@weasel-js/labkit 1.4.0-pre.1 → 1.4.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.
Files changed (95) hide show
  1. package/dist/_dts/{CanvasStackContext-LnCfqNBA.d.ts → CanvasStackContext-D6M0o8cQ.d.ts} +1 -1
  2. package/dist/_dts/{frac-C-2c72Ij.d.ts → frac-QS7XzvpG.d.ts} +2 -2
  3. package/dist/_dts/{index-BDVzvRzQ.d.ts → index-B2X21G1c.d.ts} +8 -2
  4. package/dist/_dts/{types-D6s4b7if.d.ts → types-C1Zw7s5P.d.ts} +1 -0
  5. package/dist/_dts/{types-DYMaEvM5.d.ts → types-ChVJJHvk.d.ts} +3 -0
  6. package/dist/_dts/{useTrialState-gmMvZqPc.d.ts → useTrialState-Cdm13fvl.d.ts} +2 -1
  7. package/dist/canvas/index.d.ts +6 -6
  8. package/dist/canvas/index.js +2 -2
  9. package/dist/chrome/index.d.ts +4 -4
  10. package/dist/chrome/index.js +5 -5
  11. package/dist/chunk-2YILQ7Y5.js +33 -0
  12. package/dist/chunk-2YILQ7Y5.js.map +1 -0
  13. package/dist/{chunk-QB5SM4BM.js → chunk-4AMN4MMB.js} +5 -5
  14. package/dist/{chunk-QB5SM4BM.js.map → chunk-4AMN4MMB.js.map} +1 -1
  15. package/dist/{chunk-L5QJOOLV.js → chunk-7VW3S44V.js} +512 -56
  16. package/dist/chunk-7VW3S44V.js.map +1 -0
  17. package/dist/{chunk-ESIQNQ6K.js → chunk-B5VWJBWM.js} +12 -6
  18. package/dist/chunk-B5VWJBWM.js.map +1 -0
  19. package/dist/{chunk-RBGKL7NF.js → chunk-L5WBGUVR.js} +1664 -1628
  20. package/dist/chunk-L5WBGUVR.js.map +1 -0
  21. package/dist/{chunk-XJ6N32QP.js → chunk-LJSIUFYD.js} +14 -30
  22. package/dist/chunk-LJSIUFYD.js.map +1 -0
  23. package/dist/{chunk-HHGVISVZ.js → chunk-QR5V3AFG.js} +6 -4
  24. package/dist/chunk-QR5V3AFG.js.map +1 -0
  25. package/dist/{chunk-6OEYTYML.js → chunk-UD7TEHZT.js} +15 -15
  26. package/dist/chunk-UD7TEHZT.js.map +1 -0
  27. package/dist/{chunk-HMFODCOX.js → chunk-VHFQKAUL.js} +3 -3
  28. package/dist/{chunk-HMFODCOX.js.map → chunk-VHFQKAUL.js.map} +1 -1
  29. package/dist/{chunk-TO2FUOKF.js → chunk-W3KSUXXR.js} +16 -13
  30. package/dist/chunk-W3KSUXXR.js.map +1 -0
  31. package/dist/{chunk-AE5CNVRU.js → chunk-XCBCZEBO.js} +3 -3
  32. package/dist/{chunk-AE5CNVRU.js.map → chunk-XCBCZEBO.js.map} +1 -1
  33. package/dist/{chunk-E2UQVZ44.js → chunk-Y2HK44TG.js} +3 -3
  34. package/dist/{chunk-E2UQVZ44.js.map → chunk-Y2HK44TG.js.map} +1 -1
  35. package/dist/{chunk-M75ZU6ZZ.js → chunk-YQGQUBKA.js} +3 -3
  36. package/dist/{chunk-M75ZU6ZZ.js.map → chunk-YQGQUBKA.js.map} +1 -1
  37. package/dist/controls/index.d.ts +2 -2
  38. package/dist/controls/index.js +3 -3
  39. package/dist/dragdrop/index.d.ts +3 -3
  40. package/dist/dragdrop/index.js +2 -2
  41. package/dist/index.d.ts +55 -12
  42. package/dist/index.js +306 -159
  43. package/dist/index.js.map +1 -1
  44. package/dist/layers/index.d.ts +4 -4
  45. package/dist/layers/index.js +3 -3
  46. package/dist/loupe/index.d.ts +5 -5
  47. package/dist/loupe/index.js +2 -2
  48. package/dist/passthrough/weasel-canvas.js +1 -1
  49. package/dist/passthrough/weasel-ui.d.ts +336 -15
  50. package/dist/passthrough/weasel-ui.js +2 -2
  51. package/dist/primitives/index.js +4 -4
  52. package/dist/state/index.d.ts +3 -3
  53. package/dist/state/index.js +4 -2
  54. package/dist/state/index.js.map +1 -1
  55. package/dist/styles.css +64 -5
  56. package/dist/surface/index.d.ts +17 -2
  57. package/dist/surface/index.js +3 -2
  58. package/dist/ui/layers/index.js +2 -2
  59. package/dist/undo/index.d.ts +3 -3
  60. package/package.json +8 -8
  61. package/src/annotations/AnnotationOverlay.tsx +10 -6
  62. package/src/annotations/Annotations.less +6 -0
  63. package/src/annotations/Annotations.overlay.test.tsx +113 -0
  64. package/src/annotations/MarkList.tsx +3 -2
  65. package/src/config/builder.test.ts +5 -0
  66. package/src/config/builder.ts +6 -0
  67. package/src/config/types.ts +1 -0
  68. package/src/controls/ControlPanel.test.tsx +23 -0
  69. package/src/controls/ControlPanel.tsx +3 -0
  70. package/src/lab/Lab.surface.test.tsx +8 -3
  71. package/src/lab/LabHeader.test.tsx +12 -0
  72. package/src/lab/LabHeader.tsx +16 -6
  73. package/src/passthrough/weasel-ui.test.ts +9 -0
  74. package/src/passthrough/weasel-ui.ts +4 -0
  75. package/src/primitives/ZoomControl.tsx +2 -0
  76. package/src/state/store.ts +10 -0
  77. package/src/state/types.ts +3 -0
  78. package/src/surface/AGENTS.md +11 -1
  79. package/src/surface/index.ts +7 -1
  80. package/src/surface/useSurfaceTile.ts +20 -2
  81. package/src/surface/useTiledSurface.ts +4 -1
  82. package/src/theme/Interstellar.stories.tsx +4 -3
  83. package/src/theme/base.less +39 -1
  84. package/src/trial/Trial.less +27 -5
  85. package/src/trial/TrialBody.test.tsx +67 -0
  86. package/src/trial/TrialBody.tsx +155 -0
  87. package/src/trial/TrialChrome.tsx +18 -10
  88. package/src/trial/index.ts +2 -0
  89. package/dist/chunk-6OEYTYML.js.map +0 -1
  90. package/dist/chunk-ESIQNQ6K.js.map +0 -1
  91. package/dist/chunk-HHGVISVZ.js.map +0 -1
  92. package/dist/chunk-L5QJOOLV.js.map +0 -1
  93. package/dist/chunk-RBGKL7NF.js.map +0 -1
  94. package/dist/chunk-TO2FUOKF.js.map +0 -1
  95. package/dist/chunk-XJ6N32QP.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { E as LayerDescriptor } from '../_dts/frac-C-2c72Ij.js';
2
- export { B as LayerCapability } from '../_dts/frac-C-2c72Ij.js';
1
+ import { E as LayerDescriptor } from '../_dts/frac-QS7XzvpG.js';
2
+ export { B as LayerCapability } from '../_dts/frac-QS7XzvpG.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import 'react';
5
- import '../_dts/types-D6s4b7if.js';
5
+ import '../_dts/types-C1Zw7s5P.js';
6
6
  import '../_dts/PrefsForm-BkUJZx0A.js';
7
- import '../_dts/types-DYMaEvM5.js';
7
+ import '../_dts/types-ChVJJHvk.js';
8
8
  import '../_dts/types-DJ79Tg5J.js';
9
9
  import '../_dts/types-C-gh9Ap-.js';
10
10
 
@@ -1,6 +1,6 @@
1
- export { LayerList } from '../chunk-AE5CNVRU.js';
1
+ export { LayerList } from '../chunk-XCBCZEBO.js';
2
2
  import '../chunk-SBXNQW4G.js';
