@weasel-js/labkit 1.4.2 → 1.4.4

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.
Files changed (117) hide show
  1. package/README.md +20 -2
  2. package/dist/_dts/{CanvasStackContext-kjILVnPj.d.ts → CanvasStackContext-kTEZvEgE.d.ts} +1 -1
  3. package/dist/_dts/{PrefsForm.d-CgxUequc.d.ts → PrefsForm.d-DDHFANkc.d.ts} +1 -1
  4. package/dist/_dts/{frac-A4R6v4ld.d.ts → frac-z7ker2Vx.d.ts} +11 -7
  5. package/dist/_dts/{index-CsU9WhjM.d.ts → index-Blv9uQzu.d.ts} +42 -9
  6. package/dist/_dts/types-B9_zrHmb.d.ts +166 -0
  7. package/dist/_dts/{types-BbXpvQa8.d.ts → types-BP2OCcpg.d.ts} +21 -3
  8. package/dist/_dts/types-x92Kfeme.d.ts +62 -0
  9. package/dist/_dts/{useTrialState-DKjqpv20.d.ts → useTrialState-D6Vb3T-g.d.ts} +7 -7
  10. package/dist/canvas/index.d.ts +9 -8
  11. package/dist/canvas/index.js +1 -2
  12. package/dist/chrome/index.d.ts +7 -6
  13. package/dist/chrome/index.js +5 -5
  14. package/dist/{chunk-ULDW42CR.js → chunk-2P6PP5N4.js} +33 -23
  15. package/dist/chunk-2P6PP5N4.js.map +1 -0
  16. package/dist/{chunk-W2FJR5FF.js → chunk-64ZCN3DA.js} +74 -76
  17. package/dist/chunk-64ZCN3DA.js.map +1 -0
  18. package/dist/{chunk-NSOVI3AZ.js → chunk-BKFVHKJH.js} +6 -6
  19. package/dist/{chunk-NSOVI3AZ.js.map → chunk-BKFVHKJH.js.map} +1 -1
  20. package/dist/chunk-E44SU6XS.js +50 -0
  21. package/dist/chunk-E44SU6XS.js.map +1 -0
  22. package/dist/{chunk-WS6ZRV75.js → chunk-FQMJUVHJ.js} +3 -3
  23. package/dist/{chunk-WS6ZRV75.js.map → chunk-FQMJUVHJ.js.map} +1 -1
  24. package/dist/{chunk-FJG4PHTL.js → chunk-I6JCVE24.js} +3 -3
  25. package/dist/chunk-I6JCVE24.js.map +1 -0
  26. package/dist/{chunk-UDXOYZEC.js → chunk-MOM3GOVY.js} +4 -4
  27. package/dist/{chunk-UDXOYZEC.js.map → chunk-MOM3GOVY.js.map} +1 -1
  28. package/dist/{chunk-TN7YSJVU.js → chunk-RS3HRQWU.js} +3 -3
  29. package/dist/{chunk-TN7YSJVU.js.map → chunk-RS3HRQWU.js.map} +1 -1
  30. package/dist/{chunk-UTOEDPNU.js → chunk-SMHP6XZ4.js} +7 -6
  31. package/dist/chunk-SMHP6XZ4.js.map +1 -0
  32. package/dist/{chunk-D5KQ5OY6.js → chunk-TJ7QY3OC.js} +3 -3
  33. package/dist/{chunk-D5KQ5OY6.js.map → chunk-TJ7QY3OC.js.map} +1 -1
  34. package/dist/{chunk-XKENZTNE.js → chunk-U3IYHIAE.js} +71 -55
  35. package/dist/chunk-U3IYHIAE.js.map +1 -0
  36. package/dist/chunk-W3ECWC2K.js +7335 -0
  37. package/dist/chunk-W3ECWC2K.js.map +1 -0
  38. package/dist/controls/index.d.ts +5 -4
  39. package/dist/controls/index.js +3 -3
  40. package/dist/dragdrop/index.d.ts +6 -5
  41. package/dist/dragdrop/index.js +1 -2
  42. package/dist/index.d.ts +139 -26
  43. package/dist/index.js +309 -144
  44. package/dist/index.js.map +1 -1
  45. package/dist/layers/index.d.ts +7 -6
  46. package/dist/layers/index.js +2 -3
  47. package/dist/loupe/index.d.ts +8 -7
  48. package/dist/loupe/index.js +1 -2
  49. package/dist/passthrough/weasel-canvas.d.ts +1 -3
  50. package/dist/passthrough/weasel-canvas.js +1 -1
  51. package/dist/passthrough/weasel-canvas.js.map +1 -1
  52. package/dist/passthrough/weasel-ui.d.ts +98 -20
  53. package/dist/passthrough/weasel-ui.js +1 -2
  54. package/dist/primitives/index.js +3 -4
  55. package/dist/state/index.d.ts +6 -3
  56. package/dist/state/index.js +3 -2
  57. package/dist/state/index.js.map +1 -1
  58. package/dist/styles.css +82 -15
  59. package/dist/surface/index.js +1 -2
  60. package/dist/ui/layers/index.js +1 -2
  61. package/dist/undo/index.d.ts +6 -6
  62. package/package.json +7 -7
  63. package/src/annotations/ExportMenu.test.tsx +16 -0
  64. package/src/annotations/ExportMenu.tsx +0 -5
  65. package/src/annotations/frac.test.ts +4 -4
  66. package/src/annotations/frac.ts +3 -2
  67. package/src/annotations/index.ts +1 -1
  68. package/src/annotations/store.ts +2 -2
  69. package/src/annotations/svgNodes.ts +1 -2
  70. package/src/config/builder.test.ts +56 -2
  71. package/src/config/builder.ts +73 -13
  72. package/src/config/index.ts +16 -1
  73. package/src/config/path.test.ts +109 -0
  74. package/src/config/path.ts +76 -0
  75. package/src/config/resolve.test.ts +93 -2
  76. package/src/config/resolve.ts +72 -29
  77. package/src/config/types.ts +99 -9
  78. package/src/config/visible.ts +6 -4
  79. package/src/controls/ControlPanel.stories.tsx +38 -4
  80. package/src/controls/ControlPanel.test.tsx +114 -0
  81. package/src/controls/ControlPanel.tsx +99 -50
  82. package/src/index.ts +17 -2
  83. package/src/instrument/serializers.ts +36 -0
  84. package/src/instrument/types.ts +4 -2
  85. package/src/lab/Lab.test.tsx +29 -1
  86. package/src/lab/Lab.tsx +10 -1
  87. package/src/lab/LabShell.test.tsx +8 -0
  88. package/src/lab/LabShell.tsx +17 -3
  89. package/src/lab/LabSwitcher.less +85 -0
  90. package/src/lab/LabSwitcher.test.tsx +96 -0
  91. package/src/lab/LabSwitcher.tsx +112 -0
  92. package/src/lab/index.ts +2 -0
  93. package/src/primitives/ZoomControl.less +6 -2
  94. package/src/primitives/ZoomControl.tsx +1 -0
  95. package/src/state/helpers.test.ts +20 -0
  96. package/src/state/helpers.ts +17 -1
  97. package/src/state/store.test.ts +155 -1
  98. package/src/state/store.ts +32 -26
  99. package/src/state/types.ts +24 -3
  100. package/src/state/useTrialState.ts +1 -1
  101. package/src/styles.less +1 -0
  102. package/src/theme/base.less +4 -4
  103. package/src/trial/Trial.config.test.tsx +44 -0
  104. package/src/trial/Trial.tsx +3 -3
  105. package/src/trial/TrialChrome.tsx +10 -5
  106. package/src/trial/trialOps.ts +7 -10
  107. package/dist/_dts/types-lg4TSCb2.d.ts +0 -164
  108. package/dist/_dts/weasel-canvas-FJTFi3ZZ.d.ts +0 -5041
  109. package/dist/chunk-54ZWZ5FQ.js +0 -29997
  110. package/dist/chunk-54ZWZ5FQ.js.map +0 -1
  111. package/dist/chunk-FJG4PHTL.js.map +0 -1
  112. package/dist/chunk-ISSVF5PT.js +0 -7263
  113. package/dist/chunk-ISSVF5PT.js.map +0 -1
  114. package/dist/chunk-ULDW42CR.js.map +0 -1
  115. package/dist/chunk-UTOEDPNU.js.map +0 -1
  116. package/dist/chunk-W2FJR5FF.js.map +0 -1
  117. package/dist/chunk-XKENZTNE.js.map +0 -1
