@weasel-js/core 1.13.0-rc.0 → 1.14.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 (745) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +8 -12
  3. package/dist/affordances/hitAffordanceRegions.js +1 -1
  4. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  5. package/dist/affordances/pathAnchors.js.map +1 -1
  6. package/dist/animation/clipTargets.js +1 -1
  7. package/dist/animation/clipTargets.js.map +1 -1
  8. package/dist/animation/poseTarget.js +5 -32
  9. package/dist/animation/poseTarget.js.map +1 -1
  10. package/dist/{autoPoseDescriptor-CZ1eXbzY.d.ts → autoPoseDescriptor-C25QVb0W.d.ts} +1 -1
  11. package/dist/barrel/canvas.js +8 -8
  12. package/dist/barrel/chrome.js +9 -9
  13. package/dist/barrel/input.js +1 -1
  14. package/dist/barrel/interactions.js +3 -3
  15. package/dist/barrel/paint.js +2 -2
  16. package/dist/barrel/paths.js +19 -17
  17. package/dist/barrel/renderer.js +11 -7
  18. package/dist/barrel/routing.js +4 -1
  19. package/dist/barrel/scene.js +16 -12
  20. package/dist/barrel/text.js +5 -5
  21. package/dist/barrel/viewport.js +8 -8
  22. package/dist/canvas/Canvas.js +2 -2
  23. package/dist/canvas/Canvas.js.map +1 -1
  24. package/dist/canvas/CanvasView.js +20 -14
  25. package/dist/canvas/CanvasView.js.map +1 -1
  26. package/dist/canvas/GestureReason.js +64 -0
  27. package/dist/canvas/GestureReason.js.map +1 -0
  28. package/dist/canvas/GestureReason.module.js +7 -0
  29. package/dist/canvas/GestureReason.module.js.map +1 -0
  30. package/dist/canvas/LeanSceneCanvas.js +3 -1
  31. package/dist/canvas/LeanSceneCanvas.js.map +1 -1
  32. package/dist/canvas/NodeShape.js +2 -0
  33. package/dist/canvas/NodeShape.js.map +1 -1
  34. package/dist/canvas/PickHud.js +7 -3
  35. package/dist/canvas/PickHud.js.map +1 -1
  36. package/dist/canvas/SceneCanvas/CanvasKitProviders.js +1 -1
  37. package/dist/canvas/SceneCanvas/CanvasKitProviders.js.map +1 -1
  38. package/dist/canvas/SceneCanvas/DevHuds.js +2 -2
  39. package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -1
  40. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +4 -2
  41. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  42. package/dist/canvas/SceneCanvas/SceneCanvasInput.js +3 -1
  43. package/dist/canvas/SceneCanvas/SceneCanvasInput.js.map +1 -1
  44. package/dist/canvas/SceneCanvas/brushOverlay.js.map +1 -1
  45. package/dist/canvas/SceneCanvas/builtinToolSets.js +17 -9
  46. package/dist/canvas/SceneCanvas/builtinToolSets.js.map +1 -1
  47. package/dist/canvas/SceneCanvas/canvasPassThrough.js +2 -1
  48. package/dist/canvas/SceneCanvas/canvasPassThrough.js.map +1 -1
  49. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +75 -19
  50. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  51. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +7 -1
  52. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
  53. package/dist/canvas/SceneCanvas/defaultTextEditor.js +108 -0
  54. package/dist/canvas/SceneCanvas/defaultTextEditor.js.map +1 -0
  55. package/dist/canvas/SceneCanvas/describePresets.js +47 -0
  56. package/dist/canvas/SceneCanvas/describePresets.js.map +1 -0
  57. package/dist/canvas/SceneCanvas/features.js +57 -16
  58. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  59. package/dist/canvas/SceneCanvas/mergeLayers.js +10 -1
  60. package/dist/canvas/SceneCanvas/mergeLayers.js.map +1 -1
  61. package/dist/canvas/SceneCanvas/namedPresets.js +52 -24
  62. package/dist/canvas/SceneCanvas/namedPresets.js.map +1 -1
  63. package/dist/canvas/SceneCanvas/presets/arrange.js +35 -10
  64. package/dist/canvas/SceneCanvas/presets/arrange.js.map +1 -1
  65. package/dist/canvas/SceneCanvas/presets/baseline.js +9 -0
  66. package/dist/canvas/SceneCanvas/presets/baseline.js.map +1 -0
  67. package/dist/canvas/SceneCanvas/presets/chrome.js.map +1 -1
  68. package/dist/canvas/SceneCanvas/presets/composites.js +43 -0
  69. package/dist/canvas/SceneCanvas/presets/composites.js.map +1 -0
  70. package/dist/canvas/SceneCanvas/presets/edit.js +79 -26
  71. package/dist/canvas/SceneCanvas/presets/edit.js.map +1 -1
  72. package/dist/canvas/SceneCanvas/presets/ingest.js +1 -0
  73. package/dist/canvas/SceneCanvas/presets/ingest.js.map +1 -1
  74. package/dist/canvas/SceneCanvas/presets/paths.js +58 -16
  75. package/dist/canvas/SceneCanvas/presets/paths.js.map +1 -1
  76. package/dist/canvas/SceneCanvas/presets/select.js +4 -2
  77. package/dist/canvas/SceneCanvas/presets/select.js.map +1 -1
  78. package/dist/canvas/SceneCanvas/presets/tools.js +24 -0
  79. package/dist/canvas/SceneCanvas/presets/tools.js.map +1 -0
  80. package/dist/canvas/SceneCanvas/presets/transform.js +4 -0
  81. package/dist/canvas/SceneCanvas/presets/transform.js.map +1 -1
  82. package/dist/canvas/SceneCanvas/presets/view.js +3 -1
  83. package/dist/canvas/SceneCanvas/presets/view.js.map +1 -1
  84. package/dist/canvas/SceneCanvas/props.js.map +1 -1
  85. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +1 -1
  86. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -1
  87. package/dist/canvas/SceneCanvas/toolRegistry.js +5 -4
  88. package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -1
  89. package/dist/canvas/SceneCanvas/useCanvasTools.js +26 -10
  90. package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -1
  91. package/dist/canvas/SceneCanvas/useContributionRoles.js +17 -2
  92. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -1
  93. package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +5 -4
  94. package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js.map +1 -1
  95. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +1 -1
  96. package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -1
  97. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +9 -8
  98. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -1
  99. package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +2 -2
  100. package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js.map +1 -1
  101. package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +4 -1
  102. package/dist/canvas/SceneCanvas/useSceneCanvasTools.js.map +1 -1
  103. package/dist/canvas/SceneCanvas/useSceneChrome.js +7 -4
  104. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -1
  105. package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +9 -9
  106. package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js.map +1 -1
  107. package/dist/canvas/SceneCanvas/useScenePicking.js +4 -7
  108. package/dist/canvas/SceneCanvas/useScenePicking.js.map +1 -1
  109. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +2 -1
  110. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -1
  111. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +6 -6
  112. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  113. package/dist/canvas/SceneCanvas/useSceneStandardActions.js +2 -2
  114. package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
  115. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +1 -1
  116. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -1
  117. package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js.map +1 -1
  118. package/dist/canvas/SceneCanvas/useToolKeybindings.js +2 -2
  119. package/dist/canvas/SceneCanvas/useToolKeybindings.js.map +1 -1
  120. package/dist/canvas/SceneCanvas/useViewportActions.js +5 -2
  121. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
  122. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -1
  123. package/dist/canvas/SceneCanvas.js +22 -11
  124. package/dist/canvas/SceneCanvas.js.map +1 -1
  125. package/dist/canvas/SceneViewCanvas.js +1 -0
  126. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  127. package/dist/canvas/ViewMarker.js.map +1 -1
  128. package/dist/canvas/accentColor.js +14 -1
  129. package/dist/canvas/accentColor.js.map +1 -1
  130. package/dist/canvas/affordanceAt.js +2 -2
  131. package/dist/canvas/affordanceAt.js.map +1 -1
  132. package/dist/canvas/buildSceneLayer.js +1 -1
  133. package/dist/canvas/buildSceneLayer.js.map +1 -1
  134. package/dist/canvas/buildSceneTree.js +5 -3
  135. package/dist/canvas/buildSceneTree.js.map +1 -1
  136. package/dist/canvas/canvasRenderer.js +6 -2
  137. package/dist/canvas/canvasRenderer.js.map +1 -1
  138. package/dist/canvas/deps/editAnchors.js +4 -4
  139. package/dist/canvas/deps/editAnchors.js.map +1 -1
  140. package/dist/canvas/deps/enteredGroup.js +14 -5
  141. package/dist/canvas/deps/enteredGroup.js.map +1 -1
  142. package/dist/canvas/deps/ingestion.js +5 -1
  143. package/dist/canvas/deps/ingestion.js.map +1 -1
  144. package/dist/canvas/deps/insert.js.map +1 -1
  145. package/dist/canvas/deps/insertSite.js +5 -3
  146. package/dist/canvas/deps/insertSite.js.map +1 -1
  147. package/dist/canvas/deps/nodeAtPoint.js +1 -12
  148. package/dist/canvas/deps/nodeAtPoint.js.map +1 -1
  149. package/dist/canvas/deps/pathEditCommits.js +3 -3
  150. package/dist/canvas/deps/pathEditCommits.js.map +1 -1
  151. package/dist/canvas/deps/slice.js +16 -2
  152. package/dist/canvas/deps/slice.js.map +1 -1
  153. package/dist/canvas/deps/snap.js +5 -5
  154. package/dist/canvas/deps/snap.js.map +1 -1
  155. package/dist/canvas/deps/textEdit.js +5 -6
  156. package/dist/canvas/deps/textEdit.js.map +1 -1
  157. package/dist/canvas/derivedPath.js +8 -3
  158. package/dist/canvas/derivedPath.js.map +1 -1
  159. package/dist/canvas/getNodeAtPoint.js +2 -2
  160. package/dist/canvas/getNodeAtPoint.js.map +1 -1
  161. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  162. package/dist/canvas/layerSlots.js.map +1 -1
  163. package/dist/canvas/nodeShapes/measurePainter.js +1 -1
  164. package/dist/canvas/nodeShapes/measurePainter.js.map +1 -1
  165. package/dist/canvas/nodeShapes/strokedBounds.js +5 -3
  166. package/dist/canvas/nodeShapes/strokedBounds.js.map +1 -1
  167. package/dist/canvas/overlayRoleStrokes.js +6 -0
  168. package/dist/canvas/overlayRoleStrokes.js.map +1 -1
  169. package/dist/canvas/pickIndex/scenePickIndex.js +10 -12
  170. package/dist/canvas/pickIndex/scenePickIndex.js.map +1 -1
  171. package/dist/canvas/sceneAdapter.js +10 -19
  172. package/dist/canvas/sceneAdapter.js.map +1 -1
  173. package/dist/canvas/sceneClipboard.js +17 -4
  174. package/dist/canvas/sceneClipboard.js.map +1 -1
  175. package/dist/canvas/sceneViewRender.js +7 -5
  176. package/dist/canvas/sceneViewRender.js.map +1 -1
  177. package/dist/canvas/surfaceContribution.js.map +1 -1
  178. package/dist/canvas/useCanvasPaint.js +12 -4
  179. package/dist/canvas/useCanvasPaint.js.map +1 -1
  180. package/dist/canvas/useHitObserver.js +1 -1
  181. package/dist/canvas/useHitObserver.js.map +1 -1
  182. package/dist/canvas/useViewAim.js +1 -1
  183. package/dist/canvas/useViewAim.js.map +1 -1
  184. package/dist/canvas/useViewHelpers.js +8 -5
  185. package/dist/canvas/useViewHelpers.js.map +1 -1
  186. package/dist/canvas/useViewNesting.js +39 -12
  187. package/dist/canvas/useViewNesting.js.map +1 -1
  188. package/dist/canvas/viewInputs.js.map +1 -1
  189. package/dist/canvas/viewMarkers.js +2 -2
  190. package/dist/canvas/viewMarkers.js.map +1 -1
  191. package/dist/canvas/viewRegistry.js +2 -2
  192. package/dist/canvas/viewRegistry.js.map +1 -1
  193. package/dist/canvas/viewSnap.js +67 -0
  194. package/dist/canvas/viewSnap.js.map +1 -0
  195. package/dist/clipboard.d.ts +6 -12
  196. package/dist/{clone-qb2e1F5p.d.ts → clone-Bz4iqGfE.d.ts} +10 -5
  197. package/dist/clone.d.ts +5 -5
  198. package/dist/core/geometry/booleanOfPaths.js +23 -0
  199. package/dist/core/geometry/booleanOfPaths.js.map +1 -0
  200. package/dist/core/geometry/pathPoseDescriptor.js +12 -9
  201. package/dist/core/geometry/pathPoseDescriptor.js.map +1 -1
  202. package/dist/core/geometry/poseDescriptor.js +12 -3
  203. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  204. package/dist/core/geometry/targetFrame.js +2 -13
  205. package/dist/core/geometry/targetFrame.js.map +1 -1
  206. package/dist/core/layers/render.js +2 -1
  207. package/dist/core/layers/render.js.map +1 -1
  208. package/dist/core/layers/retain.js +5 -3
  209. package/dist/core/layers/retain.js.map +1 -1
  210. package/dist/core/ops/setPath.js +3 -0
  211. package/dist/core/ops/setPath.js.map +1 -1
  212. package/dist/core/paint/meshKindLazy.js.map +1 -1
  213. package/dist/core/paint/paintKindEntry.js.map +1 -1
  214. package/dist/core/paint/paintKinds.js +8 -1
  215. package/dist/core/paint/paintKinds.js.map +1 -1
  216. package/dist/core/scene/NodeProperties.js.map +1 -1
  217. package/dist/core/scene/NodeRouting.js.map +1 -1
  218. package/dist/core/scene/booleanGroup.js +33 -0
  219. package/dist/core/scene/booleanGroup.js.map +1 -0
  220. package/dist/core/scene/booleanOfChildren.js +53 -0
  221. package/dist/core/scene/booleanOfChildren.js.map +1 -0
  222. package/dist/core/scene/carryDescendants.js +18 -6
  223. package/dist/core/scene/carryDescendants.js.map +1 -1
  224. package/dist/core/scene/composeFrame.js +42 -5
  225. package/dist/core/scene/composeFrame.js.map +1 -1
  226. package/dist/core/scene/composePose.js +35 -16
  227. package/dist/core/scene/composePose.js.map +1 -1
  228. package/dist/core/scene/depMemo.js +36 -18
  229. package/dist/core/scene/depMemo.js.map +1 -1
  230. package/dist/core/scene/derivedParts.js +2 -23
  231. package/dist/core/scene/derivedParts.js.map +1 -1
  232. package/dist/core/scene/effectivePose.js +10 -0
  233. package/dist/core/scene/effectivePose.js.map +1 -1
  234. package/dist/core/scene/historyForm.js +5 -4
  235. package/dist/core/scene/historyForm.js.map +1 -1
  236. package/dist/core/scene/kitOps.js +5 -71
  237. package/dist/core/scene/kitOps.js.map +1 -1
  238. package/dist/core/scene/kitRegistry.js +5 -0
  239. package/dist/core/scene/kitRegistry.js.map +1 -1
  240. package/dist/core/scene/layerOps.js +82 -0
  241. package/dist/core/scene/layerOps.js.map +1 -0
  242. package/dist/core/scene/layoutPass.js +14 -12
  243. package/dist/core/scene/layoutPass.js.map +1 -1
  244. package/dist/core/scene/lockGuard.js +9 -3
  245. package/dist/core/scene/lockGuard.js.map +1 -1
  246. package/dist/core/scene/nestedHit.js +5 -5
  247. package/dist/core/scene/nestedHit.js.map +1 -1
  248. package/dist/core/scene/nodeFlags.js +8 -2
  249. package/dist/core/scene/nodeFlags.js.map +1 -1
  250. package/dist/core/scene/nodeGates.js +31 -2
  251. package/dist/core/scene/nodeGates.js.map +1 -1
  252. package/dist/core/scene/pathEffects/effects.js +22 -3
  253. package/dist/core/scene/pathEffects/effects.js.map +1 -1
  254. package/dist/core/scene/pathEffects/textAlong.js +16 -3
  255. package/dist/core/scene/pathEffects/textAlong.js.map +1 -1
  256. package/dist/core/scene/pathEffects/textAlongBands.js +65 -0
  257. package/dist/core/scene/pathEffects/textAlongBands.js.map +1 -0
  258. package/dist/core/scene/reconcileSpecs.js +1 -1
  259. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  260. package/dist/core/scene/scene.js +11 -5
  261. package/dist/core/scene/scene.js.map +1 -1
  262. package/dist/core/scene/sceneEdits.js +5 -2
  263. package/dist/core/scene/sceneEdits.js.map +1 -1
  264. package/dist/core/scene/scenePoseAdapter.js +10 -1
  265. package/dist/core/scene/scenePoseAdapter.js.map +1 -1
  266. package/dist/core/scene/scrollOffsets.js +93 -0
  267. package/dist/core/scene/scrollOffsets.js.map +1 -0
  268. package/dist/core/scene/serialization.js +15 -5
  269. package/dist/core/scene/serialization.js.map +1 -1
  270. package/dist/core/scene/statedFields.js +2 -1
  271. package/dist/core/scene/statedFields.js.map +1 -1
  272. package/dist/core/scene/strategyView.js +35 -0
  273. package/dist/core/scene/strategyView.js.map +1 -0
  274. package/dist/core/scene/types.js.map +1 -1
  275. package/dist/core/scene/useScene.js +2 -0
  276. package/dist/core/scene/useScene.js.map +1 -1
  277. package/dist/core/scene/worldSave.js +87 -0
  278. package/dist/core/scene/worldSave.js.map +1 -0
  279. package/dist/core/selection/selectionTarget.js +1 -1
  280. package/dist/core/selection/selectionTarget.js.map +1 -1
  281. package/dist/{cornerHandles-CNCb7aTY.d.ts → cornerHandles-DpmQM_z5.d.ts} +1 -1
  282. package/dist/{depSchema-B1RS-IJx.d.ts → depSchema-C3BwxitB.d.ts} +130 -104
  283. package/dist/devtools-protocol.d.ts +2 -2
  284. package/dist/devtools.d.ts +2 -2
  285. package/dist/{features → domains}/chrome-caps/buildChromeCtx.js +1 -1
  286. package/dist/domains/chrome-caps/buildChromeCtx.js.map +1 -0
  287. package/dist/{features → domains}/chrome-caps/conditions.js +1 -1
  288. package/dist/domains/chrome-caps/conditions.js.map +1 -0
  289. package/dist/{features → domains}/chrome-caps/defaults.js +1 -1
  290. package/dist/domains/chrome-caps/defaults.js.map +1 -0
  291. package/dist/{features → domains}/chrome-caps/resolve.js +1 -1
  292. package/dist/domains/chrome-caps/resolve.js.map +1 -0
  293. package/dist/{features → domains}/chrome-caps/useChromeCaps.js +1 -1
  294. package/dist/domains/chrome-caps/useChromeCaps.js.map +1 -0
  295. package/dist/{features → domains}/chrome-caps/useHoverTracking.js +1 -1
  296. package/dist/domains/chrome-caps/useHoverTracking.js.map +1 -0
  297. package/dist/{features → domains}/ingestion/contentHandlers.js +20 -3
  298. package/dist/domains/ingestion/contentHandlers.js.map +1 -0
  299. package/dist/domains/ingestion/ghost.js +56 -0
  300. package/dist/domains/ingestion/ghost.js.map +1 -0
  301. package/dist/{features → domains}/ingestion/imageHandler.js +1 -1
  302. package/dist/domains/ingestion/imageHandler.js.map +1 -0
  303. package/dist/domains/ingestion/kitHandlers.js +22 -0
  304. package/dist/domains/ingestion/kitHandlers.js.map +1 -0
  305. package/dist/{features → domains}/ingestion/openFilePicker.js +1 -1
  306. package/dist/domains/ingestion/openFilePicker.js.map +1 -0
  307. package/dist/{features → domains}/ingestion/placement.js +1 -1
  308. package/dist/domains/ingestion/placement.js.map +1 -0
  309. package/dist/{features → domains}/ingestion/svgHandler.js +1 -1
  310. package/dist/domains/ingestion/svgHandler.js.map +1 -0
  311. package/dist/{features → domains}/ingestion/textHandler.js +9 -7
  312. package/dist/domains/ingestion/textHandler.js.map +1 -0
  313. package/dist/{features → domains}/ingestion/useCanvasIngestion.js +13 -15
  314. package/dist/domains/ingestion/useCanvasIngestion.js.map +1 -0
  315. package/dist/{features → domains}/ingestion/weaselJsonHandler.js +1 -1
  316. package/dist/domains/ingestion/weaselJsonHandler.js.map +1 -0
  317. package/dist/{features → domains}/longPress/longPressFeedback.js +1 -1
  318. package/dist/domains/longPress/longPressFeedback.js.map +1 -0
  319. package/dist/{features → domains}/measure/actionIds.js +1 -1
  320. package/dist/domains/measure/actionIds.js.map +1 -0
  321. package/dist/{features → domains}/measure/measureCommands.js +1 -1
  322. package/dist/domains/measure/measureCommands.js.map +1 -0
  323. package/dist/{features → domains}/measure/measureContribution.js +1 -1
  324. package/dist/domains/measure/measureContribution.js.map +1 -0
  325. package/dist/{features → domains}/measure/measureEdits.js +1 -1
  326. package/dist/domains/measure/measureEdits.js.map +1 -0
  327. package/dist/{features → domains}/measure/measureGestures.js +4 -7
  328. package/dist/domains/measure/measureGestures.js.map +1 -0
  329. package/dist/{features → domains}/measure/measureHit.js +1 -1
  330. package/dist/domains/measure/measureHit.js.map +1 -0
  331. package/dist/{features → domains}/measure/measureLayer.js +1 -1
  332. package/dist/domains/measure/measureLayer.js.map +1 -0
  333. package/dist/{features → domains}/measure/measurement.js +1 -1
  334. package/dist/domains/measure/measurement.js.map +1 -0
  335. package/dist/{features → domains}/measure/measurements.js +2 -2
  336. package/dist/domains/measure/measurements.js.map +1 -0
  337. package/dist/{features → domains}/modes/modeLayers.js +1 -1
  338. package/dist/domains/modes/modeLayers.js.map +1 -0
  339. package/dist/{features → domains}/modes/modeTriggers.js +3 -6
  340. package/dist/domains/modes/modeTriggers.js.map +1 -0
  341. package/dist/{features → domains}/pathEffects/effectSources.js +1 -1
  342. package/dist/domains/pathEffects/effectSources.js.map +1 -0
  343. package/dist/{features → domains}/pathEffects/index.js +1 -1
  344. package/dist/domains/pathEffects/index.js.map +1 -0
  345. package/dist/{features → domains}/pathEffects/readSource.js +1 -1
  346. package/dist/domains/pathEffects/readSource.js.map +1 -0
  347. package/dist/{features → domains}/pathEffects/textItems.js +11 -2
  348. package/dist/domains/pathEffects/textItems.js.map +1 -0
  349. package/dist/{features → domains}/pathEffects/useEffectSourcesLayer.js +1 -1
  350. package/dist/domains/pathEffects/useEffectSourcesLayer.js.map +1 -0
  351. package/dist/{features → domains}/paths/anchorData.js +1 -1
  352. package/dist/domains/paths/anchorData.js.map +1 -0
  353. package/dist/{features → domains}/paths/anchorMarkers.js +9 -7
  354. package/dist/domains/paths/anchorMarkers.js.map +1 -0
  355. package/dist/{features → domains}/paths/editablePath.js +1 -1
  356. package/dist/domains/paths/editablePath.js.map +1 -0
  357. package/dist/{features → domains}/paths/index.js +3 -3
  358. package/dist/{features → domains}/paths/originProjection.js +1 -1
  359. package/dist/domains/paths/originProjection.js.map +1 -0
  360. package/dist/{features → domains}/paths/pathEditExtension.js +1 -1
  361. package/dist/domains/paths/pathEditExtension.js.map +1 -0
  362. package/dist/{features → domains}/paths/pathEditState.js +1 -1
  363. package/dist/domains/paths/pathEditState.js.map +1 -0
  364. package/dist/{features → domains}/paths/pathEditingOverlayLayer.js +1 -1
  365. package/dist/domains/paths/pathEditingOverlayLayer.js.map +1 -0
  366. package/dist/{features → domains}/paths/pathLayer.js +1 -1
  367. package/dist/domains/paths/pathLayer.js.map +1 -0
  368. package/dist/{features → domains}/paths/pathRepresentation.js +1 -1
  369. package/dist/domains/paths/pathRepresentation.js.map +1 -0
  370. package/dist/{features → domains}/paths/pathSnap/glyphs.js +1 -1
  371. package/dist/domains/paths/pathSnap/glyphs.js.map +1 -0
  372. package/dist/{features → domains}/paths/pathSnap/pathSnapSource.js +1 -1
  373. package/dist/domains/paths/pathSnap/pathSnapSource.js.map +1 -0
  374. package/dist/{features → domains}/paths/pathSnap/sceneIndex.js +1 -1
  375. package/dist/domains/paths/pathSnap/sceneIndex.js.map +1 -0
  376. package/dist/{features → domains}/paths/pathSnap/snapGeometry.js +3 -2
  377. package/dist/domains/paths/pathSnap/snapGeometry.js.map +1 -0
  378. package/dist/{features → domains}/paths/penPreviewLayer.js +1 -1
  379. package/dist/domains/paths/penPreviewLayer.js.map +1 -0
  380. package/dist/{features → domains}/paths/shapeGenerator.js +6 -4
  381. package/dist/domains/paths/shapeGenerator.js.map +1 -0
  382. package/dist/{features → domains}/paths/strokeOutline.js +1 -1
  383. package/dist/domains/paths/strokeOutline.js.map +1 -0
  384. package/dist/{features → domains}/paths/useAnchorFields.js +1 -1
  385. package/dist/domains/paths/useAnchorFields.js.map +1 -0
  386. package/dist/{features → domains}/paths/usePathEdit.js +1 -1
  387. package/dist/domains/paths/usePathEdit.js.map +1 -0
  388. package/dist/{features → domains}/poseRun/usePoseRun.js +1 -1
  389. package/dist/domains/poseRun/usePoseRun.js.map +1 -0
  390. package/dist/{features → domains}/selection/enteredGroupFrame.js +49 -10
  391. package/dist/domains/selection/enteredGroupFrame.js.map +1 -0
  392. package/dist/{features → domains}/selection/enteredGroupScope.js +1 -1
  393. package/dist/domains/selection/enteredGroupScope.js.map +1 -0
  394. package/dist/domains/selection/enteredOperands.js +29 -0
  395. package/dist/domains/selection/enteredOperands.js.map +1 -0
  396. package/dist/{features → domains}/selection/handleCommands.js +1 -1
  397. package/dist/domains/selection/handleCommands.js.map +1 -0
  398. package/dist/{features → domains}/selection/overlay.js +1 -1
  399. package/dist/domains/selection/overlay.js.map +1 -0
  400. package/dist/{features → domains}/selection/selectionPose.js +1 -1
  401. package/dist/domains/selection/selectionPose.js.map +1 -0
  402. package/dist/{features → domains}/snap/angle2d.js +1 -1
  403. package/dist/domains/snap/angle2d.js.map +1 -0
  404. package/dist/{features → domains}/snap/debugCandidates.js +1 -1
  405. package/dist/domains/snap/debugCandidates.js.map +1 -0
  406. package/dist/{features → domains}/snap/gather.js +1 -1
  407. package/dist/domains/snap/gather.js.map +1 -0
  408. package/dist/{features → domains}/snap/inputSubspace.js +1 -1
  409. package/dist/domains/snap/inputSubspace.js.map +1 -0
  410. package/dist/{features → domains}/snap/lazySession.js +1 -1
  411. package/dist/domains/snap/lazySession.js.map +1 -0
  412. package/dist/{features → domains}/snap/marks.js +1 -1
  413. package/dist/domains/snap/marks.js.map +1 -0
  414. package/dist/{features → domains}/snap/outcomeStore.js +1 -1
  415. package/dist/domains/snap/outcomeStore.js.map +1 -0
  416. package/dist/{features → domains}/snap/pointSnap.js +1 -1
  417. package/dist/domains/snap/pointSnap.js.map +1 -0
  418. package/dist/{features → domains}/snap/probes2d.js +1 -1
  419. package/dist/domains/snap/probes2d.js.map +1 -0
  420. package/dist/{features → domains}/snap/readoutDraw.js +1 -1
  421. package/dist/domains/snap/readoutDraw.js.map +1 -0
  422. package/dist/{features → domains}/snap/readoutLayer.js +1 -1
  423. package/dist/domains/snap/readoutLayer.js.map +1 -0
  424. package/dist/{features → domains}/snap/registry.js +1 -1
  425. package/dist/domains/snap/registry.js.map +1 -0
  426. package/dist/{features → domains}/snap/resizeBox.js +1 -1
  427. package/dist/domains/snap/resizeBox.js.map +1 -0
  428. package/dist/{features → domains}/snap/roles.js +1 -1
  429. package/dist/domains/snap/roles.js.map +1 -0
  430. package/dist/{features → domains}/snap/rotationSource.js +1 -1
  431. package/dist/domains/snap/rotationSource.js.map +1 -0
  432. package/dist/{features → domains}/snap/sceneReads.js +24 -3
  433. package/dist/domains/snap/sceneReads.js.map +1 -0
  434. package/dist/{features → domains}/snap/sceneSession2d.js +3 -2
  435. package/dist/domains/snap/sceneSession2d.js.map +1 -0
  436. package/dist/{features → domains}/snap/screen.js +1 -1
  437. package/dist/domains/snap/screen.js.map +1 -0
  438. package/dist/{features → domains}/snap/session2d.js +3 -2
  439. package/dist/domains/snap/session2d.js.map +1 -0
  440. package/dist/{features → domains}/snap/spanSnap.js +1 -1
  441. package/dist/domains/snap/spanSnap.js.map +1 -0
  442. package/dist/{features → domains}/snap/stepAngles.js +1 -1
  443. package/dist/domains/snap/stepAngles.js.map +1 -0
  444. package/dist/{features → domains}/text/editingDrawOne.js +4 -4
  445. package/dist/domains/text/editingDrawOne.js.map +1 -0
  446. package/dist/domains/text/hostTextEditors.js +24 -0
  447. package/dist/domains/text/hostTextEditors.js.map +1 -0
  448. package/dist/{features → domains}/text/index.js +1 -1
  449. package/dist/{features → domains}/text/sceneTextDrafts.js +1 -1
  450. package/dist/domains/text/sceneTextDrafts.js.map +1 -0
  451. package/dist/{features → domains}/text/textHitAt.js +18 -2
  452. package/dist/domains/text/textHitAt.js.map +1 -0
  453. package/dist/{features → domains}/text/textLayer.js +1 -1
  454. package/dist/domains/text/textLayer.js.map +1 -0
  455. package/dist/{features → domains}/text/useSceneTextEdit.js +11 -3
  456. package/dist/domains/text/useSceneTextEdit.js.map +1 -0
  457. package/dist/{features → domains}/viewports/aim.js +1 -1
  458. package/dist/domains/viewports/aim.js.map +1 -0
  459. package/dist/{features → domains}/viewports/viewMarker.js +23 -5
  460. package/dist/domains/viewports/viewMarker.js.map +1 -0
  461. package/dist/{features → domains}/viewports/viewMarkerDrag.js +3 -3
  462. package/dist/domains/viewports/viewMarkerDrag.js.map +1 -0
  463. package/dist/{features → domains}/viewports/viewResolver.js +1 -1
  464. package/dist/domains/viewports/viewResolver.js.map +1 -0
  465. package/dist/{features → domains}/viewports/viewportLayer.js +3 -2
  466. package/dist/domains/viewports/viewportLayer.js.map +1 -0
  467. package/dist/icons.table.js +1 -1
  468. package/dist/icons.table.js.map +1 -1
  469. package/dist/icons.table.json +106 -6
  470. package/dist/index.d.ts +1445 -1053
  471. package/dist/index.js +90 -77
  472. package/dist/interactions/actions/admitsChild.js +6 -2
  473. package/dist/interactions/actions/admitsChild.js.map +1 -1
  474. package/dist/interactions/actions/align/align.js +1 -4
  475. package/dist/interactions/actions/align/align.js.map +1 -1
  476. package/dist/interactions/actions/booleans/booleanGroupAction.js +66 -0
  477. package/dist/interactions/actions/booleans/booleanGroupAction.js.map +1 -0
  478. package/dist/interactions/actions/booleans/keymap.js +52 -0
  479. package/dist/interactions/actions/booleans/keymap.js.map +1 -0
  480. package/dist/interactions/actions/booleans/operands.js +1 -1
  481. package/dist/interactions/actions/booleans/pieces.js +4 -11
  482. package/dist/interactions/actions/booleans/pieces.js.map +1 -1
  483. package/dist/interactions/actions/clipboard/action.js +3 -7
  484. package/dist/interactions/actions/clipboard/action.js.map +1 -1
  485. package/dist/interactions/actions/clipboard/clipboardOps.js +1 -1
  486. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
  487. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
  488. package/dist/interactions/actions/defaults/anchorEditing.js +6 -6
  489. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  490. package/dist/interactions/actions/defaults/bendSegment.js +1 -1
  491. package/dist/interactions/actions/defaults/bendSegment.js.map +1 -1
  492. package/dist/interactions/actions/defaults/containerScroll.js +170 -0
  493. package/dist/interactions/actions/defaults/containerScroll.js.map +1 -0
  494. package/dist/interactions/actions/defaults/contextMenu.js +2 -5
  495. package/dist/interactions/actions/defaults/contextMenu.js.map +1 -1
  496. package/dist/interactions/actions/defaults/delete.js +1 -1
  497. package/dist/interactions/actions/defaults/delete.js.map +1 -1
  498. package/dist/interactions/actions/defaults/duplicate.js +1 -3
  499. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  500. package/dist/interactions/actions/defaults/enterGroup.js +7 -12
  501. package/dist/interactions/actions/defaults/enterGroup.js.map +1 -1
  502. package/dist/interactions/actions/defaults/enterPathEdit.js +4 -8
  503. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
  504. package/dist/interactions/actions/defaults/group.js +12 -24
  505. package/dist/interactions/actions/defaults/group.js.map +1 -1
  506. package/dist/interactions/actions/defaults/ingest.js +18 -10
  507. package/dist/interactions/actions/defaults/ingest.js.map +1 -1
  508. package/dist/interactions/actions/defaults/insertPathAnchor.js +3 -3
  509. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  510. package/dist/interactions/actions/defaults/nudgeSteps.js +3 -21
  511. package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
  512. package/dist/interactions/actions/defaults/pathEditMarks.js.map +1 -1
  513. package/dist/interactions/actions/defaults/selectDeep.js +2 -2
  514. package/dist/interactions/actions/defaults/selectDeep.js.map +1 -1
  515. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  516. package/dist/interactions/actions/dropVerdict.js +9 -0
  517. package/dist/interactions/actions/dropVerdict.js.map +1 -0
  518. package/dist/interactions/actions/edit-anchors/action.js +2 -2
  519. package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
  520. package/dist/interactions/actions/edit-anchors/extensionDrags.js.map +1 -1
  521. package/dist/interactions/actions/edit-anchors/geometry.js +8 -6
  522. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
  523. package/dist/interactions/actions/edit-anchors/handleDrag.js.map +1 -1
  524. package/dist/interactions/actions/edit-anchors/preview.js +1 -1
  525. package/dist/interactions/actions/edit-anchors/preview.js.map +1 -1
  526. package/dist/interactions/actions/flip/action.js +3 -2
  527. package/dist/interactions/actions/flip/action.js.map +1 -1
  528. package/dist/interactions/actions/geometryProjection.js +8 -3
  529. package/dist/interactions/actions/geometryProjection.js.map +1 -1
  530. package/dist/interactions/actions/gestureFrames.js +1 -0
  531. package/dist/interactions/actions/gestureFrames.js.map +1 -1
  532. package/dist/interactions/actions/insert/action.js +6 -2
  533. package/dist/interactions/actions/insert/action.js.map +1 -1
  534. package/dist/interactions/actions/insert/frame.js +1 -1
  535. package/dist/interactions/actions/insert/frame.js.map +1 -1
  536. package/dist/interactions/actions/insert/placeAction.js +6 -8
  537. package/dist/interactions/actions/insert/placeAction.js.map +1 -1
  538. package/dist/interactions/actions/insert/session.js +2 -2
  539. package/dist/interactions/actions/insert/session.js.map +1 -1
  540. package/dist/interactions/actions/move/action.js +6 -15
  541. package/dist/interactions/actions/move/action.js.map +1 -1
  542. package/dist/interactions/actions/move/behaviors/layoutDrop.js +12 -2
  543. package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -1
  544. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +29 -10
  545. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -1
  546. package/dist/interactions/actions/move/behaviors/snapToContainer.js +42 -6
  547. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  548. package/dist/interactions/actions/move/capture.js +4 -8
  549. package/dist/interactions/actions/move/capture.js.map +1 -1
  550. package/dist/interactions/actions/move/commit/index.js.map +1 -1
  551. package/dist/interactions/actions/move/commit/layoutDrop.js +4 -3
  552. package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -1
  553. package/dist/interactions/actions/move/commit/layoutRelease.js +15 -9
  554. package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -1
  555. package/dist/interactions/actions/move/commit/reparent.js +19 -13
  556. package/dist/interactions/actions/move/commit/reparent.js.map +1 -1
  557. package/dist/interactions/actions/move/delta.js +51 -5
  558. package/dist/interactions/actions/move/delta.js.map +1 -1
  559. package/dist/interactions/actions/move/frame.js +8 -4
  560. package/dist/interactions/actions/move/frame.js.map +1 -1
  561. package/dist/interactions/actions/move/layout/container.js +19 -9
  562. package/dist/interactions/actions/move/layout/container.js.map +1 -1
  563. package/dist/interactions/actions/move/layout/dragged.js +2 -2
  564. package/dist/interactions/actions/move/layout/dragged.js.map +1 -1
  565. package/dist/interactions/actions/move/layout/dropPass.js +36 -18
  566. package/dist/interactions/actions/move/layout/dropPass.js.map +1 -1
  567. package/dist/interactions/actions/move/layout/exits.js +2 -2
  568. package/dist/interactions/actions/move/layout/exits.js.map +1 -1
  569. package/dist/interactions/actions/move/layout/glide.js +5 -5
  570. package/dist/interactions/actions/move/layout/glide.js.map +1 -1
  571. package/dist/interactions/actions/move/layout/view.js +55 -0
  572. package/dist/interactions/actions/move/layout/view.js.map +1 -0
  573. package/dist/interactions/actions/move/refusal.js +52 -0
  574. package/dist/interactions/actions/move/refusal.js.map +1 -0
  575. package/dist/interactions/actions/move/session.js +9 -8
  576. package/dist/interactions/actions/move/session.js.map +1 -1
  577. package/dist/interactions/actions/move/translate.js +10 -4
  578. package/dist/interactions/actions/move/translate.js.map +1 -1
  579. package/dist/interactions/actions/moveNodes.js +21 -5
  580. package/dist/interactions/actions/moveNodes.js.map +1 -1
  581. package/dist/interactions/actions/pathCommands/pathNodes.js +3 -3
  582. package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -1
  583. package/dist/interactions/actions/planeInput.js +14 -13
  584. package/dist/interactions/actions/planeInput.js.map +1 -1
  585. package/dist/interactions/actions/poseFrame.js +21 -8
  586. package/dist/interactions/actions/poseFrame.js.map +1 -1
  587. package/dist/interactions/actions/resize/action.js +1 -1
  588. package/dist/interactions/actions/resize/action.js.map +1 -1
  589. package/dist/interactions/actions/resize/aspect.js +1 -1
  590. package/dist/interactions/actions/resize/aspect.js.map +1 -1
  591. package/dist/interactions/actions/resize/commit.js +10 -1
  592. package/dist/interactions/actions/resize/commit.js.map +1 -1
  593. package/dist/interactions/actions/resize/frame.js +3 -2
  594. package/dist/interactions/actions/resize/frame.js.map +1 -1
  595. package/dist/interactions/actions/resize/held.js +44 -0
  596. package/dist/interactions/actions/resize/held.js.map +1 -0
  597. package/dist/interactions/actions/resize/session.js +3 -1
  598. package/dist/interactions/actions/resize/session.js.map +1 -1
  599. package/dist/interactions/actions/resolveOverlays.js +9 -0
  600. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  601. package/dist/interactions/actions/resolvePreviews.js +23 -7
  602. package/dist/interactions/actions/resolvePreviews.js.map +1 -1
  603. package/dist/interactions/actions/rotate/action.js +1 -1
  604. package/dist/interactions/actions/rotate/action.js.map +1 -1
  605. package/dist/interactions/actions/rotate/frame.js +1 -1
  606. package/dist/interactions/actions/rotate/frame.js.map +1 -1
  607. package/dist/interactions/actions/rotate/session.js +2 -2
  608. package/dist/interactions/actions/rotate/session.js.map +1 -1
  609. package/dist/interactions/actions/selectionSubtree.js +2 -4
  610. package/dist/interactions/actions/selectionSubtree.js.map +1 -1
  611. package/dist/interactions/actions/spatialReference.js +4 -9
  612. package/dist/interactions/actions/spatialReference.js.map +1 -1
  613. package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -1
  614. package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -1
  615. package/dist/kitSettingsSchema.js +2 -2
  616. package/dist/kitSettingsSchema.js.map +1 -1
  617. package/dist/{math-C_elShP_.d.ts → math-B_unOnF4.d.ts} +2 -2
  618. package/dist/math.d.ts +3 -3
  619. package/dist/move.d.ts +6 -6
  620. package/dist/{options-ClEm3SEl.d.ts → options-DAjkhbcs.d.ts} +5 -5
  621. package/dist/{poseDescriptor-DN2yfnq_.d.ts → poseDescriptor-CvSxVhCd.d.ts} +17 -4
  622. package/dist/resize.d.ts +6 -6
  623. package/dist/style.css +14 -0
  624. package/dist/test-seams.d.ts +11 -15
  625. package/dist/test-seams.js +1 -1
  626. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +3 -6
  627. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
  628. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  629. package/dist/tools/builtin/measure/useMeasureTool.js +2 -2
  630. package/dist/tools/builtin/measure/useMeasureTool.js.map +1 -1
  631. package/dist/tools/builtin/pen/penHandle.js +2 -2
  632. package/dist/tools/builtin/pen/penHandle.js.map +1 -1
  633. package/dist/tools/builtin/pen/usePenTool.js +13 -19
  634. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  635. package/dist/tools/builtin/polygon/usePolygonTool.js +1 -1
  636. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  637. package/dist/tools/builtin/select/groupEntry.js +1 -1
  638. package/dist/tools/builtin/select/groupEntry.js.map +1 -1
  639. package/dist/tools/builtin/select/selectionContributions.js +1 -1
  640. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  641. package/dist/tools/builtin/select/useSelectTool.js +7 -7
  642. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  643. package/dist/tools/builtin/slice/useSliceTool.js +5 -8
  644. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  645. package/dist/tools/builtin/star/useStarTool.js +1 -1
  646. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  647. package/dist/tools/index.js +2 -1
  648. package/dist/{types-49uYJN3j.d.ts → types-A_sNJYRd.d.ts} +8 -0
  649. package/dist/{types-BEdRIhNc.d.ts → types-DW14eu9B.d.ts} +131 -36
  650. package/dist/{types-p2alu-R1.d.ts → types-VCtfchp-.d.ts} +4 -6
  651. package/dist/util/color.js +12 -14
  652. package/dist/util/color.js.map +1 -1
  653. package/dist/version.js +1 -1
  654. package/package.json +25 -24
  655. package/dist/canvas/poseCascade.js +0 -65
  656. package/dist/canvas/poseCascade.js.map +0 -1
  657. package/dist/features/chrome-caps/buildChromeCtx.js.map +0 -1
  658. package/dist/features/chrome-caps/conditions.js.map +0 -1
  659. package/dist/features/chrome-caps/defaults.js.map +0 -1
  660. package/dist/features/chrome-caps/resolve.js.map +0 -1
  661. package/dist/features/chrome-caps/useChromeCaps.js.map +0 -1
  662. package/dist/features/chrome-caps/useHoverTracking.js.map +0 -1
  663. package/dist/features/ingestion/contentHandlers.js.map +0 -1
  664. package/dist/features/ingestion/imageHandler.js.map +0 -1
  665. package/dist/features/ingestion/openFilePicker.js.map +0 -1
  666. package/dist/features/ingestion/placement.js.map +0 -1
  667. package/dist/features/ingestion/registerKitHandlers.js +0 -43
  668. package/dist/features/ingestion/registerKitHandlers.js.map +0 -1
  669. package/dist/features/ingestion/svgHandler.js.map +0 -1
  670. package/dist/features/ingestion/textHandler.js.map +0 -1
  671. package/dist/features/ingestion/useCanvasIngestion.js.map +0 -1
  672. package/dist/features/ingestion/weaselJsonHandler.js.map +0 -1
  673. package/dist/features/longPress/longPressFeedback.js.map +0 -1
  674. package/dist/features/measure/actionIds.js.map +0 -1
  675. package/dist/features/measure/measureCommands.js.map +0 -1
  676. package/dist/features/measure/measureContribution.js.map +0 -1
  677. package/dist/features/measure/measureEdits.js.map +0 -1
  678. package/dist/features/measure/measureGestures.js.map +0 -1
  679. package/dist/features/measure/measureHit.js.map +0 -1
  680. package/dist/features/measure/measureLayer.js.map +0 -1
  681. package/dist/features/measure/measurement.js.map +0 -1
  682. package/dist/features/measure/measurements.js.map +0 -1
  683. package/dist/features/modes/modeLayers.js.map +0 -1
  684. package/dist/features/modes/modeTriggers.js.map +0 -1
  685. package/dist/features/pathEffects/effectSources.js.map +0 -1
  686. package/dist/features/pathEffects/index.js.map +0 -1
  687. package/dist/features/pathEffects/readSource.js.map +0 -1
  688. package/dist/features/pathEffects/textItems.js.map +0 -1
  689. package/dist/features/pathEffects/useEffectSourcesLayer.js.map +0 -1
  690. package/dist/features/paths/anchorData.js.map +0 -1
  691. package/dist/features/paths/anchorMarkers.js.map +0 -1
  692. package/dist/features/paths/editablePath.js.map +0 -1
  693. package/dist/features/paths/originProjection.js.map +0 -1
  694. package/dist/features/paths/pathEditExtension.js.map +0 -1
  695. package/dist/features/paths/pathEditState.js.map +0 -1
  696. package/dist/features/paths/pathEditingOverlayLayer.js.map +0 -1
  697. package/dist/features/paths/pathLayer.js.map +0 -1
  698. package/dist/features/paths/pathRepresentation.js.map +0 -1
  699. package/dist/features/paths/pathSnap/glyphs.js.map +0 -1
  700. package/dist/features/paths/pathSnap/pathSnapSource.js.map +0 -1
  701. package/dist/features/paths/pathSnap/sceneIndex.js.map +0 -1
  702. package/dist/features/paths/pathSnap/snapGeometry.js.map +0 -1
  703. package/dist/features/paths/penPreviewLayer.js.map +0 -1
  704. package/dist/features/paths/shapeGenerator.js.map +0 -1
  705. package/dist/features/paths/strokeOutline.js.map +0 -1
  706. package/dist/features/paths/useAnchorFields.js.map +0 -1
  707. package/dist/features/paths/usePathEdit.js.map +0 -1
  708. package/dist/features/poseRun/usePoseRun.js.map +0 -1
  709. package/dist/features/selection/enteredGroupFrame.js.map +0 -1
  710. package/dist/features/selection/enteredGroupScope.js.map +0 -1
  711. package/dist/features/selection/handleCommands.js.map +0 -1
  712. package/dist/features/selection/overlay.js.map +0 -1
  713. package/dist/features/selection/selectionPose.js.map +0 -1
  714. package/dist/features/snap/angle2d.js.map +0 -1
  715. package/dist/features/snap/debugCandidates.js.map +0 -1
  716. package/dist/features/snap/gather.js.map +0 -1
  717. package/dist/features/snap/inputSubspace.js.map +0 -1
  718. package/dist/features/snap/lazySession.js.map +0 -1
  719. package/dist/features/snap/marks.js.map +0 -1
  720. package/dist/features/snap/outcomeStore.js.map +0 -1
  721. package/dist/features/snap/pointSnap.js.map +0 -1
  722. package/dist/features/snap/probes2d.js.map +0 -1
  723. package/dist/features/snap/readoutDraw.js.map +0 -1
  724. package/dist/features/snap/readoutLayer.js.map +0 -1
  725. package/dist/features/snap/registry.js.map +0 -1
  726. package/dist/features/snap/resizeBox.js.map +0 -1
  727. package/dist/features/snap/roles.js.map +0 -1
  728. package/dist/features/snap/rotationSource.js.map +0 -1
  729. package/dist/features/snap/sceneReads.js.map +0 -1
  730. package/dist/features/snap/sceneSession2d.js.map +0 -1
  731. package/dist/features/snap/screen.js.map +0 -1
  732. package/dist/features/snap/session2d.js.map +0 -1
  733. package/dist/features/snap/spanSnap.js.map +0 -1
  734. package/dist/features/snap/stepAngles.js.map +0 -1
  735. package/dist/features/text/editingDrawOne.js.map +0 -1
  736. package/dist/features/text/sceneTextDrafts.js.map +0 -1
  737. package/dist/features/text/textHitAt.js.map +0 -1
  738. package/dist/features/text/textLayer.js.map +0 -1
  739. package/dist/features/text/useSceneTextEdit.js.map +0 -1
  740. package/dist/features/viewports/aim.js.map +0 -1
  741. package/dist/features/viewports/viewMarker.js.map +0 -1
  742. package/dist/features/viewports/viewMarkerDrag.js.map +0 -1
  743. package/dist/features/viewports/viewResolver.js.map +0 -1
  744. package/dist/features/viewports/viewportLayer.js.map +0 -1
  745. /package/dist/{features → domains}/chrome-caps/index.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GestureReason.js","names":["s"],"sources":["../../src/canvas/GestureReason.tsx"],"sourcesContent":["/// <reference path=\"../css-modules.d.ts\" />\n/**\n * The reason an in-flight gesture cannot land where it is, beside the pointer:\n * the DOM half of the `reason` overlay, which the canvas layers cannot paint\n * as text.\n */\nimport { useEffect, useState, type RefObject } from 'react';\nimport { overlaysOf, type Dispatcher } from '@weasel-js/routing';\nimport { viewToTransform, type View } from 'core/viewport/view';\nimport { worldToScreen } from 'core/viewport/viewTransform';\nimport { resolveOverlays } from 'interactions/actions/resolveOverlays';\nimport s from './GestureReason.module.css';\n\n/** How far below and right of the pointer the reason sits, in CSS pixels. */\nconst OFFSET = 14;\n\nexport interface GestureReasonProps {\n dispatcher: Dispatcher | null | undefined;\n canvasRef: RefObject<HTMLElement | null>;\n viewRef: RefObject<View>;\n}\n\ninterface Shown { left: number; top: number; text: string }\n\n/** The first `reason` overlay of the dispatcher's in-flight gestures, shown beside the pointer. */\nexport function GestureReason({ dispatcher, canvasRef, viewRef }: GestureReasonProps) {\n const [shown, setShown] = useState<Shown | null>(null);\n useEffect(() => {\n if (!dispatcher) return;\n const read = () => {\n const all = [...dispatcher.getInFlightHandles()].flatMap((h) => [...overlaysOf(h)]);\n const reason = resolveOverlays(all).find((o) => o.kind === 'reason');\n const canvas = canvasRef.current;\n const view = viewRef.current;\n if (reason?.kind !== 'reason' || !canvas || !view) {\n setShown(null);\n return;\n }\n const r = canvas.getBoundingClientRect();\n const [sx, sy] = worldToScreen(reason.at.x, reason.at.y, viewToTransform(view));\n setShown({ left: r.left + sx + OFFSET, top: r.top + sy + OFFSET, text: reason.text });\n };\n read();\n const off = dispatcher.subscribe(read);\n return () => {\n off();\n setShown(null);\n };\n }, [dispatcher, canvasRef, viewRef]);\n if (shown === null) return null;\n // The pointer moves it every frame; nothing but an inline position can follow it.\n return <div role=\"status\" className={s.reason} style={{ left: shown.left, top: shown.top }}>{shown.text}</div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,IAAM,SAAS;;AAWf,SAAgB,cAAc,EAAE,YAAY,WAAW,WAA+B;CACpF,MAAM,CAAC,OAAO,YAAY,SAAuB,IAAI;CACrD,gBAAgB;EACd,IAAI,CAAC,YAAY;EACjB,MAAM,aAAa;GACjB,MAAM,MAAM,CAAC,GAAG,WAAW,mBAAmB,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;GAClF,MAAM,SAAS,gBAAgB,GAAG,CAAC,CAAC,MAAM,MAAM,EAAE,SAAS,QAAQ;GACnE,MAAM,SAAS,UAAU;GACzB,MAAM,OAAO,QAAQ;GACrB,IAAI,QAAQ,SAAS,YAAY,CAAC,UAAU,CAAC,MAAM;IACjD,SAAS,IAAI;IACb;GACF;GACA,MAAM,IAAI,OAAO,sBAAsB;GACvC,MAAM,CAAC,IAAI,MAAM,cAAc,OAAO,GAAG,GAAG,OAAO,GAAG,GAAG,gBAAgB,IAAI,CAAC;GAC9E,SAAS;IAAE,MAAM,EAAE,OAAO,KAAK;IAAQ,KAAK,EAAE,MAAM,KAAK;IAAQ,MAAM,OAAO;GAAK,CAAC;EACtF;EACA,KAAK;EACL,MAAM,MAAM,WAAW,UAAU,IAAI;EACrC,aAAa;GACX,IAAI;GACJ,SAAS,IAAI;EACf;CACF,GAAG;EAAC;EAAY;EAAW;CAAO,CAAC;CACnC,IAAI,UAAU,MAAM,OAAO;CAE3B,OAAO,oBAAC,OAAD;EAAK,MAAK;EAAS,WAAWA,6BAAE;EAAQ,OAAO;GAAE,MAAM,MAAM;GAAM,KAAK,MAAM;EAAI;EAAI,UAAA,MAAM;CAAU,CAAA;AAC/G"}
