@weasel-js/labkit 1.6.1 → 1.7.1

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 (256) hide show
  1. package/README.md +3 -3
  2. package/dist/_dts/{CanvasStackContext-Wo6OwIVM.d.ts → CanvasStackContext-Cjy6I-Iv.d.ts} +4 -1
  3. package/dist/_dts/{Stage-DWBBi8IU.d.ts → Stage-D6t7o0pF.d.ts} +59 -18
  4. package/dist/_dts/{index-CKyX0ME_.d.ts → index-BTmaRy6a.d.ts} +10 -6
  5. package/dist/_dts/{types-B7yBTTF9.d.ts → index-DCMA4Fy1.d.ts} +59 -113
  6. package/dist/_dts/{types-DTuViBvc.d.ts → types-BUBSIZuV.d.ts} +18 -8
  7. package/dist/_dts/{useTrialState-CMaV6UD4.d.ts → useTrialState-Bh8bzFgE.d.ts} +1 -1
  8. package/dist/canvas/index.d.ts +8 -6
  9. package/dist/canvas/index.js +6 -6
  10. package/dist/chrome/index.d.ts +6 -4
  11. package/dist/chrome/index.js +11 -10
  12. package/dist/chunk-2ES4W47N.js +8 -0
  13. package/dist/chunk-2ES4W47N.js.map +1 -0
  14. package/dist/{chunk-WPLAANH4.js → chunk-2N7UBSS2.js} +12 -12
  15. package/dist/chunk-2N7UBSS2.js.map +1 -0
  16. package/dist/chunk-4KSC7NXL.js +15491 -0
  17. package/dist/chunk-4KSC7NXL.js.map +1 -0
  18. package/dist/{chunk-SLAQPUI4.js → chunk-CEGFXTBD.js} +10 -63
  19. package/dist/chunk-CEGFXTBD.js.map +1 -0
  20. package/dist/chunk-CZZPXUOU.js +3 -0
  21. package/dist/{chunk-SBXNQW4G.js.map → chunk-CZZPXUOU.js.map} +1 -1
  22. package/dist/{chunk-QGMOA2YE.js → chunk-E23Q6A3Y.js} +296 -104
  23. package/dist/chunk-E23Q6A3Y.js.map +1 -0
  24. package/dist/{chunk-GHGO52SO.js → chunk-E6NARGU7.js} +5 -5
  25. package/dist/{chunk-GHGO52SO.js.map → chunk-E6NARGU7.js.map} +1 -1
  26. package/dist/{chunk-IJJUK4FU.js → chunk-EESJUSYR.js} +5 -6
  27. package/dist/chunk-EESJUSYR.js.map +1 -0
  28. package/dist/{chunk-HXXTULDN.js → chunk-EFXRM6XQ.js} +8 -11
  29. package/dist/chunk-EFXRM6XQ.js.map +1 -0
  30. package/dist/chunk-F4ACIK7Z.js +210 -0
  31. package/dist/chunk-F4ACIK7Z.js.map +1 -0
  32. package/dist/{chunk-6FLXL3I7.js → chunk-FB4MIZOO.js} +77 -45
  33. package/dist/chunk-FB4MIZOO.js.map +1 -0
  34. package/dist/{chunk-AWQG7FCC.js → chunk-FG3EXZDV.js} +3 -3
  35. package/dist/{chunk-AWQG7FCC.js.map → chunk-FG3EXZDV.js.map} +1 -1
  36. package/dist/{chunk-4TT3PNPR.js → chunk-GAHELLJT.js} +95 -95
  37. package/dist/chunk-GAHELLJT.js.map +1 -0
  38. package/dist/{chunk-HKV7LRHY.js → chunk-IBVRMHW5.js} +5 -5
  39. package/dist/{chunk-HKV7LRHY.js.map → chunk-IBVRMHW5.js.map} +1 -1
  40. package/dist/{chunk-ASOK76ZH.js → chunk-JFOJESJF.js} +72 -29
  41. package/dist/chunk-JFOJESJF.js.map +1 -0
  42. package/dist/{chunk-RWNDDKOH.js → chunk-PMLZP7RT.js} +18 -15
  43. package/dist/chunk-PMLZP7RT.js.map +1 -0
  44. package/dist/{chunk-TJ77A4A3.js → chunk-READTDQX.js} +5 -9
  45. package/dist/chunk-READTDQX.js.map +1 -0
  46. package/dist/{chunk-JVBYV6TL.js → chunk-ROGJWDQA.js} +3 -3
  47. package/dist/{chunk-JVBYV6TL.js.map → chunk-ROGJWDQA.js.map} +1 -1
  48. package/dist/{chunk-CGHF6RZV.js → chunk-T6DLGEJB.js} +18 -18
  49. package/dist/chunk-T6DLGEJB.js.map +1 -0
  50. package/dist/{chunk-24W5VEJW.js → chunk-ULYYNWGP.js} +2 -2
  51. package/dist/{chunk-24W5VEJW.js.map → chunk-ULYYNWGP.js.map} +1 -1
  52. package/dist/{chunk-DWMSB4CA.js → chunk-VYVGVBGY.js} +95 -32
  53. package/dist/chunk-VYVGVBGY.js.map +1 -0
  54. package/dist/{chunk-IRTGUQ5O.js → chunk-WLMDTI2Q.js} +16 -6
  55. package/dist/chunk-WLMDTI2Q.js.map +1 -0
  56. package/dist/{chunk-NEXR37YJ.js → chunk-XE5HJOPL.js} +6 -8
  57. package/dist/chunk-XE5HJOPL.js.map +1 -0
  58. package/dist/chunk-XVUKDSYV.js +38 -0
  59. package/dist/chunk-XVUKDSYV.js.map +1 -0
  60. package/dist/{chunk-O6FFFOHS.js → chunk-YCFKW5RX.js} +16 -8
  61. package/dist/chunk-YCFKW5RX.js.map +1 -0
  62. package/dist/{chunk-CQLQPQ4P.js → chunk-ZQIHJXP4.js} +2 -2
  63. package/dist/chunk-ZQIHJXP4.js.map +1 -0
  64. package/dist/config/index.d.ts +28 -13
  65. package/dist/config/index.js +4 -4
  66. package/dist/controls/index.d.ts +4 -7
  67. package/dist/controls/index.js +6 -5
  68. package/dist/dragdrop/index.d.ts +23 -3
  69. package/dist/dragdrop/index.js +4 -3
  70. package/dist/fonts/oswald-tabular-digits.woff2 +0 -0
  71. package/dist/index.d.ts +72 -487
  72. package/dist/index.js +603 -441
  73. package/dist/index.js.map +1 -1
  74. package/dist/job/index.d.ts +8 -0
  75. package/dist/job/index.js +1 -1
  76. package/dist/layers/index.d.ts +6 -5
  77. package/dist/layers/index.js +3 -2
  78. package/dist/loupe/index.d.ts +100 -30
  79. package/dist/loupe/index.js +585 -6
  80. package/dist/loupe/index.js.map +1 -1
  81. package/dist/overview/index.d.ts +4 -2
  82. package/dist/overview/index.js +20 -18
  83. package/dist/overview/index.js.map +1 -1
  84. package/dist/passthrough/weasel-canvas.d.ts +2 -0
  85. package/dist/passthrough/weasel-ui.d.ts +2 -2701
  86. package/dist/passthrough/weasel-ui.js +4 -3
  87. package/dist/primitives/index.d.ts +37 -2
  88. package/dist/primitives/index.js +9 -8
  89. package/dist/state/index.d.ts +7 -5
  90. package/dist/state/index.js +6 -6
  91. package/dist/styles.css +150 -126
  92. package/dist/surface/index.d.ts +10 -2
  93. package/dist/surface/index.js +1 -1
  94. package/dist/undo/index.d.ts +5 -3
  95. package/package.json +14 -13
  96. package/src/annotations/AnnotationOverlay.abandon.test.tsx +143 -0
  97. package/src/annotations/AnnotationOverlay.tsx +52 -33
  98. package/src/annotations/Annotations.less +0 -10
  99. package/src/annotations/Annotations.overlay.test.tsx +31 -0
  100. package/src/annotations/MarkList.tsx +4 -8
  101. package/src/annotations/capture.browser.test.ts +41 -0
  102. package/src/annotations/capture.ts +14 -7
  103. package/src/annotations/drawOne.ts +2 -2
  104. package/src/annotations/frac.test.ts +44 -1
  105. package/src/annotations/frac.ts +46 -18
  106. package/src/annotations/index.ts +1 -0
  107. package/src/annotations/paint.test.ts +76 -46
  108. package/src/annotations/paint.ts +65 -43
  109. package/src/annotations/store.test.ts +212 -2
  110. package/src/annotations/store.ts +130 -27
  111. package/src/annotations/svgNodes.test.ts +28 -19
  112. package/src/annotations/svgNodes.ts +6 -6
  113. package/src/annotations/types.ts +29 -10
  114. package/src/canvas/AGENTS.md +1 -0
  115. package/src/canvas/CameraInput.test.tsx +30 -0
  116. package/src/canvas/CameraInput.tsx +60 -48
  117. package/src/canvas/CanvasStack.tsx +11 -6
  118. package/src/canvas/CanvasStackContext.ts +4 -1
  119. package/src/canvas/LinkedCursor.less +1 -1
  120. package/src/canvas/Stage.test.tsx +33 -4
  121. package/src/canvas/Stage.tsx +9 -4
  122. package/src/canvas/cameraRegistry.test.ts +55 -0
  123. package/src/canvas/cameraRegistry.ts +87 -0
  124. package/src/canvas/cameraZoom.test.ts +46 -0
  125. package/src/canvas/cameraZoom.ts +24 -0
  126. package/src/canvas/index.ts +14 -2
  127. package/src/canvas/sharedScope.test.tsx +94 -0
  128. package/src/canvas/worldSpec.ts +3 -1
  129. package/src/chrome/ChromeRegions.stories.tsx +1 -0
  130. package/src/chrome/builtins.test.ts +7 -6
  131. package/src/chrome/builtins.tsx +5 -1
  132. package/src/chrome/index.ts +1 -1
  133. package/src/chrome/merge.test.ts +5 -0
  134. package/src/chrome/merge.ts +4 -2
  135. package/src/chrome/regions/PaletteRegion.less +0 -7
  136. package/src/chrome/regions/PaletteRegion.test.tsx +2 -3
  137. package/src/chrome/regions/PaletteRegion.tsx +3 -4
  138. package/src/chrome/regions/SidebarRegion.less +12 -2
  139. package/src/chrome/regions/ViewportRegion.browser.test.less +6 -0
  140. package/src/chrome/regions/ViewportRegion.browser.test.tsx +38 -0
  141. package/src/chrome/regions/ViewportRegion.less +6 -0
  142. package/src/chrome/regions/ViewportRegion.tsx +10 -4
  143. package/src/chrome/types.ts +4 -2
  144. package/src/config/auto.ts +1 -0
  145. package/src/config/builder.test.ts +2 -1
  146. package/src/config/builder.ts +18 -5
  147. package/src/config/fromConfigField.test.ts +14 -0
  148. package/src/config/fromConfigField.ts +18 -4
  149. package/src/config/path.ts +2 -5
  150. package/src/config/resolve.ts +4 -0
  151. package/src/config/types.ts +14 -9
  152. package/src/controls/ControlPanel.less +1 -1
  153. package/src/controls/ControlPanel.stories.tsx +3 -2
  154. package/src/controls/ControlPanel.test.tsx +98 -11
  155. package/src/controls/ControlPanel.tsx +61 -2
  156. package/src/dragdrop/DragDropRuntime.tsx +22 -13
  157. package/src/dragdrop/DragGhost.tsx +3 -0
  158. package/src/dragdrop/Palette.tsx +2 -0
  159. package/src/index.test.ts +5 -0
  160. package/src/index.ts +16 -2
  161. package/src/instrument/types.ts +0 -6
  162. package/src/job/useJob.ts +14 -9
  163. package/src/lab/Lab.tsx +88 -73
  164. package/src/lab/{LabFit.stories.less → LabFit.browser.test.less} +1 -1
  165. package/src/lab/{LabFit.stories.tsx → LabFit.browser.test.tsx} +41 -63
  166. package/src/lab/LabFullChrome.stories.tsx +1 -0
  167. package/src/lab/LabHeader.test.tsx +24 -14
  168. package/src/lab/LabHeader.tsx +11 -12
  169. package/src/lab/LabShell.less +9 -17
  170. package/src/lab/LabSwitcher.browser.test.tsx +27 -0
  171. package/src/lab/LabSwitcher.less +8 -6
  172. package/src/lab/LabZoom.test.tsx +223 -0
  173. package/src/lab/LabZoom.tsx +170 -0
  174. package/src/lab/Workspace.tsx +48 -52
  175. package/src/lab/index.ts +1 -0
  176. package/src/loupe/AGENTS.md +28 -15
  177. package/src/loupe/CanvasLoupe.tsx +2 -3
  178. package/src/loupe/DomLoupe.tsx +1 -7
  179. package/src/loupe/Loupe.less +16 -0
  180. package/src/loupe/LoupeGestures.tsx +1 -1
  181. package/src/loupe/TrialLoupe.tsx +120 -57
  182. package/src/loupe/index.ts +1 -6
  183. package/src/loupe/types.test.ts +3 -3
  184. package/src/loupe/types.ts +24 -27
  185. package/src/loupe/useLoupe.test.tsx +29 -4
  186. package/src/loupe/useLoupe.ts +20 -17
  187. package/src/overview/OverviewMarks.tsx +12 -4
  188. package/src/overview/TrialOverview.tsx +10 -8
  189. package/src/passthrough/weasel-ui.test.ts +2 -0
  190. package/src/passthrough/weasel-ui.ts +17 -5
  191. package/src/primitives/FloatingPanel.test.tsx +11 -0
  192. package/src/primitives/FloatingPanel.tsx +8 -7
  193. package/src/primitives/JobProgress.less +2 -1
  194. package/src/primitives/Legend.stories.tsx +1 -0
  195. package/src/primitives/Readout.browser.test.tsx +137 -0
  196. package/src/primitives/Readout.less +12 -0
  197. package/src/primitives/Readout.stories.tsx +58 -0
  198. package/src/primitives/Readout.test.tsx +93 -0
  199. package/src/primitives/Readout.tsx +56 -0
  200. package/src/primitives/Split.tsx +69 -41
  201. package/src/primitives/Toolbar.tsx +3 -3
  202. package/src/primitives/ZoomControl.less +1 -2
  203. package/src/primitives/index.ts +2 -0
  204. package/src/specimen/Specimen.stories.tsx +1 -0
  205. package/src/specimen/Specimen.tsx +2 -3
  206. package/src/state/Persistence.browser.test.tsx +47 -0
  207. package/src/state/store.test.ts +5 -1
  208. package/src/state/undock.ts +3 -0
  209. package/src/state/useOpenOnce.ts +20 -16
  210. package/src/state/usePersistedState.test.tsx +1 -1
  211. package/src/state/view.ts +1 -0
  212. package/src/styles.less +1 -0
  213. package/src/surface/index.ts +1 -1
  214. package/src/surface/useTiledSurface.test.tsx +14 -0
  215. package/src/surface/useTiledSurface.ts +11 -3
  216. package/src/theme/Interstellar.stories.tsx +3 -1
  217. package/src/theme/base.less +21 -47
  218. package/src/theme/interstellar.test.ts +1 -1
  219. package/src/theme/interstellar.theme.json +10 -3
  220. package/src/trial/Trial.annotations.test.tsx +73 -0
  221. package/src/trial/Trial.less +0 -29
  222. package/src/trial/Trial.loupe.test.tsx +28 -11
  223. package/src/trial/Trial.tsx +85 -67
  224. package/src/trial/TrialChrome.tsx +27 -6
  225. package/src/trial/index.ts +2 -0
  226. package/src/trial/loupeSwitch.ts +15 -0
  227. package/dist/_dts/LayerList.d-BoELAMsM.d.ts +0 -83
  228. package/dist/_dts/PrefsRow.d-DFpPIeIC.d.ts +0 -39
  229. package/dist/_dts/PropertyField.d-D0ndfIIt.d.ts +0 -404
  230. package/dist/_dts/Select.d-Cr8-zoup.d.ts +0 -569
  231. package/dist/chunk-4TT3PNPR.js.map +0 -1
  232. package/dist/chunk-6FLXL3I7.js.map +0 -1
  233. package/dist/chunk-ASOK76ZH.js.map +0 -1
  234. package/dist/chunk-CGHF6RZV.js.map +0 -1
  235. package/dist/chunk-CQLQPQ4P.js.map +0 -1
  236. package/dist/chunk-DWMSB4CA.js.map +0 -1
  237. package/dist/chunk-HXXTULDN.js.map +0 -1
  238. package/dist/chunk-IJJUK4FU.js.map +0 -1
  239. package/dist/chunk-IRTGUQ5O.js.map +0 -1
  240. package/dist/chunk-KHK5FGER.js +0 -145
  241. package/dist/chunk-KHK5FGER.js.map +0 -1
  242. package/dist/chunk-NEXR37YJ.js.map +0 -1
  243. package/dist/chunk-O6FFFOHS.js.map +0 -1
  244. package/dist/chunk-QGMOA2YE.js.map +0 -1
  245. package/dist/chunk-RWNDDKOH.js.map +0 -1
  246. package/dist/chunk-S4NCI32V.js +0 -549
  247. package/dist/chunk-S4NCI32V.js.map +0 -1
  248. package/dist/chunk-SBXNQW4G.js +0 -3
  249. package/dist/chunk-SLAQPUI4.js.map +0 -1
  250. package/dist/chunk-TJ77A4A3.js.map +0 -1
  251. package/dist/chunk-TYN6MLXX.js +0 -13864
  252. package/dist/chunk-TYN6MLXX.js.map +0 -1
  253. package/dist/chunk-WPLAANH4.js.map +0 -1
  254. package/src/primitives/useRovingTabIndex.test.ts +0 -48
  255. package/src/primitives/useRovingTabIndex.ts +0 -88
  256. package/src/state/Persistence.stories.tsx +0 -75
