@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.
- package/CHANGELOG.md +1106 -0
- package/README.md +7 -5
- package/dist/WeaselProvider.js +5 -7
- package/dist/WeaselProvider.js.map +1 -1
- package/dist/affordances/composeAffordanceLayer.js +91 -93
- package/dist/affordances/composeAffordanceLayer.js.map +1 -1
- package/dist/affordances/cornerResize.js +27 -18
- package/dist/affordances/cornerResize.js.map +1 -1
- package/dist/affordances/hitAffordanceRegions.js +65 -104
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/affordances/rotationHandle.js +22 -21
- package/dist/affordances/rotationHandle.js.map +1 -1
- package/dist/animation/behaviors/coast.js +21 -0
- package/dist/animation/behaviors/coast.js.map +1 -0
- package/dist/animation/behaviors/coastByWrite.js +107 -0
- package/dist/animation/behaviors/coastByWrite.js.map +1 -0
- package/dist/animation/behaviors/coastOnTargets.js +94 -0
- package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
- package/dist/animation/behaviors/momentum.js +38 -88
- package/dist/animation/behaviors/momentum.js.map +1 -1
- package/dist/animation/clipTargets.js +12 -0
- package/dist/animation/clipTargets.js.map +1 -0
- package/dist/animation/index.js +15 -20
- package/dist/animation/poseHelpers.js +112 -33
- package/dist/animation/poseHelpers.js.map +1 -1
- package/dist/animation/poseTarget.js +115 -0
- package/dist/animation/poseTarget.js.map +1 -0
- package/dist/animation/reflow.js +113 -83
- package/dist/animation/reflow.js.map +1 -1
- package/dist/animation/rewind.js +66 -0
- package/dist/animation/rewind.js.map +1 -0
- package/dist/animation/rig/bindRig.js +85 -53
- package/dist/animation/rig/bindRig.js.map +1 -1
- package/dist/animation/rig/rigNode.js +93 -0
- package/dist/animation/rig/rigNode.js.map +1 -0
- package/dist/animation/rig/rigSeat.js +26 -0
- package/dist/animation/rig/rigSeat.js.map +1 -0
- package/dist/animation/rig/skinBinding.js +56 -0
- package/dist/animation/rig/skinBinding.js.map +1 -0
- package/dist/animation/rig/useRig.js +31 -16
- package/dist/animation/rig/useRig.js.map +1 -1
- package/dist/animation/wrappers/animateLifecycle.js +32 -24
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
- package/dist/animation/wrappers/animateOnSetPose.js +31 -29
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
- package/dist/animation/wrappers/instantPose.js +13 -0
- package/dist/animation/wrappers/instantPose.js.map +1 -0
- package/dist/animation/writtenPoseTarget.js +33 -0
- package/dist/animation/writtenPoseTarget.js.map +1 -0
- package/dist/{autoPoseDescriptor-vCdt55xm.d.ts → autoPoseDescriptor-DHg5KqaJ.d.ts} +1 -1
- package/dist/barrel/canvas.js +31 -0
- package/dist/barrel/chrome.js +16 -0
- package/dist/barrel/input.js +18 -0
- package/dist/barrel/interactions.js +38 -0
- package/dist/barrel/paint.js +11 -0
- package/dist/barrel/paths.js +12 -0
- package/dist/barrel/renderer.js +14 -0
- package/dist/barrel/routing.js +57 -0
- package/dist/barrel/scene.js +37 -0
- package/dist/barrel/text.js +9 -0
- package/dist/barrel/viewport.js +42 -0
- package/dist/canvas/Canvas.js +280 -559
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +147 -167
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/CursorCoordsHud.js +53 -49
- package/dist/canvas/CursorCoordsHud.js.map +1 -1
- package/dist/canvas/DrawCanvas.js +40 -51
- package/dist/canvas/DrawCanvas.js.map +1 -1
- package/dist/canvas/ModalityHud.js.map +1 -1
- package/dist/canvas/NodeShape.js +55 -374
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/PickHud.js +50 -47
- package/dist/canvas/PickHud.js.map +1 -1
- package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
- package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +126 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +27 -31
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +64 -0
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +16 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/coordTrace.js +46 -0
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +138 -85
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +9 -8
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
- package/dist/canvas/SceneCanvas/features.js +74 -43
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/isDev.js +12 -0
- package/dist/canvas/SceneCanvas/isDev.js.map +1 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js +31 -34
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
- package/dist/canvas/SceneCanvas/poseRegistrars.js +13 -0
- package/dist/canvas/SceneCanvas/poseRegistrars.js.map +1 -0
- package/dist/canvas/SceneCanvas/props.js +39 -0
- package/dist/canvas/SceneCanvas/props.js.map +1 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +21 -62
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
- package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js +38 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +29 -29
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
- package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +48 -48
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +74 -78
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/worldPointAt.js +9 -0
- package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +311 -969
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +42 -46
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/adapterDerivedPath.js +26 -0
- package/dist/canvas/adapterDerivedPath.js.map +1 -0
- package/dist/canvas/affordanceAt.js +11 -1
- package/dist/canvas/affordanceAt.js.map +1 -1
- package/dist/canvas/buildSceneLayer.js +111 -0
- package/dist/canvas/buildSceneLayer.js.map +1 -0
- package/dist/canvas/buildSceneTree.js +16 -19
- package/dist/canvas/buildSceneTree.js.map +1 -1
- package/dist/canvas/canvasRenderer.js +67 -55
- package/dist/canvas/canvasRenderer.js.map +1 -1
- package/dist/canvas/colorOverrides.js.map +1 -1
- package/dist/canvas/defaultDrawOne.js +12 -12
- package/dist/canvas/defaultDrawOne.js.map +1 -1
- package/dist/canvas/deps/areaSelect.js +4 -4
- package/dist/canvas/deps/areaSelect.js.map +1 -1
- package/dist/canvas/deps/changes.js +13 -0
- package/dist/canvas/deps/changes.js.map +1 -0
- package/dist/canvas/deps/debug.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +38 -57
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/geometryProjection.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +31 -26
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +130 -91
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/lassoSelect.js +5 -5
- package/dist/canvas/deps/lassoSelect.js.map +1 -1
- package/dist/canvas/deps/poseDescriptor.js +1 -1
- package/dist/canvas/deps/poseDescriptor.js.map +1 -1
- package/dist/canvas/deps/resizePolicy.js.map +1 -1
- package/dist/canvas/deps/slice.js +26 -26
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +6 -5
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/deps/view.js.map +1 -1
- package/dist/canvas/derivedPath.js +47 -22
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/drawEnvelope.js +8 -4
- package/dist/canvas/drawEnvelope.js.map +1 -1
- package/dist/canvas/getNodeAtPoint.js +4 -8
- package/dist/canvas/getNodeAtPoint.js.map +1 -1
- package/dist/canvas/hud.module.js +1 -1
- package/dist/canvas/hud.module.js.map +1 -1
- package/dist/canvas/insertPreviewExtent.js.map +1 -1
- package/dist/canvas/kitRequirements.js +2 -2
- package/dist/canvas/kitRequirements.js.map +1 -1
- package/dist/canvas/layerOrder.js +13 -6
- package/dist/canvas/layerOrder.js.map +1 -1
- package/dist/canvas/layerSlots.js +6 -1
- package/dist/canvas/layerSlots.js.map +1 -1
- package/dist/canvas/nodeShapes/derivedPainter.js +34 -0
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/imagePainter.js +87 -0
- package/dist/canvas/nodeShapes/imagePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/memo.js +9 -0
- package/dist/canvas/nodeShapes/memo.js.map +1 -0
- package/dist/canvas/nodeShapes/nodePaint.js +68 -0
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -0
- package/dist/canvas/nodeShapes/pathPainter.js +39 -0
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/poseBox.js +20 -0
- package/dist/canvas/nodeShapes/poseBox.js.map +1 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +38 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/shapePainter.js +72 -0
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/textPainter.js +55 -0
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/paintCull.js +11 -14
- package/dist/canvas/paintCull.js.map +1 -1
- package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
- package/dist/canvas/paintedCursorLayer.js.map +1 -0
- package/dist/canvas/pickWalk.js +59 -68
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/planeClips.js +18 -19
- package/dist/canvas/planeClips.js.map +1 -1
- package/dist/canvas/poseCascade.js +41 -0
- package/dist/canvas/poseCascade.js.map +1 -0
- package/dist/canvas/poseRotation.js +9 -23
- package/dist/canvas/poseRotation.js.map +1 -1
- package/dist/canvas/rasterReadback.js +22 -0
- package/dist/canvas/rasterReadback.js.map +1 -0
- package/dist/canvas/renderDebugSnapshot.js +11 -11
- package/dist/canvas/renderDebugSnapshot.js.map +1 -1
- package/dist/canvas/renderNeeds.js +3 -3
- package/dist/canvas/renderNeeds.js.map +1 -1
- package/dist/canvas/renderSceneToPixels.js +64 -81
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +68 -214
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +112 -0
- package/dist/canvas/sceneClipboard.js.map +1 -0
- package/dist/canvas/sceneLayerPaint.js +4 -4
- package/dist/canvas/sceneLayerPaint.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +39 -39
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/slopsDebugLayer.js +4 -4
- package/dist/canvas/slopsDebugLayer.js.map +1 -1
- package/dist/canvas/surface.module.js +6 -0
- package/dist/canvas/surface.module.js.map +1 -0
- package/dist/canvas/surfaceBox.js +16 -0
- package/dist/canvas/surfaceBox.js.map +1 -0
- package/dist/canvas/useCanvasRenderer.js +26 -6
- package/dist/canvas/useCanvasRenderer.js.map +1 -1
- package/dist/canvas/useCanvasSurface.js +31 -0
- package/dist/canvas/useCanvasSurface.js.map +1 -0
- package/dist/canvas/useCanvasView.js +67 -0
- package/dist/canvas/useCanvasView.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +39 -31
- package/dist/canvas/useFrameLoop.js.map +1 -1
- package/dist/canvas/useHostAnchor.js +35 -33
- package/dist/canvas/useHostAnchor.js.map +1 -1
- package/dist/canvas/useLateContentRedraw.js +8 -8
- package/dist/canvas/useLateContentRedraw.js.map +1 -1
- package/dist/canvas/useSceneLayerList.js +11 -0
- package/dist/canvas/useSceneLayerList.js.map +1 -0
- package/dist/canvas/useSurfaceInput.js +42 -0
- package/dist/canvas/useSurfaceInput.js.map +1 -0
- package/dist/canvas/useToolCursor.js +29 -0
- package/dist/canvas/useToolCursor.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +46 -85
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/viewInputs.js.map +1 -1
- package/dist/canvas/viewRegistry.js +25 -27
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/canvas/watchElementMove.js +43 -0
- package/dist/canvas/watchElementMove.js.map +1 -0
- package/dist/canvas/wrapNodeOutput.js.map +1 -1
- package/dist/clipboard.d.ts +16 -19
- package/dist/{types-B_9g6hMM.d.ts → clone-2a5hVbBd.d.ts} +123 -74
- package/dist/clone.d.ts +4 -7
- package/dist/clone.js +0 -2
- package/dist/core/device/index.js +5 -4
- package/dist/core/device/targets.js.map +1 -1
- package/dist/core/device/useDeviceProfile.js +38 -44
- package/dist/core/device/useDeviceProfile.js.map +1 -1
- package/dist/core/device/watchDevicePixelRatio.js +17 -0
- package/dist/core/device/watchDevicePixelRatio.js.map +1 -0
- package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
- package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/pathPoseDescriptor.js +88 -0
- package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/poseDescriptor.js +68 -19
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/regionHit.js +31 -34
- package/dist/core/geometry/regionHit.js.map +1 -1
- package/dist/core/geometry/targetFrame.js +94 -0
- package/dist/core/geometry/targetFrame.js.map +1 -0
- package/dist/core/geometry/unionBounds.js +30 -29
- package/dist/core/geometry/unionBounds.js.map +1 -1
- package/dist/core/isPlainObject.js +2 -11
- package/dist/core/layers/backgroundFill.js +31 -0
- package/dist/core/layers/backgroundFill.js.map +1 -0
- package/dist/{features/groups → core/layers}/children.js +1 -1
- package/dist/core/layers/children.js.map +1 -0
- package/dist/core/layers/gateLayer.js +13 -0
- package/dist/core/layers/gateLayer.js.map +1 -0
- package/dist/core/layers/layerGroup.js +40 -0
- package/dist/core/layers/layerGroup.js.map +1 -0
- package/dist/core/layers/render.js +50 -76
- package/dist/core/layers/render.js.map +1 -1
- package/dist/core/ops/arrange.js +1 -0
- package/dist/core/ops/arrange.js.map +1 -1
- package/dist/core/ops/create.js +10 -5
- package/dist/core/ops/create.js.map +1 -1
- package/dist/core/ops/createHistory.js +9 -9
- package/dist/core/ops/createHistory.js.map +1 -1
- package/dist/core/ops/delete.js +12 -24
- package/dist/core/ops/delete.js.map +1 -1
- package/dist/core/ops/reorder/index.js +43 -40
- package/dist/core/ops/reorder/index.js.map +1 -1
- package/dist/core/ops/reorder/setChildOrder.js +34 -0
- package/dist/core/ops/reorder/setChildOrder.js.map +1 -0
- package/dist/core/paint/meshKind.js +16 -0
- package/dist/core/paint/meshKind.js.map +1 -0
- package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +282 -105
- package/dist/core/paint/meshKindLazy.js.map +1 -0
- package/dist/core/paint/paintKindEntry.js +8 -0
- package/dist/core/paint/paintKindEntry.js.map +1 -0
- package/dist/core/paint/paintKinds.js +144 -0
- package/dist/core/paint/paintKinds.js.map +1 -0
- package/dist/core/paint/registerMesh.js +7 -0
- package/dist/core/paint/registerMesh.js.map +1 -0
- package/dist/core/scene/NodeProperties.js.map +1 -1
- package/dist/core/scene/NodeRouting.js.map +1 -1
- package/dist/core/scene/appliedLog.js +37 -0
- package/dist/core/scene/appliedLog.js.map +1 -0
- package/dist/core/scene/arrivalWindow.js +102 -0
- package/dist/core/scene/arrivalWindow.js.map +1 -0
- package/dist/core/scene/boundOps.js +40 -0
- package/dist/core/scene/boundOps.js.map +1 -0
- package/dist/core/scene/composeFrame.js +9 -6
- package/dist/core/scene/composeFrame.js.map +1 -1
- package/dist/{features/groups → core/scene}/composePose.js +18 -18
- package/dist/core/scene/composePose.js.map +1 -0
- package/dist/core/scene/depMemo.js +31 -6
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/derivedPath.js +19 -20
- package/dist/core/scene/derivedPath.js.map +1 -1
- package/dist/core/scene/editMode.js +26 -0
- package/dist/core/scene/editMode.js.map +1 -0
- package/dist/core/scene/effectivePose.js +38 -39
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/fieldEdits.js +98 -0
- package/dist/core/scene/fieldEdits.js.map +1 -0
- package/dist/core/scene/historyFacade.js +130 -0
- package/dist/core/scene/historyFacade.js.map +1 -0
- package/dist/core/scene/historyForm.js +6 -0
- package/dist/core/scene/historyForm.js.map +1 -0
- package/dist/core/scene/kitOps.js +185 -0
- package/dist/core/scene/kitOps.js.map +1 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layerStack.js +131 -0
- package/dist/core/scene/layerStack.js.map +1 -0
- package/dist/core/scene/layoutPass.js +58 -59
- package/dist/core/scene/layoutPass.js.map +1 -1
- package/dist/core/scene/lockGuard.js +37 -0
- package/dist/core/scene/lockGuard.js.map +1 -0
- package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
- package/dist/core/scene/nestedHit.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +10 -11
- package/dist/core/scene/nodeFnFields.js.map +1 -1
- package/dist/core/scene/nodeMemo.js +45 -19
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/nodeStore.js +127 -0
- package/dist/core/scene/nodeStore.js.map +1 -0
- package/dist/core/scene/notifier.js +37 -0
- package/dist/core/scene/notifier.js.map +1 -0
- package/dist/core/scene/opTable.js +50 -0
- package/dist/core/scene/opTable.js.map +1 -0
- package/dist/core/scene/outerOps.js +66 -0
- package/dist/core/scene/outerOps.js.map +1 -0
- package/dist/core/scene/poseFeed.js +38 -38
- package/dist/core/scene/poseFeed.js.map +1 -1
- package/dist/core/scene/poseHold.js +39 -0
- package/dist/core/scene/poseHold.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +44 -40
- package/dist/core/scene/poseOverrides.js.map +1 -1
- package/dist/core/scene/poseSnapshot.js.map +1 -1
- package/dist/core/scene/reconcileSpecs.js +3 -2
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/recorder.js +86 -0
- package/dist/core/scene/recorder.js.map +1 -0
- package/dist/core/scene/renderOrder.js +84 -0
- package/dist/core/scene/renderOrder.js.map +1 -0
- package/dist/core/scene/scene.js +80 -1266
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneEdits.js +58 -0
- package/dist/core/scene/sceneEdits.js.map +1 -0
- package/dist/core/scene/sceneMutators.js +49 -0
- package/dist/core/scene/sceneMutators.js.map +1 -0
- package/dist/core/scene/scenePoseAdapter.js +16 -0
- package/dist/core/scene/scenePoseAdapter.js.map +1 -0
- package/dist/core/scene/sceneRecording.js +90 -0
- package/dist/core/scene/sceneRecording.js.map +1 -0
- package/dist/core/scene/sceneSelection.js +28 -0
- package/dist/core/scene/sceneSelection.js.map +1 -0
- package/dist/core/scene/sceneState.js +49 -0
- package/dist/core/scene/sceneState.js.map +1 -0
- package/dist/core/scene/serialization.js +71 -0
- package/dist/core/scene/serialization.js.map +1 -0
- package/dist/core/scene/staleReplay.js +51 -0
- package/dist/core/scene/staleReplay.js.map +1 -0
- package/dist/core/scene/statedFields.js +9 -0
- package/dist/core/scene/statedFields.js.map +1 -0
- package/dist/core/scene/treeEdits.js +127 -0
- package/dist/core/scene/treeEdits.js.map +1 -0
- package/dist/core/scene/treeOrder.js +13 -0
- package/dist/core/scene/treeOrder.js.map +1 -0
- package/dist/core/scene/treeReads.js +26 -0
- package/dist/core/scene/treeReads.js.map +1 -0
- package/dist/core/scene/types.js.map +1 -1
- package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
- package/dist/core/scene/unionOfChildren.js.map +1 -0
- package/dist/core/scene/unitScopes.js +13 -0
- package/dist/core/scene/unitScopes.js.map +1 -0
- package/dist/core/scene/useScene.js.map +1 -1
- package/dist/core/selection/readOnlySelection.js +32 -0
- package/dist/core/selection/readOnlySelection.js.map +1 -0
- package/dist/core/selection/usePublishSceneSelection.js +26 -0
- package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
- package/dist/core/selection/useSelection.js +34 -25
- package/dist/core/selection/useSelection.js.map +1 -1
- package/dist/core/shapeKinds.js.map +1 -1
- package/dist/core/stylus/stylus.js.map +1 -1
- package/dist/core/stylus/usePointerStylus.js.map +1 -1
- package/dist/core/usePaintKinds.js +1 -1
- package/dist/core/usePaintKinds.js.map +1 -1
- package/dist/core/viewport/clientToWorld.js.map +1 -1
- package/dist/core/viewport/fitViewToBounds.js.map +1 -1
- package/dist/core/viewport/parallax.js.map +1 -1
- package/dist/core/viewport/screenSlop.js +11 -11
- package/dist/core/viewport/screenSlop.js.map +1 -1
- package/dist/core/viewport/useCanvasSize.js.map +1 -1
- package/dist/core/viewport/useDecayLoop.js +8 -8
- package/dist/core/viewport/useDecayLoop.js.map +1 -1
- package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
- package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
- package/dist/core/viewport/useViewAnimation.js +102 -43
- package/dist/core/viewport/useViewAnimation.js.map +1 -1
- package/dist/core/viewport/view.js +9 -9
- package/dist/core/viewport/view.js.map +1 -1
- package/dist/core/viewport/wheelHandler.js.map +1 -1
- package/dist/core/viewport/zoomBounds.js +10 -8
- package/dist/core/viewport/zoomBounds.js.map +1 -1
- package/dist/{cornerHandles-BCrDp_mH.d.ts → cornerHandles-BEshc4z3.d.ts} +11 -24
- package/dist/debug/createDebugOverlayLayer.js +97 -97
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/createDebugSink.js.map +1 -1
- package/dist/debug/flag.js +2 -41
- package/dist/debug/frameStats.js.map +1 -1
- package/dist/debug/useDebugSink.js +52 -0
- package/dist/debug/useDebugSink.js.map +1 -0
- package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
- package/dist/features/chrome-caps/conditions.js.map +1 -1
- package/dist/features/chrome-caps/defaults.js.map +1 -1
- package/dist/features/chrome-caps/resolve.js.map +1 -1
- package/dist/features/chrome-caps/useChromeCaps.js +54 -0
- package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +22 -17
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +28 -19
- package/dist/features/ingestion/contentHandlers.js.map +1 -1
- package/dist/features/ingestion/imageHandler.js +21 -24
- package/dist/features/ingestion/imageHandler.js.map +1 -1
- package/dist/features/ingestion/openFilePicker.js.map +1 -1
- package/dist/features/ingestion/placement.js +16 -0
- package/dist/features/ingestion/placement.js.map +1 -0
- package/dist/features/ingestion/registerKitHandlers.js +7 -7
- package/dist/features/ingestion/svgHandler.js +5 -0
- package/dist/features/ingestion/svgHandler.js.map +1 -1
- package/dist/features/ingestion/textHandler.js +28 -0
- package/dist/features/ingestion/textHandler.js.map +1 -0
- package/dist/features/ingestion/useCanvasIngestion.js +48 -0
- package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
- package/dist/features/ingestion/weaselJsonHandler.js +22 -14
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
- package/dist/features/longPress/longPressFeedback.js.map +1 -1
- package/dist/features/modes/modeLayers.js +7 -7
- package/dist/features/modes/modeLayers.js.map +1 -1
- package/dist/features/paths/editablePath.js +47 -0
- package/dist/features/paths/editablePath.js.map +1 -0
- package/dist/features/paths/index.js +9 -14
- package/dist/features/paths/pathEditState.js +41 -0
- package/dist/features/paths/pathEditState.js.map +1 -0
- package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
- package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
- package/dist/features/paths/pathLayer.js +3 -2
- package/dist/features/paths/pathLayer.js.map +1 -1
- package/dist/features/paths/penPreviewLayer.js +86 -88
- package/dist/features/paths/penPreviewLayer.js.map +1 -1
- package/dist/features/paths/usePathEdit.js +34 -0
- package/dist/features/paths/usePathEdit.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +44 -52
- package/dist/features/poseRun/usePoseRun.js.map +1 -1
- package/dist/features/selection/overlay.js +171 -179
- package/dist/features/selection/overlay.js.map +1 -1
- package/dist/features/text/index.js +6 -0
- package/dist/features/text/textLayer.js +1 -1
- package/dist/features/text/textLayer.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +100 -93
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/viewportLayer.js +25 -36
- package/dist/features/viewports/viewportLayer.js.map +1 -1
- package/dist/index.d.ts +8473 -9141
- package/dist/index.js +269 -307
- package/dist/input/keyState.js +38 -39
- package/dist/input/keyState.js.map +1 -1
- package/dist/input/useKeyModifiers.js +11 -0
- package/dist/input/useKeyModifiers.js.map +1 -0
- package/dist/interactions/actions/actionShortcuts.js.map +1 -1
- package/dist/interactions/actions/{defaults/align.js → align/action.js} +18 -20
- package/dist/interactions/actions/align/action.js.map +1 -0
- package/dist/interactions/actions/align/align.js +20 -20
- package/dist/interactions/actions/align/align.js.map +1 -1
- package/dist/interactions/actions/booleans/action.js +65 -0
- package/dist/interactions/actions/booleans/action.js.map +1 -0
- package/dist/interactions/actions/booleans/booleans.js +69 -78
- package/dist/interactions/actions/booleans/booleans.js.map +1 -1
- package/dist/interactions/actions/booleans/operands.js +40 -0
- package/dist/interactions/actions/booleans/operands.js.map +1 -0
- package/dist/interactions/actions/booleans/pieces.js +45 -0
- package/dist/interactions/actions/booleans/pieces.js.map +1 -0
- package/dist/interactions/actions/booleans/placement.js +24 -0
- package/dist/interactions/actions/booleans/placement.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleans.js +11 -9
- package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
- package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
- package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +31 -15
- package/dist/interactions/actions/clipboard/action.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +44 -42
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
- package/dist/interactions/actions/clipboard/materializePaste.js +10 -7
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
- package/dist/interactions/actions/clone/action.js +98 -0
- package/dist/interactions/actions/clone/action.js.map +1 -0
- package/dist/interactions/actions/clone/behaviors.js +52 -0
- package/dist/interactions/actions/clone/behaviors.js.map +1 -0
- package/dist/interactions/actions/defaultCommitAdapter.js +7 -32
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +60 -84
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/areaSelect.js +35 -38
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
- package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/copySubtree.js +40 -0
- package/dist/interactions/actions/defaults/copySubtree.js.map +1 -0
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +13 -53
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +40 -50
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +44 -38
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +11 -12
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +40 -69
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/nudgeSteps.js +37 -0
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -0
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/reorder.js +2 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +14 -8
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +7 -4
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
- package/dist/interactions/actions/defaults/setStroke.js +12 -12
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +6 -6
- package/dist/interactions/actions/defaults/sliceOps.js +8 -10
- package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportDragPan.js +37 -26
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/distribute/action.js +66 -0
- package/dist/interactions/actions/distribute/action.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +11 -11
- package/dist/interactions/actions/distribute/distribute.js.map +1 -1
- package/dist/interactions/actions/{defaults/editAnchors.js → edit-anchors/action.js} +7 -9
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +30 -27
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +124 -0
- package/dist/interactions/actions/flip/action.js.map +1 -0
- package/dist/interactions/actions/flip/helpers.js +30 -17
- package/dist/interactions/actions/flip/helpers.js.map +1 -1
- package/dist/interactions/actions/gestureFrames.js +18 -0
- package/dist/interactions/actions/gestureFrames.js.map +1 -0
- package/dist/interactions/actions/gestureLifecycle.js +47 -20
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
- package/dist/interactions/actions/hitSelection.js +8 -0
- package/dist/interactions/actions/hitSelection.js.map +1 -0
- package/dist/interactions/actions/insert/action.js +72 -0
- package/dist/interactions/actions/insert/action.js.map +1 -0
- package/dist/interactions/actions/insert/commit.js +28 -0
- package/dist/interactions/actions/insert/commit.js.map +1 -0
- package/dist/interactions/actions/insert/extras.js +65 -0
- package/dist/interactions/actions/insert/extras.js.map +1 -0
- package/dist/interactions/actions/insert/frame.js +48 -0
- package/dist/interactions/actions/insert/frame.js.map +1 -0
- package/dist/interactions/actions/insert/geometry.js +35 -0
- package/dist/interactions/actions/insert/geometry.js.map +1 -0
- package/dist/interactions/actions/insert/rotateAction.js +21 -0
- package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
- package/dist/interactions/actions/insert/session.js +59 -0
- package/dist/interactions/actions/insert/session.js.map +1 -0
- package/dist/interactions/actions/insert/shape.js +34 -0
- package/dist/interactions/actions/insert/shape.js.map +1 -0
- package/dist/interactions/actions/lasso-select/action.js +143 -0
- package/dist/interactions/actions/lasso-select/action.js.map +1 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +14 -18
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
- package/dist/interactions/actions/move/action.js +87 -0
- package/dist/interactions/actions/move/action.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +5 -5
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +39 -27
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/capture.js +99 -0
- package/dist/interactions/actions/move/capture.js.map +1 -0
- package/dist/interactions/actions/move/commit/index.js +41 -0
- package/dist/interactions/actions/move/commit/index.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
- package/dist/interactions/actions/move/commit/rebase.js +18 -0
- package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
- package/dist/interactions/actions/move/commit/reparent.js +65 -0
- package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
- package/dist/interactions/actions/move/delta.js +51 -0
- package/dist/interactions/actions/move/delta.js.map +1 -0
- package/dist/interactions/actions/move/frame.js +59 -0
- package/dist/interactions/actions/move/frame.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +22 -30
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
- package/dist/interactions/actions/move/landedDescendants.js +33 -0
- package/dist/interactions/actions/move/landedDescendants.js.map +1 -0
- package/dist/interactions/actions/move/layout/container.js +94 -0
- package/dist/interactions/actions/move/layout/container.js.map +1 -0
- package/dist/interactions/actions/move/layout/dragged.js +58 -0
- package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
- package/dist/interactions/actions/move/layout/dropPass.js +122 -0
- package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
- package/dist/interactions/actions/move/layout/exits.js +38 -0
- package/dist/interactions/actions/move/layout/exits.js.map +1 -0
- package/dist/interactions/actions/move/layout/glide.js +48 -0
- package/dist/interactions/actions/move/layout/glide.js.map +1 -0
- package/dist/interactions/actions/move/session.js +63 -0
- package/dist/interactions/actions/move/session.js.map +1 -0
- package/dist/interactions/actions/move/translate.js +61 -0
- package/dist/interactions/actions/move/translate.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlines.js +16 -63
- package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
- package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
- package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
- package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
- package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
- package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
- package/dist/interactions/actions/planeInput.js.map +1 -1
- package/dist/interactions/actions/pointerState.js +12 -0
- package/dist/interactions/actions/pointerState.js.map +1 -0
- package/dist/interactions/actions/poseDescriptorDep.js +16 -4
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +25 -20
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +55 -0
- package/dist/interactions/actions/resize/action.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
- package/dist/interactions/actions/resize/boxFrame.js +16 -0
- package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
- package/dist/interactions/actions/resize/capture.js +85 -0
- package/dist/interactions/actions/resize/capture.js.map +1 -0
- package/dist/interactions/actions/resize/commit.js +69 -0
- package/dist/interactions/actions/resize/commit.js.map +1 -0
- package/dist/interactions/actions/resize/frame.js +74 -0
- package/dist/interactions/actions/resize/frame.js.map +1 -0
- package/dist/interactions/actions/resize/pointSnap.js +111 -0
- package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
- package/dist/interactions/actions/resize/ruleBounds.js +9 -0
- package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
- package/dist/interactions/actions/resize/session.js +49 -0
- package/dist/interactions/actions/resize/session.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -1
- package/dist/interactions/actions/resolvePreviews.js.map +1 -1
- package/dist/interactions/actions/rotate/action.js +56 -0
- package/dist/interactions/actions/rotate/action.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
- package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
- package/dist/interactions/actions/rotate/commit.js +40 -0
- package/dist/interactions/actions/rotate/commit.js.map +1 -0
- package/dist/interactions/actions/rotate/frame.js +65 -0
- package/dist/interactions/actions/rotate/frame.js.map +1 -0
- package/dist/interactions/actions/rotate/handle.js +12 -12
- package/dist/interactions/actions/rotate/handle.js.map +1 -1
- package/dist/interactions/actions/rotate/session.js +92 -0
- package/dist/interactions/actions/rotate/session.js.map +1 -0
- package/dist/interactions/actions/selectionSubtree.js +69 -0
- package/dist/interactions/actions/selectionSubtree.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -1
- package/dist/interactions/actions/useStandardActions.js +87 -78
- package/dist/interactions/actions/useStandardActions.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragGesture.js +4 -7
- package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragPointOf.js +23 -0
- package/dist/interactions/gestures/dragGesture/dragPointOf.js.map +1 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js +21 -26
- package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -1
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +62 -41
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
- package/dist/interactions/gestures/shared/originProjection.js +1 -1
- package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
- package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
- package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
- package/dist/interactions/gestures/shared/snap.js.map +1 -1
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +8 -4
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -1
- package/dist/layout/arrivals.js +20 -23
- package/dist/layout/arrivals.js.map +1 -1
- package/dist/math-CYUjoyyU.d.ts +33 -0
- package/dist/math.d.ts +5 -3
- package/dist/math.js +6 -6
- package/dist/mesh.d.ts +4 -268
- package/dist/mesh.js +3 -7
- package/dist/move.d.ts +14 -11
- package/dist/{originProjection-DEklpDc_.d.ts → originProjection-PPT88jZv.d.ts} +1 -1
- package/dist/patterns-builtin.d.ts +1 -118
- package/dist/patterns-builtin.js +2 -3
- package/dist/{poseDescriptor-D-OH-tu5.d.ts → poseDescriptor-Bqk-11Rl.d.ts} +26 -36
- package/dist/renderer.d.ts +1 -91
- package/dist/renderer.js +2 -18
- package/dist/resize.d.ts +10 -22
- package/dist/resize.js +6 -6
- package/dist/style.css +1 -1
- package/dist/test-hook/install.js +12 -6
- package/dist/test-hook/install.js.map +1 -1
- package/dist/test-hook/useTestHook.js +22 -0
- package/dist/test-hook/useTestHook.js.map +1 -0
- package/dist/test-seams-D0pyV3pR.d.ts +149 -0
- package/dist/test-seams.d.ts +4 -4
- package/dist/test-seams.js +2 -2
- package/dist/tools/builtin/bone/boneActions.js +130 -0
- package/dist/tools/builtin/bone/boneActions.js.map +1 -0
- package/dist/tools/builtin/bone/boneOverlay.js +58 -0
- package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
- package/dist/tools/builtin/bone/placedRig.js +24 -0
- package/dist/tools/builtin/bone/placedRig.js.map +1 -0
- package/dist/tools/builtin/bone/rigEditState.js +21 -0
- package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
- package/dist/tools/builtin/bone/useBoneTool.js +98 -0
- package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/hand/useHandTool.js +1 -0
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js +11 -11
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
- package/dist/tools/builtin/line/useLineTool.js +1 -0
- package/dist/tools/builtin/line/useLineTool.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +198 -150
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
- package/dist/tools/builtin/pencil/usePencilTool.js +1 -0
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js +13 -8
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/rect/useRectTool.js +1 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
- package/dist/tools/builtin/select/adapterPointQuery.js +36 -0
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +25 -24
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +42 -67
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/shared/pointerFollower.js +17 -0
- package/dist/tools/builtin/shared/pointerFollower.js.map +1 -0
- package/dist/tools/builtin/slice/useSliceTool.js +72 -82
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +22 -16
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +9 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/tools/builtin/weight/useWeightTool.js +77 -0
- package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
- package/dist/tools/builtin/weight/weightActions.js +112 -0
- package/dist/tools/builtin/weight/weightActions.js.map +1 -0
- package/dist/tools/builtin/weight/weightOverlay.js +61 -0
- package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
- package/dist/tools/overlayBinding.js.map +1 -1
- package/dist/tools/useKeybindings.js +12 -22
- package/dist/tools/useKeybindings.js.map +1 -1
- package/dist/{types-A37hYkeR.d.ts → types-CIKDwlsP.d.ts} +113 -169
- package/dist/util/color.js +3 -3
- package/dist/util/color.js.map +1 -1
- package/dist/util/paint.js +1 -1
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -21
- package/dist/animation/colorHelpers.js +0 -135
- package/dist/animation/colorHelpers.js.map +0 -1
- package/dist/animation/colorRegistry.js +0 -37
- package/dist/animation/colorRegistry.js.map +0 -1
- package/dist/animation/engine/axes.js +0 -36
- package/dist/animation/engine/axes.js.map +0 -1
- package/dist/animation/engine/codec.js +0 -170
- package/dist/animation/engine/codec.js.map +0 -1
- package/dist/animation/engine/integrator.js +0 -12
- package/dist/animation/engine/integrator.js.map +0 -1
- package/dist/animation/loop.js +0 -62
- package/dist/animation/loop.js.map +0 -1
- package/dist/animation/observe.js +0 -23
- package/dist/animation/observe.js.map +0 -1
- package/dist/animation/rig/blendPoses.js +0 -43
- package/dist/animation/rig/blendPoses.js.map +0 -1
- package/dist/animation/rig/mirrorPose.js +0 -19
- package/dist/animation/rig/mirrorPose.js.map +0 -1
- package/dist/animation/rig/resolveSkeleton.js +0 -33
- package/dist/animation/rig/resolveSkeleton.js.map +0 -1
- package/dist/animation/rig/solveIk.js +0 -103
- package/dist/animation/rig/solveIk.js.map +0 -1
- package/dist/animation/rig/types.js +0 -12
- package/dist/animation/rig/types.js.map +0 -1
- package/dist/animation/slew.js +0 -27
- package/dist/animation/slew.js.map +0 -1
- package/dist/animation/stagger.js +0 -138
- package/dist/animation/stagger.js.map +0 -1
- package/dist/animation/timeline/booking.js +0 -106
- package/dist/animation/timeline/booking.js.map +0 -1
- package/dist/animation/timeline/createTimeline.js +0 -116
- package/dist/animation/timeline/createTimeline.js.map +0 -1
- package/dist/animation/timeline/sampleTrack.js +0 -71
- package/dist/animation/timeline/sampleTrack.js.map +0 -1
- package/dist/animation/useAnimator.js +0 -378
- package/dist/animation/useAnimator.js.map +0 -1
- package/dist/builtins-C-VgUlWI.d.ts +0 -4514
- package/dist/canvas/MinimapCanvas.js +0 -139
- package/dist/canvas/MinimapCanvas.js.map +0 -1
- package/dist/canvas/deps/poseComposition.js +0 -11
- package/dist/canvas/deps/poseComposition.js.map +0 -1
- package/dist/canvas/minimapMath.js +0 -80
- package/dist/canvas/minimapMath.js.map +0 -1
- package/dist/canvas/toolPreview.js +0 -39
- package/dist/canvas/toolPreview.js.map +0 -1
- package/dist/core/adapters/arrayAdapter.js +0 -85
- package/dist/core/adapters/arrayAdapter.js.map +0 -1
- package/dist/core/adapters/useArrayAdapter.js +0 -13
- package/dist/core/adapters/useArrayAdapter.js.map +0 -1
- package/dist/core/fillInPoseFrame.js +0 -102
- package/dist/core/fillInPoseFrame.js.map +0 -1
- package/dist/core/geometry/poseRotation.js +0 -58
- package/dist/core/geometry/poseRotation.js.map +0 -1
- package/dist/core/gradient.js +0 -136
- package/dist/core/gradient.js.map +0 -1
- package/dist/core/isPlainObject.js.map +0 -1
- package/dist/core/markerInset.js +0 -24
- package/dist/core/markerInset.js.map +0 -1
- package/dist/core/mixed.js +0 -6
- package/dist/core/mixed.js.map +0 -1
- package/dist/core/paintKinds.js +0 -156
- package/dist/core/paintKinds.js.map +0 -1
- package/dist/core/strokeMarkerShapes.js +0 -139
- package/dist/core/strokeMarkerShapes.js.map +0 -1
- package/dist/core/strokeMarkers.js +0 -28
- package/dist/core/strokeMarkers.js.map +0 -1
- package/dist/core/viewport/meanScale.js +0 -8
- package/dist/core/viewport/meanScale.js.map +0 -1
- package/dist/core/viewport/pxExtent.js +0 -42
- package/dist/core/viewport/pxExtent.js.map +0 -1
- package/dist/debug/flag.js.map +0 -1
- package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
- package/dist/features/focus/gateLayer.js +0 -14
- package/dist/features/focus/gateLayer.js.map +0 -1
- package/dist/features/focus/useCanvasFocus.js +0 -29
- package/dist/features/focus/useCanvasFocus.js.map +0 -1
- package/dist/features/groups/children.js.map +0 -1
- package/dist/features/groups/composePose.js.map +0 -1
- package/dist/features/groups/nestedHit.js.map +0 -1
- package/dist/features/groups/unionOfChildren.js.map +0 -1
- package/dist/features/images/imageCache.js +0 -94
- package/dist/features/images/imageCache.js.map +0 -1
- package/dist/features/ingestion/index.js +0 -8
- package/dist/features/meshPaint/bake.js +0 -79
- package/dist/features/meshPaint/bake.js.map +0 -1
- package/dist/features/meshPaint/bakeCache.js +0 -59
- package/dist/features/meshPaint/bakeCache.js.map +0 -1
- package/dist/features/meshPaint/handles.js +0 -86
- package/dist/features/meshPaint/handles.js.map +0 -1
- package/dist/features/meshPaint/lazyKind.js.map +0 -1
- package/dist/features/meshPaint/meshPaint.js +0 -236
- package/dist/features/meshPaint/meshPaint.js.map +0 -1
- package/dist/features/meshPaint/meshShader.js +0 -6
- package/dist/features/meshPaint/meshShader.js.map +0 -1
- package/dist/features/meshPaint/register.js +0 -7
- package/dist/features/meshPaint/register.js.map +0 -1
- package/dist/features/meshPaint/surface.js +0 -110
- package/dist/features/meshPaint/surface.js.map +0 -1
- package/dist/features/minimap/actions.js +0 -53
- package/dist/features/minimap/actions.js.map +0 -1
- package/dist/features/minimap/createMinimapContribution.js +0 -96
- package/dist/features/minimap/createMinimapContribution.js.map +0 -1
- package/dist/features/minimap/layers.js +0 -103
- package/dist/features/minimap/layers.js.map +0 -1
- package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
- package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
- package/dist/features/parallax/createParallaxLayer.js +0 -26
- package/dist/features/parallax/createParallaxLayer.js.map +0 -1
- package/dist/features/parallax/createParallaxPlane.js +0 -26
- package/dist/features/parallax/createParallaxPlane.js.map +0 -1
- package/dist/features/paths/anchorEdits.js +0 -156
- package/dist/features/paths/anchorEdits.js.map +0 -1
- package/dist/features/paths/anchors.js +0 -154
- package/dist/features/paths/anchors.js.map +0 -1
- package/dist/features/paths/booleans.js +0 -2
- package/dist/features/paths/markerCommands.js +0 -148
- package/dist/features/paths/markerCommands.js.map +0 -1
- package/dist/features/paths/markerSites.js +0 -59
- package/dist/features/paths/markerSites.js.map +0 -1
- package/dist/features/paths/markers.js +0 -95
- package/dist/features/paths/markers.js.map +0 -1
- package/dist/features/paths/nearestAnchor.js +0 -36
- package/dist/features/paths/nearestAnchor.js.map +0 -1
- package/dist/features/paths/pathInWorld.js +0 -41
- package/dist/features/paths/pathInWorld.js.map +0 -1
- package/dist/features/paths/poseDescriptor.js +0 -39
- package/dist/features/paths/poseDescriptor.js.map +0 -1
- package/dist/features/paths/tessellate/dash.js +0 -52
- package/dist/features/paths/tessellate/dash.js.map +0 -1
- package/dist/features/paths/tessellate/insets.js +0 -32
- package/dist/features/paths/tessellate/insets.js.map +0 -1
- package/dist/features/paths/tessellate/metric.js +0 -72
- package/dist/features/paths/tessellate/metric.js.map +0 -1
- package/dist/features/paths/tessellate/stroke.js +0 -170
- package/dist/features/paths/tessellate/stroke.js.map +0 -1
- package/dist/features/paths/tessellate/vertexWidths.js +0 -32
- package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
- package/dist/features/patterns/index.js +0 -23
- package/dist/features/patterns/index.js.map +0 -1
- package/dist/features/patterns/patterns-builtin.js +0 -38
- package/dist/features/patterns/patterns-builtin.js.map +0 -1
- package/dist/features/patterns/resolveSpec.js +0 -57
- package/dist/features/patterns/resolveSpec.js.map +0 -1
- package/dist/features/patterns/tileGeometry.js +0 -158
- package/dist/features/patterns/tileGeometry.js.map +0 -1
- package/dist/features/pointer/PointerContext.js +0 -45
- package/dist/features/pointer/PointerContext.js.map +0 -1
- package/dist/features/selection/SelectionContext.js +0 -46
- package/dist/features/selection/SelectionContext.js.map +0 -1
- package/dist/features/simulation/createSimulation.js +0 -61
- package/dist/features/simulation/createSimulation.js.map +0 -1
- package/dist/features/simulation/types.js +0 -6
- package/dist/features/simulation/types.js.map +0 -1
- package/dist/features/simulation/useSimulation.js +0 -74
- package/dist/features/simulation/useSimulation.js.map +0 -1
- package/dist/features/text/domRuns.js +0 -258
- package/dist/features/text/domRuns.js.map +0 -1
- package/dist/features/text/fitTextPose.js +0 -38
- package/dist/features/text/fitTextPose.js.map +0 -1
- package/dist/features/text/hitTest.js +0 -45
- package/dist/features/text/hitTest.js.map +0 -1
- package/dist/features/text/renderLabel.js +0 -14
- package/dist/features/text/renderLabel.js.map +0 -1
- package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
- package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
- package/dist/features/text/runs/flagRange.js +0 -53
- package/dist/features/text/runs/flagRange.js.map +0 -1
- package/dist/features/text/runs/rangeStyle.js +0 -135
- package/dist/features/text/runs/rangeStyle.js.map +0 -1
- package/dist/features/text/textCommand.js +0 -59
- package/dist/features/text/textCommand.js.map +0 -1
- package/dist/features/text/textToPath.js +0 -181
- package/dist/features/text/textToPath.js.map +0 -1
- package/dist/features/text/useTextEdit.js +0 -467
- package/dist/features/text/useTextEdit.js.map +0 -1
- package/dist/features/tiling/createTiledLayer.js +0 -63
- package/dist/features/tiling/createTiledLayer.js.map +0 -1
- package/dist/features/tiling/tiledProject.js +0 -14
- package/dist/features/tiling/tiledProject.js.map +0 -1
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
- package/dist/interactions/actions/defaults/align.js.map +0 -1
- package/dist/interactions/actions/defaults/booleans.js +0 -52
- package/dist/interactions/actions/defaults/booleans.js.map +0 -1
- package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
- package/dist/interactions/actions/defaults/clone.js +0 -107
- package/dist/interactions/actions/defaults/clone.js.map +0 -1
- package/dist/interactions/actions/defaults/createOutlines.js +0 -47
- package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
- package/dist/interactions/actions/defaults/distribute.js +0 -66
- package/dist/interactions/actions/defaults/distribute.js.map +0 -1
- package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
- package/dist/interactions/actions/defaults/flip.js +0 -119
- package/dist/interactions/actions/defaults/flip.js.map +0 -1
- package/dist/interactions/actions/defaults/freshNodeId.js +0 -10
- package/dist/interactions/actions/defaults/freshNodeId.js.map +0 -1
- package/dist/interactions/actions/defaults/insert.js +0 -288
- package/dist/interactions/actions/defaults/insert.js.map +0 -1
- package/dist/interactions/actions/defaults/lassoSelect.js +0 -156
- package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
- package/dist/interactions/actions/defaults/move.js +0 -760
- package/dist/interactions/actions/defaults/move.js.map +0 -1
- package/dist/interactions/actions/defaults/resize.js +0 -335
- package/dist/interactions/actions/defaults/resize.js.map +0 -1
- package/dist/interactions/actions/defaults/rotate.js +0 -184
- package/dist/interactions/actions/defaults/rotate.js.map +0 -1
- package/dist/interactions/actions/previewOverrides.js +0 -25
- package/dist/interactions/actions/previewOverrides.js.map +0 -1
- package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
- package/dist/math-Drrw4ewZ.d.ts +0 -160
- package/dist/registerProgram-BMZRDgrh.d.ts +0 -197
- package/dist/renderer/DrawCommand.js +0 -6
- package/dist/renderer/DrawCommand.js.map +0 -1
- package/dist/renderer/WeaselRenderer.js +0 -331
- package/dist/renderer/WeaselRenderer.js.map +0 -1
- package/dist/renderer/batchClip.js +0 -46
- package/dist/renderer/batchClip.js.map +0 -1
- package/dist/renderer/cache/GLImageCache.js +0 -64
- package/dist/renderer/cache/GLImageCache.js.map +0 -1
- package/dist/renderer/cache/GLMeshCache.js +0 -102
- package/dist/renderer/cache/GLMeshCache.js.map +0 -1
- package/dist/renderer/cache/GLTextureCache.js +0 -51
- package/dist/renderer/cache/GLTextureCache.js.map +0 -1
- package/dist/renderer/cache/GradientRampAtlas.js +0 -82
- package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
- package/dist/renderer/cache/cache.js +0 -13
- package/dist/renderer/cache/cache.js.map +0 -1
- package/dist/renderer/cache/markerCommandCache.js +0 -63
- package/dist/renderer/cache/markerCommandCache.js.map +0 -1
- package/dist/renderer/cache/outlineMeshCache.js +0 -15
- package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
- package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
- package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
- package/dist/renderer/cache/strokeMeshCache.js +0 -55
- package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
- package/dist/renderer/cullDrawCommands.js +0 -90
- package/dist/renderer/cullDrawCommands.js.map +0 -1
- package/dist/renderer/draw.js +0 -1135
- package/dist/renderer/draw.js.map +0 -1
- package/dist/renderer/drawBatch.js +0 -198
- package/dist/renderer/drawBatch.js.map +0 -1
- package/dist/renderer/effects/EffectTargets.js +0 -45
- package/dist/renderer/effects/EffectTargets.js.map +0 -1
- package/dist/renderer/effects/builtins.js +0 -31
- package/dist/renderer/effects/builtins.js.map +0 -1
- package/dist/renderer/effects/composite.js +0 -9
- package/dist/renderer/effects/composite.js.map +0 -1
- package/dist/renderer/effects/effectPrelude.js +0 -10
- package/dist/renderer/effects/effectPrelude.js.map +0 -1
- package/dist/renderer/effects/types.js +0 -10
- package/dist/renderer/effects/types.js.map +0 -1
- package/dist/renderer/glyphOutlineMesh.js +0 -67
- package/dist/renderer/glyphOutlineMesh.js.map +0 -1
- package/dist/renderer/index.js +0 -19
- package/dist/renderer/math/color.js +0 -341
- package/dist/renderer/math/color.js.map +0 -1
- package/dist/renderer/math/mat3.js +0 -76
- package/dist/renderer/math/mat3.js.map +0 -1
- package/dist/renderer/math/patternSpace.js +0 -22
- package/dist/renderer/math/patternSpace.js.map +0 -1
- package/dist/renderer/math/viewToMat3.js +0 -19
- package/dist/renderer/math/viewToMat3.js.map +0 -1
- package/dist/renderer/paintResources.js +0 -18
- package/dist/renderer/paintResources.js.map +0 -1
- package/dist/renderer/paintScratch.js +0 -37
- package/dist/renderer/paintScratch.js.map +0 -1
- package/dist/renderer/shaders/ShaderProgram.js +0 -74
- package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
- package/dist/renderer/shaders/batchFill.js +0 -119
- package/dist/renderer/shaders/batchFill.js.map +0 -1
- package/dist/renderer/shaders/customPrelude.js +0 -34
- package/dist/renderer/shaders/customPrelude.js.map +0 -1
- package/dist/renderer/shaders/extractUniformNames.js +0 -184
- package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
- package/dist/renderer/shaders/glyphPaint.js +0 -61
- package/dist/renderer/shaders/glyphPaint.js.map +0 -1
- package/dist/renderer/shaders/gradFill.js +0 -30
- package/dist/renderer/shaders/gradFill.js.map +0 -1
- package/dist/renderer/shaders/imageFill.js +0 -14
- package/dist/renderer/shaders/imageFill.js.map +0 -1
- package/dist/renderer/shaders/pathFill.js +0 -13
- package/dist/renderer/shaders/pathFill.js.map +0 -1
- package/dist/renderer/shaders/patternFill.js +0 -24
- package/dist/renderer/shaders/patternFill.js.map +0 -1
- package/dist/renderer/shaders/registerProgram.js +0 -18
- package/dist/renderer/shaders/registerProgram.js.map +0 -1
- package/dist/renderer/spriteSheet.js +0 -14
- package/dist/renderer/spriteSheet.js.map +0 -1
- package/dist/renderer/state/GroupState.js +0 -77
- package/dist/renderer/state/GroupState.js.map +0 -1
- package/dist/renderer/strokeLengths.js +0 -50
- package/dist/renderer/strokeLengths.js.map +0 -1
- package/dist/renderer/syntheticItalic.js +0 -6
- package/dist/renderer/syntheticItalic.js.map +0 -1
- package/dist/renderer/textures/registerTexture.js +0 -14
- package/dist/renderer/textures/registerTexture.js.map +0 -1
- package/dist/scheduling/useVisibleRaf.js +0 -69
- package/dist/scheduling/useVisibleRaf.js.map +0 -1
- package/dist/test-seams-CuIxe0xY.d.ts +0 -356
- package/dist/tools/prefs.js +0 -62
- package/dist/tools/prefs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaintKinds.js","names":["usePaintKinds","useSyncExternalStore","paintKindRegistry","listPaintKinds","useGradientKinds","listGradientKinds","usePaintKind","read","useCallback","getPaintKind","kind"],"sources":["../../src/core/usePaintKinds.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\nimport {\n getPaintKind, listGradientKinds, listPaintKinds, paintKindRegistry
|
|
1
|
+
{"version":3,"file":"usePaintKinds.js","names":["usePaintKinds","useSyncExternalStore","paintKindRegistry","listPaintKinds","useGradientKinds","listGradientKinds","usePaintKind","read","useCallback","getPaintKind","kind"],"sources":["../../src/core/usePaintKinds.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\nimport {\n getPaintKind, listGradientKinds, listPaintKinds, paintKindRegistry,\n} from 'core/paint/paintKinds';\nimport type { PaintKindEntry } from 'core/paint/paintKindEntry';\n\n/** Every registered paint kind, as {@link listPaintKinds} returns it,\n * re-rendering the caller whenever a kind is registered or removed. */\nexport function usePaintKinds(): readonly PaintKindEntry[] {\n return useSyncExternalStore(paintKindRegistry.subscribe, listPaintKinds, listPaintKinds);\n}\n\n/** Every registered gradient kind, as {@link listGradientKinds} returns it,\n * re-rendering the caller whenever a kind is registered or removed. */\nexport function useGradientKinds(): readonly PaintKindEntry[] {\n return useSyncExternalStore(paintKindRegistry.subscribe, listGradientKinds, listGradientKinds);\n}\n\n/**\n * The entry for `kind`, as {@link getPaintKind} returns it — `undefined` until\n * it is registered, and the new entry once it is. A kind with a loader starts\n * loading on the first read.\n */\nexport function usePaintKind(kind: string | undefined): PaintKindEntry | undefined {\n const read = useCallback(() => getPaintKind(kind), [kind]);\n return useSyncExternalStore(paintKindRegistry.subscribe, read, read);\n}\n"],"mappings":";;;AAQA,SAAgBA,IAA2C;CACzD,OAAOC,EAAqBC,EAAkB,WAAWC,GAAgBA,CAAc;AACzF;AAIA,SAAgBC,IAA8C;CAC5D,OAAOH,EAAqBC,EAAkB,WAAWG,GAAmBA,CAAiB;AAC/F;AAOA,SAAgBC,EAAa,GAAsD;CACjF,IAAMC,IAAOC,QAAkBC,EAAaC,CAAI,GAAG,CAACA,CAAI,CAAC;CACzD,OAAOT,EAAqBC,EAAkB,WAAWK,GAAMA,CAAI;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientToWorld.js","names":["clientToWorld","clientX","origin","view","clientY"],"sources":["../../../src/core/viewport/clientToWorld.ts"],"sourcesContent":["/**\n * Convert client coords directly to world coords by subtracting the canvas\n * rect origin and then applying the inverse view transform.\n *\n * This is the composition of `clientToCanvas` + the view-inverse half of\n * `screenToWorld`, but expressed against the `ViewLike` shape used by\n * `SceneCanvas`
|
|
1
|
+
{"version":3,"file":"clientToWorld.js","names":["clientToWorld","clientX","origin","view","clientY"],"sources":["../../../src/core/viewport/clientToWorld.ts"],"sourcesContent":["/**\n * Convert client coords directly to world coords by subtracting the canvas\n * rect origin and then applying the inverse view transform.\n *\n * This is the composition of `clientToCanvas` + the view-inverse half of\n * `screenToWorld`, but expressed against the `ViewLike` shape used by\n * `SceneCanvas` (`{ scale: { x, y }, x, y }`) rather than the\n * `ViewTransform` shape used by `screenToWorld` (`{ panX, panY, zoom }`).\n */\nexport interface ViewLike {\n scale: { x: number; y: number };\n x: number;\n y: number;\n}\n\n/**\n * Map a browser client coord pair to world coords.\n *\n * @param clientX - `event.clientX`\n * @param clientY - `event.clientY`\n * @param origin - client-space origin of the surface `view` is a camera on.\n * For a whole canvas that is its bounding rect. For a viewport node it is\n * the canvas rect offset by the viewport's own rect, so the same call maps\n * into that viewport's inner world.\n * @param view - current viewport transform\n */\nexport function clientToWorld(\n clientX: number,\n clientY: number,\n origin: { left: number; top: number },\n view: ViewLike,\n): [number, number] {\n return [\n (clientX - origin.left) / view.scale.x + view.x,\n (clientY - origin.top) / view.scale.y + view.y,\n ];\n}\n"],"mappings":";AA0BA,SAAgBA,EACd,GACA,GACA,GACA,GACkB;CAClB,OAAO,EACJC,IAAUC,EAAO,QAAQC,EAAK,MAAM,IAAIA,EAAK,IAC7CC,IAAUF,EAAO,OAAOC,EAAK,MAAM,IAAIA,EAAK,CAC/C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fitViewToBounds.js","names":["fitViewToBounds","DEFAULT_MAX_ZOOM","DEFAULT_MIN_ZOOM","opts","bounds","currentView","viewportDims","availW","padding","availH","sx","sy","rawX","rawY","u","scaleX","normalizeZoom","maxScale","minScale","scaleY","place","size","scale","avail","start","viewport"],"sources":["../../../src/core/viewport/fitViewToBounds.ts"],"sourcesContent":["import type { View } from './view';\nimport { DEFAULT_MIN_ZOOM, DEFAULT_MAX_ZOOM, normalizeZoom } from './zoomBounds';\n\
|
|
1
|
+
{"version":3,"file":"fitViewToBounds.js","names":["fitViewToBounds","DEFAULT_MAX_ZOOM","DEFAULT_MIN_ZOOM","opts","bounds","currentView","viewportDims","availW","padding","availH","sx","sy","rawX","rawY","u","scaleX","normalizeZoom","maxScale","minScale","scaleY","place","size","scale","avail","start","viewport"],"sources":["../../../src/core/viewport/fitViewToBounds.ts"],"sourcesContent":["import type { View } from './view';\nimport { DEFAULT_MIN_ZOOM, DEFAULT_MAX_ZOOM, normalizeZoom } from './zoomBounds';\n\nimport type { Bounds } from '@weasel-js/routing';\nexport type { Bounds };\n\n/** Pixel dimensions of the canvas viewport. */\nexport interface ViewportDims {\n width: number;\n height: number;\n}\n\n/** Options for {@link fitViewToBounds}. */\nexport interface FitViewToBoundsOptions {\n /** Inset (in CSS px) around the bounds. Default 16. */\n padding?: number;\n /** Defaults to the kit-wide max zoom (`DEFAULT_MAX_ZOOM`). */\n maxScale?: number;\n /** Defaults to the kit-wide min zoom (`DEFAULT_MIN_ZOOM`). */\n minScale?: number;\n /**\n * Fit mode:\n * - `'contain'` (default): uniform scale = `min(availW/w, availH/h)`. Bounds fit entirely; one axis has letterboxing.\n * - `'fill'`: uniform scale = `max(...)`. Bounds overflow viewport on one axis.\n * - `'stretch'`: per-axis scale. Bounds match viewport exactly; scale is non-uniform.\n */\n mode?: 'contain' | 'fill' | 'stretch';\n /**\n * Where bounds that overflow the viewport on an axis sit, which happens when\n * `minScale` stops the fit or `mode` is `'fill'`. `'center'` (default) shows\n * their middle; `'start'` shows their left or top edge, inset by `padding`.\n * An axis that fits is centered either way.\n */\n anchor?: 'center' | 'start';\n}\n\n/**\n * Compute the target {@link View} that fits `bounds` (world space) inside\n * `viewportDims` (CSS px). The bounds are centered in the viewport with\n * uniform padding on all sides; the resulting scale is clamped to the\n * configured min/max.\n *\n * Empty / zero-sized bounds or viewports cannot be fit — in that case this\n * returns `currentView` unchanged and logs a `console.warn`.\n */\nexport function fitViewToBounds(\n bounds: Bounds,\n viewportDims: ViewportDims,\n currentView: View,\n opts: FitViewToBoundsOptions = {},\n): View {\n const { padding = 16, maxScale = DEFAULT_MAX_ZOOM, minScale = DEFAULT_MIN_ZOOM } = opts;\n\n if (bounds.width <= 0 || bounds.height <= 0) {\n console.warn('[weasel] fitViewToBounds: bounds has zero or negative area; returning currentView unchanged.', bounds);\n return currentView;\n }\n if (viewportDims.width <= 0 || viewportDims.height <= 0) {\n console.warn('[weasel] fitViewToBounds: viewport has zero or negative area; returning currentView unchanged.', viewportDims);\n return currentView;\n }\n\n const availW = Math.max(1, viewportDims.width - padding * 2);\n const availH = Math.max(1, viewportDims.height - padding * 2);\n const sx = availW / bounds.width;\n const sy = availH / bounds.height;\n\n let rawX: number;\n let rawY: number;\n switch (opts.mode ?? 'contain') {\n case 'fill': {\n const u = Math.max(sx, sy);\n rawX = u;\n rawY = u;\n break;\n }\n case 'stretch':\n rawX = sx;\n rawY = sy;\n break;\n case 'contain':\n default: {\n const u = Math.min(sx, sy);\n rawX = u;\n rawY = u;\n break;\n }\n }\n const scaleX = normalizeZoom(Math.min(maxScale, Math.max(minScale, rawX)));\n const scaleY = normalizeZoom(Math.min(maxScale, Math.max(minScale, rawY)));\n\n // screenCenter = (worldCenter - view.x) * scale, solved for view.x.\n const place = (start: number, size: number, avail: number, viewport: number, scale: number) =>\n opts.anchor === 'start' && size * scale > avail + 1e-9\n ? start - padding / scale\n : start + size / 2 - viewport / (2 * scale);\n return {\n x: place(bounds.x, bounds.width, availW, viewportDims.width, scaleX),\n y: place(bounds.y, bounds.height, availH, viewportD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nE,GAAGK,EAAMhB,EAAO,GAAGA,EAAO,QAAQK,GAAQH,EAAa,QAAQa,CAAM;EACrE,OAAO;GAAE,GAAGJ;GAAQ,GAAGI;EAAO;CAChC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallax.js","names":["asXY","v","deriveParallaxView","p","opts","z","outer","planeMap","inner","kx","ky","toPlane","m","fromPlane","mapRect","a","map","r","b","rectToPlane","rectFromPlane","planeToPlane","from","to","f","IDENTITY_MAP","t","sx","sy","planeMatrix"],"sources":["../../../src/core/viewport/parallax.ts"],"sourcesContent":["import type { View } from './view';\n\n/** One value for both axes, or a separate value per axis. */\nexport type ScalarOrXY = number | { x: number; y: number };\n\n/** How a parallax plane tracks the camera: `pan` is the fraction of the\n * camera's translation it follows (1 = locked to the scene, 0 = fixed to the\n * screen), `zoom` the same for scale, and `anchor` the camera position\n * (`view.x` / `view.y`) the translation is measured from — every plane lines\n * up when the camera sits there. */\nexport interface ParallaxOpts {\n pan: ScalarOrXY;\n zoom?: ScalarOrXY;\n anchor?: { x: number; y: number };\n}\n\nfunction asXY(v: ScalarOrXY): { x: number; y: number } {\n return typeof v === 'number' ? { x: v, y: v } : v;\n}\n\n/**\n * Pure derivation of a parallax plane's inner `View` from the camera view\n * plus per-plane factors.\n *\n * `pan` controls how much the plane translates with the camera (1 = normal,\n * 0 = locked to `anchor`, >1 = leads). `zoom` controls how much it scales\n * with camera zoom (1 = normal, 0 = fixed at identity scale). `anchor`\n * (default origin) is the camera position at which all planes agree.\n *\n * Identity holds: `pan=1, zoom=1` returns a view equal to `outer`.\n */\nexport function deriveParallaxView(outer: View, opts: ParallaxOpts): View {\n const p = asXY(opts.pan);\n const z = asXY(opts.zoom ?? 1);\n const a = opts.anchor ?? { x: 0, y: 0 };\n return {\n x: a.x + (outer.x - a.x) * p.x,\n y: a.y + (outer.y - a.y) * p.y,\n scale: {\n x: 1 + (outer.scale.x - 1) * z.x,\n y: 1 + (outer.scale.y - 1) * z.y,\n },\n };\n}\n\n/** How a point of the camera's world lands in a plane's world, per axis:\n * `plane = world * scale + offset`. A plane draws its content through its\n * own view; this is what lets a pointer, a marquee or a selection box cross\n * between that view and the camera's. */\nexport interface PlaneMap {\n scale: { x: number; y: number };\n offset: { x: number; y: number };\n}\n\n/** The map from `outer`'s world into the world of a plane drawn through\n * `deriveParallaxView(outer, opts)` — the one that puts both points under the\n * same pixel. */\nexport function planeMap(outer: View, opts: ParallaxOpts): PlaneMap {\n const inner = deriveParallaxView(outer, opts);\n const kx = outer.scale.x / inner.scale.x;\n const ky = outer.scale.y / inner.scale.y;\n return {\n scale: { x: kx, y: ky },\n offset: { x: inner.x - kx * outer.x, y: inner.y - ky * outer.y },\n };\n}\n\n/** Map a point from the outer view's world into the plane's world. */\nexport function toPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: p.x * m.scale.x + m.offset.x, y: p.y * m.scale.y + m.offset.y };\n}\n\n/** Map a point from the plane's world back into the outer view's world. */\nexport function fromPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: (p.x - m.offset.x) / m.scale.x, y: (p.y - m.offset.y) / m.scale.y };\n}\n\
|
|
1
|
+
{"version":3,"file":"parallax.js","names":["asXY","v","deriveParallaxView","p","opts","z","outer","planeMap","inner","kx","ky","toPlane","m","fromPlane","mapRect","a","map","r","b","rectToPlane","rectFromPlane","planeToPlane","from","to","f","IDENTITY_MAP","t","sx","sy","planeMatrix"],"sources":["../../../src/core/viewport/parallax.ts"],"sourcesContent":["import type { Rect } from '@weasel-js/geom';\nimport type { View } from './view';\n\n/** One value for both axes, or a separate value per axis. */\nexport type ScalarOrXY = number | { x: number; y: number };\n\n/** How a parallax plane tracks the camera: `pan` is the fraction of the\n * camera's translation it follows (1 = locked to the scene, 0 = fixed to the\n * screen), `zoom` the same for scale, and `anchor` the camera position\n * (`view.x` / `view.y`) the translation is measured from — every plane lines\n * up when the camera sits there. */\nexport interface ParallaxOpts {\n pan: ScalarOrXY;\n zoom?: ScalarOrXY;\n anchor?: { x: number; y: number };\n}\n\nfunction asXY(v: ScalarOrXY): { x: number; y: number } {\n return typeof v === 'number' ? { x: v, y: v } : v;\n}\n\n/**\n * Pure derivation of a parallax plane's inner `View` from the camera view\n * plus per-plane factors.\n *\n * `pan` controls how much the plane translates with the camera (1 = normal,\n * 0 = locked to `anchor`, >1 = leads). `zoom` controls how much it scales\n * with camera zoom (1 = normal, 0 = fixed at identity scale). `anchor`\n * (default origin) is the camera position at which all planes agree.\n *\n * Identity holds: `pan=1, zoom=1` returns a view equal to `outer`.\n */\nexport function deriveParallaxView(outer: View, opts: ParallaxOpts): View {\n const p = asXY(opts.pan);\n const z = asXY(opts.zoom ?? 1);\n const a = opts.anchor ?? { x: 0, y: 0 };\n return {\n x: a.x + (outer.x - a.x) * p.x,\n y: a.y + (outer.y - a.y) * p.y,\n scale: {\n x: 1 + (outer.scale.x - 1) * z.x,\n y: 1 + (outer.scale.y - 1) * z.y,\n },\n };\n}\n\n/** How a point of the camera's world lands in a plane's world, per axis:\n * `plane = world * scale + offset`. A plane draws its content through its\n * own view; this is what lets a pointer, a marquee or a selection box cross\n * between that view and the camera's. */\nexport interface PlaneMap {\n scale: { x: number; y: number };\n offset: { x: number; y: number };\n}\n\n/** The map from `outer`'s world into the world of a plane drawn through\n * `deriveParallaxView(outer, opts)` — the one that puts both points under the\n * same pixel. */\nexport function planeMap(outer: View, opts: ParallaxOpts): PlaneMap {\n const inner = deriveParallaxView(outer, opts);\n const kx = outer.scale.x / inner.scale.x;\n const ky = outer.scale.y / inner.scale.y;\n return {\n scale: { x: kx, y: ky },\n offset: { x: inner.x - kx * outer.x, y: inner.y - ky * outer.y },\n };\n}\n\n/** Map a point from the outer view's world into the plane's world. */\nexport function toPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: p.x * m.scale.x + m.offset.x, y: p.y * m.scale.y + m.offset.y };\n}\n\n/** Map a point from the plane's world back into the outer view's world. */\nexport function fromPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: (p.x - m.offset.x) / m.scale.x, y: (p.y - m.offset.y) / m.scale.y };\n}\n\nfunction mapRect(r: Rect, map: (p: { x: number; y: number }) => { x: number; y: number }): Rect {\n const a = map({ x: r.x, y: r.y });\n const b = map({ x: r.x + r.width, y: r.y + r.height });\n return {\n x: Math.min(a.x, b.x),\n y: Math.min(a.y, b.y),\n width: Math.abs(b.x - a.x),\n height: Math.abs(b.y - a.y),\n };\n}\n\n/** A camera-world rect in the plane's world. The map is axis-aligned, so a\n * rect stays a rect; a flipped axis is normalized back to a positive size. */\nexport function rectToPlane<R extends Rect>(m: PlaneMap, r: R): R {\n return { ...r, ...mapRect(r, (p) => toPlane(m, p)) };\n}\n\n/** A plane-world rect in the camera's world — see {@link rectToPlane}. */\nexport function rectFromPlane<R extends Rect>(m: PlaneMap, r: R): R {\n return { ...r, ...mapRect(r, (p) => fromPlane(m, p)) };\n}\n\n/** The map from one world into another, where `null` is the camera's own:\n * `fromPlane(from)`, then `toPlane(to)`. Null when the two are the same\n * world, so a caller can skip the work. */\nexport function planeToPlane(from: PlaneMap | null, to: PlaneMap | null): PlaneMap | null {\n if (from === to) return null;\n const f = from ?? IDENTITY_MAP;\n const t = to ?? IDENTITY_MAP;\n const sx = t.scale.x / f.scale.x;\n const sy = t.scale.y / f.scale.y;\n const m = {\n scale: { x: sx, y: sy },\n offset: { x: t.offset.x - f.offset.x * sx, y: t.offset.y - f.offset.y * sy },\n };\n return m.scale.x === 1 && m.scale.y === 1 && m.offset.x === 0 && m.offset.y === 0 ? null : m;\n}\n\nconst IDENTITY_MAP: PlaneMap = { scale: { x: 1, y: 1 }, offset: { x: 0, y: 0 } };\n\n/** The map as an affine matrix in `@weasel-js/geom`'s `[a, b, c, d, e, f]`\n * order, for `transformPath` and friends. */\nexport function planeMatrix(m: PlaneMap): [number, number, number, number, number, number] {\n return [m.scale.x, 0, 0, m.scale.y, m.offset.x, m.offset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a,IAAyB;CAAE,OAAO;EAAE,GAAG;EAAG,GAAG;CAAE;CAAG,QAAQ;EAAE,GAAG;EAAG,GAAG;CAAE;AAAE;AAI/E,SAAgBI,EAAY,GAA+D;CACzF,OAAO;EAACjB,EAAE,MAAM;EAAG;EAAG;EAAGA,EAAE,MAAM;EAAGA,EAAE,OAAO;EAAGA,EAAE,OAAO;CAAC;AAC5D"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { multiply as e,
|
|
1
|
+
import { multiply as e, scale as t } from "@weasel-js/geom";
|
|
2
2
|
//#region src/core/viewport/screenSlop.ts
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
if (n === void 0) return {
|
|
5
5
|
extra: 0,
|
|
6
6
|
opts: {}
|
|
7
7
|
};
|
|
8
|
-
if (typeof
|
|
9
|
-
extra:
|
|
8
|
+
if (typeof n == "number") return {
|
|
9
|
+
extra: n,
|
|
10
10
|
opts: {}
|
|
11
11
|
};
|
|
12
|
-
let
|
|
12
|
+
let i = t(n.scale.x, n.scale.y);
|
|
13
13
|
return {
|
|
14
14
|
extra: 0,
|
|
15
15
|
opts: { slop: {
|
|
16
|
-
px:
|
|
17
|
-
transform:
|
|
16
|
+
px: n.px,
|
|
17
|
+
transform: r ? e(i, r) : i
|
|
18
18
|
} }
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function r(e, t, n = 1) {
|
|
22
22
|
return t > 0 ? typeof e == "object" ? {
|
|
23
23
|
...e,
|
|
24
24
|
px: e.px + t
|
|
25
25
|
} : (e ?? 0) + t / (n > 0 ? n : 1) : e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function i(e) {
|
|
28
28
|
return e === void 0 ? !1 : typeof e == "number" ? e > 0 : e.px > 0;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export {
|
|
31
|
+
export { i as hasSlop, n as slopForStrokeHit, r as widenSlop };
|
|
32
32
|
|
|
33
33
|
//# sourceMappingURL=screenSlop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSlop.js","names":["scaleMat","slopForStrokeHit","slop","s","scale","
|
|
1
|
+
{"version":3,"file":"screenSlop.js","names":["scaleMat","slopForStrokeHit","slop","s","scale","frame","multiply","widenSlop","px","hasSlop"],"sources":["../../../src/core/viewport/screenSlop.ts"],"sourcesContent":["/**\n * Pointer forgiveness measured on screen.\n *\n * A pick slop is a screen distance: \"within 4px of the outline\". Converting it\n * to a world distance — per axis or as one scalar — is exact only when the\n * frame the geometry lives in reaches the screen by a similarity. A rotated\n * node under non-uniform zoom does not: a screen circle pulled back into its\n * frame is a tilted ellipse, so the test is run against the geometry's screen\n * image instead (`strokeHitTest`'s `slop`).\n */\nimport { multiply, scale as scaleMat, type Mat3 } from '@weasel-js/geom';\nimport type { Scale2 } from '@weasel-js/geom';\n\n/** `px` screen pixels under a view whose per-axis scale is `scale`. */\nexport interface ScreenSlop {\n px: number;\n scale: Scale2;\n}\n\n/** A slop in world units (a number, the view-less form) or on screen. */\nexport type PickSlop = number | ScreenSlop;\n\n/**\n * How `strokeHitTest` should apply a slop to geometry in a frame that\n * reaches world by `frame` (`poseFrameOf`; only its linear part is read): a\n * world slop adds to the threshold, a screen slop is handed over with the\n * frame's map to the screen.\n */\nexport function slopForStrokeHit(\n slop: PickSlop | undefined,\n frame?: Mat3 | null,\n): { extra: number; opts: { slop?: { px: number; transform: Mat3 } } } {\n if (slop === undefined) return { extra: 0, opts: {} };\n if (typeof slop === 'number') return { extra: slop, opts: {} };\n const s = scaleMat(slop.scale.x, slop.scale.y);\n return {\n extra: 0,\n opts: { slop: { px: slop.px, transform: frame ? multiply(s, frame) : s } },\n };\n}\n\n/** `slop` widened by `px` screen pixels — kept on screen when it is measured\n * there, and read at `scale` when it is a world distance. */\nexport function widenSlop(slop: PickSlop | undefined, px: number, scale = 1): PickSlop | undefined {\n if (!(px > 0)) return slop;\n if (typeof slop === 'object') return { ...slop, px: slop.px + px };\n return (slop ?? 0) + px / (scale > 0 ? scale : 1);\n}\n\n/** Is any slop set at all? A zero reach plus a zero slop hits nothing. */\nexport function hasSlop(slop: PickSlop | undefined): boolean {\n if (slop === undefined) return false;\n return typeof slop === 'number' ? slop > 0 : slop.px > 0;\n}\n"],"mappings":";;AA4BA,SAAgBC,EACd,GACA,GACqE;CACrE,IAAIC,MAAS,KAAA,GAAW,OAAO;EAAE,OAAO;EAAG,MAAM,CAAC;CAAE;CACpD,IAAI,OAAOA,KAAS,UAAU,OAAO;EAAE,OAAOA;EAAM,MAAM,CAAC;CAAE;CAC7D,IAAMC,IAAIH,EAASE,EAAK,MAAM,GAAGA,EAAK,MAAM,CAAC;CAC7C,OAAO;EACL,OAAO;EACP,MAAM,EAAE,MAAM;GAAE,IAAIA,EAAK;GAAI,WAAWG,IAAQC,EAASH,GAAGE,CAAK,IAAIF;EAAE,EAAE;CAC3E;AACF;AAIA,SAAgBI,EAAU,GAA4B,GAAY,IAAQ,GAAyB;CAGjG,OAFMC,IAAK,IACP,OAAON,KAAS,WAAiB;EAAE,GAAGA;EAAM,IAAIA,EAAK,KAAKM;CAAG,KACzDN,KAAQ,KAAKM,KAAMJ,IAAQ,IAAIA,IAAQ,KAFzBF;AAGxB;AAGA,SAAgBO,EAAQ,GAAqC;CAE3D,OADIP,MAAS,KAAA,IAAkB,KACxB,OAAOA,KAAS,WAAWA,IAAO,IAAIA,EAAK,KAAK;AACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasSize.js","names":["useCanvasSize","useDeviceProfile","size","setSize","useState","measure","useCallback","containerRef","rect","prev","useEffect","observer"],"sources":["../../../src/core/viewport/useCanvasSize.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useState } from 'react';\nimport type { CanvasSize } from './clampView';\nimport { useDeviceProfile } from '../device/useDeviceProfile';\n\n/** Size snapshot returned by `useCanvasSize` — the kit-wide `CanvasSize`\n * (width × height in CSS pixels) plus the current devicePixelRatio. */\nexport interface CanvasSizeSnapshot extends CanvasSize {\n dpr: number;\n}\n\n/** Track a container's content-rect size via `ResizeObserver`, and density via\n * the ambient `DeviceProfile`.\n *\n *
|
|
1
|
+
{"version":3,"file":"useCanvasSize.js","names":["useCanvasSize","useDeviceProfile","size","setSize","useState","measure","useCallback","containerRef","rect","prev","useEffect","observer"],"sources":["../../../src/core/viewport/useCanvasSize.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useState } from 'react';\nimport type { CanvasSize } from './clampView';\nimport { useDeviceProfile } from '../device/useDeviceProfile';\n\n/** Size snapshot returned by `useCanvasSize` — the kit-wide `CanvasSize`\n * (width × height in CSS pixels) plus the current devicePixelRatio. */\nexport interface CanvasSizeSnapshot extends CanvasSize {\n dpr: number;\n}\n\n/** Track a container's content-rect size via `ResizeObserver`, and density via\n * the ambient `DeviceProfile`.\n *\n * Density deliberately does NOT come from a `window.devicePixelRatio` read\n * inside the resize callback: that only refreshes when the element resizes,\n * so dragging a window to a different-density display without resizing it\n * leaves the snapshot stale. */\nexport function useCanvasSize(containerRef: RefObject<HTMLElement | null>): CanvasSizeSnapshot {\n const { dpr } = useDeviceProfile();\n const [size, setSize] = useState<CanvasSize>({ width: 0, height: 0 });\n\n const measure = useCallback(() => {\n if (!containerRef.current) return;\n const rect = containerRef.current.getBoundingClientRect();\n setSize((prev) =>\n prev.width === rect.width && prev.height === rect.height\n ? prev\n : { width: rect.width, height: rect.height },\n );\n }, [containerRef]);\n\n useEffect(() => {\n measure();\n const observer = new ResizeObserver(measure);\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n return () => observer.disconnect();\n }, [measure, containerRef]);\n\n return { width: size.width, height: size.height, dpr };\n}\n"],"mappings":";;;AAiBA,SAAgBA,EAAc,GAAiE;CAC7F,IAAM,EAAE,WAAQC,EAAiB,GAC3B,CAACC,GAAMC,KAAWC,EAAqB;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC,GAE9DC,IAAUC,QAAkB;EAChC,IAAI,CAACC,EAAa,SAAS;EAC3B,IAAMC,IAAOD,EAAa,QAAQ,sBAAsB;EACxD,GAAS,MACPE,EAAK,UAAUD,EAAK,SAASC,EAAK,WAAWD,EAAK,SAC9CC,IACA;GAAE,OAAOD,EAAK;GAAO,QAAQA,EAAK;EAAO,CAC/C;CACF,GAAG,CAACD,CAAY,CAAC;CAWjB,OATAG,QAAgB;EACd,EAAQ;EACR,IAAMC,IAAW,IAAI,eAAeN,CAAO;EAI3C,OAHIE,EAAa,WACfI,EAAS,QAAQJ,EAAa,OAAO,SAE1BI,EAAS,WAAW;CACnC,GAAG,CAACN,GAASE,CAAY,CAAC,GAEnB;EAAE,OAAOL,EAAK;EAAO,QAAQA,EAAK;EAAQ;CAAI;AACvD"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
|
+
import { useVisibleRaf as r } from "@weasel-js/react";
|
|
3
3
|
//#region src/core/viewport/useDecayLoop.ts
|
|
4
4
|
var i = .5;
|
|
5
5
|
function a() {
|
|
6
|
-
let a =
|
|
6
|
+
let a = n(null), o = r((e) => {
|
|
7
7
|
c(e);
|
|
8
|
-
}, { onResume:
|
|
8
|
+
}, { onResume: e(() => {
|
|
9
9
|
a.current && (a.current.lastTime = null);
|
|
10
|
-
}, []) }), s =
|
|
10
|
+
}, []) }), s = e(() => {
|
|
11
11
|
o.cancel(), a.current = null;
|
|
12
|
-
}, [o]), c =
|
|
12
|
+
}, [o]), c = e((e) => {
|
|
13
13
|
let t = a.current;
|
|
14
14
|
if (!t) return;
|
|
15
15
|
if (t.lastTime === null) {
|
|
@@ -29,7 +29,7 @@ function a() {
|
|
|
29
29
|
t.boundary === "stop" ? (e !== void 0 && o < e ? (s = e - t.posX, t.vx = 0) : n !== void 0 && o > n && (s = n - t.posX, t.vx = 0), r !== void 0 && l < r ? (c = r - t.posY, t.vy = 0) : a !== void 0 && l > a && (c = a - t.posY, t.vy = 0)) : t.boundary === "spring" ? (e !== void 0 && o < e ? (s = e - t.posX, t.vx = Math.abs(t.vx) * i) : n !== void 0 && o > n && (s = n - t.posX, t.vx = -Math.abs(t.vx) * i), r !== void 0 && l < r ? (c = r - t.posY, t.vy = Math.abs(t.vy) * i) : a !== void 0 && l > a && (c = a - t.posY, t.vy = -Math.abs(t.vy) * i)) : (e !== void 0 && o < e ? (s = e - t.posX, t.vx = Math.abs(t.vx)) : n !== void 0 && o > n && (s = n - t.posX, t.vx = -Math.abs(t.vx)), r !== void 0 && l < r ? (c = r - t.posY, t.vy = Math.abs(t.vy)) : a !== void 0 && l > a && (c = a - t.posY, t.vy = -Math.abs(t.vy))), t.posX += s, t.posY += c;
|
|
30
30
|
}
|
|
31
31
|
t.onTick(s, c), o.request();
|
|
32
|
-
}, [o]), l =
|
|
32
|
+
}, [o]), l = e((e) => {
|
|
33
33
|
s();
|
|
34
34
|
let { velocity: t, friction: n = .92, minSpeed: r = .01, viewBounds: i, boundary: c, initialPosition: l, onTick: u, onEnd: d } = e;
|
|
35
35
|
if (Math.sqrt(t.vx ** 2 + t.vy ** 2) < r) {
|
|
@@ -50,7 +50,7 @@ function a() {
|
|
|
50
50
|
onEnd: d
|
|
51
51
|
}, o.request();
|
|
52
52
|
}, [s, o]);
|
|
53
|
-
return
|
|
53
|
+
return t(() => () => {
|
|
54
54
|
s();
|
|
55
55
|
}, [s]), {
|
|
56
56
|
start: l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDecayLoop.js","names":["SPRING_DAMPING","useDecayLoop","stateRef","useRef","frameLoop","useVisibleRaf","now","useCallback","cancel","tick","s","dt","f","dx","dy","newX","newY","minX","maxX","minY","maxY","start","config","velocity","minSpeed","initialPosition","useEffect"],"sources":["../../../src/core/viewport/useDecayLoop.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useVisibleRaf } from '
|
|
1
|
+
{"version":3,"file":"useDecayLoop.js","names":["SPRING_DAMPING","useDecayLoop","stateRef","useRef","frameLoop","useVisibleRaf","now","useCallback","cancel","tick","s","dt","f","dx","dy","newX","newY","minX","maxX","minY","maxY","start","config","velocity","minSpeed","initialPosition","useEffect"],"sources":["../../../src/core/viewport/useDecayLoop.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useVisibleRaf } from '@weasel-js/react';\n\n/** Per-axis limits on a view's position. Any side may be left open. */\nexport interface PanBounds {\n minX?: number;\n maxX?: number;\n minY?: number;\n maxY?: number;\n}\n\n/** Momentum settings for a pan: how quickly a flung view slows, when it stops,\n * and what happens at the pan limits. The `DecayLoopConfig` fields a caller\n * chooses up front, without the per-gesture `velocity` / `onTick`. */\nexport interface InertiaConfig {\n friction?: number;\n minSpeed?: number;\n /** What to do when inertial pan reaches `bounds`. Default: no clamping. */\n boundary?: 'stop' | 'bounce' | 'spring';\n /** View-coordinate limits for boundary clamping. Requires `boundary` to take effect. */\n bounds?: PanBounds;\n}\n\n/** How a decay should run: its starting velocity, how fast it slows, and what\n * happens if it reaches the pan limits. */\nexport interface DecayLoopConfig {\n velocity: { vx: number; vy: number };\n friction?: number;\n minSpeed?: number;\n /** Bounds for boundary clamping. Requires `boundary` to take effect. */\n viewBounds?: PanBounds;\n /**\n * What to do when the accumulated position hits `viewBounds`. Default: no clamping.\n * - `'stop'`: clamp at boundary, kill velocity component.\n * - `'bounce'`: linear reflection — flip velocity sign, magnitude preserved.\n * - `'spring'`: damped reflection — flip velocity sign and shrink magnitude\n * by `SPRING_DAMPING` per bounce so the motion settles naturally.\n */\n boundary?: 'stop' | 'bounce' | 'spring';\n /** Starting position for internal boundary tracking. Required when `viewBounds` is set. */\n initialPosition?: { x: number; y: number };\n onTick: (dx: number, dy: number) => void;\n onEnd?: () => void;\n}\n\n/**\n * Fraction of velocity preserved per `'spring'` bounce. 0.5 means each bounce\n * loses half its energy, giving a quick visible settle (typically 2–4 bounces\n * before `minSpeed` cuts the loop). Fixed for v1; a future `bounceDamping`\n * config option could expose this if a consumer needs control.\n */\nconst SPRING_DAMPING = 0.5;\n\n/** A rAF loop that coasts a value to a stop under friction, reporting the\n * per-frame delta. What turns a released pan drag into momentum scrolling. */\nexport function useDecayLoop() {\n const stateRef = useRef<{\n vx: number; vy: number;\n friction: number; minSpeed: number;\n lastTime: number | null;\n posX: number; posY: number;\n viewBounds: PanBounds | undefined;\n boundary: 'stop' | 'bounce' | 'spring' | undefined;\n onTick: (dx: number, dy: number) => void;\n onEnd?: () => void;\n } | null>(null);\n\n const frameLoop = useVisibleRaf(\n (now: number) => { tick(now); },\n {\n // Coasting does not continue while suspended: dropping `lastTime` makes\n // the resuming frame seed a fresh interval instead of applying an hour of\n // friction at once, which would end the decay before it was seen.\n onResume: useCallback(() => {\n if (stateRef.current) stateRef.current.lastTime = null;\n }, []),\n },\n );\n\n const cancel = useCallback(() => {\n frameLoop.cancel();\n stateRef.current = null;\n }, [frameLoop]);\n\n const tick = useCallback((now: number) => {\n const s = stateRef.current;\n if (!s) return;\n if (s.lastTime === null) {\n s.lastTime = now;\n frameLoop.request();\n return;\n }\n const dt = Math.min(now - s.lastTime, 64); // cap at 64ms to avoid huge jumps\n s.lastTime = now;\n // Time-normalize friction to 60fps baseline\n const f = Math.pow(s.friction, dt / 16.67);\n s.vx *= f;\n s.vy *= f;\n const speed = Math.sqrt(s.vx * s.vx + s.vy * s.vy);\n if (speed < s.minSpeed) {\n stateRef.current = null;\n frameLoop.cancel();\n s.onEnd?.();\n return;\n }\n let dx = s.vx * dt;\n let dy = s.vy * dt;\n if (s.viewBounds && s.boundary) {\n const { minX, maxX, minY, maxY } = s.viewBounds;\n const newX = s.posX + dx;\n const newY = s.posY + dy;\n if (s.boundary === 'stop') {\n if (minX !== undefined && newX < minX) { dx = minX - s.posX; s.vx = 0; }\n else if (maxX !== undefined && newX > maxX) { dx = maxX - s.posX; s.vx = 0; }\n if (minY !== undefined && newY < minY) { dy = minY - s.posY; s.vy = 0; }\n else if (maxY !== undefined && newY > maxY) { dy = maxY - s.posY; s.vy = 0; }\n } else if (s.boundary === 'spring') {\n // Damped reflection: flip sign AND scale magnitude by SPRING_DAMPING so\n // each bounce loses energy. Once |v| < minSpeed the outer loop ends.\n if (minX !== undefined && newX < minX) { dx = minX - s.posX; s.vx = Math.abs(s.vx) * SPRING_DAMPING; }\n else if (maxX !== undefined && newX > maxX) { dx = maxX - s.posX; s.vx = -Math.abs(s.vx) * SPRING_DAMPING; }\n if (minY !== undefined && newY < minY) { dy = minY - s.posY; s.vy = Math.abs(s.vy) * SPRING_DAMPING; }\n else if (maxY !== undefined && newY > maxY) { dy = maxY - s.posY; s.vy = -Math.abs(s.vy) * SPRING_DAMPING; }\n } else {\n if (minX !== undefined && newX < minX) { dx = minX - s.posX; s.vx = Math.abs(s.vx); }\n else if (maxX !== undefined && newX > maxX) { dx = maxX - s.posX; s.vx = -Math.abs(s.vx); }\n if (minY !== undefined && newY < minY) { dy = minY - s.posY; s.vy = Math.abs(s.vy); }\n else if (maxY !== undefined && newY > maxY) { dy = maxY - s.posY; s.vy = -Math.abs(s.vy); }\n }\n s.posX += dx;\n s.posY += dy;\n }\n s.onTick(dx, dy);\n frameLoop.request();\n }, [frameLoop]);\n\n const start = useCallback((config: DecayLoopConfig) => {\n cancel();\n const { velocity, friction = 0.92, minSpeed = 0.01, viewBounds, boundary, initialPosition, onTick, onEnd } = config;\n const speed = Math.sqrt(velocity.vx ** 2 + velocity.vy ** 2);\n if (speed < minSpeed) { onEnd?.(); return; }\n stateRef.current = {\n vx: velocity.vx, vy: velocity.vy, friction, minSpeed, lastTime: null,\n posX: initialPosition?.x ?? 0, posY: initialPosition?.y ?? 0,\n viewBounds, boundary,\n onTick, onEnd,\n };\n frameLoop.request();\n }, [cancel, frameLoop]);\n\n useEffect(() => () => { cancel(); }, [cancel]);\n\n return { start, cancel };\n}\n"],"mappings":";;;AAmDA,IAAMA,IAAiB;AAIvB,SAAgBC,IAA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W,KAAM,eAAY,aAAU,oBAAiB,WAAQ,aAAUe;EAE7G,IADc,KAAK,KAAKC,EAAS,MAAM,IAAIA,EAAS,MAAM,CACtD,IAAQC,GAAU;GAAE,IAAQ;GAAG;EAAQ;EAO3C,AANA,EAAS,UAAU;GACjB,IAAID,EAAS;GAAI,IAAIA,EAAS;GAAI;GAAU;GAAU,UAAU;GAChE,MAAME,GAAiB,KAAK;GAAG,MAAMA,GAAiB,KAAK;GAC3D;GAAY;GACZ;GAAQ;EACV,GACArB,EAAU,QAAQ;CACpB,GAAG,CAACI,GAAQJ,CAAS,CAAC;CAItB,OAFAsB,cAAsB;EAAE,EAAO;CAAG,GAAG,CAAClB,CAAM,CAAC,GAEtC;EAAE;EAAO;CAAO;AACzB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useCanvasSize as e } from "./useCanvasSize.js";
|
|
2
|
+
import { composeWorldPose as t } from "../scene/composeFrame.js";
|
|
3
|
+
import { composeRectPose as n } from "../scene/composePose.js";
|
|
4
|
+
import { effectivePose as r } from "../scene/effectivePose.js";
|
|
5
|
+
import { applyToPoint as i, invert as a, multiply as o, poseFrameOf as s } from "@weasel-js/geom";
|
|
6
|
+
import { useCallback as c, useInsertionEffect as l, useRef as u } from "react";
|
|
7
|
+
//#region src/core/viewport/useNodeOverlayFrame.ts
|
|
8
|
+
function d(t, n, r, d = {}) {
|
|
9
|
+
let { width: h, height: g } = e(n), { view: _, compose: v } = d, y = c(() => {
|
|
10
|
+
let e = p(t, r, v);
|
|
11
|
+
if (!e) return null;
|
|
12
|
+
let n = s(e), i = m(f(_));
|
|
13
|
+
return n ? o(i, n) : i;
|
|
14
|
+
}, [
|
|
15
|
+
t,
|
|
16
|
+
r,
|
|
17
|
+
v,
|
|
18
|
+
_
|
|
19
|
+
]), b = c((e) => {
|
|
20
|
+
let t = y();
|
|
21
|
+
if (!t) return e;
|
|
22
|
+
let [n, r] = i(t, e.x, e.y);
|
|
23
|
+
return {
|
|
24
|
+
x: n,
|
|
25
|
+
y: r
|
|
26
|
+
};
|
|
27
|
+
}, [y]), x = u(null), S = c((e) => {
|
|
28
|
+
let t = y(), n = t && a(t);
|
|
29
|
+
n && (x.current = n);
|
|
30
|
+
let [r, o] = i(n ?? x.current, e.x, e.y);
|
|
31
|
+
return {
|
|
32
|
+
x: r,
|
|
33
|
+
y: o
|
|
34
|
+
};
|
|
35
|
+
}, [y]), C = p(t, r, v), w = C && h !== 0 && g !== 0 ? y() : null, T = w && a(w);
|
|
36
|
+
return l(() => {
|
|
37
|
+
T && (x.current = T);
|
|
38
|
+
}), !C || !T ? null : {
|
|
39
|
+
box: {
|
|
40
|
+
x: C.x,
|
|
41
|
+
y: C.y,
|
|
42
|
+
width: C.width,
|
|
43
|
+
height: C.height
|
|
44
|
+
},
|
|
45
|
+
toScreen: b,
|
|
46
|
+
toLocal: S,
|
|
47
|
+
width: h,
|
|
48
|
+
height: g
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function f(e) {
|
|
52
|
+
return typeof e == "function" ? e() : e;
|
|
53
|
+
}
|
|
54
|
+
function p(e, i, a) {
|
|
55
|
+
if (i == null) return null;
|
|
56
|
+
let o = e.nodes;
|
|
57
|
+
return o.has(i) ? t({
|
|
58
|
+
getPose: (t) => r(e, o.get(t)),
|
|
59
|
+
getParent: (e) => o.get(e)?.parent ?? null
|
|
60
|
+
}, i, a ?? n) : null;
|
|
61
|
+
}
|
|
62
|
+
function m(e) {
|
|
63
|
+
if (!e) return [
|
|
64
|
+
1,
|
|
65
|
+
0,
|
|
66
|
+
0,
|
|
67
|
+
1,
|
|
68
|
+
0,
|
|
69
|
+
0
|
|
70
|
+
];
|
|
71
|
+
let { x: t, y: n } = e.scale;
|
|
72
|
+
return [
|
|
73
|
+
t,
|
|
74
|
+
0,
|
|
75
|
+
0,
|
|
76
|
+
n,
|
|
77
|
+
-e.x * t,
|
|
78
|
+
-e.y * n
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { d as useNodeOverlayFrame };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=useNodeOverlayFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodeOverlayFrame.js","names":["useNodeOverlayFrame","useCanvasSize","containerRef","options","project","useCallback","box","worldBoxOf","scene","nodeId","compose","frame","poseFrameOf","toView","viewMatrix","resolveView","view","multiply","toScreen","m","p","x","y","applyToPoint","lastInverse","useRef","toLocal","inverse","invert","width","height","useInsertionEffect","nodes","composeWorldPose","effectivePose","id","composeRectPose","sx","sy"],"sources":["../../../src/core/viewport/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 * `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. The pose's rotation and\n * `transform` live in this hook, not in those: a node's stored geometry is\n * in its box by definition.\n */\nimport { useCallback, useInsertionEffect, useRef, type RefObject } from 'react';\nimport { applyToPoint, invert, multiply, poseFrameOf, type Mat3 } from '@weasel-js/geom';\nimport type { Node, RectPose, Scene } from '../scene/types';\nimport { useCanvasSize } from './useCanvasSize';\nimport type { View } from './view';\nimport { composeRectPose, composeWorldPose } from 'core/scene/composePose';\nimport { effectivePose } from 'core/scene/effectivePose';\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: the pose's rotation and `transform`,\n * then the view. */\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 moves without a render,\n * so pass the handle's `getView`. Omit it and world units are handed\n * 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 or the pose's `transform` collapses an\n * axis to zero.\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 const frame = poseFrameOf(box);\n const toView = viewMatrix(resolveView(view));\n return frame ? multiply(toView, frame) : toView;\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"],"mappings":";;;;;;;AAiEA,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;EAC7C,IAAI,CAACJ,GAAK,OAAO;EACjB,IAAMK,IAAQC,EAAYN,CAAG,GACvBO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AM,IAAIvB,CAAM,IAOdwB,EAAiB;EAHtB,UAAU,MAAeC,EAAc1B,GAAOwB,EAAM,IAAIG,CAAE,CAAE;EAC5D,YAAY,MAAeH,EAAM,IAAIG,CAAE,CAAC,EAAE,UAAU;CAE9B,GAAS1B,GAAQC,KAAW0B,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"}
|
|
@@ -1,63 +1,122 @@
|
|
|
1
1
|
import { normalizeView as e } from "./view.js";
|
|
2
2
|
import { fitViewToBounds as t } from "./fitViewToBounds.js";
|
|
3
3
|
import { interpolateView as n } from "./interpolateView.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { easeOutCubic as r } from "@weasel-js/geom";
|
|
5
|
+
import { useId as i, useMemo as a, useRef as o } from "react";
|
|
6
|
+
import { useLatest as s } from "@weasel-js/react";
|
|
7
|
+
import { createTarget as c, useAnimator as l } from "@weasel-js/animator";
|
|
8
8
|
//#region src/core/viewport/useViewAnimation.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var u = "view", d = 250, f = {
|
|
10
|
+
count: 4,
|
|
11
|
+
names: [
|
|
12
|
+
"x",
|
|
13
|
+
"y",
|
|
14
|
+
"scale.x",
|
|
15
|
+
"scale.y"
|
|
16
|
+
],
|
|
17
|
+
to: (e) => [
|
|
18
|
+
e.x,
|
|
19
|
+
e.y,
|
|
20
|
+
e.scale.x,
|
|
21
|
+
e.scale.y
|
|
22
|
+
],
|
|
23
|
+
from: (e) => ({
|
|
24
|
+
x: e[0],
|
|
25
|
+
y: e[1],
|
|
26
|
+
scale: {
|
|
27
|
+
x: e[2],
|
|
28
|
+
y: e[3]
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
add: (e, t) => ({
|
|
32
|
+
x: e.x + t[0],
|
|
33
|
+
y: e.y + t[1],
|
|
34
|
+
scale: {
|
|
35
|
+
x: e.scale.x + t[2],
|
|
36
|
+
y: e.scale.y + t[3]
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
write: (e, t, n) => {
|
|
40
|
+
t[n] = e.x, t[n + 1] = e.y, t[n + 2] = e.scale.x, t[n + 3] = e.scale.y;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
function p(e, t) {
|
|
44
|
+
let n = l();
|
|
45
|
+
return m(e, t ?? n);
|
|
13
46
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
return
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
function m(l, p) {
|
|
48
|
+
let m = `${u}:${i()}`, h = s(l), g = s(p), _ = o(null), v = o(!1);
|
|
49
|
+
return a(() => {
|
|
50
|
+
let i = null, a = null, o = () => {
|
|
51
|
+
if (i) return i;
|
|
52
|
+
let e = h.current.get();
|
|
53
|
+
return a ? f.from(f.to(e).map((e, t) => e - a[t])) : e;
|
|
54
|
+
}, s = (t) => {
|
|
55
|
+
v.current = !0;
|
|
56
|
+
try {
|
|
57
|
+
h.current.set(e(t));
|
|
58
|
+
} finally {
|
|
59
|
+
v.current = !1;
|
|
60
|
+
}
|
|
61
|
+
}, l = c({
|
|
62
|
+
axes: f,
|
|
63
|
+
get: o,
|
|
64
|
+
set: (e) => {
|
|
65
|
+
i = e, a = null;
|
|
66
|
+
},
|
|
67
|
+
show: (e) => {
|
|
68
|
+
if (l.active) {
|
|
69
|
+
i || (i = o(), a = null), s(e);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let t = i;
|
|
73
|
+
i = a = null, t && s(t);
|
|
74
|
+
}
|
|
75
|
+
}), u = () => g.current.isActive(m), p = () => u() ? _.current : null, y = () => {
|
|
76
|
+
g.current.cancelKey(m), _.current = null;
|
|
77
|
+
}, b = () => {
|
|
78
|
+
y(), l.active || (i = a = null);
|
|
79
|
+
}, x = (t, c = {}) => {
|
|
80
|
+
let u = e(typeof t == "function" ? t(p() ?? o()) : t);
|
|
81
|
+
_.current = u, g.current.tween({
|
|
82
|
+
target: l,
|
|
83
|
+
to: u,
|
|
84
|
+
ms: c.ms ?? d,
|
|
85
|
+
easing: c.easing ?? r,
|
|
86
|
+
interpolator: c.interpolator ?? n,
|
|
87
|
+
cancelKey: m,
|
|
36
88
|
onDone: () => {
|
|
37
|
-
|
|
89
|
+
_.current = null, s(l.read()), l.active || (i = a = null), c.onDone?.();
|
|
38
90
|
}
|
|
39
91
|
});
|
|
40
92
|
};
|
|
41
93
|
return {
|
|
42
|
-
animate:
|
|
94
|
+
animate: x,
|
|
43
95
|
animateToBounds: (e, n, r = {}) => {
|
|
44
|
-
let i =
|
|
45
|
-
a !== i &&
|
|
96
|
+
let i = h.current.get(), a = t(e, n, i, r);
|
|
97
|
+
a !== i && x(a, r);
|
|
46
98
|
},
|
|
47
|
-
stop:
|
|
48
|
-
isAnimating:
|
|
49
|
-
target:
|
|
99
|
+
stop: b,
|
|
100
|
+
isAnimating: u,
|
|
101
|
+
target: p,
|
|
50
102
|
stopIfExternal: () => {
|
|
51
|
-
|
|
52
|
-
|
|
103
|
+
if (!v.current) {
|
|
104
|
+
if (y(), l.active) {
|
|
105
|
+
let e = f.to(l.read()), t = f.to(o());
|
|
106
|
+
a = e.map((e, n) => e - t[n]);
|
|
107
|
+
} else a = null;
|
|
108
|
+
i = null;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
viewTarget: l
|
|
53
112
|
};
|
|
54
113
|
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
114
|
+
m,
|
|
115
|
+
h,
|
|
116
|
+
g
|
|
58
117
|
]);
|
|
59
118
|
}
|
|
60
119
|
//#endregion
|
|
61
|
-
export {
|
|
120
|
+
export { u as VIEW_ANIMATION_KEY, p as useViewAnimation, m as useViewAnimationOn, f as viewAxes };
|
|
62
121
|
|
|
63
122
|
//# sourceMappingURL=useViewAnimation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewAnimation.js","names":["VIEW_ANIMATION_KEY","DEFAULT_MS","useViewAnimation","own","useAnimator","useViewAnimationOn","view","animator","key","useId","viewRef","useLatest","animatorRef","targetRef","useRef","writingRef","useMemo","isAnimating","target","stop","animate","from","resolved","normalizeView","to","opts","easeOutCubic","interpolateView","v","current","fitted","fitViewToBounds","bounds","dims"],"sources":["../../../src/core/viewport/useViewAnimation.ts"],"sourcesContent":["import { useId, useMemo, useRef } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { useAnimator } from '../../animation/useAnimator';\nimport { easeOutCubic } from '@weasel-js/geom';\nimport type { Animator, EasingSpec, InterpolatorFactory } from '../../animation/types';\nimport { interpolateView } from './interpolateView';\nimport { fitViewToBounds } from './fitViewToBounds';\nimport type { Bounds, FitViewToBoundsOptions, ViewportDims } from './fitViewToBounds';\nimport { normalizeView, type View } from './view';\n\n/** Cancel-key prefix. Each hook instance appends its own id, so two runners\n * sharing an animator do not cancel each other. */\nexport const VIEW_ANIMATION_KEY = 'view';\n\nconst DEFAULT_MS = 250;\n\n/** How the camera should move. */\nexport interface ViewAnimationOptions {\n /** Duration in ms. Default 250. */\n ms?: number;\n /** Easing curve. Default `easeOutCubic`. */\n easing?: EasingSpec;\n /** Replace the kit's log-scale / fixed-anchor curve. */\n interpolator?: InterpolatorFactory<View>;\n /** Fires when the target is reached. Not called on cancel. */\n onDone?: () => void;\n}\n\n/** Options accepted by {@link ViewAnimationApi.animateToBounds}. */\nexport interface AnimateToBoundsOptions extends FitViewToBoundsOptions, ViewAnimationOptions {}\n\n/** What the runner reads and writes. On `<SceneCanvas>` this is the same\n * channel `view.set` uses, so a camera animation on an uncontrolled canvas\n * costs no React render. */\nexport interface ViewChannel {\n get(): View;\n set(v: View): void;\n}\n\n/** The camera animation surface. One animation at a time. */\nexport interface ViewAnimationApi {\n /** Glide from the live view to `to`. A thunk receives the pending target when\n * one is in flight, so successive discrete steps compound. */\n animate(to: View | ((base: View) => View), opts?: ViewAnimationOptions): void;\n /** `fitViewToBounds` composed with `animate`. */\n animateToBounds(bounds: Bounds, dims: ViewportDims, opts?: AnimateToBoundsOptions): void;\n /** Cancel. The view stays where it is — no jump to the target. */\n stop(): void;\n isAnimating(): boolean;\n /** Where the in-flight animation is heading, or null when none is. */\n target(): View | null;\n /** Cancel unless the write that prompted this came from the runner's own\n * per-frame write. Feed it from every channel that can move the camera. */\n stopIfExternal(): void;\n}\n\n/**\n * Animate the viewport `View`. Runs on the kit's {@link Animator} — pass one to\n * share a canvas's animator, or omit it and the hook makes its own. A caller\n * that always has one should use {@link useViewAnimationOn}, which builds none.\n *\n * Every animation from one instance registers under that instance's cancel key,\n * so starting one cancels whatever *it* had in flight, and each starts from the\n * *live* view rather than a captured value — an interrupted camera never jumps.\n * Two instances on one animator are independent.\n */\nexport function useViewAnimation(view: ViewChannel, animator?: Animator): ViewAnimationApi {\n const own = useAnimator();\n return useViewAnimationOn(view, animator ?? own);\n}\n\n/** {@link useViewAnimation} on an animator the caller owns. Constructs no\n * animator of its own, so the camera runs on exactly the one passed. */\nexport function useViewAnimationOn(view: ViewChannel, animator: Animator): ViewAnimationApi {\n const key = `${VIEW_ANIMATION_KEY}:${useId()}`;\n const viewRef = useLatest(view);\n const animatorRef = useLatest(animator);\n const targetRef = useRef<View | null>(null);\n const writingRef = useRef(false);\n\n return useMemo<ViewAnimationApi>(() => {\n const isAnimating = () => animatorRef.current.isActive(key);\n const target = () => (isAnimating() ? targetRef.current : null);\n const stop = () => {\n animatorRef.current.cancelKey(key);\n targetRef.current = null;\n };\n\n const animate: ViewAnimationApi['animate'] = (to, opts = {}) => {\n const from = viewRef.current.get();\n const resolved = normalizeView(typeof to === 'function' ? to(target() ?? from) : to);\n stop();\n targetRef.current = resolved;\n animatorRef.current.tween<View>({\n from,\n to: resolved,\n ms: opts.ms ?? DEFAULT_MS,\n easing: opts.easing ?? easeOutCubic,\n interpolator: opts.interpolator ?? interpolateView,\n cancelKey: key,\n onTick: (v) => {\n writingRef.current = true;\n try { viewRef.current.set(v); } finally { writingRef.current = false; }\n },\n onDone: () => {\n targetRef.current = null;\n opts.onDone?.();\n },\n });\n };\n\n return {\n animate,\n animateToBounds: (bounds, dims, opts = {}) => {\n const current = viewRef.current.get();\n const fitted = fitViewToBounds(bounds, dims, current, opts);\n if (fitted === current) return; // helper bailed (zero-area bounds/viewport)\n animate(fitted, opts);\n },\n stop,\n isAnimating,\n target,\n stopIfExternal: () => { if (!writingRef.current) stop(); },\n };\n }, [key, viewRef, animatorRef]);\n}\n"],"mappings":";;;;;;;;AAYA,IAAaA,IAAqB,QAE5BC,IAAa;AAoDnB,SAAgBC,EAAiB,GAAmB,GAAuC;CACzF,IAAMC,IAAMC,EAAY;CACxB,OAAOC,EAAmBC,GAAMC,KAAYJ,CAAG;AACjD;AAIA,SAAgBE,EAAmB,GAAmB,GAAsC;CAC1F,IAAMG,IAAM,GAAGR,EAAmB,GAAGS,EAAM,KACrCC,IAAUC,EAAUL,CAAI,GACxBM,IAAcD,EAAUJ,CAAQ,GAChCM,IAAYC,EAAoB,IAAI,GACpCC,IAAaD,EAAO,EAAK;CAE/B,OAAOE,QAAgC;EACrC,IAAMC,UAAoBL,EAAY,QAAQ,SAASJ,CAAG,GACpDU,UAAgBD,EAAY,IAAIJ,EAAU,UAAU,MACpDM,UAAa;GAEjB,AADAP,EAAY,QAAQ,UAAUJ,CAAG,GACjC,EAAU,UAAU;EACtB,GAEMY,KAAwC,GAAI,IAAO,CAAC,MAAM;GAC9D,IAAMC,IAAOX,EAAQ,QAAQ,IAAI,GAC3BY,IAAWC,EAAc,OAAOC,KAAO,aAAaA,EAAGN,EAAO,KAAKG,CAAI,IAAIG,CAAE;GAGnF,AAFAL,EAAK,GACL,EAAU,UAAUG,GACpBV,EAAY,QAAQ,MAAY;IAC9B;IACA,IAAIU;IACJ,IAAIG,EAAK,MAAMxB;IACf,QAAQwB,EAAK,UAAUC;IACvB,cAAcD,EAAK,gBAAgBE;IACnC,WAAWnB;IACX,SAAS,MAAM;KACb,EAAW,UAAU;KACrB,IAAI;MAAE,EAAQ,QAAQ,IAAIoB,CAAC;KAAG,UAAU;MAAE,EAAW,UAAU;KAAO;IACxE;IACA,cAAc;KAEZ,AADA,EAAU,UAAU,MACpBH,EAAK,SAAS;IAChB;GACF,CAAC;EACH;EAEA,OAAO;GACL;GACA,kBAAkB,GAAQ,GAAM,IAAO,CAAC,MAAM;IAC5C,IAAMI,IAAUnB,EAAQ,QAAQ,IAAI,GAC9BoB,IAASC,EAAgBC,GAAQC,GAAMJ,GAASJ,CAAI;IAC1D,AAAIK,MAAWD,KACfT,EAAQU,GAAQL,CAAI;GACtB;GACA;GACA;GACA;GACA,sBAAsB;IAAE,AAAKV,EAAW,WAASI,EAAK;GAAG;EAC3D;CACF,GAAG;EAACX;EAAKE;EAASE;CAAW,CAAC;AAChC"}
|
|
1
|
+
{"version":3,"file":"useViewAnimation.js","names":["VIEW_ANIMATION_KEY","DEFAULT_MS","viewAxes","v","a","d","at","useViewAnimation","own","useAnimator","useViewAnimationOn","view","animator","key","useId","viewRef","useLatest","animatorRef","targetRef","useRef","writingRef","useMemo","committed","offset","base","live","n","i","write","normalizeView","viewTarget","createTarget","landed","isAnimating","target","cancel","stop","animate","resolved","to","opts","easeOutCubic","interpolateView","current","fitted","fitViewToBounds","bounds","dims","shown","under"],"sources":["../../../src/core/viewport/useViewAnimation.ts"],"sourcesContent":["import { useId, useMemo, useRef } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { useAnimator } from '@weasel-js/animator';\nimport { easeOutCubic } from '@weasel-js/geom';\nimport type { Animator, EasingSpec, InterpolatorFactory } from '@weasel-js/animator';\nimport { createTarget, type Target, type TargetAxes } from '@weasel-js/animator';\nimport { interpolateView } from './interpolateView';\nimport { fitViewToBounds } from './fitViewToBounds';\nimport type { Bounds, FitViewToBoundsOptions, ViewportDims } from './fitViewToBounds';\nimport { normalizeView, type View } from './view';\n\n/** Cancel-key prefix. Each hook instance appends its own id, so two runners\n * sharing an animator do not cancel each other. */\nexport const VIEW_ANIMATION_KEY = 'view';\n\nconst DEFAULT_MS = 250;\n\n/** How the camera should move. */\nexport interface ViewAnimationOptions {\n /** Duration in ms. Default 250. */\n ms?: number;\n /** Easing curve. Default `easeOutCubic`. */\n easing?: EasingSpec;\n /** Replace the kit's log-scale / fixed-anchor curve. */\n interpolator?: InterpolatorFactory<View>;\n /** Fires when the target is reached. Not called on cancel. */\n onDone?: () => void;\n}\n\n/** Options accepted by {@link ViewAnimationApi.animateToBounds}. */\nexport interface AnimateToBoundsOptions extends FitViewToBoundsOptions, ViewAnimationOptions {}\n\n/** What the runner reads and writes. On `<SceneCanvas>` this is the same\n * channel `view.set` uses, so a camera animation on an uncontrolled canvas\n * costs no React render. */\nexport interface ViewChannel {\n get(): View;\n set(v: View): void;\n}\n\n/** The camera animation surface. Its own animations run one at a time. */\nexport interface ViewAnimationApi {\n /** Glide from the live view to `to`. A thunk receives the pending target when\n * one is in flight, so successive discrete steps compound. */\n animate(to: View | ((base: View) => View), opts?: ViewAnimationOptions): void;\n /** `fitViewToBounds` composed with `animate`. */\n animateToBounds(bounds: Bounds, dims: ViewportDims, opts?: AnimateToBoundsOptions): void;\n /** Cancel. The view stays where it is — no jump to the target. */\n stop(): void;\n isAnimating(): boolean;\n /** Where the in-flight animation is heading, or null when none is. */\n target(): View | null;\n /** Cancel unless the write that prompted this came from the runner's own\n * per-frame write. Feed it from every channel that can move the camera. */\n stopIfExternal(): void;\n /**\n * The view as a {@link Target}, for running another animation on it: a shake\n * or a nudge adds to a camera animation in flight, and neither cancels the\n * other. Move it with the animator this runner was given, and without this\n * runner's cancel key. `stop` and an outside write leave such an animation\n * running.\n */\n readonly viewTarget: Target<View>;\n}\n\n/** A `View` as the four numbers an animation moves: `x`, `y`, `scale.x`, `scale.y`. */\nexport const viewAxes: TargetAxes<View> = {\n count: 4,\n names: ['x', 'y', 'scale.x', 'scale.y'],\n to: (v) => [v.x, v.y, v.scale.x, v.scale.y],\n from: (a) => ({ x: a[0]!, y: a[1]!, scale: { x: a[2]!, y: a[3]! } }),\n add: (v, d) => ({ x: v.x + d[0]!, y: v.y + d[1]!, scale: { x: v.scale.x + d[2]!, y: v.scale.y + d[3]! } }),\n write: (v, out, at) => {\n out[at] = v.x;\n out[at + 1] = v.y;\n out[at + 2] = v.scale.x;\n out[at + 3] = v.scale.y;\n },\n};\n\n/**\n * Animate the viewport `View`. Runs on the kit's {@link Animator} — pass one to\n * share a canvas's animator, or omit it and the hook makes its own. A caller\n * that always has one should use {@link useViewAnimationOn}, which builds none.\n *\n * Every animation from one instance registers under that instance's cancel key,\n * so starting one cancels whatever *it* had in flight, and each starts from where\n * the last one was rather than a captured value — an interrupted camera never jumps.\n * Two instances on one animator are independent. The view is a target\n * ({@link ViewAnimationApi.viewTarget}), so other animations can add to the camera's.\n */\nexport function useViewAnimation(view: ViewChannel, animator?: Animator): ViewAnimationApi {\n const own = useAnimator();\n return useViewAnimationOn(view, animator ?? own);\n}\n\n/** {@link useViewAnimation} on an animator the caller owns. Constructs no\n * animator of its own, so the camera runs on exactly the one passed. */\nexport function useViewAnimationOn(view: ViewChannel, animator: Animator): ViewAnimationApi {\n const key = `${VIEW_ANIMATION_KEY}:${useId()}`;\n const viewRef = useLatest(view);\n const animatorRef = useLatest(animator);\n /** Where this runner's own animation is heading. */\n const targetRef = useRef<View | null>(null);\n const writingRef = useRef(false);\n\n return useMemo<ViewAnimationApi>(() => {\n // The value the target's animations add to. While any is in flight it is kept here, apart\n // from the channel, which holds the folded view; null says to work it out from the channel.\n let committed: View | null = null;\n /** What the animations in flight added to the channel's view when `committed` was dropped. */\n let offset: number[] | null = null;\n const base = (): View => {\n if (committed) return committed;\n const live = viewRef.current.get();\n return offset ? viewAxes.from(viewAxes.to(live).map((n, i) => n - offset![i]!)) : live;\n };\n const write = (v: View): void => {\n writingRef.current = true;\n try { viewRef.current.set(normalizeView(v)); } finally { writingRef.current = false; }\n };\n const viewTarget: Target<View> = createTarget<View>({\n axes: viewAxes,\n get: base,\n set: (v) => { committed = v; offset = null; },\n show: (v) => {\n if (viewTarget.active) {\n if (!committed) { committed = base(); offset = null; }\n write(v);\n return;\n }\n // At rest. A stop or an outside write left the view as it stands; a finish lands it.\n const landed = committed;\n committed = offset = null;\n if (landed) write(landed);\n },\n });\n\n const isAnimating = () => animatorRef.current.isActive(key);\n const target = () => (isAnimating() ? targetRef.current : null);\n /** Cancels this runner's animation; whatever else moves the view goes on from where it was. */\n const cancel = (): void => {\n animatorRef.current.cancelKey(key);\n targetRef.current = null;\n };\n const stop = () => {\n cancel();\n if (!viewTarget.active) committed = offset = null;\n };\n\n const animate: ViewAnimationApi['animate'] = (to, opts = {}) => {\n const resolved = normalizeView(typeof to === 'function' ? to(target() ?? base()) : to);\n targetRef.current = resolved;\n animatorRef.current.tween<View>({\n target: viewTarget,\n to: resolved,\n ms: opts.ms ?? DEFAULT_MS,\n easing: opts.easing ?? easeOutCubic,\n interpolator: opts.interpolator ?? interpolateView,\n cancelKey: key,\n onDone: () => {\n targetRef.current = null;\n // Ahead of the frame's own write, so `onDone` reads the view it finished on.\n write(viewTarget.read());\n if (!viewTarget.active) committed = offset = null;\n opts.onDone?.();\n },\n });\n };\n\n return {\n animate,\n animateToBounds: (bounds, dims, opts = {}) => {\n const current = viewRef.current.get();\n const fitted = fitViewToBounds(bounds, dims, current, opts);\n if (fitted === current) return; // helper bailed (zero-area bounds/viewport)\n animate(fitted, opts);\n },\n stop,\n isAnimating,\n target,\n stopIfExternal: () => {\n if (writingRef.current) return;\n cancel();\n // The writer read the folded view, so what is still in flight stays on top of its write.\n if (viewTarget.active) {\n const shown = viewAxes.to(viewTarget.read());\n const under = viewAxes.to(base());\n offset = shown.map((n, i) => n - under[i]!);\n } else {\n offset = null;\n }\n committed = null;\n },\n viewTarget,\n };\n }, [key, viewRef, animatorRef]);\n}\n"],"mappings":";;;;;;;;AAaA,IAAaA,IAAqB,QAE5BC,IAAa,KAmDNC,IAA6B;CACxC,OAAO;CACP,OAAO;EAAC;EAAK;EAAK;EAAW;CAAS;CACtC,KAAK,MAAM;EAACC,EAAE;EAAGA,EAAE;EAAGA,EAAE,MAAM;EAAGA,EAAE,MAAM;CAAC;CAC1C,OAAO,OAAO;EAAE,GAAGC,EAAE;EAAK,GAAGA,EAAE;EAAK,OAAO;GAAE,GAAGA,EAAE;GAAK,GAAGA,EAAE;EAAI;CAAE;CAClE,MAAM,GAAG,OAAO;EAAE,GAAGD,EAAE,IAAIE,EAAE;EAAK,GAAGF,EAAE,IAAIE,EAAE;EAAK,OAAO;GAAE,GAAGF,EAAE,MAAM,IAAIE,EAAE;GAAK,GAAGF,EAAE,MAAM,IAAIE,EAAE;EAAI;CAAE;CACxG,QAAQ,GAAG,GAAK,MAAO;EAIrB,AAHA,EAAIC,KAAMH,EAAE,GACZ,EAAIG,IAAK,KAAKH,EAAE,GAChB,EAAIG,IAAK,KAAKH,EAAE,MAAM,GACtB,EAAIG,IAAK,KAAKH,EAAE,MAAM;CACxB;AACF;AAaA,SAAgBI,EAAiB,GAAmB,GAAuC;CACzF,IAAMC,IAAMC,EAAY;CACxB,OAAOC,EAAmBC,GAAMC,KAAYJ,CAAG;AACjD;AAIA,SAAgBE,EAAmB,GAAmB,GAAsC;CAC1F,IAAMG,IAAM,GAAGb,EAAmB,GAA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