@weasel-js/core 1.9.4 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1092) hide show
  1. package/CHANGELOG.md +750 -0
  2. package/README.md +5 -3
  3. package/dist/WeaselProvider.js +5 -7
  4. package/dist/WeaselProvider.js.map +1 -1
  5. package/dist/affordances/composeAffordanceLayer.js +91 -83
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -1
  7. package/dist/affordances/cornerResize.js +3 -2
  8. package/dist/affordances/cornerResize.js.map +1 -1
  9. package/dist/affordances/hitAffordanceRegions.js +54 -100
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  11. package/dist/affordances/pathAnchors.js.map +1 -1
  12. package/dist/affordances/rotationHandle.js +5 -4
  13. package/dist/affordances/rotationHandle.js.map +1 -1
  14. package/dist/animation/behaviors/coast.js +21 -0
  15. package/dist/animation/behaviors/coast.js.map +1 -0
  16. package/dist/animation/behaviors/coastByWrite.js +107 -0
  17. package/dist/animation/behaviors/coastByWrite.js.map +1 -0
  18. package/dist/animation/behaviors/coastOnTargets.js +94 -0
  19. package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
  20. package/dist/animation/behaviors/momentum.js +48 -136
  21. package/dist/animation/behaviors/momentum.js.map +1 -1
  22. package/dist/animation/clipTargets.js +12 -0
  23. package/dist/animation/clipTargets.js.map +1 -0
  24. package/dist/animation/index.js +15 -20
  25. package/dist/animation/poseHelpers.js +112 -33
  26. package/dist/animation/poseHelpers.js.map +1 -1
  27. package/dist/animation/poseTarget.js +115 -0
  28. package/dist/animation/poseTarget.js.map +1 -0
  29. package/dist/animation/reflow.js +113 -83
  30. package/dist/animation/reflow.js.map +1 -1
  31. package/dist/animation/rewind.js +66 -0
  32. package/dist/animation/rewind.js.map +1 -0
  33. package/dist/animation/rig/bindRig.js +85 -53
  34. package/dist/animation/rig/bindRig.js.map +1 -1
  35. package/dist/animation/rig/rigNode.js +93 -0
  36. package/dist/animation/rig/rigNode.js.map +1 -0
  37. package/dist/animation/rig/rigSeat.js +26 -0
  38. package/dist/animation/rig/rigSeat.js.map +1 -0
  39. package/dist/animation/rig/skinBinding.js +56 -0
  40. package/dist/animation/rig/skinBinding.js.map +1 -0
  41. package/dist/animation/rig/useRig.js +31 -16
  42. package/dist/animation/rig/useRig.js.map +1 -1
  43. package/dist/animation/wrappers/animateLifecycle.js +8 -7
  44. package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
  45. package/dist/animation/wrappers/animateOnSetPose.js +31 -31
  46. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
  47. package/dist/animation/wrappers/instantPose.js.map +1 -1
  48. package/dist/animation/writtenPoseTarget.js +33 -0
  49. package/dist/animation/writtenPoseTarget.js.map +1 -0
  50. package/dist/autoPoseDescriptor-DHg5KqaJ.d.ts +27 -0
  51. package/dist/barrel/canvas.js +31 -0
  52. package/dist/barrel/chrome.js +10 -10
  53. package/dist/barrel/input.js +16 -17
  54. package/dist/barrel/interactions.js +35 -39
  55. package/dist/barrel/paint.js +11 -18
  56. package/dist/barrel/paths.js +12 -19
  57. package/dist/barrel/renderer.js +14 -20
  58. package/dist/barrel/routing.js +42 -36
  59. package/dist/barrel/scene.js +37 -0
  60. package/dist/barrel/text.js +9 -18
  61. package/dist/barrel/viewport.js +41 -51
  62. package/dist/canvas/Canvas.js +281 -475
  63. package/dist/canvas/Canvas.js.map +1 -1
  64. package/dist/canvas/CanvasView.js +169 -188
  65. package/dist/canvas/CanvasView.js.map +1 -1
  66. package/dist/canvas/CursorCoordsHud.js +22 -23
  67. package/dist/canvas/CursorCoordsHud.js.map +1 -1
  68. package/dist/canvas/DrawCanvas.js +39 -56
  69. package/dist/canvas/DrawCanvas.js.map +1 -1
  70. package/dist/canvas/ModalityHud.js.map +1 -1
  71. package/dist/canvas/NodeShape.js +28 -29
  72. package/dist/canvas/NodeShape.js.map +1 -1
  73. package/dist/canvas/PickHud.js.map +1 -1
  74. package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
  75. package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
  76. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +66 -107
  77. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -1
  78. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +27 -31
  79. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  80. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +51 -54
  81. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -1
  82. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +3 -3
  83. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -1
  84. package/dist/canvas/SceneCanvas/coordTrace.js +37 -1
  85. package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -1
  86. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +40 -29
  87. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  88. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -1
  89. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
  90. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
  91. package/dist/canvas/SceneCanvas/features.js +73 -43
  92. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  93. package/dist/canvas/SceneCanvas/isDev.js.map +1 -1
  94. package/dist/canvas/SceneCanvas/poseGeometry.js +33 -37
  95. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
  96. package/dist/canvas/SceneCanvas/props.js +15 -14
  97. package/dist/canvas/SceneCanvas/props.js.map +1 -1
  98. package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
  99. package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
  100. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
  101. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
  102. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
  103. package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
  104. package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
  105. package/dist/canvas/SceneCanvas/useCanvasCamera.js +38 -0
  106. package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
  107. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
  108. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
  109. package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
  110. package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
  111. package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
  112. package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
  113. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +29 -29
  114. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
  115. package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
  116. package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
  117. package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
  118. package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
  119. package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
  120. package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
  121. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +39 -37
  122. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
  123. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
  124. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
  125. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
  126. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
  127. package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
  128. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
  129. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
  130. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
  131. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +76 -80
  132. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  133. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
  134. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
  135. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
  136. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
  137. package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
  138. package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
  139. package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
  140. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
  141. package/dist/canvas/SceneCanvas/worldPointAt.js +9 -0
  142. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
  143. package/dist/canvas/SceneCanvas.js +303 -707
  144. package/dist/canvas/SceneCanvas.js.map +1 -1
  145. package/dist/canvas/SceneViewCanvas.js +41 -47
  146. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  147. package/dist/canvas/adapterDerivedPath.js +26 -0
  148. package/dist/canvas/adapterDerivedPath.js.map +1 -0
  149. package/dist/canvas/affordanceAt.js +11 -1
  150. package/dist/canvas/affordanceAt.js.map +1 -1
  151. package/dist/canvas/buildSceneLayer.js +81 -61
  152. package/dist/canvas/buildSceneLayer.js.map +1 -1
  153. package/dist/canvas/buildSceneTree.js.map +1 -1
  154. package/dist/canvas/canvasRenderer.js +40 -44
  155. package/dist/canvas/canvasRenderer.js.map +1 -1
  156. package/dist/canvas/colorOverrides.js.map +1 -1
  157. package/dist/canvas/defaultDrawOne.js +12 -12
  158. package/dist/canvas/defaultDrawOne.js.map +1 -1
  159. package/dist/canvas/deps/areaSelect.js +4 -4
  160. package/dist/canvas/deps/areaSelect.js.map +1 -1
  161. package/dist/canvas/deps/debug.js.map +1 -1
  162. package/dist/canvas/deps/editAnchors.js +49 -68
  163. package/dist/canvas/deps/editAnchors.js.map +1 -1
  164. package/dist/canvas/deps/geometryProjection.js.map +1 -1
  165. package/dist/canvas/deps/hitTestArea.js +31 -26
  166. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  167. package/dist/canvas/deps/insert.js +65 -54
  168. package/dist/canvas/deps/insert.js.map +1 -1
  169. package/dist/canvas/deps/lassoSelect.js +5 -5
  170. package/dist/canvas/deps/lassoSelect.js.map +1 -1
  171. package/dist/canvas/deps/poseDescriptor.js +1 -1
  172. package/dist/canvas/deps/poseDescriptor.js.map +1 -1
  173. package/dist/canvas/deps/resizePolicy.js.map +1 -1
  174. package/dist/canvas/deps/slice.js +44 -45
  175. package/dist/canvas/deps/slice.js.map +1 -1
  176. package/dist/canvas/deps/textEdit.js +8 -8
  177. package/dist/canvas/deps/textEdit.js.map +1 -1
  178. package/dist/canvas/deps/view.js.map +1 -1
  179. package/dist/canvas/derivedPath.js +43 -41
  180. package/dist/canvas/derivedPath.js.map +1 -1
  181. package/dist/canvas/drawEnvelope.js +8 -4
  182. package/dist/canvas/drawEnvelope.js.map +1 -1
  183. package/dist/canvas/getNodeAtPoint.js +2 -6
  184. package/dist/canvas/getNodeAtPoint.js.map +1 -1
  185. package/dist/canvas/hud.module.js.map +1 -1
  186. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  187. package/dist/canvas/layerOrder.js.map +1 -1
  188. package/dist/canvas/layerSlots.js +6 -1
  189. package/dist/canvas/layerSlots.js.map +1 -1
  190. package/dist/canvas/nodeShapes/derivedPainter.js +12 -12
  191. package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
  192. package/dist/canvas/nodeShapes/imagePainter.js +10 -10
  193. package/dist/canvas/nodeShapes/imagePainter.js.map +1 -1
  194. package/dist/canvas/nodeShapes/memo.js.map +1 -1
  195. package/dist/canvas/nodeShapes/nodePaint.js +34 -23
  196. package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
  197. package/dist/canvas/nodeShapes/pathPainter.js +23 -22
  198. package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
  199. package/dist/canvas/nodeShapes/poseBox.js +6 -6
  200. package/dist/canvas/nodeShapes/poseBox.js.map +1 -1
  201. package/dist/canvas/nodeShapes/rectFallbackPainter.js +8 -8
  202. package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
  203. package/dist/canvas/nodeShapes/shapePainter.js +16 -16
  204. package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
  205. package/dist/canvas/nodeShapes/textPainter.js +1 -1
  206. package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
  207. package/dist/canvas/overlayRoleStrokes.js.map +1 -1
  208. package/dist/canvas/paintCull.js +6 -8
  209. package/dist/canvas/paintCull.js.map +1 -1
  210. package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
  211. package/dist/canvas/paintedCursorLayer.js.map +1 -0
  212. package/dist/canvas/pickWalk.js +52 -50
  213. package/dist/canvas/pickWalk.js.map +1 -1
  214. package/dist/canvas/planeClips.js +18 -19
  215. package/dist/canvas/planeClips.js.map +1 -1
  216. package/dist/canvas/poseCascade.js +41 -0
  217. package/dist/canvas/poseCascade.js.map +1 -0
  218. package/dist/canvas/poseRotation.js +1 -3
  219. package/dist/canvas/poseRotation.js.map +1 -1
  220. package/dist/canvas/rasterReadback.js +22 -0
  221. package/dist/canvas/rasterReadback.js.map +1 -0
  222. package/dist/canvas/renderDebugSnapshot.js +12 -12
  223. package/dist/canvas/renderDebugSnapshot.js.map +1 -1
  224. package/dist/canvas/renderNeeds.js +3 -3
  225. package/dist/canvas/renderNeeds.js.map +1 -1
  226. package/dist/canvas/renderSceneToPixels.js +64 -83
  227. package/dist/canvas/renderSceneToPixels.js.map +1 -1
  228. package/dist/canvas/sceneAdapter.js +68 -132
  229. package/dist/canvas/sceneAdapter.js.map +1 -1
  230. package/dist/canvas/sceneClipboard.js +1 -1
  231. package/dist/canvas/sceneClipboard.js.map +1 -1
  232. package/dist/canvas/sceneLayerPaint.js +4 -4
  233. package/dist/canvas/sceneLayerPaint.js.map +1 -1
  234. package/dist/canvas/sceneSlotWiring.js +4 -4
  235. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  236. package/dist/canvas/sceneViewRender.js +36 -35
  237. package/dist/canvas/sceneViewRender.js.map +1 -1
  238. package/dist/canvas/slopsDebugLayer.js +4 -4
  239. package/dist/canvas/slopsDebugLayer.js.map +1 -1
  240. package/dist/canvas/surface.module.js +6 -0
  241. package/dist/canvas/surface.module.js.map +1 -0
  242. package/dist/canvas/surfaceBox.js +16 -0
  243. package/dist/canvas/surfaceBox.js.map +1 -0
  244. package/dist/canvas/useCanvasRenderer.js +23 -11
  245. package/dist/canvas/useCanvasRenderer.js.map +1 -1
  246. package/dist/canvas/useCanvasSurface.js +31 -0
  247. package/dist/canvas/useCanvasSurface.js.map +1 -0
  248. package/dist/canvas/useCanvasView.js +46 -37
  249. package/dist/canvas/useCanvasView.js.map +1 -1
  250. package/dist/canvas/useFrameLoop.js +11 -12
  251. package/dist/canvas/useFrameLoop.js.map +1 -1
  252. package/dist/canvas/useHostAnchor.js +35 -33
  253. package/dist/canvas/useHostAnchor.js.map +1 -1
  254. package/dist/canvas/useLateContentRedraw.js +8 -8
  255. package/dist/canvas/useLateContentRedraw.js.map +1 -1
  256. package/dist/canvas/useSceneLayerList.js +4 -14
  257. package/dist/canvas/useSceneLayerList.js.map +1 -1
  258. package/dist/canvas/useSurfaceInput.js +42 -0
  259. package/dist/canvas/useSurfaceInput.js.map +1 -0
  260. package/dist/canvas/useToolCursor.js +29 -0
  261. package/dist/canvas/useToolCursor.js.map +1 -0
  262. package/dist/canvas/useViewHelpers.js +46 -85
  263. package/dist/canvas/useViewHelpers.js.map +1 -1
  264. package/dist/canvas/viewInputs.js.map +1 -1
  265. package/dist/canvas/viewRegistry.js +25 -27
  266. package/dist/canvas/viewRegistry.js.map +1 -1
  267. package/dist/canvas/watchElementMove.js +43 -0
  268. package/dist/canvas/watchElementMove.js.map +1 -0
  269. package/dist/canvas/wrapNodeOutput.js.map +1 -1
  270. package/dist/clipboard.d.ts +7 -14
  271. package/dist/{types-B4iJRHC3.d.ts → clone-2a5hVbBd.d.ts} +122 -77
  272. package/dist/clone.d.ts +4 -8
  273. package/dist/clone.js +0 -2
  274. package/dist/core/device/targets.js.map +1 -1
  275. package/dist/core/device/useDeviceProfile.js +13 -13
  276. package/dist/core/device/useDeviceProfile.js.map +1 -1
  277. package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
  278. package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
  279. package/dist/core/geometry/pathPoseDescriptor.js +88 -0
  280. package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
  281. package/dist/core/geometry/poseDescriptor.js +61 -14
  282. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  283. package/dist/core/geometry/regionHit.js +35 -37
  284. package/dist/core/geometry/regionHit.js.map +1 -1
  285. package/dist/core/geometry/targetFrame.js +94 -0
  286. package/dist/core/geometry/targetFrame.js.map +1 -0
  287. package/dist/core/geometry/unionBounds.js +4 -5
  288. package/dist/core/geometry/unionBounds.js.map +1 -1
  289. package/dist/core/layers/backgroundFill.js +31 -0
  290. package/dist/core/layers/backgroundFill.js.map +1 -0
  291. package/dist/{features/groups → core/layers}/children.js +1 -1
  292. package/dist/core/layers/children.js.map +1 -0
  293. package/dist/{features/focus → core/layers}/gateLayer.js +2 -2
  294. package/dist/core/layers/gateLayer.js.map +1 -0
  295. package/dist/core/layers/layerGroup.js +40 -0
  296. package/dist/core/layers/layerGroup.js.map +1 -0
  297. package/dist/core/layers/render.js +50 -76
  298. package/dist/core/layers/render.js.map +1 -1
  299. package/dist/core/ops/createHistory.js +9 -9
  300. package/dist/core/ops/createHistory.js.map +1 -1
  301. package/dist/core/ops/delete.js.map +1 -1
  302. package/dist/core/paint/meshKind.js +16 -0
  303. package/dist/core/paint/meshKind.js.map +1 -0
  304. package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +103 -92
  305. package/dist/core/paint/meshKindLazy.js.map +1 -0
  306. package/dist/core/paint/paintKindEntry.js +8 -0
  307. package/dist/core/paint/paintKindEntry.js.map +1 -0
  308. package/dist/core/paint/paintKinds.js +144 -0
  309. package/dist/core/paint/paintKinds.js.map +1 -0
  310. package/dist/core/paint/registerMesh.js +7 -0
  311. package/dist/core/paint/registerMesh.js.map +1 -0
  312. package/dist/core/scene/NodeProperties.js.map +1 -1
  313. package/dist/core/scene/NodeRouting.js.map +1 -1
  314. package/dist/core/scene/arrivalWindow.js +65 -64
  315. package/dist/core/scene/arrivalWindow.js.map +1 -1
  316. package/dist/core/scene/boundOps.js +40 -0
  317. package/dist/core/scene/boundOps.js.map +1 -0
  318. package/dist/core/scene/composeFrame.js +9 -6
  319. package/dist/core/scene/composeFrame.js.map +1 -1
  320. package/dist/{features/groups → core/scene}/composePose.js +18 -18
  321. package/dist/core/scene/composePose.js.map +1 -0
  322. package/dist/core/scene/depMemo.js +31 -6
  323. package/dist/core/scene/depMemo.js.map +1 -1
  324. package/dist/core/scene/derivedPath.js +19 -20
  325. package/dist/core/scene/derivedPath.js.map +1 -1
  326. package/dist/core/scene/editMode.js +26 -0
  327. package/dist/core/scene/editMode.js.map +1 -0
  328. package/dist/core/scene/effectivePose.js +38 -39
  329. package/dist/core/scene/effectivePose.js.map +1 -1
  330. package/dist/core/scene/fieldEdits.js +98 -0
  331. package/dist/core/scene/fieldEdits.js.map +1 -0
  332. package/dist/core/scene/historyFacade.js +116 -70
  333. package/dist/core/scene/historyFacade.js.map +1 -1
  334. package/dist/core/scene/historyForm.js +6 -0
  335. package/dist/core/scene/historyForm.js.map +1 -0
  336. package/dist/core/scene/kitOps.js +83 -71
  337. package/dist/core/scene/kitOps.js.map +1 -1
  338. package/dist/core/scene/kitRegistry.js.map +1 -1
  339. package/dist/core/scene/layerStack.js +105 -12
  340. package/dist/core/scene/layerStack.js.map +1 -1
  341. package/dist/core/scene/layoutPass.js +58 -59
  342. package/dist/core/scene/layoutPass.js.map +1 -1
  343. package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
  344. package/dist/core/scene/nestedHit.js.map +1 -0
  345. package/dist/core/scene/nodeFnFields.js +9 -9
  346. package/dist/core/scene/nodeFnFields.js.map +1 -1
  347. package/dist/core/scene/nodeMemo.js.map +1 -1
  348. package/dist/core/scene/nodeStore.js +72 -71
  349. package/dist/core/scene/nodeStore.js.map +1 -1
  350. package/dist/core/scene/notifier.js +37 -0
  351. package/dist/core/scene/notifier.js.map +1 -0
  352. package/dist/core/scene/opTable.js +50 -0
  353. package/dist/core/scene/opTable.js.map +1 -0
  354. package/dist/core/scene/outerOps.js +66 -0
  355. package/dist/core/scene/outerOps.js.map +1 -0
  356. package/dist/core/scene/poseHold.js +39 -0
  357. package/dist/core/scene/poseHold.js.map +1 -0
  358. package/dist/core/scene/poseOverrides.js +44 -36
  359. package/dist/core/scene/poseOverrides.js.map +1 -1
  360. package/dist/core/scene/poseSnapshot.js.map +1 -1
  361. package/dist/core/scene/reconcileSpecs.js +3 -2
  362. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  363. package/dist/core/scene/recorder.js +86 -0
  364. package/dist/core/scene/recorder.js.map +1 -0
  365. package/dist/core/scene/renderOrder.js.map +1 -1
  366. package/dist/core/scene/scene.js +81 -690
  367. package/dist/core/scene/scene.js.map +1 -1
  368. package/dist/core/scene/sceneEdits.js +58 -0
  369. package/dist/core/scene/sceneEdits.js.map +1 -0
  370. package/dist/core/scene/sceneMutators.js +49 -0
  371. package/dist/core/scene/sceneMutators.js.map +1 -0
  372. package/dist/core/scene/scenePoseAdapter.js +16 -0
  373. package/dist/core/scene/scenePoseAdapter.js.map +1 -0
  374. package/dist/core/scene/sceneRecording.js +90 -0
  375. package/dist/core/scene/sceneRecording.js.map +1 -0
  376. package/dist/core/scene/sceneSelection.js +28 -0
  377. package/dist/core/scene/sceneSelection.js.map +1 -0
  378. package/dist/core/scene/sceneState.js +49 -0
  379. package/dist/core/scene/sceneState.js.map +1 -0
  380. package/dist/core/scene/serialization.js +8 -5
  381. package/dist/core/scene/serialization.js.map +1 -1
  382. package/dist/core/scene/staleReplay.js +51 -0
  383. package/dist/core/scene/staleReplay.js.map +1 -0
  384. package/dist/core/scene/statedFields.js +9 -0
  385. package/dist/core/scene/statedFields.js.map +1 -0
  386. package/dist/core/scene/treeEdits.js +127 -0
  387. package/dist/core/scene/treeEdits.js.map +1 -0
  388. package/dist/core/scene/treeReads.js +26 -0
  389. package/dist/core/scene/treeReads.js.map +1 -0
  390. package/dist/core/scene/types.js.map +1 -1
  391. package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
  392. package/dist/core/scene/unionOfChildren.js.map +1 -0
  393. package/dist/core/scene/unitScopes.js +13 -0
  394. package/dist/core/scene/unitScopes.js.map +1 -0
  395. package/dist/core/scene/useScene.js.map +1 -1
  396. package/dist/core/selection/readOnlySelection.js +32 -0
  397. package/dist/core/selection/readOnlySelection.js.map +1 -0
  398. package/dist/core/selection/usePublishSceneSelection.js +26 -0
  399. package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
  400. package/dist/core/selection/useSelection.js +34 -25
  401. package/dist/core/selection/useSelection.js.map +1 -1
  402. package/dist/core/shapeKinds.js.map +1 -1
  403. package/dist/core/stylus/stylus.js.map +1 -1
  404. package/dist/core/stylus/usePointerStylus.js.map +1 -1
  405. package/dist/core/usePaintKinds.js +1 -1
  406. package/dist/core/usePaintKinds.js.map +1 -1
  407. package/dist/core/viewport/clientToWorld.js.map +1 -1
  408. package/dist/core/viewport/fitViewToBounds.js.map +1 -1
  409. package/dist/core/viewport/parallax.js.map +1 -1
  410. package/dist/core/viewport/screenSlop.js +11 -11
  411. package/dist/core/viewport/screenSlop.js.map +1 -1
  412. package/dist/core/viewport/useCanvasSize.js.map +1 -1
  413. package/dist/core/viewport/useDecayLoop.js +8 -8
  414. package/dist/core/viewport/useDecayLoop.js.map +1 -1
  415. package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
  416. package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
  417. package/dist/core/viewport/useViewAnimation.js +102 -43
  418. package/dist/core/viewport/useViewAnimation.js.map +1 -1
  419. package/dist/core/viewport/view.js +7 -7
  420. package/dist/core/viewport/view.js.map +1 -1
  421. package/dist/core/viewport/wheelHandler.js.map +1 -1
  422. package/dist/{cornerHandles-CtCb8a3G.d.ts → cornerHandles-BEshc4z3.d.ts} +11 -24
  423. package/dist/debug/createDebugOverlayLayer.js +100 -100
  424. package/dist/debug/createDebugOverlayLayer.js.map +1 -1
  425. package/dist/debug/createDebugSink.js.map +1 -1
  426. package/dist/debug/frameStats.js.map +1 -1
  427. package/dist/debug/useDebugSink.js +52 -0
  428. package/dist/debug/useDebugSink.js.map +1 -0
  429. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
  430. package/dist/features/chrome-caps/conditions.js.map +1 -1
  431. package/dist/features/chrome-caps/defaults.js.map +1 -1
  432. package/dist/features/chrome-caps/resolve.js.map +1 -1
  433. package/dist/features/chrome-caps/useChromeCaps.js +54 -0
  434. package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
  435. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
  436. package/dist/features/ingestion/contentHandlers.js +25 -19
  437. package/dist/features/ingestion/contentHandlers.js.map +1 -1
  438. package/dist/features/ingestion/imageHandler.js +21 -24
  439. package/dist/features/ingestion/imageHandler.js.map +1 -1
  440. package/dist/features/ingestion/openFilePicker.js.map +1 -1
  441. package/dist/features/ingestion/placement.js +16 -0
  442. package/dist/features/ingestion/placement.js.map +1 -0
  443. package/dist/features/ingestion/svgHandler.js +5 -0
  444. package/dist/features/ingestion/svgHandler.js.map +1 -1
  445. package/dist/features/ingestion/textHandler.js +28 -0
  446. package/dist/features/ingestion/textHandler.js.map +1 -0
  447. package/dist/features/ingestion/useCanvasIngestion.js +48 -0
  448. package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
  449. package/dist/features/ingestion/weaselJsonHandler.js +5 -0
  450. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
  451. package/dist/features/longPress/longPressFeedback.js.map +1 -1
  452. package/dist/features/modes/modeLayers.js +7 -7
  453. package/dist/features/modes/modeLayers.js.map +1 -1
  454. package/dist/features/paths/editablePath.js +47 -0
  455. package/dist/features/paths/editablePath.js.map +1 -0
  456. package/dist/features/paths/index.js +9 -16
  457. package/dist/features/paths/pathEditState.js +41 -0
  458. package/dist/features/paths/pathEditState.js.map +1 -0
  459. package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
  460. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
  461. package/dist/features/paths/pathLayer.js +3 -2
  462. package/dist/features/paths/pathLayer.js.map +1 -1
  463. package/dist/features/paths/penPreviewLayer.js +86 -88
  464. package/dist/features/paths/penPreviewLayer.js.map +1 -1
  465. package/dist/features/paths/usePathEdit.js +34 -0
  466. package/dist/features/paths/usePathEdit.js.map +1 -0
  467. package/dist/features/poseRun/usePoseRun.js +42 -55
  468. package/dist/features/poseRun/usePoseRun.js.map +1 -1
  469. package/dist/features/selection/overlay.js +170 -178
  470. package/dist/features/selection/overlay.js.map +1 -1
  471. package/dist/features/text/index.js +6 -0
  472. package/dist/features/text/textLayer.js +1 -1
  473. package/dist/features/text/textLayer.js.map +1 -1
  474. package/dist/features/text/useSceneTextEdit.js +95 -82
  475. package/dist/features/text/useSceneTextEdit.js.map +1 -1
  476. package/dist/features/viewports/viewportLayer.js +25 -36
  477. package/dist/features/viewports/viewportLayer.js.map +1 -1
  478. package/dist/index.d.ts +4507 -8459
  479. package/dist/index.js +275 -320
  480. package/dist/input/keyState.js +14 -14
  481. package/dist/interactions/actions/actionShortcuts.js.map +1 -1
  482. package/dist/interactions/actions/{defaults/align.js → align/action.js} +15 -16
  483. package/dist/interactions/actions/align/action.js.map +1 -0
  484. package/dist/interactions/actions/align/align.js +23 -23
  485. package/dist/interactions/actions/align/align.js.map +1 -1
  486. package/dist/interactions/actions/booleans/action.js +65 -0
  487. package/dist/interactions/actions/booleans/action.js.map +1 -0
  488. package/dist/interactions/actions/booleans/booleans.js +69 -78
  489. package/dist/interactions/actions/booleans/booleans.js.map +1 -1
  490. package/dist/interactions/actions/booleans/operands.js +40 -0
  491. package/dist/interactions/actions/booleans/operands.js.map +1 -0
  492. package/dist/interactions/actions/booleans/pieces.js +45 -0
  493. package/dist/interactions/actions/booleans/pieces.js.map +1 -0
  494. package/dist/interactions/actions/booleans/placement.js +24 -0
  495. package/dist/interactions/actions/booleans/placement.js.map +1 -0
  496. package/dist/interactions/actions/booleans/useBooleans.js +11 -9
  497. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
  498. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
  499. package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +19 -19
  500. package/dist/interactions/actions/clipboard/action.js.map +1 -0
  501. package/dist/interactions/actions/clipboard/clipboardOps.js +15 -15
  502. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
  503. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
  504. package/dist/interactions/actions/clone/action.js +98 -0
  505. package/dist/interactions/actions/clone/action.js.map +1 -0
  506. package/dist/interactions/actions/clone/behaviors.js +52 -0
  507. package/dist/interactions/actions/clone/behaviors.js.map +1 -0
  508. package/dist/interactions/actions/defaultCommitAdapter.js +10 -37
  509. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
  510. package/dist/interactions/actions/defaults/anchorEditing.js +41 -43
  511. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  512. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
  513. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
  514. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
  515. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
  516. package/dist/interactions/actions/defaults/delete.js.map +1 -1
  517. package/dist/interactions/actions/defaults/duplicate.js +19 -19
  518. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  519. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
  520. package/dist/interactions/actions/defaults/group.js +35 -40
  521. package/dist/interactions/actions/defaults/group.js.map +1 -1
  522. package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
  523. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
  524. package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
  525. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
  526. package/dist/interactions/actions/defaults/ingest.js +19 -15
  527. package/dist/interactions/actions/defaults/ingest.js.map +1 -1
  528. package/dist/interactions/actions/defaults/insertPathAnchor.js +14 -15
  529. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  530. package/dist/interactions/actions/defaults/nudge.js +30 -31
  531. package/dist/interactions/actions/defaults/nudge.js.map +1 -1
  532. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
  533. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
  534. package/dist/interactions/actions/defaults/setFill.js +9 -3
  535. package/dist/interactions/actions/defaults/setFill.js.map +1 -1
  536. package/dist/interactions/actions/defaults/setFillOpacity.js +4 -1
  537. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
  538. package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
  539. package/dist/interactions/actions/defaults/sliceOps.js +20 -22
  540. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
  541. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
  542. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
  543. package/dist/interactions/actions/defaults/viewportDragPan.js +1 -1
  544. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
  545. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
  546. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
  547. package/dist/interactions/actions/{defaults/distribute.js → distribute/action.js} +18 -19
  548. package/dist/interactions/actions/distribute/action.js.map +1 -0
  549. package/dist/interactions/actions/distribute/distribute.js +11 -11
  550. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  551. package/dist/interactions/actions/{defaults/editAnchors.js → edit-anchors/action.js} +19 -21
  552. package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
  553. package/dist/interactions/actions/edit-anchors/geometry.js +2 -4
  554. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
  555. package/dist/interactions/actions/flip/action.js +124 -0
  556. package/dist/interactions/actions/flip/action.js.map +1 -0
  557. package/dist/interactions/actions/flip/helpers.js +1 -1
  558. package/dist/interactions/actions/flip/helpers.js.map +1 -1
  559. package/dist/interactions/actions/gestureFrames.js +18 -0
  560. package/dist/interactions/actions/gestureFrames.js.map +1 -0
  561. package/dist/interactions/actions/gestureLifecycle.js +47 -20
  562. package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
  563. package/dist/interactions/actions/insert/action.js +72 -0
  564. package/dist/interactions/actions/insert/action.js.map +1 -0
  565. package/dist/interactions/actions/insert/commit.js +28 -0
  566. package/dist/interactions/actions/insert/commit.js.map +1 -0
  567. package/dist/interactions/actions/insert/extras.js +65 -0
  568. package/dist/interactions/actions/insert/extras.js.map +1 -0
  569. package/dist/interactions/actions/insert/frame.js +48 -0
  570. package/dist/interactions/actions/insert/frame.js.map +1 -0
  571. package/dist/interactions/actions/insert/geometry.js +35 -0
  572. package/dist/interactions/actions/insert/geometry.js.map +1 -0
  573. package/dist/interactions/actions/insert/rotateAction.js +21 -0
  574. package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
  575. package/dist/interactions/actions/insert/session.js +59 -0
  576. package/dist/interactions/actions/insert/session.js.map +1 -0
  577. package/dist/interactions/actions/insert/shape.js +34 -0
  578. package/dist/interactions/actions/insert/shape.js.map +1 -0
  579. package/dist/interactions/actions/lasso-select/action.js +143 -0
  580. package/dist/interactions/actions/lasso-select/action.js.map +1 -0
  581. package/dist/interactions/actions/move/action.js +87 -0
  582. package/dist/interactions/actions/move/action.js.map +1 -0
  583. package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
  584. package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
  585. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
  586. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
  587. package/dist/interactions/actions/move/behaviors/snapToContainer.js +24 -23
  588. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  589. package/dist/interactions/actions/move/capture.js +99 -0
  590. package/dist/interactions/actions/move/capture.js.map +1 -0
  591. package/dist/interactions/actions/move/commit/index.js +41 -0
  592. package/dist/interactions/actions/move/commit/index.js.map +1 -0
  593. package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
  594. package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
  595. package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
  596. package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
  597. package/dist/interactions/actions/move/commit/rebase.js +18 -0
  598. package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
  599. package/dist/interactions/actions/move/commit/reparent.js +65 -0
  600. package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
  601. package/dist/interactions/actions/move/delta.js +51 -0
  602. package/dist/interactions/actions/move/delta.js.map +1 -0
  603. package/dist/interactions/actions/move/frame.js +59 -0
  604. package/dist/interactions/actions/move/frame.js.map +1 -0
  605. package/dist/interactions/actions/move/gestureAdapter.js +15 -40
  606. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
  607. package/dist/interactions/actions/move/landedDescendants.js +8 -8
  608. package/dist/interactions/actions/move/layout/container.js +94 -0
  609. package/dist/interactions/actions/move/layout/container.js.map +1 -0
  610. package/dist/interactions/actions/move/layout/dragged.js +58 -0
  611. package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
  612. package/dist/interactions/actions/move/layout/dropPass.js +122 -0
  613. package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
  614. package/dist/interactions/actions/move/layout/exits.js +38 -0
  615. package/dist/interactions/actions/move/layout/exits.js.map +1 -0
  616. package/dist/interactions/actions/move/layout/glide.js +48 -0
  617. package/dist/interactions/actions/move/layout/glide.js.map +1 -0
  618. package/dist/interactions/actions/move/session.js +63 -0
  619. package/dist/interactions/actions/move/session.js.map +1 -0
  620. package/dist/interactions/actions/move/translate.js +61 -0
  621. package/dist/interactions/actions/move/translate.js.map +1 -0
  622. package/dist/interactions/actions/outlines/createOutlines.js +17 -64
  623. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  624. package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
  625. package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
  626. package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
  627. package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
  628. package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
  629. package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
  630. package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
  631. package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
  632. package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
  633. package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
  634. package/dist/interactions/actions/planeInput.js.map +1 -1
  635. package/dist/interactions/actions/pointerState.js +12 -0
  636. package/dist/interactions/actions/pointerState.js.map +1 -0
  637. package/dist/interactions/actions/poseDescriptorDep.js +1 -1
  638. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
  639. package/dist/interactions/actions/poseFrame.js +26 -26
  640. package/dist/interactions/actions/poseFrame.js.map +1 -1
  641. package/dist/interactions/actions/resize/action.js +55 -0
  642. package/dist/interactions/actions/resize/action.js.map +1 -0
  643. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
  644. package/dist/interactions/actions/resize/boxFrame.js +16 -0
  645. package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
  646. package/dist/interactions/actions/resize/capture.js +85 -0
  647. package/dist/interactions/actions/resize/capture.js.map +1 -0
  648. package/dist/interactions/actions/resize/commit.js +69 -0
  649. package/dist/interactions/actions/resize/commit.js.map +1 -0
  650. package/dist/interactions/actions/resize/frame.js +74 -0
  651. package/dist/interactions/actions/resize/frame.js.map +1 -0
  652. package/dist/interactions/actions/resize/pointSnap.js +111 -0
  653. package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
  654. package/dist/interactions/actions/resize/ruleBounds.js +9 -0
  655. package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
  656. package/dist/interactions/actions/resize/session.js +49 -0
  657. package/dist/interactions/actions/resize/session.js.map +1 -0
  658. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  659. package/dist/interactions/actions/resolvePreviews.js.map +1 -1
  660. package/dist/interactions/actions/rotate/action.js +56 -0
  661. package/dist/interactions/actions/rotate/action.js.map +1 -0
  662. package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
  663. package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
  664. package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
  665. package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
  666. package/dist/interactions/actions/rotate/commit.js +40 -0
  667. package/dist/interactions/actions/rotate/commit.js.map +1 -0
  668. package/dist/interactions/actions/rotate/frame.js +65 -0
  669. package/dist/interactions/actions/rotate/frame.js.map +1 -0
  670. package/dist/interactions/actions/rotate/handle.js +12 -12
  671. package/dist/interactions/actions/rotate/handle.js.map +1 -1
  672. package/dist/interactions/actions/rotate/session.js +92 -0
  673. package/dist/interactions/actions/rotate/session.js.map +1 -0
  674. package/dist/interactions/actions/spatialReference.js.map +1 -1
  675. package/dist/interactions/actions/useStandardActions.js +77 -72
  676. package/dist/interactions/actions/useStandardActions.js.map +1 -1
  677. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +61 -42
  678. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
  679. package/dist/interactions/gestures/shared/originProjection.js +1 -1
  680. package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
  681. package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
  682. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
  683. package/dist/interactions/gestures/shared/snap.js.map +1 -1
  684. package/dist/layout/arrivals.js +20 -23
  685. package/dist/layout/arrivals.js.map +1 -1
  686. package/dist/math-CYUjoyyU.d.ts +33 -0
  687. package/dist/math.d.ts +5 -2
  688. package/dist/math.js +6 -6
  689. package/dist/mesh.d.ts +4 -268
  690. package/dist/mesh.js +3 -7
  691. package/dist/move.d.ts +6 -4
  692. package/dist/{originProjection-gHnOup4e.d.ts → originProjection-PPT88jZv.d.ts} +1 -1
  693. package/dist/patterns-builtin.d.ts +1 -118
  694. package/dist/patterns-builtin.js +2 -3
  695. package/dist/poseDescriptor-Bqk-11Rl.d.ts +73 -0
  696. package/dist/renderer.d.ts +1 -92
  697. package/dist/renderer.js +2 -19
  698. package/dist/resize.d.ts +11 -22
  699. package/dist/resize.js +1 -1
  700. package/dist/style.css +1 -1
  701. package/dist/test-hook/install.js.map +1 -1
  702. package/dist/test-hook/useTestHook.js +22 -0
  703. package/dist/test-hook/useTestHook.js.map +1 -0
  704. package/dist/test-seams-D0pyV3pR.d.ts +149 -0
  705. package/dist/test-seams.d.ts +4 -4
  706. package/dist/test-seams.js +2 -2
  707. package/dist/tools/builtin/bone/boneActions.js +130 -0
  708. package/dist/tools/builtin/bone/boneActions.js.map +1 -0
  709. package/dist/tools/builtin/bone/boneOverlay.js +58 -0
  710. package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
  711. package/dist/tools/builtin/bone/placedRig.js +24 -0
  712. package/dist/tools/builtin/bone/placedRig.js.map +1 -0
  713. package/dist/tools/builtin/bone/rigEditState.js +21 -0
  714. package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
  715. package/dist/tools/builtin/bone/useBoneTool.js +98 -0
  716. package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
  717. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
  718. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
  719. package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
  720. package/dist/tools/builtin/image/useImageTool.js.map +1 -1
  721. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
  722. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  723. package/dist/tools/builtin/pen/usePenTool.js +161 -163
  724. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  725. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
  726. package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
  727. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  728. package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
  729. package/dist/tools/builtin/select/adapterPointQuery.js +36 -0
  730. package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
  731. package/dist/tools/builtin/select/selectionContributions.js +4 -4
  732. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  733. package/dist/tools/builtin/select/useSelectTool.js +43 -71
  734. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  735. package/dist/tools/builtin/shared/pointerFollower.js.map +1 -1
  736. package/dist/tools/builtin/slice/useSliceTool.js +67 -72
  737. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  738. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  739. package/dist/tools/builtin/text/useTextTool.js +8 -0
  740. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  741. package/dist/tools/builtin/weight/useWeightTool.js +77 -0
  742. package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
  743. package/dist/tools/builtin/weight/weightActions.js +112 -0
  744. package/dist/tools/builtin/weight/weightActions.js.map +1 -0
  745. package/dist/tools/builtin/weight/weightOverlay.js +61 -0
  746. package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
  747. package/dist/tools/overlayBinding.js.map +1 -1
  748. package/dist/tools/useKeybindings.js +20 -14
  749. package/dist/tools/useKeybindings.js.map +1 -1
  750. package/dist/{types-k-5Oqh-U.d.ts → types-CIKDwlsP.d.ts} +84 -164
  751. package/dist/util/paint.js +1 -1
  752. package/dist/util/paint.js.map +1 -1
  753. package/dist/version.js +1 -1
  754. package/package.json +26 -21
  755. package/dist/animation/colorHelpers.js +0 -135
  756. package/dist/animation/colorHelpers.js.map +0 -1
  757. package/dist/animation/colorRegistry.js +0 -37
  758. package/dist/animation/colorRegistry.js.map +0 -1
  759. package/dist/animation/engine/axes.js +0 -36
  760. package/dist/animation/engine/axes.js.map +0 -1
  761. package/dist/animation/engine/codec.js +0 -170
  762. package/dist/animation/engine/codec.js.map +0 -1
  763. package/dist/animation/engine/integrator.js +0 -12
  764. package/dist/animation/engine/integrator.js.map +0 -1
  765. package/dist/animation/loop.js +0 -60
  766. package/dist/animation/loop.js.map +0 -1
  767. package/dist/animation/observe.js +0 -23
  768. package/dist/animation/observe.js.map +0 -1
  769. package/dist/animation/rig/blendPoses.js +0 -43
  770. package/dist/animation/rig/blendPoses.js.map +0 -1
  771. package/dist/animation/rig/mirrorPose.js +0 -19
  772. package/dist/animation/rig/mirrorPose.js.map +0 -1
  773. package/dist/animation/rig/resolveSkeleton.js +0 -33
  774. package/dist/animation/rig/resolveSkeleton.js.map +0 -1
  775. package/dist/animation/rig/solveIk.js +0 -103
  776. package/dist/animation/rig/solveIk.js.map +0 -1
  777. package/dist/animation/rig/types.js +0 -12
  778. package/dist/animation/rig/types.js.map +0 -1
  779. package/dist/animation/slew.js +0 -27
  780. package/dist/animation/slew.js.map +0 -1
  781. package/dist/animation/stagger.js +0 -146
  782. package/dist/animation/stagger.js.map +0 -1
  783. package/dist/animation/timeline/booking.js +0 -114
  784. package/dist/animation/timeline/booking.js.map +0 -1
  785. package/dist/animation/timeline/createTimeline.js +0 -125
  786. package/dist/animation/timeline/createTimeline.js.map +0 -1
  787. package/dist/animation/timeline/sampleTrack.js +0 -79
  788. package/dist/animation/timeline/sampleTrack.js.map +0 -1
  789. package/dist/animation/useAnimator.js +0 -388
  790. package/dist/animation/useAnimator.js.map +0 -1
  791. package/dist/autoPoseDescriptor-Ct7yqivU.d.ts +0 -108
  792. package/dist/builtins-DPcdghtB.d.ts +0 -1223
  793. package/dist/canvas/MinimapCanvas.js +0 -140
  794. package/dist/canvas/MinimapCanvas.js.map +0 -1
  795. package/dist/canvas/deps/poseComposition.js +0 -11
  796. package/dist/canvas/deps/poseComposition.js.map +0 -1
  797. package/dist/canvas/minimapMath.js +0 -82
  798. package/dist/canvas/minimapMath.js.map +0 -1
  799. package/dist/canvas/toolPreview.js +0 -39
  800. package/dist/canvas/toolPreview.js.map +0 -1
  801. package/dist/core/adapters/arrayAdapter.js +0 -94
  802. package/dist/core/adapters/arrayAdapter.js.map +0 -1
  803. package/dist/core/adapters/useArrayAdapter.js +0 -13
  804. package/dist/core/adapters/useArrayAdapter.js.map +0 -1
  805. package/dist/core/fillInPoseFrame.js +0 -102
  806. package/dist/core/fillInPoseFrame.js.map +0 -1
  807. package/dist/core/geometry/poseFrame.js +0 -44
  808. package/dist/core/geometry/poseFrame.js.map +0 -1
  809. package/dist/core/geometry/poseRotation.js +0 -58
  810. package/dist/core/geometry/poseRotation.js.map +0 -1
  811. package/dist/core/gradient.js +0 -136
  812. package/dist/core/gradient.js.map +0 -1
  813. package/dist/core/markerInset.js +0 -24
  814. package/dist/core/markerInset.js.map +0 -1
  815. package/dist/core/mixed.js +0 -6
  816. package/dist/core/mixed.js.map +0 -1
  817. package/dist/core/paintKinds.js +0 -156
  818. package/dist/core/paintKinds.js.map +0 -1
  819. package/dist/core/scene/pickability.js +0 -6
  820. package/dist/core/scene/pickability.js.map +0 -1
  821. package/dist/core/strokeMarkerShapes.js +0 -139
  822. package/dist/core/strokeMarkerShapes.js.map +0 -1
  823. package/dist/core/strokeMarkers.js +0 -28
  824. package/dist/core/strokeMarkers.js.map +0 -1
  825. package/dist/core/viewport/meanScale.js +0 -8
  826. package/dist/core/viewport/meanScale.js.map +0 -1
  827. package/dist/core/viewport/pxExtent.js +0 -42
  828. package/dist/core/viewport/pxExtent.js.map +0 -1
  829. package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
  830. package/dist/features/focus/gateLayer.js.map +0 -1
  831. package/dist/features/focus/useCanvasFocus.js +0 -29
  832. package/dist/features/focus/useCanvasFocus.js.map +0 -1
  833. package/dist/features/groups/children.js.map +0 -1
  834. package/dist/features/groups/composePose.js.map +0 -1
  835. package/dist/features/groups/nestedHit.js.map +0 -1
  836. package/dist/features/groups/unionOfChildren.js.map +0 -1
  837. package/dist/features/images/imageCache.js +0 -104
  838. package/dist/features/images/imageCache.js.map +0 -1
  839. package/dist/features/ingestion/index.js +0 -8
  840. package/dist/features/meshPaint/bake.js +0 -79
  841. package/dist/features/meshPaint/bake.js.map +0 -1
  842. package/dist/features/meshPaint/bakeCache.js +0 -59
  843. package/dist/features/meshPaint/bakeCache.js.map +0 -1
  844. package/dist/features/meshPaint/handles.js +0 -86
  845. package/dist/features/meshPaint/handles.js.map +0 -1
  846. package/dist/features/meshPaint/lazyKind.js.map +0 -1
  847. package/dist/features/meshPaint/meshPaint.js +0 -239
  848. package/dist/features/meshPaint/meshPaint.js.map +0 -1
  849. package/dist/features/meshPaint/meshShader.js +0 -6
  850. package/dist/features/meshPaint/meshShader.js.map +0 -1
  851. package/dist/features/meshPaint/register.js +0 -7
  852. package/dist/features/meshPaint/register.js.map +0 -1
  853. package/dist/features/meshPaint/surface.js +0 -110
  854. package/dist/features/meshPaint/surface.js.map +0 -1
  855. package/dist/features/minimap/actions.js +0 -53
  856. package/dist/features/minimap/actions.js.map +0 -1
  857. package/dist/features/minimap/createMinimapContribution.js +0 -96
  858. package/dist/features/minimap/createMinimapContribution.js.map +0 -1
  859. package/dist/features/minimap/layers.js +0 -85
  860. package/dist/features/minimap/layers.js.map +0 -1
  861. package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
  862. package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
  863. package/dist/features/parallax/createParallaxLayer.js +0 -26
  864. package/dist/features/parallax/createParallaxLayer.js.map +0 -1
  865. package/dist/features/parallax/createParallaxPlane.js +0 -22
  866. package/dist/features/parallax/createParallaxPlane.js.map +0 -1
  867. package/dist/features/paths/anchorEdits.js +0 -167
  868. package/dist/features/paths/anchorEdits.js.map +0 -1
  869. package/dist/features/paths/anchors.js +0 -159
  870. package/dist/features/paths/anchors.js.map +0 -1
  871. package/dist/features/paths/booleans.js +0 -2
  872. package/dist/features/paths/markerCommands.js +0 -149
  873. package/dist/features/paths/markerCommands.js.map +0 -1
  874. package/dist/features/paths/markerSites.js +0 -59
  875. package/dist/features/paths/markerSites.js.map +0 -1
  876. package/dist/features/paths/markers.js +0 -95
  877. package/dist/features/paths/markers.js.map +0 -1
  878. package/dist/features/paths/nearestAnchor.js +0 -36
  879. package/dist/features/paths/nearestAnchor.js.map +0 -1
  880. package/dist/features/paths/pathInWorld.js +0 -41
  881. package/dist/features/paths/pathInWorld.js.map +0 -1
  882. package/dist/features/paths/poseDescriptor.js +0 -39
  883. package/dist/features/paths/poseDescriptor.js.map +0 -1
  884. package/dist/features/paths/strokeToPath.js +0 -40
  885. package/dist/features/paths/strokeToPath.js.map +0 -1
  886. package/dist/features/paths/tessellate/dash.js +0 -52
  887. package/dist/features/paths/tessellate/dash.js.map +0 -1
  888. package/dist/features/paths/tessellate/insets.js +0 -32
  889. package/dist/features/paths/tessellate/insets.js.map +0 -1
  890. package/dist/features/paths/tessellate/metric.js +0 -72
  891. package/dist/features/paths/tessellate/metric.js.map +0 -1
  892. package/dist/features/paths/tessellate/stroke.js +0 -170
  893. package/dist/features/paths/tessellate/stroke.js.map +0 -1
  894. package/dist/features/paths/tessellate/vertexWidths.js +0 -32
  895. package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
  896. package/dist/features/patterns/commandPaint.js +0 -18
  897. package/dist/features/patterns/commandPaint.js.map +0 -1
  898. package/dist/features/patterns/index.js +0 -11
  899. package/dist/features/patterns/index.js.map +0 -1
  900. package/dist/features/patterns/patterns-builtin.js +0 -38
  901. package/dist/features/patterns/patterns-builtin.js.map +0 -1
  902. package/dist/features/patterns/rasterizeTile.js +0 -17
  903. package/dist/features/patterns/rasterizeTile.js.map +0 -1
  904. package/dist/features/patterns/resolveSpec.js +0 -65
  905. package/dist/features/patterns/resolveSpec.js.map +0 -1
  906. package/dist/features/patterns/tileGeometry.js +0 -158
  907. package/dist/features/patterns/tileGeometry.js.map +0 -1
  908. package/dist/features/pointer/PointerContext.js +0 -45
  909. package/dist/features/pointer/PointerContext.js.map +0 -1
  910. package/dist/features/selection/SelectionContext.js +0 -51
  911. package/dist/features/selection/SelectionContext.js.map +0 -1
  912. package/dist/features/simulation/createSimulation.js +0 -61
  913. package/dist/features/simulation/createSimulation.js.map +0 -1
  914. package/dist/features/simulation/types.js +0 -6
  915. package/dist/features/simulation/types.js.map +0 -1
  916. package/dist/features/simulation/useSimulation.js +0 -74
  917. package/dist/features/simulation/useSimulation.js.map +0 -1
  918. package/dist/features/text/domOffsets.js +0 -82
  919. package/dist/features/text/domOffsets.js.map +0 -1
  920. package/dist/features/text/domRuns.js +0 -230
  921. package/dist/features/text/domRuns.js.map +0 -1
  922. package/dist/features/text/fitTextPose.js +0 -38
  923. package/dist/features/text/fitTextPose.js.map +0 -1
  924. package/dist/features/text/hitTest.js +0 -48
  925. package/dist/features/text/hitTest.js.map +0 -1
  926. package/dist/features/text/isTextData.js +0 -8
  927. package/dist/features/text/isTextData.js.map +0 -1
  928. package/dist/features/text/overlayDirection.js +0 -15
  929. package/dist/features/text/overlayDirection.js.map +0 -1
  930. package/dist/features/text/renderLabel.js +0 -14
  931. package/dist/features/text/renderLabel.js.map +0 -1
  932. package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
  933. package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
  934. package/dist/features/text/runs/flagRange.js +0 -53
  935. package/dist/features/text/runs/flagRange.js.map +0 -1
  936. package/dist/features/text/runs/rangeStyle.js +0 -133
  937. package/dist/features/text/runs/rangeStyle.js.map +0 -1
  938. package/dist/features/text/textCommand.js +0 -60
  939. package/dist/features/text/textCommand.js.map +0 -1
  940. package/dist/features/text/textToPath.js +0 -181
  941. package/dist/features/text/textToPath.js.map +0 -1
  942. package/dist/features/text/useTextEdit.js +0 -491
  943. package/dist/features/text/useTextEdit.js.map +0 -1
  944. package/dist/features/tiling/createTiledLayer.js +0 -65
  945. package/dist/features/tiling/createTiledLayer.js.map +0 -1
  946. package/dist/features/tiling/tiledProject.js +0 -14
  947. package/dist/features/tiling/tiledProject.js.map +0 -1
  948. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
  949. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
  950. package/dist/interactions/actions/defaults/align.js.map +0 -1
  951. package/dist/interactions/actions/defaults/booleans.js +0 -52
  952. package/dist/interactions/actions/defaults/booleans.js.map +0 -1
  953. package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
  954. package/dist/interactions/actions/defaults/clone.js +0 -91
  955. package/dist/interactions/actions/defaults/clone.js.map +0 -1
  956. package/dist/interactions/actions/defaults/createOutlines.js +0 -47
  957. package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
  958. package/dist/interactions/actions/defaults/distribute.js.map +0 -1
  959. package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
  960. package/dist/interactions/actions/defaults/flip.js +0 -125
  961. package/dist/interactions/actions/defaults/flip.js.map +0 -1
  962. package/dist/interactions/actions/defaults/insert.js +0 -287
  963. package/dist/interactions/actions/defaults/insert.js.map +0 -1
  964. package/dist/interactions/actions/defaults/lassoSelect.js +0 -153
  965. package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
  966. package/dist/interactions/actions/defaults/move.js +0 -778
  967. package/dist/interactions/actions/defaults/move.js.map +0 -1
  968. package/dist/interactions/actions/defaults/resize.js +0 -341
  969. package/dist/interactions/actions/defaults/resize.js.map +0 -1
  970. package/dist/interactions/actions/defaults/rotate.js +0 -185
  971. package/dist/interactions/actions/defaults/rotate.js.map +0 -1
  972. package/dist/interactions/actions/previewOverrides.js +0 -25
  973. package/dist/interactions/actions/previewOverrides.js.map +0 -1
  974. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
  975. package/dist/math-J-ACHyEg.d.ts +0 -159
  976. package/dist/registerProgram-T9S_PfAX.d.ts +0 -208
  977. package/dist/renderer/DrawCommand.js +0 -6
  978. package/dist/renderer/DrawCommand.js.map +0 -1
  979. package/dist/renderer/WeaselRenderer.js +0 -333
  980. package/dist/renderer/WeaselRenderer.js.map +0 -1
  981. package/dist/renderer/batchClip.js +0 -46
  982. package/dist/renderer/batchClip.js.map +0 -1
  983. package/dist/renderer/cache/GLImageCache.js +0 -74
  984. package/dist/renderer/cache/GLImageCache.js.map +0 -1
  985. package/dist/renderer/cache/GLMeshCache.js +0 -102
  986. package/dist/renderer/cache/GLMeshCache.js.map +0 -1
  987. package/dist/renderer/cache/GLTextureCache.js +0 -68
  988. package/dist/renderer/cache/GLTextureCache.js.map +0 -1
  989. package/dist/renderer/cache/GradientRampAtlas.js +0 -82
  990. package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
  991. package/dist/renderer/cache/cache.js +0 -13
  992. package/dist/renderer/cache/cache.js.map +0 -1
  993. package/dist/renderer/cache/markerCommandCache.js +0 -63
  994. package/dist/renderer/cache/markerCommandCache.js.map +0 -1
  995. package/dist/renderer/cache/outlineMeshCache.js +0 -15
  996. package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
  997. package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
  998. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
  999. package/dist/renderer/cache/strokeMeshCache.js +0 -55
  1000. package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
  1001. package/dist/renderer/cullDrawCommands.js +0 -90
  1002. package/dist/renderer/cullDrawCommands.js.map +0 -1
  1003. package/dist/renderer/draw/batch.js +0 -133
  1004. package/dist/renderer/draw/batch.js.map +0 -1
  1005. package/dist/renderer/draw/clip.js +0 -89
  1006. package/dist/renderer/draw/clip.js.map +0 -1
  1007. package/dist/renderer/draw/customShader.js +0 -230
  1008. package/dist/renderer/draw/customShader.js.map +0 -1
  1009. package/dist/renderer/draw/drawTriangles.js +0 -8
  1010. package/dist/renderer/draw/drawTriangles.js.map +0 -1
  1011. package/dist/renderer/draw/effects.js +0 -28
  1012. package/dist/renderer/draw/effects.js.map +0 -1
  1013. package/dist/renderer/draw/flushBatch.js +0 -35
  1014. package/dist/renderer/draw/flushBatch.js.map +0 -1
  1015. package/dist/renderer/draw/gradient.js +0 -90
  1016. package/dist/renderer/draw/gradient.js.map +0 -1
  1017. package/dist/renderer/draw/image.js +0 -38
  1018. package/dist/renderer/draw/image.js.map +0 -1
  1019. package/dist/renderer/draw/mesh.js +0 -16
  1020. package/dist/renderer/draw/mesh.js.map +0 -1
  1021. package/dist/renderer/draw/paintBind.js +0 -70
  1022. package/dist/renderer/draw/paintBind.js.map +0 -1
  1023. package/dist/renderer/draw/pathPaint.js +0 -142
  1024. package/dist/renderer/draw/pathPaint.js.map +0 -1
  1025. package/dist/renderer/draw/scratchPass.js +0 -83
  1026. package/dist/renderer/draw/scratchPass.js.map +0 -1
  1027. package/dist/renderer/draw/stencil.js +0 -28
  1028. package/dist/renderer/draw/stencil.js.map +0 -1
  1029. package/dist/renderer/draw/text.js +0 -167
  1030. package/dist/renderer/draw/text.js.map +0 -1
  1031. package/dist/renderer/draw/uniforms.js +0 -77
  1032. package/dist/renderer/draw/uniforms.js.map +0 -1
  1033. package/dist/renderer/draw.js +0 -79
  1034. package/dist/renderer/draw.js.map +0 -1
  1035. package/dist/renderer/drawBatch.js +0 -198
  1036. package/dist/renderer/drawBatch.js.map +0 -1
  1037. package/dist/renderer/effects/EffectTargets.js +0 -48
  1038. package/dist/renderer/effects/EffectTargets.js.map +0 -1
  1039. package/dist/renderer/effects/builtins.js +0 -31
  1040. package/dist/renderer/effects/builtins.js.map +0 -1
  1041. package/dist/renderer/effects/composite.js +0 -11
  1042. package/dist/renderer/effects/composite.js.map +0 -1
  1043. package/dist/renderer/effects/effectPrelude.js +0 -10
  1044. package/dist/renderer/effects/effectPrelude.js.map +0 -1
  1045. package/dist/renderer/effects/types.js +0 -10
  1046. package/dist/renderer/effects/types.js.map +0 -1
  1047. package/dist/renderer/glyphOutlineMesh.js +0 -67
  1048. package/dist/renderer/glyphOutlineMesh.js.map +0 -1
  1049. package/dist/renderer/index.js +0 -20
  1050. package/dist/renderer/math/color.js +0 -321
  1051. package/dist/renderer/math/color.js.map +0 -1
  1052. package/dist/renderer/math/mat3.js +0 -80
  1053. package/dist/renderer/math/mat3.js.map +0 -1
  1054. package/dist/renderer/math/patternSpace.js +0 -22
  1055. package/dist/renderer/math/patternSpace.js.map +0 -1
  1056. package/dist/renderer/math/viewToMat3.js +0 -19
  1057. package/dist/renderer/math/viewToMat3.js.map +0 -1
  1058. package/dist/renderer/paintResources.js +0 -18
  1059. package/dist/renderer/paintResources.js.map +0 -1
  1060. package/dist/renderer/paintScratch.js +0 -37
  1061. package/dist/renderer/paintScratch.js.map +0 -1
  1062. package/dist/renderer/shaders/ShaderProgram.js +0 -74
  1063. package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
  1064. package/dist/renderer/shaders/batchFill.js +0 -119
  1065. package/dist/renderer/shaders/batchFill.js.map +0 -1
  1066. package/dist/renderer/shaders/customPrelude.js +0 -34
  1067. package/dist/renderer/shaders/customPrelude.js.map +0 -1
  1068. package/dist/renderer/shaders/extractUniformNames.js +0 -184
  1069. package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
  1070. package/dist/renderer/shaders/glyphPaint.js +0 -61
  1071. package/dist/renderer/shaders/glyphPaint.js.map +0 -1
  1072. package/dist/renderer/shaders/gradFill.js +0 -31
  1073. package/dist/renderer/shaders/gradFill.js.map +0 -1
  1074. package/dist/renderer/shaders/pathFill.js +0 -14
  1075. package/dist/renderer/shaders/pathFill.js.map +0 -1
  1076. package/dist/renderer/shaders/patternFill.js +0 -25
  1077. package/dist/renderer/shaders/patternFill.js.map +0 -1
  1078. package/dist/renderer/shaders/registerProgram.js +0 -18
  1079. package/dist/renderer/shaders/registerProgram.js.map +0 -1
  1080. package/dist/renderer/spriteSheet.js +0 -14
  1081. package/dist/renderer/spriteSheet.js.map +0 -1
  1082. package/dist/renderer/state/GroupState.js +0 -77
  1083. package/dist/renderer/state/GroupState.js.map +0 -1
  1084. package/dist/renderer/strokeLengths.js +0 -50
  1085. package/dist/renderer/strokeLengths.js.map +0 -1
  1086. package/dist/renderer/syntheticItalic.js +0 -6
  1087. package/dist/renderer/syntheticItalic.js.map +0 -1
  1088. package/dist/renderer/textures/registerTexture.js +0 -34
  1089. package/dist/renderer/textures/registerTexture.js.map +0 -1
  1090. package/dist/scheduling/useVisibleRaf.js +0 -69
  1091. package/dist/scheduling/useVisibleRaf.js.map +0 -1
  1092. package/dist/test-seams-DM2B87-g.d.ts +0 -356