@@ -0,0 +1,7 @@
1
+ //#region src/canvas/GestureReason.module.css
2
+ var reason = "_reason_0cabc7";
3
+ var GestureReason_module_default = { reason };
4
+
5
+ //#endregion
6
+ export { GestureReason_module_default as default, reason };
7
+ //# sourceMappingURL=GestureReason.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GestureReason.module.js","names":[],"sources":["../../src/canvas/GestureReason.module.css"],"sourcesContent":["/* A refusal's reason, held beside the pointer while a drag is over what refuses it. */\n.reason {\n position: fixed;\n z-index: var(--wzl-z-hud, 900);\n max-width: 280px;\n padding: var(--wzl-space-2, 4px) var(--wzl-space-3, 6px);\n border-left: 3px solid var(--wzl-danger, #d93636);\n border-radius: var(--wzl-radius-sm, 3px);\n background: var(--wzl-surface-popover, #fff);\n color: var(--wzl-fg, #1a1a1a);\n box-shadow: var(--wzl-shadow, 0 1px 4px rgba(0, 0, 0, 0.25));\n font: var(--wzl-font-size-sm, 12px) / 1.35 system-ui, sans-serif;\n pointer-events: none;\n}\n"],"mappings":""}
@@ -1,11 +1,13 @@
1
1
  import { toolDrivenActions } from "./SceneCanvas/presets/toolDriven.js";