3
- import '../chunk-RBGKL7NF.js';
4
- import '../chunk-L5QJOOLV.js';
3
+ import '../chunk-L5WBGUVR.js';
4
+ import '../chunk-7VW3S44V.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ae as LoupeMode, V as ViewTransform, W as WorldFrame, c as WorldSpec, a2 as ViewportSize, K as LoupeRenderArgs, N as ResolvedLoupe } from '../_dts/frac-C-2c72Ij.js';
3
- export { L as LOUPE_DEFAULTS, G as LoupeCapability, J as LoupeDeclaration, ab as resolveLoupe } from '../_dts/frac-C-2c72Ij.js';
4
- import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-LnCfqNBA.js';
2
+ import { ae as LoupeMode, V as ViewTransform, W as WorldFrame, c as WorldSpec, a2 as ViewportSize, K as LoupeRenderArgs, N as ResolvedLoupe } from '../_dts/frac-QS7XzvpG.js';
3
+ export { L as LOUPE_DEFAULTS, G as LoupeCapability, J as LoupeDeclaration, ab as resolveLoupe } from '../_dts/frac-QS7XzvpG.js';
4
+ import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-D6M0o8cQ.js';
5
5
  import { RefObject, ReactNode } from 'react';
6
- import '../_dts/types-D6s4b7if.js';
6
+ import '../_dts/types-C1Zw7s5P.js';
7
7
  import '../_dts/PrefsForm-BkUJZx0A.js';
8
- import '../_dts/types-DYMaEvM5.js';
8
+ import '../_dts/types-ChVJJHvk.js';
9
9
  import '../_dts/types-DJ79Tg5J.js';
10
10
  import '../_dts/types-C-gh9Ap-.js';
11
11
 
@@ -1,7 +1,7 @@
1
- export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-E2UQVZ44.js';
1
+ export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-Y2HK44TG.js';
2
2
  import '../chunk-CTRKTLYZ.js';
3
3
  import '../chunk-2AYGEN57.js';
4
4
  import '../chunk-CQLQPQ4P.js';
5
- import '../chunk-L5QJOOLV.js';
5
+ import '../chunk-7VW3S44V.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '../chunk-L5QJOOLV.js';
1
+ export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '../chunk-7VW3S44V.js';
2
2
  //# sourceMappingURL=weasel-canvas.js.map
3
3
  //# sourceMappingURL=weasel-canvas.js.map
@@ -1,6 +1,6 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { T as ToolPrefLeaf, a as ToolPrefGroup } from '../_dts/PrefsForm-BkUJZx0A.js';
2
3
  export { b as BuiltinPref, c as PrefBoolean, d as PrefBooleanControl, e as PrefColor, f as PrefCustom, g as PrefEnum, h as PrefEnumControl, i as PrefEnumEncoding, j as PrefKind, k as PrefNumber, l as PrefNumberControl, m as PrefNumberUnit, n as PrefObject, o as PrefPaint, p as PrefRenderContext, P as PrefRenderer, q as PrefString, r as PrefStringControl } from '../_dts/PrefsForm-BkUJZx0A.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { MutableRefObject, ReactNode, CSSProperties, ButtonHTMLAttributes, ReactElement, KeyboardEvent, RefObject, PointerEvent as PointerEvent$1, RefCallback } from 'react';
6
6
  export { LayerStack, LayerStackItem, LayerStackProps } from '../ui/layers/index.js';
@@ -44,6 +44,101 @@ declare function isDebugEnabled(namespace: string): boolean;
44
44
  * Each call is prefixed with `[namespace]` so the source is searchable. */
45
45
  declare function dlog(namespace: string, ...args: unknown[]): void;
46
46
 
