@weasel-js/core 1.10.0 → 1.11.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 (1433) hide show
  1. package/CHANGELOG.md +755 -0
  2. package/README.md +45 -11
  3. package/dist/WeaselProvider.js +25 -9
  4. package/dist/WeaselProvider.js.map +1 -1
  5. package/dist/affordances/composeAffordanceLayer.js +217 -140
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -1
  7. package/dist/affordances/cornerResize.js +92 -50
  8. package/dist/affordances/cornerResize.js.map +1 -1
  9. package/dist/affordances/hitAffordanceRegions.js +152 -73
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  11. package/dist/affordances/pathAnchors.js +148 -51
  12. package/dist/affordances/pathAnchors.js.map +1 -1
  13. package/dist/affordances/rotateCursor.js +18 -0
  14. package/dist/affordances/rotateCursor.js.map +1 -0
  15. package/dist/affordances/rotationHandle.js +83 -63
  16. package/dist/affordances/rotationHandle.js.map +1 -1
  17. package/dist/animation/behaviors/coast.js +20 -14
  18. package/dist/animation/behaviors/coast.js.map +1 -1
  19. package/dist/animation/behaviors/coastByWrite.js +98 -70
  20. package/dist/animation/behaviors/coastByWrite.js.map +1 -1
  21. package/dist/animation/behaviors/coastOnTargets.js +115 -67
  22. package/dist/animation/behaviors/coastOnTargets.js.map +1 -1
  23. package/dist/animation/behaviors/momentum.js +88 -53
  24. package/dist/animation/behaviors/momentum.js.map +1 -1
  25. package/dist/animation/clipTargets.js +14 -7
  26. package/dist/animation/clipTargets.js.map +1 -1
  27. package/dist/animation/departures.js +116 -0
  28. package/dist/animation/departures.js.map +1 -0
  29. package/dist/animation/index.js +18 -15
  30. package/dist/animation/poseHelpers.js +147 -107
  31. package/dist/animation/poseHelpers.js.map +1 -1
  32. package/dist/animation/poseTarget.js +158 -85
  33. package/dist/animation/poseTarget.js.map +1 -1
  34. package/dist/animation/poseTransition.js +64 -0
  35. package/dist/animation/poseTransition.js.map +1 -0
  36. package/dist/animation/reflow.js +208 -120
  37. package/dist/animation/reflow.js.map +1 -1
  38. package/dist/animation/rewind.js +76 -45
  39. package/dist/animation/rewind.js.map +1 -1
  40. package/dist/animation/rig/bindRig.js +135 -82
  41. package/dist/animation/rig/bindRig.js.map +1 -1
  42. package/dist/animation/rig/rigNode.js +120 -69
  43. package/dist/animation/rig/rigNode.js.map +1 -1
  44. package/dist/animation/rig/rigSeat.js +70 -17
  45. package/dist/animation/rig/rigSeat.js.map +1 -1
  46. package/dist/animation/rig/skinBinding.js +59 -39
  47. package/dist/animation/rig/skinBinding.js.map +1 -1
  48. package/dist/animation/rig/useRig.js +44 -30
  49. package/dist/animation/rig/useRig.js.map +1 -1
  50. package/dist/animation/wrappers/animateLifecycle.js +51 -35
  51. package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
  52. package/dist/animation/wrappers/animateOnSetPose.js +55 -32
  53. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
  54. package/dist/animation/wrappers/instantPose.js +13 -8
  55. package/dist/animation/wrappers/instantPose.js.map +1 -1
  56. package/dist/animation/writtenPoseTarget.js +44 -22
  57. package/dist/animation/writtenPoseTarget.js.map +1 -1
  58. package/dist/{autoPoseDescriptor-DHg5KqaJ.d.ts → autoPoseDescriptor-CZ1eXbzY.d.ts} +1 -1
  59. package/dist/barrel/canvas.js +41 -31
  60. package/dist/barrel/chrome.js +19 -16
  61. package/dist/barrel/icons.js +6 -0
  62. package/dist/barrel/input.js +19 -18
  63. package/dist/barrel/interactions.js +40 -38
  64. package/dist/barrel/paint.js +12 -11
  65. package/dist/barrel/paths.js +39 -12
  66. package/dist/barrel/renderer.js +24 -14
  67. package/dist/barrel/routing.js +69 -57
  68. package/dist/barrel/scene.js +48 -37
  69. package/dist/barrel/text.js +10 -9
  70. package/dist/barrel/viewport.js +47 -42
  71. package/dist/canvas/Canvas.js +189 -317
  72. package/dist/canvas/Canvas.js.map +1 -1
  73. package/dist/canvas/CanvasView.js +273 -202
  74. package/dist/canvas/CanvasView.js.map +1 -1
  75. package/dist/canvas/CursorCoordsHud.js +103 -64
  76. package/dist/canvas/CursorCoordsHud.js.map +1 -1
  77. package/dist/canvas/DrawCanvas.js +68 -41
  78. package/dist/canvas/DrawCanvas.js.map +1 -1
  79. package/dist/canvas/LeanSceneCanvas.js +23 -0
  80. package/dist/canvas/LeanSceneCanvas.js.map +1 -0
  81. package/dist/canvas/ModalityHud.js +58 -43
  82. package/dist/canvas/ModalityHud.js.map +1 -1
  83. package/dist/canvas/NodeShape.js +137 -60
  84. package/dist/canvas/NodeShape.js.map +1 -1
  85. package/dist/canvas/PickHud.js +77 -59
  86. package/dist/canvas/PickHud.js.map +1 -1
  87. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +9 -6
  88. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -1
  89. package/dist/canvas/SceneCanvas/CanvasKitProviders.js +25 -0
  90. package/dist/canvas/SceneCanvas/CanvasKitProviders.js.map +1 -0
  91. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -6
  92. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -1
  93. package/dist/canvas/SceneCanvas/DevHuds.js +47 -32
  94. package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -1
  95. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +72 -36
  96. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  97. package/dist/canvas/SceneCanvas/SceneCanvasInput.js +110 -0
  98. package/dist/canvas/SceneCanvas/SceneCanvasInput.js.map +1 -0
  99. package/dist/canvas/SceneCanvas/brushOverlay.js +36 -0
  100. package/dist/canvas/SceneCanvas/brushOverlay.js.map +1 -0
  101. package/dist/canvas/SceneCanvas/canvasPassThrough.js +72 -0
  102. package/dist/canvas/SceneCanvas/canvasPassThrough.js.map +1 -0
  103. package/dist/canvas/SceneCanvas/contributionFrameHooks.js +54 -32
  104. package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -1
  105. package/dist/canvas/SceneCanvas/coordTrace.js +36 -29
  106. package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -1
  107. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +513 -316
  108. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  109. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +39 -13
  110. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
  111. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +83 -47
  112. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
  113. package/dist/canvas/SceneCanvas/features.js +83 -127
  114. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  115. package/dist/canvas/SceneCanvas/insertPreviewCommands.js +115 -0
  116. package/dist/canvas/SceneCanvas/insertPreviewCommands.js.map +1 -0
  117. package/dist/canvas/SceneCanvas/mergeLayers.js +43 -0
  118. package/dist/canvas/SceneCanvas/mergeLayers.js.map +1 -0
  119. package/dist/canvas/SceneCanvas/namedPresets.js +56 -0
  120. package/dist/canvas/SceneCanvas/namedPresets.js.map +1 -0
  121. package/dist/canvas/SceneCanvas/poseGeometry.js +66 -31
  122. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
  123. package/dist/canvas/SceneCanvas/poseRegistrars.js +18 -8
  124. package/dist/canvas/SceneCanvas/poseRegistrars.js.map +1 -1
  125. package/dist/canvas/SceneCanvas/presets/arrange.js +27 -0
  126. package/dist/canvas/SceneCanvas/presets/arrange.js.map +1 -0
  127. package/dist/canvas/SceneCanvas/presets/chrome.js +14 -0
  128. package/dist/canvas/SceneCanvas/presets/chrome.js.map +1 -0
  129. package/dist/canvas/SceneCanvas/presets/edit.js +59 -0
  130. package/dist/canvas/SceneCanvas/presets/edit.js.map +1 -0
  131. package/dist/canvas/SceneCanvas/presets/ingest.js +13 -0
  132. package/dist/canvas/SceneCanvas/presets/ingest.js.map +1 -0
  133. package/dist/canvas/SceneCanvas/presets/paths.js +67 -0
  134. package/dist/canvas/SceneCanvas/presets/paths.js.map +1 -0
  135. package/dist/canvas/SceneCanvas/presets/select.js +19 -0
  136. package/dist/canvas/SceneCanvas/presets/select.js.map +1 -0
  137. package/dist/canvas/SceneCanvas/presets/toolDriven.js +20 -0
  138. package/dist/canvas/SceneCanvas/presets/toolDriven.js.map +1 -0
  139. package/dist/canvas/SceneCanvas/presets/transform.js +41 -0
  140. package/dist/canvas/SceneCanvas/presets/transform.js.map +1 -0
  141. package/dist/canvas/SceneCanvas/presets/view.js +14 -0
  142. package/dist/canvas/SceneCanvas/presets/view.js.map +1 -0
  143. package/dist/canvas/SceneCanvas/props.js +19 -35
  144. package/dist/canvas/SceneCanvas/props.js.map +1 -1
  145. package/dist/canvas/SceneCanvas/scenePointQuery.js +58 -0
  146. package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -0
  147. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +59 -0
  148. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -0
  149. package/dist/canvas/SceneCanvas/toolRegistry.js +30 -15
  150. package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -1
  151. package/dist/canvas/SceneCanvas/useActionTunings.js +20 -0
  152. package/dist/canvas/SceneCanvas/useActionTunings.js.map +1 -0
  153. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +68 -35
  154. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
  155. package/dist/canvas/SceneCanvas/useBakedScene.js +17 -0
  156. package/dist/canvas/SceneCanvas/useBakedScene.js.map +1 -0
  157. package/dist/canvas/SceneCanvas/useBuiltinRigTools.js +65 -0
  158. package/dist/canvas/SceneCanvas/useBuiltinRigTools.js.map +1 -0
  159. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +47 -23
  160. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
  161. package/dist/canvas/SceneCanvas/useBuiltinTools.js +29 -14
  162. package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -1
  163. package/dist/canvas/SceneCanvas/useCanvasCamera.js +55 -32
  164. package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -1
  165. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +24 -14
  166. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -1
  167. package/dist/canvas/SceneCanvas/useCanvasSelection.js +30 -12
  168. package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -1
  169. package/dist/canvas/SceneCanvas/useCanvasTools.js +112 -53
  170. package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -1
  171. package/dist/canvas/SceneCanvas/useChromeAffordances.js +31 -0
  172. package/dist/canvas/SceneCanvas/useChromeAffordances.js.map +1 -0
  173. package/dist/canvas/SceneCanvas/useContributionRoles.js +107 -56
  174. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -1
  175. package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +64 -0
  176. package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js.map +1 -0
  177. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +105 -136
  178. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
  179. package/dist/canvas/SceneCanvas/useHeldModifiers.js +21 -14
  180. package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -1
  181. package/dist/canvas/SceneCanvas/useNodeAtPoint.js +21 -19
  182. package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -1
  183. package/dist/canvas/SceneCanvas/useNodeKinds.js +28 -19
  184. package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -1
  185. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +93 -53
  186. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
  187. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +62 -35
  188. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -1
  189. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +110 -50
  190. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -1
  191. package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +30 -0
  192. package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js.map +1 -0
  193. package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +40 -0
  194. package/dist/canvas/SceneCanvas/useSceneCanvasTools.js.map +1 -0
  195. package/dist/canvas/SceneCanvas/useSceneChrome.js +100 -44
  196. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -1
  197. package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +163 -0
  198. package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js.map +1 -0
  199. package/dist/canvas/SceneCanvas/useScenePicking.js +69 -0
  200. package/dist/canvas/SceneCanvas/useScenePicking.js.map +1 -0
  201. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +28 -17
  202. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -1
  203. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +158 -111
  204. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  205. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +38 -26
  206. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -1
  207. package/dist/canvas/SceneCanvas/useSceneStandardActions.js +108 -0
  208. package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -0
  209. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +40 -27
  210. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -1
  211. package/dist/canvas/SceneCanvas/useSurfaceRouting.js +29 -0
  212. package/dist/canvas/SceneCanvas/useSurfaceRouting.js.map +1 -0
  213. package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js +44 -0
  214. package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js.map +1 -0
  215. package/dist/canvas/SceneCanvas/useToolKeybindings.js +28 -0
  216. package/dist/canvas/SceneCanvas/useToolKeybindings.js.map +1 -0
  217. package/dist/canvas/SceneCanvas/useViewportActions.js +52 -28
  218. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
  219. package/dist/canvas/SceneCanvas/worldPointAt.js +10 -5
  220. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -1
  221. package/dist/canvas/SceneCanvas.js +274 -315
  222. package/dist/canvas/SceneCanvas.js.map +1 -1
  223. package/dist/canvas/SceneViewCanvas.js +68 -42
  224. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  225. package/dist/canvas/SurfaceCanvas.js +62 -0
  226. package/dist/canvas/SurfaceCanvas.js.map +1 -0
  227. package/dist/canvas/accentColor.js +8 -5
  228. package/dist/canvas/accentColor.js.map +1 -1
  229. package/dist/canvas/adapterDerivedPath.js +33 -18
  230. package/dist/canvas/adapterDerivedPath.js.map +1 -1
  231. package/dist/canvas/adapterPickSource.js +60 -0
  232. package/dist/canvas/adapterPickSource.js.map +1 -0
  233. package/dist/canvas/affordanceAt.js +106 -50
  234. package/dist/canvas/affordanceAt.js.map +1 -1
  235. package/dist/canvas/buildSceneLayer.js +111 -80
  236. package/dist/canvas/buildSceneLayer.js.map +1 -1
  237. package/dist/canvas/buildSceneTree.js +110 -46
  238. package/dist/canvas/buildSceneTree.js.map +1 -1
  239. package/dist/canvas/canvasRenderer.js +156 -71
  240. package/dist/canvas/canvasRenderer.js.map +1 -1
  241. package/dist/canvas/colorOverrides.js +18 -10
  242. package/dist/canvas/colorOverrides.js.map +1 -1
  243. package/dist/canvas/copiesAbove.js +37 -0
  244. package/dist/canvas/copiesAbove.js.map +1 -0
  245. package/dist/canvas/defaultDrawOne.js +56 -31
  246. package/dist/canvas/defaultDrawOne.js.map +1 -1
  247. package/dist/canvas/deps/areaSelect.js +30 -12
  248. package/dist/canvas/deps/areaSelect.js.map +1 -1
  249. package/dist/canvas/deps/booleans.js +104 -0
  250. package/dist/canvas/deps/booleans.js.map +1 -0
  251. package/dist/canvas/deps/changes.js +17 -9
  252. package/dist/canvas/deps/changes.js.map +1 -1
  253. package/dist/canvas/deps/debug.js +12 -5
  254. package/dist/canvas/deps/debug.js.map +1 -1
  255. package/dist/canvas/deps/dispatchSources.js +27 -0
  256. package/dist/canvas/deps/dispatchSources.js.map +1 -0
  257. package/dist/canvas/deps/dispatcher.js +18 -7
  258. package/dist/canvas/deps/dispatcher.js.map +1 -1
  259. package/dist/canvas/deps/editAnchors.js +253 -68
  260. package/dist/canvas/deps/editAnchors.js.map +1 -1
  261. package/dist/canvas/deps/geometryProjection.js +13 -7
  262. package/dist/canvas/deps/geometryProjection.js.map +1 -1
  263. package/dist/canvas/deps/hitTestArea.js +80 -40
  264. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  265. package/dist/canvas/deps/ingestion.js +18 -13
  266. package/dist/canvas/deps/ingestion.js.map +1 -1
  267. package/dist/canvas/deps/insert.js +205 -111
  268. package/dist/canvas/deps/insert.js.map +1 -1
  269. package/dist/canvas/deps/kitSettings.js +16 -0
  270. package/dist/canvas/deps/kitSettings.js.map +1 -0
  271. package/dist/canvas/deps/lassoSelect.js +25 -13
  272. package/dist/canvas/deps/lassoSelect.js.map +1 -1
  273. package/dist/canvas/deps/layout.js +32 -26
  274. package/dist/canvas/deps/layout.js.map +1 -1
  275. package/dist/canvas/deps/nodeAtPoint.js +28 -14
  276. package/dist/canvas/deps/nodeAtPoint.js.map +1 -1
  277. package/dist/canvas/deps/pathLeaf.js +66 -0
  278. package/dist/canvas/deps/pathLeaf.js.map +1 -0
  279. package/dist/canvas/deps/pathLeafDeps.js +13 -0
  280. package/dist/canvas/deps/pathLeafDeps.js.map +1 -0
  281. package/dist/canvas/deps/poseDescriptor.js +10 -8
  282. package/dist/canvas/deps/poseDescriptor.js.map +1 -1
  283. package/dist/canvas/deps/previewPaths.js +44 -0
  284. package/dist/canvas/deps/previewPaths.js.map +1 -0
  285. package/dist/canvas/deps/resizePolicy.js +32 -25
  286. package/dist/canvas/deps/resizePolicy.js.map +1 -1
  287. package/dist/canvas/deps/slice.js +73 -87
  288. package/dist/canvas/deps/slice.js.map +1 -1
  289. package/dist/canvas/deps/snap.js +58 -7
  290. package/dist/canvas/deps/snap.js.map +1 -1
  291. package/dist/canvas/deps/surface.js +30 -0
  292. package/dist/canvas/deps/surface.js.map +1 -0
  293. package/dist/canvas/deps/textEdit.js +21 -13
  294. package/dist/canvas/deps/textEdit.js.map +1 -1
  295. package/dist/canvas/deps/view.js +46 -34
  296. package/dist/canvas/deps/view.js.map +1 -1
  297. package/dist/canvas/derivedPath.js +158 -50
  298. package/dist/canvas/derivedPath.js.map +1 -1
  299. package/dist/canvas/doubleClickTarget.js +20 -0
  300. package/dist/canvas/doubleClickTarget.js.map +1 -0
  301. package/dist/canvas/drawEnvelope.js +26 -17
  302. package/dist/canvas/drawEnvelope.js.map +1 -1
  303. package/dist/canvas/drawnBounds.js +116 -0
  304. package/dist/canvas/drawnBounds.js.map +1 -0
  305. package/dist/canvas/getNodeAtPoint.js +11 -8
  306. package/dist/canvas/getNodeAtPoint.js.map +1 -1
  307. package/dist/canvas/hostAnchor.js +35 -18
  308. package/dist/canvas/hostAnchor.js.map +1 -1
  309. package/dist/canvas/hud.module.js +25 -14
  310. package/dist/canvas/hud.module.js.map +1 -1
  311. package/dist/canvas/insertPreviewExtent.js +81 -58
  312. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  313. package/dist/canvas/kitRequirements.js +154 -115
  314. package/dist/canvas/kitRequirements.js.map +1 -1
  315. package/dist/canvas/layerHover.js +28 -0
  316. package/dist/canvas/layerHover.js.map +1 -0
  317. package/dist/canvas/layerOrder.js +107 -57
  318. package/dist/canvas/layerOrder.js.map +1 -1
  319. package/dist/canvas/layerSlots.js +16 -9
  320. package/dist/canvas/layerSlots.js.map +1 -1
  321. package/dist/canvas/mountedCanvases.js +23 -13
  322. package/dist/canvas/mountedCanvases.js.map +1 -1
  323. package/dist/canvas/nodeShapes/derivedPainter.js +65 -25
  324. package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
  325. package/dist/canvas/nodeShapes/imagePainter.js +69 -53
  326. package/dist/canvas/nodeShapes/imagePainter.js.map +1 -1
  327. package/dist/canvas/nodeShapes/measurePainter.js +58 -0
  328. package/dist/canvas/nodeShapes/measurePainter.js.map +1 -0
  329. package/dist/canvas/nodeShapes/memo.js +16 -5
  330. package/dist/canvas/nodeShapes/memo.js.map +1 -1
  331. package/dist/canvas/nodeShapes/nodePaint.js +125 -46
  332. package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
  333. package/dist/canvas/nodeShapes/pathPainter.js +41 -27
  334. package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
  335. package/dist/canvas/nodeShapes/poseBox.js +20 -13
  336. package/dist/canvas/nodeShapes/poseBox.js.map +1 -1
  337. package/dist/canvas/nodeShapes/rectFallbackPainter.js +26 -22
  338. package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
  339. package/dist/canvas/nodeShapes/shapePainter.js +67 -46
  340. package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
  341. package/dist/canvas/nodeShapes/strokedBounds.js +177 -0
  342. package/dist/canvas/nodeShapes/strokedBounds.js.map +1 -0
  343. package/dist/canvas/nodeShapes/textPainter.js +170 -37
  344. package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
  345. package/dist/canvas/overChildren.js +40 -0
  346. package/dist/canvas/overChildren.js.map +1 -0
  347. package/dist/canvas/overlayRoleStrokes.js +20 -3
  348. package/dist/canvas/overlayRoleStrokes.js.map +1 -1
  349. package/dist/canvas/paintCull.js +24 -12
  350. package/dist/canvas/paintCull.js.map +1 -1
  351. package/dist/canvas/paintedCursorLayer.js +59 -35
  352. package/dist/canvas/paintedCursorLayer.js.map +1 -1
  353. package/dist/canvas/pathOverlay.js +63 -0
  354. package/dist/canvas/pathOverlay.js.map +1 -0
  355. package/dist/canvas/pickReach.js +40 -0
  356. package/dist/canvas/pickReach.js.map +1 -0
  357. package/dist/canvas/pickWalk.js +150 -130
  358. package/dist/canvas/pickWalk.js.map +1 -1
  359. package/dist/canvas/planeClips.js +39 -22
  360. package/dist/canvas/planeClips.js.map +1 -1
  361. package/dist/canvas/poseCascade.js +51 -27
  362. package/dist/canvas/poseCascade.js.map +1 -1
  363. package/dist/canvas/poseRotation.js +24 -14
  364. package/dist/canvas/poseRotation.js.map +1 -1
  365. package/dist/canvas/rasterReadback.js +23 -15
  366. package/dist/canvas/rasterReadback.js.map +1 -1
  367. package/dist/canvas/rasterToPng.js +21 -15
  368. package/dist/canvas/rasterToPng.js.map +1 -1
  369. package/dist/canvas/renderDebugSnapshot.js +36 -19
  370. package/dist/canvas/renderDebugSnapshot.js.map +1 -1
  371. package/dist/canvas/renderNeeds.js +33 -18
  372. package/dist/canvas/renderNeeds.js.map +1 -1
  373. package/dist/canvas/renderSceneToPixels.js +202 -87
  374. package/dist/canvas/renderSceneToPixels.js.map +1 -1
  375. package/dist/canvas/sceneAdapter.js +96 -96
  376. package/dist/canvas/sceneAdapter.js.map +1 -1
  377. package/dist/canvas/sceneClipboard.js +141 -92
  378. package/dist/canvas/sceneClipboard.js.map +1 -1
  379. package/dist/canvas/sceneLayerPaint.js +56 -27
  380. package/dist/canvas/sceneLayerPaint.js.map +1 -1
  381. package/dist/canvas/sceneSlotWiring.js +24 -13
  382. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  383. package/dist/canvas/sceneViewRender.js +85 -55
  384. package/dist/canvas/sceneViewRender.js.map +1 -1
  385. package/dist/canvas/slopsDebugLayer.js +58 -49
  386. package/dist/canvas/slopsDebugLayer.js.map +1 -1
  387. package/dist/canvas/surfaceContribution.js +22 -10
  388. package/dist/canvas/surfaceContribution.js.map +1 -1
  389. package/dist/canvas/useCanvasElements.js +31 -0
  390. package/dist/canvas/useCanvasElements.js.map +1 -0
  391. package/dist/canvas/useCanvasHandle.js +69 -0
  392. package/dist/canvas/useCanvasHandle.js.map +1 -0
  393. package/dist/canvas/useCanvasPaint.js +91 -0
  394. package/dist/canvas/useCanvasPaint.js.map +1 -0
  395. package/dist/canvas/useCanvasRenderer.js +45 -23
  396. package/dist/canvas/useCanvasRenderer.js.map +1 -1
  397. package/dist/canvas/useCanvasSurface.js +41 -23
  398. package/dist/canvas/useCanvasSurface.js.map +1 -1
  399. package/dist/canvas/useCanvasView.js +80 -50
  400. package/dist/canvas/useCanvasView.js.map +1 -1
  401. package/dist/canvas/useClientToWorld.js +27 -0
  402. package/dist/canvas/useClientToWorld.js.map +1 -0
  403. package/dist/canvas/useExtraLayers.js +45 -0
  404. package/dist/canvas/useExtraLayers.js.map +1 -0
  405. package/dist/canvas/useFrameLoop.js +109 -49
  406. package/dist/canvas/useFrameLoop.js.map +1 -1
  407. package/dist/canvas/useHitObserver.js +22 -15
  408. package/dist/canvas/useHitObserver.js.map +1 -1
  409. package/dist/canvas/useHostAnchor.js +83 -53
  410. package/dist/canvas/useHostAnchor.js.map +1 -1
  411. package/dist/canvas/useLateContentRedraw.js +21 -14
  412. package/dist/canvas/useLateContentRedraw.js.map +1 -1
  413. package/dist/canvas/useLayerStack.js +72 -0
  414. package/dist/canvas/useLayerStack.js.map +1 -0
  415. package/dist/canvas/usePaintedCursor.js +28 -0
  416. package/dist/canvas/usePaintedCursor.js.map +1 -0
  417. package/dist/canvas/useRedrawOn.js +24 -14
  418. package/dist/canvas/useRedrawOn.js.map +1 -1
  419. package/dist/canvas/useSceneAdapter.js +27 -0
  420. package/dist/canvas/useSceneAdapter.js.map +1 -0
  421. package/dist/canvas/useSceneLayerList.js +15 -7
  422. package/dist/canvas/useSceneLayerList.js.map +1 -1
  423. package/dist/canvas/useSurfaceInput.js +46 -30
  424. package/dist/canvas/useSurfaceInput.js.map +1 -1
  425. package/dist/canvas/useSurfaceSize.js +43 -0
  426. package/dist/canvas/useSurfaceSize.js.map +1 -0
  427. package/dist/canvas/useToolCursor.js +30 -21
  428. package/dist/canvas/useToolCursor.js.map +1 -1
  429. package/dist/canvas/useViewHelpers.js +112 -61
  430. package/dist/canvas/useViewHelpers.js.map +1 -1
  431. package/dist/canvas/useViewLayerGate.js +29 -0
  432. package/dist/canvas/useViewLayerGate.js.map +1 -0
  433. package/dist/canvas/useViewNesting.js +104 -0
  434. package/dist/canvas/useViewNesting.js.map +1 -0
  435. package/dist/canvas/useViewRegistrySurface.js +44 -0
  436. package/dist/canvas/useViewRegistrySurface.js.map +1 -0
  437. package/dist/canvas/viewInputs.js +14 -11
  438. package/dist/canvas/viewInputs.js.map +1 -1
  439. package/dist/canvas/viewRegistry.js +144 -38
  440. package/dist/canvas/viewRegistry.js.map +1 -1
  441. package/dist/canvas/watchElementMove.js +71 -33
  442. package/dist/canvas/watchElementMove.js.map +1 -1
  443. package/dist/canvas/wrapNodeOutput.js +21 -9
  444. package/dist/canvas/wrapNodeOutput.js.map +1 -1
  445. package/dist/clipboard.d.ts +7 -3
  446. package/dist/clipboard.js +4 -3
  447. package/dist/{clone-2a5hVbBd.d.ts → clone-DZDrfIlU.d.ts} +31 -64
  448. package/dist/clone.d.ts +5 -4
  449. package/dist/core/adapters/testing/rootsTree.js +17 -0
  450. package/dist/core/adapters/testing/rootsTree.js.map +1 -0
  451. package/dist/core/applyOps.js +23 -7
  452. package/dist/core/applyOps.js.map +1 -1
  453. package/dist/core/device/index.js +6 -5
  454. package/dist/core/device/targets.js +29 -8
  455. package/dist/core/device/targets.js.map +1 -1
  456. package/dist/core/device/useDeviceProfile.js +86 -52
  457. package/dist/core/device/useDeviceProfile.js.map +1 -1
  458. package/dist/core/device/useTargetBasePx.js +23 -0
  459. package/dist/core/device/useTargetBasePx.js.map +1 -0
  460. package/dist/core/device/watchDevicePixelRatio.js +27 -10
  461. package/dist/core/device/watchDevicePixelRatio.js.map +1 -1
  462. package/dist/core/geometry/autoPoseDescriptor.js +38 -24
  463. package/dist/core/geometry/autoPoseDescriptor.js.map +1 -1
  464. package/dist/core/geometry/inkExtents.js +60 -0
  465. package/dist/core/geometry/inkExtents.js.map +1 -0
  466. package/dist/core/geometry/pathPoseDescriptor.js +101 -76
  467. package/dist/core/geometry/pathPoseDescriptor.js.map +1 -1
  468. package/dist/core/geometry/poseDescriptor.js +209 -120
  469. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  470. package/dist/core/geometry/regionHit.js +127 -79
  471. package/dist/core/geometry/regionHit.js.map +1 -1
  472. package/dist/core/geometry/targetFrame.js +84 -60
  473. package/dist/core/geometry/targetFrame.js.map +1 -1
  474. package/dist/core/geometry/unionBounds.js +103 -48
  475. package/dist/core/geometry/unionBounds.js.map +1 -1
  476. package/dist/core/isPlainObject.js +3 -2
  477. package/dist/core/layers/backgroundFill.js +23 -15
  478. package/dist/core/layers/backgroundFill.js.map +1 -1
  479. package/dist/core/layers/children.js +16 -15
  480. package/dist/core/layers/children.js.map +1 -1
  481. package/dist/core/layers/gateLayer.js +24 -9
  482. package/dist/core/layers/gateLayer.js.map +1 -1
  483. package/dist/core/layers/layerGroup.js +42 -29
  484. package/dist/core/layers/layerGroup.js.map +1 -1
  485. package/dist/core/layers/redrawSource.js +15 -0
  486. package/dist/core/layers/redrawSource.js.map +1 -0
  487. package/dist/core/layers/render.js +183 -93
  488. package/dist/core/layers/render.js.map +1 -1
  489. package/dist/core/layers/retain.js +38 -0
  490. package/dist/core/layers/retain.js.map +1 -0
  491. package/dist/core/ops/arrange.js +30 -19
  492. package/dist/core/ops/arrange.js.map +1 -1
  493. package/dist/core/ops/create.js +32 -23
  494. package/dist/core/ops/create.js.map +1 -1
  495. package/dist/core/ops/createHistory.js +23 -14
  496. package/dist/core/ops/createHistory.js.map +1 -1
  497. package/dist/core/ops/delete.js +80 -57
  498. package/dist/core/ops/delete.js.map +1 -1
  499. package/dist/core/ops/nodeFlags.js +44 -0
  500. package/dist/core/ops/nodeFlags.js.map +1 -0
  501. package/dist/core/ops/registry.js +26 -11
  502. package/dist/core/ops/registry.js.map +1 -1
  503. package/dist/core/ops/reorder/algorithms.js +62 -38
  504. package/dist/core/ops/reorder/algorithms.js.map +1 -1
  505. package/dist/core/ops/reorder/index.js +124 -88
  506. package/dist/core/ops/reorder/index.js.map +1 -1
  507. package/dist/core/ops/reorder/setChildOrder.js +32 -25
  508. package/dist/core/ops/reorder/setChildOrder.js.map +1 -1
  509. package/dist/core/ops/reparent.js +63 -38
  510. package/dist/core/ops/reparent.js.map +1 -1
  511. package/dist/core/ops/select.js +23 -20
  512. package/dist/core/ops/select.js.map +1 -1
  513. package/dist/core/ops/setData.js +23 -21
  514. package/dist/core/ops/setData.js.map +1 -1
  515. package/dist/core/ops/setLayer.js +26 -21
  516. package/dist/core/ops/setLayer.js.map +1 -1
  517. package/dist/core/ops/setLayout.js +27 -18
  518. package/dist/core/ops/setLayout.js.map +1 -1
  519. package/dist/core/ops/setPath.js +60 -41
  520. package/dist/core/ops/setPath.js.map +1 -1
  521. package/dist/core/ops/setText.js +26 -21
  522. package/dist/core/ops/setText.js.map +1 -1
  523. package/dist/core/ops/slot.js +36 -25
  524. package/dist/core/ops/slot.js.map +1 -1
  525. package/dist/core/ops/transform.js +35 -28
  526. package/dist/core/ops/transform.js.map +1 -1
  527. package/dist/core/pages/fitViewToPage.js +17 -0
  528. package/dist/core/pages/fitViewToPage.js.map +1 -0
  529. package/dist/core/pages/pages.js +96 -0
  530. package/dist/core/pages/pages.js.map +1 -0
  531. package/dist/core/pages/pagesLayer.js +33 -0
  532. package/dist/core/pages/pagesLayer.js.map +1 -0
  533. package/dist/core/paint/meshKind.js +16 -11
  534. package/dist/core/paint/meshKind.js.map +1 -1
  535. package/dist/core/paint/meshKindLazy.js +3 -3
  536. package/dist/core/paint/meshKindLazy.js.map +1 -1
  537. package/dist/core/paint/paintKindEntry.js +13 -4
  538. package/dist/core/paint/paintKindEntry.js.map +1 -1
  539. package/dist/core/paint/paintKinds.js +149 -88
  540. package/dist/core/paint/paintKinds.js.map +1 -1
  541. package/dist/core/paint/registerMesh.js +6 -4
  542. package/dist/core/paint/registerMesh.js.map +1 -1
  543. package/dist/core/scene/NodeProperties.js +15 -10
  544. package/dist/core/scene/NodeProperties.js.map +1 -1
  545. package/dist/core/scene/NodeRouting.js +16 -12
  546. package/dist/core/scene/NodeRouting.js.map +1 -1
  547. package/dist/core/scene/annotation.js +28 -0
  548. package/dist/core/scene/annotation.js.map +1 -0
  549. package/dist/core/scene/appliedLog.js +31 -23
  550. package/dist/core/scene/appliedLog.js.map +1 -1
  551. package/dist/core/scene/arrivalWindow.js +120 -75
  552. package/dist/core/scene/arrivalWindow.js.map +1 -1
  553. package/dist/core/scene/arrivals.js +17 -6
  554. package/dist/core/scene/arrivals.js.map +1 -1
  555. package/dist/core/scene/boundOps.js +42 -23
  556. package/dist/core/scene/boundOps.js.map +1 -1
  557. package/dist/core/scene/composeFrame.js +51 -21
  558. package/dist/core/scene/composeFrame.js.map +1 -1
  559. package/dist/core/scene/composePose.js +129 -39
  560. package/dist/core/scene/composePose.js.map +1 -1
  561. package/dist/core/scene/depFrame.js +94 -0
  562. package/dist/core/scene/depFrame.js.map +1 -0
  563. package/dist/core/scene/depMemo.js +44 -19
  564. package/dist/core/scene/depMemo.js.map +1 -1
  565. package/dist/core/scene/dependents.js +73 -45
  566. package/dist/core/scene/dependents.js.map +1 -1
  567. package/dist/core/scene/derivedParts.js +58 -0
  568. package/dist/core/scene/derivedParts.js.map +1 -0
  569. package/dist/core/scene/derivedPath.js +52 -22
  570. package/dist/core/scene/derivedPath.js.map +1 -1
  571. package/dist/core/scene/editMode.js +11 -11
  572. package/dist/core/scene/editMode.js.map +1 -1
  573. package/dist/core/scene/effectivePose.js +168 -48
  574. package/dist/core/scene/effectivePose.js.map +1 -1
  575. package/dist/core/scene/fieldEdits.js +95 -75
  576. package/dist/core/scene/fieldEdits.js.map +1 -1
  577. package/dist/core/scene/historyFacade.js +130 -85
  578. package/dist/core/scene/historyFacade.js.map +1 -1
  579. package/dist/core/scene/historyForm.js +7 -3
  580. package/dist/core/scene/historyForm.js.map +1 -1
  581. package/dist/core/scene/kitOps.js +203 -131
  582. package/dist/core/scene/kitOps.js.map +1 -1
  583. package/dist/core/scene/kitRegistry.js +49 -22
  584. package/dist/core/scene/kitRegistry.js.map +1 -1
  585. package/dist/core/scene/layerStack.js +123 -92
  586. package/dist/core/scene/layerStack.js.map +1 -1
  587. package/dist/core/scene/layoutPass.js +118 -72
  588. package/dist/core/scene/layoutPass.js.map +1 -1
  589. package/dist/core/scene/lockGuard.js +32 -24
  590. package/dist/core/scene/lockGuard.js.map +1 -1
  591. package/dist/core/scene/minSize.js +17 -0
  592. package/dist/core/scene/minSize.js.map +1 -0
  593. package/dist/core/scene/nestedHit.js +45 -31
  594. package/dist/core/scene/nestedHit.js.map +1 -1
  595. package/dist/core/scene/nodeFlags.js +43 -0
  596. package/dist/core/scene/nodeFlags.js.map +1 -0
  597. package/dist/core/scene/nodeFnFields.js +64 -40
  598. package/dist/core/scene/nodeFnFields.js.map +1 -1
  599. package/dist/core/scene/nodeGates.js +58 -0
  600. package/dist/core/scene/nodeGates.js.map +1 -0
  601. package/dist/core/scene/nodeMemo.js +92 -40
  602. package/dist/core/scene/nodeMemo.js.map +1 -1
  603. package/dist/core/scene/nodeStore.js +179 -99
  604. package/dist/core/scene/nodeStore.js.map +1 -1
  605. package/dist/core/scene/notifier.js +30 -19
  606. package/dist/core/scene/notifier.js.map +1 -1
  607. package/dist/core/scene/opTable.js +42 -36
  608. package/dist/core/scene/opTable.js.map +1 -1
  609. package/dist/core/scene/outerOps.js +50 -43
  610. package/dist/core/scene/outerOps.js.map +1 -1
  611. package/dist/core/scene/pathEffects/blend.js +80 -0
  612. package/dist/core/scene/pathEffects/blend.js.map +1 -0
  613. package/dist/core/scene/pathEffects/derive.js +112 -0
  614. package/dist/core/scene/pathEffects/derive.js.map +1 -0
  615. package/dist/core/scene/pathEffects/effects.js +40 -0
  616. package/dist/core/scene/pathEffects/effects.js.map +1 -0
  617. package/dist/core/scene/poseFeed.js +95 -60
  618. package/dist/core/scene/poseFeed.js.map +1 -1
  619. package/dist/core/scene/poseHold.js +33 -24
  620. package/dist/core/scene/poseHold.js.map +1 -1
  621. package/dist/core/scene/poseOverrides.js +86 -49
  622. package/dist/core/scene/poseOverrides.js.map +1 -1
  623. package/dist/core/scene/poseRemovals.js +58 -0
  624. package/dist/core/scene/poseRemovals.js.map +1 -0
  625. package/dist/core/scene/poseSnapshot.js +62 -41
  626. package/dist/core/scene/poseSnapshot.js.map +1 -1
  627. package/dist/core/scene/poseWrites.js +151 -0
  628. package/dist/core/scene/poseWrites.js.map +1 -0
  629. package/dist/core/scene/reconcileSpecs.js +63 -34
  630. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  631. package/dist/core/scene/recorder.js +90 -57
  632. package/dist/core/scene/recorder.js.map +1 -1
  633. package/dist/core/scene/renderOrder.js +105 -59
  634. package/dist/core/scene/renderOrder.js.map +1 -1
  635. package/dist/core/scene/scene.js +133 -80
  636. package/dist/core/scene/scene.js.map +1 -1
  637. package/dist/core/scene/sceneEdits.js +62 -49
  638. package/dist/core/scene/sceneEdits.js.map +1 -1
  639. package/dist/core/scene/sceneMutators.js +44 -36
  640. package/dist/core/scene/sceneMutators.js.map +1 -1
  641. package/dist/core/scene/scenePoseAdapter.js +13 -9
  642. package/dist/core/scene/scenePoseAdapter.js.map +1 -1
  643. package/dist/core/scene/sceneRecording.js +89 -72
  644. package/dist/core/scene/sceneRecording.js.map +1 -1
  645. package/dist/core/scene/sceneSelection.js +23 -16
  646. package/dist/core/scene/sceneSelection.js.map +1 -1
  647. package/dist/core/scene/sceneState.js +54 -36
  648. package/dist/core/scene/sceneState.js.map +1 -1
  649. package/dist/core/scene/serialization.js +87 -50
  650. package/dist/core/scene/serialization.js.map +1 -1
  651. package/dist/core/scene/staleReplay.js +35 -26
  652. package/dist/core/scene/staleReplay.js.map +1 -1
  653. package/dist/core/scene/statedFields.js +10 -5
  654. package/dist/core/scene/statedFields.js.map +1 -1
  655. package/dist/core/scene/treeEdits.js +129 -98
  656. package/dist/core/scene/treeEdits.js.map +1 -1
  657. package/dist/core/scene/treeOrder.js +13 -8
  658. package/dist/core/scene/treeOrder.js.map +1 -1
  659. package/dist/core/scene/treeReads.js +25 -16
  660. package/dist/core/scene/treeReads.js.map +1 -1
  661. package/dist/core/scene/types.js +4 -3
  662. package/dist/core/scene/types.js.map +1 -1
  663. package/dist/core/scene/unionOfChildren.js +20 -10
  664. package/dist/core/scene/unionOfChildren.js.map +1 -1
  665. package/dist/core/scene/unitScopes.js +15 -8
  666. package/dist/core/scene/unitScopes.js.map +1 -1
  667. package/dist/core/scene/useScene.js +32 -24
  668. package/dist/core/scene/useScene.js.map +1 -1
  669. package/dist/core/selection/chromeState.js +41 -17
  670. package/dist/core/selection/chromeState.js.map +1 -1
  671. package/dist/core/selection/readOnlySelection.js +39 -24
  672. package/dist/core/selection/readOnlySelection.js.map +1 -1
  673. package/dist/core/selection/selectionTarget.js +14 -3
  674. package/dist/core/selection/selectionTarget.js.map +1 -1
  675. package/dist/core/selection/usePublishSceneSelection.js +25 -18
  676. package/dist/core/selection/usePublishSceneSelection.js.map +1 -1
  677. package/dist/core/selection/useSelection.js +90 -57
  678. package/dist/core/selection/useSelection.js.map +1 -1
  679. package/dist/core/shapeKinds.js +43 -28
  680. package/dist/core/shapeKinds.js.map +1 -1
  681. package/dist/core/stableStringify.js +5 -4
  682. package/dist/core/stableStringify.js.map +1 -1
  683. package/dist/core/stylus/stylus.js +49 -25
  684. package/dist/core/stylus/stylus.js.map +1 -1
  685. package/dist/core/stylus/usePointerStylus.js +61 -34
  686. package/dist/core/stylus/usePointerStylus.js.map +1 -1
  687. package/dist/core/usePaintKinds.js +21 -11
  688. package/dist/core/usePaintKinds.js.map +1 -1
  689. package/dist/core/viewport/clampView.js +31 -15
  690. package/dist/core/viewport/clampView.js.map +1 -1
  691. package/dist/core/viewport/clientToWorld.js +15 -4
  692. package/dist/core/viewport/clientToWorld.js.map +1 -1
  693. package/dist/core/viewport/createVelocityTracker.js +23 -19
  694. package/dist/core/viewport/createVelocityTracker.js.map +1 -1
  695. package/dist/core/viewport/fitToBounds.js +28 -11
  696. package/dist/core/viewport/fitToBounds.js.map +1 -1
  697. package/dist/core/viewport/fitViewToBounds.js +45 -19
  698. package/dist/core/viewport/fitViewToBounds.js.map +1 -1
  699. package/dist/core/viewport/interpolateView.js +40 -20
  700. package/dist/core/viewport/interpolateView.js.map +1 -1
  701. package/dist/core/viewport/parallax.js +89 -56
  702. package/dist/core/viewport/parallax.js.map +1 -1
  703. package/dist/core/viewport/sceneNodeClientRect.js +21 -12
  704. package/dist/core/viewport/sceneNodeClientRect.js.map +1 -1
  705. package/dist/core/viewport/screenSlop.js +40 -17
  706. package/dist/core/viewport/screenSlop.js.map +1 -1
  707. package/dist/core/viewport/useAutoCenter.js +36 -22
  708. package/dist/core/viewport/useAutoCenter.js.map +1 -1
  709. package/dist/core/viewport/useCanvasSize.js +43 -22
  710. package/dist/core/viewport/useCanvasSize.js.map +1 -1
  711. package/dist/core/viewport/useDecayLoop.js +120 -50
  712. package/dist/core/viewport/useDecayLoop.js.map +1 -1
  713. package/dist/core/viewport/useNodeOverlayFrame.js +93 -58
  714. package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -1
  715. package/dist/core/viewport/useVelocityTracker.js +9 -6
  716. package/dist/core/viewport/useVelocityTracker.js.map +1 -1
  717. package/dist/core/viewport/useViewAnimation.js +159 -99
  718. package/dist/core/viewport/useViewAnimation.js.map +1 -1
  719. package/dist/core/viewport/view.js +49 -22
  720. package/dist/core/viewport/view.js.map +1 -1
  721. package/dist/core/viewport/viewTransform.js +8 -6
  722. package/dist/core/viewport/viewTransform.js.map +1 -1
  723. package/dist/core/viewport/viewportWorldRect.js +15 -7
  724. package/dist/core/viewport/viewportWorldRect.js.map +1 -1
  725. package/dist/core/viewport/wheelHandler.js +31 -20
  726. package/dist/core/viewport/wheelHandler.js.map +1 -1
  727. package/dist/core/viewport/zoomAt.js +50 -13
  728. package/dist/core/viewport/zoomAt.js.map +1 -1
  729. package/dist/core/viewport/zoomBounds.js +33 -17
  730. package/dist/core/viewport/zoomBounds.js.map +1 -1
  731. package/dist/cornerHandles-Camw_yeu.d.ts +169 -0
  732. package/dist/debug/createDebugOverlayLayer.js +303 -215
  733. package/dist/debug/createDebugOverlayLayer.js.map +1 -1
  734. package/dist/debug/createDebugSink.js +68 -47
  735. package/dist/debug/createDebugSink.js.map +1 -1
  736. package/dist/debug/defaultTheme.js +16 -4
  737. package/dist/debug/defaultTheme.js.map +1 -1
  738. package/dist/debug/flag.js +3 -2
  739. package/dist/debug/frameStats.js +11 -9
  740. package/dist/debug/frameStats.js.map +1 -1
  741. package/dist/debug/parseDebugFlags.js +25 -17
  742. package/dist/debug/parseDebugFlags.js.map +1 -1
  743. package/dist/debug/useDebugSink.js +52 -33
  744. package/dist/debug/useDebugSink.js.map +1 -1
  745. package/dist/depSchema-Cgfu_G9s.d.ts +3581 -0
  746. package/dist/features/chrome-caps/buildChromeCtx.js +12 -10
  747. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
  748. package/dist/features/chrome-caps/conditions.js +103 -25
  749. package/dist/features/chrome-caps/conditions.js.map +1 -1
  750. package/dist/features/chrome-caps/defaults.js +18 -10
  751. package/dist/features/chrome-caps/defaults.js.map +1 -1
  752. package/dist/features/chrome-caps/index.js +8 -7
  753. package/dist/features/chrome-caps/resolve.js +28 -16
  754. package/dist/features/chrome-caps/resolve.js.map +1 -1
  755. package/dist/features/chrome-caps/useChromeCaps.js +52 -44
  756. package/dist/features/chrome-caps/useChromeCaps.js.map +1 -1
  757. package/dist/features/chrome-caps/useHoverTracking.js +52 -26
  758. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
  759. package/dist/features/ingestion/contentHandlers.js +80 -34
  760. package/dist/features/ingestion/contentHandlers.js.map +1 -1
  761. package/dist/features/ingestion/imageHandler.js +49 -29
  762. package/dist/features/ingestion/imageHandler.js.map +1 -1
  763. package/dist/features/ingestion/openFilePicker.js +27 -9
  764. package/dist/features/ingestion/openFilePicker.js.map +1 -1
  765. package/dist/features/ingestion/placement.js +20 -11
  766. package/dist/features/ingestion/placement.js.map +1 -1
  767. package/dist/features/ingestion/registerKitHandlers.js +35 -18
  768. package/dist/features/ingestion/registerKitHandlers.js.map +1 -1
  769. package/dist/features/ingestion/svgHandler.js +60 -34
  770. package/dist/features/ingestion/svgHandler.js.map +1 -1
  771. package/dist/features/ingestion/textHandler.js +37 -16
  772. package/dist/features/ingestion/textHandler.js.map +1 -1
  773. package/dist/features/ingestion/useCanvasIngestion.js +57 -39
  774. package/dist/features/ingestion/useCanvasIngestion.js.map +1 -1
  775. package/dist/features/ingestion/weaselJsonHandler.js +38 -28
  776. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
  777. package/dist/features/longPress/longPressFeedback.js +110 -81
  778. package/dist/features/longPress/longPressFeedback.js.map +1 -1
  779. package/dist/features/measure/actionIds.js +22 -0
  780. package/dist/features/measure/actionIds.js.map +1 -0
  781. package/dist/features/measure/measureCommands.js +178 -0
  782. package/dist/features/measure/measureCommands.js.map +1 -0
  783. package/dist/features/measure/measureContribution.js +57 -0
  784. package/dist/features/measure/measureContribution.js.map +1 -0
  785. package/dist/features/measure/measureEdits.js +82 -0
  786. package/dist/features/measure/measureEdits.js.map +1 -0
  787. package/dist/features/measure/measureGestures.js +185 -0
  788. package/dist/features/measure/measureGestures.js.map +1 -0
  789. package/dist/features/measure/measureHit.js +80 -0
  790. package/dist/features/measure/measureHit.js.map +1 -0
  791. package/dist/features/measure/measureLayer.js +86 -0
  792. package/dist/features/measure/measureLayer.js.map +1 -0
  793. package/dist/features/measure/measurement.js +79 -0
  794. package/dist/features/measure/measurement.js.map +1 -0
  795. package/dist/features/measure/measurements.js +41 -0
  796. package/dist/features/measure/measurements.js.map +1 -0
  797. package/dist/features/modes/modeLayers.js +81 -55
  798. package/dist/features/modes/modeLayers.js.map +1 -1
  799. package/dist/features/modes/modeTriggers.js +66 -0
  800. package/dist/features/modes/modeTriggers.js.map +1 -0
  801. package/dist/features/pathEffects/index.js +35 -0
  802. package/dist/features/pathEffects/index.js.map +1 -0
  803. package/dist/features/pathEffects/readSource.js +46 -0
  804. package/dist/features/pathEffects/readSource.js.map +1 -0
  805. package/dist/features/paths/anchorData.js +65 -0
  806. package/dist/features/paths/anchorData.js.map +1 -0
  807. package/dist/features/paths/anchorMarkers.js +137 -0
  808. package/dist/features/paths/anchorMarkers.js.map +1 -0
  809. package/dist/features/paths/editablePath.js +155 -36
  810. package/dist/features/paths/editablePath.js.map +1 -1
  811. package/dist/features/paths/index.js +12 -9
  812. package/dist/features/paths/originProjection.js +16 -9
  813. package/dist/features/paths/originProjection.js.map +1 -1
  814. package/dist/features/paths/pathEditExtension.js +26 -0
  815. package/dist/features/paths/pathEditExtension.js.map +1 -0
  816. package/dist/features/paths/pathEditState.js +107 -26
  817. package/dist/features/paths/pathEditState.js.map +1 -1
  818. package/dist/features/paths/pathEditingOverlayLayer.js +58 -110
  819. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
  820. package/dist/features/paths/pathLayer.js +79 -29
  821. package/dist/features/paths/pathLayer.js.map +1 -1
  822. package/dist/features/paths/pathRepresentation.js +27 -0
  823. package/dist/features/paths/pathRepresentation.js.map +1 -0
  824. package/dist/features/paths/pathSnap/glyphs.js +39 -0
  825. package/dist/features/paths/pathSnap/glyphs.js.map +1 -0
  826. package/dist/features/paths/pathSnap/pathSnapSource.js +82 -0
  827. package/dist/features/paths/pathSnap/pathSnapSource.js.map +1 -0
  828. package/dist/features/paths/pathSnap/sceneIndex.js +78 -0
  829. package/dist/features/paths/pathSnap/sceneIndex.js.map +1 -0
  830. package/dist/features/paths/pathSnap/snapGeometry.js +47 -0
  831. package/dist/features/paths/pathSnap/snapGeometry.js.map +1 -0
  832. package/dist/features/paths/penPreviewLayer.js +135 -102
  833. package/dist/features/paths/penPreviewLayer.js.map +1 -1
  834. package/dist/features/paths/shapeGenerator.js +141 -0
  835. package/dist/features/paths/shapeGenerator.js.map +1 -0
  836. package/dist/features/paths/strokeOutline.js +15 -0
  837. package/dist/features/paths/strokeOutline.js.map +1 -0
  838. package/dist/features/paths/useAnchorFields.js +35 -0
  839. package/dist/features/paths/useAnchorFields.js.map +1 -0
  840. package/dist/features/paths/usePathEdit.js +58 -28
  841. package/dist/features/paths/usePathEdit.js.map +1 -1
  842. package/dist/features/poseRun/usePoseRun.js +111 -44
  843. package/dist/features/poseRun/usePoseRun.js.map +1 -1
  844. package/dist/features/selection/handleCommands.js +116 -0
  845. package/dist/features/selection/handleCommands.js.map +1 -0
  846. package/dist/features/selection/overlay.js +288 -328
  847. package/dist/features/selection/overlay.js.map +1 -1
  848. package/dist/features/selection/selectionPose.js +109 -0
  849. package/dist/features/selection/selectionPose.js.map +1 -0
  850. package/dist/features/snap/angle2d.js +158 -0
  851. package/dist/features/snap/angle2d.js.map +1 -0
  852. package/dist/features/snap/debugCandidates.js +27 -0
  853. package/dist/features/snap/debugCandidates.js.map +1 -0
  854. package/dist/features/snap/gather.js +71 -0
  855. package/dist/features/snap/gather.js.map +1 -0
  856. package/dist/features/snap/inputSubspace.js +46 -0
  857. package/dist/features/snap/inputSubspace.js.map +1 -0
  858. package/dist/features/snap/marks.js +29 -0
  859. package/dist/features/snap/marks.js.map +1 -0
  860. package/dist/features/snap/outcomeStore.js +25 -0
  861. package/dist/features/snap/outcomeStore.js.map +1 -0
  862. package/dist/features/snap/pointSnap.js +48 -0
  863. package/dist/features/snap/pointSnap.js.map +1 -0
  864. package/dist/features/snap/probes2d.js +91 -0
  865. package/dist/features/snap/probes2d.js.map +1 -0
  866. package/dist/features/snap/readoutDraw.js +93 -0
  867. package/dist/features/snap/readoutDraw.js.map +1 -0
  868. package/dist/features/snap/readoutLayer.js +49 -0
  869. package/dist/features/snap/readoutLayer.js.map +1 -0
  870. package/dist/features/snap/registry.js +27 -0
  871. package/dist/features/snap/registry.js.map +1 -0
  872. package/dist/features/snap/resizeBox.js +137 -0
  873. package/dist/features/snap/resizeBox.js.map +1 -0
  874. package/dist/features/snap/roles.js +31 -0
  875. package/dist/features/snap/roles.js.map +1 -0
  876. package/dist/features/snap/rotationSource.js +30 -0
  877. package/dist/features/snap/rotationSource.js.map +1 -0
  878. package/dist/features/snap/sceneReads.js +45 -0
  879. package/dist/features/snap/sceneReads.js.map +1 -0
  880. package/dist/features/snap/sceneSession2d.js +79 -0
  881. package/dist/features/snap/sceneSession2d.js.map +1 -0
  882. package/dist/features/snap/screen.js +23 -0
  883. package/dist/features/snap/screen.js.map +1 -0
  884. package/dist/features/snap/session2d.js +129 -0
  885. package/dist/features/snap/session2d.js.map +1 -0
  886. package/dist/features/snap/spanSnap.js +77 -0
  887. package/dist/features/snap/spanSnap.js.map +1 -0
  888. package/dist/features/snap/stepAngles.js +15 -0
  889. package/dist/features/snap/stepAngles.js.map +1 -0
  890. package/dist/features/text/editingDrawOne.js +32 -0
  891. package/dist/features/text/editingDrawOne.js.map +1 -0
  892. package/dist/features/text/index.js +7 -6
  893. package/dist/features/text/textHitAt.js +51 -0
  894. package/dist/features/text/textHitAt.js.map +1 -0
  895. package/dist/features/text/textLayer.js +21 -27
  896. package/dist/features/text/textLayer.js.map +1 -1
  897. package/dist/features/text/useSceneTextEdit.js +203 -123
  898. package/dist/features/text/useSceneTextEdit.js.map +1 -1
  899. package/dist/features/viewports/viewResolver.js +51 -38
  900. package/dist/features/viewports/viewResolver.js.map +1 -1
  901. package/dist/features/viewports/viewportLayer.js +60 -29
  902. package/dist/features/viewports/viewportLayer.js.map +1 -1
  903. package/dist/iconRegistry/IconRegistryProvider.js +73 -0
  904. package/dist/iconRegistry/IconRegistryProvider.js.map +1 -0
  905. package/dist/iconRegistry/useIconGlyph.js +14 -0
  906. package/dist/iconRegistry/useIconGlyph.js.map +1 -0
  907. package/dist/iconRegistry/useIconVariant.js +29 -0
  908. package/dist/iconRegistry/useIconVariant.js.map +1 -0
  909. package/dist/icons.d.ts +6 -0
  910. package/dist/icons.js +3 -0
  911. package/dist/icons.table.js +13 -0
  912. package/dist/icons.table.js.map +1 -0
  913. package/dist/icons.table.json +556 -0
  914. package/dist/icons2.table.js +9 -0
  915. package/dist/icons2.table.js.map +1 -0
  916. package/dist/index.d.ts +4552 -4992
  917. package/dist/index.js +340 -276
  918. package/dist/input/keyState.js +118 -54
  919. package/dist/input/keyState.js.map +1 -1
  920. package/dist/input/useKeyModifiers.js +13 -7
  921. package/dist/input/useKeyModifiers.js.map +1 -1
  922. package/dist/input/useKeyState.js +23 -16
  923. package/dist/input/useKeyState.js.map +1 -1
  924. package/dist/interactions/actions/align/action.js +76 -45
  925. package/dist/interactions/actions/align/action.js.map +1 -1
  926. package/dist/interactions/actions/align/align.js +86 -48
  927. package/dist/interactions/actions/align/align.js.map +1 -1
  928. package/dist/interactions/actions/booleans/action.js +67 -33
  929. package/dist/interactions/actions/booleans/action.js.map +1 -1
  930. package/dist/interactions/actions/booleans/booleans.js +77 -70
  931. package/dist/interactions/actions/booleans/booleans.js.map +1 -1
  932. package/dist/interactions/actions/booleans/commit.js +49 -0
  933. package/dist/interactions/actions/booleans/commit.js.map +1 -0
  934. package/dist/interactions/actions/booleans/custom.js +48 -0
  935. package/dist/interactions/actions/booleans/custom.js.map +1 -0
  936. package/dist/interactions/actions/booleans/operands.js +43 -32
  937. package/dist/interactions/actions/booleans/operands.js.map +1 -1
  938. package/dist/interactions/actions/booleans/pieces.js +29 -23
  939. package/dist/interactions/actions/booleans/pieces.js.map +1 -1
  940. package/dist/interactions/actions/booleans/placement.js +30 -17
  941. package/dist/interactions/actions/booleans/placement.js.map +1 -1
  942. package/dist/interactions/actions/booleans/useBooleans.js +30 -17
  943. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
  944. package/dist/interactions/actions/booleans/useBooleansAdapter.js +8 -5
  945. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
  946. package/dist/interactions/actions/clipboard/action.js +81 -40
  947. package/dist/interactions/actions/clipboard/action.js.map +1 -1
  948. package/dist/interactions/actions/clipboard/clipboardOps.js +100 -72
  949. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
  950. package/dist/interactions/actions/clipboard/materializePaste.js +38 -19
  951. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
  952. package/dist/interactions/actions/clipboard/wireFormat.js +66 -28
  953. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
  954. package/dist/interactions/actions/clone/action.js +102 -65
  955. package/dist/interactions/actions/clone/action.js.map +1 -1
  956. package/dist/interactions/actions/clone/behaviors.js +55 -38
  957. package/dist/interactions/actions/clone/behaviors.js.map +1 -1
  958. package/dist/interactions/actions/defaultCommitAdapter.js +32 -10
  959. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
  960. package/dist/interactions/actions/defaults/anchorEditing.js +253 -115
  961. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  962. package/dist/interactions/actions/defaults/anchorFields.js +54 -0
  963. package/dist/interactions/actions/defaults/anchorFields.js.map +1 -0
  964. package/dist/interactions/actions/defaults/anchorHandles.js +46 -0
  965. package/dist/interactions/actions/defaults/anchorHandles.js.map +1 -0
  966. package/dist/interactions/actions/defaults/anchorJoin.js +110 -0
  967. package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -0
  968. package/dist/interactions/actions/defaults/areaSelect.js +56 -40
  969. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
  970. package/dist/interactions/actions/defaults/bendSegment.js +82 -0
  971. package/dist/interactions/actions/defaults/bendSegment.js.map +1 -0
  972. package/dist/interactions/actions/defaults/cancelGesture.js +12 -5
  973. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
  974. package/dist/interactions/actions/defaults/clearSelection.js +22 -7
  975. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
  976. package/dist/interactions/actions/defaults/contextMenu.js +149 -0
  977. package/dist/interactions/actions/defaults/contextMenu.js.map +1 -0
  978. package/dist/interactions/actions/defaults/copySubtree.js +43 -29
  979. package/dist/interactions/actions/defaults/copySubtree.js.map +1 -1
  980. package/dist/interactions/actions/defaults/createPaintAction.js +79 -54
  981. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
  982. package/dist/interactions/actions/defaults/delete.js +61 -33
  983. package/dist/interactions/actions/defaults/delete.js.map +1 -1
  984. package/dist/interactions/actions/defaults/duplicate.js +65 -22
  985. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  986. package/dist/interactions/actions/defaults/enterPathEdit.js +29 -13
  987. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
  988. package/dist/interactions/actions/defaults/enterTextEdit.js +20 -8
  989. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
  990. package/dist/interactions/actions/defaults/escape.js +16 -7
  991. package/dist/interactions/actions/defaults/escape.js.map +1 -1
  992. package/dist/interactions/actions/defaults/exitPathEdit.js +6 -6
  993. package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -1
  994. package/dist/interactions/actions/defaults/group.js +122 -73
  995. package/dist/interactions/actions/defaults/group.js.map +1 -1
  996. package/dist/interactions/actions/defaults/ingest.js +52 -35
  997. package/dist/interactions/actions/defaults/ingest.js.map +1 -1
  998. package/dist/interactions/actions/defaults/insertPathAnchor.js +39 -33
  999. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  1000. package/dist/interactions/actions/defaults/nudge.js +80 -48
  1001. package/dist/interactions/actions/defaults/nudge.js.map +1 -1
  1002. package/dist/interactions/actions/defaults/nudgeSteps.js +17 -12
  1003. package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
  1004. package/dist/interactions/actions/defaults/pathEditMarks.js +60 -0
  1005. package/dist/interactions/actions/defaults/pathEditMarks.js.map +1 -0
  1006. package/dist/interactions/actions/defaults/pathEditTools.js +57 -0
  1007. package/dist/interactions/actions/defaults/pathEditTools.js.map +1 -0
  1008. package/dist/interactions/actions/defaults/pinchZoom.js +54 -38
  1009. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
  1010. package/dist/interactions/actions/defaults/reorder.js +71 -40
  1011. package/dist/interactions/actions/defaults/reorder.js.map +1 -1
  1012. package/dist/interactions/actions/defaults/requiresSelection.js +13 -6
  1013. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
  1014. package/dist/interactions/actions/defaults/segmentUnder.js +30 -0
  1015. package/dist/interactions/actions/defaults/segmentUnder.js.map +1 -0
  1016. package/dist/interactions/actions/defaults/selectAll.js +21 -7
  1017. package/dist/interactions/actions/defaults/selectAll.js.map +1 -1
  1018. package/dist/interactions/actions/defaults/setFill.js +37 -21
  1019. package/dist/interactions/actions/defaults/setFill.js.map +1 -1
  1020. package/dist/interactions/actions/defaults/setFillOpacity.js +19 -10
  1021. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
  1022. package/dist/interactions/actions/defaults/setStroke.js +46 -25
  1023. package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
  1024. package/dist/interactions/actions/defaults/setStrokeOpacity.js +19 -11
  1025. package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -1
  1026. package/dist/interactions/actions/defaults/slice.js +42 -17
  1027. package/dist/interactions/actions/defaults/slice.js.map +1 -1
  1028. package/dist/interactions/actions/defaults/sliceOps.js +63 -42
  1029. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
  1030. package/dist/interactions/actions/defaults/toolActivate.js +34 -16
  1031. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
  1032. package/dist/interactions/actions/defaults/toolResetToDefault.js +29 -10
  1033. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
  1034. package/dist/interactions/actions/defaults/undoRedo.js +26 -20
  1035. package/dist/interactions/actions/defaults/undoRedo.js.map +1 -1
  1036. package/dist/interactions/actions/defaults/viewportDragPan.js +91 -58
  1037. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
  1038. package/dist/interactions/actions/defaults/viewportWheelPan.js +42 -23
  1039. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
  1040. package/dist/interactions/actions/defaults/viewportZoom.js +142 -91
  1041. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
  1042. package/dist/interactions/actions/distribute/action.js +62 -39
  1043. package/dist/interactions/actions/distribute/action.js.map +1 -1
  1044. package/dist/interactions/actions/distribute/distribute.js +53 -34
  1045. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  1046. package/dist/interactions/actions/distribute/plan.js +40 -22
  1047. package/dist/interactions/actions/distribute/plan.js.map +1 -1
  1048. package/dist/interactions/actions/drawnBoxes.js +31 -0
  1049. package/dist/interactions/actions/drawnBoxes.js.map +1 -0
  1050. package/dist/interactions/actions/edit-anchors/action.js +254 -75
  1051. package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
  1052. package/dist/interactions/actions/edit-anchors/extensionDrags.js +50 -0
  1053. package/dist/interactions/actions/edit-anchors/extensionDrags.js.map +1 -0
  1054. package/dist/interactions/actions/edit-anchors/geometry.js +74 -47
  1055. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
  1056. package/dist/interactions/actions/edit-anchors/handleDrag.js +101 -0
  1057. package/dist/interactions/actions/edit-anchors/handleDrag.js.map +1 -0
  1058. package/dist/interactions/actions/edit-anchors/handles.js +41 -27
  1059. package/dist/interactions/actions/edit-anchors/handles.js.map +1 -1
  1060. package/dist/interactions/actions/edit-anchors/params.js +12 -0
  1061. package/dist/interactions/actions/edit-anchors/params.js.map +1 -0
  1062. package/dist/interactions/actions/edit-anchors/preview.js +68 -0
  1063. package/dist/interactions/actions/edit-anchors/preview.js.map +1 -0
  1064. package/dist/interactions/actions/edit-anchors/symmetry.js +16 -0
  1065. package/dist/interactions/actions/edit-anchors/symmetry.js.map +1 -0
  1066. package/dist/interactions/actions/flip/action.js +119 -61
  1067. package/dist/interactions/actions/flip/action.js.map +1 -1
  1068. package/dist/interactions/actions/flip/helpers.js +69 -36
  1069. package/dist/interactions/actions/flip/helpers.js.map +1 -1
  1070. package/dist/interactions/actions/geometryProjection.js +17 -12
  1071. package/dist/interactions/actions/geometryProjection.js.map +1 -1
  1072. package/dist/interactions/actions/gestureFrames.js +20 -11
  1073. package/dist/interactions/actions/gestureFrames.js.map +1 -1
  1074. package/dist/interactions/actions/gestureLifecycle.js +93 -48
  1075. package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
  1076. package/dist/interactions/actions/hitSelection.js +6 -4
  1077. package/dist/interactions/actions/hitSelection.js.map +1 -1
  1078. package/dist/interactions/actions/insert/action.js +75 -39
  1079. package/dist/interactions/actions/insert/action.js.map +1 -1
  1080. package/dist/interactions/actions/insert/commit.js +44 -22
  1081. package/dist/interactions/actions/insert/commit.js.map +1 -1
  1082. package/dist/interactions/actions/insert/extras.js +60 -38
  1083. package/dist/interactions/actions/insert/extras.js.map +1 -1
  1084. package/dist/interactions/actions/insert/frame.js +59 -33
  1085. package/dist/interactions/actions/insert/frame.js.map +1 -1
  1086. package/dist/interactions/actions/insert/geometry.js +29 -25
  1087. package/dist/interactions/actions/insert/geometry.js.map +1 -1
  1088. package/dist/interactions/actions/insert/placeAction.js +108 -0
  1089. package/dist/interactions/actions/insert/placeAction.js.map +1 -0
  1090. package/dist/interactions/actions/insert/repositionAction.js +46 -0
  1091. package/dist/interactions/actions/insert/repositionAction.js.map +1 -0
  1092. package/dist/interactions/actions/insert/rotateAction.js +19 -8
  1093. package/dist/interactions/actions/insert/rotateAction.js.map +1 -1
  1094. package/dist/interactions/actions/insert/session.js +57 -41
  1095. package/dist/interactions/actions/insert/session.js.map +1 -1
  1096. package/dist/interactions/actions/insert/shape.js +83 -25
  1097. package/dist/interactions/actions/insert/shape.js.map +1 -1
  1098. package/dist/interactions/actions/lasso-select/action.js +160 -100
  1099. package/dist/interactions/actions/lasso-select/action.js.map +1 -1
  1100. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +44 -25
  1101. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
  1102. package/dist/interactions/actions/move/action.js +87 -48
  1103. package/dist/interactions/actions/move/action.js.map +1 -1
  1104. package/dist/interactions/actions/move/behaviors/layoutDrop.js +56 -36
  1105. package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -1
  1106. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +20 -10
  1107. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -1
  1108. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +40 -24
  1109. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -1
  1110. package/dist/interactions/actions/move/behaviors/snapToContainer.js +107 -63
  1111. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  1112. package/dist/interactions/actions/move/capture.js +106 -72
  1113. package/dist/interactions/actions/move/capture.js.map +1 -1
  1114. package/dist/interactions/actions/move/commit/index.js +43 -34
  1115. package/dist/interactions/actions/move/commit/index.js.map +1 -1
  1116. package/dist/interactions/actions/move/commit/layoutDrop.js +43 -32
  1117. package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -1
  1118. package/dist/interactions/actions/move/commit/layoutRelease.js +97 -77
  1119. package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -1
  1120. package/dist/interactions/actions/move/commit/rebase.js +16 -13
  1121. package/dist/interactions/actions/move/commit/rebase.js.map +1 -1
  1122. package/dist/interactions/actions/move/commit/reparent.js +83 -57
  1123. package/dist/interactions/actions/move/commit/reparent.js.map +1 -1
  1124. package/dist/interactions/actions/move/delta.js +58 -36
  1125. package/dist/interactions/actions/move/delta.js.map +1 -1
  1126. package/dist/interactions/actions/move/frame.js +73 -48
  1127. package/dist/interactions/actions/move/frame.js.map +1 -1
  1128. package/dist/interactions/actions/move/gestureAdapter.js +30 -20
  1129. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
  1130. package/dist/interactions/actions/move/landedDescendants.js +40 -25
  1131. package/dist/interactions/actions/move/landedDescendants.js.map +1 -1
  1132. package/dist/interactions/actions/move/layout/container.js +92 -72
  1133. package/dist/interactions/actions/move/layout/container.js.map +1 -1
  1134. package/dist/interactions/actions/move/layout/dragged.js +61 -39
  1135. package/dist/interactions/actions/move/layout/dragged.js.map +1 -1
  1136. package/dist/interactions/actions/move/layout/dropPass.js +136 -94
  1137. package/dist/interactions/actions/move/layout/dropPass.js.map +1 -1
  1138. package/dist/interactions/actions/move/layout/exits.js +58 -30
  1139. package/dist/interactions/actions/move/layout/exits.js.map +1 -1
  1140. package/dist/interactions/actions/move/layout/glide.js +55 -34
  1141. package/dist/interactions/actions/move/layout/glide.js.map +1 -1
  1142. package/dist/interactions/actions/move/session.js +85 -56
  1143. package/dist/interactions/actions/move/session.js.map +1 -1
  1144. package/dist/interactions/actions/move/translate.js +58 -43
  1145. package/dist/interactions/actions/move/translate.js.map +1 -1
  1146. package/dist/interactions/actions/outlines/createOutlines.js +28 -20
  1147. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  1148. package/dist/interactions/actions/outlines/createOutlinesAction.js +43 -31
  1149. package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -1
  1150. package/dist/interactions/actions/outlines/outlineStroke.js +68 -45
  1151. package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -1
  1152. package/dist/interactions/actions/outlines/outlineStrokeAction.js +24 -19
  1153. package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -1
  1154. package/dist/interactions/actions/outlines/replaceWithPaths.js +57 -42
  1155. package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -1
  1156. package/dist/interactions/actions/outlines/strokeRegion.js +37 -22
  1157. package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -1
  1158. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +8 -5
  1159. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -1
  1160. package/dist/interactions/actions/pathCommands/cutJoin.js +149 -0
  1161. package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -0
  1162. package/dist/interactions/actions/pathCommands/livePathEdit.js +98 -0
  1163. package/dist/interactions/actions/pathCommands/livePathEdit.js.map +1 -0
  1164. package/dist/interactions/actions/pathCommands/pathNodes.js +108 -0
  1165. package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -0
  1166. package/dist/interactions/actions/pathCommands/simplifyOffset.js +66 -0
  1167. package/dist/interactions/actions/pathCommands/simplifyOffset.js.map +1 -0
  1168. package/dist/interactions/actions/pathGestureTags.js +29 -0
  1169. package/dist/interactions/actions/pathGestureTags.js.map +1 -0
  1170. package/dist/interactions/actions/planeInput.js +198 -123
  1171. package/dist/interactions/actions/planeInput.js.map +1 -1
  1172. package/dist/interactions/actions/pointerState.js +12 -7
  1173. package/dist/interactions/actions/pointerState.js.map +1 -1
  1174. package/dist/interactions/actions/poseDescriptorDep.js +24 -14
  1175. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
  1176. package/dist/interactions/actions/poseFrame.js +45 -28
  1177. package/dist/interactions/actions/poseFrame.js.map +1 -1
  1178. package/dist/interactions/actions/resize/action.js +70 -30
  1179. package/dist/interactions/actions/resize/action.js.map +1 -1
  1180. package/dist/interactions/actions/resize/aspect.js +44 -0
  1181. package/dist/interactions/actions/resize/aspect.js.map +1 -0
  1182. package/dist/interactions/actions/resize/behaviors/clampMinSize.js +38 -13
  1183. package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -1
  1184. package/dist/interactions/actions/resize/boxFrame.js +15 -11
  1185. package/dist/interactions/actions/resize/boxFrame.js.map +1 -1
  1186. package/dist/interactions/actions/resize/capture.js +105 -62
  1187. package/dist/interactions/actions/resize/capture.js.map +1 -1
  1188. package/dist/interactions/actions/resize/commit.js +75 -56
  1189. package/dist/interactions/actions/resize/commit.js.map +1 -1
  1190. package/dist/interactions/actions/resize/cornerHandles.js +154 -17
  1191. package/dist/interactions/actions/resize/cornerHandles.js.map +1 -1
  1192. package/dist/interactions/actions/resize/frame.js +138 -57
  1193. package/dist/interactions/actions/resize/frame.js.map +1 -1
  1194. package/dist/interactions/actions/resize/minimum.js +35 -0
  1195. package/dist/interactions/actions/resize/minimum.js.map +1 -0
  1196. package/dist/interactions/actions/resize/replay.js +57 -0
  1197. package/dist/interactions/actions/resize/replay.js.map +1 -0
  1198. package/dist/interactions/actions/resize/ruleBounds.js +8 -5
  1199. package/dist/interactions/actions/resize/ruleBounds.js.map +1 -1
  1200. package/dist/interactions/actions/resize/session.js +100 -41
  1201. package/dist/interactions/actions/resize/session.js.map +1 -1
  1202. package/dist/interactions/actions/resolveOverlays.js +48 -32
  1203. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  1204. package/dist/interactions/actions/resolvePreviews.js +63 -46
  1205. package/dist/interactions/actions/resolvePreviews.js.map +1 -1
  1206. package/dist/interactions/actions/rotate/action.js +71 -30
  1207. package/dist/interactions/actions/rotate/action.js.map +1 -1
  1208. package/dist/interactions/actions/rotate/commit.js +39 -31
  1209. package/dist/interactions/actions/rotate/commit.js.map +1 -1
  1210. package/dist/interactions/actions/rotate/frame.js +75 -47
  1211. package/dist/interactions/actions/rotate/frame.js.map +1 -1
  1212. package/dist/interactions/actions/rotate/geometry.js +36 -24
  1213. package/dist/interactions/actions/rotate/geometry.js.map +1 -1
  1214. package/dist/interactions/actions/rotate/handle.js +28 -15
  1215. package/dist/interactions/actions/rotate/handle.js.map +1 -1
  1216. package/dist/interactions/actions/rotate/replay.js +26 -0
  1217. package/dist/interactions/actions/rotate/replay.js.map +1 -0
  1218. package/dist/interactions/actions/rotate/session.js +122 -73
  1219. package/dist/interactions/actions/rotate/session.js.map +1 -1
  1220. package/dist/interactions/actions/selectionSubtree.js +124 -53
  1221. package/dist/interactions/actions/selectionSubtree.js.map +1 -1
  1222. package/dist/interactions/actions/spatialReference.js +33 -26
  1223. package/dist/interactions/actions/spatialReference.js.map +1 -1
  1224. package/dist/interactions/actions/testUtils.js +53 -0
  1225. package/dist/interactions/actions/testUtils.js.map +1 -0
  1226. package/dist/interactions/actions/transform-again/action.js +78 -0
  1227. package/dist/interactions/actions/transform-again/action.js.map +1 -0
  1228. package/dist/interactions/actions/transform-again/memory.js +46 -0
  1229. package/dist/interactions/actions/transform-again/memory.js.map +1 -0
  1230. package/dist/interactions/actions/useActionSet.js +83 -0
  1231. package/dist/interactions/actions/useActionSet.js.map +1 -0
  1232. package/dist/interactions/actions/useStandardActions.js +23 -147
  1233. package/dist/interactions/actions/useStandardActions.js.map +1 -1
  1234. package/dist/interactions/gestures/dragGesture/dragGesture.js +109 -68
  1235. package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -1
  1236. package/dist/interactions/gestures/dragGesture/dragPointOf.js +17 -10
  1237. package/dist/interactions/gestures/dragGesture/dragPointOf.js.map +1 -1
  1238. package/dist/interactions/gestures/dragRadial/dragRadial.js +129 -93
  1239. package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -1
  1240. package/dist/interactions/gestures/dragRect/dragRect.js +155 -111
  1241. package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -1
  1242. package/dist/interactions/gestures/handleDrag/handleDrag.js +52 -30
  1243. package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -1
  1244. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +168 -97
  1245. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
  1246. package/dist/interactions/gestures/shared/originProjection.js +32 -25
  1247. package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
  1248. package/dist/interactions/gestures/shared/screenTolerance.js +26 -17
  1249. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
  1250. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +39 -21
  1251. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -1
  1252. package/dist/kitSettingsSchema.js +80 -0
  1253. package/dist/kitSettingsSchema.js.map +1 -0
  1254. package/dist/{math-CYUjoyyU.d.ts → math-CrJULaZI.d.ts} +5 -6
  1255. package/dist/math.d.ts +4 -5
  1256. package/dist/math.js +7 -6
  1257. package/dist/mesh.js +3 -2
  1258. package/dist/move.d.ts +7 -6
  1259. package/dist/move.js +4 -3
  1260. package/dist/{originProjection-PPT88jZv.d.ts → options-p9GZMXbY.d.ts} +4 -27
  1261. package/dist/originProjection-gY0jb4Wb.d.ts +24 -0
  1262. package/dist/patterns-builtin.js +3 -2
  1263. package/dist/{poseDescriptor-Bqk-11Rl.d.ts → poseDescriptor-DN2yfnq_.d.ts} +7 -7
  1264. package/dist/renderer.d.ts +1 -1
  1265. package/dist/renderer.js +3 -2
  1266. package/dist/resize.d.ts +10 -28
  1267. package/dist/resize.js +6 -7
  1268. package/dist/routing.js +3 -2
  1269. package/dist/style.css +88 -1
  1270. package/dist/test-hook/createTestHook.js +23 -20
  1271. package/dist/test-hook/createTestHook.js.map +1 -1
  1272. package/dist/test-hook/install.js +32 -13
  1273. package/dist/test-hook/install.js.map +1 -1
  1274. package/dist/test-hook/useTestHook.js +22 -16
  1275. package/dist/test-hook/useTestHook.js.map +1 -1
  1276. package/dist/test-seams.d.ts +164 -1
  1277. package/dist/test-seams.js +8 -3
  1278. package/dist/tools/builtin/bone/boneActions.js +96 -70
  1279. package/dist/tools/builtin/bone/boneActions.js.map +1 -1
  1280. package/dist/tools/builtin/bone/boneOverlay.js +49 -36
  1281. package/dist/tools/builtin/bone/boneOverlay.js.map +1 -1
  1282. package/dist/tools/builtin/bone/placedRig.js +18 -14
  1283. package/dist/tools/builtin/bone/placedRig.js.map +1 -1
  1284. package/dist/tools/builtin/bone/rigEditState.js +22 -13
  1285. package/dist/tools/builtin/bone/rigEditState.js.map +1 -1
  1286. package/dist/tools/builtin/bone/useBoneTool.js +68 -41
  1287. package/dist/tools/builtin/bone/useBoneTool.js.map +1 -1
  1288. package/dist/tools/builtin/ellipse/useEllipseTool.js +22 -16
  1289. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
  1290. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +44 -28
  1291. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
  1292. package/dist/tools/builtin/hand/dragPanContribution.js +12 -7
  1293. package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -1
  1294. package/dist/tools/builtin/hand/useHandTool.js +21 -13
  1295. package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
  1296. package/dist/tools/builtin/image/useImageTool.js +28 -19
  1297. package/dist/tools/builtin/image/useImageTool.js.map +1 -1
  1298. package/dist/tools/builtin/lasso/useLassoTool.js +48 -36
  1299. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
  1300. package/dist/tools/builtin/line/useLineTool.js +24 -16
  1301. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  1302. package/dist/tools/builtin/measure/useMeasureTool.js +84 -0
  1303. package/dist/tools/builtin/measure/useMeasureTool.js.map +1 -0
  1304. package/dist/tools/builtin/pen/penHandle.js +60 -0
  1305. package/dist/tools/builtin/pen/penHandle.js.map +1 -0
  1306. package/dist/tools/builtin/pen/usePenTool.js +463 -305
  1307. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  1308. package/dist/tools/builtin/pencil/usePencilTool.js +20 -15
  1309. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
  1310. package/dist/tools/builtin/pickTopMostHit.js +51 -34
  1311. package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
  1312. package/dist/tools/builtin/polygon/usePolygonTool.js +45 -26
  1313. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  1314. package/dist/tools/builtin/rect/useRectTool.js +24 -15
  1315. package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
  1316. package/dist/tools/builtin/select/adapterPointQuery.js +48 -27
  1317. package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -1
  1318. package/dist/tools/builtin/select/selectionContributions.js +94 -56
  1319. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  1320. package/dist/tools/builtin/select/useSelectTool.js +155 -107
  1321. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  1322. package/dist/tools/builtin/shared/insertToolOptions.js +5 -4
  1323. package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -1
  1324. package/dist/tools/builtin/shared/pointerFollower.js +15 -8
  1325. package/dist/tools/builtin/shared/pointerFollower.js.map +1 -1
  1326. package/dist/tools/builtin/slice/useSliceTool.js +148 -99
  1327. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  1328. package/dist/tools/builtin/star/useStarTool.js +48 -29
  1329. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  1330. package/dist/tools/builtin/sticky/stickyNode.js +49 -0
  1331. package/dist/tools/builtin/sticky/stickyNode.js.map +1 -0
  1332. package/dist/tools/builtin/sticky/useStickyTool.js +86 -0
  1333. package/dist/tools/builtin/sticky/useStickyTool.js.map +1 -0
  1334. package/dist/tools/builtin/text/useTextTool.js +61 -36
  1335. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  1336. package/dist/tools/builtin/weight/useWeightTool.js +66 -42
  1337. package/dist/tools/builtin/weight/useWeightTool.js.map +1 -1
  1338. package/dist/tools/builtin/weight/weightActions.js +93 -65
  1339. package/dist/tools/builtin/weight/weightActions.js.map +1 -1
  1340. package/dist/tools/builtin/weight/weightOverlay.js +47 -30
  1341. package/dist/tools/builtin/weight/weightOverlay.js.map +1 -1
  1342. package/dist/tools/overlayBinding.js +7 -5
  1343. package/dist/tools/overlayBinding.js.map +1 -1
  1344. package/dist/tools/useKeybindings.js +62 -46
  1345. package/dist/tools/useKeybindings.js.map +1 -1
  1346. package/dist/{types-CIKDwlsP.d.ts → types-CHVXGfYm.d.ts} +27 -20
  1347. package/dist/util/color.js +39 -18
  1348. package/dist/util/color.js.map +1 -1
  1349. package/dist/util/paint.js +93 -38
  1350. package/dist/util/paint.js.map +1 -1
  1351. package/dist/version.js +11 -3
  1352. package/dist/version.js.map +1 -1
  1353. package/package.json +35 -23
  1354. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +0 -126
  1355. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +0 -1
  1356. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +0 -64
  1357. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +0 -1
  1358. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +0 -16
  1359. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +0 -1
  1360. package/dist/canvas/SceneCanvas/isDev.js +0 -12
  1361. package/dist/canvas/SceneCanvas/isDev.js.map +0 -1
  1362. package/dist/canvas/SceneCanvas/useViewLayerGate.js +0 -20
  1363. package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +0 -1
  1364. package/dist/canvas/surface.module.js +0 -6
  1365. package/dist/canvas/surface.module.js.map +0 -1
  1366. package/dist/canvas/surfaceBox.js +0 -16
  1367. package/dist/canvas/surfaceBox.js.map +0 -1
  1368. package/dist/cornerHandles-BEshc4z3.d.ts +0 -104
  1369. package/dist/icons/ArrowIcon.js +0 -23
  1370. package/dist/icons/ArrowIcon.js.map +0 -1
  1371. package/dist/icons/EllipseIcon.js +0 -21
  1372. package/dist/icons/EllipseIcon.js.map +0 -1
  1373. package/dist/icons/EyedropperIcon.js +0 -49
  1374. package/dist/icons/EyedropperIcon.js.map +0 -1
  1375. package/dist/icons/HandIcon.js +0 -59
  1376. package/dist/icons/HandIcon.js.map +0 -1
  1377. package/dist/icons/ImageIcon.js +0 -34
  1378. package/dist/icons/ImageIcon.js.map +0 -1
  1379. package/dist/icons/LassoIcon.js +0 -22
  1380. package/dist/icons/LassoIcon.js.map +0 -1
  1381. package/dist/icons/LineIcon.js +0 -22
  1382. package/dist/icons/LineIcon.js.map +0 -1
  1383. package/dist/icons/PenIcon.js +0 -36
  1384. package/dist/icons/PenIcon.js.map +0 -1
  1385. package/dist/icons/PencilIcon.js +0 -25
  1386. package/dist/icons/PencilIcon.js.map +0 -1
  1387. package/dist/icons/PolygonIcon.js +0 -19
  1388. package/dist/icons/PolygonIcon.js.map +0 -1
  1389. package/dist/icons/RectIcon.js +0 -37
  1390. package/dist/icons/RectIcon.js.map +0 -1
  1391. package/dist/icons/SelectIcon.js +0 -20
  1392. package/dist/icons/SelectIcon.js.map +0 -1
  1393. package/dist/icons/StarIcon.js +0 -19
  1394. package/dist/icons/StarIcon.js.map +0 -1
  1395. package/dist/icons/TextIcon.js +0 -19
  1396. package/dist/icons/TextIcon.js.map +0 -1
  1397. package/dist/icons/UnknownIcon.js +0 -33
  1398. package/dist/icons/UnknownIcon.js.map +0 -1
  1399. package/dist/icons/_base.js +0 -12
  1400. package/dist/icons/_base.js.map +0 -1
  1401. package/dist/interactions/actions/actionShortcuts.js +0 -32
  1402. package/dist/interactions/actions/actionShortcuts.js.map +0 -1
  1403. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +0 -40
  1404. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +0 -1
  1405. package/dist/interactions/actions/defaults/icons/actionGlyphs.js +0 -10
  1406. package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +0 -1
  1407. package/dist/interactions/actions/defaults/icons/alignIcons.js +0 -173
  1408. package/dist/interactions/actions/defaults/icons/alignIcons.js.map +0 -1
  1409. package/dist/interactions/actions/defaults/icons/booleanIcons.js +0 -194
  1410. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +0 -1
  1411. package/dist/interactions/actions/defaults/icons/distributeIcons.js +0 -63
  1412. package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +0 -1
  1413. package/dist/interactions/actions/defaults/icons/editIcons.js +0 -280
  1414. package/dist/interactions/actions/defaults/icons/editIcons.js.map +0 -1
  1415. package/dist/interactions/actions/defaults/icons/outlineIcons.js +0 -91
  1416. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +0 -1
  1417. package/dist/interactions/actions/resize/behaviors/index.js +0 -8
  1418. package/dist/interactions/actions/resize/behaviors/index.js.map +0 -1
  1419. package/dist/interactions/actions/resize/behaviors/lockAspect.js +0 -24
  1420. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +0 -1
  1421. package/dist/interactions/actions/resize/pointSnap.js +0 -111
  1422. package/dist/interactions/actions/resize/pointSnap.js.map +0 -1
  1423. package/dist/interactions/actions/rotate/behaviors/index.js +0 -7
  1424. package/dist/interactions/actions/rotate/behaviors/index.js.map +0 -1
  1425. package/dist/interactions/actions/rotate/behaviors/snapRotation.js +0 -12
  1426. package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +0 -1
  1427. package/dist/interactions/gestures/shared/snap.js +0 -24
  1428. package/dist/interactions/gestures/shared/snap.js.map +0 -1
  1429. package/dist/layout/arrivals.js +0 -33
  1430. package/dist/layout/arrivals.js.map +0 -1
  1431. package/dist/test-seams-D0pyV3pR.d.ts +0 -149
  1432. package/dist/util/constrainTo45.js +0 -17
  1433. package/dist/util/constrainTo45.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","names":["DEFAULT_HANDLE_SIZE","HANDLE_BASE_PX","mergeLayersWithDefaults","defaults","defaultDrawOne","defaultPaintBounds","targetSizesPx","targetScale","user","result","isCustomEntry","scene","paintBoundsFor","NON_SHAPE_BUILTIN_TOOLS","BUILTIN_TOOL_IDS","KIT_SHAPE_KINDS"],"sources":["../../../src/canvas/SceneCanvas/props.ts"],"sourcesContent":["import type { ModeRegistry } from '@weasel-js/modes';\nimport type { PathEditHost } from './pathEditHost';\nimport type { Paint } from '@weasel-js/paint';\nimport type { ActionsProp } from '@weasel-js/routing';\nimport { Yoke } from '@weasel-js/routing/react';\nimport type { PasteOmission } from 'core/adapters/types';\nimport type { Op } from 'core/ops/types';\nimport type { Node, Scene, SerializedScene } from 'core/scene/types';\nimport type { SelectionApi, UseSelectionOptions } from 'core/selection/useSelection';\nimport { KIT_SHAPE_KINDS, type BuiltinShapeToolId } from 'core/shapeKinds';\nimport type { InertiaConfig } from 'core/viewport/useDecayLoop';\nimport type { View } from 'core/viewport/view';\nimport type {\n ContentHandlerEntry\n} from 'features/ingestion';\nimport type { PinchZoomOptions } from 'interactions/actions/defaults/pinchZoom';\nimport type { WheelPanOptions } from 'interactions/actions/defaults/viewportWheelPan';\nimport type { ViewportZoomAnimateOptions, ViewportZoomOptions } from 'interactions/actions/defaults/viewportZoom';\nimport type { SvgIngestOptions } from 'interactions/actions/depSchema';\nimport type { GeometryProjection } from 'interactions/actions/geometryProjection';\nimport type { UseMoveOptions } from 'interactions/actions/move/options';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport type { UseRotateOptions } from 'interactions/actions/rotate/options';\nimport type { SnapStrategy } from 'interactions/gestures/types';\nimport type { ReactNode } from 'react';\nimport type { Bounds } from 'tools/builtin/select';\nimport type { Animator } from '@weasel-js/animator';\nimport { HANDLE_BASE_PX, targetSizesPx } from '../../core/device/targets';\nimport type { DeviceProfile } from '../../core/device/types';\nimport type { NodeRoutingEntry } from '../../core/scene/NodeRouting';\nimport type { DebugConfig } from '../../debug/types';\nimport type { LayoutDropTargetMode, ReflowTransition } from '../../layout/types';\nimport type { DrawCommand, ShaderProgramHandle } from '@weasel-js/renderer';\nimport type { Tool, ToolsApi } from '../../tools/overlayBinding';\nimport type { SceneSlotConfig } from '../buildSceneLayer';\nimport type { CanvasProps } from '../Canvas';\nimport { isCustomEntry, type LayersMap } from '../layerSlots';\nimport type { CanvasViewProps } from '../CanvasView';\nimport { defaultDrawOne, defaultPaintBounds, paintBoundsFor } from '../defaultDrawOne';\nimport type {\n InsertNodeFactory,\n InsertPaint\n} from '../deps';\nimport type { SceneToAdapterOptions } from '../sceneAdapter';\nimport type { SurfaceContribution } from '../surfaceContribution';\nimport type { CameraProps } from '../useCanvasView';\nimport type {\n Feature\n} from './features';\nimport type { BuiltinToolOptions } from './useBuiltinShapeTools';\nimport type { VersionCheck } from './useContributionRoles';\n\n/** The adapter surface delete / duplicate / group / ungroup need, narrowed from\n * `SceneCanvasAdapter` because `StandardActionsRegistrar` is non-generic. */\nexport interface BridgeAdapter {\n applyOps(ops: Op[], label?: string): void;\n insertNode(node: { id: string; [k: string]: unknown }): void;\n removeNode(id: string): void;\n setSelection(ids: string[]): void;\n}\n\n/** Default size in CSS pixels for selection corner-handles AND their\n * hit-test radius, at `targetScale = 1`. Deliberately unscaled; kit-internal\n * use sites multiply by `DeviceProfile.targetScale`. */\nexport const DEFAULT_HANDLE_SIZE = HANDLE_BASE_PX;\n\n/** `<SceneCanvas longPress>`. */\nexport interface SceneCanvasLongPress {\n /**\n * Shown while a long-press is held and some binding would fire on it.\n * Default: a ring that fills around the press point\n * (`createLongPressFeedbackContribution()`), static under\n * `prefers-reduced-motion`. `false` shows nothing; a contribution replaces\n * it, reading the `longPress` dep. Installed beside `ambient`, so under a\n * `tools` takeover add it to your own `useTools` call instead.\n */\n feedback?: boolean | SurfaceContribution;\n /** Default true. A long-press some binding handled pulses\n * `navigator.vibrate` briefly, for touch and pen, where the API exists. */\n haptics?: boolean;\n /** Hold time in ms. Default `LONG_PRESS_MS` (500). */\n duration?: number;\n}\n\n/** `<SceneCanvas layers>`: a {@link LayersMap} whose scene slot may be partial,\n * since the defaults fill in whatever it leaves out. */\nexport type SceneCanvasLayers<TNode extends { id: string }, TPose> = LayersMap<\n TNode,\n TPose,\n Partial<SceneSlotConfig<TNode, TPose>>\n>;\n\n/** Deep-merge user-supplied `layers` with kit defaults. Slots the user\n * doesn't mention get filled with defaults; slots explicitly set to\n * `null` are dropped. Partial slot configs are shallow-spread on top of the\n * default slot config. `targetScale` comes from the resolved {@link DeviceProfile}. */\nexport function mergeLayersWithDefaults<TData, TLayer extends string, TPose>(\n user: SceneCanvasLayers<Node<TData, TLayer, TPose>, TPose> | undefined,\n targetScale = 1,\n): LayersMap<Node<TData, TLayer, TPose>, TPose> {\n const defaults = {\n scene: {\n drawOne: defaultDrawOne as (\n node: Node<TData, TLayer, TPose>,\n pose: TPose,\n ) => DrawCommand[],\n paintBounds: defaultPaintBounds<TData, TLayer, TPose>,\n },\n selectionOverlay: { handles: { size: targetSizesPx(targetScale).handle } },\n };\n\n if (!user) return defaults as LayersMap<Node<TData, TLayer, TPose>, TPose>;\n\n // Start from a shallow copy of the user map so unknown slots pass through.\n const result = { ...user } as LayersMap<Node<TData, TLayer, TPose>, TPose>;\n\n if (!('scene' in user)) {\n result.scene = defaults.scene;\n } else if (user.scene === null || isCustomEntry(user.scene)) {\n result.scene = user.scene;\n } else {\n const scene = { ...defaults.scene, ...user.scene };\n result.scene = user.scene && 'paintBounds' in user.scene\n ? scene\n : { ...scene, paintBounds: paintBoundsFor<TData, TLayer, TPose>(scene.drawOne) };\n }\n\n if (!('selectionOverlay' in user)) {\n result.selectionOverlay = defaults.selectionOverlay;\n } else if (user.selectionOverlay === null || isCustomEntry(user.selectionOverlay)) {\n result.selectionOverlay = user.selectionOverlay;\n } else {\n result.selectionOverlay = { ...defaults.selectionOverlay, ...user.selectionOverlay };\n }\n\n return result;\n}\n\n/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop\n * is supplied, via `defaultTools`. */\nexport type BuiltinToolId = 'select' | 'hand' | BuiltinShapeToolId;\n\n/** Built-in tool ids that aren't shape tools — the ones with no entry in\n * the `core/shapeKinds` table. */\nexport const NON_SHAPE_BUILTIN_TOOLS: readonly Exclude<BuiltinToolId, BuiltinShapeToolId>[] = ['select', 'hand'];\n\n/** Every built-in tool id, shape tools included. */\nexport const BUILTIN_TOOL_IDS: readonly BuiltinToolId[] = [...NON_SHAPE_BUILTIN_TOOLS, ...KIT_SHAPE_KINDS];\n\n/** Minimal hit descriptor passed to `onDoubleClick`. Contains the fields\n * modality dispatch needs; extends as the kit's `Hit` type evolves. */\nexport interface SceneCanvasHit {\n id: string;\n kind: string;\n}\n\n/** Props for `<SceneCanvas>`. A scene is the only thing it needs. With nothing\n * else it renders that scene and keeps a selection no input sets; `features`\n * turns behavior on by preset, and the rest configures what those turn on. */\nexport type SceneCanvasProps<TData, TLayer extends string, TPose> =\n Omit<\n CanvasProps<TPose>,\n | 'adapter' | 'boundsOf' | 'selection' | 'tools'\n | 'viewState' // SceneCanvas makes the camera from the view props below\n | 'layers' // stripped so we can re-add as optional below\n | 'getIsVisible' // SceneCanvas synthesizes this from chromeVisibility\n | 'contentVersion' // SceneCanvas wires this to the scene's own version\n | 'layerVisibility' | 'layerOrder' // re-declared below: they gate picking here too\n | 'debug' // re-declared below with SceneCanvas's own `slops`\n > & CameraProps\n & {\n /** A `Scene` (typically from `useScene`) — or a `SerializedScene` JSON\n * object, which SceneCanvas bakes into a Scene on first render. The\n * serialized form is read once; pass a `key` on `<SceneCanvas>` to force\n * a fresh canvas from updated JSON.\n *\n * The JSON shape is relaxed (`version: number` rather than the `1`\n * literal) so an `import json from './x.json'` result satisfies the type\n * without an `as` cast. */\n scene:\n | Scene<TData, TLayer, TPose>\n | SerializedScene<TData, TLayer, TPose>\n | { version: number; systemLayers?: ReadonlyArray<{ id: string }>; nodes: ReadonlyArray<unknown> };\n\n /** Layer configuration. When omitted, SceneCanvas applies kit defaults\n * (a scene slot that paints `node.data.fill` rects + a default\n * selection overlay). A partial scene or selection-overlay config is\n * spread over that slot's defaults; pass `slot: null` to suppress a\n * default explicitly. */\n layers?: SceneCanvasLayers<Node<TData, TLayer, TPose>, TPose>;\n\n /** Layout strategies keyed by container node id (or a resolver), for\n * containers whose scene node declares none (`ContainerNode.layout`\n * wins). Applied to a drag and to every other change to their children,\n * through the scene's layout pass. */\n layouts?: SceneToAdapterOptions<TData, TLayer, TPose>['layouts'];\n\n /** Which layout container a drag lands in when several contain the drop\n * point — the innermost (default), the topmost in paint order, or only\n * containers whose strategy declares a `dropRegion`. Decides both the\n * drag-time reflow preview and the commit. */\n layoutDropTarget?: LayoutDropTargetMode;\n\n /** Carries the siblings a layout reflow displaces to their slots over time\n * instead of snapping them — `useAnimatedReflow` builds one. Covers a\n * drag's reflow and every one the scene records (an insert, delete,\n * reorder or resize inside a laid-out container). Absent or `null`,\n * they snap. */\n reflowTransition?: ReflowTransition<TPose> | null;\n\n /**\n * Lets pose-transform actions (move, resize, nudge, flip — NOT rotate) also rewrite a\n * node's data-held geometry. Given a node and the affine `m` applied to its pose,\n * `transform(node, m)` returns updated `data`, or `null` for nodes with no data-held\n * geometry. When absent, the kit emits only the pose op and leaves `data` untouched.\n *\n * @see GeometryProjection\n */\n geometryProjection?: GeometryProjection;\n\n /**\n * Routing-trait classifiers. The kit builds a `NodeRouting` registry per `<SceneCanvas>`\n * from this prop and uses it to derive each hit's `kind`, which tool routing tables\n * (e.g. `{ target: 'rect', actionId: 'move' }`) match against. Pass `defaultNodeRouting`\n * for the kit's built-in shape kinds; spread additional entries for consumer-defined\n * kinds.\n *\n * **Memoize the `routing` value.** The registry is memoized on the prop's reference\n * identity: a fresh array each render rebuilds it and cascades into a new adapter,\n * churning gesture state.\n */\n routing?: readonly NodeRoutingEntry[];\n\n /** How to read and rewrite this scene's poses. Every built-in action,\n * the selection chrome and picking read it. Default `AUTO_POSE_DESCRIPTOR`\n * (rect poses and `Path` poses). */\n poseDescriptor?: PoseDescriptor<TPose>;\n\n // --- Geometry: hit-test + bounds overrides consumed by the internal\n // `useSelectTool`. Ignored if the consumer passes their own `tools`. ---\n geometry?: {\n /** Hit-test override. Return the topmost id, the full back-to-front hit\n * stack (`string[]`), or `null` for empty space. The stack form lets a\n * consumer with domain overlap ordering (e.g. children over their\n * container) feed the kit's `pickTopMostHit` the true order instead of\n * pre-collapsing to one id. Matches `Canvas`'s `pickEvery` shape. */\n pickEvery?: (worldX: number, worldY: number) => string | string[] | null;\n boundsOf?: (id: string) => Bounds | null;\n /**\n * What \"the pointer is on this node\" means for the default body-pick.\n *\n * - `'pose'` — the node's pose rect, rotation honored.\n * - `'shape'` (default) — the pose rect as a pre-filter, then the ink the painter\n * actually lays down: its silhouette filled or not per the painter's `ink`, plus\n * its outline widened by the stroke half-width and `pickTolerancePx`.\n *\n * Painters with no silhouette keep the pose-rect answer either way. Ignored when\n * `pickEvery` is supplied: that override owns the test.\n */\n picking?: 'pose' | 'shape';\n /**\n * Grab slop around a shape's outline, in **screen** pixels, so the target keeps\n * its apparent size at any zoom. Default 4. It widens the outline test under\n * `picking: 'shape'` and grows the pose-rect pre-filter so those outline hits\n * survive it. Set `0` for exact geometry.\n */\n pickTolerancePx?: number;\n };\n\n // --- Selection options. `pickBest` and `handleHitRadius` configure the\n // internal select tool, and are ignored under a `tools` takeover;\n // `move`, `snap`, `resize` and `rotate` configure the `move`,\n // `resize` and `rotate` presets, and apply either way. ---\n selectTool?: {\n move?: UseMoveOptions<TPose>;\n resize?: UseResizeOptions<TPose>;\n /** Rotation options, or `false` to disable rotation entirely — drops the\n * `rotate` action AND hides the selection rotation-handle chrome. */\n rotate?: UseRotateOptions<TPose> | false;\n snap?: SnapStrategy<TPose>;\n handleHitRadius?: number;\n /** Override the body-pick used on click/pointerdown. Alt-aware: receives\n * the live alt state + current selection so consumers can implement\n * alt-cycling through an overlapping stack. Default: top-most hit\n * (alt ignored). */\n pickBest?: (worldX: number, worldY: number, alt: boolean, sel: readonly string[]) => string | null;\n };\n\n /** Consumer node factories for the `insert` action, keyed by tool `kind`.\n * Each factory receives the drag AABB + tool `extras` and returns the\n * node's `data` (in this canvas's own data shape) plus an optional `pose`.\n * A factory for a kit kind (`rect`, `line`, …) replaces the kit's default\n * `{ path, fill }` node for that kind; a factory for a novel kind (e.g.\n * `text`) adds insert support the kit doesn't ship. The dep supplies id,\n * layer, and the undoable op. Return `null` to reject an insert. */\n insertNodeFactories?: Record<string, InsertNodeFactory>;\n\n /** The fill, stroke, and fill rule a kit-built shape is inserted with, by\n * tool `kind` and insert count; the kit keeps the geometry. Default\n * `paletteInsertPaint`, the kit palette in turn. A kind with a factory in\n * `insertNodeFactories` is not asked. */\n insertPaint?: InsertPaint;\n\n /** External-content ingestion (OS drop / clipboard paste / picker).\n *\n * - `handlers` — consumer content handlers registered for this canvas's\n * lifetime (priority 0 by default — they beat the kit's `image/*` /\n * `image/svg+xml` handlers at -100/-90).\n * - `resolveSrc` — overrides the image handler's `data:`-URI embed (e.g.\n * upload to an asset store, return the URL).\n * - `svg.unpack` — makes the kit SVG handler parse dropped SVG files into\n * native scene nodes instead of one embedded-image node each.\n * - `clipboard` — the kit weasel-JSON paste handler, enabled by default.\n * `reviver` restores JSON-unfriendly values the copying side encoded via\n * `jsonReplacer`. `enabled: false` opts the canvas out, but the kit\n * handler still consumes weasel-matching items and declines them inert\n * rather than letting them fall through. Also governs Cmd/Ctrl+V under\n * the `edit` preset; the rest takes the `ingest` preset.\n *\n * Memoize `handlers` and `clipboard.reviver`: an inline array literal\n * re-registers the handlers on every render. */\n ingestion?: {\n handlers?: ContentHandlerEntry[];\n resolveSrc?: (file: File) => Promise<string>;\n svg?: SvgIngestOptions;\n clipboard?: {\n reviver?: (key: string, value: unknown) => unknown;\n enabled?: boolean;\n /** Called when a paste left copied nodes out, with each one and the\n * reason. `useClipboardOps` takes the same callback as\n * `onPasteOmitted` for a paste from its own in-memory copy. */\n onOmitted?: (omitted: PasteOmission[]) => void;\n };\n };\n\n selection?: SelectionApi;\n selectionOptions?: UseSelectionOptions;\n\n /**\n * `false` stops the canvas writing the selection: no click, marquee,\n * lasso, action or tool, and no op committed through the adapter it hands\n * its tools. The consumer's own `SelectionApi` — the `selection` prop, or\n * `useSelection({ scene })` — still writes, and the canvas draws what it\n * holds. Undo and redo still restore the selection each history entry\n * recorded. Default `true`.\n *\n * Click policy (whether shift-click extends) is the selection's `mode`:\n * `useSelection({ mode: 'multi' })`, or `selectionOptions={{ mode: 'multi' }}`\n * for the selection the canvas builds itself.\n */\n selectable?: boolean;\n\n /**\n * Behavior presets to turn on, composable in any combination. A canvas\n * with none renders its scene and keeps a selection (the `selection` API\n * works) that no input sets: no tools, no standard actions or their keys,\n * no clipboard, no drop or paste, and no selection chrome. The dispatcher\n * is still mounted, so bindings a consumer adds work.\n *\n * - `view` — wheel pan and zoom, pinch, the zoom keys, and the hand tool\n * (H, or hold Space). Passing `viewport` implies it.\n * - `select` — the select tool, as the initial active tool and Escape's\n * return target: click to pick, drag on empty to marquee, click on empty\n * to clear.\n * - `outline` — the selection outline, whichever tool sets the selection.\n * - `pick` — `select` and `outline`.\n * - `move` — drag a body to move it, Alt-drag to clone it. Ambient, so it\n * runs under any tool that does not claim the drag.\n * - `resize` — resize handles, drawn and bound.\n * - `rotate` — the rotation handle, drawn and bound.\n * - `transform` — `resize` and `rotate`.\n * - `edit` — undo/redo, delete, duplicate, group/ungroup, nudge,\n * select-all, Escape, cancel-gesture, cut/copy/paste, fill and stroke,\n * and their keys. Cmd/Ctrl+V pastes nodes a kit canvas copied, from\n * this tab or another, and nothing else.\n * - `arrange` — align, distribute, reorder, flip.\n * - `paths` — pathfinder operations, path-edit entry and anchor editing.\n * - `ingest` — dropped and pasted content: images, SVG, files, and\n * whatever `ingestion.handlers` accept, on Cmd/Ctrl+V or an OS drop.\n * - `draw` — all of the above.\n *\n * Tools add the actions they bind — a shape tool brings `insert` — so\n * `defaultTools` composes with any preset. `actions` then adds, overrides\n * or removes on top of what the presets registered.\n */\n features?: readonly Feature[];\n\n /** Extra tools or overrides keyed by id, or a full `ToolsApi` takeover.\n *\n * **Patch form** (`Record<string, Tool | true | false>`): merged\n * into the built-in registry on top of whatever `defaultTools` and\n * `features` already selected.\n * - `true` pulls in the built-in for this id (`'pen'`, `'lasso'`,\n * `'hand'`, …), the same as listing it in `defaultTools`. Unknown\n * built-in ids warn in dev and are ignored.\n * - `Tool` adds a new id or replaces an existing one\n * (dev-only warning on replace).\n * - `false` omits a bundled tool entirely.\n * Auto-wiring (keybindings, dispatcher, action registry) still runs.\n *\n * **Takeover form** (`ToolsApi`): the internal registry is bypassed and\n * this `tools` value is forwarded to Canvas as-is — the consumer owns\n * active-slot management, and `pick`'s select tool is theirs to supply.\n * Every other preset still applies. Keybindings are still auto-wired\n * against the supplied registry; pass `enableKeybindings={false}` to opt\n * out. */\n tools?: ToolsApi | Record<string, Tool | true | false>;\n\n /**\n * Auto-wire keyboard shortcuts. Default `true`. When `false`, SceneCanvas still mounts\n * its tools but routes no keyboard input to them — neither tool hotkeys nor\n * keyboard-bound actions like delete / escape / nudge. Pointer, wheel, and contextmenu\n * interactions are unaffected.\n */\n enableKeybindings?: boolean;\n\n /**\n * Take the keyboard on mount, as a press in the canvas would. A key that\n * reaches the page goes to the canvas the user last pressed or scrolled\n * in, and to no canvas before the first such interaction, so a canvas in a\n * side panel does not take Space from a page that wants it. An app whose\n * canvas is the page sets this so its shortcuts work before the first\n * click. Default `false`.\n */\n claimKeys?: boolean;\n\n /**\n * Auto-mount the gesture dispatcher (`useGestureDispatcher`). Default `true`. `false` is\n * for tests or demos that drive actions another way, or that call\n * `useGestureDispatcher` themselves.\n */\n enableGestureDispatcher?: boolean;\n\n /** Called with the `ToolsApi` SceneCanvas constructs or receives, whenever its identity\n * changes. For introspection. */\n onToolsCreated?: (tools: ToolsApi) => void;\n\n /**\n * Built-in tools SceneCanvas registers in its internal `useTools`, on top\n * of the ones presets bring (`select` from `pick`, `hand` from `view`).\n * Default: none. Each tool also registers the kit actions it binds, so\n * `['rect']` brings `insert`. Ignored when the consumer supplies their own\n * `tools` prop.\n */\n defaultTools?: readonly BuiltinToolId[];\n\n /** Per-tool option overrides for the built-in shape/lasso/clone tools.\n * Each entry is a narrow subset of the underlying hook's options\n * surface — `lasso.mode`, `clone.cloneSelection`, etc. */\n toolOptions?: BuiltinToolOptions;\n\n /** Initial active-slot tool id. Default: `'select'` when it is\n * registered, otherwise none — a canvas can run on ambient bindings\n * alone. Must be one of the registered tools. Ignored when the consumer\n * supplies their own `tools` prop. */\n initialActiveTool?: string;\n\n /** Always-on entries to register alongside the internal tools — every one\n * a `SurfaceContribution`, whose views, deps, overlay, bindings, actions\n * and `attach` all install from this one list, and uninstall when the\n * entry leaves it. A tool is a contribution too, so one can go here. If\n * you supply your own `tools` prop, this is ignored — wire `ambient`\n * through your own `useTools` call instead. */\n ambient?: readonly SurfaceContribution[];\n\n /** What an entry's `requires` does when the running kit does not meet\n * it: `'warn'` (the default) logs in development, `'strict'` throws,\n * `'off'` skips the check. */\n versionCheck?: VersionCheck;\n\n /** Touch and pen long-press: its hold time, its haptic, and the\n * feedback shown while it is held. */\n longPress?: SceneCanvasLongPress;\n\n /** Configures the `view` preset, and implies it: passing this turns\n * `view` on.\n *\n * - `inertia` and `animatedZoom` are opt-in: pass `true` for defaults or\n * an object to tune. Omitted means off.\n * - `pan` (wheel pan), `zoom` (Cmd+wheel + Cmd+=/-/0), and `pinchZoom`\n * (two-finger pinch) are on under `view`; pass `false` to disable one.\n * Disabling via the `actions` prop\n * (`actions: { 'viewport.wheelPan': null }`) also works and runs after\n * this. */\n viewport?: {\n inertia?: boolean | InertiaConfig;\n /** Two-finger pinch zoom. `true`/omitted = on with the kit's 0.1–8\n * clamp; `false` disables. An object sets the scale clamp. */\n pinchZoom?: boolean | PinchZoomOptions;\n /** Glide Cmd+=/-/0 instead of jumping. `true` uses the kit defaults\n * (250 ms, ease-out-cubic); a {@link ViewportZoomAnimateOptions} tunes\n * duration, easing, interpolator and the reset-branch duration. Wheel\n * and pinch are unaffected — their input already samples every frame. */\n animatedZoom?: boolean | ViewportZoomAnimateOptions;\n /** Wheel pan. `true`/omitted = on; `false` disables; an object locks the\n * axis (`{ axis: 'x' }`) so a single-axis viewport needs no commit clamp. */\n pan?: boolean | WheelPanOptions;\n /** Wheel/keyboard zoom. `true`/omitted = default Cmd+wheel zoom with the\n * kit's 0.1–8 clamp; `false` disables. Pass a {@link ViewportZoomOptions}\n * object to bind zoom to plain wheel (`wheel: 'plain'`, pair with\n * `pan: false`) and/or set `min`/`max` scale clamps. */\n zoom?: boolean | ViewportZoomOptions;\n /** Callback invoked by Cmd-0 (`viewport.zoom` action's `reset` branch).\n * When supplied, replaces the default reset-to-identity behavior —\n * consumers typically refit the document page into the workspace via\n * `fitViewToBounds`. Return the target `View` to let the kit animate\n * there when `animatedZoom` is on; return nothing to dispatch it\n * yourself, which is what a controlled canvas does. */\n recenter?: () => View | void;\n };\n\n /**\n * @experimental\n * Override / disable / extend the default action set. Pass `null` to disable all\n * defaults.\n */\n actions?: ActionsProp;\n\n /**\n * @experimental\n * Given a scene node, return a short human-readable \"kind\" label (e.g. `'rectangle'`,\n * `'sticky note'`), which the kit publishes per id into any surrounding\n * `<SelectionContextProvider>`. Return `undefined` to skip an entry. When omitted,\n * containers report `'group'`, poses with a `kind` property report `'path'`, and\n * everything else is left unlabelled.\n */\n describeKind?: (node: Node<TData, TLayer, TPose>) => string | undefined;\n\n /**\n * Animator to bind for per-frame redraws. SceneCanvas requests a redraw on every active\n * animation frame and paints `animator.colorOverrides` onto the scene's nodes: the\n * kit's path and shape painters apply them, and a custom `drawOne` receives them as\n * `ctx.vertexColors`.\n */\n animator?: Animator;\n\n /**\n * Extra views on this canvas: each is a camera over a rect of the same\n * surface, drawn through one GL context, with input routed to it. The flat\n * `view` / `onViewChange` props above stay the canvas's own camera — view\n * zero — and are unaffected by anything declared here.\n *\n * Order is paint and hit order, low to high. Each entry is a\n * `<CanvasView>`; mounting one as a child is the same declaration, and\n * children land after every entry here.\n */\n views?: readonly CanvasViewProps[];\n\n /**\n * Children rendered alongside the canvas, inside its input scope (e.g.\n * shortcuts overlays, probes).\n */\n children?: ReactNode;\n\n /**\n * A yoke to join, from `useYoke()`: canvases on one yoke share the\n * active tool, the gesture in flight and history. Omitted, this canvas\n * keeps its own.\n */\n yoke?: Yoke;\n\n /**\n * Chrome-caps visibility overrides, keyed by chrome id (`selection.outline`,\n * `selection.rotation-handle`, `gesture.marquee`, …). Each entry is a composable\n * {@link Condition} built from the `cond()` builder, merged on top of the kit's\n * `defaultVisibilityRules`. Set an id to `never` to suppress a chrome element\n * entirely (also unhittable), or to `always` to force-show.\n */\n chromeVisibility?: import('features/chrome-caps').VisibilityRules;\n\n /**\n * The app's mode registry (`createModeRegistry` in `@weasel-js/modes`).\n * The canvas reads the active mode from it to gate chrome, tool\n * activation and the dispatcher's eligibility filter, repaints when it\n * switches, and hands every registered mode to the dev-time route-conflict\n * check. Omitted, the canvas behaves as the kit's normal mode and nothing\n * revokes anchor editing.\n */\n modes?: ModeRegistry;\n\n /** Hands which path is being anchor-edited to the host. See {@link PathEditHost}. */\n pathEdit?: PathEditHost;\n\n /**\n * Override detected device facts. Merged over what `matchMedia` reports;\n * `targetScale` is re-derived from the merged `coarsePointer` unless you\n * override it explicitly.\n */\n device?: Partial<DeviceProfile>;\n\n /**\n * Live focus getter for chrome-caps' `focused` ctx field, for visibility rules that\n * read the `focused` atom (the kit's default `selection.rotation-handle` rule does).\n * Omit to default `focused` to `true`.\n */\n getFocused?: () => boolean;\n\n /** Custom shader programs to compile on the renderer. See `CanvasProps.shaders`. */\n shaders?: ShaderProgramHandle[];\n\n /** Flatness tolerance for curve tessellation, in world units. See\n * `CanvasProps.flattenTolerance`. */\n flattenTolerance?: number;\n\n /** Fill for the full canvas behind the scene, drawn as a screen-space layer slotted\n * before `'scene'` — independent of pan / zoom. */\n backgroundFill?: Paint;\n /** Dev HUD: a fixed-position widget showing live cursor coords in both viewport\n * (client) and canvas (world) frames. */\n cursorCoordsHud?: boolean;\n /** Dev HUD: a fixed-position widget listing the ids `pickEvery(world)` returns under\n * the cursor. */\n pickHud?: boolean;\n /**\n * The debug overlay: `<Canvas debug>`'s config, plus `slops: true` for\n * translucent halos at every affordance hit zone. `false` turns it off;\n * absent reads `?debug=…` from the URL, as `<Canvas>` does.\n */\n debug?: (DebugConfig & { slops?: boolean }) | false;\n /**\n * Dev HUD: when true (or object), mounts a fixed-position widget below\n * the pick HUD showing the active modality mode, active-slot tool, and\n * hotkey stack. Pass `{ modeId }` to populate the mode line.\n */\n modalityHud?: boolean | { modeId?: string };\n\n /**\n * Per-id alpha multiplier for the scene-render slot: each node's draw output is wrapped\n * in a group with the returned alpha, and 1 emits no wrapper. Typical use: dimming\n * non-active nodes during a mode transition.\n */\n alphaFor?: (id: string) => number;\n\n /**\n * Show or hide render layers in this canvas's own view, by id — the map\n * `<Canvas>` takes. Each scene layer paints as its own render layer, keyed\n * `scene:<layerId>`, so `{ 'scene:guides': false }` hides one scene layer\n * here and nowhere else.\n *\n * A layer hidden this way is gone from this view: it does not paint, and a\n * click, a marquee or Cmd+A here passes over it. Another view of the same\n * scene — a `<CanvasView>`, a second canvas, a minimap — still shows it and\n * can still take it. It applies on top of the scene's own\n * `LayerRecord.visible` and cannot show a layer the scene hides.\n */\n layerVisibility?: Record<string, boolean>;\n\n /**\n * Draw order for this view, by render-layer id, bottom first. A listed\n * order is the whole list: a scene layer left out of it is neither painted\n * nor picked here. See `CanvasProps.layerOrder`.\n */\n layerOrder?: string[];\n\n /**\n * Per-id pointer-interactivity predicate: an id it returns `false` for is excluded from\n * hit-test results. Typical use: suppressing pointer events for dimmed nodes.\n */\n isPointerInteractive?: (id: string) => boolean;\n\n /**\n * Called when the user double-clicks the canvas, with the hit node (id + kind) at that\n * position, or `null` on empty canvas. Typical use: modality dispatch — enter path-edit\n * on a path node, isolation on a group, text-edit on a text node.\n */\n onDoubleClick?: (hit: SceneCanvasHit | null) => void;\n /** Called on every click — a press and release without a drag — with the\n * node under it, or `null` on empty canvas. Fires after the click's own\n * behavior, so a pick it made is already in the selection, and fires\n * again on a node that was already picked. */\n onClick?: (hit: SceneCanvasHit | null) => void;\n };\n"],"mappings":";;;;;;AAiEA,IAAaA,IAAsBC;AAgCnC,SAAgBC,EACd,GACA,IAAc,GACgC;CAC9C,IAAMC,IAAW;EACf,OAAO;GACL,SAASC;GAIT,aAAaC;EACf;EACA,kBAAkB,EAAE,SAAS,EAAE,MAAMC,EAAcC,CAAW,CAAC,CAAC,OAAO,EAAE;CAC3E;CAEA,IAAI,CAACC,GAAM,OAAOL;CAGlB,IAAMM,IAAS,EAAE,GAAGD,EAAK;CAEzB,IAAI,EAAE,WAAWA,IACf,EAAO,QAAQL,EAAS;MACnB,IAAIK,EAAK,UAAU,QAAQE,EAAcF,EAAK,KAAK,GACxD,EAAO,QAAQA,EAAK;MACf;EACL,IAAMG,IAAQ;GAAE,GAAGR,EAAS;GAAO,GAAGK,EAAK;EAAM;EACjD,EAAO,QAAQA,EAAK,SAAS,iBAAiBA,EAAK,QAC/CG,IACA;GAAE,GAAGA;GAAO,aAAaC,EAAqCD,EAAM,OAAO;EAAE;CACnF;CAUA,OARA,AACEF,EAAO,mBADH,sBAAsBD,IAEjBA,EAAK,qBAAqB,QAAQE,EAAcF,EAAK,gBAAgB,IACpDA,EAAK,mBAEL;EAAE,GAAGL,EAAS;EAAkB,GAAGK,EAAK;CAAiB,IAJzDL,EAAS,kBAO9BM;AACT;AAQA,IAAaI,IAAiF,CAAC,UAAU,MAAM,GAGlGC,IAA6C,CAAC,GAAGD,GAAyB,GAAGE,CAAe"}
1
+ {"version":3,"file":"props.js","names":[],"sources":["../../../src/canvas/SceneCanvas/props.ts"],"sourcesContent":["import type { ModeRegistry } from '@weasel-js/modes';\nimport type { PathEditHost, PathEditOpening } from './pathEditHost';\nimport type { SceneCanvasGeometry } from './geometryProps';\nimport type { SceneCanvasHit, SceneCanvasPointerProps } from './pointerProps';\nimport type { Paint } from '@weasel-js/paint';\nimport type { ActionsProp, ActionTunings } from '@weasel-js/routing';\nimport { Yoke } from '@weasel-js/routing/react';\nimport type { PasteOmission } from 'core/adapters/types';\nimport type { Op } from 'core/ops/types';\nimport type { Node, Scene, SerializedScene } from 'core/scene/types';\nimport type { SelectionApi, UseSelectionOptions } from 'core/selection/useSelection';\nimport { KIT_SHAPE_KINDS, type BuiltinShapeToolId } from 'core/shapeKinds';\nimport type { ContentHandlerEntry } from 'features/ingestion';\nimport type { SceneCanvasSnap } from 'features/snap/types';\nimport type { SvgIngestOptions } from 'interactions/actions/depSchema';\nimport type { GeometryProjection } from 'interactions/actions/geometryProjection';\nimport type { UseMoveOptions } from 'interactions/actions/move/options';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport type { UseRotateOptions } from 'interactions/actions/rotate/options';\nimport type { ReactNode } from 'react';\nimport type { Animator } from '@weasel-js/animator';\nimport type { PoseTransitionSeat } from '../../animation/poseTransition';\nimport { HANDLE_BASE_PX } from '../../core/device/targets';\nimport type { DeviceProfile } from '../../core/device/types';\nimport type { NodeRoutingEntry } from '../../core/scene/NodeRouting';\nimport type { DebugConfig } from '../../debug/types';\nimport type { LayoutDropTargetMode, ReflowTransition } from '../../layout/types';\nimport type { FlattenTolerance, ShaderProgramHandle } from '@weasel-js/renderer';\nimport type { Tool, ToolsApi } from '../../tools/overlayBinding';\nimport type { SceneSlotConfig } from '../buildSceneLayer';\nimport type { CanvasProps } from '../Canvas';\nimport type { LayersMap } from '../layerSlots';\nimport type { CanvasViewProps } from '../CanvasView';\nimport type { InsertNodeFactory, InsertPaint } from '../deps';\nimport type { SurfaceContribution } from '../surfaceContribution';\nimport type { CameraProps } from '../useCanvasView';\nimport type { FeatureEntry } from './features';\nimport type { BuiltinToolOptions } from './useBuiltinShapeTools';\nimport type { VersionCheck } from './useContributionRoles';\nimport type { SceneCanvasViewport } from './viewportProp';\n\n/** The adapter surface delete / duplicate / group / ungroup need, narrowed from\n * `SceneCanvasAdapter` because `useSceneStandardActions` is non-generic. */\nexport interface BridgeAdapter {\n applyOps(ops: Op[], label?: string): void;\n insertNode(node: { id: string; [k: string]: unknown }): void;\n removeNode(id: string): void;\n setSelection(ids: string[]): void;\n}\n\n/** Default size in CSS pixels for selection corner-handles AND their\n * hit-test radius, at `targetScale = 1`. Deliberately unscaled; kit-internal\n * use sites multiply by `DeviceProfile.targetScale`. */\nexport const DEFAULT_HANDLE_SIZE = HANDLE_BASE_PX;\n\n/** `<SceneCanvas longPress>`. */\nexport interface SceneCanvasLongPress {\n /**\n * Shown while a long-press is held and some binding would fire on it.\n * Default: a ring that fills around the press point\n * (`createLongPressFeedbackContribution()`), static under\n * `prefers-reduced-motion`. `false` shows nothing; a contribution replaces\n * it, reading the `longPress` dep. Installed beside `ambient`, so under a\n * `tools` takeover add it to your own `useTools` call instead.\n */\n feedback?: boolean | SurfaceContribution;\n /** Default true. A long-press some binding handled pulses\n * `navigator.vibrate` briefly, for touch and pen, where the API exists. */\n haptics?: boolean;\n /** Hold time in ms. Default `LONG_PRESS_MS` (500). */\n duration?: number;\n}\n\n/** `<SceneCanvas layers>`: a {@link LayersMap} whose scene slot may be partial,\n * since the defaults fill in whatever it leaves out. */\nexport type SceneCanvasLayers<TNode extends { id: string }, TPose> = LayersMap<\n TNode,\n TPose,\n Partial<SceneSlotConfig<TNode, TPose>>\n>;\n\n/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop\n * is supplied, via `defaultTools`. */\nexport type BuiltinToolId = 'select' | 'hand' | BuiltinShapeToolId | 'slice' | 'bone' | 'weight';\n\n/** Every built-in tool id, in palette order: the navigation tools, the shape\n * tools of the `core/shapeKinds` table, then the knife and the rig tools. */\nexport const BUILTIN_TOOL_IDS: readonly BuiltinToolId[] = ['select', 'hand', ...KIT_SHAPE_KINDS, 'slice', 'bone', 'weight'];\n\nexport type { SceneCanvasHit };\n\n/** Props for `<SceneCanvas>`. A scene is the only thing it needs. With nothing\n * else it renders that scene and keeps a selection no input sets; `features`\n * turns behavior on by preset, and the rest configures what those turn on. */\nexport type SceneCanvasProps<TData, TLayer extends string, TPose> =\n Omit<\n CanvasProps<TPose>,\n | 'adapter' | 'boundsOf' | 'selection' | 'tools'\n | 'viewState' // SceneCanvas makes the camera from the view props below\n | 'layers' // stripped so we can re-add as optional below\n | 'getIsVisible' // SceneCanvas synthesizes this from chromeVisibility\n | 'contentVersion' // SceneCanvas wires this to the scene's own version\n | 'layerVisibility' | 'layerOrder' // re-declared below: they gate picking here too\n | 'debug' // re-declared below with SceneCanvas's own `slops`\n > & CameraProps\n & {\n /** A `Scene` (typically from `useScene`) — or a `SerializedScene` JSON\n * object, which SceneCanvas bakes into a Scene on first render. The\n * serialized form is read once; pass a `key` on `<SceneCanvas>` to force\n * a fresh canvas from updated JSON.\n *\n * The JSON shape is relaxed (`version: number` rather than the `1`\n * literal) so an `import json from './x.json'` result satisfies the type\n * without an `as` cast. */\n scene:\n | Scene<TData, TLayer, TPose>\n | SerializedScene<TData, TLayer, TPose>\n | { version: number; systemLayers?: ReadonlyArray<{ id: string }>; nodes: ReadonlyArray<unknown> };\n\n /** Layer configuration. When omitted, SceneCanvas applies kit defaults\n * (a scene slot that paints `node.data.fill` rects + a default\n * selection overlay). A partial scene or selection-overlay config is\n * spread over that slot's defaults; pass `slot: null` to suppress a\n * default explicitly. */\n layers?: SceneCanvasLayers<Node<TData, TLayer, TPose>, TPose>;\n\n /** Which layout container a drag lands in when several contain the drop\n * point — the innermost (default), the topmost in paint order, or only\n * containers whose strategy declares a `dropRegion`. Decides both the\n * drag-time reflow preview and the commit. */\n layoutDropTarget?: LayoutDropTargetMode;\n\n /** Carries the siblings a layout reflow displaces to their slots over time\n * instead of snapping them — `useAnimatedReflow` builds one. Covers a\n * drag's reflow and every one the scene records (an insert, delete,\n * reorder or resize inside a laid-out container). Absent or `null`,\n * they snap. */\n reflowTransition?: ReflowTransition<TPose> | null;\n\n /** Glides what is shown when the scene writes a pose — a `scene.setPose`, an undo — and sees\n * removed nodes off with `exit`. Absent or `null`, writes snap. See {@link PoseTransitionSeat}. */\n poseTransition?: PoseTransitionSeat<TPose> | null;\n\n /**\n * Lets pose-transform actions (move, resize, nudge, flip — NOT rotate) also rewrite a\n * node's data-held geometry. Given a node and the affine `m` applied to its pose,\n * `transform(node, m)` returns updated `data`, or `null` for nodes with no data-held\n * geometry. When absent, the kit emits only the pose op and leaves `data` untouched.\n *\n * @see GeometryProjection\n */\n geometryProjection?: GeometryProjection;\n\n /**\n * Routing-trait classifiers. The kit builds a `NodeRouting` registry per `<SceneCanvas>`\n * from this prop and uses it to derive each hit's `kind`, which tool routing tables\n * (e.g. `{ target: 'rect', actionId: 'move' }`) match against. Pass `defaultNodeRouting`\n * for the kit's built-in shape kinds; spread additional entries for consumer-defined\n * kinds.\n *\n * **Memoize the `routing` value.** The registry is memoized on the prop's reference\n * identity: a fresh array each render rebuilds it and cascades into a new adapter,\n * churning gesture state.\n */\n routing?: readonly NodeRoutingEntry[];\n\n /** How to read and rewrite this scene's poses. Every built-in action,\n * the selection chrome and picking read it. Default `AUTO_POSE_DESCRIPTOR`\n * (rect poses and `Path` poses). */\n poseDescriptor?: PoseDescriptor<TPose>;\n\n // --- Geometry: hit-test + bounds overrides consumed by the internal\n // `useSelectTool`. Ignored if the consumer passes their own `tools`. ---\n geometry?: SceneCanvasGeometry;\n\n // --- Selection options. `pickBest` and `handleHitRadius` configure the\n // internal select tool, and are ignored under a `tools` takeover;\n // `move`, `resize` and `rotate` configure the `move`,\n // `resize` and `rotate` presets, and apply either way. ---\n selectTool?: {\n move?: UseMoveOptions<TPose>;\n resize?: UseResizeOptions<TPose>;\n /** Rotation options, or `false` to disable rotation entirely — drops the\n * `rotate` action AND hides the selection rotation-handle chrome. */\n rotate?: UseRotateOptions<TPose> | false;\n handleHitRadius?: number;\n /** Override the body-pick used on click/pointerdown. Alt-aware: receives\n * the live alt state + current selection so consumers can implement\n * alt-cycling through an overlapping stack. Default: top-most hit\n * (alt ignored). */\n pickBest?: (worldX: number, worldY: number, alt: boolean, sel: readonly string[]) => string | null;\n };\n\n /** Consumer node factories for the `insert` action, keyed by tool `kind`.\n * Each factory receives the drag AABB + tool `extras` and returns the\n * node's `data` (in this canvas's own data shape) plus an optional `pose`.\n * A factory for a kit kind (`rect`, `line`, …) replaces the kit's default\n * `{ path, fill }` node for that kind; a factory for a novel kind (e.g.\n * `text`) adds insert support the kit doesn't ship. The dep supplies id,\n * layer, and the undoable op. Return `null` to reject an insert. */\n insertNodeFactories?: Record<string, InsertNodeFactory>;\n\n /** The fill, stroke, and fill rule a kit-built shape is inserted with, by\n * tool `kind` and insert count; the kit keeps the geometry. Default\n * `paletteInsertPaint`, the kit palette in turn. A kind with a factory in\n * `insertNodeFactories` is not asked. */\n insertPaint?: InsertPaint;\n\n /** External-content ingestion (OS drop / clipboard paste / picker).\n *\n * - `handlers` — consumer content handlers registered for this canvas's\n * lifetime (priority 0 by default — they beat the kit's `image/*` /\n * `image/svg+xml` handlers at -100/-90).\n * - `resolveSrc` — overrides the image handler's `data:`-URI embed (e.g.\n * upload to an asset store, return the URL).\n * - `svg.unpack` — makes the kit SVG handler parse dropped SVG files into\n * native scene nodes instead of one embedded-image node each.\n * - `clipboard` — the kit weasel-JSON paste handler, enabled by default.\n * `reviver` restores JSON-unfriendly values the copying side encoded via\n * `jsonReplacer`. `enabled: false` opts the canvas out, but the kit\n * handler still consumes weasel-matching items and declines them inert\n * rather than letting them fall through. Also governs Cmd/Ctrl+V under\n * the `edit` preset; the rest takes the `ingest` preset.\n *\n * Memoize `handlers` and `clipboard.reviver`: an inline array literal\n * re-registers the handlers on every render. */\n ingestion?: {\n handlers?: ContentHandlerEntry[];\n resolveSrc?: (file: File) => Promise<string>;\n svg?: SvgIngestOptions;\n clipboard?: {\n reviver?: (key: string, value: unknown) => unknown;\n enabled?: boolean;\n /** Called when a paste left copied nodes out, with each one and the\n * reason. `useClipboardOps` takes the same callback as\n * `onPasteOmitted` for a paste from its own in-memory copy. */\n onOmitted?: (omitted: PasteOmission[]) => void;\n };\n };\n\n selection?: SelectionApi;\n selectionOptions?: UseSelectionOptions;\n\n /**\n * `false` stops the canvas writing the selection: no click, marquee,\n * lasso, action or tool, and no op committed through the adapter it hands\n * its tools. The consumer's own `SelectionApi` — the `selection` prop, or\n * `useSelection({ scene })` — still writes, and the canvas draws what it\n * holds. Undo and redo still restore the selection each history entry\n * recorded. Default `true`.\n *\n * Click policy (whether shift-click extends) is the selection's `mode`:\n * `useSelection({ mode: 'multi' })`, or `selectionOptions={{ mode: 'multi' }}`\n * for the selection the canvas builds itself.\n */\n selectable?: boolean;\n\n /**\n * Behavior presets to turn on, composable in any combination. A canvas\n * with none renders its scene and keeps a selection (the `selection` API\n * works) that no input sets: no tools, no standard actions or their keys,\n * no clipboard, no drop or paste, and no selection chrome. The dispatcher\n * is still mounted, so bindings a consumer adds work.\n *\n * - `view` — wheel pan and zoom, pinch, the zoom keys, and the hand tool\n * (H, or hold Space). Passing `viewport` implies it.\n * - `select` — the select tool, as the initial active tool and Escape's\n * return target: click to pick, drag on empty to marquee, click on empty\n * to clear.\n * - `outline` — the selection outline, whichever tool sets the selection.\n * - `pick` — `select` and `outline`.\n * - `move` — drag a body to move it, Alt-drag to clone it. Ambient, so it\n * runs under any tool that does not claim the drag.\n * - `resize` — resize handles, drawn and bound.\n * - `rotate` — the rotation handle, drawn and bound.\n * - `transform` — `resize` and `rotate`.\n * - `edit` — undo/redo, delete, duplicate, group/ungroup, nudge,\n * select-all, Escape, cancel-gesture, cut/copy/paste, fill and stroke,\n * and their keys. Cmd/Ctrl+V pastes nodes a kit canvas copied, from\n * this tab or another, and nothing else.\n * - `arrange` — align, distribute, reorder, flip.\n * - `paths` — pathfinder operations, path-edit entry and anchor editing.\n * - `ingest` — dropped and pasted content: images, SVG, files, and\n * whatever `ingestion.handlers` accept, on Cmd/Ctrl+V or an OS drop.\n * - `draw` — all of the above.\n *\n * Any `FeaturePreset` object goes beside the names: core's own\n * (`pathsPreset`), or one a package ships.\n * Tools add the actions they bind — a shape tool brings `insert` — so\n * `defaultTools` composes with any preset. `actions` then adds, overrides\n * or removes on top of what the presets registered.\n */\n features?: readonly FeatureEntry[];\n\n /** Extra tools or overrides keyed by id, or a full `ToolsApi` takeover.\n *\n * **Patch form** (`Record<string, Tool | true | false>`): merged\n * into the built-in registry on top of whatever `defaultTools` and\n * `features` already selected.\n * - `true` pulls in the built-in for this id (`'pen'`, `'lasso'`,\n * `'hand'`, …), the same as listing it in `defaultTools`. Unknown\n * built-in ids warn in dev and are ignored.\n * - `Tool` adds a new id or replaces an existing one\n * (dev-only warning on replace).\n * - `false` omits a bundled tool entirely.\n * Auto-wiring (keybindings, dispatcher, action registry) still runs.\n *\n * **Takeover form** (`ToolsApi`): the internal registry is bypassed and\n * this `tools` value is forwarded to Canvas as-is — the consumer owns\n * active-slot management, and `pick`'s select tool is theirs to supply.\n * Every other preset still applies. Keybindings are still auto-wired\n * against the supplied registry; pass `enableKeybindings={false}` to opt\n * out. */\n tools?: ToolsApi | Record<string, Tool | true | false>;\n\n /**\n * Auto-wire keyboard shortcuts. Default `true`. When `false`, SceneCanvas still mounts\n * its tools but routes no keyboard input to them — neither tool hotkeys nor\n * keyboard-bound actions like delete / escape / nudge. Pointer, wheel, and contextmenu\n * interactions are unaffected.\n */\n enableKeybindings?: boolean;\n\n /**\n * Take the keyboard on mount, as a press in the canvas would. A key that\n * reaches the page goes to the canvas the user last pressed or scrolled\n * in, and to no canvas before the first such interaction, so a canvas in a\n * side panel does not take Space from a page that wants it. An app whose\n * canvas is the page sets this so its shortcuts work before the first\n * click. Default `false`.\n */\n claimKeys?: boolean;\n\n /**\n * Auto-mount the gesture dispatcher (`useGestureDispatcher`). Default `true`. `false` is\n * for tests or demos that drive actions another way, or that call\n * `useGestureDispatcher` themselves.\n */\n enableGestureDispatcher?: boolean;\n\n /** Called with the `ToolsApi` SceneCanvas constructs or receives, whenever its identity\n * changes. For introspection. */\n onToolsCreated?: (tools: ToolsApi) => void;\n\n /**\n * Built-in tools SceneCanvas registers in its internal `useTools`, on top\n * of the ones presets bring (`select` from `pick`, `hand` from `view`).\n * Default: none. Each tool also registers the kit actions it binds, so\n * `['rect']` brings `insert`. Ignored when the consumer supplies their own\n * `tools` prop.\n */\n defaultTools?: readonly BuiltinToolId[];\n\n /** Per-tool option overrides for the built-in tools. Each entry is a\n * narrow subset of the underlying hook's options surface — `lasso.mode`,\n * `rig.state`, etc. */\n toolOptions?: BuiltinToolOptions;\n /** What gestures snap to, and how near it pulls. */\n snap?: SceneCanvasSnap;\n\n /** Initial active-slot tool id. Default: `'select'` when it is\n * registered, otherwise none — a canvas can run on ambient bindings\n * alone. Must be one of the registered tools. Ignored when the consumer\n * supplies their own `tools` prop. */\n initialActiveTool?: string;\n\n /** Always-on entries to register alongside the internal tools — every one\n * a `SurfaceContribution`, whose views, deps, overlay, bindings, actions\n * and `attach` all install from this one list, and uninstall when the\n * entry leaves it. A tool is a contribution too, so one can go here. If\n * you supply your own `tools` prop, this is ignored — wire `ambient`\n * through your own `useTools` call instead. */\n ambient?: readonly SurfaceContribution[];\n\n /** What an entry's `requires` does when the running kit does not meet\n * it: `'warn'` (the default) logs in development, `'strict'` throws,\n * `'off'` skips the check. */\n versionCheck?: VersionCheck;\n\n /** Touch and pen long-press: its hold time, its haptic, and the\n * feedback shown while it is held. */\n longPress?: SceneCanvasLongPress;\n\n /** Configures the `view` preset, and implies it. See {@link SceneCanvasViewport}. */\n viewport?: SceneCanvasViewport;\n\n /**\n * Tune actions on this canvas without restating them, keyed by action id:\n * `params` every invocation starts from, and `bindings` added beside the\n * action's own. A tuning applies to whichever descriptor holds the id, a\n * preset's or a tool's. Pass a stable object; a params thunk is read on\n * every call. See the core README (\"Tuning an action\").\n */\n tune?: ActionTunings;\n\n /**\n * Replace, add or mute whole action descriptors. Pass `null` to disable\n * all defaults. To change a built-in's params or add a key, use `tune`.\n */\n actions?: ActionsProp;\n\n /**\n * Given a scene node, return a short human-readable \"kind\" label (e.g. `'rectangle'`,\n * `'sticky note'`), which the kit publishes per id into any surrounding\n * `<SelectionContextProvider>`. Return `undefined` to skip an entry. When omitted,\n * containers report `'group'`, poses with a `kind` property report `'path'`, and\n * everything else is left unlabelled.\n */\n describeKind?: (node: Node<TData, TLayer, TPose>) => string | undefined;\n\n /**\n * Animator to bind for per-frame redraws. SceneCanvas requests a redraw on every active\n * animation frame and paints `animator.colorOverrides` onto the scene's nodes: the\n * kit's path and shape painters apply them, and a custom `drawOne` receives them as\n * `ctx.vertexColors`.\n */\n animator?: Animator;\n\n /**\n * Extra views on this canvas: each is a camera over a rect of the same\n * surface, drawn through one GL context, with input routed to it. The flat\n * `view` / `onViewChange` props above stay the canvas's own camera — view\n * zero — and are unaffected by anything declared here.\n *\n * Order is paint and hit order, low to high. Each entry is a\n * `<CanvasView>`; mounting one as a child is the same declaration, and\n * children land after every entry here.\n */\n views?: readonly CanvasViewProps[];\n\n /**\n * Children rendered alongside the canvas, inside its input scope (e.g.\n * shortcuts overlays, probes).\n */\n children?: ReactNode;\n\n /** A yoke to join, from `useYoke()`: canvases on one yoke share the active tool, the gesture\n * in flight and history. Omitted, this canvas keeps its own. */\n yoke?: Yoke;\n\n /**\n * Chrome-caps visibility overrides, keyed by chrome id (`selection.outline`,\n * `selection.rotation-handle`, `gesture.marquee`, …). Each entry is a composable\n * {@link Condition} built from the `cond()` builder, merged on top of the kit's\n * `defaultVisibilityRules`. Set an id to `never` to suppress a chrome element\n * entirely (also unhittable), or to `always` to force-show.\n */\n chromeVisibility?: import('features/chrome-caps').VisibilityRules;\n\n /**\n * The app's mode registry (`createModeRegistry` in `@weasel-js/modes`).\n * The canvas reads the active mode from it to gate chrome, tool\n * activation and the dispatcher's eligibility filter, repaints when it\n * switches, and hands every registered mode to the dev-time route-conflict\n * check. Omitted, the canvas behaves as the kit's normal mode and nothing\n * revokes anchor editing.\n */\n modes?: ModeRegistry;\n\n /** Hands which path is being anchor-edited to the host. See {@link PathEditHost}. */\n pathEdit?: PathEditHost;\n /** A path to open in anchor edit as the canvas mounts, with anchors selected. Read once. */\n defaultPathEdit?: PathEditOpening;\n\n /**\n * Override detected device facts. Merged over what `matchMedia` reports;\n * `targetScale` is re-derived from the merged `coarsePointer` unless you\n * override it explicitly.\n */\n device?: Partial<DeviceProfile>;\n\n /**\n * Live focus getter for chrome-caps' `focused` ctx field, for visibility rules that\n * read the `focused` atom (the kit's default `selection.rotation-handle` rule does).\n * Omit to default `focused` to `true`.\n */\n getFocused?: () => boolean;\n\n /** Custom shader programs to compile on the renderer. See `CanvasProps.shaders`. */\n shaders?: ShaderProgramHandle[];\n\n /** Flatness tolerance for curve tessellation. See `CanvasProps.flattenTolerance`. */\n flattenTolerance?: FlattenTolerance;\n\n /** Fill for the full canvas behind the scene, drawn as a screen-space layer slotted\n * before `'scene'` — independent of pan / zoom. */\n backgroundFill?: Paint;\n /** Dev HUD: a fixed-position widget showing live cursor coords in both viewport\n * (client) and canvas (world) frames. */\n cursorCoordsHud?: boolean;\n /** Dev HUD: a fixed-position widget listing the ids `pickEvery(world)` returns under\n * the cursor. */\n pickHud?: boolean;\n /**\n * The debug overlay: `<Canvas debug>`'s config, plus `slops: true` for\n * translucent halos at every affordance hit zone. `false` turns it off;\n * absent reads `?debug=…` from the URL, as `<Canvas>` does.\n */\n debug?: (DebugConfig & { slops?: boolean }) | false;\n /**\n * Dev HUD: when true (or object), mounts a fixed-position widget below\n * the pick HUD showing the active modality mode, active-slot tool, and\n * hotkey stack. Pass `{ modeId }` to populate the mode line.\n */\n modalityHud?: boolean | { modeId?: string };\n\n /**\n * Per-id alpha multiplier for the scene-render slot: each node's draw output is wrapped\n * in a group with the returned alpha, and 1 emits no wrapper. Typical use: dimming\n * non-active nodes during a mode transition.\n */\n alphaFor?: (id: string) => number;\n\n /**\n * Show or hide render layers in this canvas's own view, by id — the map\n * `<Canvas>` takes. Each scene layer paints as its own render layer, keyed\n * `scene:<layerId>`, so `{ 'scene:guides': false }` hides one scene layer\n * here and nowhere else.\n *\n * A layer hidden this way is gone from this view: it does not paint, and a\n * click, a marquee or Cmd+A here passes over it. Another view of the same\n * scene — a `<CanvasView>`, a second canvas, a minimap — still shows it and\n * can still take it. It applies on top of the scene's own\n * `LayerRecord.visible` and cannot show a layer the scene hides.\n */\n layerVisibility?: Record<string, boolean>;\n\n /**\n * Draw order for this view, by render-layer id, bottom first. A listed\n * order is the whole list: a scene layer left out of it is neither painted\n * nor picked here. See `CanvasProps.layerOrder`.\n */\n layerOrder?: string[];\n } & SceneCanvasPointerProps;\n"],"mappings":";;;;;;;;AAsDA,IAAa,sBAAsB;;;AAkCnC,IAAa,mBAA6C;CAAC;CAAU;CAAQ,GAAG;CAAiB;CAAS;CAAQ;AAAQ"}
@@ -0,0 +1,58 @@
1
+ import { toPlane } from "../../core/viewport/parallax.js";
2
+ import { findShapeInk, shapeCoversPoint } from "../NodeShape.js";
3
+ import { poseContains, poseContainsRotated } from "./poseGeometry.js";
4
+ import { applyToPoint, meanScale, pathContainsPoint } from "@weasel-js/geom";
5
+
6
+ //#region src/canvas/SceneCanvas/scenePointQuery.ts
7
+ /** The point query `<SceneCanvas>`'s default pick asks: a world point with
8
+ * `pickTolerancePx` of screen slop, refined to the painter's ink when
9
+ * `shapePicking` is on. */
10
+ function scenePointQuery(d, shapePicking, pickTolerancePx) {
11
+ const pointQuery = (px, py, s) => {
12
+ const scale = meanScale(s);
13
+ const tolerance = {
14
+ px: pickTolerancePx,
15
+ scale: s
16
+ };
17
+ return {
18
+ hits: (n, pose, derived) => {
19
+ const ink = shapePicking ? findShapeInk(n, pose, { scale }) : null;
20
+ const slop = {
21
+ ...tolerance,
22
+ px: tolerance.px + (ink?.outsetPx ?? 0),
23
+ reach: ink?.outset ?? 0
24
+ };
25
+ if (!(derived ? poseContains(derived, px, py, slop, d) : poseContainsRotated(pose, px, py, slop, d))) return false;
26
+ return !shapePicking || shapeCoversPoint(n, pose, px, py, {
27
+ tolerance,
28
+ scale,
29
+ derivedPath: derived
30
+ });
31
+ },
32
+ clipAdmits: (clip) => pathContainsPoint(clip, px, py),
33
+ inPlane: (m) => {
34
+ const p = toPlane(m, {
35
+ x: px,
36
+ y: py
37
+ });
38
+ return pointQuery(p.x, p.y, {
39
+ x: s.x / m.scale.x,
40
+ y: s.y / m.scale.y
41
+ });
42
+ },
43
+ inCopy: (m) => {
44
+ const [x, y] = applyToPoint(m, px, py);
45
+ const k = Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2]));
46
+ return pointQuery(x, y, {
47
+ x: s.x / k,
48
+ y: s.y / k
49
+ });
50
+ }
51
+ };
52
+ };
53
+ return pointQuery;
54
+ }
55
+
56
+ //#endregion
57
+ export { scenePointQuery };
58
+ //# sourceMappingURL=scenePointQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenePointQuery.js","names":[],"sources":["../../../src/canvas/SceneCanvas/scenePointQuery.ts"],"sourcesContent":["import { applyToPoint, meanScale, pathContainsPoint } from '@weasel-js/geom';\nimport type { PickQuery } from 'canvas/pickWalk';\nimport { findShapeInk, shapeCoversPoint } from 'canvas/NodeShape';\nimport { toPlane } from 'core/viewport/parallax';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport { poseContains, poseContainsRotated } from './poseGeometry';\n\n/** The point query `<SceneCanvas>`'s default pick asks: a world point with\n * `pickTolerancePx` of screen slop, refined to the painter's ink when\n * `shapePicking` is on. */\nexport function scenePointQuery<TPose>(\n d: PoseDescriptor<unknown>,\n shapePicking: boolean,\n pickTolerancePx: number,\n): (px: number, py: number, s: { x: number; y: number }) => PickQuery<TPose> {\n // `s` makes the slop a screen distance, so the grab zone stays the same\n // apparent thickness at any zoom and on every axis. A `{ px }` stroke's\n // reach is on screen too, and joins the slop there.\n const pointQuery = (px: number, py: number, s: { x: number; y: number }): PickQuery<TPose> => {\n const scale = meanScale(s);\n const tolerance = { px: pickTolerancePx, scale: s };\n return {\n hits: (n, pose, derived) => {\n // The pre-filter has to be at least as generous as the refinement\n // that follows it, or it rejects points the refinement would have\n // claimed. A stroke reaches past the pose box by `outset` — a whole\n // stroke width for an outer align — on top of the pointer slop.\n const ink = shapePicking ? findShapeInk(n as never, pose, { scale }) : null;\n // A derived node's pose is a placeholder — typically zero-sized at\n // the origin — so its own box rejects every point the path covers.\n // The path is the region to test instead, and `poseContains` already\n // reads a path-like pose as one.\n const slop = { ...tolerance, px: tolerance.px + (ink?.outsetPx ?? 0), reach: ink?.outset ?? 0 };\n const admitted = derived\n ? poseContains(derived as never, px, py, slop, d as PoseDescriptor<unknown>)\n : poseContainsRotated(pose, px, py, slop, d as PoseDescriptor<unknown>);\n if (!admitted) return false;\n // `shapeCoversPoint` narrows the rect to the ink the painter actually\n // lays down (and answers `true` for painters that have no silhouette,\n // so nothing becomes unpickable).\n return !shapePicking\n || shapeCoversPoint(n as never, pose, px, py, {\n tolerance, scale, derivedPath: derived,\n });\n },\n clipAdmits: (clip) => pathContainsPoint(clip, px, py),\n inPlane: (m) => {\n const p = toPlane(m, { x: px, y: py });\n return pointQuery(p.x, p.y, { x: s.x / m.scale.x, y: s.y / m.scale.y });\n },\n inCopy: (m) => {\n const [x, y] = applyToPoint(m, px, py);\n const k = Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2]));\n return pointQuery(x, y, { x: s.x / k, y: s.y / k });\n },\n };\n };\n return pointQuery;\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,gBACd,GACA,cACA,iBAC2E;CAI3E,MAAM,cAAc,IAAY,IAAY,MAAkD;EAC5F,MAAM,QAAQ,UAAU,CAAC;EACzB,MAAM,YAAY;GAAE,IAAI;GAAiB,OAAO;EAAE;EAClD,OAAO;GACL,OAAO,GAAG,MAAM,YAAY;IAK1B,MAAM,MAAM,eAAe,aAAa,GAAY,MAAM,EAAE,MAAM,CAAC,IAAI;IAKvE,MAAM,OAAO;KAAE,GAAG;KAAW,IAAI,UAAU,MAAM,KAAK,YAAY;KAAI,OAAO,KAAK,UAAU;IAAE;IAI9F,IAAI,EAHa,UACb,aAAa,SAAkB,IAAI,IAAI,MAAM,CAA4B,IACzE,oBAAoB,MAAM,IAAI,IAAI,MAAM,CAA4B,IACzD,OAAO;IAItB,OAAO,CAAC,gBACH,iBAAiB,GAAY,MAAM,IAAI,IAAI;KAC5C;KAAW;KAAO,aAAa;IACjC,CAAC;GACL;GACA,aAAa,SAAS,kBAAkB,MAAM,IAAI,EAAE;GACpD,UAAU,MAAM;IACd,MAAM,IAAI,QAAQ,GAAG;KAAE,GAAG;KAAI,GAAG;IAAG,CAAC;IACrC,OAAO,WAAW,EAAE,GAAG,EAAE,GAAG;KAAE,GAAG,EAAE,IAAI,EAAE,MAAM;KAAG,GAAG,EAAE,IAAI,EAAE,MAAM;IAAE,CAAC;GACxE;GACA,SAAS,MAAM;IACb,MAAM,CAAC,GAAG,KAAK,aAAa,GAAG,IAAI,EAAE;IACrC,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;IACvD,OAAO,WAAW,GAAG,GAAG;KAAE,GAAG,EAAE,IAAI;KAAG,GAAG,EAAE,IAAI;IAAE,CAAC;GACpD;EACF;CACF;CACA,OAAO;AACT"}
@@ -0,0 +1,59 @@
1
+ import { SHAPE_COUNT_RANGE, STAR_RATIO_RANGE } from "../../features/paths/shapeGenerator.js";
2
+ import { decimal } from "@weasel-js/quantity";
3
+
4
+ //#region src/canvas/SceneCanvas/shapeGeneratorProperties.ts
5
+ var WHOLE = decimal({
6
+ maxPlaces: 2,
7
+ grouping: false
8
+ });
9
+ /**
10
+ * The rows that edit a polygon's or a star's `data.generator`, each shown only
11
+ * on a node holding that kind's generator. A write to one regenerates the
12
+ * shape through the entry's `settle` (`settleShapeGenerator`).
13
+ */
14
+ var SHAPE_GENERATOR_SECTIONS = {
15
+ polygon: {
16
+ name: "Polygon",
17
+ showIf: { path: "data.generator.sides" },
18
+ members: { "data.generator.sides": {
19
+ kind: "number",
20
+ display: WHOLE,
21
+ name: "Sides",
22
+ description: "Number of sides.",
23
+ default: 6,
24
+ min: SHAPE_COUNT_RANGE.min,
25
+ max: SHAPE_COUNT_RANGE.max,
26
+ step: 1
27
+ } }
28
+ },
29
+ star: {
30
+ name: "Star",
31
+ showIf: { path: "data.generator.points" },
32
+ members: {
33
+ "data.generator.points": {
34
+ kind: "number",
35
+ display: WHOLE,
36
+ name: "Points",
37
+ description: "Number of points.",
38
+ default: 5,
39
+ min: SHAPE_COUNT_RANGE.min,
40
+ max: SHAPE_COUNT_RANGE.max,
41
+ step: 1
42
+ },
43
+ "data.generator.innerRadiusRatio": {
44
+ kind: "number",
45
+ name: "Inner",
46
+ description: "Inner radius as a fraction of the outer one.",
47
+ default: .5,
48
+ min: STAR_RATIO_RANGE.min,
49
+ max: STAR_RATIO_RANGE.max,
50
+ step: .01,
51
+ control: "slider"
52
+ }
53
+ }
54
+ }
55
+ };
56
+
57
+ //#endregion
58
+ export { SHAPE_GENERATOR_SECTIONS };
59
+ //# sourceMappingURL=shapeGeneratorProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapeGeneratorProperties.js","names":[],"sources":["../../../src/canvas/SceneCanvas/shapeGeneratorProperties.ts"],"sourcesContent":["import type { PrefSection } from '@weasel-js/prefs';\nimport { decimal } from '@weasel-js/quantity';\nimport { SHAPE_COUNT_RANGE, STAR_RATIO_RANGE } from 'features/paths/shapeGenerator';\n\nconst WHOLE = decimal({ maxPlaces: 2, grouping: false });\n\n/**\n * The rows that edit a polygon's or a star's `data.generator`, each shown only\n * on a node holding that kind's generator. A write to one regenerates the\n * shape through the entry's `settle` (`settleShapeGenerator`).\n */\nexport const SHAPE_GENERATOR_SECTIONS: Record<string, PrefSection> = {\n polygon: {\n name: 'Polygon',\n showIf: { path: 'data.generator.sides' },\n members: {\n 'data.generator.sides': {\n kind: 'number', display: WHOLE, name: 'Sides', description: 'Number of sides.',\n default: 6, min: SHAPE_COUNT_RANGE.min, max: SHAPE_COUNT_RANGE.max, step: 1,\n },\n },\n },\n star: {\n name: 'Star',\n showIf: { path: 'data.generator.points' },\n members: {\n 'data.generator.points': {\n kind: 'number', display: WHOLE, name: 'Points', description: 'Number of points.',\n default: 5, min: SHAPE_COUNT_RANGE.min, max: SHAPE_COUNT_RANGE.max, step: 1,\n },\n 'data.generator.innerRadiusRatio': {\n kind: 'number', name: 'Inner', description: 'Inner radius as a fraction of the outer one.',\n default: 0.5, min: STAR_RATIO_RANGE.min, max: STAR_RATIO_RANGE.max, step: 0.01, control: 'slider',\n },\n },\n },\n};\n"],"mappings":";;;;AAIA,IAAM,QAAQ,QAAQ;CAAE,WAAW;CAAG,UAAU;AAAM,CAAC;;;;;;AAOvD,IAAa,2BAAwD;CACnE,SAAS;EACP,MAAM;EACN,QAAQ,EAAE,MAAM,uBAAuB;EACvC,SAAS,EACP,wBAAwB;GACtB,MAAM;GAAU,SAAS;GAAO,MAAM;GAAS,aAAa;GAC5D,SAAS;GAAG,KAAK,kBAAkB;GAAK,KAAK,kBAAkB;GAAK,MAAM;EAC5E,EACF;CACF;CACA,MAAM;EACJ,MAAM;EACN,QAAQ,EAAE,MAAM,wBAAwB;EACxC,SAAS;GACP,yBAAyB;IACvB,MAAM;IAAU,SAAS;IAAO,MAAM;IAAU,aAAa;IAC7D,SAAS;IAAG,KAAK,kBAAkB;IAAK,KAAK,kBAAkB;IAAK,MAAM;GAC5E;GACA,mCAAmC;IACjC,MAAM;IAAU,MAAM;IAAS,aAAa;IAC5C,SAAS;IAAK,KAAK,iBAAiB;IAAK,KAAK,iBAAiB;IAAK,MAAM;IAAM,SAAS;GAC3F;EACF;CACF;AACF"}
@@ -1,23 +1,38 @@
1
- import { IS_DEV as e } from "./isDev.js";
2
- import { featureToolIds as t } from "./features.js";
3
- import { BUILTIN_TOOL_IDS as n } from "./props.js";
1
+ import { presetBuiltinTools, presetOwnTools } from "./features.js";
2
+ import { BUILTIN_TOOL_IDS } from "./props.js";
3
+ import { isDev } from "@weasel-js/react";
4
+
4
5
  //#region src/canvas/SceneCanvas/toolRegistry.ts
