@weasel-js/labkit 1.5.0 → 1.5.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 +41 -4
- package/dist/_dts/{CanvasStackContext-CqkxkFJW.d.ts → CanvasStackContext-CJNMS6mz.d.ts} +1 -1
- package/dist/_dts/{PrefsForm.d-DDHFANkc.d.ts → PrefsForm.d-DPy9I8It.d.ts} +4 -0
- package/dist/_dts/Select.d-Gwr8fLpK.d.ts +453 -0
- package/dist/_dts/{frac-8R6UmlvN.d.ts → frac-B4okC2lX.d.ts} +42 -4
- package/dist/_dts/{index-retnAut7.d.ts → index-BNdz-tNd.d.ts} +90 -10
- package/dist/_dts/{index-B8uu2ba7.d.ts → index-CSJoj4LC.d.ts} +17 -6
- package/dist/_dts/{types-Ca2LCnPq.d.ts → types-DzoNY1pO.d.ts} +28 -4
- package/dist/_dts/{usePanZoom-nS798rOF.d.ts → usePanZoom-Pzf9f2jh.d.ts} +2 -2
- package/dist/_dts/{useTrialState-jcx_TdU6.d.ts → useTrialState-uLlmaccn.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-7PFH3CNM.js +150 -0
- package/dist/chunk-7PFH3CNM.js.map +1 -0
- package/dist/{chunk-PGETSEDK.js → chunk-CEIUBPPW.js} +10 -6
- package/dist/chunk-CEIUBPPW.js.map +1 -0
- package/dist/chunk-EH7UEQV7.js +590 -0
- package/dist/chunk-EH7UEQV7.js.map +1 -0
- package/dist/{chunk-EKIICY6X.js → chunk-EHGVROVV.js} +37 -25
- package/dist/chunk-EHGVROVV.js.map +1 -0
- package/dist/{chunk-ZPH5WTWF.js → chunk-ERFMC6WU.js} +142 -66
- package/dist/chunk-ERFMC6WU.js.map +1 -0
- package/dist/{chunk-NS64DXMN.js → chunk-IHUVQ3TX.js} +39 -16
- package/dist/chunk-IHUVQ3TX.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-67SJLMC7.js → chunk-IXTQI7JX.js} +45 -12
- package/dist/chunk-IXTQI7JX.js.map +1 -0
- package/dist/{chunk-MUKOW3TC.js → chunk-MDVTK5U3.js} +4 -4
- package/dist/{chunk-MUKOW3TC.js.map → chunk-MDVTK5U3.js.map} +1 -1
- package/dist/{chunk-UU3NJO6N.js → chunk-PHK4W562.js} +3 -3
- package/dist/{chunk-UU3NJO6N.js.map → chunk-PHK4W562.js.map} +1 -1
- package/dist/chunk-PJ7WEQBJ.js +18 -0
- package/dist/chunk-PJ7WEQBJ.js.map +1 -0
- package/dist/chunk-T3EC2DXD.js +12628 -0
- package/dist/chunk-T3EC2DXD.js.map +1 -0
- package/dist/{chunk-KJALCDWE.js → chunk-UN4U4P63.js} +4 -4
- package/dist/{chunk-KJALCDWE.js.map → chunk-UN4U4P63.js.map} +1 -1
- package/dist/{chunk-NDRYLVOW.js → chunk-Z76KEZAX.js} +2 -2
- package/dist/chunk-Z76KEZAX.js.map +1 -0
- package/dist/{chunk-6ZDGOZQV.js → chunk-ZDHY47EV.js} +70 -17
- package/dist/chunk-ZDHY47EV.js.map +1 -0
- package/dist/config/index.d.ts +60 -16
- 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 +177 -53
- package/dist/index.js +1333 -1683
- 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 +26 -202
- 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 +153 -40
- 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/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 +2 -2
- package/src/chrome/regions/PaletteRegion.tsx +1 -6
- package/src/chrome/regions/SidebarRegion.stories.tsx +44 -0
- package/src/chrome/regions/ToolbarRegion.tsx +11 -7
- package/src/chrome/types.ts +3 -0
- 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 +53 -8
- 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.stories.tsx +42 -1
- package/src/controls/ControlPanel.test.tsx +514 -4
- package/src/controls/ControlPanel.tsx +557 -80
- package/src/index.ts +29 -1
- 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 +105 -13
- 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.stories.tsx +1 -1
- 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.stories.tsx +1 -1
- package/src/primitives/JobProgress.stories.tsx +1 -1
- 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.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 +26 -2
- package/src/state/useTrialState.test.tsx +85 -0
- package/src/state/useTrialState.ts +9 -1
- 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 +32 -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-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/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-DzoNY1pO.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,6 +122,10 @@ 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. */
|
|
@@ -147,9 +172,14 @@ interface TrialStateHandle<TS, TC> {
|
|
|
147
172
|
state: TS;
|
|
148
173
|
setState: (next: TS | ((prev: TS) => TS)) => void;
|
|
149
174
|
config: TC;
|
|
175
|
+
/** The config as stored, before any auto path is resolved. What the control
|
|
176
|
+
* panel renders, so a ghosted control sits at the value it pins back to. */
|
|
177
|
+
raw: TC;
|
|
178
|
+
/** Dotted paths this trial has unpinned. */
|
|
179
|
+
auto: ReadonlySet<string>;
|
|
150
180
|
/** Write one config value, by dotted path — `'grid.size'` for a leaf under
|
|
151
181
|
* an `f.group`, `'cellSize'` for one at the root. */
|
|
152
|
-
setConfig: <P extends ConfigPath<TC> & string>(path: P, value: ValueAtPath<TC, P>) => void;
|
|
182
|
+
setConfig: <P extends ConfigPath<TC> & string>(path: P, value: ValueAtPath<TC, P> | Auto) => void;
|
|
153
183
|
}
|
|
154
184
|
/** Options for `createLabStore`, which knows nothing about storage. */
|
|
155
185
|
interface CreateLabStoreOptions {
|
|
@@ -164,6 +194,10 @@ interface CreateLabStoreOptions {
|
|
|
164
194
|
/** Each instrument's `migrateConfig`, keyed by instrument name, run on a
|
|
165
195
|
* stored config before its defaults fill it. */
|
|
166
196
|
configMigrations?: Record<string, (stored: unknown) => unknown>;
|
|
197
|
+
/** Each instrument's resolved config schema, keyed by instrument name. What
|
|
198
|
+
* a trial's auto paths are read against, away from the lab that would
|
|
199
|
+
* otherwise supply the rules. */
|
|
200
|
+
configSchemas?: Record<string, ResolvedConfig>;
|
|
167
201
|
/** How each instrument's state survives a reload. Hydration is the first
|
|
168
202
|
* thing `createLabStore` does, so these have to arrive with the store. */
|
|
169
203
|
serializers?: InstrumentSerializers;
|
|
@@ -176,6 +210,7 @@ interface InstrumentHooks {
|
|
|
176
210
|
serializers: InstrumentSerializers;
|
|
177
211
|
configDefaults: Record<string, () => unknown>;
|
|
178
212
|
configMigrations: Record<string, (stored: unknown) => unknown>;
|
|
213
|
+
configSchemas: Record<string, ResolvedConfig>;
|
|
179
214
|
}
|
|
180
215
|
/** Per-instrument serialize/deserialize hooks, keyed by instrument name. An
|
|
181
216
|
* instrument whose state is already JSON-safe needs no entry. `deserialize`
|
|
@@ -368,6 +403,9 @@ interface TrialChromeContext extends ToolSlotContext, SidebarSlotContext {
|
|
|
368
403
|
* `config`, since a builder schema has no `ConfigField[]` form. */
|
|
369
404
|
configFields: ConfigField[];
|
|
370
405
|
config: unknown;
|
|
406
|
+
/** The trial's unpinned paths. `config` stays raw, so a control drawn from
|
|
407
|
+
* it sits at the value un-pinning writes back. */
|
|
408
|
+
auto: ReadonlySet<string>;
|
|
371
409
|
setConfig: (key: string, value: unknown) => void;
|
|
372
410
|
/** Which of this trial's collapsible sections are folded. A sidebar
|
|
373
411
|
* section's key is its contribution id; a section *inside* a contribution —
|
|
@@ -980,5 +1018,5 @@ declare function fracContains(box: FracRect, pt: FracPoint, tol?: number): boole
|
|
|
980
1018
|
* answers false for two rects that merely overlap. */
|
|
981
1019
|
declare function fracEncloses(outer: FracRect, inner: FracRect): boolean;
|
|
982
1020
|
|
|
983
|
-
export { DEFAULT_FRAME as D, LOUPE_DEFAULTS as
|
|
984
|
-
export type {
|
|
1021
|
+
export { DEFAULT_FRAME as D, LOUPE_DEFAULTS as a8, fracEncloses as aA, fracToWorld as aB, isAuto as aC, resolveLoupe as aD, roundFrac as aE, worldToFrac as aF, annotationsFromJSON as av, auto as aw, createAnnotationScene as ax, createAnnotationStore as ay, fracContains as az, applyCamera as b, dockPanel as j, panelKey as p, resolveFrame as r, undockPanel as u };
|
|
1022
|
+
export type { Auto 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, TrialContribution as N, Annotation as O, PaletteItem as P, AnnotationInit as Q, AnnotationPatch as R, SerializedTrial as S, TrialRecord as T, UndoStack as U, ViewportSize as V, WorldFrame as W, AnnotationQuery as X, AnnotationStatus as Y, AnnotationStoreOptions as Z, AnnotationTargetInfo as _, WorldSpec as a, CanvasCapability as a0, CanvasLayer as a1, CaptureDeps as a2, ContributionBase as a3, FracPoint as a4, FracRect as a5, HitResult as a6, IconComponent as a7, LayerCapability as a9, LoupePoint as aG, LoupeMode as aH, LayerDescriptor as aa, LoupeCapability as ab, LoupeDeclaration as ac, LoupeRenderArgs as ad, RegionContribution as ae, RenderContext as af, ResolvedLoupe as ag, SerializedAnnotations as ah, SidebarSection as ai, SidebarSlotContext as aj, StageCapability as ak, StatusReadout as al, SystemEvent as am, ToolCapability as an, ToolItem as ao, ToolSlotContext as ap, ToolbarItem as aq, TrialChromeContext as ar, TrialRegion as as, UndoCapability as at, ViewportControl as au, 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-DzoNY1pO.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* How much room a container gives its rows — gaps, padding, and field height,
|
|
@@ -100,11 +100,25 @@ 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. Draws
|
|
110
|
+
* the control ghosted and colorless. */
|
|
111
|
+
auto?: boolean;
|
|
112
|
+
/** Given, the row carries a pin dot that toggles `auto`. Omitted, the row can
|
|
113
|
+
* show an auto state but not change it. */
|
|
114
|
+
onAutoChange?: (next: boolean) => void;
|
|
115
|
+
/** Marks the row's element for a panel-level gesture handler. `PropertyRow`
|
|
116
|
+
* does not spread unknown props, so this is declared rather than inherited. */
|
|
117
|
+
'data-auto-path'?: string;
|
|
104
118
|
}
|
|
105
119
|
/** The label-plus-control frame every typed row below is built from. Use it
|
|
106
120
|
* 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;
|
|
121
|
+
declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, group, className, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
108
122
|
/** Props for `<SliderRow>`. */
|
|
109
123
|
interface SliderRowProps extends PropertyMetricProps {
|
|
110
124
|
label: ReactNode;
|
|
@@ -126,6 +140,12 @@ interface SliderRowProps extends PropertyMetricProps {
|
|
|
126
140
|
onInput?: (next: number) => void;
|
|
127
141
|
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
128
142
|
format?: (value: number) => ReactNode;
|
|
143
|
+
/**
|
|
144
|
+
* Static text in place of the editable readout. Use it when the row is not
|
|
145
|
+
* showing a number a caller could type back — an auto row's `auto · 18`, say,
|
|
146
|
+
* which an editable field would seed a draft with and then fail to parse.
|
|
147
|
+
*/
|
|
148
|
+
readout?: ReactNode;
|
|
129
149
|
/** A named display for the value: `compact` reads `2.0M`. `format` wins when both are given. */
|
|
130
150
|
notation?: ToolPrefNumberFormat;
|
|
131
151
|
/**
|
|
@@ -138,10 +158,16 @@ interface SliderRowProps extends PropertyMetricProps {
|
|
|
138
158
|
description?: string;
|
|
139
159
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
140
160
|
span?: boolean;
|
|
161
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
162
|
+
auto?: boolean;
|
|
163
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
164
|
+
onAutoChange?: (next: boolean) => void;
|
|
165
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
166
|
+
'data-auto-path'?: string;
|
|
141
167
|
}
|
|
142
168
|
/** A bounded number edited by dragging, with a live readout whose precision
|
|
143
169
|
* 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;
|
|
170
|
+
declare function SliderRow({ label, value, min, max, step, onChange, onInput, format, readout, notation, unit, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
145
171
|
/** Props for `<ColorRow>`. */
|
|
146
172
|
interface ColorRowProps extends PropertyMetricProps {
|
|
147
173
|
label: ReactNode;
|
|
@@ -172,11 +198,19 @@ interface ColorRowProps extends PropertyMetricProps {
|
|
|
172
198
|
/** Label beside the swatch (default) or above it. */
|
|
173
199
|
layout?: PropertyRowLayout;
|
|
174
200
|
description?: string;
|
|
201
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
202
|
+
readout?: ReactNode;
|
|
175
203
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
176
204
|
span?: boolean;
|
|
205
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
206
|
+
auto?: boolean;
|
|
207
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
208
|
+
onAutoChange?: (next: boolean) => void;
|
|
209
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
210
|
+
'data-auto-path'?: string;
|
|
177
211
|
}
|
|
178
212
|
/** 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;
|
|
213
|
+
declare function ColorRow({ label, readout, value, onChange, onInput, alpha, onAlphaChange, onAlphaInput, alphaDisabled, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
180
214
|
/** Props for `<CheckboxRow>`. */
|
|
181
215
|
interface CheckboxRowProps extends PropertyMetricProps {
|
|
182
216
|
label: ReactNode;
|
|
@@ -186,11 +220,19 @@ interface CheckboxRowProps extends PropertyMetricProps {
|
|
|
186
220
|
/** Label beside the box (default) or above it. */
|
|
187
221
|
layout?: PropertyRowLayout;
|
|
188
222
|
description?: string;
|
|
223
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
224
|
+
readout?: ReactNode;
|
|
189
225
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
190
226
|
span?: boolean;
|
|
227
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
228
|
+
auto?: boolean;
|
|
229
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
230
|
+
onAutoChange?: (next: boolean) => void;
|
|
231
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
232
|
+
'data-auto-path'?: string;
|
|
191
233
|
}
|
|
192
234
|
/** A boolean checkbox. */
|
|
193
|
-
declare function CheckboxRow({ label, value, onChange, layout, span, description, density, align, }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
235
|
+
declare function CheckboxRow({ label, readout, value, onChange, layout, span, description, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
194
236
|
/** Props for `<TextRow>`. */
|
|
195
237
|
interface TextRowProps extends PropertyMetricProps {
|
|
196
238
|
label: ReactNode;
|
|
@@ -201,11 +243,19 @@ interface TextRowProps extends PropertyMetricProps {
|
|
|
201
243
|
maxLength?: number;
|
|
202
244
|
layout?: PropertyRowLayout;
|
|
203
245
|
description?: string;
|
|
246
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
247
|
+
readout?: ReactNode;
|
|
204
248
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
205
249
|
span?: boolean;
|
|
250
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
251
|
+
auto?: boolean;
|
|
252
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
253
|
+
onAutoChange?: (next: boolean) => void;
|
|
254
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
255
|
+
'data-auto-path'?: string;
|
|
206
256
|
}
|
|
207
257
|
/** 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;
|
|
258
|
+
declare function TextRow({ label, readout, value, onChange, placeholder, maxLength, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
209
259
|
/** Props for `<NumberRow>`. */
|
|
210
260
|
interface NumberRowProps extends PropertyMetricProps {
|
|
211
261
|
label: ReactNode;
|
|
@@ -235,12 +285,20 @@ interface NumberRowProps extends PropertyMetricProps {
|
|
|
235
285
|
unit?: ReactNode;
|
|
236
286
|
layout?: PropertyRowLayout;
|
|
237
287
|
description?: string;
|
|
288
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
289
|
+
readout?: ReactNode;
|
|
238
290
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
239
291
|
span?: boolean;
|
|
292
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
293
|
+
auto?: boolean;
|
|
294
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
295
|
+
onAutoChange?: (next: boolean) => void;
|
|
296
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
297
|
+
'data-auto-path'?: string;
|
|
240
298
|
}
|
|
241
299
|
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
242
300
|
* 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;
|
|
301
|
+
declare function NumberRow({ label, readout, value, onChange, onInput, min, max, step, placeholder, unit, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
244
302
|
interface PropertyOption<T extends string> {
|
|
245
303
|
value: T;
|
|
246
304
|
label: ReactNode;
|
|
@@ -256,12 +314,20 @@ interface SelectRowProps<T extends string> extends PropertyMetricProps {
|
|
|
256
314
|
placeholder?: string;
|
|
257
315
|
layout?: PropertyRowLayout;
|
|
258
316
|
description?: string;
|
|
317
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
318
|
+
readout?: ReactNode;
|
|
259
319
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
260
320
|
span?: boolean;
|
|
321
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
322
|
+
auto?: boolean;
|
|
323
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
324
|
+
onAutoChange?: (next: boolean) => void;
|
|
325
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
326
|
+
'data-auto-path'?: string;
|
|
261
327
|
}
|
|
262
328
|
/** A dropdown over a fixed set of choices. Prefer `<ToggleRow>` when there
|
|
263
329
|
* 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;
|
|
330
|
+
declare function SelectRow<T extends string>({ label, readout, value, options, onChange, placeholder, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
265
331
|
/** Props for `<ToggleRow>`. */
|
|
266
332
|
interface ToggleRowProps<T extends string> extends PropertyMetricProps {
|
|
267
333
|
label: ReactNode;
|
|
@@ -270,12 +336,20 @@ interface ToggleRowProps<T extends string> extends PropertyMetricProps {
|
|
|
270
336
|
onChange: (next: T) => void;
|
|
271
337
|
layout?: PropertyRowLayout;
|
|
272
338
|
description?: string;
|
|
339
|
+
/** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */
|
|
340
|
+
readout?: ReactNode;
|
|
273
341
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
274
342
|
span?: boolean;
|
|
343
|
+
/** The row is auto — see `<PropertyRow auto>`. */
|
|
344
|
+
auto?: boolean;
|
|
345
|
+
/** Toggles `auto` from a pin dot — see `<PropertyRow onAutoChange>`. */
|
|
346
|
+
onAutoChange?: (next: boolean) => void;
|
|
347
|
+
/** Marks the row for a panel-level gesture handler — see `<PropertyRow data-auto-path>`. */
|
|
348
|
+
'data-auto-path'?: string;
|
|
275
349
|
}
|
|
276
350
|
/** A segmented control: the same choice as a select, with every option
|
|
277
351
|
* 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;
|
|
352
|
+
declare function ToggleRow<T extends string>({ label, readout, value, options, onChange, layout, description, span, density, align, auto, onAutoChange, 'data-auto-path': autoPath, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
279
353
|
|
|
280
354
|
/** How a panel packs its rows into the two-column property grid.
|
|
281
355
|
* - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
|
|
@@ -330,6 +404,12 @@ interface ControlPanelProps<TC extends Record<string, unknown>> {
|
|
|
330
404
|
/** A fold moved. The key is a section's label — prefixed by its group's
|
|
331
405
|
* dotted path when the section sits inside one — or a group's own path. */
|
|
332
406
|
onCollapse?: (key: string, collapsed: boolean) => void;
|
|
407
|
+
/** Dotted paths currently unpinned. A row in this set draws ghosted and its
|
|
408
|
+
* dot reads as auto, and the dot writes the sentinel back through
|
|
409
|
+
* `setConfig`. Omitted, the panel keeps the set itself: the dots still work
|
|
410
|
+
* and the sentinel never reaches `setConfig`, which would otherwise store it
|
|
411
|
+
* as the row's value. */
|
|
412
|
+
auto?: ReadonlySet<string>;
|
|
333
413
|
/** Draw leaves marked `hidden`. */
|
|
334
414
|
showHidden?: boolean;
|
|
335
415
|
className?: string;
|
|
@@ -337,7 +417,7 @@ interface ControlPanelProps<TC extends Record<string, unknown>> {
|
|
|
337
417
|
/** Render an instrument's config schema as a stack of controls, each writing
|
|
338
418
|
* back through `setConfig`. Built on the property rows, so a lab's controls
|
|
339
419
|
* 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;
|
|
420
|
+
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
421
|
|
|
342
422
|
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
423
|
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-DzoNY1pO.js';
|
|
2
|
+
import { K as Instrument, ar as TrialChromeContext, N as TrialContribution, T as TrialRecord, q as InstrumentList, e as SavedSnapshot, o as LabMode, ap as ToolSlotContext, a3 as ContributionBase, aq as ToolbarItem, ao as ToolItem, ai as SidebarSection, al as StatusReadout, H as TrialTool, ae as RegionContribution, aj as SidebarSlotContext } from './frac-B4okC2lX.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
|
|
@@ -102,7 +110,7 @@ type LabContribution<TCtx = LabChromeContext> = (ContributionBase & {
|
|
|
102
110
|
item: ToolItem;
|
|
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
|
|
|
@@ -233,5 +244,5 @@ interface ViewportRegionProps {
|
|
|
233
244
|
*/
|
|
234
245
|
declare function ViewportRegion({ contributions, ctx }: ViewportRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
235
246
|
|
|
236
|
-
export {
|
|
237
|
-
export type { AddTrialOptions as A, LabContribution as L, TitleBarPlacement as T, LabChromeContext as
|
|
247
|
+
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 };
|
|
248
|
+
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 lets
|
|
115
|
+
* the ghosted control draw a real value 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 takes no pin dot and ignores the
|
|
122
|
+
* gesture. For a value 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-B4okC2lX.js';
|
|
4
|
+
import { C as CanvasLayerDescriptor } from './CanvasStackContext-CJNMS6mz.js';
|
|
5
5
|
|
|
6
6
|
/** Props for `<CanvasStack>`. */
|
|
7
7
|
interface CanvasStackProps {
|
|
@@ -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-B4okC2lX.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, O as OrbitHandlers, b as OrbitView, P as PITCH_LIMIT, c as PanZoomHandlers, S as Stage, d as StageProps, U as UseOrbitOptions, e as UsePanZoomOptions, V as Vec3, Z as ZoomAtOptions, f as centerOn, g as clampPitch, h as fitStage, o as orbitAfterDrag, i as orbitAfterWheel, s as screenToWorld, u as useOrbit, j as usePanZoom, w as worldToScreen, k as wrapYaw, z as zoomAt } from '../_dts/usePanZoom-
|
|
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, O as OrbitHandlers, b as OrbitView, P as PITCH_LIMIT, c as PanZoomHandlers, S as Stage, d as StageProps, U as UseOrbitOptions, e as UsePanZoomOptions, V as Vec3, Z as ZoomAtOptions, f as centerOn, g as clampPitch, h as fitStage, o as orbitAfterDrag, i as orbitAfterWheel, s as screenToWorld, u as useOrbit, j as usePanZoom, w as worldToScreen, k as wrapYaw, z as zoomAt } from '../_dts/usePanZoom-Pzf9f2jh.js';
|
|
3
|
+
export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from '../_dts/CanvasStackContext-CJNMS6mz.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-B4okC2lX.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
|
-
import '../_dts/types-
|
|
6
|
+
import '../_dts/types-DzoNY1pO.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, PITCH_LIMIT, Stage, clampPitch, fitStage, orbitAfterDrag, orbitAfterWheel, useOrbit, usePanZoom, wrapYaw } from '../chunk-
|
|
1
|
+
export { CameraWheelContext, CanvasStack, PITCH_LIMIT, Stage, clampPitch, fitStage, orbitAfterDrag, orbitAfterWheel, useOrbit, usePanZoom, wrapYaw } from '../chunk-CEIUBPPW.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-CSJoj4LC.js';
|
|
2
|
+
export { a3 as ContributionBase, a7 as IconComponent, ae as RegionContribution, ai as SidebarSection, aj as SidebarSlotContext, al as StatusReadout, ao as ToolItem, ap as ToolSlotContext, aq as ToolbarItem, ar as TrialChromeContext, N as TrialContribution, as as TrialRegion, au as ViewportControl } from '../_dts/frac-B4okC2lX.js';
|
|
3
|
+
import '../_dts/types-DzoNY1pO.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-IHUVQ3TX.js';
|
|
2
|
+
import '../chunk-UN4U4P63.js';
|
|
3
3
|
import '../chunk-RWNDDKOH.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-EH7UEQV7.js';
|
|
5
|
+
import '../chunk-Z76KEZAX.js';
|
|
6
|
+
import '../chunk-PHK4W562.js';
|
|
7
|
+
import '../chunk-7PFH3CNM.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-T3EC2DXD.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
13
13
|
//# sourceMappingURL=index.js.map
|