@weasel-js/core 1.9.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1139) hide show
  1. package/CHANGELOG.md +1106 -0
  2. package/README.md +7 -5
  3. package/dist/WeaselProvider.js +5 -7
  4. package/dist/WeaselProvider.js.map +1 -1
  5. package/dist/affordances/composeAffordanceLayer.js +91 -93
  6. package/dist/affordances/composeAffordanceLayer.js.map +1 -1
  7. package/dist/affordances/cornerResize.js +27 -18
  8. package/dist/affordances/cornerResize.js.map +1 -1
  9. package/dist/affordances/hitAffordanceRegions.js +65 -104
  10. package/dist/affordances/hitAffordanceRegions.js.map +1 -1
  11. package/dist/affordances/pathAnchors.js.map +1 -1
  12. package/dist/affordances/rotationHandle.js +22 -21
  13. package/dist/affordances/rotationHandle.js.map +1 -1
  14. package/dist/animation/behaviors/coast.js +21 -0
  15. package/dist/animation/behaviors/coast.js.map +1 -0
  16. package/dist/animation/behaviors/coastByWrite.js +107 -0
  17. package/dist/animation/behaviors/coastByWrite.js.map +1 -0
  18. package/dist/animation/behaviors/coastOnTargets.js +94 -0
  19. package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
  20. package/dist/animation/behaviors/momentum.js +38 -88
  21. package/dist/animation/behaviors/momentum.js.map +1 -1
  22. package/dist/animation/clipTargets.js +12 -0
  23. package/dist/animation/clipTargets.js.map +1 -0
  24. package/dist/animation/index.js +15 -20
  25. package/dist/animation/poseHelpers.js +112 -33
  26. package/dist/animation/poseHelpers.js.map +1 -1
  27. package/dist/animation/poseTarget.js +115 -0
  28. package/dist/animation/poseTarget.js.map +1 -0
  29. package/dist/animation/reflow.js +113 -83
  30. package/dist/animation/reflow.js.map +1 -1
  31. package/dist/animation/rewind.js +66 -0
  32. package/dist/animation/rewind.js.map +1 -0
  33. package/dist/animation/rig/bindRig.js +85 -53
  34. package/dist/animation/rig/bindRig.js.map +1 -1
  35. package/dist/animation/rig/rigNode.js +93 -0
  36. package/dist/animation/rig/rigNode.js.map +1 -0
  37. package/dist/animation/rig/rigSeat.js +26 -0
  38. package/dist/animation/rig/rigSeat.js.map +1 -0
  39. package/dist/animation/rig/skinBinding.js +56 -0
  40. package/dist/animation/rig/skinBinding.js.map +1 -0
  41. package/dist/animation/rig/useRig.js +31 -16
  42. package/dist/animation/rig/useRig.js.map +1 -1
  43. package/dist/animation/wrappers/animateLifecycle.js +32 -24
  44. package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
  45. package/dist/animation/wrappers/animateOnSetPose.js +31 -29
  46. package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
  47. package/dist/animation/wrappers/instantPose.js +13 -0
  48. package/dist/animation/wrappers/instantPose.js.map +1 -0
  49. package/dist/animation/writtenPoseTarget.js +33 -0
  50. package/dist/animation/writtenPoseTarget.js.map +1 -0
  51. package/dist/{autoPoseDescriptor-vCdt55xm.d.ts → autoPoseDescriptor-DHg5KqaJ.d.ts} +1 -1
  52. package/dist/barrel/canvas.js +31 -0
  53. package/dist/barrel/chrome.js +16 -0
  54. package/dist/barrel/input.js +18 -0
  55. package/dist/barrel/interactions.js +38 -0
  56. package/dist/barrel/paint.js +11 -0
  57. package/dist/barrel/paths.js +12 -0
  58. package/dist/barrel/renderer.js +14 -0
  59. package/dist/barrel/routing.js +57 -0
  60. package/dist/barrel/scene.js +37 -0
  61. package/dist/barrel/text.js +9 -0
  62. package/dist/barrel/viewport.js +42 -0
  63. package/dist/canvas/Canvas.js +280 -559
  64. package/dist/canvas/Canvas.js.map +1 -1
  65. package/dist/canvas/CanvasView.js +147 -167
  66. package/dist/canvas/CanvasView.js.map +1 -1
  67. package/dist/canvas/CursorCoordsHud.js +53 -49
  68. package/dist/canvas/CursorCoordsHud.js.map +1 -1
  69. package/dist/canvas/DrawCanvas.js +40 -51
  70. package/dist/canvas/DrawCanvas.js.map +1 -1
  71. package/dist/canvas/ModalityHud.js.map +1 -1
  72. package/dist/canvas/NodeShape.js +55 -374
  73. package/dist/canvas/NodeShape.js.map +1 -1
  74. package/dist/canvas/PickHud.js +50 -47
  75. package/dist/canvas/PickHud.js.map +1 -1
  76. package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
  77. package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
  78. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +126 -0
  79. package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -0
  80. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +27 -31
  81. package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
  82. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +64 -0
  83. package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -0
  84. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +16 -0
  85. package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -0
  86. package/dist/canvas/SceneCanvas/coordTrace.js +46 -0
  87. package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -0
  88. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +138 -85
  89. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  90. package/dist/canvas/SceneCanvas/defaultNodeRouting.js +9 -8
  91. package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
  92. package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
  93. package/dist/canvas/SceneCanvas/features.js +74 -43
  94. package/dist/canvas/SceneCanvas/features.js.map +1 -1
  95. package/dist/canvas/SceneCanvas/isDev.js +12 -0
  96. package/dist/canvas/SceneCanvas/isDev.js.map +1 -0
  97. package/dist/canvas/SceneCanvas/poseGeometry.js +31 -34
  98. package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
  99. package/dist/canvas/SceneCanvas/poseRegistrars.js +13 -0
  100. package/dist/canvas/SceneCanvas/poseRegistrars.js.map +1 -0
  101. package/dist/canvas/SceneCanvas/props.js +39 -0
  102. package/dist/canvas/SceneCanvas/props.js.map +1 -0
  103. package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
  104. package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
  105. package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
  106. package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
  107. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +21 -62
  108. package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
  109. package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
  110. package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
  111. package/dist/canvas/SceneCanvas/useCanvasCamera.js +38 -0
  112. package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
  113. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
  114. package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
  115. package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
  116. package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
  117. package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
  118. package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
  119. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +29 -29
  120. package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
  121. package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
  122. package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
  123. package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
  124. package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
  125. package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
  126. package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
  127. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +48 -48
  128. package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
  129. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
  130. package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
  131. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
  132. package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
  133. package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
  134. package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
  135. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
  136. package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
  137. package/dist/canvas/SceneCanvas/useSceneSelectTool.js +74 -78
  138. package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
  139. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
  140. package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
  141. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
  142. package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
  143. package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
  144. package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
  145. package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
  146. package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
  147. package/dist/canvas/SceneCanvas/worldPointAt.js +9 -0
  148. package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
  149. package/dist/canvas/SceneCanvas.js +311 -969
  150. package/dist/canvas/SceneCanvas.js.map +1 -1
  151. package/dist/canvas/SceneViewCanvas.js +42 -46
  152. package/dist/canvas/SceneViewCanvas.js.map +1 -1
  153. package/dist/canvas/adapterDerivedPath.js +26 -0
  154. package/dist/canvas/adapterDerivedPath.js.map +1 -0
  155. package/dist/canvas/affordanceAt.js +11 -1
  156. package/dist/canvas/affordanceAt.js.map +1 -1
  157. package/dist/canvas/buildSceneLayer.js +111 -0
  158. package/dist/canvas/buildSceneLayer.js.map +1 -0
  159. package/dist/canvas/buildSceneTree.js +16 -19
  160. package/dist/canvas/buildSceneTree.js.map +1 -1
  161. package/dist/canvas/canvasRenderer.js +67 -55
  162. package/dist/canvas/canvasRenderer.js.map +1 -1
  163. package/dist/canvas/colorOverrides.js.map +1 -1
  164. package/dist/canvas/defaultDrawOne.js +12 -12
  165. package/dist/canvas/defaultDrawOne.js.map +1 -1
  166. package/dist/canvas/deps/areaSelect.js +4 -4
  167. package/dist/canvas/deps/areaSelect.js.map +1 -1
  168. package/dist/canvas/deps/changes.js +13 -0
  169. package/dist/canvas/deps/changes.js.map +1 -0
  170. package/dist/canvas/deps/debug.js.map +1 -1
  171. package/dist/canvas/deps/editAnchors.js +38 -57
  172. package/dist/canvas/deps/editAnchors.js.map +1 -1
  173. package/dist/canvas/deps/geometryProjection.js.map +1 -1
  174. package/dist/canvas/deps/hitTestArea.js +31 -26
  175. package/dist/canvas/deps/hitTestArea.js.map +1 -1
  176. package/dist/canvas/deps/insert.js +130 -91
  177. package/dist/canvas/deps/insert.js.map +1 -1
  178. package/dist/canvas/deps/lassoSelect.js +5 -5
  179. package/dist/canvas/deps/lassoSelect.js.map +1 -1
  180. package/dist/canvas/deps/poseDescriptor.js +1 -1
  181. package/dist/canvas/deps/poseDescriptor.js.map +1 -1
  182. package/dist/canvas/deps/resizePolicy.js.map +1 -1
  183. package/dist/canvas/deps/slice.js +26 -26
  184. package/dist/canvas/deps/slice.js.map +1 -1
  185. package/dist/canvas/deps/textEdit.js +6 -5
  186. package/dist/canvas/deps/textEdit.js.map +1 -1
  187. package/dist/canvas/deps/view.js.map +1 -1
  188. package/dist/canvas/derivedPath.js +47 -22
  189. package/dist/canvas/derivedPath.js.map +1 -1
  190. package/dist/canvas/drawEnvelope.js +8 -4
  191. package/dist/canvas/drawEnvelope.js.map +1 -1
  192. package/dist/canvas/getNodeAtPoint.js +4 -8
  193. package/dist/canvas/getNodeAtPoint.js.map +1 -1
  194. package/dist/canvas/hud.module.js +1 -1
  195. package/dist/canvas/hud.module.js.map +1 -1
  196. package/dist/canvas/insertPreviewExtent.js.map +1 -1
  197. package/dist/canvas/kitRequirements.js +2 -2
  198. package/dist/canvas/kitRequirements.js.map +1 -1
  199. package/dist/canvas/layerOrder.js +13 -6
  200. package/dist/canvas/layerOrder.js.map +1 -1
  201. package/dist/canvas/layerSlots.js +6 -1
  202. package/dist/canvas/layerSlots.js.map +1 -1
  203. package/dist/canvas/nodeShapes/derivedPainter.js +34 -0
  204. package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -0
  205. package/dist/canvas/nodeShapes/imagePainter.js +87 -0
  206. package/dist/canvas/nodeShapes/imagePainter.js.map +1 -0
  207. package/dist/canvas/nodeShapes/memo.js +9 -0
  208. package/dist/canvas/nodeShapes/memo.js.map +1 -0
  209. package/dist/canvas/nodeShapes/nodePaint.js +68 -0
  210. package/dist/canvas/nodeShapes/nodePaint.js.map +1 -0
  211. package/dist/canvas/nodeShapes/pathPainter.js +39 -0
  212. package/dist/canvas/nodeShapes/pathPainter.js.map +1 -0
  213. package/dist/canvas/nodeShapes/poseBox.js +20 -0
  214. package/dist/canvas/nodeShapes/poseBox.js.map +1 -0
  215. package/dist/canvas/nodeShapes/rectFallbackPainter.js +38 -0
  216. package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -0
  217. package/dist/canvas/nodeShapes/shapePainter.js +72 -0
  218. package/dist/canvas/nodeShapes/shapePainter.js.map +1 -0
  219. package/dist/canvas/nodeShapes/textPainter.js +55 -0
  220. package/dist/canvas/nodeShapes/textPainter.js.map +1 -0
  221. package/dist/canvas/overlayRoleStrokes.js.map +1 -1
  222. package/dist/canvas/paintCull.js +11 -14
  223. package/dist/canvas/paintCull.js.map +1 -1
  224. package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
  225. package/dist/canvas/paintedCursorLayer.js.map +1 -0
  226. package/dist/canvas/pickWalk.js +59 -68
  227. package/dist/canvas/pickWalk.js.map +1 -1
  228. package/dist/canvas/planeClips.js +18 -19
  229. package/dist/canvas/planeClips.js.map +1 -1
  230. package/dist/canvas/poseCascade.js +41 -0
  231. package/dist/canvas/poseCascade.js.map +1 -0
  232. package/dist/canvas/poseRotation.js +9 -23
  233. package/dist/canvas/poseRotation.js.map +1 -1
  234. package/dist/canvas/rasterReadback.js +22 -0
  235. package/dist/canvas/rasterReadback.js.map +1 -0
  236. package/dist/canvas/renderDebugSnapshot.js +11 -11
  237. package/dist/canvas/renderDebugSnapshot.js.map +1 -1
  238. package/dist/canvas/renderNeeds.js +3 -3
  239. package/dist/canvas/renderNeeds.js.map +1 -1
  240. package/dist/canvas/renderSceneToPixels.js +64 -81
  241. package/dist/canvas/renderSceneToPixels.js.map +1 -1
  242. package/dist/canvas/sceneAdapter.js +68 -214
  243. package/dist/canvas/sceneAdapter.js.map +1 -1
  244. package/dist/canvas/sceneClipboard.js +112 -0
  245. package/dist/canvas/sceneClipboard.js.map +1 -0
  246. package/dist/canvas/sceneLayerPaint.js +4 -4
  247. package/dist/canvas/sceneLayerPaint.js.map +1 -1
  248. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  249. package/dist/canvas/sceneViewRender.js +39 -39
  250. package/dist/canvas/sceneViewRender.js.map +1 -1
  251. package/dist/canvas/slopsDebugLayer.js +4 -4
  252. package/dist/canvas/slopsDebugLayer.js.map +1 -1
  253. package/dist/canvas/surface.module.js +6 -0
  254. package/dist/canvas/surface.module.js.map +1 -0
  255. package/dist/canvas/surfaceBox.js +16 -0
  256. package/dist/canvas/surfaceBox.js.map +1 -0
  257. package/dist/canvas/useCanvasRenderer.js +26 -6
  258. package/dist/canvas/useCanvasRenderer.js.map +1 -1
  259. package/dist/canvas/useCanvasSurface.js +31 -0
  260. package/dist/canvas/useCanvasSurface.js.map +1 -0
  261. package/dist/canvas/useCanvasView.js +67 -0
  262. package/dist/canvas/useCanvasView.js.map +1 -0
  263. package/dist/canvas/useFrameLoop.js +39 -31
  264. package/dist/canvas/useFrameLoop.js.map +1 -1
  265. package/dist/canvas/useHostAnchor.js +35 -33
  266. package/dist/canvas/useHostAnchor.js.map +1 -1
  267. package/dist/canvas/useLateContentRedraw.js +8 -8
  268. package/dist/canvas/useLateContentRedraw.js.map +1 -1
  269. package/dist/canvas/useSceneLayerList.js +11 -0
  270. package/dist/canvas/useSceneLayerList.js.map +1 -0
  271. package/dist/canvas/useSurfaceInput.js +42 -0
  272. package/dist/canvas/useSurfaceInput.js.map +1 -0
  273. package/dist/canvas/useToolCursor.js +29 -0
  274. package/dist/canvas/useToolCursor.js.map +1 -0
  275. package/dist/canvas/useViewHelpers.js +46 -85
  276. package/dist/canvas/useViewHelpers.js.map +1 -1
  277. package/dist/canvas/viewInputs.js.map +1 -1
  278. package/dist/canvas/viewRegistry.js +25 -27
  279. package/dist/canvas/viewRegistry.js.map +1 -1
  280. package/dist/canvas/watchElementMove.js +43 -0
  281. package/dist/canvas/watchElementMove.js.map +1 -0
  282. package/dist/canvas/wrapNodeOutput.js.map +1 -1
  283. package/dist/clipboard.d.ts +16 -19
  284. package/dist/{types-B_9g6hMM.d.ts → clone-2a5hVbBd.d.ts} +123 -74
  285. package/dist/clone.d.ts +4 -7
  286. package/dist/clone.js +0 -2
  287. package/dist/core/device/index.js +5 -4
  288. package/dist/core/device/targets.js.map +1 -1
  289. package/dist/core/device/useDeviceProfile.js +38 -44
  290. package/dist/core/device/useDeviceProfile.js.map +1 -1
  291. package/dist/core/device/watchDevicePixelRatio.js +17 -0
  292. package/dist/core/device/watchDevicePixelRatio.js.map +1 -0
  293. package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
  294. package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
  295. package/dist/core/geometry/pathPoseDescriptor.js +88 -0
  296. package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
  297. package/dist/core/geometry/poseDescriptor.js +68 -19
  298. package/dist/core/geometry/poseDescriptor.js.map +1 -1
  299. package/dist/core/geometry/regionHit.js +31 -34
  300. package/dist/core/geometry/regionHit.js.map +1 -1
  301. package/dist/core/geometry/targetFrame.js +94 -0
  302. package/dist/core/geometry/targetFrame.js.map +1 -0
  303. package/dist/core/geometry/unionBounds.js +30 -29
  304. package/dist/core/geometry/unionBounds.js.map +1 -1
  305. package/dist/core/isPlainObject.js +2 -11
  306. package/dist/core/layers/backgroundFill.js +31 -0
  307. package/dist/core/layers/backgroundFill.js.map +1 -0
  308. package/dist/{features/groups → core/layers}/children.js +1 -1
  309. package/dist/core/layers/children.js.map +1 -0
  310. package/dist/core/layers/gateLayer.js +13 -0
  311. package/dist/core/layers/gateLayer.js.map +1 -0
  312. package/dist/core/layers/layerGroup.js +40 -0
  313. package/dist/core/layers/layerGroup.js.map +1 -0
  314. package/dist/core/layers/render.js +50 -76
  315. package/dist/core/layers/render.js.map +1 -1
  316. package/dist/core/ops/arrange.js +1 -0
  317. package/dist/core/ops/arrange.js.map +1 -1
  318. package/dist/core/ops/create.js +10 -5
  319. package/dist/core/ops/create.js.map +1 -1
  320. package/dist/core/ops/createHistory.js +9 -9
  321. package/dist/core/ops/createHistory.js.map +1 -1
  322. package/dist/core/ops/delete.js +12 -24
  323. package/dist/core/ops/delete.js.map +1 -1
  324. package/dist/core/ops/reorder/index.js +43 -40
  325. package/dist/core/ops/reorder/index.js.map +1 -1
  326. package/dist/core/ops/reorder/setChildOrder.js +34 -0
  327. package/dist/core/ops/reorder/setChildOrder.js.map +1 -0
  328. package/dist/core/paint/meshKind.js +16 -0
  329. package/dist/core/paint/meshKind.js.map +1 -0
  330. package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +282 -105
  331. package/dist/core/paint/meshKindLazy.js.map +1 -0
  332. package/dist/core/paint/paintKindEntry.js +8 -0
  333. package/dist/core/paint/paintKindEntry.js.map +1 -0
  334. package/dist/core/paint/paintKinds.js +144 -0
  335. package/dist/core/paint/paintKinds.js.map +1 -0
  336. package/dist/core/paint/registerMesh.js +7 -0
  337. package/dist/core/paint/registerMesh.js.map +1 -0
  338. package/dist/core/scene/NodeProperties.js.map +1 -1
  339. package/dist/core/scene/NodeRouting.js.map +1 -1
  340. package/dist/core/scene/appliedLog.js +37 -0
  341. package/dist/core/scene/appliedLog.js.map +1 -0
  342. package/dist/core/scene/arrivalWindow.js +102 -0
  343. package/dist/core/scene/arrivalWindow.js.map +1 -0
  344. package/dist/core/scene/boundOps.js +40 -0
  345. package/dist/core/scene/boundOps.js.map +1 -0
  346. package/dist/core/scene/composeFrame.js +9 -6
  347. package/dist/core/scene/composeFrame.js.map +1 -1
  348. package/dist/{features/groups → core/scene}/composePose.js +18 -18
  349. package/dist/core/scene/composePose.js.map +1 -0
  350. package/dist/core/scene/depMemo.js +31 -6
  351. package/dist/core/scene/depMemo.js.map +1 -1
  352. package/dist/core/scene/derivedPath.js +19 -20
  353. package/dist/core/scene/derivedPath.js.map +1 -1
  354. package/dist/core/scene/editMode.js +26 -0
  355. package/dist/core/scene/editMode.js.map +1 -0
  356. package/dist/core/scene/effectivePose.js +38 -39
  357. package/dist/core/scene/effectivePose.js.map +1 -1
  358. package/dist/core/scene/fieldEdits.js +98 -0
  359. package/dist/core/scene/fieldEdits.js.map +1 -0
  360. package/dist/core/scene/historyFacade.js +130 -0
  361. package/dist/core/scene/historyFacade.js.map +1 -0
  362. package/dist/core/scene/historyForm.js +6 -0
  363. package/dist/core/scene/historyForm.js.map +1 -0
  364. package/dist/core/scene/kitOps.js +185 -0
  365. package/dist/core/scene/kitOps.js.map +1 -0
  366. package/dist/core/scene/kitRegistry.js.map +1 -1
  367. package/dist/core/scene/layerStack.js +131 -0
  368. package/dist/core/scene/layerStack.js.map +1 -0
  369. package/dist/core/scene/layoutPass.js +58 -59
  370. package/dist/core/scene/layoutPass.js.map +1 -1
  371. package/dist/core/scene/lockGuard.js +37 -0
  372. package/dist/core/scene/lockGuard.js.map +1 -0
  373. package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
  374. package/dist/core/scene/nestedHit.js.map +1 -0
  375. package/dist/core/scene/nodeFnFields.js +10 -11
  376. package/dist/core/scene/nodeFnFields.js.map +1 -1
  377. package/dist/core/scene/nodeMemo.js +45 -19
  378. package/dist/core/scene/nodeMemo.js.map +1 -1
  379. package/dist/core/scene/nodeStore.js +127 -0
  380. package/dist/core/scene/nodeStore.js.map +1 -0
  381. package/dist/core/scene/notifier.js +37 -0
  382. package/dist/core/scene/notifier.js.map +1 -0
  383. package/dist/core/scene/opTable.js +50 -0
  384. package/dist/core/scene/opTable.js.map +1 -0
  385. package/dist/core/scene/outerOps.js +66 -0
  386. package/dist/core/scene/outerOps.js.map +1 -0
  387. package/dist/core/scene/poseFeed.js +38 -38
  388. package/dist/core/scene/poseFeed.js.map +1 -1
  389. package/dist/core/scene/poseHold.js +39 -0
  390. package/dist/core/scene/poseHold.js.map +1 -0
  391. package/dist/core/scene/poseOverrides.js +44 -40
  392. package/dist/core/scene/poseOverrides.js.map +1 -1
  393. package/dist/core/scene/poseSnapshot.js.map +1 -1
  394. package/dist/core/scene/reconcileSpecs.js +3 -2
  395. package/dist/core/scene/reconcileSpecs.js.map +1 -1
  396. package/dist/core/scene/recorder.js +86 -0
  397. package/dist/core/scene/recorder.js.map +1 -0
  398. package/dist/core/scene/renderOrder.js +84 -0
  399. package/dist/core/scene/renderOrder.js.map +1 -0
  400. package/dist/core/scene/scene.js +80 -1266
  401. package/dist/core/scene/scene.js.map +1 -1
  402. package/dist/core/scene/sceneEdits.js +58 -0
  403. package/dist/core/scene/sceneEdits.js.map +1 -0
  404. package/dist/core/scene/sceneMutators.js +49 -0
  405. package/dist/core/scene/sceneMutators.js.map +1 -0
  406. package/dist/core/scene/scenePoseAdapter.js +16 -0
  407. package/dist/core/scene/scenePoseAdapter.js.map +1 -0
  408. package/dist/core/scene/sceneRecording.js +90 -0
  409. package/dist/core/scene/sceneRecording.js.map +1 -0
  410. package/dist/core/scene/sceneSelection.js +28 -0
  411. package/dist/core/scene/sceneSelection.js.map +1 -0
  412. package/dist/core/scene/sceneState.js +49 -0
  413. package/dist/core/scene/sceneState.js.map +1 -0
  414. package/dist/core/scene/serialization.js +71 -0
  415. package/dist/core/scene/serialization.js.map +1 -0
  416. package/dist/core/scene/staleReplay.js +51 -0
  417. package/dist/core/scene/staleReplay.js.map +1 -0
  418. package/dist/core/scene/statedFields.js +9 -0
  419. package/dist/core/scene/statedFields.js.map +1 -0
  420. package/dist/core/scene/treeEdits.js +127 -0
  421. package/dist/core/scene/treeEdits.js.map +1 -0
  422. package/dist/core/scene/treeOrder.js +13 -0
  423. package/dist/core/scene/treeOrder.js.map +1 -0
  424. package/dist/core/scene/treeReads.js +26 -0
  425. package/dist/core/scene/treeReads.js.map +1 -0
  426. package/dist/core/scene/types.js.map +1 -1
  427. package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
  428. package/dist/core/scene/unionOfChildren.js.map +1 -0
  429. package/dist/core/scene/unitScopes.js +13 -0
  430. package/dist/core/scene/unitScopes.js.map +1 -0
  431. package/dist/core/scene/useScene.js.map +1 -1
  432. package/dist/core/selection/readOnlySelection.js +32 -0
  433. package/dist/core/selection/readOnlySelection.js.map +1 -0
  434. package/dist/core/selection/usePublishSceneSelection.js +26 -0
  435. package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
  436. package/dist/core/selection/useSelection.js +34 -25
  437. package/dist/core/selection/useSelection.js.map +1 -1
  438. package/dist/core/shapeKinds.js.map +1 -1
  439. package/dist/core/stylus/stylus.js.map +1 -1
  440. package/dist/core/stylus/usePointerStylus.js.map +1 -1
  441. package/dist/core/usePaintKinds.js +1 -1
  442. package/dist/core/usePaintKinds.js.map +1 -1
  443. package/dist/core/viewport/clientToWorld.js.map +1 -1
  444. package/dist/core/viewport/fitViewToBounds.js.map +1 -1
  445. package/dist/core/viewport/parallax.js.map +1 -1
  446. package/dist/core/viewport/screenSlop.js +11 -11
  447. package/dist/core/viewport/screenSlop.js.map +1 -1
  448. package/dist/core/viewport/useCanvasSize.js.map +1 -1
  449. package/dist/core/viewport/useDecayLoop.js +8 -8
  450. package/dist/core/viewport/useDecayLoop.js.map +1 -1
  451. package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
  452. package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
  453. package/dist/core/viewport/useViewAnimation.js +102 -43
  454. package/dist/core/viewport/useViewAnimation.js.map +1 -1
  455. package/dist/core/viewport/view.js +9 -9
  456. package/dist/core/viewport/view.js.map +1 -1
  457. package/dist/core/viewport/wheelHandler.js.map +1 -1
  458. package/dist/core/viewport/zoomBounds.js +10 -8
  459. package/dist/core/viewport/zoomBounds.js.map +1 -1
  460. package/dist/{cornerHandles-BCrDp_mH.d.ts → cornerHandles-BEshc4z3.d.ts} +11 -24
  461. package/dist/debug/createDebugOverlayLayer.js +97 -97
  462. package/dist/debug/createDebugOverlayLayer.js.map +1 -1
  463. package/dist/debug/createDebugSink.js.map +1 -1
  464. package/dist/debug/flag.js +2 -41
  465. package/dist/debug/frameStats.js.map +1 -1
  466. package/dist/debug/useDebugSink.js +52 -0
  467. package/dist/debug/useDebugSink.js.map +1 -0
  468. package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
  469. package/dist/features/chrome-caps/conditions.js.map +1 -1
  470. package/dist/features/chrome-caps/defaults.js.map +1 -1
  471. package/dist/features/chrome-caps/resolve.js.map +1 -1
  472. package/dist/features/chrome-caps/useChromeCaps.js +54 -0
  473. package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
  474. package/dist/features/chrome-caps/useHoverTracking.js +22 -17
  475. package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
  476. package/dist/features/ingestion/contentHandlers.js +28 -19
  477. package/dist/features/ingestion/contentHandlers.js.map +1 -1
  478. package/dist/features/ingestion/imageHandler.js +21 -24
  479. package/dist/features/ingestion/imageHandler.js.map +1 -1
  480. package/dist/features/ingestion/openFilePicker.js.map +1 -1
  481. package/dist/features/ingestion/placement.js +16 -0
  482. package/dist/features/ingestion/placement.js.map +1 -0
  483. package/dist/features/ingestion/registerKitHandlers.js +7 -7
  484. package/dist/features/ingestion/svgHandler.js +5 -0
  485. package/dist/features/ingestion/svgHandler.js.map +1 -1
  486. package/dist/features/ingestion/textHandler.js +28 -0
  487. package/dist/features/ingestion/textHandler.js.map +1 -0
  488. package/dist/features/ingestion/useCanvasIngestion.js +48 -0
  489. package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
  490. package/dist/features/ingestion/weaselJsonHandler.js +22 -14
  491. package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
  492. package/dist/features/longPress/longPressFeedback.js.map +1 -1
  493. package/dist/features/modes/modeLayers.js +7 -7
  494. package/dist/features/modes/modeLayers.js.map +1 -1
  495. package/dist/features/paths/editablePath.js +47 -0
  496. package/dist/features/paths/editablePath.js.map +1 -0
  497. package/dist/features/paths/index.js +9 -14
  498. package/dist/features/paths/pathEditState.js +41 -0
  499. package/dist/features/paths/pathEditState.js.map +1 -0
  500. package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
  501. package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
  502. package/dist/features/paths/pathLayer.js +3 -2
  503. package/dist/features/paths/pathLayer.js.map +1 -1
  504. package/dist/features/paths/penPreviewLayer.js +86 -88
  505. package/dist/features/paths/penPreviewLayer.js.map +1 -1
  506. package/dist/features/paths/usePathEdit.js +34 -0
  507. package/dist/features/paths/usePathEdit.js.map +1 -0
  508. package/dist/features/poseRun/usePoseRun.js +44 -52
  509. package/dist/features/poseRun/usePoseRun.js.map +1 -1
  510. package/dist/features/selection/overlay.js +171 -179
  511. package/dist/features/selection/overlay.js.map +1 -1
  512. package/dist/features/text/index.js +6 -0
  513. package/dist/features/text/textLayer.js +1 -1
  514. package/dist/features/text/textLayer.js.map +1 -1
  515. package/dist/features/text/useSceneTextEdit.js +100 -93
  516. package/dist/features/text/useSceneTextEdit.js.map +1 -1
  517. package/dist/features/viewports/viewportLayer.js +25 -36
  518. package/dist/features/viewports/viewportLayer.js.map +1 -1
  519. package/dist/index.d.ts +8473 -9141
  520. package/dist/index.js +269 -307
  521. package/dist/input/keyState.js +38 -39
  522. package/dist/input/keyState.js.map +1 -1
  523. package/dist/input/useKeyModifiers.js +11 -0
  524. package/dist/input/useKeyModifiers.js.map +1 -0
  525. package/dist/interactions/actions/actionShortcuts.js.map +1 -1
  526. package/dist/interactions/actions/{defaults/align.js → align/action.js} +18 -20
  527. package/dist/interactions/actions/align/action.js.map +1 -0
  528. package/dist/interactions/actions/align/align.js +20 -20
  529. package/dist/interactions/actions/align/align.js.map +1 -1
  530. package/dist/interactions/actions/booleans/action.js +65 -0
  531. package/dist/interactions/actions/booleans/action.js.map +1 -0
  532. package/dist/interactions/actions/booleans/booleans.js +69 -78
  533. package/dist/interactions/actions/booleans/booleans.js.map +1 -1
  534. package/dist/interactions/actions/booleans/operands.js +40 -0
  535. package/dist/interactions/actions/booleans/operands.js.map +1 -0
  536. package/dist/interactions/actions/booleans/pieces.js +45 -0
  537. package/dist/interactions/actions/booleans/pieces.js.map +1 -0
  538. package/dist/interactions/actions/booleans/placement.js +24 -0
  539. package/dist/interactions/actions/booleans/placement.js.map +1 -0
  540. package/dist/interactions/actions/booleans/useBooleans.js +11 -9
  541. package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
  542. package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
  543. package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +31 -15
  544. package/dist/interactions/actions/clipboard/action.js.map +1 -0
  545. package/dist/interactions/actions/clipboard/clipboardOps.js +44 -42
  546. package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
  547. package/dist/interactions/actions/clipboard/materializePaste.js +10 -7
  548. package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
  549. package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
  550. package/dist/interactions/actions/clone/action.js +98 -0
  551. package/dist/interactions/actions/clone/action.js.map +1 -0
  552. package/dist/interactions/actions/clone/behaviors.js +52 -0
  553. package/dist/interactions/actions/clone/behaviors.js.map +1 -0
  554. package/dist/interactions/actions/defaultCommitAdapter.js +7 -32
  555. package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
  556. package/dist/interactions/actions/defaults/anchorEditing.js +60 -84
  557. package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
  558. package/dist/interactions/actions/defaults/areaSelect.js +35 -38
  559. package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
  560. package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
  561. package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
  562. package/dist/interactions/actions/defaults/copySubtree.js +40 -0
  563. package/dist/interactions/actions/defaults/copySubtree.js.map +1 -0
  564. package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
  565. package/dist/interactions/actions/defaults/delete.js.map +1 -1
  566. package/dist/interactions/actions/defaults/duplicate.js +13 -53
  567. package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
  568. package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
  569. package/dist/interactions/actions/defaults/group.js +40 -50
  570. package/dist/interactions/actions/defaults/group.js.map +1 -1
  571. package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
  572. package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
  573. package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
  574. package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
  575. package/dist/interactions/actions/defaults/ingest.js +44 -38
  576. package/dist/interactions/actions/defaults/ingest.js.map +1 -1
  577. package/dist/interactions/actions/defaults/insertPathAnchor.js +11 -12
  578. package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
  579. package/dist/interactions/actions/defaults/nudge.js +40 -69
  580. package/dist/interactions/actions/defaults/nudge.js.map +1 -1
  581. package/dist/interactions/actions/defaults/nudgeSteps.js +37 -0
  582. package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -0
  583. package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
  584. package/dist/interactions/actions/defaults/reorder.js +2 -0
  585. package/dist/interactions/actions/defaults/reorder.js.map +1 -1
  586. package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
  587. package/dist/interactions/actions/defaults/setFill.js +14 -8
  588. package/dist/interactions/actions/defaults/setFill.js.map +1 -1
  589. package/dist/interactions/actions/defaults/setFillOpacity.js +7 -4
  590. package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
  591. package/dist/interactions/actions/defaults/setStroke.js +12 -12
  592. package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
  593. package/dist/interactions/actions/defaults/setStrokeOpacity.js +6 -6
  594. package/dist/interactions/actions/defaults/sliceOps.js +8 -10
  595. package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
  596. package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
  597. package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
  598. package/dist/interactions/actions/defaults/viewportDragPan.js +37 -26
  599. package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
  600. package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
  601. package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
  602. package/dist/interactions/actions/distribute/action.js +66 -0
  603. package/dist/interactions/actions/distribute/action.js.map +1 -0
  604. package/dist/interactions/actions/distribute/distribute.js +11 -11
  605. package/dist/interactions/actions/distribute/distribute.js.map +1 -1
  606. package/dist/interactions/actions/{defaults/editAnchors.js → edit-anchors/action.js} +7 -9
  607. package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
  608. package/dist/interactions/actions/edit-anchors/geometry.js +30 -27
  609. package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
  610. package/dist/interactions/actions/flip/action.js +124 -0
  611. package/dist/interactions/actions/flip/action.js.map +1 -0
  612. package/dist/interactions/actions/flip/helpers.js +30 -17
  613. package/dist/interactions/actions/flip/helpers.js.map +1 -1
  614. package/dist/interactions/actions/gestureFrames.js +18 -0
  615. package/dist/interactions/actions/gestureFrames.js.map +1 -0
  616. package/dist/interactions/actions/gestureLifecycle.js +47 -20
  617. package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
  618. package/dist/interactions/actions/hitSelection.js +8 -0
  619. package/dist/interactions/actions/hitSelection.js.map +1 -0
  620. package/dist/interactions/actions/insert/action.js +72 -0
  621. package/dist/interactions/actions/insert/action.js.map +1 -0
  622. package/dist/interactions/actions/insert/commit.js +28 -0
  623. package/dist/interactions/actions/insert/commit.js.map +1 -0
  624. package/dist/interactions/actions/insert/extras.js +65 -0
  625. package/dist/interactions/actions/insert/extras.js.map +1 -0
  626. package/dist/interactions/actions/insert/frame.js +48 -0
  627. package/dist/interactions/actions/insert/frame.js.map +1 -0
  628. package/dist/interactions/actions/insert/geometry.js +35 -0
  629. package/dist/interactions/actions/insert/geometry.js.map +1 -0
  630. package/dist/interactions/actions/insert/rotateAction.js +21 -0
  631. package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
  632. package/dist/interactions/actions/insert/session.js +59 -0
  633. package/dist/interactions/actions/insert/session.js.map +1 -0
  634. package/dist/interactions/actions/insert/shape.js +34 -0
  635. package/dist/interactions/actions/insert/shape.js.map +1 -0
  636. package/dist/interactions/actions/lasso-select/action.js +143 -0
  637. package/dist/interactions/actions/lasso-select/action.js.map +1 -0
  638. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +14 -18
  639. package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
  640. package/dist/interactions/actions/move/action.js +87 -0
  641. package/dist/interactions/actions/move/action.js.map +1 -0
  642. package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
  643. package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
  644. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
  645. package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
  646. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +5 -5
  647. package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -1
  648. package/dist/interactions/actions/move/behaviors/snapToContainer.js +39 -27
  649. package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
  650. package/dist/interactions/actions/move/capture.js +99 -0
  651. package/dist/interactions/actions/move/capture.js.map +1 -0
  652. package/dist/interactions/actions/move/commit/index.js +41 -0
  653. package/dist/interactions/actions/move/commit/index.js.map +1 -0
  654. package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
  655. package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
  656. package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
  657. package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
  658. package/dist/interactions/actions/move/commit/rebase.js +18 -0
  659. package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
  660. package/dist/interactions/actions/move/commit/reparent.js +65 -0
  661. package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
  662. package/dist/interactions/actions/move/delta.js +51 -0
  663. package/dist/interactions/actions/move/delta.js.map +1 -0
  664. package/dist/interactions/actions/move/frame.js +59 -0
  665. package/dist/interactions/actions/move/frame.js.map +1 -0
  666. package/dist/interactions/actions/move/gestureAdapter.js +22 -30
  667. package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
  668. package/dist/interactions/actions/move/landedDescendants.js +33 -0
  669. package/dist/interactions/actions/move/landedDescendants.js.map +1 -0
  670. package/dist/interactions/actions/move/layout/container.js +94 -0
  671. package/dist/interactions/actions/move/layout/container.js.map +1 -0
  672. package/dist/interactions/actions/move/layout/dragged.js +58 -0
  673. package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
  674. package/dist/interactions/actions/move/layout/dropPass.js +122 -0
  675. package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
  676. package/dist/interactions/actions/move/layout/exits.js +38 -0
  677. package/dist/interactions/actions/move/layout/exits.js.map +1 -0
  678. package/dist/interactions/actions/move/layout/glide.js +48 -0
  679. package/dist/interactions/actions/move/layout/glide.js.map +1 -0
  680. package/dist/interactions/actions/move/session.js +63 -0
  681. package/dist/interactions/actions/move/session.js.map +1 -0
  682. package/dist/interactions/actions/move/translate.js +61 -0
  683. package/dist/interactions/actions/move/translate.js.map +1 -0
  684. package/dist/interactions/actions/outlines/createOutlines.js +16 -63
  685. package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
  686. package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
  687. package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
  688. package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
  689. package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
  690. package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
  691. package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
  692. package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
  693. package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
  694. package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
  695. package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
  696. package/dist/interactions/actions/planeInput.js.map +1 -1
  697. package/dist/interactions/actions/pointerState.js +12 -0
  698. package/dist/interactions/actions/pointerState.js.map +1 -0
  699. package/dist/interactions/actions/poseDescriptorDep.js +16 -4
  700. package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
  701. package/dist/interactions/actions/poseFrame.js +25 -20
  702. package/dist/interactions/actions/poseFrame.js.map +1 -1
  703. package/dist/interactions/actions/resize/action.js +55 -0
  704. package/dist/interactions/actions/resize/action.js.map +1 -0
  705. package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
  706. package/dist/interactions/actions/resize/boxFrame.js +16 -0
  707. package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
  708. package/dist/interactions/actions/resize/capture.js +85 -0
  709. package/dist/interactions/actions/resize/capture.js.map +1 -0
  710. package/dist/interactions/actions/resize/commit.js +69 -0
  711. package/dist/interactions/actions/resize/commit.js.map +1 -0
  712. package/dist/interactions/actions/resize/frame.js +74 -0
  713. package/dist/interactions/actions/resize/frame.js.map +1 -0
  714. package/dist/interactions/actions/resize/pointSnap.js +111 -0
  715. package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
  716. package/dist/interactions/actions/resize/ruleBounds.js +9 -0
  717. package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
  718. package/dist/interactions/actions/resize/session.js +49 -0
  719. package/dist/interactions/actions/resize/session.js.map +1 -0
  720. package/dist/interactions/actions/resolveOverlays.js.map +1 -1
  721. package/dist/interactions/actions/resolvePreviews.js.map +1 -1
  722. package/dist/interactions/actions/rotate/action.js +56 -0
  723. package/dist/interactions/actions/rotate/action.js.map +1 -0
  724. package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
  725. package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
  726. package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
  727. package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
  728. package/dist/interactions/actions/rotate/commit.js +40 -0
  729. package/dist/interactions/actions/rotate/commit.js.map +1 -0
  730. package/dist/interactions/actions/rotate/frame.js +65 -0
  731. package/dist/interactions/actions/rotate/frame.js.map +1 -0
  732. package/dist/interactions/actions/rotate/handle.js +12 -12
  733. package/dist/interactions/actions/rotate/handle.js.map +1 -1
  734. package/dist/interactions/actions/rotate/session.js +92 -0
  735. package/dist/interactions/actions/rotate/session.js.map +1 -0
  736. package/dist/interactions/actions/selectionSubtree.js +69 -0
  737. package/dist/interactions/actions/selectionSubtree.js.map +1 -0
  738. package/dist/interactions/actions/spatialReference.js.map +1 -1
  739. package/dist/interactions/actions/useStandardActions.js +87 -78
  740. package/dist/interactions/actions/useStandardActions.js.map +1 -1
  741. package/dist/interactions/gestures/dragGesture/dragGesture.js +4 -7
  742. package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -1
  743. package/dist/interactions/gestures/dragGesture/dragPointOf.js +23 -0
  744. package/dist/interactions/gestures/dragGesture/dragPointOf.js.map +1 -0
  745. package/dist/interactions/gestures/handleDrag/handleDrag.js +21 -26
  746. package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -1
  747. package/dist/interactions/gestures/pointerDrag/pointerDrag.js +62 -41
  748. package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
  749. package/dist/interactions/gestures/shared/originProjection.js +1 -1
  750. package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
  751. package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
  752. package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
  753. package/dist/interactions/gestures/shared/snap.js.map +1 -1
  754. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +8 -4
  755. package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -1
  756. package/dist/layout/arrivals.js +20 -23
  757. package/dist/layout/arrivals.js.map +1 -1
  758. package/dist/math-CYUjoyyU.d.ts +33 -0
  759. package/dist/math.d.ts +5 -3
  760. package/dist/math.js +6 -6
  761. package/dist/mesh.d.ts +4 -268
  762. package/dist/mesh.js +3 -7
  763. package/dist/move.d.ts +14 -11
  764. package/dist/{originProjection-DEklpDc_.d.ts → originProjection-PPT88jZv.d.ts} +1 -1
  765. package/dist/patterns-builtin.d.ts +1 -118
  766. package/dist/patterns-builtin.js +2 -3
  767. package/dist/{poseDescriptor-D-OH-tu5.d.ts → poseDescriptor-Bqk-11Rl.d.ts} +26 -36
  768. package/dist/renderer.d.ts +1 -91
  769. package/dist/renderer.js +2 -18
  770. package/dist/resize.d.ts +10 -22
  771. package/dist/resize.js +6 -6
  772. package/dist/style.css +1 -1
  773. package/dist/test-hook/install.js +12 -6
  774. package/dist/test-hook/install.js.map +1 -1
  775. package/dist/test-hook/useTestHook.js +22 -0
  776. package/dist/test-hook/useTestHook.js.map +1 -0
  777. package/dist/test-seams-D0pyV3pR.d.ts +149 -0
  778. package/dist/test-seams.d.ts +4 -4
  779. package/dist/test-seams.js +2 -2
  780. package/dist/tools/builtin/bone/boneActions.js +130 -0
  781. package/dist/tools/builtin/bone/boneActions.js.map +1 -0
  782. package/dist/tools/builtin/bone/boneOverlay.js +58 -0
  783. package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
  784. package/dist/tools/builtin/bone/placedRig.js +24 -0
  785. package/dist/tools/builtin/bone/placedRig.js.map +1 -0
  786. package/dist/tools/builtin/bone/rigEditState.js +21 -0
  787. package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
  788. package/dist/tools/builtin/bone/useBoneTool.js +98 -0
  789. package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
  790. package/dist/tools/builtin/ellipse/useEllipseTool.js +1 -0
  791. package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
  792. package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
  793. package/dist/tools/builtin/hand/useHandTool.js +1 -0
  794. package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
  795. package/dist/tools/builtin/image/useImageTool.js.map +1 -1
  796. package/dist/tools/builtin/lasso/useLassoTool.js +11 -11
  797. package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
  798. package/dist/tools/builtin/line/useLineTool.js +1 -0
  799. package/dist/tools/builtin/line/useLineTool.js.map +1 -1
  800. package/dist/tools/builtin/pen/usePenTool.js +198 -150
  801. package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
  802. package/dist/tools/builtin/pencil/usePencilTool.js +1 -0
  803. package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
  804. package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
  805. package/dist/tools/builtin/polygon/usePolygonTool.js +13 -8
  806. package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
  807. package/dist/tools/builtin/rect/useRectTool.js +1 -0
  808. package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
  809. package/dist/tools/builtin/select/adapterPointQuery.js +36 -0
  810. package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
  811. package/dist/tools/builtin/select/selectionContributions.js +25 -24
  812. package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
  813. package/dist/tools/builtin/select/useSelectTool.js +42 -67
  814. package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
  815. package/dist/tools/builtin/shared/pointerFollower.js +17 -0
  816. package/dist/tools/builtin/shared/pointerFollower.js.map +1 -0
  817. package/dist/tools/builtin/slice/useSliceTool.js +72 -82
  818. package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
  819. package/dist/tools/builtin/star/useStarTool.js +22 -16
  820. package/dist/tools/builtin/star/useStarTool.js.map +1 -1
  821. package/dist/tools/builtin/text/useTextTool.js +9 -0
  822. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  823. package/dist/tools/builtin/weight/useWeightTool.js +77 -0
  824. package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
  825. package/dist/tools/builtin/weight/weightActions.js +112 -0
  826. package/dist/tools/builtin/weight/weightActions.js.map +1 -0
  827. package/dist/tools/builtin/weight/weightOverlay.js +61 -0
  828. package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
  829. package/dist/tools/overlayBinding.js.map +1 -1
  830. package/dist/tools/useKeybindings.js +12 -22
  831. package/dist/tools/useKeybindings.js.map +1 -1
  832. package/dist/{types-A37hYkeR.d.ts → types-CIKDwlsP.d.ts} +113 -169
  833. package/dist/util/color.js +3 -3
  834. package/dist/util/color.js.map +1 -1
  835. package/dist/util/paint.js +1 -1
  836. package/dist/util/paint.js.map +1 -1
  837. package/dist/version.js +1 -1
  838. package/package.json +28 -21
  839. package/dist/animation/colorHelpers.js +0 -135
  840. package/dist/animation/colorHelpers.js.map +0 -1
  841. package/dist/animation/colorRegistry.js +0 -37
  842. package/dist/animation/colorRegistry.js.map +0 -1
  843. package/dist/animation/engine/axes.js +0 -36
  844. package/dist/animation/engine/axes.js.map +0 -1
  845. package/dist/animation/engine/codec.js +0 -170
  846. package/dist/animation/engine/codec.js.map +0 -1
  847. package/dist/animation/engine/integrator.js +0 -12
  848. package/dist/animation/engine/integrator.js.map +0 -1
  849. package/dist/animation/loop.js +0 -62
  850. package/dist/animation/loop.js.map +0 -1
  851. package/dist/animation/observe.js +0 -23
  852. package/dist/animation/observe.js.map +0 -1
  853. package/dist/animation/rig/blendPoses.js +0 -43
  854. package/dist/animation/rig/blendPoses.js.map +0 -1
  855. package/dist/animation/rig/mirrorPose.js +0 -19
  856. package/dist/animation/rig/mirrorPose.js.map +0 -1
  857. package/dist/animation/rig/resolveSkeleton.js +0 -33
  858. package/dist/animation/rig/resolveSkeleton.js.map +0 -1
  859. package/dist/animation/rig/solveIk.js +0 -103
  860. package/dist/animation/rig/solveIk.js.map +0 -1
  861. package/dist/animation/rig/types.js +0 -12
  862. package/dist/animation/rig/types.js.map +0 -1
  863. package/dist/animation/slew.js +0 -27
  864. package/dist/animation/slew.js.map +0 -1
  865. package/dist/animation/stagger.js +0 -138
  866. package/dist/animation/stagger.js.map +0 -1
  867. package/dist/animation/timeline/booking.js +0 -106
  868. package/dist/animation/timeline/booking.js.map +0 -1
  869. package/dist/animation/timeline/createTimeline.js +0 -116
  870. package/dist/animation/timeline/createTimeline.js.map +0 -1
  871. package/dist/animation/timeline/sampleTrack.js +0 -71
  872. package/dist/animation/timeline/sampleTrack.js.map +0 -1
  873. package/dist/animation/useAnimator.js +0 -378
  874. package/dist/animation/useAnimator.js.map +0 -1
  875. package/dist/builtins-C-VgUlWI.d.ts +0 -4514
  876. package/dist/canvas/MinimapCanvas.js +0 -139
  877. package/dist/canvas/MinimapCanvas.js.map +0 -1
  878. package/dist/canvas/deps/poseComposition.js +0 -11
  879. package/dist/canvas/deps/poseComposition.js.map +0 -1
  880. package/dist/canvas/minimapMath.js +0 -80
  881. package/dist/canvas/minimapMath.js.map +0 -1
  882. package/dist/canvas/toolPreview.js +0 -39
  883. package/dist/canvas/toolPreview.js.map +0 -1
  884. package/dist/core/adapters/arrayAdapter.js +0 -85
  885. package/dist/core/adapters/arrayAdapter.js.map +0 -1
  886. package/dist/core/adapters/useArrayAdapter.js +0 -13
  887. package/dist/core/adapters/useArrayAdapter.js.map +0 -1
  888. package/dist/core/fillInPoseFrame.js +0 -102
  889. package/dist/core/fillInPoseFrame.js.map +0 -1
  890. package/dist/core/geometry/poseRotation.js +0 -58
  891. package/dist/core/geometry/poseRotation.js.map +0 -1
  892. package/dist/core/gradient.js +0 -136
  893. package/dist/core/gradient.js.map +0 -1
  894. package/dist/core/isPlainObject.js.map +0 -1
  895. package/dist/core/markerInset.js +0 -24
  896. package/dist/core/markerInset.js.map +0 -1
  897. package/dist/core/mixed.js +0 -6
  898. package/dist/core/mixed.js.map +0 -1
  899. package/dist/core/paintKinds.js +0 -156
  900. package/dist/core/paintKinds.js.map +0 -1
  901. package/dist/core/strokeMarkerShapes.js +0 -139
  902. package/dist/core/strokeMarkerShapes.js.map +0 -1
  903. package/dist/core/strokeMarkers.js +0 -28
  904. package/dist/core/strokeMarkers.js.map +0 -1
  905. package/dist/core/viewport/meanScale.js +0 -8
  906. package/dist/core/viewport/meanScale.js.map +0 -1
  907. package/dist/core/viewport/pxExtent.js +0 -42
  908. package/dist/core/viewport/pxExtent.js.map +0 -1
  909. package/dist/debug/flag.js.map +0 -1
  910. package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
  911. package/dist/features/focus/gateLayer.js +0 -14
  912. package/dist/features/focus/gateLayer.js.map +0 -1
  913. package/dist/features/focus/useCanvasFocus.js +0 -29
  914. package/dist/features/focus/useCanvasFocus.js.map +0 -1
  915. package/dist/features/groups/children.js.map +0 -1
  916. package/dist/features/groups/composePose.js.map +0 -1
  917. package/dist/features/groups/nestedHit.js.map +0 -1
  918. package/dist/features/groups/unionOfChildren.js.map +0 -1
  919. package/dist/features/images/imageCache.js +0 -94
  920. package/dist/features/images/imageCache.js.map +0 -1
  921. package/dist/features/ingestion/index.js +0 -8
  922. package/dist/features/meshPaint/bake.js +0 -79
  923. package/dist/features/meshPaint/bake.js.map +0 -1
  924. package/dist/features/meshPaint/bakeCache.js +0 -59
  925. package/dist/features/meshPaint/bakeCache.js.map +0 -1
  926. package/dist/features/meshPaint/handles.js +0 -86
  927. package/dist/features/meshPaint/handles.js.map +0 -1
  928. package/dist/features/meshPaint/lazyKind.js.map +0 -1
  929. package/dist/features/meshPaint/meshPaint.js +0 -236
  930. package/dist/features/meshPaint/meshPaint.js.map +0 -1
  931. package/dist/features/meshPaint/meshShader.js +0 -6
  932. package/dist/features/meshPaint/meshShader.js.map +0 -1
  933. package/dist/features/meshPaint/register.js +0 -7
  934. package/dist/features/meshPaint/register.js.map +0 -1
  935. package/dist/features/meshPaint/surface.js +0 -110
  936. package/dist/features/meshPaint/surface.js.map +0 -1
  937. package/dist/features/minimap/actions.js +0 -53
  938. package/dist/features/minimap/actions.js.map +0 -1
  939. package/dist/features/minimap/createMinimapContribution.js +0 -96
  940. package/dist/features/minimap/createMinimapContribution.js.map +0 -1
  941. package/dist/features/minimap/layers.js +0 -103
  942. package/dist/features/minimap/layers.js.map +0 -1
  943. package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
  944. package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
  945. package/dist/features/parallax/createParallaxLayer.js +0 -26
  946. package/dist/features/parallax/createParallaxLayer.js.map +0 -1
  947. package/dist/features/parallax/createParallaxPlane.js +0 -26
  948. package/dist/features/parallax/createParallaxPlane.js.map +0 -1
  949. package/dist/features/paths/anchorEdits.js +0 -156
  950. package/dist/features/paths/anchorEdits.js.map +0 -1
  951. package/dist/features/paths/anchors.js +0 -154
  952. package/dist/features/paths/anchors.js.map +0 -1
  953. package/dist/features/paths/booleans.js +0 -2
  954. package/dist/features/paths/markerCommands.js +0 -148
  955. package/dist/features/paths/markerCommands.js.map +0 -1
  956. package/dist/features/paths/markerSites.js +0 -59
  957. package/dist/features/paths/markerSites.js.map +0 -1
  958. package/dist/features/paths/markers.js +0 -95
  959. package/dist/features/paths/markers.js.map +0 -1
  960. package/dist/features/paths/nearestAnchor.js +0 -36
  961. package/dist/features/paths/nearestAnchor.js.map +0 -1
  962. package/dist/features/paths/pathInWorld.js +0 -41
  963. package/dist/features/paths/pathInWorld.js.map +0 -1
  964. package/dist/features/paths/poseDescriptor.js +0 -39
  965. package/dist/features/paths/poseDescriptor.js.map +0 -1
  966. package/dist/features/paths/tessellate/dash.js +0 -52
  967. package/dist/features/paths/tessellate/dash.js.map +0 -1
  968. package/dist/features/paths/tessellate/insets.js +0 -32
  969. package/dist/features/paths/tessellate/insets.js.map +0 -1
  970. package/dist/features/paths/tessellate/metric.js +0 -72
  971. package/dist/features/paths/tessellate/metric.js.map +0 -1
  972. package/dist/features/paths/tessellate/stroke.js +0 -170
  973. package/dist/features/paths/tessellate/stroke.js.map +0 -1
  974. package/dist/features/paths/tessellate/vertexWidths.js +0 -32
  975. package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
  976. package/dist/features/patterns/index.js +0 -23
  977. package/dist/features/patterns/index.js.map +0 -1
  978. package/dist/features/patterns/patterns-builtin.js +0 -38
  979. package/dist/features/patterns/patterns-builtin.js.map +0 -1
  980. package/dist/features/patterns/resolveSpec.js +0 -57
  981. package/dist/features/patterns/resolveSpec.js.map +0 -1
  982. package/dist/features/patterns/tileGeometry.js +0 -158
  983. package/dist/features/patterns/tileGeometry.js.map +0 -1
  984. package/dist/features/pointer/PointerContext.js +0 -45
  985. package/dist/features/pointer/PointerContext.js.map +0 -1
  986. package/dist/features/selection/SelectionContext.js +0 -46
  987. package/dist/features/selection/SelectionContext.js.map +0 -1
  988. package/dist/features/simulation/createSimulation.js +0 -61
  989. package/dist/features/simulation/createSimulation.js.map +0 -1
  990. package/dist/features/simulation/types.js +0 -6
  991. package/dist/features/simulation/types.js.map +0 -1
  992. package/dist/features/simulation/useSimulation.js +0 -74
  993. package/dist/features/simulation/useSimulation.js.map +0 -1
  994. package/dist/features/text/domRuns.js +0 -258
  995. package/dist/features/text/domRuns.js.map +0 -1
  996. package/dist/features/text/fitTextPose.js +0 -38
  997. package/dist/features/text/fitTextPose.js.map +0 -1
  998. package/dist/features/text/hitTest.js +0 -45
  999. package/dist/features/text/hitTest.js.map +0 -1
  1000. package/dist/features/text/renderLabel.js +0 -14
  1001. package/dist/features/text/renderLabel.js.map +0 -1
  1002. package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
  1003. package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
  1004. package/dist/features/text/runs/flagRange.js +0 -53
  1005. package/dist/features/text/runs/flagRange.js.map +0 -1
  1006. package/dist/features/text/runs/rangeStyle.js +0 -135
  1007. package/dist/features/text/runs/rangeStyle.js.map +0 -1
  1008. package/dist/features/text/textCommand.js +0 -59
  1009. package/dist/features/text/textCommand.js.map +0 -1
  1010. package/dist/features/text/textToPath.js +0 -181
  1011. package/dist/features/text/textToPath.js.map +0 -1
  1012. package/dist/features/text/useTextEdit.js +0 -467
  1013. package/dist/features/text/useTextEdit.js.map +0 -1
  1014. package/dist/features/tiling/createTiledLayer.js +0 -63
  1015. package/dist/features/tiling/createTiledLayer.js.map +0 -1
  1016. package/dist/features/tiling/tiledProject.js +0 -14
  1017. package/dist/features/tiling/tiledProject.js.map +0 -1
  1018. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
  1019. package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
  1020. package/dist/interactions/actions/defaults/align.js.map +0 -1
  1021. package/dist/interactions/actions/defaults/booleans.js +0 -52
  1022. package/dist/interactions/actions/defaults/booleans.js.map +0 -1
  1023. package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
  1024. package/dist/interactions/actions/defaults/clone.js +0 -107
  1025. package/dist/interactions/actions/defaults/clone.js.map +0 -1
  1026. package/dist/interactions/actions/defaults/createOutlines.js +0 -47
  1027. package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
  1028. package/dist/interactions/actions/defaults/distribute.js +0 -66
  1029. package/dist/interactions/actions/defaults/distribute.js.map +0 -1
  1030. package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
  1031. package/dist/interactions/actions/defaults/flip.js +0 -119
  1032. package/dist/interactions/actions/defaults/flip.js.map +0 -1
  1033. package/dist/interactions/actions/defaults/freshNodeId.js +0 -10
  1034. package/dist/interactions/actions/defaults/freshNodeId.js.map +0 -1
  1035. package/dist/interactions/actions/defaults/insert.js +0 -288
  1036. package/dist/interactions/actions/defaults/insert.js.map +0 -1
  1037. package/dist/interactions/actions/defaults/lassoSelect.js +0 -156
  1038. package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
  1039. package/dist/interactions/actions/defaults/move.js +0 -760
  1040. package/dist/interactions/actions/defaults/move.js.map +0 -1
  1041. package/dist/interactions/actions/defaults/resize.js +0 -335
  1042. package/dist/interactions/actions/defaults/resize.js.map +0 -1
  1043. package/dist/interactions/actions/defaults/rotate.js +0 -184
  1044. package/dist/interactions/actions/defaults/rotate.js.map +0 -1
  1045. package/dist/interactions/actions/previewOverrides.js +0 -25
  1046. package/dist/interactions/actions/previewOverrides.js.map +0 -1
  1047. package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
  1048. package/dist/math-Drrw4ewZ.d.ts +0 -160
  1049. package/dist/registerProgram-BMZRDgrh.d.ts +0 -197
  1050. package/dist/renderer/DrawCommand.js +0 -6
  1051. package/dist/renderer/DrawCommand.js.map +0 -1
  1052. package/dist/renderer/WeaselRenderer.js +0 -331
  1053. package/dist/renderer/WeaselRenderer.js.map +0 -1
  1054. package/dist/renderer/batchClip.js +0 -46
  1055. package/dist/renderer/batchClip.js.map +0 -1
  1056. package/dist/renderer/cache/GLImageCache.js +0 -64
  1057. package/dist/renderer/cache/GLImageCache.js.map +0 -1
  1058. package/dist/renderer/cache/GLMeshCache.js +0 -102
  1059. package/dist/renderer/cache/GLMeshCache.js.map +0 -1
  1060. package/dist/renderer/cache/GLTextureCache.js +0 -51
  1061. package/dist/renderer/cache/GLTextureCache.js.map +0 -1
  1062. package/dist/renderer/cache/GradientRampAtlas.js +0 -82
  1063. package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
  1064. package/dist/renderer/cache/cache.js +0 -13
  1065. package/dist/renderer/cache/cache.js.map +0 -1
  1066. package/dist/renderer/cache/markerCommandCache.js +0 -63
  1067. package/dist/renderer/cache/markerCommandCache.js.map +0 -1
  1068. package/dist/renderer/cache/outlineMeshCache.js +0 -15
  1069. package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
  1070. package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
  1071. package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
  1072. package/dist/renderer/cache/strokeMeshCache.js +0 -55
  1073. package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
  1074. package/dist/renderer/cullDrawCommands.js +0 -90
  1075. package/dist/renderer/cullDrawCommands.js.map +0 -1
  1076. package/dist/renderer/draw.js +0 -1135
  1077. package/dist/renderer/draw.js.map +0 -1
  1078. package/dist/renderer/drawBatch.js +0 -198
  1079. package/dist/renderer/drawBatch.js.map +0 -1
  1080. package/dist/renderer/effects/EffectTargets.js +0 -45
  1081. package/dist/renderer/effects/EffectTargets.js.map +0 -1
  1082. package/dist/renderer/effects/builtins.js +0 -31
  1083. package/dist/renderer/effects/builtins.js.map +0 -1
  1084. package/dist/renderer/effects/composite.js +0 -9
  1085. package/dist/renderer/effects/composite.js.map +0 -1
  1086. package/dist/renderer/effects/effectPrelude.js +0 -10
  1087. package/dist/renderer/effects/effectPrelude.js.map +0 -1
  1088. package/dist/renderer/effects/types.js +0 -10
  1089. package/dist/renderer/effects/types.js.map +0 -1
  1090. package/dist/renderer/glyphOutlineMesh.js +0 -67
  1091. package/dist/renderer/glyphOutlineMesh.js.map +0 -1
  1092. package/dist/renderer/index.js +0 -19
  1093. package/dist/renderer/math/color.js +0 -341
  1094. package/dist/renderer/math/color.js.map +0 -1
  1095. package/dist/renderer/math/mat3.js +0 -76
  1096. package/dist/renderer/math/mat3.js.map +0 -1
  1097. package/dist/renderer/math/patternSpace.js +0 -22
  1098. package/dist/renderer/math/patternSpace.js.map +0 -1
  1099. package/dist/renderer/math/viewToMat3.js +0 -19
  1100. package/dist/renderer/math/viewToMat3.js.map +0 -1
  1101. package/dist/renderer/paintResources.js +0 -18
  1102. package/dist/renderer/paintResources.js.map +0 -1
  1103. package/dist/renderer/paintScratch.js +0 -37
  1104. package/dist/renderer/paintScratch.js.map +0 -1
  1105. package/dist/renderer/shaders/ShaderProgram.js +0 -74
  1106. package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
  1107. package/dist/renderer/shaders/batchFill.js +0 -119
  1108. package/dist/renderer/shaders/batchFill.js.map +0 -1
  1109. package/dist/renderer/shaders/customPrelude.js +0 -34
  1110. package/dist/renderer/shaders/customPrelude.js.map +0 -1
  1111. package/dist/renderer/shaders/extractUniformNames.js +0 -184
  1112. package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
  1113. package/dist/renderer/shaders/glyphPaint.js +0 -61
  1114. package/dist/renderer/shaders/glyphPaint.js.map +0 -1
  1115. package/dist/renderer/shaders/gradFill.js +0 -30
  1116. package/dist/renderer/shaders/gradFill.js.map +0 -1
  1117. package/dist/renderer/shaders/imageFill.js +0 -14
  1118. package/dist/renderer/shaders/imageFill.js.map +0 -1
  1119. package/dist/renderer/shaders/pathFill.js +0 -13
  1120. package/dist/renderer/shaders/pathFill.js.map +0 -1
  1121. package/dist/renderer/shaders/patternFill.js +0 -24
  1122. package/dist/renderer/shaders/patternFill.js.map +0 -1
  1123. package/dist/renderer/shaders/registerProgram.js +0 -18
  1124. package/dist/renderer/shaders/registerProgram.js.map +0 -1
  1125. package/dist/renderer/spriteSheet.js +0 -14
  1126. package/dist/renderer/spriteSheet.js.map +0 -1
  1127. package/dist/renderer/state/GroupState.js +0 -77
  1128. package/dist/renderer/state/GroupState.js.map +0 -1
  1129. package/dist/renderer/strokeLengths.js +0 -50
  1130. package/dist/renderer/strokeLengths.js.map +0 -1
  1131. package/dist/renderer/syntheticItalic.js +0 -6
  1132. package/dist/renderer/syntheticItalic.js.map +0 -1
  1133. package/dist/renderer/textures/registerTexture.js +0 -14
  1134. package/dist/renderer/textures/registerTexture.js.map +0 -1
  1135. package/dist/scheduling/useVisibleRaf.js +0 -69
  1136. package/dist/scheduling/useVisibleRaf.js.map +0 -1
  1137. package/dist/test-seams-CuIxe0xY.d.ts +0 -356
  1138. package/dist/tools/prefs.js +0 -62
  1139. package/dist/tools/prefs.js.map +0 -1