@@ -4,5 +4,5 @@ import { createContext } from 'react';
4
4
  var CanvasStackContext = createContext(null);
5
5
 
6
6
  export { CanvasStackContext };
7
- //# sourceMappingURL=chunk-CQLQPQ4P.js.map
8
- //# sourceMappingURL=chunk-CQLQPQ4P.js.map
7
+ //# sourceMappingURL=chunk-ZQIHJXP4.js.map
8
+ //# sourceMappingURL=chunk-ZQIHJXP4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/canvas/CanvasStackContext.ts"],"names":[],"mappings":";;;AAgCO,IAAM,kBAAA,GAAqB,cAA8C,IAAI","file":"chunk-ZQIHJXP4.js","sourcesContent":["import { createContext, type RefObject } from 'react';\nimport type { ViewTransform } from '../instrument/types';\nimport type { CanvasLayerDescriptor } from './useLayerScheduler';\nimport type { WorldFrame, WorldSpec } from './worldSpec';\n\n/** The stack's own drawing surface, for an overlay that has to re-draw it at\n * another camera or read back what it presented — a loupe. */\nexport interface CanvasStackSurface {\n /** The element the layers are stacked in, and the one pan/zoom listens on. */\n element: RefObject<HTMLElement | null>;\n /** Its measured CSS size, and the ratio the backing stores are scaled by. */\n size: { width: number; height: number; dpr: number };\n /** The presented `<canvas>` per layer id. */\n canvases: RefObject<Map<string, HTMLCanvasElement>>;\n /** The layers as the stack is drawing them, bottom first. */\n layers: readonly CanvasLayerDescriptor[];\n /** The coordinate system the stack was given, which `frame` resolves at\n * its size — for a re-draw at another size. */\n worldSpec?: WorldSpec;\n}\n\n/** What a canvas stack publishes to its children: the view, and the resolved\n * coordinate system it is read in, so DOM overlays can place themselves in the\n * same coordinates the layers draw in. */\nexport interface CanvasStackContextValue {\n view: ViewTransform;\n frame: WorldFrame;\n /** Absent from a context assembled by hand, which has no stack behind it. */\n surface?: CanvasStackSurface;\n}\n\n/** Context carrying the surrounding canvas stack's view and world frame. */\nexport const CanvasStackContext = createContext<CanvasStackContextValue | null>(null);\n"]}
@@ -1,13 +1,15 @@
1
- import { a5 as Auto } from '../_dts/types-B7yBTTF9.js';
1
+ import { a4 as Auto } from '../_dts/index-DCMA4Fy1.js';
2
2
  import { Instrument } from '../index.js';