2
+ import { BASELINE_ACTIONS } from "./SceneCanvas/presets/baseline.js";
2
3
  import { renderSceneCanvas } from "./SceneCanvas.js";
3
4
  import { forwardRef } from "react";
4
5
 
5
6
  //#region src/canvas/LeanSceneCanvas.tsx
6
7
  var LEAN_SOURCE = {
7
8
  named: null,
8
- pool: toolDrivenActions
9
+ pool: toolDrivenActions,
10
+ baseline: BASELINE_ACTIONS
9
11
  };
10
12
  function LeanSceneCanvasWrapper(props, ref) {
11
13
  return renderSceneCanvas(LEAN_SOURCE, props, ref);
@@ -1 +1 @@
1
- {"version":3,"file":"LeanSceneCanvas.js","names":[],"sources":["../../src/canvas/LeanSceneCanvas.tsx"],"sourcesContent":["import type React from 'react';\nimport { forwardRef } from 'react';\nimport type { SceneCanvasApi } from './canvasExtension';\nimport { renderSceneCanvas } from './SceneCanvas';\nimport type { FeaturePreset, PresetSource } from './SceneCanvas/features';\nimport type { SceneCanvasProps } from './SceneCanvas/props';\nimport { toolDrivenActions } from './SceneCanvas/presets/toolDriven';\n\nconst LEAN_SOURCE: PresetSource = { named: null, pool: toolDrivenActions };\n\n/** Props for {@link LeanSceneCanvas}: `<SceneCanvas>`'s, with `features`\n * taking preset objects only. */\nexport type LeanSceneCanvasProps<TData, TLayer extends string, TPose> =\n Omit<SceneCanvasProps<TData, TLayer, TPose>, 'features'> & { features?: readonly FeaturePreset[] };\n\nfunction LeanSceneCanvasWrapper<TData, TLayer extends string, TPose>(\n props: LeanSceneCanvasProps<TData, TLayer, TPose>,\n ref: React.ForwardedRef<SceneCanvasApi>,\n) {\n return renderSceneCanvas(LEAN_SOURCE, props, ref);\n}\n\n/**\n * `<SceneCanvas>` without core's preset names: `features` takes preset\n * objects (`selectPreset`, `editPreset`, a package's own), and a preset the\n * app does not import is not in its bundle. `viewport` does not imply\n * `viewPreset` here; pass it.\n */\nexport const LeanSceneCanvas = forwardRef(LeanSceneCanvasWrapper) as <\n TData, TLayer extends string, TPose,\n>(\n props: LeanSceneCanvasProps<TData, TLayer, TPose> & { ref?: React.Ref<SceneCanvasApi> },\n) => React.ReactElement;\n"],"mappings":";;;;;AAQA,IAAM,cAA4B;CAAE,OAAO;CAAM,MAAM;AAAkB;AAOzE,SAAS,uBACP,OACA,KACA;CACA,OAAO,kBAAkB,aAAa,OAAO,GAAG;AAClD;;;;;;;AAQA,IAAa,kBAAkB,WAAW,sBAAsB"}
1
+ {"version":3,"file":"LeanSceneCanvas.js","names":[],"sources":["../../src/canvas/LeanSceneCanvas.tsx"],"sourcesContent":["import type React from 'react';\nimport { forwardRef } from 'react';\nimport type { SceneCanvasApi } from './canvasExtension';\nimport { renderSceneCanvas } from './SceneCanvas';\nimport type { FeaturePreset, PresetSource } from './SceneCanvas/features';\nimport type { SceneCanvasProps } from './SceneCanvas/props';\nimport { toolDrivenActions } from './SceneCanvas/presets/toolDriven';\nimport { BASELINE_ACTIONS } from './SceneCanvas/presets/baseline';\n\nconst LEAN_SOURCE: PresetSource = { named: null, pool: toolDrivenActions, baseline: BASELINE_ACTIONS };\n\n/** Props for {@link LeanSceneCanvas}: `<SceneCanvas>`'s, with `features`\n * taking preset objects only. */\nexport type LeanSceneCanvasProps<TData, TLayer extends string, TPose> =\n Omit<SceneCanvasProps<TData, TLayer, TPose>, 'features'> & { features?: readonly FeaturePreset[] };\n\nfunction LeanSceneCanvasWrapper<TData, TLayer extends string, TPose>(\n props: LeanSceneCanvasProps<TData, TLayer, TPose>,\n ref: React.ForwardedRef<SceneCanvasApi>,\n) {\n return renderSceneCanvas(LEAN_SOURCE, props, ref);\n}\n\n/**\n * `<SceneCanvas>` without core's preset names: `features` takes preset\n * objects (`selectPreset`, `editPreset`, a package's own), and a preset the\n * app does not import is not in its bundle. `viewport` does not imply\n * `viewPreset` here; pass it.\n */\nexport const LeanSceneCanvas = forwardRef(LeanSceneCanvasWrapper) as <\n TData, TLayer extends string, TPose,\n>(\n props: LeanSceneCanvasProps<TData, TLayer, TPose> & { ref?: React.Ref<SceneCanvasApi> },\n) => React.ReactElement;\n"],"mappings":";;;;;;AASA,IAAM,cAA4B;CAAE,OAAO;CAAM,MAAM;CAAmB,UAAU;AAAiB;AAOrG,SAAS,uBACP,OACA,KACA;CACA,OAAO,kBAAkB,aAAa,OAAO,GAAG;AAClD;;;;;;;AAQA,IAAa,kBAAkB,WAAW,sBAAsB"}
@@ -1,4 +1,5 @@
1
1
  import { bumpNodeMemoGeneration, nodeMemo } from "../core/scene/nodeMemo.js";
2
+ import { setDepOutlineReader } from "../core/scene/booleanOfChildren.js";
2
3
  import { hasSlop, slopForStrokeHit, widenSlop } from "../core/viewport/screenSlop.js";
3
4
  import { derivesPath } from "./nodeShapes/memo.js";
4
5
  import { DERIVED_PAINTER } from "./nodeShapes/derivedPainter.js";
@@ -104,6 +105,7 @@ function findShapeSilhouette(node, pose, ctx) {
104
105
  }
105
106
  return nodeMemo(node, SILHOUETTE_SLOT, pose, build);
106
107
  }
108
+ setDepOutlineReader((dep) => findShapeSilhouette(dep.node, dep.pose, { derivedPath: dep.path }));
107
109
  /** Find the painter for `node` and ask how it inks its silhouette. Returns
108
110
  * the painter's declared {@link NodeInk}, or `null` when no painter matches
109
111
  * or it declares none — callers substitute {@link DEFAULT_INK}. */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeShape.js","names":[],"sources":["../../src/canvas/NodeShape.ts"],"sourcesContent":["/**\n * NodeShape — the **shape trait's** registry: the per-kind `paint` + `silhouette` used by\n * `defaultDrawOne`, clipping, non-rect hit-testing, and lasso/area-select. Teaching the kit\n * about a new kind of shape goes through this registry rather than by overriding `drawOne`.\n *\n * The first entry whose `matches` predicate returns true paints the node: `'high'` entries\n * first, then the built-ins, then `'normal'` ones, in registration order within a tier. Every\n * built-in but `kit:derived` additionally requires a rect-shaped pose — a scene whose poses are\n * some other shape matches none of them, and paints through a consumer painter or not at all.\n */\nimport { glyphGeneration } from '@weasel-js/font';\nimport {\n pathContainsPoint,\n strokeHitTest,\n type Path\n} from '@weasel-js/geom';\nimport { pathThroughPoseFrame } from '@weasel-js/geom';\nimport { bumpNodeMemoGeneration, nodeMemo } from 'core/scene/nodeMemo';\nimport type { Node } from 'core/scene/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { hasSlop, slopForStrokeHit, widenSlop, type PickSlop } from 'core/viewport/screenSlop';\nimport { DERIVED_PAINTER } from './nodeShapes/derivedPainter';\nimport { IMAGE_PAINTER } from './nodeShapes/imagePainter';\nimport { MEASURE_PAINTER } from './nodeShapes/measurePainter';\nimport { derivesPath } from './nodeShapes/memo';\nimport { PATH_PAINTER } from './nodeShapes/pathPainter';\nimport { paintsPose } from './nodeShapes/poseBox';\nimport { RECT_FALLBACK_PAINTER } from './nodeShapes/rectFallbackPainter';\nimport { SHAPE_PAINTER } from './nodeShapes/shapePainter';\nimport { TEXT_PAINTER } from './nodeShapes/textPainter';\nimport type { NodeShapeEntry, NodeInk, NodeSilhouetteCtx, NodeInkCtx } from './nodeShapeTypes';\nexport type { NodePaintCtx, SceneViewDrawOne, NodeShapeEntry, NodeInk, NodeSilhouetteCtx, NodeInkCtx } from './nodeShapeTypes';\nexport type { InheritedPaint } from 'core/scene/inheritedPaint';\n\n/** What a painter that declares no `ink` is assumed to do. */\nexport const DEFAULT_INK: Readonly<NodeInk> = Object.freeze({ filled: true, outset: 0, inset: 0 });\n\n/** Options for `registerNodeShape`. */\nexport interface RegisterNodeShapeOptions {\n /** `'high'` puts the painter ahead of all normally-registered ones (so\n * it can win over a kit built-in). `'normal'` appends at the end. */\n priority?: 'high' | 'normal';\n}\n\nconst PAINTERS: { high: NodeShapeEntry[]; normal: NodeShapeEntry[] } = {\n high: [],\n normal: [],\n};\n\n// The built-ins go in on first use, not at module load: a bundler may drop an\n// import kept only for its side effect, and the registry would come up empty.\nlet builtInsRegistered = false;\nfunction ensureBuiltIns(): void {\n if (builtInsRegistered) return;\n builtInsRegistered = true;\n registerBuiltInShapePainters();\n}\n\n/** Register a shape painter. Returns a disposer that removes it. */\nexport function registerNodeShape<TData, TPose>(\n painter: NodeShapeEntry<TData, TPose>,\n opts: RegisterNodeShapeOptions = {},\n): () => void {\n ensureBuiltIns();\n const list = opts.priority === 'high' ? PAINTERS.high : PAINTERS.normal;\n list.push(painter as NodeShapeEntry);\n // The painter set is exactly the ambient state `findNodeShape` reads, and a\n // memo keyed on the node alone cannot see it change. See `nodeMemo`.\n bumpNodeMemoGeneration();\n return () => {\n const i = list.indexOf(painter as NodeShapeEntry);\n if (i >= 0) list.splice(i, 1);\n bumpNodeMemoGeneration();\n };\n}\n\n/**\n * Slot names for what picking asks per node per pointer move: which painter matches, and that\n * painter's silhouette path. Both go through {@link nodeMemo}, so they invalidate on `data`\n * (and, for the silhouette, `pose`) reference changes and on a painter registration.\n *\n * Separate slots rather than one entry: they mostly invalidate together, but not always, and a\n * shared entry would force the stricter key on both.\n */\nconst PAINTER_SLOT = 'shape:painter';\nconst PAINTER_SLOT_NONRECT = 'shape:painter:nonrect';\nconst PAINTER_SLOT_DERIVED = 'shape:painter:derived';\nconst PAINTER_SLOT_DERIVED_NONRECT = 'shape:painter:derived:nonrect';\nconst SILHOUETTE_SLOT = 'shape:silhouette';\nconst TEXT_SILHOUETTE_SLOT = 'shape:silhouette:text';\n\n/** The painter that will render `node` — first match in priority order — or undefined if\n * none accepts it. */\nexport function findNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n // Built-in painters also gate on pose shape and on whether the node derives\n // its path, neither of which shows in `data`, so the key carries both.\n const rect = paintsPose(node.pose);\n const slot = derivesPath(node)\n ? (rect ? PAINTER_SLOT_DERIVED : PAINTER_SLOT_DERIVED_NONRECT)\n : (rect ? PAINTER_SLOT : PAINTER_SLOT_NONRECT);\n return nodeMemo(node as { data?: unknown }, slot, undefined, () =>\n matchNodeShape(node),\n );\n}\n\nfunction matchNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n ensureBuiltIns();\n for (const p of PAINTERS.high) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n for (const p of PAINTERS.normal) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n return undefined;\n}\n\n/** The silhouette path of `node`, in **world** coords, or null if no painter matches or the\n * matching painter has none.\n *\n * Painters return their silhouette in the pose's local (unrotated) frame;\n * this bakes the pose's frame (`poseFrameOf`: its rotation and `transform`)\n * on top, so clips/area-select of a turned or skewed node use the boundary\n * the renderer draws. */\nexport function findShapeSilhouette<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeSilhouetteCtx,\n): Path | null {\n const build = (): Path | null => {\n const sil = findNodeShape(node)?.silhouette?.(node, pose, ctx) ?? null;\n return sil && pathThroughPoseFrame(sil, pose);\n };\n // `SILHOUETTE_SLOT`'s key is (node, pose, data) and cannot see\n // `ctx.derivedPath` — the same reason `kit:derived` skips `PAINT_SLOT`.\n // Memoizing here would serve one caller's silhouette to a caller that\n // passed a different path. Only an actual path skips it: a scene-backed\n // source answers `null` for every ordinary node, and treating that as a\n // reason to bypass would retire the memo for the whole scene.\n if (ctx?.derivedPath != null) return build();\n // Line boxes follow font metrics, and a face landing changes those with no\n // change to the node, so the text entry is checked against the glyph epoch.\n if (findNodeShape(node) === (TEXT_PAINTER as NodeShapeEntry<unknown, unknown>)) {\n const epoch = glyphGeneration();\n const held = nodeMemo(node as { data?: unknown }, TEXT_SILHOUETTE_SLOT, pose,\n (): { epoch: number; path: Path | null } => ({ epoch, path: build() }));\n if (held.epoch !== epoch) {\n held.epoch = epoch;\n held.path = build();\n }\n return held.path;\n }\n return nodeMemo(node as { data?: unknown }, SILHOUETTE_SLOT, pose, build);\n}\n\n/** Find the painter for `node` and ask how it inks its silhouette. Returns\n * the painter's declared {@link NodeInk}, or `null` when no painter matches\n * or it declares none — callers substitute {@link DEFAULT_INK}. */\nexport function findShapeInk<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): NodeInk | null {\n return findNodeShape(node)?.ink?.(node, pose, ctx) ?? null;\n}\n\n/** Find the painter for `node` and ask for the box its paint fits in. `null`\n * when no painter matches, or the one that does cannot say — see\n * {@link NodeShapeEntry.bounds}. */\nexport function findShapeBounds<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): Bounds | null {\n return findNodeShape(node)?.bounds?.(node, pose, ctx) ?? null;\n}\n\n/** Options for {@link shapeCoversPoint}. */\nexport interface ShapeCoversPointOptions {\n /** Extra grab distance around the outline: **world** units as a number,\n * or screen pixels under a view scale (`{ px, scale }`), which is measured\n * on screen and so stays exact under non-uniform zoom. Defaults to `0`,\n * where a hairline is too thin a target to hit. */\n tolerance?: PickSlop;\n /** View scale, passed to the painter's `ink`, and what a screen reach is\n * read at under a world `tolerance`. Defaults to 1. */\n scale?: number;\n /** The node's derived path — see {@link NodeSilhouetteCtx.derivedPath}.\n * Without it a derived node reports no silhouette and this answers `true`\n * everywhere, which degrades picking to the caller's AABB: for an edge,\n * a zero-sized pose. */\n derivedPath?: Path | null;\n /** See {@link NodeInkCtx.inherited}. Without it an `'inherit'` field is\n * read as none. */\n inherited?: NodeInkCtx['inherited'];\n}\n\n/**\n * Does the shape `node` actually paints cover the world point? Asks the painter's silhouette,\n * the same boundary used for clipping and area-select, rather than the pose rect.\n *\n * The ink counts too: a shape whose interior isn't filled is grabbable along its outline and\n * not through its empty middle. The outline's grab width is the stroke's half-width plus\n * `tolerance`.\n *\n * A painter with no `silhouette`, or one that returns `null` for this node, reports `true` —\n * \"no opinion\" — so callers should keep their own AABB test as a pre-filter.\n */\nexport function shapeCoversPoint<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n x: number,\n y: number,\n opts: ShapeCoversPointOptions = {},\n): boolean {\n // A group paints nothing, so its interior is its box, which the caller's pre-filter tested.\n if (node.kind === 'group') return true;\n const sil = findShapeSilhouette(node, pose, { derivedPath: opts.derivedPath });\n if (sil === null) return true;\n const ink = findShapeInk(node, pose, { scale: opts.scale, inherited: opts.inherited }) ?? DEFAULT_INK;\n const inside = pathContainsPoint(sil, x, y);\n if (ink.filled && inside) return true;\n // The stroke reaches a different distance on each side, so which side the point is on\n // picks the reach. `tolerance` also makes a filled shape grabbable a few pixels outside\n // its edge.\n const slop = widenSlop(opts.tolerance, (inside ? ink.insetPx : ink.outsetPx) ?? 0, opts.scale);\n const { extra, opts: hit } = slopForStrokeHit(slop);\n const reach = (inside ? ink.inset : ink.outset) + extra;\n return (reach > 0 || hasSlop(slop)) && strokeHitTest(sil, x, y, reach, hit);\n}\n\n/** The current painters in evaluation order — `'high'` tier first, then `'normal'`. */\nexport function getNodeShapes(): readonly NodeShapeEntry[] {\n ensureBuiltIns();\n return [...PAINTERS.high, ...PAINTERS.normal];\n}\n\n/** Test-only: clear the registry and re-register the built-ins. */\nexport function _resetShapePaintersForTests(): void {\n PAINTERS.high.length = 0;\n PAINTERS.normal.length = 0;\n builtInsRegistered = false;\n ensureBuiltIns();\n // `registerNodeShape` already bumps, but the clearing above happens without one.\n bumpNodeMemoGeneration();\n}\n\nfunction registerBuiltInShapePainters(): void {\n registerNodeShape(TEXT_PAINTER);\n registerNodeShape(MEASURE_PAINTER);\n // Ahead of path/shape/image: a derived node whose `data` also carries a\n // `path`, `shape` or `image` means the derived path, and those three match\n // on the presence of the field alone.\n registerNodeShape(DERIVED_PAINTER);\n registerNodeShape(PATH_PAINTER);\n registerNodeShape(SHAPE_PAINTER);\n registerNodeShape(IMAGE_PAINTER);\n registerNodeShape(RECT_FALLBACK_PAINTER);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,IAAa,cAAiC,OAAO,OAAO;CAAE,QAAQ;CAAM,QAAQ;CAAG,OAAO;AAAE,CAAC;AASjG,IAAM,WAAiE;CACrE,MAAM,CAAC;CACP,QAAQ,CAAC;AACX;AAIA,IAAI,qBAAqB;AACzB,SAAS,iBAAuB;CAC9B,IAAI,oBAAoB;CACxB,qBAAqB;CACrB,6BAA6B;AAC/B;;AAGA,SAAgB,kBACd,SACA,OAAiC,CAAC,GACtB;CACZ,eAAe;CACf,MAAM,OAAO,KAAK,aAAa,SAAS,SAAS,OAAO,SAAS;CACjE,KAAK,KAAK,OAAyB;CAGnC,uBAAuB;CACvB,aAAa;EACX,MAAM,IAAI,KAAK,QAAQ,OAAyB;EAChD,IAAI,KAAK,GAAG,KAAK,OAAO,GAAG,CAAC;EAC5B,uBAAuB;CACzB;AACF;;;;;;;;;AAUA,IAAM,eAAe;AACrB,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,+BAA+B;AACrC,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;;;AAI7B,SAAgB,cACd,MAC0C;CAG1C,MAAM,OAAO,WAAW,KAAK,IAAI;CACjC,MAAM,OAAO,YAAY,IAAI,IACxB,OAAO,uBAAuB,+BAC9B,OAAO,eAAe;CAC3B,OAAO,SAAS,MAA4B,MAAM,cAChD,eAAe,IAAI,CACrB;AACF;AAEA,SAAS,eACP,MAC0C;CAC1C,eAAe;CACf,KAAK,MAAM,KAAK,SAAS,MACvB,IAAI,EAAE,QAAQ,IAAsC,GAClD,OAAO;CAGX,KAAK,MAAM,KAAK,SAAS,QACvB,IAAI,EAAE,QAAQ,IAAsC,GAClD,OAAO;AAIb;;;;;;;;AASA,SAAgB,oBACd,MACA,MACA,KACa;CACb,MAAM,cAA2B;EAC/B,MAAM,MAAM,cAAc,IAAI,CAAC,EAAE,aAAa,MAAM,MAAM,GAAG,KAAK;EAClE,OAAO,OAAO,qBAAqB,KAAK,IAAI;CAC9C;CAOA,IAAI,KAAK,eAAe,MAAM,OAAO,MAAM;CAG3C,IAAI,cAAc,IAAI,MAAO,cAAmD;EAC9E,MAAM,QAAQ,gBAAgB;EAC9B,MAAM,OAAO,SAAS,MAA4B,sBAAsB,aACzB;GAAE;GAAO,MAAM,MAAM;EAAE,EAAE;EACxE,IAAI,KAAK,UAAU,OAAO;GACxB,KAAK,QAAQ;GACb,KAAK,OAAO,MAAM;EACpB;EACA,OAAO,KAAK;CACd;CACA,OAAO,SAAS,MAA4B,iBAAiB,MAAM,KAAK;AAC1E;;;;AAKA,SAAgB,aACd,MACA,MACA,KACgB;CAChB,OAAO,cAAc,IAAI,CAAC,EAAE,MAAM,MAAM,MAAM,GAAG,KAAK;AACxD;;;;AAKA,SAAgB,gBACd,MACA,MACA,KACe;CACf,OAAO,cAAc,IAAI,CAAC,EAAE,SAAS,MAAM,MAAM,GAAG,KAAK;AAC3D;;;;;;;;;;;;AAiCA,SAAgB,iBACd,MACA,MACA,GACA,GACA,OAAgC,CAAC,GACxB;CAET,IAAI,KAAK,SAAS,SAAS,OAAO;CAClC,MAAM,MAAM,oBAAoB,MAAM,MAAM,EAAE,aAAa,KAAK,YAAY,CAAC;CAC7E,IAAI,QAAQ,MAAM,OAAO;CACzB,MAAM,MAAM,aAAa,MAAM,MAAM;EAAE,OAAO,KAAK;EAAO,WAAW,KAAK;CAAU,CAAC,KAAK;CAC1F,MAAM,SAAS,kBAAkB,KAAK,GAAG,CAAC;CAC1C,IAAI,IAAI,UAAU,QAAQ,OAAO;CAIjC,MAAM,OAAO,UAAU,KAAK,YAAY,SAAS,IAAI,UAAU,IAAI,aAAa,GAAG,KAAK,KAAK;CAC7F,MAAM,EAAE,OAAO,MAAM,QAAQ,iBAAiB,IAAI;CAClD,MAAM,SAAS,SAAS,IAAI,QAAQ,IAAI,UAAU;CAClD,QAAQ,QAAQ,KAAK,QAAQ,IAAI,MAAM,cAAc,KAAK,GAAG,GAAG,OAAO,GAAG;AAC5E;;AAGA,SAAgB,gBAA2C;CACzD,eAAe;CACf,OAAO,CAAC,GAAG,SAAS,MAAM,GAAG,SAAS,MAAM;AAC9C;AAYA,SAAS,+BAAqC;CAC5C,kBAAkB,YAAY;CAC9B,kBAAkB,eAAe;CAIjC,kBAAkB,eAAe;CACjC,kBAAkB,YAAY;CAC9B,kBAAkB,aAAa;CAC/B,kBAAkB,aAAa;CAC/B,kBAAkB,qBAAqB;AACzC"}
