@weasel-js/core 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1005) hide show
  1. package/CHANGELOG.md +1006 -0
  2. package/README.md +28 -9
  3. package/dist/WeaselProvider.js +15 -0
  4. package/dist/WeaselProvider.js.map +1 -0
  5. package/dist/affordances/composeAffordanceLayer.js +224 -0
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -0
  7. package/dist/affordances/cornerResize.js +69 -0
  8. package/dist/affordances/cornerResize.js.map +1 -0
  9. package/dist/affordances/hitAffordanceRegions.js +138 -0
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -0
  11. package/dist/affordances/pathAnchors.js +66 -0
  12. package/dist/affordances/pathAnchors.js.map +1 -0
  13. package/dist/affordances/rotationHandle.js +103 -0
  14. package/dist/affordances/rotationHandle.js.map +1 -0
  15. package/dist/animation/behaviors/momentum.js +118 -0
  16. package/dist/animation/behaviors/momentum.js.map +1 -0
  17. package/dist/animation/colorHelpers.js +135 -0
  18. package/dist/animation/colorHelpers.js.map +1 -0
  19. package/dist/animation/colorRegistry.js +37 -0
  20. package/dist/animation/colorRegistry.js.map +1 -0
  21. package/dist/animation/index.js +20 -0
  22. package/dist/animation/loop.js +62 -0
  23. package/dist/animation/loop.js.map +1 -0
  24. package/dist/animation/observe.js +23 -0
  25. package/dist/animation/observe.js.map +1 -0
  26. package/dist/animation/poseHelpers.js +50 -0
  27. package/dist/animation/poseHelpers.js.map +1 -0
  28. package/dist/animation/reflow.js +121 -0
  29. package/dist/animation/reflow.js.map +1 -0
  30. package/dist/animation/rig/bindRig.js +74 -0
  31. package/dist/animation/rig/bindRig.js.map +1 -0
  32. package/dist/animation/rig/blendPoses.js +43 -0
  33. package/dist/animation/rig/blendPoses.js.map +1 -0
  34. package/dist/animation/rig/mirrorPose.js +19 -0
  35. package/dist/animation/rig/mirrorPose.js.map +1 -0
  36. package/dist/animation/rig/resolveSkeleton.js +33 -0
  37. package/dist/animation/rig/resolveSkeleton.js.map +1 -0
  38. package/dist/animation/rig/solveIk.js +103 -0
  39. package/dist/animation/rig/solveIk.js.map +1 -0
  40. package/dist/animation/rig/types.js +12 -0
  41. package/dist/animation/rig/types.js.map +1 -0
  42. package/dist/animation/rig/useRig.js +23 -0
  43. package/dist/animation/rig/useRig.js.map +1 -0
  44. package/dist/animation/slew.js +27 -0
  45. package/dist/animation/slew.js.map +1 -0
  46. package/dist/animation/stagger.js +138 -0
  47. package/dist/animation/stagger.js.map +1 -0
  48. package/dist/animation/timeline/booking.js +106 -0
  49. package/dist/animation/timeline/booking.js.map +1 -0
  50. package/dist/animation/timeline/createTimeline.js +116 -0
  51. package/dist/animation/timeline/createTimeline.js.map +1 -0
  52. package/dist/animation/timeline/sampleTrack.js +29 -0
  53. package/dist/animation/timeline/sampleTrack.js.map +1 -0
  54. package/dist/animation/useAnimator.js +329 -0
  55. package/dist/animation/useAnimator.js.map +1 -0
  56. package/dist/animation/wrappers/animateLifecycle.js +40 -0
  57. package/dist/animation/wrappers/animateLifecycle.js.map +1 -0
  58. package/dist/animation/wrappers/animateOnSetPose.js +44 -0
  59. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -0
  60. package/dist/{autoPoseDescriptor-_XOyF7t4.d.ts → autoPoseDescriptor-BT_vp9FO.d.ts} +2 -2
  61. package/dist/{builtins-HWyuLzE-.d.ts → builtins-BSUfH8nU.d.ts} +1301 -508
  62. package/dist/canvas/Canvas.js +608 -0
  63. package/dist/canvas/Canvas.js.map +1 -0
  64. package/dist/canvas/CanvasView.js +255 -0
  65. package/dist/canvas/CanvasView.js.map +1 -0
  66. package/dist/canvas/CursorCoordsHud.js +75 -0
  67. package/dist/canvas/CursorCoordsHud.js.map +1 -0
  68. package/dist/canvas/DrawCanvas.js +67 -0
  69. package/dist/canvas/DrawCanvas.js.map +1 -0
  70. package/dist/canvas/MinimapCanvas.js +139 -0
  71. package/dist/canvas/MinimapCanvas.js.map +1 -0
  72. package/dist/canvas/ModalityHud.js +66 -0
  73. package/dist/canvas/ModalityHud.js.map +1 -0
  74. package/dist/canvas/NodeShape.js +391 -0
  75. package/dist/canvas/NodeShape.js.map +1 -0
  76. package/dist/canvas/PickHud.js +93 -0
  77. package/dist/canvas/PickHud.js.map +1 -0
  78. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +10 -0
  79. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -0
  80. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -0
  81. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -0
  82. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +51 -0
  83. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -0
  84. package/dist/canvas/SceneCanvas/contributionFrameHooks.js +42 -0
  85. package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -0
  86. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +549 -0
  87. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -0
  88. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +26 -0
  89. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -0
  90. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +69 -0
  91. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -0
  92. package/dist/canvas/SceneCanvas/features.js +97 -0
  93. package/dist/canvas/SceneCanvas/features.js.map +1 -0
  94. package/dist/canvas/SceneCanvas/poseGeometry.js +46 -0
  95. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -0
  96. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +48 -0
  97. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -0
  98. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +70 -0
  99. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -0
  100. package/dist/canvas/SceneCanvas/useContributionRoles.js +75 -0
  101. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -0
  102. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +172 -0
  103. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -0
  104. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +69 -0
  105. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -0
  106. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +127 -0
  107. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -0
  108. package/dist/canvas/SceneCanvas/useViewportActions.js +30 -0
  109. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -0
  110. package/dist/canvas/SceneCanvas.js +992 -0
  111. package/dist/canvas/SceneCanvas.js.map +1 -0
  112. package/dist/canvas/SceneViewCanvas.js +54 -0
  113. package/dist/canvas/SceneViewCanvas.js.map +1 -0
  114. package/dist/canvas/accentColor.js +9 -0
  115. package/dist/canvas/accentColor.js.map +1 -0
  116. package/dist/canvas/affordanceAt.js +63 -0
  117. package/dist/canvas/affordanceAt.js.map +1 -0
  118. package/dist/canvas/buildSceneTree.js +65 -0
  119. package/dist/canvas/buildSceneTree.js.map +1 -0
  120. package/dist/canvas/canvasRenderer.js +89 -0
  121. package/dist/canvas/canvasRenderer.js.map +1 -0
  122. package/dist/canvas/colorOverrides.js +16 -0
  123. package/dist/canvas/colorOverrides.js.map +1 -0
  124. package/dist/canvas/defaultDrawOne.js +43 -0
  125. package/dist/canvas/defaultDrawOne.js.map +1 -0
  126. package/dist/canvas/deps/areaSelect.js +19 -0
  127. package/dist/canvas/deps/areaSelect.js.map +1 -0
  128. package/dist/canvas/deps/debug.js +9 -0
  129. package/dist/canvas/deps/debug.js.map +1 -0
  130. package/dist/canvas/deps/dispatcher.js +11 -0
  131. package/dist/canvas/deps/dispatcher.js.map +1 -0
  132. package/dist/canvas/deps/editAnchors.js +101 -0
  133. package/dist/canvas/deps/editAnchors.js.map +1 -0
  134. package/dist/canvas/deps/geometryProjection.js +11 -0
  135. package/dist/canvas/deps/geometryProjection.js.map +1 -0
  136. package/dist/canvas/deps/hitTestArea.js +51 -0
  137. package/dist/canvas/deps/hitTestArea.js.map +1 -0
  138. package/dist/canvas/deps/ingestion.js +31 -0
  139. package/dist/canvas/deps/ingestion.js.map +1 -0
  140. package/dist/canvas/deps/insert.js +116 -0
  141. package/dist/canvas/deps/insert.js.map +1 -0
  142. package/dist/canvas/deps/lassoSelect.js +20 -0
  143. package/dist/canvas/deps/lassoSelect.js.map +1 -0
  144. package/dist/canvas/deps/layout.js +34 -0
  145. package/dist/canvas/deps/layout.js.map +1 -0
  146. package/dist/canvas/deps/nodeAtPoint.js +19 -0
  147. package/dist/canvas/deps/nodeAtPoint.js.map +1 -0
  148. package/dist/canvas/deps/poseComposition.js +11 -0
  149. package/dist/canvas/deps/poseComposition.js.map +1 -0
  150. package/dist/canvas/deps/poseDescriptor.js +12 -0
  151. package/dist/canvas/deps/poseDescriptor.js.map +1 -0
  152. package/dist/canvas/deps/resizePolicy.js +35 -0
  153. package/dist/canvas/deps/resizePolicy.js.map +1 -0
  154. package/dist/canvas/deps/slice.js +99 -0
  155. package/dist/canvas/deps/slice.js.map +1 -0
  156. package/dist/canvas/deps/snap.js +11 -0
  157. package/dist/canvas/deps/snap.js.map +1 -0
  158. package/dist/canvas/deps/textEdit.js +21 -0
  159. package/dist/canvas/deps/textEdit.js.map +1 -0
  160. package/dist/canvas/deps/view.js +43 -0
  161. package/dist/canvas/deps/view.js.map +1 -0
  162. package/dist/canvas/derivedPath.js +47 -0
  163. package/dist/canvas/derivedPath.js.map +1 -0
  164. package/dist/canvas/drawEnvelope.js +22 -0
  165. package/dist/canvas/drawEnvelope.js.map +1 -0
  166. package/dist/canvas/getNodeAtPoint.js +18 -0
  167. package/dist/canvas/getNodeAtPoint.js.map +1 -0
  168. package/dist/canvas/hostAnchor.js +29 -0
  169. package/dist/canvas/hostAnchor.js.map +1 -0
  170. package/dist/canvas/hud.module.js +18 -0
  171. package/dist/canvas/hud.module.js.map +1 -0
  172. package/dist/canvas/insertPreviewExtent.js +103 -0
  173. package/dist/canvas/insertPreviewExtent.js.map +1 -0
  174. package/dist/canvas/kitRequirements.js +177 -0
  175. package/dist/canvas/kitRequirements.js.map +1 -0
  176. package/dist/canvas/layerOrder.js +66 -0
  177. package/dist/canvas/layerOrder.js.map +1 -0
  178. package/dist/canvas/layerSlots.js +14 -0
  179. package/dist/canvas/layerSlots.js.map +1 -0
  180. package/dist/canvas/minimapMath.js +80 -0
  181. package/dist/canvas/minimapMath.js.map +1 -0
  182. package/dist/canvas/mountedCanvases.js +20 -0
  183. package/dist/canvas/mountedCanvases.js.map +1 -0
  184. package/dist/canvas/overlayRoleStrokes.js +17 -0
  185. package/dist/canvas/overlayRoleStrokes.js.map +1 -0
  186. package/dist/canvas/paintCull.js +20 -0
  187. package/dist/canvas/paintCull.js.map +1 -0
  188. package/dist/canvas/pickWalk.js +158 -0
  189. package/dist/canvas/pickWalk.js.map +1 -0
  190. package/dist/canvas/planeClips.js +30 -0
  191. package/dist/canvas/planeClips.js.map +1 -0
  192. package/dist/canvas/poseRotation.js +35 -0
  193. package/dist/canvas/poseRotation.js.map +1 -0
  194. package/dist/canvas/rasterToPng.js +21 -0
  195. package/dist/canvas/rasterToPng.js.map +1 -0
  196. package/dist/canvas/renderDebugSnapshot.js +32 -0
  197. package/dist/canvas/renderDebugSnapshot.js.map +1 -0
  198. package/dist/canvas/renderNeeds.js +25 -0
  199. package/dist/canvas/renderNeeds.js.map +1 -0
  200. package/dist/canvas/renderSceneToPixels.js +143 -0
  201. package/dist/canvas/renderSceneToPixels.js.map +1 -0
  202. package/dist/canvas/sceneAdapter.js +270 -0
  203. package/dist/canvas/sceneAdapter.js.map +1 -0
  204. package/dist/canvas/sceneLayerPaint.js +37 -0
  205. package/dist/canvas/sceneLayerPaint.js.map +1 -0
  206. package/dist/canvas/sceneSlotWiring.js +20 -0
  207. package/dist/canvas/sceneSlotWiring.js.map +1 -0
  208. package/dist/canvas/sceneViewRender.js +72 -0
  209. package/dist/canvas/sceneViewRender.js.map +1 -0
  210. package/dist/canvas/slopsDebugLayer.js +61 -0
  211. package/dist/canvas/slopsDebugLayer.js.map +1 -0
  212. package/dist/canvas/surfaceContribution.js +15 -0
  213. package/dist/canvas/surfaceContribution.js.map +1 -0
  214. package/dist/canvas/toolPreview.js +39 -0
  215. package/dist/canvas/toolPreview.js.map +1 -0
  216. package/dist/canvas/useCanvasRenderer.js +11 -0
  217. package/dist/canvas/useCanvasRenderer.js.map +1 -0
  218. package/dist/canvas/useFrameLoop.js +60 -0
  219. package/dist/canvas/useFrameLoop.js.map +1 -0
  220. package/dist/canvas/useHostAnchor.js +71 -0
  221. package/dist/canvas/useHostAnchor.js.map +1 -0
  222. package/dist/canvas/useLateContentRedraw.js +21 -0
  223. package/dist/canvas/useLateContentRedraw.js.map +1 -0
  224. package/dist/canvas/useRedrawOn.js +21 -0
  225. package/dist/canvas/useRedrawOn.js.map +1 -0
  226. package/dist/canvas/useViewHelpers.js +120 -0
  227. package/dist/canvas/useViewHelpers.js.map +1 -0
  228. package/dist/canvas/viewInputs.js +17 -0
  229. package/dist/canvas/viewInputs.js.map +1 -0
  230. package/dist/canvas/viewRegistry.js +61 -0
  231. package/dist/canvas/viewRegistry.js.map +1 -0
  232. package/dist/canvas/wrapNodeOutput.js +14 -0
  233. package/dist/canvas/wrapNodeOutput.js.map +1 -0
  234. package/dist/clipboard.d.ts +10 -5
  235. package/dist/clipboard.js +3 -5
  236. package/dist/clone.d.ts +3 -3
  237. package/dist/clone.js +2 -5
  238. package/dist/core/adapters/arrayAdapter.js +85 -0
  239. package/dist/core/adapters/arrayAdapter.js.map +1 -0
  240. package/dist/core/adapters/useArrayAdapter.js +13 -0
  241. package/dist/core/adapters/useArrayAdapter.js.map +1 -0
  242. package/dist/core/applyOps.js +12 -0
  243. package/dist/core/applyOps.js.map +1 -0
  244. package/dist/core/device/index.js +4 -0
  245. package/dist/core/device/targets.js +17 -0
  246. package/dist/core/device/targets.js.map +1 -0
  247. package/dist/core/device/useDeviceProfile.js +75 -0
  248. package/dist/core/device/useDeviceProfile.js.map +1 -0
  249. package/dist/core/fillInPoseFrame.js +102 -0
  250. package/dist/core/fillInPoseFrame.js.map +1 -0
  251. package/dist/core/geometry/poseDescriptor.js +98 -0
  252. package/dist/core/geometry/poseDescriptor.js.map +1 -0
  253. package/dist/core/geometry/poseRotation.js +58 -0
  254. package/dist/core/geometry/poseRotation.js.map +1 -0
  255. package/dist/core/geometry/regionHit.js +102 -0
  256. package/dist/core/geometry/regionHit.js.map +1 -0
  257. package/dist/core/geometry/unionBounds.js +60 -0
  258. package/dist/core/geometry/unionBounds.js.map +1 -0
  259. package/dist/core/gradient.js +136 -0
  260. package/dist/core/gradient.js.map +1 -0
  261. package/dist/core/isPlainObject.js +11 -0
  262. package/dist/core/isPlainObject.js.map +1 -0
  263. package/dist/core/layers/render.js +150 -0
  264. package/dist/core/layers/render.js.map +1 -0
  265. package/dist/core/markerInset.js +24 -0
  266. package/dist/core/markerInset.js.map +1 -0
  267. package/dist/core/mixed.js +6 -0
  268. package/dist/core/mixed.js.map +1 -0
  269. package/dist/core/ops/arrange.js +31 -0
  270. package/dist/core/ops/arrange.js.map +1 -0
  271. package/dist/core/ops/create.js +32 -0
  272. package/dist/core/ops/create.js.map +1 -0
  273. package/dist/core/ops/createHistory.js +20 -0
  274. package/dist/core/ops/createHistory.js.map +1 -0
  275. package/dist/core/ops/delete.js +89 -0
  276. package/dist/core/ops/delete.js.map +1 -0
  277. package/dist/core/ops/registry.js +17 -0
  278. package/dist/core/ops/registry.js.map +1 -0
  279. package/dist/core/ops/reorder/algorithms.js +55 -0
  280. package/dist/core/ops/reorder/algorithms.js.map +1 -0
  281. package/dist/core/ops/reorder/index.js +140 -0
  282. package/dist/core/ops/reorder/index.js.map +1 -0
  283. package/dist/core/ops/reparent.js +52 -0
  284. package/dist/core/ops/reparent.js.map +1 -0
  285. package/dist/core/ops/select.js +34 -0
  286. package/dist/core/ops/select.js.map +1 -0
  287. package/dist/core/ops/setData.js +34 -0
  288. package/dist/core/ops/setData.js.map +1 -0
  289. package/dist/core/ops/setLayer.js +34 -0
  290. package/dist/core/ops/setLayer.js.map +1 -0
  291. package/dist/core/ops/setLayout.js +31 -0
  292. package/dist/core/ops/setLayout.js.map +1 -0
  293. package/dist/core/ops/setPath.js +57 -0
  294. package/dist/core/ops/setPath.js.map +1 -0
  295. package/dist/core/ops/setText.js +34 -0
  296. package/dist/core/ops/setText.js.map +1 -0
  297. package/dist/core/ops/slot.js +37 -0
  298. package/dist/core/ops/slot.js.map +1 -0
  299. package/dist/core/ops/transform.js +42 -0
  300. package/dist/core/ops/transform.js.map +1 -0
  301. package/dist/core/paintKinds.js +156 -0
  302. package/dist/core/paintKinds.js.map +1 -0
  303. package/dist/core/scene/NodeProperties.js +20 -0
  304. package/dist/core/scene/NodeProperties.js.map +1 -0
  305. package/dist/core/scene/NodeRouting.js +24 -0
  306. package/dist/core/scene/NodeRouting.js.map +1 -0
  307. package/dist/core/scene/arrivals.js +12 -0
  308. package/dist/core/scene/arrivals.js.map +1 -0
  309. package/dist/core/scene/composeFrame.js +29 -0
  310. package/dist/core/scene/composeFrame.js.map +1 -0
  311. package/dist/core/scene/depMemo.js +18 -0
  312. package/dist/core/scene/depMemo.js.map +1 -0
  313. package/dist/core/scene/dependents.js +66 -0
  314. package/dist/core/scene/dependents.js.map +1 -0
  315. package/dist/core/scene/derivedPath.js +31 -0
  316. package/dist/core/scene/derivedPath.js.map +1 -0
  317. package/dist/core/scene/effectivePose.js +78 -0
  318. package/dist/core/scene/effectivePose.js.map +1 -0
  319. package/dist/core/scene/kitRegistry.js +33 -0
  320. package/dist/core/scene/kitRegistry.js.map +1 -0
  321. package/dist/core/scene/layoutPass.js +96 -0
  322. package/dist/core/scene/layoutPass.js.map +1 -0
  323. package/dist/core/scene/nodeFnFields.js +83 -0
  324. package/dist/core/scene/nodeFnFields.js.map +1 -0
  325. package/dist/core/scene/nodeMemo.js +28 -0
  326. package/dist/core/scene/nodeMemo.js.map +1 -0
  327. package/dist/core/scene/poseFeed.js +87 -0
  328. package/dist/core/scene/poseFeed.js.map +1 -0
  329. package/dist/core/scene/poseOverrides.js +52 -0
  330. package/dist/core/scene/poseOverrides.js.map +1 -0
  331. package/dist/core/scene/poseSnapshot.js +54 -0
  332. package/dist/core/scene/poseSnapshot.js.map +1 -0
  333. package/dist/core/scene/scene.js +1271 -0
  334. package/dist/core/scene/scene.js.map +1 -0
  335. package/dist/core/scene/types.js +6 -0
  336. package/dist/core/scene/types.js.map +1 -0
  337. package/dist/core/scene/useScene.js +32 -0
  338. package/dist/core/scene/useScene.js.map +1 -0
  339. package/dist/core/selection/chromeState.js +31 -0
  340. package/dist/core/selection/chromeState.js.map +1 -0
  341. package/dist/core/selection/selectionTarget.js +6 -0
  342. package/dist/core/selection/selectionTarget.js.map +1 -0
  343. package/dist/core/selection/useSelection.js +71 -0
  344. package/dist/core/selection/useSelection.js.map +1 -0
  345. package/dist/core/shapeKinds.js +54 -0
  346. package/dist/core/shapeKinds.js.map +1 -0
  347. package/dist/core/strokeMarkerShapes.js +139 -0
  348. package/dist/core/strokeMarkerShapes.js.map +1 -0
  349. package/dist/core/strokeMarkers.js +28 -0
  350. package/dist/core/strokeMarkers.js.map +1 -0
  351. package/dist/core/stylus/stylus.js +39 -0
  352. package/dist/core/stylus/stylus.js.map +1 -0
  353. package/dist/core/stylus/usePointerStylus.js +51 -0
  354. package/dist/core/stylus/usePointerStylus.js.map +1 -0
  355. package/dist/core/usePaintKinds.js +17 -0
  356. package/dist/core/usePaintKinds.js.map +1 -0
  357. package/dist/core/viewport/clampView.js +24 -0
  358. package/dist/core/viewport/clampView.js.map +1 -0
  359. package/dist/core/viewport/clientToWorld.js +8 -0
  360. package/dist/core/viewport/clientToWorld.js.map +1 -0
  361. package/dist/core/viewport/createVelocityTracker.js +39 -0
  362. package/dist/core/viewport/createVelocityTracker.js.map +1 -0
  363. package/dist/core/viewport/fitToBounds.js +18 -0
  364. package/dist/core/viewport/fitToBounds.js.map +1 -0
  365. package/dist/core/viewport/fitViewToBounds.js +36 -0
  366. package/dist/core/viewport/fitViewToBounds.js.map +1 -0
  367. package/dist/core/viewport/interpolateView.js +34 -0
  368. package/dist/core/viewport/interpolateView.js.map +1 -0
  369. package/dist/core/viewport/meanScale.js +8 -0
  370. package/dist/core/viewport/meanScale.js.map +1 -0
  371. package/dist/core/viewport/parallax.js +111 -0
  372. package/dist/core/viewport/parallax.js.map +1 -0
  373. package/dist/core/viewport/pxExtent.js +42 -0
  374. package/dist/core/viewport/pxExtent.js.map +1 -0
  375. package/dist/core/viewport/sceneNodeClientRect.js +18 -0
  376. package/dist/core/viewport/sceneNodeClientRect.js.map +1 -0
  377. package/dist/core/viewport/screenSlop.js +27 -0
  378. package/dist/core/viewport/screenSlop.js.map +1 -0
  379. package/dist/core/viewport/useAutoCenter.js +32 -0
  380. package/dist/core/viewport/useAutoCenter.js.map +1 -0
  381. package/dist/core/viewport/useCanvasSize.js +29 -0
  382. package/dist/core/viewport/useCanvasSize.js.map +1 -0
  383. package/dist/core/viewport/useDecayLoop.js +63 -0
  384. package/dist/core/viewport/useDecayLoop.js.map +1 -0
  385. package/dist/core/viewport/useVelocityTracker.js +10 -0
  386. package/dist/core/viewport/useVelocityTracker.js.map +1 -0
  387. package/dist/core/viewport/useViewAnimation.js +63 -0
  388. package/dist/core/viewport/useViewAnimation.js.map +1 -0
  389. package/dist/core/viewport/view.js +37 -0
  390. package/dist/core/viewport/view.js.map +1 -0
  391. package/dist/core/viewport/viewTransform.js +11 -0
  392. package/dist/core/viewport/viewTransform.js.map +1 -0
  393. package/dist/core/viewport/viewportWorldRect.js +13 -0
  394. package/dist/core/viewport/viewportWorldRect.js.map +1 -0
  395. package/dist/core/viewport/wheelHandler.js +30 -0
  396. package/dist/core/viewport/wheelHandler.js.map +1 -0
  397. package/dist/core/viewport/zoomAt.js +22 -0
  398. package/dist/core/viewport/zoomAt.js.map +1 -0
  399. package/dist/core/viewport/zoomBounds.js +20 -0
  400. package/dist/core/viewport/zoomBounds.js.map +1 -0
  401. package/dist/{pointSnapToGrid-7mCcm6qG.d.ts → cornerHandles-CDcZOV8h.d.ts} +54 -71
  402. package/dist/debug/createDebugOverlayLayer.js +358 -0
  403. package/dist/debug/createDebugOverlayLayer.js.map +1 -0
  404. package/dist/debug/createDebugSink.js +83 -0
  405. package/dist/debug/createDebugSink.js.map +1 -0
  406. package/dist/debug/defaultTheme.js +31 -0
  407. package/dist/debug/defaultTheme.js.map +1 -0
  408. package/dist/debug/flag.js +41 -0
  409. package/dist/debug/flag.js.map +1 -0
  410. package/dist/debug/frameStats.js +16 -0
  411. package/dist/debug/frameStats.js.map +1 -0
  412. package/dist/debug/parseDebugFlags.js +32 -0
  413. package/dist/debug/parseDebugFlags.js.map +1 -0
  414. package/dist/features/chrome-caps/buildChromeCtx.js +16 -0
  415. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -0
  416. package/dist/features/chrome-caps/conditions.js +36 -0
  417. package/dist/features/chrome-caps/conditions.js.map +1 -0
  418. package/dist/features/chrome-caps/defaults.js +26 -0
  419. package/dist/features/chrome-caps/defaults.js.map +1 -0
  420. package/dist/features/chrome-caps/index.js +7 -0
  421. package/dist/features/chrome-caps/resolve.js +23 -0
  422. package/dist/features/chrome-caps/resolve.js.map +1 -0
  423. package/dist/features/chrome-caps/useHoverTracking.js +27 -0
  424. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -0
  425. package/dist/features/cursor/paintedCursorLayer.js +60 -0
  426. package/dist/features/cursor/paintedCursorLayer.js.map +1 -0
  427. package/dist/features/focus/gateLayer.js +14 -0
  428. package/dist/features/focus/gateLayer.js.map +1 -0
  429. package/dist/features/focus/useCanvasFocus.js +29 -0
  430. package/dist/features/focus/useCanvasFocus.js.map +1 -0
  431. package/dist/features/groups/children.js +23 -0
  432. package/dist/features/groups/children.js.map +1 -0
  433. package/dist/features/groups/composePose.js +67 -0
  434. package/dist/features/groups/composePose.js.map +1 -0
  435. package/dist/features/groups/nestedHit.js +40 -0
  436. package/dist/features/groups/nestedHit.js.map +1 -0
  437. package/dist/features/groups/unionOfChildren.js +15 -0
  438. package/dist/features/groups/unionOfChildren.js.map +1 -0
  439. package/dist/features/images/imageCache.js +94 -0
  440. package/dist/features/images/imageCache.js.map +1 -0
  441. package/dist/features/ingestion/contentHandlers.js +37 -0
  442. package/dist/features/ingestion/contentHandlers.js.map +1 -0
  443. package/dist/features/ingestion/imageHandler.js +45 -0
  444. package/dist/features/ingestion/imageHandler.js.map +1 -0
  445. package/dist/features/ingestion/index.js +8 -0
  446. package/dist/features/ingestion/openFilePicker.js +15 -0
  447. package/dist/features/ingestion/openFilePicker.js.map +1 -0
  448. package/dist/features/ingestion/registerKitHandlers.js +26 -0
  449. package/dist/features/ingestion/registerKitHandlers.js.map +1 -0
  450. package/dist/features/ingestion/svgHandler.js +58 -0
  451. package/dist/features/ingestion/svgHandler.js.map +1 -0
  452. package/dist/features/ingestion/weaselJsonHandler.js +39 -0
  453. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -0
  454. package/dist/features/longPress/longPressFeedback.js +96 -0
  455. package/dist/features/longPress/longPressFeedback.js.map +1 -0
  456. package/dist/features/meshPaint/bake.js +79 -0
  457. package/dist/features/meshPaint/bake.js.map +1 -0
  458. package/dist/features/meshPaint/bakeCache.js +59 -0
  459. package/dist/features/meshPaint/bakeCache.js.map +1 -0
  460. package/dist/features/meshPaint/handles.js +86 -0
  461. package/dist/features/meshPaint/handles.js.map +1 -0
  462. package/dist/features/meshPaint/lazyKind.js +1298 -0
  463. package/dist/features/meshPaint/lazyKind.js.map +1 -0
  464. package/dist/features/meshPaint/meshPaint.js +236 -0
  465. package/dist/features/meshPaint/meshPaint.js.map +1 -0
  466. package/dist/features/meshPaint/meshShader.js +6 -0
  467. package/dist/features/meshPaint/meshShader.js.map +1 -0
  468. package/dist/features/meshPaint/register.js +7 -0
  469. package/dist/features/meshPaint/register.js.map +1 -0
  470. package/dist/features/meshPaint/surface.js +110 -0
  471. package/dist/features/meshPaint/surface.js.map +1 -0
  472. package/dist/features/minimap/actions.js +53 -0
  473. package/dist/features/minimap/actions.js.map +1 -0
  474. package/dist/features/minimap/createMinimapContribution.js +96 -0
  475. package/dist/features/minimap/createMinimapContribution.js.map +1 -0
  476. package/dist/features/minimap/layers.js +103 -0
  477. package/dist/features/minimap/layers.js.map +1 -0
  478. package/dist/features/modes/modeLayers.js +113 -0
  479. package/dist/features/modes/modeLayers.js.map +1 -0
  480. package/dist/features/overlays/useNodeOverlayFrame.js +103 -0
  481. package/dist/features/overlays/useNodeOverlayFrame.js.map +1 -0
  482. package/dist/features/parallax/createParallaxLayer.js +26 -0
  483. package/dist/features/parallax/createParallaxLayer.js.map +1 -0
  484. package/dist/features/parallax/createParallaxPlane.js +26 -0
  485. package/dist/features/parallax/createParallaxPlane.js.map +1 -0
  486. package/dist/features/paths/anchorEdits.js +156 -0
  487. package/dist/features/paths/anchorEdits.js.map +1 -0
  488. package/dist/features/paths/anchors.js +154 -0
  489. package/dist/features/paths/anchors.js.map +1 -0
  490. package/dist/features/paths/booleans.js +2 -0
  491. package/dist/features/paths/index.js +15 -0
  492. package/dist/features/paths/markerCommands.js +116 -0
  493. package/dist/features/paths/markerCommands.js.map +1 -0
  494. package/dist/features/paths/markerSites.js +59 -0
  495. package/dist/features/paths/markerSites.js.map +1 -0
  496. package/dist/features/paths/markers.js +95 -0
  497. package/dist/features/paths/markers.js.map +1 -0
  498. package/dist/features/paths/nearestAnchor.js +36 -0
  499. package/dist/features/paths/nearestAnchor.js.map +1 -0
  500. package/dist/features/paths/originProjection.js +16 -0
  501. package/dist/features/paths/originProjection.js.map +1 -0
  502. package/dist/features/paths/pathEditingOverlayLayer.js +137 -0
  503. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -0
  504. package/dist/features/paths/pathInWorld.js +41 -0
  505. package/dist/features/paths/pathInWorld.js.map +1 -0
  506. package/dist/features/paths/pathLayer.js +44 -0
  507. package/dist/features/paths/pathLayer.js.map +1 -0
  508. package/dist/features/paths/penPreviewLayer.js +220 -0
  509. package/dist/features/paths/penPreviewLayer.js.map +1 -0
  510. package/dist/features/paths/poseDescriptor.js +44 -0
  511. package/dist/features/paths/poseDescriptor.js.map +1 -0
  512. package/dist/features/paths/tessellate/stroke.js +230 -0
  513. package/dist/features/paths/tessellate/stroke.js.map +1 -0
  514. package/dist/features/patterns/index.js +23 -0
  515. package/dist/features/patterns/index.js.map +1 -0
  516. package/dist/features/patterns/patterns-builtin.js +38 -0
  517. package/dist/features/patterns/patterns-builtin.js.map +1 -0
  518. package/dist/features/patterns/resolveSpec.js +57 -0
  519. package/dist/features/patterns/resolveSpec.js.map +1 -0
  520. package/dist/features/patterns/tileGeometry.js +158 -0
  521. package/dist/features/patterns/tileGeometry.js.map +1 -0
  522. package/dist/features/pointer/PointerContext.js +45 -0
  523. package/dist/features/pointer/PointerContext.js.map +1 -0
  524. package/dist/features/poseRun/usePoseRun.js +70 -0
  525. package/dist/features/poseRun/usePoseRun.js.map +1 -0
  526. package/dist/features/selection/SelectionContext.js +46 -0
  527. package/dist/features/selection/SelectionContext.js.map +1 -0
  528. package/dist/features/selection/overlay.js +442 -0
  529. package/dist/features/selection/overlay.js.map +1 -0
  530. package/dist/features/simulation/createSimulation.js +61 -0
  531. package/dist/features/simulation/createSimulation.js.map +1 -0
  532. package/dist/features/simulation/types.js +6 -0
  533. package/dist/features/simulation/types.js.map +1 -0
  534. package/dist/features/simulation/useSimulation.js +74 -0
  535. package/dist/features/simulation/useSimulation.js.map +1 -0
  536. package/dist/features/text/domRuns.js +258 -0
  537. package/dist/features/text/domRuns.js.map +1 -0
  538. package/dist/features/text/fitTextPose.js +38 -0
  539. package/dist/features/text/fitTextPose.js.map +1 -0
  540. package/dist/features/text/hitTest.js +45 -0
  541. package/dist/features/text/hitTest.js.map +1 -0
  542. package/dist/features/text/renderLabel.js +14 -0
  543. package/dist/features/text/renderLabel.js.map +1 -0
  544. package/dist/features/text/runs/effectiveRangeStyle.js +66 -0
  545. package/dist/features/text/runs/effectiveRangeStyle.js.map +1 -0
  546. package/dist/features/text/runs/flagRange.js +53 -0
  547. package/dist/features/text/runs/flagRange.js.map +1 -0
  548. package/dist/features/text/runs/rangeStyle.js +135 -0
  549. package/dist/features/text/runs/rangeStyle.js.map +1 -0
  550. package/dist/features/text/textCommand.js +59 -0
  551. package/dist/features/text/textCommand.js.map +1 -0
  552. package/dist/features/text/textLayer.js +35 -0
  553. package/dist/features/text/textLayer.js.map +1 -0
  554. package/dist/features/text/textToPath.js +181 -0
  555. package/dist/features/text/textToPath.js.map +1 -0
  556. package/dist/features/text/useSceneTextEdit.js +138 -0
  557. package/dist/features/text/useSceneTextEdit.js.map +1 -0
  558. package/dist/features/text/useTextEdit.js +465 -0
  559. package/dist/features/text/useTextEdit.js.map +1 -0
  560. package/dist/features/tiling/createTiledLayer.js +63 -0
  561. package/dist/features/tiling/createTiledLayer.js.map +1 -0
  562. package/dist/features/tiling/tiledProject.js +14 -0
  563. package/dist/features/tiling/tiledProject.js.map +1 -0
  564. package/dist/features/viewports/viewResolver.js +59 -0
  565. package/dist/features/viewports/viewResolver.js.map +1 -0
  566. package/dist/features/viewports/viewportLayer.js +58 -0
  567. package/dist/features/viewports/viewportLayer.js.map +1 -0
  568. package/dist/icons/ArrowIcon.js +23 -0
  569. package/dist/icons/ArrowIcon.js.map +1 -0
  570. package/dist/icons/EllipseIcon.js +21 -0
  571. package/dist/icons/EllipseIcon.js.map +1 -0
  572. package/dist/icons/EyedropperIcon.js +49 -0
  573. package/dist/icons/EyedropperIcon.js.map +1 -0
  574. package/dist/icons/HandIcon.js +59 -0
  575. package/dist/icons/HandIcon.js.map +1 -0
  576. package/dist/icons/ImageIcon.js +34 -0
  577. package/dist/icons/ImageIcon.js.map +1 -0
  578. package/dist/icons/LassoIcon.js +22 -0
  579. package/dist/icons/LassoIcon.js.map +1 -0
  580. package/dist/icons/LineIcon.js +22 -0
  581. package/dist/icons/LineIcon.js.map +1 -0
  582. package/dist/icons/PenIcon.js +36 -0
  583. package/dist/icons/PenIcon.js.map +1 -0
  584. package/dist/icons/PencilIcon.js +25 -0
  585. package/dist/icons/PencilIcon.js.map +1 -0
  586. package/dist/icons/PolygonIcon.js +19 -0
  587. package/dist/icons/PolygonIcon.js.map +1 -0
  588. package/dist/icons/RectIcon.js +37 -0
  589. package/dist/icons/RectIcon.js.map +1 -0
  590. package/dist/icons/SelectIcon.js +20 -0
  591. package/dist/icons/SelectIcon.js.map +1 -0
  592. package/dist/icons/StarIcon.js +19 -0
  593. package/dist/icons/StarIcon.js.map +1 -0
  594. package/dist/icons/TextIcon.js +19 -0
  595. package/dist/icons/TextIcon.js.map +1 -0
  596. package/dist/icons/UnknownIcon.js +33 -0
  597. package/dist/icons/UnknownIcon.js.map +1 -0
  598. package/dist/icons/_base.js +12 -0
  599. package/dist/icons/_base.js.map +1 -0
  600. package/dist/index.css +2 -86
  601. package/dist/index.d.ts +2349 -2609
  602. package/dist/index.js +312 -13
  603. package/dist/input/keyState.js +76 -0
  604. package/dist/input/keyState.js.map +1 -0
  605. package/dist/input/useKeyState.js +22 -0
  606. package/dist/input/useKeyState.js.map +1 -0
  607. package/dist/interactions/actions/actionShortcuts.js +32 -0
  608. package/dist/interactions/actions/actionShortcuts.js.map +1 -0
  609. package/dist/interactions/actions/align/align.js +81 -0
  610. package/dist/interactions/actions/align/align.js.map +1 -0
  611. package/dist/interactions/actions/booleans/booleans.js +120 -0
  612. package/dist/interactions/actions/booleans/booleans.js.map +1 -0
  613. package/dist/interactions/actions/booleans/useBooleans.js +20 -0
  614. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -0
  615. package/dist/interactions/actions/booleans/useBooleansAdapter.js +9 -0
  616. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -0
  617. package/dist/interactions/actions/clipboard/clipboardOps.js +94 -0
  618. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -0
  619. package/dist/interactions/actions/clipboard/materializePaste.js +25 -0
  620. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -0
  621. package/dist/interactions/actions/clipboard/wireFormat.js +43 -0
  622. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -0
  623. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +26 -0
  624. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +1 -0
  625. package/dist/interactions/actions/defaultCommitAdapter.js +42 -0
  626. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -0
  627. package/dist/interactions/actions/defaults/align.js +71 -0
  628. package/dist/interactions/actions/defaults/align.js.map +1 -0
  629. package/dist/interactions/actions/defaults/anchorEditing.js +235 -0
  630. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -0
  631. package/dist/interactions/actions/defaults/areaSelect.js +75 -0
  632. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -0
  633. package/dist/interactions/actions/defaults/booleans.js +52 -0
  634. package/dist/interactions/actions/defaults/booleans.js.map +1 -0
  635. package/dist/interactions/actions/defaults/cancelGesture.js +24 -0
  636. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -0
  637. package/dist/interactions/actions/defaults/clearSelection.js +19 -0
  638. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -0
  639. package/dist/interactions/actions/defaults/clipboard.js +78 -0
  640. package/dist/interactions/actions/defaults/clipboard.js.map +1 -0
  641. package/dist/interactions/actions/defaults/clone.js +96 -0
  642. package/dist/interactions/actions/defaults/clone.js.map +1 -0
  643. package/dist/interactions/actions/defaults/createOutlines.js +47 -0
  644. package/dist/interactions/actions/defaults/createOutlines.js.map +1 -0
  645. package/dist/interactions/actions/defaults/createPaintAction.js +85 -0
  646. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -0
  647. package/dist/interactions/actions/defaults/delete.js +61 -0
  648. package/dist/interactions/actions/defaults/delete.js.map +1 -0
  649. package/dist/interactions/actions/defaults/distribute.js +66 -0
  650. package/dist/interactions/actions/defaults/distribute.js.map +1 -0
  651. package/dist/interactions/actions/defaults/duplicate.js +83 -0
  652. package/dist/interactions/actions/defaults/duplicate.js.map +1 -0
  653. package/dist/interactions/actions/defaults/editAnchors.js +100 -0
  654. package/dist/interactions/actions/defaults/editAnchors.js.map +1 -0
  655. package/dist/interactions/actions/defaults/enterPathEdit.js +29 -0
  656. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -0
  657. package/dist/interactions/actions/defaults/enterTextEdit.js +20 -0
  658. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -0
  659. package/dist/interactions/actions/defaults/escape.js +26 -0
  660. package/dist/interactions/actions/defaults/escape.js.map +1 -0
  661. package/dist/interactions/actions/defaults/exitPathEdit.js +22 -0
  662. package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -0
  663. package/dist/interactions/actions/defaults/flip.js +119 -0
  664. package/dist/interactions/actions/defaults/flip.js.map +1 -0
  665. package/dist/interactions/actions/defaults/freshNodeId.js +10 -0
  666. package/dist/interactions/actions/defaults/freshNodeId.js.map +1 -0
  667. package/dist/interactions/actions/defaults/group.js +131 -0
  668. package/dist/interactions/actions/defaults/group.js.map +1 -0
  669. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +40 -0
  670. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +1 -0
  671. package/dist/interactions/actions/defaults/icons/actionGlyphs.js +10 -0
  672. package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +1 -0
  673. package/dist/interactions/actions/defaults/icons/alignIcons.js +173 -0
  674. package/dist/interactions/actions/defaults/icons/alignIcons.js.map +1 -0
  675. package/dist/interactions/actions/defaults/icons/booleanIcons.js +171 -0
  676. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -0
  677. package/dist/interactions/actions/defaults/icons/distributeIcons.js +63 -0
  678. package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +1 -0
  679. package/dist/interactions/actions/defaults/icons/editIcons.js +280 -0
  680. package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -0
  681. package/dist/interactions/actions/defaults/icons/outlineIcons.js +53 -0
  682. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -0
  683. package/dist/interactions/actions/defaults/ingest.js +58 -0
  684. package/dist/interactions/actions/defaults/ingest.js.map +1 -0
  685. package/dist/interactions/actions/defaults/insert.js +288 -0
  686. package/dist/interactions/actions/defaults/insert.js.map +1 -0
  687. package/dist/interactions/actions/defaults/insertPathAnchor.js +50 -0
  688. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -0
  689. package/dist/interactions/actions/defaults/lassoSelect.js +156 -0
  690. package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -0
  691. package/dist/interactions/actions/defaults/move.js +656 -0
  692. package/dist/interactions/actions/defaults/move.js.map +1 -0
  693. package/dist/interactions/actions/defaults/nudge.js +110 -0
  694. package/dist/interactions/actions/defaults/nudge.js.map +1 -0
  695. package/dist/interactions/actions/defaults/pinchZoom.js +63 -0
  696. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -0
  697. package/dist/interactions/actions/defaults/reorder.js +143 -0
  698. package/dist/interactions/actions/defaults/reorder.js.map +1 -0
  699. package/dist/interactions/actions/defaults/requiresSelection.js +10 -0
  700. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -0
  701. package/dist/interactions/actions/defaults/resize.js +332 -0
  702. package/dist/interactions/actions/defaults/resize.js.map +1 -0
  703. package/dist/interactions/actions/defaults/rotate.js +181 -0
  704. package/dist/interactions/actions/defaults/rotate.js.map +1 -0
  705. package/dist/interactions/actions/defaults/selectAll.js +27 -0
  706. package/dist/interactions/actions/defaults/selectAll.js.map +1 -0
  707. package/dist/interactions/actions/defaults/setFill.js +27 -0
  708. package/dist/interactions/actions/defaults/setFill.js.map +1 -0
  709. package/dist/interactions/actions/defaults/setFillOpacity.js +15 -0
  710. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -0
  711. package/dist/interactions/actions/defaults/setStroke.js +36 -0
  712. package/dist/interactions/actions/defaults/setStroke.js.map +1 -0
  713. package/dist/interactions/actions/defaults/setStrokeOpacity.js +21 -0
  714. package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -0
  715. package/dist/interactions/actions/defaults/slice.js +39 -0
  716. package/dist/interactions/actions/defaults/slice.js.map +1 -0
  717. package/dist/interactions/actions/defaults/sliceOps.js +60 -0
  718. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -0
  719. package/dist/interactions/actions/defaults/toolActivate.js +35 -0
  720. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -0
  721. package/dist/interactions/actions/defaults/toolResetToDefault.js +26 -0
  722. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -0
  723. package/dist/interactions/actions/defaults/undoRedo.js +51 -0
  724. package/dist/interactions/actions/defaults/undoRedo.js.map +1 -0
  725. package/dist/interactions/actions/defaults/viewportDragPan.js +88 -0
  726. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -0
  727. package/dist/interactions/actions/defaults/viewportWheelPan.js +57 -0
  728. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -0
  729. package/dist/interactions/actions/defaults/viewportZoom.js +143 -0
  730. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -0
  731. package/dist/interactions/actions/distribute/distribute.js +42 -0
  732. package/dist/interactions/actions/distribute/distribute.js.map +1 -0
  733. package/dist/interactions/actions/distribute/plan.js +29 -0
  734. package/dist/interactions/actions/distribute/plan.js.map +1 -0
  735. package/dist/interactions/actions/edit-anchors/geometry.js +61 -0
  736. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -0
  737. package/dist/interactions/actions/edit-anchors/handles.js +43 -0
  738. package/dist/interactions/actions/edit-anchors/handles.js.map +1 -0
  739. package/dist/interactions/actions/flip/helpers.js +35 -0
  740. package/dist/interactions/actions/flip/helpers.js.map +1 -0
  741. package/dist/interactions/actions/geometryProjection.js +18 -0
  742. package/dist/interactions/actions/geometryProjection.js.map +1 -0
  743. package/dist/interactions/actions/gestureLifecycle.js +44 -0
  744. package/dist/interactions/actions/gestureLifecycle.js.map +1 -0
  745. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +39 -0
  746. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -0
  747. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +36 -0
  748. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
  749. package/dist/interactions/actions/move/behaviors/snapToContainer.js +67 -0
  750. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -0
  751. package/dist/interactions/actions/move/gestureAdapter.js +37 -0
  752. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -0
  753. package/dist/interactions/actions/outlines/createOutlines.js +84 -0
  754. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -0
  755. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +9 -0
  756. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -0
  757. package/dist/interactions/actions/planeInput.js +168 -0
  758. package/dist/interactions/actions/planeInput.js.map +1 -0
  759. package/dist/interactions/actions/poseDescriptorDep.js +9 -0
  760. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -0
  761. package/dist/interactions/actions/poseFrame.js +38 -0
  762. package/dist/interactions/actions/poseFrame.js.map +1 -0
  763. package/dist/interactions/actions/previewOverrides.js +25 -0
  764. package/dist/interactions/actions/previewOverrides.js.map +1 -0
  765. package/dist/interactions/actions/resize/autoPoseDescriptor.js +32 -0
  766. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +1 -0
  767. package/dist/interactions/actions/resize/behaviors/clampMinSize.js +18 -0
  768. package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -0
  769. package/dist/interactions/actions/resize/behaviors/index.js +8 -0
  770. package/dist/interactions/actions/resize/behaviors/index.js.map +1 -0
  771. package/dist/interactions/actions/resize/behaviors/lockAspect.js +24 -0
  772. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -0
  773. package/dist/interactions/actions/resize/cornerHandles.js +72 -0
  774. package/dist/interactions/actions/resize/cornerHandles.js.map +1 -0
  775. package/dist/interactions/actions/resolveOverlays.js +60 -0
  776. package/dist/interactions/actions/resolveOverlays.js.map +1 -0
  777. package/dist/interactions/actions/resolvePreviews.js +61 -0
  778. package/dist/interactions/actions/resolvePreviews.js.map +1 -0
  779. package/dist/interactions/actions/rotate/geometry.js +46 -0
  780. package/dist/interactions/actions/rotate/geometry.js.map +1 -0
  781. package/dist/interactions/actions/rotate/handle.js +27 -0
  782. package/dist/interactions/actions/rotate/handle.js.map +1 -0
  783. package/dist/interactions/actions/spatialReference.js +42 -0
  784. package/dist/interactions/actions/spatialReference.js.map +1 -0
  785. package/dist/interactions/actions/useStandardActions.js +142 -0
  786. package/dist/interactions/actions/useStandardActions.js.map +1 -0
  787. package/dist/interactions/gestures/dragGesture/dragGesture.js +111 -0
  788. package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -0
  789. package/dist/interactions/gestures/dragRadial/dragRadial.js +117 -0
  790. package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -0
  791. package/dist/interactions/gestures/dragRect/dragRect.js +164 -0
  792. package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -0
  793. package/dist/interactions/gestures/handleDrag/handleDrag.js +46 -0
  794. package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -0
  795. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +118 -0
  796. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -0
  797. package/dist/interactions/gestures/shared/originProjection.js +42 -0
  798. package/dist/interactions/gestures/shared/originProjection.js.map +1 -0
  799. package/dist/interactions/gestures/shared/screenTolerance.js +21 -0
  800. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -0
  801. package/dist/interactions/gestures/shared/snap.js +24 -0
  802. package/dist/interactions/gestures/shared/snap.js.map +1 -0
  803. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +30 -0
  804. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -0
  805. package/dist/layout/arrivals.js +36 -0
  806. package/dist/layout/arrivals.js.map +1 -0
  807. package/dist/{math-MCQcf_gc.d.ts → math-CUMxmZzn.d.ts} +8 -116
  808. package/dist/math.d.ts +4 -5
  809. package/dist/math.js +6 -4
  810. package/dist/mesh.d.ts +268 -0
  811. package/dist/mesh.js +7 -0
  812. package/dist/move.d.ts +7 -48
  813. package/dist/move.js +3 -142
  814. package/dist/originProjection-BSn4xiEy.d.ts +57 -0
  815. package/dist/patterns-builtin.js +3 -3
  816. package/dist/{poseDescriptor-rZa9W5hJ.d.ts → poseDescriptor-CjSXMf8X.d.ts} +3 -3
  817. package/dist/registerProgram-ateHDGjw.d.ts +193 -0
  818. package/dist/renderer/DrawCommand.js +6 -0
  819. package/dist/renderer/DrawCommand.js.map +1 -0
  820. package/dist/renderer/WeaselRenderer.js +328 -0
  821. package/dist/renderer/WeaselRenderer.js.map +1 -0
  822. package/dist/renderer/cache/GLImageCache.js +64 -0
  823. package/dist/renderer/cache/GLImageCache.js.map +1 -0
  824. package/dist/renderer/cache/GLMeshCache.js +102 -0
  825. package/dist/renderer/cache/GLMeshCache.js.map +1 -0
  826. package/dist/renderer/cache/GLTextureCache.js +51 -0
  827. package/dist/renderer/cache/GLTextureCache.js.map +1 -0
  828. package/dist/renderer/cache/GradientRampAtlas.js +82 -0
  829. package/dist/renderer/cache/GradientRampAtlas.js.map +1 -0
  830. package/dist/renderer/cache/cache.js +13 -0
  831. package/dist/renderer/cache/cache.js.map +1 -0
  832. package/dist/renderer/cache/markerCommandCache.js +59 -0
  833. package/dist/renderer/cache/markerCommandCache.js.map +1 -0
  834. package/dist/renderer/cache/outlineMeshCache.js +15 -0
  835. package/dist/renderer/cache/outlineMeshCache.js.map +1 -0
  836. package/dist/renderer/cache/outlineStrokeMeshCache.js +31 -0
  837. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +1 -0
  838. package/dist/renderer/cache/strokeMeshCache.js +44 -0
  839. package/dist/renderer/cache/strokeMeshCache.js.map +1 -0
  840. package/dist/renderer/cullDrawCommands.js +89 -0
  841. package/dist/renderer/cullDrawCommands.js.map +1 -0
  842. package/dist/renderer/draw.js +1109 -0
  843. package/dist/renderer/draw.js.map +1 -0
  844. package/dist/renderer/drawBatch.js +168 -0
  845. package/dist/renderer/drawBatch.js.map +1 -0
  846. package/dist/renderer/effects/EffectTargets.js +45 -0
  847. package/dist/renderer/effects/EffectTargets.js.map +1 -0
  848. package/dist/renderer/effects/builtins.js +31 -0
  849. package/dist/renderer/effects/builtins.js.map +1 -0
  850. package/dist/renderer/effects/composite.js +9 -0
  851. package/dist/renderer/effects/composite.js.map +1 -0
  852. package/dist/renderer/effects/effectPrelude.js +10 -0
  853. package/dist/renderer/effects/effectPrelude.js.map +1 -0
  854. package/dist/renderer/effects/types.js +10 -0
  855. package/dist/renderer/effects/types.js.map +1 -0
  856. package/dist/renderer/index.js +19 -0
  857. package/dist/renderer/math/color.js +341 -0
  858. package/dist/renderer/math/color.js.map +1 -0
  859. package/dist/renderer/math/mat3.js +71 -0
  860. package/dist/renderer/math/mat3.js.map +1 -0
  861. package/dist/renderer/math/patternSpace.js +22 -0
  862. package/dist/renderer/math/patternSpace.js.map +1 -0
  863. package/dist/renderer/math/viewToMat3.js +19 -0
  864. package/dist/renderer/math/viewToMat3.js.map +1 -0
  865. package/dist/renderer/paintResources.js +18 -0
  866. package/dist/renderer/paintResources.js.map +1 -0
  867. package/dist/renderer/paintScratch.js +37 -0
  868. package/dist/renderer/paintScratch.js.map +1 -0
  869. package/dist/renderer/shaders/ShaderProgram.js +74 -0
  870. package/dist/renderer/shaders/ShaderProgram.js.map +1 -0
  871. package/dist/renderer/shaders/batchFill.js +118 -0
  872. package/dist/renderer/shaders/batchFill.js.map +1 -0
  873. package/dist/renderer/shaders/customPrelude.js +34 -0
  874. package/dist/renderer/shaders/customPrelude.js.map +1 -0
  875. package/dist/renderer/shaders/extractUniformNames.js +184 -0
  876. package/dist/renderer/shaders/extractUniformNames.js.map +1 -0
  877. package/dist/renderer/shaders/glyphPaint.js +61 -0
  878. package/dist/renderer/shaders/glyphPaint.js.map +1 -0
  879. package/dist/renderer/shaders/gradFill.js +30 -0
  880. package/dist/renderer/shaders/gradFill.js.map +1 -0
  881. package/dist/renderer/shaders/imageFill.js +14 -0
  882. package/dist/renderer/shaders/imageFill.js.map +1 -0
  883. package/dist/renderer/shaders/pathFill.js +13 -0
  884. package/dist/renderer/shaders/pathFill.js.map +1 -0
  885. package/dist/renderer/shaders/patternFill.js +24 -0
  886. package/dist/renderer/shaders/patternFill.js.map +1 -0
  887. package/dist/renderer/shaders/registerProgram.js +18 -0
  888. package/dist/renderer/shaders/registerProgram.js.map +1 -0
  889. package/dist/renderer/spriteSheet.js +14 -0
  890. package/dist/renderer/spriteSheet.js.map +1 -0
  891. package/dist/renderer/state/GroupState.js +77 -0
  892. package/dist/renderer/state/GroupState.js.map +1 -0
  893. package/dist/renderer/syntheticItalic.js +6 -0
  894. package/dist/renderer/syntheticItalic.js.map +1 -0
  895. package/dist/renderer/textures/registerTexture.js +14 -0
  896. package/dist/renderer/textures/registerTexture.js.map +1 -0
  897. package/dist/renderer.d.ts +18 -20
  898. package/dist/renderer.js +18 -13
  899. package/dist/resize.d.ts +10 -46
  900. package/dist/resize.js +7 -5
  901. package/dist/routing.d.ts +1 -1
  902. package/dist/routing.js +2 -3
  903. package/dist/scheduling/useVisibleRaf.js +69 -0
  904. package/dist/scheduling/useVisibleRaf.js.map +1 -0
  905. package/dist/test-hook/createTestHook.js +39 -0
  906. package/dist/test-hook/createTestHook.js.map +1 -0
  907. package/dist/test-hook/install.js +12 -0
  908. package/dist/test-hook/install.js.map +1 -0
  909. package/dist/test-seams-fYf6m5pu.d.ts +356 -0
  910. package/dist/test-seams.d.ts +6 -0
  911. package/dist/test-seams.js +3 -0
  912. package/dist/tools/builtin/ellipse/useEllipseTool.js +33 -0
  913. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -0
  914. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +55 -0
  915. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -0
  916. package/dist/tools/builtin/hand/dragPanContribution.js +17 -0
  917. package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -0
  918. package/dist/tools/builtin/hand/useHandTool.js +31 -0
  919. package/dist/tools/builtin/hand/useHandTool.js.map +1 -0
  920. package/dist/tools/builtin/image/useImageTool.js +41 -0
  921. package/dist/tools/builtin/image/useImageTool.js.map +1 -0
  922. package/dist/tools/builtin/lasso/useLassoTool.js +42 -0
  923. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -0
  924. package/dist/tools/builtin/line/useLineTool.js +33 -0
  925. package/dist/tools/builtin/line/useLineTool.js.map +1 -0
  926. package/dist/tools/builtin/pen/usePenTool.js +414 -0
  927. package/dist/tools/builtin/pen/usePenTool.js.map +1 -0
  928. package/dist/tools/builtin/pencil/usePencilTool.js +36 -0
  929. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -0
  930. package/dist/tools/builtin/pickTopMostHit.js +45 -0
  931. package/dist/tools/builtin/pickTopMostHit.js.map +1 -0
  932. package/dist/tools/builtin/polygon/usePolygonTool.js +81 -0
  933. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -0
  934. package/dist/tools/builtin/rect/useRectTool.js +32 -0
  935. package/dist/tools/builtin/rect/useRectTool.js.map +1 -0
  936. package/dist/tools/builtin/select/selectionContributions.js +109 -0
  937. package/dist/tools/builtin/select/selectionContributions.js.map +1 -0
  938. package/dist/tools/builtin/select/useSelectTool.js +162 -0
  939. package/dist/tools/builtin/select/useSelectTool.js.map +1 -0
  940. package/dist/tools/builtin/shared/insertToolOptions.js +8 -0
  941. package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -0
  942. package/dist/tools/builtin/slice/useSliceTool.js +263 -0
  943. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -0
  944. package/dist/tools/builtin/star/useStarTool.js +82 -0
  945. package/dist/tools/builtin/star/useStarTool.js.map +1 -0
  946. package/dist/tools/builtin/text/useTextTool.js +177 -0
  947. package/dist/tools/builtin/text/useTextTool.js.map +1 -0
  948. package/dist/tools/overlayBinding.js +8 -0
  949. package/dist/tools/overlayBinding.js.map +1 -0
  950. package/dist/tools/prefs.js +47 -0
  951. package/dist/tools/prefs.js.map +1 -0
  952. package/dist/tools/useKeybindings.js +66 -0
  953. package/dist/tools/useKeybindings.js.map +1 -0
  954. package/dist/{types-CxC8P6W0.d.ts → types-CA54-mAZ.d.ts} +188 -17
  955. package/dist/{types-D_74YlWs.d.ts → types-DSjd6W3n.d.ts} +35 -12
  956. package/dist/util/color.js +26 -0
  957. package/dist/util/color.js.map +1 -0
  958. package/dist/util/constrainTo45.js +17 -0
  959. package/dist/util/constrainTo45.js.map +1 -0
  960. package/dist/util/paint.js +72 -0
  961. package/dist/util/paint.js.map +1 -0
  962. package/dist/version.js +6 -0
  963. package/dist/version.js.map +1 -0
  964. package/package.json +31 -18
  965. package/dist/chunk-44EWMJV2.js +0 -128
  966. package/dist/chunk-44EWMJV2.js.map +0 -1
  967. package/dist/chunk-4RJP2N2L.js +0 -143
  968. package/dist/chunk-4RJP2N2L.js.map +0 -1
  969. package/dist/chunk-BJN5ZRIJ.js +0 -167
  970. package/dist/chunk-BJN5ZRIJ.js.map +0 -1
  971. package/dist/chunk-D4AAWR64.js +0 -28
  972. package/dist/chunk-D4AAWR64.js.map +0 -1
  973. package/dist/chunk-DOBSZOPR.js +0 -29
  974. package/dist/chunk-DOBSZOPR.js.map +0 -1
  975. package/dist/chunk-H6N2JSZ3.js +0 -248
  976. package/dist/chunk-H6N2JSZ3.js.map +0 -1
  977. package/dist/chunk-HPFJUUTF.js +0 -167
  978. package/dist/chunk-HPFJUUTF.js.map +0 -1
  979. package/dist/chunk-L5YNZYEG.js +0 -648
  980. package/dist/chunk-L5YNZYEG.js.map +0 -1
  981. package/dist/chunk-MZAIDI6D.js +0 -32492
  982. package/dist/chunk-MZAIDI6D.js.map +0 -1
  983. package/dist/chunk-PNNZSYRD.js +0 -318
  984. package/dist/chunk-PNNZSYRD.js.map +0 -1
  985. package/dist/chunk-RMR4QMM6.js +0 -250
  986. package/dist/chunk-RMR4QMM6.js.map +0 -1
  987. package/dist/clipboard.js.map +0 -1
  988. package/dist/clone.js.map +0 -1
  989. package/dist/grid-BXdz8GF2.d.ts +0 -158
  990. package/dist/index.css.map +0 -1
  991. package/dist/index.js.map +0 -1
  992. package/dist/insert.d.ts +0 -37
  993. package/dist/insert.js +0 -81
  994. package/dist/insert.js.map +0 -1
  995. package/dist/math.js.map +0 -1
  996. package/dist/move.js.map +0 -1
  997. package/dist/options-CzjxFoYZ.d.ts +0 -67
  998. package/dist/path-JEV2c5If.d.ts +0 -48
  999. package/dist/patterns-builtin.js.map +0 -1
  1000. package/dist/renderer.css +0 -86
  1001. package/dist/renderer.css.map +0 -1
  1002. package/dist/renderer.js.map +0 -1
  1003. package/dist/resize.js.map +0 -1
  1004. package/dist/routing.js.map +0 -1
  1005. package/dist/types-D2tTKEU0.d.ts +0 -18