47
+ declare const ICON_PATHS: {
48
+ readonly clone: "<path d=\"M7 7.4V4.6A1.6 1.6 0 0 1 8.6 3h6.8A1.6 1.6 0 0 1 17 4.6v6.8a1.6 1.6 0 0 1-1.6 1.6H12.6\" stroke-linecap=\"butt\"/><rect x=\"3\" y=\"7\" width=\"10\" height=\"10\" rx=\"1.6\"/><path d=\"M5.7 10.8h4.6M5.7 13.4h3\" stroke-width=\"1\"/>";
49
+ readonly reset: "<path d=\"M7.28 4.88A5.8 5.8 0 1 0 12.72 4.88\"/><path d=\"M13.81 7.57 12.72 4.88 15.56 4.28\"/>";
50
+ readonly close: "<path d=\"M5 5 15 15M15 5 5 15\" stroke-width=\"1.75\"/>";
51
+ readonly export: "<path d=\"M4 12.6v2.9A1.5 1.5 0 0 0 5.5 17h9a1.5 1.5 0 0 0 1.5-1.5v-2.9\"/><path d=\"M10 3.2v8.5\"/><path d=\"M11.7 9.35 10 11.7 8.3 9.35\"/><path d=\"M6.8 14.7h6.4\" stroke-width=\"1\"/>";
52
+ readonly zoomIn: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M9 6.7v4.6M6.7 9h4.6\"/>";
53
+ readonly pan: "<path d=\"M10 8.1V3.2M10 11.9V16.8M8.1 10H3.2M11.9 10H16.8\"/><path d=\"M8.26 5.27 10 3.2 11.74 5.27M11.74 14.73 10 16.8 8.26 14.73M5.27 11.74 3.2 10 5.27 8.26M14.73 8.26 16.8 10 14.73 11.74\"/><circle cx=\"10\" cy=\"10\" r=\"1.9\"/>";
54
+ readonly add: "<path d=\"M10 4.9v10.2M4.9 10h10.2\"/>";
55
+ readonly remove: "<path d=\"M4.9 10h10.2\"/>";
56
+ readonly delete: "<path d=\"M3.6 5.8h12.8M8 5.8V4.5A1.1 1.1 0 0 1 9.1 3.4h1.8A1.1 1.1 0 0 1 12 4.5v1.3\"/><path d=\"M5.2 5.8v9.6A1.6 1.6 0 0 0 6.8 17h6.4a1.6 1.6 0 0 0 1.6-1.6V5.8\"/><path d=\"M8.4 8.8v5.2M11.6 8.8v5.2\" stroke-width=\"1\"/>";
57
+ readonly sort: "<path d=\"M3.6 5.6h7.2M3.6 10h8.8M3.6 14.4h5\"/><path d=\"M15.3 5.4v9.4\"/><path d=\"M16.97 12.81 15.3 14.8 13.63 12.81\"/>";
58
+ readonly undo: "<path d=\"M4.4 8.4h6.8a3.6 3.6 0 0 1 0 7.2H8.6\"/><path d=\"M6.47 10.14 4.4 8.4 6.47 6.66\"/>";
59
+ readonly redo: "<path d=\"M15.6 8.4H8.8a3.6 3.6 0 0 0 0 7.2H11.4\"/><path d=\"M13.53 6.66 15.6 8.4 13.53 10.14\"/>";
60
+ readonly zoomOut: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M6.7 9h4.6\"/>";
61
+ readonly fit: "<path d=\"M3.2 7.2V4.4A1.2 1.2 0 0 1 4.4 3.2h2.8M12.8 3.2h2.8A1.2 1.2 0 0 1 16.8 4.4v2.8M16.8 12.8v2.8a1.2 1.2 0 0 1-1.2 1.2h-2.8M7.2 16.8H4.4a1.2 1.2 0 0 1-1.2-1.2v-2.8\"/><rect x=\"7.4\" y=\"8.2\" width=\"5.2\" height=\"3.6\" rx=\"0.8\" stroke-width=\"1\"/>";
62
+ readonly snapshot: "<path d=\"M3.8 8.3A1.4 1.4 0 0 1 5.2 6.9h1.9L8 5.1h4l.9 1.8h1.9A1.4 1.4 0 0 1 16.2 8.3v6A1.4 1.4 0 0 1 14.8 15.7H5.2A1.4 1.4 0 0 1 3.8 14.3z\"/><circle cx=\"10\" cy=\"11\" r=\"2.75\"/>";
63
+ readonly play: "<path d=\"M7.6 5.2 15.6 10 7.6 14.8Z\"/>";
64
+ readonly pause: "<path d=\"M7.8 5.2v9.6M12.2 5.2v9.6\"/>";
65
+ readonly stop: "<rect x=\"5.6\" y=\"5.6\" width=\"8.8\" height=\"8.8\" rx=\"1.4\"/>";
66
+ readonly step: "<path d=\"M6.4 5.4 13 10 6.4 14.6Z\"/><path d=\"M15.2 5.4v9.2\"/>";
67
+ readonly crosshair: "<circle cx=\"10\" cy=\"10\" r=\"5.6\"/><path d=\"M10 2.8v4.4M10 12.8v4.4M2.8 10h4.4M12.8 10h4.4\"/>";
68
+ readonly fullscreen: "<path d=\"M11.6 3.6h4.8v4.8M8.4 16.4H3.6v-4.8\"/><path d=\"M16.4 3.6 11.2 8.8M3.6 16.4 8.8 11.2\"/>";
69
+ readonly compare: "<rect x=\"3.4\" y=\"4.6\" width=\"13.2\" height=\"10.8\" rx=\"1.6\"/><path d=\"M10 4.6v10.8\" stroke-width=\"1\"/><path d=\"M5.2 7.6h3.4M5.2 10h2.6M5.2 12.4h3.4\" stroke-width=\"1\"/><path d=\"M11.4 7.6h3.4M11.4 10h3.4M11.4 12.4h1.8\" stroke-width=\"1\"/>";
70
+ readonly filter: "<path d=\"M3.4 4.6h13.2L11.8 11v5.4L8.2 14.8V11z\"/>";
71
+ readonly search: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/>";
72
+ readonly loupe: "<circle cx=\"9\" cy=\"9\" r=\"5.6\"/><path d=\"M12.96 12.96 17 17\"/><rect x=\"6\" y=\"6\" width=\"6\" height=\"6\" stroke-width=\"1\"/><path d=\"M9 6v6M6 9h6\" stroke-width=\"1\"/>";
73
+ readonly layers: "<path d=\"M10 2.8 17.2 6.6 10 10.4 2.8 6.6z\"/><path d=\"M2.8 10 10 13.8 17.2 10\" stroke-width=\"1\"/><path d=\"M2.8 13.4 10 17.2 17.2 13.4\" stroke-width=\"1\"/>";
74
+ readonly lock: "<rect x=\"4.6\" y=\"9\" width=\"10.8\" height=\"8\" rx=\"1.6\"/><path d=\"M7.2 9V6.6a2.8 2.8 0 0 1 5.6 0V9\"/>";
75
+ readonly unlock: "<rect x=\"4.6\" y=\"9\" width=\"10.8\" height=\"8\" rx=\"1.6\"/><path d=\"M7.2 9V6.6a2.8 2.8 0 0 1 5.6 0\"/>";
76
+ readonly visible: "<path d=\"M2.6 10C4.6 6.6 7.1 5 10 5s5.4 1.6 7.4 5c-2 3.4-4.5 5-7.4 5s-5.4-1.6-7.4-5z\"/><circle cx=\"10\" cy=\"10\" r=\"2.2\"/>";
77
+ readonly hidden: "<path d=\"M2.6 10C4.6 6.6 7.1 5 10 5s5.4 1.6 7.4 5c-2 3.4-4.5 5-7.4 5s-5.4-1.6-7.4-5z\"/><circle cx=\"10\" cy=\"10\" r=\"2.2\"/><path d=\"M4.2 15.8 15.8 4.2\"/>";
78
+ readonly pin: "<path d=\"M8.2 3.4v5.2l-2 2.6h7.6l-2-2.6V3.4z\"/><path d=\"M7 3.4h6\"/><path d=\"M10 11.2v5.4\"/>";
79
+ readonly link: "<path d=\"M8.6 11.4a3.4 3.4 0 0 1 0-4.8l2.2-2.2a3.4 3.4 0 0 1 4.8 4.8l-1.1 1.1\"/><path d=\"M11.4 8.6a3.4 3.4 0 0 1 0 4.8l-2.2 2.2a3.4 3.4 0 0 1-4.8-4.8l1.1-1.1\"/>";
80
+ readonly collapse: "<path d=\"M14.16 4.05 10 7.8 5.84 4.05M5.84 15.95 10 12.2 14.16 15.95\"/>";
81
+ readonly expand: "<path d=\"M5.84 8.15 10 4.4 14.16 8.15M14.16 11.85 10 15.6 5.84 11.85\"/>";
82
+ readonly chevron: "<path d=\"M14.9 7.98 10 12.4 5.1 7.98\"/>";
83
+ readonly tune: "<path d=\"M3.4 6h13.2M3.4 10h13.2M3.4 14h13.2\" stroke-width=\"1.25\"/><circle cx=\"7\" cy=\"6\" r=\"1.8\"/><circle cx=\"12.6\" cy=\"10\" r=\"1.8\"/><circle cx=\"9\" cy=\"14\" r=\"1.8\"/>";
84
+ readonly grid: "<rect x=\"3.4\" y=\"3.4\" width=\"13.2\" height=\"13.2\" rx=\"1.4\"/><path d=\"M7.8 3.4v13.2M12.2 3.4v13.2M3.4 7.8h13.2M3.4 12.2h13.2\" stroke-width=\"1\"/>";
85
+ readonly snap: "<path d=\"M5.4 15.6V9.4a4.6 4.6 0 0 1 9.2 0v6.2h-3.2V9.4a1.4 1.4 0 0 0-2.8 0v6.2z\"/><path d=\"M5.4 12.8h3.2M11.4 12.8h3.2\" stroke-width=\"1\"/>";
86
+ readonly measure: "<rect x=\"2.6\" y=\"7.4\" width=\"14.8\" height=\"5.2\" rx=\"1.2\"/><path d=\"M6 7.4v2.2M9.4 7.4v3M12.8 7.4v2.2\" stroke-width=\"1\"/>";
87
+ readonly randomize: "<rect x=\"3.6\" y=\"3.6\" width=\"12.8\" height=\"12.8\" rx=\"2\"/><circle cx=\"7.2\" cy=\"7.2\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"10\" cy=\"10\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12.8\" cy=\"12.8\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/>";
88
+ readonly refresh: "<path d=\"M4.27 12.09A6.1 6.1 0 0 1 14.67 6.08\"/><path d=\"M14.67 3.38 14.67 6.08 12.01 5.61\"/><path d=\"M15.73 7.91A6.1 6.1 0 0 1 5.33 13.92\"/><path d=\"M5.33 16.62 5.33 13.92 7.99 14.39\"/>";
89
+ readonly info: "<circle cx=\"10\" cy=\"10\" r=\"7\"/><path d=\"M10 9.4v4.4\"/><path d=\"M10 6.5h0\"/>";
90
+ readonly warning: "<path d=\"M10 3.4 17.4 16.2H2.6z\"/><path d=\"M10 8.4v3.4\"/><path d=\"M10 14h0\"/>";
91
+ readonly error: "<circle cx=\"10\" cy=\"10\" r=\"7\"/><path d=\"M7.6 7.6 12.4 12.4M12.4 7.6 7.6 12.4\"/>";
92
+ readonly busy: "<path d=\"M10 3.2A6.8 6.8 0 1 1 3.2 10\"/>";
93
+ readonly modeLight: "<circle cx=\"10\" cy=\"10\" r=\"3.5\"/><path d=\"M15.3 10L17.7 10M13.75 6.25L15.44 4.56M10 4.7L10 2.3M6.25 6.25L4.56 4.56M4.7 10L2.3 10M6.25 13.75L4.56 15.44M10 15.3L10 17.7M13.75 13.75L15.44 15.44\"/>";
94
+ readonly modeDark: "<path d=\"M8.19 3.55A6.7 6.7 0 1 0 16.45 11.81A5.9 5.9 0 0 1 8.19 3.55Z\"/>";
95
+ readonly modeAuto: "<path d=\"M10 2.6Q10 10 17.4 10Q10 10 10 17.4Q10 10 2.6 10Q10 10 10 2.6Z\"/>";
96
+ readonly strokeWidth: "<path d=\"M3.4 5.6h13.2\" stroke-width=\"1\"/><path d=\"M3.4 10h13.2\" stroke-width=\"2\"/><path d=\"M3.4 15.2h13.2\" stroke-width=\"3.4\"/>";
97
+ readonly strokeCap: "<path d=\"M2.5 10H12\" stroke-linecap=\"butt\"/><path d=\"M12 6V14\" stroke-width=\"1\"/>";
98
+ readonly strokeJoin: "<path d=\"M4.4 15.5 10 5.5 15.6 15.5\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\"/>";
99
+ readonly strokeAlign: "<circle cx=\"10\" cy=\"10\" r=\"6.2\"/>";
100
+ readonly capButt: "<path d=\"M5.5 5.25H14.5V14.75H5.5Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/>";
101
+ readonly capRound: "<path d=\"M3.13 5.25H12.13V14.75H3.13Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/><path d=\"M12.13 4.5A5.5 5.5 0 0 1 12.13 15.5Z\" fill=\"currentColor\" stroke=\"none\"/>";
102
+ readonly capSquare: "<path d=\"M3.13 5.25H12.13V14.75H3.13Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/><path d=\"M12.13 4.5H17.63V15.5H12.13Z\" fill=\"currentColor\" stroke=\"none\"/>";
103
+ readonly joinMiter: "<path d=\"M10 3.5 15.6 15.5H4.4Z\" fill=\"currentColor\" stroke=\"none\"/>";
104
+ readonly joinRound: "<path d=\"M4.4 15.5V12a5.6 5.6 0 0 1 11.2 0v3.5Z\" fill=\"currentColor\" stroke=\"none\"/>";
105
+ readonly joinBevel: "<path d=\"M6.8 8.2h6.4l2.4 7.3H4.4Z\" fill=\"currentColor\" stroke=\"none\"/>";
106
+ readonly alignInner: "<path d=\"M10 3.8A6.2 6.2 0 1 0 10 16.2A6.2 6.2 0 1 0 10 3.8Z\" fill=\"currentColor\" stroke=\"none\"/>";
107
+ readonly alignCenter: "<path d=\"M10 2.1A7.9 7.9 0 1 0 10 17.9A7.9 7.9 0 1 0 10 2.1ZM10 5.5A4.5 4.5 0 1 0 10 14.5A4.5 4.5 0 1 0 10 5.5Z\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"/>";
108
+ readonly alignOuter: "<path d=\"M0 0H20V20H0ZM10 3.8A6.2 6.2 0 1 0 10 16.2A6.2 6.2 0 1 0 10 3.8Z\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"/>";
109
+ readonly dashSolid: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\"/>";
110
+ readonly dashDashed: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"6 4\"/>";
111
+ readonly dashDotted: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"2.5 2\"/>";
112
+ readonly dashCustom: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"5 2 2 2\"/>";
113
+ readonly paintSolid: "<path d=\"M3.4 3.4H16.6V16.6H3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/>";
114
+ readonly paintLinear: "<path d=\"M3.4 3.4H6.7V16.6H3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/><path d=\"M6.7 3.4H10V16.6H6.7Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.68\"/><path d=\"M10 3.4H13.3V16.6H10Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.42\"/><path d=\"M13.3 3.4H16.6V16.6H13.3Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.2\"/>";
115
+ readonly paintRadial: "<path d=\"M3.4 3.4H16.6V16.6H3.4ZM4.95 4.95H15.05V15.05H4.95Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.7\"/><path d=\"M4.95 4.95H15.05V15.05H4.95ZM6.5 6.5H13.5V13.5H6.5Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.53\"/><path d=\"M6.5 6.5H13.5V13.5H6.5ZM8.05 8.05H11.95V11.95H8.05Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.37\"/><path d=\"M8.05 8.05H11.95V11.95H8.05Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.2\"/>";
116
+ readonly paintConic: "<path d=\"M10 10L16.6 3.4L16.6 16.6Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/><path d=\"M10 10L16.6 16.6L3.4 16.6Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.68\"/><path d=\"M10 10L3.4 16.6L3.4 3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.42\"/><path d=\"M10 10L3.4 3.4L16.6 3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.2\"/>";
117
+ readonly paintPattern: "<path d=\"M3.4 3.4L4.7 3.4L3.4 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M8.7 3.4L11.3 3.4L3.4 11.3L3.4 8.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M15.3 3.4L16.6 3.4L16.6 4.7L4.7 16.6L3.4 16.6L3.4 15.3Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M16.6 8.7L16.6 11.3L11.3 16.6L8.7 16.6Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M16.6 15.3L16.6 16.6L15.3 16.6Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M15.3 3.4L16.6 3.4L16.6 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M8.7 3.4L11.3 3.4L16.6 8.7L16.6 11.3Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M3.4 3.4L4.7 3.4L16.6 15.3L16.6 16.6L15.3 16.6L3.4 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M11.3 16.6L8.7 16.6L3.4 11.3L3.4 8.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M4.7 16.6L3.4 16.6L3.4 15.3Z\" fill=\"currentColor\" stroke=\"none\"/>";
118
+ readonly paintNone: "<path d=\"M3.4 3.4H16.6V16.6H3.4Z\"/><path d=\"M3.4 16.6L16.6 3.4\" stroke=\"var(--wzl-danger, #d94a3f)\" stroke-width=\"1.8\" stroke-linecap=\"butt\"/>";
119
+ readonly layoutRows: "<rect x=\"3.4\" y=\"3.4\" width=\"13.2\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"3.4\" y=\"8.3\" width=\"13.2\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"3.4\" y=\"13.2\" width=\"13.2\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/>";
120
+ readonly layoutColumns: "<rect x=\"3.4\" y=\"3.4\" width=\"3.4\" height=\"13.2\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"8.3\" y=\"3.4\" width=\"3.4\" height=\"13.2\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"13.2\" y=\"3.4\" width=\"3.4\" height=\"13.2\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/>";
121
+ readonly layoutGrid: "<rect x=\"3.4\" y=\"3.4\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"8.3\" y=\"3.4\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"13.2\" y=\"3.4\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"3.4\" y=\"8.3\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"8.3\" y=\"8.3\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"13.2\" y=\"8.3\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"3.4\" y=\"13.2\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"8.3\" y=\"13.2\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/><rect x=\"13.2\" y=\"13.2\" width=\"3.4\" height=\"3.4\" rx=\"1\" fill=\"currentColor\" stroke=\"none\"/>";
122
+ };
123
+ /** Every glyph name in the set. */
124
+ type IconName = keyof typeof ICON_PATHS;
125
+
126
+ /** Shared prop shape for the icon set. Color comes from the surrounding
127
+ * `color` CSS property — every glyph strokes in `currentColor`. */
128
+ interface IconProps {
129
+ className?: string;
130
+ /** Rendered pixel size, applied to both width and height. Defaults to 20. */
131
+ size?: number;
132
+ /** Accessible name. Omit inside a button that already labels itself; the
133
+ * glyph is then `aria-hidden`. */
134
+ label?: string;
135
+ }
136
+ /** Renders one glyph by name. The named components below are the usual way
137
+ * in; reach for this when the glyph is chosen at runtime. */
138
+ declare function Icon({ name, className, size, label }: IconProps & {
139
+ name: IconName;
140
+ }): react_jsx_runtime.JSX.Element;
141
+
47
142
  /**
48
143
  * 2D affine transforms in canvas/DOMMatrix order: [a, b, c, d, e, f].
49
144
  * x' = a·x + c·y + e
@@ -76,6 +171,224 @@ interface ModifierState {
76
171
  ctrl: boolean;
77
172
  }
78
173
 
174
+ declare const GLYPHS: {
175
+ readonly pencil: {
176
+ readonly box: 24;
177
+ readonly hotspot: readonly [5, 19];
178
+ readonly paths: readonly [{
179
+ readonly role: "ink";
180
+ readonly d: "M 5 19 L 7.5 16.5 L 16 8 L 19 11 L 10.5 19.5 L 8 19 Z";
181
+ }, {
182
+ readonly role: "detail";
183
+ readonly d: "M 14 6 L 19 11";
184
+ readonly width: 1.2;
185
+ }];
186
+ };
187
+ readonly pen: {
188
+ readonly box: 24;
189
+ readonly hotspot: readonly [5, 19];
190
+ readonly paths: readonly [{
191
+ readonly role: "ink";
192
+ readonly d: "M 5 19 L 8.5 9.5 L 13 5 L 18 10 L 13.5 14.5 Z";
193
+ }, {
194
+ readonly role: "detail";
195
+ readonly d: "M 8.4 13.9 L 12.2 10.1";
196
+ readonly width: 0.9;
197
+ }];
198
+ };
199
+ readonly eyedropper: {
200
+ readonly box: 24;
201
+ readonly hotspot: readonly [5, 19];
202
+ readonly paths: readonly [{
203
+ readonly role: "ink";
204
+ readonly d: "M 5 19 L 6.8 14.8 L 14.4 7.2 L 16.8 9.6 L 9.2 17.2 Z";
205
+ }, {
206
+ readonly role: "ink";
207
+ readonly d: "M 18.2 2.6 A 3.2 3.2 0 1 0 18.2 9 A 3.2 3.2 0 1 0 18.2 2.6 Z";
208
+ }];
209
+ };
210
+ readonly brush: {
211
+ readonly box: 24;
212
+ readonly hotspot: readonly [12, 12];
213
+ readonly radius: 9.9;
214
+ readonly paths: readonly [{
215
+ readonly role: "stroke";
216
+ readonly d: "M 12 2.1 A 9.9 9.9 0 1 0 12 21.9 A 9.9 9.9 0 1 0 12 2.1 Z";
217
+ readonly width: 1.6;
218
+ }];
219
+ };
220
+ readonly crosshairRect: {
221
+ readonly box: 24;
222
+ readonly hotspot: readonly [9, 9];
223
+ readonly paths: readonly [{
224
+ readonly role: "stroke";
225
+ readonly d: "M 1.6 9 L 6.4 9";
226
+ readonly width: 1.6;
227
+ }, {
228
+ readonly role: "stroke";
229
+ readonly d: "M 11.6 9 L 16.4 9";
230
+ readonly width: 1.6;
231
+ }, {
232
+ readonly role: "stroke";
233
+ readonly d: "M 9 1.6 L 9 6.4";
234
+ readonly width: 1.6;
235
+ }, {
236
+ readonly role: "stroke";
237
+ readonly d: "M 9 11.6 L 9 16.4";
238
+ readonly width: 1.6;
239
+ }, {
240
+ readonly role: "ink";
241
+ readonly d: "M 14.2 14.2 L 21 14.2 L 21 21 L 14.2 21 Z";
242
+ }];
243
+ };
244
+ readonly crosshairEllipse: {
245
+ readonly box: 24;
246
+ readonly hotspot: readonly [9, 9];
247
+ readonly paths: readonly [{
248
+ readonly role: "stroke";
249
+ readonly d: "M 1.6 9 L 6.4 9";
250
+ readonly width: 1.6;
251
+ }, {
252
+ readonly role: "stroke";
253
+ readonly d: "M 11.6 9 L 16.4 9";
254
+ readonly width: 1.6;
255
+ }, {
256
+ readonly role: "stroke";
257
+ readonly d: "M 9 1.6 L 9 6.4";
258
+ readonly width: 1.6;
259
+ }, {
260
+ readonly role: "stroke";
261
+ readonly d: "M 9 11.6 L 9 16.4";
262
+ readonly width: 1.6;
263
+ }, {
264
+ readonly role: "ink";
265
+ readonly d: "M 17.6 13.9 A 3.7 3.7 0 1 0 17.6 21.3 A 3.7 3.7 0 1 0 17.6 13.9 Z";
266
+ }];
267
+ };
268
+ readonly crosshairLine: {
269
+ readonly box: 24;
270
+ readonly hotspot: readonly [9, 9];
271
+ readonly paths: readonly [{
272
+ readonly role: "stroke";
273
+ readonly d: "M 1.6 9 L 6.4 9";
274
+ readonly width: 1.6;
275
+ }, {
276
+ readonly role: "stroke";
277
+ readonly d: "M 11.6 9 L 16.4 9";
278
+ readonly width: 1.6;
279
+ }, {
280
+ readonly role: "stroke";
281
+ readonly d: "M 9 1.6 L 9 6.4";
282
+ readonly width: 1.6;
283
+ }, {
284
+ readonly role: "stroke";
285
+ readonly d: "M 9 11.6 L 9 16.4";
286
+ readonly width: 1.6;
287
+ }, {
288
+ readonly role: "stroke";
289
+ readonly d: "M 14.2 21 L 21 14.2";
290
+ readonly width: 2.2;
291
+ }];
292
+ };
293
+ readonly crosshairStar: {
294
+ readonly box: 24;
295
+ readonly hotspot: readonly [9, 9];
296
+ readonly paths: readonly [{
297
+ readonly role: "stroke";
298
+ readonly d: "M 1.6 9 L 6.4 9";
299
+ readonly width: 1.6;
300
+ }, {
301
+ readonly role: "stroke";
302
+ readonly d: "M 11.6 9 L 16.4 9";
303
+ readonly width: 1.6;
304
+ }, {
305
+ readonly role: "stroke";
306
+ readonly d: "M 9 1.6 L 9 6.4";
307
+ readonly width: 1.6;
308
+ }, {
309
+ readonly role: "stroke";
310
+ readonly d: "M 9 11.6 L 9 16.4";
311
+ readonly width: 1.6;
312
+ }, {
313
+ readonly role: "ink";
314
+ readonly d: "M 17.6 13.4 L 18.72 16.06 L 21.59 16.3 L 19.41 18.19 L 20.07 21 L 17.6 19.5 L 15.13 21 L 15.79 18.19 L 13.61 16.3 L 16.48 16.06 Z";
315
+ }];
316
+ };
317
+ readonly crosshairPolygon: {
318
+ readonly box: 24;
319
+ readonly hotspot: readonly [9, 9];
320
+ readonly paths: readonly [{
321
+ readonly role: "stroke";
322
+ readonly d: "M 1.6 9 L 6.4 9";
323
+ readonly width: 1.6;
324
+ }, {
325
+ readonly role: "stroke";
326
+ readonly d: "M 11.6 9 L 16.4 9";
327
+ readonly width: 1.6;
328
+ }, {
329
+ readonly role: "stroke";
330
+ readonly d: "M 9 1.6 L 9 6.4";
331
+ readonly width: 1.6;
332
+ }, {
333
+ readonly role: "stroke";
334
+ readonly d: "M 9 11.6 L 9 16.4";
335
+ readonly width: 1.6;
336
+ }, {
337
+ readonly role: "ink";
338
+ readonly d: "M 17.6 13.5 L 21.5 16.33 L 20.01 20.92 L 15.19 20.92 L 13.7 16.33 Z";
339
+ }];
340
+ };
341
+ readonly resize: {
342
+ readonly box: 24;
343
+ readonly hotspot: readonly [12, 12];
344
+ readonly paths: readonly [{
345
+ readonly role: "ink";
346
+ readonly d: "M 2.5 12 L 7 8.8 L 7 10.7 L 17 10.7 L 17 8.8 L 21.5 12 L 17 15.2 L 17 13.3 L 7 13.3 L 7 15.2 Z";
347
+ }];
348
+ };
349
+ readonly rotate: {
350
+ readonly box: 24;
351
+ readonly hotspot: readonly [12, 12];
352
+ readonly paths: readonly [{
353
+ readonly role: "stroke";
354
+ readonly d: "M 5.8 9.74 A 6.6 6.6 0 0 1 18.2 9.74";
355
+ readonly width: 2.8;
356
+ }, {
357
+ readonly role: "ink";
358
+ readonly d: "M 4.22 14.07 L 2.98 8.72 L 8.62 10.77 Z";
359
+ }, {
360
+ readonly role: "ink";
361
+ readonly d: "M 19.78 14.07 L 15.38 10.77 L 21.02 8.72 Z";
362
+ }];
363
+ };
364
+ };
365
+ /** Every glyph name in the set. */
366
+ type CursorGlyphName = keyof typeof GLYPHS;
367
+
368
+ /**
369
+ * What a tool, action or affordance declares as its cursor.
370
+ *
371
+ * A bare string is a CSS cursor value and passes through untouched, so every
372
+ * declaration written before this type existed keeps working.
373
+ */
374
+ type CursorSpec = string | CursorGlyphSpec;
375
+ /** The glyph form of a {@link CursorSpec}. */
376
+ interface CursorGlyphSpec {
377
+ readonly glyph: CursorGlyphName;
378
+ /** Rendered size in CSS px. Default 24. */
379
+ readonly size?: number;
380
+ /**
381
+ * Size in world units instead of `size`, so the glyph tracks zoom — a brush
382
+ * radius ring. Forces the painted tier at every zoom level, because a baked
383
+ * image would have to be rebuilt on every wheel tick.
384
+ */
385
+ readonly worldRadius?: number;
386
+ /** Clockwise rotation in radians, quantized to 22.5° at bake. */
387
+ readonly angle?: number;
388
+ /** Keyword drawn if the browser rejects the image. Default 'default'. */
389
+ readonly fallback?: string;
390
+ }
391
+
79
392
  /**
80
393
  * @experimental
81
394
  * Result of an affordance hit — what the region computed about itself.
@@ -102,9 +415,9 @@ interface AffordanceBinding<TScratch = unknown> {
102
415
  * outright.
103
416
  */
