@weasel-js/labkit 1.5.2 → 1.6.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 (217) hide show
  1. package/README.md +3 -7
  2. package/dist/_dts/{CanvasStackContext-CMMo180l.d.ts → CanvasStackContext-Wo6OwIVM.d.ts} +1 -1
  3. package/dist/_dts/FloatingPanel-7j0IcXwz.d.ts +30 -0
  4. package/dist/_dts/LayerList.d-BoELAMsM.d.ts +83 -0
  5. package/dist/_dts/{PrefsForm.d-DPy9I8It.d.ts → PrefsRow.d-DFpPIeIC.d.ts} +16 -1
  6. package/dist/_dts/PropertyField.d-D0ndfIIt.d.ts +404 -0
  7. package/dist/_dts/{Select.d-ZTiwzYyT.d.ts → Select.d-Cr8-zoup.d.ts} +105 -15
  8. package/dist/_dts/{usePanZoom-SSTZe410.d.ts → Stage-DWBBi8IU.d.ts} +80 -35
  9. package/dist/_dts/{index-DlKolEIZ.d.ts → index-CKyX0ME_.d.ts} +12 -13
  10. package/dist/_dts/{frac-B4hFJMiN.d.ts → types-B7yBTTF9.d.ts} +709 -651
  11. package/dist/_dts/{types-Db-3NNk1.d.ts → types-DTuViBvc.d.ts} +21 -2
  12. package/dist/_dts/{useTrialState-pnAE-UBD.d.ts → useTrialState-CMaV6UD4.d.ts} +2 -3
  13. package/dist/canvas/index.d.ts +41 -8
  14. package/dist/canvas/index.js +5 -3
  15. package/dist/chrome/index.d.ts +6 -6
  16. package/dist/chrome/index.js +9 -7
  17. package/dist/chunk-24W5VEJW.js +18 -0
  18. package/dist/chunk-24W5VEJW.js.map +1 -0
  19. package/dist/chunk-2RVCB2PT.js +3 -0
  20. package/dist/chunk-2RVCB2PT.js.map +1 -0
  21. package/dist/chunk-3RY6WL5T.js +38 -0
  22. package/dist/chunk-3RY6WL5T.js.map +1 -0
  23. package/dist/{chunk-CKUKF72R.js → chunk-4TT3PNPR.js} +68 -55
  24. package/dist/chunk-4TT3PNPR.js.map +1 -0
  25. package/dist/{chunk-KJCUERQF.js → chunk-6FLXL3I7.js} +9 -164
  26. package/dist/chunk-6FLXL3I7.js.map +1 -0
  27. package/dist/chunk-ASOK76ZH.js +431 -0
  28. package/dist/chunk-ASOK76ZH.js.map +1 -0
  29. package/dist/chunk-AWQG7FCC.js +19 -0
  30. package/dist/chunk-AWQG7FCC.js.map +1 -0
  31. package/dist/chunk-CGHF6RZV.js +300 -0
  32. package/dist/chunk-CGHF6RZV.js.map +1 -0
  33. package/dist/chunk-DWMSB4CA.js +228 -0
  34. package/dist/chunk-DWMSB4CA.js.map +1 -0
  35. package/dist/chunk-GHGO52SO.js +92 -0
  36. package/dist/chunk-GHGO52SO.js.map +1 -0
  37. package/dist/{chunk-LRI3MBGR.js → chunk-HKV7LRHY.js} +4 -4
  38. package/dist/{chunk-LRI3MBGR.js.map → chunk-HKV7LRHY.js.map} +1 -1
  39. package/dist/{chunk-EMXAIRUJ.js → chunk-IRTGUQ5O.js} +5 -4
  40. package/dist/chunk-IRTGUQ5O.js.map +1 -0
  41. package/dist/{chunk-H6ZAOWNE.js → chunk-JVBYV6TL.js} +3 -3
  42. package/dist/{chunk-H6ZAOWNE.js.map → chunk-JVBYV6TL.js.map} +1 -1
  43. package/dist/chunk-KHK5FGER.js +145 -0
  44. package/dist/chunk-KHK5FGER.js.map +1 -0
  45. package/dist/chunk-NEXR37YJ.js +144 -0
  46. package/dist/chunk-NEXR37YJ.js.map +1 -0
  47. package/dist/{chunk-A2ACAGW6.js → chunk-O6FFFOHS.js} +32 -7
  48. package/dist/chunk-O6FFFOHS.js.map +1 -0
  49. package/dist/chunk-QGMOA2YE.js +731 -0
  50. package/dist/chunk-QGMOA2YE.js.map +1 -0
  51. package/dist/{chunk-ERFMC6WU.js → chunk-S4NCI32V.js} +19 -10
  52. package/dist/chunk-S4NCI32V.js.map +1 -0
  53. package/dist/{chunk-753Y6HE6.js → chunk-SLAQPUI4.js} +4 -4
  54. package/dist/chunk-SLAQPUI4.js.map +1 -0
  55. package/dist/{chunk-REOBGYMC.js → chunk-TJ77A4A3.js} +3 -5
  56. package/dist/chunk-TJ77A4A3.js.map +1 -0
  57. package/dist/chunk-TYN6MLXX.js +13864 -0
  58. package/dist/chunk-TYN6MLXX.js.map +1 -0
  59. package/dist/{chunk-RS3HRQWU.js → chunk-WPLAANH4.js} +4 -3
  60. package/dist/chunk-WPLAANH4.js.map +1 -0
  61. package/dist/config/index.d.ts +51 -7
  62. package/dist/config/index.js +4 -5
  63. package/dist/controls/index.d.ts +92 -5
  64. package/dist/controls/index.js +5 -4
  65. package/dist/dragdrop/index.d.ts +9 -6
  66. package/dist/dragdrop/index.js +3 -2
  67. package/dist/index.d.ts +108 -154
  68. package/dist/index.js +456 -600
  69. package/dist/index.js.map +1 -1
  70. package/dist/layers/index.d.ts +5 -35
  71. package/dist/layers/index.js +3 -3
  72. package/dist/loupe/index.d.ts +21 -17
  73. package/dist/loupe/index.js +5 -3
  74. package/dist/overview/index.d.ts +56 -0
  75. package/dist/overview/index.js +288 -0
  76. package/dist/overview/index.js.map +1 -0
  77. package/dist/passthrough/weasel-ui.d.ts +434 -231
  78. package/dist/passthrough/weasel-ui.js +2 -1
  79. package/dist/primitives/index.d.ts +19 -54
  80. package/dist/primitives/index.js +6 -4
  81. package/dist/state/index.d.ts +8 -7
  82. package/dist/state/index.js +4 -5
  83. package/dist/state/index.js.map +1 -1
  84. package/dist/styles.css +360 -174
  85. package/dist/undo/index.d.ts +5 -4
  86. package/package.json +13 -13
  87. package/src/annotations/frac.test.ts +7 -0
  88. package/src/annotations/index.ts +1 -0
  89. package/src/annotations/paint.test.ts +21 -0
  90. package/src/annotations/paint.ts +12 -0
  91. package/src/annotations/store.test.ts +57 -0
  92. package/src/annotations/store.ts +25 -6
  93. package/src/annotations/toolMap.test.ts +37 -2
  94. package/src/annotations/toolMap.ts +13 -0
  95. package/src/annotations/types.ts +30 -2
  96. package/src/canvas/AGENTS.md +8 -10
  97. package/src/canvas/CameraInput.test.tsx +136 -0
  98. package/src/canvas/CameraInput.tsx +311 -0
  99. package/src/canvas/CanvasStack.tsx +42 -58
  100. package/src/canvas/LinkedCursor.less +16 -0
  101. package/src/canvas/LinkedCursor.tsx +54 -0
  102. package/src/canvas/Stage.test.tsx +18 -0
  103. package/src/canvas/Stage.tsx +42 -37
  104. package/src/canvas/cameraView.test.ts +60 -0
  105. package/src/canvas/cameraView.ts +61 -0
  106. package/src/canvas/index.ts +11 -2
  107. package/src/chrome/regions/SidebarRegion.less +197 -0
  108. package/src/chrome/regions/SidebarRegion.test.tsx +27 -0
  109. package/src/chrome/regions/SidebarRegion.tsx +7 -2
  110. package/src/chrome/types.ts +5 -2
  111. package/src/config/autoConfig.ts +2 -2
  112. package/src/config/builder.ts +21 -2
  113. package/src/config/entry.test.ts +10 -0
  114. package/src/config/fromConfigField.ts +1 -0
  115. package/src/config/index.ts +5 -0
  116. package/src/config/resolve.ts +11 -1
  117. package/src/config/rules.ts +2 -0
  118. package/src/config/sectionTree.test.ts +152 -0
  119. package/src/config/sectionTree.ts +134 -0
  120. package/src/config/types.ts +21 -0
  121. package/src/controls/ControlPanel.less +4 -0
  122. package/src/controls/ControlPanel.stories.tsx +55 -2
  123. package/src/controls/ControlPanel.test.tsx +40 -3
  124. package/src/controls/ControlPanel.tsx +134 -336
  125. package/src/controls/inDialog.test.tsx +100 -0
  126. package/src/controls/inDialog.tsx +38 -0
  127. package/src/controls/index.ts +1 -0
  128. package/src/index.test.ts +1 -1
  129. package/src/index.ts +18 -29
  130. package/src/instrument/SineWave.smoke.test.tsx +2 -0
  131. package/src/instrument/types.ts +15 -3
  132. package/src/lab/Lab.nebula.test.tsx +40 -0
  133. package/src/lab/Lab.test.tsx +3 -1
  134. package/src/lab/Lab.tsx +42 -19
  135. package/src/lab/LabBoundary.test.tsx +66 -0
  136. package/src/lab/LabBoundary.tsx +56 -0
  137. package/src/lab/LabHeader.tsx +4 -23
  138. package/src/lab/LabRoot.tsx +2 -3
  139. package/src/lab/LabShell.less +0 -1
  140. package/src/lab/LabShell.stories.tsx +15 -0
  141. package/src/lab/LabShell.test.tsx +18 -0
  142. package/src/lab/LabShell.tsx +14 -1
  143. package/src/lab/LabSwitcher.less +1 -1
  144. package/src/lab/LabSwitcher.test.tsx +41 -0
  145. package/src/lab/LabSwitcher.tsx +30 -8
  146. package/src/lab/index.ts +1 -0
  147. package/src/layers/AGENTS.md +18 -74
  148. package/src/layers/index.ts +4 -2
  149. package/src/loupe/AGENTS.md +7 -6
  150. package/src/loupe/LoupeGestures.tsx +14 -9
  151. package/src/loupe/TrialLoupe.tsx +5 -5
  152. package/src/loupe/index.ts +1 -0
  153. package/src/loupe/loupeActions.ts +6 -2
  154. package/src/overview/AGENTS.md +38 -0
  155. package/src/overview/OverviewMarks.test.tsx +100 -0
  156. package/src/overview/OverviewMarks.tsx +93 -0
  157. package/src/overview/TrialOverview.less +53 -0
  158. package/src/overview/TrialOverview.stories.tsx +50 -0
  159. package/src/overview/TrialOverview.test.tsx +116 -0
  160. package/src/overview/TrialOverview.tsx +374 -0
  161. package/src/overview/index.ts +2 -0
  162. package/src/passthrough/weasel-ui.ts +32 -10
  163. package/src/primitives/index.ts +0 -2
  164. package/src/specimen/Specimen.tsx +59 -56
  165. package/src/state/labRecords.test.ts +4 -1
  166. package/src/state/store.test.ts +4 -4
  167. package/src/state/types.ts +2 -1
  168. package/src/state/useTrialState.test.tsx +1 -1
  169. package/src/styles.less +6 -2
  170. package/src/theme/Interstellar.stories.tsx +8 -13
  171. package/src/theme/base.less +3 -20
  172. package/src/theme/interstellar.test.ts +6 -3
  173. package/src/theme/interstellar.theme.json +0 -56
  174. package/src/theme/interstellar.ts +2 -2
  175. package/src/tools/labTool.ts +6 -2
  176. package/src/trial/Trial.annotations.test.tsx +16 -0
  177. package/src/trial/Trial.canvas.test.tsx +1 -1
  178. package/src/trial/Trial.loupe.test.tsx +73 -1
  179. package/src/trial/Trial.stories.tsx +2 -0
  180. package/src/trial/Trial.tsx +47 -9
  181. package/src/trial/trialOps.test.ts +4 -4
  182. package/dist/_dts/index-8LiKe3A-.d.ts +0 -410
  183. package/dist/chunk-2AYGEN57.js +0 -32
  184. package/dist/chunk-2AYGEN57.js.map +0 -1
  185. package/dist/chunk-6BUQ77ZV.js +0 -18
  186. package/dist/chunk-6BUQ77ZV.js.map +0 -1
  187. package/dist/chunk-753Y6HE6.js.map +0 -1
  188. package/dist/chunk-A2ACAGW6.js.map +0 -1
  189. package/dist/chunk-CKUKF72R.js.map +0 -1
  190. package/dist/chunk-D35PFTS7.js +0 -170
  191. package/dist/chunk-D35PFTS7.js.map +0 -1
  192. package/dist/chunk-EMXAIRUJ.js.map +0 -1
  193. package/dist/chunk-ERFMC6WU.js.map +0 -1
  194. package/dist/chunk-FKLT3ITC.js +0 -590
  195. package/dist/chunk-FKLT3ITC.js.map +0 -1
  196. package/dist/chunk-KJCUERQF.js.map +0 -1
  197. package/dist/chunk-LASCBWW7.js +0 -13456
  198. package/dist/chunk-LASCBWW7.js.map +0 -1
  199. package/dist/chunk-REOBGYMC.js.map +0 -1
  200. package/dist/chunk-RS3HRQWU.js.map +0 -1
  201. package/dist/chunk-TT5C5S6R.js +0 -368
  202. package/dist/chunk-TT5C5S6R.js.map +0 -1
  203. package/dist/ui/layers/index.d.ts +0 -66
  204. package/dist/ui/layers/index.js +0 -3
  205. package/dist/ui/layers/index.js.map +0 -1
  206. package/src/canvas/usePanZoom.test.ts +0 -244
  207. package/src/canvas/usePanZoom.ts +0 -147
  208. package/src/lab/useSystemMode.ts +0 -30
  209. package/src/layers/LayerList.less +0 -93
  210. package/src/layers/LayerList.stories.tsx +0 -66
  211. package/src/layers/LayerList.test.tsx +0 -232
  212. package/src/layers/LayerList.tsx +0 -268
  213. package/src/primitives/Sidebar.less +0 -112
  214. package/src/primitives/Sidebar.stories.tsx +0 -38
  215. package/src/primitives/Sidebar.test.tsx +0 -74
  216. package/src/primitives/Sidebar.tsx +0 -35
  217. package/src/ui/layers/index.ts +0 -5