@@ -1,6 +1,7 @@
1
- export { e as ControlPanel } from '../_dts/index-CsU9WhjM.js';
2
- export { g as CheckboxField, h as ColorField, C as ConfigField, j as ConfigFieldType, m as NumberField, n as SelectField, o as SelectOption, p as SliderField, T as TextField } from '../_dts/types-lg4TSCb2.js';
1
+ export { e as ControlPanel } from '../_dts/index-Blv9uQzu.js';
2
+ export { a as CheckboxField, b as ColorField, C as ConfigField, d as ConfigFieldType, N as NumberField, S as SelectField, e as SelectOption, f as SliderField, T as TextField } from '../_dts/types-x92Kfeme.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
5
- import '../_dts/weasel-canvas-FJTFi3ZZ.js';
6
- import '../_dts/PrefsForm.d-CgxUequc.js';
5
+ import '../_dts/types-B9_zrHmb.js';
6
+ import '@weasel-js/core';
7
+ import '../_dts/PrefsForm.d-DDHFANkc.js';
@@ -1,5 +1,5 @@
1
- export { ControlPanel } from '../chunk-XKENZTNE.js';
2
- import '../chunk-ISSVF5PT.js';
3
- import '../chunk-54ZWZ5FQ.js';
1
+ export { ControlPanel } from '../chunk-U3IYHIAE.js';
2
+ import '../chunk-E44SU6XS.js';
3
+ import '../chunk-W3ECWC2K.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,11 @@
1
- import { P as PaletteItem, a as Point, D as DragFeedback, b as DragDropCapability, V as ViewTransform, c as WorldSpec } from '../_dts/frac-A4R6v4ld.js';
1
+ import { P as PaletteItem, a as Point, D as DragFeedback, b as DragDropCapability, V as ViewTransform, c as WorldSpec } from '../_dts/frac-z7ker2Vx.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { RefObject, PointerEvent, ReactPortal } from 'react';
4
- import '../_dts/types-lg4TSCb2.js';
5
- import '../_dts/weasel-canvas-FJTFi3ZZ.js';
6
- import '../_dts/PrefsForm.d-CgxUequc.js';
7
- import '../_dts/types-BbXpvQa8.js';
4
+ import '../_dts/types-B9_zrHmb.js';
5
+ import '@weasel-js/core';
6
+ import '../_dts/PrefsForm.d-DDHFANkc.js';
7
+ import '../_dts/types-x92Kfeme.js';
8
+ import '../_dts/types-BP2OCcpg.js';
8
9
  import '../_dts/types-DJ79Tg5J.js';
