@weasel-js/core 1.9.4 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1191) hide show
  1. package/CHANGELOG.md +918 -0
  2. package/README.md +38 -3
  3. package/dist/WeaselProvider.js +5 -7
  4. package/dist/WeaselProvider.js.map +1 -1
  5. package/dist/affordances/composeAffordanceLayer.js +92 -84
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -1
  7. package/dist/affordances/cornerResize.js +3 -2
  8. package/dist/affordances/cornerResize.js.map +1 -1
  9. package/dist/affordances/hitAffordanceRegions.js +71 -101
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  11. package/dist/affordances/pathAnchors.js +50 -28
  12. package/dist/affordances/pathAnchors.js.map +1 -1
  13. package/dist/affordances/rotateCursor.js +12 -0
  14. package/dist/affordances/rotateCursor.js.map +1 -0
  15. package/dist/affordances/rotationHandle.js +44 -46
  16. package/dist/affordances/rotationHandle.js.map +1 -1
  17. package/dist/animation/behaviors/coast.js +21 -0
  18. package/dist/animation/behaviors/coast.js.map +1 -0
  19. package/dist/animation/behaviors/coastByWrite.js +107 -0
  20. package/dist/animation/behaviors/coastByWrite.js.map +1 -0
  21. package/dist/animation/behaviors/coastOnTargets.js +94 -0
  22. package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
  23. package/dist/animation/behaviors/momentum.js +48 -136
  24. package/dist/animation/behaviors/momentum.js.map +1 -1
  25. package/dist/animation/clipTargets.js +12 -0
  26. package/dist/animation/clipTargets.js.map +1 -0
  27. package/dist/animation/index.js +15 -20
  28. package/dist/animation/poseHelpers.js +112 -33
  29. package/dist/animation/poseHelpers.js.map +1 -1
  30. package/dist/animation/poseTarget.js +115 -0
  31. package/dist/animation/poseTarget.js.map +1 -0
  32. package/dist/animation/reflow.js +113 -83
  33. package/dist/animation/reflow.js.map +1 -1
  34. package/dist/animation/rewind.js +66 -0
  35. package/dist/animation/rewind.js.map +1 -0
  36. package/dist/animation/rig/bindRig.js +85 -53
  37. package/dist/animation/rig/bindRig.js.map +1 -1
  38. package/dist/animation/rig/rigNode.js +99 -0
  39. package/dist/animation/rig/rigNode.js.map +1 -0
  40. package/dist/animation/rig/rigSeat.js +59 -0
  41. package/dist/animation/rig/rigSeat.js.map +1 -0
  42. package/dist/animation/rig/skinBinding.js +64 -0
  43. package/dist/animation/rig/skinBinding.js.map +1 -0
  44. package/dist/animation/rig/useRig.js +31 -16
  45. package/dist/animation/rig/useRig.js.map +1 -1
  46. package/dist/animation/wrappers/animateLifecycle.js +8 -7
  47. package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
  48. package/dist/animation/wrappers/animateOnSetPose.js +31 -31
  49. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
  50. package/dist/animation/wrappers/instantPose.js.map +1 -1
  51. package/dist/animation/writtenPoseTarget.js +33 -0
  52. package/dist/animation/writtenPoseTarget.js.map +1 -0
  53. package/dist/autoPoseDescriptor-DHg5KqaJ.d.ts +27 -0
  54. package/dist/barrel/canvas.js +32 -0
  55. package/dist/barrel/chrome.js +10 -10
  56. package/dist/barrel/input.js +16 -17
  57. package/dist/barrel/interactions.js +34 -37
  58. package/dist/barrel/paint.js +11 -18
  59. package/dist/barrel/paths.js +13 -19
  60. package/dist/barrel/renderer.js +14 -20
  61. package/dist/barrel/routing.js +54 -47
  62. package/dist/barrel/scene.js +37 -0
  63. package/dist/barrel/text.js +9 -18
  64. package/dist/barrel/viewport.js +44 -51
  65. package/dist/canvas/Canvas.js +270 -475
  66. package/dist/canvas/Canvas.js.map +1 -1
  67. package/dist/canvas/CanvasView.js +168 -190
  68. package/dist/canvas/CanvasView.js.map +1 -1
  69. package/dist/canvas/CursorCoordsHud.js +24 -25
  70. package/dist/canvas/CursorCoordsHud.js.map +1 -1
  71. package/dist/canvas/DrawCanvas.js +39 -56
  72. package/dist/canvas/DrawCanvas.js.map +1 -1
  73. package/dist/canvas/ModalityHud.js.map +1 -1
  74. package/dist/canvas/NodeShape.js +28 -29
  75. package/dist/canvas/NodeShape.js.map +1 -1
  76. package/dist/canvas/PickHud.js.map +1 -1
  77. package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
  78. package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
  79. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +66 -107
  80. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -1
  81. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +33 -36
  82. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  83. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +38 -50
  84. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -1
  85. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +3 -3
  86. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -1
  87. package/dist/canvas/SceneCanvas/coordTrace.js +37 -1
  88. package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -1
  89. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +319 -270
  90. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  91. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -1
  92. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
  93. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
  94. package/dist/canvas/SceneCanvas/features.js +71 -62
  95. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  96. package/dist/canvas/SceneCanvas/insertPreviewCommands.js +97 -0
  97. package/dist/canvas/SceneCanvas/insertPreviewCommands.js.map +1 -0
  98. package/dist/canvas/SceneCanvas/isDev.js.map +1 -1
  99. package/dist/canvas/SceneCanvas/poseGeometry.js +33 -37
  100. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
  101. package/dist/canvas/SceneCanvas/props.js +15 -14
  102. package/dist/canvas/SceneCanvas/props.js.map +1 -1
  103. package/dist/canvas/SceneCanvas/scenePointQuery.js +50 -0
  104. package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -0
  105. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +52 -0
  106. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -0
  107. package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
  108. package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
  109. package/dist/canvas/SceneCanvas/useActionTunings.js +17 -0
  110. package/dist/canvas/SceneCanvas/useActionTunings.js.map +1 -0
  111. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
  112. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
  113. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
  114. package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
  115. package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
  116. package/dist/canvas/SceneCanvas/useCanvasCamera.js +46 -0
  117. package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
  118. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
  119. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
  120. package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
  121. package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
  122. package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
  123. package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
  124. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +49 -113
  125. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
  126. package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
  127. package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
  128. package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
  129. package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
  130. package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
  131. package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
  132. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +51 -41
  133. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
  134. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
  135. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
  136. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
  137. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
  138. package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
  139. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
  140. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
  141. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
  142. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +65 -101
  143. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  144. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
  145. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
  146. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
  147. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
  148. package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
  149. package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
  150. package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
  151. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
  152. package/dist/canvas/SceneCanvas/worldPointAt.js +8 -0
  153. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
  154. package/dist/canvas/SceneCanvas.js +301 -708
  155. package/dist/canvas/SceneCanvas.js.map +1 -1
  156. package/dist/canvas/SceneViewCanvas.js +41 -47
  157. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  158. package/dist/canvas/SurfaceCanvas.js +40 -0
  159. package/dist/canvas/SurfaceCanvas.js.map +1 -0
  160. package/dist/canvas/adapterDerivedPath.js +26 -0
  161. package/dist/canvas/adapterDerivedPath.js.map +1 -0
  162. package/dist/canvas/adapterPickSource.js +34 -0
  163. package/dist/canvas/adapterPickSource.js.map +1 -0
  164. package/dist/canvas/affordanceAt.js +12 -2
  165. package/dist/canvas/affordanceAt.js.map +1 -1
  166. package/dist/canvas/buildSceneLayer.js +81 -61
  167. package/dist/canvas/buildSceneLayer.js.map +1 -1
  168. package/dist/canvas/buildSceneTree.js +56 -34
  169. package/dist/canvas/buildSceneTree.js.map +1 -1
  170. package/dist/canvas/canvasRenderer.js +40 -44
  171. package/dist/canvas/canvasRenderer.js.map +1 -1
  172. package/dist/canvas/colorOverrides.js.map +1 -1
  173. package/dist/canvas/copiesAbove.js +27 -0
  174. package/dist/canvas/copiesAbove.js.map +1 -0
  175. package/dist/canvas/defaultDrawOne.js +25 -24
  176. package/dist/canvas/defaultDrawOne.js.map +1 -1
  177. package/dist/canvas/deps/areaSelect.js +4 -4
  178. package/dist/canvas/deps/areaSelect.js.map +1 -1
  179. package/dist/canvas/deps/debug.js.map +1 -1
  180. package/dist/canvas/deps/editAnchors.js +47 -71
  181. package/dist/canvas/deps/editAnchors.js.map +1 -1
  182. package/dist/canvas/deps/geometryProjection.js.map +1 -1
  183. package/dist/canvas/deps/hitTestArea.js +45 -25
  184. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  185. package/dist/canvas/deps/insert.js +149 -104
  186. package/dist/canvas/deps/insert.js.map +1 -1
  187. package/dist/canvas/deps/lassoSelect.js +5 -5
  188. package/dist/canvas/deps/lassoSelect.js.map +1 -1
  189. package/dist/canvas/deps/layout.js +9 -15
  190. package/dist/canvas/deps/layout.js.map +1 -1
  191. package/dist/canvas/deps/poseDescriptor.js +1 -1
  192. package/dist/canvas/deps/poseDescriptor.js.map +1 -1
  193. package/dist/canvas/deps/resizePolicy.js.map +1 -1
  194. package/dist/canvas/deps/slice.js +44 -45
  195. package/dist/canvas/deps/slice.js.map +1 -1
  196. package/dist/canvas/deps/textEdit.js +8 -8
  197. package/dist/canvas/deps/textEdit.js.map +1 -1
  198. package/dist/canvas/deps/view.js.map +1 -1
  199. package/dist/canvas/derivedPath.js +69 -43
  200. package/dist/canvas/derivedPath.js.map +1 -1
  201. package/dist/canvas/drawEnvelope.js +8 -4
  202. package/dist/canvas/drawEnvelope.js.map +1 -1
  203. package/dist/canvas/getNodeAtPoint.js +2 -6
  204. package/dist/canvas/getNodeAtPoint.js.map +1 -1
  205. package/dist/canvas/hud.module.js.map +1 -1
  206. package/dist/canvas/insertPreviewExtent.js +33 -31
  207. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  208. package/dist/canvas/layerOrder.js.map +1 -1
  209. package/dist/canvas/layerSlots.js +6 -1
  210. package/dist/canvas/layerSlots.js.map +1 -1
  211. package/dist/canvas/nodeShapes/derivedPainter.js +12 -12
  212. package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
  213. package/dist/canvas/nodeShapes/imagePainter.js +10 -10
  214. package/dist/canvas/nodeShapes/imagePainter.js.map +1 -1
  215. package/dist/canvas/nodeShapes/memo.js.map +1 -1
  216. package/dist/canvas/nodeShapes/nodePaint.js +34 -23
  217. package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
  218. package/dist/canvas/nodeShapes/pathPainter.js +23 -22
  219. package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
  220. package/dist/canvas/nodeShapes/poseBox.js +6 -6
  221. package/dist/canvas/nodeShapes/poseBox.js.map +1 -1
  222. package/dist/canvas/nodeShapes/rectFallbackPainter.js +8 -8
  223. package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
  224. package/dist/canvas/nodeShapes/shapePainter.js +16 -16
  225. package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
  226. package/dist/canvas/nodeShapes/textPainter.js +1 -1
  227. package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
  228. package/dist/canvas/overChildren.js +29 -0
  229. package/dist/canvas/overChildren.js.map +1 -0
  230. package/dist/canvas/overlayRoleStrokes.js.map +1 -1
  231. package/dist/canvas/paintCull.js +6 -8
  232. package/dist/canvas/paintCull.js.map +1 -1
  233. package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
  234. package/dist/canvas/paintedCursorLayer.js.map +1 -0
  235. package/dist/canvas/pickReach.js +23 -0
  236. package/dist/canvas/pickReach.js.map +1 -0
  237. package/dist/canvas/pickWalk.js +43 -70
  238. package/dist/canvas/pickWalk.js.map +1 -1
  239. package/dist/canvas/planeClips.js +18 -19
  240. package/dist/canvas/planeClips.js.map +1 -1
  241. package/dist/canvas/poseCascade.js +41 -0
  242. package/dist/canvas/poseCascade.js.map +1 -0
  243. package/dist/canvas/poseRotation.js +1 -3
  244. package/dist/canvas/poseRotation.js.map +1 -1
  245. package/dist/canvas/rasterReadback.js +22 -0
  246. package/dist/canvas/rasterReadback.js.map +1 -0
  247. package/dist/canvas/renderDebugSnapshot.js +12 -12
  248. package/dist/canvas/renderDebugSnapshot.js.map +1 -1
  249. package/dist/canvas/renderNeeds.js +3 -3
  250. package/dist/canvas/renderNeeds.js.map +1 -1
  251. package/dist/canvas/renderSceneToPixels.js +64 -83
  252. package/dist/canvas/renderSceneToPixels.js.map +1 -1
  253. package/dist/canvas/sceneAdapter.js +59 -144
  254. package/dist/canvas/sceneAdapter.js.map +1 -1
  255. package/dist/canvas/sceneClipboard.js +1 -1
  256. package/dist/canvas/sceneClipboard.js.map +1 -1
  257. package/dist/canvas/sceneLayerPaint.js +4 -4
  258. package/dist/canvas/sceneLayerPaint.js.map +1 -1
  259. package/dist/canvas/sceneSlotWiring.js +10 -9
  260. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  261. package/dist/canvas/sceneViewRender.js +37 -42
  262. package/dist/canvas/sceneViewRender.js.map +1 -1
  263. package/dist/canvas/slopsDebugLayer.js +4 -4
  264. package/dist/canvas/slopsDebugLayer.js.map +1 -1
  265. package/dist/canvas/useCanvasRenderer.js +23 -11
  266. package/dist/canvas/useCanvasRenderer.js.map +1 -1
  267. package/dist/canvas/useCanvasSurface.js +31 -0
  268. package/dist/canvas/useCanvasSurface.js.map +1 -0
  269. package/dist/canvas/useCanvasView.js +51 -44
  270. package/dist/canvas/useCanvasView.js.map +1 -1
  271. package/dist/canvas/useFrameLoop.js +11 -12
  272. package/dist/canvas/useFrameLoop.js.map +1 -1
  273. package/dist/canvas/useHostAnchor.js +35 -33
  274. package/dist/canvas/useHostAnchor.js.map +1 -1
  275. package/dist/canvas/useLateContentRedraw.js +8 -8
  276. package/dist/canvas/useLateContentRedraw.js.map +1 -1
  277. package/dist/canvas/useSceneAdapter.js +22 -0
  278. package/dist/canvas/useSceneAdapter.js.map +1 -0
  279. package/dist/canvas/useSceneLayerList.js +4 -14
  280. package/dist/canvas/useSceneLayerList.js.map +1 -1
  281. package/dist/canvas/useSurfaceInput.js +39 -0
  282. package/dist/canvas/useSurfaceInput.js.map +1 -0
  283. package/dist/canvas/useToolCursor.js +29 -0
  284. package/dist/canvas/useToolCursor.js.map +1 -0
  285. package/dist/canvas/useViewHelpers.js +46 -85
  286. package/dist/canvas/useViewHelpers.js.map +1 -1
  287. package/dist/canvas/viewInputs.js.map +1 -1
  288. package/dist/canvas/viewRegistry.js +40 -34
  289. package/dist/canvas/viewRegistry.js.map +1 -1
  290. package/dist/canvas/watchElementMove.js +43 -0
  291. package/dist/canvas/watchElementMove.js.map +1 -0
  292. package/dist/canvas/wrapNodeOutput.js +7 -2
  293. package/dist/canvas/wrapNodeOutput.js.map +1 -1
  294. package/dist/clipboard.d.ts +7 -14
  295. package/dist/{types-B4iJRHC3.d.ts → clone-C0eADtS0.d.ts} +129 -84
  296. package/dist/clone.d.ts +4 -8
  297. package/dist/clone.js +0 -2
  298. package/dist/core/device/targets.js.map +1 -1
  299. package/dist/core/device/useDeviceProfile.js +13 -13
  300. package/dist/core/device/useDeviceProfile.js.map +1 -1
  301. package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
  302. package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
  303. package/dist/core/geometry/pathPoseDescriptor.js +88 -0
  304. package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
  305. package/dist/core/geometry/poseDescriptor.js +102 -29
  306. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  307. package/dist/core/geometry/regionHit.js +35 -37
  308. package/dist/core/geometry/regionHit.js.map +1 -1
  309. package/dist/core/geometry/targetFrame.js +94 -0
  310. package/dist/core/geometry/targetFrame.js.map +1 -0
  311. package/dist/core/geometry/unionBounds.js +4 -5
  312. package/dist/core/geometry/unionBounds.js.map +1 -1
  313. package/dist/core/layers/backgroundFill.js +31 -0
  314. package/dist/core/layers/backgroundFill.js.map +1 -0
  315. package/dist/{features/groups → core/layers}/children.js +2 -4
  316. package/dist/core/layers/children.js.map +1 -0
  317. package/dist/{features/focus → core/layers}/gateLayer.js +2 -2
  318. package/dist/core/layers/gateLayer.js.map +1 -0
  319. package/dist/core/layers/layerGroup.js +40 -0
  320. package/dist/core/layers/layerGroup.js.map +1 -0
  321. package/dist/core/layers/render.js +50 -76
  322. package/dist/core/layers/render.js.map +1 -1
  323. package/dist/core/ops/create.js +2 -2
  324. package/dist/core/ops/create.js.map +1 -1
  325. package/dist/core/ops/createHistory.js +9 -9
  326. package/dist/core/ops/createHistory.js.map +1 -1
  327. package/dist/core/ops/delete.js +19 -23
  328. package/dist/core/ops/delete.js.map +1 -1
  329. package/dist/core/ops/reorder/index.js +3 -7
  330. package/dist/core/ops/reorder/index.js.map +1 -1
  331. package/dist/core/ops/reorder/setChildOrder.js +2 -4
  332. package/dist/core/ops/reorder/setChildOrder.js.map +1 -1
  333. package/dist/core/ops/reparent.js +0 -1
  334. package/dist/core/ops/reparent.js.map +1 -1
  335. package/dist/core/ops/slot.js +3 -6
  336. package/dist/core/ops/slot.js.map +1 -1
  337. package/dist/core/pages/fitViewToPage.js +15 -0
  338. package/dist/core/pages/fitViewToPage.js.map +1 -0
  339. package/dist/core/pages/pages.js +65 -0
  340. package/dist/core/pages/pages.js.map +1 -0
  341. package/dist/core/pages/pagesLayer.js +27 -0
  342. package/dist/core/pages/pagesLayer.js.map +1 -0
  343. package/dist/core/paint/meshKind.js +16 -0
  344. package/dist/core/paint/meshKind.js.map +1 -0
  345. package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +104 -93
  346. package/dist/core/paint/meshKindLazy.js.map +1 -0
  347. package/dist/core/paint/paintKindEntry.js +8 -0
  348. package/dist/core/paint/paintKindEntry.js.map +1 -0
  349. package/dist/core/paint/paintKinds.js +144 -0
  350. package/dist/core/paint/paintKinds.js.map +1 -0
  351. package/dist/core/paint/registerMesh.js +7 -0
  352. package/dist/core/paint/registerMesh.js.map +1 -0
  353. package/dist/core/scene/NodeProperties.js.map +1 -1
  354. package/dist/core/scene/NodeRouting.js.map +1 -1
  355. package/dist/core/scene/arrivalWindow.js +65 -64
  356. package/dist/core/scene/arrivalWindow.js.map +1 -1
  357. package/dist/core/scene/boundOps.js +40 -0
  358. package/dist/core/scene/boundOps.js.map +1 -0
  359. package/dist/core/scene/composeFrame.js +9 -6
  360. package/dist/core/scene/composeFrame.js.map +1 -1
  361. package/dist/core/scene/composePose.js +105 -0
  362. package/dist/core/scene/composePose.js.map +1 -0
  363. package/dist/core/scene/depMemo.js +31 -6
  364. package/dist/core/scene/depMemo.js.map +1 -1
  365. package/dist/core/scene/derivedPath.js +19 -20
  366. package/dist/core/scene/derivedPath.js.map +1 -1
  367. package/dist/core/scene/editMode.js +26 -0
  368. package/dist/core/scene/editMode.js.map +1 -0
  369. package/dist/core/scene/effectivePose.js +42 -39
  370. package/dist/core/scene/effectivePose.js.map +1 -1
  371. package/dist/core/scene/fieldEdits.js +98 -0
  372. package/dist/core/scene/fieldEdits.js.map +1 -0
  373. package/dist/core/scene/historyFacade.js +122 -70
  374. package/dist/core/scene/historyFacade.js.map +1 -1
  375. package/dist/core/scene/historyForm.js +6 -0
  376. package/dist/core/scene/historyForm.js.map +1 -0
  377. package/dist/core/scene/kitOps.js +83 -71
  378. package/dist/core/scene/kitOps.js.map +1 -1
  379. package/dist/core/scene/kitRegistry.js.map +1 -1
  380. package/dist/core/scene/layerStack.js +105 -12
  381. package/dist/core/scene/layerStack.js.map +1 -1
  382. package/dist/core/scene/layoutPass.js +58 -59
  383. package/dist/core/scene/layoutPass.js.map +1 -1
  384. package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
  385. package/dist/core/scene/nestedHit.js.map +1 -0
  386. package/dist/core/scene/nodeFnFields.js +16 -9
  387. package/dist/core/scene/nodeFnFields.js.map +1 -1
  388. package/dist/core/scene/nodeMemo.js.map +1 -1
  389. package/dist/core/scene/nodeStore.js +72 -71
  390. package/dist/core/scene/nodeStore.js.map +1 -1
  391. package/dist/core/scene/notifier.js +37 -0
  392. package/dist/core/scene/notifier.js.map +1 -0
  393. package/dist/core/scene/opTable.js +50 -0
  394. package/dist/core/scene/opTable.js.map +1 -0
  395. package/dist/core/scene/outerOps.js +67 -0
  396. package/dist/core/scene/outerOps.js.map +1 -0
  397. package/dist/core/scene/poseHold.js +39 -0
  398. package/dist/core/scene/poseHold.js.map +1 -0
  399. package/dist/core/scene/poseOverrides.js +44 -36
  400. package/dist/core/scene/poseOverrides.js.map +1 -1
  401. package/dist/core/scene/poseSnapshot.js.map +1 -1
  402. package/dist/core/scene/reconcileSpecs.js +4 -3
  403. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  404. package/dist/core/scene/recorder.js +86 -0
  405. package/dist/core/scene/recorder.js.map +1 -0
  406. package/dist/core/scene/renderOrder.js.map +1 -1
  407. package/dist/core/scene/scene.js +81 -690
  408. package/dist/core/scene/scene.js.map +1 -1
  409. package/dist/core/scene/sceneEdits.js +58 -0
  410. package/dist/core/scene/sceneEdits.js.map +1 -0
  411. package/dist/core/scene/sceneMutators.js +49 -0
  412. package/dist/core/scene/sceneMutators.js.map +1 -0
  413. package/dist/core/scene/scenePoseAdapter.js +16 -0
  414. package/dist/core/scene/scenePoseAdapter.js.map +1 -0
  415. package/dist/core/scene/sceneRecording.js +91 -0
  416. package/dist/core/scene/sceneRecording.js.map +1 -0
  417. package/dist/core/scene/sceneSelection.js +28 -0
  418. package/dist/core/scene/sceneSelection.js.map +1 -0
  419. package/dist/core/scene/sceneState.js +49 -0
  420. package/dist/core/scene/sceneState.js.map +1 -0
  421. package/dist/core/scene/serialization.js +8 -5
  422. package/dist/core/scene/serialization.js.map +1 -1
  423. package/dist/core/scene/staleReplay.js +51 -0
  424. package/dist/core/scene/staleReplay.js.map +1 -0
  425. package/dist/core/scene/statedFields.js +9 -0
  426. package/dist/core/scene/statedFields.js.map +1 -0
  427. package/dist/core/scene/treeEdits.js +127 -0
  428. package/dist/core/scene/treeEdits.js.map +1 -0
  429. package/dist/core/scene/treeReads.js +26 -0
  430. package/dist/core/scene/treeReads.js.map +1 -0
  431. package/dist/core/scene/types.js.map +1 -1
  432. package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
  433. package/dist/core/scene/unionOfChildren.js.map +1 -0
  434. package/dist/core/scene/unitScopes.js +13 -0
  435. package/dist/core/scene/unitScopes.js.map +1 -0
  436. package/dist/core/scene/useScene.js.map +1 -1
  437. package/dist/core/selection/readOnlySelection.js +32 -0
  438. package/dist/core/selection/readOnlySelection.js.map +1 -0
  439. package/dist/core/selection/usePublishSceneSelection.js +26 -0
  440. package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
  441. package/dist/core/selection/useSelection.js +34 -25
  442. package/dist/core/selection/useSelection.js.map +1 -1
  443. package/dist/core/shapeKinds.js.map +1 -1
  444. package/dist/core/stylus/stylus.js.map +1 -1
  445. package/dist/core/stylus/usePointerStylus.js.map +1 -1
  446. package/dist/core/usePaintKinds.js +1 -1
  447. package/dist/core/usePaintKinds.js.map +1 -1
  448. package/dist/core/viewport/clientToWorld.js.map +1 -1
  449. package/dist/core/viewport/fitViewToBounds.js.map +1 -1
  450. package/dist/core/viewport/parallax.js.map +1 -1
  451. package/dist/core/viewport/screenSlop.js +11 -11
  452. package/dist/core/viewport/screenSlop.js.map +1 -1
  453. package/dist/core/viewport/useCanvasSize.js.map +1 -1
  454. package/dist/core/viewport/useDecayLoop.js +31 -33
  455. package/dist/core/viewport/useDecayLoop.js.map +1 -1
  456. package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
  457. package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
  458. package/dist/core/viewport/useViewAnimation.js +113 -53
  459. package/dist/core/viewport/useViewAnimation.js.map +1 -1
  460. package/dist/core/viewport/view.js +14 -11
  461. package/dist/core/viewport/view.js.map +1 -1
  462. package/dist/core/viewport/wheelHandler.js.map +1 -1
  463. package/dist/core/viewport/zoomAt.js +11 -2
  464. package/dist/core/viewport/zoomAt.js.map +1 -1
  465. package/dist/{cornerHandles-CtCb8a3G.d.ts → cornerHandles-BSKbyuvQ.d.ts} +11 -24
  466. package/dist/debug/createDebugOverlayLayer.js +100 -100
  467. package/dist/debug/createDebugOverlayLayer.js.map +1 -1
  468. package/dist/debug/createDebugSink.js.map +1 -1
  469. package/dist/debug/frameStats.js.map +1 -1
  470. package/dist/debug/useDebugSink.js +52 -0
  471. package/dist/debug/useDebugSink.js.map +1 -0
  472. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
  473. package/dist/features/chrome-caps/conditions.js.map +1 -1
  474. package/dist/features/chrome-caps/defaults.js.map +1 -1
  475. package/dist/features/chrome-caps/resolve.js.map +1 -1
  476. package/dist/features/chrome-caps/useChromeCaps.js +54 -0
  477. package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
  478. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
  479. package/dist/features/ingestion/contentHandlers.js +25 -19
  480. package/dist/features/ingestion/contentHandlers.js.map +1 -1
  481. package/dist/features/ingestion/imageHandler.js +21 -24
  482. package/dist/features/ingestion/imageHandler.js.map +1 -1
  483. package/dist/features/ingestion/openFilePicker.js.map +1 -1
  484. package/dist/features/ingestion/placement.js +16 -0
  485. package/dist/features/ingestion/placement.js.map +1 -0
  486. package/dist/features/ingestion/svgHandler.js +5 -0
  487. package/dist/features/ingestion/svgHandler.js.map +1 -1
  488. package/dist/features/ingestion/textHandler.js +28 -0
  489. package/dist/features/ingestion/textHandler.js.map +1 -0
  490. package/dist/features/ingestion/useCanvasIngestion.js +48 -0
  491. package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
  492. package/dist/features/ingestion/weaselJsonHandler.js +5 -0
  493. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
  494. package/dist/features/longPress/longPressFeedback.js.map +1 -1
  495. package/dist/features/modes/modeLayers.js +7 -7
  496. package/dist/features/modes/modeLayers.js.map +1 -1
  497. package/dist/features/paths/editablePath.js +63 -0
  498. package/dist/features/paths/editablePath.js.map +1 -0
  499. package/dist/features/paths/index.js +9 -16
  500. package/dist/features/paths/pathEditState.js +41 -0
  501. package/dist/features/paths/pathEditState.js.map +1 -0
  502. package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
  503. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
  504. package/dist/features/paths/pathLayer.js +3 -2
  505. package/dist/features/paths/pathLayer.js.map +1 -1
  506. package/dist/features/paths/penPreviewLayer.js +86 -88
  507. package/dist/features/paths/penPreviewLayer.js.map +1 -1
  508. package/dist/features/paths/shapeGenerator.js +89 -0
  509. package/dist/features/paths/shapeGenerator.js.map +1 -0
  510. package/dist/features/paths/usePathEdit.js +34 -0
  511. package/dist/features/paths/usePathEdit.js.map +1 -0
  512. package/dist/features/poseRun/usePoseRun.js +44 -57
  513. package/dist/features/poseRun/usePoseRun.js.map +1 -1
  514. package/dist/features/selection/overlay.js +170 -178
  515. package/dist/features/selection/overlay.js.map +1 -1
  516. package/dist/features/text/index.js +6 -0
  517. package/dist/features/text/textLayer.js +1 -1
  518. package/dist/features/text/textLayer.js.map +1 -1
  519. package/dist/features/text/useSceneTextEdit.js +119 -88
  520. package/dist/features/text/useSceneTextEdit.js.map +1 -1
  521. package/dist/features/viewports/viewResolver.js +28 -24
  522. package/dist/features/viewports/viewResolver.js.map +1 -1
  523. package/dist/features/viewports/viewportLayer.js +25 -36
  524. package/dist/features/viewports/viewportLayer.js.map +1 -1
  525. package/dist/icons/SliceIcon.js +24 -0
  526. package/dist/icons/SliceIcon.js.map +1 -0
  527. package/dist/index.d.ts +5200 -8777
  528. package/dist/index.js +284 -320
  529. package/dist/input/keyState.js +14 -14
  530. package/dist/interactions/actions/actionShortcuts.js.map +1 -1
  531. package/dist/interactions/actions/{defaults/align.js → align/action.js} +15 -16
  532. package/dist/interactions/actions/align/action.js.map +1 -0
  533. package/dist/interactions/actions/align/align.js +24 -24
  534. package/dist/interactions/actions/align/align.js.map +1 -1
  535. package/dist/interactions/actions/booleans/action.js +65 -0
  536. package/dist/interactions/actions/booleans/action.js.map +1 -0
  537. package/dist/interactions/actions/booleans/booleans.js +74 -83
  538. package/dist/interactions/actions/booleans/booleans.js.map +1 -1
  539. package/dist/interactions/actions/booleans/operands.js +40 -0
  540. package/dist/interactions/actions/booleans/operands.js.map +1 -0
  541. package/dist/interactions/actions/booleans/pieces.js +45 -0
  542. package/dist/interactions/actions/booleans/pieces.js.map +1 -0
  543. package/dist/interactions/actions/booleans/placement.js +24 -0
  544. package/dist/interactions/actions/booleans/placement.js.map +1 -0
  545. package/dist/interactions/actions/booleans/useBooleans.js +11 -9
  546. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
  547. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
  548. package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +19 -19
  549. package/dist/interactions/actions/clipboard/action.js.map +1 -0
  550. package/dist/interactions/actions/clipboard/clipboardOps.js +15 -15
  551. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
  552. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
  553. package/dist/interactions/actions/clone/action.js +103 -0
  554. package/dist/interactions/actions/clone/action.js.map +1 -0
  555. package/dist/interactions/actions/clone/behaviors.js +52 -0
  556. package/dist/interactions/actions/clone/behaviors.js.map +1 -0
  557. package/dist/interactions/actions/defaultCommitAdapter.js +10 -37
  558. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
  559. package/dist/interactions/actions/defaults/anchorEditing.js +69 -74
  560. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  561. package/dist/interactions/actions/defaults/anchorHandles.js +42 -0
  562. package/dist/interactions/actions/defaults/anchorHandles.js.map +1 -0
  563. package/dist/interactions/actions/defaults/anchorJoin.js +92 -0
  564. package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -0
  565. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
  566. package/dist/interactions/actions/defaults/bendSegment.js +46 -0
  567. package/dist/interactions/actions/defaults/bendSegment.js.map +1 -0
  568. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
  569. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
  570. package/dist/interactions/actions/defaults/copySubtree.js +1 -1
  571. package/dist/interactions/actions/defaults/copySubtree.js.map +1 -1
  572. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
  573. package/dist/interactions/actions/defaults/delete.js.map +1 -1
  574. package/dist/interactions/actions/defaults/duplicate.js +36 -21
  575. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  576. package/dist/interactions/actions/defaults/enterPathEdit.js +19 -7
  577. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
  578. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
  579. package/dist/interactions/actions/defaults/group.js +35 -40
  580. package/dist/interactions/actions/defaults/group.js.map +1 -1
  581. package/dist/interactions/actions/defaults/icons/anchorIcons.js +75 -0
  582. package/dist/interactions/actions/defaults/icons/anchorIcons.js.map +1 -0
  583. package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
  584. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
  585. package/dist/interactions/actions/defaults/icons/editIcons.js +35 -8
  586. package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -1
  587. package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
  588. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
  589. package/dist/interactions/actions/defaults/ingest.js +19 -15
  590. package/dist/interactions/actions/defaults/ingest.js.map +1 -1
  591. package/dist/interactions/actions/defaults/insertPathAnchor.js +18 -34
  592. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  593. package/dist/interactions/actions/defaults/nudge.js +43 -39
  594. package/dist/interactions/actions/defaults/nudge.js.map +1 -1
  595. package/dist/interactions/actions/defaults/pinchZoom.js +29 -29
  596. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
  597. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
  598. package/dist/interactions/actions/defaults/segmentUnder.js +22 -0
  599. package/dist/interactions/actions/defaults/segmentUnder.js.map +1 -0
  600. package/dist/interactions/actions/defaults/setFill.js +9 -3
  601. package/dist/interactions/actions/defaults/setFill.js.map +1 -1
  602. package/dist/interactions/actions/defaults/setFillOpacity.js +4 -1
  603. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
  604. package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
  605. package/dist/interactions/actions/defaults/sliceOps.js +20 -22
  606. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
  607. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
  608. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
  609. package/dist/interactions/actions/defaults/viewportDragPan.js +1 -1
  610. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
  611. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
  612. package/dist/interactions/actions/defaults/viewportZoom.js +82 -79
  613. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
  614. package/dist/interactions/actions/{defaults/distribute.js → distribute/action.js} +18 -19
  615. package/dist/interactions/actions/distribute/action.js.map +1 -0
  616. package/dist/interactions/actions/distribute/distribute.js +15 -15
  617. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  618. package/dist/interactions/actions/edit-anchors/action.js +101 -0
  619. package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
  620. package/dist/interactions/actions/edit-anchors/geometry.js +2 -4
  621. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
  622. package/dist/interactions/actions/edit-anchors/preview.js +26 -0
  623. package/dist/interactions/actions/edit-anchors/preview.js.map +1 -0
  624. package/dist/interactions/actions/edit-anchors/symmetry.js +11 -0
  625. package/dist/interactions/actions/edit-anchors/symmetry.js.map +1 -0
  626. package/dist/interactions/actions/flip/action.js +124 -0
  627. package/dist/interactions/actions/flip/action.js.map +1 -0
  628. package/dist/interactions/actions/flip/helpers.js +1 -1
  629. package/dist/interactions/actions/flip/helpers.js.map +1 -1
  630. package/dist/interactions/actions/geometryProjection.js.map +1 -1
  631. package/dist/interactions/actions/gestureFrames.js +18 -0
  632. package/dist/interactions/actions/gestureFrames.js.map +1 -0
  633. package/dist/interactions/actions/gestureLifecycle.js +47 -20
  634. package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
  635. package/dist/interactions/actions/insert/action.js +79 -0
  636. package/dist/interactions/actions/insert/action.js.map +1 -0
  637. package/dist/interactions/actions/insert/commit.js +28 -0
  638. package/dist/interactions/actions/insert/commit.js.map +1 -0
  639. package/dist/interactions/actions/insert/extras.js +65 -0
  640. package/dist/interactions/actions/insert/extras.js.map +1 -0
  641. package/dist/interactions/actions/insert/frame.js +55 -0
  642. package/dist/interactions/actions/insert/frame.js.map +1 -0
  643. package/dist/interactions/actions/insert/geometry.js +35 -0
  644. package/dist/interactions/actions/insert/geometry.js.map +1 -0
  645. package/dist/interactions/actions/insert/repositionAction.js +31 -0
  646. package/dist/interactions/actions/insert/repositionAction.js.map +1 -0
  647. package/dist/interactions/actions/insert/rotateAction.js +21 -0
  648. package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
  649. package/dist/interactions/actions/insert/session.js +59 -0
  650. package/dist/interactions/actions/insert/session.js.map +1 -0
  651. package/dist/interactions/actions/insert/shape.js +34 -0
  652. package/dist/interactions/actions/insert/shape.js.map +1 -0
  653. package/dist/interactions/actions/lasso-select/action.js +143 -0
  654. package/dist/interactions/actions/lasso-select/action.js.map +1 -0
  655. package/dist/interactions/actions/move/action.js +91 -0
  656. package/dist/interactions/actions/move/action.js.map +1 -0
  657. package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
  658. package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
  659. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
  660. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
  661. package/dist/interactions/actions/move/behaviors/snapToContainer.js +35 -28
  662. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  663. package/dist/interactions/actions/move/capture.js +108 -0
  664. package/dist/interactions/actions/move/capture.js.map +1 -0
  665. package/dist/interactions/actions/move/commit/index.js +41 -0
  666. package/dist/interactions/actions/move/commit/index.js.map +1 -0
  667. package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
  668. package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
  669. package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
  670. package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
  671. package/dist/interactions/actions/move/commit/rebase.js +18 -0
  672. package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
  673. package/dist/interactions/actions/move/commit/reparent.js +65 -0
  674. package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
  675. package/dist/interactions/actions/move/delta.js +51 -0
  676. package/dist/interactions/actions/move/delta.js.map +1 -0
  677. package/dist/interactions/actions/move/frame.js +47 -0
  678. package/dist/interactions/actions/move/frame.js.map +1 -0
  679. package/dist/interactions/actions/move/gestureAdapter.js +15 -40
  680. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
  681. package/dist/interactions/actions/move/landedDescendants.js +8 -8
  682. package/dist/interactions/actions/move/layout/container.js +94 -0
  683. package/dist/interactions/actions/move/layout/container.js.map +1 -0
  684. package/dist/interactions/actions/move/layout/dragged.js +58 -0
  685. package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
  686. package/dist/interactions/actions/move/layout/dropPass.js +122 -0
  687. package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
  688. package/dist/interactions/actions/move/layout/exits.js +38 -0
  689. package/dist/interactions/actions/move/layout/exits.js.map +1 -0
  690. package/dist/interactions/actions/move/layout/glide.js +48 -0
  691. package/dist/interactions/actions/move/layout/glide.js.map +1 -0
  692. package/dist/interactions/actions/move/session.js +63 -0
  693. package/dist/interactions/actions/move/session.js.map +1 -0
  694. package/dist/interactions/actions/move/translate.js +61 -0
  695. package/dist/interactions/actions/move/translate.js.map +1 -0
  696. package/dist/interactions/actions/outlines/createOutlines.js +17 -64
  697. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  698. package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
  699. package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
  700. package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
  701. package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
  702. package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
  703. package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
  704. package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
  705. package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
  706. package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
  707. package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
  708. package/dist/interactions/actions/pathCommands/cutJoin.js +102 -0
  709. package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -0
  710. package/dist/interactions/actions/pathCommands/livePathEdit.js +64 -0
  711. package/dist/interactions/actions/pathCommands/livePathEdit.js.map +1 -0
  712. package/dist/interactions/actions/pathCommands/pathNodes.js +99 -0
  713. package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -0
  714. package/dist/interactions/actions/pathCommands/simplifyOffset.js +42 -0
  715. package/dist/interactions/actions/pathCommands/simplifyOffset.js.map +1 -0
  716. package/dist/interactions/actions/planeInput.js.map +1 -1
  717. package/dist/interactions/actions/pointerState.js +12 -0
  718. package/dist/interactions/actions/pointerState.js.map +1 -0
  719. package/dist/interactions/actions/poseDescriptorDep.js +1 -1
  720. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
  721. package/dist/interactions/actions/poseFrame.js +26 -26
  722. package/dist/interactions/actions/poseFrame.js.map +1 -1
  723. package/dist/interactions/actions/resize/action.js +66 -0
  724. package/dist/interactions/actions/resize/action.js.map +1 -0
  725. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
  726. package/dist/interactions/actions/resize/boxFrame.js +16 -0
  727. package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
  728. package/dist/interactions/actions/resize/capture.js +85 -0
  729. package/dist/interactions/actions/resize/capture.js.map +1 -0
  730. package/dist/interactions/actions/resize/commit.js +69 -0
  731. package/dist/interactions/actions/resize/commit.js.map +1 -0
  732. package/dist/interactions/actions/resize/frame.js +88 -0
  733. package/dist/interactions/actions/resize/frame.js.map +1 -0
  734. package/dist/interactions/actions/resize/pointSnap.js +111 -0
  735. package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
  736. package/dist/interactions/actions/resize/replay.js +47 -0
  737. package/dist/interactions/actions/resize/replay.js.map +1 -0
  738. package/dist/interactions/actions/resize/ruleBounds.js +9 -0
  739. package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
  740. package/dist/interactions/actions/resize/session.js +63 -0
  741. package/dist/interactions/actions/resize/session.js.map +1 -0
  742. package/dist/interactions/actions/resolveOverlays.js +2 -1
  743. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  744. package/dist/interactions/actions/resolvePreviews.js.map +1 -1
  745. package/dist/interactions/actions/rotate/action.js +71 -0
  746. package/dist/interactions/actions/rotate/action.js.map +1 -0
  747. package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
  748. package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
  749. package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
  750. package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
  751. package/dist/interactions/actions/rotate/commit.js +40 -0
  752. package/dist/interactions/actions/rotate/commit.js.map +1 -0
  753. package/dist/interactions/actions/rotate/frame.js +65 -0
  754. package/dist/interactions/actions/rotate/frame.js.map +1 -0
  755. package/dist/interactions/actions/rotate/handle.js +12 -12
  756. package/dist/interactions/actions/rotate/handle.js.map +1 -1
  757. package/dist/interactions/actions/rotate/replay.js +22 -0
  758. package/dist/interactions/actions/rotate/replay.js.map +1 -0
  759. package/dist/interactions/actions/rotate/session.js +102 -0
  760. package/dist/interactions/actions/rotate/session.js.map +1 -0
  761. package/dist/interactions/actions/spatialReference.js.map +1 -1
  762. package/dist/interactions/actions/transform-again/action.js +63 -0
  763. package/dist/interactions/actions/transform-again/action.js.map +1 -0
  764. package/dist/interactions/actions/transform-again/memory.js +35 -0
  765. package/dist/interactions/actions/transform-again/memory.js.map +1 -0
  766. package/dist/interactions/actions/useStandardActions.js +84 -61
  767. package/dist/interactions/actions/useStandardActions.js.map +1 -1
  768. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +61 -42
  769. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
  770. package/dist/interactions/gestures/shared/originProjection.js +1 -1
  771. package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
  772. package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
  773. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
  774. package/dist/interactions/gestures/shared/snap.js.map +1 -1
  775. package/dist/math-CYUjoyyU.d.ts +33 -0
  776. package/dist/math.d.ts +5 -2
  777. package/dist/math.js +6 -6
  778. package/dist/mesh.d.ts +4 -268
  779. package/dist/mesh.js +3 -7
  780. package/dist/move.d.ts +6 -4
  781. package/dist/{originProjection-gHnOup4e.d.ts → originProjection-CoNVpITV.d.ts} +1 -1
  782. package/dist/patterns-builtin.d.ts +1 -118
  783. package/dist/patterns-builtin.js +2 -3
  784. package/dist/poseDescriptor-Bqk-11Rl.d.ts +73 -0
  785. package/dist/renderer.d.ts +1 -92
  786. package/dist/renderer.js +2 -19
  787. package/dist/resize.d.ts +11 -22
  788. package/dist/resize.js +1 -1
  789. package/dist/style.css +1 -1
  790. package/dist/test-hook/install.js.map +1 -1
  791. package/dist/test-hook/useTestHook.js +22 -0
  792. package/dist/test-hook/useTestHook.js.map +1 -0
  793. package/dist/test-seams-D0pyV3pR.d.ts +149 -0
  794. package/dist/test-seams.d.ts +4 -4
  795. package/dist/test-seams.js +2 -2
  796. package/dist/tools/builtin/bone/boneActions.js +130 -0
  797. package/dist/tools/builtin/bone/boneActions.js.map +1 -0
  798. package/dist/tools/builtin/bone/boneOverlay.js +58 -0
  799. package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
  800. package/dist/tools/builtin/bone/placedRig.js +24 -0
  801. package/dist/tools/builtin/bone/placedRig.js.map +1 -0
  802. package/dist/tools/builtin/bone/rigEditState.js +21 -0
  803. package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
  804. package/dist/tools/builtin/bone/useBoneTool.js +98 -0
  805. package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
  806. package/dist/tools/builtin/ellipse/useEllipseTool.js +16 -15
  807. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
  808. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
  809. package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
  810. package/dist/tools/builtin/image/useImageTool.js.map +1 -1
  811. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
  812. package/dist/tools/builtin/line/useLineTool.js +16 -15
  813. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  814. package/dist/tools/builtin/pen/usePenTool.js +162 -164
  815. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  816. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
  817. package/dist/tools/builtin/pickTopMostHit.js +11 -14
  818. package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
  819. package/dist/tools/builtin/polygon/usePolygonTool.js +17 -15
  820. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  821. package/dist/tools/builtin/rect/useRectTool.js +15 -14
  822. package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
  823. package/dist/tools/builtin/select/adapterPointQuery.js +40 -0
  824. package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
  825. package/dist/tools/builtin/select/selectionContributions.js +5 -5
  826. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  827. package/dist/tools/builtin/select/useSelectTool.js +44 -71
  828. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  829. package/dist/tools/builtin/shared/pointerFollower.js.map +1 -1
  830. package/dist/tools/builtin/slice/useSliceTool.js +69 -72
  831. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  832. package/dist/tools/builtin/star/useStarTool.js +18 -16
  833. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  834. package/dist/tools/builtin/text/useTextTool.js +10 -2
  835. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  836. package/dist/tools/builtin/weight/useWeightTool.js +77 -0
  837. package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
  838. package/dist/tools/builtin/weight/weightActions.js +112 -0
  839. package/dist/tools/builtin/weight/weightActions.js.map +1 -0
  840. package/dist/tools/builtin/weight/weightOverlay.js +61 -0
  841. package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
  842. package/dist/tools/overlayBinding.js.map +1 -1
  843. package/dist/tools/useKeybindings.js +20 -14
  844. package/dist/tools/useKeybindings.js.map +1 -1
  845. package/dist/{types-k-5Oqh-U.d.ts → types-DBbbCy0i.d.ts} +103 -176
  846. package/dist/util/paint.js +1 -1
  847. package/dist/util/paint.js.map +1 -1
  848. package/dist/version.js +1 -1
  849. package/package.json +26 -21
  850. package/dist/animation/colorHelpers.js +0 -135
  851. package/dist/animation/colorHelpers.js.map +0 -1
  852. package/dist/animation/colorRegistry.js +0 -37
  853. package/dist/animation/colorRegistry.js.map +0 -1
  854. package/dist/animation/engine/axes.js +0 -36
  855. package/dist/animation/engine/axes.js.map +0 -1
  856. package/dist/animation/engine/codec.js +0 -170
  857. package/dist/animation/engine/codec.js.map +0 -1
  858. package/dist/animation/engine/integrator.js +0 -12
  859. package/dist/animation/engine/integrator.js.map +0 -1
  860. package/dist/animation/loop.js +0 -60
  861. package/dist/animation/loop.js.map +0 -1
  862. package/dist/animation/observe.js +0 -23
  863. package/dist/animation/observe.js.map +0 -1
  864. package/dist/animation/rig/blendPoses.js +0 -43
  865. package/dist/animation/rig/blendPoses.js.map +0 -1
  866. package/dist/animation/rig/mirrorPose.js +0 -19
  867. package/dist/animation/rig/mirrorPose.js.map +0 -1
  868. package/dist/animation/rig/resolveSkeleton.js +0 -33
  869. package/dist/animation/rig/resolveSkeleton.js.map +0 -1
  870. package/dist/animation/rig/solveIk.js +0 -103
  871. package/dist/animation/rig/solveIk.js.map +0 -1
  872. package/dist/animation/rig/types.js +0 -12
  873. package/dist/animation/rig/types.js.map +0 -1
  874. package/dist/animation/slew.js +0 -27
  875. package/dist/animation/slew.js.map +0 -1
  876. package/dist/animation/stagger.js +0 -146
  877. package/dist/animation/stagger.js.map +0 -1
  878. package/dist/animation/timeline/booking.js +0 -114
  879. package/dist/animation/timeline/booking.js.map +0 -1
  880. package/dist/animation/timeline/createTimeline.js +0 -125
  881. package/dist/animation/timeline/createTimeline.js.map +0 -1
  882. package/dist/animation/timeline/sampleTrack.js +0 -79
  883. package/dist/animation/timeline/sampleTrack.js.map +0 -1
  884. package/dist/animation/useAnimator.js +0 -388
  885. package/dist/animation/useAnimator.js.map +0 -1
  886. package/dist/autoPoseDescriptor-Ct7yqivU.d.ts +0 -108
  887. package/dist/builtins-DPcdghtB.d.ts +0 -1223
  888. package/dist/canvas/MinimapCanvas.js +0 -140
  889. package/dist/canvas/MinimapCanvas.js.map +0 -1
  890. package/dist/canvas/deps/poseComposition.js +0 -11
  891. package/dist/canvas/deps/poseComposition.js.map +0 -1
  892. package/dist/canvas/minimapMath.js +0 -82
  893. package/dist/canvas/minimapMath.js.map +0 -1
  894. package/dist/canvas/toolPreview.js +0 -39
  895. package/dist/canvas/toolPreview.js.map +0 -1
  896. package/dist/core/adapters/arrayAdapter.js +0 -94
  897. package/dist/core/adapters/arrayAdapter.js.map +0 -1
  898. package/dist/core/adapters/useArrayAdapter.js +0 -13
  899. package/dist/core/adapters/useArrayAdapter.js.map +0 -1
  900. package/dist/core/fillInPoseFrame.js +0 -102
  901. package/dist/core/fillInPoseFrame.js.map +0 -1
  902. package/dist/core/geometry/poseFrame.js +0 -44
  903. package/dist/core/geometry/poseFrame.js.map +0 -1
  904. package/dist/core/geometry/poseRotation.js +0 -58
  905. package/dist/core/geometry/poseRotation.js.map +0 -1
  906. package/dist/core/gradient.js +0 -136
  907. package/dist/core/gradient.js.map +0 -1
  908. package/dist/core/markerInset.js +0 -24
  909. package/dist/core/markerInset.js.map +0 -1
  910. package/dist/core/mixed.js +0 -6
  911. package/dist/core/mixed.js.map +0 -1
  912. package/dist/core/paintKinds.js +0 -156
  913. package/dist/core/paintKinds.js.map +0 -1
  914. package/dist/core/scene/pickability.js +0 -6
  915. package/dist/core/scene/pickability.js.map +0 -1
  916. package/dist/core/strokeMarkerShapes.js +0 -139
  917. package/dist/core/strokeMarkerShapes.js.map +0 -1
  918. package/dist/core/strokeMarkers.js +0 -28
  919. package/dist/core/strokeMarkers.js.map +0 -1
  920. package/dist/core/viewport/meanScale.js +0 -8
  921. package/dist/core/viewport/meanScale.js.map +0 -1
  922. package/dist/core/viewport/pxExtent.js +0 -42
  923. package/dist/core/viewport/pxExtent.js.map +0 -1
  924. package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
  925. package/dist/features/focus/gateLayer.js.map +0 -1
  926. package/dist/features/focus/useCanvasFocus.js +0 -29
  927. package/dist/features/focus/useCanvasFocus.js.map +0 -1
  928. package/dist/features/groups/children.js.map +0 -1
  929. package/dist/features/groups/composePose.js +0 -67
  930. package/dist/features/groups/composePose.js.map +0 -1
  931. package/dist/features/groups/nestedHit.js.map +0 -1
  932. package/dist/features/groups/unionOfChildren.js.map +0 -1
  933. package/dist/features/images/imageCache.js +0 -104
  934. package/dist/features/images/imageCache.js.map +0 -1
  935. package/dist/features/ingestion/index.js +0 -8
  936. package/dist/features/meshPaint/bake.js +0 -79
  937. package/dist/features/meshPaint/bake.js.map +0 -1
  938. package/dist/features/meshPaint/bakeCache.js +0 -59
  939. package/dist/features/meshPaint/bakeCache.js.map +0 -1
  940. package/dist/features/meshPaint/handles.js +0 -86
  941. package/dist/features/meshPaint/handles.js.map +0 -1
  942. package/dist/features/meshPaint/lazyKind.js.map +0 -1
  943. package/dist/features/meshPaint/meshPaint.js +0 -239
  944. package/dist/features/meshPaint/meshPaint.js.map +0 -1
  945. package/dist/features/meshPaint/meshShader.js +0 -6
  946. package/dist/features/meshPaint/meshShader.js.map +0 -1
  947. package/dist/features/meshPaint/register.js +0 -7
  948. package/dist/features/meshPaint/register.js.map +0 -1
  949. package/dist/features/meshPaint/surface.js +0 -110
  950. package/dist/features/meshPaint/surface.js.map +0 -1
  951. package/dist/features/minimap/actions.js +0 -53
  952. package/dist/features/minimap/actions.js.map +0 -1
  953. package/dist/features/minimap/createMinimapContribution.js +0 -96
  954. package/dist/features/minimap/createMinimapContribution.js.map +0 -1
  955. package/dist/features/minimap/layers.js +0 -85
  956. package/dist/features/minimap/layers.js.map +0 -1
  957. package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
  958. package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
  959. package/dist/features/parallax/createParallaxLayer.js +0 -26
  960. package/dist/features/parallax/createParallaxLayer.js.map +0 -1
  961. package/dist/features/parallax/createParallaxPlane.js +0 -22
  962. package/dist/features/parallax/createParallaxPlane.js.map +0 -1
  963. package/dist/features/paths/anchorEdits.js +0 -167
  964. package/dist/features/paths/anchorEdits.js.map +0 -1
  965. package/dist/features/paths/anchors.js +0 -159
  966. package/dist/features/paths/anchors.js.map +0 -1
  967. package/dist/features/paths/booleans.js +0 -2
  968. package/dist/features/paths/markerCommands.js +0 -149
  969. package/dist/features/paths/markerCommands.js.map +0 -1
  970. package/dist/features/paths/markerSites.js +0 -59
  971. package/dist/features/paths/markerSites.js.map +0 -1
  972. package/dist/features/paths/markers.js +0 -95
  973. package/dist/features/paths/markers.js.map +0 -1
  974. package/dist/features/paths/nearestAnchor.js +0 -36
  975. package/dist/features/paths/nearestAnchor.js.map +0 -1
  976. package/dist/features/paths/pathInWorld.js +0 -41
  977. package/dist/features/paths/pathInWorld.js.map +0 -1
  978. package/dist/features/paths/poseDescriptor.js +0 -39
  979. package/dist/features/paths/poseDescriptor.js.map +0 -1
  980. package/dist/features/paths/strokeToPath.js +0 -40
  981. package/dist/features/paths/strokeToPath.js.map +0 -1
  982. package/dist/features/paths/tessellate/dash.js +0 -52
  983. package/dist/features/paths/tessellate/dash.js.map +0 -1
  984. package/dist/features/paths/tessellate/insets.js +0 -32
  985. package/dist/features/paths/tessellate/insets.js.map +0 -1
  986. package/dist/features/paths/tessellate/metric.js +0 -72
  987. package/dist/features/paths/tessellate/metric.js.map +0 -1
  988. package/dist/features/paths/tessellate/stroke.js +0 -170
  989. package/dist/features/paths/tessellate/stroke.js.map +0 -1
  990. package/dist/features/paths/tessellate/vertexWidths.js +0 -32
  991. package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
  992. package/dist/features/patterns/commandPaint.js +0 -18
  993. package/dist/features/patterns/commandPaint.js.map +0 -1
  994. package/dist/features/patterns/index.js +0 -11
  995. package/dist/features/patterns/index.js.map +0 -1
  996. package/dist/features/patterns/patterns-builtin.js +0 -38
  997. package/dist/features/patterns/patterns-builtin.js.map +0 -1
  998. package/dist/features/patterns/rasterizeTile.js +0 -17
  999. package/dist/features/patterns/rasterizeTile.js.map +0 -1
  1000. package/dist/features/patterns/resolveSpec.js +0 -65
  1001. package/dist/features/patterns/resolveSpec.js.map +0 -1
  1002. package/dist/features/patterns/tileGeometry.js +0 -158
  1003. package/dist/features/patterns/tileGeometry.js.map +0 -1
  1004. package/dist/features/pointer/PointerContext.js +0 -45
  1005. package/dist/features/pointer/PointerContext.js.map +0 -1
  1006. package/dist/features/selection/SelectionContext.js +0 -51
  1007. package/dist/features/selection/SelectionContext.js.map +0 -1
  1008. package/dist/features/simulation/createSimulation.js +0 -61
  1009. package/dist/features/simulation/createSimulation.js.map +0 -1
  1010. package/dist/features/simulation/types.js +0 -6
  1011. package/dist/features/simulation/types.js.map +0 -1
  1012. package/dist/features/simulation/useSimulation.js +0 -74
  1013. package/dist/features/simulation/useSimulation.js.map +0 -1
  1014. package/dist/features/text/domOffsets.js +0 -82
  1015. package/dist/features/text/domOffsets.js.map +0 -1
  1016. package/dist/features/text/domRuns.js +0 -230
  1017. package/dist/features/text/domRuns.js.map +0 -1
  1018. package/dist/features/text/fitTextPose.js +0 -38
  1019. package/dist/features/text/fitTextPose.js.map +0 -1
  1020. package/dist/features/text/hitTest.js +0 -48
  1021. package/dist/features/text/hitTest.js.map +0 -1
  1022. package/dist/features/text/isTextData.js +0 -8
  1023. package/dist/features/text/isTextData.js.map +0 -1
  1024. package/dist/features/text/overlayDirection.js +0 -15
  1025. package/dist/features/text/overlayDirection.js.map +0 -1
  1026. package/dist/features/text/renderLabel.js +0 -14
  1027. package/dist/features/text/renderLabel.js.map +0 -1
  1028. package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
  1029. package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
  1030. package/dist/features/text/runs/flagRange.js +0 -53
  1031. package/dist/features/text/runs/flagRange.js.map +0 -1
  1032. package/dist/features/text/runs/rangeStyle.js +0 -133
  1033. package/dist/features/text/runs/rangeStyle.js.map +0 -1
  1034. package/dist/features/text/textCommand.js +0 -60
  1035. package/dist/features/text/textCommand.js.map +0 -1
  1036. package/dist/features/text/textToPath.js +0 -181
  1037. package/dist/features/text/textToPath.js.map +0 -1
  1038. package/dist/features/text/useTextEdit.js +0 -491
  1039. package/dist/features/text/useTextEdit.js.map +0 -1
  1040. package/dist/features/tiling/createTiledLayer.js +0 -65
  1041. package/dist/features/tiling/createTiledLayer.js.map +0 -1
  1042. package/dist/features/tiling/tiledProject.js +0 -14
  1043. package/dist/features/tiling/tiledProject.js.map +0 -1
  1044. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
  1045. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
  1046. package/dist/interactions/actions/defaults/align.js.map +0 -1
  1047. package/dist/interactions/actions/defaults/booleans.js +0 -52
  1048. package/dist/interactions/actions/defaults/booleans.js.map +0 -1
  1049. package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
  1050. package/dist/interactions/actions/defaults/clone.js +0 -91
  1051. package/dist/interactions/actions/defaults/clone.js.map +0 -1
  1052. package/dist/interactions/actions/defaults/createOutlines.js +0 -47
  1053. package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
  1054. package/dist/interactions/actions/defaults/distribute.js.map +0 -1
  1055. package/dist/interactions/actions/defaults/editAnchors.js +0 -100
  1056. package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
  1057. package/dist/interactions/actions/defaults/flip.js +0 -125
  1058. package/dist/interactions/actions/defaults/flip.js.map +0 -1
  1059. package/dist/interactions/actions/defaults/insert.js +0 -287
  1060. package/dist/interactions/actions/defaults/insert.js.map +0 -1
  1061. package/dist/interactions/actions/defaults/lassoSelect.js +0 -153
  1062. package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
  1063. package/dist/interactions/actions/defaults/move.js +0 -778
  1064. package/dist/interactions/actions/defaults/move.js.map +0 -1
  1065. package/dist/interactions/actions/defaults/resize.js +0 -341
  1066. package/dist/interactions/actions/defaults/resize.js.map +0 -1
  1067. package/dist/interactions/actions/defaults/rotate.js +0 -185
  1068. package/dist/interactions/actions/defaults/rotate.js.map +0 -1
  1069. package/dist/interactions/actions/previewOverrides.js +0 -25
  1070. package/dist/interactions/actions/previewOverrides.js.map +0 -1
  1071. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
  1072. package/dist/layout/arrivals.js +0 -36
  1073. package/dist/layout/arrivals.js.map +0 -1
  1074. package/dist/math-J-ACHyEg.d.ts +0 -159
  1075. package/dist/registerProgram-T9S_PfAX.d.ts +0 -208
  1076. package/dist/renderer/DrawCommand.js +0 -6
  1077. package/dist/renderer/DrawCommand.js.map +0 -1
  1078. package/dist/renderer/WeaselRenderer.js +0 -333
  1079. package/dist/renderer/WeaselRenderer.js.map +0 -1
  1080. package/dist/renderer/batchClip.js +0 -46
  1081. package/dist/renderer/batchClip.js.map +0 -1
  1082. package/dist/renderer/cache/GLImageCache.js +0 -74
  1083. package/dist/renderer/cache/GLImageCache.js.map +0 -1
  1084. package/dist/renderer/cache/GLMeshCache.js +0 -102
  1085. package/dist/renderer/cache/GLMeshCache.js.map +0 -1
  1086. package/dist/renderer/cache/GLTextureCache.js +0 -68
  1087. package/dist/renderer/cache/GLTextureCache.js.map +0 -1
  1088. package/dist/renderer/cache/GradientRampAtlas.js +0 -82
  1089. package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
  1090. package/dist/renderer/cache/cache.js +0 -13
  1091. package/dist/renderer/cache/cache.js.map +0 -1
  1092. package/dist/renderer/cache/markerCommandCache.js +0 -63
  1093. package/dist/renderer/cache/markerCommandCache.js.map +0 -1
  1094. package/dist/renderer/cache/outlineMeshCache.js +0 -15
  1095. package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
  1096. package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
  1097. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
  1098. package/dist/renderer/cache/strokeMeshCache.js +0 -55
  1099. package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
  1100. package/dist/renderer/cullDrawCommands.js +0 -90
  1101. package/dist/renderer/cullDrawCommands.js.map +0 -1
  1102. package/dist/renderer/draw/batch.js +0 -133
  1103. package/dist/renderer/draw/batch.js.map +0 -1
  1104. package/dist/renderer/draw/clip.js +0 -89
  1105. package/dist/renderer/draw/clip.js.map +0 -1
  1106. package/dist/renderer/draw/customShader.js +0 -230
  1107. package/dist/renderer/draw/customShader.js.map +0 -1
  1108. package/dist/renderer/draw/drawTriangles.js +0 -8
  1109. package/dist/renderer/draw/drawTriangles.js.map +0 -1
  1110. package/dist/renderer/draw/effects.js +0 -28
  1111. package/dist/renderer/draw/effects.js.map +0 -1
  1112. package/dist/renderer/draw/flushBatch.js +0 -35
  1113. package/dist/renderer/draw/flushBatch.js.map +0 -1
  1114. package/dist/renderer/draw/gradient.js +0 -90
  1115. package/dist/renderer/draw/gradient.js.map +0 -1
  1116. package/dist/renderer/draw/image.js +0 -38
  1117. package/dist/renderer/draw/image.js.map +0 -1
  1118. package/dist/renderer/draw/mesh.js +0 -16
  1119. package/dist/renderer/draw/mesh.js.map +0 -1
  1120. package/dist/renderer/draw/paintBind.js +0 -70
  1121. package/dist/renderer/draw/paintBind.js.map +0 -1
  1122. package/dist/renderer/draw/pathPaint.js +0 -142
  1123. package/dist/renderer/draw/pathPaint.js.map +0 -1
  1124. package/dist/renderer/draw/scratchPass.js +0 -83
  1125. package/dist/renderer/draw/scratchPass.js.map +0 -1
  1126. package/dist/renderer/draw/stencil.js +0 -28
  1127. package/dist/renderer/draw/stencil.js.map +0 -1
  1128. package/dist/renderer/draw/text.js +0 -167
  1129. package/dist/renderer/draw/text.js.map +0 -1
  1130. package/dist/renderer/draw/uniforms.js +0 -77
  1131. package/dist/renderer/draw/uniforms.js.map +0 -1
  1132. package/dist/renderer/draw.js +0 -79
  1133. package/dist/renderer/draw.js.map +0 -1
  1134. package/dist/renderer/drawBatch.js +0 -198
  1135. package/dist/renderer/drawBatch.js.map +0 -1
  1136. package/dist/renderer/effects/EffectTargets.js +0 -48
  1137. package/dist/renderer/effects/EffectTargets.js.map +0 -1
  1138. package/dist/renderer/effects/builtins.js +0 -31
  1139. package/dist/renderer/effects/builtins.js.map +0 -1
  1140. package/dist/renderer/effects/composite.js +0 -11
  1141. package/dist/renderer/effects/composite.js.map +0 -1
  1142. package/dist/renderer/effects/effectPrelude.js +0 -10
  1143. package/dist/renderer/effects/effectPrelude.js.map +0 -1
  1144. package/dist/renderer/effects/types.js +0 -10
  1145. package/dist/renderer/effects/types.js.map +0 -1
  1146. package/dist/renderer/glyphOutlineMesh.js +0 -67
  1147. package/dist/renderer/glyphOutlineMesh.js.map +0 -1
  1148. package/dist/renderer/index.js +0 -20
  1149. package/dist/renderer/math/color.js +0 -321
  1150. package/dist/renderer/math/color.js.map +0 -1
  1151. package/dist/renderer/math/mat3.js +0 -80
  1152. package/dist/renderer/math/mat3.js.map +0 -1
  1153. package/dist/renderer/math/patternSpace.js +0 -22
  1154. package/dist/renderer/math/patternSpace.js.map +0 -1
  1155. package/dist/renderer/math/viewToMat3.js +0 -19
  1156. package/dist/renderer/math/viewToMat3.js.map +0 -1
  1157. package/dist/renderer/paintResources.js +0 -18
  1158. package/dist/renderer/paintResources.js.map +0 -1
  1159. package/dist/renderer/paintScratch.js +0 -37
  1160. package/dist/renderer/paintScratch.js.map +0 -1
  1161. package/dist/renderer/shaders/ShaderProgram.js +0 -74
  1162. package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
  1163. package/dist/renderer/shaders/batchFill.js +0 -119
  1164. package/dist/renderer/shaders/batchFill.js.map +0 -1
  1165. package/dist/renderer/shaders/customPrelude.js +0 -34
  1166. package/dist/renderer/shaders/customPrelude.js.map +0 -1
  1167. package/dist/renderer/shaders/extractUniformNames.js +0 -184
  1168. package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
  1169. package/dist/renderer/shaders/glyphPaint.js +0 -61
  1170. package/dist/renderer/shaders/glyphPaint.js.map +0 -1
  1171. package/dist/renderer/shaders/gradFill.js +0 -31
  1172. package/dist/renderer/shaders/gradFill.js.map +0 -1
  1173. package/dist/renderer/shaders/pathFill.js +0 -14
  1174. package/dist/renderer/shaders/pathFill.js.map +0 -1
  1175. package/dist/renderer/shaders/patternFill.js +0 -25
  1176. package/dist/renderer/shaders/patternFill.js.map +0 -1
  1177. package/dist/renderer/shaders/registerProgram.js +0 -18
  1178. package/dist/renderer/shaders/registerProgram.js.map +0 -1
  1179. package/dist/renderer/spriteSheet.js +0 -14
  1180. package/dist/renderer/spriteSheet.js.map +0 -1
  1181. package/dist/renderer/state/GroupState.js +0 -77
  1182. package/dist/renderer/state/GroupState.js.map +0 -1
  1183. package/dist/renderer/strokeLengths.js +0 -50
  1184. package/dist/renderer/strokeLengths.js.map +0 -1
  1185. package/dist/renderer/syntheticItalic.js +0 -6
  1186. package/dist/renderer/syntheticItalic.js.map +0 -1
  1187. package/dist/renderer/textures/registerTexture.js +0 -34
  1188. package/dist/renderer/textures/registerTexture.js.map +0 -1
  1189. package/dist/scheduling/useVisibleRaf.js +0 -69
  1190. package/dist/scheduling/useVisibleRaf.js.map +0 -1
  1191. package/dist/test-seams-DM2B87-g.d.ts +0 -356
