@weasel-js/core 1.14.2 → 1.15.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 (856) hide show
  1. package/CHANGELOG.md +251 -0
  2. package/dist/WeaselProvider.js +4 -5
  3. package/dist/affordances/composeAffordanceLayer.js +1 -2
  4. package/dist/affordances/cornerResize.js +4 -5
  5. package/dist/affordances/hitAffordanceRegions.js +1 -2
  6. package/dist/affordances/pathAnchors.js +1 -3
  7. package/dist/affordances/pathAnchors.js.map +1 -1
  8. package/dist/affordances/rotateCursor.js +1 -2
  9. package/dist/affordances/rotationHandle.js +2 -3
  10. package/dist/animation/behaviors/coast.js +1 -2
  11. package/dist/animation/behaviors/coastByWrite.js +2 -3
  12. package/dist/animation/behaviors/coastOnTargets.js +2 -3
  13. package/dist/animation/behaviors/momentum.js +1 -2
  14. package/dist/animation/clipTargets.js +1 -2
  15. package/dist/animation/departures.js +2 -3
  16. package/dist/animation/poseHelpers.js +2 -3
  17. package/dist/animation/poseTarget.js +2 -3
  18. package/dist/animation/poseTransition.js +1 -2
  19. package/dist/animation/reflow.js +2 -3
  20. package/dist/animation/rewind.js +1 -2
  21. package/dist/animation/rig/bindRig.js +2 -3
  22. package/dist/animation/rig/rigNode.js +1 -2
  23. package/dist/animation/rig/rigSeat.js +1 -2
  24. package/dist/animation/rig/skinBinding.js +1 -2
  25. package/dist/animation/rig/useRig.js +2 -3
  26. package/dist/animation/wrappers/animateLifecycle.js +1 -2
  27. package/dist/animation/wrappers/animateOnSetPose.js +1 -2
  28. package/dist/animation/wrappers/instantPose.js +1 -2
  29. package/dist/animation/writtenPoseTarget.js +1 -2
  30. package/dist/barrel/interactions.js +2 -1
  31. package/dist/barrel/paths.js +1 -1
  32. package/dist/barrel/renderer.js +2 -2
  33. package/dist/barrel/routing.js +6 -4
  34. package/dist/barrel/scene.js +2 -2
  35. package/dist/barrel/text.js +5 -3
  36. package/dist/canvas/Canvas.js +10 -7
  37. package/dist/canvas/Canvas.js.map +1 -1
  38. package/dist/canvas/CanvasView.js +6 -7
  39. package/dist/canvas/CursorCoordsHud.js +2 -3
  40. package/dist/canvas/DrawCanvas.js +8 -5
  41. package/dist/canvas/DrawCanvas.js.map +1 -1
  42. package/dist/canvas/GestureReason.js +1 -2
  43. package/dist/canvas/GestureReason.module.js +1 -2
  44. package/dist/canvas/LeanSceneCanvas.js +2 -3
  45. package/dist/canvas/ModalityHud.js +2 -3
  46. package/dist/canvas/NodeShape.js +3 -4
  47. package/dist/canvas/PickHud.js +2 -3
  48. package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +1 -2
  49. package/dist/canvas/SceneCanvas/CanvasKitProviders.js +3 -4
  50. package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +1 -2
  51. package/dist/canvas/SceneCanvas/DevHuds.js +1 -2
  52. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +1 -2
  53. package/dist/canvas/SceneCanvas/SceneCanvasInput.js +8 -5
  54. package/dist/canvas/SceneCanvas/SceneCanvasInput.js.map +1 -1
  55. package/dist/canvas/SceneCanvas/SurfaceDeclarations.js +1 -2
  56. package/dist/canvas/SceneCanvas/brushOverlay.js +1 -2
  57. package/dist/canvas/SceneCanvas/builtinToolSets.js +7 -5
  58. package/dist/canvas/SceneCanvas/builtinToolSets.js.map +1 -1
  59. package/dist/canvas/SceneCanvas/canvasPassThrough.js +1 -2
  60. package/dist/canvas/SceneCanvas/contributionFrameHooks.js +1 -2
  61. package/dist/canvas/SceneCanvas/coordTrace.js +1 -2
  62. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +4 -5
  63. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -2
  64. package/dist/canvas/SceneCanvas/defaultTextEditor.js +4 -5
  65. package/dist/canvas/SceneCanvas/describePresets.js +1 -2
  66. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +1 -2
  67. package/dist/canvas/SceneCanvas/features.js +1 -2
  68. package/dist/canvas/SceneCanvas/insertPreviewCommands.js +1 -2
  69. package/dist/canvas/SceneCanvas/mergeLayers.js +1 -2
  70. package/dist/canvas/SceneCanvas/namedPresets.js +5 -6
  71. package/dist/canvas/SceneCanvas/poseGeometry.js +1 -2
  72. package/dist/canvas/SceneCanvas/poseRegistrars.js +1 -2
  73. package/dist/canvas/SceneCanvas/presets/arrange.js +2 -3
  74. package/dist/canvas/SceneCanvas/presets/baseline.js +1 -2
  75. package/dist/canvas/SceneCanvas/presets/chrome.js +1 -2
  76. package/dist/canvas/SceneCanvas/presets/composites.js +1 -2
  77. package/dist/canvas/SceneCanvas/presets/edit.js +4 -5
  78. package/dist/canvas/SceneCanvas/presets/ingest.js +1 -2
  79. package/dist/canvas/SceneCanvas/presets/paths.js +9 -10
  80. package/dist/canvas/SceneCanvas/presets/paths.js.map +1 -1
  81. package/dist/canvas/SceneCanvas/presets/select.js +1 -2
  82. package/dist/canvas/SceneCanvas/presets/toolDriven.js +2 -3
  83. package/dist/canvas/SceneCanvas/presets/tools.js +1 -2
  84. package/dist/canvas/SceneCanvas/presets/transform.js +2 -3
  85. package/dist/canvas/SceneCanvas/presets/view.js +2 -3
  86. package/dist/canvas/SceneCanvas/props.js +1 -2
  87. package/dist/canvas/SceneCanvas/scenePointQuery.js +2 -3
  88. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +2 -3
  89. package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -1
  90. package/dist/canvas/SceneCanvas/toolRegistry.js +2 -3
  91. package/dist/canvas/SceneCanvas/useActionTunings.js +1 -2
  92. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +1 -2
  93. package/dist/canvas/SceneCanvas/useBakedScene.js +2 -3
  94. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +7 -8
  95. package/dist/canvas/SceneCanvas/useBuiltinTools.js +3 -2
  96. package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -1
  97. package/dist/canvas/SceneCanvas/useCanvasCamera.js +2 -3
  98. package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js +1 -2
  99. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +1 -2
  100. package/dist/canvas/SceneCanvas/useCanvasSelection.js +8 -6
  101. package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -1
  102. package/dist/canvas/SceneCanvas/useCanvasTools.js +2 -3
  103. package/dist/canvas/SceneCanvas/useChromeAffordances.js +2 -3
  104. package/dist/canvas/SceneCanvas/useContributionRoles.js +3 -2
  105. package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -1
  106. package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +4 -5
  107. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +2 -3
  108. package/dist/canvas/SceneCanvas/useHeldModifiers.js +1 -2
  109. package/dist/canvas/SceneCanvas/useMagnificationCheck.js +41 -0
  110. package/dist/canvas/SceneCanvas/useMagnificationCheck.js.map +1 -0
  111. package/dist/canvas/SceneCanvas/useNodeAtPoint.js +1 -2
  112. package/dist/canvas/SceneCanvas/useNodeKinds.js +2 -3
  113. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +10 -11
  114. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +1 -2
  115. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +6 -7
  116. package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +1 -2
  117. package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +1 -2
  118. package/dist/canvas/SceneCanvas/useSceneChrome.js +22 -11
  119. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -1
  120. package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +6 -7
  121. package/dist/canvas/SceneCanvas/useScenePicking.js +5 -6
  122. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +1 -2
  123. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +7 -8
  124. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +2 -3
  125. package/dist/canvas/SceneCanvas/useSceneStandardActions.js +28 -17
  126. package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
  127. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +2 -3
  128. package/dist/canvas/SceneCanvas/useSurfaceRouting.js +1 -2
  129. package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js +1 -2
  130. package/dist/canvas/SceneCanvas/useToolKeybindings.js +1 -2
  131. package/dist/canvas/SceneCanvas/useViewportActions.js +3 -4
  132. package/dist/canvas/SceneCanvas/worldPointAt.js +1 -2
  133. package/dist/canvas/SceneCanvas.js +22 -20
  134. package/dist/canvas/SceneCanvas.js.map +1 -1
  135. package/dist/canvas/SceneViewCanvas.js +7 -4
  136. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  137. package/dist/canvas/SurfaceCanvas.js +1 -2
  138. package/dist/canvas/ViewMarker.js +1 -2
  139. package/dist/canvas/accentColor.js +1 -2
  140. package/dist/canvas/adapterDerivedPath.js +2 -3
  141. package/dist/canvas/adapterPickSource.js +1 -2
  142. package/dist/canvas/affordanceAt.js +2 -4
  143. package/dist/canvas/affordanceAt.js.map +1 -1
  144. package/dist/canvas/buildSceneLayer.js +4 -5
  145. package/dist/canvas/buildSceneTree.js +4 -5
  146. package/dist/canvas/canvasRenderer.js +1 -2
  147. package/dist/canvas/colorOverrides.js +1 -2
  148. package/dist/canvas/contextAttributes.js +1 -2
  149. package/dist/canvas/copiesAbove.js +1 -2
  150. package/dist/canvas/defaultDrawOne.js +1 -2
  151. package/dist/canvas/deps/areaSelect.js +5 -3
  152. package/dist/canvas/deps/areaSelect.js.map +1 -1
  153. package/dist/canvas/deps/booleans.js +5 -6
  154. package/dist/canvas/deps/changes.js +1 -2
  155. package/dist/canvas/deps/chromeRules.js +36 -0
  156. package/dist/canvas/deps/chromeRules.js.map +1 -0
  157. package/dist/canvas/deps/debug.js +1 -2
  158. package/dist/canvas/deps/dispatchSources.js +1 -2
  159. package/dist/canvas/deps/dispatcher.js +1 -2
  160. package/dist/canvas/deps/editAnchors.js +3 -10
  161. package/dist/canvas/deps/editAnchors.js.map +1 -1
  162. package/dist/canvas/deps/enteredGroup.js +1 -2
  163. package/dist/canvas/deps/geometryProjection.js +1 -2
  164. package/dist/canvas/deps/hitTestArea.js +6 -5
  165. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  166. package/dist/canvas/deps/ingestion.js +1 -2
  167. package/dist/canvas/deps/insert.js +3 -4
  168. package/dist/canvas/deps/insertSite.js +3 -4
  169. package/dist/canvas/deps/kitSettings.js +1 -2
  170. package/dist/canvas/deps/lassoSelect.js +5 -3
  171. package/dist/canvas/deps/lassoSelect.js.map +1 -1
  172. package/dist/canvas/deps/layout.js +1 -2
  173. package/dist/canvas/deps/modeDefaultTool.js +22 -0
  174. package/dist/canvas/deps/modeDefaultTool.js.map +1 -0
  175. package/dist/canvas/deps/nodeAtPoint.js +1 -2
  176. package/dist/canvas/deps/pathEditCommits.js +3 -4
  177. package/dist/canvas/deps/pathLeaf.js +1 -2
  178. package/dist/canvas/deps/pathLeafDeps.js +2 -3
  179. package/dist/canvas/deps/poseDescriptor.js +1 -2
  180. package/dist/canvas/deps/previewPaths.js +1 -2
  181. package/dist/canvas/deps/resizePolicy.js +1 -2
  182. package/dist/canvas/deps/selectionSnapshot.js +22 -0
  183. package/dist/canvas/deps/selectionSnapshot.js.map +1 -0
  184. package/dist/canvas/deps/slice.js +5 -6
  185. package/dist/canvas/deps/snap.js +4 -4
  186. package/dist/canvas/deps/snap.js.map +1 -1
  187. package/dist/canvas/deps/surface.js +1 -2
  188. package/dist/canvas/deps/textEdit.js +1 -2
  189. package/dist/canvas/deps/transformFollowers.js +1 -2
  190. package/dist/canvas/deps/view.js +1 -2
  191. package/dist/canvas/derivedPath.js +6 -7
  192. package/dist/canvas/doubleClickTarget.js +1 -2
  193. package/dist/canvas/drawEnvelope.js +1 -2
  194. package/dist/canvas/drawnBounds.js +4 -5
  195. package/dist/canvas/getNodeAtPoint.js +1 -2
  196. package/dist/canvas/hostAnchor.js +1 -2
  197. package/dist/canvas/hud.module.js +1 -2
  198. package/dist/canvas/inheritedPaints.js +1 -2
  199. package/dist/canvas/insertPreviewExtent.js +1 -2
  200. package/dist/canvas/kitRequirements.js +1 -2
  201. package/dist/canvas/layerHover.js +1 -2
  202. package/dist/canvas/layerOrder.js +1 -2
  203. package/dist/canvas/layerSlots.js +1 -2
  204. package/dist/canvas/mountedCanvases.js +1 -2
  205. package/dist/canvas/nodeShapes/derivedPainter.js +2 -3
  206. package/dist/canvas/nodeShapes/imagePainter.js +1 -2
  207. package/dist/canvas/nodeShapes/measurePainter.js +2 -3
  208. package/dist/canvas/nodeShapes/memo.js +1 -2
  209. package/dist/canvas/nodeShapes/nodePaint.js +1 -2
  210. package/dist/canvas/nodeShapes/pathPainter.js +3 -4
  211. package/dist/canvas/nodeShapes/poseBox.js +1 -2
  212. package/dist/canvas/nodeShapes/rectFallbackPainter.js +1 -2
  213. package/dist/canvas/nodeShapes/shapePainter.js +2 -3
  214. package/dist/canvas/nodeShapes/strokedBounds.js +1 -2
  215. package/dist/canvas/nodeShapes/textPainter.js +1 -2
  216. package/dist/canvas/overChildren.js +1 -2
  217. package/dist/canvas/overlayRoleStrokes.js +1 -2
  218. package/dist/canvas/ownClip.js +1 -2
  219. package/dist/canvas/paintCull.js +1 -2
  220. package/dist/canvas/paintedCursorLayer.js +1 -2
  221. package/dist/canvas/pathOverlay.js +1 -2
  222. package/dist/canvas/pickIndex/nodeBroadBox.js +3 -4
  223. package/dist/canvas/pickIndex/scenePickIndex.js +3 -4
  224. package/dist/canvas/pickReach.js +13 -10
  225. package/dist/canvas/pickReach.js.map +1 -1
  226. package/dist/canvas/pickWalk.js +9 -8
  227. package/dist/canvas/pickWalk.js.map +1 -1
  228. package/dist/canvas/planeClips.js +1 -2
  229. package/dist/canvas/poseRotation.js +1 -2
  230. package/dist/canvas/publishPreviews.js +1 -2
  231. package/dist/canvas/rasterReadback.js +1 -2
  232. package/dist/canvas/rasterToPng.js +1 -2
  233. package/dist/canvas/renderDebugSnapshot.js +1 -2
  234. package/dist/canvas/renderNeeds.js +1 -2
  235. package/dist/canvas/renderSceneToPixels.js +5 -6
  236. package/dist/canvas/sceneAdapter.js +37 -27
  237. package/dist/canvas/sceneAdapter.js.map +1 -1
  238. package/dist/canvas/sceneClipboard.js +19 -7
  239. package/dist/canvas/sceneClipboard.js.map +1 -1
  240. package/dist/canvas/sceneLayerPaint.js +1 -2
  241. package/dist/canvas/scenePickReads.js +1 -2
  242. package/dist/canvas/scenePickSource.js +7 -8
  243. package/dist/canvas/scenePickSource.js.map +1 -1
  244. package/dist/canvas/sceneSlotWiring.js +2 -3
  245. package/dist/canvas/sceneViewRender.js +5 -6
  246. package/dist/canvas/shownNodes.js +1 -2
  247. package/dist/canvas/slopsDebugLayer.js +1 -2
  248. package/dist/canvas/surfaceContribution.js +1 -2
  249. package/dist/canvas/useCanvasElements.js +1 -2
  250. package/dist/canvas/useCanvasHandle.js +1 -2
  251. package/dist/canvas/useCanvasPaint.js +2 -3
  252. package/dist/canvas/useCanvasRenderer.js +1 -2
  253. package/dist/canvas/useCanvasSurface.js +22 -5
  254. package/dist/canvas/useCanvasSurface.js.map +1 -1
  255. package/dist/canvas/useCanvasView.js +2 -3
  256. package/dist/canvas/useClientToWorld.js +1 -2
  257. package/dist/canvas/useExtraLayers.js +1 -2
  258. package/dist/canvas/useFrameLoop.js +7 -9
  259. package/dist/canvas/useFrameLoop.js.map +1 -1
  260. package/dist/canvas/useHitObserver.js +1 -2
  261. package/dist/canvas/useHostAnchor.js +1 -2
  262. package/dist/canvas/useInFlightBounds.js +6 -6
  263. package/dist/canvas/useInFlightBounds.js.map +1 -1
  264. package/dist/canvas/useLateContentRedraw.js +1 -2
  265. package/dist/canvas/useLayerStack.js +2 -3
  266. package/dist/canvas/usePaintedCursor.js +1 -2
  267. package/dist/canvas/useRedrawOn.js +1 -2
  268. package/dist/canvas/useSceneAdapter.js +1 -2
  269. package/dist/canvas/useSceneLayerList.js +1 -2
  270. package/dist/canvas/useSurfaceInput.js +1 -2
  271. package/dist/canvas/useSurfaceSize.js +5 -5
  272. package/dist/canvas/useSurfaceSize.js.map +1 -1
  273. package/dist/canvas/useToolCursor.js +1 -2
  274. package/dist/canvas/useViewAim.js +2 -3
  275. package/dist/canvas/useViewHelpers.js +5 -4
  276. package/dist/canvas/useViewHelpers.js.map +1 -1
  277. package/dist/canvas/useViewLayerGate.js +1 -2
  278. package/dist/canvas/useViewNesting.js +1 -2
  279. package/dist/canvas/useViewRegistrySurface.js +1 -2
  280. package/dist/canvas/viewInputs.js +1 -2
  281. package/dist/canvas/viewMarkers.js +1 -2
  282. package/dist/canvas/viewRegistry.js +1 -2
  283. package/dist/canvas/viewSnap.js +1 -2
  284. package/dist/canvas/watchElementMove.js +1 -2
  285. package/dist/canvas/wrapNodeOutput.js +1 -2
  286. package/dist/core/adapters/testing/rootsTree.js +1 -2
  287. package/dist/core/applyOps.js +1 -2
  288. package/dist/core/device/targets.js +1 -2
  289. package/dist/core/device/useDeviceProfile.js +1 -2
  290. package/dist/core/device/useTargetBasePx.js +1 -2
  291. package/dist/core/device/watchDevicePixelRatio.js +1 -2
  292. package/dist/core/geometry/autoPoseDescriptor.js +2 -3
  293. package/dist/core/geometry/booleanOfPaths.js +1 -2
  294. package/dist/core/geometry/inkExtents.js +1 -2
  295. package/dist/core/geometry/pathPoseDescriptor.js +1 -2
  296. package/dist/core/geometry/poseDescriptor.js +1 -2
  297. package/dist/core/geometry/regionHit.js +36 -18
  298. package/dist/core/geometry/regionHit.js.map +1 -1
  299. package/dist/core/geometry/targetFrame.js +1 -2
  300. package/dist/core/geometry/unionBounds.js +1 -2
  301. package/dist/core/layers/backgroundFill.js +1 -2
  302. package/dist/core/layers/children.js +1 -2
  303. package/dist/core/layers/gateLayer.js +1 -2
  304. package/dist/core/layers/layerGroup.js +1 -2
  305. package/dist/core/layers/redrawSource.js +1 -2
  306. package/dist/core/layers/render.js +1 -2
  307. package/dist/core/layers/retain.js +1 -2
  308. package/dist/core/ops/arrange.js +1 -2
  309. package/dist/core/ops/create.js +2 -3
  310. package/dist/core/ops/createHistory.js +2 -3
  311. package/dist/core/ops/delete.js +2 -3
  312. package/dist/core/ops/nodeFlags.js +1 -2
  313. package/dist/core/ops/registry.js +1 -2
  314. package/dist/core/ops/reorder/algorithms.js +1 -2
  315. package/dist/core/ops/reorder/index.js +1 -2
  316. package/dist/core/ops/reorder/setChildOrder.js +1 -2
  317. package/dist/core/ops/reparent.js +1 -2
  318. package/dist/core/ops/select.js +1 -2
  319. package/dist/core/ops/setData.js +1 -2
  320. package/dist/core/ops/setDependsOn.js +1 -2
  321. package/dist/core/ops/setLayer.js +1 -2
  322. package/dist/core/ops/setLayout.js +1 -2
  323. package/dist/core/ops/setPath.js +1 -2
  324. package/dist/core/ops/setText.js +1 -2
  325. package/dist/core/ops/slot.js +1 -2
  326. package/dist/core/ops/transform.js +1 -2
  327. package/dist/core/ops/writtenBy.js +1 -2
  328. package/dist/core/pages/fitViewToPage.js +1 -2
  329. package/dist/core/pages/pageEdits.js +3 -4
  330. package/dist/core/pages/pages.js +1 -2
  331. package/dist/core/pages/pages.js.map +1 -1
  332. package/dist/core/pages/pagesLayer.js +1 -2
  333. package/dist/core/paint/meshKind.js +1 -2
  334. package/dist/core/paint/meshKindLazy.js +9 -18
  335. package/dist/core/paint/meshKindLazy.js.map +1 -1
  336. package/dist/core/paint/paintKindEntry.js +1 -2
  337. package/dist/core/paint/paintKinds.js +1 -2
  338. package/dist/core/paint/registerMesh.js +1 -2
  339. package/dist/core/scene/NodeProperties.js +1 -2
  340. package/dist/core/scene/NodeRouting.js +1 -2
  341. package/dist/core/scene/annotation.js +1 -2
  342. package/dist/core/scene/appliedLog.js +1 -2
  343. package/dist/core/scene/arrivalWindow.js +2 -3
  344. package/dist/core/scene/arrivals.js +1 -2
  345. package/dist/core/scene/booleanGroup.js +1 -2
  346. package/dist/core/scene/booleanOfChildren.js +1 -2
  347. package/dist/core/scene/boundOps.js +1 -2
  348. package/dist/core/scene/carryDescendants.js +2 -3
  349. package/dist/core/scene/clipNothing.js +1 -2
  350. package/dist/core/scene/composeFrame.js +1 -2
  351. package/dist/core/scene/composePose.js +1 -2
  352. package/dist/core/scene/declaredFieldSetters.js +1 -2
  353. package/dist/core/scene/depFrame.js +1 -2
  354. package/dist/core/scene/depMemo.js +1 -2
  355. package/dist/core/scene/dependents.js +1 -2
  356. package/dist/core/scene/derivedParts.js +1 -2
  357. package/dist/core/scene/derivedPath.js +2 -3
  358. package/dist/core/scene/docValues.js +1 -2
  359. package/dist/core/scene/documentOf.js +1 -2
  360. package/dist/core/scene/editMode.js +5 -3
  361. package/dist/core/scene/editMode.js.map +1 -1
  362. package/dist/core/scene/editPass.js +1 -2
  363. package/dist/core/scene/effectivePose.js +3 -4
  364. package/dist/core/scene/fieldEdits.js +1 -2
  365. package/dist/core/scene/fontReads.js +1 -2
  366. package/dist/core/scene/historyFacade.js +8 -52
  367. package/dist/core/scene/historyFacade.js.map +1 -1
  368. package/dist/core/scene/historyForm.js +1 -2
  369. package/dist/core/scene/inheritedPaint.js +1 -2
  370. package/dist/core/scene/kitOps.js +16 -15
  371. package/dist/core/scene/kitOps.js.map +1 -1
  372. package/dist/core/scene/kitRegistry.js +2 -3
  373. package/dist/core/scene/layerOps.js +1 -2
  374. package/dist/core/scene/layerStack.js +1 -2
  375. package/dist/core/scene/layoutPass.js +4 -5
  376. package/dist/core/scene/lockGuard.js +1 -2
  377. package/dist/core/scene/minSize.js +1 -2
  378. package/dist/core/scene/nestedHit.js +1 -2
  379. package/dist/core/scene/nodeAsShown.js +1 -2
  380. package/dist/core/scene/nodeFlags.js +1 -2
  381. package/dist/core/scene/nodeFnFields.js +1 -2
  382. package/dist/core/scene/nodeGates.js +3 -4
  383. package/dist/core/scene/nodeGates.js.map +1 -1
  384. package/dist/core/scene/nodeMemo.js +1 -2
  385. package/dist/core/scene/nodeStore.js +2 -3
  386. package/dist/core/scene/notifier.js +1 -2
  387. package/dist/core/scene/opTable.js +9 -10
  388. package/dist/core/scene/opTable.js.map +1 -1
  389. package/dist/core/scene/outerOps.js +3 -4
  390. package/dist/core/scene/outerOps.js.map +1 -1
  391. package/dist/core/scene/pathEffects/blend.js +1 -2
  392. package/dist/core/scene/pathEffects/derive.js +2 -3
  393. package/dist/core/scene/pathEffects/effects.js +1 -2
  394. package/dist/core/scene/pathEffects/foundHidden.js +1 -2
  395. package/dist/core/scene/pathEffects/textAlong.js +1 -2
  396. package/dist/core/scene/pathEffects/textAlongBands.js +1 -2
  397. package/dist/core/scene/plyStacks.js +1 -2
  398. package/dist/core/scene/poseFeed.js +1 -2
  399. package/dist/core/scene/poseHold.js +1 -2
  400. package/dist/core/scene/poseOverrides.js +1 -2
  401. package/dist/core/scene/posePlies.js +1 -2
  402. package/dist/core/scene/poseRemovals.js +1 -2
  403. package/dist/core/scene/poseSnapshot.js +1 -2
  404. package/dist/core/scene/poseWrites.js +17 -17
  405. package/dist/core/scene/poseWrites.js.map +1 -1
  406. package/dist/core/scene/reconcileSpecs.js +26 -3
  407. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  408. package/dist/core/scene/recorder.js +1 -2
  409. package/dist/core/scene/renderOrder.js +1 -2
  410. package/dist/core/scene/sameValue.js +1 -2
  411. package/dist/core/scene/scene.js +11 -12
  412. package/dist/core/scene/scene.js.map +1 -1
  413. package/dist/core/scene/sceneChanges.js +1 -2
  414. package/dist/core/scene/sceneEdits.js +1 -2
  415. package/dist/core/scene/sceneJournals.js +77 -0
  416. package/dist/core/scene/sceneJournals.js.map +1 -0
  417. package/dist/core/scene/sceneMutators.js +2 -3
  418. package/dist/core/scene/scenePoseAdapter.js +1 -2
  419. package/dist/core/scene/sceneRecording.js +4 -4
  420. package/dist/core/scene/sceneRecording.js.map +1 -1
  421. package/dist/core/scene/sceneSelection.js +8 -5
  422. package/dist/core/scene/sceneSelection.js.map +1 -1
  423. package/dist/core/scene/sceneState.js +3 -4
  424. package/dist/core/scene/scrollOffsets.js +1 -2
  425. package/dist/core/scene/serialization.js +2 -3
  426. package/dist/core/scene/staleReplay.js +1 -2
  427. package/dist/core/scene/statedFields.js +1 -2
  428. package/dist/core/scene/strategyView.js +1 -2
  429. package/dist/core/scene/treeEdits.js +2 -3
  430. package/dist/core/scene/treeOrder.js +1 -2
  431. package/dist/core/scene/treeReads.js +1 -2
  432. package/dist/core/scene/treeShape.js +1 -2
  433. package/dist/core/scene/types.js +1 -2
  434. package/dist/core/scene/types.js.map +1 -1
  435. package/dist/core/scene/unionOfChildren.js +1 -2
  436. package/dist/core/scene/unitScopes.js +20 -4
  437. package/dist/core/scene/unitScopes.js.map +1 -1
  438. package/dist/core/scene/useScene.js +2 -3
  439. package/dist/core/scene/worldSave.js +2 -3
  440. package/dist/core/selection/chromeState.js +1 -2
  441. package/dist/core/selection/outermostSelection.js +56 -0
  442. package/dist/core/selection/outermostSelection.js.map +1 -0
  443. package/dist/core/selection/readOnlySelection.js +1 -2
  444. package/dist/core/selection/selectionTarget.js +1 -2
  445. package/dist/core/selection/usePublishSceneSelection.js +1 -2
  446. package/dist/core/selection/useSelection.js +1 -2
  447. package/dist/core/shapeKinds.js +1 -2
  448. package/dist/core/stableStringify.js +1 -2
  449. package/dist/core/stylus/stylus.js +1 -2
  450. package/dist/core/stylus/usePointerStylus.js +1 -2
  451. package/dist/core/usePaintKinds.js +1 -2
  452. package/dist/core/viewport/clampView.js +1 -2
  453. package/dist/core/viewport/clientToWorld.js +1 -2
  454. package/dist/core/viewport/createVelocityTracker.js +1 -2
  455. package/dist/core/viewport/fitToBounds.js +1 -2
  456. package/dist/core/viewport/fitViewToBounds.js +1 -2
  457. package/dist/core/viewport/interpolateView.js +1 -2
  458. package/dist/core/viewport/parallax.js +1 -2
  459. package/dist/core/viewport/sceneNodeClientRect.js +1 -2
  460. package/dist/core/viewport/screenSlop.js +1 -2
  461. package/dist/core/viewport/useAutoCenter.js +1 -2
  462. package/dist/core/viewport/useCanvasSize.js +48 -28
  463. package/dist/core/viewport/useCanvasSize.js.map +1 -1
  464. package/dist/core/viewport/useDecayLoop.js +1 -2
  465. package/dist/core/viewport/useNodeOverlayFrame.js +1 -2
  466. package/dist/core/viewport/useVelocityTracker.js +1 -2
  467. package/dist/core/viewport/useViewAnimation.js +3 -4
  468. package/dist/core/viewport/view.js +1 -2
  469. package/dist/core/viewport/viewTransform.js +1 -2
  470. package/dist/core/viewport/viewportWorldRect.js +1 -2
  471. package/dist/core/viewport/wheelHandler.js +1 -2
  472. package/dist/core/viewport/zoomAt.js +2 -3
  473. package/dist/core/viewport/zoomBounds.js +1 -2
  474. package/dist/debug/createDebugOverlayLayer.js +1 -2
  475. package/dist/debug/createDebugSink.js +1 -2
  476. package/dist/debug/defaultTheme.js +1 -2
  477. package/dist/debug/features.js +1 -2
  478. package/dist/debug/frameStats.js +1 -2
  479. package/dist/debug/overlayPanels.js +1 -2
  480. package/dist/debug/parseDebugFlags.js +1 -2
  481. package/dist/debug/useDebugSink.js +2 -3
  482. package/dist/{depSchema-DD9H89gX.d.ts → depSchema-C7a_OMt-.d.ts} +101 -65
  483. package/dist/devtools/handlers.js +1 -2
  484. package/dist/devtools/history.js +1 -2
  485. package/dist/devtools/hook.js +1 -2
  486. package/dist/devtools/label.js +1 -2
  487. package/dist/devtools/notices.js +1 -2
  488. package/dist/devtools/protocol.js +1 -2
  489. package/dist/devtools/registry.js +1 -2
  490. package/dist/devtools/root.js +1 -2
  491. package/dist/devtools/serialize.js +1 -2
  492. package/dist/devtools/session.js +2 -3
  493. package/dist/devtools/transport.js +1 -2
  494. package/dist/devtools/useDevtoolsRoot.js +1 -2
  495. package/dist/devtools-protocol.d.ts +1 -1
  496. package/dist/devtools-protocol.js +2 -2
  497. package/dist/devtools.d.ts +1 -1
  498. package/dist/devtools.js +1 -2
  499. package/dist/domains/chrome-caps/buildChromeCtx.js +1 -2
  500. package/dist/domains/chrome-caps/conditions.js +1 -2
  501. package/dist/domains/chrome-caps/defaults.js +1 -2
  502. package/dist/domains/chrome-caps/resolve.js +3 -3
  503. package/dist/domains/chrome-caps/resolve.js.map +1 -1
  504. package/dist/domains/chrome-caps/useChromeCaps.js +5 -4
  505. package/dist/domains/chrome-caps/useChromeCaps.js.map +1 -1
  506. package/dist/domains/chrome-caps/useHoverTracking.js +1 -2
  507. package/dist/domains/ingestion/contentHandlers.js +1 -2
  508. package/dist/domains/ingestion/ghost.js +2 -3
  509. package/dist/domains/ingestion/imageHandler.js +1 -2
  510. package/dist/domains/ingestion/kitHandlers.js +2 -3
  511. package/dist/domains/ingestion/openFilePicker.js +1 -2
  512. package/dist/domains/ingestion/placement.js +1 -2
  513. package/dist/domains/ingestion/svgHandler.js +1 -2
  514. package/dist/domains/ingestion/textHandler.js +1 -2
  515. package/dist/domains/ingestion/useCanvasIngestion.js +1 -2
  516. package/dist/domains/ingestion/weaselJsonHandler.js +2 -3
  517. package/dist/domains/longPress/longPressFeedback.js +1 -2
  518. package/dist/domains/measure/actionIds.js +1 -2
  519. package/dist/domains/measure/measureCommands.js +6 -7
  520. package/dist/domains/measure/measureContribution.js +3 -4
  521. package/dist/domains/measure/measureEdits.js +3 -4
  522. package/dist/domains/measure/measureGestures.js +2 -3
  523. package/dist/domains/measure/measureHit.js +3 -4
  524. package/dist/domains/measure/measureLayer.js +3 -4
  525. package/dist/domains/measure/measurement.js +1 -2
  526. package/dist/domains/measure/measurements.js +1 -2
  527. package/dist/domains/modes/modeLayers.js +1 -2
  528. package/dist/domains/modes/modeTriggers.js +1 -2
  529. package/dist/domains/pathEffects/effectSources.js +2 -3
  530. package/dist/domains/pathEffects/index.js +1 -2
  531. package/dist/domains/pathEffects/readSource.js +3 -4
  532. package/dist/domains/pathEffects/textItems.js +1 -2
  533. package/dist/domains/pathEffects/useEffectSourcesLayer.js +3 -4
  534. package/dist/domains/paths/anchorData.js +1 -2
  535. package/dist/domains/paths/anchorMarkers.js +1 -2
  536. package/dist/domains/paths/editablePath.js +3 -4
  537. package/dist/domains/paths/originProjection.js +1 -2
  538. package/dist/domains/paths/pathEditExtension.js +1 -2
  539. package/dist/domains/paths/pathEditState.js +1 -26
  540. package/dist/domains/paths/pathEditState.js.map +1 -1
  541. package/dist/domains/paths/pathEditingOverlayLayer.js +2 -3
  542. package/dist/domains/paths/pathLayer.js +1 -2
  543. package/dist/domains/paths/pathRepresentation.js +1 -2
  544. package/dist/domains/paths/pathSnap/glyphs.js +1 -2
  545. package/dist/domains/paths/pathSnap/pathSnapSource.js +1 -2
  546. package/dist/domains/paths/pathSnap/sceneIndex.js +1 -2
  547. package/dist/domains/paths/pathSnap/snapGeometry.js +2 -3
  548. package/dist/domains/paths/penPreviewLayer.js +1 -2
  549. package/dist/domains/paths/shapeGenerator.js +1 -2
  550. package/dist/domains/paths/strokeOutline.js +2 -3
  551. package/dist/domains/paths/useAnchorFields.js +1 -2
  552. package/dist/domains/paths/usePathEdit.js +2 -3
  553. package/dist/domains/poseRun/usePoseRun.js +1 -2
  554. package/dist/domains/selection/enteredGroupFrame.js +1 -2
  555. package/dist/domains/selection/enteredGroupScope.js +1 -2
  556. package/dist/domains/selection/enteredOperands.js +1 -2
  557. package/dist/domains/selection/handleCommands.js +2 -3
  558. package/dist/domains/selection/overlay.js +6 -7
  559. package/dist/domains/selection/selectionPose.js +2 -3
  560. package/dist/domains/snap/angle2d.js +1 -2
  561. package/dist/domains/snap/debugCandidates.js +1 -2
  562. package/dist/domains/snap/gather.js +1 -2
  563. package/dist/domains/snap/inputSubspace.js +2 -3
  564. package/dist/domains/snap/lazySession.js +1 -2
  565. package/dist/domains/snap/marks.js +1 -2
  566. package/dist/domains/snap/outcomeStore.js +1 -2
  567. package/dist/domains/snap/pointSnap.js +1 -2
  568. package/dist/domains/snap/probes2d.js +6 -2
  569. package/dist/domains/snap/probes2d.js.map +1 -1
  570. package/dist/domains/snap/readoutDraw.js +1 -2
  571. package/dist/domains/snap/readoutLayer.js +1 -2
  572. package/dist/domains/snap/registry.js +1 -2
  573. package/dist/domains/snap/resizeBox.js +1 -2
  574. package/dist/domains/snap/roles.js +1 -2
  575. package/dist/domains/snap/rotationSource.js +1 -2
  576. package/dist/domains/snap/sceneReads.js +13 -4
  577. package/dist/domains/snap/sceneReads.js.map +1 -1
  578. package/dist/domains/snap/sceneSession2d.js +6 -5
  579. package/dist/domains/snap/sceneSession2d.js.map +1 -1
  580. package/dist/domains/snap/screen.js +2 -3
  581. package/dist/domains/snap/session2d.js +4 -5
  582. package/dist/domains/snap/spanSnap.js +1 -2
  583. package/dist/domains/snap/stepAngles.js +1 -2
  584. package/dist/domains/text/editingDrawOne.js +1 -2
  585. package/dist/domains/text/hostTextEditors.js +1 -2
  586. package/dist/domains/text/index.js +2 -2
  587. package/dist/domains/text/sceneTextDrafts.js +1 -2
  588. package/dist/domains/text/textHitAt.js +4 -5
  589. package/dist/domains/text/textLayer.js +12 -2
  590. package/dist/domains/text/textLayer.js.map +1 -1
  591. package/dist/domains/text/useSceneTextEdit.js +4 -5
  592. package/dist/domains/viewports/aim.js +3 -4
  593. package/dist/domains/viewports/viewMarker.js +1 -2
  594. package/dist/domains/viewports/viewMarkerDrag.js +1 -2
  595. package/dist/domains/viewports/viewResolver.js +1 -2
  596. package/dist/domains/viewports/viewportLayer.js +1 -2
  597. package/dist/iconRegistry/IconRegistryProvider.js +1 -2
  598. package/dist/iconRegistry/useIconGlyph.js +1 -2
  599. package/dist/iconRegistry/useIconVariant.js +1 -2
  600. package/dist/icons.table.js +2 -3
  601. package/dist/icons.table.js.map +1 -1
  602. package/dist/icons.table.json +5 -0
  603. package/dist/icons2.table.js +1 -2
  604. package/dist/index.d.ts +160 -64
  605. package/dist/index.js +14 -9
  606. package/dist/input/keyState.js +1 -2
  607. package/dist/input/useKeyModifiers.js +1 -2
  608. package/dist/input/useKeyState.js +1 -2
  609. package/dist/interactions/actions/admitsChild.js +1 -2
  610. package/dist/interactions/actions/align/action.js +6 -7
  611. package/dist/interactions/actions/align/align.js +6 -7
  612. package/dist/interactions/actions/booleans/action.js +5 -4
  613. package/dist/interactions/actions/booleans/action.js.map +1 -1
  614. package/dist/interactions/actions/booleans/booleanGroupAction.js +2 -3
  615. package/dist/interactions/actions/booleans/booleans.js +1 -2
  616. package/dist/interactions/actions/booleans/commit.js +4 -5
  617. package/dist/interactions/actions/booleans/custom.js +2 -3
  618. package/dist/interactions/actions/booleans/keymap.js +1 -2
  619. package/dist/interactions/actions/booleans/operands.js +1 -2
  620. package/dist/interactions/actions/booleans/pieces.js +1 -2
  621. package/dist/interactions/actions/booleans/placement.js +1 -2
  622. package/dist/interactions/actions/booleans/useBooleans.js +1 -2
  623. package/dist/interactions/actions/booleans/useBooleansAdapter.js +1 -2
  624. package/dist/interactions/actions/clipboard/action.js +2 -3
  625. package/dist/interactions/actions/clipboard/clipboardOps.js +2 -3
  626. package/dist/interactions/actions/clipboard/materializePaste.js +1 -2
  627. package/dist/interactions/actions/clipboard/wireFormat.js +1 -2
  628. package/dist/interactions/actions/clone/action.js +7 -8
  629. package/dist/interactions/actions/clone/behaviors.js +4 -5
  630. package/dist/interactions/actions/defaultCommitAdapter.js +2 -3
  631. package/dist/interactions/actions/defaults/anchorEditing.js +6 -10
  632. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  633. package/dist/interactions/actions/defaults/anchorFields.js +1 -2
  634. package/dist/interactions/actions/defaults/anchorHandles.js +2 -3
  635. package/dist/interactions/actions/defaults/anchorJoin.js +2 -3
  636. package/dist/interactions/actions/defaults/areaSelect.js +6 -6
  637. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
  638. package/dist/interactions/actions/defaults/bendSegment.js +4 -6
  639. package/dist/interactions/actions/defaults/bendSegment.js.map +1 -1
  640. package/dist/interactions/actions/defaults/cancelGesture.js +1 -2
  641. package/dist/interactions/actions/defaults/clearSelection.js +1 -2
  642. package/dist/interactions/actions/defaults/containerScroll.js +4 -5
  643. package/dist/interactions/actions/defaults/contextMenu.js +6 -7
  644. package/dist/interactions/actions/defaults/copySubtree.js +2 -3
  645. package/dist/interactions/actions/defaults/createPaintAction.js +3 -4
  646. package/dist/interactions/actions/defaults/delete.js +2 -3
  647. package/dist/interactions/actions/defaults/duplicate.js +5 -6
  648. package/dist/interactions/actions/defaults/enterGroup.js +2 -3
  649. package/dist/interactions/actions/defaults/enterPathEdit.js +1 -2
  650. package/dist/interactions/actions/defaults/enterTextEdit.js +1 -2
  651. package/dist/interactions/actions/defaults/escape.js +1 -2
  652. package/dist/interactions/actions/defaults/exitPathEdit.js +18 -3
  653. package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -1
  654. package/dist/interactions/actions/defaults/group.js +6 -7
  655. package/dist/interactions/actions/defaults/ingest.js +3 -4
  656. package/dist/interactions/actions/defaults/insertPathAnchor.js +2 -3
  657. package/dist/interactions/actions/defaults/nudge.js +3 -4
  658. package/dist/interactions/actions/defaults/nudgeSteps.js +2 -3
  659. package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
  660. package/dist/interactions/actions/defaults/pathEditMarks.js +1 -2
  661. package/dist/interactions/actions/defaults/pinchZoom.js +3 -4
  662. package/dist/interactions/actions/defaults/reorder.js +2 -3
  663. package/dist/interactions/actions/defaults/requiresSelection.js +1 -2
  664. package/dist/interactions/actions/defaults/segmentUnder.js +1 -2
  665. package/dist/interactions/actions/defaults/selectAll.js +1 -2
  666. package/dist/interactions/actions/defaults/selectDeep.js +1 -2
  667. package/dist/interactions/actions/defaults/setFill.js +1 -2
  668. package/dist/interactions/actions/defaults/setFillOpacity.js +1 -2
  669. package/dist/interactions/actions/defaults/setStroke.js +1 -2
  670. package/dist/interactions/actions/defaults/setStrokeOpacity.js +1 -2
  671. package/dist/interactions/actions/defaults/slice.js +1 -2
  672. package/dist/interactions/actions/defaults/sliceOps.js +1 -2
  673. package/dist/interactions/actions/defaults/toolActivate.js +1 -2
  674. package/dist/interactions/actions/defaults/toolResetToDefault.js +1 -2
  675. package/dist/interactions/actions/defaults/undoRedo.js +1 -2
  676. package/dist/interactions/actions/defaults/viewportDragPan.js +1 -2
  677. package/dist/interactions/actions/defaults/viewportWheelPan.js +1 -2
  678. package/dist/interactions/actions/defaults/viewportZoom.js +3 -4
  679. package/dist/interactions/actions/distribute/action.js +4 -5
  680. package/dist/interactions/actions/distribute/distribute.js +5 -6
  681. package/dist/interactions/actions/distribute/plan.js +1 -2
  682. package/dist/interactions/actions/drawnBoxes.js +4 -5
  683. package/dist/interactions/actions/dropVerdict.js +1 -2
  684. package/dist/interactions/actions/edit-anchors/action.js +7 -9
  685. package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
  686. package/dist/interactions/actions/edit-anchors/extensionDrags.js +1 -2
  687. package/dist/interactions/actions/edit-anchors/geometry.js +1 -2
  688. package/dist/interactions/actions/edit-anchors/handleDrag.js +1 -2
  689. package/dist/interactions/actions/edit-anchors/handles.js +1 -2
  690. package/dist/interactions/actions/edit-anchors/params.js +1 -2
  691. package/dist/interactions/actions/edit-anchors/preview.js +1 -2
  692. package/dist/interactions/actions/edit-anchors/symmetry.js +1 -2
  693. package/dist/interactions/actions/flip/action.js +8 -9
  694. package/dist/interactions/actions/flip/helpers.js +1 -2
  695. package/dist/interactions/actions/geometryProjection.js +1 -2
  696. package/dist/interactions/actions/gestureFrames.js +3 -4
  697. package/dist/interactions/actions/gestureLifecycle.js +1 -2
  698. package/dist/interactions/actions/hitSelection.js +7 -3
  699. package/dist/interactions/actions/hitSelection.js.map +1 -1
  700. package/dist/interactions/actions/insert/action.js +27 -9
  701. package/dist/interactions/actions/insert/action.js.map +1 -1
  702. package/dist/interactions/actions/insert/commit.js +2 -3
  703. package/dist/interactions/actions/insert/extras.js +1 -2
  704. package/dist/interactions/actions/insert/frame.js +1 -2
  705. package/dist/interactions/actions/insert/geometry.js +1 -2
  706. package/dist/interactions/actions/insert/params.js +42 -0
  707. package/dist/interactions/actions/insert/params.js.map +1 -0
  708. package/dist/interactions/actions/insert/parent.js +1 -2
  709. package/dist/interactions/actions/insert/placeAction.js +5 -6
  710. package/dist/interactions/actions/insert/repositionAction.js +1 -2
  711. package/dist/interactions/actions/insert/rotateAction.js +1 -2
  712. package/dist/interactions/actions/insert/session.js +5 -6
  713. package/dist/interactions/actions/insert/shape.js +2 -3
  714. package/dist/interactions/actions/lasso-select/action.js +9 -9
  715. package/dist/interactions/actions/lasso-select/action.js.map +1 -1
  716. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +2 -3
  717. package/dist/interactions/actions/magnification.js +37 -0
  718. package/dist/interactions/actions/magnification.js.map +1 -0
  719. package/dist/interactions/actions/move/action.js +2 -3
  720. package/dist/interactions/actions/move/behaviors/layoutDrop.js +2 -3
  721. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +2 -3
  722. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +1 -2
  723. package/dist/interactions/actions/move/behaviors/snapToContainer.js +2 -3
  724. package/dist/interactions/actions/move/capture.js +6 -7
  725. package/dist/interactions/actions/move/commit/index.js +2 -3
  726. package/dist/interactions/actions/move/commit/layoutDrop.js +4 -5
  727. package/dist/interactions/actions/move/commit/layoutRelease.js +7 -8
  728. package/dist/interactions/actions/move/commit/rebase.js +2 -3
  729. package/dist/interactions/actions/move/commit/reparent.js +5 -6
  730. package/dist/interactions/actions/move/delta.js +2 -3
  731. package/dist/interactions/actions/move/frame.js +2 -3
  732. package/dist/interactions/actions/move/gestureAdapter.js +1 -2
  733. package/dist/interactions/actions/move/landedDescendants.js +2 -3
  734. package/dist/interactions/actions/move/layout/container.js +3 -4
  735. package/dist/interactions/actions/move/layout/dragged.js +2 -3
  736. package/dist/interactions/actions/move/layout/dropPass.js +5 -6
  737. package/dist/interactions/actions/move/layout/exits.js +2 -3
  738. package/dist/interactions/actions/move/layout/glide.js +2 -3
  739. package/dist/interactions/actions/move/layout/view.js +1 -2
  740. package/dist/interactions/actions/move/refusal.js +2 -3
  741. package/dist/interactions/actions/move/session.js +4 -5
  742. package/dist/interactions/actions/move/translate.js +2 -3
  743. package/dist/interactions/actions/moveNodes.js +5 -6
  744. package/dist/interactions/actions/notices.js +16 -0
  745. package/dist/interactions/actions/notices.js.map +1 -0
  746. package/dist/interactions/actions/outlines/createOutlines.js +9 -8
  747. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  748. package/dist/interactions/actions/outlines/createOutlinesAction.js +14 -10
  749. package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -1
  750. package/dist/interactions/actions/outlines/outlineStroke.js +2 -3
  751. package/dist/interactions/actions/outlines/outlineStrokeAction.js +5 -5
  752. package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -1
  753. package/dist/interactions/actions/outlines/replaceWithPaths.js +5 -6
  754. package/dist/interactions/actions/outlines/strokeRegion.js +1 -2
  755. package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +1 -2
  756. package/dist/interactions/actions/pathCommands/cutJoin.js +3 -4
  757. package/dist/interactions/actions/pathCommands/livePathEdit.js +3 -4
  758. package/dist/interactions/actions/pathCommands/pathNodes.js +2 -3
  759. package/dist/interactions/actions/pathCommands/simplifyOffset.js +2 -3
  760. package/dist/interactions/actions/pathGestureTags.js +1 -2
  761. package/dist/interactions/actions/planeInput.js +2 -3
  762. package/dist/interactions/actions/pointerState.js +1 -2
  763. package/dist/interactions/actions/poseDescriptorDep.js +1 -2
  764. package/dist/interactions/actions/poseFrame.js +3 -4
  765. package/dist/interactions/actions/resize/action.js +3 -4
  766. package/dist/interactions/actions/resize/aspect.js +1 -2
  767. package/dist/interactions/actions/resize/behaviors/clampMinSize.js +1 -2
  768. package/dist/interactions/actions/resize/boxFrame.js +1 -2
  769. package/dist/interactions/actions/resize/capture.js +7 -8
  770. package/dist/interactions/actions/resize/commit.js +3 -4
  771. package/dist/interactions/actions/resize/cornerHandles.js +1 -2
  772. package/dist/interactions/actions/resize/frame.js +7 -8
  773. package/dist/interactions/actions/resize/held.js +2 -3
  774. package/dist/interactions/actions/resize/minimum.js +1 -2
  775. package/dist/interactions/actions/resize/replay.js +1 -2
  776. package/dist/interactions/actions/resize/ruleBounds.js +1 -2
  777. package/dist/interactions/actions/resize/session.js +9 -10
  778. package/dist/interactions/actions/resolveOverlays.js +1 -2
  779. package/dist/interactions/actions/resolvePreviews.js +3 -4
  780. package/dist/interactions/actions/rotate/action.js +5 -6
  781. package/dist/interactions/actions/rotate/commit.js +2 -3
  782. package/dist/interactions/actions/rotate/frame.js +3 -4
  783. package/dist/interactions/actions/rotate/geometry.js +1 -2
  784. package/dist/interactions/actions/rotate/handle.js +2 -3
  785. package/dist/interactions/actions/rotate/replay.js +2 -3
  786. package/dist/interactions/actions/rotate/session.js +10 -11
  787. package/dist/interactions/actions/selectionSubtree.js +7 -22
  788. package/dist/interactions/actions/selectionSubtree.js.map +1 -1
  789. package/dist/interactions/actions/spatialReference.js +1 -2
  790. package/dist/interactions/actions/testUtils.js +1 -9
  791. package/dist/interactions/actions/testUtils.js.map +1 -1
  792. package/dist/interactions/actions/transform-again/action.js +5 -6
  793. package/dist/interactions/actions/transform-again/memory.js +1 -2
  794. package/dist/interactions/actions/transformFinish.js +1 -2
  795. package/dist/interactions/actions/useActionSet.js +1 -2
  796. package/dist/interactions/actions/useNotices.js +12 -0
  797. package/dist/interactions/actions/useNotices.js.map +1 -0
  798. package/dist/interactions/actions/useStandardActions.js +1 -2
  799. package/dist/interactions/gestures/dragGesture/dragGesture.js +1 -2
  800. package/dist/interactions/gestures/dragGesture/dragPointOf.js +1 -2
  801. package/dist/interactions/gestures/dragRadial/dragRadial.js +2 -3
  802. package/dist/interactions/gestures/dragRect/dragRect.js +2 -3
  803. package/dist/interactions/gestures/handleDrag/handleDrag.js +1 -2
  804. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +1 -2
  805. package/dist/interactions/gestures/shared/originProjection.js +1 -2
  806. package/dist/interactions/gestures/shared/screenTolerance.js +1 -2
  807. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +1 -2
  808. package/dist/kitSettingsSchema.js +4 -5
  809. package/dist/test-hook/createTestHook.js +1 -2
  810. package/dist/test-hook/install.js +1 -2
  811. package/dist/test-hook/useTestHook.js +1 -2
  812. package/dist/test-seams.d.ts +7 -14
  813. package/dist/test-seams.js +2 -2
  814. package/dist/tools/builtin/anchors/anchorsTool.js +30 -0
  815. package/dist/tools/builtin/anchors/anchorsTool.js.map +1 -0
  816. package/dist/tools/builtin/ellipse/useEllipseTool.js +2 -3
  817. package/dist/tools/builtin/eyedropper/useEyedropperTool.js +1 -2
  818. package/dist/tools/builtin/hand/dragPanContribution.js +1 -2
  819. package/dist/tools/builtin/hand/useHandTool.js +1 -2
  820. package/dist/tools/builtin/image/useImageTool.js +1 -2
  821. package/dist/tools/builtin/lasso/useLassoTool.js +1 -2
  822. package/dist/tools/builtin/line/useLineTool.js +2 -3
  823. package/dist/tools/builtin/measure/useMeasureTool.js +2 -3
  824. package/dist/tools/builtin/pen/penHandle.js +1 -2
  825. package/dist/tools/builtin/pen/usePenTool.js +6 -7
  826. package/dist/tools/builtin/pencil/usePencilTool.js +1 -2
  827. package/dist/tools/builtin/pickTopMostHit.js +1 -2
  828. package/dist/tools/builtin/polygon/usePolygonTool.js +2 -3
  829. package/dist/tools/builtin/pressTarget.js +1 -2
  830. package/dist/tools/builtin/rect/useRectTool.js +2 -3
  831. package/dist/tools/builtin/select/adapterPointQuery.js +3 -4
  832. package/dist/tools/builtin/select/collapseDeferred.js +1 -2
  833. package/dist/tools/builtin/select/groupEntry.js +2 -3
  834. package/dist/tools/builtin/select/pressDecision.js +3 -4
  835. package/dist/tools/builtin/select/pressDecision.js.map +1 -1
  836. package/dist/tools/builtin/select/selectionContributions.js +1 -2
  837. package/dist/tools/builtin/select/useSelectTool.js +5 -6
  838. package/dist/tools/builtin/shared/insertToolOptions.js +1 -2
  839. package/dist/tools/builtin/shared/pointerFollower.js +1 -2
  840. package/dist/tools/builtin/slice/useSliceTool.js +5 -6
  841. package/dist/tools/builtin/star/useStarTool.js +2 -3
  842. package/dist/tools/builtin/sticky/stickyNode.js +1 -2
  843. package/dist/tools/builtin/sticky/useStickyTool.js +2 -3
  844. package/dist/tools/builtin/text/useTextTool.js +1 -2
  845. package/dist/tools/index.js +4 -2
  846. package/dist/tools/overlayBinding.js +1 -2
  847. package/dist/tools/toolOptions.js +60 -0
  848. package/dist/tools/toolOptions.js.map +1 -0
  849. package/dist/tools/useKeybindings.js +1 -2
  850. package/dist/{types-DW14eu9B.d.ts → types-BUvUXZe5.d.ts} +3 -3
  851. package/dist/util/color.js +1 -2
  852. package/dist/util/paint.js +1 -2
  853. package/dist/version.js +2 -3
  854. package/package.json +27 -27
  855. package/dist/interactions/actions/defaults/pathEditTools.js +0 -60
  856. package/dist/interactions/actions/defaults/pathEditTools.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { rectToPlane, toPlane } from "../../core/viewport/parallax.js";
