@weasel-js/labkit 1.6.0 → 1.7.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/dist/_dts/{CanvasStackContext-DQgcH1ny.d.ts → CanvasStackContext-D2jnIwfk.d.ts} +1 -1
- package/dist/_dts/FloatingPanel-7j0IcXwz.d.ts +30 -0
- package/dist/_dts/{LayerList.d-2c9yup5Y.d.ts → LayerList.d-DiuEArKq.d.ts} +4 -4
- package/dist/_dts/PrefsRow.d-TOZ7BgD9.d.ts +79 -0
- package/dist/_dts/PropertyPanel.d-D-1paCbE.d.ts +141 -0
- package/dist/_dts/{Select.d-BchGMC2Y.d.ts → Select.d-Bensr_MT.d.ts} +15 -6
- package/dist/_dts/Stage-CCWfQQWM.d.ts +202 -0
- package/dist/_dts/index-B2Yj5aA0.d.ts +274 -0
- package/dist/_dts/{index-B0--8PEM.d.ts → index-CsYqUHD3.d.ts} +12 -13
- package/dist/_dts/{types-B7y8hX1D.d.ts → types-CRPSGFAp.d.ts} +33 -5
- package/dist/_dts/{frac-DTRq7Xpb.d.ts → types-CSm9jgol.d.ts} +700 -650
- package/dist/_dts/{useTrialState-CP4jfuKl.d.ts → useTrialState-CTZPgeZ7.d.ts} +2 -3
- package/dist/canvas/index.d.ts +40 -8
- package/dist/canvas/index.js +5 -3
- package/dist/chrome/index.d.ts +5 -6
- package/dist/chrome/index.js +9 -7
- package/dist/chunk-24W5VEJW.js +18 -0
- package/dist/chunk-24W5VEJW.js.map +1 -0
- package/dist/chunk-275JRRVD.js +728 -0
- package/dist/chunk-275JRRVD.js.map +1 -0
- package/dist/chunk-3RY6WL5T.js +38 -0
- package/dist/chunk-3RY6WL5T.js.map +1 -0
- package/dist/chunk-4LJSC7MB.js +143 -0
- package/dist/chunk-4LJSC7MB.js.map +1 -0
- package/dist/{chunk-3FI7Y4R4.js → chunk-7BO7HNGF.js} +5 -5
- package/dist/{chunk-3FI7Y4R4.js.map → chunk-7BO7HNGF.js.map} +1 -1
- package/dist/chunk-AWQG7FCC.js +19 -0
- package/dist/chunk-AWQG7FCC.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-ZORVNOKX.js → chunk-FMK7UQ6V.js} +24 -145
- package/dist/chunk-FMK7UQ6V.js.map +1 -0
- package/dist/{chunk-BVL7Y574.js → chunk-FZ7YFQN7.js} +26 -10
- package/dist/chunk-FZ7YFQN7.js.map +1 -0
- package/dist/{chunk-USO6TERP.js → chunk-GOZLNM4L.js} +11 -9
- package/dist/chunk-GOZLNM4L.js.map +1 -0
- package/dist/{chunk-H5VIV7MQ.js → chunk-I5DUQ5HM.js} +88 -82
- package/dist/chunk-I5DUQ5HM.js.map +1 -0
- package/dist/chunk-J7OWWTCW.js +143 -0
- package/dist/chunk-J7OWWTCW.js.map +1 -0
- package/dist/{chunk-H6ZAOWNE.js → chunk-JVBYV6TL.js} +3 -3
- package/dist/{chunk-H6ZAOWNE.js.map → chunk-JVBYV6TL.js.map} +1 -1
- package/dist/{chunk-VQ47KWD5.js → chunk-KMJ7RWD3.js} +18 -7
- package/dist/chunk-KMJ7RWD3.js.map +1 -0
- package/dist/{chunk-ERFMC6WU.js → chunk-M7HP3FTK.js} +20 -11
- package/dist/chunk-M7HP3FTK.js.map +1 -0
- package/dist/chunk-MIM5R4ZT.js +14972 -0
- package/dist/chunk-MIM5R4ZT.js.map +1 -0
- package/dist/{chunk-HFRE4QQV.js → chunk-T5IBSPAM.js} +96 -32
- package/dist/chunk-T5IBSPAM.js.map +1 -0
- package/dist/chunk-UNAZSLWE.js +294 -0
- package/dist/chunk-UNAZSLWE.js.map +1 -0
- package/dist/{chunk-RS3HRQWU.js → chunk-WPLAANH4.js} +4 -3
- package/dist/chunk-WPLAANH4.js.map +1 -0
- package/dist/{chunk-AWH3SRPW.js → chunk-Y23G2VZL.js} +5 -37
- package/dist/chunk-Y23G2VZL.js.map +1 -0
- package/dist/{chunk-MOLIUNVH.js → chunk-YT75VYRD.js} +4 -4
- package/dist/{chunk-MOLIUNVH.js.map → chunk-YT75VYRD.js.map} +1 -1
- package/dist/chunk-ZIFPHIWZ.js +302 -0
- package/dist/chunk-ZIFPHIWZ.js.map +1 -0
- package/dist/config/index.d.ts +48 -40
- package/dist/config/index.js +4 -5
- package/dist/controls/index.d.ts +91 -7
- package/dist/controls/index.js +5 -4
- package/dist/dragdrop/index.d.ts +9 -7
- package/dist/dragdrop/index.js +3 -2
- package/dist/index.d.ts +294 -82
- package/dist/index.js +425 -402
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +4 -5
- package/dist/layers/index.js +2 -1
- package/dist/loupe/index.d.ts +20 -17
- package/dist/loupe/index.js +5 -3
- package/dist/overview/index.d.ts +56 -0
- package/dist/overview/index.js +289 -0
- package/dist/overview/index.js.map +1 -0
- package/dist/passthrough/weasel-ui.d.ts +239 -69
- package/dist/passthrough/weasel-ui.js +3 -2
- package/dist/primitives/index.d.ts +5 -204
- package/dist/primitives/index.js +6 -4
- package/dist/state/index.d.ts +8 -8
- package/dist/state/index.js +4 -5
- package/dist/state/index.js.map +1 -1
- package/dist/styles.css +152 -82
- package/dist/undo/index.d.ts +4 -4
- package/package.json +17 -12
- package/src/annotations/AnnotationOverlay.tsx +2 -2
- package/src/annotations/Annotations.less +0 -10
- package/src/annotations/MarkList.tsx +4 -8
- package/src/annotations/index.ts +1 -0
- package/src/annotations/paint.test.ts +3 -14
- package/src/annotations/paint.ts +3 -19
- package/src/annotations/store.test.ts +26 -0
- package/src/annotations/store.ts +25 -6
- package/src/annotations/svgNodes.test.ts +6 -9
- package/src/annotations/svgNodes.ts +3 -3
- package/src/annotations/toolMap.test.ts +37 -2
- package/src/annotations/toolMap.ts +13 -0
- package/src/annotations/types.ts +27 -0
- package/src/canvas/AGENTS.md +9 -10
- package/src/canvas/CameraInput.test.tsx +136 -0
- package/src/canvas/CameraInput.tsx +322 -0
- package/src/canvas/CanvasStack.tsx +47 -58
- package/src/canvas/LinkedCursor.less +16 -0
- package/src/canvas/LinkedCursor.tsx +54 -0
- package/src/canvas/Stage.test.tsx +33 -4
- package/src/canvas/Stage.tsx +47 -37
- package/src/canvas/cameraRegistry.test.ts +55 -0
- package/src/canvas/cameraRegistry.ts +86 -0
- package/src/canvas/cameraView.test.ts +60 -0
- package/src/canvas/cameraView.ts +61 -0
- package/src/canvas/cameraZoom.test.ts +46 -0
- package/src/canvas/cameraZoom.ts +24 -0
- package/src/canvas/index.ts +23 -2
- package/src/canvas/sharedScope.test.tsx +94 -0
- package/src/chrome/ChromeRegions.stories.tsx +1 -0
- package/src/chrome/regions/PaletteRegion.less +0 -7
- package/src/chrome/regions/SidebarRegion.less +12 -2
- package/src/chrome/regions/SidebarRegion.test.tsx +9 -2
- package/src/config/builder.test.ts +2 -1
- package/src/config/builder.ts +15 -8
- package/src/config/entry.test.ts +3 -1
- package/src/config/fromConfigField.test.ts +14 -0
- package/src/config/fromConfigField.ts +19 -4
- package/src/config/index.ts +4 -1
- package/src/config/path.ts +2 -5
- package/src/config/resolve.ts +15 -1
- package/src/config/sectionTree.test.ts +12 -6
- package/src/config/sectionTree.ts +15 -5
- package/src/config/types.ts +34 -9
- package/src/controls/ControlPanel.less +1 -1
- package/src/controls/ControlPanel.stories.tsx +3 -2
- package/src/controls/ControlPanel.test.tsx +76 -13
- package/src/controls/ControlPanel.tsx +80 -11
- package/src/controls/inDialog.test.tsx +18 -0
- package/src/controls/inDialog.tsx +2 -10
- package/src/index.test.ts +1 -1
- package/src/index.ts +23 -5
- package/src/instrument/SineWave.smoke.test.tsx +2 -0
- package/src/instrument/types.ts +10 -1
- package/src/lab/Lab.nebula.test.tsx +11 -2
- package/src/lab/Lab.test.tsx +3 -1
- package/src/lab/Lab.tsx +87 -76
- 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 +8 -17
- package/src/lab/LabSwitcher.less +6 -6
- package/src/lab/LabZoom.test.tsx +223 -0
- package/src/lab/LabZoom.tsx +170 -0
- package/src/lab/index.ts +1 -0
- package/src/loupe/AGENTS.md +7 -6
- package/src/loupe/LoupeGestures.tsx +15 -10
- package/src/loupe/TrialLoupe.tsx +5 -5
- package/src/loupe/index.ts +1 -0
- package/src/loupe/loupeActions.ts +6 -2
- package/src/overview/AGENTS.md +38 -0
- package/src/overview/OverviewMarks.test.tsx +100 -0
- package/src/overview/OverviewMarks.tsx +93 -0
- package/src/overview/TrialOverview.less +53 -0
- package/src/overview/TrialOverview.stories.tsx +50 -0
- package/src/overview/TrialOverview.test.tsx +116 -0
- package/src/overview/TrialOverview.tsx +376 -0
- package/src/overview/index.ts +2 -0
- package/src/passthrough/weasel-ui.test.ts +2 -0
- package/src/passthrough/weasel-ui.ts +23 -4
- package/src/primitives/FloatingPanel.test.tsx +11 -0
- package/src/primitives/FloatingPanel.tsx +2 -5
- package/src/primitives/JobProgress.less +1 -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/index.ts +2 -0
- package/src/specimen/Specimen.stories.tsx +1 -0
- package/src/specimen/Specimen.tsx +21 -4
- package/src/state/Persistence.browser.test.tsx +47 -0
- package/src/state/labRecords.test.ts +4 -1
- package/src/state/store.test.ts +9 -5
- package/src/state/usePersistedState.test.tsx +1 -1
- package/src/state/useTrialState.test.tsx +1 -1
- package/src/styles.less +3 -0
- package/src/theme/Interstellar.stories.tsx +4 -6
- 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/tools/labTool.ts +6 -2
- package/src/trial/Trial.annotations.test.tsx +16 -0
- package/src/trial/Trial.less +0 -13
- package/src/trial/Trial.loupe.test.tsx +73 -1
- package/src/trial/Trial.stories.tsx +2 -0
- package/src/trial/Trial.tsx +23 -1
- package/src/trial/TrialChrome.tsx +21 -3
- package/src/trial/trialOps.test.ts +4 -4
- package/dist/_dts/PrefsRow.d-DFpPIeIC.d.ts +0 -39
- package/dist/_dts/inDialog-D5ZKGjiD.d.ts +0 -23
- package/dist/_dts/index-DINmCuLA.d.ts +0 -453
- package/dist/_dts/number.d-OeQYQoUO.d.ts +0 -28
- package/dist/_dts/usePanZoom-Bq73pwFe.d.ts +0 -117
- package/dist/chunk-2AYGEN57.js +0 -32
- package/dist/chunk-2AYGEN57.js.map +0 -1
- package/dist/chunk-AWH3SRPW.js.map +0 -1
- package/dist/chunk-BVL7Y574.js.map +0 -1
- package/dist/chunk-ERFMC6WU.js.map +0 -1
- package/dist/chunk-H5VIV7MQ.js.map +0 -1
- package/dist/chunk-HFRE4QQV.js.map +0 -1
- package/dist/chunk-RS3HRQWU.js.map +0 -1
- package/dist/chunk-SBXNQW4G.js +0 -3
- package/dist/chunk-TT5C5S6R.js +0 -368
- package/dist/chunk-TT5C5S6R.js.map +0 -1
- package/dist/chunk-USO6TERP.js.map +0 -1
- package/dist/chunk-VQ47KWD5.js.map +0 -1
- package/dist/chunk-WUJXJC5O.js +0 -14568
- package/dist/chunk-WUJXJC5O.js.map +0 -1
- package/dist/chunk-ZORVNOKX.js.map +0 -1
- package/src/canvas/usePanZoom.test.ts +0 -244
- package/src/canvas/usePanZoom.ts +0 -147
- package/src/state/Persistence.stories.tsx +0 -75
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import '../chunk-
|
|
2
|
-
export { v as ActionBar,
|
|
1
|
+
import '../chunk-CZZPXUOU.js';
|
|
2
|
+
export { v as ActionBar, Xt as Badge, c as Button, a10 as ButtonBar, a9 as COLOR_MODE_OPTIONS, _2 as Callout, d4 as CalloutTrigger, o5 as Checkbox, a2 as CloseButton, s2 as ColorModeControl, y2 as ComboBox, S2 as ComboBoxItem, L as CurveEditor, f as DataGrid, d2 as Dialog, i2 as Disclosure, r as DisclosureMark, a3 as DisclosureRow, a5 as DragGhost, n4 as DragGrip, Ze as EDGE_PROFILES, n5 as Field, p3 as GestureRoute, n as ICON_PATHS, l as Icon, u3 as Input, f2 as KeyCap, p as KeySequence, E3 as LayerList, c2 as ListEditor, MINUS_SIGN, d3 as MenuButton, y as NumberField, r3 as OptionsBar, w as Plot2D, n9 as PointPlotter, r4 as Powerline, I2 as PrefsDialog, j as PrefsForm, u4 as Radio, l4 as RadioGroup, l7 as RangeSlider, E2 as Select, L2 as SelectItem, n6 as Sidebar, a11 as SidebarPanel, S as Slider, a8 as Switch, c6 as Tab, s4 as TabList, l6 as TabPanel, o6 as Tabs, o3 as ThemeSwitcher, a7 as ToggleBar, o4 as ToolButton, n8 as ToolGroup, h2 as ToolPalette, Z2 as chromaAt, o2 as detectPlatform, a as dlog, r2 as fieldClasses, formatNumber, n2 as formatShortcut, t as formatShortcutParts, f4 as gestureRouteSegments, d as inferKeycapKind, i as isDebugEnabled, s3 as isPrefLeaf, e as keyGlyph, l3 as keySpecFromKey, s as keySpecsFromMods, m as keySpecsFromShortcut, x3 as moveLayers, X2 as oklchToHex, C2 as paintGradientTrack, c3 as prefValueAtPath, x as sampleByInterpolation, wi as useAsyncOptions, u2 as useReorderDragList, a6 as useRovingTabIndex, l5 as visiblePrefSubtree } from '../chunk-MIM5R4ZT.js';
|
|
3
|
+
import '../chunk-275JRRVD.js';
|
|
3
4
|
//# sourceMappingURL=weasel-ui.js.map
|
|
4
5
|
//# sourceMappingURL=weasel-ui.js.map
|
|
@@ -1,204 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
/** Props for `<FloatingPanel>`. */
|
|
7
|
-
interface FloatingPanelProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/** Corner it rests in before it has ever been dragged. Default `'bottom-left'`. */
|
|
10
|
-
anchor?: Corner;
|
|
11
|
-
/** Corners that may capture it. Default: all four. */
|
|
12
|
-
snapCorners?: readonly Corner[];
|
|
13
|
-
/** Pixels in from a corner when snapped. Default 12. */
|
|
14
|
-
inset?: number;
|
|
15
|
-
/** Name to remember its position under, through `usePersistedState` — so it
|
|
16
|
-
* is remembered only inside a lab or a `<Persistence>`. Omit to forget on
|
|
17
|
-
* reload. */
|
|
18
|
-
persist?: string;
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* A draggable box that floats over its offset parent and snaps to its corners.
|
|
23
|
-
*
|
|
24
|
-
* Drives windease's `floatingStrategy` as a pure function rather than mounting a
|
|
25
|
-
* windease container: a lab overlay has one item and no zone tree, so the node
|
|
26
|
-
* model would be all cost. Pointer handling is therefore this component's, and
|
|
27
|
-
* windease's own affordance rendering never participates.
|
|
28
|
-
*/
|
|
29
|
-
declare function FloatingPanel({ children, anchor, snapCorners, inset, persist, className, }: FloatingPanelProps): react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
/** A live frame-rate readout, averaged over the last 30 frames. */
|
|
32
|
-
declare function FpsMeter(): react_jsx_runtime.JSX.Element;
|
|
33
|
-
|
|
34
|
-
/** Props for `<JobProgress>`. */
|
|
35
|
-
interface JobProgressProps {
|
|
36
|
-
job: JobHandle;
|
|
37
|
-
className?: string;
|
|
38
|
-
}
|
|
39
|
-
/** A running job's progress, failures and outcome. Determinate once the job
|
|
40
|
-
* reports a total; a job that cannot count up front never sends one, so the
|
|
41
|
-
* bar stays indeterminate rather than inventing a denominator. */
|
|
42
|
-
declare function JobProgress({ job, className }: JobProgressProps): react_jsx_runtime.JSX.Element | null;
|
|
43
|
-
|
|
44
|
-
/** How a legend entry's swatch is drawn, matching how the thing looks on canvas. */
|
|
45
|
-
type LegendMark = 'line' | 'dash' | 'dot' | 'band';
|
|
46
|
-
/** One row of a legend: a swatch and what it means. */
|
|
47
|
-
interface LegendEntry {
|
|
48
|
-
key: string;
|
|
49
|
-
label: string;
|
|
50
|
-
color: string;
|
|
51
|
-
/** Defaults to `'line'`. */
|
|
52
|
-
mark?: LegendMark;
|
|
53
|
-
}
|
|
54
|
-
/** Props for `<Legend>`. */
|
|
55
|
-
interface LegendProps {
|
|
56
|
-
entries: readonly LegendEntry[];
|
|
57
|
-
className?: string;
|
|
58
|
-
}
|
|
59
|
-
/** A color key. Presentational only — no handlers, no state, no hover behavior. */
|
|
60
|
-
declare function Legend({ entries, className }: LegendProps): react_jsx_runtime.JSX.Element;
|
|
61
|
-
|
|
62
|
-
/** Props for `<ScaleIndicator>`. */
|
|
63
|
-
interface ScaleIndicatorProps {
|
|
64
|
-
/** Current view zoom factor. If omitted, reads from CanvasStackContext. Defaults to 1. */
|
|
65
|
-
zoom?: number;
|
|
66
|
-
/** World pixels per unit at zoom=1. Default: 1. */
|
|
67
|
-
pixelsPerUnit?: number;
|
|
68
|
-
/** Unit label. Default: 'px'. */
|
|
69
|
-
unit?: string;
|
|
70
|
-
/** Target bar width in display pixels. Default: 100. */
|
|
71
|
-
targetWidth?: number;
|
|
72
|
-
}
|
|
73
|
-
/** A scale bar: a labeled rule showing how far a round number of world units
|
|
74
|
-
* is at the current zoom. Reads the zoom from the surrounding canvas stack
|
|
75
|
-
* unless one is passed. */
|
|
76
|
-
declare function ScaleIndicator({ zoom, pixelsPerUnit, unit, targetWidth, }: ScaleIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
77
|
-
|
|
78
|
-
/** Props for `<Split>`. */
|
|
79
|
-
interface SplitProps {
|
|
80
|
-
/** The sidebar pane's contents. */
|
|
81
|
-
sidebar: ReactNode;
|
|
82
|
-
/** The edge the sidebar sits on. Read once, when the strip mounts. Default `'start'`. */
|
|
83
|
-
side?: 'start' | 'end';
|
|
84
|
-
/** The content pane's contents. */
|
|
85
|
-
children: ReactNode;
|
|
86
|
-
/** Names the sidebar pane, and through it the seam. Default `'Sidebar'`. */
|
|
87
|
-
label?: string;
|
|
88
|
-
/** Extra classes on the strip, which always has `lk-split`. */
|
|
89
|
-
className?: string;
|
|
90
|
-
/** The class on the sidebar pane. */
|
|
91
|
-
sidebarClassName?: string;
|
|
92
|
-
/** The class on the content pane. */
|
|
93
|
-
contentClassName?: string;
|
|
94
|
-
/** The sidebar's current extent in pixels. Omit to leave it unpersisted: the
|
|
95
|
-
* seam still works, its result just does not outlive the mount. */
|
|
96
|
-
width?: number;
|
|
97
|
-
/** Where the sidebar starts before anyone drags it. */
|
|
98
|
-
defaultWidth?: number;
|
|
99
|
-
minWidth?: number;
|
|
100
|
-
maxWidth?: number;
|
|
101
|
-
/** How little the content pane may be squeezed to. Reported as the seam's
|
|
102
|
-
* reachable maximum, so the drag stops there rather than clamping silently. */
|
|
103
|
-
contentMinWidth?: number;
|
|
104
|
-
/** Fires through the drag, not on release: the pane is already there. */
|
|
105
|
-
onWidthChange?: (width: number) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Fixed extent. Omit in an app — the strip measures its own box. Supply it
|
|
108
|
-
* where nothing measures, notably jsdom, or both panes lay out at zero.
|
|
109
|
-
*/
|
|
110
|
-
viewport?: {
|
|
111
|
-
w: number;
|
|
112
|
-
h: number;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* A sidebar and a content pane as a two-pane strip with a draggable seam.
|
|
117
|
-
*
|
|
118
|
-
* The seam is `stripStrategy`'s own resize affordance, so it arrives as a
|
|
119
|
-
* `role="separator"` carrying the reachable range, operable by pointer and by
|
|
120
|
-
* arrows / Home / End, and clamped against the content pane's floor rather
|
|
121
|
-
* than against the sidebar's alone.
|
|
122
|
-
*/
|
|
123
|
-
declare function Split({ sidebar, children, side, label, className, sidebarClassName, contentClassName, width, defaultWidth, minWidth, maxWidth, contentMinWidth, onWidthChange, viewport, }: SplitProps): react_jsx_runtime.JSX.Element;
|
|
124
|
-
|
|
125
|
-
/** Props for `<StatusBar>`. */
|
|
126
|
-
interface StatusBarProps {
|
|
127
|
-
children: ReactNode;
|
|
128
|
-
}
|
|
129
|
-
/** A footer strip for readouts. Fill it with `<StatusBar.Section>`. */
|
|
130
|
-
declare function StatusBar({ children }: StatusBarProps): react_jsx_runtime.JSX.Element;
|
|
131
|
-
declare namespace StatusBar {
|
|
132
|
-
var Section: ({ children, end }: StatusBarSectionProps) => react_jsx_runtime.JSX.Element;
|
|
133
|
-
}
|
|
134
|
-
/** Props for `<StatusBar.Section>`. */
|
|
135
|
-
interface StatusBarSectionProps {
|
|
136
|
-
children: ReactNode;
|
|
137
|
-
/** Pushes this section, and everything after it, to the far end. */
|
|
138
|
-
end?: boolean;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Props for `<Toolbar>`. */
|
|
142
|
-
interface ToolbarProps {
|
|
143
|
-
children: ReactNode;
|
|
144
|
-
/** Names the toolbar for assistive tech. Required by the APG pattern when a
|
|
145
|
-
* view holds more than one. */
|
|
146
|
-
'aria-label'?: string;
|
|
147
|
-
}
|
|
148
|
-
/** A horizontal bar of controls. Fill it with `<Toolbar.Title>`,
|
|
149
|
-
* `<Toolbar.Group>`, `<Toolbar.Button>` and `<Toolbar.Spacer>`. */
|
|
150
|
-
declare function Toolbar({ children, 'aria-label': ariaLabel }: ToolbarProps): react_jsx_runtime.JSX.Element;
|
|
151
|
-
declare namespace Toolbar {
|
|
152
|
-
var Title: ({ children }: TitleProps) => react_jsx_runtime.JSX.Element;
|
|
153
|
-
var Group: ({ children, end, "aria-label": ariaLabel }: ToolbarGroupProps) => react_jsx_runtime.JSX.Element;
|
|
154
|
-
var Button: ({ children, onClick, disabled, title, "aria-label": ariaLabel, variant, iconOnly, pressed, }: ToolbarButtonProps) => react_jsx_runtime.JSX.Element;
|
|
155
|
-
var Spacer: () => react_jsx_runtime.JSX.Element;
|
|
156
|
-
}
|
|
157
|
-
interface TitleProps {
|
|
158
|
-
children: ReactNode;
|
|
159
|
-
}
|
|
160
|
-
/** Props for `<Toolbar.Group>`. */
|
|
161
|
-
interface ToolbarGroupProps {
|
|
162
|
-
children: ReactNode;
|
|
163
|
-
/** Pushes this group, and everything after it, to the far end. */
|
|
164
|
-
end?: boolean;
|
|
165
|
-
'aria-label'?: string;
|
|
166
|
-
}
|
|
167
|
-
/** Props for `<Toolbar.Button>`. */
|
|
168
|
-
interface ToolbarButtonProps {
|
|
169
|
-
children: ReactNode;
|
|
170
|
-
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
171
|
-
disabled?: boolean;
|
|
172
|
-
title?: string;
|
|
173
|
-
/** Required when `children` is an icon with no text of its own. */
|
|
174
|
-
'aria-label'?: string;
|
|
175
|
-
/** `danger` reddens on hover — for actions that discard work. */
|
|
176
|
-
variant?: 'default' | 'danger';
|
|
177
|
-
/** Square, for a button whose whole content is one glyph. */
|
|
178
|
-
iconOnly?: boolean;
|
|
179
|
-
/** Makes this a toggle: `aria-pressed`, and held down while true. */
|
|
180
|
-
pressed?: boolean;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/** Props for `<ZoomControl>`. */
|
|
184
|
-
interface ZoomControlProps {
|
|
185
|
-
/** Current zoom as a scale factor: 1 is actual size. */
|
|
186
|
-
zoom: number;
|
|
187
|
-
/** Fired continuously while the slider drags. */
|
|
188
|
-
onZoomChange: (zoom: number) => void;
|
|
189
|
-
/** Fired when a drag settles or the field is committed. Defaults to
|
|
190
|
-
* `onZoomChange`. */
|
|
191
|
-
onZoomCommit?: (zoom: number) => void;
|
|
192
|
-
/** Smallest selectable zoom. Defaults to 0.1 (10%). */
|
|
193
|
-
min?: number;
|
|
194
|
-
/** Largest selectable zoom. Defaults to 8 (800%). */
|
|
195
|
-
max?: number;
|
|
196
|
-
className?: string;
|
|
197
|
-
}
|
|
198
|
-
/** Zoom as a log-scaled slider with an editable percentage beside it. Pair it
|
|
199
|
-
* with zoom-in / zoom-out buttons in a `<Toolbar.Group>`; this component owns
|
|
200
|
-
* only the continuous part. */
|
|
201
|
-
declare function ZoomControl({ zoom, onZoomChange, onZoomCommit, min: minProp, max: maxProp, className, }: ZoomControlProps): react_jsx_runtime.JSX.Element;
|
|
202
|
-
|
|
203
|
-
export { FloatingPanel, FpsMeter, JobProgress, Legend, ScaleIndicator, Split, StatusBar, Toolbar, ZoomControl };
|
|
204
|
-
export type { FloatingPanelProps, JobProgressProps, LegendEntry, LegendMark, LegendProps, ScaleIndicatorProps, SplitProps, StatusBarProps, StatusBarSectionProps, ToolbarButtonProps, ToolbarGroupProps, ToolbarProps, ZoomControlProps };
|
|
1
|
+
export { a as FloatingPanel, F as FloatingPanelProps } from '../_dts/FloatingPanel-7j0IcXwz.js';
|
|
2
|
+
export { F as FpsMeter, J as JobProgress, g as JobProgressProps, L as Legend, h as LegendEntry, i as LegendMark, j as LegendProps, R as Readout, k as ReadoutProps, l as ReadoutRow, m as ScaleIndicator, n as ScaleIndicatorProps, o as Split, S as SplitProps, p as StatusBar, q as StatusBarProps, r as StatusBarSectionProps, T as Toolbar, s as ToolbarButtonProps, t as ToolbarGroupProps, u as ToolbarProps, Z as ZoomControl, v as ZoomControlProps } from '../_dts/index-B2Yj5aA0.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'windease';
|
|
5
|
+
import '../_dts/types-DJ79Tg5J.js';
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
export { JobProgress, Legend, Readout, Split } from '../chunk-FMK7UQ6V.js';
|
|
2
|
+
export { FloatingPanel } from '../chunk-J7OWWTCW.js';
|
|
3
|
+
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-7BO7HNGF.js';
|
|
4
|
+
import '../chunk-CZZPXUOU.js';
|
|
4
5
|
import '../chunk-RWNDDKOH.js';
|
|
5
6
|
import '../chunk-CQLQPQ4P.js';
|
|
6
7
|
import '../chunk-2YILQ7Y5.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-MIM5R4ZT.js';
|
|
9
|
+
import '../chunk-275JRRVD.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { C as CURRENT_DOCUMENT_VERSION, I as IndexedDbAdapterOptions, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, O as OpenLabStoreOptions, d as OpenedLabStore, P as PersistedStateOptions, e as Persistence, f as PersistenceProps, R as RecordCache, g as RecordChange, T as TrialIdContext, h as TrialIdProvider, i as createIndexedDbAdapter, j as createLabStore, k as createMemoryAdapter, l as indexedDbAdapter, m as labDocumentKey, n as localStorageAdapter, o as noneAdapter, p as openLabStore, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, r as useLabStore, t as usePersistedState, v as useTrialId, w as useTrialState } from '../_dts/useTrialState-
|
|
2
|
-
import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack,
|
|
3
|
-
export { C as CreateLabStoreOptions,
|
|
4
|
-
import * as
|
|
1
|
+
export { C as CURRENT_DOCUMENT_VERSION, I as IndexedDbAdapterOptions, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, O as OpenLabStoreOptions, d as OpenedLabStore, P as PersistedStateOptions, e as Persistence, f as PersistenceProps, R as RecordCache, g as RecordChange, T as TrialIdContext, h as TrialIdProvider, i as createIndexedDbAdapter, j as createLabStore, k as createMemoryAdapter, l as indexedDbAdapter, m as labDocumentKey, n as localStorageAdapter, o as noneAdapter, p as openLabStore, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, r as useLabStore, t as usePersistedState, v as useTrialId, w as useTrialState } from '../_dts/useTrialState-CTZPgeZ7.js';
|
|
2
|
+
import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, c as StorageAdapter } from '../_dts/types-CSm9jgol.js';
|
|
3
|
+
export { C as CreateLabStoreOptions, d as LabDocument, e as LabStoreState, M as Migration, f as SavedSnapshot, g as StorageChange, h as TrialStateHandle, i as UndockedPanel, j as UndockedPanels, k as dockPanel, p as panelKey, u as undockPanel } from '../_dts/types-CSm9jgol.js';
|
|
4
|
+
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import 'zustand/vanilla';
|
|
7
|
-
import '../_dts/PrefsRow.d-DFpPIeIC.js';
|
|
8
|
-
import '@weasel-js/theme';
|
|
9
7
|
import '@weasel-js/core';
|
|
10
|
-
import '../_dts/
|
|
8
|
+
import '../_dts/PrefsRow.d-TOZ7BgD9.js';
|
|
9
|
+
import '@weasel-js/theme';
|
|
10
|
+
import '../_dts/types-CRPSGFAp.js';
|
|
11
11
|
import '../_dts/types-DJ79Tg5J.js';
|
|
12
12
|
|
|
13
13
|
/** The storage key a lab writes one of its buckets under. Namespaced by
|
|
@@ -50,7 +50,7 @@ interface SingletonExperimentProviderProps<TS, TC> {
|
|
|
50
50
|
* full `<Lab instruments={...}>` runtime. `storageKey` and `storage` are read
|
|
51
51
|
* once, at mount.
|
|
52
52
|
*/
|
|
53
|
-
declare function SingletonExperimentProvider<TS, TC>({ id, initialConfig, initialState, storage, storageKey, fallback, children, }: SingletonExperimentProviderProps<TS, TC>):
|
|
53
|
+
declare function SingletonExperimentProvider<TS, TC>({ id, initialConfig, initialState, storage, storageKey, fallback, children, }: SingletonExperimentProviderProps<TS, TC>): react.JSX.Element;
|
|
54
54
|
|
|
55
55
|
export { InstrumentSerializers, SerializedTrial, SingletonExperimentProvider, StorageAdapter, TrialRecord, UndoStack, decodeUrlHash, deserializeTrials, emptyUndoStack, encodeUrlHash, labStorageKey, serializeTrials };
|
|
56
56
|
export type { SingletonExperimentProviderProps };
|
package/dist/state/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { openLabStore } from '../chunk-
|
|
2
|
-
export { CURRENT_DOCUMENT_VERSION, createLabStore, dockPanel, labDocumentKey, openLabStore, panelKey, quarantineKey, undockPanel, useTrialState } from '../chunk-
|
|
1
|
+
import { openLabStore } from '../chunk-YT75VYRD.js';
|
|
2
|
+
export { CURRENT_DOCUMENT_VERSION, createLabStore, dockPanel, labDocumentKey, openLabStore, panelKey, quarantineKey, undockPanel, useTrialState } from '../chunk-YT75VYRD.js';
|
|
3
3
|
import { useWarnIgnoredChange, useOpenOnce, defaultStorage, PersistenceContext } from '../chunk-RWNDDKOH.js';
|
|
4
4
|
export { Persistence, createIndexedDbAdapter, createMemoryAdapter, decodeUrlHash, deserializeTrials, emptyUndoStack, encodeUrlHash, indexedDbAdapter, labStorageKey, localStorageAdapter, noneAdapter, serializeTrials, sessionStorageAdapter, urlHashAdapter, usePersistedState } from '../chunk-RWNDDKOH.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-FZ7YFQN7.js';
|
|
6
|
+
import '../chunk-Y23G2VZL.js';
|
|
7
7
|
import { LabStoreProvider, TrialIdProvider } from '../chunk-2YILQ7Y5.js';
|
|
8
8
|
export { LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, useLabStore, useTrialId } from '../chunk-2YILQ7Y5.js';
|
|
9
|
-
import '../chunk-WUJXJC5O.js';
|
|
10
9
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
11
10
|
|
|
12
11
|
var SINGLETON_INSTRUMENT = "__singleton__";
|
package/dist/state/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":";;;;;;;;;;AAQA,IAAM,oBAAA,GAAuB,eAAA;AAwBtB,SAAS,2BAAA,CAAoC;AAAA,EAClD,EAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA,GAAW,IAAA;AAAA,EACX;AACF,CAAA,EAA6C;AAC3C,EAAA,oBAAA,CAAqB,+BAAA,EAAiC,EAAE,UAAA,EAAY,OAAA,EAAS,CAAA;AAC7E,EAAA,MAAM,MAAA,GAAS,YAAY,YAAY;AACrC,IAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,UAAA,EAAY,SAAS,OAAA,IAAY,MAAM,cAAA,EAAe,EAAI,CAAA;AAC3F,IAAA,IAAI,CAAC,GAAA,CAAI,KAAA,CAAM,QAAA,EAAS,CAAE,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,EAAA,KAAO,EAAE,CAAA,EAAG;AACzD,MAAA,GAAA,CAAI,KAAA,CAAM,QAAA,EAAS,CAAE,QAAA,CAAS;AAAA,QAC5B,EAAA;AAAA,QACA,cAAA,EAAgB,oBAAA;AAAA,QAChB,MAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,YAAA;AAAA,QACP,IAAA,EAAM,EAAE,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAE;AAAE,OACtC,CAAA;AAAA,IACH;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAC,CAAA;AACD,EAAA,IAAI,CAAC,MAAA,EAAQ,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,QAAA,EAAS,CAAA;AAChC,EAAA,2BACG,gBAAA,EAAA,EAAiB,KAAA,EAAO,OAAO,KAAA,EAC9B,QAAA,kBAAA,GAAA,CAAC,mBAAmB,QAAA,EAAnB,EAA4B,KAAA,EAAO,MAAA,CAAO,SACzC,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAS,EAAA,EAAK,QAAA,EAAS,GAC1C,CAAA,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { ReactNode } from 'react';\nimport { defaultStorage } from './adapters';\nimport { LabStoreProvider, TrialIdProvider } from './context';\nimport { openLabStore } from './openLabStore';\nimport { PersistenceContext } from './Persistence';\nimport type { StorageAdapter } from './types';\nimport { useOpenOnce, useWarnIgnoredChange } from './useOpenOnce';\n\nconst SINGLETON_INSTRUMENT = '__singleton__';\n\n/** Props for `<SingletonExperimentProvider>`. */\nexport interface SingletonExperimentProviderProps<TS, TC> {\n /** Stable id for the synthetic trial; also doubles as the\n * TrialIdContext value. */\n id: string;\n initialConfig: TC;\n initialState: TS;\n storageKey: string;\n /** Default: IndexedDB, or localStorage where IndexedDB will not open. */\n storage?: StorageAdapter;\n /** Rendered until the stored experiment has loaded. Default: nothing. */\n fallback?: ReactNode;\n children: ReactNode;\n}\n\n/**\n * One-trial `<Lab>` substitute for single-screen experiments. Mounts\n * a `LabStoreProvider` + `TrialIdProvider` with one synthetic\n * trial, so `useTrialState` works without going through the\n * full `<Lab instruments={...}>` runtime. `storageKey` and `storage` are read\n * once, at mount.\n */\nexport function SingletonExperimentProvider<TS, TC>({\n id,\n initialConfig,\n initialState,\n storage,\n storageKey,\n fallback = null,\n children,\n}: SingletonExperimentProviderProps<TS, TC>) {\n useWarnIgnoredChange('<SingletonExperimentProvider>', { storageKey, storage });\n const opened = useOpenOnce(async () => {\n const lab = await openLabStore({ storageKey, storage: storage ?? (await defaultStorage()) });\n if (!lab.store.getState().trials.some((w) => w.id === id)) {\n lab.store.getState().addTrial({\n id,\n instrumentName: SINGLETON_INSTRUMENT,\n config: initialConfig,\n state: initialState,\n view: { zoom: 1, pan: { x: 0, y: 0 } },\n });\n }\n return lab;\n });\n if (!opened) return <>{fallback}</>;\n return (\n <LabStoreProvider store={opened.store}>\n <PersistenceContext.Provider value={opened.records}>\n <TrialIdProvider trialId={id}>{children}</TrialIdProvider>\n </PersistenceContext.Provider>\n </LabStoreProvider>\n );\n}\n"]}
|