5
- function r(r) {
6
- let { builtins: i, defaultTools: a = [], enabled: o, patch: s, dev: c = e } = r, l = {}, u = t(o);
7
- for (let e of n) {
8
- let t = s?.[e];
9
- t !== !1 && (t === !0 || a.includes(e) || u.has(e)) && (l[e] = i[e]);
6
+ /**
7
+ * The tool registry a canvas mounts when it is not handed a whole `ToolsApi`.
8
+ *
9
+ * Built-ins come first, in `BUILTIN_TOOL_IDS` order whatever order they were
10
+ * asked for in, then the presets' own tools in preset order; a patch tool
11
+ * replaces a mounted one where it stands, and any other is appended in patch
12
+ * order. That order is the palette's.
13
+ */
14
+ function resolveToolRegistry(args) {
15
+ const { builtins, defaultTools = [], enabled, patch, dev = isDev() } = args;
16
+ const registry = {};
17
+ const preset = presetBuiltinTools(enabled);
18
+ for (const id of BUILTIN_TOOL_IDS) {
19
+ const patched = patch?.[id];
20
+ if (patched === false) continue;
21
+ if (patched === true || defaultTools.includes(id) || preset.has(id)) registry[id] = builtins[id];
10
22
  }
11
- for (let [e, t] of Object.entries(s ?? {})) if (t !== !1) {
12
- if (t === !0) {
13
- c && !n.includes(e) && console.warn(`[SceneCanvas] tools.${e}=true is not a known built-in id; ignoring`);
23
+ for (const [id, tool] of Object.entries(presetOwnTools(enabled))) if (patch?.[id] !== false) registry[id] = tool;
24
+ for (const [id, value] of Object.entries(patch ?? {})) {
25
+ if (value === false) continue;
26
+ if (value === true) {
27
+ if (dev && !BUILTIN_TOOL_IDS.includes(id)) console.warn(`[SceneCanvas] tools.${id}=true is not a known built-in id; ignoring`);
14
28
  continue;
15
29
  }
16
- c && e in l && console.warn(`[SceneCanvas] tools prop overrides bundled "${e}" tool`), l[e] = t;
30
+ if (dev && id in registry) console.warn(`[SceneCanvas] tools prop overrides bundled "${id}" tool`);
31
+ registry[id] = value;
17
32
  }
18
- return l;
33
+ return registry;
19
34
  }
20
- //#endregion
21
- export { r as resolveToolRegistry };
22
35
 
36
+ //#endregion
37
+ export { resolveToolRegistry };
23
38
  //# sourceMappingURL=toolRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolRegistry.js","names":["resolveToolRegistry","IS_DEV","args","registry","preset","featureToolIds","enabled","id","BUILTIN_TOOL_IDS","patched","patch","defaultTools","builtins","value","dev"],"sources":["../../../src/canvas/SceneCanvas/toolRegistry.ts"],"sourcesContent":["import type { Tool } from 'tools/overlayBinding';\nimport { featureToolIds, type BaseFeature } from './features';\nimport { IS_DEV } from './isDev';\nimport { BUILTIN_TOOL_IDS, type BuiltinToolId } from './props';\n\n/** The patch form of `<SceneCanvas tools>`: per id, `true` mounts that\n * built-in, `false` leaves it out, and a tool adds or replaces one. */\nexport type ToolsPatch = Record<string, Tool | true | false>;\n\n/** One tool per built-in id, mounted or not. */\nexport type BuiltinTools = Record<BuiltinToolId, Tool>;\n\nexport interface ResolveToolRegistryArgs {\n builtins: BuiltinTools;\n /** Built-ins asked for by id. */\n defaultTools?: readonly BuiltinToolId[];\n /** The presets the canvas runs with, each bringing the tools its\n * `FEATURE_PRESETS` row names. */\n enabled: ReadonlySet<BaseFeature>;\n patch: ToolsPatch | null;\n /** Whether to warn about a patch entry that is probably a mistake. */\n dev?: boolean;\n}\n\n/**\n * The tool registry a canvas mounts when it is not handed a whole `ToolsApi`.\n *\n * Built-ins come first, in `BUILTIN_TOOL_IDS` order whatever order they were\n * asked for in; a patch tool replaces a mounted one where it stands, and any\n * other is appended in patch order. That order is the palette's.\n */\nexport function resolveToolRegistry(args: ResolveToolRegistryArgs): Record<string, Tool> {\n const { builtins, defaultTools = [], enabled, patch, dev = IS_DEV } = args;\n const registry: Record<string, Tool> = {};\n const preset = featureToolIds(enabled);\n for (const id of BUILTIN_TOOL_IDS) {\n const patched = patch?.[id];\n if (patched === false) continue;\n const asked = patched === true || defaultTools.includes(id) || preset.has(id);\n if (asked) registry[id] = builtins[id];\n }\n for (const [id, value] of Object.entries(patch ?? {})) {\n if (value === false) continue;\n if (value === true) {\n if (dev && !(BUILTIN_TOOL_IDS as readonly string[]).includes(id)) {\n console.warn(`[SceneCanvas] tools.${id}=true is not a known built-in id; ignoring`);\n }\n continue;\n }\n if (dev && id in registry) {\n console.warn(`[SceneCanvas] tools prop overrides bundled \"${id}\" tool`);\n }\n registry[id] = value;\n }\n return registry;\n}\n"],"mappings":";;;;AA+BA,SAAgBA,EAAoB,GAAqD;CACvF,IAAM,EAAE,aAAU,kBAAe,CAAC,GAAG,YAAS,UAAO,SAAMC,MAAWC,GAChEC,IAAiC,CAAC,GAClCC,IAASC,EAAeC,CAAO;CACrC,KAAK,IAAMC,KAAMC,GAAkB;EACjC,IAAMC,IAAUC,IAAQH;EACxB,AAAIE,MAAY,OACFA,MAAY,MAAQE,EAAa,SAASJ,CAAE,KAAKH,EAAO,IAAIG,CAAE,OACjE,EAASA,KAAMK,EAASL;CACrC;CACA,KAAK,IAAM,CAACA,GAAIM,MAAU,OAAO,QAAQH,KAAS,CAAC,CAAC,GAClD,IAAIG,MAAU,IACd;MAAIA,MAAU,IAAM;GAClB,AAAIC,KAAO,CAAEN,EAAuC,SAASD,CAAE,KAC7D,QAAQ,KAAK,uBAAuBA,EAAG,2CAA2C;GAEpF;EACF;EAIA,AAHIO,KAAOP,KAAMJ,KACf,QAAQ,KAAK,+CAA+CI,EAAG,OAAO,GAExE,EAASA,KAAMM;CAJf;CAMF,OAAOV;AACT"}
1
+ {"version":3,"file":"toolRegistry.js","names":[],"sources":["../../../src/canvas/SceneCanvas/toolRegistry.ts"],"sourcesContent":["import type { Tool } from 'tools/overlayBinding';\nimport { presetBuiltinTools, presetOwnTools, type EnabledPresets } from './features';\nimport { isDev } from '@weasel-js/react';\nimport { BUILTIN_TOOL_IDS, type BuiltinToolId } from './props';\n\n/** The patch form of `<SceneCanvas tools>`: per id, `true` mounts that\n * built-in, `false` leaves it out, and a tool adds or replaces one. */\nexport type ToolsPatch = Record<string, Tool | true | false>;\n\n/** One tool per built-in id, mounted or not. */\nexport type BuiltinTools = Record<BuiltinToolId, Tool>;\n\nexport interface ResolveToolRegistryArgs {\n builtins: BuiltinTools;\n /** Built-ins asked for by id. */\n defaultTools?: readonly BuiltinToolId[];\n /** The presets the canvas runs with, each bringing the tools it names. */\n enabled: EnabledPresets;\n patch: ToolsPatch | null;\n /** Whether to warn about a patch entry that is probably a mistake. */\n dev?: boolean;\n}\n\n/**\n * The tool registry a canvas mounts when it is not handed a whole `ToolsApi`.\n *\n * Built-ins come first, in `BUILTIN_TOOL_IDS` order whatever order they were\n * asked for in, then the presets' own tools in preset order; a patch tool\n * replaces a mounted one where it stands, and any other is appended in patch\n * order. That order is the palette's.\n */\nexport function resolveToolRegistry(args: ResolveToolRegistryArgs): Record<string, Tool> {\n const { builtins, defaultTools = [], enabled, patch, dev = isDev() } = args;\n const registry: Record<string, Tool> = {};\n const preset = presetBuiltinTools(enabled);\n for (const id of BUILTIN_TOOL_IDS) {\n const patched = patch?.[id];\n if (patched === false) continue;\n const asked = patched === true || defaultTools.includes(id) || preset.has(id);\n if (asked) registry[id] = builtins[id];\n }\n for (const [id, tool] of Object.entries(presetOwnTools(enabled))) {\n if (patch?.[id] !== false) registry[id] = tool;\n }\n for (const [id, value] of Object.entries(patch ?? {})) {\n if (value === false) continue;\n if (value === true) {\n if (dev && !(BUILTIN_TOOL_IDS as readonly string[]).includes(id)) {\n console.warn(`[SceneCanvas] tools.${id}=true is not a known built-in id; ignoring`);\n }\n continue;\n }\n if (dev && id in registry) {\n console.warn(`[SceneCanvas] tools prop overrides bundled \"${id}\" tool`);\n }\n registry[id] = value;\n }\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,oBAAoB,MAAqD;CACvF,MAAM,EAAE,UAAU,eAAe,CAAC,GAAG,SAAS,OAAO,MAAM,MAAM,MAAM;CACvE,MAAM,WAAiC,CAAC;CACxC,MAAM,SAAS,mBAAmB,OAAO;CACzC,KAAK,MAAM,MAAM,kBAAkB;EACjC,MAAM,UAAU,QAAQ;EACxB,IAAI,YAAY,OAAO;EAEvB,IADc,YAAY,QAAQ,aAAa,SAAS,EAAE,KAAK,OAAO,IAAI,EAAE,GACjE,SAAS,MAAM,SAAS;CACrC;CACA,KAAK,MAAM,CAAC,IAAI,SAAS,OAAO,QAAQ,eAAe,OAAO,CAAC,GAC7D,IAAI,QAAQ,QAAQ,OAAO,SAAS,MAAM;CAE5C,KAAK,MAAM,CAAC,IAAI,UAAU,OAAO,QAAQ,SAAS,CAAC,CAAC,GAAG;EACrD,IAAI,UAAU,OAAO;EACrB,IAAI,UAAU,MAAM;GAClB,IAAI,OAAO,CAAE,iBAAuC,SAAS,EAAE,GAC7D,QAAQ,KAAK,uBAAuB,GAAG,2CAA2C;GAEpF;EACF;EACA,IAAI,OAAO,MAAM,UACf,QAAQ,KAAK,+CAA+C,GAAG,OAAO;EAExE,SAAS,MAAM;CACjB;CACA,OAAO;AACT"}
@@ -0,0 +1,20 @@
1
+ import { useEffect } from "react";
2
+ import { useActionsRegistry } from "@weasel-js/routing/react";
3
+
4
+ //#region src/canvas/SceneCanvas/useActionTunings.ts
5
+ /** Hold `tune`'s tunings on the registry in scope for as long as the object
6
+ * is the same one. */
7
+ function useActionTunings(tune) {
8
+ const reg = useActionsRegistry();
9
+ useEffect(() => {
10
+ if (!reg || !tune) return;
11
+ const releases = Object.entries(tune).flatMap(([id, t]) => t ? [reg.tune(id, t)] : []);
12
+ return () => {
13
+ for (const release of releases) release();
14
+ };
15
+ }, [reg, tune]);
16
+ }
17
+
18
+ //#endregion
19
+ export { useActionTunings };
20
+ //# sourceMappingURL=useActionTunings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActionTunings.js","names":[],"sources":["../../../src/canvas/SceneCanvas/useActionTunings.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { ActionTuning, ActionTunings } from '@weasel-js/routing';\nimport { useActionsRegistry } from '@weasel-js/routing/react';\n\n/** Hold `tune`'s tunings on the registry in scope for as long as the object\n * is the same one. */\nexport function useActionTunings(tune: ActionTunings | undefined): void {\n const reg = useActionsRegistry();\n useEffect(() => {\n if (!reg || !tune) return;\n const releases = Object.entries(tune).flatMap(([id, t]) => (t ? [reg.tune(id, t as ActionTuning)] : []));\n return () => { for (const release of releases) release(); };\n }, [reg, tune]);\n}\n"],"mappings":";;;;;;AAMA,SAAgB,iBAAiB,MAAuC;CACtE,MAAM,MAAM,mBAAmB;CAC/B,gBAAgB;EACd,IAAI,CAAC,OAAO,CAAC,MAAM;EACnB,MAAM,WAAW,OAAO,QAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,OAAQ,IAAI,CAAC,IAAI,KAAK,IAAI,CAAiB,CAAC,IAAI,CAAC,CAAE;EACvG,aAAa;GAAE,KAAK,MAAM,WAAW,UAAU,QAAQ;EAAG;CAC5D,GAAG,CAAC,KAAK,IAAI,CAAC;AAChB"}
@@ -1,53 +1,86 @@
1
- import { useEffect as e } from "react";
2
- import { useLatest as t } from "@weasel-js/react";
3
- import { useActionsRegistry as n } from "@weasel-js/routing/react";
1
+ import { useEffect } from "react";
2
+ import { useLatest } from "@weasel-js/react";
3
+ import { useActionsRegistry } from "@weasel-js/routing/react";
4
+
4
5
  //#region src/canvas/SceneCanvas/useActionsPropResolver.ts
5
- function r(r, i) {
6
- let a = n(), o = t(r);
7
- e(() => {
8
- if (!a) return;
9
- let e = o.current, t = [];
10
- if (e === null) {
11
- for (let e of a.list().map((e) => e.id)) t.push(a.mute(e));
6
+ /**
7
+ * Applies the `actions` prop overrides on top of whatever is already
8
+ * registered, so the caller mounts this hook last.
9
+ *
10
+ * actions === null → mute every currently-registered action
11
+ * actions[id] === null → mute that id
12
+ * actions[id] = partial → merge onto the existing descriptor (slot wins
13
+ * over entry.id; warns once on mismatch)
14
+ * actions[id] = full (new) → register alongside defaults
15
+ *
16
+ * `null` mutes rather than unregisters: the opt-out belongs to this canvas, so
17
+ * a sibling sharing the registry keeps the action and this canvas's unmount
18
+ * gives it back.
19
+ */
20
+ /** `rev` re-applies the overrides when it changes — pass whatever changes when
21
+ * the set they sit on is re-registered. */
22
+ function useActionsPropResolver(actions, rev) {
23
+ const reg = useActionsRegistry();
24
+ const actionsRef = useLatest(actions);
25
+ useEffect(() => {
26
+ if (!reg) return;
27
+ const prop = actionsRef.current;
28
+ const unregisters = [];
29
+ if (prop === null) {
30
+ for (const id of reg.list().map((a) => a.id)) unregisters.push(reg.mute(id));
12
31
  return () => {
13
- for (let e of t) e();
32
+ for (const u of unregisters) u();
14
33
  };
15
34
  }
16
- if (!e) return;
17
- let n = /* @__PURE__ */ new Set();
18
- for (let [r, i] of Object.entries(e)) {
19
- if (i === null) {
20
- t.push(a.mute(r));
35
+ if (!prop) return;
36
+ const warnedIds = /* @__PURE__ */ new Set();
37
+ for (const [slotId, entry] of Object.entries(prop)) {
38
+ if (entry === null) {
39
+ unregisters.push(reg.mute(slotId));
21
40
  continue;
22
41
  }
23
- let e = (e) => typeof e.id == "string" && typeof e.label == "string" && !!e.invoker, o = a.list().find((e) => e.id === r);
24
- if (!o) {
25
- e(i) ? t.push(a.register(i)) : n.has(r) || (n.add(r), console.warn(`weasel actions resolver: actions["${r}"] is a partial Action but no default with this id exists. Pass a complete {id, label, invoker} descriptor.`));
42
+ const isFull = (e) => typeof e.id === "string" && typeof e.label === "string" && !!e.invoker;
43
+ const existing = reg.list().find((a) => a.id === slotId);
44
+ if (!existing) {
45
+ if (isFull(entry)) unregisters.push(reg.register(entry));
46
+ else if (!warnedIds.has(slotId)) {
47
+ warnedIds.add(slotId);
48
+ console.warn(`weasel actions resolver: actions["${slotId}"] is a partial Action but no default with this id exists. Pass a complete {id, label, invoker} descriptor.`);
49
+ }
26
50
  continue;
27
51
  }
28
- i.id !== void 0 && i.id !== r && !n.has(`mismatch:${r}`) && (n.add(`mismatch:${r}`), console.warn(`weasel actions resolver: actions["${r}"].id="${i.id}" mismatches the slot key. Ignoring the id field; the action remains at id="${r}".`));
29
- let { id: s, ...c } = i, l = {
30
- ...o,
31
- ...c
52
+ if (entry.id !== void 0 && entry.id !== slotId && !warnedIds.has(`mismatch:${slotId}`)) {
53
+ warnedIds.add(`mismatch:${slotId}`);
54
+ console.warn(`weasel actions resolver: actions["${slotId}"].id="${entry.id}" mismatches the slot key. Ignoring the id field; the action remains at id="${slotId}".`);
55
+ }
56
+ const { id: _drop, ...rest } = entry;
57
+ const merged = {
58
+ ...existing,
59
+ ...rest
32
60
  };
33
- t.push(a.register(l));
61
+ unregisters.push(reg.register(merged));
34
62
  }
35
63
  return () => {
36
- for (let e of t) e();
64
+ for (const u of unregisters) u();
37
65
  };
38
66
  }, [
39
- a,
40
- r,
41
- o,
42
- i
67
+ reg,
68
+ actions,
69
+ actionsRef,
70
+ rev
43
71
  ]);
44
72
  }
45
- function i(e, t) {
46
- if (e === null) return null;
47
- let n = { ...e ?? {} };
48
- return t in n || (n[t] = null), n;
73
+ /**
74
+ * `actions` with `id` muted. A caller's own entry for `id` still wins, and
75
+ * `null` (every default muted) is left as it is.
76
+ */
77
+ function actionsMuting(actions, id) {
78
+ if (actions === null) return null;
79
+ const merged = { ...actions ?? {} };
80
+ if (!(id in merged)) merged[id] = null;
81
+ return merged;
49
82
  }
50
- //#endregion
51
- export { i as actionsMuting, r as useActionsPropResolver };
52
83
 
84
+ //#endregion
85
+ export { actionsMuting, useActionsPropResolver };
53
86
  //# sourceMappingURL=useActionsPropResolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useActionsPropResolver.js","names":["useActionsPropResolver","reg","useActionsRegistry","actionsRef","useLatest","actions","prop","unregisters","id","a","u","warnedIds","slotId","entry","isFull","existing","_drop","rest","merged","rev","actionsMuting"],"sources":["../../../src/canvas/SceneCanvas/useActionsPropResolver.ts"],"sourcesContent":["/**\n * Applies the `actions` prop overrides on top of whatever is already\n * registered, so the caller mounts this hook last.\n *\n * actions === null → mute every currently-registered action\n * actions[id] === null → mute that id\n * actions[id] = partial → merge onto the existing descriptor (slot wins\n * over entry.id; warns once on mismatch)\n * actions[id] = full (new) → register alongside defaults\n *\n * `null` mutes rather than unregisters: the opt-out belongs to this canvas, so\n * a sibling sharing the registry keeps the action and this canvas's unmount\n * gives it back.\n */\nimport { useEffect } from 'react';\nimport type { ActionsProp } from '@weasel-js/routing';\nimport { useActionsRegistry } from '@weasel-js/routing/react';\nimport { useLatest } from '@weasel-js/react';\nimport type { Action } from '@weasel-js/routing';\n\n/** `rev` re-applies the overrides when it changes — pass whatever changes when\n * the set they sit on is re-registered. */\nexport function useActionsPropResolver(actions: ActionsProp | undefined, rev?: string): void {\n const reg = useActionsRegistry();\n const actionsRef = useLatest(actions);\n\n useEffect(() => {\n if (!reg) return;\n const prop = actionsRef.current;\n\n const unregisters: Array<() => void> = [];\n\n if (prop === null) {\n for (const id of reg.list().map((a) => a.id)) unregisters.push(reg.mute(id));\n return () => { for (const u of unregisters) u(); };\n }\n\n if (!prop) return;\n\n const warnedIds = new Set<string>();\n\n for (const [slotId, entry] of Object.entries(prop)) {\n if (entry === null) {\n unregisters.push(reg.mute(slotId));\n continue;\n }\n\n const isFull = (e: Partial<Action>): e is Action =>\n typeof e.id === 'string' && typeof e.label === 'string' && !!e.invoker;\n const existing = reg.list().find((a) => a.id === slotId);\n\n if (!existing) {\n if (isFull(entry)) {\n unregisters.push(reg.register(entry));\n } else if (!warnedIds.has(slotId)) {\n warnedIds.add(slotId);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"] is a partial Action but no default ` +\n `with this id exists. Pass a complete {id, label, invoker} descriptor.`,\n );\n }\n continue;\n }\n\n if (entry.id !== undefined && entry.id !== slotId && !warnedIds.has(`mismatch:${slotId}`)) {\n warnedIds.add(`mismatch:${slotId}`);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"].id=\"${entry.id as string}\" mismatches the slot key. ` +\n `Ignoring the id field; the action remains at id=\"${slotId}\".`,\n );\n }\n const { id: _drop, ...rest } = entry;\n void _drop;\n const merged: Action = { ...existing, ...rest };\n // No explicit restore: `register` stacks, so popping `merged` uncovers\n // the descriptor it displaced. Re-registering `existing` here would push\n // a stale snapshot back on top and never take it off again.\n unregisters.push(reg.register(merged));\n }\n\n return () => { for (const u of unregisters) u(); };\n }, [reg, actions, actionsRef, rev]);\n}\n\n/**\n * `actions` with `id` muted. A caller's own entry for `id` still wins, and\n * `null` (every default muted) is left as it is.\n */\nexport function actionsMuting(actions: ActionsProp | undefined, id: string): ActionsProp {\n if (actions === null) return null;\n const merged = { ...(actions ?? {}) } as Record<string, unknown>;\n if (!(id in merged)) merged[id] = null;\n return merged as ActionsProp;\n}\n"],"mappings":";;;;AAsBA,SAAgBA,EAAuB,GAAkC,GAAoB;CAC3F,IAAMC,IAAMC,EAAmB,GACzBC,IAAaC,EAAUC,CAAO;CAEpC,QAAgB;EACd,IAAI,CAACJ,GAAK;EACV,IAAMK,IAAOH,EAAW,SAElBI,IAAiC,CAAC;EAExC,IAAID,MAAS,MAAM;GACjB,KAAK,IAAME,KAAMP,EAAI,KAAK,CAAC,CAAC,KAAK,MAAMQ,EAAE,EAAE,GAAG,EAAY,KAAKR,EAAI,KAAKO,CAAE,CAAC;GAC3E,aAAa;IAAE,KAAK,IAAME,KAAKH,GAAa,EAAE;GAAG;EACnD;EAEA,IAAI,CAACD,GAAM;EAEX,IAAMK,oBAAY,IAAI,IAAY;EAElC,KAAK,IAAM,CAACC,GAAQC,MAAU,OAAO,QAAQP,CAAI,GAAG;GAClD,IAAIO,MAAU,MAAM;IAClB,EAAY,KAAKZ,EAAI,KAAKW,CAAM,CAAC;IACjC;GACF;GAEA,IAAME,KAAU,MACd,OAAO,EAAE,MAAO,YAAY,OAAO,EAAE,SAAU,YAAY,CAAC,CAAC,EAAE,SAC3DC,IAAWd,EAAI,KAAK,CAAC,CAAC,MAAM,MAAMQ,EAAE,OAAOG,CAAM;GAEvD,IAAI,CAACG,GAAU;IACb,AAAID,EAAOD,CAAK,IACdN,EAAY,KAAKN,EAAI,SAASY,CAAK,CAAC,IAC1BF,EAAU,IAAIC,CAAM,MAC9BD,EAAU,IAAIC,CAAM,GACpB,QAAQ,KACN,qCAAqCA,EAAO,4GAE9C;IAEF;GACF;GAEA,AAAIC,EAAM,OAAO,KAAA,KAAaA,EAAM,OAAOD,KAAU,CAACD,EAAU,IAAI,YAAYC,GAAQ,MACtFD,EAAU,IAAI,YAAYC,GAAQ,GAClC,QAAQ,KACN,qCAAqCA,EAAO,SAASC,EAAM,GAAa,8EACpBD,EAAO,GAC7D;GAEF,IAAM,EAAE,IAAII,GAAO,GAAGC,MAASJ,GAEzBK,IAAiB;IAAE,GAAGH;IAAU,GAAGE;GAAK;GAI9C,EAAY,KAAKhB,EAAI,SAASiB,CAAM,CAAC;EACvC;EAEA,aAAa;GAAE,KAAK,IAAMR,KAAKH,GAAa,EAAE;EAAG;CACnD,GAAG;EAACN;EAAKI;EAASF;EAAYgB;CAAG,CAAC;AACpC;AAMA,SAAgBC,EAAc,GAAkC,GAAyB;CACvF,IAAIf,MAAY,MAAM,OAAO;CAC7B,IAAMa,IAAS,EAAE,GAAIb,KAAW,CAAC,EAAG;CAEpC,OADMG,KAAMU,MAAS,EAAOV,KAAM,OAC3BU;AACT"}
1
+ {"version":3,"file":"useActionsPropResolver.js","names":[],"sources":["../../../src/canvas/SceneCanvas/useActionsPropResolver.ts"],"sourcesContent":["/**\n * Applies the `actions` prop overrides on top of whatever is already\n * registered, so the caller mounts this hook last.\n *\n * actions === null → mute every currently-registered action\n * actions[id] === null → mute that id\n * actions[id] = partial → merge onto the existing descriptor (slot wins\n * over entry.id; warns once on mismatch)\n * actions[id] = full (new) → register alongside defaults\n *\n * `null` mutes rather than unregisters: the opt-out belongs to this canvas, so\n * a sibling sharing the registry keeps the action and this canvas's unmount\n * gives it back.\n */\nimport { useEffect } from 'react';\nimport type { ActionsProp } from '@weasel-js/routing';\nimport { useActionsRegistry } from '@weasel-js/routing/react';\nimport { useLatest } from '@weasel-js/react';\nimport type { Action } from '@weasel-js/routing';\n\n/** `rev` re-applies the overrides when it changes — pass whatever changes when\n * the set they sit on is re-registered. */\nexport function useActionsPropResolver(actions: ActionsProp | undefined, rev?: string): void {\n const reg = useActionsRegistry();\n const actionsRef = useLatest(actions);\n\n useEffect(() => {\n if (!reg) return;\n const prop = actionsRef.current;\n\n const unregisters: Array<() => void> = [];\n\n if (prop === null) {\n for (const id of reg.list().map((a) => a.id)) unregisters.push(reg.mute(id));\n return () => { for (const u of unregisters) u(); };\n }\n\n if (!prop) return;\n\n const warnedIds = new Set<string>();\n\n for (const [slotId, entry] of Object.entries(prop)) {\n if (entry === null) {\n unregisters.push(reg.mute(slotId));\n continue;\n }\n\n const isFull = (e: Partial<Action>): e is Action =>\n typeof e.id === 'string' && typeof e.label === 'string' && !!e.invoker;\n const existing = reg.list().find((a) => a.id === slotId);\n\n if (!existing) {\n if (isFull(entry)) {\n unregisters.push(reg.register(entry));\n } else if (!warnedIds.has(slotId)) {\n warnedIds.add(slotId);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"] is a partial Action but no default ` +\n `with this id exists. Pass a complete {id, label, invoker} descriptor.`,\n );\n }\n continue;\n }\n\n if (entry.id !== undefined && entry.id !== slotId && !warnedIds.has(`mismatch:${slotId}`)) {\n warnedIds.add(`mismatch:${slotId}`);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"].id=\"${entry.id as string}\" mismatches the slot key. ` +\n `Ignoring the id field; the action remains at id=\"${slotId}\".`,\n );\n }\n const { id: _drop, ...rest } = entry;\n void _drop;\n const merged: Action = { ...existing, ...rest };\n // No explicit restore: `register` stacks, so popping `merged` uncovers\n // the descriptor it displaced. Re-registering `existing` here would push\n // a stale snapshot back on top and never take it off again.\n unregisters.push(reg.register(merged));\n }\n\n return () => { for (const u of unregisters) u(); };\n }, [reg, actions, actionsRef, rev]);\n}\n\n/**\n * `actions` with `id` muted. A caller's own entry for `id` still wins, and\n * `null` (every default muted) is left as it is.\n */\nexport function actionsMuting(actions: ActionsProp | undefined, id: string): ActionsProp {\n if (actions === null) return null;\n const merged = { ...(actions ?? {}) } as Record<string, unknown>;\n if (!(id in merged)) merged[id] = null;\n return merged as ActionsProp;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,uBAAuB,SAAkC,KAAoB;CAC3F,MAAM,MAAM,mBAAmB;CAC/B,MAAM,aAAa,UAAU,OAAO;CAEpC,gBAAgB;EACd,IAAI,CAAC,KAAK;EACV,MAAM,OAAO,WAAW;EAExB,MAAM,cAAiC,CAAC;EAExC,IAAI,SAAS,MAAM;GACjB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,KAAK,MAAM,EAAE,EAAE,GAAG,YAAY,KAAK,IAAI,KAAK,EAAE,CAAC;GAC3E,aAAa;IAAE,KAAK,MAAM,KAAK,aAAa,EAAE;GAAG;EACnD;EAEA,IAAI,CAAC,MAAM;EAEX,MAAM,4BAAY,IAAI,IAAY;EAElC,KAAK,MAAM,CAAC,QAAQ,UAAU,OAAO,QAAQ,IAAI,GAAG;GAClD,IAAI,UAAU,MAAM;IAClB,YAAY,KAAK,IAAI,KAAK,MAAM,CAAC;IACjC;GACF;GAEA,MAAM,UAAU,MACd,OAAO,EAAE,OAAO,YAAY,OAAO,EAAE,UAAU,YAAY,CAAC,CAAC,EAAE;GACjE,MAAM,WAAW,IAAI,KAAK,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,MAAM;GAEvD,IAAI,CAAC,UAAU;IACb,IAAI,OAAO,KAAK,GACd,YAAY,KAAK,IAAI,SAAS,KAAK,CAAC;SAC/B,IAAI,CAAC,UAAU,IAAI,MAAM,GAAG;KACjC,UAAU,IAAI,MAAM;KACpB,QAAQ,KACN,qCAAqC,OAAO,4GAE9C;IACF;IACA;GACF;GAEA,IAAI,MAAM,OAAO,UAAa,MAAM,OAAO,UAAU,CAAC,UAAU,IAAI,YAAY,QAAQ,GAAG;IACzF,UAAU,IAAI,YAAY,QAAQ;IAClC,QAAQ,KACN,qCAAqC,OAAO,SAAS,MAAM,GAAa,8EACpB,OAAO,GAC7D;GACF;GACA,MAAM,EAAE,IAAI,OAAO,GAAG,SAAS;GAE/B,MAAM,SAAiB;IAAE,GAAG;IAAU,GAAG;GAAK;GAI9C,YAAY,KAAK,IAAI,SAAS,MAAM,CAAC;EACvC;EAEA,aAAa;GAAE,KAAK,MAAM,KAAK,aAAa,EAAE;EAAG;CACnD,GAAG;EAAC;EAAK;EAAS;EAAY;CAAG,CAAC;AACpC;;;;;AAMA,SAAgB,cAAc,SAAkC,IAAyB;CACvF,IAAI,YAAY,MAAM,OAAO;CAC7B,MAAM,SAAS,EAAE,GAAI,WAAW,CAAC,EAAG;CACpC,IAAI,EAAE,MAAM,SAAS,OAAO,MAAM;CAClC,OAAO;AACT"}
@@ -0,0 +1,17 @@
1
+ import { isSerializedScene } from "../../core/scene/serialization.js";
2
+ import { sceneFromJSON } from "../../core/scene/scene.js";
3
+ import { useState } from "react";
4
+
5
+ //#region src/canvas/SceneCanvas/useBakedScene.ts
6
+ /**
7
+ * `scene` accepts either a live `Scene` or a `SerializedScene` JSON object. JSON is baked
8
+ * once; later prop changes are ignored (use a `key` on `<SceneCanvas>` to force a fresh canvas).
9
+ */
10
+ function useBakedScene(sceneInput) {
11
+ const [bakedScene] = useState(() => isSerializedScene(sceneInput) ? sceneFromJSON(sceneInput, {}) : null);
12
+ return bakedScene ?? sceneInput;
13
+ }
14
+
15
+ //#endregion
16
+ export { useBakedScene };
17
+ //# sourceMappingURL=useBakedScene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBakedScene.js","names":[],"sources":["../../../src/canvas/SceneCanvas/useBakedScene.ts"],"sourcesContent":["import { useState } from 'react';\nimport { sceneFromJSON } from 'core/scene/scene';\nimport { isSerializedScene } from 'core/scene/serialization';\nimport type { Scene } from 'core/scene/types';\nimport type { SceneCanvasProps } from './props';\n\n/**\n * `scene` accepts either a live `Scene` or a `SerializedScene` JSON object. JSON is baked\n * once; later prop changes are ignored (use a `key` on `<SceneCanvas>` to force a fresh canvas).\n */\nexport function useBakedScene<TData, TLayer extends string, TPose>(\n sceneInput: SceneCanvasProps<TData, TLayer, TPose>['scene'],\n): Scene<TData, TLayer, TPose> {\n const [bakedScene] = useState<Scene<TData, TLayer, TPose> | null>(\n () => (isSerializedScene<TData, TLayer, TPose>(sceneInput) ? sceneFromJSON(sceneInput, {}) : null),\n );\n return bakedScene ?? (sceneInput as Scene<TData, TLayer, TPose>);\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,cACd,YAC6B;CAC7B,MAAM,CAAC,cAAc,eACZ,kBAAwC,UAAU,IAAI,cAAc,YAAY,CAAC,CAAC,IAAI,IAC/F;CACA,OAAO,cAAe;AACxB"}