2
1
  import { poseDescriptorForNode, visualBoundsViaDescriptor } from "../../core/geometry/poseDescriptor.js";
3
2
  import { AUTO_POSE_DESCRIPTOR } from "../../core/geometry/autoPoseDescriptor.js";
3
+ import { pickWalk } from "../pickWalk.js";
4
+ import { rectToPlane, toPlane } from "../../core/viewport/parallax.js";
4
5
  import { findShapeInk, findShapeSilhouette } from "../NodeShape.js";
5
- import { polygonRegion, poseOutline, rectRegion, regionBoundsOf, regionOf, regionTakes } from "../../core/geometry/regionHit.js";
6
6
  import { scenePickSource } from "../scenePickSource.js";
7
- import { pickWalk } from "../pickWalk.js";
7
+ import { polygonRegion, poseOutline, rectRegion, regionBoundsOf, regionOf, regionTakes, regionTakesByBounds } from "../../core/geometry/regionHit.js";
8
8
  import { applyToPoint, boundsOfPath, pathIntersectsRect } from "@weasel-js/geom";
9
9
 
10
- //#region src/canvas/deps/hitTestArea.ts
10
+ // src/canvas/deps/hitTestArea.ts
11
11
  /** The pick options a region dep hands the shared walk: the asking view's
12
12
  * layer gate and camera, and the surface's alpha. */
