@weasel-js/core 1.9.3 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1106 -0
- package/README.md +7 -5
- package/dist/WeaselProvider.js +5 -7
- package/dist/WeaselProvider.js.map +1 -1
- package/dist/affordances/composeAffordanceLayer.js +91 -93
- package/dist/affordances/composeAffordanceLayer.js.map +1 -1
- package/dist/affordances/cornerResize.js +27 -18
- package/dist/affordances/cornerResize.js.map +1 -1
- package/dist/affordances/hitAffordanceRegions.js +65 -104
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/affordances/rotationHandle.js +22 -21
- package/dist/affordances/rotationHandle.js.map +1 -1
- package/dist/animation/behaviors/coast.js +21 -0
- package/dist/animation/behaviors/coast.js.map +1 -0
- package/dist/animation/behaviors/coastByWrite.js +107 -0
- package/dist/animation/behaviors/coastByWrite.js.map +1 -0
- package/dist/animation/behaviors/coastOnTargets.js +94 -0
- package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
- package/dist/animation/behaviors/momentum.js +38 -88
- package/dist/animation/behaviors/momentum.js.map +1 -1
- package/dist/animation/clipTargets.js +12 -0
- package/dist/animation/clipTargets.js.map +1 -0
- package/dist/animation/index.js +15 -20
- package/dist/animation/poseHelpers.js +112 -33
- package/dist/animation/poseHelpers.js.map +1 -1
- package/dist/animation/poseTarget.js +115 -0
- package/dist/animation/poseTarget.js.map +1 -0
- package/dist/animation/reflow.js +113 -83
- package/dist/animation/reflow.js.map +1 -1
- package/dist/animation/rewind.js +66 -0
- package/dist/animation/rewind.js.map +1 -0
- package/dist/animation/rig/bindRig.js +85 -53
- package/dist/animation/rig/bindRig.js.map +1 -1
- package/dist/animation/rig/rigNode.js +93 -0
- package/dist/animation/rig/rigNode.js.map +1 -0
- package/dist/animation/rig/rigSeat.js +26 -0
- package/dist/animation/rig/rigSeat.js.map +1 -0
- package/dist/animation/rig/skinBinding.js +56 -0
- package/dist/animation/rig/skinBinding.js.map +1 -0
- package/dist/animation/rig/useRig.js +31 -16
- package/dist/animation/rig/useRig.js.map +1 -1
- package/dist/animation/wrappers/animateLifecycle.js +32 -24
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
- package/dist/animation/wrappers/animateOnSetPose.js +31 -29
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
- package/dist/animation/wrappers/instantPose.js +13 -0
- package/dist/animation/wrappers/instantPose.js.map +1 -0
- package/dist/animation/writtenPoseTarget.js +33 -0
- package/dist/animation/writtenPoseTarget.js.map +1 -0
- package/dist/{autoPoseDescriptor-vCdt55xm.d.ts → autoPoseDescriptor-DHg5KqaJ.d.ts} +1 -1
- package/dist/barrel/canvas.js +31 -0
- package/dist/barrel/chrome.js +16 -0
- package/dist/barrel/input.js +18 -0
- package/dist/barrel/interactions.js +38 -0
- package/dist/barrel/paint.js +11 -0
- package/dist/barrel/paths.js +12 -0
- package/dist/barrel/renderer.js +14 -0
- package/dist/barrel/routing.js +57 -0
- package/dist/barrel/scene.js +37 -0
- package/dist/barrel/text.js +9 -0
- package/dist/barrel/viewport.js +42 -0
- package/dist/canvas/Canvas.js +280 -559
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +147 -167
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/CursorCoordsHud.js +53 -49
- package/dist/canvas/CursorCoordsHud.js.map +1 -1
- package/dist/canvas/DrawCanvas.js +40 -51
- package/dist/canvas/DrawCanvas.js.map +1 -1
- package/dist/canvas/ModalityHud.js.map +1 -1
- package/dist/canvas/NodeShape.js +55 -374
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/PickHud.js +50 -47
- package/dist/canvas/PickHud.js.map +1 -1
- package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
- package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +126 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +27 -31
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +64 -0
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +16 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/coordTrace.js +46 -0
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +138 -85
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +9 -8
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
- package/dist/canvas/SceneCanvas/features.js +74 -43
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/isDev.js +12 -0
- package/dist/canvas/SceneCanvas/isDev.js.map +1 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js +31 -34
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
- package/dist/canvas/SceneCanvas/poseRegistrars.js +13 -0
- package/dist/canvas/SceneCanvas/poseRegistrars.js.map +1 -0
- package/dist/canvas/SceneCanvas/props.js +39 -0
- package/dist/canvas/SceneCanvas/props.js.map +1 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +21 -62
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
- package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js +38 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +29 -29
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
- package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +48 -48
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +74 -78
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/worldPointAt.js +9 -0
- package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +311 -969
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +42 -46
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/adapterDerivedPath.js +26 -0
- package/dist/canvas/adapterDerivedPath.js.map +1 -0
- package/dist/canvas/affordanceAt.js +11 -1
- package/dist/canvas/affordanceAt.js.map +1 -1
- package/dist/canvas/buildSceneLayer.js +111 -0
- package/dist/canvas/buildSceneLayer.js.map +1 -0
- package/dist/canvas/buildSceneTree.js +16 -19
- package/dist/canvas/buildSceneTree.js.map +1 -1
- package/dist/canvas/canvasRenderer.js +67 -55
- package/dist/canvas/canvasRenderer.js.map +1 -1
- package/dist/canvas/colorOverrides.js.map +1 -1
- package/dist/canvas/defaultDrawOne.js +12 -12
- package/dist/canvas/defaultDrawOne.js.map +1 -1
- package/dist/canvas/deps/areaSelect.js +4 -4
- package/dist/canvas/deps/areaSelect.js.map +1 -1
- package/dist/canvas/deps/changes.js +13 -0
- package/dist/canvas/deps/changes.js.map +1 -0
- package/dist/canvas/deps/debug.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +38 -57
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/geometryProjection.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +31 -26
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +130 -91
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/lassoSelect.js +5 -5
- package/dist/canvas/deps/lassoSelect.js.map +1 -1
- package/dist/canvas/deps/poseDescriptor.js +1 -1
- package/dist/canvas/deps/poseDescriptor.js.map +1 -1
- package/dist/canvas/deps/resizePolicy.js.map +1 -1
- package/dist/canvas/deps/slice.js +26 -26
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +6 -5
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/deps/view.js.map +1 -1
- package/dist/canvas/derivedPath.js +47 -22
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/drawEnvelope.js +8 -4
- package/dist/canvas/drawEnvelope.js.map +1 -1
- package/dist/canvas/getNodeAtPoint.js +4 -8
- package/dist/canvas/getNodeAtPoint.js.map +1 -1
- package/dist/canvas/hud.module.js +1 -1
- package/dist/canvas/hud.module.js.map +1 -1
- package/dist/canvas/insertPreviewExtent.js.map +1 -1
- package/dist/canvas/kitRequirements.js +2 -2
- package/dist/canvas/kitRequirements.js.map +1 -1
- package/dist/canvas/layerOrder.js +13 -6
- package/dist/canvas/layerOrder.js.map +1 -1
- package/dist/canvas/layerSlots.js +6 -1
- package/dist/canvas/layerSlots.js.map +1 -1
- package/dist/canvas/nodeShapes/derivedPainter.js +34 -0
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/imagePainter.js +87 -0
- package/dist/canvas/nodeShapes/imagePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/memo.js +9 -0
- package/dist/canvas/nodeShapes/memo.js.map +1 -0
- package/dist/canvas/nodeShapes/nodePaint.js +68 -0
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -0
- package/dist/canvas/nodeShapes/pathPainter.js +39 -0
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/poseBox.js +20 -0
- package/dist/canvas/nodeShapes/poseBox.js.map +1 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +38 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/shapePainter.js +72 -0
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/textPainter.js +55 -0
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/paintCull.js +11 -14
- package/dist/canvas/paintCull.js.map +1 -1
- package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
- package/dist/canvas/paintedCursorLayer.js.map +1 -0
- package/dist/canvas/pickWalk.js +59 -68
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/planeClips.js +18 -19
- package/dist/canvas/planeClips.js.map +1 -1
- package/dist/canvas/poseCascade.js +41 -0
- package/dist/canvas/poseCascade.js.map +1 -0
- package/dist/canvas/poseRotation.js +9 -23
- package/dist/canvas/poseRotation.js.map +1 -1
- package/dist/canvas/rasterReadback.js +22 -0
- package/dist/canvas/rasterReadback.js.map +1 -0
- package/dist/canvas/renderDebugSnapshot.js +11 -11
- package/dist/canvas/renderDebugSnapshot.js.map +1 -1
- package/dist/canvas/renderNeeds.js +3 -3
- package/dist/canvas/renderNeeds.js.map +1 -1
- package/dist/canvas/renderSceneToPixels.js +64 -81
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +68 -214
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +112 -0
- package/dist/canvas/sceneClipboard.js.map +1 -0
- package/dist/canvas/sceneLayerPaint.js +4 -4
- package/dist/canvas/sceneLayerPaint.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +39 -39
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/slopsDebugLayer.js +4 -4
- package/dist/canvas/slopsDebugLayer.js.map +1 -1
- package/dist/canvas/surface.module.js +6 -0
- package/dist/canvas/surface.module.js.map +1 -0
- package/dist/canvas/surfaceBox.js +16 -0
- package/dist/canvas/surfaceBox.js.map +1 -0
- package/dist/canvas/useCanvasRenderer.js +26 -6
- package/dist/canvas/useCanvasRenderer.js.map +1 -1
- package/dist/canvas/useCanvasSurface.js +31 -0
- package/dist/canvas/useCanvasSurface.js.map +1 -0
- package/dist/canvas/useCanvasView.js +67 -0
- package/dist/canvas/useCanvasView.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +39 -31
- package/dist/canvas/useFrameLoop.js.map +1 -1
- package/dist/canvas/useHostAnchor.js +35 -33
- package/dist/canvas/useHostAnchor.js.map +1 -1
- package/dist/canvas/useLateContentRedraw.js +8 -8
- package/dist/canvas/useLateContentRedraw.js.map +1 -1
- package/dist/canvas/useSceneLayerList.js +11 -0
- package/dist/canvas/useSceneLayerList.js.map +1 -0
- package/dist/canvas/useSurfaceInput.js +42 -0
- package/dist/canvas/useSurfaceInput.js.map +1 -0
- package/dist/canvas/useToolCursor.js +29 -0
- package/dist/canvas/useToolCursor.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +46 -85
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/viewInputs.js.map +1 -1
- package/dist/canvas/viewRegistry.js +25 -27
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/canvas/watchElementMove.js +43 -0
- package/dist/canvas/watchElementMove.js.map +1 -0
- package/dist/canvas/wrapNodeOutput.js.map +1 -1
- package/dist/clipboard.d.ts +16 -19
- package/dist/{types-B_9g6hMM.d.ts → clone-2a5hVbBd.d.ts} +123 -74
- package/dist/clone.d.ts +4 -7
- package/dist/clone.js +0 -2
- package/dist/core/device/index.js +5 -4
- package/dist/core/device/targets.js.map +1 -1
- package/dist/core/device/useDeviceProfile.js +38 -44
- package/dist/core/device/useDeviceProfile.js.map +1 -1
- package/dist/core/device/watchDevicePixelRatio.js +17 -0
- package/dist/core/device/watchDevicePixelRatio.js.map +1 -0
- package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
- package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/pathPoseDescriptor.js +88 -0
- package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/poseDescriptor.js +68 -19
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/regionHit.js +31 -34
- package/dist/core/geometry/regionHit.js.map +1 -1
- package/dist/core/geometry/targetFrame.js +94 -0
- package/dist/core/geometry/targetFrame.js.map +1 -0
- package/dist/core/geometry/unionBounds.js +30 -29
- package/dist/core/geometry/unionBounds.js.map +1 -1
- package/dist/core/isPlainObject.js +2 -11
- package/dist/core/layers/backgroundFill.js +31 -0
- package/dist/core/layers/backgroundFill.js.map +1 -0
- package/dist/{features/groups → core/layers}/children.js +1 -1
- package/dist/core/layers/children.js.map +1 -0
- package/dist/core/layers/gateLayer.js +13 -0
- package/dist/core/layers/gateLayer.js.map +1 -0
- package/dist/core/layers/layerGroup.js +40 -0
- package/dist/core/layers/layerGroup.js.map +1 -0
- package/dist/core/layers/render.js +50 -76
- package/dist/core/layers/render.js.map +1 -1
- package/dist/core/ops/arrange.js +1 -0
- package/dist/core/ops/arrange.js.map +1 -1
- package/dist/core/ops/create.js +10 -5
- package/dist/core/ops/create.js.map +1 -1
- package/dist/core/ops/createHistory.js +9 -9
- package/dist/core/ops/createHistory.js.map +1 -1
- package/dist/core/ops/delete.js +12 -24
- package/dist/core/ops/delete.js.map +1 -1
- package/dist/core/ops/reorder/index.js +43 -40
- package/dist/core/ops/reorder/index.js.map +1 -1
- package/dist/core/ops/reorder/setChildOrder.js +34 -0
- package/dist/core/ops/reorder/setChildOrder.js.map +1 -0
- package/dist/core/paint/meshKind.js +16 -0
- package/dist/core/paint/meshKind.js.map +1 -0
- package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +282 -105
- package/dist/core/paint/meshKindLazy.js.map +1 -0
- package/dist/core/paint/paintKindEntry.js +8 -0
- package/dist/core/paint/paintKindEntry.js.map +1 -0
- package/dist/core/paint/paintKinds.js +144 -0
- package/dist/core/paint/paintKinds.js.map +1 -0
- package/dist/core/paint/registerMesh.js +7 -0
- package/dist/core/paint/registerMesh.js.map +1 -0
- package/dist/core/scene/NodeProperties.js.map +1 -1
- package/dist/core/scene/NodeRouting.js.map +1 -1
- package/dist/core/scene/appliedLog.js +37 -0
- package/dist/core/scene/appliedLog.js.map +1 -0
- package/dist/core/scene/arrivalWindow.js +102 -0
- package/dist/core/scene/arrivalWindow.js.map +1 -0
- package/dist/core/scene/boundOps.js +40 -0
- package/dist/core/scene/boundOps.js.map +1 -0
- package/dist/core/scene/composeFrame.js +9 -6
- package/dist/core/scene/composeFrame.js.map +1 -1
- package/dist/{features/groups → core/scene}/composePose.js +18 -18
- package/dist/core/scene/composePose.js.map +1 -0
- package/dist/core/scene/depMemo.js +31 -6
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/derivedPath.js +19 -20
- package/dist/core/scene/derivedPath.js.map +1 -1
- package/dist/core/scene/editMode.js +26 -0
- package/dist/core/scene/editMode.js.map +1 -0
- package/dist/core/scene/effectivePose.js +38 -39
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/fieldEdits.js +98 -0
- package/dist/core/scene/fieldEdits.js.map +1 -0
- package/dist/core/scene/historyFacade.js +130 -0
- package/dist/core/scene/historyFacade.js.map +1 -0
- package/dist/core/scene/historyForm.js +6 -0
- package/dist/core/scene/historyForm.js.map +1 -0
- package/dist/core/scene/kitOps.js +185 -0
- package/dist/core/scene/kitOps.js.map +1 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layerStack.js +131 -0
- package/dist/core/scene/layerStack.js.map +1 -0
- package/dist/core/scene/layoutPass.js +58 -59
- package/dist/core/scene/layoutPass.js.map +1 -1
- package/dist/core/scene/lockGuard.js +37 -0
- package/dist/core/scene/lockGuard.js.map +1 -0
- package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
- package/dist/core/scene/nestedHit.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +10 -11
- package/dist/core/scene/nodeFnFields.js.map +1 -1
- package/dist/core/scene/nodeMemo.js +45 -19
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/nodeStore.js +127 -0
- package/dist/core/scene/nodeStore.js.map +1 -0
- package/dist/core/scene/notifier.js +37 -0
- package/dist/core/scene/notifier.js.map +1 -0
- package/dist/core/scene/opTable.js +50 -0
- package/dist/core/scene/opTable.js.map +1 -0
- package/dist/core/scene/outerOps.js +66 -0
- package/dist/core/scene/outerOps.js.map +1 -0
- package/dist/core/scene/poseFeed.js +38 -38
- package/dist/core/scene/poseFeed.js.map +1 -1
- package/dist/core/scene/poseHold.js +39 -0
- package/dist/core/scene/poseHold.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +44 -40
- package/dist/core/scene/poseOverrides.js.map +1 -1
- package/dist/core/scene/poseSnapshot.js.map +1 -1
- package/dist/core/scene/reconcileSpecs.js +3 -2
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/recorder.js +86 -0
- package/dist/core/scene/recorder.js.map +1 -0
- package/dist/core/scene/renderOrder.js +84 -0
- package/dist/core/scene/renderOrder.js.map +1 -0
- package/dist/core/scene/scene.js +80 -1266
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneEdits.js +58 -0
- package/dist/core/scene/sceneEdits.js.map +1 -0
- package/dist/core/scene/sceneMutators.js +49 -0
- package/dist/core/scene/sceneMutators.js.map +1 -0
- package/dist/core/scene/scenePoseAdapter.js +16 -0
- package/dist/core/scene/scenePoseAdapter.js.map +1 -0
- package/dist/core/scene/sceneRecording.js +90 -0
- package/dist/core/scene/sceneRecording.js.map +1 -0
- package/dist/core/scene/sceneSelection.js +28 -0
- package/dist/core/scene/sceneSelection.js.map +1 -0
- package/dist/core/scene/sceneState.js +49 -0
- package/dist/core/scene/sceneState.js.map +1 -0
- package/dist/core/scene/serialization.js +71 -0
- package/dist/core/scene/serialization.js.map +1 -0
- package/dist/core/scene/staleReplay.js +51 -0
- package/dist/core/scene/staleReplay.js.map +1 -0
- package/dist/core/scene/statedFields.js +9 -0
- package/dist/core/scene/statedFields.js.map +1 -0
- package/dist/core/scene/treeEdits.js +127 -0
- package/dist/core/scene/treeEdits.js.map +1 -0
- package/dist/core/scene/treeOrder.js +13 -0
- package/dist/core/scene/treeOrder.js.map +1 -0
- package/dist/core/scene/treeReads.js +26 -0
- package/dist/core/scene/treeReads.js.map +1 -0
- package/dist/core/scene/types.js.map +1 -1
- package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
- package/dist/core/scene/unionOfChildren.js.map +1 -0
- package/dist/core/scene/unitScopes.js +13 -0
- package/dist/core/scene/unitScopes.js.map +1 -0
- package/dist/core/scene/useScene.js.map +1 -1
- package/dist/core/selection/readOnlySelection.js +32 -0
- package/dist/core/selection/readOnlySelection.js.map +1 -0
- package/dist/core/selection/usePublishSceneSelection.js +26 -0
- package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
- package/dist/core/selection/useSelection.js +34 -25
- package/dist/core/selection/useSelection.js.map +1 -1
- package/dist/core/shapeKinds.js.map +1 -1
- package/dist/core/stylus/stylus.js.map +1 -1
- package/dist/core/stylus/usePointerStylus.js.map +1 -1
- package/dist/core/usePaintKinds.js +1 -1
- package/dist/core/usePaintKinds.js.map +1 -1
- package/dist/core/viewport/clientToWorld.js.map +1 -1
- package/dist/core/viewport/fitViewToBounds.js.map +1 -1
- package/dist/core/viewport/parallax.js.map +1 -1
- package/dist/core/viewport/screenSlop.js +11 -11
- package/dist/core/viewport/screenSlop.js.map +1 -1
- package/dist/core/viewport/useCanvasSize.js.map +1 -1
- package/dist/core/viewport/useDecayLoop.js +8 -8
- package/dist/core/viewport/useDecayLoop.js.map +1 -1
- package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
- package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
- package/dist/core/viewport/useViewAnimation.js +102 -43
- package/dist/core/viewport/useViewAnimation.js.map +1 -1
- package/dist/core/viewport/view.js +9 -9
- package/dist/core/viewport/view.js.map +1 -1
- package/dist/core/viewport/wheelHandler.js.map +1 -1
- package/dist/core/viewport/zoomBounds.js +10 -8
- package/dist/core/viewport/zoomBounds.js.map +1 -1
- package/dist/{cornerHandles-BCrDp_mH.d.ts → cornerHandles-BEshc4z3.d.ts} +11 -24
- package/dist/debug/createDebugOverlayLayer.js +97 -97
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/createDebugSink.js.map +1 -1
- package/dist/debug/flag.js +2 -41
- package/dist/debug/frameStats.js.map +1 -1
- package/dist/debug/useDebugSink.js +52 -0
- package/dist/debug/useDebugSink.js.map +1 -0
- package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
- package/dist/features/chrome-caps/conditions.js.map +1 -1
- package/dist/features/chrome-caps/defaults.js.map +1 -1
- package/dist/features/chrome-caps/resolve.js.map +1 -1
- package/dist/features/chrome-caps/useChromeCaps.js +54 -0
- package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +22 -17
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +28 -19
- package/dist/features/ingestion/contentHandlers.js.map +1 -1
- package/dist/features/ingestion/imageHandler.js +21 -24
- package/dist/features/ingestion/imageHandler.js.map +1 -1
- package/dist/features/ingestion/openFilePicker.js.map +1 -1
- package/dist/features/ingestion/placement.js +16 -0
- package/dist/features/ingestion/placement.js.map +1 -0
- package/dist/features/ingestion/registerKitHandlers.js +7 -7
- package/dist/features/ingestion/svgHandler.js +5 -0
- package/dist/features/ingestion/svgHandler.js.map +1 -1
- package/dist/features/ingestion/textHandler.js +28 -0
- package/dist/features/ingestion/textHandler.js.map +1 -0
- package/dist/features/ingestion/useCanvasIngestion.js +48 -0
- package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
- package/dist/features/ingestion/weaselJsonHandler.js +22 -14
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
- package/dist/features/longPress/longPressFeedback.js.map +1 -1
- package/dist/features/modes/modeLayers.js +7 -7
- package/dist/features/modes/modeLayers.js.map +1 -1
- package/dist/features/paths/editablePath.js +47 -0
- package/dist/features/paths/editablePath.js.map +1 -0
- package/dist/features/paths/index.js +9 -14
- package/dist/features/paths/pathEditState.js +41 -0
- package/dist/features/paths/pathEditState.js.map +1 -0
- package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
- package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
- package/dist/features/paths/pathLayer.js +3 -2
- package/dist/features/paths/pathLayer.js.map +1 -1
- package/dist/features/paths/penPreviewLayer.js +86 -88
- package/dist/features/paths/penPreviewLayer.js.map +1 -1
- package/dist/features/paths/usePathEdit.js +34 -0
- package/dist/features/paths/usePathEdit.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +44 -52
- package/dist/features/poseRun/usePoseRun.js.map +1 -1
- package/dist/features/selection/overlay.js +171 -179
- package/dist/features/selection/overlay.js.map +1 -1
- package/dist/features/text/index.js +6 -0
- package/dist/features/text/textLayer.js +1 -1
- package/dist/features/text/textLayer.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +100 -93
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/viewportLayer.js +25 -36
- package/dist/features/viewports/viewportLayer.js.map +1 -1
- package/dist/index.d.ts +8473 -9141
- package/dist/index.js +269 -307
- package/dist/input/keyState.js +38 -39
- package/dist/input/keyState.js.map +1 -1
- package/dist/input/useKeyModifiers.js +11 -0
- package/dist/input/useKeyModifiers.js.map +1 -0
- package/dist/interactions/actions/actionShortcuts.js.map +1 -1
- package/dist/interactions/actions/{defaults/align.js → align/action.js} +18 -20
- package/dist/interactions/actions/align/action.js.map +1 -0
- package/dist/interactions/actions/align/align.js +20 -20
- package/dist/interactions/actions/align/align.js.map +1 -1
- package/dist/interactions/actions/booleans/action.js +65 -0
- package/dist/interactions/actions/booleans/action.js.map +1 -0
- package/dist/interactions/actions/booleans/booleans.js +69 -78
- package/dist/interactions/actions/booleans/booleans.js.map +1 -1
- package/dist/interactions/actions/booleans/operands.js +40 -0
- package/dist/interactions/actions/booleans/operands.js.map +1 -0
- package/dist/interactions/actions/booleans/pieces.js +45 -0
- package/dist/interactions/actions/booleans/pieces.js.map +1 -0
- package/dist/interactions/actions/booleans/placement.js +24 -0
- package/dist/interactions/actions/booleans/placement.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleans.js +11 -9
- package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
- package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
- package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +31 -15
- package/dist/interactions/actions/clipboard/action.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +44 -42
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
- package/dist/interactions/actions/clipboard/materializePaste.js +10 -7
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
- package/dist/interactions/actions/clone/action.js +98 -0
- package/dist/interactions/actions/clone/action.js.map +1 -0
- package/dist/interactions/actions/clone/behaviors.js +52 -0
- package/dist/interactions/actions/clone/behaviors.js.map +1 -0
- package/dist/interactions/actions/defaultCommitAdapter.js +7 -32
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +60 -84
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/areaSelect.js +35 -38
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
- package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/copySubtree.js +40 -0
- package/dist/interactions/actions/defaults/copySubtree.js.map +1 -0
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +13 -53
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +40 -50
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +44 -38
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +11 -12
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +40 -69
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/nudgeSteps.js +37 -0
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -0
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/reorder.js +2 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +14 -8
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +7 -4
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
- package/dist/interactions/actions/defaults/setStroke.js +12 -12
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +6 -6
- package/dist/interactions/actions/defaults/sliceOps.js +8 -10
- package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportDragPan.js +37 -26
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/distribute/action.js +66 -0
- package/dist/interactions/actions/distribute/action.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +11 -11
- package/dist/interactions/actions/distribute/distribute.js.map +1 -1
- package/dist/interactions/actions/{defaults/editAnchors.js → edit-anchors/action.js} +7 -9
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +30 -27
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +124 -0
- package/dist/interactions/actions/flip/action.js.map +1 -0
- package/dist/interactions/actions/flip/helpers.js +30 -17
- package/dist/interactions/actions/flip/helpers.js.map +1 -1
- package/dist/interactions/actions/gestureFrames.js +18 -0
- package/dist/interactions/actions/gestureFrames.js.map +1 -0
- package/dist/interactions/actions/gestureLifecycle.js +47 -20
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
- package/dist/interactions/actions/hitSelection.js +8 -0
- package/dist/interactions/actions/hitSelection.js.map +1 -0
- package/dist/interactions/actions/insert/action.js +72 -0
- package/dist/interactions/actions/insert/action.js.map +1 -0
- package/dist/interactions/actions/insert/commit.js +28 -0
- package/dist/interactions/actions/insert/commit.js.map +1 -0
- package/dist/interactions/actions/insert/extras.js +65 -0
- package/dist/interactions/actions/insert/extras.js.map +1 -0
- package/dist/interactions/actions/insert/frame.js +48 -0
- package/dist/interactions/actions/insert/frame.js.map +1 -0
- package/dist/interactions/actions/insert/geometry.js +35 -0
- package/dist/interactions/actions/insert/geometry.js.map +1 -0
- package/dist/interactions/actions/insert/rotateAction.js +21 -0
- package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
- package/dist/interactions/actions/insert/session.js +59 -0
- package/dist/interactions/actions/insert/session.js.map +1 -0
- package/dist/interactions/actions/insert/shape.js +34 -0
- package/dist/interactions/actions/insert/shape.js.map +1 -0
- package/dist/interactions/actions/lasso-select/action.js +143 -0
- package/dist/interactions/actions/lasso-select/action.js.map +1 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +14 -18
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
- package/dist/interactions/actions/move/action.js +87 -0
- package/dist/interactions/actions/move/action.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +5 -5
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +39 -27
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/capture.js +99 -0
- package/dist/interactions/actions/move/capture.js.map +1 -0
- package/dist/interactions/actions/move/commit/index.js +41 -0
- package/dist/interactions/actions/move/commit/index.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
- package/dist/interactions/actions/move/commit/rebase.js +18 -0
- package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
- package/dist/interactions/actions/move/commit/reparent.js +65 -0
- package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
- package/dist/interactions/actions/move/delta.js +51 -0
- package/dist/interactions/actions/move/delta.js.map +1 -0
- package/dist/interactions/actions/move/frame.js +59 -0
- package/dist/interactions/actions/move/frame.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +22 -30
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
- package/dist/interactions/actions/move/landedDescendants.js +33 -0
- package/dist/interactions/actions/move/landedDescendants.js.map +1 -0
- package/dist/interactions/actions/move/layout/container.js +94 -0
- package/dist/interactions/actions/move/layout/container.js.map +1 -0
- package/dist/interactions/actions/move/layout/dragged.js +58 -0
- package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
- package/dist/interactions/actions/move/layout/dropPass.js +122 -0
- package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
- package/dist/interactions/actions/move/layout/exits.js +38 -0
- package/dist/interactions/actions/move/layout/exits.js.map +1 -0
- package/dist/interactions/actions/move/layout/glide.js +48 -0
- package/dist/interactions/actions/move/layout/glide.js.map +1 -0
- package/dist/interactions/actions/move/session.js +63 -0
- package/dist/interactions/actions/move/session.js.map +1 -0
- package/dist/interactions/actions/move/translate.js +61 -0
- package/dist/interactions/actions/move/translate.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlines.js +16 -63
- package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
- package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
- package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
- package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
- package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
- package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
- package/dist/interactions/actions/planeInput.js.map +1 -1
- package/dist/interactions/actions/pointerState.js +12 -0
- package/dist/interactions/actions/pointerState.js.map +1 -0
- package/dist/interactions/actions/poseDescriptorDep.js +16 -4
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +25 -20
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +55 -0
- package/dist/interactions/actions/resize/action.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
- package/dist/interactions/actions/resize/boxFrame.js +16 -0
- package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
- package/dist/interactions/actions/resize/capture.js +85 -0
- package/dist/interactions/actions/resize/capture.js.map +1 -0
- package/dist/interactions/actions/resize/commit.js +69 -0
- package/dist/interactions/actions/resize/commit.js.map +1 -0
- package/dist/interactions/actions/resize/frame.js +74 -0
- package/dist/interactions/actions/resize/frame.js.map +1 -0
- package/dist/interactions/actions/resize/pointSnap.js +111 -0
- package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
- package/dist/interactions/actions/resize/ruleBounds.js +9 -0
- package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
- package/dist/interactions/actions/resize/session.js +49 -0
- package/dist/interactions/actions/resize/session.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -1
- package/dist/interactions/actions/resolvePreviews.js.map +1 -1
- package/dist/interactions/actions/rotate/action.js +56 -0
- package/dist/interactions/actions/rotate/action.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
- package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
- package/dist/interactions/actions/rotate/commit.js +40 -0
- package/dist/interactions/actions/rotate/commit.js.map +1 -0
- package/dist/interactions/actions/rotate/frame.js +65 -0
- package/dist/interactions/actions/rotate/frame.js.map +1 -0
- package/dist/interactions/actions/rotate/handle.js +12 -12
- package/dist/interactions/actions/rotate/handle.js.map +1 -1
- package/dist/interactions/actions/rotate/session.js +92 -0
- package/dist/interactions/actions/rotate/session.js.map +1 -0
- package/dist/interactions/actions/selectionSubtree.js +69 -0
- package/dist/interactions/actions/selectionSubtree.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -1
- package/dist/interactions/actions/useStandardActions.js +87 -78
- package/dist/interactions/actions/useStandardActions.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragGesture.js +4 -7
- package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragPointOf.js +23 -0
- package/dist/interactions/gestures/dragGesture/dragPointOf.js.map +1 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js +21 -26
- package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -1
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +62 -41
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
- package/dist/interactions/gestures/shared/originProjection.js +1 -1
- package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
- package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
- package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
- package/dist/interactions/gestures/shared/snap.js.map +1 -1
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +8 -4
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -1
- package/dist/layout/arrivals.js +20 -23
- package/dist/layout/arrivals.js.map +1 -1
- package/dist/math-CYUjoyyU.d.ts +33 -0
- package/dist/math.d.ts +5 -3
- package/dist/math.js +6 -6
- package/dist/mesh.d.ts +4 -268
- package/dist/mesh.js +3 -7
- package/dist/move.d.ts +14 -11
- package/dist/{originProjection-DEklpDc_.d.ts → originProjection-PPT88jZv.d.ts} +1 -1
- package/dist/patterns-builtin.d.ts +1 -118
- package/dist/patterns-builtin.js +2 -3
- package/dist/{poseDescriptor-D-OH-tu5.d.ts → poseDescriptor-Bqk-11Rl.d.ts} +26 -36
- package/dist/renderer.d.ts +1 -91
- package/dist/renderer.js +2 -18
- package/dist/resize.d.ts +10 -22
- package/dist/resize.js +6 -6
- package/dist/style.css +1 -1
- package/dist/test-hook/install.js +12 -6
- package/dist/test-hook/install.js.map +1 -1
- package/dist/test-hook/useTestHook.js +22 -0
- package/dist/test-hook/useTestHook.js.map +1 -0
- package/dist/test-seams-D0pyV3pR.d.ts +149 -0
- package/dist/test-seams.d.ts +4 -4
- package/dist/test-seams.js +2 -2
- package/dist/tools/builtin/bone/boneActions.js +130 -0
- package/dist/tools/builtin/bone/boneActions.js.map +1 -0
- package/dist/tools/builtin/bone/boneOverlay.js +58 -0
- package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
- package/dist/tools/builtin/bone/placedRig.js +24 -0
- package/dist/tools/builtin/bone/placedRig.js.map +1 -0
- package/dist/tools/builtin/bone/rigEditState.js +21 -0
- package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
- package/dist/tools/builtin/bone/useBoneTool.js +98 -0
- package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/hand/useHandTool.js +1 -0
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js +11 -11
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
- package/dist/tools/builtin/line/useLineTool.js +1 -0
- package/dist/tools/builtin/line/useLineTool.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +198 -150
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
- package/dist/tools/builtin/pencil/usePencilTool.js +1 -0
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js +13 -8
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/rect/useRectTool.js +1 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
- package/dist/tools/builtin/select/adapterPointQuery.js +36 -0
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +25 -24
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +42 -67
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/shared/pointerFollower.js +17 -0
- package/dist/tools/builtin/shared/pointerFollower.js.map +1 -0
- package/dist/tools/builtin/slice/useSliceTool.js +72 -82
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +22 -16
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +9 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/tools/builtin/weight/useWeightTool.js +77 -0
- package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
- package/dist/tools/builtin/weight/weightActions.js +112 -0
- package/dist/tools/builtin/weight/weightActions.js.map +1 -0
- package/dist/tools/builtin/weight/weightOverlay.js +61 -0
- package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
- package/dist/tools/overlayBinding.js.map +1 -1
- package/dist/tools/useKeybindings.js +12 -22
- package/dist/tools/useKeybindings.js.map +1 -1
- package/dist/{types-A37hYkeR.d.ts → types-CIKDwlsP.d.ts} +113 -169
- package/dist/util/color.js +3 -3
- package/dist/util/color.js.map +1 -1
- package/dist/util/paint.js +1 -1
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -21
- package/dist/animation/colorHelpers.js +0 -135
- package/dist/animation/colorHelpers.js.map +0 -1
- package/dist/animation/colorRegistry.js +0 -37
- package/dist/animation/colorRegistry.js.map +0 -1
- package/dist/animation/engine/axes.js +0 -36
- package/dist/animation/engine/axes.js.map +0 -1
- package/dist/animation/engine/codec.js +0 -170
- package/dist/animation/engine/codec.js.map +0 -1
- package/dist/animation/engine/integrator.js +0 -12
- package/dist/animation/engine/integrator.js.map +0 -1
- package/dist/animation/loop.js +0 -62
- package/dist/animation/loop.js.map +0 -1
- package/dist/animation/observe.js +0 -23
- package/dist/animation/observe.js.map +0 -1
- package/dist/animation/rig/blendPoses.js +0 -43
- package/dist/animation/rig/blendPoses.js.map +0 -1
- package/dist/animation/rig/mirrorPose.js +0 -19
- package/dist/animation/rig/mirrorPose.js.map +0 -1
- package/dist/animation/rig/resolveSkeleton.js +0 -33
- package/dist/animation/rig/resolveSkeleton.js.map +0 -1
- package/dist/animation/rig/solveIk.js +0 -103
- package/dist/animation/rig/solveIk.js.map +0 -1
- package/dist/animation/rig/types.js +0 -12
- package/dist/animation/rig/types.js.map +0 -1
- package/dist/animation/slew.js +0 -27
- package/dist/animation/slew.js.map +0 -1
- package/dist/animation/stagger.js +0 -138
- package/dist/animation/stagger.js.map +0 -1
- package/dist/animation/timeline/booking.js +0 -106
- package/dist/animation/timeline/booking.js.map +0 -1
- package/dist/animation/timeline/createTimeline.js +0 -116
- package/dist/animation/timeline/createTimeline.js.map +0 -1
- package/dist/animation/timeline/sampleTrack.js +0 -71
- package/dist/animation/timeline/sampleTrack.js.map +0 -1
- package/dist/animation/useAnimator.js +0 -378
- package/dist/animation/useAnimator.js.map +0 -1
- package/dist/builtins-C-VgUlWI.d.ts +0 -4514
- package/dist/canvas/MinimapCanvas.js +0 -139
- package/dist/canvas/MinimapCanvas.js.map +0 -1
- package/dist/canvas/deps/poseComposition.js +0 -11
- package/dist/canvas/deps/poseComposition.js.map +0 -1
- package/dist/canvas/minimapMath.js +0 -80
- package/dist/canvas/minimapMath.js.map +0 -1
- package/dist/canvas/toolPreview.js +0 -39
- package/dist/canvas/toolPreview.js.map +0 -1
- package/dist/core/adapters/arrayAdapter.js +0 -85
- package/dist/core/adapters/arrayAdapter.js.map +0 -1
- package/dist/core/adapters/useArrayAdapter.js +0 -13
- package/dist/core/adapters/useArrayAdapter.js.map +0 -1
- package/dist/core/fillInPoseFrame.js +0 -102
- package/dist/core/fillInPoseFrame.js.map +0 -1
- package/dist/core/geometry/poseRotation.js +0 -58
- package/dist/core/geometry/poseRotation.js.map +0 -1
- package/dist/core/gradient.js +0 -136
- package/dist/core/gradient.js.map +0 -1
- package/dist/core/isPlainObject.js.map +0 -1
- package/dist/core/markerInset.js +0 -24
- package/dist/core/markerInset.js.map +0 -1
- package/dist/core/mixed.js +0 -6
- package/dist/core/mixed.js.map +0 -1
- package/dist/core/paintKinds.js +0 -156
- package/dist/core/paintKinds.js.map +0 -1
- package/dist/core/strokeMarkerShapes.js +0 -139
- package/dist/core/strokeMarkerShapes.js.map +0 -1
- package/dist/core/strokeMarkers.js +0 -28
- package/dist/core/strokeMarkers.js.map +0 -1
- package/dist/core/viewport/meanScale.js +0 -8
- package/dist/core/viewport/meanScale.js.map +0 -1
- package/dist/core/viewport/pxExtent.js +0 -42
- package/dist/core/viewport/pxExtent.js.map +0 -1
- package/dist/debug/flag.js.map +0 -1
- package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
- package/dist/features/focus/gateLayer.js +0 -14
- package/dist/features/focus/gateLayer.js.map +0 -1
- package/dist/features/focus/useCanvasFocus.js +0 -29
- package/dist/features/focus/useCanvasFocus.js.map +0 -1
- package/dist/features/groups/children.js.map +0 -1
- package/dist/features/groups/composePose.js.map +0 -1
- package/dist/features/groups/nestedHit.js.map +0 -1
- package/dist/features/groups/unionOfChildren.js.map +0 -1
- package/dist/features/images/imageCache.js +0 -94
- package/dist/features/images/imageCache.js.map +0 -1
- package/dist/features/ingestion/index.js +0 -8
- package/dist/features/meshPaint/bake.js +0 -79
- package/dist/features/meshPaint/bake.js.map +0 -1
- package/dist/features/meshPaint/bakeCache.js +0 -59
- package/dist/features/meshPaint/bakeCache.js.map +0 -1
- package/dist/features/meshPaint/handles.js +0 -86
- package/dist/features/meshPaint/handles.js.map +0 -1
- package/dist/features/meshPaint/lazyKind.js.map +0 -1
- package/dist/features/meshPaint/meshPaint.js +0 -236
- package/dist/features/meshPaint/meshPaint.js.map +0 -1
- package/dist/features/meshPaint/meshShader.js +0 -6
- package/dist/features/meshPaint/meshShader.js.map +0 -1
- package/dist/features/meshPaint/register.js +0 -7
- package/dist/features/meshPaint/register.js.map +0 -1
- package/dist/features/meshPaint/surface.js +0 -110
- package/dist/features/meshPaint/surface.js.map +0 -1
- package/dist/features/minimap/actions.js +0 -53
- package/dist/features/minimap/actions.js.map +0 -1
- package/dist/features/minimap/createMinimapContribution.js +0 -96
- package/dist/features/minimap/createMinimapContribution.js.map +0 -1
- package/dist/features/minimap/layers.js +0 -103
- package/dist/features/minimap/layers.js.map +0 -1
- package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
- package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
- package/dist/features/parallax/createParallaxLayer.js +0 -26
- package/dist/features/parallax/createParallaxLayer.js.map +0 -1
- package/dist/features/parallax/createParallaxPlane.js +0 -26
- package/dist/features/parallax/createParallaxPlane.js.map +0 -1
- package/dist/features/paths/anchorEdits.js +0 -156
- package/dist/features/paths/anchorEdits.js.map +0 -1
- package/dist/features/paths/anchors.js +0 -154
- package/dist/features/paths/anchors.js.map +0 -1
- package/dist/features/paths/booleans.js +0 -2
- package/dist/features/paths/markerCommands.js +0 -148
- package/dist/features/paths/markerCommands.js.map +0 -1
- package/dist/features/paths/markerSites.js +0 -59
- package/dist/features/paths/markerSites.js.map +0 -1
- package/dist/features/paths/markers.js +0 -95
- package/dist/features/paths/markers.js.map +0 -1
- package/dist/features/paths/nearestAnchor.js +0 -36
- package/dist/features/paths/nearestAnchor.js.map +0 -1
- package/dist/features/paths/pathInWorld.js +0 -41
- package/dist/features/paths/pathInWorld.js.map +0 -1
- package/dist/features/paths/poseDescriptor.js +0 -39
- package/dist/features/paths/poseDescriptor.js.map +0 -1
- package/dist/features/paths/tessellate/dash.js +0 -52
- package/dist/features/paths/tessellate/dash.js.map +0 -1
- package/dist/features/paths/tessellate/insets.js +0 -32
- package/dist/features/paths/tessellate/insets.js.map +0 -1
- package/dist/features/paths/tessellate/metric.js +0 -72
- package/dist/features/paths/tessellate/metric.js.map +0 -1
- package/dist/features/paths/tessellate/stroke.js +0 -170
- package/dist/features/paths/tessellate/stroke.js.map +0 -1
- package/dist/features/paths/tessellate/vertexWidths.js +0 -32
- package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
- package/dist/features/patterns/index.js +0 -23
- package/dist/features/patterns/index.js.map +0 -1
- package/dist/features/patterns/patterns-builtin.js +0 -38
- package/dist/features/patterns/patterns-builtin.js.map +0 -1
- package/dist/features/patterns/resolveSpec.js +0 -57
- package/dist/features/patterns/resolveSpec.js.map +0 -1
- package/dist/features/patterns/tileGeometry.js +0 -158
- package/dist/features/patterns/tileGeometry.js.map +0 -1
- package/dist/features/pointer/PointerContext.js +0 -45
- package/dist/features/pointer/PointerContext.js.map +0 -1
- package/dist/features/selection/SelectionContext.js +0 -46
- package/dist/features/selection/SelectionContext.js.map +0 -1
- package/dist/features/simulation/createSimulation.js +0 -61
- package/dist/features/simulation/createSimulation.js.map +0 -1
- package/dist/features/simulation/types.js +0 -6
- package/dist/features/simulation/types.js.map +0 -1
- package/dist/features/simulation/useSimulation.js +0 -74
- package/dist/features/simulation/useSimulation.js.map +0 -1
- package/dist/features/text/domRuns.js +0 -258
- package/dist/features/text/domRuns.js.map +0 -1
- package/dist/features/text/fitTextPose.js +0 -38
- package/dist/features/text/fitTextPose.js.map +0 -1
- package/dist/features/text/hitTest.js +0 -45
- package/dist/features/text/hitTest.js.map +0 -1
- package/dist/features/text/renderLabel.js +0 -14
- package/dist/features/text/renderLabel.js.map +0 -1
- package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
- package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
- package/dist/features/text/runs/flagRange.js +0 -53
- package/dist/features/text/runs/flagRange.js.map +0 -1
- package/dist/features/text/runs/rangeStyle.js +0 -135
- package/dist/features/text/runs/rangeStyle.js.map +0 -1
- package/dist/features/text/textCommand.js +0 -59
- package/dist/features/text/textCommand.js.map +0 -1
- package/dist/features/text/textToPath.js +0 -181
- package/dist/features/text/textToPath.js.map +0 -1
- package/dist/features/text/useTextEdit.js +0 -467
- package/dist/features/text/useTextEdit.js.map +0 -1
- package/dist/features/tiling/createTiledLayer.js +0 -63
- package/dist/features/tiling/createTiledLayer.js.map +0 -1
- package/dist/features/tiling/tiledProject.js +0 -14
- package/dist/features/tiling/tiledProject.js.map +0 -1
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
- package/dist/interactions/actions/defaults/align.js.map +0 -1
- package/dist/interactions/actions/defaults/booleans.js +0 -52
- package/dist/interactions/actions/defaults/booleans.js.map +0 -1
- package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
- package/dist/interactions/actions/defaults/clone.js +0 -107
- package/dist/interactions/actions/defaults/clone.js.map +0 -1
- package/dist/interactions/actions/defaults/createOutlines.js +0 -47
- package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
- package/dist/interactions/actions/defaults/distribute.js +0 -66
- package/dist/interactions/actions/defaults/distribute.js.map +0 -1
- package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
- package/dist/interactions/actions/defaults/flip.js +0 -119
- package/dist/interactions/actions/defaults/flip.js.map +0 -1
- package/dist/interactions/actions/defaults/freshNodeId.js +0 -10
- package/dist/interactions/actions/defaults/freshNodeId.js.map +0 -1
- package/dist/interactions/actions/defaults/insert.js +0 -288
- package/dist/interactions/actions/defaults/insert.js.map +0 -1
- package/dist/interactions/actions/defaults/lassoSelect.js +0 -156
- package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
- package/dist/interactions/actions/defaults/move.js +0 -760
- package/dist/interactions/actions/defaults/move.js.map +0 -1
- package/dist/interactions/actions/defaults/resize.js +0 -335
- package/dist/interactions/actions/defaults/resize.js.map +0 -1
- package/dist/interactions/actions/defaults/rotate.js +0 -184
- package/dist/interactions/actions/defaults/rotate.js.map +0 -1
- package/dist/interactions/actions/previewOverrides.js +0 -25
- package/dist/interactions/actions/previewOverrides.js.map +0 -1
- package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
- package/dist/math-Drrw4ewZ.d.ts +0 -160
- package/dist/registerProgram-BMZRDgrh.d.ts +0 -197
- package/dist/renderer/DrawCommand.js +0 -6
- package/dist/renderer/DrawCommand.js.map +0 -1
- package/dist/renderer/WeaselRenderer.js +0 -331
- package/dist/renderer/WeaselRenderer.js.map +0 -1
- package/dist/renderer/batchClip.js +0 -46
- package/dist/renderer/batchClip.js.map +0 -1
- package/dist/renderer/cache/GLImageCache.js +0 -64
- package/dist/renderer/cache/GLImageCache.js.map +0 -1
- package/dist/renderer/cache/GLMeshCache.js +0 -102
- package/dist/renderer/cache/GLMeshCache.js.map +0 -1
- package/dist/renderer/cache/GLTextureCache.js +0 -51
- package/dist/renderer/cache/GLTextureCache.js.map +0 -1
- package/dist/renderer/cache/GradientRampAtlas.js +0 -82
- package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
- package/dist/renderer/cache/cache.js +0 -13
- package/dist/renderer/cache/cache.js.map +0 -1
- package/dist/renderer/cache/markerCommandCache.js +0 -63
- package/dist/renderer/cache/markerCommandCache.js.map +0 -1
- package/dist/renderer/cache/outlineMeshCache.js +0 -15
- package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
- package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
- package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
- package/dist/renderer/cache/strokeMeshCache.js +0 -55
- package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
- package/dist/renderer/cullDrawCommands.js +0 -90
- package/dist/renderer/cullDrawCommands.js.map +0 -1
- package/dist/renderer/draw.js +0 -1135
- package/dist/renderer/draw.js.map +0 -1
- package/dist/renderer/drawBatch.js +0 -198
- package/dist/renderer/drawBatch.js.map +0 -1
- package/dist/renderer/effects/EffectTargets.js +0 -45
- package/dist/renderer/effects/EffectTargets.js.map +0 -1
- package/dist/renderer/effects/builtins.js +0 -31
- package/dist/renderer/effects/builtins.js.map +0 -1
- package/dist/renderer/effects/composite.js +0 -9
- package/dist/renderer/effects/composite.js.map +0 -1
- package/dist/renderer/effects/effectPrelude.js +0 -10
- package/dist/renderer/effects/effectPrelude.js.map +0 -1
- package/dist/renderer/effects/types.js +0 -10
- package/dist/renderer/effects/types.js.map +0 -1
- package/dist/renderer/glyphOutlineMesh.js +0 -67
- package/dist/renderer/glyphOutlineMesh.js.map +0 -1
- package/dist/renderer/index.js +0 -19
- package/dist/renderer/math/color.js +0 -341
- package/dist/renderer/math/color.js.map +0 -1
- package/dist/renderer/math/mat3.js +0 -76
- package/dist/renderer/math/mat3.js.map +0 -1
- package/dist/renderer/math/patternSpace.js +0 -22
- package/dist/renderer/math/patternSpace.js.map +0 -1
- package/dist/renderer/math/viewToMat3.js +0 -19
- package/dist/renderer/math/viewToMat3.js.map +0 -1
- package/dist/renderer/paintResources.js +0 -18
- package/dist/renderer/paintResources.js.map +0 -1
- package/dist/renderer/paintScratch.js +0 -37
- package/dist/renderer/paintScratch.js.map +0 -1
- package/dist/renderer/shaders/ShaderProgram.js +0 -74
- package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
- package/dist/renderer/shaders/batchFill.js +0 -119
- package/dist/renderer/shaders/batchFill.js.map +0 -1
- package/dist/renderer/shaders/customPrelude.js +0 -34
- package/dist/renderer/shaders/customPrelude.js.map +0 -1
- package/dist/renderer/shaders/extractUniformNames.js +0 -184
- package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
- package/dist/renderer/shaders/glyphPaint.js +0 -61
- package/dist/renderer/shaders/glyphPaint.js.map +0 -1
- package/dist/renderer/shaders/gradFill.js +0 -30
- package/dist/renderer/shaders/gradFill.js.map +0 -1
- package/dist/renderer/shaders/imageFill.js +0 -14
- package/dist/renderer/shaders/imageFill.js.map +0 -1
- package/dist/renderer/shaders/pathFill.js +0 -13
- package/dist/renderer/shaders/pathFill.js.map +0 -1
- package/dist/renderer/shaders/patternFill.js +0 -24
- package/dist/renderer/shaders/patternFill.js.map +0 -1
- package/dist/renderer/shaders/registerProgram.js +0 -18
- package/dist/renderer/shaders/registerProgram.js.map +0 -1
- package/dist/renderer/spriteSheet.js +0 -14
- package/dist/renderer/spriteSheet.js.map +0 -1
- package/dist/renderer/state/GroupState.js +0 -77
- package/dist/renderer/state/GroupState.js.map +0 -1
- package/dist/renderer/strokeLengths.js +0 -50
- package/dist/renderer/strokeLengths.js.map +0 -1
- package/dist/renderer/syntheticItalic.js +0 -6
- package/dist/renderer/syntheticItalic.js.map +0 -1
- package/dist/renderer/textures/registerTexture.js +0 -14
- package/dist/renderer/textures/registerTexture.js.map +0 -1
- package/dist/scheduling/useVisibleRaf.js +0 -69
- package/dist/scheduling/useVisibleRaf.js.map +0 -1
- package/dist/test-seams-CuIxe0xY.d.ts +0 -356
- package/dist/tools/prefs.js +0 -62
- package/dist/tools/prefs.js.map +0 -1
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { PATH_L as e, PATH_M as t, PATH_Z as n, rectToContour as r } from "@weasel-js/geom";
|
|
2
|
-
//#region src/features/paths/markers.ts
|
|
3
|
-
function i(r, i, a, o = 32) {
|
|
4
|
-
let s = new Uint8Array(o + 1), c = new Float32Array(o * 2);
|
|
5
|
-
s[0] = t, c[0] = r + a, c[1] = i;
|
|
6
|
-
for (let t = 1; t < o; t++) {
|
|
7
|
-
s[t] = e;
|
|
8
|
-
let n = t / o * Math.PI * 2;
|
|
9
|
-
c[t * 2] = r + a * Math.cos(n), c[t * 2 + 1] = i + a * Math.sin(n);
|
|
10
|
-
}
|
|
11
|
-
return s[o] = n, {
|
|
12
|
-
kind: "polygon",
|
|
13
|
-
commands: s,
|
|
14
|
-
coords: c,
|
|
15
|
-
fillRule: "nonzero"
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function a(r, i, a) {
|
|
19
|
-
let o = a / 2, s = r - o, c = i - o, l = r + o, u = i + o;
|
|
20
|
-
return {
|
|
21
|
-
kind: "polygon",
|
|
22
|
-
commands: new Uint8Array([
|
|
23
|
-
t,
|
|
24
|
-
e,
|
|
25
|
-
e,
|
|
26
|
-
e,
|
|
27
|
-
n
|
|
28
|
-
]),
|
|
29
|
-
coords: new Float32Array([
|
|
30
|
-
s,
|
|
31
|
-
c,
|
|
32
|
-
l,
|
|
33
|
-
c,
|
|
34
|
-
l,
|
|
35
|
-
u,
|
|
36
|
-
s,
|
|
37
|
-
u
|
|
38
|
-
]),
|
|
39
|
-
fillRule: "nonzero"
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function o(i, a, o, s) {
|
|
43
|
-
return {
|
|
44
|
-
kind: "polygon",
|
|
45
|
-
commands: new Uint8Array([
|
|
46
|
-
t,
|
|
47
|
-
e,
|
|
48
|
-
e,
|
|
49
|
-
e,
|
|
50
|
-
n
|
|
51
|
-
]),
|
|
52
|
-
coords: Float32Array.from(r(i, a, o, s)),
|
|
53
|
-
fillRule: "nonzero"
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function s(r, i, a, s, c, l = 8) {
|
|
57
|
-
let u = Math.max(0, Math.min(c, Math.min(a, s) / 2));
|
|
58
|
-
if (u === 0) return o(r, i, a, s);
|
|
59
|
-
let d = Math.PI / 2, f = [
|
|
60
|
-
[
|
|
61
|
-
r + u,
|
|
62
|
-
i + u,
|
|
63
|
-
Math.PI
|
|
64
|
-
],
|
|
65
|
-
[
|
|
66
|
-
r + a - u,
|
|
67
|
-
i + u,
|
|
68
|
-
-d
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
r + a - u,
|
|
72
|
-
i + s - u,
|
|
73
|
-
0
|
|
74
|
-
],
|
|
75
|
-
[
|
|
76
|
-
r + u,
|
|
77
|
-
i + s - u,
|
|
78
|
-
d
|
|
79
|
-
]
|
|
80
|
-
], p = l + 1, m = f.length * p, h = new Uint8Array(m + 1), g = new Float32Array(m * 2), _ = 0;
|
|
81
|
-
for (let [n, r, i] of f) for (let a = 0; a <= l; a++) {
|
|
82
|
-
let o = i + a / l * d;
|
|
83
|
-
h[_] = _ === 0 ? t : e, g[_ * 2] = n + u * Math.cos(o), g[_ * 2 + 1] = r + u * Math.sin(o), _++;
|
|
84
|
-
}
|
|
85
|
-
return h[m] = n, {
|
|
86
|
-
kind: "polygon",
|
|
87
|
-
commands: h,
|
|
88
|
-
coords: g,
|
|
89
|
-
fillRule: "nonzero"
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
export { i as circlePath, o as rectMarkerPath, s as roundRectPath, a as squarePath };
|
|
94
|
-
|
|
95
|
-
//# sourceMappingURL=markers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markers.js","names":["circlePath","cmds","segments","coords","PATH_M","cx","r","cy","i","PATH_L","theta","PATH_Z","squarePath","half","size","x0","y0","x1","y1","rectMarkerPath","rectToContour","x","y","width","height","roundRectPath","radius","HALF_PI","corners","perCorner","cornerSamples","count","start","s"],"sources":["../../../src/features/paths/markers.ts"],"sourcesContent":["/**\n * Ergonomic builders for tiny shape paths used by chrome / overlays / markers.\n *\n * These don't expand the `DrawCommand` union — they all return `PolygonPath`,\n * which `PathDrawCommand.path` already accepts. The wins are:\n * - One place owns the math (`circlePath`'s segment loop, `squarePath`'s\n * corner unrolling), so consumers don't reinvent it.\n * - Default segment counts can be tuned in one place if \"circles look\n * facety\" feedback ever surfaces.\n *\n * Not appropriate for *user-drawn* shapes (those have a pose and live in the\n * scene). Use these for selection chrome, anchor markers, rubber-band rects,\n * and similar transient/decorative geometry.\n */\n\nimport { PATH_L, PATH_M, PATH_Z, type PolygonPath, rectToContour } from '@weasel-js/geom';\n\n/**\n * N-segment polygon approximation of a circle. Default 32 segments → max\n * radial deviation of ≈0.005·r (≈0.05 px at r=10). Bump higher for large\n * filled circles where the facets become visible; the default is fine for\n * the handle-dot / anchor-dot scale we use everywhere.\n */\nexport function circlePath(cx: number, cy: number, r: number, segments = 32): PolygonPath {\n const cmds = new Uint8Array(segments + 1);\n const coords = new Float32Array(segments * 2);\n cmds[0] = PATH_M;\n coords[0] = cx + r;\n coords[1] = cy;\n for (let i = 1; i < segments; i++) {\n cmds[i] = PATH_L;\n const theta = (i / segments) * Math.PI * 2;\n coords[i * 2] = cx + r * Math.cos(theta);\n coords[i * 2 + 1] = cy + r * Math.sin(theta);\n }\n cmds[segments] = PATH_Z;\n return { kind: 'polygon', commands: cmds, coords, fillRule: 'nonzero' };\n}\n\n/** Axis-aligned square centred at (cx, cy) with side length `size`. */\nexport function squarePath(cx: number, cy: number, size: number): PolygonPath {\n const half = size / 2;\n const x0 = cx - half, y0 = cy - half;\n const x1 = cx + half, y1 = cy + half;\n return {\n kind: 'polygon',\n commands: new Uint8Array([PATH_M, PATH_L, PATH_L, PATH_L, PATH_Z]),\n coords: new Float32Array([x0, y0, x1, y0, x1, y1, x0, y1]),\n fillRule: 'nonzero',\n };\n}\n\n/** Axis-aligned rectangle. Top-left at (x, y), width/height as given. */\nexport function rectMarkerPath(x: number, y: number, width: number, height: number): PolygonPath {\n return {\n kind: 'polygon',\n commands: new Uint8Array([PATH_M, PATH_L, PATH_L, PATH_L, PATH_Z]),\n coords: Float32Array.from(rectToContour(x, y, width, height)),\n fillRule: 'nonzero',\n };\n}\n\n/**\n * Axis-aligned rounded rectangle. Top-left at (x, y); `r` is clamped to half\n * the shorter side. Each corner is `cornerSamples` line segments, matching\n * `circlePath`'s polygonal approximation — the default 8 gives the same\n * angular resolution as `circlePath`'s 32.\n */\nexport function roundRectPath(\n x: number,\n y: number,\n width: number,\n height: number,\n r: number,\n cornerSamples = 8,\n): PolygonPath {\n const radius = Math.max(0, Math.min(r, Math.min(width, height) / 2));\n if (radius === 0) return rectMarkerPath(x, y, width, height);\n\n const HALF_PI = Math.PI / 2;\n // Corner centers paired with the arc's start angle, walked clockwise in\n // screen space from the top-left.\n const corners: Array<[number, number, number]> = [\n [x + radius, y + radius, Math.PI],\n [x + width - radius, y + radius, -HALF_PI],\n [x + width - radius, y + height - radius, 0],\n [x + radius, y + height - radius, HALF_PI],\n ];\n\n const perCorner = cornerSamples + 1;\n const count = corners.length * perCorner;\n const cmds = new Uint8Array(count + 1);\n const coords = new Float32Array(count * 2);\n let i = 0;\n for (const [cx, cy, start] of corners) {\n for (let s = 0; s <= cornerSamples; s++) {\n const theta = start + (s / cornerSamples) * HALF_PI;\n cmds[i] = i === 0 ? PATH_M : PATH_L;\n coords[i * 2] = cx + radius * Math.cos(theta);\n coords[i * 2 + 1] = cy + radius * Math.sin(theta);\n i++;\n }\n }\n cmds[count] = PATH_Z;\n return { kind: 'polygon', commands: cmds, coords, fillRule: 'nonzero' };\n}\n"],"mappings":";;AAuBA,SAAgBA,EAAW,GAAY,GAAY,GAAW,IAAW,IAAiB;CACxF,IAAMC,IAAO,IAAI,WAAWC,IAAW,CAAC,GAClCC,IAAS,IAAI,aAAaD,IAAW,CAAC;CAG5C,AAFA,EAAK,KAAKE,GACV,EAAO,KAAKC,IAAKC,GACjB,EAAO,KAAKC;CACZ,KAAK,IAAIC,IAAI,GAAGA,IAAIN,GAAU,KAAK;EACjC,EAAKM,KAAKC;EACV,IAAMC,IAASF,IAAIN,IAAY,KAAK,KAAK;EAEzC,AADA,EAAOM,IAAI,KAAKH,IAAKC,IAAI,KAAK,IAAII,CAAK,GACvC,EAAOF,IAAI,IAAI,KAAKD,IAAKD,IAAI,KAAK,IAAII,CAAK;CAC7C;CAEA,OADA,EAAKR,KAAYS,GACV;EAAE,MAAM;EAAW,UAAUV;EAAM;EAAQ,UAAU;CAAU;AACxE;AAGA,SAAgBW,EAAW,GAAY,GAAY,GAA2B;CAC5E,IAAMC,IAAOC,IAAO,GACdC,IAAKV,IAAKQ,GAAMG,IAAKT,IAAKM,GAC1BI,IAAKZ,IAAKQ,GAAMK,IAAKX,IAAKM;CAChC,OAAO;EACL,MAAM;EACN,UAAU,IAAI,WAAW;GAACT;GAAQK;GAAQA;GAAQA;GAAQE;EAAM,CAAC;EACjE,QAAQ,IAAI,aAAa;GAACI;GAAIC;GAAIC;GAAID;GAAIC;GAAIC;GAAIH;GAAIG;EAAE,CAAC;EACzD,UAAU;CACZ;AACF;AAGA,SAAgBC,EAAe,GAAW,GAAW,GAAe,GAA6B;CAC/F,OAAO;EACL,MAAM;EACN,UAAU,IAAI,WAAW;GAACf;GAAQK;GAAQA;GAAQA;GAAQE;EAAM,CAAC;EACjE,QAAQ,aAAa,KAAKS,EAAcC,GAAGC,GAAGC,GAAOC,CAAM,CAAC;EAC5D,UAAU;CACZ;AACF;AAQA,SAAgBC,EACd,GACA,GACA,GACA,GACA,GACA,IAAgB,GACH;CACb,IAAMC,IAAS,KAAK,IAAI,GAAG,KAAK,IAAIpB,GAAG,KAAK,IAAIiB,GAAOC,CAAM,IAAI,CAAC,CAAC;CACnE,IAAIE,MAAW,GAAG,OAAOP,EAAeE,GAAGC,GAAGC,GAAOC,CAAM;CAE3D,IAAMG,IAAU,KAAK,KAAK,GAGpBC,IAA2C;EAC/C;GAACP,IAAIK;GAAQJ,IAAII;GAAQ,KAAK;EAAE;EAChC;GAACL,IAAIE,IAAQG;GAAQJ,IAAII;GAAQ,CAACC;EAAO;EACzC;GAACN,IAAIE,IAAQG;GAAQJ,IAAIE,IAASE;GAAQ;EAAC;EAC3C;GAACL,IAAIK;GAAQJ,IAAIE,IAASE;GAAQC;EAAO;CAC3C,GAEME,IAAYC,IAAgB,GAC5BC,IAAQH,EAAQ,SAASC,GACzB5B,IAAO,IAAI,WAAW8B,IAAQ,CAAC,GAC/B5B,IAAS,IAAI,aAAa4B,IAAQ,CAAC,GACrCvB,IAAI;CACR,KAAK,IAAM,CAACH,GAAIE,GAAIyB,MAAUJ,GAC5B,KAAK,IAAIK,IAAI,GAAGA,KAAKH,GAAe,KAAK;EACvC,IAAMpB,IAAQsB,IAASC,IAAIH,IAAiBH;EAI5C,AAHA,EAAKnB,KAAKA,MAAM,IAAIJ,IAASK,GAC7B,EAAOD,IAAI,KAAKH,IAAKqB,IAAS,KAAK,IAAIhB,CAAK,GAC5C,EAAOF,IAAI,IAAI,KAAKD,IAAKmB,IAAS,KAAK,IAAIhB,CAAK,GAChD;CACF;CAGF,OADA,EAAKqB,KAASpB,GACP;EAAE,MAAM;EAAW,UAAUV;EAAM;EAAQ,UAAU;CAAU;AACxE"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { scaleDelta as e } from "../../core/viewport/pxExtent.js";
|
|
2
|
-
import { pathToAnchors as t } from "./anchors.js";
|
|
3
|
-
//#region src/features/paths/nearestAnchor.ts
|
|
4
|
-
function n(n, r, i, a, o) {
|
|
5
|
-
let s = null, c = i * i;
|
|
6
|
-
for (let { id: i, path: l } of n) {
|
|
7
|
-
let { anchors: n, closed: u } = t(l);
|
|
8
|
-
for (let t = 0; t < n.length; t++) {
|
|
9
|
-
let l = n[t];
|
|
10
|
-
for (let n = 0; n < l.length; n++) {
|
|
11
|
-
let d = l[n], f = e(d.x - r.x, d.y - r.y, a), p = f.x * f.x + f.y * f.y;
|
|
12
|
-
if (p > c || s !== null && p === c) continue;
|
|
13
|
-
let m = u[t] ? null : n === l.length - 1 ? "last" : n === 0 ? "first" : null, h = {
|
|
14
|
-
id: i,
|
|
15
|
-
sub: t,
|
|
16
|
-
idx: n,
|
|
17
|
-
x: d.x,
|
|
18
|
-
y: d.y,
|
|
19
|
-
end: m
|
|
20
|
-
};
|
|
21
|
-
(!o || o(h)) && (s = h, c = p);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return s;
|
|
26
|
-
}
|
|
27
|
-
function r(e) {
|
|
28
|
-
return e.map((e) => {
|
|
29
|
-
let { inHandle: t, outHandle: n, ...r } = e, i = { ...r };
|
|
30
|
-
return n && (i.inHandle = { ...n }), t && (i.outHandle = { ...t }), i;
|
|
31
|
-
}).reverse();
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { n as nearestPathAnchor, r as reverseAnchors };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=nearestAnchor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nearestAnchor.js","names":["nearestPathAnchor","best","bestD2","px","paths","pathToAnchors","path","sub","anchors","list","idx","a","s","scaleDelta","point","scale","d2","end","closed","hit","accept","reverseAnchors","rest","r","outHandle","inHandle"],"sources":["../../../src/features/paths/nearestAnchor.ts"],"sourcesContent":["/**\n * Anchor lookup across several paths, measured on screen: which existing\n * anchor is nearest a point, and whether it ends an open subpath. Feeds the\n * pen's anchor snapping and its pick-up of an open path's endpoint.\n */\n\nimport { scaleDelta, type Scale2 } from 'core/viewport/pxExtent';\nimport { pathToAnchors, type PenAnchor } from './anchors';\nimport type { PolygonPath } from '@weasel-js/geom';\n\n/** An existing anchor found near a point. */\nexport interface PathAnchorHit {\n /** The id the path was supplied under. */\n id: string;\n /** Subpath index, then anchor index within that subpath. */\n sub: number;\n idx: number;\n x: number;\n y: number;\n /** Which end of an open subpath this anchor is, or null when it is an\n * interior anchor or its subpath is closed. A lone anchor reads `'last'`. */\n end: 'first' | 'last' | null;\n}\n\n/**\n * The anchor nearest `point` within a screen-space circle of radius `px`,\n * across every subpath of every path in `paths`. Paths and `point` share one\n * world frame; `scale` is the view's, so the radius stays round under\n * non-uniform zoom. `accept` narrows the candidates (endpoints only, say).\n * Ties go to the earlier path, so pass paths front-to-back.\n */\nexport function nearestPathAnchor(\n paths: Iterable<{ id: string; path: PolygonPath }>,\n point: { x: number; y: number },\n px: number,\n scale: Scale2,\n accept?: (hit: PathAnchorHit) => boolean,\n): PathAnchorHit | null {\n let best: PathAnchorHit | null = null;\n let bestD2 = px * px;\n for (const { id, path } of paths) {\n const { anchors, closed } = pathToAnchors(path);\n for (let sub = 0; sub < anchors.length; sub++) {\n const list = anchors[sub];\n for (let idx = 0; idx < list.length; idx++) {\n const a = list[idx];\n const s = scaleDelta(a.x - point.x, a.y - point.y, scale);\n const d2 = s.x * s.x + s.y * s.y;\n if (d2 > bestD2 || (best !== null && d2 === bestD2)) continue;\n const end = closed[sub]\n ? null\n : idx === list.length - 1 ? 'last' : idx === 0 ? 'first' : null;\n const hit: PathAnchorHit = { id, sub, idx, x: a.x, y: a.y, end };\n if (accept && !accept(hit)) continue;\n best = hit;\n bestD2 = d2;\n }\n }\n }\n return best;\n}\n\n/** Reverse a subpath's direction without changing its shape: the anchor\n * order flips and each anchor's in and out handles trade places. */\nexport function reverseAnchors<A extends PenAnchor>(anchors: readonly A[]): A[] {\n return anchors.map((a) => {\n const { inHandle, outHandle, ...rest } = a;\n const r = { ...rest } as A;\n if (outHandle) r.inHandle = { ...outHandle };\n if (inHandle) r.outHandle = { ...inHandle };\n return r;\n }).reverse();\n}\n"],"mappings":";;;AA+BA,SAAgBA,EACd,GACA,GACA,GACA,GACA,GACsB;CACtB,IAAIC,IAA6B,MAC7BC,IAASC,IAAKA;CAClB,KAAK,IAAM,EAAE,OAAI,aAAUC,GAAO;EAChC,IAAM,EAAE,YAAS,cAAWC,EAAcC,CAAI;EAC9C,KAAK,IAAIC,IAAM,GAAGA,IAAMC,EAAQ,QAAQ,KAAO;GAC7C,IAAMC,IAAOD,EAAQD;GACrB,KAAK,IAAIG,IAAM,GAAGA,IAAMD,EAAK,QAAQ,KAAO;IAC1C,IAAME,IAAIF,EAAKC,IACTE,IAAIC,EAAWF,EAAE,IAAIG,EAAM,GAAGH,EAAE,IAAIG,EAAM,GAAGC,CAAK,GAClDC,IAAKJ,EAAE,IAAIA,EAAE,IAAIA,EAAE,IAAIA,EAAE;IAC/B,IAAII,IAAKd,KAAWD,MAAS,QAAQe,MAAOd,GAAS;IACrD,IAAMe,IAAMC,EAAOX,KACf,OACAG,MAAQD,EAAK,SAAS,IAAI,SAASC,MAAQ,IAAI,UAAU,MACvDS,IAAqB;KAAE;KAAI;KAAK;KAAK,GAAGR,EAAE;KAAG,GAAGA,EAAE;KAAG;IAAI;IAC/D,CAAI,MAAWS,EAAOD,CAAG,OACzB,IAAOA,GACP,IAASH;GACX;EACF;CACF;CACA,OAAOf;AACT;AAIA,SAAgBoB,EAAoC,GAA4B;CAC9E,OAAOb,EAAQ,KAAK,MAAM;EACxB,IAAM,EAAE,aAAU,cAAW,GAAGc,MAASX,GACnCY,IAAI,EAAE,GAAGD,EAAK;EAGpB,OAFIE,MAAW,EAAE,WAAW,EAAE,GAAGA,EAAU,IACvCC,MAAU,EAAE,YAAY,EAAE,GAAGA,EAAS,IACnCF;CACT,CAAC,CAAC,CAAC,QAAQ;AACb"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { poseRotationOf as e } from "../../core/geometry/poseRotation.js";
|
|
2
|
-
import { applyToPoint as t, boundsOfPath as n, boxToBox as r, rotateAboutPoint as i, transformPath as a, translatePath as o } from "@weasel-js/geom";
|
|
3
|
-
//#region src/features/paths/pathInWorld.ts
|
|
4
|
-
function s(e, t) {
|
|
5
|
-
if (e.kind === "rect") return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height ? e : {
|
|
6
|
-
kind: "rect",
|
|
7
|
-
x: t.x,
|
|
8
|
-
y: t.y,
|
|
9
|
-
width: t.width,
|
|
10
|
-
height: t.height
|
|
11
|
-
};
|
|
12
|
-
let i = n(e);
|
|
13
|
-
if (i.x === t.x && i.y === t.y && i.width === t.width && i.height === t.height) return e;
|
|
14
|
-
let o = r(i.x, i.y, i.width, i.height, t.x, t.y, t.width, t.height);
|
|
15
|
-
return a(e, o);
|
|
16
|
-
}
|
|
17
|
-
function c(t, n) {
|
|
18
|
-
let r = s(t, n), o = e(n);
|
|
19
|
-
return o ? a(r, i(o.cx, o.cy, o.rotation)) : r;
|
|
20
|
-
}
|
|
21
|
-
function l(r, s) {
|
|
22
|
-
let c = e(r), l = c ? a(s, i(c.cx, c.cy, -c.rotation)) : s, u = n(l), d = o(l, -u.x, -u.y), f = u.x, p = u.y;
|
|
23
|
-
if (c) {
|
|
24
|
-
let [e, n] = t(i(c.cx, c.cy, c.rotation), u.x + u.width / 2, u.y + u.height / 2);
|
|
25
|
-
f = e - u.width / 2, p = n - u.height / 2;
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
pose: {
|
|
29
|
-
...r,
|
|
30
|
-
x: f,
|
|
31
|
-
y: p,
|
|
32
|
-
width: u.width,
|
|
33
|
-
height: u.height
|
|
34
|
-
},
|
|
35
|
-
path: d
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
export { s as pathInPoseFrame, c as pathInWorld, l as worldEditToStorage };
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=pathInWorld.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pathInWorld.js","names":["pathInPoseFrame","path","pose","b","boundsOfPath","m","boxToBox","transformPath","pathInWorld","local","r","poseRotationOf","rotateAboutPoint","worldEditToStorage","unrotated","worldPath","aligned","translatePath","x","y","cx","cy","applyToPoint"],"sources":["../../../src/features/paths/pathInWorld.ts"],"sourcesContent":["/**\n * Project a leaf path from its source frame into world coordinates given a\n * `{x, y, width, height, rotation?}` pose. Two transforms compose, in this\n * order:\n *\n * 1. Translate so the path's source AABB origin lands at `pose.x, pose.y`.\n * 2. If `pose.rotation` is nonzero, rotate every coord about the unrotated\n * AABB center — i.e. `(pose.x + pose.width/2, pose.y + pose.height/2)`,\n * matching `SceneCanvas.rotateAroundAABBCenter` so the baked geometry\n * lines up with what the renderer draws.\n *\n * RectPaths can't carry rotation as-is (they're axis-aligned by definition);\n * a non-zero `pose.rotation` on a rect promotes the result to a polygon so\n * the four corners are baked into world coords. Callers that need to keep\n * the rect fast-path can pre-check `pose.rotation` themselves.\n *\n * Used by adapters that need true world geometry — most notably boolean ops,\n * where operating on the unrotated source path produces wrong shapes.\n */\n\nimport {\n applyToPoint,\n boxToBox,\n rotateAboutPoint,\n boundsOfPath,\n type Path,\n type PolygonPath,\n translatePath,\n transformPath,\n} from '@weasel-js/geom';\nimport { poseRotationOf } from 'core/geometry/poseRotation';\n\n/** Subset of pose fields this helper consumes. Matches the kit's auto-rotate\n * convention (`SceneCanvas.defaultDrawOne`): `x/y/width/height` define an\n * AABB whose unrotated center is the rotation pivot. */\nexport interface PathInWorldPose {\n x: number;\n y: number;\n width: number;\n height: number;\n rotation?: number;\n}\n\n/**\n * Project a stored path into the pose's **local frame** — translate (and, for\n * rects, rebase to the pose's `width`/`height`) so the path's AABB origin sits\n * at the pose origin. This is translate-only: it does NOT apply\n * `pose.rotation`. Callers that want the fully world-positioned (rotated) path\n * should use `pathInWorld`, which composes this with the rotation wrap.\n *\n * Rects rebase onto the pose's `width`/`height` because resize updates the pose,\n * not the stored `RectPath` — so the live size lives on the pose. Honoring it\n * here keeps this in lockstep with the renderer (`SceneCanvas` paints the rect\n * at `pose.width/height`); otherwise world-space consumers (slice, booleans,\n * release-compound) would operate on the stale pre-resize dimensions.\n *\n * Used by the local seams: the default painter (paint + silhouette), and as the\n * building block `pathInWorld`/`findShapeSilhouette` rotate on top of.\n */\nexport function pathInPoseFrame(path: Path, pose: PathInWorldPose): Path {\n if (path.kind === 'rect') {\n if (\n path.x === pose.x && path.y === pose.y\n && path.width === pose.width && path.height === pose.height\n ) return path;\n return { kind: 'rect', x: pose.x, y: pose.y, width: pose.width, height: pose.height };\n }\n // Polygon: rebase the path's own AABB into the pose box via a box→box affine.\n // Identity when the bounds already equal the pose box (geometry already tracks\n // the pose) — behavior-preserving there; for geometry-in-data nodes whose pose\n // box was resized independently, it scales the contents to fill the box,\n // fixing the anchor bug.\n const b = boundsOfPath(path);\n if (b.x === pose.x && b.y === pose.y && b.width === pose.width && b.height === pose.height) {\n return path;\n }\n const m = boxToBox(b.x, b.y, b.width, b.height, pose.x, pose.y, pose.width, pose.height);\n return transformPath(path, m);\n}\n\n/**\n * Bake `pose` into `path`'s coordinates so the returned path is positioned\n * in world space. Returns a fresh `Path` instance; never mutates inputs.\n */\nexport function pathInWorld(path: Path, pose: PathInWorldPose): Path {\n // Step 1: project into the pose's local frame (translate; rebase rect dims).\n // Shares `pathInPoseFrame` with the renderer so world geometry never diverges\n // from what's painted — notably for resized rects (pose dims, not path dims).\n const local = pathInPoseFrame(path, pose);\n\n // Step 2: apply the pose's rotation about its AABB center, if any. The ≈0\n // gate + AABB-center pivot come from `poseRotationOf` (the shared rotation\n // convention); the rotation itself composes on the kernel — `transformPath`\n // handles the rect->polygon promotion and bezier control-point rotation,\n // identically to the bespoke `rotatePathAround` it replaces.\n const r = poseRotationOf(pose);\n if (!r) return local;\n return transformPath(local, rotateAboutPoint(r.cx, r.cy, r.rotation)) as PolygonPath;\n}\n\n/**\n * Inverse of `pathInWorld` for a path in **world** space: the unrotated\n * stored path plus the pose that draws it there. Inverse-rotates about the\n * pose's AABB center, so the stored path is unrotated and the pose's\n * `rotation` is preserved, then fits the pose's AABB fields to the result.\n * The new box's center is placed where the old rotation carries it, since\n * the pivot moves with the box: `pathInWorld(result.path, result.pose)`\n * reproduces `worldPath` whether or not its bounds changed.\n *\n * Generic in the pose type so consumer-defined pose fields (including\n * `rotation`) survive the round-trip. Used by the anchor-edit commit, its\n * live preview, and the default slice dep.\n */\nexport function worldEditToStorage<P extends PathInWorldPose>(\n pose: P,\n worldPath: PolygonPath,\n): { pose: P; path: PolygonPath };\nexport function worldEditToStorage<P extends PathInWorldPose>(pose: P, worldPath: Path): { pose: P; path: Path };\nexport function worldEditToStorage<P extends PathInWorldPose>(\n pose: P,\n worldPath: Path,\n): { pose: P; path: Path } {\n const r = poseRotationOf(pose);\n // The exact inverse of `rotateAboutPoint(cx, cy, θ)` is the same pivot at\n // -θ — exact by construction, and never `null` the way `invert` can be.\n const unrotated = r ? transformPath(worldPath, rotateAboutPoint(r.cx, r.cy, -r.rotation)) : worldPath;\n const b = boundsOfPath(unrotated);\n const aligned = translatePath(unrotated, -b.x, -b.y);\n let x = b.x, y = b.y;\n if (r) {\n const [cx, cy] = applyToPoint(\n rotateAboutPoint(r.cx, r.cy, r.rotation), b.x + b.width / 2, b.y + b.height / 2,\n );\n x = cx - b.width / 2;\n y = cy - b.height / 2;\n }\n return {\n pose: { ...pose, x, y, width: b.width, height: b.height },\n path: aligned,\n };\n}\n"],"mappings":";;;AA2DA,SAAgBA,EAAgB,GAAY,GAA6B;CACvE,IAAIC,EAAK,SAAS,QAKhB,OAHEA,EAAK,MAAMC,EAAK,KAAKD,EAAK,MAAMC,EAAK,KAClCD,EAAK,UAAUC,EAAK,SAASD,EAAK,WAAWC,EAAK,SAC9CD,IACF;EAAE,MAAM;EAAQ,GAAGC,EAAK;EAAG,GAAGA,EAAK;EAAG,OAAOA,EAAK;EAAO,QAAQA,EAAK;CAAO;CAOtF,IAAMC,IAAIC,EAAaH,CAAI;CAC3B,IAAIE,EAAE,MAAMD,EAAK,KAAKC,EAAE,MAAMD,EAAK,KAAKC,EAAE,UAAUD,EAAK,SAASC,EAAE,WAAWD,EAAK,QAClF,OAAOD;CAET,IAAMI,IAAIC,EAASH,EAAE,GAAGA,EAAE,GAAGA,EAAE,OAAOA,EAAE,QAAQD,EAAK,GAAGA,EAAK,GAAGA,EAAK,OAAOA,EAAK,MAAM;CACvF,OAAOK,EAAcN,GAAMI,CAAC;AAC9B;AAMA,SAAgBG,EAAY,GAAY,GAA6B;CAInE,IAAMC,IAAQT,EAAgBC,GAAMC,CAAI,GAOlCQ,IAAIC,EAAeT,CAAI;CAE7B,OADKQ,IACEH,EAAcE,GAAOG,EAAiBF,EAAE,IAAIA,EAAE,IAAIA,EAAE,QAAQ,CAAC,IADrDD;AAEjB;AAoBA,SAAgBI,EACd,GACA,GACyB;CACzB,IAAMH,IAAIC,EAAeT,CAAI,GAGvBY,IAAYJ,IAAIH,EAAcQ,GAAWH,EAAiBF,EAAE,IAAIA,EAAE,IAAI,CAACA,EAAE,QAAQ,CAAC,IAAIK,GACtFZ,IAAIC,EAAaU,CAAS,GAC1BE,IAAUC,EAAcH,GAAW,CAACX,EAAE,GAAG,CAACA,EAAE,CAAC,GAC/Ce,IAAIf,EAAE,GAAGgB,IAAIhB,EAAE;CACnB,IAAIO,GAAG;EACL,IAAM,CAACU,GAAIC,KAAMC,EACfV,EAAiBF,EAAE,IAAIA,EAAE,IAAIA,EAAE,QAAQ,GAAGP,EAAE,IAAIA,EAAE,QAAQ,GAAGA,EAAE,IAAIA,EAAE,SAAS,CAChF;EAEA,AADA,IAAIiB,IAAKjB,EAAE,QAAQ,GACnB,IAAIkB,IAAKlB,EAAE,SAAS;CACtB;CACA,OAAO;EACL,MAAM;GAAE,GAAGD;GAAM;GAAG;GAAG,OAAOC,EAAE;GAAO,QAAQA,EAAE;EAAO;EACxD,MAAMa;CACR;AACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { boundsOfPath as e, boxToBox as t, transformPath as n, translatePath as r } from "@weasel-js/geom";
|
|
2
|
-
//#region src/features/paths/poseDescriptor.ts
|
|
3
|
-
var i = {
|
|
4
|
-
getBounds: (t) => e(t),
|
|
5
|
-
remapBounds: (e, r, i) => n(e, t(r.x, r.y, r.width, r.height, i.x, i.y, i.width, i.height)),
|
|
6
|
-
fromBounds: (e) => ({
|
|
7
|
-
kind: "rect",
|
|
8
|
-
x: e.x,
|
|
9
|
-
y: e.y,
|
|
10
|
-
width: e.width,
|
|
11
|
-
height: e.height
|
|
12
|
-
}),
|
|
13
|
-
translate: (e, t, n) => r(e, t, n),
|
|
14
|
-
lerp: (e, t, n) => {
|
|
15
|
-
if (e.kind === "rect" && t.kind === "rect") return {
|
|
16
|
-
kind: "rect",
|
|
17
|
-
x: e.x + (t.x - e.x) * n,
|
|
18
|
-
y: e.y + (t.y - e.y) * n,
|
|
19
|
-
width: e.width + (t.width - e.width) * n,
|
|
20
|
-
height: e.height + (t.height - e.height) * n
|
|
21
|
-
};
|
|
22
|
-
if (e.kind === "polygon" && t.kind === "polygon" && e.coords.length === t.coords.length) {
|
|
23
|
-
let r = new Float32Array(e.coords.length);
|
|
24
|
-
for (let i = 0; i < e.coords.length; i++) r[i] = e.coords[i] + (t.coords[i] - e.coords[i]) * n;
|
|
25
|
-
return {
|
|
26
|
-
kind: "polygon",
|
|
27
|
-
commands: e.commands,
|
|
28
|
-
coords: r,
|
|
29
|
-
fillRule: e.fillRule
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
throw Error("pathPoseDescriptor.lerp: incompatible path shapes");
|
|
33
|
-
},
|
|
34
|
-
supportsRotation: () => !1
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { i as pathPoseDescriptor };
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=poseDescriptor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"poseDescriptor.js","names":["pathPoseDescriptor","boundsOfPath","path","transformPath","boxToBox","src","dst","b","translatePath","dx","dy","a","t","next"],"sources":["../../../src/features/paths/poseDescriptor.ts"],"sourcesContent":["import {\n boxToBox,\n boundsOfPath,\n translatePath,\n transformPath,\n type Path,\n} from '@weasel-js/geom';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\n\n/**\n * `PoseDescriptor` for `Path` poses — wires `useResize` to operate\n * on `Path` directly. `getBounds` defers to the same `boundsOfPath` kernel\n * the rest of the kit uses.\n *\n * `remapBounds` mirrors `scalePathToBounds` but takes `src` explicitly: the\n * resize hook knows the group's origin AABB and uses it for every leaf,\n * instead of each leaf scaling against its own AABB (which would ignore\n * group context).\n */\nexport const pathPoseDescriptor: PoseDescriptor<Path> = {\n getBounds: (path) => boundsOfPath(path),\n remapBounds: (path, src, dst) => transformPath(\n path,\n boxToBox(src.x, src.y, src.width, src.height, dst.x, dst.y, dst.width, dst.height),\n ),\n fromBounds: (b) => ({ kind: 'rect', x: b.x, y: b.y, width: b.width, height: b.height }),\n translate: (path, dx, dy) => translatePath(path, dx, dy),\n lerp: (a, b, t) => {\n if (a.kind === 'rect' && b.kind === 'rect') {\n return {\n kind: 'rect',\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n width: a.width + (b.width - a.width) * t,\n height: a.height + (b.height - a.height) * t,\n };\n }\n if (a.kind === 'polygon' && b.kind === 'polygon' && a.coords.length === b.coords.length) {\n const next = new Float32Array(a.coords.length);\n for (let i = 0; i < a.coords.length; i++) {\n next[i] = a.coords[i] + (b.coords[i] - a.coords[i]) * t;\n }\n return { kind: 'polygon', commands: a.commands, coords: next, fillRule: a.fillRule };\n }\n throw new Error('pathPoseDescriptor.lerp: incompatible path shapes');\n },\n // Path poses carry no x/y/width/height/rotation fields — the kit's\n // `wrapWithPoseRotation` helper has nothing to bind a rotation to, and\n // `remapBounds` would drop a synthetic rotation field on every commit.\n // Returning false here hides the rotation affordance for Path consumers\n // so the rotate cursor doesn't appear without a working interaction.\n supportsRotation: () => false,\n};\n"],"mappings":";;AAmBA,IAAaA,IAA2C;CACtD,YAAY,MAASC,EAAaC,CAAI;CACtC,cAAc,GAAM,GAAK,MAAQC,EAC/BD,GACAE,EAASC,EAAI,GAAGA,EAAI,GAAGA,EAAI,OAAOA,EAAI,QAAQC,EAAI,GAAGA,EAAI,GAAGA,EAAI,OAAOA,EAAI,MAAM,CACnF;CACA,aAAa,OAAO;EAAE,MAAM;EAAQ,GAAGC,EAAE;EAAG,GAAGA,EAAE;EAAG,OAAOA,EAAE;EAAO,QAAQA,EAAE;CAAO;CACrF,YAAY,GAAM,GAAI,MAAOC,EAAcN,GAAMO,GAAIC,CAAE;CACvD,OAAO,GAAG,GAAG,MAAM;EACjB,IAAIC,EAAE,SAAS,UAAUJ,EAAE,SAAS,QAClC,OAAO;GACL,MAAM;GACN,GAAGI,EAAE,KAAKJ,EAAE,IAAII,EAAE,KAAKC;GACvB,GAAGD,EAAE,KAAKJ,EAAE,IAAII,EAAE,KAAKC;GACvB,OAAOD,EAAE,SAASJ,EAAE,QAAQI,EAAE,SAASC;GACvC,QAAQD,EAAE,UAAUJ,EAAE,SAASI,EAAE,UAAUC;EAC7C;EAEF,IAAID,EAAE,SAAS,aAAaJ,EAAE,SAAS,aAAaI,EAAE,OAAO,WAAWJ,EAAE,OAAO,QAAQ;GACvF,IAAMM,IAAO,IAAI,aAAaF,EAAE,OAAO,MAAM;GAC7C,KAAK,IAAI,IAAI,GAAG,IAAIA,EAAE,OAAO,QAAQ,KACnC,EAAK,KAAKA,EAAE,OAAO,MAAMJ,EAAE,OAAO,KAAKI,EAAE,OAAO,MAAMC;GAExD,OAAO;IAAE,MAAM;IAAW,UAAUD,EAAE;IAAU,QAAQE;IAAM,UAAUF,EAAE;GAAS;EACrF;EACA,MAAU,MAAM,mDAAmD;CACrE;CAMA,wBAAwB;AAC1B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//#region src/features/paths/tessellate/dash.ts
|
|
2
|
-
function e(e, n) {
|
|
3
|
-
let r = [], i = e.anchorA ?? new Uint32Array(e.points.length / 2), a = e.anchorB ?? new Uint32Array(e.points.length / 2), o = e.anchorT ?? new Float32Array(e.points.length / 2), s = 0, c = n[0], l = !0, u = l ? [e.points[0], e.points[1]] : null, d = l ? [i[0]] : null, f = l ? [a[0]] : null, p = l ? [o[0]] : null, m = () => {
|
|
4
|
-
u && u.length >= 4 && r.push({
|
|
5
|
-
points: u,
|
|
6
|
-
closed: !1,
|
|
7
|
-
anchorA: new Uint32Array(d),
|
|
8
|
-
anchorB: new Uint32Array(f),
|
|
9
|
-
anchorT: new Float32Array(p)
|
|
10
|
-
}), u = null, d = null, f = null, p = null, s = (s + 1) % n.length, c = n[s], l = !l;
|
|
11
|
-
}, h = e.points[0], g = e.points[1], _ = e.points.length / 2, v = e.closed ? _ : _ - 1;
|
|
12
|
-
for (let t = 0; t < v; t++) {
|
|
13
|
-
let n = (t + 1) % _, r = e.points[n * 2], s = e.points[n * 2 + 1], v = i[t], y = a[t], b = o[t], x = i[n], S = a[n], C = o[n], w = r - h, T = s - g, E = Math.hypot(w, T), D = w, O = T, k = E, A = 0;
|
|
14
|
-
for (; k > 1e-9;) if (k <= c) l && u && (u.push(r, s), d.push(x), f.push(S), p.push(C)), c -= k, h = r, g = s, A = E, k = 0, c <= 1e-9 && (m(), l && (u = [h, g], d = [x], f = [S], p = [C]));
|
|
15
|
-
else {
|
|
16
|
-
let e = c / k, t = h + D * e, n = g + O * e;
|
|
17
|
-
A += c;
|
|
18
|
-
let i = A / E, a, o, _;
|
|
19
|
-
v === x && y === S ? (a = v, o = y, _ = b + (C - b) * i) : i < .5 ? (a = v, o = y, _ = b) : (a = x, o = S, _ = C), l && u && (u.push(t, n), d.push(a), f.push(o), p.push(_)), h = t, g = n, D = r - h, O = s - g, k = Math.hypot(D, O), m(), l && (u = [h, g], d = [a], f = [o], p = [_]);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (u && u.length >= 4) {
|
|
23
|
-
let n = {
|
|
24
|
-
points: u,
|
|
25
|
-
closed: !1,
|
|
26
|
-
anchorA: new Uint32Array(d),
|
|
27
|
-
anchorB: new Uint32Array(f),
|
|
28
|
-
anchorT: new Float32Array(p)
|
|
29
|
-
}, i = u[u.length - 2], a = u[u.length - 1], o = (e, t) => Math.hypot(i - e, a - t) <= 1e-9;
|
|
30
|
-
e.closed && r.length > 0 && o(r[0].points[0], r[0].points[1]) ? r[0] = t(n, r[0]) : e.closed && r.length === 0 && o(u[0], u[1]) ? r.push({
|
|
31
|
-
points: u.slice(0, -2),
|
|
32
|
-
closed: !0,
|
|
33
|
-
anchorA: n.anchorA.slice(0, -1),
|
|
34
|
-
anchorB: n.anchorB.slice(0, -1),
|
|
35
|
-
anchorT: n.anchorT.slice(0, -1)
|
|
36
|
-
}) : r.push(n);
|
|
37
|
-
}
|
|
38
|
-
return r;
|
|
39
|
-
}
|
|
40
|
-
function t(e, t) {
|
|
41
|
-
return {
|
|
42
|
-
points: [...e.points, ...t.points.slice(2)],
|
|
43
|
-
closed: !1,
|
|
44
|
-
anchorA: Uint32Array.from([...e.anchorA, ...t.anchorA.subarray(1)]),
|
|
45
|
-
anchorB: Uint32Array.from([...e.anchorB, ...t.anchorB.subarray(1)]),
|
|
46
|
-
anchorT: Float32Array.from([...e.anchorT, ...t.anchorT.subarray(1)])
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { e as splitForDash };
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=dash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dash.js","names":["splitForDash","out","plA","pl","plB","plT","dashIdx","dashRemaining","dash","onPhase","curPts","curA","curB","curT","flushAndAdvance","prevX","prevY","ptCount","segCount","i","nextIdx","cx","cy","startA","startB","startT","endA","endB","endT","segFullDx","segFullDy","segFullLen","segDx","segDy","segLen","traveled","tConsume","ix","iy","frac","mA","mB","mT","tail","tx","ty","meets","x","y","joinAtSeam","head"],"sources":["../../../../src/features/paths/tessellate/dash.ts"],"sourcesContent":["import type { Polyline } from '@weasel-js/geom/tessellate';\n\n/**\n * Split a polyline into open sub-polylines for the \"on\" portions of a dash\n * pattern. Each output sub-polyline gets caps from the stroke's `cap` setting.\n * The \"off\" portions become invisible gaps. Anchor params are carried through:\n * sub-polyline endpoints inherit their source polyline-point's anchor params;\n * dash boundaries that land mid-segment (between two polyline points) snap\n * their anchor params to whichever endpoint they're closer to when the\n * segment crosses a path-anchor boundary, otherwise interpolate `t` linearly.\n */\nexport function splitForDash(pl: Polyline, dash: number[]): Polyline[] {\n const out: Polyline[] = [];\n const plA = pl.anchorA ?? new Uint32Array(pl.points.length / 2);\n const plB = pl.anchorB ?? new Uint32Array(pl.points.length / 2);\n const plT = pl.anchorT ?? new Float32Array(pl.points.length / 2);\n\n let dashIdx = 0;\n let dashRemaining = dash[0];\n let onPhase = true;\n let curPts: number[] | null = onPhase ? [pl.points[0], pl.points[1]] : null;\n let curA: number[] | null = onPhase ? [plA[0]] : null;\n let curB: number[] | null = onPhase ? [plB[0]] : null;\n let curT: number[] | null = onPhase ? [plT[0]] : null;\n\n const flushAndAdvance = () => {\n if (curPts && curPts.length >= 4) {\n out.push({\n points: curPts,\n closed: false,\n anchorA: new Uint32Array(curA!),\n anchorB: new Uint32Array(curB!),\n anchorT: new Float32Array(curT!),\n });\n }\n curPts = null; curA = null; curB = null; curT = null;\n dashIdx = (dashIdx + 1) % dash.length;\n dashRemaining = dash[dashIdx];\n onPhase = !onPhase;\n };\n\n let prevX = pl.points[0], prevY = pl.points[1];\n const ptCount = pl.points.length / 2;\n const segCount = pl.closed ? ptCount : ptCount - 1;\n\n for (let i = 0; i < segCount; i++) {\n const nextIdx = (i + 1) % ptCount;\n const cx = pl.points[nextIdx * 2], cy = pl.points[nextIdx * 2 + 1];\n const startA = plA[i], startB = plB[i], startT = plT[i];\n const endA = plA[nextIdx], endB = plB[nextIdx], endT = plT[nextIdx];\n const segFullDx = cx - prevX, segFullDy = cy - prevY;\n const segFullLen = Math.hypot(segFullDx, segFullDy);\n let segDx = segFullDx, segDy = segFullDy;\n let segLen = segFullLen;\n let traveled = 0;\n\n while (segLen > 1e-9) {\n if (segLen <= dashRemaining) {\n if (onPhase && curPts) {\n curPts.push(cx, cy);\n curA!.push(endA); curB!.push(endB); curT!.push(endT);\n }\n dashRemaining -= segLen;\n prevX = cx; prevY = cy;\n traveled = segFullLen;\n segLen = 0;\n if (dashRemaining <= 1e-9) {\n flushAndAdvance();\n if (onPhase) {\n curPts = [prevX, prevY];\n curA = [endA]; curB = [endB]; curT = [endT];\n }\n }\n } else {\n const tConsume = dashRemaining / segLen;\n const ix = prevX + segDx * tConsume;\n const iy = prevY + segDy * tConsume;\n traveled += dashRemaining;\n const frac = traveled / segFullLen;\n let mA: number, mB: number, mT: number;\n if (startA === endA && startB === endB) {\n mA = startA; mB = startB;\n mT = startT + (endT - startT) * frac;\n } else {\n // Cross-anchor segment: pick the nearer endpoint's params.\n if (frac < 0.5) { mA = startA; mB = startB; mT = startT; }\n else { mA = endA; mB = endB; mT = endT; }\n }\n if (onPhase && curPts) {\n curPts.push(ix, iy);\n curA!.push(mA); curB!.push(mB); curT!.push(mT);\n }\n prevX = ix; prevY = iy;\n segDx = cx - prevX; segDy = cy - prevY;\n segLen = Math.hypot(segDx, segDy);\n flushAndAdvance();\n if (onPhase) {\n curPts = [prevX, prevY];\n curA = [mA]; curB = [mB]; curT = [mT];\n }\n }\n }\n }\n\n if (curPts && curPts.length >= 4) {\n const tail: Polyline = {\n points: curPts,\n closed: false,\n anchorA: new Uint32Array(curA!),\n anchorB: new Uint32Array(curB!),\n anchorT: new Float32Array(curT!),\n };\n // A closed subpath's walk ends at the vertex it started from, so the run\n // still open there and the run that started there are one dash. Pushed\n // separately they are two butt-capped ribbons meeting at the seam — the\n // visible artifact whenever the pattern doesn't divide the perimeter.\n const tx = curPts[curPts.length - 2], ty = curPts[curPts.length - 1];\n const meets = (x: number, y: number) => Math.hypot(tx - x, ty - y) <= 1e-9;\n if (pl.closed && out.length > 0 && meets(out[0].points[0], out[0].points[1])) {\n out[0] = joinAtSeam(tail, out[0]);\n } else if (pl.closed && out.length === 0 && meets(curPts[0], curPts[1])) {\n // Every gap fell outside the perimeter: the dash is the whole loop, and\n // a loop stroked as an open run seams at its own start vertex too.\n out.push({\n points: curPts.slice(0, -2),\n closed: true,\n anchorA: tail.anchorA!.slice(0, -1),\n anchorB: tail.anchorB!.slice(0, -1),\n anchorT: tail.anchorT!.slice(0, -1),\n });\n } else {\n out.push(tail);\n }\n }\n return out;\n}\n\n/** `tail` continued by `head`, which starts where `tail` ends — the shared\n * vertex is carried once. */\nfunction joinAtSeam(tail: Polyline, head: Polyline): Polyline {\n return {\n points: [...tail.points, ...head.points.slice(2)],\n closed: false,\n anchorA: Uint32Array.from([...tail.anchorA!, ...head.anchorA!.subarray(1)]),\n anchorB: Uint32Array.from([...tail.anchorB!, ...head.anchorB!.subarray(1)]),\n anchorT: Float32Array.from([...tail.anchorT!, ...head.anchorT!.subarray(1)]),\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { polylineIntoMetric as e, polylineOutOfMetric as t, sameMetric as n } from "./metric.js";
|
|
2
|
-
import { trimPolyline as r } from "@weasel-js/geom/tessellate";
|
|
3
|
-
//#region src/features/paths/tessellate/insets.ts
|
|
4
|
-
var i = (e, t) => e === void 0 ? {
|
|
5
|
-
length: 0,
|
|
6
|
-
metric: t
|
|
7
|
-
} : typeof e == "number" ? {
|
|
8
|
-
length: e,
|
|
9
|
-
metric: t
|
|
10
|
-
} : e;
|
|
11
|
-
function a(a, o, s, c, l) {
|
|
12
|
-
let u = i(c, s), d = i(l, s), f = a, p = o, m = (r) => {
|
|
13
|
-
f === null || n(p, r) || (p !== null && t(f, p), r !== null && e(f, r), p = r);
|
|
14
|
-
};
|
|
15
|
-
if (u.length > 0 || d.length > 0) {
|
|
16
|
-
if (n(u.metric, d.metric)) m(u.metric), f = r(f, u.length, d.length);
|
|
17
|
-
else for (let [e, t, n] of [[
|
|
18
|
-
u.length,
|
|
19
|
-
u.metric,
|
|
20
|
-
!0
|
|
21
|
-
], [
|
|
22
|
-
d.length,
|
|
23
|
-
d.metric,
|
|
24
|
-
!1
|
|
25
|
-
]]) e > 0 && f !== null && (m(t), f = r(f, n ? e : 0, n ? 0 : e));
|
|
26
|
-
}
|
|
27
|
-
return m(s), f;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { a as trimInSpace };
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=insets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insets.js","names":["trimOf","inset","ribbon","trimInSpace","s","start","e","end","cur","pl","space","from","moveTo","sameMetric","to","polylineOutOfMetric","polylineIntoMetric","trimPolyline","len","metric","atStart"],"sources":["../../../../src/features/paths/tessellate/insets.ts"],"sourcesContent":["/**\n * Trimming a stroke's ends where each inset is measured.\n *\n * A head stops the line by a length in the head's own space, which need not be\n * the ribbon's: a world-sized head on a `{ px }` stroke stops it a world\n * distance short, a `{ px }` head on a world-width stroke a screen distance.\n * Under a stretching view one length means different distances in the two\n * spaces depending on which way the line runs, so each end is trimmed in its\n * own space rather than converted.\n */\nimport { type Polyline, trimPolyline } from '@weasel-js/geom/tessellate';\nimport {\n type StrokeMetric, polylineIntoMetric, polylineOutOfMetric, sameMetric,\n} from './metric';\n\n/** A length along the line measured in `metric`'s space, or in world where\n * `metric` is `null`. */\nexport interface MeasuredLength {\n readonly length: number;\n readonly metric: StrokeMetric | null;\n}\n\n/** A plain number is a length in the ribbon's own space. */\nexport type InsetLength = number | MeasuredLength;\n\ninterface Trim {\n length: number;\n metric: StrokeMetric | null;\n}\n\nconst trimOf = (inset: InsetLength | undefined, ribbon: StrokeMetric | null): Trim =>\n inset === undefined ? { length: 0, metric: ribbon }\n : typeof inset === 'number' ? { length: inset, metric: ribbon }\n : inset;\n\n/**\n * `pl`, whose points are in `from`'s space, trimmed by `start` and `end` and\n * carried into `ribbon`'s — `null` for world in both. `pl` may be mapped in\n * place. Returns `null` when the insets consume the whole run.\n */\nexport function trimInSpace(\n pl: Polyline,\n from: StrokeMetric | null,\n ribbon: StrokeMetric | null,\n start: InsetLength | undefined,\n end: InsetLength | undefined,\n): Polyline | null {\n const s = trimOf(start, ribbon);\n const e = trimOf(end, ribbon);\n let cur: Polyline | null = pl;\n let space = from;\n const moveTo = (to: StrokeMetric | null) => {\n if (cur === null || sameMetric(space, to)) return;\n if (space !== null) polylineOutOfMetric(cur, space);\n if (to !== null) polylineIntoMetric(cur, to);\n space = to;\n };\n if (s.length > 0 || e.length > 0) {\n if (sameMetric(s.metric, e.metric)) {\n moveTo(s.metric);\n cur = trimPolyline(cur, s.length, e.length);\n } else {\n for (const [len, metric, atStart] of [[s.length, s.metric, true], [e.length, e.metric, false]] as const) {\n if (!(len > 0) || cur === null) continue;\n moveTo(metric);\n cur = trimPolyline(cur, atStart ? len : 0, atStart ? 0 : len);\n }\n }\n }\n moveTo(ribbon);\n return cur;\n}\n"],"mappings":";;;AA8BA,IAAMA,KAAU,GAAgC,MAC9CC,MAAU,KAAA,IAAY;CAAE,QAAQ;CAAG,QAAQC;AAAO,IAC9C,OAAOD,KAAU,WAAW;CAAE,QAAQA;CAAO,QAAQC;AAAO,IAC1DD;AAOR,SAAgBE,EACd,GACA,GACA,GACA,GACA,GACiB;CACjB,IAAMC,IAAIJ,EAAOK,GAAOH,CAAM,GACxBI,IAAIN,EAAOO,GAAKL,CAAM,GACxBM,IAAuBC,GACvBC,IAAQC,GACNC,KAAU,MAA4B;EAC1C,AAAIJ,MAAQ,QAAQK,EAAWH,GAAOI,CAAE,MACpCJ,MAAU,QAAMK,EAAoBP,GAAKE,CAAK,GAC9CI,MAAO,QAAME,EAAmBR,GAAKM,CAAE,GAC3C,IAAQA;CACV;CACA,IAAIV,EAAE,SAAS,KAAKE,EAAE,SAAS,GAAG;EAChC,IAAIO,EAAWT,EAAE,QAAQE,EAAE,MAAM,GAE/B,AADAM,EAAOR,EAAE,MAAM,GACf,IAAMa,EAAaT,GAAKJ,EAAE,QAAQE,EAAE,MAAM;OAE1C,KAAK,IAAM,CAACY,GAAKC,GAAQC,MAAY,CAAC;GAAChB,EAAE;GAAQA,EAAE;GAAQ;EAAI,GAAG;GAACE,EAAE;GAAQA,EAAE;GAAQ;EAAK,CAAC,GAC3F,AAAMY,IAAM,KAAMV,MAAQ,SAC1BI,EAAOO,CAAM,GACb,IAAMF,EAAaT,GAAKY,IAAUF,IAAM,GAAGE,IAAU,IAAIF,CAAG;CAGlE;CAEA,OADAN,EAAOV,CAAM,GACNM;AACT"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
//#region src/features/paths/tessellate/metric.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
return e === void 0 ? "" : `${r(e.metric)}@${e.pxPerUnit}`;
|
|
4
|
-
}
|
|
5
|
-
var t = 1e-9;
|
|
6
|
-
function n(e, n, r, i) {
|
|
7
|
-
let a = Math.abs(e * i - n * r), o = Math.sqrt(a);
|
|
8
|
-
if (!(a > 0) || !Number.isFinite(a)) return {
|
|
9
|
-
scale: 0,
|
|
10
|
-
metric: null
|
|
11
|
-
};
|
|
12
|
-
let s = (e * e + n * n) / a, c = (e * r + n * i) / a, l = (r * r + i * i) / a, u = Math.sqrt(s + l + 2), d = (s + 1) / u, f = c / u, p = (l + 1) / u;
|
|
13
|
-
return Math.abs(f) < t && Math.abs(d - p) < t ? {
|
|
14
|
-
scale: o,
|
|
15
|
-
metric: null
|
|
16
|
-
} : {
|
|
17
|
-
scale: o,
|
|
18
|
-
metric: {
|
|
19
|
-
p: d,
|
|
20
|
-
q: f,
|
|
21
|
-
r: p
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function r(e) {
|
|
26
|
-
return e === void 0 ? "" : `${e.p},${e.q},${e.r}`;
|
|
27
|
-
}
|
|
28
|
-
function i(e, t) {
|
|
29
|
-
let n = e.points;
|
|
30
|
-
for (let e = 0; e < n.length; e += 2) {
|
|
31
|
-
let r = n[e], i = n[e + 1];
|
|
32
|
-
n[e] = t.p * r + t.q * i, n[e + 1] = t.q * r + t.r * i;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function a(e, t) {
|
|
36
|
-
let n = e.points;
|
|
37
|
-
for (let e = 0; e < n.length; e += 2) {
|
|
38
|
-
let r = n[e], i = n[e + 1];
|
|
39
|
-
n[e] = t.r * r - t.q * i, n[e + 1] = t.p * i - t.q * r;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function o(e, t) {
|
|
43
|
-
return e === t || e !== null && t !== null && e.p === t.p && e.q === t.q && e.r === t.r;
|
|
44
|
-
}
|
|
45
|
-
function s(e, t, n) {
|
|
46
|
-
return Math.hypot(e.r * t - e.q * n, e.p * n - e.q * t);
|
|
47
|
-
}
|
|
48
|
-
function c(e, t, n) {
|
|
49
|
-
return 1 / Math.hypot(e.p * t + e.q * n, e.q * t + e.r * n);
|
|
50
|
-
}
|
|
51
|
-
function l(e, t) {
|
|
52
|
-
for (let n = 0; n < e.length; n += 2) {
|
|
53
|
-
let r = e[n], i = e[n + 1];
|
|
54
|
-
e[n] = t.r * r - t.q * i, e[n + 1] = t.p * i - t.q * r;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function u(e) {
|
|
58
|
-
return e.q === 0;
|
|
59
|
-
}
|
|
60
|
-
function d(e, t) {
|
|
61
|
-
return u(t) ? {
|
|
62
|
-
kind: "rect",
|
|
63
|
-
x: t.p * e.x,
|
|
64
|
-
y: t.r * e.y,
|
|
65
|
-
width: t.p * e.width,
|
|
66
|
-
height: t.r * e.height
|
|
67
|
-
} : null;
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
export { l as coordsOutOfMetric, u as metricKeepsRects, r as metricKey, i as polylineIntoMetric, a as polylineOutOfMetric, d as rectIntoMetric, o as sameMetric, e as screenSpaceKey, n as strokeSpaceOf, s as worldWidthInMetric, c as worldWidthInMetricAlongWorld };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=metric.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metric.js","names":["screenSpaceKey","space","metricKey","CONFORMAL_EPSILON","strokeSpaceOf","det2","a","d","b","c","scale","g11","g12","g22","s","p","q","r","metric","polylineIntoMetric","pts","pl","i","x","y","m","polylineOutOfMetric","sameMetric","worldWidthInMetric","tx","ty","worldWidthInMetricAlongWorld","ux","uy","coordsOutOfMetric","coords","metricKeepsRects","rectIntoMetric","rect"],"sources":["../../../../src/features/paths/tessellate/metric.ts"],"sourcesContent":["/**\n * The space a screen-pixel stroke is built in.\n *\n * A `{ px }` stroke is exact on screen only when its ribbon is offset in a\n * space that measures lengths the way the screen does. The transform's linear\n * part is `scale · R · P`: a uniform scale, a rotation (or reflection) that\n * moves no lengths, and `P`, the symmetric unit-determinant stretch left over.\n * Offsetting the ribbon after `P` and mapping it back through `P⁻¹` gives a\n * world-space mesh that the full transform turns into a ribbon of exactly\n * `width · scale` pixels in every direction — and keeps the mesh drawable by\n * every path that draws a world-space ribbon.\n *\n * `P` depends only on the lengths the transform induces (`LᵀL`), not on any\n * rotation applied after it, so a view that only pans or zooms uniformly keeps\n * the same metric and the ribbon cache keeps hitting.\n */\nimport type { Polyline } from '@weasel-js/geom/tessellate';\n\n/** `P` = [[p, q], [q, r]], with `pr − q² = 1`. */\nexport interface StrokeMetric {\n readonly p: number;\n readonly q: number;\n readonly r: number;\n}\n\n/** A space a screen-sized part of a stroke is built in: the metric, and how\n * many screen pixels one of its units is. */\nexport interface ScreenSpace {\n readonly metric: StrokeMetric;\n readonly pxPerUnit: number;\n}\n\n/**\n * Where each part of a stroke is built. An absent part is built in world:\n * everything is under a similarity, and otherwise a part whose size is a world\n * length. The ribbon is screen-sized for a `{ px }` width; a head for a\n * `{ px }` size, or for no size on a screen-sized ribbon, since it then takes\n * the stroke width.\n */\nexport interface StrokeSpaces {\n readonly ribbon?: ScreenSpace;\n readonly start?: ScreenSpace;\n readonly mid?: ScreenSpace;\n readonly end?: ScreenSpace;\n}\n\n/** A cache-key fragment naming `space`; empty for world. */\nexport function screenSpaceKey(space: ScreenSpace | undefined): string {\n return space === undefined ? '' : `${metricKey(space.metric)}@${space.pxPerUnit}`;\n}\n\n/** Below this, a stretch is a rounding error and the transform a similarity. */\nconst CONFORMAL_EPSILON = 1e-9;\n\n/**\n * Split the linear map `x' = a·x + c·y, y' = b·x + d·y` — a GL `mat3`'s\n * `m[0], m[1], m[3], m[4]` — into its geometric-mean scale and its stroke\n * metric. `metric` is `null` when the map is a similarity, where world space\n * already measures like the screen; `scale` is `0` for a singular map.\n */\nexport function strokeSpaceOf(\n a: number, b: number, c: number, d: number,\n): { scale: number; metric: StrokeMetric | null } {\n const det2 = Math.abs(a * d - b * c);\n const scale = Math.sqrt(det2);\n if (!(det2 > 0) || !Number.isFinite(det2)) return { scale: 0, metric: null };\n // G = LᵀL / det, whose determinant is 1, so √G = (G + I) / √(tr G + 2).\n const g11 = (a * a + b * b) / det2;\n const g12 = (a * c + b * d) / det2;\n const g22 = (c * c + d * d) / det2;\n const s = Math.sqrt(g11 + g22 + 2);\n const p = (g11 + 1) / s;\n const q = g12 / s;\n const r = (g22 + 1) / s;\n if (Math.abs(q) < CONFORMAL_EPSILON && Math.abs(p - r) < CONFORMAL_EPSILON) {\n return { scale, metric: null };\n }\n return { scale, metric: { p, q, r } };\n}\n\n/** A cache-key fragment naming `metric`; empty for none. */\nexport function metricKey(metric: StrokeMetric | undefined): string {\n return metric === undefined ? '' : `${metric.p},${metric.q},${metric.r}`;\n}\n\n/** Map `pl`'s points through `P`, in place. */\nexport function polylineIntoMetric(pl: Polyline, m: StrokeMetric): void {\n const pts = pl.points;\n for (let i = 0; i < pts.length; i += 2) {\n const x = pts[i], y = pts[i + 1];\n pts[i] = m.p * x + m.q * y;\n pts[i + 1] = m.q * x + m.r * y;\n }\n}\n\n/** Map `pl`'s points back out through `P⁻¹`, in place. */\nexport function polylineOutOfMetric(pl: Polyline, m: StrokeMetric): void {\n const pts = pl.points;\n for (let i = 0; i < pts.length; i += 2) {\n const x = pts[i], y = pts[i + 1];\n pts[i] = m.r * x - m.q * y;\n pts[i + 1] = m.p * y - m.q * x;\n }\n}\n\n/** Whether two spaces are the same — world being `null`. */\nexport function sameMetric(a: StrokeMetric | null, b: StrokeMetric | null): boolean {\n if (a === b) return true;\n return a !== null && b !== null && a.p === b.p && a.q === b.q && a.r === b.r;\n}\n\n/**\n * What one world unit of width, across a line running along the unit\n * direction `(tx, ty)` of the metric's own space, measures in that space.\n * `P` keeps areas, so a strip keeps its area while its length stretches by\n * `|P u|` (`u` the line's world direction): its width shrinks by the same,\n * and `1 / |P u|` is `|P⁻¹ t|`.\n */\nexport function worldWidthInMetric(m: StrokeMetric, tx: number, ty: number): number {\n return Math.hypot(m.r * tx - m.q * ty, m.p * ty - m.q * tx);\n}\n\n/** The same, for a line running along the unit world direction `(ux, uy)`. */\nexport function worldWidthInMetricAlongWorld(m: StrokeMetric, ux: number, uy: number): number {\n return 1 / Math.hypot(m.p * ux + m.q * uy, m.q * ux + m.r * uy);\n}\n\n/** Map interleaved x,y pairs back out through `P⁻¹` = [[r, −q], [−q, p]], in\n * place. */\nexport function coordsOutOfMetric(coords: Float32Array, m: StrokeMetric): void {\n for (let i = 0; i < coords.length; i += 2) {\n const x = coords[i], y = coords[i + 1];\n coords[i] = m.r * x - m.q * y;\n coords[i + 1] = m.p * y - m.q * x;\n }\n}\n\n/** Whether `P` takes an axis-aligned rect to another one. */\nexport function metricKeepsRects(m: StrokeMetric): boolean {\n return m.q === 0;\n}\n\n/** `rect` in the metric's space, while `P` keeps it axis-aligned; otherwise\n * `null`, and the rect has to be carried as a polygon. */\nexport function rectIntoMetric(\n rect: { x: number; y: number; width: number; height: number },\n m: StrokeMetric,\n): { kind: 'rect'; x: number; y: number; width: number; height: number } | null {\n if (!metricKeepsRects(m)) return null;\n return { kind: 'rect', x: m.p * rect.x, y: m.r * rect.y, width: m.p * rect.width, height: m.r * rect.height };\n}\n"],"mappings":"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"}
|