2022-01-29 18:24:36 +01:00
|
|
|
import { linkClasses, Chevron } from 'shared/components/navigation/primary.js'
|
2022-02-12 14:31:17 +01:00
|
|
|
import ViewMenu from './view.js'
|
2022-01-25 12:39:29 +01:00
|
|
|
import DesignOptions from './design-options'
|
2022-01-27 12:26:56 +01:00
|
|
|
import CoreSettings from './core-settings'
|
2022-01-29 14:51:13 +01:00
|
|
|
import Xray from './xray'
|
2022-02-12 15:23:37 +01:00
|
|
|
import TestDesignOptions from './test-design-options'
|
2022-01-25 12:39:29 +01:00
|
|
|
|
2022-01-29 18:24:36 +01:00
|
|
|
export const Ul = props => <ul className="pl-5 list-inside">{props.children}</ul>
|
2022-01-30 12:21:08 +01:00
|
|
|
export const Li = props => (
|
|
|
|
<li className="flex flex-row hover:border-r-2 hover:border-r-secondary">
|
|
|
|
{props.children}
|
|
|
|
</li>
|
|
|
|
)
|
2022-01-29 18:24:36 +01:00
|
|
|
export const Details = props => (
|
|
|
|
<details className="grow" open={props.open || false}>
|
|
|
|
{props.children}
|
|
|
|
</details>
|
|
|
|
)
|
|
|
|
export const Deg = props => <span className="text-3xl inline-block p-0 leading-3 px-2 translate-y-3">°</span>
|
2022-01-29 21:31:12 +01:00
|
|
|
export const NoSumDiv = props => (
|
|
|
|
<div className={`
|
|
|
|
grow px-2 ml-2 border-l-2
|
|
|
|
${linkClasses}
|
|
|
|
hover:cursor-resize
|
|
|
|
hover:border-secondary
|
|
|
|
sm:hover:border-secondary-focus
|
2022-05-14 14:53:29 +02:00
|
|
|
text-base-content sm:text-base-content
|
2022-01-29 21:31:12 +01:00
|
|
|
`}>{props.children}</div>
|
|
|
|
)
|
2022-01-29 18:24:36 +01:00
|
|
|
export const SumDiv = props => (
|
|
|
|
<div className={`
|
|
|
|
grow pl-2 border-l-2
|
|
|
|
${linkClasses}
|
|
|
|
hover:cursor-resize
|
|
|
|
hover:border-secondary
|
|
|
|
sm:hover:border-secondary-focus
|
2022-05-14 14:53:29 +02:00
|
|
|
text-base-content sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
`}>{props.children}</div>
|
|
|
|
)
|
|
|
|
export const Summary = props => (
|
|
|
|
<summary className={`
|
|
|
|
flex flex-row
|
|
|
|
px-2
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
hover:cursor-row-resize
|
|
|
|
items-center
|
|
|
|
`}>{props.children}</summary>
|
|
|
|
)
|
|
|
|
export const TopSummary = props => (
|
|
|
|
<summary className={`
|
|
|
|
flex flex-row gap-4 text-lg
|
|
|
|
hover:cursor-row-resize
|
|
|
|
p-2
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
items-center
|
|
|
|
`}>
|
|
|
|
<span className="text-secondary-focus mr-4">{props.icon || null}</span>
|
|
|
|
{props.children}
|
|
|
|
</summary>
|
|
|
|
)
|
|
|
|
export const SumButton = props => (
|
|
|
|
<button className={`
|
|
|
|
flex flex-row
|
|
|
|
px-2
|
|
|
|
w-full justify-between
|
|
|
|
text-left
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
hover:cursor-pointer
|
|
|
|
items-center
|
|
|
|
mr-4
|
|
|
|
`} onClick={props.onClick}>{props.children}</button>
|
|
|
|
)
|
|
|
|
export const TopSumTitle = props => (
|
|
|
|
<span className={`grow ${linkClasses} hover:cursor-resize font-bold uppercase`}>
|
|
|
|
{props.children}
|
|
|
|
</span>
|
|
|
|
)
|
|
|
|
export const SecText = props => props.raw
|
2022-02-10 21:40:19 +01:00
|
|
|
? <span className="text-secondary-focus" dangerouslySetInnerHTML={{__html: props.raw}} />
|
|
|
|
: <span className="text-secondary-focus">{props.children}</span>
|
2022-01-29 18:24:36 +01:00
|
|
|
|
2022-01-25 12:39:29 +01:00
|
|
|
const WorkbenchMenu = props => {
|
|
|
|
return (
|
2022-05-14 14:53:29 +02:00
|
|
|
<nav className="grow mb-12">
|
2022-02-12 14:31:17 +01:00
|
|
|
<ViewMenu {...props} />
|
|
|
|
{props.gist?._state?.view === 'draft' && (
|
2022-01-27 12:26:56 +01:00
|
|
|
<>
|
|
|
|
<DesignOptions {...props} />
|
|
|
|
<CoreSettings {...props} />
|
2022-01-29 14:51:13 +01:00
|
|
|
{props.gist.renderer === 'react' && <Xray {...props} />}
|
2022-01-27 12:26:56 +01:00
|
|
|
</>
|
|
|
|
)}
|
2022-02-19 17:01:28 +01:00
|
|
|
{props.gist?._state?.view === 'test' && <TestDesignOptions {...props} />}
|
2022-01-25 12:39:29 +01:00
|
|
|
</nav>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default WorkbenchMenu
|