@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,62 +1,73 @@
1
1
  import { KIT_SHAPE_KINDS as e } from "../../core/shapeKinds.js";
2
- import { inferredNodeRouting as t } from "./defaultNodeRouting.js";
3
- import { dashForStrokeStyle as n, strokeDashStyleOf as r } from "@weasel-js/paint";
4
- import { listMarkers as i, markerGeneration as a } from "@weasel-js/stroke";
5
- import { resolveAlign as o } from "@weasel-js/text";
6
- import { ANGLE_RADIANS as s } from "@weasel-js/quantity";
7
- import { prefUnit as c } from "@weasel-js/prefs";
2
+ import { settleShapeGenerator as t } from "../../features/paths/shapeGenerator.js";
3
+ import { inferredNodeRouting as n } from "./defaultNodeRouting.js";
4
+ import { SHAPE_GENERATOR_SECTIONS as r } from "./shapeGeneratorProperties.js";
5
+ import { poseLinearOf as i } from "@weasel-js/geom";
6
+ import { dashForStrokeStyle as a, strokeDashStyleOf as o } from "@weasel-js/paint";
7
+ import { listMarkers as s, markerGeneration as c } from "@weasel-js/stroke";
8
+ import { resolveAlign as l } from "@weasel-js/text";
9
+ import { ANGLE_RADIANS as u, decimal as d } from "@weasel-js/quantity";
10
+ import { prefUnit as f } from "@weasel-js/prefs";
8
11
  //#region src/canvas/SceneCanvas/defaultNodeProperties.ts
