@weasel-js/labkit 1.3.0-pre.0 → 1.4.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/CanvasStackContext-DtAn_3O-.d.ts +42 -0
- package/dist/_dts/DrawCommand-B3bskUsC.d.ts +564 -0
- package/dist/_dts/{PrefsForm-BYa6cWnO.d.ts → PrefsForm-BkUJZx0A.d.ts} +4 -1
- package/dist/_dts/fitViewToBounds-dZ2UDB6e.d.ts +21 -0
- package/dist/_dts/frac-Cp3NivlC.d.ts +728 -0
- package/dist/_dts/index-BDVzvRzQ.d.ts +236 -0
- package/dist/_dts/shapeKinds-Cx_rxwsa.d.ts +87 -0
- package/dist/_dts/{DrawCommand-DBB45NfN.d.ts → types-C-gh9Ap-.d.ts} +1 -582
- package/dist/_dts/{types-AHlQxBNN.d.ts → types-D6s4b7if.d.ts} +2 -2
- package/dist/_dts/{types-1Sdxy_Pv.d.ts → types-DYMaEvM5.d.ts} +26 -1
- package/dist/_dts/{useTrialState-CsGMjhu9.d.ts → useTrialState-gmMvZqPc.d.ts} +7 -2
- package/dist/canvas/index.d.ts +43 -25
- package/dist/canvas/index.js +5 -3
- package/dist/chrome/index.d.ts +9 -6
- package/dist/chrome/index.js +7 -6
- package/dist/chunk-2AYGEN57.js +32 -0
- package/dist/chunk-2AYGEN57.js.map +1 -0
- package/dist/{chunk-RVNN4CHQ.js → chunk-3P5TTTA7.js} +16 -8
- package/dist/chunk-3P5TTTA7.js.map +1 -0
- package/dist/{chunk-NS54R52R.js → chunk-3ZELRRBV.js} +45 -40
- package/dist/chunk-3ZELRRBV.js.map +1 -0
- package/dist/{chunk-HFDVGF4X.js → chunk-4EY67BKJ.js} +32 -7
- package/dist/chunk-4EY67BKJ.js.map +1 -0
- package/dist/chunk-5TCEVMPI.js +140 -0
- package/dist/chunk-5TCEVMPI.js.map +1 -0
- package/dist/{chunk-O7NVSCLN.js → chunk-6JMU56CU.js} +133 -134
- package/dist/chunk-6JMU56CU.js.map +1 -0
- package/dist/{chunk-CPUJ3QXL.js → chunk-CQLQPQ4P.js} +2 -2
- package/dist/chunk-CQLQPQ4P.js.map +1 -0
- package/dist/chunk-CTRKTLYZ.js +33 -0
- package/dist/chunk-CTRKTLYZ.js.map +1 -0
- package/dist/chunk-EQIB2PGC.js +458 -0
- package/dist/chunk-EQIB2PGC.js.map +1 -0
- package/dist/chunk-HEORBLVT.js +7128 -0
- package/dist/chunk-HEORBLVT.js.map +1 -0
- package/dist/{chunk-V7PRSIRQ.js → chunk-JDDIZSLL.js} +4 -4
- package/dist/chunk-JDDIZSLL.js.map +1 -0
- package/dist/chunk-LITE5YFB.js +669 -0
- package/dist/chunk-LITE5YFB.js.map +1 -0
- package/dist/{chunk-Z6HJ5FEM.js → chunk-ROQDRXKW.js} +732 -315
- package/dist/chunk-ROQDRXKW.js.map +1 -0
- package/dist/chunk-SBXNQW4G.js +3 -0
- package/dist/chunk-SBXNQW4G.js.map +1 -0
- package/dist/{chunk-4TMMVIDM.js → chunk-XJ6N32QP.js} +50 -6
- package/dist/chunk-XJ6N32QP.js.map +1 -0
- package/dist/chunk-YQJNT4XQ.js +293 -0
- package/dist/chunk-YQJNT4XQ.js.map +1 -0
- package/dist/controls/index.d.ts +4 -28
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +50 -5
- package/dist/dragdrop/index.js +3 -1
- package/dist/index.d.ts +660 -302
- package/dist/index.js +1793 -587
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +6 -5
- package/dist/layers/index.js +4 -2
- package/dist/loupe/index.d.ts +187 -0
- package/dist/loupe/index.js +7 -0
- package/dist/loupe/index.js.map +1 -0
- package/dist/passthrough/weasel-canvas.d.ts +3 -1
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +151 -91
- package/dist/passthrough/weasel-ui.js +3 -2
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.js +6 -5
- package/dist/state/index.d.ts +3 -3
- package/dist/state/index.js +2 -2
- package/dist/styles.css +229 -703
- package/dist/surface/index.d.ts +18 -2
- package/dist/surface/index.js +2 -2
- package/dist/ui/layers/index.d.ts +8 -2
- package/dist/ui/layers/index.js +2 -4
- package/dist/undo/index.d.ts +5 -4
- package/package.json +14 -7
- package/src/annotations/AnnotationOverlay.tsx +205 -0
- package/src/annotations/AnnotationTargets.tsx +37 -0
- package/src/annotations/Annotations.less +129 -0
- package/src/annotations/Annotations.meaning.test.tsx +111 -0
- package/src/annotations/Annotations.overlay.test.tsx +142 -0
- package/src/annotations/AnnotationsContext.ts +49 -0
- package/src/annotations/ExportMenu.test.tsx +86 -0
- package/src/annotations/ExportMenu.tsx +182 -0
- package/src/annotations/MarkList.tsx +75 -0
- package/src/annotations/capture.test.ts +140 -0
- package/src/annotations/capture.ts +237 -0
- package/src/annotations/drawOne.test.ts +56 -0
- package/src/annotations/drawOne.ts +47 -0
- package/src/annotations/frac.test.ts +59 -0
- package/src/annotations/frac.ts +66 -0
- package/src/annotations/history.test.ts +82 -0
- package/src/annotations/history.ts +118 -0
- package/src/annotations/index.ts +37 -0
- package/src/annotations/paint.test.ts +125 -0
- package/src/annotations/paint.ts +130 -0
- package/src/annotations/staleness.test.ts +56 -0
- package/src/annotations/staleness.ts +41 -0
- package/src/annotations/store.test.ts +175 -0
- package/src/annotations/store.ts +317 -0
- package/src/annotations/svgNodes.test.ts +77 -0
- package/src/annotations/svgNodes.ts +74 -0
- package/src/annotations/toolMap.test.ts +36 -0
- package/src/annotations/toolMap.ts +54 -0
- package/src/annotations/types.ts +222 -0
- package/src/annotations/view.test.ts +37 -0
- package/src/annotations/view.ts +40 -0
- package/src/canvas/AGENTS.md +55 -5
- package/src/canvas/CanvasStack.test.tsx +27 -1
- package/src/canvas/CanvasStack.tsx +29 -4
- package/src/canvas/CanvasStackContext.ts +23 -4
- package/src/canvas/camera.test.ts +78 -0
- package/src/canvas/camera.ts +62 -0
- package/src/canvas/canvasCoords.test.ts +26 -0
- package/src/canvas/canvasCoords.ts +20 -7
- package/src/canvas/index.ts +5 -1
- package/src/canvas/useLayerScheduler.ts +7 -3
- package/src/canvas/usePanZoom.test.ts +36 -5
- package/src/canvas/usePanZoom.ts +20 -15
- package/src/canvas/worldSpec.test.ts +63 -0
- package/src/canvas/worldSpec.ts +48 -0
- package/src/chrome/builtins.test.ts +31 -1
- package/src/chrome/builtins.tsx +63 -19
- package/src/chrome/regions/PaletteRegion.test.tsx +22 -1
- package/src/chrome/regions/PaletteRegion.tsx +4 -0
- package/src/chrome/regions/SidebarRegion.tsx +37 -13
- package/src/chrome/regions/ToolbarRegion.tsx +2 -1
- package/src/chrome/regions/ViewportRegion.tsx +9 -1
- package/src/chrome/regions/regions.test.tsx +6 -1
- package/src/chrome/types.ts +20 -0
- package/src/config/builder.test.ts +7 -1
- package/src/config/builder.ts +1 -5
- package/src/config/resolve.test.ts +1 -2
- package/src/controls/ControlPanel.stories.tsx +41 -2
- package/src/controls/ControlPanel.test.tsx +69 -9
- package/src/controls/ControlPanel.tsx +106 -25
- package/src/dragdrop/DragDropRuntime.tsx +8 -2
- package/src/dragdrop/dragDrop.test.tsx +29 -2
- package/src/dragdrop/index.ts +11 -0
- package/src/index.test.ts +22 -0
- package/src/index.ts +136 -4
- package/src/instrument/SineWave.smoke.test.tsx +1 -0
- package/src/instrument/types.ts +24 -1
- package/src/lab/Lab.surface.test.tsx +162 -0
- package/src/lab/Lab.tsx +102 -17
- package/src/lab/Lab.undock.test.tsx +85 -0
- package/src/lab/LabFullChrome.stories.tsx +20 -0
- package/src/lab/LabShell.less +11 -0
- package/src/lab/Workspace.less +73 -0
- package/src/lab/Workspace.surface.test.tsx +2 -0
- package/src/lab/Workspace.tsx +97 -8
- package/src/lab/index.ts +1 -1
- package/src/lab/panelHost.ts +37 -0
- package/src/layers/AGENTS.md +1 -1
- package/src/layers/LayerList.tsx +1 -1
- package/src/loupe/AGENTS.md +49 -0
- package/src/loupe/CanvasLoupe.tsx +83 -0
- package/src/loupe/DomLoupe.tsx +62 -0
- package/src/loupe/Loupe.less +38 -0
- package/src/loupe/LoupeBubble.tsx +32 -0
- package/src/loupe/TrialLoupe.tsx +93 -0
- package/src/loupe/canvasLens.test.ts +205 -0
- package/src/loupe/canvasLens.ts +141 -0
- package/src/loupe/index.ts +19 -0
- package/src/loupe/types.test.ts +29 -0
- package/src/loupe/types.ts +90 -0
- package/src/loupe/useHostSize.ts +30 -0
- package/src/loupe/useLoupe.test.tsx +197 -0
- package/src/loupe/useLoupe.ts +189 -0
- package/src/passthrough/weasel-ui.ts +25 -17
- package/src/primitives/FloatingPanel.test.tsx +76 -1
- package/src/primitives/FloatingPanel.tsx +19 -3
- package/src/primitives/ScaleIndicator.test.tsx +7 -2
- package/src/primitives/Sidebar.less +18 -0
- package/src/primitives/Toolbar.less +8 -0
- package/src/primitives/Toolbar.tsx +5 -0
- package/src/primitives/useRovingTabIndex.test.ts +21 -0
- package/src/primitives/useRovingTabIndex.ts +26 -17
- package/src/state/document.test.ts +23 -0
- package/src/state/document.ts +14 -2
- package/src/state/index.ts +2 -0
- package/src/state/store.test.ts +24 -0
- package/src/state/store.ts +35 -1
- package/src/state/types.ts +11 -0
- package/src/state/undock.test.ts +40 -0
- package/src/state/undock.ts +39 -0
- package/src/styles.less +2 -4
- package/src/surface/SurfaceContext.ts +4 -0
- package/src/surface/index.ts +8 -3
- package/src/surface/useSurfaceTile.test.tsx +2 -0
- package/src/surface/useSurfaceTile.ts +7 -1
- package/src/surface/useTiledSurface.test.tsx +58 -0
- package/src/surface/useTiledSurface.ts +38 -3
- package/src/theme/Interstellar.stories.tsx +1 -1
- package/src/trial/Trial.annotations.persist.test.tsx +166 -0
- package/src/trial/Trial.annotations.test.tsx +121 -0
- package/src/trial/Trial.canvas.test.tsx +76 -1
- package/src/trial/Trial.config.test.tsx +3 -8
- package/src/trial/Trial.less +19 -0
- package/src/trial/Trial.loupe.test.tsx +128 -0
- package/src/trial/Trial.stories.tsx +1 -0
- package/src/trial/Trial.test.tsx +12 -0
- package/src/trial/Trial.trialId.test.tsx +36 -0
- package/src/trial/Trial.tsx +215 -40
- package/src/trial/TrialChrome.tsx +35 -0
- package/src/trial/UndockedSections.tsx +65 -0
- package/src/trial/trialOps.test.ts +21 -0
- package/src/trial/trialOps.ts +5 -3
- package/src/ui/layers/index.ts +5 -1
- package/dist/_dts/index-DgcNdEdh.d.ts +0 -314
- package/dist/chunk-4TMMVIDM.js.map +0 -1
- package/dist/chunk-CPUJ3QXL.js.map +0 -1
- package/dist/chunk-HFDVGF4X.js.map +0 -1
- package/dist/chunk-NS54R52R.js.map +0 -1
- package/dist/chunk-O2BULFHX.js +0 -152
- package/dist/chunk-O2BULFHX.js.map +0 -1
- package/dist/chunk-O7NVSCLN.js.map +0 -1
- package/dist/chunk-PO6L3NSH.js +0 -366
- package/dist/chunk-PO6L3NSH.js.map +0 -1
- package/dist/chunk-PQJ5B2U2.js +0 -27
- package/dist/chunk-PQJ5B2U2.js.map +0 -1
- package/dist/chunk-RVNN4CHQ.js.map +0 -1
- package/dist/chunk-TLGRYALP.js +0 -6151
- package/dist/chunk-TLGRYALP.js.map +0 -1
- package/dist/chunk-V7PRSIRQ.js.map +0 -1
- package/dist/chunk-Z6HJ5FEM.js.map +0 -1
- package/dist/chunk-ZZAYVX4X.js +0 -505
- package/dist/chunk-ZZAYVX4X.js.map +0 -1
- package/src/primitives/DragHandleGlyph.tsx +0 -29
- 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 -208
- 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 -606
- 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 -398
- 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,28 +1,650 @@
|
|
|
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 { C as CheckboxRow, a as CheckboxRowProps, b as ColorRow, c as ColorRowProps, d as ControlPanel, N as NumberRow, e as NumberRowProps, P as PropertyList, f as PropertyListPack, g as PropertyListProps, h as PropertyOption, i as PropertyPanel, j as PropertyPanelProps, k as PropertyRow, l as PropertyRowLayout, m as PropertyRowProps, n as PropertyRowVariant, o as PropertySpan, p as PropertySpanProps, S as SelectRow, q as SelectRowProps, r as SliderRow, s as SliderRowProps, T as TextRow, t as TextRowProps, u as ToggleRow, v as ToggleRowProps } from './_dts/index-BDVzvRzQ.js';
|
|
6
|
+
import { N as Node, P as Path } from './_dts/types-C-gh9Ap-.js';
|
|
7
|
+
import { F as FillStyle, S as Stroke, D as DrawCommand, V as View, T as TextStyle } from './_dts/DrawCommand-B3bskUsC.js';
|
|
8
|
+
import { d as WorldRect, A as AnnotationData, e as AnnotationMeaning, M as MarkScene, C as CaptureSource, f as CaptureOptions, g as CaptureResult, h as AnnotationTarget, i as AnnotationsApi, j as AnnotationsCapability, T as TrialTool, k as AnnotationKind, V as ViewTransform, I as Instrument, l as InstrumentList, m as TrialContribution } from './_dts/frac-Cp3NivlC.js';
|
|
9
|
+
export { n as Annotation, o as AnnotationInit, p as AnnotationPatch, q as AnnotationQuery, r as AnnotationStatus, s as AnnotationStoreOptions, t as AnnotationTargetInfo, u as CanvasCapability, v as CanvasLayer, w as CaptureDeps, x as DEFAULT_FRAME, b as DragDropCapability, D as DragFeedback, F as FracPoint, y as FracRect, H as HitResult, z as IconComponent, L as LOUPE_DEFAULTS, B as LayerCapability, E as LayerDescriptor, G as LoupeCapability, J as LoupeDeclaration, K as LoupeRenderArgs, P as PaletteItem, a as Point, R as RenderContext, N as ResolvedLoupe, S as SerializedAnnotations, O as SidebarSection, Q as StatusReadout, U as SystemEvent, X as ToolCapability, Y as ToolItem, Z as ToolbarItem, _ as TrialChromeContext, $ as TrialRegion, a0 as UndoCapability, a1 as ViewportControl, a2 as ViewportSize, W as WorldFrame, c as WorldSpec, a3 as annotationsFromJSON, a4 as applyCamera, a5 as createAnnotationScene, a6 as createAnnotationStore, a7 as fracContains, a8 as fracIntersects, a9 as fracToWorld, aa as resolveFrame, ab as resolveLoupe, ac as roundFrac, ad as worldToFrac } from './_dts/frac-Cp3NivlC.js';
|
|
10
|
+
import { B as BuiltinShapeToolId } from './_dts/shapeKinds-Cx_rxwsa.js';
|
|
11
|
+
export { CanvasStack, CanvasStackProps, ZoomAtOptions, centerOn, screenToWorld, worldToScreen, zoomAt } from './canvas/index.js';
|
|
12
|
+
export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from './_dts/CanvasStackContext-DtAn_3O-.js';
|
|
4
13
|
export { PaletteRegion, PaletteRegionProps, SidebarRegion, SidebarRegionProps, StatusRegion, StatusRegionProps, TitleBarRegion, TitleBarRegionProps, ToolbarRegion, ToolbarRegionProps, ViewportRegion, ViewportRegionProps, builtinContributions, mergeContributions, suppressContributions } from './chrome/index.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { C as ConfigNode, A as Annotations, N as NodeOptions, a as ControlRenderer, b as ConfigOption, c as ConfigSchema, I as InferConfig, d as ConfigField, R as ResolvedConfig, e as ConfigRule, L as LeafPatch, f as ConfigRuleContext } from './_dts/types-AHlQxBNN.js';
|
|
9
|
-
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-AHlQxBNN.js';
|
|
10
|
-
export { ControlPanel } from './controls/index.js';
|
|
14
|
+
import { T as ToolPrefLeaf } from './_dts/PrefsForm-BkUJZx0A.js';
|
|
15
|
+
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-D6s4b7if.js';
|
|
16
|
+
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-D6s4b7if.js';
|
|
11
17
|
import { J as JobHandle } from './_dts/types-DJ79Tg5J.js';
|
|
12
18
|
export { a as JobCapability, b as JobEvent, c as JobFailure, d as JobStatus } from './_dts/types-DJ79Tg5J.js';
|
|
13
19
|
export { UseJobOptions, useJob } from './job/index.js';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
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';
|
|
20
|
+
import { a as StorageAdapter, h as LabMode, T as TrialRecord, c as SavedSnapshot } from './_dts/types-DYMaEvM5.js';
|
|
21
|
+
export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, S as SerializedTrial, d as TrialStateHandle, U as UndoStack, e as UndockedPanel, f as UndockedPanels, g as dockPanel, p as panelKey, u as undockPanel } from './_dts/types-DYMaEvM5.js';
|
|
17
22
|
export { LayerList, LayerListProps } from './layers/index.js';
|
|
23
|
+
export { CanvasLoupe, CanvasLoupeProps, DomLoupe, DomLoupeProps, LensCamera, LoupeBubble, LoupeBubbleProps, LoupeState, SourceRect, TrialLoupe, TrialLoupeProps, UseLoupeOptions, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe } from './loupe/index.js';
|
|
18
24
|
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';
|
|
19
|
-
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-
|
|
20
|
-
export { Box, Rect, SurfaceContext, SurfaceFrame, SurfaceHandle, UseTiledSurfaceOptions, composeRects, rectsEqual, toDeviceRect, useSurface, useSurfaceOptional, useSurfaceTile, useTiledSurface } from './surface/index.js';
|
|
21
|
-
export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.js';
|
|
25
|
+
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-gmMvZqPc.js';
|
|
26
|
+
export { Box, Rect, SurfaceCanvasContext, SurfaceContext, SurfaceFrame, SurfaceHandle, TilePainter, UseTiledSurfaceOptions, composeRects, rectsEqual, toDeviceRect, useSurface, useSurfaceCanvas, useSurfaceOptional, useSurfaceTile, useTiledSurface } from './surface/index.js';
|
|
22
27
|
export { EventBus, EventListener, clearUndo, createEventBus, emptyStack, pushSnapshot, redo, undo } from './undo/index.js';
|
|
23
28
|
import 'windease';
|
|
24
29
|
import 'zustand/vanilla';
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Canonical inline-styling primitive for text nodes. A node's text is
|
|
33
|
+
* either a plain `string` (treated as a single-run, default-styled fragment)
|
|
34
|
+
* or `StyledRun[]` for rich content. `toRuns` is the funnel that normalizes
|
|
35
|
+
* either form into the array shape used by the renderer.
|
|
36
|
+
*
|
|
37
|
+
* Every field except `text` is optional; missing fields fall back to the
|
|
38
|
+
* node-level `TextStyle`. `bold`/`italic` are toggles; richer weight axes
|
|
39
|
+
* (300/500/900) are out of scope for slice 1.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/** A span of text with its own styling, as authored. Fields left absent
|
|
43
|
+
* inherit from the node's text style — this is the difference between a run
|
|
44
|
+
* and a fully resolved one. */
|
|
45
|
+
interface StyledRun {
|
|
46
|
+
text: string;
|
|
47
|
+
bold?: boolean;
|
|
48
|
+
italic?: boolean;
|
|
49
|
+
fontFamily?: string;
|
|
50
|
+
fontSize?: number;
|
|
51
|
+
fill?: FillStyle;
|
|
52
|
+
/** Outline over this run's glyphs. Overrides the node's own `data.stroke`;
|
|
53
|
+
* absent inherits it. Only painted on the outline tier. */
|
|
54
|
+
stroke?: Stroke;
|
|
55
|
+
letterSpacing?: number;
|
|
56
|
+
underline?: boolean;
|
|
57
|
+
strikethrough?: boolean;
|
|
58
|
+
/** Draw a rule above this run's ascent. Additive over the node style. */
|
|
59
|
+
overline?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Set this run as a superscript or subscript — a raised or lowered baseline
|
|
62
|
+
* and a smaller size together, which is the pair `<sup>` and `<sub>` imply.
|
|
63
|
+
*
|
|
64
|
+
* A preset over the two primitives below, not a third mechanism: it supplies
|
|
65
|
+
* a `baselineShift` and a `fontScale`, and naming either of those directly
|
|
66
|
+
* overrides that half while leaving the other alone. The numbers are in
|
|
67
|
+
* {@link SCRIPT_METRICS}.
|
|
68
|
+
*/
|
|
69
|
+
script?: 'super' | 'sub';
|
|
70
|
+
/**
|
|
71
|
+
* Raise (positive) or lower (negative) this run off the line's shared
|
|
72
|
+
* baseline, in ems of the *inherited* font size — so a run's rise does not
|
|
73
|
+
* shrink along with the run when `fontScale` also applies.
|
|
74
|
+
*/
|
|
75
|
+
baselineShift?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Multiplier on the inherited font size. The relative counterpart to
|
|
78
|
+
* `fontSize`, which pins an absolute size and wins over this when both are
|
|
79
|
+
* present.
|
|
80
|
+
*/
|
|
81
|
+
fontScale?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Built-in tool ids that aren't shape tools — the ones with no entry in
|
|
85
|
+
* the `core/shapeKinds` table. */
|
|
86
|
+
declare const NON_SHAPE_BUILTIN_TOOLS: readonly ["select", "rotate", "hand"];
|
|
87
|
+
/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop
|
|
88
|
+
* is supplied. Pass a subset via `defaultTools` to slim the registered set. */
|
|
89
|
+
type BuiltinToolId = (typeof NON_SHAPE_BUILTIN_TOOLS)[number] | BuiltinShapeToolId;
|
|
90
|
+
|
|
91
|
+
/** An annotation drawn over a curve plot: a shaded band across a range of x,
|
|
92
|
+
* or a vertical line at one x. */
|
|
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
|
+
/** Props for `<CurveField>`. */
|
|
103
|
+
interface CurveFieldProps {
|
|
104
|
+
/** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs
|
|
105
|
+
* serialize in JSON snapshots. */
|
|
106
|
+
values: number[];
|
|
107
|
+
min: number;
|
|
108
|
+
max: number;
|
|
109
|
+
step: number;
|
|
110
|
+
/** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */
|
|
111
|
+
width: number;
|
|
112
|
+
/** Plot height in CSS px. Default 110. */
|
|
113
|
+
height?: number;
|
|
114
|
+
/** Flat default curve. When provided, a Reset button restores it. */
|
|
115
|
+
defaults?: readonly number[];
|
|
116
|
+
onChange: (next: number[]) => void;
|
|
117
|
+
/** Optional vertical marks overlaid on the plot (e.g. landmarks). */
|
|
118
|
+
marks?: readonly CurveMark[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop
|
|
122
|
+
* numeric readouts and flip buttons. Wraps weasel-ui's
|
|
123
|
+
* `CurveEditor`; consumers wanting the raw editor (2D paths,
|
|
124
|
+
* custom anchors) should import that instead.
|
|
125
|
+
*/
|
|
126
|
+
declare function CurveField({ values, min, max, step, width, height, defaults, onChange, marks, }: CurveFieldProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
/** Props for `<Subpanel>`. */
|
|
129
|
+
interface SubpanelProps {
|
|
130
|
+
title: ReactNode;
|
|
131
|
+
children: ReactNode;
|
|
132
|
+
className?: string;
|
|
133
|
+
}
|
|
134
|
+
/** A typographic divider inside a property list: a small title flanked by a
|
|
135
|
+
* rule. Purely a heading — use `<PropertyGroup>` for a bordered section. */
|
|
136
|
+
declare function Subpanel({ title, children, className }: SubpanelProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
/** Props for `<EffectCard>`. */
|
|
138
|
+
interface EffectCardProps {
|
|
139
|
+
/** Card title rendered in the title bar (e.g. effect kind label or a select). */
|
|
140
|
+
title: ReactNode;
|
|
141
|
+
/** Optional badge/chip displayed before the remove button (e.g. primary value summary). */
|
|
142
|
+
primary?: ReactNode;
|
|
143
|
+
/** Optional accent color in any CSS color form. Sets --wzl-effect-card-accent on the card. */
|
|
144
|
+
accent?: string;
|
|
145
|
+
/** Optional ordinal badge that doubles as the drag handle (used by tail cards in SB). */
|
|
146
|
+
index?: number;
|
|
147
|
+
expanded?: boolean;
|
|
148
|
+
onToggleExpanded?: () => void;
|
|
149
|
+
onRemove?: () => void;
|
|
150
|
+
/**
|
|
151
|
+
* Drag-handle wiring. When provided, an inline handle (⋮⋮ icon or `index`)
|
|
152
|
+
* activates HTML5 drag on press. Consumer owns the drag/drop coordination —
|
|
153
|
+
* see EffectCardList for the batteries-included wrapper.
|
|
154
|
+
*/
|
|
155
|
+
draggable?: boolean;
|
|
156
|
+
onPressHandle?: () => void;
|
|
157
|
+
onReleaseHandle?: () => void;
|
|
158
|
+
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
159
|
+
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
160
|
+
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
161
|
+
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
162
|
+
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
163
|
+
dragging?: boolean;
|
|
164
|
+
children?: ReactNode;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
/** An accented, collapsible card for one item in a list of like things —
|
|
168
|
+
* effects, layers, tails. The accent color rebinds the theme accent token
|
|
169
|
+
* within the card, so its controls pick it up too. */
|
|
170
|
+
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;
|
|
171
|
+
/** The minimum an item must carry to appear in an `<EffectCardList>`. */
|
|
172
|
+
interface EffectCardListItem {
|
|
173
|
+
id: string | number;
|
|
174
|
+
}
|
|
175
|
+
/** Props for `<EffectCardList>`. */
|
|
176
|
+
interface EffectCardListProps<T extends EffectCardListItem> {
|
|
177
|
+
items: ReadonlyArray<T>;
|
|
178
|
+
renderItem: (item: T, helpers: {
|
|
179
|
+
isExpanded: boolean;
|
|
180
|
+
isDragging: boolean;
|
|
181
|
+
toggleExpanded: () => void;
|
|
182
|
+
cardProps: Pick<EffectCardProps, 'expanded' | 'dragging' | 'draggable' | 'onToggleExpanded' | 'onPressHandle' | 'onReleaseHandle' | 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDragLeave' | 'onDrop'>;
|
|
183
|
+
}) => ReactNode;
|
|
184
|
+
onReorder: (sourceId: T['id'], targetId: T['id'], position: 'before' | 'after') => void;
|
|
185
|
+
/** Optional rendered when the list is empty. */
|
|
186
|
+
empty?: ReactNode;
|
|
187
|
+
/** IDs to render expanded on first mount. Defaults to all collapsed. */
|
|
188
|
+
defaultExpandedIds?: ReadonlyArray<T['id']>;
|
|
189
|
+
}
|
|
190
|
+
/** A drag-reorderable list of `<EffectCard>`s. Owns the expanded and dragging
|
|
191
|
+
* state and hands it back to `renderItem`, so the caller only supplies each
|
|
192
|
+
* card's contents. */
|
|
193
|
+
declare function EffectCardList<T extends EffectCardListItem>({ items, renderItem, onReorder, empty, defaultExpandedIds, }: EffectCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
194
|
+
|
|
195
|
+
/** Props for `<PropertyGroup>`. */
|
|
196
|
+
interface PropertyGroupProps {
|
|
197
|
+
/** Title rendered between two rules at the top of the group. */
|
|
198
|
+
title: ReactNode;
|
|
199
|
+
/** When true the group renders nothing — useful for conditional sections. */
|
|
200
|
+
hidden?: boolean;
|
|
201
|
+
children: ReactNode;
|
|
202
|
+
className?: string;
|
|
203
|
+
/**
|
|
204
|
+
* How rows pack into the 2-column grid.
|
|
205
|
+
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
206
|
+
* else spans the full width.
|
|
207
|
+
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
208
|
+
*/
|
|
209
|
+
pack?: 'auto-color' | 'pairs';
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Visually-bordered group inside a PropertyList. Use to scope a set of
|
|
213
|
+
* related rows under a heading (e.g. "Aqua", "Bevel", "Dome" sections
|
|
214
|
+
* inside a fill effect's controls).
|
|
215
|
+
*/
|
|
216
|
+
declare function PropertyGroup({ title, hidden, children, className, pack, }: PropertyGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
217
|
+
|
|
218
|
+
/** The subset of a mark's scene node this needs: where it is, and what it is. */
|
|
219
|
+
interface PaintableMark {
|
|
220
|
+
pose: WorldRect;
|
|
221
|
+
data: AnnotationData;
|
|
222
|
+
}
|
|
223
|
+
/** How a mark is drawn, as opposed to where. Resolved by the overlay from the
|
|
224
|
+
* instrument's vocabulary and the mark's own staleness. */
|
|
225
|
+
interface MarkStyle {
|
|
226
|
+
/** The status's colour, or the default. */
|
|
227
|
+
color?: string;
|
|
228
|
+
/** A mark whose stored position no longer describes the picture. Drawn
|
|
229
|
+
* dashed rather than hidden: it still describes *something*, and dropping
|
|
230
|
+
* it would lose it. */
|
|
231
|
+
stale?: boolean;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* What one mark draws, in its target's world.
|
|
235
|
+
*
|
|
236
|
+
* Pure: a node and the target's content box in, draw commands out. Geometry
|
|
237
|
+
* that a bounding box cannot describe — a line's ends, a stroke's path — comes
|
|
238
|
+
* from `data.points`, which is in fractions like the bounds.
|
|
239
|
+
*/
|
|
240
|
+
declare function markCommands(m: PaintableMark, content: {
|
|
241
|
+
w: number;
|
|
242
|
+
h: number;
|
|
243
|
+
}, style?: MarkStyle): DrawCommand[];
|
|
244
|
+
|
|
245
|
+
/** What resolving a mark's appearance needs beyond the mark itself. */
|
|
246
|
+
interface MarkDrawOptions {
|
|
247
|
+
/** The target's content box — the world a mark's geometry is in. */
|
|
248
|
+
content: {
|
|
249
|
+
w: number;
|
|
250
|
+
h: number;
|
|
251
|
+
};
|
|
252
|
+
/** The target's `positionDependsOn`, for staleness. */
|
|
253
|
+
positionDependsOn?: readonly string[];
|
|
254
|
+
/** The trial's config at the time of the draw. */
|
|
255
|
+
config: unknown;
|
|
256
|
+
/** The instrument's vocabulary, for a status's colour. */
|
|
257
|
+
meaning?: AnnotationMeaning;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* How one mark is drawn — shared by the pane on screen and by an export.
|
|
261
|
+
*
|
|
262
|
+
* One function rather than two call sites building their own, because an
|
|
263
|
+
* export that resolves a status colour or a stale dash differently from the
|
|
264
|
+
* screen produces a picture nobody was looking at.
|
|
265
|
+
*/
|
|
266
|
+
declare function createMarkDrawOne(opts: MarkDrawOptions): (node: Node<AnnotationData, 'marks', WorldRect>, pose: WorldRect, view: View) => DrawCommand[];
|
|
267
|
+
/** How a mark looks, as opposed to where it is. Separate from the callback
|
|
268
|
+
* above because an SVG export resolves the same appearance without ever
|
|
269
|
+
* building a draw command. */
|
|
270
|
+
declare function resolveMarkStyle(data: AnnotationData, opts: MarkDrawOptions): MarkStyle;
|
|
271
|
+
|
|
272
|
+
/** Which of the two composition routes an export takes. */
|
|
273
|
+
type CapturePlan = 'svg-document' | 'raster-stack';
|
|
274
|
+
/**
|
|
275
|
+
* Vector all the way through, or both sides rasterized and stacked.
|
|
276
|
+
*
|
|
277
|
+
* An SVG base is the only one that nests: the marks serialize beside the
|
|
278
|
+
* artifact's own markup and the whole document rasterizes once at the end. A
|
|
279
|
+
* raster base, or none at all, takes the renderer's own path instead — which
|
|
280
|
+
* is also what draws marks onto transparency for a target that declares no
|
|
281
|
+
* base.
|
|
282
|
+
*/
|
|
283
|
+
declare function capturePlan(base: CaptureSource | undefined, format: 'png' | 'svg'): CapturePlan;
|
|
284
|
+
interface ComposeSvgArgs {
|
|
285
|
+
base?: CaptureSource;
|
|
286
|
+
scene: MarkScene;
|
|
287
|
+
draw: MarkDrawOptions;
|
|
288
|
+
scale: number;
|
|
289
|
+
onWarn?: (message: string) => void;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The base and the marks in one SVG document.
|
|
293
|
+
*
|
|
294
|
+
* The outer `viewBox` is the content box, so marks — which are already in it —
|
|
295
|
+
* need no transform, and `width`/`height` carry the export scale. Both halves
|
|
296
|
+
* nest as child `<svg>` elements, which each establish their own viewport and
|
|
297
|
+
* so keep their own `viewBox` maths out of this function.
|
|
298
|
+
*/
|
|
299
|
+
declare function composeCaptureSvg(args: ComposeSvgArgs): string;
|
|
300
|
+
/** What a capture needs about the target it is exporting. */
|
|
301
|
+
interface CaptureArgs {
|
|
302
|
+
target: string;
|
|
303
|
+
scene: MarkScene;
|
|
304
|
+
draw: MarkDrawOptions;
|
|
305
|
+
base?: () => CaptureSource | Promise<CaptureSource>;
|
|
306
|
+
onWarn?: (message: string) => void;
|
|
307
|
+
}
|
|
308
|
+
/** Export one target's picture with its marks on it. */
|
|
309
|
+
declare function captureTarget(args: CaptureArgs, opts?: CaptureOptions): Promise<CaptureResult>;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Export a target's picture with its marks on it.
|
|
313
|
+
*
|
|
314
|
+
* A panel rather than a button because a mark belongs to a target: with more
|
|
315
|
+
* than one pane, "export" on its own does not say what.
|
|
316
|
+
*
|
|
317
|
+
* Reads the store through the hook the way `<MarkList>` does — the chrome
|
|
318
|
+
* context carries no instrument state and is not the route to it.
|
|
319
|
+
*/
|
|
320
|
+
declare function ExportMenu(): react_jsx_runtime.JSX.Element | null;
|
|
321
|
+
|
|
322
|
+
/** Props for `<MarkList>`. */
|
|
323
|
+
interface MarkListProps {
|
|
324
|
+
/** The instrument's vocabulary. Omitted, rows carry no status control —
|
|
325
|
+
* a host that declared none owns what a mark means. */
|
|
326
|
+
meaning?: AnnotationMeaning;
|
|
327
|
+
/** The live config, for answering staleness. */
|
|
328
|
+
config: unknown;
|
|
329
|
+
}
|
|
330
|
+
/** Every mark on this trial's targets: what it says, and whether it still
|
|
331
|
+
* describes the picture under it.
|
|
332
|
+
*
|
|
333
|
+
* Reads the store through the hook, which re-renders on every mutation — so a
|
|
334
|
+
* mark drawn on a pane appears here without anything wiring the two. */
|
|
335
|
+
declare function MarkList({ meaning, config }: MarkListProps): react_jsx_runtime.JSX.Element;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Whether a stored mark still describes the picture the current config
|
|
339
|
+
* produces. A target names the config keys its positions depend on; labkit
|
|
340
|
+
* snapshots and compares them without knowing what any of them mean.
|
|
341
|
+
*/
|
|
342
|
+
/** The values of `keys` in `config`, for storing beside a new mark. Keys the
|
|
343
|
+
* config does not carry are omitted rather than stored as undefined, so the
|
|
344
|
+
* snapshot says what was known rather than what was asked. */
|
|
345
|
+
declare function seenFrom(config: unknown, keys: readonly string[]): Record<string, unknown>;
|
|
346
|
+
/**
|
|
347
|
+
* Whether the picture moved under the mark.
|
|
348
|
+
*
|
|
349
|
+
* Only keys present in `seen` are compared. A mark filed before its target
|
|
350
|
+
* declared a new dependency must not go stale retroactively: nothing can know
|
|
351
|
+
* what that key was at the time, and guessing would grey out every old mark
|
|
352
|
+
* the first time a target grows a key.
|
|
353
|
+
*/
|
|
354
|
+
declare function isStale(seen: Readonly<Record<string, unknown>> | undefined, config: unknown, keys: readonly string[]): boolean;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Public types for `@weasel-js/svg`. The package exposes a flat,
|
|
358
|
+
* discriminated-union node model (`SvgNode`) that mirrors the SVG element
|
|
359
|
+
* tree but uses weasel-native leaf data (`Path`, `FillStyle`) for geometry and
|
|
360
|
+
* paint.
|
|
361
|
+
*
|
|
362
|
+
* Parsing collapses every `transform="..."` onto its descendants' geometry,
|
|
363
|
+
* so the `SvgNode` tree returned from `parseSvg` never has a non-identity
|
|
364
|
+
* group transform. Consumers may still construct groups with explicit
|
|
365
|
+
* transforms before serializing, in which case the serializer emits a
|
|
366
|
+
* single `matrix(a b c d e f)` on the `<g>`.
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Opaque pass-through bag for namespaced XML content.
|
|
371
|
+
*
|
|
372
|
+
* weasel-svg does not interpret the contents — it only ensures that any
|
|
373
|
+
* attributes or child elements in a *declared* XML namespace round-trip
|
|
374
|
+
* losslessly through parse → serialize. Consumers (e.g. an app-specific
|
|
375
|
+
* bridge layer) hang their domain semantics off this structure.
|
|
376
|
+
*
|
|
377
|
+
* Keyed by namespace prefix (the prefix is a write-time choice; the URI
|
|
378
|
+
* is the canonical identifier and is supplied via `ParseOptions.namespaces`
|
|
379
|
+
* / `SerializeOptions.namespaces`).
|
|
380
|
+
*/
|
|
381
|
+
interface NamespaceMeta {
|
|
382
|
+
[prefix: string]: {
|
|
383
|
+
/** Local-name → string-value map for attributes in this namespace. */
|
|
384
|
+
attrs?: Record<string, string>;
|
|
385
|
+
/**
|
|
386
|
+
* Child elements in this namespace, keyed by local name. Each entry
|
|
387
|
+
* is an array because a namespace can host multiple sibling elements
|
|
388
|
+
* with the same tag (e.g. `<wd:layer/><wd:layer/>`).
|
|
389
|
+
*/
|
|
390
|
+
elements?: Record<string, NamespacedElement[]>;
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
/** Opaque structured representation of a namespaced element. */
|
|
394
|
+
interface NamespacedElement {
|
|
395
|
+
/** Attribute local-name → string-value. */
|
|
396
|
+
attrs: Record<string, string>;
|
|
397
|
+
/** Text content, when the element contains only text (no child elements). */
|
|
398
|
+
text?: string;
|
|
399
|
+
/** Nested namespaced children, keyed by local name (recursive). */
|
|
400
|
+
children?: Record<string, NamespacedElement[]>;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* 2x3 affine matrix in column-major form (SVG's `matrix(a b c d e f)`
|
|
404
|
+
* order). Maps `[x', y'] = [a*x + c*y + e, b*x + d*y + f]`.
|
|
405
|
+
*/
|
|
406
|
+
type Matrix = readonly [number, number, number, number, number, number];
|
|
407
|
+
/**
|
|
408
|
+
* FillStyle description in the SVG sense — either explicit `none`, a solid
|
|
409
|
+
* color, or a reference to a weasel-native gradient `FillStyle`. Solid colors
|
|
410
|
+
* are normalized to `#rrggbb` strings; opacity is carried separately so
|
|
411
|
+
* `fill-opacity` and `stroke-opacity` round-trip cleanly.
|
|
412
|
+
*/
|
|
413
|
+
type SvgPaint = {
|
|
414
|
+
kind: 'none';
|
|
415
|
+
} | {
|
|
416
|
+
kind: 'solid';
|
|
417
|
+
color: string;
|
|
418
|
+
opacity?: number;
|
|
419
|
+
} | {
|
|
420
|
+
kind: 'gradient';
|
|
421
|
+
paint: FillStyle;
|
|
422
|
+
};
|
|
423
|
+
/** Stroke description: a paint plus structural line parameters. */
|
|
424
|
+
interface SvgStroke {
|
|
425
|
+
paint: SvgPaint;
|
|
426
|
+
width: number;
|
|
427
|
+
opacity?: number;
|
|
428
|
+
/** `stroke-linecap`. Default per SVG spec is `'butt'`. */
|
|
429
|
+
cap?: 'butt' | 'round' | 'square';
|
|
430
|
+
/** `stroke-linejoin`. Default per SVG spec is `'miter'`. SVG's `arcs` / `miter-clip` map to `'miter'` with a warning. */
|
|
431
|
+
join?: 'miter' | 'round' | 'bevel';
|
|
432
|
+
/** `stroke-dasharray` as a flat number array. Odd-length inputs are doubled per SVG spec. */
|
|
433
|
+
dash?: number[];
|
|
434
|
+
/**
|
|
435
|
+
* `stroke-miterlimit`. SVG's default is 4. Weasel's renderer defaults to
|
|
436
|
+
* 10 (Canvas2D) when unset, so parsed strokes without an explicit
|
|
437
|
+
* attribute may render with longer miters than the source SVG intended.
|
|
438
|
+
*/
|
|
439
|
+
miterLimit?: number;
|
|
440
|
+
/** `marker-start` / `marker-mid` / `marker-end`, as the bare `url(#id)` key. */
|
|
441
|
+
markerStart?: string;
|
|
442
|
+
markerMid?: string;
|
|
443
|
+
markerEnd?: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Leaf node: a path geometry plus fill/stroke. All other v1 shapes
|
|
447
|
+
* (`<rect>`, `<ellipse>`, etc.) are lowered to this representation on
|
|
448
|
+
* parse — `<rect>` uses weasel's `RectPath` fast-path subtype when
|
|
449
|
+
* possible, everything else becomes a `PolygonPath`.
|
|
450
|
+
*/
|
|
451
|
+
interface SvgPathNode {
|
|
452
|
+
kind: 'path';
|
|
453
|
+
path: Path;
|
|
454
|
+
fill: SvgPaint;
|
|
455
|
+
stroke?: SvgStroke;
|
|
456
|
+
/** Element-level opacity (`opacity="..."`), 0..1. */
|
|
457
|
+
opacity?: number;
|
|
458
|
+
/** Element-level rotation in **radians**, pivoting around the AABB
|
|
459
|
+
* center of the underlying `path` geometry. Emitted as SVG
|
|
460
|
+
* `transform="rotate(angleDegrees cx cy)"`. */
|
|
461
|
+
rotation?: number;
|
|
462
|
+
/** Opaque per-element bag for declared namespaces. See `NamespaceMeta`. */
|
|
463
|
+
meta?: NamespaceMeta;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Group node: an SVG `<g>`. On parse, `transform` is always omitted (any
|
|
467
|
+
* `transform` attribute is collapsed onto descendants' geometry). On
|
|
468
|
+
* serialize, a non-identity `transform` is emitted as
|
|
469
|
+
* `matrix(a b c d e f)`.
|
|
470
|
+
*/
|
|
471
|
+
interface SvgGroupNode {
|
|
472
|
+
kind: 'group';
|
|
473
|
+
children: SvgNode[];
|
|
474
|
+
transform?: Matrix;
|
|
475
|
+
opacity?: number;
|
|
476
|
+
/** Opaque per-element bag for declared namespaces. See `NamespaceMeta`. */
|
|
477
|
+
meta?: NamespaceMeta;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Text leaf node. Mirrors the kit's `TextPose` shape — a bounding box plus
|
|
481
|
+
* text content, optional rich-text `runs` (per-range styling), and an
|
|
482
|
+
* optional `TextStyle` for the node-wide defaults.
|
|
483
|
+
*
|
|
484
|
+
* Note on SVG text geometry: native `<text>` flows from a baseline; it
|
|
485
|
+
* doesn't have width/height attributes. The serializer emits
|
|
486
|
+
* `dominant-baseline="text-before-edge"` so `y` is the top of the text
|
|
487
|
+
* box, plus `data-weasel-width` / `data-weasel-height` so weasel's
|
|
488
|
+
* explicit box dimensions round-trip losslessly. External SVG text
|
|
489
|
+
* (lacking the data-* attrs) imports with estimated dimensions —
|
|
490
|
+
* {@link UNBOUNDED_TEXT_WIDTH} and
|
|
491
|
+
* `height = fontSize * lineHeight * (lineCount || 1)`.
|
|
492
|
+
*/
|
|
493
|
+
interface SvgTextNode {
|
|
494
|
+
kind: 'text';
|
|
495
|
+
x: number;
|
|
496
|
+
y: number;
|
|
497
|
+
width: number;
|
|
498
|
+
height: number;
|
|
499
|
+
/** Plain text. When `runs` is set, `runsToPlainText(runs)` must equal `text`. */
|
|
500
|
+
text: string;
|
|
501
|
+
/** Optional per-range styling — same shape as `TextPose.runs`. */
|
|
502
|
+
runs?: StyledRun[];
|
|
503
|
+
/** Node-wide typography. Defaults applied at render time via `resolveTextStyle`. */
|
|
504
|
+
style?: TextStyle;
|
|
505
|
+
/**
|
|
506
|
+
* Node-wide glyph paint, the `FillStyle` / `Stroke` a kit text node holds
|
|
507
|
+
* in `data.fill` / `data.stroke`. Not `SvgPaint`, which is the path
|
|
508
|
+
* nodes' shape — a text paint reaches the renderer through the runs, and
|
|
509
|
+
* `StyledRun.fill` / `.stroke` override these per range.
|
|
510
|
+
*/
|
|
511
|
+
fill?: FillStyle;
|
|
512
|
+
stroke?: Stroke;
|
|
513
|
+
/** Element-level opacity (`opacity="..."`), 0..1. */
|
|
514
|
+
opacity?: number;
|
|
515
|
+
/** Element-level rotation in **radians**, pivoting around the unrotated
|
|
516
|
+
* AABB center `(x + width/2, y + height/2)`. Emitted as SVG
|
|
517
|
+
* `transform="rotate(angleDegrees cx cy)"`. */
|
|
518
|
+
rotation?: number;
|
|
519
|
+
/** Opaque per-element bag for declared namespaces. See `NamespaceMeta`. */
|
|
520
|
+
meta?: NamespaceMeta;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Raster-image leaf — an SVG `<image>`. `href` is the element's `href` (or
|
|
524
|
+
* legacy `xlink:href`) verbatim: an external URL or a `data:` URI. The
|
|
525
|
+
* package neither fetches nor decodes it, so an external URL round-trips as
|
|
526
|
+
* a reference and only resolves when something downstream loads it.
|
|
527
|
+
*
|
|
528
|
+
* SVG's `preserveAspectRatio` is not modeled; the box is taken literally.
|
|
529
|
+
*/
|
|
530
|
+
interface SvgImageNode {
|
|
531
|
+
kind: 'image';
|
|
532
|
+
href: string;
|
|
533
|
+
x: number;
|
|
534
|
+
y: number;
|
|
535
|
+
width: number;
|
|
536
|
+
height: number;
|
|
537
|
+
/** Element-level opacity (`opacity="..."`), 0..1. */
|
|
538
|
+
opacity?: number;
|
|
539
|
+
/** Element-level rotation in **radians**, pivoting around the unrotated
|
|
540
|
+
* AABB center `(x + width/2, y + height/2)`. Emitted as SVG
|
|
541
|
+
* `transform="rotate(angleDegrees cx cy)"`. */
|
|
542
|
+
rotation?: number;
|
|
543
|
+
/** Opaque per-element bag for declared namespaces. See `NamespaceMeta`. */
|
|
544
|
+
meta?: NamespaceMeta;
|
|
545
|
+
}
|
|
546
|
+
/** Discriminated-union node — the leaf of the public tree. */
|
|
547
|
+
type SvgNode = SvgPathNode | SvgGroupNode | SvgTextNode | SvgImageNode;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* One mark as SVG nodes, converted from the very commands the pane paints.
|
|
551
|
+
*
|
|
552
|
+
* Deliberately not a second switch over `data.kind`: geometry has one source,
|
|
553
|
+
* and this is a translation of it. `serializeSvg` turns the result into a
|
|
554
|
+
* document.
|
|
555
|
+
*/
|
|
556
|
+
declare function markSvgNodes(m: PaintableMark, content: {
|
|
557
|
+
w: number;
|
|
558
|
+
h: number;
|
|
559
|
+
}, style?: MarkStyle): SvgNode[];
|
|
560
|
+
|
|
561
|
+
/** Props for `<AnnotationOverlay>`. */
|
|
562
|
+
interface AnnotationOverlayProps {
|
|
563
|
+
target: AnnotationTarget;
|
|
564
|
+
/** The trial's mark scene — shared by every target; a mark's own `target`
|
|
565
|
+
* field is what separates them. */
|
|
566
|
+
scene: MarkScene;
|
|
567
|
+
/** Snapshotted onto each new mark, so staleness can be answered later. */
|
|
568
|
+
config: unknown;
|
|
569
|
+
/** The trial's resolved tool slot. */
|
|
570
|
+
activeToolId: string | null;
|
|
571
|
+
/** The instrument's vocabulary, for a status's colour. */
|
|
572
|
+
meaning?: AnnotationMeaning;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* One target's drawing surface: a transparent box over the target's element
|
|
576
|
+
* taking the input, and a `<SceneCanvas>` painting into the lab's shared
|
|
577
|
+
* buffer at that box's rect.
|
|
578
|
+
*
|
|
579
|
+
* The box is portalled into the surface container because that is what tile
|
|
580
|
+
* rects are measured against; positioning it among the instrument's own DOM
|
|
581
|
+
* would put it in whatever positioning context happened to be there.
|
|
582
|
+
*/
|
|
583
|
+
declare function AnnotationOverlay({ target, scene, config, activeToolId, meaning, }: AnnotationOverlayProps): react.ReactPortal | null;
|
|
584
|
+
|
|
585
|
+
/** Null in a trial whose instrument declares no `annotations`. */
|
|
586
|
+
declare const AnnotationsContext: react.Context<AnnotationsApi | null>;
|
|
587
|
+
/** The marks on this trial's targets. Reached through a hook rather than the
|
|
588
|
+
* chrome context, which carries no instrument state — a sidebar panel listing
|
|
589
|
+
* marks pulls it the way `useTrialState()` does. Throws outside a trial whose
|
|
590
|
+
* instrument declares the capability. */
|
|
591
|
+
declare function useAnnotations(): AnnotationsApi;
|
|
592
|
+
/** The marks on this trial's targets, or null. For chrome that renders in
|
|
593
|
+
* every trial and does something else where there are none. */
|
|
594
|
+
declare function useAnnotationsOptional(): AnnotationsApi | null;
|
|
595
|
+
|
|
596
|
+
/** Props for `<AnnotationTargets>`. */
|
|
597
|
+
interface AnnotationTargetsProps {
|
|
598
|
+
capability: AnnotationsCapability;
|
|
599
|
+
state: unknown;
|
|
600
|
+
config: unknown;
|
|
601
|
+
annotations: AnnotationsApi;
|
|
602
|
+
activeToolId: string | null;
|
|
603
|
+
}
|
|
604
|
+
/** One overlay per region the instrument said accepts marks. */
|
|
605
|
+
declare function AnnotationTargets({ capability, state, config, annotations, activeToolId, }: AnnotationTargetsProps): react_jsx_runtime.JSX.Element;
|
|
606
|
+
|
|
607
|
+
/** Which weasel tool an annotation tool drives, and what kind of mark that
|
|
608
|
+
* makes. `select` makes none. */
|
|
609
|
+
interface AnnotationToolInfo {
|
|
610
|
+
weaselTool: BuiltinToolId;
|
|
611
|
+
kind?: AnnotationKind;
|
|
612
|
+
}
|
|
613
|
+
/** The palette an instrument gets for declaring `annotations`. Ids share the
|
|
614
|
+
* trial's contribution namespace with `instrument.tools`, and one tool slot
|
|
615
|
+
* holds whichever is active. */
|
|
616
|
+
declare const ANNOTATION_TOOLS: readonly TrialTool[];
|
|
617
|
+
/** What `id` drives, or undefined for a tool that is not one of these. */
|
|
618
|
+
declare function annotationToolInfo(id: string | null): AnnotationToolInfo | undefined;
|
|
619
|
+
/** Every weasel tool the overlay has to mount for this palette to work. */
|
|
620
|
+
declare const ANNOTATION_WEASEL_TOOLS: readonly BuiltinToolId[];
|
|
621
|
+
|
|
622
|
+
/** A target's world in CSS pixels: the box its fractions are fractions of. */
|
|
623
|
+
interface ContentSize {
|
|
624
|
+
w: number;
|
|
625
|
+
h: number;
|
|
626
|
+
}
|
|
627
|
+
/** A target's drawn box on the surface, in CSS pixels. */
|
|
628
|
+
interface PaneSize {
|
|
629
|
+
w: number;
|
|
630
|
+
h: number;
|
|
631
|
+
}
|
|
632
|
+
/** labkit's camera in weasel's shape. Zoom is uniform, so it lands on both
|
|
633
|
+
* scale axes; pan is weasel's translation unchanged. */
|
|
634
|
+
declare function toWeaselView(v: ViewTransform): View;
|
|
635
|
+
/** The inverse. A weasel view with unequal axis scales collapses to its x —
|
|
636
|
+
* labkit's camera has one zoom and cannot hold the other. */
|
|
637
|
+
declare function fromWeaselView(v: View): ViewTransform;
|
|
638
|
+
/**
|
|
639
|
+
* The camera a target with none of its own draws through: its content box
|
|
640
|
+
* scaled to fit the box it is drawn in, anchored at the origin.
|
|
641
|
+
*
|
|
642
|
+
* The spec calls the camera "a plain scale" at zoom 1; zoom 1 is only right
|
|
643
|
+
* when the pane happens to be the content's size, and a mark drawn on a
|
|
644
|
+
* scaled-down pane otherwise lands outside it.
|
|
645
|
+
*/
|
|
646
|
+
declare function fitView(content: ContentSize, pane: PaneSize): ViewTransform;
|
|
647
|
+
|
|
26
648
|
/** A point in the space the instrument works in. */
|
|
27
649
|
interface Vec3 {
|
|
28
650
|
x: number;
|
|
@@ -388,6 +1010,11 @@ interface WorkspaceProps {
|
|
|
388
1010
|
onLayoutChange?: (layout: TrialLayout) => void;
|
|
389
1011
|
gap?: number;
|
|
390
1012
|
padding?: number;
|
|
1013
|
+
/** Undocked sidebar panels to render alongside the trials. A `'tile'` panel
|
|
1014
|
+
* joins the grid as a peer of the trials; a `'floating'` one goes into the
|
|
1015
|
+
* floating zone above it. The body is portalled in by the trial that owns
|
|
1016
|
+
* it, so all this renders is the frame and the host. */
|
|
1017
|
+
panels?: readonly PanelDescriptor[];
|
|
391
1018
|
/**
|
|
392
1019
|
* Fixed tiling extent. Omit in an app — the grid measures its own box. Supply
|
|
393
1020
|
* it where nothing measures, notably jsdom: at a zero measurement the grid
|
|
@@ -398,14 +1025,14 @@ interface WorkspaceProps {
|
|
|
398
1025
|
h: number;
|
|
399
1026
|
};
|
|
400
1027
|
}
|
|
401
|
-
/**
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
declare function Workspace({ children, ids, resizable, reorderable, onReorder, layout, onLayoutChange, gap, padding, viewport, }: WorkspaceProps): react_jsx_runtime.JSX.Element;
|
|
1028
|
+
/** One undocked panel, as the workspace needs to know it. */
|
|
1029
|
+
interface PanelDescriptor {
|
|
1030
|
+
/** Stable key; also the portal host key the owning trial writes into. */
|
|
1031
|
+
key: string;
|
|
1032
|
+
title: string;
|
|
1033
|
+
as: 'tile' | 'floating';
|
|
1034
|
+
}
|
|
1035
|
+
declare function Workspace({ children, ids, panels, resizable, reorderable, onReorder, layout, onLayoutChange, gap, padding, viewport, }: WorkspaceProps): react_jsx_runtime.JSX.Element;
|
|
409
1036
|
|
|
410
1037
|
/** The 2D view labkit has always shipped, and what a trial gets when it names no
|
|
411
1038
|
* other. Re-exported under its own name so a consumer can say which it means. */
|
|
@@ -466,6 +1093,11 @@ interface TrialProps {
|
|
|
466
1093
|
* instrument, and mounts the instrument inside the trial chrome. */
|
|
467
1094
|
declare function Trial({ id, chrome, suppress }: TrialProps): react_jsx_runtime.JSX.Element;
|
|
468
1095
|
|
|
1096
|
+
/** The trial's loupe as its chrome sees it: a switch and its position. */
|
|
1097
|
+
interface LoupeBindings {
|
|
1098
|
+
on: boolean;
|
|
1099
|
+
toggle: () => void;
|
|
1100
|
+
}
|
|
469
1101
|
interface UndoBindings {
|
|
470
1102
|
canUndo: boolean;
|
|
471
1103
|
canRedo: boolean;
|
|
@@ -481,6 +1113,9 @@ interface TrialChromeProps {
|
|
|
481
1113
|
undoBindings?: UndoBindings;
|
|
482
1114
|
/** Supplied when the instrument declares a `job`. */
|
|
483
1115
|
job?: JobHandle;
|
|
1116
|
+
/** Supplied when the instrument declares a `loupe`. The lens itself is the
|
|
1117
|
+
* trial's to mount; the chrome only offers the switch. */
|
|
1118
|
+
loupe?: LoupeBindings;
|
|
484
1119
|
/** Contributions the trial runtime itself adds — the drag palette and the
|
|
485
1120
|
* layer list, which depend on runtime state the instrument cannot reach. */
|
|
486
1121
|
trialChrome?: readonly TrialContribution[];
|
|
@@ -497,7 +1132,7 @@ interface TrialChromeProps {
|
|
|
497
1132
|
/** The frame around a running instrument. Builds one chrome context, assembles
|
|
498
1133
|
* the contributions the instrument, the runtime and the lab declare, and hands
|
|
499
1134
|
* each region its slice. */
|
|
500
|
-
declare function TrialChrome({ trialId, record, instrument, isLastTrial, undoBindings, job, trialChrome, chrome, suppress, activeToolId, setActiveTool, children, }: TrialChromeProps): react_jsx_runtime.JSX.Element;
|
|
1135
|
+
declare function TrialChrome({ trialId, record, instrument, isLastTrial, undoBindings, job, loupe, trialChrome, chrome, suppress, activeToolId, setActiveTool, children, }: TrialChromeProps): react_jsx_runtime.JSX.Element;
|
|
501
1136
|
|
|
502
1137
|
/** Append a new trial running `instrumentName`, at that instrument's
|
|
503
1138
|
* default config and initial state. */
|
|
@@ -518,282 +1153,5 @@ declare function resetTrial(trials: TrialRecord[], id: string, instruments: Inst
|
|
|
518
1153
|
*/
|
|
519
1154
|
declare function reorderTrials(trials: TrialRecord[], ids: readonly string[]): TrialRecord[];
|
|
520
1155
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
type CurveMark = {
|
|
524
|
-
kind: 'band';
|
|
525
|
-
x: [number, number];
|
|
526
|
-
color?: string;
|
|
527
|
-
} | {
|
|
528
|
-
kind: 'line';
|
|
529
|
-
x: number;
|
|
530
|
-
color?: string;
|
|
531
|
-
};
|
|
532
|
-
/** Props for `<CurveField>`. */
|
|
533
|
-
interface CurveFieldProps {
|
|
534
|
-
/** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs
|
|
535
|
-
* serialize in JSON snapshots. */
|
|
536
|
-
values: number[];
|
|
537
|
-
min: number;
|
|
538
|
-
max: number;
|
|
539
|
-
step: number;
|
|
540
|
-
/** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */
|
|
541
|
-
width: number;
|
|
542
|
-
/** Plot height in CSS px. Default 110. */
|
|
543
|
-
height?: number;
|
|
544
|
-
/** Flat default curve. When provided, a Reset button restores it. */
|
|
545
|
-
defaults?: readonly number[];
|
|
546
|
-
onChange: (next: number[]) => void;
|
|
547
|
-
/** Optional vertical marks overlaid on the plot (e.g. landmarks). */
|
|
548
|
-
marks?: readonly CurveMark[];
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop
|
|
552
|
-
* numeric readouts and flip buttons. Wraps weasel-ui's
|
|
553
|
-
* `CurveEditor`; consumers wanting the raw editor (2D paths,
|
|
554
|
-
* custom anchors) should import it from `@weasel-js/labkit/weasel-ui`.
|
|
555
|
-
*/
|
|
556
|
-
declare function CurveField({ values, min, max, step, width, height, defaults, onChange, marks, }: CurveFieldProps): react_jsx_runtime.JSX.Element;
|
|
557
|
-
|
|
558
|
-
/** Props for `<Subpanel>`. */
|
|
559
|
-
interface SubpanelProps {
|
|
560
|
-
title: ReactNode;
|
|
561
|
-
children: ReactNode;
|
|
562
|
-
className?: string;
|
|
563
|
-
}
|
|
564
|
-
/** A typographic divider inside a property list: a small title flanked by a
|
|
565
|
-
* rule. Purely a heading — use `<PropertyGroup>` for a bordered section. */
|
|
566
|
-
declare function Subpanel({ title, children, className }: SubpanelProps): react_jsx_runtime.JSX.Element;
|
|
567
|
-
/** Props for `<EffectCard>`. */
|
|
568
|
-
interface EffectCardProps {
|
|
569
|
-
/** Card title rendered in the title bar (e.g. effect kind label or a select). */
|
|
570
|
-
title: ReactNode;
|
|
571
|
-
/** Optional badge/chip displayed before the remove button (e.g. primary value summary). */
|
|
572
|
-
primary?: ReactNode;
|
|
573
|
-
/** Optional accent color in any CSS color form. Sets --lk-panel-accent on the card. */
|
|
574
|
-
accent?: string;
|
|
575
|
-
/** Optional ordinal badge that doubles as the drag handle (used by tail cards in SB). */
|
|
576
|
-
index?: number;
|
|
577
|
-
expanded?: boolean;
|
|
578
|
-
onToggleExpanded?: () => void;
|
|
579
|
-
onRemove?: () => void;
|
|
580
|
-
/**
|
|
581
|
-
* Drag-handle wiring. When provided, an inline handle (⋮⋮ icon or `index`)
|
|
582
|
-
* activates HTML5 drag on press. Consumer owns the drag/drop coordination —
|
|
583
|
-
* see EffectCardList for the batteries-included wrapper.
|
|
584
|
-
*/
|
|
585
|
-
draggable?: boolean;
|
|
586
|
-
onPressHandle?: () => void;
|
|
587
|
-
onReleaseHandle?: () => void;
|
|
588
|
-
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
589
|
-
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
590
|
-
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
591
|
-
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
592
|
-
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
593
|
-
dragging?: boolean;
|
|
594
|
-
children?: ReactNode;
|
|
595
|
-
className?: string;
|
|
596
|
-
}
|
|
597
|
-
/** An accented, collapsible card for one item in a list of like things —
|
|
598
|
-
* effects, layers, tails. The accent color rebinds the theme accent token
|
|
599
|
-
* within the card, so its controls pick it up too. */
|
|
600
|
-
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;
|
|
601
|
-
/** The minimum an item must carry to appear in an `<EffectCardList>`. */
|
|
602
|
-
interface EffectCardListItem {
|
|
603
|
-
id: string | number;
|
|
604
|
-
}
|
|
605
|
-
/** Props for `<EffectCardList>`. */
|
|
606
|
-
interface EffectCardListProps<T extends EffectCardListItem> {
|
|
607
|
-
items: ReadonlyArray<T>;
|
|
608
|
-
renderItem: (item: T, helpers: {
|
|
609
|
-
isExpanded: boolean;
|
|
610
|
-
isDragging: boolean;
|
|
611
|
-
toggleExpanded: () => void;
|
|
612
|
-
cardProps: Pick<EffectCardProps, 'expanded' | 'dragging' | 'draggable' | 'onToggleExpanded' | 'onPressHandle' | 'onReleaseHandle' | 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDragLeave' | 'onDrop'>;
|
|
613
|
-
}) => ReactNode;
|
|
614
|
-
onReorder: (sourceId: T['id'], targetId: T['id'], position: 'before' | 'after') => void;
|
|
615
|
-
/** Optional rendered when the list is empty. */
|
|
616
|
-
empty?: ReactNode;
|
|
617
|
-
/** IDs to render expanded on first mount. Defaults to all collapsed. */
|
|
618
|
-
defaultExpandedIds?: ReadonlyArray<T['id']>;
|
|
619
|
-
}
|
|
620
|
-
/** A drag-reorderable list of `<EffectCard>`s. Owns the expanded and dragging
|
|
621
|
-
* state and hands it back to `renderItem`, so the caller only supplies each
|
|
622
|
-
* card's contents. */
|
|
623
|
-
declare function EffectCardList<T extends EffectCardListItem>({ items, renderItem, onReorder, empty, defaultExpandedIds, }: EffectCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
624
|
-
|
|
625
|
-
/** Props for `<PropertyGroup>`. */
|
|
626
|
-
interface PropertyGroupProps {
|
|
627
|
-
/** Title rendered between two rules at the top of the group. */
|
|
628
|
-
title: ReactNode;
|
|
629
|
-
/** When true the group renders nothing — useful for conditional sections. */
|
|
630
|
-
hidden?: boolean;
|
|
631
|
-
children: ReactNode;
|
|
632
|
-
className?: string;
|
|
633
|
-
/**
|
|
634
|
-
* How rows pack into the 2-column grid.
|
|
635
|
-
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
636
|
-
* else spans the full width.
|
|
637
|
-
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
638
|
-
*/
|
|
639
|
-
pack?: 'auto-color' | 'pairs';
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Visually-bordered group inside a PropertyList. Use to scope a set of
|
|
643
|
-
* related rows under a heading (e.g. "Aqua", "Bevel", "Dome" sections
|
|
644
|
-
* inside a fill effect's controls).
|
|
645
|
-
*/
|
|
646
|
-
declare function PropertyGroup({ title, hidden, children, className, pack, }: PropertyGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
647
|
-
|
|
648
|
-
/** Props for `<PropertyPanel>`. */
|
|
649
|
-
interface PropertyPanelProps {
|
|
650
|
-
title?: ReactNode;
|
|
651
|
-
children: ReactNode;
|
|
652
|
-
className?: string;
|
|
653
|
-
}
|
|
654
|
-
/** A titled panel holding property rows — the sidebar container the rest of
|
|
655
|
-
* this module's components fill. */
|
|
656
|
-
declare function PropertyPanel({ title, children, className }: PropertyPanelProps): react_jsx_runtime.JSX.Element;
|
|
657
|
-
/** How a property list packs its rows into two columns. */
|
|
658
|
-
type PropertyListPack = 'auto-color' | 'pairs';
|
|
659
|
-
/** Props for `<PropertyList>`. */
|
|
660
|
-
interface PropertyListProps {
|
|
661
|
-
children: ReactNode;
|
|
662
|
-
className?: string;
|
|
663
|
-
/**
|
|
664
|
-
* How rows pack into the 2-column grid.
|
|
665
|
-
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
666
|
-
* else spans the full width. Right for sparse top-level panels.
|
|
667
|
-
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
668
|
-
* Headers, subpanels, and full-width children (`<hr>`, curve blocks)
|
|
669
|
-
* still span via `lk-property-list__span`. Right for dense effect bodies.
|
|
670
|
-
*/
|
|
671
|
-
pack?: PropertyListPack;
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Grid container for PropertyRows. Use standalone for chrome-less layouts, or
|
|
675
|
-
* nest inside <PropertyPanel/> for the standard glass card.
|
|
676
|
-
*/
|
|
677
|
-
declare function PropertyList({ children, className, pack }: PropertyListProps): react_jsx_runtime.JSX.Element;
|
|
678
|
-
/** Which control shape a row holds, which decides its intrinsic layout. */
|
|
679
|
-
type PropertyRowVariant = 'default' | 'color' | 'checkbox';
|
|
680
|
-
/** Whether a row's label sits above its control or beside it. */
|
|
681
|
-
type PropertyRowLayout = 'block' | 'inline';
|
|
682
|
-
/** Props for `<PropertyRow>`. */
|
|
683
|
-
interface PropertyRowProps {
|
|
684
|
-
label: ReactNode;
|
|
685
|
-
/** Right-aligned readout shown next to the label (e.g. current value). */
|
|
686
|
-
readout?: ReactNode;
|
|
687
|
-
variant?: PropertyRowVariant;
|
|
688
|
-
/**
|
|
689
|
-
* Label position relative to the control. "block" (default) stacks
|
|
690
|
-
* label above control; "inline" places the label to the left.
|
|
691
|
-
* Color and checkbox variants are always inline by their own nature.
|
|
692
|
-
*/
|
|
693
|
-
layout?: PropertyRowLayout;
|
|
694
|
-
children: ReactNode;
|
|
695
|
-
htmlFor?: string;
|
|
696
|
-
className?: string;
|
|
697
|
-
}
|
|
698
|
-
/** The label-plus-control frame every typed row below is built from. Use it
|
|
699
|
-
* directly for a control this module does not cover. */
|
|
700
|
-
declare function PropertyRow({ label, readout, variant, layout, children, htmlFor, className, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
|
|
701
|
-
/** Props for `<SliderRow>`. */
|
|
702
|
-
interface SliderRowProps {
|
|
703
|
-
label: ReactNode;
|
|
704
|
-
value: number;
|
|
705
|
-
min: number;
|
|
706
|
-
max: number;
|
|
707
|
-
step?: number;
|
|
708
|
-
onChange: (next: number) => void;
|
|
709
|
-
/** Override how the value is rendered next to the label. Defaults to `value.toString()`. */
|
|
710
|
-
format?: (value: number) => ReactNode;
|
|
711
|
-
/**
|
|
712
|
-
* Optional suffix rendered next to the readout. A string becomes a
|
|
713
|
-
* baseline-aligned dim "word" unit (e.g. "px"); pass JSX like `<sup>°</sup>`
|
|
714
|
-
* to get the browser's native super positioning for symbol units.
|
|
715
|
-
*/
|
|
716
|
-
unit?: ReactNode;
|
|
717
|
-
layout?: PropertyRowLayout;
|
|
718
|
-
}
|
|
719
|
-
/** A bounded number edited by dragging, with a live readout whose precision
|
|
720
|
-
* follows `step`. */
|
|
721
|
-
declare function SliderRow({ label, value, min, max, step, onChange, format, unit, layout, }: SliderRowProps): react_jsx_runtime.JSX.Element;
|
|
722
|
-
/** Props for `<ColorRow>`. */
|
|
723
|
-
interface ColorRowProps {
|
|
724
|
-
label: ReactNode;
|
|
725
|
-
value: string;
|
|
726
|
-
onChange: (next: string) => void;
|
|
727
|
-
/** 0..1 alpha. When provided, a translucent slider renders beneath the swatch. */
|
|
728
|
-
alpha?: number;
|
|
729
|
-
onAlphaChange?: (next: number) => void;
|
|
730
|
-
/**
|
|
731
|
-
* Render the alpha track as inert (dimmed, no thumb, not-allowed cursor).
|
|
732
|
-
* Use when the color's consumer drops alpha so the affordance reads dead.
|
|
733
|
-
*/
|
|
734
|
-
alphaDisabled?: boolean;
|
|
735
|
-
}
|
|
736
|
-
/** A color swatch, optionally with an alpha slider beneath it. */
|
|
737
|
-
declare function ColorRow({ label, value, onChange, alpha, onAlphaChange, alphaDisabled, }: ColorRowProps): react_jsx_runtime.JSX.Element;
|
|
738
|
-
/** Props for `<CheckboxRow>`. */
|
|
739
|
-
interface CheckboxRowProps {
|
|
740
|
-
label: ReactNode;
|
|
741
|
-
value: boolean;
|
|
742
|
-
onChange: (next: boolean) => void;
|
|
743
|
-
}
|
|
744
|
-
/** A boolean checkbox. */
|
|
745
|
-
declare function CheckboxRow({ label, value, onChange }: CheckboxRowProps): react_jsx_runtime.JSX.Element;
|
|
746
|
-
/** Props for `<TextRow>`. */
|
|
747
|
-
interface TextRowProps {
|
|
748
|
-
label: ReactNode;
|
|
749
|
-
value: string;
|
|
750
|
-
onChange: (next: string) => void;
|
|
751
|
-
placeholder?: string;
|
|
752
|
-
maxLength?: number;
|
|
753
|
-
layout?: PropertyRowLayout;
|
|
754
|
-
}
|
|
755
|
-
/** A single-line text input. */
|
|
756
|
-
declare function TextRow({ label, value, onChange, placeholder, maxLength, layout }: TextRowProps): react_jsx_runtime.JSX.Element;
|
|
757
|
-
/** Props for `<NumberRow>`. */
|
|
758
|
-
interface NumberRowProps {
|
|
759
|
-
label: ReactNode;
|
|
760
|
-
value: number;
|
|
761
|
-
onChange: (next: number) => void;
|
|
762
|
-
min?: number;
|
|
763
|
-
max?: number;
|
|
764
|
-
step?: number;
|
|
765
|
-
placeholder?: string;
|
|
766
|
-
layout?: PropertyRowLayout;
|
|
767
|
-
}
|
|
768
|
-
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
769
|
-
* more than the exact value. */
|
|
770
|
-
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, layout, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
771
|
-
interface SelectOption<T extends string> {
|
|
772
|
-
value: T;
|
|
773
|
-
label: ReactNode;
|
|
774
|
-
}
|
|
775
|
-
/** Props for `<SelectRow>`. */
|
|
776
|
-
interface SelectRowProps<T extends string> {
|
|
777
|
-
label: ReactNode;
|
|
778
|
-
value: T;
|
|
779
|
-
options: ReadonlyArray<SelectOption<T>>;
|
|
780
|
-
onChange: (next: T) => void;
|
|
781
|
-
layout?: PropertyRowLayout;
|
|
782
|
-
}
|
|
783
|
-
/** A dropdown over a fixed set of choices. Prefer `<ToggleRow>` when there
|
|
784
|
-
* are only two or three and they should all stay visible. */
|
|
785
|
-
declare function SelectRow<T extends string>({ label, value, options, onChange, layout, }: SelectRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
786
|
-
/** Props for `<ToggleRow>`. */
|
|
787
|
-
interface ToggleRowProps<T extends string> {
|
|
788
|
-
label: ReactNode;
|
|
789
|
-
value: T;
|
|
790
|
-
options: ReadonlyArray<SelectOption<T>>;
|
|
791
|
-
onChange: (next: T) => void;
|
|
792
|
-
layout?: PropertyRowLayout;
|
|
793
|
-
}
|
|
794
|
-
/** A segmented control: the same choice as a select, with every option
|
|
795
|
-
* visible at once. */
|
|
796
|
-
declare function ToggleRow<T extends string>({ label, value, options, onChange, layout, }: ToggleRowProps<T>): react_jsx_runtime.JSX.Element;
|
|
797
|
-
|
|
798
|
-
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, 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 };
|
|
799
|
-
export type { CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, EffectCardListItem, EffectCardListProps, EffectCardProps, InstrumentSpec, LabContextValue, LabPaletteProps, LabProps, LabShellProps, NumberRowProps, OrbitHandlers, OrbitView, PropertyGroupProps, PropertyListPack, PropertyListProps, PropertyPanelProps, PropertyRowLayout, PropertyRowProps, PropertyRowVariant, SelectRowProps, SliderRowProps, SubpanelProps, TextRowProps, ToggleRowProps, TrialChromeProps, TrialProps, UndoBindings, UseOrbitOptions, ValidationResult, Vec3, ViewTransform2D, WorkspaceProps };
|
|
1156
|
+
export { ANNOTATION_TOOLS, ANNOTATION_WEASEL_TOOLS, AnnotationData, AnnotationKind, AnnotationMeaning, AnnotationOverlay, AnnotationTarget, AnnotationTargets, Annotations, AnnotationsApi, AnnotationsCapability, AnnotationsContext, CaptureOptions, CaptureResult, CaptureSource, ConfigField, ConfigNode, ConfigOption, ConfigRule, ConfigRuleContext, ConfigSchema, ControlRenderer, CurveField, DEFAULT_VIEW, EffectCard, EffectCardList, ExportMenu, InferConfig, Instrument, InstrumentList, JobHandle, Lab, LabContext, LabMode, LabPalette, LabShell, LeafPatch, MarkList, MarkScene, NodeOptions, PITCH_LIMIT, PropertyGroup, ResolvedConfig, SavedSnapshot, StorageAdapter, Subpanel, Trial, TrialChrome, TrialContribution, TrialRecord, TrialTool, ViewTransform, Workspace, WorldRect, addTrial, annotationToolInfo, applyRules, as2DView, builtinRules, capturePlan, captureTarget, clampPitch, cloneTrial, closeTrial, composeCaptureSvg, createMarkDrawOne, defineInstrument, f, fitView, fromConfigFields, fromWeaselView, interstellarTheme, isLeafVisible, isStale, markCommands, markSvgNodes, orbitAfterDrag, orbitAfterWheel, reorderTrials, resetTrial, resolveConfigSchema, resolveMarkStyle, seenFrom, titleCase, toWeaselView, useAnnotations, useAnnotationsOptional, useConfigSchema, useLabContext, useOrbit, validateConfigSchema, wrapYaw };
|
|
1157
|
+
export type { AnnotationOverlayProps, AnnotationTargetsProps, AnnotationToolInfo, CaptureArgs, CapturePlan, ComposeSvgArgs, ContentSize, CurveFieldProps, CurveMark, EffectCardListItem, EffectCardListProps, EffectCardProps, InstrumentSpec, LabContextValue, LabPaletteProps, LabProps, LabShellProps, MarkDrawOptions, MarkListProps, MarkStyle, OrbitHandlers, OrbitView, PaintableMark, PaneSize, PanelDescriptor, PropertyGroupProps, SubpanelProps, TrialChromeProps, TrialLayout, TrialProps, UndoBindings, UseOrbitOptions, ValidationResult, Vec3, ViewTransform2D, WorkspaceProps };
|