13
13
  function regionPickOptions(view, alphaOf) {
@@ -60,6 +60,8 @@ function regionPickQuery(r, mode, descriptor, query) {
60
60
  hits: (node, pose, derived, inherited) => {
61
61
  const g = poseDescriptorForNode(descriptor, node);
62
62
  const b = derived ? boundsOfPath(derived) : regionBoundsOf(node, pose, g);
63
+ const decided = regionTakesByBounds(r, mode, b);
64
+ if (decided !== void 0) return decided;
63
65
  let ink;
64
66
  const filled = () => ink ??= findShapeInk(node, pose, { inherited })?.filled !== false;
65
67
  return regionTakes(r, mode, asInked(filled, pose), b, () => asInked(filled, findShapeSilhouette(node, pose, { derivedPath: derived }) ?? derived ?? poseOutline(pose, b)), filled);
@@ -103,6 +105,5 @@ function regionInCopy(r, m) {
103
105
  }, r.isRect && keepsAxes);
104
106
  }
105
107
 
106
- //#endregion
107
108
  export { hitTestArea, hitTestLassoPolygon, regionPickOptions, regionPickQuery };
108
109
  //# sourceMappingURL=hitTestArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hitTestArea.js","names":[],"sources":["../../../src/canvas/deps/hitTestArea.ts"],"sourcesContent":["/**\n * Silhouette-aware area hit-test for marquee and lasso selection.\n *\n * The per-node decision is `regionTakes` (`core/geometry/regionHit`). This\n * module supplies the scene walk and the node's drawn outline: the painter's\n * world-frame silhouette (`findShapeSilhouette`), or with no painter the pose\n * rect, rotated if the pose is.\n */\nimport type { Scene, NodeId } from 'core/scene/types';\nimport { applyToPoint, boundsOfPath, pathIntersectsRect, type Affine } from '@weasel-js/geom';\nimport type { LassoHitMode } from 'core/adapters/types';\nimport {\n poseDescriptorForNode,\n visualBoundsViaDescriptor,\n type PoseDescriptor,\n} from 'interactions/actions/resize/geometry';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport {\n pickWalk,\n scenePickSource,\n type PickQuery,\n type ScenePickSourceOptions,\n} from 'canvas/pickWalk';\nimport { rectToPlane, toPlane, type PlaneMap } from 'core/viewport/parallax';\n\nimport type { HitTestView } from 'interactions/actions/depSchema';\nimport { findShapeInk, findShapeSilhouette } from 'canvas/NodeShape';\nimport {\n polygonRegion,\n poseOutline,\n rectRegion,\n regionBoundsOf,\n regionOf,\n regionTakes,\n type SelectRegion,\n} from 'core/geometry/regionHit';\n\nexport interface AABBBounds {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** What a region query takes back beyond leaves. */\nexport interface RegionQueryOptions {\n /** Default `false`: a region that takes a group and its members\n * selects the same ink twice. A bare-adapter consumer, which has nothing\n * to fold members back into their group, asks for them. */\n includeGroups?: boolean;\n}\n\n\n/** The pick options a region dep hands the shared walk: the asking view's\n * layer gate and camera, and the surface's alpha. */\nexport function regionPickOptions(\n view: HitTestView | undefined,\n alphaOf: ((id: string) => number) | undefined,\n): ScenePickSourceOptions<unknown> {\n const camera = view?.get?.();\n return {\n ...(alphaOf ? { alphaOf } : {}),\n ...(view?.layerIsPainted ? { layerIsPainted: (layer: string) => view.layerIsPainted!(layer) } : {}),\n ...(camera ? { camera } : {}),\n };\n}\n\n/** Marquee entry point: every node the rect `bounds` meets. */\nexport function hitTestArea(\n scene: Scene<unknown, string, unknown>,\n bounds: AABBBounds,\n opts?: ScenePickSourceOptions<unknown>,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n return walkArea(scene, rectRegion(bounds), 'intersect', opts, descriptor, query);\n}\n\n/**\n * Every node an arbitrary closed area polygon meets. `area` is interleaved\n * `[x0,y0,x1,y1,…]`; `areaBounds` is its AABB, derived when omitted.\n */\nexport function hitTestAreaPolygon(\n scene: Scene<unknown, string, unknown>,\n area: ArrayLike<number>,\n areaBounds?: AABBBounds,\n /** True when `area` IS its own bounding rect, so `areaBounds` containment\n * implies containment in the area proper. Never pass this for a lasso\n * polygon — a node inside the hull's box can miss the hull. */\n areaIsRect = false,\n /** The asking view's alpha and layer accessors. A bare scene answers for\n * itself; a view that dims or reorders layers has to supply its own. */\n opts?: ScenePickSourceOptions<unknown>,\n /** How to read this scene's poses. Default `AUTO_POSE_DESCRIPTOR`. */\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n const region = regionOf(area, areaBounds, areaIsRect);\n return region ? walkArea(scene, region, 'intersect', opts, descriptor, query) : [];\n}\n\n/**\n * Lasso entry point: which nodes a closed lasso polygon picks under `mode`\n * (see `regionTakes`).\n */\nexport function hitTestLassoPolygon(\n scene: Scene<unknown, string, unknown>,\n polygon: ReadonlyArray<{ x: number; y: number }>,\n mode: LassoHitMode,\n opts?: ScenePickSourceOptions<unknown>,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n const region = polygonRegion(polygon);\n return region ? walkArea(scene, region, mode, opts, descriptor, query) : [];\n}\n\n/** `shape` as a region reads it: a polygon path's open subpaths enclose\n * nothing when the node's painter lays down no fill. */\nfunction asInked<T>(filled: () => boolean, shape: T): T {\n if ((shape as { kind?: unknown } | null)?.kind !== 'polygon') return shape;\n return filled() ? shape : { ...shape, openFill: 'none' };\n}\n\n/** The walk every region query shares: skip groups unless asked, gate on\n * the clip, and let `regionTakes` decide each node. */\nfunction walkArea(\n scene: Scene<unknown, string, unknown>,\n region: SelectRegion,\n mode: LassoHitMode,\n opts: ScenePickSourceOptions<unknown> | undefined,\n descriptor: PoseDescriptor<unknown>,\n query: RegionQueryOptions,\n): NodeId[] {\n const src = scenePickSource(scene, { ...opts, index: { descriptor } });\n return pickWalk<unknown>(src, regionPickQuery(region, mode, descriptor, query)) as NodeId[];\n}\n\n/** The query a marquee or a lasso over `r` asks of each node. */\nexport function regionPickQuery(\n r: SelectRegion,\n mode: LassoHitMode,\n descriptor: PoseDescriptor<unknown>,\n query: RegionQueryOptions,\n): PickQuery<unknown> {\n return {\n includeGroups: query.includeGroups === true,\n broad: { box: r.bounds },\n clipAdmits: (clip, node, pose, derived) => {\n const g = poseDescriptorForNode(descriptor, node);\n return pathIntersectsRect(clip, derived ? boundsOfPath(derived) : visualBoundsViaDescriptor(pose, g))\n && pathIntersectsRect(clip, r.bounds);\n },\n hits: (node, pose, derived, inherited) => {\n // The descriptor sees the node here, so a pose shape whose extent\n // depends on `node.data` bounds itself rather than its pose's default.\n const g = poseDescriptorForNode(descriptor, node);\n // A derived node's pose is a placeholder: its path is the extent and the fallback outline.\n const b = derived ? boundsOfPath(derived) : regionBoundsOf(node as object, pose, g);\n let ink: boolean | undefined;\n const filled = (): boolean => ink ??= findShapeInk(node as never, pose, { inherited })?.filled !== false;\n return regionTakes(r, mode, asInked(filled, pose), b, () =>\n asInked(filled, findShapeSilhouette(node as never, pose, { derivedPath: derived }) ?? derived ?? poseOutline(pose, b)), filled);\n },\n inPlane: (m) => regionPickQuery(regionInPlane(r, m), mode, descriptor, query),\n // A copy is tested by every walk, so the query carried into one asks no index.\n inCopy: (m) => ({ ...regionPickQuery(regionInCopy(r, m), mode, descriptor, query), broad: undefined }),\n };\n}\n\n/** `r` carried into a plane's world. The map is axis-aligned, so a rect stays\n * one; a flipped axis reverses the winding, which no region test reads. */\nfunction regionInPlane(r: SelectRegion, m: PlaneMap): SelectRegion {\n const coords: number[] = [];\n for (const v of r.verts) {\n const p = toPlane(m, v);\n coords.push(p.x, p.y);\n }\n return regionOf(coords, rectToPlane(m, r.bounds), r.isRect)!;\n}\n\n/** `r` carried by an affine into a copy's source frame. A rect stays one only\n * while the map keeps the axes; a turn makes it a polygon. */\nfunction regionInCopy(r: SelectRegion, m: Affine): SelectRegion {\n const coords: number[] = [];\n let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;\n for (const v of r.verts) {\n const [x, y] = applyToPoint(m, v.x, v.y);\n coords.push(x, y);\n x0 = Math.min(x0, x); y0 = Math.min(y0, y); x1 = Math.max(x1, x); y1 = Math.max(y1, y);\n }\n const keepsAxes = (m[1] === 0 && m[2] === 0) || (m[0] === 0 && m[3] === 0);\n return regionOf(coords, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 }, r.isRect && keepsAxes)!;\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"hitTestArea.js","names":[],"sources":["../../../src/canvas/deps/hitTestArea.ts"],"sourcesContent":["/**\n * Silhouette-aware area hit-test for marquee and lasso selection.\n *\n * The per-node decision is `regionTakes` (`core/geometry/regionHit`). This\n * module supplies the scene walk and the node's drawn outline: the painter's\n * world-frame silhouette (`findShapeSilhouette`), or with no painter the pose\n * rect, rotated if the pose is.\n */\nimport type { Scene, NodeId } from 'core/scene/types';\nimport { applyToPoint, boundsOfPath, pathIntersectsRect, type Affine } from '@weasel-js/geom';\nimport type { LassoHitMode } from 'core/adapters/types';\nimport {\n poseDescriptorForNode,\n visualBoundsViaDescriptor,\n type PoseDescriptor,\n} from 'interactions/actions/resize/geometry';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport {\n pickWalk,\n scenePickSource,\n type PickQuery,\n type ScenePickSourceOptions,\n} from 'canvas/pickWalk';\nimport { rectToPlane, toPlane, type PlaneMap } from 'core/viewport/parallax';\n\nimport type { HitTestView } from 'interactions/actions/depSchema';\nimport { findShapeInk, findShapeSilhouette } from 'canvas/NodeShape';\nimport {\n polygonRegion,\n poseOutline,\n rectRegion,\n regionBoundsOf,\n regionOf,\n regionTakes,\n regionTakesByBounds,\n type SelectRegion,\n} from 'core/geometry/regionHit';\n\nexport interface AABBBounds {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** What a region query takes back beyond leaves. */\nexport interface RegionQueryOptions {\n /** Default `false`: a region that takes a group and its members\n * selects the same ink twice. A bare-adapter consumer, which has nothing\n * to fold members back into their group, asks for them. */\n includeGroups?: boolean;\n}\n\n\n/** The pick options a region dep hands the shared walk: the asking view's\n * layer gate and camera, and the surface's alpha. */\nexport function regionPickOptions(\n view: HitTestView | undefined,\n alphaOf: ((id: string) => number) | undefined,\n): ScenePickSourceOptions<unknown> {\n const camera = view?.get?.();\n return {\n ...(alphaOf ? { alphaOf } : {}),\n ...(view?.layerIsPainted ? { layerIsPainted: (layer: string) => view.layerIsPainted!(layer) } : {}),\n ...(camera ? { camera } : {}),\n };\n}\n\n/** Marquee entry point: every node the rect `bounds` meets. */\nexport function hitTestArea(\n scene: Scene<unknown, string, unknown>,\n bounds: AABBBounds,\n opts?: ScenePickSourceOptions<unknown>,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n return walkArea(scene, rectRegion(bounds), 'intersect', opts, descriptor, query);\n}\n\n/**\n * Every node an arbitrary closed area polygon meets. `area` is interleaved\n * `[x0,y0,x1,y1,…]`; `areaBounds` is its AABB, derived when omitted.\n */\nexport function hitTestAreaPolygon(\n scene: Scene<unknown, string, unknown>,\n area: ArrayLike<number>,\n areaBounds?: AABBBounds,\n /** True when `area` IS its own bounding rect, so `areaBounds` containment\n * implies containment in the area proper. Never pass this for a lasso\n * polygon — a node inside the hull's box can miss the hull. */\n areaIsRect = false,\n /** The asking view's alpha and layer accessors. A bare scene answers for\n * itself; a view that dims or reorders layers has to supply its own. */\n opts?: ScenePickSourceOptions<unknown>,\n /** How to read this scene's poses. Default `AUTO_POSE_DESCRIPTOR`. */\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n const region = regionOf(area, areaBounds, areaIsRect);\n return region ? walkArea(scene, region, 'intersect', opts, descriptor, query) : [];\n}\n\n/**\n * Lasso entry point: which nodes a closed lasso polygon picks under `mode`\n * (see `regionTakes`).\n */\nexport function hitTestLassoPolygon(\n scene: Scene<unknown, string, unknown>,\n polygon: ReadonlyArray<{ x: number; y: number }>,\n mode: LassoHitMode,\n opts?: ScenePickSourceOptions<unknown>,\n descriptor: PoseDescriptor<unknown> = AUTO_POSE_DESCRIPTOR,\n query: RegionQueryOptions = {},\n): NodeId[] {\n const region = polygonRegion(polygon);\n return region ? walkArea(scene, region, mode, opts, descriptor, query) : [];\n}\n\n/** `shape` as a region reads it: a polygon path's open subpaths enclose\n * nothing when the node's painter lays down no fill. */\nfunction asInked<T>(filled: () => boolean, shape: T): T {\n if ((shape as { kind?: unknown } | null)?.kind !== 'polygon') return shape;\n return filled() ? shape : { ...shape, openFill: 'none' };\n}\n\n/** The walk every region query shares: skip groups unless asked, gate on\n * the clip, and let `regionTakes` decide each node. */\nfunction walkArea(\n scene: Scene<unknown, string, unknown>,\n region: SelectRegion,\n mode: LassoHitMode,\n opts: ScenePickSourceOptions<unknown> | undefined,\n descriptor: PoseDescriptor<unknown>,\n query: RegionQueryOptions,\n): NodeId[] {\n const src = scenePickSource(scene, { ...opts, index: { descriptor } });\n return pickWalk<unknown>(src, regionPickQuery(region, mode, descriptor, query)) as NodeId[];\n}\n\n/** The query a marquee or a lasso over `r` asks of each node. */\nexport function regionPickQuery(\n r: SelectRegion,\n mode: LassoHitMode,\n descriptor: PoseDescriptor<unknown>,\n query: RegionQueryOptions,\n): PickQuery<unknown> {\n return {\n includeGroups: query.includeGroups === true,\n broad: { box: r.bounds },\n clipAdmits: (clip, node, pose, derived) => {\n const g = poseDescriptorForNode(descriptor, node);\n return pathIntersectsRect(clip, derived ? boundsOfPath(derived) : visualBoundsViaDescriptor(pose, g))\n && pathIntersectsRect(clip, r.bounds);\n },\n hits: (node, pose, derived, inherited) => {\n // The descriptor sees the node here, so a pose shape whose extent\n // depends on `node.data` bounds itself rather than its pose's default.\n const g = poseDescriptorForNode(descriptor, node);\n // A derived node's pose is a placeholder: its path is the extent and the fallback outline.\n const b = derived ? boundsOfPath(derived) : regionBoundsOf(node as object, pose, g);\n const decided = regionTakesByBounds(r, mode, b);\n if (decided !== undefined) return decided;\n let ink: boolean | undefined;\n const filled = (): boolean => ink ??= findShapeInk(node as never, pose, { inherited })?.filled !== false;\n return regionTakes(r, mode, asInked(filled, pose), b, () =>\n asInked(filled, findShapeSilhouette(node as never, pose, { derivedPath: derived }) ?? derived ?? poseOutline(pose, b)), filled);\n },\n inPlane: (m) => regionPickQuery(regionInPlane(r, m), mode, descriptor, query),\n // A copy is tested by every walk, so the query carried into one asks no index.\n inCopy: (m) => ({ ...regionPickQuery(regionInCopy(r, m), mode, descriptor, query), broad: undefined }),\n };\n}\n\n/** `r` carried into a plane's world. The map is axis-aligned, so a rect stays\n * one; a flipped axis reverses the winding, which no region test reads. */\nfunction regionInPlane(r: SelectRegion, m: PlaneMap): SelectRegion {\n const coords: number[] = [];\n for (const v of r.verts) {\n const p = toPlane(m, v);\n coords.push(p.x, p.y);\n }\n return regionOf(coords, rectToPlane(m, r.bounds), r.isRect)!;\n}\n\n/** `r` carried by an affine into a copy's source frame. A rect stays one only\n * while the map keeps the axes; a turn makes it a polygon. */\nfunction regionInCopy(r: SelectRegion, m: Affine): SelectRegion {\n const coords: number[] = [];\n let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;\n for (const v of r.verts) {\n const [x, y] = applyToPoint(m, v.x, v.y);\n coords.push(x, y);\n x0 = Math.min(x0, x); y0 = Math.min(y0, y); x1 = Math.max(x1, x); y1 = Math.max(y1, y);\n }\n const keepsAxes = (m[1] === 0 && m[2] === 0) || (m[0] === 0 && m[3] === 0);\n return regionOf(coords, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 }, r.isRect && keepsAxes)!;\n}\n"],"mappings":"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"}
@@ -2,7 +2,7 @@ import { viewportWorldRect } from "../../core/viewport/viewportWorldRect.js";
2
2
  import { useLatest } from "@weasel-js/react";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/ingestion.ts
5
+ // src/canvas/deps/ingestion.ts
6
6
  function useIngestionDepSource(canvasRef, getView, resolveSrc, svg, clipboard, handlers) {
7
7
  const getViewRef = useLatest(getView);
8
8
  const resolveSrcRef = useLatest(resolveSrc);
@@ -35,6 +35,5 @@ function useIngestionDepSource(canvasRef, getView, resolveSrc, svg, clipboard, h
35
35
  }));