3
- export { aC as auto, aI as isAuto } from '../_dts/types-B7yBTTF9.js';
4
- import { R as ResolvedConfig, l as ConfigNode, A as Annotations, N as NodeOptions, S as SectionOption, d as ControlRenderer, I as InDialogOptions, n as ConfigOption, p as ConfigShape, h as ConfigBranch, B as BranchAnnotations, e as BranchOptions, b as ConfigSchema, q as InferConfig, i as ConfigEntry, c as ConfigRule, L as LeafPatch, o as ConfigRuleContext } from '../_dts/types-DTuViBvc.js';
3
+ export { aw as auto, aC as isAuto } from '../_dts/index-DCMA4Fy1.js';
4
+ import { R as ResolvedConfig, k as ConfigNode, A as Annotations, N as NodeOptions, S as SectionOption, c as ControlRenderer, I as InDialogOptions, m as ConfigOption, p as ConfigShape, g as ConfigBranch, B as BranchAnnotations, d as BranchOptions, C as ConfigSchema, q as InferConfig, h as ConfigEntry, b as ConfigRule, L as LeafPatch, o as ConfigRuleContext } from '../_dts/types-BUBSIZuV.js';
5
5
  import { ConfigField } from '../controls/index.js';
6
- export { m as ConfigOf, C as ConfigPath, D as DialogSpec, E as EntryValue, r as NodeValue, t as SectionSpec, V as ValueAtPath } from '../_dts/types-DTuViBvc.js';
7
- import { ToolPrefNumberFormat, ToolPrefNumberUnit, ToolPrefLeaf, ToolPrefGroup } from '@weasel-js/core';
6
+ export { l as ConfigOf, n as ConfigPath, D as DialogSpec, E as EntryValue, r as NodeValue, t as SectionSpec, V as ValueAtPath } from '../_dts/types-BUBSIZuV.js';
7
+ import { Display } from '@weasel-js/quantity';
8
+ import { PrefNumberUnit, PrefLeaf, PrefGroup } from '@weasel-js/ui';
9
+ import '@weasel-js/core';
8
10
  import 'react';
