@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,34 +0,0 @@
|
|
|
1
|
-
import { createReflectable as e } from "@weasel-js/registry";
|
|
2
|
-
//#region src/renderer/textures/registerTexture.ts
|
|
3
|
-
var t = 0, n = e(), r = n.reflection, i = [];
|
|
4
|
-
function a(e, t) {
|
|
5
|
-
let n = {
|
|
6
|
-
prefix: e,
|
|
7
|
-
owner: t
|
|
8
|
-
};
|
|
9
|
-
return i.push(n), () => {
|
|
10
|
-
let e = i.indexOf(n);
|
|
11
|
-
e !== -1 && i.splice(e, 1);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function o(e) {
|
|
15
|
-
for (let t = 0; t < i.length; t++) if (e.startsWith(i[t].prefix)) return i[t].owner;
|
|
16
|
-
}
|
|
17
|
-
function s(e) {
|
|
18
|
-
let t = i.length > 0 ? o(e) : void 0, r = n.get(e);
|
|
19
|
-
return r ? (t?.touched?.(e), r) : t ? (t.revive(e), n.get(e) ?? null) : null;
|
|
20
|
-
}
|
|
21
|
-
function c(e) {
|
|
22
|
-
let r = `tex_${++t}`;
|
|
23
|
-
return n.set(r, { source: e }), { id: r };
|
|
24
|
-
}
|
|
25
|
-
function l(e, t) {
|
|
26
|
-
return n.set(e, { source: t }), { id: e };
|
|
27
|
-
}
|
|
28
|
-
function u(e) {
|
|
29
|
-
return n.delete(e.id);
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { s as getTexture, a as ownTextureIds, c as registerTexture, l as registerTextureAs, r as textureRegistry, u as unregisterTexture };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=registerTexture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerTexture.js","names":["counter","registry","createReflectable","textureRegistry","owners","ownTextureIds","claim","i","ownerOf","id","getTexture","owner","hit","registerTexture","image","registerTextureAs","unregisterTexture","handle"],"sources":["../../../src/renderer/textures/registerTexture.ts"],"sourcesContent":["/**\n * registerTexture — accepts an image source, assigns an opaque id, stores in\n * a module-level registry. Actual GL upload happens lazily at draw time in\n * drawShader() via GLTextureCache.upload (which is idempotent).\n *\n * Lifecycle: a texture lives until `unregisterTexture`. Each renderer frees\n * its own GL copy at the top of its next frame.\n *\n * Convention §9: this registry stores image data only — no per-renderer state.\n * Each WeaselRenderer's GLTextureCache does its own dedup by id and source.\n */\n\nimport type { TextureHandle } from '@weasel-js/paint';\nimport { createReflectable, type Reflection } from '@weasel-js/registry';\n\nexport type { TextureHandle };\n\n/** A registered texture's image source, uploaded to GL lazily at first draw. */\nexport interface TextureEntry {\n source: HTMLImageElement | ImageBitmap;\n}\n\nlet counter = 0;\nconst registry = createReflectable<TextureEntry>();\n\n/** Every registered texture, keyed by its handle id. */\nexport const textureRegistry: Reflection<TextureEntry> = registry.reflection;\n\n/** @internal Test helper — do not call from product code. */\nexport function _resetTextureRegistryForTests(): void {\n registry.clear();\n counter = 0;\n}\n\n/**\n * Whoever mints the ids under one prefix and can rebuild any of them.\n * @internal\n */\nexport interface TextureIdOwner {\n /** Register `id` again if it can be rebuilt; do nothing otherwise. */\n revive(id: string): void;\n /** `id` was looked up and found: something is about to draw it. */\n touched?(id: string): void;\n}\n\nconst owners: { prefix: string; owner: TextureIdOwner }[] = [];\n\n/**\n * Claim every texture id starting with `prefix`. Returns the release.\n * @internal\n */\nexport function ownTextureIds(prefix: string, owner: TextureIdOwner): () => void {\n const claim = { prefix, owner };\n owners.push(claim);\n return () => {\n const i = owners.indexOf(claim);\n if (i !== -1) owners.splice(i, 1);\n };\n}\n\nfunction ownerOf(id: string): TextureIdOwner | undefined {\n for (let i = 0; i < owners.length; i++) {\n if (id.startsWith(owners[i].prefix)) return owners[i].owner;\n }\n return undefined;\n}\n\n/**\n * The entry for `id`, as a draw looks it up. An owned id that was\n * unregistered is rebuilt by its owner first, so a handle held past its\n * texture's eviction still draws.\n */\nexport function getTexture(id: string): TextureEntry | null {\n const owner = owners.length > 0 ? ownerOf(id) : undefined;\n const hit = registry.get(id);\n if (hit) {\n owner?.touched?.(id);\n return hit;\n }\n if (!owner) return null;\n owner.revive(id);\n return registry.get(id) ?? null;\n}\n\n/**\n * Register an image for use as a shader texture uniform.\n *\n * Returns a TextureHandle whose `id` can be passed as a ShaderUniform value.\n * The handle is valid for the lifetime of the renderer it will be used with.\n *\n * @param image The image to register. HTMLImageElement must be fully loaded.\n * @returns Opaque TextureHandle.\n */\nexport function registerTexture(\n image: HTMLImageElement | ImageBitmap,\n): TextureHandle {\n const id = `tex_${++counter}`;\n registry.set(id, { source: image });\n return { id };\n}\n\n/**\n * Register an image under an id its caller chose.\n * @internal\n */\nexport function registerTextureAs(\n id: string,\n image: HTMLImageElement | ImageBitmap,\n): TextureHandle {\n registry.set(id, { source: image });\n return { id };\n}\n\n/**\n * Drop a registered texture. Every renderer that uploaded it frees its GL\n * copy at the top of its next frame; a draw command still holding the handle\n * then draws nothing and warns. The image itself is the caller's to release.\n *\n * @returns Whether the handle was registered.\n */\nexport function unregisterTexture(handle: TextureHandle): boolean {\n return registry.delete(handle.id);\n}\n"],"mappings":";;AAsBA,IAAIA,IAAU,GACRC,IAAWC,EAAgC,GAGpCC,IAA4CF,EAAS,YAmB5DG,IAAsD,CAAC;AAM7D,SAAgBC,EAAc,GAAgB,GAAmC;CAC/E,IAAMC,IAAQ;EAAE;EAAQ;CAAM;CAE9B,OADAF,EAAO,KAAKE,CAAK,SACJ;EACX,IAAMC,IAAIH,EAAO,QAAQE,CAAK;EAC9B,AAAIC,MAAM,MAAIH,EAAO,OAAOG,GAAG,CAAC;CAClC;AACF;AAEA,SAASC,EAAQ,GAAwC;CACvD,KAAK,IAAID,IAAI,GAAGA,IAAIH,EAAO,QAAQ,KACjC,IAAIK,EAAG,WAAWL,EAAOG,EAAE,CAAC,MAAM,GAAG,OAAOH,EAAOG,EAAE,CAAC;AAG1D;AAOA,SAAgBG,EAAW,GAAiC;CAC1D,IAAMC,IAAQP,EAAO,SAAS,IAAII,EAAQC,CAAE,IAAI,KAAA,GAC1CG,IAAMX,EAAS,IAAIQ,CAAE;CAO3B,OANIG,KACFD,GAAO,UAAUF,CAAE,GACZG,KAEJD,KACLA,EAAM,OAAOF,CAAE,GACRR,EAAS,IAAIQ,CAAE,KAAK,QAFR;AAGrB;AAWA,SAAgBI,EACd,GACe;CACf,IAAMJ,IAAK,OAAO,EAAET;CAEpB,OADAC,EAAS,IAAIQ,GAAI,EAAE,QAAQK,EAAM,CAAC,GAC3B,EAAE,MAAG;AACd;AAMA,SAAgBC,EACd,GACA,GACe;CAEf,OADAd,EAAS,IAAIQ,GAAI,EAAE,QAAQK,EAAM,CAAC,GAC3B,EAAE,MAAG;AACd;AASA,SAAgBE,EAAkB,GAAgC;CAChE,OAAOf,EAAS,OAAOgB,EAAO,EAAE;AAClC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { useCallback as e, useLayoutEffect as t, useMemo as n, useRef as r } from "react";
|
|
2
|
-
import { useLatest as i } from "@weasel-js/react";
|
|
3
|
-
//#region src/scheduling/useVisibleRaf.ts
|
|
4
|
-
var a = () => typeof document < "u" && document.hidden, o = (e) => typeof e == "function" ? e() : e?.current ?? null;
|
|
5
|
-
function s(s, c = {}) {
|
|
6
|
-
let l = i(s), u = i(c), d = r(null), f = r(!1), p = r(!1), m = r(!0), h = r(!0), g = r(null), _ = r(null), v = e(() => u.current.dangerouslyRunWhenHidden === !0 || !a() && h.current, [u]), y = e(() => {
|
|
7
|
-
d.current !== null && ((u.current.cancelFrame ?? cancelAnimationFrame)(d.current), d.current = null);
|
|
8
|
-
}, [u]), b = e(() => {
|
|
9
|
-
d.current === null && m.current && (d.current = (u.current.requestFrame ?? requestAnimationFrame)((e) => {
|
|
10
|
-
d.current = null, m.current && f.current && v() && (f.current = !1, l.current(e));
|
|
11
|
-
}));
|
|
12
|
-
}, [
|
|
13
|
-
l,
|
|
14
|
-
v,
|
|
15
|
-
u
|
|
16
|
-
]), x = e(() => {
|
|
17
|
-
let e = g.current;
|
|
18
|
-
if (!e) return;
|
|
19
|
-
let t = o(u.current.target);
|
|
20
|
-
t !== _.current && (_.current && e.unobserve(_.current), _.current = t, h.current = !0, t && e.observe(t));
|
|
21
|
-
}, [u]), S = e(() => {
|
|
22
|
-
if (!v()) {
|
|
23
|
-
if (p.current) return;
|
|
24
|
-
p.current = !0, y();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
p.current && (p.current = !1, m.current && (u.current.onResume?.(), f.current && b()));
|
|
28
|
-
}, [
|
|
29
|
-
y,
|
|
30
|
-
v,
|
|
31
|
-
u,
|
|
32
|
-
b
|
|
33
|
-
]), C = e(() => {
|
|
34
|
-
if (m.current) {
|
|
35
|
-
if (x(), f.current = !0, !v()) {
|
|
36
|
-
p.current = !0;
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
b();
|
|
40
|
-
}
|
|
41
|
-
}, [
|
|
42
|
-
v,
|
|
43
|
-
b,
|
|
44
|
-
x
|
|
45
|
-
]), w = e(() => {
|
|
46
|
-
f.current = !1, y();
|
|
47
|
-
}, [y]);
|
|
48
|
-
return t(() => (m.current = !0, document.addEventListener("visibilitychange", S), typeof IntersectionObserver < "u" && (g.current = new IntersectionObserver((e) => {
|
|
49
|
-
h.current = e.some((e) => e.isIntersecting), S();
|
|
50
|
-
}), x()), () => {
|
|
51
|
-
m.current = !1, document.removeEventListener("visibilitychange", S), g.current?.disconnect(), g.current = null, _.current = null, h.current = !0, y(), f.current = !1, p.current = !1;
|
|
52
|
-
}), [
|
|
53
|
-
y,
|
|
54
|
-
S,
|
|
55
|
-
x
|
|
56
|
-
]), n(() => ({
|
|
57
|
-
request: C,
|
|
58
|
-
cancel: w,
|
|
59
|
-
isVisible: v
|
|
60
|
-
}), [
|
|
61
|
-
C,
|
|
62
|
-
w,
|
|
63
|
-
v
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { s as useVisibleRaf };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=useVisibleRaf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVisibleRaf.js","names":["documentHidden","resolveTarget","target","useVisibleRaf","frameRef","useLatest","frame","optsRef","options","rafRef","useRef","pendingRef","suspendedRef","aliveRef","intersectingRef","observerRef","observedRef","isVisible","useCallback","cancelRaf","scheduleRaf","time","syncObserver","io","el","syncGate","request","cancel","useLayoutEffect","entries","useMemo"],"sources":["../../src/scheduling/useVisibleRaf.ts"],"sourcesContent":["/**\n * The one place weasel decides whether a frame may run, so that \"a loop does no\n * work nobody can see\" holds by construction rather than by every loop author\n * remembering. Nothing runs while the document is hidden; a loop that names an\n * element also stops while that element is outside the viewport.\n *\n * A request made while suspended is held, not dropped, and re-armed when the\n * surface comes back — so a loop never needs to poll visibility itself.\n */\n\nimport { type RefObject, useCallback, useLayoutEffect, useMemo, useRef } from 'react';\nimport { useLatest } from '@weasel-js/react';\n\n/** What a loop names as its element, resolved every time the gate is consulted\n * so a ref filled in after mount still starts the observer. */\nexport type VisibleRafTarget = RefObject<Element | null> | (() => Element | null);\n\n/** Options for {@link useVisibleRaf}. */\nexport interface VisibleRafOptions {\n /** Also gate on this element's intersection with the viewport. Omit it and\n * the loop is gated on document visibility alone. */\n target?: VisibleRafTarget;\n /**\n * Run frames regardless of visibility. The escape hatch for a loop that is\n * not painting for a viewer — an offscreen recording, an export driving its\n * own frames. It is the wrong fix for a loop that stalls after a tab switch:\n * that is a missing `request()`, and setting this hides it.\n */\n dangerouslyRunWhenHidden?: boolean;\n /** Frame clock. Read live, so a test may inject one after mount. */\n requestFrame?: (cb: FrameRequestCallback) => number;\n cancelFrame?: (handle: number) => void;\n /**\n * Runs once when the loop leaves suspension, before the frame that follows\n * it. Where a loop that measures elapsed time drops the interval it spent\n * suspended — without it, an hour hidden arrives as one hour-long frame.\n */\n onResume?: () => void;\n}\n\n/** The handle {@link useVisibleRaf} returns. Nothing runs until `request()` is called. */\nexport interface VisibleRaf {\n /** Ask for a frame. Idempotent while one is outstanding, and held rather than\n * dropped while suspended. Identity is stable for the component's lifetime. */\n request(): void;\n /** Drop the outstanding request, held or scheduled. */\n cancel(): void;\n /** Whether a frame would run right now. */\n isVisible(): boolean;\n}\n\nconst documentHidden = (): boolean => typeof document !== 'undefined' && document.hidden;\n\nconst resolveTarget = (target: VisibleRafTarget | undefined): Element | null =>\n typeof target === 'function' ? target() : (target?.current ?? null);\n\n/**\n * @param frame Runs on the frame, with the timestamp the clock supplied.\n * A continuous loop calls `request()` again from inside it; a one-shot loop\n * does not.\n */\nexport function useVisibleRaf(\n frame: (time: number) => void,\n options: VisibleRafOptions = {},\n): VisibleRaf {\n const frameRef = useLatest(frame);\n const optsRef = useLatest(options);\n\n const rafRef = useRef<number | null>(null);\n const pendingRef = useRef(false);\n const suspendedRef = useRef(false);\n const aliveRef = useRef(true);\n const intersectingRef = useRef(true);\n const observerRef = useRef<IntersectionObserver | null>(null);\n const observedRef = useRef<Element | null>(null);\n\n const isVisible = useCallback(\n (): boolean =>\n optsRef.current.dangerouslyRunWhenHidden === true ||\n (!documentHidden() && intersectingRef.current),\n [optsRef],\n );\n\n const cancelRaf = useCallback(() => {\n if (rafRef.current === null) return;\n (optsRef.current.cancelFrame ?? cancelAnimationFrame)(rafRef.current);\n rafRef.current = null;\n }, [optsRef]);\n\n const scheduleRaf = useCallback(() => {\n if (rafRef.current !== null || !aliveRef.current) return;\n rafRef.current = (optsRef.current.requestFrame ?? requestAnimationFrame)((time) => {\n // Released before the frame runs, so a `request()` issued from inside it\n // schedules the next one instead of being swallowed.\n rafRef.current = null;\n if (!aliveRef.current || !pendingRef.current || !isVisible()) return;\n pendingRef.current = false;\n frameRef.current(time);\n });\n }, [frameRef, isVisible, optsRef]);\n\n /** Attaches the observer once the named element exists. Ref callbacks and\n * lazily-mounted hosts fill their refs after this hook's effect has run. */\n const syncObserver = useCallback(() => {\n const io = observerRef.current;\n if (!io) return;\n const el = resolveTarget(optsRef.current.target);\n if (el === observedRef.current) return;\n if (observedRef.current) io.unobserve(observedRef.current);\n observedRef.current = el;\n // An element that has gone away stops gating rather than stopping the loop.\n intersectingRef.current = true;\n if (el) io.observe(el);\n }, [optsRef]);\n\n /** Re-reads the gate after something that could have changed it. Suspending\n * drops the outstanding frame but keeps the request; resuming hands the\n * loop its rebase before re-arming. */\n const syncGate = useCallback(() => {\n if (!isVisible()) {\n if (suspendedRef.current) return;\n suspendedRef.current = true;\n cancelRaf();\n return;\n }\n if (!suspendedRef.current) return;\n suspendedRef.current = false;\n if (!aliveRef.current) return;\n optsRef.current.onResume?.();\n if (pendingRef.current) scheduleRaf();\n }, [cancelRaf, isVisible, optsRef, scheduleRaf]);\n\n const request = useCallback(() => {\n if (!aliveRef.current) return;\n syncObserver();\n pendingRef.current = true;\n if (!isVisible()) {\n suspendedRef.current = true;\n return;\n }\n scheduleRaf();\n }, [isVisible, scheduleRaf, syncObserver]);\n\n const cancel = useCallback(() => {\n pendingRef.current = false;\n cancelRaf();\n }, [cancelRaf]);\n\n // Re-armed in setup because the refs survive StrictMode's simulated remount, and\n // a layout effect so the arming precedes the host's own layout effects — a loop\n // driven from one of those would otherwise be declined on the second mount.\n useLayoutEffect(() => {\n aliveRef.current = true;\n document.addEventListener('visibilitychange', syncGate);\n if (typeof IntersectionObserver !== 'undefined') {\n observerRef.current = new IntersectionObserver((entries) => {\n intersectingRef.current = entries.some((e) => e.isIntersecting);\n syncGate();\n });\n syncObserver();\n }\n return () => {\n aliveRef.current = false;\n document.removeEventListener('visibilitychange', syncGate);\n observerRef.current?.disconnect();\n observerRef.current = null;\n observedRef.current = null;\n intersectingRef.current = true;\n cancelRaf();\n pendingRef.current = false;\n suspendedRef.current = false;\n };\n }, [cancelRaf, syncGate, syncObserver]);\n\n // Stable identity: `requestRedraw` and friends outlive the render that made\n // them, and consumers capture the handle.\n return useMemo(() => ({ request, cancel, isVisible }), [request, cancel, isVisible]);\n}\n"],"mappings":";;;AAmDA,IAAMA,UAAgC,OAAO,WAAa,OAAe,SAAS,QAE5EC,KAAiB,MACrB,OAAOC,KAAW,aAAaA,EAAO,IAAKA,GAAQ,WAAW;AAOhE,SAAgBC,EACd,GACA,IAA6B,CAAC,GAClB;CACZ,IAAMC,IAAWC,EAAUC,CAAK,GAC1BC,IAAUF,EAAUG,CAAO,GAE3BC,IAASC,EAAsB,IAAI,GACnCC,IAAaD,EAAO,EAAK,GACzBE,IAAeF,EAAO,EAAK,GAC3BG,IAAWH,EAAO,EAAI,GACtBI,IAAkBJ,EAAO,EAAI,GAC7BK,IAAcL,EAAoC,IAAI,GACtDM,IAAcN,EAAuB,IAAI,GAEzCO,IAAYC,QAEdX,EAAQ,QAAQ,6BAA6B,MAC5C,CAACP,EAAe,KAAKc,EAAgB,SACxC,CAACP,CAAO,CACV,GAEMY,IAAYD,QAAkB;EAClC,AAAIT,EAAO,YAAY,UACtBF,EAAQ,QAAQ,eAAe,qBAAA,CAAsBE,EAAO,OAAO,GACpE,EAAO,UAAU;CACnB,GAAG,CAACF,CAAO,CAAC,GAENa,IAAcF,QAAkB;EACpC,AAAIT,EAAO,YAAY,QAASI,EAAS,YACzC,EAAO,WAAWN,EAAQ,QAAQ,gBAAgB,sBAAA,EAAwB,MAAS;GAIjF,AADA,EAAO,UAAU,MACZM,EAAS,WAAYF,EAAW,WAAYM,EAAU,MAC3D,EAAW,UAAU,IACrBb,EAAS,QAAQiB,CAAI;EACvB,CAAC;CACH,GAAG;EAACjB;EAAUa;EAAWV;CAAO,CAAC,GAI3Be,IAAeJ,QAAkB;EACrC,IAAMK,IAAKR,EAAY;EACvB,IAAI,CAACQ,GAAI;EACT,IAAMC,IAAKvB,EAAcM,EAAQ,QAAQ,MAAM;EAC/C,AAAIiB,MAAOR,EAAY,YACnBA,EAAY,WAASO,EAAG,UAAUP,EAAY,OAAO,GACzD,EAAY,UAAUQ,GAEtB,EAAgB,UAAU,IACtBA,KAAID,EAAG,QAAQC,CAAE;CACvB,GAAG,CAACjB,CAAO,CAAC,GAKNkB,IAAWP,QAAkB;EACjC,IAAI,CAACD,EAAU,GAAG;GAChB,IAAIL,EAAa,SAAS;GAE1B,AADA,EAAa,UAAU,IACvBO,EAAU;GACV;EACF;EACA,AAAKP,EAAa,YAClB,EAAa,UAAU,IAClBC,EAAS,YACdN,EAAQ,QAAQ,WAAW,GACvBI,EAAW,WAASS,EAAY;CACtC,GAAG;EAACD;EAAWF;EAAWV;EAASa;CAAW,CAAC,GAEzCM,IAAUR,QAAkB;EAChC,IAAKL,EAAS,SAGd;OAFAS,EAAa,GACb,EAAW,UAAU,IACjB,CAACL,EAAU,GAAG;IAChB,EAAa,UAAU;IACvB;GACF;GACA,EAAY;EADZ;CAEF,GAAG;EAACA;EAAWG;EAAaE;CAAY,CAAC,GAEnCK,IAAST,QAAkB;EAE/B,AADA,EAAW,UAAU,IACrBC,EAAU;CACZ,GAAG,CAACA,CAAS,CAAC;CA8Bd,OAzBAS,SACE,EAAS,UAAU,IACnB,SAAS,iBAAiB,oBAAoBH,CAAQ,GAClD,OAAO,uBAAyB,QAClC,EAAY,UAAU,IAAI,sBAAsB,MAAY;EAE1D,AADA,EAAgB,UAAUI,EAAQ,MAAM,MAAM,EAAE,cAAc,GAC9DJ,EAAS;CACX,CAAC,GACDH,EAAa,UAEF;EASX,AARA,EAAS,UAAU,IACnB,SAAS,oBAAoB,oBAAoBG,CAAQ,GACzDV,EAAY,SAAS,WAAW,GAChC,EAAY,UAAU,MACtB,EAAY,UAAU,MACtB,EAAgB,UAAU,IAC1BI,EAAU,GACV,EAAW,UAAU,IACrB,EAAa,UAAU;CACzB,IACC;EAACA;EAAWM;EAAUH;CAAY,CAAC,GAI/BQ,SAAe;EAAE;EAAS;EAAQ;CAAU,IAAI;EAACJ;EAASC;EAAQV;CAAS,CAAC;AACrF"}
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import { FillStyle, PosedFill, GradientUnits, GradStop, ColorSpace, MarkerKey, Stroke } from '@weasel-js/paint';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
import { Reflection } from '@weasel-js/registry';
|
|
4
|
-
import { c as ShaderProgram, G as GlMat3, P as ProgramSource } from './registerProgram-T9S_PfAX.js';
|
|
5
|
-
import { Path } from '@weasel-js/geom';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Resolve a `units: 'bounds'` gradient into the frame its node is painted in.
|
|
9
|
-
*
|
|
10
|
-
* Node painters bake the pose into their geometry (`pathInPoseFrame`) rather
|
|
11
|
-
* than emitting a per-node transform, so by the time the renderer sees a
|
|
12
|
-
* scene node there is no node-local space left for a gradient to refer to.
|
|
13
|
-
* This is the paint-side counterpart: it maps box-relative gradient geometry
|
|
14
|
-
* onto the same box the path was just projected into, so the two arrive in
|
|
15
|
-
* the renderer in one frame.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/** The box a `'bounds'` gradient's normalized geometry is mapped onto —
|
|
19
|
-
* usually a node's bounds. */
|
|
20
|
-
interface FillPoseBox {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Map a `'bounds'` gradient's `0..1` geometry onto `box`, returning it in the
|
|
28
|
-
* box's own frame (`units: 'local'`). Any other fill — solid, pattern, or a
|
|
29
|
-
* gradient in another space — is returned untouched.
|
|
30
|
-
*
|
|
31
|
-
* Radii scale by the box's normalized diagonal, SVG's rule for a percentage
|
|
32
|
-
* radius against `objectBoundingBox`: `sqrt(w² + h²) / sqrt(2)`, which is
|
|
33
|
-
* exactly `w` for a square box. The renderer's radial gradient is circular,
|
|
34
|
-
* so a non-square box cannot make it the ellipse SVG would — this keeps the
|
|
35
|
-
* radius proportionate instead.
|
|
36
|
-
*/
|
|
37
|
-
declare function fillInPoseFrame(fill: FillStyle, box: FillPoseBox): PosedFill;
|
|
38
|
-
/**
|
|
39
|
-
* Inverse of {@link fillInPoseFrame}: express a gradient already positioned
|
|
40
|
-
* in `box`'s frame as `0..1` fractions of that box (`units: 'bounds'`), so
|
|
41
|
-
* it follows the node when moved or resized.
|
|
42
|
-
*
|
|
43
|
-
* The importer's counterpart — SVG `userSpaceOnUse` coordinates arrive in
|
|
44
|
-
* page space, and normalizing them here makes an imported gradient behave
|
|
45
|
-
* exactly like one drawn in the app.
|
|
46
|
-
*
|
|
47
|
-
* A zero-width or zero-height box has no frame to normalize against; the
|
|
48
|
-
* fill is returned untouched rather than divided by zero.
|
|
49
|
-
*/
|
|
50
|
-
declare function fillToBoundsFrame(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The paint-kind registry — what makes `FillStyle` open.
|
|
54
|
-
*
|
|
55
|
-
* A consumer registers a sixth kind and it renders, converts between the
|
|
56
|
-
* bounds and pose frames, and serializes, with no kit edits. The five built-in
|
|
57
|
-
* kinds are registered here at module load so an editor's kind bar can
|
|
58
|
-
* enumerate every kind through one list.
|
|
59
|
-
*
|
|
60
|
-
* Each kit layer consults this registry for a kind it does not recognize and
|
|
61
|
-
* otherwise runs its own built-in branch. That split is not laziness: a built-in
|
|
62
|
-
* kind's render slot lives in the GL renderer, its serialize slot lives in
|
|
63
|
-
* `@weasel-js/svg`, and neither can be imported from here without inverting a
|
|
64
|
-
* package dependency.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/** A compiled GL program. A paint kind gets one from
|
|
68
|
-
* {@link PaintBindContext.program} and hands it back from `bind`. */
|
|
69
|
-
type PaintProgram = ShaderProgram;
|
|
70
|
-
/**
|
|
71
|
-
* `FillStyle`'s discriminant, open on the string the way `ChromeId` is: the
|
|
72
|
-
* five kinds the kit ships, plus whatever a consumer registers.
|
|
73
|
-
*/
|
|
74
|
-
type PaintKind = 'solid' | 'linear-gradient' | 'radial-gradient' | 'conic-gradient' | 'pattern' | (string & {});
|
|
75
|
-
/** What a registered kind's editor renders. `PaintInput` in `@weasel-js/ui`
|
|
76
|
-
* is the control that mounts it. */
|
|
77
|
-
interface PaintKindEditorProps {
|
|
78
|
-
value: FillStyle;
|
|
79
|
-
onInput?(next: FillStyle): void;
|
|
80
|
-
onChange(next: FillStyle): void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The lifetime a paint kind's GPU state belongs to: one renderer on one live
|
|
84
|
-
* context. The object itself is the key — a kind caches textures in a
|
|
85
|
-
* `WeakMap` on it, so two renderers sharing a context never trade them — and
|
|
86
|
-
* `onRelease` is where it frees them.
|
|
87
|
-
*/
|
|
88
|
-
interface PaintResources {
|
|
89
|
-
/** Run `release` once, when this lifetime ends: the renderer is disposed, or
|
|
90
|
-
* its context was lost and restored. Free every GL object made under it
|
|
91
|
-
* there. */
|
|
92
|
-
onRelease(release: () => void): void;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* The renderer surface a paint kind binds against, narrowed to what a paint
|
|
96
|
-
* needs. The full `DrawContext` is not consumer surface.
|
|
97
|
-
*/
|
|
98
|
-
interface PaintBindContext {
|
|
99
|
-
readonly gl: WebGL2RenderingContext;
|
|
100
|
-
/** The group alpha this draw inherits — multiply it into the paint's own. */
|
|
101
|
-
readonly alpha: number;
|
|
102
|
-
/**
|
|
103
|
-
* The compiled program for a `registerProgram` id, compiled against this
|
|
104
|
-
* renderer on first use. `null` when no source is registered under `id` or
|
|
105
|
-
* compilation failed.
|
|
106
|
-
*/
|
|
107
|
-
program(id: string): PaintProgram | null;
|
|
108
|
-
/** Send `u_proj` and `u_model`, which every kit vertex shader takes. */
|
|
109
|
-
setProjAndModel(program: PaintProgram): void;
|
|
110
|
-
/**
|
|
111
|
-
* `u_worldInv` for a paint declaring `units` — the inverse of the transform
|
|
112
|
-
* from the paint's space to the frame the geometry arrives in. Paired with
|
|
113
|
-
* the vertex shader's `v_world` varying this is *the* paint-space
|
|
114
|
-
* convention; it is not gradient-specific.
|
|
115
|
-
*
|
|
116
|
-
* `null` when that space has no inverse — a transform or view that flattens
|
|
117
|
-
* an axis. Nothing the paint draws there means anything, so `bind` should
|
|
118
|
-
* return `null` and draw nothing.
|
|
119
|
-
*/
|
|
120
|
-
spaceInverse(units: GradientUnits | undefined): GlMat3 | null;
|
|
121
|
-
/**
|
|
122
|
-
* The transform from the space `units` names to device pixels of the target
|
|
123
|
-
* this draw lands in — screen pixels times the pixel ratio on screen, output
|
|
124
|
-
* pixels in a headless render. It is what a paint baking a texture measures
|
|
125
|
-
* its resolution against. `null` where `spaceInverse` is.
|
|
126
|
-
*/
|
|
127
|
-
spaceToDevice(units: GradientUnits | undefined): GlMat3 | null;
|
|
128
|
-
/** The largest texture side this context accepts, `MAX_TEXTURE_SIZE`. */
|
|
129
|
-
readonly maxTextureSize: number;
|
|
130
|
-
/** The lifetime GPU state made for this draw belongs to. Stable across the
|
|
131
|
-
* frames of one renderer, so it is the key for a kind's texture cache. */
|
|
132
|
-
readonly resources: PaintResources;
|
|
133
|
-
/**
|
|
134
|
-
* Bake a stop ramp into the frame's ramp atlas, bind that atlas to a texture
|
|
135
|
-
* unit, and return the `v` the ramp's own row sits at — every ramp in a
|
|
136
|
-
* frame shares one texture, so a paint must sample at the returned `v` and
|
|
137
|
-
* not at a constant.
|
|
138
|
-
*
|
|
139
|
-
* `space` is the blend the stops are baked through, defaulting to `'rgb'`.
|
|
140
|
-
* It is part of the atlas key, so the same stops under two spaces take two
|
|
141
|
-
* rows rather than colliding.
|
|
142
|
-
*/
|
|
143
|
-
bindRamp(stops: GradStop[], unit: number, space?: ColorSpace): number;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* One paint kind.
|
|
147
|
-
*
|
|
148
|
-
* `seed`, `label` and `colorOf` are the editor's slots and every kind has
|
|
149
|
-
* them. The rest are optional because a kind may not need them — but
|
|
150
|
-
* `inPoseFrame` and `toBoundsFrame` come as a pair or not at all: a kind that
|
|
151
|
-
* converts one direction and not the other paints correctly once and then
|
|
152
|
-
* drifts on the next resize.
|
|
153
|
-
*/
|
|
154
|
-
interface PaintKindEntry {
|
|
155
|
-
id: string;
|
|
156
|
-
label: string;
|
|
157
|
-
/** Glyph naming this kind in an editor's kind bar, as an icon name the UI
|
|
158
|
-
* layer resolves — the same indirection `PrefBase.icon` uses. A kind
|
|
159
|
-
* without one is named by its `label`. */
|
|
160
|
-
icon?: string;
|
|
161
|
-
/** A paint of this kind seeded from a color — what an editor writes when a
|
|
162
|
-
* consumer switches a solid to this kind. */
|
|
163
|
-
seed(fromColor: string): FillStyle;
|
|
164
|
-
/** The single color this paint shows, or `undefined` when it has none. */
|
|
165
|
-
colorOf(paint: FillStyle): string | undefined;
|
|
166
|
-
/** Editor slot. */
|
|
167
|
-
Editor?: ComponentType<PaintKindEditorProps>;
|
|
168
|
-
/**
|
|
169
|
-
* The stop list this paint reads as. With `fromStops`, it is what makes a
|
|
170
|
-
* kind a gradient: `listGradientKinds` returns the kinds carrying both, and
|
|
171
|
-
* `switchGradientKind` converts between any two of them through the list.
|
|
172
|
-
*/
|
|
173
|
-
stopsOf?(paint: FillStyle): GradStop[];
|
|
174
|
-
/** A paint of this kind built from a stop list, in `bounds` units. The
|
|
175
|
-
* converse of `stopsOf`; supply both or neither. */
|
|
176
|
-
fromStops?(stops: GradStop[]): FillStyle;
|
|
177
|
-
/**
|
|
178
|
-
* Render slot: bind program, uniforms and textures for `fill` and return the
|
|
179
|
-
* bound program; `null` declines the paint.
|
|
180
|
-
*
|
|
181
|
-
* Binding is split from drawing on purpose — a caller owning its own stencil
|
|
182
|
-
* state (an inner/outer-aligned stroke, an even-odd fill) must issue its own
|
|
183
|
-
* draw call, and the kit's draw wrapper would clobber that state. Shader
|
|
184
|
-
* output must be premultiplied: `outColor = vec4(rgb * a, a)`.
|
|
185
|
-
*
|
|
186
|
-
* The geometry is not always the node's own. Text below the outline tier
|
|
187
|
-
* paints by drawing a quad over its glyphs' screen box into an offscreen
|
|
188
|
-
* buffer and masking that with glyph coverage, so a paint must come from
|
|
189
|
-
* `v_world` through `spaceInverse`, not from where `a_position` happens to
|
|
190
|
-
* lie.
|
|
191
|
-
*/
|
|
192
|
-
bind?(ctx: PaintBindContext, fill: FillStyle): PaintProgram | null;
|
|
193
|
-
/** Bounds frame → the frame the node is painted in. */
|
|
194
|
-
inPoseFrame?(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
195
|
-
/** The inverse. Required whenever `inPoseFrame` is supplied. */
|
|
196
|
-
toBoundsFrame?(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
197
|
-
/**
|
|
198
|
-
* The `<defs>` entry backing a `url(#id)` reference.
|
|
199
|
-
*
|
|
200
|
-
* SVG has paint servers for two gradients and a pattern and nothing else, so
|
|
201
|
-
* a kind beyond those has no element to target: write a foreign-namespaced
|
|
202
|
-
* one under the `wzl:` prefix `@weasel-js/svg` declares on the root whenever
|
|
203
|
-
* a document holds such a paint. That package emits the fallback color
|
|
204
|
-
* beside the reference on its own, from `colorOf`.
|
|
205
|
-
*/
|
|
206
|
-
toSvg?(id: string, fill: FillStyle): string;
|
|
207
|
-
/**
|
|
208
|
-
* Shader programs `bind` looks up through `ctx.program`, keyed by program
|
|
209
|
-
* id; registering the kind registers them. Declaring them here rather than
|
|
210
|
-
* calling `registerProgram` at import keeps a kind loaded by
|
|
211
|
-
* {@link registerPaintKindLoader} free of core's registries.
|
|
212
|
-
*/
|
|
213
|
-
programs?: Readonly<Record<string, ProgramSource>>;
|
|
214
|
-
}
|
|
215
|
-
/** Every registered paint kind, with the overrides each displaced. */
|
|
216
|
-
declare const paintKindRegistry: Reflection<PaintKindEntry>;
|
|
217
|
-
/**
|
|
218
|
-
* A consumer's own paint, typed as a `FillStyle`.
|
|
219
|
-
*
|
|
220
|
-
* `FillStyle` stays a closed union: opening its discriminant would widen every
|
|
221
|
-
* built-in member and break the narrowing the kit's own branches depend on.
|
|
222
|
-
* A registered kind declares its own interface instead and passes it through
|
|
223
|
-
* here — the kit reads only `fill` and hands the whole object back to that
|
|
224
|
-
* kind's slots.
|
|
225
|
-
*/
|
|
226
|
-
declare function asPaint<T extends {
|
|
227
|
-
fill: string;
|
|
228
|
-
}>(paint: T): FillStyle;
|
|
229
|
-
/** Register a paint kind. Returns a disposer that removes it. Re-registering an
|
|
230
|
-
* existing id is an override; disposing it uncovers whatever it displaced. */
|
|
231
|
-
declare function registerPaintKind(entry: PaintKindEntry): () => void;
|
|
232
|
-
/** The entry for `kind`, or `undefined`. A lookup that misses on a kind with
|
|
233
|
-
* a loader starts that load; see {@link registerPaintKindLoader}. */
|
|
234
|
-
declare function getPaintKind(kind: string | undefined): PaintKindEntry | undefined;
|
|
235
|
-
/** Resolves with the entry for a kind that is loaded on first use. */
|
|
236
|
-
type PaintKindLoader = () => Promise<PaintKindEntry>;
|
|
237
|
-
/**
|
|
238
|
-
* Declare a paint kind that is loaded the first time something looks it up,
|
|
239
|
-
* so its code stays out of the bundle until a paint of it appears — typically
|
|
240
|
-
* `() => import('./myKind').then((m) => m.myKindEntry)`.
|
|
241
|
-
*
|
|
242
|
-
* Until it lands the kind is unregistered: the renderer draws nothing for its
|
|
243
|
-
* paints, and every other reader treats it as unknown. Registering it fires
|
|
244
|
-
* `paintKindRegistry`'s subscribers, which is what `<SceneCanvas>` repaints
|
|
245
|
-
* on. Call {@link warmPaintKinds} to load ahead of the first frame instead.
|
|
246
|
-
*
|
|
247
|
-
* A kind that is already registered never calls its loader. Returns a
|
|
248
|
-
* disposer that removes the loader.
|
|
249
|
-
*/
|
|
250
|
-
declare function registerPaintKindLoader(id: string, load: PaintKindLoader): () => void;
|
|
251
|
-
/** Is `id` registered, or declared with a loader? */
|
|
252
|
-
declare function isPaintKindKnown(id: string): boolean;
|
|
253
|
-
/**
|
|
254
|
-
* Load paint kinds ahead of their first use, so the first frame that meets
|
|
255
|
-
* one draws it rather than a blank. With no list, loads every kind that has a
|
|
256
|
-
* loader — the kit's lazily loaded built-ins (`mesh-gradient`) plus any a
|
|
257
|
-
* consumer declared with {@link registerPaintKindLoader}.
|
|
258
|
-
*
|
|
259
|
-
* Resolves once every kind is registered; a kind already registered counts
|
|
260
|
-
* as loaded. Rejects when a load fails, or for a kind that is neither
|
|
261
|
-
* registered nor loadable.
|
|
262
|
-
*/
|
|
263
|
-
declare function warmPaintKinds(kinds?: readonly string[]): Promise<void>;
|
|
264
|
-
/** Every registered kind, built-ins first, in registration order. The same
|
|
265
|
-
* array until the registry changes. */
|
|
266
|
-
declare function listPaintKinds(): readonly PaintKindEntry[];
|
|
267
|
-
/** Every registered gradient kind — the ones that read as and build from a
|
|
268
|
-
* stop list — in registration order. The same array until the registry
|
|
269
|
-
* changes. */
|
|
270
|
-
declare function listGradientKinds(): readonly PaintKindEntry[];
|
|
271
|
-
/**
|
|
272
|
-
* `paint` retargeted to gradient kind `kind`, or `undefined` when either side
|
|
273
|
-
* is not a gradient kind.
|
|
274
|
-
*
|
|
275
|
-
* Between two of the stop gradients this is `withGradientKind`, which carries
|
|
276
|
-
* the geometry. Any other pair goes through the stop list — `stopsOf` on the
|
|
277
|
-
* way out, `fromStops` on the way in — keeping `interpolate` and `opacity`.
|
|
278
|
-
* Lossy wherever the kinds hold different information; an editor that wants a
|
|
279
|
-
* switch to be undoable should keep the original paint.
|
|
280
|
-
*/
|
|
281
|
-
declare function switchGradientKind(paint: FillStyle, kind: PaintKind): FillStyle | undefined;
|
|
282
|
-
/** The registry entry for a paint, or `undefined` when its kind is unknown. */
|
|
283
|
-
declare function paintKindOf(fill: FillStyle): PaintKindEntry | undefined;
|
|
284
|
-
/** @internal Test helper — do not call from product code. */
|
|
285
|
-
declare function _resetPaintKindsForTests(): void;
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* The stroke-marker registry — arrowheads and other line terminators.
|
|
289
|
-
*
|
|
290
|
-
* Keyed by string, because a key is what sits in `stroke.markerEnd`. That is
|
|
291
|
-
* the difference from `registerNodeShape`, which resolves by first-matching
|
|
292
|
-
* predicate and whose `id` is only a label.
|
|
293
|
-
*
|
|
294
|
-
* A built-in's SVG slot lives in `@weasel-js/svg` and cannot be imported here
|
|
295
|
-
* without inverting a package dependency, so an entry carries `toSvg` for that
|
|
296
|
-
* package to consume — the same split `PaintKindEntry` uses.
|
|
297
|
-
*/
|
|
298
|
-
|
|
299
|
-
/** What an entry's `path` is given. Entries that ignore it may return a
|
|
300
|
-
* constant path. */
|
|
301
|
-
interface MarkerCtx {
|
|
302
|
-
/** One geometry unit, in the same world units the ribbon is tessellated in.
|
|
303
|
-
* Defaults to the resolved stroke width. */
|
|
304
|
-
readonly size: number;
|
|
305
|
-
/** The stroke this marker belongs to, already width-resolved. */
|
|
306
|
-
readonly stroke: Stroke;
|
|
307
|
-
}
|
|
308
|
-
/** `'line'` means the stroke's own paint — SVG 2's `context-stroke`, as the
|
|
309
|
-
* default rather than an opt-in. */
|
|
310
|
-
type MarkerPaint = FillStyle | 'line' | 'none';
|
|
311
|
-
/** A stroke-marker registry entry: a terminator's geometry, paint and inset. */
|
|
312
|
-
interface MarkerEntry {
|
|
313
|
-
/** `'kit:'`-free for built-ins so the key matches the SVG attribute value;
|
|
314
|
-
* consumers should prefix (`'app-my-head'`). A key becomes the `id` of the
|
|
315
|
-
* emitted `<marker>` def, so it must be a valid XML name — no colons. */
|
|
316
|
-
id: MarkerKey;
|
|
317
|
-
/** Geometry with its anchor at the origin, pointing +X, in units of
|
|
318
|
-
* `ctx.size`. An arbitrary anchor is expressed by where the geometry is
|
|
319
|
-
* drawn, which is why there is no `refX`/`refY`. */
|
|
320
|
-
path(ctx: MarkerCtx): Path;
|
|
321
|
-
/** Default `'line'`. */
|
|
322
|
-
fill?: MarkerPaint;
|
|
323
|
-
/** Outline width is in the same units as `path`. `false` (the default)
|
|
324
|
-
* means no outline. */
|
|
325
|
-
outline?: {
|
|
326
|
-
width: number;
|
|
327
|
-
paint?: MarkerPaint;
|
|
328
|
-
} | false;
|
|
329
|
-
/** How far back along the line the stroke stops, in units of `ctx.size`.
|
|
330
|
-
* Default 0. A property of the shape, not a setting on the stroke: an open
|
|
331
|
-
* V needs 0 or its arms stop meeting the line. */
|
|
332
|
-
inset?: number;
|
|
333
|
-
/** `'auto'` (default) follows the line; a number is a fixed angle in
|
|
334
|
-
* radians, ignoring the line — SVG's `orient="<angle>"`. */
|
|
335
|
-
orient?: 'auto' | number;
|
|
336
|
-
/** The stroke fields `path` reads besides `ctx.size` — `[]` for a shape
|
|
337
|
-
* drawn from size alone. Declared, a head is reused across stroke objects
|
|
338
|
-
* whose listed fields are equal; omitted, only across frames that pass the
|
|
339
|
-
* same stroke object, since `path` might read any of it. */
|
|
340
|
-
reads?: readonly (keyof Stroke)[];
|
|
341
|
-
/** Emits the `<marker>` def. Consumed by `@weasel-js/svg`. */
|
|
342
|
-
toSvg?(id: string, entry: MarkerEntry): string;
|
|
343
|
-
}
|
|
344
|
-
/** Every registered marker, with the overrides each displaced. */
|
|
345
|
-
declare const markerRegistry: Reflection<MarkerEntry>;
|
|
346
|
-
/** Register a marker. Returns a disposer. Re-registering an existing id is an
|
|
347
|
-
* override; disposing it uncovers whatever it displaced rather than deleting the key. */
|
|
348
|
-
declare function registerMarker(entry: MarkerEntry): () => void;
|
|
349
|
-
/** The entry for `key`, or `undefined`. */
|
|
350
|
-
declare function getMarker(key: string | undefined): MarkerEntry | undefined;
|
|
351
|
-
/** Every registered marker, built-ins first, in registration order. */
|
|
352
|
-
declare function listMarkers(): readonly MarkerEntry[];
|
|
353
|
-
/** Test helper. Do not call from product code. */
|
|
354
|
-
declare function _resetMarkersForTests(): void;
|
|
355
|
-
|
|
356
|
-
export { type FillPoseBox as F, type MarkerEntry as M, type PaintKindEntry as P, _resetMarkersForTests as _, type MarkerCtx as a, type MarkerPaint as b, type PaintBindContext as c, type PaintKind as d, type PaintKindEditorProps as e, type PaintKindLoader as f, type PaintProgram as g, type PaintResources as h, asPaint as i, fillInPoseFrame as j, fillToBoundsFrame as k, getMarker as l, getPaintKind as m, isPaintKindKnown as n, listGradientKinds as o, listMarkers as p, listPaintKinds as q, markerRegistry as r, paintKindOf as s, paintKindRegistry as t, registerMarker as u, registerPaintKind as v, registerPaintKindLoader as w, switchGradientKind as x, warmPaintKinds as y, _resetPaintKindsForTests as z };
|