1
+ {"version":3,"file":"NodeShape.js","names":[],"sources":["../../src/canvas/NodeShape.ts"],"sourcesContent":["/**\n * NodeShape — the **shape trait's** registry: the per-kind `paint` + `silhouette` used by\n * `defaultDrawOne`, clipping, non-rect hit-testing, and lasso/area-select. Teaching the kit\n * about a new kind of shape goes through this registry rather than by overriding `drawOne`.\n *\n * The first entry whose `matches` predicate returns true paints the node: `'high'` entries\n * first, then the built-ins, then `'normal'` ones, in registration order within a tier. Every\n * built-in but `kit:derived` additionally requires a rect-shaped pose — a scene whose poses are\n * some other shape matches none of them, and paints through a consumer painter or not at all.\n */\nimport { glyphGeneration } from '@weasel-js/font';\nimport {\n pathContainsPoint,\n strokeHitTest,\n type Path\n} from '@weasel-js/geom';\nimport { pathThroughPoseFrame } from '@weasel-js/geom';\nimport { bumpNodeMemoGeneration, nodeMemo } from 'core/scene/nodeMemo';\nimport { setDepOutlineReader } from 'core/scene/booleanOfChildren';\nimport type { Node } from 'core/scene/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { hasSlop, slopForStrokeHit, widenSlop, type PickSlop } from 'core/viewport/screenSlop';\nimport { DERIVED_PAINTER } from './nodeShapes/derivedPainter';\nimport { IMAGE_PAINTER } from './nodeShapes/imagePainter';\nimport { MEASURE_PAINTER } from './nodeShapes/measurePainter';\nimport { derivesPath } from './nodeShapes/memo';\nimport { PATH_PAINTER } from './nodeShapes/pathPainter';\nimport { paintsPose } from './nodeShapes/poseBox';\nimport { RECT_FALLBACK_PAINTER } from './nodeShapes/rectFallbackPainter';\nimport { SHAPE_PAINTER } from './nodeShapes/shapePainter';\nimport { TEXT_PAINTER } from './nodeShapes/textPainter';\nimport type { NodeShapeEntry, NodeInk, NodeSilhouetteCtx, NodeInkCtx } from './nodeShapeTypes';\nexport type { NodePaintCtx, SceneViewDrawOne, NodeShapeEntry, NodeInk, NodeSilhouetteCtx, NodeInkCtx } from './nodeShapeTypes';\nexport type { InheritedPaint } from 'core/scene/inheritedPaint';\n\n/** What a painter that declares no `ink` is assumed to do. */\nexport const DEFAULT_INK: Readonly<NodeInk> = Object.freeze({ filled: true, outset: 0, inset: 0 });\n\n/** Options for `registerNodeShape`. */\nexport interface RegisterNodeShapeOptions {\n /** `'high'` puts the painter ahead of all normally-registered ones (so\n * it can win over a kit built-in). `'normal'` appends at the end. */\n priority?: 'high' | 'normal';\n}\n\nconst PAINTERS: { high: NodeShapeEntry[]; normal: NodeShapeEntry[] } = {\n high: [],\n normal: [],\n};\n\n// The built-ins go in on first use, not at module load: a bundler may drop an\n// import kept only for its side effect, and the registry would come up empty.\nlet builtInsRegistered = false;\nfunction ensureBuiltIns(): void {\n if (builtInsRegistered) return;\n builtInsRegistered = true;\n registerBuiltInShapePainters();\n}\n\n/** Register a shape painter. Returns a disposer that removes it. */\nexport function registerNodeShape<TData, TPose>(\n painter: NodeShapeEntry<TData, TPose>,\n opts: RegisterNodeShapeOptions = {},\n): () => void {\n ensureBuiltIns();\n const list = opts.priority === 'high' ? PAINTERS.high : PAINTERS.normal;\n list.push(painter as NodeShapeEntry);\n // The painter set is exactly the ambient state `findNodeShape` reads, and a\n // memo keyed on the node alone cannot see it change. See `nodeMemo`.\n bumpNodeMemoGeneration();\n return () => {\n const i = list.indexOf(painter as NodeShapeEntry);\n if (i >= 0) list.splice(i, 1);\n bumpNodeMemoGeneration();\n };\n}\n\n/**\n * Slot names for what picking asks per node per pointer move: which painter matches, and that\n * painter's silhouette path. Both go through {@link nodeMemo}, so they invalidate on `data`\n * (and, for the silhouette, `pose`) reference changes and on a painter registration.\n *\n * Separate slots rather than one entry: they mostly invalidate together, but not always, and a\n * shared entry would force the stricter key on both.\n */\nconst PAINTER_SLOT = 'shape:painter';\nconst PAINTER_SLOT_NONRECT = 'shape:painter:nonrect';\nconst PAINTER_SLOT_DERIVED = 'shape:painter:derived';\nconst PAINTER_SLOT_DERIVED_NONRECT = 'shape:painter:derived:nonrect';\nconst SILHOUETTE_SLOT = 'shape:silhouette';\nconst TEXT_SILHOUETTE_SLOT = 'shape:silhouette:text';\n\n/** The painter that will render `node` — first match in priority order — or undefined if\n * none accepts it. */\nexport function findNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n // Built-in painters also gate on pose shape and on whether the node derives\n // its path, neither of which shows in `data`, so the key carries both.\n const rect = paintsPose(node.pose);\n const slot = derivesPath(node)\n ? (rect ? PAINTER_SLOT_DERIVED : PAINTER_SLOT_DERIVED_NONRECT)\n : (rect ? PAINTER_SLOT : PAINTER_SLOT_NONRECT);\n return nodeMemo(node as { data?: unknown }, slot, undefined, () =>\n matchNodeShape(node),\n );\n}\n\nfunction matchNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n ensureBuiltIns();\n for (const p of PAINTERS.high) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n for (const p of PAINTERS.normal) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n return undefined;\n}\n\n/** The silhouette path of `node`, in **world** coords, or null if no painter matches or the\n * matching painter has none.\n *\n * Painters return their silhouette in the pose's local (unrotated) frame;\n * this bakes the pose's frame (`poseFrameOf`: its rotation and `transform`)\n * on top, so clips/area-select of a turned or skewed node use the boundary\n * the renderer draws. */\nexport function findShapeSilhouette<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeSilhouetteCtx,\n): Path | null {\n const build = (): Path | null => {\n const sil = findNodeShape(node)?.silhouette?.(node, pose, ctx) ?? null;\n return sil && pathThroughPoseFrame(sil, pose);\n };\n // `SILHOUETTE_SLOT`'s key is (node, pose, data) and cannot see\n // `ctx.derivedPath` — the same reason `kit:derived` skips `PAINT_SLOT`.\n // Memoizing here would serve one caller's silhouette to a caller that\n // passed a different path. Only an actual path skips it: a scene-backed\n // source answers `null` for every ordinary node, and treating that as a\n // reason to bypass would retire the memo for the whole scene.\n if (ctx?.derivedPath != null) return build();\n // Line boxes follow font metrics, and a face landing changes those with no\n // change to the node, so the text entry is checked against the glyph epoch.\n if (findNodeShape(node) === (TEXT_PAINTER as NodeShapeEntry<unknown, unknown>)) {\n const epoch = glyphGeneration();\n const held = nodeMemo(node as { data?: unknown }, TEXT_SILHOUETTE_SLOT, pose,\n (): { epoch: number; path: Path | null } => ({ epoch, path: build() }));\n if (held.epoch !== epoch) {\n held.epoch = epoch;\n held.path = build();\n }\n return held.path;\n }\n return nodeMemo(node as { data?: unknown }, SILHOUETTE_SLOT, pose, build);\n}\n\n// A boolean group's operands are its children's outlines.\nsetDepOutlineReader((dep) => findShapeSilhouette(dep.node, dep.pose, { derivedPath: dep.path }));\n\n/** Find the painter for `node` and ask how it inks its silhouette. Returns\n * the painter's declared {@link NodeInk}, or `null` when no painter matches\n * or it declares none — callers substitute {@link DEFAULT_INK}. */\nexport function findShapeInk<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): NodeInk | null {\n return findNodeShape(node)?.ink?.(node, pose, ctx) ?? null;\n}\n\n/** Find the painter for `node` and ask for the box its paint fits in. `null`\n * when no painter matches, or the one that does cannot say — see\n * {@link NodeShapeEntry.bounds}. */\nexport function findShapeBounds<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): Bounds | null {\n return findNodeShape(node)?.bounds?.(node, pose, ctx) ?? null;\n}\n\n/** Options for {@link shapeCoversPoint}. */\nexport interface ShapeCoversPointOptions {\n /** Extra grab distance around the outline: **world** units as a number,\n * or screen pixels under a view scale (`{ px, scale }`), which is measured\n * on screen and so stays exact under non-uniform zoom. Defaults to `0`,\n * where a hairline is too thin a target to hit. */\n tolerance?: PickSlop;\n /** View scale, passed to the painter's `ink`, and what a screen reach is\n * read at under a world `tolerance`. Defaults to 1. */\n scale?: number;\n /** The node's derived path — see {@link NodeSilhouetteCtx.derivedPath}.\n * Without it a derived node reports no silhouette and this answers `true`\n * everywhere, which degrades picking to the caller's AABB: for an edge,\n * a zero-sized pose. */\n derivedPath?: Path | null;\n /** See {@link NodeInkCtx.inherited}. Without it an `'inherit'` field is\n * read as none. */\n inherited?: NodeInkCtx['inherited'];\n}\n\n/**\n * Does the shape `node` actually paints cover the world point? Asks the painter's silhouette,\n * the same boundary used for clipping and area-select, rather than the pose rect.\n *\n * The ink counts too: a shape whose interior isn't filled is grabbable along its outline and\n * not through its empty middle. The outline's grab width is the stroke's half-width plus\n * `tolerance`.\n *\n * A painter with no `silhouette`, or one that returns `null` for this node, reports `true` —\n * \"no opinion\" — so callers should keep their own AABB test as a pre-filter.\n */\nexport function shapeCoversPoint<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n x: number,\n y: number,\n opts: ShapeCoversPointOptions = {},\n): boolean {\n // A group paints nothing, so its interior is its box, which the caller's pre-filter tested.\n if (node.kind === 'group') return true;\n const sil = findShapeSilhouette(node, pose, { derivedPath: opts.derivedPath });\n if (sil === null) return true;\n const ink = findShapeInk(node, pose, { scale: opts.scale, inherited: opts.inherited }) ?? DEFAULT_INK;\n const inside = pathContainsPoint(sil, x, y);\n if (ink.filled && inside) return true;\n // The stroke reaches a different distance on each side, so which side the point is on\n // picks the reach. `tolerance` also makes a filled shape grabbable a few pixels outside\n // its edge.\n const slop = widenSlop(opts.tolerance, (inside ? ink.insetPx : ink.outsetPx) ?? 0, opts.scale);\n const { extra, opts: hit } = slopForStrokeHit(slop);\n const reach = (inside ? ink.inset : ink.outset) + extra;\n return (reach > 0 || hasSlop(slop)) && strokeHitTest(sil, x, y, reach, hit);\n}\n\n/** The current painters in evaluation order — `'high'` tier first, then `'normal'`. */\nexport function getNodeShapes(): readonly NodeShapeEntry[] {\n ensureBuiltIns();\n return [...PAINTERS.high, ...PAINTERS.normal];\n}\n\n/** Test-only: clear the registry and re-register the built-ins. */\nexport function _resetShapePaintersForTests(): void {\n PAINTERS.high.length = 0;\n PAINTERS.normal.length = 0;\n builtInsRegistered = false;\n ensureBuiltIns();\n // `registerNodeShape` already bumps, but the clearing above happens without one.\n bumpNodeMemoGeneration();\n}\n\nfunction registerBuiltInShapePainters(): void {\n registerNodeShape(TEXT_PAINTER);\n registerNodeShape(MEASURE_PAINTER);\n // Ahead of path/shape/image: a derived node whose `data` also carries a\n // `path`, `shape` or `image` means the derived path, and those three match\n // on the presence of the field alone.\n registerNodeShape(DERIVED_PAINTER);\n registerNodeShape(PATH_PAINTER);\n registerNodeShape(SHAPE_PAINTER);\n registerNodeShape(IMAGE_PAINTER);\n registerNodeShape(RECT_FALLBACK_PAINTER);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,cAAiC,OAAO,OAAO;CAAE,QAAQ;CAAM,QAAQ;CAAG,OAAO;AAAE,CAAC;AASjG,IAAM,WAAiE;CACrE,MAAM,CAAC;CACP,QAAQ,CAAC;AACX;AAIA,IAAI,qBAAqB;AACzB,SAAS,iBAAuB;CAC9B,IAAI,oBAAoB;CACxB,qBAAqB;CACrB,6BAA6B;AAC/B;;AAGA,SAAgB,kBACd,SACA,OAAiC,CAAC,GACtB;CACZ,eAAe;CACf,MAAM,OAAO,KAAK,aAAa,SAAS,SAAS,OAAO,SAAS;CACjE,KAAK,KAAK,OAAyB;CAGnC,uBAAuB;CACvB,aAAa;EACX,MAAM,IAAI,KAAK,QAAQ,OAAyB;EAChD,IAAI,KAAK,GAAG,KAAK,OAAO,GAAG,CAAC;EAC5B,uBAAuB;CACzB;AACF;;;;;;;;;AAUA,IAAM,eAAe;AACrB,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,+BAA+B;AACrC,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;;;AAI7B,SAAgB,cACd,MAC0C;CAG1C,MAAM,OAAO,WAAW,KAAK,IAAI;CACjC,MAAM,OAAO,YAAY,IAAI,IACxB,OAAO,uBAAuB,+BAC9B,OAAO,eAAe;CAC3B,OAAO,SAAS,MAA4B,MAAM,cAChD,eAAe,IAAI,CACrB;AACF;AAEA,SAAS,eACP,MAC0C;CAC1C,eAAe;CACf,KAAK,MAAM,KAAK,SAAS,MACvB,IAAI,EAAE,QAAQ,IAAsC,GAClD,OAAO;CAGX,KAAK,MAAM,KAAK,SAAS,QACvB,IAAI,EAAE,QAAQ,IAAsC,GAClD,OAAO;AAIb;;;;;;;;AASA,SAAgB,oBACd,MACA,MACA,KACa;CACb,MAAM,cAA2B;EAC/B,MAAM,MAAM,cAAc,IAAI,CAAC,EAAE,aAAa,MAAM,MAAM,GAAG,KAAK;EAClE,OAAO,OAAO,qBAAqB,KAAK,IAAI;CAC9C;CAOA,IAAI,KAAK,eAAe,MAAM,OAAO,MAAM;CAG3C,IAAI,cAAc,IAAI,MAAO,cAAmD;EAC9E,MAAM,QAAQ,gBAAgB;EAC9B,MAAM,OAAO,SAAS,MAA4B,sBAAsB,aACzB;GAAE;GAAO,MAAM,MAAM;EAAE,EAAE;EACxE,IAAI,KAAK,UAAU,OAAO;GACxB,KAAK,QAAQ;GACb,KAAK,OAAO,MAAM;EACpB;EACA,OAAO,KAAK;CACd;CACA,OAAO,SAAS,MAA4B,iBAAiB,MAAM,KAAK;AAC1E;AAGA,qBAAqB,QAAQ,oBAAoB,IAAI,MAAM,IAAI,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC,CAAC;;;;AAK/F,SAAgB,aACd,MACA,MACA,KACgB;CAChB,OAAO,cAAc,IAAI,CAAC,EAAE,MAAM,MAAM,MAAM,GAAG,KAAK;AACxD;;;;AAKA,SAAgB,gBACd,MACA,MACA,KACe;CACf,OAAO,cAAc,IAAI,CAAC,EAAE,SAAS,MAAM,MAAM,GAAG,KAAK;AAC3D;;;;;;;;;;;;AAiCA,SAAgB,iBACd,MACA,MACA,GACA,GACA,OAAgC,CAAC,GACxB;CAET,IAAI,KAAK,SAAS,SAAS,OAAO;CAClC,MAAM,MAAM,oBAAoB,MAAM,MAAM,EAAE,aAAa,KAAK,YAAY,CAAC;CAC7E,IAAI,QAAQ,MAAM,OAAO;CACzB,MAAM,MAAM,aAAa,MAAM,MAAM;EAAE,OAAO,KAAK;EAAO,WAAW,KAAK;CAAU,CAAC,KAAK;CAC1F,MAAM,SAAS,kBAAkB,KAAK,GAAG,CAAC;CAC1C,IAAI,IAAI,UAAU,QAAQ,OAAO;CAIjC,MAAM,OAAO,UAAU,KAAK,YAAY,SAAS,IAAI,UAAU,IAAI,aAAa,GAAG,KAAK,KAAK;CAC7F,MAAM,EAAE,OAAO,MAAM,QAAQ,iBAAiB,IAAI;CAClD,MAAM,SAAS,SAAS,IAAI,QAAQ,IAAI,UAAU;CAClD,QAAQ,QAAQ,KAAK,QAAQ,IAAI,MAAM,cAAc,KAAK,GAAG,GAAG,OAAO,GAAG;AAC5E;;AAGA,SAAgB,gBAA2C;CACzD,eAAe;CACf,OAAO,CAAC,GAAG,SAAS,MAAM,GAAG,SAAS,MAAM;AAC9C;AAYA,SAAS,+BAAqC;CAC5C,kBAAkB,YAAY;CAC9B,kBAAkB,eAAe;CAIjC,kBAAkB,eAAe;CACjC,kBAAkB,YAAY;CAC9B,kBAAkB,aAAa;CAC/B,kBAAkB,aAAa;CAC/B,kBAAkB,qBAAqB;AACzC"}
@@ -54,16 +54,20 @@ function PickHud({ canvasRef, anchorRef, viewRef, toWorld, pickEvery, pickBest,
54
54
  });
55
55
  return;
56
56
  }
