@weasel-js/core 1.7.0 → 1.7.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 +794 -0
- package/README.md +14 -8
- package/dist/WeaselProvider.js +15 -0
- package/dist/WeaselProvider.js.map +1 -0
- package/dist/affordances/composeAffordanceLayer.js +224 -0
- package/dist/affordances/composeAffordanceLayer.js.map +1 -0
- package/dist/affordances/cornerResize.js +69 -0
- package/dist/affordances/cornerResize.js.map +1 -0
- package/dist/affordances/hitAffordanceRegions.js +138 -0
- package/dist/affordances/hitAffordanceRegions.js.map +1 -0
- package/dist/affordances/pathAnchors.js +66 -0
- package/dist/affordances/pathAnchors.js.map +1 -0
- package/dist/affordances/rotationHandle.js +103 -0
- package/dist/affordances/rotationHandle.js.map +1 -0
- package/dist/animation/behaviors/momentum.js +118 -0
- package/dist/animation/behaviors/momentum.js.map +1 -0
- package/dist/animation/colorHelpers.js +135 -0
- package/dist/animation/colorHelpers.js.map +1 -0
- package/dist/animation/colorRegistry.js +37 -0
- package/dist/animation/colorRegistry.js.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/loop.js +62 -0
- package/dist/animation/loop.js.map +1 -0
- package/dist/animation/observe.js +23 -0
- package/dist/animation/observe.js.map +1 -0
- package/dist/animation/poseHelpers.js +50 -0
- package/dist/animation/poseHelpers.js.map +1 -0
- package/dist/animation/reflow.js +121 -0
- package/dist/animation/reflow.js.map +1 -0
- package/dist/animation/rig/bindRig.js +74 -0
- package/dist/animation/rig/bindRig.js.map +1 -0
- package/dist/animation/rig/blendPoses.js +43 -0
- package/dist/animation/rig/blendPoses.js.map +1 -0
- package/dist/animation/rig/mirrorPose.js +19 -0
- package/dist/animation/rig/mirrorPose.js.map +1 -0
- package/dist/animation/rig/resolveSkeleton.js +33 -0
- package/dist/animation/rig/resolveSkeleton.js.map +1 -0
- package/dist/animation/rig/solveIk.js +103 -0
- package/dist/animation/rig/solveIk.js.map +1 -0
- package/dist/animation/rig/types.js +12 -0
- package/dist/animation/rig/types.js.map +1 -0
- package/dist/animation/rig/useRig.js +23 -0
- package/dist/animation/rig/useRig.js.map +1 -0
- package/dist/animation/slew.js +27 -0
- package/dist/animation/slew.js.map +1 -0
- package/dist/animation/stagger.js +138 -0
- package/dist/animation/stagger.js.map +1 -0
- package/dist/animation/timeline/booking.js +106 -0
- package/dist/animation/timeline/booking.js.map +1 -0
- package/dist/animation/timeline/createTimeline.js +116 -0
- package/dist/animation/timeline/createTimeline.js.map +1 -0
- package/dist/animation/timeline/sampleTrack.js +29 -0
- package/dist/animation/timeline/sampleTrack.js.map +1 -0
- package/dist/animation/useAnimator.js +329 -0
- package/dist/animation/useAnimator.js.map +1 -0
- package/dist/animation/wrappers/animateLifecycle.js +40 -0
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -0
- package/dist/animation/wrappers/animateOnSetPose.js +44 -0
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -0
- package/dist/{autoPoseDescriptor-_XOyF7t4.d.ts → autoPoseDescriptor-vCdt55xm.d.ts} +2 -2
- package/dist/{builtins-DLn2lCr_.d.ts → builtins-C-gRyVRx.d.ts} +742 -513
- package/dist/canvas/Canvas.js +608 -0
- package/dist/canvas/Canvas.js.map +1 -0
- package/dist/canvas/CanvasView.js +255 -0
- package/dist/canvas/CanvasView.js.map +1 -0
- package/dist/canvas/CursorCoordsHud.js +102 -0
- package/dist/canvas/CursorCoordsHud.js.map +1 -0
- package/dist/canvas/DrawCanvas.js +67 -0
- package/dist/canvas/DrawCanvas.js.map +1 -0
- package/dist/canvas/MinimapCanvas.js +139 -0
- package/dist/canvas/MinimapCanvas.js.map +1 -0
- package/dist/canvas/ModalityHud.js +66 -0
- package/dist/canvas/ModalityHud.js.map +1 -0
- package/dist/canvas/NodeShape.js +391 -0
- package/dist/canvas/NodeShape.js.map +1 -0
- package/dist/canvas/PickHud.js +93 -0
- package/dist/canvas/PickHud.js.map +1 -0
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +10 -0
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +10 -0
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +51 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -0
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js +42 -0
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +549 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +26 -0
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -0
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +69 -0
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -0
- package/dist/canvas/SceneCanvas/features.js +97 -0
- package/dist/canvas/SceneCanvas/features.js.map +1 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js +46 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +48 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -0
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +70 -0
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useContributionRoles.js +75 -0
- package/dist/canvas/SceneCanvas/useContributionRoles.js.map +1 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +172 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +69 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +127 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js +30 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +992 -0
- package/dist/canvas/SceneCanvas.js.map +1 -0
- package/dist/canvas/SceneViewCanvas.js +54 -0
- package/dist/canvas/SceneViewCanvas.js.map +1 -0
- package/dist/canvas/accentColor.js +9 -0
- package/dist/canvas/accentColor.js.map +1 -0
- package/dist/canvas/affordanceAt.js +63 -0
- package/dist/canvas/affordanceAt.js.map +1 -0
- package/dist/canvas/buildSceneTree.js +65 -0
- package/dist/canvas/buildSceneTree.js.map +1 -0
- package/dist/canvas/canvasRenderer.js +89 -0
- package/dist/canvas/canvasRenderer.js.map +1 -0
- package/dist/canvas/colorOverrides.js +16 -0
- package/dist/canvas/colorOverrides.js.map +1 -0
- package/dist/canvas/defaultDrawOne.js +43 -0
- package/dist/canvas/defaultDrawOne.js.map +1 -0
- package/dist/canvas/deps/areaSelect.js +19 -0
- package/dist/canvas/deps/areaSelect.js.map +1 -0
- package/dist/canvas/deps/debug.js +9 -0
- package/dist/canvas/deps/debug.js.map +1 -0
- package/dist/canvas/deps/dispatcher.js +11 -0
- package/dist/canvas/deps/dispatcher.js.map +1 -0
- package/dist/canvas/deps/editAnchors.js +101 -0
- package/dist/canvas/deps/editAnchors.js.map +1 -0
- package/dist/canvas/deps/geometryProjection.js +11 -0
- package/dist/canvas/deps/geometryProjection.js.map +1 -0
- package/dist/canvas/deps/hitTestArea.js +51 -0
- package/dist/canvas/deps/hitTestArea.js.map +1 -0
- package/dist/canvas/deps/ingestion.js +31 -0
- package/dist/canvas/deps/ingestion.js.map +1 -0
- package/dist/canvas/deps/insert.js +116 -0
- package/dist/canvas/deps/insert.js.map +1 -0
- package/dist/canvas/deps/lassoSelect.js +20 -0
- package/dist/canvas/deps/lassoSelect.js.map +1 -0
- package/dist/canvas/deps/layout.js +34 -0
- package/dist/canvas/deps/layout.js.map +1 -0
- package/dist/canvas/deps/nodeAtPoint.js +19 -0
- package/dist/canvas/deps/nodeAtPoint.js.map +1 -0
- package/dist/canvas/deps/poseComposition.js +11 -0
- package/dist/canvas/deps/poseComposition.js.map +1 -0
- package/dist/canvas/deps/poseDescriptor.js +12 -0
- package/dist/canvas/deps/poseDescriptor.js.map +1 -0
- package/dist/canvas/deps/resizePolicy.js +35 -0
- package/dist/canvas/deps/resizePolicy.js.map +1 -0
- package/dist/canvas/deps/slice.js +99 -0
- package/dist/canvas/deps/slice.js.map +1 -0
- package/dist/canvas/deps/snap.js +11 -0
- package/dist/canvas/deps/snap.js.map +1 -0
- package/dist/canvas/deps/textEdit.js +21 -0
- package/dist/canvas/deps/textEdit.js.map +1 -0
- package/dist/canvas/deps/view.js +43 -0
- package/dist/canvas/deps/view.js.map +1 -0
- package/dist/canvas/derivedPath.js +47 -0
- package/dist/canvas/derivedPath.js.map +1 -0
- package/dist/canvas/drawEnvelope.js +22 -0
- package/dist/canvas/drawEnvelope.js.map +1 -0
- package/dist/canvas/getNodeAtPoint.js +18 -0
- package/dist/canvas/getNodeAtPoint.js.map +1 -0
- package/dist/canvas/hostAnchor.js +29 -0
- package/dist/canvas/hostAnchor.js.map +1 -0
- package/dist/canvas/hud.module.js +18 -0
- package/dist/canvas/hud.module.js.map +1 -0
- package/dist/canvas/insertPreviewExtent.js +103 -0
- package/dist/canvas/insertPreviewExtent.js.map +1 -0
- package/dist/canvas/kitRequirements.js +177 -0
- package/dist/canvas/kitRequirements.js.map +1 -0
- package/dist/canvas/layerOrder.js +66 -0
- package/dist/canvas/layerOrder.js.map +1 -0
- package/dist/canvas/layerSlots.js +14 -0
- package/dist/canvas/layerSlots.js.map +1 -0
- package/dist/canvas/minimapMath.js +80 -0
- package/dist/canvas/minimapMath.js.map +1 -0
- package/dist/canvas/mountedCanvases.js +20 -0
- package/dist/canvas/mountedCanvases.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js +17 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -0
- package/dist/canvas/paintCull.js +20 -0
- package/dist/canvas/paintCull.js.map +1 -0
- package/dist/canvas/pickWalk.js +158 -0
- package/dist/canvas/pickWalk.js.map +1 -0
- package/dist/canvas/planeClips.js +30 -0
- package/dist/canvas/planeClips.js.map +1 -0
- package/dist/canvas/poseRotation.js +35 -0
- package/dist/canvas/poseRotation.js.map +1 -0
- package/dist/canvas/rasterToPng.js +21 -0
- package/dist/canvas/rasterToPng.js.map +1 -0
- package/dist/canvas/renderDebugSnapshot.js +32 -0
- package/dist/canvas/renderDebugSnapshot.js.map +1 -0
- package/dist/canvas/renderNeeds.js +25 -0
- package/dist/canvas/renderNeeds.js.map +1 -0
- package/dist/canvas/renderSceneToPixels.js +143 -0
- package/dist/canvas/renderSceneToPixels.js.map +1 -0
- package/dist/canvas/sceneAdapter.js +270 -0
- package/dist/canvas/sceneAdapter.js.map +1 -0
- package/dist/canvas/sceneLayerPaint.js +37 -0
- package/dist/canvas/sceneLayerPaint.js.map +1 -0
- package/dist/canvas/sceneSlotWiring.js +20 -0
- package/dist/canvas/sceneSlotWiring.js.map +1 -0
- package/dist/canvas/sceneViewRender.js +72 -0
- package/dist/canvas/sceneViewRender.js.map +1 -0
- package/dist/canvas/slopsDebugLayer.js +61 -0
- package/dist/canvas/slopsDebugLayer.js.map +1 -0
- package/dist/canvas/surfaceContribution.js +15 -0
- package/dist/canvas/surfaceContribution.js.map +1 -0
- package/dist/canvas/toolPreview.js +39 -0
- package/dist/canvas/toolPreview.js.map +1 -0
- package/dist/canvas/useCanvasRenderer.js +11 -0
- package/dist/canvas/useCanvasRenderer.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +60 -0
- package/dist/canvas/useFrameLoop.js.map +1 -0
- package/dist/canvas/useHostAnchor.js +71 -0
- package/dist/canvas/useHostAnchor.js.map +1 -0
- package/dist/canvas/useLateContentRedraw.js +21 -0
- package/dist/canvas/useLateContentRedraw.js.map +1 -0
- package/dist/canvas/useRedrawOn.js +21 -0
- package/dist/canvas/useRedrawOn.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +120 -0
- package/dist/canvas/useViewHelpers.js.map +1 -0
- package/dist/canvas/viewInputs.js +17 -0
- package/dist/canvas/viewInputs.js.map +1 -0
- package/dist/canvas/viewRegistry.js +61 -0
- package/dist/canvas/viewRegistry.js.map +1 -0
- package/dist/canvas/wrapNodeOutput.js +14 -0
- package/dist/canvas/wrapNodeOutput.js.map +1 -0
- package/dist/clipboard.d.ts +10 -5
- package/dist/clipboard.js +3 -5
- package/dist/clone.d.ts +3 -3
- package/dist/clone.js +2 -5
- package/dist/core/adapters/arrayAdapter.js +85 -0
- package/dist/core/adapters/arrayAdapter.js.map +1 -0
- package/dist/core/adapters/useArrayAdapter.js +13 -0
- package/dist/core/adapters/useArrayAdapter.js.map +1 -0
- package/dist/core/applyOps.js +12 -0
- package/dist/core/applyOps.js.map +1 -0
- package/dist/core/device/index.js +4 -0
- package/dist/core/device/targets.js +17 -0
- package/dist/core/device/targets.js.map +1 -0
- package/dist/core/device/useDeviceProfile.js +75 -0
- package/dist/core/device/useDeviceProfile.js.map +1 -0
- package/dist/core/fillInPoseFrame.js +102 -0
- package/dist/core/fillInPoseFrame.js.map +1 -0
- package/dist/core/geometry/poseDescriptor.js +93 -0
- package/dist/core/geometry/poseDescriptor.js.map +1 -0
- package/dist/core/geometry/poseRotation.js +58 -0
- package/dist/core/geometry/poseRotation.js.map +1 -0
- package/dist/core/geometry/regionHit.js +102 -0
- package/dist/core/geometry/regionHit.js.map +1 -0
- package/dist/core/geometry/unionBounds.js +60 -0
- package/dist/core/geometry/unionBounds.js.map +1 -0
- package/dist/core/gradient.js +136 -0
- package/dist/core/gradient.js.map +1 -0
- package/dist/core/isPlainObject.js +11 -0
- package/dist/core/isPlainObject.js.map +1 -0
- package/dist/core/layers/render.js +150 -0
- package/dist/core/layers/render.js.map +1 -0
- package/dist/core/markerInset.js +24 -0
- package/dist/core/markerInset.js.map +1 -0
- package/dist/core/mixed.js +6 -0
- package/dist/core/mixed.js.map +1 -0
- package/dist/core/ops/arrange.js +31 -0
- package/dist/core/ops/arrange.js.map +1 -0
- package/dist/core/ops/create.js +32 -0
- package/dist/core/ops/create.js.map +1 -0
- package/dist/core/ops/createHistory.js +20 -0
- package/dist/core/ops/createHistory.js.map +1 -0
- package/dist/core/ops/delete.js +89 -0
- package/dist/core/ops/delete.js.map +1 -0
- package/dist/core/ops/registry.js +17 -0
- package/dist/core/ops/registry.js.map +1 -0
- package/dist/core/ops/reorder/algorithms.js +55 -0
- package/dist/core/ops/reorder/algorithms.js.map +1 -0
- package/dist/core/ops/reorder/index.js +140 -0
- package/dist/core/ops/reorder/index.js.map +1 -0
- package/dist/core/ops/reparent.js +52 -0
- package/dist/core/ops/reparent.js.map +1 -0
- package/dist/core/ops/select.js +34 -0
- package/dist/core/ops/select.js.map +1 -0
- package/dist/core/ops/setData.js +34 -0
- package/dist/core/ops/setData.js.map +1 -0
- package/dist/core/ops/setLayer.js +34 -0
- package/dist/core/ops/setLayer.js.map +1 -0
- package/dist/core/ops/setLayout.js +31 -0
- package/dist/core/ops/setLayout.js.map +1 -0
- package/dist/core/ops/setPath.js +57 -0
- package/dist/core/ops/setPath.js.map +1 -0
- package/dist/core/ops/setText.js +34 -0
- package/dist/core/ops/setText.js.map +1 -0
- package/dist/core/ops/slot.js +37 -0
- package/dist/core/ops/slot.js.map +1 -0
- package/dist/core/ops/transform.js +42 -0
- package/dist/core/ops/transform.js.map +1 -0
- package/dist/core/paintKinds.js +156 -0
- package/dist/core/paintKinds.js.map +1 -0
- package/dist/core/scene/NodeProperties.js +20 -0
- package/dist/core/scene/NodeProperties.js.map +1 -0
- package/dist/core/scene/NodeRouting.js +24 -0
- package/dist/core/scene/NodeRouting.js.map +1 -0
- package/dist/core/scene/arrivals.js +12 -0
- package/dist/core/scene/arrivals.js.map +1 -0
- package/dist/core/scene/composeFrame.js +29 -0
- package/dist/core/scene/composeFrame.js.map +1 -0
- package/dist/core/scene/depMemo.js +18 -0
- package/dist/core/scene/depMemo.js.map +1 -0
- package/dist/core/scene/dependents.js +66 -0
- package/dist/core/scene/dependents.js.map +1 -0
- package/dist/core/scene/derivedPath.js +31 -0
- package/dist/core/scene/derivedPath.js.map +1 -0
- package/dist/core/scene/effectivePose.js +78 -0
- package/dist/core/scene/effectivePose.js.map +1 -0
- package/dist/core/scene/kitRegistry.js +33 -0
- package/dist/core/scene/kitRegistry.js.map +1 -0
- package/dist/core/scene/layoutPass.js +96 -0
- package/dist/core/scene/layoutPass.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +83 -0
- package/dist/core/scene/nodeFnFields.js.map +1 -0
- package/dist/core/scene/nodeMemo.js +28 -0
- package/dist/core/scene/nodeMemo.js.map +1 -0
- package/dist/core/scene/poseFeed.js +87 -0
- package/dist/core/scene/poseFeed.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +52 -0
- package/dist/core/scene/poseOverrides.js.map +1 -0
- package/dist/core/scene/poseSnapshot.js +54 -0
- package/dist/core/scene/poseSnapshot.js.map +1 -0
- package/dist/core/scene/scene.js +1271 -0
- package/dist/core/scene/scene.js.map +1 -0
- package/dist/core/scene/types.js +6 -0
- package/dist/core/scene/types.js.map +1 -0
- package/dist/core/scene/useScene.js +32 -0
- package/dist/core/scene/useScene.js.map +1 -0
- package/dist/core/selection/chromeState.js +31 -0
- package/dist/core/selection/chromeState.js.map +1 -0
- package/dist/core/selection/selectionTarget.js +6 -0
- package/dist/core/selection/selectionTarget.js.map +1 -0
- package/dist/core/selection/useSelection.js +71 -0
- package/dist/core/selection/useSelection.js.map +1 -0
- package/dist/core/shapeKinds.js +54 -0
- package/dist/core/shapeKinds.js.map +1 -0
- package/dist/core/strokeMarkerShapes.js +139 -0
- package/dist/core/strokeMarkerShapes.js.map +1 -0
- package/dist/core/strokeMarkers.js +28 -0
- package/dist/core/strokeMarkers.js.map +1 -0
- package/dist/core/stylus/stylus.js +39 -0
- package/dist/core/stylus/stylus.js.map +1 -0
- package/dist/core/stylus/usePointerStylus.js +51 -0
- package/dist/core/stylus/usePointerStylus.js.map +1 -0
- package/dist/core/usePaintKinds.js +17 -0
- package/dist/core/usePaintKinds.js.map +1 -0
- package/dist/core/viewport/clampView.js +24 -0
- package/dist/core/viewport/clampView.js.map +1 -0
- package/dist/core/viewport/clientToWorld.js +8 -0
- package/dist/core/viewport/clientToWorld.js.map +1 -0
- package/dist/core/viewport/createVelocityTracker.js +39 -0
- package/dist/core/viewport/createVelocityTracker.js.map +1 -0
- package/dist/core/viewport/fitToBounds.js +18 -0
- package/dist/core/viewport/fitToBounds.js.map +1 -0
- package/dist/core/viewport/fitViewToBounds.js +36 -0
- package/dist/core/viewport/fitViewToBounds.js.map +1 -0
- package/dist/core/viewport/interpolateView.js +34 -0
- package/dist/core/viewport/interpolateView.js.map +1 -0
- package/dist/core/viewport/meanScale.js +8 -0
- package/dist/core/viewport/meanScale.js.map +1 -0
- package/dist/core/viewport/parallax.js +111 -0
- package/dist/core/viewport/parallax.js.map +1 -0
- package/dist/core/viewport/pxExtent.js +42 -0
- package/dist/core/viewport/pxExtent.js.map +1 -0
- package/dist/core/viewport/sceneNodeClientRect.js +18 -0
- package/dist/core/viewport/sceneNodeClientRect.js.map +1 -0
- package/dist/core/viewport/screenSlop.js +27 -0
- package/dist/core/viewport/screenSlop.js.map +1 -0
- package/dist/core/viewport/useAutoCenter.js +32 -0
- package/dist/core/viewport/useAutoCenter.js.map +1 -0
- package/dist/core/viewport/useCanvasSize.js +29 -0
- package/dist/core/viewport/useCanvasSize.js.map +1 -0
- package/dist/core/viewport/useDecayLoop.js +63 -0
- package/dist/core/viewport/useDecayLoop.js.map +1 -0
- package/dist/core/viewport/useVelocityTracker.js +10 -0
- package/dist/core/viewport/useVelocityTracker.js.map +1 -0
- package/dist/core/viewport/useViewAnimation.js +63 -0
- package/dist/core/viewport/useViewAnimation.js.map +1 -0
- package/dist/core/viewport/view.js +37 -0
- package/dist/core/viewport/view.js.map +1 -0
- package/dist/core/viewport/viewTransform.js +11 -0
- package/dist/core/viewport/viewTransform.js.map +1 -0
- package/dist/core/viewport/viewportWorldRect.js +13 -0
- package/dist/core/viewport/viewportWorldRect.js.map +1 -0
- package/dist/core/viewport/wheelHandler.js +30 -0
- package/dist/core/viewport/wheelHandler.js.map +1 -0
- package/dist/core/viewport/zoomAt.js +22 -0
- package/dist/core/viewport/zoomAt.js.map +1 -0
- package/dist/core/viewport/zoomBounds.js +20 -0
- package/dist/core/viewport/zoomBounds.js.map +1 -0
- package/dist/{pointSnapToGrid-Dp2IxLGb.d.ts → cornerHandles-BCrDp_mH.d.ts} +3 -13
- package/dist/debug/createDebugOverlayLayer.js +358 -0
- package/dist/debug/createDebugOverlayLayer.js.map +1 -0
- package/dist/debug/createDebugSink.js +83 -0
- package/dist/debug/createDebugSink.js.map +1 -0
- package/dist/debug/defaultTheme.js +31 -0
- package/dist/debug/defaultTheme.js.map +1 -0
- package/dist/debug/flag.js +41 -0
- package/dist/debug/flag.js.map +1 -0
- package/dist/debug/frameStats.js +16 -0
- package/dist/debug/frameStats.js.map +1 -0
- package/dist/debug/parseDebugFlags.js +32 -0
- package/dist/debug/parseDebugFlags.js.map +1 -0
- package/dist/features/chrome-caps/buildChromeCtx.js +16 -0
- package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -0
- package/dist/features/chrome-caps/conditions.js +36 -0
- package/dist/features/chrome-caps/conditions.js.map +1 -0
- package/dist/features/chrome-caps/defaults.js +26 -0
- package/dist/features/chrome-caps/defaults.js.map +1 -0
- package/dist/features/chrome-caps/index.js +7 -0
- package/dist/features/chrome-caps/resolve.js +23 -0
- package/dist/features/chrome-caps/resolve.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +27 -0
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -0
- package/dist/features/cursor/paintedCursorLayer.js +60 -0
- package/dist/features/cursor/paintedCursorLayer.js.map +1 -0
- package/dist/features/focus/gateLayer.js +14 -0
- package/dist/features/focus/gateLayer.js.map +1 -0
- package/dist/features/focus/useCanvasFocus.js +29 -0
- package/dist/features/focus/useCanvasFocus.js.map +1 -0
- package/dist/features/groups/children.js +23 -0
- package/dist/features/groups/children.js.map +1 -0
- package/dist/features/groups/composePose.js +67 -0
- package/dist/features/groups/composePose.js.map +1 -0
- package/dist/features/groups/nestedHit.js +40 -0
- package/dist/features/groups/nestedHit.js.map +1 -0
- package/dist/features/groups/unionOfChildren.js +15 -0
- package/dist/features/groups/unionOfChildren.js.map +1 -0
- package/dist/features/images/imageCache.js +94 -0
- package/dist/features/images/imageCache.js.map +1 -0
- package/dist/features/ingestion/contentHandlers.js +37 -0
- package/dist/features/ingestion/contentHandlers.js.map +1 -0
- package/dist/features/ingestion/imageHandler.js +45 -0
- package/dist/features/ingestion/imageHandler.js.map +1 -0
- package/dist/features/ingestion/index.js +8 -0
- package/dist/features/ingestion/openFilePicker.js +15 -0
- package/dist/features/ingestion/openFilePicker.js.map +1 -0
- package/dist/features/ingestion/registerKitHandlers.js +26 -0
- package/dist/features/ingestion/registerKitHandlers.js.map +1 -0
- package/dist/features/ingestion/svgHandler.js +58 -0
- package/dist/features/ingestion/svgHandler.js.map +1 -0
- package/dist/features/ingestion/weaselJsonHandler.js +39 -0
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -0
- package/dist/features/longPress/longPressFeedback.js +96 -0
- package/dist/features/longPress/longPressFeedback.js.map +1 -0
- package/dist/features/meshPaint/bake.js +79 -0
- package/dist/features/meshPaint/bake.js.map +1 -0
- package/dist/features/meshPaint/bakeCache.js +59 -0
- package/dist/features/meshPaint/bakeCache.js.map +1 -0
- package/dist/features/meshPaint/handles.js +86 -0
- package/dist/features/meshPaint/handles.js.map +1 -0
- package/dist/features/meshPaint/lazyKind.js +1298 -0
- package/dist/features/meshPaint/lazyKind.js.map +1 -0
- package/dist/features/meshPaint/meshPaint.js +236 -0
- package/dist/features/meshPaint/meshPaint.js.map +1 -0
- package/dist/features/meshPaint/meshShader.js +6 -0
- package/dist/features/meshPaint/meshShader.js.map +1 -0
- package/dist/features/meshPaint/register.js +7 -0
- package/dist/features/meshPaint/register.js.map +1 -0
- package/dist/features/meshPaint/surface.js +110 -0
- package/dist/features/meshPaint/surface.js.map +1 -0
- package/dist/features/minimap/actions.js +53 -0
- package/dist/features/minimap/actions.js.map +1 -0
- package/dist/features/minimap/createMinimapContribution.js +96 -0
- package/dist/features/minimap/createMinimapContribution.js.map +1 -0
- package/dist/features/minimap/layers.js +103 -0
- package/dist/features/minimap/layers.js.map +1 -0
- package/dist/features/modes/modeLayers.js +113 -0
- package/dist/features/modes/modeLayers.js.map +1 -0
- package/dist/features/overlays/useNodeOverlayFrame.js +103 -0
- package/dist/features/overlays/useNodeOverlayFrame.js.map +1 -0
- package/dist/features/parallax/createParallaxLayer.js +26 -0
- package/dist/features/parallax/createParallaxLayer.js.map +1 -0
- package/dist/features/parallax/createParallaxPlane.js +26 -0
- package/dist/features/parallax/createParallaxPlane.js.map +1 -0
- package/dist/features/paths/anchorEdits.js +156 -0
- package/dist/features/paths/anchorEdits.js.map +1 -0
- package/dist/features/paths/anchors.js +154 -0
- package/dist/features/paths/anchors.js.map +1 -0
- package/dist/features/paths/booleans.js +2 -0
- package/dist/features/paths/index.js +15 -0
- package/dist/features/paths/markerCommands.js +116 -0
- package/dist/features/paths/markerCommands.js.map +1 -0
- package/dist/features/paths/markerSites.js +59 -0
- package/dist/features/paths/markerSites.js.map +1 -0
- package/dist/features/paths/markers.js +95 -0
- package/dist/features/paths/markers.js.map +1 -0
- package/dist/features/paths/nearestAnchor.js +36 -0
- package/dist/features/paths/nearestAnchor.js.map +1 -0
- package/dist/features/paths/originProjection.js +16 -0
- package/dist/features/paths/originProjection.js.map +1 -0
- package/dist/features/paths/pathEditingOverlayLayer.js +137 -0
- package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -0
- package/dist/features/paths/pathInWorld.js +41 -0
- package/dist/features/paths/pathInWorld.js.map +1 -0
- package/dist/features/paths/pathLayer.js +44 -0
- package/dist/features/paths/pathLayer.js.map +1 -0
- package/dist/features/paths/penPreviewLayer.js +220 -0
- package/dist/features/paths/penPreviewLayer.js.map +1 -0
- package/dist/features/paths/poseDescriptor.js +39 -0
- package/dist/features/paths/poseDescriptor.js.map +1 -0
- package/dist/features/paths/tessellate/stroke.js +230 -0
- package/dist/features/paths/tessellate/stroke.js.map +1 -0
- package/dist/features/patterns/index.js +23 -0
- package/dist/features/patterns/index.js.map +1 -0
- package/dist/features/patterns/patterns-builtin.js +38 -0
- package/dist/features/patterns/patterns-builtin.js.map +1 -0
- package/dist/features/patterns/resolveSpec.js +57 -0
- package/dist/features/patterns/resolveSpec.js.map +1 -0
- package/dist/features/patterns/tileGeometry.js +158 -0
- package/dist/features/patterns/tileGeometry.js.map +1 -0
- package/dist/features/pointer/PointerContext.js +45 -0
- package/dist/features/pointer/PointerContext.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +70 -0
- package/dist/features/poseRun/usePoseRun.js.map +1 -0
- package/dist/features/selection/SelectionContext.js +46 -0
- package/dist/features/selection/SelectionContext.js.map +1 -0
- package/dist/features/selection/overlay.js +442 -0
- package/dist/features/selection/overlay.js.map +1 -0
- package/dist/features/simulation/createSimulation.js +61 -0
- package/dist/features/simulation/createSimulation.js.map +1 -0
- package/dist/features/simulation/types.js +6 -0
- package/dist/features/simulation/types.js.map +1 -0
- package/dist/features/simulation/useSimulation.js +74 -0
- package/dist/features/simulation/useSimulation.js.map +1 -0
- package/dist/features/text/domRuns.js +258 -0
- package/dist/features/text/domRuns.js.map +1 -0
- package/dist/features/text/fitTextPose.js +38 -0
- package/dist/features/text/fitTextPose.js.map +1 -0
- package/dist/features/text/hitTest.js +45 -0
- package/dist/features/text/hitTest.js.map +1 -0
- package/dist/features/text/renderLabel.js +14 -0
- package/dist/features/text/renderLabel.js.map +1 -0
- package/dist/features/text/runs/effectiveRangeStyle.js +66 -0
- package/dist/features/text/runs/effectiveRangeStyle.js.map +1 -0
- package/dist/features/text/runs/flagRange.js +53 -0
- package/dist/features/text/runs/flagRange.js.map +1 -0
- package/dist/features/text/runs/rangeStyle.js +135 -0
- package/dist/features/text/runs/rangeStyle.js.map +1 -0
- package/dist/features/text/textCommand.js +59 -0
- package/dist/features/text/textCommand.js.map +1 -0
- package/dist/features/text/textLayer.js +35 -0
- package/dist/features/text/textLayer.js.map +1 -0
- package/dist/features/text/textToPath.js +181 -0
- package/dist/features/text/textToPath.js.map +1 -0
- package/dist/features/text/useSceneTextEdit.js +138 -0
- package/dist/features/text/useSceneTextEdit.js.map +1 -0
- package/dist/features/text/useTextEdit.js +465 -0
- package/dist/features/text/useTextEdit.js.map +1 -0
- package/dist/features/tiling/createTiledLayer.js +63 -0
- package/dist/features/tiling/createTiledLayer.js.map +1 -0
- package/dist/features/tiling/tiledProject.js +14 -0
- package/dist/features/tiling/tiledProject.js.map +1 -0
- package/dist/features/viewports/viewResolver.js +59 -0
- package/dist/features/viewports/viewResolver.js.map +1 -0
- package/dist/features/viewports/viewportLayer.js +58 -0
- package/dist/features/viewports/viewportLayer.js.map +1 -0
- package/dist/icons/ArrowIcon.js +23 -0
- package/dist/icons/ArrowIcon.js.map +1 -0
- package/dist/icons/EllipseIcon.js +21 -0
- package/dist/icons/EllipseIcon.js.map +1 -0
- package/dist/icons/EyedropperIcon.js +49 -0
- package/dist/icons/EyedropperIcon.js.map +1 -0
- package/dist/icons/HandIcon.js +59 -0
- package/dist/icons/HandIcon.js.map +1 -0
- package/dist/icons/ImageIcon.js +34 -0
- package/dist/icons/ImageIcon.js.map +1 -0
- package/dist/icons/LassoIcon.js +22 -0
- package/dist/icons/LassoIcon.js.map +1 -0
- package/dist/icons/LineIcon.js +22 -0
- package/dist/icons/LineIcon.js.map +1 -0
- package/dist/icons/PenIcon.js +36 -0
- package/dist/icons/PenIcon.js.map +1 -0
- package/dist/icons/PencilIcon.js +25 -0
- package/dist/icons/PencilIcon.js.map +1 -0
- package/dist/icons/PolygonIcon.js +19 -0
- package/dist/icons/PolygonIcon.js.map +1 -0
- package/dist/icons/RectIcon.js +37 -0
- package/dist/icons/RectIcon.js.map +1 -0
- package/dist/icons/SelectIcon.js +20 -0
- package/dist/icons/SelectIcon.js.map +1 -0
- package/dist/icons/StarIcon.js +19 -0
- package/dist/icons/StarIcon.js.map +1 -0
- package/dist/icons/TextIcon.js +19 -0
- package/dist/icons/TextIcon.js.map +1 -0
- package/dist/icons/UnknownIcon.js +33 -0
- package/dist/icons/UnknownIcon.js.map +1 -0
- package/dist/icons/_base.js +12 -0
- package/dist/icons/_base.js.map +1 -0
- package/dist/index.d.ts +1960 -1891
- package/dist/index.js +312 -13
- package/dist/input/keyState.js +76 -0
- package/dist/input/keyState.js.map +1 -0
- package/dist/input/useKeyState.js +22 -0
- package/dist/input/useKeyState.js.map +1 -0
- package/dist/interactions/actions/actionShortcuts.js +32 -0
- package/dist/interactions/actions/actionShortcuts.js.map +1 -0
- package/dist/interactions/actions/align/align.js +81 -0
- package/dist/interactions/actions/align/align.js.map +1 -0
- package/dist/interactions/actions/booleans/booleans.js +120 -0
- package/dist/interactions/actions/booleans/booleans.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleans.js +20 -0
- package/dist/interactions/actions/booleans/useBooleans.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleansAdapter.js +9 -0
- package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +94 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -0
- package/dist/interactions/actions/clipboard/materializePaste.js +25 -0
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -0
- package/dist/interactions/actions/clipboard/wireFormat.js +43 -0
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -0
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +26 -0
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +1 -0
- package/dist/interactions/actions/defaultCommitAdapter.js +42 -0
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -0
- package/dist/interactions/actions/defaults/align.js +71 -0
- package/dist/interactions/actions/defaults/align.js.map +1 -0
- package/dist/interactions/actions/defaults/anchorEditing.js +235 -0
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -0
- package/dist/interactions/actions/defaults/areaSelect.js +75 -0
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -0
- package/dist/interactions/actions/defaults/booleans.js +52 -0
- package/dist/interactions/actions/defaults/booleans.js.map +1 -0
- package/dist/interactions/actions/defaults/cancelGesture.js +24 -0
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -0
- package/dist/interactions/actions/defaults/clearSelection.js +19 -0
- package/dist/interactions/actions/defaults/clearSelection.js.map +1 -0
- package/dist/interactions/actions/defaults/clipboard.js +78 -0
- package/dist/interactions/actions/defaults/clipboard.js.map +1 -0
- package/dist/interactions/actions/defaults/clone.js +107 -0
- package/dist/interactions/actions/defaults/clone.js.map +1 -0
- package/dist/interactions/actions/defaults/createOutlines.js +47 -0
- package/dist/interactions/actions/defaults/createOutlines.js.map +1 -0
- package/dist/interactions/actions/defaults/createPaintAction.js +85 -0
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -0
- package/dist/interactions/actions/defaults/delete.js +61 -0
- package/dist/interactions/actions/defaults/delete.js.map +1 -0
- package/dist/interactions/actions/defaults/distribute.js +66 -0
- package/dist/interactions/actions/defaults/distribute.js.map +1 -0
- package/dist/interactions/actions/defaults/duplicate.js +83 -0
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -0
- package/dist/interactions/actions/defaults/editAnchors.js +100 -0
- package/dist/interactions/actions/defaults/editAnchors.js.map +1 -0
- package/dist/interactions/actions/defaults/enterPathEdit.js +29 -0
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/enterTextEdit.js +20 -0
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/escape.js +26 -0
- package/dist/interactions/actions/defaults/escape.js.map +1 -0
- package/dist/interactions/actions/defaults/exitPathEdit.js +22 -0
- package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -0
- package/dist/interactions/actions/defaults/flip.js +119 -0
- package/dist/interactions/actions/defaults/flip.js.map +1 -0
- package/dist/interactions/actions/defaults/freshNodeId.js +10 -0
- package/dist/interactions/actions/defaults/freshNodeId.js.map +1 -0
- package/dist/interactions/actions/defaults/group.js +131 -0
- package/dist/interactions/actions/defaults/group.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js +40 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphs.js +10 -0
- package/dist/interactions/actions/defaults/icons/actionGlyphs.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/alignIcons.js +173 -0
- package/dist/interactions/actions/defaults/icons/alignIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/booleanIcons.js +171 -0
- package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/distributeIcons.js +63 -0
- package/dist/interactions/actions/defaults/icons/distributeIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/editIcons.js +280 -0
- package/dist/interactions/actions/defaults/icons/editIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/icons/outlineIcons.js +53 -0
- package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -0
- package/dist/interactions/actions/defaults/ingest.js +58 -0
- package/dist/interactions/actions/defaults/ingest.js.map +1 -0
- package/dist/interactions/actions/defaults/insert.js +288 -0
- package/dist/interactions/actions/defaults/insert.js.map +1 -0
- package/dist/interactions/actions/defaults/insertPathAnchor.js +50 -0
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -0
- package/dist/interactions/actions/defaults/lassoSelect.js +156 -0
- package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -0
- package/dist/interactions/actions/defaults/move.js +760 -0
- package/dist/interactions/actions/defaults/move.js.map +1 -0
- package/dist/interactions/actions/defaults/nudge.js +110 -0
- package/dist/interactions/actions/defaults/nudge.js.map +1 -0
- package/dist/interactions/actions/defaults/pinchZoom.js +63 -0
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -0
- package/dist/interactions/actions/defaults/reorder.js +143 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -0
- package/dist/interactions/actions/defaults/requiresSelection.js +10 -0
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -0
- package/dist/interactions/actions/defaults/resize.js +335 -0
- package/dist/interactions/actions/defaults/resize.js.map +1 -0
- package/dist/interactions/actions/defaults/rotate.js +184 -0
- package/dist/interactions/actions/defaults/rotate.js.map +1 -0
- package/dist/interactions/actions/defaults/selectAll.js +27 -0
- package/dist/interactions/actions/defaults/selectAll.js.map +1 -0
- package/dist/interactions/actions/defaults/setFill.js +27 -0
- package/dist/interactions/actions/defaults/setFill.js.map +1 -0
- package/dist/interactions/actions/defaults/setFillOpacity.js +15 -0
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -0
- package/dist/interactions/actions/defaults/setStroke.js +36 -0
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -0
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +21 -0
- package/dist/interactions/actions/defaults/setStrokeOpacity.js.map +1 -0
- package/dist/interactions/actions/defaults/slice.js +39 -0
- package/dist/interactions/actions/defaults/slice.js.map +1 -0
- package/dist/interactions/actions/defaults/sliceOps.js +60 -0
- package/dist/interactions/actions/defaults/sliceOps.js.map +1 -0
- package/dist/interactions/actions/defaults/toolActivate.js +35 -0
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -0
- package/dist/interactions/actions/defaults/toolResetToDefault.js +26 -0
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -0
- package/dist/interactions/actions/defaults/undoRedo.js +51 -0
- package/dist/interactions/actions/defaults/undoRedo.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportDragPan.js +88 -0
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportWheelPan.js +57 -0
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -0
- package/dist/interactions/actions/defaults/viewportZoom.js +143 -0
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +42 -0
- package/dist/interactions/actions/distribute/distribute.js.map +1 -0
- package/dist/interactions/actions/distribute/plan.js +29 -0
- package/dist/interactions/actions/distribute/plan.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +61 -0
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/handles.js +43 -0
- package/dist/interactions/actions/edit-anchors/handles.js.map +1 -0
- package/dist/interactions/actions/flip/helpers.js +35 -0
- package/dist/interactions/actions/flip/helpers.js.map +1 -0
- package/dist/interactions/actions/geometryProjection.js +18 -0
- package/dist/interactions/actions/geometryProjection.js.map +1 -0
- package/dist/interactions/actions/gestureLifecycle.js +44 -0
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +39 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +36 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +67 -0
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +37 -0
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlines.js +84 -0
- package/dist/interactions/actions/outlines/createOutlines.js.map +1 -0
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +9 -0
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js.map +1 -0
- package/dist/interactions/actions/planeInput.js +181 -0
- package/dist/interactions/actions/planeInput.js.map +1 -0
- package/dist/interactions/actions/poseDescriptorDep.js +9 -0
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -0
- package/dist/interactions/actions/poseFrame.js +38 -0
- package/dist/interactions/actions/poseFrame.js.map +1 -0
- package/dist/interactions/actions/previewOverrides.js +25 -0
- package/dist/interactions/actions/previewOverrides.js.map +1 -0
- package/dist/interactions/actions/resize/autoPoseDescriptor.js +31 -0
- package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js +18 -0
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/index.js +8 -0
- package/dist/interactions/actions/resize/behaviors/index.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js +24 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -0
- package/dist/interactions/actions/resize/cornerHandles.js +72 -0
- package/dist/interactions/actions/resize/cornerHandles.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js +60 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -0
- package/dist/interactions/actions/resolvePreviews.js +61 -0
- package/dist/interactions/actions/resolvePreviews.js.map +1 -0
- package/dist/interactions/actions/rotate/geometry.js +46 -0
- package/dist/interactions/actions/rotate/geometry.js.map +1 -0
- package/dist/interactions/actions/rotate/handle.js +27 -0
- package/dist/interactions/actions/rotate/handle.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js +42 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -0
- package/dist/interactions/actions/useStandardActions.js +142 -0
- package/dist/interactions/actions/useStandardActions.js.map +1 -0
- package/dist/interactions/gestures/dragGesture/dragGesture.js +111 -0
- package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -0
- package/dist/interactions/gestures/dragRadial/dragRadial.js +117 -0
- package/dist/interactions/gestures/dragRadial/dragRadial.js.map +1 -0
- package/dist/interactions/gestures/dragRect/dragRect.js +164 -0
- package/dist/interactions/gestures/dragRect/dragRect.js.map +1 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js +46 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -0
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +118 -0
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -0
- package/dist/interactions/gestures/shared/originProjection.js +42 -0
- package/dist/interactions/gestures/shared/originProjection.js.map +1 -0
- package/dist/interactions/gestures/shared/screenTolerance.js +21 -0
- package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -0
- package/dist/interactions/gestures/shared/snap.js +24 -0
- package/dist/interactions/gestures/shared/snap.js.map +1 -0
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +30 -0
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -0
- package/dist/layout/arrivals.js +36 -0
- package/dist/layout/arrivals.js.map +1 -0
- package/dist/{math-MCQcf_gc.d.ts → math-Drrw4ewZ.d.ts} +8 -116
- package/dist/math.d.ts +4 -5
- package/dist/math.js +6 -4
- package/dist/mesh.d.ts +268 -0
- package/dist/mesh.js +7 -0
- package/dist/move.d.ts +7 -49
- package/dist/move.js +3 -142
- package/dist/originProjection-DEklpDc_.d.ts +57 -0
- package/dist/patterns-builtin.js +3 -3
- package/dist/{poseDescriptor-rZa9W5hJ.d.ts → poseDescriptor-D-OH-tu5.d.ts} +0 -4
- package/dist/registerProgram-ateHDGjw.d.ts +193 -0
- package/dist/renderer/DrawCommand.js +6 -0
- package/dist/renderer/DrawCommand.js.map +1 -0
- package/dist/renderer/WeaselRenderer.js +328 -0
- package/dist/renderer/WeaselRenderer.js.map +1 -0
- package/dist/renderer/cache/GLImageCache.js +64 -0
- package/dist/renderer/cache/GLImageCache.js.map +1 -0
- package/dist/renderer/cache/GLMeshCache.js +102 -0
- package/dist/renderer/cache/GLMeshCache.js.map +1 -0
- package/dist/renderer/cache/GLTextureCache.js +51 -0
- package/dist/renderer/cache/GLTextureCache.js.map +1 -0
- package/dist/renderer/cache/GradientRampAtlas.js +82 -0
- package/dist/renderer/cache/GradientRampAtlas.js.map +1 -0
- package/dist/renderer/cache/cache.js +13 -0
- package/dist/renderer/cache/cache.js.map +1 -0
- package/dist/renderer/cache/markerCommandCache.js +59 -0
- package/dist/renderer/cache/markerCommandCache.js.map +1 -0
- package/dist/renderer/cache/outlineMeshCache.js +15 -0
- package/dist/renderer/cache/outlineMeshCache.js.map +1 -0
- package/dist/renderer/cache/outlineStrokeMeshCache.js +31 -0
- package/dist/renderer/cache/outlineStrokeMeshCache.js.map +1 -0
- package/dist/renderer/cache/strokeMeshCache.js +44 -0
- package/dist/renderer/cache/strokeMeshCache.js.map +1 -0
- package/dist/renderer/cullDrawCommands.js +89 -0
- package/dist/renderer/cullDrawCommands.js.map +1 -0
- package/dist/renderer/draw.js +1109 -0
- package/dist/renderer/draw.js.map +1 -0
- package/dist/renderer/drawBatch.js +168 -0
- package/dist/renderer/drawBatch.js.map +1 -0
- package/dist/renderer/effects/EffectTargets.js +45 -0
- package/dist/renderer/effects/EffectTargets.js.map +1 -0
- package/dist/renderer/effects/builtins.js +31 -0
- package/dist/renderer/effects/builtins.js.map +1 -0
- package/dist/renderer/effects/composite.js +9 -0
- package/dist/renderer/effects/composite.js.map +1 -0
- package/dist/renderer/effects/effectPrelude.js +10 -0
- package/dist/renderer/effects/effectPrelude.js.map +1 -0
- package/dist/renderer/effects/types.js +10 -0
- package/dist/renderer/effects/types.js.map +1 -0
- package/dist/renderer/index.js +19 -0
- package/dist/renderer/math/color.js +341 -0
- package/dist/renderer/math/color.js.map +1 -0
- package/dist/renderer/math/mat3.js +71 -0
- package/dist/renderer/math/mat3.js.map +1 -0
- package/dist/renderer/math/patternSpace.js +22 -0
- package/dist/renderer/math/patternSpace.js.map +1 -0
- package/dist/renderer/math/viewToMat3.js +19 -0
- package/dist/renderer/math/viewToMat3.js.map +1 -0
- package/dist/renderer/paintResources.js +18 -0
- package/dist/renderer/paintResources.js.map +1 -0
- package/dist/renderer/paintScratch.js +37 -0
- package/dist/renderer/paintScratch.js.map +1 -0
- package/dist/renderer/shaders/ShaderProgram.js +74 -0
- package/dist/renderer/shaders/ShaderProgram.js.map +1 -0
- package/dist/renderer/shaders/batchFill.js +118 -0
- package/dist/renderer/shaders/batchFill.js.map +1 -0
- package/dist/renderer/shaders/customPrelude.js +34 -0
- package/dist/renderer/shaders/customPrelude.js.map +1 -0
- package/dist/renderer/shaders/extractUniformNames.js +184 -0
- package/dist/renderer/shaders/extractUniformNames.js.map +1 -0
- package/dist/renderer/shaders/glyphPaint.js +61 -0
- package/dist/renderer/shaders/glyphPaint.js.map +1 -0
- package/dist/renderer/shaders/gradFill.js +30 -0
- package/dist/renderer/shaders/gradFill.js.map +1 -0
- package/dist/renderer/shaders/imageFill.js +14 -0
- package/dist/renderer/shaders/imageFill.js.map +1 -0
- package/dist/renderer/shaders/pathFill.js +13 -0
- package/dist/renderer/shaders/pathFill.js.map +1 -0
- package/dist/renderer/shaders/patternFill.js +24 -0
- package/dist/renderer/shaders/patternFill.js.map +1 -0
- package/dist/renderer/shaders/registerProgram.js +18 -0
- package/dist/renderer/shaders/registerProgram.js.map +1 -0
- package/dist/renderer/spriteSheet.js +14 -0
- package/dist/renderer/spriteSheet.js.map +1 -0
- package/dist/renderer/state/GroupState.js +77 -0
- package/dist/renderer/state/GroupState.js.map +1 -0
- package/dist/renderer/syntheticItalic.js +6 -0
- package/dist/renderer/syntheticItalic.js.map +1 -0
- package/dist/renderer/textures/registerTexture.js +14 -0
- package/dist/renderer/textures/registerTexture.js.map +1 -0
- package/dist/renderer.d.ts +11 -21
- package/dist/renderer.js +18 -13
- package/dist/resize.d.ts +10 -46
- package/dist/resize.js +7 -5
- package/dist/routing.js +2 -3
- package/dist/scheduling/useVisibleRaf.js +69 -0
- package/dist/scheduling/useVisibleRaf.js.map +1 -0
- package/dist/style.css +2 -0
- package/dist/test-hook/createTestHook.js +39 -0
- package/dist/test-hook/createTestHook.js.map +1 -0
- package/dist/test-hook/install.js +12 -0
- package/dist/test-hook/install.js.map +1 -0
- package/dist/test-seams-fYf6m5pu.d.ts +356 -0
- package/dist/test-seams.d.ts +6 -0
- package/dist/test-seams.js +3 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js +33 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -0
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js +55 -0
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -0
- package/dist/tools/builtin/hand/dragPanContribution.js +17 -0
- package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -0
- package/dist/tools/builtin/hand/useHandTool.js +31 -0
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -0
- package/dist/tools/builtin/image/useImageTool.js +41 -0
- package/dist/tools/builtin/image/useImageTool.js.map +1 -0
- package/dist/tools/builtin/lasso/useLassoTool.js +42 -0
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -0
- package/dist/tools/builtin/line/useLineTool.js +33 -0
- package/dist/tools/builtin/line/useLineTool.js.map +1 -0
- package/dist/tools/builtin/pen/usePenTool.js +414 -0
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -0
- package/dist/tools/builtin/pencil/usePencilTool.js +36 -0
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -0
- package/dist/tools/builtin/pickTopMostHit.js +45 -0
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -0
- package/dist/tools/builtin/polygon/usePolygonTool.js +81 -0
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -0
- package/dist/tools/builtin/rect/useRectTool.js +32 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +109 -0
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -0
- package/dist/tools/builtin/select/useSelectTool.js +162 -0
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -0
- package/dist/tools/builtin/shared/insertToolOptions.js +8 -0
- package/dist/tools/builtin/shared/insertToolOptions.js.map +1 -0
- package/dist/tools/builtin/slice/useSliceTool.js +263 -0
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -0
- package/dist/tools/builtin/star/useStarTool.js +82 -0
- package/dist/tools/builtin/star/useStarTool.js.map +1 -0
- package/dist/tools/builtin/text/useTextTool.js +177 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -0
- package/dist/tools/overlayBinding.js +8 -0
- package/dist/tools/overlayBinding.js.map +1 -0
- package/dist/tools/prefs.js +47 -0
- package/dist/tools/prefs.js.map +1 -0
- package/dist/tools/useKeybindings.js +66 -0
- package/dist/tools/useKeybindings.js.map +1 -0
- package/dist/{types-D-9QWBy5.d.ts → types-A37hYkeR.d.ts} +185 -15
- package/dist/{types-qYpyTAiZ.d.ts → types-B_9g6hMM.d.ts} +32 -6
- package/dist/util/color.js +26 -0
- package/dist/util/color.js.map +1 -0
- package/dist/util/constrainTo45.js +17 -0
- package/dist/util/constrainTo45.js.map +1 -0
- package/dist/util/paint.js +72 -0
- package/dist/util/paint.js.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +31 -19
- package/dist/chunk-3TY6FHAF.js +0 -170
- package/dist/chunk-3TY6FHAF.js.map +0 -1
- package/dist/chunk-DGWNNKGD.js +0 -248
- package/dist/chunk-DGWNNKGD.js.map +0 -1
- package/dist/chunk-G4ZGQMY7.js +0 -33372
- package/dist/chunk-G4ZGQMY7.js.map +0 -1
- package/dist/chunk-L5YNZYEG.js +0 -648
- package/dist/chunk-L5YNZYEG.js.map +0 -1
- package/dist/chunk-LU4IJ52W.js +0 -111
- package/dist/chunk-LU4IJ52W.js.map +0 -1
- package/dist/chunk-M24CLARN.js +0 -28
- package/dist/chunk-M24CLARN.js.map +0 -1
- package/dist/chunk-NE27EOLP.js +0 -146
- package/dist/chunk-NE27EOLP.js.map +0 -1
- package/dist/chunk-PNNZSYRD.js +0 -318
- package/dist/chunk-PNNZSYRD.js.map +0 -1
- package/dist/chunk-UPZY4ART.js +0 -29
- package/dist/chunk-UPZY4ART.js.map +0 -1
- package/dist/chunk-WPNA6L5O.js +0 -250
- package/dist/chunk-WPNA6L5O.js.map +0 -1
- package/dist/chunk-XMAWPGTK.js +0 -128
- package/dist/chunk-XMAWPGTK.js.map +0 -1
- package/dist/clipboard.js.map +0 -1
- package/dist/clone.js.map +0 -1
- package/dist/grid-CY5UKlZh.d.ts +0 -98
- package/dist/index.css +0 -62
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/insert.d.ts +0 -36
- package/dist/insert.js +0 -81
- package/dist/insert.js.map +0 -1
- package/dist/math.js.map +0 -1
- package/dist/move.js.map +0 -1
- package/dist/path-JEV2c5If.d.ts +0 -48
- package/dist/patterns-builtin.js.map +0 -1
- package/dist/renderer.css +0 -62
- package/dist/renderer.css.map +0 -1
- package/dist/renderer.js.map +0 -1
- package/dist/resize.js.map +0 -1
- package/dist/routing.js.map +0 -1
- package/dist/types-D2tTKEU0.d.ts +0 -18
package/dist/mesh.d.ts
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { GradientUnits, ColorSpace, FillStyle, GradStop } from '@weasel-js/paint';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Coons and tensor-product patch surfaces — PDF's shading types 6 and 7, as
|
|
5
|
+
* pure geometry.
|
|
6
|
+
*
|
|
7
|
+
* A patch is a curved quadrilateral: four cubic Bézier edges and a color at
|
|
8
|
+
* each corner. The interior is what the edges imply — a Coons patch reads it
|
|
9
|
+
* off the boundary alone; a tensor patch adds four interior control points
|
|
10
|
+
* that pull it around. Both evaluate at a `(u, v)` in the unit square, which
|
|
11
|
+
* is what lets the renderer subdivide a patch into as many triangles as it
|
|
12
|
+
* wants without the patch knowing.
|
|
13
|
+
*
|
|
14
|
+
* Nothing here touches GL, a color string, or a scene. `evalPatch` is the
|
|
15
|
+
* whole contract.
|
|
16
|
+
*/
|
|
17
|
+
/** A point in the patch's own space. */
|
|
18
|
+
interface MeshPoint {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* One patch.
|
|
24
|
+
*
|
|
25
|
+
* `points` walks the boundary: corner 0, the two control points of the edge
|
|
26
|
+
* leaving it, corner 1, its two, and so on — twelve points, ending with the
|
|
27
|
+
* two controls that return to corner 0. A tensor patch appends its four
|
|
28
|
+
* interior points, in the order `(1,1)`, `(1,2)`, `(2,2)`, `(2,1)` of the
|
|
29
|
+
* bicubic control net, which is PDF's own order.
|
|
30
|
+
*
|
|
31
|
+
* Twelve points is a Coons patch and sixteen is a tensor patch; there is no
|
|
32
|
+
* flag, because the count already says which it is.
|
|
33
|
+
*
|
|
34
|
+
* `colors` are the corner colors in the same walk order, as whatever color
|
|
35
|
+
* form the caller resolves — the renderer hands premultiplied RGBA in, the
|
|
36
|
+
* serializer hands CSS strings.
|
|
37
|
+
*/
|
|
38
|
+
interface MeshPatch<TColor = string> {
|
|
39
|
+
points: readonly MeshPoint[];
|
|
40
|
+
colors: readonly [TColor, TColor, TColor, TColor];
|
|
41
|
+
}
|
|
42
|
+
/** Corner `i` of the boundary walk. */
|
|
43
|
+
declare function patchCorner(patch: MeshPatch<unknown>, i: number): MeshPoint;
|
|
44
|
+
/** `true` when the patch carries the four interior points a tensor patch adds. */
|
|
45
|
+
declare function isTensorPatch(patch: MeshPatch<unknown>): boolean;
|
|
46
|
+
/** A patch is twelve boundary points, or sixteen with the interior. Anything
|
|
47
|
+
* else cannot be evaluated, and saying so here beats painting nonsense. */
|
|
48
|
+
declare function isValidPatch(patch: MeshPatch<unknown>): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The patch surface at `(u, v)`, both in `0..1`.
|
|
51
|
+
*
|
|
52
|
+
* `u` runs along the edge leaving corner 0 and `v` along the edge leaving
|
|
53
|
+
* corner 1, so `(0,0)` is corner 0, `(1,0)` corner 1, `(1,1)` corner 2 and
|
|
54
|
+
* `(0,1)` corner 3 — the same walk `colors` is in.
|
|
55
|
+
*/
|
|
56
|
+
declare function evalPatch(patch: MeshPatch<unknown>, u: number, v: number): MeshPoint;
|
|
57
|
+
/**
|
|
58
|
+
* The four corner weights at `(u, v)` — bilinear, in the corner walk order.
|
|
59
|
+
*
|
|
60
|
+
* Color is separate from position on purpose: it interpolates in whatever
|
|
61
|
+
* space the caller chose, which is not a thing the surface can do for it.
|
|
62
|
+
*/
|
|
63
|
+
declare function cornerWeights(u: number, v: number): [number, number, number, number];
|
|
64
|
+
/** Axis-aligned bounds of a patch, sampled on a grid. Control points alone
|
|
65
|
+
* bound a Bézier but not tightly, and a mesh paint is baked into a texture
|
|
66
|
+
* sized from this — a loose box wastes texels on every side. */
|
|
67
|
+
declare function patchBounds(patch: MeshPatch<unknown>, steps?: number): {
|
|
68
|
+
x: number;
|
|
69
|
+
y: number;
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The `mesh-gradient` paint kind — PDF's shading types 6 and 7 as a registered
|
|
76
|
+
* paint.
|
|
77
|
+
*
|
|
78
|
+
* A mesh gradient is a set of curved quadrilateral patches, each with a color
|
|
79
|
+
* at every corner. It is the paint SVG tried to standardize as
|
|
80
|
+
* `<meshgradient>` and abandoned, and the one PDF has had since 1993; what it
|
|
81
|
+
* buys over the three gradients is a color field that bends, so a highlight
|
|
82
|
+
* can follow a form instead of running straight across it.
|
|
83
|
+
*
|
|
84
|
+
* This is a registered kind rather than a sixth branch in the renderer, and
|
|
85
|
+
* deliberately: it uses only the slots `registerPaintKind` gives a consumer, so
|
|
86
|
+
* whatever it can do, a consumer's own kind can do too. Its one concession is
|
|
87
|
+
* living in this package, because that is where the shader registry is.
|
|
88
|
+
*
|
|
89
|
+
* `docs/proposals/2026-09-17-paint-kinds-beyond-svg.md` is the design.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A mesh gradient paint.
|
|
94
|
+
*
|
|
95
|
+
* `patches` are in the space `units` names, the same way a gradient's
|
|
96
|
+
* geometry is — under `'bounds'` every point is a fraction of the painted
|
|
97
|
+
* node's box, which is what lets the paint survive a resize.
|
|
98
|
+
*
|
|
99
|
+
* `interpolate` is the space corner colors blend through, matching the three
|
|
100
|
+
* gradients. It is more visible here than there: a mesh blends in two
|
|
101
|
+
* directions at once, so an sRGB blend's muddy middle covers area rather than
|
|
102
|
+
* a line.
|
|
103
|
+
*/
|
|
104
|
+
interface MeshGradientFill {
|
|
105
|
+
fill: 'mesh-gradient';
|
|
106
|
+
patches: MeshPatch[];
|
|
107
|
+
units?: GradientUnits;
|
|
108
|
+
interpolate?: ColorSpace;
|
|
109
|
+
opacity?: number;
|
|
110
|
+
}
|
|
111
|
+
/** The kind's id, as `FillStyle['fill']` carries it. */
|
|
112
|
+
declare const MESH_GRADIENT_KIND = "mesh-gradient";
|
|
113
|
+
/** A mesh paint, narrowed. */
|
|
114
|
+
declare function isMeshGradientFill(fill: FillStyle | null | undefined): fill is FillStyle & MeshGradientFill;
|
|
115
|
+
/** A one-patch square covering the unit box, its four corners four readings of
|
|
116
|
+
* `color` — a mesh seeded from a solid has to show *something* curved, or
|
|
117
|
+
* switching kind looks like nothing happened. */
|
|
118
|
+
declare function seedMeshPatch(color: string): MeshGradientFill;
|
|
119
|
+
/**
|
|
120
|
+
* A stop list as a mesh: one full-height band per gap between neighboring
|
|
121
|
+
* stops, colored left to right. The bands blend exactly the way the ramp
|
|
122
|
+
* does, so a horizontal gradient survives the switch unchanged. A zero-width
|
|
123
|
+
* gap is a hard break and gets no band.
|
|
124
|
+
*/
|
|
125
|
+
declare function meshFromStops(stops: readonly GradStop[]): MeshGradientFill;
|
|
126
|
+
/**
|
|
127
|
+
* A mesh read as a stop list: every patch's top edge — corner 0 to corner 1 —
|
|
128
|
+
* placed by its `x` across the mesh's horizontal extent. The inverse of
|
|
129
|
+
* `meshFromStops`, and for any other mesh the ramp across its top.
|
|
130
|
+
*/
|
|
131
|
+
declare function meshStops(mesh: MeshGradientFill): GradStop[];
|
|
132
|
+
/**
|
|
133
|
+
* The `<defs>` entry for a mesh paint, in weasel's own namespace.
|
|
134
|
+
*
|
|
135
|
+
* Not SVG's abandoned `<meshgradient>`: that vocabulary only reaches Coons
|
|
136
|
+
* patches, shares patch edges implicitly — a reader that gets the sharing
|
|
137
|
+
* wrong tears the surface rather than failing outright — and has exactly one
|
|
138
|
+
* implementation in the world. Ours writes every patch's points in full.
|
|
139
|
+
* `@weasel-js/svg` puts the paint fallback color beside the reference, so a
|
|
140
|
+
* foreign renderer paints flat instead of nothing.
|
|
141
|
+
*/
|
|
142
|
+
declare function meshGradientXml(id: string, mesh: MeshGradientFill): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A mesh paint baked into one RGBA bitmap.
|
|
146
|
+
*
|
|
147
|
+
* A patch is a surface over `(u, v)`, but a paint has to answer "what color is
|
|
148
|
+
* this fragment", which is the inverse question — and inverting a bicubic is
|
|
149
|
+
* Newton iteration per fragment. Every renderer that draws these instead
|
|
150
|
+
* subdivides the patch into small quads and rasterizes them forward, which is
|
|
151
|
+
* what this does, once per paint, into a texture the shader then samples. The
|
|
152
|
+
* cost is a texture and a resolution; the gain is that the paint composes with
|
|
153
|
+
* every fill the renderer already knows how to draw, clipping included.
|
|
154
|
+
*
|
|
155
|
+
* The bitmap is straight (non-premultiplied) RGBA, matching the ramp atlas;
|
|
156
|
+
* the fragment shader premultiplies.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
/** Texels on a side of a bake when the caller names no size. The renderer
|
|
160
|
+
* sizes each bake from how large the paint draws — see `meshBakeSize`. */
|
|
161
|
+
declare const MESH_BAKE_SIZE = 256;
|
|
162
|
+
/** The box a bake covers, in the paint's own space. */
|
|
163
|
+
interface MeshBox {
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
}
|
|
169
|
+
/** The bitmap `bakeMesh` produces, and the paint-space box it covers. */
|
|
170
|
+
interface BakedMesh {
|
|
171
|
+
/** `size` × `size` texels, straight RGBA. */
|
|
172
|
+
pixels: Uint8ClampedArray;
|
|
173
|
+
/** Texels on a side; `MESH_BAKE_SIZE` unless the caller asked otherwise. */
|
|
174
|
+
size: number;
|
|
175
|
+
/** Where the bitmap sits in paint space, which is what the shader maps a
|
|
176
|
+
* fragment through. */
|
|
177
|
+
box: MeshBox;
|
|
178
|
+
}
|
|
179
|
+
/** The union of every patch's bounds, or `null` when nothing is drawable. */
|
|
180
|
+
declare function meshBounds(patches: readonly MeshPatch[]): MeshBox | null;
|
|
181
|
+
/**
|
|
182
|
+
* Rasterize `patches` into a square bitmap covering their union.
|
|
183
|
+
*
|
|
184
|
+
* Returns `null` when no patch is drawable, which is the caller's cue to paint
|
|
185
|
+
* nothing rather than a blank square.
|
|
186
|
+
*/
|
|
187
|
+
declare function bakeMesh(patches: readonly MeshPatch[], space?: ColorSpace, size?: number): BakedMesh | null;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* How large a mesh bake is, and the bounded cache the bakes live in.
|
|
191
|
+
*
|
|
192
|
+
* A gradient's ramp is one-dimensional, so 256 texels cover it at any size. A
|
|
193
|
+
* mesh's bake is two-dimensional and is stretched over whatever the paint
|
|
194
|
+
* covers, so a fixed size shows its texels once the paint draws large. The
|
|
195
|
+
* bake is sized from the device pixels it covers instead, in power-of-two
|
|
196
|
+
* buckets so a zoom inside one bucket reuses the bake it already has.
|
|
197
|
+
*/
|
|
198
|
+
/** The smallest bake: below this a texture costs more in bookkeeping than in
|
|
199
|
+
* bytes. */
|
|
200
|
+
declare const MESH_BAKE_MIN = 32;
|
|
201
|
+
/** The largest bake, whatever the context allows: 16 MiB of RGBA, and a bake
|
|
202
|
+
* that already takes a noticeable moment on the CPU. */
|
|
203
|
+
declare const MESH_BAKE_MAX = 2048;
|
|
204
|
+
/**
|
|
205
|
+
* The bake side for a paint drawn `devicePx` device pixels across, on a
|
|
206
|
+
* context accepting `maxTextureSize`: the next power of two at or above it,
|
|
207
|
+
* clamped to `[MESH_BAKE_MIN, MESH_BAKE_MAX]` and to the context. A size that
|
|
208
|
+
* cannot be measured gets `MESH_BAKE_SIZE`.
|
|
209
|
+
*/
|
|
210
|
+
declare function meshBakeSize(devicePx: number, maxTextureSize: number): number;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The draggable points of a mesh paint, as pure geometry — what an on-canvas
|
|
214
|
+
* editor lists, and what moving one of them does to the paint.
|
|
215
|
+
*
|
|
216
|
+
* Nothing here knows a frame: the handles are in whatever space the mesh's
|
|
217
|
+
* points are, so a caller resolves a `'bounds'` mesh onto its box first
|
|
218
|
+
* (`fillInPoseFrame`) and normalizes the result back (`fillToBoundsFrame`).
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
/** What a handle moves: a patch corner, one of the two controls of an edge,
|
|
222
|
+
* or one of a tensor patch's four interior points. */
|
|
223
|
+
type MeshHandleKind = 'corner' | 'control' | 'interior';
|
|
224
|
+
/** One stored point: `patches[patch].points[index]`. */
|
|
225
|
+
interface MeshPointRef {
|
|
226
|
+
patch: number;
|
|
227
|
+
index: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* One draggable point.
|
|
231
|
+
*
|
|
232
|
+
* Patches store their points in full rather than sharing edges, so two
|
|
233
|
+
* patches that meet each carry a copy of the corner and controls they meet
|
|
234
|
+
* at. Those copies are one handle, with a `ref` per copy — dragging one of
|
|
235
|
+
* them alone would tear the surface open along the seam.
|
|
236
|
+
*/
|
|
237
|
+
interface MeshHandle {
|
|
238
|
+
/** Stable while the handle moves: its first ref, as `"patch:index"`. */
|
|
239
|
+
id: string;
|
|
240
|
+
kind: MeshHandleKind;
|
|
241
|
+
at: MeshPoint;
|
|
242
|
+
refs: readonly MeshPointRef[];
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Every draggable point of `mesh`, in walk order: each patch's corners and
|
|
246
|
+
* edge controls, then a tensor patch's interior. Coincident points of one
|
|
247
|
+
* kind merge into one handle. A patch that cannot be evaluated has none.
|
|
248
|
+
*/
|
|
249
|
+
declare function meshHandles(mesh: MeshGradientFill): MeshHandle[];
|
|
250
|
+
/**
|
|
251
|
+
* `mesh` with `handle` moved to `to`. A corner carries its edge controls
|
|
252
|
+
* and interior neighbor along by the same offset, the way a path editor's
|
|
253
|
+
* anchor carries its handles; a control or interior point moves alone.
|
|
254
|
+
* Returns a new paint; `mesh` is not modified.
|
|
255
|
+
*/
|
|
256
|
+
declare function moveMeshHandle(mesh: MeshGradientFill, handle: MeshHandle, to: MeshPoint): MeshGradientFill;
|
|
257
|
+
/** The lines an editor draws under the handles, as control polygons. */
|
|
258
|
+
interface MeshGuides {
|
|
259
|
+
/** Every patch edge as its four cubic control points, from the corner it
|
|
260
|
+
* leaves to the corner it reaches. */
|
|
261
|
+
edges: [MeshPoint, MeshPoint, MeshPoint, MeshPoint][];
|
|
262
|
+
/** Corner to each point it carries — an edge control or interior point. */
|
|
263
|
+
arms: [MeshPoint, MeshPoint][];
|
|
264
|
+
}
|
|
265
|
+
/** The guides for `mesh`'s valid patches. Shared edges appear once per patch. */
|
|
266
|
+
declare function meshGuides(mesh: MeshGradientFill): MeshGuides;
|
|
267
|
+
|
|
268
|
+
export { type BakedMesh, MESH_BAKE_MAX, MESH_BAKE_MIN, MESH_BAKE_SIZE, MESH_GRADIENT_KIND, type MeshBox, type MeshGradientFill, type MeshGuides, type MeshHandle, type MeshHandleKind, type MeshPatch, type MeshPoint, type MeshPointRef, bakeMesh, cornerWeights, evalPatch, isMeshGradientFill, isTensorPatch, isValidPatch, meshBakeSize, meshBounds, meshFromStops, meshGradientXml, meshGuides, meshHandles, meshStops, moveMeshHandle, patchBounds, patchCorner, seedMeshPatch };
|
package/dist/mesh.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cornerWeights as e, evalPatch as t, isTensorPatch as n, isValidPatch as r, patchBounds as i, patchCorner as a } from "./features/meshPaint/surface.js";
|
|
2
|
+
import { MESH_BAKE_SIZE as o, bakeMesh as s, meshBounds as c } from "./features/meshPaint/bake.js";
|
|
3
|
+
import { MESH_BAKE_MAX as l, MESH_BAKE_MIN as u, meshBakeSize as d } from "./features/meshPaint/bakeCache.js";
|
|
4
|
+
import { MESH_GRADIENT_KIND as f, isMeshGradientFill as p, meshFromStops as m, meshGradientXml as h, meshStops as g, seedMeshPatch as _ } from "./features/meshPaint/meshPaint.js";
|
|
5
|
+
import "./features/meshPaint/register.js";
|
|
6
|
+
import { meshGuides as v, meshHandles as y, moveMeshHandle as b } from "./features/meshPaint/handles.js";
|
|
7
|
+
export { l as MESH_BAKE_MAX, u as MESH_BAKE_MIN, o as MESH_BAKE_SIZE, f as MESH_GRADIENT_KIND, s as bakeMesh, e as cornerWeights, t as evalPatch, p as isMeshGradientFill, n as isTensorPatch, r as isValidPatch, d as meshBakeSize, c as meshBounds, m as meshFromStops, h as meshGradientXml, v as meshGuides, y as meshHandles, g as meshStops, b as moveMeshHandle, i as patchBounds, a as patchCorner, _ as seedMeshPatch };
|
package/dist/move.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import { O as OriginProjection } from './
|
|
2
|
-
export { U as UseMoveOptions } from './
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { S as SnapTarget } from './types-D-9QWBy5.js';
|
|
6
|
-
import { G as Guide } from './types-D2tTKEU0.js';
|
|
7
|
-
import '@weasel-js/quantity';
|
|
1
|
+
import { O as OriginProjection } from './originProjection-DEklpDc_.js';
|
|
2
|
+
export { U as UseMoveOptions } from './originProjection-DEklpDc_.js';
|
|
3
|
+
import { S as SnapTarget } from './types-A37hYkeR.js';
|
|
4
|
+
import { M as MoveBehavior } from './types-B_9g6hMM.js';
|
|
8
5
|
import '@weasel-js/history';
|
|
9
|
-
import '
|
|
10
|
-
|
|
11
|
-
type ModKey$1 = keyof ModifierState;
|
|
12
|
-
/** Move behavior that snaps the dragged pose's origin to a grid. Hold
|
|
13
|
-
* `bypassKey` to drag freely. */
|
|
14
|
-
declare function snapToGrid<TPose extends {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
}>(args: {
|
|
18
|
-
spacing: number;
|
|
19
|
-
bypassKey?: ModKey$1;
|
|
20
|
-
}): MoveBehavior<TPose>;
|
|
6
|
+
import '@weasel-js/geom';
|
|
7
|
+
import '@weasel-js/routing';
|
|
21
8
|
|
|
22
9
|
/**
|
|
23
10
|
* Move behavior that drops the dragged node into a container it hovers over
|
|
@@ -59,33 +46,4 @@ declare function snapBackOrDelete<TPose>(args: {
|
|
|
59
46
|
origin: OriginProjection<TPose>;
|
|
60
47
|
}): MoveBehavior<TPose>;
|
|
61
48
|
|
|
62
|
-
|
|
63
|
-
/** Options for the move-flavored `snapToGuides`. */
|
|
64
|
-
interface SnapToGuidesMoveArgs<TPose> {
|
|
65
|
-
/** Stable getter into the live guide list (typically from `useGuides`). */
|
|
66
|
-
getGuides: () => readonly Guide[];
|
|
67
|
-
/** Snap tolerance (screen px when `getView` is set, world units otherwise). */
|
|
68
|
-
tolerance?: number;
|
|
69
|
-
/** Read the active view; required for screen-pixel tolerance. */
|
|
70
|
-
getView?: () => View;
|
|
71
|
-
/** Modifier key that bypasses snapping while held. */
|
|
72
|
-
bypassKey?: ModKey;
|
|
73
|
-
/** Origin projection for non-rect TPose (e.g. Path). */
|
|
74
|
-
origin?: OriginProjection<TPose>;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Move behavior that snaps the dragged pose's origin to the nearest world-space
|
|
78
|
-
* guide line within `tolerance`. Closest-guide-per-axis wins; the two axes are
|
|
79
|
-
* considered independently. Pair with `useGuides` and `createGuidesLayer`.
|
|
80
|
-
*/
|
|
81
|
-
declare function snapToGuides<TPose extends {
|
|
82
|
-
x: number;
|
|
83
|
-
y: number;
|
|
84
|
-
}>(args: Omit<SnapToGuidesMoveArgs<TPose>, 'origin'>): MoveBehavior<TPose>;
|
|
85
|
-
/** As above, for a `TPose` that is not a rect: `origin` tells the behavior how
|
|
86
|
-
* to read and write the pose's origin. */
|
|
87
|
-
declare function snapToGuides<TPose>(args: SnapToGuidesMoveArgs<TPose> & {
|
|
88
|
-
origin: OriginProjection<TPose>;
|
|
89
|
-
}): MoveBehavior<TPose>;
|
|
90
|
-
|
|
91
|
-
export { snapBackOrDelete, snapToContainer, snapToGrid, snapToGuides };
|
|
49
|
+
export { snapBackOrDelete, snapToContainer };
|
package/dist/move.js
CHANGED
|
@@ -1,142 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { createDeleteOp } from './chunk-NE27EOLP.js';
|
|
5
|
-
import { scratchKey, getScratch, setScratch } from '@weasel-js/routing';
|
|
6
|
-
|
|
7
|
-
// src/interactions/actions/move/behaviors/snapToGrid.ts
|
|
8
|
-
function snapToGrid(args) {
|
|
9
|
-
return snap(gridSnapStrategy(args.spacing), { bypassKey: args.bypassKey });
|
|
10
|
-
}
|
|
11
|
-
var STATE = scratchKey("snapToContainer");
|
|
12
|
-
function getState(ctx) {
|
|
13
|
-
let s = getScratch(ctx.scratch, STATE);
|
|
14
|
-
if (!s) {
|
|
15
|
-
s = { pendingTargetId: null, pendingTimer: null, committedSnap: null };
|
|
16
|
-
setScratch(ctx.scratch, STATE, s);
|
|
17
|
-
}
|
|
18
|
-
return s;
|
|
19
|
-
}
|
|
20
|
-
function clearTimer(s) {
|
|
21
|
-
if (s.pendingTimer !== null) {
|
|
22
|
-
clearTimeout(s.pendingTimer);
|
|
23
|
-
s.pendingTimer = null;
|
|
24
|
-
}
|
|
25
|
-
s.pendingTargetId = null;
|
|
26
|
-
}
|
|
27
|
-
function snapToContainer(args) {
|
|
28
|
-
const { dwellMs, findTarget, isInstant, moveLabel = "Move", reparentLabel = "Move and reparent" } = args;
|
|
29
|
-
return {
|
|
30
|
-
onMove(ctx, _proposed) {
|
|
31
|
-
const s = getState(ctx);
|
|
32
|
-
const target = findTarget(ctx.draggedIds[0], ctx.pointer.worldX, ctx.pointer.worldY);
|
|
33
|
-
if (s.committedSnap) {
|
|
34
|
-
if (target && target.parentId === s.committedSnap.parentId) {
|
|
35
|
-
return { pose: s.committedSnap.slotPose, snap: s.committedSnap };
|
|
36
|
-
}
|
|
37
|
-
s.committedSnap = null;
|
|
38
|
-
}
|
|
39
|
-
if (!target) {
|
|
40
|
-
clearTimer(s);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (isInstant?.(target)) {
|
|
44
|
-
clearTimer(s);
|
|
45
|
-
s.committedSnap = target;
|
|
46
|
-
return { pose: target.slotPose, snap: target };
|
|
47
|
-
}
|
|
48
|
-
if (s.pendingTargetId === target.parentId) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
clearTimer(s);
|
|
52
|
-
s.pendingTargetId = target.parentId;
|
|
53
|
-
s.pendingTimer = setTimeout(() => {
|
|
54
|
-
s.committedSnap = target;
|
|
55
|
-
s.pendingTimer = null;
|
|
56
|
-
}, dwellMs);
|
|
57
|
-
return;
|
|
58
|
-
},
|
|
59
|
-
onEnd(ctx) {
|
|
60
|
-
const s = getState(ctx);
|
|
61
|
-
clearTimer(s);
|
|
62
|
-
const snap2 = s.committedSnap ?? ctx.snap;
|
|
63
|
-
if (!snap2) return;
|
|
64
|
-
const draggedId = ctx.draggedIds[0];
|
|
65
|
-
const oldParent = ctx.adapter.getParent?.(draggedId) ?? null;
|
|
66
|
-
const fromPose = ctx.origin.get(draggedId);
|
|
67
|
-
const ops = [
|
|
68
|
-
createTransformOp({
|
|
69
|
-
id: draggedId,
|
|
70
|
-
from: fromPose,
|
|
71
|
-
to: snap2.slotPose,
|
|
72
|
-
label: moveLabel
|
|
73
|
-
})
|
|
74
|
-
];
|
|
75
|
-
if (oldParent !== snap2.parentId) {
|
|
76
|
-
ops.push(createReparentOp({
|
|
77
|
-
id: draggedId,
|
|
78
|
-
fromParentId: oldParent,
|
|
79
|
-
toParentId: snap2.parentId,
|
|
80
|
-
label: reparentLabel
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
return ops;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
var SNAPSHOTS = scratchKey("snapBackOrDelete.snapshots");
|
|
88
|
-
var INDEXES = scratchKey("snapBackOrDelete.indexes");
|
|
89
|
-
function snapBackOrDelete(args) {
|
|
90
|
-
const { radius, onFreeRelease, deleteLabel = "Delete" } = args;
|
|
91
|
-
const proj = args.origin ?? AUTO_ORIGIN_PROJECTION;
|
|
92
|
-
const r2 = radius * radius;
|
|
93
|
-
return {
|
|
94
|
-
onStart(ctx) {
|
|
95
|
-
const snapshots = /* @__PURE__ */ new Map();
|
|
96
|
-
const indexes = /* @__PURE__ */ new Map();
|
|
97
|
-
const nodes = ctx.adapter.getNodes();
|
|
98
|
-
for (const id of ctx.draggedIds) {
|
|
99
|
-
const obj = ctx.adapter.getNode(id) ?? { id };
|
|
100
|
-
snapshots.set(id, obj);
|
|
101
|
-
indexes.set(id, nodes.findIndex((n) => n.id === id));
|
|
102
|
-
}
|
|
103
|
-
setScratch(ctx.scratch, SNAPSHOTS, snapshots);
|
|
104
|
-
setScratch(ctx.scratch, INDEXES, indexes);
|
|
105
|
-
},
|
|
106
|
-
onEnd(ctx) {
|
|
107
|
-
if (ctx.snap) return;
|
|
108
|
-
const id = ctx.draggedIds[0];
|
|
109
|
-
const o0 = proj.getOrigin(ctx.origin.get(id));
|
|
110
|
-
const o1 = proj.getOrigin(ctx.current.get(id));
|
|
111
|
-
const dx = o1.x - o0.x;
|
|
112
|
-
const dy = o1.y - o0.y;
|
|
113
|
-
const within = dx * dx + dy * dy <= r2;
|
|
114
|
-
if (within) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
if (onFreeRelease === "delete") {
|
|
118
|
-
const snapshots = getScratch(ctx.scratch, SNAPSHOTS);
|
|
119
|
-
const indexes = getScratch(ctx.scratch, INDEXES);
|
|
120
|
-
const obj = snapshots?.get(id) ?? { id };
|
|
121
|
-
const index = indexes?.get(id) ?? -1;
|
|
122
|
-
const ops = [createDeleteOp({ node: obj, label: deleteLabel, index })];
|
|
123
|
-
return ops;
|
|
124
|
-
}
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// src/interactions/actions/move/behaviors/snapToGuides.ts
|
|
131
|
-
function snapToGuides(args) {
|
|
132
|
-
const strategy = guideSnapStrategy(args.getGuides, {
|
|
133
|
-
tolerance: args.tolerance,
|
|
134
|
-
getView: args.getView,
|
|
135
|
-
origin: args.origin
|
|
136
|
-
});
|
|
137
|
-
return snap(strategy, { bypassKey: args.bypassKey });
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export { snapBackOrDelete, snapToContainer, snapToGrid, snapToGuides };
|
|
141
|
-
//# sourceMappingURL=move.js.map
|
|
142
|
-
//# sourceMappingURL=move.js.map
|
|
1
|
+
import { snapToContainer as e } from "./interactions/actions/move/behaviors/snapToContainer.js";
|
|
2
|
+
import { snapBackOrDelete as t } from "./interactions/actions/move/behaviors/snapBackOrDelete.js";
|
|
3
|
+
export { t as snapBackOrDelete, e as snapToContainer };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { M as MoveBehavior } from './types-B_9g6hMM.js';
|
|
2
|
+
|
|
3
|
+
/** Option surface for the `move` action. */
|
|
4
|
+
|
|
5
|
+
/** Options for the `move` action: the behaviors (snapping, momentum) layered
|
|
6
|
+
* over the raw drag, the ids a drag carries, and its history and lifecycle.
|
|
7
|
+
* `selectionMoveBindings` threads them into the move bindings. */
|
|
8
|
+
interface UseMoveOptions<TPose> {
|
|
9
|
+
behaviors?: MoveBehavior<TPose>[];
|
|
10
|
+
/** Screen travel, in CSS pixels, before the drag moves anything. Default
|
|
11
|
+
* `DRAG_THRESHOLD_PX`. The dispatcher opens no drag before that, so a
|
|
12
|
+
* smaller value has no effect; a larger one holds the selection in place
|
|
13
|
+
* until the pointer has gone that far. */
|
|
14
|
+
dragThresholdPx?: number;
|
|
15
|
+
/** History label for the committed move. Unset, a behavior's or a layout
|
|
16
|
+
* drop's own op label names it, else `'Move'`. */
|
|
17
|
+
moveLabel?: string;
|
|
18
|
+
/** Commit without an undo entry (`scene.untracked`), bypassing the
|
|
19
|
+
* consumer `applyOps` hook. Unset, a behavior's `defaultTransient` decides. */
|
|
20
|
+
transient?: boolean;
|
|
21
|
+
/** Fired once the drag passes its threshold, with the ids it moves. */
|
|
22
|
+
onGestureStart?(ids: string[]): void;
|
|
23
|
+
/** Fired once per `onGestureStart`: `true` when the move wrote to the
|
|
24
|
+
* document, `false` on cancel, a behavior abort, or no net movement. */
|
|
25
|
+
onGestureEnd?(committed: boolean): void;
|
|
26
|
+
/** Replace the selection with the ids the drag moves — to carry linked
|
|
27
|
+
* nodes along, say. Called once at drag start; the result is what
|
|
28
|
+
* behaviors see as `draggedIds` and what the commit writes (each id's
|
|
29
|
+
* descendants follow it as usual). Returning `[]` declines the drag.
|
|
30
|
+
* Default: the selection. */
|
|
31
|
+
expandIds?: (ids: string[]) => string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* How a snap reads and moves a pose that doesn't expose `{x,y}` directly
|
|
36
|
+
* (Path, polygon, etc.): `getOrigin` gives the point a snap strategy rounds,
|
|
37
|
+
* and `translate` moves the pose by the resulting delta.
|
|
38
|
+
*/
|
|
39
|
+
interface OriginProjection<TPose> {
|
|
40
|
+
getOrigin(pose: TPose): {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
translate(pose: TPose, dx: number, dy: number): TPose;
|
|
45
|
+
}
|
|
46
|
+
/** Identity projection for `TPose extends { x; y }`. */
|
|
47
|
+
declare const RECT_ORIGIN_PROJECTION: OriginProjection<{
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}>;
|
|
51
|
+
/** Per-call dispatch: routes Path-shaped poses to the path origin/translate
|
|
52
|
+
* helpers and everything else to `RECT_ORIGIN_PROJECTION`. The default for
|
|
53
|
+
* `snap` and the snap strategies, so consumers with Path TPose don't have to
|
|
54
|
+
* thread `pathOriginProjection` explicitly. */
|
|
55
|
+
declare const AUTO_ORIGIN_PROJECTION: OriginProjection<unknown>;
|
|
56
|
+
|
|
57
|
+
export { AUTO_ORIGIN_PROJECTION as A, type OriginProjection as O, RECT_ORIGIN_PROJECTION as R, type UseMoveOptions as U };
|
package/dist/patterns-builtin.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { drawTileShapes as e, tileGeometry as t, tileSize as n } from "./features/patterns/tileGeometry.js";
|
|
2
|
+
import { chunks as r, crosshatch as i, dots as a, hatch as o } from "./features/patterns/patterns-builtin.js";
|
|
3
|
+
export { r as chunks, i as crosshatch, a as dots, e as drawTileShapes, o as hatch, t as tileGeometry, n as tileSize };
|
|
@@ -27,10 +27,6 @@ interface PoseDescriptor<TPose, TNode = unknown> {
|
|
|
27
27
|
* back to a translation derived from `remapBounds` (origin shifted, no
|
|
28
28
|
* scale). Path-shaped poses should provide this for performance. */
|
|
29
29
|
translate?(pose: TPose, dx: number, dy: number): TPose;
|
|
30
|
-
/** True iff any portion of the pose's geometry intersects `rect`. Optional
|
|
31
|
-
* — when omitted, area-select and similar callers test against `getBounds`
|
|
32
|
-
* AABB (looser, but correct for axis-aligned rect poses). */
|
|
33
|
-
intersectsRect?(pose: TPose, rect: Bounds): boolean;
|
|
34
30
|
/** Interpolate between two poses. Optional — animation helpers fall back to
|
|
35
31
|
* rect-shape lerp when omitted (which fails for non-rect poses). */
|
|
36
32
|
lerp?(a: TPose, b: TPose, t: number): TPose;
|