@@ -1,4 +1,5 @@
1
- import { resolveFrame, screenToWorld } from './chunk-2AYGEN57.js';
1
+ import { screenToWorld } from './chunk-AWQG7FCC.js';
2
+ import { resolveFrame } from './chunk-24W5VEJW.js';
2
3
  import { useState, useEffect, useRef, useCallback } from 'react';
3
4
  import { createPortal } from 'react-dom';
4
5
  import { jsx } from 'react/jsx-runtime';
@@ -138,5 +139,5 @@ function Palette({ items, onDragStart, className }) {
138
139
  }
139
140
 
140
141
  export { DragGhost, DragOverlay, Palette, useDragDrop };
141
- //# sourceMappingURL=chunk-RS3HRQWU.js.map
142
- //# sourceMappingURL=chunk-RS3HRQWU.js.map
142
+ //# sourceMappingURL=chunk-WPLAANH4.js.map
143
+ //# sourceMappingURL=chunk-WPLAANH4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dragdrop/DragGhost.tsx","../src/dragdrop/DragDropRuntime.tsx","../src/dragdrop/Palette.tsx"],"names":["useState","useEffect","jsx"],"mappings":";;;;;;;AASO,SAAS,SAAA,CAAU,EAAE,IAAA,EAAM,SAAA,EAAU,EAAuC;AACjF,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,SAAA,CAAU,MAAM,UAAA,CAAW,IAAI,CAAA,EAAG,EAAE,CAAA;AACpC,EAAA,IAAI,CAAC,OAAA,IAAW,OAAO,QAAA,KAAa,aAAa,OAAO,IAAA;AACxD,EAAA,MAAM,KAAA,GAAQ;AAAA,IACZ,IAAA,EAAM,CAAA,EAAG,SAAA,CAAU,CAAA,GAAI,EAAE,CAAA,EAAA,CAAA;AAAA,IACzB,GAAA,EAAK,CAAA,EAAG,SAAA,CAAU,CAAA,GAAI,EAAE,CAAA,EAAA;AAAA,GAC1B;AACA,EAAA,OAAO,YAAA;AAAA,oBACL,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,eAAA,EAAgB,KAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,S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AC,SAAA,EAAA,EAAU,IAAA,EAAM,KAAK,IAAA,EAAM,SAAA,EAAW,KAAK,SAAA,EAAW,CAAA;AAChE;AClKO,SAAS,OAAA,CAAQ,EAAE,KAAA,EAAO,WAAA,EAAa,WAAU,EAAiB;AACvE,EAAA,uBACEA,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,SAAA,GAAY,CAAA,WAAA,EAAc,SAAS,CAAA,CAAA,GAAK,YAAA,EACrD,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,yBACVA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MAEL,SAAA,EAAU,kBAAA;AAAA,MACV,aAAA,EAAe,CAAC,CAAA,KAAM;AACpB,QAAA,CAAA,CAAE,cAAA,EAAe;AACjB,QAAA,WAAA,CAAY,MAAM,CAAC,CAAA;AAAA,MACrB,CAAA;AAAA,MAEA,0BAAAA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mBAAA,EAAqB,eAAK,KAAA,EAAM;AAAA,KAAA;AAAA,IAP3C,IAAA,CAAK;AAAA,GASb,CAAA,EACH,CAAA;AAEJ","file":"chunk-WPLAANH4.js","sourcesContent":["import { type ReactPortal, useEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { PaletteItem, Point } from '../instrument/types';\n\nexport interface DragGhostProps {\n item: PaletteItem;\n screenPos: Point;\n}\n\nexport function DragGhost({ item, screenPos }: DragGhostProps): ReactPortal | null {\n const [mounted, setMounted] = useState(false);\n useEffect(() => setMounted(true), []);\n if (!mounted || typeof document === 'undefined') return null;\n const style = {\n left: `${screenPos.x + 12}px`,\n top: `${screenPos.y + 12}px`,\n };\n return createPortal(\n <div className=\"lk-drag-ghost\" style={style}>\n <span className=\"lk-drag-ghost__label\">{item.label}</span>\n </div>,\n document.body,\n );\n}\n","import { openPointerSession, type PointerSession, useVisibleRaf } from '@weasel-js/core';\nimport {\n type PointerEvent as ReactPointerEvent,\n type RefObject,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { screenToWorld } from '../canvas/canvasCoords';\nimport { resolveFrame, type WorldSpec } from '../canvas/worldSpec';\nimport type {\n DragDropCapability,\n DragFeedback,\n PaletteItem,\n Point,\n ViewTransform,\n} from '../instrument/types';\nimport { DragGhost } from './DragGhost';\n\nexport interface DragState {\n item: PaletteItem;\n screenPos: Point;\n feedback: DragFeedback | null;\n}\n\nexport interface UseDragDropArgs<TS, TC> {\n capability: DragDropCapability<TS, TC>;\n canvasContainerRef: RefObject<HTMLElement | null>;\n view: ViewTransform;\n /** The instrument's coordinate system, resolved against the container each\n * time a screen point is converted — the container is what knows its size. */\n worldSpec?: WorldSpec;\n state: TS;\n config: TC;\n setState: (next: TS | ((prev: TS) => TS)) => void;\n emit: (event: string) => void;\n}\n\nexport interface UseDragDropResult {\n drag: DragState | null;\n startDrag: (item: PaletteItem, e: ReactPointerEvent) => void;\n}\n\nexport function useDragDrop<TS, TC>({\n capability,\n canvasContainerRef,\n view,\n state,\n config,\n setState,\n emit,\n worldSpec,\n}: UseDragDropArgs<TS, TC>): UseDragDropResult {\n const [drag, setDrag] = useState<DragState | null>(null);\n const dragRef = useRef<DragState | null>(null);\n dragRef.current = drag;\n /** The move the next frame will resolve. Doubles as the throttle's flag:\n * non-null means a frame is already queued. */\n const pendingPos = useRef<Point | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n\n /** A session keeps the closure it was opened with, so everything the drop\n * reads has to come from here rather than from that closure. */\n const liveRef = useRef({ capability, state, config, setState, emit, view, worldSpec });\n liveRef.current = { capability, state, config, setState, emit, view, worldSpec };\n\n const isOverCanvas = useCallback(\n (screenPos: Point): boolean => {\n const el = canvasContainerRef.current;\n if (!el) return false;\n const r = el.getBoundingClientRect();\n return (\n screenPos.x >= r.left &&\n screenPos.x <= r.right &&\n screenPos.y >= r.top &&\n screenPos.y <= r.bottom\n );\n },\n [canvasContainerRef],\n );\n\n const screenToWorldFromContainer = useCallback(\n (screenPos: Point): Point | null => {\n const el = canvasContainerRef.current;\n if (!el) return null;\n const r = el.getBoundingClientRect();\n const frame = resolveFrame(liveRef.current.worldSpec, { width: r.width, height: r.height });\n return screenToWorld(\n { x: screenPos.x - r.left, y: screenPos.y - r.top },\n liveRef.current.view,\n frame,\n );\n },\n [canvasContainerRef],\n );\n\n const frameLoop = useVisibleRaf(() => {\n const screenPos = pendingPos.current;\n pendingPos.current = null;\n const active = dragRef.current;\n if (!active || !screenPos) return;\n const live = liveRef.current;\n let feedback: DragFeedback | null = null;\n if (live.capability.onDragOver && isOverCanvas(screenPos)) {\n const world = screenToWorldFromContainer(screenPos);\n if (world) feedback = live.capability.onDragOver(world, active.item, live.state, live.config);\n }\n setDrag({ ...active, screenPos, feedback });\n });\n\n const clearDrag = useCallback(() => {\n pendingPos.current = null;\n frameLoop.cancel();\n sessionRef.current = null;\n dragRef.current = null;\n setDrag(null);\n }, [frameLoop]);\n\n const startDrag = useCallback(\n (item: PaletteItem, e: ReactPointerEvent) => {\n if (sessionRef.current) return;\n const next: DragState = { item, screenPos: { x: e.clientX, y: e.clientY }, feedback: null };\n dragRef.current = next;\n setDrag(next);\n sessionRef.current = openPointerSession(e.currentTarget, e, {\n onMove: (ev) => {\n const screenPos = { x: ev.clientX, y: ev.clientY };\n const current = dragRef.current;\n if (!current) return;\n if (pendingPos.current !== null) {\n // A frame is already queued: keep the ghost under the cursor and\n // let that frame probe the drop target from the newest position.\n pendingPos.current = screenPos;\n dragRef.current = { ...current, screenPos };\n setDrag(dragRef.current);\n return;\n }\n pendingPos.current = screenPos;\n frameLoop.request();\n },\n onEnd: (ev) => {\n const screenPos = { x: ev.clientX, y: ev.clientY };\n const active = dragRef.current;\n clearDrag();\n if (!active || !isOverCanvas(screenPos)) return;\n const world = screenToWorldFromContainer(screenPos);\n if (!world) return;\n const live = liveRef.current;\n live.setState(live.capability.onDrop(world, active.item, live.state, live.config));\n live.emit('canvas.itemAdded');\n },\n // An interrupted gesture never named a destination, so it drops nothing.\n onCancel: clearDrag,\n });\n },\n [clearDrag, frameLoop, isOverCanvas, screenToWorldFromContainer],\n );\n\n useEffect(() => () => sessionRef.current?.cancel(), []);\n\n return { drag, startDrag };\n}\n\nexport interface DragOverlayProps {\n drag: DragState | null;\n}\n\nexport function DragOverlay({ drag }: DragOverlayProps) {\n if (!drag) return null;\n return <DragGhost item={drag.item} screenPos={drag.screenPos} />;\n}\n","import type { PointerEvent as ReactPointerEvent } from 'react';\nimport type { PaletteItem } from '../instrument/types';\n\nexport interface PaletteProps {\n items: PaletteItem[];\n onDragStart: (item: PaletteItem, e: ReactPointerEvent) => void;\n className?: string;\n}\n\nexport function Palette({ items, onDragStart, className }: PaletteProps) {\n return (\n <div className={className ? `lk-palette ${className}` : 'lk-palette'}>\n {items.map((item) => (\n <button\n type=\"button\"\n key={item.id}\n className=\"lk-palette__item\"\n onPointerDown={(e) => {\n e.preventDefault();\n onDragStart(item, e);\n }}\n >\n <span className=\"lk-palette__label\">{item.label}</span>\n </button>\n ))}\n </div>\n );\n}\n"]}
@@ -1,11 +1,14 @@
1
- import { a0 as Auto, K as Instrument } from '../_dts/frac-B4hFJMiN.js';
2
- export { ax as auto, aD as isAuto } from '../_dts/frac-B4hFJMiN.js';
3
- import { R as ResolvedConfig, l as ConfigNode, A as Annotations, N as NodeOptions, v as SectionOption, d as ControlRenderer, n as ConfigOption, p as ConfigShape, h as ConfigBranch, B as BranchAnnotations, e as BranchOptions, b as ConfigSchema, I as InferConfig, i as ConfigEntry, a as ConfigField, c as ConfigRule, L as LeafPatch, o as ConfigRuleContext } from '../_dts/types-Db-3NNk1.js';
4
- export { m as ConfigOf, C as ConfigPath, E as EntryValue, q as NodeValue, S as SectionSpec, V as ValueAtPath } from '../_dts/types-Db-3NNk1.js';
1
+ import { a5 as Auto } from '../_dts/types-B7yBTTF9.js';
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';
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';
5
7
  import { ToolPrefNumberFormat, ToolPrefNumberUnit, ToolPrefLeaf, ToolPrefGroup } from '@weasel-js/core';