9
- var l = c(s, "deg", {
12
+ var p = f(u, "deg", {
10
13
  precision: 1,
11
14
  suffix: "°"
15
+ }), m = d({
16
+ maxPlaces: 2,
17
+ grouping: !1
12
18
  });
13
- function u(e) {
19
+ function h(e) {
14
20
  let t = e?.width;
15
21
  if (typeof t == "number" || typeof t == "object" && t && typeof t.px == "number") return t;
16
22
  }
17
- var d = {
18
- read: (e, t) => t === void 0 ? void 0 : r(Array.isArray(e) ? e : void 0, u(t)),
19
- write: (e, t) => e === "dashed" || e === "dotted" ? n(e, u(t)) : e === "solid" ? void 0 : t?.dash
20
- }, f = {
23
+ var g = {
24
+ read: (e, t) => t === void 0 ? void 0 : o(Array.isArray(e) ? e : void 0, h(t)),
25
+ write: (e, t) => e === "dashed" || e === "dotted" ? a(e, h(t)) : e === "solid" ? void 0 : t?.dash
26
+ }, _ = {
21
27
  read: (e) => typeof e == "string" ? e : e && typeof e == "object" && "key" in e ? String(e.key) : "",
22
28
  write: (e) => e === "" ? void 0 : e
23
- }, p = {
29
+ }, v = {
24
30
  read: (e) => e === "italic",
25
31
  write: (e) => e ? "italic" : void 0
26
- }, m = {
32
+ }, y = {
27
33
  read: (e, t) => {
28
- if (e === void 0 || e === "justify") return e;
29
- let n = t?.direction === "rtl" ? "rtl" : "ltr";
30
- return o(e, n);
34
+ if (e === "start" || e === "end") {
35
+ let n = t?.direction;
36
+ return n === "ltr" || n === "rtl" ? l(e, n) : void 0;
37
+ }
38
+ return e;
31
39
  },
32
40
  write: (e) => e
33
- }, h;
34
- function g() {
35
- let e = a();
36
- return h?.generation !== e && (h = {
41
+ }, b = {
42
+ read: (e) => i({ transform: e }) !== null,
43
+ write: (e, t) => e ? t?.transform : void 0
44
+ }, x;
45
+ function S() {
46
+ let e = c();
47
+ return x?.generation !== e && (x = {
37
48
  generation: e,
38
49
  options: [{
39
50
  value: "",
40
51
  label: "None"
41
- }, ...i().map((e) => ({
52
+ }, ...s().map((e) => ({
42
53
  value: e.id,
43
54
  label: e.id
44
55
  }))]
45
- }), h.options;
56
+ }), x.options;
46
57
  }
47
- function _(e) {
58
+ function C(e) {
48
59
  return {
49
60
  kind: "enum",
50
61
  default: "",
51
62
  control: "select",
52
- encoding: f,
63
+ encoding: _,
53
64
  ...e,
54
65
  get options() {
55
- return g();
66
+ return S();
56
67
  }
57
68
  };
58
69
  }
59
- var v = {
70
+ var w = {
60
71
  kind: "object",
61
72
  name: "Fill",
62
73
  description: "Fill paint.",
@@ -76,59 +87,243 @@ var v = {
76
87
  alpha: !0,
77
88
  block: !0
78
89
  } }
90
+ }, T = {
91
+ kind: "object",
92
+ name: "Stroke",
93
+ description: "Stroke paint and line geometry.",
94
+ default: {
95
+ paint: {
96
+ kind: "solid",
97
+ color: "#000000ff"
98
+ },
99
+ width: 1
100
+ },
101
+ block: !0,
102
+ children: {
103
+ width: {
104
+ kind: "number",
105
+ name: "Width",
106
+ description: "Stroke width, world units.",
107
+ absentIsDefault: !0,
108
+ default: 1,
109
+ min: 0,
110
+ max: 20,
111
+ step: .5,
112
+ control: "slider",
113
+ icon: "strokeWidth",
114
+ block: !0
115
+ },
116
+ paint: {
117
+ kind: "paint",
118
+ name: "Paint",
119
+ description: "Stroke paint.",
120
+ default: {
121
+ kind: "solid",
122
+ color: "#000000ff"
123
+ },
124
+ alpha: !0,
125
+ block: !0
126
+ },
127
+ cap: {
128
+ kind: "enum",
129
+ name: "Cap",
130
+ description: "How an open end is drawn.",
131
+ absentIsDefault: !0,
132
+ default: "butt",
133
+ control: "toggle",
134
+ block: !0,
135
+ pair: {
136
+ with: ["data.stroke.join", "data.stroke.align"],
137
+ label: "Line"
138
+ },
139
+ options: [
140
+ {
141
+ value: "butt",
142
+ label: "Butt",
143
+ icon: "capButt"
144
+ },
145
+ {
146
+ value: "round",
147
+ label: "Round",
148
+ icon: "capRound"
149
+ },
150
+ {
151
+ value: "square",
152
+ label: "Square",
153
+ icon: "capSquare"
154
+ }
155
+ ]
156
+ },
157
+ join: {
158
+ kind: "enum",
159
+ name: "Join",
160
+ description: "How a corner is drawn.",
161
+ absentIsDefault: !0,
162
+ default: "miter",
163
+ control: "toggle",
164
+ block: !0,
165
+ options: [
166
+ {
167
+ value: "miter",
168
+ label: "Miter",
169
+ icon: "joinMiter"
170
+ },
171
+ {
172
+ value: "round",
173
+ label: "Round",
174
+ icon: "joinRound"
175
+ },
176
+ {
177
+ value: "bevel",
178
+ label: "Bevel",
179
+ icon: "joinBevel"
180
+ }
181
+ ]
182
+ },
183
+ align: {
184
+ kind: "enum",
185
+ name: "Align",
186
+ description: "Where the ribbon sits relative to the edge.",
187
+ absentIsDefault: !0,
188
+ default: "center",
189
+ control: "toggle",
190
+ block: !0,
191
+ options: [
192
+ {
193
+ value: "inner",
194
+ label: "Inner",
195
+ icon: "alignInner"
196
+ },
197
+ {
198
+ value: "center",
199
+ label: "Center",
200
+ icon: "alignCenter"
201
+ },
202
+ {
203
+ value: "outer",
204
+ label: "Outer",
205
+ icon: "alignOuter"
206
+ }
207
+ ]
208
+ },
209
+ dash: {
210
+ kind: "enum",
211
+ name: "Style",
212
+ description: "Solid, dashed or dotted. Dash lengths are multiples of the stroke width, so a style holds as the width changes.",
213
+ default: "solid",
214
+ control: "toggle",
215
+ block: !0,
216
+ encoding: g,
217
+ options: [
218
+ {
219
+ value: "solid",
220
+ label: "Solid",
221
+ icon: "dashSolid"
222
+ },
223
+ {
224
+ value: "dashed",
225
+ label: "Dashed",
226
+ icon: "dashDashed"
227
+ },
228
+ {
229
+ value: "dotted",
230
+ label: "Dotted",
231
+ icon: "dashDotted"
232
+ },
233
+ {
234
+ value: "custom",
235
+ label: "Custom",
236
+ icon: "dashCustom",
237
+ disabled: !0
238
+ }
239
+ ]
240
+ },
241
+ markerStart: C({
242
+ name: "Start",
243
+ description: "Marker at the first vertex of each open subpath.",
244
+ block: !0,
245
+ pair: {
246
+ with: ["data.stroke.markerMid", "data.stroke.markerEnd"],
247
+ label: "Markers"
248
+ }
249
+ }),
250
+ markerMid: C({
251
+ name: "Mid",
252
+ description: "Marker at every interior authored vertex.",
253
+ block: !0
254
+ }),
255
+ markerEnd: C({
256
+ name: "End",
257
+ description: "Marker at the last vertex of each open subpath.",
258
+ block: !0
259
+ })
260
+ }
261
+ }, E = {
262
+ name: "Layout",
263
+ members: {
264
+ "pose.x": {
265
+ kind: "number",
266
+ display: m,
267
+ name: "X",
268
+ description: "Left edge, world units.",
269
+ default: 0,
270
+ pair: {
271
+ with: "pose.y",
272
+ label: "Position"
273
+ }
274
+ },
275
+ "pose.y": {
276
+ kind: "number",
277
+ display: m,
278
+ name: "Y",
279
+ description: "Top edge, world units.",
280
+ default: 0
281
+ },
282
+ "pose.width": {
283
+ kind: "number",
284
+ display: m,
285
+ name: "W",
286
+ description: "Width, world units.",
287
+ default: 0,
288
+ min: 0,
289
+ pair: {
290
+ with: "pose.height",
291
+ label: "Size"
292
+ }
293
+ },
294
+ "pose.height": {
295
+ kind: "number",
296
+ display: m,
297
+ name: "H",
298
+ description: "Height, world units.",
299
+ default: 0,
300
+ min: 0
301
+ },
302
+ "pose.rotation": {
303
+ kind: "number",
304
+ name: "Rotation",
305
+ description: "Rotation about the box center.",
306
+ default: 0,
307
+ step: 1,
308
+ unit: p,
309
+ absentIsDefault: !0
310
+ },
311
+ "pose.transform": {
312
+ kind: "boolean",
313
+ name: "Skew",
314
+ description: "The skew or per-axis scale the box and rotation cannot hold. Off removes it.",
315
+ default: !1,
316
+ control: "switch",
317
+ encoding: b
318
+ }
319
+ }
79
320
  };
80
- function y(e = {}) {
321
+ function D(e = {}) {
81
322
  return {
82
323
  name: "Properties",
83
324
  members: {
84
- layout: {
85
- name: "Layout",
86
- members: {
87
- "pose.x": {
88
- kind: "number",
89
- name: "X",
90
- description: "Left edge, world units.",
91
- default: 0,
92
- pair: {
93
- with: "pose.y",
94
- label: "Position"
95
- }
96
- },
97
- "pose.y": {
98
- kind: "number",
99
- name: "Y",
100
- description: "Top edge, world units.",
101
- default: 0
102
- },
103
- "pose.width": {
104
- kind: "number",
105
- name: "W",
106
- description: "Width, world units.",
107
- default: 0,
108
- min: 0,
109
- pair: {
110
- with: "pose.height",
111
- label: "Size"
112
- }
113
- },
114
- "pose.height": {
115
- kind: "number",
116
- name: "H",
117
- description: "Height, world units.",
118
- default: 0,
119
- min: 0
120
- },
121
- "pose.rotation": {
122
- kind: "number",
123
- name: "Rotation",
124
- description: "Rotation about the box center.",
125
- default: 0,
126
- step: 1,
127
- unit: l,
128
- absentIsDefault: !0
129
- }
130
- }
131
- },
325
+ layout: E,
326
+ ...Object.fromEntries((e.generators ?? []).map((e) => [e, r[e]])),
132
327
  ...e.text ? { content: {
133
328
  name: "Content",
134
329
  members: { "data.text": {
@@ -143,179 +338,8 @@ function y(e = {}) {
143
338
  appearance: {
144
339
  name: "",
145
340
  members: {
146
- "data.fill": v,
147
- "data.stroke": {
148
- kind: "object",
149
- name: "Stroke",
150
- description: "Stroke paint and line geometry.",
151
- default: {
152
- paint: {
153
- kind: "solid",
154
- color: "#000000ff"
155
- },
156
- width: 1
157
- },
158
- block: !0,
159
- children: {
160
- width: {
161
- kind: "number",
162
- name: "Width",
163
- description: "Stroke width, world units.",
164
- absentIsDefault: !0,
165
- default: 1,
166
- min: 0,
167
- max: 20,
168
- step: .5,
169
- control: "slider",
170
- icon: "strokeWidth",
171
- block: !0
172
- },
173
- paint: {
174
- kind: "paint",
175
- name: "Paint",
176
- description: "Stroke paint.",
177
- default: {
178
- kind: "solid",
179
- color: "#000000ff"
180
- },
181
- alpha: !0,
182
- block: !0
183
- },
184
- cap: {
185
- kind: "enum",
186
- name: "Cap",
187
- description: "How an open end is drawn.",
188
- absentIsDefault: !0,
189
- default: "butt",
190
- control: "toggle",
191
- block: !0,
192
- pair: {
193
- with: ["data.stroke.join", "data.stroke.align"],
194
- label: "Line"
195
- },
196
- options: [
197
- {
198
- value: "butt",
199
- label: "Butt",
200
- icon: "capButt"
201
- },
202
- {
203
- value: "round",
204
- label: "Round",
205
- icon: "capRound"
206
- },
207
- {
208
- value: "square",
209
- label: "Square",
210
- icon: "capSquare"
211
- }
212
- ]
213
- },
214
- join: {
215
- kind: "enum",
216
- name: "Join",
217
- description: "How a corner is drawn.",
218
- absentIsDefault: !0,
219
- default: "miter",
220
- control: "toggle",
221
- block: !0,
222
- options: [
223
- {
224
- value: "miter",
225
- label: "Miter",
226
- icon: "joinMiter"
227
- },
228
- {
229
- value: "round",
230
- label: "Round",
231
- icon: "joinRound"
232
- },
233
- {
234
- value: "bevel",
235
- label: "Bevel",
236
- icon: "joinBevel"
237
- }
238
- ]
239
- },
240
- align: {
241
- kind: "enum",
242
- name: "Align",
243
- description: "Where the ribbon sits relative to the edge.",
244
- absentIsDefault: !0,
245
- default: "center",
246
- control: "toggle",
247
- block: !0,
248
- options: [
249
- {
250
- value: "inner",
251
- label: "Inner",
252
- icon: "alignInner"
253
- },
254
- {
255
- value: "center",
256
- label: "Center",
257
- icon: "alignCenter"
258
- },
259
- {
260
- value: "outer",
261
- label: "Outer",
262
- icon: "alignOuter"
263
- }
264
- ]
265
- },
266
- dash: {
267
- kind: "enum",
268
- name: "Style",
269
- description: "Solid, dashed or dotted. Dash lengths are multiples of the stroke width, so a style holds as the width changes.",
270
- default: "solid",
271
- control: "toggle",
272
- block: !0,
273
- encoding: d,
274
- options: [
275
- {
276
- value: "solid",
277
- label: "Solid",
278
- icon: "dashSolid"
279
- },
280
- {
281
- value: "dashed",
282
- label: "Dashed",
283
- icon: "dashDashed"
284
- },
285
- {
286
- value: "dotted",
287
- label: "Dotted",
288
- icon: "dashDotted"
289
- },
290
- {
291
- value: "custom",
292
- label: "Custom",
293
- icon: "dashCustom",
294
- disabled: !0
295
- }
296
- ]
297
- },
298
- markerStart: _({
299
- name: "Start",
300
- description: "Marker at the first vertex of each open subpath.",
301
- block: !0,
302
- pair: {
303
- with: ["data.stroke.markerMid", "data.stroke.markerEnd"],
304
- label: "Markers"
305
- }
306
- }),
307
- markerMid: _({
308
- name: "Mid",
309
- description: "Marker at every interior authored vertex.",
310
- block: !0
311
- }),
312
- markerEnd: _({
313
- name: "End",
314
- description: "Marker at the last vertex of each open subpath.",
315
- block: !0
316
- })
317
- }
318
- }
341
+ "data.fill": w,
342
+ "data.stroke": T
319
343
  }
320
344
  },
321
345
  ...e.text ? { text: {
@@ -341,6 +365,7 @@ function y(e = {}) {
341
365
  },
342
366
  fontSize: {
343
367
  kind: "number",
368
+ display: m,
344
369
  name: "Size",
345
370
  description: "Font size, world units.",
346
371
  absentIsDefault: !0,
@@ -376,7 +401,7 @@ function y(e = {}) {
376
401
  ],
377
402
  label: "Style"
378
403
  },
379
- encoding: p
404
+ encoding: v
380
405
  },
381
406
  underline: {
382
407
  kind: "boolean",
@@ -427,6 +452,7 @@ function y(e = {}) {
427
452
  },
428
453
  letterSpacing: {
429
454
  kind: "number",
455
+ display: m,
430
456
  name: "Tracking",
431
457
  description: "Extra advance per glyph, world units.",
432
458
  absentIsDefault: !0,
@@ -487,6 +513,7 @@ function y(e = {}) {
487
513
  members: {
488
514
  lineHeight: {
489
515
  kind: "number",
516
+ display: m,
490
517
  name: "Leading",
491
518
  description: "Line height as a multiple of font size.",
492
519
  absentIsDefault: !0,
@@ -504,6 +531,7 @@ function y(e = {}) {
504
531
  },
505
532
  tabSize: {
506
533
  kind: "number",
534
+ display: m,
507
535
  name: "Tab size",
508
536
  description: "Distance between tab stops, in spaces.",
509
537
  absentIsDefault: !0,
@@ -543,7 +571,7 @@ function y(e = {}) {
543
571
  absentIsDefault: !0,
544
572
  default: "left",
545
573
  control: "toggle",
546
- encoding: m,
574
+ encoding: y,
547
575
  options: [
548
576
  {
549
577
  value: "left",
@@ -601,14 +629,24 @@ function y(e = {}) {
601
629
  }
602
630
  };
603
631
  }
604
- var b = e.map((e) => ({
605
- name: e,
606
- schema: y({ text: e === "text" })
607
- })), x = t.map((e) => ({
608
- name: e.name,
609
- schema: y({ text: e.name === "text" })
610
- }));
632
+ var O = {
633
+ polygon: ["polygon"],
634
+ star: ["star"],
635
+ path: ["polygon", "star"]
636
+ };
637
+ function k(e) {
638
+ let n = O[e];
639
+ return {
640
+ name: e,
641
+ schema: D({
642
+ text: e === "text",
643
+ ...n ? { generators: n } : {}
644
+ }),
645
+ ...n ? { settle: t } : {}
646
+ };
647
+ }
648
+ var A = e.map(k), j = n.map((e) => k(e.name));
611
649
  //#endregion
612
- export { b as defaultNodeProperties, x as inferredNodeProperties, l as rotationDegreesUnit };
650
+ export { A as defaultNodeProperties, j as inferredNodeProperties, p as rotationDegreesUnit };
613
651
 
614
652
  //# sourceMappingURL=defaultNodeProperties.js.map