@@ -1,7 +0,0 @@
1
- import { registerPaintKind as e } from "../../core/paintKinds.js";
2
- import { meshGradientKind as t } from "./meshPaint.js";
3
- //#region src/features/meshPaint/register.ts
4
- e(t);
5
- //#endregion
6
-
7
- //# sourceMappingURL=register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.js","names":["registerPaintKind","meshGradientKind"],"sources":["../../../src/features/meshPaint/register.ts"],"sourcesContent":["/** Registers the mesh-gradient kind at import; `@weasel-js/core/mesh` imports it for effect. */\nimport { registerPaintKind } from '../../core/paintKinds';\nimport { meshGradientKind } from './meshPaint';\n\nregisterPaintKind(meshGradientKind);\n"],"mappings":";;;AAIAA,EAAkBC,CAAgB"}
@@ -1,110 +0,0 @@
1
- //#region src/features/meshPaint/surface.ts
2
- function e(e, t) {
3
- return e.points[(t & 3) * 3];
4
- }
5
- function t(e) {
6
- return e.points.length >= 16;
7
- }
8
- function n(e) {
9
- return e.points.length === 12 || e.points.length === 16;
10
- }
11
- function r(e, t, n, r, i) {
12
- let a = 1 - i, o = a * a * a, s = 3 * a * a * i, c = 3 * a * i * i, l = i * i * i;
13
- return {
14
- x: o * e.x + s * t.x + c * n.x + l * r.x,
15
- y: o * e.y + s * t.y + c * n.y + l * r.y
16
- };
17
- }
18
- function i(e, t) {
19
- let n = e.points, r = (t & 3) * 3;
20
- return [
21
- n[r],
22
- n[r + 1],
23
- n[r + 2],
24
- n[(t + 1 & 3) * 3]
25
- ];
26
- }
27
- function a(e, n, r) {
28
- return t(e) ? l(e, n, r) : o(e, n, r);
29
- }
30
- function o(t, n, a) {
31
- let [o, s, c, l] = i(t, 0), [u, d, f, p] = i(t, 1), [m, h, g, _] = i(t, 2), [v, y, b, x] = i(t, 3), S = r(o, s, c, l, n), C = r(m, h, g, _, 1 - n), w = r(u, d, f, p, a), T = r(v, y, b, x, 1 - a), E = e(t, 0), D = e(t, 1), O = e(t, 2), k = e(t, 3), A = (e, t) => (1 - a) * e + a * t, j = (e, t) => (1 - n) * e + n * t, M = (e, t, r, i) => (1 - n) * (1 - a) * e + n * (1 - a) * t + n * a * r + (1 - n) * a * i;
32
- return {
33
- x: A(S.x, C.x) + j(T.x, w.x) - M(E.x, D.x, O.x, k.x),
34
- y: A(S.y, C.y) + j(T.y, w.y) - M(E.y, D.y, O.y, k.y)
35
- };
36
- }
37
- function s(e) {
38
- let t = e.points;
39
- return [
40
- [
41
- t[0],
42
- t[11],
43
- t[10],
44
- t[9]
45
- ],
46
- [
47
- t[1],
48
- t[12],
49
- t[13],
50
- t[8]
51
- ],
52
- [
53
- t[2],
54
- t[15],
55
- t[14],
56
- t[7]
57
- ],
58
- [
59
- t[3],
60
- t[4],
61
- t[5],
62
- t[6]
63
- ]
64
- ];
65
- }
66
- var c = (e) => {
67
- let t = 1 - e;
68
- return [
69
- t * t * t,
70
- 3 * t * t * e,
71
- 3 * t * e * e,
72
- e * e * e
73
- ];
74
- };
75
- function l(e, t, n) {
76
- let r = s(e), i = c(t), a = c(n), o = 0, l = 0;
77
- for (let e = 0; e < 4; e++) for (let t = 0; t < 4; t++) {
78
- let n = i[e] * a[t];
79
- o += n * r[e][t].x, l += n * r[e][t].y;
80
- }
81
- return {
82
- x: o,
83
- y: l
84
- };
85
- }
86
- function u(e, t) {
87
- return [
88
- (1 - e) * (1 - t),
89
- e * (1 - t),
90
- e * t,
91
- (1 - e) * t
92
- ];
93
- }
94
- function d(e, t = 8) {
95
- let n = Infinity, r = Infinity, i = -Infinity, o = -Infinity;
96
- for (let s = 0; s <= t; s++) for (let c = 0; c <= t; c++) {
97
- let l = a(e, s / t, c / t);
98
- l.x < n && (n = l.x), l.y < r && (r = l.y), l.x > i && (i = l.x), l.y > o && (o = l.y);
99
- }
100
- return {
101
- x: n,
102
- y: r,
103
- width: i - n,
104
- height: o - r
105
- };
106
- }
107
- //#endregion
108
- export { u as cornerWeights, a as evalPatch, t as isTensorPatch, n as isValidPatch, d as patchBounds, e as patchCorner };
109
-
110
- //# sourceMappingURL=surface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"surface.js","names":["patchCorner","patch","i","isTensorPatch","isValidPatch","bezier","s","t","a","b","d","p0","p1","p2","p3","edge","p","evalPatch","evalTensor","u","v","evalCoons","b0","b1","b2","b3","r0","r1","r2","r3","t0","t1","t2","t3","l0","l1","l2","l3","bottom","top","right","left","c0","c1","c2","c3","ruledU","ruledV","corner","k0","k1","k2","k3","tensorNet","BERNSTEIN","net","bu","bv","x","y","j","w","cornerWeights","patchBounds","minX","minY","maxX","maxY","steps"],"sources":["../../../src/features/meshPaint/surface.ts"],"sourcesContent":["/**\n * Coons and tensor-product patch surfaces — PDF's shading types 6 and 7, as\n * pure geometry.\n *\n * A patch is a curved quadrilateral: four cubic Bézier edges and a color at\n * each corner. The interior is what the edges imply — a Coons patch reads it\n * off the boundary alone; a tensor patch adds four interior control points\n * that pull it around. Both evaluate at a `(u, v)` in the unit square, which\n * is what lets the renderer subdivide a patch into as many triangles as it\n * wants without the patch knowing.\n *\n * Nothing here touches GL, a color string, or a scene. `evalPatch` is the\n * whole contract.\n */\n\n/** A point in the patch's own space. */\nexport interface MeshPoint {\n x: number;\n y: number;\n}\n\n/**\n * One patch.\n *\n * `points` walks the boundary: corner 0, the two control points of the edge\n * leaving it, corner 1, its two, and so on — twelve points, ending with the\n * two controls that return to corner 0. A tensor patch appends its four\n * interior points, in the order `(1,1)`, `(1,2)`, `(2,2)`, `(2,1)` of the\n * bicubic control net, which is PDF's own order.\n *\n * Twelve points is a Coons patch and sixteen is a tensor patch; there is no\n * flag, because the count already says which it is.\n *\n * `colors` are the corner colors in the same walk order, as whatever color\n * form the caller resolves — the renderer hands premultiplied RGBA in, the\n * serializer hands CSS strings.\n */\nexport interface MeshPatch<TColor = string> {\n points: readonly MeshPoint[];\n colors: readonly [TColor, TColor, TColor, TColor];\n}\n\n/** Corner `i` of the boundary walk. */\nexport function patchCorner(patch: MeshPatch<unknown>, i: number): MeshPoint {\n return patch.points[(i & 3) * 3];\n}\n\n/** `true` when the patch carries the four interior points a tensor patch adds. */\nexport function isTensorPatch(patch: MeshPatch<unknown>): boolean {\n return patch.points.length >= 16;\n}\n\n/** A patch is twelve boundary points, or sixteen with the interior. Anything\n * else cannot be evaluated, and saying so here beats painting nonsense. */\nexport function isValidPatch(patch: MeshPatch<unknown>): boolean {\n return patch.points.length === 12 || patch.points.length === 16;\n}\n\nfunction bezier(p0: MeshPoint, p1: MeshPoint, p2: MeshPoint, p3: MeshPoint, t: number): MeshPoint {\n const s = 1 - t;\n const a = s * s * s;\n const b = 3 * s * s * t;\n const c = 3 * s * t * t;\n const d = t * t * t;\n return {\n x: a * p0.x + b * p1.x + c * p2.x + d * p3.x,\n y: a * p0.y + b * p1.y + c * p2.y + d * p3.y,\n };\n}\n\n/** The edge leaving corner `i`, as its four control points. */\nfunction edge(patch: MeshPatch<unknown>, i: number): [MeshPoint, MeshPoint, MeshPoint, MeshPoint] {\n const p = patch.points;\n const a = (i & 3) * 3;\n return [p[a], p[a + 1], p[a + 2], p[((i + 1) & 3) * 3]];\n}\n\n/**\n * The patch surface at `(u, v)`, both in `0..1`.\n *\n * `u` runs along the edge leaving corner 0 and `v` along the edge leaving\n * corner 1, so `(0,0)` is corner 0, `(1,0)` corner 1, `(1,1)` corner 2 and\n * `(0,1)` corner 3 — the same walk `colors` is in.\n */\nexport function evalPatch(patch: MeshPatch<unknown>, u: number, v: number): MeshPoint {\n return isTensorPatch(patch) ? evalTensor(patch, u, v) : evalCoons(patch, u, v);\n}\n\nfunction evalCoons(patch: MeshPatch<unknown>, u: number, v: number): MeshPoint {\n const [b0, b1, b2, b3] = edge(patch, 0); // corner 0 → 1, along u at v=0\n const [r0, r1, r2, r3] = edge(patch, 1); // corner 1 → 2, along v at u=1\n const [t0, t1, t2, t3] = edge(patch, 2); // corner 2 → 3, along u at v=1\n const [l0, l1, l2, l3] = edge(patch, 3); // corner 3 → 0, along v at u=0\n\n const bottom = bezier(b0, b1, b2, b3, u);\n const top = bezier(t0, t1, t2, t3, 1 - u); // walks 2 → 3, so reverse it\n const right = bezier(r0, r1, r2, r3, v);\n const left = bezier(l0, l1, l2, l3, 1 - v); // walks 3 → 0, so reverse it\n\n const c0 = patchCorner(patch, 0);\n const c1 = patchCorner(patch, 1);\n const c2 = patchCorner(patch, 2);\n const c3 = patchCorner(patch, 3);\n\n // The Coons construction: the two ruled surfaces between opposite edges,\n // minus the bilinear surface through the corners they both already carry.\n const ruledU = (a: number, b: number): number => (1 - v) * a + v * b;\n const ruledV = (a: number, b: number): number => (1 - u) * a + u * b;\n const corner = (k0: number, k1: number, k2: number, k3: number): number =>\n (1 - u) * (1 - v) * k0 + u * (1 - v) * k1 + u * v * k2 + (1 - u) * v * k3;\n\n return {\n x: ruledU(bottom.x, top.x) + ruledV(left.x, right.x)\n - corner(c0.x, c1.x, c2.x, c3.x),\n y: ruledU(bottom.y, top.y) + ruledV(left.y, right.y)\n - corner(c0.y, c1.y, c2.y, c3.y),\n };\n}\n\n/** The bicubic control net a tensor patch's sixteen points make, as\n * `net[i][j]` with `i` along `u` and `j` along `v`. */\nfunction tensorNet(patch: MeshPatch<unknown>): MeshPoint[][] {\n const p = patch.points;\n // Boundary, read off the same walk; interior from the four trailing points.\n return [\n [p[0], p[11], p[10], p[9]],\n [p[1], p[12], p[13], p[8]],\n [p[2], p[15], p[14], p[7]],\n [p[3], p[4], p[5], p[6]],\n ];\n}\n\nconst BERNSTEIN = (t: number): [number, number, number, number] => {\n const s = 1 - t;\n return [s * s * s, 3 * s * s * t, 3 * s * t * t, t * t * t];\n};\n\nfunction evalTensor(patch: MeshPatch<unknown>, u: number, v: number): MeshPoint {\n const net = tensorNet(patch);\n const bu = BERNSTEIN(u);\n const bv = BERNSTEIN(v);\n let x = 0;\n let y = 0;\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n const w = bu[i] * bv[j];\n x += w * net[i][j].x;\n y += w * net[i][j].y;\n }\n }\n return { x, y };\n}\n\n/**\n * The four corner weights at `(u, v)` — bilinear, in the corner walk order.\n *\n * Color is separate from position on purpose: it interpolates in whatever\n * space the caller chose, which is not a thing the surface can do for it.\n */\nexport function cornerWeights(u: number, v: number): [number, number, number, number] {\n return [(1 - u) * (1 - v), u * (1 - v), u * v, (1 - u) * v];\n}\n\n/** Axis-aligned bounds of a patch, sampled on a grid. Control points alone\n * bound a Bézier but not tightly, and a mesh paint is baked into a texture\n * sized from this — a loose box wastes texels on every side. */\nexport function patchBounds(\n patch: MeshPatch<unknown>, steps = 8,\n): { x: number; y: number; width: number; height: number } {\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (let i = 0; i <= steps; i++) {\n for (let j = 0; j <= steps; j++) {\n const p = evalPatch(patch, i / steps, j / steps);\n if (p.x < minX) minX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.x > maxX) maxX = p.x;\n if (p.y > maxY) maxY = p.y;\n }\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n"],"mappings":"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"}
@@ -1,53 +0,0 @@
1
- //#region src/features/minimap/actions.ts
2
- var e = "minimap.center", t = "minimap.pan";
3
- function n(e, t, n) {
4
- let r = e.hostSize?.();
5
- if (!r) return;
6
- let i = e.get();
7
- e.set({
8
- x: t - r.width / (2 * i.scale.x),
9
- y: n - r.height / (2 * i.scale.y),
10
- scale: i.scale
11
- });
12
- }
13
- function r(e) {
14
- return e.rootView;
15
- }
16
- function i() {
17
- return {
18
- id: e,
19
- label: "Minimap — center the view here",
20
- requires: ["rootView"],
21
- invoker: {
22
- timing: "immediate",
23
- run: (e, t) => {
24
- let i = t, a = r(e);
25
- a && i?.worldX !== void 0 && i.worldY !== void 0 && n(a, i.worldX, i.worldY);
26
- }
27
- }
28
- };
29
- }
30
- function a() {
31
- return {
32
- id: t,
33
- label: "Minimap — pan the view",
34
- requires: ["rootView"],
35
- invoker: {
36
- timing: "ongoing",
37
- start(e) {
38
- let t = r(e.deps);
39
- return t ? {
40
- onMove: (e) => {
41
- let r = e.drag?.current ?? e.world;
42
- n(t, r.x, r.y);
43
- },
44
- onEnd: () => {}
45
- } : {};
46
- }
47
- }
48
- };
49
- }
50
- //#endregion
51
- export { e as MINIMAP_CENTER, t as MINIMAP_PAN, n as centerRootOn, i as minimapCenterAction, a as minimapPanAction };
52
-
53
- //# sourceMappingURL=actions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.js","names":["MINIMAP_CENTER","MINIMAP_PAN","centerRootOn","size","root","v","x","y","rootOf","deps","minimapCenterAction","p","params","minimapPanAction","ctx","m"],"sources":["../../../src/features/minimap/actions.ts"],"sourcesContent":["/**\n * The minimap's input: press to recenter the main camera on a world point,\n * drag to keep it there. Both read `rootView` — never `view`, which inside the\n * minimap's own view answers the minimap's camera.\n */\nimport type { Action, InvocationCtx, OngoingHandle } from '@weasel-js/routing';\nimport type { ViewApi } from 'interactions/actions/depSchema';\n\n/** Action id for `minimapCenterAction`. */\nexport const MINIMAP_CENTER = 'minimap.center';\n/** Action id for `minimapPanAction`. */\nexport const MINIMAP_PAN = 'minimap.pan';\n\n/** Move `root` so world point (`x`, `y`) sits at the center of its host,\n * keeping its scale. A no-op while the host is unmeasured. */\nexport function centerRootOn(root: ViewApi, x: number, y: number): void {\n const size = root.hostSize?.();\n if (!size) return;\n const v = root.get();\n root.set({\n x: x - size.width / (2 * v.scale.x),\n y: y - size.height / (2 * v.scale.y),\n scale: v.scale,\n });\n}\n\nfunction rootOf(deps: InvocationCtx['deps']): ViewApi | undefined {\n return deps.rootView;\n}\n\n/** Recenter the main camera on the pressed world point. */\nexport function minimapCenterAction(): Action {\n return {\n id: MINIMAP_CENTER,\n label: 'Minimap — center the view here',\n requires: ['rootView'],\n invoker: {\n timing: 'immediate',\n run: (deps, params) => {\n const p = params as { worldX?: number; worldY?: number } | undefined;\n const root = rootOf(deps);\n if (!root || p?.worldX === undefined || p.worldY === undefined) return;\n centerRootOn(root, p.worldX, p.worldY);\n },\n },\n };\n}\n\n/** Keep the main camera centered on the pointer's world point while dragging.\n * Pair it with `minimap.center` on `pointerDown`, which handles the press.\n * A recenter lands the moment it is computed, so there is nothing to commit\n * and a cancel ends where a release does. */\nexport function minimapPanAction(): Action {\n return {\n id: MINIMAP_PAN,\n label: 'Minimap — pan the view',\n requires: ['rootView'],\n invoker: {\n timing: 'ongoing',\n start(ctx: InvocationCtx): OngoingHandle {\n const root = rootOf(ctx.deps);\n if (!root) return {};\n // The press already centered (`minimap.center`); the move that crossed\n // the drag threshold is pumped to `onMove` like every later one.\n return {\n onMove: (m) => {\n const p = m.drag?.current ?? m.world;\n centerRootOn(root, p.x, p.y);\n },\n onEnd: () => {},\n };\n },\n },\n };\n}\n"],"mappings":";AASA,IAAaA,IAAiB,kBAEjBC,IAAc;AAI3B,SAAgBC,EAAa,GAAe,GAAW,GAAiB;CACtE,IAAMC,IAAOC,EAAK,WAAW;CAC7B,IAAI,CAACD,GAAM;CACX,IAAME,IAAID,EAAK,IAAI;CACnB,EAAK,IAAI;EACP,GAAGE,IAAIH,EAAK,SAAS,IAAIE,EAAE,MAAM;EACjC,GAAGE,IAAIJ,EAAK,UAAU,IAAIE,EAAE,MAAM;EAClC,OAAOA,EAAE;CACX,CAAC;AACH;AAEA,SAASG,EAAO,GAAkD;CAChE,OAAOC,EAAK;AACd;AAGA,SAAgBC,IAA8B;CAC5C,OAAO;EACL,IAAIV;EACJ,OAAO;EACP,UAAU,CAAC,UAAU;EACrB,SAAS;GACP,QAAQ;GACR,MAAM,GAAM,MAAW;IACrB,IAAMW,IAAIC,GACJR,IAAOI,EAAOC,CAAI;IACxB,AAAKL,KAAQO,GAAG,WAAW,KAAA,KAAaA,EAAE,WAAW,KAAA,KACrDT,EAAaE,GAAMO,EAAE,QAAQA,EAAE,MAAM;GACvC;EACF;CACF;AACF;AAMA,SAAgBE,IAA2B;CACzC,OAAO;EACL,IAAIZ;EACJ,OAAO;EACP,UAAU,CAAC,UAAU;EACrB,SAAS;GACP,QAAQ;GACR,MAAM,GAAmC;IACvC,IAAMG,IAAOI,EAAOM,EAAI,IAAI;IAI5B,OAHKV,IAGE;KACL,SAAS,MAAM;MACb,IAAMO,IAAII,EAAE,MAAM,WAAWA,EAAE;MAC/B,EAAaX,GAAMO,EAAE,GAAGA,EAAE,CAAC;KAC7B;KACA,aAAa,CAAC;IAChB,IATkB,CAAC;GAUrB;EACF;CACF;AACF"}
@@ -1,96 +0,0 @@
1
- import { AUTO_POSE_DESCRIPTOR as e } from "../../interactions/actions/resize/autoPoseDescriptor.js";
2
- import { FALLBACK_ACCENT as t, accentColorOf as n } from "../../canvas/accentColor.js";
3
- import { MINIMAP_CENTER as r, MINIMAP_PAN as i, minimapCenterAction as a, minimapPanAction as o } from "./actions.js";
4
- import { createIndicatorLayer as s, createLinkedCursorLayer as c } from "./layers.js";
5
- import { FALLBACK_FIT_VIEW as l, computeFitView as u } from "../../canvas/minimapMath.js";
6
- //#region src/features/minimap/createMinimapContribution.ts
7
- function d(e, r) {
8
- let i = null, a = t, o = (e) => e !== null && r.some((t) => t !== e.viewId);
9
- return {
10
- layer: c({
11
- id: e,
12
- pointer: () => i,
13
- color: () => a,
14
- views: r
15
- }),
16
- attach: (e, t) => {
17
- let r = t.get("pointer");
18
- if (!r) return () => {};
19
- a = n(e.element), i = r.get();
20
- let s = r.subscribe(() => {
21
- let t = i;
22
- i = r.get(), (o(t) || o(i)) && e.requestRedraw();
23
- });
24
- return () => {
25
- s(), i = null, e.requestRedraw();
26
- };
27
- }
28
- };
29
- }
30
- function f(e = {}) {
31
- let t = e.id ?? "linked-cursor", n = d(t, e.views ?? [null]);
32
- return {
33
- id: t,
34
- eligibility: { always: !0 },
35
- overlay: n.layer,
36
- attach: n.attach
37
- };
38
- }
39
- var p = "#18181c";
40
- function m(t) {
41
- let n = t.id ?? "minimap", c = t.fit ?? "scene", f = null, m = null, h = (n, r) => {
42
- let i = f?.get("scene");
43
- if (!i) return l;
44
- let a = typeof t.rect == "function" ? t.rect(n, r) : t.rect, o = i.getVersion();
45
- if (m && m.scene === i && m.version === o && m.w === a.w && m.h === a.h) return m.view;
46
- let s = f?.get("poseDescriptor") ?? e, d = u(i, {
47
- width: a.w,
48
- height: a.h
49
- }, c, s);
50
- return m = {
51
- scene: i,
52
- version: o,
53
- w: a.w,
54
- h: a.h,
55
- view: d
56
- }, d;
57
- }, g = d(`${n}.cursor`, [null, n]), _ = s({
58
- viewId: n,
59
- root: () => f?.get("rootView"),
60
- ...t.indicatorStyle ? { style: t.indicatorStyle } : {}
61
- });
62
- return {
63
- id: n,
64
- eligibility: { always: !0 },
65
- views: [{
66
- id: n,
67
- bounds: t.rect,
68
- view: h,
69
- interactive: !0,
70
- background: t.background ?? p,
71
- ...t.layers ? { layers: t.layers } : {}
72
- }],
73
- actions: [a(), o()],
74
- bindings: [{
75
- spec: { kind: "pointerDown" },
76
- actionId: r,
77
- opts: { views: [n] }
78
- }, {
79
- spec: { kind: "drag" },
80
- actionId: i,
81
- opts: { views: [n] }
82
- }],
83
- overlay: [_, g.layer],
84
- attach: (e, t) => {
85
- f = t;
86
- let n = g.attach(e, t);
87
- return e.requestRedraw(), () => {
88
- n(), f = null, m = null;
89
- };
90
- }
91
- };
92
- }
93
- //#endregion
94
- export { f as createLinkedCursorContribution, m as createMinimapContribution };
95
-
96
- //# sourceMappingURL=createMinimapContribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMinimapContribution.js","names":["linkedCursor","pointer","color","FALLBACK_ACCENT","visible","p","ownViews","v","createLinkedCursorLayer","store","deps","accentColorOf","api","off","prev","createLinkedCursorContribution","id","opts","cursor","DEFAULT_BACKGROUND","createMinimapContribution","fit","cached","fitCamera","scene","FALLBACK_FIT_VIEW","r","outer","dims","version","descriptor","AUTO_POSE_DESCRIPTOR","view","computeFitView","indicator","createIndicatorLayer","minimapCenterAction","minimapPanAction","MINIMAP_CENTER","MINIMAP_PAN","reader","detachCursor"],"sources":["../../../src/features/minimap/createMinimapContribution.ts"],"sourcesContent":["/**\n * A minimap over a `<SceneCanvas>`, written as one `SurfaceContribution`: a\n * view through a fit camera, the pan that moves the main camera from inside\n * it, the visible-rect indicator, and a linked crosshair.\n */\nimport type { Dims, RenderLayer } from 'core/layers/render';\nimport type { View } from 'core/viewport/view';\nimport type { Scene } from 'core/scene/types';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { AUTO_POSE_DESCRIPTOR } from 'interactions/actions/resize/autoPoseDescriptor';\nimport type { PointerWorldPos } from 'features/pointer/PointerContext';\nimport type { CanvasExtensionApi } from '../../canvas/canvasExtension';\nimport type { ViewRect } from '../../canvas/CanvasView';\nimport type { ContributionDepReader, SurfaceContribution } from '../../canvas/surfaceContribution';\nimport {\n computeFitView, FALLBACK_FIT_VIEW, type IndicatorStyle, type MinimapFit,\n} from '../../canvas/minimapMath';\nimport {\n MINIMAP_CENTER, MINIMAP_PAN, minimapCenterAction, minimapPanAction,\n} from './actions';\nimport { createIndicatorLayer, createLinkedCursorLayer } from './layers';\nimport { accentColorOf, FALLBACK_ACCENT } from '../../canvas/accentColor';\n\n\n/**\n * The linked crosshair's live half: follows the pointer store, and asks the\n * surface to repaint whenever the crosshair shows, moves, or has just hidden.\n * `ownViews` are the view ids this surface paints; the crosshair shows in any\n * of them the pointer is not over.\n */\nfunction linkedCursor(id: string, ownViews: readonly (string | null)[]) {\n let pointer: PointerWorldPos = null;\n let color = FALLBACK_ACCENT;\n const visible = (p: PointerWorldPos): boolean =>\n p !== null && ownViews.some((v) => v !== p.viewId);\n const layer = createLinkedCursorLayer({ id, pointer: () => pointer, color: () => color, views: ownViews });\n const attach = (api: CanvasExtensionApi, deps: ContributionDepReader): (() => void) => {\n const store = deps.get('pointer');\n if (!store) return () => {};\n color = accentColorOf(api.element);\n pointer = store.get();\n const off = store.subscribe(() => {\n const prev = pointer;\n pointer = store.get();\n if (visible(prev) || visible(pointer)) api.requestRedraw();\n });\n return () => {\n off();\n pointer = null;\n api.requestRedraw();\n };\n };\n return { layer, attach };\n}\n\n/** Options for {@link createLinkedCursorContribution}. */\nexport interface LinkedCursorOptions {\n /** Entry id. Default `'linked-cursor'`. */\n id?: string;\n /** Views on this surface the crosshair may paint in. Default `[null]`, the\n * surface's own camera — the main canvas beside a detached minimap. */\n views?: readonly (string | null)[];\n}\n\n/**\n * The linked crosshair alone: this surface paints the pointer's position\n * whenever the pointer is over some other view — another surface under the\n * same `<PointerContextProvider>`, such as a detached `<MinimapCanvas>`.\n *\n * A surface carrying `createMinimapContribution` already has one, in both its\n * views; this is for a surface without.\n */\nexport function createLinkedCursorContribution(opts: LinkedCursorOptions = {}): SurfaceContribution {\n const id = opts.id ?? 'linked-cursor';\n const cursor = linkedCursor(id, opts.views ?? [null]);\n return { id, eligibility: { always: true }, overlay: cursor.layer, attach: cursor.attach };\n}\n\n/** Options for {@link createMinimapContribution}. */\nexport interface MinimapContributionOptions<TData = unknown, TLayer extends string = string, TPose = unknown> {\n /** View and entry id. Default `'minimap'`. */\n id?: string;\n /** Where the minimap paints, in CSS pixels from the canvas top-left. A\n * function is re-read every frame, so it can follow the canvas's size. */\n rect: ViewRect | ((outer: View, dims: Dims) => ViewRect);\n /** What the minimap frames. Default `'scene'`, the union of leaf poses. */\n fit?: MinimapFit<TData, TLayer, TPose>;\n /** The surface layers the minimap paints. Default: all of them. */\n layers?: (surface: readonly RenderLayer<unknown>[]) => readonly RenderLayer<unknown>[];\n /** Ground painted before the minimap's layers, so the main canvas does not\n * show through. */\n background?: string;\n /** The visible-rect indicator's stroke. */\n indicatorStyle?: IndicatorStyle;\n}\n\nconst DEFAULT_BACKGROUND = '#18181c';\n\n/**\n * A minimap inside a `<SceneCanvas>`, installed with one entry:\n *\n * ```tsx\n * const minimap = useMemo(() => createMinimapContribution({ rect: { x: 8, y: 8, w: 160, h: 110 } }), []);\n * <SceneCanvas ambient={[minimap]} … />\n * ```\n *\n * Press in it to center the main camera on that point, drag to keep it there.\n * It shows the main camera's visible rect, and a crosshair where the pointer is\n * over the other view. Build it once — each instance keeps the live state its\n * layers read.\n */\nexport function createMinimapContribution<TData = unknown, TLayer extends string = string, TPose = unknown>(\n opts: MinimapContributionOptions<TData, TLayer, TPose>,\n): SurfaceContribution {\n const id = opts.id ?? 'minimap';\n const fit = (opts.fit ?? 'scene') as MinimapFit<unknown, string, unknown>;\n let deps: ContributionDepReader | null = null;\n\n // The fit follows the scene, so it is recomputed only when the scene's\n // version or the minimap's size changes — it is read on every frame and\n // every event.\n let cached: { scene: unknown; version: number; w: number; h: number; view: View } | null = null;\n const fitCamera = (outer: View, dims: Dims): View => {\n const scene = deps?.get('scene') as Scene<unknown, string, unknown> | undefined;\n if (!scene) return FALLBACK_FIT_VIEW;\n const r = typeof opts.rect === 'function' ? opts.rect(outer, dims) : opts.rect;\n const version = scene.getVersion();\n if (cached && cached.scene === scene && cached.version === version && cached.w === r.w && cached.h === r.h) {\n return cached.view;\n }\n const descriptor = (deps?.get('poseDescriptor') ?? AUTO_POSE_DESCRIPTOR) as PoseDescriptor<unknown>;\n const view = computeFitView(scene, { width: r.w, height: r.h }, fit, descriptor);\n cached = { scene, version, w: r.w, h: r.h, view };\n return view;\n };\n\n const cursor = linkedCursor(`${id}.cursor`, [null, id]);\n const indicator = createIndicatorLayer({\n viewId: id,\n root: () => deps?.get('rootView'),\n ...(opts.indicatorStyle ? { style: opts.indicatorStyle } : {}),\n });\n\n return {\n id,\n eligibility: { always: true },\n views: [{\n id,\n bounds: opts.rect,\n view: fitCamera,\n interactive: true,\n background: opts.background ?? DEFAULT_BACKGROUND,\n ...(opts.layers ? { layers: opts.layers } : {}),\n }],\n actions: [minimapCenterAction(), minimapPanAction()],\n bindings: [\n { spec: { kind: 'pointerDown' }, actionId: MINIMAP_CENTER, opts: { views: [id] } },\n { spec: { kind: 'drag' }, actionId: MINIMAP_PAN, opts: { views: [id] } },\n ],\n overlay: [indicator, cursor.layer],\n attach: (api, reader) => {\n deps = reader;\n const detachCursor = cursor.attach(api, reader);\n // The fit camera had no scene until now.\n api.requestRedraw();\n return () => {\n detachCursor();\n deps = null;\n cached = null;\n };\n },\n };\n}\n"],"mappings":"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"}
@@ -1,103 +0,0 @@
1
- //#region src/features/minimap/layers.ts
2
- function e(e) {
3
- return e?.viewId ?? null;
4
- }
5
- function t(t) {
6
- let { viewId: n, root: r, style: i = {} } = t;
7
- return {
8
- id: `${n}.indicator`,
9
- label: "Minimap indicator",
10
- draw: (t, a) => {
11
- if (e(t) !== n) return [];
12
- let o = r(), s = o?.hostSize?.();
13
- if (!o || !s) return [];
14
- let c = o.get(), l = 1 / a.scale.x;
15
- return [{
16
- kind: "path",
17
- path: {
18
- kind: "rect",
19
- x: c.x,
20
- y: c.y,
21
- width: s.width / c.scale.x,
22
- height: s.height / c.scale.y
23
- },
24
- stroke: {
25
- paint: {
26
- fill: "solid",
27
- color: i.stroke ?? "#ffffff"
28
- },
29
- width: (i.width ?? 1) * l,
30
- dash: (i.dash ?? [2, 3]).map((e) => e * l)
31
- }
32
- }];
33
- }
34
- };
35
- }
36
- var n = "rgba(0, 0, 0, 0.6)";
37
- function r(e, t, n) {
38
- let r = n, i = 9 * r, a = 3 * r, o = 2 * r, s = 1 * r, c = [
39
- {
40
- x: e - a - i,
41
- y: t - o / 2,
42
- w: i,
43
- h: o
44
- },
45
- {
46
- x: e + a,
47
- y: t - o / 2,
48
- w: i,
49
- h: o
50
- },
51
- {
52
- x: e - o / 2,
53
- y: t - a - i,
54
- w: o,
55
- h: i
56
- },
57
- {
58
- x: e - o / 2,
59
- y: t + a,
60
- w: o,
61
- h: i
62
- }
63
- ];
64
- return {
65
- halo: c.map((e) => ({
66
- x: e.x - s,
67
- y: e.y - s,
68
- w: e.w + 2 * s,
69
- h: e.h + 2 * s
70
- })),
71
- bars: c
72
- };
73
- }
74
- function i(t) {
75
- let { id: i, pointer: a, color: o, views: s } = t;
76
- return {
77
- id: i,
78
- label: "Linked cursor",
79
- draw: (t, i) => {
80
- let c = a(), l = e(t);
81
- if (!c || c.viewId === l || s && !s.includes(l)) return [];
82
- let { halo: u, bars: d } = r(c.worldX, c.worldY, 1 / i.scale.x), f = (e, t) => ({
83
- kind: "path",
84
- path: {
85
- kind: "rect",
86
- x: e.x,
87
- y: e.y,
88
- width: e.w,
89
- height: e.h
90
- },
91
- fill: {
92
- fill: "solid",
93
- color: t
94
- }
95
- }), p = o();
96
- return [...u.map((e) => f(e, n)), ...d.map((e) => f(e, p))];
97
- }
98
- };
99
- }
100
- //#endregion
101
- export { n as CROSSHAIR_HALO, t as createIndicatorLayer, i as createLinkedCursorLayer, r as crosshairRects };
102
-
103
- //# sourceMappingURL=layers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layers.js","names":["viewIdOf","data","createIndicatorLayer","opts","viewId","r","root","size","v","px","view","style","d","CROSSHAIR_HALO","crosshairRects","k","unitsPerPx","arm","gap","t","h","bars","x","y","b","createLinkedCursorLayer","p","pointer","here","views","rect","c","accent","color","halo"],"sources":["../../../src/features/minimap/layers.ts"],"sourcesContent":["/**\n * The minimap's chrome: the main camera's visible rect, drawn in the minimap,\n * and the linked crosshair, drawn in every view the pointer is not over.\n */\nimport type { RenderLayer } from 'core/layers/render';\nimport type { View } from 'core/viewport/view';\nimport type { DrawCommand } from '../../renderer/DrawCommand';\nimport type { ViewApi } from 'interactions/actions/depSchema';\nimport type { PointerWorldPos } from 'features/pointer/PointerContext';\nimport type { IndicatorStyle } from '../../canvas/minimapMath';\n\n/** What a layer's `data` carries for this feature: the view it draws for. */\nfunction viewIdOf(data: unknown): string | null {\n return (data as { viewId?: string | null } | null)?.viewId ?? null;\n}\n\n/**\n * The main camera's visible world rect, painted only in view `viewId`. Its\n * stroke and dash are screen pixels whatever the minimap's scale.\n */\nexport function createIndicatorLayer(opts: {\n viewId: string;\n root: () => ViewApi | undefined;\n style?: IndicatorStyle;\n}): RenderLayer<unknown> {\n const { viewId, root, style = {} } = opts;\n return {\n id: `${viewId}.indicator`,\n label: 'Minimap indicator',\n draw: (data, view: View): DrawCommand[] => {\n if (viewIdOf(data) !== viewId) return [];\n const r = root();\n const size = r?.hostSize?.();\n if (!r || !size) return [];\n const v = r.get();\n const px = 1 / view.scale.x;\n return [{\n kind: 'path',\n path: { kind: 'rect', x: v.x, y: v.y, width: size.width / v.scale.x, height: size.height / v.scale.y },\n stroke: {\n paint: { fill: 'solid', color: style.stroke ?? '#ffffff' },\n width: (style.width ?? 1) * px,\n dash: (style.dash ?? [2, 3]).map((d) => d * px),\n },\n }];\n },\n };\n}\n\n/** Screen-pixel geometry of the crosshair: arm length, the gap at its center,\n * line thickness, and the dark halo that keeps it legible over any content. */\nconst ARM = 9;\nconst GAP = 3;\nconst THICK = 2;\nconst HALO = 1;\n/** The halo's color: dark enough to separate the accent from any content. */\nexport const CROSSHAIR_HALO = 'rgba(0, 0, 0, 0.6)';\n\n/** An axis-aligned rect, `{ x, y, w, h }`. */\nexport interface CrosshairRect { x: number; y: number; w: number; h: number }\n\n/**\n * The linked crosshair at (`x`, `y`) as rects in the caller's units, where one\n * screen pixel is `unitsPerPx` of them: four halo rects to paint first, then\n * four bars. A painter with no weasel renderer — a 2D canvas — draws the same\n * crosshair from these.\n */\nexport function crosshairRects(\n x: number, y: number, unitsPerPx: number,\n): { halo: CrosshairRect[]; bars: CrosshairRect[] } {\n const k = unitsPerPx;\n const arm = ARM * k, gap = GAP * k, t = THICK * k, h = HALO * k;\n const bars: CrosshairRect[] = [\n { x: x - gap - arm, y: y - t / 2, w: arm, h: t },\n { x: x + gap, y: y - t / 2, w: arm, h: t },\n { x: x - t / 2, y: y - gap - arm, w: t, h: arm },\n { x: x - t / 2, y: y + gap, w: t, h: arm },\n ];\n const halo = bars.map((b) => ({ x: b.x - h, y: b.y - h, w: b.w + 2 * h, h: b.h + 2 * h }));\n return { halo, bars };\n}\n\n/**\n * A crosshair at the pointer's world point, in each of `views` the pointer is\n * not over — the other side of a linked cursor. A fixed screen size in every\n * view. `views` omitted paints in every view.\n */\nexport function createLinkedCursorLayer(opts: {\n id: string;\n pointer: () => PointerWorldPos;\n color: () => string;\n views?: readonly (string | null)[];\n}): RenderLayer<unknown> {\n const { id, pointer, color, views } = opts;\n return {\n id,\n label: 'Linked cursor',\n draw: (data, view: View): DrawCommand[] => {\n const p = pointer();\n const here = viewIdOf(data);\n if (!p || p.viewId === here || (views && !views.includes(here))) return [];\n const { halo, bars } = crosshairRects(p.worldX, p.worldY, 1 / view.scale.x);\n const rect = (r: CrosshairRect, c: string): DrawCommand => ({\n kind: 'path',\n path: { kind: 'rect', x: r.x, y: r.y, width: r.w, height: r.h },\n fill: { fill: 'solid', color: c },\n });\n const accent = color();\n return [\n ...halo.map((r) => rect(r, CROSSHAIR_HALO)),\n ...bars.map((r) => rect(r, accent)),\n ];\n },\n };\n}\n"],"mappings":";AAYA,SAASA,EAAS,GAA8B;CAC9C,OAAQC,GAA4C,UAAU;AAChE;AAMA,SAAgBC,EAAqB,GAIZ;CACvB,IAAM,EAAE,WAAQ,SAAM,WAAQ,CAAC,MAAMC;CACrC,OAAO;EACL,IAAI,GAAGC,EAAO;EACd,OAAO;EACP,OAAO,GAAM,MAA8B;GACzC,IAAIJ,EAASC,CAAI,MAAMG,GAAQ,OAAO,CAAC;GACvC,IAAMC,IAAIC,EAAK,GACTC,IAAOF,GAAG,WAAW;GAC3B,IAAI,CAACA,KAAK,CAACE,GAAM,OAAO,CAAC;GACzB,IAAMC,IAAIH,EAAE,IAAI,GACVI,IAAK,IAAIC,EAAK,MAAM;GAC1B,OAAO,CAAC;IACN,MAAM;IACN,MAAM;KAAE,MAAM;KAAQ,GAAGF,EAAE;KAAG,GAAGA,EAAE;KAAG,OAAOD,EAAK,QAAQC,EAAE,MAAM;KAAG,QAAQD,EAAK,SAASC,EAAE,MAAM;IAAE;IACrG,QAAQ;KACN,OAAO;MAAE,MAAM;MAAS,OAAOG,EAAM,UAAU;KAAU;KACzD,QAAQA,EAAM,SAAS,KAAKF;KAC5B,OAAOE,EAAM,QAAQ,CAAC,GAAG,CAAC,EAAA,CAAG,KAAK,MAAMC,IAAIH,CAAE;IAChD;GACF,CAAC;EACH;CACF;AACF;AAIA,IAKaI,IAAiB;AAW9B,SAAgBC,EACd,GAAW,GAAW,GAC4B;CAClD,IAAMC,IAAIC,GACJC,IAAM,IAAMF,GAAGG,IAAM,IAAMH,GAAGI,IAAI,IAAQJ,GAAGK,IAAI,IAAOL,GACxDM,IAAwB;EAC5B;GAAE,GAAGC,IAAIJ,IAAMD;GAAK,GAAGM,IAAIJ,IAAI;GAAG,GAAGF;GAAK,GAAGE;EAAE;EAC/C;GAAE,GAAGG,IAAIJ;GAAK,GAAGK,IAAIJ,IAAI;GAAG,GAAGF;GAAK,GAAGE;EAAE;EACzC;GAAE,GAAGG,IAAIH,IAAI;GAAG,GAAGI,IAAIL,IAAMD;GAAK,GAAGE;GAAG,GAAGF;EAAI;EAC/C;GAAE,GAAGK,IAAIH,IAAI;GAAG,GAAGI,IAAIL;GAAK,GAAGC;GAAG,GAAGF;EAAI;CAC3C;CAEA,OAAO;EAAE,MADII,EAAK,KAAK,OAAO;GAAE,GAAGG,EAAE,IAAIJ;GAAG,GAAGI,EAAE,IAAIJ;GAAG,GAAGI,EAAE,IAAI,IAAIJ;GAAG,GAAGI,EAAE,IAAI,IAAIJ;EAAE,EAC9E;EAAM;CAAK;AACtB;AAOA,SAAgBK,EAAwB,GAKf;CACvB,IAAM,EAAE,OAAI,YAAS,UAAO,aAAUtB;CACtC,OAAO;EACL;EACA,OAAO;EACP,OAAO,GAAM,MAA8B;GACzC,IAAMuB,IAAIC,EAAQ,GACZC,IAAO5B,EAASC,CAAI;GAC1B,IAAI,CAACyB,KAAKA,EAAE,WAAWE,KAASC,KAAS,CAACA,EAAM,SAASD,CAAI,GAAI,OAAO,CAAC;GACzE,IAAM,EAAE,SAAM,YAASd,EAAeY,EAAE,QAAQA,EAAE,QAAQ,IAAIhB,EAAK,MAAM,CAAC,GACpEoB,KAAQ,GAAkB,OAA4B;IAC1D,MAAM;IACN,MAAM;KAAE,MAAM;KAAQ,GAAGzB,EAAE;KAAG,GAAGA,EAAE;KAAG,OAAOA,EAAE;KAAG,QAAQA,EAAE;IAAE;IAC9D,MAAM;KAAE,MAAM;KAAS,OAAO0B;IAAE;GAClC,IACMC,IAASC,EAAM;GACrB,OAAO,CACL,GAAGC,EAAK,KAAK,MAAMJ,EAAKzB,GAAGQ,CAAc,CAAC,GAC1C,GAAGQ,EAAK,KAAK,MAAMS,EAAKzB,GAAG2B,CAAM,CAAC,CACpC;EACF;CACF;AACF"}
@@ -1,103 +0,0 @@
1
- import { useCanvasSize as e } from "../../core/viewport/useCanvasSize.js";
2
- import { composeWorldPose as t } from "../../core/scene/composeFrame.js";
3
- import { composeRectPose as n } from "../groups/composePose.js";
4
- import { effectivePose as r } from "../../core/scene/effectivePose.js";
5
- import { poseRotationOf as i } from "../../core/geometry/poseRotation.js";
6
- import { applyToPoint as a, invert as o, multiply as s } from "@weasel-js/geom";
7
- import { useCallback as c, useInsertionEffect as l, useRef as u } from "react";
8
- //#region src/features/overlays/useNodeOverlayFrame.ts
9
- function d(t, n, r, i = {}) {
10
- let { width: d, height: g } = e(n), { view: _, compose: v } = i, y = c(() => {
11
- let e = p(t, r, v);
12
- return e ? s(m(f(_)), h(e)) : null;
13
- }, [
14
- t,
15
- r,
16
- v,
17
- _
18
- ]), b = c((e) => {
19
- let t = y();
20
- if (!t) return e;
21
- let [n, r] = a(t, e.x, e.y);
22
- return {
23
- x: n,
24
- y: r
25
- };
26
- }, [y]), x = u(null), S = c((e) => {
27
- let t = y(), n = t && o(t);
28
- n && (x.current = n);
29
- let [r, i] = a(n ?? x.current, e.x, e.y);
30
- return {
31
- x: r,
32
- y: i
33
- };
34
- }, [y]), C = p(t, r, v), w = C && d !== 0 && g !== 0 ? y() : null, T = w && o(w);
35
- return l(() => {
36
- T && (x.current = T);
37
- }), !C || !T ? null : {
38
- box: {
39
- x: C.x,
40
- y: C.y,
41
- width: C.width,
42
- height: C.height
43
- },
44
- toScreen: b,
45
- toLocal: S,
46
- width: d,
47
- height: g
48
- };
49
- }
50
- function f(e) {
51
- return typeof e == "function" ? e() : e;
52
- }
53
- function p(e, i, a) {
54
- if (i == null) return null;
55
- let o = e.nodes;
56
- return o.has(i) ? t({
57
- getPose: (t) => r(e, o.get(t)),
58
- getParent: (e) => o.get(e)?.parent ?? null
59
- }, i, a ?? n) : null;
60
- }
61
- function m(e) {
62
- if (!e) return [
63
- 1,
64
- 0,
65
- 0,
66
- 1,
67
- 0,
68
- 0
69
- ];
70
- let { x: t, y: n } = e.scale;
71
- return [
72
- t,
73
- 0,
74
- 0,
75
- n,
76
- -e.x * t,
77
- -e.y * n
78
- ];
79
- }
80
- function h(e) {
81
- let t = i(e);
82
- if (!t) return [
83
- 1,
84
- 0,
85
- 0,
86
- 1,
87
- 0,
88
- 0
89
- ];
90
- let n = Math.cos(t.rotation), r = Math.sin(t.rotation);
91
- return [
92
- n,
93
- r,
94
- -r,
95
- n,
96
- t.cx - t.cx * n + t.cy * r,
97
- t.cy - t.cx * r - t.cy * n
98
- ];
99
- }
100
- //#endregion
101
- export { d as useNodeOverlayFrame };
102
-
103
- //# sourceMappingURL=useNodeOverlayFrame.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNodeOverlayFrame.js","names":["useNodeOverlayFrame","useCanvasSize","containerRef","options","project","useCallback","box","worldBoxOf","scene","nodeId","compose","multiply","viewMatrix","resolveView","view","rotationMatrix","toScreen","m","p","x","y","applyToPoint","lastInverse","useRef","toLocal","inverse","invert","width","height","useInsertionEffect","nodes","composeWorldPose","effectivePose","id","composeRectPose","sx","sy","r","poseRotationOf","pose","c","s"],"sources":["../../../src/features/overlays/useNodeOverlayFrame.ts"],"sourcesContent":["/**\n * `useNodeOverlayFrame` — the coordinate frame a DOM overlay pinned to one\n * scene node needs: the node's world box, the projection from that box's\n * frame into overlay pixels, and the overlay's measured size.\n *\n * This is the frame half of `subscribeView`'s \"DOM pinned to world\n * coordinates\" case. Consumers positioning chrome over a node — gradient\n * handles, a badge, a caret — otherwise re-derive it, and the\n * translate-and-scale inverse that derivation usually reaches for drops\n * `pose.rotation`, so the chrome sits where the node would be unrotated.\n *\n * `toScreen` maps the node's **unrotated world box** frame, which is the\n * frame `fillInPoseFrame` resolves a `units: 'bounds'` paint into and the\n * one `pathInPoseFrame` projects geometry into. Rotation lives in this hook,\n * not in those: a node's stored geometry is pre-rotation by definition.\n */\nimport { useCallback, useInsertionEffect, useRef, type RefObject } from 'react';\nimport { applyToPoint, invert, multiply, type Mat3 } from '@weasel-js/geom';\nimport type { Node, RectPose, Scene } from '../../core/scene/types';\nimport { useCanvasSize } from '../../core/viewport/useCanvasSize';\nimport type { View } from '../../core/viewport/view';\nimport { composeRectPose, composeWorldPose } from '../groups/composePose';\nimport { effectivePose } from 'core/scene/effectivePose';\nimport { poseRotationOf } from 'core/geometry/poseRotation';\n\n/** Structural point, matching every other `{ x, y }` the kit passes across a\n * boundary. */\nexport interface OverlayPoint {\n x: number;\n y: number;\n}\n\n/** The overlay frame for one node. `null` from the hook means there is no\n * frame yet — no node, or nothing measured to draw it on. */\nexport interface NodeOverlayFrame {\n /** The node's composed world box, **unrotated**: the frame `toScreen` maps\n * from, and the box to hand `fillInPoseFrame` / `fillToBoundsFrame`. */\n box: { x: number; y: number; width: number; height: number };\n /** Node box frame → overlay pixels, rotation and view included. */\n toScreen: (p: OverlayPoint) => OverlayPoint;\n /** Overlay pixels → node box frame. Inverts `toScreen`; while a live view\n * flattens an axis, it keeps the last mapping that had an inverse. */\n toLocal: (p: OverlayPoint) => OverlayPoint;\n /** The container's size in CSS pixels — the overlay's own box. */\n width: number;\n height: number;\n}\n\n/** Options for `useNodeOverlayFrame`. */\nexport interface UseNodeOverlayFrameOptions<TPose> {\n /**\n * Current viewport. A thunk is re-read on every projection, which is what\n * an uncontrolled `SceneCanvas` needs — its camera lives in a ref and moves\n * without a render, so pass the handle's `getView`. A plain `View` is the\n * value from the render that supplied it, correct for a controlled\n * consumer. Omit it and world units are handed through as screen pixels.\n */\n view?: View | (() => View);\n /** Fold a child pose into its parent's frame. Default `composeRectPose`. */\n compose?: (parent: TPose, child: TPose) => TPose;\n}\n\n/**\n * Resolve the overlay frame for `nodeId` against `containerRef` — the element\n * the overlay is positioned in, which must be the canvas's own box for the\n * projection to land.\n *\n * Returns `null` when there is no node under `nodeId`, when the container has\n * not been measured, or when the view collapses an axis to zero — the three\n * states in which an overlay has nothing to draw.\n */\nexport function useNodeOverlayFrame<TData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n containerRef: RefObject<HTMLElement | null>,\n nodeId: string | null | undefined,\n options: UseNodeOverlayFrameOptions<TPose> = {},\n): NodeOverlayFrame | null {\n const { width, height } = useCanvasSize(containerRef);\n const { view, compose } = options;\n\n const project = useCallback((): Mat3 | null => {\n const box = worldBoxOf(scene, nodeId, compose);\n if (!box) return null;\n return multiply(viewMatrix(resolveView(view)), rotationMatrix(box));\n }, [scene, nodeId, compose, view]);\n\n const toScreen = useCallback((p: OverlayPoint): OverlayPoint => {\n const m = project();\n if (!m) return p;\n const [x, y] = applyToPoint(m, p.x, p.y);\n return { x, y };\n }, [project]);\n\n const lastInverse = useRef<Mat3 | null>(null);\n\n const toLocal = useCallback((p: OverlayPoint): OverlayPoint => {\n const m = project();\n const inverse = m && invert(m);\n if (inverse) lastInverse.current = inverse;\n // Published by the commit that handed this toLocal out, so there is one.\n const [x, y] = applyToPoint(inverse ?? lastInverse.current!, p.x, p.y);\n return { x, y };\n }, [project]);\n\n const box = worldBoxOf(scene, nodeId, compose);\n const m = box && width !== 0 && height !== 0 ? project() : null;\n const inverse = m && invert(m);\n useInsertionEffect(() => {\n if (inverse) lastInverse.current = inverse;\n });\n\n if (!box || !inverse) return null;\n return { box: { x: box.x, y: box.y, width: box.width, height: box.height }, toScreen, toLocal, width, height };\n}\n\nfunction resolveView(view: View | (() => View) | undefined): View | undefined {\n return typeof view === 'function' ? view() : view;\n}\n\nfunction worldBoxOf<TData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n nodeId: string | null | undefined,\n compose: ((parent: TPose, child: TPose) => TPose) | undefined,\n): TPose | null {\n if (nodeId == null) return null;\n const nodes = scene.nodes as ReadonlyMap<string, Node<TData, TLayer, TPose>>;\n if (!nodes.has(nodeId)) return null;\n // `effectivePose`, not `node.pose`: an overlay tracks what the renderer\n // draws, and a gesture override or a derived pose is exactly the difference.\n const adapter = {\n getPose: (id: string) => effectivePose(scene, nodes.get(id)!),\n getParent: (id: string) => nodes.get(id)?.parent ?? null,\n };\n return composeWorldPose(adapter, nodeId, compose ?? composeRectPose);\n}\n\n/** World → overlay pixels: `screen = (world − view) × view.scale`. */\nfunction viewMatrix(view: View | undefined): Mat3 {\n if (!view) return [1, 0, 0, 1, 0, 0];\n const { x: sx, y: sy } = view.scale;\n return [sx, 0, 0, sy, -view.x * sx, -view.y * sy];\n}\n\n/** The pose→world leg the box frame omits, per `poseRotationOf`'s convention. */\nfunction rotationMatrix(pose: RectPose): Mat3 {\n const r = poseRotationOf(pose);\n if (!r) return [1, 0, 0, 1, 0, 0];\n const c = Math.cos(r.rotation);\n const s = Math.sin(r.rotation);\n return [c, s, -s, c, r.cx - r.cx * c + r.cy * s, r.cy - r.cx * s - r.cy * c];\n}\n"],"mappings":";;;;;;;;AAuEA,SAAgBA,EACd,GACA,GACA,GACA,IAA6C,CAAC,GACrB;CACzB,IAAM,EAAE,UAAO,cAAWC,EAAcC,CAAY,GAC9C,EAAE,SAAM,eAAYC,GAEpBC,IAAUC,QAA+B;EAC7C,IAAMC,IAAMC,EAAWC,GAAOC,GAAQC,CAAO;EAE7C,OADKJ,IACEK,EAASC,EAAWC,EAAYC,CAAI,CAAC,GAAGC,EAAeT,CAAG,CAAC,IADjD;CAEnB,GAAG;EAACE;EAAOC;EAAQC;EAASI;CAAI,CAAC,GAE3BE,IAAWX,GAAa,MAAkC;EAC9D,IAAMY,IAAIb,EAAQ;EAClB,IAAI,CAACa,GAAG,OAAOC;EACf,IAAM,CAACC,GAAGC,KAAKC,EAAaJ,GAAGC,EAAE,GAAGA,EAAE,CAAC;EACvC,OAAO;GAAE;GAAG;EAAE;CAChB,GAAG,CAACd,CAAO,CAAC,GAENkB,IAAcC,EAAoB,IAAI,GAEtCC,IAAUnB,GAAa,MAAkC;EAC7D,IAAMY,IAAIb,EAAQ,GACZqB,IAAUR,KAAKS,EAAOT,CAAC;EAC7B,AAAIQ,MAAS,EAAY,UAAUA;EAEnC,IAAM,CAACN,GAAGC,KAAKC,EAAaI,KAAWH,EAAY,SAAUJ,EAAE,GAAGA,EAAE,CAAC;EACrE,OAAO;GAAE;GAAG;EAAE;CAChB,GAAG,CAACd,CAAO,CAAC,GAENE,IAAMC,EAAWC,GAAOC,GAAQC,CAAO,GACvCO,IAAIX,KAAOqB,MAAU,KAAKC,MAAW,IAAIxB,EAAQ,IAAI,MACrDqB,IAAUR,KAAKS,EAAOT,CAAC;CAM7B,OALAY,QAAyB;EACvB,AAAIJ,MAAS,EAAY,UAAUA;CACrC,CAAC,GAEG,CAACnB,KAAO,CAACmB,IAAgB,OACtB;EAAE,KAAK;GAAE,GAAGnB,EAAI;GAAG,GAAGA,EAAI;GAAG,OAAOA,EAAI;GAAO,QAAQA,EAAI;EAAO;EAAG;EAAU;EAAS;EAAO;CAAO;AAC/G;AAEA,SAASO,EAAY,GAAyD;CAC5E,OAAO,OAAOC,KAAS,aAAaA,EAAK,IAAIA;AAC/C;AAEA,SAASP,EACP,GACA,GACA,GACc;CACd,IAAIE,KAAU,MAAM,OAAO;CAC3B,IAAMqB,IAAQtB,EAAM;CAQpB,OAPKsB,EAAM,IAAIrB,CAAM,IAOdsB,EAAiB;EAHtB,UAAU,MAAeC,EAAcxB,GAAOsB,EAAM,IAAIG,CAAE,CAAE;EAC5D,YAAY,MAAeH,EAAM,IAAIG,CAAE,CAAC,EAAE,UAAU;CAE9B,GAASxB,GAAQC,KAAWwB,CAAe,IAPpC;AAQjC;AAGA,SAAStB,EAAW,GAA8B;CAChD,IAAI,CAACE,GAAM,OAAO;EAAC;EAAG;EAAG;EAAG;EAAG;EAAG;CAAC;CACnC,IAAM,EAAE,GAAGqB,GAAI,GAAGC,MAAOtB,EAAK;CAC9B,OAAO;EAACqB;EAAI;EAAG;EAAGC;EAAI,CAACtB,EAAK,IAAIqB;EAAI,CAACrB,EAAK,IAAIsB;CAAE;AAClD;AAGA,SAASrB,EAAe,GAAsB;CAC5C,IAAMsB,IAAIC,EAAeC,CAAI;CAC7B,IAAI,CAACF,GAAG,OAAO;EAAC;EAAG;EAAG;EAAG;EAAG;EAAG;CAAC;CAChC,IAAMG,IAAI,KAAK,IAAIH,EAAE,QAAQ,GACvBI,IAAI,KAAK,IAAIJ,EAAE,QAAQ;CAC7B,OAAO;EAACG;EAAGC;EAAG,CAACA;EAAGD;EAAGH,EAAE,KAAKA,EAAE,KAAKG,IAAIH,EAAE,KAAKI;EAAGJ,EAAE,KAAKA,EAAE,KAAKI,IAAIJ,EAAE,KAAKG;CAAC;AAC7E"}
@@ -1,26 +0,0 @@
1
- import { drawOneLayer as e, subscribeToSources as t } from "../../core/layers/render.js";
2
- import { deriveParallaxView as n } from "../../core/viewport/parallax.js";
3
- import { isParallaxSource as r } from "./createParallaxPlane.js";
4
- //#region src/features/parallax/createParallaxLayer.ts
5
- function i(i) {
6
- let { id: a, label: o, source: s, parallax: c, getOuterView: l } = i, u = r(c) ? () => c.get() : () => c, d = t(s);
7
- return {
8
- id: a,
9
- label: o,
10
- space: "screen",
11
- subscribe: r(c) ? (e) => {
12
- let t = d(e), n = c.subscribe(e);
13
- return () => {
14
- t(), n();
15
- };
16
- } : d,
17
- draw: (t, r, i) => {
18
- let a = n(l?.() ?? r, u());
19
- return s.flatMap((n) => e(n, t, a, i));
20
- }
21
- };
22
- }
23
- //#endregion
24
- export { i as createParallaxLayer };
25
-
26
- //# sourceMappingURL=createParallaxLayer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createParallaxLayer.js","names":["createParallaxLayer","opts","read","isParallaxSource","parallax","fromSources","subscribeToSources","source","offSources","listener","offPlane","inner","deriveParallaxView","getOuterView","outer","drawOneLayer","layer","data","dims"],"sources":["../../../src/features/parallax/createParallaxLayer.ts"],"sourcesContent":["import { drawOneLayer, subscribeToSources, type RenderLayer } from '../../core/layers/render';\nimport type { View } from '../../core/viewport/view';\nimport { deriveParallaxView, type ParallaxOpts } from '../../core/viewport/parallax';\nimport { isParallaxSource, type ParallaxSource } from './createParallaxPlane';\n\n/** Options for `createParallaxLayer`. */\nexport interface CreateParallaxLayerOpts<TData> {\n id: string;\n label: string;\n /** Layers re-rendered through the derived inner view. */\n source: RenderLayer<TData>[];\n /** How the plane tracks the camera. Pass a `ParallaxSource` (such as\n * `createParallaxPlane`) to change it after the layer is built — an\n * animator tweening `pan` or `zoom` writes the plane, not the layer. */\n parallax: ParallaxOpts | ParallaxSource;\n /** Where the camera view comes from. Defaults to the view the Canvas hands\n * the layer — the `view` prop. A consumer running a 60 Hz camera through\n * refs pins that prop to identity, and would otherwise get identity back\n * for every `pan` value and a backdrop that never moves. */\n getOuterView?: () => View;\n}\n\n/**\n * Wrap source RenderLayers in a parallax plane. The plane's inner view is\n * derived from the camera view per {@link deriveParallaxView}; each source\n * layer is drawn through it by `drawOneLayer`, so a `space: 'world'` source\n * gets the inner view's transform and a `space: 'screen'` one does not. The\n * plane itself is emitted as `space: 'screen'` — its children already carry\n * whatever transform they need, and the outer Canvas must add none.\n *\n * What this draws is paint: pointer events target the camera's view. Content\n * that should be clickable belongs on a scene layer carrying `parallax`\n * instead, which `<SceneCanvas>` renders and picks through the same view.\n *\n * **Screen-space source layers don't compose meaningfully** — they ignore\n * the derived view by definition. Same constraint as `createViewportLayer`.\n */\nexport function createParallaxLayer<TData>(\n opts: CreateParallaxLayerOpts<TData>,\n): RenderLayer<TData> {\n const { id, label, source, parallax, getOuterView } = opts;\n const read = isParallaxSource(parallax) ? () => parallax.get() : () => parallax;\n const fromSources = subscribeToSources(source);\n return {\n id,\n label,\n space: 'screen',\n subscribe: isParallaxSource(parallax)\n ? (listener) => {\n const offSources = fromSources(listener);\n const offPlane = parallax.subscribe(listener);\n return () => { offSources(); offPlane(); };\n }\n : fromSources,\n draw: (data, outer, dims) => {\n const inner = deriveParallaxView(getOuterView?.() ?? outer, read());\n return source.flatMap((layer) => drawOneLayer(layer, data, inner, dims));\n },\n };\n}\n"],"mappings":";;;;AAqCA,SAAgBA,EACd,GACoB;CACpB,IAAM,EAAE,OAAI,UAAO,WAAQ,aAAU,oBAAiBC,GAChDC,IAAOC,EAAiBC,CAAQ,UAAUA,EAAS,IAAI,UAAUA,GACjEC,IAAcC,EAAmBC,CAAM;CAC7C,OAAO;EACL;EACA;EACA,OAAO;EACP,WAAWJ,EAAiBC,CAAQ,KAC/B,MAAa;GACd,IAAMI,IAAaH,EAAYI,CAAQ,GACjCC,IAAWN,EAAS,UAAUK,CAAQ;GAC5C,aAAa;IAAgB,AAAdD,EAAW,GAAGE,EAAS;GAAG;EAC3C,IACEL;EACJ,OAAO,GAAM,GAAO,MAAS;GAC3B,IAAMM,IAAQC,EAAmBC,IAAe,KAAKC,GAAOZ,EAAK,CAAC;GAClE,OAAOK,EAAO,SAAS,MAAUQ,EAAaC,GAAOC,GAAMN,GAAOO,CAAI,CAAC;EACzE;CACF;AACF"}
@@ -1,26 +0,0 @@
1
- //#region src/features/parallax/createParallaxPlane.ts
2
- function e(e) {
3
- let t = { ...e }, n = /* @__PURE__ */ new Set();
4
- return {
5
- get: () => t,
6
- set(e) {
7
- t = {
8
- ...t,
9
- ...e
10
- };
11
- for (let e of [...n]) e();
12
- },
13
- subscribe(e) {
14
- return n.add(e), () => {
15
- n.delete(e);
16
- };
17
- }
18
- };
19
- }
20
- function t(e) {
21
- return typeof e.get == "function";
22
- }
23
- //#endregion
24
- export { e as createParallaxPlane, t as isParallaxSource };
25
-
26
- //# sourceMappingURL=createParallaxPlane.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createParallaxPlane.js","names":["createParallaxPlane","current","initial","listeners","patch","fn","isParallaxSource","p"],"sources":["../../../src/features/parallax/createParallaxPlane.ts"],"sourcesContent":["import type { RedrawSource } from '../../core/layers/render';\nimport type { ParallaxOpts } from '../../core/viewport/parallax';\n\n/** Parallax opts that can change after a layer is built. `get` is read on\n * every draw, and a notification repaints whatever draws through it. */\nexport interface ParallaxSource extends RedrawSource {\n get(): ParallaxOpts;\n}\n\n/** A {@link ParallaxSource} you write to — what an animator's `onTick` drives\n * to tween a plane's `pan`, `zoom` or `anchor`. */\nexport interface ParallaxPlane extends ParallaxSource {\n /** Merge `patch` over the current opts and notify. */\n set(patch: Partial<ParallaxOpts>): void;\n}\n\n/** A {@link ParallaxPlane} starting at `initial`. Pass it as a parallax\n * layer's `parallax` and write to it to move the plane. */\nexport function createParallaxPlane(initial: ParallaxOpts): ParallaxPlane {\n let current: ParallaxOpts = { ...initial };\n const listeners = new Set<() => void>();\n return {\n get: () => current,\n set(patch) {\n current = { ...current, ...patch };\n for (const fn of [...listeners]) fn();\n },\n subscribe(fn) {\n listeners.add(fn);\n return () => { listeners.delete(fn); };\n },\n };\n}\n\n/** Whether `p` is a live source rather than a fixed set of opts. */\nexport function isParallaxSource(p: ParallaxOpts | ParallaxSource): p is ParallaxSource {\n return typeof (p as ParallaxSource).get === 'function';\n}\n"],"mappings":";AAkBA,SAAgBA,EAAoB,GAAsC;CACxE,IAAIC,IAAwB,EAAE,GAAGC,EAAQ,GACnCC,oBAAY,IAAI,IAAgB;CACtC,OAAO;EACL,WAAWF;EACX,IAAI,GAAO;GACT,IAAU;IAAE,GAAGA;IAAS,GAAGG;GAAM;GACjC,KAAK,IAAMC,KAAM,CAAC,GAAGF,CAAS,GAAG,EAAG;EACtC;EACA,UAAU,GAAI;GAEZ,OADAA,EAAU,IAAIE,CAAE,SACH;IAAE,EAAU,OAAOA,CAAE;GAAG;EACvC;CACF;AACF;AAGA,SAAgBC,EAAiB,GAAuD;CACtF,OAAO,OAAQC,EAAqB,OAAQ;AAC9C"}