@weasel-js/labkit 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -7
- package/dist/_dts/{CanvasStackContext-CJNMS6mz.d.ts → CanvasStackContext-DQgcH1ny.d.ts} +1 -1
- package/dist/_dts/LayerList.d-2c9yup5Y.d.ts +83 -0
- package/dist/_dts/{PrefsForm.d-DPy9I8It.d.ts → PrefsRow.d-DFpPIeIC.d.ts} +16 -1
- package/dist/_dts/{Select.d-Gwr8fLpK.d.ts → Select.d-BchGMC2Y.d.ts} +129 -12
- package/dist/_dts/{frac-B4okC2lX.d.ts → frac-DTRq7Xpb.d.ts} +31 -13
- package/dist/_dts/inDialog-D5ZKGjiD.d.ts +23 -0
- package/dist/_dts/{index-CSJoj4LC.d.ts → index-B0--8PEM.d.ts} +5 -4
- package/dist/_dts/index-DINmCuLA.d.ts +453 -0
- package/dist/_dts/number.d-OeQYQoUO.d.ts +28 -0
- package/dist/_dts/{types-DzoNY1pO.d.ts → types-B7y8hX1D.d.ts} +6 -6
- package/dist/_dts/{usePanZoom-Pzf9f2jh.d.ts → usePanZoom-Bq73pwFe.d.ts} +4 -47
- package/dist/_dts/{useTrialState-uLlmaccn.d.ts → useTrialState-CP4jfuKl.d.ts} +1 -1
- package/dist/canvas/index.d.ts +6 -5
- package/dist/canvas/index.js +1 -1
- package/dist/chrome/index.d.ts +5 -4
- package/dist/chrome/index.js +7 -7
- package/dist/chunk-2RVCB2PT.js +3 -0
- package/dist/chunk-2RVCB2PT.js.map +1 -0
- package/dist/{chunk-UN4U4P63.js → chunk-3FI7Y4R4.js} +9 -9
- package/dist/chunk-3FI7Y4R4.js.map +1 -0
- package/dist/{chunk-7PFH3CNM.js → chunk-AWH3SRPW.js} +31 -5
- package/dist/chunk-AWH3SRPW.js.map +1 -0
- package/dist/{chunk-ZDHY47EV.js → chunk-BVL7Y574.js} +25 -9
- package/dist/chunk-BVL7Y574.js.map +1 -0
- package/dist/{chunk-IHUVQ3TX.js → chunk-H5VIV7MQ.js} +31 -27
- package/dist/chunk-H5VIV7MQ.js.map +1 -0
- package/dist/chunk-HFRE4QQV.js +400 -0
- package/dist/chunk-HFRE4QQV.js.map +1 -0
- package/dist/{chunk-IXTQI7JX.js → chunk-MOLIUNVH.js} +4 -4
- package/dist/{chunk-IXTQI7JX.js.map → chunk-MOLIUNVH.js.map} +1 -1
- package/dist/{chunk-CEIUBPPW.js → chunk-TT5C5S6R.js} +3 -86
- package/dist/chunk-TT5C5S6R.js.map +1 -0
- package/dist/chunk-USO6TERP.js +90 -0
- package/dist/chunk-USO6TERP.js.map +1 -0
- package/dist/{chunk-PHK4W562.js → chunk-VQ47KWD5.js} +3 -3
- package/dist/{chunk-PHK4W562.js.map → chunk-VQ47KWD5.js.map} +1 -1
- package/dist/chunk-WUJXJC5O.js +14568 -0
- package/dist/chunk-WUJXJC5O.js.map +1 -0
- package/dist/{chunk-EHGVROVV.js → chunk-ZORVNOKX.js} +6 -25
- package/dist/chunk-ZORVNOKX.js.map +1 -0
- package/dist/config/index.d.ts +53 -11
- package/dist/config/index.js +5 -5
- package/dist/controls/index.d.ts +6 -3
- package/dist/controls/index.js +4 -4
- package/dist/dragdrop/index.d.ts +4 -3
- package/dist/index.d.ts +139 -114
- package/dist/index.js +470 -479
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +6 -35
- package/dist/layers/index.js +2 -3
- package/dist/loupe/index.d.ts +6 -5
- package/dist/passthrough/weasel-ui.d.ts +421 -215
- package/dist/passthrough/weasel-ui.js +1 -1
- package/dist/primitives/index.d.ts +2 -13
- package/dist/primitives/index.js +4 -4
- package/dist/state/index.d.ts +6 -5
- package/dist/state/index.js +5 -5
- package/dist/styles.css +410 -190
- package/dist/undo/index.d.ts +4 -3
- package/package.json +9 -13
- package/src/annotations/frac.test.ts +7 -0
- package/src/annotations/paint.test.ts +21 -0
- package/src/annotations/paint.ts +12 -0
- package/src/annotations/store.test.ts +31 -0
- package/src/annotations/types.ts +3 -2
- package/src/canvas/Stage.test.tsx +18 -0
- package/src/canvas/index.ts +0 -9
- package/src/chrome/labTypes.ts +1 -1
- package/src/chrome/regions/PaletteRegion.test.tsx +18 -0
- package/src/chrome/regions/PaletteRegion.tsx +5 -4
- package/src/chrome/regions/SidebarRegion.less +197 -0
- package/src/chrome/regions/SidebarRegion.test.tsx +20 -0
- package/src/chrome/regions/SidebarRegion.tsx +7 -2
- package/src/chrome/regions/TitleBarRegion.tsx +1 -1
- package/src/chrome/types.ts +13 -4
- package/src/config/autoConfig.ts +2 -2
- package/src/config/builder.ts +23 -5
- package/src/config/entry.test.ts +8 -0
- package/src/config/index.ts +2 -0
- package/src/config/rules.ts +2 -0
- package/src/config/sectionTree.test.ts +146 -0
- package/src/config/sectionTree.ts +124 -0
- package/src/config/types.ts +4 -4
- package/src/controls/AutoControls.stories.tsx +6 -6
- package/src/controls/ControlPanel.less +27 -0
- package/src/controls/ControlPanel.stories.tsx +95 -1
- package/src/controls/ControlPanel.test.tsx +82 -112
- package/src/controls/ControlPanel.tsx +159 -396
- package/src/controls/inDialog.test.tsx +82 -0
- package/src/controls/inDialog.tsx +46 -0
- package/src/controls/index.ts +1 -0
- package/src/index.test.ts +0 -2
- package/src/index.ts +14 -35
- package/src/instrument/types.ts +5 -2
- package/src/lab/Lab.nebula.test.tsx +31 -0
- package/src/lab/Lab.tsx +57 -18
- package/src/lab/LabBoundary.test.tsx +66 -0
- package/src/lab/LabBoundary.tsx +56 -0
- package/src/lab/LabHeader.tsx +4 -23
- package/src/lab/LabRoot.tsx +2 -3
- package/src/lab/LabShell.less +0 -1
- package/src/lab/LabShell.stories.tsx +15 -0
- package/src/lab/LabShell.test.tsx +18 -0
- package/src/lab/LabShell.tsx +14 -1
- package/src/lab/LabSwitcher.less +1 -1
- package/src/lab/LabSwitcher.test.tsx +41 -0
- package/src/lab/LabSwitcher.tsx +30 -8
- package/src/lab/index.ts +1 -0
- package/src/layers/AGENTS.md +18 -74
- package/src/layers/index.ts +4 -2
- package/src/passthrough/weasel-ui.ts +25 -10
- package/src/primitives/FpsMeter.less +6 -1
- package/src/primitives/FpsMeter.test.tsx +12 -4
- package/src/primitives/FpsMeter.tsx +6 -1
- package/src/primitives/JobProgress.stories.tsx +1 -1
- package/src/primitives/StatusBar.less +6 -0
- package/src/primitives/index.ts +0 -2
- package/src/specimen/Specimen.tsx +42 -56
- package/src/state/types.ts +8 -2
- package/src/state/view.test.ts +4 -4
- package/src/styles.less +4 -2
- package/src/theme/Interstellar.stories.tsx +8 -9
- package/src/theme/base.less +3 -20
- package/src/theme/interstellar.test.ts +6 -3
- package/src/theme/interstellar.theme.json +0 -56
- package/src/theme/interstellar.ts +2 -2
- package/src/trial/Trial.canvas.test.tsx +9 -5
- package/src/trial/Trial.config.test.tsx +1 -1
- package/src/trial/Trial.tsx +30 -8
- package/dist/_dts/index-BNdz-tNd.d.ts +0 -423
- package/dist/chunk-7PFH3CNM.js.map +0 -1
- package/dist/chunk-CEIUBPPW.js.map +0 -1
- package/dist/chunk-EH7UEQV7.js +0 -590
- package/dist/chunk-EH7UEQV7.js.map +0 -1
- package/dist/chunk-EHGVROVV.js.map +0 -1
- package/dist/chunk-IHUVQ3TX.js.map +0 -1
- package/dist/chunk-MDVTK5U3.js +0 -170
- package/dist/chunk-MDVTK5U3.js.map +0 -1
- package/dist/chunk-PJ7WEQBJ.js +0 -18
- package/dist/chunk-PJ7WEQBJ.js.map +0 -1
- package/dist/chunk-T3EC2DXD.js +0 -12628
- package/dist/chunk-T3EC2DXD.js.map +0 -1
- package/dist/chunk-UN4U4P63.js.map +0 -1
- package/dist/chunk-ZDHY47EV.js.map +0 -1
- package/dist/ui/layers/index.d.ts +0 -66
- package/dist/ui/layers/index.js +0 -3
- package/dist/ui/layers/index.js.map +0 -1
- package/src/canvas/useOrbit.test.ts +0 -167
- package/src/canvas/useOrbit.ts +0 -156
- package/src/lab/useSystemMode.ts +0 -30
- package/src/layers/LayerList.less +0 -93
- package/src/layers/LayerList.stories.tsx +0 -66
- package/src/layers/LayerList.test.tsx +0 -232
- package/src/layers/LayerList.tsx +0 -268
- package/src/primitives/Sidebar.less +0 -112
- package/src/primitives/Sidebar.stories.tsx +0 -38
- package/src/primitives/Sidebar.test.tsx +0 -74
- package/src/primitives/Sidebar.tsx +0 -35
- package/src/ui/layers/index.ts +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/useRovingTabIndex.ts","../src/primitives/Toolbar.tsx","../src/primitives/fpsAverage.ts","../src/primitives/FpsMeter.tsx","../src/primitives/ScaleIndicator.tsx","../src/primitives/ZoomControl.tsx","../src/primitives/StatusBar.tsx"],"names":["useRef","useEffect","jsx","jsxs","b","g"],"mappings":";;;;;;AAUO,SAAS,SAAA,CACd,OAAA,EACA,GAAA,EACA,KAAA,EACA,cAAiC,YAAA,EAClB;AACf,EAAA,IAAI,KAAA,KAAU,GAAG,OAAO,IAAA;AACxB,EAAA,MAAM,OAAA,GAAU,WAAA,KAAgB,UAAA,GAAa,WAAA,GAAc,YAAA;AAC3D,EAAA,MAAM,IAAA,GAAO,WAAA,KAAgB,UAAA,GAAa,SAAA,GAAY,WAAA;AACtD,EAAA,IAAI,GAAA,KAAQ,OAAA,EAAS,OAAA,CAAQ,OAAA,GAAU,CAAA,IAAK,KAAA;AAC5C,EAAA,IAAI,GAAA,KAAQ,IAAA,EAAM,OAAA,CAAQ,OAAA,GAAU,IAAI,KAAA,IAAS,KAAA;AACjD,EAAA,IAAI,GAAA,KAAQ,QAAQ,OAAO,CAAA;AAC3B,EAAA,IAAI,GAAA,KAAQ,KAAA,EAAO,OAAO,KAAA,GAAQ,CAAA;AAClC,EAAA,OAAO,IAAA;AACT;AAQO,SAAS,iBAAA,CACd,cAAiC,YAAA,EACjC;AACA,EAAA,MAAM,GAAA,GAAM,OAAiB,IAAI,CAAA;AACjC,EAAA,MAAM,IAAA,GAAO,OAAO,CAAC,CAAA;AAErB,E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AAAA,oBAGAF,GAAAA;AAAA,MAACG,EAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,gBAAA;AAAA,QACV,KAAA,EAAM,KAAA;AAAA,QACN,YAAA,EAAW,MAAA;AAAA,QACX,KAAA,EAAO,IAAA;AAAA,QACP,QAAA,EAAU,GAAA;AAAA,QACV,QAAA,EAAU,GAAA;AAAA,QACV,IAAA,EAAM,IAAA;AAAA,QACN,YAAA,EAAY,IAAA;AAAA,QACZ,KAAA,EAAK,IAAA;AAAA,QACL,aAAA,EAAe,EAAE,KAAA,EAAO,SAAA,EAAW,uBAAuB,CAAA,EAAE;AAAA,QAC5D,QAAA,EAAU,CAAC,IAAA,KAAS;AAClB,UAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA,EAAG;AAC5B,UAAA,MAAA,CAAO,KAAA,CAAM,IAAA,EAAM,GAAA,EAAK,GAAG,CAAC,CAAA;AAAA,QAC9B;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;ACzEO,SAAS,SAAA,CAAU,EAAE,QAAA,EAAS,EAAmB;AACtD,EAAA,uBAAOH,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBAAiB,QAAA,EAAS,CAAA;AAClD;AAQA,SAAS,OAAA,CAAQ,EAAE,QAAA,EAAU,GAAA,EAAI,EAA0B;AACzD,EAAA,uBACEA,IAAC,MAAA,EAAA,EAAK,SAAA,EAAW,wBAAwB,GAAA,GAAM,6BAAA,GAAgC,EAAE,CAAA,CAAA,EAC9E,QAAA,EACH,CAAA;AAEJ;AAGA,SAAA,CAAU,OAAA,GAAU,OAAA","file":"chunk-UN4U4P63.js","sourcesContent":["import { type KeyboardEvent, useCallback, useEffect, useRef } from 'react';\n\n/** Which axis a toolbar's arrow keys walk. Matches `aria-orientation`. */\nexport type RovingOrientation = 'horizontal' | 'vertical';\n\n/** Where a key takes focus within `count` items, or null if it does not move it.\n *\n * Only the arrows on the toolbar's own axis move focus — APG leaves the\n * cross-axis arrows to the page, so a vertical strip does not swallow\n * ArrowLeft. `Home` / `End` work on both. */\nexport function nextIndex(\n current: number,\n key: string,\n count: number,\n orientation: RovingOrientation = 'horizontal',\n): number | null {\n if (count === 0) return null;\n const forward = orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';\n const back = orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';\n if (key === forward) return (current + 1) % count;\n if (key === back) return (current - 1 + count) % count;\n if (key === 'Home') return 0;\n if (key === 'End') return count - 1;\n return null;\n}\n\n/**\n * The APG roving-tabindex contract: exactly one item in the tab order, arrows\n * moving focus within. `tabIndex` is written onto the DOM nodes rather than\n * threaded through props, because the items are arbitrary children — the\n * container never sees them as a list it could index.\n */\nexport function useRovingTabIndex<T extends HTMLElement>(\n orientation: RovingOrientation = 'horizontal',\n) {\n const ref = useRef<T | null>(null);\n const stop = useRef(0);\n\n const items = useCallback(\n (): HTMLElement[] =>\n ref.current\n ? Array.from(\n ref.current.querySelectorAll<HTMLElement>('button:not([disabled]), [role=\"button\"]'),\n )\n : [],\n [],\n );\n\n const setTabStop = useCallback(\n (index: number) => {\n const found = items();\n const at = Math.min(Math.max(index, 0), Math.max(found.length - 1, 0));\n stop.current = at;\n for (const [i, el] of found.entries()) el.tabIndex = i === at ? 0 : -1;\n },\n [items],\n );\n\n // Re-establish the tab stop whenever the item set changes — a trial's toolbar\n // contributions are dynamic, and `disabled` moves a button in and out of the\n // set without touching the child list. The focused item keeps the stop.\n useEffect(() => {\n const resync = () => {\n const focused = items().indexOf(document.activeElement as HTMLElement);\n setTabStop(focused === -1 ? stop.current : focused);\n };\n resync();\n if (!ref.current) return;\n const mo = new MutationObserver(resync);\n mo.observe(ref.current, { childList: true, subtree: true, attributeFilter: ['disabled'] });\n return () => mo.disconnect();\n }, [items, setTabStop]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<T>) => {\n const found = items();\n const current = found.indexOf(document.activeElement as HTMLElement);\n const next = nextIndex(current === -1 ? 0 : current, e.key, found.length, orientation);\n if (next === null) return;\n e.preventDefault();\n found[next]?.focus();\n setTabStop(next);\n },\n [items, setTabStop, orientation],\n );\n\n return { ref, onKeyDown };\n}\n","import type { MouseEventHandler, ReactNode } from 'react';\nimport { useRovingTabIndex } from './useRovingTabIndex';\n\n/** Props for `<Toolbar>`. */\nexport interface ToolbarProps {\n children: ReactNode;\n /** Names the toolbar for assistive tech. Required by the APG pattern when a\n * view holds more than one. */\n 'aria-label'?: string;\n}\n\n/** A horizontal bar of controls. Fill it with `<Toolbar.Title>`,\n * `<Toolbar.Group>`, `<Toolbar.Button>` and `<Toolbar.Spacer>`. */\nexport function Toolbar({ children, 'aria-label': ariaLabel }: ToolbarProps) {\n const { ref, onKeyDown } = useRovingTabIndex<HTMLDivElement>();\n return (\n <div\n ref={ref}\n className=\"lk-toolbar\"\n role=\"toolbar\"\n aria-label={ariaLabel}\n onKeyDown={onKeyDown}\n >\n {children}\n </div>\n );\n}\n\ninterface TitleProps {\n children: ReactNode;\n}\nfunction Title({ children }: TitleProps) {\n return <span className=\"lk-toolbar-title\">{children}</span>;\n}\n\n/** Props for `<Toolbar.Group>`. */\nexport interface ToolbarGroupProps {\n children: ReactNode;\n /** Pushes this group, and everything after it, to the far end. */\n end?: boolean;\n 'aria-label'?: string;\n}\n\n/** Related controls, kept tight and ruled off from their neighbors. Group\n * rather than separate with repeated `<Toolbar.Spacer>`: consecutive spacers\n * share the free space, so every gap collapses to the same slack and the bar\n * reads as one undifferentiated run. */\nfunction Group({ children, end, 'aria-label': ariaLabel }: ToolbarGroupProps) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a group inside role=\"toolbar\" is the APG pattern; the rule is local and cannot see the parent. <fieldset> means form controls, needs a <legend> to be named, and its UA min-width breaks flex children.\n <div\n className={`lk-toolbar-group${end ? ' lk-toolbar-group--end' : ''}`}\n role=\"group\"\n aria-label={ariaLabel}\n >\n {children}\n </div>\n );\n}\n\n/** Props for `<Toolbar.Button>`. */\nexport interface ToolbarButtonProps {\n children: ReactNode;\n onClick: MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n title?: string;\n /** Required when `children` is an icon with no text of its own. */\n 'aria-label'?: string;\n /** `danger` reddens on hover — for actions that discard work. */\n variant?: 'default' | 'danger';\n /** Square, for a button whose whole content is one glyph. */\n iconOnly?: boolean;\n /** Makes this a toggle: `aria-pressed`, and held down while true. */\n pressed?: boolean;\n}\n\nfunction Button({\n children,\n onClick,\n disabled,\n title,\n 'aria-label': ariaLabel,\n variant = 'default',\n iconOnly,\n pressed,\n}: ToolbarButtonProps) {\n const cls = [\n 'lk-toolbar-button',\n variant === 'danger' && 'lk-toolbar-button--danger',\n iconOnly && 'lk-toolbar-button--icon',\n pressed && 'lk-toolbar-button--pressed',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <button\n type=\"button\"\n className={cls}\n onClick={onClick}\n disabled={disabled}\n title={title}\n aria-label={ariaLabel ?? title}\n aria-pressed={pressed}\n >\n {children}\n </button>\n );\n}\n\nfunction Spacer() {\n return <span className=\"lk-toolbar-spacer\" aria-hidden=\"true\" />;\n}\n\n/** A label within a toolbar. */\nToolbar.Title = Title;\n/** A ruled-off run of related controls. */\nToolbar.Group = Group;\n/** A button within a toolbar. */\nToolbar.Button = Button;\n/** Flexible space that pushes what follows to the far end of the toolbar. */\nToolbar.Spacer = Spacer;\n","export function rollingAverage(samples: readonly number[]): number {\n if (samples.length === 0) return 0;\n const sum = samples.reduce((acc, n) => acc + n, 0);\n return Math.round(sum / samples.length);\n}\n","import { useVisibleRaf } from '@weasel-js/core';\nimport { useEffect, useRef, useState } from 'react';\nimport { rollingAverage } from './fpsAverage';\n\nconst SAMPLE_WINDOW = 30;\n\n/** A live frame-rate readout, averaged over the last 30 frames. */\nexport function FpsMeter() {\n const [fps, setFps] = useState(0);\n const samplesRef = useRef<number[]>([]);\n const lastTimeRef = useRef<number | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const loop = useVisibleRaf(\n (time) => {\n const last = lastTimeRef.current;\n if (last !== null) {\n const delta = time - last;\n if (delta > 0) {\n const samples = samplesRef.current;\n samples.push(1000 / delta);\n if (samples.length > SAMPLE_WINDOW) samples.shift();\n setFps(rollingAverage(samples));\n }\n }\n lastTimeRef.current = time;\n loop.request();\n },\n {\n target: rootRef,\n // The gap spent suspended is not a frame that took an hour to draw.\n onResume: () => {\n lastTimeRef.current = null;\n },\n },\n );\n\n useEffect(() => {\n loop.request();\n return () => loop.cancel();\n }, [loop]);\n\n return (\n <div className=\"lk-fps-meter\" ref={rootRef}>\n <span className=\"lk-fps-meter-value\">FPS {fps}</span>\n </div>\n );\n}\n","import { useContext } from 'react';\nimport { CanvasStackContext } from '../canvas/CanvasStackContext';\n\n/** Props for `<ScaleIndicator>`. */\nexport interface ScaleIndicatorProps {\n /** Current view zoom factor. If omitted, reads from CanvasStackContext. Defaults to 1. */\n zoom?: number;\n /** World pixels per unit at zoom=1. Default: 1. */\n pixelsPerUnit?: number;\n /** Unit label. Default: 'px'. */\n unit?: string;\n /** Target bar width in display pixels. Default: 100. */\n targetWidth?: number;\n}\n\n// Rounds n to a \"nice\" number — 1, 2, 5, 10, 20, 50, ...\nfunction niceNumber(n: number): number {\n if (n <= 0) return 1;\n const exp = Math.floor(Math.log10(n));\n const fraction = n / 10 ** exp;\n let nice: number;\n if (fraction < 1.5) nice = 1;\n else if (fraction < 3.5) nice = 2;\n else if (fraction < 7.5) nice = 5;\n else nice = 10;\n return nice * 10 ** exp;\n}\n\n/** A scale bar: a labeled rule showing how far a round number of world units\n * is at the current zoom. Reads the zoom from the surrounding canvas stack\n * unless one is passed. */\nexport function ScaleIndicator({\n zoom,\n pixelsPerUnit = 1,\n unit = 'px',\n targetWidth = 100,\n}: ScaleIndicatorProps) {\n const ctxValue = useContext(CanvasStackContext);\n const effectiveZoom = zoom ?? ctxValue?.view.zoom ?? 1;\n const effectivePxPerUnit = pixelsPerUnit * effectiveZoom;\n const targetUnits = targetWidth / effectivePxPerUnit;\n const niceUnits = niceNumber(targetUnits);\n const barWidth = niceUnits * effectivePxPerUnit;\n return (\n <div className=\"lk-scale-indicator\" role=\"img\" aria-label={`Scale: ${niceUnits} ${unit}`}>\n <div className=\"lk-scale-indicator-bar\" style={{ width: `${barWidth}px` }} />\n <span className=\"lk-scale-indicator-label\">\n {niceUnits} {unit}\n </span>\n </div>\n );\n}\n","import { normalizeZoom } from '@weasel-js/core';\nimport { NumberField, Slider } from '../passthrough/weasel-ui';\n\n/** Props for `<ZoomControl>`. */\nexport interface ZoomControlProps {\n /** Current zoom as a scale factor: 1 is actual size. */\n zoom: number;\n /** Fired continuously while the slider drags. */\n onZoomChange: (zoom: number) => void;\n /** Fired when a drag settles or the field is committed. Defaults to\n * `onZoomChange`. */\n onZoomCommit?: (zoom: number) => void;\n /** Smallest selectable zoom. Defaults to 0.1 (10%). */\n min?: number;\n /** Largest selectable zoom. Defaults to 8 (800%). */\n max?: number;\n className?: string;\n}\n\n// Zoom is perceptually geometric — halving is as big a step as doubling — so\n// the slider runs on log2 and 100% lands mid-track for a symmetric range.\nconst toTrack = (zoom: number): number => Math.log2(zoom);\nconst fromTrack = (v: number): number => 2 ** v;\n\nconst clamp = (v: number, lo: number, hi: number): number => Math.max(lo, Math.min(hi, v));\n\n/** Zoom as a log-scaled slider with an editable percentage beside it. Pair it\n * with zoom-in / zoom-out buttons in a `<Toolbar.Group>`; this component owns\n * only the continuous part. */\nexport function ZoomControl({\n zoom,\n onZoomChange,\n onZoomCommit,\n min: minProp = 0.1,\n max: maxProp = 8,\n className,\n}: ZoomControlProps) {\n const min = normalizeZoom(minProp);\n const max = normalizeZoom(maxProp);\n const commit = onZoomCommit ?? onZoomChange;\n const emit = (track: number, done: boolean): void => {\n const next = clamp(fromTrack(track), min, max);\n (done ? commit : onZoomChange)(next);\n };\n\n return (\n <div className={`lk-zoom${className ? ` ${className}` : ''}`}>\n <Slider\n className=\"lk-zoom__slider\"\n ariaLabel=\"Zoom\"\n density=\"slim\"\n min={toTrack(min)}\n max={toTrack(max)}\n // Detents at the octaves plus actual size, so 25/50/100/200/400% are\n // reachable by drag rather than only by typing.\n stops={[-2, -1, 0, 1, 2]}\n thumbs={[{ value: clamp(toTrack(zoom), toTrack(min), toTrack(max)) }]}\n onInput={(next) => emit(next[0].value, false)}\n onChange={(next) => emit(next[0].value, true)}\n readoutPlacement=\"none\"\n />\n {/* `style: 'percent'` formats a fraction, so the field carries the scale\n factor itself and renders 0.5 as \"50%\". */}\n <NumberField\n className=\"lk-zoom__field\"\n width=\"fit\"\n aria-label=\"Zoom\"\n value={zoom}\n minValue={min}\n maxValue={max}\n step={0.01}\n hideSteppers\n ghost\n formatOptions={{ style: 'percent', maximumFractionDigits: 0 }}\n onChange={(next) => {\n if (!Number.isFinite(next)) return;\n commit(clamp(next, min, max));\n }}\n />\n </div>\n );\n}\n","import type { ReactNode } from 'react';\n\n/** Props for `<StatusBar>`. */\nexport interface StatusBarProps {\n children: ReactNode;\n}\n\n/** A footer strip for readouts. Fill it with `<StatusBar.Section>`. */\nexport function StatusBar({ children }: StatusBarProps) {\n return <div className=\"lk-status-bar\">{children}</div>;\n}\n\n/** Props for `<StatusBar.Section>`. */\nexport interface StatusBarSectionProps {\n children: ReactNode;\n /** Pushes this section, and everything after it, to the far end. */\n end?: boolean;\n}\nfunction Section({ children, end }: StatusBarSectionProps) {\n return (\n <span className={`lk-status-bar-section${end ? ' lk-status-bar-section--end' : ''}`}>\n {children}\n </span>\n );\n}\n\n/** One readout within a status bar. */\nStatusBar.Section = Section;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/builder.ts","../src/config/rules.ts","../src/config/resolve.ts","../src/config/useResolvedConfig.ts"],"names":[],"mappings":";;;;AAmBO,SAAS,eAAe,KAAA,EAA2C;AACxE,EAAA,OAAO,UAAA,IAAc,KAAA;AACvB;AAIO,IAAe,WAAf,MAAoD;AAAA,EAOzD,YACE,YAAA,EACS,WAAA,GAAqC,EAA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weasel-js/ui';\nimport { type Auto, isAuto } from './auto';\nimport type {\n Annotations,\n BranchAnnotations,\n BranchOptions,\n ConfigBranch,\n ConfigEntry,\n ConfigNode,\n ConfigOption,\n ConfigSchema,\n ConfigShape,\n ControlRenderer,\n InferConfig,\n NodeOptions,\n SectionOption,\n} from './types';\n\n/** Whether a schema entry is a branch rather than a leaf. */\nexport function isConfigBranch(entry: ConfigEntry): entry is ConfigBranch {\n return 'children' in entry;\n}\n\n/** Shared chaining surface. Every method clones, so a node can be reused as a\n * base for several leaves without one bleeding into the next. */\nexport abstract class BaseNode<T> implements ConfigNode<T> {\n abstract readonly kind: string | null;\n\n // `default` is a reserved word in a parameter position, so the field is\n // declared rather than taken as a parameter property.\n readonly default: T;\n\n constructor(\n defaultValue: T,\n readonly annotations: Readonly<Annotations> = {},\n readonly options: Readonly<NodeOptions> = {},\n ) {\n this.default = defaultValue;\n }\n\n /** Clone into the same subclass. Subclasses with extra constructor\n * arguments override this. */\n protected with(annotations: Annotations, options: NodeOptions): this {\n const Ctor = this.constructor as new (d: T, a: Annotations, o: NodeOptions) => this;\n return new Ctor(this.default, annotations, options);\n }\n\n protected ann(patch: Annotations): this {\n return this.with({ ...this.annotations, ...patch }, this.options);\n }\n\n protected opt(patch: NodeOptions): this {\n return this.with(this.annotations, { ...this.options, ...patch });\n }\n\n /** Human-readable label. Defaults to the key, title-cased. */\n label(name: string): this {\n return this.ann({ name });\n }\n\n /** Longer help text, surfaced as a tooltip on the row label. */\n describe(description: string): this {\n return this.ann({ description });\n }\n\n /** Omit from the panel unless it is asked to show hidden leaves. */\n hidden(): this {\n return this.ann({ hidden: true });\n }\n\n /** Pair with a sibling sharing this id, side-by-side on one row. */\n pair(pair: string): this {\n return this.ann({ pair });\n }\n\n /** Render under a named section heading. `collapsed` opens the section\n * folded, and `layout` and `pack` lay out its rows — say each on any one of\n * the section's leaves. */\n section(label: string, opts: Omit<SectionOption, 'label'> = {}): this {\n return this.opt({ section: { label, ...opts } });\n }\n\n /** Show this row only while the predicate holds. Presentational — the value\n * stays in config and the instrument still reads it. */\n showIf(predicate: (config: Record<string, unknown>) => boolean): this {\n return this.opt({ showIf: predicate });\n }\n\n /** Draw this one row yourself, keeping the kind, default and validation. */\n render(renderer: ControlRenderer): this {\n return this.opt({ render: renderer });\n }\n\n /**\n * Compute this leaf's value while it is auto, instead of leaving it\n * `undefined`. The resolver is given the config with every other auto path\n * already resolved.\n */\n auto(resolve: (config: Record<string, unknown>) => T): this {\n return this.opt({ autoResolve: resolve as (c: Record<string, unknown>) => unknown });\n }\n\n /**\n * Start this leaf auto rather than pinned at its default. Takes `auto` and\n * nothing else — the constructor argument already declares the value, and a\n * second way to say it would fight with the first.\n */\n initial(value: Auto): this {\n if (!isAuto(value)) throw new Error('[labkit] .initial() takes `auto` and nothing else');\n return this.opt({ unpinned: true });\n }\n\n /** Never auto. The row takes no pin dot and ignores the gesture. */\n manual(): this {\n return this.opt({ manual: true });\n }\n}\n\nexport class NumberNode extends BaseNode<number> {\n readonly kind = 'number';\n\n /** Bound the value. A number with both bounds renders as a slider. */\n range(min: number, max: number): this {\n return this.ann({ min, max });\n }\n\n step(step: number): this {\n return this.ann({ step });\n }\n\n /** A display suffix for the value — `'px'`, `'ms'`, `'°'`. Presentation only:\n * it is never parsed, and the stored value stays a plain number. */\n suffix(suffix: string): this {\n return this.ann({ suffix });\n }\n\n /** Show the value in a named format — `'compact'` reads `2.0M`. Presentation\n * only: the stored value stays a plain number, and a typed `2.5m` reads back. */\n format(format: PrefNumberFormat): this {\n return this.ann({ format });\n }\n\n /**\n * Store the value in one unit and edit it in another — radians stored,\n * degrees typed. `min`, `max` and `step` are declared in the stored unit\n * alongside the value, and convert with it. `prefUnit` builds one from a\n * `UnitSystem`.\n */\n unit(unit: PrefNumberUnit): this {\n return this.ann({ unit });\n }\n\n /** Force a slider even without both bounds. */\n slider(): this {\n return this.ann({ control: 'slider' });\n }\n\n /** Force a typed input even when both bounds are set. */\n input(): this {\n return this.ann({ control: 'input' });\n }\n}\n\nexport class BooleanNode extends BaseNode<boolean> {\n readonly kind = 'boolean';\n\n /** Ask for a switch rather than a checkbox. */\n toggle(): this {\n return this.ann({ control: 'switch' });\n }\n}\n\nexport class StringNode extends BaseNode<string> {\n readonly kind = 'string';\n\n placeholder(placeholder: string): this {\n return this.ann({ placeholder });\n }\n\n maxLength(maxLength: number): this {\n return this.ann({ maxLength });\n }\n\n /** Milliseconds to debounce live writes. 0 commits every keystroke. */\n debounce(debounceMs: number): this {\n return this.ann({ debounceMs });\n }\n}\n\nexport class ColorNode extends BaseNode<string> {\n readonly kind = 'color';\n\n /** The value carries alpha as `#rrggbbaa`, and the row gets an opacity\n * track beside the swatch. */\n alpha(): this {\n return this.ann({ alpha: true });\n }\n}\n\nexport class EnumNode<T extends string> extends BaseNode<T> {\n readonly kind = 'enum';\n\n /** Render as a segmented control rather than a select. */\n radio(): this {\n return this.ann({ control: 'radio' });\n }\n\n /** Relabel the choices. Named `labels` rather than `options` because\n * `options` is the node's own extras bag. */\n labels(options: readonly ConfigOption[]): this {\n return this.ann({ options });\n }\n}\n\n/** A leaf whose kind the rule chain decides. */\nexport class ValueNode<T> extends BaseNode<T> {\n readonly kind = null;\n}\n\n/** A leaf of a kind labkit does not ship a row for. */\nexport class CustomNode<T> extends BaseNode<T> {\n constructor(\n readonly kind: string,\n defaultValue: T,\n annotations: Readonly<Annotations> = {},\n options: Readonly<NodeOptions> = {},\n ) {\n super(defaultValue, annotations, options);\n }\n\n protected override with(annotations: Annotations, options: NodeOptions): this {\n return new CustomNode(this.kind, this.default, annotations, options) as this;\n }\n}\n\n/**\n * A branch of the schema: its children nest under its key, so a leaf inside\n * one is read and written at a dotted path. Distinct from `.section()`, which\n * puts a heading over sibling leaves and leaves their paths alone.\n */\nexport class GroupNode<S extends ConfigShape> implements ConfigBranch<S> {\n constructor(\n readonly children: S,\n readonly annotations: Readonly<BranchAnnotations> = {},\n readonly options: Readonly<BranchOptions> = {},\n ) {}\n\n private with(annotations: BranchAnnotations, options: BranchOptions): GroupNode<S> {\n return new GroupNode(this.children, annotations, options);\n }\n\n /** Heading for the group's rows. Defaults to the key, title-cased. */\n label(name: string): GroupNode<S> {\n return this.with({ ...this.annotations, name }, this.options);\n }\n\n /** Longer help text. Carried on the resolved `PrefGroup`, where weasel-ui's\n * `PrefsForm` draws it under the heading; `ControlPanel` has no place for\n * it yet and shows the heading alone. */\n describe(description: string): GroupNode<S> {\n return this.with({ ...this.annotations, description }, this.options);\n }\n\n /** Render this whole group under a named section heading. */\n section(label: string, opts: Omit<SectionOption, 'label'> = {}): GroupNode<S> {\n return this.with(this.annotations, { ...this.options, section: { label, ...opts } });\n }\n\n /** Show this group only while the predicate holds. Presentational — every\n * value beneath it stays in config and the instrument still reads it. */\n showIf(predicate: (config: Record<string, unknown>) => boolean): GroupNode<S> {\n return this.with(this.annotations, { ...this.options, showIf: predicate });\n }\n}\n\n/** Every default in a shape, nested the way the shape is. */\nfunction shapeDefaults(shape: ConfigShape): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(shape)) {\n out[key] = isConfigBranch(entry) ? shapeDefaults(entry.children) : entry.default;\n }\n return out;\n}\n\nconst expand = <T extends string>(\n options: readonly T[] | readonly ConfigOption[],\n): readonly ConfigOption[] =>\n options.map((o) => (typeof o === 'string' ? { value: o, label: o } : o));\n\n/**\n * Builds an instrument's config: the values, their types, and how each is\n * edited, in one declaration.\n *\n * ```ts\n * const config = f.schema({\n * showGrid: f.boolean(true),\n * cellSize: f.number(20).range(5, 80).step(5).label('Grid spacing'),\n * // Nested: read and written at `grid.color`.\n * grid: f.group({ color: f.color('#ffffff') }),\n * })\n * ```\n */\nexport const f = {\n number: (def: number): NumberNode => new NumberNode(def),\n boolean: (def: boolean): BooleanNode => new BooleanNode(def),\n string: (def: string): StringNode => new StringNode(def),\n color: (def: string): ColorNode => new ColorNode(def),\n\n /** A fixed set of choices. The default's literal type flows into the config\n * type, so `f.enum('fast', ['fast', 'accurate'])` gives\n * `'fast' | 'accurate'` with no `as const`. */\n enum: <const T extends string>(\n def: T,\n options: readonly T[] | readonly ConfigOption[],\n ): EnumNode<T> => new EnumNode<T>(def, { options: expand(options) }),\n\n /** A leaf with no declared kind: the rule chain decides, which is how a lab\n * states a convention like \"every `*Color` key is a color picker\". */\n value: <T>(def: T): ValueNode<T> => new ValueNode(def),\n\n /** A branch: its children nest under this key, so `grid: f.group({ size })`\n * puts the value at `config.grid.size` and addresses it as `'grid.size'`.\n * Groups nest as deeply as the schema wants. */\n group: <const S extends ConfigShape>(children: S): GroupNode<S> => new GroupNode(children),\n\n /** A leaf of a kind a lab supplies the control for, through `controls`. */\n custom: <T>(\n kind: string,\n def: T,\n validate?: (leaf: PrefLeaf, config: Record<string, unknown>) => string[],\n ): CustomNode<T> => new CustomNode(kind, def, {}, validate ? { validate } : {}),\n\n /** Collect leaves and groups into an instrument's config. */\n schema<S extends ConfigShape>(nodes: S): ConfigSchema<InferConfig<S>> {\n return { nodes, defaults: () => shapeDefaults(nodes) as InferConfig<S> };\n },\n};\n","import type { ConfigRule, ConfigRuleContext, LeafPatch } from './types';\n\n/** `cellSize` -> `Cell size`. Splits camelCase without shattering acronyms. */\nexport function titleCase(key: string): string {\n const words = key\n .replace(/[_-]+/g, ' ')\n .split(/(?<=[a-z0-9])(?=[A-Z])/)\n .join(' ')\n .trim()\n .toLowerCase();\n return words.length === 0 ? words : words[0].toUpperCase() + words.slice(1);\n}\n\n/** An `f.value` leaf takes its kind from the shape of its default. */\nconst kindFromValue: ConfigRule = (ctx) => {\n const t = typeof ctx.default;\n if (t === 'boolean' || t === 'number' || t === 'string') return { kind: t };\n return null;\n};\n\nconst labelFromKey: ConfigRule = (ctx) => ({ name: titleCase(ctx.key) });\n\n/** A number bounded on both sides is a slider; one bound or none is an input. */\nconst sliderWhenBounded: ConfigRule = (ctx) => {\n if (ctx.leaf.kind !== 'number') return null;\n const bounded = ctx.leaf.min !== undefined && ctx.leaf.max !== undefined;\n return bounded ? { control: 'slider' } : null;\n};\n\n/** `PrefBase.description` is required, so every leaf must end up with one. */\nconst descriptionDefault: ConfigRule = () => ({ description: '' });\n\n/**\n * labkit's own inference, expressed in the same vocabulary a consumer\n * extends. Runs after the consumer's rules, so a lab always wins.\n *\n * If one of these ever needs something a `ConfigRule` cannot express, the\n * seam is too weak — that is the point of writing them this way.\n */\nexport const builtinRules: readonly ConfigRule[] = [\n kindFromValue,\n labelFromKey,\n sliderWhenBounded,\n descriptionDefault,\n];\n\n/**\n * Fold a rule chain into one leaf patch. Gap-filling: a property already\n * settled is never overwritten, so the accumulator seeded with the author's\n * annotations beats every rule, and earlier rules beat later ones.\n */\nexport function applyRules(\n seed: LeafPatch,\n ctx: Omit<ConfigRuleContext, 'leaf'>,\n rules: readonly ConfigRule[],\n): LeafPatch {\n const acc: LeafPatch = { ...seed };\n for (const rule of rules) {\n const patch = rule({ ...ctx, leaf: acc });\n if (patch === null) continue;\n for (const [k, v] of Object.entries(patch)) {\n if (v !== undefined && acc[k as keyof LeafPatch] === undefined) {\n (acc as Record<string, unknown>)[k] = v;\n }\n }\n }\n return acc;\n}\n","import type { PrefGroup, PrefLeaf } from '@weasel-js/ui';\nimport { isConfigBranch } from './builder';\nimport { applyRules, builtinRules, titleCase } from './rules';\nimport type {\n ConfigEntry,\n ConfigRule,\n ConfigSchema,\n ConfigShape,\n ControlRenderer,\n LeafPatch,\n ResolvedConfig,\n SectionSpec,\n} from './types';\n\n/** Drop keys whose value is undefined, so an unset annotation stays a gap the\n * rule chain can fill rather than a settled `undefined`. */\nfunction defined(annotations: Record<string, unknown>): LeafPatch {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(annotations)) if (v !== undefined) out[k] = v;\n return out as LeafPatch;\n}\n\n/** What the walk collects on the side of the `PrefGroup` tree. */\ninterface Sink {\n sections: SectionSpec[];\n showIf: Map<string, (config: Record<string, unknown>) => boolean>;\n renderers: Record<string, ControlRenderer>;\n chain: readonly ConfigRule[];\n}\n\n/**\n * Resolve a schema into the vocabulary weasel-ui renders, running each leaf\n * through the consumer's rules and then labkit's own.\n *\n * The group mirrors the schema's own nesting: an `f.group` becomes a nested\n * `PrefGroup`, so a leaf's dotted path within the tree is the path its value\n * is written at, and both `ControlPanel` and `PrefsForm` address it\n * identically.\n */\nexport function resolveConfigSchema<TC>(\n schema: ConfigSchema<TC>,\n rules: readonly ConfigRule[] = [],\n): ResolvedConfig {\n const sink: Sink = {\n sections: [],\n showIf: new Map(),\n renderers: {},\n chain: [...rules, ...builtinRules],\n };\n const group = resolveShape(schema.nodes, '', '', sink);\n return { group, sections: sink.sections, showIf: sink.showIf, renderers: sink.renderers };\n}\n\n/** A section while it is still being filled. */\ntype OpenSection = Omit<SectionSpec, 'paths'> & { paths: string[] };\n\nfunction resolveShape(shape: ConfigShape, at: string, name: string, sink: Sink): PrefGroup {\n const children: Record<string, PrefLeaf | PrefGroup> = {};\n const sections = new Map<string, OpenSection>();\n\n for (const [key, entry] of Object.entries(shape)) {\n const path = at === '' ? key : `${at}.${key}`;\n children[key] = resolveEntry(entry, key, path, sink);\n\n const { section, showIf: predicate } = entry.options;\n if (section !== undefined) {\n let spec = sections.get(section.label);\n if (!spec) {\n spec = { at, label: section.label, paths: [] };\n sections.set(section.label, spec);\n sink.sections.push(spec);\n }\n spec.paths.push(path);\n // One node saying `collapsed` settles the section, so a schema does not\n // have to repeat it on every node under the heading.\n if (section.collapsed !== undefined) {\n spec.collapsed = (spec.collapsed ?? false) || section.collapsed;\n }\n if (section.layout !== undefined && spec.layout === undefined) spec.layout = section.layout;\n if (section.pack !== undefined && spec.pack === undefined) spec.pack = section.pack;\n }\n if (predicate) sink.showIf.set(path, predicate);\n if (!isConfigBranch(entry) && entry.options.render) sink.renderers[path] = entry.options.render;\n }\n\n return { name, children };\n}\n\nfunction resolveEntry(\n entry: ConfigEntry,\n key: string,\n path: string,\n sink: Sink,\n): PrefLeaf | PrefGroup {\n if (isConfigBranch(entry)) {\n const group = resolveShape(\n entry.children,\n path,\n entry.annotations.name ?? titleCase(key),\n sink,\n );\n return entry.annotations.description === undefined\n ? group\n : { ...group, description: entry.annotations.description };\n }\n if (entry.options.manual && entry.options.unpinned) {\n throw new Error(\n `[labkit] \"${path}\" is both .manual() and .initial(auto) — a field that can never be auto cannot start auto`,\n );\n }\n const seed: LeafPatch = defined({\n ...entry.annotations,\n ...(entry.kind === null ? {} : { kind: entry.kind }),\n });\n const patch = applyRules(seed, { key, path, default: entry.default }, sink.chain);\n const { autoResolve, unpinned, manual } = entry.options;\n return {\n ...patch,\n default: entry.default,\n // Extra keys survive onto the leaf at runtime; `ControlPanel` reads them\n // back with its `extra<T>` helper, the same as `min`, `step` and the rest.\n ...(autoResolve === undefined ? {} : { autoResolve }),\n ...(unpinned === undefined ? {} : { unpinned }),\n ...(manual === undefined ? {} : { manual }),\n } as PrefLeaf;\n}\n","import { useMemo } from 'react';\nimport { resolveAutoConfig } from './autoConfig';\nimport type { ResolvedConfig } from './types';\n\nconst NONE: ReadonlySet<string> = new Set();\n\n/**\n * The config an instrument reads: the stored one with every unpinned path\n * resolved. The single place resolution happens, so `Trial` and\n * `useTrialState` cannot disagree about what an instrument is looking at.\n */\nexport function useResolvedConfig<TC>(\n schema: ResolvedConfig | undefined,\n config: TC,\n autoPaths: readonly string[] | undefined,\n): { config: TC; auto: ReadonlySet<string> } {\n const auto = useMemo(\n () => (autoPaths && autoPaths.length > 0 ? new Set(autoPaths) : NONE),\n [autoPaths],\n );\n const resolvedConfig = useMemo(\n () => (schema ? resolveAutoConfig(schema, config, auto) : config),\n [schema, config, auto],\n );\n return { config: resolvedConfig, auto };\n}\n"]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
/** One card in a layer stack: its identity, the label shown when collapsed,
|
|
5
|
-
* and the optional select hoisted into its header. */
|
|
6
|
-
interface LayerStackItem {
|
|
7
|
-
/** Stable id used for keys, onRemove, onReorder. Numeric to match
|
|
8
|
-
* common id-from-nextId conventions; string ids also work. */
|
|
9
|
-
id: number | string;
|
|
10
|
-
/** Short kind label rendered in the header when no primary select
|
|
11
|
-
* is hoisted (e.g. "shadow", "stroke"). Omit it for items that have no
|
|
12
|
-
* kind; `label` then names the card. */
|
|
13
|
-
kind?: string;
|
|
14
|
-
/** Header text, when the item's name is not its kind. Falls back to
|
|
15
|
-
* `kind`. */
|
|
16
|
-
label?: string;
|
|
17
|
-
/** When present, hoist this select into the card header so the user
|
|
18
|
-
* can switch mode/shape without expanding. */
|
|
19
|
-
primaryValue?: string;
|
|
20
|
-
primaryOptions?: string[];
|
|
21
|
-
/** Accent CSS color used as the left border / index-badge fill. Sets
|
|
22
|
-
* --wzl-layer-stack-accent on the card, which re-binds --wzl-accent
|
|
23
|
-
* for everything inside it. */
|
|
24
|
-
accent?: string;
|
|
25
|
-
/** Optional badge text rendered before the primary control
|
|
26
|
-
* (e.g. tail index "1", "2", "3"). When omitted a drag handle
|
|
27
|
-
* glyph renders in its place. */
|
|
28
|
-
badge?: string;
|
|
29
|
-
/** Initial expanded state. Defaults to true for newly-added items. */
|
|
30
|
-
defaultExpanded?: boolean;
|
|
31
|
-
}
|
|
32
|
-
/** Props for `<LayerStack>`. */
|
|
33
|
-
interface LayerStackProps {
|
|
34
|
-
/** Heading above the list. Omit it, along with the palette, for a stack
|
|
35
|
-
* whose surroundings already name it. */
|
|
36
|
-
title?: string;
|
|
37
|
-
items: LayerStackItem[];
|
|
38
|
-
/** Kinds the user can add via the header palette. Omit both this and
|
|
39
|
-
* `onAdd` for a stack the user cannot add to. */
|
|
40
|
-
paletteKinds?: string[];
|
|
41
|
-
onAdd?: (kind: string) => void;
|
|
42
|
-
/** Omit for items the user cannot remove; the card then has no ✕. */
|
|
43
|
-
onRemove?: (id: number | string) => void;
|
|
44
|
-
onReorder: (orderedIds: Array<number | string>) => void;
|
|
45
|
-
/** Required for `primaryValue` to render as a select — without a handler
|
|
46
|
-
* the control could not be changed. */
|
|
47
|
-
onPrimaryChange?: (id: number | string, nextValue: string) => void;
|
|
48
|
-
/** Render the body controls for each item. */
|
|
49
|
-
renderBody: (item: LayerStackItem) => ReactNode;
|
|
50
|
-
/** Shown in place of the list when `items` is empty. Defaults to a line
|
|
51
|
-
* that points at the palette, or a bare one when there is no palette. */
|
|
52
|
-
emptyLabel?: ReactNode;
|
|
53
|
-
/** Hide the title + palette row (used when an outer wrap renders its
|
|
54
|
-
* own head — see speech-balloons Tails panel). */
|
|
55
|
-
hideHead?: boolean;
|
|
56
|
-
/** Appended to the root element's class list. The module's own class names
|
|
57
|
-
* are hashed, so this is the supported way to reach the stack from a
|
|
58
|
-
* consumer stylesheet. */
|
|
59
|
-
className?: string;
|
|
60
|
-
}
|
|
61
|
-
/** A drag-reorderable stack of expandable cards, with a palette in the header
|
|
62
|
-
* for adding more. The body of each card is the caller's to render. */
|
|
63
|
-
declare function LayerStack({ className, title, items, paletteKinds, onAdd, onRemove, onReorder, onPrimaryChange, renderBody, emptyLabel, hideHead, }: LayerStackProps): react_jsx_runtime.JSX.Element;
|
|
64
|
-
|
|
65
|
-
export { LayerStack };
|
|
66
|
-
export type { LayerStackItem, LayerStackProps };
|
package/dist/ui/layers/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { act, renderHook } from '@testing-library/react';
|
|
2
|
-
import type { PointerEvent as ReactPointerEvent } from 'react';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import {
|
|
5
|
-
clampPitch,
|
|
6
|
-
type OrbitView,
|
|
7
|
-
orbitAfterDrag,
|
|
8
|
-
orbitAfterWheel,
|
|
9
|
-
PITCH_LIMIT,
|
|
10
|
-
useOrbit,
|
|
11
|
-
wrapYaw,
|
|
12
|
-
} from './useOrbit';
|
|
13
|
-
|
|
14
|
-
const view = { yaw: 0, pitch: 0, distance: 5, target: { x: 0, y: 0, z: 0 } };
|
|
15
|
-
|
|
16
|
-
describe('clampPitch', () => {
|
|
17
|
-
it('stops just short of the poles, where azimuth becomes undefined', () => {
|
|
18
|
-
expect(clampPitch(Math.PI)).toBeCloseTo(PITCH_LIMIT);
|
|
19
|
-
expect(clampPitch(-Math.PI)).toBeCloseTo(-PITCH_LIMIT);
|
|
20
|
-
expect(PITCH_LIMIT).toBeLessThan(Math.PI / 2);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('leaves an in-range pitch alone', () => {
|
|
24
|
-
expect(clampPitch(0.3)).toBe(0.3);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('wrapYaw', () => {
|
|
29
|
-
it('wraps into (-PI, PI] so a value cannot drift without bound', () => {
|
|
30
|
-
expect(wrapYaw(3 * Math.PI)).toBeCloseTo(Math.PI);
|
|
31
|
-
expect(wrapYaw(-3 * Math.PI)).toBeCloseTo(Math.PI);
|
|
32
|
-
expect(wrapYaw(0.5)).toBeCloseTo(0.5);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('keeps a full turn equivalent to no turn', () => {
|
|
36
|
-
expect(wrapYaw(2 * Math.PI)).toBeCloseTo(0);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('orbitAfterDrag', () => {
|
|
41
|
-
it('turns horizontal movement into yaw and vertical into pitch', () => {
|
|
42
|
-
const next = orbitAfterDrag(view, 100, 50);
|
|
43
|
-
expect(next.yaw).not.toBe(view.yaw);
|
|
44
|
-
expect(next.pitch).not.toBe(view.pitch);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('is absolute against the drag start, so re-applying does not compound', () => {
|
|
48
|
-
const once = orbitAfterDrag(view, 100, 50);
|
|
49
|
-
const twice = orbitAfterDrag(view, 100, 50);
|
|
50
|
-
expect(twice).toEqual(once);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('clamps pitch rather than tumbling past the pole', () => {
|
|
54
|
-
const next = orbitAfterDrag(view, 0, 100_000);
|
|
55
|
-
expect(Math.abs(next.pitch)).toBeLessThanOrEqual(PITCH_LIMIT);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('leaves distance and target untouched', () => {
|
|
59
|
-
const next = orbitAfterDrag(view, 100, 50);
|
|
60
|
-
expect(next.distance).toBe(view.distance);
|
|
61
|
-
expect(next.target).toEqual(view.target);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe('orbitAfterWheel', () => {
|
|
66
|
-
it('moves the camera in and out', () => {
|
|
67
|
-
expect(orbitAfterWheel(view, 100, 0.5, 50).distance).toBeGreaterThan(view.distance);
|
|
68
|
-
expect(orbitAfterWheel(view, -100, 0.5, 50).distance).toBeLessThan(view.distance);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('is multiplicative, so a step feels the same at every distance', () => {
|
|
72
|
-
const near = orbitAfterWheel({ ...view, distance: 2 }, 100, 0.5, 50);
|
|
73
|
-
const far = orbitAfterWheel({ ...view, distance: 20 }, 100, 0.5, 50);
|
|
74
|
-
expect(far.distance / 20).toBeCloseTo(near.distance / 2);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('honours its bounds', () => {
|
|
78
|
-
expect(orbitAfterWheel(view, 100_000, 0.5, 50).distance).toBe(50);
|
|
79
|
-
expect(orbitAfterWheel(view, -100_000, 0.5, 50).distance).toBe(0.5);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
/** The fields `useOrbit` reads off a React pointerdown, plus the element the
|
|
84
|
-
* session hangs its document listeners off. */
|
|
85
|
-
function press(
|
|
86
|
-
el: HTMLElement,
|
|
87
|
-
x: number,
|
|
88
|
-
y: number,
|
|
89
|
-
init: { pointerId?: number; button?: number; buttons?: number } = {},
|
|
90
|
-
): ReactPointerEvent<HTMLElement> {
|
|
91
|
-
return {
|
|
92
|
-
pointerId: init.pointerId ?? 1,
|
|
93
|
-
button: init.button ?? 0,
|
|
94
|
-
buttons: init.buttons ?? 1,
|
|
95
|
-
clientX: x,
|
|
96
|
-
clientY: y,
|
|
97
|
-
currentTarget: el,
|
|
98
|
-
} as unknown as ReactPointerEvent<HTMLElement>;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function dispatchOn(target: EventTarget, type: string, init: PointerEventInit) {
|
|
102
|
-
act(() => {
|
|
103
|
-
target.dispatchEvent(new PointerEvent(type, { pointerId: 1, bubbles: true, ...init }));
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function dragSetup() {
|
|
108
|
-
let current: OrbitView = view;
|
|
109
|
-
const onViewChange = (v: OrbitView) => {
|
|
110
|
-
current = v;
|
|
111
|
-
};
|
|
112
|
-
const { result, unmount } = renderHook(() => useOrbit({ view, onViewChange }));
|
|
113
|
-
const el = document.createElement('div');
|
|
114
|
-
document.body.appendChild(el);
|
|
115
|
-
return { result, unmount, el, getView: () => current };
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
describe('useOrbit dragging', () => {
|
|
119
|
-
it('turns from a move the element never sees', () => {
|
|
120
|
-
const { result, el, getView } = dragSetup();
|
|
121
|
-
act(() => result.current.onPointerDown(press(el, 100, 100)));
|
|
122
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 200, clientY: 150 });
|
|
123
|
-
expect(getView()).toEqual(orbitAfterDrag(view, 100, 50));
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('ends the drag on a release dispatched off the element', () => {
|
|
127
|
-
const { result, el, getView } = dragSetup();
|
|
128
|
-
act(() => result.current.onPointerDown(press(el, 100, 100)));
|
|
129
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 200, clientY: 150 });
|
|
130
|
-
dispatchOn(document, 'pointerup', { clientX: 200, clientY: 150 });
|
|
131
|
-
expect(result.current.isDragging()).toBe(false);
|
|
132
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 400, clientY: 400 });
|
|
133
|
-
expect(getView()).toEqual(orbitAfterDrag(view, 100, 50));
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// The other half of the rule — a detached origin does cancel — is owned by
|
|
137
|
-
// pointerSession.test.ts, which exercises it without React in the way.
|
|
138
|
-
it('keeps turning when capture is lost and the element is still in the document', () => {
|
|
139
|
-
const { result, el, getView } = dragSetup();
|
|
140
|
-
act(() => result.current.onPointerDown(press(el, 100, 100)));
|
|
141
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 200, clientY: 150 });
|
|
142
|
-
// Chrome releases capture a beat before it delivers pointerup, so ending
|
|
143
|
-
// here throws away a release that has already been dispatched.
|
|
144
|
-
dispatchOn(el, 'lostpointercapture', {});
|
|
145
|
-
expect(result.current.isDragging()).toBe(true);
|
|
146
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 400, clientY: 400 });
|
|
147
|
-
expect(getView()).toEqual(orbitAfterDrag(view, 300, 300));
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('reads a move with nothing held as the release that never arrived', () => {
|
|
151
|
-
const { result, el, getView } = dragSetup();
|
|
152
|
-
act(() => result.current.onPointerDown(press(el, 100, 100, { buttons: 1 })));
|
|
153
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 200, clientY: 150 });
|
|
154
|
-
expect(getView()).toEqual(orbitAfterDrag(view, 100, 50));
|
|
155
|
-
dispatchOn(document, 'pointermove', { buttons: 0, clientX: 400, clientY: 400 });
|
|
156
|
-
expect(getView()).toEqual(orbitAfterDrag(view, 100, 50));
|
|
157
|
-
expect(result.current.isDragging()).toBe(false);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('drops its listeners when the hook unmounts mid-drag', () => {
|
|
161
|
-
const { result, el, unmount, getView } = dragSetup();
|
|
162
|
-
act(() => result.current.onPointerDown(press(el, 100, 100)));
|
|
163
|
-
unmount();
|
|
164
|
-
dispatchOn(document, 'pointermove', { buttons: 1, clientX: 400, clientY: 400 });
|
|
165
|
-
expect(getView()).toEqual(view);
|
|
166
|
-
});
|
|
167
|
-
});
|
package/src/canvas/useOrbit.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { openPointerSession, type PointerSession } from '@weasel-js/core';
|
|
2
|
-
import {
|
|
3
|
-
type PointerEvent as ReactPointerEvent,
|
|
4
|
-
useCallback,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
type WheelEvent,
|
|
8
|
-
} from 'react';
|
|
9
|
-
|
|
10
|
-
/** A point in the space the instrument works in. */
|
|
11
|
-
export interface Vec3 {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
z: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** An orbit camera as a trial view: where it looks from, and what it looks at.
|
|
18
|
-
* labkit does not turn this into a matrix — the host's renderer does. */
|
|
19
|
-
export interface OrbitView {
|
|
20
|
-
yaw: number;
|
|
21
|
-
pitch: number;
|
|
22
|
-
distance: number;
|
|
23
|
-
target: Vec3;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Just short of the pole. At exactly ±PI/2 the azimuth is undefined and the
|
|
27
|
-
* camera rolls, which reads as the model jumping rather than as a limit. */
|
|
28
|
-
export const PITCH_LIMIT = Math.PI / 2 - 0.01;
|
|
29
|
-
|
|
30
|
-
const YAW_PER_PX = 0.008;
|
|
31
|
-
const PITCH_PER_PX = 0.008;
|
|
32
|
-
const DISTANCE_PER_NOTCH = 0.0015;
|
|
33
|
-
const DRAG_THRESHOLD = 3;
|
|
34
|
-
|
|
35
|
-
export function clampPitch(pitch: number): number {
|
|
36
|
-
return Math.min(PITCH_LIMIT, Math.max(-PITCH_LIMIT, pitch));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function wrapYaw(yaw: number): number {
|
|
40
|
-
const wrapped = ((((yaw + Math.PI) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI)) - Math.PI;
|
|
41
|
-
return wrapped === -Math.PI ? Math.PI : wrapped;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** The view a drag of (dx, dy) from `start` produces. Absolute against the drag
|
|
45
|
-
* start, so it can be re-applied any number of times without compounding. */
|
|
46
|
-
export function orbitAfterDrag(start: OrbitView, dx: number, dy: number): OrbitView {
|
|
47
|
-
return {
|
|
48
|
-
...start,
|
|
49
|
-
yaw: wrapYaw(start.yaw + dx * YAW_PER_PX),
|
|
50
|
-
pitch: clampPitch(start.pitch + dy * PITCH_PER_PX),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Multiplicative, so one notch covers the same proportion of the distance
|
|
55
|
-
* whether the camera is near or far. */
|
|
56
|
-
export function orbitAfterWheel(
|
|
57
|
-
view: OrbitView,
|
|
58
|
-
deltaY: number,
|
|
59
|
-
minDistance: number,
|
|
60
|
-
maxDistance: number,
|
|
61
|
-
): OrbitView {
|
|
62
|
-
const factor = Math.exp(deltaY * DISTANCE_PER_NOTCH);
|
|
63
|
-
return {
|
|
64
|
-
...view,
|
|
65
|
-
distance: Math.min(maxDistance, Math.max(minDistance, view.distance * factor)),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface UseOrbitOptions {
|
|
70
|
-
view: OrbitView;
|
|
71
|
-
onViewChange: (v: OrbitView) => void;
|
|
72
|
-
/** Restored on double-click. Defaults to the view the hook first saw. */
|
|
73
|
-
home?: OrbitView;
|
|
74
|
-
minDistance?: number;
|
|
75
|
-
maxDistance?: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface OrbitHandlers {
|
|
79
|
-
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
80
|
-
onPointerDown: (e: ReactPointerEvent<HTMLElement>) => void;
|
|
81
|
-
onDoubleClick: () => void;
|
|
82
|
-
isDragging: () => boolean;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
interface DragState {
|
|
86
|
-
startX: number;
|
|
87
|
-
startY: number;
|
|
88
|
-
startView: OrbitView;
|
|
89
|
-
moved: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Pointer gestures over an orbit view: drag to turn, wheel or pinch to dolly,
|
|
93
|
-
* double-click to go home. The 3D peer of `usePanZoom`. */
|
|
94
|
-
export function useOrbit({
|
|
95
|
-
view,
|
|
96
|
-
onViewChange,
|
|
97
|
-
home,
|
|
98
|
-
minDistance = 0.1,
|
|
99
|
-
maxDistance = 1000,
|
|
100
|
-
}: UseOrbitOptions): OrbitHandlers {
|
|
101
|
-
const dragRef = useRef<DragState | null>(null);
|
|
102
|
-
const sessionRef = useRef<PointerSession | null>(null);
|
|
103
|
-
const viewRef = useRef(view);
|
|
104
|
-
viewRef.current = view;
|
|
105
|
-
const onViewChangeRef = useRef(onViewChange);
|
|
106
|
-
onViewChangeRef.current = onViewChange;
|
|
107
|
-
const homeRef = useRef(home ?? view);
|
|
108
|
-
if (home) homeRef.current = home;
|
|
109
|
-
|
|
110
|
-
const onWheel = useCallback(
|
|
111
|
-
(e: WheelEvent<HTMLElement>) => {
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
onViewChange(orbitAfterWheel(viewRef.current, e.deltaY, minDistance, maxDistance));
|
|
114
|
-
},
|
|
115
|
-
[onViewChange, minDistance, maxDistance],
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const clearDrag = useCallback(() => {
|
|
119
|
-
dragRef.current = null;
|
|
120
|
-
sessionRef.current = null;
|
|
121
|
-
}, []);
|
|
122
|
-
|
|
123
|
-
const onPointerDown = useCallback(
|
|
124
|
-
(e: ReactPointerEvent<HTMLElement>) => {
|
|
125
|
-
if (e.button !== 0) return;
|
|
126
|
-
const drag: DragState = {
|
|
127
|
-
startX: e.clientX,
|
|
128
|
-
startY: e.clientY,
|
|
129
|
-
startView: viewRef.current,
|
|
130
|
-
moved: false,
|
|
131
|
-
};
|
|
132
|
-
dragRef.current = drag;
|
|
133
|
-
sessionRef.current = openPointerSession(e.currentTarget, e, {
|
|
134
|
-
onMove: (ev) => {
|
|
135
|
-
const dx = ev.clientX - drag.startX;
|
|
136
|
-
const dy = ev.clientY - drag.startY;
|
|
137
|
-
if (!drag.moved && Math.hypot(dx, dy) < DRAG_THRESHOLD) return;
|
|
138
|
-
drag.moved = true;
|
|
139
|
-
onViewChangeRef.current(orbitAfterDrag(drag.startView, dx, dy));
|
|
140
|
-
},
|
|
141
|
-
onEnd: clearDrag,
|
|
142
|
-
// A cancelled turn keeps where it got to: every move was committed as
|
|
143
|
-
// it arrived, so there is nothing left to undo.
|
|
144
|
-
onCancel: clearDrag,
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
[clearDrag],
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
useEffect(() => () => sessionRef.current?.cancel(), []);
|
|
151
|
-
|
|
152
|
-
const onDoubleClick = useCallback(() => onViewChange(homeRef.current), [onViewChange]);
|
|
153
|
-
const isDragging = useCallback(() => dragRef.current?.moved === true, []);
|
|
154
|
-
|
|
155
|
-
return { onWheel, onPointerDown, onDoubleClick, isDragging };
|
|
156
|
-
}
|
package/src/lab/useSystemMode.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import type { LabMode } from '../state/types';
|
|
3
|
-
|
|
4
|
-
function query(): MediaQueryList | null {
|
|
5
|
-
if (typeof window === 'undefined' || !window.matchMedia) return null;
|
|
6
|
-
return window.matchMedia('(prefers-color-scheme: light)');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Resolve a `LabMode` to the mode the theme resolver understands.
|
|
11
|
-
*
|
|
12
|
-
* `auto` is not a mode — it means "read the OS", live. An explicit choice
|
|
13
|
-
* opts out of the subscription entirely.
|
|
14
|
-
*/
|
|
15
|
-
export function useResolvedMode(mode: LabMode): 'light' | 'dark' {
|
|
16
|
-
const [system, setSystem] = useState<'light' | 'dark'>(() =>
|
|
17
|
-
query()?.matches ? 'light' : 'dark',
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (mode !== 'auto') return;
|
|
22
|
-
const mq = query();
|
|
23
|
-
if (!mq) return;
|
|
24
|
-
const onChange = (e: MediaQueryListEvent) => setSystem(e.matches ? 'light' : 'dark');
|
|
25
|
-
mq.addEventListener('change', onChange);
|
|
26
|
-
return () => mq.removeEventListener('change', onChange);
|
|
27
|
-
}, [mode]);
|
|
28
|
-
|
|
29
|
-
return mode === 'auto' ? system : mode;
|
|
30
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// No padding of its own: whatever mounts the list insets it. The sidebar
|
|
2
|
-
// section body already does, and a second inset here put the grip 22px off a
|
|
3
|
-
// 161px-wide sidebar's edge.
|
|
4
|
-
.lk-layer-list {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 1px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.lk-layer-list__empty {
|
|
11
|
-
color: var(--wzl-fg-muted);
|
|
12
|
-
font-size: var(--wzl-font-size-sm);
|
|
13
|
-
font-style: italic;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.lk-layer-list__row {
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
gap: var(--wzl-space-xs);
|
|
20
|
-
padding: 1px 2px;
|
|
21
|
-
border-radius: var(--wzl-radius-sm);
|
|
22
|
-
user-select: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.lk-layer-list__row:hover {
|
|
26
|
-
background: var(--wzl-surface-hover);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.lk-layer-list__row--dragging {
|
|
30
|
-
background: var(--wzl-surface-pressed);
|
|
31
|
-
opacity: 0.7;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.lk-layer-list__row--pinned {
|
|
35
|
-
opacity: 0.7;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Prefixed with `.lk-root` to outrank base.less's `:where(button)` default,
|
|
39
|
-
// which would otherwise wrap this grip in a 24px chrome box with a border, an
|
|
40
|
-
// elevated fill and 12px of side padding — around a glyph a third that size.
|
|
41
|
-
.lk-root .lk-layer-list__handle {
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
height: auto;
|
|
45
|
-
// Transparent, so the grab target is comfortable while nothing but the dots
|
|
46
|
-
// is drawn. The negative margin keeps it from widening the row.
|
|
47
|
-
padding: 4px;
|
|
48
|
-
margin: -4px;
|
|
49
|
-
border: 0;
|
|
50
|
-
border-radius: 0;
|
|
51
|
-
background: transparent;
|
|
52
|
-
backdrop-filter: none;
|
|
53
|
-
-webkit-backdrop-filter: none;
|
|
54
|
-
cursor: grab;
|
|
55
|
-
color: var(--wzl-fg-muted);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.lk-root .lk-layer-list__handle:hover {
|
|
59
|
-
color: var(--wzl-fg);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.lk-layer-list__handle:active {
|
|
63
|
-
cursor: grabbing;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.lk-layer-list__lock {
|
|
67
|
-
color: var(--wzl-fg-muted);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.lk-layer-list__label {
|
|
71
|
-
flex: 1;
|
|
72
|
-
font-size: var(--wzl-font-size-sm);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.lk-layer-list input[type='checkbox'] {
|
|
76
|
-
accent-color: var(--wzl-accent);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.lk-layer-list__children {
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
gap: 1px;
|
|
83
|
-
// Indents by the twisty column, so a child's own twisty starts where its
|
|
84
|
-
// parent's label does.
|
|
85
|
-
padding-left: var(--wzl-space-md);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Holds the twisty column open on rows that have nothing to expand, so labels
|
|
89
|
-
// line up down the level.
|
|
90
|
-
.lk-layer-list__twisty-gap {
|
|
91
|
-
flex: 0 0 auto;
|
|
92
|
-
width: var(--wzl-disclosure-target, 20px);
|
|
93
|
-
}
|