@weasel-js/labkit 0.1.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/README.md +72 -0
- package/dist/_dts/fitViewToBounds-rWrBI4a6.d.ts +870 -0
- package/dist/_dts/index-C6Yze7sQ.d.ts +93 -0
- package/dist/_dts/types-Si4Fw-1F.d.ts +48 -0
- package/dist/_dts/useExperimentState-eSvpwV_P.d.ts +102 -0
- package/dist/canvas/index.d.ts +34 -0
- package/dist/canvas/index.js +4 -0
- package/dist/canvas/index.js.map +1 -0
- package/dist/chunk-2QNYYL3V.js +86 -0
- package/dist/chunk-2QNYYL3V.js.map +1 -0
- package/dist/chunk-54IQ2DX7.js +222 -0
- package/dist/chunk-54IQ2DX7.js.map +1 -0
- package/dist/chunk-6FO7G5BB.js +6095 -0
- package/dist/chunk-6FO7G5BB.js.map +1 -0
- package/dist/chunk-7BKDG73Z.js +54 -0
- package/dist/chunk-7BKDG73Z.js.map +1 -0
- package/dist/chunk-B5ZUYRKN.js +23330 -0
- package/dist/chunk-B5ZUYRKN.js.map +1 -0
- package/dist/chunk-HXZHVU4G.js +126 -0
- package/dist/chunk-HXZHVU4G.js.map +1 -0
- package/dist/chunk-PWC7AQZM.js +8 -0
- package/dist/chunk-PWC7AQZM.js.map +1 -0
- package/dist/chunk-SD3HDXR7.js +161 -0
- package/dist/chunk-SD3HDXR7.js.map +1 -0
- package/dist/chunk-SSMHPMDV.js +350 -0
- package/dist/chunk-SSMHPMDV.js.map +1 -0
- package/dist/chunk-VLAHRJOC.js +201 -0
- package/dist/chunk-VLAHRJOC.js.map +1 -0
- package/dist/controls/index.d.ts +13 -0
- package/dist/controls/index.js +3 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/dragdrop/index.d.ts +3 -0
- package/dist/dragdrop/index.js +3 -0
- package/dist/dragdrop/index.js.map +1 -0
- package/dist/fonts/oswald-latin-variable.woff2 +0 -0
- package/dist/index.d.ts +410 -0
- package/dist/index.js +1425 -0
- package/dist/index.js.map +1 -0
- package/dist/layers/index.d.ts +17 -0
- package/dist/layers/index.js +3 -0
- package/dist/layers/index.js.map +1 -0
- package/dist/passthrough/weasel-canvas.d.ts +258 -0
- package/dist/passthrough/weasel-canvas.js +3 -0
- package/dist/passthrough/weasel-canvas.js.map +1 -0
- package/dist/passthrough/weasel-ui.d.ts +2826 -0
- package/dist/passthrough/weasel-ui.js +4 -0
- package/dist/passthrough/weasel-ui.js.map +1 -0
- package/dist/primitives/index.d.ts +57 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/state/index.d.ts +33 -0
- package/dist/state/index.js +34 -0
- package/dist/state/index.js.map +1 -0
- package/dist/styles.css +1224 -0
- package/dist/theme-interstellar.css +25 -0
- package/dist/theme-light.css +13 -0
- package/dist/ui/layers/index.d.ts +42 -0
- package/dist/ui/layers/index.js +5 -0
- package/dist/ui/layers/index.js.map +1 -0
- package/dist/undo/index.d.ts +30 -0
- package/dist/undo/index.js +3 -0
- package/dist/undo/index.js.map +1 -0
- package/package.json +99 -0
- package/src/canvas/AGENTS.md +72 -0
- package/src/canvas/CanvasStack.less +22 -0
- package/src/canvas/CanvasStack.stories.tsx +63 -0
- package/src/canvas/CanvasStack.test.tsx +82 -0
- package/src/canvas/CanvasStack.tsx +108 -0
- package/src/canvas/CanvasStackContext.ts +8 -0
- package/src/canvas/canvasCoords.test.ts +30 -0
- package/src/canvas/canvasCoords.ts +15 -0
- package/src/canvas/index.ts +6 -0
- package/src/canvas/useLayerScheduler.ts +72 -0
- package/src/canvas/usePanZoom.ts +98 -0
- package/src/controls/ControlPanel.less +61 -0
- package/src/controls/ControlPanel.stories.tsx +77 -0
- package/src/controls/ControlPanel.test.tsx +149 -0
- package/src/controls/ControlPanel.tsx +249 -0
- package/src/controls/index.ts +12 -0
- package/src/controls/types.ts +61 -0
- package/src/dragdrop/DragDropRuntime.tsx +135 -0
- package/src/dragdrop/DragGhost.less +17 -0
- package/src/dragdrop/DragGhost.tsx +24 -0
- package/src/dragdrop/Palette.less +34 -0
- package/src/dragdrop/Palette.tsx +27 -0
- package/src/dragdrop/dragDrop.test.tsx +145 -0
- package/src/dragdrop/index.ts +1 -0
- package/src/fonts/oswald-latin-variable.woff2 +0 -0
- package/src/index.ts +70 -0
- package/src/instrument/SineWave.smoke.test.tsx +94 -0
- package/src/instrument/capabilityDetector.test.ts +64 -0
- package/src/instrument/capabilityDetector.ts +17 -0
- package/src/instrument/defineInstrument.test.ts +27 -0
- package/src/instrument/defineInstrument.ts +5 -0
- package/src/instrument/index.ts +19 -0
- package/src/instrument/types.ts +65 -0
- package/src/instrument/validateConfigSchema.test.ts +125 -0
- package/src/instrument/validateConfigSchema.ts +65 -0
- package/src/lab/Lab.less +3 -0
- package/src/lab/Lab.stories.tsx +51 -0
- package/src/lab/Lab.test.tsx +126 -0
- package/src/lab/Lab.tsx +196 -0
- package/src/lab/LabContext.test.ts +11 -0
- package/src/lab/LabContext.ts +28 -0
- package/src/lab/LabShell.less +45 -0
- package/src/lab/LabShell.stories.tsx +39 -0
- package/src/lab/LabShell.test.tsx +59 -0
- package/src/lab/LabShell.tsx +33 -0
- package/src/lab/WorkspaceGrid.less +8 -0
- package/src/lab/WorkspaceGrid.stories.tsx +61 -0
- package/src/lab/WorkspaceGrid.test.tsx +40 -0
- package/src/lab/WorkspaceGrid.tsx +20 -0
- package/src/lab/gridDims.test.ts +35 -0
- package/src/lab/gridDims.ts +11 -0
- package/src/lab/index.ts +10 -0
- package/src/layers/AGENTS.md +65 -0
- package/src/layers/LayerList.less +53 -0
- package/src/layers/LayerList.test.tsx +49 -0
- package/src/layers/LayerList.tsx +105 -0
- package/src/layers/index.ts +3 -0
- package/src/passthrough/weasel-canvas.test.ts +30 -0
- package/src/passthrough/weasel-canvas.ts +23 -0
- package/src/passthrough/weasel-ui.test.ts +79 -0
- package/src/passthrough/weasel-ui.ts +150 -0
- package/src/primitives/FpsMeter.less +14 -0
- package/src/primitives/FpsMeter.stories.tsx +14 -0
- package/src/primitives/FpsMeter.test.tsx +38 -0
- package/src/primitives/FpsMeter.tsx +36 -0
- package/src/primitives/ScaleIndicator.less +25 -0
- package/src/primitives/ScaleIndicator.stories.tsx +16 -0
- package/src/primitives/ScaleIndicator.test.tsx +46 -0
- package/src/primitives/ScaleIndicator.tsx +48 -0
- package/src/primitives/Sidebar.less +57 -0
- package/src/primitives/Sidebar.stories.tsx +38 -0
- package/src/primitives/Sidebar.test.tsx +74 -0
- package/src/primitives/Sidebar.tsx +32 -0
- package/src/primitives/StatusBar.less +21 -0
- package/src/primitives/StatusBar.stories.tsx +24 -0
- package/src/primitives/StatusBar.test.tsx +25 -0
- package/src/primitives/StatusBar.tsx +18 -0
- package/src/primitives/Toolbar.less +43 -0
- package/src/primitives/Toolbar.stories.tsx +36 -0
- package/src/primitives/Toolbar.test.tsx +65 -0
- package/src/primitives/Toolbar.tsx +44 -0
- package/src/primitives/fpsAverage.test.ts +21 -0
- package/src/primitives/fpsAverage.ts +5 -0
- package/src/primitives/index.ts +9 -0
- package/src/state/SingletonExperiment.test.tsx +101 -0
- package/src/state/SingletonExperiment.tsx +52 -0
- package/src/state/adapters.test.ts +94 -0
- package/src/state/adapters.ts +102 -0
- package/src/state/context.tsx +42 -0
- package/src/state/helpers.test.ts +89 -0
- package/src/state/helpers.ts +61 -0
- package/src/state/index.ts +40 -0
- package/src/state/store.test.ts +243 -0
- package/src/state/store.ts +225 -0
- package/src/state/types.ts +53 -0
- package/src/state/useExperimentState.test.tsx +102 -0
- package/src/state/useExperimentState.ts +28 -0
- package/src/styles.less +20 -0
- package/src/test-setup.ts +17 -0
- package/src/theme/Interstellar.stories.less +92 -0
- package/src/theme/Interstellar.stories.tsx +243 -0
- package/src/theme/base.less +122 -0
- package/src/theme/interstellar.less +34 -0
- package/src/theme/light.less +14 -0
- package/src/theme/tokens.less +85 -0
- package/src/ui/format.ts +19 -0
- package/src/ui/layers/LayerStack.less +143 -0
- package/src/ui/layers/LayerStack.stories.tsx +45 -0
- package/src/ui/layers/LayerStack.test.tsx +170 -0
- package/src/ui/layers/LayerStack.tsx +215 -0
- package/src/ui/layers/index.ts +1 -0
- package/src/ui/properties/CheckboxRow.stories.tsx +27 -0
- package/src/ui/properties/ColorRow.stories.tsx +106 -0
- package/src/ui/properties/CurveField.less +48 -0
- package/src/ui/properties/CurveField.stories.tsx +20 -0
- package/src/ui/properties/CurveField.test.tsx +127 -0
- package/src/ui/properties/CurveField.tsx +181 -0
- package/src/ui/properties/EffectCard.tsx +312 -0
- package/src/ui/properties/Gallery.stories.tsx +178 -0
- package/src/ui/properties/NumberRow.stories.tsx +65 -0
- package/src/ui/properties/PropertyGroup.less +50 -0
- package/src/ui/properties/PropertyGroup.stories.tsx +34 -0
- package/src/ui/properties/PropertyGroup.test.tsx +33 -0
- package/src/ui/properties/PropertyGroup.tsx +44 -0
- package/src/ui/properties/PropertyList.stories.tsx +83 -0
- package/src/ui/properties/PropertyPanel.less +592 -0
- package/src/ui/properties/PropertyPanel.stories.tsx +191 -0
- package/src/ui/properties/PropertyPanel.test.tsx +193 -0
- package/src/ui/properties/PropertyPanel.tsx +441 -0
- package/src/ui/properties/PropertyRow.stories.tsx +53 -0
- package/src/ui/properties/SelectRow.stories.tsx +58 -0
- package/src/ui/properties/SliderRow.stories.tsx +74 -0
- package/src/ui/properties/SpeechBalloonPanels.stories.tsx +396 -0
- package/src/ui/properties/TextRow.stories.tsx +62 -0
- package/src/ui/properties/ToggleRow.stories.tsx +57 -0
- package/src/ui/properties/index.ts +39 -0
- package/src/ui/properties/storyLayouts.tsx +36 -0
- package/src/undo/eventBus.test.ts +49 -0
- package/src/undo/eventBus.ts +32 -0
- package/src/undo/index.ts +5 -0
- package/src/undo/undoStack.test.ts +70 -0
- package/src/undo/undoStack.ts +38 -0
- package/src/workspace/DefaultSidebar.tsx +26 -0
- package/src/workspace/DefaultStatusBar.tsx +15 -0
- package/src/workspace/DefaultToolbar.tsx +88 -0
- package/src/workspace/Workspace.less +58 -0
- package/src/workspace/Workspace.stories.tsx +78 -0
- package/src/workspace/Workspace.test.tsx +186 -0
- package/src/workspace/Workspace.tsx +255 -0
- package/src/workspace/WorkspaceChrome.tsx +150 -0
- package/src/workspace/index.ts +24 -0
- package/src/workspace/slotTypes.ts +44 -0
- package/src/workspace/workspaceOps.test.ts +142 -0
- package/src/workspace/workspaceOps.ts +78 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
export { CanvasLayerDescriptor, CanvasStack, CanvasStackContext, CanvasStackContextValue, CanvasStackProps, screenToWorld, worldToScreen } from './canvas/index.js';
|
|
2
|
+
export { ControlPanel } from './controls/index.js';
|
|
3
|
+
import { C as ConfigField } from './_dts/types-Si4Fw-1F.js';
|
|
4
|
+
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-Si4Fw-1F.js';
|
|
5
|
+
import { I as Instrument } from './_dts/index-C6Yze7sQ.js';
|
|
6
|
+
export { C as CanvasCapability, a as CanvasLayer, D as DragDropCapability, b as DragFeedback, H as HitResult, L as LayerCapability, c as LayerDescriptor, P as PaletteItem, d as Point, R as RenderContext, S as SystemEvent, U as UndoCapability, V as ViewTransform } from './_dts/index-C6Yze7sQ.js';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
import * as react from 'react';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { S as StorageAdapter, W as WorkspaceRecord, e as SavedSnapshot } from './_dts/useExperimentState-eSvpwV_P.js';
|
|
11
|
+
export { C as CreateLabStoreOptions, E as ExperimentStateHandle, b as LabStoreContext, c as LabStoreProvider, d as LabStoreState, U as UndoStack, f as WorkspaceIdContext, g as WorkspaceIdProvider, i as createMemoryAdapter, l as localStorageAdapter, n as noneAdapter, s as sessionStorageAdapter, u as urlHashAdapter, j as useExperimentState, k as useLabStore, m as useWorkspaceId } from './_dts/useExperimentState-eSvpwV_P.js';
|
|
12
|
+
export { LayerList, LayerListProps } from './layers/index.js';
|
|
13
|
+
export { FpsMeter, ScaleIndicator, ScaleIndicatorProps, Sidebar, SidebarProps, StatusBar, StatusBarProps, Toolbar, ToolbarProps } from './primitives/index.js';
|
|
14
|
+
export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.js';
|
|
15
|
+
export { EventBus, EventListener, clearUndo, createEventBus, emptyStack, pushSnapshot, redo, undo } from './undo/index.js';
|
|
16
|
+
import 'zustand/vanilla';
|
|
17
|
+
|
|
18
|
+
interface CapabilityFlags {
|
|
19
|
+
hasCanvas: boolean;
|
|
20
|
+
hasLayers: boolean;
|
|
21
|
+
hasDragDrop: boolean;
|
|
22
|
+
hasUndo: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function detectCapabilities(instrument: Instrument<unknown, unknown>): CapabilityFlags;
|
|
25
|
+
|
|
26
|
+
declare function defineInstrument<TS, TC>(spec: Instrument<TS, TC>): Instrument<TS, TC>;
|
|
27
|
+
|
|
28
|
+
interface ValidationResult {
|
|
29
|
+
valid: boolean;
|
|
30
|
+
errors: string[];
|
|
31
|
+
}
|
|
32
|
+
declare function validateConfigSchema(fields: ConfigField[]): ValidationResult;
|
|
33
|
+
|
|
34
|
+
interface GridDims {
|
|
35
|
+
cols: number;
|
|
36
|
+
rows: number;
|
|
37
|
+
}
|
|
38
|
+
declare function gridDims(count: number): GridDims;
|
|
39
|
+
|
|
40
|
+
interface LabProps {
|
|
41
|
+
instruments: Instrument[];
|
|
42
|
+
defaultInstrument: string;
|
|
43
|
+
storage?: StorageAdapter | null;
|
|
44
|
+
storageKey?: string;
|
|
45
|
+
theme?: 'auto' | 'light' | 'interstellar';
|
|
46
|
+
/**
|
|
47
|
+
* Optional list of CSS colors used to compose the interstellar theme's
|
|
48
|
+
* cosmic backdrop. Each color becomes one radial-gradient blob on the
|
|
49
|
+
* dark void base. Order maps to a fixed spread of positions; extras wrap
|
|
50
|
+
* around. Ignored unless `theme="interstellar"` is active.
|
|
51
|
+
*/
|
|
52
|
+
nebula?: readonly string[];
|
|
53
|
+
title?: string;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
declare function Lab({ instruments, defaultInstrument, storage, storageKey, theme, nebula, title, children, }: LabProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
interface LabContextValue {
|
|
59
|
+
instruments: Instrument[];
|
|
60
|
+
workspaces: WorkspaceRecord[];
|
|
61
|
+
addWorkspace: (instrumentName: string) => void;
|
|
62
|
+
cloneWorkspace: (id: string) => void;
|
|
63
|
+
closeWorkspace: (id: string) => void;
|
|
64
|
+
resetWorkspace: (id: string) => void;
|
|
65
|
+
savedSnapshots: SavedSnapshot[];
|
|
66
|
+
saveSnapshot: (workspaceId: string, name?: string) => void;
|
|
67
|
+
loadSnapshot: (workspaceId: string, snapshotId: string) => void;
|
|
68
|
+
deleteSnapshot: (snapshotId: string) => void;
|
|
69
|
+
theme: 'auto' | 'light' | 'interstellar';
|
|
70
|
+
setTheme: (t: 'auto' | 'light' | 'interstellar') => void;
|
|
71
|
+
}
|
|
72
|
+
declare const LabContext: react.Context<LabContextValue | null>;
|
|
73
|
+
declare function useLabContext(): LabContextValue;
|
|
74
|
+
|
|
75
|
+
type LabTheme = 'auto' | 'light' | 'interstellar';
|
|
76
|
+
interface LabShellProps {
|
|
77
|
+
title: string;
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
/** Optional content rendered into the header (e.g., action buttons). */
|
|
80
|
+
header?: ReactNode;
|
|
81
|
+
/** Optional content rendered into the footer. */
|
|
82
|
+
footer?: ReactNode;
|
|
83
|
+
/** Theme override. "auto" (default) follows prefers-color-scheme. */
|
|
84
|
+
theme?: LabTheme;
|
|
85
|
+
}
|
|
86
|
+
declare function LabShell({ title, children, header, footer, theme }: LabShellProps): react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
interface WorkspaceGridProps {
|
|
89
|
+
children: ReactNode;
|
|
90
|
+
}
|
|
91
|
+
declare function WorkspaceGrid({ children }: WorkspaceGridProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
93
|
+
type CurveMark = {
|
|
94
|
+
kind: 'band';
|
|
95
|
+
x: [number, number];
|
|
96
|
+
color?: string;
|
|
97
|
+
} | {
|
|
98
|
+
kind: 'line';
|
|
99
|
+
x: number;
|
|
100
|
+
color?: string;
|
|
101
|
+
};
|
|
102
|
+
interface CurveFieldProps {
|
|
103
|
+
/** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs
|
|
104
|
+
* serialize in JSON snapshots. */
|
|
105
|
+
values: number[];
|
|
106
|
+
min: number;
|
|
107
|
+
max: number;
|
|
108
|
+
step: number;
|
|
109
|
+
/** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */
|
|
110
|
+
width: number;
|
|
111
|
+
/** Plot height in CSS px. Default 110. */
|
|
112
|
+
height?: number;
|
|
113
|
+
/** Flat default curve. When provided, a Reset button restores it. */
|
|
114
|
+
defaults?: readonly number[];
|
|
115
|
+
onChange: (next: number[]) => void;
|
|
116
|
+
/** Optional vertical marks overlaid on the plot (e.g. landmarks). */
|
|
117
|
+
marks?: readonly CurveMark[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop
|
|
121
|
+
* numeric readouts and flip buttons. Wraps weasel-ui's
|
|
122
|
+
* `CurveEditor`; consumers wanting the raw editor (2D paths,
|
|
123
|
+
* custom anchors) should import it from `@weasel-js/labkit/weasel-ui`.
|
|
124
|
+
*/
|
|
125
|
+
declare function CurveField({ values, min, max, step, width, height, defaults, onChange, marks, }: CurveFieldProps): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
interface SubpanelProps {
|
|
128
|
+
title: ReactNode;
|
|
129
|
+
children: ReactNode;
|
|
130
|
+
className?: string;
|
|
131
|
+
}
|
|
132
|
+
declare function Subpanel({ title, children, className }: SubpanelProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
interface EffectCardProps {
|
|
134
|
+
/** Card title rendered in the title bar (e.g. effect kind label or a select). */
|
|
135
|
+
title: ReactNode;
|
|
136
|
+
/** Optional badge/chip displayed before the remove button (e.g. primary value summary). */
|
|
137
|
+
primary?: ReactNode;
|
|
138
|
+
/** Optional accent color in any CSS color form. Sets --lk-panel-accent on the card. */
|
|
139
|
+
accent?: string;
|
|
140
|
+
/** Optional ordinal badge that doubles as the drag handle (used by tail cards in SB). */
|
|
141
|
+
index?: number;
|
|
142
|
+
expanded?: boolean;
|
|
143
|
+
onToggleExpanded?: () => void;
|
|
144
|
+
onRemove?: () => void;
|
|
145
|
+
/**
|
|
146
|
+
* Drag-handle wiring. When provided, an inline handle (⋮⋮ icon or `index`)
|
|
147
|
+
* activates HTML5 drag on press. Consumer owns the drag/drop coordination —
|
|
148
|
+
* see EffectCardList for the batteries-included wrapper.
|
|
149
|
+
*/
|
|
150
|
+
draggable?: boolean;
|
|
151
|
+
onPressHandle?: () => void;
|
|
152
|
+
onReleaseHandle?: () => void;
|
|
153
|
+
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
154
|
+
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
155
|
+
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
156
|
+
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
157
|
+
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
158
|
+
dragging?: boolean;
|
|
159
|
+
children?: ReactNode;
|
|
160
|
+
className?: string;
|
|
161
|
+
}
|
|
162
|
+
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;
|
|
163
|
+
interface EffectCardListItem {
|
|
164
|
+
id: string | number;
|
|
165
|
+
}
|
|
166
|
+
interface EffectCardListProps<T extends EffectCardListItem> {
|
|
167
|
+
items: ReadonlyArray<T>;
|
|
168
|
+
renderItem: (item: T, helpers: {
|
|
169
|
+
isExpanded: boolean;
|
|
170
|
+
isDragging: boolean;
|
|
171
|
+
toggleExpanded: () => void;
|
|
172
|
+
cardProps: Pick<EffectCardProps, 'expanded' | 'dragging' | 'draggable' | 'onToggleExpanded' | 'onPressHandle' | 'onReleaseHandle' | 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDragLeave' | 'onDrop'>;
|
|
173
|
+
}) => ReactNode;
|
|
174
|
+
onReorder: (sourceId: T['id'], targetId: T['id'], position: 'before' | 'after') => void;
|
|
175
|
+
/** Optional rendered when the list is empty. */
|
|
176
|
+
empty?: ReactNode;
|
|
177
|
+
/** IDs to render expanded on first mount. Defaults to all collapsed. */
|
|
178
|
+
defaultExpandedIds?: ReadonlyArray<T['id']>;
|
|
179
|
+
}
|
|
180
|
+
declare function EffectCardList<T extends EffectCardListItem>({ items, renderItem, onReorder, empty, defaultExpandedIds, }: EffectCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
181
|
+
|
|
182
|
+
interface PropertyGroupProps {
|
|
183
|
+
/** Title rendered between two rules at the top of the group. */
|
|
184
|
+
title: ReactNode;
|
|
185
|
+
/** When true the group renders nothing — useful for conditional sections. */
|
|
186
|
+
hidden?: boolean;
|
|
187
|
+
children: ReactNode;
|
|
188
|
+
className?: string;
|
|
189
|
+
/**
|
|
190
|
+
* How rows pack into the 2-column grid.
|
|
191
|
+
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
192
|
+
* else spans the full width.
|
|
193
|
+
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
194
|
+
*/
|
|
195
|
+
pack?: 'auto-color' | 'pairs';
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Visually-bordered group inside a PropertyList. Use to scope a set of
|
|
199
|
+
* related rows under a heading (e.g. "Aqua", "Bevel", "Dome" sections
|
|
200
|
+
* inside a fill effect's controls).
|
|
201
|
+
*/
|
|
202
|
+
declare function PropertyGroup({ title, hidden, children, className, pack, }: PropertyGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
203
|
+
|
|
204
|
+
interface PropertyPanelProps {
|
|
205
|
+
title?: ReactNode;
|
|
206
|
+
children: ReactNode;
|
|
207
|
+
className?: string;
|
|
208
|
+
}
|
|
209
|
+
declare function PropertyPanel({ title, children, className }: PropertyPanelProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
type PropertyListPack = 'auto-color' | 'pairs';
|
|
211
|
+
interface PropertyListProps {
|
|
212
|
+
children: ReactNode;
|
|
213
|
+
className?: string;
|
|
214
|
+
/**
|
|
215
|
+
* How rows pack into the 2-column grid.
|
|
216
|
+
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
217
|
+
* else spans the full width. Right for sparse top-level panels.
|
|
218
|
+
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
219
|
+
* Headers, subpanels, and full-width children (`<hr>`, curve blocks)
|
|
220
|
+
* still span via `lk-property-list__span`. Right for dense effect bodies.
|
|
221
|
+
*/
|
|
222
|
+
pack?: PropertyListPack;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Grid container for PropertyRows. Use standalone for chrome-less layouts, or
|
|
226
|
+
* nest inside <PropertyPanel/> for the standard glass card.
|
|
227
|
+
*/
|
|
228
|
+
declare function PropertyList({ children, className, pack }: PropertyListProps): react_jsx_runtime.JSX.Element;
|
|
229
|
+
type PropertyRowVariant = 'default' | 'color' | 'checkbox';
|
|
230
|
+
type PropertyRowLayout = 'block' | 'inline';
|
|
231
|
+
interface PropertyRowProps {
|
|
232
|
+
label: ReactNode;
|
|
233
|
+
/** Right-aligned readout shown next to the label (e.g. current value). */
|
|
234
|
+
readout?: ReactNode;
|
|
235
|
+
variant?: PropertyRowVariant;
|
|
236
|
+
/**
|
|
237
|
+
* Label position relative to the control. "block" (default) stacks
|
|
238
|
+
* label above control; "inline" places the label to the left.
|
|
239
|
+
* Color and checkbox variants are always inline by their own nature.
|
|
240
|
+
*/
|
|
241
|
+
layout?: PropertyRowLayout;
|
|
242
|
+
children: ReactNode;
|
|
243
|
+
htmlFor?: string;
|
|
244
|
+
className?: string;
|
|
245
|
+
}
|
|
246
|
+
declare function PropertyRow({ label, readout, variant, layout, children, htmlFor, className, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
247
|
+
interface SliderRowProps {
|
|
248
|
+
label: ReactNode;
|
|
249
|
+
value: number;
|
|
250
|
+
min: number;
|
|
251
|
+
max: number;
|
|
252
|
+
step?: number;
|
|
253
|
+
onChange: (next: number) => void;
|
|
254
|
+
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
255
|
+
format?: (value: number) => ReactNode;
|
|
256
|
+
/**
|
|
257
|
+
* Optional suffix rendered next to the readout. A string becomes a
|
|
258
|
+
* baseline-aligned dim "word" unit (e.g. "px"); pass JSX like `<sup>°</sup>`
|
|
259
|
+
* to get the browser's native super positioning for symbol units.
|
|
260
|
+
*/
|
|
261
|
+
unit?: ReactNode;
|
|
262
|
+
layout?: PropertyRowLayout;
|
|
263
|
+
}
|
|
264
|
+
declare function SliderRow({ label, value, min, max, step, onChange, format, unit, layout, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
265
|
+
interface ColorRowProps {
|
|
266
|
+
label: ReactNode;
|
|
267
|
+
value: string;
|
|
268
|
+
onChange: (next: string) => void;
|
|
269
|
+
/** 0..1 alpha. When provided, a translucent slider renders beneath the swatch. */
|
|
270
|
+
alpha?: number;
|
|
271
|
+
onAlphaChange?: (next: number) => void;
|
|
272
|
+
/**
|
|
273
|
+
* Render the alpha track as inert (dimmed, no thumb, not-allowed cursor).
|
|
274
|
+
* Use when the color's consumer drops alpha so the affordance reads dead.
|
|
275
|
+
*/
|
|
276
|
+
alphaDisabled?: boolean;
|
|
277
|
+
}
|
|
278
|
+
declare function ColorRow({ label, value, onChange, alpha, onAlphaChange, alphaDisabled, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
279
|
+
interface CheckboxRowProps {
|
|
280
|
+
label: ReactNode;
|
|
281
|
+
value: boolean;
|
|
282
|
+
onChange: (next: boolean) => void;
|
|
283
|
+
}
|
|
284
|
+
declare function CheckboxRow({ label, value, onChange }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
285
|
+
interface TextRowProps {
|
|
286
|
+
label: ReactNode;
|
|
287
|
+
value: string;
|
|
288
|
+
onChange: (next: string) => void;
|
|
289
|
+
placeholder?: string;
|
|
290
|
+
maxLength?: number;
|
|
291
|
+
layout?: PropertyRowLayout;
|
|
292
|
+
}
|
|
293
|
+
declare function TextRow({ label, value, onChange, placeholder, maxLength, layout }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
294
|
+
interface NumberRowProps {
|
|
295
|
+
label: ReactNode;
|
|
296
|
+
value: number;
|
|
297
|
+
onChange: (next: number) => void;
|
|
298
|
+
min?: number;
|
|
299
|
+
max?: number;
|
|
300
|
+
step?: number;
|
|
301
|
+
placeholder?: string;
|
|
302
|
+
layout?: PropertyRowLayout;
|
|
303
|
+
}
|
|
304
|
+
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, layout, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
305
|
+
interface SelectOption<T extends string> {
|
|
306
|
+
value: T;
|
|
307
|
+
label: ReactNode;
|
|
308
|
+
}
|
|
309
|
+
interface SelectRowProps<T extends string> {
|
|
310
|
+
label: ReactNode;
|
|
311
|
+
value: T;
|
|
312
|
+
options: ReadonlyArray<SelectOption<T>>;
|
|
313
|
+
onChange: (next: T) => void;
|
|
314
|
+
layout?: PropertyRowLayout;
|
|
315
|
+
}
|
|
316
|
+
declare function SelectRow<T extends string>({ label, value, options, onChange, layout, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
317
|
+
interface ToggleRowProps<T extends string> {
|
|
318
|
+
label: ReactNode;
|
|
319
|
+
value: T;
|
|
320
|
+
options: ReadonlyArray<SelectOption<T>>;
|
|
321
|
+
onChange: (next: T) => void;
|
|
322
|
+
layout?: PropertyRowLayout;
|
|
323
|
+
}
|
|
324
|
+
declare function ToggleRow<T extends string>({ label, value, options, onChange, layout, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
interface WorkspaceToolbarContext {
|
|
327
|
+
workspaceId: string;
|
|
328
|
+
instrumentName: string;
|
|
329
|
+
hasUndo: boolean;
|
|
330
|
+
canUndo: boolean;
|
|
331
|
+
canRedo: boolean;
|
|
332
|
+
undo: () => void;
|
|
333
|
+
redo: () => void;
|
|
334
|
+
zoom: number;
|
|
335
|
+
setZoom: (z: number) => void;
|
|
336
|
+
zoomIn: () => void;
|
|
337
|
+
zoomOut: () => void;
|
|
338
|
+
resetZoom: () => void;
|
|
339
|
+
hasCanvas: boolean;
|
|
340
|
+
savedSnapshots: SavedSnapshot[];
|
|
341
|
+
saveSnapshot: (name?: string) => void;
|
|
342
|
+
loadSnapshot: (snapshotId: string) => void;
|
|
343
|
+
clone: () => void;
|
|
344
|
+
reset: () => void;
|
|
345
|
+
close: () => void;
|
|
346
|
+
isLastWorkspace: boolean;
|
|
347
|
+
}
|
|
348
|
+
interface WorkspaceSidebarContext {
|
|
349
|
+
workspaceId: string;
|
|
350
|
+
instrumentName: string;
|
|
351
|
+
configFields: ConfigField[];
|
|
352
|
+
config: unknown;
|
|
353
|
+
setConfig: (key: string, value: unknown) => void;
|
|
354
|
+
}
|
|
355
|
+
interface WorkspaceStatusBarContext {
|
|
356
|
+
workspaceId: string;
|
|
357
|
+
instrumentName: string;
|
|
358
|
+
zoom: number;
|
|
359
|
+
}
|
|
360
|
+
type ToolbarSlot = (ctx: WorkspaceToolbarContext) => ReactNode;
|
|
361
|
+
type SidebarSlot = (ctx: WorkspaceSidebarContext) => ReactNode;
|
|
362
|
+
type StatusBarSlot = (ctx: WorkspaceStatusBarContext) => ReactNode;
|
|
363
|
+
|
|
364
|
+
interface DefaultSidebarProps {
|
|
365
|
+
ctx: WorkspaceSidebarContext;
|
|
366
|
+
}
|
|
367
|
+
declare function DefaultSidebar({ ctx }: DefaultSidebarProps): react_jsx_runtime.JSX.Element;
|
|
368
|
+
|
|
369
|
+
interface DefaultStatusBarProps {
|
|
370
|
+
ctx: WorkspaceStatusBarContext;
|
|
371
|
+
}
|
|
372
|
+
declare function DefaultStatusBar({ ctx }: DefaultStatusBarProps): react_jsx_runtime.JSX.Element;
|
|
373
|
+
|
|
374
|
+
interface DefaultToolbarProps {
|
|
375
|
+
ctx: WorkspaceToolbarContext;
|
|
376
|
+
}
|
|
377
|
+
declare function DefaultToolbar({ ctx }: DefaultToolbarProps): react_jsx_runtime.JSX.Element;
|
|
378
|
+
|
|
379
|
+
interface WorkspaceProps {
|
|
380
|
+
id: string;
|
|
381
|
+
}
|
|
382
|
+
declare function Workspace({ id }: WorkspaceProps): react_jsx_runtime.JSX.Element;
|
|
383
|
+
|
|
384
|
+
interface UndoBindings {
|
|
385
|
+
canUndo: boolean;
|
|
386
|
+
canRedo: boolean;
|
|
387
|
+
undo: () => void;
|
|
388
|
+
redo: () => void;
|
|
389
|
+
}
|
|
390
|
+
interface WorkspaceChromeProps {
|
|
391
|
+
workspaceId: string;
|
|
392
|
+
record: WorkspaceRecord;
|
|
393
|
+
instrument: Instrument;
|
|
394
|
+
isLastWorkspace: boolean;
|
|
395
|
+
toolbar?: ToolbarSlot;
|
|
396
|
+
sidebar?: SidebarSlot;
|
|
397
|
+
statusBar?: StatusBarSlot;
|
|
398
|
+
undoBindings?: UndoBindings;
|
|
399
|
+
sidebarExtras?: ReactNode;
|
|
400
|
+
children: ReactNode;
|
|
401
|
+
}
|
|
402
|
+
declare function WorkspaceChrome({ workspaceId, record, instrument, isLastWorkspace, toolbar, sidebar, statusBar, undoBindings, sidebarExtras, children, }: WorkspaceChromeProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
|
|
404
|
+
declare function addWorkspace(workspaces: WorkspaceRecord[], instruments: Instrument[], instrumentName: string): WorkspaceRecord[];
|
|
405
|
+
declare function cloneWorkspace(workspaces: WorkspaceRecord[], id: string): WorkspaceRecord[];
|
|
406
|
+
declare function closeWorkspace(workspaces: WorkspaceRecord[], id: string): WorkspaceRecord[];
|
|
407
|
+
declare function resetWorkspace(workspaces: WorkspaceRecord[], id: string, instruments: Instrument[]): WorkspaceRecord[];
|
|
408
|
+
|
|
409
|
+
export { CheckboxRow, ColorRow, ConfigField, CurveField, DefaultSidebar, DefaultStatusBar, DefaultToolbar, EffectCard, EffectCardList, Instrument, Lab, LabContext, LabShell, NumberRow, PropertyGroup, PropertyList, PropertyPanel, PropertyRow, SavedSnapshot, SelectRow, SliderRow, StorageAdapter, Subpanel, TextRow, ToggleRow, Workspace, WorkspaceChrome, WorkspaceGrid, WorkspaceRecord, addWorkspace, cloneWorkspace, closeWorkspace, defineInstrument, detectCapabilities, gridDims, resetWorkspace, useLabContext, validateConfigSchema };
|
|
410
|
+
export type { CapabilityFlags, CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, DefaultSidebarProps, DefaultStatusBarProps, DefaultToolbarProps, EffectCardListItem, EffectCardListProps, EffectCardProps, GridDims, LabContextValue, LabProps, LabShellProps, LabTheme, NumberRowProps, PropertyGroupProps, PropertyListPack, PropertyListProps, PropertyPanelProps, PropertyRowLayout, PropertyRowProps, PropertyRowVariant, SelectRowProps, SidebarSlot, SliderRowProps, StatusBarSlot, SubpanelProps, TextRowProps, ToggleRowProps, ToolbarSlot, ValidationResult, WorkspaceChromeProps, WorkspaceGridProps, WorkspaceProps, WorkspaceSidebarContext, WorkspaceStatusBarContext, WorkspaceToolbarContext };
|