@weasel-js/labkit 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{DrawCommand-C_XboUpz.d.ts → DrawCommand-DBB45NfN.d.ts} +196 -52
- package/dist/_dts/PrefsForm-BYa6cWnO.d.ts +201 -0
- package/dist/_dts/types-1Sdxy_Pv.d.ts +90 -0
- package/dist/_dts/types-BttTIent.d.ts +314 -0
- package/dist/_dts/types-DCGEcMO_.d.ts +162 -0
- package/dist/_dts/{useTrialState-BMNIx3Cy.d.ts → useTrialState-CsGMjhu9.d.ts} +5 -87
- package/dist/canvas/index.d.ts +7 -3
- package/dist/canvas/index.js +3 -1
- package/dist/chrome/index.d.ts +86 -0
- package/dist/chrome/index.js +9 -0
- package/dist/chrome/index.js.map +1 -0
- package/dist/chunk-3XXPU73K.js +138 -0
- package/dist/chunk-3XXPU73K.js.map +1 -0
- package/dist/{chunk-VUU5UXHE.js → chunk-4TMMVIDM.js} +8 -5
- package/dist/chunk-4TMMVIDM.js.map +1 -0
- package/dist/chunk-6X5RBC6G.js +366 -0
- package/dist/chunk-6X5RBC6G.js.map +1 -0
- package/dist/{chunk-574LJAV4.js → chunk-BDJXIBRZ.js} +33 -35
- package/dist/chunk-BDJXIBRZ.js.map +1 -0
- package/dist/{chunk-SFL7NFKN.js → chunk-BMW4TDP5.js} +15 -7
- package/dist/chunk-BMW4TDP5.js.map +1 -0
- package/dist/chunk-JDROYQM3.js +266 -0
- package/dist/chunk-JDROYQM3.js.map +1 -0
- package/dist/{chunk-THBG7FQZ.js → chunk-LGKRIUSW.js} +15 -12
- package/dist/chunk-LGKRIUSW.js.map +1 -0
- package/dist/{chunk-BOHF3PQO.js → chunk-QCICIHEO.js} +8129 -5196
- package/dist/chunk-QCICIHEO.js.map +1 -0
- package/dist/chunk-QRYPXSGP.js +212 -0
- package/dist/chunk-QRYPXSGP.js.map +1 -0
- package/dist/chunk-RGT4EJIB.js +6961 -0
- package/dist/chunk-RGT4EJIB.js.map +1 -0
- package/dist/chunk-SBXNQW4G.js +3 -0
- package/dist/chunk-SBXNQW4G.js.map +1 -0
- package/dist/chunk-T66HU3HX.js +17 -0
- package/dist/chunk-T66HU3HX.js.map +1 -0
- package/dist/chunk-WTI26YTM.js +266 -0
- package/dist/chunk-WTI26YTM.js.map +1 -0
- package/dist/controls/index.d.ts +19 -5
- package/dist/controls/index.js +3 -1
- package/dist/dragdrop/index.d.ts +46 -3
- package/dist/dragdrop/index.js +3 -1
- package/dist/index.d.ts +735 -565
- package/dist/index.js +661 -1019
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +5 -3
- package/dist/layers/index.js +4 -1
- package/dist/passthrough/weasel-canvas.d.ts +69 -13
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +3811 -3671
- package/dist/passthrough/weasel-ui.js +3 -2
- package/dist/primitives/index.d.ts +102 -8
- package/dist/primitives/index.js +5 -1
- package/dist/state/index.d.ts +3 -2
- package/dist/state/index.js +2 -2
- package/dist/styles.css +490 -803
- package/dist/surface/index.js +2 -1
- package/dist/ui/layers/index.d.ts +8 -2
- package/dist/ui/layers/index.js +2 -3
- package/dist/undo/index.d.ts +4 -2
- package/package.json +16 -7
- package/src/canvas/AGENTS.md +4 -0
- package/src/canvas/CanvasStack.tsx +6 -2
- package/src/canvas/useLayerScheduler.ts +22 -15
- package/src/canvas/usePanZoom.test.ts +80 -0
- package/src/canvas/usePanZoom.ts +16 -2
- package/src/chrome/ChromeRegions.stories.tsx +106 -0
- package/src/chrome/builtins.test.ts +153 -0
- package/src/chrome/builtins.tsx +205 -0
- package/src/chrome/index.ts +25 -0
- package/src/chrome/merge.test.ts +51 -0
- package/src/chrome/merge.ts +52 -0
- package/src/chrome/regions/PaletteRegion.less +14 -0
- package/src/chrome/regions/PaletteRegion.test.tsx +36 -0
- package/src/chrome/regions/PaletteRegion.tsx +41 -0
- package/src/chrome/regions/SidebarRegion.tsx +56 -0
- package/src/chrome/regions/StatusRegion.tsx +31 -0
- package/src/chrome/regions/TitleBarRegion.tsx +41 -0
- package/src/chrome/regions/ToolbarRegion.test.tsx +82 -0
- package/src/chrome/regions/ToolbarRegion.tsx +71 -0
- package/src/chrome/regions/ViewportRegion.less +42 -0
- package/src/chrome/regions/ViewportRegion.tsx +37 -0
- package/src/chrome/regions/regions.test.tsx +81 -0
- package/src/chrome/types.ts +127 -0
- package/src/config/builder.test.ts +93 -0
- package/src/config/builder.ts +220 -0
- package/src/config/fromConfigField.test.ts +93 -0
- package/src/config/fromConfigField.ts +74 -0
- package/src/config/index.ts +22 -0
- package/src/config/resolve.test.ts +119 -0
- package/src/config/resolve.ts +67 -0
- package/src/config/rules.ts +68 -0
- package/src/config/types.ts +108 -0
- package/src/config/useConfigSchema.ts +30 -0
- package/src/config/visible.ts +20 -0
- package/src/controls/ControlPanel.less +4 -58
- package/src/controls/ControlPanel.stories.tsx +125 -0
- package/src/controls/ControlPanel.test.tsx +245 -10
- package/src/controls/ControlPanel.tsx +236 -203
- package/src/dragdrop/DragDropRuntime.tsx +36 -18
- package/src/dragdrop/DragGhost.less +1 -1
- package/src/dragdrop/Palette.less +1 -1
- package/src/dragdrop/index.ts +11 -0
- package/src/index.ts +74 -5
- package/src/instrument/SineWave.smoke.test.tsx +8 -1
- package/src/instrument/defineInstrument.test.ts +38 -1
- package/src/instrument/defineInstrument.ts +31 -4
- package/src/instrument/index.ts +1 -0
- package/src/instrument/types.ts +27 -4
- package/src/instrument/validateConfigSchema.test.ts +13 -3
- package/src/instrument/validateConfigSchema.ts +7 -10
- package/src/lab/Lab.chrome.test.tsx +65 -0
- package/src/lab/Lab.tsx +58 -15
- package/src/lab/LabContext.ts +6 -0
- package/src/lab/LabFullChrome.stories.tsx +308 -0
- package/src/lab/LabHeader.test.tsx +42 -0
- package/src/lab/LabHeader.tsx +57 -0
- package/src/lab/LabPalette.test.tsx +35 -0
- package/src/lab/LabPalette.tsx +34 -0
- package/src/lab/LabShell.less +50 -3
- package/src/lab/Workspace.less +1 -30
- package/src/lab/Workspace.test.tsx +20 -10
- package/src/lab/Workspace.tsx +5 -8
- package/src/lab/index.ts +3 -1
- package/src/layers/AGENTS.md +1 -1
- package/src/layers/LayerList.less +31 -7
- package/src/layers/LayerList.tsx +17 -4
- package/src/passthrough/weasel-ui.ts +28 -0
- package/src/primitives/FloatingPanel.less +28 -0
- package/src/primitives/FloatingPanel.stories.tsx +46 -0
- package/src/primitives/FloatingPanel.test.tsx +240 -0
- package/src/primitives/FloatingPanel.tsx +190 -0
- package/src/primitives/FpsMeter.test.tsx +44 -0
- package/src/primitives/FpsMeter.tsx +20 -9
- package/src/primitives/JobProgress.less +69 -0
- package/src/primitives/JobProgress.stories.tsx +48 -0
- package/src/primitives/JobProgress.tsx +65 -0
- package/src/primitives/Legend.less +47 -0
- package/src/primitives/Legend.stories.tsx +32 -0
- package/src/primitives/Legend.test.tsx +57 -0
- package/src/primitives/Legend.tsx +40 -0
- package/src/primitives/Sidebar.less +32 -2
- package/src/primitives/StatusBar.less +7 -0
- package/src/primitives/StatusBar.tsx +10 -3
- package/src/primitives/Toolbar.less +50 -3
- package/src/primitives/Toolbar.test.tsx +67 -1
- package/src/primitives/Toolbar.tsx +72 -6
- package/src/primitives/ZoomControl.less +31 -0
- package/src/primitives/ZoomControl.tsx +76 -0
- package/src/primitives/floating.entry.test.tsx +14 -0
- package/src/primitives/index.ts +10 -2
- package/src/primitives/useRovingTabIndex.test.ts +27 -0
- package/src/primitives/useRovingTabIndex.ts +79 -0
- package/src/state/store.ts +11 -3
- package/src/state/toolSlot.test.ts +36 -0
- package/src/state/types.ts +4 -0
- package/src/styles.less +6 -4
- package/src/surface/useTiledSurface.ts +14 -10
- package/src/test-setup.ts +26 -0
- package/src/theme/Interstellar.stories.tsx +1 -1
- package/src/theme/base.less +19 -2
- package/src/theme/interstellar.tokens.json +6 -2
- package/src/tools/types.ts +24 -0
- package/src/trial/Trial.config.test.tsx +108 -0
- package/src/trial/Trial.job.test.tsx +13 -15
- package/src/trial/Trial.less +115 -10
- package/src/trial/Trial.stories.tsx +1 -0
- package/src/trial/Trial.test.tsx +67 -96
- package/src/trial/Trial.tsx +80 -39
- package/src/trial/TrialChrome.tsx +99 -80
- package/src/trial/TrialDragContext.ts +10 -0
- package/src/trial/TrialTitleBar.tsx +41 -0
- package/src/trial/index.ts +1 -15
- package/src/trial/trialChrome.borders.test.ts +38 -0
- package/src/ui/layers/index.ts +5 -1
- package/dist/_dts/index-JFAYj5Tv.d.ts +0 -144
- package/dist/_dts/types-x92Kfeme.d.ts +0 -62
- package/dist/chunk-574LJAV4.js.map +0 -1
- package/dist/chunk-5R2ATYPJ.js +0 -201
- package/dist/chunk-5R2ATYPJ.js.map +0 -1
- package/dist/chunk-73KA7WBO.js +0 -5992
- package/dist/chunk-73KA7WBO.js.map +0 -1
- package/dist/chunk-BOHF3PQO.js.map +0 -1
- package/dist/chunk-G5TJVQQT.js +0 -161
- package/dist/chunk-G5TJVQQT.js.map +0 -1
- package/dist/chunk-PMAU3SEE.js +0 -126
- package/dist/chunk-PMAU3SEE.js.map +0 -1
- package/dist/chunk-SFL7NFKN.js.map +0 -1
- package/dist/chunk-THBG7FQZ.js.map +0 -1
- package/dist/chunk-VUU5UXHE.js.map +0 -1
- package/src/instrument/capabilityDetector.test.ts +0 -64
- package/src/instrument/capabilityDetector.ts +0 -20
- package/src/trial/DefaultSidebar.tsx +0 -29
- package/src/trial/DefaultStatusBar.tsx +0 -19
- package/src/trial/DefaultToolbar.tsx +0 -92
- package/src/trial/slotTypes.ts +0 -54
- package/src/ui/format.test.ts +0 -33
- package/src/ui/format.ts +0 -30
- package/src/ui/layers/LayerStack.less +0 -143
- package/src/ui/layers/LayerStack.stories.tsx +0 -45
- package/src/ui/layers/LayerStack.test.tsx +0 -170
- package/src/ui/layers/LayerStack.tsx +0 -220
- package/src/ui/properties/CheckboxRow.stories.tsx +0 -27
- package/src/ui/properties/ColorRow.stories.tsx +0 -106
- package/src/ui/properties/CurveField.less +0 -48
- package/src/ui/properties/CurveField.stories.tsx +0 -20
- package/src/ui/properties/CurveField.test.tsx +0 -127
- package/src/ui/properties/CurveField.tsx +0 -184
- package/src/ui/properties/EffectCard.tsx +0 -324
- package/src/ui/properties/Gallery.stories.tsx +0 -178
- package/src/ui/properties/NumberRow.stories.tsx +0 -65
- package/src/ui/properties/PropertyGroup.less +0 -50
- package/src/ui/properties/PropertyGroup.stories.tsx +0 -34
- package/src/ui/properties/PropertyGroup.test.tsx +0 -33
- package/src/ui/properties/PropertyGroup.tsx +0 -45
- package/src/ui/properties/PropertyList.stories.tsx +0 -83
- package/src/ui/properties/PropertyPanel.less +0 -592
- package/src/ui/properties/PropertyPanel.stories.tsx +0 -190
- package/src/ui/properties/PropertyPanel.test.tsx +0 -193
- package/src/ui/properties/PropertyPanel.tsx +0 -469
- package/src/ui/properties/PropertyRow.stories.tsx +0 -53
- package/src/ui/properties/SelectRow.stories.tsx +0 -58
- package/src/ui/properties/SliderRow.stories.tsx +0 -74
- package/src/ui/properties/SpeechBalloonPanels.stories.tsx +0 -396
- package/src/ui/properties/TextRow.stories.tsx +0 -62
- package/src/ui/properties/ToggleRow.stories.tsx +0 -57
- package/src/ui/properties/index.ts +0 -39
- package/src/ui/properties/storyLayouts.tsx +0 -36
package/dist/index.d.ts
CHANGED
|
@@ -1,337 +1,777 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.js';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import * as react from 'react';
|
|
3
|
-
import { WheelEvent, PointerEvent
|
|
4
|
+
import { ReactNode, WheelEvent, PointerEvent } from 'react';
|
|
5
|
+
export { CanvasLayerDescriptor, CanvasStack, CanvasStackContext, CanvasStackContextValue, CanvasStackProps, screenToWorld, worldToScreen } from './canvas/index.js';
|
|
6
|
+
export { PaletteRegion, PaletteRegionProps, SidebarRegion, SidebarRegionProps, StatusRegion, StatusRegionProps, TitleBarRegion, TitleBarRegionProps, ToolbarRegion, ToolbarRegionProps, ViewportRegion, ViewportRegionProps, builtinContributions, mergeContributions, suppressContributions } from './chrome/index.js';
|
|
7
|
+
import { I as Instrument, c as InstrumentList, T as TrialContribution, d as TrialTool, V as ViewTransform } from './_dts/types-BttTIent.js';
|
|
8
|
+
export { C as CanvasCapability, e as CanvasLayer, b as DragDropCapability, D as DragFeedback, H as HitResult, f as IconComponent, L as LayerCapability, g as LayerDescriptor, P as PaletteItem, a as Point, R as RenderContext, S as SidebarSection, h as StatusReadout, i as SystemEvent, j as ToolCapability, k as ToolItem, l as ToolbarItem, m as TrialChromeContext, n as TrialRegion, U as UndoCapability, o as ViewportControl } from './_dts/types-BttTIent.js';
|
|
9
|
+
import { T as ToolPrefLeaf } from './_dts/PrefsForm-BYa6cWnO.js';
|
|
10
|
+
import { b as ConfigNode, A as Annotations, N as NodeOptions, c as ControlRenderer, d as ConfigOption, a as ConfigSchema, I as InferConfig, C as ConfigField, R as ResolvedConfig, e as ConfigRule, L as LeafPatch, f as ConfigRuleContext } from './_dts/types-DCGEcMO_.js';
|
|
11
|
+
export { g as CheckboxField, h as ColorField, i as ConfigFieldBase, j as ConfigFieldType, k as ConfigOf, l as NodeValue, m as NumberField, S as SectionSpec, n as SelectField, o as SelectOption, p as SliderField, T as TextField } from './_dts/types-DCGEcMO_.js';
|
|
4
12
|
export { ControlPanel } from './controls/index.js';
|
|
5
|
-
import { C as ConfigField } from './_dts/types-x92Kfeme.js';
|
|
6
|
-
export { a as CheckboxField, b as ColorField, c as ConfigFieldBase, d as ConfigFieldType, N as NumberField, S as SelectField, e as SelectOption, f as SliderField, T as TextField } from './_dts/types-x92Kfeme.js';
|
|
7
|
-
import { I as Instrument, a as InstrumentList, V as ViewTransform } from './_dts/index-JFAYj5Tv.js';
|
|
8
|
-
export { C as CanvasCapability, b as CanvasLayer, D as DragDropCapability, c as DragFeedback, H as HitResult, L as LayerCapability, d as LayerDescriptor, P as PaletteItem, e as Point, R as RenderContext, S as SystemEvent, U as UndoCapability } from './_dts/index-JFAYj5Tv.js';
|
|
9
13
|
import { J as JobHandle } from './_dts/types-DJ79Tg5J.js';
|
|
10
14
|
export { a as JobCapability, b as JobEvent, c as JobFailure, d as JobStatus } from './_dts/types-DJ79Tg5J.js';
|
|
11
15
|
export { UseJobOptions, useJob } from './job/index.js';
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
export { C as CURRENT_DOCUMENT_VERSION, b as CreateLabStoreOptions, L as LabDocument, e as LabStoreContext, f as LabStoreProvider, g as LabStoreState, S as SerializedTrial, i as TrialIdContext, j as TrialIdProvider, k as TrialStateHandle, U as UndoStack, m as createMemoryAdapter, n as labDocumentKey, o as localStorageAdapter, p as noneAdapter, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, r as useLabStore, t as useTrialId, v as useTrialState } from './_dts/useTrialState-BMNIx3Cy.js';
|
|
16
|
+
import { a as StorageAdapter, e as LabMode, T as TrialRecord, c as SavedSnapshot } from './_dts/types-1Sdxy_Pv.js';
|
|
17
|
+
export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, S as SerializedTrial, d as TrialStateHandle, U as UndoStack } from './_dts/types-1Sdxy_Pv.js';
|
|
15
18
|
export { LayerList, LayerListProps } from './layers/index.js';
|
|
16
|
-
export { FpsMeter, ScaleIndicator, ScaleIndicatorProps, Sidebar, SidebarProps, StatusBar, StatusBarProps, Toolbar, ToolbarProps } from './primitives/index.js';
|
|
19
|
+
export { FloatingPanel, FloatingPanelProps, FpsMeter, JobProgress, JobProgressProps, Legend, LegendEntry, LegendMark, LegendProps, ScaleIndicator, ScaleIndicatorProps, Sidebar, SidebarProps, StatusBar, StatusBarProps, StatusBarSectionProps, Toolbar, ToolbarButtonProps, ToolbarGroupProps, ToolbarProps, ZoomControl, ZoomControlProps } from './primitives/index.js';
|
|
20
|
+
export { C as CURRENT_DOCUMENT_VERSION, b as LabStoreContext, c as LabStoreProvider, T as TrialIdContext, d as TrialIdProvider, f as createMemoryAdapter, l as labDocumentKey, g as localStorageAdapter, n as noneAdapter, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, h as useLabStore, i as useTrialId, j as useTrialState } from './_dts/useTrialState-CsGMjhu9.js';
|
|
17
21
|
export { Box, Rect, SurfaceContext, SurfaceFrame, SurfaceHandle, UseTiledSurfaceOptions, composeRects, rectsEqual, toDeviceRect, useSurface, useSurfaceOptional, useSurfaceTile, useTiledSurface } from './surface/index.js';
|
|
18
|
-
export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.js';
|
|
19
22
|
export { EventBus, EventListener, clearUndo, createEventBus, emptyStack, pushSnapshot, redo, undo } from './undo/index.js';
|
|
23
|
+
import 'windease';
|
|
20
24
|
import 'zustand/vanilla';
|
|
21
25
|
|
|
22
|
-
/**
|
|
23
|
-
|
|
26
|
+
/** An annotation drawn over a curve plot: a shaded band across a range of x,
|
|
27
|
+
* or a vertical line at one x. */
|
|
28
|
+
type CurveMark = {
|
|
29
|
+
kind: 'band';
|
|
30
|
+
x: [number, number];
|
|
31
|
+
color?: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'line';
|
|
24
34
|
x: number;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/** Multiplicative, so one notch covers the same proportion of the distance
|
|
45
|
-
* whether the camera is near or far. */
|
|
46
|
-
declare function orbitAfterWheel(view: OrbitView, deltaY: number, minDistance: number, maxDistance: number): OrbitView;
|
|
47
|
-
interface UseOrbitOptions {
|
|
48
|
-
view: OrbitView;
|
|
49
|
-
onViewChange: (v: OrbitView) => void;
|
|
50
|
-
/** Restored on double-click. Defaults to the view the hook first saw. */
|
|
51
|
-
home?: OrbitView;
|
|
52
|
-
minDistance?: number;
|
|
53
|
-
maxDistance?: number;
|
|
54
|
-
}
|
|
55
|
-
interface OrbitHandlers {
|
|
56
|
-
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
57
|
-
onPointerDown: (e: PointerEvent<HTMLElement>) => void;
|
|
58
|
-
onPointerMove: (e: PointerEvent<HTMLElement>) => void;
|
|
59
|
-
onPointerUp: (e: PointerEvent<HTMLElement>) => void;
|
|
60
|
-
onDoubleClick: () => void;
|
|
61
|
-
isDragging: () => boolean;
|
|
35
|
+
color?: string;
|
|
36
|
+
};
|
|
37
|
+
/** Props for `<CurveField>`. */
|
|
38
|
+
interface CurveFieldProps {
|
|
39
|
+
/** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs
|
|
40
|
+
* serialize in JSON snapshots. */
|
|
41
|
+
values: number[];
|
|
42
|
+
min: number;
|
|
43
|
+
max: number;
|
|
44
|
+
step: number;
|
|
45
|
+
/** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */
|
|
46
|
+
width: number;
|
|
47
|
+
/** Plot height in CSS px. Default 110. */
|
|
48
|
+
height?: number;
|
|
49
|
+
/** Flat default curve. When provided, a Reset button restores it. */
|
|
50
|
+
defaults?: readonly number[];
|
|
51
|
+
onChange: (next: number[]) => void;
|
|
52
|
+
/** Optional vertical marks overlaid on the plot (e.g. landmarks). */
|
|
53
|
+
marks?: readonly CurveMark[];
|
|
62
54
|
}
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
hasCanvas: boolean;
|
|
71
|
-
hasLayers: boolean;
|
|
72
|
-
hasDragDrop: boolean;
|
|
73
|
-
hasUndo: boolean;
|
|
74
|
-
}
|
|
75
|
-
/** Read an instrument's declared capabilities off its definition. */
|
|
76
|
-
declare function detectCapabilities(instrument: Instrument<unknown, unknown>): CapabilityFlags;
|
|
77
|
-
|
|
78
|
-
/** Identity at runtime; exists so an instrument's state and config types are
|
|
79
|
-
* inferred from the spec rather than having to be written out. */
|
|
80
|
-
declare function defineInstrument<TS, TC>(spec: Instrument<TS, TC>): Instrument<TS, TC>;
|
|
55
|
+
/**
|
|
56
|
+
* A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop
|
|
57
|
+
* numeric readouts and flip buttons. Wraps weasel-ui's
|
|
58
|
+
* `CurveEditor`; consumers wanting the raw editor (2D paths,
|
|
59
|
+
* custom anchors) should import that instead.
|
|
60
|
+
*/
|
|
61
|
+
declare function CurveField({ values, min, max, step, width, height, defaults, onChange, marks, }: CurveFieldProps): react_jsx_runtime.JSX.Element;
|
|
81
62
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
/** Props for `<Subpanel>`. */
|
|
64
|
+
interface SubpanelProps {
|
|
65
|
+
title: ReactNode;
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
className?: string;
|
|
87
68
|
}
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
69
|
+
/** A typographic divider inside a property list: a small title flanked by a
|
|
70
|
+
* rule. Purely a heading — use `<PropertyGroup>` for a bordered section. */
|
|
71
|
+
declare function Subpanel({ title, children, className }: SubpanelProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
/** Props for `<EffectCard>`. */
|
|
73
|
+
interface EffectCardProps {
|
|
74
|
+
/** Card title rendered in the title bar (e.g. effect kind label or a select). */
|
|
75
|
+
title: ReactNode;
|
|
76
|
+
/** Optional badge/chip displayed before the remove button (e.g. primary value summary). */
|
|
77
|
+
primary?: ReactNode;
|
|
78
|
+
/** Optional accent color in any CSS color form. Sets --wzl-effect-card-accent on the card. */
|
|
79
|
+
accent?: string;
|
|
80
|
+
/** Optional ordinal badge that doubles as the drag handle (used by tail cards in SB). */
|
|
81
|
+
index?: number;
|
|
82
|
+
expanded?: boolean;
|
|
83
|
+
onToggleExpanded?: () => void;
|
|
84
|
+
onRemove?: () => void;
|
|
100
85
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* around. Ignored unless the resolved mode is dark.
|
|
86
|
+
* Drag-handle wiring. When provided, an inline handle (⋮⋮ icon or `index`)
|
|
87
|
+
* activates HTML5 drag on press. Consumer owns the drag/drop coordination —
|
|
88
|
+
* see EffectCardList for the batteries-included wrapper.
|
|
105
89
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
draggable?: boolean;
|
|
91
|
+
onPressHandle?: () => void;
|
|
92
|
+
onReleaseHandle?: () => void;
|
|
93
|
+
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
94
|
+
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
95
|
+
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
96
|
+
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
97
|
+
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
98
|
+
dragging?: boolean;
|
|
108
99
|
children?: ReactNode;
|
|
100
|
+
className?: string;
|
|
109
101
|
}
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
interface LabContextValue {
|
|
118
|
-
instruments: InstrumentList;
|
|
119
|
-
trials: TrialRecord[];
|
|
120
|
-
addTrial: (instrumentName: string) => void;
|
|
121
|
-
cloneTrial: (id: string) => void;
|
|
122
|
-
closeTrial: (id: string) => void;
|
|
123
|
-
resetTrial: (id: string) => void;
|
|
124
|
-
reorderTrials: (ids: readonly string[]) => void;
|
|
125
|
-
savedSnapshots: SavedSnapshot[];
|
|
126
|
-
saveSnapshot: (trialId: string, name?: string) => void;
|
|
127
|
-
loadSnapshot: (trialId: string, snapshotId: string) => void;
|
|
128
|
-
deleteSnapshot: (snapshotId: string) => void;
|
|
129
|
-
mode: LabMode;
|
|
130
|
-
setMode: (m: LabMode) => void;
|
|
102
|
+
/** An accented, collapsible card for one item in a list of like things —
|
|
103
|
+
* effects, layers, tails. The accent color rebinds the theme accent token
|
|
104
|
+
* within the card, so its controls pick it up too. */
|
|
105
|
+
declare function EffectCard({ title, primary, accent, index, expanded, onToggleExpanded, onRemove, draggable, onPressHandle, onReleaseHandle, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, dragging, children, className, }: EffectCardProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
/** The minimum an item must carry to appear in an `<EffectCardList>`. */
|
|
107
|
+
interface EffectCardListItem {
|
|
108
|
+
id: string | number;
|
|
131
109
|
}
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
110
|
+
/** Props for `<EffectCardList>`. */
|
|
111
|
+
interface EffectCardListProps<T extends EffectCardListItem> {
|
|
112
|
+
items: ReadonlyArray<T>;
|
|
113
|
+
renderItem: (item: T, helpers: {
|
|
114
|
+
isExpanded: boolean;
|
|
115
|
+
isDragging: boolean;
|
|
116
|
+
toggleExpanded: () => void;
|
|
117
|
+
cardProps: Pick<EffectCardProps, 'expanded' | 'dragging' | 'draggable' | 'onToggleExpanded' | 'onPressHandle' | 'onReleaseHandle' | 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDragLeave' | 'onDrop'>;
|
|
118
|
+
}) => ReactNode;
|
|
119
|
+
onReorder: (sourceId: T['id'], targetId: T['id'], position: 'before' | 'after') => void;
|
|
120
|
+
/** Optional rendered when the list is empty. */
|
|
121
|
+
empty?: ReactNode;
|
|
122
|
+
/** IDs to render expanded on first mount. Defaults to all collapsed. */
|
|
123
|
+
defaultExpandedIds?: ReadonlyArray<T['id']>;
|
|
124
|
+
}
|
|
125
|
+
/** A drag-reorderable list of `<EffectCard>`s. Owns the expanded and dragging
|
|
126
|
+
* state and hands it back to `renderItem`, so the caller only supplies each
|
|
127
|
+
* card's contents. */
|
|
128
|
+
declare function EffectCardList<T extends EffectCardListItem>({ items, renderItem, onReorder, empty, defaultExpandedIds, }: EffectCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
136
129
|
|
|
137
|
-
/** Props for `<
|
|
138
|
-
interface
|
|
139
|
-
|
|
130
|
+
/** Props for `<PropertyGroup>`. */
|
|
131
|
+
interface PropertyGroupProps {
|
|
132
|
+
/** Title rendered between two rules at the top of the group. */
|
|
133
|
+
title: ReactNode;
|
|
134
|
+
/** When true the group renders nothing — useful for conditional sections. */
|
|
135
|
+
hidden?: boolean;
|
|
140
136
|
children: ReactNode;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
137
|
+
className?: string;
|
|
138
|
+
/**
|
|
139
|
+
* How rows pack into the 2-column grid.
|
|
140
|
+
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
141
|
+
* else spans the full width.
|
|
142
|
+
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
143
|
+
*/
|
|
144
|
+
pack?: 'auto-color' | 'pairs';
|
|
147
145
|
}
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Visually-bordered group inside a PropertyList. Use to scope a set of
|
|
148
|
+
* related rows under a heading (e.g. "Aqua", "Bevel", "Dome" sections
|
|
149
|
+
* inside a fill effect's controls).
|
|
150
|
+
*/
|
|
151
|
+
declare function PropertyGroup({ title, hidden, children, className, pack, }: PropertyGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
interface
|
|
153
|
+
/** Props for `<PropertyPanel>`. */
|
|
154
|
+
interface PropertyPanelProps {
|
|
155
|
+
title?: ReactNode;
|
|
156
|
+
children: ReactNode;
|
|
157
|
+
className?: string;
|
|
158
|
+
}
|
|
159
|
+
/** A titled panel holding property rows — the sidebar container the rest of
|
|
160
|
+
* this module's components fill. */
|
|
161
|
+
declare function PropertyPanel({ title, children, className }: PropertyPanelProps): react_jsx_runtime.JSX.Element;
|
|
162
|
+
/** How a property list packs its rows into two columns. */
|
|
163
|
+
type PropertyListPack = 'auto-color' | 'pairs';
|
|
164
|
+
/** Props for `<PropertyList>`. */
|
|
165
|
+
interface PropertyListProps {
|
|
166
166
|
children: ReactNode;
|
|
167
|
+
className?: string;
|
|
167
168
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
169
|
+
* How rows pack into the 2-column grid.
|
|
170
|
+
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
171
|
+
* else spans the full width. Right for sparse top-level panels.
|
|
172
|
+
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
173
|
+
* Headers and subpanels still span the full width; wrap any other
|
|
174
|
+
* full-width child in `<PropertySpan>`. Right for dense effect bodies.
|
|
173
175
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
pack?: PropertyListPack;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Grid container for PropertyRows. Use standalone for chrome-less layouts, or
|
|
180
|
+
* nest inside <PropertyPanel/> for the standard glass card.
|
|
181
|
+
*/
|
|
182
|
+
declare function PropertyList({ children, className, pack }: PropertyListProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
/** Props for `<PropertySpan>`. */
|
|
184
|
+
interface PropertySpanProps {
|
|
185
|
+
children: ReactNode;
|
|
186
|
+
className?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Wrapper that makes an arbitrary child span both columns of a
|
|
190
|
+
* `<PropertyList pack="pairs">`, a `<PropertyGroup pack="pairs">` body, or a
|
|
191
|
+
* `<Subpanel>`. `<PropertyRow span>` covers the row case; this covers
|
|
192
|
+
* everything else a consumer puts in the grid.
|
|
193
|
+
*/
|
|
194
|
+
declare function PropertySpan({ children, className }: PropertySpanProps): react_jsx_runtime.JSX.Element;
|
|
195
|
+
/** Which control shape a row holds, which decides its intrinsic layout. */
|
|
196
|
+
type PropertyRowVariant = 'default' | 'color' | 'checkbox';
|
|
197
|
+
/** Whether a row's label sits above its control or beside it. */
|
|
198
|
+
type PropertyRowLayout = 'block' | 'inline';
|
|
199
|
+
/** Props for `<PropertyRow>`. */
|
|
200
|
+
interface PropertyRowProps {
|
|
201
|
+
label: ReactNode;
|
|
202
|
+
/** Right-aligned readout shown next to the label (e.g. current value). */
|
|
203
|
+
readout?: ReactNode;
|
|
191
204
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* renders no tiles at all.
|
|
205
|
+
* Help text for the row, shown in a tooltip off an ⓘ affordance beside the
|
|
206
|
+
* label. Empty or absent renders no affordance.
|
|
195
207
|
*/
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
208
|
+
description?: string;
|
|
209
|
+
variant?: PropertyRowVariant;
|
|
210
|
+
/**
|
|
211
|
+
* Label position relative to the control. "block" (default) stacks
|
|
212
|
+
* label above control; "inline" places the label to the left.
|
|
213
|
+
* Color and checkbox variants are always inline by their own nature.
|
|
214
|
+
*/
|
|
215
|
+
layout?: PropertyRowLayout;
|
|
216
|
+
/**
|
|
217
|
+
* Take the full width of the enclosing grid. Only has an effect inside a
|
|
218
|
+
* `<PropertyList pack="pairs">` or a `<Subpanel>`; elsewhere rows are already
|
|
219
|
+
* full width.
|
|
220
|
+
*/
|
|
221
|
+
span?: boolean;
|
|
222
|
+
children: ReactNode;
|
|
223
|
+
htmlFor?: string;
|
|
224
|
+
className?: string;
|
|
225
|
+
}
|
|
226
|
+
/** The label-plus-control frame every typed row below is built from. Use it
|
|
227
|
+
* directly for a control this module does not cover. */
|
|
228
|
+
declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, className, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
229
|
+
/** Props for `<SliderRow>`. */
|
|
230
|
+
interface SliderRowProps {
|
|
231
|
+
label: ReactNode;
|
|
232
|
+
value: number;
|
|
233
|
+
min: number;
|
|
234
|
+
max: number;
|
|
235
|
+
step?: number;
|
|
236
|
+
onChange: (next: number) => void;
|
|
237
|
+
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
238
|
+
format?: (value: number) => ReactNode;
|
|
239
|
+
/**
|
|
240
|
+
* Optional suffix rendered next to the readout. A string becomes a
|
|
241
|
+
* baseline-aligned dim "word" unit (e.g. "px"); pass JSX like `<sup>°</sup>`
|
|
242
|
+
* to get the browser's native super positioning for symbol units.
|
|
243
|
+
*/
|
|
244
|
+
unit?: ReactNode;
|
|
245
|
+
layout?: PropertyRowLayout;
|
|
246
|
+
description?: string;
|
|
247
|
+
}
|
|
248
|
+
/** A bounded number edited by dragging, with a live readout whose precision
|
|
249
|
+
* follows `step`. */
|
|
250
|
+
declare function SliderRow({ label, value, min, max, step, onChange, format, unit, layout, description, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
251
|
+
/** Props for `<ColorRow>`. */
|
|
252
|
+
interface ColorRowProps {
|
|
253
|
+
label: ReactNode;
|
|
254
|
+
value: string;
|
|
255
|
+
onChange: (next: string) => void;
|
|
256
|
+
/** 0..1 alpha. When provided, a translucent slider renders beneath the swatch. */
|
|
257
|
+
alpha?: number;
|
|
258
|
+
onAlphaChange?: (next: number) => void;
|
|
259
|
+
/**
|
|
260
|
+
* Render the alpha track as inert (dimmed, no thumb, not-allowed cursor).
|
|
261
|
+
* Use when the color's consumer drops alpha so the affordance reads dead.
|
|
262
|
+
*/
|
|
263
|
+
alphaDisabled?: boolean;
|
|
264
|
+
description?: string;
|
|
265
|
+
}
|
|
266
|
+
/** A color swatch, optionally with an alpha slider beneath it. */
|
|
267
|
+
declare function ColorRow({ label, value, onChange, alpha, onAlphaChange, alphaDisabled, description, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
268
|
+
/** Props for `<CheckboxRow>`. */
|
|
269
|
+
interface CheckboxRowProps {
|
|
270
|
+
label: ReactNode;
|
|
271
|
+
value: boolean;
|
|
272
|
+
onChange: (next: boolean) => void;
|
|
273
|
+
description?: string;
|
|
274
|
+
}
|
|
275
|
+
/** A boolean checkbox. */
|
|
276
|
+
declare function CheckboxRow({ label, value, onChange, description }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
277
|
+
/** Props for `<TextRow>`. */
|
|
278
|
+
interface TextRowProps {
|
|
279
|
+
label: ReactNode;
|
|
280
|
+
value: string;
|
|
281
|
+
onChange: (next: string) => void;
|
|
282
|
+
placeholder?: string;
|
|
283
|
+
maxLength?: number;
|
|
284
|
+
layout?: PropertyRowLayout;
|
|
285
|
+
description?: string;
|
|
286
|
+
}
|
|
287
|
+
/** A single-line text input. */
|
|
288
|
+
declare function TextRow({ label, value, onChange, placeholder, maxLength, layout, description, }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
289
|
+
/** Props for `<NumberRow>`. */
|
|
290
|
+
interface NumberRowProps {
|
|
291
|
+
label: ReactNode;
|
|
292
|
+
value: number;
|
|
293
|
+
onChange: (next: number) => void;
|
|
294
|
+
min?: number;
|
|
295
|
+
max?: number;
|
|
296
|
+
step?: number;
|
|
297
|
+
placeholder?: string;
|
|
298
|
+
layout?: PropertyRowLayout;
|
|
299
|
+
description?: string;
|
|
300
|
+
}
|
|
301
|
+
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
302
|
+
* more than the exact value. */
|
|
303
|
+
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, layout, description, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
304
|
+
interface PropertyOption<T extends string> {
|
|
305
|
+
value: T;
|
|
306
|
+
label: ReactNode;
|
|
307
|
+
}
|
|
308
|
+
/** Props for `<SelectRow>`. */
|
|
309
|
+
interface SelectRowProps<T extends string> {
|
|
310
|
+
label: ReactNode;
|
|
311
|
+
value: T;
|
|
312
|
+
options: ReadonlyArray<PropertyOption<T>>;
|
|
313
|
+
onChange: (next: T) => void;
|
|
314
|
+
layout?: PropertyRowLayout;
|
|
315
|
+
description?: string;
|
|
316
|
+
}
|
|
317
|
+
/** A dropdown over a fixed set of choices. Prefer `<ToggleRow>` when there
|
|
318
|
+
* are only two or three and they should all stay visible. */
|
|
319
|
+
declare function SelectRow<T extends string>({ label, value, options, onChange, layout, description, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
320
|
+
/** Props for `<ToggleRow>`. */
|
|
321
|
+
interface ToggleRowProps<T extends string> {
|
|
322
|
+
label: ReactNode;
|
|
323
|
+
value: T;
|
|
324
|
+
options: ReadonlyArray<PropertyOption<T>>;
|
|
325
|
+
onChange: (next: T) => void;
|
|
326
|
+
layout?: PropertyRowLayout;
|
|
327
|
+
description?: string;
|
|
328
|
+
}
|
|
329
|
+
/** A segmented control: the same choice as a select, with every option
|
|
330
|
+
* visible at once. */
|
|
331
|
+
declare function ToggleRow<T extends string>({ label, value, options, onChange, layout, description, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
332
|
+
|
|
333
|
+
/** A point in the space the instrument works in. */
|
|
334
|
+
interface Vec3 {
|
|
335
|
+
x: number;
|
|
336
|
+
y: number;
|
|
337
|
+
z: number;
|
|
338
|
+
}
|
|
339
|
+
/** An orbit camera as a trial view: where it looks from, and what it looks at.
|
|
340
|
+
* labkit does not turn this into a matrix — the host's renderer does. */
|
|
341
|
+
interface OrbitView {
|
|
342
|
+
yaw: number;
|
|
343
|
+
pitch: number;
|
|
344
|
+
distance: number;
|
|
345
|
+
target: Vec3;
|
|
346
|
+
}
|
|
347
|
+
/** Just short of the pole. At exactly ±PI/2 the azimuth is undefined and the
|
|
348
|
+
* camera rolls, which reads as the model jumping rather than as a limit. */
|
|
349
|
+
declare const PITCH_LIMIT: number;
|
|
350
|
+
declare function clampPitch(pitch: number): number;
|
|
351
|
+
declare function wrapYaw(yaw: number): number;
|
|
352
|
+
/** The view a drag of (dx, dy) from `start` produces. Absolute against the drag
|
|
353
|
+
* start, so it can be re-applied any number of times without compounding. */
|
|
354
|
+
declare function orbitAfterDrag(start: OrbitView, dx: number, dy: number): OrbitView;
|
|
355
|
+
/** Multiplicative, so one notch covers the same proportion of the distance
|
|
356
|
+
* whether the camera is near or far. */
|
|
357
|
+
declare function orbitAfterWheel(view: OrbitView, deltaY: number, minDistance: number, maxDistance: number): OrbitView;
|
|
358
|
+
interface UseOrbitOptions {
|
|
359
|
+
view: OrbitView;
|
|
360
|
+
onViewChange: (v: OrbitView) => void;
|
|
361
|
+
/** Restored on double-click. Defaults to the view the hook first saw. */
|
|
362
|
+
home?: OrbitView;
|
|
363
|
+
minDistance?: number;
|
|
364
|
+
maxDistance?: number;
|
|
365
|
+
}
|
|
366
|
+
interface OrbitHandlers {
|
|
367
|
+
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
368
|
+
onPointerDown: (e: PointerEvent<HTMLElement>) => void;
|
|
369
|
+
onPointerMove: (e: PointerEvent<HTMLElement>) => void;
|
|
370
|
+
onPointerUp: (e: PointerEvent<HTMLElement>) => void;
|
|
371
|
+
onDoubleClick: () => void;
|
|
372
|
+
isDragging: () => boolean;
|
|
373
|
+
}
|
|
374
|
+
/** Pointer gestures over an orbit view: drag to turn, wheel or pinch to dolly,
|
|
375
|
+
* double-click to go home. The 3D peer of `usePanZoom`. */
|
|
376
|
+
declare function useOrbit({ view, onViewChange, home, minDistance, maxDistance, }: UseOrbitOptions): OrbitHandlers;
|
|
377
|
+
|
|
378
|
+
/** Shared chaining surface. Every method clones, so a node can be reused as a
|
|
379
|
+
* base for several leaves without one bleeding into the next. */
|
|
380
|
+
declare abstract class BaseNode<T> implements ConfigNode<T> {
|
|
381
|
+
readonly annotations: Readonly<Annotations>;
|
|
382
|
+
readonly options: Readonly<NodeOptions>;
|
|
383
|
+
abstract readonly kind: string | null;
|
|
384
|
+
readonly default: T;
|
|
385
|
+
constructor(defaultValue: T, annotations?: Readonly<Annotations>, options?: Readonly<NodeOptions>);
|
|
386
|
+
/** Clone into the same subclass. Subclasses with extra constructor
|
|
387
|
+
* arguments override this. */
|
|
388
|
+
protected with(annotations: Annotations, options: NodeOptions): this;
|
|
389
|
+
protected ann(patch: Annotations): this;
|
|
390
|
+
protected opt(patch: NodeOptions): this;
|
|
391
|
+
/** Human-readable label. Defaults to the key, title-cased. */
|
|
392
|
+
label(name: string): this;
|
|
393
|
+
/** Longer help text, surfaced as a tooltip on the row label. */
|
|
394
|
+
describe(description: string): this;
|
|
395
|
+
/** Omit from the panel unless it is asked to show hidden leaves. */
|
|
396
|
+
hidden(): this;
|
|
397
|
+
/** Pair with a sibling sharing this id, side-by-side on one row. */
|
|
398
|
+
pair(pair: string): this;
|
|
399
|
+
/** Render under a named section heading. */
|
|
400
|
+
section(section: string): this;
|
|
401
|
+
/** Show this row only while the predicate holds. Presentational — the value
|
|
402
|
+
* stays in config and the instrument still reads it. */
|
|
403
|
+
showIf(predicate: (config: Record<string, unknown>) => boolean): this;
|
|
404
|
+
/** Draw this one row yourself, keeping the kind, default and validation. */
|
|
405
|
+
render(renderer: ControlRenderer): this;
|
|
406
|
+
}
|
|
407
|
+
declare class NumberNode extends BaseNode<number> {
|
|
408
|
+
readonly kind = "number";
|
|
409
|
+
/** Bound the value. A number with both bounds renders as a slider. */
|
|
410
|
+
range(min: number, max: number): this;
|
|
411
|
+
step(step: number): this;
|
|
412
|
+
/** Force a slider even without both bounds. */
|
|
413
|
+
slider(): this;
|
|
414
|
+
/** Force a typed input even when both bounds are set. */
|
|
415
|
+
input(): this;
|
|
416
|
+
}
|
|
417
|
+
declare class BooleanNode extends BaseNode<boolean> {
|
|
418
|
+
readonly kind = "boolean";
|
|
419
|
+
/** Ask for a switch. `ControlPanel` still draws a checkbox; weasel-ui's
|
|
420
|
+
* `PrefsForm` honors the distinction. */
|
|
421
|
+
toggle(): this;
|
|
422
|
+
}
|
|
423
|
+
declare class StringNode extends BaseNode<string> {
|
|
424
|
+
readonly kind = "string";
|
|
425
|
+
placeholder(placeholder: string): this;
|
|
426
|
+
maxLength(maxLength: number): this;
|
|
427
|
+
/** Milliseconds to debounce live writes. 0 commits every keystroke. */
|
|
428
|
+
debounce(debounceMs: number): this;
|
|
429
|
+
}
|
|
430
|
+
declare class ColorNode extends BaseNode<string> {
|
|
431
|
+
readonly kind = "color";
|
|
432
|
+
}
|
|
433
|
+
declare class EnumNode<T extends string> extends BaseNode<T> {
|
|
434
|
+
readonly kind = "enum";
|
|
435
|
+
/** Render as a segmented control rather than a select. */
|
|
436
|
+
radio(): this;
|
|
437
|
+
/** Relabel the choices. Named `labels` rather than `options` because
|
|
438
|
+
* `options` is the node's own extras bag. */
|
|
439
|
+
labels(options: readonly ConfigOption[]): this;
|
|
440
|
+
}
|
|
441
|
+
/** A leaf whose kind the rule chain decides. */
|
|
442
|
+
declare class ValueNode<T> extends BaseNode<T> {
|
|
443
|
+
readonly kind: null;
|
|
444
|
+
}
|
|
445
|
+
/** A leaf of a kind labkit does not ship a row for. */
|
|
446
|
+
declare class CustomNode<T> extends BaseNode<T> {
|
|
447
|
+
readonly kind: string;
|
|
448
|
+
constructor(kind: string, defaultValue: T, annotations?: Readonly<Annotations>, options?: Readonly<NodeOptions>);
|
|
449
|
+
protected with(annotations: Annotations, options: NodeOptions): this;
|
|
200
450
|
}
|
|
201
451
|
/**
|
|
202
|
-
*
|
|
452
|
+
* Builds an instrument's config: the values, their types, and how each is
|
|
453
|
+
* edited, in one declaration.
|
|
203
454
|
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* const config = f.schema({
|
|
457
|
+
* showGrid: f.boolean(true),
|
|
458
|
+
* cellSize: f.number(20).range(5, 80).step(5).label('Grid spacing'),
|
|
459
|
+
* })
|
|
460
|
+
* ```
|
|
207
461
|
*/
|
|
208
|
-
declare
|
|
462
|
+
declare const f: {
|
|
463
|
+
number: (def: number) => NumberNode;
|
|
464
|
+
boolean: (def: boolean) => BooleanNode;
|
|
465
|
+
string: (def: string) => StringNode;
|
|
466
|
+
color: (def: string) => ColorNode;
|
|
467
|
+
/** A fixed set of choices. The default's literal type flows into the config
|
|
468
|
+
* type, so `f.enum('fast', ['fast', 'accurate'])` gives
|
|
469
|
+
* `'fast' | 'accurate'` with no `as const`. */
|
|
470
|
+
enum: <const T extends string>(def: T, options: readonly T[] | readonly ConfigOption[]) => EnumNode<T>;
|
|
471
|
+
/** A leaf with no declared kind: the rule chain decides, which is how a lab
|
|
472
|
+
* states a convention like "every `*Color` key is a color picker". */
|
|
473
|
+
value: <T>(def: T) => ValueNode<T>;
|
|
474
|
+
/** A leaf of a kind a lab supplies the control for, through `controls`. */
|
|
475
|
+
custom: <T>(kind: string, def: T, validate?: (leaf: ToolPrefLeaf) => string[]) => CustomNode<T>;
|
|
476
|
+
/** Collect leaves into an instrument's config. */
|
|
477
|
+
schema<S extends Record<string, ConfigNode>>(nodes: S): ConfigSchema<InferConfig<S>>;
|
|
478
|
+
};
|
|
209
479
|
|
|
210
|
-
/**
|
|
211
|
-
*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
|
|
480
|
+
/**
|
|
481
|
+
* Adapt a legacy `configSchema(): ConfigField[]` into the resolved shape, so
|
|
482
|
+
* both instrument paths reach one renderer.
|
|
483
|
+
*
|
|
484
|
+
* Rules do not run here: a hand-written `ConfigField` already states its label
|
|
485
|
+
* and control, which is everything the rule chain would have inferred.
|
|
486
|
+
*/
|
|
487
|
+
declare function fromConfigFields(fields: readonly ConfigField[]): ResolvedConfig;
|
|
217
488
|
|
|
218
|
-
type TokenValue = string | number | readonly (string | number)[];
|
|
219
489
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
490
|
+
* Resolve a schema into the vocabulary weasel-ui renders, running each leaf
|
|
491
|
+
* through the consumer's rules and then labkit's own.
|
|
492
|
+
*
|
|
493
|
+
* The group is flat — every leaf is a direct child — so a leaf's path is its
|
|
494
|
+
* config key and both `ControlPanel` and `PrefsForm` address it identically.
|
|
222
495
|
*/
|
|
223
|
-
|
|
224
|
-
readonly type: string;
|
|
225
|
-
readonly value: TokenValue;
|
|
226
|
-
/** Render the referenced color at this alpha, 0–1. */
|
|
227
|
-
readonly alpha?: number | undefined;
|
|
228
|
-
readonly description?: string | undefined;
|
|
229
|
-
}
|
|
230
|
-
/** A token graph flattened to one level, keyed by token name (no `--wzl-`
|
|
231
|
-
* prefix). Still unresolved — see `ResolvedTokenMap` for the output side. */
|
|
232
|
-
type FlatTokens = Record<string, RawToken>;
|
|
496
|
+
declare function resolveConfigSchema<TC>(schema: ConfigSchema<TC>, rules?: readonly ConfigRule[]): ResolvedConfig;
|
|
233
497
|
|
|
498
|
+
/** `cellSize` -> `Cell size`. Splits camelCase without shattering acronyms. */
|
|
499
|
+
declare function titleCase(key: string): string;
|
|
234
500
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* that
|
|
501
|
+
* labkit's own inference, expressed in the same vocabulary a consumer
|
|
502
|
+
* extends. Runs after the consumer's rules, so a lab always wins.
|
|
503
|
+
*
|
|
504
|
+
* If one of these ever needs something a `ConfigRule` cannot express, the
|
|
505
|
+
* seam is too weak — that is the point of writing them this way.
|
|
240
506
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
507
|
+
declare const builtinRules: readonly ConfigRule[];
|
|
508
|
+
/**
|
|
509
|
+
* Fold a rule chain into one leaf patch. Gap-filling: a property already
|
|
510
|
+
* settled is never overwritten, so the accumulator seeded with the author's
|
|
511
|
+
* annotations beats every rule, and earlier rules beat later ones.
|
|
512
|
+
*/
|
|
513
|
+
declare function applyRules(seed: LeafPatch, ctx: Omit<ConfigRuleContext, 'leaf'>, rules: readonly ConfigRule[]): LeafPatch;
|
|
248
514
|
|
|
249
515
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
516
|
+
* An instrument's controls, resolved against the surrounding lab's rules.
|
|
517
|
+
*
|
|
518
|
+
* Resolution cannot happen in `defineInstrument` — rules are lab-scoped and
|
|
519
|
+
* that runs at module load — so it happens here, at render. Both instrument
|
|
520
|
+
* paths land in the same shape, so callers never branch on which was used.
|
|
253
521
|
*/
|
|
254
|
-
declare
|
|
522
|
+
declare function useConfigSchema(instrument: Instrument<any, any, any>): ResolvedConfig;
|
|
255
523
|
|
|
256
|
-
/**
|
|
257
|
-
*
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
undo: () => void;
|
|
265
|
-
redo: () => void;
|
|
266
|
-
zoom: number;
|
|
267
|
-
setZoom: (z: number) => void;
|
|
268
|
-
zoomIn: () => void;
|
|
269
|
-
zoomOut: () => void;
|
|
270
|
-
resetZoom: () => void;
|
|
271
|
-
hasCanvas: boolean;
|
|
272
|
-
savedSnapshots: SavedSnapshot[];
|
|
273
|
-
saveSnapshot: (name?: string) => void;
|
|
274
|
-
loadSnapshot: (snapshotId: string) => void;
|
|
275
|
-
clone: () => void;
|
|
276
|
-
reset: () => void;
|
|
277
|
-
close: () => void;
|
|
278
|
-
isLastTrial: boolean;
|
|
279
|
-
}
|
|
280
|
-
/** What a trial hands its sidebar: the instrument's config schema, its
|
|
281
|
-
* current values, and the setter. */
|
|
282
|
-
interface TrialSidebarContext {
|
|
283
|
-
trialId: string;
|
|
284
|
-
instrumentName: string;
|
|
285
|
-
configFields: ConfigField[];
|
|
286
|
-
config: unknown;
|
|
287
|
-
setConfig: (key: string, value: unknown) => void;
|
|
288
|
-
}
|
|
289
|
-
/** What a trial hands its status bar. */
|
|
290
|
-
interface TrialStatusBarContext {
|
|
291
|
-
trialId: string;
|
|
292
|
-
instrumentName: string;
|
|
293
|
-
/** Null when the trial holds a view that is not the 2D one. */
|
|
294
|
-
zoom: number | null;
|
|
295
|
-
}
|
|
296
|
-
/** Replaces a trial's toolbar. Receives everything the default one uses,
|
|
297
|
-
* so a custom toolbar need not reach into the store. */
|
|
298
|
-
type ToolbarSlot = (ctx: TrialToolbarContext) => ReactNode;
|
|
299
|
-
/** Replaces a trial's sidebar. */
|
|
300
|
-
type SidebarSlot = (ctx: TrialSidebarContext) => ReactNode;
|
|
301
|
-
/** Replaces a trial's status bar. */
|
|
302
|
-
type StatusBarSlot = (ctx: TrialStatusBarContext) => ReactNode;
|
|
524
|
+
/**
|
|
525
|
+
* Whether a leaf's row should be drawn right now.
|
|
526
|
+
*
|
|
527
|
+
* `hidden` is the leaf's own static flag; `showIf` is the schema's predicate
|
|
528
|
+
* over the live config. Both are presentational — a hidden leaf keeps its
|
|
529
|
+
* value and the instrument still reads it.
|
|
530
|
+
*/
|
|
531
|
+
declare function isLeafVisible(resolved: ResolvedConfig, path: string, config: Record<string, unknown>, showHidden?: boolean): boolean;
|
|
303
532
|
|
|
304
|
-
/**
|
|
305
|
-
|
|
306
|
-
|
|
533
|
+
/** An instrument as it is written: either the legacy `defaultConfig` (plus an
|
|
534
|
+
* optional `configSchema`), or a `config` schema that supplies both. */
|
|
535
|
+
type InstrumentSpec<TS, TC, TItem = unknown> = Instrument<TS, TC, TItem> | (Omit<Instrument<TS, TC, TItem>, 'defaultConfig'> & {
|
|
536
|
+
config: ConfigSchema<TC>;
|
|
537
|
+
});
|
|
538
|
+
/**
|
|
539
|
+
* Normalizes an instrument spec, and infers its state and config types from
|
|
540
|
+
* the literal rather than making them be written out.
|
|
541
|
+
*
|
|
542
|
+
* A spec declaring `config` gets its `defaultConfig` synthesized from the
|
|
543
|
+
* schema, so nothing downstream branches on which way the config was
|
|
544
|
+
* declared. A spec written the legacy way is returned unchanged, by
|
|
545
|
+
* reference.
|
|
546
|
+
*
|
|
547
|
+
* Resolving the schema into controls does not happen here: rules are
|
|
548
|
+
* lab-scoped and this runs at module load. `useConfigSchema` does that.
|
|
549
|
+
*
|
|
550
|
+
* TypeScript infers all three type arguments or none, so a call that names
|
|
551
|
+
* `TS` and `TC` leaves `TItem` at `unknown` and a job's `onItem` needs a cast.
|
|
552
|
+
* Name the item type too, or pass no type arguments at all.
|
|
553
|
+
*/
|
|
554
|
+
declare function defineInstrument<TS, TC, TItem = unknown>(spec: InstrumentSpec<TS, TC, TItem>): Instrument<TS, TC, TItem>;
|
|
555
|
+
|
|
556
|
+
/** Whether a config schema is usable, and every problem found rather than
|
|
557
|
+
* just the first. */
|
|
558
|
+
interface ValidationResult {
|
|
559
|
+
valid: boolean;
|
|
560
|
+
errors: string[];
|
|
307
561
|
}
|
|
308
|
-
/**
|
|
309
|
-
* control
|
|
310
|
-
|
|
562
|
+
/** Check a config schema for the mistakes that would otherwise surface as a
|
|
563
|
+
* silently broken control: empty or duplicate keys, and fields whose own
|
|
564
|
+
* constraints do not hold.
|
|
565
|
+
*
|
|
566
|
+
* An unrecognized type is not an error — a lab supplies controls for its own
|
|
567
|
+
* kinds through `ControlPanel`'s `renderers`, and this cannot see them. Such
|
|
568
|
+
* a field simply has no constraints to check here. */
|
|
569
|
+
declare function validateConfigSchema(fields: ConfigField[]): ValidationResult;
|
|
570
|
+
|
|
571
|
+
/** Props for `<Lab>`. */
|
|
572
|
+
interface LabProps {
|
|
573
|
+
instruments: InstrumentList;
|
|
574
|
+
defaultInstrument: string;
|
|
575
|
+
storage?: StorageAdapter | null;
|
|
576
|
+
storageKey?: string;
|
|
577
|
+
mode?: LabMode;
|
|
578
|
+
/**
|
|
579
|
+
* Optional list of CSS colors used to compose the interstellar theme's
|
|
580
|
+
* cosmic backdrop. Each color becomes one radial-gradient blob on the
|
|
581
|
+
* dark void base. Order maps to a fixed spread of positions; extras wrap
|
|
582
|
+
* around. Ignored unless the resolved mode is dark.
|
|
583
|
+
*/
|
|
584
|
+
nebula?: readonly string[];
|
|
585
|
+
title?: string;
|
|
586
|
+
/** Rendered in the shell's footer, below the workspace. */
|
|
587
|
+
footer?: ReactNode;
|
|
588
|
+
/** Contributions added to every trial's chrome, after the instrument's own. */
|
|
589
|
+
chrome?: readonly TrialContribution[];
|
|
590
|
+
/** Built-in contribution ids to drop. Throws on an id that is not there. */
|
|
591
|
+
suppress?: readonly string[];
|
|
592
|
+
/** Tools offered lab-wide. A trial whose instrument declares none of its own
|
|
593
|
+
* reflects and writes this slot. */
|
|
594
|
+
tools?: readonly TrialTool[];
|
|
595
|
+
/** Rules run over every instrument's config leaves, before labkit's own
|
|
596
|
+
* inference — where a lab states a convention once instead of annotating
|
|
597
|
+
* each field. Memoize or hoist. */
|
|
598
|
+
configRules?: readonly ConfigRule[];
|
|
599
|
+
/** Control overrides and app-defined kinds for every trial's settings panel.
|
|
600
|
+
* Keys are config paths (checked first) or leaf kinds. Memoize or hoist. */
|
|
601
|
+
controls?: Record<string, ControlRenderer>;
|
|
602
|
+
children?: ReactNode;
|
|
603
|
+
}
|
|
604
|
+
/** The lab runtime: creates the store, provides it, and renders one trial
|
|
605
|
+
* per record in a grid. Each trial runs one of `instruments`. */
|
|
606
|
+
declare function Lab({ instruments, defaultInstrument, storage, storageKey, mode, nebula, title, footer, chrome, suppress, tools, configRules, controls, children, }: LabProps): react_jsx_runtime.JSX.Element;
|
|
607
|
+
|
|
608
|
+
/** Lab-wide state and commands: the available instruments, the open
|
|
609
|
+
* trials and the operations over them, saved snapshots, and the color
|
|
610
|
+
* mode. */
|
|
611
|
+
interface LabContextValue {
|
|
612
|
+
instruments: InstrumentList;
|
|
613
|
+
trials: TrialRecord[];
|
|
614
|
+
addTrial: (instrumentName: string) => void;
|
|
615
|
+
cloneTrial: (id: string) => void;
|
|
616
|
+
closeTrial: (id: string) => void;
|
|
617
|
+
resetTrial: (id: string) => void;
|
|
618
|
+
reorderTrials: (ids: readonly string[]) => void;
|
|
619
|
+
savedSnapshots: SavedSnapshot[];
|
|
620
|
+
saveSnapshot: (trialId: string, name?: string) => void;
|
|
621
|
+
loadSnapshot: (trialId: string, snapshotId: string) => void;
|
|
622
|
+
deleteSnapshot: (snapshotId: string) => void;
|
|
623
|
+
mode: LabMode;
|
|
624
|
+
setMode: (m: LabMode) => void;
|
|
625
|
+
/** Lab-wide rules run over every instrument's config leaves, before
|
|
626
|
+
* labkit's own inference. */
|
|
627
|
+
configRules?: readonly ConfigRule[];
|
|
628
|
+
/** Lab-wide control overrides, keyed by config path or by leaf kind. */
|
|
629
|
+
controls?: Record<string, ControlRenderer>;
|
|
630
|
+
}
|
|
631
|
+
/** Context carrying the surrounding lab. Prefer `useLabContext`. */
|
|
632
|
+
declare const LabContext: react.Context<LabContextValue | null>;
|
|
633
|
+
/** The surrounding lab. Throws outside a `<Lab>`. */
|
|
634
|
+
declare function useLabContext(): LabContextValue;
|
|
311
635
|
|
|
312
|
-
/** Props for `<
|
|
313
|
-
interface
|
|
314
|
-
|
|
636
|
+
/** Props for `<LabPalette>`. */
|
|
637
|
+
interface LabPaletteProps {
|
|
638
|
+
tools: readonly TrialTool[];
|
|
315
639
|
}
|
|
316
|
-
/** The
|
|
317
|
-
*
|
|
318
|
-
declare function
|
|
640
|
+
/** The lab's tool strip. Writes the lab's tool slot, which every trial whose
|
|
641
|
+
* instrument declares no tools of its own resolves to. */
|
|
642
|
+
declare function LabPalette({ tools }: LabPaletteProps): react_jsx_runtime.JSX.Element;
|
|
319
643
|
|
|
320
|
-
/** Props for `<
|
|
321
|
-
interface
|
|
322
|
-
|
|
644
|
+
/** Props for `<LabShell>`. */
|
|
645
|
+
interface LabShellProps {
|
|
646
|
+
title: string;
|
|
647
|
+
children: ReactNode;
|
|
648
|
+
/** Optional content rendered into the header (e.g., action buttons). */
|
|
649
|
+
header?: ReactNode;
|
|
650
|
+
/** Optional content rendered into the footer. */
|
|
651
|
+
footer?: ReactNode;
|
|
652
|
+
/** Color mode. "auto" (default) follows prefers-color-scheme. */
|
|
653
|
+
mode?: LabMode;
|
|
323
654
|
}
|
|
324
|
-
/**
|
|
325
|
-
*
|
|
326
|
-
|
|
655
|
+
/** Page frame for a lab: a titled header, a body, and an optional footer,
|
|
656
|
+
* themed for the resolved color mode. Presentational only — use `<Lab>` when
|
|
657
|
+
* the trial runtime is wanted too. */
|
|
658
|
+
declare function LabShell({ title, children, header, footer, mode }: LabShellProps): react_jsx_runtime.JSX.Element;
|
|
659
|
+
|
|
660
|
+
/** A tile's persisted extent, keyed by the id its caller gave it. Grid resizes
|
|
661
|
+
* write `span`; `size` is here because a strategy swap would write that. */
|
|
662
|
+
type TrialLayout = Record<string, {
|
|
663
|
+
size?: {
|
|
664
|
+
w?: number;
|
|
665
|
+
h?: number;
|
|
666
|
+
};
|
|
667
|
+
span?: {
|
|
668
|
+
cols?: number;
|
|
669
|
+
rows?: number;
|
|
670
|
+
};
|
|
671
|
+
}>;
|
|
672
|
+
interface WorkspaceProps {
|
|
673
|
+
children: ReactNode;
|
|
674
|
+
/**
|
|
675
|
+
* Stable id per child, positionally matched. Supply these whenever a tile
|
|
676
|
+
* can be closed from the middle: without them a tile is identified by its
|
|
677
|
+
* position, so closing one shifts every id after it and the panes inherit
|
|
678
|
+
* each other's dragged extents. `layout` and `reorderable` both key off
|
|
679
|
+
* these, so neither means much without them.
|
|
680
|
+
*/
|
|
681
|
+
ids?: readonly string[];
|
|
682
|
+
/** Draggable seams between tiles. Off by default — an even tiling is the
|
|
683
|
+
* behavior every existing caller has. */
|
|
684
|
+
resizable?: boolean;
|
|
685
|
+
/** Let a tile be dragged to a new position. Off by default. The grid never
|
|
686
|
+
* reorders `children` itself: it reports the order a drop would produce and
|
|
687
|
+
* the caller commits it. */
|
|
688
|
+
reorderable?: boolean;
|
|
689
|
+
/** The full id list a drop would produce, in its new order. */
|
|
690
|
+
onReorder?: (ids: string[]) => void;
|
|
691
|
+
/** Extents from a previous session, applied to tiles as they register. */
|
|
692
|
+
layout?: TrialLayout;
|
|
693
|
+
/** Fires when a tile's extent changes. Persist it and hand it back as
|
|
694
|
+
* `layout` to make a resize survive a reload. */
|
|
695
|
+
onLayoutChange?: (layout: TrialLayout) => void;
|
|
696
|
+
gap?: number;
|
|
697
|
+
padding?: number;
|
|
698
|
+
/**
|
|
699
|
+
* Fixed tiling extent. Omit in an app — the grid measures its own box. Supply
|
|
700
|
+
* it where nothing measures, notably jsdom: at a zero measurement the grid
|
|
701
|
+
* renders no tiles at all.
|
|
702
|
+
*/
|
|
703
|
+
viewport?: {
|
|
704
|
+
w: number;
|
|
705
|
+
h: number;
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Auto-balanced tiling of trials, `ceil(sqrt(n))` columns wide.
|
|
710
|
+
*
|
|
711
|
+
* Tiles are absolutely positioned at the rects `gridStrategy` computes, not
|
|
712
|
+
* laid out by CSS — `windease/styles.css` (folded into
|
|
713
|
+
* `@weasel-js/labkit/styles.css`) carries the rules that positioning depends on.
|
|
714
|
+
*/
|
|
715
|
+
declare function Workspace({ children, ids, resizable, reorderable, onReorder, layout, onLayoutChange, gap, padding, viewport, }: WorkspaceProps): react_jsx_runtime.JSX.Element;
|
|
716
|
+
|
|
717
|
+
/** The 2D view labkit has always shipped, and what a trial gets when it names no
|
|
718
|
+
* other. Re-exported under its own name so a consumer can say which it means. */
|
|
719
|
+
type ViewTransform2D = ViewTransform;
|
|
720
|
+
declare const DEFAULT_VIEW: ViewTransform2D;
|
|
721
|
+
/** A trial's view is opaque to labkit, so anything that needs the 2D shape — the
|
|
722
|
+
* zoom chrome, `CanvasStack` — asks for it and handles not getting it. */
|
|
723
|
+
declare function as2DView(view: unknown): ViewTransform2D | null;
|
|
724
|
+
|
|
725
|
+
type TokenValue = string | number | readonly (string | number)[];
|
|
726
|
+
/**
|
|
727
|
+
* A single design token as authored, before aliases are resolved: a DTCG-shaped
|
|
728
|
+
* `{ type, value }` pair where `value` may still be a `{ref}` to another token.
|
|
729
|
+
*/
|
|
730
|
+
interface RawToken {
|
|
731
|
+
readonly type: string;
|
|
732
|
+
readonly value: TokenValue;
|
|
733
|
+
/** Render the referenced color at this alpha, 0–1. */
|
|
734
|
+
readonly alpha?: number | undefined;
|
|
735
|
+
readonly description?: string | undefined;
|
|
736
|
+
}
|
|
737
|
+
/** A token graph flattened to one level, keyed by token name (no `--wzl-`
|
|
738
|
+
* prefix). Still unresolved — see `ResolvedTokenMap` for the output side. */
|
|
739
|
+
type FlatTokens = Record<string, RawToken>;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* A theme: a named set of design tokens, organized into a mode-invariant layer
|
|
743
|
+
* plus one layer per mode (light, dark, …), optionally extending another theme.
|
|
744
|
+
* Tokens are held unresolved — aliases between them are collapsed later by
|
|
745
|
+
* `resolveTheme`, so an override of a base primitive still reaches everything
|
|
746
|
+
* that references it.
|
|
747
|
+
*/
|
|
748
|
+
interface Theme {
|
|
749
|
+
readonly name: string;
|
|
750
|
+
readonly extends: Theme | null;
|
|
751
|
+
readonly defaultMode: string;
|
|
752
|
+
readonly tokens: FlatTokens;
|
|
753
|
+
readonly modes: Readonly<Record<string, FlatTokens>>;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* labkit's theme: a cosmic dark and a warm parchment light, extending the
|
|
758
|
+
* built-in weasel theme. Authored as DTCG and loaded at import time — the
|
|
759
|
+
* interchange path a theme exported from a design tool would take.
|
|
760
|
+
*/
|
|
761
|
+
declare const interstellarTheme: Theme;
|
|
327
762
|
|
|
328
763
|
/** Props for `<Trial>`. */
|
|
329
764
|
interface TrialProps {
|
|
330
765
|
id: string;
|
|
766
|
+
/** Contributions the lab adds to this trial's chrome, merged after the
|
|
767
|
+
* instrument's own. */
|
|
768
|
+
chrome?: readonly TrialContribution[];
|
|
769
|
+
/** Built-in contribution ids to drop. Throws on an id that is not there. */
|
|
770
|
+
suppress?: readonly string[];
|
|
331
771
|
}
|
|
332
772
|
/** Renders one trial from the lab store: looks up its record and
|
|
333
773
|
* instrument, and mounts the instrument inside the trial chrome. */
|
|
334
|
-
declare function Trial({ id }: TrialProps): react_jsx_runtime.JSX.Element;
|
|
774
|
+
declare function Trial({ id, chrome, suppress }: TrialProps): react_jsx_runtime.JSX.Element;
|
|
335
775
|
|
|
336
776
|
interface UndoBindings {
|
|
337
777
|
canUndo: boolean;
|
|
@@ -345,19 +785,26 @@ interface TrialChromeProps {
|
|
|
345
785
|
record: TrialRecord;
|
|
346
786
|
instrument: Instrument;
|
|
347
787
|
isLastTrial: boolean;
|
|
348
|
-
toolbar?: ToolbarSlot;
|
|
349
|
-
sidebar?: SidebarSlot;
|
|
350
|
-
statusBar?: StatusBarSlot;
|
|
351
788
|
undoBindings?: UndoBindings;
|
|
352
789
|
/** Supplied when the instrument declares a `job`. */
|
|
353
790
|
job?: JobHandle;
|
|
354
|
-
|
|
791
|
+
/** Contributions the trial runtime itself adds — the drag palette and the
|
|
792
|
+
* layer list, which depend on runtime state the instrument cannot reach. */
|
|
793
|
+
trialChrome?: readonly TrialContribution[];
|
|
794
|
+
/** Contributions from the lab, merged last. */
|
|
795
|
+
chrome?: readonly TrialContribution[];
|
|
796
|
+
/** Built-in contribution ids to drop. Throws on an id that is not there. */
|
|
797
|
+
suppress?: readonly string[];
|
|
798
|
+
/** The trial's resolved tool slot, and the setter that writes whichever
|
|
799
|
+
* slot it resolved to. `Trial` owns the resolution. */
|
|
800
|
+
activeToolId?: string | null;
|
|
801
|
+
setActiveTool?: (id: string) => void;
|
|
355
802
|
children: ReactNode;
|
|
356
803
|
}
|
|
357
|
-
/** The frame around a running instrument
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
declare function TrialChrome({ trialId, record, instrument, isLastTrial,
|
|
804
|
+
/** The frame around a running instrument. Builds one chrome context, assembles
|
|
805
|
+
* the contributions the instrument, the runtime and the lab declare, and hands
|
|
806
|
+
* each region its slice. */
|
|
807
|
+
declare function TrialChrome({ trialId, record, instrument, isLastTrial, undoBindings, job, trialChrome, chrome, suppress, activeToolId, setActiveTool, children, }: TrialChromeProps): react_jsx_runtime.JSX.Element;
|
|
361
808
|
|
|
362
809
|
/** Append a new trial running `instrumentName`, at that instrument's
|
|
363
810
|
* default config and initial state. */
|
|
@@ -378,282 +825,5 @@ declare function resetTrial(trials: TrialRecord[], id: string, instruments: Inst
|
|
|
378
825
|
*/
|
|
379
826
|
declare function reorderTrials(trials: TrialRecord[], ids: readonly string[]): TrialRecord[];
|
|
380
827
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
type CurveMark = {
|
|
384
|
-
kind: 'band';
|
|
385
|
-
x: [number, number];
|
|
386
|
-
color?: string;
|
|
387
|
-
} | {
|
|
388
|
-
kind: 'line';
|
|
389
|
-
x: number;
|
|
390
|
-
color?: string;
|
|
391
|
-
};
|
|
392
|
-
/** Props for `<CurveField>`. */
|
|
393
|
-
interface CurveFieldProps {
|
|
394
|
-
/** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs
|
|
395
|
-
* serialize in JSON snapshots. */
|
|
396
|
-
values: number[];
|
|
397
|
-
min: number;
|
|
398
|
-
max: number;
|
|
399
|
-
step: number;
|
|
400
|
-
/** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */
|
|
401
|
-
width: number;
|
|
402
|
-
/** Plot height in CSS px. Default 110. */
|
|
403
|
-
height?: number;
|
|
404
|
-
/** Flat default curve. When provided, a Reset button restores it. */
|
|
405
|
-
defaults?: readonly number[];
|
|
406
|
-
onChange: (next: number[]) => void;
|
|
407
|
-
/** Optional vertical marks overlaid on the plot (e.g. landmarks). */
|
|
408
|
-
marks?: readonly CurveMark[];
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop
|
|
412
|
-
* numeric readouts and flip buttons. Wraps weasel-ui's
|
|
413
|
-
* `CurveEditor`; consumers wanting the raw editor (2D paths,
|
|
414
|
-
* custom anchors) should import it from `@weasel-js/labkit/weasel-ui`.
|
|
415
|
-
*/
|
|
416
|
-
declare function CurveField({ values, min, max, step, width, height, defaults, onChange, marks, }: CurveFieldProps): react_jsx_runtime.JSX.Element;
|
|
417
|
-
|
|
418
|
-
/** Props for `<Subpanel>`. */
|
|
419
|
-
interface SubpanelProps {
|
|
420
|
-
title: ReactNode;
|
|
421
|
-
children: ReactNode;
|
|
422
|
-
className?: string;
|
|
423
|
-
}
|
|
424
|
-
/** A typographic divider inside a property list: a small title flanked by a
|
|
425
|
-
* rule. Purely a heading — use `<PropertyGroup>` for a bordered section. */
|
|
426
|
-
declare function Subpanel({ title, children, className }: SubpanelProps): react_jsx_runtime.JSX.Element;
|
|
427
|
-
/** Props for `<EffectCard>`. */
|
|
428
|
-
interface EffectCardProps {
|
|
429
|
-
/** Card title rendered in the title bar (e.g. effect kind label or a select). */
|
|
430
|
-
title: ReactNode;
|
|
431
|
-
/** Optional badge/chip displayed before the remove button (e.g. primary value summary). */
|
|
432
|
-
primary?: ReactNode;
|
|
433
|
-
/** Optional accent color in any CSS color form. Sets --lk-panel-accent on the card. */
|
|
434
|
-
accent?: string;
|
|
435
|
-
/** Optional ordinal badge that doubles as the drag handle (used by tail cards in SB). */
|
|
436
|
-
index?: number;
|
|
437
|
-
expanded?: boolean;
|
|
438
|
-
onToggleExpanded?: () => void;
|
|
439
|
-
onRemove?: () => void;
|
|
440
|
-
/**
|
|
441
|
-
* Drag-handle wiring. When provided, an inline handle (⋮⋮ icon or `index`)
|
|
442
|
-
* activates HTML5 drag on press. Consumer owns the drag/drop coordination —
|
|
443
|
-
* see EffectCardList for the batteries-included wrapper.
|
|
444
|
-
*/
|
|
445
|
-
draggable?: boolean;
|
|
446
|
-
onPressHandle?: () => void;
|
|
447
|
-
onReleaseHandle?: () => void;
|
|
448
|
-
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
449
|
-
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
450
|
-
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
451
|
-
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
452
|
-
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
453
|
-
dragging?: boolean;
|
|
454
|
-
children?: ReactNode;
|
|
455
|
-
className?: string;
|
|
456
|
-
}
|
|
457
|
-
/** An accented, collapsible card for one item in a list of like things —
|
|
458
|
-
* effects, layers, tails. The accent color rebinds the theme accent token
|
|
459
|
-
* within the card, so its controls pick it up too. */
|
|
460
|
-
declare function EffectCard({ title, primary, accent, index, expanded, onToggleExpanded, onRemove, draggable, onPressHandle, onReleaseHandle, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, dragging, children, className, }: EffectCardProps): react_jsx_runtime.JSX.Element;
|
|
461
|
-
/** The minimum an item must carry to appear in an `<EffectCardList>`. */
|
|
462
|
-
interface EffectCardListItem {
|
|
463
|
-
id: string | number;
|
|
464
|
-
}
|
|
465
|
-
/** Props for `<EffectCardList>`. */
|
|
466
|
-
interface EffectCardListProps<T extends EffectCardListItem> {
|
|
467
|
-
items: ReadonlyArray<T>;
|
|
468
|
-
renderItem: (item: T, helpers: {
|
|
469
|
-
isExpanded: boolean;
|
|
470
|
-
isDragging: boolean;
|
|
471
|
-
toggleExpanded: () => void;
|
|
472
|
-
cardProps: Pick<EffectCardProps, 'expanded' | 'dragging' | 'draggable' | 'onToggleExpanded' | 'onPressHandle' | 'onReleaseHandle' | 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDragLeave' | 'onDrop'>;
|
|
473
|
-
}) => ReactNode;
|
|
474
|
-
onReorder: (sourceId: T['id'], targetId: T['id'], position: 'before' | 'after') => void;
|
|
475
|
-
/** Optional rendered when the list is empty. */
|
|
476
|
-
empty?: ReactNode;
|
|
477
|
-
/** IDs to render expanded on first mount. Defaults to all collapsed. */
|
|
478
|
-
defaultExpandedIds?: ReadonlyArray<T['id']>;
|
|
479
|
-
}
|
|
480
|
-
/** A drag-reorderable list of `<EffectCard>`s. Owns the expanded and dragging
|
|
481
|
-
* state and hands it back to `renderItem`, so the caller only supplies each
|
|
482
|
-
* card's contents. */
|
|
483
|
-
declare function EffectCardList<T extends EffectCardListItem>({ items, renderItem, onReorder, empty, defaultExpandedIds, }: EffectCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
484
|
-
|
|
485
|
-
/** Props for `<PropertyGroup>`. */
|
|
486
|
-
interface PropertyGroupProps {
|
|
487
|
-
/** Title rendered between two rules at the top of the group. */
|
|
488
|
-
title: ReactNode;
|
|
489
|
-
/** When true the group renders nothing — useful for conditional sections. */
|
|
490
|
-
hidden?: boolean;
|
|
491
|
-
children: ReactNode;
|
|
492
|
-
className?: string;
|
|
493
|
-
/**
|
|
494
|
-
* How rows pack into the 2-column grid.
|
|
495
|
-
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
496
|
-
* else spans the full width.
|
|
497
|
-
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
498
|
-
*/
|
|
499
|
-
pack?: 'auto-color' | 'pairs';
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* Visually-bordered group inside a PropertyList. Use to scope a set of
|
|
503
|
-
* related rows under a heading (e.g. "Aqua", "Bevel", "Dome" sections
|
|
504
|
-
* inside a fill effect's controls).
|
|
505
|
-
*/
|
|
506
|
-
declare function PropertyGroup({ title, hidden, children, className, pack, }: PropertyGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
507
|
-
|
|
508
|
-
/** Props for `<PropertyPanel>`. */
|
|
509
|
-
interface PropertyPanelProps {
|
|
510
|
-
title?: ReactNode;
|
|
511
|
-
children: ReactNode;
|
|
512
|
-
className?: string;
|
|
513
|
-
}
|
|
514
|
-
/** A titled panel holding property rows — the sidebar container the rest of
|
|
515
|
-
* this module's components fill. */
|
|
516
|
-
declare function PropertyPanel({ title, children, className }: PropertyPanelProps): react_jsx_runtime.JSX.Element;
|
|
517
|
-
/** How a property list packs its rows into two columns. */
|
|
518
|
-
type PropertyListPack = 'auto-color' | 'pairs';
|
|
519
|
-
/** Props for `<PropertyList>`. */
|
|
520
|
-
interface PropertyListProps {
|
|
521
|
-
children: ReactNode;
|
|
522
|
-
className?: string;
|
|
523
|
-
/**
|
|
524
|
-
* How rows pack into the 2-column grid.
|
|
525
|
-
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
526
|
-
* else spans the full width. Right for sparse top-level panels.
|
|
527
|
-
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
528
|
-
* Headers, subpanels, and full-width children (`<hr>`, curve blocks)
|
|
529
|
-
* still span via `lk-property-list__span`. Right for dense effect bodies.
|
|
530
|
-
*/
|
|
531
|
-
pack?: PropertyListPack;
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Grid container for PropertyRows. Use standalone for chrome-less layouts, or
|
|
535
|
-
* nest inside <PropertyPanel/> for the standard glass card.
|
|
536
|
-
*/
|
|
537
|
-
declare function PropertyList({ children, className, pack }: PropertyListProps): react_jsx_runtime.JSX.Element;
|
|
538
|
-
/** Which control shape a row holds, which decides its intrinsic layout. */
|
|
539
|
-
type PropertyRowVariant = 'default' | 'color' | 'checkbox';
|
|
540
|
-
/** Whether a row's label sits above its control or beside it. */
|
|
541
|
-
type PropertyRowLayout = 'block' | 'inline';
|
|
542
|
-
/** Props for `<PropertyRow>`. */
|
|
543
|
-
interface PropertyRowProps {
|
|
544
|
-
label: ReactNode;
|
|
545
|
-
/** Right-aligned readout shown next to the label (e.g. current value). */
|
|
546
|
-
readout?: ReactNode;
|
|
547
|
-
variant?: PropertyRowVariant;
|
|
548
|
-
/**
|
|
549
|
-
* Label position relative to the control. "block" (default) stacks
|
|
550
|
-
* label above control; "inline" places the label to the left.
|
|
551
|
-
* Color and checkbox variants are always inline by their own nature.
|
|
552
|
-
*/
|
|
553
|
-
layout?: PropertyRowLayout;
|
|
554
|
-
children: ReactNode;
|
|
555
|
-
htmlFor?: string;
|
|
556
|
-
className?: string;
|
|
557
|
-
}
|
|
558
|
-
/** The label-plus-control frame every typed row below is built from. Use it
|
|
559
|
-
* directly for a control this module does not cover. */
|
|
560
|
-
declare function PropertyRow({ label, readout, variant, layout, children, htmlFor, className, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
561
|
-
/** Props for `<SliderRow>`. */
|
|
562
|
-
interface SliderRowProps {
|
|
563
|
-
label: ReactNode;
|
|
564
|
-
value: number;
|
|
565
|
-
min: number;
|
|
566
|
-
max: number;
|
|
567
|
-
step?: number;
|
|
568
|
-
onChange: (next: number) => void;
|
|
569
|
-
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
570
|
-
format?: (value: number) => ReactNode;
|
|
571
|
-
/**
|
|
572
|
-
* Optional suffix rendered next to the readout. A string becomes a
|
|
573
|
-
* baseline-aligned dim "word" unit (e.g. "px"); pass JSX like `<sup>°</sup>`
|
|
574
|
-
* to get the browser's native super positioning for symbol units.
|
|
575
|
-
*/
|
|
576
|
-
unit?: ReactNode;
|
|
577
|
-
layout?: PropertyRowLayout;
|
|
578
|
-
}
|
|
579
|
-
/** A bounded number edited by dragging, with a live readout whose precision
|
|
580
|
-
* follows `step`. */
|
|
581
|
-
declare function SliderRow({ label, value, min, max, step, onChange, format, unit, layout, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
582
|
-
/** Props for `<ColorRow>`. */
|
|
583
|
-
interface ColorRowProps {
|
|
584
|
-
label: ReactNode;
|
|
585
|
-
value: string;
|
|
586
|
-
onChange: (next: string) => void;
|
|
587
|
-
/** 0..1 alpha. When provided, a translucent slider renders beneath the swatch. */
|
|
588
|
-
alpha?: number;
|
|
589
|
-
onAlphaChange?: (next: number) => void;
|
|
590
|
-
/**
|
|
591
|
-
* Render the alpha track as inert (dimmed, no thumb, not-allowed cursor).
|
|
592
|
-
* Use when the color's consumer drops alpha so the affordance reads dead.
|
|
593
|
-
*/
|
|
594
|
-
alphaDisabled?: boolean;
|
|
595
|
-
}
|
|
596
|
-
/** A color swatch, optionally with an alpha slider beneath it. */
|
|
597
|
-
declare function ColorRow({ label, value, onChange, alpha, onAlphaChange, alphaDisabled, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
598
|
-
/** Props for `<CheckboxRow>`. */
|
|
599
|
-
interface CheckboxRowProps {
|
|
600
|
-
label: ReactNode;
|
|
601
|
-
value: boolean;
|
|
602
|
-
onChange: (next: boolean) => void;
|
|
603
|
-
}
|
|
604
|
-
/** A boolean checkbox. */
|
|
605
|
-
declare function CheckboxRow({ label, value, onChange }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
606
|
-
/** Props for `<TextRow>`. */
|
|
607
|
-
interface TextRowProps {
|
|
608
|
-
label: ReactNode;
|
|
609
|
-
value: string;
|
|
610
|
-
onChange: (next: string) => void;
|
|
611
|
-
placeholder?: string;
|
|
612
|
-
maxLength?: number;
|
|
613
|
-
layout?: PropertyRowLayout;
|
|
614
|
-
}
|
|
615
|
-
/** A single-line text input. */
|
|
616
|
-
declare function TextRow({ label, value, onChange, placeholder, maxLength, layout }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
617
|
-
/** Props for `<NumberRow>`. */
|
|
618
|
-
interface NumberRowProps {
|
|
619
|
-
label: ReactNode;
|
|
620
|
-
value: number;
|
|
621
|
-
onChange: (next: number) => void;
|
|
622
|
-
min?: number;
|
|
623
|
-
max?: number;
|
|
624
|
-
step?: number;
|
|
625
|
-
placeholder?: string;
|
|
626
|
-
layout?: PropertyRowLayout;
|
|
627
|
-
}
|
|
628
|
-
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
629
|
-
* more than the exact value. */
|
|
630
|
-
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, layout, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
631
|
-
interface SelectOption<T extends string> {
|
|
632
|
-
value: T;
|
|
633
|
-
label: ReactNode;
|
|
634
|
-
}
|
|
635
|
-
/** Props for `<SelectRow>`. */
|
|
636
|
-
interface SelectRowProps<T extends string> {
|
|
637
|
-
label: ReactNode;
|
|
638
|
-
value: T;
|
|
639
|
-
options: ReadonlyArray<SelectOption<T>>;
|
|
640
|
-
onChange: (next: T) => void;
|
|
641
|
-
layout?: PropertyRowLayout;
|
|
642
|
-
}
|
|
643
|
-
/** A dropdown over a fixed set of choices. Prefer `<ToggleRow>` when there
|
|
644
|
-
* are only two or three and they should all stay visible. */
|
|
645
|
-
declare function SelectRow<T extends string>({ label, value, options, onChange, layout, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
646
|
-
/** Props for `<ToggleRow>`. */
|
|
647
|
-
interface ToggleRowProps<T extends string> {
|
|
648
|
-
label: ReactNode;
|
|
649
|
-
value: T;
|
|
650
|
-
options: ReadonlyArray<SelectOption<T>>;
|
|
651
|
-
onChange: (next: T) => void;
|
|
652
|
-
layout?: PropertyRowLayout;
|
|
653
|
-
}
|
|
654
|
-
/** A segmented control: the same choice as a select, with every option
|
|
655
|
-
* visible at once. */
|
|
656
|
-
declare function ToggleRow<T extends string>({ label, value, options, onChange, layout, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
657
|
-
|
|
658
|
-
export { CheckboxRow, ColorRow, ConfigField, CurveField, DEFAULT_VIEW, DefaultSidebar, DefaultStatusBar, DefaultToolbar, EffectCard, EffectCardList, Instrument, InstrumentList, JobHandle, Lab, LabContext, LabMode, LabShell, NumberRow, PITCH_LIMIT, PropertyGroup, PropertyList, PropertyPanel, PropertyRow, SavedSnapshot, SelectRow, SliderRow, StorageAdapter, Subpanel, TextRow, ToggleRow, Trial, TrialChrome, TrialRecord, ViewTransform, Workspace, addTrial, as2DView, clampPitch, cloneTrial, closeTrial, defineInstrument, detectCapabilities, interstellarTheme, orbitAfterDrag, orbitAfterWheel, reorderTrials, resetTrial, useLabContext, useOrbit, validateConfigSchema, wrapYaw };
|
|
659
|
-
export type { CapabilityFlags, CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, DefaultSidebarProps, DefaultStatusBarProps, DefaultToolbarProps, EffectCardListItem, EffectCardListProps, EffectCardProps, LabContextValue, LabProps, LabShellProps, NumberRowProps, OrbitHandlers, OrbitView, PropertyGroupProps, PropertyListPack, PropertyListProps, PropertyPanelProps, PropertyRowLayout, PropertyRowProps, PropertyRowVariant, SelectRowProps, SidebarSlot, SliderRowProps, StatusBarSlot, SubpanelProps, TextRowProps, ToggleRowProps, ToolbarSlot, TrialChromeProps, TrialProps, TrialSidebarContext, TrialStatusBarContext, TrialToolbarContext, UseOrbitOptions, ValidationResult, Vec3, ViewTransform2D, WorkspaceProps };
|
|
828
|
+
export { Annotations, CheckboxRow, ColorRow, ConfigField, ConfigNode, ConfigOption, ConfigRule, ConfigRuleContext, ConfigSchema, ControlRenderer, CurveField, DEFAULT_VIEW, EffectCard, EffectCardList, InferConfig, Instrument, InstrumentList, JobHandle, Lab, LabContext, LabMode, LabPalette, LabShell, LeafPatch, NodeOptions, NumberRow, PITCH_LIMIT, PropertyGroup, PropertyList, PropertyPanel, PropertyRow, PropertySpan, ResolvedConfig, SavedSnapshot, SelectRow, SliderRow, StorageAdapter, Subpanel, TextRow, ToggleRow, Trial, TrialChrome, TrialContribution, TrialRecord, TrialTool, ViewTransform, Workspace, addTrial, applyRules, as2DView, builtinRules, clampPitch, cloneTrial, closeTrial, defineInstrument, f, fromConfigFields, interstellarTheme, isLeafVisible, orbitAfterDrag, orbitAfterWheel, reorderTrials, resetTrial, resolveConfigSchema, titleCase, useConfigSchema, useLabContext, useOrbit, validateConfigSchema, wrapYaw };
|
|
829
|
+
export type { CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, EffectCardListItem, EffectCardListProps, EffectCardProps, InstrumentSpec, LabContextValue, LabPaletteProps, LabProps, LabShellProps, NumberRowProps, OrbitHandlers, OrbitView, PropertyGroupProps, PropertyListPack, PropertyListProps, PropertyOption, PropertyPanelProps, PropertyRowLayout, PropertyRowProps, PropertyRowVariant, PropertySpanProps, SelectRowProps, SliderRowProps, SubpanelProps, TextRowProps, ToggleRowProps, TrialChromeProps, TrialLayout, TrialProps, UndoBindings, UseOrbitOptions, ValidationResult, Vec3, ViewTransform2D, WorkspaceProps };
|