@@ -1,47 +1,43 @@
1
- import { poseFrameInverseOf as e, poseFrameOf as t, poseLinearOf as n } from "../../core/geometry/poseFrame.js";
2
- import { AUTO_POSE_DESCRIPTOR as r, isPathLike as i } from "../../interactions/actions/resize/autoPoseDescriptor.js";
3
- import { hasSlop as a, slopForStrokeHit as o } from "../../core/viewport/screenSlop.js";
4
- import { applyToPoint as s, pointInPath as c, strokeHitTest as l } from "@weasel-js/geom";
1
+ import { framedBounds as e } from "../../core/geometry/poseDescriptor.js";
2
+ import { AUTO_POSE_DESCRIPTOR as t, isPathLike as n } from "../../core/geometry/autoPoseDescriptor.js";
3
+ import { hasSlop as r, slopForStrokeHit as i } from "../../core/viewport/screenSlop.js";
4
+ import { applyToPoint as a, pointInPath as o, poseFrameInverseOf as s, poseFrameOf as c, poseLinearOf as l, strokeHitTest as u } from "@weasel-js/geom";
5
5
  //#region src/canvas/SceneCanvas/poseGeometry.ts
6
- function u(e, t = r) {
7
- return t.getBounds(e);
6
+ function d(e, n = t) {
7
+ return n.getBounds(e);
8
8
  }
9
- var d = 4;
10
- function f(e, t, n, i, a = r) {
11
- return m(e, t, n, i, a, 0);
9
+ var f = 4;
10
+ function p(e, n, r, i, a = t) {
11
+ return g(e, n, r, i, a, null, !1);
12
12
  }
13
- function p(n, i, a, o, c = r) {
14
- let l = c === r ? n : h(n, c);
15
- if (!t(l)) return m(n, i, a, o, c, 0);
16
- let u = e(l);
17
- if (!u) return !1;
18
- let [d, f] = s(u, i, a);
19
- return m(n, d, f, o, c, l.rotation ?? 0);
13
+ function m(n, r, i, o, u = t) {
14
+ let d = u === t ? n : e(n, u), f = c(d);
15
+ if (!f) return g(n, r, i, o, u, null, !1);
16
+ let p = s(d);
17
+ if (!p) return !1;
18
+ let [m, h] = a(p, r, i);
19
+ return g(n, m, h, o, u, f, l(d) !== null);
20
20
  }
21
- function m(e, t, n, r, s, f) {
22
- let p = i(e), m = r === void 0 ? p ? d : 0 : typeof r == "number" ? r : r.reach ?? 0, h = typeof r == "object" ? r : void 0, { opts: g } = o(h, f);
23
- if (p) return c(e, t, n) ? !0 : l(e, t, n, m, g);
24
- let _ = u(e, s), v = {
21
+ var h = {
22
+ x: 1,
23
+ y: 1
24
+ };
25
+ function g(e, t, a, s, c, l, p) {
26
+ let m = n(e), g = typeof s == "object" ? void 0 : s ?? (m ? f : 0), _ = p && g !== void 0 && g > 0, v = _ ? 0 : g ?? s.reach ?? 0, y = _ ? {
27
+ px: g,
28
+ scale: h
29
+ } : typeof s == "object" ? s : void 0, { opts: b } = i(y, l);
30
+ if (m) return o(e, t, a) ? !0 : u(e, t, a, v, b);
31
+ let x = d(e, c), S = {
25
32
  kind: "rect",
26
- x: _.x - m,
27
- y: _.y - m,
28
- width: _.width + 2 * m,
29
- height: _.height + 2 * m
30
- };
31
- return c(v, t, n) ? !0 : a(h) && l(v, t, n, 0, g);
32
- }
33
- function h(e, t) {
34
- let r = t.getBounds(e);
35
- return {
36
- x: r.x,
37
- y: r.y,
38
- width: r.width,
39
- height: r.height,
40
- rotation: t.getRotation?.(e) ?? 0,
41
- transform: n(e) ?? void 0
33
+ x: x.x - v,
34
+ y: x.y - v,
35
+ width: x.width + 2 * v,
36
+ height: x.height + 2 * v
42
37
  };
38
+ return o(S, t, a) ? !0 : r(y) && u(S, t, a, 0, b);
43
39
  }
44
40
  //#endregion
45
- export { u as aabbOfPose, i as isPathLike, f as poseContains, p as poseContainsRotated };
41
+ export { d as aabbOfPose, n as isPathLike, p as poseContains, m as poseContainsRotated };
46
42
 
47
43
  //# sourceMappingURL=poseGeometry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"poseGeometry.js","names":["aabbOfPose","AUTO_POSE_DESCRIPTOR","descriptor","pose","DEFAULT_PATH_STROKE_SLOP","poseContains","containsInFrame","wx","wy","tolerance","poseContainsRotated","framed","framedBounds","poseFrameOf","back","poseFrameInverseOf","lx","ly","applyToPoint","pathLike","isPathLike","reach","screen","slopForStrokeHit","rotation","pointInPath","x","y","strokeHitTest","opts","b","grown","hasSlop","poseLinearOf"],"sources":["../../../src/canvas/SceneCanvas/poseGeometry.ts"],"sourcesContent":["/**\n * Pose-shape helpers shared by `<SceneCanvas>` internals.\n *\n * Every bounds read goes through a `PoseDescriptor`, defaulting to\n * `AUTO_POSE_DESCRIPTOR` (path descriptor for `{kind:'polygon'|'rect'}` poses,\n * rect descriptor for everything else). Used by hit-test, marquee and bounds\n * extraction, so a consumer-supplied descriptor reaches all three.\n */\nimport type { Bounds } from 'tools/builtin/select';\nimport { applyToPoint, pointInPath, strokeHitTest } from '@weasel-js/geom';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport { AUTO_POSE_DESCRIPTOR, isPathLike } from 'interactions/actions/resize/autoPoseDescriptor';\nimport { poseFrameInverseOf, poseFrameOf, poseLinearOf } from 'core/geometry/poseFrame';\nimport { hasSlop, slopForStrokeHit, type ScreenSlop } from 'core/viewport/screenSlop';\n\nexport { isPathLike };\n\nexport function aabbOfPose<TPose>(\n pose: TPose,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): Bounds {\n return descriptor.getBounds(pose);\n}\n\n/** Screen-px slop applied to the stroke-distance hit-test for paths. Catches\n * fingertip-imprecision around thin lines / curves without depending on the\n * stroke's actual rendered width (which the hit-test layer doesn't know). */\nconst DEFAULT_PATH_STROKE_SLOP = 4;\n\n/** A containment slop: `reach` world units the caller knows the ink extends\n * past the pose (a stroke's outward half-width), then `px`/`scale` of screen\n * slop measured from there. */\nexport interface PoseSlop extends ScreenSlop {\n reach?: number;\n}\n\n/**\n * @param tolerance - Grab slop. A number is **world** units and grows the\n * AABB test and the path stroke-distance test alike; a {@link PoseSlop}\n * is measured on screen, from `reach` world units out. Defaults to\n * {@link DEFAULT_PATH_STROKE_SLOP} for path-like poses (the historical\n * fixed slop) and to `0` for rect poses, whose edges were never fuzzy.\n */\nexport function poseContains<TPose>(\n pose: TPose,\n wx: number,\n wy: number,\n tolerance?: number | PoseSlop,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): boolean {\n return containsInFrame(pose, wx, wy, tolerance, descriptor, 0);\n}\n\n/**\n * Containment for `<SceneCanvas>`'s default `pickEvery`. When the pose has a\n * frame (`poseFrameOf`: a rotation, a `transform`, or both), takes the query\n * point back through it and tests in the pose's own box frame, mirroring the\n * renderer's wrap so the click target matches the drawn shape. This covers\n * rect-shaped poses and `kind:'rect'`/polygon poses that carry an AABB. A pose\n * with no frame tests directly, and one whose `transform` is singular draws\n * nothing and contains nothing.\n *\n * Rotation comes from the descriptor when one is supplied, and otherwise from\n * `pose.rotation`, the convention the renderer reads. A world `tolerance` is\n * measured in the pose's own frame, so a `transform` stretches it with the\n * node.\n */\nexport function poseContainsRotated<TPose>(\n pose: TPose,\n wx: number,\n wy: number,\n tolerance?: number | PoseSlop,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): boolean {\n const framed = descriptor === AUTO_POSE_DESCRIPTOR ? pose : framedBounds(pose, descriptor);\n if (!poseFrameOf(framed)) return containsInFrame(pose, wx, wy, tolerance, descriptor, 0);\n const back = poseFrameInverseOf(framed);\n if (!back) return false;\n const [lx, ly] = applyToPoint(back, wx, wy);\n const rotation = (framed as { rotation?: number }).rotation ?? 0;\n return containsInFrame(pose, lx, ly, tolerance, descriptor, rotation);\n}\n\n/** `(x, y)` is in the pose's own frame, which reaches world by `rotation`. */\nfunction containsInFrame<TPose>(\n pose: TPose,\n x: number,\n y: number,\n tolerance: number | PoseSlop | undefined,\n descriptor: PoseDescriptor<unknown>,\n rotation: number,\n): boolean {\n const pathLike = isPathLike(pose);\n const reach = tolerance === undefined\n ? (pathLike ? DEFAULT_PATH_STROKE_SLOP : 0)\n : typeof tolerance === 'number' ? tolerance : (tolerance.reach ?? 0);\n const screen = typeof tolerance === 'object' ? tolerance : undefined;\n const { opts } = slopForStrokeHit(screen, rotation);\n if (pathLike) {\n // Precise inside-filled-region OR within-stroke-slop. Replaces the old\n // \"AABB-conservative-fallback\" path that returned true anywhere inside\n // the path's bounding box (which over-picked on open / non-convex paths).\n if (pointInPath(pose, x, y)) return true;\n return strokeHitTest(pose, x, y, reach, opts);\n }\n const b = aabbOfPose(pose, descriptor);\n // `reach` is the caller's budget for being at least as generous as whatever\n // refinement follows: the stroke's outward reach, which this function\n // cannot see. Grown square, so it contains the round band the refinement\n // tests.\n const grown = {\n kind: 'rect' as const,\n x: b.x - reach, y: b.y - reach, width: b.width + 2 * reach, height: b.height + 2 * reach,\n };\n if (pointInPath(grown, x, y)) return true;\n return hasSlop(screen) && strokeHitTest(grown, x, y, 0, opts);\n}\n\n/** The box, rotation, and `transform` a descriptor-read pose is drawn in. */\nfunction framedBounds<TPose>(pose: TPose, descriptor: PoseDescriptor<unknown>): unknown {\n const b = descriptor.getBounds(pose);\n return {\n x: b.x, y: b.y, width: b.width, height: b.height,\n rotation: descriptor.getRotation?.(pose) ?? 0,\n transform: poseLinearOf(pose) ?? undefined,\n };\n}\n"],"mappings":";;;;;AAiBA,SAAgBA,EACd,GACA,IAAsCC,GAC9B;CACR,OAAOC,EAAW,UAAUC,CAAI;AAClC;AAKA,IAAMC,IAA2B;AAgBjC,SAAgBC,EACd,GACA,GACA,GACA,GACA,IAAsCJ,GAC7B;CACT,OAAOK,EAAgBH,GAAMI,GAAIC,GAAIC,GAAWP,GAAY,CAAC;AAC/D;AAgBA,SAAgBQ,EACd,GACA,GACA,GACA,GACA,IAAsCT,GAC7B;CACT,IAAMU,IAAST,MAAeD,IAAuBE,IAAOS,EAAaT,GAAMD,CAAU;CACzF,IAAI,CAACW,EAAYF,CAAM,GAAG,OAAOL,EAAgBH,GAAMI,GAAIC,GAAIC,GAAWP,GAAY,CAAC;CACvF,IAAMY,IAAOC,EAAmBJ,CAAM;CACtC,IAAI,CAACG,GAAM,OAAO;CAClB,IAAM,CAACE,GAAIC,KAAMC,EAAaJ,GAAMP,GAAIC,CAAE;CAE1C,OAAOF,EAAgBH,GAAMa,GAAIC,GAAIR,GAAWP,GAD9BS,EAAiC,YAAY,CACK;AACtE;AAGA,SAASL,EACP,GACA,GACA,GACA,GACA,GACA,GACS;CACT,IAAMa,IAAWC,EAAWjB,CAAI,GAC1BkB,IAAQZ,MAAc,KAAA,IACvBU,IAAWf,IAA2B,IACvC,OAAOK,KAAc,WAAWA,IAAaA,EAAU,SAAS,GAC9Da,IAAS,OAAOb,KAAc,WAAWA,IAAY,KAAA,GACrD,EAAE,YAASc,EAAiBD,GAAQE,CAAQ;CAClD,IAAIL,GAKF,OADIM,EAAYtB,GAAMuB,GAAGC,CAAC,IAAU,KAC7BC,EAAczB,GAAMuB,GAAGC,GAAGN,GAAOQ,CAAI;CAE9C,IAAMC,IAAI9B,EAAWG,GAAMD,CAAU,GAK/B6B,IAAQ;EACZ,MAAM;EACN,GAAGD,EAAE,IAAIT;EAAO,GAAGS,EAAE,IAAIT;EAAO,OAAOS,EAAE,QAAQ,IAAIT;EAAO,QAAQS,EAAE,SAAS,IAAIT;CACrF;CAEA,OADII,EAAYM,GAAOL,GAAGC,CAAC,IAAU,KAC9BK,EAAQV,CAAM,KAAKM,EAAcG,GAAOL,GAAGC,GAAG,GAAGE,CAAI;AAC9D;AAGA,SAASjB,EAAoB,GAAa,GAA8C;CACtF,IAAMkB,IAAI5B,EAAW,UAAUC,CAAI;CACnC,OAAO;EACL,GAAG2B,EAAE;EAAG,GAAGA,EAAE;EAAG,OAAOA,EAAE;EAAO,QAAQA,EAAE;EAC1C,UAAU5B,EAAW,cAAcC,CAAI,KAAK;EAC5C,WAAW8B,EAAa9B,CAAI,KAAK,KAAA;CACnC;AACF"}
1
+ {"version":3,"file":"poseGeometry.js","names":["aabbOfPose","AUTO_POSE_DESCRIPTOR","descriptor","pose","DEFAULT_PATH_STROKE_SLOP","poseContains","containsInFrame","wx","wy","tolerance","poseContainsRotated","framed","framedBounds","frame","poseFrameOf","back","poseFrameInverseOf","lx","ly","applyToPoint","poseLinearOf","WORLD_SCALE","pathLike","isPathLike","world","throughFrame","stretched","reach","screen","slopForStrokeHit","pointInPath","x","y","strokeHitTest","opts","b","grown","hasSlop"],"sources":["../../../src/canvas/SceneCanvas/poseGeometry.ts"],"sourcesContent":["/**\n * Pose-shape helpers shared by `<SceneCanvas>` internals. Every bounds read goes through a\n * `PoseDescriptor`, defaulting to `AUTO_POSE_DESCRIPTOR`, so a consumer-supplied descriptor\n * reaches hit-test, marquee, and bounds extraction alike.\n */\nimport type { Bounds } from 'tools/builtin/select';\nimport { applyToPoint, pointInPath, strokeHitTest, type Affine } from '@weasel-js/geom';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport { framedBounds } from 'core/geometry/poseDescriptor';\nimport { AUTO_POSE_DESCRIPTOR, isPathLike } from 'core/geometry/autoPoseDescriptor';\nimport { poseFrameInverseOf, poseFrameOf, poseLinearOf } from '@weasel-js/geom';\nimport { hasSlop, slopForStrokeHit, type ScreenSlop } from 'core/viewport/screenSlop';\n\nexport { isPathLike };\n\nexport function aabbOfPose<TPose>(\n pose: TPose,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): Bounds {\n return descriptor.getBounds(pose);\n}\n\n/** Default slop for the stroke-distance hit-test on paths, in world units. Independent of\n * the stroke's rendered width, which the hit-test layer doesn't know. */\nconst DEFAULT_PATH_STROKE_SLOP = 4;\n\n/** A containment slop: `reach` world units the caller knows the ink extends\n * past the pose (a stroke's outward half-width), then `px`/`scale` of screen\n * slop measured from there. */\nexport interface PoseSlop extends ScreenSlop {\n reach?: number;\n}\n\n/**\n * @param tolerance - Grab slop. A number is **world** units and grows the\n * AABB test and the path stroke-distance test alike; a {@link PoseSlop}\n * is measured on screen, from `reach` world units out. Defaults to\n * {@link DEFAULT_PATH_STROKE_SLOP} for path-like poses and to `0` for rect poses.\n */\nexport function poseContains<TPose>(\n pose: TPose,\n wx: number,\n wy: number,\n tolerance?: number | PoseSlop,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): boolean {\n return containsInFrame(pose, wx, wy, tolerance, descriptor, null, false);\n}\n\n/**\n * Containment for `<SceneCanvas>`'s default `pickEvery`. When the pose has a\n * frame (`poseFrameOf`: a rotation, a `transform`, or both), takes the query\n * point back through it and tests in the pose's own box frame, mirroring the\n * renderer's wrap so the click target matches the drawn shape. A pose with no\n * frame tests directly, and one whose `transform` is singular draws nothing and\n * contains nothing.\n *\n * Rotation comes from the descriptor when one is supplied, and otherwise from\n * `pose.rotation`, the convention the renderer reads. A `tolerance` is a\n * distance in world or on screen whatever the frame; only a `PoseSlop`'s\n * `reach` is in the pose's own frame, where the stroke it stands for is drawn.\n */\nexport function poseContainsRotated<TPose>(\n pose: TPose,\n wx: number,\n wy: number,\n tolerance?: number | PoseSlop,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n): boolean {\n const framed = descriptor === AUTO_POSE_DESCRIPTOR ? pose : framedBounds(pose, descriptor);\n const frame = poseFrameOf(framed);\n if (!frame) return containsInFrame(pose, wx, wy, tolerance, descriptor, null, false);\n const back = poseFrameInverseOf(framed);\n if (!back) return false;\n const [lx, ly] = applyToPoint(back, wx, wy);\n return containsInFrame(pose, lx, ly, tolerance, descriptor, frame, poseLinearOf(framed) !== null);\n}\n\nconst WORLD_SCALE = { x: 1, y: 1 };\n\n/** `(x, y)` is in the pose's own frame, which reaches world by `frame`.\n * `stretched` is whether that frame changes lengths: it carries a `transform`. */\nfunction containsInFrame<TPose>(\n pose: TPose,\n x: number,\n y: number,\n tolerance: number | PoseSlop | undefined,\n descriptor: PoseDescriptor<unknown>,\n frame: Affine | null,\n stretched: boolean,\n): boolean {\n const pathLike = isPathLike(pose);\n const world = typeof tolerance === 'object' ? undefined\n : tolerance ?? (pathLike ? DEFAULT_PATH_STROKE_SLOP : 0);\n // A world distance is not one in a stretched frame, so it is tested through\n // the frame, as a screen slop is: at a scale of one.\n const throughFrame = stretched && world !== undefined && world > 0;\n const reach = throughFrame ? 0 : world ?? (tolerance as PoseSlop).reach ?? 0;\n const screen = throughFrame ? { px: world, scale: WORLD_SCALE }\n : typeof tolerance === 'object' ? tolerance : undefined;\n const { opts } = slopForStrokeHit(screen, frame);\n if (pathLike) {\n // Inside the filled region, or within stroke slop.\n if (pointInPath(pose, x, y)) return true;\n return strokeHitTest(pose, x, y, reach, opts);\n }\n const b = aabbOfPose(pose, descriptor);\n // `reach` is the caller's budget for being at least as generous as whatever\n // refinement follows: the stroke's outward reach, which this function\n // cannot see. Grown square, so it contains the round band the refinement\n // tests.\n const grown = {\n kind: 'rect' as const,\n x: b.x - reach, y: b.y - reach, width: b.width + 2 * reach, height: b.height + 2 * reach,\n };\n if (pointInPath(grown, x, y)) return true;\n return hasSlop(screen) && strokeHitTest(grown, x, y, 0, opts);\n}\n"],"mappings":";;;;;AAeA,SAAgBA,EACd,GACA,IAAsCC,GAC9B;CACR,OAAOC,EAAW,UAAUC,CAAI;AAClC;AAIA,IAAMC,IAA2B;AAejC,SAAgBC,EACd,GACA,GACA,GACA,GACA,IAAsCJ,GAC7B;CACT,OAAOK,EAAgBH,GAAMI,GAAIC,GAAIC,GAAWP,GAAY,MAAM,EAAK;AACzE;AAeA,SAAgBQ,EACd,GACA,GACA,GACA,GACA,IAAsCT,GAC7B;CACT,IAAMU,IAAST,MAAeD,IAAuBE,IAAOS,EAAaT,GAAMD,CAAU,GACnFW,IAAQC,EAAYH,CAAM;CAChC,IAAI,CAACE,GAAO,OAAOP,EAAgBH,GAAMI,GAAIC,GAAIC,GAAWP,GAAY,MAAM,EAAK;CACnF,IAAMa,IAAOC,EAAmBL,CAAM;CACtC,IAAI,CAACI,GAAM,OAAO;CAClB,IAAM,CAACE,GAAIC,KAAMC,EAAaJ,GAAMR,GAAIC,CAAE;CAC1C,OAAOF,EAAgBH,GAAMc,GAAIC,GAAIT,GAAWP,GAAYW,GAAOO,EAAaT,CAAM,MAAM,IAAI;AAClG;AAEA,IAAMU,IAAc;CAAE,GAAG;CAAG,GAAG;AAAE;AAIjC,SAASf,EACP,GACA,GACA,GACA,GACA,GACA,GACA,GACS;CACT,IAAMgB,IAAWC,EAAWpB,CAAI,GAC1BqB,IAAQ,OAAOf,KAAc,WAAW,KAAA,IAC1CA,MAAca,IAAWlB,IAA2B,IAGlDqB,IAAeC,KAAaF,MAAU,KAAA,KAAaA,IAAQ,GAC3DG,IAAQF,IAAe,IAAID,KAAUf,EAAuB,SAAS,GACrEmB,IAASH,IAAe;EAAE,IAAID;EAAO,OAAOH;CAAY,IAC1D,OAAOZ,KAAc,WAAWA,IAAY,KAAA,GAC1C,EAAE,YAASoB,EAAiBD,GAAQf,CAAK;CAC/C,IAAIS,GAGF,OADIQ,EAAY3B,GAAM4B,GAAGC,CAAC,IAAU,KAC7BC,EAAc9B,GAAM4B,GAAGC,GAAGL,GAAOO,CAAI;CAE9C,IAAMC,IAAInC,EAAWG,GAAMD,CAAU,GAK/BkC,IAAQ;EACZ,MAAM;EACN,GAAGD,EAAE,IAAIR;EAAO,GAAGQ,EAAE,IAAIR;EAAO,OAAOQ,EAAE,QAAQ,IAAIR;EAAO,QAAQQ,EAAE,SAAS,IAAIR;CACrF;CAEA,OADIG,EAAYM,GAAOL,GAAGC,CAAC,IAAU,KAC9BK,EAAQT,CAAM,KAAKK,EAAcG,GAAOL,GAAGC,GAAG,GAAGE,CAAI;AAC9D"}
@@ -1,38 +1,39 @@
1
1
  import { HANDLE_BASE_PX as e, targetSizesPx as t } from "../../core/device/targets.js";
2
2
  import { defaultDrawOne as n, defaultPaintBounds as r, paintBoundsFor as i } from "../defaultDrawOne.js";
3
3
  import { KIT_SHAPE_KINDS as a } from "../../core/shapeKinds.js";
4
+ import { isCustomEntry as o } from "../layerSlots.js";
4
5
  import "@weasel-js/routing/react";
5
6
  //#region src/canvas/SceneCanvas/props.ts
6
- var o = e;
7
- function s(e, a = 1) {
8
- let o = {
7
+ var s = e;
8
+ function c(e, a = 1) {
9
+ let s = {
9
10
  scene: {
10
11
  drawOne: n,
11
12
  paintBounds: r
12
13
  },
13
14
  selectionOverlay: { handles: { size: t(a).handle } }
14
15
  };
15
- if (!e) return o;
16
- let s = { ...e };
17
- if (!("scene" in e)) s.scene = o.scene;
18
- else if (e.scene === null) s.scene = null;
16
+ if (!e) return s;
17
+ let c = { ...e };
18
+ if (!("scene" in e)) c.scene = s.scene;
19
+ else if (e.scene === null || o(e.scene)) c.scene = e.scene;
19
20
  else {
20
21
  let t = {
21
- ...o.scene,
22
+ ...s.scene,
22
23
  ...e.scene
23
24
  };
24
- s.scene = e.scene && "paintBounds" in e.scene ? t : {
25
+ c.scene = e.scene && "paintBounds" in e.scene ? t : {
25
26
  ...t,
26
27
  paintBounds: i(t.drawOne)
27
28
  };
28
29
  }
29
- return s.selectionOverlay = "selectionOverlay" in e ? e.selectionOverlay === null ? null : {
30
- ...o.selectionOverlay,
30
+ return c.selectionOverlay = "selectionOverlay" in e ? e.selectionOverlay === null || o(e.selectionOverlay) ? e.selectionOverlay : {
31
+ ...s.selectionOverlay,
31
32
  ...e.selectionOverlay
32
- } : o.selectionOverlay, s;
33
+ } : s.selectionOverlay, c;
33
34
  }
34
- var c = ["select", "hand"], l = [...c, ...a];
35
+ var l = ["select", "hand"], u = [...l, ...a];
35
36
  //#endregion
36
- export { l as BUILTIN_TOOL_IDS, o as DEFAULT_HANDLE_SIZE, c as NON_SHAPE_BUILTIN_TOOLS, s as mergeLayersWithDefaults };
37
+ export { u as BUILTIN_TOOL_IDS, s as DEFAULT_HANDLE_SIZE, l as NON_SHAPE_BUILTIN_TOOLS, c as mergeLayersWithDefaults };
37
38
 
38
39
  //# sourceMappingURL=props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","names":["DEFAULT_HANDLE_SIZE","HANDLE_BASE_PX","mergeLayersWithDefaults","defaults","defaultDrawOne","defaultPaintBounds","targetSizesPx","targetScale","user","result","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 { FillStyle } 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, NodeId, Scene, SerializedScene } from 'core/scene/types';\nimport type { SelectionApi, UseSelectionOptions } from 'core/selection/useSelection';\nimport type { BuiltinShapeToolId } from 'core/shapeKinds';\nimport { KIT_SHAPE_KINDS } from 'core/shapeKinds';\nimport type { PanBounds } 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 '../../animation/types';\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 '../../renderer';\nimport type { AnyTool } from '../../tools/overlayBinding';\nimport type { ToolsApi } from '../../tools/overlayBinding';\nimport type { CanvasProps, LayersMap, SceneSlotConfig } from '../Canvas';\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 {\n Feature\n} from './features';\nimport type { BuiltinToolOptions } from './useBuiltinShapeTools';\nimport type { VersionCheck } from './useContributionRoles';\n\n/**\n * Minimal adapter surface the legacy bridge factories need for delete /\n * duplicate / group / ungroup. Extracted from `SceneCanvasAdapter` to avoid\n * threading the full generic type through `StandardActionsRegistrar` (which is\n * non-generic). The actual adapter supplied is always a `SceneCanvasAdapter`\n * so the cast is safe.\n */\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`. Used by the SceneCanvas defaults;\n * consumers override via `selectTool.handleHitRadius` or\n * `layers.selectionOverlay.handles.size`.\n *\n * Deliberately unscaled: consumers reading this constant keep getting the\n * number they always got. Kit-internal use sites multiply by\n * `DeviceProfile.targetScale`. */\nexport const DEFAULT_HANDLE_SIZE = HANDLE_BASE_PX;\n\n// ---------------------------------------------------------------------------\n// Dev-only coord trace\n// ---------------------------------------------------------------------------\n\n/**\n * `import.meta.env.DEV`, read through a cast rather than off a typed\n * `ImportMeta`. Core must not depend on a bundler's ambient augmentation\n * (`vite/client`) to compile — until core moved into `packages/core/`, two\n * call sites below read `import.meta.env` bare and only type-checked because\n * `apps/site/vite-env.d.ts` leaked its `/// <reference types=\"vite/client\" />`\n * into the shared root-tsconfig program. Isolating core's build surfaced it.\n * Mirrors the same cast in dispatcher.ts and buildDeps.ts.\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 (the existing \"disable this slot\" convention).\n * Partial slot configs (e.g. `{ scene: { drawOne: customFn } }`) are\n * shallow-spread on top of the default slot config.\n *\n * `targetScale` comes from the resolved {@link DeviceProfile}. It is a\n * parameter rather than a read because this function is module-scope and\n * the profile is a hook value; the caller inside the component passes it. */\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) {\n result.scene = null;\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) {\n result.selectionOverlay = null;\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<Node<TData, TLayer, TPose>, TPose>,\n | 'adapter'\n | 'moveOptions' | 'resizeOptions' | 'rotateOptions'\n | 'snap' | 'pickEvery' | 'boundsOf' | 'handleHitRadius'\n | 'selection' | 'selectionOptions' | 'tools'\n | 'layers' // stripped so we can re-add as optional below\n | 'onBackgroundClick' // SceneCanvas synthesizes this; not a consumer prop\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 >\n & {\n /** A `Scene` (typically from `useScene`) — or a `SerializedScene`\n * JSON object, which SceneCanvas bakes into a Scene internally on\n * first render. The serialized form is read once; subsequent\n * changes to the prop are ignored. Pass a `key` prop on\n * `<SceneCanvas>` to force a fresh canvas from updated JSON.\n *\n * The accepted JSON shape is intentionally relaxed (`version:\n * number` rather than `1` literal) so a `import json from './x.json'`\n * result satisfies the type without an `as` cast — Vite infers\n * number-literal types as `number` from JSON, which the strict\n * `SerializedScene<…>` would reject. */\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 /** How a child's stored pose folds into its parent's frame. Omit for the\n * absolute-pose model, where a container groups its children but imposes\n * no transform. Pass `RIGID_POSE_COMPOSITION` to make a container's pose\n * a frame, so rotating it rotates its contents and moving it carries them\n * without touching their poses. */\n poseComposition?: SceneToAdapterOptions<TData, TLayer, TPose>['poseComposition'];\n\n /**\n * Optional consumer seam for eager geometry sync: lets pose-transform\n * actions (move, resize, nudge, flip — NOT rotate) also rewrite a node's\n * data-held geometry. Given a node and the affine `m` applied to its pose,\n * `transform(node, m)` returns updated `data` (geometry mapped by `m`) or\n * `null` for nodes with no data-held geometry.\n *\n * Strictly opt-in: when absent, the kit emits only the pose op and leaves\n * `data` untouched. Consumers wire this via `geometryProjection={myProjection}`.\n *\n * @see GeometryProjection\n */\n geometryProjection?: GeometryProjection;\n\n /**\n * Routing-trait classifiers — list of `NodeRoutingEntry` entries. The kit\n * constructs a `NodeRouting` registry per-`<SceneCanvas>` from this prop,\n * then uses the resulting classifier to derive each hit's `kind` when\n * building `getNodeAtPoint`. Tool routing tables (e.g.\n * `{ target: 'rect', actionId: 'move' }`) match against the produced\n * kind strings.\n *\n * Pass `defaultNodeRouting` to pick up the kit's built-in shape kinds\n * (rect, ellipse, polygon, …) for `data: { kind: '<shape>' }` nodes.\n * Spread additional entries for consumer-defined kinds.\n *\n * See `docs/superpowers/specs/2026-05-24-node-traits-reframe-design.md`.\n *\n * **Memoize the `routing` value.** The kit memoizes the registry on the\n * prop's reference identity. Passing a fresh array each render\n * (e.g. `routing={[...defaultNodeRouting, custom]}` inline) rebuilds the\n * registry and cascades into a new adapter, churning gesture state.\n * Define the list as a module-level constant, or wrap it in `useMemo`.\n * (`defaultNodeRouting` alone is a stable module-level constant; spreading\n * it with extras is what needs the memo.)\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. What every\n * consumer got before `'shape'` existed, and now the opt-out.\n * - `'shape'` (default) — the pose rect as a pre-filter, then the ink the painter\n * actually lays down: its silhouette (`findShapeSilhouette`) filled\n * or not per the painter's `ink`, plus its outline widened by the\n * stroke half-width and `pickTolerancePx`. A click in the concave\n * notch of a star, in the corner outside an ellipse, or in the blank\n * half of a text box falls through to whatever is beneath; a click on\n * the thin outline of an unfilled shape hits it.\n *\n * Painters with no silhouette are unaffected — they keep the pose-rect\n * answer either way, so this can never make a node unreachable.\n *\n * Ignored when `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. Default 4.\n *\n * Screen pixels rather than world units so the target keeps its\n * apparent size at any zoom. It widens the outline test under\n * `picking: 'shape'` (a 1px hairline is otherwise a half-world-unit\n * target, which is unhittable), and it grows the pose-rect pre-filter\n * so those outline hits 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, so a\n * consumer whose objects don't rotate (e.g. a floor-plan / garden\n * editor) opts out with a single switch instead of pairing\n * `actions={{ rotate: null }}` with a `chromeVisibility` override. */\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 // --- Insert tool: when `create` is supplied, the synthesized adapter\n // exposes `commitInsert` and inserted objects are added as leaves on\n // `layer` (default `'default'`). ---\n insertTool?: {\n create: SceneToAdapterOptions<TData, TLayer, TPose>['commitInsert'];\n layer?: TLayer;\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 and stroke a kit-built shape is inserted with, by tool `kind`\n * 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 * `handlers` are 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). `resolveSrc` overrides the\n * image handler's `data:`-URI embed (e.g. upload to an asset store,\n * return the URL). `svg.unpack` makes the kit SVG handler parse dropped\n * SVG files into native scene nodes instead of keeping each one a\n * single embedded-image node.\n * `clipboard` configures the kit weasel-JSON paste handler: enabled by\n * default (pastes of weasel clipboard payloads re-materialize through\n * this canvas's adapter); `reviver` restores JSON-unfriendly values the\n * copying side encoded via `jsonReplacer` (typed arrays etc.);\n * `enabled: false` opts the canvas out — but note the kit handler\n * still consumes weasel-matching items at match time; on a disabled\n * canvas it declines inert (a dwarn, nothing ingested) rather than\n * falling through. Only items that never match (non-weasel text)\n * flow on to other handlers.\n * `clipboard` also governs Cmd/Ctrl+V under the `edit` preset; the rest\n * takes the `ingest` preset.\n * Memoize `handlers` (useState/useMemo/module const) — an inline array\n * literal re-registers the handlers on every render. The same applies\n * to `clipboard.reviver`: an inline function identity-churns the\n * memoized clipboard ctx each render (harmless but wasteful). */\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 ---\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 // --- Tools: extend, override, or take over ---\n /** Extra tools or overrides keyed by id, or a full `ToolsApi` takeover.\n *\n * **Patch form** (`Record<string, AnyTool | 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 * - `AnyTool` 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, AnyTool | true | false>;\n\n /**\n * Auto-wire keyboard shortcuts. Default `true`. When `false`, SceneCanvas\n * still mounts its tools but routes no keyboard input to them: it neither\n * subscribes the legacy `useKeybindings` hook (tool hotkeys) nor lets the\n * gesture dispatcher attach its `keydown`/`keyup` listeners (modern\n * keyboard-bound actions like delete / escape / nudge). Pointer, wheel, and\n * contextmenu interactions are unaffected. Leaves the consumer free to call\n * `useKeybindings(tools, { ... })` themselves (e.g. with `disable`,\n * `overrides`, or `defaultTool`).\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`) inside\n * `<SceneCanvas>`. Default `true`. When `false`, the dispatcher is not\n * wired — useful in tests or demos that drive actions through alternative\n * mechanisms, or that want to call `useGestureDispatcher` themselves.\n *\n * The dispatcher reads registered actions' `defaultBinding` fields and\n * routes matching window keydown / canvas pointer / wheel events to the\n * corresponding `invoker.run` (or `invoker.start` for ongoing gestures).\n */\n enableGestureDispatcher?: boolean;\n\n /**\n * Called once after SceneCanvas constructs (or receives) its\n * `ToolsApi`. Useful for introspection — e.g. the toolkit-builder\n * dev surface walks `tools.registry` to render the live route table.\n * Fires with the consumer-supplied `tools` prop when present, or with\n * the internally-synthesized one otherwise.\n */\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. The lasso demo starts with\n * `initialActiveTool=\"lasso\"`. Ignored when the consumer supplies their\n * 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 * All three are wired by registering the kit's `viewport.*` action\n * descriptors with the actions registry — disabling via the `actions`\n * prop (`actions: { 'viewport.wheelPan': null }`) also works and runs\n * after this.\n *\n * Without `view`, none of them are wired. */\n viewport?: {\n inertia?: boolean | { friction?: number; minSpeed?: number; boundary?: 'stop' | 'bounce' | 'spring'; bounds?: PanBounds };\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. Resolution rules:\n * see `docs/superpowers/specs/2026-05-09-actions-registry-design.md` §D.\n * Pass `null` to disable all defaults.\n */\n actions?: ActionsProp;\n\n /**\n * @experimental\n * Inputs the kit can't synthesize on its own — currently `cloneNode`\n * for the `duplicate` default. When omitted, the `duplicate` default is\n * silently dropped from the registered set.\n */\n /** @deprecated unused after legacy-bridge removal; will be deleted */\n actionDefaults?: {\n cloneNode?: (id: NodeId, offset: { dx: number; dy: number }) => { id: NodeId };\n /** Per-clone offset for the duplicate default. Default {dx:8,dy:8}. */\n duplicateOffset?: { dx: number; dy: number };\n /** Base nudge step. Default 1. */\n nudgeStep?: number;\n /** Shifted nudge step. Default 10. */\n nudgeShiftStep?: number;\n };\n\n /**\n * @experimental\n * Optional resolver: given a scene node, return a short human-readable\n * \"kind\" label (e.g. `'rectangle'`, `'path'`, `'sticky note'`). When\n * supplied, the kit publishes per-id kinds into any surrounding\n * `<SelectionContextProvider>` so non-canvas UI (palette, status bar)\n * can render type-aware copy. Return `undefined` to skip an entry.\n *\n * Default behavior when omitted: containers report `'group'`, paths\n * (poses with a `kind` property) report `'path'`, everything else is\n * left unlabelled.\n */\n describeKind?: (node: Node<TData, TLayer, TPose>) => string | undefined;\n\n /**\n * Optional animator to bind for per-frame redraws. When supplied,\n * SceneCanvas subscribes to `animator.onTick` and requests a redraw on\n * every active animation frame, and paints `animator.colorOverrides`\n * onto the scene's nodes: the kit's path and shape painters apply them,\n * and a custom `drawOne` receives them as `ctx.vertexColors`. Scene\n * mutations trigger repaints automatically, but `colorOverrides` writes\n * do not.\n *\n * Omit when no animation channel touches the render pipeline; idle\n * frames don't cost anything if no animations are active (the animator's\n * subscriber list stays quiet).\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\n * composable {@link Condition} built from the\n * `cond()` builder. Merged on top of the kit's `defaultVisibilityRules`;\n * unspecified ids fall through to the defaults.\n *\n * Set an id to `never` to suppress a chrome element entirely (also\n * unhittable). Set to `always` to force-show. Mix `cond(...)` chains\n * (e.g. `selectionIs(1).and(focused).andNot(gesturing)`) for the in-\n * between cases.\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 /**\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 * Reach for this in three cases: tests that need a coarse profile without\n * stubbing `matchMedia`, demos that want to show touch-sized chrome on a\n * desktop, and hybrid devices where the media query guesses wrong.\n */\n device?: Partial<DeviceProfile>;\n\n /**\n * Optional live focus getter for chrome-caps' `focused` ctx field.\n * SceneCanvas does not own focus state by default — wire this when\n * your visibility rules read the `focused` atom (e.g. the kit's\n * default `selection.rotation-handle` rule requires focus). Omit\n * to default `focused` to `true` (rule fires regardless of focus).\n */\n getFocused?: () => boolean;\n\n /**\n * Custom shader programs to compile on the renderer. Forwarded directly\n * to `<Canvas shaders={...} />`. See `CanvasProps.shaders` for details.\n */\n shaders?: ShaderProgramHandle[];\n\n /**\n * Flatness tolerance for curve tessellation, in world units. Forwarded\n * directly to `<Canvas flattenTolerance={...} />`. See\n * `CanvasProps.flattenTolerance` for details.\n */\n flattenTolerance?: number;\n\n /**\n * FillStyle applied to the full canvas behind the scene. Accepts the kit's\n * `FillStyle` union (solid / pattern / linear-gradient / radial-gradient /\n * conic-gradient) so consumers don't have to author a background node\n * just to colorize the canvas. Rendered as a screen-space layer slotted\n * before `'scene'` — independent of pan / zoom.\n */\n backgroundFill?: FillStyle;\n /**\n * Dev HUD: when true, mounts a fixed-position widget in the top-left\n * of the viewport showing live cursor coords in both viewport\n * (client) and canvas (world) frames. Useful for diagnosing pointer-\n * coord drift / pan-zoom misalignment without instrumenting events.\n */\n cursorCoordsHud?: boolean;\n /**\n * Dev HUD: when true, mounts a fixed-position widget just below the\n * cursor-coords HUD listing the ids returned by `pickEvery(world)`\n * under the cursor. Useful for diagnosing hit-test order and\n * container/leaf overlap during select-tool work.\n */\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 * Optional per-id alpha multiplier for the scene-render slot. When\n * supplied, each node's draw output is wrapped in a `GroupDrawCommand`\n * with the returned alpha so the renderer applies the multiplier.\n * Values equal to 1 are a no-op (no wrapper emitted). Typical use:\n * scoping-dim integration dims non-active nodes during a mode transition.\n *\n * Defaults to `() => 1` (no effect).\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 * Optional per-id pointer-interactivity predicate. When supplied, ids\n * for which the predicate returns `false` are excluded from hit-test\n * results — `getNodeAtPoint` returns null for those positions.\n * Typical use: scoping-dim integration suppresses pointer events for\n * non-active nodes during a mode transition.\n *\n * Defaults to `() => true` (all nodes are interactive).\n */\n isPointerInteractive?: (id: string) => boolean;\n\n /**\n * Called when the user double-clicks the canvas. Receives the hit node\n * (id + kind) at the double-click position, or `null` when the click\n * lands on empty canvas. Wired internally via a `dblclick` listener on\n * the canvas element so it doesn't interfere with the pointer-gesture\n * pipeline.\n *\n * Typical use: modality dispatch — enter path-edit on a path node,\n * 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":";;;;;AAyEA,IAAaA,IAAsBC;AAkDnC,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,MACxB,EAAO,QAAQ;MACV;EACL,IAAME,IAAQ;GAAE,GAAGP,EAAS;GAAO,GAAGK,EAAK;EAAM;EACjD,EAAO,QAAQA,EAAK,SAAS,iBAAiBA,EAAK,QAC/CE,IACA;GAAE,GAAGA;GAAO,aAAaC,EAAqCD,EAAM,OAAO;EAAE;CACnF;CAUA,OARA,AACED,EAAO,mBADH,sBAAsBD,IAEjBA,EAAK,qBAAqB,OACT,OAEA;EAAE,GAAGL,EAAS;EAAkB,GAAGK,EAAK;CAAiB,IAJzDL,EAAS,kBAO9BM;AACT;AAQA,IAAaG,IAAiF,CAAC,UAAU,MAAM,GAGlGC,IAA6C,CAAC,GAAGD,GAAyB,GAAGE,CAAe"}
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, 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 {\n ContentHandlerEntry\n} from 'features/ingestion';\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 { 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';\nimport type { SceneCanvasViewport } from './viewportProp';\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 /** 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. 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 * @experimental\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 * @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":";;;;;;AA4DA,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"}
@@ -0,0 +1,50 @@
1
+ import { toPlane as e } from "../../core/viewport/parallax.js";
2
+ import { findShapeInk as t, shapeCoversPoint as n } from "../NodeShape.js";
3
+ import { poseContains as r, poseContainsRotated as i } from "./poseGeometry.js";
4
+ import { applyToPoint as a, meanScale as o, pathContainsPoint as s } from "@weasel-js/geom";
5
+ //#region src/canvas/SceneCanvas/scenePointQuery.ts
6
+ function c(c, l, u) {
7
+ let d = (f, p, m) => {
8
+ let h = o(m), g = {
9
+ px: u,
10
+ scale: m
11
+ };
12
+ return {
13
+ hits: (e, a, o) => {
14
+ let s = l ? t(e, a, { scale: h }) : null, u = {
15
+ ...g,
16
+ px: g.px + (s?.outsetPx ?? 0),
17
+ reach: s?.outset ?? 0
18
+ };
19
+ return (o ? r(o, f, p, u, c) : i(a, f, p, u, c)) ? !l || n(e, a, f, p, {
20
+ tolerance: g,
21
+ scale: h,
22
+ derivedPath: o
23
+ }) : !1;
24
+ },
25
+ clipAdmits: (e) => s(e, f, p),
26
+ inPlane: (t) => {
27
+ let n = e(t, {
28
+ x: f,
29
+ y: p
30
+ });
31
+ return d(n.x, n.y, {
32
+ x: m.x / t.scale.x,
33
+ y: m.y / t.scale.y
34
+ });
35
+ },
36
+ inCopy: (e) => {
37
+ let [t, n] = a(e, f, p), r = Math.sqrt(Math.abs(e[0] * e[3] - e[1] * e[2]));
38
+ return d(t, n, {
39
+ x: m.x / r,
40
+ y: m.y / r
41
+ });
42
+ }
43
+ };
44
+ };
45
+ return d;
46
+ }
47
+ //#endregion
48
+ export { c as scenePointQuery };
49
+
50
+ //# sourceMappingURL=scenePointQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenePointQuery.js","names":["scenePointQuery","pointQuery","scale","meanScale","s","tolerance","pickTolerancePx","ink","shapePicking","findShapeInk","n","pose","slop","derived","poseContains","px","py","d","poseContainsRotated","shapeCoversPoint","pathContainsPoint","clip","p","toPlane","m","x","y","applyToPoint","k"],"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,SAAgBA,EACd,GACA,GACA,GAC2E;CAI3E,IAAMC,KAAc,GAAY,GAAY,MAAkD;EAC5F,IAAMC,IAAQC,EAAUC,CAAC,GACnBC,IAAY;GAAE,IAAIC;GAAiB,OAAOF;EAAE;EAClD,OAAO;GACL,OAAO,GAAG,GAAM,MAAY;IAK1B,IAAMG,IAAMC,IAAeC,EAAaC,GAAYC,GAAM,EAAE,SAAM,CAAC,IAAI,MAKjEC,IAAO;KAAE,GAAGP;KAAW,IAAIA,EAAU,MAAME,GAAK,YAAY;KAAI,OAAOA,GAAK,UAAU;IAAE;IAQ9F,QAPiBM,IACbC,EAAaD,GAAkBE,GAAIC,GAAIJ,GAAMK,CAA4B,IACzEC,EAAoBP,GAAMI,GAAIC,GAAIJ,GAAMK,CAA4B,KAKjE,CAACT,KACHW,EAAiBT,GAAYC,GAAMI,GAAIC,GAAI;KAC5C;KAAW;KAAO,aAAaH;IACjC,CAAC,IAPmB;GAQxB;GACA,aAAa,MAASO,EAAkBC,GAAMN,GAAIC,CAAE;GACpD,UAAU,MAAM;IACd,IAAMM,IAAIC,EAAQC,GAAG;KAAE,GAAGT;KAAI,GAAGC;IAAG,CAAC;IACrC,OAAOf,EAAWqB,EAAE,GAAGA,EAAE,GAAG;KAAE,GAAGlB,EAAE,IAAIoB,EAAE,MAAM;KAAG,GAAGpB,EAAE,IAAIoB,EAAE,MAAM;IAAE,CAAC;GACxE;GACA,SAAS,MAAM;IACb,IAAM,CAACC,GAAGC,KAAKC,EAAaH,GAAGT,GAAIC,CAAE,GAC/BY,IAAI,KAAK,KAAK,KAAK,IAAIJ,EAAE,KAAKA,EAAE,KAAKA,EAAE,KAAKA,EAAE,EAAE,CAAC;IACvD,OAAOvB,EAAWwB,GAAGC,GAAG;KAAE,GAAGtB,EAAE,IAAIwB;KAAG,GAAGxB,EAAE,IAAIwB;IAAE,CAAC;GACpD;EACF;CACF;CACA,OAAO3B;AACT"}
@@ -0,0 +1,52 @@
1
+ import { SHAPE_COUNT_RANGE as e, STAR_RATIO_RANGE as t } from "../../features/paths/shapeGenerator.js";
2
+ import { decimal as n } from "@weasel-js/quantity";
3
+ //#region src/canvas/SceneCanvas/shapeGeneratorProperties.ts
4
+ var r = n({
5
+ maxPlaces: 2,
6
+ grouping: !1
7
+ }), i = {
8
+ polygon: {
9
+ name: "Polygon",
10
+ showIf: { path: "data.generator.sides" },
11
+ members: { "data.generator.sides": {
12
+ kind: "number",
13
+ display: r,
14
+ name: "Sides",
15
+ description: "Number of sides.",
16
+ default: 6,
17
+ min: e.min,
18
+ max: e.max,
19
+ step: 1
20
+ } }
21
+ },
22
+ star: {
23
+ name: "Star",
24
+ showIf: { path: "data.generator.points" },
25
+ members: {
26
+ "data.generator.points": {
27
+ kind: "number",
28
+ display: r,
29
+ name: "Points",
30
+ description: "Number of points.",
31
+ default: 5,
32
+ min: e.min,
33
+ max: e.max,
34
+ step: 1
35
+ },
36
+ "data.generator.innerRadiusRatio": {
37
+ kind: "number",
38
+ name: "Inner",
39
+ description: "Inner radius as a fraction of the outer one.",
40
+ default: .5,
41
+ min: t.min,
42
+ max: t.max,
43
+ step: .01,
44
+ control: "slider"
45
+ }
46
+ }
47
+ }
48
+ };
49
+ //#endregion
50
+ export { i as SHAPE_GENERATOR_SECTIONS };
51
+
52
+ //# sourceMappingURL=shapeGeneratorProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapeGeneratorProperties.js","names":["WHOLE","decimal","SHAPE_GENERATOR_SECTIONS","SHAPE_COUNT_RANGE","STAR_RATIO_RANGE"],"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,IAAMA,IAAQC,EAAQ;CAAE,WAAW;CAAG,UAAU;AAAM,CAAC,GAO1CC,IAAwD;CACnE,SAAS;EACP,MAAM;EACN,QAAQ,EAAE,MAAM,uBAAuB;EACvC,SAAS,EACP,wBAAwB;GACtB,MAAM;GAAU,SAASF;GAAO,MAAM;GAAS,aAAa;GAC5D,SAAS;GAAG,KAAKG,EAAkB;GAAK,KAAKA,EAAkB;GAAK,MAAM;EAC5E,EACF;CACF;CACA,MAAM;EACJ,MAAM;EACN,QAAQ,EAAE,MAAM,wBAAwB;EACxC,SAAS;GACP,yBAAyB;IACvB,MAAM;IAAU,SAASH;IAAO,MAAM;IAAU,aAAa;IAC7D,SAAS;IAAG,KAAKG,EAAkB;IAAK,KAAKA,EAAkB;IAAK,MAAM;GAC5E;GACA,mCAAmC;IACjC,MAAM;IAAU,MAAM;IAAS,aAAa;IAC5C,SAAS;IAAK,KAAKC,EAAiB;IAAK,KAAKA,EAAiB;IAAK,MAAM;IAAM,SAAS;GAC3F;EACF;CACF;AACF"}
@@ -0,0 +1,23 @@
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";
4
+ //#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]);
10
+ }
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`);
14
+ continue;
15
+ }
16
+ c && e in l && console.warn(`[SceneCanvas] tools prop overrides bundled "${e}" tool`), l[e] = t;
17
+ }
18
+ return l;
19
+ }
20
+ //#endregion
21
+ export { r as resolveToolRegistry };
22
+
23
+ //# sourceMappingURL=toolRegistry.js.map
@@ -0,0 +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"}
@@ -0,0 +1,17 @@
1
+ import { useEffect as e } from "react";
2
+ import { useActionsRegistry as t } from "@weasel-js/routing/react";
3
+ //#region src/canvas/SceneCanvas/useActionTunings.ts
4
+ function n(n) {
5
+ let r = t();
6
+ e(() => {
7
+ if (!r || !n) return;
8
+ let e = Object.entries(n).flatMap(([e, t]) => t ? [r.tune(e, t)] : []);
9
+ return () => {
10
+ for (let t of e) t();
11
+ };
12
+ }, [r, n]);
13
+ }
14
+ //#endregion
15
+ export { n as useActionTunings };
16
+
17
+ //# sourceMappingURL=useActionTunings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActionTunings.js","names":["useActionTunings","reg","useActionsRegistry","tune","releases","id","release"],"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,SAAgBA,EAAiB,GAAuC;CACtE,IAAMC,IAAMC,EAAmB;CAC/B,QAAgB;EACd,IAAI,CAACD,KAAO,CAACE,GAAM;EACnB,IAAMC,IAAW,OAAO,QAAQD,CAAI,CAAC,CAAC,SAAS,CAACE,GAAI,OAAQ,IAAI,CAACJ,EAAI,KAAKI,GAAI,CAAiB,CAAC,IAAI,CAAC,CAAE;EACvG,aAAa;GAAE,KAAK,IAAMC,KAAWF,GAAU,EAAQ;EAAG;CAC5D,GAAG,CAACH,GAAKE,CAAI,CAAC;AAChB"}
@@ -42,7 +42,12 @@ function r(r, i) {
42
42
  i
43
43
  ]);
44
44
  }
45
+ function i(e, t) {
46
+ if (e === null) return null;
47
+ let n = { ...e ?? {} };
48
+ return t in n || (n[t] = null), n;
49
+ }
45
50
  //#endregion
46
- export { r as useActionsPropResolver };
51
+ export { i as actionsMuting, r as useActionsPropResolver };
47
52
 
48
53
  //# 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"],"sources":["../../../src/canvas/SceneCanvas/useActionsPropResolver.ts"],"sourcesContent":["/**\n * `useActionsPropResolver` — applies the `actions` prop overrides on top of\n * whatever `useStandardActions` registered. Runs after it (caller mounts this\n * hook last). Resolution rules:\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"],"mappings":";;;;AAuBA,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"}
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"}