@weasel-js/core 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1003) hide show
  1. package/CHANGELOG.md +764 -0
  2. package/README.md +7 -8
  3. package/dist/WeaselProvider.js +15 -0
  4. package/dist/WeaselProvider.js.map +1 -0
  5. package/dist/affordances/composeAffordanceLayer.js +224 -0
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -0
  7. package/dist/affordances/cornerResize.js +69 -0
  8. package/dist/affordances/cornerResize.js.map +1 -0
  9. package/dist/affordances/hitAffordanceRegions.js +138 -0
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -0
  11. package/dist/affordances/pathAnchors.js +66 -0
  12. package/dist/affordances/pathAnchors.js.map +1 -0
  13. package/dist/affordances/rotationHandle.js +103 -0
  14. package/dist/affordances/rotationHandle.js.map +1 -0
  15. package/dist/animation/behaviors/momentum.js +118 -0
  16. package/dist/animation/behaviors/momentum.js.map +1 -0
  17. package/dist/animation/colorHelpers.js +135 -0
  18. package/dist/animation/colorHelpers.js.map +1 -0
  19. package/dist/animation/colorRegistry.js +37 -0
  20. package/dist/animation/colorRegistry.js.map +1 -0
  21. package/dist/animation/index.js +20 -0
  22. package/dist/animation/loop.js +62 -0
  23. package/dist/animation/loop.js.map +1 -0
  24. package/dist/animation/observe.js +23 -0
  25. package/dist/animation/observe.js.map +1 -0
  26. package/dist/animation/poseHelpers.js +50 -0
  27. package/dist/animation/poseHelpers.js.map +1 -0
  28. package/dist/animation/reflow.js +121 -0
  29. package/dist/animation/reflow.js.map +1 -0
  30. package/dist/animation/rig/bindRig.js +74 -0
  31. package/dist/animation/rig/bindRig.js.map +1 -0
  32. package/dist/animation/rig/blendPoses.js +43 -0
  33. package/dist/animation/rig/blendPoses.js.map +1 -0
  34. package/dist/animation/rig/mirrorPose.js +19 -0
  35. package/dist/animation/rig/mirrorPose.js.map +1 -0
  36. package/dist/animation/rig/resolveSkeleton.js +33 -0
  37. package/dist/animation/rig/resolveSkeleton.js.map +1 -0
  38. package/dist/animation/rig/solveIk.js +103 -0
  39. package/dist/animation/rig/solveIk.js.map +1 -0
  40. package/dist/animation/rig/types.js +12 -0
  41. package/dist/animation/rig/types.js.map +1 -0
  42. package/dist/animation/rig/useRig.js +23 -0
  43. package/dist/animation/rig/useRig.js.map +1 -0
  44. package/dist/animation/slew.js +27 -0
  45. package/dist/animation/slew.js.map +1 -0
  46. package/dist/animation/stagger.js +138 -0
  47. package/dist/animation/stagger.js.map +1 -0
  48. package/dist/animation/timeline/booking.js +106 -0
  49. package/dist/animation/timeline/booking.js.map +1 -0
  50. package/dist/animation/timeline/createTimeline.js +116 -0
  51. package/dist/animation/timeline/createTimeline.js.map +1 -0
  52. package/dist/animation/timeline/sampleTrack.js +29 -0
  53. package/dist/animation/timeline/sampleTrack.js.map +1 -0
  54. package/dist/animation/useAnimator.js +329 -0
  55. package/dist/animation/useAnimator.js.map +1 -0
  56. package/dist/animation/wrappers/animateLifecycle.js +40 -0
  57. package/dist/animation/wrappers/animateLifecycle.js.map +1 -0
  58. package/dist/animation/wrappers/animateOnSetPose.js +44 -0
  59. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -0
  60. package/dist/{autoPoseDescriptor-_XOyF7t4.d.ts → autoPoseDescriptor-BT_vp9FO.d.ts} +2 -2
  61. package/dist/{builtins-DLn2lCr_.d.ts → builtins-BSUfH8nU.d.ts} +738 -513
  62. package/dist/canvas/Canvas.js +608 -0
  63. package/dist/canvas/Canvas.js.map +1 -0
  64. package/dist/canvas/CanvasView.js +255 -0
  65. package/dist/canvas/CanvasView.js.map +1 -0
  66. package/dist/canvas/CursorCoordsHud.js +75 -0
  67. package/dist/canvas/CursorCoordsHud.js.map +1 -0
  68. package/dist/canvas/DrawCanvas.js +67 -0
  69. package/dist/canvas/DrawCanvas.js.map +1 -0
  70. package/dist/canvas/MinimapCanvas.js +139 -0
  71. package/dist/canvas/MinimapCanvas.js.map +1 -0
  72. package/dist/canvas/ModalityHud.js +66 -0
  73. package/dist/canvas/ModalityHud.js.map +1 -0
  74. package/dist/canvas/NodeShape.js +391 -0
  75. package/dist/canvas/NodeShape.js.map +1 -0
  76. package/dist/canvas/PickHud.js +93 -0
  77. package/dist/canvas/PickHud.js.map +1 -0
  78. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +10 -0
  79. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -0
  80. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -0
  81. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -0
  82. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +51 -0
  83. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -0
  84. package/dist/canvas/SceneCanvas/contributionFrameHooks.js +42 -0
  85. package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -0
  86. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +549 -0
  87. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -0
  88. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +26 -0
  89. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -0
  90. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +69 -0
  91. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -0
  92. package/dist/canvas/SceneCanvas/features.js +97 -0
  93. package/dist/canvas/SceneCanvas/features.js.map +1 -0
  94. package/dist/canvas/SceneCanvas/poseGeometry.js +46 -0
  95. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -0
  96. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +48 -0
  97. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -0
  98. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +70 -0
  99. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -0
  100. package/dist/canvas/SceneCanvas/useContributionRoles.js +75 -0
  101. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -0
  102. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +172 -0
  103. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -0
  104. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +69 -0
  105. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -0
  106. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +127 -0
  107. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -0
  108. package/dist/canvas/SceneCanvas/useViewportActions.js +30 -0
  109. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -0
  110. package/dist/canvas/SceneCanvas.js +992 -0
  111. package/dist/canvas/SceneCanvas.js.map +1 -0
  112. package/dist/canvas/SceneViewCanvas.js +54 -0
  113. package/dist/canvas/SceneViewCanvas.js.map +1 -0
  114. package/dist/canvas/accentColor.js +9 -0
  115. package/dist/canvas/accentColor.js.map +1 -0
  116. package/dist/canvas/affordanceAt.js +63 -0
  117. package/dist/canvas/affordanceAt.js.map +1 -0
  118. package/dist/canvas/buildSceneTree.js +65 -0
  119. package/dist/canvas/buildSceneTree.js.map +1 -0
  120. package/dist/canvas/canvasRenderer.js +89 -0
  121. package/dist/canvas/canvasRenderer.js.map +1 -0
  122. package/dist/canvas/colorOverrides.js +16 -0
  123. package/dist/canvas/colorOverrides.js.map +1 -0
  124. package/dist/canvas/defaultDrawOne.js +43 -0
  125. package/dist/canvas/defaultDrawOne.js.map +1 -0
  126. package/dist/canvas/deps/areaSelect.js +19 -0
  127. package/dist/canvas/deps/areaSelect.js.map +1 -0
  128. package/dist/canvas/deps/debug.js +9 -0
  129. package/dist/canvas/deps/debug.js.map +1 -0
  130. package/dist/canvas/deps/dispatcher.js +11 -0
  131. package/dist/canvas/deps/dispatcher.js.map +1 -0
  132. package/dist/canvas/deps/editAnchors.js +101 -0
  133. package/dist/canvas/deps/editAnchors.js.map +1 -0
  134. package/dist/canvas/deps/geometryProjection.js +11 -0
  135. package/dist/canvas/deps/geometryProjection.js.map +1 -0
  136. package/dist/canvas/deps/hitTestArea.js +51 -0
  137. package/dist/canvas/deps/hitTestArea.js.map +1 -0
  138. package/dist/canvas/deps/ingestion.js +31 -0
  139. package/dist/canvas/deps/ingestion.js.map +1 -0
  140. package/dist/canvas/deps/insert.js +116 -0
  141. package/dist/canvas/deps/insert.js.map +1 -0
  142. package/dist/canvas/deps/lassoSelect.js +20 -0
  143. package/dist/canvas/deps/lassoSelect.js.map +1 -0
  144. package/dist/canvas/deps/layout.js +34 -0
  145. package/dist/canvas/deps/layout.js.map +1 -0
  146. package/dist/canvas/deps/nodeAtPoint.js +19 -0
  147. package/dist/canvas/deps/nodeAtPoint.js.map +1 -0
  148. package/dist/canvas/deps/poseComposition.js +11 -0
  149. package/dist/canvas/deps/poseComposition.js.map +1 -0
  150. package/dist/canvas/deps/poseDescriptor.js +12 -0
  151. package/dist/canvas/deps/poseDescriptor.js.map +1 -0
  152. package/dist/canvas/deps/resizePolicy.js +35 -0
  153. package/dist/canvas/deps/resizePolicy.js.map +1 -0
  154. package/dist/canvas/deps/slice.js +99 -0
  155. package/dist/canvas/deps/slice.js.map +1 -0
  156. package/dist/canvas/deps/snap.js +11 -0
  157. package/dist/canvas/deps/snap.js.map +1 -0
  158. package/dist/canvas/deps/textEdit.js +21 -0
  159. package/dist/canvas/deps/textEdit.js.map +1 -0
  160. package/dist/canvas/deps/view.js +43 -0
  161. package/dist/canvas/deps/view.js.map +1 -0
  162. package/dist/canvas/derivedPath.js +47 -0
  163. package/dist/canvas/derivedPath.js.map +1 -0
  164. package/dist/canvas/drawEnvelope.js +22 -0
  165. package/dist/canvas/drawEnvelope.js.map +1 -0
  166. package/dist/canvas/getNodeAtPoint.js +18 -0
  167. package/dist/canvas/getNodeAtPoint.js.map +1 -0
  168. package/dist/canvas/hostAnchor.js +29 -0
  169. package/dist/canvas/hostAnchor.js.map +1 -0
  170. package/dist/canvas/hud.module.js +18 -0
  171. package/dist/canvas/hud.module.js.map +1 -0
  172. package/dist/canvas/insertPreviewExtent.js +103 -0
  173. package/dist/canvas/insertPreviewExtent.js.map +1 -0
  174. package/dist/canvas/kitRequirements.js +177 -0
  175. package/dist/canvas/kitRequirements.js.map +1 -0
  176. package/dist/canvas/layerOrder.js +66 -0
  177. package/dist/canvas/layerOrder.js.map +1 -0
  178. package/dist/canvas/layerSlots.js +14 -0
  179. package/dist/canvas/layerSlots.js.map +1 -0
  180. package/dist/canvas/minimapMath.js +80 -0
  181. package/dist/canvas/minimapMath.js.map +1 -0
  182. package/dist/canvas/mountedCanvases.js +20 -0
  183. package/dist/canvas/mountedCanvases.js.map +1 -0
  184. package/dist/canvas/overlayRoleStrokes.js +17 -0
  185. package/dist/canvas/overlayRoleStrokes.js.map +1 -0
  186. package/dist/canvas/paintCull.js +20 -0
  187. package/dist/canvas/paintCull.js.map +1 -0
  188. package/dist/canvas/pickWalk.js +158 -0
  189. package/dist/canvas/pickWalk.js.map +1 -0
  190. package/dist/canvas/planeClips.js +30 -0
  191. package/dist/canvas/planeClips.js.map +1 -0
  192. package/dist/canvas/poseRotation.js +35 -0
  193. package/dist/canvas/poseRotation.js.map +1 -0
  194. package/dist/canvas/rasterToPng.js +21 -0
  195. package/dist/canvas/rasterToPng.js.map +1 -0
  196. package/dist/canvas/renderDebugSnapshot.js +32 -0
  197. package/dist/canvas/renderDebugSnapshot.js.map +1 -0
  198. package/dist/canvas/renderNeeds.js +25 -0
  199. package/dist/canvas/renderNeeds.js.map +1 -0
  200. package/dist/canvas/renderSceneToPixels.js +143 -0
  201. package/dist/canvas/renderSceneToPixels.js.map +1 -0
  202. package/dist/canvas/sceneAdapter.js +270 -0
  203. package/dist/canvas/sceneAdapter.js.map +1 -0
  204. package/dist/canvas/sceneLayerPaint.js +37 -0
  205. package/dist/canvas/sceneLayerPaint.js.map +1 -0
  206. package/dist/canvas/sceneSlotWiring.js +20 -0
  207. package/dist/canvas/sceneSlotWiring.js.map +1 -0
  208. package/dist/canvas/sceneViewRender.js +72 -0
  209. package/dist/canvas/sceneViewRender.js.map +1 -0
  210. package/dist/canvas/slopsDebugLayer.js +61 -0
  211. package/dist/canvas/slopsDebugLayer.js.map +1 -0
  212. package/dist/canvas/surfaceContribution.js +15 -0
  213. package/dist/canvas/surfaceContribution.js.map +1 -0
  214. package/dist/canvas/toolPreview.js +39 -0
  215. package/dist/canvas/toolPreview.js.map +1 -0
  216. package/dist/canvas/useCanvasRenderer.js +11 -0
  217. package/dist/canvas/useCanvasRenderer.js.map +1 -0
  218. package/dist/canvas/useFrameLoop.js +60 -0
  219. package/dist/canvas/useFrameLoop.js.map +1 -0
  220. package/dist/canvas/useHostAnchor.js +71 -0
  221. package/dist/canvas/useHostAnchor.js.map +1 -0
  222. package/dist/canvas/useLateContentRedraw.js +21 -0
  223. package/dist/canvas/useLateContentRedraw.js.map +1 -0
  224. package/dist/canvas/useRedrawOn.js +21 -0
  225. package/dist/canvas/useRedrawOn.js.map +1 -0
  226. package/dist/canvas/useViewHelpers.js +120 -0
  227. package/dist/canvas/useViewHelpers.js.map +1 -0
  228. package/dist/canvas/viewInputs.js +17 -0
  229. package/dist/canvas/viewInputs.js.map +1 -0
  230. package/dist/canvas/viewRegistry.js +61 -0
  231. package/dist/canvas/viewRegistry.js.map +1 -0
  232. package/dist/canvas/wrapNodeOutput.js +14 -0
  233. package/dist/canvas/wrapNodeOutput.js.map +1 -0
  234. package/dist/clipboard.d.ts +10 -5
  235. package/dist/clipboard.js +3 -5
  236. package/dist/clone.d.ts +3 -3
  237. package/dist/clone.js +2 -5
  238. package/dist/core/adapters/arrayAdapter.js +85 -0
  239. package/dist/core/adapters/arrayAdapter.js.map +1 -0
  240. package/dist/core/adapters/useArrayAdapter.js +13 -0
  241. package/dist/core/adapters/useArrayAdapter.js.map +1 -0
  242. package/dist/core/applyOps.js +12 -0
  243. package/dist/core/applyOps.js.map +1 -0
  244. package/dist/core/device/index.js +4 -0
  245. package/dist/core/device/targets.js +17 -0
  246. package/dist/core/device/targets.js.map +1 -0
  247. package/dist/core/device/useDeviceProfile.js +75 -0
  248. package/dist/core/device/useDeviceProfile.js.map +1 -0
  249. package/dist/core/fillInPoseFrame.js +102 -0
  250. package/dist/core/fillInPoseFrame.js.map +1 -0
  251. package/dist/core/geometry/poseDescriptor.js +98 -0
  252. package/dist/core/geometry/poseDescriptor.js.map +1 -0
  253. package/dist/core/geometry/poseRotation.js +58 -0
  254. package/dist/core/geometry/poseRotation.js.map +1 -0
  255. package/dist/core/geometry/regionHit.js +102 -0
  256. package/dist/core/geometry/regionHit.js.map +1 -0
  257. package/dist/core/geometry/unionBounds.js +60 -0
  258. package/dist/core/geometry/unionBounds.js.map +1 -0
  259. package/dist/core/gradient.js +136 -0
  260. package/dist/core/gradient.js.map +1 -0
  261. package/dist/core/isPlainObject.js +11 -0
  262. package/dist/core/isPlainObject.js.map +1 -0
  263. package/dist/core/layers/render.js +150 -0
  264. package/dist/core/layers/render.js.map +1 -0
  265. package/dist/core/markerInset.js +24 -0
  266. package/dist/core/markerInset.js.map +1 -0
  267. package/dist/core/mixed.js +6 -0
  268. package/dist/core/mixed.js.map +1 -0
  269. package/dist/core/ops/arrange.js +31 -0
  270. package/dist/core/ops/arrange.js.map +1 -0
  271. package/dist/core/ops/create.js +32 -0
  272. package/dist/core/ops/create.js.map +1 -0
  273. package/dist/core/ops/createHistory.js +20 -0
  274. package/dist/core/ops/createHistory.js.map +1 -0
  275. package/dist/core/ops/delete.js +89 -0
  276. package/dist/core/ops/delete.js.map +1 -0
  277. package/dist/core/ops/registry.js +17 -0
  278. package/dist/core/ops/registry.js.map +1 -0
  279. package/dist/core/ops/reorder/algorithms.js +55 -0
  280. package/dist/core/ops/reorder/algorithms.js.map +1 -0
  281. package/dist/core/ops/reorder/index.js +140 -0
  282. package/dist/core/ops/reorder/index.js.map +1 -0
  283. package/dist/core/ops/reparent.js +52 -0
  284. package/dist/core/ops/reparent.js.map +1 -0
  285. package/dist/core/ops/select.js +34 -0
  286. package/dist/core/ops/select.js.map +1 -0
  287. package/dist/core/ops/setData.js +34 -0
  288. package/dist/core/ops/setData.js.map +1 -0
  289. package/dist/core/ops/setLayer.js +34 -0
  290. package/dist/core/ops/setLayer.js.map +1 -0
  291. package/dist/core/ops/setLayout.js +31 -0
  292. package/dist/core/ops/setLayout.js.map +1 -0
  293. package/dist/core/ops/setPath.js +57 -0
  294. package/dist/core/ops/setPath.js.map +1 -0
  295. package/dist/core/ops/setText.js +34 -0
  296. package/dist/core/ops/setText.js.map +1 -0
  297. package/dist/core/ops/slot.js +37 -0
  298. package/dist/core/ops/slot.js.map +1 -0
  299. package/dist/core/ops/transform.js +42 -0
  300. package/dist/core/ops/transform.js.map +1 -0
  301. package/dist/core/paintKinds.js +156 -0
  302. package/dist/core/paintKinds.js.map +1 -0
  303. package/dist/core/scene/NodeProperties.js +20 -0
  304. package/dist/core/scene/NodeProperties.js.map +1 -0
  305. package/dist/core/scene/NodeRouting.js +24 -0
  306. package/dist/core/scene/NodeRouting.js.map +1 -0
  307. package/dist/core/scene/arrivals.js +12 -0
  308. package/dist/core/scene/arrivals.js.map +1 -0
  309. package/dist/core/scene/composeFrame.js +29 -0
  310. package/dist/core/scene/composeFrame.js.map +1 -0
  311. package/dist/core/scene/depMemo.js +18 -0
  312. package/dist/core/scene/depMemo.js.map +1 -0
  313. package/dist/core/scene/dependents.js +66 -0
  314. package/dist/core/scene/dependents.js.map +1 -0
  315. package/dist/core/scene/derivedPath.js +31 -0
  316. package/dist/core/scene/derivedPath.js.map +1 -0
  317. package/dist/core/scene/effectivePose.js +78 -0
  318. package/dist/core/scene/effectivePose.js.map +1 -0
  319. package/dist/core/scene/kitRegistry.js +33 -0
  320. package/dist/core/scene/kitRegistry.js.map +1 -0
  321. package/dist/core/scene/layoutPass.js +96 -0
  322. package/dist/core/scene/layoutPass.js.map +1 -0
  323. package/dist/core/scene/nodeFnFields.js +83 -0
  324. package/dist/core/scene/nodeFnFields.js.map +1 -0
  325. package/dist/core/scene/nodeMemo.js +28 -0
  326. package/dist/core/scene/nodeMemo.js.map +1 -0
  327. package/dist/core/scene/poseFeed.js +87 -0
  328. package/dist/core/scene/poseFeed.js.map +1 -0
  329. package/dist/core/scene/poseOverrides.js +52 -0
  330. package/dist/core/scene/poseOverrides.js.map +1 -0
  331. package/dist/core/scene/poseSnapshot.js +54 -0
  332. package/dist/core/scene/poseSnapshot.js.map +1 -0
  333. package/dist/core/scene/scene.js +1271 -0
  334. package/dist/core/scene/scene.js.map +1 -0
  335. package/dist/core/scene/types.js +6 -0
  336. package/dist/core/scene/types.js.map +1 -0
  337. package/dist/core/scene/useScene.js +32 -0
  338. package/dist/core/scene/useScene.js.map +1 -0
  339. package/dist/core/selection/chromeState.js +31 -0
  340. package/dist/core/selection/chromeState.js.map +1 -0
  341. package/dist/core/selection/selectionTarget.js +6 -0
  342. package/dist/core/selection/selectionTarget.js.map +1 -0
  343. package/dist/core/selection/useSelection.js +71 -0
  344. package/dist/core/selection/useSelection.js.map +1 -0
  345. package/dist/core/shapeKinds.js +54 -0
  346. package/dist/core/shapeKinds.js.map +1 -0
  347. package/dist/core/strokeMarkerShapes.js +139 -0
  348. package/dist/core/strokeMarkerShapes.js.map +1 -0
  349. package/dist/core/strokeMarkers.js +28 -0
  350. package/dist/core/strokeMarkers.js.map +1 -0
  351. package/dist/core/stylus/stylus.js +39 -0
  352. package/dist/core/stylus/stylus.js.map +1 -0
  353. package/dist/core/stylus/usePointerStylus.js +51 -0
  354. package/dist/core/stylus/usePointerStylus.js.map +1 -0
  355. package/dist/core/usePaintKinds.js +17 -0
  356. package/dist/core/usePaintKinds.js.map +1 -0
  357. package/dist/core/viewport/clampView.js +24 -0
  358. package/dist/core/viewport/clampView.js.map +1 -0
  359. package/dist/core/viewport/clientToWorld.js +8 -0
  360. package/dist/core/viewport/clientToWorld.js.map +1 -0
  361. package/dist/core/viewport/createVelocityTracker.js +39 -0
  362. package/dist/core/viewport/createVelocityTracker.js.map +1 -0
  363. package/dist/core/viewport/fitToBounds.js +18 -0
  364. package/dist/core/viewport/fitToBounds.js.map +1 -0
  365. package/dist/core/viewport/fitViewToBounds.js +36 -0
  366. package/dist/core/viewport/fitViewToBounds.js.map +1 -0
  367. package/dist/core/viewport/interpolateView.js +34 -0
  368. package/dist/core/viewport/interpolateView.js.map +1 -0
  369. package/dist/core/viewport/meanScale.js +8 -0
  370. package/dist/core/viewport/meanScale.js.map +1 -0
  371. package/dist/core/viewport/parallax.js +111 -0
  372. package/dist/core/viewport/parallax.js.map +1 -0
  373. package/dist/core/viewport/pxExtent.js +42 -0
  374. package/dist/core/viewport/pxExtent.js.map +1 -0
  375. package/dist/core/viewport/sceneNodeClientRect.js +18 -0
  376. package/dist/core/viewport/sceneNodeClientRect.js.map +1 -0
  377. package/dist/core/viewport/screenSlop.js +27 -0
  378. package/dist/core/viewport/screenSlop.js.map +1 -0
  379. package/dist/core/viewport/useAutoCenter.js +32 -0
  380. package/dist/core/viewport/useAutoCenter.js.map +1 -0
  381. package/dist/core/viewport/useCanvasSize.js +29 -0
  382. package/dist/core/viewport/useCanvasSize.js.map +1 -0
  383. package/dist/core/viewport/useDecayLoop.js +63 -0
  384. package/dist/core/viewport/useDecayLoop.js.map +1 -0
  385. package/dist/core/viewport/useVelocityTracker.js +10 -0
  386. package/dist/core/viewport/useVelocityTracker.js.map +1 -0
  387. package/dist/core/viewport/useViewAnimation.js +63 -0
  388. package/dist/core/viewport/useViewAnimation.js.map +1 -0
  389. package/dist/core/viewport/view.js +37 -0
  390. package/dist/core/viewport/view.js.map +1 -0
  391. package/dist/core/viewport/viewTransform.js +11 -0
  392. package/dist/core/viewport/viewTransform.js.map +1 -0
  393. package/dist/core/viewport/viewportWorldRect.js +13 -0
  394. package/dist/core/viewport/viewportWorldRect.js.map +1 -0
  395. package/dist/core/viewport/wheelHandler.js +30 -0
  396. package/dist/core/viewport/wheelHandler.js.map +1 -0
  397. package/dist/core/viewport/zoomAt.js +22 -0
  398. package/dist/core/viewport/zoomAt.js.map +1 -0
  399. package/dist/core/viewport/zoomBounds.js +20 -0
  400. package/dist/core/viewport/zoomBounds.js.map +1 -0
  401. package/dist/{pointSnapToGrid-Dp2IxLGb.d.ts → cornerHandles-CDcZOV8h.d.ts} +3 -13
  402. package/dist/debug/createDebugOverlayLayer.js +358 -0
  403. package/dist/debug/createDebugOverlayLayer.js.map +1 -0
  404. package/dist/debug/createDebugSink.js +83 -0
  405. package/dist/debug/createDebugSink.js.map +1 -0
  406. package/dist/debug/defaultTheme.js +31 -0
  407. package/dist/debug/defaultTheme.js.map +1 -0
  408. package/dist/debug/flag.js +41 -0
  409. package/dist/debug/flag.js.map +1 -0
  410. package/dist/debug/frameStats.js +16 -0
  411. package/dist/debug/frameStats.js.map +1 -0
  412. package/dist/debug/parseDebugFlags.js +32 -0
  413. package/dist/debug/parseDebugFlags.js.map +1 -0
  414. package/dist/features/chrome-caps/buildChromeCtx.js +16 -0
  415. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -0
  416. package/dist/features/chrome-caps/conditions.js +36 -0
  417. package/dist/features/chrome-caps/conditions.js.map +1 -0
  418. package/dist/features/chrome-caps/defaults.js +26 -0
  419. package/dist/features/chrome-caps/defaults.js.map +1 -0
  420. package/dist/features/chrome-caps/index.js +7 -0
  421. package/dist/features/chrome-caps/resolve.js +23 -0
  422. package/dist/features/chrome-caps/resolve.js.map +1 -0
  423. package/dist/features/chrome-caps/useHoverTracking.js +27 -0
  424. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -0
  425. package/dist/features/cursor/paintedCursorLayer.js +60 -0
  426. package/dist/features/cursor/paintedCursorLayer.js.map +1 -0
  427. package/dist/features/focus/gateLayer.js +14 -0
  428. package/dist/features/focus/gateLayer.js.map +1 -0
  429. package/dist/features/focus/useCanvasFocus.js +29 -0
  430. package/dist/features/focus/useCanvasFocus.js.map +1 -0
  431. package/dist/features/groups/children.js +23 -0
  432. package/dist/features/groups/children.js.map +1 -0
  433. package/dist/features/groups/composePose.js +67 -0
  434. package/dist/features/groups/composePose.js.map +1 -0
  435. package/dist/features/groups/nestedHit.js +40 -0
  436. package/dist/features/groups/nestedHit.js.map +1 -0
  437. package/dist/features/groups/unionOfChildren.js +15 -0
  438. package/dist/features/groups/unionOfChildren.js.map +1 -0
  439. package/dist/features/images/imageCache.js +94 -0
  440. package/dist/features/images/imageCache.js.map +1 -0
  441. package/dist/features/ingestion/contentHandlers.js +37 -0
  442. package/dist/features/ingestion/contentHandlers.js.map +1 -0
  443. package/dist/features/ingestion/imageHandler.js +45 -0
  444. package/dist/features/ingestion/imageHandler.js.map +1 -0
  445. package/dist/features/ingestion/index.js +8 -0
  446. package/dist/features/ingestion/openFilePicker.js +15 -0
  447. package/dist/features/ingestion/openFilePicker.js.map +1 -0
  448. package/dist/features/ingestion/registerKitHandlers.js +26 -0
  449. package/dist/features/ingestion/registerKitHandlers.js.map +1 -0
  450. package/dist/features/ingestion/svgHandler.js +58 -0
  451. package/dist/features/ingestion/svgHandler.js.map +1 -0
  452. package/dist/features/ingestion/weaselJsonHandler.js +39 -0
  453. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -0
  454. package/dist/features/longPress/longPressFeedback.js +96 -0
  455. package/dist/features/longPress/longPressFeedback.js.map +1 -0
  456. package/dist/features/meshPaint/bake.js +79 -0
  457. package/dist/features/meshPaint/bake.js.map +1 -0
  458. package/dist/features/meshPaint/bakeCache.js +59 -0
  459. package/dist/features/meshPaint/bakeCache.js.map +1 -0
  460. package/dist/features/meshPaint/handles.js +86 -0
  461. package/dist/features/meshPaint/handles.js.map +1 -0
  462. package/dist/features/meshPaint/lazyKind.js +1298 -0
  463. package/dist/features/meshPaint/lazyKind.js.map +1 -0
  464. package/dist/features/meshPaint/meshPaint.js +236 -0
  465. package/dist/features/meshPaint/meshPaint.js.map +1 -0
  466. package/dist/features/meshPaint/meshShader.js +6 -0
  467. package/dist/features/meshPaint/meshShader.js.map +1 -0
  468. package/dist/features/meshPaint/register.js +7 -0
  469. package/dist/features/meshPaint/register.js.map +1 -0
  470. package/dist/features/meshPaint/surface.js +110 -0
  471. package/dist/features/meshPaint/surface.js.map +1 -0
  472. package/dist/features/minimap/actions.js +53 -0
  473. package/dist/features/minimap/actions.js.map +1 -0
  474. package/dist/features/minimap/createMinimapContribution.js +96 -0
  475. package/dist/features/minimap/createMinimapContribution.js.map +1 -0
  476. package/dist/features/minimap/layers.js +103 -0
  477. package/dist/features/minimap/layers.js.map +1 -0
  478. package/dist/features/modes/modeLayers.js +113 -0
  479. package/dist/features/modes/modeLayers.js.map +1 -0
  480. package/dist/features/overlays/useNodeOverlayFrame.js +103 -0
  481. package/dist/features/overlays/useNodeOverlayFrame.js.map +1 -0
  482. package/dist/features/parallax/createParallaxLayer.js +26 -0
  483. package/dist/features/parallax/createParallaxLayer.js.map +1 -0
  484. package/dist/features/parallax/createParallaxPlane.js +26 -0
  485. package/dist/features/parallax/createParallaxPlane.js.map +1 -0
  486. package/dist/features/paths/anchorEdits.js +156 -0
  487. package/dist/features/paths/anchorEdits.js.map +1 -0
  488. package/dist/features/paths/anchors.js +154 -0
  489. package/dist/features/paths/anchors.js.map +1 -0
  490. package/dist/features/paths/booleans.js +2 -0
  491. package/dist/features/paths/index.js +15 -0
  492. package/dist/features/paths/markerCommands.js +116 -0
  493. package/dist/features/paths/markerCommands.js.map +1 -0
  494. package/dist/features/paths/markerSites.js +59 -0
  495. package/dist/features/paths/markerSites.js.map +1 -0
  496. package/dist/features/paths/markers.js +95 -0
  497. package/dist/features/paths/markers.js.map +1 -0
  498. package/dist/features/paths/nearestAnchor.js +36 -0
  499. package/dist/features/paths/nearestAnchor.js.map +1 -0
  500. package/dist/features/paths/originProjection.js +16 -0
  501. package/dist/features/paths/originProjection.js.map +1 -0
  502. package/dist/features/paths/pathEditingOverlayLayer.js +137 -0
  503. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -0
  504. package/dist/features/paths/pathInWorld.js +41 -0
  505. package/dist/features/paths/pathInWorld.js.map +1 -0
  506. package/dist/features/paths/pathLayer.js +44 -0
  507. package/dist/features/paths/pathLayer.js.map +1 -0
  508. package/dist/features/paths/penPreviewLayer.js +220 -0
  509. package/dist/features/paths/penPreviewLayer.js.map +1 -0
  510. package/dist/features/paths/poseDescriptor.js +44 -0
  511. package/dist/features/paths/poseDescriptor.js.map +1 -0
  512. package/dist/features/paths/tessellate/stroke.js +230 -0
  513. package/dist/features/paths/tessellate/stroke.js.map +1 -0
  514. package/dist/features/patterns/index.js +23 -0
  515. package/dist/features/patterns/index.js.map +1 -0
  516. package/dist/features/patterns/patterns-builtin.js +38 -0
  517. package/dist/features/patterns/patterns-builtin.js.map +1 -0
  518. package/dist/features/patterns/resolveSpec.js +57 -0
  519. package/dist/features/patterns/resolveSpec.js.map +1 -0
  520. package/dist/features/patterns/tileGeometry.js +158 -0
  521. package/dist/features/patterns/tileGeometry.js.map +1 -0
  522. package/dist/features/pointer/PointerContext.js +45 -0
  523. package/dist/features/pointer/PointerContext.js.map +1 -0
  524. package/dist/features/poseRun/usePoseRun.js +70 -0
  525. package/dist/features/poseRun/usePoseRun.js.map +1 -0
  526. package/dist/features/selection/SelectionContext.js +46 -0
  527. package/dist/features/selection/SelectionContext.js.map +1 -0
  528. package/dist/features/selection/overlay.js +442 -0
  529. package/dist/features/selection/overlay.js.map +1 -0
  530. package/dist/features/simulation/createSimulation.js +61 -0
  531. package/dist/features/simulation/createSimulation.js.map +1 -0
  532. package/dist/features/simulation/types.js +6 -0
  533. package/dist/features/simulation/types.js.map +1 -0
  534. package/dist/features/simulation/useSimulation.js +74 -0
  535. package/dist/features/simulation/useSimulation.js.map +1 -0
  536. package/dist/features/text/domRuns.js +258 -0
  537. package/dist/features/text/domRuns.js.map +1 -0
  538. package/dist/features/text/fitTextPose.js +38 -0
  539. package/dist/features/text/fitTextPose.js.map +1 -0
  540. package/dist/features/text/hitTest.js +45 -0
  541. package/dist/features/text/hitTest.js.map +1 -0
  542. package/dist/features/text/renderLabel.js +14 -0
  543. package/dist/features/text/renderLabel.js.map +1 -0
  544. package/dist/features/text/runs/effectiveRangeStyle.js +66 -0
  545. package/dist/features/text/runs/effectiveRangeStyle.js.map +1 -0
  546. package/dist/features/text/runs/flagRange.js +53 -0
  547. package/dist/features/text/runs/flagRange.js.map +1 -0
  548. package/dist/features/text/runs/rangeStyle.js +135 -0
  549. package/dist/features/text/runs/rangeStyle.js.map +1 -0
  550. package/dist/features/text/textCommand.js +59 -0
  551. package/dist/features/text/textCommand.js.map +1 -0
  552. package/dist/features/text/textLayer.js +35 -0
  553. package/dist/features/text/textLayer.js.map +1 -0
  554. package/dist/features/text/textToPath.js +181 -0
  555. package/dist/features/text/textToPath.js.map +1 -0
  556. package/dist/features/text/useSceneTextEdit.js +138 -0
  557. package/dist/features/text/useSceneTextEdit.js.map +1 -0
  558. package/dist/features/text/useTextEdit.js +465 -0
  559. package/dist/features/text/useTextEdit.js.map +1 -0
  560. package/dist/features/tiling/createTiledLayer.js +63 -0
  561. package/dist/features/tiling/createTiledLayer.js.map +1 -0
  562. package/dist/features/tiling/tiledProject.js +14 -0
  563. package/dist/features/tiling/tiledProject.js.map +1 -0
  564. package/dist/features/viewports/viewResolver.js +59 -0
  565. package/dist/features/viewports/viewResolver.js.map +1 -0
  566. package/dist/features/viewports/viewportLayer.js +58 -0
  567. package/dist/features/viewports/viewportLayer.js.map +1 -0
  568. package/dist/icons/ArrowIcon.js +23 -0
  569. package/dist/icons/ArrowIcon.js.map +1 -0
  570. package/dist/icons/EllipseIcon.js +21 -0
  571. package/dist/icons/EllipseIcon.js.map +1 -0
  572. package/dist/icons/EyedropperIcon.js +49 -0
  573. package/dist/icons/EyedropperIcon.js.map +1 -0
  574. package/dist/icons/HandIcon.js +59 -0
  575. package/dist/icons/HandIcon.js.map +1 -0
  576. package/dist/icons/ImageIcon.js +34 -0
  577. package/dist/icons/ImageIcon.js.map +1 -0
  578. package/dist/icons/LassoIcon.js +22 -0
  579. package/dist/icons/LassoIcon.js.map +1 -0
  580. package/dist/icons/LineIcon.js +22 -0
  581. package/dist/icons/LineIcon.js.map +1 -0
  582. package/dist/icons/PenIcon.js +36 -0
  583. package/dist/icons/PenIcon.js.map +1 -0
  584. package/dist/icons/PencilIcon.js +25 -0
  585. package/dist/icons/PencilIcon.js.map +1 -0
  586. package/dist/icons/PolygonIcon.js +19 -0
  587. package/dist/icons/PolygonIcon.js.map +1 -0
  588. package/dist/icons/RectIcon.js +37 -0
  589. package/dist/icons/RectIcon.js.map +1 -0
  590. package/dist/icons/SelectIcon.js +20 -0
  591. package/dist/icons/SelectIcon.js.map +1 -0
  592. package/dist/icons/StarIcon.js +19 -0
  593. package/dist/icons/StarIcon.js.map +1 -0
  594. package/dist/icons/TextIcon.js +19 -0
  595. package/dist/icons/TextIcon.js.map +1 -0
  596. package/dist/icons/UnknownIcon.js +33 -0
  597. package/dist/icons/UnknownIcon.js.map +1 -0
  598. package/dist/icons/_base.js +12 -0
  599. package/dist/icons/_base.js.map +1 -0
  600. package/dist/index.css +2 -62
  601. package/dist/index.d.ts +1955 -1891
  602. package/dist/index.js +312 -13
  603. package/dist/input/keyState.js +76 -0
  604. package/dist/input/keyState.js.map +1 -0
  605. package/dist/input/useKeyState.js +22 -0
  606. package/dist/input/useKeyState.js.map +1 -0
  607. package/dist/interactions/actions/actionShortcuts.js +32 -0
  608. package/dist/interactions/actions/actionShortcuts.js.map +1 -0
  609. package/dist/interactions/actions/align/align.js +81 -0
  610. package/dist/interactions/actions/align/align.js.map +1 -0
  611. package/dist/interactions/actions/booleans/booleans.js +120 -0
  612. package/dist/interactions/actions/booleans/booleans.js.map +1 -0
  613. package/dist/interactions/actions/booleans/useBooleans.js +20 -0
  614. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -0
  615. package/dist/interactions/actions/booleans/useBooleansAdapter.js +9 -0
  616. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -0
  617. package/dist/interactions/actions/clipboard/clipboardOps.js +94 -0
  618. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -0
  619. package/dist/interactions/actions/clipboard/materializePaste.js +25 -0
  620. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -0
  621. package/dist/interactions/actions/clipboard/wireFormat.js +43 -0
  622. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -0
  623. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +26 -0
  624. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +1 -0
  625. package/dist/interactions/actions/defaultCommitAdapter.js +42 -0
  626. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -0
  627. package/dist/interactions/actions/defaults/align.js +71 -0
  628. package/dist/interactions/actions/defaults/align.js.map +1 -0
  629. package/dist/interactions/actions/defaults/anchorEditing.js +235 -0
  630. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -0
  631. package/dist/interactions/actions/defaults/areaSelect.js +75 -0
  632. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -0
  633. package/dist/interactions/actions/defaults/booleans.js +52 -0
  634. package/dist/interactions/actions/defaults/booleans.js.map +1 -0
  635. package/dist/interactions/actions/defaults/cancelGesture.js +24 -0
  636. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -0
  637. package/dist/interactions/actions/defaults/clearSelection.js +19 -0
  638. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -0
  639. package/dist/interactions/actions/defaults/clipboard.js +78 -0
  640. package/dist/interactions/actions/defaults/clipboard.js.map +1 -0
  641. package/dist/interactions/actions/defaults/clone.js +96 -0
  642. package/dist/interactions/actions/defaults/clone.js.map +1 -0
  643. package/dist/interactions/actions/defaults/createOutlines.js +47 -0
  644. package/dist/interactions/actions/defaults/createOutlines.js.map +1 -0
  645. package/dist/interactions/actions/defaults/createPaintAction.js +85 -0
  646. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -0
  647. package/dist/interactions/actions/defaults/delete.js +61 -0
  648. package/dist/interactions/actions/defaults/delete.js.map +1 -0
  649. package/dist/interactions/actions/defaults/distribute.js +66 -0
  650. package/dist/interactions/actions/defaults/distribute.js.map +1 -0
  651. package/dist/interactions/actions/defaults/duplicate.js +83 -0
  652. package/dist/interactions/actions/defaults/duplicate.js.map +1 -0
  653. package/dist/interactions/actions/defaults/editAnchors.js +100 -0
  654. package/dist/interactions/actions/defaults/editAnchors.js.map +1 -0
  655. package/dist/interactions/actions/defaults/enterPathEdit.js +29 -0
  656. package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -0
  657. package/dist/interactions/actions/defaults/enterTextEdit.js +20 -0
  658. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -0
  659. package/dist/interactions/actions/defaults/escape.js +26 -0
  660. package/dist/interactions/actions/defaults/escape.js.map +1 -0
  661. package/dist/interactions/actions/defaults/exitPathEdit.js +22 -0
  662. package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -0
  663. package/dist/interactions/actions/defaults/flip.js +119 -0
  664. package/dist/interactions/actions/defaults/flip.js.map +1 -0
  665. package/dist/interactions/actions/defaults/freshNodeId.js +10 -0
  666. package/dist/interactions/actions/defaults/freshNodeId.js.map +1 -0
  667. package/dist/interactions/actions/defaults/group.js +131 -0
  668. package/dist/interactions/actions/defaults/group.js.map +1 -0
  669. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +40 -0
  670. package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +1 -0
  671. package/dist/interactions/actions/defaults/icons/actionGlyphs.js +10 -0
  672. package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +1 -0
  673. package/dist/interactions/actions/defaults/icons/alignIcons.js +173 -0
  674. package/dist/interactions/actions/defaults/icons/alignIcons.js.map +1 -0
  675. package/dist/interactions/actions/defaults/icons/booleanIcons.js +171 -0
  676. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -0
  677. package/dist/interactions/actions/defaults/icons/distributeIcons.js +63 -0
  678. package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +1 -0
  679. package/dist/interactions/actions/defaults/icons/editIcons.js +280 -0
  680. package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -0
  681. package/dist/interactions/actions/defaults/icons/outlineIcons.js +53 -0
  682. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -0
  683. package/dist/interactions/actions/defaults/ingest.js +58 -0
  684. package/dist/interactions/actions/defaults/ingest.js.map +1 -0
  685. package/dist/interactions/actions/defaults/insert.js +288 -0
  686. package/dist/interactions/actions/defaults/insert.js.map +1 -0
  687. package/dist/interactions/actions/defaults/insertPathAnchor.js +50 -0
  688. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -0
  689. package/dist/interactions/actions/defaults/lassoSelect.js +156 -0
  690. package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -0
  691. package/dist/interactions/actions/defaults/move.js +656 -0
  692. package/dist/interactions/actions/defaults/move.js.map +1 -0
  693. package/dist/interactions/actions/defaults/nudge.js +110 -0
  694. package/dist/interactions/actions/defaults/nudge.js.map +1 -0
  695. package/dist/interactions/actions/defaults/pinchZoom.js +63 -0
  696. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -0
  697. package/dist/interactions/actions/defaults/reorder.js +143 -0
  698. package/dist/interactions/actions/defaults/reorder.js.map +1 -0
  699. package/dist/interactions/actions/defaults/requiresSelection.js +10 -0
  700. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -0
  701. package/dist/interactions/actions/defaults/resize.js +332 -0
  702. package/dist/interactions/actions/defaults/resize.js.map +1 -0
  703. package/dist/interactions/actions/defaults/rotate.js +181 -0
  704. package/dist/interactions/actions/defaults/rotate.js.map +1 -0
  705. package/dist/interactions/actions/defaults/selectAll.js +27 -0
  706. package/dist/interactions/actions/defaults/selectAll.js.map +1 -0
  707. package/dist/interactions/actions/defaults/setFill.js +27 -0
  708. package/dist/interactions/actions/defaults/setFill.js.map +1 -0
  709. package/dist/interactions/actions/defaults/setFillOpacity.js +15 -0
  710. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -0
  711. package/dist/interactions/actions/defaults/setStroke.js +36 -0
  712. package/dist/interactions/actions/defaults/setStroke.js.map +1 -0
  713. package/dist/interactions/actions/defaults/setStrokeOpacity.js +21 -0
  714. package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -0
  715. package/dist/interactions/actions/defaults/slice.js +39 -0
  716. package/dist/interactions/actions/defaults/slice.js.map +1 -0
  717. package/dist/interactions/actions/defaults/sliceOps.js +60 -0
  718. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -0
  719. package/dist/interactions/actions/defaults/toolActivate.js +35 -0
  720. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -0
  721. package/dist/interactions/actions/defaults/toolResetToDefault.js +26 -0
  722. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -0
  723. package/dist/interactions/actions/defaults/undoRedo.js +51 -0
  724. package/dist/interactions/actions/defaults/undoRedo.js.map +1 -0
  725. package/dist/interactions/actions/defaults/viewportDragPan.js +88 -0
  726. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -0
  727. package/dist/interactions/actions/defaults/viewportWheelPan.js +57 -0
  728. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -0
  729. package/dist/interactions/actions/defaults/viewportZoom.js +143 -0
  730. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -0
  731. package/dist/interactions/actions/distribute/distribute.js +42 -0
  732. package/dist/interactions/actions/distribute/distribute.js.map +1 -0
  733. package/dist/interactions/actions/distribute/plan.js +29 -0
  734. package/dist/interactions/actions/distribute/plan.js.map +1 -0
  735. package/dist/interactions/actions/edit-anchors/geometry.js +61 -0
  736. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -0
  737. package/dist/interactions/actions/edit-anchors/handles.js +43 -0
  738. package/dist/interactions/actions/edit-anchors/handles.js.map +1 -0
  739. package/dist/interactions/actions/flip/helpers.js +35 -0
  740. package/dist/interactions/actions/flip/helpers.js.map +1 -0
  741. package/dist/interactions/actions/geometryProjection.js +18 -0
  742. package/dist/interactions/actions/geometryProjection.js.map +1 -0
  743. package/dist/interactions/actions/gestureLifecycle.js +44 -0
  744. package/dist/interactions/actions/gestureLifecycle.js.map +1 -0
  745. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +39 -0
  746. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -0
  747. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +36 -0
  748. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
  749. package/dist/interactions/actions/move/behaviors/snapToContainer.js +67 -0
  750. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -0
  751. package/dist/interactions/actions/move/gestureAdapter.js +37 -0
  752. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -0
  753. package/dist/interactions/actions/outlines/createOutlines.js +84 -0
  754. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -0
  755. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +9 -0
  756. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -0
  757. package/dist/interactions/actions/planeInput.js +168 -0
  758. package/dist/interactions/actions/planeInput.js.map +1 -0
  759. package/dist/interactions/actions/poseDescriptorDep.js +9 -0
  760. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -0
  761. package/dist/interactions/actions/poseFrame.js +38 -0
  762. package/dist/interactions/actions/poseFrame.js.map +1 -0
  763. package/dist/interactions/actions/previewOverrides.js +25 -0
  764. package/dist/interactions/actions/previewOverrides.js.map +1 -0
  765. package/dist/interactions/actions/resize/autoPoseDescriptor.js +32 -0
  766. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +1 -0
  767. package/dist/interactions/actions/resize/behaviors/clampMinSize.js +18 -0
  768. package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -0
  769. package/dist/interactions/actions/resize/behaviors/index.js +8 -0
  770. package/dist/interactions/actions/resize/behaviors/index.js.map +1 -0
  771. package/dist/interactions/actions/resize/behaviors/lockAspect.js +24 -0
  772. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -0
  773. package/dist/interactions/actions/resize/cornerHandles.js +72 -0
  774. package/dist/interactions/actions/resize/cornerHandles.js.map +1 -0
  775. package/dist/interactions/actions/resolveOverlays.js +60 -0
  776. package/dist/interactions/actions/resolveOverlays.js.map +1 -0
  777. package/dist/interactions/actions/resolvePreviews.js +61 -0
  778. package/dist/interactions/actions/resolvePreviews.js.map +1 -0
  779. package/dist/interactions/actions/rotate/geometry.js +46 -0
  780. package/dist/interactions/actions/rotate/geometry.js.map +1 -0
  781. package/dist/interactions/actions/rotate/handle.js +27 -0
  782. package/dist/interactions/actions/rotate/handle.js.map +1 -0
  783. package/dist/interactions/actions/spatialReference.js +42 -0
  784. package/dist/interactions/actions/spatialReference.js.map +1 -0
  785. package/dist/interactions/actions/useStandardActions.js +142 -0
  786. package/dist/interactions/actions/useStandardActions.js.map +1 -0
  787. package/dist/interactions/gestures/dragGesture/dragGesture.js +111 -0
  788. package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -0
  789. package/dist/interactions/gestures/dragRadial/dragRadial.js +117 -0
  790. package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -0
  791. package/dist/interactions/gestures/dragRect/dragRect.js +164 -0
  792. package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -0
  793. package/dist/interactions/gestures/handleDrag/handleDrag.js +46 -0
  794. package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -0
  795. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +118 -0
  796. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -0
  797. package/dist/interactions/gestures/shared/originProjection.js +42 -0
  798. package/dist/interactions/gestures/shared/originProjection.js.map +1 -0
  799. package/dist/interactions/gestures/shared/screenTolerance.js +21 -0
  800. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -0
  801. package/dist/interactions/gestures/shared/snap.js +24 -0
  802. package/dist/interactions/gestures/shared/snap.js.map +1 -0
  803. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +30 -0
  804. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -0
  805. package/dist/layout/arrivals.js +36 -0
  806. package/dist/layout/arrivals.js.map +1 -0
  807. package/dist/{math-MCQcf_gc.d.ts → math-CUMxmZzn.d.ts} +8 -116
  808. package/dist/math.d.ts +4 -5
  809. package/dist/math.js +6 -4
  810. package/dist/mesh.d.ts +268 -0
  811. package/dist/mesh.js +7 -0
  812. package/dist/move.d.ts +7 -49
  813. package/dist/move.js +3 -142
  814. package/dist/originProjection-BSn4xiEy.d.ts +57 -0
  815. package/dist/patterns-builtin.js +3 -3
  816. package/dist/{poseDescriptor-rZa9W5hJ.d.ts → poseDescriptor-CjSXMf8X.d.ts} +3 -3
  817. package/dist/registerProgram-ateHDGjw.d.ts +193 -0
  818. package/dist/renderer/DrawCommand.js +6 -0
  819. package/dist/renderer/DrawCommand.js.map +1 -0
  820. package/dist/renderer/WeaselRenderer.js +328 -0
  821. package/dist/renderer/WeaselRenderer.js.map +1 -0
  822. package/dist/renderer/cache/GLImageCache.js +64 -0
  823. package/dist/renderer/cache/GLImageCache.js.map +1 -0
  824. package/dist/renderer/cache/GLMeshCache.js +102 -0
  825. package/dist/renderer/cache/GLMeshCache.js.map +1 -0
  826. package/dist/renderer/cache/GLTextureCache.js +51 -0
  827. package/dist/renderer/cache/GLTextureCache.js.map +1 -0
  828. package/dist/renderer/cache/GradientRampAtlas.js +82 -0
  829. package/dist/renderer/cache/GradientRampAtlas.js.map +1 -0
  830. package/dist/renderer/cache/cache.js +13 -0
  831. package/dist/renderer/cache/cache.js.map +1 -0
  832. package/dist/renderer/cache/markerCommandCache.js +59 -0
  833. package/dist/renderer/cache/markerCommandCache.js.map +1 -0
  834. package/dist/renderer/cache/outlineMeshCache.js +15 -0
  835. package/dist/renderer/cache/outlineMeshCache.js.map +1 -0
  836. package/dist/renderer/cache/outlineStrokeMeshCache.js +31 -0
  837. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +1 -0
  838. package/dist/renderer/cache/strokeMeshCache.js +44 -0
  839. package/dist/renderer/cache/strokeMeshCache.js.map +1 -0
  840. package/dist/renderer/cullDrawCommands.js +89 -0
  841. package/dist/renderer/cullDrawCommands.js.map +1 -0
  842. package/dist/renderer/draw.js +1109 -0
  843. package/dist/renderer/draw.js.map +1 -0
  844. package/dist/renderer/drawBatch.js +168 -0
  845. package/dist/renderer/drawBatch.js.map +1 -0
  846. package/dist/renderer/effects/EffectTargets.js +45 -0
  847. package/dist/renderer/effects/EffectTargets.js.map +1 -0
  848. package/dist/renderer/effects/builtins.js +31 -0
  849. package/dist/renderer/effects/builtins.js.map +1 -0
  850. package/dist/renderer/effects/composite.js +9 -0
  851. package/dist/renderer/effects/composite.js.map +1 -0
  852. package/dist/renderer/effects/effectPrelude.js +10 -0
  853. package/dist/renderer/effects/effectPrelude.js.map +1 -0
  854. package/dist/renderer/effects/types.js +10 -0
  855. package/dist/renderer/effects/types.js.map +1 -0
  856. package/dist/renderer/index.js +19 -0
  857. package/dist/renderer/math/color.js +341 -0
  858. package/dist/renderer/math/color.js.map +1 -0
  859. package/dist/renderer/math/mat3.js +71 -0
  860. package/dist/renderer/math/mat3.js.map +1 -0
  861. package/dist/renderer/math/patternSpace.js +22 -0
  862. package/dist/renderer/math/patternSpace.js.map +1 -0
  863. package/dist/renderer/math/viewToMat3.js +19 -0
  864. package/dist/renderer/math/viewToMat3.js.map +1 -0
  865. package/dist/renderer/paintResources.js +18 -0
  866. package/dist/renderer/paintResources.js.map +1 -0
  867. package/dist/renderer/paintScratch.js +37 -0
  868. package/dist/renderer/paintScratch.js.map +1 -0
  869. package/dist/renderer/shaders/ShaderProgram.js +74 -0
  870. package/dist/renderer/shaders/ShaderProgram.js.map +1 -0
  871. package/dist/renderer/shaders/batchFill.js +118 -0
  872. package/dist/renderer/shaders/batchFill.js.map +1 -0
  873. package/dist/renderer/shaders/customPrelude.js +34 -0
  874. package/dist/renderer/shaders/customPrelude.js.map +1 -0
  875. package/dist/renderer/shaders/extractUniformNames.js +184 -0
  876. package/dist/renderer/shaders/extractUniformNames.js.map +1 -0
  877. package/dist/renderer/shaders/glyphPaint.js +61 -0
  878. package/dist/renderer/shaders/glyphPaint.js.map +1 -0
  879. package/dist/renderer/shaders/gradFill.js +30 -0
  880. package/dist/renderer/shaders/gradFill.js.map +1 -0
  881. package/dist/renderer/shaders/imageFill.js +14 -0
  882. package/dist/renderer/shaders/imageFill.js.map +1 -0
  883. package/dist/renderer/shaders/pathFill.js +13 -0
  884. package/dist/renderer/shaders/pathFill.js.map +1 -0
  885. package/dist/renderer/shaders/patternFill.js +24 -0
  886. package/dist/renderer/shaders/patternFill.js.map +1 -0
  887. package/dist/renderer/shaders/registerProgram.js +18 -0
  888. package/dist/renderer/shaders/registerProgram.js.map +1 -0
  889. package/dist/renderer/spriteSheet.js +14 -0
  890. package/dist/renderer/spriteSheet.js.map +1 -0
  891. package/dist/renderer/state/GroupState.js +77 -0
  892. package/dist/renderer/state/GroupState.js.map +1 -0
  893. package/dist/renderer/syntheticItalic.js +6 -0
  894. package/dist/renderer/syntheticItalic.js.map +1 -0
  895. package/dist/renderer/textures/registerTexture.js +14 -0
  896. package/dist/renderer/textures/registerTexture.js.map +1 -0
  897. package/dist/renderer.d.ts +11 -21
  898. package/dist/renderer.js +18 -13
  899. package/dist/resize.d.ts +10 -46
  900. package/dist/resize.js +7 -5
  901. package/dist/routing.js +2 -3
  902. package/dist/scheduling/useVisibleRaf.js +69 -0
  903. package/dist/scheduling/useVisibleRaf.js.map +1 -0
  904. package/dist/test-hook/createTestHook.js +39 -0
  905. package/dist/test-hook/createTestHook.js.map +1 -0
  906. package/dist/test-hook/install.js +12 -0
  907. package/dist/test-hook/install.js.map +1 -0
  908. package/dist/test-seams-fYf6m5pu.d.ts +356 -0
  909. package/dist/test-seams.d.ts +6 -0
  910. package/dist/test-seams.js +3 -0
  911. package/dist/tools/builtin/ellipse/useEllipseTool.js +33 -0
  912. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -0
  913. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +55 -0
  914. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -0
  915. package/dist/tools/builtin/hand/dragPanContribution.js +17 -0
  916. package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -0
  917. package/dist/tools/builtin/hand/useHandTool.js +31 -0
  918. package/dist/tools/builtin/hand/useHandTool.js.map +1 -0
  919. package/dist/tools/builtin/image/useImageTool.js +41 -0
  920. package/dist/tools/builtin/image/useImageTool.js.map +1 -0
  921. package/dist/tools/builtin/lasso/useLassoTool.js +42 -0
  922. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -0
  923. package/dist/tools/builtin/line/useLineTool.js +33 -0
  924. package/dist/tools/builtin/line/useLineTool.js.map +1 -0
  925. package/dist/tools/builtin/pen/usePenTool.js +414 -0
  926. package/dist/tools/builtin/pen/usePenTool.js.map +1 -0
  927. package/dist/tools/builtin/pencil/usePencilTool.js +36 -0
  928. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -0
  929. package/dist/tools/builtin/pickTopMostHit.js +45 -0
  930. package/dist/tools/builtin/pickTopMostHit.js.map +1 -0
  931. package/dist/tools/builtin/polygon/usePolygonTool.js +81 -0
  932. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -0
  933. package/dist/tools/builtin/rect/useRectTool.js +32 -0
  934. package/dist/tools/builtin/rect/useRectTool.js.map +1 -0
  935. package/dist/tools/builtin/select/selectionContributions.js +109 -0
  936. package/dist/tools/builtin/select/selectionContributions.js.map +1 -0
  937. package/dist/tools/builtin/select/useSelectTool.js +162 -0
  938. package/dist/tools/builtin/select/useSelectTool.js.map +1 -0
  939. package/dist/tools/builtin/shared/insertToolOptions.js +8 -0
  940. package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -0
  941. package/dist/tools/builtin/slice/useSliceTool.js +263 -0
  942. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -0
  943. package/dist/tools/builtin/star/useStarTool.js +82 -0
  944. package/dist/tools/builtin/star/useStarTool.js.map +1 -0
  945. package/dist/tools/builtin/text/useTextTool.js +177 -0
  946. package/dist/tools/builtin/text/useTextTool.js.map +1 -0
  947. package/dist/tools/overlayBinding.js +8 -0
  948. package/dist/tools/overlayBinding.js.map +1 -0
  949. package/dist/tools/prefs.js +47 -0
  950. package/dist/tools/prefs.js.map +1 -0
  951. package/dist/tools/useKeybindings.js +66 -0
  952. package/dist/tools/useKeybindings.js.map +1 -0
  953. package/dist/{types-D-9QWBy5.d.ts → types-CA54-mAZ.d.ts} +181 -13
  954. package/dist/{types-qYpyTAiZ.d.ts → types-DSjd6W3n.d.ts} +32 -6
  955. package/dist/util/color.js +26 -0
  956. package/dist/util/color.js.map +1 -0
  957. package/dist/util/constrainTo45.js +17 -0
  958. package/dist/util/constrainTo45.js.map +1 -0
  959. package/dist/util/paint.js +72 -0
  960. package/dist/util/paint.js.map +1 -0
  961. package/dist/version.js +6 -0
  962. package/dist/version.js.map +1 -0
  963. package/package.json +29 -19
  964. package/dist/chunk-3TY6FHAF.js +0 -170
  965. package/dist/chunk-3TY6FHAF.js.map +0 -1
  966. package/dist/chunk-DGWNNKGD.js +0 -248
  967. package/dist/chunk-DGWNNKGD.js.map +0 -1
  968. package/dist/chunk-G4ZGQMY7.js +0 -33372
  969. package/dist/chunk-G4ZGQMY7.js.map +0 -1
  970. package/dist/chunk-L5YNZYEG.js +0 -648
  971. package/dist/chunk-L5YNZYEG.js.map +0 -1
  972. package/dist/chunk-LU4IJ52W.js +0 -111
  973. package/dist/chunk-LU4IJ52W.js.map +0 -1
  974. package/dist/chunk-M24CLARN.js +0 -28
  975. package/dist/chunk-M24CLARN.js.map +0 -1
  976. package/dist/chunk-NE27EOLP.js +0 -146
  977. package/dist/chunk-NE27EOLP.js.map +0 -1
  978. package/dist/chunk-PNNZSYRD.js +0 -318
  979. package/dist/chunk-PNNZSYRD.js.map +0 -1
  980. package/dist/chunk-UPZY4ART.js +0 -29
  981. package/dist/chunk-UPZY4ART.js.map +0 -1
  982. package/dist/chunk-WPNA6L5O.js +0 -250
  983. package/dist/chunk-WPNA6L5O.js.map +0 -1
  984. package/dist/chunk-XMAWPGTK.js +0 -128
  985. package/dist/chunk-XMAWPGTK.js.map +0 -1
  986. package/dist/clipboard.js.map +0 -1
  987. package/dist/clone.js.map +0 -1
  988. package/dist/grid-CY5UKlZh.d.ts +0 -98
  989. package/dist/index.css.map +0 -1
  990. package/dist/index.js.map +0 -1
  991. package/dist/insert.d.ts +0 -36
  992. package/dist/insert.js +0 -81
  993. package/dist/insert.js.map +0 -1
  994. package/dist/math.js.map +0 -1
  995. package/dist/move.js.map +0 -1
  996. package/dist/path-JEV2c5If.d.ts +0 -48
  997. package/dist/patterns-builtin.js.map +0 -1
  998. package/dist/renderer.css +0 -62
  999. package/dist/renderer.css.map +0 -1
  1000. package/dist/renderer.js.map +0 -1
  1001. package/dist/resize.js.map +0 -1
  1002. package/dist/routing.js.map +0 -1
  1003. package/dist/types-D2tTKEU0.d.ts +0 -18