9
10
 
10
11
  interface DragState {
@@ -1,5 +1,4 @@
1
- export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-TN7YSJVU.js';
1
+ export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-RS3HRQWU.js';
2
2
  import '../chunk-2AYGEN57.js';
3
- import '../chunk-54ZWZ5FQ.js';
4
3
  //# sourceMappingURL=index.js.map
5
4
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -2,28 +2,30 @@ export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.j
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
- import { P as PropertyMetricProps, a as PropertyListPack } from './_dts/index-CsU9WhjM.js';
6
- export { C as CheckboxRow, b as CheckboxRowProps, c as ColorRow, d as ColorRowProps, e as ControlPanel, N as NumberRow, f as NumberRowProps, g as PropertyList, h as PropertyListProps, i as PropertyOption, j as PropertyPanel, k as PropertyPanelProps, l as PropertyRow, m as PropertyRowLayout, n as PropertyRowProps, o as PropertyRowVariant, p as PropertySpan, q as PropertySpanProps, S as SelectRow, r as SelectRowProps, s as SliderRow, t as SliderRowProps, T as TextRow, u as TextRowProps, v as ToggleRow, w as ToggleRowProps } from './_dts/index-CsU9WhjM.js';
7
- import { D as DrawCommand, N as Node, V as View, P as Path, F as FillStyle, b as StyledRun, c as TextStyle, d as Stroke, B as BuiltinToolId, T as ToolPrefLeaf } from './_dts/weasel-canvas-FJTFi3ZZ.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-A4R6v4ld.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-A4R6v4ld.js';
10
- import { i as TrialInfo, a as StorageAdapter, h as LabMode, T as TrialRecord, c as SavedSnapshot } from './_dts/types-BbXpvQa8.js';
11
- 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-BbXpvQa8.js';
5
+ import { P as PropertyMetricProps, a as PropertyListPack } from './_dts/index-Blv9uQzu.js';
6
+ export { C as CheckboxRow, b as CheckboxRowProps, c as ColorRow, d as ColorRowProps, e as ControlPanel, N as NumberRow, f as NumberRowProps, g as PropertyList, h as PropertyListProps, i as PropertyOption, j as PropertyPanel, k as PropertyPanelProps, l as PropertyRow, m as PropertyRowLayout, n as PropertyRowProps, o as PropertyRowVariant, p as PropertySpan, q as PropertySpanProps, S as SelectRow, r as SelectRowProps, s as SliderRow, t as SliderRowProps, T as TextRow, u as TextRowProps, v as ToggleRow, w as ToggleRowProps } from './_dts/index-Blv9uQzu.js';
7
+ import { DrawCommand, SceneNode, View, Path, FillStyle, StyledRun, TextStyle, Stroke, BuiltinToolId, ToolPrefLeaf, ToolPrefGroup } from '@weasel-js/core';
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-z7ker2Vx.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 fracEncloses, a9 as fracToWorld, aa as resolveFrame, ab as resolveLoupe, ac as roundFrac, ad as worldToFrac } from './_dts/frac-z7ker2Vx.js';
10
+ import { i as TrialInfo, a as StorageAdapter, h as LabMode, T as TrialRecord, c as SavedSnapshot } from './_dts/types-BP2OCcpg.js';
11
+ 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-BP2OCcpg.js';
12
12
  export { CanvasStack, CanvasStackProps, OrbitHandlers, OrbitView, PITCH_LIMIT, PanZoomHandlers, UseOrbitOptions, UsePanZoomOptions, Vec3, ZoomAtOptions, centerOn, clampPitch, orbitAfterDrag, orbitAfterWheel, screenToWorld, useOrbit, usePanZoom, worldToScreen, wrapYaw, zoomAt } from './canvas/index.js';