6
8
  import 'react';
9
+ import '../_dts/PrefsRow.d-DFpPIeIC.js';
10
+ import '@weasel-js/theme';
7
11
  import '../_dts/types-DJ79Tg5J.js';
8
- import '../_dts/PrefsForm.d-DPy9I8It.js';
9
12
 
10
13
  /** The dotted paths a schema declares as starting auto — every leaf that said
11
14
  * `.initial(auto)`. This is what seeds a new trial's unpinned set. */
@@ -52,6 +55,9 @@ declare abstract class BaseNode<T> implements ConfigNode<T> {
52
55
  showIf(predicate: (config: Record<string, unknown>) => boolean): this;
53
56
  /** Draw this one row yourself, keeping the kind, default and validation. */
54
57
  render(renderer: ControlRenderer): this;
58
+ /** Draw this row as a button that opens a dialog, with `body` as the
59
+ * dialog's content — for an editor too big for the row. */
60
+ dialog(body: ControlRenderer, opts?: InDialogOptions): this;
55
61
  /**
56
62
  * Compute this leaf's value while it is auto, instead of leaving it
57
63
  * `undefined`. The resolver is given the config with every other auto path
@@ -75,7 +81,7 @@ declare class NumberNode extends BaseNode<number> {
75
81
  /** A display suffix for the value — `'px'`, `'ms'`, `'°'`. Presentation only:
76
82
  * it is never parsed, and the stored value stays a plain number. */
77
83
  suffix(suffix: string): this;
78
- /** Show the value in a named format — `'compact'` reads `2.0M`. Presentation
84
+ /** Show the value in a named format — `'compact'` reads `2.00M`. Presentation
79
85
  * only: the stored value stays a plain number, and a typed `2.5m` reads back. */
80
86
  format(format: ToolPrefNumberFormat): this;
81
87
  /**
@@ -102,6 +108,11 @@ declare class StringNode extends BaseNode<string> {
102
108
  /** Milliseconds to debounce live writes. 0 commits every keystroke. */
103
109
  debounce(debounceMs: number): this;
104
110
  }