@@ -0,0 +1,391 @@
1
+ import { bumpNodeMemoGeneration as e, nodeMemo as t } from "../core/scene/nodeMemo.js";
2
+ import { resolveStrokeWidth as n } from "../features/paths/tessellate/stroke.js";
3
+ import { markerReach as r } from "../features/paths/markerCommands.js";
4
+ import { strokeReachAt as i } from "../renderer/cullDrawCommands.js";
5
+ import { poseRotationOf as a, rotatePathAround as o } from "../core/geometry/poseRotation.js";
6
+ import { isRectPose as s } from "../interactions/actions/resize/autoPoseDescriptor.js";
7
+ import { countPathAnchors as c } from "../features/paths/anchors.js";
8
+ import { pathInPoseFrame as l } from "../features/paths/pathInWorld.js";
9
+ import { DEFAULT_SHAPE_FILL as u } from "../util/paint.js";
10
+ import { fillInPoseFrame as d } from "../core/fillInPoseFrame.js";
11
+ import { resolveFillPattern as f } from "../features/patterns/resolveSpec.js";
12
+ import { textCommandFromPose as p } from "../features/text/textCommand.js";
13
+ import { hasSlop as m, slopForStrokeHit as ee } from "../core/viewport/screenSlop.js";
14
+ import { getImageBitmap as h, imageStatus as g } from "../features/images/imageCache.js";
15
+ import { PATH_L as _, PATH_M as v, PATH_Z as y, boundsOfPath as b, ellipsePath as x, linePath as S, pathContainsPoint as C, regularPolygonPath as w, starPath as T, strokeHitTest as E } from "@weasel-js/geom";
16
+ import { textLineBoxes as D } from "@weasel-js/text";
17
+ //#region src/canvas/NodeShape.ts
18
+ function O(e) {
19
+ return e === void 0 || s(e);
20
+ }
21
+ var k = Object.freeze({
22
+ filled: !0,
23
+ outset: 0,
24
+ inset: 0
25
+ }), A = {
26
+ high: [],
27
+ normal: []
28
+ };
29
+ function j(t, n = {}) {
30
+ let r = n.priority === "high" ? A.high : A.normal;
31
+ return r.push(t), e(), () => {
32
+ let n = r.indexOf(t);
33
+ n >= 0 && r.splice(n, 1), e();
34
+ };
35
+ }
36
+ var M = "shape:painter", N = "shape:painter:nonrect", P = "shape:silhouette", F = "shape:paint";
37
+ function I(e) {
38
+ let n = O(e.pose) ? M : N;
39
+ return t(e, n, void 0, () => L(e));
40
+ }
41
+ function L(e) {
42
+ for (let t of A.high) if (t.matches(e)) return t;
43
+ for (let t of A.normal) if (t.matches(e)) return t;
44
+ }
45
+ function R(e, n, r) {
46
+ let i = () => {
47
+ let t = I(e)?.silhouette?.(e, n, r) ?? null, i = t ? a(n) : null;
48
+ return t && i ? o(t, i.cx, i.cy, i.rotation) : t;
49
+ };
50
+ return r?.derivedPath == null ? t(e, P, n, i) : i();
51
+ }
52
+ function z(e, t, n) {
53
+ return I(e)?.ink?.(e, t, n) ?? null;
54
+ }
55
+ function B(e, t, n) {
56
+ return I(e)?.bounds?.(e, t, n) ?? null;
57
+ }
58
+ function V(e, t, n) {
59
+ if (!s(e)) return null;
60
+ let r = t ? i(t, n ?? 1) : 0, a = Math.min(e.x, e.x + e.width), o = Math.min(e.y, e.y + e.height);
61
+ return {
62
+ x: a - r,
63
+ y: o - r,
64
+ width: Math.abs(e.width) + 2 * r,
65
+ height: Math.abs(e.height) + 2 * r
66
+ };
67
+ }
68
+ function H(e, t, n, r, i = {}) {
69
+ let a = R(e, t, { derivedPath: i.derivedPath });
70
+ if (a === null) return !0;
71
+ let o = z(e, t, { scale: i.scale }) ?? k, s = C(a, n, r);
72
+ if (o.filled && s) return !0;
73
+ let { extra: c, opts: l } = ee(i.tolerance), u = (s ? o.inset : o.outset) + c;
74
+ return (u > 0 || m(i.tolerance)) && E(a, n, r, u, l);
75
+ }
76
+ function U() {
77
+ return [...A.high, ...A.normal];
78
+ }
79
+ function W(e, t) {
80
+ return {
81
+ x: t.x,
82
+ y: t.y,
83
+ width: t.width,
84
+ height: t.height,
85
+ text: e.text,
86
+ runs: e.runs,
87
+ style: e.style,
88
+ fill: e.fill,
89
+ stroke: q(e.stroke) ?? void 0,
90
+ verticalAlign: e.verticalAlign
91
+ };
92
+ }
93
+ var G = {
94
+ id: "kit:text",
95
+ matches: (e) => O(e.pose) ? e.data?.text != null : !1,
96
+ paint: (e, n) => t(e, F, n, () => [p(W(e.data, n))]),
97
+ silhouette: (e, t) => {
98
+ let n = D(W(e.data, t));
99
+ return n.length === 0 ? null : te(n);
100
+ },
101
+ ink: (e, t, n) => {
102
+ let r = e.data;
103
+ return {
104
+ filled: !0,
105
+ ...Y(q(r.stroke), n?.scale)
106
+ };
107
+ }
108
+ };
109
+ function te(e) {
110
+ let t = new Uint8Array(e.length * 6), n = new Float32Array(e.length * 10), r = 0, i = 0;
111
+ for (let a of e) {
112
+ let { x: e, y: o, width: s, height: c } = a;
113
+ t[i++] = v, n[r++] = e, n[r++] = o, t[i++] = _, n[r++] = e + s, n[r++] = o, t[i++] = _, n[r++] = e + s, n[r++] = o + c, t[i++] = _, n[r++] = e, n[r++] = o + c, t[i++] = _, n[r++] = e, n[r++] = o, t[i++] = y;
114
+ }
115
+ return {
116
+ kind: "polygon",
117
+ commands: t,
118
+ coords: n,
119
+ fillRule: "nonzero"
120
+ };
121
+ }
122
+ function K(e, t) {
123
+ return e === void 0 ? t : e;
124
+ }
125
+ function q(e) {
126
+ return e?.paint == null ? null : e;
127
+ }
128
+ function J(e, t) {
129
+ let n = f(d(e.paint, t));
130
+ return n === null ? null : n === e.paint ? e : {
131
+ ...e,
132
+ paint: n
133
+ };
134
+ }
135
+ function Y(e, t) {
136
+ if (e === null) return {
137
+ outset: 0,
138
+ inset: 0
139
+ };
140
+ let i = n(e.width ?? 1, t ?? 1), a = r(e, i, t);
141
+ switch (e.align ?? "center") {
142
+ case "inner": return {
143
+ outset: a,
144
+ inset: i
145
+ };
146
+ case "outer": return {
147
+ outset: i + a,
148
+ inset: 0
149
+ };
150
+ default: return {
151
+ outset: i / 2 + a,
152
+ inset: i / 2
153
+ };
154
+ }
155
+ }
156
+ function X(e, t) {
157
+ let n = t?.vertexColors, r = e[0];
158
+ if (n === void 0 || r?.kind !== "path") return e;
159
+ let i = 4 * c(r.path), a = r.fill ? n("fill", r.vertexColors) : void 0, o = r.stroke ? n("stroke", r.stroke.vertexColors) : void 0, s = a?.length === i && a !== r.vertexColors, l = o?.length === i && o !== r.stroke?.vertexColors;
160
+ return !s && !l ? e : [{
161
+ ...r,
162
+ ...s ? { vertexColors: a } : {},
163
+ ...l ? { stroke: {
164
+ ...r.stroke,
165
+ vertexColors: o
166
+ } } : {}
167
+ }, ...e.slice(1)];
168
+ }
169
+ var Z = {
170
+ id: "kit:path",
171
+ matches: (e) => O(e.pose) ? e.data?.path != null : !1,
172
+ paint: (e, n, r) => X(t(e, F, n, () => {
173
+ let t = e.data, r = l(t.path, n), i = q(t.stroke), a = i !== null, o = K(t.fill, a ? null : u), s = o && f(d(o, n)), c = i && J(i, n);
174
+ return [{
175
+ kind: "path",
176
+ path: r,
177
+ ...s ? { fill: s } : {},
178
+ ...s && t.vertexColors ? { vertexColors: t.vertexColors } : {},
179
+ ...c ? { stroke: c } : {}
180
+ }];
181
+ }), r),
182
+ silhouette: (e, t) => {
183
+ let n = e.data;
184
+ return l(n.path, t);
185
+ },
186
+ ink: (e, t, n) => {
187
+ let r = e.data, i = q(r.stroke), a = i !== null;
188
+ return {
189
+ filled: K(r.fill, a ? null : u) !== null,
190
+ ...Y(i, n?.scale)
191
+ };
192
+ },
193
+ bounds: (e, t, n) => V(t, q(e.data.stroke), n?.scale)
194
+ }, Q = {
195
+ id: "kit:shape",
196
+ matches: (e) => {
197
+ if (!O(e.pose)) return !1;
198
+ let t = e.data?.shape;
199
+ return t != null && ne.has(t);
200
+ },
201
+ paint: (e, n, r) => X(t(e, F, n, () => {
202
+ let t = e.data, r = $(t, n), i = K(t.fill, u), a = i && f(d(i, n)), o = q(t.stroke), s = o && J(o, n);
203
+ return [{
204
+ kind: "path",
205
+ path: r,
206
+ ...a ? { fill: a } : {},
207
+ ...s ? { stroke: s } : {}
208
+ }];
209
+ }), r),
210
+ silhouette: (e, t) => {
211
+ let n = e.data;
212
+ return $(n, t);
213
+ },
214
+ ink: (e, t, n) => {
215
+ let r = e.data;
216
+ return {
217
+ filled: K(r.fill, u) !== null,
218
+ ...Y(q(r.stroke), n?.scale)
219
+ };
220
+ },
221
+ bounds: (e, t, n) => V(t, q(e.data.stroke), n?.scale)
222
+ }, ne = /* @__PURE__ */ new Set([
223
+ "rect",
224
+ "ellipse",
225
+ "polygon",
226
+ "star"
227
+ ]);
228
+ function $(e, t) {
229
+ switch (e.shape) {
230
+ case "ellipse": return x(t);
231
+ case "polygon": {
232
+ let n = t.x + t.width / 2, r = t.y + t.height / 2, i = Math.min(t.width, t.height) / 2;
233
+ return w({
234
+ x: n,
235
+ y: r
236
+ }, i, e.sides ?? 6);
237
+ }
238
+ case "star": {
239
+ let n = t.x + t.width / 2, r = t.y + t.height / 2, i = Math.min(t.width, t.height) / 2;
240
+ return T({
241
+ x: n,
242
+ y: r
243
+ }, i, e.points ?? 5);
244
+ }
245
+ default: return {
246
+ kind: "rect",
247
+ x: t.x,
248
+ y: t.y,
249
+ width: t.width,
250
+ height: t.height
251
+ };
252
+ }
253
+ }
254
+ function re(e, t) {
255
+ return {
256
+ x: e.x * t.width,
257
+ y: e.y * t.height,
258
+ w: e.width * t.width,
259
+ h: e.height * t.height
260
+ };
261
+ }
262
+ function ie(e, t, n) {
263
+ if (n && n > 0) return {
264
+ width: Math.abs(e.width) * n / (t?.width || 1),
265
+ height: Math.abs(e.height) * n / (t?.height || 1)
266
+ };
267
+ }
268
+ var ae = {
269
+ id: "kit:image",
270
+ matches: (e) => {
271
+ if (!O(e.pose)) return !1;
272
+ let t = e.data?.image?.src;
273
+ return typeof t == "string" && t.length > 0;
274
+ },
275
+ paint: (e, t, n) => {
276
+ let r = e.data, i = t, a = n?.resolveImage ? n.resolveImage(e) : h(r.image.src, ie(i, r.image.source, n?.pixelScale));
277
+ if (a) return [{
278
+ kind: "image",
279
+ image: a,
280
+ x: i.x,
281
+ y: i.y,
282
+ w: i.width,
283
+ h: i.height,
284
+ ...r.image.opacity === void 0 ? {} : { opacity: r.image.opacity },
285
+ ...r.image.source ? { source: re(r.image.source, a) } : {},
286
+ ...r.image.flipX ? { flipX: !0 } : {},
287
+ ...r.image.flipY ? { flipY: !0 } : {}
288
+ }];
289
+ let o = !n?.resolveImage && g(r.image.src) === "error", s = o ? "#d08a8a" : "#bbbbbb", c = [{
290
+ kind: "path",
291
+ path: {
292
+ kind: "rect",
293
+ x: i.x,
294
+ y: i.y,
295
+ width: i.width,
296
+ height: i.height
297
+ },
298
+ stroke: {
299
+ paint: { color: s },
300
+ width: 1
301
+ }
302
+ }];
303
+ return o && c.push({
304
+ kind: "path",
305
+ path: S({
306
+ x: i.x,
307
+ y: i.y
308
+ }, {
309
+ x: i.x + i.width,
310
+ y: i.y + i.height
311
+ }),
312
+ stroke: {
313
+ paint: { color: s },
314
+ width: 1
315
+ }
316
+ }), c;
317
+ },
318
+ silhouette: (e, t) => {
319
+ let n = t;
320
+ return {
321
+ kind: "rect",
322
+ x: n.x,
323
+ y: n.y,
324
+ width: n.width,
325
+ height: n.height
326
+ };
327
+ },
328
+ bounds: (e, t, n) => V(t, oe, n?.scale)
329
+ }, oe = {
330
+ paint: { color: "#000" },
331
+ width: 1
332
+ }, se = {
333
+ id: "kit:derived",
334
+ matches: (e) => (e.dependsOn?.length ?? 0) > 0 && e.derivePath !== void 0,
335
+ paint: (e, t, n) => {
336
+ let r = n?.derivedPath;
337
+ if (r == null) return [];
338
+ let i = b(r), a = e.data, o = q(a?.stroke), s = K(a?.fill, o === null ? u : null), c = s && f(d(s, i)), l = o && J(o, i);
339
+ return X([{
340
+ kind: "path",
341
+ path: r,
342
+ ...c ? { fill: c } : {},
343
+ ...c && a?.vertexColors ? { vertexColors: a.vertexColors } : {},
344
+ ...l ? { stroke: l } : {}
345
+ }], n);
346
+ },
347
+ silhouette: (e, t, n) => n?.derivedPath ?? null,
348
+ ink: (e, t, n) => {
349
+ let r = e.data, i = q(r?.stroke);
350
+ return {
351
+ filled: K(r?.fill, i === null ? u : null) !== null,
352
+ ...Y(i, n?.scale)
353
+ };
354
+ }
355
+ }, ce = {
356
+ id: "kit:rect-fallback",
357
+ matches: (e) => O(e.pose),
358
+ paint: (e, t) => {
359
+ let n = e.data, r = t, i = K(n?.fill, u);
360
+ return [{
361
+ kind: "path",
362
+ path: {
363
+ kind: "rect",
364
+ x: r.x,
365
+ y: r.y,
366
+ width: r.width,
367
+ height: r.height
368
+ },
369
+ ...i ? { fill: i } : {}
370
+ }];
371
+ },
372
+ silhouette: (e, t) => {
373
+ let n = t;
374
+ return {
375
+ kind: "rect",
376
+ x: n.x,
377
+ y: n.y,
378
+ width: n.width,
379
+ height: n.height
380
+ };
381
+ },
382
+ bounds: (e, t) => V(t, null, void 0)
383
+ };
384
+ function le() {
385
+ j(G), j(se), j(Z), j(Q), j(ae), j(ce);
386
+ }
387
+ le();
388
+ //#endregion
389
+ export { k as DEFAULT_INK, I as findNodeShape, B as findShapeBounds, z as findShapeInk, R as findShapeSilhouette, U as getNodeShapes, j as registerNodeShape, H as shapeCoversPoint };
390
+
391
+ //# sourceMappingURL=NodeShape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeShape.js","names":["paintsPose","pose","isRectPose","DEFAULT_INK","PAINTERS","registerNodeShape","list","opts","painter","bumpNodeMemoGeneration","i","PAINTER_SLOT","PAINTER_SLOT_NONRECT","SILHOUETTE_SLOT","PAINT_SLOT","findNodeShape","slot","node","nodeMemo","matchNodeShape","p","findShapeSilhouette","build","sil","ctx","r","poseRotationOf","rotatePathAround","findShapeInk","findShapeBounds","poseBoxBounds","reach","stroke","strokeReachAt","scale","x","y","shapeCoversPoint","ink","inside","pathContainsPoint","hit","slopForStrokeHit","extra","hasSlop","strokeHitTest","getNodeShapes","textPoseOf","d","resolveNodeStroke","TEXT_PAINTER","textCommandFromPose","boxes","textLineBoxes","rectsToPath","inkReach","commands","rects","coords","ci","cmd","w","h","PATH_M","PATH_L","PATH_Z","resolveNodeFill","fill","fallback","strokeInPoseFrame","paint","resolveFillPattern","fillInPoseFrame","box","resolveStrokeWidth","markerReach","withAnimatedVertexColors","resolve","body","cmds","expected","countPathAnchors","fillChanged","strokeChanged","PATH_PAINTER","projected","pathInPoseFrame","strokeSpec","hasStroke","declared","DEFAULT_SHAPE_FILL","SHAPE_PAINTER","s","SHAPE_KINDS","path","pathForShape","declaredFill","shapeFill","ellipsePath","cx","cy","regularPolygonPath","starPath","sourceInPixels","bmp","drawnSize","pixelScale","source","IMAGE_PAINTER","src","getImageBitmap","error","imageStatus","color","linePath","IMAGE_PLACEHOLDER_STROKE","DERIVED_PAINTER","boundsOfPath","RECT_FALLBACK_PAINTER","registerBuiltInShapePainters"],"sources":["../../src/canvas/NodeShape.ts"],"sourcesContent":["/**\n * NodeShape — the **shape trait's** registry. Each trait of a node\n * (shape, routing, label, icon, affordances, …) is its own registry;\n * this one holds the per-kind `paint` + `silhouette` (and future\n * fields) used by `defaultDrawOne`, clipping, non-rect hit-testing,\n * and lasso/area-select.\n *\n * Teaching the kit about a new kind of shape goes through this registry\n * rather than by overriding `drawOne`. Overrides are still possible but\n * shouldn't be the default seam: most consumers want the same dispatch\n * logic, just extended with their own shape kinds (images, custom paths,\n * SVG fragments, etc.).\n *\n * Built-in entries (`kit:text`, `kit:path`, `kit:rect-fallback`) are\n * registered at module load. Consumer entries added via\n * `registerNodeShape` join the chain; the first entry whose\n * `matches` predicate returns true paints the node. Every built-in but\n * `kit:derived` additionally requires a rect-shaped pose — a scene whose\n * poses are some other shape matches none of them, and paints through a\n * consumer painter or not at all.\n *\n * Two priority tiers:\n * - `'high'` — checked before all `'normal'` entries. Use this to\n * override a kit built-in for a specific data shape (e.g. a custom\n * text renderer that wins over `kit:text`).\n * - `'normal'` (default) — appended after the built-ins.\n *\n * Within a tier, entries run in registration order. Each\n * `registerNodeShape` call returns a disposer that removes the\n * entry — useful for tests, for plugin lifecycles, and for swapping\n * implementations at runtime.\n *\n * See `docs/superpowers/specs/2026-05-24-node-traits-reframe-design.md`\n * for the trait taxonomy.\n */\nimport type { Node, RectPose } from 'core/scene/types';\nimport type { View } from 'core/viewport/view';\nimport { isRectPose } from 'interactions/actions/resize/autoPoseDescriptor';\n\n/** Whether a built-in painter can read this pose. A node that declares none\n * passes: the pose is then the caller's argument, not the node's. */\nfunction paintsPose(pose: unknown): boolean {\n return pose === undefined || isRectPose(pose);\n}\nimport type { DrawCommand, PathDrawCommand } from '../renderer';\nimport type { VertexColorChannel } from '../animation/colorRegistry';\nimport { countPathAnchors } from 'features/paths/anchors';\nimport { textCommandFromPose } from 'features/text/textCommand';\nimport type { TextPose, TextStyle } from '@weasel-js/text';\nimport type { StyledRun, TextVerticalAlign } from '@weasel-js/text';\nimport { textLineBoxes } from '@weasel-js/text';\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport { DEFAULT_SHAPE_FILL } from '../util/paint';\nimport {\n type Path,\n type PolygonPath,\n PATH_M,\n PATH_L,\n PATH_Z,\n ellipsePath,\n regularPolygonPath,\n starPath,\n linePath,\n pathContainsPoint,\n strokeHitTest,\n boundsOfPath,\n} from '@weasel-js/geom';\nimport { resolveStrokeWidth } from 'features/paths/tessellate/stroke';\nimport { markerReach } from 'features/paths/markerCommands';\nimport { strokeReachAt } from '../renderer/cullDrawCommands';\nimport { hasSlop, slopForStrokeHit, type PickSlop } from 'core/viewport/screenSlop';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { poseRotationOf, rotatePathAround } from 'core/geometry/poseRotation';\nimport { pathInPoseFrame } from 'features/paths/pathInWorld';\nimport { fillInPoseFrame, type FillPoseBox } from '../core/fillInPoseFrame';\nimport { resolveFillPattern } from '../features/patterns/resolveSpec';\nimport {\n getImageBitmap, imageStatus, type ImageNodeData, type ImageRasterSize,\n} from 'features/images/imageCache';\nimport { nodeMemo, bumpNodeMemoGeneration } from 'core/scene/nodeMemo';\n\n/** Optional per-call paint context, threaded through `defaultDrawOne`'s third\n * argument. Lets a rendering entry point override ambient environment reads\n * — the headless `renderSceneToPixels` path supplies its own bitmap resolver\n * here so consumers reuse their own decode caches. Custom painters may\n * ignore it entirely. */\nexport interface NodePaintCtx {\n /** Override bitmap resolution for image nodes. When set it is authoritative:\n * the global `imageCache` is not consulted, and an `undefined` result\n * paints the deterministic grey placeholder outline (never the ambient\n * load-status error variant). */\n resolveImage?: (node: Node<unknown, string, unknown>) => ImageBitmap | undefined;\n /** Device pixels per world unit where this paint will land — the view's\n * scale times the device-pixel ratio. `defaultDrawOne` fills it from its\n * view when absent. Lets a painter size resolution-dependent work, such as\n * re-rasterizing an SVG image; one that has no such work ignores it. */\n pixelScale?: number;\n /** The node's derived path, resolved by the scene-aware `drawOne` wrapper\n * before painting: `paint` has no scene handle, and deriving needs the\n * dependencies' poses. **Absent** for a node that derives from nothing —\n * the wrapper hands such a node the caller's own ctx untouched. `null`\n * means the node derives but has nothing to draw. */\n derivedPath?: Path | null;\n /** A node's animated per-anchor colors: given the colors a painter would paint\n * on `channel`, the colors to paint instead. **Absent** when nothing animates\n * the node. The kit's path painters apply it; see `withColorOverrides`. */\n vertexColors?: (\n channel: VertexColorChannel,\n base: readonly number[] | undefined,\n ) => readonly number[] | undefined;\n}\n\n/**\n * Per-node draw function — the scene-slot `drawOne` signature shared by\n * `<SceneCanvas>`, `renderSceneToCanvas` and `renderSceneToPixels`, so a\n * consumer can reuse one callback across a main canvas and a detached view.\n *\n * Called once per node in the walk. Returned commands are world-space; the\n * caller applies the view transform at the group level. `ctx` is supplied by\n * the scene-aware wrappers — see {@link NodePaintCtx}.\n */\nexport type SceneViewDrawOne<TData, TLayer extends string, TPose> = (\n node: Node<TData, TLayer, TPose>,\n pose: TPose,\n view: View,\n ctx?: NodePaintCtx,\n) => DrawCommand[];\n\n/** A painter for one kind of node: which nodes it claims, and the draw\n * commands it emits for them. Registering one is how a consumer teaches the\n * default renderer to draw its own node kinds. */\nexport interface NodeShapeEntry<TData = unknown, TPose = unknown> {\n /** Stable identifier — used for unregistration and debugging. Pick\n * something descriptive: `'kit:text'`, `'app:image'`, etc. */\n id: string;\n /** Returns true when this painter renders the node. The first matching\n * painter (`'high'` tier first, then `'normal'`) wins. The kit's own\n * painters also require a rect-shaped pose, since their geometry reads\n * `x`/`y`/`width`/`height` off it. */\n matches(node: Node<TData, string, TPose>): boolean;\n /** Emits the draw commands for the node's primary visual. `ctx` is an\n * optional per-call paint context (see `NodePaintCtx`); painters that\n * don't need it can keep a two-argument signature.\n *\n * **The returned array belongs to the painter.** Callers must treat it as\n * immutable and copy before appending — a painter is free to memoize its\n * command list (`kit:shape` and `kit:path` do), and an in-place `push`\n * would grow that list on every frame. `defaultDrawOne` copies before\n * adding its label overlay for exactly this reason. */\n paint(node: Node<TData, string, TPose>, pose: TPose, ctx?: NodePaintCtx): DrawCommand[];\n /** Optional: derive the node's silhouette path from its pose.\n * Used by clipping (when the container has no explicit\n * `clipFromPose`), by non-rect hit-testing, and by lasso/area-select.\n * Painters whose visual has no meaningful closed silhouette (e.g. text)\n * leave this undefined. */\n silhouette?(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeSilhouetteCtx,\n ): Path | null;\n /** Optional: how the silhouette is inked — whether the interior is filled,\n * and how wide the outline is. Read by picking, so that an unfilled shape\n * is grabbable by its outline rather than by its empty middle.\n *\n * This is declared separately from `paint` rather than read back off the\n * emitted draw commands because picking runs on every pointer move, and\n * `paint` is allowed to be expensive (`kit:text` lays out glyphs). Keep it\n * to cheap field reads.\n *\n * Painters that leave it undefined are treated as {@link DEFAULT_INK} —\n * the pre-`ink` behavior, where the whole silhouette interior is grabbable\n * and the outline adds nothing.\n *\n * `ctx.scale` carries the view scale so a `{ px }` stroke width resolves to\n * world units; without it a screen-pixel width is read as world units. */\n ink?(node: Node<TData, string, TPose>, pose: TPose, ctx?: NodeInkCtx): NodeInk | null;\n /** Optional: a box enclosing every pixel `paint` can put down for this node,\n * stroke, markers and miter spikes included, in the frame `paint` emits in\n * — before the pose's rotation is applied around it.\n *\n * Culling reads it to skip `paint` for a node outside the view, so a box\n * that is too small makes the node vanish before it reaches the screen\n * edge. Leave it undefined, or return `null`, when no cheap conservative\n * answer exists (`kit:text` has none short of laying out its glyphs); such\n * a node is always painted. Same cheap-reads rule as `ink`. */\n bounds?(node: Node<TData, string, TPose>, pose: TPose, ctx?: NodeInkCtx): Bounds | null;\n}\n\n/** How a painter inks its silhouette. See {@link NodeShapeEntry.ink}.\n *\n * Reach is per-side because `align` decides which side the ribbon lands on:\n * a centered stroke straddles the outline, `'inner'` puts nothing outside it,\n * `'outer'` nothing inside. */\nexport interface NodeInk {\n /** True when the silhouette's interior is painted, and so grabbable. */\n filled: boolean;\n /** How far the ink reaches outside the outline, world units. */\n outset: number;\n /** How far it reaches inside. */\n inset: number;\n}\n\n/** Per-call context for {@link NodeShapeEntry.silhouette}. */\nexport interface NodeSilhouetteCtx {\n /** The node's derived path, resolved by the caller — a painter has no scene\n * handle and deriving needs the dependencies' poses. Same convention as\n * {@link NodePaintCtx.derivedPath}: absent for a node that derives from\n * nothing, `null` when it derives but has nothing to draw. */\n derivedPath?: Path | null;\n}\n\n/** Per-call context for {@link NodeShapeEntry.ink}. */\nexport interface NodeInkCtx {\n /** View scale, for resolving `{ px }` stroke widths to world units. */\n scale?: number;\n}\n\n/** What a painter that declares no `ink` is assumed to do. */\nexport const DEFAULT_INK: Readonly<NodeInk> = Object.freeze({ filled: true, outset: 0, inset: 0 });\n\n/** Options for `registerNodeShape`. */\nexport interface RegisterNodeShapeOptions {\n /** `'high'` puts the painter ahead of all normally-registered ones (so\n * it can win over a kit built-in). `'normal'` appends at the end. */\n priority?: 'high' | 'normal';\n}\n\nconst PAINTERS: { high: NodeShapeEntry[]; normal: NodeShapeEntry[] } = {\n high: [],\n normal: [],\n};\n\n/** Register a shape painter. Returns a disposer that removes it. */\nexport function registerNodeShape<TData, TPose>(\n painter: NodeShapeEntry<TData, TPose>,\n opts: RegisterNodeShapeOptions = {},\n): () => void {\n const list = opts.priority === 'high' ? PAINTERS.high : PAINTERS.normal;\n list.push(painter as NodeShapeEntry);\n // The painter set is exactly the ambient state `findNodeShape` reads, and a\n // memo keyed on the node alone cannot see it change. See `nodeMemo`.\n bumpNodeMemoGeneration();\n return () => {\n const i = list.indexOf(painter as NodeShapeEntry);\n if (i >= 0) list.splice(i, 1);\n bumpNodeMemoGeneration();\n };\n}\n\n// ─── Per-node shape memo ────────────────────────────────────────────────────\n\n/**\n * Slot names for the two things picking asks per node per pointer move: which\n * painter matches, and that painter's silhouette path. Both go through\n * {@link nodeMemo}, so they invalidate on `data` (and, for the silhouette,\n * `pose`) reference changes and on a painter registration.\n *\n * Worth memoizing because both are hot and neither is free. `findNodeShape`\n * runs every registered painter's `matches` predicate; `silhouette` *builds*\n * a path — `pathForShape` allocates a fresh `Float32Array` for every ellipse,\n * polygon and star. Picking runs on every pointermove through both the\n * hover-cursor pump and `classifyTarget`, so that's two rebuilds per move per\n * node under the pointer, and shape-accurate picking is now the default.\n *\n * Separate slots rather than one entry: they mostly invalidate together, but\n * not always, and a shared entry would force the stricter key on both.\n */\nconst PAINTER_SLOT = 'shape:painter';\nconst PAINTER_SLOT_NONRECT = 'shape:painter:nonrect';\nconst SILHOUETTE_SLOT = 'shape:silhouette';\n\n/**\n * Slot for a painter's memoized `paint` output.\n *\n * Distinct from {@link SILHOUETTE_SLOT} even though the two mostly invalidate\n * together: the silhouette bakes `pose.rotation` in (paint does not — the\n * render wrap applies it), and paint alone can depend on `NodePaintCtx` and on\n * ambient readiness. One entry keyed the same way for both would be wrong in\n * both directions.\n *\n * **Only for painters that are a pure function of `(node, pose, data)`.**\n * `kit:shape` and `kit:path` qualify and are also precisely the painters that\n * allocated a fresh `Path` per frame, defeating the tessellation cache in\n * `renderer/cache/cache.ts` (`WeakMap<Path, Mesh>`, keyed on Path identity).\n * `kit:text` and `kit:image` do not qualify — see the tests in\n * `NodeShape.cache.test.ts` that pin their opt-out.\n */\nconst PAINT_SLOT = 'shape:paint';\n\n/** Find the painter that will render `node` — first match in priority\n * order. Returns undefined if no painter (including the built-in\n * fallback) accepts the node. */\nexport function findNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n // Built-in painters also gate on pose shape, so the key carries it too.\n const slot = paintsPose(node.pose) ? PAINTER_SLOT : PAINTER_SLOT_NONRECT;\n return nodeMemo(node as { data?: unknown }, slot, undefined, () =>\n matchNodeShape(node),\n );\n}\n\nfunction matchNodeShape<TData, TPose>(\n node: Node<TData, string, TPose>,\n): NodeShapeEntry<TData, TPose> | undefined {\n for (const p of PAINTERS.high) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n for (const p of PAINTERS.normal) {\n if (p.matches(node as Node<unknown, string, unknown>)) {\n return p as NodeShapeEntry<TData, TPose>;\n }\n }\n return undefined;\n}\n\n/** Find the painter for `node` and ask it for the node's silhouette path,\n * in **world** coords. Returns null if no painter matches, or the matching\n * painter has no `silhouette` method, or the method returns null. Used by\n * clipping, generic non-rect hit-testing and lasso/area-select — anywhere\n * the kit needs the \"closed boundary\" of whatever this kind of node draws as.\n *\n * Painters return their silhouette in the pose's local (unrotated) frame;\n * this bakes `pose.rotation` on top via the shared rotation convention, so\n * clips/area-select of a rotated node use the rotated boundary the renderer\n * draws. (`paint()` is unaffected — it applies rotation via the render wrap,\n * not the silhouette, so there is no double-rotation.) */\nexport function findShapeSilhouette<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeSilhouetteCtx,\n): Path | null {\n const build = (): Path | null => {\n const sil = findNodeShape(node)?.silhouette?.(node, pose, ctx) ?? null;\n const r = sil ? poseRotationOf(pose) : null;\n return sil && r ? rotatePathAround(sil, r.cx, r.cy, r.rotation) : sil;\n };\n // `SILHOUETTE_SLOT`'s key is (node, pose, data) and cannot see\n // `ctx.derivedPath` — the same reason `kit:derived` skips `PAINT_SLOT`.\n // Memoizing here would serve one caller's silhouette to a caller that\n // passed a different path. Only an actual path skips it: a scene-backed\n // source answers `null` for every ordinary node, and treating that as a\n // reason to bypass would retire the memo for the whole scene.\n if (ctx?.derivedPath != null) return build();\n return nodeMemo(node as { data?: unknown }, SILHOUETTE_SLOT, pose, build);\n}\n\n/** Find the painter for `node` and ask how it inks its silhouette. Returns\n * the painter's declared {@link NodeInk}, or `null` when no painter matches\n * or it declares none — callers substitute {@link DEFAULT_INK}. */\nexport function findShapeInk<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): NodeInk | null {\n return findNodeShape(node)?.ink?.(node, pose, ctx) ?? null;\n}\n\n/** Find the painter for `node` and ask for the box its paint fits in. `null`\n * when no painter matches, or the one that does cannot say — see\n * {@link NodeShapeEntry.bounds}. */\nexport function findShapeBounds<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n ctx?: NodeInkCtx,\n): Bounds | null {\n return findNodeShape(node)?.bounds?.(node, pose, ctx) ?? null;\n}\n\n/** The pose rect grown by how far `stroke` can paint outside it — the paint\n * box of every built-in painter whose geometry the pose box contains. */\nfunction poseBoxBounds(pose: unknown, stroke: Stroke | null, scale: number | undefined): Bounds | null {\n if (!isRectPose(pose)) return null;\n const reach = stroke ? strokeReachAt(stroke, scale ?? 1) : 0;\n const x = Math.min(pose.x, pose.x + pose.width);\n const y = Math.min(pose.y, pose.y + pose.height);\n return {\n x: x - reach,\n y: y - reach,\n width: Math.abs(pose.width) + 2 * reach,\n height: Math.abs(pose.height) + 2 * reach,\n };\n}\n\n/** Options for {@link shapeCoversPoint}. */\nexport interface ShapeCoversPointOptions {\n /** Extra grab distance around the outline: **world** units as a number,\n * or screen pixels under a view scale (`{ px, scale }`), which is measured\n * on screen and so stays exact under non-uniform zoom.\n *\n * Without slop a hairline is a mathematically zero-width target: the\n * stroke of a 1px outline is half a world unit wide at scale 1, which no\n * one can hit. Defaults to `0` so a caller that hasn't thought about the\n * view still gets exact geometry rather than a wrong guess. */\n tolerance?: PickSlop;\n /** View scale, passed to the painter's `ink` so a `{ px }` stroke width\n * resolves to world units. Defaults to 1. */\n scale?: number;\n /** The node's derived path — see {@link NodeSilhouetteCtx.derivedPath}.\n * Without it a derived node reports no silhouette and this answers `true`\n * everywhere, which degrades picking to the caller's AABB: for an edge,\n * a zero-sized pose. */\n derivedPath?: Path | null;\n}\n\n/**\n * Does the shape `node` actually paints cover the world point?\n *\n * The pose rect says a node covers its whole bounding box. That is wrong for\n * everything that is not a rectangle: the concave notch of a star, the corner\n * outside an ellipse, the blank right half of a text box. This asks the\n * painter's silhouette instead, which is the same boundary used for clipping\n * and area-select, so \"what you can click\" and \"what is drawn\" answer\n * together.\n *\n * \"What is drawn\" includes the *ink*, not just the boundary. A shape whose\n * interior isn't filled — an outlined rect, a pencil stroke, a bare line — is\n * grabbable along its outline and not through its empty middle, which is the\n * opposite of what a fill test alone answers. The outline's grab width is the\n * stroke's half-width plus `tolerance`.\n *\n * A painter with no `silhouette`, or one that returns `null` for this node\n * (`kit:text` does, for a node with no non-blank lines), reports `true` —\n * \"no opinion\", leaving the caller's own AABB test as the answer. Callers\n * should keep that AABB test as a cheap pre-filter; this is the refinement,\n * not a replacement.\n *\n * Rotation is already baked by `findShapeSilhouette`, so the point is in\n * plain world coordinates.\n */\nexport function shapeCoversPoint<TData, TPose>(\n node: Node<TData, string, TPose>,\n pose: TPose,\n x: number,\n y: number,\n opts: ShapeCoversPointOptions = {},\n): boolean {\n const sil = findShapeSilhouette(node, pose, { derivedPath: opts.derivedPath });\n if (sil === null) return true;\n const ink = findShapeInk(node, pose, { scale: opts.scale }) ?? DEFAULT_INK;\n const inside = pathContainsPoint(sil, x, y);\n if (ink.filled && inside) return true;\n // The stroke reaches a different distance on each side, so which side the\n // point is on picks the reach. `tolerance` widens it to something a pointer\n // can actually land on, and also makes a filled shape grabbable a few pixels\n // outside its edge — which is what every editor does and what makes\n // edge-dragging feel possible.\n const { extra, opts: hit } = slopForStrokeHit(opts.tolerance);\n const reach = (inside ? ink.inset : ink.outset) + extra;\n return (reach > 0 || hasSlop(opts.tolerance)) && strokeHitTest(sil, x, y, reach, hit);\n}\n\n/** Snapshot of the current painters in evaluation order — `'high'` tier\n * first, then `'normal'`. Useful for debugging which painter handles a\n * given node. */\nexport function getNodeShapes(): readonly NodeShapeEntry[] {\n return [...PAINTERS.high, ...PAINTERS.normal];\n}\n\n/** Test-only: clear the registry and re-register the built-ins. */\nexport function _resetShapePaintersForTests(): void {\n PAINTERS.high.length = 0;\n PAINTERS.normal.length = 0;\n registerBuiltInShapePainters();\n // Swapping the painter set out from under a node invalidates anything\n // memoized against the old one. (`registerNodeShape` already bumps, but the\n // clearing above happens without one.)\n bumpNodeMemoGeneration();\n}\n\n// ─── Built-in painters ─────────────────────────────────────────────────\n\n/** The `data` a `kit:text` node carries. */\ninterface TextNodeData {\n text: string;\n style?: TextStyle;\n runs?: readonly StyledRun[];\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n verticalAlign?: TextVerticalAlign;\n}\n\n/** A `kit:text` node as the `TextPose` every text consumer reads. The stroke\n * goes through the same resolver every other node kind's does, so one\n * carrying no paint is dropped here rather than throwing in the renderer. */\nfunction textPoseOf(d: TextNodeData, p: RectPose): TextPose {\n return {\n x: p.x, y: p.y, width: p.width, height: p.height,\n text: d.text,\n runs: d.runs as StyledRun[] | undefined,\n style: d.style,\n fill: d.fill,\n stroke: resolveNodeStroke(d.stroke) ?? undefined,\n verticalAlign: d.verticalAlign,\n };\n}\n\nconst TEXT_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n id: 'kit:text',\n matches: (node) => {\n if (!paintsPose(node.pose)) return false;\n const d = node.data as { text?: string } | null;\n return d?.text != null;\n },\n // Memoized, and not for its own sake — `resolveTextStyle` + `resolveRuns`\n // are cheap (0.14 ms/frame at 1000 text nodes). It is the enabler: the\n // renderer's layout cache keys on the `ResolvedRun[]` array identity, and\n // `layoutRuns` costs 25.9 ms/frame for 200 wrapped paragraphs. Handing back\n // a fresh runs array per frame would leave that cache missing on every\n // draw, exactly as a fresh `Path` per frame defeated the mesh cache. Both\n // resolvers are pure style merging — no font reads — so `(data, pose)` is\n // the whole key. See PAINT_SLOT.\n //\n // `y` is the top of the first line box, not a baseline — see\n // `TextDrawCommand.y`. Wrap, alignment and run resolution are\n // `textCommandFromPose`'s, which `createTextLayer`, picking, the caret and\n // the edit overlay all share.\n paint: (node, pose) => nodeMemo(node, PAINT_SLOT, pose, () => [\n textCommandFromPose(textPoseOf(node.data as TextNodeData, pose)),\n ]),\n // The pose is a layout box, not a bounding box — \"Away\" in a 300-unit box\n // leaves most of it empty, and a pose-rect silhouette claims all of it. The\n // union of the line boxes is what the node actually covers, so picking,\n // lasso and clipping stop grabbing blank space.\n //\n // `null` rather than an empty path when there are no non-blank lines: an\n // empty text node would otherwise become unpickable, and a caller reading\n // \"no silhouette\" falls back to the pose rect, which is the behavior an\n // empty box wants.\n silhouette: (node, pose) => {\n const boxes = textLineBoxes(textPoseOf(node.data as TextNodeData, pose));\n if (boxes.length === 0) return null;\n return rectsToPath(boxes);\n },\n // `filled` is unconditional, `data.fill: null` included: the silhouette\n // above is line boxes, not glyph ink, so reporting outline-only text as\n // unfilled would leave it grabbable within a stroke width of a box edge and\n // nowhere near the letters. The reach still matters — a heavily outlined\n // glyph was unpickable across the width of its own outline.\n ink: (node, _pose, ctx) => {\n const d = node.data as { stroke?: Stroke | null };\n return { filled: true, ...inkReach(resolveNodeStroke(d.stroke), ctx?.scale) };\n },\n};\n\n/**\n * Union of axis-aligned rects as one multi-contour `PolygonPath`.\n *\n * Every contour winds the same way, so `'nonzero'` reads overlapping rects as\n * covered rather than punching a hole where two lines happen to overlap —\n * which they do the moment `lineHeight` drops below 1.\n */\nfunction rectsToPath(rects: readonly { x: number; y: number; width: number; height: number }[]): PolygonPath {\n const commands = new Uint8Array(rects.length * 6);\n const coords = new Float32Array(rects.length * 10);\n let ci = 0;\n let cmd = 0;\n for (const r of rects) {\n const { x, y, width: w, height: h } = r;\n commands[cmd++] = PATH_M; coords[ci++] = x; coords[ci++] = y;\n commands[cmd++] = PATH_L; coords[ci++] = x + w; coords[ci++] = y;\n commands[cmd++] = PATH_L; coords[ci++] = x + w; coords[ci++] = y + h;\n commands[cmd++] = PATH_L; coords[ci++] = x; coords[ci++] = y + h;\n commands[cmd++] = PATH_L; coords[ci++] = x; coords[ci++] = y;\n commands[cmd++] = PATH_Z;\n }\n return { kind: 'polygon', commands, coords, fillRule: 'nonzero' };\n}\n\n/**\n * What a node's `data.fill` means to the built-in painters.\n *\n * A {@link FillStyle} is used as-is — which is how a gradient or a pattern\n * reaches the renderer without a consumer registering a painter of its own.\n * `null` is an explicit \"no fill\"; `undefined` takes the painter's fallback.\n * Write one with {@link solid} rather than by hand when all you have is a\n * color.\n */\nfunction resolveNodeFill(\n fill: FillStyle | null | undefined,\n fallback: FillStyle | null,\n): FillStyle | null {\n return fill === undefined ? fallback : fill;\n}\n\n/** The stroke a built-in painter should emit, or `null` for \"no stroke\".\n * `data.stroke` is a whole {@link Stroke} — width, cap, join, dash, miter\n * limit and align all reach the renderer. {@link strokeOf} builds one from a\n * color.\n *\n * A stroke carrying no `paint` reads as no stroke. `Stroke.paint` is\n * required by the type, so this is unreachable from well-formed data — but a\n * document is data, and a stroke assembled a field at a time (a width\n * written onto a node that had none) arrives here without one. Painting it\n * threw out of `fillInPoseFrame`, and the throw escapes the painter and\n * takes the whole frame with it: the page and every other node vanish, and\n * the canvas stays stale until something unrelated requests a redraw. One\n * malformed node must not be able to blank the document. */\nfunction resolveNodeStroke(stroke: Stroke | null | undefined): PaintedStroke | null {\n if (stroke?.paint == null) return null;\n return stroke as PaintedStroke;\n}\n\n/** A stroke that paints — what everything downstream of `resolveNodeStroke`\n * works with. */\ntype PaintedStroke = Stroke & { paint: FillStyle };\n\n/** Bake a bounds-relative stroke paint onto the given box, the way a fill is\n * baked. The box is the frame the path was projected into, so a paint left in\n * `'bounds'` units would reach the renderer describing a frame that never\n * exists. `null` when a pattern spec fails to resolve. */\nfunction strokeInPoseFrame(stroke: PaintedStroke, box: FillPoseBox): Stroke | null {\n const paint = resolveFillPattern(fillInPoseFrame(stroke.paint, box));\n if (paint === null) return null;\n return paint === stroke.paint ? stroke : { ...stroke, paint };\n}\n\n/** Per-side grab reach for a resolved stroke, in world units. */\nfunction inkReach(\n stroke: Stroke | null,\n scale: number | undefined,\n): { outset: number; inset: number } {\n if (stroke === null) return { outset: 0, inset: 0 };\n const w = resolveStrokeWidth(stroke.width ?? 1, scale ?? 1);\n // A marker paints past the path's own end, and the kit's rule is that\n // visible chrome is hittable — so the reach has to cover it.\n const reach = markerReach(stroke, w, scale);\n switch (stroke.align ?? 'center') {\n case 'inner':\n return { outset: reach, inset: w };\n case 'outer':\n return { outset: w + reach, inset: 0 };\n default:\n return { outset: w / 2 + reach, inset: w / 2 };\n }\n}\n\n/** Apply {@link NodePaintCtx.vertexColors} to a path painter's body — its first\n * command. Applied outside the paint memo, whose key\n * cannot see an override: `cmds` comes back as-is when nothing changes, and\n * otherwise as a copy, since a memoized list is not ours to edit. Colors whose\n * length does not match the path's anchors are dropped. */\nfunction withAnimatedVertexColors(cmds: DrawCommand[], ctx: NodePaintCtx | undefined): DrawCommand[] {\n const resolve = ctx?.vertexColors;\n const body = cmds[0];\n if (resolve === undefined || body?.kind !== 'path') return cmds;\n const expected = 4 * countPathAnchors(body.path);\n const fill = body.fill ? resolve('fill', body.vertexColors) : undefined;\n const stroke = body.stroke ? resolve('stroke', body.stroke.vertexColors) : undefined;\n const fillChanged = fill?.length === expected && fill !== body.vertexColors;\n const strokeChanged = stroke?.length === expected && stroke !== body.stroke?.vertexColors;\n if (!fillChanged && !strokeChanged) return cmds;\n const next: PathDrawCommand = {\n ...body,\n ...(fillChanged ? { vertexColors: fill as number[] } : {}),\n ...(strokeChanged ? { stroke: { ...body.stroke!, vertexColors: stroke as number[] } } : {}),\n };\n return [next, ...cmds.slice(1)];\n}\n\nconst PATH_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n id: 'kit:path',\n matches: (node) => {\n if (!paintsPose(node.pose)) return false;\n const d = node.data as { path?: Path } | null;\n return d?.path != null;\n },\n // Memoized: a pure function of `(data, pose)`, and `pathInPoseFrame`\n // allocates on every call but the identity (`kind: 'rect'`) branch. See\n // PAINT_SLOT.\n paint: (node, pose, ctx) => withAnimatedVertexColors(nodeMemo(node, PAINT_SLOT, pose, () => {\n const d = node.data as {\n path: Path;\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n vertexColors?: number[];\n };\n const projected = pathInPoseFrame(d.path, pose);\n const strokeSpec = resolveNodeStroke(d.stroke);\n const hasStroke = strokeSpec !== null;\n // An undeclared fill falls back to the default one only if there's no\n // stroke — otherwise the path is stroke-only (e.g. pencil) and a default\n // fill would be wrong.\n const declared = resolveNodeFill(d.fill, hasStroke ? null : DEFAULT_SHAPE_FILL);\n // The pose is baked into `projected` rather than emitted as a transform,\n // so a box-relative gradient has to be baked onto the same box here or\n // it would arrive in the renderer referring to a frame that never exists.\n const fill = declared && resolveFillPattern(fillInPoseFrame(declared, pose));\n const stroke = strokeSpec && strokeInPoseFrame(strokeSpec, pose);\n const cmd: DrawCommand = {\n kind: 'path',\n path: projected,\n ...(fill ? { fill } : {}),\n ...(fill && d.vertexColors ? { vertexColors: d.vertexColors } : {}),\n ...(stroke ? { stroke } : {}),\n };\n return [cmd];\n }), ctx),\n silhouette: (node, pose) => {\n const d = node.data as { path: Path };\n return pathInPoseFrame(d.path, pose);\n },\n // Mirrors the fill/stroke decisions `paint` makes above — same reads, same\n // 'none' handling, same \"no fill declared and a stroke present means\n // stroke-only\" fallback. Kept in step with `paint` by\n // `NodeShape.ink.test.ts`, which asserts the two agree.\n ink: (node, _pose, ctx) => {\n const d = node.data as {\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n };\n const stroke = resolveNodeStroke(d.stroke);\n const hasStroke = stroke !== null;\n return {\n filled: resolveNodeFill(d.fill, hasStroke ? null : DEFAULT_SHAPE_FILL) !== null,\n ...inkReach(stroke, ctx?.scale),\n };\n },\n // `pathInPoseFrame` fits the path's own bounds to the pose box.\n bounds: (node, pose, ctx) =>\n poseBoxBounds(pose, resolveNodeStroke((node.data as { stroke?: Stroke | null }).stroke), ctx?.scale),\n};\n\n/** Built-in shape dispatcher — matches when `data.shape` names a kit-known\n * shape kind. Computes both paint and silhouette from the pose so consumer\n * scenes can declare clipping/rendering directly in JSON without\n * registering a custom painter. */\nconst SHAPE_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n id: 'kit:shape',\n matches: (node) => {\n if (!paintsPose(node.pose)) return false;\n const s = (node.data as { shape?: string } | null)?.shape;\n return s != null && SHAPE_KINDS.has(s);\n },\n // Memoized: a pure function of `(data, pose)`, and `pathForShape` builds a\n // fresh `Uint8Array` + `Float32Array` for every ellipse, polygon and star.\n // See PAINT_SLOT.\n paint: (node, pose, ctx) => withAnimatedVertexColors(nodeMemo(node, PAINT_SLOT, pose, () => {\n const d = node.data as { shape: string; fill?: FillStyle | null; stroke?: Stroke | null; sides?: number; points?: number };\n const path = pathForShape(d, pose);\n const declaredFill = resolveNodeFill(d.fill, DEFAULT_SHAPE_FILL);\n const shapeFill = declaredFill && resolveFillPattern(fillInPoseFrame(declaredFill, pose));\n const strokeSpec = resolveNodeStroke(d.stroke);\n const stroke = strokeSpec && strokeInPoseFrame(strokeSpec, pose);\n return [{\n kind: 'path',\n path,\n ...(shapeFill ? { fill: shapeFill } : {}),\n ...(stroke ? { stroke } : {}),\n }];\n }), ctx),\n silhouette: (node, pose) => {\n const d = node.data as { shape: string; sides?: number; points?: number };\n return pathForShape(d, pose);\n },\n // `paint` above emits the default fill when none is declared, so a shape\n // is filled unless it declares `fill: null` — unlike `kit:path`, it has no\n // implicit stroke-only form.\n ink: (node, _pose, ctx) => {\n const d = node.data as { fill?: FillStyle | null; stroke?: Stroke | null };\n return {\n filled: resolveNodeFill(d.fill, DEFAULT_SHAPE_FILL) !== null,\n ...inkReach(resolveNodeStroke(d.stroke), ctx?.scale),\n };\n },\n // Every shape kind is inscribed in the pose box.\n bounds: (node, pose, ctx) =>\n poseBoxBounds(pose, resolveNodeStroke((node.data as { stroke?: Stroke | null }).stroke), ctx?.scale),\n};\n\nconst SHAPE_KINDS = new Set(['rect', 'ellipse', 'polygon', 'star']);\n\nfunction pathForShape(\n d: { shape: string; sides?: number; points?: number },\n p: RectPose,\n): Path {\n switch (d.shape) {\n case 'ellipse':\n return ellipsePath(p);\n case 'polygon': {\n const cx = p.x + p.width / 2;\n const cy = p.y + p.height / 2;\n const r = Math.min(p.width, p.height) / 2;\n return regularPolygonPath({ x: cx, y: cy }, r, d.sides ?? 6);\n }\n case 'star': {\n const cx = p.x + p.width / 2;\n const cy = p.y + p.height / 2;\n const r = Math.min(p.width, p.height) / 2;\n return starPath({ x: cx, y: cy }, r, d.points ?? 5);\n }\n case 'rect':\n default:\n return { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height };\n }\n}\n\nfunction sourceInPixels(\n s: NonNullable<ImageNodeData['image']['source']>,\n bmp: ImageBitmap,\n): { x: number; y: number; w: number; h: number } {\n return {\n x: s.x * bmp.width, y: s.y * bmp.height, w: s.width * bmp.width, h: s.height * bmp.height,\n };\n}\n\n/** The whole bitmap's size in device pixels when `source` of it fills `pose`. */\nfunction drawnSize(\n pose: RectPose,\n source: ImageNodeData['image']['source'],\n pixelScale: number | undefined,\n): ImageRasterSize | undefined {\n if (!(pixelScale && pixelScale > 0)) return undefined;\n return {\n width: Math.abs(pose.width) * pixelScale / (source?.width || 1),\n height: Math.abs(pose.height) * pixelScale / (source?.height || 1),\n };\n}\n\n/** Raster-image painter. Renders `data.image.src` (URL / blob: / data-URI)\n * via an `ImageDrawCommand` once the bitmap has decoded; until then it paints\n * a faint placeholder outline so the node stays visible + selectable (a\n * reddish outline + slash marks a failed load). The decoded bitmap is owned\n * by `imageCache`, keyed on `src`; the node holds only the serializable `src`.\n * Registered before `kit:rect-fallback` so image nodes don't fall through. */\nconst IMAGE_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n id: 'kit:image',\n matches: (node) => {\n if (!paintsPose(node.pose)) return false;\n const src = (node.data as { image?: { src?: unknown } } | null)?.image?.src;\n return typeof src === 'string' && src.length > 0;\n },\n paint: (node, pose, ctx) => {\n const d = node.data as ImageNodeData;\n const p = pose;\n const bmp = ctx?.resolveImage\n ? ctx.resolveImage(node as unknown as Node<unknown, string, unknown>)\n : getImageBitmap(d.image.src, drawnSize(p, d.image.source, ctx?.pixelScale));\n if (bmp) {\n return [{\n kind: 'image',\n image: bmp,\n x: p.x, y: p.y, w: p.width, h: p.height,\n ...(d.image.opacity !== undefined ? { opacity: d.image.opacity } : {}),\n ...(d.image.source ? { source: sourceInPixels(d.image.source, bmp) } : {}),\n ...(d.image.flipX ? { flipX: true } : {}),\n ...(d.image.flipY ? { flipY: true } : {}),\n }];\n }\n // Not ready — faint placeholder (grey while loading, reddish + slash on\n // error). With a caller-supplied resolver the fallback is deterministic:\n // always the plain grey outline, no ambient load-status read.\n const error = ctx?.resolveImage ? false : imageStatus(d.image.src) === 'error';\n const color = error ? '#d08a8a' : '#bbbbbb';\n const cmds: DrawCommand[] = [{\n kind: 'path',\n path: { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height },\n stroke: { paint: { color }, width: 1 },\n }];\n if (error) {\n cmds.push({\n kind: 'path',\n path: linePath({ x: p.x, y: p.y }, { x: p.x + p.width, y: p.y + p.height }),\n stroke: { paint: { color }, width: 1 },\n });\n }\n return cmds;\n },\n silhouette: (_node, pose) => {\n const p = pose;\n return { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height };\n },\n // The placeholder's 1-unit outline is the only thing that leaves the box.\n bounds: (_node, pose, ctx) => poseBoxBounds(pose, IMAGE_PLACEHOLDER_STROKE, ctx?.scale),\n};\n\nconst IMAGE_PLACEHOLDER_STROKE: Stroke = { paint: { color: '#000' }, width: 1 };\n\n/**\n * Built-in painter for nodes whose geometry is computed from other nodes'\n * poses. The path itself arrives on the paint context — see\n * {@link NodePaintCtx.derivedPath}.\n *\n * Fill and stroke resolve as `kit:path`'s do, but against the **derived path's\n * own bounds**, not the pose. `kit:path` projects its path into the pose frame\n * first, so there the two boxes are the same one; here the path is already\n * absolute and the pose is typically a zero-sized placeholder, which would\n * collapse a box-relative gradient onto a point.\n *\n * Not memoized on {@link PAINT_SLOT} on purpose: that key is `(node, pose,\n * data)` and cannot see `ctx.derivedPath`, so it would serve one caller's\n * commands to a caller that passed a different path.\n *\n * Rotation still comes from the pose — `wrapNodeOutput` turns the output about\n * the pose AABB's center, which for a zero-sized pose is its origin.\n */\nconst DERIVED_PAINTER: NodeShapeEntry = {\n id: 'kit:derived',\n // `dependsOn` alone is not enough: the two fields are independent optionals,\n // and `kit:add` restores a node with its `dependsOn` intact when its\n // `derivePath` key is missing from the registry. Claiming that node would paint\n // nothing where the authored appearance is what the warning promises.\n matches: (node) => (node.dependsOn?.length ?? 0) > 0 && node.derivePath !== undefined,\n paint: (node, _pose, ctx) => {\n const path = ctx?.derivedPath;\n if (path == null) return [];\n const box = boundsOfPath(path);\n const d = node.data as { fill?: FillStyle | null; stroke?: Stroke | null; vertexColors?: number[] } | null;\n const strokeSpec = resolveNodeStroke(d?.stroke);\n const declared = resolveNodeFill(d?.fill, strokeSpec === null ? DEFAULT_SHAPE_FILL : null);\n const fill = declared && resolveFillPattern(fillInPoseFrame(declared, box));\n const stroke = strokeSpec && strokeInPoseFrame(strokeSpec, box);\n const cmd: DrawCommand = {\n kind: 'path',\n path,\n ...(fill ? { fill } : {}),\n ...(fill && d?.vertexColors ? { vertexColors: d.vertexColors } : {}),\n ...(stroke ? { stroke } : {}),\n };\n return withAnimatedVertexColors([cmd], ctx);\n },\n // The derived path *is* the silhouette, and it is already absolute — the\n // pose is a placeholder, so nothing here can be recovered from it. Without\n // a `ctx` this reports null, which `shapeCoversPoint` reads as \"no\n // opinion\": picking then falls back to that zero-sized pose.\n silhouette: (_node, _pose, ctx) => ctx?.derivedPath ?? null,\n ink: (node, _pose, ctx) => {\n const d = node.data as { fill?: FillStyle | null; stroke?: Stroke | null } | null;\n const stroke = resolveNodeStroke(d?.stroke);\n return {\n filled: resolveNodeFill(d?.fill, stroke === null ? DEFAULT_SHAPE_FILL : null) !== null,\n ...inkReach(stroke, ctx?.scale),\n };\n },\n};\n\nconst RECT_FALLBACK_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n // Last-resort painter — matches any rect-posed node, so it must be\n // registered last within `'normal'`. Consumers who want a different\n // fallback should register their own painter at `'high'` priority and let\n // this one never fire (or unregister it explicitly).\n id: 'kit:rect-fallback',\n matches: (node) => paintsPose(node.pose),\n paint: (node, pose) => {\n const d = node.data as { fill?: FillStyle | null } | null;\n const p = pose;\n const fill = resolveNodeFill(d?.fill, DEFAULT_SHAPE_FILL);\n return [{\n kind: 'path',\n path: { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height },\n ...(fill ? { fill } : {}),\n }];\n },\n silhouette: (_node, pose) => {\n const p = pose;\n return { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height };\n },\n bounds: (_node, pose) => poseBoxBounds(pose, null, undefined),\n};\n\nfunction registerBuiltInShapePainters(): void {\n registerNodeShape(TEXT_PAINTER);\n // Ahead of path/shape/image: a derived node whose `data` also carries a\n // `path`, `shape` or `image` means the derived path, and those three match\n // on the presence of the field alone.\n registerNodeShape(DERIVED_PAINTER);\n registerNodeShape(PATH_PAINTER);\n registerNodeShape(SHAPE_PAINTER);\n registerNodeShape(IMAGE_PAINTER);\n registerNodeShape(RECT_FALLBACK_PAINTER);\n}\n\nregisterBuiltInShapePainters();\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,SAASA,EAAW,GAAwB;CAC1C,OAAOC,MAAS,KAAA,KAAaC,EAAWD,CAAI;AAC9C;AA+KA,IAAaE,IAAiC,OAAO,OAAO;CAAE,QAAQ;CAAM,QAAQ;CAAG,OAAO;AAAE,CAAC,GAS3FC,IAAiE;CACrE,MAAM,CAAC;CACP,QAAQ,CAAC;AACX;AAGA,SAAgBC,EACd,GACA,IAAiC,CAAC,GACtB;CACZ,IAAMC,IAAOC,EAAK,aAAa,SAASH,EAAS,OAAOA,EAAS;CAKjE,OAJAE,EAAK,KAAKE,CAAyB,GAGnCC,EAAuB,SACV;EACX,IAAMC,IAAIJ,EAAK,QAAQE,CAAyB;EAEhD,AADIE,KAAK,KAAGJ,EAAK,OAAOI,GAAG,CAAC,GAC5BD,EAAuB;CACzB;AACF;AAoBA,IAAME,IAAe,iBACfC,IAAuB,yBACvBC,IAAkB,oBAkBlBC,IAAa;AAKnB,SAAgBC,EACd,GAC0C;CAE1C,IAAMC,IAAOhB,EAAWiB,EAAK,IAAI,IAAIN,IAAeC;CACpD,OAAOM,EAASD,GAA4BD,GAAM,KAAA,SAChDG,EAAeF,CAAI,CACrB;AACF;AAEA,SAASE,EACP,GAC0C;CAC1C,KAAK,IAAMC,KAAKhB,EAAS,MACvB,IAAIgB,EAAE,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IAAI/B,EAAK,MACTG,IAAInB,GACJkE,IAAOD,EAAgBlB,GAAG,MAAM0C,CAAkB;EACxD,OAAO,CAAC;GACN,MAAM;GACN,MAAM;IAAE,MAAM;IAAQ,GAAGtE,EAAE;IAAG,GAAGA,EAAE;IAAG,OAAOA,EAAE;IAAO,QAAQA,EAAE;GAAO;GACvE,GAAI+C,IAAO,EAAE,QAAK,IAAI,CAAC;EACzB,CAAC;CACH;CACA,aAAa,GAAO,MAAS;EAC3B,IAAM/C,IAAInB;EACV,OAAO;GAAE,MAAM;GAAQ,GAAGmB,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC1E;CACA,SAAS,GAAO,MAASU,EAAc7B,GAAM,MAAM,KAAA,CAAS;AAC9D;AAEA,SAASsH,KAAqC;CAS5C,AARAlH,EAAkB6C,CAAY,GAI9B7C,EAAkB+G,EAAe,GACjC/G,EAAkB+E,CAAY,GAC9B/E,EAAkBsF,CAAa,GAC/BtF,EAAkBuG,EAAa,GAC/BvG,EAAkBiH,EAAqB;AACzC;AAEAC,GAA6B"}
@@ -0,0 +1,93 @@
1
+ import e from "./hud.module.js";
2
+ import { useHostAnchor as t } from "./useHostAnchor.js";
3
+ import { useEffect as n, useState as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/canvas/PickHud.tsx
6
+ function o({ canvasRef: o, anchorRef: s, viewRef: c, pickEvery: l, pickBest: u, offset: d }) {
7
+ let [f, p] = r({
8
+ ids: [],
9
+ best: null,
10
+ inCanvas: !1
11
+ }), { ref: m, style: h } = t(() => s?.current ?? o.current?.parentElement ?? o.current, {
12
+ align: {
13
+ x: "end",
14
+ y: "start"
15
+ },
16
+ offset: {
17
+ x: d?.right ?? 8,
18
+ y: d?.top ?? 76
19
+ }
20
+ });
21
+ return n(() => {
22
+ let e = (e) => {
23
+ let t = o.current, n = c.current;
24
+ if (!t || !n) {
25
+ p({
26
+ ids: [],
27
+ best: null,
28
+ inCanvas: !1
29
+ });
30
+ return;
31
+ }
32
+ let r = t.getBoundingClientRect();
33
+ if (!(e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom)) {
34
+ p({
35
+ ids: [],
36
+ best: null,
37
+ inCanvas: !1
38
+ });
39
+ return;
40
+ }
41
+ let i = (e.clientX - r.left) / n.scale.x + n.x, a = (e.clientY - r.top) / n.scale.y + n.y, s = [];
42
+ try {
43
+ s = l(i, a);
44
+ } catch {
45
+ s = [];
46
+ }
47
+ let d = null;
48
+ if (u) try {
49
+ d = u(i, a);
50
+ } catch {
51
+ d = null;
52
+ }
53
+ p({
54
+ ids: s,
55
+ best: d,
56
+ inCanvas: !0
57
+ });
58
+ };
59
+ return document.addEventListener("pointermove", e), () => {
60
+ document.removeEventListener("pointermove", e);
61
+ };
62
+ }, [
63
+ o,
64
+ c,
65
+ l,
66
+ u
67
+ ]), h ? /* @__PURE__ */ a("div", {
68
+ ref: m,
69
+ className: `${e.hud} ${e.sized}`,
70
+ style: h,
71
+ children: [/* @__PURE__ */ a("div", {
72
+ className: `${e.header} ${e.muted}`,
73
+ children: [
74
+ "pickEvery (",
75
+ f.ids.length,
76
+ ")"
77
+ ]
78
+ }), f.ids.length === 0 ? /* @__PURE__ */ i("div", {
79
+ className: e.absent,
80
+ children: f.inCanvas ? "—" : "off-canvas"
81
+ }) : /* @__PURE__ */ i("ul", {
82
+ className: e.list,
83
+ children: f.ids.slice().reverse().map((t) => /* @__PURE__ */ i("li", {
84
+ className: t === f.best ? `${e.item} ${e.itemBest}` : e.item,
85
+ children: t
86
+ }, t))
87
+ })]
88
+ }) : null;
89
+ }
90
+ //#endregion
91
+ export { o as PickHud };
92
+
93
+ //# sourceMappingURL=PickHud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickHud.js","names":["s","hud_module_default","PickHud","state","setState","useState","useHostAnchor","anchorRef","canvasRef","offset","useEffect","onMove","canvas","view","viewRef","rect","worldX","worldY","ids","pickEvery","best","pickBest","style","id"],"sources":["../../src/canvas/PickHud.tsx"],"sourcesContent":["/**\n * Dev HUD listing the ids returned by `pickEvery(world)` under the cursor.\n *\n * Anchors to the canvas's top-right corner like `CursorCoordsHud`, offset\n * downward so it sits just below that HUD. Updates on `document`\n * pointermove. Refreshes its position on scroll / resize so it tracks the\n * canvas through layout changes.\n */\nimport { useEffect, useState } from 'react';\nimport type { View } from 'core/viewport/view';\nimport { useHostAnchor } from './useHostAnchor';\nimport s from './hud.module.css';\n\n/** Props for `<PickHud>`. */\nexport interface PickHudProps {\n canvasRef: React.RefObject<HTMLElement | null>;\n /** Element the HUD pins its corner to. Defaults to the canvas's parent — the\n * wrapper a bare `<canvas>` sits in. A detached canvas passes its own input\n * box, whose parent is the shared surface every pane sits in. */\n anchorRef?: React.RefObject<HTMLElement | null>;\n viewRef: React.RefObject<View>;\n /** World-space hit-test. Same shape as `useSelectTool`'s `pickEvery`. */\n pickEvery: (worldX: number, worldY: number) => readonly string[];\n /** Optional single-best resolver — the id this point would select on a\n * bare click. When supplied, that id is rendered bold in the list. */\n pickBest?: (worldX: number, worldY: number) => string | null;\n /** Inset from the canvas's top-right corner. Default `{ top: 76, right: 8 }`\n * so the HUD clears `CursorCoordsHud` (~64 px tall in its 3-line form). */\n offset?: { top?: number; right?: number };\n}\n\ninterface HudState {\n ids: readonly string[];\n best: string | null;\n inCanvas: boolean;\n}\n\n/** Debug overlay listing every node under the pointer, with the one a click\n * would actually select shown in bold. */\nexport function PickHud({ canvasRef, anchorRef, viewRef, pickEvery, pickBest, offset }: PickHudProps) {\n const [state, setState] = useState<HudState>({\n ids: [], best: null, inCanvas: false,\n });\n const { ref, style } = useHostAnchor(\n () => anchorRef?.current ?? canvasRef.current?.parentElement ?? canvasRef.current,\n {\n align: { x: 'end', y: 'start' },\n offset: { x: offset?.right ?? 8, y: offset?.top ?? 76 },\n },\n );\n\n useEffect(() => {\n const onMove = (e: PointerEvent) => {\n const canvas = canvasRef.current;\n const view = viewRef.current;\n if (!canvas || !view) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const rect = canvas.getBoundingClientRect();\n const inCanvas =\n e.clientX >= rect.left && e.clientX <= rect.right &&\n e.clientY >= rect.top && e.clientY <= rect.bottom;\n if (!inCanvas) {\n setState({ ids: [], best: null, inCanvas: false });\n return;\n }\n const worldX = (e.clientX - rect.left) / view.scale.x + view.x;\n const worldY = (e.clientY - rect.top) / view.scale.y + view.y;\n let ids: readonly string[] = [];\n try {\n ids = pickEvery(worldX, worldY);\n } catch {\n ids = [];\n }\n let best: string | null = null;\n if (pickBest) {\n try { best = pickBest(worldX, worldY); } catch { best = null; }\n }\n setState({ ids, best, inCanvas: true });\n };\n\n document.addEventListener('pointermove', onMove);\n\n return () => {\n document.removeEventListener('pointermove', onMove);\n };\n }, [canvasRef, viewRef, pickEvery, pickBest]);\n\n if (!style) return null;\n\n return (\n <div ref={ref} className={`${s.hud} ${s.sized}`} style={style}>\n <div className={`${s.header} ${s.muted}`}>pickEvery ({state.ids.length})</div>\n {state.ids.length === 0 ? (\n <div className={s.absent}>{state.inCanvas ? '—' : 'off-canvas'}</div>\n ) : (\n <ul className={s.list}>\n {/* pickEvery returns back-to-front (topmost last). Display top-first. */}\n {state.ids.slice().reverse().map((id) => (\n <li\n key={id}\n className={id === state.best ? `${s.item} ${s.itemBest}` : s.item}\n >\n {id}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAuCA,SAAgBE,EAAQ,EAAE,cAAW,cAAW,YAAS,cAAW,aAAU,aAAwB;CACpG,IAAM,CAACC,GAAOC,KAAYC,EAAmB;EAC3C,KAAK,CAAC;EAAG,MAAM;EAAM,UAAU;CACjC,CAAC,GACK,EAAE,QAAK,aAAUC,QACfC,GAAW,WAAWC,EAAU,SAAS,iBAAiBA,EAAU,SAC1E;EACE,OAAO;GAAE,GAAG;GAAO,GAAG;EAAQ;EAC9B,QAAQ;GAAE,GAAGC,GAAQ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AO;GAAM;EAC5E,CAAA,GAAAA,EAAM,IAAI,WAAW,IACpB,kBAAC,OAAD;GAAK,WAAWH,EAAE;GAAS,UAAAG,EAAM,WAAW,MAAM;EAAkB,CAAA,IAEpE,kBAAC,MAAD;GAAI,WAAWH,EAAE;GAEd,UAAAG,EAAM,IAAI,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,MAChC,kBAAC,MAAD;IAEE,WAAWoB,MAAOpB,EAAM,OAAO,GAAGH,EAAE,KAAK,GAAGA,EAAE,aAAaA,EAAE;IAE5D,UAAAuB;GACC,GAJGA,CAIH,CACL;EACC,CAAA,CAEH;MApBY;AAsBrB"}
@@ -0,0 +1,10 @@
1
+ import { ActionsProvider as e, useActionsRegistry as t } from "@weasel-js/routing/react";
2
+ import { Fragment as n, jsx as r } from "react/jsx-runtime";
3
+ //#region src/canvas/SceneCanvas/ActionsProviderIfRoot.tsx
4
+ function i({ children: i }) {
5
+ return t() ? /* @__PURE__ */ r(n, { children: i }) : /* @__PURE__ */ r(e, { children: i });
6
+ }
7
+ //#endregion
8
+ export { i as ActionsProviderIfRoot };
9
+
10
+ //# sourceMappingURL=ActionsProviderIfRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionsProviderIfRoot.js","names":["_Fragment","ActionsProviderIfRoot","useActionsRegistry","Fragment","ActionsProvider"],"sources":["../../../src/canvas/SceneCanvas/ActionsProviderIfRoot.tsx"],"sourcesContent":["/**\n * Conditional `<ActionsProvider>` wrapper: mounts one only when no registry is\n * in scope, and otherwise renders its children against the one there. Used by\n * a non-isolated `<WeaselProvider>`.\n */\nimport type { ReactNode } from 'react';\nimport { ActionsProvider, useActionsRegistry } from '@weasel-js/routing/react';\n\n/** Mount an `<ActionsProvider>` only when none is already in scope. */\nexport function ActionsProviderIfRoot({ children }: { children: ReactNode }) {\n const parent = useActionsRegistry();\n if (parent) return <>{children}</>;\n return <ActionsProvider>{children}</ActionsProvider>;\n}\n"],"mappings":";;;AASA,SAAgBC,EAAsB,EAAE,eAAqC;CAG3E,OAFeC,EACX,IAAe,kBAAAF,GAAA,EAAG,YAAW,CAAA,IAC1B,kBAACI,GAAD,EAAkB,YAA0B,CAAA;AACrD"}
@@ -0,0 +1,10 @@
1
+ import { DepRegistryProvider as e, useOptionalDepRegistry as t } from "@weasel-js/routing/react";
2
+ import { Fragment as n, jsx as r } from "react/jsx-runtime";
3
+ //#region src/canvas/SceneCanvas/DepRegistryProviderIfRoot.tsx
4
+ function i({ children: i }) {
5
+ return t() ? /* @__PURE__ */ r(n, { children: i }) : /* @__PURE__ */ r(e, { children: i });
6
+ }
7
+ //#endregion
8
+ export { i as DepRegistryProviderIfRoot };
9
+
10
+ //# sourceMappingURL=DepRegistryProviderIfRoot.js.map