13
- export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from './_dts/CanvasStackContext-kjILVnPj.js';
13
+ export { C as CanvasLayerDescriptor, a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from './_dts/CanvasStackContext-kTEZvEgE.js';
14
14
  export { PaletteRegion, PaletteRegionProps, SidebarRegion, SidebarRegionProps, StatusRegion, StatusRegionProps, TitleBarPlacement, TitleBarRegion, TitleBarRegionProps, ToolbarRegion, ToolbarRegionProps, ViewportRegion, ViewportRegionProps, builtinContributions, mergeContributions, suppressContributions } from './chrome/index.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-lg4TSCb2.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-lg4TSCb2.js';
15
+ import { b as ConfigNode, A as Annotations, N as NodeOptions, c as ControlRenderer, d as ConfigOption, e as ConfigShape, f as ConfigBranch, B as BranchAnnotations, g as BranchOptions, a as ConfigSchema, I as InferConfig, h as ConfigEntry, R as ResolvedConfig, i as ConfigRule, L as LeafPatch, j as ConfigRuleContext } from './_dts/types-B9_zrHmb.js';
16
+ export { k as ConfigOf, C as ConfigPath, E as EntryValue, l as NodeValue, S as SectionSpec, V as ValueAtPath } from './_dts/types-B9_zrHmb.js';
17
+ import { C as ConfigField } from './_dts/types-x92Kfeme.js';
18
+ export { a as CheckboxField, b as ColorField, c as ConfigFieldBase, d as ConfigFieldType, N as NumberField, S as SelectField, e as SelectOption, f as SliderField, T as TextField } from './_dts/types-x92Kfeme.js';
17
19
  import { J as JobHandle } from './_dts/types-DJ79Tg5J.js';
18
20
  export { a as JobCapability, b as JobEvent, c as JobFailure, d as JobStatus } from './_dts/types-DJ79Tg5J.js';
19
21
  export { UseJobOptions, useJob } from './job/index.js';
20
22
  export { LayerList, LayerListProps, LayerTreeNode } from './layers/index.js';
21
23
  export { CanvasLoupe, CanvasLoupeProps, DomLoupe, DomLoupeProps, LensCamera, LoupeBubble, LoupeBubbleProps, LoupeState, SourceRect, TrialLoupe, TrialLoupeProps, UseLoupeOptions, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe } from './loupe/index.js';
22
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';
23
- 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-DKjqpv20.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-D6Vb3T-g.js';
24
26
  export { Box, Rect, SurfaceCanvasContext, SurfaceContext, SurfaceFrame, SurfaceHandle, TilePainter, UseTiledSurfaceOptions, composeRects, rectsEqual, toDeviceRect, useSurface, useSurfaceCanvas, useSurfaceOptional, useSurfaceTile, useTileId, useTiledSurface } from './surface/index.js';
25
27
  export { EventBus, EventListener, clearUndo, createEventBus, emptyStack, pushSnapshot, redo, undo } from './undo/index.js';
26
- import './_dts/PrefsForm.d-CgxUequc.js';
28
+ import './_dts/PrefsForm.d-DDHFANkc.js';
27
29
  import 'windease';
28
30
  import 'zustand/vanilla';
29
31
 
@@ -215,7 +217,7 @@ interface MarkDrawOptions {
215
217
  * export that resolves a status colour or a stale dash differently from the
216
218
  * screen produces a picture nobody was looking at.
217
219
  */
218
- declare function createMarkDrawOne(opts: MarkDrawOptions): (node: Node<AnnotationData, 'marks', WorldRect>, pose: WorldRect, view: View) => DrawCommand[];
220
+ declare function createMarkDrawOne(opts: MarkDrawOptions): (node: SceneNode<AnnotationData, 'marks', WorldRect>, pose: WorldRect, view: View) => DrawCommand[];
219
221
  /** How a mark looks, as opposed to where it is. Separate from the callback
220
222
  * above because an SVG export resolves the same appearance without ever
221
223
  * building a draw command. */
@@ -375,7 +377,12 @@ type SvgPaint = {
375
377
  /** Stroke description: a paint plus structural line parameters. */
376
378
  interface SvgStroke {
377
379
  paint: SvgPaint;
378
- width: number;
380
+ /** World units, or `{ px }` for a width that holds its rendered thickness
381
+ * however the document is scaled — SVG's `vector-effect="non-scaling-stroke"`,
382
+ * and the same unit system as the kit's `Stroke.width`. */
383
+ width: number | {
384
+ px: number;
385
+ };
379
386
  opacity?: number;
380
387
  /** `stroke-linecap`. Default per SVG spec is `'butt'`. */
381
388
  cap?: 'butt' | 'round' | 'square';
@@ -459,8 +466,11 @@ interface SvgTextNode {
459
466
  * in `data.fill` / `data.stroke`. Not `SvgPaint`, which is the path
460
467
  * nodes' shape — a text paint reaches the renderer through the runs, and
461
468
  * `StyledRun.fill` / `.stroke` override these per range.
469
+ *
470
+ * `null` is SVG's `fill="none"`: outline-only text, painted by its stroke
471
+ * alone. Absent takes the default black.
462
472
  */
463
- fill?: FillStyle;
473
+ fill?: FillStyle | null;
464
474
  stroke?: Stroke;
465
475
  /** Element-level opacity (`opacity="..."`), 0..1. */
466
476
  opacity?: number;
@@ -600,6 +610,8 @@ declare function fromWeaselView(v: View): ViewTransform;
600
610
  */
601
611
  declare function fitView(content: ContentSize, pane: PaneSize): ViewTransform;
602
612
 
613
+ /** Whether a schema entry is a branch rather than a leaf. */
614
+ declare function isConfigBranch(entry: ConfigEntry): entry is ConfigBranch;
603
615
  /** Shared chaining surface. Every method clones, so a node can be reused as a
604
616
  * base for several leaves without one bleeding into the next. */
605
617
  declare abstract class BaseNode<T> implements ConfigNode<T> {
@@ -621,8 +633,11 @@ declare abstract class BaseNode<T> implements ConfigNode<T> {
621
633
  hidden(): this;
622
634
  /** Pair with a sibling sharing this id, side-by-side on one row. */
623
635
  pair(pair: string): this;
624
- /** Render under a named section heading. */
625
- section(section: string): this;
636
+ /** Render under a named section heading. `collapsed` opens the section
637
+ * folded — say it on any one of the section's leaves. */
638
+ section(label: string, opts?: {
639
+ collapsed?: boolean;
640
+ }): this;
626
641
  /** Show this row only while the predicate holds. Presentational — the value
627
642
  * stays in config and the instrument still reads it. */
628
643
  showIf(predicate: (config: Record<string, unknown>) => boolean): this;
@@ -676,6 +691,31 @@ declare class CustomNode<T> extends BaseNode<T> {
676
691
  constructor(kind: string, defaultValue: T, annotations?: Readonly<Annotations>, options?: Readonly<NodeOptions>);
677
692
  protected with(annotations: Annotations, options: NodeOptions): this;
678
693
  }
694
+ /**
695
+ * A branch of the schema: its children nest under its key, so a leaf inside
696
+ * one is read and written at a dotted path. Distinct from `.section()`, which
697
+ * puts a heading over sibling leaves and leaves their paths alone.
698
+ */
699
+ declare class GroupNode<S extends ConfigShape> implements ConfigBranch<S> {
700
+ readonly children: S;
701
+ readonly annotations: Readonly<BranchAnnotations>;
702
+ readonly options: Readonly<BranchOptions>;
703
+ constructor(children: S, annotations?: Readonly<BranchAnnotations>, options?: Readonly<BranchOptions>);
704
+ private with;
705
+ /** Heading for the group's rows. Defaults to the key, title-cased. */
706
+ label(name: string): GroupNode<S>;
707
+ /** Longer help text. Carried on the resolved `PrefGroup`, where weasel-ui's
708
+ * `PrefsForm` draws it under the heading; `ControlPanel` has no place for
709
+ * it yet and shows the heading alone. */
710
+ describe(description: string): GroupNode<S>;
711
+ /** Render this whole group under a named section heading. */
712
+ section(label: string, opts?: {
713
+ collapsed?: boolean;
714
+ }): GroupNode<S>;
715
+ /** Show this group only while the predicate holds. Presentational — every
716
+ * value beneath it stays in config and the instrument still reads it. */
717
+ showIf(predicate: (config: Record<string, unknown>) => boolean): GroupNode<S>;
718
+ }
679
719
  /**
680
720
  * Builds an instrument's config: the values, their types, and how each is
681
721
  * edited, in one declaration.
@@ -684,6 +724,8 @@ declare class CustomNode<T> extends BaseNode<T> {
684
724
  * const config = f.schema({
685
725
  * showGrid: f.boolean(true),
686
726
  * cellSize: f.number(20).range(5, 80).step(5).label('Grid spacing'),
727
+ * // Nested: read and written at `grid.color`.
728
+ * grid: f.group({ color: f.color('#ffffff') }),
687
729
  * })
688
730
  * ```
689
731
  */
@@ -699,10 +741,14 @@ declare const f: {
699
741
  /** A leaf with no declared kind: the rule chain decides, which is how a lab
700
742
  * states a convention like "every `*Color` key is a color picker". */
701
743
  value: <T>(def: T) => ValueNode<T>;
744
+ /** A branch: its children nest under this key, so `grid: f.group({ size })`
745
+ * puts the value at `config.grid.size` and addresses it as `'grid.size'`.
746
+ * Groups nest as deeply as the schema wants. */
747
+ group: <const S extends ConfigShape>(children: S) => GroupNode<S>;
702
748
  /** A leaf of a kind a lab supplies the control for, through `controls`. */
703
749
  custom: <T>(kind: string, def: T, validate?: (leaf: ToolPrefLeaf) => string[]) => CustomNode<T>;
704
- /** Collect leaves into an instrument's config. */
705
- schema<S extends Record<string, ConfigNode>>(nodes: S): ConfigSchema<InferConfig<S>>;
750
+ /** Collect leaves and groups into an instrument's config. */
751
+ schema<S extends ConfigShape>(nodes: S): ConfigSchema<InferConfig<S>>;
706
752
  };
707
753
 
708
754
  /**
@@ -714,12 +760,37 @@ declare const f: {
714
760
  */
715
761
  declare function fromConfigFields(fields: readonly ConfigField[]): ResolvedConfig;
716
762
 
763
+ /** The value at a dotted path. `undefined` when a segment is missing or the
764
+ * walk hits something that is not a record. */
765
+ declare function valueAtPath(config: unknown, path: string): unknown;
766
+ /** Whether a dotted path is actually present, which a `undefined` value is
767
+ * not enough to tell you. */
768
+ declare function hasConfigPath(config: unknown, path: string): boolean;
769
+ /** A copy of `config` with `value` written at a dotted path. Every record on
770
+ * the way down is copied and the input is left alone; a missing — or
771
+ * non-record — intermediate is replaced with the branch the path implies. */
772
+ declare function withValueAtPath<T>(config: T, path: string, value: unknown): T;
773
+ /**
774
+ * `stored` with every gap filled from `defaults`, down the whole tree.
775
+ *
776
+ * This is how a config written before its schema grew a branch still loads:
777
+ * the branch arrives at its defaults instead of `undefined`, and a key the
778
+ * defaults no longer mention is kept rather than dropped, so nothing is lost
779
+ * to a schema change the author has not finished making.
780
+ */
781
+ declare function fillConfigDefaults<T>(stored: unknown, defaults: T): T;
782
+ /** A node in a resolved schema tree, by dotted path. Structural rather than
783
+ * `isPrefLeaf` so this stays free of a runtime import. */
784
+ declare function schemaNodeAtPath(group: ToolPrefGroup, path: string): ToolPrefLeaf | ToolPrefGroup | undefined;
785
+
717
786
  /**
718
787
  * Resolve a schema into the vocabulary weasel-ui renders, running each leaf
719
788
  * through the consumer's rules and then labkit's own.
720
789
  *
721
- * The group is flat — every leaf is a direct child — so a leaf's path is its
722
- * config key and both `ControlPanel` and `PrefsForm` address it identically.
790
+ * The group mirrors the schema's own nesting: an `f.group` becomes a nested
791
+ * `PrefGroup`, so a leaf's dotted path within the tree is the path its value
792
+ * is written at, and both `ControlPanel` and `PrefsForm` address it
793
+ * identically.
723
794
  */
724
795
  declare function resolveConfigSchema<TC>(schema: ConfigSchema<TC>, rules?: readonly ConfigRule[]): ResolvedConfig;
725
796
 
@@ -750,9 +821,10 @@ declare function applyRules(seed: LeafPatch, ctx: Omit<ConfigRuleContext, 'leaf'
750
821
  declare function useConfigSchema(instrument: Instrument<any, any, any>): ResolvedConfig;
751
822
 
752
823
  /**
753
- * Whether a leaf's row should be drawn right now.
824
+ * Whether the row at a dotted path should be drawn right now. A group answers
825
+ * for its whole subtree — hiding one hides everything under it.
754
826
  *
755
- * `hidden` is the leaf's own static flag; `showIf` is the schema's predicate
827
+ * `hidden` is the node's own static flag; `showIf` is the schema's predicate
756
828
  * over the live config. Both are presentational — a hidden leaf keeps its
757
829
  * value and the instrument still reads it.
758
830
  */
@@ -899,6 +971,41 @@ interface LabPaletteProps {
899
971
  * instrument declares no tools of its own resolves to. */
900
972
  declare function LabPalette({ tools }: LabPaletteProps): react_jsx_runtime.JSX.Element;
901
973
 
974
+ /** One page in a project's set of labs. */
975
+ interface LabPage {
976
+ /** The page's own URL, and how the switcher knows which page is open. */
977
+ href: string;
978
+ label: string;
979
+ }
980
+ /** Props for `<LabSwitcher>`. */
981
+ interface LabSwitcherProps {
982
+ /** The open page's title, shown as the control's own label. */
983
+ title: string;
984
+ pages: readonly LabPage[];
985
+ /** Defaults to the current location. Pass it in tests, or to render a
986
+ * switcher for a page other than the one being viewed. */
987
+ path?: string;
988
+ className?: string;
989
+ }
990
+ /** Which of `pages` a path is on, or -1.
991
+ *
992
+ * Matched on the end of the path so a query string, a trailing slash or a
993
+ * leftover `.html` cannot lose it: a project whose dev server maps `/stats`
994
+ * to `stats.html` serves both spellings, and a bookmark from before the URLs
995
+ * lost their extension still resolves to the same page. */
996
+ declare function currentPage(path: string, pages: readonly LabPage[]): number;
997
+ /** A project's lab title, doubling as the way to reach its other labs.
998
+ *
999
+ * The menu holds real anchors, not a `<select>` and not buttons. These are
1000
+ * separate documents, so an `href` is what gets middle-click, cmd-click and
1001
+ * the back button for free; a select fires a change event and can do none of
1002
+ * the three. The trigger is a button because it opens something rather than
1003
+ * going anywhere.
1004
+ *
1005
+ * Pages accumulate -- a project grows a wall, a dashboard, an ingest page, a
1006
+ * bench -- and a tab strip is the layout that stops working first. */
1007
+ declare function LabSwitcher({ title, pages, path, className }: LabSwitcherProps): react_jsx_runtime.JSX.Element;
1008
+
902
1009
  /** Props for `<LabShell>`. */
903
1010
  interface LabShellProps {
904
1011
  title: string;
@@ -909,11 +1016,17 @@ interface LabShellProps {
909
1016
  footer?: ReactNode;
910
1017
  /** Color mode. "auto" (default) follows prefers-color-scheme. */
911
1018
  mode?: LabMode;
1019
+ /** The project's other labs. Given two or more, the title becomes the way
1020
+ * to reach them; given none, it stays a plain heading. */
1021
+ pages?: readonly LabPage[];
1022
+ /** The path the switcher reads to mark the open page. Defaults to the
1023
+ * current location. */
1024
+ path?: string;
912
1025
  }
913
1026
  /** Page frame for a lab: a titled header, a body, and an optional footer,
914
1027
  * themed for the resolved color mode. Presentational only — use `<Lab>` when
915
1028
  * the trial runtime is wanted too. */
916
- declare function LabShell({ title, children, header, footer, mode }: LabShellProps): react_jsx_runtime.JSX.Element;
1029
+ declare function LabShell({ title, children, header, footer, mode, pages, path }: LabShellProps): react_jsx_runtime.JSX.Element;
917
1030
 
918
1031
  /** A tile's persisted extent, keyed by the id its caller gave it. Grid resizes
919
1032
  * write `span`; `size` is here because a strategy swap would write that. */
@@ -1116,5 +1229,5 @@ interface TrialChromeProps {
1116
1229
  * each region its slice. */
1117
1230
  declare function TrialChrome({ trialId, record, instrument, isLastTrial, undoBindings, job, loupe, trialChrome, chrome, suppress, activeToolId, setActiveTool, children, }: TrialChromeProps): react_jsx_runtime.JSX.Element;
1118
1231
 
1119
- 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, PropertyGroup, PropertyListPack, ResolvedConfig, SavedSnapshot, StorageAdapter, Subpanel, Trial, TrialBody, TrialChrome, TrialContribution, TrialInfo, TrialRecord, TrialTool, ViewTransform, Workspace, WorldRect, addTrial, annotationToolInfo, applyRules, as2DView, builtinRules, capturePlan, captureTarget, cloneTrial, closeTrial, composeCaptureSvg, createMarkDrawOne, defineInstrument, f, fitView, fromConfigFields, fromWeaselView, interstellarTheme, isLeafVisible, isStale, markCommands, markSvgNodes, reorderTrials, resetTrial, resolveConfigSchema, resolveMarkStyle, seenFrom, titleCase, toWeaselView, useAnnotations, useAnnotationsOptional, useConfigSchema, useLabContext, validateConfigSchema };
1120
- export type { AddTrialOptions, AnnotationOverlayProps, AnnotationTargetsProps, AnnotationToolInfo, CaptureArgs, CapturePlan, ComposeSvgArgs, ContentSize, CurveFieldProps, CurveMark, EffectCardListItem, EffectCardListProps, EffectCardProps, InstrumentSpec, LabContextValue, LabPaletteProps, LabProps, LabShellProps, MarkDrawOptions, MarkListProps, MarkStyle, PaintableMark, PaneSize, PanelDescriptor, PropertyGroupProps, SubpanelProps, TrialBodyProps, TrialChromeProps, TrialLayout, TrialProps, UndoBindings, ValidationResult, ViewTransform2D, WorkspaceProps };
1232
+ export { ANNOTATION_TOOLS, ANNOTATION_WEASEL_TOOLS, AnnotationData, AnnotationKind, AnnotationMeaning, AnnotationOverlay, AnnotationTarget, AnnotationTargets, Annotations, AnnotationsApi, AnnotationsCapability, AnnotationsContext, BranchAnnotations, BranchOptions, CaptureOptions, CaptureResult, CaptureSource, ConfigBranch, ConfigEntry, ConfigField, ConfigNode, ConfigOption, ConfigRule, ConfigRuleContext, ConfigSchema, ConfigShape, ControlRenderer, CurveField, DEFAULT_VIEW, EffectCard, EffectCardList, ExportMenu, InferConfig, Instrument, InstrumentList, JobHandle, Lab, LabContext, LabMode, LabPalette, LabShell, LabSwitcher, LeafPatch, MarkList, MarkScene, NodeOptions, PropertyGroup, PropertyListPack, ResolvedConfig, SavedSnapshot, StorageAdapter, Subpanel, Trial, TrialBody, TrialChrome, TrialContribution, TrialInfo, TrialRecord, TrialTool, ViewTransform, Workspace, WorldRect, addTrial, annotationToolInfo, applyRules, as2DView, builtinRules, capturePlan, captureTarget, cloneTrial, closeTrial, composeCaptureSvg, createMarkDrawOne, currentPage, defineInstrument, f, fillConfigDefaults, fitView, fromConfigFields, fromWeaselView, hasConfigPath, interstellarTheme, isConfigBranch, isLeafVisible, isStale, markCommands, markSvgNodes, reorderTrials, resetTrial, resolveConfigSchema, resolveMarkStyle, schemaNodeAtPath, seenFrom, titleCase, toWeaselView, useAnnotations, useAnnotationsOptional, useConfigSchema, useLabContext, validateConfigSchema, valueAtPath, withValueAtPath };
1233
+ export type { AddTrialOptions, AnnotationOverlayProps, AnnotationTargetsProps, AnnotationToolInfo, CaptureArgs, CapturePlan, ComposeSvgArgs, ContentSize, CurveFieldProps, CurveMark, EffectCardListItem, EffectCardListProps, EffectCardProps, InstrumentSpec, LabContextValue, LabPage, LabPaletteProps, LabProps, LabShellProps, LabSwitcherProps, MarkDrawOptions, MarkListProps, MarkStyle, PaintableMark, PaneSize, PanelDescriptor, PropertyGroupProps, SubpanelProps, TrialBodyProps, TrialChromeProps, TrialLayout, TrialProps, UndoBindings, ValidationResult, ViewTransform2D, WorkspaceProps };