@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poseRegistrars.js","names":["ResizePolicyRegistrar","useResizePolicy","resizePolicyOptions","options","GeometryProjectionRegistrar","useGeometryProjection","projection"],"sources":["../../../src/canvas/SceneCanvas/poseRegistrars.tsx"],"sourcesContent":["import type { GeometryProjection } from 'interactions/actions/geometryProjection';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport {\n resizePolicyOptions,\n useGeometryProjection,\n useResizePolicy\n} from '../deps';\n\n/** Subcomponent so we can conditionally render (and thus conditionally\n * call) `useResizePolicy`. See parent's comment for why this\n * must be gated rather than always-on. */\nexport function ResizePolicyRegistrar({\n options,\n}: {\n options: UseResizeOptions<unknown>;\n}) {\n useResizePolicy<unknown>(resizePolicyOptions(options));\n return null;\n}\n\n/** Subcomponent so we can conditionally render (and thus conditionally\n * call) `useGeometryProjection`. Mirrors `ResizePolicyRegistrar` — the\n * conditional mount ensures the dep is registered only when the consumer\n * supplies a projection, so absent → dep undefined → actions stay pose-only. */\nexport function GeometryProjectionRegistrar({\n projection,\n}: {\n projection: GeometryProjection;\n}) {\n useGeometryProjection(projection);\n return null;\n}\n"],"mappings":";;;AAWA,SAAgBA,EAAsB,EACpC,cAGC;CAED,OADAC,EAAyBC,EAAoBC,CAAO,CAAC,GAC9C;AACT;AAMA,SAAgBC,EAA4B,EAC1C,iBAGC;CAED,OADAC,EAAsBC,CAAU,GACzB;AACT"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HANDLE_BASE_PX as e, targetSizesPx as t } from "../../core/device/targets.js";
|
|
2
|
+
import { defaultDrawOne as n, defaultPaintBounds as r, paintBoundsFor as i } from "../defaultDrawOne.js";
|
|
3
|
+
import { KIT_SHAPE_KINDS as a } from "../../core/shapeKinds.js";
|
|
4
|
+
import { isCustomEntry as o } from "../layerSlots.js";
|
|
5
|
+
import "@weasel-js/routing/react";
|
|
6
|
+
//#region src/canvas/SceneCanvas/props.ts
|
|
7
|
+
var s = e;
|
|
8
|
+
function c(e, a = 1) {
|
|
9
|
+
let s = {
|
|
10
|
+
scene: {
|
|
11
|
+
drawOne: n,
|
|
12
|
+
paintBounds: r
|
|
13
|
+
},
|
|
14
|
+
selectionOverlay: { handles: { size: t(a).handle } }
|
|
15
|
+
};
|
|
16
|
+
if (!e) return s;
|
|
17
|
+
let c = { ...e };
|
|
18
|
+
if (!("scene" in e)) c.scene = s.scene;
|
|
19
|
+
else if (e.scene === null || o(e.scene)) c.scene = e.scene;
|
|
20
|
+
else {
|
|
21
|
+
let t = {
|
|
22
|
+
...s.scene,
|
|
23
|
+
...e.scene
|
|
24
|
+
};
|
|
25
|
+
c.scene = e.scene && "paintBounds" in e.scene ? t : {
|
|
26
|
+
...t,
|
|
27
|
+
paintBounds: i(t.drawOne)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return c.selectionOverlay = "selectionOverlay" in e ? e.selectionOverlay === null || o(e.selectionOverlay) ? e.selectionOverlay : {
|
|
31
|
+
...s.selectionOverlay,
|
|
32
|
+
...e.selectionOverlay
|
|
33
|
+
} : s.selectionOverlay, c;
|
|
34
|
+
}
|
|
35
|
+
var l = ["select", "hand"], u = [...l, ...a];
|
|
36
|
+
//#endregion
|
|
37
|
+
export { u as BUILTIN_TOOL_IDS, s as DEFAULT_HANDLE_SIZE, l as NON_SHAPE_BUILTIN_TOOLS, c as mergeLayersWithDefaults };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","names":["DEFAULT_HANDLE_SIZE","HANDLE_BASE_PX","mergeLayersWithDefaults","defaults","defaultDrawOne","defaultPaintBounds","targetSizesPx","targetScale","user","result","isCustomEntry","scene","paintBoundsFor","NON_SHAPE_BUILTIN_TOOLS","BUILTIN_TOOL_IDS","KIT_SHAPE_KINDS"],"sources":["../../../src/canvas/SceneCanvas/props.ts"],"sourcesContent":["import type { ModeRegistry } from '@weasel-js/modes';\nimport type { PathEditHost } from './pathEditHost';\nimport type { Paint } from '@weasel-js/paint';\nimport type { ActionsProp } from '@weasel-js/routing';\nimport { Yoke } from '@weasel-js/routing/react';\nimport type { PasteOmission } from 'core/adapters/types';\nimport type { Op } from 'core/ops/types';\nimport type { Node, Scene, SerializedScene } from 'core/scene/types';\nimport type { SelectionApi, UseSelectionOptions } from 'core/selection/useSelection';\nimport { KIT_SHAPE_KINDS, type BuiltinShapeToolId } from 'core/shapeKinds';\nimport type { InertiaConfig } from 'core/viewport/useDecayLoop';\nimport type { View } from 'core/viewport/view';\nimport type {\n ContentHandlerEntry\n} from 'features/ingestion';\nimport type { PinchZoomOptions } from 'interactions/actions/defaults/pinchZoom';\nimport type { WheelPanOptions } from 'interactions/actions/defaults/viewportWheelPan';\nimport type { ViewportZoomAnimateOptions, ViewportZoomOptions } from 'interactions/actions/defaults/viewportZoom';\nimport type { SvgIngestOptions } from 'interactions/actions/depSchema';\nimport type { GeometryProjection } from 'interactions/actions/geometryProjection';\nimport type { UseMoveOptions } from 'interactions/actions/move/options';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport type { UseRotateOptions } from 'interactions/actions/rotate/options';\nimport type { SnapStrategy } from 'interactions/gestures/types';\nimport type { ReactNode } from 'react';\nimport type { Bounds } from 'tools/builtin/select';\nimport type { Animator } from '@weasel-js/animator';\nimport { HANDLE_BASE_PX, targetSizesPx } from '../../core/device/targets';\nimport type { DeviceProfile } from '../../core/device/types';\nimport type { NodeRoutingEntry } from '../../core/scene/NodeRouting';\nimport type { DebugConfig } from '../../debug/types';\nimport type { LayoutDropTargetMode, ReflowTransition } from '../../layout/types';\nimport type { DrawCommand, ShaderProgramHandle } from '@weasel-js/renderer';\nimport type { Tool, ToolsApi } from '../../tools/overlayBinding';\nimport type { SceneSlotConfig } from '../buildSceneLayer';\nimport type { CanvasProps } from '../Canvas';\nimport { isCustomEntry, type LayersMap } from '../layerSlots';\nimport type { CanvasViewProps } from '../CanvasView';\nimport { defaultDrawOne, defaultPaintBounds, paintBoundsFor } from '../defaultDrawOne';\nimport type {\n InsertNodeFactory,\n InsertPaint\n} from '../deps';\nimport type { SceneToAdapterOptions } from '../sceneAdapter';\nimport type { SurfaceContribution } from '../surfaceContribution';\nimport type { CameraProps } from '../useCanvasView';\nimport type {\n Feature\n} from './features';\nimport type { BuiltinToolOptions } from './useBuiltinShapeTools';\nimport type { VersionCheck } from './useContributionRoles';\n\n/** The adapter surface delete / duplicate / group / ungroup need, narrowed from\n * `SceneCanvasAdapter` because `StandardActionsRegistrar` is non-generic. */\nexport interface BridgeAdapter {\n applyOps(ops: Op[], label?: string): void;\n insertNode(node: { id: string; [k: string]: unknown }): void;\n removeNode(id: string): void;\n setSelection(ids: string[]): void;\n}\n\n/** Default size in CSS pixels for selection corner-handles AND their\n * hit-test radius, at `targetScale = 1`. Deliberately unscaled; kit-internal\n * use sites multiply by `DeviceProfile.targetScale`. */\nexport const DEFAULT_HANDLE_SIZE = HANDLE_BASE_PX;\n\n/** `<SceneCanvas longPress>`. */\nexport interface SceneCanvasLongPress {\n /**\n * Shown while a long-press is held and some binding would fire on it.\n * Default: a ring that fills around the press point\n * (`createLongPressFeedbackContribution()`), static under\n * `prefers-reduced-motion`. `false` shows nothing; a contribution replaces\n * it, reading the `longPress` dep. Installed beside `ambient`, so under a\n * `tools` takeover add it to your own `useTools` call instead.\n */\n feedback?: boolean | SurfaceContribution;\n /** Default true. A long-press some binding handled pulses\n * `navigator.vibrate` briefly, for touch and pen, where the API exists. */\n haptics?: boolean;\n /** Hold time in ms. Default `LONG_PRESS_MS` (500). */\n duration?: number;\n}\n\n/** `<SceneCanvas layers>`: a {@link LayersMap} whose scene slot may be partial,\n * since the defaults fill in whatever it leaves out. */\nexport type SceneCanvasLayers<TNode extends { id: string }, TPose> = LayersMap<\n TNode,\n TPose,\n Partial<SceneSlotConfig<TNode, TPose>>\n>;\n\n/** Deep-merge user-supplied `layers` with kit defaults. Slots the user\n * doesn't mention get filled with defaults; slots explicitly set to\n * `null` are dropped. Partial slot configs are shallow-spread on top of the\n * default slot config. `targetScale` comes from the resolved {@link DeviceProfile}. */\nexport function mergeLayersWithDefaults<TData, TLayer extends string, TPose>(\n user: SceneCanvasLayers<Node<TData, TLayer, TPose>, TPose> | undefined,\n targetScale = 1,\n): LayersMap<Node<TData, TLayer, TPose>, TPose> {\n const defaults = {\n scene: {\n drawOne: defaultDrawOne as (\n node: Node<TData, TLayer, TPose>,\n pose: TPose,\n ) => DrawCommand[],\n paintBounds: defaultPaintBounds<TData, TLayer, TPose>,\n },\n selectionOverlay: { handles: { size: targetSizesPx(targetScale).handle } },\n };\n\n if (!user) return defaults as LayersMap<Node<TData, TLayer, TPose>, TPose>;\n\n // Start from a shallow copy of the user map so unknown slots pass through.\n const result = { ...user } as LayersMap<Node<TData, TLayer, TPose>, TPose>;\n\n if (!('scene' in user)) {\n result.scene = defaults.scene;\n } else if (user.scene === null || isCustomEntry(user.scene)) {\n result.scene = user.scene;\n } else {\n const scene = { ...defaults.scene, ...user.scene };\n result.scene = user.scene && 'paintBounds' in user.scene\n ? scene\n : { ...scene, paintBounds: paintBoundsFor<TData, TLayer, TPose>(scene.drawOne) };\n }\n\n if (!('selectionOverlay' in user)) {\n result.selectionOverlay = defaults.selectionOverlay;\n } else if (user.selectionOverlay === null || isCustomEntry(user.selectionOverlay)) {\n result.selectionOverlay = user.selectionOverlay;\n } else {\n result.selectionOverlay = { ...defaults.selectionOverlay, ...user.selectionOverlay };\n }\n\n return result;\n}\n\n/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop\n * is supplied, via `defaultTools`. */\nexport type BuiltinToolId = 'select' | 'hand' | BuiltinShapeToolId;\n\n/** Built-in tool ids that aren't shape tools — the ones with no entry in\n * the `core/shapeKinds` table. */\nexport const NON_SHAPE_BUILTIN_TOOLS: readonly Exclude<BuiltinToolId, BuiltinShapeToolId>[] = ['select', 'hand'];\n\n/** Every built-in tool id, shape tools included. */\nexport const BUILTIN_TOOL_IDS: readonly BuiltinToolId[] = [...NON_SHAPE_BUILTIN_TOOLS, ...KIT_SHAPE_KINDS];\n\n/** Minimal hit descriptor passed to `onDoubleClick`. Contains the fields\n * modality dispatch needs; extends as the kit's `Hit` type evolves. */\nexport interface SceneCanvasHit {\n id: string;\n kind: string;\n}\n\n/** Props for `<SceneCanvas>`. A scene is the only thing it needs. With nothing\n * else it renders that scene and keeps a selection no input sets; `features`\n * turns behavior on by preset, and the rest configures what those turn on. */\nexport type SceneCanvasProps<TData, TLayer extends string, TPose> =\n Omit<\n CanvasProps<TPose>,\n | 'adapter' | 'boundsOf' | 'selection' | 'tools'\n | 'viewState' // SceneCanvas makes the camera from the view props below\n | 'layers' // stripped so we can re-add as optional below\n | 'getIsVisible' // SceneCanvas synthesizes this from chromeVisibility\n | 'contentVersion' // SceneCanvas wires this to the scene's own version\n | 'layerVisibility' | 'layerOrder' // re-declared below: they gate picking here too\n | 'debug' // re-declared below with SceneCanvas's own `slops`\n > & CameraProps\n & {\n /** A `Scene` (typically from `useScene`) — or a `SerializedScene` JSON\n * object, which SceneCanvas bakes into a Scene on first render. The\n * serialized form is read once; pass a `key` on `<SceneCanvas>` to force\n * a fresh canvas from updated JSON.\n *\n * The JSON shape is relaxed (`version: number` rather than the `1`\n * literal) so an `import json from './x.json'` result satisfies the type\n * without an `as` cast. */\n scene:\n | Scene<TData, TLayer, TPose>\n | SerializedScene<TData, TLayer, TPose>\n | { version: number; systemLayers?: ReadonlyArray<{ id: string }>; nodes: ReadonlyArray<unknown> };\n\n /** Layer configuration. When omitted, SceneCanvas applies kit defaults\n * (a scene slot that paints `node.data.fill` rects + a default\n * selection overlay). A partial scene or selection-overlay config is\n * spread over that slot's defaults; pass `slot: null` to suppress a\n * default explicitly. */\n layers?: SceneCanvasLayers<Node<TData, TLayer, TPose>, TPose>;\n\n /** Layout strategies keyed by container node id (or a resolver), for\n * containers whose scene node declares none (`ContainerNode.layout`\n * wins). Applied to a drag and to every other change to their children,\n * through the scene's layout pass. */\n layouts?: SceneToAdapterOptions<TData, TLayer, TPose>['layouts'];\n\n /** Which layout container a drag lands in when several contain the drop\n * point — the innermost (default), the topmost in paint order, or only\n * containers whose strategy declares a `dropRegion`. Decides both the\n * drag-time reflow preview and the commit. */\n layoutDropTarget?: LayoutDropTargetMode;\n\n /** Carries the siblings a layout reflow displaces to their slots over time\n * instead of snapping them — `useAnimatedReflow` builds one. Covers a\n * drag's reflow and every one the scene records (an insert, delete,\n * reorder or resize inside a laid-out container). Absent or `null`,\n * they snap. */\n reflowTransition?: ReflowTransition<TPose> | null;\n\n /**\n * Lets pose-transform actions (move, resize, nudge, flip — NOT rotate) also rewrite a\n * node's data-held geometry. Given a node and the affine `m` applied to its pose,\n * `transform(node, m)` returns updated `data`, or `null` for nodes with no data-held\n * geometry. When absent, the kit emits only the pose op and leaves `data` untouched.\n *\n * @see GeometryProjection\n */\n geometryProjection?: GeometryProjection;\n\n /**\n * Routing-trait classifiers. The kit builds a `NodeRouting` registry per `<SceneCanvas>`\n * from this prop and uses it to derive each hit's `kind`, which tool routing tables\n * (e.g. `{ target: 'rect', actionId: 'move' }`) match against. Pass `defaultNodeRouting`\n * for the kit's built-in shape kinds; spread additional entries for consumer-defined\n * kinds.\n *\n * **Memoize the `routing` value.** The registry is memoized on the prop's reference\n * identity: a fresh array each render rebuilds it and cascades into a new adapter,\n * churning gesture state.\n */\n routing?: readonly NodeRoutingEntry[];\n\n /** How to read and rewrite this scene's poses. Every built-in action,\n * the selection chrome and picking read it. Default `AUTO_POSE_DESCRIPTOR`\n * (rect poses and `Path` poses). */\n poseDescriptor?: PoseDescriptor<TPose>;\n\n // --- Geometry: hit-test + bounds overrides consumed by the internal\n // `useSelectTool`. Ignored if the consumer passes their own `tools`. ---\n geometry?: {\n /** Hit-test override. Return the topmost id, the full back-to-front hit\n * stack (`string[]`), or `null` for empty space. The stack form lets a\n * consumer with domain overlap ordering (e.g. children over their\n * container) feed the kit's `pickTopMostHit` the true order instead of\n * pre-collapsing to one id. Matches `Canvas`'s `pickEvery` shape. */\n pickEvery?: (worldX: number, worldY: number) => string | string[] | null;\n boundsOf?: (id: string) => Bounds | null;\n /**\n * What \"the pointer is on this node\" means for the default body-pick.\n *\n * - `'pose'` — the node's pose rect, rotation honored.\n * - `'shape'` (default) — the pose rect as a pre-filter, then the ink the painter\n * actually lays down: its silhouette filled or not per the painter's `ink`, plus\n * its outline widened by the stroke half-width and `pickTolerancePx`.\n *\n * Painters with no silhouette keep the pose-rect answer either way. Ignored when\n * `pickEvery` is supplied: that override owns the test.\n */\n picking?: 'pose' | 'shape';\n /**\n * Grab slop around a shape's outline, in **screen** pixels, so the target keeps\n * its apparent size at any zoom. Default 4. It widens the outline test under\n * `picking: 'shape'` and grows the pose-rect pre-filter so those outline hits\n * survive it. Set `0` for exact geometry.\n */\n pickTolerancePx?: number;\n };\n\n // --- Selection options. `pickBest` and `handleHitRadius` configure the\n // internal select tool, and are ignored under a `tools` takeover;\n // `move`, `snap`, `resize` and `rotate` configure the `move`,\n // `resize` and `rotate` presets, and apply either way. ---\n selectTool?: {\n move?: UseMoveOptions<TPose>;\n resize?: UseResizeOptions<TPose>;\n /** Rotation options, or `false` to disable rotation entirely — drops the\n * `rotate` action AND hides the selection rotation-handle chrome. */\n rotate?: UseRotateOptions<TPose> | false;\n snap?: SnapStrategy<TPose>;\n handleHitRadius?: number;\n /** Override the body-pick used on click/pointerdown. Alt-aware: receives\n * the live alt state + current selection so consumers can implement\n * alt-cycling through an overlapping stack. Default: top-most hit\n * (alt ignored). */\n pickBest?: (worldX: number, worldY: number, alt: boolean, sel: readonly string[]) => string | null;\n };\n\n /** Consumer node factories for the `insert` action, keyed by tool `kind`.\n * Each factory receives the drag AABB + tool `extras` and returns the\n * node's `data` (in this canvas's own data shape) plus an optional `pose`.\n * A factory for a kit kind (`rect`, `line`, …) replaces the kit's default\n * `{ path, fill }` node for that kind; a factory for a novel kind (e.g.\n * `text`) adds insert support the kit doesn't ship. The dep supplies id,\n * layer, and the undoable op. Return `null` to reject an insert. */\n insertNodeFactories?: Record<string, InsertNodeFactory>;\n\n /** The fill, stroke, and fill rule a kit-built shape is inserted with, by\n * tool `kind` and insert count; the kit keeps the geometry. Default\n * `paletteInsertPaint`, the kit palette in turn. A kind with a factory in\n * `insertNodeFactories` is not asked. */\n insertPaint?: InsertPaint;\n\n /** External-content ingestion (OS drop / clipboard paste / picker).\n *\n * - `handlers` — consumer content handlers registered for this canvas's\n * lifetime (priority 0 by default — they beat the kit's `image/*` /\n * `image/svg+xml` handlers at -100/-90).\n * - `resolveSrc` — overrides the image handler's `data:`-URI embed (e.g.\n * upload to an asset store, return the URL).\n * - `svg.unpack` — makes the kit SVG handler parse dropped SVG files into\n * native scene nodes instead of one embedded-image node each.\n * - `clipboard` — the kit weasel-JSON paste handler, enabled by default.\n * `reviver` restores JSON-unfriendly values the copying side encoded via\n * `jsonReplacer`. `enabled: false` opts the canvas out, but the kit\n * handler still consumes weasel-matching items and declines them inert\n * rather than letting them fall through. Also governs Cmd/Ctrl+V under\n * the `edit` preset; the rest takes the `ingest` preset.\n *\n * Memoize `handlers` and `clipboard.reviver`: an inline array literal\n * re-registers the handlers on every render. */\n ingestion?: {\n handlers?: ContentHandlerEntry[];\n resolveSrc?: (file: File) => Promise<string>;\n svg?: SvgIngestOptions;\n clipboard?: {\n reviver?: (key: string, value: unknown) => unknown;\n enabled?: boolean;\n /** Called when a paste left copied nodes out, with each one and the\n * reason. `useClipboardOps` takes the same callback as\n * `onPasteOmitted` for a paste from its own in-memory copy. */\n onOmitted?: (omitted: PasteOmission[]) => void;\n };\n };\n\n selection?: SelectionApi;\n selectionOptions?: UseSelectionOptions;\n\n /**\n * `false` stops the canvas writing the selection: no click, marquee,\n * lasso, action or tool, and no op committed through the adapter it hands\n * its tools. The consumer's own `SelectionApi` — the `selection` prop, or\n * `useSelection({ scene })` — still writes, and the canvas draws what it\n * holds. Undo and redo still restore the selection each history entry\n * recorded. Default `true`.\n *\n * Click policy (whether shift-click extends) is the selection's `mode`:\n * `useSelection({ mode: 'multi' })`, or `selectionOptions={{ mode: 'multi' }}`\n * for the selection the canvas builds itself.\n */\n selectable?: boolean;\n\n /**\n * Behavior presets to turn on, composable in any combination. A canvas\n * with none renders its scene and keeps a selection (the `selection` API\n * works) that no input sets: no tools, no standard actions or their keys,\n * no clipboard, no drop or paste, and no selection chrome. The dispatcher\n * is still mounted, so bindings a consumer adds work.\n *\n * - `view` — wheel pan and zoom, pinch, the zoom keys, and the hand tool\n * (H, or hold Space). Passing `viewport` implies it.\n * - `select` — the select tool, as the initial active tool and Escape's\n * return target: click to pick, drag on empty to marquee, click on empty\n * to clear.\n * - `outline` — the selection outline, whichever tool sets the selection.\n * - `pick` — `select` and `outline`.\n * - `move` — drag a body to move it, Alt-drag to clone it. Ambient, so it\n * runs under any tool that does not claim the drag.\n * - `resize` — resize handles, drawn and bound.\n * - `rotate` — the rotation handle, drawn and bound.\n * - `transform` — `resize` and `rotate`.\n * - `edit` — undo/redo, delete, duplicate, group/ungroup, nudge,\n * select-all, Escape, cancel-gesture, cut/copy/paste, fill and stroke,\n * and their keys. Cmd/Ctrl+V pastes nodes a kit canvas copied, from\n * this tab or another, and nothing else.\n * - `arrange` — align, distribute, reorder, flip.\n * - `paths` — pathfinder operations, path-edit entry and anchor editing.\n * - `ingest` — dropped and pasted content: images, SVG, files, and\n * whatever `ingestion.handlers` accept, on Cmd/Ctrl+V or an OS drop.\n * - `draw` — all of the above.\n *\n * Tools add the actions they bind — a shape tool brings `insert` — so\n * `defaultTools` composes with any preset. `actions` then adds, overrides\n * or removes on top of what the presets registered.\n */\n features?: readonly Feature[];\n\n /** Extra tools or overrides keyed by id, or a full `ToolsApi` takeover.\n *\n * **Patch form** (`Record<string, Tool | true | false>`): merged\n * into the built-in registry on top of whatever `defaultTools` and\n * `features` already selected.\n * - `true` pulls in the built-in for this id (`'pen'`, `'lasso'`,\n * `'hand'`, …), the same as listing it in `defaultTools`. Unknown\n * built-in ids warn in dev and are ignored.\n * - `Tool` adds a new id or replaces an existing one\n * (dev-only warning on replace).\n * - `false` omits a bundled tool entirely.\n * Auto-wiring (keybindings, dispatcher, action registry) still runs.\n *\n * **Takeover form** (`ToolsApi`): the internal registry is bypassed and\n * this `tools` value is forwarded to Canvas as-is — the consumer owns\n * active-slot management, and `pick`'s select tool is theirs to supply.\n * Every other preset still applies. Keybindings are still auto-wired\n * against the supplied registry; pass `enableKeybindings={false}` to opt\n * out. */\n tools?: ToolsApi | Record<string, Tool | true | false>;\n\n /**\n * Auto-wire keyboard shortcuts. Default `true`. When `false`, SceneCanvas still mounts\n * its tools but routes no keyboard input to them — neither tool hotkeys nor\n * keyboard-bound actions like delete / escape / nudge. Pointer, wheel, and contextmenu\n * interactions are unaffected.\n */\n enableKeybindings?: boolean;\n\n /**\n * Take the keyboard on mount, as a press in the canvas would. A key that\n * reaches the page goes to the canvas the user last pressed or scrolled\n * in, and to no canvas before the first such interaction, so a canvas in a\n * side panel does not take Space from a page that wants it. An app whose\n * canvas is the page sets this so its shortcuts work before the first\n * click. Default `false`.\n */\n claimKeys?: boolean;\n\n /**\n * Auto-mount the gesture dispatcher (`useGestureDispatcher`). Default `true`. `false` is\n * for tests or demos that drive actions another way, or that call\n * `useGestureDispatcher` themselves.\n */\n enableGestureDispatcher?: boolean;\n\n /** Called with the `ToolsApi` SceneCanvas constructs or receives, whenever its identity\n * changes. For introspection. */\n onToolsCreated?: (tools: ToolsApi) => void;\n\n /**\n * Built-in tools SceneCanvas registers in its internal `useTools`, on top\n * of the ones presets bring (`select` from `pick`, `hand` from `view`).\n * Default: none. Each tool also registers the kit actions it binds, so\n * `['rect']` brings `insert`. Ignored when the consumer supplies their own\n * `tools` prop.\n */\n defaultTools?: readonly BuiltinToolId[];\n\n /** Per-tool option overrides for the built-in shape/lasso/clone tools.\n * Each entry is a narrow subset of the underlying hook's options\n * surface — `lasso.mode`, `clone.cloneSelection`, etc. */\n toolOptions?: BuiltinToolOptions;\n\n /** Initial active-slot tool id. Default: `'select'` when it is\n * registered, otherwise none — a canvas can run on ambient bindings\n * alone. Must be one of the registered tools. Ignored when the consumer\n * supplies their own `tools` prop. */\n initialActiveTool?: string;\n\n /** Always-on entries to register alongside the internal tools — every one\n * a `SurfaceContribution`, whose views, deps, overlay, bindings, actions\n * and `attach` all install from this one list, and uninstall when the\n * entry leaves it. A tool is a contribution too, so one can go here. If\n * you supply your own `tools` prop, this is ignored — wire `ambient`\n * through your own `useTools` call instead. */\n ambient?: readonly SurfaceContribution[];\n\n /** What an entry's `requires` does when the running kit does not meet\n * it: `'warn'` (the default) logs in development, `'strict'` throws,\n * `'off'` skips the check. */\n versionCheck?: VersionCheck;\n\n /** Touch and pen long-press: its hold time, its haptic, and the\n * feedback shown while it is held. */\n longPress?: SceneCanvasLongPress;\n\n /** Configures the `view` preset, and implies it: passing this turns\n * `view` on.\n *\n * - `inertia` and `animatedZoom` are opt-in: pass `true` for defaults or\n * an object to tune. Omitted means off.\n * - `pan` (wheel pan), `zoom` (Cmd+wheel + Cmd+=/-/0), and `pinchZoom`\n * (two-finger pinch) are on under `view`; pass `false` to disable one.\n * Disabling via the `actions` prop\n * (`actions: { 'viewport.wheelPan': null }`) also works and runs after\n * this. */\n viewport?: {\n inertia?: boolean | InertiaConfig;\n /** Two-finger pinch zoom. `true`/omitted = on with the kit's 0.1–8\n * clamp; `false` disables. An object sets the scale clamp. */\n pinchZoom?: boolean | PinchZoomOptions;\n /** Glide Cmd+=/-/0 instead of jumping. `true` uses the kit defaults\n * (250 ms, ease-out-cubic); a {@link ViewportZoomAnimateOptions} tunes\n * duration, easing, interpolator and the reset-branch duration. Wheel\n * and pinch are unaffected — their input already samples every frame. */\n animatedZoom?: boolean | ViewportZoomAnimateOptions;\n /** Wheel pan. `true`/omitted = on; `false` disables; an object locks the\n * axis (`{ axis: 'x' }`) so a single-axis viewport needs no commit clamp. */\n pan?: boolean | WheelPanOptions;\n /** Wheel/keyboard zoom. `true`/omitted = default Cmd+wheel zoom with the\n * kit's 0.1–8 clamp; `false` disables. Pass a {@link ViewportZoomOptions}\n * object to bind zoom to plain wheel (`wheel: 'plain'`, pair with\n * `pan: false`) and/or set `min`/`max` scale clamps. */\n zoom?: boolean | ViewportZoomOptions;\n /** Callback invoked by Cmd-0 (`viewport.zoom` action's `reset` branch).\n * When supplied, replaces the default reset-to-identity behavior —\n * consumers typically refit the document page into the workspace via\n * `fitViewToBounds`. Return the target `View` to let the kit animate\n * there when `animatedZoom` is on; return nothing to dispatch it\n * yourself, which is what a controlled canvas does. */\n recenter?: () => View | void;\n };\n\n /**\n * @experimental\n * Override / disable / extend the default action set. Pass `null` to disable all\n * defaults.\n */\n actions?: ActionsProp;\n\n /**\n * @experimental\n * Given a scene node, return a short human-readable \"kind\" label (e.g. `'rectangle'`,\n * `'sticky note'`), which the kit publishes per id into any surrounding\n * `<SelectionContextProvider>`. Return `undefined` to skip an entry. When omitted,\n * containers report `'group'`, poses with a `kind` property report `'path'`, and\n * everything else is left unlabelled.\n */\n describeKind?: (node: Node<TData, TLayer, TPose>) => string | undefined;\n\n /**\n * Animator to bind for per-frame redraws. SceneCanvas requests a redraw on every active\n * animation frame and paints `animator.colorOverrides` onto the scene's nodes: the\n * kit's path and shape painters apply them, and a custom `drawOne` receives them as\n * `ctx.vertexColors`.\n */\n animator?: Animator;\n\n /**\n * Extra views on this canvas: each is a camera over a rect of the same\n * surface, drawn through one GL context, with input routed to it. The flat\n * `view` / `onViewChange` props above stay the canvas's own camera — view\n * zero — and are unaffected by anything declared here.\n *\n * Order is paint and hit order, low to high. Each entry is a\n * `<CanvasView>`; mounting one as a child is the same declaration, and\n * children land after every entry here.\n */\n views?: readonly CanvasViewProps[];\n\n /**\n * Children rendered alongside the canvas, inside its input scope (e.g.\n * shortcuts overlays, probes).\n */\n children?: ReactNode;\n\n /**\n * A yoke to join, from `useYoke()`: canvases on one yoke share the\n * active tool, the gesture in flight and history. Omitted, this canvas\n * keeps its own.\n */\n yoke?: Yoke;\n\n /**\n * Chrome-caps visibility overrides, keyed by chrome id (`selection.outline`,\n * `selection.rotation-handle`, `gesture.marquee`, …). Each entry is a composable\n * {@link Condition} built from the `cond()` builder, merged on top of the kit's\n * `defaultVisibilityRules`. Set an id to `never` to suppress a chrome element\n * entirely (also unhittable), or to `always` to force-show.\n */\n chromeVisibility?: import('features/chrome-caps').VisibilityRules;\n\n /**\n * The app's mode registry (`createModeRegistry` in `@weasel-js/modes`).\n * The canvas reads the active mode from it to gate chrome, tool\n * activation and the dispatcher's eligibility filter, repaints when it\n * switches, and hands every registered mode to the dev-time route-conflict\n * check. Omitted, the canvas behaves as the kit's normal mode and nothing\n * revokes anchor editing.\n */\n modes?: ModeRegistry;\n\n /** Hands which path is being anchor-edited to the host. See {@link PathEditHost}. */\n pathEdit?: PathEditHost;\n\n /**\n * Override detected device facts. Merged over what `matchMedia` reports;\n * `targetScale` is re-derived from the merged `coarsePointer` unless you\n * override it explicitly.\n */\n device?: Partial<DeviceProfile>;\n\n /**\n * Live focus getter for chrome-caps' `focused` ctx field, for visibility rules that\n * read the `focused` atom (the kit's default `selection.rotation-handle` rule does).\n * Omit to default `focused` to `true`.\n */\n getFocused?: () => boolean;\n\n /** Custom shader programs to compile on the renderer. See `CanvasProps.shaders`. */\n shaders?: ShaderProgramHandle[];\n\n /** Flatness tolerance for curve tessellation, in world units. See\n * `CanvasProps.flattenTolerance`. */\n flattenTolerance?: number;\n\n /** Fill for the full canvas behind the scene, drawn as a screen-space layer slotted\n * before `'scene'` — independent of pan / zoom. */\n backgroundFill?: Paint;\n /** Dev HUD: a fixed-position widget showing live cursor coords in both viewport\n * (client) and canvas (world) frames. */\n cursorCoordsHud?: boolean;\n /** Dev HUD: a fixed-position widget listing the ids `pickEvery(world)` returns under\n * the cursor. */\n pickHud?: boolean;\n /**\n * The debug overlay: `<Canvas debug>`'s config, plus `slops: true` for\n * translucent halos at every affordance hit zone. `false` turns it off;\n * absent reads `?debug=…` from the URL, as `<Canvas>` does.\n */\n debug?: (DebugConfig & { slops?: boolean }) | false;\n /**\n * Dev HUD: when true (or object), mounts a fixed-position widget below\n * the pick HUD showing the active modality mode, active-slot tool, and\n * hotkey stack. Pass `{ modeId }` to populate the mode line.\n */\n modalityHud?: boolean | { modeId?: string };\n\n /**\n * Per-id alpha multiplier for the scene-render slot: each node's draw output is wrapped\n * in a group with the returned alpha, and 1 emits no wrapper. Typical use: dimming\n * non-active nodes during a mode transition.\n */\n alphaFor?: (id: string) => number;\n\n /**\n * Show or hide render layers in this canvas's own view, by id — the map\n * `<Canvas>` takes. Each scene layer paints as its own render layer, keyed\n * `scene:<layerId>`, so `{ 'scene:guides': false }` hides one scene layer\n * here and nowhere else.\n *\n * A layer hidden this way is gone from this view: it does not paint, and a\n * click, a marquee or Cmd+A here passes over it. Another view of the same\n * scene — a `<CanvasView>`, a second canvas, a minimap — still shows it and\n * can still take it. It applies on top of the scene's own\n * `LayerRecord.visible` and cannot show a layer the scene hides.\n */\n layerVisibility?: Record<string, boolean>;\n\n /**\n * Draw order for this view, by render-layer id, bottom first. A listed\n * order is the whole list: a scene layer left out of it is neither painted\n * nor picked here. See `CanvasProps.layerOrder`.\n */\n layerOrder?: string[];\n\n /**\n * Per-id pointer-interactivity predicate: an id it returns `false` for is excluded from\n * hit-test results. Typical use: suppressing pointer events for dimmed nodes.\n */\n isPointerInteractive?: (id: string) => boolean;\n\n /**\n * Called when the user double-clicks the canvas, with the hit node (id + kind) at that\n * position, or `null` on empty canvas. Typical use: modality dispatch — enter path-edit\n * on a path node, isolation on a group, text-edit on a text node.\n */\n onDoubleClick?: (hit: SceneCanvasHit | null) => void;\n /** Called on every click — a press and release without a drag — with the\n * node under it, or `null` on empty canvas. Fires after the click's own\n * behavior, so a pick it made is already in the selection, and fires\n * again on a node that was already picked. */\n onClick?: (hit: SceneCanvasHit | null) => void;\n };\n"],"mappings":";;;;;;AAiEA,IAAaA,IAAsBC;AAgCnC,SAAgBC,EACd,GACA,IAAc,GACgC;CAC9C,IAAMC,IAAW;EACf,OAAO;GACL,SAASC;GAIT,aAAaC;EACf;EACA,kBAAkB,EAAE,SAAS,EAAE,MAAMC,EAAcC,CAAW,CAAC,CAAC,OAAO,EAAE;CAC3E;CAEA,IAAI,CAACC,GAAM,OAAOL;CAGlB,IAAMM,IAAS,EAAE,GAAGD,EAAK;CAEzB,IAAI,EAAE,WAAWA,IACf,EAAO,QAAQL,EAAS;MACnB,IAAIK,EAAK,UAAU,QAAQE,EAAcF,EAAK,KAAK,GACxD,EAAO,QAAQA,EAAK;MACf;EACL,IAAMG,IAAQ;GAAE,GAAGR,EAAS;GAAO,GAAGK,EAAK;EAAM;EACjD,EAAO,QAAQA,EAAK,SAAS,iBAAiBA,EAAK,QAC/CG,IACA;GAAE,GAAGA;GAAO,aAAaC,EAAqCD,EAAM,OAAO;EAAE;CACnF;CAUA,OARA,AACEF,EAAO,mBADH,sBAAsBD,IAEjBA,EAAK,qBAAqB,QAAQE,EAAcF,EAAK,gBAAgB,IACpDA,EAAK,mBAEL;EAAE,GAAGL,EAAS;EAAkB,GAAGK,EAAK;CAAiB,IAJzDL,EAAS,kBAO9BM;AACT;AAQA,IAAaI,IAAiF,CAAC,UAAU,MAAM,GAGlGC,IAA6C,CAAC,GAAGD,GAAyB,GAAGE,CAAe"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IS_DEV as e } from "./isDev.js";
|
|
2
|
+
import { featureToolIds as t } from "./features.js";
|
|
3
|
+
import { BUILTIN_TOOL_IDS as n } from "./props.js";
|
|
4
|
+
//#region src/canvas/SceneCanvas/toolRegistry.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { builtins: i, defaultTools: a = [], enabled: o, patch: s, dev: c = e } = r, l = {}, u = t(o);
|
|
7
|
+
for (let e of n) {
|
|
8
|
+
let t = s?.[e];
|
|
9
|
+
t !== !1 && (t === !0 || a.includes(e) || u.has(e)) && (l[e] = i[e]);
|
|
10
|
+
}
|
|
11
|
+
for (let [e, t] of Object.entries(s ?? {})) if (t !== !1) {
|
|
12
|
+
if (t === !0) {
|
|
13
|
+
c && !n.includes(e) && console.warn(`[SceneCanvas] tools.${e}=true is not a known built-in id; ignoring`);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
c && e in l && console.warn(`[SceneCanvas] tools prop overrides bundled "${e}" tool`), l[e] = t;
|
|
17
|
+
}
|
|
18
|
+
return l;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as resolveToolRegistry };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=toolRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRegistry.js","names":["resolveToolRegistry","IS_DEV","args","registry","preset","featureToolIds","enabled","id","BUILTIN_TOOL_IDS","patched","patch","defaultTools","builtins","value","dev"],"sources":["../../../src/canvas/SceneCanvas/toolRegistry.ts"],"sourcesContent":["import type { Tool } from 'tools/overlayBinding';\nimport { featureToolIds, type BaseFeature } from './features';\nimport { IS_DEV } from './isDev';\nimport { BUILTIN_TOOL_IDS, type BuiltinToolId } from './props';\n\n/** The patch form of `<SceneCanvas tools>`: per id, `true` mounts that\n * built-in, `false` leaves it out, and a tool adds or replaces one. */\nexport type ToolsPatch = Record<string, Tool | true | false>;\n\n/** One tool per built-in id, mounted or not. */\nexport type BuiltinTools = Record<BuiltinToolId, Tool>;\n\nexport interface ResolveToolRegistryArgs {\n builtins: BuiltinTools;\n /** Built-ins asked for by id. */\n defaultTools?: readonly BuiltinToolId[];\n /** The presets the canvas runs with, each bringing the tools its\n * `FEATURE_PRESETS` row names. */\n enabled: ReadonlySet<BaseFeature>;\n patch: ToolsPatch | null;\n /** Whether to warn about a patch entry that is probably a mistake. */\n dev?: boolean;\n}\n\n/**\n * The tool registry a canvas mounts when it is not handed a whole `ToolsApi`.\n *\n * Built-ins come first, in `BUILTIN_TOOL_IDS` order whatever order they were\n * asked for in; a patch tool replaces a mounted one where it stands, and any\n * other is appended in patch order. That order is the palette's.\n */\nexport function resolveToolRegistry(args: ResolveToolRegistryArgs): Record<string, Tool> {\n const { builtins, defaultTools = [], enabled, patch, dev = IS_DEV } = args;\n const registry: Record<string, Tool> = {};\n const preset = featureToolIds(enabled);\n for (const id of BUILTIN_TOOL_IDS) {\n const patched = patch?.[id];\n if (patched === false) continue;\n const asked = patched === true || defaultTools.includes(id) || preset.has(id);\n if (asked) registry[id] = builtins[id];\n }\n for (const [id, value] of Object.entries(patch ?? {})) {\n if (value === false) continue;\n if (value === true) {\n if (dev && !(BUILTIN_TOOL_IDS as readonly string[]).includes(id)) {\n console.warn(`[SceneCanvas] tools.${id}=true is not a known built-in id; ignoring`);\n }\n continue;\n }\n if (dev && id in registry) {\n console.warn(`[SceneCanvas] tools prop overrides bundled \"${id}\" tool`);\n }\n registry[id] = value;\n }\n return registry;\n}\n"],"mappings":";;;;AA+BA,SAAgBA,EAAoB,GAAqD;CACvF,IAAM,EAAE,aAAU,kBAAe,CAAC,GAAG,YAAS,UAAO,SAAMC,MAAWC,GAChEC,IAAiC,CAAC,GAClCC,IAASC,EAAeC,CAAO;CACrC,KAAK,IAAMC,KAAMC,GAAkB;EACjC,IAAMC,IAAUC,IAAQH;EACxB,AAAIE,MAAY,OACFA,MAAY,MAAQE,EAAa,SAASJ,CAAE,KAAKH,EAAO,IAAIG,CAAE,OACjE,EAASA,KAAMK,EAASL;CACrC;CACA,KAAK,IAAM,CAACA,GAAIM,MAAU,OAAO,QAAQH,KAAS,CAAC,CAAC,GAClD,IAAIG,MAAU,IACd;MAAIA,MAAU,IAAM;GAClB,AAAIC,KAAO,CAAEN,EAAuC,SAASD,CAAE,KAC7D,QAAQ,KAAK,uBAAuBA,EAAG,2CAA2C;GAEpF;EACF;EAIA,AAHIO,KAAOP,KAAMJ,KACf,QAAQ,KAAK,+CAA+CI,EAAG,OAAO,GAExE,EAASA,KAAMM;CAJf;CAMF,OAAOV;AACT"}
|
|
@@ -42,7 +42,12 @@ function r(r, i) {
|
|
|
42
42
|
i
|
|
43
43
|
]);
|
|
44
44
|
}
|
|
45
|
+
function i(e, t) {
|
|
46
|
+
if (e === null) return null;
|
|
47
|
+
let n = { ...e ?? {} };
|
|
48
|
+
return t in n || (n[t] = null), n;
|
|
49
|
+
}
|
|
45
50
|
//#endregion
|
|
46
|
-
export { r as useActionsPropResolver };
|
|
51
|
+
export { i as actionsMuting, r as useActionsPropResolver };
|
|
47
52
|
|
|
48
53
|
//# sourceMappingURL=useActionsPropResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActionsPropResolver.js","names":["useActionsPropResolver","reg","useActionsRegistry","actionsRef","useLatest","actions","prop","unregisters","id","a","u","warnedIds","slotId","entry","isFull","existing","_drop","rest","merged","rev"],"sources":["../../../src/canvas/SceneCanvas/useActionsPropResolver.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"useActionsPropResolver.js","names":["useActionsPropResolver","reg","useActionsRegistry","actionsRef","useLatest","actions","prop","unregisters","id","a","u","warnedIds","slotId","entry","isFull","existing","_drop","rest","merged","rev","actionsMuting"],"sources":["../../../src/canvas/SceneCanvas/useActionsPropResolver.ts"],"sourcesContent":["/**\n * Applies the `actions` prop overrides on top of whatever is already\n * registered, so the caller mounts this hook last.\n *\n * actions === null → mute every currently-registered action\n * actions[id] === null → mute that id\n * actions[id] = partial → merge onto the existing descriptor (slot wins\n * over entry.id; warns once on mismatch)\n * actions[id] = full (new) → register alongside defaults\n *\n * `null` mutes rather than unregisters: the opt-out belongs to this canvas, so\n * a sibling sharing the registry keeps the action and this canvas's unmount\n * gives it back.\n */\nimport { useEffect } from 'react';\nimport type { ActionsProp } from '@weasel-js/routing';\nimport { useActionsRegistry } from '@weasel-js/routing/react';\nimport { useLatest } from '@weasel-js/react';\nimport type { Action } from '@weasel-js/routing';\n\n/** `rev` re-applies the overrides when it changes — pass whatever changes when\n * the set they sit on is re-registered. */\nexport function useActionsPropResolver(actions: ActionsProp | undefined, rev?: string): void {\n const reg = useActionsRegistry();\n const actionsRef = useLatest(actions);\n\n useEffect(() => {\n if (!reg) return;\n const prop = actionsRef.current;\n\n const unregisters: Array<() => void> = [];\n\n if (prop === null) {\n for (const id of reg.list().map((a) => a.id)) unregisters.push(reg.mute(id));\n return () => { for (const u of unregisters) u(); };\n }\n\n if (!prop) return;\n\n const warnedIds = new Set<string>();\n\n for (const [slotId, entry] of Object.entries(prop)) {\n if (entry === null) {\n unregisters.push(reg.mute(slotId));\n continue;\n }\n\n const isFull = (e: Partial<Action>): e is Action =>\n typeof e.id === 'string' && typeof e.label === 'string' && !!e.invoker;\n const existing = reg.list().find((a) => a.id === slotId);\n\n if (!existing) {\n if (isFull(entry)) {\n unregisters.push(reg.register(entry));\n } else if (!warnedIds.has(slotId)) {\n warnedIds.add(slotId);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"] is a partial Action but no default ` +\n `with this id exists. Pass a complete {id, label, invoker} descriptor.`,\n );\n }\n continue;\n }\n\n if (entry.id !== undefined && entry.id !== slotId && !warnedIds.has(`mismatch:${slotId}`)) {\n warnedIds.add(`mismatch:${slotId}`);\n console.warn(\n `weasel actions resolver: actions[\"${slotId}\"].id=\"${entry.id as string}\" mismatches the slot key. ` +\n `Ignoring the id field; the action remains at id=\"${slotId}\".`,\n );\n }\n const { id: _drop, ...rest } = entry;\n void _drop;\n const merged: Action = { ...existing, ...rest };\n // No explicit restore: `register` stacks, so popping `merged` uncovers\n // the descriptor it displaced. Re-registering `existing` here would push\n // a stale snapshot back on top and never take it off again.\n unregisters.push(reg.register(merged));\n }\n\n return () => { for (const u of unregisters) u(); };\n }, [reg, actions, actionsRef, rev]);\n}\n\n/**\n * `actions` with `id` muted. A caller's own entry for `id` still wins, and\n * `null` (every default muted) is left as it is.\n */\nexport function actionsMuting(actions: ActionsProp | undefined, id: string): ActionsProp {\n if (actions === null) return null;\n const merged = { ...(actions ?? {}) } as Record<string, unknown>;\n if (!(id in merged)) merged[id] = null;\n return merged as ActionsProp;\n}\n"],"mappings":";;;;AAsBA,SAAgBA,EAAuB,GAAkC,GAAoB;CAC3F,IAAMC,IAAMC,EAAmB,GACzBC,IAAaC,EAAUC,CAAO;CAEpC,QAAgB;EACd,IAAI,CAACJ,GAAK;EACV,IAAMK,IAAOH,EAAW,SAElBI,IAAiC,CAAC;EAExC,IAAID,MAAS,MAAM;GACjB,KAAK,IAAME,KAAMP,EAAI,KAAK,CAAC,CAAC,KAAK,MAAMQ,EAAE,EAAE,GAAG,EAAY,KAAKR,EAAI,KAAKO,CAAE,CAAC;GAC3E,aAAa;IAAE,KAAK,IAAME,KAAKH,GAAa,EAAE;GAAG;EACnD;EAEA,IAAI,CAACD,GAAM;EAEX,IAAMK,oBAAY,IAAI,IAAY;EAElC,KAAK,IAAM,CAACC,GAAQC,MAAU,OAAO,QAAQP,CAAI,GAAG;GAClD,IAAIO,MAAU,MAAM;IAClB,EAAY,KAAKZ,EAAI,KAAKW,CAAM,CAAC;IACjC;GACF;GAEA,IAAME,KAAU,MACd,OAAO,EAAE,MAAO,YAAY,OAAO,EAAE,SAAU,YAAY,CAAC,CAAC,EAAE,SAC3DC,IAAWd,EAAI,KAAK,CAAC,CAAC,MAAM,MAAMQ,EAAE,OAAOG,CAAM;GAEvD,IAAI,CAACG,GAAU;IACb,AAAID,EAAOD,CAAK,IACdN,EAAY,KAAKN,EAAI,SAASY,CAAK,CAAC,IAC1BF,EAAU,IAAIC,CAAM,MAC9BD,EAAU,IAAIC,CAAM,GACpB,QAAQ,KACN,qCAAqCA,EAAO,4GAE9C;IAEF;GACF;GAEA,AAAIC,EAAM,OAAO,KAAA,KAAaA,EAAM,OAAOD,KAAU,CAACD,EAAU,IAAI,YAAYC,GAAQ,MACtFD,EAAU,IAAI,YAAYC,GAAQ,GAClC,QAAQ,KACN,qCAAqCA,EAAO,SAASC,EAAM,GAAa,8EACpBD,EAAO,GAC7D;GAEF,IAAM,EAAE,IAAII,GAAO,GAAGC,MAASJ,GAEzBK,IAAiB;IAAE,GAAGH;IAAU,GAAGE;GAAK;GAI9C,EAAY,KAAKhB,EAAI,SAASiB,CAAM,CAAC;EACvC;EAEA,aAAa;GAAE,KAAK,IAAMR,KAAKH,GAAa,EAAE;EAAG;CACnD,GAAG;EAACN;EAAKI;EAASF;EAAYgB;CAAG,CAAC;AACpC;AAMA,SAAgBC,EAAc,GAAkC,GAAyB;CACvF,IAAIf,MAAY,MAAM,OAAO;CAC7B,IAAMa,IAAS,EAAE,GAAIb,KAAW,CAAC,EAAG;CAEpC,OADMG,KAAMU,MAAS,EAAOV,KAAM,OAC3BU;AACT"}
|
|
@@ -1,70 +1,29 @@
|
|
|
1
|
-
import { asNodeId as e } from "../../core/scene/types.js";
|
|
2
1
|
import "../../core/shapeKinds.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { usePencilTool as f } from "../../tools/builtin/pencil/usePencilTool.js";
|
|
13
|
-
import { boundsOfPath as p } from "@weasel-js/geom";
|
|
14
|
-
import { useRef as m } from "react";
|
|
2
|
+
import { useTextTool as e } from "../../tools/builtin/text/useTextTool.js";
|
|
3
|
+
import { usePenTool as t } from "../../tools/builtin/pen/usePenTool.js";
|
|
4
|
+
import { useRectTool as n } from "../../tools/builtin/rect/useRectTool.js";
|
|
5
|
+
import { useEllipseTool as r } from "../../tools/builtin/ellipse/useEllipseTool.js";
|
|
6
|
+
import { useLineTool as i } from "../../tools/builtin/line/useLineTool.js";
|
|
7
|
+
import { useLassoTool as a } from "../../tools/builtin/lasso/useLassoTool.js";
|
|
8
|
+
import { usePolygonTool as o } from "../../tools/builtin/polygon/usePolygonTool.js";
|
|
9
|
+
import { useStarTool as s } from "../../tools/builtin/star/useStarTool.js";
|
|
10
|
+
import { usePencilTool as c } from "../../tools/builtin/pencil/usePencilTool.js";
|
|
15
11
|
//#region src/canvas/SceneCanvas/useBuiltinShapeTools.tsx
|
|
16
|
-
function
|
|
17
|
-
let {
|
|
18
|
-
id: e,
|
|
19
|
-
kind: "leaf",
|
|
20
|
-
layer: S(),
|
|
21
|
-
pose: t,
|
|
22
|
-
data: n,
|
|
23
|
-
parent: null
|
|
24
|
-
}), w = v?.snapPoint, T = v?.insert ?? {}, E = o(T), D = s(T), O = c(T), k = u(T), A = d(T), j = f(T), M = (e) => {
|
|
25
|
-
let t = b("pn"), i = x();
|
|
26
|
-
return C(t, e.bounds, {
|
|
27
|
-
path: e.path,
|
|
28
|
-
fill: e.closed ? n(x()) : null,
|
|
29
|
-
stroke: r(i, 2)
|
|
30
|
-
});
|
|
31
|
-
};
|
|
12
|
+
function l(l = {}) {
|
|
13
|
+
let { options: u } = l, d = u?.snapPoint, f = u?.insert ?? {}, p = n(f), m = r(f), h = i(f), g = o(f), _ = s(f), v = c(f);
|
|
32
14
|
return {
|
|
33
|
-
rect:
|
|
34
|
-
ellipse:
|
|
35
|
-
line:
|
|
36
|
-
polygon:
|
|
37
|
-
star:
|
|
38
|
-
pen:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
path: e,
|
|
44
|
-
closed: t,
|
|
45
|
-
bounds: {
|
|
46
|
-
x: n.x,
|
|
47
|
-
y: n.y,
|
|
48
|
-
width: n.width,
|
|
49
|
-
height: n.height
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
adapter: {
|
|
54
|
-
addNode: (e) => {
|
|
55
|
-
let t = M(e);
|
|
56
|
-
return _.insertNode(t), String(t.id);
|
|
57
|
-
},
|
|
58
|
-
makeNode: (e) => M(e),
|
|
59
|
-
setSelection: (e) => _.setSelection(e)
|
|
60
|
-
}
|
|
61
|
-
}),
|
|
62
|
-
pencil: j,
|
|
63
|
-
lasso: l(_, v?.lasso ?? {}),
|
|
64
|
-
text: i(T)
|
|
15
|
+
rect: p,
|
|
16
|
+
ellipse: m,
|
|
17
|
+
line: h,
|
|
18
|
+
polygon: g,
|
|
19
|
+
star: _,
|
|
20
|
+
pen: t({ snapPoint: d }),
|
|
21
|
+
pencil: v,
|
|
22
|
+
lasso: a(u?.lasso ?? {}),
|
|
23
|
+
text: e(f)
|
|
65
24
|
};
|
|
66
25
|
}
|
|
67
26
|
//#endregion
|
|
68
|
-
export {
|
|
27
|
+
export { l as useBuiltinShapeTools };
|
|
69
28
|
|
|
70
29
|
//# sourceMappingURL=useBuiltinShapeTools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuiltinShapeTools.js","names":["useBuiltinShapeTools","args","
|
|
1
|
+
{"version":3,"file":"useBuiltinShapeTools.js","names":["useBuiltinShapeTools","args","snapPoint","options","insert","rect","useRectTool","ellipse","useEllipseTool","line","useLineTool","polygon","usePolygonTool","star","useStarTool","pencil","usePencilTool","usePenTool","useLassoTool","useTextTool"],"sources":["../../../src/canvas/SceneCanvas/useBuiltinShapeTools.tsx"],"sourcesContent":["/**\n * Shape-tool synthesis for `<SceneCanvas>` — calls the kit's per-shape tool\n * hooks; the `insert` dep mints each tool's node. Lets consumers opt into\n * a complete drawing toolset via `<SceneCanvas defaultTools={['rect', 'ellipse']}>`\n * without writing per-tool factory code.\n *\n * All hooks are always called (React rules of hooks) — `resolveToolRegistry`\n * decides which the canvas registers.\n */\nimport { useEllipseTool } from 'tools/builtin/ellipse/useEllipseTool';\nimport { useLassoTool } from 'tools/builtin/lasso/useLassoTool';\nimport { useLineTool } from 'tools/builtin/line/useLineTool';\nimport { usePencilTool } from 'tools/builtin/pencil/usePencilTool';\nimport { usePenTool } from 'tools/builtin/pen/usePenTool';\nimport { usePolygonTool } from 'tools/builtin/polygon/usePolygonTool';\nimport { useRectTool } from 'tools/builtin/rect/useRectTool';\nimport { useStarTool } from 'tools/builtin/star/useStarTool';\nimport { useTextTool } from 'tools/builtin/text/useTextTool';\nimport type { Tool } from 'tools/overlayBinding';\nimport type { InsertToolOptions } from 'tools/builtin/shared/insertToolOptions';\nimport type { LassoHitMode } from 'core/adapters/types';\nimport type { BuiltinShapeToolId } from 'core/shapeKinds';\n\n/** Per-tool option overrides for the built-in shape/lasso tools.\n * Each entry is a narrow subset of the underlying hook's options surface\n * — just the knobs that need consumer control under the bundle pattern. */\nexport interface BuiltinToolOptions {\n lasso?: { mode?: LassoHitMode };\n /** Insert-action options for every drag-to-insert tool (rect / ellipse /\n * line / polygon / star / pencil / text): `behaviors` become each insert\n * binding's `opts.behaviors`, the way `selectTool.move.behaviors` do for\n * move. */\n insert?: InsertToolOptions;\n /** Snap world-space points to the active grid (or any other snap target).\n *\n * Registered as the `snap` dep, which `insertAction` applies to the\n * drag start and current point — so the live preview and the committed\n * geometry agree — and which the pen tool reads for its own anchor\n * placement. Covers every drag-to-insert tool (rect / ellipse / line /\n * polygon / star / text); freehand pencil samples are deliberately left\n * unsnapped. */\n snapPoint?: (p: { x: number; y: number }) => { x: number; y: number };\n}\n\n// `BuiltinShapeToolId` / `KIT_SHAPE_KINDS` derive from the `core/shapeKinds`\n// table, a dependency-free module, so barrel-reachable code can reach them\n// without entering this file's `@weasel-js/core` self-import cycle.\n// Re-exported here so existing importers of this module keep working.\nexport { KIT_SHAPE_KINDS } from 'core/shapeKinds';\nexport type { BuiltinShapeToolId } from 'core/shapeKinds';\n\nexport interface UseBuiltinShapeToolsArgs {\n /** Per-tool option overrides (lasso mode, etc.). */\n options?: BuiltinToolOptions;\n}\n\nexport type BuiltinShapeTools = Record<BuiltinShapeToolId, Tool>;\n\n/** Synthesize the full shape-tool registry. Hooks always run;\n * `useBuiltinTools` registers the ones asked for. */\nexport function useBuiltinShapeTools(args: UseBuiltinShapeToolsArgs = {}): BuiltinShapeTools {\n const { options } = args;\n\n const snapPoint = options?.snapPoint;\n // Every tool here is a declarative shell: the `insert` dep\n // (`useInsertDepSource`) mints the node, so a consumer wanting its own node\n // shape overrides the dep, not the tool.\n const insert = options?.insert ?? {};\n const rect = useRectTool(insert);\n const ellipse = useEllipseTool(insert);\n const line = useLineTool(insert);\n const polygon = usePolygonTool(insert);\n const star = useStarTool(insert);\n const pencil = usePencilTool(insert);\n const pen = usePenTool({ snapPoint });\n const lasso = useLassoTool(options?.lasso ?? {});\n const text = useTextTool(insert);\n return { rect, ellipse, line, polygon, star, pen, pencil, lasso, text };\n}\n"],"mappings":";;;;;;;;;;;AA4DA,SAAgBA,EAAqB,IAAiC,CAAC,GAAsB;CAC3F,IAAM,EAAE,eAAYC,GAEdC,IAAYC,GAAS,WAIrBC,IAASD,GAAS,UAAU,CAAC,GAC7BE,IAAOC,EAAYF,CAAM,GACzBG,IAAUC,EAAeJ,CAAM,GAC/BK,IAAOC,EAAYN,CAAM,GACzBO,IAAUC,EAAeR,CAAM,GAC/BS,IAAOC,EAAYV,CAAM,GACzBW,IAASC,EAAcZ,CAAM;CAInC,OAAO;EAAE;EAAM;EAAS;EAAM;EAAS;EAAM,KAHjCa,EAAW,EAAE,aAAU,CAGU;EAAK;EAAQ,OAF5CC,EAAaf,GAAS,SAAS,CAAC,CAEY;EAAO,MADpDgB,EAAYf,CACwC;CAAK;AACxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useHandTool as e } from "../../tools/builtin/hand/useHandTool.js";
|
|
2
|
+
import { resolveToolRegistry as t } from "./toolRegistry.js";
|
|
3
|
+
import { useBuiltinShapeTools as n } from "./useBuiltinShapeTools.js";
|
|
4
|
+
//#region src/canvas/SceneCanvas/useBuiltinTools.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { select: i, enabled: a, defaultTools: o, patch: s, toolOptions: c, inertia: l } = r, u = e({ inertia: l }), d = n({ options: c });
|
|
7
|
+
return t({
|
|
8
|
+
builtins: {
|
|
9
|
+
select: i,
|
|
10
|
+
hand: u,
|
|
11
|
+
...d
|
|
12
|
+
},
|
|
13
|
+
defaultTools: o,
|
|
14
|
+
enabled: a,
|
|
15
|
+
patch: s
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { r as useBuiltinTools };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useBuiltinTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBuiltinTools.js","names":["useBuiltinTools","args","hand","useHandTool","shapes","useBuiltinShapeTools","toolOptions","resolveToolRegistry"],"sources":["../../../src/canvas/SceneCanvas/useBuiltinTools.ts"],"sourcesContent":["import type { InertiaConfig } from 'core/viewport/useDecayLoop';\nimport { useHandTool } from 'tools/builtin/hand';\nimport type { Tool } from 'tools/overlayBinding';\nimport type { BaseFeature } from './features';\nimport type { BuiltinToolId } from './props';\nimport { resolveToolRegistry, type ToolsPatch } from './toolRegistry';\nimport { useBuiltinShapeTools, type BuiltinToolOptions } from './useBuiltinShapeTools';\n\nexport interface UseBuiltinToolsArgs {\n /** The canvas's select tool, which is built from its scene and pickers. */\n select: Tool;\n enabled: ReadonlySet<BaseFeature>;\n defaultTools?: readonly BuiltinToolId[];\n patch: ToolsPatch | null;\n toolOptions?: BuiltinToolOptions;\n /** `viewport.inertia`, which is the hand tool's. */\n inertia?: boolean | InertiaConfig;\n}\n\n/** The registry of tools `<SceneCanvas>` mounts for itself. Every built-in's\n * hook runs on every render; `resolveToolRegistry` decides which are in. */\nexport function useBuiltinTools(args: UseBuiltinToolsArgs): Record<string, Tool> {\n const { select, enabled, defaultTools, patch, toolOptions, inertia } = args;\n const hand = useHandTool({ inertia });\n const shapes = useBuiltinShapeTools({ options: toolOptions });\n return resolveToolRegistry({\n builtins: { select, hand, ...shapes },\n defaultTools,\n enabled,\n patch,\n });\n}\n"],"mappings":";;;;AAqBA,SAAgBA,EAAgB,GAAiD;CAC/E,IAAM,EAAE,WAAQ,YAAS,iBAAc,UAAO,gBAAa,eAAYC,GACjEC,IAAOC,EAAY,EAAE,WAAQ,CAAC,GAC9BC,IAASC,EAAqB,EAAE,SAASC,EAAY,CAAC;CAC5D,OAAOC,EAAoB;EACzB,UAAU;GAAE;GAAQ;GAAM,GAAGH;EAAO;EACpC;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useViewAnimationOn as e } from "../../core/viewport/useViewAnimation.js";
|
|
2
|
+
import { useCanvasView as t } from "../useCanvasView.js";
|
|
3
|
+
import { useInsertionEffect as n, useMemo as r, useRef as i } from "react";
|
|
4
|
+
import { useLatest as a } from "@weasel-js/react";
|
|
5
|
+
import { useAnimator as o } from "@weasel-js/animator";
|
|
6
|
+
//#region src/canvas/SceneCanvas/useCanvasCamera.ts
|
|
7
|
+
function s(s) {
|
|
8
|
+
let { view: c, defaultView: l, onViewChange: u, viewBounds: d, width: f, height: p, requestRedraw: m } = s, h = a({
|
|
9
|
+
width: f,
|
|
10
|
+
height: p
|
|
11
|
+
}), g = i(null), _ = t({
|
|
12
|
+
view: c,
|
|
13
|
+
defaultView: l,
|
|
14
|
+
onViewChange: (e) => {
|
|
15
|
+
g.current?.stopIfExternal(), u?.(e);
|
|
16
|
+
},
|
|
17
|
+
viewBounds: d,
|
|
18
|
+
dims: () => h.current,
|
|
19
|
+
requestRedraw: m
|
|
20
|
+
}), v = o(), { viewRef: y, setViewFromInput: b } = _, x = r(() => ({
|
|
21
|
+
get: () => y.current,
|
|
22
|
+
set: b
|
|
23
|
+
}), [y, b]), S = e(x, v);
|
|
24
|
+
return n(() => {
|
|
25
|
+
g.current = S;
|
|
26
|
+
}), {
|
|
27
|
+
viewState: _,
|
|
28
|
+
viewAnimation: S,
|
|
29
|
+
camera: r(() => ({
|
|
30
|
+
target: S.viewTarget,
|
|
31
|
+
animator: v
|
|
32
|
+
}), [S, v])
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { s as useCanvasCamera };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=useCanvasCamera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasCamera.js","names":["useCanvasCamera","opts","size","useLatest","animationRef","useRef","viewState","useCanvasView","onViewChange","next","animator","useAnimator","channel","useMemo","viewRef","setViewFromInput","viewAnimation","useViewAnimationOn","useInsertionEffect"],"sources":["../../../src/canvas/SceneCanvas/useCanvasCamera.ts"],"sourcesContent":["import { useInsertionEffect, useMemo, useRef } from 'react';\nimport { useAnimator } from '@weasel-js/animator';\nimport { useLatest } from '@weasel-js/react';\nimport { useViewAnimationOn, type ViewAnimationApi } from 'core/viewport/useViewAnimation';\nimport type { SceneCanvasApi } from '../canvasExtension';\nimport { useCanvasView, type CameraProps, type CanvasViewState } from '../useCanvasView';\n\n/**\n * The canvas's camera: the view `<Canvas>` looks through, the runner behind\n * `animateView`, and the target and animator it runs on.\n */\nexport function useCanvasCamera(opts: CameraProps & {\n /** The size the camera looks through, which `viewBounds` clamps against. */\n width: number;\n height: number;\n requestRedraw: () => void;\n}): {\n viewState: CanvasViewState;\n viewAnimation: ViewAnimationApi;\n camera: SceneCanvasApi['camera'];\n} {\n const { view, defaultView, onViewChange, viewBounds, width, height, requestRedraw } = opts;\n const size = useLatest({ width, height });\n const animationRef = useRef<ViewAnimationApi | null>(null);\n const viewState = useCanvasView({\n view,\n defaultView,\n // Every write to the view is reported here, so it is the runner's one\n // interrupt feed.\n onViewChange: (next) => {\n animationRef.current?.stopIfExternal();\n onViewChange?.(next);\n },\n viewBounds,\n dims: () => size.current,\n requestRedraw,\n });\n\n // The camera runs on its own animator, never the `animator` prop's: that prop\n // is the consumer's scene animator, and their `cancelAll()` or `pause()` must\n // not strand a zoom half-finished or freeze the camera.\n const animator = useAnimator();\n const { viewRef, setViewFromInput } = viewState;\n const channel = useMemo(\n () => ({ get: () => viewRef.current, set: setViewFromInput }),\n [viewRef, setViewFromInput],\n );\n const viewAnimation = useViewAnimationOn(channel, animator);\n useInsertionEffect(() => { animationRef.current = viewAnimation; });\n const camera = useMemo(() => ({ target: viewAnimation.viewTarget, animator }), [viewAnimation, animator]);\n return { viewState, viewAnimation, camera };\n}\n"],"mappings":";;;;;;AAWA,SAAgBA,EAAgB,GAS9B;CACA,IAAM,EAAE,SAAM,gBAAa,iBAAc,eAAY,UAAO,WAAQ,qBAAkBC,GAChFC,IAAOC,EAAU;EAAE;EAAO;CAAO,CAAC,GAClCC,IAAeC,EAAgC,IAAI,GACnDC,IAAYC,EAAc;EAC9B;EACA;EAGA,eAAe,MAAS;GAEtB,AADAH,EAAa,SAAS,eAAe,GACrCI,IAAeC,CAAI;EACrB;EACA;EACA,YAAYP,EAAK;EACjB;CACF,CAAC,GAKKQ,IAAWC,EAAY,GACvB,EAAE,YAAS,wBAAqBL,GAChCM,IAAUC,SACP;EAAE,WAAWC,EAAQ;EAAS,KAAKC;CAAiB,IAC3D,CAACD,GAASC,CAAgB,CAC5B,GACMC,IAAgBC,EAAmBL,GAASF,CAAQ;CAG1D,OAFAQ,QAAyB;EAAE,EAAa,UAAUF;CAAe,CAAC,GAE3D;EAAE;EAAW;EAAe,QADpBH,SAAe;GAAE,QAAQG,EAAc;GAAY;EAAS,IAAI,CAACA,GAAeN,CAAQ,CACpE;CAAO;AAC5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createDispatcherPreviewSources as e, createGestureSource as t } from "./dispatcherGestureBounds.js";
|
|
2
|
+
import { useRef as n, useState as r } from "react";
|
|
3
|
+
import { createDispatcher as i } from "@weasel-js/routing";
|
|
4
|
+
//#region src/canvas/SceneCanvas/useCanvasDispatcher.ts
|
|
5
|
+
function a() {
|
|
6
|
+
let a = n(null), o = n(null);
|
|
7
|
+
o.current ||= i({ getAction: (e) => a.current?.(e) });
|
|
8
|
+
let s = o.current, [c] = r(() => t(() => o.current)), [{ previewIdsExtra: l, previewPoseExtra: u }] = r(() => e(() => o.current));
|
|
9
|
+
return {
|
|
10
|
+
dispatcher: s,
|
|
11
|
+
getActionRef: a,
|
|
12
|
+
gestureSource: c,
|
|
13
|
+
previewIdsExtra: l,
|
|
14
|
+
previewPoseExtra: u
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { a as useCanvasDispatcher };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useCanvasDispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasDispatcher.js","names":["useCanvasDispatcher","getActionRef","useRef","dispatcherRef","createDispatcher","id","dispatcher","gestureSource","useState","createGestureSource","createDispatcherPreviewSources"],"sources":["../../../src/canvas/SceneCanvas/useCanvasDispatcher.ts"],"sourcesContent":["import { useRef, useState, type MutableRefObject } from 'react';\nimport { createDispatcher, type Action, type Dispatcher } from '@weasel-js/routing';\nimport type { GestureSource } from '../gestureBounds';\nimport { createDispatcherPreviewSources, createGestureSource } from './dispatcherGestureBounds';\n\n/**\n * One `Dispatcher` for the life of a `<SceneCanvas>`, shared by the gesture\n * mounter that pumps input into it and the layers that walk its in-flight\n * handles, with the lookups those layers and `<Canvas>` read it through.\n */\nexport function useCanvasDispatcher(): {\n dispatcher: Dispatcher;\n /** How the dispatcher resolves an action id at call time. Populated by\n * `StandardActionsRegistrar` once it has the registry in scope. */\n getActionRef: MutableRefObject<((id: string) => Action | undefined) | null>;\n /** In-flight preview ids, nascent-insert bounds, and the pump signal. */\n gestureSource: GestureSource;\n /** Ids whose committed paint an in-flight ghost hides. */\n previewIdsExtra: () => string[];\n /** The pose an in-flight handle proposes for an id. */\n previewPoseExtra: (id: string) => unknown;\n} {\n const getActionRef = useRef<((id: string) => Action | undefined) | null>(null);\n const dispatcherRef = useRef<Dispatcher | null>(null);\n if (!dispatcherRef.current) {\n dispatcherRef.current = createDispatcher({\n getAction: (id) => getActionRef.current?.(id),\n });\n }\n const dispatcher = dispatcherRef.current;\n const [gestureSource] = useState(() => createGestureSource(() => dispatcherRef.current));\n const [{ previewIdsExtra, previewPoseExtra }] = useState(\n () => createDispatcherPreviewSources(() => dispatcherRef.current),\n );\n return { dispatcher, getActionRef, gestureSource, previewIdsExtra, previewPoseExtra };\n}\n"],"mappings":";;;;AAUA,SAAgBA,IAWd;CACA,IAAMC,IAAeC,EAAoD,IAAI,GACvEC,IAAgBD,EAA0B,IAAI;CACpD,AACEC,EAAc,YAAUC,EAAiB,EACvC,YAAY,MAAOH,EAAa,UAAUI,CAAE,EAC9C,CAAC;CAEH,IAAMC,IAAaH,EAAc,SAC3B,CAACI,KAAiBC,QAAeC,QAA0BN,EAAc,OAAO,CAAC,GACjF,CAAC,EAAE,oBAAiB,yBAAsBK,QACxCE,QAAqCP,EAAc,OAAO,CAClE;CACA,OAAO;EAAE;EAAY;EAAc;EAAe;EAAiB;CAAiB;AACtF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useSelection as e } from "../../core/selection/useSelection.js";
|
|
2
|
+
import { readOnlySelection as t } from "../../core/selection/readOnlySelection.js";
|
|
3
|
+
import { usePublishSceneSelection as n } from "../../core/selection/usePublishSceneSelection.js";
|
|
4
|
+
import { useMemo as r } from "react";
|
|
5
|
+
//#region src/canvas/SceneCanvas/useCanvasSelection.ts
|
|
6
|
+
function i(i) {
|
|
7
|
+
let { scene: a, supplied: o, options: s, selectable: c, describeKind: l } = i, u = r(() => ({
|
|
8
|
+
scene: a,
|
|
9
|
+
...s ?? {}
|
|
10
|
+
}), [a, s]), d = e(u), f = o ?? d, p = c ? f : t(f);
|
|
11
|
+
return n(a, p.current, l), p;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as useCanvasSelection };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useCanvasSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasSelection.js","names":["useCanvasSelection","args","derivedOptions","useMemo","options","scene","internal","useSelection","base","supplied","selection","selectable","readOnlySelection","usePublishSceneSelection","describeKind"],"sources":["../../../src/canvas/SceneCanvas/useCanvasSelection.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Node, NodeId, Scene } from 'core/scene/types';\nimport { readOnlySelection } from 'core/selection/readOnlySelection';\nimport { usePublishSceneSelection } from 'core/selection/usePublishSceneSelection';\nimport { useSelection, type SelectionApi, type UseSelectionOptions } from 'core/selection/useSelection';\n\n/**\n * The canvas's selection, published to any surrounding selection context.\n *\n * A caller-supplied api wins, and the one built here is then unused. The\n * built one is bound to the scene, so the selection an edit was made under\n * rides on the scene's history entries and undo can put it back.\n *\n * Everything the kit writes selection through (the `selection` dep, the\n * adapter's `setSelection`, ops committed through either) reads the returned\n * api, so on an unselectable canvas every write path here is closed. The\n * caller's own api is not wrapped and still writes.\n */\nexport function useCanvasSelection<TData, TLayer extends string, TPose>(args: {\n scene: Scene<TData, TLayer, TPose>;\n /** `<SceneCanvas selection>`. */\n supplied: SelectionApi | undefined;\n options: UseSelectionOptions | undefined;\n selectable: boolean;\n describeKind: ((node: Node<TData, TLayer, TPose>) => string | undefined) | undefined;\n}): SelectionApi {\n const { scene, supplied, options, selectable, describeKind } = args;\n const derivedOptions = useMemo<UseSelectionOptions>(\n () => ({ scene, ...(options ?? {}) }),\n [scene, options],\n );\n const internal = useSelection(derivedOptions);\n const base = supplied ?? internal;\n const selection = selectable ? base : readOnlySelection(base);\n usePublishSceneSelection(scene, selection.current as readonly NodeId[], describeKind);\n return selection;\n}\n"],"mappings":";;;;;AAkBA,SAAgBA,EAAwD,GAOvD;CACf,IAAM,EAAE,UAAO,aAAU,YAAS,eAAY,oBAAiBC,GACzDC,IAAiBC,SACd;EAAE;EAAO,GAAIC,KAAW,CAAC;CAAG,IACnC,CAACC,GAAOD,CAAO,CACjB,GACME,IAAWC,EAAaL,CAAc,GACtCM,IAAOC,KAAYH,GACnBI,IAAYC,IAAaH,IAAOI,EAAkBJ,CAAI;CAE5D,OADAK,EAAyBR,GAAOK,EAAU,SAA8BI,CAAY,GAC7EJ;AACT"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createLongPressFeedbackContribution as e } from "../../features/longPress/longPressFeedback.js";
|
|
2
|
+
import { KIT_STANDARD_ACTION_IDS as t } from "../../interactions/actions/useStandardActions.js";
|
|
3
|
+
import { useTools as n } from "../../tools/overlayBinding.js";
|
|
4
|
+
import { featureActionIds as r, featureAmbient as i, resolveFeatures as a } from "./features.js";
|
|
5
|
+
import { useBuiltinTools as o } from "./useBuiltinTools.js";
|
|
6
|
+
import { useEffect as s, useMemo as c } from "react";
|
|
7
|
+
import { useLatest as l } from "@weasel-js/react";
|
|
8
|
+
//#region src/canvas/SceneCanvas/useCanvasTools.ts
|
|
9
|
+
function u(e) {
|
|
10
|
+
return typeof e.setActive == "function";
|
|
11
|
+
}
|
|
12
|
+
function d(e, t) {
|
|
13
|
+
let n = (e ?? []).join("|");
|
|
14
|
+
return c(() => a(e, { viewport: t }), [n, t]);
|
|
15
|
+
}
|
|
16
|
+
function f(t) {
|
|
17
|
+
let { select: r, enabled: i, tools: a, defaultTools: d, toolOptions: f, inertia: p, ambient: m, initialActiveTool: h, modes: g, onToolsCreated: _ } = t, v = a && u(a) ? a : null, y = o({
|
|
18
|
+
select: r,
|
|
19
|
+
enabled: i,
|
|
20
|
+
defaultTools: d,
|
|
21
|
+
patch: a && !u(a) ? a : null,
|
|
22
|
+
toolOptions: f,
|
|
23
|
+
inertia: p
|
|
24
|
+
}), b = c(() => e(), []), x = t.pressFeedback ?? !0, S = x === !0 ? b : x || null, C = c(() => S ? [...m ?? [], S] : m ?? [], [m, S]), w = n({
|
|
25
|
+
active: h ?? ("select" in y ? "select" : null),
|
|
26
|
+
registry: y,
|
|
27
|
+
...C.length ? { ambient: C } : {},
|
|
28
|
+
...g ? { modes: g } : {}
|
|
29
|
+
}), T = v ?? w, E = l(_);
|
|
30
|
+
return s(() => {
|
|
31
|
+
E.current?.(T);
|
|
32
|
+
}, [T, E]), {
|
|
33
|
+
tools: T,
|
|
34
|
+
internal: w,
|
|
35
|
+
takeover: v
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function p(e) {
|
|
39
|
+
let { enabled: n, tools: a, move: o, rotate: s } = e, l = c(() => i(n, {
|
|
40
|
+
move: o,
|
|
41
|
+
rotate: s
|
|
42
|
+
}), [
|
|
43
|
+
n,
|
|
44
|
+
o,
|
|
45
|
+
s
|
|
46
|
+
]);
|
|
47
|
+
return {
|
|
48
|
+
contributions: l,
|
|
49
|
+
standardActionsExclude: c(() => {
|
|
50
|
+
let e = r(n), i = [
|
|
51
|
+
...Object.values(a.registry),
|
|
52
|
+
...a.ambient,
|
|
53
|
+
...l
|
|
54
|
+
];
|
|
55
|
+
for (let t of i) for (let n of t.bindings ?? []) e.add(n.actionId);
|
|
56
|
+
return t.filter((t) => !e.has(t));
|
|
57
|
+
}, [
|
|
58
|
+
n,
|
|
59
|
+
a,
|
|
60
|
+
l
|
|
61
|
+
])
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { f as useCanvasTools, d as useEnabledFeatures, p as useFeatureBindings };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=useCanvasTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasTools.js","names":["isToolsApi","tools","useEnabledFeatures","featuresKey","features","useMemo","resolveFeatures","hasViewport","useCanvasTools","toolsProp","args","takeover","registry","useBuiltinTools","defaultPressFeedback","createLongPressFeedbackContribution","feedbackOpt","pressFeedback","mergedAmbient","ambient","internal","useTools","initialActiveTool","modes","onToolsCreatedRef","useLatest","onToolsCreated","useEffect","useFeatureBindings","contributions","featureAmbient","enabled","move","rotate","include","featureActionIds","bound","entry","b","KIT_STANDARD_ACTION_IDS","id"],"sources":["../../../src/canvas/SceneCanvas/useCanvasTools.ts"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { KIT_STANDARD_ACTION_IDS } from 'interactions/actions/useStandardActions';\nimport { createLongPressFeedbackContribution } from '../../features/longPress/longPressFeedback';\nimport { useTools, type Contribution, type Tool, type ToolsApi } from '../../tools/overlayBinding';\nimport {\n featureActionIds,\n featureAmbient,\n resolveFeatures,\n type BaseFeature,\n type Feature,\n type FeatureBindingOptions,\n} from './features';\nimport type { SceneCanvasProps } from './props';\nimport type { ToolsPatch } from './toolRegistry';\nimport { useBuiltinTools } from './useBuiltinTools';\n\ntype Props = SceneCanvasProps<unknown, string, unknown>;\n\n/** Discriminate the polymorphic `tools` prop: `ToolsApi` has `setActive`\n * / `active` / `registry`; the patch record shape has none of those. */\nfunction isToolsApi(tools: ToolsApi | ToolsPatch): tools is ToolsApi {\n return typeof (tools as ToolsApi).setActive === 'function';\n}\n\n/** The presets a canvas runs with. Keyed on the ids, not the array, so an\n * inline `features={['draw']}` does not re-derive every render. */\nexport function useEnabledFeatures(\n features: readonly Feature[] | undefined,\n hasViewport: boolean,\n): ReadonlySet<BaseFeature> {\n const featuresKey = (features ?? []).join('|');\n return useMemo(\n () => resolveFeatures(features, { viewport: hasViewport }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [featuresKey, hasViewport],\n );\n}\n\n/**\n * The canvas's tools: a caller's own `ToolsApi` when the `tools` prop is one\n * (the takeover form), and otherwise the built-ins the presets and\n * `defaultTools` name, patched by a `tools` record.\n */\nexport function useCanvasTools(args: {\n /** The canvas's select tool, which is built from its scene and pickers. */\n select: Tool;\n enabled: ReadonlySet<BaseFeature>;\n tools: Props['tools'];\n defaultTools: Props['defaultTools'];\n toolOptions: Props['toolOptions'];\n /** `viewport.inertia`, which is the hand tool's. */\n inertia: NonNullable<Props['viewport']>['inertia'];\n ambient: Props['ambient'];\n /** `longPress.feedback`. Default true, which installs the kit's own. */\n pressFeedback: NonNullable<Props['longPress']>['feedback'];\n initialActiveTool: Props['initialActiveTool'];\n modes: Props['modes'];\n onToolsCreated: Props['onToolsCreated'];\n}): {\n /** What the canvas routes input through: the takeover, or `internal`. */\n tools: ToolsApi;\n /** The canvas's own api, built whether or not a takeover replaces it. */\n internal: ToolsApi;\n takeover: ToolsApi | null;\n} {\n const { select, enabled, tools: toolsProp, defaultTools, toolOptions, inertia, ambient, initialActiveTool, modes, onToolsCreated } = args;\n\n const takeover = toolsProp && isToolsApi(toolsProp) ? toolsProp : null;\n const registry = useBuiltinTools({\n select,\n enabled,\n defaultTools,\n patch: toolsProp && !isToolsApi(toolsProp) ? toolsProp : null,\n toolOptions,\n inertia,\n });\n\n const defaultPressFeedback = useMemo(() => createLongPressFeedbackContribution(), []);\n const feedbackOpt = args.pressFeedback ?? true;\n const pressFeedback = feedbackOpt === true ? defaultPressFeedback : feedbackOpt || null;\n const mergedAmbient = useMemo(\n () => (pressFeedback ? [...(ambient ?? []), pressFeedback] : (ambient ?? [])),\n [ambient, pressFeedback],\n );\n\n const internal = useTools({\n active: initialActiveTool ?? ('select' in registry ? 'select' : null),\n registry,\n ...(mergedAmbient.length ? { ambient: mergedAmbient } : {}),\n ...(modes ? { modes } : {}),\n });\n const tools = takeover ?? internal;\n\n const onToolsCreatedRef = useLatest(onToolsCreated);\n useEffect(() => { onToolsCreatedRef.current?.(tools); }, [tools, onToolsCreatedRef]);\n\n return { tools, internal, takeover };\n}\n\n/**\n * The presets' ambient bindings, and the kit-standard actions the canvas\n * leaves unregistered. The bindings are not tools and sit outside `tools`, so\n * they apply under a takeover too. An action is registered when a preset\n * names it or a tool or contribution on this canvas binds it: a tool brings\n * the actions it routes to, so `defaultTools={['rect']}` works under any preset.\n */\nexport function useFeatureBindings(args: {\n enabled: ReadonlySet<BaseFeature>;\n tools: Pick<ToolsApi, 'registry' | 'ambient'>;\n move: FeatureBindingOptions['move'];\n rotate: FeatureBindingOptions['rotate'];\n}): { contributions: Contribution[]; standardActionsExclude: string[] } {\n const { enabled, tools, move, rotate } = args;\n const contributions = useMemo<Contribution[]>(\n () => featureAmbient(enabled, { move, rotate }),\n [enabled, move, rotate],\n );\n const standardActionsExclude = useMemo(() => {\n const include = featureActionIds(enabled);\n const bound = [...Object.values(tools.registry), ...tools.ambient, ...contributions];\n for (const entry of bound) {\n for (const b of entry.bindings ?? []) include.add(b.actionId);\n }\n return KIT_STANDARD_ACTION_IDS.filter((id) => !include.has(id));\n }, [enabled, tools, contributions]);\n return { contributions, standardActionsExclude };\n}\n"],"mappings":";;;;;;;;AAqBA,SAASA,EAAW,GAAiD;CACnE,OAAO,OAAQC,EAAmB,aAAc;AAClD;AAIA,SAAgBC,EACd,GACA,GAC0B;CAC1B,IAAMC,KAAeC,KAAY,CAAC,EAAA,CAAG,KAAK,GAAG;CAC7C,OAAOC,QACCC,EAAgBF,GAAU,EAAE,UAAUG,EAAY,CAAC,GAEzD,CAACJ,GAAaI,CAAW,CAC3B;AACF;AAOA,SAAgBC,EAAe,GAqB7B;CACA,IAAM,EAAE,WAAQ,YAAS,OAAOC,GAAW,iBAAc,gBAAa,YAAS,YAAS,sBAAmB,UAAO,sBAAmBC,GAE/HC,IAAWF,KAAaT,EAAWS,CAAS,IAAIA,IAAY,MAC5DG,IAAWC,EAAgB;EAC/B;EACA;EACA;EACA,OAAOJ,KAAa,CAACT,EAAWS,CAAS,IAAIA,IAAY;EACzD;EACA;CACF,CAAC,GAEKK,IAAuBT,QAAcU,EAAoC,GAAG,CAAC,CAAC,GAC9EC,IAAcN,EAAK,iBAAiB,IACpCO,IAAgBD,MAAgB,KAAOF,IAAuBE,KAAe,MAC7EE,IAAgBb,QACbY,IAAgB,CAAC,GAAIE,KAAW,CAAC,GAAIF,CAAa,IAAKE,KAAW,CAAC,GAC1E,CAACA,GAASF,CAAa,CACzB,GAEMG,IAAWC,EAAS;EACxB,QAAQC,MAAsB,YAAYV,IAAW,WAAW;EAChE;EACA,GAAIM,EAAc,SAAS,EAAE,SAASA,EAAc,IAAI,CAAC;EACzD,GAAIK,IAAQ,EAAE,SAAM,IAAI,CAAC;CAC3B,CAAC,GACKtB,IAAQU,KAAYS,GAEpBI,IAAoBC,EAAUC,CAAc;CAGlD,OAFAC,QAAgB;EAAE,EAAkB,UAAU1B,CAAK;CAAG,GAAG,CAACA,GAAOuB,CAAiB,CAAC,GAE5E;EAAE;EAAO;EAAU;CAAS;AACrC;AASA,SAAgBI,EAAmB,GAKqC;CACtE,IAAM,EAAE,YAAS,UAAO,SAAM,cAAWlB,GACnCmB,IAAgBxB,QACdyB,EAAeC,GAAS;EAAE;EAAM;CAAO,CAAC,GAC9C;EAACA;EAASC;EAAMC;CAAM,CACxB;CASA,OAAO;EAAE;EAAe,wBARO5B,QAAc;GAC3C,IAAM6B,IAAUC,EAAiBJ,CAAO,GAClCK,IAAQ;IAAC,GAAG,OAAO,OAAOnC,EAAM,QAAQ;IAAG,GAAGA,EAAM;IAAS,GAAG4B;GAAa;GACnF,KAAK,IAAMQ,KAASD,GAClB,KAAK,IAAME,KAAKD,EAAM,YAAY,CAAC,GAAG,EAAQ,IAAIC,EAAE,QAAQ;GAE9D,OAAOC,EAAwB,QAAQ,MAAO,CAACL,EAAQ,IAAIM,CAAE,CAAC;EAChE,GAAG;GAACT;GAAS9B;GAAO4B;EAAa,CACT;CAAuB;AACjD"}
|