@weasel-js/core 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +326 -0
- package/README.md +8 -12
- package/dist/affordances/hitAffordanceRegions.js +1 -1
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/animation/clipTargets.js +1 -1
- package/dist/animation/clipTargets.js.map +1 -1
- package/dist/animation/poseTarget.js +5 -32
- package/dist/animation/poseTarget.js.map +1 -1
- package/dist/{autoPoseDescriptor-CZ1eXbzY.d.ts → autoPoseDescriptor-C25QVb0W.d.ts} +1 -1
- package/dist/barrel/canvas.js +8 -8
- package/dist/barrel/chrome.js +9 -9
- package/dist/barrel/input.js +1 -1
- package/dist/barrel/interactions.js +3 -3
- package/dist/barrel/paint.js +2 -2
- package/dist/barrel/paths.js +19 -17
- package/dist/barrel/renderer.js +11 -7
- package/dist/barrel/routing.js +4 -1
- package/dist/barrel/scene.js +16 -12
- package/dist/barrel/text.js +5 -5
- package/dist/barrel/viewport.js +8 -8
- package/dist/canvas/Canvas.js +2 -2
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +20 -14
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/GestureReason.js +64 -0
- package/dist/canvas/GestureReason.js.map +1 -0
- package/dist/canvas/GestureReason.module.js +7 -0
- package/dist/canvas/GestureReason.module.js.map +1 -0
- package/dist/canvas/LeanSceneCanvas.js +3 -1
- package/dist/canvas/LeanSceneCanvas.js.map +1 -1
- package/dist/canvas/NodeShape.js +2 -0
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/PickHud.js +7 -3
- package/dist/canvas/PickHud.js.map +1 -1
- package/dist/canvas/SceneCanvas/CanvasKitProviders.js +1 -1
- package/dist/canvas/SceneCanvas/CanvasKitProviders.js.map +1 -1
- package/dist/canvas/SceneCanvas/DevHuds.js +2 -2
- package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -1
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +4 -2
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js +3 -1
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js.map +1 -1
- package/dist/canvas/SceneCanvas/brushOverlay.js.map +1 -1
- package/dist/canvas/SceneCanvas/builtinToolSets.js +17 -9
- package/dist/canvas/SceneCanvas/builtinToolSets.js.map +1 -1
- package/dist/canvas/SceneCanvas/canvasPassThrough.js +2 -1
- package/dist/canvas/SceneCanvas/canvasPassThrough.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +75 -19
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +7 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultTextEditor.js +108 -0
- package/dist/canvas/SceneCanvas/defaultTextEditor.js.map +1 -0
- package/dist/canvas/SceneCanvas/describePresets.js +47 -0
- package/dist/canvas/SceneCanvas/describePresets.js.map +1 -0
- package/dist/canvas/SceneCanvas/features.js +57 -16
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/mergeLayers.js +10 -1
- package/dist/canvas/SceneCanvas/mergeLayers.js.map +1 -1
- package/dist/canvas/SceneCanvas/namedPresets.js +52 -24
- package/dist/canvas/SceneCanvas/namedPresets.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/arrange.js +35 -10
- package/dist/canvas/SceneCanvas/presets/arrange.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/baseline.js +9 -0
- package/dist/canvas/SceneCanvas/presets/baseline.js.map +1 -0
- package/dist/canvas/SceneCanvas/presets/chrome.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/composites.js +43 -0
- package/dist/canvas/SceneCanvas/presets/composites.js.map +1 -0
- package/dist/canvas/SceneCanvas/presets/edit.js +79 -26
- package/dist/canvas/SceneCanvas/presets/edit.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/ingest.js +1 -0
- package/dist/canvas/SceneCanvas/presets/ingest.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/paths.js +58 -16
- package/dist/canvas/SceneCanvas/presets/paths.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/select.js +4 -2
- package/dist/canvas/SceneCanvas/presets/select.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/tools.js +24 -0
- package/dist/canvas/SceneCanvas/presets/tools.js.map +1 -0
- package/dist/canvas/SceneCanvas/presets/transform.js +4 -0
- package/dist/canvas/SceneCanvas/presets/transform.js.map +1 -1
- package/dist/canvas/SceneCanvas/presets/view.js +3 -1
- package/dist/canvas/SceneCanvas/presets/view.js.map +1 -1
- package/dist/canvas/SceneCanvas/props.js.map +1 -1
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +1 -1
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/toolRegistry.js +5 -4
- package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasTools.js +26 -10
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useContributionRoles.js +15 -2
- package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -1
- package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +5 -4
- package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +1 -1
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +9 -8
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +2 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +4 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneChrome.js +7 -4
- package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +9 -9
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js.map +1 -1
- package/dist/canvas/SceneCanvas/useScenePicking.js +4 -7
- package/dist/canvas/SceneCanvas/useScenePicking.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +2 -1
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +6 -6
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js +2 -2
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +1 -1
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js.map +1 -1
- package/dist/canvas/SceneCanvas/useToolKeybindings.js +2 -2
- package/dist/canvas/SceneCanvas/useToolKeybindings.js.map +1 -1
- package/dist/canvas/SceneCanvas/useViewportActions.js +5 -2
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -1
- package/dist/canvas/SceneCanvas.js +22 -11
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +1 -0
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/ViewMarker.js.map +1 -1
- package/dist/canvas/accentColor.js +14 -1
- package/dist/canvas/accentColor.js.map +1 -1
- package/dist/canvas/affordanceAt.js +2 -2
- package/dist/canvas/affordanceAt.js.map +1 -1
- package/dist/canvas/buildSceneTree.js +5 -3
- package/dist/canvas/buildSceneTree.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +4 -4
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/enteredGroup.js +14 -5
- package/dist/canvas/deps/enteredGroup.js.map +1 -1
- package/dist/canvas/deps/ingestion.js +5 -1
- package/dist/canvas/deps/ingestion.js.map +1 -1
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/insertSite.js +5 -3
- package/dist/canvas/deps/insertSite.js.map +1 -1
- package/dist/canvas/deps/nodeAtPoint.js +1 -12
- package/dist/canvas/deps/nodeAtPoint.js.map +1 -1
- package/dist/canvas/deps/pathEditCommits.js +3 -3
- package/dist/canvas/deps/pathEditCommits.js.map +1 -1
- package/dist/canvas/deps/slice.js +16 -2
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/snap.js +5 -5
- package/dist/canvas/deps/snap.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +5 -6
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/derivedPath.js +8 -3
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/getNodeAtPoint.js +2 -2
- package/dist/canvas/getNodeAtPoint.js.map +1 -1
- package/dist/canvas/insertPreviewExtent.js.map +1 -1
- package/dist/canvas/layerSlots.js.map +1 -1
- package/dist/canvas/nodeShapes/measurePainter.js +1 -1
- package/dist/canvas/nodeShapes/measurePainter.js.map +1 -1
- package/dist/canvas/nodeShapes/strokedBounds.js +5 -3
- package/dist/canvas/nodeShapes/strokedBounds.js.map +1 -1
- package/dist/canvas/overlayRoleStrokes.js +6 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/pickIndex/scenePickIndex.js +10 -12
- package/dist/canvas/pickIndex/scenePickIndex.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +10 -19
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +17 -4
- package/dist/canvas/sceneClipboard.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +3 -2
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/surfaceContribution.js.map +1 -1
- package/dist/canvas/useCanvasPaint.js +10 -4
- package/dist/canvas/useCanvasPaint.js.map +1 -1
- package/dist/canvas/useHitObserver.js +1 -1
- package/dist/canvas/useHitObserver.js.map +1 -1
- package/dist/canvas/useViewAim.js +1 -1
- package/dist/canvas/useViewAim.js.map +1 -1
- package/dist/canvas/useViewHelpers.js +8 -5
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/useViewNesting.js +39 -12
- package/dist/canvas/useViewNesting.js.map +1 -1
- package/dist/canvas/viewInputs.js.map +1 -1
- package/dist/canvas/viewMarkers.js +2 -2
- package/dist/canvas/viewMarkers.js.map +1 -1
- package/dist/canvas/viewRegistry.js +2 -2
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/canvas/viewSnap.js +67 -0
- package/dist/canvas/viewSnap.js.map +1 -0
- package/dist/clipboard.d.ts +6 -12
- package/dist/{clone-qb2e1F5p.d.ts → clone-Bz4iqGfE.d.ts} +10 -5
- package/dist/clone.d.ts +5 -5
- package/dist/core/geometry/booleanOfPaths.js +23 -0
- package/dist/core/geometry/booleanOfPaths.js.map +1 -0
- package/dist/core/geometry/pathPoseDescriptor.js +12 -9
- package/dist/core/geometry/pathPoseDescriptor.js.map +1 -1
- package/dist/core/geometry/poseDescriptor.js +12 -3
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/targetFrame.js +2 -13
- package/dist/core/geometry/targetFrame.js.map +1 -1
- package/dist/core/layers/render.js +2 -1
- package/dist/core/layers/render.js.map +1 -1
- package/dist/core/layers/retain.js +5 -3
- package/dist/core/layers/retain.js.map +1 -1
- package/dist/core/ops/setPath.js +3 -0
- package/dist/core/ops/setPath.js.map +1 -1
- package/dist/core/paint/meshKindLazy.js.map +1 -1
- package/dist/core/paint/paintKindEntry.js.map +1 -1
- package/dist/core/paint/paintKinds.js +8 -1
- package/dist/core/paint/paintKinds.js.map +1 -1
- package/dist/core/scene/NodeProperties.js.map +1 -1
- package/dist/core/scene/NodeRouting.js.map +1 -1
- package/dist/core/scene/booleanGroup.js +33 -0
- package/dist/core/scene/booleanGroup.js.map +1 -0
- package/dist/core/scene/booleanOfChildren.js +53 -0
- package/dist/core/scene/booleanOfChildren.js.map +1 -0
- package/dist/core/scene/carryDescendants.js +18 -6
- package/dist/core/scene/carryDescendants.js.map +1 -1
- package/dist/core/scene/composeFrame.js +42 -5
- package/dist/core/scene/composeFrame.js.map +1 -1
- package/dist/core/scene/composePose.js +35 -16
- package/dist/core/scene/composePose.js.map +1 -1
- package/dist/core/scene/depMemo.js +36 -18
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/derivedParts.js +2 -23
- package/dist/core/scene/derivedParts.js.map +1 -1
- package/dist/core/scene/effectivePose.js +10 -0
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/historyForm.js +5 -4
- package/dist/core/scene/historyForm.js.map +1 -1
- package/dist/core/scene/kitOps.js +5 -71
- package/dist/core/scene/kitOps.js.map +1 -1
- package/dist/core/scene/kitRegistry.js +5 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layerOps.js +82 -0
- package/dist/core/scene/layerOps.js.map +1 -0
- package/dist/core/scene/layoutPass.js +14 -12
- package/dist/core/scene/layoutPass.js.map +1 -1
- package/dist/core/scene/lockGuard.js +9 -3
- package/dist/core/scene/lockGuard.js.map +1 -1
- package/dist/core/scene/nestedHit.js +5 -5
- package/dist/core/scene/nestedHit.js.map +1 -1
- package/dist/core/scene/nodeFlags.js +8 -2
- package/dist/core/scene/nodeFlags.js.map +1 -1
- package/dist/core/scene/nodeGates.js +31 -2
- package/dist/core/scene/nodeGates.js.map +1 -1
- package/dist/core/scene/pathEffects/effects.js +22 -3
- package/dist/core/scene/pathEffects/effects.js.map +1 -1
- package/dist/core/scene/pathEffects/textAlong.js +16 -3
- package/dist/core/scene/pathEffects/textAlong.js.map +1 -1
- package/dist/core/scene/pathEffects/textAlongBands.js +65 -0
- package/dist/core/scene/pathEffects/textAlongBands.js.map +1 -0
- package/dist/core/scene/reconcileSpecs.js +1 -1
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/scene.js +11 -5
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneEdits.js +5 -2
- package/dist/core/scene/sceneEdits.js.map +1 -1
- package/dist/core/scene/scenePoseAdapter.js +10 -1
- package/dist/core/scene/scenePoseAdapter.js.map +1 -1
- package/dist/core/scene/scrollOffsets.js +93 -0
- package/dist/core/scene/scrollOffsets.js.map +1 -0
- package/dist/core/scene/serialization.js +15 -5
- package/dist/core/scene/serialization.js.map +1 -1
- package/dist/core/scene/statedFields.js +2 -1
- package/dist/core/scene/statedFields.js.map +1 -1
- package/dist/core/scene/strategyView.js +35 -0
- package/dist/core/scene/strategyView.js.map +1 -0
- package/dist/core/scene/types.js.map +1 -1
- package/dist/core/scene/useScene.js +2 -0
- package/dist/core/scene/useScene.js.map +1 -1
- package/dist/core/scene/worldSave.js +87 -0
- package/dist/core/scene/worldSave.js.map +1 -0
- package/dist/core/selection/selectionTarget.js +1 -1
- package/dist/core/selection/selectionTarget.js.map +1 -1
- package/dist/{cornerHandles-CNCb7aTY.d.ts → cornerHandles-DpmQM_z5.d.ts} +1 -1
- package/dist/{depSchema-CpIQzKWQ.d.ts → depSchema-C3BwxitB.d.ts} +119 -99
- package/dist/devtools-protocol.d.ts +2 -2
- package/dist/devtools.d.ts +2 -2
- package/dist/{features → domains}/chrome-caps/buildChromeCtx.js +1 -1
- package/dist/domains/chrome-caps/buildChromeCtx.js.map +1 -0
- package/dist/{features → domains}/chrome-caps/conditions.js +1 -1
- package/dist/domains/chrome-caps/conditions.js.map +1 -0
- package/dist/{features → domains}/chrome-caps/defaults.js +1 -1
- package/dist/domains/chrome-caps/defaults.js.map +1 -0
- package/dist/{features → domains}/chrome-caps/resolve.js +1 -1
- package/dist/domains/chrome-caps/resolve.js.map +1 -0
- package/dist/{features → domains}/chrome-caps/useChromeCaps.js +1 -1
- package/dist/domains/chrome-caps/useChromeCaps.js.map +1 -0
- package/dist/{features → domains}/chrome-caps/useHoverTracking.js +1 -1
- package/dist/domains/chrome-caps/useHoverTracking.js.map +1 -0
- package/dist/{features → domains}/ingestion/contentHandlers.js +20 -3
- package/dist/domains/ingestion/contentHandlers.js.map +1 -0
- package/dist/domains/ingestion/ghost.js +56 -0
- package/dist/domains/ingestion/ghost.js.map +1 -0
- package/dist/{features → domains}/ingestion/imageHandler.js +1 -1
- package/dist/domains/ingestion/imageHandler.js.map +1 -0
- package/dist/domains/ingestion/kitHandlers.js +22 -0
- package/dist/domains/ingestion/kitHandlers.js.map +1 -0
- package/dist/{features → domains}/ingestion/openFilePicker.js +1 -1
- package/dist/domains/ingestion/openFilePicker.js.map +1 -0
- package/dist/{features → domains}/ingestion/placement.js +1 -1
- package/dist/domains/ingestion/placement.js.map +1 -0
- package/dist/{features → domains}/ingestion/svgHandler.js +1 -1
- package/dist/domains/ingestion/svgHandler.js.map +1 -0
- package/dist/{features → domains}/ingestion/textHandler.js +9 -7
- package/dist/domains/ingestion/textHandler.js.map +1 -0
- package/dist/{features → domains}/ingestion/useCanvasIngestion.js +13 -15
- package/dist/domains/ingestion/useCanvasIngestion.js.map +1 -0
- package/dist/{features → domains}/ingestion/weaselJsonHandler.js +1 -1
- package/dist/domains/ingestion/weaselJsonHandler.js.map +1 -0
- package/dist/{features → domains}/longPress/longPressFeedback.js +1 -1
- package/dist/domains/longPress/longPressFeedback.js.map +1 -0
- package/dist/{features → domains}/measure/actionIds.js +1 -1
- package/dist/domains/measure/actionIds.js.map +1 -0
- package/dist/{features → domains}/measure/measureCommands.js +1 -1
- package/dist/domains/measure/measureCommands.js.map +1 -0
- package/dist/{features → domains}/measure/measureContribution.js +1 -1
- package/dist/domains/measure/measureContribution.js.map +1 -0
- package/dist/{features → domains}/measure/measureEdits.js +1 -1
- package/dist/domains/measure/measureEdits.js.map +1 -0
- package/dist/{features → domains}/measure/measureGestures.js +4 -7
- package/dist/domains/measure/measureGestures.js.map +1 -0
- package/dist/{features → domains}/measure/measureHit.js +1 -1
- package/dist/domains/measure/measureHit.js.map +1 -0
- package/dist/{features → domains}/measure/measureLayer.js +1 -1
- package/dist/domains/measure/measureLayer.js.map +1 -0
- package/dist/{features → domains}/measure/measurement.js +1 -1
- package/dist/domains/measure/measurement.js.map +1 -0
- package/dist/{features → domains}/measure/measurements.js +2 -2
- package/dist/domains/measure/measurements.js.map +1 -0
- package/dist/{features → domains}/modes/modeLayers.js +1 -1
- package/dist/domains/modes/modeLayers.js.map +1 -0
- package/dist/{features → domains}/modes/modeTriggers.js +3 -6
- package/dist/domains/modes/modeTriggers.js.map +1 -0
- package/dist/{features → domains}/pathEffects/effectSources.js +1 -1
- package/dist/domains/pathEffects/effectSources.js.map +1 -0
- package/dist/{features → domains}/pathEffects/index.js +1 -1
- package/dist/domains/pathEffects/index.js.map +1 -0
- package/dist/{features → domains}/pathEffects/readSource.js +1 -1
- package/dist/domains/pathEffects/readSource.js.map +1 -0
- package/dist/{features → domains}/pathEffects/textItems.js +11 -2
- package/dist/domains/pathEffects/textItems.js.map +1 -0
- package/dist/{features → domains}/pathEffects/useEffectSourcesLayer.js +1 -1
- package/dist/domains/pathEffects/useEffectSourcesLayer.js.map +1 -0
- package/dist/{features → domains}/paths/anchorData.js +1 -1
- package/dist/domains/paths/anchorData.js.map +1 -0
- package/dist/{features → domains}/paths/anchorMarkers.js +9 -7
- package/dist/domains/paths/anchorMarkers.js.map +1 -0
- package/dist/{features → domains}/paths/editablePath.js +1 -1
- package/dist/domains/paths/editablePath.js.map +1 -0
- package/dist/{features → domains}/paths/index.js +3 -3
- package/dist/{features → domains}/paths/originProjection.js +1 -1
- package/dist/domains/paths/originProjection.js.map +1 -0
- package/dist/{features → domains}/paths/pathEditExtension.js +1 -1
- package/dist/domains/paths/pathEditExtension.js.map +1 -0
- package/dist/{features → domains}/paths/pathEditState.js +1 -1
- package/dist/domains/paths/pathEditState.js.map +1 -0
- package/dist/{features → domains}/paths/pathEditingOverlayLayer.js +1 -1
- package/dist/domains/paths/pathEditingOverlayLayer.js.map +1 -0
- package/dist/{features → domains}/paths/pathLayer.js +1 -1
- package/dist/domains/paths/pathLayer.js.map +1 -0
- package/dist/{features → domains}/paths/pathRepresentation.js +1 -1
- package/dist/domains/paths/pathRepresentation.js.map +1 -0
- package/dist/{features → domains}/paths/pathSnap/glyphs.js +1 -1
- package/dist/domains/paths/pathSnap/glyphs.js.map +1 -0
- package/dist/{features → domains}/paths/pathSnap/pathSnapSource.js +1 -1
- package/dist/domains/paths/pathSnap/pathSnapSource.js.map +1 -0
- package/dist/{features → domains}/paths/pathSnap/sceneIndex.js +1 -1
- package/dist/domains/paths/pathSnap/sceneIndex.js.map +1 -0
- package/dist/{features → domains}/paths/pathSnap/snapGeometry.js +3 -2
- package/dist/domains/paths/pathSnap/snapGeometry.js.map +1 -0
- package/dist/{features → domains}/paths/penPreviewLayer.js +1 -1
- package/dist/domains/paths/penPreviewLayer.js.map +1 -0
- package/dist/{features → domains}/paths/shapeGenerator.js +6 -4
- package/dist/domains/paths/shapeGenerator.js.map +1 -0
- package/dist/{features → domains}/paths/strokeOutline.js +1 -1
- package/dist/domains/paths/strokeOutline.js.map +1 -0
- package/dist/{features → domains}/paths/useAnchorFields.js +1 -1
- package/dist/domains/paths/useAnchorFields.js.map +1 -0
- package/dist/{features → domains}/paths/usePathEdit.js +1 -1
- package/dist/domains/paths/usePathEdit.js.map +1 -0
- package/dist/{features → domains}/poseRun/usePoseRun.js +1 -1
- package/dist/domains/poseRun/usePoseRun.js.map +1 -0
- package/dist/{features → domains}/selection/enteredGroupFrame.js +49 -10
- package/dist/domains/selection/enteredGroupFrame.js.map +1 -0
- package/dist/{features → domains}/selection/enteredGroupScope.js +1 -1
- package/dist/domains/selection/enteredGroupScope.js.map +1 -0
- package/dist/domains/selection/enteredOperands.js +29 -0
- package/dist/domains/selection/enteredOperands.js.map +1 -0
- package/dist/{features → domains}/selection/handleCommands.js +1 -1
- package/dist/domains/selection/handleCommands.js.map +1 -0
- package/dist/{features → domains}/selection/overlay.js +1 -1
- package/dist/domains/selection/overlay.js.map +1 -0
- package/dist/{features → domains}/selection/selectionPose.js +1 -1
- package/dist/domains/selection/selectionPose.js.map +1 -0
- package/dist/{features → domains}/snap/angle2d.js +1 -1
- package/dist/domains/snap/angle2d.js.map +1 -0
- package/dist/{features → domains}/snap/debugCandidates.js +1 -1
- package/dist/domains/snap/debugCandidates.js.map +1 -0
- package/dist/{features → domains}/snap/gather.js +1 -1
- package/dist/domains/snap/gather.js.map +1 -0
- package/dist/{features → domains}/snap/inputSubspace.js +1 -1
- package/dist/domains/snap/inputSubspace.js.map +1 -0
- package/dist/{features → domains}/snap/lazySession.js +1 -1
- package/dist/domains/snap/lazySession.js.map +1 -0
- package/dist/{features → domains}/snap/marks.js +1 -1
- package/dist/domains/snap/marks.js.map +1 -0
- package/dist/{features → domains}/snap/outcomeStore.js +1 -1
- package/dist/domains/snap/outcomeStore.js.map +1 -0
- package/dist/{features → domains}/snap/pointSnap.js +1 -1
- package/dist/domains/snap/pointSnap.js.map +1 -0
- package/dist/{features → domains}/snap/probes2d.js +1 -1
- package/dist/domains/snap/probes2d.js.map +1 -0
- package/dist/{features → domains}/snap/readoutDraw.js +1 -1
- package/dist/domains/snap/readoutDraw.js.map +1 -0
- package/dist/{features → domains}/snap/readoutLayer.js +1 -1
- package/dist/domains/snap/readoutLayer.js.map +1 -0
- package/dist/{features → domains}/snap/registry.js +1 -1
- package/dist/domains/snap/registry.js.map +1 -0
- package/dist/{features → domains}/snap/resizeBox.js +1 -1
- package/dist/domains/snap/resizeBox.js.map +1 -0
- package/dist/{features → domains}/snap/roles.js +1 -1
- package/dist/domains/snap/roles.js.map +1 -0
- package/dist/{features → domains}/snap/rotationSource.js +1 -1
- package/dist/domains/snap/rotationSource.js.map +1 -0
- package/dist/{features → domains}/snap/sceneReads.js +24 -3
- package/dist/domains/snap/sceneReads.js.map +1 -0
- package/dist/{features → domains}/snap/sceneSession2d.js +3 -2
- package/dist/domains/snap/sceneSession2d.js.map +1 -0
- package/dist/{features → domains}/snap/screen.js +1 -1
- package/dist/domains/snap/screen.js.map +1 -0
- package/dist/{features → domains}/snap/session2d.js +3 -2
- package/dist/domains/snap/session2d.js.map +1 -0
- package/dist/{features → domains}/snap/spanSnap.js +1 -1
- package/dist/domains/snap/spanSnap.js.map +1 -0
- package/dist/{features → domains}/snap/stepAngles.js +1 -1
- package/dist/domains/snap/stepAngles.js.map +1 -0
- package/dist/{features → domains}/text/editingDrawOne.js +4 -4
- package/dist/domains/text/editingDrawOne.js.map +1 -0
- package/dist/domains/text/hostTextEditors.js +24 -0
- package/dist/domains/text/hostTextEditors.js.map +1 -0
- package/dist/{features → domains}/text/index.js +1 -1
- package/dist/{features → domains}/text/sceneTextDrafts.js +1 -1
- package/dist/domains/text/sceneTextDrafts.js.map +1 -0
- package/dist/{features → domains}/text/textHitAt.js +18 -2
- package/dist/domains/text/textHitAt.js.map +1 -0
- package/dist/{features → domains}/text/textLayer.js +1 -1
- package/dist/domains/text/textLayer.js.map +1 -0
- package/dist/{features → domains}/text/useSceneTextEdit.js +11 -3
- package/dist/domains/text/useSceneTextEdit.js.map +1 -0
- package/dist/{features → domains}/viewports/aim.js +1 -1
- package/dist/domains/viewports/aim.js.map +1 -0
- package/dist/{features → domains}/viewports/viewMarker.js +23 -5
- package/dist/domains/viewports/viewMarker.js.map +1 -0
- package/dist/{features → domains}/viewports/viewMarkerDrag.js +3 -3
- package/dist/domains/viewports/viewMarkerDrag.js.map +1 -0
- package/dist/{features → domains}/viewports/viewResolver.js +1 -1
- package/dist/domains/viewports/viewResolver.js.map +1 -0
- package/dist/{features → domains}/viewports/viewportLayer.js +1 -1
- package/dist/domains/viewports/viewportLayer.js.map +1 -0
- package/dist/icons.table.js +1 -1
- package/dist/icons.table.js.map +1 -1
- package/dist/icons.table.json +106 -6
- package/dist/index.d.ts +1441 -1050
- package/dist/index.js +90 -77
- package/dist/interactions/actions/admitsChild.js +6 -2
- package/dist/interactions/actions/admitsChild.js.map +1 -1
- package/dist/interactions/actions/align/align.js +1 -4
- package/dist/interactions/actions/align/align.js.map +1 -1
- package/dist/interactions/actions/booleans/booleanGroupAction.js +66 -0
- package/dist/interactions/actions/booleans/booleanGroupAction.js.map +1 -0
- package/dist/interactions/actions/booleans/keymap.js +52 -0
- package/dist/interactions/actions/booleans/keymap.js.map +1 -0
- package/dist/interactions/actions/booleans/operands.js +1 -1
- package/dist/interactions/actions/booleans/pieces.js +4 -11
- package/dist/interactions/actions/booleans/pieces.js.map +1 -1
- package/dist/interactions/actions/clipboard/action.js +3 -7
- package/dist/interactions/actions/clipboard/action.js.map +1 -1
- package/dist/interactions/actions/clipboard/clipboardOps.js +1 -1
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +6 -6
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js.map +1 -1
- package/dist/interactions/actions/defaults/containerScroll.js +170 -0
- package/dist/interactions/actions/defaults/containerScroll.js.map +1 -0
- package/dist/interactions/actions/defaults/contextMenu.js +2 -5
- package/dist/interactions/actions/defaults/contextMenu.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js +1 -1
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +1 -3
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterGroup.js +7 -12
- package/dist/interactions/actions/defaults/enterGroup.js.map +1 -1
- package/dist/interactions/actions/defaults/enterPathEdit.js +4 -8
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +12 -24
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +18 -10
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +3 -3
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudgeSteps.js +3 -21
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
- package/dist/interactions/actions/defaults/pathEditMarks.js.map +1 -1
- package/dist/interactions/actions/defaults/selectDeep.js +2 -2
- package/dist/interactions/actions/defaults/selectDeep.js.map +1 -1
- package/dist/interactions/actions/distribute/distribute.js.map +1 -1
- package/dist/interactions/actions/dropVerdict.js +9 -0
- package/dist/interactions/actions/dropVerdict.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/action.js +2 -2
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/extensionDrags.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/geometry.js +8 -6
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/handleDrag.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/preview.js +1 -1
- package/dist/interactions/actions/edit-anchors/preview.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +3 -2
- package/dist/interactions/actions/flip/action.js.map +1 -1
- package/dist/interactions/actions/geometryProjection.js +8 -3
- package/dist/interactions/actions/geometryProjection.js.map +1 -1
- package/dist/interactions/actions/gestureFrames.js +1 -0
- package/dist/interactions/actions/gestureFrames.js.map +1 -1
- package/dist/interactions/actions/insert/action.js +6 -2
- package/dist/interactions/actions/insert/action.js.map +1 -1
- package/dist/interactions/actions/insert/frame.js +1 -1
- package/dist/interactions/actions/insert/frame.js.map +1 -1
- package/dist/interactions/actions/insert/placeAction.js +6 -8
- package/dist/interactions/actions/insert/placeAction.js.map +1 -1
- package/dist/interactions/actions/insert/session.js +2 -2
- package/dist/interactions/actions/insert/session.js.map +1 -1
- package/dist/interactions/actions/move/action.js +6 -15
- package/dist/interactions/actions/move/action.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +12 -2
- package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +29 -10
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +42 -6
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/capture.js +4 -8
- package/dist/interactions/actions/move/capture.js.map +1 -1
- package/dist/interactions/actions/move/commit/index.js.map +1 -1
- package/dist/interactions/actions/move/commit/layoutDrop.js +4 -3
- package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -1
- package/dist/interactions/actions/move/commit/layoutRelease.js +15 -9
- package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -1
- package/dist/interactions/actions/move/commit/reparent.js +19 -13
- package/dist/interactions/actions/move/commit/reparent.js.map +1 -1
- package/dist/interactions/actions/move/delta.js +51 -5
- package/dist/interactions/actions/move/delta.js.map +1 -1
- package/dist/interactions/actions/move/frame.js +8 -4
- package/dist/interactions/actions/move/frame.js.map +1 -1
- package/dist/interactions/actions/move/layout/container.js +19 -9
- package/dist/interactions/actions/move/layout/container.js.map +1 -1
- package/dist/interactions/actions/move/layout/dragged.js +2 -2
- package/dist/interactions/actions/move/layout/dragged.js.map +1 -1
- package/dist/interactions/actions/move/layout/dropPass.js +36 -18
- package/dist/interactions/actions/move/layout/dropPass.js.map +1 -1
- package/dist/interactions/actions/move/layout/exits.js +2 -2
- package/dist/interactions/actions/move/layout/exits.js.map +1 -1
- package/dist/interactions/actions/move/layout/glide.js +5 -5
- package/dist/interactions/actions/move/layout/glide.js.map +1 -1
- package/dist/interactions/actions/move/layout/view.js +55 -0
- package/dist/interactions/actions/move/layout/view.js.map +1 -0
- package/dist/interactions/actions/move/refusal.js +52 -0
- package/dist/interactions/actions/move/refusal.js.map +1 -0
- package/dist/interactions/actions/move/session.js +9 -8
- package/dist/interactions/actions/move/session.js.map +1 -1
- package/dist/interactions/actions/move/translate.js +10 -4
- package/dist/interactions/actions/move/translate.js.map +1 -1
- package/dist/interactions/actions/moveNodes.js +21 -5
- package/dist/interactions/actions/moveNodes.js.map +1 -1
- package/dist/interactions/actions/pathCommands/pathNodes.js +3 -3
- package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -1
- package/dist/interactions/actions/planeInput.js +14 -13
- package/dist/interactions/actions/planeInput.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +21 -8
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +1 -1
- package/dist/interactions/actions/resize/action.js.map +1 -1
- package/dist/interactions/actions/resize/aspect.js +1 -1
- package/dist/interactions/actions/resize/aspect.js.map +1 -1
- package/dist/interactions/actions/resize/commit.js +10 -1
- package/dist/interactions/actions/resize/commit.js.map +1 -1
- package/dist/interactions/actions/resize/frame.js +3 -2
- package/dist/interactions/actions/resize/frame.js.map +1 -1
- package/dist/interactions/actions/resize/held.js +44 -0
- package/dist/interactions/actions/resize/held.js.map +1 -0
- package/dist/interactions/actions/resize/session.js +3 -1
- package/dist/interactions/actions/resize/session.js.map +1 -1
- package/dist/interactions/actions/resolveOverlays.js +9 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -1
- package/dist/interactions/actions/resolvePreviews.js +23 -7
- package/dist/interactions/actions/resolvePreviews.js.map +1 -1
- package/dist/interactions/actions/rotate/action.js +1 -1
- package/dist/interactions/actions/rotate/action.js.map +1 -1
- package/dist/interactions/actions/rotate/frame.js +1 -1
- package/dist/interactions/actions/rotate/frame.js.map +1 -1
- package/dist/interactions/actions/rotate/session.js +2 -2
- package/dist/interactions/actions/rotate/session.js.map +1 -1
- package/dist/interactions/actions/selectionSubtree.js +2 -4
- package/dist/interactions/actions/selectionSubtree.js.map +1 -1
- package/dist/interactions/actions/spatialReference.js +4 -9
- package/dist/interactions/actions/spatialReference.js.map +1 -1
- package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -1
- package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -1
- package/dist/kitSettingsSchema.js +2 -2
- package/dist/kitSettingsSchema.js.map +1 -1
- package/dist/{math-C_elShP_.d.ts → math-B_unOnF4.d.ts} +2 -2
- package/dist/math.d.ts +3 -3
- package/dist/move.d.ts +6 -6
- package/dist/{options-ClEm3SEl.d.ts → options-DAjkhbcs.d.ts} +5 -5
- package/dist/{poseDescriptor-DN2yfnq_.d.ts → poseDescriptor-CvSxVhCd.d.ts} +17 -4
- package/dist/resize.d.ts +6 -6
- package/dist/style.css +14 -0
- package/dist/test-seams.d.ts +11 -15
- package/dist/test-seams.js +1 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js +3 -6
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/line/useLineTool.js.map +1 -1
- package/dist/tools/builtin/measure/useMeasureTool.js +2 -2
- package/dist/tools/builtin/measure/useMeasureTool.js.map +1 -1
- package/dist/tools/builtin/pen/penHandle.js +2 -2
- package/dist/tools/builtin/pen/penHandle.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +13 -19
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/select/groupEntry.js +1 -1
- package/dist/tools/builtin/select/groupEntry.js.map +1 -1
- package/dist/tools/builtin/select/selectionContributions.js +1 -1
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +7 -7
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/slice/useSliceTool.js +5 -8
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +1 -1
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/index.js +2 -1
- package/dist/{types-49uYJN3j.d.ts → types-A_sNJYRd.d.ts} +8 -0
- package/dist/{types-BEdRIhNc.d.ts → types-DW14eu9B.d.ts} +131 -36
- package/dist/{types-p2alu-R1.d.ts → types-VCtfchp-.d.ts} +4 -6
- package/dist/util/color.js +12 -14
- package/dist/util/color.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +25 -24
- package/dist/canvas/poseCascade.js +0 -65
- package/dist/canvas/poseCascade.js.map +0 -1
- package/dist/features/chrome-caps/buildChromeCtx.js.map +0 -1
- package/dist/features/chrome-caps/conditions.js.map +0 -1
- package/dist/features/chrome-caps/defaults.js.map +0 -1
- package/dist/features/chrome-caps/resolve.js.map +0 -1
- package/dist/features/chrome-caps/useChromeCaps.js.map +0 -1
- package/dist/features/chrome-caps/useHoverTracking.js.map +0 -1
- package/dist/features/ingestion/contentHandlers.js.map +0 -1
- package/dist/features/ingestion/imageHandler.js.map +0 -1
- package/dist/features/ingestion/openFilePicker.js.map +0 -1
- package/dist/features/ingestion/placement.js.map +0 -1
- package/dist/features/ingestion/registerKitHandlers.js +0 -43
- package/dist/features/ingestion/registerKitHandlers.js.map +0 -1
- package/dist/features/ingestion/svgHandler.js.map +0 -1
- package/dist/features/ingestion/textHandler.js.map +0 -1
- package/dist/features/ingestion/useCanvasIngestion.js.map +0 -1
- package/dist/features/ingestion/weaselJsonHandler.js.map +0 -1
- package/dist/features/longPress/longPressFeedback.js.map +0 -1
- package/dist/features/measure/actionIds.js.map +0 -1
- package/dist/features/measure/measureCommands.js.map +0 -1
- package/dist/features/measure/measureContribution.js.map +0 -1
- package/dist/features/measure/measureEdits.js.map +0 -1
- package/dist/features/measure/measureGestures.js.map +0 -1
- package/dist/features/measure/measureHit.js.map +0 -1
- package/dist/features/measure/measureLayer.js.map +0 -1
- package/dist/features/measure/measurement.js.map +0 -1
- package/dist/features/measure/measurements.js.map +0 -1
- package/dist/features/modes/modeLayers.js.map +0 -1
- package/dist/features/modes/modeTriggers.js.map +0 -1
- package/dist/features/pathEffects/effectSources.js.map +0 -1
- package/dist/features/pathEffects/index.js.map +0 -1
- package/dist/features/pathEffects/readSource.js.map +0 -1
- package/dist/features/pathEffects/textItems.js.map +0 -1
- package/dist/features/pathEffects/useEffectSourcesLayer.js.map +0 -1
- package/dist/features/paths/anchorData.js.map +0 -1
- package/dist/features/paths/anchorMarkers.js.map +0 -1
- package/dist/features/paths/editablePath.js.map +0 -1
- package/dist/features/paths/originProjection.js.map +0 -1
- package/dist/features/paths/pathEditExtension.js.map +0 -1
- package/dist/features/paths/pathEditState.js.map +0 -1
- package/dist/features/paths/pathEditingOverlayLayer.js.map +0 -1
- package/dist/features/paths/pathLayer.js.map +0 -1
- package/dist/features/paths/pathRepresentation.js.map +0 -1
- package/dist/features/paths/pathSnap/glyphs.js.map +0 -1
- package/dist/features/paths/pathSnap/pathSnapSource.js.map +0 -1
- package/dist/features/paths/pathSnap/sceneIndex.js.map +0 -1
- package/dist/features/paths/pathSnap/snapGeometry.js.map +0 -1
- package/dist/features/paths/penPreviewLayer.js.map +0 -1
- package/dist/features/paths/shapeGenerator.js.map +0 -1
- package/dist/features/paths/strokeOutline.js.map +0 -1
- package/dist/features/paths/useAnchorFields.js.map +0 -1
- package/dist/features/paths/usePathEdit.js.map +0 -1
- package/dist/features/poseRun/usePoseRun.js.map +0 -1
- package/dist/features/selection/enteredGroupFrame.js.map +0 -1
- package/dist/features/selection/enteredGroupScope.js.map +0 -1
- package/dist/features/selection/handleCommands.js.map +0 -1
- package/dist/features/selection/overlay.js.map +0 -1
- package/dist/features/selection/selectionPose.js.map +0 -1
- package/dist/features/snap/angle2d.js.map +0 -1
- package/dist/features/snap/debugCandidates.js.map +0 -1
- package/dist/features/snap/gather.js.map +0 -1
- package/dist/features/snap/inputSubspace.js.map +0 -1
- package/dist/features/snap/lazySession.js.map +0 -1
- package/dist/features/snap/marks.js.map +0 -1
- package/dist/features/snap/outcomeStore.js.map +0 -1
- package/dist/features/snap/pointSnap.js.map +0 -1
- package/dist/features/snap/probes2d.js.map +0 -1
- package/dist/features/snap/readoutDraw.js.map +0 -1
- package/dist/features/snap/readoutLayer.js.map +0 -1
- package/dist/features/snap/registry.js.map +0 -1
- package/dist/features/snap/resizeBox.js.map +0 -1
- package/dist/features/snap/roles.js.map +0 -1
- package/dist/features/snap/rotationSource.js.map +0 -1
- package/dist/features/snap/sceneReads.js.map +0 -1
- package/dist/features/snap/sceneSession2d.js.map +0 -1
- package/dist/features/snap/screen.js.map +0 -1
- package/dist/features/snap/session2d.js.map +0 -1
- package/dist/features/snap/spanSnap.js.map +0 -1
- package/dist/features/snap/stepAngles.js.map +0 -1
- package/dist/features/text/editingDrawOne.js.map +0 -1
- package/dist/features/text/sceneTextDrafts.js.map +0 -1
- package/dist/features/text/textHitAt.js.map +0 -1
- package/dist/features/text/textLayer.js.map +0 -1
- package/dist/features/text/useSceneTextEdit.js.map +0 -1
- package/dist/features/viewports/aim.js.map +0 -1
- package/dist/features/viewports/viewMarker.js.map +0 -1
- package/dist/features/viewports/viewMarkerDrag.js.map +0 -1
- package/dist/features/viewports/viewResolver.js.map +0 -1
- package/dist/features/viewports/viewportLayer.js.map +0 -1
- /package/dist/{features → domains}/chrome-caps/index.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { composeChildFrame, frameAtOrAbove, rebaseLocalPose } from "../../../../core/scene/composeFrame.js";
|
|
2
2
|
import { documentPose } from "../../../../core/scene/effectivePose.js";
|
|
3
|
-
import {
|
|
3
|
+
import { sceneViewPoseAdapter } from "../../../../core/scene/scenePoseAdapter.js";
|
|
4
4
|
|
|
5
5
|
//#region src/interactions/actions/move/layout/glide.ts
|
|
6
6
|
/** Hold a node still gliding from an earlier reflow where it is shown. Returns
|
|
@@ -31,13 +31,13 @@ function stepGlide(reflow, gliding, targets) {
|
|
|
31
31
|
function releasedPoses(session, previews) {
|
|
32
32
|
const out = /* @__PURE__ */ new Map();
|
|
33
33
|
const { scene, pc } = session;
|
|
34
|
-
const adapter =
|
|
34
|
+
const adapter = sceneViewPoseAdapter(scene);
|
|
35
35
|
for (const id of session.startPoses.keys()) {
|
|
36
36
|
const local = previews.get(id);
|
|
37
37
|
if (local === void 0) continue;
|
|
38
38
|
const parent = scene.get(id)?.parent ?? null;
|
|
39
39
|
const frame = frameAtOrAbove(adapter, parent);
|
|
40
|
-
const world = frame === null ? local : pc.compose(
|
|
40
|
+
const world = frame === null ? local : pc.compose(composeChildFrame(adapter, frame, pc.compose), local);
|
|
41
41
|
out.set(id, {
|
|
42
42
|
local,
|
|
43
43
|
parent,
|
|
@@ -51,7 +51,7 @@ function releasedPoses(session, previews) {
|
|
|
51
51
|
* never moved resumes settling from where it was held. */
|
|
52
52
|
function landReleased(session, reflow, released) {
|
|
53
53
|
const { scene, pc } = session;
|
|
54
|
-
const adapter =
|
|
54
|
+
const adapter = sceneViewPoseAdapter(scene);
|
|
55
55
|
for (const id of session.startPoses.keys()) {
|
|
56
56
|
const r = released.get(id);
|
|
57
57
|
if (!r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glide.js","names":[],"sources":["../../../../../src/interactions/actions/move/layout/glide.ts"],"sourcesContent":["import type { NodeId, Scene } from 'core/scene/types';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { documentPose } from 'core/scene/effectivePose';\nimport {
|
|
1
|
+
{"version":3,"file":"glide.js","names":[],"sources":["../../../../../src/interactions/actions/move/layout/glide.ts"],"sourcesContent":["import type { NodeId, Scene } from 'core/scene/types';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { documentPose } from 'core/scene/effectivePose';\nimport { composeChildFrame, frameAtOrAbove, rebaseLocalPose } from 'core/scene/composePose';\nimport { sceneViewPoseAdapter } from 'core/scene/scenePoseAdapter';\nimport type { ReflowTransition } from '../../../../layout/types';\nimport type { MoveSession } from '../session';\n\n/** Hold a node still gliding from an earlier reflow where it is shown. Returns\n * how far that stands from its document pose, or null when it is not gliding. */\nexport function catchGliding(\n scene: Scene<unknown, string, unknown>,\n reflow: ReflowTransition | null,\n projection: PoseDescriptor<unknown>,\n id: NodeId,\n): { dx: number; dy: number } | null {\n const shown = reflow?.poseOf(id as string);\n if (!reflow || shown === undefined) return null;\n reflow.glide(id as string, shown, { from: shown });\n const at = projection.getBounds(shown);\n const home = projection.getBounds(documentPose(scene, scene.get(id)!));\n return { dx: at.x - home.x, dy: at.y - home.y };\n}\n\n/** Send this frame's reflow targets gliding and settle what stopped reflowing. */\nexport function stepGlide(reflow: ReflowTransition, gliding: Set<NodeId>, targets: ReadonlyMap<NodeId, unknown>): void {\n for (const [id, pose] of targets) {\n reflow.glide(id as string, pose);\n gliding.add(id);\n }\n for (const id of gliding) {\n if (targets.has(id)) continue;\n reflow.settle(id as string);\n gliding.delete(id);\n }\n}\n\n/** Where a dragged id was shown when the gesture ended: its stored pose then,\n * the parent that pose was stored under, and the same pose in world. */\nexport interface Released {\n local: unknown;\n parent: NodeId | null;\n world: unknown;\n}\n\nexport function releasedPoses(session: MoveSession, previews: ReadonlyMap<NodeId, unknown>): Map<NodeId, Released> {\n const out = new Map<NodeId, Released>();\n const { scene, pc } = session;\n const adapter = sceneViewPoseAdapter(scene);\n for (const id of session.startPoses.keys()) {\n const local = previews.get(id);\n if (local === undefined) continue;\n const parent = scene.get(id)?.parent ?? null;\n const frame = frameAtOrAbove(adapter, parent);\n const world = frame === null ? local : pc.compose(composeChildFrame(adapter, frame, pc.compose), local);\n out.set(id, { local, parent, world });\n }\n return out;\n}\n\n/** Hand every dragged id to the reflow transition to glide from where it was\n * let go onto the pose the document now holds. An id caught mid-glide that\n * never moved resumes settling from where it was held. */\nexport function landReleased(\n session: MoveSession,\n reflow: ReflowTransition,\n released: Map<NodeId, Released>,\n): void {\n const { scene, pc } = session;\n const adapter = sceneViewPoseAdapter(scene);\n for (const id of session.startPoses.keys()) {\n const r = released.get(id);\n if (!r) {\n if (session.caught.has(id)) reflow.settle(id as string);\n continue;\n }\n const parent = scene.get(id)?.parent ?? null;\n const from = parent === r.parent\n ? r.local\n : rebaseLocalPose(adapter, r.world, parent, pc.compose, pc.decompose);\n reflow.settle(id as string, { from });\n }\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,aACd,OACA,QACA,YACA,IACmC;CACnC,MAAM,QAAQ,QAAQ,OAAO,EAAY;CACzC,IAAI,CAAC,UAAU,UAAU,QAAW,OAAO;CAC3C,OAAO,MAAM,IAAc,OAAO,EAAE,MAAM,MAAM,CAAC;CACjD,MAAM,KAAK,WAAW,UAAU,KAAK;CACrC,MAAM,OAAO,WAAW,UAAU,aAAa,OAAO,MAAM,IAAI,EAAE,CAAE,CAAC;CACrE,OAAO;EAAE,IAAI,GAAG,IAAI,KAAK;EAAG,IAAI,GAAG,IAAI,KAAK;CAAE;AAChD;;AAGA,SAAgB,UAAU,QAA0B,SAAsB,SAA6C;CACrH,KAAK,MAAM,CAAC,IAAI,SAAS,SAAS;EAChC,OAAO,MAAM,IAAc,IAAI;EAC/B,QAAQ,IAAI,EAAE;CAChB;CACA,KAAK,MAAM,MAAM,SAAS;EACxB,IAAI,QAAQ,IAAI,EAAE,GAAG;EACrB,OAAO,OAAO,EAAY;EAC1B,QAAQ,OAAO,EAAE;CACnB;AACF;AAUA,SAAgB,cAAc,SAAsB,UAA+D;CACjH,MAAM,sBAAM,IAAI,IAAsB;CACtC,MAAM,EAAE,OAAO,OAAO;CACtB,MAAM,UAAU,qBAAqB,KAAK;CAC1C,KAAK,MAAM,MAAM,QAAQ,WAAW,KAAK,GAAG;EAC1C,MAAM,QAAQ,SAAS,IAAI,EAAE;EAC7B,IAAI,UAAU,QAAW;EACzB,MAAM,SAAS,MAAM,IAAI,EAAE,CAAC,EAAE,UAAU;EACxC,MAAM,QAAQ,eAAe,SAAS,MAAM;EAC5C,MAAM,QAAQ,UAAU,OAAO,QAAQ,GAAG,QAAQ,kBAAkB,SAAS,OAAO,GAAG,OAAO,GAAG,KAAK;EACtG,IAAI,IAAI,IAAI;GAAE;GAAO;GAAQ;EAAM,CAAC;CACtC;CACA,OAAO;AACT;;;;AAKA,SAAgB,aACd,SACA,QACA,UACM;CACN,MAAM,EAAE,OAAO,OAAO;CACtB,MAAM,UAAU,qBAAqB,KAAK;CAC1C,KAAK,MAAM,MAAM,QAAQ,WAAW,KAAK,GAAG;EAC1C,MAAM,IAAI,SAAS,IAAI,EAAE;EACzB,IAAI,CAAC,GAAG;GACN,IAAI,QAAQ,OAAO,IAAI,EAAE,GAAG,OAAO,OAAO,EAAY;GACtD;EACF;EACA,MAAM,SAAS,MAAM,IAAI,EAAE,CAAC,EAAE,UAAU;EACxC,MAAM,OAAO,WAAW,EAAE,SACtB,EAAE,QACF,gBAAgB,SAAS,EAAE,OAAO,QAAQ,GAAG,SAAS,GAAG,SAAS;EACtE,OAAO,OAAO,IAAc,EAAE,KAAK,CAAC;CACtC;AACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { translatePoseViaDescriptor } from "../../../../core/geometry/poseDescriptor.js";
|
|
2
|
+
import { createTransformOp } from "../../../../core/ops/transform.js";
|
|
3
|
+
import { strategyView } from "../../../../core/scene/strategyView.js";
|
|
4
|
+
|
|
5
|
+
//#region src/interactions/actions/move/layout/view.ts
|
|
6
|
+
/** `pose`'s box as `g` measures it, and nothing else of it. */
|
|
7
|
+
function boxOf(g, pose) {
|
|
8
|
+
const b = g.getBounds(pose);
|
|
9
|
+
return {
|
|
10
|
+
x: b.x,
|
|
11
|
+
y: b.y,
|
|
12
|
+
width: b.width,
|
|
13
|
+
height: b.height
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** A container at world `pose` as its strategy's drag hooks see it: upright,
|
|
17
|
+
* the way the layout pass shows it to `childPoses`, `arrive` and `depart`. */
|
|
18
|
+
function containerView(pc, g, pose) {
|
|
19
|
+
return strategyView(pose, pc, (p) => boxOf(g, p), (p, from, to) => translatePoseViaDescriptor(p, to.x - from.x, to.y - from.y, g));
|
|
20
|
+
}
|
|
21
|
+
/** A dragged child's poses in `view`'s space. */
|
|
22
|
+
function draggedInView(view, arg) {
|
|
23
|
+
if (!view.turned) return arg;
|
|
24
|
+
return {
|
|
25
|
+
...arg,
|
|
26
|
+
originPose: view.toStrategy(arg.originPose),
|
|
27
|
+
pose: view.toStrategy(arg.pose)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** World `point` in `view`'s space, carried there as the center of `pose`
|
|
31
|
+
* (measured by `g`) moved onto it. */
|
|
32
|
+
function pointInView(view, g, pose, point) {
|
|
33
|
+
if (!view.turned) return point;
|
|
34
|
+
const b = g.getBounds(pose);
|
|
35
|
+
const moved = translatePoseViaDescriptor(pose, point.x - (b.x + b.width / 2), point.y - (b.y + b.height / 2), g);
|
|
36
|
+
const s = g.getBounds(view.toStrategy(moved));
|
|
37
|
+
return {
|
|
38
|
+
x: s.x + s.width / 2,
|
|
39
|
+
y: s.y + s.height / 2
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** A transform op a strategy answered in `view`'s space, in world. */
|
|
43
|
+
function opInWorld(view, op) {
|
|
44
|
+
if (!view.turned || op.name !== "transform") return op;
|
|
45
|
+
const a = op.args;
|
|
46
|
+
return createTransformOp({
|
|
47
|
+
...a,
|
|
48
|
+
from: view.toWorld(a.from),
|
|
49
|
+
to: view.toWorld(a.to)
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { boxOf, containerView, draggedInView, opInWorld, pointInView };
|
|
55
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","names":[],"sources":["../../../../../src/interactions/actions/move/layout/view.ts"],"sourcesContent":["import { translatePoseViaDescriptor, type PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { createTransformOp } from 'core/ops/transform';\nimport type { Op } from 'core/ops/types';\nimport type { PoseComposition } from 'core/scene/composePose';\nimport { strategyView, type StrategyView } from 'core/scene/strategyView';\nimport type { ContainerBounds, LayoutDragged } from '../../../../layout/types';\n\n/** `pose`'s box as `g` measures it, and nothing else of it. */\nexport function boxOf(g: PoseDescriptor<unknown>, pose: unknown): ContainerBounds {\n const b = g.getBounds(pose);\n return { x: b.x, y: b.y, width: b.width, height: b.height };\n}\n\n/** A container at world `pose` as its strategy's drag hooks see it: upright,\n * the way the layout pass shows it to `childPoses`, `arrive` and `depart`. */\nexport function containerView(\n pc: PoseComposition<unknown>, g: PoseDescriptor<unknown>, pose: unknown,\n): StrategyView<unknown> {\n return strategyView(\n pose,\n pc,\n (p) => boxOf(g, p),\n (p, from, to) => translatePoseViaDescriptor(p, to.x - from.x, to.y - from.y, g),\n )!;\n}\n\n/** A dragged child's poses in `view`'s space. */\nexport function draggedInView(view: StrategyView<unknown>, arg: LayoutDragged<unknown>): LayoutDragged<unknown> {\n if (!view.turned) return arg;\n return { ...arg, originPose: view.toStrategy(arg.originPose), pose: view.toStrategy(arg.pose) };\n}\n\n/** World `point` in `view`'s space, carried there as the center of `pose`\n * (measured by `g`) moved onto it. */\nexport function pointInView(\n view: StrategyView<unknown>, g: PoseDescriptor<unknown>, pose: unknown, point: { x: number; y: number },\n): { x: number; y: number } {\n if (!view.turned) return point;\n const b = g.getBounds(pose);\n const moved = translatePoseViaDescriptor(pose, point.x - (b.x + b.width / 2), point.y - (b.y + b.height / 2), g);\n const s = g.getBounds(view.toStrategy(moved));\n return { x: s.x + s.width / 2, y: s.y + s.height / 2 };\n}\n\n/** A transform op a strategy answered in `view`'s space, in world. */\nexport function opInWorld(view: StrategyView<unknown>, op: Op): Op {\n if (!view.turned || op.name !== 'transform') return op;\n const a = op.args as { id: string; from: unknown; to: unknown; label?: string; coalesceKey?: string };\n return createTransformOp<unknown>({ ...a, from: view.toWorld(a.from), to: view.toWorld(a.to) });\n}\n"],"mappings":";;;;;;AAQA,SAAgB,MAAM,GAA4B,MAAgC;CAChF,MAAM,IAAI,EAAE,UAAU,IAAI;CAC1B,OAAO;EAAE,GAAG,EAAE;EAAG,GAAG,EAAE;EAAG,OAAO,EAAE;EAAO,QAAQ,EAAE;CAAO;AAC5D;;;AAIA,SAAgB,cACd,IAA8B,GAA4B,MACnC;CACvB,OAAO,aACL,MACA,KACC,MAAM,MAAM,GAAG,CAAC,IAChB,GAAG,MAAM,OAAO,2BAA2B,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,CAAC,CAChF;AACF;;AAGA,SAAgB,cAAc,MAA6B,KAAqD;CAC9G,IAAI,CAAC,KAAK,QAAQ,OAAO;CACzB,OAAO;EAAE,GAAG;EAAK,YAAY,KAAK,WAAW,IAAI,UAAU;EAAG,MAAM,KAAK,WAAW,IAAI,IAAI;CAAE;AAChG;;;AAIA,SAAgB,YACd,MAA6B,GAA4B,MAAe,OAC9C;CAC1B,IAAI,CAAC,KAAK,QAAQ,OAAO;CACzB,MAAM,IAAI,EAAE,UAAU,IAAI;CAC1B,MAAM,QAAQ,2BAA2B,MAAM,MAAM,KAAK,EAAE,IAAI,EAAE,QAAQ,IAAI,MAAM,KAAK,EAAE,IAAI,EAAE,SAAS,IAAI,CAAC;CAC/G,MAAM,IAAI,EAAE,UAAU,KAAK,WAAW,KAAK,CAAC;CAC5C,OAAO;EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ;EAAG,GAAG,EAAE,IAAI,EAAE,SAAS;CAAE;AACvD;;AAGA,SAAgB,UAAU,MAA6B,IAAY;CACjE,IAAI,CAAC,KAAK,UAAU,GAAG,SAAS,aAAa,OAAO;CACpD,MAAM,IAAI,GAAG;CACb,OAAO,kBAA2B;EAAE,GAAG;EAAG,MAAM,KAAK,QAAQ,EAAE,IAAI;EAAG,IAAI,KAAK,QAAQ,EAAE,EAAE;CAAE,CAAC;AAChG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { composeWorldPose } from "../../../core/scene/composeFrame.js";
|
|
2
|
+
import { poseDescriptorForNode } from "../../../core/geometry/poseDescriptor.js";
|
|
3
|
+
import { sceneViewPoseAdapter } from "../../../core/scene/scenePoseAdapter.js";
|
|
4
|
+
|
|
5
|
+
//#region src/interactions/actions/move/refusal.ts
|
|
6
|
+
/** What a move draws over a refusal: the container's outline, refused, and the reason at the pointer. */
|
|
7
|
+
function refusalOverlays(refusal, pointer) {
|
|
8
|
+
const { x, y, width, height } = refusal.bounds;
|
|
9
|
+
return [{
|
|
10
|
+
kind: "polyline",
|
|
11
|
+
points: [
|
|
12
|
+
{
|
|
13
|
+
x,
|
|
14
|
+
y
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
x: x + width,
|
|
18
|
+
y
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
x: x + width,
|
|
22
|
+
y: y + height
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
x,
|
|
26
|
+
y: y + height
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
x,
|
|
30
|
+
y
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
role: "refused"
|
|
34
|
+
}, {
|
|
35
|
+
kind: "reason",
|
|
36
|
+
at: {
|
|
37
|
+
x: pointer.x,
|
|
38
|
+
y: pointer.y
|
|
39
|
+
},
|
|
40
|
+
text: refusal.reason
|
|
41
|
+
}];
|
|
42
|
+
}
|
|
43
|
+
/** `id`'s world bounds, as the move measures them. */
|
|
44
|
+
function worldBoundsOf(session, id) {
|
|
45
|
+
const node = session.scene.get(id);
|
|
46
|
+
const pose = composeWorldPose(sceneViewPoseAdapter(session.scene), id, session.pc.compose);
|
|
47
|
+
return poseDescriptorForNode(session.projection, node).getBounds(pose);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { refusalOverlays, worldBoundsOf };
|
|
52
|
+
//# sourceMappingURL=refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal.js","names":[],"sources":["../../../../src/interactions/actions/move/refusal.ts"],"sourcesContent":["import type { OngoingOverlay } from '@weasel-js/routing';\nimport { poseDescriptorForNode } from 'core/geometry/poseDescriptor';\nimport { composeWorldPose } from 'core/scene/composePose';\nimport { sceneViewPoseAdapter } from 'core/scene/scenePoseAdapter';\nimport type { NodeId } from 'core/scene/types';\nimport type { Bounds4 } from './layout/container';\nimport type { MoveSession } from './session';\n\n/** A container the dragged roots are over and may not land in, and the reason it gives. */\nexport interface MoveRefusal {\n id: NodeId;\n /** Its world bounds. */\n bounds: Bounds4;\n reason: string;\n}\n\n/** What a move draws over a refusal: the container's outline, refused, and the reason at the pointer. */\nexport function refusalOverlays(refusal: MoveRefusal, pointer: { x: number; y: number }): OngoingOverlay[] {\n const { x, y, width, height } = refusal.bounds;\n const points = [{ x, y }, { x: x + width, y }, { x: x + width, y: y + height }, { x, y: y + height }, { x, y }];\n return [\n { kind: 'polyline', points, role: 'refused' },\n { kind: 'reason', at: { x: pointer.x, y: pointer.y }, text: refusal.reason },\n ];\n}\n\n/** `id`'s world bounds, as the move measures them. */\nexport function worldBoundsOf(session: MoveSession, id: NodeId): Bounds4 {\n const node = session.scene.get(id)!;\n const pose = composeWorldPose(sceneViewPoseAdapter(session.scene), id as string, session.pc.compose);\n return poseDescriptorForNode(session.projection, node).getBounds(pose);\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,gBAAgB,SAAsB,SAAqD;CACzG,MAAM,EAAE,GAAG,GAAG,OAAO,WAAW,QAAQ;CAExC,OAAO,CACL;EAAE,MAAM;EAAY;GAFN;IAAE;IAAG;GAAE;GAAG;IAAE,GAAG,IAAI;IAAO;GAAE;GAAG;IAAE,GAAG,IAAI;IAAO,GAAG,IAAI;GAAO;GAAG;IAAE;IAAG,GAAG,IAAI;GAAO;GAAG;IAAE;IAAG;GAAE;EAEvF;EAAQ,MAAM;CAAU,GAC5C;EAAE,MAAM;EAAU,IAAI;GAAE,GAAG,QAAQ;GAAG,GAAG,QAAQ;EAAE;EAAG,MAAM,QAAQ;CAAO,CAC7E;AACF;;AAGA,SAAgB,cAAc,SAAsB,IAAqB;CACvE,MAAM,OAAO,QAAQ,MAAM,IAAI,EAAE;CACjC,MAAM,OAAO,iBAAiB,qBAAqB,QAAQ,KAAK,GAAG,IAAc,QAAQ,GAAG,OAAO;CACnG,OAAO,sBAAsB,QAAQ,YAAY,IAAI,CAAC,CAAC,UAAU,IAAI;AACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { childVerdict } from "../admitsChild.js";
|
|
2
2
|
import { nodeDescriptors, poseDescriptorOf } from "../poseDescriptorDep.js";
|
|
3
3
|
import { transformFinisher } from "../transformFinish.js";
|
|
4
4
|
import { commitGestureOps, readGestureLifecycle } from "../gestureLifecycle.js";
|
|
@@ -8,13 +8,13 @@ import { layoutDrop } from "./behaviors/layoutDrop.js";
|
|
|
8
8
|
import { reparentOnDrop } from "./behaviors/reparentOnDrop.js";
|
|
9
9
|
import { buildGestureContext, captureFrames, capturePlaneRefs, captureStartPoses } from "./capture.js";
|
|
10
10
|
import { moveGestureAdapter } from "./gestureAdapter.js";
|
|
11
|
-
import { lazySnapSession } from "../../../
|
|
12
|
-
import {
|
|
11
|
+
import { lazySnapSession } from "../../../domains/snap/lazySession.js";
|
|
12
|
+
import { isPathEditPart, resolveParams } from "@weasel-js/routing";
|
|
13
13
|
|
|
14
14
|
//#region src/interactions/actions/move/session.ts
|
|
15
|
-
function
|
|
15
|
+
function verdictOf(canDropInto, ids, scene) {
|
|
16
16
|
const roots = ids;
|
|
17
|
-
return (parent) =>
|
|
17
|
+
return (parent) => childVerdict(scene, parent, roots, canDropInto);
|
|
18
18
|
}
|
|
19
19
|
/** Capture a drag at press. Null when there is nothing to move. Runs each
|
|
20
20
|
* behavior's `onStart`. `frame` reads the drag's latest frame, for the
|
|
@@ -47,7 +47,6 @@ function beginMove(ctx, opts, frame) {
|
|
|
47
47
|
...layout ? [layoutDrop(gesture)] : [],
|
|
48
48
|
reparentOnDrop(gesture)
|
|
49
49
|
];
|
|
50
|
-
const dragThresholdPx = params?.["dragThresholdPx"] ?? ctx.deps.kitSettings?.get("gestures.dragPx") ?? DRAG_THRESHOLD_PX;
|
|
51
50
|
const lifecycle = readGestureLifecycle(params, "Move", behaviors);
|
|
52
51
|
const adapter = moveGestureAdapter(scene, (ops, _label, through) => commitGestureOps({
|
|
53
52
|
scene,
|
|
@@ -59,6 +58,7 @@ function beginMove(ctx, opts, frame) {
|
|
|
59
58
|
const gestureCtx = buildGestureContext(ctx, scene, ids, startPoses, adapter, readers);
|
|
60
59
|
for (const b of behaviors) b.onStart?.(gestureCtx);
|
|
61
60
|
const press = ctx.drag?.start ?? ctx.world;
|
|
61
|
+
const verdict = verdictOf(ctx.deps.canDropInto, ids, scene);
|
|
62
62
|
const session = {
|
|
63
63
|
startPoses,
|
|
64
64
|
ids,
|
|
@@ -81,9 +81,10 @@ function beginMove(ctx, opts, frame) {
|
|
|
81
81
|
geometryProjection,
|
|
82
82
|
lifecycle,
|
|
83
83
|
nodeAtPoint: ctx.deps.nodeAtPoint,
|
|
84
|
-
|
|
84
|
+
verdict,
|
|
85
|
+
admits: (parent) => verdict(parent) === true,
|
|
86
|
+
mayRefuse: ctx.deps.canDropInto !== void 0,
|
|
85
87
|
reparentOnDrop: () => resolveParams(opts?.params)?.["reparentOnDrop"] ?? "off",
|
|
86
|
-
dragThresholdPx,
|
|
87
88
|
snap: lazySnapSession(ctx.deps.snap, {
|
|
88
89
|
gesture: "move",
|
|
89
90
|
ids,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","names":[],"sources":["../../../../src/interactions/actions/move/session.ts"],"sourcesContent":["import type { BindingOpts, InvocationCtx } from '@weasel-js/routing';\nimport { DRAG_THRESHOLD_PX, isPathEditPart, resolveParams } from '@weasel-js/routing';\nimport type { Op } from 'core/ops/types';\nimport type { NodeId, Scene } from 'core/scene/types';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport type { PoseComposition } from 'core/scene/composePose';\nimport { gestureReaders, type GestureReaders } from '../../gestures/shared/screenTolerance';\nimport type { GestureContext, MoveBehavior } from '../../gestures/types';\nimport type { CanDropIntoDep, LayoutDep, NodeAtPointDep } from '../depSchema';\nimport { admitsChild } from '../admitsChild';\nimport type { GeometryProjection } from '../geometryProjection';\nimport { commitGestureOps, readGestureLifecycle, type GestureLifecycle } from '../gestureLifecycle';\nimport { transformFinisher, type TransformFinisher } from '../transformFinish';\nimport { nodeDescriptors, poseDescriptorOf } from '../poseDescriptorDep';\nimport { moveSources } from '../selectionSubtree';\nimport { layoutDrop } from './behaviors/layoutDrop';\nimport { reparentOnDrop } from './behaviors/reparentOnDrop';\nimport { buildGestureContext, captureFrames, capturePlaneRefs, captureStartPoses } from './capture';\nimport { moveGestureAdapter, type MoveGestureAdapter } from './gestureAdapter';\nimport type { SnapSession } from '../snapDep';\nimport { lazySnapSession } from 'features/snap/lazySession';\n\n/** Allowed values for the `reparentOnDrop` binding param. `'off'` (the\n * default) preserves the legacy translate-only commit. `'top'` lands the\n * moved node at the top of the container under the cursor. `'above'`\n * lands it immediately above the hit sibling in z-order (falls back to\n * `'top'` semantics when the hit is itself a container or when the hit\n * and moved node share no parent). */\nexport type ReparentOnDrop = 'off' | 'top' | 'above';\n\n/** What a move captured at press. Nothing here changes during the drag. */\nexport interface MoveSession {\n readonly scene: Scene<unknown, string, unknown>;\n /** The drag roots. */\n readonly ids: readonly NodeId[];\n /** Descendants of the roots, previewed along with them. */\n readonly cascadeIds: readonly NodeId[];\n /** Start pose of every root and descendant. */\n readonly startPoses: ReadonlyMap<NodeId, unknown>;\n /** Ids whose frame is itself moving, so they ride it and are not translated. */\n readonly carried: ReadonlySet<NodeId>;\n /** For each moved id stored under a frame: its world pose and the frame's, at press. */\n readonly frames: ReadonlyMap<NodeId, { world: unknown; frameWorld: unknown }>;\n /** Ids grabbed mid-glide, with how far the pose shown stood from the document's. */\n readonly caught: ReadonlyMap<NodeId, { dx: number; dy: number }>;\n /** Per layer on another plane than the edited one: a point of its first root, in both. */\n readonly planeRefs: ReadonlyMap<string, { own: { x: number; y: number }; edited: { x: number; y: number } }>;\n readonly view: unknown;\n readonly projection: PoseDescriptor<unknown>;\n readonly descriptorOf: (id: NodeId | string) => PoseDescriptor<unknown>;\n readonly pc: PoseComposition<unknown>;\n /** The binding's behaviors, then the ones the action adds: a layout drop\n * when the `layout` dep is present, and reparent-on-drop. */\n readonly behaviors: readonly MoveBehavior<unknown>[];\n /** Reused across the drag; behaviors mutate its `scratch`. */\n readonly gestureCtx: GestureContext<unknown>;\n readonly adapter: MoveGestureAdapter<unknown>;\n readonly layout: LayoutDep | undefined;\n readonly applyOps?: (ops: Op[], label: string) => void;\n /** Finishes the committed batch with the other nodes that change with it. */\n readonly finish?: TransformFinisher;\n readonly geometryProjection?: GeometryProjection;\n readonly lifecycle: GestureLifecycle;\n readonly nodeAtPoint: NodeAtPointDep | undefined;\n /** Whether a node admits the dragged roots; with no `canDropInto`, a group does and a mark does not. */\n readonly admits: (parent: NodeId) => boolean;\n /** Read at release: a binding's params may be a thunk. */\n readonly reparentOnDrop: () => ReparentOnDrop;\n readonly dragThresholdPx: number;\n /** The drag's snapping, begun once the drag passes its threshold; null\n * with no `snap` dep. */\n readonly snap: SnapSession | null;\n /** The press, in the coordinates the drag's delta is measured in. */\n readonly press: { x: number; y: number };\n}\n\n/** What one `onMove` produced. Replaced, not mutated, by the next. */\nexport interface MoveFrame {\n readonly delta: { dx: number; dy: number };\n /** Stored-frame pose of every displaced id, roots and descendants, and of\n * any other id a behavior posed. */\n readonly previews: Map<NodeId, unknown>;\n /** Ids the behaviors asked to have painted at full opacity. */\n readonly opaque: ReadonlySet<NodeId>;\n}\n\n/** What the behaviors the action builds itself read of the drag they belong\n * to. Neither is readable from `onStart`, which runs before the session\n * exists. */\nexport interface MoveGesture {\n session(): MoveSession;\n /** The latest frame: the previous one while an `onMove` is running. */\n frame(): MoveFrame;\n}\n\nfunction admitsOf(\n canDropInto: CanDropIntoDep | undefined,\n ids: readonly NodeId[],\n scene: { get(id: NodeId): { kind: string } | undefined },\n): (parent: NodeId) => boolean {\n const roots = ids as readonly string[];\n return (parent) => admitsChild(scene, parent, roots, canDropInto);\n}\n\n/** Capture a drag at press. Null when there is nothing to move. Runs each\n * behavior's `onStart`. `frame` reads the drag's latest frame, for the\n * behaviors appended to the binding's own. */\nexport function beginMove(\n ctx: InvocationCtx,\n opts: BindingOpts | undefined,\n frame: () => MoveFrame,\n): { session: MoveSession; readers: GestureReaders } | null {\n const selection = ctx.deps.selection;\n const scene = ctx.deps.scene;\n const projection = poseDescriptorOf(ctx.deps.poseDescriptor);\n const layout = ctx.deps.layout;\n const applyOps = ctx.deps.applyOps;\n const geometryProjection = ctx.deps.geometryProjection;\n const finish = transformFinisher(ctx.deps);\n\n if (!selection || !scene) return null;\n const pc = scene.composition;\n // Anchors, segments, and balance grips sit on the selected body, and this binding ties the\n // path-edit drags' on specificity; with no mode registry to filter move out, declining is what\n // lets them through.\n if (isPathEditPart(ctx.drag?.affordance)) return null;\n\n const params = resolveParams(opts?.params);\n const expandIds = params?.['expandIds'] as ((ids: string[]) => string[]) | undefined;\n const selected = [...selection.get()] as string[];\n const ids = moveSources(scene, expandIds ? expandIds(selected) : selected) as NodeId[];\n if (ids.length === 0) return null;\n\n const reflow = layout?.reflow ?? null;\n const { startPoses, cascadeIds, caught } = captureStartPoses(scene, ids, reflow, projection);\n const { carried, frames } = captureFrames(scene, ids, startPoses);\n\n // Everything a move does beyond translating is a behavior: the binding's\n // own, then the layout drop, then reparent-on-drop. On release the first to\n // answer owns the commit, so each preempts the ones after it.\n const gesture: MoveGesture = { session: () => session, frame };\n const behaviors: MoveBehavior<unknown>[] = [\n ...((opts?.behaviors ?? []) as MoveBehavior<unknown>[]),\n ...(layout ? [layoutDrop(gesture)] : []),\n reparentOnDrop(gesture),\n ];\n const dragThresholdPx = (params?.['dragThresholdPx'] as number | undefined)\n ?? ctx.deps.kitSettings?.get('gestures.dragPx') ?? DRAG_THRESHOLD_PX;\n const lifecycle = readGestureLifecycle(params, 'Move', behaviors);\n // A behavior that commits after the gesture has ended, a coast coming to\n // rest, lands its batch the way the gesture's own commit does.\n const adapter = moveGestureAdapter<unknown>(scene, (ops, _label, through) =>\n commitGestureOps({ scene, applyOps, adapter: through, finish }, lifecycle, ops), selection.adapterMethods);\n const readers = gestureReaders(ctx.deps);\n const gestureCtx = buildGestureContext(ctx, scene, ids, startPoses, adapter, readers);\n for (const b of behaviors) b.onStart?.(gestureCtx);\n\n const press = ctx.drag?.start ?? ctx.world;\n const session: MoveSession = {\n startPoses,\n ids,\n cascadeIds,\n carried,\n frames,\n scene,\n view: ctx.deps.view,\n planeRefs: capturePlaneRefs(scene, ids, ctx.deps.view, frames, startPoses, projection),\n caught,\n projection,\n descriptorOf: nodeDescriptors(scene, projection),\n behaviors,\n gestureCtx,\n adapter,\n layout,\n pc,\n applyOps,\n finish,\n geometryProjection,\n lifecycle,\n nodeAtPoint: ctx.deps.nodeAtPoint,\n admits: admitsOf(ctx.deps.canDropInto, ids, scene),\n reparentOnDrop: () => (resolveParams(opts?.params)?.['reparentOnDrop'] as ReparentOnDrop | undefined) ?? 'off',\n dragThresholdPx,\n snap: lazySnapSession(ctx.deps.snap, { gesture: 'move', ids, press, constrain: 'axis' }),\n press,\n };\n return { session, readers };\n}\n"],"mappings":";;;;;;;;;;;;;;AA+FA,SAAS,SACP,aACA,KACA,OAC6B;CAC7B,MAAM,QAAQ;CACd,QAAQ,WAAW,YAAY,OAAO,QAAQ,OAAO,WAAW;AAClE;;;;AAKA,SAAgB,UACd,KACA,MACA,OAC0D;CAC1D,MAAM,YAAY,IAAI,KAAK;CAC3B,MAAM,QAAQ,IAAI,KAAK;CACvB,MAAM,aAAa,iBAAiB,IAAI,KAAK,cAAc;CAC3D,MAAM,SAAS,IAAI,KAAK;CACxB,MAAM,WAAW,IAAI,KAAK;CAC1B,MAAM,qBAAqB,IAAI,KAAK;CACpC,MAAM,SAAS,kBAAkB,IAAI,IAAI;CAEzC,IAAI,CAAC,aAAa,CAAC,OAAO,OAAO;CACjC,MAAM,KAAK,MAAM;CAIjB,IAAI,eAAe,IAAI,MAAM,UAAU,GAAG,OAAO;CAEjD,MAAM,SAAS,cAAc,MAAM,MAAM;CACzC,MAAM,YAAY,SAAS;CAC3B,MAAM,WAAW,CAAC,GAAG,UAAU,IAAI,CAAC;CACpC,MAAM,MAAM,YAAY,OAAO,YAAY,UAAU,QAAQ,IAAI,QAAQ;CACzE,IAAI,IAAI,WAAW,GAAG,OAAO;CAE7B,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,EAAE,YAAY,YAAY,WAAW,kBAAkB,OAAO,KAAK,QAAQ,UAAU;CAC3F,MAAM,EAAE,SAAS,WAAW,cAAc,OAAO,KAAK,UAAU;CAKhE,MAAM,UAAuB;EAAE,eAAe;EAAS;CAAM;CAC7D,MAAM,YAAqC;EACzC,GAAK,MAAM,aAAa,CAAC;EACzB,GAAI,SAAS,CAAC,WAAW,OAAO,CAAC,IAAI,CAAC;EACtC,eAAe,OAAO;CACxB;CACA,MAAM,kBAAmB,SAAS,sBAC7B,IAAI,KAAK,aAAa,IAAI,iBAAiB,KAAK;CACrD,MAAM,YAAY,qBAAqB,QAAQ,QAAQ,SAAS;CAGhE,MAAM,UAAU,mBAA4B,QAAQ,KAAK,QAAQ,YAC/D,iBAAiB;EAAE;EAAO;EAAU,SAAS;EAAS;CAAO,GAAG,WAAW,GAAG,GAAG,UAAU,cAAc;CAC3G,MAAM,UAAU,eAAe,IAAI,IAAI;CACvC,MAAM,aAAa,oBAAoB,KAAK,OAAO,KAAK,YAAY,SAAS,OAAO;CACpF,KAAK,MAAM,KAAK,WAAW,EAAE,UAAU,UAAU;CAEjD,MAAM,QAAQ,IAAI,MAAM,SAAS,IAAI;CACrC,MAAM,UAAuB;EAC3B;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,IAAI,KAAK;EACf,WAAW,iBAAiB,OAAO,KAAK,IAAI,KAAK,MAAM,QAAQ,YAAY,UAAU;EACrF;EACA;EACA,cAAc,gBAAgB,OAAO,UAAU;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,IAAI,KAAK;EACtB,QAAQ,SAAS,IAAI,KAAK,aAAa,KAAK,KAAK;EACjD,sBAAuB,cAAc,MAAM,MAAM,CAAC,GAAG,qBAAoD;EACzG;EACA,MAAM,gBAAgB,IAAI,KAAK,MAAM;GAAE,SAAS;GAAQ;GAAK;GAAO,WAAW;EAAO,CAAC;EACvF;CACF;CACA,OAAO;EAAE;EAAS;CAAQ;AAC5B"}
|
|
1
|
+
{"version":3,"file":"session.js","names":[],"sources":["../../../../src/interactions/actions/move/session.ts"],"sourcesContent":["import type { BindingOpts, InvocationCtx, OngoingOverlay } from '@weasel-js/routing';\nimport { isPathEditPart, resolveParams } from '@weasel-js/routing';\nimport type { Op } from 'core/ops/types';\nimport type { NodeId, Scene } from 'core/scene/types';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport type { PoseComposition } from 'core/scene/composePose';\nimport { gestureReaders, type GestureReaders } from '../../gestures/shared/screenTolerance';\nimport type { GestureContext, MoveBehavior } from '../../gestures/types';\nimport type { CanDropIntoDep, LayoutDep, NodeAtPointDep } from '../depSchema';\nimport { childVerdict } from '../admitsChild';\nimport type { DropVerdict } from '../dropVerdict';\nimport type { GeometryProjection } from '../geometryProjection';\nimport { commitGestureOps, readGestureLifecycle, type GestureLifecycle } from '../gestureLifecycle';\nimport { transformFinisher, type TransformFinisher } from '../transformFinish';\nimport { nodeDescriptors, poseDescriptorOf } from '../poseDescriptorDep';\nimport { moveSources } from '../selectionSubtree';\nimport { layoutDrop } from './behaviors/layoutDrop';\nimport { reparentOnDrop } from './behaviors/reparentOnDrop';\nimport { buildGestureContext, captureFrames, capturePlaneRefs, captureStartPoses } from './capture';\nimport { moveGestureAdapter, type MoveGestureAdapter } from './gestureAdapter';\nimport type { SnapSession } from '../snapDep';\nimport { lazySnapSession } from 'domains/snap/lazySession';\n\n/** Allowed values for the `reparentOnDrop` binding param. `'off'` (the\n * default) preserves the legacy translate-only commit. `'top'` lands the\n * moved node at the top of the container under the cursor. `'above'`\n * lands it immediately above the hit sibling in z-order (falls back to\n * `'top'` semantics when the hit is itself a container or when the hit\n * and moved node share no parent). */\nexport type ReparentOnDrop = 'off' | 'top' | 'above';\n\n/** What a move captured at press. Nothing here changes during the drag. */\nexport interface MoveSession {\n readonly scene: Scene<unknown, string, unknown>;\n /** The drag roots. */\n readonly ids: readonly NodeId[];\n /** Descendants of the roots, previewed along with them. */\n readonly cascadeIds: readonly NodeId[];\n /** Start pose of every root and descendant. */\n readonly startPoses: ReadonlyMap<NodeId, unknown>;\n /** Ids whose frame is itself moving, so they ride it and are not translated. */\n readonly carried: ReadonlySet<NodeId>;\n /** For each moved id stored under a frame: its world pose and the frame's, at press. */\n readonly frames: ReadonlyMap<NodeId, { world: unknown; frameWorld: unknown }>;\n /** Ids grabbed mid-glide, with how far the pose shown stood from the document's. */\n readonly caught: ReadonlyMap<NodeId, { dx: number; dy: number }>;\n /** Per layer on another plane than the edited one: a point of its first root, in both. */\n readonly planeRefs: ReadonlyMap<string, { own: { x: number; y: number }; edited: { x: number; y: number } }>;\n readonly view: unknown;\n readonly projection: PoseDescriptor<unknown>;\n readonly descriptorOf: (id: NodeId | string) => PoseDescriptor<unknown>;\n readonly pc: PoseComposition<unknown>;\n /** The binding's behaviors, then the ones the action adds: a layout drop\n * when the `layout` dep is present, and reparent-on-drop. */\n readonly behaviors: readonly MoveBehavior<unknown>[];\n /** Reused across the drag; behaviors mutate its `scratch`. */\n readonly gestureCtx: GestureContext<unknown>;\n readonly adapter: MoveGestureAdapter<unknown>;\n readonly layout: LayoutDep | undefined;\n readonly applyOps?: (ops: Op[], label: string) => void;\n /** Finishes the committed batch with the other nodes that change with it. */\n readonly finish?: TransformFinisher;\n readonly geometryProjection?: GeometryProjection;\n readonly lifecycle: GestureLifecycle;\n readonly nodeAtPoint: NodeAtPointDep | undefined;\n /** Whether a node takes the dragged roots; with no `canDropInto`, a group does and a mark does not. */\n readonly verdict: (parent: NodeId) => DropVerdict;\n /** Whether {@link verdict} lets them land. */\n readonly admits: (parent: NodeId) => boolean;\n /** Whether a `canDropInto` dep is there to refuse with a reason. */\n readonly mayRefuse: boolean;\n /** Read at release: a binding's params may be a thunk. */\n readonly reparentOnDrop: () => ReparentOnDrop;\n /** The drag's snapping, begun once the drag passes its threshold; null\n * with no `snap` dep. */\n readonly snap: SnapSession | null;\n /** The press, in the coordinates the drag's delta is measured in. */\n readonly press: { x: number; y: number };\n}\n\n/** What one `onMove` produced. Replaced, not mutated, by the next. */\nexport interface MoveFrame {\n readonly delta: { dx: number; dy: number };\n /** Stored-frame pose of every displaced id, roots and descendants, and of\n * any other id a behavior posed. */\n readonly previews: Map<NodeId, unknown>;\n /** Ids the behaviors asked to have painted at full opacity. */\n readonly opaque: ReadonlySet<NodeId>;\n /** What the behaviors asked to have painted beside the drag. */\n readonly overlays: readonly OngoingOverlay[];\n}\n\n/** What the behaviors the action builds itself read of the drag they belong\n * to. Neither is readable from `onStart`, which runs before the session\n * exists. */\nexport interface MoveGesture {\n session(): MoveSession;\n /** The latest frame: the previous one while an `onMove` is running. */\n frame(): MoveFrame;\n}\n\nfunction verdictOf(\n canDropInto: CanDropIntoDep | undefined,\n ids: readonly NodeId[],\n scene: { get(id: NodeId): { kind: string } | undefined },\n): (parent: NodeId) => DropVerdict {\n const roots = ids as readonly string[];\n return (parent) => childVerdict(scene, parent, roots, canDropInto);\n}\n\n/** Capture a drag at press. Null when there is nothing to move. Runs each\n * behavior's `onStart`. `frame` reads the drag's latest frame, for the\n * behaviors appended to the binding's own. */\nexport function beginMove(\n ctx: InvocationCtx,\n opts: BindingOpts | undefined,\n frame: () => MoveFrame,\n): { session: MoveSession; readers: GestureReaders } | null {\n const selection = ctx.deps.selection;\n const scene = ctx.deps.scene;\n const projection = poseDescriptorOf(ctx.deps.poseDescriptor);\n const layout = ctx.deps.layout;\n const applyOps = ctx.deps.applyOps;\n const geometryProjection = ctx.deps.geometryProjection;\n const finish = transformFinisher(ctx.deps);\n\n if (!selection || !scene) return null;\n const pc = scene.composition;\n // Anchors, segments, and balance grips sit on the selected body, and this binding ties the\n // path-edit drags' on specificity; with no mode registry to filter move out, declining is what\n // lets them through.\n if (isPathEditPart(ctx.drag?.affordance)) return null;\n\n const params = resolveParams(opts?.params);\n const expandIds = params?.['expandIds'] as ((ids: string[]) => string[]) | undefined;\n const selected = [...selection.get()] as string[];\n const ids = moveSources(scene, expandIds ? expandIds(selected) : selected) as NodeId[];\n if (ids.length === 0) return null;\n\n const reflow = layout?.reflow ?? null;\n const { startPoses, cascadeIds, caught } = captureStartPoses(scene, ids, reflow, projection);\n const { carried, frames } = captureFrames(scene, ids, startPoses);\n\n // Everything a move does beyond translating is a behavior: the binding's\n // own, then the layout drop, then reparent-on-drop. On release the first to\n // answer owns the commit, so each preempts the ones after it.\n const gesture: MoveGesture = { session: () => session, frame };\n const behaviors: MoveBehavior<unknown>[] = [\n ...((opts?.behaviors ?? []) as MoveBehavior<unknown>[]),\n ...(layout ? [layoutDrop(gesture)] : []),\n reparentOnDrop(gesture),\n ];\n const lifecycle = readGestureLifecycle(params, 'Move', behaviors);\n // A behavior that commits after the gesture has ended, a coast coming to\n // rest, lands its batch the way the gesture's own commit does.\n const adapter = moveGestureAdapter<unknown>(scene, (ops, _label, through) =>\n commitGestureOps({ scene, applyOps, adapter: through, finish }, lifecycle, ops), selection.adapterMethods);\n const readers = gestureReaders(ctx.deps);\n const gestureCtx = buildGestureContext(ctx, scene, ids, startPoses, adapter, readers);\n for (const b of behaviors) b.onStart?.(gestureCtx);\n\n const press = ctx.drag?.start ?? ctx.world;\n const verdict = verdictOf(ctx.deps.canDropInto, ids, scene);\n const session: MoveSession = {\n startPoses,\n ids,\n cascadeIds,\n carried,\n frames,\n scene,\n view: ctx.deps.view,\n planeRefs: capturePlaneRefs(scene, ids, ctx.deps.view, frames, startPoses, projection),\n caught,\n projection,\n descriptorOf: nodeDescriptors(scene, projection),\n behaviors,\n gestureCtx,\n adapter,\n layout,\n pc,\n applyOps,\n finish,\n geometryProjection,\n lifecycle,\n nodeAtPoint: ctx.deps.nodeAtPoint,\n verdict,\n admits: (parent) => verdict(parent) === true,\n mayRefuse: ctx.deps.canDropInto !== undefined,\n reparentOnDrop: () => (resolveParams(opts?.params)?.['reparentOnDrop'] as ReparentOnDrop | undefined) ?? 'off',\n snap: lazySnapSession(ctx.deps.snap, { gesture: 'move', ids, press, constrain: 'axis' }),\n press,\n };\n return { session, readers };\n}\n"],"mappings":";;;;;;;;;;;;;;AAqGA,SAAS,UACP,aACA,KACA,OACiC;CACjC,MAAM,QAAQ;CACd,QAAQ,WAAW,aAAa,OAAO,QAAQ,OAAO,WAAW;AACnE;;;;AAKA,SAAgB,UACd,KACA,MACA,OAC0D;CAC1D,MAAM,YAAY,IAAI,KAAK;CAC3B,MAAM,QAAQ,IAAI,KAAK;CACvB,MAAM,aAAa,iBAAiB,IAAI,KAAK,cAAc;CAC3D,MAAM,SAAS,IAAI,KAAK;CACxB,MAAM,WAAW,IAAI,KAAK;CAC1B,MAAM,qBAAqB,IAAI,KAAK;CACpC,MAAM,SAAS,kBAAkB,IAAI,IAAI;CAEzC,IAAI,CAAC,aAAa,CAAC,OAAO,OAAO;CACjC,MAAM,KAAK,MAAM;CAIjB,IAAI,eAAe,IAAI,MAAM,UAAU,GAAG,OAAO;CAEjD,MAAM,SAAS,cAAc,MAAM,MAAM;CACzC,MAAM,YAAY,SAAS;CAC3B,MAAM,WAAW,CAAC,GAAG,UAAU,IAAI,CAAC;CACpC,MAAM,MAAM,YAAY,OAAO,YAAY,UAAU,QAAQ,IAAI,QAAQ;CACzE,IAAI,IAAI,WAAW,GAAG,OAAO;CAE7B,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,EAAE,YAAY,YAAY,WAAW,kBAAkB,OAAO,KAAK,QAAQ,UAAU;CAC3F,MAAM,EAAE,SAAS,WAAW,cAAc,OAAO,KAAK,UAAU;CAKhE,MAAM,UAAuB;EAAE,eAAe;EAAS;CAAM;CAC7D,MAAM,YAAqC;EACzC,GAAK,MAAM,aAAa,CAAC;EACzB,GAAI,SAAS,CAAC,WAAW,OAAO,CAAC,IAAI,CAAC;EACtC,eAAe,OAAO;CACxB;CACA,MAAM,YAAY,qBAAqB,QAAQ,QAAQ,SAAS;CAGhE,MAAM,UAAU,mBAA4B,QAAQ,KAAK,QAAQ,YAC/D,iBAAiB;EAAE;EAAO;EAAU,SAAS;EAAS;CAAO,GAAG,WAAW,GAAG,GAAG,UAAU,cAAc;CAC3G,MAAM,UAAU,eAAe,IAAI,IAAI;CACvC,MAAM,aAAa,oBAAoB,KAAK,OAAO,KAAK,YAAY,SAAS,OAAO;CACpF,KAAK,MAAM,KAAK,WAAW,EAAE,UAAU,UAAU;CAEjD,MAAM,QAAQ,IAAI,MAAM,SAAS,IAAI;CACrC,MAAM,UAAU,UAAU,IAAI,KAAK,aAAa,KAAK,KAAK;CAC1D,MAAM,UAAuB;EAC3B;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,IAAI,KAAK;EACf,WAAW,iBAAiB,OAAO,KAAK,IAAI,KAAK,MAAM,QAAQ,YAAY,UAAU;EACrF;EACA;EACA,cAAc,gBAAgB,OAAO,UAAU;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,IAAI,KAAK;EACtB;EACA,SAAS,WAAW,QAAQ,MAAM,MAAM;EACxC,WAAW,IAAI,KAAK,gBAAgB;EACpC,sBAAuB,cAAc,MAAM,MAAM,CAAC,GAAG,qBAAoD;EACzG,MAAM,gBAAgB,IAAI,KAAK,MAAM;GAAE,SAAS;GAAQ;GAAK;GAAO,WAAW;EAAO,CAAC;EACvF;CACF;CACA,OAAO;EAAE;EAAS;CAAQ;AAC5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { localDelta } from "./delta.js";
|
|
1
|
+
import { localDelta, storedLeadFor } from "./delta.js";
|
|
2
2
|
import { translateNodeOps } from "../moveNodes.js";
|
|
3
3
|
|
|
4
4
|
//#region src/interactions/actions/move/translate.ts
|
|
@@ -6,12 +6,18 @@ import { translateNodeOps } from "../moveNodes.js";
|
|
|
6
6
|
* geometry op when the `geometryProjection` seam is wired. */
|
|
7
7
|
function translateOps(session, ids, delta) {
|
|
8
8
|
return translateNodeOps(session.scene, ids, (id) => {
|
|
9
|
-
if (!session.startPoses.has(id)
|
|
10
|
-
const l = localDelta(session, id, delta.dx, delta.dy);
|
|
9
|
+
if (!session.startPoses.has(id)) return null;
|
|
11
10
|
const c = session.caught.get(id);
|
|
12
|
-
return c
|
|
11
|
+
if (session.carried.has(id)) return c ?? null;
|
|
12
|
+
const l = localDelta(session, id, delta.dx, delta.dy);
|
|
13
|
+
if (c) return {
|
|
13
14
|
dx: l.dx + c.dx,
|
|
14
15
|
dy: l.dy + c.dy
|
|
16
|
+
};
|
|
17
|
+
const lead = storedLeadFor(session, id, delta.dx, delta.dy);
|
|
18
|
+
return lead ? {
|
|
19
|
+
...l,
|
|
20
|
+
lead
|
|
15
21
|
} : l;
|
|
16
22
|
}, session.descriptorOf, session.geometryProjection, session.lifecycle.label);
|
|
17
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.js","names":[],"sources":["../../../../src/interactions/actions/move/translate.ts"],"sourcesContent":["import type { Op } from 'core/ops/types';\nimport type { NodeId } from 'core/scene/types';\nimport { translateNodeOps } from '../moveNodes';\nimport { localDelta } from './delta';\nimport type { MoveSession } from './session';\n\n/** The default translate commit: one transform op per id, plus the data-held\n * geometry op when the `geometryProjection` seam is wired. */\nexport function translateOps(session: MoveSession, ids: Iterable<NodeId>, delta: { dx: number; dy: number }): Op[] {\n return translateNodeOps(\n session.scene,\n ids,\n (id) => {\n if (!session.startPoses.has(id)
|
|
1
|
+
{"version":3,"file":"translate.js","names":[],"sources":["../../../../src/interactions/actions/move/translate.ts"],"sourcesContent":["import type { Op } from 'core/ops/types';\nimport type { NodeId } from 'core/scene/types';\nimport { translateNodeOps } from '../moveNodes';\nimport { localDelta, storedLeadFor } from './delta';\nimport type { MoveSession } from './session';\n\n/** The default translate commit: one transform op per id, plus the data-held\n * geometry op when the `geometryProjection` seam is wired. */\nexport function translateOps(session: MoveSession, ids: Iterable<NodeId>, delta: { dx: number; dy: number }): Op[] {\n return translateNodeOps(\n session.scene,\n ids,\n (id) => {\n if (!session.startPoses.has(id)) return null;\n const c = session.caught.get(id);\n // A moving frame carries the drag; a catch mid-glide is the node's own.\n if (session.carried.has(id)) return c ?? null;\n const l = localDelta(session, id, delta.dx, delta.dy);\n if (c) return { dx: l.dx + c.dx, dy: l.dy + c.dy };\n const lead = storedLeadFor(session, id, delta.dx, delta.dy);\n return lead ? { ...l, lead } : l;\n },\n session.descriptorOf,\n session.geometryProjection,\n session.lifecycle.label,\n );\n}\n\n/** The default translate commit for the dragged roots among `roots` and the\n * descendants that follow them. Anything else in `roots` is ignored. */\nexport function rootTranslateOps(session: MoveSession, roots: Iterable<string>, delta: { dx: number; dy: number }): Op[] {\n const wanted = new Set<string>(roots);\n const others = new Set<NodeId>(session.ids.filter((id) => !wanted.has(id)));\n return translateOps(session, unreleasedIds(session, others), delta);\n}\n\n/** Selected roots no source layout claimed on release, plus the descendants\n * that follow them — the part of the selection the translate commit owns. */\nexport function unreleasedIds(session: MoveSession, released: Set<NodeId>): NodeId[] {\n const selected = new Set<NodeId>(session.ids);\n const out: NodeId[] = session.ids.filter((id) => !released.has(id));\n for (const id of session.cascadeIds) {\n let cur = session.scene.get(id)?.parent ?? null;\n let claimed = false;\n while (cur) {\n if (released.has(cur)) { claimed = true; break; }\n if (selected.has(cur)) break;\n cur = session.scene.get(cur)?.parent ?? null;\n }\n if (!claimed) out.push(id);\n }\n return out;\n}\n"],"mappings":";;;;;;AAQA,SAAgB,aAAa,SAAsB,KAAuB,OAAyC;CACjH,OAAO,iBACL,QAAQ,OACR,MACC,OAAO;EACN,IAAI,CAAC,QAAQ,WAAW,IAAI,EAAE,GAAG,OAAO;EACxC,MAAM,IAAI,QAAQ,OAAO,IAAI,EAAE;EAE/B,IAAI,QAAQ,QAAQ,IAAI,EAAE,GAAG,OAAO,KAAK;EACzC,MAAM,IAAI,WAAW,SAAS,IAAI,MAAM,IAAI,MAAM,EAAE;EACpD,IAAI,GAAG,OAAO;GAAE,IAAI,EAAE,KAAK,EAAE;GAAI,IAAI,EAAE,KAAK,EAAE;EAAG;EACjD,MAAM,OAAO,cAAc,SAAS,IAAI,MAAM,IAAI,MAAM,EAAE;EAC1D,OAAO,OAAO;GAAE,GAAG;GAAG;EAAK,IAAI;CACjC,GACA,QAAQ,cACR,QAAQ,oBACR,QAAQ,UAAU,KACpB;AACF;;;AAIA,SAAgB,iBAAiB,SAAsB,OAAyB,OAAyC;CACvH,MAAM,SAAS,IAAI,IAAY,KAAK;CAEpC,OAAO,aAAa,SAAS,cAAc,SAAS,IADjC,IAAY,QAAQ,IAAI,QAAQ,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CACrB,CAAM,GAAG,KAAK;AACpE;;;AAIA,SAAgB,cAAc,SAAsB,UAAiC;CACnF,MAAM,WAAW,IAAI,IAAY,QAAQ,GAAG;CAC5C,MAAM,MAAgB,QAAQ,IAAI,QAAQ,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;CAClE,KAAK,MAAM,MAAM,QAAQ,YAAY;EACnC,IAAI,MAAM,QAAQ,MAAM,IAAI,EAAE,CAAC,EAAE,UAAU;EAC3C,IAAI,UAAU;EACd,OAAO,KAAK;GACV,IAAI,SAAS,IAAI,GAAG,GAAG;IAAE,UAAU;IAAM;GAAO;GAChD,IAAI,SAAS,IAAI,GAAG,GAAG;GACvB,MAAM,QAAQ,MAAM,IAAI,GAAG,CAAC,EAAE,UAAU;EAC1C;EACA,IAAI,CAAC,SAAS,IAAI,KAAK,EAAE;CAC3B;CACA,OAAO;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { translatePoseViaDescriptor } from "../../core/geometry/poseDescriptor.js";
|
|
1
|
+
import { leadUnder, translatePoseViaDescriptor } from "../../core/geometry/poseDescriptor.js";
|
|
2
2
|
import { scenePoseFrame } from "./poseFrame.js";
|
|
3
3
|
import { nodeDescriptors, poseDescriptorOf } from "./poseDescriptorDep.js";
|
|
4
4
|
import { commitTransformOps } from "./transformFinish.js";
|
|
@@ -19,7 +19,8 @@ var MOVE_NODES_REQUIRES = [
|
|
|
19
19
|
/**
|
|
20
20
|
* One transform op per id, translating its authored pose by the stored-frame
|
|
21
21
|
* delta `deltaOf` gives it, plus its data-held geometry's op when a
|
|
22
|
-
* `geometryProjection` is wired. An id `deltaOf` answers null for is skipped
|
|
22
|
+
* `geometryProjection` is wired. An id `deltaOf` answers null for is skipped,
|
|
23
|
+
* and one it answers with a `lead` is translated with it.
|
|
23
24
|
* Every translate commit — a drag, a nudge, {@link moveNodes} — builds its ops here.
|
|
24
25
|
*/
|
|
25
26
|
function translateNodeOps(scene, ids, deltaOf, descriptorOf, geometryProjection, label) {
|
|
@@ -30,10 +31,11 @@ function translateNodeOps(scene, ids, deltaOf, descriptorOf, geometryProjection,
|
|
|
30
31
|
const l = deltaOf(id);
|
|
31
32
|
if (!l) continue;
|
|
32
33
|
const from = node.pose;
|
|
34
|
+
const to = translatePoseViaDescriptor(from, l.dx, l.dy, descriptorOf(id), l.lead);
|
|
33
35
|
ops.push(createTransformOp({
|
|
34
36
|
id,
|
|
35
37
|
from,
|
|
36
|
-
to
|
|
38
|
+
to,
|
|
37
39
|
label
|
|
38
40
|
}));
|
|
39
41
|
const m = [
|
|
@@ -48,7 +50,7 @@ function translateNodeOps(scene, ids, deltaOf, descriptorOf, geometryProjection,
|
|
|
48
50
|
id,
|
|
49
51
|
data: node.data,
|
|
50
52
|
pose: from
|
|
51
|
-
}, m, label);
|
|
53
|
+
}, m, to, label);
|
|
52
54
|
if (dataOp) ops.push(dataOp);
|
|
53
55
|
}
|
|
54
56
|
return ops;
|
|
@@ -66,7 +68,21 @@ function moveNodesOps(scene, ids, delta, deps, label = "Move") {
|
|
|
66
68
|
if (dx === 0 && dy === 0) return [];
|
|
67
69
|
const descriptorOf = nodeDescriptors(scene, poseDescriptorOf(deps?.poseDescriptor));
|
|
68
70
|
const frame = scenePoseFrame(scene);
|
|
69
|
-
|
|
71
|
+
const sources = moveSources(scene, ids);
|
|
72
|
+
const targets = translateTargets(scene, frame, sources);
|
|
73
|
+
const first = targets.find((id) => id === sources[0]) ?? targets[0];
|
|
74
|
+
const from = first === void 0 ? void 0 : frame.world(first);
|
|
75
|
+
const lead = first === void 0 ? void 0 : {
|
|
76
|
+
from,
|
|
77
|
+
to: translatePoseViaDescriptor(from, dx, dy, descriptorOf(first))
|
|
78
|
+
};
|
|
79
|
+
return translateNodeOps(scene, targets, (id) => {
|
|
80
|
+
const own = storedDelta(frame, descriptorOf(id), id, dx, dy);
|
|
81
|
+
return lead ? {
|
|
82
|
+
...own,
|
|
83
|
+
lead: leadUnder(frame.pc, frame.parentWorld(id), lead)
|
|
84
|
+
} : own;
|
|
85
|
+
}, descriptorOf, deps?.geometryProjection, label);
|
|
70
86
|
}
|
|
71
87
|
/**
|
|
72
88
|
* Move `ids` by `delta` the way a drag of them commits ({@link moveNodesOps}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveNodes.js","names":[],"sources":["../../../src/interactions/actions/moveNodes.ts"],"sourcesContent":["import type { ActionDeps } from '@weasel-js/routing';\nimport type { Affine } from '@weasel-js/geom';\nimport { translatePoseViaDescriptor, type PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { createTransformOp } from 'core/ops/transform';\nimport type { Op } from 'core/ops/types';\nimport type { NodeId, Scene } from 'core/scene/types';\nimport { geometryDataOp, type GeometryProjection } from './geometryProjection';\nimport { nodeDescriptors, poseDescriptorOf } from './poseDescriptorDep';\nimport { scenePoseFrame } from './poseFrame';\nimport { moveSources, storedDelta, translateTargets } from './selectionSubtree';\nimport { commitTransformOps } from './transformFinish';\n\ntype AnyScene = Scene<unknown, string, unknown>;\n\n/** The deps {@link moveNodes} reads; an action calling it declares these. */\nexport const MOVE_NODES_REQUIRES = [\n 'scene', 'selection', 'applyOps', 'poseDescriptor', 'geometryProjection', 'transformFollowers',\n] as const;\n\n/**\n * One transform op per id, translating its authored pose by the stored-frame\n * delta `deltaOf` gives it, plus its data-held geometry's op when a\n * `geometryProjection` is wired. An id `deltaOf` answers null for is skipped.\n * Every translate commit — a drag, a nudge, {@link moveNodes} — builds its ops here.\n */\nexport function translateNodeOps(\n scene: AnyScene,\n ids: Iterable<NodeId>,\n deltaOf: (id: NodeId) => { dx: number; dy: number } | null,\n descriptorOf: (id: NodeId) => PoseDescriptor<unknown>,\n geometryProjection: GeometryProjection | undefined,\n label: string,\n): Op[] {\n const ops: Op[] = [];\n for (const id of ids) {\n const node = scene.get(id);\n if (!node) continue;\n const l = deltaOf(id);\n if (!l) continue;\n // The authored pose, not the effective one: a derived node's effective\n // pose is its derivation, and writing that back would lose the\n // placeholder undo restores.\n const from = node.pose;\n ops.push(createTransformOp<unknown>({
|
|
1
|
+
{"version":3,"file":"moveNodes.js","names":[],"sources":["../../../src/interactions/actions/moveNodes.ts"],"sourcesContent":["import type { ActionDeps } from '@weasel-js/routing';\nimport type { Affine } from '@weasel-js/geom';\nimport {\n leadUnder, translatePoseViaDescriptor, type PoseDescriptor, type TranslateLead,\n} from 'core/geometry/poseDescriptor';\nimport { createTransformOp } from 'core/ops/transform';\nimport type { Op } from 'core/ops/types';\nimport type { NodeId, Scene } from 'core/scene/types';\nimport { geometryDataOp, type GeometryProjection } from './geometryProjection';\nimport { nodeDescriptors, poseDescriptorOf } from './poseDescriptorDep';\nimport { scenePoseFrame } from './poseFrame';\nimport { moveSources, storedDelta, translateTargets } from './selectionSubtree';\nimport { commitTransformOps } from './transformFinish';\n\ntype AnyScene = Scene<unknown, string, unknown>;\n\n/** The deps {@link moveNodes} reads; an action calling it declares these. */\nexport const MOVE_NODES_REQUIRES = [\n 'scene', 'selection', 'applyOps', 'poseDescriptor', 'geometryProjection', 'transformFollowers',\n] as const;\n\n/**\n * One transform op per id, translating its authored pose by the stored-frame\n * delta `deltaOf` gives it, plus its data-held geometry's op when a\n * `geometryProjection` is wired. An id `deltaOf` answers null for is skipped,\n * and one it answers with a `lead` is translated with it.\n * Every translate commit — a drag, a nudge, {@link moveNodes} — builds its ops here.\n */\nexport function translateNodeOps(\n scene: AnyScene,\n ids: Iterable<NodeId>,\n deltaOf: (id: NodeId) => { dx: number; dy: number; lead?: TranslateLead<unknown> } | null,\n descriptorOf: (id: NodeId) => PoseDescriptor<unknown>,\n geometryProjection: GeometryProjection | undefined,\n label: string,\n): Op[] {\n const ops: Op[] = [];\n for (const id of ids) {\n const node = scene.get(id);\n if (!node) continue;\n const l = deltaOf(id);\n if (!l) continue;\n // The authored pose, not the effective one: a derived node's effective\n // pose is its derivation, and writing that back would lose the\n // placeholder undo restores.\n const from = node.pose;\n const to = translatePoseViaDescriptor(from, l.dx, l.dy, descriptorOf(id), l.lead);\n ops.push(createTransformOp<unknown>({ id: id as string, from, to, label }));\n const m: Affine = [1, 0, 0, 1, l.dx, l.dy];\n const dataOp = geometryDataOp(geometryProjection, { id: id as string, data: node.data, pose: from }, m, to, label);\n if (dataOp) ops.push(dataOp);\n }\n return ops;\n}\n\n/**\n * The ops that move `ids` by `delta` the way a drag of them commits: each id\n * that is not itself derived (a derived one is moved through what it derives\n * from) and every descendant not carried by a moving frame, each translated in\n * the frame it is stored in. `delta` is in the coordinates a gesture's points\n * are — world on a 2D canvas — and the `poseDescriptor` dep turns it into each\n * pose's translation, so a 3D host's descriptor lands it on the node's plane.\n */\nexport function moveNodesOps(\n scene: AnyScene,\n ids: readonly string[],\n delta: { dx: number; dy: number },\n deps?: Pick<ActionDeps, 'poseDescriptor' | 'geometryProjection'>,\n label = 'Move',\n): Op[] {\n const { dx, dy } = delta;\n if (dx === 0 && dy === 0) return [];\n const descriptorOf = nodeDescriptors(scene, poseDescriptorOf(deps?.poseDescriptor));\n const frame = scenePoseFrame(scene);\n const sources = moveSources(scene, ids);\n const targets = translateTargets(scene, frame, sources);\n // The first one leads the rest, as in a drag: each is moved by its world change.\n const first = targets.find((id) => id === sources[0]) ?? targets[0];\n const from = first === undefined ? undefined : frame.world(first);\n const lead: TranslateLead<unknown> | undefined = first === undefined\n ? undefined\n : { from, to: translatePoseViaDescriptor(from, dx, dy, descriptorOf(first)) };\n return translateNodeOps(\n scene,\n targets,\n (id) => {\n const own = storedDelta(frame, descriptorOf(id), id, dx, dy);\n return lead ? { ...own, lead: leadUnder(frame.pc, frame.parentWorld(id), lead) } : own;\n },\n descriptorOf,\n deps?.geometryProjection,\n label,\n );\n}\n\n/**\n * Move `ids` by `delta` the way a drag of them commits ({@link moveNodesOps}),\n * finished by the `transformFollowers` and committed as one undo entry through\n * `applyOps`, else the scene. Inside an open `scene.batch` it joins that\n * batch's entry. Returns whether anything moved. A caller running as an\n * action declares {@link MOVE_NODES_REQUIRES}.\n */\nexport function moveNodes(\n deps: ActionDeps,\n ids: readonly string[],\n delta: { dx: number; dy: number },\n label = 'Move',\n): boolean {\n const scene = deps.scene as AnyScene | undefined;\n if (!scene) return false;\n const ops = moveNodesOps(scene, ids, delta, deps, label);\n return ops.length > 0 && commitTransformOps(deps, ops, label);\n}\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,sBAAsB;CACjC;CAAS;CAAa;CAAY;CAAkB;CAAsB;AAC5E;;;;;;;;AASA,SAAgB,iBACd,OACA,KACA,SACA,cACA,oBACA,OACM;CACN,MAAM,MAAY,CAAC;CACnB,KAAK,MAAM,MAAM,KAAK;EACpB,MAAM,OAAO,MAAM,IAAI,EAAE;EACzB,IAAI,CAAC,MAAM;EACX,MAAM,IAAI,QAAQ,EAAE;EACpB,IAAI,CAAC,GAAG;EAIR,MAAM,OAAO,KAAK;EAClB,MAAM,KAAK,2BAA2B,MAAM,EAAE,IAAI,EAAE,IAAI,aAAa,EAAE,GAAG,EAAE,IAAI;EAChF,IAAI,KAAK,kBAA2B;GAAM;GAAc;GAAM;GAAI;EAAM,CAAC,CAAC;EAC1E,MAAM,IAAY;GAAC;GAAG;GAAG;GAAG;GAAG,EAAE;GAAI,EAAE;EAAE;EACzC,MAAM,SAAS,eAAe,oBAAoB;GAAM;GAAc,MAAM,KAAK;GAAM,MAAM;EAAK,GAAG,GAAG,IAAI,KAAK;EACjH,IAAI,QAAQ,IAAI,KAAK,MAAM;CAC7B;CACA,OAAO;AACT;;;;;;;;;AAUA,SAAgB,aACd,OACA,KACA,OACA,MACA,QAAQ,QACF;CACN,MAAM,EAAE,IAAI,OAAO;CACnB,IAAI,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC;CAClC,MAAM,eAAe,gBAAgB,OAAO,iBAAiB,MAAM,cAAc,CAAC;CAClF,MAAM,QAAQ,eAAe,KAAK;CAClC,MAAM,UAAU,YAAY,OAAO,GAAG;CACtC,MAAM,UAAU,iBAAiB,OAAO,OAAO,OAAO;CAEtD,MAAM,QAAQ,QAAQ,MAAM,OAAO,OAAO,QAAQ,EAAE,KAAK,QAAQ;CACjE,MAAM,OAAO,UAAU,SAAY,SAAY,MAAM,MAAM,KAAK;CAChE,MAAM,OAA2C,UAAU,SACvD,SACA;EAAE;EAAM,IAAI,2BAA2B,MAAM,IAAI,IAAI,aAAa,KAAK,CAAC;CAAE;CAC9E,OAAO,iBACL,OACA,UACC,OAAO;EACN,MAAM,MAAM,YAAY,OAAO,aAAa,EAAE,GAAG,IAAI,IAAI,EAAE;EAC3D,OAAO,OAAO;GAAE,GAAG;GAAK,MAAM,UAAU,MAAM,IAAI,MAAM,YAAY,EAAE,GAAG,IAAI;EAAE,IAAI;CACrF,GACA,cACA,MAAM,oBACN,KACF;AACF;;;;;;;;AASA,SAAgB,UACd,MACA,KACA,OACA,QAAQ,QACC;CACT,MAAM,QAAQ,KAAK;CACnB,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,MAAM,aAAa,OAAO,KAAK,OAAO,MAAM,KAAK;CACvD,OAAO,IAAI,SAAS,KAAK,mBAAmB,MAAM,KAAK,KAAK;AAC9D"}
|
|
@@ -2,9 +2,9 @@ import { createTransformOp } from "../../../core/ops/transform.js";
|
|
|
2
2
|
import { createSetDataOp } from "../../../core/ops/setData.js";
|
|
3
3
|
import { createDeleteOp } from "../../../core/ops/delete.js";
|
|
4
4
|
import { createInsertOp } from "../../../core/ops/create.js";
|
|
5
|
-
import { resolveEditablePathOf, storeEditablePath } from "../../../
|
|
6
|
-
import { withoutShapeGenerator } from "../../../
|
|
7
|
-
import { withoutGeometryBoundData } from "../../../
|
|
5
|
+
import { resolveEditablePathOf, storeEditablePath } from "../../../domains/paths/editablePath.js";
|
|
6
|
+
import { withoutShapeGenerator } from "../../../domains/paths/shapeGenerator.js";
|
|
7
|
+
import { withoutGeometryBoundData } from "../../../domains/paths/pathEditExtension.js";
|
|
8
8
|
|
|
9
9
|
//#region src/interactions/actions/pathCommands/pathNodes.ts
|
|
10
10
|
/** The selected leaves that hold an editable polygon, in selection order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathNodes.js","names":[],"sources":["../../../../src/interactions/actions/pathCommands/pathNodes.ts"],"sourcesContent":["/**\n * What the path commands share: reading the selected path nodes, and writing\n * new geometry back into a node or into a copy of one. A node's geometry is\n * stored where it already lives (`storeEditablePath`); a shape generator, and\n * the data in `GEOMETRY_BOUND_DATA`, which no longer make it or name anchors\n * it no longer has, are dropped.\n */\nimport type { ActionDeps } from '@weasel-js/routing';\nimport type { PolygonPath } from '@weasel-js/geom';\nimport type { Node, NodeId, Scene } from 'core/scene/types';\nimport type { Op } from 'core/ops/types';\nimport { createTransformOp } from 'core/ops/transform';\nimport { createSetDataOp } from 'core/ops/setData';\nimport { createInsertOp } from 'core/ops/create';\nimport { createDeleteOp } from 'core/ops/delete';\nimport { resolveEditablePathOf, storeEditablePath } from '
|
|
1
|
+
{"version":3,"file":"pathNodes.js","names":[],"sources":["../../../../src/interactions/actions/pathCommands/pathNodes.ts"],"sourcesContent":["/**\n * What the path commands share: reading the selected path nodes, and writing\n * new geometry back into a node or into a copy of one. A node's geometry is\n * stored where it already lives (`storeEditablePath`); a shape generator, and\n * the data in `GEOMETRY_BOUND_DATA`, which no longer make it or name anchors\n * it no longer has, are dropped.\n */\nimport type { ActionDeps } from '@weasel-js/routing';\nimport type { PolygonPath } from '@weasel-js/geom';\nimport type { Node, NodeId, Scene } from 'core/scene/types';\nimport type { Op } from 'core/ops/types';\nimport { createTransformOp } from 'core/ops/transform';\nimport { createSetDataOp } from 'core/ops/setData';\nimport { createInsertOp } from 'core/ops/create';\nimport { createDeleteOp } from 'core/ops/delete';\nimport { resolveEditablePathOf, storeEditablePath } from 'domains/paths/editablePath';\nimport { withoutShapeGenerator } from 'domains/paths/shapeGenerator';\nimport { withoutGeometryBoundData } from 'domains/paths/pathEditExtension';\n\n\n/** A selected node with an editable polygon, and that polygon in world space. */\nexport interface PathNode {\n id: NodeId;\n node: Node<unknown, string, unknown>;\n path: PolygonPath;\n}\n\n/** The selected leaves that hold an editable polygon, in selection order. */\nexport function selectedPathNodes(deps: ActionDeps | undefined): PathNode[] {\n const scene = deps?.scene as Scene<unknown, string, unknown> | undefined;\n return scene ? pathNodesOf(scene, deps?.selection?.get() ?? []) : [];\n}\n\n/** The leaves among `ids` that hold an editable polygon, in the order given.\n * `shapeOf` stands in a node's pose and data, as an in-flight gesture would\n * leave them, for its own. */\nexport function pathNodesOf(\n scene: Pick<Scene<unknown, string, unknown>, 'get'>,\n ids: readonly string[],\n shapeOf?: (id: string) => { pose: unknown; data: unknown } | undefined,\n): PathNode[] {\n const out: PathNode[] = [];\n for (const id of ids) {\n const found = scene.get(id as NodeId);\n if (!found || found.kind !== 'mark') continue;\n const shape = shapeOf?.(id);\n const node = shape ? ({ ...found, pose: shape.pose, data: shape.data } as Node<unknown, string, unknown>) : found;\n const path = resolveEditablePathOf(node);\n if (path) out.push({ id: id as NodeId, node, path });\n }\n return out;\n}\n\n/** Per node, the last path `withPath` stored and what it made of it. */\nconst lastStored = new WeakMap<object, { path: PolygonPath; shape: { pose: unknown; data: unknown } | null }>();\n\n/** `node` storing `worldPath` as plain geometry, or null when it holds no\n * editable polygon. The same object while the node and the path are, so a\n * gesture previewing through it keeps its preview's identity between frames. */\nexport function withPath(node: Node<unknown, string, unknown>, worldPath: PolygonPath): { pose: unknown; data: unknown } | null {\n const held = lastStored.get(node);\n if (held?.path === worldPath) return held.shape;\n const stored = storeEditablePath(node, worldPath);\n const shape = stored ? { pose: stored.pose, data: withoutGeometryBoundData(withoutShapeGenerator(stored.data)) } : null;\n lastStored.set(node, { path: worldPath, shape });\n return shape;\n}\n\n/** The ops that give `node` the geometry `worldPath`, labeled `label`. */\nexport function reshapeOps(node: Node<unknown, string, unknown>, worldPath: PolygonPath, label: string): Op[] {\n const next = withPath(node, worldPath);\n return next ? reshapeTo(node, next, label) : [];\n}\n\n/** The ops taking `node` from what it is to `next`, labeled `label`. */\nexport function reshapeTo(node: Node<unknown, string, unknown>, next: { pose: unknown; data: unknown }, label: string): Op[] {\n const ops: Op[] = [];\n if (next.pose !== node.pose) ops.push(createTransformOp({ id: node.id, from: node.pose, to: next.pose, label }));\n if (next.data !== node.data) ops.push(createSetDataOp({ id: node.id, from: node.data, to: next.data, label }));\n return ops;\n}\n\n/** A copy of `node` under a fresh id, holding `worldPath`. */\nexport function pathCopy(scene: Scene<unknown, string, unknown>, node: Node<unknown, string, unknown>, worldPath: PolygonPath): Node<unknown, string, unknown> | null {\n const next = withPath(node, worldPath);\n if (!next) return null;\n return { ...node, id: scene.mintId(), pose: next.pose, data: next.data } as Node<unknown, string, unknown>;\n}\n\n/** Where `id` sits among its siblings, back to front. */\nexport function slotOf(scene: Scene<unknown, string, unknown>, id: NodeId): number {\n const parent = scene.get(id)?.parent ?? null;\n const siblings = parent === null ? scene.roots : scene.childrenOf(parent);\n return siblings.indexOf(id);\n}\n\n/** Insert `node` at `index` among its parent's children. */\nexport function insertAt(node: Node<unknown, string, unknown>, index: number, label: string): Op {\n return createInsertOp(index >= 0 ? { node, index, label } : { node, label });\n}\n\n/** Delete `node`, remembering its slot for undo. */\nexport function deleteNode(scene: Scene<unknown, string, unknown>, node: Node<unknown, string, unknown>, label: string): Op {\n return createDeleteOp({ node, index: slotOf(scene, node.id), label });\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,kBAAkB,MAA0C;CAC1E,MAAM,QAAQ,MAAM;CACpB,OAAO,QAAQ,YAAY,OAAO,MAAM,WAAW,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC;AACrE;;;;AAKA,SAAgB,YACd,OACA,KACA,SACY;CACZ,MAAM,MAAkB,CAAC;CACzB,KAAK,MAAM,MAAM,KAAK;EACpB,MAAM,QAAQ,MAAM,IAAI,EAAY;EACpC,IAAI,CAAC,SAAS,MAAM,SAAS,QAAQ;EACrC,MAAM,QAAQ,UAAU,EAAE;EAC1B,MAAM,OAAO,QAAS;GAAE,GAAG;GAAO,MAAM,MAAM;GAAM,MAAM,MAAM;EAAK,IAAuC;EAC5G,MAAM,OAAO,sBAAsB,IAAI;EACvC,IAAI,MAAM,IAAI,KAAK;GAAM;GAAc;GAAM;EAAK,CAAC;CACrD;CACA,OAAO;AACT;;AAGA,IAAM,6BAAa,IAAI,QAAuF;;;;AAK9G,SAAgB,SAAS,MAAsC,WAAiE;CAC9H,MAAM,OAAO,WAAW,IAAI,IAAI;CAChC,IAAI,MAAM,SAAS,WAAW,OAAO,KAAK;CAC1C,MAAM,SAAS,kBAAkB,MAAM,SAAS;CAChD,MAAM,QAAQ,SAAS;EAAE,MAAM,OAAO;EAAM,MAAM,yBAAyB,sBAAsB,OAAO,IAAI,CAAC;CAAE,IAAI;CACnH,WAAW,IAAI,MAAM;EAAE,MAAM;EAAW;CAAM,CAAC;CAC/C,OAAO;AACT;;AAGA,SAAgB,WAAW,MAAsC,WAAwB,OAAqB;CAC5G,MAAM,OAAO,SAAS,MAAM,SAAS;CACrC,OAAO,OAAO,UAAU,MAAM,MAAM,KAAK,IAAI,CAAC;AAChD;;AAGA,SAAgB,UAAU,MAAsC,MAAwC,OAAqB;CAC3H,MAAM,MAAY,CAAC;CACnB,IAAI,KAAK,SAAS,KAAK,MAAM,IAAI,KAAK,kBAAkB;EAAE,IAAI,KAAK;EAAI,MAAM,KAAK;EAAM,IAAI,KAAK;EAAM;CAAM,CAAC,CAAC;CAC/G,IAAI,KAAK,SAAS,KAAK,MAAM,IAAI,KAAK,gBAAgB;EAAE,IAAI,KAAK;EAAI,MAAM,KAAK;EAAM,IAAI,KAAK;EAAM;CAAM,CAAC,CAAC;CAC7G,OAAO;AACT;;AAGA,SAAgB,SAAS,OAAwC,MAAsC,WAA+D;CACpK,MAAM,OAAO,SAAS,MAAM,SAAS;CACrC,IAAI,CAAC,MAAM,OAAO;CAClB,OAAO;EAAE,GAAG;EAAM,IAAI,MAAM,OAAO;EAAG,MAAM,KAAK;EAAM,MAAM,KAAK;CAAK;AACzE;;AAGA,SAAgB,OAAO,OAAwC,IAAoB;CACjF,MAAM,SAAS,MAAM,IAAI,EAAE,CAAC,EAAE,UAAU;CAExC,QADiB,WAAW,OAAO,MAAM,QAAQ,MAAM,WAAW,MAAM,EACjE,CAAS,QAAQ,EAAE;AAC5B;;AAGA,SAAgB,SAAS,MAAsC,OAAe,OAAmB;CAC/F,OAAO,eAAe,SAAS,IAAI;EAAE;EAAM;EAAO;CAAM,IAAI;EAAE;EAAM;CAAM,CAAC;AAC7E;;AAGA,SAAgB,WAAW,OAAwC,MAAsC,OAAmB;CAC1H,OAAO,eAAe;EAAE;EAAM,OAAO,OAAO,OAAO,KAAK,EAAE;EAAG;CAAM,CAAC;AACtE"}
|
|
@@ -37,8 +37,8 @@ function carryPose(d, pose, m) {
|
|
|
37
37
|
* names. An action in a scene with no `parallax` layer, or invoked with no
|
|
38
38
|
* scene or view to read a plane from, runs exactly as it would unwrapped.
|
|
39
39
|
*
|
|
40
|
-
* An immediate action's
|
|
41
|
-
*
|
|
40
|
+
* An immediate action's points are its params' `world` and `press`; each
|
|
41
|
+
* is carried when present. */
|
|
42
42
|
function inPlane(action, layerOf) {
|
|
43
43
|
const inner = action.invoker;
|
|
44
44
|
if (!inner) return action;
|
|
@@ -57,17 +57,14 @@ function inPlane(action, layerOf) {
|
|
|
57
57
|
run(deps, params) {
|
|
58
58
|
const plane = livePlane(deps, layerOf(deps), declared, null);
|
|
59
59
|
if (plane === null) return inner.run(deps, params);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
y: wy
|
|
65
|
-
}) : null;
|
|
66
|
-
inner.run(plane.deps, at ? {
|
|
60
|
+
const { world, press } = params ?? {};
|
|
61
|
+
if (!world && !press) return inner.run(plane.deps, params);
|
|
62
|
+
const m = plane.map();
|
|
63
|
+
return inner.run(plane.deps, {
|
|
67
64
|
...params,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
65
|
+
...world ? { world: toPlane(m, world) } : {},
|
|
66
|
+
...press ? { press: toPlane(m, press) } : {}
|
|
67
|
+
});
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
};
|
|
@@ -75,7 +72,7 @@ function inPlane(action, layerOf) {
|
|
|
75
72
|
...action,
|
|
76
73
|
requires,
|
|
77
74
|
invoker: {
|
|
78
|
-
|
|
75
|
+
...inner,
|
|
79
76
|
start(ctx, opts) {
|
|
80
77
|
const plane = livePlane(ctx.deps, layerOf(ctx.deps, ctx.drag?.affordance), declared, ctx.drag?.start ?? null);
|
|
81
78
|
if (plane === null) return inner.start(ctx, opts);
|
|
@@ -221,6 +218,10 @@ function overlayFromPlane(ov, m) {
|
|
|
221
218
|
...ov,
|
|
222
219
|
points: ov.points.map(pt)
|
|
223
220
|
};
|
|
221
|
+
case "reason": return {
|
|
222
|
+
...ov,
|
|
223
|
+
at: pt(ov.at)
|
|
224
|
+
};
|
|
224
225
|
case "insertPreview": return {
|
|
225
226
|
...ov,
|
|
226
227
|
bounds: rectFromPlane(m, ov.bounds),
|