@weasel-js/core 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/README.md +33 -0
  3. package/dist/affordances/composeAffordanceLayer.js +21 -21
  4. package/dist/affordances/composeAffordanceLayer.js.map +1 -1
  5. package/dist/affordances/hitAffordanceRegions.js +48 -32
  6. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  7. package/dist/affordances/pathAnchors.js +50 -28
  8. package/dist/affordances/pathAnchors.js.map +1 -1
  9. package/dist/affordances/rotateCursor.js +12 -0
  10. package/dist/affordances/rotateCursor.js.map +1 -0
  11. package/dist/affordances/rotationHandle.js +40 -43
  12. package/dist/affordances/rotationHandle.js.map +1 -1
  13. package/dist/animation/rig/rigNode.js +9 -3
  14. package/dist/animation/rig/rigNode.js.map +1 -1
  15. package/dist/animation/rig/rigSeat.js +46 -13
  16. package/dist/animation/rig/rigSeat.js.map +1 -1
  17. package/dist/animation/rig/skinBinding.js +22 -14
  18. package/dist/animation/rig/skinBinding.js.map +1 -1
  19. package/dist/barrel/canvas.js +29 -28
  20. package/dist/barrel/interactions.js +33 -32
  21. package/dist/barrel/paths.js +11 -10
  22. package/dist/barrel/routing.js +49 -48
  23. package/dist/barrel/scene.js +10 -10
  24. package/dist/barrel/viewport.js +24 -21
  25. package/dist/canvas/Canvas.js +6 -17
  26. package/dist/canvas/Canvas.js.map +1 -1
  27. package/dist/canvas/CanvasView.js +34 -37
  28. package/dist/canvas/CanvasView.js.map +1 -1
  29. package/dist/canvas/CursorCoordsHud.js +3 -3
  30. package/dist/canvas/CursorCoordsHud.js.map +1 -1
  31. package/dist/canvas/DrawCanvas.js +3 -3
  32. package/dist/canvas/DrawCanvas.js.map +1 -1
  33. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +24 -23
  34. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  35. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +40 -49
  36. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -1
  37. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +297 -259
  38. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  39. package/dist/canvas/SceneCanvas/features.js +3 -24
  40. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  41. package/dist/canvas/SceneCanvas/insertPreviewCommands.js +97 -0
  42. package/dist/canvas/SceneCanvas/insertPreviewCommands.js.map +1 -0
  43. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
  44. package/dist/canvas/SceneCanvas/props.js.map +1 -1
  45. package/dist/canvas/SceneCanvas/scenePointQuery.js +50 -0
  46. package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -0
  47. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +52 -0
  48. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -0
  49. package/dist/canvas/SceneCanvas/useActionTunings.js +17 -0
  50. package/dist/canvas/SceneCanvas/useActionTunings.js.map +1 -0
  51. package/dist/canvas/SceneCanvas/useCanvasCamera.js +37 -29
  52. package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -1
  53. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +11 -11
  54. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -1
  55. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +45 -109
  56. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
  57. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +49 -41
  58. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
  59. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +64 -96
  60. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  61. package/dist/canvas/SceneCanvas/worldPointAt.js +3 -4
  62. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -1
  63. package/dist/canvas/SceneCanvas.js +77 -80
  64. package/dist/canvas/SceneCanvas.js.map +1 -1
  65. package/dist/canvas/SceneViewCanvas.js +3 -3
  66. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  67. package/dist/canvas/SurfaceCanvas.js +40 -0
  68. package/dist/canvas/SurfaceCanvas.js.map +1 -0
  69. package/dist/canvas/adapterDerivedPath.js +13 -13
  70. package/dist/canvas/adapterDerivedPath.js.map +1 -1
  71. package/dist/canvas/adapterPickSource.js +34 -0
  72. package/dist/canvas/adapterPickSource.js.map +1 -0
  73. package/dist/canvas/affordanceAt.js +1 -1
  74. package/dist/canvas/affordanceAt.js.map +1 -1
  75. package/dist/canvas/buildSceneLayer.js.map +1 -1
  76. package/dist/canvas/buildSceneTree.js +56 -34
  77. package/dist/canvas/buildSceneTree.js.map +1 -1
  78. package/dist/canvas/copiesAbove.js +27 -0
  79. package/dist/canvas/copiesAbove.js.map +1 -0
  80. package/dist/canvas/defaultDrawOne.js +24 -23
  81. package/dist/canvas/defaultDrawOne.js.map +1 -1
  82. package/dist/canvas/deps/editAnchors.js +45 -50
  83. package/dist/canvas/deps/editAnchors.js.map +1 -1
  84. package/dist/canvas/deps/hitTestArea.js +30 -15
  85. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  86. package/dist/canvas/deps/insert.js +134 -100
  87. package/dist/canvas/deps/insert.js.map +1 -1
  88. package/dist/canvas/deps/layout.js +9 -15
  89. package/dist/canvas/deps/layout.js.map +1 -1
  90. package/dist/canvas/derivedPath.js +53 -29
  91. package/dist/canvas/derivedPath.js.map +1 -1
  92. package/dist/canvas/insertPreviewExtent.js +33 -31
  93. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  94. package/dist/canvas/overChildren.js +29 -0
  95. package/dist/canvas/overChildren.js.map +1 -0
  96. package/dist/canvas/paintedCursorLayer.js.map +1 -1
  97. package/dist/canvas/pickReach.js +23 -0
  98. package/dist/canvas/pickReach.js.map +1 -0
  99. package/dist/canvas/pickWalk.js +51 -80
  100. package/dist/canvas/pickWalk.js.map +1 -1
  101. package/dist/canvas/sceneAdapter.js +14 -35
  102. package/dist/canvas/sceneAdapter.js.map +1 -1
  103. package/dist/canvas/sceneSlotWiring.js +11 -10
  104. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  105. package/dist/canvas/sceneViewRender.js +38 -44
  106. package/dist/canvas/sceneViewRender.js.map +1 -1
  107. package/dist/canvas/useCanvasView.js +42 -44
  108. package/dist/canvas/useCanvasView.js.map +1 -1
  109. package/dist/canvas/useSceneAdapter.js +22 -0
  110. package/dist/canvas/useSceneAdapter.js.map +1 -0
  111. package/dist/canvas/useSurfaceInput.js +13 -16
  112. package/dist/canvas/useSurfaceInput.js.map +1 -1
  113. package/dist/canvas/viewRegistry.js +31 -23
  114. package/dist/canvas/viewRegistry.js.map +1 -1
  115. package/dist/canvas/wrapNodeOutput.js +7 -2
  116. package/dist/canvas/wrapNodeOutput.js.map +1 -1
  117. package/dist/clipboard.d.ts +1 -1
  118. package/dist/{clone-2a5hVbBd.d.ts → clone-C0eADtS0.d.ts} +13 -13
  119. package/dist/clone.d.ts +2 -2
  120. package/dist/core/geometry/poseDescriptor.js +49 -23
  121. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  122. package/dist/core/geometry/regionHit.js +2 -2
  123. package/dist/core/geometry/regionHit.js.map +1 -1
  124. package/dist/core/geometry/targetFrame.js.map +1 -1
  125. package/dist/core/layers/children.js +1 -3
  126. package/dist/core/layers/children.js.map +1 -1
  127. package/dist/core/ops/create.js +2 -2
  128. package/dist/core/ops/create.js.map +1 -1
  129. package/dist/core/ops/delete.js +19 -23
  130. package/dist/core/ops/delete.js.map +1 -1
  131. package/dist/core/ops/reorder/index.js +3 -7
  132. package/dist/core/ops/reorder/index.js.map +1 -1
  133. package/dist/core/ops/reorder/setChildOrder.js +2 -4
  134. package/dist/core/ops/reorder/setChildOrder.js.map +1 -1
  135. package/dist/core/ops/reparent.js +0 -1
  136. package/dist/core/ops/reparent.js.map +1 -1
  137. package/dist/core/ops/slot.js +3 -6
  138. package/dist/core/ops/slot.js.map +1 -1
  139. package/dist/core/pages/fitViewToPage.js +15 -0
  140. package/dist/core/pages/fitViewToPage.js.map +1 -0
  141. package/dist/core/pages/pages.js +65 -0
  142. package/dist/core/pages/pages.js.map +1 -0
  143. package/dist/core/pages/pagesLayer.js +27 -0
  144. package/dist/core/pages/pagesLayer.js.map +1 -0
  145. package/dist/core/paint/meshKindLazy.js +2 -2
  146. package/dist/core/paint/meshKindLazy.js.map +1 -1
  147. package/dist/core/scene/NodeProperties.js.map +1 -1
  148. package/dist/core/scene/composeFrame.js.map +1 -1
  149. package/dist/core/scene/composePose.js +58 -20
  150. package/dist/core/scene/composePose.js.map +1 -1
  151. package/dist/core/scene/effectivePose.js +5 -1
  152. package/dist/core/scene/effectivePose.js.map +1 -1
  153. package/dist/core/scene/historyFacade.js +19 -13
  154. package/dist/core/scene/historyFacade.js.map +1 -1
  155. package/dist/core/scene/nodeFnFields.js +7 -0
  156. package/dist/core/scene/nodeFnFields.js.map +1 -1
  157. package/dist/core/scene/outerOps.js +2 -1
  158. package/dist/core/scene/outerOps.js.map +1 -1
  159. package/dist/core/scene/reconcileSpecs.js +1 -1
  160. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  161. package/dist/core/scene/sceneRecording.js +2 -1
  162. package/dist/core/scene/sceneRecording.js.map +1 -1
  163. package/dist/core/scene/types.js.map +1 -1
  164. package/dist/core/viewport/screenSlop.js.map +1 -1
  165. package/dist/core/viewport/useDecayLoop.js +28 -30
  166. package/dist/core/viewport/useDecayLoop.js.map +1 -1
  167. package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -1
  168. package/dist/core/viewport/useViewAnimation.js +70 -69
  169. package/dist/core/viewport/useViewAnimation.js.map +1 -1
  170. package/dist/core/viewport/view.js +8 -5
  171. package/dist/core/viewport/view.js.map +1 -1
  172. package/dist/core/viewport/zoomAt.js +11 -2
  173. package/dist/core/viewport/zoomAt.js.map +1 -1
  174. package/dist/{cornerHandles-BEshc4z3.d.ts → cornerHandles-BSKbyuvQ.d.ts} +1 -1
  175. package/dist/features/paths/editablePath.js +24 -8
  176. package/dist/features/paths/editablePath.js.map +1 -1
  177. package/dist/features/paths/index.js +4 -4
  178. package/dist/features/paths/shapeGenerator.js +89 -0
  179. package/dist/features/paths/shapeGenerator.js.map +1 -0
  180. package/dist/features/paths/usePathEdit.js +13 -13
  181. package/dist/features/poseRun/usePoseRun.js +25 -25
  182. package/dist/features/poseRun/usePoseRun.js.map +1 -1
  183. package/dist/features/text/useSceneTextEdit.js +82 -64
  184. package/dist/features/text/useSceneTextEdit.js.map +1 -1
  185. package/dist/features/viewports/viewResolver.js +28 -24
  186. package/dist/features/viewports/viewResolver.js.map +1 -1
  187. package/dist/icons/SliceIcon.js +24 -0
  188. package/dist/icons/SliceIcon.js.map +1 -0
  189. package/dist/index.d.ts +956 -581
  190. package/dist/index.js +260 -251
  191. package/dist/interactions/actions/align/align.js +9 -9
  192. package/dist/interactions/actions/align/align.js.map +1 -1
  193. package/dist/interactions/actions/booleans/booleans.js +18 -18
  194. package/dist/interactions/actions/booleans/booleans.js.map +1 -1
  195. package/dist/interactions/actions/booleans/operands.js.map +1 -1
  196. package/dist/interactions/actions/clone/action.js +35 -30
  197. package/dist/interactions/actions/clone/action.js.map +1 -1
  198. package/dist/interactions/actions/defaults/anchorEditing.js +56 -59
  199. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  200. package/dist/interactions/actions/defaults/anchorHandles.js +42 -0
  201. package/dist/interactions/actions/defaults/anchorHandles.js.map +1 -0
  202. package/dist/interactions/actions/defaults/anchorJoin.js +92 -0
  203. package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -0
  204. package/dist/interactions/actions/defaults/bendSegment.js +46 -0
  205. package/dist/interactions/actions/defaults/bendSegment.js.map +1 -0
  206. package/dist/interactions/actions/defaults/copySubtree.js +1 -1
  207. package/dist/interactions/actions/defaults/copySubtree.js.map +1 -1
  208. package/dist/interactions/actions/defaults/duplicate.js +32 -17
  209. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  210. package/dist/interactions/actions/defaults/enterPathEdit.js +19 -7
  211. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
  212. package/dist/interactions/actions/defaults/icons/anchorIcons.js +75 -0
  213. package/dist/interactions/actions/defaults/icons/anchorIcons.js.map +1 -0
  214. package/dist/interactions/actions/defaults/icons/editIcons.js +35 -8
  215. package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -1
  216. package/dist/interactions/actions/defaults/insertPathAnchor.js +16 -31
  217. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  218. package/dist/interactions/actions/defaults/nudge.js +28 -23
  219. package/dist/interactions/actions/defaults/nudge.js.map +1 -1
  220. package/dist/interactions/actions/defaults/pinchZoom.js +29 -29
  221. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
  222. package/dist/interactions/actions/defaults/segmentUnder.js +22 -0
  223. package/dist/interactions/actions/defaults/segmentUnder.js.map +1 -0
  224. package/dist/interactions/actions/defaults/viewportZoom.js +82 -79
  225. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
  226. package/dist/interactions/actions/distribute/distribute.js +8 -8
  227. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  228. package/dist/interactions/actions/edit-anchors/action.js +58 -55
  229. package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
  230. package/dist/interactions/actions/edit-anchors/preview.js +26 -0
  231. package/dist/interactions/actions/edit-anchors/preview.js.map +1 -0
  232. package/dist/interactions/actions/edit-anchors/symmetry.js +11 -0
  233. package/dist/interactions/actions/edit-anchors/symmetry.js.map +1 -0
  234. package/dist/interactions/actions/flip/action.js.map +1 -1
  235. package/dist/interactions/actions/geometryProjection.js.map +1 -1
  236. package/dist/interactions/actions/insert/action.js +37 -30
  237. package/dist/interactions/actions/insert/action.js.map +1 -1
  238. package/dist/interactions/actions/insert/frame.js +9 -2
  239. package/dist/interactions/actions/insert/frame.js.map +1 -1
  240. package/dist/interactions/actions/insert/repositionAction.js +31 -0
  241. package/dist/interactions/actions/insert/repositionAction.js.map +1 -0
  242. package/dist/interactions/actions/lasso-select/action.js +32 -32
  243. package/dist/interactions/actions/move/action.js +29 -25
  244. package/dist/interactions/actions/move/action.js.map +1 -1
  245. package/dist/interactions/actions/move/behaviors/snapToContainer.js +12 -6
  246. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  247. package/dist/interactions/actions/move/capture.js +32 -23
  248. package/dist/interactions/actions/move/capture.js.map +1 -1
  249. package/dist/interactions/actions/move/frame.js +2 -14
  250. package/dist/interactions/actions/move/frame.js.map +1 -1
  251. package/dist/interactions/actions/move/session.js +1 -1
  252. package/dist/interactions/actions/move/session.js.map +1 -1
  253. package/dist/interactions/actions/move/translate.js.map +1 -1
  254. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  255. package/dist/interactions/actions/outlines/replaceWithPaths.js +13 -13
  256. package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -1
  257. package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -1
  258. package/dist/interactions/actions/pathCommands/cutJoin.js +102 -0
  259. package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -0
  260. package/dist/interactions/actions/pathCommands/livePathEdit.js +64 -0
  261. package/dist/interactions/actions/pathCommands/livePathEdit.js.map +1 -0
  262. package/dist/interactions/actions/pathCommands/pathNodes.js +99 -0
  263. package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -0
  264. package/dist/interactions/actions/pathCommands/simplifyOffset.js +42 -0
  265. package/dist/interactions/actions/pathCommands/simplifyOffset.js.map +1 -0
  266. package/dist/interactions/actions/resize/action.js +31 -20
  267. package/dist/interactions/actions/resize/action.js.map +1 -1
  268. package/dist/interactions/actions/resize/commit.js.map +1 -1
  269. package/dist/interactions/actions/resize/frame.js +29 -15
  270. package/dist/interactions/actions/resize/frame.js.map +1 -1
  271. package/dist/interactions/actions/resize/replay.js +47 -0
  272. package/dist/interactions/actions/resize/replay.js.map +1 -0
  273. package/dist/interactions/actions/resize/session.js +49 -35
  274. package/dist/interactions/actions/resize/session.js.map +1 -1
  275. package/dist/interactions/actions/resolveOverlays.js +2 -1
  276. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  277. package/dist/interactions/actions/rotate/action.js +40 -25
  278. package/dist/interactions/actions/rotate/action.js.map +1 -1
  279. package/dist/interactions/actions/rotate/frame.js +1 -1
  280. package/dist/interactions/actions/rotate/frame.js.map +1 -1
  281. package/dist/interactions/actions/rotate/replay.js +22 -0
  282. package/dist/interactions/actions/rotate/replay.js.map +1 -0
  283. package/dist/interactions/actions/rotate/session.js +42 -32
  284. package/dist/interactions/actions/rotate/session.js.map +1 -1
  285. package/dist/interactions/actions/transform-again/action.js +63 -0
  286. package/dist/interactions/actions/transform-again/action.js.map +1 -0
  287. package/dist/interactions/actions/transform-again/memory.js +35 -0
  288. package/dist/interactions/actions/transform-again/memory.js.map +1 -0
  289. package/dist/interactions/actions/useStandardActions.js +101 -83
  290. package/dist/interactions/actions/useStandardActions.js.map +1 -1
  291. package/dist/move.d.ts +4 -4
  292. package/dist/{originProjection-PPT88jZv.d.ts → originProjection-CoNVpITV.d.ts} +1 -1
  293. package/dist/resize.d.ts +3 -3
  294. package/dist/style.css +1 -1
  295. package/dist/tools/builtin/ellipse/useEllipseTool.js +16 -15
  296. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
  297. package/dist/tools/builtin/line/useLineTool.js +16 -15
  298. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  299. package/dist/tools/builtin/pen/usePenTool.js +111 -111
  300. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  301. package/dist/tools/builtin/pickTopMostHit.js +11 -14
  302. package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
  303. package/dist/tools/builtin/polygon/usePolygonTool.js +17 -15
  304. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  305. package/dist/tools/builtin/rect/useRectTool.js +15 -14
  306. package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
  307. package/dist/tools/builtin/select/adapterPointQuery.js +22 -18
  308. package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -1
  309. package/dist/tools/builtin/select/selectionContributions.js +1 -1
  310. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  311. package/dist/tools/builtin/select/useSelectTool.js +2 -1
  312. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  313. package/dist/tools/builtin/slice/useSliceTool.js +42 -40
  314. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  315. package/dist/tools/builtin/star/useStarTool.js +18 -16
  316. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  317. package/dist/tools/builtin/text/useTextTool.js +2 -2
  318. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  319. package/dist/{types-CIKDwlsP.d.ts → types-DBbbCy0i.d.ts} +22 -15
  320. package/dist/version.js +1 -1
  321. package/package.json +22 -22
  322. package/dist/canvas/surface.module.js +0 -6
  323. package/dist/canvas/surface.module.js.map +0 -1
  324. package/dist/canvas/surfaceBox.js +0 -16
  325. package/dist/canvas/surfaceBox.js.map +0 -1
  326. package/dist/layout/arrivals.js +0 -33
  327. package/dist/layout/arrivals.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rigNode.js","names":["through","m","x","y","placeSkeleton","AUTO_POSE_DESCRIPTOR","box","descriptor","pose","frame","poseFrameOf","turn","skeleton","joint","unplaceSkeleton","inverse","poseFrameInverseOf","UNPAINTED","noWord","unpainted","read","node","scene","id","local","out","walk","child","parent","n","data","skin","painted","sameRefs","a","b","r","i","rigFromNode","useRigNode","options","version","useSyncExternalStore","painting","next","useMemo","held","setHeld","useState","parts","joints","seat","createRigSeat","useSeatedRig"],"sources":["../../../src/animation/rig/rigNode.ts"],"sourcesContent":["import { useMemo, useState, useSyncExternalStore } from 'react';\nimport { poseFrameInverseOf, poseFrameOf } from '@weasel-js/geom';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId } from '../../core/scene/types';\nimport type { BindRigOptions, Rig, RigScene } from './bindRig';\nimport type { Skin } from '@weasel-js/animator';\nimport type { Skeleton } from '@weasel-js/animator';\nimport { createRigSeat } from './rigSeat';\nimport { useSeatedRig } from './useRig';\n\n/** What a rig reads from node data: a `skeleton` on the node that is the rig, and on the nodes\n * under it a `skin` for a path that bends or a `joint` for a node that rides one whole. */\nexport interface RigNodeData {\n /** Joints relative to the node's pose: its box's top-left corner, turned as the node is. */\n skeleton?: Skeleton;\n skin?: Skin;\n joint?: string;\n}\n\n/** Weights to bind in place of the document's, and word of when they change. A `RigEditState`\n * is one: it holds what a stroke of the weight tool has painted and not yet written. */\nexport interface PaintedSkins {\n /** By node. A new map whenever the weights change. */\n painted(): ReadonlyMap<NodeId, Skin>;\n listen(fn: () => void): () => void;\n}\n\n/** The part of a scene `rigFromNode` reads. */\nexport interface RigNodeSource<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n childrenOf(id: NodeId): readonly NodeId[];\n}\n\n/** The skeleton, bindings, and skins a rig node declares, as `bindRig` takes them. */\nexport interface RigNodeParts {\n skeleton: Skeleton;\n bindings: Record<string, NodeId[]>;\n skins: Record<NodeId, Skin>;\n}\n\ninterface Reading extends RigNodeParts {\n /** Every node, pose, and data object the parts were read from, to tell when they are stale. */\n refs: unknown[];\n}\n\ntype Affine = readonly [number, number, number, number, number, number];\nconst through = (m: Affine | null, x: number, y: number): [number, number] =>\n (m ? [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]] : [x, y]);\n\n/**\n * A skeleton as a rig node's data keeps it, moved to where the node's pose puts it: its root\n * joints are offset from the pose box's top-left corner and turned as the node is. Joints\n * under a root are relative to their parents and are left as they are.\n */\nexport function placeSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const frame = poseFrameOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(frame, box.x + joint.bind.x, box.y + joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x, y, rotation: joint.bind.rotation + turn } };\n }),\n };\n}\n\n/** The inverse of {@link placeSkeleton}: a skeleton in the scene's space, as the node at\n * `pose` would keep it in its data. */\nexport function unplaceSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const inverse = poseFrameInverseOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(inverse, joint.bind.x, joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x: x - box.x, y: y - box.y, rotation: joint.bind.rotation - turn } };\n }),\n };\n}\n\nconst UNPAINTED: ReadonlyMap<NodeId, Skin> = new Map();\nconst noWord = (): (() => void) => () => {};\nconst unpainted = (): ReadonlyMap<NodeId, Skin> => UNPAINTED;\n\nfunction read<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose>,\n painted: ReadonlyMap<NodeId, Skin> = UNPAINTED,\n): Reading {\n const node = scene.get(id);\n if (!node) throw new Error(`rigFromNode: the rig is node \"${id}\", which the scene lacks.`);\n const local = (node.data as RigNodeData | null | undefined)?.skeleton;\n if (!local) throw new Error(`rigFromNode: node \"${id}\" has no skeleton in its data.`);\n\n const skeleton = placeSkeleton(local, node.pose, descriptor);\n\n const out: Reading = { skeleton, bindings: {}, skins: {}, refs: [node.pose, node.data] };\n const walk = (parent: NodeId): void => {\n for (const child of scene.childrenOf(parent)) {\n const n = scene.get(child);\n if (!n) continue;\n const data = n.data as RigNodeData | null | undefined;\n const skin = painted.get(child) ?? data?.skin;\n out.refs.push(child, n.pose, n.data, skin);\n if (skin) out.skins[child] = skin;\n else if (data?.joint !== undefined) (out.bindings[data.joint] ??= []).push(child);\n walk(child);\n }\n };\n walk(id);\n return out;\n}\n\nconst sameRefs = (a: Reading, b: Reading): boolean =>\n a === b || (a.refs.length === b.refs.length && a.refs.every((r, i) => r === b.refs[i]));\n\n/**\n * Read a rig out of the scene: the skeleton in `id`'s `data.skeleton`, placed by that node's\n * pose, and under it every node whose data has a `skin` or names a `joint`.\n */\nexport function rigFromNode<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): RigNodeParts {\n const { skeleton, bindings, skins } = read(scene, id, descriptor);\n return { skeleton, bindings, skins };\n}\n\n/** Options for `useRigNode`. */\nexport interface UseRigNodeOptions<TPose>\n extends Pick<BindRigOptions<TPose>, 'apply' | 'descriptor' | 'restPath'> {\n scene: RigScene<TPose> & RigNodeSource<TPose> & {\n subscribe(listener: () => void): () => void;\n getVersion(): number;\n };\n /** The node whose data holds the skeleton. */\n node: NodeId;\n /** Weights bound in place of a node's `data.skin` while they are held. Give it the\n * `RigEditState` the weight tool has, and a stroke bends the path as it is painted. */\n painting?: PaintedSkins;\n}\n\n/**\n * A {@link Rig} read from a node, as {@link rigFromNode} reads it. It is bound again when the\n * rig node or a node under it changes its pose or data, or when nodes under it come or go; an\n * edit elsewhere in the scene leaves it alone. A rig bound again keeps its `target`, with the\n * animations running on it, its committed pose, and its placement, unless the skeleton's\n * joints were added, removed, renamed, or reordered: then it starts at the bind pose with a\n * new `target`.\n */\nexport function useRigNode<TPose>(options: UseRigNodeOptions<TPose>): Rig {\n const { scene, node, apply, descriptor, restPath, painting } = options;\n const version = useSyncExternalStore(scene.subscribe, scene.getVersion);\n const painted = useSyncExternalStore(painting?.listen ?? noWord, painting?.painted ?? unpainted);\n const next = useMemo(\n () => read(scene, node, descriptor ?? (AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>), painted),\n // `version` is what says the scene may answer differently.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [scene, node, descriptor, version, painted],\n );\n // Each read makes new objects; the rig must outlive a read that found nothing changed.\n const [held, setHeld] = useState(next);\n const parts = sameRefs(held, next) ? held : next;\n if (parts !== held) setHeld(next);\n const joints = JSON.stringify(parts.skeleton.joints.map((joint) => joint.name));\n // A pose target's axes are its joints' names in order, so the seat holds while those do.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const seat = useMemo(() => createRigSeat(parts.skeleton), [joints]);\n return useSeatedRig({\n scene, skeleton: parts.skeleton, bindings: parts.bindings, skins: parts.skins, apply, descriptor, restPath,\n }, seat);\n}\n"],"mappings":";;;;;;AA+CA,IAAMA,KAAW,GAAkB,GAAW,MAC3CC,IAAI,CAACA,EAAE,KAAKC,IAAID,EAAE,KAAKE,IAAIF,EAAE,IAAIA,EAAE,KAAKC,IAAID,EAAE,KAAKE,IAAIF,EAAE,EAAE,IAAI,CAACC,GAAGC,CAAC;AAOvE,SAAgBC,EACd,GACA,GACA,IAAoCC,GAC1B;CACV,IAAMC,IAAMC,EAAW,UAAUC,CAAI,GAC/BC,IAAQC,EAAYF,CAAI,GACxBG,IAAOJ,EAAW,cAAcC,CAAI,KAAK;CAC/C,OAAO,EACL,QAAQI,EAAS,OAAO,KAAK,MAAU;EACrC,IAAIC,EAAM,UAAU,MAAM,OAAOA;EACjC,IAAM,CAACX,GAAGC,KAAKH,EAAQS,GAAOH,EAAI,IAAIO,EAAM,KAAK,GAAGP,EAAI,IAAIO,EAAM,KAAK,CAAC;EACxE,OAAO;GAAE,GAAGA;GAAO,MAAM;IAAE,GAAGA,EAAM;IAAM;IAAG;IAAG,UAA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M;EAAU,OAAOA,EAAM;EAAO;EAAO;EAAY;CACpG,GAAGE,CAAI;AACT"}
1
+ {"version":3,"file":"rigNode.js","names":["through","m","x","y","placeSkeleton","AUTO_POSE_DESCRIPTOR","box","descriptor","pose","frame","poseFrameOf","turn","skeleton","joint","unplaceSkeleton","inverse","poseFrameInverseOf","UNPAINTED","noWord","unpainted","read","node","scene","id","local","out","walk","child","parent","n","data","skin","painted","sameRefs","a","b","r","i","rigFromNode","useRigNode","options","version","useSyncExternalStore","painting","next","useMemo","held","setHeld","useState","parts","joints","seated","setSeated","createRigSeat","useSeatedRig","seat"],"sources":["../../../src/animation/rig/rigNode.ts"],"sourcesContent":["import { useMemo, useState, useSyncExternalStore } from 'react';\nimport { poseFrameInverseOf, poseFrameOf } from '@weasel-js/geom';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId } from '../../core/scene/types';\nimport type { BindRigOptions, Rig, RigScene } from './bindRig';\nimport type { Skin } from '@weasel-js/animator';\nimport type { Skeleton } from '@weasel-js/animator';\nimport { createRigSeat } from './rigSeat';\nimport { useSeatedRig } from './useRig';\n\n/** What a rig reads from node data: a `skeleton` on the node that is the rig, and on the nodes\n * under it a `skin` for a path that bends or a `joint` for a node that rides one whole. */\nexport interface RigNodeData {\n /** Joints relative to the node's pose: its box's top-left corner, turned as the node is. */\n skeleton?: Skeleton;\n skin?: Skin;\n joint?: string;\n}\n\n/** Weights to bind in place of the document's, and word of when they change. A `RigEditState`\n * is one: it holds what a stroke of the weight tool has painted and not yet written. */\nexport interface PaintedSkins {\n /** By node. A new map whenever the weights change. */\n painted(): ReadonlyMap<NodeId, Skin>;\n listen(fn: () => void): () => void;\n}\n\n/** The part of a scene `rigFromNode` reads. */\nexport interface RigNodeSource<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n childrenOf(id: NodeId): readonly NodeId[];\n}\n\n/** The skeleton, bindings, and skins a rig node declares, as `bindRig` takes them. */\nexport interface RigNodeParts {\n skeleton: Skeleton;\n bindings: Record<string, NodeId[]>;\n skins: Record<NodeId, Skin>;\n}\n\ninterface Reading extends RigNodeParts {\n /** Every node, pose, and data object the parts were read from, to tell when they are stale. */\n refs: unknown[];\n}\n\ntype Affine = readonly [number, number, number, number, number, number];\nconst through = (m: Affine | null, x: number, y: number): [number, number] =>\n (m ? [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]] : [x, y]);\n\n/**\n * A skeleton as a rig node's data keeps it, moved to where the node's pose puts it: its root\n * joints are offset from the pose box's top-left corner and turned as the node is. Joints\n * under a root are relative to their parents and are left as they are.\n */\nexport function placeSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const frame = poseFrameOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(frame, box.x + joint.bind.x, box.y + joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x, y, rotation: joint.bind.rotation + turn } };\n }),\n };\n}\n\n/** The inverse of {@link placeSkeleton}: a skeleton in the scene's space, as the node at\n * `pose` would keep it in its data. */\nexport function unplaceSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const inverse = poseFrameInverseOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(inverse, joint.bind.x, joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x: x - box.x, y: y - box.y, rotation: joint.bind.rotation - turn } };\n }),\n };\n}\n\nconst UNPAINTED: ReadonlyMap<NodeId, Skin> = new Map();\nconst noWord = (): (() => void) => () => {};\nconst unpainted = (): ReadonlyMap<NodeId, Skin> => UNPAINTED;\n\nfunction read<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose>,\n painted: ReadonlyMap<NodeId, Skin> = UNPAINTED,\n): Reading {\n const node = scene.get(id);\n if (!node) throw new Error(`rigFromNode: the rig is node \"${id}\", which the scene lacks.`);\n const local = (node.data as RigNodeData | null | undefined)?.skeleton;\n if (!local) throw new Error(`rigFromNode: node \"${id}\" has no skeleton in its data.`);\n\n const skeleton = placeSkeleton(local, node.pose, descriptor);\n\n const out: Reading = { skeleton, bindings: {}, skins: {}, refs: [node.pose, node.data] };\n const walk = (parent: NodeId): void => {\n for (const child of scene.childrenOf(parent)) {\n const n = scene.get(child);\n if (!n) continue;\n const data = n.data as RigNodeData | null | undefined;\n const skin = painted.get(child) ?? data?.skin;\n out.refs.push(child, n.pose, n.data, skin);\n if (skin) out.skins[child] = skin;\n else if (data?.joint !== undefined) (out.bindings[data.joint] ??= []).push(child);\n walk(child);\n }\n };\n walk(id);\n return out;\n}\n\nconst sameRefs = (a: Reading, b: Reading): boolean =>\n a === b || (a.refs.length === b.refs.length && a.refs.every((r, i) => r === b.refs[i]));\n\n/**\n * Read a rig out of the scene: the skeleton in `id`'s `data.skeleton`, placed by that node's\n * pose, and under it every node whose data has a `skin` or names a `joint`.\n */\nexport function rigFromNode<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): RigNodeParts {\n const { skeleton, bindings, skins } = read(scene, id, descriptor);\n return { skeleton, bindings, skins };\n}\n\n/** Options for `useRigNode`. */\nexport interface UseRigNodeOptions<TPose>\n extends Pick<BindRigOptions<TPose>, 'apply' | 'descriptor' | 'restPath'> {\n scene: RigScene<TPose> & RigNodeSource<TPose> & {\n subscribe(listener: () => void): () => void;\n getVersion(): number;\n };\n /** The node whose data holds the skeleton. */\n node: NodeId;\n /** Weights bound in place of a node's `data.skin` while they are held. Give it the\n * `RigEditState` the weight tool has, and a stroke bends the path as it is painted. */\n painting?: PaintedSkins;\n}\n\n/**\n * A {@link Rig} read from a node, as {@link rigFromNode} reads it. It is bound again when the\n * rig node or a node under it changes its pose or data, or when nodes under it come or go; an\n * edit elsewhere in the scene leaves it alone. A rig bound again keeps its `target`, with the\n * animations running on it, its committed pose, and its placement, unless the skeleton's\n * joints were added, removed, renamed, or reordered. Then it has a new `target`, which takes\n * over the placement and the pose of every joint the skeleton still names. Animations go on\n * running on the target they were started on and show through the new one, so a joint that\n * was renamed stops moving.\n */\nexport function useRigNode<TPose>(options: UseRigNodeOptions<TPose>): Rig {\n const { scene, node, apply, descriptor, restPath, painting } = options;\n const version = useSyncExternalStore(scene.subscribe, scene.getVersion);\n const painted = useSyncExternalStore(painting?.listen ?? noWord, painting?.painted ?? unpainted);\n const next = useMemo(\n () => read(scene, node, descriptor ?? (AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>), painted),\n // `version` is what says the scene may answer differently.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [scene, node, descriptor, version, painted],\n );\n // Each read makes new objects; the rig must outlive a read that found nothing changed.\n const [held, setHeld] = useState(next);\n const parts = sameRefs(held, next) ? held : next;\n if (parts !== held) setHeld(next);\n const joints = JSON.stringify(parts.skeleton.joints.map((joint) => joint.name));\n // A pose target's axes are its joints' names in order, so the seat holds while those do,\n // and the next one takes over from it.\n const [seated, setSeated] = useState(() => ({ joints, seat: createRigSeat(parts.skeleton) }));\n let { seat } = seated;\n if (seated.joints !== joints) {\n seat = createRigSeat(parts.skeleton, seated.seat);\n setSeated({ joints, seat });\n }\n return useSeatedRig({\n scene, skeleton: parts.skeleton, bindings: parts.bindings, skins: parts.skins, apply, descriptor, restPath,\n }, seat);\n}\n"],"mappings":";;;;;;AA+CA,IAAMA,KAAW,G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,gBAAaC,GACzDC,IAAUC,EAAqBpB,EAAM,WAAWA,EAAM,UAAU,GAChEU,IAAUU,EAAqBC,GAAU,UAAUzB,GAAQyB,GAAU,WAAWxB,CAAS,GACzFyB,IAAOC,QACLzB,EAAKE,GAAOD,GAAMd,KAAeF,GAAgD2B,CAAO,GAG9F;EAACV;EAAOD;EAAMd;EAAYkC;EAAST;CAAO,CAC5C,GAEM,CAACc,GAAMC,KAAWC,EAASJ,CAAI,GAC/BK,IAAQhB,EAASa,GAAMF,CAAI,IAAIE,IAAOF;CAC5C,AAAIK,MAAUH,KAAMC,EAAQH,CAAI;CAChC,IAAMM,IAAS,KAAK,UAAUD,EAAM,SAAS,OAAO,KAAK,MAAUpC,EAAM,IAAI,CAAC,GAGxE,CAACsC,GAAQC,KAAaJ,SAAgB;EAAE;EAAQ,MAAMK,EAAcJ,EAAM,QAAQ;CAAE,EAAE,GACxF,EAAE,YAASE;CAKf,OAJIA,EAAO,WAAWD,MACpB,IAAOG,EAAcJ,EAAM,UAAUE,EAAO,IAAI,GAChDC,EAAU;EAAE;EAAQ;CAAK,CAAC,IAErBE,EAAa;EAClB;EAAO,UAAUL,EAAM;EAAU,UAAUA,EAAM;EAAU,OAAOA,EAAM;EAAO;EAAO;EAAY;CACpG,GAAGM,CAAI;AACT"}
@@ -1,26 +1,59 @@
1
1
  import { createTarget as e, skeletonAxes as t } from "@weasel-js/animator";
2
2
  //#region src/animation/rig/rigSeat.ts
3
- function n(n) {
4
- let r = {
5
- committed: {},
6
- root: void 0,
3
+ var n = (e) => e.target.active || e.carried !== null && n(e.carried.seat);
4
+ function r(e) {
5
+ let { target: t } = e.seat, n = t.axes.to(t.read());
6
+ return e.axis.map((t) => t < 0 ? 0 : n[t] - e.from[t]);
7
+ }
8
+ function i(e, t) {
9
+ let n = {};
10
+ for (let { name: r } of t.joints) {
11
+ let t = e[r];
12
+ t && (n[r] = t);
13
+ }
14
+ return n;
15
+ }
16
+ function a(a, s) {
17
+ let c = t(a), l = (e, t, n) => c.from(c.to(e).map((e, r) => e + n * t[r])), u = {
18
+ committed: s ? i(s.target.read(), a) : {},
19
+ root: s?.root,
7
20
  binding: null,
8
- shown: !1,
21
+ shown: s?.shown ?? !1,
22
+ carried: s && n(s) ? o(s, c.names ?? []) : null,
9
23
  target: e({
10
- get: () => r.committed,
24
+ get: () => {
25
+ let { carried: e } = u;
26
+ if (!e) return u.committed;
27
+ let t = l(u.committed, r(e), 1);
28
+ return n(e.seat) || (u.committed = t, u.carried = null), t;
29
+ },
11
30
  set: (e) => {
12
- r.committed = e;
31
+ let { carried: t } = u;
32
+ u.committed = t ? l(e, r(t), -1) : e;
13
33
  },
14
- axes: t(n),
15
- show: (e) => r.binding?.show(e)
34
+ axes: c,
35
+ show: (e) => u.binding?.show(e)
16
36
  })
17
37
  };
18
- return r;
38
+ return u;
39
+ }
40
+ function o(e, t) {
41
+ let { target: n } = e, r = n.axes.names ?? [];
42
+ return {
43
+ seat: e,
44
+ from: n.axes.to(n.read()),
45
+ axis: t.map((e) => r.indexOf(e))
46
+ };
19
47
  }
20
- function r(e, t) {
21
- e.binding = t, e.shown && t.show(e.target.read());
48
+ function s(e, t) {
49
+ e.binding = t;
50
+ let n = e.carried?.seat;
51
+ n && (n.binding = {
52
+ show: () => e.binding?.show(e.target.read()),
53
+ drop: () => {}
54
+ }), e.shown && t.show(e.target.read());
22
55
  }
23
56
  //#endregion
24
- export { n as createRigSeat, r as seatBinding };
57
+ export { a as createRigSeat, s as seatBinding };
25
58
 
26
59
  //# sourceMappingURL=rigSeat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rigSeat.js","names":["createRigSeat","seat","createTarget","pose","skeletonAxes","skeleton","seatBinding","binding"],"sources":["../../../src/animation/rig/rigSeat.ts"],"sourcesContent":["import type { GlMat3 } from '@weasel-js/geom';\nimport { createTarget, skeletonAxes, type Pose, type Skeleton, type Target } from '@weasel-js/animator';\n\n/** One binding of a rig to the scene: what a seat shows its pose through. */\nexport interface RigBinding {\n show(pose: Pose): void;\n /** Drop the overrides, leaving the seat as it is. */\n drop(): void;\n}\n\n/**\n * A rig's pose apart from the binding that shows it: the target, the committed pose, and the\n * placement. A rig bound again on the seat it had goes on under the animations running on its\n * target.\n */\nexport interface RigSeat {\n readonly target: Target<Pose>;\n committed: Pose;\n root: GlMat3 | undefined;\n binding: RigBinding | null;\n /** Whether the pose is on screen: set as a binding shows it, cleared as the rig is released. */\n shown: boolean;\n}\n\n/** A seat at the bind pose, for a skeleton with these joints in this order. */\nexport function createRigSeat(skeleton: Skeleton): RigSeat {\n const seat: RigSeat = {\n committed: {},\n root: undefined,\n binding: null,\n shown: false,\n target: createTarget<Pose>({\n get: () => seat.committed,\n set: (pose) => { seat.committed = pose; },\n axes: skeletonAxes(skeleton),\n show: (pose) => seat.binding?.show(pose),\n }),\n };\n return seat;\n}\n\n/** Make `binding` the one `seat` shows through, and show it what the last one had on screen. */\nexport function seatBinding(seat: RigSeat, binding: RigBinding): void {\n seat.binding = binding;\n if (seat.shown) binding.show(seat.target.read());\n}\n"],"mappings":";;AAyBA,SAAgBA,EAAc,GAA6B;CACzD,IAAMC,IAAgB;EACpB,WAAW,CAAC;EACZ,MAAM,KAAA;EACN,SAAS;EACT,OAAO;EACP,QAAQC,EAAmB;GACzB,WAAWD,EAAK;GAChB,MAAM,MAAS;IAAE,EAAK,YAAYE;GAAM;GACxC,MAAMC,EAAaC,CAAQ;GAC3B,OAAO,MAASJ,EAAK,SAAS,KAAKE,CAAI;EACzC,CAAC;CACH;CACA,OAAOF;AACT;AAGA,SAAgBK,EAAY,GAAe,GAA2B;CAEpE,AADA,EAAK,UAAUC,GACXN,EAAK,SAAOM,EAAQ,KAAKN,EAAK,OAAO,KAAK,CAAC;AACjD"}
1
+ {"version":3,"file":"rigSeat.js","names":["moving","seat","travel","carried","now","target","k","jointsOf","out","skeleton","joint","pose","name","createRigSeat","axes","skeletonAxes","shifted","v","sign","by","i","prior","carry","createTarget","had","names","seatBinding","binding"],"sources":["../../../src/animation/rig/rigSeat.ts"],"sourcesContent":["import type { GlMat3 } from '@weasel-js/geom';\nimport { createTarget, skeletonAxes, type Pose, type Skeleton, type Target } from '@weasel-js/animator';\n\n/** One binding of a rig to the scene: what a seat shows its pose through. */\nexport interface RigBinding {\n show(pose: Pose): void;\n /** Drop the overrides, leaving the seat as it is. */\n drop(): void;\n}\n\n/** The seat another took over from, while something still moves its target. */\ninterface Carried {\n seat: RigSeat;\n /** That seat's target as it read when this one was made, as its axes. */\n from: number[];\n /** For each axis of this seat, that seat's axis of the same name; -1 where it has none. */\n axis: number[];\n}\n\n/**\n * A rig's pose apart from the binding that shows it: the target, the committed pose, and the\n * placement. A rig bound again on the seat it had goes on under the animations running on its\n * target.\n */\nexport interface RigSeat {\n readonly target: Target<Pose>;\n /** The committed pose, less what `carried` adds to it. */\n committed: Pose;\n root: GlMat3 | undefined;\n binding: RigBinding | null;\n /** Whether the pose is on screen: set as a binding shows it, cleared as the rig is released. */\n shown: boolean;\n /** The seat this one took over from as the skeleton's joints changed. What moves that\n * seat's target since then is added to this one's, on the joints both skeletons name. */\n carried: Carried | null;\n}\n\nconst moving = (seat: RigSeat): boolean =>\n seat.target.active || (seat.carried !== null && moving(seat.carried.seat));\n\n/** How far `carried`'s target has moved since it was taken over from, in the new seat's axes. */\nfunction travel(carried: Carried): number[] {\n const { target } = carried.seat;\n const now = target.axes.to(target.read());\n return carried.axis.map((k) => (k < 0 ? 0 : now[k]! - carried.from[k]!));\n}\n\n/** The joints of `pose` that `skeleton` names. */\nfunction jointsOf(pose: Pose, skeleton: Skeleton): Pose {\n const out: Pose = {};\n for (const { name } of skeleton.joints) {\n const joint = pose[name];\n if (joint) out[name] = joint;\n }\n return out;\n}\n\n/**\n * A seat for a skeleton with these joints in this order. With no `prior` it is at the bind\n * pose. With one, it takes over where that seat stands: its placement, and its pose on the\n * joints `skeleton` still names. Animations go on running on the prior seat's target, and\n * this one shows them.\n */\nexport function createRigSeat(skeleton: Skeleton, prior?: RigSeat): RigSeat {\n const axes = skeletonAxes(skeleton);\n const shifted = (pose: Pose, by: number[], sign: 1 | -1): Pose =>\n axes.from(axes.to(pose).map((v, i) => v + sign * by[i]!));\n const seat: RigSeat = {\n committed: prior ? jointsOf(prior.target.read(), skeleton) : {},\n root: prior?.root,\n binding: null,\n shown: prior?.shown ?? false,\n carried: prior && moving(prior) ? carry(prior, axes.names ?? []) : null,\n target: createTarget<Pose>({\n get: () => {\n const { carried } = seat;\n if (!carried) return seat.committed;\n const pose = shifted(seat.committed, travel(carried), 1);\n if (!moving(carried.seat)) {\n seat.committed = pose;\n seat.carried = null;\n }\n return pose;\n },\n set: (pose) => {\n const { carried } = seat;\n seat.committed = carried ? shifted(pose, travel(carried), -1) : pose;\n },\n axes,\n show: (pose) => seat.binding?.show(pose),\n }),\n };\n return seat;\n}\n\nfunction carry(prior: RigSeat, names: readonly string[]): Carried {\n const { target } = prior;\n const had = target.axes.names ?? [];\n return { seat: prior, from: target.axes.to(target.read()), axis: names.map((name) => had.indexOf(name)) };\n}\n\n/** Make `binding` the one `seat` shows through, and show it what the last one had on screen.\n * A seat it took over from shows through it too. */\nexport function seatBinding(seat: RigSeat, binding: RigBinding): void {\n seat.binding = binding;\n const prior = seat.carried?.seat;\n if (prior) prior.binding = { show: () => seat.binding?.show(seat.target.read()), drop: () => {} };\n if (seat.shown) binding.show(seat.target.read());\n}\n"],"mappings":";;AAqCA,IAAMA,KAAU,MACdC,EAAK,OAAO,UAAWA,EAAK,YAAY,QAAQD,EAAOC,EAAK,QAAQ,IAAI;AAG1E,SAASC,EAAO,GAA4B;CAC1C,IAAM,EAAE,cAAWC,EAAQ,MACrBC,IAAMC,EAAO,KAAK,GAAGA,EAAO,KAAK,CAAC;CACxC,OAAOF,EAAQ,KAAK,KAAK,MAAOG,IAAI,IAAI,IAAIF,EAAIE,KAAMH,EAAQ,KAAKG,EAAI;AACzE;AAGA,SAASC,EAAS,GAAY,GAA0B;CACtD,IAAMC,IAAY,CAAC;CACnB,KAAK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C;CAAE;AAC1G;AAIA,SAAgBc,EAAY,GAAe,GAA2B;CACpE,EAAK,UAAUC;CACf,IAAMN,IAAQpB,EAAK,SAAS;CAE5B,AADIoB,MAAO,EAAM,UAAU;EAAE,YAAYpB,EAAK,SAAS,KAAKA,EAAK,OAAO,KAAK,CAAC;EAAG,YAAY,CAAC;CAAE,IAC5FA,EAAK,SAAO0B,EAAQ,KAAK1B,EAAK,OAAO,KAAK,CAAC;AACjD"}
@@ -1,32 +1,40 @@
1
- import { boundsOfPath as e, pathInWorld as t } from "@weasel-js/geom";
2
- import { skinPath as n } from "@weasel-js/animator";
1
+ import { boundsOfPath as e, pathInWorld as t, remapPointValues as n } from "@weasel-js/geom";
2
+ import { skinPath as r } from "@weasel-js/animator";
3
3
  //#region src/animation/rig/skinBinding.ts
4
- function r(e) {
4
+ function i(e) {
5
5
  let n = e.data?.path;
6
6
  return n ? t(n, e.pose) : null;
7
7
  }
8
- function i(t, r, i, a) {
8
+ function a(e, t) {
9
+ let r = {};
10
+ for (let i in e) {
11
+ let a = n(e[i], t);
12
+ a.some((e) => e > 0) && (r[i] = a);
13
+ }
14
+ return r;
15
+ }
16
+ function o(t, n, i, a) {
9
17
  let o = [], s = /* @__PURE__ */ new Set();
10
- for (let [e, n] of Object.entries(r)) {
11
- let r = t.get(e);
12
- if (!r) throw Error(`bindRig: a skin names node "${e}", which the scene lacks.`);
13
- let a = i(r);
18
+ for (let [e, r] of Object.entries(n)) {
19
+ let n = t.get(e);
20
+ if (!n) throw Error(`bindRig: a skin names node "${e}", which the scene lacks.`);
21
+ let a = i(n);
14
22
  if (!a) throw Error(`bindRig: node "${e}" has no path to skin.`);
15
- for (let e in n) s.add(e);
23
+ for (let e in r) s.add(e);
16
24
  o.push({
17
25
  node: e,
18
- skin: n,
26
+ skin: r,
19
27
  rest: a,
20
- restPose: r.pose,
28
+ restPose: n.pose,
21
29
  entry: {}
22
30
  });
23
31
  }
24
32
  let c = !1;
25
33
  return {
26
34
  joints: [...s],
27
- show(r) {
35
+ show(n) {
28
36
  for (let i of o) {
29
- let o = n(i.rest, i.skin, r);
37
+ let o = r(i.rest, i.skin, n);
30
38
  i.entry.path = o, i.entry.pose = a.fromBounds(e(o), i.restPose), c || t.overrides.set(i.node, i.entry);
31
39
  }
32
40
  c = !0;
@@ -51,6 +59,6 @@ function i(t, r, i, a) {
51
59
  };
52
60
  }
53
61
  //#endregion
54
- export { i as bindSkins, r as dataRestPath };
62
+ export { o as bindSkins, i as dataRestPath, a as remapSkin };
55
63
 
56
64
  //# sourceMappingURL=skinBinding.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skinBinding.js","names":["dataRestPath","path","node","pathInWorld","bindSkins","skinned","joints","id","skin","skins","scene","rest","restPath","joint","installed","s","skinPath","motions","descriptor","boundsOfPath","pose","data"],"sources":["../../../src/animation/rig/skinBinding.ts"],"sourcesContent":["import { boundsOfPath, pathInWorld, type GlMat3, type Path, type PathInWorldPose } from '@weasel-js/geom';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId, PoseOverride, PoseOverrides } from '../../core/scene/types';\nimport { skinPath, type Skin } from '@weasel-js/animator';\n\n/** The part of a scene a rig's skins read and write. */\nexport interface SkinScene<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n readonly overrides: PoseOverrides<TPose>;\n setPose(id: NodeId, pose: TPose): void;\n update(id: NodeId, patch: { data: never }): void;\n}\n\n/** Where a node's path is drawn, for a skin to bend: `null` for a node with none. */\nexport type RestPath<TPose> = (node: { pose: TPose; data?: unknown }) => Path | null;\n\n/** The path in a node's `data.path`, carried through its pose as `kit:path` paints it. */\nexport function dataRestPath<TPose>(node: { pose: TPose; data?: unknown }): Path | null {\n const path = (node.data as { path?: Path } | null | undefined)?.path;\n return path ? pathInWorld(path, node.pose as PathInWorldPose) : null;\n}\n\ninterface Skinned<TPose> {\n node: NodeId;\n skin: Skin;\n rest: Path;\n restPose: TPose;\n entry: PoseOverride<TPose>;\n}\n\n/** A rig's skinned nodes, as `bindSkins` returns them. */\nexport interface SkinBinding {\n /** Every joint a skin weighs. */\n readonly joints: readonly string[];\n /** Bend each skinned path by `motions`, which holds every one of `joints`, into its node's\n * pose override. The caller commits the overrides. */\n show(motions: ReadonlyMap<string, GlMat3>): void;\n /** Write each bent path and its bounds into the document. */\n write(): void;\n release(): void;\n}\n\n/** Read each skinned node's rest path and ready an override for it. */\nexport function bindSkins<TPose>(\n scene: SkinScene<TPose>,\n skins: Readonly<Record<NodeId, Skin>>,\n restPath: RestPath<TPose>,\n descriptor: PoseDescriptor<TPose>,\n): SkinBinding {\n const skinned: Skinned<TPose>[] = [];\n const joints = new Set<string>();\n for (const [id, skin] of Object.entries(skins) as [NodeId, Skin][]) {\n const node = scene.get(id);\n if (!node) throw new Error(`bindRig: a skin names node \"${id}\", which the scene lacks.`);\n const rest = restPath(node);\n if (!rest) throw new Error(`bindRig: node \"${id}\" has no path to skin.`);\n for (const joint in skin) joints.add(joint);\n skinned.push({ node: id, skin, rest, restPose: node.pose, entry: {} });\n }\n let installed = false;\n return {\n joints: [...joints],\n show(motions) {\n for (const s of skinned) {\n const path = skinPath(s.rest, s.skin, motions);\n s.entry.path = path;\n s.entry.pose = descriptor.fromBounds(boundsOfPath(path), s.restPose);\n if (!installed) scene.overrides.set(s.node, s.entry);\n }\n installed = true;\n },\n write() {\n for (const s of skinned) {\n const { path, pose } = s.entry;\n if (path === undefined || pose === undefined) continue;\n const data = scene.get(s.node)?.data;\n scene.update(s.node, { data: { ...(data as object), path } as never });\n scene.setPose(s.node, pose);\n }\n },\n release() {\n if (!installed) return;\n installed = false;\n for (const s of skinned) scene.overrides.clear(s.node);\n },\n };\n}\n"],"mappings":";;;AAiBA,SAAgBA,EAAoB,GAAoD;CACtF,IAAMC,IAAQC,EAAK,MAA6C;CAChE,OAAOD,IAAOE,EAAYF,GAAMC,EAAK,IAAuB,IAAI;AAClE;AAuBA,SAAgBE,EACd,GACA,GACA,GACA,GACa;CACb,I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,EAAE,IAAI;GADzC;EAEd;CACF;AACF"}
1
+ {"version":3,"file":"skinBinding.js","names":["dataRestPath","path","node","pathInWorld","remapSkin","next","joint","skin","weights","remapPointValues","origins","w","bindSkins","skinned","joints","id","skins","scene","rest","restPath","installed","s","skinPath","motions","descriptor","boundsOfPath","pose","data"],"sources":["../../../src/animation/rig/skinBinding.ts"],"sourcesContent":["import {\n boundsOfPath, pathInWorld, remapPointValues,\n type GlMat3, type Path, type PathInWorldPose, type PointOrigin,\n} from '@weasel-js/geom';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId, PoseOverride, PoseOverrides } from '../../core/scene/types';\nimport { skinPath, type Skin } from '@weasel-js/animator';\n\n/** The part of a scene a rig's skins read and write. */\nexport interface SkinScene<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n readonly overrides: PoseOverrides<TPose>;\n setPose(id: NodeId, pose: TPose): void;\n update(id: NodeId, patch: { data: never }): void;\n}\n\n/** Where a node's path is drawn, for a skin to bend: `null` for a node with none. */\nexport type RestPath<TPose> = (node: { pose: TPose; data?: unknown }) => Path | null;\n\n/** The path in a node's `data.path`, carried through its pose as `kit:path` paints it. */\nexport function dataRestPath<TPose>(node: { pose: TPose; data?: unknown }): Path | null {\n const path = (node.data as { path?: Path } | null | undefined)?.path;\n return path ? pathInWorld(path, node.pose as PathInWorldPose) : null;\n}\n\n/**\n * `skin` after an edit to the points of the path it weighs: `origins` says where each point\n * of the new path came from, as `editAnchorSetTracked` answers. A point the edit made takes\n * weights between those of the points it lies between, and a joint left weighing nothing is\n * dropped.\n */\nexport function remapSkin(skin: Skin, origins: readonly (PointOrigin | null)[]): Skin {\n const next: Record<string, number[]> = {};\n for (const joint in skin) {\n const weights = remapPointValues(skin[joint], origins);\n if (weights.some((w) => w > 0)) next[joint] = weights;\n }\n return next;\n}\n\ninterface Skinned<TPose> {\n node: NodeId;\n skin: Skin;\n rest: Path;\n restPose: TPose;\n entry: PoseOverride<TPose>;\n}\n\n/** A rig's skinned nodes, as `bindSkins` returns them. */\nexport interface SkinBinding {\n /** Every joint a skin weighs. */\n readonly joints: readonly string[];\n /** Bend each skinned path by `motions`, which holds every one of `joints`, into its node's\n * pose override. The caller commits the overrides. */\n show(motions: ReadonlyMap<string, GlMat3>): void;\n /** Write each bent path and its bounds into the document. */\n write(): void;\n release(): void;\n}\n\n/** Read each skinned node's rest path and ready an override for it. */\nexport function bindSkins<TPose>(\n scene: SkinScene<TPose>,\n skins: Readonly<Record<NodeId, Skin>>,\n restPath: RestPath<TPose>,\n descriptor: PoseDescriptor<TPose>,\n): SkinBinding {\n const skinned: Skinned<TPose>[] = [];\n const joints = new Set<string>();\n for (const [id, skin] of Object.entries(skins) as [NodeId, Skin][]) {\n const node = scene.get(id);\n if (!node) throw new Error(`bindRig: a skin names node \"${id}\", which the scene lacks.`);\n const rest = restPath(node);\n if (!rest) throw new Error(`bindRig: node \"${id}\" has no path to skin.`);\n for (const joint in skin) joints.add(joint);\n skinned.push({ node: id, skin, rest, restPose: node.pose, entry: {} });\n }\n let installed = false;\n return {\n joints: [...joints],\n show(motions) {\n for (const s of skinned) {\n const path = skinPath(s.rest, s.skin, motions);\n s.entry.path = path;\n s.entry.pose = descriptor.fromBounds(boundsOfPath(path), s.restPose);\n if (!installed) scene.overrides.set(s.node, s.entry);\n }\n installed = true;\n },\n write() {\n for (const s of skinned) {\n const { path, pose } = s.entry;\n if (path === undefined || pose === undefined) continue;\n const data = scene.get(s.node)?.data;\n scene.update(s.node, { data: { ...(data as object), path } as never });\n scene.setPose(s.node, pose);\n }\n },\n release() {\n if (!installed) return;\n installed = false;\n for (const s of skinned) scene.overrides.clear(s.node);\n },\n };\n}\n"],"mappings":";;;AAoBA,SAAgBA,EAAoB,GAAoD;CACtF,IAAMC,IAAQC,EAAK,MAA6C;CAChE,OAAOD,IAAOE,EAAYF,GAAMC,EAAK,IAAuB,IAAI;AAClE;AAQA,SAAgBE,EAAU,GAAY,GAAgD;CACp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AAI,CAAC,EAAE;IAEhC,AADAJ,EAAM,OAAOI,EAAE,MAAM,EAAE,MAAM;KAAE,GAAIM;KAAiB;IAAK,EAAW,CAAC,GACrEV,EAAM,QAAQI,EAAE,MAAMK,CAAI;GAC5B;EACF;EACA,UAAU;GACR,IAAKN,GACL;QAAY;IACZ,KAAK,IAAMC,KAAKR,GAAS,EAAM,UAAU,MAAMQ,EAAE,IAAI;GADzC;EAEd;CACF;AACF"}
@@ -1,31 +1,32 @@
1
1
  import { depsUnchanged as e, drawLayers as t, drawOneLayer as n, isLayerPainted as r, isLayerVisible as i, paintedLayers as a, subscribeToSources as o } from "../core/layers/render.js";
2
2
  import { dlog as s, dwarn as c, isDebugEnabled as l } from "../debug/flag.js";
3
3
  import { insertPreviewExtent as u } from "../canvas/insertPreviewExtent.js";
4
- import { DEFAULT_INK as d, findNodeShape as f, findShapeBounds as p, findShapeInk as m, findShapeSilhouette as h, getNodeShapes as g, registerNodeShape as _, shapeCoversPoint as v } from "../canvas/NodeShape.js";
5
- import { defaultDrawOne as y, defaultPaintBounds as b } from "../canvas/defaultDrawOne.js";
6
- import { DEFAULT_DEBUG_STROKES as x, DEFAULT_DEBUG_THEME as S } from "../debug/defaultTheme.js";
7
- import { buildDebugOverlayCommands as C, createDebugOverlayLayer as w } from "../debug/createDebugOverlayLayer.js";
8
- import { parseDebugFlags as T } from "../debug/parseDebugFlags.js";
9
- import { createDebugSink as E } from "../debug/createDebugSink.js";
10
- import { registerContentHandler as D } from "../features/ingestion/contentHandlers.js";
11
- import { hostAnchorCss as O, hostAnchorRect as k } from "../canvas/hostAnchor.js";
12
- import { useHostAnchor as A } from "../canvas/useHostAnchor.js";
13
- import { CursorCoordsHud as j } from "../canvas/CursorCoordsHud.js";
14
- import { PickHud as M } from "../canvas/PickHud.js";
15
- import { layoutArrivalHandler as N, useLayoutArrivals as P } from "../layout/arrivals.js";
16
- import { DEFAULT_HANDLE_SIZE as F } from "../canvas/SceneCanvas/props.js";
17
- import { createNodeRouting as I } from "../core/scene/NodeRouting.js";
18
- import { defaultNodeRouting as L, inferredNodeRouting as R } from "../canvas/SceneCanvas/defaultNodeRouting.js";
19
- import { resolveOverlays as z } from "../interactions/actions/resolveOverlays.js";
20
- import { flattenPreviews as B, resolvePreviews as V } from "../interactions/actions/resolvePreviews.js";
21
- import { sceneToAdapter as H, useSceneAdapter as U } from "../canvas/sceneAdapter.js";
22
- import { SceneCanvas as W } from "../canvas/SceneCanvas.js";
23
- import { createNodeProperties as G } from "../core/scene/NodeProperties.js";
24
- import { defaultNodeProperties as K, inferredNodeProperties as q, rotationDegreesUnit as J } from "../canvas/SceneCanvas/defaultNodeProperties.js";
25
- import { kitTextHandler as Y } from "../features/ingestion/textHandler.js";
26
- import { openFilePicker as X } from "../features/ingestion/openFilePicker.js";
27
- import { WeaselProvider as Z } from "../WeaselProvider.js";
28
- import { modeDecorationLayer as Q, workspaceTintLayer as $ } from "../features/modes/modeLayers.js";
29
- import { createChildrenLayer as ee } from "../core/layers/children.js";
30
- import { getImageBitmap as te, imageStatus as ne, isVectorImageSrc as re, releaseImage as ie, retryImage as ae, setImageCacheBudget as oe, subscribeImageReady as se } from "@weasel-js/renderer";
31
- export { j as CursorCoordsHud, x as DEFAULT_DEBUG_STROKES, S as DEFAULT_DEBUG_THEME, F as DEFAULT_HANDLE_SIZE, d as DEFAULT_INK, M as PickHud, W as SceneCanvas, Z as WeaselProvider, C as buildDebugOverlayCommands, ee as createChildrenLayer, w as createDebugOverlayLayer, E as createDebugSink, G as createNodeProperties, I as createNodeRouting, y as defaultDrawOne, K as defaultNodeProperties, L as defaultNodeRouting, b as defaultPaintBounds, e as depsUnchanged, s as dlog, t as drawLayers, n as drawOneLayer, c as dwarn, f as findNodeShape, p as findShapeBounds, m as findShapeInk, h as findShapeSilhouette, B as flattenPreviews, te as getImageBitmap, g as getNodeShapes, O as hostAnchorCss, k as hostAnchorRect, ne as imageStatus, q as inferredNodeProperties, R as inferredNodeRouting, u as insertPreviewExtent, l as isDebugEnabled, r as isLayerPainted, i as isLayerVisible, re as isVectorImageSrc, Y as kitTextHandler, N as layoutArrivalHandler, Q as modeDecorationLayer, X as openFilePicker, a as paintedLayers, T as parseDebugFlags, D as registerContentHandler, _ as registerNodeShape, ie as releaseImage, z as resolveOverlays, V as resolvePreviews, ae as retryImage, J as rotationDegreesUnit, H as sceneToAdapter, oe as setImageCacheBudget, v as shapeCoversPoint, se as subscribeImageReady, o as subscribeToSources, A as useHostAnchor, P as useLayoutArrivals, U as useSceneAdapter, $ as workspaceTintLayer };
4
+ import { isOverChildren as d, overChildren as f, splitOverChildren as p } from "../canvas/overChildren.js";
5
+ import { DEFAULT_INK as m, findNodeShape as h, findShapeBounds as g, findShapeInk as _, findShapeSilhouette as v, getNodeShapes as y, registerNodeShape as b, shapeCoversPoint as x } from "../canvas/NodeShape.js";
6
+ import { sceneToAdapter as S } from "../canvas/sceneAdapter.js";
7
+ import { defaultDrawOne as C, defaultPaintBounds as w } from "../canvas/defaultDrawOne.js";
8
+ import { DEFAULT_DEBUG_STROKES as T, DEFAULT_DEBUG_THEME as E } from "../debug/defaultTheme.js";
9
+ import { buildDebugOverlayCommands as D, createDebugOverlayLayer as O } from "../debug/createDebugOverlayLayer.js";
10
+ import { parseDebugFlags as k } from "../debug/parseDebugFlags.js";
11
+ import { createDebugSink as A } from "../debug/createDebugSink.js";
12
+ import { registerContentHandler as j } from "../features/ingestion/contentHandlers.js";
13
+ import { hostAnchorCss as M, hostAnchorRect as N } from "../canvas/hostAnchor.js";
14
+ import { useHostAnchor as P } from "../canvas/useHostAnchor.js";
15
+ import { CursorCoordsHud as F } from "../canvas/CursorCoordsHud.js";
16
+ import { PickHud as I } from "../canvas/PickHud.js";
17
+ import { DEFAULT_HANDLE_SIZE as L } from "../canvas/SceneCanvas/props.js";
18
+ import { createNodeRouting as R } from "../core/scene/NodeRouting.js";
19
+ import { defaultNodeRouting as z, inferredNodeRouting as B } from "../canvas/SceneCanvas/defaultNodeRouting.js";
20
+ import { resolveOverlays as V } from "../interactions/actions/resolveOverlays.js";
21
+ import { flattenPreviews as H, resolvePreviews as U } from "../interactions/actions/resolvePreviews.js";
22
+ import { useSceneAdapter as W } from "../canvas/useSceneAdapter.js";
23
+ import { SceneCanvas as G } from "../canvas/SceneCanvas.js";
24
+ import { createNodeProperties as K } from "../core/scene/NodeProperties.js";
25
+ import { defaultNodeProperties as q, inferredNodeProperties as J, rotationDegreesUnit as Y } from "../canvas/SceneCanvas/defaultNodeProperties.js";
26
+ import { kitTextHandler as X } from "../features/ingestion/textHandler.js";
27
+ import { openFilePicker as Z } from "../features/ingestion/openFilePicker.js";
28
+ import { WeaselProvider as Q } from "../WeaselProvider.js";
29
+ import { modeDecorationLayer as $, workspaceTintLayer as ee } from "../features/modes/modeLayers.js";
30
+ import { createChildrenLayer as te } from "../core/layers/children.js";
31
+ import { getImageBitmap as ne, imageStatus as re, isVectorImageSrc as ie, releaseImage as ae, retryImage as oe, setImageCacheBudget as se, subscribeImageReady as ce } from "@weasel-js/renderer";
32
+ export { F as CursorCoordsHud, T as DEFAULT_DEBUG_STROKES, E as DEFAULT_DEBUG_THEME, L as DEFAULT_HANDLE_SIZE, m as DEFAULT_INK, I as PickHud, G as SceneCanvas, Q as WeaselProvider, D as buildDebugOverlayCommands, te as createChildrenLayer, O as createDebugOverlayLayer, A as createDebugSink, K as createNodeProperties, R as createNodeRouting, C as defaultDrawOne, q as defaultNodeProperties, z as defaultNodeRouting, w as defaultPaintBounds, e as depsUnchanged, s as dlog, t as drawLayers, n as drawOneLayer, c as dwarn, h as findNodeShape, g as findShapeBounds, _ as findShapeInk, v as findShapeSilhouette, H as flattenPreviews, ne as getImageBitmap, y as getNodeShapes, M as hostAnchorCss, N as hostAnchorRect, re as imageStatus, J as inferredNodeProperties, B as inferredNodeRouting, u as insertPreviewExtent, l as isDebugEnabled, r as isLayerPainted, i as isLayerVisible, d as isOverChildren, ie as isVectorImageSrc, X as kitTextHandler, $ as modeDecorationLayer, Z as openFilePicker, f as overChildren, a as paintedLayers, k as parseDebugFlags, j as registerContentHandler, b as registerNodeShape, ae as releaseImage, V as resolveOverlays, U as resolvePreviews, oe as retryImage, Y as rotationDegreesUnit, S as sceneToAdapter, se as setImageCacheBudget, x as shapeCoversPoint, p as splitOverChildren, ce as subscribeImageReady, o as subscribeToSources, P as useHostAnchor, W as useSceneAdapter, ee as workspaceTintLayer };
@@ -4,35 +4,36 @@ import { RECT_POSE_DESCRIPTOR as e, ROTATED_POSE_DESCRIPTOR as t, poseDescriptor
4
4
  import { AUTO_POSE_DESCRIPTOR as a, isPathLike as o, isRectPose as s } from "../core/geometry/autoPoseDescriptor.js";
5
5
  import { cornerResizeHandles as c, fixedCornerOf as l, hitCornerHandle as u } from "../interactions/actions/resize/cornerHandles.js";
6
6
  import { enumerateAnchors as d, withCoord as f } from "../interactions/actions/edit-anchors/geometry.js";
7
- import { aabbCenter as p, pointInRotatedRect as m, rectCorners as h, rotatePoint as g, rotatedRectCorners as _ } from "../interactions/actions/rotate/geometry.js";
8
- import { gesturePlaneReader as v, gestureViewReader as y, screenTolerance as b } from "../interactions/gestures/shared/screenTolerance.js";
9
- import { createPoseTarget as x, poseAxes as S, scenePoseTarget as C } from "../animation/poseTarget.js";
10
- import { DEFAULT_ROTATION_SNAP_STEP as w, snapRotationWithModifier as T } from "../interactions/actions/rotate/behaviors/snapRotation.js";
11
- import { DEFAULT_ROTATE_BEHAVIORS as E } from "../interactions/actions/rotate/behaviors/index.js";
12
- import { WEASEL_CLIPBOARD_MIME as D, WEASEL_CLIPBOARD_MIME_WEB as O, buildWeaselClipboardText as k, embedWeaselMetadataInSvg as A, extractWeaselClipboardFromSvg as j, parseWeaselClipboardText as M, sniffWeaselClipboardText as N } from "../interactions/actions/clipboard/wireFormat.js";
13
- import { resolveSpatialReference as P } from "../interactions/actions/spatialReference.js";
14
- import { alignDeltaFor as F, alignTargetBounds as I, useAlign as L } from "../interactions/actions/align/align.js";
15
- import { dataRestPath as R } from "../animation/rig/skinBinding.js";
16
- import { bindRig as z, rigidRigApply as B } from "../animation/rig/bindRig.js";
17
- import { useRig as V } from "../animation/rig/useRig.js";
18
- import { placeSkeleton as H, rigFromNode as U, unplaceSkeleton as W, useRigNode as G } from "../animation/rig/rigNode.js";
19
- import { DEFAULT_ROTATION_HANDLE_DISTANCE as K, hitRotationHandle as q, rotationHandle as J } from "../interactions/actions/rotate/handle.js";
20
- import { AUTO_ORIGIN_PROJECTION as Y, RECT_ORIGIN_PROJECTION as X } from "../interactions/gestures/shared/originProjection.js";
21
- import { snap as Z } from "../interactions/gestures/shared/snap.js";
22
- import { useDragGesture as Q } from "../interactions/gestures/dragGesture/dragGesture.js";
23
- import { dragPointOf as $ } from "../interactions/gestures/dragGesture/dragPointOf.js";
24
- import { useDragRect as ee } from "../interactions/gestures/dragRect/dragRect.js";
25
- import { useDragRadial as te } from "../interactions/gestures/dragRadial/dragRadial.js";
26
- import { hitAnchor as ne } from "../interactions/actions/edit-anchors/handles.js";
27
- import { useClipboardOps as re } from "../interactions/actions/clipboard/clipboardOps.js";
28
- import { useDistribute as ie } from "../interactions/actions/distribute/distribute.js";
29
- import { createWrittenPoseTarget as ae } from "../animation/writtenPoseTarget.js";
30
- import { sceneClipTargets as oe } from "../animation/clipTargets.js";
31
- import { springPose as se, staggerSpringPose as ce, tweenPose as le } from "../animation/poseHelpers.js";
32
- import { animateOnSetPose as ue } from "../animation/wrappers/animateOnSetPose.js";
33
- import { animateLifecycle as de } from "../animation/wrappers/animateLifecycle.js";
34
- import { createReflowTransition as fe, useAnimatedReflow as pe } from "../animation/reflow.js";
35
- import { momentum as me } from "../animation/behaviors/momentum.js";
36
- import { EASINGS as he, SPRING_PRESETS as ge, cubicBezierEasing as _e, easeIn as ve, easeInBack as ye, easeInBounce as be, easeInCirc as xe, easeInCubic as Se, easeInElastic as Ce, easeInExpo as we, easeInOut as Te, easeInOutBack as Ee, easeInOutBounce as De, easeInOutCirc as Oe, easeInOutCubic as ke, easeInOutElastic as Ae, easeInOutExpo as je, easeInOutQuad as Me, easeInOutQuart as Ne, easeInOutQuint as Pe, easeInOutSine as Fe, easeInQuad as Ie, easeInQuart as Le, easeInQuint as Re, easeInSine as ze, easeOut as Be, easeOutBack as Ve, easeOutBounce as He, easeOutCirc as Ue, easeOutCubic as We, easeOutElastic as Ge, easeOutExpo as Ke, easeOutQuad as qe, easeOutQuart as Je, easeOutQuint as Ye, easeOutSine as Xe, hexToOklchDeg as Ze, hslToSrgb as Qe, interpolateSrgb as $e, lerpColorArray as et, lerpOklab as tt, lerpOklch as nt, linear as rt, linearSrgbToOklab as it, linearToSrgb as at, oklabToLinearSrgb as ot, oklabToOklch as st, oklabToSrgbU8 as ct, oklchDegToHex as lt, oklchToOklab as ut, resolveEasing as dt, srgbFloatToOklab as ft, srgbToHsl as pt, srgbToLinear as mt, srgbU8ToOklab as ht } from "../animation/index.js";
37
- import { CONTROL_SELECTOR as gt, DRAG_THRESHOLD_PX as _t, isInControlWithin as vt, openPointerSession as yt, pastDragThreshold as bt } from "@weasel-js/routing";
38
- export { Y as AUTO_ORIGIN_PROJECTION, a as AUTO_POSE_DESCRIPTOR, gt as CONTROL_SELECTOR, E as DEFAULT_ROTATE_BEHAVIORS, K as DEFAULT_ROTATION_HANDLE_DISTANCE, w as DEFAULT_ROTATION_SNAP_STEP, _t as DRAG_THRESHOLD_PX, he as EASINGS, X as RECT_ORIGIN_PROJECTION, e as RECT_POSE_DESCRIPTOR, t as ROTATED_POSE_DESCRIPTOR, ge as SPRING_PRESETS, D as WEASEL_CLIPBOARD_MIME, O as WEASEL_CLIPBOARD_MIME_WEB, p as aabbCenter, F as alignDeltaFor, I as alignTargetBounds, de as animateLifecycle, ue as animateOnSetPose, z as bindRig, k as buildWeaselClipboardText, c as cornerResizeHandles, x as createPoseTarget, fe as createReflowTransition, ae as createWrittenPoseTarget, _e as cubicBezierEasing, R as dataRestPath, $ as dragPointOf, ve as easeIn, ye as easeInBack, be as easeInBounce, xe as easeInCirc, Se as easeInCubic, Ce as easeInElastic, we as easeInExpo, Te as easeInOut, Ee as easeInOutBack, De as easeInOutBounce, Oe as easeInOutCirc, ke as easeInOutCubic, Ae as easeInOutElastic, je as easeInOutExpo, Me as easeInOutQuad, Ne as easeInOutQuart, Pe as easeInOutQuint, Fe as easeInOutSine, Ie as easeInQuad, Le as easeInQuart, Re as easeInQuint, ze as easeInSine, Be as easeOut, Ve as easeOutBack, He as easeOutBounce, Ue as easeOutCirc, We as easeOutCubic, Ge as easeOutElastic, Ke as easeOutExpo, qe as easeOutQuad, Je as easeOutQuart, Ye as easeOutQuint, Xe as easeOutSine, A as embedWeaselMetadataInSvg, d as enumerateAnchors, j as extractWeaselClipboardFromSvg, l as fixedCornerOf, v as gesturePlaneReader, y as gestureViewReader, Ze as hexToOklchDeg, ne as hitAnchor, u as hitCornerHandle, q as hitRotationHandle, Qe as hslToSrgb, $e as interpolateSrgb, vt as isInControlWithin, o as isPathLike, s as isRectPose, et as lerpColorArray, tt as lerpOklab, nt as lerpOklch, rt as linear, it as linearSrgbToOklab, at as linearToSrgb, me as momentum, ot as oklabToLinearSrgb, st as oklabToOklch, ct as oklabToSrgbU8, lt as oklchDegToHex, ut as oklchToOklab, yt as openPointerSession, M as parseWeaselClipboardText, bt as pastDragThreshold, H as placeSkeleton, m as pointInRotatedRect, S as poseAxes, n as poseDescriptorForNode, h as rectCorners, dt as resolveEasing, P as resolveSpatialReference, U as rigFromNode, B as rigidRigApply, g as rotatePoint, _ as rotatedRectCorners, J as rotationHandle, oe as sceneClipTargets, C as scenePoseTarget, b as screenTolerance, Z as snap, T as snapRotationWithModifier, N as sniffWeaselClipboardText, se as springPose, ft as srgbFloatToOklab, pt as srgbToHsl, mt as srgbToLinear, ht as srgbU8ToOklab, ce as staggerSpringPose, r as translatePoseViaDescriptor, le as tweenPose, W as unplaceSkeleton, L as useAlign, pe as useAnimatedReflow, re as useClipboardOps, ie as useDistribute, Q as useDragGesture, te as useDragRadial, ee as useDragRect, V as useRig, G as useRigNode, i as visualBoundsViaDescriptor, f as withCoord };
7
+ import { createPoseTarget as p, poseAxes as m, scenePoseTarget as h } from "../animation/poseTarget.js";
8
+ import { aabbCenter as g, pointInRotatedRect as _, rectCorners as v, rotatePoint as y, rotatedRectCorners as b } from "../interactions/actions/rotate/geometry.js";
9
+ import { gesturePlaneReader as x, gestureViewReader as S, screenTolerance as C } from "../interactions/gestures/shared/screenTolerance.js";
10
+ import { forgetTransform as w, lastTransform as T, recordTransform as E } from "../interactions/actions/transform-again/memory.js";
11
+ import { DEFAULT_ROTATION_SNAP_STEP as D, snapRotationWithModifier as O } from "../interactions/actions/rotate/behaviors/snapRotation.js";
12
+ import { DEFAULT_ROTATE_BEHAVIORS as k } from "../interactions/actions/rotate/behaviors/index.js";
13
+ import { WEASEL_CLIPBOARD_MIME as A, WEASEL_CLIPBOARD_MIME_WEB as j, buildWeaselClipboardText as M, embedWeaselMetadataInSvg as N, extractWeaselClipboardFromSvg as P, parseWeaselClipboardText as F, sniffWeaselClipboardText as I } from "../interactions/actions/clipboard/wireFormat.js";
14
+ import { resolveSpatialReference as L } from "../interactions/actions/spatialReference.js";
15
+ import { alignDeltaFor as R, alignTargetBounds as z, useAlign as B } from "../interactions/actions/align/align.js";
16
+ import { dataRestPath as V } from "../animation/rig/skinBinding.js";
17
+ import { bindRig as H, rigidRigApply as U } from "../animation/rig/bindRig.js";
18
+ import { useRig as W } from "../animation/rig/useRig.js";
19
+ import { placeSkeleton as G, rigFromNode as K, unplaceSkeleton as q, useRigNode as J } from "../animation/rig/rigNode.js";
20
+ import { DEFAULT_ROTATION_HANDLE_DISTANCE as Y, hitRotationHandle as X, rotationHandle as Z } from "../interactions/actions/rotate/handle.js";
21
+ import { AUTO_ORIGIN_PROJECTION as Q, RECT_ORIGIN_PROJECTION as $ } from "../interactions/gestures/shared/originProjection.js";
22
+ import { snap as ee } from "../interactions/gestures/shared/snap.js";
23
+ import { useDragGesture as te } from "../interactions/gestures/dragGesture/dragGesture.js";
24
+ import { dragPointOf as ne } from "../interactions/gestures/dragGesture/dragPointOf.js";
25
+ import { useDragRect as re } from "../interactions/gestures/dragRect/dragRect.js";
26
+ import { useDragRadial as ie } from "../interactions/gestures/dragRadial/dragRadial.js";
27
+ import { hitAnchor as ae } from "../interactions/actions/edit-anchors/handles.js";
28
+ import { useClipboardOps as oe } from "../interactions/actions/clipboard/clipboardOps.js";
29
+ import { useDistribute as se } from "../interactions/actions/distribute/distribute.js";
30
+ import { createWrittenPoseTarget as ce } from "../animation/writtenPoseTarget.js";
31
+ import { sceneClipTargets as le } from "../animation/clipTargets.js";
32
+ import { springPose as ue, staggerSpringPose as de, tweenPose as fe } from "../animation/poseHelpers.js";
33
+ import { animateOnSetPose as pe } from "../animation/wrappers/animateOnSetPose.js";
34
+ import { animateLifecycle as me } from "../animation/wrappers/animateLifecycle.js";
35
+ import { createReflowTransition as he, useAnimatedReflow as ge } from "../animation/reflow.js";
36
+ import { momentum as _e } from "../animation/behaviors/momentum.js";
37
+ import { EASINGS as ve, SPRING_PRESETS as ye, cubicBezierEasing as be, easeIn as xe, easeInBack as Se, easeInBounce as Ce, easeInCirc as we, easeInCubic as Te, easeInElastic as Ee, easeInExpo as De, easeInOut as Oe, easeInOutBack as ke, easeInOutBounce as Ae, easeInOutCirc as je, easeInOutCubic as Me, easeInOutElastic as Ne, easeInOutExpo as Pe, easeInOutQuad as Fe, easeInOutQuart as Ie, easeInOutQuint as Le, easeInOutSine as Re, easeInQuad as ze, easeInQuart as Be, easeInQuint as Ve, easeInSine as He, easeOut as Ue, easeOutBack as We, easeOutBounce as Ge, easeOutCirc as Ke, easeOutCubic as qe, easeOutElastic as Je, easeOutExpo as Ye, easeOutQuad as Xe, easeOutQuart as Ze, easeOutQuint as Qe, easeOutSine as $e, hexToOklchDeg as et, hslToSrgb as tt, interpolateSrgb as nt, lerpColorArray as rt, lerpOklab as it, lerpOklch as at, linear as ot, linearSrgbToOklab as st, linearToSrgb as ct, oklabToLinearSrgb as lt, oklabToOklch as ut, oklabToSrgbU8 as dt, oklchDegToHex as ft, oklchToOklab as pt, resolveEasing as mt, srgbFloatToOklab as ht, srgbToHsl as gt, srgbToLinear as _t, srgbU8ToOklab as vt } from "../animation/index.js";
38
+ import { CONTROL_SELECTOR as yt, DRAG_THRESHOLD_PX as bt, isInControlWithin as xt, openPointerSession as St, pastDragThreshold as Ct } from "@weasel-js/routing";
39
+ export { Q as AUTO_ORIGIN_PROJECTION, a as AUTO_POSE_DESCRIPTOR, yt as CONTROL_SELECTOR, k as DEFAULT_ROTATE_BEHAVIORS, Y as DEFAULT_ROTATION_HANDLE_DISTANCE, D as DEFAULT_ROTATION_SNAP_STEP, bt as DRAG_THRESHOLD_PX, ve as EASINGS, $ as RECT_ORIGIN_PROJECTION, e as RECT_POSE_DESCRIPTOR, t as ROTATED_POSE_DESCRIPTOR, ye as SPRING_PRESETS, A as WEASEL_CLIPBOARD_MIME, j as WEASEL_CLIPBOARD_MIME_WEB, g as aabbCenter, R as alignDeltaFor, z as alignTargetBounds, me as animateLifecycle, pe as animateOnSetPose, H as bindRig, M as buildWeaselClipboardText, c as cornerResizeHandles, p as createPoseTarget, he as createReflowTransition, ce as createWrittenPoseTarget, be as cubicBezierEasing, V as dataRestPath, ne as dragPointOf, xe as easeIn, Se as easeInBack, Ce as easeInBounce, we as easeInCirc, Te as easeInCubic, Ee as easeInElastic, De as easeInExpo, Oe as easeInOut, ke as easeInOutBack, Ae as easeInOutBounce, je as easeInOutCirc, Me as easeInOutCubic, Ne as easeInOutElastic, Pe as easeInOutExpo, Fe as easeInOutQuad, Ie as easeInOutQuart, Le as easeInOutQuint, Re as easeInOutSine, ze as easeInQuad, Be as easeInQuart, Ve as easeInQuint, He as easeInSine, Ue as easeOut, We as easeOutBack, Ge as easeOutBounce, Ke as easeOutCirc, qe as easeOutCubic, Je as easeOutElastic, Ye as easeOutExpo, Xe as easeOutQuad, Ze as easeOutQuart, Qe as easeOutQuint, $e as easeOutSine, N as embedWeaselMetadataInSvg, d as enumerateAnchors, P as extractWeaselClipboardFromSvg, l as fixedCornerOf, w as forgetTransform, x as gesturePlaneReader, S as gestureViewReader, et as hexToOklchDeg, ae as hitAnchor, u as hitCornerHandle, X as hitRotationHandle, tt as hslToSrgb, nt as interpolateSrgb, xt as isInControlWithin, o as isPathLike, s as isRectPose, T as lastTransform, rt as lerpColorArray, it as lerpOklab, at as lerpOklch, ot as linear, st as linearSrgbToOklab, ct as linearToSrgb, _e as momentum, lt as oklabToLinearSrgb, ut as oklabToOklch, dt as oklabToSrgbU8, ft as oklchDegToHex, pt as oklchToOklab, St as openPointerSession, F as parseWeaselClipboardText, Ct as pastDragThreshold, G as placeSkeleton, _ as pointInRotatedRect, m as poseAxes, n as poseDescriptorForNode, E as recordTransform, v as rectCorners, mt as resolveEasing, L as resolveSpatialReference, K as rigFromNode, U as rigidRigApply, y as rotatePoint, b as rotatedRectCorners, Z as rotationHandle, le as sceneClipTargets, h as scenePoseTarget, C as screenTolerance, ee as snap, O as snapRotationWithModifier, I as sniffWeaselClipboardText, ue as springPose, ht as srgbFloatToOklab, gt as srgbToHsl, _t as srgbToLinear, vt as srgbU8ToOklab, de as staggerSpringPose, r as translatePoseViaDescriptor, fe as tweenPose, q as unplaceSkeleton, B as useAlign, ge as useAnimatedReflow, oe as useClipboardOps, se as useDistribute, te as useDragGesture, ie as useDragRadial, re as useDragRect, W as useRig, J as useRigNode, i as visualBoundsViaDescriptor, f as withCoord };
@@ -1,12 +1,13 @@
1
1
  import { pathPoseDescriptor as e } from "../core/geometry/pathPoseDescriptor.js";
2
2
  import { applyBooleanOp as t, previewBooleanOp as n } from "../interactions/actions/booleans/booleans.js";
3
- import { createPenPreviewLayer as r } from "../features/paths/penPreviewLayer.js";
4
- import { constrainTo45 as i } from "../util/constrainTo45.js";
5
- import { createPathEditingOverlayLayer as a } from "../features/paths/pathEditingOverlayLayer.js";
6
- import { createPathLayer as o } from "../features/paths/pathLayer.js";
7
- import { pathOriginProjection as s } from "../features/paths/originProjection.js";
8
- import { DEFAULT_FLATTEN_TOLERANCE as c, PATH_C as l, PATH_CMD_LENGTHS as u, PATH_L as d, PATH_M as f, PATH_Q as p, PATH_Z as m, PathBuilder as h, boundsOfPath as g, circlePath as _, composePath as v, countPathAnchors as y, decomposePath as b, ellipsePath as x, flattenCubic as S, flattenCubicWithArcLen as C, flattenQuadratic as w, flattenQuadraticWithArcLen as T, hasOpenSubpath as E, linePath as D, pathCommandCoordCount as O, pathContainsPoint as k, pathContainsPolygon as A, pathContainsRect as j, pathDistanceToPoint as M, pathDivide as N, pathExclude as P, pathFromD as F, pathInPoseFrame as I, pathInWorld as L, pathIntersect as R, pathIntersectsPolygon as z, pathIntersectsRect as B, pathSignedArea as V, pathSubtract as H, pathThroughPoseFrame as U, pathToAnchors as W, pathUnion as G, pointAlongPath as K, pointInPath as q, polygonFromPoints as J, polylineFromPoints as Y, poseFrameInverseOf as X, poseFrameOf as Z, poseLinearOf as Q, poseRotationOf as $, rectMarkerPath as ee, rectPath as te, regularPolygonPath as ne, reversePath as re, rotatePathAround as ie, roundRectPath as ae, scalePathToBounds as oe, snipPathByPolyline as se, splitByClosure as ce, splitPathByPolyline as le, splitPathBySegment as ue, splitSubpaths as de, squarePath as fe, starPath as pe, strokeToPath as me, transformPath as he, translatePath as ge, trianglesToPath as _e, unionBoundsPath as ve, worldEditToStorage as ye } from "../features/paths/index.js";
9
- import { useBooleans as be } from "../interactions/actions/booleans/useBooleans.js";
10
- import { useBooleansAdapter as xe } from "../interactions/actions/booleans/useBooleansAdapter.js";
11
- import { CURVE_REPS as Se, bezierCubic as Ce, bezierQuadratic as we, nurbs as Te, spiro as Ee } from "@weasel-js/geom/curves";
12
- export { Se as CURVE_REPS, c as DEFAULT_FLATTEN_TOLERANCE, l as PATH_C, u as PATH_CMD_LENGTHS, d as PATH_L, f as PATH_M, p as PATH_Q, m as PATH_Z, h as PathBuilder, t as applyBooleanOp, Ce as bezierCubic, we as bezierQuadratic, g as boundsOfPath, _ as circlePath, v as composePath, i as constrainTo45, y as countPathAnchors, a as createPathEditingOverlayLayer, o as createPathLayer, r as createPenPreviewLayer, b as decomposePath, x as ellipsePath, S as flattenCubic, C as flattenCubicWithArcLen, w as flattenQuadratic, T as flattenQuadraticWithArcLen, E as hasOpenSubpath, D as linePath, Te as nurbs, O as pathCommandCoordCount, k as pathContainsPoint, A as pathContainsPolygon, j as pathContainsRect, M as pathDistanceToPoint, N as pathDivide, P as pathExclude, F as pathFromD, I as pathInPoseFrame, L as pathInWorld, R as pathIntersect, z as pathIntersectsPolygon, B as pathIntersectsRect, s as pathOriginProjection, e as pathPoseDescriptor, V as pathSignedArea, H as pathSubtract, U as pathThroughPoseFrame, W as pathToAnchors, G as pathUnion, K as pointAlongPath, q as pointInPath, J as polygonFromPoints, Y as polylineFromPoints, X as poseFrameInverseOf, Z as poseFrameOf, Q as poseLinearOf, $ as poseRotationOf, n as previewBooleanOp, ee as rectMarkerPath, te as rectPath, ne as regularPolygonPath, re as reversePath, ie as rotatePathAround, ae as roundRectPath, oe as scalePathToBounds, se as snipPathByPolyline, Ee as spiro, ce as splitByClosure, le as splitPathByPolyline, ue as splitPathBySegment, de as splitSubpaths, fe as squarePath, pe as starPath, me as strokeToPath, he as transformPath, ge as translatePath, _e as trianglesToPath, ve as unionBoundsPath, be as useBooleans, xe as useBooleansAdapter, ye as worldEditToStorage };
3
+ import { SHAPE_COUNT_RANGE as r, STAR_RATIO_RANGE as i, clampShapeGenerator as a, isShapeGenerator as o, regenerateShape as s, settleShapeGenerator as c, shapeGeneratorOf as l, shapeGeneratorPath as u, withoutShapeGenerator as d } from "../features/paths/shapeGenerator.js";
4
+ import { createPenPreviewLayer as f } from "../features/paths/penPreviewLayer.js";
5
+ import { constrainTo45 as p } from "../util/constrainTo45.js";
6
+ import { createPathEditingOverlayLayer as m } from "../features/paths/pathEditingOverlayLayer.js";
7
+ import { createPathLayer as h } from "../features/paths/pathLayer.js";
8
+ import { pathOriginProjection as g } from "../features/paths/originProjection.js";
9
+ import { DEFAULT_FLATTEN_TOLERANCE as _, PATH_C as v, PATH_CMD_LENGTHS as y, PATH_L as b, PATH_M as x, PATH_Q as S, PATH_Z as C, PathBuilder as w, averageAnchorsAt as T, boundsOfPath as E, circlePath as D, composePath as O, countPathAnchors as k, decomposePath as A, ellipsePath as j, flattenCubic as M, flattenCubicWithArcLen as N, flattenQuadratic as P, flattenQuadraticWithArcLen as F, hasOpenSubpath as I, joinAnchorsAt as L, linePath as R, offsetPath as z, pathCommandCoordCount as B, pathContainsPoint as V, pathContainsPolygon as H, pathContainsRect as U, pathDistanceToPoint as W, pathDivide as G, pathExclude as K, pathFromD as q, pathInPoseFrame as J, pathInWorld as Y, pathIntersect as X, pathIntersectsPolygon as Z, pathIntersectsRect as Q, pathSignedArea as $, pathSubtract as ee, pathThroughPoseFrame as te, pathToAnchors as ne, pathUnion as re, pointAlongPath as ie, pointInPath as ae, polygonFromPoints as oe, polylineFromPoints as se, poseFrameInverseOf as ce, poseFrameOf as le, poseLinearOf as ue, poseRotationOf as de, rectMarkerPath as fe, rectPath as pe, regularPolygonPath as me, reversePath as he, rotatePathAround as ge, roundRectPath as _e, scalePathToBounds as ve, simplifyPath as ye, snipPathByPolyline as be, snipPathsAtCrossings as xe, splitByClosure as Se, splitPathByPolyline as Ce, splitPathBySegment as we, splitSubpaths as Te, squarePath as Ee, starPath as De, strokeToPath as Oe, transformPath as ke, translatePath as Ae, trianglesToPath as je, unionBoundsPath as Me, worldEditToStorage as Ne } from "../features/paths/index.js";
10
+ import { useBooleans as Pe } from "../interactions/actions/booleans/useBooleans.js";
11
+ import { useBooleansAdapter as Fe } from "../interactions/actions/booleans/useBooleansAdapter.js";
12
+ import { CURVE_REPS as Ie, bezierCubic as Le, bezierQuadratic as Re, nurbs as ze, spiro as Be } from "@weasel-js/geom/curves";
13
+ export { Ie as CURVE_REPS, _ as DEFAULT_FLATTEN_TOLERANCE, v as PATH_C, y as PATH_CMD_LENGTHS, b as PATH_L, x as PATH_M, S as PATH_Q, C as PATH_Z, w as PathBuilder, r as SHAPE_COUNT_RANGE, i as STAR_RATIO_RANGE, t as applyBooleanOp, T as averageAnchorsAt, Le as bezierCubic, Re as bezierQuadratic, E as boundsOfPath, D as circlePath, a as clampShapeGenerator, O as composePath, p as constrainTo45, k as countPathAnchors, m as createPathEditingOverlayLayer, h as createPathLayer, f as createPenPreviewLayer, A as decomposePath, j as ellipsePath, M as flattenCubic, N as flattenCubicWithArcLen, P as flattenQuadratic, F as flattenQuadraticWithArcLen, I as hasOpenSubpath, o as isShapeGenerator, L as joinAnchorsAt, R as linePath, ze as nurbs, z as offsetPath, B as pathCommandCoordCount, V as pathContainsPoint, H as pathContainsPolygon, U as pathContainsRect, W as pathDistanceToPoint, G as pathDivide, K as pathExclude, q as pathFromD, J as pathInPoseFrame, Y as pathInWorld, X as pathIntersect, Z as pathIntersectsPolygon, Q as pathIntersectsRect, g as pathOriginProjection, e as pathPoseDescriptor, $ as pathSignedArea, ee as pathSubtract, te as pathThroughPoseFrame, ne as pathToAnchors, re as pathUnion, ie as pointAlongPath, ae as pointInPath, oe as polygonFromPoints, se as polylineFromPoints, ce as poseFrameInverseOf, le as poseFrameOf, ue as poseLinearOf, de as poseRotationOf, n as previewBooleanOp, fe as rectMarkerPath, pe as rectPath, s as regenerateShape, me as regularPolygonPath, he as reversePath, ge as rotatePathAround, _e as roundRectPath, ve as scalePathToBounds, c as settleShapeGenerator, l as shapeGeneratorOf, u as shapeGeneratorPath, ye as simplifyPath, be as snipPathByPolyline, xe as snipPathsAtCrossings, Be as spiro, Se as splitByClosure, Ce as splitPathByPolyline, we as splitPathBySegment, Te as splitSubpaths, Ee as squarePath, De as starPath, Oe as strokeToPath, ke as transformPath, Ae as translatePath, je as trianglesToPath, Me as unionBoundsPath, Pe as useBooleans, Fe as useBooleansAdapter, d as withoutShapeGenerator, Ne as worldEditToStorage };