104
417
  interface LayerHit<TScratch = unknown> extends AffordanceBinding<TScratch> {
105
- /** CSS cursor while the pointer is over this hit. Reaches the hover-cursor
418
+ /** Cursor while the pointer is over this hit. Reaches the hover-cursor
106
419
  * pump as `AffordanceHit.cursor`, the same path kit chrome uses. */
107
- cursor?: string;
420
+ cursor?: CursorSpec;
108
421
  /** `'exclusive'` bars every binding whose target doesn't consult the
109
422
  * affordance. Omitted means `'shared'` — today's behavior. Same name and
110
423
  * meaning as `AffordanceHit.strength`, which it becomes. */
@@ -1091,11 +1404,11 @@ interface AffordanceHit {
1091
1404
  * Other affordance kinds (rotate-handle, anchor:N, controlIn:N, controlOut:N)
1092
1405
  * leave this undefined. */
1093
1406
  anchor?: ResizeAnchor;
1094
- /** CSS cursor to show while the pointer hovers this affordance (no
1407
+ /** Cursor to show while the pointer hovers this affordance (no
1095
1408
  * gesture in flight). Consumed by the hover-cursor pump in
1096
1409
  * `useGestureDispatcher`; unset = the pump falls through to
1097
1410
  * action-cursor prediction, then to the active tool's cursor. */
1098
- cursor?: string;
1411
+ cursor?: CursorSpec;
1099
1412
  /**
1100
1413
  * Free-form payload from whatever produced the hit, carried through to the
1101
1414
  * matching action untouched.
@@ -1397,10 +1710,9 @@ interface OngoingHandle {
1397
1710
  * async side-effect; the registry doesn't wait). */
1398
1711
  interface ImmediateInvoker {
1399
1712
  timing: 'immediate';
1400
- /** `params` carries the matched binding's opts.params. When
1401
- * invoked via the legacy `Action.run` bridge or from the command palette
1402
- * with no per-binding context, `params` is undefined; descriptors should
1403
- * default to a sensible variant. */
1713
+ /** `params` carries the matched binding's opts.params. Invoked from the
1714
+ * command palette, or anywhere else with no per-binding context, `params`
1715
+ * is undefined; descriptors should default to a sensible variant. */
1404
1716
  run(deps: ActionDeps, params?: Record<string, unknown>): void;
1405
1717
  }
1406
1718
  /** Phase-machine invocation. `start` opens the phase and returns the handle
@@ -2688,7 +3000,7 @@ interface Tool<TScratch = unknown> extends Contribution {
2688
3000
  * the invoker knows which tool to switch to). */
2689
3001
  keybinding?: ToolKeybinding;
2690
3002
  initScratch?: () => TScratch;
2691
- cursor?: string | ((ctx: ToolCtx<TScratch>) => string);
3003
+ cursor?: CursorSpec | ((ctx: ToolCtx<TScratch>) => CursorSpec);
2692
3004
  onActivate?: (ctx: ToolCtx<TScratch>) => void;
2693
3005
  onDeactivate?: (ctx: ToolCtx<TScratch>) => void;
2694
3006
  /** Returns the in-flight preview pose for `id` if this tool is mid-gesture
@@ -2824,12 +3136,12 @@ interface Action {
2824
3136
  * `Tool.cursor` shows). Affordance hits are resolved earlier in the
2825
3137
  * pump via `AffordanceRegion.cursor` and never reach this field.
2826
3138
  *
2827
- * Static string only. Prediction runs `enabled()` but cannot run the
3139
+ * Static value only. Prediction runs `enabled()` but cannot run the
2828
3140
  * invoker, so an action that matches yet bails at `start()` (empty
2829
3141
  * handle) may still show its cursor — keep `enabled` accurate for
2830
3142
  * actions that declare one.
2831
3143
  */
2832
- cursor?: string;
3144
+ cursor?: CursorSpec;
2833
3145
  /**
2834
3146
  * CSS cursor shown while THIS action's ongoing handle is in flight —
2835
3147
  * grabbing while panning, `move` while dragging a selection, `crosshair`
@@ -2848,7 +3160,7 @@ interface Action {
2848
3160
  * being taken over by bindings, and neither could describe a cursor for an
2849
3161
  * action a tool doesn't own.
2850
3162
  */
2851
- activeCursor?: string;
3163
+ activeCursor?: CursorSpec;
2852
3164
  }
2853
3165
  /**
2854
3166
  * @experimental
@@ -3991,6 +4303,9 @@ type SliderProps<T extends Thumb = Thumb> = {
3991
4303
  allowShiftAll?: boolean;
3992
4304
  renderTrack?: (ctx: TrackCtx) => ReactNode;
3993
4305
  trackHeight?: number;
4306
+ /** `'slim'` drives the track and thumb from the kit's slider tokens, so a
4307
+ * Slider matches the property rows. `trackHeight` still wins if given. */
4308
+ density?: 'default' | 'slim';
3994
4309
  renderReadout?: (thumb: T, index: number) => ReactNode;
3995
4310
  readoutPlacement?: 'none' | 'inline-after' | 'below-thumb';
3996
4311
  ariaLabel?: string;
@@ -4537,6 +4852,9 @@ type NumberFieldProps = Omit<NumberFieldProps$1, 'children' | 'className'> & {
4537
4852
  errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
4538
4853
  /** Hide the up/down stepper buttons. Defaults to false. */
4539
4854
  hideSteppers?: boolean;
4855
+ /** Render with no box until focused — the readout treatment the property
4856
+ * rows use, for a value that sits inside other chrome rather than in a form. */
4857
+ ghost?: boolean;
4540
4858
  /** Native input placeholder — e.g. `'Mixed'` for a multi-selection
4541
4859
  * editor with no shared value. */
4542
4860
  placeholder?: string;
@@ -4556,6 +4874,9 @@ declare const NumberField: react.ForwardRefExoticComponent<Omit<NumberFieldProps
4556
4874
  errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
4557
4875
  /** Hide the up/down stepper buttons. Defaults to false. */
4558
4876
  hideSteppers?: boolean;
4877
+ /** Render with no box until focused — the readout treatment the property
4878
+ * rows use, for a value that sits inside other chrome rather than in a form. */
4879
+ ghost?: boolean;
4559
4880
  /** Native input placeholder — e.g. `'Mixed'` for a multi-selection
4560
4881
  * editor with no shared value. */
4561
4882
  placeholder?: string;
@@ -5191,5 +5512,5 @@ declare const MINUS_SIGN = "\u2212";
5191
5512
  */
5192
5513
  declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
5193
5514
 
5194
- export { ActionBar, ActionsBar, Badge, Button, Callout, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, DragHandleGlyph, EDGE_PROFILES, Field, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline, ToolPrefGroup as PrefGroup, ToolPrefLeaf as PrefLeaf, Radio, RadioGroup, RangeSlider, Select, SelectItem, Sidebar, SidebarPanel, Slider, Switch, Tab, TabList, TabPanel, Tabs, ToggleBar, ToolButton, ToolGroup, ToolPalette, chromaAt, detectPlatform, dlog, fieldClasses, formatNumber, formatShortcut, formatShortcutParts, inferKeycapKind, isDebugEnabled, isPrefLeaf, keyGlyph, keySpecFromKey, keySpecsFromMods, oklchToHex, paintGradientTrack, prefValueAtPath, useReorderDragList, useRovingTabIndex, visiblePrefSubtree };
5195
- export type { ActionBarProps, ActionsBarItem, ActionsBarProps, ActionsBarSize, ActionsBarVariant, AddPointMode, AnchorRenderProps, AxesSettings, BadgeProps, BadgeShape, BadgeSize, BadgeTone, BadgeVariant, BoundsCtx, BuiltInEdgeName, ButtonProps, ButtonSize, ButtonVariant, CalloutProps, CheckboxProps, ChromaCurve, ChromaCurvePoint, ComboBoxItemProps, ComboBoxOption, ComboBoxProps, ControlPoint, CurveDomain, CurveEditorProps, DataGridColumn, DataGridProps, DialogProps, DragHandleGlyphProps, EdgeCap, EdgeProfile, EndpointMode, FieldOrientation, FieldProps, FillSettings, GradientTrackOpts, GridSettings, InputProps, InterpolationMode, KeyCapProps, KeyCapVariant, KeySequenceProps, KeySpec, KeycapKind, LayerListItem, LogicalMod, LogicalModSpec, NumberFieldProps, OptionsBarItem, OptionsBarProps, OptionsBarSize, OptionsBarVariant, Platform, Plot2DCoords, Plot2DHandle, Plot2DProps, PointPlotterProps, PowerlineProps, PowerlineSegment, RadioGroupProps, RadioProps, RangeSliderProps, ReorderDragHandlers, ReorderDragState, RovingItem, RovingTabIndex, SelectItemProps, SelectOption, SelectProps, SidebarPanelProps, SidebarProps, SliderProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabsProps, Thumb, ThumbRenderCtx, ThumbShape, ToggleBarItem, ToggleBarProps, ToggleBarSize, ToggleBarVariant, ToolButtonProps, ToolGroupProps, ToolPaletteProps, TrackCtx, UseReorderDragListOptions, UseRovingTabIndexOptions };
5515
+ export { ActionBar, ActionsBar, Badge, Button, Callout, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, DragHandleGlyph, EDGE_PROFILES, Field, ICON_PATHS, Icon, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline, ToolPrefGroup as PrefGroup, ToolPrefLeaf as PrefLeaf, Radio, RadioGroup, RangeSlider, Select, SelectItem, Sidebar, SidebarPanel, Slider, Switch, Tab, TabList, TabPanel, Tabs, ToggleBar, ToolButton, ToolGroup, ToolPalette, chromaAt, detectPlatform, dlog, fieldClasses, formatNumber, formatShortcut, formatShortcutParts, inferKeycapKind, isDebugEnabled, isPrefLeaf, keyGlyph, keySpecFromKey, keySpecsFromMods, oklchToHex, paintGradientTrack, prefValueAtPath, useReorderDragList, useRovingTabIndex, visiblePrefSubtree };
5516
+ export type { ActionBarProps, ActionsBarItem, ActionsBarProps, ActionsBarSize, ActionsBarVariant, AddPointMode, AnchorRenderProps, AxesSettings, BadgeProps, BadgeShape, BadgeSize, BadgeTone, BadgeVariant, BoundsCtx, BuiltInEdgeName, ButtonProps, ButtonSize, ButtonVariant, CalloutProps, CheckboxProps, ChromaCurve, ChromaCurvePoint, ComboBoxItemProps, ComboBoxOption, ComboBoxProps, ControlPoint, CurveDomain, CurveEditorProps, DataGridColumn, DataGridProps, DialogProps, DragHandleGlyphProps, EdgeCap, EdgeProfile, EndpointMode, FieldOrientation, FieldProps, FillSettings, GradientTrackOpts, GridSettings, IconName, IconProps, InputProps, InterpolationMode, KeyCapProps, KeyCapVariant, KeySequenceProps, KeySpec, KeycapKind, LayerListItem, LogicalMod, LogicalModSpec, NumberFieldProps, OptionsBarItem, OptionsBarProps, OptionsBarSize, OptionsBarVariant, Platform, Plot2DCoords, Plot2DHandle, Plot2DProps, PointPlotterProps, PowerlineProps, PowerlineSegment, RadioGroupProps, RadioProps, RangeSliderProps, ReorderDragHandlers, ReorderDragState, RovingItem, RovingTabIndex, SelectItemProps, SelectOption, SelectProps, SidebarPanelProps, SidebarProps, SliderProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabsProps, Thumb, ThumbRenderCtx, ThumbShape, ToggleBarItem, ToggleBarProps, ToggleBarSize, ToggleBarVariant, ToolButtonProps, ToolGroupProps, ToolPaletteProps, TrackCtx, UseReorderDragListOptions, UseRovingTabIndexOptions };
@@ -1,5 +1,5 @@
1
1
  import '../chunk-SBXNQW4G.js';
2
- export { m as ActionBar, r4 as ActionsBar, It as Badge, a3 as Button, h2 as Callout, c5 as CalloutTrigger, o as Checkbox, p3 as ComboBox, m3 as ComboBoxItem, F as CurveEditor, s as DataGrid, c as Dialog, n2 as DragHandleGlyph, Je as EDGE_PROFILES, n as Field, u as Input, s2 as KeyCap, c2 as KeySequence, c3 as LayerStack, e2 as MINUS_SIGN, f as NumberField, r3 as OptionsBar, f2 as Plot2D, n5 as PointPlotter, r5 as Powerline, u2 as Radio, l as RadioGroup, l2 as RangeSlider, p as Select, h as SelectItem, n3 as Sidebar, s3 as SidebarPanel, _2 as Slider, a2 as Switch, c4 as Tab, s4 as TabList, l3 as TabPanel, o4 as Tabs, r2 as ToggleBar, o3 as ToolButton, n4 as ToolGroup, _4 as ToolPalette, In as chromaAt, u3 as detectPlatform, a as dlog, r as fieldClasses, t as formatNumber, d2 as formatShortcut, u4 as formatShortcutParts, o2 as inferKeycapKind, i as isDebugEnabled, b2 as isPrefLeaf, e as keyGlyph, p2 as keySpecFromKey, d as keySpecsFromMods, Fn as oklchToHex, v2 as paintGradientTrack, x2 as prefValueAtPath, i2 as useReorderDragList, a4 as useRovingTabIndex, S as visiblePrefSubtree } from '../chunk-RBGKL7NF.js';
3
- import '../chunk-L5QJOOLV.js';
2
+ export { m as ActionBar, r5 as ActionsBar, It as Badge, a3 as Button, h3 as Callout, c5 as CalloutTrigger, o as Checkbox, p3 as ComboBox, m2 as ComboBoxItem, F as CurveEditor, s as DataGrid, c as Dialog, n2 as DragHandleGlyph, Je as EDGE_PROFILES, n as Field, t as ICON_PATHS, r as Icon, u as Input, s2 as KeyCap, c2 as KeySequence, c3 as LayerStack, e2 as MINUS_SIGN, f as NumberField, r4 as OptionsBar, f2 as Plot2D, n5 as PointPlotter, r6 as Powerline, u2 as Radio, l as RadioGroup, l2 as RangeSlider, p as Select, h as SelectItem, n3 as Sidebar, s3 as SidebarPanel, _2 as Slider, a2 as Switch, c4 as Tab, s4 as TabList, l3 as TabPanel, o4 as Tabs, r3 as ToggleBar, o3 as ToolButton, n4 as ToolGroup, _4 as ToolPalette, Hn as chromaAt, u3 as detectPlatform, a as dlog, r2 as fieldClasses, t2 as formatNumber, d2 as formatShortcut, u4 as formatShortcutParts, o2 as inferKeycapKind, i as isDebugEnabled, b2 as isPrefLeaf, e as keyGlyph, p2 as keySpecFromKey, d as keySpecsFromMods, Vn as oklchToHex, v2 as paintGradientTrack, x2 as prefValueAtPath, i2 as useReorderDragList, a4 as useRovingTabIndex, S as visiblePrefSubtree } from '../chunk-L5WBGUVR.js';
3
+ import '../chunk-7VW3S44V.js';
4
4
  //# sourceMappingURL=weasel-ui.js.map
5
5
  //# sourceMappingURL=weasel-ui.js.map
@@ -1,8 +1,8 @@
1
- export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-QB5SM4BM.js';
2
- export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-HHGVISVZ.js';
1
+ export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-4AMN4MMB.js';
2
+ export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-QR5V3AFG.js';
3
3
  import '../chunk-SBXNQW4G.js';
4
- import '../chunk-RBGKL7NF.js';
4
+ import '../chunk-L5WBGUVR.js';
5
5
  import '../chunk-CQLQPQ4P.js';
6
- import '../chunk-L5QJOOLV.js';
6
+ import '../chunk-7VW3S44V.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { C as CURRENT_DOCUMENT_VERSION, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, T as TrialIdContext, d as TrialIdProvider, e as createLabStore, 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';
2
- import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, a as StorageAdapter } from '../_dts/types-DYMaEvM5.js';
3
- export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, M as Migration, c as SavedSnapshot, d as TrialStateHandle, e as UndockedPanel, f as UndockedPanels, g as dockPanel, p as panelKey, u as undockPanel } from '../_dts/types-DYMaEvM5.js';
1
+ export { C as CURRENT_DOCUMENT_VERSION, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, T as TrialIdContext, d as TrialIdProvider, e as createLabStore, 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-Cdm13fvl.js';
2
+ import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, a as StorageAdapter } from '../_dts/types-ChVJJHvk.js';
3
+ export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, M as Migration, c as SavedSnapshot, d as TrialStateHandle, e as UndockedPanel, f as UndockedPanels, g as dockPanel, p as panelKey, u as undockPanel } from '../_dts/types-ChVJJHvk.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode } from 'react';
6
6
  import 'zustand/vanilla';
