@weasel-js/core 1.11.0 → 1.12.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 +611 -0
- package/README.md +1 -1
- package/dist/WeaselProvider.js +1 -1
- package/dist/affordances/pathAnchors.js +10 -6
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/animation/index.js +3 -3
- package/dist/animation/rig/bindRig.js +1 -1
- package/dist/animation/rig/rigNode.js.map +1 -1
- package/dist/barrel/canvas.js +9 -3
- package/dist/barrel/interactions.js +5 -4
- package/dist/barrel/paint.js +4 -4
- package/dist/barrel/paths.js +10 -6
- package/dist/barrel/renderer.js +5 -3
- package/dist/barrel/routing.js +7 -12
- package/dist/barrel/scene.js +9 -5
- package/dist/barrel/text.js +2 -2
- package/dist/barrel/viewport.js +9 -4
- package/dist/canvas/Canvas.js +5 -2
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +23 -34
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/ModalityHud.js +1 -1
- package/dist/canvas/NodeShape.js +4 -1
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js +17 -3
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js.map +1 -1
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js +23 -0
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js.map +1 -0
- package/dist/canvas/SceneCanvas/builtinToolSets.js +30 -0
- package/dist/canvas/SceneCanvas/builtinToolSets.js.map +1 -0
- package/dist/canvas/SceneCanvas/canvasPassThrough.js +2 -0
- package/dist/canvas/SceneCanvas/canvasPassThrough.js.map +1 -1
- package/dist/canvas/SceneCanvas/coordTrace.js +5 -16
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +5 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/features.js +45 -5
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/props.js +1 -11
- package/dist/canvas/SceneCanvas/props.js.map +1 -1
- package/dist/canvas/SceneCanvas/scenePointQuery.js +7 -3
- package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -1
- package/dist/canvas/SceneCanvas/toolRegistry.js +8 -4
- package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -1
- package/dist/canvas/SceneCanvas/useActionTunings.js +6 -1
- package/dist/canvas/SceneCanvas/useActionTunings.js.map +1 -1
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +1 -11
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +2 -9
- package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js +94 -0
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +7 -2
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasTools.js +15 -10
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useNodeKinds.js +1 -1
- package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +9 -3
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +23 -4
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +2 -3
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneChrome.js +6 -7
- package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +24 -7
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js.map +1 -1
- package/dist/canvas/SceneCanvas/useScenePicking.js +2 -3
- package/dist/canvas/SceneCanvas/useScenePicking.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +2 -1
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js +5 -5
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
- package/dist/canvas/SceneCanvas.js +27 -24
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SurfaceCanvas.js +5 -22
- package/dist/canvas/SurfaceCanvas.js.map +1 -1
- package/dist/canvas/ViewMarker.js +35 -0
- package/dist/canvas/ViewMarker.js.map +1 -0
- package/dist/canvas/canvasRenderer.js +9 -5
- package/dist/canvas/canvasRenderer.js.map +1 -1
- package/dist/canvas/contextAttributes.js +14 -0
- package/dist/canvas/contextAttributes.js.map +1 -0
- package/dist/canvas/defaultDrawOne.js +2 -0
- package/dist/canvas/defaultDrawOne.js.map +1 -1
- package/dist/canvas/deps/booleans.js +2 -1
- package/dist/canvas/deps/booleans.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +9 -113
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +2 -2
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +10 -4
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/pathEditCommits.js +189 -0
- package/dist/canvas/deps/pathEditCommits.js.map +1 -0
- package/dist/canvas/deps/snap.js +12 -9
- package/dist/canvas/deps/snap.js.map +1 -1
- package/dist/canvas/deps/transformFollowers.js +20 -0
- package/dist/canvas/deps/transformFollowers.js.map +1 -0
- package/dist/canvas/derivedPath.js +20 -1
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/drawnBounds.js +38 -4
- package/dist/canvas/drawnBounds.js.map +1 -1
- package/dist/canvas/inheritedPaints.js +44 -0
- package/dist/canvas/inheritedPaints.js.map +1 -0
- package/dist/canvas/nodeShapes/derivedPainter.js +23 -16
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/nodePaint.js +13 -34
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
- package/dist/canvas/nodeShapes/pathPainter.js +12 -10
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +4 -5
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/shapePainter.js +12 -11
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
- package/dist/canvas/nodeShapes/textPainter.js +13 -12
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
- package/dist/canvas/overlayRoleStrokes.js +12 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/pathOverlay.js +27 -7
- package/dist/canvas/pathOverlay.js.map +1 -1
- package/dist/canvas/pickReach.js +3 -3
- package/dist/canvas/pickReach.js.map +1 -1
- package/dist/canvas/pickWalk.js +3 -1
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/renderDebugSnapshot.js +1 -0
- package/dist/canvas/renderDebugSnapshot.js.map +1 -1
- package/dist/canvas/renderSceneToPixels.js +7 -6
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js +2 -1
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +2 -1
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/surfaceContribution.js +12 -8
- package/dist/canvas/surfaceContribution.js.map +1 -1
- package/dist/canvas/useCanvasPaint.js +2 -1
- package/dist/canvas/useCanvasPaint.js.map +1 -1
- package/dist/canvas/useCanvasView.js +4 -2
- package/dist/canvas/useCanvasView.js.map +1 -1
- package/dist/canvas/useInFlightBounds.js +52 -0
- package/dist/canvas/useInFlightBounds.js.map +1 -0
- package/dist/canvas/useLayerStack.js +6 -2
- package/dist/canvas/useLayerStack.js.map +1 -1
- package/dist/canvas/useViewAim.js +121 -0
- package/dist/canvas/useViewAim.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +7 -9
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/useViewNesting.js +3 -2
- package/dist/canvas/useViewNesting.js.map +1 -1
- package/dist/canvas/useViewRegistrySurface.js +4 -2
- package/dist/canvas/useViewRegistrySurface.js.map +1 -1
- package/dist/canvas/viewMarkers.js +63 -0
- package/dist/canvas/viewMarkers.js.map +1 -0
- package/dist/canvas/viewRegistry.js +27 -1
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/clipboard.d.ts +3 -2
- package/dist/{clone-DZDrfIlU.d.ts → clone-C3e0OTuF.d.ts} +8 -21
- package/dist/clone.d.ts +4 -3
- package/dist/core/geometry/autoPoseDescriptor.js +1 -1
- package/dist/core/ops/setDependsOn.js +37 -0
- package/dist/core/ops/setDependsOn.js.map +1 -0
- package/dist/core/ops/writtenBy.js +53 -0
- package/dist/core/ops/writtenBy.js.map +1 -0
- package/dist/core/pages/fitViewToPage.js +12 -1
- package/dist/core/pages/fitViewToPage.js.map +1 -1
- package/dist/core/pages/pageEdits.js +163 -0
- package/dist/core/pages/pageEdits.js.map +1 -0
- package/dist/core/pages/pages.js +30 -1
- package/dist/core/pages/pages.js.map +1 -1
- package/dist/core/paint/meshKindLazy.js +59 -2
- package/dist/core/paint/meshKindLazy.js.map +1 -1
- package/dist/core/scene/NodeRouting.js +8 -3
- package/dist/core/scene/NodeRouting.js.map +1 -1
- package/dist/core/scene/arrivalWindow.js.map +1 -1
- package/dist/core/scene/carryDescendants.js +51 -0
- package/dist/core/scene/carryDescendants.js.map +1 -0
- package/dist/core/scene/clipNothing.js +13 -0
- package/dist/core/scene/clipNothing.js.map +1 -0
- package/dist/core/scene/depMemo.js +11 -3
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/dependents.js +7 -1
- package/dist/core/scene/dependents.js.map +1 -1
- package/dist/core/scene/derivedParts.js +10 -11
- package/dist/core/scene/derivedParts.js.map +1 -1
- package/dist/core/scene/docValues.js +57 -0
- package/dist/core/scene/docValues.js.map +1 -0
- package/dist/core/scene/editPass.js +111 -0
- package/dist/core/scene/editPass.js.map +1 -0
- package/dist/core/scene/effectivePose.js +13 -2
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/fieldEdits.js +4 -1
- package/dist/core/scene/fieldEdits.js.map +1 -1
- package/dist/core/scene/fontReads.js +37 -0
- package/dist/core/scene/fontReads.js.map +1 -0
- package/dist/core/scene/historyFacade.js +1 -0
- package/dist/core/scene/historyFacade.js.map +1 -1
- package/dist/core/scene/inheritedPaint.js +75 -0
- package/dist/core/scene/inheritedPaint.js.map +1 -0
- package/dist/core/scene/kitRegistry.js +5 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layoutPass.js +28 -3
- package/dist/core/scene/layoutPass.js.map +1 -1
- package/dist/core/scene/nodeMemo.js +15 -7
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/pathEffects/blend.js.map +1 -1
- package/dist/core/scene/pathEffects/derive.js +7 -2
- package/dist/core/scene/pathEffects/derive.js.map +1 -1
- package/dist/core/scene/pathEffects/effects.js +3 -1
- package/dist/core/scene/pathEffects/effects.js.map +1 -1
- package/dist/core/scene/pathEffects/textAlong.js +95 -0
- package/dist/core/scene/pathEffects/textAlong.js.map +1 -0
- package/dist/core/scene/recorder.js +28 -19
- package/dist/core/scene/recorder.js.map +1 -1
- package/dist/core/scene/scene.js +15 -9
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneChanges.js +13 -0
- package/dist/core/scene/sceneChanges.js.map +1 -0
- package/dist/core/scene/sceneEdits.js +8 -1
- package/dist/core/scene/sceneEdits.js.map +1 -1
- package/dist/core/scene/sceneMutators.js +1 -0
- package/dist/core/scene/sceneMutators.js.map +1 -1
- package/dist/core/scene/sceneRecording.js +20 -3
- package/dist/core/scene/sceneRecording.js.map +1 -1
- package/dist/core/scene/sceneSelection.js +4 -1
- package/dist/core/scene/sceneSelection.js.map +1 -1
- package/dist/core/scene/sceneState.js +11 -5
- package/dist/core/scene/sceneState.js.map +1 -1
- package/dist/core/scene/serialization.js +5 -3
- package/dist/core/scene/serialization.js.map +1 -1
- package/dist/core/scene/types.js.map +1 -1
- package/dist/core/scene/unitScopes.js +19 -1
- package/dist/core/scene/unitScopes.js.map +1 -1
- package/dist/core/selection/usePublishSceneSelection.js +6 -12
- package/dist/core/selection/usePublishSceneSelection.js.map +1 -1
- package/dist/core/shapeKinds.js +25 -11
- package/dist/core/shapeKinds.js.map +1 -1
- package/dist/{cornerHandles-Camw_yeu.d.ts → cornerHandles-p8fDIAKt.d.ts} +3 -2
- package/dist/debug/createDebugOverlayLayer.js +16 -111
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/createDebugSink.js +2 -1
- package/dist/debug/createDebugSink.js.map +1 -1
- package/dist/debug/defaultTheme.js +4 -2
- package/dist/debug/defaultTheme.js.map +1 -1
- package/dist/debug/features.js +17 -0
- package/dist/debug/features.js.map +1 -0
- package/dist/debug/overlayPanels.js +117 -0
- package/dist/debug/overlayPanels.js.map +1 -0
- package/dist/debug/parseDebugFlags.js +4 -13
- package/dist/debug/parseDebugFlags.js.map +1 -1
- package/dist/{depSchema-Cgfu_G9s.d.ts → depSchema-mG19aEdD.d.ts} +174 -904
- package/dist/devtools/handlers.js +112 -0
- package/dist/devtools/handlers.js.map +1 -0
- package/dist/devtools/history.js +71 -0
- package/dist/devtools/history.js.map +1 -0
- package/dist/devtools/hook.js +74 -0
- package/dist/devtools/hook.js.map +1 -0
- package/dist/devtools/label.js +25 -0
- package/dist/devtools/label.js.map +1 -0
- package/dist/devtools/notices.js +58 -0
- package/dist/devtools/notices.js.map +1 -0
- package/dist/devtools/protocol.js +7 -0
- package/dist/devtools/protocol.js.map +1 -0
- package/dist/devtools/registry.js +90 -0
- package/dist/devtools/registry.js.map +1 -0
- package/dist/devtools/root.js +80 -0
- package/dist/devtools/root.js.map +1 -0
- package/dist/devtools/serialize.js +86 -0
- package/dist/devtools/serialize.js.map +1 -0
- package/dist/devtools/session.js +111 -0
- package/dist/devtools/session.js.map +1 -0
- package/dist/devtools/transport.js +67 -0
- package/dist/devtools/transport.js.map +1 -0
- package/dist/devtools/useDevtoolsRoot.js +81 -0
- package/dist/devtools/useDevtoolsRoot.js.map +1 -0
- package/dist/devtools-protocol.d.ts +435 -0
- package/dist/devtools-protocol.js +7 -0
- package/dist/devtools.d.ts +8 -0
- package/dist/devtools.js +12 -0
- package/dist/devtools.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +16 -10
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +25 -2
- package/dist/features/ingestion/contentHandlers.js.map +1 -1
- package/dist/features/measure/measureCommands.js +7 -5
- package/dist/features/measure/measureCommands.js.map +1 -1
- package/dist/features/measure/measureContribution.js +4 -2
- package/dist/features/measure/measureContribution.js.map +1 -1
- package/dist/features/modes/modeTriggers.js +7 -3
- package/dist/features/modes/modeTriggers.js.map +1 -1
- package/dist/features/pathEffects/effectSources.js +60 -0
- package/dist/features/pathEffects/effectSources.js.map +1 -0
- package/dist/features/pathEffects/readSource.js +17 -1
- package/dist/features/pathEffects/readSource.js.map +1 -1
- package/dist/features/pathEffects/textItems.js +53 -0
- package/dist/features/pathEffects/textItems.js.map +1 -0
- package/dist/features/pathEffects/useEffectSourcesLayer.js +57 -0
- package/dist/features/pathEffects/useEffectSourcesLayer.js.map +1 -0
- package/dist/features/paths/index.js +2 -2
- package/dist/features/paths/pathEditExtension.js.map +1 -1
- package/dist/features/paths/pathEditState.js +5 -2
- package/dist/features/paths/pathEditState.js.map +1 -1
- package/dist/features/paths/pathSnap/pathSnapSource.js +5 -5
- package/dist/features/paths/pathSnap/pathSnapSource.js.map +1 -1
- package/dist/features/paths/pathSnap/sceneIndex.js +10 -3
- package/dist/features/paths/pathSnap/sceneIndex.js.map +1 -1
- package/dist/features/selection/selectionPose.js +4 -1
- package/dist/features/selection/selectionPose.js.map +1 -1
- package/dist/features/snap/gather.js +9 -1
- package/dist/features/snap/gather.js.map +1 -1
- package/dist/features/snap/lazySession.js +17 -0
- package/dist/features/snap/lazySession.js.map +1 -0
- package/dist/features/snap/marks.js.map +1 -1
- package/dist/features/snap/probes2d.js +27 -19
- package/dist/features/snap/probes2d.js.map +1 -1
- package/dist/features/snap/readoutLayer.js.map +1 -1
- package/dist/features/snap/roles.js +2 -1
- package/dist/features/snap/roles.js.map +1 -1
- package/dist/features/snap/rotationSource.js +25 -8
- package/dist/features/snap/rotationSource.js.map +1 -1
- package/dist/features/snap/sceneSession2d.js +6 -4
- package/dist/features/snap/sceneSession2d.js.map +1 -1
- package/dist/features/snap/session2d.js +37 -23
- package/dist/features/snap/session2d.js.map +1 -1
- package/dist/features/snap/spanSnap.js +5 -2
- package/dist/features/snap/spanSnap.js.map +1 -1
- package/dist/features/text/sceneTextDrafts.js +65 -0
- package/dist/features/text/sceneTextDrafts.js.map +1 -0
- package/dist/features/text/textHitAt.js +31 -2
- package/dist/features/text/textHitAt.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +22 -18
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/aim.js +105 -0
- package/dist/features/viewports/aim.js.map +1 -0
- package/dist/features/viewports/viewMarker.js +82 -0
- package/dist/features/viewports/viewMarker.js.map +1 -0
- package/dist/features/viewports/viewMarkerDrag.js +55 -0
- package/dist/features/viewports/viewMarkerDrag.js.map +1 -0
- package/dist/icons.table.js +1 -1
- package/dist/icons.table.js.map +1 -1
- package/dist/icons.table.json +0 -10
- package/dist/index.d.ts +1198 -894
- package/dist/index.js +55 -38
- package/dist/interactions/actions/align/action.js +6 -4
- package/dist/interactions/actions/align/action.js.map +1 -1
- package/dist/interactions/actions/align/align.js.map +1 -1
- package/dist/interactions/actions/booleans/action.js +7 -1
- package/dist/interactions/actions/booleans/action.js.map +1 -1
- package/dist/interactions/actions/booleans/booleans.js +2 -1
- package/dist/interactions/actions/booleans/booleans.js.map +1 -1
- package/dist/interactions/actions/booleans/operands.js +6 -5
- package/dist/interactions/actions/booleans/operands.js.map +1 -1
- package/dist/interactions/actions/clipboard/action.js +27 -17
- package/dist/interactions/actions/clipboard/action.js.map +1 -1
- package/dist/interactions/actions/clone/action.js +1 -1
- package/dist/interactions/actions/clone/behaviors.js +4 -4
- package/dist/interactions/actions/clone/behaviors.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +44 -23
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorJoin.js +12 -6
- package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +8 -5
- package/dist/interactions/actions/defaults/bendSegment.js.map +1 -1
- package/dist/interactions/actions/defaults/cancelGesture.js +11 -8
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
- package/dist/interactions/actions/defaults/contextMenu.js +17 -8
- package/dist/interactions/actions/defaults/contextMenu.js.map +1 -1
- package/dist/interactions/actions/defaults/createPaintAction.js +2 -2
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js +64 -41
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +12 -9
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterPathEdit.js +19 -9
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/escape.js +11 -8
- package/dist/interactions/actions/defaults/escape.js.map +1 -1
- package/dist/interactions/actions/defaults/exitPathEdit.js +7 -4
- package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +21 -15
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +17 -9
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +7 -4
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +21 -40
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/pathEditTools.js +11 -8
- package/dist/interactions/actions/defaults/pathEditTools.js.map +1 -1
- package/dist/interactions/actions/defaults/pinchZoom.js +7 -4
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/reorder.js +24 -6
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/selectAll.js +8 -5
- package/dist/interactions/actions/defaults/selectAll.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +7 -3
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +1 -1
- package/dist/interactions/actions/defaults/setStroke.js +12 -11
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +1 -1
- package/dist/interactions/actions/defaults/toolActivate.js +7 -1
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
- package/dist/interactions/actions/defaults/toolResetToDefault.js +7 -4
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
- package/dist/interactions/actions/defaults/undoRedo.js +19 -13
- package/dist/interactions/actions/defaults/undoRedo.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportWheelPan.js +16 -7
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportZoom.js +24 -6
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/distribute/action.js +6 -4
- package/dist/interactions/actions/distribute/action.js.map +1 -1
- package/dist/interactions/actions/drawnBoxes.js +2 -1
- package/dist/interactions/actions/drawnBoxes.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/action.js +10 -10
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/preview.js +41 -8
- package/dist/interactions/actions/edit-anchors/preview.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +14 -6
- package/dist/interactions/actions/flip/action.js.map +1 -1
- package/dist/interactions/actions/gestureLifecycle.js +5 -2
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
- package/dist/interactions/actions/insert/action.js +1 -2
- package/dist/interactions/actions/insert/action.js.map +1 -1
- package/dist/interactions/actions/insert/commit.js +1 -1
- package/dist/interactions/actions/insert/parent.js +11 -0
- package/dist/interactions/actions/insert/parent.js.map +1 -0
- package/dist/interactions/actions/insert/placeAction.js +7 -2
- package/dist/interactions/actions/insert/placeAction.js.map +1 -1
- package/dist/interactions/actions/insert/repositionAction.js +2 -1
- package/dist/interactions/actions/insert/repositionAction.js.map +1 -1
- package/dist/interactions/actions/insert/session.js +5 -1
- package/dist/interactions/actions/insert/session.js.map +1 -1
- package/dist/interactions/actions/move/action.js +15 -8
- package/dist/interactions/actions/move/action.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +0 -1
- package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +1 -1
- package/dist/interactions/actions/move/capture.js +1 -1
- package/dist/interactions/actions/move/commit/index.js +0 -2
- package/dist/interactions/actions/move/commit/index.js.map +1 -1
- package/dist/interactions/actions/move/commit/layoutDrop.js +2 -2
- package/dist/interactions/actions/move/commit/layoutRelease.js +2 -2
- package/dist/interactions/actions/move/commit/reparent.js +11 -5
- package/dist/interactions/actions/move/commit/reparent.js.map +1 -1
- package/dist/interactions/actions/move/frame.js +4 -10
- package/dist/interactions/actions/move/frame.js.map +1 -1
- package/dist/interactions/actions/move/landedDescendants.js +20 -17
- package/dist/interactions/actions/move/landedDescendants.js.map +1 -1
- package/dist/interactions/actions/move/layout/container.js +2 -1
- package/dist/interactions/actions/move/layout/container.js.map +1 -1
- package/dist/interactions/actions/move/layout/dragged.js +1 -1
- package/dist/interactions/actions/move/layout/dropPass.js +18 -1
- package/dist/interactions/actions/move/layout/dropPass.js.map +1 -1
- package/dist/interactions/actions/move/layout/exits.js +5 -5
- package/dist/interactions/actions/move/layout/exits.js.map +1 -1
- package/dist/interactions/actions/move/session.js +14 -3
- package/dist/interactions/actions/move/session.js.map +1 -1
- package/dist/interactions/actions/move/translate.js +8 -37
- package/dist/interactions/actions/move/translate.js.map +1 -1
- package/dist/interactions/actions/moveNodes.js +87 -0
- package/dist/interactions/actions/moveNodes.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlinesAction.js +8 -5
- package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -1
- package/dist/interactions/actions/outlines/outlineStroke.js +5 -3
- package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -1
- package/dist/interactions/actions/pathCommands/cutJoin.js +8 -5
- package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -1
- package/dist/interactions/actions/planeInput.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +83 -72
- package/dist/interactions/actions/resize/action.js.map +1 -1
- package/dist/interactions/actions/resize/commit.js +2 -1
- package/dist/interactions/actions/resize/commit.js.map +1 -1
- package/dist/interactions/actions/resize/cornerHandles.js +2 -1
- package/dist/interactions/actions/resize/cornerHandles.js.map +1 -1
- package/dist/interactions/actions/resize/session.js +2 -0
- package/dist/interactions/actions/resize/session.js.map +1 -1
- package/dist/interactions/actions/resolvePreviews.js +3 -3
- package/dist/interactions/actions/resolvePreviews.js.map +1 -1
- package/dist/interactions/actions/rotate/action.js +7 -4
- package/dist/interactions/actions/rotate/action.js.map +1 -1
- package/dist/interactions/actions/rotate/commit.js +2 -1
- package/dist/interactions/actions/rotate/commit.js.map +1 -1
- package/dist/interactions/actions/rotate/session.js +2 -0
- package/dist/interactions/actions/rotate/session.js.map +1 -1
- package/dist/interactions/actions/selectionSubtree.js +25 -9
- package/dist/interactions/actions/selectionSubtree.js.map +1 -1
- package/dist/interactions/actions/testUtils.js.map +1 -1
- package/dist/interactions/actions/transform-again/action.js +13 -11
- package/dist/interactions/actions/transform-again/action.js.map +1 -1
- package/dist/interactions/actions/transformFinish.js +106 -0
- package/dist/interactions/actions/transformFinish.js.map +1 -0
- package/dist/json.d.ts +4 -0
- package/dist/json.js +3 -0
- package/dist/kitSettingsSchema.js +8 -5
- package/dist/kitSettingsSchema.js.map +1 -1
- package/dist/{math-CrJULaZI.d.ts → math-B56zxVs5.d.ts} +10 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -1
- package/dist/move.d.ts +5 -4
- package/dist/{options-p9GZMXbY.d.ts → options-DBxEryYq.d.ts} +1 -1
- package/dist/resize.d.ts +4 -3
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +2 -2
- package/dist/test-hook/createTestHook.js +1 -1
- package/dist/test-hook/createTestHook.js.map +1 -1
- package/dist/test-hook/useTestHook.js +2 -1
- package/dist/test-hook/useTestHook.js.map +1 -1
- package/dist/test-seams.d.ts +9 -5
- 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 +2 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/hand/dragPanContribution.js +4 -1
- package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -1
- package/dist/tools/builtin/hand/useHandTool.js +7 -4
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js +1 -0
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js +1 -0
- 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/measure/useMeasureTool.js +12 -5
- package/dist/tools/builtin/measure/useMeasureTool.js.map +1 -1
- package/dist/tools/builtin/pen/penHandle.js +3 -5
- package/dist/tools/builtin/pen/penHandle.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +14 -6
- 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/polygon/usePolygonTool.js +13 -4
- 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 +3 -2
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -1
- package/dist/tools/builtin/select/pressDecision.js +32 -0
- package/dist/tools/builtin/select/pressDecision.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +22 -13
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +13 -10
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/slice/useSliceTool.js +22 -8
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +13 -4
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/sticky/stickyNode.js +4 -1
- package/dist/tools/builtin/sticky/stickyNode.js.map +1 -1
- package/dist/tools/builtin/sticky/useStickyTool.js +10 -5
- package/dist/tools/builtin/sticky/useStickyTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +3 -1
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/tools/index.js +26 -0
- package/dist/{types-CHVXGfYm.d.ts → types-7puAuVD2.d.ts} +3 -262
- package/dist/types-BN9hbdMI.d.ts +184 -0
- package/dist/types-CniVctmk.d.ts +949 -0
- package/dist/types-oFeQ5VjV.d.ts +264 -0
- package/dist/util/paint.js +1 -3
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +39 -25
- package/dist/canvas/SceneCanvas/useBuiltinRigTools.js +0 -65
- package/dist/canvas/SceneCanvas/useBuiltinRigTools.js.map +0 -1
- package/dist/tools/builtin/bone/boneActions.js +0 -156
- package/dist/tools/builtin/bone/boneActions.js.map +0 -1
- package/dist/tools/builtin/bone/boneOverlay.js +0 -71
- package/dist/tools/builtin/bone/boneOverlay.js.map +0 -1
- package/dist/tools/builtin/bone/placedRig.js +0 -28
- package/dist/tools/builtin/bone/placedRig.js.map +0 -1
- package/dist/tools/builtin/bone/rigEditState.js +0 -30
- package/dist/tools/builtin/bone/rigEditState.js.map +0 -1
- package/dist/tools/builtin/bone/useBoneTool.js +0 -125
- package/dist/tools/builtin/bone/useBoneTool.js.map +0 -1
- package/dist/tools/builtin/weight/useWeightTool.js +0 -101
- package/dist/tools/builtin/weight/useWeightTool.js.map +0 -1
- package/dist/tools/builtin/weight/weightActions.js +0 -140
- package/dist/tools/builtin/weight/weightActions.js.map +0 -1
- package/dist/tools/builtin/weight/weightOverlay.js +0 -78
- package/dist/tools/builtin/weight/weightOverlay.js.map +0 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ export function Editor() {
|
|
|
72
72
|
const selection = useSelection({ mode: 'multi' });
|
|
73
73
|
|
|
74
74
|
// Click to select, drag to move, handles to resize and rotate, the shape and
|
|
75
|
-
// text tools, sticky notes, the knife,
|
|
75
|
+
// text tools, sticky notes, the knife, and the
|
|
76
76
|
// standard keyboard actions (Cmd+A, Cmd+Z, Delete, …), all snapping to the grid:
|
|
77
77
|
return (
|
|
78
78
|
<SceneCanvas
|
package/dist/WeaselProvider.js
CHANGED
|
@@ -2,8 +2,8 @@ import { PointerProviderIfRoot } from "./canvas/SceneCanvas/PointerProviderIfRoo
|
|
|
2
2
|
import { ActionsProviderIfRoot } from "./canvas/SceneCanvas/ActionsProviderIfRoot.js";
|
|
3
3
|
import { DepRegistryProviderIfRoot } from "./canvas/SceneCanvas/DepRegistryProviderIfRoot.js";
|
|
4
4
|
import { IconRegistryScope } from "./iconRegistry/IconRegistryProvider.js";
|
|
5
|
-
import { ActionsProvider, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, DepRegistryProvider, PointerContextProvider, SelectionContextProvider, SelectionContextProviderIfRoot } from "@weasel-js/routing/react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ActionsProvider, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, DepRegistryProvider, PointerContextProvider, SelectionContextProvider, SelectionContextProviderIfRoot } from "@weasel-js/routing/react";
|
|
7
7
|
|
|
8
8
|
//#region src/WeaselProvider.tsx
|
|
9
9
|
/**
|
|
@@ -21,12 +21,12 @@ var PATH_ANCHOR_CHROME_ID = "path-edit.anchors";
|
|
|
21
21
|
*/
|
|
22
22
|
function createPathAnchorAffordances(getAnchorState, opts = {}) {
|
|
23
23
|
const { hitRadius = 8, cursor = "pointer" } = opts;
|
|
24
|
-
/** Selected polygon paths, paired with their node id. */
|
|
24
|
+
/** Selected polygon paths, and the one being edited, paired with their node id. */
|
|
25
25
|
const editablePaths = (state) => {
|
|
26
26
|
const anchorState = getAnchorState();
|
|
27
27
|
if (!anchorState) return [];
|
|
28
28
|
const out = [];
|
|
29
|
-
for (const id of state.selection) {
|
|
29
|
+
for (const id of withEdited(state.selection, anchorState.editingId)) {
|
|
30
30
|
const pose = anchorState.getPose(id);
|
|
31
31
|
if (!pose || pose.kind !== "polygon") continue;
|
|
32
32
|
out.push({
|
|
@@ -119,17 +119,16 @@ function createPathAnchorAffordances(getAnchorState, opts = {}) {
|
|
|
119
119
|
controls
|
|
120
120
|
];
|
|
121
121
|
}
|
|
122
|
-
/** The parts path-edit extensions add to the path in edit mode
|
|
123
|
-
*
|
|
122
|
+
/** The parts path-edit extensions add to the path in edit mode, each pressed
|
|
123
|
+
* as its own `hitKind`. */
|
|
124
124
|
function extensionParts(getAnchorState, hitRadius, cursor) {
|
|
125
125
|
return {
|
|
126
126
|
id: PATH_ANCHOR_CHROME_ID,
|
|
127
|
-
regions(
|
|
127
|
+
regions() {
|
|
128
128
|
const anchorState = getAnchorState();
|
|
129
129
|
const editingId = anchorState?.editingId ?? null;
|
|
130
130
|
const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];
|
|
131
131
|
if (editingId === null || extensions.length === 0) return [];
|
|
132
|
-
if (!state.selection.includes(editingId)) return [];
|
|
133
132
|
const pose = anchorState.getPose(editingId);
|
|
134
133
|
const node = anchorState.getNode?.(editingId);
|
|
135
134
|
if (!node || !pose || pose.kind !== "polygon") return [];
|
|
@@ -157,6 +156,11 @@ function extensionParts(getAnchorState, hitRadius, cursor) {
|
|
|
157
156
|
}
|
|
158
157
|
};
|
|
159
158
|
}
|
|
159
|
+
/** `selection`, and the path being edited after it when the selection does not hold it: a path edited through the
|
|
160
|
+
* effect that hides it is edited while the effect is what is selected. */
|
|
161
|
+
function withEdited(selection, editingId) {
|
|
162
|
+
return editingId === null || selection.includes(editingId) ? selection : [...selection, editingId];
|
|
163
|
+
}
|
|
160
164
|
|
|
161
165
|
//#endregion
|
|
162
166
|
export { PATH_ANCHOR_CHROME_ID, createPathAnchorAffordances };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathAnchors.js","names":[],"sources":["../../src/affordances/pathAnchors.ts"],"sourcesContent":["/** Path anchor, control-handle, and segment affordances, and the parts path-edit extensions add. */\n\nimport type { CursorSpec } from '@weasel-js/cursor';\nimport type { Affordance, AffordanceBinding, AffordanceRegion, CommonAffordanceScratch } from './types';\nimport type { ChromeState } from 'core/selection/chromeState';\nimport { pathToAnchors, type AnchorSet, type PolygonPath } from '@weasel-js/geom';\nimport { enumerateAnchors } from 'interactions/actions/edit-anchors/geometry';\nimport type { PathEditExtension } from 'features/paths/pathEditExtension';\n\n/**\n * Live anchor-editing state. The thunk that returns it is called on every\n * pointer event, so it must be cheap (O(1) field reads).\n */\nexport interface AnchorState {\n /** Id of the path currently in anchor-edit mode, or `null`. Control handles\n * are only hittable on the path that is being edited. */\n editingId: string | null;\n /** Current editable path for a node id. Non-polygon values are ignored. */\n getPose(id: string): unknown;\n /** The committed pose and data of a node, which extensions' parts read. */\n getNode?(id: string): { pose: unknown; data: unknown } | null;\n /** The path-edit extensions whose parts are pressed, in order. */\n extensions?: readonly PathEditExtension[];\n /** The active path-edit tool, if any. While one is set, anchors and controls\n * carry no cursor of their own, so the tool's action shows its own. */\n tool?: string | null;\n /** The path whose outline counts as a segment press, when it is not\n * `getPose`'s: a path drawn from a form, edited through the form's edit\n * path. */\n getOutline?(id: string): unknown;\n}\n\n/** Options for the path-anchor affordances. */\nexport interface PathAnchorAffordanceOptions {\n /** Hit radius (screen-px) for anchor and control points. Default 8. */\n hitRadius?: number;\n /** Cursor while hovering an anchor or control, with no path-edit tool\n * active. Defaults to `'pointer'`. */\n cursor?: CursorSpec;\n}\n\n/** What an anchor hit hands to the action that follows. */\nexport interface AnchorScratch extends CommonAffordanceScratch {\n /** Node id of the path the anchor belongs to. */\n targetId: string;\n /** Sequential anchor index in path walk order. */\n anchorIndex: number;\n /** Which of the anchor's three grabbable points this is. */\n part: 'anchor' | 'controlIn' | 'controlOut';\n}\n\n/** Chrome-caps id gating the anchor, control, and segment affordances. */\nexport const PATH_ANCHOR_CHROME_ID = 'path-edit.anchors';\n\n/**\n * Segment, extension-part, anchor, and control affordances for the selected\n * paths, bottom → top.\n *\n * Three affordances rather than one, so that a control handle beats an anchor\n * regardless of which is nearer, the way controls draw on top, and both beat\n * the segment they sit on. Within each, nearest wins. A press on the edited\n * path's outline is a `segment` hit, which the segment bend binds to and a\n * selection move turns down. Anchors, controls, and segments share one id:\n * chrome-caps gates anchor editing as a single piece of chrome. A part a\n * path-edit extension adds (`PathEditExtension.parts`) may name a chrome id of\n * its own as well, so it can be shown apart from the anchors.\n *\n * Order matters — spread this into an affordance list in the returned order.\n */\nexport function createPathAnchorAffordances(\n getAnchorState: () => AnchorState | null,\n opts: PathAnchorAffordanceOptions = {},\n): Affordance[] {\n const { hitRadius = 8, cursor = 'pointer' } = opts;\n\n /** Selected polygon paths, paired with their node id. */\n const editablePaths = (state: ChromeState): Array<{ id: string; path: PolygonPath }> => {\n const anchorState = getAnchorState();\n if (!anchorState) return [];\n const out: Array<{ id: string; path: PolygonPath }> = [];\n for (const id of state.selection) {\n const pose = anchorState.getPose(id);\n if (!pose || (pose as { kind?: string }).kind !== 'polygon') continue;\n out.push({ id, path: pose as PolygonPath });\n }\n return out;\n };\n\n const point = (\n id: string,\n targetId: string,\n x: number,\n y: number,\n scratch: AnchorScratch,\n hitKind: string,\n ): AffordanceRegion => ({\n id,\n // Anchor coordinates are already world space, pose rotation baked in.\n // Anchoring to `null` keeps the framework from applying it twice.\n targetId: null,\n shape: { kind: 'point', x, y, hitRadiusPx: hitRadius },\n hitKind,\n ...(getAnchorState()?.tool ? {} : { cursor }),\n bind: (): AffordanceBinding => ({ initialScratch: { ...scratch, targetId } }),\n });\n\n const anchors: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // `editAnchorsAction` edits whatever path the dep says is in edit\n // mode, ignoring which one was hit — so once a path IS being edited,\n // only its own anchors may claim the press.\n if (editingId !== null && id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n out.push(point(\n `${id}:anchor:${a.anchorIndex}`,\n id, a.x, a.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'anchor' },\n `anchor:${a.anchorIndex}`,\n ));\n }\n }\n return out;\n },\n };\n\n const controls: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n if (editingId === null) return [];\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // Controls are grabbable only on the path actually in edit mode.\n if (id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n if (a.controlIn) {\n out.push(point(\n `${id}:controlIn:${a.anchorIndex}`,\n id, a.controlIn.x, a.controlIn.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlIn' },\n `controlIn:${a.anchorIndex}`,\n ));\n }\n if (a.controlOut) {\n out.push(point(\n `${id}:controlOut:${a.anchorIndex}`,\n id, a.controlOut.x, a.controlOut.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlOut' },\n `controlOut:${a.anchorIndex}`,\n ));\n }\n }\n }\n return out;\n },\n };\n\n const segments: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n if (editingId === null) return [];\n const edited = editablePaths(state).find(({ id }) => id === editingId);\n if (!edited) return [];\n const outline = getAnchorState()?.getOutline?.(editingId) as PolygonPath | null | undefined;\n return [{\n id: `${editingId}:segment`,\n targetId: null,\n shape: { kind: 'outline', path: outline?.kind === 'polygon' ? outline : edited.path, hitRadiusPx: hitRadius },\n hitKind: 'segment',\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n }];\n },\n };\n\n return [segments, extensionParts(getAnchorState, hitRadius, cursor), anchors, controls];\n}\n\n/** The parts path-edit extensions add to the path in edit mode while it is\n * selected, each pressed as its own `hitKind`. */\nfunction extensionParts(\n getAnchorState: () => AnchorState | null,\n hitRadius: number,\n cursor: CursorSpec,\n): Affordance {\n return {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];\n if (editingId === null || extensions.length === 0) return [];\n if (!(state.selection as readonly string[]).includes(editingId)) return [];\n const pose = anchorState!.getPose(editingId);\n const node = anchorState!.getNode?.(editingId);\n if (!node || !pose || (pose as { kind?: string }).kind !== 'polygon') return [];\n const target = {\n id: editingId, node, path: pose as PolygonPath, anchors: pathToAnchors(pose as PolygonPath) as AnchorSet,\n };\n return extensions.flatMap((ext) => ext.parts!(target).map((part): AffordanceRegion => ({\n id: `${editingId}:${part.hitKind}`,\n targetId: null,\n shape: {\n kind: 'point', x: part.x, y: part.y, hitRadiusPx: part.hitRadiusPx ?? hitRadius,\n ...(part.standoff ? { standoff: part.standoff } : {}),\n },\n hitKind: part.hitKind,\n ...(part.chromeId ? { chromeId: part.chromeId } : {}),\n cursor,\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n })));\n },\n };\n}\n"],"mappings":";;;;;AAoDA,IAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,SAAgB,4BACd,gBACA,OAAoC,CAAC,GACvB;CACd,MAAM,EAAE,YAAY,GAAG,SAAS,cAAc;;CAG9C,MAAM,iBAAiB,UAAiE;EACtF,MAAM,cAAc,eAAe;EACnC,IAAI,CAAC,aAAa,OAAO,CAAC;EAC1B,MAAM,MAAgD,CAAC;EACvD,KAAK,MAAM,MAAM,MAAM,WAAW;GAChC,MAAM,OAAO,YAAY,QAAQ,EAAE;GACnC,IAAI,CAAC,QAAS,KAA2B,SAAS,WAAW;GAC7D,IAAI,KAAK;IAAE;IAAI,MAAM;GAAoB,CAAC;EAC5C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IAAM,MAAM;IAAqB,SAAS,cAAc,IAAmB;GAC5F;GACA,OAAO,WAAW,SAAS,QAAQ,IAAI,MAAO,MAAM,CAAC,CAAC,KAAK,UAA4B;IACrF,IAAI,GAAG,UAAU,GAAG,KAAK;IACzB,UAAU;IACV,OAAO;KACL,MAAM;KAAS,GAAG,KAAK;KAAG,GAAG,KAAK;KAAG,aAAa,KAAK,eAAe;KACtE,GAAI,KAAK,WAAW,EAAE,UAAU,KAAK,SAAS,IAAI,CAAC;IACrD;IACA,SAAS,KAAK;IACd,GAAI,KAAK,WAAW,EAAE,UAAU,KAAK,SAAS,IAAI,CAAC;IACnD;IACA,aAAgC,EAAE,gBAAgB,EAAE,UAAU,UAAU,EAAE;GAC5E,EAAE,CAAC;EACL;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"pathAnchors.js","names":[],"sources":["../../src/affordances/pathAnchors.ts"],"sourcesContent":["/** Path anchor, control-handle, and segment affordances, and the parts path-edit extensions add. */\n\nimport type { CursorSpec } from '@weasel-js/cursor';\nimport type { Affordance, AffordanceBinding, AffordanceRegion, CommonAffordanceScratch } from './types';\nimport type { ChromeState } from 'core/selection/chromeState';\nimport { pathToAnchors, type AnchorSet, type PolygonPath } from '@weasel-js/geom';\nimport { enumerateAnchors } from 'interactions/actions/edit-anchors/geometry';\nimport type { PathEditExtension } from 'features/paths/pathEditExtension';\n\n/**\n * Live anchor-editing state. The thunk that returns it is called on every\n * pointer event, so it must be cheap (O(1) field reads).\n */\nexport interface AnchorState {\n /** Id of the path currently in anchor-edit mode, or `null`. Control handles\n * are only hittable on the path that is being edited. */\n editingId: string | null;\n /** Current editable path for a node id. Non-polygon values are ignored. */\n getPose(id: string): unknown;\n /** The committed pose and data of a node, which extensions' parts read. */\n getNode?(id: string): { pose: unknown; data: unknown } | null;\n /** The path-edit extensions whose parts are pressed, in order. */\n extensions?: readonly PathEditExtension[];\n /** The active path-edit tool, if any. While one is set, anchors and controls\n * carry no cursor of their own, so the tool's action shows its own. */\n tool?: string | null;\n /** The path whose outline counts as a segment press, when it is not\n * `getPose`'s: a path drawn from a form, edited through the form's edit\n * path. */\n getOutline?(id: string): unknown;\n}\n\n/** Options for the path-anchor affordances. */\nexport interface PathAnchorAffordanceOptions {\n /** Hit radius (screen-px) for anchor and control points. Default 8. */\n hitRadius?: number;\n /** Cursor while hovering an anchor or control, with no path-edit tool\n * active. Defaults to `'pointer'`. */\n cursor?: CursorSpec;\n}\n\n/** What an anchor hit hands to the action that follows. */\nexport interface AnchorScratch extends CommonAffordanceScratch {\n /** Node id of the path the anchor belongs to. */\n targetId: string;\n /** Sequential anchor index in path walk order. */\n anchorIndex: number;\n /** Which of the anchor's three grabbable points this is. */\n part: 'anchor' | 'controlIn' | 'controlOut';\n}\n\n/** Chrome-caps id gating the anchor, control, and segment affordances. */\nexport const PATH_ANCHOR_CHROME_ID = 'path-edit.anchors';\n\n/**\n * Segment, extension-part, anchor, and control affordances for the selected\n * paths, bottom → top.\n *\n * Three affordances rather than one, so that a control handle beats an anchor\n * regardless of which is nearer, the way controls draw on top, and both beat\n * the segment they sit on. Within each, nearest wins. A press on the edited\n * path's outline is a `segment` hit, which the segment bend binds to and a\n * selection move turns down. Anchors, controls, and segments share one id:\n * chrome-caps gates anchor editing as a single piece of chrome. A part a\n * path-edit extension adds (`PathEditExtension.parts`) may name a chrome id of\n * its own as well, so it can be shown apart from the anchors.\n *\n * Order matters — spread this into an affordance list in the returned order.\n */\nexport function createPathAnchorAffordances(\n getAnchorState: () => AnchorState | null,\n opts: PathAnchorAffordanceOptions = {},\n): Affordance[] {\n const { hitRadius = 8, cursor = 'pointer' } = opts;\n\n /** Selected polygon paths, and the one being edited, paired with their node id. */\n const editablePaths = (state: ChromeState): Array<{ id: string; path: PolygonPath }> => {\n const anchorState = getAnchorState();\n if (!anchorState) return [];\n const out: Array<{ id: string; path: PolygonPath }> = [];\n for (const id of withEdited(state.selection, anchorState.editingId)) {\n const pose = anchorState.getPose(id);\n if (!pose || (pose as { kind?: string }).kind !== 'polygon') continue;\n out.push({ id, path: pose as PolygonPath });\n }\n return out;\n };\n\n const point = (\n id: string,\n targetId: string,\n x: number,\n y: number,\n scratch: AnchorScratch,\n hitKind: string,\n ): AffordanceRegion => ({\n id,\n // Anchor coordinates are already world space, pose rotation baked in.\n // Anchoring to `null` keeps the framework from applying it twice.\n targetId: null,\n shape: { kind: 'point', x, y, hitRadiusPx: hitRadius },\n hitKind,\n ...(getAnchorState()?.tool ? {} : { cursor }),\n bind: (): AffordanceBinding => ({ initialScratch: { ...scratch, targetId } }),\n });\n\n const anchors: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // `editAnchorsAction` edits whatever path the dep says is in edit\n // mode, ignoring which one was hit — so once a path IS being edited,\n // only its own anchors may claim the press.\n if (editingId !== null && id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n out.push(point(\n `${id}:anchor:${a.anchorIndex}`,\n id, a.x, a.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'anchor' },\n `anchor:${a.anchorIndex}`,\n ));\n }\n }\n return out;\n },\n };\n\n const controls: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n if (editingId === null) return [];\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // Controls are grabbable only on the path actually in edit mode.\n if (id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n if (a.controlIn) {\n out.push(point(\n `${id}:controlIn:${a.anchorIndex}`,\n id, a.controlIn.x, a.controlIn.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlIn' },\n `controlIn:${a.anchorIndex}`,\n ));\n }\n if (a.controlOut) {\n out.push(point(\n `${id}:controlOut:${a.anchorIndex}`,\n id, a.controlOut.x, a.controlOut.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlOut' },\n `controlOut:${a.anchorIndex}`,\n ));\n }\n }\n }\n return out;\n },\n };\n\n const segments: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n if (editingId === null) return [];\n const edited = editablePaths(state).find(({ id }) => id === editingId);\n if (!edited) return [];\n const outline = getAnchorState()?.getOutline?.(editingId) as PolygonPath | null | undefined;\n return [{\n id: `${editingId}:segment`,\n targetId: null,\n shape: { kind: 'outline', path: outline?.kind === 'polygon' ? outline : edited.path, hitRadiusPx: hitRadius },\n hitKind: 'segment',\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n }];\n },\n };\n\n return [segments, extensionParts(getAnchorState, hitRadius, cursor), anchors, controls];\n}\n\n/** The parts path-edit extensions add to the path in edit mode, each pressed\n * as its own `hitKind`. */\nfunction extensionParts(\n getAnchorState: () => AnchorState | null,\n hitRadius: number,\n cursor: CursorSpec,\n): Affordance {\n return {\n id: PATH_ANCHOR_CHROME_ID,\n regions() {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];\n if (editingId === null || extensions.length === 0) return [];\n const pose = anchorState!.getPose(editingId);\n const node = anchorState!.getNode?.(editingId);\n if (!node || !pose || (pose as { kind?: string }).kind !== 'polygon') return [];\n const target = {\n id: editingId, node, path: pose as PolygonPath, anchors: pathToAnchors(pose as PolygonPath) as AnchorSet,\n };\n return extensions.flatMap((ext) => ext.parts!(target).map((part): AffordanceRegion => ({\n id: `${editingId}:${part.hitKind}`,\n targetId: null,\n shape: {\n kind: 'point', x: part.x, y: part.y, hitRadiusPx: part.hitRadiusPx ?? hitRadius,\n ...(part.standoff ? { standoff: part.standoff } : {}),\n },\n hitKind: part.hitKind,\n ...(part.chromeId ? { chromeId: part.chromeId } : {}),\n cursor,\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n })));\n },\n };\n}\n\n/** `selection`, and the path being edited after it when the selection does not hold it: a path edited through the\n * effect that hides it is edited while the effect is what is selected. */\nfunction withEdited(selection: readonly string[], editingId: string | null): readonly string[] {\n return editingId === null || selection.includes(editingId) ? selection : [...selection, editingId];\n}\n"],"mappings":";;;;;AAoDA,IAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,SAAgB,4BACd,gBACA,OAAoC,CAAC,GACvB;CACd,MAAM,EAAE,YAAY,GAAG,SAAS,cAAc;;CAG9C,MAAM,iBAAiB,UAAiE;EACtF,MAAM,cAAc,eAAe;EACnC,IAAI,CAAC,aAAa,OAAO,CAAC;EAC1B,MAAM,MAAgD,CAAC;EACvD,KAAK,MAAM,MAAM,WAAW,MAAM,WAAW,YAAY,SAAS,GAAG;GACnE,MAAM,OAAO,YAAY,QAAQ,EAAE;GACnC,IAAI,CAAC,QAAS,KAA2B,SAAS,WAAW;GAC7D,IAAI,KAAK;IAAE;IAAI,MAAM;GAAoB,CAAC;EAC5C;EACA,OAAO;CACT;CAEA,MAAM,SACJ,IACA,UACA,GACA,GACA,SACA,aACsB;EACtB;EAGA,UAAU;EACV,OAAO;GAAE,MAAM;GAAS;GAAG;GAAG,aAAa;EAAU;EACrD;EACA,GAAI,eAAe,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO;EAC3C,aAAgC,EAAE,gBAAgB;GAAE,GAAG;GAAS;EAAS,EAAE;CAC7E;CAEA,MAAM,UAAsB;EAC1B,IAAI;EACJ,QAAQ,OAAO;GACb,MAAM,YAAY,eAAe,CAAC,EAAE,aAAa;GACjD,MAAM,MAA0B,CAAC;GACjC,KAAK,MAAM,EAAE,IAAI,UAAU,cAAc,KAAK,GAAG;IAI/C,IAAI,cAAc,QAAQ,OAAO,WAAW;IAC5C,KAAK,MAAM,KAAK,iBAAiB,IAAI,GACnC,IAAI,KAAK,MACP,GAAG,GAAG,UAAU,EAAE,eAClB,IAAI,EAAE,GAAG,EAAE,GACX;KAAE,UAAU;KAA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, scenePoseTarget } from "./poseTarget.js";
|
|
2
2
|
import { dataRestPath } from "./rig/skinBinding.js";
|
|
3
|
-
import { bindRig, rigidRigApply } from "./rig/bindRig.js";
|
|
4
|
-
import { useRig } from "./rig/useRig.js";
|
|
5
|
-
import { placeSkeleton, rigFromNode, unplaceSkeleton, useRigNode } from "./rig/rigNode.js";
|
|
6
3
|
import { createDepartures } from "./departures.js";
|
|
7
4
|
import { bindPoseTransition, glidesByDefault, usePoseTransition } from "./poseTransition.js";
|
|
8
5
|
import { createWrittenPoseTarget } from "./writtenPoseTarget.js";
|
|
@@ -12,6 +9,9 @@ import { animateOnSetPose } from "./wrappers/animateOnSetPose.js";
|
|
|
12
9
|
import { animateLifecycle } from "./wrappers/animateLifecycle.js";
|
|
13
10
|
import { createReflowTransition, useAnimatedReflow } from "./reflow.js";
|
|
14
11
|
import { momentum } from "./behaviors/momentum.js";
|
|
12
|
+
import { bindRig, rigidRigApply } from "./rig/bindRig.js";
|
|
13
|
+
import { useRig } from "./rig/useRig.js";
|
|
14
|
+
import { placeSkeleton, rigFromNode, unplaceSkeleton, useRigNode } from "./rig/rigNode.js";
|
|
15
15
|
import { EASINGS, SPRING_PRESETS, cubicBezierEasing, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut as easeOut$1, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic as easeOutCubic$1, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, linear, resolveEasing as resolveEasing$1 } from "@weasel-js/geom";
|
|
16
16
|
import { hexToOklchDeg, hslToSrgb, interpolateSrgb, lerpColorArray, lerpOklab, lerpOklch, linearSrgbToOklab, linearToSrgb, oklabToLinearSrgb, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, srgbFloatToOklab, srgbToHsl, srgbToLinear, srgbU8ToOklab } from "@weasel-js/paint";
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AUTO_POSE_DESCRIPTOR } from "../../core/geometry/autoPoseDescriptor.js";
|
|
2
|
-
import { createRigSeat } from "./rigSeat.js";
|
|
3
2
|
import { bindSkins, dataRestPath } from "./skinBinding.js";
|
|
3
|
+
import { createRigSeat } from "./rigSeat.js";
|
|
4
4
|
import { mat3 } from "@weasel-js/geom";
|
|
5
5
|
import { resolveSkeleton } from "@weasel-js/animator";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rigNode.js","names":[],"sources":["../../../src/animation/rig/rigNode.ts"],"sourcesContent":["import { useMemo, useState, useSyncExternalStore } from 'react';\nimport { poseFrameInverseOf, poseFrameOf } from '@weasel-js/geom';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId } from '../../core/scene/types';\nimport type { BindRigOptions, Rig, RigScene } from './bindRig';\nimport type { Skin } from '@weasel-js/animator';\nimport type { Skeleton } from '@weasel-js/animator';\nimport { createRigSeat } from './rigSeat';\nimport { useSeatedRig } from './useRig';\n\n/** What a rig reads from node data: a `skeleton` on the node that is the rig, and on the nodes\n * under it a `skin` for a path that bends or a `joint` for a node that rides one whole. */\nexport interface RigNodeData {\n /** Joints relative to the node's pose: its box's top-left corner, turned as the node is. */\n skeleton?: Skeleton;\n skin?: Skin;\n joint?: string;\n}\n\n/** Weights to bind in place of the document's, and word of when they change. A `RigEditState`\n * is one: it holds what a stroke of the weight tool has painted and not yet written. */\nexport interface PaintedSkins {\n /** By node. A new map whenever the weights change. */\n painted(): ReadonlyMap<NodeId, Skin>;\n listen(fn: () => void): () => void;\n}\n\n/** The part of a scene `rigFromNode` reads. */\nexport interface RigNodeSource<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n childrenOf(id: NodeId): readonly NodeId[];\n}\n\n/** The skeleton, bindings, and skins a rig node declares, as `bindRig` takes them. */\nexport interface RigNodeParts {\n skeleton: Skeleton;\n bindings: Record<string, NodeId[]>;\n skins: Record<NodeId, Skin>;\n}\n\ninterface Reading extends RigNodeParts {\n /** Every node, pose, and data object the parts were read from, to tell when they are stale. */\n refs: unknown[];\n}\n\ntype Affine = readonly [number, number, number, number, number, number];\nconst through = (m: Affine | null, x: number, y: number): [number, number] =>\n (m ? [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]] : [x, y]);\n\n/**\n * A skeleton as a rig node's data keeps it, moved to where the node's pose puts it: its root\n * joints are offset from the pose box's top-left corner and turned as the node is. Joints\n * under a root are relative to their parents and are left as they are.\n */\nexport function placeSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const frame = poseFrameOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(frame, box.x + joint.bind.x, box.y + joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x, y, rotation: joint.bind.rotation + turn } };\n }),\n };\n}\n\n/** The inverse of {@link placeSkeleton}: a skeleton in the scene's space, as the node at\n * `pose` would keep it in its data. */\nexport function unplaceSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const inverse = poseFrameInverseOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(inverse, joint.bind.x, joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x: x - box.x, y: y - box.y, rotation: joint.bind.rotation - turn } };\n }),\n };\n}\n\nconst UNPAINTED: ReadonlyMap<NodeId, Skin> = new Map();\nconst noWord = (): (() => void) => () => {};\nconst unpainted = (): ReadonlyMap<NodeId, Skin> => UNPAINTED;\n\nfunction read<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose>,\n painted: ReadonlyMap<NodeId, Skin> = UNPAINTED,\n): Reading {\n const node = scene.get(id);\n if (!node) throw new Error(`rigFromNode: the rig is node \"${id}\", which the scene lacks.`);\n const local = (node.data as RigNodeData | null | undefined)?.skeleton;\n if (!local) throw new Error(`rigFromNode: node \"${id}\" has no skeleton in its data.`);\n\n const skeleton = placeSkeleton(local, node.pose, descriptor);\n\n const out: Reading = { skeleton, bindings: {}, skins: {}, refs: [node.pose, node.data] };\n const walk = (parent: NodeId): void => {\n for (const child of scene.childrenOf(parent)) {\n const n = scene.get(child);\n if (!n) continue;\n const data = n.data as RigNodeData | null | undefined;\n const skin = painted.get(child) ?? data?.skin;\n out.refs.push(child, n.pose, n.data, skin);\n if (skin) out.skins[child] = skin;\n else if (data?.joint !== undefined) (out.bindings[data.joint] ??= []).push(child);\n walk(child);\n }\n };\n walk(id);\n return out;\n}\n\nconst sameRefs = (a: Reading, b: Reading): boolean =>\n a === b || (a.refs.length === b.refs.length && a.refs.every((r, i) => r === b.refs[i]));\n\n/**\n * Read a rig out of the scene: the skeleton in `id`'s `data.skeleton`, placed by that node's\n * pose, and under it every node whose data has a `skin` or names a `joint`.\n */\nexport function rigFromNode<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): RigNodeParts {\n const { skeleton, bindings, skins } = read(scene, id, descriptor);\n return { skeleton, bindings, skins };\n}\n\n/** Options for `useRigNode`. */\nexport interface UseRigNodeOptions<TPose>\n extends Pick<BindRigOptions<TPose>, 'apply' | 'descriptor' | 'restPath'> {\n scene: RigScene<TPose> & RigNodeSource<TPose> & {\n subscribe(listener: () => void): () => void;\n getVersion(): number;\n };\n /** The node whose data holds the skeleton. */\n node: NodeId;\n /** Weights bound in place of a node's `data.skin` while they are held. Give it the\n * `RigEditState` the weight tool has, and a stroke bends the path as it is painted. */\n painting?: PaintedSkins;\n}\n\n/**\n * A {@link Rig} read from a node, as {@link rigFromNode} reads it. It is bound again when the\n * rig node or a node under it changes its pose or data, or when nodes under it come or go; an\n * edit elsewhere in the scene leaves it alone. A rig bound again keeps its `target`, with the\n * animations running on it, its committed pose, and its placement, unless the skeleton's\n * joints were added, removed, renamed, or reordered. Then it has a new `target`, which takes\n * over the placement and the pose of every joint the skeleton still names. Animations go on\n * running on the target they were started on and show through the new one, so a joint that\n * was renamed stops moving.\n */\nexport function useRigNode<TPose>(options: UseRigNodeOptions<TPose>): Rig {\n const { scene, node, apply, descriptor, restPath, painting } = options;\n const version = useSyncExternalStore(scene.subscribe, scene.getVersion);\n const painted = useSyncExternalStore(painting?.listen ?? noWord, painting?.painted ?? unpainted);\n const next = useMemo(\n () => read(scene, node, descriptor ?? (AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>), painted),\n // `version` is what says the scene may answer differently.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [scene, node, descriptor, version, painted],\n );\n // Each read makes new objects; the rig must outlive a read that found nothing changed.\n const [held, setHeld] = useState(next);\n const parts = sameRefs(held, next) ? held : next;\n if (parts !== held) setHeld(next);\n const joints = JSON.stringify(parts.skeleton.joints.map((joint) => joint.name));\n // A pose target's axes are its joints' names in order, so the seat holds while those do,\n // and the next one takes over from it.\n const [seated, setSeated] = useState(() => ({ joints, seat: createRigSeat(parts.skeleton) }));\n let { seat } = seated;\n if (seated.joints !== joints) {\n seat = createRigSeat(parts.skeleton, seated.seat);\n setSeated({ joints, seat });\n }\n return useSeatedRig({\n scene, skeleton: parts.skeleton,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E,MAAM,EAAE,OAAO,MAAM,OAAO,YAAY,UAAU,aAAa;CAC/D,MAAM,UAAU,qBAAqB,MAAM,WAAW,MAAM,UAAU;CACtE,MAAM,UAAU,qBAAqB,UAAU,UAAU,QAAQ,UAAU,WAAW,SAAS;CAC/F,MAAM,OAAO,cACL,KAAK,OAAO,MAAM,cAAe,sBAAgD,OAAO,GAG9F;EAAC;EAAO;EAAM;EAAY;EAAS;CAAO,CAC5C;CAEA,MAAM,CAAC,MAAM,WAAW,SAAS,IAAI;CACrC,MAAM,QAAQ,SAAS,MAAM,IAAI,IAAI,OAAO;CAC5C,IAAI,UAAU,MAAM,QAAQ,IAAI;CAChC,MAAM,SAAS,KAAK,UAAU,MAAM,SAAS,OAAO,KAAK,UAAU,MAAM,IAAI,CAAC;CAG9E,MAAM,CAAC,QAAQ,aAAa,gBAAgB;EAAE;EAAQ,MAAM,cAAc,MAAM,QAAQ;CAAE,EAAE;CAC5F,IAAI,EAAE,SAAS;CACf,IAAI,OAAO,WAAW,QAAQ;EAC5B,OAAO,cAAc,MAAM,UAAU,OAAO,IAAI;EAChD,UAAU;GAAE;GAAQ;EAAK,CAAC;CAC5B;CACA,OAAO,aAAa;EAClB;EAAO,UAAU,MAAM;EAAU,UAAU,MAAM;EAAU,OAAO,MAAM;EAAO;EAAO;EAAY;CACpG,GAAG,IAAI;AACT"}
|
|
1
|
+
{"version":3,"file":"rigNode.js","names":[],"sources":["../../../src/animation/rig/rigNode.ts"],"sourcesContent":["import { useMemo, useState, useSyncExternalStore } from 'react';\nimport { poseFrameInverseOf, poseFrameOf } from '@weasel-js/geom';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport type { PoseDescriptor } from '../../core/geometry/poseDescriptor';\nimport type { NodeId } from '../../core/scene/types';\nimport type { BindRigOptions, Rig, RigScene } from './bindRig';\nimport type { Skin } from '@weasel-js/animator';\nimport type { Skeleton } from '@weasel-js/animator';\nimport { createRigSeat } from './rigSeat';\nimport { useSeatedRig } from './useRig';\n\n/** What a rig reads from node data: a `skeleton` on the node that is the rig, and on the nodes\n * under it a `skin` for a path that bends or a `joint` for a node that rides one whole. */\nexport interface RigNodeData {\n /** Joints relative to the node's pose: its box's top-left corner, turned as the node is. */\n skeleton?: Skeleton;\n skin?: Skin;\n joint?: string;\n}\n\n/** Weights to bind in place of the document's, and word of when they change. `@weasel-js/rig`'s\n * `RigEditState` is one: it holds what a stroke of the weight tool has painted and not yet written. */\nexport interface PaintedSkins {\n /** By node. A new map whenever the weights change. */\n painted(): ReadonlyMap<NodeId, Skin>;\n listen(fn: () => void): () => void;\n}\n\n/** The part of a scene `rigFromNode` reads. */\nexport interface RigNodeSource<TPose> {\n get(id: NodeId): { pose: TPose; data?: unknown } | undefined;\n childrenOf(id: NodeId): readonly NodeId[];\n}\n\n/** The skeleton, bindings, and skins a rig node declares, as `bindRig` takes them. */\nexport interface RigNodeParts {\n skeleton: Skeleton;\n bindings: Record<string, NodeId[]>;\n skins: Record<NodeId, Skin>;\n}\n\ninterface Reading extends RigNodeParts {\n /** Every node, pose, and data object the parts were read from, to tell when they are stale. */\n refs: unknown[];\n}\n\ntype Affine = readonly [number, number, number, number, number, number];\nconst through = (m: Affine | null, x: number, y: number): [number, number] =>\n (m ? [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]] : [x, y]);\n\n/**\n * A skeleton as a rig node's data keeps it, moved to where the node's pose puts it: its root\n * joints are offset from the pose box's top-left corner and turned as the node is. Joints\n * under a root are relative to their parents and are left as they are.\n */\nexport function placeSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const frame = poseFrameOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(frame, box.x + joint.bind.x, box.y + joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x, y, rotation: joint.bind.rotation + turn } };\n }),\n };\n}\n\n/** The inverse of {@link placeSkeleton}: a skeleton in the scene's space, as the node at\n * `pose` would keep it in its data. */\nexport function unplaceSkeleton<TPose>(\n skeleton: Skeleton,\n pose: TPose,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): Skeleton {\n const box = descriptor.getBounds(pose);\n const inverse = poseFrameInverseOf(pose);\n const turn = descriptor.getRotation?.(pose) ?? 0;\n return {\n joints: skeleton.joints.map((joint) => {\n if (joint.parent != null) return joint;\n const [x, y] = through(inverse, joint.bind.x, joint.bind.y);\n return { ...joint, bind: { ...joint.bind, x: x - box.x, y: y - box.y, rotation: joint.bind.rotation - turn } };\n }),\n };\n}\n\nconst UNPAINTED: ReadonlyMap<NodeId, Skin> = new Map();\nconst noWord = (): (() => void) => () => {};\nconst unpainted = (): ReadonlyMap<NodeId, Skin> => UNPAINTED;\n\nfunction read<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose>,\n painted: ReadonlyMap<NodeId, Skin> = UNPAINTED,\n): Reading {\n const node = scene.get(id);\n if (!node) throw new Error(`rigFromNode: the rig is node \"${id}\", which the scene lacks.`);\n const local = (node.data as RigNodeData | null | undefined)?.skeleton;\n if (!local) throw new Error(`rigFromNode: node \"${id}\" has no skeleton in its data.`);\n\n const skeleton = placeSkeleton(local, node.pose, descriptor);\n\n const out: Reading = { skeleton, bindings: {}, skins: {}, refs: [node.pose, node.data] };\n const walk = (parent: NodeId): void => {\n for (const child of scene.childrenOf(parent)) {\n const n = scene.get(child);\n if (!n) continue;\n const data = n.data as RigNodeData | null | undefined;\n const skin = painted.get(child) ?? data?.skin;\n out.refs.push(child, n.pose, n.data, skin);\n if (skin) out.skins[child] = skin;\n else if (data?.joint !== undefined) (out.bindings[data.joint] ??= []).push(child);\n walk(child);\n }\n };\n walk(id);\n return out;\n}\n\nconst sameRefs = (a: Reading, b: Reading): boolean =>\n a === b || (a.refs.length === b.refs.length && a.refs.every((r, i) => r === b.refs[i]));\n\n/**\n * Read a rig out of the scene: the skeleton in `id`'s `data.skeleton`, placed by that node's\n * pose, and under it every node whose data has a `skin` or names a `joint`.\n */\nexport function rigFromNode<TPose>(\n scene: RigNodeSource<TPose>,\n id: NodeId,\n descriptor: PoseDescriptor<TPose> = AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>,\n): RigNodeParts {\n const { skeleton, bindings, skins } = read(scene, id, descriptor);\n return { skeleton, bindings, skins };\n}\n\n/** Options for `useRigNode`. */\nexport interface UseRigNodeOptions<TPose>\n extends Pick<BindRigOptions<TPose>, 'apply' | 'descriptor' | 'restPath'> {\n scene: RigScene<TPose> & RigNodeSource<TPose> & {\n subscribe(listener: () => void): () => void;\n getVersion(): number;\n };\n /** The node whose data holds the skeleton. */\n node: NodeId;\n /** Weights bound in place of a node's `data.skin` while they are held. Give it the\n * `RigEditState` `@weasel-js/rig`'s weight tool has, and a stroke bends the path as it is painted. */\n painting?: PaintedSkins;\n}\n\n/**\n * A {@link Rig} read from a node, as {@link rigFromNode} reads it. It is bound again when the\n * rig node or a node under it changes its pose or data, or when nodes under it come or go; an\n * edit elsewhere in the scene leaves it alone. A rig bound again keeps its `target`, with the\n * animations running on it, its committed pose, and its placement, unless the skeleton's\n * joints were added, removed, renamed, or reordered. Then it has a new `target`, which takes\n * over the placement and the pose of every joint the skeleton still names. Animations go on\n * running on the target they were started on and show through the new one, so a joint that\n * was renamed stops moving.\n */\nexport function useRigNode<TPose>(options: UseRigNodeOptions<TPose>): Rig {\n const { scene, node, apply, descriptor, restPath, painting } = options;\n const version = useSyncExternalStore(scene.subscribe, scene.getVersion);\n const painted = useSyncExternalStore(painting?.listen ?? noWord, painting?.painted ?? unpainted);\n const next = useMemo(\n () => read(scene, node, descriptor ?? (AUTO_POSE_DESCRIPTOR as PoseDescriptor<TPose>), painted),\n // `version` is what says the scene may answer differently.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [scene, node, descriptor, version, painted],\n );\n // Each read makes new objects; the rig must outlive a read that found nothing changed.\n const [held, setHeld] = useState(next);\n const parts = sameRefs(held, next) ? held : next;\n if (parts !== held) setHeld(next);\n const joints = JSON.stringify(parts.skeleton.joints.map((joint) => joint.name));\n // A pose target's axes are its joints' names in order, so the seat holds while those do,\n // and the next one takes over from it.\n const [seated, setSeated] = useState(() => ({ joints, seat: createRigSeat(parts.skeleton) }));\n let { seat } = seated;\n if (seated.joints !== joints) {\n seat = createRigSeat(parts.skeleton, seated.seat);\n setSeated({ joints, seat });\n }\n return useSeatedRig({\n scene, skeleton: parts.skeleton, bindings: parts.bindings, skins: parts.skins, apply, descriptor, restPath,\n }, seat);\n}\n"],"mappings":";;;;;;;AA+CA,IAAM,WAAW,GAAkB,GAAW,MAC3C,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC;;;;;;AAOvE,SAAgB,cACd,UACA,MACA,aAAoC,sBAC1B;CACV,MAAM,MAAM,WAAW,UAAU,IAAI;CACrC,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,OAAO,WAAW,cAAc,IAAI,KAAK;CAC/C,OAAO,EACL,QAAQ,SAAS,OAAO,KAAK,UAAU;EACrC,IAAI,MAAM,UAAU,MAAM,OAAO;EACjC,MAAM,CAAC,GAAG,KAAK,QAAQ,OAAO,IAAI,IAAI,MAAM,KAAK,GAAG,IAAI,IAAI,MAAM,KAAK,CAAC;EACxE,OAAO;GAAE,GAAG;GAAO,MAAM;IAAE,GAAG,MAAM;IAAM;IAAG;IAAG,UAAU,MAAM,KAAK,WAAW;GAAK;EAAE;CACzF,CAAC,EACH;AACF;;;AAIA,SAAgB,gBACd,UACA,MACA,aAAoC,sBAC1B;CACV,MAAM,MAAM,WAAW,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O,MAAM;EAAO;EAAO;EAAY;CACpG,GAAG,IAAI;AACT"}
|
package/dist/barrel/canvas.js
CHANGED
|
@@ -2,16 +2,21 @@ import { DEFAULT_LAYER_RETAIN } from "../core/layers/retain.js";
|
|
|
2
2
|
import { subscribeToSources } from "../core/layers/redrawSource.js";
|
|
3
3
|
import { depsUnchanged, drawLayers, drawOneLayer, isLayerPainted, isLayerVisible, paintedLayers } from "../core/layers/render.js";
|
|
4
4
|
import { dlog, dwarn, isDebugEnabled } from "../debug/flag.js";
|
|
5
|
+
import { inheritedPaintOf, inheritsPaint, withInheritedPaint } from "../core/scene/inheritedPaint.js";
|
|
6
|
+
import { inheritedPaintIn, paintAbove, withInheritedPaints } from "../canvas/inheritedPaints.js";
|
|
5
7
|
import { OVERLAY_ROLE_STROKES } from "../canvas/overlayRoleStrokes.js";
|
|
6
8
|
import { DEFAULT_INK, findNodeShape, findShapeBounds, findShapeInk, findShapeSilhouette, getNodeShapes, registerNodeShape, shapeCoversPoint } from "../canvas/NodeShape.js";
|
|
7
9
|
import { drawnAABBOf, drawnBoundsOf, findShapeDrawnBounds, inkExtentsOf } from "../canvas/drawnBounds.js";
|
|
8
10
|
import { insertPreviewExtent } from "../canvas/insertPreviewExtent.js";
|
|
11
|
+
import { CANVAS_CONTEXT_ATTRIBUTES } from "../canvas/contextAttributes.js";
|
|
9
12
|
import { isOverChildren, overChildren, splitOverChildren } from "../canvas/overChildren.js";
|
|
13
|
+
import { drawnBoundsScene } from "../canvas/derivedPath.js";
|
|
10
14
|
import { sceneToAdapter } from "../canvas/sceneAdapter.js";
|
|
11
15
|
import { defaultDrawOne, defaultPaintBounds } from "../canvas/defaultDrawOne.js";
|
|
12
16
|
import { DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME } from "../debug/defaultTheme.js";
|
|
13
17
|
import { buildDebugOverlayCommands, createDebugOverlayLayer } from "../debug/createDebugOverlayLayer.js";
|
|
14
18
|
import { minSizeOf } from "../core/scene/minSize.js";
|
|
19
|
+
import { DEBUG_FEATURES } from "../debug/features.js";
|
|
15
20
|
import { parseDebugFlags } from "../debug/parseDebugFlags.js";
|
|
16
21
|
import { createDebugSink } from "../debug/createDebugSink.js";
|
|
17
22
|
import { registerContentHandler } from "../features/ingestion/contentHandlers.js";
|
|
@@ -20,12 +25,13 @@ import { useHostAnchor } from "../canvas/useHostAnchor.js";
|
|
|
20
25
|
import { CursorCoordsHud } from "../canvas/CursorCoordsHud.js";
|
|
21
26
|
import { PickHud } from "../canvas/PickHud.js";
|
|
22
27
|
import { PATH_OVERLAY_ROLES, createPathOverlay } from "../canvas/pathOverlay.js";
|
|
28
|
+
import { DevtoolsLabel, useDevtoolsLabel } from "../devtools/label.js";
|
|
29
|
+
import { defaultNodeRouting, groupNodeRouting, inferredNodeRouting } from "../canvas/SceneCanvas/defaultNodeRouting.js";
|
|
23
30
|
import { DEFAULT_HANDLE_SIZE } from "../canvas/SceneCanvas/props.js";
|
|
24
31
|
import { resolveOverlays } from "../interactions/actions/resolveOverlays.js";
|
|
25
32
|
import { flattenPreviews, resolvePreviews } from "../interactions/actions/resolvePreviews.js";
|
|
26
33
|
import { useSceneAdapter } from "../canvas/useSceneAdapter.js";
|
|
27
|
-
import { createNodeRouting } from "../core/scene/NodeRouting.js";
|
|
28
|
-
import { defaultNodeRouting, groupNodeRouting, inferredNodeRouting } from "../canvas/SceneCanvas/defaultNodeRouting.js";
|
|
34
|
+
import { createNodeRouting, routeKind } from "../core/scene/NodeRouting.js";
|
|
29
35
|
import { SceneCanvas } from "../canvas/SceneCanvas.js";
|
|
30
36
|
import { LeanSceneCanvas } from "../canvas/LeanSceneCanvas.js";
|
|
31
37
|
import { createNodeProperties } from "../core/scene/NodeProperties.js";
|
|
@@ -38,4 +44,4 @@ import { modeTriggers } from "../features/modes/modeTriggers.js";
|
|
|
38
44
|
import { createChildrenLayer } from "../core/layers/children.js";
|
|
39
45
|
import { bitmapSrc, getImageBitmap as getImageBitmap$1, imageStatus as imageStatus$1, isVectorImageSrc, releaseImage, retryImage, setImageCacheBudget, subscribeImageReady as subscribeImageReady$1 } from "@weasel-js/renderer";
|
|
40
46
|
|
|
41
|
-
export { CursorCoordsHud, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_HANDLE_SIZE, DEFAULT_INK, DEFAULT_LAYER_RETAIN, LeanSceneCanvas, OVERLAY_ROLE_STROKES, PATH_OVERLAY_ROLES, PickHud, SceneCanvas, WeaselProvider, bitmapSrc, buildDebugOverlayCommands, createChildrenLayer, createDebugOverlayLayer, createDebugSink, createNodeProperties, createNodeRouting, createPathOverlay, defaultDrawOne, defaultNodeProperties, defaultNodeRouting, defaultPaintBounds, depsUnchanged, dlog, drawLayers, drawOneLayer, drawnAABBOf, drawnBoundsOf, dwarn, findNodeShape, findShapeBounds, findShapeDrawnBounds, findShapeInk, findShapeSilhouette, flattenPreviews, getImageBitmap$1 as getImageBitmap, getNodeShapes, groupNodeRouting, hostAnchorCss, hostAnchorRect, imageStatus$1 as imageStatus, inferredNodeProperties, inferredNodeRouting, inkExtentsOf, insertPreviewExtent, isDebugEnabled, isLayerPainted, isLayerVisible, isOverChildren, isVectorImageSrc, kitTextHandler, minSizeOf, modeDecorationLayer, modeTriggers, openFilePicker, overChildren, paintedLayers, parseDebugFlags, registerContentHandler, registerNodeShape, releaseImage, resolveOverlays, resolvePreviews, retryImage, rotationDegreesUnit, sceneToAdapter, setImageCacheBudget, shapeCoversPoint, splitOverChildren, subscribeImageReady$1 as subscribeImageReady, subscribeToSources, useHostAnchor, useSceneAdapter, workspaceTintLayer };
|
|
47
|
+
export { CANVAS_CONTEXT_ATTRIBUTES, CursorCoordsHud, DEBUG_FEATURES, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_HANDLE_SIZE, DEFAULT_INK, DEFAULT_LAYER_RETAIN, DevtoolsLabel, LeanSceneCanvas, OVERLAY_ROLE_STROKES, PATH_OVERLAY_ROLES, PickHud, SceneCanvas, WeaselProvider, bitmapSrc, buildDebugOverlayCommands, createChildrenLayer, createDebugOverlayLayer, createDebugSink, createNodeProperties, createNodeRouting, createPathOverlay, defaultDrawOne, defaultNodeProperties, defaultNodeRouting, defaultPaintBounds, depsUnchanged, dlog, drawLayers, drawOneLayer, drawnAABBOf, drawnBoundsOf, drawnBoundsScene, dwarn, findNodeShape, findShapeBounds, findShapeDrawnBounds, findShapeInk, findShapeSilhouette, flattenPreviews, getImageBitmap$1 as getImageBitmap, getNodeShapes, groupNodeRouting, hostAnchorCss, hostAnchorRect, imageStatus$1 as imageStatus, inferredNodeProperties, inferredNodeRouting, inheritedPaintIn, inheritedPaintOf, inheritsPaint, inkExtentsOf, insertPreviewExtent, isDebugEnabled, isLayerPainted, isLayerVisible, isOverChildren, isVectorImageSrc, kitTextHandler, minSizeOf, modeDecorationLayer, modeTriggers, openFilePicker, overChildren, paintAbove, paintedLayers, parseDebugFlags, registerContentHandler, registerNodeShape, releaseImage, resolveOverlays, resolvePreviews, retryImage, rotationDegreesUnit, routeKind, sceneToAdapter, setImageCacheBudget, shapeCoversPoint, splitOverChildren, subscribeImageReady$1 as subscribeImageReady, subscribeToSources, useDevtoolsLabel, useHostAnchor, useSceneAdapter, withInheritedPaint, withInheritedPaints, workspaceTintLayer };
|
|
@@ -8,14 +8,12 @@ import { createPoseTarget, poseAxes, scenePoseTarget } from "../animation/poseTa
|
|
|
8
8
|
import { aabbCenter, pointInRotatedRect, rectCorners, rotatePoint, rotatedRectCorners } from "../interactions/actions/rotate/geometry.js";
|
|
9
9
|
import { scenePoseFrame } from "../interactions/actions/poseFrame.js";
|
|
10
10
|
import { gesturePlaneReader, gestureViewReader, screenTolerance } from "../interactions/gestures/shared/screenTolerance.js";
|
|
11
|
+
import { MOVE_NODES_REQUIRES, moveNodes, moveNodesOps } from "../interactions/actions/moveNodes.js";
|
|
11
12
|
import { forgetTransform, lastTransform, recordTransform } from "../interactions/actions/transform-again/memory.js";
|
|
12
13
|
import { resolveSpatialReference } from "../interactions/actions/spatialReference.js";
|
|
13
14
|
import { WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, buildWeaselClipboardText, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, parseWeaselClipboardText, sniffWeaselClipboardText } from "../interactions/actions/clipboard/wireFormat.js";
|
|
14
15
|
import { alignDeltaFor, alignTargetBounds, useAlign } from "../interactions/actions/align/align.js";
|
|
15
16
|
import { dataRestPath } from "../animation/rig/skinBinding.js";
|
|
16
|
-
import { bindRig, rigidRigApply } from "../animation/rig/bindRig.js";
|
|
17
|
-
import { useRig } from "../animation/rig/useRig.js";
|
|
18
|
-
import { placeSkeleton, rigFromNode, unplaceSkeleton, useRigNode } from "../animation/rig/rigNode.js";
|
|
19
17
|
import { AUTO_ORIGIN_PROJECTION, RECT_ORIGIN_PROJECTION } from "../interactions/gestures/shared/originProjection.js";
|
|
20
18
|
import { createDepartures } from "../animation/departures.js";
|
|
21
19
|
import { bindPoseTransition, glidesByDefault, usePoseTransition } from "../animation/poseTransition.js";
|
|
@@ -34,7 +32,10 @@ import { animateOnSetPose } from "../animation/wrappers/animateOnSetPose.js";
|
|
|
34
32
|
import { animateLifecycle } from "../animation/wrappers/animateLifecycle.js";
|
|
35
33
|
import { createReflowTransition, useAnimatedReflow } from "../animation/reflow.js";
|
|
36
34
|
import { momentum } from "../animation/behaviors/momentum.js";
|
|
35
|
+
import { bindRig, rigidRigApply } from "../animation/rig/bindRig.js";
|
|
36
|
+
import { useRig } from "../animation/rig/useRig.js";
|
|
37
|
+
import { placeSkeleton, rigFromNode, unplaceSkeleton, useRigNode } from "../animation/rig/rigNode.js";
|
|
37
38
|
import { EASINGS, SPRING_PRESETS, cubicBezierEasing, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, hexToOklchDeg, hslToSrgb, interpolateSrgb, lerpColorArray, lerpOklab, lerpOklch, linear, linearSrgbToOklab, linearToSrgb, oklabToLinearSrgb, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, resolveEasing, srgbFloatToOklab, srgbToHsl, srgbToLinear, srgbU8ToOklab } from "../animation/index.js";
|
|
38
39
|
import { CONTROL_SELECTOR, DRAG_THRESHOLD_PX as DRAG_THRESHOLD_PX$1, isInControlWithin, openPointerSession as openPointerSession$1, pastDragThreshold as pastDragThreshold$1, startCarry } from "@weasel-js/routing";
|
|
39
40
|
|
|
40
|
-
export { AUTO_ORIGIN_PROJECTION, AUTO_POSE_DESCRIPTOR, CONTROL_SELECTOR, DEFAULT_ROTATION_HANDLE_DISTANCE, DRAG_THRESHOLD_PX$1 as DRAG_THRESHOLD_PX, EASINGS, RECT_ORIGIN_PROJECTION, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, SPRING_PRESETS, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, aabbCenter, alignDeltaFor, alignTargetBounds, animateLifecycle, animateOnSetPose, bindPoseTransition, bindRig, buildWeaselClipboardText, cornerResizeHandles, createDepartures, createPoseTarget, createReflowTransition, createWrittenPoseTarget, cubicBezierEasing, dataRestPath, dragPointOf, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, embedWeaselMetadataInSvg, enumerateAnchors, extractWeaselClipboardFromSvg, fixedCornerOf, forgetTransform, gesturePlaneReader, gestureViewReader, glidesByDefault, hexToOklchDeg, hitAnchor, hitCornerHandle, hitRotationHandle, hslToSrgb, interpolateSrgb, isInControlWithin, isPathLike, isRectPose, lastTransform, lerpColorArray, lerpOklab, lerpOklch, linear, linearSrgbToOklab, linearToSrgb, momentum, oklabToLinearSrgb, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, openPointerSession$1 as openPointerSession, parseWeaselClipboardText, pastDragThreshold$1 as pastDragThreshold, placeSkeleton, pointInRotatedRect, poseAxes, poseDescriptorForNode, recordTransform, rectCorners, resolveEasing, resolveSpatialReference, rigFromNode, rigidRigApply, rotatePoint, rotatedRectCorners, rotationHandle, sceneClipTargets, scenePoseFrame, scenePoseTarget, screenTolerance, sniffWeaselClipboardText, springPose, srgbFloatToOklab, srgbToHsl, srgbToLinear, srgbU8ToOklab, staggerSpringPose, startCarry, translatePoseViaDescriptor, tweenPose, unplaceSkeleton, useAlign, useAnimatedReflow, useClipboardOps, useDistribute, useDragGesture, useDragRadial, useDragRect, usePoseTransition, useRig, useRigNode, visualBoundsViaDescriptor, withCoord };
|
|
41
|
+
export { AUTO_ORIGIN_PROJECTION, AUTO_POSE_DESCRIPTOR, CONTROL_SELECTOR, DEFAULT_ROTATION_HANDLE_DISTANCE, DRAG_THRESHOLD_PX$1 as DRAG_THRESHOLD_PX, EASINGS, MOVE_NODES_REQUIRES, RECT_ORIGIN_PROJECTION, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, SPRING_PRESETS, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, aabbCenter, alignDeltaFor, alignTargetBounds, animateLifecycle, animateOnSetPose, bindPoseTransition, bindRig, buildWeaselClipboardText, cornerResizeHandles, createDepartures, createPoseTarget, createReflowTransition, createWrittenPoseTarget, cubicBezierEasing, dataRestPath, dragPointOf, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, embedWeaselMetadataInSvg, enumerateAnchors, extractWeaselClipboardFromSvg, fixedCornerOf, forgetTransform, gesturePlaneReader, gestureViewReader, glidesByDefault, hexToOklchDeg, hitAnchor, hitCornerHandle, hitRotationHandle, hslToSrgb, interpolateSrgb, isInControlWithin, isPathLike, isRectPose, lastTransform, lerpColorArray, lerpOklab, lerpOklch, linear, linearSrgbToOklab, linearToSrgb, momentum, moveNodes, moveNodesOps, oklabToLinearSrgb, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, openPointerSession$1 as openPointerSession, parseWeaselClipboardText, pastDragThreshold$1 as pastDragThreshold, placeSkeleton, pointInRotatedRect, poseAxes, poseDescriptorForNode, recordTransform, rectCorners, resolveEasing, resolveSpatialReference, rigFromNode, rigidRigApply, rotatePoint, rotatedRectCorners, rotationHandle, sceneClipTargets, scenePoseFrame, scenePoseTarget, screenTolerance, sniffWeaselClipboardText, springPose, srgbFloatToOklab, srgbToHsl, srgbToLinear, srgbU8ToOklab, staggerSpringPose, startCarry, translatePoseViaDescriptor, tweenPose, unplaceSkeleton, useAlign, useAnimatedReflow, useClipboardOps, useDistribute, useDragGesture, useDragRadial, useDragRect, usePoseTransition, useRig, useRigNode, visualBoundsViaDescriptor, withCoord };
|
package/dist/barrel/paint.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getAlpha01, mergeAlphaFromPrev, toHex8, withAlpha01 } from "../util/color.js";
|
|
2
|
-
import { DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, GHOST_STROKE, cycleFill, paintAlpha, paintWithAlpha, paintWithColor, solid, strokeOf, strokeWith } from "../util/paint.js";
|
|
3
1
|
import { pathPaintOf } from "../canvas/nodeShapes/nodePaint.js";
|
|
4
2
|
import { getPaintKind, listGradientKinds, listPaintKinds, paintKindOf, paintKindRegistry, patternFamily, registerPaintKind, registerPaintKindLoader, seedTile, switchGradientKind } from "../core/paint/paintKinds.js";
|
|
3
|
+
import { getAlpha01, mergeAlphaFromPrev, toHex8, withAlpha01 } from "../util/color.js";
|
|
4
|
+
import { DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, GHOST_STROKE, cycleFill, paintAlpha, paintWithAlpha, paintWithColor, solid, strokeOf, strokeWith } from "../util/paint.js";
|
|
5
5
|
import { asPaint } from "../core/paint/paintKindEntry.js";
|
|
6
6
|
import { useGradientKinds, usePaintKind, usePaintKinds } from "../core/usePaintKinds.js";
|
|
7
7
|
import { commandFill as commandFill$1, commandPaint as commandPaint$1, commandStroke as commandStroke$1, createTilePattern, fillInPoseFrame, fillToBoundsFrame, isPaintKindKnown as isPaintKindKnown$1, resolveFillPattern, resolvePatternSpec, warmPaintKinds as warmPaintKinds$1 } from "@weasel-js/renderer";
|
|
8
|
-
import { STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect as alignedStrokeRect$1, composePatternTransform, contrastLineColor, dashForStrokeStyle as dashForStrokeStyle$1, decomposePatternTransform, gradientForBounds as gradientForBounds$1, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint as isGradientPaint$1, isPatternPaint, isSolidPaint, isTileKind, isTilePaint as isTilePaint$1, lerpFill as lerpFill$1, lerpPaint, lerpStroke as lerpStroke$1, normalizeHex, parseColor, parseColorToRgba255, parseHexBytes, patternPlacementOf, resolveColor, resolveScreenLength as resolveScreenLength$1, rgbaToHex, sampleGradientStops, scaleVertexWidth as scaleVertexWidth$1, strokeDashStyleOf as strokeDashStyleOf$1, tileSpecOf, vertexHalfWidths as vertexHalfWidths$1, vertexWidthFromSides as vertexWidthFromSides$1, widestHalfWidth, withGradientKind as withGradientKind$1 } from "@weasel-js/paint";
|
|
8
|
+
import { INHERIT as INHERIT$1, STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect as alignedStrokeRect$1, composePatternTransform, contrastLineColor, contrastRatio, dashForStrokeStyle as dashForStrokeStyle$1, decomposePatternTransform, gradientForBounds as gradientForBounds$1, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint as isGradientPaint$1, isPatternPaint, isSolidPaint, isTileKind, isTilePaint as isTilePaint$1, lerpFill as lerpFill$1, lerpPaint, lerpStroke as lerpStroke$1, normalizeHex, parseColor, parseColorToRgba255, parseHexBytes, patternPlacementOf, resolveColor, resolveFill as resolveFill$1, resolveScreenLength as resolveScreenLength$1, resolveStroke as resolveStroke$1, rgbaToHex, sampleGradientStops, scaleVertexWidth as scaleVertexWidth$1, strokeDashStyleOf as strokeDashStyleOf$1, tileSpecOf, vertexHalfWidths as vertexHalfWidths$1, vertexWidthFromSides as vertexWidthFromSides$1, wcagLevels, widestHalfWidth, withGradientKind as withGradientKind$1 } from "@weasel-js/paint";
|
|
9
9
|
import { BUILTIN_MARKERS, getMarker, listMarkers as listMarkers$1, markerInset, markerKeyOf, markerRegistry, markerSites, registerMarker, resolveMarkerSize, resolveStrokeWidth as resolveStrokeWidth$1, strokeInsets as strokeInsets$1 } from "@weasel-js/stroke";
|
|
10
10
|
import { trimPolyline } from "@weasel-js/geom/tessellate";
|
|
11
11
|
|
|
12
|
-
export { BUILTIN_MARKERS, DEFAULT_FILL_COLOR, DEFAULT_PALETTE,
|
|
12
|
+
export { BUILTIN_MARKERS, DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, GHOST_STROKE, INHERIT$1 as INHERIT, STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect$1 as alignedStrokeRect, asPaint, commandFill$1 as commandFill, commandPaint$1 as commandPaint, commandStroke$1 as commandStroke, composePatternTransform, contrastLineColor, contrastRatio, createTilePattern, cycleFill, dashForStrokeStyle$1 as dashForStrokeStyle, decomposePatternTransform, fillInPoseFrame, fillToBoundsFrame, getAlpha01, getMarker, getPaintKind, gradientForBounds$1 as gradientForBounds, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint$1 as isGradientPaint, isPaintKindKnown$1 as isPaintKindKnown, isPatternPaint, isSolidPaint, isTileKind, isTilePaint$1 as isTilePaint, lerpFill$1 as lerpFill, lerpPaint, lerpStroke$1 as lerpStroke, listGradientKinds, listMarkers$1 as listMarkers, listPaintKinds, markerInset, markerKeyOf, markerRegistry, markerSites, mergeAlphaFromPrev, normalizeHex, paintAlpha, paintKindOf, paintKindRegistry, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseHexBytes, pathPaintOf, patternFamily, patternPlacementOf, registerMarker, registerPaintKind, registerPaintKindLoader, resolveColor, resolveFill$1 as resolveFill, resolveFillPattern, resolveMarkerSize, resolvePatternSpec, resolveScreenLength$1 as resolveScreenLength, resolveStroke$1 as resolveStroke, resolveStrokeWidth$1 as resolveStrokeWidth, rgbaToHex, sampleGradientStops, scaleVertexWidth$1 as scaleVertexWidth, seedTile, solid, strokeDashStyleOf$1 as strokeDashStyleOf, strokeInsets$1 as strokeInsets, strokeOf, strokeWith, switchGradientKind, tileSpecOf, toHex8, trimPolyline, useGradientKinds, usePaintKind, usePaintKinds, vertexHalfWidths$1 as vertexHalfWidths, vertexWidthFromSides$1 as vertexWidthFromSides, warmPaintKinds$1 as warmPaintKinds, wcagLevels, widestHalfWidth, withAlpha01, withGradientKind$1 as withGradientKind };
|
package/dist/barrel/paths.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { noteFontRead } from "../core/scene/fontReads.js";
|
|
2
|
+
import { derivedPartsOf, pathFromParts, resolvePartPaint } from "../core/scene/derivedParts.js";
|
|
2
3
|
import { pathPoseDescriptor } from "../core/geometry/pathPoseDescriptor.js";
|
|
3
4
|
import { commitOps } from "../interactions/actions/defaultCommitAdapter.js";
|
|
4
5
|
import { HANDLE_LOCK_ROLES, locksInForce } from "../interactions/actions/edit-anchors/handleDrag.js";
|
|
5
6
|
import { classifyPathStorage, hasEditablePath, pathEditPathOf, resolveEditablePathOf, storeEditablePath } from "../features/paths/editablePath.js";
|
|
6
|
-
import { pathEditPreview } from "../interactions/actions/edit-anchors/preview.js";
|
|
7
|
+
import { finishPathEditFrame, pathEditPreview } from "../interactions/actions/edit-anchors/preview.js";
|
|
7
8
|
import { editedPathSymmetries } from "../interactions/actions/edit-anchors/symmetry.js";
|
|
8
9
|
import { deleteSelectedMark, editTargetOf, markUnder } from "../interactions/actions/defaults/pathEditMarks.js";
|
|
9
10
|
import { anchorEditWouldChange, commitAnchorEdit, depOf, requiresAnchorSelection } from "../interactions/actions/defaults/anchorEditing.js";
|
|
11
|
+
import { textAlongParts } from "../core/scene/pathEffects/textAlong.js";
|
|
12
|
+
import { PATH_EFFECT, createPathEffectDerivations, pathEffectNode, pathEffectOf, pathEffectParts, registeredPathEffects } from "../core/scene/pathEffects/derive.js";
|
|
13
|
+
import { effectSourceFor, hiddenSourcesTakenWith } from "../features/pathEffects/effectSources.js";
|
|
10
14
|
import { makeHandleCommand } from "../interactions/actions/defaults/anchorHandles.js";
|
|
11
15
|
import { joinSelectedAnchors } from "../interactions/actions/defaults/anchorJoin.js";
|
|
12
16
|
import { segmentUnder } from "../interactions/actions/defaults/segmentUnder.js";
|
|
@@ -23,12 +27,12 @@ import { PATH_SNAP_LABELS, pathSnapGlyph } from "../features/paths/pathSnap/glyp
|
|
|
23
27
|
import { nodeOutline } from "../features/paths/strokeOutline.js";
|
|
24
28
|
import { DEFAULT_OVERLAY_STYLE } from "../features/paths/anchorMarkers.js";
|
|
25
29
|
import { createPathEditingOverlayLayer } from "../features/paths/pathEditingOverlayLayer.js";
|
|
30
|
+
import { readEffectSource } from "../features/pathEffects/readSource.js";
|
|
31
|
+
import { useEffectSourcesLayer } from "../features/pathEffects/useEffectSourcesLayer.js";
|
|
26
32
|
import { createPathLayer } from "../features/paths/pathLayer.js";
|
|
27
33
|
import { pathOriginProjection } from "../features/paths/originProjection.js";
|
|
28
|
-
import { CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, DEFAULT_FLATTEN_TOLERANCE, PATH_C as PATH_C$1, PATH_CMD_LENGTHS, PATH_L as PATH_L$1, PATH_M as PATH_M$1, PATH_Q as PATH_Q$1, PATH_SNAP_KINDS as PATH_SNAP_KINDS$1, PATH_Z as PATH_Z$1, PathBuilder, asPolygonPath as asPolygonPath$1, averageAnchorsAt as averageAnchorsAt$1, bendAlongPath as bendAlongPath$1, blendPaths, boundsOfPath as boundsOfPath$1, circlePath as circlePath$1, composePath, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors as countPathAnchors$1, createPathSnapIndex as createPathSnapIndex$1, decomposePath, ellipsePath as ellipsePath$1, extendToMeet, findPathSnap as findPathSnap$1, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasOpenSubpath as hasOpenSubpath$1, intersectSegments, isCornerShape, joinAnchorsAt as joinAnchorsAt$1, lengthenOpenEnd, linePath as linePath$1, measurePath as measurePath$1, nextCornerShape, offsetPath, openEndRay, openPathEnds, pathCommandCoordCount, pathContainsPoint as pathContainsPoint$1, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathDivide, pathExclude, pathFromD as pathFromD$1, pathInPoseFrame as pathInPoseFrame$1, pathInWorld as pathInWorld$1, pathIntersect, pathIntersectsPolygon, pathIntersectsRect as pathIntersectsRect$1, pathSegments, pathSignedArea, pathSubtract, pathThroughPoseFrame as pathThroughPoseFrame$1, pathToAnchors as pathToAnchors$1, pathUnion, pointAlongPath, pointInPath as pointInPath$1, polygonFromPoints as polygonFromPoints$1, polylineFromPoints as polylineFromPoints$1, poseFrameInverseOf as poseFrameInverseOf$1, poseFrameOf as poseFrameOf$1, poseLinearOf as poseLinearOf$1, poseRotationOf, prepareBlend as prepareBlend$1, rectMarkerPath as rectMarkerPath$1, rectPath as rectPath$1, regularPolygonPath as regularPolygonPath$1, remapPerAnchor, repeatAlongPath as repeatAlongPath$1, resolveCorners as resolveCorners$1, resolveCornersWithSources, reversePath, rotatePathAround as rotatePathAround$1, roundRectPath, scalePathToBounds, simplifyAnchorsAt, simplifyPath as simplifyPath$1, smudgePath, snipPathByPolyline, snipPathsAtCrossings, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath as squarePath$1, starPath as starPath$1, stationsAlongPath, strokeToPath, transformPath as transformPath$1, translatePath as translatePath$1, trianglesToPath, trimPathAt, unionBoundsPath, withCorner, withoutCorners, worldEditToStorage as worldEditToStorage$1 } from "../features/paths/index.js";
|
|
34
|
+
import { CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, DEFAULT_FLATTEN_TOLERANCE, PATH_C as PATH_C$1, PATH_CMD_LENGTHS, PATH_L as PATH_L$1, PATH_M as PATH_M$1, PATH_Q as PATH_Q$1, PATH_SNAP_KINDS as PATH_SNAP_KINDS$1, PATH_Z as PATH_Z$1, PathBuilder, asPolygonPath as asPolygonPath$1, averageAnchorsAt as averageAnchorsAt$1, bendAlongPath as bendAlongPath$1, blendPaths, boundsOfPath as boundsOfPath$1, circlePath as circlePath$1, composePath, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors as countPathAnchors$1, createPathSnapIndex as createPathSnapIndex$1, decomposePath, ellipsePath as ellipsePath$1, extendToMeet, findPathSnap as findPathSnap$1, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasOpenSubpath as hasOpenSubpath$1, intersectSegments, isCornerShape, joinAnchorsAt as joinAnchorsAt$1, lengthenOpenEnd, linePath as linePath$1, measurePath as measurePath$1, nextCornerShape, offsetPath, openEndRay, openPathEnds, pathCommandCoordCount, pathContainsPoint as pathContainsPoint$1, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathDivide, pathExclude, pathFromD as pathFromD$1, pathInPoseFrame as pathInPoseFrame$1, pathInWorld as pathInWorld$1, pathIntersect, pathIntersectsPolygon, pathIntersectsRect as pathIntersectsRect$1, pathSegments, pathSignedArea, pathSubtract, pathThroughPoseFrame as pathThroughPoseFrame$1, pathToAnchors as pathToAnchors$1, pathToD, pathUnion, pointAlongPath, pointInPath as pointInPath$1, polygonFromPoints as polygonFromPoints$1, polylineFromPoints as polylineFromPoints$1, poseFrameInverseOf as poseFrameInverseOf$1, poseFrameOf as poseFrameOf$1, poseLinearOf as poseLinearOf$1, poseRotationOf, prepareBlend as prepareBlend$1, rectMarkerPath as rectMarkerPath$1, rectPath as rectPath$1, regularPolygonPath as regularPolygonPath$1, remapPerAnchor, repeatAlongPath as repeatAlongPath$1, resolveCorners as resolveCorners$1, resolveCornersWithSources, reversePath, rotatePathAround as rotatePathAround$1, roundRectPath, scalePathToBounds, simplifyAnchorsAt, simplifyPath as simplifyPath$1, smudgePath, snipPathByPolyline, snipPathsAtCrossings, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath as squarePath$1, starPath as starPath$1, stationsAlongPath, strokeToPath, transformPath as transformPath$1, translatePath as translatePath$1, trianglesToPath, trimPathAt, unionBoundsPath, withCorner, withoutCorners, worldEditToStorage as worldEditToStorage$1 } from "../features/paths/index.js";
|
|
29
35
|
import { useAnchorFields } from "../features/paths/useAnchorFields.js";
|
|
30
|
-
import { PATH_EFFECT, createPathEffectDerivations, pathEffectNode, pathEffectOf, pathEffectParts, registeredPathEffects } from "../core/scene/pathEffects/derive.js";
|
|
31
|
-
import { readEffectSource } from "../features/pathEffects/readSource.js";
|
|
32
36
|
import { PATH_EFFECT_DERIVATIONS, withPathEffectsRegistry } from "../features/pathEffects/index.js";
|
|
33
37
|
import { useBooleans } from "../interactions/actions/booleans/useBooleans.js";
|
|
34
38
|
import { useBooleansAdapter } from "../interactions/actions/booleans/useBooleansAdapter.js";
|
|
@@ -36,4 +40,4 @@ import { commitBooleanPieces, resolveBooleanOperands } from "../interactions/act
|
|
|
36
40
|
import { CONSTRAINT_TOLERANCE, constrainPathEdit, constraintAnchors, pathAnchorPoints, solveConstraints, solvePathConstraints, unsatisfiedConstraints } from "@weasel-js/geom";
|
|
37
41
|
import { CURVE_REPS, bezierCubic, bezierQuadratic, nurbs, spiro } from "@weasel-js/geom/curves";
|
|
38
42
|
|
|
39
|
-
export { CONSTRAINT_TOLERANCE, CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, CURVE_REPS, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_OVERLAY_STYLE, DEFAULT_SIMPLIFY_TOLERANCE, GEOMETRY_BOUND_DATA, HANDLE_LOCK_ROLES, PATHFINDER_STROKES, PATH_C$1 as PATH_C, PATH_CMD_LENGTHS, PATH_EFFECT, PATH_EFFECT_DERIVATIONS, PATH_L$1 as PATH_L, PATH_M$1 as PATH_M, PATH_Q$1 as PATH_Q, PATH_SNAP_KINDS$1 as PATH_SNAP_KINDS, PATH_SNAP_LABELS, PATH_Z$1 as PATH_Z, PathBuilder, SHAPE_COUNT_RANGE, STAR_RATIO_RANGE, anchorEditWouldChange, applyBooleanOp, asPolygonPath$1 as asPolygonPath, averageAnchorsAt$1 as averageAnchorsAt, bendAlongPath$1 as bendAlongPath, bezierCubic, bezierQuadratic, blendPaths, boundsOfPath$1 as boundsOfPath, circlePath$1 as circlePath, clampShapeGenerator, classifyPathStorage, commitAnchorEdit, commitBooleanPieces, commitOps, composePath, constrainPathEdit, constraintAnchors, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors$1 as countPathAnchors, createPathEditingOverlayLayer, createPathEffectDerivations, createPathLayer, createPathSnapIndex$1 as createPathSnapIndex, createPenPreviewLayer, decomposePath, deleteNode, deleteSelectedMark, depOf, derivedPartsOf, editTargetOf, editedPathSymmetries, ellipsePath$1 as ellipsePath, extendToMeet, findPathSnap$1 as findPathSnap, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasEditablePath, hasOpenSubpath$1 as hasOpenSubpath, insertAt, intersectSegments, isCornerShape, isShapeGenerator, joinAnchorsAt$1 as joinAnchorsAt, joinPathsCommand, joinSelectedAnchors, lengthenOpenEnd, linePath$1 as linePath, livePathEdit, locksInForce, makeHandleCommand, markUnder, measurePath$1 as measurePath, nextCornerShape, nodeOutline, nurbs, offsetPath, openEndRay, openPathEnds, pathAnchorPoints, pathCommandCoordCount, pathContainsPoint$1 as pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCopy, pathCrossings, pathDistanceToPoint, pathDivide, pathEditPathOf, pathEditPreview, pathEffectNode, pathEffectOf, pathEffectParts, pathExclude, pathFromD$1 as pathFromD, pathFromParts, pathInPoseFrame$1 as pathInPoseFrame, pathInWorld$1 as pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect$1 as pathIntersectsRect, pathNodesOf, pathOriginProjection, pathPoseDescriptor, pathSegments, pathSignedArea, pathSnapGlyph, pathSubtract, pathThroughPoseFrame$1 as pathThroughPoseFrame, pathToAnchors$1 as pathToAnchors, pathUnion, planJoin, pointAlongPath, pointInPath$1 as pointInPath, polygonFromPoints$1 as polygonFromPoints, polylineFromPoints$1 as polylineFromPoints, poseFrameInverseOf$1 as poseFrameInverseOf, poseFrameOf$1 as poseFrameOf, poseLinearOf$1 as poseLinearOf, poseRotationOf, prepareBlend$1 as prepareBlend, previewBooleanOp, readEffectSource, rectMarkerPath$1 as rectMarkerPath, rectPath$1 as rectPath, regenerateShape, registeredPathEffects, regularPolygonPath$1 as regularPolygonPath, remapPerAnchor, repeatAlongPath$1 as repeatAlongPath, requiresAnchorSelection, reshapeOps, reshapeTo, resolveBooleanOperands, resolveCorners$1 as resolveCorners, resolveCornersWithSources, resolveEditablePathOf, reversePath, rotatePathAround$1 as rotatePathAround, roundRectPath, scalePathToBounds, segmentUnder, selectedPathNodes, settleShapeGenerator, shapeGeneratorOf, shapeGeneratorPath, simplifyAnchorsAt, simplifyPath$1 as simplifyPath, slotOf, smudgePath, snipPathByPolyline, snipPathsAtCrossings, solveConstraints, solvePathConstraints, spiro, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath$1 as squarePath, starPath$1 as starPath, stationsAlongPath, storeEditablePath, strokeToPath, transformPath$1 as transformPath, translatePath$1 as translatePath, trianglesToPath, trimPathAt, unionBoundsPath, unsatisfiedConstraints, useAnchorFields, useBooleans, useBooleansAdapter, withCorner, withPath, withPathEffectsRegistry, withoutCorners, withoutGeometryBoundData, withoutShapeGenerator, worldEditToStorage$1 as worldEditToStorage };
|
|
43
|
+
export { CONSTRAINT_TOLERANCE, CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, CURVE_REPS, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_OVERLAY_STYLE, DEFAULT_SIMPLIFY_TOLERANCE, GEOMETRY_BOUND_DATA, HANDLE_LOCK_ROLES, PATHFINDER_STROKES, PATH_C$1 as PATH_C, PATH_CMD_LENGTHS, PATH_EFFECT, PATH_EFFECT_DERIVATIONS, PATH_L$1 as PATH_L, PATH_M$1 as PATH_M, PATH_Q$1 as PATH_Q, PATH_SNAP_KINDS$1 as PATH_SNAP_KINDS, PATH_SNAP_LABELS, PATH_Z$1 as PATH_Z, PathBuilder, SHAPE_COUNT_RANGE, STAR_RATIO_RANGE, anchorEditWouldChange, applyBooleanOp, asPolygonPath$1 as asPolygonPath, averageAnchorsAt$1 as averageAnchorsAt, bendAlongPath$1 as bendAlongPath, bezierCubic, bezierQuadratic, blendPaths, boundsOfPath$1 as boundsOfPath, circlePath$1 as circlePath, clampShapeGenerator, classifyPathStorage, commitAnchorEdit, commitBooleanPieces, commitOps, composePath, constrainPathEdit, constraintAnchors, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors$1 as countPathAnchors, createPathEditingOverlayLayer, createPathEffectDerivations, createPathLayer, createPathSnapIndex$1 as createPathSnapIndex, createPenPreviewLayer, decomposePath, deleteNode, deleteSelectedMark, depOf, derivedPartsOf, editTargetOf, editedPathSymmetries, effectSourceFor, ellipsePath$1 as ellipsePath, extendToMeet, findPathSnap$1 as findPathSnap, finishPathEditFrame, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasEditablePath, hasOpenSubpath$1 as hasOpenSubpath, hiddenSourcesTakenWith, insertAt, intersectSegments, isCornerShape, isShapeGenerator, joinAnchorsAt$1 as joinAnchorsAt, joinPathsCommand, joinSelectedAnchors, lengthenOpenEnd, linePath$1 as linePath, livePathEdit, locksInForce, makeHandleCommand, markUnder, measurePath$1 as measurePath, nextCornerShape, nodeOutline, noteFontRead, nurbs, offsetPath, openEndRay, openPathEnds, pathAnchorPoints, pathCommandCoordCount, pathContainsPoint$1 as pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCopy, pathCrossings, pathDistanceToPoint, pathDivide, pathEditPathOf, pathEditPreview, pathEffectNode, pathEffectOf, pathEffectParts, pathExclude, pathFromD$1 as pathFromD, pathFromParts, pathInPoseFrame$1 as pathInPoseFrame, pathInWorld$1 as pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect$1 as pathIntersectsRect, pathNodesOf, pathOriginProjection, pathPoseDescriptor, pathSegments, pathSignedArea, pathSnapGlyph, pathSubtract, pathThroughPoseFrame$1 as pathThroughPoseFrame, pathToAnchors$1 as pathToAnchors, pathToD, pathUnion, planJoin, pointAlongPath, pointInPath$1 as pointInPath, polygonFromPoints$1 as polygonFromPoints, polylineFromPoints$1 as polylineFromPoints, poseFrameInverseOf$1 as poseFrameInverseOf, poseFrameOf$1 as poseFrameOf, poseLinearOf$1 as poseLinearOf, poseRotationOf, prepareBlend$1 as prepareBlend, previewBooleanOp, readEffectSource, rectMarkerPath$1 as rectMarkerPath, rectPath$1 as rectPath, regenerateShape, registeredPathEffects, regularPolygonPath$1 as regularPolygonPath, remapPerAnchor, repeatAlongPath$1 as repeatAlongPath, requiresAnchorSelection, reshapeOps, reshapeTo, resolveBooleanOperands, resolveCorners$1 as resolveCorners, resolveCornersWithSources, resolveEditablePathOf, resolvePartPaint, reversePath, rotatePathAround$1 as rotatePathAround, roundRectPath, scalePathToBounds, segmentUnder, selectedPathNodes, settleShapeGenerator, shapeGeneratorOf, shapeGeneratorPath, simplifyAnchorsAt, simplifyPath$1 as simplifyPath, slotOf, smudgePath, snipPathByPolyline, snipPathsAtCrossings, solveConstraints, solvePathConstraints, spiro, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath$1 as squarePath, starPath$1 as starPath, stationsAlongPath, storeEditablePath, strokeToPath, textAlongParts, transformPath$1 as transformPath, translatePath$1 as translatePath, trianglesToPath, trimPathAt, unionBoundsPath, unsatisfiedConstraints, useAnchorFields, useBooleans, useBooleansAdapter, useEffectSourcesLayer, withCorner, withPath, withPathEffectsRegistry, withoutCorners, withoutGeometryBoundData, withoutShapeGenerator, worldEditToStorage$1 as worldEditToStorage };
|
package/dist/barrel/renderer.js
CHANGED
|
@@ -10,15 +10,17 @@ import { movePreset, outlinePreset, resizePreset, rotatePreset } from "../canvas
|
|
|
10
10
|
import { viewPreset } from "../canvas/SceneCanvas/presets/view.js";
|
|
11
11
|
import { COMPOSITE_FEATURES, FEATURE_ACTION_IDS, TOOL_DRIVEN_ACTION_IDS } from "../canvas/SceneCanvas/namedPresets.js";
|
|
12
12
|
import { PAINTED_CURSOR_LAYER_ID, createPaintedCursorLayer } from "../canvas/paintedCursorLayer.js";
|
|
13
|
+
import { useTransformFollower } from "../canvas/deps/transformFollowers.js";
|
|
13
14
|
import { paletteInsertPaint } from "../canvas/deps/insert.js";
|
|
14
15
|
import { KIT_VERSIONS, checkRequirements, satisfiesRange } from "../canvas/kitRequirements.js";
|
|
15
16
|
import { SCENE_CANVAS_FEATURES } from "../canvas/SceneCanvas/features.js";
|
|
16
|
-
import { BUILTIN_TOOL_IDS } from "../canvas/SceneCanvas/
|
|
17
|
+
import { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, DRAW_TOOLS, PAGE_TOOLS, SELECT_TOOLS, SHAPE_TOOLS, TYPE_TOOLS, VIEW_TOOLS } from "../canvas/SceneCanvas/builtinToolSets.js";
|
|
17
18
|
import { mergeContributions as mergeContributions$1 } from "../canvas/surfaceContribution.js";
|
|
18
19
|
import { SPRITE_STRIDE, blur, cullDrawCommands as cullDrawCommands$1, frameRect, mat3 as mat3$1, registerEffect, viewToMat3 as viewToMat3$1, vignette } from "@weasel-js/renderer";
|
|
19
20
|
import { createReflectable as createReflectable$1 } from "@weasel-js/registry";
|
|
20
|
-
import { assembleEntries, liveScope, modeShortcutSpec, modeShortcuts, scopeBindings } from "@weasel-js/routing";
|
|
21
|
+
import { KEYMAP_HOLD, assembleEntries, captureGesture, captureKey, createKeymapStack, describeKeymap, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, liveScope, modeShortcutSpec, modeShortcuts, scopeBindings } from "@weasel-js/routing";
|
|
21
22
|
import { canQueryLocalFonts, cssFamilyName, cssFontFamily, cssFontFamilyLoading, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, hasFontOutlines, isCanvasFont, listFontOutlines, loadFontOutlines, outlineStatus, refreshCanvasFont, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady as subscribeGlyphReady$1, unregisterCanvasFont, unregisterFontOutlines, warmFonts as warmFonts$1 } from "@weasel-js/font";
|
|
23
|
+
import { bindingSpec, held, key, keySpecRoute, unbound } from "@weasel-js/gestures";
|
|
22
24
|
import { CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, bakeCursor, createCursorSink as createCursorSink$1, createPaintedCursorState as createPaintedCursorState$1, cursorFor as cursorFor$1, resolveCursor, resolveCursorTier as resolveCursorTier$1 } from "@weasel-js/cursor";
|
|
23
25
|
|
|
24
|
-
export { BUILTIN_TOOL_IDS, COMPOSITE_FEATURES, CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, FEATURE_ACTION_IDS, KIT_SHAPE_KINDS, KIT_VERSIONS, PAINTED_CURSOR_LAYER_ID, SCENE_CANVAS_FEATURES, SHAPE_KINDS, SPRITE_STRIDE, TOOL_DRIVEN_ACTION_IDS, arrangePreset, assembleEntries, bakeCursor, blur, canQueryLocalFonts, checkRequirements, createCursorSink$1 as createCursorSink, createPaintedCursorLayer, createPaintedCursorState$1 as createPaintedCursorState, createReflectable$1 as createReflectable, cssFamilyName, cssFontFamily, cssFontFamilyLoading, cullDrawCommands$1 as cullDrawCommands, cursorFor$1 as cursorFor, editPreset, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, frameRect, hasFontOutlines, ingestPreset, isCanvasFont, listFontOutlines, liveScope, loadFontOutlines, mat3$1 as mat3, mergeContributions$1 as mergeContributions, modeShortcutSpec, modeShortcuts, movePreset, outlinePreset, outlineStatus, paletteInsertPaint, pathsPreset, refreshCanvasFont, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, resizePreset, resolveCursor, resolveCursorTier$1 as resolveCursorTier, rotateAroundAABBCenter, rotatePreset, satisfiesRange, scopeBindings, selectPreset, subscribeGlyphReady$1 as subscribeGlyphReady, textBoxOf, unregisterCanvasFont, unregisterFontOutlines, viewPreset, viewToMat3$1 as viewToMat3, vignette, warmFonts$1 as warmFonts };
|
|
26
|
+
export { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, COMPOSITE_FEATURES, CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, DRAW_TOOLS, FEATURE_ACTION_IDS, KEYMAP_HOLD, KIT_SHAPE_KINDS, KIT_VERSIONS, PAGE_TOOLS, PAINTED_CURSOR_LAYER_ID, SCENE_CANVAS_FEATURES, SELECT_TOOLS, SHAPE_KINDS, SHAPE_TOOLS, SPRITE_STRIDE, TOOL_DRIVEN_ACTION_IDS, TYPE_TOOLS, VIEW_TOOLS, arrangePreset, assembleEntries, bakeCursor, bindingSpec, blur, canQueryLocalFonts, captureGesture, captureKey, checkRequirements, createCursorSink$1 as createCursorSink, createKeymapStack, createPaintedCursorLayer, createPaintedCursorState$1 as createPaintedCursorState, createReflectable$1 as createReflectable, cssFamilyName, cssFontFamily, cssFontFamilyLoading, cullDrawCommands$1 as cullDrawCommands, cursorFor$1 as cursorFor, describeKeymap, editPreset, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, frameRect, hasFontOutlines, held, ingestPreset, isCanvasFont, key, keySpecRoute, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, listFontOutlines, liveScope, loadFontOutlines, mat3$1 as mat3, mergeContributions$1 as mergeContributions, modeShortcutSpec, modeShortcuts, movePreset, outlinePreset, outlineStatus, paletteInsertPaint, pathsPreset, refreshCanvasFont, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, resizePreset, resolveCursor, resolveCursorTier$1 as resolveCursorTier, rotateAroundAABBCenter, rotatePreset, satisfiesRange, scopeBindings, selectPreset, subscribeGlyphReady$1 as subscribeGlyphReady, textBoxOf, unbound, unregisterCanvasFont, unregisterFontOutlines, useTransformFollower, viewPreset, viewToMat3$1 as viewToMat3, vignette, warmFonts$1 as warmFonts };
|
package/dist/barrel/routing.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CORNER_ANCHORS, EDGE_HANDLE_MIN_RADII, RESIZE_HANDLE_ANCHORS, cornerPoint, handlePoint, isCornerHandle, resizeHandlesFor } from "../interactions/actions/resize/cornerHandles.js";
|
|
2
2
|
import { contextMenuAction, openContextMenu } from "../interactions/actions/defaults/contextMenu.js";
|
|
3
3
|
import { PATH_GESTURE_TAGS, pathOperationTags } from "../interactions/actions/pathGestureTags.js";
|
|
4
|
-
import { editingLayer, inPlane, insertLayer, selectionLayer } from "../interactions/actions/planeInput.js";
|
|
5
4
|
import { defaultCommitAdapter } from "../interactions/actions/defaultCommitAdapter.js";
|
|
5
|
+
import { editingLayer, inPlane, insertLayer, selectionLayer } from "../interactions/actions/planeInput.js";
|
|
6
6
|
import { moveAction } from "../interactions/actions/move/action.js";
|
|
7
7
|
import { flipAction } from "../interactions/actions/flip/action.js";
|
|
8
|
-
import { resizeAction } from "../interactions/actions/resize/action.js";
|
|
8
|
+
import { createResizeAction, resizeAction } from "../interactions/actions/resize/action.js";
|
|
9
9
|
import { rotateAction } from "../interactions/actions/rotate/action.js";
|
|
10
10
|
import { areaSelectAction } from "../interactions/actions/defaults/areaSelect.js";
|
|
11
11
|
import { insertAction } from "../interactions/actions/insert/action.js";
|
|
@@ -22,6 +22,7 @@ import { deleteAnchorsAction, nudgeAnchorsDownAction, nudgeAnchorsLeftAction, nu
|
|
|
22
22
|
import { selectFromLasso } from "../interactions/actions/lasso-select/behaviors/selectFromLasso.js";
|
|
23
23
|
import { lassoSelectAction } from "../interactions/actions/lasso-select/action.js";
|
|
24
24
|
import { sliceAction } from "../interactions/actions/defaults/slice.js";
|
|
25
|
+
import { commitDeleteToScene, createDeleteAction, deleteAction, hiddenSourceDeleteOps } from "../interactions/actions/defaults/delete.js";
|
|
25
26
|
import { makePinchZoomAction, pinchZoomAction } from "../interactions/actions/defaults/pinchZoom.js";
|
|
26
27
|
import { clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction } from "../interactions/actions/clipboard/action.js";
|
|
27
28
|
import { enterTextEditAction } from "../interactions/actions/defaults/enterTextEdit.js";
|
|
@@ -41,13 +42,6 @@ import { DRAG_PAN_ID, dragPanContribution } from "../tools/builtin/hand/dragPanC
|
|
|
41
42
|
import { useTextTool } from "../tools/builtin/text/useTextTool.js";
|
|
42
43
|
import { STICKY_DEFAULTS, stickyData, stickyNodeFactory } from "../tools/builtin/sticky/stickyNode.js";
|
|
43
44
|
import { useStickyTool } from "../tools/builtin/sticky/useStickyTool.js";
|
|
44
|
-
import { placedRig } from "../tools/builtin/bone/placedRig.js";
|
|
45
|
-
import { createBoneOverlay } from "../tools/builtin/bone/boneOverlay.js";
|
|
46
|
-
import { createRigEditState } from "../tools/builtin/bone/rigEditState.js";
|
|
47
|
-
import { useBoneTool } from "../tools/builtin/bone/useBoneTool.js";
|
|
48
|
-
import { weighedPaths } from "../tools/builtin/weight/weightActions.js";
|
|
49
|
-
import { createWeightOverlay } from "../tools/builtin/weight/weightOverlay.js";
|
|
50
|
-
import { useWeightTool } from "../tools/builtin/weight/useWeightTool.js";
|
|
51
45
|
import { createPointerFollower } from "../tools/builtin/shared/pointerFollower.js";
|
|
52
46
|
import { usePenTool } from "../tools/builtin/pen/usePenTool.js";
|
|
53
47
|
import { useRectTool } from "../tools/builtin/rect/useRectTool.js";
|
|
@@ -61,9 +55,10 @@ import { useStarTool } from "../tools/builtin/star/useStarTool.js";
|
|
|
61
55
|
import { usePencilTool } from "../tools/builtin/pencil/usePencilTool.js";
|
|
62
56
|
import { useSliceTool } from "../tools/builtin/slice/useSliceTool.js";
|
|
63
57
|
import { useMeasureTool } from "../tools/builtin/measure/useMeasureTool.js";
|
|
58
|
+
import { isToolSet, toolIdsOf as toolIdsOf$1, toolSet as toolSet$1, toolSetHas, withoutTools } from "../tools/index.js";
|
|
64
59
|
import { useLatest as useLatest$1 } from "@weasel-js/react";
|
|
65
|
-
import { ActionDisabledReason as ActionDisabledReason$1, actionBindings, actionCursor, actionItemTitle, actionItems, actionShortcuts, actionsTagged, buildDepsFromRequires, createDepRegistry, createDispatcher as createDispatcher$1, deleteScratch, evaluateActive, evaluateEnabled, getScratch as getScratch$1, heldKeySpec as heldKeySpec$1, keySpecShortcut, keysHeld, matchActionItem, overlaysOf as overlaysOf$1, resolveParams as resolveParams$1, resolveSchemaMenu, roleReader as roleReader$1, scratchKey as scratchKey$1, setScratch as setScratch$1, specificity, taggedActionItems, tuneAction } from "@weasel-js/routing";
|
|
60
|
+
import { ActionDisabledReason as ActionDisabledReason$1, actionBindings as actionBindings$1, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, bindingId, buildDepsFromRequires as buildDepsFromRequires$1, createDepRegistry, createDispatcher as createDispatcher$1, deleteScratch, evaluateActive as evaluateActive$1, evaluateEnabled as evaluateEnabled$1, getScratch as getScratch$1, heldKeySpec as heldKeySpec$1, keySpecShortcut, keysHeld, matchActionItem, overlaysOf as overlaysOf$1, readActionSettings, resolveBindingOverrides, resolveParams as resolveParams$1, resolveSchemaMenu, roleReader as roleReader$1, scratchKey as scratchKey$1, setScratch as setScratch$1, specificity, taggedActionItems, tuneAction } from "@weasel-js/routing";
|
|
66
61
|
import { bodyPredicate, hitPredicate as hitPredicate$1 } from "@weasel-js/gestures";
|
|
67
|
-
import { ActionsProvider as ActionsProvider$1, ActiveToolContextProvider as ActiveToolContextProvider$1, ActiveToolContextProviderIfRoot as ActiveToolContextProviderIfRoot$1, DepRegistryProvider as DepRegistryProvider$1, InputScope as InputScope$1, Yoke, useAction, useActionsRegistry as useActionsRegistry$1, useActiveToolContext, useCommand, useDepRegistry as useDepRegistry$1, useDepSource as useDepSource$1, useGestureDispatcher as useGestureDispatcher$1, useMenuHost as useMenuHost$1, useMenus, useOngoingAction, useOptionalActiveToolContext as useOptionalActiveToolContext$1, useOptionalDepRegistry as useOptionalDepRegistry$1, useYoke } from "@weasel-js/routing/react";
|
|
62
|
+
import { ActionsProvider as ActionsProvider$1, ActiveToolContextProvider as ActiveToolContextProvider$1, ActiveToolContextProviderIfRoot as ActiveToolContextProviderIfRoot$1, DepRegistryProvider as DepRegistryProvider$1, InputScope as InputScope$1, Yoke, useAction, useActionsRegistry as useActionsRegistry$1, useActiveToolContext, useCommand, useDepRegistry as useDepRegistry$1, useDepSource as useDepSource$1, useGestureDispatcher as useGestureDispatcher$1, useMenuHost as useMenuHost$1, useMenus, useOngoingAction, useOpenKeymap, useOptionalActiveToolContext as useOptionalActiveToolContext$1, useOptionalDepRegistry as useOptionalDepRegistry$1, useYoke } from "@weasel-js/routing/react";
|
|
68
63
|
|
|
69
|
-
export { AREA_SELECT_ID, ActionDisabledReason$1 as ActionDisabledReason, ActionsProvider$1 as ActionsProvider, ActiveToolContextProvider$1 as ActiveToolContextProvider, ActiveToolContextProviderIfRoot$1 as ActiveToolContextProviderIfRoot, CORNER_ANCHORS, DRAG_PAN_ID, DepRegistryProvider$1 as DepRegistryProvider, EDGE_HANDLE_MIN_RADII, INSERT_REPOSITION_BINDING, InputScope$1 as InputScope, KIT_STANDARD_ACTION_IDS, PATH_GESTURE_TAGS, RESIZE_HANDLE_ANCHORS, SELECTION_MOVE_ID, SELECTION_RESIZE_ID, SELECTION_ROTATE_ID, SELECTION_TRANSFORM_ID, STICKY_DEFAULTS, Yoke, actionBindings, actionCursor, actionItemTitle, actionItems, actionShortcuts, actionsTagged, areaSelectAction, areaSelectContribution, bodyPredicate, buildDepsFromRequires, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction, cloneAction, computeSliceOps, contextMenuAction, cornerPoint,
|
|
64
|
+
export { AREA_SELECT_ID, ActionDisabledReason$1 as ActionDisabledReason, ActionsProvider$1 as ActionsProvider, ActiveToolContextProvider$1 as ActiveToolContextProvider, ActiveToolContextProviderIfRoot$1 as ActiveToolContextProviderIfRoot, CORNER_ANCHORS, DRAG_PAN_ID, DepRegistryProvider$1 as DepRegistryProvider, EDGE_HANDLE_MIN_RADII, INSERT_REPOSITION_BINDING, InputScope$1 as InputScope, KIT_STANDARD_ACTION_IDS, PATH_GESTURE_TAGS, RESIZE_HANDLE_ANCHORS, SELECTION_MOVE_ID, SELECTION_RESIZE_ID, SELECTION_ROTATE_ID, SELECTION_TRANSFORM_ID, STICKY_DEFAULTS, Yoke, actionBindings$1 as actionBindings, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, areaSelectAction, areaSelectContribution, bindingId, bodyPredicate, buildDepsFromRequires$1 as buildDepsFromRequires, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction, cloneAction, commitDeleteToScene, computeSliceOps, contextMenuAction, cornerPoint, createDeleteAction, createDepRegistry, createDispatcher$1 as createDispatcher, createPointerFollower, createResizeAction, defaultCommitAdapter, defineTool, deleteAction, deleteAnchorsAction, deleteScratch, dragPanContribution, editAnchorsAction, editingLayer, enterTextEditAction, evaluateActive$1 as evaluateActive, evaluateEnabled$1 as evaluateEnabled, exitPathEditToolAction, flipAction, getScratch$1 as getScratch, handlePoint, heldKeySpec$1 as heldKeySpec, hiddenSourceDeleteOps, hitPredicate$1 as hitPredicate, inPlane, insertAction, insertLayer, insertRepositionAction, isCornerHandle, isToolSet, keySpecShortcut, keysHeld, lassoSelectAction, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, matchActionItem, moveAction, nudgeAnchorsDownAction, nudgeAnchorsLeftAction, nudgeAnchorsRightAction, nudgeAnchorsUpAction, onEmptyCanvas, openContextMenu, overlaysOf$1 as overlaysOf, pathEditToolAction, pathEditToolActive, pathOperationTags, pickTopMostHit, pinchZoomAction, placeAction, readActionSettings, resizeAction, resizeHandlesFor, resolveBindingOverrides, resolveParams$1 as resolveParams, resolveSchemaMenu, roleReader$1 as roleReader, rotateAction, scratchKey$1 as scratchKey, selectAnchorAction, selectFromLasso, selectionLayer, selectionMoveBindings, selectionMoveContribution, selectionResizeBindings, selectionResizeContribution, selectionRotateBindings, selectionRotateContribution, selectionTransformBindings, selectionTransformContribution, setScratch$1 as setScratch, sliceAction, specificity, stickyData, stickyNodeFactory, taggedActionItems, toolIdsOf$1 as toolIdsOf, toolSet$1 as toolSet, toolSetHas, tuneAction, useAction, useActionsRegistry$1 as useActionsRegistry, useActiveToolContext, useBooleansAdapterSource, useCommand, useDepRegistry$1 as useDepRegistry, useDepSource$1 as useDepSource, useEllipseTool, useEyedropperTool, useGestureDispatcher$1 as useGestureDispatcher, useHandTool, useImageTool, useKeybindings, useLassoTool, useLatest$1 as useLatest, useLineTool, useMeasureTool, useMenuHost$1 as useMenuHost, useMenus, useOngoingAction, useOpenKeymap, useOptionalActiveToolContext$1 as useOptionalActiveToolContext, useOptionalDepRegistry$1 as useOptionalDepRegistry, usePenTool, usePencilTool, usePolygonTool, usePoseDescriptorDepSource, useRectTool, useResizePolicy, useSelectTool, useSliceDep, useSliceDepSource, useSliceTool, useStandardActions, useStarTool, useStickyTool, useTextTool, useTools$1 as useTools, useYoke, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, withoutTools };
|
package/dist/barrel/scene.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IDENTITY_POSE_COMPOSITION, composeWorldPose, composesFrames, rebaseLocalPose } from "../core/scene/composeFrame.js";
|
|
2
2
|
import { RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, composeRectPose, composeRigidPose, decomposeRectPose, decomposeRigidPose, translateRectPose, worldPoseLookup } from "../core/scene/composePose.js";
|
|
3
|
-
import { definesFrame, derivedDepOf, derivedPose, documentPose, effectivePose } from "../core/scene/effectivePose.js";
|
|
3
|
+
import { definesFrame, derivedDepOf, derivedPose, documentDepOf, documentPose, effectivePose } from "../core/scene/effectivePose.js";
|
|
4
4
|
import { axisAlignedBounds, unionAABB, unionBounds } from "../core/geometry/unionBounds.js";
|
|
5
|
+
import { scenePoseAdapter } from "../core/scene/scenePoseAdapter.js";
|
|
6
|
+
import { carriedDescendants, sceneCarrySource } from "../core/scene/carryDescendants.js";
|
|
5
7
|
import { measureBetween, measureEndsOf, measureNode, measurePose, measurementOf } from "../features/measure/measurement.js";
|
|
6
8
|
import { asNodeId } from "../core/scene/types.js";
|
|
7
9
|
import { annotationLayerIds, isAnnotationLayer, isAnnotationNode } from "../core/scene/annotation.js";
|
|
@@ -9,9 +11,8 @@ import { hidesSubtree, isNodeHidden, isNodeLocked, nodeGates } from "../core/sce
|
|
|
9
11
|
import { applyOpsTo, dispatchApplyBatch } from "../core/applyOps.js";
|
|
10
12
|
import { SceneArrivalRefused } from "../core/scene/arrivals.js";
|
|
11
13
|
import { opFactoryRegistry, rebuildOp, registerOpFactory, registeredOpNames } from "../core/ops/registry.js";
|
|
12
|
-
import { createReparentOp } from "../core/ops/reparent.js";
|
|
13
14
|
import { createTransformOp } from "../core/ops/transform.js";
|
|
14
|
-
import {
|
|
15
|
+
import { createReparentOp } from "../core/ops/reparent.js";
|
|
15
16
|
import { createSetDataOp } from "../core/ops/setData.js";
|
|
16
17
|
import { createSetLayerOp } from "../core/ops/setLayer.js";
|
|
17
18
|
import { createDeleteOp } from "../core/ops/delete.js";
|
|
@@ -20,10 +21,12 @@ import { createSetSelectionOp } from "../core/ops/select.js";
|
|
|
20
21
|
import { canBringForward, canSendBackward } from "../core/ops/reorder/algorithms.js";
|
|
21
22
|
import { createSetChildOrderOp } from "../core/ops/reorder/setChildOrder.js";
|
|
22
23
|
import { createMoveToIndexOp, createReorderOp } from "../core/ops/reorder/index.js";
|
|
24
|
+
import { CLIP_NOTHING, clipNothing } from "../core/scene/clipNothing.js";
|
|
23
25
|
import { UNION_OF_CHILDREN, unionOfChildren } from "../core/scene/kitRegistry.js";
|
|
24
26
|
import { createMeasurements, currentMeasureId, measureIds } from "../features/measure/measurements.js";
|
|
25
27
|
import { measureAt, measureEndSource } from "../features/measure/measureHit.js";
|
|
26
28
|
import { MEASURE_ACTION_IDS } from "../features/measure/actionIds.js";
|
|
29
|
+
import { writtenBy } from "../core/ops/writtenBy.js";
|
|
27
30
|
import { createPoseOverrides } from "../core/scene/poseOverrides.js";
|
|
28
31
|
import { createArrangeOp } from "../core/ops/arrange.js";
|
|
29
32
|
import { createHistory as createHistory$1 } from "../core/ops/createHistory.js";
|
|
@@ -31,6 +34,7 @@ import { SCENE_HISTORY_FORM } from "../core/scene/historyForm.js";
|
|
|
31
34
|
import { sceneSelectionStore } from "../core/scene/sceneSelection.js";
|
|
32
35
|
import { createScene, sceneFromJSON } from "../core/scene/scene.js";
|
|
33
36
|
import { createSetTextOp } from "../core/ops/setText.js";
|
|
37
|
+
import { createSetDependsOnOp } from "../core/ops/setDependsOn.js";
|
|
34
38
|
import { createSetHiddenOp, createSetLockedOp } from "../core/ops/nodeFlags.js";
|
|
35
39
|
import { createSetLayoutOp } from "../core/ops/setLayout.js";
|
|
36
40
|
import { createSetPathOp } from "../core/ops/setPath.js";
|
|
@@ -38,11 +42,11 @@ import { nestedHitTester } from "../core/scene/nestedHit.js";
|
|
|
38
42
|
import { unionOfChildrenVia } from "../core/scene/unionOfChildren.js";
|
|
39
43
|
import { useScene } from "../core/scene/useScene.js";
|
|
40
44
|
import { reconcileSpecs } from "../core/scene/reconcileSpecs.js";
|
|
41
|
-
import { sceneUnitScopes } from "../core/scene/unitScopes.js";
|
|
45
|
+
import { sceneSharedUnitScopes, sceneUnitScopes } from "../core/scene/unitScopes.js";
|
|
42
46
|
import { createPoseFeed } from "../core/scene/poseFeed.js";
|
|
43
47
|
import { MEASURE_AFFORDANCE_KIND, MEASURE_LAYER_ID } from "../features/measure/measureLayer.js";
|
|
44
48
|
import { measurementsContribution } from "../features/measure/measureContribution.js";
|
|
45
49
|
import { MIXED } from "@weasel-js/registry";
|
|
46
50
|
import { swapOp } from "@weasel-js/history";
|
|
47
51
|
|
|
48
|
-
export { IDENTITY_POSE_COMPOSITION, MEASURE_ACTION_IDS, MEASURE_AFFORDANCE_KIND, MEASURE_LAYER_ID, MIXED, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, SCENE_HISTORY_FORM, SceneArrivalRefused, UNION_OF_CHILDREN, annotationLayerIds, applyOpsTo, asNodeId, axisAlignedBounds, canBringForward, canSendBackward, composeRectPose, composeRigidPose, composeWorldPose, composesFrames, createArrangeOp, createDeleteOp, createHistory$1 as createHistory, createInsertOp, createMeasurements, createMoveToIndexOp, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createScene, createSetChildOrderOp, createSetDataOp, createSetHiddenOp, createSetLayerOp, createSetLayoutOp, createSetLockedOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTransformOp, currentMeasureId, decomposeRectPose, decomposeRigidPose, definesFrame, derivedDepOf, derivedPose, dispatchApplyBatch, documentPose, effectivePose, hidesSubtree, isAnnotationLayer, isAnnotationNode, isNodeHidden, isNodeLocked, measureAt, measureBetween, measureEndSource, measureEndsOf, measureIds, measureNode, measurePose, measurementOf, measurementsContribution, nestedHitTester, nodeGates, opFactoryRegistry, rebaseLocalPose, rebuildOp, reconcileSpecs, registerOpFactory, registeredOpNames, sceneFromJSON, scenePoseAdapter, sceneSelectionStore, sceneUnitScopes, swapOp, translateRectPose, unionAABB, unionBounds, unionOfChildren, unionOfChildrenVia, useScene, worldPoseLookup };
|
|
52
|
+
export { CLIP_NOTHING, IDENTITY_POSE_COMPOSITION, MEASURE_ACTION_IDS, MEASURE_AFFORDANCE_KIND, MEASURE_LAYER_ID, MIXED, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, SCENE_HISTORY_FORM, SceneArrivalRefused, UNION_OF_CHILDREN, annotationLayerIds, applyOpsTo, asNodeId, axisAlignedBounds, canBringForward, canSendBackward, carriedDescendants, clipNothing, composeRectPose, composeRigidPose, composeWorldPose, composesFrames, createArrangeOp, createDeleteOp, createHistory$1 as createHistory, createInsertOp, createMeasurements, createMoveToIndexOp, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createScene, createSetChildOrderOp, createSetDataOp, createSetDependsOnOp, createSetHiddenOp, createSetLayerOp, createSetLayoutOp, createSetLockedOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTransformOp, currentMeasureId, decomposeRectPose, decomposeRigidPose, definesFrame, derivedDepOf, derivedPose, dispatchApplyBatch, documentDepOf, documentPose, effectivePose, hidesSubtree, isAnnotationLayer, isAnnotationNode, isNodeHidden, isNodeLocked, measureAt, measureBetween, measureEndSource, measureEndsOf, measureIds, measureNode, measurePose, measurementOf, measurementsContribution, nestedHitTester, nodeGates, opFactoryRegistry, rebaseLocalPose, rebuildOp, reconcileSpecs, registerOpFactory, registeredOpNames, sceneCarrySource, sceneFromJSON, scenePoseAdapter, sceneSelectionStore, sceneSharedUnitScopes, sceneUnitScopes, swapOp, translateRectPose, unionAABB, unionBounds, unionOfChildren, unionOfChildrenVia, useScene, worldPoseLookup, writtenBy };
|