@weasel-js/core 1.9.4 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +918 -0
- package/README.md +38 -3
- package/dist/WeaselProvider.js +5 -7
- package/dist/WeaselProvider.js.map +1 -1
- package/dist/affordances/composeAffordanceLayer.js +92 -84
- package/dist/affordances/composeAffordanceLayer.js.map +1 -1
- package/dist/affordances/cornerResize.js +3 -2
- package/dist/affordances/cornerResize.js.map +1 -1
- package/dist/affordances/hitAffordanceRegions.js +71 -101
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/pathAnchors.js +50 -28
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/affordances/rotateCursor.js +12 -0
- package/dist/affordances/rotateCursor.js.map +1 -0
- package/dist/affordances/rotationHandle.js +44 -46
- 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 +48 -136
- 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 +99 -0
- package/dist/animation/rig/rigNode.js.map +1 -0
- package/dist/animation/rig/rigSeat.js +59 -0
- package/dist/animation/rig/rigSeat.js.map +1 -0
- package/dist/animation/rig/skinBinding.js +64 -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 +8 -7
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
- package/dist/animation/wrappers/animateOnSetPose.js +31 -31
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
- package/dist/animation/wrappers/instantPose.js.map +1 -1
- package/dist/animation/writtenPoseTarget.js +33 -0
- package/dist/animation/writtenPoseTarget.js.map +1 -0
- package/dist/autoPoseDescriptor-DHg5KqaJ.d.ts +27 -0
- package/dist/barrel/canvas.js +32 -0
- package/dist/barrel/chrome.js +10 -10
- package/dist/barrel/input.js +16 -17
- package/dist/barrel/interactions.js +34 -37
- package/dist/barrel/paint.js +11 -18
- package/dist/barrel/paths.js +13 -19
- package/dist/barrel/renderer.js +14 -20
- package/dist/barrel/routing.js +54 -47
- package/dist/barrel/scene.js +37 -0
- package/dist/barrel/text.js +9 -18
- package/dist/barrel/viewport.js +44 -51
- package/dist/canvas/Canvas.js +270 -475
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +168 -190
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/CursorCoordsHud.js +24 -25
- package/dist/canvas/CursorCoordsHud.js.map +1 -1
- package/dist/canvas/DrawCanvas.js +39 -56
- package/dist/canvas/DrawCanvas.js.map +1 -1
- package/dist/canvas/ModalityHud.js.map +1 -1
- package/dist/canvas/NodeShape.js +28 -29
- package/dist/canvas/NodeShape.js.map +1 -1
- 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 +66 -107
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -1
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +33 -36
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +38 -50
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -1
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +3 -3
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -1
- package/dist/canvas/SceneCanvas/coordTrace.js +37 -1
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +319 -270
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
- package/dist/canvas/SceneCanvas/features.js +71 -62
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/insertPreviewCommands.js +97 -0
- package/dist/canvas/SceneCanvas/insertPreviewCommands.js.map +1 -0
- package/dist/canvas/SceneCanvas/isDev.js.map +1 -1
- package/dist/canvas/SceneCanvas/poseGeometry.js +33 -37
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
- package/dist/canvas/SceneCanvas/props.js +15 -14
- package/dist/canvas/SceneCanvas/props.js.map +1 -1
- package/dist/canvas/SceneCanvas/scenePointQuery.js +50 -0
- package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -0
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +52 -0
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.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/useActionTunings.js +17 -0
- package/dist/canvas/SceneCanvas/useActionTunings.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.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 +46 -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 +49 -113
- 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 +51 -41
- 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 +65 -101
- 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 +8 -0
- package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +301 -708
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +41 -47
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/SurfaceCanvas.js +40 -0
- package/dist/canvas/SurfaceCanvas.js.map +1 -0
- package/dist/canvas/adapterDerivedPath.js +26 -0
- package/dist/canvas/adapterDerivedPath.js.map +1 -0
- package/dist/canvas/adapterPickSource.js +34 -0
- package/dist/canvas/adapterPickSource.js.map +1 -0
- package/dist/canvas/affordanceAt.js +12 -2
- package/dist/canvas/affordanceAt.js.map +1 -1
- package/dist/canvas/buildSceneLayer.js +81 -61
- package/dist/canvas/buildSceneLayer.js.map +1 -1
- package/dist/canvas/buildSceneTree.js +56 -34
- package/dist/canvas/buildSceneTree.js.map +1 -1
- package/dist/canvas/canvasRenderer.js +40 -44
- package/dist/canvas/canvasRenderer.js.map +1 -1
- package/dist/canvas/colorOverrides.js.map +1 -1
- package/dist/canvas/copiesAbove.js +27 -0
- package/dist/canvas/copiesAbove.js.map +1 -0
- package/dist/canvas/defaultDrawOne.js +25 -24
- 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/debug.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +47 -71
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/geometryProjection.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +45 -25
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +149 -104
- 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/layout.js +9 -15
- package/dist/canvas/deps/layout.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 +44 -45
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +8 -8
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/deps/view.js.map +1 -1
- package/dist/canvas/derivedPath.js +69 -43
- 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 +2 -6
- package/dist/canvas/getNodeAtPoint.js.map +1 -1
- package/dist/canvas/hud.module.js.map +1 -1
- package/dist/canvas/insertPreviewExtent.js +33 -31
- package/dist/canvas/insertPreviewExtent.js.map +1 -1
- 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 +12 -12
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/imagePainter.js +10 -10
- package/dist/canvas/nodeShapes/imagePainter.js.map +1 -1
- package/dist/canvas/nodeShapes/memo.js.map +1 -1
- package/dist/canvas/nodeShapes/nodePaint.js +34 -23
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
- package/dist/canvas/nodeShapes/pathPainter.js +23 -22
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/poseBox.js +6 -6
- package/dist/canvas/nodeShapes/poseBox.js.map +1 -1
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +8 -8
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/shapePainter.js +16 -16
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
- package/dist/canvas/nodeShapes/textPainter.js +1 -1
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
- package/dist/canvas/overChildren.js +29 -0
- package/dist/canvas/overChildren.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/paintCull.js +6 -8
- 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/pickReach.js +23 -0
- package/dist/canvas/pickReach.js.map +1 -0
- package/dist/canvas/pickWalk.js +43 -70
- 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 +1 -3
- 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 +12 -12
- 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 -83
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +59 -144
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +1 -1
- package/dist/canvas/sceneClipboard.js.map +1 -1
- package/dist/canvas/sceneLayerPaint.js +4 -4
- package/dist/canvas/sceneLayerPaint.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js +10 -9
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +37 -42
- 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/useCanvasRenderer.js +23 -11
- 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 +51 -44
- package/dist/canvas/useCanvasView.js.map +1 -1
- package/dist/canvas/useFrameLoop.js +11 -12
- 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/useSceneAdapter.js +22 -0
- package/dist/canvas/useSceneAdapter.js.map +1 -0
- package/dist/canvas/useSceneLayerList.js +4 -14
- package/dist/canvas/useSceneLayerList.js.map +1 -1
- package/dist/canvas/useSurfaceInput.js +39 -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 +40 -34
- 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 +7 -2
- package/dist/canvas/wrapNodeOutput.js.map +1 -1
- package/dist/clipboard.d.ts +7 -14
- package/dist/{types-B4iJRHC3.d.ts → clone-C0eADtS0.d.ts} +129 -84
- package/dist/clone.d.ts +4 -8
- package/dist/clone.js +0 -2
- package/dist/core/device/targets.js.map +1 -1
- package/dist/core/device/useDeviceProfile.js +13 -13
- package/dist/core/device/useDeviceProfile.js.map +1 -1
- 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 +102 -29
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/regionHit.js +35 -37
- 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 +4 -5
- package/dist/core/geometry/unionBounds.js.map +1 -1
- 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 +2 -4
- package/dist/core/layers/children.js.map +1 -0
- package/dist/{features/focus → core/layers}/gateLayer.js +2 -2
- 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/create.js +2 -2
- 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 +19 -23
- package/dist/core/ops/delete.js.map +1 -1
- package/dist/core/ops/reorder/index.js +3 -7
- package/dist/core/ops/reorder/index.js.map +1 -1
- package/dist/core/ops/reorder/setChildOrder.js +2 -4
- package/dist/core/ops/reorder/setChildOrder.js.map +1 -1
- package/dist/core/ops/reparent.js +0 -1
- package/dist/core/ops/reparent.js.map +1 -1
- package/dist/core/ops/slot.js +3 -6
- package/dist/core/ops/slot.js.map +1 -1
- package/dist/core/pages/fitViewToPage.js +15 -0
- package/dist/core/pages/fitViewToPage.js.map +1 -0
- package/dist/core/pages/pages.js +65 -0
- package/dist/core/pages/pages.js.map +1 -0
- package/dist/core/pages/pagesLayer.js +27 -0
- package/dist/core/pages/pagesLayer.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} +104 -93
- 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/arrivalWindow.js +65 -64
- package/dist/core/scene/arrivalWindow.js.map +1 -1
- 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/core/scene/composePose.js +105 -0
- 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 +42 -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 +122 -70
- package/dist/core/scene/historyFacade.js.map +1 -1
- package/dist/core/scene/historyForm.js +6 -0
- package/dist/core/scene/historyForm.js.map +1 -0
- package/dist/core/scene/kitOps.js +83 -71
- package/dist/core/scene/kitOps.js.map +1 -1
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layerStack.js +105 -12
- package/dist/core/scene/layerStack.js.map +1 -1
- package/dist/core/scene/layoutPass.js +58 -59
- package/dist/core/scene/layoutPass.js.map +1 -1
- 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 +16 -9
- package/dist/core/scene/nodeFnFields.js.map +1 -1
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/nodeStore.js +72 -71
- package/dist/core/scene/nodeStore.js.map +1 -1
- 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 +67 -0
- package/dist/core/scene/outerOps.js.map +1 -0
- package/dist/core/scene/poseHold.js +39 -0
- package/dist/core/scene/poseHold.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +44 -36
- package/dist/core/scene/poseOverrides.js.map +1 -1
- package/dist/core/scene/poseSnapshot.js.map +1 -1
- package/dist/core/scene/reconcileSpecs.js +4 -3
- 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.map +1 -1
- package/dist/core/scene/scene.js +81 -690
- 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 +91 -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 +8 -5
- package/dist/core/scene/serialization.js.map +1 -1
- 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/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 +31 -33
- 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 +113 -53
- package/dist/core/viewport/useViewAnimation.js.map +1 -1
- package/dist/core/viewport/view.js +14 -11
- package/dist/core/viewport/view.js.map +1 -1
- package/dist/core/viewport/wheelHandler.js.map +1 -1
- package/dist/core/viewport/zoomAt.js +11 -2
- package/dist/core/viewport/zoomAt.js.map +1 -1
- package/dist/{cornerHandles-CtCb8a3G.d.ts → cornerHandles-BSKbyuvQ.d.ts} +11 -24
- package/dist/debug/createDebugOverlayLayer.js +100 -100
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/createDebugSink.js.map +1 -1
- 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.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +25 -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/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 +5 -0
- 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 +63 -0
- package/dist/features/paths/editablePath.js.map +1 -0
- package/dist/features/paths/index.js +9 -16
- 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/shapeGenerator.js +89 -0
- package/dist/features/paths/shapeGenerator.js.map +1 -0
- package/dist/features/paths/usePathEdit.js +34 -0
- package/dist/features/paths/usePathEdit.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +44 -57
- package/dist/features/poseRun/usePoseRun.js.map +1 -1
- package/dist/features/selection/overlay.js +170 -178
- 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 +119 -88
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/viewResolver.js +28 -24
- package/dist/features/viewports/viewResolver.js.map +1 -1
- package/dist/features/viewports/viewportLayer.js +25 -36
- package/dist/features/viewports/viewportLayer.js.map +1 -1
- package/dist/icons/SliceIcon.js +24 -0
- package/dist/icons/SliceIcon.js.map +1 -0
- package/dist/index.d.ts +5200 -8777
- package/dist/index.js +284 -320
- package/dist/input/keyState.js +14 -14
- package/dist/interactions/actions/actionShortcuts.js.map +1 -1
- package/dist/interactions/actions/{defaults/align.js → align/action.js} +15 -16
- package/dist/interactions/actions/align/action.js.map +1 -0
- package/dist/interactions/actions/align/align.js +24 -24
- 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 +74 -83
- 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} +19 -19
- package/dist/interactions/actions/clipboard/action.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +15 -15
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
- package/dist/interactions/actions/clone/action.js +103 -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 +10 -37
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +69 -74
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorHandles.js +42 -0
- package/dist/interactions/actions/defaults/anchorHandles.js.map +1 -0
- package/dist/interactions/actions/defaults/anchorJoin.js +92 -0
- package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -0
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +46 -0
- package/dist/interactions/actions/defaults/bendSegment.js.map +1 -0
- 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 +1 -1
- package/dist/interactions/actions/defaults/copySubtree.js.map +1 -1
- 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 +36 -21
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterPathEdit.js +19 -7
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +35 -40
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/anchorIcons.js +75 -0
- package/dist/interactions/actions/defaults/icons/anchorIcons.js.map +1 -0
- 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/editIcons.js +35 -8
- package/dist/interactions/actions/defaults/icons/editIcons.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 +19 -15
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +18 -34
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +43 -39
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/pinchZoom.js +29 -29
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/segmentUnder.js +22 -0
- package/dist/interactions/actions/defaults/segmentUnder.js.map +1 -0
- package/dist/interactions/actions/defaults/setFill.js +9 -3
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +4 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/sliceOps.js +20 -22
- 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 +1 -1
- 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 +82 -79
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/{defaults/distribute.js → distribute/action.js} +18 -19
- package/dist/interactions/actions/distribute/action.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +15 -15
- package/dist/interactions/actions/distribute/distribute.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/action.js +101 -0
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +2 -4
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/preview.js +26 -0
- package/dist/interactions/actions/edit-anchors/preview.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/symmetry.js +11 -0
- package/dist/interactions/actions/edit-anchors/symmetry.js.map +1 -0
- 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 +1 -1
- package/dist/interactions/actions/flip/helpers.js.map +1 -1
- package/dist/interactions/actions/geometryProjection.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/insert/action.js +79 -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 +55 -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/repositionAction.js +31 -0
- package/dist/interactions/actions/insert/repositionAction.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/move/action.js +91 -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/snapToContainer.js +35 -28
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/capture.js +108 -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 +47 -0
- package/dist/interactions/actions/move/frame.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +15 -40
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
- package/dist/interactions/actions/move/landedDescendants.js +8 -8
- 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 +17 -64
- 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/pathCommands/cutJoin.js +102 -0
- package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -0
- package/dist/interactions/actions/pathCommands/livePathEdit.js +64 -0
- package/dist/interactions/actions/pathCommands/livePathEdit.js.map +1 -0
- package/dist/interactions/actions/pathCommands/pathNodes.js +99 -0
- package/dist/interactions/actions/pathCommands/pathNodes.js.map +1 -0
- package/dist/interactions/actions/pathCommands/simplifyOffset.js +42 -0
- package/dist/interactions/actions/pathCommands/simplifyOffset.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 +1 -1
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +26 -26
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +66 -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 +88 -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/replay.js +47 -0
- package/dist/interactions/actions/resize/replay.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 +63 -0
- package/dist/interactions/actions/resize/session.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js +2 -1
- 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 +71 -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/replay.js +22 -0
- package/dist/interactions/actions/rotate/replay.js.map +1 -0
- package/dist/interactions/actions/rotate/session.js +102 -0
- package/dist/interactions/actions/rotate/session.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -1
- package/dist/interactions/actions/transform-again/action.js +63 -0
- package/dist/interactions/actions/transform-again/action.js.map +1 -0
- package/dist/interactions/actions/transform-again/memory.js +35 -0
- package/dist/interactions/actions/transform-again/memory.js.map +1 -0
- package/dist/interactions/actions/useStandardActions.js +84 -61
- package/dist/interactions/actions/useStandardActions.js.map +1 -1
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +61 -42
- 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/math-CYUjoyyU.d.ts +33 -0
- package/dist/math.d.ts +5 -2
- package/dist/math.js +6 -6
- package/dist/mesh.d.ts +4 -268
- package/dist/mesh.js +3 -7
- package/dist/move.d.ts +6 -4
- package/dist/{originProjection-gHnOup4e.d.ts → originProjection-CoNVpITV.d.ts} +1 -1
- package/dist/patterns-builtin.d.ts +1 -118
- package/dist/patterns-builtin.js +2 -3
- package/dist/poseDescriptor-Bqk-11Rl.d.ts +73 -0
- package/dist/renderer.d.ts +1 -92
- package/dist/renderer.js +2 -19
- package/dist/resize.d.ts +11 -22
- package/dist/resize.js +1 -1
- package/dist/style.css +1 -1
- 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 +16 -15
- 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.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
- package/dist/tools/builtin/line/useLineTool.js +16 -15
- package/dist/tools/builtin/line/useLineTool.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +162 -164
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
- package/dist/tools/builtin/pickTopMostHit.js +11 -14
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js +17 -15
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/rect/useRectTool.js +15 -14
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
- package/dist/tools/builtin/select/adapterPointQuery.js +40 -0
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +5 -5
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +44 -71
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/shared/pointerFollower.js.map +1 -1
- package/dist/tools/builtin/slice/useSliceTool.js +69 -72
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +18 -16
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +10 -2
- 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 +20 -14
- package/dist/tools/useKeybindings.js.map +1 -1
- package/dist/{types-k-5Oqh-U.d.ts → types-DBbbCy0i.d.ts} +103 -176
- package/dist/util/paint.js +1 -1
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +26 -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 -60
- 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 -146
- package/dist/animation/stagger.js.map +0 -1
- package/dist/animation/timeline/booking.js +0 -114
- package/dist/animation/timeline/booking.js.map +0 -1
- package/dist/animation/timeline/createTimeline.js +0 -125
- package/dist/animation/timeline/createTimeline.js.map +0 -1
- package/dist/animation/timeline/sampleTrack.js +0 -79
- package/dist/animation/timeline/sampleTrack.js.map +0 -1
- package/dist/animation/useAnimator.js +0 -388
- package/dist/animation/useAnimator.js.map +0 -1
- package/dist/autoPoseDescriptor-Ct7yqivU.d.ts +0 -108
- package/dist/builtins-DPcdghtB.d.ts +0 -1223
- package/dist/canvas/MinimapCanvas.js +0 -140
- 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 -82
- 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 -94
- 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/poseFrame.js +0 -44
- package/dist/core/geometry/poseFrame.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/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/scene/pickability.js +0 -6
- package/dist/core/scene/pickability.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/features/cursor/paintedCursorLayer.js.map +0 -1
- 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 +0 -67
- 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 -104
- 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 -239
- 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 -85
- 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 -22
- package/dist/features/parallax/createParallaxPlane.js.map +0 -1
- package/dist/features/paths/anchorEdits.js +0 -167
- package/dist/features/paths/anchorEdits.js.map +0 -1
- package/dist/features/paths/anchors.js +0 -159
- package/dist/features/paths/anchors.js.map +0 -1
- package/dist/features/paths/booleans.js +0 -2
- package/dist/features/paths/markerCommands.js +0 -149
- 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/strokeToPath.js +0 -40
- package/dist/features/paths/strokeToPath.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/commandPaint.js +0 -18
- package/dist/features/patterns/commandPaint.js.map +0 -1
- package/dist/features/patterns/index.js +0 -11
- 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/rasterizeTile.js +0 -17
- package/dist/features/patterns/rasterizeTile.js.map +0 -1
- package/dist/features/patterns/resolveSpec.js +0 -65
- 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 -51
- 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/domOffsets.js +0 -82
- package/dist/features/text/domOffsets.js.map +0 -1
- package/dist/features/text/domRuns.js +0 -230
- 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 -48
- package/dist/features/text/hitTest.js.map +0 -1
- package/dist/features/text/isTextData.js +0 -8
- package/dist/features/text/isTextData.js.map +0 -1
- package/dist/features/text/overlayDirection.js +0 -15
- package/dist/features/text/overlayDirection.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 -133
- package/dist/features/text/runs/rangeStyle.js.map +0 -1
- package/dist/features/text/textCommand.js +0 -60
- 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 -491
- package/dist/features/text/useTextEdit.js.map +0 -1
- package/dist/features/tiling/createTiledLayer.js +0 -65
- 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 -91
- 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.map +0 -1
- package/dist/interactions/actions/defaults/editAnchors.js +0 -100
- package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
- package/dist/interactions/actions/defaults/flip.js +0 -125
- package/dist/interactions/actions/defaults/flip.js.map +0 -1
- package/dist/interactions/actions/defaults/insert.js +0 -287
- package/dist/interactions/actions/defaults/insert.js.map +0 -1
- package/dist/interactions/actions/defaults/lassoSelect.js +0 -153
- package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
- package/dist/interactions/actions/defaults/move.js +0 -778
- package/dist/interactions/actions/defaults/move.js.map +0 -1
- package/dist/interactions/actions/defaults/resize.js +0 -341
- package/dist/interactions/actions/defaults/resize.js.map +0 -1
- package/dist/interactions/actions/defaults/rotate.js +0 -185
- 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/layout/arrivals.js +0 -36
- package/dist/layout/arrivals.js.map +0 -1
- package/dist/math-J-ACHyEg.d.ts +0 -159
- package/dist/registerProgram-T9S_PfAX.d.ts +0 -208
- package/dist/renderer/DrawCommand.js +0 -6
- package/dist/renderer/DrawCommand.js.map +0 -1
- package/dist/renderer/WeaselRenderer.js +0 -333
- 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 -74
- 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 -68
- 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/batch.js +0 -133
- package/dist/renderer/draw/batch.js.map +0 -1
- package/dist/renderer/draw/clip.js +0 -89
- package/dist/renderer/draw/clip.js.map +0 -1
- package/dist/renderer/draw/customShader.js +0 -230
- package/dist/renderer/draw/customShader.js.map +0 -1
- package/dist/renderer/draw/drawTriangles.js +0 -8
- package/dist/renderer/draw/drawTriangles.js.map +0 -1
- package/dist/renderer/draw/effects.js +0 -28
- package/dist/renderer/draw/effects.js.map +0 -1
- package/dist/renderer/draw/flushBatch.js +0 -35
- package/dist/renderer/draw/flushBatch.js.map +0 -1
- package/dist/renderer/draw/gradient.js +0 -90
- package/dist/renderer/draw/gradient.js.map +0 -1
- package/dist/renderer/draw/image.js +0 -38
- package/dist/renderer/draw/image.js.map +0 -1
- package/dist/renderer/draw/mesh.js +0 -16
- package/dist/renderer/draw/mesh.js.map +0 -1
- package/dist/renderer/draw/paintBind.js +0 -70
- package/dist/renderer/draw/paintBind.js.map +0 -1
- package/dist/renderer/draw/pathPaint.js +0 -142
- package/dist/renderer/draw/pathPaint.js.map +0 -1
- package/dist/renderer/draw/scratchPass.js +0 -83
- package/dist/renderer/draw/scratchPass.js.map +0 -1
- package/dist/renderer/draw/stencil.js +0 -28
- package/dist/renderer/draw/stencil.js.map +0 -1
- package/dist/renderer/draw/text.js +0 -167
- package/dist/renderer/draw/text.js.map +0 -1
- package/dist/renderer/draw/uniforms.js +0 -77
- package/dist/renderer/draw/uniforms.js.map +0 -1
- package/dist/renderer/draw.js +0 -79
- 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 -48
- 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 -11
- 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 -20
- package/dist/renderer/math/color.js +0 -321
- package/dist/renderer/math/color.js.map +0 -1
- package/dist/renderer/math/mat3.js +0 -80
- 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 -31
- package/dist/renderer/shaders/gradFill.js.map +0 -1
- package/dist/renderer/shaders/pathFill.js +0 -14
- package/dist/renderer/shaders/pathFill.js.map +0 -1
- package/dist/renderer/shaders/patternFill.js +0 -25
- 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 -34
- 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-DM2B87-g.d.ts +0 -356
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useMemo as e } from "react";
|
|
2
|
+
import { usePublishSelection as t } from "@weasel-js/routing/react";
|
|
3
|
+
//#region src/core/selection/usePublishSceneSelection.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
if (e.kind === "container") return "group";
|
|
6
|
+
let t = e.pose;
|
|
7
|
+
if (t && typeof t == "object" && "kind" in t && typeof t.kind == "string") return "path";
|
|
8
|
+
}
|
|
9
|
+
function r(e, t, r) {
|
|
10
|
+
if (t.length !== 0) return t.map((t) => {
|
|
11
|
+
let i = e.get(t);
|
|
12
|
+
if (i) return r ? r(i) : n(i);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function i(n, i, a) {
|
|
16
|
+
let o = e(() => r(n, i, a), [
|
|
17
|
+
n,
|
|
18
|
+
i,
|
|
19
|
+
a
|
|
20
|
+
]);
|
|
21
|
+
t(i, o);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as selectionKindLabels, i as usePublishSceneSelection };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=usePublishSceneSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePublishSceneSelection.js","names":["defaultKindLabel","node","pose","selectionKindLabels","ids","scene","id","describeKind","usePublishSceneSelection","kinds","useMemo"],"sources":["../../../src/core/selection/usePublishSceneSelection.ts"],"sourcesContent":["import { usePublishSelection } from '@weasel-js/routing/react';\nimport type { Node, NodeId, Scene } from 'core/scene/types';\nimport { useMemo } from 'react';\n\ntype KindLabel = string | undefined;\n\n// Not the routing kind: this reads the node and its pose where `NodeRouting.classify` reads\n// `data`, and the two disagree on most nodes (`SceneCanvas.selectionKinds.test.tsx`).\nfunction defaultKindLabel(node: Node<unknown, string, unknown>): KindLabel {\n if (node.kind === 'container') return 'group';\n const pose = node.pose as { kind?: unknown } | null;\n if (pose && typeof pose === 'object' && 'kind' in pose && typeof pose.kind === 'string') return 'path';\n return undefined;\n}\n\n/** The label published beside each selected id, parallel to `ids`; `undefined` when\n * nothing is selected. `describeKind` replaces the default for every node. */\nexport function selectionKindLabels<TData, TLayer extends string, TPose>(\n scene: Pick<Scene<TData, TLayer, TPose>, 'get'>,\n ids: readonly NodeId[],\n describeKind?: (node: Node<TData, TLayer, TPose>) => KindLabel,\n): readonly KindLabel[] | undefined {\n if (ids.length === 0) return undefined;\n return ids.map((id) => {\n const node = scene.get(id);\n if (!node) return undefined;\n return describeKind ? describeKind(node) : defaultKindLabel(node as Node<unknown, string, unknown>);\n });\n}\n\n/** Publishes a scene's selection, with a kind label per id, into any surrounding\n * `<SelectionContextProvider>`. A no-op without one. */\nexport function usePublishSceneSelection<TData, TLayer extends string, TPose>(\n scene: Pick<Scene<TData, TLayer, TPose>, 'get'>,\n ids: readonly NodeId[],\n describeKind?: (node: Node<TData, TLayer, TPose>) => KindLabel,\n): void {\n const kinds = useMemo(() => selectionKindLabels(scene, ids, describeKind), [scene, ids, describeKind]);\n usePublishSelection(ids, kinds);\n}\n"],"mappings":";;;AAQA,SAASA,EAAiB,GAAiD;CACzE,IAAIC,EAAK,SAAS,aAAa,OAAO;CACtC,IAAMC,IAAOD,EAAK;CAClB,IAAIC,KAAQ,OAAOA,KAAS,YAAY,UAAUA,KAAQ,OAAOA,EAAK,QAAS,UAAU,OAAO;AAElG;AAIA,SAAgBC,EACd,GACA,GACA,GACkC;CAClC,IAAIC,EAAI,WAAW,GACnB,OAAOA,EAAI,KAAK,MAAO;EACrB,IAAMH,IAAOI,EAAM,IAAIC,CAAE;EACzB,IAAKL,GACL,OAAOM,IAAeA,EAAaN,CAAI,IAAID,EAAiBC,CAAsC;CACpG,CAAC;AACH;AAIA,SAAgBO,EACd,GACA,GACA,GACM;CACN,IAAMC,IAAQC,QAAcP,EAAoBE,GAAOD,GAAKG,CAAY,GAAG;EAACF;EAAOD;EAAKG;CAAY,CAAC;CACrG,EAAoBH,GAAKK,CAAK;AAChC"}
|
|
@@ -3,25 +3,31 @@ import { useLayoutEffect as t, useMemo as n, useRef as r, useState as i, useSync
|
|
|
3
3
|
import { useLatest as o } from "@weasel-js/react";
|
|
4
4
|
import { createSelectionStore as s, intentOf as c, select as l } from "@weasel-js/select";
|
|
5
5
|
//#region src/core/selection/useSelection.ts
|
|
6
|
-
function u(
|
|
7
|
-
let {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
function u(e) {
|
|
7
|
+
let { renderOrder: t } = e;
|
|
8
|
+
return typeof t == "function" ? () => t.call(e) : void 0;
|
|
9
|
+
}
|
|
10
|
+
function d(d = {}) {
|
|
11
|
+
let { mode: f = "single", extend: p = "shift", initial: m = [], lock: h = !1, scene: g, range: _, order: v } = d, [y] = i(() => s([...m])), b = g ?? y, x = r(m);
|
|
12
|
+
a(b.subscribe, () => b.getSelection());
|
|
13
|
+
let S = r(!1);
|
|
10
14
|
t(() => {
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
let
|
|
14
|
-
mode:
|
|
15
|
-
extend:
|
|
16
|
-
lock:
|
|
17
|
-
|
|
15
|
+
g && !S.current && (S.current = !0, x.current.length > 0 && g.getSelection().length === 0 && g.setSelection([...x.current]));
|
|
16
|
+
}, [g]);
|
|
17
|
+
let C = o({
|
|
18
|
+
mode: f,
|
|
19
|
+
extend: p,
|
|
20
|
+
lock: h,
|
|
21
|
+
range: _,
|
|
22
|
+
order: v
|
|
23
|
+
}), w = r(null);
|
|
18
24
|
return n(() => {
|
|
19
|
-
let t = () =>
|
|
20
|
-
|
|
25
|
+
let t = () => b.getSelection(), n = (n) => {
|
|
26
|
+
C.current.lock || (e("selection", "set", {
|
|
21
27
|
from: t().length,
|
|
22
28
|
to: n.length,
|
|
23
29
|
ids: n
|
|
24
|
-
}),
|
|
30
|
+
}), b.setSelection(n));
|
|
25
31
|
}, r = (e) => t().filter((t) => t !== e);
|
|
26
32
|
return {
|
|
27
33
|
get current() {
|
|
@@ -30,36 +36,39 @@ function u(u = {}) {
|
|
|
30
36
|
get: t,
|
|
31
37
|
set: n,
|
|
32
38
|
add(e) {
|
|
33
|
-
|
|
39
|
+
C.current.mode === "single" ? n([e]) : t().includes(e) || n([...t(), e]);
|
|
34
40
|
},
|
|
35
41
|
remove(e) {
|
|
36
42
|
t().includes(e) && n(r(e));
|
|
37
43
|
},
|
|
38
44
|
toggle(e) {
|
|
39
|
-
t().includes(e) ? n(r(e)) : n(
|
|
45
|
+
t().includes(e) ? n(r(e)) : n(C.current.mode === "single" ? [e] : [...t(), e]);
|
|
40
46
|
},
|
|
41
47
|
clear() {
|
|
42
48
|
n([]);
|
|
43
49
|
},
|
|
44
50
|
contains: (e) => t().includes(e),
|
|
45
51
|
applyClick(e, r) {
|
|
46
|
-
let { mode: i, extend: a } =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
anchor: null
|
|
50
|
-
}, e, c(r, {
|
|
52
|
+
let { mode: i, extend: a, range: o, order: s = u(b), lock: d } = C.current;
|
|
53
|
+
if (d) return;
|
|
54
|
+
let f = t(), p = w.current !== null && f.includes(w.current) ? w.current : f.at(-1) ?? null, m = c(r, {
|
|
51
55
|
mode: i,
|
|
52
|
-
toggle: a
|
|
53
|
-
|
|
56
|
+
toggle: a,
|
|
57
|
+
range: o
|
|
58
|
+
}), h = l({
|
|
59
|
+
ids: f,
|
|
60
|
+
anchor: p
|
|
61
|
+
}, e, m, m === "range" && s ? { order: [...s()] } : {});
|
|
62
|
+
w.current = h.anchor, n([...h.ids]);
|
|
54
63
|
},
|
|
55
64
|
adapterMethods: {
|
|
56
65
|
getSelection: () => t(),
|
|
57
66
|
setSelection: (e) => n(e)
|
|
58
67
|
}
|
|
59
68
|
};
|
|
60
|
-
}, [
|
|
69
|
+
}, [b, C]);
|
|
61
70
|
}
|
|
62
71
|
//#endregion
|
|
63
|
-
export {
|
|
72
|
+
export { d as useSelection };
|
|
64
73
|
|
|
65
74
|
//# sourceMappingURL=useSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.js","names":["useSelection","opts","local","useState","createSelectionStore","initial","
|
|
1
|
+
{"version":3,"file":"useSelection.js","names":["paintOrderOf","store","renderOrder","useSelection","opts","local","useState","createSelectionStore","initial","scene","initialRef","useRef","seeded","optsRef","useLatest","anchorRef","useMemo","get","set","dlog","ids","without","x","id","m","key","rangeKey","walk","locked","anchor","intent","intentOf","modifiers","next","select"],"sources":["../../../src/core/selection/useSelection.ts"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { createSelectionStore, intentOf, select, type SelectionStore as Store } from '@weasel-js/select';\nimport type { NodeId } from 'core/scene/types';\nimport { dlog } from 'debug/flag';\n\n/** Declared in `@weasel-js/routing`; re-exported here, beside the hook that returns one. */\nimport type { SelectionApi, SelectionMode, SelectionExtendKey } from '@weasel-js/routing';\nexport type { SelectionApi, SelectionMode, SelectionExtendKey };\n\n/** Somewhere selection can live outside this hook. `Scene` satisfies it;\n * so does any store with the same three methods. */\nexport type SelectionStore = Store<NodeId>;\n\n/** Options for {@link useSelection}. */\nexport interface UseSelectionOptions {\n /** Default `'single'`. */\n mode?: SelectionMode;\n /** Default `'shift'`. Ignored in single-mode. */\n extend?: SelectionExtendKey;\n /** The key that selects everything from the last pressed id to this one,\n * along `order`. Absent, nothing ranges. It beats `extend` when both name\n * one key, so give them different keys. Ignored in single-mode. */\n range?: SelectionExtendKey;\n /** The sequence a range walks: a layer panel's rows, a timeline's tracks.\n * Default is the order the `scene` paints in, back to front; with neither,\n * the range key replaces. */\n order?: () => Iterable<NodeId>;\n /** Default `[]`. */\n initial?: readonly NodeId[];\n /** Keep the selection on this store rather than in the hook, so every\n * consumer of the same scene shares one selection and undo / redo can\n * restore it. `initial` then only seeds a store that has none yet.\n * Omit it and the hook owns a selection nobody else sees. */\n scene?: SelectionStore;\n /** When `true`, every mutator (`set`/`add`/`remove`/`toggle`/`clear`/\n * `applyClick`) is a no-op — selection stays at whatever `initial`\n * pinned it to. */\n lock?: boolean;\n}\n\n/** The order a store paints its nodes in, when it is a scene and has one. */\nfunction paintOrderOf(store: SelectionStore): (() => Iterable<NodeId>) | undefined {\n const { renderOrder } = store as { renderOrder?: () => Iterable<NodeId> };\n return typeof renderOrder === 'function' ? () => renderOrder.call(store) : undefined;\n}\n\n/**\n * Owns selection state, exposes a click-policy helper (single vs multi with\n * an extend key), and pre-builds the `getSelection` / `setSelection` adapter\n * methods:\n *\n * ```tsx\n * const selection = useSelection({ mode: 'multi' });\n * const adapter = useSceneAdapter(scene, { selection: selection.adapterMethods });\n * ```\n *\n * Returns the same object for as long as `scene` is the same store, so it is\n * safe as a memo or effect dependency. The calling component re-renders when\n * the selection changes; key anything derived from the ids on\n * `selection.current`.\n */\nexport function useSelection(opts: UseSelectionOptions = {}): SelectionApi {\n const { mode = 'single', extend = 'shift', initial = [], lock = false, scene, range, order } = opts;\n // Without a `scene` the hook still keeps its ids in a store, so `get()` reads one store either\n // way and a write is visible before the re-render it causes.\n const [local] = useState(() => createSelectionStore<NodeId>([...initial]));\n const store = scene ?? local;\n const initialRef = useRef(initial);\n\n useSyncExternalStore(store.subscribe, () => store.getSelection());\n\n // A store that already holds a selection wins: the hook is joining it, not\n // resetting it. In an effect, not during render — the store has other\n // subscribers.\n const seeded = useRef(false);\n useLayoutEffect(() => {\n if (!scene || seeded.current) return;\n seeded.current = true;\n if (initialRef.current.length > 0 && scene.getSelection().length === 0) {\n scene.setSelection([...initialRef.current]);\n }\n }, [scene]);\n\n const optsRef = useLatest({ mode, extend, lock, range, order });\n const anchorRef = useRef<NodeId | null>(null);\n\n return useMemo<SelectionApi>(() => {\n const get = (): NodeId[] => store.getSelection() as NodeId[];\n const set = (ids: NodeId[]): void => {\n if (optsRef.current.lock) return;\n dlog('selection', 'set', { from: get().length, to: ids.length, ids });\n store.setSelection(ids);\n };\n const without = (id: NodeId) => get().filter((x) => x !== id);\n return {\n get current() { return get(); },\n get,\n set,\n add(id) {\n if (optsRef.current.mode === 'single') set([id]);\n else if (!get().includes(id)) set([...get(), id]);\n },\n remove(id) {\n if (get().includes(id)) set(without(id));\n },\n toggle(id) {\n if (get().includes(id)) set(without(id));\n else set(optsRef.current.mode === 'single' ? [id] : [...get(), id]);\n },\n clear() { set([]); },\n contains: (id) => get().includes(id),\n applyClick(id, modifiers) {\n const { mode: m, extend: key, range: rangeKey, order: walk = paintOrderOf(store), lock: locked } = optsRef.current;\n if (locked) return;\n const ids = get();\n // A selection something else set — a marquee, an undo — ranges from its last id.\n const anchor = anchorRef.current !== null && ids.includes(anchorRef.current)\n ? anchorRef.current\n : (ids.at(-1) ?? null);\n const intent = intentOf(modifiers, { mode: m, toggle: key, range: rangeKey });\n const next = select({ ids, anchor }, id, intent, intent === 'range' && walk ? { order: [...walk()] } : {});\n anchorRef.current = next.anchor;\n set([...next.ids]);\n },\n adapterMethods: {\n getSelection: () => get(),\n setSelection: (ids: NodeId[]) => set(ids),\n },\n };\n }, [store, optsRef]);\n}\n"],"mappings":";;;;;AA0CA,SAASA,EAAa,GAA6D;CACjF,IAAM,EAAE,mBAAgBC;CACxB,OAAO,OAAOC,KAAgB,mBAAmBA,EAAY,KAAKD,CAAK,IAAI,KAAA;AAC7E;AAiBA,SAAgBE,EAAa,IAA4B,CAAC,GAAiB;CACzE,IAAM,EAAE,UAAO,UAAU,YAAS,SAAS,aAAU,CAAC,GAAG,UAAO,IAAO,UAAO,UAAO,aAAUC,GAGzF,CAACC,KAASC,QAAeC,EAA6B,CAAC,GAAGC,CAAO,CAAC,CAAC,GACnEP,IAAQQ,KAASJ,GACjBK,IAAaC,EAAOH,CAAO;CAEjC,EAAqBP,EAAM,iBAAiBA,EAAM,aAAa,CAAC;CAKhE,IAAMW,IAASD,EAAO,EAAK;CAC3B,QAAsB;EACpB,AAAKF,KAAS,GAAO,YACrB,EAAO,UAAU,IACbC,EAAW,QAAQ,SAAS,KAAKD,EAAM,aAAa,CAAC,CAAC,WAAW,KACnEA,EAAM,aAAa,CAAC,GAAGC,EAAW,OAAO,CAAC;CAE9C,GAAG,CAACD,CAAK,CAAC;CAEV,IAAMI,IAAUC,EAAU;EAAE;EAAM;EAAQ;EAAM;EAAO;CAAM,CAAC,GACxDC,IAAYJ,EAAsB,IAAI;CAE5C,OAAOK,QAA4B;EACjC,IAAMC,UAAsBhB,EAAM,aAAa,GACzCiB,KAAO,MAAwB;GACnC,AAAIL,EAAQ,QAAQ,SACpBM,EAAK,aAAa,OAAO;IAAE,MAAMF,EAAI,CAAC,CAAC;IAAQ,IAAIG,EAAI;IAAQ;GAAI,CAAC,GACpEnB,EAAM,aAAamB,CAAG;EACxB,GACMC,KAAW,MAAeJ,EAAI,CAAC,CAAC,QAAQ,MAAMK,MAAMC,CAAE;EAC5D,OAAO;GACL,IAAI,UAAU;IAAE,OAAON,EAAI;GAAG;GAC9B;GACA;GACA,IAAI,GAAI;IACN,AAAIJ,EAAQ,QAAQ,SAAS,WAAUK,EAAI,CAACK,CAAE,CAAC,IACrCN,EAAI,CAAC,CAAC,SAASM,CAAE,KAAGL,EAAI,CAAC,GAAGD,EAAI,GAAGM,CAAE,CAAC;GAClD;GACA,OAAO,GAAI;IACT,AAAIN,EAAI,CAAC,CAAC,SAASM,CAAE,KAAGL,EAAIG,EAAQE,CAAE,CAAC;GACzC;GACA,OAAO,GAAI;IACT,AAAIN,EAAI,CAAC,CAAC,SAASM,CAAE,IAAGL,EAAIG,EAAQE,CAAE,CAAC,IAClCL,EAAIL,EAAQ,QAAQ,SAAS,WAAW,CAACU,CAAE,IAAI,CAAC,GAAGN,EAAI,GAAGM,CAAE,CAAC;GACpE;GACA,QAAQ;IAAE,EAAI,CAAC,CAAC;GAAG;GACnB,WAAW,MAAON,EAAI,CAAC,CAAC,SAASM,CAAE;GACnC,WAAW,GAAI,GAAW;IACxB,IAAM,EAAE,MAAMC,GAAG,QAAQC,GAAK,OAAOC,GAAU,OAAOC,IAAO3B,EAAaC,CAAK,GAAG,MAAM2B,MAAWf,EAAQ;IAC3G,IAAIe,GAAQ;IACZ,IAAMR,IAAMH,EAAI,GAEVY,IAASd,EAAU,YAAY,QAAQK,EAAI,SAASL,EAAU,OAAO,IACvEA,EAAU,UACTK,EAAI,GAAG,EAAE,KAAK,MACbU,IAASC,EAASC,GAAW;KAAE,MAAMR;KAAG,QAAQC;KAAK,OAAOC;IAAS,CAAC,GACtEO,IAAOC,EAAO;KAAE;KAAK;IAAO,GAAGX,GAAIO,GAAQA,MAAW,WAAWH,IAAO,EAAE,OAAO,CAAC,GAAGA,EAAK,CAAC,EAAE,IAAI,CAAC,CAAC;IAEzG,AADA,EAAU,UAAUM,EAAK,QACzBf,EAAI,CAAC,GAAGe,EAAK,GAAG,CAAC;GACnB;GACA,gBAAgB;IACd,oBAAoBhB,EAAI;IACxB,eAAe,MAAkBC,EAAIE,CAAG;GAC1C;EACF;CACF,GAAG,CAACnB,GAAOY,CAAO,CAAC;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeKinds.js","names":["SHAPE_KINDS","shapeKindsWhere","table","k","field","shapeKindInfo","kind","KIT_SHAPE_KINDS"],"sources":["../../src/core/shapeKinds.ts"],"sourcesContent":["/**\n * The kit's built-in shape kinds — one table, every other spelling derived.\n *\n *
|
|
1
|
+
{"version":3,"file":"shapeKinds.js","names":["SHAPE_KINDS","shapeKindsWhere","table","k","field","shapeKindInfo","kind","KIT_SHAPE_KINDS"],"sources":["../../src/core/shapeKinds.ts"],"sourcesContent":["/**\n * The kit's built-in shape kinds — one table, every other spelling derived.\n *\n * This module imports nothing on purpose: `useBuiltinShapeTools` imports the\n * package barrel, so anything barrel-reachable that needs these lists at\n * module-evaluation time must not route through it.\n */\n\n/** What the kit knows about one built-in shape kind. */\nexport interface ShapeKindDescriptor {\n /** Mounted as a built-in shape tool by `useBuiltinShapeTools`, and so a\n * member of `BuiltinShapeToolId` / `KIT_SHAPE_KINDS`. `image` is false:\n * `useImageTool` needs a `src` and can't be auto-mounted. */\n readonly tool: boolean;\n /** `insertAction` emits an `insertPreview` overlay for this kind, and the\n * dispatcher overlay layer knows how to draw it. Kinds without one still\n * commit; they just have no live drag preview. */\n readonly insertPreview: boolean;\n}\n\n/**\n * Declaration order is the enumeration order of every derived list —\n * `KIT_SHAPE_KINDS`, and through it `defaultNodeRouting` /\n * `defaultNodeProperties` / `BUILTIN_TOOL_IDS`.\n */\nexport const SHAPE_KINDS = {\n rect: { tool: true, insertPreview: true },\n ellipse: { tool: true, insertPreview: true },\n line: { tool: true, insertPreview: true },\n polygon: { tool: true, insertPreview: true },\n star: { tool: true, insertPreview: true },\n pen: { tool: true, insertPreview: false },\n pencil: { tool: true, insertPreview: true },\n lasso: { tool: true, insertPreview: false },\n text: { tool: true, insertPreview: true },\n image: { tool: false, insertPreview: true },\n} as const satisfies Record<string, ShapeKindDescriptor>;\n\n/** Every kind in the table, tool or not. */\nexport type ShapeKind = keyof typeof SHAPE_KINDS;\n\n/** The keys of a shape-kind table whose descriptor sets `F` to `true`. */\nexport type ShapeKindsWhere<T, F extends keyof ShapeKindDescriptor> = {\n [K in keyof T]: T[K] extends Record<F, true> ? K : never;\n}[keyof T];\n\n/** Built-in shape tool ids handled by `useBuiltinShapeTools`. */\nexport type BuiltinShapeToolId = ShapeKindsWhere<typeof SHAPE_KINDS, 'tool'>;\n\n/** The insert kinds the kit's dispatcher overlay layer knows how to render.\n * Consumer-defined kinds fall outside it: no live preview, commit unaffected. */\nexport type KitInsertShape = ShapeKindsWhere<typeof SHAPE_KINDS, 'insertPreview'>;\n\n/** Kinds in `table` whose descriptor sets `field`, in declaration order. */\nexport function shapeKindsWhere<T extends Record<string, ShapeKindDescriptor>>(\n table: T,\n field: keyof ShapeKindDescriptor,\n): (keyof T & string)[] {\n return (Object.keys(table) as (keyof T & string)[]).filter((k) => table[k][field]);\n}\n\n/** The descriptor for `kind`, or `undefined` for a kind the kit doesn't ship.\n * The one accessor: ask it rather than testing membership of a derived list. */\nexport function shapeKindInfo(kind: string): ShapeKindDescriptor | undefined {\n return (SHAPE_KINDS as Record<string, ShapeKindDescriptor>)[kind];\n}\n\n/** Runtime, iterable list of the shape-tool ids in `BuiltinShapeToolId`. */\nexport const KIT_SHAPE_KINDS: readonly BuiltinShapeToolId[] =\n shapeKindsWhere(SHAPE_KINDS, 'tool') as BuiltinShapeToolId[];\n"],"mappings":";AAyBA,IAAaA,IAAc;CACzB,MAAM;EAAE,MAAM;EAAM,eAAe;CAAK;CACxC,SAAS;EAAE,MAAM;EAAM,eAAe;CAAK;CAC3C,MAAM;EAAE,MAAM;EAAM,eAAe;CAAK;CACxC,SAAS;EAAE,MAAM;EAAM,eAAe;CAAK;CAC3C,MAAM;EAAE,MAAM;EAAM,eAAe;CAAK;CACxC,KAAK;EAAE,MAAM;EAAM,eAAe;CAAM;CACxC,QAAQ;EAAE,MAAM;EAAM,eAAe;CAAK;CAC1C,OAAO;EAAE,MAAM;EAAM,eAAe;CAAM;CAC1C,MAAM;EAAE,MAAM;EAAM,eAAe;CAAK;CACxC,OAAO;EAAE,MAAM;EAAO,eAAe;CAAK;AAC5C;AAkBA,SAAgBC,EACd,GACA,GACsB;CACtB,OAAQ,OAAO,KAAKC,CAAK,CAAC,CAA0B,QAAQ,MAAMA,EAAMC,EAAE,CAACC,EAAM;AACnF;AAIA,SAAgBC,EAAc,GAA+C;CAC3E,OAAQL,EAAoDM;AAC9D;AAGA,IAAaC,IACXN,EAAgBD,GAAa,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylus.js","names":["pressureToWidth","minWidth","options","maxWidth","gamma","shaped","pressure","getStylusData","ext","pointerType","forEachCoalesced","get","event","sub","list","e","screenX","screenY","ctx","worldX","worldY","clientToWorld"],"sources":["../../../src/core/stylus/stylus.ts"],"sourcesContent":["import { clientToWorld } from 'core/viewport/clientToWorld';\n/**\n * Stylus / Pencil pointer-event helpers.\n *\n *
|
|
1
|
+
{"version":3,"file":"stylus.js","names":["pressureToWidth","minWidth","options","maxWidth","gamma","shaped","pressure","getStylusData","ext","pointerType","forEachCoalesced","get","event","sub","list","e","screenX","screenY","ctx","worldX","worldY","clientToWorld"],"sources":["../../../src/core/stylus/stylus.ts"],"sourcesContent":["import { clientToWorld } from 'core/viewport/clientToWorld';\n/**\n * Stylus / Pencil pointer-event helpers.\n *\n * These normalize the standard `PointerEvent` stylus fields across browsers,\n * fill in defaults for non-stylus inputs, and provide a coalesced-event\n * iterator for high-frequency samples.\n *\n * `pointerType: 'pen'` covers Apple Pencil on iPad Safari. The\n * barrel-double-tap (Pencil 2) and barrel-squeeze (Pencil Pro) gestures are\n * NOT exposed to web pages.\n */\n\n/** Normalized snapshot of stylus state at a single pointer sample. */\nexport interface StylusData {\n /** 0..1. Mouse and ordinary touch report 0 when no button is held and 0.5\n * while a button is held (per the Pointer Events spec). Stylus inputs\n * report a true pressure curve. */\n pressure: number;\n /** Tilt of the pen in degrees from the surface normal, projected onto the\n * X axis. Range ±90. Zero for mouse/touch. */\n tiltX: number;\n /** Tilt projected onto the Y axis. Range ±90. Zero for mouse/touch. */\n tiltY: number;\n /** Newer (Pointer Events level 3) angle in radians between the surface\n * and the pen barrel. π/2 = perpendicular to the surface. Undefined on\n * browsers that haven't shipped the field yet. */\n altitudeAngle: number | undefined;\n /** Newer angle in radians around the Z axis. Undefined on browsers\n * without level-3 support. */\n azimuthAngle: number | undefined;\n /** Rotation of the pen barrel in degrees. Apple Pencil Pro reports this\n * natively but Safari does NOT yet surface it via PointerEvent.twist —\n * expect 0 there. Some Wacom stylus drivers do report it. */\n twist: number;\n /** Raw pointerType from the event ('mouse' | 'pen' | 'touch' | ''). */\n pointerType: string;\n /** Convenience: `pointerType === 'pen'`. */\n isStylus: boolean;\n}\n\n/** Options for `pressureToWidth`. */\nexport interface PressureToWidthOptions {\n /** Width returned at pressure 0. Default 0.5. */\n minWidth?: number;\n /** Width returned at pressure 1. Default 6. */\n maxWidth?: number;\n /** Response curve exponent applied to pressure before lerping\n * (`p ** gamma`). 1 = linear. Default 1.6. */\n gamma?: number;\n}\n\n/**\n * Map a 0..1 pressure value to a stroke width.\n *\n * `width(p) = minWidth + (maxWidth - minWidth) × p^gamma`\n *\n * Mouse / non-stylus inputs report `pressure === 0` (no button) or `0.5`\n * (button held); gate on `pointerType === 'pen'` upstream to give them a\n * constant width instead.\n */\nexport function pressureToWidth(\n pressure: number,\n options: PressureToWidthOptions = {},\n): number {\n const minWidth = options.minWidth ?? 0.5;\n const maxWidth = options.maxWidth ?? 6;\n const gamma = options.gamma ?? 1.6;\n const p = Math.max(0, Math.min(1, pressure));\n const shaped = p ** gamma;\n return minWidth + (maxWidth - minWidth) * shaped;\n}\n\n/** Extract a normalized stylus snapshot from any PointerEvent. Pure. */\nexport function getStylusData(e: PointerEvent): StylusData {\n const ext = e as PointerEvent & {\n altitudeAngle?: number;\n azimuthAngle?: number;\n };\n const pointerType = e.pointerType ?? '';\n return {\n pressure: e.pressure,\n tiltX: e.tiltX ?? 0,\n tiltY: e.tiltY ?? 0,\n altitudeAngle: typeof ext.altitudeAngle === 'number' ? ext.altitudeAngle : undefined,\n azimuthAngle: typeof ext.azimuthAngle === 'number' ? ext.azimuthAngle : undefined,\n twist: e.twist ?? 0,\n pointerType,\n isStylus: pointerType === 'pen',\n };\n}\n\n/** One enriched sample, ready for tools that want world coords + stylus\n * data at every coalesced sub-frame. */\nexport interface PointerSample {\n /** Client coords (relative to viewport). */\n clientX: number;\n clientY: number;\n /** Canvas-relative CSS pixels. */\n screenX: number;\n screenY: number;\n /** World coords, derived from `screenX/Y` via the supplied view. */\n worldX: number;\n worldY: number;\n /** Stylus snapshot for this sample. */\n stylus: StylusData;\n /** Original event (may be the parent move or a coalesced sub-event). */\n event: PointerEvent;\n}\n\n/** Context for `forEachCoalesced`: the canvas's client rect and its view. */\nexport interface CoalescedCtx {\n canvasRect: { left: number; top: number };\n view: { x: number; y: number; scale: { x: number; y: number } };\n}\n\n/**\n * Iterate coalesced sub-events of a `pointermove`, yielding a\n * `PointerSample` per sub-event with world coords already derived. When\n * `getCoalescedEvents` is unavailable or returns an empty list, the parent\n * event itself is yielded once.\n */\nexport function forEachCoalesced(\n event: PointerEvent,\n ctx: CoalescedCtx,\n cb: (sample: PointerSample) => void,\n): void {\n // Cast through unknown — older lib.dom.d.ts in some toolchains omits the\n // method even though every modern engine ships it.\n const get = (event as unknown as { getCoalescedEvents?: () => PointerEvent[] })\n .getCoalescedEvents;\n const sub = typeof get === 'function' ? get.call(event) : [];\n const list = sub.length > 0 ? sub : [event];\n for (const e of list) {\n const [screenX, screenY] = [e.clientX - ctx.canvasRect.left, e.clientY - ctx.canvasRect.top];\n const [worldX, worldY] = clientToWorld(e.clientX, e.clientY, ctx.canvasRect, ctx.view);\n cb({\n clientX: e.clientX,\n clientY: e.clientY,\n screenX,\n screenY,\n worldX,\n worldY,\n stylus: getStylusData(e),\n event: e,\n });\n }\n}\n"],"mappings":";;AA6DA,SAAgBA,EACd,GACA,IAAkC,CAAC,GAC3B;CACR,IAAMC,IAAWC,EAAQ,YAAY,IAC/BC,IAAWD,EAAQ,YAAY,GAC/BE,IAAQF,EAAQ,SAAS,KAEzBG,IADI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGC,CAAQ,CAC3B,KAAKF;CACpB,OAAOH,KAAYE,IAAWF,KAAYI;AAC5C;AAGA,SAAgBE,EAAc,GAA6B;CACzD,IAAMC,IAAM,GAINC,IAAc,EAAE,eAAe;CACrC,OAAO;EACL,UAAU,EAAE;EACZ,OAAO,EAAE,SAAS;EAClB,OAAO,EAAE,SAAS;EAClB,eAAe,OAAOD,EAAI,iBAAkB,WAAWA,EAAI,gBAAgB,KAAA;EAC3E,cAAc,OAAOA,EAAI,gBAAiB,WAAWA,EAAI,eAAe,KAAA;EACxE,OAAO,EAAE,SAAS;EAClB;EACA,UAAUC,MAAgB;CAC5B;AACF;AAgCA,SAAgBC,EACd,GACA,GACA,GACM;CAGN,IAAMC,IAAOC,EACV,oBACGC,IAAM,OAAOF,KAAQ,aAAaA,EAAI,KAAKC,CAAK,IAAI,CAAC,GACrDE,IAAOD,EAAI,SAAS,IAAIA,IAAM,CAACD,CAAK;CAC1C,KAAK,IAAMG,KAAKD,GAAM;EACpB,IAAM,CAACE,GAASC,KAAW,CAACF,EAAE,UAAUG,EAAI,WAAW,MAAMH,EAAE,UAAUG,EAAI,WAAW,GAAG,GACrF,CAACC,GAAQC,KAAUC,EAAcN,EAAE,SAASA,EAAE,SAASG,EAAI,YAAYA,EAAI,IAAI;EACrF,EAAG;GACD,SAASH,EAAE;GACX,SAASA,EAAE;GACX;GACA;GACA;GACA;GACA,QAAQR,EAAcQ,CAAC;GACvB,OAAOA;EACT,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePointerStylus.js","names":["IDLE","usePointerStylus","options","state","setState","useState","lastCommit","useRef","optsRef","useLatest","useEffect","el","target","onMove","e","raw","stylusOnly","now","minGap","maxFps","getStylusData","prev","onEnter","onLeave"],"sources":["../../../src/core/stylus/usePointerStylus.ts"],"sourcesContent":["import { useEffect, useRef, useState, type RefObject } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { getStylusData, type StylusData } from './stylus';\n\n/** State exposed by `usePointerStylus` — the most recent stylus snapshot\n * plus a `hovering` flag
|
|
1
|
+
{"version":3,"file":"usePointerStylus.js","names":["IDLE","usePointerStylus","options","state","setState","useState","lastCommit","useRef","optsRef","useLatest","useEffect","el","target","onMove","e","raw","stylusOnly","now","minGap","maxFps","getStylusData","prev","onEnter","onLeave"],"sources":["../../../src/core/stylus/usePointerStylus.ts"],"sourcesContent":["import { useEffect, useRef, useState, type RefObject } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport { getStylusData, type StylusData } from './stylus';\n\n/** State exposed by `usePointerStylus` — the most recent stylus snapshot\n * plus a `hovering` flag. */\nexport interface PointerStylusState extends StylusData {\n /** True between `pointerenter` and `pointerleave` events on the target\n * element. iPad Safari fires these for Apple Pencil hover, so this is\n * true while the pen is near the glass without contact. */\n hovering: boolean;\n}\n\nconst IDLE: PointerStylusState = {\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n altitudeAngle: undefined,\n azimuthAngle: undefined,\n twist: 0,\n pointerType: '',\n isStylus: false,\n hovering: false,\n};\n\n/** Options for `usePointerStylus`. */\nexport interface UsePointerStylusOptions {\n /** Throttle re-renders to ≈this many state updates per second. The latest\n * sample is always kept; intermediates are dropped. Default 60. Set to\n * `Infinity` (or 0) to emit every move. */\n maxFps?: number;\n /** When true, only emit updates while `pointerType === 'pen'`. Default\n * false. */\n stylusOnly?: boolean;\n}\n\n/**\n * Subscribe to pointer events on a target element (defaults to `window`)\n * and expose the most recent stylus snapshot.\n *\n * The hook does NOT consume pointerdown / pointerup — leave gesture handling\n * to the dispatcher. Re-renders are throttled by default (`maxFps`); pass\n * `maxFps: Infinity` to get every sample.\n */\nexport function usePointerStylus(\n target?: RefObject<HTMLElement | null> | HTMLElement | null,\n options: UsePointerStylusOptions = {},\n): PointerStylusState {\n const { maxFps = 60, stylusOnly = false } = options;\n const [state, setState] = useState<PointerStylusState>(IDLE);\n // Track the last commit time to throttle. A ref avoids re-creating the\n // listener every render and avoids stale-closure read of an outer `let`.\n const lastCommit = useRef(-Infinity);\n const optsRef = useLatest({ maxFps, stylusOnly });\n\n useEffect(() => {\n const el: EventTarget =\n target == null\n ? window\n : target instanceof HTMLElement\n ? target\n : target.current ?? window;\n\n const onMove = (raw: Event) => {\n const e = raw as PointerEvent;\n const { maxFps, stylusOnly } = optsRef.current;\n if (stylusOnly && e.pointerType !== 'pen') return;\n const now = performance.now();\n const minGap = maxFps > 0 && Number.isFinite(maxFps) ? 1000 / maxFps : 0;\n if (minGap > 0 && now - lastCommit.current < minGap) return;\n lastCommit.current = now;\n setState((prev) => ({ ...getStylusData(e), hovering: prev.hovering }));\n };\n const onEnter = (raw: Event) => {\n const e = raw as PointerEvent;\n if (optsRef.current.stylusOnly && e.pointerType !== 'pen') return;\n setState((prev) => ({ ...prev, hovering: true }));\n };\n const onLeave = (raw: Event) => {\n const e = raw as PointerEvent;\n if (optsRef.current.stylusOnly && e.pointerType !== 'pen') return;\n setState((prev) => ({ ...prev, hovering: false }));\n };\n\n el.addEventListener('pointermove', onMove);\n el.addEventListener('pointerenter', onEnter);\n el.addEventListener('pointerleave', onLeave);\n return () => {\n el.removeEventListener('pointermove', onMove);\n el.removeEventListener('pointerenter', onEnter);\n el.removeEventListener('pointerleave', onLeave);\n };\n }, [target, optsRef]);\n\n return state;\n}\n"],"mappings":";;;;AAaA,IAAMA,IAA2B;CAC/B,UAAU;CACV,OAAO;CACP,OAAO;CACP,eAAe,KAAA;CACf,cAAc,KAAA;CACd,OAAO;CACP,aAAa;CACb,UAAU;CACV,UAAU;AACZ;AAqBA,SAAgBC,EACd,GACA,IAAmC,CAAC,GAChB;CACpB,IAAM,EAAE,YAAS,IAAI,gBAAa,OAAUC,GACtC,CAACC,GAAOC,KAAYC,EAA6BL,CAAI,GAGrDM,IAAaC,EAAO,SAAS,GAC7BC,IAAUC,EAAU;EAAE;EAAQ;CAAW,CAAC;CAyChD,OAvCAC,QAAgB;EACd,IAAMC,IACJC,KAAU,OACN,SACAA,aAAkB,cAChBA,IACAA,EAAO,WAAW,QAEpBC,KAAU,MAAe;GAC7B,IAAMC,IAAIC,GACJ,EAAE,WAAQ,kBAAeP,EAAQ;GACvC,IAAIQ,KAAcF,EAAE,gBAAgB,OAAO;GAC3C,IAAMG,IAAM,YAAY,IAAI,GACtBC,IAASC,IAAS,KAAK,OAAO,SAASA,CAAM,IAAI,MAAOA,IAAS;GACvE,AAAID,IAAS,KAAKD,IAAMX,EAAW,UAAUY,MAC7C,EAAW,UAAUD,GACrBb,GAAU,OAAU;IAAE,GAAGgB,EAAcN,CAAC;IAAG,UAAUO,EAAK;GAAS,EAAE;EACvE,GACMC,KAAW,MAAe;GAC9B,IAAMR,IAAIC;GACV,AAAIP,EAAQ,QAAQ,cAAcM,EAAE,gBAAgB,SACpDV,GAAU,OAAU;IAAE,GAAGiB;IAAM,UAAU;GAAK,EAAE;EAClD,GACME,KAAW,MAAe;GAC9B,IAAMT,IAAIC;GACV,AAAIP,EAAQ,QAAQ,cAAcM,EAAE,gBAAgB,SACpDV,GAAU,OAAU;IAAE,GAAGiB;IAAM,UAAU;GAAM,EAAE;EACnD;EAKA,OAHAV,EAAG,iBAAiB,eAAeE,CAAM,GACzCF,EAAG,iBAAiB,gBAAgBW,CAAO,GAC3CX,EAAG,iBAAiB,gBAAgBY,CAAO,SAC9B;GAGX,AAFAZ,EAAG,oBAAoB,eAAeE,CAAM,GAC5CF,EAAG,oBAAoB,gBAAgBW,CAAO,GAC9CX,EAAG,oBAAoB,gBAAgBY,CAAO;EAChD;CACF,GAAG,CAACX,GAAQJ,CAAO,CAAC,GAEbL;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPaintKind as e, listGradientKinds as t, listPaintKinds as n, paintKindRegistry as r } from "./paintKinds.js";
|
|
1
|
+
import { getPaintKind as e, listGradientKinds as t, listPaintKinds as n, paintKindRegistry as r } from "./paint/paintKinds.js";
|
|
2
2
|
import { useCallback as i, useSyncExternalStore as a } from "react";
|
|
3
3
|
//#region src/core/usePaintKinds.ts
|
|
4
4
|
function o() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaintKinds.js","names":["usePaintKinds","useSyncExternalStore","paintKindRegistry","listPaintKinds","useGradientKinds","listGradientKinds","usePaintKind","read","useCallback","getPaintKind","kind"],"sources":["../../src/core/usePaintKinds.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\nimport {\n getPaintKind, listGradientKinds, listPaintKinds, paintKindRegistry
|
|
1
|
+
{"version":3,"file":"usePaintKinds.js","names":["usePaintKinds","useSyncExternalStore","paintKindRegistry","listPaintKinds","useGradientKinds","listGradientKinds","usePaintKind","read","useCallback","getPaintKind","kind"],"sources":["../../src/core/usePaintKinds.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\nimport {\n getPaintKind, listGradientKinds, listPaintKinds, paintKindRegistry,\n} from 'core/paint/paintKinds';\nimport type { PaintKindEntry } from 'core/paint/paintKindEntry';\n\n/** Every registered paint kind, as {@link listPaintKinds} returns it,\n * re-rendering the caller whenever a kind is registered or removed. */\nexport function usePaintKinds(): readonly PaintKindEntry[] {\n return useSyncExternalStore(paintKindRegistry.subscribe, listPaintKinds, listPaintKinds);\n}\n\n/** Every registered gradient kind, as {@link listGradientKinds} returns it,\n * re-rendering the caller whenever a kind is registered or removed. */\nexport function useGradientKinds(): readonly PaintKindEntry[] {\n return useSyncExternalStore(paintKindRegistry.subscribe, listGradientKinds, listGradientKinds);\n}\n\n/**\n * The entry for `kind`, as {@link getPaintKind} returns it — `undefined` until\n * it is registered, and the new entry once it is. A kind with a loader starts\n * loading on the first read.\n */\nexport function usePaintKind(kind: string | undefined): PaintKindEntry | undefined {\n const read = useCallback(() => getPaintKind(kind), [kind]);\n return useSyncExternalStore(paintKindRegistry.subscribe, read, read);\n}\n"],"mappings":";;;AAQA,SAAgBA,IAA2C;CACzD,OAAOC,EAAqBC,EAAkB,WAAWC,GAAgBA,CAAc;AACzF;AAIA,SAAgBC,IAA8C;CAC5D,OAAOH,EAAqBC,EAAkB,WAAWG,GAAmBA,CAAiB;AAC/F;AAOA,SAAgBC,EAAa,GAAsD;CACjF,IAAMC,IAAOC,QAAkBC,EAAaC,CAAI,GAAG,CAACA,CAAI,CAAC;CACzD,OAAOT,EAAqBC,EAAkB,WAAWK,GAAMA,CAAI;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientToWorld.js","names":["clientToWorld","clientX","origin","view","clientY"],"sources":["../../../src/core/viewport/clientToWorld.ts"],"sourcesContent":["/**\n * Convert client coords directly to world coords by subtracting the canvas\n * rect origin and then applying the inverse view transform.\n *\n * This is the composition of `clientToCanvas` + the view-inverse half of\n * `screenToWorld`, but expressed against the `ViewLike` shape used by\n * `SceneCanvas`
|
|
1
|
+
{"version":3,"file":"clientToWorld.js","names":["clientToWorld","clientX","origin","view","clientY"],"sources":["../../../src/core/viewport/clientToWorld.ts"],"sourcesContent":["/**\n * Convert client coords directly to world coords by subtracting the canvas\n * rect origin and then applying the inverse view transform.\n *\n * This is the composition of `clientToCanvas` + the view-inverse half of\n * `screenToWorld`, but expressed against the `ViewLike` shape used by\n * `SceneCanvas` (`{ scale: { x, y }, x, y }`) rather than the\n * `ViewTransform` shape used by `screenToWorld` (`{ panX, panY, zoom }`).\n */\nexport interface ViewLike {\n scale: { x: number; y: number };\n x: number;\n y: number;\n}\n\n/**\n * Map a browser client coord pair to world coords.\n *\n * @param clientX - `event.clientX`\n * @param clientY - `event.clientY`\n * @param origin - client-space origin of the surface `view` is a camera on.\n * For a whole canvas that is its bounding rect. For a viewport node it is\n * the canvas rect offset by the viewport's own rect, so the same call maps\n * into that viewport's inner world.\n * @param view - current viewport transform\n */\nexport function clientToWorld(\n clientX: number,\n clientY: number,\n origin: { left: number; top: number },\n view: ViewLike,\n): [number, number] {\n return [\n (clientX - origin.left) / view.scale.x + view.x,\n (clientY - origin.top) / view.scale.y + view.y,\n ];\n}\n"],"mappings":";AA0BA,SAAgBA,EACd,GACA,GACA,GACA,GACkB;CAClB,OAAO,EACJC,IAAUC,EAAO,QAAQC,EAAK,MAAM,IAAIA,EAAK,IAC7CC,IAAUF,EAAO,OAAOC,EAAK,MAAM,IAAIA,EAAK,CAC/C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fitViewToBounds.js","names":["fitViewToBounds","DEFAULT_MAX_ZOOM","DEFAULT_MIN_ZOOM","opts","bounds","currentView","viewportDims","availW","padding","availH","sx","sy","rawX","rawY","u","scaleX","normalizeZoom","maxScale","minScale","scaleY","place","size","scale","avail","start","viewport"],"sources":["../../../src/core/viewport/fitViewToBounds.ts"],"sourcesContent":["import type { View } from './view';\nimport { DEFAULT_MIN_ZOOM, DEFAULT_MAX_ZOOM, normalizeZoom } from './zoomBounds';\n\
|
|
1
|
+
{"version":3,"file":"fitViewToBounds.js","names":["fitViewToBounds","DEFAULT_MAX_ZOOM","DEFAULT_MIN_ZOOM","opts","bounds","currentView","viewportDims","availW","padding","availH","sx","sy","rawX","rawY","u","scaleX","normalizeZoom","maxScale","minScale","scaleY","place","size","scale","avail","start","viewport"],"sources":["../../../src/core/viewport/fitViewToBounds.ts"],"sourcesContent":["import type { View } from './view';\nimport { DEFAULT_MIN_ZOOM, DEFAULT_MAX_ZOOM, normalizeZoom } from './zoomBounds';\n\nimport type { Bounds } from '@weasel-js/routing';\nexport type { Bounds };\n\n/** Pixel dimensions of the canvas viewport. */\nexport interface ViewportDims {\n width: number;\n height: number;\n}\n\n/** Options for {@link fitViewToBounds}. */\nexport interface FitViewToBoundsOptions {\n /** Inset (in CSS px) around the bounds. Default 16. */\n padding?: number;\n /** Defaults to the kit-wide max zoom (`DEFAULT_MAX_ZOOM`). */\n maxScale?: number;\n /** Defaults to the kit-wide min zoom (`DEFAULT_MIN_ZOOM`). */\n minScale?: number;\n /**\n * Fit mode:\n * - `'contain'` (default): uniform scale = `min(availW/w, availH/h)`. Bounds fit entirely; one axis has letterboxing.\n * - `'fill'`: uniform scale = `max(...)`. Bounds overflow viewport on one axis.\n * - `'stretch'`: per-axis scale. Bounds match viewport exactly; scale is non-uniform.\n */\n mode?: 'contain' | 'fill' | 'stretch';\n /**\n * Where bounds that overflow the viewport on an axis sit, which happens when\n * `minScale` stops the fit or `mode` is `'fill'`. `'center'` (default) shows\n * their middle; `'start'` shows their left or top edge, inset by `padding`.\n * An axis that fits is centered either way.\n */\n anchor?: 'center' | 'start';\n}\n\n/**\n * Compute the target {@link View} that fits `bounds` (world space) inside\n * `viewportDims` (CSS px). The bounds are centered in the viewport with\n * uniform padding on all sides; the resulting scale is clamped to the\n * configured min/max.\n *\n * Empty / zero-sized bounds or viewports cannot be fit — in that case this\n * returns `currentView` unchanged and logs a `console.warn`.\n */\nexport function fitViewToBounds(\n bounds: Bounds,\n viewportDims: ViewportDims,\n currentView: View,\n opts: FitViewToBoundsOptions = {},\n): View {\n const { padding = 16, maxScale = DEFAULT_MAX_ZOOM, minScale = DEFAULT_MIN_ZOOM } = opts;\n\n if (bounds.width <= 0 || bounds.height <= 0) {\n console.warn('[weasel] fitViewToBounds: bounds has zero or negative area; returning currentView unchanged.', bounds);\n return currentView;\n }\n if (viewportDims.width <= 0 || viewportDims.height <= 0) {\n console.warn('[weasel] fitViewToBounds: viewport has zero or negative area; returning currentView unchanged.', viewportDims);\n return currentView;\n }\n\n const availW = Math.max(1, viewportDims.width - padding * 2);\n const availH = Math.max(1, viewportDims.height - padding * 2);\n const sx = availW / bounds.width;\n const sy = availH / bounds.height;\n\n let rawX: number;\n let rawY: number;\n switch (opts.mode ?? 'contain') {\n case 'fill': {\n const u = Math.max(sx, sy);\n rawX = u;\n rawY = u;\n break;\n }\n case 'stretch':\n rawX = sx;\n rawY = sy;\n break;\n case 'contain':\n default: {\n const u = Math.min(sx, sy);\n rawX = u;\n rawY = u;\n break;\n }\n }\n const scaleX = normalizeZoom(Math.min(maxScale, Math.max(minScale, rawX)));\n const scaleY = normalizeZoom(Math.min(maxScale, Math.max(minScale, rawY)));\n\n // screenCenter = (worldCenter - view.x) * scale, solved for view.x.\n const place = (start: number, size: number, avail: number, viewport: number, scale: number) =>\n opts.anchor === 'start' && size * scale > avail + 1e-9\n ? start - padding / scale\n : start + size / 2 - viewport / (2 * scale);\n return {\n x: place(bounds.x, bounds.width, availW, viewportDims.width, scaleX),\n y: place(bounds.y, bounds.height, availH, viewportDims.height, scaleY),\n scale: { x: scaleX, y: scaleY },\n };\n}\n"],"mappings":";;AA6CA,SAAgBA,EACd,GACA,GACA,GACA,IAA+B,CAAC,GAC1B;CACN,IAAM,EAAE,aAAU,IAAI,cAAWC,GAAkB,cAAWC,MAAqBC;CAEnF,IAAIC,EAAO,SAAS,KAAKA,EAAO,UAAU,GAExC,OADA,QAAQ,KAAK,gGAAgGA,CAAM,GAC5GC;CAET,IAAIC,EAAa,SAAS,KAAKA,EAAa,UAAU,GAEpD,OADA,QAAQ,KAAK,kGAAkGA,CAAY,GACpHD;CAGT,IAAME,IAAS,KAAK,IAAI,GAAGD,EAAa,QAAQE,IAAU,CAAC,GACrDC,IAAS,KAAK,IAAI,GAAGH,EAAa,SAASE,IAAU,CAAC,GACtDE,IAAKH,IAASH,EAAO,OACrBO,IAAKF,IAASL,EAAO,QAEvBQ,GACAC;CACJ,QAAQV,EAAK,QAAQ,WAArB;EACE,KAAK,QAAQ;GACX,IAAMW,IAAI,KAAK,IAAIJ,GAAIC,CAAE;GAEzB,AADA,IAAOG,GACP,IAAOA;GACP;EACF;EACA,KAAK;GAEH,AADA,IAAOJ,GACP,IAAOC;GACP;EAEF,SAAS;GACP,IAAMG,IAAI,KAAK,IAAIJ,GAAIC,CAAE;GAEzB,AADA,IAAOG,GACP,IAAOA;GACP;EACF;CACF;CACA,IAAMC,IAASC,EAAc,KAAK,IAAIC,GAAU,KAAK,IAAIC,GAAUN,CAAI,CAAC,CAAC,GACnEO,IAASH,EAAc,KAAK,IAAIC,GAAU,KAAK,IAAIC,GAAUL,CAAI,CAAC,CAAC,GAGnEO,KAAS,GAAe,GAAc,GAAe,GAAkB,MAC3EjB,EAAK,WAAW,WAAWkB,IAAOC,IAAQC,IAAQ,OAC9CC,IAAQhB,IAAUc,IAClBE,IAAQH,IAAO,IAAII,KAAY,IAAIH;CACzC,OAAO;EACL,GAAGF,EAAMhB,EAAO,GAAGA,EAAO,OAAOG,GAAQD,EAAa,OAAOS,CAAM;EACnE,GAAGK,EAAMhB,EAAO,GAAGA,EAAO,QAAQK,GAAQH,EAAa,QAAQa,CAAM;EACrE,OAAO;GAAE,GAAGJ;GAAQ,GAAGI;EAAO;CAChC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallax.js","names":["asXY","v","deriveParallaxView","p","opts","z","outer","planeMap","inner","kx","ky","toPlane","m","fromPlane","mapRect","a","map","r","b","rectToPlane","rectFromPlane","planeToPlane","from","to","f","IDENTITY_MAP","t","sx","sy","planeMatrix"],"sources":["../../../src/core/viewport/parallax.ts"],"sourcesContent":["import type { View } from './view';\n\n/** One value for both axes, or a separate value per axis. */\nexport type ScalarOrXY = number | { x: number; y: number };\n\n/** How a parallax plane tracks the camera: `pan` is the fraction of the\n * camera's translation it follows (1 = locked to the scene, 0 = fixed to the\n * screen), `zoom` the same for scale, and `anchor` the camera position\n * (`view.x` / `view.y`) the translation is measured from — every plane lines\n * up when the camera sits there. */\nexport interface ParallaxOpts {\n pan: ScalarOrXY;\n zoom?: ScalarOrXY;\n anchor?: { x: number; y: number };\n}\n\nfunction asXY(v: ScalarOrXY): { x: number; y: number } {\n return typeof v === 'number' ? { x: v, y: v } : v;\n}\n\n/**\n * Pure derivation of a parallax plane's inner `View` from the camera view\n * plus per-plane factors.\n *\n * `pan` controls how much the plane translates with the camera (1 = normal,\n * 0 = locked to `anchor`, >1 = leads). `zoom` controls how much it scales\n * with camera zoom (1 = normal, 0 = fixed at identity scale). `anchor`\n * (default origin) is the camera position at which all planes agree.\n *\n * Identity holds: `pan=1, zoom=1` returns a view equal to `outer`.\n */\nexport function deriveParallaxView(outer: View, opts: ParallaxOpts): View {\n const p = asXY(opts.pan);\n const z = asXY(opts.zoom ?? 1);\n const a = opts.anchor ?? { x: 0, y: 0 };\n return {\n x: a.x + (outer.x - a.x) * p.x,\n y: a.y + (outer.y - a.y) * p.y,\n scale: {\n x: 1 + (outer.scale.x - 1) * z.x,\n y: 1 + (outer.scale.y - 1) * z.y,\n },\n };\n}\n\n/** How a point of the camera's world lands in a plane's world, per axis:\n * `plane = world * scale + offset`. A plane draws its content through its\n * own view; this is what lets a pointer, a marquee or a selection box cross\n * between that view and the camera's. */\nexport interface PlaneMap {\n scale: { x: number; y: number };\n offset: { x: number; y: number };\n}\n\n/** The map from `outer`'s world into the world of a plane drawn through\n * `deriveParallaxView(outer, opts)` — the one that puts both points under the\n * same pixel. */\nexport function planeMap(outer: View, opts: ParallaxOpts): PlaneMap {\n const inner = deriveParallaxView(outer, opts);\n const kx = outer.scale.x / inner.scale.x;\n const ky = outer.scale.y / inner.scale.y;\n return {\n scale: { x: kx, y: ky },\n offset: { x: inner.x - kx * outer.x, y: inner.y - ky * outer.y },\n };\n}\n\n/** Map a point from the outer view's world into the plane's world. */\nexport function toPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: p.x * m.scale.x + m.offset.x, y: p.y * m.scale.y + m.offset.y };\n}\n\n/** Map a point from the plane's world back into the outer view's world. */\nexport function fromPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: (p.x - m.offset.x) / m.scale.x, y: (p.y - m.offset.y) / m.scale.y };\n}\n\
|
|
1
|
+
{"version":3,"file":"parallax.js","names":["asXY","v","deriveParallaxView","p","opts","z","outer","planeMap","inner","kx","ky","toPlane","m","fromPlane","mapRect","a","map","r","b","rectToPlane","rectFromPlane","planeToPlane","from","to","f","IDENTITY_MAP","t","sx","sy","planeMatrix"],"sources":["../../../src/core/viewport/parallax.ts"],"sourcesContent":["import type { Rect } from '@weasel-js/geom';\nimport type { View } from './view';\n\n/** One value for both axes, or a separate value per axis. */\nexport type ScalarOrXY = number | { x: number; y: number };\n\n/** How a parallax plane tracks the camera: `pan` is the fraction of the\n * camera's translation it follows (1 = locked to the scene, 0 = fixed to the\n * screen), `zoom` the same for scale, and `anchor` the camera position\n * (`view.x` / `view.y`) the translation is measured from — every plane lines\n * up when the camera sits there. */\nexport interface ParallaxOpts {\n pan: ScalarOrXY;\n zoom?: ScalarOrXY;\n anchor?: { x: number; y: number };\n}\n\nfunction asXY(v: ScalarOrXY): { x: number; y: number } {\n return typeof v === 'number' ? { x: v, y: v } : v;\n}\n\n/**\n * Pure derivation of a parallax plane's inner `View` from the camera view\n * plus per-plane factors.\n *\n * `pan` controls how much the plane translates with the camera (1 = normal,\n * 0 = locked to `anchor`, >1 = leads). `zoom` controls how much it scales\n * with camera zoom (1 = normal, 0 = fixed at identity scale). `anchor`\n * (default origin) is the camera position at which all planes agree.\n *\n * Identity holds: `pan=1, zoom=1` returns a view equal to `outer`.\n */\nexport function deriveParallaxView(outer: View, opts: ParallaxOpts): View {\n const p = asXY(opts.pan);\n const z = asXY(opts.zoom ?? 1);\n const a = opts.anchor ?? { x: 0, y: 0 };\n return {\n x: a.x + (outer.x - a.x) * p.x,\n y: a.y + (outer.y - a.y) * p.y,\n scale: {\n x: 1 + (outer.scale.x - 1) * z.x,\n y: 1 + (outer.scale.y - 1) * z.y,\n },\n };\n}\n\n/** How a point of the camera's world lands in a plane's world, per axis:\n * `plane = world * scale + offset`. A plane draws its content through its\n * own view; this is what lets a pointer, a marquee or a selection box cross\n * between that view and the camera's. */\nexport interface PlaneMap {\n scale: { x: number; y: number };\n offset: { x: number; y: number };\n}\n\n/** The map from `outer`'s world into the world of a plane drawn through\n * `deriveParallaxView(outer, opts)` — the one that puts both points under the\n * same pixel. */\nexport function planeMap(outer: View, opts: ParallaxOpts): PlaneMap {\n const inner = deriveParallaxView(outer, opts);\n const kx = outer.scale.x / inner.scale.x;\n const ky = outer.scale.y / inner.scale.y;\n return {\n scale: { x: kx, y: ky },\n offset: { x: inner.x - kx * outer.x, y: inner.y - ky * outer.y },\n };\n}\n\n/** Map a point from the outer view's world into the plane's world. */\nexport function toPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: p.x * m.scale.x + m.offset.x, y: p.y * m.scale.y + m.offset.y };\n}\n\n/** Map a point from the plane's world back into the outer view's world. */\nexport function fromPlane(m: PlaneMap, p: { x: number; y: number }): { x: number; y: number } {\n return { x: (p.x - m.offset.x) / m.scale.x, y: (p.y - m.offset.y) / m.scale.y };\n}\n\nfunction mapRect(r: Rect, map: (p: { x: number; y: number }) => { x: number; y: number }): Rect {\n const a = map({ x: r.x, y: r.y });\n const b = map({ x: r.x + r.width, y: r.y + r.height });\n return {\n x: Math.min(a.x, b.x),\n y: Math.min(a.y, b.y),\n width: Math.abs(b.x - a.x),\n height: Math.abs(b.y - a.y),\n };\n}\n\n/** A camera-world rect in the plane's world. The map is axis-aligned, so a\n * rect stays a rect; a flipped axis is normalized back to a positive size. */\nexport function rectToPlane<R extends Rect>(m: PlaneMap, r: R): R {\n return { ...r, ...mapRect(r, (p) => toPlane(m, p)) };\n}\n\n/** A plane-world rect in the camera's world — see {@link rectToPlane}. */\nexport function rectFromPlane<R extends Rect>(m: PlaneMap, r: R): R {\n return { ...r, ...mapRect(r, (p) => fromPlane(m, p)) };\n}\n\n/** The map from one world into another, where `null` is the camera's own:\n * `fromPlane(from)`, then `toPlane(to)`. Null when the two are the same\n * world, so a caller can skip the work. */\nexport function planeToPlane(from: PlaneMap | null, to: PlaneMap | null): PlaneMap | null {\n if (from === to) return null;\n const f = from ?? IDENTITY_MAP;\n const t = to ?? IDENTITY_MAP;\n const sx = t.scale.x / f.scale.x;\n const sy = t.scale.y / f.scale.y;\n const m = {\n scale: { x: sx, y: sy },\n offset: { x: t.offset.x - f.offset.x * sx, y: t.offset.y - f.offset.y * sy },\n };\n return m.scale.x === 1 && m.scale.y === 1 && m.offset.x === 0 && m.offset.y === 0 ? null : m;\n}\n\nconst IDENTITY_MAP: PlaneMap = { scale: { x: 1, y: 1 }, offset: { x: 0, y: 0 } };\n\n/** The map as an affine matrix in `@weasel-js/geom`'s `[a, b, c, d, e, f]`\n * order, for `transformPath` and friends. */\nexport function planeMatrix(m: PlaneMap): [number, number, number, number, number, number] {\n return [m.scale.x, 0, 0, m.scale.y, m.offset.x, m.offset.y];\n}\n"],"mappings":";AAiBA,SAASA,EAAK,GAAyC;CACrD,OAAO,OAAOC,KAAM,WAAW;EAAE,GAAGA;EAAG,GAAGA;CAAE,IAAIA;AAClD;AAaA,SAAgBC,EAAmB,GAAa,GAA0B;CACxE,IAAMC,IAAIH,EAAKI,EAAK,GAAG,GACjBC,IAAIL,EAAKI,EAAK,QAAQ,CAAC,GACvB,IAAIA,EAAK,UAAU;EAAE,GAAG;EAAG,GAAG;CAAE;CACtC,OAAO;EACL,GAAG,EAAE,KAAKE,EAAM,IAAI,EAAE,KAAKH,EAAE;EAC7B,GAAG,EAAE,KAAKG,EAAM,IAAI,EAAE,KAAKH,EAAE;EAC7B,OAAO;GACL,GAAG,KAAKG,EAAM,MAAM,IAAI,KAAKD,EAAE;GAC/B,GAAG,KAAKC,EAAM,MAAM,IAAI,KAAKD,EAAE;EACjC;CACF;AACF;AAcA,SAAgBE,EAAS,GAAa,GAA8B;CAClE,IAAMC,IAAQN,EAAmBI,GAAOF,CAAI,GACtCK,IAAKH,EAAM,MAAM,IAAIE,EAAM,MAAM,GACjCE,IAAKJ,EAAM,MAAM,IAAIE,EAAM,MAAM;CACvC,OAAO;EACL,OAAO;GAAE,GAAGC;GAAI,GAAGC;EAAG;EACtB,QAAQ;GAAE,GAAGF,EAAM,IAAIC,IAAKH,EAAM;GAAG,GAAGE,EAAM,IAAIE,IAAKJ,EAAM;EAAE;CACjE;AACF;AAGA,SAAgBK,EAAQ,GAAa,GAAuD;CAC1F,OAAO;EAAE,GAAGR,EAAE,IAAIS,EAAE,MAAM,IAAIA,EAAE,OAAO;EAAG,GAAGT,EAAE,IAAIS,EAAE,MAAM,IAAIA,EAAE,OAAO;CAAE;AAC5E;AAGA,SAAgBC,EAAU,GAAa,GAAuD;CAC5F,OAAO;EAAE,IAAIV,EAAE,IAAIS,EAAE,OAAO,KAAKA,EAAE,MAAM;EAAG,IAAIT,EAAE,IAAIS,EAAE,OAAO,KAAKA,EAAE,MAAM;CAAE;AAChF;AAEA,SAASE,EAAQ,GAAS,GAAsE;CAC9F,IAAMC,IAAIC,EAAI;EAAE,GAAGC,EAAE;EAAG,GAAGA,EAAE;CAAE,CAAC,GAC1BC,IAAIF,EAAI;EAAE,GAAGC,EAAE,IAAIA,EAAE;EAAO,GAAGA,EAAE,IAAIA,EAAE;CAAO,CAAC;CACrD,OAAO;EACL,GAAG,KAAK,IAAIF,EAAE,GAAGG,EAAE,CAAC;EACpB,GAAG,KAAK,IAAIH,EAAE,GAAGG,EAAE,CAAC;EACpB,OAAO,KAAK,IAAIA,EAAE,IAAIH,EAAE,CAAC;EACzB,QAAQ,KAAK,IAAIG,EAAE,IAAIH,EAAE,CAAC;CAC5B;AACF;AAIA,SAAgBI,EAA4B,GAAa,GAAS;CAChE,OAAO;EAAE,GAAGF;EAAG,GAAGH,EAAQG,IAAI,MAAMN,EAAQC,GAAGT,CAAC,CAAC;CAAE;AACrD;AAGA,SAAgBiB,EAA8B,GAAa,GAAS;CAClE,OAAO;EAAE,GAAGH;EAAG,GAAGH,EAAQG,IAAI,MAAMJ,EAAUD,GAAGT,CAAC,CAAC;CAAE;AACvD;AAKA,SAAgBkB,EAAa,GAAuB,GAAsC;CACxF,IAAIC,MAASC,GAAI,OAAO;CACxB,IAAMC,IAAIF,KAAQG,GACZC,IAAIH,KAAME,GACVE,IAAKD,EAAE,MAAM,IAAIF,EAAE,MAAM,GACzBI,IAAKF,EAAE,MAAM,IAAIF,EAAE,MAAM,GACzBZ,IAAI;EACR,OAAO;GAAE,GAAGe;GAAI,GAAGC;EAAG;EACtB,QAAQ;GAAE,GAAGF,EAAE,OAAO,IAAIF,EAAE,OAAO,IAAIG;GAAI,GAAGD,EAAE,OAAO,IAAIF,EAAE,OAAO,IAAII;EAAG;CAC7E;CACA,OAAOhB,EAAE,MAAM,MAAM,KAAKA,EAAE,MAAM,MAAM,KAAKA,EAAE,OAAO,MAAM,KAAKA,EAAE,OAAO,MAAM,IAAI,OAAOA;AAC7F;AAEA,IAAMa,IAAyB;CAAE,OAAO;EAAE,GAAG;EAAG,GAAG;CAAE;CAAG,QAAQ;EAAE,GAAG;EAAG,GAAG;CAAE;AAAE;AAI/E,SAAgBI,EAAY,GAA+D;CACzF,OAAO;EAACjB,EAAE,MAAM;EAAG;EAAG;EAAGA,EAAE,MAAM;EAAGA,EAAE,OAAO;EAAGA,EAAE,OAAO;CAAC;AAC5D"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { multiply as e,
|
|
1
|
+
import { multiply as e, scale as t } from "@weasel-js/geom";
|
|
2
2
|
//#region src/core/viewport/screenSlop.ts
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
if (n === void 0) return {
|
|
5
5
|
extra: 0,
|
|
6
6
|
opts: {}
|
|
7
7
|
};
|
|
8
|
-
if (typeof
|
|
9
|
-
extra:
|
|
8
|
+
if (typeof n == "number") return {
|
|
9
|
+
extra: n,
|
|
10
10
|
opts: {}
|
|
11
11
|
};
|
|
12
|
-
let
|
|
12
|
+
let i = t(n.scale.x, n.scale.y);
|
|
13
13
|
return {
|
|
14
14
|
extra: 0,
|
|
15
15
|
opts: { slop: {
|
|
16
|
-
px:
|
|
17
|
-
transform:
|
|
16
|
+
px: n.px,
|
|
17
|
+
transform: r ? e(i, r) : i
|
|
18
18
|
} }
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function r(e, t, n = 1) {
|
|
22
22
|
return t > 0 ? typeof e == "object" ? {
|
|
23
23
|
...e,
|
|
24
24
|
px: e.px + t
|
|
25
25
|
} : (e ?? 0) + t / (n > 0 ? n : 1) : e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function i(e) {
|
|
28
28
|
return e === void 0 ? !1 : typeof e == "number" ? e > 0 : e.px > 0;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export {
|
|
31
|
+
export { i as hasSlop, n as slopForStrokeHit, r as widenSlop };
|
|
32
32
|
|
|
33
33
|
//# sourceMappingURL=screenSlop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSlop.js","names":["scaleMat","slopForStrokeHit","slop","s","scale","
|
|
1
|
+
{"version":3,"file":"screenSlop.js","names":["scaleMat","slopForStrokeHit","slop","s","scale","frame","multiply","widenSlop","px","hasSlop"],"sources":["../../../src/core/viewport/screenSlop.ts"],"sourcesContent":["/**\n * Pointer forgiveness measured on screen.\n *\n * A pick slop is a screen distance: \"within 4px of the outline\". Converting it\n * to a world distance — per axis or as one scalar — is exact only when the\n * frame the geometry lives in reaches the screen by a similarity. A rotated\n * node under non-uniform zoom does not: a screen circle pulled back into its\n * frame is a tilted ellipse, so the test is run against the geometry's screen\n * image instead (`strokeHitTest`'s `slop`).\n */\nimport { multiply, scale as scaleMat, type Affine } from '@weasel-js/geom';\nimport type { Scale2 } from '@weasel-js/geom';\n\n/** `px` screen pixels under a view whose per-axis scale is `scale`. */\nexport interface ScreenSlop {\n px: number;\n scale: Scale2;\n}\n\n/** A slop in world units (a number, the view-less form) or on screen. */\nexport type PickSlop = number | ScreenSlop;\n\n/**\n * How `strokeHitTest` should apply a slop to geometry in a frame that\n * reaches world by `frame` (`poseFrameOf`; only its linear part is read): a\n * world slop adds to the threshold, a screen slop is handed over with the\n * frame's map to the screen.\n */\nexport function slopForStrokeHit(\n slop: PickSlop | undefined,\n frame?: Affine | null,\n): { extra: number; opts: { slop?: { px: number; transform: Affine } } } {\n if (slop === undefined) return { extra: 0, opts: {} };\n if (typeof slop === 'number') return { extra: slop, opts: {} };\n const s = scaleMat(slop.scale.x, slop.scale.y);\n return {\n extra: 0,\n opts: { slop: { px: slop.px, transform: frame ? multiply(s, frame) : s } },\n };\n}\n\n/** `slop` widened by `px` screen pixels — kept on screen when it is measured\n * there, and read at `scale` when it is a world distance. */\nexport function widenSlop(slop: PickSlop | undefined, px: number, scale = 1): PickSlop | undefined {\n if (!(px > 0)) return slop;\n if (typeof slop === 'object') return { ...slop, px: slop.px + px };\n return (slop ?? 0) + px / (scale > 0 ? scale : 1);\n}\n\n/** Is any slop set at all? A zero reach plus a zero slop hits nothing. */\nexport function hasSlop(slop: PickSlop | undefined): boolean {\n if (slop === undefined) return false;\n return typeof slop === 'number' ? slop > 0 : slop.px > 0;\n}\n"],"mappings":";;AA4BA,SAAgBC,EACd,GACA,GACuE;CACvE,IAAIC,MAAS,KAAA,GAAW,OAAO;EAAE,OAAO;EAAG,MAAM,CAAC;CAAE;CACpD,IAAI,OAAOA,KAAS,UAAU,OAAO;EAAE,OAAOA;EAAM,MAAM,CAAC;CAAE;CAC7D,IAAMC,IAAIH,EAASE,EAAK,MAAM,GAAGA,EAAK,MAAM,CAAC;CAC7C,OAAO;EACL,OAAO;EACP,MAAM,EAAE,MAAM;GAAE,IAAIA,EAAK;GAAI,WAAWG,IAAQC,EAASH,GAAGE,CAAK,IAAIF;EAAE,EAAE;CAC3E;AACF;AAIA,SAAgBI,EAAU,GAA4B,GAAY,IAAQ,GAAyB;CAGjG,OAFMC,IAAK,IACP,OAAON,KAAS,WAAiB;EAAE,GAAGA;EAAM,IAAIA,EAAK,KAAKM;CAAG,KACzDN,KAAQ,KAAKM,KAAMJ,IAAQ,IAAIA,IAAQ,KAFzBF;AAGxB;AAGA,SAAgBO,EAAQ,GAAqC;CAE3D,OADIP,MAAS,KAAA,IAAkB,KACxB,OAAOA,KAAS,WAAWA,IAAO,IAAIA,EAAK,KAAK;AACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasSize.js","names":["useCanvasSize","useDeviceProfile","size","setSize","useState","measure","useCallback","containerRef","rect","prev","useEffect","observer"],"sources":["../../../src/core/viewport/useCanvasSize.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useState } from 'react';\nimport type { CanvasSize } from './clampView';\nimport { useDeviceProfile } from '../device/useDeviceProfile';\n\n/** Size snapshot returned by `useCanvasSize` — the kit-wide `CanvasSize`\n * (width × height in CSS pixels) plus the current devicePixelRatio. */\nexport interface CanvasSizeSnapshot extends CanvasSize {\n dpr: number;\n}\n\n/** Track a container's content-rect size via `ResizeObserver`, and density via\n * the ambient `DeviceProfile`.\n *\n *
|
|
1
|
+
{"version":3,"file":"useCanvasSize.js","names":["useCanvasSize","useDeviceProfile","size","setSize","useState","measure","useCallback","containerRef","rect","prev","useEffect","observer"],"sources":["../../../src/core/viewport/useCanvasSize.ts"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useState } from 'react';\nimport type { CanvasSize } from './clampView';\nimport { useDeviceProfile } from '../device/useDeviceProfile';\n\n/** Size snapshot returned by `useCanvasSize` — the kit-wide `CanvasSize`\n * (width × height in CSS pixels) plus the current devicePixelRatio. */\nexport interface CanvasSizeSnapshot extends CanvasSize {\n dpr: number;\n}\n\n/** Track a container's content-rect size via `ResizeObserver`, and density via\n * the ambient `DeviceProfile`.\n *\n * Density deliberately does NOT come from a `window.devicePixelRatio` read\n * inside the resize callback: that only refreshes when the element resizes,\n * so dragging a window to a different-density display without resizing it\n * leaves the snapshot stale. */\nexport function useCanvasSize(containerRef: RefObject<HTMLElement | null>): CanvasSizeSnapshot {\n const { dpr } = useDeviceProfile();\n const [size, setSize] = useState<CanvasSize>({ width: 0, height: 0 });\n\n const measure = useCallback(() => {\n if (!containerRef.current) return;\n const rect = containerRef.current.getBoundingClientRect();\n setSize((prev) =>\n prev.width === rect.width && prev.height === rect.height\n ? prev\n : { width: rect.width, height: rect.height },\n );\n }, [containerRef]);\n\n useEffect(() => {\n measure();\n const observer = new ResizeObserver(measure);\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n return () => observer.disconnect();\n }, [measure, containerRef]);\n\n return { width: size.width, height: size.height, dpr };\n}\n"],"mappings":";;;AAiBA,SAAgBA,EAAc,GAAiE;CAC7F,IAAM,EAAE,WAAQC,EAAiB,GAC3B,CAACC,GAAMC,KAAWC,EAAqB;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC,GAE9DC,IAAUC,QAAkB;EAChC,IAAI,CAACC,EAAa,SAAS;EAC3B,IAAMC,IAAOD,EAAa,QAAQ,sBAAsB;EACxD,GAAS,MACPE,EAAK,UAAUD,EAAK,SAASC,EAAK,WAAWD,EAAK,SAC9CC,IACA;GAAE,OAAOD,EAAK;GAAO,QAAQA,EAAK;EAAO,CAC/C;CACF,GAAG,CAACD,CAAY,CAAC;CAWjB,OATAG,QAAgB;EACd,EAAQ;EACR,IAAMC,IAAW,IAAI,eAAeN,CAAO;EAI3C,OAHIE,EAAa,WACfI,EAAS,QAAQJ,EAAa,OAAO,SAE1BI,EAAS,WAAW;CACnC,GAAG,CAACN,GAASE,CAAY,CAAC,GAEnB;EAAE,OAAOL,EAAK;EAAO,QAAQA,EAAK;EAAQ;CAAI;AACvD"}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
|
+
import { useVisibleRaf as r } from "@weasel-js/react";
|
|
3
3
|
//#region src/core/viewport/useDecayLoop.ts
|
|
4
4
|
var i = .5;
|
|
5
5
|
function a() {
|
|
6
|
-
let a =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o.cancel(), a.current = null;
|
|
12
|
-
}, [o]), c = t((e) => {
|
|
13
|
-
let t = a.current;
|
|
14
|
-
if (!t) return;
|
|
15
|
-
if (t.lastTime === null) {
|
|
16
|
-
t.lastTime = e, o.request();
|
|
6
|
+
let a = n(null), o = e((e, t) => {
|
|
7
|
+
let n = a.current;
|
|
8
|
+
if (!n) return;
|
|
9
|
+
if (n.lastTime === null) {
|
|
10
|
+
n.lastTime = e, t.request();
|
|
17
11
|
return;
|
|
18
12
|
}
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
if (
|
|
23
|
-
a.current = null,
|
|
13
|
+
let r = Math.min(e - n.lastTime, 64);
|
|
14
|
+
n.lastTime = e;
|
|
15
|
+
let o = n.friction ** (r / 16.67);
|
|
16
|
+
if (n.vx *= o, n.vy *= o, Math.sqrt(n.vx * n.vx + n.vy * n.vy) < n.minSpeed) {
|
|
17
|
+
a.current = null, t.cancel(), n.onEnd?.();
|
|
24
18
|
return;
|
|
25
19
|
}
|
|
26
|
-
let s =
|
|
27
|
-
if (
|
|
28
|
-
let { minX: e, maxX:
|
|
29
|
-
|
|
20
|
+
let s = n.vx * r, c = n.vy * r;
|
|
21
|
+
if (n.viewBounds && n.boundary) {
|
|
22
|
+
let { minX: e, maxX: t, minY: r, maxY: a } = n.viewBounds, o = n.posX + s, l = n.posY + c;
|
|
23
|
+
n.boundary === "stop" ? (e !== void 0 && o < e ? (s = e - n.posX, n.vx = 0) : t !== void 0 && o > t && (s = t - n.posX, n.vx = 0), r !== void 0 && l < r ? (c = r - n.posY, n.vy = 0) : a !== void 0 && l > a && (c = a - n.posY, n.vy = 0)) : n.boundary === "spring" ? (e !== void 0 && o < e ? (s = e - n.posX, n.vx = Math.abs(n.vx) * i) : t !== void 0 && o > t && (s = t - n.posX, n.vx = -Math.abs(n.vx) * i), r !== void 0 && l < r ? (c = r - n.posY, n.vy = Math.abs(n.vy) * i) : a !== void 0 && l > a && (c = a - n.posY, n.vy = -Math.abs(n.vy) * i)) : (e !== void 0 && o < e ? (s = e - n.posX, n.vx = Math.abs(n.vx)) : t !== void 0 && o > t && (s = t - n.posX, n.vx = -Math.abs(n.vx)), r !== void 0 && l < r ? (c = r - n.posY, n.vy = Math.abs(n.vy)) : a !== void 0 && l > a && (c = a - n.posY, n.vy = -Math.abs(n.vy))), n.posX += s, n.posY += c;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
n.onTick(s, c), t.request();
|
|
26
|
+
}, []), s = r(o, { onResume: e(() => {
|
|
27
|
+
a.current && (a.current.lastTime = null);
|
|
28
|
+
}, []) }), c = e(() => {
|
|
29
|
+
s.cancel(), a.current = null;
|
|
30
|
+
}, [s]), l = e((e) => {
|
|
31
|
+
c();
|
|
32
|
+
let { velocity: t, friction: n = .92, minSpeed: r = .01, viewBounds: i, boundary: o, initialPosition: l, onTick: u, onEnd: d } = e;
|
|
35
33
|
if (Math.sqrt(t.vx ** 2 + t.vy ** 2) < r) {
|
|
36
34
|
d?.();
|
|
37
35
|
return;
|
|
@@ -45,16 +43,16 @@ function a() {
|
|
|
45
43
|
posX: l?.x ?? 0,
|
|
46
44
|
posY: l?.y ?? 0,
|
|
47
45
|
viewBounds: i,
|
|
48
|
-
boundary:
|
|
46
|
+
boundary: o,
|
|
49
47
|
onTick: u,
|
|
50
48
|
onEnd: d
|
|
51
|
-
},
|
|
52
|
-
}, [
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
}, [
|
|
49
|
+
}, s.request();
|
|
50
|
+
}, [c, s]);
|
|
51
|
+
return t(() => () => {
|
|
52
|
+
c();
|
|
53
|
+
}, [c]), {
|
|
56
54
|
start: l,
|
|
57
|
-
cancel:
|
|
55
|
+
cancel: c
|
|
58
56
|
};
|
|
59
57
|
}
|
|
60
58
|
//#endregion
|