@@ -1,5 +1,7 @@
1
- import { createLabStore, LabStoreProvider, TrialIdProvider } from '../chunk-XJ6N32QP.js';
2
- export { CURRENT_DOCUMENT_VERSION, LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, dockPanel, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, panelKey, quarantineKey, serializeTrials, sessionStorageAdapter, undockPanel, urlHashAdapter, useLabStore, useTrialId, useTrialState } from '../chunk-XJ6N32QP.js';
1
+ import { createLabStore } from '../chunk-LJSIUFYD.js';
2
+ export { CURRENT_DOCUMENT_VERSION, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, dockPanel, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, panelKey, quarantineKey, serializeTrials, sessionStorageAdapter, undockPanel, urlHashAdapter, useTrialState } from '../chunk-LJSIUFYD.js';
3
+ import { LabStoreProvider, TrialIdProvider } from '../chunk-2YILQ7Y5.js';
4
+ export { LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, useLabStore, useTrialId } from '../chunk-2YILQ7Y5.js';
3
5
  import { useRef } from 'react';
4
6
  import { jsx } from 'react/jsx-runtime';
5
7
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":";;;;;AAKA,IAAM,oBAAA,GAAuB,eAAA;AAoBtB,SAAS,2BAAA,CAAoC;AAAA,EAClD,EAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA6C;AAC3C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,IAAI,QAAA,CAAS,YAAY,IAAA,EAAM;AAC7B,IAAA,MAAM,KAAA,GAAQ,cAAA,CAAe,EAAE,UAAA,EAAY,SAAS,CAAA;AACpD,IAAA,IAAI,CAAC,KAAA,CAAM,QAAA,EAAS,CAAE,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,EAAA,KAAO,EAAE,CAAA,EAAG;AACrD,MAAA,KAAA,CAAM,QAAA,GAAW,QAAA,CAAS;AAAA,QACxB,EAAA;AAAA,QACA,cAAA,EAAgB,oBAAA;AAAA,QAChB,MAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,YAAA;AAAA,QACP,IAAA,EAAM,EAAE,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAE;AAAE,OACtC,CAAA;AAAA,IACH;AACA,IAAA,QAAA,CAAS,OAAA,GAAU,KAAA;AAAA,EACrB;AACA,EAAA,uBACE,GAAA,CAAC,gBAAA,EAAA,EAAiB,KAAA,EAAO,QAAA,CAAS,OAAA,EAChC,8BAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,EAAA,EAAK,QAAA,EAAS,CAAA,EAC1C,CAAA;AAEJ","file":"index.js","sourcesContent":["import { type ReactNode, useRef } from 'react';\nimport { LabStoreProvider, TrialIdProvider } from './context';\nimport { createLabStore, type LabStore } from './store';\nimport type { StorageAdapter } from './types';\n\nconst SINGLETON_INSTRUMENT = '__singleton__';\n\n/** Props for `<SingletonExperimentProvider>`. */\nexport interface SingletonExperimentProviderProps<TS, TC> {\n /** Stable id for the synthetic trial; also doubles as the\n * TrialIdContext value. */\n id: string;\n initialConfig: TC;\n initialState: TS;\n storage: StorageAdapter;\n storageKey: string;\n children: ReactNode;\n}\n\n/**\n * One-trial `<Lab>` substitute for single-screen experiments. Mounts\n * a `LabStoreProvider` + `TrialIdProvider` with one synthetic\n * trial, so `useTrialState` works without going through the\n * full `<Lab instruments={...}>` runtime.\n */\nexport function SingletonExperimentProvider<TS, TC>({\n id,\n initialConfig,\n initialState,\n storage,\n storageKey,\n children,\n}: SingletonExperimentProviderProps<TS, TC>) {\n const storeRef = useRef<LabStore | null>(null);\n if (storeRef.current === null) {\n const store = createLabStore({ storageKey, storage });\n if (!store.getState().trials.some((w) => w.id === id)) {\n store.getState().addTrial({\n id,\n instrumentName: SINGLETON_INSTRUMENT,\n config: initialConfig,\n state: initialState,\n view: { zoom: 1, pan: { x: 0, y: 0 } },\n });\n }\n storeRef.current = store;\n }\n return (\n <LabStoreProvider store={storeRef.current}>\n <TrialIdProvider trialId={id}>{children}</TrialIdProvider>\n </LabStoreProvider>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":";;;;;;;AAKA,IAAM,oBAAA,GAAuB,eAAA;AAoBtB,SAAS,2BAAA,CAAoC;AAAA,EAClD,EAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA6C;AAC3C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,IAAI,QAAA,CAAS,YAAY,IAAA,EAAM;AAC7B,IAAA,MAAM,KAAA,GAAQ,cAAA,CAAe,EAAE,UAAA,EAAY,SAAS,CAAA;AACpD,IAAA,IAAI,CAAC,KAAA,CAAM,QAAA,EAAS,CAAE,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,EAAA,KAAO,EAAE,CAAA,EAAG;AACrD,MAAA,KAAA,CAAM,QAAA,GAAW,QAAA,CAAS;AAAA,QACxB,EAAA;AAAA,QACA,cAAA,EAAgB,oBAAA;AAAA,QAChB,MAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,YAAA;AAAA,QACP,IAAA,EAAM,EAAE,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAE;AAAE,OACtC,CAAA;AAAA,IACH;AACA,IAAA,QAAA,CAAS,OAAA,GAAU,KAAA;AAAA,EACrB;AACA,EAAA,uBACE,GAAA,CAAC,gBAAA,EAAA,EAAiB,KAAA,EAAO,QAAA,CAAS,OAAA,EAChC,8BAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,EAAA,EAAK,QAAA,EAAS,CAAA,EAC1C,CAAA;AAEJ","file":"index.js","sourcesContent":["import { type ReactNode, useRef } from 'react';\nimport { LabStoreProvider, TrialIdProvider } from './context';\nimport { createLabStore, type LabStore } from './store';\nimport type { StorageAdapter } from './types';\n\nconst SINGLETON_INSTRUMENT = '__singleton__';\n\n/** Props for `<SingletonExperimentProvider>`. */\nexport interface SingletonExperimentProviderProps<TS, TC> {\n /** Stable id for the synthetic trial; also doubles as the\n * TrialIdContext value. */\n id: string;\n initialConfig: TC;\n initialState: TS;\n storage: StorageAdapter;\n storageKey: string;\n children: ReactNode;\n}\n\n/**\n * One-trial `<Lab>` substitute for single-screen experiments. Mounts\n * a `LabStoreProvider` + `TrialIdProvider` with one synthetic\n * trial, so `useTrialState` works without going through the\n * full `<Lab instruments={...}>` runtime.\n */\nexport function SingletonExperimentProvider<TS, TC>({\n id,\n initialConfig,\n initialState,\n storage,\n storageKey,\n children,\n}: SingletonExperimentProviderProps<TS, TC>) {\n const storeRef = useRef<LabStore | null>(null);\n if (storeRef.current === null) {\n const store = createLabStore({ storageKey, storage });\n if (!store.getState().trials.some((w) => w.id === id)) {\n store.getState().addTrial({\n id,\n instrumentName: SINGLETON_INSTRUMENT,\n config: initialConfig,\n state: initialState,\n view: { zoom: 1, pan: { x: 0, y: 0 } },\n });\n }\n storeRef.current = store;\n }\n return (\n <LabStoreProvider store={storeRef.current}>\n <TrialIdProvider trialId={id}>{children}</TrialIdProvider>\n </LabStoreProvider>\n );\n}\n"]}