@weasel-js/labkit 1.5.0 → 1.5.2
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 +41 -4
- package/dist/_dts/{CanvasStackContext-CqkxkFJW.d.ts → CanvasStackContext-CMMo180l.d.ts} +1 -1
- package/dist/_dts/{PrefsForm.d-DDHFANkc.d.ts → PrefsForm.d-DPy9I8It.d.ts} +4 -0
- package/dist/_dts/Select.d-ZTiwzYyT.d.ts +479 -0
- package/dist/_dts/{frac-8R6UmlvN.d.ts → frac-B4hFJMiN.d.ts} +54 -6
- package/dist/_dts/{index-retnAut7.d.ts → index-8LiKe3A-.d.ts} +77 -10
- package/dist/_dts/{index-B8uu2ba7.d.ts → index-DlKolEIZ.d.ts} +20 -8
- package/dist/_dts/{types-Ca2LCnPq.d.ts → types-Db-3NNk1.d.ts} +28 -4
- package/dist/_dts/{usePanZoom-nS798rOF.d.ts → usePanZoom-SSTZe410.d.ts} +4 -47
- package/dist/_dts/{useTrialState-jcx_TdU6.d.ts → useTrialState-pnAE-UBD.d.ts} +1 -1
- package/dist/canvas/index.d.ts +5 -5
- package/dist/canvas/index.js +1 -1
- package/dist/chrome/index.d.ts +4 -4
- package/dist/chrome/index.js +7 -7
- package/dist/chunk-6BUQ77ZV.js +18 -0
- package/dist/chunk-6BUQ77ZV.js.map +1 -0
- package/dist/{chunk-KJALCDWE.js → chunk-753Y6HE6.js} +9 -9
- package/dist/chunk-753Y6HE6.js.map +1 -0
- package/dist/{chunk-6ZDGOZQV.js → chunk-A2ACAGW6.js} +72 -20
- package/dist/chunk-A2ACAGW6.js.map +1 -0
- package/dist/{chunk-NS64DXMN.js → chunk-CKUKF72R.js} +44 -21
- package/dist/chunk-CKUKF72R.js.map +1 -0
- package/dist/{chunk-MUKOW3TC.js → chunk-D35PFTS7.js} +4 -4
- package/dist/{chunk-MUKOW3TC.js.map → chunk-D35PFTS7.js.map} +1 -1
- package/dist/{chunk-UU3NJO6N.js → chunk-EMXAIRUJ.js} +3 -3
- package/dist/{chunk-UU3NJO6N.js.map → chunk-EMXAIRUJ.js.map} +1 -1
- package/dist/{chunk-ZPH5WTWF.js → chunk-ERFMC6WU.js} +142 -66
- package/dist/chunk-ERFMC6WU.js.map +1 -0
- package/dist/chunk-FKLT3ITC.js +590 -0
- package/dist/chunk-FKLT3ITC.js.map +1 -0
- package/dist/{chunk-QLSV2N3G.js → chunk-IJJUK4FU.js} +25 -13
- package/dist/chunk-IJJUK4FU.js.map +1 -0
- package/dist/{chunk-EKIICY6X.js → chunk-KJCUERQF.js} +37 -25
- package/dist/chunk-KJCUERQF.js.map +1 -0
- package/dist/chunk-LASCBWW7.js +13456 -0
- package/dist/chunk-LASCBWW7.js.map +1 -0
- package/dist/{chunk-67SJLMC7.js → chunk-LRI3MBGR.js} +45 -12
- package/dist/chunk-LRI3MBGR.js.map +1 -0
- package/dist/chunk-REOBGYMC.js +150 -0
- package/dist/chunk-REOBGYMC.js.map +1 -0
- package/dist/{chunk-PGETSEDK.js → chunk-TT5C5S6R.js} +11 -90
- package/dist/chunk-TT5C5S6R.js.map +1 -0
- package/dist/{chunk-NDRYLVOW.js → chunk-Z76KEZAX.js} +2 -2
- package/dist/chunk-Z76KEZAX.js.map +1 -0
- package/dist/config/index.d.ts +62 -19
- package/dist/config/index.js +6 -4
- package/dist/controls/index.d.ts +3 -3
- package/dist/controls/index.js +4 -4
- package/dist/dragdrop/index.d.ts +3 -3
- package/dist/index.d.ts +230 -62
- package/dist/index.js +1367 -1698
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +4 -4
- package/dist/layers/index.js +2 -2
- package/dist/loupe/index.d.ts +67 -16
- package/dist/loupe/index.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +57 -230
- package/dist/passthrough/weasel-ui.js +1 -1
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.js +3 -3
- package/dist/state/index.d.ts +5 -5
- package/dist/state/index.js +5 -3
- package/dist/state/index.js.map +1 -1
- package/dist/styles.css +266 -57
- package/dist/surface/index.js +1 -1
- package/dist/ui/layers/index.js +1 -1
- package/dist/undo/index.d.ts +3 -3
- package/package.json +9 -9
- package/src/annotations/AnnotationOverlay.tsx +3 -0
- package/src/annotations/Annotations.less +4 -0
- package/src/annotations/Annotations.overlay.test.tsx +20 -0
- package/src/annotations/svgNodes.ts +1 -0
- package/src/annotations/toolMap.test.ts +9 -5
- package/src/annotations/toolMap.ts +3 -0
- package/src/canvas/CanvasStack.stories.tsx +1 -1
- package/src/canvas/index.ts +0 -9
- package/src/canvas/usePanZoom.test.ts +28 -0
- package/src/canvas/usePanZoom.ts +11 -4
- package/src/chrome/ChromeRegions.stories.tsx +1 -1
- package/src/chrome/LabChrome.tsx +21 -5
- package/src/chrome/builtins.test.ts +1 -0
- package/src/chrome/builtins.tsx +1 -0
- package/src/chrome/index.ts +1 -0
- package/src/chrome/labTypes.ts +3 -3
- package/src/chrome/regions/PaletteRegion.test.tsx +18 -0
- package/src/chrome/regions/PaletteRegion.tsx +6 -10
- package/src/chrome/regions/SidebarRegion.stories.tsx +44 -0
- package/src/chrome/regions/TitleBarRegion.tsx +1 -1
- package/src/chrome/regions/ToolbarRegion.tsx +11 -7
- package/src/chrome/types.ts +11 -2
- package/src/config/auto.test.ts +12 -0
- package/src/config/auto.ts +15 -0
- package/src/config/autoConfig.test.ts +107 -0
- package/src/config/autoConfig.ts +153 -0
- package/src/config/builder.test.ts +38 -0
- package/src/config/builder.ts +55 -11
- package/src/config/index.ts +3 -0
- package/src/config/path.ts +7 -2
- package/src/config/resolve.test.ts +25 -0
- package/src/config/resolve.ts +17 -1
- package/src/config/types.ts +32 -2
- package/src/config/useResolvedConfig.ts +26 -0
- package/src/controls/AutoControls.stories.tsx +88 -0
- package/src/controls/ControlPanel.less +23 -0
- package/src/controls/ControlPanel.stories.tsx +83 -1
- package/src/controls/ControlPanel.test.tsx +457 -4
- package/src/controls/ControlPanel.tsx +534 -73
- package/src/index.test.ts +0 -2
- package/src/index.ts +33 -11
- package/src/instrument/serializers.ts +29 -1
- package/src/lab/Lab.chrome.test.tsx +16 -0
- package/src/lab/Lab.stories.tsx +1 -1
- package/src/lab/Lab.surface.test.tsx +7 -2
- package/src/lab/Lab.test.tsx +79 -1
- package/src/lab/Lab.tsx +124 -16
- package/src/lab/LabContext.ts +8 -0
- package/src/lab/LabFit.stories.tsx +4 -4
- package/src/lab/LabFullChrome.stories.tsx +1 -1
- package/src/lab/LabHeader.tsx +0 -1
- package/src/lab/LabRoot.test.tsx +56 -0
- package/src/lab/LabRoot.tsx +47 -0
- package/src/lab/LabShell.less +24 -3
- package/src/lab/LabShell.stories.tsx +50 -1
- package/src/lab/LabShell.tsx +18 -27
- package/src/lab/LabSwitcher.less +10 -10
- package/src/lab/LabSwitcher.test.tsx +14 -9
- package/src/lab/LabSwitcher.tsx +8 -4
- package/src/lab/Workspace.less +1 -1
- package/src/lab/Workspace.stories.tsx +1 -1
- package/src/lab/Workspace.surface.test.tsx +1 -1
- package/src/lab/index.ts +2 -0
- package/src/layers/LayerList.less +1 -1
- package/src/layers/LayerList.stories.tsx +2 -2
- package/src/loupe/AGENTS.md +16 -4
- package/src/loupe/LoupeGestures.tsx +67 -0
- package/src/loupe/TrialLoupe.tsx +43 -28
- package/src/loupe/index.ts +4 -0
- package/src/loupe/loupeActions.ts +98 -0
- package/src/loupe/useLoupe.test.tsx +59 -2
- package/src/loupe/useLoupe.ts +28 -48
- package/src/passthrough/weasel-ui.ts +3 -3
- package/src/primitives/FloatingPanel.stories.tsx +1 -1
- package/src/primitives/FpsMeter.less +6 -1
- package/src/primitives/FpsMeter.stories.tsx +1 -1
- package/src/primitives/FpsMeter.test.tsx +12 -4
- package/src/primitives/FpsMeter.tsx +6 -1
- package/src/primitives/JobProgress.stories.tsx +2 -2
- package/src/primitives/Legend.stories.tsx +1 -1
- package/src/primitives/ScaleIndicator.stories.tsx +1 -1
- package/src/primitives/Sidebar.less +7 -0
- package/src/primitives/Sidebar.stories.tsx +1 -1
- package/src/primitives/Split.test.tsx +25 -0
- package/src/primitives/Split.tsx +36 -20
- package/src/primitives/StatusBar.less +6 -0
- package/src/primitives/StatusBar.stories.tsx +1 -1
- package/src/primitives/Toolbar.stories.tsx +1 -1
- package/src/specimen/Specimen.less +95 -0
- package/src/specimen/Specimen.stories.tsx +13 -0
- package/src/specimen/Specimen.test.tsx +13 -0
- package/src/specimen/Specimen.tsx +888 -0
- package/src/state/Persistence.stories.tsx +4 -4
- package/src/state/store.test.ts +65 -0
- package/src/state/store.ts +32 -8
- package/src/state/types.ts +31 -2
- package/src/state/useTrialState.test.tsx +85 -0
- package/src/state/useTrialState.ts +9 -1
- package/src/state/view.test.ts +4 -4
- package/src/styles.less +1 -0
- package/src/surface/index.ts +1 -1
- package/src/surface/useSurfaceTile.test.tsx +1 -1
- package/src/surface/useTiledSurface.test.tsx +65 -10
- package/src/surface/useTiledSurface.ts +23 -11
- package/src/theme/Interstellar.stories.tsx +2 -2
- package/src/theme/interstellar.test.ts +16 -5
- package/src/theme/interstellar.theme.json +180 -0
- package/src/theme/interstellar.ts +8 -5
- package/src/tools/labTool.ts +3 -3
- package/src/trial/Trial.annotations.test.tsx +13 -4
- package/src/trial/Trial.canvas.test.tsx +36 -0
- package/src/trial/Trial.config.test.tsx +75 -2
- package/src/trial/Trial.less +4 -0
- package/src/trial/Trial.stories.tsx +4 -1
- package/src/trial/Trial.test.tsx +3 -0
- package/src/trial/Trial.tsx +21 -14
- package/src/trial/TrialChrome.tsx +17 -3
- package/src/trial/trialOps.test.ts +101 -1
- package/src/trial/trialOps.ts +62 -4
- package/dist/_dts/ToggleBar.d-DbHoWKIA.d.ts +0 -116
- package/dist/chunk-67SJLMC7.js.map +0 -1
- package/dist/chunk-6ZDGOZQV.js.map +0 -1
- package/dist/chunk-E44SU6XS.js +0 -50
- package/dist/chunk-E44SU6XS.js.map +0 -1
- package/dist/chunk-EKIICY6X.js.map +0 -1
- package/dist/chunk-KJALCDWE.js.map +0 -1
- package/dist/chunk-NDRYLVOW.js.map +0 -1
- package/dist/chunk-NS64DXMN.js.map +0 -1
- package/dist/chunk-PGETSEDK.js.map +0 -1
- package/dist/chunk-QLSV2N3G.js.map +0 -1
- package/dist/chunk-S2SHZRD7.js +0 -7681
- package/dist/chunk-S2SHZRD7.js.map +0 -1
- package/dist/chunk-TQBBYTAF.js +0 -280
- package/dist/chunk-TQBBYTAF.js.map +0 -1
- package/dist/chunk-ZPH5WTWF.js.map +0 -1
- package/src/canvas/useOrbit.test.ts +0 -167
- package/src/canvas/useOrbit.ts +0 -156
- package/src/theme/interstellar.tokens.json +0 -61
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode, RefObject } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { R as ResolvedConfig, C as ConfigPath, V as ValueAtPath, a as ConfigField, b as ConfigSchema } from './types-Db-3NNk1.js';
|
|
3
3
|
import { J as JobHandle, a as JobCapability } from './types-DJ79Tg5J.js';
|
|
4
4
|
import { Scene } from '@weasel-js/core';
|
|
5
5
|
|
|
@@ -31,6 +31,18 @@ declare function resolveFrame(spec: WorldSpec | undefined, size: ViewportSize):
|
|
|
31
31
|
* `draw` works in them. Must stay the exact inverse of `screenToWorld`. */
|
|
32
32
|
declare function applyCamera(ctx: CanvasRenderingContext2D, view: ViewTransform, frame?: WorldFrame): void;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Written at a config path to mean "do not pin this — let the instrument
|
|
36
|
+
* decide". Accepted by `setConfig`, by a trial's `configSeed`, and by
|
|
37
|
+
* `.initial()` in a schema. It is normalized into the trial's set of unpinned
|
|
38
|
+
* paths on the way into the store and is never itself stored, so a serialized
|
|
39
|
+
* trial contains no sentinel and the last pinned value survives.
|
|
40
|
+
*/
|
|
41
|
+
declare const auto: unique symbol;
|
|
42
|
+
/** The type of the `auto` sentinel, for widening a value parameter. */
|
|
43
|
+
type Auto = typeof auto;
|
|
44
|
+
declare function isAuto(value: unknown): value is Auto;
|
|
45
|
+
|
|
34
46
|
/** A sidebar section torn out of its trial, and where it went. */
|
|
35
47
|
interface UndockedPanel {
|
|
36
48
|
trialId: string;
|
|
@@ -73,6 +85,15 @@ interface TrialRecord<TS = unknown, TC = unknown, TV = unknown> {
|
|
|
73
85
|
* defaults. Kept so Reset restores the trial's own subject rather than the
|
|
74
86
|
* bare defaults. */
|
|
75
87
|
configSeed?: Partial<TC>;
|
|
88
|
+
/** Dotted paths the trial's seed config opened as auto. Kept beside
|
|
89
|
+
* `configSeed`, which cannot carry them: the sentinel is stripped on the way
|
|
90
|
+
* in, so Reset would otherwise have no way back to the state the trial
|
|
91
|
+
* opened in. Absent means none. */
|
|
92
|
+
autoSeed?: readonly string[];
|
|
93
|
+
/** Dotted paths this trial has unpinned. The value at such a path stays in
|
|
94
|
+
* `config` — it is what the field pins back to — but the instrument reads
|
|
95
|
+
* the resolver's value, or `undefined`, instead. Absent means none. */
|
|
96
|
+
auto?: readonly string[];
|
|
76
97
|
/** This trial's own tool slot. Undefined means it reads the lab's. */
|
|
77
98
|
activeToolId?: string | null;
|
|
78
99
|
/** The extent the trial's sidebar was last dragged to, in pixels. Undefined
|
|
@@ -101,10 +122,18 @@ interface SavedSnapshot {
|
|
|
101
122
|
instrumentName: string;
|
|
102
123
|
config: unknown;
|
|
103
124
|
state: unknown;
|
|
125
|
+
/** The trial's `auto` paths when saved; empty means every field was pinned.
|
|
126
|
+
* Absent on a snapshot saved before snapshots carried them, which loads
|
|
127
|
+
* over the trial's current set rather than guessing one. */
|
|
128
|
+
auto?: readonly string[];
|
|
104
129
|
savedAt: number;
|
|
105
130
|
}
|
|
106
131
|
/** `auto` follows the OS; the other two are an explicit choice. */
|
|
107
132
|
type LabMode = 'auto' | 'light' | 'dark';
|
|
133
|
+
/** How much room the lab's own chrome takes — the theme's density axis, named
|
|
134
|
+
* the way the theme names it. A lab's instruments are unaffected: this sizes
|
|
135
|
+
* the shell around them. */
|
|
136
|
+
type LabDensity = 'compact' | 'comfortable' | 'roomy';
|
|
108
137
|
/** Everything a lab persists: its trials, its saved snapshots, and the
|
|
109
138
|
* chosen color mode. */
|
|
110
139
|
interface LabStoreState {
|
|
@@ -147,9 +176,14 @@ interface TrialStateHandle<TS, TC> {
|
|
|
147
176
|
state: TS;
|
|
148
177
|
setState: (next: TS | ((prev: TS) => TS)) => void;
|
|
149
178
|
config: TC;
|
|
179
|
+
/** The config as stored, before any auto path is resolved. What the control
|
|
180
|
+
* panel renders, so an auto row pins back to the value it was holding. */
|
|
181
|
+
raw: TC;
|
|
182
|
+
/** Dotted paths this trial has unpinned. */
|
|
183
|
+
auto: ReadonlySet<string>;
|
|
150
184
|
/** Write one config value, by dotted path — `'grid.size'` for a leaf under
|
|
151
185
|
* an `f.group`, `'cellSize'` for one at the root. */
|
|
152
|
-
setConfig: <P extends ConfigPath<TC> & string>(path: P, value: ValueAtPath<TC, P>) => void;
|
|
186
|
+
setConfig: <P extends ConfigPath<TC> & string>(path: P, value: ValueAtPath<TC, P> | Auto) => void;
|
|
153
187
|
}
|
|
154
188
|
/** Options for `createLabStore`, which knows nothing about storage. */
|
|
155
189
|
interface CreateLabStoreOptions {
|
|
@@ -164,6 +198,10 @@ interface CreateLabStoreOptions {
|
|
|
164
198
|
/** Each instrument's `migrateConfig`, keyed by instrument name, run on a
|
|
165
199
|
* stored config before its defaults fill it. */
|
|
166
200
|
configMigrations?: Record<string, (stored: unknown) => unknown>;
|
|
201
|
+
/** Each instrument's resolved config schema, keyed by instrument name. What
|
|
202
|
+
* a trial's auto paths are read against, away from the lab that would
|
|
203
|
+
* otherwise supply the rules. */
|
|
204
|
+
configSchemas?: Record<string, ResolvedConfig>;
|
|
167
205
|
/** How each instrument's state survives a reload. Hydration is the first
|
|
168
206
|
* thing `createLabStore` does, so these have to arrive with the store. */
|
|
169
207
|
serializers?: InstrumentSerializers;
|
|
@@ -176,6 +214,7 @@ interface InstrumentHooks {
|
|
|
176
214
|
serializers: InstrumentSerializers;
|
|
177
215
|
configDefaults: Record<string, () => unknown>;
|
|
178
216
|
configMigrations: Record<string, (stored: unknown) => unknown>;
|
|
217
|
+
configSchemas: Record<string, ResolvedConfig>;
|
|
179
218
|
}
|
|
180
219
|
/** Per-instrument serialize/deserialize hooks, keyed by instrument name. An
|
|
181
220
|
* instrument whose state is already JSON-safe needs no entry. `deserialize`
|
|
@@ -230,12 +269,18 @@ interface ToolbarItem<TCtx = TrialChromeContext> {
|
|
|
230
269
|
* zero-argument handler stays valid. */
|
|
231
270
|
onActivate: (ctx: TCtx) => void;
|
|
232
271
|
}
|
|
233
|
-
/** A
|
|
234
|
-
|
|
272
|
+
/** A tool in the palette region: a mode by default, a command when it carries
|
|
273
|
+
* an `onActivate`. `TCtx` is the chrome context that handler is handed — a
|
|
274
|
+
* trial's, or the lab's for a lab-level rail. */
|
|
275
|
+
interface ToolItem<TCtx = TrialChromeContext> {
|
|
235
276
|
icon: IconComponent;
|
|
236
277
|
label: string;
|
|
278
|
+
/** Shown in the tooltip. Not bound here — the trial owns its keymap. */
|
|
237
279
|
shortcut?: string;
|
|
238
280
|
disabled?: boolean;
|
|
281
|
+
/** Runs on press instead of selecting. An item with one is a command: it
|
|
282
|
+
* never writes the tool slot, and never reads as the current tool. */
|
|
283
|
+
onActivate?: (ctx: TCtx) => void;
|
|
239
284
|
}
|
|
240
285
|
/** A titled block in the sidebar. */
|
|
241
286
|
interface SidebarSection {
|
|
@@ -368,6 +413,9 @@ interface TrialChromeContext extends ToolSlotContext, SidebarSlotContext {
|
|
|
368
413
|
* `config`, since a builder schema has no `ConfigField[]` form. */
|
|
369
414
|
configFields: ConfigField[];
|
|
370
415
|
config: unknown;
|
|
416
|
+
/** The trial's unpinned paths. `config` stays raw, so a control drawn from
|
|
417
|
+
* it sits at the value un-pinning writes back. */
|
|
418
|
+
auto: ReadonlySet<string>;
|
|
371
419
|
setConfig: (key: string, value: unknown) => void;
|
|
372
420
|
/** Which of this trial's collapsible sections are folded. A sidebar
|
|
373
421
|
* section's key is its contribution id; a section *inside* a contribution —
|
|
@@ -980,5 +1028,5 @@ declare function fracContains(box: FracRect, pt: FracPoint, tol?: number): boole
|
|
|
980
1028
|
* answers false for two rects that merely overlap. */
|
|
981
1029
|
declare function fracEncloses(outer: FracRect, inner: FracRect): boolean;
|
|
982
1030
|
|
|
983
|
-
export { DEFAULT_FRAME as D, LOUPE_DEFAULTS as
|
|
984
|
-
export type {
|
|
1031
|
+
export { DEFAULT_FRAME as D, LOUPE_DEFAULTS as a9, fracContains as aA, fracEncloses as aB, fracToWorld as aC, isAuto as aD, resolveLoupe as aE, roundFrac as aF, worldToFrac as aG, annotationsFromJSON as aw, auto as ax, createAnnotationScene as ay, createAnnotationStore as az, applyCamera as b, dockPanel as j, panelKey as p, resolveFrame as r, undockPanel as u };
|
|
1032
|
+
export type { AnnotationTargetInfo as $, AnnotationData as A, AnnotationTarget as B, CreateLabStoreOptions as C, AnnotationsApi as E, AnnotationsCapability as F, TrialInfo as G, TrialTool as H, InstrumentSerializers as I, AnnotationKind as J, Instrument as K, LabDocument as L, Migration as M, LabDensity as N, TrialContribution as O, PaletteItem as P, Annotation as Q, AnnotationInit as R, SerializedTrial as S, TrialRecord as T, UndoStack as U, ViewportSize as V, WorldFrame as W, AnnotationPatch as X, AnnotationQuery as Y, AnnotationStatus as Z, AnnotationStoreOptions as _, WorldSpec as a, Auto as a0, CanvasCapability as a1, CanvasLayer as a2, CaptureDeps as a3, ContributionBase as a4, FracPoint as a5, FracRect as a6, HitResult as a7, IconComponent as a8, LoupePoint as aH, LoupeMode as aI, LayerCapability as aa, LayerDescriptor as ab, LoupeCapability as ac, LoupeDeclaration as ad, LoupeRenderArgs as ae, RegionContribution as af, RenderContext as ag, ResolvedLoupe as ah, SerializedAnnotations as ai, SidebarSection as aj, SidebarSlotContext as ak, StageCapability as al, StatusReadout as am, SystemEvent as an, ToolCapability as ao, ToolItem as ap, ToolSlotContext as aq, ToolbarItem as ar, TrialChromeContext as as, TrialRegion as at, UndoCapability as au, ViewportControl as av, StorageAdapter as c, LabStoreState as d, SavedSnapshot as e, StorageChange as f, TrialStateHandle as g, UndockedPanel as h, UndockedPanels as i, ViewTransform as k, Point as l, DragFeedback as m, DragDropCapability as n, LabMode as o, InstrumentList as q, InstrumentHooks as s, WorldRect as t, AnnotationMeaning as v, MarkScene as w, CaptureSource as x, CaptureOptions as y, CaptureResult as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { ToolPrefNumberFormat } from '@weasel-js/core';
|
|
4
|
-
import { R as ResolvedConfig, a as ConfigField, d as ControlRenderer } from './types-
|
|
4
|
+
import { R as ResolvedConfig, a as ConfigField, d as ControlRenderer } from './types-Db-3NNk1.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* How much room a container gives its rows — gaps, padding, and field height,
|
|
@@ -100,11 +100,26 @@ interface PropertyRowProps extends PropertyMetricProps {
|
|
|
100
100
|
span?: boolean;
|
|
101
101
|
children: ReactNode;
|
|
102
102
|
htmlFor?: string;
|
|
103
|
+
/** The control is a group of several (a segmented toggle), not one element.
|
|
104
|
+
* The row then renders as a `<div>`: a `<label>` hands a click on its text to
|
|
105
|
+
* its first control, which in a group means selecting the first option. Each
|
|
106
|
+
* member has to carry its own name. */
|
|
107
|
+
group?: boolean;
|
|
103
108
|
className?: string;
|
|
109
|
+
/** The row is auto: its value is not pinned and the owner computes it. The
|
|
110
|
+
* control is hidden — its box kept, so the row does not resize — and the
|
|
111
|
+
* row reads out the word instead. */
|
|
112
|
+
auto?: boolean;
|
|
113
|
+
/** Given, the row's label toggles `auto` when it is clicked. Omitted, the row
|
|
114
|
+
* can show an auto state but not change it.
|
|
115
|
+
*
|
|
116
|
+
* The label then names that toggle, so a control passed as `children` has to
|
|
117
|
+
* carry its own accessible name — every row in this module does. */
|
|
118
|
+
onAutoChange?: (next: boolean) => void;
|
|
104
119
|
}
|
|
105
120
|
/** The label-plus-control frame every typed row below is built from. Use it
|
|
106
121
|
* directly for a control this module does not cover. */
|
|
107
|
-
declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, className, density, align, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
122
|
+
declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, group, className, density, align, auto, onAutoChange, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
108
123
|
/** Props for `<SliderRow>`. */
|
|
109
124
|
interface SliderRowProps extends PropertyMetricProps {
|
|
110
125
|
label: ReactNode;
|
|
@@ -126,6 +141,12 @@ interface SliderRowProps extends PropertyMetricProps {
|
|
|
126
141
|
onInput?: (next: number) => void;
|
|
127
142
|
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
128
143
|
format?: (value: number) => ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Static text in place of the editable readout. Use it when the row is not
|
|
146
|
+
* showing a number a caller could type back — an auto row's `auto`, say,
|
|
147
|
+
* which an editable field would seed a draft with and then fail to parse.
|
|
148
|
+
*/
|
|
149
|
+
readout?: ReactNode;
|
|
129
150
|
/** A named display for the value: `compact` reads `2.0M`. `format` wins when both are given. */
|
|
130
151
|
notation?: ToolPrefNumberFormat;
|
|
131
152
|
/**
|
|
@@ -138,10 +159,14 @@ interface SliderRowProps extends PropertyMetricProps {
|
|
|
138
159
|
description?: string;
|
|
139
160
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
140
161
|
span?: boolean;
|
|
162
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
163
|
+
auto?: boolean;
|
|
164
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
165
|
+
onAutoChange?: (next: boolean) => void;
|
|
141
166
|
}
|
|
142
167
|
/** A bounded number edited by dragging, with a live readout whose precision
|
|
143
168
|
* follows `step`. */
|
|
144
|
-
declare function SliderRow({ label, value, min, max, step, onChange, onInput, format, notation, unit, layout, description, span, density, align, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
declare function SliderRow({ label, value, min, max, step, onChange, onInput, format, readout, notation, unit, layout, description, span, density, align, auto, onAutoChange, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
145
170
|
/** Props for `<ColorRow>`. */
|
|
146
171
|
interface ColorRowProps extends PropertyMetricProps {
|
|
147
172
|
label: ReactNode;
|
|
@@ -172,11 +197,17 @@ interface ColorRowProps extends PropertyMetricProps {
|
|
|
172
197
|
/** Label beside the swatch (default) or above it. */
|
|
173
198
|
layout?: PropertyRowLayout;
|
|
174
199
|
description?: string;
|
|
200
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
201
|
+
readout?: ReactNode;
|
|
175
202
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
176
203
|
span?: boolean;
|
|
204
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
205
|
+
auto?: boolean;
|
|
206
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
207
|
+
onAutoChange?: (next: boolean) => void;
|
|
177
208
|
}
|
|
178
209
|
/** A color swatch, optionally with an alpha slider beneath it. */
|
|
179
|
-
declare function ColorRow({ label, value, onChange, onInput, alpha, onAlphaChange, onAlphaInput, alphaDisabled, layout, description, span, density, align, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
declare function ColorRow({ label, readout, value, onChange, onInput, alpha, onAlphaChange, onAlphaInput, alphaDisabled, layout, description, span, density, align, auto, onAutoChange, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
180
211
|
/** Props for `<CheckboxRow>`. */
|
|
181
212
|
interface CheckboxRowProps extends PropertyMetricProps {
|
|
182
213
|
label: ReactNode;
|
|
@@ -186,11 +217,17 @@ interface CheckboxRowProps extends PropertyMetricProps {
|
|
|
186
217
|
/** Label beside the box (default) or above it. */
|
|
187
218
|
layout?: PropertyRowLayout;
|
|
188
219
|
description?: string;
|
|
220
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
221
|
+
readout?: ReactNode;
|
|
189
222
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
190
223
|
span?: boolean;
|
|
224
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
225
|
+
auto?: boolean;
|
|
226
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
227
|
+
onAutoChange?: (next: boolean) => void;
|
|
191
228
|
}
|
|
192
229
|
/** A boolean checkbox. */
|
|
193
|
-
declare function CheckboxRow({ label, value, onChange, layout, span, description, density, align, }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
230
|
+
declare function CheckboxRow({ label, readout, value, onChange, layout, span, description, density, align, auto, onAutoChange, }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
194
231
|
/** Props for `<TextRow>`. */
|
|
195
232
|
interface TextRowProps extends PropertyMetricProps {
|
|
196
233
|
label: ReactNode;
|
|
@@ -201,11 +238,17 @@ interface TextRowProps extends PropertyMetricProps {
|
|
|
201
238
|
maxLength?: number;
|
|
202
239
|
layout?: PropertyRowLayout;
|
|
203
240
|
description?: string;
|
|
241
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
242
|
+
readout?: ReactNode;
|
|
204
243
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
205
244
|
span?: boolean;
|
|
245
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
246
|
+
auto?: boolean;
|
|
247
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
248
|
+
onAutoChange?: (next: boolean) => void;
|
|
206
249
|
}
|
|
207
250
|
/** A single-line text input. */
|
|
208
|
-
declare function TextRow({ label, value, onChange, placeholder, maxLength, layout, description, span, density, align, }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
251
|
+
declare function TextRow({ label, readout, value, onChange, placeholder, maxLength, layout, description, span, density, align, auto, onAutoChange, }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
209
252
|
/** Props for `<NumberRow>`. */
|
|
210
253
|
interface NumberRowProps extends PropertyMetricProps {
|
|
211
254
|
label: ReactNode;
|
|
@@ -235,12 +278,18 @@ interface NumberRowProps extends PropertyMetricProps {
|
|
|
235
278
|
unit?: ReactNode;
|
|
236
279
|
layout?: PropertyRowLayout;
|
|
237
280
|
description?: string;
|
|
281
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
282
|
+
readout?: ReactNode;
|
|
238
283
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
239
284
|
span?: boolean;
|
|
285
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
286
|
+
auto?: boolean;
|
|
287
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
288
|
+
onAutoChange?: (next: boolean) => void;
|
|
240
289
|
}
|
|
241
290
|
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
242
291
|
* more than the exact value. */
|
|
243
|
-
declare function NumberRow({ label, value, onChange, onInput, min, max, step, placeholder, unit, layout, description, span, density, align, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
292
|
+
declare function NumberRow({ label, readout, value, onChange, onInput, min, max, step, placeholder, unit, layout, description, span, density, align, auto, onAutoChange, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
244
293
|
interface PropertyOption<T extends string> {
|
|
245
294
|
value: T;
|
|
246
295
|
label: ReactNode;
|
|
@@ -256,12 +305,18 @@ interface SelectRowProps<T extends string> extends PropertyMetricProps {
|
|
|
256
305
|
placeholder?: string;
|
|
257
306
|
layout?: PropertyRowLayout;
|
|
258
307
|
description?: string;
|
|
308
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
309
|
+
readout?: ReactNode;
|
|
259
310
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
260
311
|
span?: boolean;
|
|
312
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
313
|
+
auto?: boolean;
|
|
314
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
315
|
+
onAutoChange?: (next: boolean) => void;
|
|
261
316
|
}
|
|
262
317
|
/** A dropdown over a fixed set of choices. Prefer `<ToggleRow>` when there
|
|
263
318
|
* are only two or three and they should all stay visible. */
|
|
264
|
-
declare function SelectRow<T extends string>({ label, value, options, onChange, placeholder, layout, description, span, density, align, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
319
|
+
declare function SelectRow<T extends string>({ label, readout, value, options, onChange, placeholder, layout, description, span, density, align, auto, onAutoChange, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
265
320
|
/** Props for `<ToggleRow>`. */
|
|
266
321
|
interface ToggleRowProps<T extends string> extends PropertyMetricProps {
|
|
267
322
|
label: ReactNode;
|
|
@@ -270,12 +325,18 @@ interface ToggleRowProps<T extends string> extends PropertyMetricProps {
|
|
|
270
325
|
onChange: (next: T) => void;
|
|
271
326
|
layout?: PropertyRowLayout;
|
|
272
327
|
description?: string;
|
|
328
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
329
|
+
readout?: ReactNode;
|
|
273
330
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
274
331
|
span?: boolean;
|
|
332
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
333
|
+
auto?: boolean;
|
|
334
|
+
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
335
|
+
onAutoChange?: (next: boolean) => void;
|
|
275
336
|
}
|
|
276
337
|
/** A segmented control: the same choice as a select, with every option
|
|
277
338
|
* visible at once. */
|
|
278
|
-
declare function ToggleRow<T extends string>({ label, value, options, onChange, layout, description, span, density, align, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
339
|
+
declare function ToggleRow<T extends string>({ label, readout, value, options, onChange, layout, description, span, density, align, auto, onAutoChange, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
279
340
|
|
|
280
341
|
/** How a panel packs its rows into the two-column property grid.
|
|
281
342
|
* - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
|
|
@@ -330,6 +391,12 @@ interface ControlPanelProps<TC extends Record<string, unknown>> {
|
|
|
330
391
|
/** A fold moved. The key is a section's label — prefixed by its group's
|
|
331
392
|
* dotted path when the section sits inside one — or a group's own path. */
|
|
332
393
|
onCollapse?: (key: string, collapsed: boolean) => void;
|
|
394
|
+
/** Dotted paths currently unpinned. A row in this set hides its control and
|
|
395
|
+
* reads out `auto`, and clicking its label writes the sentinel back through
|
|
396
|
+
* `setConfig`. Omitted, the panel keeps the set itself: the labels still
|
|
397
|
+
* toggle and the sentinel never reaches `setConfig`, which would otherwise
|
|
398
|
+
* store it as the row's value. */
|
|
399
|
+
auto?: ReadonlySet<string>;
|
|
333
400
|
/** Draw leaves marked `hidden`. */
|
|
334
401
|
showHidden?: boolean;
|
|
335
402
|
className?: string;
|
|
@@ -337,7 +404,7 @@ interface ControlPanelProps<TC extends Record<string, unknown>> {
|
|
|
337
404
|
/** Render an instrument's config schema as a stack of controls, each writing
|
|
338
405
|
* back through `setConfig`. Built on the property rows, so a lab's controls
|
|
339
406
|
* are the same aligned, themed rows the rest of the kit uses. */
|
|
340
|
-
declare function ControlPanel<TC extends Record<string, unknown>>({ schema, fields, config, setConfig, renderers, pack, layout, density, align, collapse, collapsed, onCollapse, showHidden, className, }: ControlPanelProps<TC>): react_jsx_runtime.JSX.Element;
|
|
407
|
+
declare function ControlPanel<TC extends Record<string, unknown>>({ schema, fields, config, setConfig, renderers, pack, layout, density, align, collapse, collapsed, onCollapse, auto: given, showHidden, className, }: ControlPanelProps<TC>): react_jsx_runtime.JSX.Element;
|
|
341
408
|
|
|
342
409
|
export { CheckboxRow as C, NumberRow as N, SelectRow as S, TextRow as T, ColorRow as c, ControlPanel as e, PropertyList as g, PropertyPanel as j, PropertyRow as l, PropertySpan as p, SliderRow as s, ToggleRow as v };
|
|
343
410
|
export type { PropertyMetricProps as P, PropertyListPack as a, CheckboxRowProps as b, ColorRowProps as d, NumberRowProps as f, PropertyListProps as h, PropertyOption as i, PropertyPanelProps as k, PropertyRowLayout as m, PropertyRowProps as n, PropertyRowVariant as o, PropertySpanProps as q, SelectRowProps as r, SliderRowProps as t, TextRowProps as u, ToggleRowProps as w };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as ControlRenderer, c as ConfigRule } from './types-
|
|
2
|
-
import { K as Instrument,
|
|
1
|
+
import { d as ControlRenderer, c as ConfigRule } from './types-Db-3NNk1.js';
|
|
2
|
+
import { K as Instrument, as as TrialChromeContext, O as TrialContribution, T as TrialRecord, q as InstrumentList, e as SavedSnapshot, o as LabMode, aq as ToolSlotContext, a4 as ContributionBase, ar as ToolbarItem, ap as ToolItem, aj as SidebarSection, am as StatusReadout, H as TrialTool, af as RegionContribution, ak as SidebarSlotContext } from './frac-B4hFJMiN.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
@@ -52,6 +52,14 @@ interface LabContextValue {
|
|
|
52
52
|
closeTrial: (id: string) => void;
|
|
53
53
|
resetTrial: (id: string) => void;
|
|
54
54
|
reorderTrials: (ids: readonly string[]) => void;
|
|
55
|
+
/** Put a fresh trial running `instrumentName` in trial `id`'s place, at its
|
|
56
|
+
* size. The replacement has a new id, and takes the focus if `id` had it. */
|
|
57
|
+
swapTrial: (id: string, instrumentName: string, options?: AddTrialOptions) => void;
|
|
58
|
+
/** The trial last pointed at or focused, counting focus that moved into a
|
|
59
|
+
* frame inside it. A trial `addTrial` or `cloneTrial` opens takes it. Falls
|
|
60
|
+
* back to the first trial; null only when there are none. */
|
|
61
|
+
focusedTrialId: string | null;
|
|
62
|
+
focusTrial: (id: string) => void;
|
|
55
63
|
savedSnapshots: SavedSnapshot[];
|
|
56
64
|
saveSnapshot: (trialId: string, name?: string) => void;
|
|
57
65
|
loadSnapshot: (trialId: string, snapshotId: string) => void;
|
|
@@ -75,7 +83,7 @@ declare function useLabContext(): LabContextValue;
|
|
|
75
83
|
* `<LabShell>` names them; `palette` is the tool rail down the side of the
|
|
76
84
|
* workspace; `sidebar` is a column of sections left of the tool rail.
|
|
77
85
|
*/
|
|
78
|
-
type LabRegion = 'header' | 'palette' | 'sidebar' | 'footer';
|
|
86
|
+
type LabRegion = 'header' | 'palette' | 'sidebar' | 'aside' | 'footer';
|
|
79
87
|
/**
|
|
80
88
|
* Everything a lab-level contribution can read and command: the lab's own
|
|
81
89
|
* state and operations, plus the lab's tool slot — which every trial whose
|
|
@@ -99,10 +107,10 @@ type LabContribution<TCtx = LabChromeContext> = (ContributionBase & {
|
|
|
99
107
|
render?: never;
|
|
100
108
|
}) | (ContributionBase & {
|
|
101
109
|
region: 'palette';
|
|
102
|
-
item: ToolItem
|
|
110
|
+
item: ToolItem<TCtx>;
|
|
103
111
|
render?: never;
|
|
104
112
|
}) | (ContributionBase & {
|
|
105
|
-
region: 'sidebar';
|
|
113
|
+
region: 'sidebar' | 'aside';
|
|
106
114
|
item: SidebarSection;
|
|
107
115
|
render?: never;
|
|
108
116
|
}) | (ContributionBase & {
|
|
@@ -138,6 +146,9 @@ declare function LabHeaderRegion({ contributions }: LabRegionProps): react_jsx_r
|
|
|
138
146
|
/** The lab's sidebar sections. Fold state is a lab-scoped persisted value, so it
|
|
139
147
|
* survives a reload in a stored lab and lasts the session in an unstored one. */
|
|
140
148
|
declare function LabSidebarRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
/** The lab's aside sections, on the far side of the workspace from the sidebar.
|
|
150
|
+
* Fold state persists the way the sidebar's does. */
|
|
151
|
+
declare function LabAsideRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
|
|
141
152
|
/** The lab's readouts, in the shell footer below the workspace. */
|
|
142
153
|
declare function LabFooterRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
|
|
143
154
|
|
|
@@ -170,7 +181,8 @@ interface PaletteRegionProps<TCtx extends ToolSlotContext = TrialChromeContext>
|
|
|
170
181
|
region?: string;
|
|
171
182
|
}
|
|
172
183
|
/** A tool strip: a trial's, or the lab's. Selection lives in whichever tool
|
|
173
|
-
* slot the context carries; this region only reflects it.
|
|
184
|
+
* slot the context carries; this region only reflects it. An item carrying
|
|
185
|
+
* `onActivate` is a command instead — it presses, and never latches. */
|
|
174
186
|
declare function PaletteRegion<TCtx extends ToolSlotContext = TrialChromeContext>({ contributions, ctx, region, }: PaletteRegionProps<TCtx>): react_jsx_runtime.JSX.Element | null;
|
|
175
187
|
|
|
176
188
|
/** Props for `<SidebarRegion>`. */
|
|
@@ -233,5 +245,5 @@ interface ViewportRegionProps {
|
|
|
233
245
|
*/
|
|
234
246
|
declare function ViewportRegion({ contributions, ctx }: ViewportRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
235
247
|
|
|
236
|
-
export {
|
|
237
|
-
export type { AddTrialOptions as A, LabContribution as L, TitleBarPlacement as T, LabChromeContext as
|
|
248
|
+
export { resetTrial as B, suppressContributions as C, toolContributions as D, useLabChromeContext as E, useLabContext as F, PaletteRegion as P, SidebarRegion as S, ViewportRegion as V, LabAsideRegion as a, LabContext as c, LabFooterRegion as e, LabHeaderRegion as f, LabSidebarRegion as i, StatusRegion as l, TitleBarRegion as n, ToolbarRegion as p, addTrial as s, builtinContributions as t, cloneTrial as u, closeTrial as v, contributionsIn as w, labContributions as x, mergeContributions as y, reorderTrials as z };
|
|
249
|
+
export type { AddTrialOptions as A, LabContribution as L, TitleBarPlacement as T, LabChromeContext as b, LabContextValue as d, LabRegion as g, LabRegionProps as h, PaletteRegionProps as j, SidebarRegionProps as k, StatusRegionProps as m, TitleBarRegionProps as o, ToolbarRegionProps as q, ViewportRegionProps as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ToolPrefNumberFormat, ToolPrefLeaf, ToolPrefGroup } from '@weasel-js/core';
|
|
2
|
-
import { P as PrefRenderer } from './PrefsForm.d-
|
|
1
|
+
import { ToolPrefNumberFormat, ToolPrefNumberUnit, ToolPrefLeaf, ToolPrefGroup } from '@weasel-js/core';
|
|
2
|
+
import { P as PrefRenderer } from './PrefsForm.d-DPy9I8It.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Renders the control cell for one config leaf. Identical to weasel-ui's
|
|
@@ -26,6 +26,11 @@ interface Annotations {
|
|
|
26
26
|
suffix?: string;
|
|
27
27
|
/** How a number's value is shown. `compact` abbreviates from a thousand up. */
|
|
28
28
|
format?: ToolPrefNumberFormat;
|
|
29
|
+
/** Display-unit conversion for a number stored in a canonical unit — the
|
|
30
|
+
* value, its bounds and its step all convert at the control's edge. */
|
|
31
|
+
unit?: ToolPrefNumberUnit;
|
|
32
|
+
/** A color leaf's value carries alpha (`#rrggbbaa`) and its row edits it. */
|
|
33
|
+
alpha?: boolean;
|
|
29
34
|
control?: string;
|
|
30
35
|
options?: readonly ConfigOption[];
|
|
31
36
|
placeholder?: string;
|
|
@@ -73,6 +78,10 @@ interface SectionSpec {
|
|
|
73
78
|
* whether or not it was given a panel-wide `collapse`; a fold the reader
|
|
74
79
|
* has since toggled outranks it. */
|
|
75
80
|
collapsed?: boolean;
|
|
81
|
+
/** Where the section's rows put their labels, over the panel's `layout`. */
|
|
82
|
+
layout?: 'block' | 'inline';
|
|
83
|
+
/** How the section packs its rows, over the panel's `pack`. */
|
|
84
|
+
pack?: 'auto' | 'pairs' | 'one-up';
|
|
76
85
|
}
|
|
77
86
|
/** A schema resolved against a set of rules: the vocabulary weasel-ui renders,
|
|
78
87
|
* plus the three things labkit keeps on the side because `PrefLeaf` has no
|
|
@@ -92,11 +101,26 @@ interface ResolvedConfig {
|
|
|
92
101
|
interface SectionOption {
|
|
93
102
|
label: string;
|
|
94
103
|
collapsed?: boolean;
|
|
104
|
+
/** Where the section's rows put their labels, over the panel's `layout`. */
|
|
105
|
+
layout?: 'block' | 'inline';
|
|
106
|
+
/** How the section packs its rows, over the panel's `pack`. */
|
|
107
|
+
pack?: 'auto' | 'pairs' | 'one-up';
|
|
95
108
|
}
|
|
96
109
|
/** Per-node extras that do not belong on a `PrefLeaf`. */
|
|
97
110
|
interface NodeOptions extends BranchOptions {
|
|
98
111
|
render?: ControlRenderer;
|
|
99
|
-
|
|
112
|
+
/** Errors for this leaf under `config`, the instrument's whole config. */
|
|
113
|
+
validate?: (leaf: ToolPrefLeaf, config: Record<string, unknown>) => string[];
|
|
114
|
+
/** Computes this leaf's value while it is auto. Attaching one is what gives
|
|
115
|
+
* the row a real value to pin back to and keeps the instrument off
|
|
116
|
+
* `?? compute()`. */
|
|
117
|
+
autoResolve?: (config: Record<string, unknown>) => unknown;
|
|
118
|
+
/** The leaf starts auto rather than pinned at its default. Set by
|
|
119
|
+
* `.initial(auto)`. */
|
|
120
|
+
unpinned?: boolean;
|
|
121
|
+
/** The leaf can never be auto: the row's label does not toggle. For a value
|
|
122
|
+
* the instrument cannot receive as `undefined`. */
|
|
123
|
+
manual?: boolean;
|
|
100
124
|
}
|
|
101
125
|
/** What a branch can say about itself, beyond its children. */
|
|
102
126
|
interface BranchOptions {
|
|
@@ -226,4 +250,4 @@ interface ColorField extends ConfigFieldBase {
|
|
|
226
250
|
* panel renders, and what `validateConfigSchema` checks. */
|
|
227
251
|
type ConfigField = SliderField | CheckboxField | SelectField | NumberField | TextField | ColorField;
|
|
228
252
|
|
|
229
|
-
export type { Annotations as A, BranchAnnotations as B, ConfigPath as C, EntryValue as E, InferConfig as I, LeafPatch as L, NodeOptions as N, ResolvedConfig as R, SectionSpec as S, TextField as T, ValueAtPath as V, ConfigField as a, ConfigSchema as b, ConfigRule as c, ControlRenderer as d, BranchOptions as e, CheckboxField as f, ColorField as g, ConfigBranch as h, ConfigEntry as i, ConfigFieldBase as j, ConfigFieldType as k, ConfigNode as l, ConfigOf as m, ConfigOption as n, ConfigRuleContext as o, ConfigShape as p, NodeValue as q, NumberField as r, SelectField as s, SelectOption as t, SliderField as u };
|
|
253
|
+
export type { Annotations as A, BranchAnnotations as B, ConfigPath as C, EntryValue as E, InferConfig as I, LeafPatch as L, NodeOptions as N, ResolvedConfig as R, SectionSpec as S, TextField as T, ValueAtPath as V, ConfigField as a, ConfigSchema as b, ConfigRule as c, ControlRenderer as d, BranchOptions as e, CheckboxField as f, ColorField as g, ConfigBranch as h, ConfigEntry as i, ConfigFieldBase as j, ConfigFieldType as k, ConfigNode as l, ConfigOf as m, ConfigOption as n, ConfigRuleContext as o, ConfigShape as p, NodeValue as q, NumberField as r, SelectField as s, SelectOption as t, SliderField as u, SectionOption as v };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, WheelEvent, PointerEvent as PointerEvent$1 } from 'react';
|
|
3
|
-
import { k as ViewTransform, a as WorldSpec, V as ViewportSize, l as Point, W as WorldFrame } from './frac-
|
|
4
|
-
import { C as CanvasLayerDescriptor } from './CanvasStackContext-
|
|
3
|
+
import { k as ViewTransform, a as WorldSpec, V as ViewportSize, l as Point, W as WorldFrame } from './frac-B4hFJMiN.js';
|
|
4
|
+
import { C as CanvasLayerDescriptor } from './CanvasStackContext-CMMo180l.js';
|
|
5
5
|
|
|
6
6
|
/** Props for `<CanvasStack>`. */
|
|
7
7
|
interface CanvasStackProps {
|
|
@@ -88,49 +88,6 @@ declare function fitStage(size: ViewportSize, viewport: ViewportSize): ViewTrans
|
|
|
88
88
|
*/
|
|
89
89
|
declare function Stage({ size, view: viewProp, onViewChange, minZoom, maxZoom, onResize, hostRef, overlay, children, }: StageProps): react_jsx_runtime.JSX.Element;
|
|
90
90
|
|
|
91
|
-
/** A point in the space the instrument works in. */
|
|
92
|
-
interface Vec3 {
|
|
93
|
-
x: number;
|
|
94
|
-
y: number;
|
|
95
|
-
z: number;
|
|
96
|
-
}
|
|
97
|
-
/** An orbit camera as a trial view: where it looks from, and what it looks at.
|
|
98
|
-
* labkit does not turn this into a matrix — the host's renderer does. */
|
|
99
|
-
interface OrbitView {
|
|
100
|
-
yaw: number;
|
|
101
|
-
pitch: number;
|
|
102
|
-
distance: number;
|
|
103
|
-
target: Vec3;
|
|
104
|
-
}
|
|
105
|
-
/** Just short of the pole. At exactly ±PI/2 the azimuth is undefined and the
|
|
106
|
-
* camera rolls, which reads as the model jumping rather than as a limit. */
|
|
107
|
-
declare const PITCH_LIMIT: number;
|
|
108
|
-
declare function clampPitch(pitch: number): number;
|
|
109
|
-
declare function wrapYaw(yaw: number): number;
|
|
110
|
-
/** The view a drag of (dx, dy) from `start` produces. Absolute against the drag
|
|
111
|
-
* start, so it can be re-applied any number of times without compounding. */
|
|
112
|
-
declare function orbitAfterDrag(start: OrbitView, dx: number, dy: number): OrbitView;
|
|
113
|
-
/** Multiplicative, so one notch covers the same proportion of the distance
|
|
114
|
-
* whether the camera is near or far. */
|
|
115
|
-
declare function orbitAfterWheel(view: OrbitView, deltaY: number, minDistance: number, maxDistance: number): OrbitView;
|
|
116
|
-
interface UseOrbitOptions {
|
|
117
|
-
view: OrbitView;
|
|
118
|
-
onViewChange: (v: OrbitView) => void;
|
|
119
|
-
/** Restored on double-click. Defaults to the view the hook first saw. */
|
|
120
|
-
home?: OrbitView;
|
|
121
|
-
minDistance?: number;
|
|
122
|
-
maxDistance?: number;
|
|
123
|
-
}
|
|
124
|
-
interface OrbitHandlers {
|
|
125
|
-
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
126
|
-
onPointerDown: (e: PointerEvent$1<HTMLElement>) => void;
|
|
127
|
-
onDoubleClick: () => void;
|
|
128
|
-
isDragging: () => boolean;
|
|
129
|
-
}
|
|
130
|
-
/** Pointer gestures over an orbit view: drag to turn, wheel or pinch to dolly,
|
|
131
|
-
* double-click to go home. The 3D peer of `usePanZoom`. */
|
|
132
|
-
declare function useOrbit({ view, onViewChange, home, minDistance, maxDistance, }: UseOrbitOptions): OrbitHandlers;
|
|
133
|
-
|
|
134
91
|
interface UsePanZoomOptions {
|
|
135
92
|
view: ViewTransform;
|
|
136
93
|
onViewChange: (v: ViewTransform) => void;
|
|
@@ -156,5 +113,5 @@ interface PanZoomHandlers {
|
|
|
156
113
|
}
|
|
157
114
|
declare function usePanZoom({ view, onViewChange, minZoom, maxZoom, frame, onTap, }: UsePanZoomOptions): PanZoomHandlers;
|
|
158
115
|
|
|
159
|
-
export { CanvasStack as C,
|
|
160
|
-
export type {
|
|
116
|
+
export { CanvasStack as C, Stage as S, centerOn as c, fitStage as f, screenToWorld as s, usePanZoom as u, worldToScreen as w, zoomAt as z };
|
|
117
|
+
export type { PanZoomHandlers as P, UsePanZoomOptions as U, ZoomAtOptions as Z, CanvasStackProps as a, StageProps as b };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as StorageAdapter, d as LabStoreState, T as TrialRecord, e as SavedSnapshot, o as LabMode, h as UndockedPanel, q as InstrumentList, s as InstrumentHooks, C as CreateLabStoreOptions, g as TrialStateHandle } from './frac-
|
|
1
|
+
import { c as StorageAdapter, d as LabStoreState, T as TrialRecord, e as SavedSnapshot, o as LabMode, h as UndockedPanel, q as InstrumentList, s as InstrumentHooks, C as CreateLabStoreOptions, g as TrialStateHandle } from './frac-B4hFJMiN.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ReactElement, Dispatch, SetStateAction } from 'react';
|
|
4
4
|
import { StoreApi } from 'zustand/vanilla';
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
export { C as CanvasStack, a as CanvasStackProps,
|
|
3
|
-
export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from '../_dts/CanvasStackContext-
|
|
4
|
-
export { D as DEFAULT_FRAME, V as ViewportSize, W as WorldFrame, a as WorldSpec, b as applyCamera, r as resolveFrame } from '../_dts/frac-
|
|
2
|
+
export { C as CanvasStack, a as CanvasStackProps, P as PanZoomHandlers, S as Stage, b as StageProps, U as UsePanZoomOptions, Z as ZoomAtOptions, c as centerOn, f as fitStage, s as screenToWorld, u as usePanZoom, w as worldToScreen, z as zoomAt } from '../_dts/usePanZoom-SSTZe410.js';
|
|
3
|
+
export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from '../_dts/CanvasStackContext-CMMo180l.js';
|
|
4
|
+
export { D as DEFAULT_FRAME, V as ViewportSize, W as WorldFrame, a as WorldSpec, b as applyCamera, r as resolveFrame } from '../_dts/frac-B4hFJMiN.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
|
-
import '../_dts/types-
|
|
6
|
+
import '../_dts/types-Db-3NNk1.js';
|
|
7
7
|
import '@weasel-js/core';
|
|
8
|
-
import '../_dts/PrefsForm.d-
|
|
8
|
+
import '../_dts/PrefsForm.d-DPy9I8It.js';
|
|
9
9
|
import '../_dts/types-DJ79Tg5J.js';
|
|
10
10
|
|
|
11
11
|
/** Where a trial's camera takes a wheel event from outside its own element. */
|
package/dist/canvas/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CameraWheelContext, CanvasStack,
|
|
1
|
+
export { CameraWheelContext, CanvasStack, Stage, fitStage, usePanZoom } from '../chunk-TT5C5S6R.js';
|
|
2
2
|
export { centerOn, zoomAt } from '../chunk-H6ZAOWNE.js';
|
|
3
3
|
export { DEFAULT_FRAME, applyCamera, resolveFrame, screenToWorld, worldToScreen } from '../chunk-2AYGEN57.js';
|
|
4
4
|
import '../chunk-WIG6XHJ7.js';
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { a as LabChromeContext, L as LabContribution,
|
|
2
|
-
export {
|
|
3
|
-
import '../_dts/types-
|
|
1
|
+
export { a as LabAsideRegion, b as LabChromeContext, L as LabContribution, e as LabFooterRegion, f as LabHeaderRegion, g as LabRegion, h as LabRegionProps, i as LabSidebarRegion, P as PaletteRegion, j as PaletteRegionProps, S as SidebarRegion, k as SidebarRegionProps, l as StatusRegion, m as StatusRegionProps, T as TitleBarPlacement, n as TitleBarRegion, o as TitleBarRegionProps, p as ToolbarRegion, q as ToolbarRegionProps, V as ViewportRegion, r as ViewportRegionProps, t as builtinContributions, w as contributionsIn, x as labContributions, y as mergeContributions, C as suppressContributions, D as toolContributions, E as useLabChromeContext } from '../_dts/index-DlKolEIZ.js';
|
|
2
|
+
export { a4 as ContributionBase, a8 as IconComponent, af as RegionContribution, aj as SidebarSection, ak as SidebarSlotContext, am as StatusReadout, ap as ToolItem, aq as ToolSlotContext, ar as ToolbarItem, as as TrialChromeContext, O as TrialContribution, at as TrialRegion, av as ViewportControl } from '../_dts/frac-B4hFJMiN.js';
|
|
3
|
+
import '../_dts/types-Db-3NNk1.js';
|
|
4
4
|
import '@weasel-js/core';
|
|
5
|
-
import '../_dts/PrefsForm.d-
|
|
5
|
+
import '../_dts/PrefsForm.d-DPy9I8It.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import '../_dts/types-DJ79Tg5J.js';
|
package/dist/chrome/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { LabFooterRegion, LabHeaderRegion, LabSidebarRegion, PaletteRegion, SidebarRegion, StatusRegion, TitleBarRegion, ToolbarRegion, ViewportRegion, builtinContributions, contributionsIn, labContributions, mergeContributions, suppressContributions, toolContributions, useLabChromeContext } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { LabAsideRegion, LabFooterRegion, LabHeaderRegion, LabSidebarRegion, PaletteRegion, SidebarRegion, StatusRegion, TitleBarRegion, ToolbarRegion, ViewportRegion, builtinContributions, contributionsIn, labContributions, mergeContributions, suppressContributions, toolContributions, useLabChromeContext } from '../chunk-CKUKF72R.js';
|
|
2
|
+
import '../chunk-753Y6HE6.js';
|
|
3
3
|
import '../chunk-RWNDDKOH.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-FKLT3ITC.js';
|
|
5
|
+
import '../chunk-Z76KEZAX.js';
|
|
6
|
+
import '../chunk-EMXAIRUJ.js';
|
|
7
|
+
import '../chunk-REOBGYMC.js';
|
|
8
8
|
import '../chunk-CQLQPQ4P.js';
|
|
9
9
|
import '../chunk-2YILQ7Y5.js';
|
|
10
10
|
import '../chunk-SBXNQW4G.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-LASCBWW7.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
13
13
|
//# sourceMappingURL=index.js.map
|