@weasel-js/core 1.15.0 → 1.15.2
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 +199 -0
- package/dist/WeaselProvider.js +4 -5
- package/dist/affordances/composeAffordanceLayer.js +1 -2
- package/dist/affordances/cornerResize.js +4 -5
- package/dist/affordances/hitAffordanceRegions.js +1 -2
- package/dist/affordances/pathAnchors.js +1 -2
- package/dist/affordances/rotateCursor.js +1 -2
- package/dist/affordances/rotationHandle.js +2 -3
- package/dist/animation/behaviors/coast.js +1 -2
- package/dist/animation/behaviors/coastByWrite.js +2 -3
- package/dist/animation/behaviors/coastOnTargets.js +2 -3
- package/dist/animation/behaviors/momentum.js +1 -2
- package/dist/animation/clipTargets.js +1 -2
- package/dist/animation/departures.js +2 -3
- package/dist/animation/poseHelpers.js +2 -3
- package/dist/animation/poseTarget.js +5 -6
- package/dist/animation/poseTarget.js.map +1 -1
- package/dist/animation/poseTransition.js +1 -2
- package/dist/animation/reflow.js +9 -10
- package/dist/animation/reflow.js.map +1 -1
- package/dist/animation/rewind.js +1 -2
- package/dist/animation/rig/bindRig.js +2 -3
- package/dist/animation/rig/rigNode.js +3 -4
- package/dist/animation/rig/rigNode.js.map +1 -1
- package/dist/animation/rig/rigSeat.js +1 -2
- package/dist/animation/rig/skinBinding.js +1 -2
- package/dist/animation/rig/useRig.js +2 -3
- package/dist/animation/wrappers/animateLifecycle.js +1 -2
- package/dist/animation/wrappers/animateOnSetPose.js +1 -2
- package/dist/animation/wrappers/instantPose.js +1 -2
- package/dist/animation/writtenPoseTarget.js +1 -2
- package/dist/barrel/input.js +2 -1
- package/dist/barrel/interactions.js +2 -1
- package/dist/barrel/paint.js +2 -2
- package/dist/barrel/routing.js +2 -2
- package/dist/barrel/scene.js +2 -2
- package/dist/barrel/viewport.js +3 -3
- package/dist/canvas/Canvas.js +5 -6
- package/dist/canvas/CanvasView.js +6 -7
- package/dist/canvas/CursorCoordsHud.js +2 -3
- package/dist/canvas/DrawCanvas.js +3 -4
- package/dist/canvas/GestureReason.js +1 -2
- package/dist/canvas/GestureReason.module.js +1 -2
- package/dist/canvas/LeanSceneCanvas.js +2 -3
- package/dist/canvas/ModalityHud.js +2 -3
- package/dist/canvas/NodeShape.js +3 -4
- package/dist/canvas/PickHud.js +2 -3
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +1 -2
- package/dist/canvas/SceneCanvas/CanvasKitProviders.js +3 -4
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +1 -2
- package/dist/canvas/SceneCanvas/DevHuds.js +1 -2
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +18 -66
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js +4 -5
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js +1 -2
- package/dist/canvas/SceneCanvas/brushOverlay.js +1 -2
- package/dist/canvas/SceneCanvas/builtinToolSets.js +1 -2
- package/dist/canvas/SceneCanvas/canvasPassThrough.js +1 -2
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js +1 -2
- package/dist/canvas/SceneCanvas/coordTrace.js +1 -2
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +3 -4
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -2
- package/dist/canvas/SceneCanvas/defaultTextEditor.js +4 -5
- package/dist/canvas/SceneCanvas/describePresets.js +1 -2
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +1 -2
- package/dist/canvas/SceneCanvas/features.js +1 -2
- package/dist/canvas/SceneCanvas/insertPreviewCommands.js +1 -2
- package/dist/canvas/SceneCanvas/mergeLayers.js +1 -2
- package/dist/canvas/SceneCanvas/namedPresets.js +5 -6
- package/dist/canvas/SceneCanvas/poseGeometry.js +1 -2
- package/dist/canvas/SceneCanvas/poseRegistrars.js +1 -2
- package/dist/canvas/SceneCanvas/presets/arrange.js +2 -3
- package/dist/canvas/SceneCanvas/presets/baseline.js +1 -2
- package/dist/canvas/SceneCanvas/presets/chrome.js +1 -2
- package/dist/canvas/SceneCanvas/presets/composites.js +1 -2
- package/dist/canvas/SceneCanvas/presets/edit.js +4 -5
- package/dist/canvas/SceneCanvas/presets/ingest.js +1 -2
- package/dist/canvas/SceneCanvas/presets/paths.js +3 -4
- package/dist/canvas/SceneCanvas/presets/select.js +1 -2
- package/dist/canvas/SceneCanvas/presets/toolDriven.js +2 -3
- package/dist/canvas/SceneCanvas/presets/tools.js +1 -2
- package/dist/canvas/SceneCanvas/presets/transform.js +2 -3
- package/dist/canvas/SceneCanvas/presets/view.js +2 -3
- package/dist/canvas/SceneCanvas/props.js +1 -2
- package/dist/canvas/SceneCanvas/scenePointQuery.js +2 -3
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +1 -2
- package/dist/canvas/SceneCanvas/toolRegistry.js +2 -3
- package/dist/canvas/SceneCanvas/useActionTunings.js +1 -2
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +1 -2
- package/dist/canvas/SceneCanvas/useBakedScene.js +2 -3
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +7 -8
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +2 -3
- package/dist/canvas/SceneCanvas/useCanvasCamera.js +2 -3
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js +1 -2
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +1 -2
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +8 -6
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasTools.js +2 -3
- package/dist/canvas/SceneCanvas/useChromeAffordances.js +2 -3
- package/dist/canvas/SceneCanvas/useContributionRoles.js +1 -2
- package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +4 -5
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +2 -3
- package/dist/canvas/SceneCanvas/useHeldModifiers.js +1 -2
- package/dist/canvas/SceneCanvas/useMagnificationCheck.js +41 -0
- package/dist/canvas/SceneCanvas/useMagnificationCheck.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js +1 -2
- package/dist/canvas/SceneCanvas/useNodeKinds.js +2 -3
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +10 -11
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +6 -7
- package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneChrome.js +5 -6
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +6 -7
- package/dist/canvas/SceneCanvas/useScenePicking.js +5 -6
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +7 -8
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +2 -3
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js +26 -18
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +2 -3
- package/dist/canvas/SceneCanvas/useSurfaceRouting.js +1 -2
- package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js +1 -2
- package/dist/canvas/SceneCanvas/useToolKeybindings.js +1 -2
- package/dist/canvas/SceneCanvas/useViewportActions.js +3 -4
- package/dist/canvas/SceneCanvas/worldPointAt.js +1 -2
- package/dist/canvas/SceneCanvas.js +18 -17
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +2 -3
- package/dist/canvas/SurfaceCanvas.js +1 -2
- package/dist/canvas/ViewMarker.js +1 -2
- package/dist/canvas/accentColor.js +4 -5
- package/dist/canvas/accentColor.js.map +1 -1
- package/dist/canvas/adapterDerivedPath.js +2 -3
- package/dist/canvas/adapterPickSource.js +1 -2
- package/dist/canvas/affordanceAt.js +2 -3
- package/dist/canvas/buildSceneLayer.js +4 -5
- package/dist/canvas/buildSceneTree.js +4 -5
- package/dist/canvas/canvasRenderer.js +1 -2
- package/dist/canvas/colorOverrides.js +1 -2
- package/dist/canvas/contextAttributes.js +1 -2
- package/dist/canvas/copiesAbove.js +1 -2
- package/dist/canvas/defaultDrawOne.js +1 -2
- package/dist/canvas/deps/areaSelect.js +5 -3
- package/dist/canvas/deps/areaSelect.js.map +1 -1
- package/dist/canvas/deps/booleans.js +5 -6
- package/dist/canvas/deps/changes.js +1 -2
- package/dist/canvas/deps/chromeRules.js +1 -2
- package/dist/canvas/deps/debug.js +1 -2
- package/dist/canvas/deps/dispatchSources.js +1 -2
- package/dist/canvas/deps/dispatcher.js +1 -2
- package/dist/canvas/deps/editAnchors.js +3 -4
- package/dist/canvas/deps/enteredGroup.js +6 -6
- package/dist/canvas/deps/enteredGroup.js.map +1 -1
- package/dist/canvas/deps/geometryProjection.js +1 -2
- package/dist/canvas/deps/hitTestArea.js +4 -5
- package/dist/canvas/deps/ingestion.js +1 -2
- package/dist/canvas/deps/insert.js +3 -4
- package/dist/canvas/deps/insertSite.js +3 -4
- package/dist/canvas/deps/kitSettings.js +1 -2
- package/dist/canvas/deps/lassoSelect.js +5 -3
- package/dist/canvas/deps/lassoSelect.js.map +1 -1
- package/dist/canvas/deps/layout.js +1 -2
- package/dist/canvas/deps/modeDefaultTool.js +1 -2
- package/dist/canvas/deps/nodeAtPoint.js +1 -2
- package/dist/canvas/deps/pathEditCommits.js +4 -5
- package/dist/canvas/deps/pathLeaf.js +1 -2
- package/dist/canvas/deps/pathLeafDeps.js +2 -3
- package/dist/canvas/deps/poseDescriptor.js +1 -2
- package/dist/canvas/deps/previewPaths.js +1 -2
- package/dist/canvas/deps/resizePolicy.js +1 -2
- package/dist/canvas/deps/selectionSnapshot.js +8 -4
- package/dist/canvas/deps/selectionSnapshot.js.map +1 -1
- package/dist/canvas/deps/slice.js +5 -6
- package/dist/canvas/deps/snap.js +3 -4
- package/dist/canvas/deps/surface.js +1 -2
- package/dist/canvas/deps/textEdit.js +1 -2
- package/dist/canvas/deps/transformFollowers.js +1 -2
- package/dist/canvas/deps/view.js +1 -2
- package/dist/canvas/derivedPath.js +6 -7
- package/dist/canvas/doubleClickTarget.js +1 -2
- package/dist/canvas/drawEnvelope.js +1 -2
- package/dist/canvas/drawnBounds.js +4 -5
- package/dist/canvas/getNodeAtPoint.js +1 -2
- package/dist/canvas/hostAnchor.js +1 -2
- package/dist/canvas/hud.module.js +1 -2
- package/dist/canvas/inheritedPaints.js +1 -2
- package/dist/canvas/insertPreviewExtent.js +1 -2
- package/dist/canvas/kitRequirements.js +1 -2
- package/dist/canvas/layerHover.js +1 -2
- package/dist/canvas/layerOrder.js +1 -2
- package/dist/canvas/layerSlots.js +1 -2
- package/dist/canvas/mountedCanvases.js +1 -2
- package/dist/canvas/nodeShapes/derivedPainter.js +2 -3
- package/dist/canvas/nodeShapes/imagePainter.js +1 -2
- package/dist/canvas/nodeShapes/measurePainter.js +2 -3
- package/dist/canvas/nodeShapes/memo.js +1 -2
- package/dist/canvas/nodeShapes/nodePaint.js +1 -2
- package/dist/canvas/nodeShapes/pathPainter.js +3 -4
- package/dist/canvas/nodeShapes/poseBox.js +1 -2
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +1 -2
- package/dist/canvas/nodeShapes/shapePainter.js +2 -3
- package/dist/canvas/nodeShapes/strokedBounds.js +1 -2
- package/dist/canvas/nodeShapes/textPainter.js +1 -2
- package/dist/canvas/overChildren.js +1 -2
- package/dist/canvas/overlayRoleStrokes.js +1 -2
- package/dist/canvas/ownClip.js +1 -2
- package/dist/canvas/paintCull.js +1 -2
- package/dist/canvas/paintedCursorLayer.js +1 -2
- package/dist/canvas/pathOverlay.js +1 -2
- package/dist/canvas/pickIndex/nodeBroadBox.js +3 -4
- package/dist/canvas/pickIndex/scenePickIndex.js +3 -4
- package/dist/canvas/pickReach.js +1 -2
- package/dist/canvas/pickWalk.js +2 -3
- package/dist/canvas/planeClips.js +1 -2
- package/dist/canvas/poseRotation.js +1 -2
- package/dist/canvas/publishPreviews.js +1 -2
- package/dist/canvas/rasterReadback.js +1 -2
- package/dist/canvas/rasterToPng.js +1 -2
- package/dist/canvas/renderDebugSnapshot.js +1 -2
- package/dist/canvas/renderNeeds.js +1 -2
- package/dist/canvas/renderSceneToPixels.js +5 -6
- package/dist/canvas/sceneAdapter.js +37 -27
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +19 -7
- package/dist/canvas/sceneClipboard.js.map +1 -1
- package/dist/canvas/sceneLayerPaint.js +1 -2
- package/dist/canvas/scenePickReads.js +1 -2
- package/dist/canvas/scenePickSource.js +5 -6
- package/dist/canvas/sceneSlotWiring.js +2 -3
- package/dist/canvas/sceneViewRender.js +5 -6
- package/dist/canvas/shownNodes.js +1 -2
- package/dist/canvas/slopsDebugLayer.js +9 -4
- package/dist/canvas/slopsDebugLayer.js.map +1 -1
- package/dist/canvas/surfaceContribution.js +1 -2
- package/dist/canvas/useCanvasElements.js +1 -2
- package/dist/canvas/useCanvasHandle.js +1 -2
- package/dist/canvas/useCanvasPaint.js +2 -3
- package/dist/canvas/useCanvasRenderer.js +1 -2
- package/dist/canvas/useCanvasSurface.js +1 -2
- package/dist/canvas/useCanvasView.js +2 -3
- package/dist/canvas/useClientToWorld.js +1 -2
- package/dist/canvas/useExtraLayers.js +1 -2
- package/dist/canvas/useFrameLoop.js +1 -2
- package/dist/canvas/useHitObserver.js +1 -2
- package/dist/canvas/useHostAnchor.js +1 -2
- package/dist/canvas/useInFlightBounds.js +6 -6
- package/dist/canvas/useInFlightBounds.js.map +1 -1
- package/dist/canvas/useLateContentRedraw.js +1 -2
- package/dist/canvas/useLayerStack.js +2 -3
- package/dist/canvas/usePaintedCursor.js +1 -2
- package/dist/canvas/useRedrawOn.js +1 -2
- package/dist/canvas/useSceneAdapter.js +1 -2
- package/dist/canvas/useSceneLayerList.js +1 -2
- package/dist/canvas/useSurfaceInput.js +1 -2
- package/dist/canvas/useSurfaceSize.js +1 -2
- package/dist/canvas/useToolCursor.js +1 -2
- package/dist/canvas/useViewAim.js +2 -3
- package/dist/canvas/useViewHelpers.js +5 -4
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/useViewLayerGate.js +1 -2
- package/dist/canvas/useViewNesting.js +1 -2
- package/dist/canvas/useViewRegistrySurface.js +7 -5
- package/dist/canvas/useViewRegistrySurface.js.map +1 -1
- package/dist/canvas/viewInputs.js +1 -2
- package/dist/canvas/viewMarkers.js +1 -2
- package/dist/canvas/viewRegistry.js +6 -7
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/canvas/viewSnap.js +1 -2
- package/dist/canvas/watchElementMove.js +1 -2
- package/dist/canvas/wrapNodeOutput.js +1 -2
- package/dist/core/adapters/testing/rootsTree.js +1 -2
- package/dist/core/applyOps.js +1 -2
- package/dist/core/device/targets.js +1 -2
- package/dist/core/device/useDeviceProfile.js +1 -2
- package/dist/core/device/useTargetBasePx.js +1 -2
- package/dist/core/device/watchDevicePixelRatio.js +1 -2
- package/dist/core/geometry/autoPoseDescriptor.js +2 -3
- package/dist/core/geometry/booleanOfPaths.js +1 -2
- package/dist/core/geometry/inkExtents.js +1 -2
- package/dist/core/geometry/pathPoseDescriptor.js +1 -2
- package/dist/core/geometry/poseDescriptor.js +1 -2
- package/dist/core/geometry/regionHit.js +1 -2
- package/dist/core/geometry/targetFrame.js +1 -2
- package/dist/core/geometry/unionBounds.js +1 -2
- package/dist/core/layers/backgroundFill.js +1 -2
- package/dist/core/layers/children.js +1 -2
- package/dist/core/layers/gateLayer.js +1 -2
- package/dist/core/layers/layerGroup.js +1 -2
- package/dist/core/layers/redrawSource.js +1 -2
- package/dist/core/layers/render.js +1 -2
- package/dist/core/layers/retain.js +1 -2
- package/dist/core/ops/arrange.js +1 -2
- package/dist/core/ops/create.js +2 -3
- package/dist/core/ops/createHistory.js +2 -3
- package/dist/core/ops/delete.js +2 -3
- package/dist/core/ops/nodeFlags.js +1 -2
- package/dist/core/ops/registry.js +1 -2
- package/dist/core/ops/reorder/algorithms.js +1 -2
- package/dist/core/ops/reorder/index.js +3 -8
- package/dist/core/ops/reorder/index.js.map +1 -1
- package/dist/core/ops/reorder/setChildOrder.js +1 -2
- package/dist/core/ops/reparent.js +1 -2
- package/dist/core/ops/select.js +1 -2
- package/dist/core/ops/setData.js +1 -2
- package/dist/core/ops/setDependsOn.js +1 -2
- package/dist/core/ops/setLayer.js +1 -2
- package/dist/core/ops/setLayout.js +1 -2
- package/dist/core/ops/setPath.js +1 -2
- package/dist/core/ops/setText.js +1 -2
- package/dist/core/ops/slot.js +1 -2
- package/dist/core/ops/transform.js +1 -2
- package/dist/core/ops/writtenBy.js +1 -2
- package/dist/core/pages/fitViewToPage.js +3 -9
- package/dist/core/pages/fitViewToPage.js.map +1 -1
- package/dist/core/pages/pageEdits.js +3 -4
- package/dist/core/pages/pages.js +4 -11
- package/dist/core/pages/pages.js.map +1 -1
- package/dist/core/pages/pagesLayer.js +1 -2
- package/dist/core/paint/meshKind.js +1 -2
- package/dist/core/paint/meshKindLazy.js +18 -23
- package/dist/core/paint/meshKindLazy.js.map +1 -1
- package/dist/core/paint/paintKindEntry.js +1 -2
- package/dist/core/paint/paintKinds.js +1 -2
- package/dist/core/paint/registerMesh.js +1 -2
- package/dist/core/scene/NodeProperties.js +1 -2
- package/dist/core/scene/NodeRouting.js +1 -2
- package/dist/core/scene/annotation.js +1 -2
- package/dist/core/scene/appliedLog.js +1 -2
- package/dist/core/scene/arrivalWindow.js +2 -3
- package/dist/core/scene/arrivals.js +1 -2
- package/dist/core/scene/booleanGroup.js +1 -2
- package/dist/core/scene/booleanOfChildren.js +1 -2
- package/dist/core/scene/boundOps.js +1 -2
- package/dist/core/scene/carryDescendants.js +2 -3
- package/dist/core/scene/clipNothing.js +1 -2
- package/dist/core/scene/composeFrame.js +1 -2
- package/dist/core/scene/composePose.js +1 -2
- package/dist/core/scene/declaredFieldSetters.js +1 -2
- package/dist/core/scene/depFrame.js +1 -2
- package/dist/core/scene/depMemo.js +1 -2
- package/dist/core/scene/dependents.js +1 -2
- package/dist/core/scene/derivedParts.js +1 -2
- package/dist/core/scene/derivedPath.js +2 -3
- package/dist/core/scene/docValues.js +1 -2
- package/dist/core/scene/documentOf.js +1 -2
- package/dist/core/scene/editMode.js +1 -2
- package/dist/core/scene/editPass.js +1 -2
- package/dist/core/scene/effectivePose.js +3 -4
- package/dist/core/scene/fieldEdits.js +1 -2
- package/dist/core/scene/fontReads.js +1 -2
- package/dist/core/scene/historyFacade.js +1 -2
- package/dist/core/scene/historyForm.js +1 -2
- package/dist/core/scene/inheritedPaint.js +1 -2
- package/dist/core/scene/kitOps.js +16 -15
- package/dist/core/scene/kitOps.js.map +1 -1
- package/dist/core/scene/kitRegistry.js +2 -3
- package/dist/core/scene/layerOps.js +1 -2
- package/dist/core/scene/layerStack.js +1 -2
- package/dist/core/scene/layoutPass.js +4 -5
- package/dist/core/scene/lockGuard.js +1 -2
- package/dist/core/scene/minSize.js +1 -2
- package/dist/core/scene/nestedHit.js +1 -2
- package/dist/core/scene/nodeAsShown.js +1 -2
- package/dist/core/scene/nodeFlags.js +1 -2
- package/dist/core/scene/nodeFnFields.js +1 -2
- package/dist/core/scene/nodeGates.js +1 -2
- package/dist/core/scene/nodeMemo.js +1 -2
- package/dist/core/scene/nodeStore.js +2 -3
- package/dist/core/scene/notifier.js +1 -2
- package/dist/core/scene/opTable.js +1 -2
- package/dist/core/scene/outerOps.js +1 -2
- package/dist/core/scene/pathEffects/blend.js +3 -4
- package/dist/core/scene/pathEffects/blend.js.map +1 -1
- package/dist/core/scene/pathEffects/derive.js +2 -3
- package/dist/core/scene/pathEffects/effects.js +1 -2
- package/dist/core/scene/pathEffects/foundHidden.js +1 -2
- package/dist/core/scene/pathEffects/textAlong.js +6 -6
- package/dist/core/scene/pathEffects/textAlong.js.map +1 -1
- package/dist/core/scene/pathEffects/textAlongBands.js +1 -2
- package/dist/core/scene/plyStacks.js +1 -2
- package/dist/core/scene/poseFeed.js +1 -2
- package/dist/core/scene/poseHold.js +1 -2
- package/dist/core/scene/poseOverrides.js +1 -2
- package/dist/core/scene/posePlies.js +1 -2
- package/dist/core/scene/poseRemovals.js +1 -2
- package/dist/core/scene/poseSnapshot.js +1 -2
- package/dist/core/scene/poseWrites.js +1 -2
- package/dist/core/scene/reconcileSpecs.js +26 -3
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/recorder.js +1 -2
- package/dist/core/scene/renderOrder.js +1 -2
- package/dist/core/scene/sameValue.js +1 -2
- package/dist/core/scene/scene.js +23 -13
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneChanges.js +1 -2
- package/dist/core/scene/sceneEdits.js +1 -2
- package/dist/core/scene/sceneJournals.js +1 -2
- package/dist/core/scene/sceneMutators.js +2 -3
- package/dist/core/scene/scenePoseAdapter.js +1 -2
- package/dist/core/scene/sceneRecording.js +1 -2
- package/dist/core/scene/sceneSelection.js +8 -5
- package/dist/core/scene/sceneSelection.js.map +1 -1
- package/dist/core/scene/sceneState.js +3 -4
- package/dist/core/scene/scrollOffsets.js +1 -2
- package/dist/core/scene/serialization.js +2 -3
- package/dist/core/scene/staleReplay.js +1 -2
- package/dist/core/scene/statedFields.js +1 -2
- package/dist/core/scene/strategyView.js +1 -2
- package/dist/core/scene/treeEdits.js +2 -3
- package/dist/core/scene/treeOrder.js +1 -2
- package/dist/core/scene/treeReads.js +1 -2
- package/dist/core/scene/treeShape.js +1 -2
- package/dist/core/scene/types.js +1 -2
- package/dist/core/scene/types.js.map +1 -1
- package/dist/core/scene/unionOfChildren.js +1 -2
- package/dist/core/scene/unitScopes.js +20 -4
- package/dist/core/scene/unitScopes.js.map +1 -1
- package/dist/core/scene/useScene.js +2 -3
- package/dist/core/scene/worldSave.js +2 -3
- package/dist/core/selection/chromeState.js +1 -2
- package/dist/core/selection/outermostSelection.js +56 -0
- package/dist/core/selection/outermostSelection.js.map +1 -0
- package/dist/core/selection/readOnlySelection.js +1 -2
- package/dist/core/selection/selectionTarget.js +1 -2
- package/dist/core/selection/usePublishSceneSelection.js +1 -2
- package/dist/core/selection/useSelection.js +1 -2
- package/dist/core/shapeKinds.js +1 -2
- package/dist/core/stableStringify.js +1 -2
- package/dist/core/stylus/stylus.js +1 -2
- package/dist/core/stylus/usePointerStylus.js +1 -2
- package/dist/core/usePaintKinds.js +1 -2
- package/dist/core/viewport/clampView.js +1 -2
- package/dist/core/viewport/clientToWorld.js +8 -3
- package/dist/core/viewport/clientToWorld.js.map +1 -1
- package/dist/core/viewport/createVelocityTracker.js +1 -2
- package/dist/core/viewport/fitToBounds.js +1 -2
- package/dist/core/viewport/fitViewToBounds.js +1 -2
- package/dist/core/viewport/interpolateView.js +1 -2
- package/dist/core/viewport/parallax.js +1 -2
- package/dist/core/viewport/sceneNodeClientRect.js +1 -2
- package/dist/core/viewport/screenSlop.js +1 -2
- package/dist/core/viewport/useAutoCenter.js +1 -2
- package/dist/core/viewport/useCanvasSize.js +1 -2
- package/dist/core/viewport/useDecayLoop.js +1 -2
- package/dist/core/viewport/useNodeOverlayFrame.js +1 -2
- package/dist/core/viewport/useVelocityTracker.js +1 -2
- package/dist/core/viewport/useViewAnimation.js +3 -4
- package/dist/core/viewport/view.js +1 -2
- package/dist/core/viewport/viewTransform.js +1 -2
- package/dist/core/viewport/viewportWorldRect.js +1 -2
- package/dist/core/viewport/wheelHandler.js +1 -2
- package/dist/core/viewport/zoomAt.js +7 -8
- package/dist/core/viewport/zoomAt.js.map +1 -1
- package/dist/core/viewport/zoomBounds.js +1 -2
- package/dist/debug/createDebugOverlayLayer.js +1 -2
- package/dist/debug/createDebugSink.js +1 -2
- package/dist/debug/defaultTheme.js +1 -2
- package/dist/debug/features.js +1 -2
- package/dist/debug/frameStats.js +1 -2
- package/dist/debug/overlayPanels.js +1 -2
- package/dist/debug/parseDebugFlags.js +1 -2
- package/dist/debug/useDebugSink.js +2 -3
- package/dist/{depSchema-ChQPzEkW.d.ts → depSchema-C7a_OMt-.d.ts} +61 -52
- package/dist/devtools/handlers.js +1 -2
- package/dist/devtools/history.js +1 -2
- package/dist/devtools/hook.js +1 -2
- package/dist/devtools/label.js +1 -2
- package/dist/devtools/notices.js +1 -2
- package/dist/devtools/protocol.js +1 -2
- package/dist/devtools/registry.js +1 -2
- package/dist/devtools/root.js +12 -6
- package/dist/devtools/root.js.map +1 -1
- package/dist/devtools/serialize.js +1 -2
- package/dist/devtools/session.js +2 -3
- package/dist/devtools/transport.js +13 -18
- package/dist/devtools/transport.js.map +1 -1
- package/dist/devtools/useDevtoolsRoot.js +1 -2
- package/dist/devtools-protocol.d.ts +1 -12
- package/dist/devtools-protocol.js +2 -2
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +1 -2
- package/dist/domains/chrome-caps/buildChromeCtx.js +1 -2
- package/dist/domains/chrome-caps/conditions.js +1 -2
- package/dist/domains/chrome-caps/defaults.js +1 -2
- package/dist/domains/chrome-caps/resolve.js +2 -3
- package/dist/domains/chrome-caps/useChromeCaps.js +1 -2
- package/dist/domains/chrome-caps/useHoverTracking.js +1 -2
- package/dist/domains/ingestion/contentHandlers.js +1 -2
- package/dist/domains/ingestion/ghost.js +2 -3
- package/dist/domains/ingestion/imageHandler.js +1 -2
- package/dist/domains/ingestion/kitHandlers.js +2 -3
- package/dist/domains/ingestion/openFilePicker.js +1 -2
- package/dist/domains/ingestion/placement.js +1 -2
- package/dist/domains/ingestion/svgHandler.js +1 -2
- package/dist/domains/ingestion/textHandler.js +1 -2
- package/dist/domains/ingestion/useCanvasIngestion.js +1 -2
- package/dist/domains/ingestion/weaselJsonHandler.js +2 -3
- package/dist/domains/longPress/longPressFeedback.js +1 -2
- package/dist/domains/measure/actionIds.js +1 -2
- package/dist/domains/measure/measureCommands.js +6 -7
- package/dist/domains/measure/measureContribution.js +3 -4
- package/dist/domains/measure/measureEdits.js +3 -4
- package/dist/domains/measure/measureGestures.js +2 -3
- package/dist/domains/measure/measureHit.js +5 -12
- package/dist/domains/measure/measureHit.js.map +1 -1
- package/dist/domains/measure/measureLayer.js +3 -4
- package/dist/domains/measure/measurement.js +1 -2
- package/dist/domains/measure/measurements.js +1 -2
- package/dist/domains/modes/modeLayers.js +1 -2
- package/dist/domains/modes/modeTriggers.js +1 -2
- package/dist/domains/pathEffects/effectSources.js +2 -3
- package/dist/domains/pathEffects/index.js +1 -2
- package/dist/domains/pathEffects/readSource.js +3 -4
- package/dist/domains/pathEffects/textItems.js +1 -2
- package/dist/domains/pathEffects/useEffectSourcesLayer.js +3 -4
- package/dist/domains/paths/anchorData.js +1 -2
- package/dist/domains/paths/anchorMarkers.js +6 -13
- package/dist/domains/paths/anchorMarkers.js.map +1 -1
- package/dist/domains/paths/editablePath.js +3 -4
- package/dist/domains/paths/originProjection.js +1 -2
- package/dist/domains/paths/pathEditExtension.js +1 -2
- package/dist/domains/paths/pathEditState.js +1 -2
- package/dist/domains/paths/pathEditingOverlayLayer.js +7 -12
- package/dist/domains/paths/pathEditingOverlayLayer.js.map +1 -1
- package/dist/domains/paths/pathLayer.js +1 -2
- package/dist/domains/paths/pathRepresentation.js +1 -2
- package/dist/domains/paths/pathSnap/glyphs.js +1 -2
- package/dist/domains/paths/pathSnap/pathSnapSource.js +1 -2
- package/dist/domains/paths/pathSnap/sceneIndex.js +1 -2
- package/dist/domains/paths/pathSnap/snapGeometry.js +2 -3
- package/dist/domains/paths/penPreviewLayer.js +10 -14
- package/dist/domains/paths/penPreviewLayer.js.map +1 -1
- package/dist/domains/paths/shapeGenerator.js +2 -4
- package/dist/domains/paths/shapeGenerator.js.map +1 -1
- package/dist/domains/paths/strokeOutline.js +2 -3
- package/dist/domains/paths/useAnchorFields.js +1 -2
- package/dist/domains/paths/usePathEdit.js +2 -3
- package/dist/domains/poseRun/usePoseRun.js +1 -2
- package/dist/domains/selection/enteredGroupFrame.js +1 -2
- package/dist/domains/selection/enteredGroupScope.js +1 -2
- package/dist/domains/selection/enteredOperands.js +1 -2
- package/dist/domains/selection/handleCommands.js +2 -3
- package/dist/domains/selection/overlay.js +6 -7
- package/dist/domains/selection/selectionPose.js +2 -3
- package/dist/domains/snap/angle2d.js +3 -3
- package/dist/domains/snap/angle2d.js.map +1 -1
- package/dist/domains/snap/debugCandidates.js +1 -2
- package/dist/domains/snap/gather.js +1 -2
- package/dist/domains/snap/inputSubspace.js +2 -3
- package/dist/domains/snap/lazySession.js +1 -2
- package/dist/domains/snap/marks.js +1 -2
- package/dist/domains/snap/outcomeStore.js +6 -10
- package/dist/domains/snap/outcomeStore.js.map +1 -1
- package/dist/domains/snap/pointSnap.js +1 -2
- package/dist/domains/snap/probes2d.js +1 -2
- package/dist/domains/snap/readoutDraw.js +1 -2
- package/dist/domains/snap/readoutLayer.js +1 -2
- package/dist/domains/snap/registry.js +1 -2
- package/dist/domains/snap/resizeBox.js +1 -2
- package/dist/domains/snap/roles.js +1 -2
- package/dist/domains/snap/rotationSource.js +1 -2
- package/dist/domains/snap/sceneReads.js +2 -3
- package/dist/domains/snap/sceneSession2d.js +2 -3
- package/dist/domains/snap/screen.js +2 -3
- package/dist/domains/snap/session2d.js +4 -5
- package/dist/domains/snap/spanSnap.js +1 -2
- package/dist/domains/snap/stepAngles.js +1 -2
- package/dist/domains/text/editingDrawOne.js +1 -2
- package/dist/domains/text/hostTextEditors.js +1 -2
- package/dist/domains/text/sceneTextDrafts.js +1 -2
- package/dist/domains/text/textHitAt.js +4 -5
- package/dist/domains/text/textLayer.js +12 -2
- package/dist/domains/text/textLayer.js.map +1 -1
- package/dist/domains/text/useSceneTextEdit.js +13 -9
- package/dist/domains/text/useSceneTextEdit.js.map +1 -1
- package/dist/domains/viewports/aim.js +6 -12
- package/dist/domains/viewports/aim.js.map +1 -1
- package/dist/domains/viewports/viewMarker.js +1 -2
- package/dist/domains/viewports/viewMarkerDrag.js +1 -2
- package/dist/domains/viewports/viewResolver.js +6 -5
- package/dist/domains/viewports/viewResolver.js.map +1 -1
- package/dist/domains/viewports/viewportLayer.js +1 -2
- package/dist/iconRegistry/IconRegistryProvider.js +1 -2
- package/dist/iconRegistry/useIconGlyph.js +1 -2
- package/dist/iconRegistry/useIconVariant.js +1 -2
- package/dist/icons.table.js +1 -2
- package/dist/icons2.table.js +1 -2
- package/dist/index.d.ts +70 -27
- package/dist/index.js +7 -5
- package/dist/input/keyState.js +1 -2
- package/dist/input/useKeyModifiers.js +1 -2
- package/dist/input/useKeyState.js +1 -2
- package/dist/input/usePublishPointer.js +59 -0
- package/dist/input/usePublishPointer.js.map +1 -0
- package/dist/interactions/actions/admitsChild.js +1 -2
- package/dist/interactions/actions/align/action.js +6 -7
- package/dist/interactions/actions/align/align.js +6 -7
- package/dist/interactions/actions/booleans/action.js +1 -2
- package/dist/interactions/actions/booleans/booleanGroupAction.js +2 -3
- package/dist/interactions/actions/booleans/booleans.js +1 -2
- package/dist/interactions/actions/booleans/commit.js +4 -5
- package/dist/interactions/actions/booleans/custom.js +2 -3
- package/dist/interactions/actions/booleans/keymap.js +1 -2
- package/dist/interactions/actions/booleans/operands.js +1 -2
- package/dist/interactions/actions/booleans/pieces.js +1 -2
- package/dist/interactions/actions/booleans/placement.js +1 -2
- package/dist/interactions/actions/booleans/useBooleans.js +1 -2
- package/dist/interactions/actions/booleans/useBooleansAdapter.js +1 -2
- package/dist/interactions/actions/clipboard/action.js +2 -3
- package/dist/interactions/actions/clipboard/clipboardOps.js +2 -3
- package/dist/interactions/actions/clipboard/materializePaste.js +1 -2
- package/dist/interactions/actions/clipboard/wireFormat.js +1 -2
- package/dist/interactions/actions/clone/action.js +7 -8
- package/dist/interactions/actions/clone/behaviors.js +4 -5
- package/dist/interactions/actions/defaultCommitAdapter.js +2 -3
- package/dist/interactions/actions/defaults/anchorEditing.js +3 -4
- package/dist/interactions/actions/defaults/anchorFields.js +1 -2
- package/dist/interactions/actions/defaults/anchorHandles.js +2 -3
- package/dist/interactions/actions/defaults/anchorJoin.js +2 -3
- package/dist/interactions/actions/defaults/areaSelect.js +6 -6
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +3 -4
- package/dist/interactions/actions/defaults/cancelGesture.js +1 -2
- package/dist/interactions/actions/defaults/clearSelection.js +1 -2
- package/dist/interactions/actions/defaults/containerScroll.js +13 -8
- package/dist/interactions/actions/defaults/containerScroll.js.map +1 -1
- package/dist/interactions/actions/defaults/contextMenu.js +6 -7
- package/dist/interactions/actions/defaults/copySubtree.js +2 -3
- package/dist/interactions/actions/defaults/createPaintAction.js +3 -4
- package/dist/interactions/actions/defaults/delete.js +2 -3
- package/dist/interactions/actions/defaults/duplicate.js +5 -6
- package/dist/interactions/actions/defaults/enterGroup.js +5 -6
- package/dist/interactions/actions/defaults/enterGroup.js.map +1 -1
- package/dist/interactions/actions/defaults/enterPathEdit.js +1 -2
- package/dist/interactions/actions/defaults/enterTextEdit.js +1 -2
- package/dist/interactions/actions/defaults/escape.js +1 -2
- package/dist/interactions/actions/defaults/exitPathEdit.js +1 -2
- package/dist/interactions/actions/defaults/group.js +6 -7
- package/dist/interactions/actions/defaults/ingest.js +3 -4
- package/dist/interactions/actions/defaults/insertPathAnchor.js +2 -3
- package/dist/interactions/actions/defaults/nudge.js +3 -4
- package/dist/interactions/actions/defaults/nudgeSteps.js +2 -3
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
- package/dist/interactions/actions/defaults/pathEditMarks.js +3 -7
- package/dist/interactions/actions/defaults/pathEditMarks.js.map +1 -1
- package/dist/interactions/actions/defaults/pinchZoom.js +3 -4
- package/dist/interactions/actions/defaults/reorder.js +2 -3
- package/dist/interactions/actions/defaults/requiresSelection.js +1 -2
- package/dist/interactions/actions/defaults/segmentUnder.js +1 -2
- package/dist/interactions/actions/defaults/selectAll.js +1 -2
- package/dist/interactions/actions/defaults/selectDeep.js +1 -2
- package/dist/interactions/actions/defaults/setFill.js +1 -2
- package/dist/interactions/actions/defaults/setFillOpacity.js +1 -2
- package/dist/interactions/actions/defaults/setStroke.js +1 -2
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +1 -2
- package/dist/interactions/actions/defaults/slice.js +1 -2
- package/dist/interactions/actions/defaults/sliceOps.js +1 -2
- package/dist/interactions/actions/defaults/toolActivate.js +1 -2
- package/dist/interactions/actions/defaults/toolResetToDefault.js +1 -2
- package/dist/interactions/actions/defaults/undoRedo.js +1 -2
- package/dist/interactions/actions/defaults/viewportDragPan.js +1 -2
- package/dist/interactions/actions/defaults/viewportWheelPan.js +1 -2
- package/dist/interactions/actions/defaults/viewportZoom.js +3 -4
- package/dist/interactions/actions/distribute/action.js +4 -5
- package/dist/interactions/actions/distribute/distribute.js +5 -6
- package/dist/interactions/actions/distribute/plan.js +1 -2
- package/dist/interactions/actions/drawnBoxes.js +4 -5
- package/dist/interactions/actions/dropVerdict.js +1 -2
- package/dist/interactions/actions/edit-anchors/action.js +4 -5
- package/dist/interactions/actions/edit-anchors/extensionDrags.js +1 -2
- package/dist/interactions/actions/edit-anchors/geometry.js +1 -2
- package/dist/interactions/actions/edit-anchors/handleDrag.js +5 -9
- package/dist/interactions/actions/edit-anchors/handleDrag.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/handles.js +1 -2
- package/dist/interactions/actions/edit-anchors/params.js +1 -2
- package/dist/interactions/actions/edit-anchors/preview.js +1 -2
- package/dist/interactions/actions/edit-anchors/symmetry.js +1 -2
- package/dist/interactions/actions/flip/action.js +8 -9
- package/dist/interactions/actions/flip/helpers.js +1 -2
- package/dist/interactions/actions/geometryProjection.js +1 -2
- package/dist/interactions/actions/gestureFrames.js +3 -4
- package/dist/interactions/actions/gestureLifecycle.js +1 -2
- package/dist/interactions/actions/hitSelection.js +7 -3
- package/dist/interactions/actions/hitSelection.js.map +1 -1
- package/dist/interactions/actions/insert/action.js +6 -7
- package/dist/interactions/actions/insert/commit.js +2 -3
- package/dist/interactions/actions/insert/extras.js +1 -2
- package/dist/interactions/actions/insert/frame.js +1 -2
- package/dist/interactions/actions/insert/geometry.js +1 -2
- package/dist/interactions/actions/insert/params.js +2 -3
- package/dist/interactions/actions/insert/parent.js +1 -2
- package/dist/interactions/actions/insert/placeAction.js +5 -6
- package/dist/interactions/actions/insert/repositionAction.js +1 -2
- package/dist/interactions/actions/insert/rotateAction.js +1 -2
- package/dist/interactions/actions/insert/session.js +5 -6
- package/dist/interactions/actions/insert/shape.js +2 -3
- package/dist/interactions/actions/lasso-select/action.js +9 -9
- package/dist/interactions/actions/lasso-select/action.js.map +1 -1
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +2 -3
- package/dist/interactions/actions/magnification.js +37 -0
- package/dist/interactions/actions/magnification.js.map +1 -0
- package/dist/interactions/actions/move/action.js +2 -3
- package/dist/interactions/actions/move/behaviors/clampMove.js +42 -0
- package/dist/interactions/actions/move/behaviors/clampMove.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +2 -3
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +2 -3
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +1 -2
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +2 -3
- package/dist/interactions/actions/move/capture.js +6 -7
- package/dist/interactions/actions/move/commit/index.js +2 -3
- package/dist/interactions/actions/move/commit/layoutDrop.js +4 -5
- package/dist/interactions/actions/move/commit/layoutRelease.js +7 -8
- package/dist/interactions/actions/move/commit/rebase.js +2 -3
- package/dist/interactions/actions/move/commit/reparent.js +5 -6
- package/dist/interactions/actions/move/delta.js +2 -3
- package/dist/interactions/actions/move/frame.js +2 -3
- package/dist/interactions/actions/move/gestureAdapter.js +1 -2
- package/dist/interactions/actions/move/landedDescendants.js +2 -3
- package/dist/interactions/actions/move/layout/container.js +6 -10
- package/dist/interactions/actions/move/layout/container.js.map +1 -1
- package/dist/interactions/actions/move/layout/dragged.js +2 -3
- package/dist/interactions/actions/move/layout/dropPass.js +5 -6
- package/dist/interactions/actions/move/layout/exits.js +4 -5
- package/dist/interactions/actions/move/layout/exits.js.map +1 -1
- package/dist/interactions/actions/move/layout/glide.js +2 -3
- package/dist/interactions/actions/move/layout/view.js +1 -2
- package/dist/interactions/actions/move/refusal.js +2 -3
- package/dist/interactions/actions/move/session.js +4 -5
- package/dist/interactions/actions/move/translate.js +2 -3
- package/dist/interactions/actions/moveNodes.js +5 -6
- package/dist/interactions/actions/notices.js +1 -2
- package/dist/interactions/actions/outlines/createOutlines.js +1 -2
- package/dist/interactions/actions/outlines/createOutlinesAction.js +2 -3
- package/dist/interactions/actions/outlines/outlineStroke.js +2 -3
- package/dist/interactions/actions/outlines/outlineStrokeAction.js +2 -3
- package/dist/interactions/actions/outlines/replaceWithPaths.js +5 -6
- package/dist/interactions/actions/outlines/strokeRegion.js +1 -2
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +1 -2
- package/dist/interactions/actions/pathCommands/cutJoin.js +3 -4
- package/dist/interactions/actions/pathCommands/livePathEdit.js +3 -4
- package/dist/interactions/actions/pathCommands/pathNodes.js +3 -4
- package/dist/interactions/actions/pathCommands/simplifyOffset.js +2 -3
- package/dist/interactions/actions/pathGestureTags.js +1 -2
- package/dist/interactions/actions/planeInput.js +2 -3
- package/dist/interactions/actions/pointerState.js +1 -2
- package/dist/interactions/actions/poseDescriptorDep.js +1 -2
- package/dist/interactions/actions/poseFrame.js +3 -4
- package/dist/interactions/actions/resize/action.js +3 -4
- package/dist/interactions/actions/resize/aspect.js +1 -2
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js +1 -2
- package/dist/interactions/actions/resize/boxFrame.js +1 -2
- package/dist/interactions/actions/resize/capture.js +7 -8
- package/dist/interactions/actions/resize/commit.js +3 -4
- package/dist/interactions/actions/resize/cornerHandles.js +1 -2
- package/dist/interactions/actions/resize/frame.js +7 -8
- package/dist/interactions/actions/resize/held.js +2 -3
- package/dist/interactions/actions/resize/minimum.js +1 -2
- package/dist/interactions/actions/resize/replay.js +1 -2
- package/dist/interactions/actions/resize/ruleBounds.js +1 -2
- package/dist/interactions/actions/resize/session.js +9 -10
- package/dist/interactions/actions/resolveOverlays.js +1 -2
- package/dist/interactions/actions/resolvePreviews.js +3 -4
- package/dist/interactions/actions/rotate/action.js +5 -6
- package/dist/interactions/actions/rotate/commit.js +2 -3
- package/dist/interactions/actions/rotate/frame.js +3 -4
- package/dist/interactions/actions/rotate/geometry.js +1 -2
- package/dist/interactions/actions/rotate/handle.js +2 -3
- package/dist/interactions/actions/rotate/replay.js +2 -3
- package/dist/interactions/actions/rotate/session.js +10 -11
- package/dist/interactions/actions/selectionSubtree.js +7 -22
- package/dist/interactions/actions/selectionSubtree.js.map +1 -1
- package/dist/interactions/actions/spatialReference.js +1 -2
- package/dist/interactions/actions/testUtils.js +1 -2
- package/dist/interactions/actions/transform-again/action.js +5 -6
- package/dist/interactions/actions/transform-again/memory.js +3 -4
- package/dist/interactions/actions/transform-again/memory.js.map +1 -1
- package/dist/interactions/actions/transformFinish.js +1 -2
- package/dist/interactions/actions/useActionSet.js +1 -2
- package/dist/interactions/actions/useNotices.js +1 -2
- package/dist/interactions/actions/useStandardActions.js +1 -2
- package/dist/interactions/gestures/dragGesture/dragGesture.js +1 -2
- package/dist/interactions/gestures/dragGesture/dragPointOf.js +1 -2
- package/dist/interactions/gestures/dragRadial/dragRadial.js +2 -3
- package/dist/interactions/gestures/dragRect/dragRect.js +2 -3
- package/dist/interactions/gestures/handleDrag/handleDrag.js +1 -2
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +1 -2
- package/dist/interactions/gestures/shared/originProjection.js +1 -2
- package/dist/interactions/gestures/shared/screenTolerance.js +1 -2
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +1 -2
- package/dist/kitSettingsSchema.js +4 -5
- package/dist/move.d.ts +18 -3
- package/dist/move.js +2 -1
- package/dist/test-hook/createTestHook.js +1 -2
- package/dist/test-hook/install.js +1 -2
- package/dist/test-hook/useTestHook.js +1 -2
- package/dist/test-seams.d.ts +4 -4
- package/dist/test-seams.js +2 -2
- package/dist/tools/builtin/anchors/anchorsTool.js +1 -2
- package/dist/tools/builtin/ellipse/useEllipseTool.js +2 -3
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js +1 -2
- package/dist/tools/builtin/hand/dragPanContribution.js +1 -2
- package/dist/tools/builtin/hand/useHandTool.js +1 -2
- package/dist/tools/builtin/image/useImageTool.js +1 -2
- package/dist/tools/builtin/lasso/useLassoTool.js +1 -2
- package/dist/tools/builtin/line/useLineTool.js +2 -3
- package/dist/tools/builtin/measure/useMeasureTool.js +2 -3
- package/dist/tools/builtin/pen/penHandle.js +1 -2
- package/dist/tools/builtin/pen/usePenTool.js +6 -7
- package/dist/tools/builtin/pencil/usePencilTool.js +1 -2
- package/dist/tools/builtin/pickTopMostHit.js +1 -2
- package/dist/tools/builtin/polygon/usePolygonTool.js +3 -4
- package/dist/tools/builtin/pressTarget.js +1 -2
- package/dist/tools/builtin/rect/useRectTool.js +2 -3
- package/dist/tools/builtin/select/adapterPointQuery.js +3 -4
- package/dist/tools/builtin/select/collapseDeferred.js +1 -2
- package/dist/tools/builtin/select/groupEntry.js +2 -3
- package/dist/tools/builtin/select/pressDecision.js +3 -4
- package/dist/tools/builtin/select/pressDecision.js.map +1 -1
- package/dist/tools/builtin/select/selectionContributions.js +1 -2
- package/dist/tools/builtin/select/useSelectTool.js +5 -6
- package/dist/tools/builtin/shared/insertToolOptions.js +1 -2
- package/dist/tools/builtin/shared/pointerFollower.js +1 -2
- package/dist/tools/builtin/slice/useSliceTool.js +5 -6
- package/dist/tools/builtin/star/useStarTool.js +3 -4
- package/dist/tools/builtin/sticky/stickyNode.js +1 -2
- package/dist/tools/builtin/sticky/useStickyTool.js +2 -3
- package/dist/tools/builtin/text/useTextTool.js +1 -2
- package/dist/tools/index.js +2 -2
- package/dist/tools/overlayBinding.js +1 -2
- package/dist/tools/toolOptions.js +17 -4
- package/dist/tools/toolOptions.js.map +1 -1
- package/dist/tools/useKeybindings.js +1 -2
- package/dist/{types-DW14eu9B.d.ts → types-BUvUXZe5.d.ts} +3 -3
- package/dist/util/color.js +1 -2
- package/dist/util/paint.js +1 -2
- package/dist/version.js +2 -3
- package/package.json +27 -27
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SceneArrivalRefused } from "../../core/scene/arrivals.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/interactions/actions/gestureLifecycle.ts
|
|
4
4
|
/** The params entries for {@link GestureLifecycleOptions}, with the unset
|
|
5
5
|
* keys left out. */
|
|
6
6
|
function gestureLifecycleParams(o) {
|
|
@@ -114,6 +114,5 @@ function closeGesture(gesture, committed) {
|
|
|
114
114
|
runEvery([() => runBehaviorSettled(gesture.behaviors, gesture.ctx, committed), () => gesture.lifecycle.end(committed)], (step) => step());
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { closeGesture, commitGestureOps, gestureLifecycleParams, readGestureLifecycle, reduceBehaviorEnd, runBehaviorCancel, runBehaviorSettled };
|
|
119
118
|
//# sourceMappingURL=gestureLifecycle.js.map
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interactions/actions/hitSelection.ts
|
|
2
|
+
/** What selecting `hits` selects: each hit's `targetOf`, first answer kept,
|
|
3
|
+
* or the hits themselves when there is no `targetOf`. */
|
|
4
|
+
function hitTargets(hits, targetOf) {
|
|
5
|
+
return targetOf ? [...new Set(hits.map(targetOf))] : [...hits];
|
|
6
|
+
}
|
|
2
7
|
/** The selection a hit list leaves behind: the hits alone, or, when the
|
|
3
8
|
* gesture extends the selection, the current ids with the new hits after them. */
|
|
4
9
|
function selectionFromHits(current, hits, extend) {
|
|
5
10
|
return [...new Set(extend ? [...current, ...hits] : hits)];
|
|
6
11
|
}
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
export { selectionFromHits };
|
|
13
|
+
export { hitTargets, selectionFromHits };
|
|
10
14
|
//# sourceMappingURL=hitSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hitSelection.js","names":[],"sources":["../../../src/interactions/actions/hitSelection.ts"],"sourcesContent":["/** The selection a hit list leaves behind: the hits alone, or, when the\n * gesture extends the selection, the current ids with the new hits after them. */\nexport function selectionFromHits<T extends string>(\n current: readonly T[],\n hits: readonly T[],\n extend: boolean,\n): T[] {\n return [...new Set(extend ? [...current, ...hits] : hits)];\n}\n"],"mappings":";;;AAEA,SAAgB,kBACd,SACA,MACA,QACK;CACL,OAAO,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,IAAI,IAAI,CAAC;AAC3D"}
|
|
1
|
+
{"version":3,"file":"hitSelection.js","names":[],"sources":["../../../src/interactions/actions/hitSelection.ts"],"sourcesContent":["/** What selecting `hits` selects: each hit's `targetOf`, first answer kept,\n * or the hits themselves when there is no `targetOf`. */\nexport function hitTargets<T extends string>(hits: readonly T[], targetOf?: (id: T) => T): T[] {\n return targetOf ? [...new Set(hits.map(targetOf))] : [...hits];\n}\n\n/** The selection a hit list leaves behind: the hits alone, or, when the\n * gesture extends the selection, the current ids with the new hits after them. */\nexport function selectionFromHits<T extends string>(\n current: readonly T[],\n hits: readonly T[],\n extend: boolean,\n): T[] {\n return [...new Set(extend ? [...current, ...hits] : hits)];\n}\n"],"mappings":";;;AAEA,SAAgB,WAA6B,MAAoB,UAA8B;CAC7F,OAAO,WAAW,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/D;;;AAIA,SAAgB,kBACd,SACA,MACA,QACK;CACL,OAAO,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,IAAI,IAAI,CAAC;AAC3D"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shapeKindInfo } from "../../../core/shapeKinds.js";
|
|
2
|
+
import { SNAP_ROLES } from "../../../domains/snap/roles.js";
|
|
2
3
|
import { runBehaviorSettled } from "../gestureLifecycle.js";
|
|
3
4
|
import { inPlane, insertLayer } from "../planeInput.js";
|
|
4
|
-
import { SNAP_ROLES } from "../../../domains/snap/roles.js";
|
|
5
|
-
import { shapeKindInfo } from "../../../core/shapeKinds.js";
|
|
6
5
|
import { copiesWithin } from "../../../canvas/copiesAbove.js";
|
|
7
|
-
import {
|
|
6
|
+
import { scenePaintedPoseOf } from "../../../canvas/derivedPath.js";
|
|
8
7
|
import { cancelInsert, commitInsert } from "./commit.js";
|
|
9
|
-
import { beginInsert } from "./session.js";
|
|
10
8
|
import { carryStart, nextFrame } from "./frame.js";
|
|
11
9
|
import { insertParams } from "./params.js";
|
|
10
|
+
import { beginInsert } from "./session.js";
|
|
11
|
+
import { insertKind, insertShape } from "./shape.js";
|
|
12
12
|
import { resolveParams } from "@weasel-js/routing";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// src/interactions/actions/insert/action.ts
|
|
15
15
|
/** How far, in CSS pixels, a drag travels before it draws a shape: past the wobble of a click, so a
|
|
16
16
|
* press that drifts a few pixels draws nothing rather than a shape a few pixels wide. */
|
|
17
17
|
var INSERT_DRAG_THRESHOLD_PX = 8;
|
|
@@ -126,6 +126,5 @@ var insertAction = inPlane({
|
|
|
126
126
|
enabled: () => true
|
|
127
127
|
}, insertLayer);
|
|
128
128
|
|
|
129
|
-
//#endregion
|
|
130
129
|
export { INSERT_DRAG_THRESHOLD_PX, insertAction };
|
|
131
130
|
//# sourceMappingURL=action.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defaultCommitAdapter } from "../defaultCommitAdapter.js";
|
|
2
2
|
import { commitGestureOps, readGestureLifecycle, reduceBehaviorEnd, runBehaviorCancel } from "../gestureLifecycle.js";
|
|
3
|
-
import { shapeKindInfo } from "../../../core/shapeKinds.js";
|
|
4
3
|
import { insertShape, isCommittableExtent } from "./shape.js";
|
|
4
|
+
import { shapeKindInfo } from "../../../core/shapeKinds.js";
|
|
5
5
|
import { resolveParams } from "@weasel-js/routing";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/interactions/actions/insert/commit.ts
|
|
8
8
|
/**
|
|
9
9
|
* A freshly inserted text box is empty, so it draws nothing and the tool's own
|
|
10
10
|
* `click on selected body → enterTextEdit` binding has nothing visible to
|
|
@@ -45,6 +45,5 @@ function commitInsert(session, frame, points, userRotation) {
|
|
|
45
45
|
return id !== null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
//#endregion
|
|
49
48
|
export { cancelInsert, commitInsert, enterInsertedText };
|
|
50
49
|
//# sourceMappingURL=commit.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interactions/actions/insert/extras.ts
|
|
2
2
|
/** Build a typed `InsertExtras` from the static params + gesture context.
|
|
3
3
|
* Kit-built-in kinds (line / polygon / star / pencil) read kind-specific
|
|
4
4
|
* fields; unknown kinds pass the raw params through as `{ kind, ... }`. */
|
|
@@ -82,6 +82,5 @@ function applyUserRotation(extras, userRotation) {
|
|
|
82
82
|
if (extras.kind === "star" || extras.kind === "polygon") extras.rotation += userRotation;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
//#endregion
|
|
86
85
|
export { applyUserRotation, buildExtras };
|
|
87
86
|
//# sourceMappingURL=extras.js.map
|
|
@@ -4,7 +4,7 @@ import { computeBounds, effectiveOriginMode } from "./geometry.js";
|
|
|
4
4
|
import { GESTURE_KEY } from "./session.js";
|
|
5
5
|
import { resolveParams } from "@weasel-js/routing";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/interactions/actions/insert/frame.ts
|
|
8
8
|
/**
|
|
9
9
|
* Shape the raw pointer into the drag's endpoints: the snap session (with
|
|
10
10
|
* the line kind's Shift step as its input subspace, about the snapped
|
|
@@ -69,6 +69,5 @@ function nextFrame(session, readers, prev, moveCtx) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
//#endregion
|
|
73
72
|
export { carryStart, nextFrame };
|
|
74
73
|
//# sourceMappingURL=frame.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interactions/actions/insert/geometry.ts
|
|
2
2
|
/** Resolve the effective origin mode from the binding's nominal opt
|
|
3
3
|
* and live Alt state. Alt inverts: `corner` ⇄ `center`. Applies to
|
|
4
4
|
* every shape kind — radial shapes (polygon/star) included; the
|
|
@@ -34,6 +34,5 @@ function computeBounds(startX, startY, currentX, currentY, originMode) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { computeBounds, effectiveOriginMode };
|
|
39
38
|
//# sourceMappingURL=geometry.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { insertKind } from "./shape.js";
|
|
2
1
|
import { SHAPE_COUNT_RANGE, STAR_RATIO_RANGE } from "../../../domains/paths/shapeGenerator.js";
|
|
2
|
+
import { insertKind } from "./shape.js";
|
|
3
3
|
import { pref } from "@weasel-js/prefs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/interactions/actions/insert/params.ts
|
|
6
6
|
/** A polygon insert's params as a form, for the last-operation panel. */
|
|
7
7
|
var POLYGON_INSERT_PARAMS = pref.group("Polygon", { sides: pref.number("Sides", 6, {
|
|
8
8
|
min: SHAPE_COUNT_RANGE.min,
|
|
@@ -38,6 +38,5 @@ function insertParams(params) {
|
|
|
38
38
|
return kind === "polygon" ? POLYGON_INSERT_PARAMS : kind === "star" ? STAR_INSERT_PARAMS : null;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
export { POLYGON_INSERT_PARAMS, STAR_INSERT_PARAMS, insertParams };
|
|
43
42
|
//# sourceMappingURL=params.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { admitsChild } from "../admitsChild.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/interactions/actions/insert/parent.ts
|
|
4
4
|
/** The node an insert lands in: the one the `insertInto` dep's `into` names when
|
|
5
5
|
* it exists and admits the insert, or null, the top of the tree. */
|
|
6
6
|
function insertParent(scene, into, canDropInto) {
|
|
@@ -8,6 +8,5 @@ function insertParent(scene, into, canDropInto) {
|
|
|
8
8
|
return admitsChild(scene, into, [], canDropInto) ? into : null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//#endregion
|
|
12
11
|
export { insertParent };
|
|
13
12
|
//# sourceMappingURL=parent.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { insertParent } from "./parent.js";
|
|
2
|
-
import { inPlane, insertLayer } from "../planeInput.js";
|
|
3
1
|
import { SNAP_ROLES, snapMods } from "../../../domains/snap/roles.js";
|
|
4
|
-
import {
|
|
5
|
-
import { insertKind } from "./shape.js";
|
|
2
|
+
import { inPlane, insertLayer } from "../planeInput.js";
|
|
6
3
|
import { enterInsertedText } from "./commit.js";
|
|
4
|
+
import { insertParent } from "./parent.js";
|
|
5
|
+
import { insertKind } from "./shape.js";
|
|
6
|
+
import { minSizeOf } from "../../../core/scene/minSize.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/interactions/actions/insert/placeAction.ts
|
|
9
9
|
/** What the dispatcher lays under an immediate action's params for a click. */
|
|
10
10
|
var CLICK_FIELDS = [
|
|
11
11
|
"world",
|
|
@@ -107,6 +107,5 @@ var placeAction = inPlane({
|
|
|
107
107
|
enabled: () => true
|
|
108
108
|
}, insertLayer);
|
|
109
109
|
|
|
110
|
-
//#endregion
|
|
111
110
|
export { placeAction };
|
|
112
111
|
//# sourceMappingURL=placeAction.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { heldKeySpec } from "@weasel-js/routing";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/interactions/actions/insert/repositionAction.ts
|
|
4
4
|
/**
|
|
5
5
|
* Companion to `insertAction`: while its key is held, dragging moves the
|
|
6
6
|
* shape being drawn instead of resizing it; letting go resumes resizing from
|
|
@@ -42,6 +42,5 @@ var INSERT_REPOSITION_BINDING = {
|
|
|
42
42
|
opts: { id: "insert.reposition.held" }
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { INSERT_REPOSITION_BINDING, insertRepositionAction };
|
|
47
46
|
//# sourceMappingURL=repositionAction.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interactions/actions/insert/rotateAction.ts
|
|
2
2
|
/** Radians per unit of wheel deltaY. Tuned so a typical mouse-wheel click
|
|
3
3
|
* (deltaY ≈ 100) yields ~25°, while a trackpad event (deltaY ≈ 1–10)
|
|
4
4
|
* yields a smooth 0.25–2.5° increment. */
|
|
@@ -27,6 +27,5 @@ var insertRotateAction = {
|
|
|
27
27
|
requires: ["insertLive"]
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
export { insertRotateAction };
|
|
32
31
|
//# sourceMappingURL=rotateAction.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { insertParent } from "./parent.js";
|
|
2
|
-
import { gestureReaders } from "../../gestures/shared/screenTolerance.js";
|
|
3
|
-
import { pointerStateOf } from "../pointerState.js";
|
|
4
1
|
import { SNAP_ANGLE_STEP, snapMods } from "../../../domains/snap/roles.js";
|
|
5
|
-
import { insertKind } from "./shape.js";
|
|
6
2
|
import { spanSnap } from "../../../domains/snap/spanSnap.js";
|
|
3
|
+
import { pointerStateOf } from "../pointerState.js";
|
|
4
|
+
import { gestureReaders } from "../../gestures/shared/screenTolerance.js";
|
|
5
|
+
import { insertParent } from "./parent.js";
|
|
6
|
+
import { insertKind } from "./shape.js";
|
|
7
7
|
import { resolveParams } from "@weasel-js/routing";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/interactions/actions/insert/session.ts
|
|
10
10
|
/** The key an insert's single gesture point rides under in the behaviors'
|
|
11
11
|
* `draggedIds` / `origin` / `current` — insert has no node id yet. */
|
|
12
12
|
var GESTURE_KEY = "gesture";
|
|
@@ -74,6 +74,5 @@ function beginInsert(ctx, opts) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
//#endregion
|
|
78
77
|
export { GESTURE_KEY, beginInsert };
|
|
79
78
|
//# sourceMappingURL=session.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { minSizeOf } from "../../../core/scene/minSize.js";
|
|
2
1
|
import { applyUserRotation, buildExtras } from "./extras.js";
|
|
3
2
|
import { computeBounds, effectiveOriginMode } from "./geometry.js";
|
|
3
|
+
import { minSizeOf } from "../../../core/scene/minSize.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/interactions/actions/insert/shape.ts
|
|
6
6
|
/** The node kind a binding's resolved params ask for. */
|
|
7
7
|
function insertKind(resolved) {
|
|
8
8
|
return resolved?.["kind"] ?? "rect";
|
|
@@ -87,6 +87,5 @@ function isCommittableExtent(bounds, kind) {
|
|
|
87
87
|
return bounds.width !== 0 && bounds.height !== 0;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
//#endregion
|
|
91
90
|
export { insertKind, insertShape, isCommittableExtent };
|
|
92
91
|
//# sourceMappingURL=shape.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { applyOpsTo } from "../../../core/applyOps.js";
|
|
2
|
-
import { reduceBehaviorEnd, runBehaviorCancel, runBehaviorSettled } from "../gestureLifecycle.js";
|
|
3
1
|
import { gestureViewReader } from "../../gestures/shared/screenTolerance.js";
|
|
4
2
|
import { pointerStateOf } from "../pointerState.js";
|
|
5
|
-
import {
|
|
3
|
+
import { applyOpsTo } from "../../../core/applyOps.js";
|
|
6
4
|
import { LASSO_VERTICES } from "./behaviors/selectFromLasso.js";
|
|
5
|
+
import { reduceBehaviorEnd, runBehaviorCancel, runBehaviorSettled } from "../gestureLifecycle.js";
|
|
6
|
+
import { hitTargets, selectionFromHits } from "../hitSelection.js";
|
|
7
7
|
import { resolveParams, setScratch } from "@weasel-js/routing";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/interactions/actions/lasso-select/action.ts
|
|
10
10
|
/**
|
|
11
11
|
* `lassoSelectAction` — ongoing Action descriptor for polygon lasso selection.
|
|
12
12
|
*
|
|
@@ -43,11 +43,12 @@ function polygonAABB(pts) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
/** The dep's polygon test, or its rect test over the polygon's AABB when it
|
|
46
|
-
* has none
|
|
46
|
+
* has none, each hit taken at the depth a click selects. What both the
|
|
47
|
+
* default commit and a behavior's adapter ask. */
|
|
47
48
|
function hitTestPolygon(dep, vertices, mode, view) {
|
|
48
|
-
if (dep.hitTestLasso) return dep.hitTestLasso(vertices, mode, view);
|
|
49
|
+
if (dep.hitTestLasso) return hitTargets(dep.hitTestLasso(vertices, mode, view), dep.targetOf);
|
|
49
50
|
const aabb = polygonAABB(vertices);
|
|
50
|
-
return aabb ? dep.hitTestArea(aabb, view) : [];
|
|
51
|
+
return aabb ? hitTargets(dep.hitTestArea(aabb, view), dep.targetOf) : [];
|
|
51
52
|
}
|
|
52
53
|
/** The adapter a behavior sees: selection and hit-testing from the dep,
|
|
53
54
|
* scoped to the view the lasso started in. */
|
|
@@ -55,7 +56,7 @@ function behaviorAdapter(dep, view) {
|
|
|
55
56
|
const adapter = {
|
|
56
57
|
getSelection: () => dep.getSelection(),
|
|
57
58
|
setSelection: (ids) => dep.setSelection(ids),
|
|
58
|
-
hitTestArea: (rect) => dep.hitTestArea(rect, view),
|
|
59
|
+
hitTestArea: (rect) => hitTargets(dep.hitTestArea(rect, view), dep.targetOf),
|
|
59
60
|
hitTestLasso: (polygon, mode) => hitTestPolygon(dep, polygon, mode, view),
|
|
60
61
|
applyOps: (ops) => applyOpsTo(adapter, ops)
|
|
61
62
|
};
|
|
@@ -198,6 +199,5 @@ function endLasso(scratch, reason) {
|
|
|
198
199
|
return true;
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
//#endregion
|
|
202
202
|
export { lassoSelectAction };
|
|
203
203
|
//# sourceMappingURL=action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","names":[],"sources":["../../../../src/interactions/actions/lasso-select/action.ts"],"sourcesContent":["/**\n * `lassoSelectAction` — ongoing Action descriptor for polygon lasso selection.\n *\n * A move adds a vertex unless it is closer than the binding's\n * `params.minVertexSpacing` (default 2 world-px) to the last one. The commit\n * hit-tests the polygon with `dep.hitTestLasso(polygon, mode)` — `mode` from\n * the binding's `params.mode`, default `'intersect'` — falling back to the\n * polygon's AABB via `dep.hitTestArea(bounds)`. Shift extends the selection.\n * Always transient: no undo entry.\n *\n * `opts.behaviors` (`LassoSelectBehavior[]`) run over a `GestureContext`\n * whose `origin.get('gesture')` is the start pose, whose scratch holds the\n * vertices under `LASSO_VERTICES`, and whose adapter answers selection and\n * hit-testing from the `lassoSelect` dep. `onEnd` is first-non-undefined-wins:\n * `Op[]` is applied in place of the default selection, `null` aborts, and\n * all-`undefined` falls through to it. A behavior's ops are applied\n * transiently too.\n */\n\nimport { gestureViewReader } from '../../gestures/shared/screenTolerance';\nimport { resolveParams, setScratch, type Action } from '@weasel-js/routing';\nimport type { InvocationCtx, OngoingHandle, OngoingOverlay, Point2 } from '@weasel-js/routing';\nimport { pointerStateOf } from '../pointerState';\nimport type { LassoSelectDep, ViewApi } from '../depSchema';\nimport type { LassoHitMode, LassoSelectAdapter } from 'core/adapters/types';\nimport type { Op } from 'core/ops/types';\nimport { applyOpsTo } from 'core/applyOps';\nimport type { GestureContext, LassoSelectBehavior, LassoSelectPose } from '../../gestures/types';\nimport { LASSO_VERTICES } from './behaviors/selectFromLasso';\nimport { reduceBehaviorEnd, runBehaviorCancel, runBehaviorSettled } from '../gestureLifecycle';\nimport { selectionFromHits } from '../hitSelection';\n\n/** Compute AABB of a polygon (for fallback hit-test when hitTestLasso is absent). */\nfunction polygonAABB(\n pts: Point2[],\n): { x: number; y: number; width: number; height: number } | null {\n if (pts.length === 0) return null;\n let minX = pts[0].x, minY = pts[0].y, maxX = pts[0].x, maxY = pts[0].y;\n for (const p of pts) {\n if (p.x < minX) minX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.x > maxX) maxX = p.x;\n if (p.y > maxY) maxY = p.y;\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n\n/** The dep's polygon test, or its rect test over the polygon's AABB when it\n * has none. What both the default commit and a behavior's adapter ask. */\nfunction hitTestPolygon(\n dep: LassoSelectDep,\n vertices: ReadonlyArray<Point2>,\n mode: LassoHitMode,\n view: ViewApi | undefined,\n): string[] {\n if (dep.hitTestLasso) return dep.hitTestLasso(vertices, mode, view);\n const aabb = polygonAABB(vertices as Point2[]);\n return aabb ? dep.hitTestArea(aabb, view) : [];\n}\n\n/** The adapter a behavior sees: selection and hit-testing from the dep,\n * scoped to the view the lasso started in. */\nfunction behaviorAdapter(dep: LassoSelectDep, view: ViewApi | undefined): LassoSelectAdapter {\n const adapter: LassoSelectAdapter = {\n getSelection: () => dep.getSelection(),\n setSelection: (ids) => dep.setSelection(ids),\n hitTestArea: (rect) => dep.hitTestArea(rect, view),\n hitTestLasso: (polygon, mode) => hitTestPolygon(dep, polygon, mode, view),\n applyOps: (ops: Op[]) => applyOpsTo(adapter, ops),\n };\n return adapter;\n}\n\nconst DEFAULT_MIN_VERTEX_SPACING = 2; // world-px\n\ninterface LassoScratch {\n dep: LassoSelectDep;\n mode: LassoHitMode;\n minVertexSpacing: number;\n /** The view the lasso started in: what it does not paint is not taken. */\n view: ViewApi | undefined;\n vertices: Point2[];\n shiftHeld: boolean;\n /** Current pointer position — paint the live \"close-line\" from the last\n * vertex back to the start while the gesture is open. Tracked separately\n * from `vertices` because we throttle vertex insertion. */\n currentX: number;\n currentY: number;\n /** Cleared by `onEnd` so post-commit `overlay()` returns null. */\n open: boolean;\n behaviors: LassoSelectBehavior[];\n /** Built only when there are behaviors to hand it to. */\n gesture: GestureContext<LassoSelectPose> | null;\n}\n\n/**\n * Static descriptor for the `lassoSelect` Action.\n */\nexport const lassoSelectAction: Action & { requires: string[] } = {\n id: 'lassoSelect',\n label: 'Lasso Select',\n eligible: { capability: 'creates-selection' },\n requires: ['lassoSelect', 'view'],\n invoker: {\n timing: 'ongoing',\n start(ctx: InvocationCtx, opts): OngoingHandle {\n const dep = ctx.deps.lassoSelect;\n if (!dep) return {};\n\n const params = resolveParams(opts?.params) as\n { mode?: LassoHitMode; minVertexSpacing?: number } | undefined;\n const view = ctx.deps.view;\n const vertices: Point2[] = [{ x: ctx.world.x, y: ctx.world.y }];\n const behaviors = (opts?.behaviors ?? []) as LassoSelectBehavior[];\n let gesture: GestureContext<LassoSelectPose> | null = null;\n const readView = gestureViewReader(ctx.deps);\n if (behaviors.length > 0) {\n const pose: LassoSelectPose = {\n worldX: ctx.world.x, worldY: ctx.world.y, shiftHeld: ctx.modifiers.shift,\n };\n gesture = {\n draggedIds: ['gesture'],\n origin: new Map([['gesture', pose]]),\n current: new Map([['gesture', { ...pose }]]),\n snap: null,\n modifiers: { ...ctx.modifiers },\n pointer: pointerStateOf(ctx.world, ctx),\n view: readView(),\n adapter: behaviorAdapter(dep, view) as unknown as GestureContext<LassoSelectPose>['adapter'],\n scratch: {},\n };\n // The live array, so a behavior reads every vertex added since.\n setScratch(gesture.scratch, LASSO_VERTICES, vertices);\n for (const b of behaviors) b.onStart?.(gesture);\n }\n const scratch: LassoScratch = {\n dep,\n mode: params?.mode ?? 'intersect',\n minVertexSpacing: params?.minVertexSpacing ?? DEFAULT_MIN_VERTEX_SPACING,\n view,\n vertices,\n shiftHeld: ctx.modifiers.shift,\n currentX: ctx.world.x,\n currentY: ctx.world.y,\n open: true,\n behaviors,\n gesture,\n };\n\n return {\n kind: 'lasso',\n onMove(moveCtx: InvocationCtx): void {\n const { x, y } = moveCtx.world;\n scratch.currentX = x;\n scratch.currentY = y;\n const last = scratch.vertices[scratch.vertices.length - 1];\n const dx = x - last.x;\n const dy = y - last.y;\n const min = scratch.minVertexSpacing;\n if (dx * dx + dy * dy >= min * min) {\n scratch.vertices.push({ x, y });\n }\n const g = scratch.gesture;\n if (g) {\n g.modifiers = { ...moveCtx.modifiers };\n g.pointer = pointerStateOf(moveCtx.world, moveCtx);\n g.view = readView();\n g.current.set('gesture', { worldX: x, worldY: y, shiftHeld: scratch.shiftHeld });\n const proposed = { vertices: scratch.vertices, shiftHeld: scratch.shiftHeld };\n for (const b of scratch.behaviors) b.onMove?.(g, proposed);\n }\n },\n overlay(): OngoingOverlay | null {\n if (!scratch.open) return null;\n return {\n kind: 'lasso',\n vertices: scratch.vertices,\n current: { x: scratch.currentX, y: scratch.currentY },\n shiftHeld: scratch.shiftHeld,\n };\n },\n onEnd(_endCtx: InvocationCtx, reason: 'commit' | 'cancel'): void {\n let committed = false;\n try {\n committed = endLasso(scratch, reason);\n } finally {\n if (scratch.gesture) runBehaviorSettled(scratch.behaviors, scratch.gesture, committed);\n }\n },\n };\n },\n },\n enabled: () => true,\n};\n\n/** Close the lasso. Returns whether it committed: a behavior's ops were\n * applied, or the lasso set the selection. */\nfunction endLasso(scratch: LassoScratch, reason: 'commit' | 'cancel'): boolean {\n scratch.open = false;\n if (reason === 'cancel') {\n if (scratch.gesture) runBehaviorCancel(scratch.behaviors, scratch.gesture);\n return false;\n }\n\n const { dep: d, mode, view, vertices, shiftHeld, gesture: g } = scratch;\n\n if (g) {\n const r = reduceBehaviorEnd(scratch.behaviors, g);\n if (r !== undefined) {\n if (r !== null) (g.adapter as unknown as LassoSelectAdapter).applyOps!(r);\n return r !== null;\n }\n }\n\n // Need at least 3 vertices for a meaningful polygon; otherwise no-op.\n if (vertices.length < 3) {\n if (!shiftHeld) d.setSelection([]);\n return !shiftHeld;\n }\n\n const hits = hitTestPolygon(d, vertices, mode, view);\n\n d.setSelection(selectionFromHits(d.getSelection(), hits, shiftHeld));\n return true;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"action.js","names":[],"sources":["../../../../src/interactions/actions/lasso-select/action.ts"],"sourcesContent":["/**\n * `lassoSelectAction` — ongoing Action descriptor for polygon lasso selection.\n *\n * A move adds a vertex unless it is closer than the binding's\n * `params.minVertexSpacing` (default 2 world-px) to the last one. The commit\n * hit-tests the polygon with `dep.hitTestLasso(polygon, mode)` — `mode` from\n * the binding's `params.mode`, default `'intersect'` — falling back to the\n * polygon's AABB via `dep.hitTestArea(bounds)`. Shift extends the selection.\n * Always transient: no undo entry.\n *\n * `opts.behaviors` (`LassoSelectBehavior[]`) run over a `GestureContext`\n * whose `origin.get('gesture')` is the start pose, whose scratch holds the\n * vertices under `LASSO_VERTICES`, and whose adapter answers selection and\n * hit-testing from the `lassoSelect` dep. `onEnd` is first-non-undefined-wins:\n * `Op[]` is applied in place of the default selection, `null` aborts, and\n * all-`undefined` falls through to it. A behavior's ops are applied\n * transiently too.\n */\n\nimport { gestureViewReader } from '../../gestures/shared/screenTolerance';\nimport { resolveParams, setScratch, type Action } from '@weasel-js/routing';\nimport type { InvocationCtx, OngoingHandle, OngoingOverlay, Point2 } from '@weasel-js/routing';\nimport { pointerStateOf } from '../pointerState';\nimport type { LassoSelectDep, ViewApi } from '../depSchema';\nimport type { LassoHitMode, LassoSelectAdapter } from 'core/adapters/types';\nimport type { Op } from 'core/ops/types';\nimport { applyOpsTo } from 'core/applyOps';\nimport type { GestureContext, LassoSelectBehavior, LassoSelectPose } from '../../gestures/types';\nimport { LASSO_VERTICES } from './behaviors/selectFromLasso';\nimport { reduceBehaviorEnd, runBehaviorCancel, runBehaviorSettled } from '../gestureLifecycle';\nimport { hitTargets, selectionFromHits } from '../hitSelection';\n\n/** Compute AABB of a polygon (for fallback hit-test when hitTestLasso is absent). */\nfunction polygonAABB(\n pts: Point2[],\n): { x: number; y: number; width: number; height: number } | null {\n if (pts.length === 0) return null;\n let minX = pts[0].x, minY = pts[0].y, maxX = pts[0].x, maxY = pts[0].y;\n for (const p of pts) {\n if (p.x < minX) minX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.x > maxX) maxX = p.x;\n if (p.y > maxY) maxY = p.y;\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n\n/** The dep's polygon test, or its rect test over the polygon's AABB when it\n * has none, each hit taken at the depth a click selects. What both the\n * default commit and a behavior's adapter ask. */\nfunction hitTestPolygon(\n dep: LassoSelectDep,\n vertices: ReadonlyArray<Point2>,\n mode: LassoHitMode,\n view: ViewApi | undefined,\n): string[] {\n if (dep.hitTestLasso) return hitTargets(dep.hitTestLasso(vertices, mode, view), dep.targetOf);\n const aabb = polygonAABB(vertices as Point2[]);\n return aabb ? hitTargets(dep.hitTestArea(aabb, view), dep.targetOf) : [];\n}\n\n/** The adapter a behavior sees: selection and hit-testing from the dep,\n * scoped to the view the lasso started in. */\nfunction behaviorAdapter(dep: LassoSelectDep, view: ViewApi | undefined): LassoSelectAdapter {\n const adapter: LassoSelectAdapter = {\n getSelection: () => dep.getSelection(),\n setSelection: (ids) => dep.setSelection(ids),\n hitTestArea: (rect) => hitTargets(dep.hitTestArea(rect, view), dep.targetOf),\n hitTestLasso: (polygon, mode) => hitTestPolygon(dep, polygon, mode, view),\n applyOps: (ops: Op[]) => applyOpsTo(adapter, ops),\n };\n return adapter;\n}\n\nconst DEFAULT_MIN_VERTEX_SPACING = 2; // world-px\n\ninterface LassoScratch {\n dep: LassoSelectDep;\n mode: LassoHitMode;\n minVertexSpacing: number;\n /** The view the lasso started in: what it does not paint is not taken. */\n view: ViewApi | undefined;\n vertices: Point2[];\n shiftHeld: boolean;\n /** Current pointer position — paint the live \"close-line\" from the last\n * vertex back to the start while the gesture is open. Tracked separately\n * from `vertices` because we throttle vertex insertion. */\n currentX: number;\n currentY: number;\n /** Cleared by `onEnd` so post-commit `overlay()` returns null. */\n open: boolean;\n behaviors: LassoSelectBehavior[];\n /** Built only when there are behaviors to hand it to. */\n gesture: GestureContext<LassoSelectPose> | null;\n}\n\n/**\n * Static descriptor for the `lassoSelect` Action.\n */\nexport const lassoSelectAction: Action & { requires: string[] } = {\n id: 'lassoSelect',\n label: 'Lasso Select',\n eligible: { capability: 'creates-selection' },\n requires: ['lassoSelect', 'view'],\n invoker: {\n timing: 'ongoing',\n start(ctx: InvocationCtx, opts): OngoingHandle {\n const dep = ctx.deps.lassoSelect;\n if (!dep) return {};\n\n const params = resolveParams(opts?.params) as\n { mode?: LassoHitMode; minVertexSpacing?: number } | undefined;\n const view = ctx.deps.view;\n const vertices: Point2[] = [{ x: ctx.world.x, y: ctx.world.y }];\n const behaviors = (opts?.behaviors ?? []) as LassoSelectBehavior[];\n let gesture: GestureContext<LassoSelectPose> | null = null;\n const readView = gestureViewReader(ctx.deps);\n if (behaviors.length > 0) {\n const pose: LassoSelectPose = {\n worldX: ctx.world.x, worldY: ctx.world.y, shiftHeld: ctx.modifiers.shift,\n };\n gesture = {\n draggedIds: ['gesture'],\n origin: new Map([['gesture', pose]]),\n current: new Map([['gesture', { ...pose }]]),\n snap: null,\n modifiers: { ...ctx.modifiers },\n pointer: pointerStateOf(ctx.world, ctx),\n view: readView(),\n adapter: behaviorAdapter(dep, view) as unknown as GestureContext<LassoSelectPose>['adapter'],\n scratch: {},\n };\n // The live array, so a behavior reads every vertex added since.\n setScratch(gesture.scratch, LASSO_VERTICES, vertices);\n for (const b of behaviors) b.onStart?.(gesture);\n }\n const scratch: LassoScratch = {\n dep,\n mode: params?.mode ?? 'intersect',\n minVertexSpacing: params?.minVertexSpacing ?? DEFAULT_MIN_VERTEX_SPACING,\n view,\n vertices,\n shiftHeld: ctx.modifiers.shift,\n currentX: ctx.world.x,\n currentY: ctx.world.y,\n open: true,\n behaviors,\n gesture,\n };\n\n return {\n kind: 'lasso',\n onMove(moveCtx: InvocationCtx): void {\n const { x, y } = moveCtx.world;\n scratch.currentX = x;\n scratch.currentY = y;\n const last = scratch.vertices[scratch.vertices.length - 1];\n const dx = x - last.x;\n const dy = y - last.y;\n const min = scratch.minVertexSpacing;\n if (dx * dx + dy * dy >= min * min) {\n scratch.vertices.push({ x, y });\n }\n const g = scratch.gesture;\n if (g) {\n g.modifiers = { ...moveCtx.modifiers };\n g.pointer = pointerStateOf(moveCtx.world, moveCtx);\n g.view = readView();\n g.current.set('gesture', { worldX: x, worldY: y, shiftHeld: scratch.shiftHeld });\n const proposed = { vertices: scratch.vertices, shiftHeld: scratch.shiftHeld };\n for (const b of scratch.behaviors) b.onMove?.(g, proposed);\n }\n },\n overlay(): OngoingOverlay | null {\n if (!scratch.open) return null;\n return {\n kind: 'lasso',\n vertices: scratch.vertices,\n current: { x: scratch.currentX, y: scratch.currentY },\n shiftHeld: scratch.shiftHeld,\n };\n },\n onEnd(_endCtx: InvocationCtx, reason: 'commit' | 'cancel'): void {\n let committed = false;\n try {\n committed = endLasso(scratch, reason);\n } finally {\n if (scratch.gesture) runBehaviorSettled(scratch.behaviors, scratch.gesture, committed);\n }\n },\n };\n },\n },\n enabled: () => true,\n};\n\n/** Close the lasso. Returns whether it committed: a behavior's ops were\n * applied, or the lasso set the selection. */\nfunction endLasso(scratch: LassoScratch, reason: 'commit' | 'cancel'): boolean {\n scratch.open = false;\n if (reason === 'cancel') {\n if (scratch.gesture) runBehaviorCancel(scratch.behaviors, scratch.gesture);\n return false;\n }\n\n const { dep: d, mode, view, vertices, shiftHeld, gesture: g } = scratch;\n\n if (g) {\n const r = reduceBehaviorEnd(scratch.behaviors, g);\n if (r !== undefined) {\n if (r !== null) (g.adapter as unknown as LassoSelectAdapter).applyOps!(r);\n return r !== null;\n }\n }\n\n // Need at least 3 vertices for a meaningful polygon; otherwise no-op.\n if (vertices.length < 3) {\n if (!shiftHeld) d.setSelection([]);\n return !shiftHeld;\n }\n\n const hits = hitTestPolygon(d, vertices, mode, view);\n\n d.setSelection(selectionFromHits(d.getSelection(), hits, shiftHeld));\n return true;\n}\n"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { selectionFromHits } from "../../hitSelection.js";
|
|
2
1
|
import { createSetSelectionOp } from "../../../../core/ops/select.js";
|
|
2
|
+
import { selectionFromHits } from "../../hitSelection.js";
|
|
3
3
|
import { getScratch, scratchKey } from "@weasel-js/routing";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/interactions/actions/lasso-select/behaviors/selectFromLasso.ts
|
|
6
6
|
/** Typed scratch slot the lasso tool's gesture writes into for this behavior
|
|
7
7
|
* to consume. Shared identity: tools producing the polygon for a lasso
|
|
8
8
|
* selection write under this same key. */
|
|
@@ -49,6 +49,5 @@ function polygonAabbArea(vertices) {
|
|
|
49
49
|
return (maxX - minX) * (maxY - minY);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
export { LASSO_VERTICES, selectFromLasso };
|
|
54
53
|
//# sourceMappingURL=selectFromLasso.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sceneDeclaredScopes } from "../../core/scene/unitScopes.js";
|
|
2
|
+
import { sceneBoxFrames } from "./poseFrame.js";
|
|
3
|
+
import { magnificationOf } from "@weasel-js/quantity";
|
|
4
|
+
|
|
5
|
+
// src/interactions/actions/magnification.ts
|
|
6
|
+
var differs = (a, b, tolerance) => Math.abs(a / b - 1) > tolerance;
|
|
7
|
+
/**
|
|
8
|
+
* Every container in `scene` whose children are drawn magnified, by a scale
|
|
9
|
+
* `transform` on it or above it, by more or less than the `drawnAt` of the unit
|
|
10
|
+
* scopes it sits in and declares. Only containers under some declared scope
|
|
11
|
+
* are read: a scene stating no units says nothing about what size it draws at.
|
|
12
|
+
*/
|
|
13
|
+
function undeclaredMagnifications(scene, tolerance = 1e-6) {
|
|
14
|
+
const frames = sceneBoxFrames(scene);
|
|
15
|
+
const out = [];
|
|
16
|
+
for (const id of scene.nodes.keys()) {
|
|
17
|
+
if (scene.childrenOf(id).length === 0) continue;
|
|
18
|
+
const scopes = sceneDeclaredScopes(scene, id, { inclusive: true });
|
|
19
|
+
if (scopes.length === 0) continue;
|
|
20
|
+
const f = frames(id);
|
|
21
|
+
if (f === null) continue;
|
|
22
|
+
const drawn = {
|
|
23
|
+
x: Math.hypot(f[0], f[1]),
|
|
24
|
+
y: Math.hypot(f[2], f[3])
|
|
25
|
+
};
|
|
26
|
+
const declared = magnificationOf(scopes);
|
|
27
|
+
if (differs(drawn.x, declared, tolerance) || differs(drawn.y, declared, tolerance)) out.push({
|
|
28
|
+
id,
|
|
29
|
+
drawn,
|
|
30
|
+
declared
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { undeclaredMagnifications };
|
|
37
|
+
//# sourceMappingURL=magnification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magnification.js","names":[],"sources":["../../../src/interactions/actions/magnification.ts"],"sourcesContent":["import { magnificationOf } from '@weasel-js/quantity';\nimport { sceneDeclaredScopes } from 'core/scene/unitScopes';\nimport type { NodeId, Scene } from 'core/scene/types';\nimport { sceneBoxFrames } from './poseFrame';\n\n/** A container whose children are drawn at a size its unit scopes do not declare. */\nexport interface UndeclaredMagnification {\n id: NodeId;\n /** How large its children's frame is drawn in world, on each of its axes. */\n drawn: { x: number; y: number };\n /** The magnification its scope chain declares: every `drawnAt`, multiplied. */\n declared: number;\n}\n\nconst differs = (a: number, b: number, tolerance: number): boolean => Math.abs(a / b - 1) > tolerance;\n\n/**\n * Every container in `scene` whose children are drawn magnified, by a scale\n * `transform` on it or above it, by more or less than the `drawnAt` of the unit\n * scopes it sits in and declares. Only containers under some declared scope\n * are read: a scene stating no units says nothing about what size it draws at.\n */\nexport function undeclaredMagnifications(\n scene: Scene<unknown, string, unknown>,\n tolerance = 1e-6,\n): UndeclaredMagnification[] {\n const frames = sceneBoxFrames(scene);\n const out: UndeclaredMagnification[] = [];\n for (const id of scene.nodes.keys()) {\n if (scene.childrenOf(id).length === 0) continue;\n const scopes = sceneDeclaredScopes(scene, id, { inclusive: true });\n if (scopes.length === 0) continue;\n const f = frames(id);\n if (f === null) continue;\n const drawn = { x: Math.hypot(f[0], f[1]), y: Math.hypot(f[2], f[3]) };\n const declared = magnificationOf(scopes);\n if (differs(drawn.x, declared, tolerance) || differs(drawn.y, declared, tolerance)) out.push({ id, drawn, declared });\n }\n return out;\n}\n"],"mappings":";;;;;AAcA,IAAM,WAAW,GAAW,GAAW,cAA+B,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI;;;;;;;AAQ5F,SAAgB,yBACd,OACA,YAAY,MACe;CAC3B,MAAM,SAAS,eAAe,KAAK;CACnC,MAAM,MAAiC,CAAC;CACxC,KAAK,MAAM,MAAM,MAAM,MAAM,KAAK,GAAG;EACnC,IAAI,MAAM,WAAW,EAAE,CAAC,CAAC,WAAW,GAAG;EACvC,MAAM,SAAS,oBAAoB,OAAO,IAAI,EAAE,WAAW,KAAK,CAAC;EACjE,IAAI,OAAO,WAAW,GAAG;EACzB,MAAM,IAAI,OAAO,EAAE;EACnB,IAAI,MAAM,MAAM;EAChB,MAAM,QAAQ;GAAE,GAAG,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE;GAAG,GAAG,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE;EAAE;EACrE,MAAM,WAAW,gBAAgB,MAAM;EACvC,IAAI,QAAQ,MAAM,GAAG,UAAU,SAAS,KAAK,QAAQ,MAAM,GAAG,UAAU,SAAS,GAAG,IAAI,KAAK;GAAE;GAAI;GAAO;EAAS,CAAC;CACtH;CACA,OAAO;AACT"}
|
|
@@ -2,12 +2,12 @@ import { transformPreview } from "../transformFinish.js";
|
|
|
2
2
|
import { closeGesture, runBehaviorCancel } from "../gestureLifecycle.js";
|
|
3
3
|
import { inPlane, selectionLayer } from "../planeInput.js";
|
|
4
4
|
import { beginMove } from "./session.js";
|
|
5
|
-
import { SNAP_ROLES } from "../../../domains/snap/roles.js";
|
|
6
5
|
import { nextFrame } from "./frame.js";
|
|
7
6
|
import { commitMove } from "./commit/index.js";
|
|
8
7
|
import { recordTransform } from "../transform-again/memory.js";
|
|
8
|
+
import { SNAP_ROLES } from "../../../domains/snap/roles.js";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/interactions/actions/move/action.ts
|
|
11
11
|
/**
|
|
12
12
|
* Drag-translates the selection.
|
|
13
13
|
*
|
|
@@ -119,6 +119,5 @@ var moveAction = inPlane({
|
|
|
119
119
|
enabled: () => true
|
|
120
120
|
}, selectionLayer);
|
|
121
121
|
|
|
122
|
-
//#endregion
|
|
123
122
|
export { moveAction };
|
|
124
123
|
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AUTO_POSE_DESCRIPTOR } from "../../../../core/geometry/autoPoseDescriptor.js";
|
|
2
|
+
import { unionRects } from "@weasel-js/geom";
|
|
3
|
+
|
|
4
|
+
// src/interactions/actions/move/behaviors/clampMove.ts
|
|
5
|
+
/** The shift along one axis that keeps `[lo, hi]` moved by `d` inside `[min, max]`; a span wider
|
|
6
|
+
* than the range is held to its start. */
|
|
7
|
+
function clampAxis(d, lo, hi, min, max) {
|
|
8
|
+
if (hi + d > max) d = max - hi;
|
|
9
|
+
if (lo + d < min) d = min - lo;
|
|
10
|
+
return d;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Move behavior that keeps the dragged nodes inside `bounds`: the drag's translation is
|
|
14
|
+
* clamped so the box around every dragged node's start pose, moved by it, stays in the rect.
|
|
15
|
+
* The clamp applies to the preview and the commit alike, so a node let go past an edge lands
|
|
16
|
+
* on it. Put it after behaviors that reshape the translation, so it has the last word.
|
|
17
|
+
*/
|
|
18
|
+
function clampMove(opts) {
|
|
19
|
+
const d = opts.poseDescriptor ?? AUTO_POSE_DESCRIPTOR;
|
|
20
|
+
return { onMove(ctx, proposed) {
|
|
21
|
+
const b = typeof opts.bounds === "function" ? opts.bounds() : opts.bounds;
|
|
22
|
+
const starts = [];
|
|
23
|
+
for (const id of ctx.draggedIds) {
|
|
24
|
+
const pose = ctx.origin.get(id);
|
|
25
|
+
if (pose !== void 0) starts.push(d.getBounds(pose));
|
|
26
|
+
}
|
|
27
|
+
const u = unionRects(starts);
|
|
28
|
+
if (!u) return void 0;
|
|
29
|
+
const x0 = u.x, y0 = u.y, x1 = u.x + u.width, y1 = u.y + u.height;
|
|
30
|
+
const dx = clampAxis(proposed.dx, x0, x1, b.x, b.x + b.width);
|
|
31
|
+
const dy = clampAxis(proposed.dy, y0, y1, b.y, b.y + b.height);
|
|
32
|
+
if (dx === proposed.dx && dy === proposed.dy) return void 0;
|
|
33
|
+
return { transform: {
|
|
34
|
+
kind: "translate",
|
|
35
|
+
dx,
|
|
36
|
+
dy
|
|
37
|
+
} };
|
|
38
|
+
} };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { clampMove };
|
|
42
|
+
//# sourceMappingURL=clampMove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clampMove.js","names":[],"sources":["../../../../../src/interactions/actions/move/behaviors/clampMove.ts"],"sourcesContent":["import { unionRects, type FramedBox, type Rect } from '@weasel-js/geom';\nimport type { PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { AUTO_POSE_DESCRIPTOR } from 'core/geometry/autoPoseDescriptor';\nimport type { MoveBehavior } from '../../../gestures/types';\n\n/** What {@link clampMove} takes. */\nexport interface ClampMoveOptions<TPose> {\n /** The world rect the dragged nodes stay inside, or a function read each frame for one that changes. */\n bounds: FramedBox | (() => FramedBox);\n /** Reads each pose's box. Default `AUTO_POSE_DESCRIPTOR`. */\n poseDescriptor?: PoseDescriptor<TPose>;\n}\n\n/** The shift along one axis that keeps `[lo, hi]` moved by `d` inside `[min, max]`; a span wider\n * than the range is held to its start. */\nfunction clampAxis(d: number, lo: number, hi: number, min: number, max: number): number {\n if (hi + d > max) d = max - hi;\n if (lo + d < min) d = min - lo;\n return d;\n}\n\n/**\n * Move behavior that keeps the dragged nodes inside `bounds`: the drag's translation is\n * clamped so the box around every dragged node's start pose, moved by it, stays in the rect.\n * The clamp applies to the preview and the commit alike, so a node let go past an edge lands\n * on it. Put it after behaviors that reshape the translation, so it has the last word.\n */\nexport function clampMove<TPose>(opts: ClampMoveOptions<TPose>): MoveBehavior<TPose> {\n const d = (opts.poseDescriptor ?? AUTO_POSE_DESCRIPTOR) as PoseDescriptor<TPose>;\n return {\n onMove(ctx, proposed) {\n const b = typeof opts.bounds === 'function' ? opts.bounds() : opts.bounds;\n const starts: Rect[] = [];\n for (const id of ctx.draggedIds) {\n const pose = ctx.origin.get(id);\n if (pose !== undefined) starts.push(d.getBounds(pose));\n }\n const u = unionRects(starts);\n if (!u) return undefined;\n const x0 = u.x, y0 = u.y, x1 = u.x + u.width, y1 = u.y + u.height;\n const dx = clampAxis(proposed.dx, x0, x1, b.x, b.x + b.width);\n const dy = clampAxis(proposed.dy, y0, y1, b.y, b.y + b.height);\n if (dx === proposed.dx && dy === proposed.dy) return undefined;\n return { transform: { kind: 'translate', dx, dy } };\n },\n };\n}\n"],"mappings":";;;;;;AAeA,SAAS,UAAU,GAAW,IAAY,IAAY,KAAa,KAAqB;CACtF,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM;CAC5B,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM;CAC5B,OAAO;AACT;;;;;;;AAQA,SAAgB,UAAiB,MAAoD;CACnF,MAAM,IAAK,KAAK,kBAAkB;CAClC,OAAO,EACL,OAAO,KAAK,UAAU;EACpB,MAAM,IAAI,OAAO,KAAK,WAAW,aAAa,KAAK,OAAO,IAAI,KAAK;EACnE,MAAM,SAAiB,CAAC;EACxB,KAAK,MAAM,MAAM,IAAI,YAAY;GAC/B,MAAM,OAAO,IAAI,OAAO,IAAI,EAAE;GAC9B,IAAI,SAAS,QAAW,OAAO,KAAK,EAAE,UAAU,IAAI,CAAC;EACvD;EACA,MAAM,IAAI,WAAW,MAAM;EAC3B,IAAI,CAAC,GAAG,OAAO;EACf,MAAM,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,KAAK,EAAE,IAAI,EAAE;EAC3D,MAAM,KAAK,UAAU,SAAS,IAAI,IAAI,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK;EAC5D,MAAM,KAAK,UAAU,SAAS,IAAI,IAAI,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;EAC7D,IAAI,OAAO,SAAS,MAAM,OAAO,SAAS,IAAI,OAAO;EACrD,OAAO,EAAE,WAAW;GAAE,MAAM;GAAa;GAAI;EAAG,EAAE;CACpD,EACF;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { layoutDropOps } from "../commit/layoutDrop.js";
|
|
2
|
-
import { runDropPass } from "../layout/dropPass.js";
|
|
3
2
|
import { layoutReleaseOps } from "../commit/layoutRelease.js";
|
|
3
|
+
import { runDropPass } from "../layout/dropPass.js";
|
|
4
4
|
import { landReleased, releasedPoses, stepGlide } from "../layout/glide.js";
|
|
5
5
|
import { refusalOverlays } from "../refusal.js";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/interactions/actions/move/behaviors/layoutDrop.ts
|
|
8
8
|
/**
|
|
9
9
|
* The move behavior that drops the selection into the layout container under
|
|
10
10
|
* it. Each move it resolves the drop and shows the siblings making room; on
|
|
@@ -75,6 +75,5 @@ function layoutDrop(move) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
//#endregion
|
|
79
78
|
export { layoutDrop };
|
|
80
79
|
//# sourceMappingURL=layoutDrop.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { refusalOverlays } from "../refusal.js";
|
|
2
1
|
import { reparentOps, resolveDrop } from "../commit/reparent.js";
|
|
2
|
+
import { refusalOverlays } from "../refusal.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/interactions/actions/move/behaviors/reparentOnDrop.ts
|
|
5
5
|
/**
|
|
6
6
|
* The move behavior that reparents the selection under the node the pointer is
|
|
7
7
|
* released over, when the binding's `reparentOnDrop` param asks for it. While
|
|
@@ -39,6 +39,5 @@ function reparentOnDrop(move) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { reparentOnDrop };
|
|
44
43
|
//# sourceMappingURL=reparentOnDrop.js.map
|
|
@@ -2,7 +2,7 @@ import { createDeleteOp } from "../../../../core/ops/delete.js";
|
|
|
2
2
|
import { AUTO_ORIGIN_PROJECTION } from "../../../gestures/shared/originProjection.js";
|
|
3
3
|
import { getScratch, scratchKey, setScratch } from "@weasel-js/routing";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/interactions/actions/move/behaviors/snapBackOrDelete.ts
|
|
6
6
|
var SNAPSHOTS = scratchKey("snapBackOrDelete.snapshots");
|
|
7
7
|
var INDEXES = scratchKey("snapBackOrDelete.indexes");
|
|
8
8
|
/** Snap back to the origin pose, or delete, depending on where the drag is
|
|
@@ -47,6 +47,5 @@ function snapBackOrDelete(args) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { snapBackOrDelete };
|
|
52
51
|
//# sourceMappingURL=snapBackOrDelete.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { definesFrame } from "../../../../core/scene/effectivePose.js";
|
|
2
1
|
import { createTransformOp } from "../../../../core/ops/transform.js";
|
|
2
|
+
import { definesFrame } from "../../../../core/scene/effectivePose.js";
|
|
3
3
|
import { createReparentOp } from "../../../../core/ops/reparent.js";
|
|
4
4
|
import { getScratch, scratchKey, setScratch } from "@weasel-js/routing";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/interactions/actions/move/behaviors/snapToContainer.ts
|
|
7
7
|
var STATE = scratchKey("snapToContainer");
|
|
8
8
|
function getState(ctx) {
|
|
9
9
|
let s = getScratch(ctx.scratch, STATE);
|
|
@@ -154,6 +154,5 @@ function keptInPlace(ctx, parentId, id, moved, label) {
|
|
|
154
154
|
return ops;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
//#endregion
|
|
158
157
|
export { snapToContainer };
|
|
159
158
|
//# sourceMappingURL=snapToContainer.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { pointerStateOf } from "../pointerState.js";
|
|
2
|
+
import { effectivePose } from "../../../core/scene/effectivePose.js";
|
|
1
3
|
import { toPlane } from "../../../core/viewport/parallax.js";
|
|
2
4
|
import { composeChildFrame, composeWorldPose, frameAtOrAbove } from "../../../core/scene/composeFrame.js";
|
|
3
|
-
import { effectivePose } from "../../../core/scene/effectivePose.js";
|
|
4
5
|
import { sceneViewPoseAdapter } from "../../../core/scene/scenePoseAdapter.js";
|
|
5
|
-
import { scenePoseFrame } from "../poseFrame.js";
|
|
6
|
-
import { poseDescriptorOf } from "../poseDescriptorDep.js";
|
|
7
6
|
import { invertPlane, planeOf } from "../planeInput.js";
|
|
7
|
+
import { sceneGestureFrames } from "../gestureFrames.js";
|
|
8
|
+
import { poseDescriptorOf } from "../poseDescriptorDep.js";
|
|
9
|
+
import { scenePoseFrame } from "../poseFrame.js";
|
|
8
10
|
import { translateTargets } from "../selectionSubtree.js";
|
|
9
11
|
import { catchGliding } from "./layout/glide.js";
|
|
10
|
-
import { pointerStateOf } from "../pointerState.js";
|
|
11
|
-
import { sceneGestureFrames } from "../gestureFrames.js";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/interactions/actions/move/capture.ts
|
|
14
14
|
/** Start pose of each root and descendant, the descendants in walk order, and
|
|
15
15
|
* the offsets of any caught mid-glide. */
|
|
16
16
|
function captureStartPoses(scene, ids, reflow, projection) {
|
|
@@ -124,6 +124,5 @@ function buildGestureContext(ctx, scene, ids, startPoses, adapter, readers) {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
//#endregion
|
|
128
127
|
export { buildGestureContext, captureFrames, capturePlaneRefs, captureStartPoses };
|
|
129
128
|
//# sourceMappingURL=capture.js.map
|