57
- const [worldX, worldY] = toWorldRef.current?.(e.clientX, e.clientY) ?? clientToWorld(e.clientX, e.clientY, rect, view);
57
+ const [x, y] = toWorldRef.current?.(e.clientX, e.clientY) ?? clientToWorld(e.clientX, e.clientY, rect, view);
58
+ const world = {
59
+ x,
60
+ y
61
+ };
58
62
  let ids = [];
59
63
  try {
60
- ids = pickEvery(worldX, worldY);
64
+ ids = pickEvery(world);
61
65
  } catch {
62
66
  ids = [];
63
67
  }
64
68
  let best = null;
65
69
  if (pickBest) try {
66
- best = pickBest(worldX, worldY);
70
+ best = pickBest(world);
67
71
  } catch {
68
72
  best = null;
69
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PickHud.js","names":["s"],"sources":["../../src/canvas/PickHud.tsx"],"sourcesContent":["/// <reference path=\"../css-modules.d.ts\" />\n/**\n * Dev HUD listing the ids returned by `pickEvery(world)` under the cursor.\n *\n * Anchors to the canvas's top-right corner like `CursorCoordsHud`, offset\n * downward so it sits just below that HUD. Updates on `document`\n * pointermove. Refreshes its position on scroll / resize so it tracks the\n * canvas through layout changes.\n */\nimport { useEffect, useState } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { View } from 'core/viewport/view';\nimport { clientToWorld } from 'core/viewport/clientToWorld';\nimport { useHostAnchor } from './useHostAnchor';\nimport s from './hud.module.css';\n\n/** Props for `<PickHud>`. */\nexport interface PickHudProps {\n canvasRef: React.RefObject<HTMLElement | null>;\n /** Element the HUD pins its corner to. Defaults to the canvas's parent — the\n * wrapper a bare `<canvas>` sits in. A detached canvas passes its own input\n * box, whose parent is the shared surface every pane sits in. */\n anchorRef?: React.RefObject<HTMLElement | null>;\n viewRef: React.RefObject<View>;\n /** Client coords to world. Defaults to the canvas's rect and `viewRef`. A\n * canvas whose routing converts some other way (a CSS transform, a 3D host)\n * passes that conversion, so the readout agrees with the picks. */\n toWorld?: (clientX: number, clientY: number) => [number, number];\n /** World-space hit-test. Same shape as `useSelectTool`'s `pickEvery`. */\n pickEvery: (worldX: number, worldY: number) => readonly string[];\n /** Optional single-best resolver — the id this point would select on a\n * bare click. When supplied, that id is rendered bold in the list. */\n pickBest?: (worldX: number, worldY: number) => string | null;\n /** Inset from the canvas's top-right corner. Default `{ top: 76, right: 8 }`\n * so the HUD clears `CursorCoordsHud` (~64 px tall in its 3-line form). */\n offset?: { top?: number; right?: number };\n}\n\ninterface HudState {\n ids: readonly string[];\n best: string | null;\n inCanvas: boolean;\n}\n\n/** Debug overlay listing every node under the pointer, with the one a click\n * would actually select shown in bold. */\nexport function PickHud({ canvasRef, anchorRef, viewRef, toWorld, pickEvery, pickBest, offset }: PickHudProps) {\n const toWorldRef = useLatest(toWorld);\n const [state, setState] = useState<HudState>({\n ids: [], best: null, inCanvas: false,\n });\n const { ref, style } = useHostAnchor(\n () => anchorRef?.current ?? canvasRef.current?.parentElement ?? canvasRef.current,\n {\n align: { x: 'end', y: 'start' },\n offset: { x: offset?.right ?? 8, y: offset?.top ?? 76 },\n },\n );\n\n useEffect(() => {\n const onMove = (e: PointerEvent) => {\n const canvas = canvasRef.current;\n const view = viewRef.current;\n if (!canvas || !view) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const rect = canvas.getBoundingClientRect();\n const inCanvas =\n e.clientX >= rect.left && e.clientX <= rect.right &&\n e.clientY >= rect.top && e.clientY <= rect.bottom;\n if (!inCanvas) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const [worldX, worldY] = toWorldRef.current?.(e.clientX, e.clientY)\n ?? clientToWorld(e.clientX, e.clientY, rect, view);\n let ids: readonly string[] = [];\n try {\n ids = pickEvery(worldX, worldY);\n } catch {\n ids = [];\n }\n let best: string | null = null;\n if (pickBest) {\n try { best = pickBest(worldX, worldY); } catch { best = null; }\n }\n setState({ ids, best, inCanvas: true });\n };\n\n document.addEventListener('pointermove', onMove);\n\n return () => {\n document.removeEventListener('pointermove', onMove);\n };\n }, [canvasRef, viewRef, pickEvery, pickBest, toWorldRef]);\n\n if (!style) return null;\n\n return (\n <div ref={ref} className={`${s.hud} ${s.sized}`} style={style}>\n <div className={`${s.header} ${s.muted}`}>pickEvery ({state.ids.length})</div>\n {state.ids.length === 0 ? (\n <div className={s.absent}>{state.inCanvas ? '—' : 'off-canvas'}</div>\n ) : (\n <ul className={s.list}>\n {/* pickEvery returns back-to-front (topmost last). Display top-first. */}\n {state.ids.slice().reverse().map((id) => (\n <li\n key={id}\n className={id === state.best ? `${s.item} ${s.itemBest}` : s.item}\n >\n {id}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8CA,SAAgB,QAAQ,EAAE,WAAW,WAAW,SAAS,SAAS,WAAW,UAAU,UAAwB;CAC7G,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,CAAC,OAAO,YAAY,SAAmB;EAC3C,KAAK,CAAC;EAAG,MAAM;EAAM,UAAU;CACjC,CAAC;CACD,MAAM,EAAE,KAAK,UAAU,oBACf,WAAW,WAAW,UAAU,SAAS,iBAAiB,UAAU,SAC1E;EACE,OAAO;GAAE,GAAG;GAAO,GAAG;EAAQ;EAC9B,QAAQ;GAAE,GAAG,QAAQ,SAAS;GAAG,GAAG,QAAQ,OAAO;EAAG;CACxD,CACF;CAEA,gBAAgB;EACd,MAAM,UAAU,MAAoB;GAClC,MAAM,SAAS,UAAU;GACzB,MAAM,OAAO,QAAQ;GACrB,IAAI,CAAC,UAAU,CAAC,MAAM;IACpB,SAAS;KAAE,KAAK,CAAC;KAAG,MAAM;KAAM,UAAU;IAAM,CAAC;IACjD;GACF;GACA,MAAM,OAAO,OAAO,sBAAsB;GAI1C,IAAI,EAFF,EAAE,WAAW,KAAK,QAAQ,EAAE,WAAW,KAAK,SAC5C,EAAE,WAAW,KAAK,OAAQ,EAAE,WAAW,KAAK,SAC/B;IACb,SAAS;KAAE,KAAK,CAAC;KAAG,MAAM;KAAM,UAAU;IAAM,CAAC;IACjD;GACF;GACA,MAAM,CAAC,QAAQ,UAAU,WAAW,UAAU,EAAE,SAAS,EAAE,OAAO,KAC7D,cAAc,EAAE,SAAS,EAAE,SAAS,MAAM,IAAI;GACnD,IAAI,MAAyB,CAAC;GAC9B,IAAI;IACF,MAAM,UAAU,QAAQ,MAAM;GAChC,QAAQ;IACN,MAAM,CAAC;GACT;GACA,IAAI,OAAsB;GAC1B,IAAI,UACF,IAAI;IAAE,OAAO,SAAS,QAAQ,MAAM;GAAG,QAAQ;IAAE,OAAO;GAAM;GAEhE,SAAS;IAAE;IAAK;IAAM,UAAU;GAAK,CAAC;EACxC;EAEA,SAAS,iBAAiB,eAAe,MAAM;EAE/C,aAAa;GACX,SAAS,oBAAoB,eAAe,MAAM;EACpD;CACF,GAAG;EAAC;EAAW;EAAS;EAAW;EAAU;CAAU,CAAC;CAExD,IAAI,CAAC,OAAO,OAAO;CAEnB,OACE,qBAAC,OAAD;EAAU;EAAK,WAAW,GAAGA,mBAAE,IAAI,GAAGA,mBAAE;EAAgB;EAAxD,UAAA,CACE,qBAAC,OAAD;GAAK,WAAW,GAAGA,mBAAE,OAAO,GAAGA,mBAAE;GAAjC,UAAA;IAA0C;IAAY,MAAM,IAAI;IAAO;GAAM;EAC5E,CAAA,GAAA,MAAM,IAAI,WAAW,IACpB,oBAAC,OAAD;GAAK,WAAWA,mBAAE;GAAS,UAAA,MAAM,WAAW,MAAM;EAAkB,CAAA,IAEpE,oBAAC,MAAD;GAAI,WAAWA,mBAAE;GAEd,UAAA,MAAM,IAAI,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,OAChC,oBAAC,MAAD;IAEE,WAAW,OAAO,MAAM,OAAO,GAAGA,mBAAE,KAAK,GAAGA,mBAAE,aAAaA,mBAAE;IAE5D,UAAA;GACC,GAJG,EAIH,CACL;EACC,CAAA,CAEH;;AAET"}
1
+ {"version":3,"file":"PickHud.js","names":["s"],"sources":["../../src/canvas/PickHud.tsx"],"sourcesContent":["/// <reference path=\"../css-modules.d.ts\" />\n/**\n * Dev HUD listing the ids returned by `pickEvery(world)` under the cursor.\n *\n * Anchors to the canvas's top-right corner like `CursorCoordsHud`, offset\n * downward so it sits just below that HUD. Updates on `document`\n * pointermove. Refreshes its position on scroll / resize so it tracks the\n * canvas through layout changes.\n */\nimport { useEffect, useState } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { View } from 'core/viewport/view';\nimport type { WorldPoint } from '@weasel-js/routing';\nimport { clientToWorld } from 'core/viewport/clientToWorld';\nimport { useHostAnchor } from './useHostAnchor';\nimport s from './hud.module.css';\n\n/** Props for `<PickHud>`. */\nexport interface PickHudProps {\n canvasRef: React.RefObject<HTMLElement | null>;\n /** Element the HUD pins its corner to. Defaults to the canvas's parent — the\n * wrapper a bare `<canvas>` sits in. A detached canvas passes its own input\n * box, whose parent is the shared surface every pane sits in. */\n anchorRef?: React.RefObject<HTMLElement | null>;\n viewRef: React.RefObject<View>;\n /** Client coords to world. Defaults to the canvas's rect and `viewRef`. A\n * canvas whose routing converts some other way (a CSS transform, a 3D host)\n * passes that conversion, so the readout agrees with the picks. */\n toWorld?: (clientX: number, clientY: number) => [number, number];\n /** World-space hit-test. Same shape as `useSelectTool`'s `pickEvery`. */\n pickEvery: (world: WorldPoint) => readonly string[];\n /** Optional single-best resolver — the id this point would select on a\n * bare click. When supplied, that id is rendered bold in the list. */\n pickBest?: (world: WorldPoint) => string | null;\n /** Inset from the canvas's top-right corner. Default `{ top: 76, right: 8 }`\n * so the HUD clears `CursorCoordsHud` (~64 px tall in its 3-line form). */\n offset?: { top?: number; right?: number };\n}\n\ninterface HudState {\n ids: readonly string[];\n best: string | null;\n inCanvas: boolean;\n}\n\n/** Debug overlay listing every node under the pointer, with the one a click\n * would actually select shown in bold. */\nexport function PickHud({ canvasRef, anchorRef, viewRef, toWorld, pickEvery, pickBest, offset }: PickHudProps) {\n const toWorldRef = useLatest(toWorld);\n const [state, setState] = useState<HudState>({\n ids: [], best: null, inCanvas: false,\n });\n const { ref, style } = useHostAnchor(\n () => anchorRef?.current ?? canvasRef.current?.parentElement ?? canvasRef.current,\n {\n align: { x: 'end', y: 'start' },\n offset: { x: offset?.right ?? 8, y: offset?.top ?? 76 },\n },\n );\n\n useEffect(() => {\n const onMove = (e: PointerEvent) => {\n const canvas = canvasRef.current;\n const view = viewRef.current;\n if (!canvas || !view) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const rect = canvas.getBoundingClientRect();\n const inCanvas =\n e.clientX >= rect.left && e.clientX <= rect.right &&\n e.clientY >= rect.top && e.clientY <= rect.bottom;\n if (!inCanvas) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const [x, y] = toWorldRef.current?.(e.clientX, e.clientY)\n ?? clientToWorld(e.clientX, e.clientY, rect, view);\n const world = { x, y };\n let ids: readonly string[] = [];\n try {\n ids = pickEvery(world);\n } catch {\n ids = [];\n }\n let best: string | null = null;\n if (pickBest) {\n try { best = pickBest(world); } catch { best = null; }\n }\n setState({ ids, best, inCanvas: true });\n };\n\n document.addEventListener('pointermove', onMove);\n\n return () => {\n document.removeEventListener('pointermove', onMove);\n };\n }, [canvasRef, viewRef, pickEvery, pickBest, toWorldRef]);\n\n if (!style) return null;\n\n return (\n <div ref={ref} className={`${s.hud} ${s.sized}`} style={style}>\n <div className={`${s.header} ${s.muted}`}>pickEvery ({state.ids.length})</div>\n {state.ids.length === 0 ? (\n <div className={s.absent}>{state.inCanvas ? '—' : 'off-canvas'}</div>\n ) : (\n <ul className={s.list}>\n {/* pickEvery returns back-to-front (topmost last). Display top-first. */}\n {state.ids.slice().reverse().map((id) => (\n <li\n key={id}\n className={id === state.best ? `${s.item} ${s.itemBest}` : s.item}\n >\n {id}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,SAAgB,QAAQ,EAAE,WAAW,WAAW,SAAS,SAAS,WAAW,UAAU,UAAwB;CAC7G,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,CAAC,OAAO,YAAY,SAAmB;EAC3C,KAAK,CAAC;EAAG,MAAM;EAAM,UAAU;CACjC,CAAC;CACD,MAAM,EAAE,KAAK,UAAU,oBACf,WAAW,WAAW,UAAU,SAAS,iBAAiB,UAAU,SAC1E;EACE,OAAO;GAAE,GAAG;GAAO,GAAG;EAAQ;EAC9B,QAAQ;GAAE,GAAG,QAAQ,SAAS;GAAG,GAAG,QAAQ,OAAO;EAAG;CACxD,CACF;CAEA,gBAAgB;EACd,MAAM,UAAU,MAAoB;GAClC,MAAM,SAAS,UAAU;GACzB,MAAM,OAAO,QAAQ;GACrB,IAAI,CAAC,UAAU,CAAC,MAAM;IACpB,SAAS;KAAE,KAAK,CAAC;KAAG,MAAM;KAAM,UAAU;IAAM,CAAC;IACjD;GACF;GACA,MAAM,OAAO,OAAO,sBAAsB;GAI1C,IAAI,EAFF,EAAE,WAAW,KAAK,QAAQ,EAAE,WAAW,KAAK,SAC5C,EAAE,WAAW,KAAK,OAAQ,EAAE,WAAW,KAAK,SAC/B;IACb,SAAS;KAAE,KAAK,CAAC;KAAG,MAAM;KAAM,UAAU;IAAM,CAAC;IACjD;GACF;GACA,MAAM,CAAC,GAAG,KAAK,WAAW,UAAU,EAAE,SAAS,EAAE,OAAO,KACnD,cAAc,EAAE,SAAS,EAAE,SAAS,MAAM,IAAI;GACnD,MAAM,QAAQ;IAAE;IAAG;GAAE;GACrB,IAAI,MAAyB,CAAC;GAC9B,IAAI;IACF,MAAM,UAAU,KAAK;GACvB,QAAQ;IACN,MAAM,CAAC;GACT;GACA,IAAI,OAAsB;GAC1B,IAAI,UACF,IAAI;IAAE,OAAO,SAAS,KAAK;GAAG,QAAQ;IAAE,OAAO;GAAM;GAEvD,SAAS;IAAE;IAAK;IAAM,UAAU;GAAK,CAAC;EACxC;EAEA,SAAS,iBAAiB,eAAe,MAAM;EAE/C,aAAa;GACX,SAAS,oBAAoB,eAAe,MAAM;EACpD;CACF,GAAG;EAAC;EAAW;EAAS;EAAW;EAAU;CAAU,CAAC;CAExD,IAAI,CAAC,OAAO,OAAO;CAEnB,OACE,qBAAC,OAAD;EAAU;EAAK,WAAW,GAAGA,mBAAE,IAAI,GAAGA,mBAAE;EAAgB;EAAxD,UAAA,CACE,qBAAC,OAAD;GAAK,WAAW,GAAGA,mBAAE,OAAO,GAAGA,mBAAE;GAAjC,UAAA;IAA0C;IAAY,MAAM,IAAI;IAAO;GAAM;EAC5E,CAAA,GAAA,MAAM,IAAI,WAAW,IACpB,oBAAC,OAAD;GAAK,WAAWA,mBAAE;GAAS,UAAA,MAAM,WAAW,MAAM;EAAkB,CAAA,IAEpE,oBAAC,MAAD;GAAI,WAAWA,mBAAE;GAEd,UAAA,MAAM,IAAI,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,OAChC,oBAAC,MAAD;IAEE,WAAW,OAAO,MAAM,OAAO,GAAGA,mBAAE,KAAK,GAAGA,mBAAE,aAAaA,mBAAE;IAE5D,UAAA;GACC,GAJG,EAIH,CACL;EACC,CAAA,CAEH;;AAET"}
@@ -1,6 +1,6 @@
1
1
  import { ViewInputsProvider } from "../viewInputs.js";
2
2
  import { PointerProviderIfRoot } from "./PointerProviderIfRoot.js";
3
- import { SnapSourceRegistryContext, createSnapSourceRegistry } from "../../features/snap/registry.js";
3
+ import { SnapSourceRegistryContext, createSnapSourceRegistry } from "../../domains/snap/registry.js";
4
4
  import { IconRegistryProviderIfRoot } from "../../iconRegistry/IconRegistryProvider.js";
5
5
  import { useState } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasKitProviders.js","names":[],"sources":["../../../src/canvas/SceneCanvas/CanvasKitProviders.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport { createSnapSourceRegistry, SnapSourceRegistryContext } from 'features/snap/registry';\nimport { IconRegistryProviderIfRoot } from '../../iconRegistry';\nimport { ViewInputsProvider, type SurfaceViewInputs } from '../viewInputs';\nimport { PointerProviderIfRoot } from './PointerProviderIfRoot';\n\n/** The kit providers a canvas mounts around its surface: view inputs and the\n * snap source registry, then the icon registry and pointer context where none\n * is already in scope. */\nexport function CanvasKitProviders({ viewInputs, children }: { viewInputs: SurfaceViewInputs; children: ReactNode }) {\n const [snapRegistry] = useState(createSnapSourceRegistry);\n return (\n <ViewInputsProvider value={viewInputs}>\n <SnapSourceRegistryContext.Provider value={snapRegistry}>\n <IconRegistryProviderIfRoot>\n <PointerProviderIfRoot>{children}</PointerProviderIfRoot>\n </IconRegistryProviderIfRoot>\n </SnapSourceRegistryContext.Provider>\n </ViewInputsProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,mBAAmB,EAAE,YAAY,YAAoE;CACnH,MAAM,CAAC,gBAAgB,SAAS,wBAAwB;CACxD,OACE,oBAAC,oBAAD;EAAoB,OAAO;EACzB,UAAA,oBAAC,0BAA0B,UAA3B;GAAoC,OAAO;GACzC,UAAA,oBAAC,4BAAD,EAAA,UACE,oBAAC,uBAAD,EAAwB,SAAgC,CAAA,EAC9B,CAAA;EACM,CAAA;CAClB,CAAA;AAExB"}
1
+ {"version":3,"file":"CanvasKitProviders.js","names":[],"sources":["../../../src/canvas/SceneCanvas/CanvasKitProviders.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport { createSnapSourceRegistry, SnapSourceRegistryContext } from 'domains/snap/registry';\nimport { IconRegistryProviderIfRoot } from '../../iconRegistry';\nimport { ViewInputsProvider, type SurfaceViewInputs } from '../viewInputs';\nimport { PointerProviderIfRoot } from './PointerProviderIfRoot';\n\n/** The kit providers a canvas mounts around its surface: view inputs and the\n * snap source registry, then the icon registry and pointer context where none\n * is already in scope. */\nexport function CanvasKitProviders({ viewInputs, children }: { viewInputs: SurfaceViewInputs; children: ReactNode }) {\n const [snapRegistry] = useState(createSnapSourceRegistry);\n return (\n <ViewInputsProvider value={viewInputs}>\n <SnapSourceRegistryContext.Provider value={snapRegistry}>\n <IconRegistryProviderIfRoot>\n <PointerProviderIfRoot>{children}</PointerProviderIfRoot>\n </IconRegistryProviderIfRoot>\n </SnapSourceRegistryContext.Provider>\n </ViewInputsProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,mBAAmB,EAAE,YAAY,YAAoE;CACnH,MAAM,CAAC,gBAAgB,SAAS,wBAAwB;CACxD,OACE,oBAAC,oBAAD;EAAoB,OAAO;EACzB,UAAA,oBAAC,0BAA0B,UAA3B;GAAoC,OAAO;GACzC,UAAA,oBAAC,4BAAD,EAAA,UACE,oBAAC,uBAAD,EAAwB,SAAgC,CAAA,EAC9B,CAAA;EACM,CAAA;CAClB,CAAA;AAExB"}
@@ -17,8 +17,8 @@ function DevHuds(props) {
17
17
  pickEvery: props.pickEvery,
18
18
  pickBest: props.pickBest
19
19
  });
20
- const pickEvery = useCallback((wx, wy) => pickersRef.current.pickEvery(wx, wy), [pickersRef]);
21
- const pickBest = useCallback((wx, wy) => pickersRef.current.pickBest(wx, wy), [pickersRef]);
20
+ const pickEvery = useCallback((world) => pickersRef.current.pickEvery(world), [pickersRef]);
21
+ const pickBest = useCallback((world) => pickersRef.current.pickBest(world), [pickersRef]);
22
22
  if (detachedInput === null) return null;
23
23
  const anchor = detachedInput ? { anchorRef: canvasRef } : {};
24
24
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1 +1 @@
1
- {"version":3,"file":"DevHuds.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/DevHuds.tsx"],"sourcesContent":["/**\n * `<SceneCanvas>`'s dev HUDs: the cursor readout, the pick list, and the\n * modality panel, each a fixed-position widget pinned to the canvas.\n */\nimport { useCallback, type RefObject } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { View } from 'core/viewport/view';\nimport type { DebugConfig } from '../../debug/types';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { CursorCoordsHud } from '../CursorCoordsHud';\nimport { ModalityHud } from '../ModalityHud';\nimport { PickHud } from '../PickHud';\n\nexport interface DevHudsProps {\n cursorCoords: boolean | undefined;\n pick: boolean | undefined;\n /** `true` leaves the mode line at `—`; an object supplies the mode id. */\n modality: boolean | { modeId?: string } | undefined;\n /** The element input comes from. */\n canvasRef: RefObject<HTMLElement | null>;\n /** Read for the canvas's own client→world conversion, so a readout agrees\n * with a pick. */\n canvasApiRef: RefObject<Pick<CanvasExtensionApi, 'clientToWorld'> | null>;\n /** Under `paintInto`, the caller's input element, `null` until it arrives;\n * `undefined` when the canvas renders its own. Each HUD of a detached\n * canvas pins to the input element itself, not to its parent, which every\n * pane of the shared surface sits in. */\n detachedInput: HTMLElement | null | undefined;\n viewRef: RefObject<View>;\n pickEvery: (worldX: number, worldY: number) => readonly string[];\n /** The id a bare click at this point would select. */\n pickBest: (worldX: number, worldY: number) => string | null;\n}\n\nexport function DevHuds(props: DevHudsProps) {\n const { cursorCoords, pick, modality, canvasRef, canvasApiRef, detachedInput, viewRef } = props;\n const toWorld = useCallback(\n (clientX: number, clientY: number): [number, number] =>\n canvasApiRef.current?.clientToWorld(clientX, clientY) ?? [clientX, clientY],\n [canvasApiRef],\n );\n // The pick HUD installs its pointer listener again whenever a picker's\n // identity changes, so it gets two that never do.\n const pickersRef = useLatest({ pickEvery: props.pickEvery, pickBest: props.pickBest });\n const pickEvery = useCallback(\n (wx: number, wy: number): readonly string[] => pickersRef.current.pickEvery(wx, wy),\n [pickersRef],\n );\n const pickBest = useCallback(\n (wx: number, wy: number): string | null => pickersRef.current.pickBest(wx, wy),\n [pickersRef],\n );\n\n // `useHostAnchor` resolves its host on mount and again only when the panel\n // or the window moves, so a HUD mounted against a null host would latch off.\n if (detachedInput === null) return null;\n\n const anchor = detachedInput ? { anchorRef: canvasRef } : {};\n return (\n <>\n {cursorCoords && (\n <CursorCoordsHud canvasRef={canvasRef} {...anchor} viewRef={viewRef} toWorld={toWorld} />\n )}\n {pick && (\n <PickHud\n canvasRef={canvasRef}\n {...anchor}\n viewRef={viewRef}\n toWorld={toWorld}\n pickEvery={pickEvery}\n pickBest={pickBest}\n />\n )}\n {modality && (\n <ModalityHud\n canvasRef={canvasRef}\n {...anchor}\n modeId={typeof modality === 'object' ? modality.modeId : undefined}\n />\n )}\n </>\n );\n}\n\n/** `<SceneCanvas debug>` minus the flag only SceneCanvas reads. */\nexport function canvasDebug(debug: (DebugConfig & { slops?: boolean }) | false): DebugConfig | false {\n if (debug === false) return false;\n const { slops: _slops, ...rest } = debug;\n return rest;\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,EAAE,cAAc,MAAM,UAAU,WAAW,cAAc,eAAe,YAAY;CAC1F,MAAM,UAAU,aACb,SAAiB,YAChB,aAAa,SAAS,cAAc,SAAS,OAAO,KAAK,CAAC,SAAS,OAAO,GAC5E,CAAC,YAAY,CACf;CAGA,MAAM,aAAa,UAAU;EAAE,WAAW,MAAM;EAAW,UAAU,MAAM;CAAS,CAAC;CACrF,MAAM,YAAY,aACf,IAAY,OAAkC,WAAW,QAAQ,UAAU,IAAI,EAAE,GAClF,CAAC,UAAU,CACb;CACA,MAAM,WAAW,aACd,IAAY,OAA8B,WAAW,QAAQ,SAAS,IAAI,EAAE,GAC7E,CAAC,UAAU,CACb;CAIA,IAAI,kBAAkB,MAAM,OAAO;CAEnC,MAAM,SAAS,gBAAgB,EAAE,WAAW,UAAU,IAAI,CAAC;CAC3D,OACE,qBAAAA,UAAA,EAAA,UAAA;EACG,gBACC,oBAAC,iBAAD;GAA4B;GAAW,GAAI;GAAiB;GAAkB;EAAU,CAAA;EAEzF,QACC,oBAAC,SAAD;GACa;GACX,GAAI;GACK;GACA;GACE;GACD;EACX,CAAA;EAEF,YACC,oBAAC,aAAD;GACa;GACX,GAAI;GACJ,QAAQ,OAAO,aAAa,WAAW,SAAS,SAAS;EAC1D,CAAA;CAEH,EAAA,CAAA;AAEN;;AAGA,SAAgB,YAAY,OAAyE;CACnG,IAAI,UAAU,OAAO,OAAO;CAC5B,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;CACnC,OAAO;AACT"}
1
+ {"version":3,"file":"DevHuds.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/DevHuds.tsx"],"sourcesContent":["/**\n * `<SceneCanvas>`'s dev HUDs: the cursor readout, the pick list, and the\n * modality panel, each a fixed-position widget pinned to the canvas.\n */\nimport { useCallback, type RefObject } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { View } from 'core/viewport/view';\nimport type { WorldPoint } from '@weasel-js/routing';\nimport type { DebugConfig } from '../../debug/types';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { CursorCoordsHud } from '../CursorCoordsHud';\nimport { ModalityHud } from '../ModalityHud';\nimport { PickHud } from '../PickHud';\n\nexport interface DevHudsProps {\n cursorCoords: boolean | undefined;\n pick: boolean | undefined;\n /** `true` leaves the mode line at `—`; an object supplies the mode id. */\n modality: boolean | { modeId?: string } | undefined;\n /** The element input comes from. */\n canvasRef: RefObject<HTMLElement | null>;\n /** Read for the canvas's own client→world conversion, so a readout agrees\n * with a pick. */\n canvasApiRef: RefObject<Pick<CanvasExtensionApi, 'clientToWorld'> | null>;\n /** Under `paintInto`, the caller's input element, `null` until it arrives;\n * `undefined` when the canvas renders its own. Each HUD of a detached\n * canvas pins to the input element itself, not to its parent, which every\n * pane of the shared surface sits in. */\n detachedInput: HTMLElement | null | undefined;\n viewRef: RefObject<View>;\n pickEvery: (world: WorldPoint) => readonly string[];\n /** The id a bare click at this point would select. */\n pickBest: (world: WorldPoint) => string | null;\n}\n\nexport function DevHuds(props: DevHudsProps) {\n const { cursorCoords, pick, modality, canvasRef, canvasApiRef, detachedInput, viewRef } = props;\n const toWorld = useCallback(\n (clientX: number, clientY: number): [number, number] =>\n canvasApiRef.current?.clientToWorld(clientX, clientY) ?? [clientX, clientY],\n [canvasApiRef],\n );\n // The pick HUD installs its pointer listener again whenever a picker's\n // identity changes, so it gets two that never do.\n const pickersRef = useLatest({ pickEvery: props.pickEvery, pickBest: props.pickBest });\n const pickEvery = useCallback(\n (world: WorldPoint): readonly string[] => pickersRef.current.pickEvery(world),\n [pickersRef],\n );\n const pickBest = useCallback(\n (world: WorldPoint): string | null => pickersRef.current.pickBest(world),\n [pickersRef],\n );\n\n // `useHostAnchor` resolves its host on mount and again only when the panel\n // or the window moves, so a HUD mounted against a null host would latch off.\n if (detachedInput === null) return null;\n\n const anchor = detachedInput ? { anchorRef: canvasRef } : {};\n return (\n <>\n {cursorCoords && (\n <CursorCoordsHud canvasRef={canvasRef} {...anchor} viewRef={viewRef} toWorld={toWorld} />\n )}\n {pick && (\n <PickHud\n canvasRef={canvasRef}\n {...anchor}\n viewRef={viewRef}\n toWorld={toWorld}\n pickEvery={pickEvery}\n pickBest={pickBest}\n />\n )}\n {modality && (\n <ModalityHud\n canvasRef={canvasRef}\n {...anchor}\n modeId={typeof modality === 'object' ? modality.modeId : undefined}\n />\n )}\n </>\n );\n}\n\n/** `<SceneCanvas debug>` minus the flag only SceneCanvas reads. */\nexport function canvasDebug(debug: (DebugConfig & { slops?: boolean }) | false): DebugConfig | false {\n if (debug === false) return false;\n const { slops: _slops, ...rest } = debug;\n return rest;\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,EAAE,cAAc,MAAM,UAAU,WAAW,cAAc,eAAe,YAAY;CAC1F,MAAM,UAAU,aACb,SAAiB,YAChB,aAAa,SAAS,cAAc,SAAS,OAAO,KAAK,CAAC,SAAS,OAAO,GAC5E,CAAC,YAAY,CACf;CAGA,MAAM,aAAa,UAAU;EAAE,WAAW,MAAM;EAAW,UAAU,MAAM;CAAS,CAAC;CACrF,MAAM,YAAY,aACf,UAAyC,WAAW,QAAQ,UAAU,KAAK,GAC5E,CAAC,UAAU,CACb;CACA,MAAM,WAAW,aACd,UAAqC,WAAW,QAAQ,SAAS,KAAK,GACvE,CAAC,UAAU,CACb;CAIA,IAAI,kBAAkB,MAAM,OAAO;CAEnC,MAAM,SAAS,gBAAgB,EAAE,WAAW,UAAU,IAAI,CAAC;CAC3D,OACE,qBAAAA,UAAA,EAAA,UAAA;EACG,gBACC,oBAAC,iBAAD;GAA4B;GAAW,GAAI;GAAiB;GAAkB;EAAU,CAAA;EAEzF,QACC,oBAAC,SAAD;GACa;GACX,GAAI;GACK;GACA;GACE;GACD;EACX,CAAA;EAEF,YACC,oBAAC,aAAD;GACa;GACX,GAAI;GACJ,QAAQ,OAAO,aAAa,WAAW,SAAS,SAAS;EAC1D,CAAA;CAEH,EAAA,CAAA;AAEN;;AAGA,SAAgB,YAAY,OAAyE;CACnG,IAAI,UAAU,OAAO,OAAO;CAC5B,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;CACnC,OAAO;AACT"}
@@ -42,8 +42,10 @@ function usePointerPublisher(canvasRef, canvasApiRef) {
42
42
  const target = registry?.resolver.at(pointerId, clientX, clientY);
43
43
  const [worldX, worldY] = worldPointAt(api, target, clientX, clientY);
44
44
  ctx.set({
45
- worldX,
46
- worldY,
45
+ world: {
46
+ x: worldX,
47
+ y: worldY
48
+ },
47
49
  viewId: target?.id ?? null
48
50
  });
49
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PointerProviderIfRoot.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/PointerProviderIfRoot.tsx"],"sourcesContent":["/**\n * Conditional `<PointerContextProvider>` wrapper. Mounts a provider only\n * when no parent provider is in scope — otherwise renders children unwrapped\n * so SceneCanvas defers to the host's existing scope.\n *\n * Pairs with `usePointerPublisher`, which attaches native pointermove/leave\n * listeners to the canvas element and writes world-space coords into the\n * surrounding context's `pointerRef`.\n */\nimport { useEffect, type MutableRefObject, type ReactNode, type RefObject } from 'react';\nimport { heldPointers } from '@weasel-js/gestures';\nimport { PointerContextProvider, usePointerContext } from '@weasel-js/routing/react';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { useOptionalViewRegistry } from '../viewRegistry';\nimport { worldPointAt } from './worldPointAt';\n\n/** Mount a `<PointerContextProvider>` only when none is already in scope. */\nexport function PointerProviderIfRoot({ children }: { children: ReactNode }) {\n const parent = usePointerContext();\n if (parent) return <>{children}</>;\n return <PointerContextProvider>{children}</PointerContextProvider>;\n}\n\n/**\n * Attaches native `pointermove` / `pointerleave` listeners to the supplied\n * canvas element and publishes the world-space pointer coordinates into the\n * surrounding `<PointerContextProvider>`. No-op when no provider is in scope\n * (matches \"publish if anyone is listening\").\n *\n * Called inside the provider scope so it sees both consumer-mounted providers\n * and SceneCanvas's auto-mounted one.\n */\nexport function usePointerPublisher(\n canvasRef: MutableRefObject<HTMLElement | null>,\n canvasApiRef: RefObject<CanvasExtensionApi | null>,\n): void {\n const ctx = usePointerContext();\n const registry = useOptionalViewRegistry();\n useEffect(() => {\n if (!ctx) return;\n const el = canvasRef.current;\n if (!el) return;\n // The surface's one resolver answers which camera a client point belongs\n // to, so paste-at-pointer lands in the panel the cursor is over. With no\n // views declared it answers the canvas's own camera and rect.\n const publish = (pointerId: number | null, clientX: number, clientY: number): void => {\n const api = canvasApiRef.current;\n if (!api) return;\n const target = registry?.resolver.at(pointerId, clientX, clientY);\n const [worldX, worldY] = worldPointAt(api, target, clientX, clientY);\n ctx.set({ worldX, worldY, viewId: target?.id ?? null });\n };\n const onMove = (e: PointerEvent): void => publish(e.pointerId, e.clientX, e.clientY);\n const held = heldPointers(el);\n const onLeave = (e: PointerEvent): void => {\n // A pointer held on the canvas is still working it once it leaves the\n // rect, and what it drives needs the latest world position.\n if (held.count() > 0) {\n publish(e.pointerId, e.clientX, e.clientY);\n return;\n }\n ctx.set(null);\n };\n // A drag that began on the canvas keeps reporting once it is off it; the\n // canvas's own listener has the moves that still target it.\n const onDocMove = (e: PointerEvent): void => {\n if (e.target === el) return;\n if (held.count() === 0) return;\n publish(e.pointerId, e.clientX, e.clientY);\n };\n el.addEventListener('pointermove', onMove);\n el.addEventListener('pointerleave', onLeave);\n document.addEventListener('pointermove', onDocMove);\n return () => {\n el.removeEventListener('pointermove', onMove);\n el.removeEventListener('pointerleave', onLeave);\n document.removeEventListener('pointermove', onDocMove);\n held.release();\n };\n // canvasRef + registry + ctx identity are all stable across the lifetime\n // of the surrounding provider; effect runs once per mount.\n }, [ctx, canvasRef, canvasApiRef, registry]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,EAAE,YAAqC;CAE3E,IADe,kBACX,GAAQ,OAAO,oBAAAA,UAAA,EAAG,SAAW,CAAA;CACjC,OAAO,oBAAC,wBAAD,EAAyB,SAAiC,CAAA;AACnE;;;;;;;;;;AAWA,SAAgB,oBACd,WACA,cACM;CACN,MAAM,MAAM,kBAAkB;CAC9B,MAAM,WAAW,wBAAwB;CACzC,gBAAgB;EACd,IAAI,CAAC,KAAK;EACV,MAAM,KAAK,UAAU;EACrB,IAAI,CAAC,IAAI;EAIT,MAAM,WAAW,WAA0B,SAAiB,YAA0B;GACpF,MAAM,MAAM,aAAa;GACzB,IAAI,CAAC,KAAK;GACV,MAAM,SAAS,UAAU,SAAS,GAAG,WAAW,SAAS,OAAO;GAChE,MAAM,CAAC,QAAQ,UAAU,aAAa,KAAK,QAAQ,SAAS,OAAO;GACnE,IAAI,IAAI;IAAE;IAAQ;IAAQ,QAAQ,QAAQ,MAAM;GAAK,CAAC;EACxD;EACA,MAAM,UAAU,MAA0B,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;EACnF,MAAM,OAAO,aAAa,EAAE;EAC5B,MAAM,WAAW,MAA0B;GAGzC,IAAI,KAAK,MAAM,IAAI,GAAG;IACpB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;IACzC;GACF;GACA,IAAI,IAAI,IAAI;EACd;EAGA,MAAM,aAAa,MAA0B;GAC3C,IAAI,EAAE,WAAW,IAAI;GACrB,IAAI,KAAK,MAAM,MAAM,GAAG;GACxB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;EAC3C;EACA,GAAG,iBAAiB,eAAe,MAAM;EACzC,GAAG,iBAAiB,gBAAgB,OAAO;EAC3C,SAAS,iBAAiB,eAAe,SAAS;EAClD,aAAa;GACX,GAAG,oBAAoB,eAAe,MAAM;GAC5C,GAAG,oBAAoB,gBAAgB,OAAO;GAC9C,SAAS,oBAAoB,eAAe,SAAS;GACrD,KAAK,QAAQ;EACf;CAGF,GAAG;EAAC;EAAK;EAAW;EAAc;CAAQ,CAAC;AAC7C"}
1
+ {"version":3,"file":"PointerProviderIfRoot.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/PointerProviderIfRoot.tsx"],"sourcesContent":["/**\n * Conditional `<PointerContextProvider>` wrapper. Mounts a provider only\n * when no parent provider is in scope — otherwise renders children unwrapped\n * so SceneCanvas defers to the host's existing scope.\n *\n * Pairs with `usePointerPublisher`, which attaches native pointermove/leave\n * listeners to the canvas element and writes world-space coords into the\n * surrounding context's `pointerRef`.\n */\nimport { useEffect, type MutableRefObject, type ReactNode, type RefObject } from 'react';\nimport { heldPointers } from '@weasel-js/gestures';\nimport { PointerContextProvider, usePointerContext } from '@weasel-js/routing/react';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { useOptionalViewRegistry } from '../viewRegistry';\nimport { worldPointAt } from './worldPointAt';\n\n/** Mount a `<PointerContextProvider>` only when none is already in scope. */\nexport function PointerProviderIfRoot({ children }: { children: ReactNode }) {\n const parent = usePointerContext();\n if (parent) return <>{children}</>;\n return <PointerContextProvider>{children}</PointerContextProvider>;\n}\n\n/**\n * Attaches native `pointermove` / `pointerleave` listeners to the supplied\n * canvas element and publishes the world-space pointer coordinates into the\n * surrounding `<PointerContextProvider>`. No-op when no provider is in scope\n * (matches \"publish if anyone is listening\").\n *\n * Called inside the provider scope so it sees both consumer-mounted providers\n * and SceneCanvas's auto-mounted one.\n */\nexport function usePointerPublisher(\n canvasRef: MutableRefObject<HTMLElement | null>,\n canvasApiRef: RefObject<CanvasExtensionApi | null>,\n): void {\n const ctx = usePointerContext();\n const registry = useOptionalViewRegistry();\n useEffect(() => {\n if (!ctx) return;\n const el = canvasRef.current;\n if (!el) return;\n // The surface's one resolver answers which camera a client point belongs\n // to, so paste-at-pointer lands in the panel the cursor is over. With no\n // views declared it answers the canvas's own camera and rect.\n const publish = (pointerId: number | null, clientX: number, clientY: number): void => {\n const api = canvasApiRef.current;\n if (!api) return;\n const target = registry?.resolver.at(pointerId, clientX, clientY);\n const [worldX, worldY] = worldPointAt(api, target, clientX, clientY);\n ctx.set({ world: { x: worldX, y: worldY }, viewId: target?.id ?? null });\n };\n const onMove = (e: PointerEvent): void => publish(e.pointerId, e.clientX, e.clientY);\n const held = heldPointers(el);\n const onLeave = (e: PointerEvent): void => {\n // A pointer held on the canvas is still working it once it leaves the\n // rect, and what it drives needs the latest world position.\n if (held.count() > 0) {\n publish(e.pointerId, e.clientX, e.clientY);\n return;\n }\n ctx.set(null);\n };\n // A drag that began on the canvas keeps reporting once it is off it; the\n // canvas's own listener has the moves that still target it.\n const onDocMove = (e: PointerEvent): void => {\n if (e.target === el) return;\n if (held.count() === 0) return;\n publish(e.pointerId, e.clientX, e.clientY);\n };\n el.addEventListener('pointermove', onMove);\n el.addEventListener('pointerleave', onLeave);\n document.addEventListener('pointermove', onDocMove);\n return () => {\n el.removeEventListener('pointermove', onMove);\n el.removeEventListener('pointerleave', onLeave);\n document.removeEventListener('pointermove', onDocMove);\n held.release();\n };\n // canvasRef + registry + ctx identity are all stable across the lifetime\n // of the surrounding provider; effect runs once per mount.\n }, [ctx, canvasRef, canvasApiRef, registry]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,EAAE,YAAqC;CAE3E,IADe,kBACX,GAAQ,OAAO,oBAAAA,UAAA,EAAG,SAAW,CAAA;CACjC,OAAO,oBAAC,wBAAD,EAAyB,SAAiC,CAAA;AACnE;;;;;;;;;;AAWA,SAAgB,oBACd,WACA,cACM;CACN,MAAM,MAAM,kBAAkB;CAC9B,MAAM,WAAW,wBAAwB;CACzC,gBAAgB;EACd,IAAI,CAAC,KAAK;EACV,MAAM,KAAK,UAAU;EACrB,IAAI,CAAC,IAAI;EAIT,MAAM,WAAW,WAA0B,SAAiB,YAA0B;GACpF,MAAM,MAAM,aAAa;GACzB,IAAI,CAAC,KAAK;GACV,MAAM,SAAS,UAAU,SAAS,GAAG,WAAW,SAAS,OAAO;GAChE,MAAM,CAAC,QAAQ,UAAU,aAAa,KAAK,QAAQ,SAAS,OAAO;GACnE,IAAI,IAAI;IAAE,OAAO;KAAE,GAAG;KAAQ,GAAG;IAAO;IAAG,QAAQ,QAAQ,MAAM;GAAK,CAAC;EACzE;EACA,MAAM,UAAU,MAA0B,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;EACnF,MAAM,OAAO,aAAa,EAAE;EAC5B,MAAM,WAAW,MAA0B;GAGzC,IAAI,KAAK,MAAM,IAAI,GAAG;IACpB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;IACzC;GACF;GACA,IAAI,IAAI,IAAI;EACd;EAGA,MAAM,aAAa,MAA0B;GAC3C,IAAI,EAAE,WAAW,IAAI;GACrB,IAAI,KAAK,MAAM,MAAM,GAAG;GACxB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO;EAC3C;EACA,GAAG,iBAAiB,eAAe,MAAM;EACzC,GAAG,iBAAiB,gBAAgB,OAAO;EAC3C,SAAS,iBAAiB,eAAe,SAAS;EAClD,aAAa;GACX,GAAG,oBAAoB,eAAe,MAAM;GAC5C,GAAG,oBAAoB,gBAAgB,OAAO;GAC9C,SAAS,oBAAoB,eAAe,SAAS;GACrD,KAAK,QAAQ;EACf;CAGF,GAAG;EAAC;EAAK;EAAW;EAAc;CAAQ,CAAC;AAC7C"}
@@ -1,7 +1,7 @@
1
1
  import { useDeviceProfile } from "../../core/device/useDeviceProfile.js";
2
2
  import { dlog } from "../../debug/flag.js";
3
3
  import { usePointerPublisher } from "./PointerProviderIfRoot.js";
4
- import { SnapSourceRegistryContext } from "../../features/snap/registry.js";
4
+ import { SnapSourceRegistryContext } from "../../domains/snap/registry.js";
5
5
  import { useTestHook } from "../../test-hook/useTestHook.js";
6
6
  import { useHitObserver } from "../useHitObserver.js";
7
7
  import { GeometryProjectionRegistrar, ResizePolicyRegistrar } from "./poseRegistrars.js";
@@ -53,6 +53,7 @@ function SceneCanvasInput(p) {
53
53
  canvasRef: canvas.elementRef,
54
54
  canvasApiRef: canvas.apiRef,
55
55
  ingestionClipboard: p.ingestionClipboard,
56
+ ingestionHandlers: p.ingestionHandlers,
56
57
  snap: {
57
58
  sources: [...props.snap?.sources ?? [], ...p.snapSources],
58
59
  registry: snapRegistry,
@@ -106,6 +107,7 @@ function SceneCanvasInput(p) {
106
107
  useToolKeybindings({
107
108
  internalTools: p.tools.internal,
108
109
  toolsTakeover: p.tools.takeover ?? void 0,
110
+ surface: p.tools.surface,
109
111
  enableKeybindings,
110
112
  modes: props.modes,
111
113
  canvasApi: canvas.ready ? canvas.apiRef.current : null,
@@ -1 +1 @@
1
- {"version":3,"file":"SceneCanvasInput.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/SceneCanvasInput.tsx"],"sourcesContent":["import type { ResizeHandleLayout } from 'interactions/actions/resize/cornerHandles';\nimport { useLatest } from '@weasel-js/react';\nimport type { Dispatcher } from '@weasel-js/routing';\nimport type { Scene } from 'core/scene/types';\nimport type { SelectionApi } from 'core/selection/useSelection';\nimport type { RuleCtx } from 'features/chrome-caps';\nimport type { Affordance } from 'affordances/types';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport { useContext, useEffect, type MutableRefObject, type RefObject } from 'react';\nimport { SnapSourceRegistryContext } from 'features/snap/registry';\nimport type { SnapOutcomeStore } from 'features/snap/outcomeStore';\nimport type { SnapSource } from 'features/snap/types';\nimport { dlog } from '../../debug/flag';\nimport { useDeviceProfile } from '../../core/device/useDeviceProfile';\nimport { useTestHook } from '../../test-hook/useTestHook';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { useHitObserver } from '../useHitObserver';\nimport type { CanvasViewState } from '../useCanvasView';\nimport { GeometryProjectionRegistrar, ResizePolicyRegistrar } from './poseRegistrars';\nimport { usePointerPublisher } from './PointerProviderIfRoot';\nimport type { BridgeAdapter, SceneCanvasProps } from './props';\nimport type { NodeAtPoint } from './useNodeAtPoint';\nimport type { useSceneCanvasTools } from './useSceneCanvasTools';\nimport { useSceneGestureDispatcher } from './useSceneGestureDispatcher';\nimport { useCanvasDevtoolsRoot, type CanvasDevtools } from './useCanvasDevtoolsRoot';\nimport type { useScenePicking } from './useScenePicking';\nimport {\n useSceneStandardActions, type SceneStandardActionsInputs, type StandardActionsProps,\n} from './useSceneStandardActions';\nimport { useToolKeybindings } from './useToolKeybindings';\n\ntype Props = SceneCanvasProps<unknown, string, unknown>;\ntype Picking = ReturnType<typeof useScenePicking<unknown, string, unknown>>;\n\n/** The `<SceneCanvas>` props its input wiring reads. */\nexport type SceneCanvasInputOptions = StandardActionsProps & Pick<\n Props,\n | 'selectTool' | 'geometryProjection' | 'enableGestureDispatcher' | 'enableKeybindings'\n | 'claimKeys' | 'longPress' | 'modes' | 'versionCheck' | 'onClick' | 'onDoubleClick' | 'routing'\n>;\n\n/** What `<SceneCanvas>` hands {@link SceneCanvasInput}. */\nexport interface SceneCanvasInputProps {\n props: SceneCanvasInputOptions;\n scene: Scene<unknown, string, unknown>;\n selection: SelectionApi;\n descriptor: PoseDescriptor<unknown>;\n picking: Pick<\n Picking, 'pickEvery' | 'pickBest' | 'boundsOf' | 'planeOfNode' | 'kindOfNode' | 'doubleClickNames' | 'viewLayerGate' | 'alphaOf' | 'enteredGroup' | 'reachable'\n > & { adapter: BridgeAdapter };\n /** The node a hit resolves to, for the `onClick` / `onDoubleClick` observers. */\n nodeAtPointRef: MutableRefObject<NodeAtPoint | undefined>;\n tools: ReturnType<typeof useSceneCanvasTools>;\n viewOn: boolean;\n camera: { viewState: CanvasViewState; viewAnimation: SceneStandardActionsInputs['viewAnimation'] };\n dispatcher: Dispatcher;\n pathEdit: {\n state: SceneStandardActionsInputs['editAnchorsExternalState'];\n };\n chrome: { getIsVisible: () => (id: string) => boolean; getRuleCtx: () => RuleCtx | undefined };\n /** The selection overlay's rotate badge, and where the dispatcher reports the affordances\n * it hit-tests, for the slops overlay. */\n overlay: {\n rotationBadge: { distancePx: number; sizePx: number } | null | undefined;\n /** The resize-handle layout the overlay paints, so the hit-test grabs exactly those. */\n resizeHandles: ResizeHandleLayout;\n chromeAffordancesRef: MutableRefObject<readonly Affordance[]>;\n };\n canvas: {\n elementRef: MutableRefObject<HTMLElement | null>;\n apiRef: RefObject<CanvasExtensionApi | null>;\n ready: boolean;\n };\n ingestionClipboard: SceneStandardActionsInputs['ingestionClipboard'];\n /** The enabled presets' snap sources. */\n snapSources: readonly SnapSource[];\n /** The outcome store the canvas's readout layer draws. */\n snapStore: SnapOutcomeStore;\n devtools: CanvasDevtools;\n}\n\n/**\n * The canvas's input wiring: the pointer publisher, the standard actions and their deps, the\n * gesture dispatcher, and the tool keybindings, in that order, then the test hook.\n *\n * A component of its own, mounted ahead of `<SceneCanvas>`'s children, rather than hooks in the\n * canvas's body: dep sources and actions stack newest-live in effect order, and a parent's\n * effects run after its children's, so a child overriding a kit dep would lose to it.\n */\nexport function SceneCanvasInput(p: SceneCanvasInputProps) {\n const { props, scene, selection, picking, chrome, overlay, canvas } = p;\n const { viewState } = p.camera;\n const { selectTool, enableKeybindings = true } = props;\n const snapRegistry = useContext(SnapSourceRegistryContext);\n useEffect(() => {\n dlog('scene-canvas', 'mount');\n return () => dlog('scene-canvas', 'unmount');\n }, []);\n usePointerPublisher(canvas.elementRef, canvas.apiRef);\n useSceneStandardActions({\n props, viewOn: p.viewOn,\n selection, enteredGroup: picking.enteredGroup, scene, adapter: picking.adapter, standardActions: p.tools.standardActions,\n currentViewRef: viewState.viewRef, onViewChange: viewState.setViewFromInput,\n poseDescriptor: p.descriptor, dispatcher: p.dispatcher,\n pickEvery: picking.pickEvery, layerIsPainted: picking.viewLayerGate, alphaOf: picking.alphaOf, reachable: picking.reachable,\n viewAnimation: p.camera.viewAnimation, editAnchorsExternalState: p.pathEdit.state,\n canvasRef: canvas.elementRef, canvasApiRef: canvas.apiRef, ingestionClipboard: p.ingestionClipboard,\n snap: { sources: [...(props.snap?.sources ?? []), ...p.snapSources], registry: snapRegistry, store: p.snapStore },\n });\n\n // Rides the gesture dispatcher as an OBSERVER rather than an Action binding because the\n // prop is a notification, not a behavior: as a binding it would lose first-match-wins to\n // `enterPathEdit` on every body hit and silently stop firing.\n const onDoubleClick = useHitObserver(props.onDoubleClick, p.nodeAtPointRef);\n const onClick = useHitObserver(props.onClick, p.nodeAtPointRef);\n const selectionRef = useLatest(selection);\n const { targetScale } = useDeviceProfile();\n const { root, traces } = useCanvasDevtoolsRoot({\n scene, selection, viewState, tools: p.tools.tools, contributions: p.tools.contributions, routing: props.routing,\n element: canvas.elementRef, api: canvas.apiRef, devtools: p.devtools,\n });\n useSceneGestureDispatcher({\n canvasRef: canvas.elementRef, canvasApiRef: canvas.apiRef,\n tools: p.tools.tools, contributions: p.tools.contributions,\n enabled: props.enableGestureDispatcher ?? true, keyboard: enableKeybindings,\n claimKeys: props.claimKeys ?? false,\n selectionRef,\n boundsOf: picking.boundsOf, planeOfNode: picking.planeOfNode,\n pickEvery: picking.pickEvery, pickBest: picking.pickBest, kindOfNode: picking.kindOfNode,\n doubleClickNames: picking.doubleClickNames,\n viewRef: viewState.viewRef, dispatcher: p.dispatcher, traces,\n getIsVisibleForCanvas: chrome.getIsVisible, getRuleCtx: chrome.getRuleCtx,\n targetScale, handleHitRadius: overlay.resizeHandles.hitRadiusPx,\n edgeHandles: overlay.resizeHandles.edges,\n rotationBadge: overlay.rotationBadge, chromeAffordancesRef: overlay.chromeAffordancesRef,\n onDoubleClick, onClick, longPress: props.longPress,\n });\n useToolKeybindings({\n internalTools: p.tools.internal,\n toolsTakeover: p.tools.takeover ?? undefined,\n enableKeybindings,\n modes: props.modes,\n canvasApi: canvas.ready ? canvas.apiRef.current : null,\n versionCheck: props.versionCheck,\n });\n useTestHook({\n getScene: () => scene as never,\n getSelectionIds: () => (selection.current as readonly string[] | undefined) ?? [],\n getView: () => viewState.viewRef.current,\n getActiveToolId: () => p.tools.tools.active ?? null,\n probes: root.probes,\n });\n\n // Mounted only when passed: an empty default registered with the deps above would land\n // after, and over, a dep one of these registered (child effects run first). Absent\n // `geometryProjection` leaves the dep undefined.\n return (\n <>\n {selectTool?.resize\n ? <ResizePolicyRegistrar options={selectTool.resize as UseResizeOptions<unknown>} />\n : null}\n {props.geometryProjection ? <GeometryProjectionRegistrar projection={props.geometryProjection} /> : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0FA,SAAgB,iBAAiB,GAA0B;CACzD,MAAM,EAAE,OAAO,OAAO,WAAW,SAAS,QAAQ,SAAS,WAAW;CACtE,MAAM,EAAE,cAAc,EAAE;CACxB,MAAM,EAAE,YAAY,oBAAoB,SAAS;CACjD,MAAM,eAAe,WAAW,yBAAyB;CACzD,gBAAgB;EACd,KAAK,gBAAgB,OAAO;EAC5B,aAAa,KAAK,gBAAgB,SAAS;CAC7C,GAAG,CAAC,CAAC;CACL,oBAAoB,OAAO,YAAY,OAAO,MAAM;CACpD,wBAAwB;EACtB;EAAO,QAAQ,EAAE;EACjB;EAAW,cAAc,QAAQ;EAAc;EAAO,SAAS,QAAQ;EAAS,iBAAiB,EAAE,MAAM;EACzG,gBAAgB,UAAU;EAAS,cAAc,UAAU;EAC3D,gBAAgB,EAAE;EAAY,YAAY,EAAE;EAC5C,WAAW,QAAQ;EAAW,gBAAgB,QAAQ;EAAe,SAAS,QAAQ;EAAS,WAAW,QAAQ;EAClH,eAAe,EAAE,OAAO;EAAe,0BAA0B,EAAE,SAAS;EAC5E,WAAW,OAAO;EAAY,cAAc,OAAO;EAAQ,oBAAoB,EAAE;EACjF,MAAM;GAAE,SAAS,CAAC,GAAI,MAAM,MAAM,WAAW,CAAC,GAAI,GAAG,EAAE,WAAW;GAAG,UAAU;GAAc,OAAO,EAAE;EAAU;CAClH,CAAC;CAKD,MAAM,gBAAgB,eAAe,MAAM,eAAe,EAAE,cAAc;CAC1E,MAAM,UAAU,eAAe,MAAM,SAAS,EAAE,cAAc;CAC9D,MAAM,eAAe,UAAU,SAAS;CACxC,MAAM,EAAE,gBAAgB,iBAAiB;CACzC,MAAM,EAAE,MAAM,WAAW,sBAAsB;EAC7C;EAAO;EAAW;EAAW,OAAO,EAAE,MAAM;EAAO,eAAe,EAAE,MAAM;EAAe,SAAS,MAAM;EACxG,SAAS,OAAO;EAAY,KAAK,OAAO;EAAQ,UAAU,EAAE;CAC9D,CAAC;CACD,0BAA0B;EACxB,WAAW,OAAO;EAAY,cAAc,OAAO;EACnD,OAAO,EAAE,MAAM;EAAO,eAAe,EAAE,MAAM;EAC7C,SAAS,MAAM,2BAA2B;EAAM,UAAU;EAC1D,WAAW,MAAM,aAAa;EAC9B;EACA,UAAU,QAAQ;EAAU,aAAa,QAAQ;EACjD,WAAW,QAAQ;EAAW,UAAU,QAAQ;EAAU,YAAY,QAAQ;EAC9E,kBAAkB,QAAQ;EAC1B,SAAS,UAAU;EAAS,YAAY,EAAE;EAAY;EACtD,uBAAuB,OAAO;EAAc,YAAY,OAAO;EAC/D;EAAa,iBAAiB,QAAQ,cAAc;EACpD,aAAa,QAAQ,cAAc;EACnC,eAAe,QAAQ;EAAe,sBAAsB,QAAQ;EACpE;EAAe;EAAS,WAAW,MAAM;CAC3C,CAAC;CACD,mBAAmB;EACjB,eAAe,EAAE,MAAM;EACvB,eAAe,EAAE,MAAM,YAAY;EACnC;EACA,OAAO,MAAM;EACb,WAAW,OAAO,QAAQ,OAAO,OAAO,UAAU;EAClD,cAAc,MAAM;CACtB,CAAC;CACD,YAAY;EACV,gBAAgB;EAChB,uBAAwB,UAAU,WAA6C,CAAC;EAChF,eAAe,UAAU,QAAQ;EACjC,uBAAuB,EAAE,MAAM,MAAM,UAAU;EAC/C,QAAQ,KAAK;CACf,CAAC;CAKD,OACE,qBAAAA,UAAA,EAAA,UAAA,CACG,YAAY,SACT,oBAAC,uBAAD,EAAuB,SAAS,WAAW,OAAsC,CAAA,IACjF,MACH,MAAM,qBAAqB,oBAAC,6BAAD,EAA6B,YAAY,MAAM,mBAAqB,CAAA,IAAI,IACpG,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"SceneCanvasInput.js","names":["_Fragment"],"sources":["../../../src/canvas/SceneCanvas/SceneCanvasInput.tsx"],"sourcesContent":["import type { ResizeHandleLayout } from 'interactions/actions/resize/cornerHandles';\nimport { useLatest } from '@weasel-js/react';\nimport type { Dispatcher } from '@weasel-js/routing';\nimport type { Scene } from 'core/scene/types';\nimport type { SelectionApi } from 'core/selection/useSelection';\nimport type { RuleCtx } from 'domains/chrome-caps';\nimport type { Affordance } from 'affordances/types';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport { useContext, useEffect, type MutableRefObject, type RefObject } from 'react';\nimport { SnapSourceRegistryContext } from 'domains/snap/registry';\nimport type { SnapOutcomeStore } from 'domains/snap/outcomeStore';\nimport type { SnapSource } from 'domains/snap/types';\nimport { dlog } from '../../debug/flag';\nimport { useDeviceProfile } from '../../core/device/useDeviceProfile';\nimport { useTestHook } from '../../test-hook/useTestHook';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { useHitObserver } from '../useHitObserver';\nimport type { CanvasViewState } from '../useCanvasView';\nimport { GeometryProjectionRegistrar, ResizePolicyRegistrar } from './poseRegistrars';\nimport { usePointerPublisher } from './PointerProviderIfRoot';\nimport type { BridgeAdapter, SceneCanvasProps } from './props';\nimport type { NodeAtPoint } from './useNodeAtPoint';\nimport type { useSceneCanvasTools } from './useSceneCanvasTools';\nimport { useSceneGestureDispatcher } from './useSceneGestureDispatcher';\nimport { useCanvasDevtoolsRoot, type CanvasDevtools } from './useCanvasDevtoolsRoot';\nimport type { useScenePicking } from './useScenePicking';\nimport {\n useSceneStandardActions, type SceneStandardActionsInputs, type StandardActionsProps,\n} from './useSceneStandardActions';\nimport { useToolKeybindings } from './useToolKeybindings';\n\ntype Props = SceneCanvasProps<unknown, string, unknown>;\ntype Picking = ReturnType<typeof useScenePicking<unknown, string, unknown>>;\n\n/** The `<SceneCanvas>` props its input wiring reads. */\nexport type SceneCanvasInputOptions = StandardActionsProps & Pick<\n Props,\n | 'selectTool' | 'geometryProjection' | 'enableGestureDispatcher' | 'enableKeybindings'\n | 'claimKeys' | 'longPress' | 'modes' | 'versionCheck' | 'onClick' | 'onDoubleClick' | 'routing'\n>;\n\n/** What `<SceneCanvas>` hands {@link SceneCanvasInput}. */\nexport interface SceneCanvasInputProps {\n props: SceneCanvasInputOptions;\n scene: Scene<unknown, string, unknown>;\n selection: SelectionApi;\n descriptor: PoseDescriptor<unknown>;\n picking: Pick<\n Picking, 'pickEvery' | 'pickBest' | 'boundsOf' | 'planeOfNode' | 'kindOfNode' | 'doubleClickNames' | 'viewLayerGate' | 'alphaOf' | 'enteredGroup' | 'reachable'\n > & { adapter: BridgeAdapter };\n /** The node a hit resolves to, for the `onClick` / `onDoubleClick` observers. */\n nodeAtPointRef: MutableRefObject<NodeAtPoint | undefined>;\n tools: ReturnType<typeof useSceneCanvasTools>;\n viewOn: boolean;\n camera: { viewState: CanvasViewState; viewAnimation: SceneStandardActionsInputs['viewAnimation'] };\n dispatcher: Dispatcher;\n pathEdit: {\n state: SceneStandardActionsInputs['editAnchorsExternalState'];\n };\n chrome: { getIsVisible: () => (id: string) => boolean; getRuleCtx: () => RuleCtx | undefined };\n /** The selection overlay's rotate badge, and where the dispatcher reports the affordances\n * it hit-tests, for the slops overlay. */\n overlay: {\n rotationBadge: { distancePx: number; sizePx: number } | null | undefined;\n /** The resize-handle layout the overlay paints, so the hit-test grabs exactly those. */\n resizeHandles: ResizeHandleLayout;\n chromeAffordancesRef: MutableRefObject<readonly Affordance[]>;\n };\n canvas: {\n elementRef: MutableRefObject<HTMLElement | null>;\n apiRef: RefObject<CanvasExtensionApi | null>;\n ready: boolean;\n };\n ingestionClipboard: SceneStandardActionsInputs['ingestionClipboard'];\n ingestionHandlers: SceneStandardActionsInputs['ingestionHandlers'];\n /** The enabled presets' snap sources. */\n snapSources: readonly SnapSource[];\n /** The outcome store the canvas's readout layer draws. */\n snapStore: SnapOutcomeStore;\n devtools: CanvasDevtools;\n}\n\n/**\n * The canvas's input wiring: the pointer publisher, the standard actions and their deps, the\n * gesture dispatcher, and the tool keybindings, in that order, then the test hook.\n *\n * A component of its own, mounted ahead of `<SceneCanvas>`'s children, rather than hooks in the\n * canvas's body: dep sources and actions stack newest-live in effect order, and a parent's\n * effects run after its children's, so a child overriding a kit dep would lose to it.\n */\nexport function SceneCanvasInput(p: SceneCanvasInputProps) {\n const { props, scene, selection, picking, chrome, overlay, canvas } = p;\n const { viewState } = p.camera;\n const { selectTool, enableKeybindings = true } = props;\n const snapRegistry = useContext(SnapSourceRegistryContext);\n useEffect(() => {\n dlog('scene-canvas', 'mount');\n return () => dlog('scene-canvas', 'unmount');\n }, []);\n usePointerPublisher(canvas.elementRef, canvas.apiRef);\n useSceneStandardActions({\n props, viewOn: p.viewOn,\n selection, enteredGroup: picking.enteredGroup, scene, adapter: picking.adapter, standardActions: p.tools.standardActions,\n currentViewRef: viewState.viewRef, onViewChange: viewState.setViewFromInput,\n poseDescriptor: p.descriptor, dispatcher: p.dispatcher,\n pickEvery: picking.pickEvery, layerIsPainted: picking.viewLayerGate, alphaOf: picking.alphaOf, reachable: picking.reachable,\n viewAnimation: p.camera.viewAnimation, editAnchorsExternalState: p.pathEdit.state,\n canvasRef: canvas.elementRef, canvasApiRef: canvas.apiRef, ingestionClipboard: p.ingestionClipboard,\n ingestionHandlers: p.ingestionHandlers,\n snap: { sources: [...(props.snap?.sources ?? []), ...p.snapSources], registry: snapRegistry, store: p.snapStore },\n });\n\n // Rides the gesture dispatcher as an OBSERVER rather than an Action binding because the\n // prop is a notification, not a behavior: as a binding it would lose first-match-wins to\n // `enterPathEdit` on every body hit and silently stop firing.\n const onDoubleClick = useHitObserver(props.onDoubleClick, p.nodeAtPointRef);\n const onClick = useHitObserver(props.onClick, p.nodeAtPointRef);\n const selectionRef = useLatest(selection);\n const { targetScale } = useDeviceProfile();\n const { root, traces } = useCanvasDevtoolsRoot({\n scene, selection, viewState, tools: p.tools.tools, contributions: p.tools.contributions, routing: props.routing,\n element: canvas.elementRef, api: canvas.apiRef, devtools: p.devtools,\n });\n useSceneGestureDispatcher({\n canvasRef: canvas.elementRef, canvasApiRef: canvas.apiRef,\n tools: p.tools.tools, contributions: p.tools.contributions,\n enabled: props.enableGestureDispatcher ?? true, keyboard: enableKeybindings,\n claimKeys: props.claimKeys ?? false,\n selectionRef,\n boundsOf: picking.boundsOf, planeOfNode: picking.planeOfNode,\n pickEvery: picking.pickEvery, pickBest: picking.pickBest, kindOfNode: picking.kindOfNode,\n doubleClickNames: picking.doubleClickNames,\n viewRef: viewState.viewRef, dispatcher: p.dispatcher, traces,\n getIsVisibleForCanvas: chrome.getIsVisible, getRuleCtx: chrome.getRuleCtx,\n targetScale, handleHitRadius: overlay.resizeHandles.hitRadiusPx,\n edgeHandles: overlay.resizeHandles.edges,\n rotationBadge: overlay.rotationBadge, chromeAffordancesRef: overlay.chromeAffordancesRef,\n onDoubleClick, onClick, longPress: props.longPress,\n });\n useToolKeybindings({\n internalTools: p.tools.internal,\n toolsTakeover: p.tools.takeover ?? undefined,\n surface: p.tools.surface,\n enableKeybindings,\n modes: props.modes,\n canvasApi: canvas.ready ? canvas.apiRef.current : null,\n versionCheck: props.versionCheck,\n });\n useTestHook({\n getScene: () => scene as never,\n getSelectionIds: () => (selection.current as readonly string[] | undefined) ?? [],\n getView: () => viewState.viewRef.current,\n getActiveToolId: () => p.tools.tools.active ?? null,\n probes: root.probes,\n });\n\n // Mounted only when passed: an empty default registered with the deps above would land\n // after, and over, a dep one of these registered (child effects run first). Absent\n // `geometryProjection` leaves the dep undefined.\n return (\n <>\n {selectTool?.resize\n ? <ResizePolicyRegistrar options={selectTool.resize as UseResizeOptions<unknown>} />\n : null}\n {props.geometryProjection ? <GeometryProjectionRegistrar projection={props.geometryProjection} /> : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,iBAAiB,GAA0B;CACzD,MAAM,EAAE,OAAO,OAAO,WAAW,SAAS,QAAQ,SAAS,WAAW;CACtE,MAAM,EAAE,cAAc,EAAE;CACxB,MAAM,EAAE,YAAY,oBAAoB,SAAS;CACjD,MAAM,eAAe,WAAW,yBAAyB;CACzD,gBAAgB;EACd,KAAK,gBAAgB,OAAO;EAC5B,aAAa,KAAK,gBAAgB,SAAS;CAC7C,GAAG,CAAC,CAAC;CACL,oBAAoB,OAAO,YAAY,OAAO,MAAM;CACpD,wBAAwB;EACtB;EAAO,QAAQ,EAAE;EACjB;EAAW,cAAc,QAAQ;EAAc;EAAO,SAAS,QAAQ;EAAS,iBAAiB,EAAE,MAAM;EACzG,gBAAgB,UAAU;EAAS,cAAc,UAAU;EAC3D,gBAAgB,EAAE;EAAY,YAAY,EAAE;EAC5C,WAAW,QAAQ;EAAW,gBAAgB,QAAQ;EAAe,SAAS,QAAQ;EAAS,WAAW,QAAQ;EAClH,eAAe,EAAE,OAAO;EAAe,0BAA0B,EAAE,SAAS;EAC5E,WAAW,OAAO;EAAY,cAAc,OAAO;EAAQ,oBAAoB,EAAE;EACjF,mBAAmB,EAAE;EACrB,MAAM;GAAE,SAAS,CAAC,GAAI,MAAM,MAAM,WAAW,CAAC,GAAI,GAAG,EAAE,WAAW;GAAG,UAAU;GAAc,OAAO,EAAE;EAAU;CAClH,CAAC;CAKD,MAAM,gBAAgB,eAAe,MAAM,eAAe,EAAE,cAAc;CAC1E,MAAM,UAAU,eAAe,MAAM,SAAS,EAAE,cAAc;CAC9D,MAAM,eAAe,UAAU,SAAS;CACxC,MAAM,EAAE,gBAAgB,iBAAiB;CACzC,MAAM,EAAE,MAAM,WAAW,sBAAsB;EAC7C;EAAO;EAAW;EAAW,OAAO,EAAE,MAAM;EAAO,eAAe,EAAE,MAAM;EAAe,SAAS,MAAM;EACxG,SAAS,OAAO;EAAY,KAAK,OAAO;EAAQ,UAAU,EAAE;CAC9D,CAAC;CACD,0BAA0B;EACxB,WAAW,OAAO;EAAY,cAAc,OAAO;EACnD,OAAO,EAAE,MAAM;EAAO,eAAe,EAAE,MAAM;EAC7C,SAAS,MAAM,2BAA2B;EAAM,UAAU;EAC1D,WAAW,MAAM,aAAa;EAC9B;EACA,UAAU,QAAQ;EAAU,aAAa,QAAQ;EACjD,WAAW,QAAQ;EAAW,UAAU,QAAQ;EAAU,YAAY,QAAQ;EAC9E,kBAAkB,QAAQ;EAC1B,SAAS,UAAU;EAAS,YAAY,EAAE;EAAY;EACtD,uBAAuB,OAAO;EAAc,YAAY,OAAO;EAC/D;EAAa,iBAAiB,QAAQ,cAAc;EACpD,aAAa,QAAQ,cAAc;EACnC,eAAe,QAAQ;EAAe,sBAAsB,QAAQ;EACpE;EAAe;EAAS,WAAW,MAAM;CAC3C,CAAC;CACD,mBAAmB;EACjB,eAAe,EAAE,MAAM;EACvB,eAAe,EAAE,MAAM,YAAY;EACnC,SAAS,EAAE,MAAM;EACjB;EACA,OAAO,MAAM;EACb,WAAW,OAAO,QAAQ,OAAO,OAAO,UAAU;EAClD,cAAc,MAAM;CACtB,CAAC;CACD,YAAY;EACV,gBAAgB;EAChB,uBAAwB,UAAU,WAA6C,CAAC;EAChF,eAAe,UAAU,QAAQ;EACjC,uBAAuB,EAAE,MAAM,MAAM,UAAU;EAC/C,QAAQ,KAAK;CACf,CAAC;CAKD,OACE,qBAAAA,UAAA,EAAA,UAAA,CACG,YAAY,SACT,oBAAC,uBAAD,EAAuB,SAAS,WAAW,OAAsC,CAAA,IACjF,MACH,MAAM,qBAAqB,oBAAC,6BAAD,EAA6B,YAAY,MAAM,mBAAqB,CAAA,IAAI,IACpG,EAAA,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"brushOverlay.js","names":[],"sources":["../../../src/canvas/SceneCanvas/brushOverlay.ts"],"sourcesContent":["import type { PathDrawCommand } from '@weasel-js/renderer';\nimport { circlePath, polylineFromPoints } from '@weasel-js/geom';\n\ntype Point = { x: number; y: number };\n\n/** The colors a brush overlay paints with: `fill` for the area swept, `stroke`\n * for the footprint's rim. */\nexport interface BrushOverlayStyle {\n fill: string;\n stroke: string;\n lineWidth: number;\n}\n\n/**\n * A `brush` overlay as screen-space commands: the area swept so far, and the\n * brush's rim where it is now. `points` are already on screen.\n */\nexport function brushOverlayCommands(\n points: readonly Point[],\n radiusPx: number,\n style: BrushOverlayStyle,\n): PathDrawCommand[] {\n const head = points[points.length - 1];\n if (!head) return [];\n const swept: PathDrawCommand = points.length === 1\n ? { kind: 'path', path: circlePath(head.x, head.y, radiusPx), fill: { paint: { color: style.fill } } }\n : {\n kind: 'path',\n path: polylineFromPoints(points),\n stroke: { paint: { color: style.fill }, width: radiusPx * 2, cap: 'round', join: 'round' },\n };\n return [\n swept,\n {\n kind: 'path',\n path: circlePath(head.x, head.y, radiusPx),\n stroke: { paint: { color: style.stroke }, width: style.lineWidth },\n },\n ];\n}\n"],"mappings":";;;;;;;AAiBA,SAAgB,qBACd,QACA,UACA,OACmB;CACnB,MAAM,OAAO,OAAO,OAAO,SAAS;CACpC,IAAI,CAAC,MAAM,OAAO,CAAC;CAQnB,OAAO,CAPwB,OAAO,WAAW,IAC7C;EAAE,MAAM;EAAQ,MAAM,WAAW,KAAK,GAAG,KAAK,GAAG,QAAQ;EAAG,MAAM,EAAE,OAAO,EAAE,OAAO,MAAM,KAAK,EAAE;CAAE,IACnG;EACE,MAAM;EACN,MAAM,mBAAmB,MAAM;EAC/B,QAAQ;GAAE,OAAO,EAAE,OAAO,MAAM,KAAK;GAAG,OAAO,WAAW;GAAG,KAAK;GAAS,MAAM;EAAQ;CAC3F,GAGF;EACE,MAAM;EACN,MAAM,WAAW,KAAK,GAAG,KAAK,GAAG,QAAQ;EACzC,QAAQ;GAAE,OAAO,EAAE,OAAO,MAAM,OAAO;GAAG,OAAO,MAAM;EAAU;CACnE,CACF;AACF"}
1
+ {"version":3,"file":"brushOverlay.js","names":[],"sources":["../../../src/canvas/SceneCanvas/brushOverlay.ts"],"sourcesContent":["import type { PathDrawCommand } from '@weasel-js/renderer';\nimport { circlePath, polylineFromPoints, type Point } from '@weasel-js/geom';\n\n/** The colors a brush overlay paints with: `fill` for the area swept, `stroke`\n * for the footprint's rim. */\nexport interface BrushOverlayStyle {\n fill: string;\n stroke: string;\n lineWidth: number;\n}\n\n/**\n * A `brush` overlay as screen-space commands: the area swept so far, and the\n * brush's rim where it is now. `points` are already on screen.\n */\nexport function brushOverlayCommands(\n points: readonly Point[],\n radiusPx: number,\n style: BrushOverlayStyle,\n): PathDrawCommand[] {\n const head = points[points.length - 1];\n if (!head) return [];\n const swept: PathDrawCommand = points.length === 1\n ? { kind: 'path', path: circlePath(head.x, head.y, radiusPx), fill: { paint: { color: style.fill } } }\n : {\n kind: 'path',\n path: polylineFromPoints(points),\n stroke: { paint: { color: style.fill }, width: radiusPx * 2, cap: 'round', join: 'round' },\n };\n return [\n swept,\n {\n kind: 'path',\n path: circlePath(head.x, head.y, radiusPx),\n stroke: { paint: { color: style.stroke }, width: style.lineWidth },\n },\n ];\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,qBACd,QACA,UACA,OACmB;CACnB,MAAM,OAAO,OAAO,OAAO,SAAS;CACpC,IAAI,CAAC,MAAM,OAAO,CAAC;CAQnB,OAAO,CAPwB,OAAO,WAAW,IAC7C;EAAE,MAAM;EAAQ,MAAM,WAAW,KAAK,GAAG,KAAK,GAAG,QAAQ;EAAG,MAAM,EAAE,OAAO,EAAE,OAAO,MAAM,KAAK,EAAE;CAAE,IACnG;EACE,MAAM;EACN,MAAM,mBAAmB,MAAM;EAC/B,QAAQ;GAAE,OAAO,EAAE,OAAO,MAAM,KAAK;GAAG,OAAO,WAAW;GAAG,KAAK;GAAS,MAAM;EAAQ;CAC3F,GAGF;EACE,MAAM;EACN,MAAM,WAAW,KAAK,GAAG,KAAK,GAAG,QAAQ;EACzC,QAAQ;GAAE,OAAO,EAAE,OAAO,MAAM,OAAO;GAAG,OAAO,MAAM;EAAU;CACnE,CACF;AACF"}
@@ -14,17 +14,25 @@ var DRAW_TOOLS = toolSet("draw", kitShapeKindsOf("draw"));
14
14
  var TYPE_TOOLS = toolSet("type", kitShapeKindsOf("type"));
15
15
  /** The tools that cut the page itself. */
16
16
  var PAGE_TOOLS = toolSet("page", ["slice"]);
17
- /** Every built-in tool, in palette order: the navigation tools, the shape-kind
18
- * table's tools in its order, then the knife. */
19
- var BUILTIN_TOOLS = toolSet("builtin", [
20
- "select",
21
- "hand",
22
- ...KIT_SHAPE_KINDS,
17
+ /** The built-in tool sets in palette order: selection, then navigation, then the tools that make
18
+ * things. Each set is named for the presentation group its tools sit in. */
19
+ var BUILTIN_TOOL_GROUPS = [
20
+ SELECT_TOOLS,
21
+ VIEW_TOOLS,
22
+ SHAPE_TOOLS,
23
+ DRAW_TOOLS,
24
+ TYPE_TOOLS,
23
25
  PAGE_TOOLS
24
- ]);
25
- /** Every built-in tool id, in palette order: {@link BUILTIN_TOOLS} opened. */
26
+ ];
27
+ /** The natural order of palette groups, which `ToolPalette` follows unless given its own. */
28
+ var TOOL_GROUP_ORDER = BUILTIN_TOOL_GROUPS.map((set) => set.id);
29
+ /** Every built-in tool, in palette order: {@link BUILTIN_TOOL_GROUPS} one after another, then any
30
+ * shape kind in no family. */
31
+ var BUILTIN_TOOLS = toolSet("builtin", [...BUILTIN_TOOL_GROUPS, ...KIT_SHAPE_KINDS]);
32
+ /** Every built-in tool id, in palette order: {@link BUILTIN_TOOLS} opened. A palette orders the
33
+ * tools within each group by it. */
26
34
  var BUILTIN_TOOL_IDS = toolIdsOf([BUILTIN_TOOLS]);
27
35
 
28
36
  //#endregion
29
- export { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, DRAW_TOOLS, PAGE_TOOLS, SELECT_TOOLS, SHAPE_TOOLS, TYPE_TOOLS, VIEW_TOOLS };
37
+ export { BUILTIN_TOOLS, BUILTIN_TOOL_GROUPS, BUILTIN_TOOL_IDS, DRAW_TOOLS, PAGE_TOOLS, SELECT_TOOLS, SHAPE_TOOLS, TOOL_GROUP_ORDER, TYPE_TOOLS, VIEW_TOOLS };
30
38
  //# sourceMappingURL=builtinToolSets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"builtinToolSets.js","names":[],"sources":["../../../src/canvas/SceneCanvas/builtinToolSets.ts"],"sourcesContent":["import { KIT_SHAPE_KINDS, kitShapeKindsOf, type BuiltinShapeToolId } from 'core/shapeKinds';\nimport { toolIdsOf, toolSet, type ToolSet } from '@weasel-js/routing';\n\n/** Built-in tool ids SceneCanvas knows how to mount, through `defaultTools` or a preset. */\nexport type BuiltinToolId = 'select' | 'hand' | BuiltinShapeToolId | 'slice';\n\n/** The selection tools: click and marquee, and the lasso. */\nexport const SELECT_TOOLS: ToolSet<BuiltinToolId> = toolSet('select', ['select', ...kitShapeKindsOf('select')]);\n/** The view tools. */\nexport const VIEW_TOOLS: ToolSet<BuiltinToolId> = toolSet('view', ['hand']);\n/** The tools that drag out a closed or open primitive. */\nexport const SHAPE_TOOLS: ToolSet<BuiltinToolId> = toolSet('shape', kitShapeKindsOf('shape'));\n/** The freehand and bezier path tools. */\nexport const DRAW_TOOLS: ToolSet<BuiltinToolId> = toolSet('draw', kitShapeKindsOf('draw'));\n/** The text tools: text and the sticky note. */\nexport const TYPE_TOOLS: ToolSet<BuiltinToolId> = toolSet('type', kitShapeKindsOf('type'));\n/** The tools that cut the page itself. */\nexport const PAGE_TOOLS: ToolSet<BuiltinToolId> = toolSet('page', ['slice']);\n\n/** Every built-in tool, in palette order: the navigation tools, the shape-kind\n * table's tools in its order, then the knife. */\nexport const BUILTIN_TOOLS: ToolSet<BuiltinToolId> = toolSet('builtin', [\n 'select', 'hand', ...KIT_SHAPE_KINDS, PAGE_TOOLS,\n]);\n\n/** Every built-in tool id, in palette order: {@link BUILTIN_TOOLS} opened. */\nexport const BUILTIN_TOOL_IDS: readonly BuiltinToolId[] = toolIdsOf([BUILTIN_TOOLS]);\n"],"mappings":";;;;;AAOA,IAAa,eAAuC,QAAQ,UAAU,CAAC,UAAU,GAAG,gBAAgB,QAAQ,CAAC,CAAC;;AAE9G,IAAa,aAAqC,QAAQ,QAAQ,CAAC,MAAM,CAAC;;AAE1E,IAAa,cAAsC,QAAQ,SAAS,gBAAgB,OAAO,CAAC;;AAE5F,IAAa,aAAqC,QAAQ,QAAQ,gBAAgB,MAAM,CAAC;;AAEzF,IAAa,aAAqC,QAAQ,QAAQ,gBAAgB,MAAM,CAAC;;AAEzF,IAAa,aAAqC,QAAQ,QAAQ,CAAC,OAAO,CAAC;;;AAI3E,IAAa,gBAAwC,QAAQ,WAAW;CACtE;CAAU;CAAQ,GAAG;CAAiB;AACxC,CAAC;;AAGD,IAAa,mBAA6C,UAAU,CAAC,aAAa,CAAC"}
1
+ {"version":3,"file":"builtinToolSets.js","names":[],"sources":["../../../src/canvas/SceneCanvas/builtinToolSets.ts"],"sourcesContent":["import { KIT_SHAPE_KINDS, kitShapeKindsOf, type BuiltinShapeToolId } from 'core/shapeKinds';\nimport { toolIdsOf, toolSet, type ToolSet } from '@weasel-js/routing';\n\n/** Built-in tool ids SceneCanvas knows how to mount, through `defaultTools` or a preset. */\nexport type BuiltinToolId = 'select' | 'hand' | BuiltinShapeToolId | 'slice';\n\n/** The selection tools: click and marquee, and the lasso. */\nexport const SELECT_TOOLS: ToolSet<BuiltinToolId> = toolSet('select', ['select', ...kitShapeKindsOf('select')]);\n/** The view tools. */\nexport const VIEW_TOOLS: ToolSet<BuiltinToolId> = toolSet('view', ['hand']);\n/** The tools that drag out a closed or open primitive. */\nexport const SHAPE_TOOLS: ToolSet<BuiltinToolId> = toolSet('shape', kitShapeKindsOf('shape'));\n/** The freehand and bezier path tools. */\nexport const DRAW_TOOLS: ToolSet<BuiltinToolId> = toolSet('draw', kitShapeKindsOf('draw'));\n/** The text tools: text and the sticky note. */\nexport const TYPE_TOOLS: ToolSet<BuiltinToolId> = toolSet('type', kitShapeKindsOf('type'));\n/** The tools that cut the page itself. */\nexport const PAGE_TOOLS: ToolSet<BuiltinToolId> = toolSet('page', ['slice']);\n\n/** The built-in tool sets in palette order: selection, then navigation, then the tools that make\n * things. Each set is named for the presentation group its tools sit in. */\nexport const BUILTIN_TOOL_GROUPS: readonly ToolSet<BuiltinToolId>[] = [\n SELECT_TOOLS, VIEW_TOOLS, SHAPE_TOOLS, DRAW_TOOLS, TYPE_TOOLS, PAGE_TOOLS,\n];\n\n/** The natural order of palette groups, which `ToolPalette` follows unless given its own. */\nexport const TOOL_GROUP_ORDER: readonly string[] = BUILTIN_TOOL_GROUPS.map((set) => set.id);\n\n/** Every built-in tool, in palette order: {@link BUILTIN_TOOL_GROUPS} one after another, then any\n * shape kind in no family. */\nexport const BUILTIN_TOOLS: ToolSet<BuiltinToolId> = toolSet('builtin', [...BUILTIN_TOOL_GROUPS, ...KIT_SHAPE_KINDS]);\n\n/** Every built-in tool id, in palette order: {@link BUILTIN_TOOLS} opened. A palette orders the\n * tools within each group by it. */\nexport const BUILTIN_TOOL_IDS: readonly BuiltinToolId[] = toolIdsOf([BUILTIN_TOOLS]);\n"],"mappings":";;;;;AAOA,IAAa,eAAuC,QAAQ,UAAU,CAAC,UAAU,GAAG,gBAAgB,QAAQ,CAAC,CAAC;;AAE9G,IAAa,aAAqC,QAAQ,QAAQ,CAAC,MAAM,CAAC;;AAE1E,IAAa,cAAsC,QAAQ,SAAS,gBAAgB,OAAO,CAAC;;AAE5F,IAAa,aAAqC,QAAQ,QAAQ,gBAAgB,MAAM,CAAC;;AAEzF,IAAa,aAAqC,QAAQ,QAAQ,gBAAgB,MAAM,CAAC;;AAEzF,IAAa,aAAqC,QAAQ,QAAQ,CAAC,OAAO,CAAC;;;AAI3E,IAAa,sBAAyD;CACpE;CAAc;CAAY;CAAa;CAAY;CAAY;AACjE;;AAGA,IAAa,mBAAsC,oBAAoB,KAAK,QAAQ,IAAI,EAAE;;;AAI1F,IAAa,gBAAwC,QAAQ,WAAW,CAAC,GAAG,qBAAqB,GAAG,eAAe,CAAC;;;AAIpH,IAAa,mBAA6C,UAAU,CAAC,aAAa,CAAC"}
@@ -59,7 +59,8 @@ var OWN_PROPS = [
59
59
  "defaultView",
60
60
  "viewBounds",
61
61
  "redrawOn",
62
- "snap"
62
+ "snap",
63
+ "textEditor"
63
64
  ];
64
65
  /** The props `<SceneCanvas>` passes through to its `<Canvas>`: all but its own. */
65
66
  function canvasPassThrough(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"canvasPassThrough.js","names":[],"sources":["../../../src/canvas/SceneCanvas/canvasPassThrough.ts"],"sourcesContent":["import type { SceneCanvasProps } from './props';\n\ntype Props = SceneCanvasProps<unknown, string, unknown>;\n\n/** Every prop `<SceneCanvas>` reads itself instead of handing to `<Canvas>`. */\nconst OWN_PROPS = [\n 'scene', 'geometry', 'poseDescriptor', 'selectTool', 'insertNodeFactories', 'insertPaint',\n 'ingestion', 'layoutDropTarget', 'reflowTransition', 'poseTransition', 'geometryProjection', 'routing',\n 'selection', 'selectionOptions', 'selectable', 'tools', 'features', 'enableKeybindings',\n 'claimKeys', 'enableGestureDispatcher', 'onToolsCreated', 'defaultTools', 'toolOptions',\n 'initialActiveTool', 'ambient', 'versionCheck', 'longPress', 'viewport', 'layers', 'actions',\n 'tune', 'bindingOverrides', 'describeKind', 'animator', 'views', 'children', 'debug', 'alphaFor', 'layerVisibility',\n 'layerOrder', 'isPointerInteractive', 'enteredGroup', 'onDoubleClick', 'onClick', 'onHover', 'chromeVisibility', 'modes',\n 'pathEdit', 'defaultPathEdit', 'getFocused', 'cursorCoordsHud', 'pickHud', 'modalityHud', 'view',\n 'onViewChange', 'defaultView', 'viewBounds', 'redrawOn', 'snap',\n] as const satisfies readonly (keyof Props)[];\n\n/** The props `<SceneCanvas>` passes through to its `<Canvas>`: all but its own. */\nexport function canvasPassThrough<P extends object>(props: P): Omit<P, (typeof OWN_PROPS)[number] | 'presetSource'> {\n const rest = { ...props } as Record<string, unknown>;\n for (const key of OWN_PROPS) delete rest[key];\n delete rest.presetSource;\n return rest as Omit<P, (typeof OWN_PROPS)[number] | 'presetSource'>;\n}\n"],"mappings":";;AAKA,IAAM,YAAY;CAChB;CAAS;CAAY;CAAkB;CAAc;CAAuB;CAC5E;CAAa;CAAoB;CAAoB;CAAkB;CAAsB;CAC7F;CAAa;CAAoB;CAAc;CAAS;CAAY;CACpE;CAAa;CAA2B;CAAkB;CAAgB;CAC1E;CAAqB;CAAW;CAAgB;CAAa;CAAY;CAAU;CACnF;CAAQ;CAAoB;CAAgB;CAAY;CAAS;CAAY;CAAS;CAAY;CAClG;CAAc;CAAwB;CAAgB;CAAiB;CAAW;CAAW;CAAoB;CACjH;CAAY;CAAmB;CAAc;CAAmB;CAAW;CAAe;CAC1F;CAAgB;CAAe;CAAc;CAAY;AAC3D;;AAGA,SAAgB,kBAAoC,OAAgE;CAClH,MAAM,OAAO,EAAE,GAAG,MAAM;CACxB,KAAK,MAAM,OAAO,WAAW,OAAO,KAAK;CACzC,OAAO,KAAK;CACZ,OAAO;AACT"}
1
+ {"version":3,"file":"canvasPassThrough.js","names":[],"sources":["../../../src/canvas/SceneCanvas/canvasPassThrough.ts"],"sourcesContent":["import type { SceneCanvasProps } from './props';\n\ntype Props = SceneCanvasProps<unknown, string, unknown>;\n\n/** Every prop `<SceneCanvas>` reads itself instead of handing to `<Canvas>`. */\nconst OWN_PROPS = [\n 'scene', 'geometry', 'poseDescriptor', 'selectTool', 'insertNodeFactories', 'insertPaint',\n 'ingestion', 'layoutDropTarget', 'reflowTransition', 'poseTransition', 'geometryProjection', 'routing',\n 'selection', 'selectionOptions', 'selectable', 'tools', 'features', 'enableKeybindings',\n 'claimKeys', 'enableGestureDispatcher', 'onToolsCreated', 'defaultTools', 'toolOptions',\n 'initialActiveTool', 'ambient', 'versionCheck', 'longPress', 'viewport', 'layers', 'actions',\n 'tune', 'bindingOverrides', 'describeKind', 'animator', 'views', 'children', 'debug', 'alphaFor', 'layerVisibility',\n 'layerOrder', 'isPointerInteractive', 'enteredGroup', 'onDoubleClick', 'onClick', 'onHover', 'chromeVisibility', 'modes',\n 'pathEdit', 'defaultPathEdit', 'getFocused', 'cursorCoordsHud', 'pickHud', 'modalityHud', 'view',\n 'onViewChange', 'defaultView', 'viewBounds', 'redrawOn', 'snap', 'textEditor',\n] as const satisfies readonly (keyof Props)[];\n\n/** The props `<SceneCanvas>` passes through to its `<Canvas>`: all but its own. */\nexport function canvasPassThrough<P extends object>(props: P): Omit<P, (typeof OWN_PROPS)[number] | 'presetSource'> {\n const rest = { ...props } as Record<string, unknown>;\n for (const key of OWN_PROPS) delete rest[key];\n delete rest.presetSource;\n return rest as Omit<P, (typeof OWN_PROPS)[number] | 'presetSource'>;\n}\n"],"mappings":";;AAKA,IAAM,YAAY;CAChB;CAAS;CAAY;CAAkB;CAAc;CAAuB;CAC5E;CAAa;CAAoB;CAAoB;CAAkB;CAAsB;CAC7F;CAAa;CAAoB;CAAc;CAAS;CAAY;CACpE;CAAa;CAA2B;CAAkB;CAAgB;CAC1E;CAAqB;CAAW;CAAgB;CAAa;CAAY;CAAU;CACnF;CAAQ;CAAoB;CAAgB;CAAY;CAAS;CAAY;CAAS;CAAY;CAClG;CAAc;CAAwB;CAAgB;CAAiB;CAAW;CAAW;CAAoB;CACjH;CAAY;CAAmB;CAAc;CAAmB;CAAW;CAAe;CAC1F;CAAgB;CAAe;CAAc;CAAY;CAAQ;AACnE;;AAGA,SAAgB,kBAAoC,OAAgE;CAClH,MAAM,OAAO,EAAE,GAAG,MAAM;CACxB,KAAK,MAAM,OAAO,WAAW,OAAO,KAAK;CACzC,OAAO,KAAK;CACZ,OAAO;AACT"}