@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNodeAtPoint.js","names":["makeGetNodeAtPoint","id","pickBest","wx","wy","view","
|
|
1
|
+
{"version":3,"file":"getNodeAtPoint.js","names":["makeGetNodeAtPoint","id","pickBest","wx","wy","view","nodeResolver"],"sources":["../../src/canvas/getNodeAtPoint.ts"],"sourcesContent":["import type { PickView } from './SceneCanvas/useSceneSelectTool';\n\n/** The hit record returned by a `getNodeAtPoint` function. */\nexport interface NodeAtPointHit {\n id: string;\n kind: string;\n}\n\n/** Resolves a node's routing kind. */\nexport type NodeResolver = (id: string) => { kind: string } | null;\n\n/** The node a single-hit picker names under a world point, with its kind:\n * `'unknown'` when `nodeResolver` is absent or returns null. */\nexport function makeGetNodeAtPoint(\n pickBest: (wx: number, wy: number, view?: PickView | null) => string | null,\n nodeResolver?: NodeResolver,\n): (wx: number, wy: number, view?: PickView | null) => NodeAtPointHit | null {\n return (wx: number, wy: number, view?: PickView | null): NodeAtPointHit | null => {\n const id = pickBest(wx, wy, view);\n if (id == null) return null;\n\n return { id, kind: nodeResolver?.(id)?.kind ?? 'unknown' };\n };\n}\n"],"mappings":";AAaA,SAAgBA,EACd,GACA,GAC2E;CAC3E,QAAQ,GAAY,GAAY,MAAkD;EAChF,IAAMC,IAAKC,EAASC,GAAIC,GAAIC,CAAI;EAGhC,OAFIJ,KAAM,OAAa,OAEhB;GAAE;GAAI,MAAMK,IAAeL,CAAE,CAAC,EAAE,QAAQ;EAAU;CAC3D;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hud.module.js","names":["hud","sized","readings","muted","absent","header","list","item","itemBest","row","stack","hud_module_default"],"sources":["../../src/canvas/hud.module.css"],"sourcesContent":["/* The debug HUDs <Canvas> can draw: CursorCoordsHud, PickHud, ModalityHud. The\n mono face is for the ids the pick and modality HUDs list; figures take the\n numeric face, on a child so `.hud`'s own font cannot override it. */\n.hud {\n position: fixed;\n z-index: 900;\n background: rgba(0, 0, 0, 0.7);\n color: #e8e8e8;\n font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;\n padding: 6px 8px;\n border-radius: 4px;\n pointer-events: none;\n line-height: 1.4;\n text-align: right;\n}\n\n.sized {\n min-width: 120px;\n max-width: 260px;\n}\n\n.readings {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 8px;\n margin: 0;\n}\n\n.readings dt {\n text-align: left;\n}\n\n.readings dd {\n margin: 0;\n white-space: nowrap;\n}\n\n.muted {\n color: #888;\n}\n\n/* A value that is not there: an em dash, \"off-canvas\". */\n.absent {\n color: #888;\n font-style: italic;\n}\n\n.header {\n margin-bottom: 2px;\n}\n\n.list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n.item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.itemBest {\n font-weight: 700;\n}\n\n.row {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n white-space: nowrap;\n}\n\n.stack {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"hud.module.js","names":["hud","sized","readings","muted","absent","header","list","item","itemBest","row","stack","hud_module_default"],"sources":["../../src/canvas/hud.module.css"],"sourcesContent":["/* The debug HUDs <Canvas> can draw: CursorCoordsHud, PickHud, ModalityHud. The\n mono face is for the ids the pick and modality HUDs list; figures take the\n numeric face, on a child so `.hud`'s own font cannot override it. */\n.hud {\n position: fixed;\n z-index: var(--wzl-z-hud, 900);\n background: rgba(0, 0, 0, 0.7);\n color: #e8e8e8;\n font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;\n padding: var(--wzl-space-3, 6px) var(--wzl-space-4, 8px);\n border-radius: 4px;\n pointer-events: none;\n line-height: 1.4;\n text-align: right;\n}\n\n.sized {\n min-width: 120px;\n max-width: 260px;\n}\n\n.readings {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n display: grid;\n grid-template-columns: auto auto;\n column-gap: var(--wzl-space-4, 8px);\n margin: 0;\n}\n\n.readings dt {\n text-align: left;\n}\n\n.readings dd {\n margin: 0;\n white-space: nowrap;\n}\n\n.muted {\n color: #888;\n}\n\n/* A value that is not there: an em dash, \"off-canvas\". */\n.absent {\n color: #888;\n font-style: italic;\n}\n\n.header {\n margin-bottom: var(--wzl-space-1, 2px);\n}\n\n.list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n.item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.itemBest {\n font-weight: 700;\n}\n\n.row {\n display: flex;\n gap: var(--wzl-space-4, 8px);\n justify-content: flex-end;\n white-space: nowrap;\n}\n\n.stack {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { boundsOfPath as e, regularPolygonPath as t, starPath as n } from "@weasel-js/geom";
|
|
1
2
|
//#region src/canvas/insertPreviewExtent.ts
|
|
2
|
-
function
|
|
3
|
-
let r = e.bounds,
|
|
3
|
+
function r(e) {
|
|
4
|
+
let r = e.bounds, o = {
|
|
4
5
|
x: r.x,
|
|
5
6
|
y: r.y,
|
|
6
7
|
width: r.width,
|
|
@@ -8,55 +9,55 @@ function e(e) {
|
|
|
8
9
|
};
|
|
9
10
|
switch (e.shape) {
|
|
10
11
|
case "line": {
|
|
11
|
-
let t = e.extras,
|
|
12
|
+
let t = e.extras, n = t.a ?? {
|
|
12
13
|
x: r.x,
|
|
13
14
|
y: r.y
|
|
14
|
-
},
|
|
15
|
+
}, i = t.b ?? {
|
|
15
16
|
x: r.x + r.width,
|
|
16
17
|
y: r.y + r.height
|
|
17
18
|
};
|
|
18
19
|
return {
|
|
19
20
|
shape: e.shape,
|
|
20
|
-
bounds:
|
|
21
|
+
bounds: a([n, i]) ?? o,
|
|
21
22
|
geometry: {
|
|
22
23
|
kind: "line",
|
|
23
|
-
a,
|
|
24
|
-
b:
|
|
24
|
+
a: n,
|
|
25
|
+
b: i
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
case "polygon": {
|
|
29
|
-
let n = e.extras,
|
|
30
|
+
let n = e.extras, a = n.center ?? {
|
|
30
31
|
x: r.x + r.width / 2,
|
|
31
32
|
y: r.y + r.height / 2
|
|
32
|
-
},
|
|
33
|
+
}, o = n.radius ?? Math.min(r.width, r.height) / 2, s = Math.max(3, Math.floor(n.sides ?? 6)), c = n.rotation ?? 0;
|
|
33
34
|
return {
|
|
34
35
|
shape: e.shape,
|
|
35
|
-
bounds: t(
|
|
36
|
+
bounds: i(t(a, o, s, c)),
|
|
36
37
|
geometry: {
|
|
37
38
|
kind: "polygon",
|
|
38
|
-
center:
|
|
39
|
-
radius:
|
|
40
|
-
sides:
|
|
41
|
-
rotation:
|
|
39
|
+
center: a,
|
|
40
|
+
radius: o,
|
|
41
|
+
sides: s,
|
|
42
|
+
rotation: c
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
case "star": {
|
|
46
|
-
let
|
|
47
|
+
let t = e.extras, a = t.center ?? {
|
|
47
48
|
x: r.x + r.width / 2,
|
|
48
49
|
y: r.y + r.height / 2
|
|
49
|
-
},
|
|
50
|
+
}, o = t.outerRadius ?? Math.min(r.width, r.height) / 2, s = o * (t.innerRadiusRatio ?? .5), c = Math.max(3, Math.floor(t.points ?? 5)), l = t.rotation ?? 0;
|
|
50
51
|
return {
|
|
51
52
|
shape: e.shape,
|
|
52
|
-
bounds:
|
|
53
|
+
bounds: i(n(a, o, c, s, l)),
|
|
53
54
|
geometry: {
|
|
54
55
|
kind: "star",
|
|
55
|
-
center:
|
|
56
|
-
outerRadius:
|
|
57
|
-
innerRadius:
|
|
58
|
-
points:
|
|
59
|
-
rotation:
|
|
56
|
+
center: a,
|
|
57
|
+
outerRadius: o,
|
|
58
|
+
innerRadius: s,
|
|
59
|
+
points: c,
|
|
60
|
+
rotation: l
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
}
|
|
@@ -64,7 +65,7 @@ function e(e) {
|
|
|
64
65
|
let t = e.extras.samples ?? [];
|
|
65
66
|
return {
|
|
66
67
|
shape: e.shape,
|
|
67
|
-
bounds:
|
|
68
|
+
bounds: a(t) ?? o,
|
|
68
69
|
geometry: {
|
|
69
70
|
kind: "pencil",
|
|
70
71
|
samples: t
|
|
@@ -73,20 +74,21 @@ function e(e) {
|
|
|
73
74
|
}
|
|
74
75
|
default: return {
|
|
75
76
|
shape: e.shape,
|
|
76
|
-
bounds:
|
|
77
|
+
bounds: o,
|
|
77
78
|
geometry: { kind: "box" }
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function i(t) {
|
|
83
|
+
let { x: n, y: r, width: i, height: a } = e(t);
|
|
82
84
|
return {
|
|
83
|
-
x:
|
|
84
|
-
y:
|
|
85
|
-
width:
|
|
86
|
-
height:
|
|
85
|
+
x: n,
|
|
86
|
+
y: r,
|
|
87
|
+
width: i,
|
|
88
|
+
height: a
|
|
87
89
|
};
|
|
88
90
|
}
|
|
89
|
-
function
|
|
91
|
+
function a(e) {
|
|
90
92
|
if (e.length === 0) return null;
|
|
91
93
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
92
94
|
for (let a of e) a.x < t && (t = a.x), a.y < n && (n = a.y), a.x > r && (r = a.x), a.y > i && (i = a.y);
|
|
@@ -98,6 +100,6 @@ function n(e) {
|
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
102
|
//#endregion
|
|
101
|
-
export {
|
|
103
|
+
export { r as insertPreviewExtent };
|
|
102
104
|
|
|
103
105
|
//# sourceMappingURL=insertPreviewExtent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertPreviewExtent.js","names":["insertPreviewExtent","b","ov","box","e","b2","aabbOf","center","radius","
|
|
1
|
+
{"version":3,"file":"insertPreviewExtent.js","names":["insertPreviewExtent","b","ov","box","e","a","b2","aabbOf","center","radius","sides","rotation","boxOf","regularPolygonPath","outerRadius","innerRadius","points","starPath","samples","boundsOfPath","path","pts","minX","minY","maxX","maxY","p"],"sources":["../../src/canvas/insertPreviewExtent.ts"],"sourcesContent":["/**\n * The one answer to \"how big is the thing this in-flight insert is making\",\n * shared by the preview paint, the commit, and the gesture's reported bounds.\n *\n * The drag AABB alone is NOT the answer. `insertAction` hands over an\n * `extras` payload that can carry richer geometry than the drag rect, and\n * where it does, that geometry is the shape: a pencil that loops back to its\n * start produces a zero-area drag rect around a trail that swept the page.\n */\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport type { OngoingOverlay } from '@weasel-js/routing';\nimport { boundsOfPath, regularPolygonPath, starPath, type Path } from '@weasel-js/geom';\n\ntype Point = { x: number; y: number };\n\n/** The fields of an `insertPreview` overlay this needs. `canvas/deps/insert`\n * passes the equivalent from its own `(bounds, extras)` commit arguments. */\nexport interface InsertPreviewLike {\n shape: string;\n bounds: { x: number; y: number; width: number; height: number };\n extras: unknown;\n}\n\n/** Resolved preview geometry, in the terms the path builders take. */\nexport type InsertPreviewGeometry =\n | { kind: 'box' }\n | { kind: 'line'; a: Point; b: Point }\n | { kind: 'polygon'; center: Point; radius: number; sides: number; rotation: number }\n | {\n kind: 'star';\n center: Point;\n outerRadius: number;\n innerRadius: number;\n points: number;\n rotation: number;\n }\n | { kind: 'pencil'; samples: ReadonlyArray<Point> };\n\n/** An in-flight insert's shape, resolved from its drag rect and `extras`. */\nexport interface InsertPreviewExtent {\n /** The insert kind, verbatim from the caller. */\n shape: string;\n /** World-space AABB of `geometry` — the extent. */\n bounds: Bounds;\n geometry: InsertPreviewGeometry;\n}\n\n/** The `insertPreview` member of `OngoingOverlay`, which `insertAction` publishes during a drag-to-insert. */\nexport type InsertPreviewOverlay = Extract<OngoingOverlay, { kind: 'insertPreview' }>;\n\n/** Resolve an in-flight insert's geometry and world AABB. Uses the geometry in\n * `extras` where the shape carries it; an unknown shape falls back to its drag rect. */\nexport function insertPreviewExtent(ov: InsertPreviewLike): InsertPreviewExtent {\n const b = ov.bounds;\n const box = { x: b.x, y: b.y, width: b.width, height: b.height };\n\n switch (ov.shape) {\n case 'line': {\n const e = ov.extras as Partial<{ a: Point; b: Point }>;\n const a = e.a ?? { x: b.x, y: b.y };\n const b2 = e.b ?? { x: b.x + b.width, y: b.y + b.height };\n return { shape: ov.shape, bounds: aabbOf([a, b2]) ?? box, geometry: { kind: 'line', a, b: b2 } };\n }\n case 'polygon': {\n const e = ov.extras as Partial<{\n sides: number; rotation: number; center: Point; radius: number;\n }>;\n const center = e.center ?? { x: b.x + b.width / 2, y: b.y + b.height / 2 };\n const radius = e.radius ?? Math.min(b.width, b.height) / 2;\n const sides = Math.max(3, Math.floor(e.sides ?? 6));\n const rotation = e.rotation ?? 0;\n return {\n shape: ov.shape,\n bounds: boxOf(regularPolygonPath(center, radius, sides, rotation)),\n geometry: { kind: 'polygon', center, radius, sides, rotation },\n };\n }\n case 'star': {\n const e = ov.extras as Partial<{\n points: number; innerRadiusRatio: number; rotation: number;\n center: Point; outerRadius: number;\n }>;\n const center = e.center ?? { x: b.x + b.width / 2, y: b.y + b.height / 2 };\n const outerRadius = e.outerRadius ?? Math.min(b.width, b.height) / 2;\n const innerRadius = outerRadius * (e.innerRadiusRatio ?? 0.5);\n const points = Math.max(3, Math.floor(e.points ?? 5));\n const rotation = e.rotation ?? 0;\n return {\n shape: ov.shape,\n bounds: boxOf(starPath(center, outerRadius, points, innerRadius, rotation)),\n geometry: { kind: 'star', center, outerRadius, innerRadius, points, rotation },\n };\n }\n case 'pencil': {\n const e = ov.extras as Partial<{ samples: ReadonlyArray<Point> }>;\n const samples = e.samples ?? [];\n return {\n shape: ov.shape,\n bounds: aabbOf(samples) ?? box,\n geometry: { kind: 'pencil', samples },\n };\n }\n default:\n return { shape: ov.shape, bounds: box, geometry: { kind: 'box' } };\n }\n}\n\n/** A radial shape's extent is the box of the shape it makes, as the commit stores it. */\nfunction boxOf(path: Path): Bounds {\n const { x, y, width, height } = boundsOfPath(path);\n return { x, y, width, height };\n}\n\nfunction aabbOf(pts: ReadonlyArray<Point>): Bounds | null {\n if (pts.length === 0) return null;\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (const p of pts) {\n if (p.x < minX) minX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.x > maxX) maxX = p.x;\n if (p.y > maxY) maxY = p.y;\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n"],"mappings":";;AAoDA,SAAgBA,EAAoB,GAA4C;CAC9E,IAAMC,IAAIC,EAAG,QACPC,IAAM;EAAE,GAAGF,EAAE;EAAG,GAAGA,EAAE;EAAG,OAAOA,EAAE;EAAO,QAAQA,EAAE;CAAO;CAE/D,QAAQC,EAAG,OAAX;EACE,KAAK,QAAQ;GACX,IAAME,IAAIF,EAAG,QACPG,IAAID,EAAE,KAAK;IAAE,GAAGH,EAAE;IAAG,GAAGA,EAAE;GAAE,GAC5BK,IAAKF,EAAE,KAAK;IAAE,GAAGH,EAAE,IAAIA,EAAE;IAAO,GAAGA,EAAE,IAAIA,EAAE;GAAO;GACxD,OAAO;IAAE,OAAOC,EAAG;IAAO,QAAQK,EAAO,CAACF,GAAGC,CAAE,CAAC,KAAKH;IAAK,UAAU;KAAE,MAAM;KAAQ;KAAG,GAAGG;IAAG;GAAE;EACjG;EACA,KAAK,WAAW;GACd,IAAMF,IAAIF,EAAG,QAGPM,IAASJ,EAAE,UAAU;IAAE,GAAGH,EAAE,IAAIA,EAAE,QAAQ;IAAG,GAAGA,EAAE,IAAIA,EAAE,SAAS;GAAE,GACnEQ,IAASL,EAAE,UAAU,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI,GACnDS,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAMN,EAAE,SAAS,CAAC,CAAC,GAC5CO,IAAWP,EAAE,YAAY;GAC/B,OAAO;IACL,OAAOF,EAAG;IACV,QAAQU,EAAMC,EAAmBL,GAAQC,GAAQC,GAAOC,CAAQ,CAAC;IACjE,UAAU;KAAE,MAAM;KAAW;KAAQ;KAAQ;KAAO;IAAS;GAC/D;EACF;EACA,KAAK,QAAQ;GACX,IAAMP,IAAIF,EAAG,QAIPM,IAASJ,EAAE,UAAU;IAAE,GAAGH,EAAE,IAAIA,EAAE,QAAQ;IAAG,GAAGA,EAAE,IAAIA,EAAE,SAAS;GAAE,GACnEa,IAAcV,EAAE,eAAe,KAAK,IAAIH,EAAE,OAAOA,EAAE,MAAM,IAAI,GAC7Dc,IAAcD,KAAeV,EAAE,oBAAoB,KACnDY,IAAS,KAAK,IAAI,GAAG,KAAK,MAAMZ,EAAE,UAAU,CAAC,CAAC,GAC9CO,IAAWP,EAAE,YAAY;GAC/B,OAAO;IACL,OAAOF,EAAG;IACV,QAAQU,EAAMK,EAAST,GAAQM,GAAaE,GAAQD,GAAaJ,CAAQ,CAAC;IAC1E,UAAU;KAAE,MAAM;KAAQ;KAAQ;KAAa;KAAa;KAAQ;IAAS;GAC/E;EACF;EACA,KAAK,UAAU;GAEb,IAAMO,IADIhB,EAAG,OACK,WAAW,CAAC;GAC9B,OAAO;IACL,OAAOA,EAAG;IACV,QAAQK,EAAOW,CAAO,KAAKf;IAC3B,UAAU;KAAE,MAAM;KAAU;IAAQ;GACtC;EACF;EACA,SACE,OAAO;GAAE,OAAOD,EAAG;GAAO,QAAQC;GAAK,UAAU,EAAE,MAAM,MAAM;EAAE;CACrE;AACF;AAGA,SAASS,EAAM,GAAoB;CACjC,IAAM,EAAE,MAAG,MAAG,UAAO,cAAWO,EAAaC,CAAI;CACjD,OAAO;EAAE;EAAG;EAAG;EAAO;CAAO;AAC/B;AAEA,SAASb,EAAO,GAA0C;CACxD,IAAIc,EAAI,WAAW,GAAG,OAAO;CAC7B,IAAIC,IAAO,UAAUC,IAAO,UAAUC,IAAO,WAAWC,IAAO;CAC/D,KAAK,IAAMC,KAAKL,GAId,AAHIK,EAAE,IAAIJ,MAAM,IAAOI,EAAE,IACrBA,EAAE,IAAIH,MAAM,IAAOG,EAAE,IACrBA,EAAE,IAAIF,MAAM,IAAOE,EAAE,IACrBA,EAAE,IAAID,MAAM,IAAOC,EAAE;CAE3B,OAAO;EAAE,GAAGJ;EAAM,GAAGC;EAAM,OAAOC,IAAOF;EAAM,QAAQG,IAAOF;CAAK;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerOrder.js","names":["STANDARD_SLOT_SET","STANDARD_SLOTS","composeOrderedLayers","afterByParent","beforeByParent","tail","allCustomKeys","key","value","layersMap","isCustomEntry","arr","emitted","out","background","emitChild","child","emitBefore","emitAfter","parentKey","slot","sceneLayers","sl","layer","standardLayers","t","anchorOf","inCycle","at","hops","ref","placeToolOverlays","before","overlays","after","selectionOverlay","ordered"],"sources":["../../src/canvas/layerOrder.ts"],"sourcesContent":["import type { RenderLayer } from '../core/layers/render';\nimport
|
|
1
|
+
{"version":3,"file":"layerOrder.js","names":["STANDARD_SLOT_SET","STANDARD_SLOTS","composeOrderedLayers","afterByParent","beforeByParent","tail","allCustomKeys","key","value","layersMap","isCustomEntry","arr","emitted","out","background","emitChild","child","emitBefore","emitAfter","parentKey","slot","sceneLayers","sl","layer","standardLayers","t","anchorOf","inCycle","at","hops","ref","placeToolOverlays","before","overlays","after","selectionOverlay","ordered"],"sources":["../../src/canvas/layerOrder.ts"],"sourcesContent":["import type { RenderLayer } from '../core/layers/render';\nimport { STANDARD_SLOTS, isCustomEntry } from './layerSlots';\nimport type { OverlayPosition } from '@weasel-js/routing';\n\nconst STANDARD_SLOT_SET = new Set<string>(STANDARD_SLOTS);\n\n/**\n * Compose the final ordered layer list from a layersMap and the resolved\n * standard-slot layers.\n *\n * - Standard slots are emitted in `STANDARD_SLOTS` order.\n * - `after: 'X'` / `before: 'X'` accept standard slot names OR other\n * custom-layer keys, and chains may mix the two.\n * - Customs with neither `after` nor `before` are emitted after all standard\n * slots.\n * - Dangling references and cycles go to the tail with a `console.warn`.\n * - An entry with both `after` and `before` is placed by `after`.\n */\nexport function composeOrderedLayers(\n layersMap: Record<string, unknown>,\n standardLayers: Partial<Record<(typeof STANDARD_SLOTS)[number], RenderLayer<unknown>>>,\n /** The `scene` slot split into per-scene-layer canvas layers (keyed\n * `scene:<layerId>`), in render order. Each key becomes an anchor point;\n * `before/after: 'scene'` brackets the whole group. When omitted, the\n * `scene` slot uses `standardLayers.scene`. */\n sceneLayers?: ReadonlyArray<{ key: string; layer: RenderLayer<unknown> }>,\n /** Drawn beneath everything else, grid and customs anchored before the\n * scene included — a fill that must never cover what is laid over it. */\n background?: RenderLayer<unknown>,\n): RenderLayer<unknown>[] {\n // Map<parent key, [{ key, layer }, ...]> — children grouped by their declared anchor.\n const afterByParent = new Map<string, Array<{ key: string; layer: RenderLayer<unknown> }>>();\n const beforeByParent = new Map<string, Array<{ key: string; layer: RenderLayer<unknown> }>>();\n const tail: Array<{ key: string; layer: RenderLayer<unknown> }> = [];\n const allCustomKeys = new Set<string>();\n\n for (const [key, value] of Object.entries(layersMap)) {\n if (STANDARD_SLOT_SET.has(key)) continue;\n if (!isCustomEntry(value)) continue;\n allCustomKeys.add(key);\n if (value.after) {\n const arr = afterByParent.get(value.after) ?? [];\n arr.push({ key, layer: value.layer });\n afterByParent.set(value.after, arr);\n } else if (value.before) {\n const arr = beforeByParent.get(value.before) ?? [];\n arr.push({ key, layer: value.layer });\n beforeByParent.set(value.before, arr);\n } else {\n tail.push({ key, layer: value.layer });\n }\n }\n\n const emitted = new Set<string>();\n const out: RenderLayer<unknown>[] = background ? [background] : [];\n\n function emitChild(child: { key: string; layer: RenderLayer<unknown> }) {\n // A custom has one anchor, so it is reached twice only when `sceneLayers`\n // repeats a key.\n if (emitted.has(child.key)) return;\n emitted.add(child.key);\n emitBefore(child.key);\n out.push(child.layer);\n emitAfter(child.key);\n }\n\n function emitAfter(parentKey: string) {\n for (const child of afterByParent.get(parentKey) ?? []) emitChild(child);\n }\n\n function emitBefore(parentKey: string) {\n for (const child of beforeByParent.get(parentKey) ?? []) emitChild(child);\n }\n\n for (const slot of STANDARD_SLOTS) {\n if (slot === 'scene' && sceneLayers) {\n emitBefore('scene');\n for (const sl of sceneLayers) {\n emitBefore(sl.key);\n out.push(sl.layer);\n emitAfter(sl.key);\n }\n emitAfter('scene');\n continue;\n }\n emitBefore(slot);\n const layer = standardLayers[slot];\n if (layer) out.push(layer);\n emitAfter(slot);\n }\n\n for (const t of tail) {\n if (emitted.has(t.key)) continue;\n emitted.add(t.key);\n out.push(t.layer);\n }\n\n const anchorOf = (key: string): string | undefined => {\n const value = layersMap[key];\n return isCustomEntry(value) ? value.after ?? value.before : undefined;\n };\n const inCycle = (key: string): boolean => {\n let at = anchorOf(key);\n for (let hops = 0; at !== undefined && hops < allCustomKeys.size; hops++) {\n if (at === key) return true;\n at = anchorOf(at);\n }\n return false;\n };\n\n // Orphans: customs that declared an `after`/`before` but never got emitted,\n // because the chain of anchors loops or ends on a key nothing defines.\n for (const key of allCustomKeys) {\n if (emitted.has(key)) continue;\n const value = layersMap[key];\n if (!isCustomEntry(value)) continue;\n const ref = value.after ?? value.before;\n console.warn(inCycle(key)\n ? `composeOrderedLayers: cycle detected involving custom layer \"${key}\" — falling back to tail`\n : `composeOrderedLayers: dangling reference \"${ref}\" from custom layer \"${key}\" — falling back to tail`);\n emitted.add(key);\n out.push(value.layer);\n }\n\n return out;\n}\n\n/**\n * Splice a tool's positioned overlays into an already-composed layer list.\n * With no selection chrome present the anchored overlays fall back to the\n * tail, keeping their relative order. Mutates and returns `ordered`.\n */\nexport function placeToolOverlays(\n ordered: RenderLayer<unknown>[],\n selectionOverlay: RenderLayer<unknown> | undefined,\n overlays: (position: OverlayPosition) => RenderLayer<unknown>[],\n): RenderLayer<unknown>[] {\n const before = overlays('before-selection');\n const after = overlays('after-selection');\n const at = selectionOverlay ? ordered.indexOf(selectionOverlay) : -1;\n if (at >= 0) {\n ordered.splice(at + 1, 0, ...after);\n ordered.splice(at, 0, ...before);\n } else {\n ordered.push(...before, ...after);\n }\n ordered.push(...overlays('top'));\n return ordered;\n}\n"],"mappings":";;AAIA,IAAMA,IAAoB,IAAI,IAAYC,CAAc;AAcxD,SAAgBC,EACd,GACA,GAKA,GAGA,GACwB;CAExB,IAAMC,oBAAgB,IAAI,IAAiE,GACrFC,oBAAiB,IAAI,IAAiE,GACtFC,IAA4D,CAAC,GAC7DC,oBAAgB,IAAI,IAAY;CAEtC,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQC,CAAS,GACjD,IAAI,GAAkB,IAAIF,CAAG,KACxBG,EAAcF,CAAK,GAExB;MADAF,EAAc,IAAIC,CAAG,GACjBC,EAAM,OAAO;GACf,IAAMG,IAAMR,EAAc,IAAIK,EAAM,KAAK,KAAK,CAAC;GAE/C,AADAG,EAAI,KAAK;IAAE;IAAK,OAAOH,EAAM;GAAM,CAAC,GACpCL,EAAc,IAAIK,EAAM,OAAOG,CAAG;EACpC,OAAO,IAAIH,EAAM,QAAQ;GACvB,IAAMG,IAAMP,EAAe,IAAII,EAAM,MAAM,KAAK,CAAC;GAEjD,AADAG,EAAI,KAAK;IAAE;IAAK,OAAOH,EAAM;GAAM,CAAC,GACpCJ,EAAe,IAAII,EAAM,QAAQG,CAAG;EACtC,OACE,EAAK,KAAK;GAAE;GAAK,OAAOH,EAAM;EAAM,CAAC;CAAA;CAIzC,IAAMI,oBAAU,IAAI,IAAY,GAC1BC,IAA8BC,IAAa,CAACA,CAAU,IAAI,CAAC;CAEjE,SAASC,EAAU,GAAqD;EAGtE,AAAIH,EAAQ,IAAII,EAAM,GAAG,MACzBJ,EAAQ,IAAII,EAAM,GAAG,GACrBC,EAAWD,EAAM,GAAG,GACpBH,EAAI,KAAKG,EAAM,KAAK,GACpBE,EAAUF,EAAM,GAAG;CACrB;CAEA,SAASE,EAAU,GAAmB;EACpC,KAAK,IAAMF,KAASb,EAAc,IAAIgB,CAAS,KAAK,CAAC,GAAG,EAAUH,CAAK;CACzE;CAEA,SAASC,EAAW,GAAmB;EACrC,KAAK,IAAMD,KAASZ,EAAe,IAAIe,CAAS,KAAK,CAAC,GAAG,EAAUH,CAAK;CAC1E;CAEA,KAAK,IAAMI,KAAQnB,GAAgB;EACjC,IAAImB,MAAS,WAAWC,GAAa;GACnC,EAAW,OAAO;GAClB,KAAK,IAAMC,KAAMD,GAGf,AAFAJ,EAAWK,EAAG,GAAG,GACjBT,EAAI,KAAKS,EAAG,KAAK,GACjBJ,EAAUI,EAAG,GAAG;GAElB,EAAU,OAAO;GACjB;EACF;EACA,EAAWF,CAAI;EACf,IAAMG,IAAQC,EAAeJ;EAE7B,AADIG,KAAOV,EAAI,KAAKU,CAAK,GACzBL,EAAUE,CAAI;CAChB;CAEA,KAAK,IAAMK,KAAKpB,GACd,AAAIO,EAAQ,IAAIa,EAAE,GAAG,MACrBb,EAAQ,IAAIa,EAAE,GAAG,GACjBZ,EAAI,KAAKY,EAAE,KAAK;CAGlB,IAAMC,KAAY,MAAoC;EACpD,IAAMlB,IAAQC,EAAUF;EACxB,OAAOG,EAAcF,CAAK,IAAIA,EAAM,SAASA,EAAM,SAAS,KAAA;CAC9D,GACMmB,KAAW,MAAyB;EACxC,IAAIC,IAAKF,EAASnB,CAAG;EACrB,KAAK,IAAIsB,IAAO,GAAGD,MAAO,KAAA,KAAaC,IAAOvB,EAAc,MAAM,KAAQ;GACxE,IAAIsB,MAAOrB,GAAK,OAAO;GACvB,IAAKmB,EAASE,CAAE;EAClB;EACA,OAAO;CACT;CAIA,KAAK,IAAMrB,KAAOD,GAAe;EAC/B,IAAIM,EAAQ,IAAIL,CAAG,GAAG;EACtB,IAAMC,IAAQC,EAAUF;EACxB,IAAI,CAACG,EAAcF,CAAK,GAAG;EAC3B,IAAMsB,IAAMtB,EAAM,SAASA,EAAM;EAKjC,AAJA,QAAQ,KAAKmB,EAAQpB,CAAG,IACpB,gEAAgEA,EAAI,4BACpE,6CAA6CuB,EAAI,uBAAuBvB,EAAI,yBAAyB,GACzGK,EAAQ,IAAIL,CAAG,GACfM,EAAI,KAAKL,EAAM,KAAK;CACtB;CAEA,OAAOK;AACT;AAOA,SAAgBkB,EACd,GACA,GACA,GACwB;CACxB,IAAMC,IAASC,EAAS,kBAAkB,GACpCC,IAAQD,EAAS,iBAAiB,GAClCL,IAAKO,IAAmBC,EAAQ,QAAQD,CAAgB,IAAI;CAQlE,OAPIP,KAAM,KACRQ,EAAQ,OAAOR,IAAK,GAAG,GAAG,GAAGM,CAAK,GAClCE,EAAQ,OAAOR,GAAI,GAAG,GAAGI,CAAM,KAE/BI,EAAQ,KAAK,GAAGJ,GAAQ,GAAGE,CAAK,GAElCE,EAAQ,KAAK,GAAGH,EAAS,KAAK,CAAC,GACxBG;AACT"}
|
|
@@ -8,7 +8,12 @@ var e = [
|
|
|
8
8
|
function t(e) {
|
|
9
9
|
return !!e && typeof e == "object" && "layer" in e;
|
|
10
10
|
}
|
|
11
|
+
function n(e) {
|
|
12
|
+
let n = {};
|
|
13
|
+
for (let [r, i] of Object.entries(e)) (i === null || t(i)) && (n[r] = i);
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
11
16
|
//#endregion
|
|
12
|
-
export { e as STANDARD_SLOTS, t as isCustomEntry };
|
|
17
|
+
export { e as STANDARD_SLOTS, n as builtLayersOf, t as isCustomEntry };
|
|
13
18
|
|
|
14
19
|
//# sourceMappingURL=layerSlots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerSlots.js","names":["STANDARD_SLOTS","isCustomEntry","v"],"sources":["../../src/canvas/layerSlots.ts"],"sourcesContent":["import type { RenderLayer } from '../core/layers/render';\n\n/** Standard slot names — render in this canonical order.\n * `cellHighlight` is not an anchor for custom layers: it sits between the\n * grid and the scene, so anchor to one of those. */\n/** @internal */\nexport const STANDARD_SLOTS = [\n 'grid',\n 'cellHighlight',\n 'scene',\n 'selectionOverlay',\n] as const;\n\n/** Names of the slots `<Canvas>` supports out of the box (excluding the implicit cell-highlight overlay). */\nexport type StandardSlotName = Exclude<(typeof STANDARD_SLOTS)[number], 'cellHighlight'>;\n\n/** Custom layer entry — any key not in `STANDARD_SLOTS`. The presence of\n * `.layer` discriminates this from a slot config. */\nexport interface CustomLayerEntry {\n layer: RenderLayer<unknown>;\n /** Insert immediately after the named standard slot or another custom-layer key. */\n after?: StandardSlotName | (string & {});\n /** Insert immediately before the named standard slot or another custom-layer key. */\n before?: StandardSlotName | (string & {});\n}\n\nexport function isCustomEntry(v: unknown): v is CustomLayerEntry {\n return !!v && typeof v === 'object' && 'layer' in (v as Record<string, unknown>);\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"layerSlots.js","names":["STANDARD_SLOTS","isCustomEntry","v","builtLayersOf","out","key","value","map"],"sources":["../../src/canvas/layerSlots.ts"],"sourcesContent":["import type { RenderLayer } from '../core/layers/render';\nimport type { SelectionOverlayLayerOpts } from 'features/selection/overlay';\nimport type { SceneSlotConfig } from './buildSceneLayer';\n\n/** Standard slot names — render in this canonical order.\n * `cellHighlight` is not an anchor for custom layers: it sits between the\n * grid and the scene, so anchor to one of those. */\n/** @internal */\nexport const STANDARD_SLOTS = [\n 'grid',\n 'cellHighlight',\n 'scene',\n 'selectionOverlay',\n] as const;\n\n/** Names of the slots `<Canvas>` supports out of the box (excluding the implicit cell-highlight overlay). */\nexport type StandardSlotName = Exclude<(typeof STANDARD_SLOTS)[number], 'cellHighlight'>;\n\n/** Custom layer entry — any key not in `STANDARD_SLOTS`. The presence of\n * `.layer` discriminates this from a slot config. */\nexport interface CustomLayerEntry {\n layer: RenderLayer<unknown>;\n /** Insert immediately after the named standard slot or another custom-layer key. */\n after?: StandardSlotName | (string & {});\n /** Insert immediately before the named standard slot or another custom-layer key. */\n before?: StandardSlotName | (string & {});\n}\n\nexport function isCustomEntry(v: unknown): v is CustomLayerEntry {\n return !!v && typeof v === 'object' && 'layer' in (v as Record<string, unknown>);\n}\n\n/** Selection-overlay slot config — passed through to `createSelectionOverlayLayer`,\n * minus the `getSelection`/`getPose` the canvas wires automatically. */\nexport type SelectionOverlaySlotConfig<TPose> = Omit<\n SelectionOverlayLayerOpts<TPose>,\n 'getSelection' | 'getPose'\n> & {\n /** Override the auto-wired pose lookup (overlay-aware → adapter fallback). */\n poseById?: (id: string) => TPose | null;\n};\n\n/** Per-slot config union. The key narrows it in practice. */\nexport type StandardSlotConfig<TNode extends { id: string }, TPose> =\n | SceneSlotConfig<TNode, TPose>\n | SelectionOverlaySlotConfig<TPose>;\n\n/** What may fill one of the canvas's named layer slots: a config the canvas\n * builds the layer from, a pre-built layer, or `null` to leave the slot\n * empty. */\nexport type LayerSlotValue<TNode extends { id: string }, TPose> =\n | StandardSlotConfig<TNode, TPose>\n | CustomLayerEntry\n | null;\n\n/** The canvas's render stack, as named slots. The standard slots (grid,\n * scene, selection overlay, cell highlight) fix where a layer sits in the\n * stack; scene and selection overlay can be configured, and every one can be\n * given a layer of your own or switched off. Further keys add custom layers.\n * `TSceneSlot` is what the scene slot accepts: `<SceneCanvas>` takes a\n * partial config and fills the rest from its defaults. */\nexport type LayersMap<\n TNode extends { id: string },\n TPose,\n TSceneSlot = SceneSlotConfig<TNode, TPose>,\n> = {\n /** Grid slot, beneath the scene. Takes a pre-built layer (`{ layer }`) —\n * e.g. `createGridLayer` from `@weasel-js/guides` — or `null`. */\n grid?: CustomLayerEntry | null;\n /** Scene slot: the config `<SceneCanvas>` builds its layers from, a\n * pre-built layer that paints the scene in their place, or `null`. A\n * pre-built layer gets no ghost of a node in flight, which needs `drawOne`. */\n scene?: TSceneSlot | CustomLayerEntry | null;\n /** Selection-overlay slot: the config `<SceneCanvas>` builds the layer\n * from, a pre-built layer that paints in its place, or `null` for no\n * selection chrome. */\n selectionOverlay?: SelectionOverlaySlotConfig<TPose> | CustomLayerEntry | null;\n /** Cell-highlight overlay slot, drawn immediately after the grid. Takes a\n * pre-built layer (`{ layer }`) — e.g. `createCellHighlightLayer` from\n * `@weasel-js/guides` — or `null`. */\n cellHighlight?: CustomLayerEntry | null;\n} & {\n [customKey: string]: LayerSlotValue<TNode, TPose> | TSceneSlot | undefined;\n};\n\n/** The scene slot once built: its canvas layers, bottom first. Each `key` is\n * an anchor a custom layer can name (`scene`, or `scene:<layerId>`). */\nexport interface SceneSlotLayers {\n layers: ReadonlyArray<{ key: string; layer: RenderLayer<unknown> }>;\n}\n\n/** What `<Canvas>` composes: a {@link LayersMap} with every slot already a\n * layer. `<SceneCanvas>` builds one from its `layers` prop. */\nexport type CanvasLayers = {\n grid?: CustomLayerEntry | null;\n cellHighlight?: CustomLayerEntry | null;\n scene?: SceneSlotLayers | null;\n selectionOverlay?: CustomLayerEntry | null;\n} & {\n [customKey: string]: CustomLayerEntry | SceneSlotLayers | null | undefined;\n};\n\n/** The layers of `map` that are already built, in its key order: each\n * `{ layer }` entry and each `null`. A slot config is left out, for whoever\n * builds it to put back. */\nexport function builtLayersOf(map: Record<string, unknown>): Record<string, CustomLayerEntry | null> {\n const out: Record<string, CustomLayerEntry | null> = {};\n for (const [key, value] of Object.entries(map)) {\n if (value === null || isCustomEntry(value)) out[key] = value;\n }\n return out;\n}\n"],"mappings":";AAQA,IAAaA,IAAiB;CAC5B;CACA;CACA;CACA;AACF;AAeA,SAAgBC,EAAc,GAAmC;CAC/D,OAAO,CAAC,CAACC,KAAK,OAAOA,KAAM,YAAY,WAAYA;AACrD;AA2EA,SAAgBC,EAAc,GAAuE;CACnG,IAAMC,IAA+C,CAAC;CACtD,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQC,CAAG,GAC3C,CAAID,MAAU,QAAQL,EAAcK,CAAK,OAAG,EAAID,KAAOC;CAEzD,OAAOF;AACT"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { DEFAULT_SHAPE_FILL as e } from "../../util/paint.js";
|
|
2
|
+
import { derivesPath as t } from "./memo.js";
|
|
3
|
+
import { inkReach as n, resolveNodeFill as r, resolveNodeStroke as i, withAnimatedVertexColors as a } from "./nodePaint.js";
|
|
4
|
+
import { commandFill as o, commandStroke as s } from "@weasel-js/renderer";
|
|
5
5
|
import { boundsOfPath as c } from "@weasel-js/geom";
|
|
6
6
|
//#region src/canvas/nodeShapes/derivedPainter.ts
|
|
7
7
|
var l = {
|
|
8
8
|
id: "kit:derived",
|
|
9
|
-
matches:
|
|
10
|
-
paint: (
|
|
9
|
+
matches: t,
|
|
10
|
+
paint: (t, n, l) => {
|
|
11
11
|
let u = l?.derivedPath;
|
|
12
12
|
if (u == null) return [];
|
|
13
|
-
let d = c(u), f =
|
|
13
|
+
let d = c(u), f = t.data, p = i(f?.stroke), m = r(f?.fill, p === null ? e : null), h = m && o(m, d), g = p && s(p, d), _ = {
|
|
14
14
|
kind: "path",
|
|
15
15
|
path: u,
|
|
16
16
|
...h ? { fill: h } : {},
|
|
17
17
|
...h && f?.vertexColors ? { vertexColors: f.vertexColors } : {},
|
|
18
18
|
...g ? { stroke: g } : {}
|
|
19
19
|
};
|
|
20
|
-
return
|
|
20
|
+
return a([_], l);
|
|
21
21
|
},
|
|
22
22
|
silhouette: (e, t, n) => n?.derivedPath ?? null,
|
|
23
|
-
ink: (
|
|
24
|
-
let s =
|
|
23
|
+
ink: (t, a, o) => {
|
|
24
|
+
let s = t.data, c = i(s?.stroke);
|
|
25
25
|
return {
|
|
26
|
-
filled:
|
|
27
|
-
...
|
|
26
|
+
filled: r(s?.fill, c === null ? e : null) !== null,
|
|
27
|
+
...n(c, o?.scale)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivedPainter.js","names":["DERIVED_PAINTER","derivesPath","path","ctx","box","boundsOfPath","d","node","strokeSpec","resolveNodeStroke","declared","resolveNodeFill","DEFAULT_SHAPE_FILL","fill","commandFill","stroke","commandStroke","cmd","withAnimatedVertexColors","inkReach"],"sources":["../../../src/canvas/nodeShapes/derivedPainter.ts"],"sourcesContent":["import {\n boundsOfPath\n} from '@weasel-js/geom';\nimport type {
|
|
1
|
+
{"version":3,"file":"derivedPainter.js","names":["DERIVED_PAINTER","derivesPath","path","ctx","box","boundsOfPath","d","node","strokeSpec","resolveNodeStroke","declared","resolveNodeFill","DEFAULT_SHAPE_FILL","fill","commandFill","stroke","commandStroke","cmd","withAnimatedVertexColors","inkReach"],"sources":["../../../src/canvas/nodeShapes/derivedPainter.ts"],"sourcesContent":["import {\n boundsOfPath\n} from '@weasel-js/geom';\nimport type { Stroke, Fill } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport { commandFill, commandStroke } from '@weasel-js/renderer';\nimport type { DrawCommand } from '@weasel-js/renderer';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\nimport { derivesPath } from './memo';\nimport { inkReach, withAnimatedVertexColors, resolveNodeFill, resolveNodeStroke } from './nodePaint';\n\n/**\n * Built-in painter for nodes whose geometry is computed from other nodes'\n * poses. The path itself arrives on the paint context — see\n * {@link NodePaintCtx.derivedPath}.\n *\n * Fill and stroke resolve as `kit:path`'s do, but against the **derived path's\n * own bounds**, not the pose. `kit:path` projects its path into the pose frame\n * first, so there the two boxes are the same one; here the path is already\n * absolute and the pose is typically a zero-sized placeholder, which would\n * collapse a box-relative gradient onto a point.\n *\n * Not memoized on {@link PAINT_SLOT} on purpose: that key is `(node, pose,\n * data)` and cannot see `ctx.derivedPath`, so it would serve one caller's\n * commands to a caller that passed a different path.\n *\n * Rotation still comes from the pose — `wrapNodeOutput` turns the output about\n * the pose AABB's center, which for a zero-sized pose is its origin.\n */\nexport const DERIVED_PAINTER: NodeShapeEntry = {\n id: 'kit:derived',\n // `dependsOn` alone is not enough: the two fields are independent optionals,\n // and `kit:add` restores a node with its `dependsOn` intact when its\n // `derivePath` key is missing from the registry. Claiming that node would paint\n // nothing where the authored appearance is what the warning promises.\n matches: derivesPath,\n paint: (node, _pose, ctx) => {\n const path = ctx?.derivedPath;\n if (path == null) return [];\n const box = boundsOfPath(path);\n const d = node.data as { fill?: Fill | null; stroke?: Stroke | null; vertexColors?: number[] } | null;\n const strokeSpec = resolveNodeStroke(d?.stroke);\n const declared = resolveNodeFill(d?.fill, strokeSpec === null ? DEFAULT_SHAPE_FILL : null);\n const fill = declared && commandFill(declared, box);\n const stroke = strokeSpec && commandStroke(strokeSpec, box);\n const cmd: DrawCommand = {\n kind: 'path',\n path,\n ...(fill ? { fill } : {}),\n ...(fill && d?.vertexColors ? { vertexColors: d.vertexColors } : {}),\n ...(stroke ? { stroke } : {}),\n };\n return withAnimatedVertexColors([cmd], ctx);\n },\n // The derived path *is* the silhouette, and it is already absolute — the\n // pose is a placeholder, so nothing here can be recovered from it. Without\n // a `ctx` this reports null, which `shapeCoversPoint` reads as \"no\n // opinion\": picking then falls back to that zero-sized pose.\n silhouette: (_node, _pose, ctx) => ctx?.derivedPath ?? null,\n ink: (node, _pose, ctx) => {\n const d = node.data as { fill?: Fill | null; stroke?: Stroke | null } | null;\n const stroke = resolveNodeStroke(d?.stroke);\n return {\n filled: resolveNodeFill(d?.fill, stroke === null ? DEFAULT_SHAPE_FILL : null) !== null,\n ...inkReach(stroke, ctx?.scale),\n };\n },\n};\n"],"mappings":";;;;;;AA6BA,IAAaA,IAAkC;CAC7C,IAAI;CAKJ,SAASC;CACT,QAAQ,GAAM,GAAO,MAAQ;EAC3B,IAAMC,IAAOC,GAAK;EAClB,IAAID,KAAQ,MAAM,OAAO,CAAC;EAC1B,IAAME,IAAMC,EAAaH,CAAI,GACvBI,IAAIC,EAAK,MACTC,IAAaC,EAAkBH,GAAG,MAAM,GACxCI,IAAWC,EAAgBL,GAAG,MAAME,MAAe,OAAOI,IAAqB,IAAI,GACnFC,IAAOH,KAAYI,EAAYJ,GAAUN,CAAG,GAC5CW,IAASP,KAAcQ,EAAcR,GAAYJ,CAAG,GACpDa,IAAmB;GACvB,MAAM;GACN;GACA,GAAIJ,IAAO,EAAE,QAAK,IAAI,CAAC;GACvB,GAAIA,KAAQP,GAAG,eAAe,EAAE,cAAcA,EAAE,aAAa,IAAI,CAAC;GAClE,GAAIS,IAAS,EAAE,UAAO,IAAI,CAAC;EAC7B;EACA,OAAOG,EAAyB,CAACD,CAAG,GAAGd,CAAG;CAC5C;CAKA,aAAa,GAAO,GAAO,MAAQA,GAAK,eAAe;CACvD,MAAM,GAAM,GAAO,MAAQ;EACzB,IAAMG,IAAIC,EAAK,MACTQ,IAASN,EAAkBH,GAAG,MAAM;EAC1C,OAAO;GACL,QAAQK,EAAgBL,GAAG,MAAMS,MAAW,OAAOH,IAAqB,IAAI,MAAM;GAClF,GAAGO,EAASJ,GAAQZ,GAAK,KAAK;EAChC;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { paintsPose as e, poseBoxBounds as t } from "./poseBox.js";
|
|
2
|
+
import { getImageBitmap as n, imageStatus as r } from "@weasel-js/renderer";
|
|
3
3
|
import { linePath as i } from "@weasel-js/geom";
|
|
4
4
|
//#region src/canvas/nodeShapes/imagePainter.ts
|
|
5
5
|
function a(e, t) {
|
|
@@ -18,13 +18,13 @@ function o(e, t, n) {
|
|
|
18
18
|
}
|
|
19
19
|
var s = {
|
|
20
20
|
id: "kit:image",
|
|
21
|
-
matches: (
|
|
22
|
-
if (!
|
|
23
|
-
let
|
|
24
|
-
return typeof
|
|
21
|
+
matches: (t) => {
|
|
22
|
+
if (!e(t.pose)) return !1;
|
|
23
|
+
let n = t.data?.image?.src;
|
|
24
|
+
return typeof n == "string" && n.length > 0;
|
|
25
25
|
},
|
|
26
|
-
paint: (
|
|
27
|
-
let c =
|
|
26
|
+
paint: (e, t, s) => {
|
|
27
|
+
let c = e.data, l = t, u = s?.resolveImage ? s.resolveImage(e) : n(c.image.src, o(l, c.image.source, s?.pixelScale));
|
|
28
28
|
if (u) return [{
|
|
29
29
|
kind: "image",
|
|
30
30
|
image: u,
|
|
@@ -37,7 +37,7 @@ var s = {
|
|
|
37
37
|
...c.image.flipX ? { flipX: !0 } : {},
|
|
38
38
|
...c.image.flipY ? { flipY: !0 } : {}
|
|
39
39
|
}];
|
|
40
|
-
let d = !s?.resolveImage &&
|
|
40
|
+
let d = !s?.resolveImage && r(c.image.src) === "error", f = d ? "#d08a8a" : "#bbbbbb", p = [{
|
|
41
41
|
kind: "path",
|
|
42
42
|
path: {
|
|
43
43
|
kind: "rect",
|
|
@@ -76,7 +76,7 @@ var s = {
|
|
|
76
76
|
height: n.height
|
|
77
77
|
};
|
|
78
78
|
},
|
|
79
|
-
bounds: (e,
|
|
79
|
+
bounds: (e, n, r) => t(n, c, r)
|
|
80
80
|
}, c = {
|
|
81
81
|
paint: { color: "#000" },
|
|
82
82
|
width: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagePainter.js","names":["sourceInPixels","s","bmp","drawnSize","pixelScale","pose","source","IMAGE_PAINTER","paintsPose","node","src","d","p","ctx","getImageBitmap","error","imageStatus","color","cmds","linePath","poseBoxBounds","IMAGE_PLACEHOLDER_STROKE"],"sources":["../../../src/canvas/nodeShapes/imagePainter.ts"],"sourcesContent":["import {\n linePath\n} from '@weasel-js/geom';\nimport type { Stroke } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport type { Node, RectPose } from 'core/scene/types';\nimport {\n getImageBitmap, imageStatus, type ImageNodeData, type ImageRasterSize,\n} from '
|
|
1
|
+
{"version":3,"file":"imagePainter.js","names":["sourceInPixels","s","bmp","drawnSize","pixelScale","pose","source","IMAGE_PAINTER","paintsPose","node","src","d","p","ctx","getImageBitmap","error","imageStatus","color","cmds","linePath","poseBoxBounds","IMAGE_PLACEHOLDER_STROKE"],"sources":["../../../src/canvas/nodeShapes/imagePainter.ts"],"sourcesContent":["import {\n linePath\n} from '@weasel-js/geom';\nimport type { Stroke } from '@weasel-js/paint';\nimport type { NodeShapeEntry } from 'canvas/NodeShape';\nimport type { Node, RectPose } from 'core/scene/types';\nimport {\n getImageBitmap, imageStatus, type ImageNodeData, type ImageRasterSize,\n} from '@weasel-js/renderer';\nimport type { DrawCommand } from '@weasel-js/renderer';\nimport { paintsPose, poseBoxBounds } from './poseBox';\n\n// ─── Built-in painters ─────────────────────────────────────────────────\n\nexport function sourceInPixels(\n s: NonNullable<ImageNodeData['image']['source']>,\n bmp: ImageBitmap,\n): { x: number; y: number; w: number; h: number } {\n return {\n x: s.x * bmp.width, y: s.y * bmp.height, w: s.width * bmp.width, h: s.height * bmp.height,\n };\n}\n\n/** The whole bitmap's size in device pixels when `source` of it fills `pose`. */\nexport function drawnSize(\n pose: RectPose,\n source: ImageNodeData['image']['source'],\n pixelScale: number | undefined,\n): ImageRasterSize | undefined {\n if (!(pixelScale && pixelScale > 0)) return undefined;\n return {\n width: Math.abs(pose.width) * pixelScale / (source?.width || 1),\n height: Math.abs(pose.height) * pixelScale / (source?.height || 1),\n };\n}\n\n/** Raster-image painter. Renders `data.image.src` (URL / blob: / data-URI)\n * via an `ImageDrawCommand` once the bitmap has decoded; until then it paints\n * a faint placeholder outline so the node stays visible + selectable (a\n * reddish outline + slash marks a failed load). The decoded bitmap is owned\n * by `imageCache`, keyed on `src`; the node holds only the serializable `src`.\n * Registered before `kit:rect-fallback` so image nodes don't fall through. */\nexport const IMAGE_PAINTER: NodeShapeEntry<unknown, RectPose> = {\n id: 'kit:image',\n matches: (node) => {\n if (!paintsPose(node.pose)) return false;\n const src = (node.data as { image?: { src?: unknown } } | null)?.image?.src;\n return typeof src === 'string' && src.length > 0;\n },\n paint: (node, pose, ctx) => {\n const d = node.data as ImageNodeData;\n const p = pose;\n const bmp = ctx?.resolveImage\n ? ctx.resolveImage(node as unknown as Node<unknown, string, unknown>)\n : getImageBitmap(d.image.src, drawnSize(p, d.image.source, ctx?.pixelScale));\n if (bmp) {\n return [{\n kind: 'image',\n image: bmp,\n x: p.x, y: p.y, w: p.width, h: p.height,\n ...(d.image.opacity !== undefined ? { opacity: d.image.opacity } : {}),\n ...(d.image.source ? { source: sourceInPixels(d.image.source, bmp) } : {}),\n ...(d.image.flipX ? { flipX: true } : {}),\n ...(d.image.flipY ? { flipY: true } : {}),\n }];\n }\n // Not ready — faint placeholder (grey while loading, reddish + slash on\n // error). With a caller-supplied resolver the fallback is deterministic:\n // always the plain grey outline, no ambient load-status read.\n const error = ctx?.resolveImage ? false : imageStatus(d.image.src) === 'error';\n const color = error ? '#d08a8a' : '#bbbbbb';\n const cmds: DrawCommand[] = [{\n kind: 'path',\n path: { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height },\n stroke: { paint: { color }, width: 1 },\n }];\n if (error) {\n cmds.push({\n kind: 'path',\n path: linePath({ x: p.x, y: p.y }, { x: p.x + p.width, y: p.y + p.height }),\n stroke: { paint: { color }, width: 1 },\n });\n }\n return cmds;\n },\n silhouette: (_node, pose) => {\n const p = pose;\n return { kind: 'rect', x: p.x, y: p.y, width: p.width, height: p.height };\n },\n // The placeholder's 1-unit outline is the only thing that leaves the box.\n bounds: (_node, pose, ctx) => poseBoxBounds(pose, IMAGE_PLACEHOLDER_STROKE, ctx),\n};\n\nexport const IMAGE_PLACEHOLDER_STROKE: Stroke = { paint: { color: '#000' }, width: 1 };\n"],"mappings":";;;;AAcA,SAAgBA,EACd,GACA,GACgD;CAChD,OAAO;EACL,GAAGC,EAAE,IAAIC,EAAI;EAAO,GAAGD,EAAE,IAAIC,EAAI;EAAQ,GAAGD,EAAE,QAAQC,EAAI;EAAO,GAAGD,EAAE,SAASC,EAAI;CACrF;AACF;AAGA,SAAgBC,EACd,GACA,GACA,GAC6B;CAC7B,IAAMC,KAAcA,IAAa,GACjC,OAAO;EACL,OAAO,KAAK,IAAIC,EAAK,KAAK,IAAID,KAAcE,GAAQ,SAAS;EAC7D,QAAQ,KAAK,IAAID,EAAK,MAAM,IAAID,KAAcE,GAAQ,UAAU;CAClE;AACF;AAQA,IAAaC,IAAmD;CAC9D,IAAI;CACJ,UAAU,MAAS;EACjB,IAAI,CAACC,EAAWC,EAAK,IAAI,GAAG,OAAO;EACnC,IAAMC,IAAOD,EAAK,MAA+C,OAAO;EACxE,OAAO,OAAOC,KAAQ,YAAYA,EAAI,SAAS;CACjD;CACA,QAAQ,GAAM,GAAM,MAAQ;EAC1B,IAAMC,IAAIF,EAAK,MACTG,IAAIP,GACJH,IAAMW,GAAK,eACbA,EAAI,aAAaJ,CAAiD,IAClEK,EAAeH,EAAE,MAAM,KAAKR,EAAUS,GAAGD,EAAE,MAAM,QAAQE,GAAK,UAAU,CAAC;EAC7E,IAAIX,GACF,OAAO,CAAC;GACN,MAAM;GACN,OAAOA;GACP,GAAGU,EAAE;GAAG,GAAGA,EAAE;GAAG,GAAGA,EAAE;GAAO,GAAGA,EAAE;GACjC,GAAID,EAAE,MAAM,YAAY,KAAA,IAA2C,CAAC,IAAhC,EAAE,SAASA,EAAE,MAAM,QAAQ;GAC/D,GAAIA,EAAE,MAAM,SAAS,EAAE,QAAQX,EAAeW,EAAE,MAAM,QAAQT,CAAG,EAAE,IAAI,CAAC;GACxE,GAAIS,EAAE,MAAM,QAAQ,EAAE,OAAO,GAAK,IAAI,CAAC;GACvC,GAAIA,EAAE,MAAM,QAAQ,EAAE,OAAO,GAAK,IAAI,CAAC;EACzC,CAAC;EAKH,IAAMI,IAAQ,IAAK,gBAAuBC,EAAYL,EAAE,MAAM,GAAG,MAAM,SACjEM,IAAQF,IAAQ,YAAY,WAC5BG,IAAsB,CAAC;GAC3B,MAAM;GACN,MAAM;IAAE,MAAM;IAAQ,GAAGN,EAAE;IAAG,GAAGA,EAAE;IAAG,OAAOA,EAAE;IAAO,QAAQA,EAAE;GAAO;GACvE,QAAQ;IAAE,OAAO,EAAE,SAAM;IAAG,OAAO;GAAE;EACvC,CAAC;EAQD,OAPIG,KACFG,EAAK,KAAK;GACR,MAAM;GACN,MAAMC,EAAS;IAAE,GAAGP,EAAE;IAAG,GAAGA,EAAE;GAAE,GAAG;IAAE,GAAGA,EAAE,IAAIA,EAAE;IAAO,GAAGA,EAAE,IAAIA,EAAE;GAAO,CAAC;GAC1E,QAAQ;IAAE,OAAO,EAAE,SAAM;IAAG,OAAO;GAAE;EACvC,CAAC,GAEIM;CACT;CACA,aAAa,GAAO,MAAS;EAC3B,IAAMN,IAAIP;EACV,OAAO;GAAE,MAAM;GAAQ,GAAGO,EAAE;GAAG,GAAGA,EAAE;GAAG,OAAOA,EAAE;GAAO,QAAQA,EAAE;EAAO;CAC1E;CAEA,SAAS,GAAO,GAAM,MAAQQ,EAAcf,GAAMgB,GAA0BR,CAAG;AACjF,GAEaQ,IAAmC;CAAE,OAAO,EAAE,OAAO,OAAO;CAAG,OAAO;AAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo.js","names":["PAINT_SLOT","derivesPath","node"],"sources":["../../../src/canvas/nodeShapes/memo.ts"],"sourcesContent":["\n/**\n * Slot for a painter's memoized `paint` output.\n *\n * Distinct from
|
|
1
|
+
{"version":3,"file":"memo.js","names":["PAINT_SLOT","derivesPath","node"],"sources":["../../../src/canvas/nodeShapes/memo.ts"],"sourcesContent":["\n/**\n * Slot for a painter's memoized `paint` output.\n *\n * Distinct from the silhouette slot even though the two mostly invalidate\n * together: the silhouette bakes `pose.rotation` in (paint does not — the\n * render wrap applies it), and paint alone can depend on `NodePaintCtx` and on\n * ambient readiness.\n *\n * **Only for painters that are a pure function of `(node, pose, data)`.**\n * `kit:text` and `kit:image` do not qualify.\n */\nexport const PAINT_SLOT = 'shape:paint';\n\nexport function derivesPath(node: { dependsOn?: readonly unknown[] | 'children'; derivePath?: unknown }): boolean {\n return (node.dependsOn?.length ?? 0) > 0 && node.derivePath !== undefined;\n}\n"],"mappings":";AAYA,IAAaA,IAAa;AAE1B,SAAgBC,EAAY,GAAsF;CAChH,QAAQC,EAAK,WAAW,UAAU,KAAK,KAAKA,EAAK,eAAe,KAAA;AAClE"}
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { bumpNodeMemoGeneration as e } from "../../core/scene/nodeMemo.js";
|
|
2
|
+
import { DEFAULT_SHAPE_FILL as t } from "../../util/paint.js";
|
|
3
|
+
import { paintDrawKindRegistry as n } from "@weasel-js/renderer";
|
|
4
|
+
import { countPathAnchors as r } from "@weasel-js/geom";
|
|
5
|
+
import { markerReach as i, resolveStrokeWidth as a } from "@weasel-js/stroke";
|
|
4
6
|
//#region src/canvas/nodeShapes/nodePaint.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
n.subscribe(e);
|
|
8
|
+
function o(e, t) {
|
|
9
|
+
let n = e === void 0 ? t : e;
|
|
10
|
+
return n?.paint == null ? null : n;
|
|
7
11
|
}
|
|
8
|
-
function
|
|
12
|
+
function s(e) {
|
|
9
13
|
return e?.paint == null ? null : e;
|
|
10
14
|
}
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
15
|
+
function c(e, t) {
|
|
16
|
+
if (e === null) return {
|
|
13
17
|
outset: 0,
|
|
14
18
|
inset: 0
|
|
15
19
|
};
|
|
16
|
-
let
|
|
17
|
-
switch (
|
|
20
|
+
let n = i(e), r = (t, n) => {
|
|
21
|
+
switch (e.align ?? "center") {
|
|
18
22
|
case "inner": return {
|
|
19
|
-
outset:
|
|
20
|
-
inset:
|
|
23
|
+
outset: n,
|
|
24
|
+
inset: t
|
|
21
25
|
};
|
|
22
26
|
case "outer": return {
|
|
23
|
-
outset:
|
|
27
|
+
outset: t + n,
|
|
24
28
|
inset: 0
|
|
25
29
|
};
|
|
26
30
|
default: return {
|
|
27
|
-
outset:
|
|
28
|
-
inset:
|
|
31
|
+
outset: t / 2 + n,
|
|
32
|
+
inset: t / 2
|
|
29
33
|
};
|
|
30
34
|
}
|
|
31
|
-
}, o =
|
|
32
|
-
if (typeof o != "object" && !(
|
|
33
|
-
let c =
|
|
35
|
+
}, o = e.width ?? 1, s = r(typeof o == "object" ? 0 : a(o, t ?? 1), n.world);
|
|
36
|
+
if (typeof o != "object" && !(n.px > 0)) return s;
|
|
37
|
+
let c = r(typeof o == "object" ? o.px : 0, n.px);
|
|
34
38
|
return {
|
|
35
39
|
outset: s.outset,
|
|
36
40
|
inset: s.inset,
|
|
@@ -38,10 +42,10 @@ function a(n, r) {
|
|
|
38
42
|
insetPx: c.inset
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
|
-
function
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
44
|
-
let a = 4 *
|
|
45
|
+
function l(e, t) {
|
|
46
|
+
let n = t?.vertexColors, i = e[0];
|
|
47
|
+
if (n === void 0 || i?.kind !== "path") return e;
|
|
48
|
+
let a = 4 * r(i.path), o = i.fill ? n("fill", i.vertexColors) : void 0, s = i.stroke ? n("stroke", i.stroke.vertexColors) : void 0, c = o?.length === a && o !== i.vertexColors, l = s?.length === a && s !== i.stroke?.vertexColors;
|
|
45
49
|
return !c && !l ? e : [{
|
|
46
50
|
...i,
|
|
47
51
|
...c ? { vertexColors: o } : {},
|
|
@@ -51,7 +55,14 @@ function o(e, t) {
|
|
|
51
55
|
} } : {}
|
|
52
56
|
}, ...e.slice(1)];
|
|
53
57
|
}
|
|
58
|
+
function u(e) {
|
|
59
|
+
let n = s(e.stroke), r = o(e.fill, n === null ? t : null);
|
|
60
|
+
return n === null ? { fill: r } : {
|
|
61
|
+
fill: r,
|
|
62
|
+
stroke: n
|
|
63
|
+
};
|
|
64
|
+
}
|
|
54
65
|
//#endregion
|
|
55
|
-
export {
|
|
66
|
+
export { c as inkReach, u as pathPaintOf, o as resolveNodeFill, s as resolveNodeStroke, l as withAnimatedVertexColors };
|
|
56
67
|
|
|
57
68
|
//# sourceMappingURL=nodePaint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodePaint.js","names":["resolveNodeFill","fill","fallback","resolveNodeStroke","stroke","inkReach","heads","markerReach","sides","headReach","width","world","resolveStrokeWidth","scale","px","withAnimatedVertexColors","resolve","ctx","body","cmds","expected","countPathAnchors","fillChanged","strokeChanged"],"sources":["../../../src/canvas/nodeShapes/nodePaint.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"nodePaint.js","names":["paintDrawKindRegistry","bumpNodeMemoGeneration","resolveNodeFill","declared","fill","fallback","resolveNodeStroke","stroke","inkReach","heads","markerReach","sides","headReach","width","world","resolveStrokeWidth","scale","px","withAnimatedVertexColors","resolve","ctx","body","cmds","expected","countPathAnchors","fillChanged","strokeChanged","pathPaintOf","data","DEFAULT_SHAPE_FILL"],"sources":["../../../src/canvas/nodeShapes/nodePaint.ts"],"sourcesContent":["import type { Paint, Stroke, Fill } from '@weasel-js/paint';\nimport type { NodeInk, NodePaintCtx } from 'canvas/NodeShape';\nimport { countPathAnchors } from '@weasel-js/geom';\nimport { markerReach } from '@weasel-js/stroke';\nimport { resolveStrokeWidth } from '@weasel-js/stroke';\nimport type { DrawCommand, PathDrawCommand } from '@weasel-js/renderer';\nimport { paintDrawKindRegistry } from '@weasel-js/renderer';\nimport { bumpNodeMemoGeneration } from 'core/scene/nodeMemo';\nimport { DEFAULT_SHAPE_FILL } from '../../util/paint';\n\n// The painters memoize a node's paint and resolve a fill's frame inside the\n// memo, so the kind set is ambient state that memo cannot see change.\npaintDrawKindRegistry.subscribe(bumpNodeMemoGeneration);\n\n/**\n * What a node's `data.fill` means to the built-in painters.\n *\n * Its {@link Paint} is used as-is — which is how a gradient or a pattern\n * reaches the renderer without a consumer registering a painter of its own.\n * `null` is an explicit \"no fill\", and so is a fill carrying no `paint`;\n * `undefined` takes the painter's fallback. Write the paint with\n * {@link solid} rather than by hand when all you have is a color.\n */\nexport function resolveNodeFill(\n fill: Fill | null | undefined,\n fallback: Fill | null,\n): PaintedFill | null {\n const declared = fill === undefined ? fallback : fill;\n return declared?.paint == null ? null : (declared as PaintedFill);\n}\n\n/** A fill that paints — what everything downstream of `resolveNodeFill`\n * works with. */\nexport type PaintedFill = Fill & { paint: Paint };\n\n/** The stroke a built-in painter should emit, or `null` for \"no stroke\".\n * `data.stroke` is a whole {@link Stroke} — width, cap, join, dash, miter\n * limit, and align all reach the renderer. {@link strokeOf} builds one from a\n * color.\n *\n * A stroke carrying no `paint` reads as no stroke. The type requires `paint`,\n * but a document is data, and a stroke assembled a field at a time arrives\n * here without one; painting it throws out of the painter and takes the whole\n * frame with it. */\nexport function resolveNodeStroke(stroke: Stroke | null | undefined): PaintedStroke | null {\n if (stroke?.paint == null) return null;\n return stroke as PaintedStroke;\n}\n\n/** A stroke that paints — what everything downstream of `resolveNodeStroke`\n * works with. */\nexport type PaintedStroke = Stroke & { paint: Paint };\n\n/** Per-side grab reach for a resolved stroke: world units for what the\n * renderer builds in world, screen pixels for what it builds on screen — a\n * `{ px }` width, and each head by its own size's units. */\nexport function inkReach(\n stroke: Stroke | null,\n scale: number | undefined,\n): Pick<NodeInk, 'outset' | 'inset' | 'outsetPx' | 'insetPx'> {\n if (stroke === null) return { outset: 0, inset: 0 };\n // A marker paints past the path's own end, and the kit's rule is that\n // visible chrome is hittable — so the reach has to cover it.\n const heads = markerReach(stroke);\n const sides = (width: number, headReach: number) => {\n switch (stroke.align ?? 'center') {\n case 'inner': return { outset: headReach, inset: width };\n case 'outer': return { outset: width + headReach, inset: 0 };\n default: return { outset: width / 2 + headReach, inset: width / 2 };\n }\n };\n const width = stroke.width ?? 1;\n const world = sides(typeof width === 'object' ? 0 : resolveStrokeWidth(width, scale ?? 1), heads.world);\n if (typeof width !== 'object' && !(heads.px > 0)) return world;\n const px = sides(typeof width === 'object' ? width.px : 0, heads.px);\n return { outset: world.outset, inset: world.inset, outsetPx: px.outset, insetPx: px.inset };\n}\n\n/** Apply {@link NodePaintCtx.vertexColors} to a path painter's body — its first\n * command. Applied outside the paint memo, whose key\n * cannot see an override: `cmds` comes back as-is when nothing changes, and\n * otherwise as a copy, since a memoized list is not ours to edit. Colors whose\n * length does not match the path's anchors are dropped. */\nexport function withAnimatedVertexColors(cmds: DrawCommand[], ctx: NodePaintCtx | undefined): DrawCommand[] {\n const resolve = ctx?.vertexColors;\n const body = cmds[0];\n if (resolve === undefined || body?.kind !== 'path') return cmds;\n const expected = 4 * countPathAnchors(body.path);\n const fill = body.fill ? resolve('fill', body.vertexColors) : undefined;\n const stroke = body.stroke ? resolve('stroke', body.stroke.vertexColors) : undefined;\n const fillChanged = fill?.length === expected && fill !== body.vertexColors;\n const strokeChanged = stroke?.length === expected && stroke !== body.stroke?.vertexColors;\n if (!fillChanged && !strokeChanged) return cmds;\n const next: PathDrawCommand = {\n ...body,\n ...(fillChanged ? { vertexColors: fill as number[] } : {}),\n ...(strokeChanged ? { stroke: { ...body.stroke!, vertexColors: stroke as number[] } } : {}),\n };\n return [next, ...cmds.slice(1)];\n}\n\n/** The paint a path node wears, resolved: what an action that turns ink into\n * geometry reads from a node and tells a consumer to put on a result. */\nexport interface PathPaint {\n /** `null` is no fill. */\n fill: Fill | null;\n /** Absent for no stroke. */\n stroke?: Stroke;\n}\n\n/** {@link PathPaint} of a node that keeps its paint in `data.fill` and\n * `data.stroke`, as the built-in path painter draws it: a stroke with no\n * `paint` is none, and an undeclared fill is the default shape fill unless\n * the node is stroked. */\nexport function pathPaintOf(data: { fill?: Fill | null; stroke?: Stroke | null }): PathPaint {\n const stroke = resolveNodeStroke(data.stroke);\n const fill = resolveNodeFill(data.fill, stroke !== null ? null : DEFAULT_SHAPE_FILL);\n return stroke !== null ? { fill, stroke } : { fill };\n}\n"],"mappings":";;;;;;AAYAA,EAAsB,UAAUC,CAAsB;AAWtD,SAAgBC,EACd,GACA,GACoB;CACpB,IAAMC,IAAWC,MAAS,KAAA,IAAYC,IAAWD;CACjD,OAAOD,GAAU,SAAS,OAAO,OAAQA;AAC3C;AAeA,SAAgBG,EAAkB,GAAyD;CAEzF,OADIC,GAAQ,SAAS,OAAa,OAC3BA;AACT;AASA,SAAgBC,EACd,GACA,GAC4D;CAC5D,IAAID,MAAW,MAAM,OAAO;EAAE,QAAQ;EAAG,OAAO;CAAE;CAGlD,IAAME,IAAQC,EAAYH,CAAM,GAC1BI,KAAS,GAAe,MAAsB;EAClD,QAAQJ,EAAO,SAAS,UAAxB;GACE,KAAK,SAAS,OAAO;IAAE,QAAQK;IAAW,OAAOC;GAAM;GACvD,KAAK,SAAS,OAAO;IAAE,QAAQA,IAAQD;IAAW,OAAO;GAAE;GAC3D,SAAS,OAAO;IAAE,QAAQC,IAAQ,IAAID;IAAW,OAAOC,IAAQ;GAAE;EACpE;CACF,GACMA,IAAQN,EAAO,SAAS,GACxBO,IAAQH,EAAM,OAAOE,KAAU,WAAW,IAAIE,EAAmBF,GAAOG,KAAS,CAAC,GAAGP,EAAM,KAAK;CACtG,IAAI,OAAOI,KAAU,YAAY,EAAEJ,EAAM,KAAK,IAAI,OAAOK;CACzD,IAAMG,IAAKN,EAAM,OAAOE,KAAU,WAAWA,EAAM,KAAK,GAAGJ,EAAM,EAAE;CACnE,OAAO;EAAE,QAAQK,EAAM;EAAQ,OAAOA,EAAM;EAAO,UAAUG,EAAG;EAAQ,SAASA,EAAG;CAAM;AAC5F;AAOA,SAAgBC,EAAyB,GAAqB,GAA8C;CAC1G,IAAMC,IAAUC,GAAK,cACfC,IAAOC,EAAK;CAClB,IAAIH,MAAY,KAAA,KAAaE,GAAM,SAAS,QAAQ,OAAOC;CAC3D,IAAMC,IAAW,IAAIC,EAAiBH,EAAK,IAAI,GACzCjB,IAAOiB,EAAK,OAAOF,EAAQ,QAAQE,EAAK,YAAY,IAAI,KAAA,GACxDd,IAASc,EAAK,SAASF,EAAQ,UAAUE,EAAK,OAAO,YAAY,IAAI,KAAA,GACrEI,IAAcrB,GAAM,WAAWmB,KAAYnB,MAASiB,EAAK,cACzDK,IAAgBnB,GAAQ,WAAWgB,KAAYhB,MAAWc,EAAK,QAAQ;CAO7E,OANI,CAACI,KAAe,CAACC,IAAsBJ,IAMpC,CAAC;EAJN,GAAGD;EACH,GAAII,IAAc,EAAE,cAAcrB,EAAiB,IAAI,CAAC;EACxD,GAAIsB,IAAgB,EAAE,QAAQ;GAAE,GAAGL,EAAK;GAAS,cAAcd;EAAmB,EAAE,IAAI,CAAC;CAEnF,GAAM,GAAGe,EAAK,MAAM,CAAC,CAAC;AAChC;AAeA,SAAgBK,EAAY,GAAiE;CAC3F,IAAMpB,IAASD,EAAkBsB,EAAK,MAAM,GACtCxB,IAAOF,EAAgB0B,EAAK,MAAMrB,MAAW,OAAcsB,IAAP,IAAyB;CACnF,OAAOtB,MAAW,OAA0B,EAAE,QAAK,IAA1B;EAAE;EAAM;CAAO;AAC1C"}
|