@@ -1,36 +1,40 @@
1
- import { resolveStrokeWidth as e } from "../../features/paths/tessellate/stroke.js";
2
- import { markerReach as t } from "../../features/paths/markerCommands.js";
3
- import { countPathAnchors as n } from "../../features/paths/anchors.js";
1
+ import { bumpNodeMemoGeneration as e } from "../../core/scene/nodeMemo.js";
2
+ import { DEFAULT_SHAPE_FILL as t } from "../../util/paint.js";
3
+ import { paintDrawKindRegistry as n } from "@weasel-js/renderer";
4
+ import { countPathAnchors as r } from "@weasel-js/geom";
5
+ import { markerReach as i, resolveStrokeWidth as a } from "@weasel-js/stroke";
4
6
  //#region src/canvas/nodeShapes/nodePaint.ts
5
- function r(e, t) {
6
- return e === void 0 ? t : e;
7
+ n.subscribe(e);
8
+ function o(e, t) {
9
+ let n = e === void 0 ? t : e;
10
+ return n?.paint == null ? null : n;
7
11
  }
8
- function i(e) {
12
+ function s(e) {
9
13
  return e?.paint == null ? null : e;
10
14
  }
11
- function a(n, r) {
12
- if (n === null) return {
15
+ function c(e, t) {
16
+ if (e === null) return {
13
17
  outset: 0,
14
18
  inset: 0
15
19
  };
16
- let i = t(n), a = (e, t) => {
17
- switch (n.align ?? "center") {
20
+ let n = i(e), r = (t, n) => {
21
+ switch (e.align ?? "center") {
18
22
  case "inner": return {
19
- outset: t,
20
- inset: e
23
+ outset: n,
24
+ inset: t
21
25
  };
22
26
  case "outer": return {
23
- outset: e + t,
27
+ outset: t + n,
24
28
  inset: 0
25
29
  };
26
30
  default: return {
27
- outset: e / 2 + t,
28
- inset: e / 2
31
+ outset: t / 2 + n,
32
+ inset: t / 2
29
33
  };
30
34
  }
31
- }, o = n.width ?? 1, s = a(typeof o == "object" ? 0 : e(o, r ?? 1), i.world);
32
- if (typeof o != "object" && !(i.px > 0)) return s;
33
- let c = a(typeof o == "object" ? o.px : 0, i.px);
35
+ }, o = e.width ?? 1, s = r(typeof o == "object" ? 0 : a(o, t ?? 1), n.world);
36
+ if (typeof o != "object" && !(n.px > 0)) return s;
37
+ let c = r(typeof o == "object" ? o.px : 0, n.px);
34
38
  return {
35
39
  outset: s.outset,
36
40
  inset: s.inset,
@@ -38,10 +42,10 @@ function a(n, r) {
38
42
  insetPx: c.inset
39
43
  };
40
44
  }
41
- function o(e, t) {
42
- let r = t?.vertexColors, i = e[0];
43
- if (r === void 0 || i?.kind !== "path") return e;
44
- let a = 4 * n(i.path), o = i.fill ? r("fill", i.vertexColors) : void 0, s = i.stroke ? r("stroke", i.stroke.vertexColors) : void 0, c = o?.length === a && o !== i.vertexColors, l = s?.length === a && s !== i.stroke?.vertexColors;
45
+ function l(e, t) {
46
+ let n = t?.vertexColors, i = e[0];
47
+ if (n === void 0 || i?.kind !== "path") return e;
48
+ let a = 4 * r(i.path), o = i.fill ? n("fill", i.vertexColors) : void 0, s = i.stroke ? n("stroke", i.stroke.vertexColors) : void 0, c = o?.length === a && o !== i.vertexColors, l = s?.length === a && s !== i.stroke?.vertexColors;
45
49
  return !c && !l ? e : [{
46
50
  ...i,
47
51
  ...c ? { vertexColors: o } : {},
@@ -51,7 +55,14 @@ function o(e, t) {
51
55
  } } : {}
52
56
  }, ...e.slice(1)];
53
57
  }
58
+ function u(e) {
59
+ let n = s(e.stroke), r = o(e.fill, n === null ? t : null);
60
+ return n === null ? { fill: r } : {
61
+ fill: r,
62
+ stroke: n
63
+ };
64
+ }
54
65
  //#endregion
55
- export { a as inkReach, r as resolveNodeFill, i as resolveNodeStroke, o as withAnimatedVertexColors };
66
+ export { c as inkReach, u as pathPaintOf, o as resolveNodeFill, s as resolveNodeStroke, l as withAnimatedVertexColors };
56
67
 
57
68
  //# sourceMappingURL=nodePaint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodePaint.js","names":["resolveNodeFill","fill","fallback","resolveNodeStroke","stroke","inkReach","heads","markerReach","sides","headReach","width","world","resolveStrokeWidth","scale","px","withAnimatedVertexColors","resolve","ctx","body","cmds","expected","countPathAnchors","fillChanged","strokeChanged"],"sources":["../../../src/canvas/nodeShapes/nodePaint.ts"],"sourcesContent":["import type { FillStyle, Stroke } from '@weasel-js/paint';\nimport type { NodeInk, NodePaintCtx } from 'canvas/NodeShape';\nimport { countPathAnchors } from 'features/paths/anchors';\nimport { markerReach } from 'features/paths/markerCommands';\nimport { resolveStrokeWidth } from 'features/paths/tessellate/stroke';\nimport type { DrawCommand, PathDrawCommand } from '../../renderer';\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 */\nexport function 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. */\nexport function 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. */\nexport type PaintedStroke = Stroke & { paint: FillStyle };\n\n/** Per-side grab reach for a resolved stroke: world units for what the\n * renderer builds in world, screen pixels for what it builds on screen — a\n * `{ px }` width, and each head by its own size's units. */\nexport function inkReach(\n stroke: Stroke | null,\n scale: number | undefined,\n): Pick<NodeInk, 'outset' | 'inset' | 'outsetPx' | 'insetPx'> {\n if (stroke === null) return { outset: 0, inset: 0 };\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 heads = markerReach(stroke);\n const sides = (width: number, headReach: number) => {\n switch (stroke.align ?? 'center') {\n case 'inner': return { outset: headReach, inset: width };\n case 'outer': return { outset: width + headReach, inset: 0 };\n default: return { outset: width / 2 + headReach, inset: width / 2 };\n }\n };\n const width = stroke.width ?? 1;\n const world = sides(typeof width === 'object' ? 0 : resolveStrokeWidth(width, scale ?? 1), heads.world);\n if (typeof width !== 'object' && !(heads.px > 0)) return world;\n const px = sides(typeof width === 'object' ? width.px : 0, heads.px);\n return { outset: world.outset, inset: world.inset, outsetPx: px.outset, insetPx: px.inset };\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. */\nexport function 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"],"mappings":";;;;AAgBA,SAAgBA,EACd,GACA,GACkB;CAClB,OAAOC,MAAS,KAAA,IAAYC,IAAWD;AACzC;AAeA,SAAgBE,EAAkB,GAAyD;CAEzF,OADIC,GAAQ,SAAS,OAAa,OAC3BA;AACT;AASA,SAAgBC,EACd,GACA,GAC4D;CAC5D,IAAID,MAAW,MAAM,OAAO;EAAE,QAAQ;EAAG,OAAO;CAAE;CAGlD,IAAME,IAAQC,EAAYH,CAAM,GAC1BI,KAAS,GAAe,MAAsB;EAClD,QAAQJ,EAAO,SAAS,UAAxB;GACE,KAAK,SAAS,OAAO;IAAE,QAAQK;IAAW,OAAOC;GAAM;GACvD,KAAK,SAAS,OAAO;IAAE,QAAQA,IAAQD;IAAW,OAAO;GAAE;GAC3D,SAAS,OAAO;IAAE,QAAQC,IAAQ,IAAID;IAAW,OAAOC,IAAQ;GAAE;EACpE;CACF,GACMA,IAAQN,EAAO,SAAS,GACxBO,IAAQH,EAAM,OAAOE,KAAU,WAAW,IAAIE,EAAmBF,GAAOG,KAAS,CAAC,GAAGP,EAAM,KAAK;CACtG,IAAI,OAAOI,KAAU,YAAY,EAAEJ,EAAM,KAAK,IAAI,OAAOK;CACzD,IAAMG,IAAKN,EAAM,OAAOE,KAAU,WAAWA,EAAM,KAAK,GAAGJ,EAAM,EAAE;CACnE,OAAO;EAAE,QAAQK,EAAM;EAAQ,OAAOA,EAAM;EAAO,UAAUG,EAAG;EAAQ,SAASA,EAAG;CAAM;AAC5F;AAOA,SAAgBC,EAAyB,GAAqB,GAA8C;CAC1G,IAAMC,IAAUC,GAAK,cACfC,IAAOC,EAAK;CAClB,IAAIH,MAAY,KAAA,KAAaE,GAAM,SAAS,QAAQ,OAAOC;CAC3D,IAAMC,IAAW,IAAIC,EAAiBH,EAAK,IAAI,GACzCjB,IAAOiB,EAAK,OAAOF,EAAQ,QAAQE,EAAK,YAAY,IAAI,KAAA,GACxDd,IAASc,EAAK,SAASF,EAAQ,UAAUE,EAAK,OAAO,YAAY,IAAI,KAAA,GACrEI,IAAcrB,GAAM,WAAWmB,KAAYnB,MAASiB,EAAK,cACzDK,IAAgBnB,GAAQ,WAAWgB,KAAYhB,MAAWc,EAAK,QAAQ;CAO7E,OANI,CAACI,KAAe,CAACC,IAAsBJ,IAMpC,CAAC;EAJN,GAAGD;EACH,GAAII,IAAc,EAAE,cAAcrB,EAAiB,IAAI,CAAC;EACxD,GAAIsB,IAAgB,EAAE,QAAQ;GAAE,GAAGL,EAAK;GAAS,cAAcd;EAAmB,EAAE,IAAI,CAAC;CAEnF,GAAM,GAAGe,EAAK,MAAM,CAAC,CAAC;AAChC"}
1
+ {"version":3,"file":"nodePaint.js","names":["paintDrawKindRegistry","bumpNodeMemoGeneration","resolveNodeFill","declared","fill","fallback","resolveNodeStroke","stroke","inkReach","heads","markerReach","sides","headReach","width","world","resolveStrokeWidth","scale","px","withAnimatedVertexColors","resolve","ctx","body","cmds","expected","countPathAnchors","fillChanged","strokeChanged","pathPaintOf","data","DEFAULT_SHAPE_FILL"],"sources":["../../../src/canvas/nodeShapes/nodePaint.ts"],"sourcesContent":["import type { Paint, Stroke, Fill } from '@weasel-js/paint';\nimport type { NodeInk, NodePaintCtx } from 'canvas/NodeShape';\nimport { countPathAnchors } from '@weasel-js/geom';\nimport { markerReach } from '@weasel-js/stroke';\nimport { resolveStrokeWidth } from '@weasel-js/stroke';\nimport type { DrawCommand, PathDrawCommand } from '@weasel-js/renderer';\nimport { paintDrawKindRegistry } from '@weasel-js/renderer';\nimport { bumpNodeMemoGeneration } from 'core/scene/nodeMemo';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\n\n// The painters memoize a node's paint and resolve a fill's frame inside the\n// memo, so the kind set is ambient state that memo cannot see change.\npaintDrawKindRegistry.subscribe(bumpNodeMemoGeneration);\n\n/**\n * What a node's `data.fill` means to the built-in painters.\n *\n * Its {@link Paint} 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\", and so is a fill carrying no `paint`;\n * `undefined` takes the painter's fallback. Write the paint with\n * {@link solid} rather than by hand when all you have is a color.\n */\nexport function resolveNodeFill(\n fill: Fill | null | undefined,\n fallback: Fill | null,\n): PaintedFill | null {\n const declared = fill === undefined ? fallback : fill;\n return declared?.paint == null ? null : (declared as PaintedFill);\n}\n\n/** A fill that paints — what everything downstream of `resolveNodeFill`\n * works with. */\nexport type PaintedFill = Fill & { paint: Paint };\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. The type requires `paint`,\n * but a document is data, and a stroke assembled a field at a time arrives\n * here without one; painting it throws out of the painter and takes the whole\n * frame with it. */\nexport function 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. */\nexport type PaintedStroke = Stroke & { paint: Paint };\n\n/** Per-side grab reach for a resolved stroke: world units for what the\n * renderer builds in world, screen pixels for what it builds on screen — a\n * `{ px }` width, and each head by its own size's units. */\nexport function inkReach(\n stroke: Stroke | null,\n scale: number | undefined,\n): Pick<NodeInk, 'outset' | 'inset' | 'outsetPx' | 'insetPx'> {\n if (stroke === null) return { outset: 0, inset: 0 };\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 heads = markerReach(stroke);\n const sides = (width: number, headReach: number) => {\n switch (stroke.align ?? 'center') {\n case 'inner': return { outset: headReach, inset: width };\n case 'outer': return { outset: width + headReach, inset: 0 };\n default: return { outset: width / 2 + headReach, inset: width / 2 };\n }\n };\n const width = stroke.width ?? 1;\n const world = sides(typeof width === 'object' ? 0 : resolveStrokeWidth(width, scale ?? 1), heads.world);\n if (typeof width !== 'object' && !(heads.px > 0)) return world;\n const px = sides(typeof width === 'object' ? width.px : 0, heads.px);\n return { outset: world.outset, inset: world.inset, outsetPx: px.outset, insetPx: px.inset };\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. */\nexport function 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\n/** The paint a path node wears, resolved: what an action that turns ink into\n * geometry reads from a node and tells a consumer to put on a result. */\nexport interface PathPaint {\n /** `null` is no fill. */\n fill: Fill | null;\n /** Absent for no stroke. */\n stroke?: Stroke;\n}\n\n/** {@link PathPaint} of a node that keeps its paint in `data.fill` and\n * `data.stroke`, as the built-in path painter draws it: a stroke with no\n * `paint` is none, and an undeclared fill is the default shape fill unless\n * the node is stroked. */\nexport function pathPaintOf(data: { fill?: Fill | null; stroke?: Stroke | null }): PathPaint {\n const stroke = resolveNodeStroke(data.stroke);\n const fill = resolveNodeFill(data.fill, stroke !== null ? null : DEFAULT_SHAPE_FILL);\n return stroke !== null ? { fill, stroke } : { fill };\n}\n"],"mappings":";;;;;;AAYAA,EAAsB,UAAUC,CAAsB;AAWtD,SAAgBC,EACd,GACA,GACoB;CACpB,IAAMC,IAAWC,MAAS,KAAA,IAAYC,IAAWD;CACjD,OAAOD,GAAU,SAAS,OAAO,OAAQA;AAC3C;AAeA,SAAgBG,EAAkB,GAAyD;CAEzF,OADIC,GAAQ,SAAS,OAAa,OAC3BA;AACT;AASA,SAAgBC,EACd,GACA,GAC4D;CAC5D,IAAID,MAAW,MAAM,OAAO;EAAE,QAAQ;EAAG,OAAO;CAAE;CAGlD,IAAME,IAAQC,EAAYH,CAAM,GAC1BI,KAAS,GAAe,MAAsB;EAClD,QAAQJ,EAAO,SAAS,UAAxB;GACE,KAAK,SAAS,OAAO;IAAE,QAAQK;IAAW,OAAOC;GAAM;GACvD,KAAK,SAAS,OAAO;IAAE,QAAQA,IAAQD;IAAW,OAAO;GAAE;GAC3D,SAAS,OAAO;IAAE,QAAQC,IAAQ,IAAID;IAAW,OAAOC,IAAQ;GAAE;EACpE;CACF,GACMA,IAAQN,EAAO,SAAS,GACxBO,IAAQH,EAAM,OAAOE,KAAU,WAAW,IAAIE,EAAmBF,GAAOG,KAAS,CAAC,GAAGP,EAAM,KAAK;CACtG,IAAI,OAAOI,KAAU,YAAY,EAAEJ,EAAM,KAAK,IAAI,OAAOK;CACzD,IAAMG,IAAKN,EAAM,OAAOE,KAAU,WAAWA,EAAM,KAAK,GAAGJ,EAAM,EAAE;CACnE,OAAO;EAAE,QAAQK,EAAM;EAAQ,OAAOA,EAAM;EAAO,UAAUG,EAAG;EAAQ,SAASA,EAAG;CAAM;AAC5F;AAOA,SAAgBC,EAAyB,GAAqB,GAA8C;CAC1G,IAAMC,IAAUC,GAAK,cACfC,IAAOC,EAAK;CAClB,IAAIH,MAAY,KAAA,KAAaE,GAAM,SAAS,QAAQ,OAAOC;CAC3D,IAAMC,IAAW,IAAIC,EAAiBH,EAAK,IAAI,GACzCjB,IAAOiB,EAAK,OAAOF,EAAQ,QAAQE,EAAK,YAAY,IAAI,KAAA,GACxDd,IAASc,EAAK,SAASF,EAAQ,UAAUE,EAAK,OAAO,YAAY,IAAI,KAAA,GACrEI,IAAcrB,GAAM,WAAWmB,KAAYnB,MAASiB,EAAK,cACzDK,IAAgBnB,GAAQ,WAAWgB,KAAYhB,MAAWc,EAAK,QAAQ;CAO7E,OANI,CAACI,KAAe,CAACC,IAAsBJ,IAMpC,CAAC;EAJN,GAAGD;EACH,GAAII,IAAc,EAAE,cAAcrB,EAAiB,IAAI,CAAC;EACxD,GAAIsB,IAAgB,EAAE,QAAQ;GAAE,GAAGL,EAAK;GAAS,cAAcd;EAAmB,EAAE,IAAI,CAAC;CAEnF,GAAM,GAAGe,EAAK,MAAM,CAAC,CAAC;AAChC;AAeA,SAAgBK,EAAY,GAAiE;CAC3F,IAAMpB,IAASD,EAAkBsB,EAAK,MAAM,GACtCxB,IAAOF,EAAgB0B,EAAK,MAAMrB,MAAW,OAAcsB,IAAP,IAAyB;CACnF,OAAOtB,MAAW,OAA0B,EAAE,QAAK,IAA1B;EAAE;EAAM;CAAO;AAC1C"}
@@ -1,36 +1,37 @@
1
1
  import { nodeMemo as e } from "../../core/scene/nodeMemo.js";
2
- import { commandFill as t, commandStroke as n } from "../../features/patterns/commandPaint.js";
3
- import { DEFAULT_SHAPE_FILL as r } from "../../util/paint.js";
4
- import { PAINT_SLOT as i } from "./memo.js";
5
- import { inkReach as a, resolveNodeFill as o, resolveNodeStroke as s, withAnimatedVertexColors as c } from "./nodePaint.js";
6
- import { paintsPose as l, poseBoxBounds as u } from "./poseBox.js";
7
- import { pathInPoseFrame as d } from "../../features/paths/pathInWorld.js";
2
+ import { PAINT_SLOT as t } from "./memo.js";
3
+ import { inkReach as n, pathPaintOf as r, resolveNodeStroke as i, withAnimatedVertexColors as a } from "./nodePaint.js";
4
+ import { DERIVED_PAINTER as o } from "./derivedPainter.js";
5
+ import { paintsPose as s, poseBoxBounds as c } from "./poseBox.js";
6
+ import { commandFill as l, commandStroke as u } from "@weasel-js/renderer";
7
+ import { pathInPoseFrame as d } from "@weasel-js/geom";
8
8
  //#region src/canvas/nodeShapes/pathPainter.ts
9
9
  var f = {
10
10
  id: "kit:path",
11
- matches: (e) => l(e.pose) ? e.data?.path != null : !1,
12
- paint: (a, l, u) => c(e(a, i, l, () => {
13
- let e = a.data, i = d(e.path, l), c = s(e.stroke), u = c !== null, f = o(e.fill, u ? null : r), p = f && t(f, l), m = c && n(c, l);
11
+ matches: (e) => s(e.pose) ? e.data?.path != null : !1,
12
+ paint: (n, i, s) => s?.derivedPath == null ? a(e(n, t, i, () => {
13
+ let e = n.data, t = d(e.path, i), { fill: a, stroke: o } = r(e), s = a && l(a, i), c = o && u(o, i);
14
14
  return [{
15
15
  kind: "path",
16
- path: i,
17
- ...p ? { fill: p } : {},
18
- ...p && e.vertexColors ? { vertexColors: e.vertexColors } : {},
19
- ...m ? { stroke: m } : {}
16
+ path: t,
17
+ ...s ? { fill: s } : {},
18
+ ...s && e.vertexColors ? { vertexColors: e.vertexColors } : {},
19
+ ...c ? { stroke: c } : {}
20
20
  }];
21
- }), u),
22
- silhouette: (e, t) => {
23
- let n = e.data;
24
- return d(n.path, t);
21
+ }), s) : o.paint(n, i, s),
22
+ silhouette: (e, t, n) => {
23
+ if (n?.derivedPath != null) return n.derivedPath;
24
+ let r = e.data;
25
+ return d(r.path, t);
25
26
  },
26
- ink: (e, t, n) => {
27
- let i = e.data, c = s(i.stroke), l = c !== null;
27
+ ink: (e, t, i) => {
28
+ let a = e.data, { fill: o, stroke: s } = r(a);
28
29
  return {
29
- filled: o(i.fill, l ? null : r) !== null,
30
- ...a(c, n?.scale)
30
+ filled: o !== null,
31
+ ...n(s ?? null, i?.scale)
31
32
  };
32
33
  },
33
- bounds: (e, t, n) => u(t, s(e.data.stroke), n)
34
+ bounds: (e, t, n) => c(t, i(e.data.stroke), n)
34
35
  };
35
36
  //#endregion
36
37
  export { f as PATH_PAINTER };
@@ -1 +1 @@
1
- {"version":3,"file":"pathPainter.js","names":["PATH_PAINTER","paintsPose","node","withAnimatedVertexColors","nodeMemo","PAINT_SLOT","pose","d","projected","pathInPoseFrame","strokeSpec","resolveNodeStroke","hasStroke","declared","resolveNodeFill","DEFAULT_SHAPE_FILL","fill","commandFill","stroke","commandStroke","ctx","inkReach","poseBoxBounds"],"sources":["../../../src/canvas/nodeShapes/pathPainter.ts"],"sourcesContent":["import type {\n Path\n} from '@weasel-js/geom';\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { pathInPoseFrame } from 'features/paths/pathInWorld';\nimport { commandFill, commandStroke } from '../../features/patterns/commandPaint';\nimport type { DrawCommand } from '../../renderer';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, withAnimatedVertexColors, resolveNodeFill, resolveNodeStroke } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\nexport const 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 && commandFill(declared, pose);\n const stroke = strokeSpec && commandStroke(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),\n};\n"],"mappings":";;;;;;;;AAgBA,IAAaA,IAAkD;CAC7D,IAAI;CACJ,UAAU,MACHC,EAAWC,EAAK,IAAI,IACfA,EAAK,MACL,QAAQ,OAFiB;CAOrC,QAAQ,GAAM,GAAM,MAAQC,EAAyBC,EAASF,GAAMG,GAAYC,SAAY;EAC1F,IAAMC,IAAIL,EAAK,MAMTM,IAAYC,EAAgBF,EAAE,MAAMD,CAAI,GACxCI,IAAaC,EAAkBJ,EAAE,MAAM,GACvCK,IAAYF,MAAe,MAI3BG,IAAWC,EAAgBP,EAAE,MAAMK,IAAY,OAAOG,CAAkB,GAIxEC,IAAOH,KAAYI,EAAYJ,GAAUP,CAAI,GAC7CY,IAASR,KAAcS,EAAcT,GAAYJ,CAAI;EAQ3D,OAAO,CAAC;GANN,MAAM;GACN,MAAME;GACN,GAAIQ,IAAO,EAAE,QAAK,IAAI,CAAC;GACvB,GAAIA,KAAQT,EAAE,eAAe,EAAE,cAAcA,EAAE,aAAa,IAAI,CAAC;GACjE,GAAIW,IAAS,EAAE,UAAO,IAAI,CAAC;EAErB,CAAG;CACb,CAAC,GAAGE,CAAG;CACP,aAAa,GAAM,MAAS;EAC1B,IAAMb,IAAIL,EAAK;EACf,OAAOO,EAAgBF,EAAE,MAAMD,CAAI;CACrC;CAKA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMC,IAAIL,EAAK,MAITgB,IAASP,EAAkBJ,EAAE,MAAM,GACnCK,IAAYM,MAAW;EAC7B,OAAO;GACL,QAAQJ,EAAgBP,EAAE,MAAMK,IAAY,OAAOG,CAAkB,MAAM;GAC3E,GAAGM,EAASH,GAAQE,GAAK,KAAK;EAChC;CACF;CAEA,SAAS,GAAM,GAAM,MACnBE,EAAchB,GAAMK,EAAmBT,EAAK,KAAoC,MAAM,GAAGkB,CAAG;AAChG"}
1
+ {"version":3,"file":"pathPainter.js","names":["PATH_PAINTER","paintsPose","node","ctx","withAnimatedVertexColors","nodeMemo","PAINT_SLOT","pose","d","projected","pathInPoseFrame","declared","strokeSpec","pathPaintOf","fill","commandFill","stroke","commandStroke","DERIVED_PAINTER","inkReach","poseBoxBounds","resolveNodeStroke"],"sources":["../../../src/canvas/nodeShapes/pathPainter.ts"],"sourcesContent":["import type {\n Path\n} from '@weasel-js/geom';\nimport type { Stroke, Fill } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { pathInPoseFrame } from '@weasel-js/geom';\nimport { commandFill, commandStroke } from '@weasel-js/renderer';\nimport type { DrawCommand } from '@weasel-js/renderer';\nimport { DERIVED_PAINTER } from './derivedPainter';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, pathPaintOf, withAnimatedVertexColors, resolveNodeStroke } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\nexport const 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) => ctx?.derivedPath != null\n // A pose override's path stands in for `data.path`, already where it is drawn.\n ? DERIVED_PAINTER.paint(node, pose, ctx)\n : withAnimatedVertexColors(nodeMemo(node, PAINT_SLOT, pose, () => {\n const d = node.data as {\n path: Path;\n fill?: Fill | null;\n stroke?: Stroke | null;\n vertexColors?: number[];\n };\n const projected = pathInPoseFrame(d.path, pose);\n const { fill: declared, stroke: strokeSpec } = pathPaintOf(d);\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 && commandFill(declared, pose);\n const stroke = strokeSpec && commandStroke(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, ctx) => {\n if (ctx?.derivedPath != null) return ctx.derivedPath;\n const d = node.data as { path: Path };\n return pathInPoseFrame(d.path, pose);\n },\n ink: (node, _pose, ctx) => {\n const d = node.data as {\n fill?: Fill | null;\n stroke?: Stroke | null;\n };\n const { fill, stroke } = pathPaintOf(d);\n return { filled: fill !== null, ...inkReach(stroke ?? null, ctx?.scale) };\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),\n};\n"],"mappings":";;;;;;;;AAgBA,IAAaA,IAAkD;CAC7D,IAAI;CACJ,UAAU,MACHC,EAAWC,EAAK,IAAI,IACfA,EAAK,MACL,QAAQ,OAFiB;CAOrC,QAAQ,GAAM,GAAM,MAAQC,GAAK,eAAe,OAG5CC,EAAyBC,EAASH,GAAMI,GAAYC,SAAY;EAClE,IAAMC,IAAIN,EAAK,MAMTO,IAAYC,EAAgBF,EAAE,MAAMD,CAAI,GACxC,EAAE,MAAMI,GAAU,QAAQC,MAAeC,EAAYL,CAAC,GAItDM,IAAOH,KAAYI,EAAYJ,GAAUJ,CAAI,GAC7CS,IAASJ,KAAcK,EAAcL,GAAYL,CAAI;EAQ3D,OAAO,CAAC;GANN,MAAM;GACN,MAAME;GACN,GAAIK,IAAO,EAAE,QAAK,IAAI,CAAC;GACvB,GAAIA,KAAQN,EAAE,eAAe,EAAE,cAAcA,EAAE,aAAa,IAAI,CAAC;GACjE,GAAIQ,IAAS,EAAE,UAAO,IAAI,CAAC;EAErB,CAAG;CACb,CAAC,GAAGb,CAAG,IAvBHe,EAAgB,MAAMhB,GAAMK,GAAMJ,CAAG;CAwBzC,aAAa,GAAM,GAAM,MAAQ;EAC/B,IAAIA,GAAK,eAAe,MAAM,OAAOA,EAAI;EACzC,IAAMK,IAAIN,EAAK;EACf,OAAOQ,EAAgBF,EAAE,MAAMD,CAAI;CACrC;CACA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMC,IAAIN,EAAK,MAIT,EAAE,SAAM,cAAWW,EAAYL,CAAC;EACtC,OAAO;GAAE,QAAQM,MAAS;GAAM,GAAGK,EAASH,KAAU,MAAMb,GAAK,KAAK;EAAE;CAC1E;CAEA,SAAS,GAAM,GAAM,MACnBiB,EAAcb,GAAMc,EAAmBnB,EAAK,KAAoC,MAAM,GAAGC,CAAG;AAChG"}
@@ -1,12 +1,12 @@
1
- import { strokeReachAt as e } from "../../renderer/cullDrawCommands.js";
2
- import { isRectPose as t } from "../../interactions/actions/resize/autoPoseDescriptor.js";
1
+ import { isRectPose as e } from "../../core/geometry/autoPoseDescriptor.js";
2
+ import { strokeReachAt as t } from "@weasel-js/renderer";
3
3
  //#region src/canvas/nodeShapes/poseBox.ts
4
- function n(e) {
5
- return e === void 0 || t(e);
4
+ function n(t) {
5
+ return t === void 0 || e(t);
6
6
  }
7
7
  function r(n, r, i) {
8
- if (!t(n)) return null;
9
- let a = r ? e(r, i?.scale ?? 1, i?.leastScale) : 0, o = Math.min(n.x, n.x + n.width), s = Math.min(n.y, n.y + n.height);
8
+ if (!e(n)) return null;
9
+ let a = r ? t(r, i?.scale ?? 1, i?.leastScale) : 0, o = Math.min(n.x, n.x + n.width), s = Math.min(n.y, n.y + n.height);
10
10
  return {
11
11
  x: o - a,
12
12
  y: s - a,
@@ -1 +1 @@
1
- {"version":3,"file":"poseBox.js","names":["paintsPose","pose","isRectPose","poseBoxBounds","reach","stroke","strokeReachAt","ctx","x","y"],"sources":["../../../src/canvas/nodeShapes/poseBox.ts"],"sourcesContent":["import type { Stroke } from '@weasel-js/paint';\nimport type { NodeInkCtx } from 'canvas/NodeShape';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { isRectPose } from 'interactions/actions/resize/autoPoseDescriptor';\nimport { strokeReachAt } from '../../renderer/cullDrawCommands';\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. */\nexport function paintsPose(pose: unknown): boolean {\n return pose === undefined || isRectPose(pose);\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. */\nexport function poseBoxBounds(pose: unknown, stroke: Stroke | null, ctx: NodeInkCtx | undefined): Bounds | null {\n if (!isRectPose(pose)) return null;\n const reach = stroke ? strokeReachAt(stroke, ctx?.scale ?? 1, ctx?.leastScale) : 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"],"mappings":";;;AAQA,SAAgBA,EAAW,GAAwB;CACjD,OAAOC,MAAS,KAAA,KAAaC,EAAWD,CAAI;AAC9C;AAIA,SAAgBE,EAAc,GAAe,GAAuB,GAA4C;CAC9G,IAAI,CAACD,EAAWD,CAAI,GAAG,OAAO;CAC9B,IAAMG,IAAQC,IAASC,EAAcD,GAAQE,GAAK,SAAS,GAAGA,GAAK,UAAU,IAAI,GAC3EC,IAAI,KAAK,IAAIP,EAAK,GAAGA,EAAK,IAAIA,EAAK,KAAK,GACxCQ,IAAI,KAAK,IAAIR,EAAK,GAAGA,EAAK,IAAIA,EAAK,MAAM;CAC/C,OAAO;EACL,GAAGO,IAAIJ;EACP,GAAGK,IAAIL;EACP,OAAO,KAAK,IAAIH,EAAK,KAAK,IAAI,IAAIG;EAClC,QAAQ,KAAK,IAAIH,EAAK,MAAM,IAAI,IAAIG;CACtC;AACF"}
1
+ {"version":3,"file":"poseBox.js","names":["paintsPose","pose","isRectPose","poseBoxBounds","reach","stroke","strokeReachAt","ctx","x","y"],"sources":["../../../src/canvas/nodeShapes/poseBox.ts"],"sourcesContent":["import type { Stroke } from '@weasel-js/paint';\nimport type { NodeInkCtx } from 'canvas/NodeShape';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { isRectPose } from 'core/geometry/autoPoseDescriptor';\nimport { strokeReachAt } from '@weasel-js/renderer';\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. */\nexport function paintsPose(pose: unknown): boolean {\n return pose === undefined || isRectPose(pose);\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. */\nexport function poseBoxBounds(pose: unknown, stroke: Stroke | null, ctx: NodeInkCtx | undefined): Bounds | null {\n if (!isRectPose(pose)) return null;\n const reach = stroke ? strokeReachAt(stroke, ctx?.scale ?? 1, ctx?.leastScale) : 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"],"mappings":";;;AAQA,SAAgBA,EAAW,GAAwB;CACjD,OAAOC,MAAS,KAAA,KAAaC,EAAWD,CAAI;AAC9C;AAIA,SAAgBE,EAAc,GAAe,GAAuB,GAA4C;CAC9G,IAAI,CAACD,EAAWD,CAAI,GAAG,OAAO;CAC9B,IAAMG,IAAQC,IAASC,EAAcD,GAAQE,GAAK,SAAS,GAAGA,GAAK,UAAU,IAAI,GAC3EC,IAAI,KAAK,IAAIP,EAAK,GAAGA,EAAK,IAAIA,EAAK,KAAK,GACxCQ,IAAI,KAAK,IAAIR,EAAK,GAAGA,EAAK,IAAIA,EAAK,MAAM;CAC/C,OAAO;EACL,GAAGO,IAAIJ;EACP,GAAGK,IAAIL;EACP,OAAO,KAAK,IAAIH,EAAK,KAAK,IAAI,IAAIG;EAClC,QAAQ,KAAK,IAAIH,EAAK,MAAM,IAAI,IAAIG;CACtC;AACF"}
@@ -1,13 +1,13 @@
1
- import { commandFill as e } from "../../features/patterns/commandPaint.js";
2
- import { DEFAULT_SHAPE_FILL as t } from "../../util/paint.js";
3
- import { resolveNodeFill as n } from "./nodePaint.js";
4
- import { paintsPose as r, poseBoxBounds as i } from "./poseBox.js";
1
+ import { DEFAULT_SHAPE_FILL as e } from "../../util/paint.js";
2
+ import { resolveNodeFill as t } from "./nodePaint.js";
3
+ import { paintsPose as n, poseBoxBounds as r } from "./poseBox.js";
4
+ import { commandFill as i } from "@weasel-js/renderer";
5
5
  //#region src/canvas/nodeShapes/rectFallbackPainter.ts
6
6
  var a = {
7
7
  id: "kit:rect-fallback",
8
- matches: (e) => r(e.pose),
9
- paint: (r, i) => {
10
- let a = r.data, o = i, s = n(a?.fill, t), c = s && e(s, o);
8
+ matches: (e) => n(e.pose),
9
+ paint: (n, r) => {
10
+ let a = n.data, o = r, s = t(a?.fill, e), c = s && i(s, o);
11
11
  return [{
12
12
  kind: "path",
13
13
  path: {
@@ -30,7 +30,7 @@ var a = {
30
30
  height: n.height
31
31
  };
32
32
  },
33
- bounds: (e, t) => i(t, null, void 0)
33
+ bounds: (e, t) => r(t, null, void 0)
34
34
  };
35
35
  //#endregion
36
36
  export { a as RECT_FALLBACK_PAINTER };
@@ -1 +1 @@
1
- {"version":3,"file":"rectFallbackPainter.js","names":["RECT_FALLBACK_PAINTER","paintsPose","node","d","p","pose","declared","resolveNodeFill","DEFAULT_SHAPE_FILL","fill","commandFill","poseBoxBounds"],"sources":["../../../src/canvas/nodeShapes/rectFallbackPainter.ts"],"sourcesContent":["import type { FillStyle } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport type { RectPose } from 'core/scene/types';\nimport { commandFill } from '../../features/patterns/commandPaint';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { resolveNodeFill } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\nexport const 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 declared = resolveNodeFill(d?.fill, DEFAULT_SHAPE_FILL);\n const fill = declared && commandFill(declared, p);\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"],"mappings":";;;;;AASA,IAAaA,IAA2D;CAKtE,IAAI;CACJ,UAAU,MAASC,EAAWC,EAAK,IAAI;CACvC,QAAQ,GAAM,MAAS;EACrB,IAAMC,IAAID,EAAK,MACTE,IAAIC,GACJC,IAAWC,EAAgBJ,GAAG,MAAMK,CAAkB,GACtDC,IAAOH,KAAYI,EAAYJ,GAAUF,CAAC;EAChD,OAAO,CAAC;GACN,MAAM;GACN,MAAM;IAAE,MAAM;IAAQ,GAAGA,EAAE;IAAG,GAAGA,EAAE;IAAG,OAAOA,EAAE;IAAO,QAAQA,EAAE;GAAO;GACvE,GAAIK,IAAO,EAAE,QAAK,IAAI,CAAC;EACzB,CAAC;CACH;CACA,aAAa,GAAO,MAAS;EAC3B,IAAML,IAAIC;EACV,OAAO;GAAE,MAAM;GAAQ,GAAGD,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC1E;CACA,SAAS,GAAO,MAASO,EAAcN,GAAM,MAAM,KAAA,CAAS;AAC9D"}
1
+ {"version":3,"file":"rectFallbackPainter.js","names":["RECT_FALLBACK_PAINTER","paintsPose","node","d","p","pose","declared","resolveNodeFill","DEFAULT_SHAPE_FILL","fill","commandFill","poseBoxBounds"],"sources":["../../../src/canvas/nodeShapes/rectFallbackPainter.ts"],"sourcesContent":["import type { Fill } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport type { RectPose } from 'core/scene/types';\nimport { commandFill } from '@weasel-js/renderer';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { resolveNodeFill } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\nexport const 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?: Fill | null } | null;\n const p = pose;\n const declared = resolveNodeFill(d?.fill, DEFAULT_SHAPE_FILL);\n const fill = declared && commandFill(declared, p);\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"],"mappings":";;;;;AASA,IAAaA,IAA2D;CAKtE,IAAI;CACJ,UAAU,MAASC,EAAWC,EAAK,IAAI;CACvC,QAAQ,GAAM,MAAS;EACrB,IAAMC,IAAID,EAAK,MACTE,IAAIC,GACJC,IAAWC,EAAgBJ,GAAG,MAAMK,CAAkB,GACtDC,IAAOH,KAAYI,EAAYJ,GAAUF,CAAC;EAChD,OAAO,CAAC;GACN,MAAM;GACN,MAAM;IAAE,MAAM;IAAQ,GAAGA,EAAE;IAAG,GAAGA,EAAE;IAAG,OAAOA,EAAE;IAAO,QAAQA,EAAE;GAAO;GACvE,GAAIK,IAAO,EAAE,QAAK,IAAI,CAAC;EACzB,CAAC;CACH;CACA,aAAa,GAAO,MAAS;EAC3B,IAAML,IAAIC;EACV,OAAO;GAAE,MAAM;GAAQ,GAAGD,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC1E;CACA,SAAS,GAAO,MAASO,EAAcN,GAAM,MAAM,KAAA,CAAS;AAC9D"}
@@ -1,39 +1,39 @@
1
1
  import { nodeMemo as e } from "../../core/scene/nodeMemo.js";
2
- import { commandFill as t, commandStroke as n } from "../../features/patterns/commandPaint.js";
3
- import { DEFAULT_SHAPE_FILL as r } from "../../util/paint.js";
4
- import { PAINT_SLOT as i } from "./memo.js";
5
- import { inkReach as a, resolveNodeFill as o, resolveNodeStroke as s, withAnimatedVertexColors as c } from "./nodePaint.js";
6
- import { paintsPose as l, poseBoxBounds as u } from "./poseBox.js";
2
+ import { DEFAULT_SHAPE_FILL as t } from "../../util/paint.js";
3
+ import { PAINT_SLOT as n } from "./memo.js";
4
+ import { inkReach as r, resolveNodeFill as i, resolveNodeStroke as a, withAnimatedVertexColors as o } from "./nodePaint.js";
5
+ import { paintsPose as s, poseBoxBounds as c } from "./poseBox.js";
6
+ import { commandFill as l, commandStroke as u } from "@weasel-js/renderer";
7
7
  import { ellipsePath as d, regularPolygonPath as f, starPath as p } from "@weasel-js/geom";
8
8
  //#region src/canvas/nodeShapes/shapePainter.ts
9
9
  var m = {
10
10
  id: "kit:shape",
11
11
  matches: (e) => {
12
- if (!l(e.pose)) return !1;
12
+ if (!s(e.pose)) return !1;
13
13
  let t = e.data?.shape;
14
14
  return t != null && h.has(t);
15
15
  },
16
- paint: (a, l, u) => c(e(a, i, l, () => {
17
- let e = a.data, i = g(e, l), c = o(e.fill, r), u = c && t(c, l), d = s(e.stroke), f = d && n(d, l);
16
+ paint: (r, s, c) => o(e(r, n, s, () => {
17
+ let e = r.data, n = g(e, s), o = i(e.fill, t), c = o && l(o, s), d = a(e.stroke), f = d && u(d, s);
18
18
  return [{
19
19
  kind: "path",
20
- path: i,
21
- ...u ? { fill: u } : {},
20
+ path: n,
21
+ ...c ? { fill: c } : {},
22
22
  ...f ? { stroke: f } : {}
23
23
  }];
24
- }), u),
24
+ }), c),
25
25
  silhouette: (e, t) => {
26
26
  let n = e.data;
27
27
  return g(n, t);
28
28
  },
29
- ink: (e, t, n) => {
30
- let i = e.data;
29
+ ink: (e, n, o) => {
30
+ let s = e.data;
31
31
  return {
32
- filled: o(i.fill, r) !== null,
33
- ...a(s(i.stroke), n?.scale)
32
+ filled: i(s.fill, t) !== null,
33
+ ...r(a(s.stroke), o?.scale)
34
34
  };
35
35
  },
36
- bounds: (e, t, n) => u(t, s(e.data.stroke), n)
36
+ bounds: (e, t, n) => c(t, a(e.data.stroke), n)
37
37
  }, h = /* @__PURE__ */ new Set([
38
38
  "rect",
39
39
  "ellipse",
@@ -1 +1 @@
1
- {"version":3,"file":"shapePainter.js","names":["SHAPE_PAINTER","paintsPose","node","s","SHAPE_KINDS","withAnimatedVertexColors","nodeMemo","PAINT_SLOT","pose","d","path","pathForShape","declaredFill","resolveNodeFill","DEFAULT_SHAPE_FILL","shapeFill","commandFill","strokeSpec","resolveNodeStroke","stroke","commandStroke","ctx","inkReach","poseBoxBounds","ellipsePath","p","cx","cy","r","regularPolygonPath","starPath"],"sources":["../../../src/canvas/nodeShapes/shapePainter.ts"],"sourcesContent":["import {\n ellipsePath,\n regularPolygonPath,\n starPath,\n type Path\n} from '@weasel-js/geom';\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { commandFill, commandStroke } from '../../features/patterns/commandPaint';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, withAnimatedVertexColors, resolveNodeFill, resolveNodeStroke } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\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. */\nexport const 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 && commandFill(declaredFill, pose);\n const strokeSpec = resolveNodeStroke(d.stroke);\n const stroke = strokeSpec && commandStroke(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),\n};\n\nexport const SHAPE_KINDS = new Set(['rect', 'ellipse', 'polygon', 'star']);\n\nexport function 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"],"mappings":";;;;;;;;AAqBA,IAAaA,IAAmD;CAC9D,IAAI;CACJ,UAAU,MAAS;EACjB,IAAI,CAACC,EAAWC,EAAK,IAAI,GAAG,OAAO;EACnC,IAAMC,IAAKD,EAAK,MAAoC;EACpD,OAAOC,KAAK,QAAQC,EAAY,IAAID,CAAC;CACvC;CAIA,QAAQ,GAAM,GAAM,MAAQE,EAAyBC,EAASJ,GAAMK,GAAYC,SAAY;EAC1F,IAAMC,IAAIP,EAAK,MACTQ,IAAOC,EAAaF,GAAGD,CAAI,GAC3BI,IAAeC,EAAgBJ,EAAE,MAAMK,CAAkB,GACzDC,IAAYH,KAAgBI,EAAYJ,GAAcJ,CAAI,GAC1DS,IAAaC,EAAkBT,EAAE,MAAM,GACvCU,IAASF,KAAcG,EAAcH,GAAYT,CAAI;EAC3D,OAAO,CAAC;GACN,MAAM;GACN;GACA,GAAIO,IAAY,EAAE,MAAMA,EAAU,IAAI,CAAC;GACvC,GAAII,IAAS,EAAE,UAAO,IAAI,CAAC;EAC7B,CAAC;CACH,CAAC,GAAGE,CAAG;CACP,aAAa,GAAM,MAAS;EAC1B,IAAMZ,IAAIP,EAAK;EACf,OAAOS,EAAaF,GAAGD,CAAI;CAC7B;CAIA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMC,IAAIP,EAAK;EACf,OAAO;GACL,QAAQW,EAAgBJ,EAAE,MAAMK,CAAkB,MAAM;GACxD,GAAGQ,EAASJ,EAAkBT,EAAE,MAAM,GAAGY,GAAK,KAAK;EACrD;CACF;CAEA,SAAS,GAAM,GAAM,MACnBE,EAAcf,GAAMU,EAAmBhB,EAAK,KAAoC,MAAM,GAAGmB,CAAG;AAChG,GAEajB,oBAAc,IAAI,IAAI;CAAC;CAAQ;CAAW;CAAW;AAAM,CAAC;AAEzE,SAAgBO,EACd,GACA,GACM;CACN,QAAQF,EAAE,OAAV;EACE,KAAK,WACH,OAAOe,EAAYC,CAAC;EACtB,KAAK,WAAW;GACd,IAAMC,IAAKD,EAAE,IAAIA,EAAE,QAAQ,GACrBE,IAAKF,EAAE,IAAIA,EAAE,SAAS,GACtBG,IAAI,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI;GACxC,OAAOI,EAAmB;IAAE,GAAGH;IAAI,GAAGC;GAAG,GAAGC,GAAGnB,EAAE,SAAS,CAAC;EAC7D;EACA,KAAK,QAAQ;GACX,IAAMiB,IAAKD,EAAE,IAAIA,EAAE,QAAQ,GACrBE,IAAKF,EAAE,IAAIA,EAAE,SAAS,GACtBG,IAAI,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI;GACxC,OAAOK,EAAS;IAAE,GAAGJ;IAAI,GAAGC;GAAG,GAAGC,GAAGnB,EAAE,UAAU,CAAC;EACpD;EAEA,SACE,OAAO;GAAE,MAAM;GAAQ,GAAGgB,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC5E;AACF"}
1
+ {"version":3,"file":"shapePainter.js","names":["SHAPE_PAINTER","paintsPose","node","s","SHAPE_KINDS","withAnimatedVertexColors","nodeMemo","PAINT_SLOT","pose","d","path","pathForShape","declaredFill","resolveNodeFill","DEFAULT_SHAPE_FILL","shapeFill","commandFill","strokeSpec","resolveNodeStroke","stroke","commandStroke","ctx","inkReach","poseBoxBounds","ellipsePath","p","cx","cy","r","regularPolygonPath","starPath"],"sources":["../../../src/canvas/nodeShapes/shapePainter.ts"],"sourcesContent":["import {\n ellipsePath,\n regularPolygonPath,\n starPath,\n type Path\n} from '@weasel-js/geom';\nimport type { Stroke, Fill } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { commandFill, commandStroke } from '@weasel-js/renderer';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, withAnimatedVertexColors, resolveNodeFill, resolveNodeStroke } from './nodePaint';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\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. */\nexport const 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?: Fill | 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 && commandFill(declaredFill, pose);\n const strokeSpec = resolveNodeStroke(d.stroke);\n const stroke = strokeSpec && commandStroke(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?: Fill | 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),\n};\n\nexport const SHAPE_KINDS = new Set(['rect', 'ellipse', 'polygon', 'star']);\n\nexport function 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"],"mappings":";;;;;;;;AAqBA,IAAaA,IAAmD;CAC9D,IAAI;CACJ,UAAU,MAAS;EACjB,IAAI,CAACC,EAAWC,EAAK,IAAI,GAAG,OAAO;EACnC,IAAMC,IAAKD,EAAK,MAAoC;EACpD,OAAOC,KAAK,QAAQC,EAAY,IAAID,CAAC;CACvC;CAIA,QAAQ,GAAM,GAAM,MAAQE,EAAyBC,EAASJ,GAAMK,GAAYC,SAAY;EAC1F,IAAMC,IAAIP,EAAK,MACTQ,IAAOC,EAAaF,GAAGD,CAAI,GAC3BI,IAAeC,EAAgBJ,EAAE,MAAMK,CAAkB,GACzDC,IAAYH,KAAgBI,EAAYJ,GAAcJ,CAAI,GAC1DS,IAAaC,EAAkBT,EAAE,MAAM,GACvCU,IAASF,KAAcG,EAAcH,GAAYT,CAAI;EAC3D,OAAO,CAAC;GACN,MAAM;GACN;GACA,GAAIO,IAAY,EAAE,MAAMA,EAAU,IAAI,CAAC;GACvC,GAAII,IAAS,EAAE,UAAO,IAAI,CAAC;EAC7B,CAAC;CACH,CAAC,GAAGE,CAAG;CACP,aAAa,GAAM,MAAS;EAC1B,IAAMZ,IAAIP,EAAK;EACf,OAAOS,EAAaF,GAAGD,CAAI;CAC7B;CAIA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMC,IAAIP,EAAK;EACf,OAAO;GACL,QAAQW,EAAgBJ,EAAE,MAAMK,CAAkB,MAAM;GACxD,GAAGQ,EAASJ,EAAkBT,EAAE,MAAM,GAAGY,GAAK,KAAK;EACrD;CACF;CAEA,SAAS,GAAM,GAAM,MACnBE,EAAcf,GAAMU,EAAmBhB,EAAK,KAAoC,MAAM,GAAGmB,CAAG;AAChG,GAEajB,oBAAc,IAAI,IAAI;CAAC;CAAQ;CAAW;CAAW;AAAM,CAAC;AAEzE,SAAgBO,EACd,GACA,GACM;CACN,QAAQF,EAAE,OAAV;EACE,KAAK,WACH,OAAOe,EAAYC,CAAC;EACtB,KAAK,WAAW;GACd,IAAMC,IAAKD,EAAE,IAAIA,EAAE,QAAQ,GACrBE,IAAKF,EAAE,IAAIA,EAAE,SAAS,GACtBG,IAAI,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI;GACxC,OAAOI,EAAmB;IAAE,GAAGH;IAAI,GAAGC;GAAG,GAAGC,GAAGnB,EAAE,SAAS,CAAC;EAC7D;EACA,KAAK,QAAQ;GACX,IAAMiB,IAAKD,EAAE,IAAIA,EAAE,QAAQ,GACrBE,IAAKF,EAAE,IAAIA,EAAE,SAAS,GACtBG,IAAI,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI;GACxC,OAAOK,EAAS;IAAE,GAAGJ;IAAI,GAAGC;GAAG,GAAGC,GAAGnB,EAAE,UAAU,CAAC;EACpD;EAEA,SACE,OAAO;GAAE,MAAM;GAAQ,GAAGgB,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC5E;AACF"}
@@ -2,7 +2,7 @@ import { nodeMemo as e } from "../../core/scene/nodeMemo.js";
2
2
  import { PAINT_SLOT as t } from "./memo.js";
3
3
  import { inkReach as n, resolveNodeStroke as r } from "./nodePaint.js";
4
4
  import { paintsPose as i } from "./poseBox.js";
5
- import { textCommandFromPose as a } from "../../features/text/textCommand.js";
5
+ import { textCommandFromPose as a } from "@weasel-js/renderer";
6
6
  import { PATH_L as o, PATH_M as s, PATH_Z as c } from "@weasel-js/geom";
7
7
  import { textLineBoxes as l } from "@weasel-js/text";
8
8
  //#region src/canvas/nodeShapes/textPainter.ts
@@ -1 +1 @@
1
- {"version":3,"file":"textPainter.js","names":["textPoseOf","p","d","resolveNodeStroke","TEXT_PAINTER","paintsPose","node","nodeMemo","PAINT_SLOT","pose","textCommandFromPose","boxes","textLineBoxes","rectsToPath","inkReach","ctx","commands","rects","coords","ci","cmd","r","w","h","PATH_M","x","y","PATH_L","PATH_Z"],"sources":["../../../src/canvas/nodeShapes/textPainter.ts"],"sourcesContent":["import {\n PATH_L,\n PATH_M,\n PATH_Z,\n type PolygonPath\n} from '@weasel-js/geom';\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport type { StyledRun, TextPose, TextStyle, TextVerticalAlign } from '@weasel-js/text';\nimport { textLineBoxes } from '@weasel-js/text';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { textCommandFromPose } from 'features/text/textCommand';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, resolveNodeStroke } from './nodePaint';\nimport { paintsPose } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\n\n/** The `data` a `kit:text` node carries. */\nexport interface 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. */\nexport function 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\nexport const 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 */\nexport function 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"],"mappings":";;;;;;;;AAgCA,SAAgBA,EAAW,GAAiB,GAAuB;CACjE,OAAO;EACL,GAAGC,EAAE;EAAG,GAAGA,EAAE;EAAG,OAAOA,EAAE;EAAO,QAAQA,EAAE;EAC1C,MAAMC,EAAE;EACR,MAAMA,EAAE;EACR,OAAOA,EAAE;EACT,MAAMA,EAAE;EACR,QAAQC,EAAkBD,EAAE,MAAM,KAAK,KAAA;EACvC,eAAeA,EAAE;CACnB;AACF;AAEA,IAAaE,IAAkD;CAC7D,IAAI;CACJ,UAAU,MACHC,EAAWC,EAAK,IAAI,IACfA,EAAK,MACL,QAAQ,OAFiB;CAiBrC,QAAQ,GAAM,MAASC,EAASD,GAAME,GAAYC,SAAY,CAC5DC,EAAoBV,EAAWM,EAAK,MAAsBG,CAAI,CAAC,CACjE,CAAC;CAUD,aAAa,GAAM,MAAS;EAC1B,IAAME,IAAQC,EAAcZ,EAAWM,EAAK,MAAsBG,CAAI,CAAC;EAEvE,OADIE,EAAM,WAAW,IAAU,OACxBE,EAAYF,CAAK;CAC1B;CAMA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMT,IAAII,EAAK;EACf,OAAO;GAAE,QAAQ;GAAM,GAAGQ,EAASX,EAAkBD,EAAE,MAAM,GAAGa,GAAK,KAAK;EAAE;CAC9E;AACF;AASA,SAAgBF,EAAY,GAAwF;CAClH,IAAMG,IAAW,IAAI,WAAWC,EAAM,SAAS,CAAC,GAC1CC,IAAS,IAAI,aAAaD,EAAM,SAAS,EAAE,GAC7CE,IAAK,GACLC,IAAM;CACV,KAAK,IAAMC,KAAKJ,GAAO;EACrB,IAAM,EAAE,MAAG,MAAG,OAAOK,GAAG,QAAQC,MAAMF;EAMtC,AALA,EAAS,OAASG,GAAQ,EAAO,OAAQC,GAAG,EAAO,OAAQC,GAC3D,EAAS,OAASC,GAAQ,EAAO,OAAQF,IAAIH,GAAG,EAAO,OAAQI,GAC/D,EAAS,OAASC,GAAQ,EAAO,OAAQF,IAAIH,GAAG,EAAO,OAAQI,IAAIH,GACnE,EAAS,OAASI,GAAQ,EAAO,OAAQF,GAAG,EAAO,OAAQC,IAAIH,GAC/D,EAAS,OAASI,GAAQ,EAAO,OAAQF,GAAG,EAAO,OAAQC,GAC3D,EAAS,OAASE;CACpB;CACA,OAAO;EAAE,MAAM;EAAW;EAAU;EAAQ,UAAU;CAAU;AAClE"}
1
+ {"version":3,"file":"textPainter.js","names":["textPoseOf","p","d","resolveNodeStroke","TEXT_PAINTER","paintsPose","node","nodeMemo","PAINT_SLOT","pose","textCommandFromPose","boxes","textLineBoxes","rectsToPath","inkReach","ctx","commands","rects","coords","ci","cmd","r","w","h","PATH_M","x","y","PATH_L","PATH_Z"],"sources":["../../../src/canvas/nodeShapes/textPainter.ts"],"sourcesContent":["import {\n PATH_L,\n PATH_M,\n PATH_Z,\n type PolygonPath\n} from '@weasel-js/geom';\nimport type { Stroke, Fill } from '@weasel-js/paint';\nimport type { StyledRun, TextPose, TextStyle, TextVerticalAlign } from '@weasel-js/text';\nimport { textLineBoxes } from '@weasel-js/text';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { nodeMemo } from 'core/scene/nodeMemo';\nimport type { RectPose } from 'core/scene/types';\nimport { textCommandFromPose } from '@weasel-js/renderer';\nimport { PAINT_SLOT } from './memo';\nimport { inkReach, resolveNodeStroke } from './nodePaint';\nimport { paintsPose } from './poseBox';\n\n/** The `data` a `kit:text` node carries. */\nexport interface TextNodeData {\n text: string;\n style?: TextStyle;\n runs?: readonly StyledRun[];\n fill?: Fill | 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. */\nexport function 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\nexport const 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 because the renderer's layout cache keys on the `ResolvedRun[]` array\n // identity: a fresh runs array per frame would leave that cache missing on every\n // draw. Both 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 `TextDrawCommand.y`.\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: the union of the line boxes is what\n // the node actually covers, so picking, lasso, and clipping stop grabbing blank space.\n //\n // `null` rather than an empty path when there are no non-blank lines: a caller\n // reading \"no silhouette\" falls back to the pose rect, which keeps an empty text\n // node pickable.\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 above is line\n // boxes, not glyph ink, so reporting outline-only text as unfilled would leave it\n // grabbable within a stroke width of a box edge and nowhere near the letters.\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 */\nexport function 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"],"mappings":";;;;;;;;AA8BA,SAAgBA,EAAW,GAAiB,GAAuB;CACjE,OAAO;EACL,GAAGC,EAAE;EAAG,GAAGA,EAAE;EAAG,OAAOA,EAAE;EAAO,QAAQA,EAAE;EAC1C,MAAMC,EAAE;EACR,MAAMA,EAAE;EACR,OAAOA,EAAE;EACT,MAAMA,EAAE;EACR,QAAQC,EAAkBD,EAAE,MAAM,KAAK,KAAA;EACvC,eAAeA,EAAE;CACnB;AACF;AAEA,IAAaE,IAAkD;CAC7D,IAAI;CACJ,UAAU,MACHC,EAAWC,EAAK,IAAI,IACfA,EAAK,MACL,QAAQ,OAFiB;CAUrC,QAAQ,GAAM,MAASC,EAASD,GAAME,GAAYC,SAAY,CAC5DC,EAAoBV,EAAWM,EAAK,MAAsBG,CAAI,CAAC,CACjE,CAAC;CAOD,aAAa,GAAM,MAAS;EAC1B,IAAME,IAAQC,EAAcZ,EAAWM,EAAK,MAAsBG,CAAI,CAAC;EAEvE,OADIE,EAAM,WAAW,IAAU,OACxBE,EAAYF,CAAK;CAC1B;CAIA,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMT,IAAII,EAAK;EACf,OAAO;GAAE,QAAQ;GAAM,GAAGQ,EAASX,EAAkBD,EAAE,MAAM,GAAGa,GAAK,KAAK;EAAE;CAC9E;AACF;AASA,SAAgBF,EAAY,GAAwF;CAClH,IAAMG,IAAW,IAAI,WAAWC,EAAM,SAAS,CAAC,GAC1CC,IAAS,IAAI,aAAaD,EAAM,SAAS,EAAE,GAC7CE,IAAK,GACLC,IAAM;CACV,KAAK,IAAMC,KAAKJ,GAAO;EACrB,IAAM,EAAE,MAAG,MAAG,OAAOK,GAAG,QAAQC,MAAMF;EAMtC,AALA,EAAS,OAASG,GAAQ,EAAO,OAAQC,GAAG,EAAO,OAAQC,GAC3D,EAAS,OAASC,GAAQ,EAAO,OAAQF,IAAIH,GAAG,EAAO,OAAQI,GAC/D,EAAS,OAASC,GAAQ,EAAO,OAAQF,IAAIH,GAAG,EAAO,OAAQI,IAAIH,GACnE,EAAS,OAASI,GAAQ,EAAO,OAAQF,GAAG,EAAO,OAAQC,IAAIH,GAC/D,EAAS,OAASI,GAAQ,EAAO,OAAQF,GAAG,EAAO,OAAQC,GAC3D,EAAS,OAASE;CACpB;CACA,OAAO;EAAE,MAAM;EAAW;EAAU;EAAQ,UAAU;CAAU;AAClE"}
@@ -1 +1 @@
1
- {"version":3,"file":"overlayRoleStrokes.js","names":["OVERLAY_ROLE_STROKES"],"sources":["../../src/canvas/overlayRoleStrokes.ts"],"sourcesContent":["import type { CommandFill, CommandStroke } from '@weasel-js/paint';\n\n/** How each `polyline` overlay role reads. An action publishes the run and\n * the word; this table is the whole of the paint, for the dispatcher overlay\n * and for any tool previewing the same kind of run between gestures. */\nexport const OVERLAY_ROLE_STROKES: Readonly<Record<string, CommandStroke & { paint: CommandFill }>> = {\n cut: { paint: { color: '#e23b3b' }, width: 1, dash: [6, 4] },\n connector: { paint: { color: '#7ba7c7' }, width: 2, dash: [4, 4] },\n};\n"],"mappings":";AAKA,IAAaA,IAAyF;CACpG,KAAK;EAAE,OAAO,EAAE,OAAO,UAAU;EAAG,OAAO;EAAG,MAAM,CAAC,GAAG,CAAC;CAAE;CAC3D,WAAW;EAAE,OAAO,EAAE,OAAO,UAAU;EAAG,OAAO;EAAG,MAAM,CAAC,GAAG,CAAC;CAAE;AACnE"}
1
+ {"version":3,"file":"overlayRoleStrokes.js","names":["OVERLAY_ROLE_STROKES"],"sources":["../../src/canvas/overlayRoleStrokes.ts"],"sourcesContent":["import type { CommandPaint, CommandStroke } from '@weasel-js/paint';\n\n/** How each `polyline` overlay role reads. An action publishes the run and\n * the word; this table is the whole of the paint, for the dispatcher overlay\n * and for any tool previewing the same kind of run between gestures. */\nexport const OVERLAY_ROLE_STROKES: Readonly<Record<string, CommandStroke & { paint: CommandPaint }>> = {\n cut: { paint: { color: '#e23b3b' }, width: 1, dash: [6, 4] },\n connector: { paint: { color: '#7ba7c7' }, width: 2, dash: [4, 4] },\n};\n"],"mappings":";AAKA,IAAaA,IAA0F;CACrG,KAAK;EAAE,OAAO,EAAE,OAAO,UAAU;EAAG,OAAO;EAAG,MAAM,CAAC,GAAG,CAAC;CAAE;CAC3D,WAAW;EAAE,OAAO,EAAE,OAAO,UAAU;EAAG,OAAO;EAAG,MAAM,CAAC,GAAG,CAAC;CAAE;AACnE"}
@@ -1,16 +1,14 @@
1
- import { mat3 as e } from "../renderer/math/mat3.js";
2
- import { viewToMat3 as t } from "../renderer/math/viewToMat3.js";
3
- import { boundsMissRect as n } from "../renderer/cullDrawCommands.js";
4
- import { poseFrameOf as r } from "../core/geometry/poseFrame.js";
1
+ import { boundsMissRect as e } from "@weasel-js/renderer";
2
+ import { mat3 as t, poseFrameOf as n, viewToMat3 as r } from "@weasel-js/geom";
5
3
  //#region src/canvas/paintCull.ts
6
4
  function i(i, a, o) {
7
- let s = a, c = t(a);
5
+ let s = a, c = r(a);
8
6
  return (l, u, d = a) => {
9
- d !== s && (s = d, c = t(d));
7
+ d !== s && (s = d, c = r(d));
10
8
  let f = i(l, u, d);
11
9
  if (!f) return !1;
12
- let p = r(u), m = p ? e.multiply(c, e.fromAffine(p)) : c;
13
- return n(f, m, o);
10
+ let p = n(u), m = p ? t.multiply(c, t.fromAffine(p)) : c;
11
+ return e(f, m, o);
14
12
  };
15
13
  }
16
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"paintCull.js","names":["paintMissesView","last","view","toScreen","viewToMat3","layerView","b","paintBounds","node","pose","frame","poseFrameOf","mat3","boundsMissRect","rect"],"sources":["../../src/canvas/paintCull.ts"],"sourcesContent":["import type { View } from 'core/viewport/view';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { poseFrameOf } from 'core/geometry/poseFrame';\nimport { boundsMissRect, type CullRect } from '../renderer/cullDrawCommands';\nimport { mat3 } from '../renderer/math/mat3';\nimport { viewToMat3 } from '../renderer/math/viewToMat3';\n\n/** Where a node's paint can reach, before its pose frame — the scene\n * slot's `paintBounds`. `null` means unknown, and the node is painted. */\nexport type PaintBoundsFn<TNode, TPose> = (node: TNode, pose: TPose, view: View) => Bounds | null;\n\n/**\n * A predicate true for the nodes whose paint cannot reach `rect` (screen\n * pixels) under `view`, by `paintBounds` taken through the pose frame\n * (`poseFrameOf`) `wrapNodeOutput` applies and then the view. A node `paintBounds` cannot\n * bound is never culled.\n */\nexport function paintMissesView<TNode, TPose>(\n paintBounds: PaintBoundsFn<TNode, TPose>,\n view: View,\n rect: CullRect,\n): (node: TNode, pose: TPose, layerView?: View) => boolean {\n // `layerView` is a parallax plane's own view; planes are few, so one slot\n // of memo covers a walk that meets them layer by layer.\n let last = view;\n let toScreen = viewToMat3(view);\n return (node, pose, layerView = view) => {\n if (layerView !== last) { last = layerView; toScreen = viewToMat3(layerView); }\n const b = paintBounds(node, pose, layerView);\n if (!b) return false;\n const frame = poseFrameOf(pose);\n const m = frame ? mat3.multiply(toScreen, mat3.fromAffine(frame)) : toScreen;\n return boundsMissRect(b, m, rect);\n };\n}\n"],"mappings":";;;;;AAiBA,SAAgBA,EACd,GACA,GACA,GACyD;CAGzD,IAAIC,IAAOC,GACPC,IAAWC,EAAWF,CAAI;CAC9B,QAAQ,GAAM,GAAM,IAAYA,MAAS;EACvC,AAAIG,MAAcJ,MAAQ,IAAOI,GAAW,IAAWD,EAAWC,CAAS;EAC3E,IAAMC,IAAIC,EAAYC,GAAMC,GAAMJ,CAAS;EAC3C,IAAI,CAACC,GAAG,OAAO;EACf,IAAMI,IAAQC,EAAYF,CAAI,GACxB,IAAIC,IAAQE,EAAK,SAAST,GAAUS,EAAK,WAAWF,CAAK,CAAC,IAAIP;EACpE,OAAOU,EAAeP,GAAG,GAAGQ,CAAI;CAClC;AACF"}
1
+ {"version":3,"file":"paintCull.js","names":["viewToMat3","mat3","mat3$1","viewToMat3$1","paintMissesView","last","view","toScreen","layerView","b","paintBounds","node","pose","frame","poseFrameOf","boundsMissRect","rect"],"sources":["../../src/canvas/paintCull.ts"],"sourcesContent":["import type { View } from 'core/viewport/view';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport { poseFrameOf } from '@weasel-js/geom';\nimport { boundsMissRect, type CullRect } from '@weasel-js/renderer';\nimport { mat3, viewToMat3 } from '@weasel-js/geom';\n\n/** Where a node's paint can reach, before its pose frame — the scene\n * slot's `paintBounds`. `null` means unknown, and the node is painted. */\nexport type PaintBoundsFn<TNode, TPose> = (node: TNode, pose: TPose, view: View) => Bounds | null;\n\n/**\n * A predicate true for the nodes whose paint cannot reach `rect` (screen\n * pixels) under `view`, by `paintBounds` taken through the pose frame\n * (`poseFrameOf`) `wrapNodeOutput` applies and then the view. A node `paintBounds` cannot\n * bound is never culled.\n */\nexport function paintMissesView<TNode, TPose>(\n paintBounds: PaintBoundsFn<TNode, TPose>,\n view: View,\n rect: CullRect,\n): (node: TNode, pose: TPose, layerView?: View) => boolean {\n // `layerView` is a parallax plane's own view; planes are few, so one slot\n // of memo covers a walk that meets them layer by layer.\n let last = view;\n let toScreen = viewToMat3(view);\n return (node, pose, layerView = view) => {\n if (layerView !== last) { last = layerView; toScreen = viewToMat3(layerView); }\n const b = paintBounds(node, pose, layerView);\n if (!b) return false;\n const frame = poseFrameOf(pose);\n const m = frame ? mat3.multiply(toScreen, mat3.fromAffine(frame)) : toScreen;\n return boundsMissRect(b, m, rect);\n };\n}\n"],"mappings":";;;AAgBA,SAAgBI,EACd,GACA,GACA,GACyD;CAGzD,IAAIC,IAAOC,GACPC,IAAWP,EAAWM,CAAI;CAC9B,QAAQ,GAAM,GAAM,IAAYA,MAAS;EACvC,AAAIE,MAAcH,MAAQ,IAAOG,GAAW,IAAWR,EAAWQ,CAAS;EAC3E,IAAMC,IAAIC,EAAYC,GAAMC,GAAMJ,CAAS;EAC3C,IAAI,CAACC,GAAG,OAAO;EACf,IAAMI,IAAQC,EAAYF,CAAI,GACxB,IAAIC,IAAQZ,EAAK,SAASM,GAAUN,EAAK,WAAWY,CAAK,CAAC,IAAIN;EACpE,OAAOQ,EAAeN,GAAG,GAAGO,CAAI;CAClC;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { pathFromD as e } from "@weasel-js/geom";
2
2
  import { GLYPHS as t, chromeLineWidthScale as n, cursorPaintMatrix as r, cursorPaintOps as i, cursorWorldSize as a } from "@weasel-js/cursor";
3
- //#region src/features/cursor/paintedCursorLayer.ts
3
+ //#region src/canvas/paintedCursorLayer.ts
4
4
  var o = "painted-cursor", s = /* @__PURE__ */ new Map();
5
5
  function c(t) {
6
6
  let n = s.get(t);
@@ -10,7 +10,7 @@ function l(e) {
10
10
  return {
11
11
  kind: "path",
12
12
  path: c(e.d),
13
- ...e.fill === void 0 ? {} : { fill: { color: e.fill } },
13
+ ...e.fill === void 0 ? {} : { fill: { paint: { color: e.fill } } },
14
14
  ...e.stroke === void 0 ? {} : { stroke: {
15
15
  paint: { color: e.stroke.color },
16
16
  width: e.stroke.width,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paintedCursorLayer.js","names":["PAINTED_CURSOR_LAYER_ID","pathCache","pathFor","p","d","pathFromD","commandFor","op","createPaintedCursorLayer","frame","state","glyph","GLYPHS","cursor","scale","view","worldSized","size","cursorWorldSize","ops","cursorPaintOps","chromeLineWidthScale","a","b","c","e","f","cursorPaintMatrix"],"sources":["../../src/canvas/paintedCursorLayer.ts"],"sourcesContent":["/**\n * The painted tier: draws a cursor glyph into the scene when it is too big,\n * or too tied to the view, to be a CSS `url()` cursor.\n *\n * Screen-space: the glyph is chrome at the pointer, so it must not pan or zoom\n * with the camera. What *does* track the camera is a world-sized glyph's size,\n * and `view.scale` is read for that.\n */\n\nimport { GLYPHS } from '@weasel-js/cursor';\nimport {\n chromeLineWidthScale,\n cursorPaintMatrix,\n cursorPaintOps,\n cursorWorldSize,\n} from '@weasel-js/cursor';\nimport type { CursorPaintOp } from '@weasel-js/cursor';\nimport type { DrawCommand, PathDrawCommand } from '@weasel-js/renderer';\nimport type { RenderLayer } from 'core/layers/render';\nimport { pathFromD, type Path } from '@weasel-js/geom';\nimport type { PaintedCursorState } from '@weasel-js/cursor';\n\n/** Layer id, so a consumer can order or hide it like any other. */\nexport const PAINTED_CURSOR_LAYER_ID = 'painted-cursor';\n\n/** Handing the renderer the same `Path` object every frame lets its mesh cache hit. */\nconst pathCache = new Map<string, Path>();\nfunction pathFor(d: string): Path {\n let p = pathCache.get(d);\n if (p === undefined) {\n p = pathFromD(d);\n pathCache.set(d, p);\n }\n return p;\n}\n\nfunction commandFor(op: CursorPaintOp): PathDrawCommand {\n return {\n kind: 'path',\n path: pathFor(op.d),\n ...(op.fill !== undefined ? { fill: { paint: { color: op.fill } } } : {}),\n ...(op.stroke !== undefined\n ? {\n stroke: {\n paint: { color: op.stroke.color },\n width: op.stroke.width,\n cap: 'round' as const,\n join: 'round' as const,\n },\n }\n : {}),\n };\n}\n\n/**\n * A screen-space layer that draws the glyph `state` currently holds at the pointer,\n * or nothing when it holds none. `<Canvas>` mounts one over its own state already.\n */\nexport function createPaintedCursorLayer(state: PaintedCursorState): RenderLayer<unknown> {\n return {\n id: PAINTED_CURSOR_LAYER_ID,\n label: 'Painted cursor',\n space: 'screen',\n draw: (_data, view) => {\n const frame = state.current();\n if (!frame) return [];\n const { cursor, at } = frame;\n const glyph = GLYPHS[cursor.glyph];\n if (!glyph) return [];\n\n // A world-sized glyph holds its line weight in CSS px while its geometry\n // grows — a ring at a 400px radius drawn with scaled weight is a filled\n // blob. A single radius needs one scale factor, so average the axes.\n const scale = (view.scale.x + view.scale.y) / 2;\n const worldSized = cursor.worldRadius !== undefined;\n const size = worldSized\n ? cursorWorldSize(glyph, cursor.worldRadius as number, scale)\n : (cursor.size ?? 24);\n if (!(size > 0) || !Number.isFinite(size)) return [];\n\n const ops = cursorPaintOps(\n glyph,\n worldSized ? { lineWidthScale: chromeLineWidthScale(glyph, size) } : {},\n );\n const [a, b, c, d, e, f] = cursorPaintMatrix(glyph, {\n size,\n angle: cursor.angle,\n at,\n });\n // Column-major, the layout `Mat3` documents.\n const transform = new Float32Array([a, b, 0, c, d, 0, e, f, 1]);\n const children: DrawCommand[] = ops.map(commandFor);\n return [{ kind: 'group', transform, children }];\n },\n };\n}\n"],"mappings":";;;AAuBA,IAAaA,IAA0B,kBAGjCC,oBAAY,IAAI,IAAkB;AACxC,SAASC,EAAQ,GAAiB;CAChC,IAAIC,IAAIF,EAAU,IAAIG,CAAC;CAKvB,OAJID,MAAM,KAAA,MACR,IAAIE,EAAUD,CAAC,GACfH,EAAU,IAAIG,GAAGD,CAAC,IAEbA;AACT;AAEA,SAASG,EAAW,GAAoC;CACtD,OAAO;EACL,MAAM;EACN,MAAMJ,EAAQK,EAAG,CAAC;EAClB,GAAIA,EAAG,SAAS,KAAA,IAAsD,CAAC,IAA3C,EAAE,MAAM,EAAE,OAAO,EAAE,OAAOA,EAAG,KAAK,EAAE,EAAE;EAClE,GAAIA,EAAG,WAAW,KAAA,IASd,CAAC,IARD,EACE,QAAQ;GACN,OAAO,EAAE,OAAOA,EAAG,OAAO,MAAM;GAChC,OAAOA,EAAG,OAAO;GACjB,KAAK;GACL,MAAM;EACR,EACF;CAEN;AACF;AAMA,SAAgBC,EAAyB,GAAiD;CACxF,OAAO;EACL,IAAIR;EACJ,OAAO;EACP,OAAO;EACP,OAAO,GAAO,MAAS;GACrB,IAAMS,IAAQC,EAAM,QAAQ;GAC5B,IAAI,CAACD,GAAO,OAAO,CAAC;GACpB,IAAM,EAAE,WAAQ,UAAOA,GACjBE,IAAQC,EAAOC,EAAO;GAC5B,IAAI,CAACF,GAAO,OAAO,CAAC;GAKpB,IAAMG,KAASC,EAAK,MAAM,IAAIA,EAAK,MAAM,KAAK,GACxCC,IAAaH,EAAO,gBAAgB,KAAA,GACpCI,IAAOD,IACTE,EAAgBP,GAAOE,EAAO,aAAuBC,CAAK,IACzDD,EAAO,QAAQ;GACpB,IAAI,EAAEI,IAAO,MAAM,CAAC,OAAO,SAASA,CAAI,GAAG,OAAO,CAAC;GAEnD,IAAME,IAAMC,EACVT,GACAK,IAAa,EAAE,gBAAgBK,EAAqBV,GAAOM,CAAI,EAAE,IAAI,CAAC,CACxE,GACM,CAACK,GAAGC,GAAGC,GAAGpB,GAAGqB,GAAGC,KAAKC,EAAkBhB,GAAO;IAClD;IACA,OAAOE,EAAO;IACd;GACF,CAAC;GAID,OAAO,CAAC;IAAE,MAAM;IAAS,WAAA,IAFH,aAAa;KAACS;KAAGC;KAAG;KAAGC;KAAGpB;KAAG;KAAGqB;KAAGC;KAAG;IAAC,CAEpC;IAAW,UADJP,EAAI,IAAIb,CACJ;GAAS,CAAC;EAChD;CACF;AACF"}