36
36
  }
37
37
 
38
- //#endregion
39
38
  export { useIngestionDepSource };
40
39
  //# sourceMappingURL=ingestion.js.map
@@ -1,16 +1,16 @@
1
- import { insertPreviewExtent } from "../insertPreviewExtent.js";
2
1
  import { insertSite } from "./insertSite.js";
3
- import { minSizeOf } from "../../core/scene/minSize.js";
4
2
  import { createInsertOp } from "../../core/ops/create.js";
3
+ import { insertPreviewExtent } from "../insertPreviewExtent.js";
5
4
  import { cycleFill, solid, strokeOf } from "../../util/paint.js";
6
5
  import { stickyData } from "../../tools/builtin/sticky/stickyNode.js";
6
+ import { minSizeOf } from "../../core/scene/minSize.js";
7
7
  import { ellipsePath, linePath, polygonFromPoints, rectPath, regularPolygonPath, schneiderFit, starPath } from "@weasel-js/geom";
8
8
  import { useRef } from "react";
9
9
  import { useLatest } from "@weasel-js/react";
10
10
  import { DEFAULT_TEXT_FILL } from "@weasel-js/text";
11
11
  import { useDepRegistry, useDepSource } from "@weasel-js/routing/react";
12
12
 
13
- //#region src/canvas/deps/insert.ts
13
+ // src/canvas/deps/insert.ts
14
14
  /**
15
15
  * `useInsertDepSource` — wires the `insert` dep consumed by `insertAction`.
16
16
  *
@@ -218,6 +218,5 @@ function useInsertDepSource(scene, adapter, factories, paint = paletteInsertPain
218
218
  });
219
219
  }
220
220
 
221
- //#endregion
222
221
  export { paletteInsertPaint, useInsertDepSource };
223
222
  //# sourceMappingURL=insert.js.map
@@ -1,9 +1,9 @@
1
+ import { insertParent } from "../../interactions/actions/insert/parent.js";
1
2
  import { composeChildFrame, composesFrames } from "../../core/scene/composeFrame.js";
2
- import { definesFrame } from "../../core/scene/effectivePose.js";
3
3
  import { viewPoseAdapter } from "../../core/scene/scrollOffsets.js";
4
- import { insertParent } from "../../interactions/actions/insert/parent.js";
4
+ import { definesFrame } from "../../core/scene/effectivePose.js";
5
5
 
6
- //#region src/canvas/deps/insertSite.ts
6
+ // src/canvas/deps/insertSite.ts
7
7
  /**
8
8
  * Where an insert lands: the container the `insertInto` dep names, on that container's
9
9
  * layer, with the pose made local to it when the scene composes frames —
@@ -36,6 +36,5 @@ function insertSite(sc, into, canDropInto) {
36
36
  };
37
37
  }
38
38
 
39
- //#endregion
40
39
  export { insertSite };
41
40
  //# sourceMappingURL=insertSite.js.map
@@ -1,7 +1,7 @@
1
1
  import { useKitSettings, useLatest } from "@weasel-js/react";
2
2
  import { useDepSource } from "@weasel-js/routing/react";
3
3
 
4
- //#region src/canvas/deps/kitSettings.ts
4
+ // src/canvas/deps/kitSettings.ts
5
5
  /**
6
6
  * Wires the `kitSettings` dep: the store of the nearest `<KitSettingsProvider>`,
7
7
  * resolved at invocation so a provider swapped above the canvas reaches the next action.
@@ -11,6 +11,5 @@ function useKitSettingsDepSource() {
11
11
  useDepSource("kitSettings", () => ref.current);
12
12
  }
13
13
 
14
- //#endregion
15
14
  export { useKitSettingsDepSource };
16
15
  //# sourceMappingURL=kitSettings.js.map
@@ -2,34 +2,36 @@ import { hitTestArea, hitTestLassoPolygon, regionPickOptions } from "./hitTestAr
2
2
  import { useLatest } from "@weasel-js/react";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/lassoSelect.ts
5
+ // src/canvas/deps/lassoSelect.ts
6
6
  /**
7
7
  * `useLassoSelectDepSource` — wires the `lassoSelect` dep consumed by
8
8
  * `lassoSelectAction`: `hitTestLasso` tests the lasso polygon itself, and
9
9
  * `hitTestArea` is the same silhouette-aware rect test `areaSelect` uses.
10
10
  */