9
- import '../_dts/PrefsRow.d-DFpPIeIC.js';
10
11
  import '@weasel-js/theme';
12
+ import '@weasel-js/geom';
11
13
  import '../_dts/types-DJ79Tg5J.js';
12
14
 
13
15
  /** The dotted paths a schema declares as starting auto — every leaf that said
@@ -73,6 +75,7 @@ declare abstract class BaseNode<T> implements ConfigNode<T> {
73
75
  /** Never auto. The row's label does not toggle. */
74
76
  manual(): this;
75
77
  }
78
+ /** A numeric leaf, built by `f.number`. */
76
79
  declare class NumberNode extends BaseNode<number> {
77
80
  readonly kind = "number";
78
81
  /** Bound the value. A number with both bounds renders as a slider. */
@@ -81,26 +84,28 @@ declare class NumberNode extends BaseNode<number> {
81
84
  /** A display suffix for the value — `'px'`, `'ms'`, `'°'`. Presentation only:
82
85
  * it is never parsed, and the stored value stays a plain number. */
83
86
  suffix(suffix: string): this;
84
- /** Show the value in a named format — `'compact'` reads `2.00M`. Presentation
85
- * only: the stored value stays a plain number, and a typed `2.5m` reads back. */
86
- format(format: ToolPrefNumberFormat): this;
87
+ /** Show, speak and read the value through a display — `compact()` reads
88
+ * `2.00M`. Presentation only: the stored value stays a plain number. */
89
+ display(display: Display): this;
87
90
  /**
88
91
  * Store the value in one unit and edit it in another — radians stored,
89
92
  * degrees typed. `min`, `max` and `step` are declared in the stored unit
90
93
  * alongside the value, and convert with it. `prefUnit` builds one from a
91
94
  * `UnitSystem`.
92
95
  */
93
- unit(unit: ToolPrefNumberUnit): this;
96
+ unit(unit: PrefNumberUnit): this;
94
97
  /** Force a slider even without both bounds. */
95
98
  slider(): this;
96
99
  /** Force a typed input even when both bounds are set. */
97
100
  input(): this;
98
101
  }
102
+ /** A true/false leaf, built by `f.boolean`; a checkbox unless `.toggle()`. */
99
103
  declare class BooleanNode extends BaseNode<boolean> {
100
104
  readonly kind = "boolean";
101
105
  /** Ask for a switch rather than a checkbox. */
102
106
  toggle(): this;
103
107
  }
108
+ /** A text leaf, built by `f.string`. */
104
109
  declare class StringNode extends BaseNode<string> {
105
110
  readonly kind = "string";
106
111
  placeholder(placeholder: string): this;
@@ -108,17 +113,20 @@ declare class StringNode extends BaseNode<string> {
108
113
  /** Milliseconds to debounce live writes. 0 commits every keystroke. */
109
114
  debounce(debounceMs: number): this;
110
115
  }
116
+ /** A string-list leaf, built by `f.list`. */
111
117
  declare class ListNode extends BaseNode<string[]> {
112
118
  readonly kind = "list";
113
119
  /** Shown in an empty entry. */
114
120
  placeholder(placeholder: string): this;
115
121
  }
122
+ /** A color leaf holding a hex string, built by `f.color`. */
116
123
  declare class ColorNode extends BaseNode<string> {
117
124
  readonly kind = "color";
118
125
  /** The value carries alpha as `#rrggbbaa`, and the row gets an opacity
119
126
  * track beside the swatch. */
120
127
  alpha(): this;
121
128
  }
129
+ /** A fixed-choice leaf, built by `f.enum`; a select unless `.radio()`. */
122
130
  declare class EnumNode<T extends string> extends BaseNode<T> {
123
131
  readonly kind = "enum";
124
132
  /** Render as a segmented control rather than a select. */
@@ -158,6 +166,9 @@ declare class GroupNode<S extends ConfigShape> implements ConfigBranch<S> {
158
166
  /** Show this group only while the predicate holds. Presentational — every
159
167
  * value beneath it stays in config and the instrument still reads it. */
160
168
  showIf(predicate: (config: Record<string, unknown>) => boolean): GroupNode<S>;
169
+ /** Put a button on the group's heading that returns every value beneath it
170
+ * to its default, leaving the rest of the config alone. */
171
+ resettable(): GroupNode<S>;
161
172
  }
162
173
  /**
163
174
  * Builds an instrument's config: the values, their types, and how each is
@@ -192,7 +203,7 @@ declare const f: {
192
203
  * Groups nest as deeply as the schema wants. */
193
204
  group: <const S extends ConfigShape>(children: S) => GroupNode<S>;
194
205
  /** A leaf of a kind a lab supplies the control for, through `controls`. */
195
- custom: <T>(kind: string, def: T, validate?: (leaf: ToolPrefLeaf, config: Record<string, unknown>) => string[]) => CustomNode<T>;
206
+ custom: <T>(kind: string, def: T, validate?: (leaf: PrefLeaf, config: Record<string, unknown>) => string[]) => CustomNode<T>;
196
207
  /** Collect leaves and groups into an instrument's config. */
197
208
  schema<S extends ConfigShape>(nodes: S): ConfigSchema<InferConfig<S>>;
198
209
  };
@@ -203,6 +214,10 @@ declare const f: {
203
214
  *
204
215
  * Rules do not run here: a hand-written `ConfigField` already states its label
205
216
  * and control, which is everything the rule chain would have inferred.
217
+ *
218
+ * A dotted `key` is a config path, as it is to every read and write, so its
219
+ * leaf is filed under headless groups at that path rather than as one child
220
+ * whose name contains dots — which no path lookup would find.
206
221
  */
207
222
  declare function fromConfigFields(fields: readonly ConfigField[]): ResolvedConfig;
208
223
 
@@ -227,7 +242,7 @@ declare function withValueAtPath<T>(config: T, path: string, value: unknown): T;
227
242
  declare function fillConfigDefaults<T>(stored: unknown, defaults: T): T;
228
243
  /** A node in a resolved schema tree, by dotted path. Structural rather than
229
244
  * `isPrefLeaf` so this stays free of a runtime import. */
230
- declare function schemaNodeAtPath(group: ToolPrefGroup, path: string): ToolPrefLeaf | ToolPrefGroup | undefined;
245
+ declare function schemaNodeAtPath(group: PrefGroup, path: string): PrefLeaf | PrefGroup | undefined;
231
246
 
232
247
  /**
233
248
  * Resolve a schema into the vocabulary weasel-ui renders, running each leaf
@@ -269,7 +284,7 @@ declare function applyRules(seed: LeafPatch, ctx: Omit<ConfigRuleContext, 'leaf'
269
284
  interface SectionTree {
270
285
  /** The rail's schema. Top-level children are the schema's root sections,
271
286
  * followed by any root node no section claimed. */
272
- group: ToolPrefGroup;
287
+ group: PrefGroup;
273
288
  /** `config` renested to mirror `group` — the value tree `PrefsForm` takes. */
274
289
  values: Record<string, unknown>;
275
290
  /** The config path a path within `group` stands for. */
@@ -1,7 +1,7 @@
1
- export { sectionTree, useConfigSchema } from '../chunk-GHGO52SO.js';
1
+ export { sectionTree, useConfigSchema } from '../chunk-E6NARGU7.js';
2
2
  import '../chunk-Z76KEZAX.js';
3
- export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from '../chunk-O6FFFOHS.js';
4
- export { fromConfigFields, isLeafVisible } from '../chunk-IRTGUQ5O.js';
5
- export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from '../chunk-TJ77A4A3.js';
3
+ export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from '../chunk-YCFKW5RX.js';
4
+ export { fromConfigFields, isLeafVisible } from '../chunk-WLMDTI2Q.js';
5
+ export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from '../chunk-READTDQX.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
@@ -1,13 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { StanceProps } from '../passthrough/weasel-ui.js';
4
- import { PropertyRowLayout } from '../index.js';
5
- import { PropertyDensity, PropertyAlign } from '../passthrough/weasel-ui.js';
6
- import { a as ConfigField, I as InDialogOptions } from '../_dts/types-DTuViBvc.js';
3
+ import { StanceProps, PropertyRowLayout, PropertyDensity, PropertyAlign } from '@weasel-js/ui';
4
+ import { a as ConfigField, I as InDialogOptions } from '../_dts/types-BUBSIZuV.js';
7
5
  import { ResolvedConfig, ControlRenderer } from '../config/index.js';
8
- export { f as CheckboxField, g as ColorField, k as ConfigFieldType, s as NumberField, u as SelectField, v as SelectOption, w as SliderField, T as TextField } from '../_dts/types-DTuViBvc.js';
9
- import '@weasel-js/theme';
10
- import '@weasel-js/core';
6
+ export { e as CheckboxField, f as ColorField, j as ConfigFieldType, s as NumberField, u as SelectField, v as SelectOption, w as SliderField, T as TextField } from '../_dts/types-BUBSIZuV.js';
7
+ import '@weasel-js/quantity';
11
8
 
12
9
  /** How a panel packs its rows into the two-column property grid.
13
10
  * - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
@@ -1,7 +1,8 @@
1
- export { ControlPanel, inDialog, summarizeValue } from '../chunk-ASOK76ZH.js';
2
- import '../chunk-IRTGUQ5O.js';
3
- import '../chunk-TJ77A4A3.js';
4
- import '../chunk-TYN6MLXX.js';
5
- import '../chunk-QGMOA2YE.js';
1
+ export { ControlPanel, inDialog, summarizeValue } from '../chunk-JFOJESJF.js';
2
+ import '../chunk-WLMDTI2Q.js';
3
+ import '../chunk-READTDQX.js';
4
+ import '../chunk-4KSC7NXL.js';
5
+ import '../chunk-E23Q6A3Y.js';
6
+ import '../chunk-XVUKDSYV.js';
6
7
  //# sourceMappingURL=index.js.map
7
8
  //# sourceMappingURL=index.js.map
@@ -1,19 +1,25 @@
1
- import { n as PaletteItem, o as DragFeedback, q as DragDropCapability } from '../_dts/types-B7yBTTF9.js';
1
+ import { l as PaletteItem, m as DragFeedback, n as DragDropCapability } from '../_dts/index-DCMA4Fy1.js';
2
2
  import { WorldSpec } from '../canvas/index.js';
3
3
  import { Point, ViewTransform } from '../index.js';
4
4
  import * as react from 'react';
5
5
  import { RefObject, PointerEvent, ReactPortal } from 'react';
6
+ import '@weasel-js/ui';
6
7
  import '@weasel-js/core';
7
- import '../_dts/PrefsRow.d-DFpPIeIC.js';
8
8
  import '@weasel-js/theme';
9
- import '../_dts/types-DTuViBvc.js';
9
+ import '../_dts/types-BUBSIZuV.js';
10
+ import '@weasel-js/quantity';
11
+ import '@weasel-js/geom';
10
12
  import '../_dts/types-DJ79Tg5J.js';
11
13
 
14
+ /** A palette drag in progress. `screenPos` is in client pixels; `feedback` is
15
+ * the last `onDragOver` answer — `null` off the canvas or without one. */
12
16
  interface DragState {
13
17
  item: PaletteItem;
14
18
  screenPos: Point;
15
19
  feedback: DragFeedback | null;
16
20
  }
21
+ /** Inputs to `useDragDrop`: the capability, the element that counts as the
22
+ * drop target, and the trial state a drop rewrites. */
17
23
  interface UseDragDropArgs<TS, TC> {
18
24
  capability: DragDropCapability<TS, TC>;
19
25
  canvasContainerRef: RefObject<HTMLElement | null>;
@@ -26,27 +32,41 @@ interface UseDragDropArgs<TS, TC> {
26
32
  setState: (next: TS | ((prev: TS) => TS)) => void;
27
33
  emit: (event: string) => void;
28
34
  }
35
+ /** The live drag, and the handler a palette item calls on pointerdown. */
29
36
  interface UseDragDropResult {
30
37
  drag: DragState | null;
31
38
  startDrag: (item: PaletteItem, e: PointerEvent) => void;
32
39
  }
40
+ /**
41
+ * Run palette-to-canvas drags for a `DragDropCapability`. Releasing over the
42
+ * container converts the pointer to world coordinates, applies `onDrop`'s
43
+ * state and emits `'canvas.itemAdded'`; releasing anywhere else, or a canceled
44
+ * gesture, drops nothing. `onDragOver` is probed at most once per frame.
45
+ */
33
46
  declare function useDragDrop<TS, TC>({ capability, canvasContainerRef, view, state, config, setState, emit, worldSpec, }: UseDragDropArgs<TS, TC>): UseDragDropResult;
47
+ /** Props for `DragOverlay`. */
34
48
  interface DragOverlayProps {
35
49
  drag: DragState | null;
36
50
  }
51
+ /** The ghost for `drag`, or nothing when no drag is live. */
37
52
  declare function DragOverlay({ drag }: DragOverlayProps): react.JSX.Element | null;
38
53
 
54
+ /** Props for `DragGhost`. `screenPos` is in client pixels. */
39
55
  interface DragGhostProps {
40
56
  item: PaletteItem;
41
57
  screenPos: Point;
42
58
  }
59
+ /** The dragged item's label, portaled to `document.body` just below-right of
60
+ * `screenPos`. Renders nothing until mounted, so it is SSR-safe. */
43
61
  declare function DragGhost({ item, screenPos }: DragGhostProps): ReactPortal | null;
44
62
 
63
+ /** Props for `Palette`. `onDragStart` is usually `useDragDrop`'s `startDrag`. */
45
64
  interface PaletteProps {
46
65
  items: PaletteItem[];
47
66
  onDragStart: (item: PaletteItem, e: PointerEvent) => void;
48
67
  className?: string;
49
68
  }
69
+ /** One button per item, each starting a drag on pointerdown. */
50
70
  declare function Palette({ items, onDragStart, className }: PaletteProps): react.JSX.Element;
51
71
 
52
72
  export { DragDropCapability, DragFeedback, DragGhost, DragOverlay, Palette, PaletteItem, useDragDrop };
@@ -1,5 +1,6 @@
1
- export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-WPLAANH4.js';
2
- import '../chunk-AWQG7FCC.js';
3
- import '../chunk-24W5VEJW.js';
1
+ export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-2N7UBSS2.js';
2
+ import '../chunk-FG3EXZDV.js';
3
+ import '../chunk-ULYYNWGP.js';
4
+ import '../chunk-XVUKDSYV.js';
4
5
  //# sourceMappingURL=index.js.map
5
6
  //# sourceMappingURL=index.js.map