@@ -0,0 +1,18 @@
1
+ //#region src/interactions/actions/resize/behaviors/clampMinSize.ts
2
+ function e(e) {
3
+ let { minWidth: t, minHeight: n } = e;
4
+ return { onMove(e, { pose: r, anchor: i }) {
5
+ let { x: a, y: o, width: s, height: c } = r, l = !1;
6
+ if (i.x !== "free" && s < t && (i.x === "min" || (a = a + s - t), s = t, l = !0), i.y !== "free" && c < n && (i.y === "min" || (o = o + c - n), c = n, l = !0), l) return { pose: {
7
+ ...r,
8
+ x: a,
9
+ y: o,
10
+ width: s,
11
+ height: c
12
+ } };
13
+ } };
14
+ }
15
+ //#endregion
16
+ export { e as clampMinSize };
17
+
18
+ //# sourceMappingURL=clampMinSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clampMinSize.js","names":["clampMinSize","args","pose","changed","anchor","width","minWidth","x","height","minHeight","y"],"sources":["../../../../../src/interactions/actions/resize/behaviors/clampMinSize.ts"],"sourcesContent":["import type { BoundsConstraint } from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Resize constraint that stops a node shrinking past a minimum. The anchored\n * edge stays put, so clamping pushes the dragged edge back rather than moving\n * the node. */\nexport function clampMinSize<TPose extends Bounds>(args: {\n minWidth: number;\n minHeight: number;\n}): BoundsConstraint<TPose> {\n const { minWidth, minHeight } = args;\n return {\n onMove(_ctx, { pose, anchor }) {\n let { x, y, width, height } = pose;\n let changed = false;\n if (anchor.x !== 'free' && width < minWidth) {\n if (anchor.x === 'min') {\n // West edge is anchor; east edge was dragged. Hold x; widen to min.\n width = minWidth;\n } else {\n // East edge is anchor at originalRight = x + width. Hold the right;\n // shift x left so width = minWidth.\n const right = x + width;\n x = right - minWidth;\n width = minWidth;\n }\n changed = true;\n }\n if (anchor.y !== 'free' && height < minHeight) {\n if (anchor.y === 'min') {\n height = minHeight;\n } else {\n const bottom = y + height;\n y = bottom - minHeight;\n height = minHeight;\n }\n changed = true;\n }\n if (!changed) return;\n return { pose: { ...pose, x, y, width, height } };\n },\n };\n}\n"],"mappings":";AAMA,SAAgBA,EAAmC,GAGvB;CAC1B,IAAM,EAAE,aAAU,iBAAcC;CAChC,OAAO,EACL,OAAO,GAAM,EAAE,SAAM,aAAU;EAC7B,IAAI,EAAE,MAAG,MAAG,UAAO,cAAWC,GAC1BC,IAAU;EAwBd,IAvBIC,EAAO,MAAM,UAAUC,IAAQC,MAC7BF,EAAO,MAAM,UAOf,IADcG,IAAIF,IACNC,IALZ,IAAQA,GAQV,IAAU,KAERF,EAAO,MAAM,UAAUI,IAASC,MAC9BL,EAAO,MAAM,UAIf,IADeM,IAAIF,IACNC,IAHb,IAASA,GAMX,IAAU,KAEPN,GACL,OAAO,EAAE,MAAM;GAAE,GAAGD;GAAM;GAAG;GAAG;GAAO;EAAO,EAAE;CAClD,EACF;AACF"}
@@ -0,0 +1,8 @@
1
+ import { clampMinSize as e } from "./clampMinSize.js";
2
+ import { lockAspectWithModifier as t } from "./lockAspect.js";
3
+ //#region src/interactions/actions/resize/behaviors/index.ts
4
+ var n = Object.freeze([t()]);
5
+ //#endregion
6
+ export { n as DEFAULT_RESIZE_BEHAVIORS, e as clampMinSize, t as lockAspectWithModifier };
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["DEFAULT_RESIZE_BEHAVIORS","lockAspectWithModifier","clampMinSize"],"sources":["../../../../../src/interactions/actions/resize/behaviors/index.ts"],"sourcesContent":["export { clampMinSize } from './clampMinSize';\nexport { lockAspectWithModifier } from './lockAspect';\n\nimport type { BoundsConstraint } from '../../../gestures/types';\nimport { lockAspectWithModifier } from './lockAspect';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** The kit's standard resize behaviors, applied when a consumer doesn't\n * supply its own list: shift-drag locks the start pose's aspect ratio.\n * Pass an explicit `behaviors: []` to opt out. Stateless, so one shared\n * frozen instance is safe across every gesture. */\nexport const DEFAULT_RESIZE_BEHAVIORS: readonly BoundsConstraint<Bounds>[] =\n Object.freeze([lockAspectWithModifier()]);\n"],"mappings":";;;AAWA,IAAaA,IACX,OAAO,OAAO,CAACC,EAAuB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ //#region src/interactions/actions/resize/behaviors/lockAspect.ts
2
+ function e(e = {}) {
3
+ let { key: t = "shift" } = e;
4
+ return { onMove(e, { pose: n, anchor: r }) {
5
+ if (!e.modifiers[t]) return;
6
+ let i = e.origin.get(e.draggedIds[0]);
7
+ if (!i || i.width === 0 || i.height === 0) return;
8
+ let a = i.width / i.height, o = n.width - i.width, s = n.height - i.height, c, l;
9
+ if (r.x === "free" && r.y === "free") return;
10
+ r.x === "free" ? (l = n.height, c = l * a, c < 0 && (c = -c)) : r.y === "free" ? (c = n.width, l = c / a, l < 0 && (l = -l)) : Math.abs(o) >= Math.abs(s) ? (c = n.width, l = Math.abs(c) / a * Math.sign(n.height || 1)) : (l = n.height, c = Math.abs(l) * a * Math.sign(n.width || 1));
11
+ let u = n.x, d = n.y;
12
+ return u = r.x === "min" ? i.x : r.x === "max" ? i.x + i.width - c : i.x + i.width / 2 - c / 2, d = r.y === "min" ? i.y : r.y === "max" ? i.y + i.height - l : i.y + i.height / 2 - l / 2, { pose: {
13
+ ...n,
14
+ x: u,
15
+ y: d,
16
+ width: c,
17
+ height: l
18
+ } };
19
+ } };
20
+ }
21
+ //#endregion
22
+ export { e as lockAspectWithModifier };
23
+
24
+ //# sourceMappingURL=lockAspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockAspect.js","names":["lockAspectWithModifier","opts","ctx","key","origin","ratio","dw","pose","dh","nw","nh","anchor","nx","ny"],"sources":["../../../../../src/interactions/actions/resize/behaviors/lockAspect.ts"],"sourcesContent":["import type {\n ModifierState,\n BoundsConstraint,\n} from '../../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\ntype ModKey = keyof ModifierState;\n\n/** Aspect-ratio lock: drag a corner/edge with `key` (default `'shift'`) held\n * to keep the resized bounds at the start-pose's `width / height` ratio.\n *\n * Strategy:\n * - Compute the proposed deltas in width and height (signed, relative to\n * origin). Whichever axis has the larger absolute delta \"wins\"; the other\n * is recomputed from `(originW / originH) * winnerDelta`.\n * - The opposite corner/edge stays anchored — for the corner case we infer\n * the anchor from the proposed bounds; for an edge handle we resize the\n * orthogonal axis symmetrically around the dragged edge's anchor (the\n * handle's own line stays put, the orthogonal axis grows/shrinks centered\n * on the un-dragged edge — see notes below).\n * - No-op when the modifier is not held, when the origin has zero width or\n * height (no defined ratio), or when the proposed pose hasn't moved.\n *\n * Edge-handle handling: with `anchor.x !== 'free' && anchor.y === 'free'`\n * (an `e` or `w` handle), only the width was driven by the pointer. We pick\n * the new height as `width / ratio` and pin it to the un-dragged y axis by\n * anchoring at the origin's top edge (`y` stays at `origin.y`). Symmetric\n * for `n` / `s`.\n */\nexport function lockAspectWithModifier<TPose extends Bounds>(opts: {\n key?: ModKey;\n} = {}): BoundsConstraint<TPose> {\n const { key = 'shift' } = opts;\n\n return {\n onMove(ctx, { pose, anchor }) {\n if (!ctx.modifiers[key]) return;\n const origin = ctx.origin.get(ctx.draggedIds[0]) as Bounds | undefined;\n if (!origin) return;\n if (origin.width === 0 || origin.height === 0) return;\n const ratio = origin.width / origin.height; // w / h\n\n // Signed deltas relative to origin. Negative deltas mean the user has\n // dragged through the anchor and flipped the rect; we preserve sign on\n // the recomputed axis so the flipped quadrant stays consistent.\n const dw = pose.width - origin.width;\n const dh = pose.height - origin.height;\n\n let nw: number;\n let nh: number;\n\n if (anchor.x === 'free' && anchor.y === 'free') {\n // No driven axis — nothing to lock against.\n return;\n } else if (anchor.x === 'free') {\n // Edge handle: n or s. height is driven; width follows.\n nh = pose.height;\n nw = nh * ratio;\n // sign-preserve width if the original height delta caused a flip.\n // (height-driven only; width direction follows ratio absolutely.)\n if (nw < 0) nw = -nw;\n } else if (anchor.y === 'free') {\n // Edge handle: e or w. width is driven; height follows.\n nw = pose.width;\n nh = nw / ratio;\n if (nh < 0) nh = -nh;\n } else {\n // Corner handle. Pick the dominant axis by absolute delta.\n if (Math.abs(dw) >= Math.abs(dh)) {\n nw = pose.width;\n // Match height sign to width sign so the rect stays in the same\n // quadrant the pointer chose.\n nh = (Math.abs(nw) / ratio) * Math.sign(pose.height || 1);\n } else {\n nh = pose.height;\n nw = (Math.abs(nh) * ratio) * Math.sign(pose.width || 1);\n }\n }\n\n // Recompute x/y from the anchor (the un-dragged edge stays pinned).\n let nx = pose.x;\n let ny = pose.y;\n if (anchor.x === 'min') {\n // West edge anchored at origin.x.\n nx = origin.x;\n } else if (anchor.x === 'max') {\n // East edge anchored at origin.x + origin.width.\n nx = origin.x + origin.width - nw;\n } else {\n // Edge handle (n/s): width grew/shrunk via ratio. Center horizontally\n // about the origin's center so the rect stays visually centered on\n // the dragged edge's midline.\n nx = origin.x + origin.width / 2 - nw / 2;\n }\n if (anchor.y === 'min') {\n ny = origin.y;\n } else if (anchor.y === 'max') {\n ny = origin.y + origin.height - nh;\n } else {\n ny = origin.y + origin.height / 2 - nh / 2;\n }\n\n return {\n pose: { ...pose, x: nx, y: ny, width: nw, height: nh },\n };\n },\n };\n}\n"],"mappings":";AA6BA,SAAgBA,EAA6C,IAEzD,CAAC,GAA4B;CAC/B,IAAM,EAAE,SAAM,YAAYC;CAE1B,OAAO,EACL,OAAO,GAAK,EAAE,SAAM,aAAU;EAC5B,IAAI,CAACC,EAAI,UAAUC,IAAM;EACzB,IAAMC,IAASF,EAAI,OAAO,IAAIA,EAAI,WAAW,EAAE;EAE/C,IADI,CAACE,KACDA,EAAO,UAAU,KAAKA,EAAO,WAAW,GAAG;EAC/C,IAAMC,IAAQD,EAAO,QAAQA,EAAO,QAK9BE,IAAKC,EAAK,QAAQH,EAAO,OACzBI,IAAKD,EAAK,SAASH,EAAO,QAE5BK,GACAC;EAEJ,IAAIC,EAAO,MAAM,UAAUA,EAAO,MAAM,QAEtC;EACK,AAAIA,EAAO,MAAM,UAEtB,IAAKJ,EAAK,QACV,IAAKG,IAAKL,GAGNI,IAAK,MAAG,IAAK,CAACA,MACTE,EAAO,MAAM,UAEtB,IAAKJ,EAAK,OACV,IAAKE,IAAKJ,GACNK,IAAK,MAAG,IAAK,CAACA,MAGd,KAAK,IAAIJ,CAAE,KAAK,KAAK,IAAIE,CAAE,KAC7B,IAAKD,EAAK,OAGV,IAAM,KAAK,IAAIE,CAAE,IAAIJ,IAAS,KAAK,KAAKE,EAAK,UAAU,CAAC,MAExD,IAAKA,EAAK,QACV,IAAM,KAAK,IAAIG,CAAE,IAAIL,IAAS,KAAK,KAAKE,EAAK,SAAS,CAAC;EAK3D,IAAIK,IAAKL,EAAK,GACVM,IAAKN,EAAK;EAqBd,OApBA,AAUEK,IAVED,EAAO,MAAM,QAEVP,EAAO,IACHO,EAAO,MAAM,QAEjBP,EAAO,IAAIA,EAAO,QAAQK,IAK1BL,EAAO,IAAIA,EAAO,QAAQ,IAAIK,IAAK,GAE1C,AAKEI,IALEF,EAAO,MAAM,QACVP,EAAO,IACHO,EAAO,MAAM,QACjBP,EAAO,IAAIA,EAAO,SAASM,IAE3BN,EAAO,IAAIA,EAAO,SAAS,IAAIM,IAAK,GAGpC,EACL,MAAM;GAAE,GAAGH;GAAM,GAAGK;GAAI,GAAGC;GAAI,OAAOJ;GAAI,QAAQC;EAAG,EACvD;CACF,EACF;AACF"}
@@ -0,0 +1,72 @@
1
+ //#region src/interactions/actions/resize/cornerHandles.ts
2
+ var e = [
3
+ {
4
+ xEdge: "min",
5
+ yEdge: "min",
6
+ anchor: {
7
+ x: "max",
8
+ y: "max"
9
+ },
10
+ kind: "handle:top-left",
11
+ tag: "min-min"
12
+ },
13
+ {
14
+ xEdge: "max",
15
+ yEdge: "min",
16
+ anchor: {
17
+ x: "min",
18
+ y: "max"
19
+ },
20
+ kind: "handle:top-right",
21
+ tag: "max-min"
22
+ },
23
+ {
24
+ xEdge: "min",
25
+ yEdge: "max",
26
+ anchor: {
27
+ x: "max",
28
+ y: "min"
29
+ },
30
+ kind: "handle:bottom-left",
31
+ tag: "min-max"
32
+ },
33
+ {
34
+ xEdge: "max",
35
+ yEdge: "max",
36
+ anchor: {
37
+ x: "min",
38
+ y: "min"
39
+ },
40
+ kind: "handle:bottom-right",
41
+ tag: "max-max"
42
+ }
43
+ ];
44
+ function t(e, t) {
45
+ return {
46
+ x: t.xEdge === "max" ? e.x + e.width : e.x,
47
+ y: t.yEdge === "max" ? e.y + e.height : e.y
48
+ };
49
+ }
50
+ function n(n) {
51
+ return e.map((e) => {
52
+ let r = t(n, e);
53
+ return {
54
+ cx: r.x,
55
+ cy: r.y,
56
+ anchor: e.anchor
57
+ };
58
+ });
59
+ }
60
+ function r(e, t, n, r) {
61
+ return Math.abs(t - e.cx) <= r && Math.abs(n - e.cy) <= r;
62
+ }
63
+ function i(e, t) {
64
+ return {
65
+ x: t.x === "max" ? e.x + e.width : e.x,
66
+ y: t.y === "max" ? e.y + e.height : e.y
67
+ };
68
+ }
69
+ //#endregion
70
+ export { e as CORNER_ANCHORS, t as cornerPoint, n as cornerResizeHandles, i as fixedCornerOf, r as hitCornerHandle };
71
+
72
+ //# sourceMappingURL=cornerHandles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cornerHandles.js","names":["CORNER_ANCHORS","cornerPoint","entry","bounds","cornerResizeHandles","p","c","hitCornerHandle","px","handle","radius","py","fixedCornerOf","anchor"],"sources":["../../../../src/interactions/actions/resize/cornerHandles.ts"],"sourcesContent":["import type { ResizeAnchor } from '../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */\nexport interface CornerHandle {\n cx: number;\n cy: number;\n anchor: ResizeAnchor;\n}\n\n/** Which AABB edge a corner sits on, per axis. `'min'` = the x/y origin\n * edge; `'max'` = the origin + extent edge. */\nexport type CornerEdge = 'min' | 'max';\n\n/** One entry of the canonical 4-corner resize layout. The single source of\n * truth for \"which corner maps to which anchor / handle-kind\". */\nexport interface CornerAnchor {\n /** Which x-edge the corner sits on (`'min'` = left, `'max'` = right). */\n xEdge: CornerEdge;\n /** Which y-edge the corner sits on (`'min'` = top, `'max'` = bottom). */\n yEdge: CornerEdge;\n /** Anchor that pins the diagonally-opposite (fixed) corner. Always the\n * axis-wise opposite of `{xEdge, yEdge}`. */\n anchor: ResizeAnchor;\n /** Affordance/handle discriminator string for this corner. */\n kind: string;\n /** Short positional tag (`'<xEdge>-<yEdge>'`), e.g. `'min-max'`. */\n tag: string;\n}\n\n/**\n * The single ordered corner→anchor table. Order is **load-bearing**: every\n * consumer iterates it in this sequence (TL, TR, BL, BR) so positional\n * meaning (the i-th handle / `kind` / `tag`) stays consistent across the\n * resize-handle affordance, the affordance-hit classifier, and\n * `cornerResizeHandles`. Each corner's `anchor` names the diagonally\n * opposite corner, so dragging the corner scales the box from that fixed\n * point.\n */\nexport const CORNER_ANCHORS: readonly CornerAnchor[] = [\n { xEdge: 'min', yEdge: 'min', anchor: { x: 'max', y: 'max' }, kind: 'handle:top-left', tag: 'min-min' },\n { xEdge: 'max', yEdge: 'min', anchor: { x: 'min', y: 'max' }, kind: 'handle:top-right', tag: 'max-min' },\n { xEdge: 'min', yEdge: 'max', anchor: { x: 'max', y: 'min' }, kind: 'handle:bottom-left', tag: 'min-max' },\n { xEdge: 'max', yEdge: 'max', anchor: { x: 'min', y: 'min' }, kind: 'handle:bottom-right', tag: 'max-max' },\n];\n\n/** Resolve a corner's world-space position for the given bounds. `xEdge`\n * `'max'` → `x + width`; `yEdge` `'max'` → `y + height`. */\nexport function cornerPoint(\n bounds: Bounds,\n entry: Pick<CornerAnchor, 'xEdge' | 'yEdge'>,\n): { x: number; y: number } {\n return {\n x: entry.xEdge === 'max' ? bounds.x + bounds.width : bounds.x,\n y: entry.yEdge === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n\n/** Standard 4-corner resize-handle layout: each corner pins the opposite\n * corner via an anchor of `{x: 'min'|'max', y: 'min'|'max'}` so dragging it\n * scales the box from the fixed opposite corner. Decodes {@link CORNER_ANCHORS}\n * against `bounds`. */\nexport function cornerResizeHandles(bounds: Bounds): CornerHandle[] {\n return CORNER_ANCHORS.map((c) => {\n const p = cornerPoint(bounds, c);\n return { cx: p.x, cy: p.y, anchor: c.anchor };\n });\n}\n\n/** Square hit-test for a handle: returns true if `(px, py)` is within\n * `radius` of the handle center on both axes. */\nexport function hitCornerHandle(\n handle: CornerHandle,\n px: number,\n py: number,\n radius: number,\n): boolean {\n return Math.abs(px - handle.cx) <= radius\n && Math.abs(py - handle.cy) <= radius;\n}\n\n/** The corner that does NOT move under a resize gesture with the given\n * anchor. Used by the rotated-resize math to pin a world-space invariant.\n *\n * Convention: `anchor.x === 'min'` means the min-x (left) edge is the\n * fixed anchor, so the fixed corner sits at `x = bounds.x` (min-x).\n * `anchor.x === 'max'` means the max-x (right) edge is fixed, so the\n * fixed corner sits at `x = bounds.x + bounds.width`. `'free'` on an\n * axis means that axis doesn't move; the fixed coord is the bounds\n * origin on that axis. */\nexport function fixedCornerOf(\n bounds: Bounds,\n anchor: ResizeAnchor,\n): { x: number; y: number } {\n return {\n x: anchor.x === 'max' ? bounds.x + bounds.width : bounds.x,\n y: anchor.y === 'max' ? bounds.y + bounds.height : bounds.y,\n };\n}\n"],"mappings":";AAuCA,IAAaA,IAA0C;CACrD;EAAE,OAAO;EAAO,OAAO;EAAO,QAAQ;GAAE,GAAG;GAAO,GAAG;EAAM;EAAG,MAAM;EAAuB,KAAK;CAAU;CAC1G;EAAE,OAAO;EAAO,OAAO;EAAO,QAAQ;GAAE,GAAG;GAAO,GAAG;EAAM;EAAG,MAAM;EAAuB,KAAK;CAAU;CAC1G;EAAE,OAAO;EAAO,OAAO;EAAO,QAAQ;GAAE,GAAG;GAAO,GAAG;EAAM;EAAG,MAAM;EAAuB,KAAK;CAAU;CAC1G;EAAE,OAAO;EAAO,OAAO;EAAO,QAAQ;GAAE,GAAG;GAAO,GAAG;EAAM;EAAG,MAAM;EAAuB,KAAK;CAAU;AAC5G;AAIA,SAAgBC,EACd,GACA,GAC0B;CAC1B,OAAO;EACL,GAAGC,EAAM,UAAU,QAAQC,EAAO,IAAIA,EAAO,QAAQA,EAAO;EAC5D,GAAGD,EAAM,UAAU,QAAQC,EAAO,IAAIA,EAAO,SAASA,EAAO;CAC/D;AACF;AAMA,SAAgBC,EAAoB,GAAgC;CAClE,OAAOJ,EAAe,KAAK,MAAM;EAC/B,IAAMK,IAAIJ,EAAYE,GAAQG,CAAC;EAC/B,OAAO;GAAE,IAAID,EAAE;GAAG,IAAIA,EAAE;GAAG,QAAQC,EAAE;EAAO;CAC9C,CAAC;AACH;AAIA,SAAgBC,EACd,GACA,GACA,GACA,GACS;CACT,OAAO,KAAK,IAAIC,IAAKC,EAAO,EAAE,KAAKC,KAC9B,KAAK,IAAIC,IAAKF,EAAO,EAAE,KAAKC;AACnC;AAWA,SAAgBE,EACd,GACA,GAC0B;CAC1B,OAAO;EACL,GAAGC,EAAO,MAAM,QAAQV,EAAO,IAAIA,EAAO,QAAQA,EAAO;EACzD,GAAGU,EAAO,MAAM,QAAQV,EAAO,IAAIA,EAAO,SAASA,EAAO;CAC5D;AACF"}
@@ -0,0 +1,60 @@
1
+ import { insertPreviewExtent as e } from "../../canvas/insertPreviewExtent.js";
2
+ //#region src/interactions/actions/resolveOverlays.ts
3
+ function t(t) {
4
+ let n = [];
5
+ for (let r of t) switch (r.kind) {
6
+ case "marquee": {
7
+ let e = Math.min(r.start.x, r.current.x), t = Math.min(r.start.y, r.current.y), i = Math.abs(r.current.x - r.start.x), a = Math.abs(r.current.y - r.start.y);
8
+ if (i === 0 && a === 0) break;
9
+ n.push({
10
+ kind: "marquee",
11
+ visibilityId: "action.marquee",
12
+ bounds: {
13
+ x: e,
14
+ y: t,
15
+ width: i,
16
+ height: a
17
+ },
18
+ shiftHeld: r.shiftHeld
19
+ });
20
+ break;
21
+ }
22
+ case "lasso":
23
+ if (r.vertices.length < 2) break;
24
+ n.push({
25
+ kind: "lasso",
26
+ visibilityId: "action.lasso",
27
+ vertices: r.vertices,
28
+ current: r.current,
29
+ shiftHeld: r.shiftHeld
30
+ });
31
+ break;
32
+ case "insertPreview": {
33
+ let { bounds: t, geometry: i } = e(r);
34
+ if (t.width === 0 && t.height === 0 && r.shape !== "pencil" || i.kind === "pencil" && i.samples.length < 2) break;
35
+ n.push({
36
+ kind: "insertPreview",
37
+ visibilityId: "action.insert-preview",
38
+ shape: r.shape,
39
+ bounds: t,
40
+ geometry: i,
41
+ extras: r.extras,
42
+ ...r.anchorPoint && r.shape !== "pencil" ? { anchorPoint: r.anchorPoint } : {}
43
+ });
44
+ break;
45
+ }
46
+ case "polyline":
47
+ if (r.points.length < 2) break;
48
+ n.push({
49
+ kind: "polyline",
50
+ visibilityId: "action.polyline",
51
+ points: r.points,
52
+ role: r.role ?? "chrome"
53
+ });
54
+ }
55
+ return n;
56
+ }
57
+ //#endregion
58
+ export { t as resolveOverlays };
59
+
60
+ //# sourceMappingURL=resolveOverlays.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveOverlays.js","names":["resolveOverlays","out","ov","overlays","x","y","width","height","insertPreviewExtent","bounds","geometry"],"sources":["../../../src/interactions/actions/resolveOverlays.ts"],"sourcesContent":["/**\n * What an in-flight gesture is proposing to paint *beside* the scene, resolved\n * to geometry.\n *\n * The sibling of `resolvePreviews`: that one answers for the ghosts of scene\n * nodes a gesture is displacing, this one for the chrome a gesture draws that\n * is no node at all — a marquee rect, a lasso trail, the outline of a shape\n * being dragged out. `<SceneCanvas>`'s `useDispatcherOverlayLayer` used to be\n * the only thing that knew how to read an `OngoingOverlay`, and it read one\n * straight into `DrawCommand`s, so a consumer with its own renderer got\n * nothing. None of the normalizing is about drawing.\n *\n * What stays out, as in `resolvePreviews`: no view, no screen projection, no\n * `DrawCommand`, no style, no React, no dispatcher. World coordinates only.\n */\n\nimport type { InsertPreviewGeometry } from '../../canvas/insertPreviewExtent';\nimport { insertPreviewExtent } from '../../canvas/insertPreviewExtent';\nimport type { Bounds } from '../../core/viewport/fitViewToBounds';\nimport type { KitInsertShape } from '../../core/shapeKinds';\nimport type { OngoingOverlay, OverlayRole } from '@weasel-js/routing';\n\ntype Point = { x: number; y: number };\n\n/**\n * The chrome-caps id a surface consults before painting each variant. The\n * gating itself is the painter's — two views of one surface may disagree about\n * whether to show an in-flight marquee — but the id is not something a caller\n * should have to guess.\n */\nexport type OverlayVisibilityId =\n | 'action.marquee'\n | 'action.lasso'\n | 'action.insert-preview'\n | 'action.polyline';\n\n/**\n * One in-flight overlay, in world coordinates.\n *\n * Every degenerate overlay is already gone: a marquee of zero size, a lasso\n * under two vertices, a zero-area insert of anything but a pencil, a pencil\n * under two samples, a run of fewer than two points. Whatever is in this list\n * is worth painting.\n */\nexport type ResolvedOverlay =\n | {\n kind: 'marquee';\n visibilityId: 'action.marquee';\n /** The drag normalized: `start`/`current` in either order, one AABB. */\n bounds: Bounds;\n /** Additive intent. Core's 2D layer paints the same rect either way. */\n shiftHeld: boolean;\n }\n | {\n kind: 'lasso';\n visibilityId: 'action.lasso';\n /** The trail so far, at least two long. The region it encloses is the\n * trail closed back to its first vertex. */\n vertices: ReadonlyArray<Point>;\n /** Live pointer position — the trail's last vertex until it advances. */\n current: Point;\n shiftHeld: boolean;\n }\n | {\n kind: 'insertPreview';\n visibilityId: 'action.insert-preview';\n shape: KitInsertShape;\n /** Extent of `geometry`, which for a radial or freehand shape is not the\n * drag rect. See `insertPreviewExtent`. */\n bounds: Bounds;\n geometry: InsertPreviewGeometry;\n /** The drag's anchor — a growth axis to mark. Absent for a pencil, which\n * has none. */\n anchorPoint?: Point;\n /** The action's per-shape payload, verbatim. Carries what geometry\n * cannot: an image insert's `src`, say. */\n extras: unknown;\n }\n | {\n kind: 'polyline';\n visibilityId: 'action.polyline';\n /** The run, at least two long, open — the last point does not join the\n * first. A closed sweep is a `lasso`. */\n points: ReadonlyArray<Point>;\n /** What the run is, for a painter choosing a style. Never defaulted\n * away: `'chrome'` when the action named none. A role the painter has\n * no style for is drawn as plain chrome, not dropped. */\n role: OverlayRole;\n };\n\n/** The overlays worth painting, in the order the handles published them. */\nexport function resolveOverlays(overlays: Iterable<OngoingOverlay>): ResolvedOverlay[] {\n const out: ResolvedOverlay[] = [];\n for (const ov of overlays) {\n switch (ov.kind) {\n case 'marquee': {\n const x = Math.min(ov.start.x, ov.current.x);\n const y = Math.min(ov.start.y, ov.current.y);\n const width = Math.abs(ov.current.x - ov.start.x);\n const height = Math.abs(ov.current.y - ov.start.y);\n if (width === 0 && height === 0) break;\n out.push({\n kind: 'marquee',\n visibilityId: 'action.marquee',\n bounds: { x, y, width, height },\n shiftHeld: ov.shiftHeld,\n });\n break;\n }\n case 'lasso': {\n if (ov.vertices.length < 2) break;\n out.push({\n kind: 'lasso',\n visibilityId: 'action.lasso',\n vertices: ov.vertices,\n current: ov.current,\n shiftHeld: ov.shiftHeld,\n });\n break;\n }\n case 'insertPreview': {\n const { bounds, geometry } = insertPreviewExtent(ov);\n // A pencil can be meaningful at zero AABB — a closed loop, a\n // sub-threshold gesture — where every other shape cannot.\n if (bounds.width === 0 && bounds.height === 0 && ov.shape !== 'pencil') break;\n if (geometry.kind === 'pencil' && geometry.samples.length < 2) break;\n out.push({\n kind: 'insertPreview',\n visibilityId: 'action.insert-preview',\n // Routing types the insert shape as an open string: a\n // consumer-defined kind is legal there and simply gets no live\n // preview. This narrows to the kinds the kit's overlay draws —\n // the `break` above has already rejected everything else.\n shape: ov.shape as KitInsertShape,\n bounds,\n geometry,\n extras: ov.extras,\n ...(ov.anchorPoint && ov.shape !== 'pencil' ? { anchorPoint: ov.anchorPoint } : {}),\n });\n break;\n }\n case 'polyline': {\n if (ov.points.length < 2) break;\n out.push({\n kind: 'polyline',\n visibilityId: 'action.polyline',\n points: ov.points,\n role: ov.role ?? 'chrome',\n });\n break;\n }\n }\n }\n return out;\n}\n"],"mappings":";;AA2FA,SAAgBA,EAAgB,GAAuD;CACrF,IAAMC,IAAyB,CAAC;CAChC,KAAK,IAAMC,KAAMC,GACf,QAAQD,EAAG,MAAX;EACE,KAAK,WAAW;GACd,IAAME,IAAI,KAAK,IAAIF,EAAG,MAAM,GAAGA,EAAG,QAAQ,CAAC,GACrCG,IAAI,KAAK,IAAIH,EAAG,MAAM,GAAGA,EAAG,QAAQ,CAAC,GACrCI,IAAQ,KAAK,IAAIJ,EAAG,QAAQ,IAAIA,EAAG,MAAM,CAAC,GAC1CK,IAAS,KAAK,IAAIL,EAAG,QAAQ,IAAIA,EAAG,MAAM,CAAC;GACjD,IAAII,MAAU,KAAKC,MAAW,GAAG;GACjC,EAAI,KAAK;IACP,MAAM;IACN,cAAc;IACd,QAAQ;KAAE;KAAG;KAAG;KAAO;IAAO;IAC9B,WAAWL,EAAG;GAChB,CAAC;GACD;EACF;EACA,KAAK;GACH,IAAIA,EAAG,SAAS,SAAS,GAAG;GAC5B,EAAI,KAAK;IACP,MAAM;IACN,cAAc;IACd,UAAUA,EAAG;IACb,SAASA,EAAG;IACZ,WAAWA,EAAG;GAChB,CAAC;GACD;EAEF,KAAK,iBAAiB;GACpB,IAAM,EAAE,WAAQ,gBAAaM,EAAoBN,CAAE;GAInD,IADIO,EAAO,UAAU,KAAKA,EAAO,WAAW,KAAKP,EAAG,UAAU,YAC1DQ,EAAS,SAAS,YAAYA,EAAS,QAAQ,SAAS,GAAG;GAC/D,EAAI,KAAK;IACP,MAAM;IACN,cAAc;IAKd,OAAOR,EAAG;IACV;IACA;IACA,QAAQA,EAAG;IACX,GAAIA,EAAG,eAAeA,EAAG,UAAU,WAAW,EAAE,aAAaA,EAAG,YAAY,IAAI,CAAC;GACnF,CAAC;GACD;EACF;EACA,KAAK;GACH,IAAIA,EAAG,OAAO,SAAS,GAAG;GAC1B,EAAI,KAAK;IACP,MAAM;IACN,cAAc;IACd,QAAQA,EAAG;IACX,MAAMA,EAAG,QAAQ;GACnB,CAAC;CAGL;CAEF,OAAOD;AACT"}
@@ -0,0 +1,61 @@
1
+ import { asNodeId as e } from "../../core/scene/types.js";
2
+ //#region src/interactions/actions/resolvePreviews.ts
3
+ function t(e, t, n) {
4
+ for (let r of e) {
5
+ let e = n(r, t);
6
+ if (e != null) return e;
7
+ }
8
+ return null;
9
+ }
10
+ function n(n, r) {
11
+ let i = [...n], a = /* @__PURE__ */ new Set();
12
+ for (let e of i) {
13
+ let t = e.previewIds?.();
14
+ if (t) for (let e of t) a.add(e);
15
+ }
16
+ if (a.size === 0) return [];
17
+ let o = /* @__PURE__ */ new Set();
18
+ for (let e of i) {
19
+ let t = e.previewOpaqueIds?.();
20
+ if (t) for (let e of t) o.add(e);
21
+ }
22
+ let s = (n) => {
23
+ let c = r.get(e(n));
24
+ if (!c) return null;
25
+ let l = t(i, n, (e, t) => e.previewPose?.(t)), u = t(i, n, (e, t) => e.previewData?.(t));
26
+ if (l == null && u == null) return null;
27
+ let d = [];
28
+ for (let t of r.childrenOf(e(n))) {
29
+ if (!a.has(t)) continue;
30
+ let e = s(t);
31
+ e && d.push(e);
32
+ }
33
+ return {
34
+ id: e(n),
35
+ node: c,
36
+ pose: l ?? c.pose,
37
+ data: u ?? c.data,
38
+ opaque: o.has(n),
39
+ children: d
40
+ };
41
+ }, c = [];
42
+ for (let t of a) {
43
+ let n = r.get(e(t))?.parent;
44
+ if (n != null && a.has(n)) continue;
45
+ let i = s(t);
46
+ i && c.push(i);
47
+ }
48
+ return c;
49
+ }
50
+ function r(e) {
51
+ let t = [], n = (e) => {
52
+ t.push(e);
53
+ for (let t of e.children) n(t);
54
+ };
55
+ for (let t of e) n(t);
56
+ return t;
57
+ }
58
+ //#endregion
59
+ export { r as flattenPreviews, n as resolvePreviews };
60
+
61
+ //# sourceMappingURL=resolvePreviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolvePreviews.js","names":["firstNonNull","source","sources","value","read","id","resolvePreviews","list","ids","previewing","opaque","settled","build","node","scene","asNodeId","pose","s","i","data","children","childId","child","roots","parent","root","flattenPreviews","out","walk","entry"],"sources":["../../../src/interactions/actions/resolvePreviews.ts"],"sourcesContent":["/**\n * What an in-flight gesture is proposing, resolved against the committed scene.\n *\n * An ongoing action publishes interim poses on its handle rather than writing\n * them to the scene, and `<SceneCanvas>`'s ghost layer used to be the only\n * thing that knew how to read them: which ids are in flight, which of those are\n * roots, whose preview wins when two sources name the same id, and which are\n * merely displaced rather than dragged. None of that is about drawing, and a\n * consumer with its own renderer needs all of it.\n */\n\nimport type { GesturePreviewSource } from '../../canvas/gestureBounds';\nimport type { Node, NodeId, Scene } from '../../core/scene/types';\nimport { asNodeId } from '../../core/scene/types';\n\n/** One node an in-flight gesture is previewing, as {@link resolvePreviews} returns it. */\nexport interface PreviewNode<TData, TLayer extends string, TPose> {\n id: NodeId;\n /** The node as committed — the gesture has not touched the scene. */\n node: Node<TData, TLayer, TPose>;\n /** The interim pose, or the committed one when only data is in flight. */\n pose: TPose;\n /** The interim data, or the committed one when only the pose is in flight. */\n data: TData;\n /**\n * The gesture is not carrying this one under the pointer — a layout sibling\n * reflowing into its destination slot. It reads better painted settled.\n */\n opaque: boolean;\n /** Previewed descendants, so a container's ghost brings its children. */\n children: PreviewNode<TData, TLayer, TPose>[];\n}\n\n/** First non-null answer across sources: tool-side before dispatcher-side. */\nfunction firstNonNull<T>(\n sources: readonly GesturePreviewSource[],\n id: string,\n read: (source: GesturePreviewSource, id: string) => unknown,\n): T | null {\n for (const source of sources) {\n const value = read(source, id);\n if (value != null) return value as T;\n }\n return null;\n}\n\n/**\n * The previewing subtrees, as roots. A previewed node whose parent is also\n * previewing is a child of that parent's entry rather than a root of its own,\n * which is what lets a caller draw a container and its contents as one thing.\n *\n * An id with no node is skipped: an insert previews before the node it will\n * create exists. So is an id no source has a pose or data for.\n */\nexport function resolvePreviews<TData, TLayer extends string, TPose>(\n sources: Iterable<GesturePreviewSource>,\n scene: Scene<TData, TLayer, TPose>,\n): PreviewNode<TData, TLayer, TPose>[] {\n const list = [...sources];\n const ids = new Set<string>();\n for (const source of list) {\n const previewing = source.previewIds?.();\n if (!previewing) continue;\n for (const id of previewing) ids.add(id);\n }\n if (ids.size === 0) return [];\n\n const opaque = new Set<string>();\n for (const source of list) {\n const settled = source.previewOpaqueIds?.();\n if (!settled) continue;\n for (const id of settled) opaque.add(id);\n }\n\n const build = (id: string): PreviewNode<TData, TLayer, TPose> | null => {\n const node = scene.get(asNodeId(id));\n if (!node) return null;\n const pose = firstNonNull<TPose>(list, id, (s, i) => s.previewPose?.(i));\n const data = firstNonNull<TData>(list, id, (s, i) => s.previewData?.(i));\n if (pose == null && data == null) return null;\n\n const children: PreviewNode<TData, TLayer, TPose>[] = [];\n for (const childId of scene.childrenOf(asNodeId(id))) {\n if (!ids.has(childId)) continue;\n const child = build(childId);\n if (child) children.push(child);\n }\n\n return {\n id: asNodeId(id),\n node,\n pose: pose ?? node.pose,\n data: data ?? node.data,\n opaque: opaque.has(id),\n children,\n };\n };\n\n const roots: PreviewNode<TData, TLayer, TPose>[] = [];\n for (const id of ids) {\n const parent = scene.get(asNodeId(id))?.parent;\n if (parent != null && ids.has(parent)) continue;\n const root = build(id);\n if (root) roots.push(root);\n }\n return roots;\n}\n\n/** Every entry in the forest, parents before their children. */\nexport function flattenPreviews<TData, TLayer extends string, TPose>(\n roots: readonly PreviewNode<TData, TLayer, TPose>[],\n): PreviewNode<TData, TLayer, TPose>[] {\n const out: PreviewNode<TData, TLayer, TPose>[] = [];\n const walk = (entry: PreviewNode<TData, TLayer, TPose>) => {\n out.push(entry);\n for (const child of entry.children) walk(child);\n };\n for (const root of roots) walk(root);\n return out;\n}\n"],"mappings":";;AAkCA,SAASA,EACP,GACA,GACA,GACU;CACV,KAAK,IAAMC,KAAUC,GAAS;EAC5B,IAAMC,IAAQC,EAAKH,GAAQI,CAAE;EAC7B,IAAIF,KAAS,MAAM,OAAOA;CAC5B;CACA,OAAO;AACT;AAUA,SAAgBG,EACd,GACA,GACqC;CACrC,IAAMC,IAAO,CAAC,GAAGL,CAAO,GAClBM,oBAAM,IAAI,IAAY;CAC5B,KAAK,IAAMP,KAAUM,GAAM;EACzB,IAAME,IAAaR,EAAO,aAAa;EACvC,IAAKQ,GACL,KAAK,IAAMJ,KAAMI,GAAY,EAAI,IAAIJ,CAAE;CACzC;CACA,IAAIG,EAAI,SAAS,GAAG,OAAO,CAAC;CAE5B,IAAME,oBAAS,IAAI,IAAY;CAC/B,KAAK,IAAMT,KAAUM,GAAM;EACzB,IAAMI,IAAUV,EAAO,mBAAmB;EAC1C,IAAKU,GACL,KAAK,IAAMN,KAAMM,GAAS,EAAO,IAAIN,CAAE;CACzC;CAEA,IAAMO,KAAS,MAAyD;EACtE,IAAMC,IAAOC,EAAM,IAAIC,EAASV,CAAE,CAAC;EACnC,IAAI,CAACQ,GAAM,OAAO;EAClB,IAAMG,IAAOhB,EAAoBO,GAAMF,IAAK,GAAG,MAAMY,EAAE,cAAcC,CAAC,CAAC,GACjEC,IAAOnB,EAAoBO,GAAMF,IAAK,GAAG,MAAMY,EAAE,cAAcC,CAAC,CAAC;EACvE,IAAIF,KAAQ,QAAQG,KAAQ,MAAM,OAAO;EAEzC,IAAMC,IAAgD,CAAC;EACvD,KAAK,IAAMC,KAAWP,EAAM,WAAWC,EAASV,CAAE,CAAC,GAAG;GACpD,IAAI,CAACG,EAAI,IAAIa,CAAO,GAAG;GACvB,IAAMC,IAAQV,EAAMS,CAAO;GAC3B,AAAIC,KAAOF,EAAS,KAAKE,CAAK;EAChC;EAEA,OAAO;GACL,IAAIP,EAASV,CAAE;GACf;GACA,MAAMW,KAAQH,EAAK;GACnB,MAAMM,KAAQN,EAAK;GACnB,QAAQH,EAAO,IAAIL,CAAE;GACrB;EACF;CACF,GAEMkB,IAA6C,CAAC;CACpD,KAAK,IAAMlB,KAAMG,GAAK;EACpB,IAAMgB,IAASV,EAAM,IAAIC,EAASV,CAAE,CAAC,CAAC,EAAE;EACxC,IAAImB,KAAU,QAAQhB,EAAI,IAAIgB,CAAM,GAAG;EACvC,IAAMC,IAAOb,EAAMP,CAAE;EACrB,AAAIoB,KAAMF,EAAM,KAAKE,CAAI;CAC3B;CACA,OAAOF;AACT;AAGA,SAAgBG,EACd,GACqC;CACrC,IAAMC,IAA2C,CAAC,GAC5CC,KAAQ,MAA6C;EACzD,EAAI,KAAKC,CAAK;EACd,KAAK,IAAMP,KAASO,EAAM,UAAU,EAAKP,CAAK;CAChD;CACA,KAAK,IAAMG,KAAQF,GAAO,EAAKE,CAAI;CACnC,OAAOE;AACT"}
@@ -0,0 +1,46 @@
1
+ //#region src/interactions/actions/rotate/geometry.ts
2
+ function e(e) {
3
+ return {
4
+ x: e.x + e.width / 2,
5
+ y: e.y + e.height / 2
6
+ };
7
+ }
8
+ function t(e, t, n, r, i) {
9
+ let a = Math.cos(i), o = Math.sin(i), s = e - n, c = t - r;
10
+ return {
11
+ x: n + s * a - c * o,
12
+ y: r + s * o + c * a
13
+ };
14
+ }
15
+ function n(e) {
16
+ return [
17
+ {
18
+ x: e.x,
19
+ y: e.y
20
+ },
21
+ {
22
+ x: e.x + e.width,
23
+ y: e.y
24
+ },
25
+ {
26
+ x: e.x + e.width,
27
+ y: e.y + e.height
28
+ },
29
+ {
30
+ x: e.x,
31
+ y: e.y + e.height
32
+ }
33
+ ];
34
+ }
35
+ function r(r) {
36
+ let i = e(r);
37
+ return n(r).map((e) => t(e.x, e.y, i.x, i.y, r.rotation));
38
+ }
39
+ function i(n, r, i) {
40
+ let a = e(n), o = t(r, i, a.x, a.y, -n.rotation);
41
+ return o.x >= n.x && o.x <= n.x + n.width && o.y >= n.y && o.y <= n.y + n.height;
42
+ }
43
+ //#endregion
44
+ export { e as aabbCenter, i as pointInRotatedRect, n as rectCorners, t as rotatePoint, r as rotatedRectCorners };
45
+
46
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","names":["aabbCenter","bounds","rotatePoint","c","angle","s","dx","px","cx","dy","py","cy","rectCorners","rotatedRectCorners","pose","p","pointInRotatedRect","local","worldX","worldY"],"sources":["../../../../src/interactions/actions/rotate/geometry.ts"],"sourcesContent":["import type { RotatedPose } from '../../gestures/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/** AABB center of an unrotated rect — the canonical rotation pivot. */\nexport function aabbCenter(bounds: Bounds): { x: number; y: number } {\n return { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 };\n}\n\n/** Rotate `(px, py)` by `angle` (radians) around `(cx, cy)`. */\nexport function rotatePoint(\n px: number,\n py: number,\n cx: number,\n cy: number,\n angle: number,\n): { x: number; y: number } {\n const c = Math.cos(angle);\n const s = Math.sin(angle);\n const dx = px - cx;\n const dy = py - cy;\n return { x: cx + dx * c - dy * s, y: cy + dx * s + dy * c };\n}\n\n/** Four corners of an unrotated rect, in TL/TR/BR/BL order. */\nexport function rectCorners(bounds: Bounds): { x: number; y: number }[] {\n return [\n { x: bounds.x, y: bounds.y },\n { x: bounds.x + bounds.width, y: bounds.y },\n { x: bounds.x + bounds.width, y: bounds.y + bounds.height },\n { x: bounds.x, y: bounds.y + bounds.height },\n ];\n}\n\n/** Four corners of a rotated rect (rotation around AABB center), in\n * TL/TR/BR/BL order. Useful for selection-overlay rendering. */\nexport function rotatedRectCorners(pose: RotatedPose): { x: number; y: number }[] {\n const c = aabbCenter(pose);\n return rectCorners(pose).map((p) => rotatePoint(p.x, p.y, c.x, c.y, pose.rotation));\n}\n\n/** Hit-test a world point against a rotated rect (rotation around AABB\n * center). Standard pattern: invert the rotation and AABB-test in the\n * rect's local frame. */\nexport function pointInRotatedRect(\n pose: RotatedPose,\n worldX: number,\n worldY: number,\n): boolean {\n const c = aabbCenter(pose);\n const local = rotatePoint(worldX, worldY, c.x, c.y, -pose.rotation);\n return (\n local.x >= pose.x &&\n local.x <= pose.x + pose.width &&\n local.y >= pose.y &&\n local.y <= pose.y + pose.height\n );\n}\n"],"mappings":";AAIA,SAAgBA,EAAW,GAA0C;CACnE,OAAO;EAAE,GAAGC,EAAO,IAAIA,EAAO,QAAQ;EAAG,GAAGA,EAAO,IAAIA,EAAO,SAAS;CAAE;AAC3E;AAGA,SAAgBC,EACd,GACA,GACA,GACA,GACA,GAC0B;CAC1B,IAAMC,IAAI,KAAK,IAAIC,CAAK,GAClBC,IAAI,KAAK,IAAID,CAAK,GAClBE,IAAKC,IAAKC,GACVC,IAAKC,IAAKC;CAChB,OAAO;EAAE,GAAGH,IAAKF,IAAKH,IAAIM,IAAKJ;EAAG,GAAGM,IAAKL,IAAKD,IAAII,IAAKN;CAAE;AAC5D;AAGA,SAAgBS,EAAY,GAA4C;CACtE,OAAO;EACL;GAAE,GAAGX,EAAO;GAAG,GAAGA,EAAO;EAAE;EAC3B;GAAE,GAAGA,EAAO,IAAIA,EAAO;GAAO,GAAGA,EAAO;EAAE;EAC1C;GAAE,GAAGA,EAAO,IAAIA,EAAO;GAAO,GAAGA,EAAO,IAAIA,EAAO;EAAO;EAC1D;GAAE,GAAGA,EAAO;GAAG,GAAGA,EAAO,IAAIA,EAAO;EAAO;CAC7C;AACF;AAIA,SAAgBY,EAAmB,GAA+C;CAChF,IAAMV,IAAIH,EAAWc,CAAI;CACzB,OAAOF,EAAYE,CAAI,CAAC,CAAC,KAAK,MAAMZ,EAAYa,EAAE,GAAGA,EAAE,GAAGZ,EAAE,GAAGA,EAAE,GAAGW,EAAK,QAAQ,CAAC;AACpF;AAKA,SAAgBE,EACd,GACA,GACA,GACS;CACT,IAAMb,IAAIH,EAAWc,CAAI,GACnBG,IAAQf,EAAYgB,GAAQC,GAAQhB,EAAE,GAAGA,EAAE,GAAG,CAACW,EAAK,QAAQ;CAClE,OACEG,EAAM,KAAKH,EAAK,KAChBG,EAAM,KAAKH,EAAK,IAAIA,EAAK,SACzBG,EAAM,KAAKH,EAAK,KAChBG,EAAM,KAAKH,EAAK,IAAIA,EAAK;AAE7B"}
@@ -0,0 +1,27 @@
1
+ import { standoff as e } from "../../../core/viewport/pxExtent.js";
2
+ import { ROTATION_HANDLE_BASE_PX as t } from "../../../core/device/targets.js";
3
+ import { aabbCenter as n, rotatePoint as r } from "./geometry.js";
4
+ //#region src/interactions/actions/rotate/handle.ts
5
+ var i = t;
6
+ function a(t, a = i, s = o) {
7
+ let c = t.rotation ?? 0, l = n(t), u = r(t.x + t.width / 2, t.y, l.x, l.y, c), d = e(u, {
8
+ x: Math.sin(c),
9
+ y: -Math.cos(c)
10
+ }, a, s);
11
+ return {
12
+ cx: d.x,
13
+ cy: d.y,
14
+ angle: Math.atan2(d.nx, -d.ny)
15
+ };
16
+ }
17
+ var o = {
18
+ x: 1,
19
+ y: 1
20
+ };
21
+ function s(e, t, n, r) {
22
+ return Math.abs(t - e.cx) <= r && Math.abs(n - e.cy) <= r;
23
+ }
24
+ //#endregion
25
+ export { i as DEFAULT_ROTATION_HANDLE_DISTANCE, s as hitRotationHandle, a as rotationHandle };
26
+
27
+ //# sourceMappingURL=handle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle.js","names":["DEFAULT_ROTATION_HANDLE_DISTANCE","ROTATION_HANDLE_BASE_PX","rotationHandle","UNIT_SCALE","rotation","pose","c","aabbCenter","top","rotatePoint","p","standoff","distance","scale","hitRotationHandle","px","handle","radius","py"],"sources":["../../../../src/interactions/actions/rotate/handle.ts"],"sourcesContent":["import { aabbCenter, rotatePoint } from './geometry';\nimport { ROTATION_HANDLE_BASE_PX } from 'core/device/targets';\nimport { standoff, type Scale2 } from 'core/viewport/pxExtent';\n\n/** Default world-space distance from the rect's top edge to the rotation\n * handle's center. Matches the demo's visual default; consumers can\n * override per-call. Unscaled — kit-internal use sites multiply by\n * `DeviceProfile.targetScale`. */\nexport const DEFAULT_ROTATION_HANDLE_DISTANCE = ROTATION_HANDLE_BASE_PX;\n\n/** Rotation handle position in world coords. */\nexport interface RotationHandle {\n /** Handle center in world coords. */\n cx: number;\n cy: number;\n /** How far the handle is turned on screen, radians: the angle from screen\n * up to the top edge's outward normal as it lands there. Equals the pose\n * rotation under uniform zoom. */\n angle: number;\n}\n\n/** Rotation handle for a rotated rect: `distance` pixels off the top edge's\n * midpoint, along that edge's outward normal as it lands on a screen whose\n * per-axis zoom is `scale`. With no `scale`, a pixel is a world unit. When\n * `pose.rotation` is missing it's treated as 0. */\nexport function rotationHandle(\n pose: { x: number; y: number; width: number; height: number; rotation?: number },\n distance: number = DEFAULT_ROTATION_HANDLE_DISTANCE,\n scale: Scale2 = UNIT_SCALE,\n): RotationHandle {\n const rotation = pose.rotation ?? 0;\n const c = aabbCenter(pose);\n const top = rotatePoint(pose.x + pose.width / 2, pose.y, c.x, c.y, rotation);\n const p = standoff(top, { x: Math.sin(rotation), y: -Math.cos(rotation) }, distance, scale);\n return { cx: p.x, cy: p.y, angle: Math.atan2(p.nx, -p.ny) };\n}\n\nconst UNIT_SCALE: Scale2 = { x: 1, y: 1 };\n\n/** Square hit-test: returns true if `(px, py)` is within `radius` of the\n * handle's center on both axes. Mirrors `hitCornerHandle`. */\nexport function hitRotationHandle(\n handle: Pick<RotationHandle, 'cx' | 'cy'>,\n px: number,\n py: number,\n radius: number,\n): boolean {\n return Math.abs(px - handle.cx) <= radius && Math.abs(py - handle.cy) <= radius;\n}\n"],"mappings":";;;;AAQA,IAAaA,IAAmCC;AAiBhD,SAAgBC,EACd,GACA,IAAmBF,GACnB,IAAgBG,GACA;CAChB,IAAMC,IAAWC,EAAK,YAAY,GAC5BC,IAAIC,EAAWF,CAAI,GACnBG,IAAMC,EAAYJ,EAAK,IAAIA,EAAK,QAAQ,GAAGA,EAAK,GAAGC,EAAE,GAAGA,EAAE,GAAGF,CAAQ,GACrEM,IAAIC,EAASH,GAAK;EAAE,GAAG,KAAK,IAAIJ,CAAQ;EAAG,GAAG,CAAC,KAAK,IAAIA,CAAQ;CAAE,GAAGQ,GAAUC,CAAK;CAC1F,OAAO;EAAE,IAAIH,EAAE;EAAG,IAAIA,EAAE;EAAG,OAAO,KAAK,MAAMA,EAAE,IAAI,CAACA,EAAE,EAAE;CAAE;AAC5D;AAEA,IAAMP,IAAqB;CAAE,GAAG;CAAG,GAAG;AAAE;AAIxC,SAAgBW,EACd,GACA,GACA,GACA,GACS;CACT,OAAO,KAAK,IAAIC,IAAKC,EAAO,EAAE,KAAKC,KAAU,KAAK,IAAIC,IAAKF,EAAO,EAAE,KAAKC;AAC3E"}
@@ -0,0 +1,42 @@
1
+ import { visualBoundsViaDescriptor as e } from "../../core/geometry/poseDescriptor.js";
2
+ //#region src/interactions/actions/spatialReference.ts
3
+ function t(e, t) {
4
+ if (e === "pointer") {
5
+ let e = t.pointer();
6
+ return e ? {
7
+ x: e.x,
8
+ y: e.y,
9
+ width: 0,
10
+ height: 0
11
+ } : null;
12
+ }
13
+ if (typeof e != "object" || !e) return null;
14
+ if ("node" in e) return t.nodeBounds(e.node);
15
+ let n = e;
16
+ return typeof n.x != "number" || typeof n.y != "number" ? null : {
17
+ x: n.x,
18
+ y: n.y,
19
+ width: typeof n.width == "number" ? n.width : 0,
20
+ height: typeof n.height == "number" ? n.height : 0
21
+ };
22
+ }
23
+ function n(t, n, r, i, a) {
24
+ return {
25
+ pointer: () => {
26
+ if (typeof t?.worldX == "number" && typeof t.worldY == "number") return {
27
+ x: t.worldX,
28
+ y: t.worldY
29
+ };
30
+ let e = n?.get();
31
+ return e ? {
32
+ x: e.worldX,
33
+ y: e.worldY
34
+ } : null;
35
+ },
36
+ nodeBounds: (t) => r.get(t) === void 0 ? null : e(i.world(t), a)
37
+ };
38
+ }
39
+ //#endregion
40
+ export { n as actionReferenceSources, t as resolveSpatialReference };
41
+
42
+ //# sourceMappingURL=spatialReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialReference.js","names":["resolveSpatialReference","ref","p","src","r","actionReferenceSources","params","pointer","scene","id","visualBoundsViaDescriptor","frame","geom"],"sources":["../../../src/interactions/actions/spatialReference.ts"],"sourcesContent":["import type { NodeId, Scene } from 'core/scene/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport type { PointerContextValue } from 'features/pointer/PointerContext';\nimport type { PoseDescriptor } from './resize/geometry';\nimport { visualBoundsViaDescriptor } from './resize/geometry';\nimport type { PoseFrame } from './poseFrame';\n\n/**\n * @experimental\n * A world-space place a selection transform lines up against — what align\n * aligns to, what flip mirrors about — other than the selection itself:\n *\n * - `'pointer'` — where the pointer is: the click's world point when a click\n * invoked the action, otherwise the latest position in the `pointer` dep.\n * - `{ x, y, width?, height? }` — a world point, or a world rect when it has\n * extent.\n * - `{ node }` — that node's visual bounds (a key object; it does not move).\n */\nexport type SpatialReference =\n | 'pointer'\n | { x: number; y: number; width?: number; height?: number }\n | { node: NodeId };\n\n/** @experimental Where `resolveSpatialReference` reads a reference's inputs. */\nexport interface SpatialReferenceSources {\n /** The pointer's world position, or `null` when it is over no canvas. */\n pointer(): { x: number; y: number } | null;\n /** A node's world visual bounds, or `null` when it is not in the scene. */\n nodeBounds(id: NodeId): Bounds | null;\n}\n\n/**\n * @experimental\n * The world bounds `ref` names — a point comes back as a zero-size rect — or\n * `null` when it names nothing right now (no pointer, a missing node, a\n * malformed value).\n */\nexport function resolveSpatialReference(\n ref: SpatialReference | unknown,\n src: SpatialReferenceSources,\n): Bounds | null {\n if (ref === 'pointer') {\n const p = src.pointer();\n return p ? { x: p.x, y: p.y, width: 0, height: 0 } : null;\n }\n if (typeof ref !== 'object' || ref === null) return null;\n if ('node' in ref) return src.nodeBounds((ref as { node: NodeId }).node);\n const r = ref as { x?: unknown; y?: unknown; width?: unknown; height?: unknown };\n if (typeof r.x !== 'number' || typeof r.y !== 'number') return null;\n return {\n x: r.x,\n y: r.y,\n width: typeof r.width === 'number' ? r.width : 0,\n height: typeof r.height === 'number' ? r.height : 0,\n };\n}\n\n/** The sources an immediate action resolves a reference from. A click's\n * `worldX`/`worldY` params outrank the `pointer` dep. */\nexport function actionReferenceSources(\n params: Record<string, unknown> | undefined,\n pointer: PointerContextValue | undefined,\n scene: Scene<unknown, string, unknown>,\n frame: PoseFrame<unknown>,\n geom: PoseDescriptor<unknown>,\n): SpatialReferenceSources {\n return {\n pointer: () => {\n if (typeof params?.worldX === 'number' && typeof params.worldY === 'number') {\n return { x: params.worldX, y: params.worldY };\n }\n const p = pointer?.get();\n return p ? { x: p.worldX, y: p.worldY } : null;\n },\n nodeBounds: (id) => (scene.get(id) === undefined\n ? null\n : visualBoundsViaDescriptor(frame.world(id), geom)),\n };\n}\n"],"mappings":";;AAqCA,SAAgBA,EACd,GACA,GACe;CACf,IAAIC,MAAQ,WAAW;EACrB,IAAMC,IAAIC,EAAI,QAAQ;EACtB,OAAOD,IAAI;GAAE,GAAGA,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAO;GAAG,QAAQ;EAAE,IAAI;CACvD;CACA,IAAI,OAAOD,KAAQ,aAAYA,GAAc,OAAO;CACpD,IAAI,UAAUA,GAAK,OAAOE,EAAI,WAAYF,EAAyB,IAAI;CACvE,IAAMG,IAAIH;CAEV,OADI,OAAOG,EAAE,KAAM,YAAY,OAAOA,EAAE,KAAM,WAAiB,OACxD;EACL,GAAGA,EAAE;EACL,GAAGA,EAAE;EACL,OAAO,OAAOA,EAAE,SAAU,WAAWA,EAAE,QAAQ;EAC/C,QAAQ,OAAOA,EAAE,UAAW,WAAWA,EAAE,SAAS;CACpD;AACF;AAIA,SAAgBC,EACd,GACA,GACA,GACA,GACA,GACyB;CACzB,OAAO;EACL,eAAe;GACb,IAAI,OAAOC,GAAQ,UAAW,YAAY,OAAOA,EAAO,UAAW,UACjE,OAAO;IAAE,GAAGA,EAAO;IAAQ,GAAGA,EAAO;GAAO;GAE9C,IAAMJ,IAAIK,GAAS,IAAI;GACvB,OAAOL,IAAI;IAAE,GAAGA,EAAE;IAAQ,GAAGA,EAAE;GAAO,IAAI;EAC5C;EACA,aAAa,MAAQM,EAAM,IAAIC,CAAE,MAAM,KAAA,IACnC,OACAC,EAA0BC,EAAM,MAAMF,CAAE,GAAGG,CAAI;CACrD;AACF"}
@@ -0,0 +1,142 @@
1
+ import { moveAction as e } from "./defaults/move.js";
2
+ import { resizeAction as t } from "./defaults/resize.js";
3
+ import { rotateAction as n } from "./defaults/rotate.js";
4
+ import { areaSelectAction as r } from "./defaults/areaSelect.js";
5
+ import { insertAction as i, insertRotateAction as a } from "./defaults/insert.js";
6
+ import { clearSelectionAction as o } from "./defaults/clearSelection.js";
7
+ import { cloneAction as ee } from "./defaults/clone.js";
8
+ import { viewportDragPanAction as te } from "./defaults/viewportDragPan.js";
9
+ import { editAnchorsAction as ne } from "./defaults/editAnchors.js";
10
+ import { lassoSelectAction as re } from "./defaults/lassoSelect.js";
11
+ import { pinchZoomAction as s } from "./defaults/pinchZoom.js";
12
+ import { deleteAction as c } from "./defaults/delete.js";
13
+ import { clipboardCopyAction as l, clipboardCutAction as u, clipboardPasteAction as d } from "./defaults/clipboard.js";
14
+ import { enterTextEditAction as f } from "./defaults/enterTextEdit.js";
15
+ import { escapeAction as p } from "./defaults/escape.js";
16
+ import { cancelGestureAction as m } from "./defaults/cancelGesture.js";
17
+ import { selectAllAction as h } from "./defaults/selectAll.js";
18
+ import { duplicateAction as g } from "./defaults/duplicate.js";
19
+ import { groupAction as _, ungroupAction as v } from "./defaults/group.js";
20
+ import { redoAction as y, undoAction as b } from "./defaults/undoRedo.js";
21
+ import { flipAction as x } from "./defaults/flip.js";
22
+ import { nudgeDownAction as S, nudgeLeftAction as C, nudgeRightAction as w, nudgeUpAction as T } from "./defaults/nudge.js";
23
+ import { reorderBackwardAction as E, reorderForwardAction as D } from "./defaults/reorder.js";
24
+ import { alignBottomAction as O, alignCenterXAction as k, alignCenterYAction as A, alignLeftAction as j, alignRightAction as M, alignTopAction as N } from "./defaults/align.js";
25
+ import { distributeHorizontalAction as P, distributeVerticalAction as ie } from "./defaults/distribute.js";
26
+ import { pathfinderCropAction as F, pathfinderDivideAction as I, pathfinderExcludeAction as L, pathfinderIntersectAction as R, pathfinderSubtractAction as z, pathfinderUnionAction as B } from "./defaults/booleans.js";
27
+ import { createOutlinesAction as V } from "./defaults/createOutlines.js";
28
+ import { enterPathEditAction as H } from "./defaults/enterPathEdit.js";
29
+ import { exitPathEditAction as U } from "./defaults/exitPathEdit.js";
30
+ import { insertPathAnchorAction as W } from "./defaults/insertPathAnchor.js";
31
+ import { cutPathAtAnchorAction as G, deleteAnchorsAction as K, marqueeAnchorsAction as q, nudgeAnchorsDownAction as J, nudgeAnchorsLeftAction as Y, nudgeAnchorsRightAction as ae, nudgeAnchorsUpAction as oe, selectAnchorAction as se } from "./defaults/anchorEditing.js";
32
+ import { setFillAction as ce } from "./defaults/setFill.js";
33
+ import { setStrokeAction as le } from "./defaults/setStroke.js";
34
+ import { setFillOpacityAction as X } from "./defaults/setFillOpacity.js";
35
+ import { setStrokeOpacityAction as ue } from "./defaults/setStrokeOpacity.js";
36
+ import { ingestAction as de } from "./defaults/ingest.js";
37
+ import { useEffect as Z } from "react";
38
+ import { useLatest as Q } from "@weasel-js/react";
39
+ import "@weasel-js/routing";
40
+ import { useActionsRegistry as fe, useOptionalActiveToolContext as pe, useOptionalDepRegistry as me } from "@weasel-js/routing/react";
41
+ //#region src/interactions/actions/useStandardActions.ts
42
+ var $ = [
43
+ p,
44
+ m,
45
+ h,
46
+ g,
47
+ c,
48
+ _,
49
+ v,
50
+ b,
51
+ y,
52
+ x,
53
+ T,
54
+ S,
55
+ C,
56
+ w,
57
+ D,
58
+ E,
59
+ j,
60
+ k,
61
+ M,
62
+ N,
63
+ A,
64
+ O,
65
+ P,
66
+ ie,
67
+ B,
68
+ z,
69
+ R,
70
+ L,
71
+ I,
72
+ F,
73
+ V,
74
+ e,
75
+ t,
76
+ n,
77
+ r,
78
+ i,
79
+ a,
80
+ ee,
81
+ ne,
82
+ H,
83
+ U,
84
+ W,
85
+ oe,
86
+ J,
87
+ Y,
88
+ ae,
89
+ K,
90
+ G,
91
+ q,
92
+ se,
93
+ re,
94
+ s,
95
+ te,
96
+ o,
97
+ f,
98
+ ce,
99
+ le,
100
+ X,
101
+ ue,
102
+ de,
103
+ u,
104
+ l,
105
+ d
106
+ ], he = $.map((e) => e.id);
107
+ function ge(e) {
108
+ let t = Q(e), n = pe(), r = Q(n), i = me();
109
+ Z(() => {
110
+ if (!i) return;
111
+ let e = [];
112
+ for (let n of [
113
+ "selection",
114
+ "view",
115
+ "scene",
116
+ "history"
117
+ ]) e.push(i.register(n, () => t.current[n]));
118
+ return e.push(i.register("activeTool", () => t.current.activeTool ?? r.current)), () => {
119
+ for (let t of e) t();
120
+ };
121
+ }, [
122
+ i,
123
+ t,
124
+ r
125
+ ]);
126
+ let a = fe(), o = e.exclude ? [...e.exclude].join("\0") : "";
127
+ Z(() => {
128
+ if (!a || !i) return;
129
+ let e = new Set(o ? o.split("\0") : []), t = $.filter((t) => !e.has(t.id)).map((e) => a.register(e));
130
+ return () => {
131
+ for (let e of t) e();
132
+ };
133
+ }, [
134
+ a,
135
+ i,
136
+ o
137
+ ]);
138
+ }
139
+ //#endregion
140
+ export { he as KIT_STANDARD_ACTION_IDS, ge as useStandardActions };
141
+
142
+ //# sourceMappingURL=useStandardActions.js.map