111
+ declare class ListNode extends BaseNode<string[]> {
112
+ readonly kind = "list";
113
+ /** Shown in an empty entry. */
114
+ placeholder(placeholder: string): this;
115
+ }
105
116
  declare class ColorNode extends BaseNode<string> {
106
117
  readonly kind = "color";
107
118
  /** The value carries alpha as `#rrggbbaa`, and the row gets an opacity
@@ -166,6 +177,9 @@ declare const f: {
166
177
  boolean: (def: boolean) => BooleanNode;
167
178
  string: (def: string) => StringNode;
168
179
  color: (def: string) => ColorNode;
180
+ /** A list of strings. Its row summarizes the list, and opens a dialog to
181
+ * edit it one entry per field. */
182
+ list: (def: readonly string[]) => ListNode;
169
183
  /** A fixed set of choices. The default's literal type flows into the config
170
184
  * type, so `f.enum('fast', ['fast', 'accurate'])` gives
171
185
  * `'fast' | 'accurate'` with no `as const`. */
@@ -243,6 +257,35 @@ declare const builtinRules: readonly ConfigRule[];
243
257
  */
244
258
  declare function applyRules(seed: LeafPatch, ctx: Omit<ConfigRuleContext, 'leaf'>, rules: readonly ConfigRule[]): LeafPatch;
245
259
 
260
+ /**
261
+ * A resolved schema rearranged so its sections are groups.
262
+ *
263
+ * `PrefsForm`'s rail navigates the schema tree — top-level groups are its
264
+ * items, their group children indent under them. A resolved schema keeps its
265
+ * sections beside the tree instead, so a flat schema's rail comes out as one
266
+ * unnamed item however many headings the panel draws. This puts the sections
267
+ * where the rail looks for them.
268
+ */
269
+ interface SectionTree {
270
+ /** The rail's schema. Top-level children are the schema's root sections,
271
+ * followed by any root node no section claimed. */
272
+ group: ToolPrefGroup;
273
+ /** `config` renested to mirror `group` — the value tree `PrefsForm` takes. */
274
+ values: Record<string, unknown>;
275
+ /** The config path a path within `group` stands for. */
276
+ pathAt: (railPath: string) => string;
277
+ }
278
+ /**
279
+ * Turn a resolved schema's root sections into the top level of a `PrefGroup`,
280
+ * for `PrefsForm`'s rail layout.
281
+ *
282
+ * A section naming a group brings that group in whole, so it lands as an
283
+ * indented rail item; a section naming a leaf drops it loose into the
284
+ * section's own pane. Sections nested under a group are left alone — they
285
+ * bucket rows inside a pane, which is the panel's job and not the rail's.
286
+ */
287
+ declare function sectionTree(resolved: ResolvedConfig, config: Record<string, unknown>, showHidden?: boolean): SectionTree;
288
+
246
289
  /**
247
290
  * An instrument's controls, resolved against the surrounding lab's rules.
248
291
  *
@@ -272,4 +315,5 @@ declare function useResolvedConfig<TC>(schema: ResolvedConfig | undefined, confi
272
315
  */
273
316
  declare function isLeafVisible(resolved: ResolvedConfig, path: string, config: Record<string, unknown>, showHidden?: boolean): boolean;
274
317
 
275
- export { Annotations, Auto, BaseNode, BooleanNode, BranchAnnotations, BranchOptions, ColorNode, ConfigBranch, ConfigEntry, ConfigNode, ConfigOption, ConfigRule, ConfigRuleContext, ConfigSchema, ConfigShape, ControlRenderer, CustomNode, EnumNode, GroupNode, InferConfig, LeafPatch, NodeOptions, NumberNode, ResolvedConfig, StringNode, ValueNode, applyRules, autoPathsOf, builtinRules, f, fillConfigDefaults, fromConfigFields, hasConfigPath, isConfigBranch, isLeafVisible, resolveAutoConfig, resolveConfigSchema, schemaNodeAtPath, titleCase, useConfigSchema, useResolvedConfig, valueAtPath, withValueAtPath };
318
+ export { Annotations, Auto, BaseNode, BooleanNode, BranchAnnotations, BranchOptions, ColorNode, ConfigBranch, ConfigEntry, ConfigNode, ConfigOption, ConfigRule, ConfigRuleContext, ConfigSchema, ConfigShape, ControlRenderer, CustomNode, EnumNode, GroupNode, InDialogOptions, InferConfig, LeafPatch, ListNode, NodeOptions, NumberNode, ResolvedConfig, SectionOption, StringNode, ValueNode, applyRules, autoPathsOf, builtinRules, f, fillConfigDefaults, fromConfigFields, hasConfigPath, isConfigBranch, isLeafVisible, resolveAutoConfig, resolveConfigSchema, schemaNodeAtPath, sectionTree, titleCase, useConfigSchema, useResolvedConfig, valueAtPath, withValueAtPath };
319
+ export type { SectionTree };
@@ -1,8 +1,7 @@
1
- export { useConfigSchema } from '../chunk-6BUQ77ZV.js';
1
+ export { sectionTree, useConfigSchema } from '../chunk-GHGO52SO.js';
2
2
  import '../chunk-Z76KEZAX.js';
3
- export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from '../chunk-A2ACAGW6.js';
4
- export { fromConfigFields, isLeafVisible } from '../chunk-EMXAIRUJ.js';
5
- export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from '../chunk-REOBGYMC.js';
6
- import '../chunk-LASCBWW7.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';
7
6
  //# sourceMappingURL=index.js.map
8
7
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,93 @@
1
- export { e as ControlPanel } from '../_dts/index-8LiKe3A-.js';
2
- export { f as CheckboxField, g as ColorField, a as ConfigField, k as ConfigFieldType, r as NumberField, s as SelectField, t as SelectOption, u as SliderField, T as TextField } from '../_dts/types-Db-3NNk1.js';
3
- import 'react/jsx-runtime';
4
- import 'react';
1
+ import * as react from 'react';
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';
7
+ 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';
5
10
  import '@weasel-js/core';
6
- import '../_dts/PrefsForm.d-DPy9I8It.js';
11
+
12
+ /** How a panel packs its rows into the two-column property grid.
13
+ * - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
14
+ * two per row; the ones that need the width — text, sliders, segmented
15
+ * toggles — span it.
16
+ * - `'pairs'`: every row pairs. A control that needs the full width says so
17
+ * itself, with `<PropertyRow span>`.
18
+ * - `'one-up'`: one control per row, colors excepted.
19
+ */
20
+ type ControlPack = 'auto' | 'pairs' | 'one-up';
21
+ interface ControlPanelProps<TC extends Record<string, unknown>> extends StanceProps {
22
+ /** The instrument's resolved config schema. */
23
+ schema?: ResolvedConfig;
24
+ /** @deprecated Pass `schema`. A field list is adapted into one internally. */
25
+ fields?: ConfigField[];
26
+ config: TC;
27
+ /** Writes one value. The path is dotted for a leaf inside an `f.group`, and
28
+ * the bare key for one at the root. */
29
+ setConfig: (path: string, value: unknown) => void;
30
+ /**
31
+ * Control overrides and app-defined kinds, PrefsForm-style. Keys are config
32
+ * paths (checked first) or leaf kinds. A renderer returning `null` collapses
33
+ * the row; entries override the built-in rows on collision.
34
+ */
35
+ renderers?: Record<string, ControlRenderer>;
36
+ /** How rows pack into the two-column grid. Defaults to `'pairs'`. */
37
+ pack?: ControlPack;
38
+ /**
39
+ * Where a row's label sits relative to its control. Unset takes each row's
40
+ * own orientation — `block` (label above, which is what leaves a paired row
41
+ * room for its value) for most, `inline` for colors and checkboxes.
42
+ */
43
+ layout?: PropertyRowLayout;
44
+ /** Room the rows get. Passed straight to the property list. */
45
+ density?: PropertyDensity;
46
+ /** Cross-axis alignment of an inline row's label and control. */
47
+ align?: PropertyAlign;
48
+ /**
49
+ * Fold each section away behind a twisty, starting `'open'` or `'closed'`.
50
+ * Unset draws the heading alone, as the panel always has — unless a section
51
+ * in the schema declares how it opens, which makes that section foldable on
52
+ * its own and outranks this for that one section.
53
+ */
54
+ collapse?: 'open' | 'closed';
55
+ /**
56
+ * Which sections are folded, keyed as `onCollapse` reports them. Given, the
57
+ * panel keeps no state of its own: every toggle arrives at `onCollapse`
58
+ * instead, which is where a lab that remembers a trial's sections writes
59
+ * them.
60
+ */
61
+ collapsed?: Readonly<Record<string, boolean>>;
62
+ /** A fold moved. The key is a section's label — prefixed by its group's
63
+ * dotted path when the section sits inside one — or a group's own path. */
64
+ onCollapse?: (key: string, collapsed: boolean) => void;
65
+ /** Dotted paths currently unpinned. A row in this set hides its control and
66
+ * reads out `auto`, and clicking its label writes the sentinel back through
67
+ * `setConfig`. Omitted, the panel keeps the set itself: the labels still
68
+ * toggle and the sentinel never reaches `setConfig`, which would otherwise
69
+ * store it as the row's value. */
70
+ auto?: ReadonlySet<string>;
71
+ /** Draw leaves marked `hidden`. */
72
+ showHidden?: boolean;
73
+ /** Heads the panel. With `title`, `stance` or `tone` given, the rows sit in a
74
+ * `<PropertyPanel>` carrying them; with none, they are the bare list. */
75
+ title?: ReactNode;
76
+ className?: string;
77
+ }
78
+ /** Render an instrument's config schema as a stack of controls, each writing
79
+ * back through `setConfig`. Built on the property rows, so a lab's controls
80
+ * are the same aligned, themed rows the rest of the kit uses. */
81
+ declare function ControlPanel<TC extends Record<string, unknown>>({ schema, fields, config, setConfig, renderers, pack, layout, density, align, collapse, collapsed, onCollapse, auto: given, showHidden, title, stance, tone, className, }: ControlPanelProps<TC>): react.JSX.Element;
82
+
83
+ /** The one-line summary a dialog row shows when it is given none. */
84
+ declare function summarizeValue(value: unknown): string;
85
+ /**
86
+ * Moves a control into a modal: the row becomes a button showing a summary of
87
+ * the value, and the button opens a dialog whose body is `body`, handed the
88
+ * same context a row renderer gets. For a leaf whose editor will never fit a
89
+ * sidebar row.
90
+ */
91
+ declare function inDialog(body: ControlRenderer, opts?: InDialogOptions): ControlRenderer;
92
+
93
+ export { ConfigField, ControlPanel, InDialogOptions, inDialog, summarizeValue };
@@ -1,6 +1,7 @@
1
- export { ControlPanel } from '../chunk-FKLT3ITC.js';
2
- import '../chunk-EMXAIRUJ.js';
3
- import '../chunk-REOBGYMC.js';
4
- import '../chunk-LASCBWW7.js';
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';
5
6
  //# sourceMappingURL=index.js.map
6
7
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,12 @@
1
- import { P as PaletteItem, l as Point, m as DragFeedback, n as DragDropCapability, k as ViewTransform, a as WorldSpec } from '../_dts/frac-B4hFJMiN.js';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import { n as PaletteItem, o as DragFeedback, q as DragDropCapability } from '../_dts/types-B7yBTTF9.js';
2
+ import { WorldSpec } from '../canvas/index.js';
3
+ import { Point, ViewTransform } from '../index.js';
4
+ import * as react from 'react';
3
5
  import { RefObject, PointerEvent, ReactPortal } from 'react';
4
- import '../_dts/types-Db-3NNk1.js';
5
6
  import '@weasel-js/core';
6
- import '../_dts/PrefsForm.d-DPy9I8It.js';
7
+ import '../_dts/PrefsRow.d-DFpPIeIC.js';
8
+ import '@weasel-js/theme';
9
+ import '../_dts/types-DTuViBvc.js';
7
10
  import '../_dts/types-DJ79Tg5J.js';
8
11
 
9
12
  interface DragState {
@@ -31,7 +34,7 @@ declare function useDragDrop<TS, TC>({ capability, canvasContainerRef, view, sta
31
34
  interface DragOverlayProps {
32
35
  drag: DragState | null;
33
36
  }
34
- declare function DragOverlay({ drag }: DragOverlayProps): react_jsx_runtime.JSX.Element | null;
37
+ declare function DragOverlay({ drag }: DragOverlayProps): react.JSX.Element | null;
35
38
 
36
39
  interface DragGhostProps {
37
40
  item: PaletteItem;
@@ -44,7 +47,7 @@ interface PaletteProps {
44
47
  onDragStart: (item: PaletteItem, e: PointerEvent) => void;
45
48
  className?: string;
46
49
  }
47
- declare function Palette({ items, onDragStart, className }: PaletteProps): react_jsx_runtime.JSX.Element;
50
+ declare function Palette({ items, onDragStart, className }: PaletteProps): react.JSX.Element;
48
51
 
49
52
  export { DragDropCapability, DragFeedback, DragGhost, DragOverlay, Palette, PaletteItem, useDragDrop };
50
53
  export type { DragGhostProps, DragOverlayProps, DragState, PaletteProps, UseDragDropArgs, UseDragDropResult };
@@ -1,4 +1,5 @@
1
- export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-RS3HRQWU.js';
2
- import '../chunk-2AYGEN57.js';
1
+ export { DragGhost, DragOverlay, Palette, useDragDrop } from '../chunk-WPLAANH4.js';
2
+ import '../chunk-AWQG7FCC.js';
3
+ import '../chunk-24W5VEJW.js';
3
4
  //# sourceMappingURL=index.js.map
4
5
  //# sourceMappingURL=index.js.map