@weasel-js/labkit 1.6.1 → 1.7.1
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 -3
- package/dist/_dts/{CanvasStackContext-Wo6OwIVM.d.ts → CanvasStackContext-Cjy6I-Iv.d.ts} +4 -1
- package/dist/_dts/{Stage-DWBBi8IU.d.ts → Stage-D6t7o0pF.d.ts} +59 -18
- package/dist/_dts/{index-CKyX0ME_.d.ts → index-BTmaRy6a.d.ts} +10 -6
- package/dist/_dts/{types-B7yBTTF9.d.ts → index-DCMA4Fy1.d.ts} +59 -113
- package/dist/_dts/{types-DTuViBvc.d.ts → types-BUBSIZuV.d.ts} +18 -8
- package/dist/_dts/{useTrialState-CMaV6UD4.d.ts → useTrialState-Bh8bzFgE.d.ts} +1 -1
- package/dist/canvas/index.d.ts +8 -6
- package/dist/canvas/index.js +6 -6
- package/dist/chrome/index.d.ts +6 -4
- package/dist/chrome/index.js +11 -10
- package/dist/chunk-2ES4W47N.js +8 -0
- package/dist/chunk-2ES4W47N.js.map +1 -0
- package/dist/{chunk-WPLAANH4.js → chunk-2N7UBSS2.js} +12 -12
- package/dist/chunk-2N7UBSS2.js.map +1 -0
- package/dist/chunk-4KSC7NXL.js +15491 -0
- package/dist/chunk-4KSC7NXL.js.map +1 -0
- package/dist/{chunk-SLAQPUI4.js → chunk-CEGFXTBD.js} +10 -63
- package/dist/chunk-CEGFXTBD.js.map +1 -0
- package/dist/chunk-CZZPXUOU.js +3 -0
- package/dist/{chunk-SBXNQW4G.js.map → chunk-CZZPXUOU.js.map} +1 -1
- package/dist/{chunk-QGMOA2YE.js → chunk-E23Q6A3Y.js} +296 -104
- package/dist/chunk-E23Q6A3Y.js.map +1 -0
- package/dist/{chunk-GHGO52SO.js → chunk-E6NARGU7.js} +5 -5
- package/dist/{chunk-GHGO52SO.js.map → chunk-E6NARGU7.js.map} +1 -1
- package/dist/{chunk-IJJUK4FU.js → chunk-EESJUSYR.js} +5 -6
- package/dist/chunk-EESJUSYR.js.map +1 -0
- package/dist/{chunk-HXXTULDN.js → chunk-EFXRM6XQ.js} +8 -11
- package/dist/chunk-EFXRM6XQ.js.map +1 -0
- package/dist/chunk-F4ACIK7Z.js +210 -0
- package/dist/chunk-F4ACIK7Z.js.map +1 -0
- package/dist/{chunk-6FLXL3I7.js → chunk-FB4MIZOO.js} +77 -45
- package/dist/chunk-FB4MIZOO.js.map +1 -0
- package/dist/{chunk-AWQG7FCC.js → chunk-FG3EXZDV.js} +3 -3
- package/dist/{chunk-AWQG7FCC.js.map → chunk-FG3EXZDV.js.map} +1 -1
- package/dist/{chunk-4TT3PNPR.js → chunk-GAHELLJT.js} +95 -95
- package/dist/chunk-GAHELLJT.js.map +1 -0
- package/dist/{chunk-HKV7LRHY.js → chunk-IBVRMHW5.js} +5 -5
- package/dist/{chunk-HKV7LRHY.js.map → chunk-IBVRMHW5.js.map} +1 -1
- package/dist/{chunk-ASOK76ZH.js → chunk-JFOJESJF.js} +72 -29
- package/dist/chunk-JFOJESJF.js.map +1 -0
- package/dist/{chunk-RWNDDKOH.js → chunk-PMLZP7RT.js} +18 -15
- package/dist/chunk-PMLZP7RT.js.map +1 -0
- package/dist/{chunk-TJ77A4A3.js → chunk-READTDQX.js} +5 -9
- package/dist/chunk-READTDQX.js.map +1 -0
- package/dist/{chunk-JVBYV6TL.js → chunk-ROGJWDQA.js} +3 -3
- package/dist/{chunk-JVBYV6TL.js.map → chunk-ROGJWDQA.js.map} +1 -1
- package/dist/{chunk-CGHF6RZV.js → chunk-T6DLGEJB.js} +18 -18
- package/dist/chunk-T6DLGEJB.js.map +1 -0
- package/dist/{chunk-24W5VEJW.js → chunk-ULYYNWGP.js} +2 -2
- package/dist/{chunk-24W5VEJW.js.map → chunk-ULYYNWGP.js.map} +1 -1
- package/dist/{chunk-DWMSB4CA.js → chunk-VYVGVBGY.js} +95 -32
- package/dist/chunk-VYVGVBGY.js.map +1 -0
- package/dist/{chunk-IRTGUQ5O.js → chunk-WLMDTI2Q.js} +16 -6
- package/dist/chunk-WLMDTI2Q.js.map +1 -0
- package/dist/{chunk-NEXR37YJ.js → chunk-XE5HJOPL.js} +6 -8
- package/dist/chunk-XE5HJOPL.js.map +1 -0
- package/dist/chunk-XVUKDSYV.js +38 -0
- package/dist/chunk-XVUKDSYV.js.map +1 -0
- package/dist/{chunk-O6FFFOHS.js → chunk-YCFKW5RX.js} +16 -8
- package/dist/chunk-YCFKW5RX.js.map +1 -0
- package/dist/{chunk-CQLQPQ4P.js → chunk-ZQIHJXP4.js} +2 -2
- package/dist/chunk-ZQIHJXP4.js.map +1 -0
- package/dist/config/index.d.ts +28 -13
- package/dist/config/index.js +4 -4
- package/dist/controls/index.d.ts +4 -7
- package/dist/controls/index.js +6 -5
- package/dist/dragdrop/index.d.ts +23 -3
- package/dist/dragdrop/index.js +4 -3
- package/dist/fonts/oswald-tabular-digits.woff2 +0 -0
- package/dist/index.d.ts +72 -487
- package/dist/index.js +603 -441
- package/dist/index.js.map +1 -1
- package/dist/job/index.d.ts +8 -0
- package/dist/job/index.js +1 -1
- package/dist/layers/index.d.ts +6 -5
- package/dist/layers/index.js +3 -2
- package/dist/loupe/index.d.ts +100 -30
- package/dist/loupe/index.js +585 -6
- package/dist/loupe/index.js.map +1 -1
- package/dist/overview/index.d.ts +4 -2
- package/dist/overview/index.js +20 -18
- package/dist/overview/index.js.map +1 -1
- package/dist/passthrough/weasel-canvas.d.ts +2 -0
- package/dist/passthrough/weasel-ui.d.ts +2 -2701
- package/dist/passthrough/weasel-ui.js +4 -3
- package/dist/primitives/index.d.ts +37 -2
- package/dist/primitives/index.js +9 -8
- package/dist/state/index.d.ts +7 -5
- package/dist/state/index.js +6 -6
- package/dist/styles.css +150 -126
- package/dist/surface/index.d.ts +10 -2
- package/dist/surface/index.js +1 -1
- package/dist/undo/index.d.ts +5 -3
- package/package.json +14 -13
- package/src/annotations/AnnotationOverlay.abandon.test.tsx +143 -0
- package/src/annotations/AnnotationOverlay.tsx +52 -33
- package/src/annotations/Annotations.less +0 -10
- package/src/annotations/Annotations.overlay.test.tsx +31 -0
- package/src/annotations/MarkList.tsx +4 -8
- package/src/annotations/capture.browser.test.ts +41 -0
- package/src/annotations/capture.ts +14 -7
- package/src/annotations/drawOne.ts +2 -2
- package/src/annotations/frac.test.ts +44 -1
- package/src/annotations/frac.ts +46 -18
- package/src/annotations/index.ts +1 -0
- package/src/annotations/paint.test.ts +76 -46
- package/src/annotations/paint.ts +65 -43
- package/src/annotations/store.test.ts +212 -2
- package/src/annotations/store.ts +130 -27
- package/src/annotations/svgNodes.test.ts +28 -19
- package/src/annotations/svgNodes.ts +6 -6
- package/src/annotations/types.ts +29 -10
- package/src/canvas/AGENTS.md +1 -0
- package/src/canvas/CameraInput.test.tsx +30 -0
- package/src/canvas/CameraInput.tsx +60 -48
- package/src/canvas/CanvasStack.tsx +11 -6
- package/src/canvas/CanvasStackContext.ts +4 -1
- package/src/canvas/LinkedCursor.less +1 -1
- package/src/canvas/Stage.test.tsx +33 -4
- package/src/canvas/Stage.tsx +9 -4
- package/src/canvas/cameraRegistry.test.ts +55 -0
- package/src/canvas/cameraRegistry.ts +87 -0
- package/src/canvas/cameraZoom.test.ts +46 -0
- package/src/canvas/cameraZoom.ts +24 -0
- package/src/canvas/index.ts +14 -2
- package/src/canvas/sharedScope.test.tsx +94 -0
- package/src/canvas/worldSpec.ts +3 -1
- package/src/chrome/ChromeRegions.stories.tsx +1 -0
- package/src/chrome/builtins.test.ts +7 -6
- package/src/chrome/builtins.tsx +5 -1
- package/src/chrome/index.ts +1 -1
- package/src/chrome/merge.test.ts +5 -0
- package/src/chrome/merge.ts +4 -2
- package/src/chrome/regions/PaletteRegion.less +0 -7
- package/src/chrome/regions/PaletteRegion.test.tsx +2 -3
- package/src/chrome/regions/PaletteRegion.tsx +3 -4
- package/src/chrome/regions/SidebarRegion.less +12 -2
- package/src/chrome/regions/ViewportRegion.browser.test.less +6 -0
- package/src/chrome/regions/ViewportRegion.browser.test.tsx +38 -0
- package/src/chrome/regions/ViewportRegion.less +6 -0
- package/src/chrome/regions/ViewportRegion.tsx +10 -4
- package/src/chrome/types.ts +4 -2
- package/src/config/auto.ts +1 -0
- package/src/config/builder.test.ts +2 -1
- package/src/config/builder.ts +18 -5
- package/src/config/fromConfigField.test.ts +14 -0
- package/src/config/fromConfigField.ts +18 -4
- package/src/config/path.ts +2 -5
- package/src/config/resolve.ts +4 -0
- package/src/config/types.ts +14 -9
- package/src/controls/ControlPanel.less +1 -1
- package/src/controls/ControlPanel.stories.tsx +3 -2
- package/src/controls/ControlPanel.test.tsx +98 -11
- package/src/controls/ControlPanel.tsx +61 -2
- package/src/dragdrop/DragDropRuntime.tsx +22 -13
- package/src/dragdrop/DragGhost.tsx +3 -0
- package/src/dragdrop/Palette.tsx +2 -0
- package/src/index.test.ts +5 -0
- package/src/index.ts +16 -2
- package/src/instrument/types.ts +0 -6
- package/src/job/useJob.ts +14 -9
- package/src/lab/Lab.tsx +88 -73
- package/src/lab/{LabFit.stories.less → LabFit.browser.test.less} +1 -1
- package/src/lab/{LabFit.stories.tsx → LabFit.browser.test.tsx} +41 -63
- package/src/lab/LabFullChrome.stories.tsx +1 -0
- package/src/lab/LabHeader.test.tsx +24 -14
- package/src/lab/LabHeader.tsx +11 -12
- package/src/lab/LabShell.less +9 -17
- package/src/lab/LabSwitcher.browser.test.tsx +27 -0
- package/src/lab/LabSwitcher.less +8 -6
- package/src/lab/LabZoom.test.tsx +223 -0
- package/src/lab/LabZoom.tsx +170 -0
- package/src/lab/Workspace.tsx +48 -52
- package/src/lab/index.ts +1 -0
- package/src/loupe/AGENTS.md +28 -15
- package/src/loupe/CanvasLoupe.tsx +2 -3
- package/src/loupe/DomLoupe.tsx +1 -7
- package/src/loupe/Loupe.less +16 -0
- package/src/loupe/LoupeGestures.tsx +1 -1
- package/src/loupe/TrialLoupe.tsx +120 -57
- package/src/loupe/index.ts +1 -6
- package/src/loupe/types.test.ts +3 -3
- package/src/loupe/types.ts +24 -27
- package/src/loupe/useLoupe.test.tsx +29 -4
- package/src/loupe/useLoupe.ts +20 -17
- package/src/overview/OverviewMarks.tsx +12 -4
- package/src/overview/TrialOverview.tsx +10 -8
- package/src/passthrough/weasel-ui.test.ts +2 -0
- package/src/passthrough/weasel-ui.ts +17 -5
- package/src/primitives/FloatingPanel.test.tsx +11 -0
- package/src/primitives/FloatingPanel.tsx +8 -7
- package/src/primitives/JobProgress.less +2 -1
- package/src/primitives/Legend.stories.tsx +1 -0
- package/src/primitives/Readout.browser.test.tsx +137 -0
- package/src/primitives/Readout.less +12 -0
- package/src/primitives/Readout.stories.tsx +58 -0
- package/src/primitives/Readout.test.tsx +93 -0
- package/src/primitives/Readout.tsx +56 -0
- package/src/primitives/Split.tsx +69 -41
- package/src/primitives/Toolbar.tsx +3 -3
- package/src/primitives/ZoomControl.less +1 -2
- package/src/primitives/index.ts +2 -0
- package/src/specimen/Specimen.stories.tsx +1 -0
- package/src/specimen/Specimen.tsx +2 -3
- package/src/state/Persistence.browser.test.tsx +47 -0
- package/src/state/store.test.ts +5 -1
- package/src/state/undock.ts +3 -0
- package/src/state/useOpenOnce.ts +20 -16
- package/src/state/usePersistedState.test.tsx +1 -1
- package/src/state/view.ts +1 -0
- package/src/styles.less +1 -0
- package/src/surface/index.ts +1 -1
- package/src/surface/useTiledSurface.test.tsx +14 -0
- package/src/surface/useTiledSurface.ts +11 -3
- package/src/theme/Interstellar.stories.tsx +3 -1
- package/src/theme/base.less +21 -47
- package/src/theme/interstellar.test.ts +1 -1
- package/src/theme/interstellar.theme.json +10 -3
- package/src/trial/Trial.annotations.test.tsx +73 -0
- package/src/trial/Trial.less +0 -29
- package/src/trial/Trial.loupe.test.tsx +28 -11
- package/src/trial/Trial.tsx +85 -67
- package/src/trial/TrialChrome.tsx +27 -6
- package/src/trial/index.ts +2 -0
- package/src/trial/loupeSwitch.ts +15 -0
- package/dist/_dts/LayerList.d-BoELAMsM.d.ts +0 -83
- package/dist/_dts/PrefsRow.d-DFpPIeIC.d.ts +0 -39
- package/dist/_dts/PropertyField.d-D0ndfIIt.d.ts +0 -404
- package/dist/_dts/Select.d-Cr8-zoup.d.ts +0 -569
- package/dist/chunk-4TT3PNPR.js.map +0 -1
- package/dist/chunk-6FLXL3I7.js.map +0 -1
- package/dist/chunk-ASOK76ZH.js.map +0 -1
- package/dist/chunk-CGHF6RZV.js.map +0 -1
- package/dist/chunk-CQLQPQ4P.js.map +0 -1
- package/dist/chunk-DWMSB4CA.js.map +0 -1
- package/dist/chunk-HXXTULDN.js.map +0 -1
- package/dist/chunk-IJJUK4FU.js.map +0 -1
- package/dist/chunk-IRTGUQ5O.js.map +0 -1
- package/dist/chunk-KHK5FGER.js +0 -145
- package/dist/chunk-KHK5FGER.js.map +0 -1
- package/dist/chunk-NEXR37YJ.js.map +0 -1
- package/dist/chunk-O6FFFOHS.js.map +0 -1
- package/dist/chunk-QGMOA2YE.js.map +0 -1
- package/dist/chunk-RWNDDKOH.js.map +0 -1
- package/dist/chunk-S4NCI32V.js +0 -549
- package/dist/chunk-S4NCI32V.js.map +0 -1
- package/dist/chunk-SBXNQW4G.js +0 -3
- package/dist/chunk-SLAQPUI4.js.map +0 -1
- package/dist/chunk-TJ77A4A3.js.map +0 -1
- package/dist/chunk-TYN6MLXX.js +0 -13864
- package/dist/chunk-TYN6MLXX.js.map +0 -1
- package/dist/chunk-WPLAANH4.js.map +0 -1
- package/src/primitives/useRovingTabIndex.test.ts +0 -48
- package/src/primitives/useRovingTabIndex.ts +0 -88
- package/src/state/Persistence.stories.tsx +0 -75
|
@@ -4,5 +4,5 @@ import { createContext } from 'react';
|
|
|
4
4
|
var CanvasStackContext = createContext(null);
|
|
5
5
|
|
|
6
6
|
export { CanvasStackContext };
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-ZQIHJXP4.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-ZQIHJXP4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/canvas/CanvasStackContext.ts"],"names":[],"mappings":";;;AAgCO,IAAM,kBAAA,GAAqB,cAA8C,IAAI","file":"chunk-ZQIHJXP4.js","sourcesContent":["import { createContext, type RefObject } from 'react';\nimport type { ViewTransform } from '../instrument/types';\nimport type { CanvasLayerDescriptor } from './useLayerScheduler';\nimport type { WorldFrame, WorldSpec } from './worldSpec';\n\n/** The stack's own drawing surface, for an overlay that has to re-draw it at\n * another camera or read back what it presented — a loupe. */\nexport interface CanvasStackSurface {\n /** The element the layers are stacked in, and the one pan/zoom listens on. */\n element: RefObject<HTMLElement | null>;\n /** Its measured CSS size, and the ratio the backing stores are scaled by. */\n size: { width: number; height: number; dpr: number };\n /** The presented `<canvas>` per layer id. */\n canvases: RefObject<Map<string, HTMLCanvasElement>>;\n /** The layers as the stack is drawing them, bottom first. */\n layers: readonly CanvasLayerDescriptor[];\n /** The coordinate system the stack was given, which `frame` resolves at\n * its size — for a re-draw at another size. */\n worldSpec?: WorldSpec;\n}\n\n/** What a canvas stack publishes to its children: the view, and the resolved\n * coordinate system it is read in, so DOM overlays can place themselves in the\n * same coordinates the layers draw in. */\nexport interface CanvasStackContextValue {\n view: ViewTransform;\n frame: WorldFrame;\n /** Absent from a context assembled by hand, which has no stack behind it. */\n surface?: CanvasStackSurface;\n}\n\n/** Context carrying the surrounding canvas stack's view and world frame. */\nexport const CanvasStackContext = createContext<CanvasStackContextValue | null>(null);\n"]}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a4 as Auto } from '../_dts/index-DCMA4Fy1.js';
|
|
2
2
|
import { Instrument } from '../index.js';
|
|
3
|
-
export {
|
|
4
|
-
import { R as ResolvedConfig,
|
|
3
|
+
export { aw as auto, aC as isAuto } from '../_dts/index-DCMA4Fy1.js';
|
|
4
|
+
import { R as ResolvedConfig, k as ConfigNode, A as Annotations, N as NodeOptions, S as SectionOption, c as ControlRenderer, I as InDialogOptions, m as ConfigOption, p as ConfigShape, g as ConfigBranch, B as BranchAnnotations, d as BranchOptions, C as ConfigSchema, q as InferConfig, h as ConfigEntry, b as ConfigRule, L as LeafPatch, o as ConfigRuleContext } from '../_dts/types-BUBSIZuV.js';
|
|
5
5
|
import { ConfigField } from '../controls/index.js';
|
|
6
|
-
export {
|
|
7
|
-
import {
|
|
6
|
+
export { l as ConfigOf, n as ConfigPath, D as DialogSpec, E as EntryValue, r as NodeValue, t as SectionSpec, V as ValueAtPath } from '../_dts/types-BUBSIZuV.js';
|
|
7
|
+
import { Display } from '@weasel-js/quantity';
|
|
8
|
+
import { PrefNumberUnit, PrefLeaf, PrefGroup } from '@weasel-js/ui';
|
|
9
|
+
import '@weasel-js/core';
|
|
8
10
|
import 'react';
|
|
9
|
-
import '../_dts/PrefsRow.d-DFpPIeIC.js';
|
|
10
11
|
import '@weasel-js/theme';
|
|
12
|
+
import '@weasel-js/geom';
|
|
11
13
|
import '../_dts/types-DJ79Tg5J.js';
|
|
12
14
|
|
|
13
15
|
/** The dotted paths a schema declares as starting auto — every leaf that said
|
|
@@ -73,6 +75,7 @@ declare abstract class BaseNode<T> implements ConfigNode<T> {
|
|
|
73
75
|
/** Never auto. The row's label does not toggle. */
|
|
74
76
|
manual(): this;
|
|
75
77
|
}
|
|
78
|
+
/** A numeric leaf, built by `f.number`. */
|
|
76
79
|
declare class NumberNode extends BaseNode<number> {
|
|
77
80
|
readonly kind = "number";
|
|
78
81
|
/** Bound the value. A number with both bounds renders as a slider. */
|
|
@@ -81,26 +84,28 @@ declare class NumberNode extends BaseNode<number> {
|
|
|
81
84
|
/** A display suffix for the value — `'px'`, `'ms'`, `'°'`. Presentation only:
|
|
82
85
|
* it is never parsed, and the stored value stays a plain number. */
|
|
83
86
|
suffix(suffix: string): this;
|
|
84
|
-
/** Show the value
|
|
85
|
-
* only: the stored value stays a plain number
|
|
86
|
-
|
|
87
|
+
/** Show, speak and read the value through a display — `compact()` reads
|
|
88
|
+
* `2.00M`. Presentation only: the stored value stays a plain number. */
|
|
89
|
+
display(display: Display): this;
|
|
87
90
|
/**
|
|
88
91
|
* Store the value in one unit and edit it in another — radians stored,
|
|
89
92
|
* degrees typed. `min`, `max` and `step` are declared in the stored unit
|
|
90
93
|
* alongside the value, and convert with it. `prefUnit` builds one from a
|
|
91
94
|
* `UnitSystem`.
|
|
92
95
|
*/
|
|
93
|
-
unit(unit:
|
|
96
|
+
unit(unit: PrefNumberUnit): this;
|
|
94
97
|
/** Force a slider even without both bounds. */
|
|
95
98
|
slider(): this;
|
|
96
99
|
/** Force a typed input even when both bounds are set. */
|
|
97
100
|
input(): this;
|
|
98
101
|
}
|
|
102
|
+
/** A true/false leaf, built by `f.boolean`; a checkbox unless `.toggle()`. */
|
|
99
103
|
declare class BooleanNode extends BaseNode<boolean> {
|
|
100
104
|
readonly kind = "boolean";
|
|
101
105
|
/** Ask for a switch rather than a checkbox. */
|
|
102
106
|
toggle(): this;
|
|
103
107
|
}
|
|
108
|
+
/** A text leaf, built by `f.string`. */
|
|
104
109
|
declare class StringNode extends BaseNode<string> {
|
|
105
110
|
readonly kind = "string";
|
|
106
111
|
placeholder(placeholder: string): this;
|
|
@@ -108,17 +113,20 @@ declare class StringNode extends BaseNode<string> {
|
|
|
108
113
|
/** Milliseconds to debounce live writes. 0 commits every keystroke. */
|
|
109
114
|
debounce(debounceMs: number): this;
|
|
110
115
|
}
|
|
116
|
+
/** A string-list leaf, built by `f.list`. */
|
|
111
117
|
declare class ListNode extends BaseNode<string[]> {
|
|
112
118
|
readonly kind = "list";
|
|
113
119
|
/** Shown in an empty entry. */
|
|
114
120
|
placeholder(placeholder: string): this;
|
|
115
121
|
}
|
|
122
|
+
/** A color leaf holding a hex string, built by `f.color`. */
|
|
116
123
|
declare class ColorNode extends BaseNode<string> {
|
|
117
124
|
readonly kind = "color";
|
|
118
125
|
/** The value carries alpha as `#rrggbbaa`, and the row gets an opacity
|
|
119
126
|
* track beside the swatch. */
|
|
120
127
|
alpha(): this;
|
|
121
128
|
}
|
|
129
|
+
/** A fixed-choice leaf, built by `f.enum`; a select unless `.radio()`. */
|
|
122
130
|
declare class EnumNode<T extends string> extends BaseNode<T> {
|
|
123
131
|
readonly kind = "enum";
|
|
124
132
|
/** Render as a segmented control rather than a select. */
|
|
@@ -158,6 +166,9 @@ declare class GroupNode<S extends ConfigShape> implements ConfigBranch<S> {
|
|
|
158
166
|
/** Show this group only while the predicate holds. Presentational — every
|
|
159
167
|
* value beneath it stays in config and the instrument still reads it. */
|
|
160
168
|
showIf(predicate: (config: Record<string, unknown>) => boolean): GroupNode<S>;
|
|
169
|
+
/** Put a button on the group's heading that returns every value beneath it
|
|
170
|
+
* to its default, leaving the rest of the config alone. */
|
|
171
|
+
resettable(): GroupNode<S>;
|
|
161
172
|
}
|
|
162
173
|
/**
|
|
163
174
|
* Builds an instrument's config: the values, their types, and how each is
|
|
@@ -192,7 +203,7 @@ declare const f: {
|
|
|
192
203
|
* Groups nest as deeply as the schema wants. */
|
|
193
204
|
group: <const S extends ConfigShape>(children: S) => GroupNode<S>;
|
|
194
205
|
/** A leaf of a kind a lab supplies the control for, through `controls`. */
|
|
195
|
-
custom: <T>(kind: string, def: T, validate?: (leaf:
|
|
206
|
+
custom: <T>(kind: string, def: T, validate?: (leaf: PrefLeaf, config: Record<string, unknown>) => string[]) => CustomNode<T>;
|
|
196
207
|
/** Collect leaves and groups into an instrument's config. */
|
|
197
208
|
schema<S extends ConfigShape>(nodes: S): ConfigSchema<InferConfig<S>>;
|
|
198
209
|
};
|
|
@@ -203,6 +214,10 @@ declare const f: {
|
|
|
203
214
|
*
|
|
204
215
|
* Rules do not run here: a hand-written `ConfigField` already states its label
|
|
205
216
|
* and control, which is everything the rule chain would have inferred.
|
|
217
|
+
*
|
|
218
|
+
* A dotted `key` is a config path, as it is to every read and write, so its
|
|
219
|
+
* leaf is filed under headless groups at that path rather than as one child
|
|
220
|
+
* whose name contains dots — which no path lookup would find.
|
|
206
221
|
*/
|
|
207
222
|
declare function fromConfigFields(fields: readonly ConfigField[]): ResolvedConfig;
|
|
208
223
|
|
|
@@ -227,7 +242,7 @@ declare function withValueAtPath<T>(config: T, path: string, value: unknown): T;
|
|
|
227
242
|
declare function fillConfigDefaults<T>(stored: unknown, defaults: T): T;
|
|
228
243
|
/** A node in a resolved schema tree, by dotted path. Structural rather than
|
|
229
244
|
* `isPrefLeaf` so this stays free of a runtime import. */
|
|
230
|
-
declare function schemaNodeAtPath(group:
|
|
245
|
+
declare function schemaNodeAtPath(group: PrefGroup, path: string): PrefLeaf | PrefGroup | undefined;
|
|
231
246
|
|
|
232
247
|
/**
|
|
233
248
|
* Resolve a schema into the vocabulary weasel-ui renders, running each leaf
|
|
@@ -269,7 +284,7 @@ declare function applyRules(seed: LeafPatch, ctx: Omit<ConfigRuleContext, 'leaf'
|
|
|
269
284
|
interface SectionTree {
|
|
270
285
|
/** The rail's schema. Top-level children are the schema's root sections,
|
|
271
286
|
* followed by any root node no section claimed. */
|
|
272
|
-
group:
|
|
287
|
+
group: PrefGroup;
|
|
273
288
|
/** `config` renested to mirror `group` — the value tree `PrefsForm` takes. */
|
|
274
289
|
values: Record<string, unknown>;
|
|
275
290
|
/** The config path a path within `group` stands for. */
|
package/dist/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { sectionTree, useConfigSchema } from '../chunk-
|
|
1
|
+
export { sectionTree, useConfigSchema } from '../chunk-E6NARGU7.js';
|
|
2
2
|
import '../chunk-Z76KEZAX.js';
|
|
3
|
-
export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from '../chunk-
|
|
4
|
-
export { fromConfigFields, isLeafVisible } from '../chunk-
|
|
5
|
-
export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from '../chunk-
|
|
3
|
+
export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from '../chunk-YCFKW5RX.js';
|
|
4
|
+
export { fromConfigFields, isLeafVisible } from '../chunk-WLMDTI2Q.js';
|
|
5
|
+
export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from '../chunk-READTDQX.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/controls/index.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { StanceProps } from '
|
|
4
|
-
import {
|
|
5
|
-
import { PropertyDensity, PropertyAlign } from '../passthrough/weasel-ui.js';
|
|
6
|
-
import { a as ConfigField, I as InDialogOptions } from '../_dts/types-DTuViBvc.js';
|
|
3
|
+
import { StanceProps, PropertyRowLayout, PropertyDensity, PropertyAlign } from '@weasel-js/ui';
|
|
4
|
+
import { a as ConfigField, I as InDialogOptions } from '../_dts/types-BUBSIZuV.js';
|
|
7
5
|
import { ResolvedConfig, ControlRenderer } from '../config/index.js';
|
|
8
|
-
export {
|
|
9
|
-
import '@weasel-js/
|
|
10
|
-
import '@weasel-js/core';
|
|
6
|
+
export { e as CheckboxField, f as ColorField, j as ConfigFieldType, s as NumberField, u as SelectField, v as SelectOption, w as SliderField, T as TextField } from '../_dts/types-BUBSIZuV.js';
|
|
7
|
+
import '@weasel-js/quantity';
|
|
11
8
|
|
|
12
9
|
/** How a panel packs its rows into the two-column property grid.
|
|
13
10
|
* - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
|
package/dist/controls/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { ControlPanel, inDialog, summarizeValue } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
1
|
+
export { ControlPanel, inDialog, summarizeValue } from '../chunk-JFOJESJF.js';
|
|
2
|
+
import '../chunk-WLMDTI2Q.js';
|
|
3
|
+
import '../chunk-READTDQX.js';
|
|
4
|
+
import '../chunk-4KSC7NXL.js';
|
|
5
|
+
import '../chunk-E23Q6A3Y.js';
|
|
6
|
+
import '../chunk-XVUKDSYV.js';
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/dragdrop/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as PaletteItem, m as DragFeedback, n as DragDropCapability } from '../_dts/index-DCMA4Fy1.js';
|
|
2
2
|
import { WorldSpec } from '../canvas/index.js';
|
|
3
3
|
import { Point, ViewTransform } from '../index.js';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { RefObject, PointerEvent, ReactPortal } from 'react';
|
|
6
|
+
import '@weasel-js/ui';
|
|
6
7
|
import '@weasel-js/core';
|
|
7
|
-
import '../_dts/PrefsRow.d-DFpPIeIC.js';
|
|
8
8
|
import '@weasel-js/theme';
|
|
9
|
-
import '../_dts/types-
|
|
9
|
+
import '../_dts/types-BUBSIZuV.js';
|
|
10
|
+
import '@weasel-js/quantity';
|
|
11
|
+
import '@weasel-js/geom';
|
|
10
12
|
import '../_dts/types-DJ79Tg5J.js';
|
|
11
13
|
|
|
14
|
+
/** A palette drag in progress. `screenPos` is in client pixels; `feedback` is
|
|
15
|
+
* the last `onDragOver` answer — `null` off the canvas or without one. */
|
|
12
16
|
interface DragState {
|
|
13
17
|
item: PaletteItem;
|
|
14
18
|
screenPos: Point;
|
|
15
19
|
feedback: DragFeedback | null;
|
|
16
20
|
}
|
|
21
|
+
/** Inputs to `useDragDrop`: the capability, the element that counts as the
|
|
22
|
+
* drop target, and the trial state a drop rewrites. */
|
|
17
23
|
interface UseDragDropArgs<TS, TC> {
|
|
18
24
|
capability: DragDropCapability<TS, TC>;
|
|
19
25
|
canvasContainerRef: RefObject<HTMLElement | null>;
|
|
@@ -26,27 +32,41 @@ interface UseDragDropArgs<TS, TC> {
|
|
|
26
32
|
setState: (next: TS | ((prev: TS) => TS)) => void;
|
|
27
33
|
emit: (event: string) => void;
|
|
28
34
|
}
|
|
35
|
+
/** The live drag, and the handler a palette item calls on pointerdown. */
|
|
29
36
|
interface UseDragDropResult {
|
|
30
37
|
drag: DragState | null;
|
|
31
38
|
startDrag: (item: PaletteItem, e: PointerEvent) => void;
|
|
32
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Run palette-to-canvas drags for a `DragDropCapability`. Releasing over the
|
|
42
|
+
* container converts the pointer to world coordinates, applies `onDrop`'s
|
|
43
|
+
* state and emits `'canvas.itemAdded'`; releasing anywhere else, or a canceled
|
|
44
|
+
* gesture, drops nothing. `onDragOver` is probed at most once per frame.
|
|
45
|
+
*/
|
|
33
46
|
declare function useDragDrop<TS, TC>({ capability, canvasContainerRef, view, state, config, setState, emit, worldSpec, }: UseDragDropArgs<TS, TC>): UseDragDropResult;
|
|
47
|
+
/** Props for `DragOverlay`. */
|
|
34
48
|
interface DragOverlayProps {
|
|
35
49
|
drag: DragState | null;
|
|
36
50
|
}
|
|
51
|
+
/** The ghost for `drag`, or nothing when no drag is live. */
|
|
37
52
|
declare function DragOverlay({ drag }: DragOverlayProps): react.JSX.Element | null;
|
|
38
53
|
|
|
54
|
+
/** Props for `DragGhost`. `screenPos` is in client pixels. */
|
|
39
55
|
interface DragGhostProps {
|
|
40
56
|
item: PaletteItem;
|
|
41
57
|
screenPos: Point;
|
|
42
58
|
}
|
|
59
|
+
/** The dragged item's label, portaled to `document.body` just below-right of
|
|
60
|
+
* `screenPos`. Renders nothing until mounted, so it is SSR-safe. */
|
|
43
61
|
declare function DragGhost({ item, screenPos }: DragGhostProps): ReactPortal | null;
|
|
44
62
|
|
|
63
|
+
/** Props for `Palette`. `onDragStart` is usually `useDragDrop`'s `startDrag`. */
|
|
45
64
|
interface PaletteProps {
|
|
46
65
|
items: PaletteItem[];
|
|
47
66
|
onDragStart: (item: PaletteItem, e: PointerEvent) => void;
|
|
48
67
|
className?: string;
|
|
49
68
|
}
|
|
69
|
+
/** One button per item, each starting a drag on pointerdown. */
|
|
50
70
|
declare function Palette({ items, onDragStart, className }: PaletteProps): react.JSX.Element;
|
|
51
71
|
|
|
52
72
|
export { DragDropCapability, DragFeedback, DragGhost, DragOverlay, Palette, PaletteItem, useDragDrop };
|
package/dist/dragdrop/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-2N7UBSS2.js';
|
|
2
|
+
import '../chunk-FG3EXZDV.js';
|
|
3
|
+
import '../chunk-ULYYNWGP.js';
|
|
4
|
+
import '../chunk-XVUKDSYV.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
Binary file
|