11
- function useLassoSelectDepSource(scene, selection, descriptor, alphaOf, reachable) {
11
+ function useLassoSelectDepSource(scene, selection, descriptor, alphaOf, reachable, targetOf) {
12
12
  const sceneRef = useLatest(scene);
13
13
  const selectionRef = useLatest(selection);
14
14
  const descriptorRef = useLatest(descriptor);
15
15
  const alphaOfRef = useLatest(alphaOf);
16
16
  const reachableRef = useLatest(reachable);
17
+ const targetOfRef = useLatest(targetOf);
17
18
  useDepSource("lassoSelect", () => {
18
19
  const sc = sceneRef.current;
19
20
  const s = selectionRef.current;
20
21
  const d = descriptorRef.current;
21
22
  const a = alphaOfRef.current;
22
23
  const r = reachableRef.current;
24
+ const t = targetOfRef.current;
23
25
  const keep = (ids) => r ? ids.filter((id) => r(id)) : ids;
24
26
  return {
25
27
  hitTestLasso: (polygon, mode, view) => keep(hitTestLassoPolygon(sc, polygon, mode, regionPickOptions(view, a), d)),
26
28
  hitTestArea: (bounds, view) => keep(hitTestArea(sc, bounds, regionPickOptions(view, a), d)),
29
+ ...t ? { targetOf: t } : {},
27
30
  getSelection: () => s.current,
28
31
  setSelection: (ids) => s.set(ids)
29
32
  };
30
33
  });
31
34
  }
32
35
 
33
- //#endregion
34
36
  export { useLassoSelectDepSource };
35
37
  //# sourceMappingURL=lassoSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lassoSelect.js","names":["hitTestAreaShared"],"sources":["../../../src/canvas/deps/lassoSelect.ts"],"sourcesContent":["/**\n * `useLassoSelectDepSource` — wires the `lassoSelect` dep consumed by\n * `lassoSelectAction`: `hitTestLasso` tests the lasso polygon itself, and\n * `hitTestArea` is the same silhouette-aware rect test `areaSelect` uses.\n */\nimport { useDepSource } from '@weasel-js/routing/react';\nimport { useLatest } from '@weasel-js/react';\nimport type { LassoSelectDep } from 'interactions/actions/depSchema';\nimport type { Scene, NodeId } from 'core/scene/types';\nimport type { SelectionApi } from 'core/selection/useSelection';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport { hitTestArea as hitTestAreaShared, hitTestLassoPolygon, regionPickOptions } from './hitTestArea';\n\nexport function useLassoSelectDepSource(\n scene: Scene<unknown, string, unknown>,\n selection: SelectionApi,\n descriptor?: PoseDescriptor<unknown>,\n /** The painted alpha the surface's layers apply, which every view shares. */\n alphaOf?: (id: string) => number,\n /** Whether a node can be reached at all: the canvas's one answer, which picking reads too. */\n reachable?: (id: string) => boolean,\n): void {\n const sceneRef = useLatest(scene);\n const selectionRef = useLatest(selection);\n const descriptorRef = useLatest(descriptor);\n const alphaOfRef = useLatest(alphaOf);\n const reachableRef = useLatest(reachable);\n\n useDepSource('lassoSelect', (): LassoSelectDep => {\n const sc = sceneRef.current;\n const s = selectionRef.current;\n const d = descriptorRef.current;\n const a = alphaOfRef.current;\n const r = reachableRef.current;\n const keep = (ids: NodeId[]): NodeId[] => (r ? ids.filter((id) => r(id)) : ids);\n return {\n hitTestLasso: (polygon, mode, view) =>\n keep(hitTestLassoPolygon(sc, polygon, mode, regionPickOptions(view, a), d)),\n hitTestArea: (bounds, view) =>\n keep(hitTestAreaShared(sc, bounds, regionPickOptions(view, a), d)),\n getSelection: () => s.current as NodeId[],\n setSelection: (ids) => s.set(ids as NodeId[]),\n };\n });\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,wBACd,OACA,WACA,YAEA,SAEA,WACM;CACN,MAAM,WAAW,UAAU,KAAK;CAChC,MAAM,eAAe,UAAU,SAAS;CACxC,MAAM,gBAAgB,UAAU,UAAU;CAC1C,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,eAAe,UAAU,SAAS;CAExC,aAAa,qBAAqC;EAChD,MAAM,KAAK,SAAS;EACpB,MAAM,IAAI,aAAa;EACvB,MAAM,IAAI,cAAc;EACxB,MAAM,IAAI,WAAW;EACrB,MAAM,IAAI,aAAa;EACvB,MAAM,QAAQ,QAA6B,IAAI,IAAI,QAAQ,OAAO,EAAE,EAAE,CAAC,IAAI;EAC3E,OAAO;GACL,eAAe,SAAS,MAAM,SAC5B,KAAK,oBAAoB,IAAI,SAAS,MAAM,kBAAkB,MAAM,CAAC,GAAG,CAAC,CAAC;GAC5E,cAAc,QAAQ,SACpB,KAAKA,YAAkB,IAAI,QAAQ,kBAAkB,MAAM,CAAC,GAAG,CAAC,CAAC;GACnE,oBAAoB,EAAE;GACtB,eAAe,QAAQ,EAAE,IAAI,GAAe;EAC9C;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"lassoSelect.js","names":["hitTestAreaShared"],"sources":["../../../src/canvas/deps/lassoSelect.ts"],"sourcesContent":["/**\n * `useLassoSelectDepSource` — wires the `lassoSelect` dep consumed by\n * `lassoSelectAction`: `hitTestLasso` tests the lasso polygon itself, and\n * `hitTestArea` is the same silhouette-aware rect test `areaSelect` uses.\n */\nimport { useDepSource } from '@weasel-js/routing/react';\nimport { useLatest } from '@weasel-js/react';\nimport type { LassoSelectDep } from 'interactions/actions/depSchema';\nimport type { Scene, NodeId } from 'core/scene/types';\nimport type { SelectionApi } from 'core/selection/useSelection';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport { hitTestArea as hitTestAreaShared, hitTestLassoPolygon, regionPickOptions } from './hitTestArea';\n\nexport function useLassoSelectDepSource(\n scene: Scene<unknown, string, unknown>,\n selection: SelectionApi,\n descriptor?: PoseDescriptor<unknown>,\n /** The painted alpha the surface's layers apply, which every view shares. */\n alphaOf?: (id: string) => number,\n /** Whether a node can be reached at all: the canvas's one answer, which picking reads too. */\n reachable?: (id: string) => boolean,\n /** The node selecting a hit selects, as a click picks. */\n targetOf?: (id: string) => string,\n): void {\n const sceneRef = useLatest(scene);\n const selectionRef = useLatest(selection);\n const descriptorRef = useLatest(descriptor);\n const alphaOfRef = useLatest(alphaOf);\n const reachableRef = useLatest(reachable);\n const targetOfRef = useLatest(targetOf);\n\n useDepSource('lassoSelect', (): LassoSelectDep => {\n const sc = sceneRef.current;\n const s = selectionRef.current;\n const d = descriptorRef.current;\n const a = alphaOfRef.current;\n const r = reachableRef.current;\n const t = targetOfRef.current;\n const keep = (ids: NodeId[]): NodeId[] => (r ? ids.filter((id) => r(id)) : ids);\n return {\n hitTestLasso: (polygon, mode, view) =>\n keep(hitTestLassoPolygon(sc, polygon, mode, regionPickOptions(view, a), d)),\n hitTestArea: (bounds, view) =>\n keep(hitTestAreaShared(sc, bounds, regionPickOptions(view, a), d)),\n ...(t ? { targetOf: t } : {}),\n getSelection: () => s.current as NodeId[],\n setSelection: (ids) => s.set(ids as NodeId[]),\n };\n });\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,wBACd,OACA,WACA,YAEA,SAEA,WAEA,UACM;CACN,MAAM,WAAW,UAAU,KAAK;CAChC,MAAM,eAAe,UAAU,SAAS;CACxC,MAAM,gBAAgB,UAAU,UAAU;CAC1C,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,eAAe,UAAU,SAAS;CACxC,MAAM,cAAc,UAAU,QAAQ;CAEtC,aAAa,qBAAqC;EAChD,MAAM,KAAK,SAAS;EACpB,MAAM,IAAI,aAAa;EACvB,MAAM,IAAI,cAAc;EACxB,MAAM,IAAI,WAAW;EACrB,MAAM,IAAI,aAAa;EACvB,MAAM,IAAI,YAAY;EACtB,MAAM,QAAQ,QAA6B,IAAI,IAAI,QAAQ,OAAO,EAAE,EAAE,CAAC,IAAI;EAC3E,OAAO;GACL,eAAe,SAAS,MAAM,SAC5B,KAAK,oBAAoB,IAAI,SAAS,MAAM,kBAAkB,MAAM,CAAC,GAAG,CAAC,CAAC;GAC5E,cAAc,QAAQ,SACpB,KAAKA,YAAkB,IAAI,QAAQ,kBAAkB,MAAM,CAAC,GAAG,CAAC,CAAC;GACnE,GAAI,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;GAC3B,oBAAoB,EAAE;GACtB,eAAe,QAAQ,EAAE,IAAI,GAAe;EAC9C;CACF,CAAC;AACH"}
@@ -3,7 +3,7 @@ import { useEffect } from "react";
3
3
  import { useLatest } from "@weasel-js/react";
4
4
  import { useDepSource } from "@weasel-js/routing/react";
5
5
 
6
- //#region src/canvas/deps/layout.ts
6
+ // src/canvas/deps/layout.ts
7
7
  /**
8
8
  * `useLayoutDepSource` — wires the `layout` dep consumed by `moveAction`'s
9
9
  * drag-time reflow pass. A container's layout is the one its scene node
@@ -35,6 +35,5 @@ function useLayoutDepSource(scene, dropTarget, reflow) {
35
35
  }), [scene, ref]);
36
36
  }
37
37
 
38
- //#endregion
39
38
  export { useLayoutDepSource };
40
39
  //# sourceMappingURL=layout.js.map
@@ -0,0 +1,22 @@
1
+ import { useLatest } from "@weasel-js/react";
2
+ import { useDepSource } from "@weasel-js/routing/react";
3
+ import { defaultToolOf } from "@weasel-js/modes";
4
+
5
+ // src/canvas/deps/modeDefaultTool.ts
6
+ /**
7
+ * Wires the `modeDefaultTool` dep: the tool the canvas's active mode starts
8
+ * on, when the canvas mounts it. Absent with no mode registry.
9
+ */
10
+ function useModeDefaultToolDepSource(modes, tools) {
11
+ const ref = useLatest({
12
+ modes,
13
+ tools
14
+ });
15
+ useDepSource("modeDefaultTool", () => {
16
+ const { modes: m } = ref.current;
17
+ return m ? () => defaultToolOf(m.current(), ref.current.tools.has) : void 0;
18
+ });
19
+ }
20
+
21
+ export { useModeDefaultToolDepSource };
22
+ //# sourceMappingURL=modeDefaultTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modeDefaultTool.js","names":[],"sources":["../../../src/canvas/deps/modeDefaultTool.ts"],"sourcesContent":["/**\n * Wires the `modeDefaultTool` dep: the tool the canvas's active mode starts\n * on, when the canvas mounts it. Absent with no mode registry.\n */\nimport { defaultToolOf, type ModeRegistry } from '@weasel-js/modes';\nimport { useLatest } from '@weasel-js/react';\nimport { useDepSource } from '@weasel-js/routing/react';\nimport type { ToolsApi } from 'tools/overlayBinding';\n\nexport function useModeDefaultToolDepSource(modes: ModeRegistry | undefined, tools: Pick<ToolsApi, 'has'>): void {\n const ref = useLatest({ modes, tools });\n useDepSource('modeDefaultTool', () => {\n const { modes: m } = ref.current;\n return m ? () => defaultToolOf(m.current(), ref.current.tools.has) : undefined;\n });\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,4BAA4B,OAAiC,OAAoC;CAC/G,MAAM,MAAM,UAAU;EAAE;EAAO;CAAM,CAAC;CACtC,aAAa,yBAAyB;EACpC,MAAM,EAAE,OAAO,MAAM,IAAI;EACzB,OAAO,UAAU,cAAc,EAAE,QAAQ,GAAG,IAAI,QAAQ,MAAM,GAAG,IAAI;CACvE,CAAC;AACH"}
@@ -2,7 +2,7 @@ import { asNodeId } from "../../core/scene/types.js";
2
2
  import { useLatest } from "@weasel-js/react";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/nodeAtPoint.ts
5
+ // src/canvas/deps/nodeAtPoint.ts
6
6
  function useNodeAtPointDepSource(pickEvery) {
7
7
  const pickRef = useLatest(pickEvery);
8
8
  useDepSource("nodeAtPoint", () => {
@@ -17,6 +17,5 @@ function useNodeAtPointDepSource(pickEvery) {
17
17
  });
18
18
  }
19
19
 
20
- //#endregion
21
20
  export { useNodeAtPointDepSource };
22
21
  //# sourceMappingURL=nodeAtPoint.js.map
@@ -1,13 +1,13 @@
1
- import { sceneDependentsOf } from "../../core/scene/dependents.js";
2
1
  import { createTransformOp } from "../../core/ops/transform.js";
3
2
  import { createSetDataOp } from "../../core/ops/setData.js";
4
3
  import { createDeleteOp } from "../../core/ops/delete.js";
4
+ import { writtenBy } from "../../core/ops/writtenBy.js";
5
+ import { sceneDependentsOf } from "../../core/scene/dependents.js";
5
6
  import { pathEditPathOf, storeEditablePath } from "../../domains/paths/editablePath.js";
6
7
  import { withoutShapeGenerator } from "../../domains/paths/shapeGenerator.js";
7
8
  import { withoutGeometryBoundData } from "../../domains/paths/pathEditExtension.js";
8
- import { writtenBy } from "../../core/ops/writtenBy.js";
9
9
 
10
- //#region src/canvas/deps/pathEditCommits.ts
10
+ // src/canvas/deps/pathEditCommits.ts
11
11
  /** The scene as an extension's `finishEdit` reads it. */
12
12
  function finishCtx(sc, id, extensions) {
13
13
  return {
@@ -184,6 +184,5 @@ function pathEditFollower(sc, extensions) {
184
184
  };
185
185
  }
186
186
 
187
- //#endregion
188
187
  export { finishCtx, finishEdit, otherOps, pathEditFollower, reshapeOps, transformOps, transformPreview };
189
188
  //# sourceMappingURL=pathEditCommits.js.map
@@ -1,6 +1,6 @@
1
1
  import { poseLinearOf, worldEditToStorage } from "@weasel-js/geom";
2
2
 
3
- //#region src/canvas/deps/pathLeaf.ts
3
+ // src/canvas/deps/pathLeaf.ts
4
4
  /** How `g` draws a leaf at `world`, or null for a pose it reads no finite box from. */
5
5
  function drawnPose(g, world) {
6
6
  const b = g.getBounds(world);
@@ -61,6 +61,5 @@ function leafPath(scene, node) {
61
61
  return path && (path.kind === "rect" || path.kind === "polygon") ? path : null;
62
62
  }
63
63
 
64
- //#endregion
65
64
  export { drawnPose, leafPath, storePiece };
66
65
  //# sourceMappingURL=pathLeaf.js.map
@@ -1,13 +1,12 @@
1
- import { useSliceDepSource } from "./slice.js";
2
1
  import { useBooleansAdapterSource } from "./booleans.js";
2
+ import { useSliceDepSource } from "./slice.js";
3
3
 
4
- //#region src/canvas/deps/pathLeafDeps.ts
4
+ // src/canvas/deps/pathLeafDeps.ts
5
5
  /** The kit deps that rewrite a scene's path leaves: `slice` and `booleansAdapter`. */
6
6
  function usePathLeafDepSources(scene, selection, adapter, poseDescriptor) {
7
7
  useSliceDepSource(scene, selection, adapter, poseDescriptor);
8
8
  useBooleansAdapterSource(scene, selection, adapter, poseDescriptor);
9
9
  }
10
10
 
11
- //#endregion
12
11
  export { usePathLeafDepSources };
13
12
  //# sourceMappingURL=pathLeafDeps.js.map
@@ -2,13 +2,12 @@ import { AUTO_POSE_DESCRIPTOR } from "../../core/geometry/autoPoseDescriptor.js"
2
2
  import { useLatest } from "@weasel-js/react";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/poseDescriptor.ts
5
+ // src/canvas/deps/poseDescriptor.ts
6
6
  /** Publish the pose descriptor every built-in action reads. */
7
7
  function usePoseDescriptorDepSource(descriptor) {
8
8
  const ref = useLatest(descriptor);
9
9
  useDepSource("poseDescriptor", () => ref.current ?? AUTO_POSE_DESCRIPTOR);
10
10
  }
11
11
 
12
- //#endregion
13
12
  export { usePoseDescriptorDepSource };
14
13
  //# sourceMappingURL=poseDescriptor.js.map
@@ -2,7 +2,7 @@ import { createPathOverlay } from "../pathOverlay.js";
2
2
  import { useMemo } from "react";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/previewPaths.ts
5
+ // src/canvas/deps/previewPaths.ts
6
6
  /**
7
7
  * `usePreviewPathsDepSource` — wires the `previewPaths` dep: where an
8
8
  * action's `preview` draws what it would make, over this canvas.
@@ -39,6 +39,5 @@ function usePreviewPathsDepSource(canvasApiRef) {
39
39
  useDepSource("previewPaths", () => dep);
40
40
  }
41
41
 
42
- //#endregion
43
42
  export { PREVIEW_PATHS_LAYER_ID, createPreviewPaths, usePreviewPathsDepSource };
44
43
  //# sourceMappingURL=previewPaths.js.map
@@ -1,7 +1,7 @@
1
1
  import { useLatest } from "@weasel-js/react";
2
2
  import { useDepSource } from "@weasel-js/routing/react";
3
3
 
4
- //#region src/canvas/deps/resizePolicy.ts
4
+ // src/canvas/deps/resizePolicy.ts
5
5
  /**
6
6
  * Wires the `resizePolicy` dep consumed by `resizeAction`. Omitted
7
7
  * `constraints` default to none; Shift's aspect lock is the snap session's.
@@ -37,6 +37,5 @@ function resizePolicyOptions(o) {
37
37
  };
38
38
  }
39
39
 
40
- //#endregion
41
40
  export { resizePolicyOptions, useResizePolicy };
42
41
  //# sourceMappingURL=resizePolicy.js.map
@@ -0,0 +1,22 @@
1
+ import { useDepRegistry, useDepSource } from "@weasel-js/routing/react";
2
+
3
+ // src/canvas/deps/selectionSnapshot.ts
4
+ var sameIds = (a, b) => a.length === b.length && a.every((id, i) => id === b[i]);
5
+ function useSelectionSnapshotDepSource() {
6
+ const registry = useDepRegistry();
7
+ useDepSource("selectionSnapshot", () => ({ take() {
8
+ const ids = registry.get("selection")?.get() ?? null;
9
+ const edit = registry.get("editAnchors");
10
+ const editing = edit?.editingId ?? "";
11
+ const anchors = edit ? [...edit.selectedAnchors] : [];
12
+ return () => {
13
+ const selection = registry.get("selection");
14
+ if (ids && selection && !sameIds(selection.get(), ids)) selection.set([...ids]);
15
+ const now = registry.get("editAnchors");
16
+ if (editing && now?.editingId === editing) now.setSelectedAnchors(anchors);
17
+ };
18
+ } }));
19
+ }
20
+
21
+ export { useSelectionSnapshotDepSource };
22
+ //# sourceMappingURL=selectionSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectionSnapshot.js","names":[],"sources":["../../../src/canvas/deps/selectionSnapshot.ts"],"sourcesContent":["/**\n * The `selectionSnapshot` dep: the node selection and, in path edit, the anchor\n * selection, captured together, so the last operation puts both back before it\n * reruns an action that changed them.\n */\nimport type { SelectionSnapshotDep } from '@weasel-js/routing';\nimport { useDepRegistry, useDepSource } from '@weasel-js/routing/react';\nimport type {} from '../../interactions/actions/depSchema';\n\nconst sameIds = (a: readonly string[], b: readonly string[]): boolean =>\n a.length === b.length && a.every((id, i) => id === b[i]);\n\nexport function useSelectionSnapshotDepSource(): void {\n const registry = useDepRegistry();\n useDepSource('selectionSnapshot', (): SelectionSnapshotDep => ({\n take() {\n const ids = registry.get('selection')?.get() ?? null;\n const edit = registry.get('editAnchors');\n const editing = edit?.editingId ?? '';\n const anchors = edit ? [...edit.selectedAnchors] : [];\n return () => {\n const selection = registry.get('selection');\n if (ids && selection && !sameIds(selection.get(), ids)) selection.set([...ids] as never);\n const now = registry.get('editAnchors');\n if (editing && now?.editingId === editing) now.setSelectedAnchors(anchors);\n };\n },\n }));\n}\n"],"mappings":";;;AASA,IAAM,WAAW,GAAsB,MACrC,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,IAAI,MAAM,OAAO,EAAE,EAAE;AAEzD,SAAgB,gCAAsC;CACpD,MAAM,WAAW,eAAe;CAChC,aAAa,4BAAkD,EAC7D,OAAO;EACL,MAAM,MAAM,SAAS,IAAI,WAAW,CAAC,EAAE,IAAI,KAAK;EAChD,MAAM,OAAO,SAAS,IAAI,aAAa;EACvC,MAAM,UAAU,MAAM,aAAa;EACnC,MAAM,UAAU,OAAO,CAAC,GAAG,KAAK,eAAe,IAAI,CAAC;EACpD,aAAa;GACX,MAAM,YAAY,SAAS,IAAI,WAAW;GAC1C,IAAI,OAAO,aAAa,CAAC,QAAQ,UAAU,IAAI,GAAG,GAAG,GAAG,UAAU,IAAI,CAAC,GAAG,GAAG,CAAU;GACvF,MAAM,MAAM,SAAS,IAAI,aAAa;GACtC,IAAI,WAAW,KAAK,cAAc,SAAS,IAAI,mBAAmB,OAAO;EAC3E;CACF,EACF,EAAE;AACJ"}
@@ -1,15 +1,15 @@
1
- import { documentOf } from "../../core/scene/documentOf.js";
2
- import { poseDescriptorForNode } from "../../core/geometry/poseDescriptor.js";
3
1
  import { AUTO_POSE_DESCRIPTOR } from "../../core/geometry/autoPoseDescriptor.js";
4
- import { indexedCandidates } from "../pickIndex/scenePickIndex.js";
5
- import { scenePoseFrame } from "../../interactions/actions/poseFrame.js";
2
+ import { poseDescriptorForNode } from "../../core/geometry/poseDescriptor.js";
6
3
  import { drawnPose, leafPath, storePiece } from "./pathLeaf.js";
4
+ import { scenePoseFrame } from "../../interactions/actions/poseFrame.js";
5
+ import { documentOf } from "../../core/scene/documentOf.js";
7
6
  import { computeSliceOps } from "../../interactions/actions/defaults/sliceOps.js";
7
+ import { indexedCandidates } from "../pickIndex/scenePickIndex.js";
8
8
  import { boundsOfCoords, pathInWorld } from "@weasel-js/geom";
9
9
  import { useLatest } from "@weasel-js/react";
10
10
  import { useDepSource } from "@weasel-js/routing/react";
11
11
 
12
- //#region src/canvas/deps/slice.ts
12
+ // src/canvas/deps/slice.ts
13
13
  /**
14
14
  * The `slice` dep `sliceAction` and `useSliceTool` commit their cuts through.
15
15
  *
@@ -95,6 +95,5 @@ function siblingIndex(scene, node) {
95
95
  return (node.parent == null ? scene.roots : scene.childrenOf(node.parent)).indexOf(node.id);
96
96
  }
97
97
 
98
- //#endregion
99
98
  export { useSliceDep, useSliceDepSource };
100
99
  //# sourceMappingURL=slice.js.map
@@ -1,12 +1,12 @@
1
- import { assertSnapSourceIds, snapSourcesFor } from "../../domains/snap/gather.js";
2
- import { DEFAULT_SNAP_PX } from "../../domains/snap/session2d.js";
3
1
  import { ownGeometryAt, pathSnapSource } from "../../domains/paths/pathSnap/pathSnapSource.js";
2
+ import { assertSnapSourceIds, snapSourcesFor } from "../../domains/snap/gather.js";
4
3
  import { sceneSession2d } from "../../domains/snap/sceneSession2d.js";
4
+ import { DEFAULT_SNAP_PX } from "../../domains/snap/session2d.js";
5
5
  import { rotationSnapSource } from "../../domains/snap/rotationSource.js";
6
6
  import { useKitSettings, useLatest } from "@weasel-js/react";
7
7
  import { useDepSource } from "@weasel-js/routing/react";
8
8
 
9
- //#region src/canvas/deps/snap.ts
9
+ // src/canvas/deps/snap.ts
10
10
  /**
11
11
  * `useSnapDepSource` — wires the `snap` dep whose `begin` every snapping
12
12
  * gesture runs: a session over the snap sources `session` names, writing its
@@ -53,6 +53,7 @@ function useSnapDepSource(viewRef, session, store) {
53
53
  reachPx,
54
54
  ...s.poseDescriptor ? { poseDescriptor: s.poseDescriptor } : {},
55
55
  ...s.originProjection ? { originProjection: s.originProjection } : {},
56
+ ...s.anchors ? { anchors: s.anchors } : {},
56
57
  ...debug ? { debug } : {},
57
58
  store
58
59
  });
@@ -60,6 +61,5 @@ function useSnapDepSource(viewRef, session, store) {
60
61
  return store;
61
62
  }
62
63
 
63
- //#endregion
64
64
  export { useSnapDepSource };
65
65
  //# sourceMappingURL=snap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snap.js","names":[],"sources":["../../../src/canvas/deps/snap.ts"],"sourcesContent":["/**\n * `useSnapDepSource` — wires the `snap` dep whose `begin` every snapping\n * gesture runs: a session over the snap sources `session` names, writing its\n * marks to the outcome store this hook returns.\n */\nimport { useDepSource } from '@weasel-js/routing/react';\nimport { useKitSettings, useLatest } from '@weasel-js/react';\nimport type { DebugSink, WorldPoint } from '@weasel-js/routing';\nimport type { SnapDep } from 'interactions/actions/snapDep';\nimport { ownGeometryAt } from 'domains/paths/pathSnap/pathSnapSource';\nimport type { View } from 'core/viewport/view';\nimport type { Scene } from 'core/scene/types';\nimport type { DrawnBoxes } from 'interactions/actions/drawnBoxes';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { OriginProjection } from 'interactions/gestures/shared/originProjection';\nimport type { SnapOutcomeStore } from 'domains/snap/outcomeStore';\nimport type { SnapSourceRegistry } from 'domains/snap/registry';\nimport { assertSnapSourceIds, snapSourcesFor } from 'domains/snap/gather';\nimport { sceneSession2d } from 'domains/snap/sceneSession2d';\nimport { DEFAULT_SNAP_PX } from 'domains/snap/session2d';\nimport type { SnapReadoutDep } from 'domains/snap/readoutDep';\nimport { rotationSnapSource } from 'domains/snap/rotationSource';\nimport { pathSnapSource } from 'domains/paths/pathSnap/pathSnapSource';\nimport type { SnapSource } from 'domains/snap/types';\n\n/** What `begin` reads: the scene its probes come from and the sources it asks. */\nexport interface SnapSessionSources {\n scene: Scene<unknown, string, unknown>;\n /** The boxes the subject is drawn with, read when a session begins. */\n boxes: () => DrawnBoxes;\n /** `<SceneCanvas snap.sources>`, then the presets' `snapSources`. */\n sources: readonly SnapSource[];\n /** Sources `useSnapSource` adds, after `sources`. */\n registry?: SnapSourceRegistry;\n /** Ids of the canvas's default sources to leave out. */\n omit?: readonly string[];\n /** Overrides the kit setting `targets.snapPx`. */\n reachPx?: number;\n /** How a node's rotation is read, for angle targets. */\n poseDescriptor?: PoseDescriptor<unknown>;\n /** How a pose's origin is read, for the `origin` probe. */\n originProjection?: OriginProjection<unknown>;\n /** The canvas's debug sink, read when a session begins: each frame's\n * candidates are recorded into it. */\n debug?: () => DebugSink | null | undefined;\n}\n\n/** The sources every canvas asks after its own, unless `omit` names one:\n * quarter turns and other nodes' angles for a rotate, and other nodes'\n * anchors for a point gesture, under `pathSnapSource`'s own id, so a\n * consumer's `pathSnapSource()` takes its place. */\nconst DEFAULT_SNAP_SOURCES: readonly SnapSource[] = [\n rotationSnapSource(),\n { ...pathSnapSource({ only: ['anchor'] }), gestures: ['point'] },\n];\n\n/** `listed`, which must not repeat an id, then each default whose id is\n * neither listed nor in `omit`. */\nfunction withDefaults(listed: readonly SnapSource[], omit: readonly string[] = []): SnapSource[] {\n assertSnapSourceIds(listed);\n const taken = new Set([...listed.map((s) => s.id), ...omit]);\n return [...listed, ...DEFAULT_SNAP_SOURCES.filter((s) => !taken.has(s.id))];\n}\n\nexport function useSnapDepSource(\n viewRef: React.RefObject<View | null>,\n session: SnapSessionSources,\n /** The canvas's outcome store, which its readout layer draws. */\n store: SnapOutcomeStore,\n): SnapOutcomeStore {\n const sessionRef = useLatest(session);\n const kitSettings = useKitSettings();\n useDepSource('snapReadout', (): SnapReadoutDep => ({ store }));\n\n useDepSource('snap', (): SnapDep => ({\n begin: (req) => {\n const s = sessionRef.current;\n const view = viewRef.current;\n const omit = new Set(req.omit);\n const sources = [\n ...withDefaults([...s.sources, ...(s.registry?.list() ?? [])], s.omit).filter((src) => !omit.has(src.id)),\n ...(req.sources ?? []),\n ];\n assertSnapSourceIds(sources);\n const wantsGeometry = snapSourcesFor(sources, req.gesture).some((src) => src.roles.includes('geometry'));\n const debug = s.debug?.() ?? undefined;\n const reachPx = s.reachPx ?? kitSettings.get('targets.snapPx') ?? DEFAULT_SNAP_PX;\n return sceneSession2d({\n req,\n scene: s.scene,\n boxes: s.boxes(),\n sources,\n ...(wantsGeometry ? { geometryAt: (press: WorldPoint, ids: readonly string[]) => ownGeometryAt(s.scene, press, ids, view?.scale ?? { x: 1, y: 1 }, reachPx) } : {}),\n view: () => viewRef.current,\n reachPx,\n ...(s.poseDescriptor ? { poseDescriptor: s.poseDescriptor } : {}),\n ...(s.originProjection ? { originProjection: s.originProjection } : {}),\n ...(debug ? { debug } : {}),\n store,\n });\n },\n }));\n return store;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,IAAM,uBAA8C,CAClD,mBAAmB,GACnB;CAAE,GAAG,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;CAAG,UAAU,CAAC,OAAO;AAAE,CACjE;;;AAIA,SAAS,aAAa,QAA+B,OAA0B,CAAC,GAAiB;CAC/F,oBAAoB,MAAM;CAC1B,MAAM,wBAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,MAAM,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC;CAC3D,OAAO,CAAC,GAAG,QAAQ,GAAG,qBAAqB,QAAQ,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5E;AAEA,SAAgB,iBACd,SACA,SAEA,OACkB;CAClB,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,cAAc,eAAe;CACnC,aAAa,sBAAsC,EAAE,MAAM,EAAE;CAE7D,aAAa,eAAwB,EACnC,QAAQ,QAAQ;EACd,MAAM,IAAI,WAAW;EACrB,MAAM,OAAO,QAAQ;EACrB,MAAM,OAAO,IAAI,IAAI,IAAI,IAAI;EAC7B,MAAM,UAAU,CACd,GAAG,aAAa,CAAC,GAAG,EAAE,SAAS,GAAI,EAAE,UAAU,KAAK,KAAK,CAAC,CAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,QAAQ,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,GACxG,GAAI,IAAI,WAAW,CAAC,CACtB;EACA,oBAAoB,OAAO;EAC3B,MAAM,gBAAgB,eAAe,SAAS,IAAI,OAAO,CAAC,CAAC,MAAM,QAAQ,IAAI,MAAM,SAAS,UAAU,CAAC;EACvG,MAAM,QAAQ,EAAE,QAAQ,KAAK;EAC7B,MAAM,UAAU,EAAE,WAAW,YAAY,IAAI,gBAAgB,KAAK;EAClE,OAAO,eAAe;GACpB;GACA,OAAO,EAAE;GACT,OAAO,EAAE,MAAM;GACf;GACA,GAAI,gBAAgB,EAAE,aAAa,OAAmB,QAA2B,cAAc,EAAE,OAAO,OAAO,KAAK,MAAM,SAAS;IAAE,GAAG;IAAG,GAAG;GAAE,GAAG,OAAO,EAAE,IAAI,CAAC;GACjK,YAAY,QAAQ;GACpB;GACA,GAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,IAAI,CAAC;GAC/D,GAAI,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,IAAI,CAAC;GACrE,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;GACzB;EACF,CAAC;CACH,EACF,EAAE;CACF,OAAO;AACT"}
1
+ {"version":3,"file":"snap.js","names":[],"sources":["../../../src/canvas/deps/snap.ts"],"sourcesContent":["/**\n * `useSnapDepSource` — wires the `snap` dep whose `begin` every snapping\n * gesture runs: a session over the snap sources `session` names, writing its\n * marks to the outcome store this hook returns.\n */\nimport { useDepSource } from '@weasel-js/routing/react';\nimport { useKitSettings, useLatest } from '@weasel-js/react';\nimport type { DebugSink, WorldPoint } from '@weasel-js/routing';\nimport type { SnapDep } from 'interactions/actions/snapDep';\nimport { ownGeometryAt } from 'domains/paths/pathSnap/pathSnapSource';\nimport type { View } from 'core/viewport/view';\nimport type { Scene } from 'core/scene/types';\nimport type { DrawnBoxes } from 'interactions/actions/drawnBoxes';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { OriginProjection } from 'interactions/gestures/shared/originProjection';\nimport type { SnapOutcomeStore } from 'domains/snap/outcomeStore';\nimport type { SnapSourceRegistry } from 'domains/snap/registry';\nimport { assertSnapSourceIds, snapSourcesFor } from 'domains/snap/gather';\nimport { sceneSession2d } from 'domains/snap/sceneSession2d';\nimport { DEFAULT_SNAP_PX } from 'domains/snap/session2d';\nimport type { SnapReadoutDep } from 'domains/snap/readoutDep';\nimport { rotationSnapSource } from 'domains/snap/rotationSource';\nimport { pathSnapSource } from 'domains/paths/pathSnap/pathSnapSource';\nimport type { SnapAnchors, SnapSource } from 'domains/snap/types';\n\n/** What `begin` reads: the scene its probes come from and the sources it asks. */\nexport interface SnapSessionSources {\n scene: Scene<unknown, string, unknown>;\n /** The boxes the subject is drawn with, read when a session begins. */\n boxes: () => DrawnBoxes;\n /** `<SceneCanvas snap.sources>`, then the presets' `snapSources`. */\n sources: readonly SnapSource[];\n /** Sources `useSnapSource` adds, after `sources`. */\n registry?: SnapSourceRegistry;\n /** Ids of the canvas's default sources to leave out. */\n omit?: readonly string[];\n /** Overrides the kit setting `targets.snapPx`. */\n reachPx?: number;\n /** How a node's rotation is read, for angle targets. */\n poseDescriptor?: PoseDescriptor<unknown>;\n /** How a pose's origin is read, for the `origin` probe. */\n originProjection?: OriginProjection<unknown>;\n /** Each node's snap anchors, for the `anchor` probes of a move. */\n anchors?: SnapAnchors;\n /** The canvas's debug sink, read when a session begins: each frame's\n * candidates are recorded into it. */\n debug?: () => DebugSink | null | undefined;\n}\n\n/** The sources every canvas asks after its own, unless `omit` names one:\n * quarter turns and other nodes' angles for a rotate, and other nodes'\n * anchors for a point gesture, under `pathSnapSource`'s own id, so a\n * consumer's `pathSnapSource()` takes its place. */\nconst DEFAULT_SNAP_SOURCES: readonly SnapSource[] = [\n rotationSnapSource(),\n { ...pathSnapSource({ only: ['anchor'] }), gestures: ['point'] },\n];\n\n/** `listed`, which must not repeat an id, then each default whose id is\n * neither listed nor in `omit`. */\nfunction withDefaults(listed: readonly SnapSource[], omit: readonly string[] = []): SnapSource[] {\n assertSnapSourceIds(listed);\n const taken = new Set([...listed.map((s) => s.id), ...omit]);\n return [...listed, ...DEFAULT_SNAP_SOURCES.filter((s) => !taken.has(s.id))];\n}\n\nexport function useSnapDepSource(\n viewRef: React.RefObject<View | null>,\n session: SnapSessionSources,\n /** The canvas's outcome store, which its readout layer draws. */\n store: SnapOutcomeStore,\n): SnapOutcomeStore {\n const sessionRef = useLatest(session);\n const kitSettings = useKitSettings();\n useDepSource('snapReadout', (): SnapReadoutDep => ({ store }));\n\n useDepSource('snap', (): SnapDep => ({\n begin: (req) => {\n const s = sessionRef.current;\n const view = viewRef.current;\n const omit = new Set(req.omit);\n const sources = [\n ...withDefaults([...s.sources, ...(s.registry?.list() ?? [])], s.omit).filter((src) => !omit.has(src.id)),\n ...(req.sources ?? []),\n ];\n assertSnapSourceIds(sources);\n const wantsGeometry = snapSourcesFor(sources, req.gesture).some((src) => src.roles.includes('geometry'));\n const debug = s.debug?.() ?? undefined;\n const reachPx = s.reachPx ?? kitSettings.get('targets.snapPx') ?? DEFAULT_SNAP_PX;\n return sceneSession2d({\n req,\n scene: s.scene,\n boxes: s.boxes(),\n sources,\n ...(wantsGeometry ? { geometryAt: (press: WorldPoint, ids: readonly string[]) => ownGeometryAt(s.scene, press, ids, view?.scale ?? { x: 1, y: 1 }, reachPx) } : {}),\n view: () => viewRef.current,\n reachPx,\n ...(s.poseDescriptor ? { poseDescriptor: s.poseDescriptor } : {}),\n ...(s.originProjection ? { originProjection: s.originProjection } : {}),\n ...(s.anchors ? { anchors: s.anchors } : {}),\n ...(debug ? { debug } : {}),\n store,\n });\n },\n }));\n return store;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqDA,IAAM,uBAA8C,CAClD,mBAAmB,GACnB;CAAE,GAAG,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;CAAG,UAAU,CAAC,OAAO;AAAE,CACjE;;;AAIA,SAAS,aAAa,QAA+B,OAA0B,CAAC,GAAiB;CAC/F,oBAAoB,MAAM;CAC1B,MAAM,wBAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,MAAM,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC;CAC3D,OAAO,CAAC,GAAG,QAAQ,GAAG,qBAAqB,QAAQ,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5E;AAEA,SAAgB,iBACd,SACA,SAEA,OACkB;CAClB,MAAM,aAAa,UAAU,OAAO;CACpC,MAAM,cAAc,eAAe;CACnC,aAAa,sBAAsC,EAAE,MAAM,EAAE;CAE7D,aAAa,eAAwB,EACnC,QAAQ,QAAQ;EACd,MAAM,IAAI,WAAW;EACrB,MAAM,OAAO,QAAQ;EACrB,MAAM,OAAO,IAAI,IAAI,IAAI,IAAI;EAC7B,MAAM,UAAU,CACd,GAAG,aAAa,CAAC,GAAG,EAAE,SAAS,GAAI,EAAE,UAAU,KAAK,KAAK,CAAC,CAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,QAAQ,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,GACxG,GAAI,IAAI,WAAW,CAAC,CACtB;EACA,oBAAoB,OAAO;EAC3B,MAAM,gBAAgB,eAAe,SAAS,IAAI,OAAO,CAAC,CAAC,MAAM,QAAQ,IAAI,MAAM,SAAS,UAAU,CAAC;EACvG,MAAM,QAAQ,EAAE,QAAQ,KAAK;EAC7B,MAAM,UAAU,EAAE,WAAW,YAAY,IAAI,gBAAgB,KAAK;EAClE,OAAO,eAAe;GACpB;GACA,OAAO,EAAE;GACT,OAAO,EAAE,MAAM;GACf;GACA,GAAI,gBAAgB,EAAE,aAAa,OAAmB,QAA2B,cAAc,EAAE,OAAO,OAAO,KAAK,MAAM,SAAS;IAAE,GAAG;IAAG,GAAG;GAAE,GAAG,OAAO,EAAE,IAAI,CAAC;GACjK,YAAY,QAAQ;GACpB;GACA,GAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,IAAI,CAAC;GAC/D,GAAI,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,IAAI,CAAC;GACrE,GAAI,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;GAC1C,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;GACzB;EACF,CAAC;CACH,EACF,EAAE;CACF,OAAO;AACT"}
@@ -2,7 +2,7 @@ import { viewToTransform } from "../../core/viewport/view.js";
2
2
  import { worldToScreen } from "../../core/viewport/viewTransform.js";
3
3
  import { useDepSource, useMenuHost, usePointerContext } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/surface.ts
5
+ // src/canvas/deps/surface.ts
6
6
  /**
7
7
  * `useSurfaceDepSources` — the deps that describe where this canvas sits:
8
8
  * the `pointer` context, the surface's `menuHost`, and `worldToClient`, which
@@ -25,6 +25,5 @@ function useSurfaceDepSources(canvasRef, currentViewRef) {
25
25
  });
26
26
  }
27
27
 
28
- //#endregion
29
28
  export { useSurfaceDepSources };
30
29
  //# sourceMappingURL=surface.js.map
@@ -2,7 +2,7 @@ import { isDev, useLatest } from "@weasel-js/react";
2
2
  import { isTextData } from "@weasel-js/text";
3
3
  import { useDepSource } from "@weasel-js/routing/react";
4
4
 
5
- //#region src/canvas/deps/textEdit.ts
5
+ // src/canvas/deps/textEdit.ts
6
6
  /**
7
7
  * `useTextEditDepSource` — the `textEdit` dep `enterTextEditAction` reads when
8
8
  * no editor answers it: a `startEdit` that does nothing, and an `isTextNode`
@@ -24,6 +24,5 @@ function useTextEditDepSource(scene) {
24
24
  });
25
25
  }
26
26
 
27
- //#endregion
28
27
  export { useTextEditDepSource };
29
28
  //# sourceMappingURL=textEdit.js.map
@@ -1,6 +1,6 @@
1
1
  import { useDepSource } from "@weasel-js/routing/react";
2
2
 
3
- //#region src/canvas/deps/transformFollowers.ts
3
+ // src/canvas/deps/transformFollowers.ts
4
4
  /**
5
5
  * Add a follower to the `transformFollowers` dep for the lifetime of the
6
6
  * calling component, after every one already there in its scope and the
@@ -15,6 +15,5 @@ function useTransformFollower(follower) {
15
15
  });
16
16
  }
17
17
 
18
- //#endregion
19
18
  export { useTransformFollower };
20
19
  //# sourceMappingURL=transformFollowers.js.map
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from "react";
2
2
  import { useLatest } from "@weasel-js/react";
3
3
 
4
- //#region src/canvas/deps/view.ts
4
+ // src/canvas/deps/view.ts
5
5
  /**
6
6
  * Builds a stable `ViewApi` that reads from `currentViewRef` and writes via
7
7
  * `onViewChange`. It does **not** call `useDepSource('view', ...)` itself:
@@ -50,6 +50,5 @@ function useViewDepSource(currentViewRef, onViewChange, recenter, hostSize, anim
50
50
  ]);
51
51
  }
52
52
 
53
- //#endregion
54
53
  export { useViewDepSource };
55
54
  //# sourceMappingURL=view.js.map
@@ -1,15 +1,15 @@
1
+ import { asNodeId } from "../core/scene/types.js";
2
+ import { definesFrame, derivedDepOf, effectivePose } from "../core/scene/effectivePose.js";
1
3
  import { composeWorldPose, composesFrames } from "../core/scene/composeFrame.js";
2
- import { carryBoxPath, carryPathBy, pathAsPainted } from "../core/scene/depFrame.js";
3
- import { createNodeMemoScope } from "../core/scene/nodeMemo.js";
4
+ import { viewPoseAdapter } from "../core/scene/scrollOffsets.js";
4
5
  import { resolveDerivedPath } from "../core/scene/derivedPath.js";
5
6
  import { inheritedPaintIn } from "../core/scene/inheritedPaint.js";
7
+ import { createNodeMemoScope } from "../core/scene/nodeMemo.js";
8
+ import { carryBoxPath, carryPathBy, pathAsPainted } from "../core/scene/depFrame.js";
6
9
  import { nodeAsShown, shownLookup } from "../core/scene/nodeAsShown.js";
7
- import { definesFrame, derivedDepOf, effectivePose } from "../core/scene/effectivePose.js";
8
- import { viewPoseAdapter } from "../core/scene/scrollOffsets.js";
9
- import { asNodeId } from "../core/scene/types.js";
10
10
  import { multiply, poseFrameInverseOf, poseFrameOf } from "@weasel-js/geom";
11
11
 
12
- //#region src/canvas/derivedPath.ts
12
+ // src/canvas/derivedPath.ts
13
13
  /** `node` as the scene shows it, its `pose` an override's or a derived one and its `data` an
14
14
  * override's: the stored node itself where they agree. */
15
15
  function shownNode(scene, stored) {
@@ -207,6 +207,5 @@ function drawnBoundsScene(scene) {
207
207
  return held;
208
208
  }
209
209
 
210
- //#endregion
211
210
  export { drawnBoundsScene, resolveDerivedPath, sceneDepLookup, sceneDerivedPathOf, scenePaintedPoseOf, sceneShownToPose, showsComputedPath, withDerivedPaths };
212
211
  //# sourceMappingURL=derivedPath.js.map