@weasel-js/core 1.9.3 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1106 -0
- package/README.md +7 -5
- package/dist/WeaselProvider.js +5 -7
- package/dist/WeaselProvider.js.map +1 -1
- package/dist/affordances/composeAffordanceLayer.js +91 -93
- package/dist/affordances/composeAffordanceLayer.js.map +1 -1
- package/dist/affordances/cornerResize.js +27 -18
- package/dist/affordances/cornerResize.js.map +1 -1
- package/dist/affordances/hitAffordanceRegions.js +65 -104
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/affordances/rotationHandle.js +22 -21
- package/dist/affordances/rotationHandle.js.map +1 -1
- package/dist/animation/behaviors/coast.js +21 -0
- package/dist/animation/behaviors/coast.js.map +1 -0
- package/dist/animation/behaviors/coastByWrite.js +107 -0
- package/dist/animation/behaviors/coastByWrite.js.map +1 -0
- package/dist/animation/behaviors/coastOnTargets.js +94 -0
- package/dist/animation/behaviors/coastOnTargets.js.map +1 -0
- package/dist/animation/behaviors/momentum.js +38 -88
- package/dist/animation/behaviors/momentum.js.map +1 -1
- package/dist/animation/clipTargets.js +12 -0
- package/dist/animation/clipTargets.js.map +1 -0
- package/dist/animation/index.js +15 -20
- package/dist/animation/poseHelpers.js +112 -33
- package/dist/animation/poseHelpers.js.map +1 -1
- package/dist/animation/poseTarget.js +115 -0
- package/dist/animation/poseTarget.js.map +1 -0
- package/dist/animation/reflow.js +113 -83
- package/dist/animation/reflow.js.map +1 -1
- package/dist/animation/rewind.js +66 -0
- package/dist/animation/rewind.js.map +1 -0
- package/dist/animation/rig/bindRig.js +85 -53
- package/dist/animation/rig/bindRig.js.map +1 -1
- package/dist/animation/rig/rigNode.js +93 -0
- package/dist/animation/rig/rigNode.js.map +1 -0
- package/dist/animation/rig/rigSeat.js +26 -0
- package/dist/animation/rig/rigSeat.js.map +1 -0
- package/dist/animation/rig/skinBinding.js +56 -0
- package/dist/animation/rig/skinBinding.js.map +1 -0
- package/dist/animation/rig/useRig.js +31 -16
- package/dist/animation/rig/useRig.js.map +1 -1
- package/dist/animation/wrappers/animateLifecycle.js +32 -24
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
- package/dist/animation/wrappers/animateOnSetPose.js +31 -29
- package/dist/animation/wrappers/animateOnSetPose.js.map +1 -1
- package/dist/animation/wrappers/instantPose.js +13 -0
- package/dist/animation/wrappers/instantPose.js.map +1 -0
- package/dist/animation/writtenPoseTarget.js +33 -0
- package/dist/animation/writtenPoseTarget.js.map +1 -0
- package/dist/{autoPoseDescriptor-vCdt55xm.d.ts → autoPoseDescriptor-DHg5KqaJ.d.ts} +1 -1
- package/dist/barrel/canvas.js +31 -0
- package/dist/barrel/chrome.js +16 -0
- package/dist/barrel/input.js +18 -0
- package/dist/barrel/interactions.js +38 -0
- package/dist/barrel/paint.js +11 -0
- package/dist/barrel/paths.js +12 -0
- package/dist/barrel/renderer.js +14 -0
- package/dist/barrel/routing.js +57 -0
- package/dist/barrel/scene.js +37 -0
- package/dist/barrel/text.js +9 -0
- package/dist/barrel/viewport.js +42 -0
- package/dist/canvas/Canvas.js +280 -559
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +147 -167
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/CursorCoordsHud.js +53 -49
- package/dist/canvas/CursorCoordsHud.js.map +1 -1
- package/dist/canvas/DrawCanvas.js +40 -51
- package/dist/canvas/DrawCanvas.js.map +1 -1
- package/dist/canvas/ModalityHud.js.map +1 -1
- package/dist/canvas/NodeShape.js +55 -374
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/PickHud.js +50 -47
- package/dist/canvas/PickHud.js.map +1 -1
- package/dist/canvas/SceneCanvas/DevHuds.js +40 -0
- package/dist/canvas/SceneCanvas/DevHuds.js.map +1 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js +126 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +27 -31
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +64 -0
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js.map +1 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js +16 -0
- package/dist/canvas/SceneCanvas/ToolKeybindingsMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/coordTrace.js +46 -0
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +138 -85
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +9 -8
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js.map +1 -1
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js.map +1 -1
- package/dist/canvas/SceneCanvas/features.js +74 -43
- package/dist/canvas/SceneCanvas/features.js.map +1 -1
- package/dist/canvas/SceneCanvas/isDev.js +12 -0
- package/dist/canvas/SceneCanvas/isDev.js.map +1 -0
- package/dist/canvas/SceneCanvas/poseGeometry.js +31 -34
- package/dist/canvas/SceneCanvas/poseGeometry.js.map +1 -1
- package/dist/canvas/SceneCanvas/poseRegistrars.js +13 -0
- package/dist/canvas/SceneCanvas/poseRegistrars.js.map +1 -0
- package/dist/canvas/SceneCanvas/props.js +39 -0
- package/dist/canvas/SceneCanvas/props.js.map +1 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js +23 -0
- package/dist/canvas/SceneCanvas/toolRegistry.js.map +1 -0
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +6 -1
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +21 -62
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +21 -0
- package/dist/canvas/SceneCanvas/useBuiltinTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js +38 -0
- package/dist/canvas/SceneCanvas/useCanvasCamera.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +20 -0
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +16 -0
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js +67 -0
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -0
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +29 -29
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useHeldModifiers.js +20 -0
- package/dist/canvas/SceneCanvas/useHeldModifiers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js +26 -0
- package/dist/canvas/SceneCanvas/useNodeKinds.js.map +1 -0
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +48 -48
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +47 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +66 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js +59 -0
- package/dist/canvas/SceneCanvas/useSceneChrome.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +23 -0
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +74 -78
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +37 -0
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js.map +1 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +38 -0
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js +20 -0
- package/dist/canvas/SceneCanvas/useViewLayerGate.js.map +1 -0
- package/dist/canvas/SceneCanvas/useViewportActions.js +9 -1
- package/dist/canvas/SceneCanvas/useViewportActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/worldPointAt.js +9 -0
- package/dist/canvas/SceneCanvas/worldPointAt.js.map +1 -0
- package/dist/canvas/SceneCanvas.js +311 -969
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +42 -46
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/adapterDerivedPath.js +26 -0
- package/dist/canvas/adapterDerivedPath.js.map +1 -0
- package/dist/canvas/affordanceAt.js +11 -1
- package/dist/canvas/affordanceAt.js.map +1 -1
- package/dist/canvas/buildSceneLayer.js +111 -0
- package/dist/canvas/buildSceneLayer.js.map +1 -0
- package/dist/canvas/buildSceneTree.js +16 -19
- package/dist/canvas/buildSceneTree.js.map +1 -1
- package/dist/canvas/canvasRenderer.js +67 -55
- package/dist/canvas/canvasRenderer.js.map +1 -1
- package/dist/canvas/colorOverrides.js.map +1 -1
- package/dist/canvas/defaultDrawOne.js +12 -12
- package/dist/canvas/defaultDrawOne.js.map +1 -1
- package/dist/canvas/deps/areaSelect.js +4 -4
- package/dist/canvas/deps/areaSelect.js.map +1 -1
- package/dist/canvas/deps/changes.js +13 -0
- package/dist/canvas/deps/changes.js.map +1 -0
- package/dist/canvas/deps/debug.js.map +1 -1
- package/dist/canvas/deps/editAnchors.js +38 -57
- package/dist/canvas/deps/editAnchors.js.map +1 -1
- package/dist/canvas/deps/geometryProjection.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +31 -26
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +130 -91
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/lassoSelect.js +5 -5
- package/dist/canvas/deps/lassoSelect.js.map +1 -1
- package/dist/canvas/deps/poseDescriptor.js +1 -1
- package/dist/canvas/deps/poseDescriptor.js.map +1 -1
- package/dist/canvas/deps/resizePolicy.js.map +1 -1
- package/dist/canvas/deps/slice.js +26 -26
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +6 -5
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/deps/view.js.map +1 -1
- package/dist/canvas/derivedPath.js +47 -22
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/drawEnvelope.js +8 -4
- package/dist/canvas/drawEnvelope.js.map +1 -1
- package/dist/canvas/getNodeAtPoint.js +4 -8
- package/dist/canvas/getNodeAtPoint.js.map +1 -1
- package/dist/canvas/hud.module.js +1 -1
- package/dist/canvas/hud.module.js.map +1 -1
- package/dist/canvas/insertPreviewExtent.js.map +1 -1
- package/dist/canvas/kitRequirements.js +2 -2
- package/dist/canvas/kitRequirements.js.map +1 -1
- package/dist/canvas/layerOrder.js +13 -6
- package/dist/canvas/layerOrder.js.map +1 -1
- package/dist/canvas/layerSlots.js +6 -1
- package/dist/canvas/layerSlots.js.map +1 -1
- package/dist/canvas/nodeShapes/derivedPainter.js +34 -0
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/imagePainter.js +87 -0
- package/dist/canvas/nodeShapes/imagePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/memo.js +9 -0
- package/dist/canvas/nodeShapes/memo.js.map +1 -0
- package/dist/canvas/nodeShapes/nodePaint.js +68 -0
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -0
- package/dist/canvas/nodeShapes/pathPainter.js +39 -0
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/poseBox.js +20 -0
- package/dist/canvas/nodeShapes/poseBox.js.map +1 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +38 -0
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -0
- package/dist/canvas/nodeShapes/shapePainter.js +72 -0
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -0
- package/dist/canvas/nodeShapes/textPainter.js +55 -0
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -0
- package/dist/canvas/overlayRoleStrokes.js.map +1 -1
- package/dist/canvas/paintCull.js +11 -14
- package/dist/canvas/paintCull.js.map +1 -1
- package/dist/{features/cursor → canvas}/paintedCursorLayer.js +2 -2
- package/dist/canvas/paintedCursorLayer.js.map +1 -0
- package/dist/canvas/pickWalk.js +59 -68
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/planeClips.js +18 -19
- package/dist/canvas/planeClips.js.map +1 -1
- package/dist/canvas/poseCascade.js +41 -0
- package/dist/canvas/poseCascade.js.map +1 -0
- package/dist/canvas/poseRotation.js +9 -23
- package/dist/canvas/poseRotation.js.map +1 -1
- package/dist/canvas/rasterReadback.js +22 -0
- package/dist/canvas/rasterReadback.js.map +1 -0
- package/dist/canvas/renderDebugSnapshot.js +11 -11
- package/dist/canvas/renderDebugSnapshot.js.map +1 -1
- package/dist/canvas/renderNeeds.js +3 -3
- package/dist/canvas/renderNeeds.js.map +1 -1
- package/dist/canvas/renderSceneToPixels.js +64 -81
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +68 -214
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +112 -0
- package/dist/canvas/sceneClipboard.js.map +1 -0
- package/dist/canvas/sceneLayerPaint.js +4 -4
- package/dist/canvas/sceneLayerPaint.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +39 -39
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/slopsDebugLayer.js +4 -4
- package/dist/canvas/slopsDebugLayer.js.map +1 -1
- package/dist/canvas/surface.module.js +6 -0
- package/dist/canvas/surface.module.js.map +1 -0
- package/dist/canvas/surfaceBox.js +16 -0
- package/dist/canvas/surfaceBox.js.map +1 -0
- package/dist/canvas/useCanvasRenderer.js +26 -6
- package/dist/canvas/useCanvasRenderer.js.map +1 -1
- package/dist/canvas/useCanvasSurface.js +31 -0
- package/dist/canvas/useCanvasSurface.js.map +1 -0
- package/dist/canvas/useCanvasView.js +67 -0
- package/dist/canvas/useCanvasView.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +39 -31
- package/dist/canvas/useFrameLoop.js.map +1 -1
- package/dist/canvas/useHostAnchor.js +35 -33
- package/dist/canvas/useHostAnchor.js.map +1 -1
- package/dist/canvas/useLateContentRedraw.js +8 -8
- package/dist/canvas/useLateContentRedraw.js.map +1 -1
- package/dist/canvas/useSceneLayerList.js +11 -0
- package/dist/canvas/useSceneLayerList.js.map +1 -0
- package/dist/canvas/useSurfaceInput.js +42 -0
- package/dist/canvas/useSurfaceInput.js.map +1 -0
- package/dist/canvas/useToolCursor.js +29 -0
- package/dist/canvas/useToolCursor.js.map +1 -0
- package/dist/canvas/useViewHelpers.js +46 -85
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/viewInputs.js.map +1 -1
- package/dist/canvas/viewRegistry.js +25 -27
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/canvas/watchElementMove.js +43 -0
- package/dist/canvas/watchElementMove.js.map +1 -0
- package/dist/canvas/wrapNodeOutput.js.map +1 -1
- package/dist/clipboard.d.ts +16 -19
- package/dist/{types-B_9g6hMM.d.ts → clone-2a5hVbBd.d.ts} +123 -74
- package/dist/clone.d.ts +4 -7
- package/dist/clone.js +0 -2
- package/dist/core/device/index.js +5 -4
- package/dist/core/device/targets.js.map +1 -1
- package/dist/core/device/useDeviceProfile.js +38 -44
- package/dist/core/device/useDeviceProfile.js.map +1 -1
- package/dist/core/device/watchDevicePixelRatio.js +17 -0
- package/dist/core/device/watchDevicePixelRatio.js.map +1 -0
- package/dist/{interactions/actions/resize → core/geometry}/autoPoseDescriptor.js +8 -7
- package/dist/core/geometry/autoPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/pathPoseDescriptor.js +88 -0
- package/dist/core/geometry/pathPoseDescriptor.js.map +1 -0
- package/dist/core/geometry/poseDescriptor.js +68 -19
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/regionHit.js +31 -34
- package/dist/core/geometry/regionHit.js.map +1 -1
- package/dist/core/geometry/targetFrame.js +94 -0
- package/dist/core/geometry/targetFrame.js.map +1 -0
- package/dist/core/geometry/unionBounds.js +30 -29
- package/dist/core/geometry/unionBounds.js.map +1 -1
- package/dist/core/isPlainObject.js +2 -11
- package/dist/core/layers/backgroundFill.js +31 -0
- package/dist/core/layers/backgroundFill.js.map +1 -0
- package/dist/{features/groups → core/layers}/children.js +1 -1
- package/dist/core/layers/children.js.map +1 -0
- package/dist/core/layers/gateLayer.js +13 -0
- package/dist/core/layers/gateLayer.js.map +1 -0
- package/dist/core/layers/layerGroup.js +40 -0
- package/dist/core/layers/layerGroup.js.map +1 -0
- package/dist/core/layers/render.js +50 -76
- package/dist/core/layers/render.js.map +1 -1
- package/dist/core/ops/arrange.js +1 -0
- package/dist/core/ops/arrange.js.map +1 -1
- package/dist/core/ops/create.js +10 -5
- package/dist/core/ops/create.js.map +1 -1
- package/dist/core/ops/createHistory.js +9 -9
- package/dist/core/ops/createHistory.js.map +1 -1
- package/dist/core/ops/delete.js +12 -24
- package/dist/core/ops/delete.js.map +1 -1
- package/dist/core/ops/reorder/index.js +43 -40
- package/dist/core/ops/reorder/index.js.map +1 -1
- package/dist/core/ops/reorder/setChildOrder.js +34 -0
- package/dist/core/ops/reorder/setChildOrder.js.map +1 -0
- package/dist/core/paint/meshKind.js +16 -0
- package/dist/core/paint/meshKind.js.map +1 -0
- package/dist/{features/meshPaint/lazyKind.js → core/paint/meshKindLazy.js} +282 -105
- package/dist/core/paint/meshKindLazy.js.map +1 -0
- package/dist/core/paint/paintKindEntry.js +8 -0
- package/dist/core/paint/paintKindEntry.js.map +1 -0
- package/dist/core/paint/paintKinds.js +144 -0
- package/dist/core/paint/paintKinds.js.map +1 -0
- package/dist/core/paint/registerMesh.js +7 -0
- package/dist/core/paint/registerMesh.js.map +1 -0
- package/dist/core/scene/NodeProperties.js.map +1 -1
- package/dist/core/scene/NodeRouting.js.map +1 -1
- package/dist/core/scene/appliedLog.js +37 -0
- package/dist/core/scene/appliedLog.js.map +1 -0
- package/dist/core/scene/arrivalWindow.js +102 -0
- package/dist/core/scene/arrivalWindow.js.map +1 -0
- package/dist/core/scene/boundOps.js +40 -0
- package/dist/core/scene/boundOps.js.map +1 -0
- package/dist/core/scene/composeFrame.js +9 -6
- package/dist/core/scene/composeFrame.js.map +1 -1
- package/dist/{features/groups → core/scene}/composePose.js +18 -18
- package/dist/core/scene/composePose.js.map +1 -0
- package/dist/core/scene/depMemo.js +31 -6
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/derivedPath.js +19 -20
- package/dist/core/scene/derivedPath.js.map +1 -1
- package/dist/core/scene/editMode.js +26 -0
- package/dist/core/scene/editMode.js.map +1 -0
- package/dist/core/scene/effectivePose.js +38 -39
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/fieldEdits.js +98 -0
- package/dist/core/scene/fieldEdits.js.map +1 -0
- package/dist/core/scene/historyFacade.js +130 -0
- package/dist/core/scene/historyFacade.js.map +1 -0
- package/dist/core/scene/historyForm.js +6 -0
- package/dist/core/scene/historyForm.js.map +1 -0
- package/dist/core/scene/kitOps.js +185 -0
- package/dist/core/scene/kitOps.js.map +1 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/layerStack.js +131 -0
- package/dist/core/scene/layerStack.js.map +1 -0
- package/dist/core/scene/layoutPass.js +58 -59
- package/dist/core/scene/layoutPass.js.map +1 -1
- package/dist/core/scene/lockGuard.js +37 -0
- package/dist/core/scene/lockGuard.js.map +1 -0
- package/dist/{features/groups → core/scene}/nestedHit.js +3 -3
- package/dist/core/scene/nestedHit.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +10 -11
- package/dist/core/scene/nodeFnFields.js.map +1 -1
- package/dist/core/scene/nodeMemo.js +45 -19
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/nodeStore.js +127 -0
- package/dist/core/scene/nodeStore.js.map +1 -0
- package/dist/core/scene/notifier.js +37 -0
- package/dist/core/scene/notifier.js.map +1 -0
- package/dist/core/scene/opTable.js +50 -0
- package/dist/core/scene/opTable.js.map +1 -0
- package/dist/core/scene/outerOps.js +66 -0
- package/dist/core/scene/outerOps.js.map +1 -0
- package/dist/core/scene/poseFeed.js +38 -38
- package/dist/core/scene/poseFeed.js.map +1 -1
- package/dist/core/scene/poseHold.js +39 -0
- package/dist/core/scene/poseHold.js.map +1 -0
- package/dist/core/scene/poseOverrides.js +44 -40
- package/dist/core/scene/poseOverrides.js.map +1 -1
- package/dist/core/scene/poseSnapshot.js.map +1 -1
- package/dist/core/scene/reconcileSpecs.js +3 -2
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/recorder.js +86 -0
- package/dist/core/scene/recorder.js.map +1 -0
- package/dist/core/scene/renderOrder.js +84 -0
- package/dist/core/scene/renderOrder.js.map +1 -0
- package/dist/core/scene/scene.js +80 -1266
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneEdits.js +58 -0
- package/dist/core/scene/sceneEdits.js.map +1 -0
- package/dist/core/scene/sceneMutators.js +49 -0
- package/dist/core/scene/sceneMutators.js.map +1 -0
- package/dist/core/scene/scenePoseAdapter.js +16 -0
- package/dist/core/scene/scenePoseAdapter.js.map +1 -0
- package/dist/core/scene/sceneRecording.js +90 -0
- package/dist/core/scene/sceneRecording.js.map +1 -0
- package/dist/core/scene/sceneSelection.js +28 -0
- package/dist/core/scene/sceneSelection.js.map +1 -0
- package/dist/core/scene/sceneState.js +49 -0
- package/dist/core/scene/sceneState.js.map +1 -0
- package/dist/core/scene/serialization.js +71 -0
- package/dist/core/scene/serialization.js.map +1 -0
- package/dist/core/scene/staleReplay.js +51 -0
- package/dist/core/scene/staleReplay.js.map +1 -0
- package/dist/core/scene/statedFields.js +9 -0
- package/dist/core/scene/statedFields.js.map +1 -0
- package/dist/core/scene/treeEdits.js +127 -0
- package/dist/core/scene/treeEdits.js.map +1 -0
- package/dist/core/scene/treeOrder.js +13 -0
- package/dist/core/scene/treeOrder.js.map +1 -0
- package/dist/core/scene/treeReads.js +26 -0
- package/dist/core/scene/treeReads.js.map +1 -0
- package/dist/core/scene/types.js.map +1 -1
- package/dist/{features/groups → core/scene}/unionOfChildren.js +3 -3
- package/dist/core/scene/unionOfChildren.js.map +1 -0
- package/dist/core/scene/unitScopes.js +13 -0
- package/dist/core/scene/unitScopes.js.map +1 -0
- package/dist/core/scene/useScene.js.map +1 -1
- package/dist/core/selection/readOnlySelection.js +32 -0
- package/dist/core/selection/readOnlySelection.js.map +1 -0
- package/dist/core/selection/usePublishSceneSelection.js +26 -0
- package/dist/core/selection/usePublishSceneSelection.js.map +1 -0
- package/dist/core/selection/useSelection.js +34 -25
- package/dist/core/selection/useSelection.js.map +1 -1
- package/dist/core/shapeKinds.js.map +1 -1
- package/dist/core/stylus/stylus.js.map +1 -1
- package/dist/core/stylus/usePointerStylus.js.map +1 -1
- package/dist/core/usePaintKinds.js +1 -1
- package/dist/core/usePaintKinds.js.map +1 -1
- package/dist/core/viewport/clientToWorld.js.map +1 -1
- package/dist/core/viewport/fitViewToBounds.js.map +1 -1
- package/dist/core/viewport/parallax.js.map +1 -1
- package/dist/core/viewport/screenSlop.js +11 -11
- package/dist/core/viewport/screenSlop.js.map +1 -1
- package/dist/core/viewport/useCanvasSize.js.map +1 -1
- package/dist/core/viewport/useDecayLoop.js +8 -8
- package/dist/core/viewport/useDecayLoop.js.map +1 -1
- package/dist/core/viewport/useNodeOverlayFrame.js +84 -0
- package/dist/core/viewport/useNodeOverlayFrame.js.map +1 -0
- package/dist/core/viewport/useViewAnimation.js +102 -43
- package/dist/core/viewport/useViewAnimation.js.map +1 -1
- package/dist/core/viewport/view.js +9 -9
- package/dist/core/viewport/view.js.map +1 -1
- package/dist/core/viewport/wheelHandler.js.map +1 -1
- package/dist/core/viewport/zoomBounds.js +10 -8
- package/dist/core/viewport/zoomBounds.js.map +1 -1
- package/dist/{cornerHandles-BCrDp_mH.d.ts → cornerHandles-BEshc4z3.d.ts} +11 -24
- package/dist/debug/createDebugOverlayLayer.js +97 -97
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/createDebugSink.js.map +1 -1
- package/dist/debug/flag.js +2 -41
- package/dist/debug/frameStats.js.map +1 -1
- package/dist/debug/useDebugSink.js +52 -0
- package/dist/debug/useDebugSink.js.map +1 -0
- package/dist/features/chrome-caps/buildChromeCtx.js.map +1 -1
- package/dist/features/chrome-caps/conditions.js.map +1 -1
- package/dist/features/chrome-caps/defaults.js.map +1 -1
- package/dist/features/chrome-caps/resolve.js.map +1 -1
- package/dist/features/chrome-caps/useChromeCaps.js +54 -0
- package/dist/features/chrome-caps/useChromeCaps.js.map +1 -0
- package/dist/features/chrome-caps/useHoverTracking.js +22 -17
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +28 -19
- package/dist/features/ingestion/contentHandlers.js.map +1 -1
- package/dist/features/ingestion/imageHandler.js +21 -24
- package/dist/features/ingestion/imageHandler.js.map +1 -1
- package/dist/features/ingestion/openFilePicker.js.map +1 -1
- package/dist/features/ingestion/placement.js +16 -0
- package/dist/features/ingestion/placement.js.map +1 -0
- package/dist/features/ingestion/registerKitHandlers.js +7 -7
- package/dist/features/ingestion/svgHandler.js +5 -0
- package/dist/features/ingestion/svgHandler.js.map +1 -1
- package/dist/features/ingestion/textHandler.js +28 -0
- package/dist/features/ingestion/textHandler.js.map +1 -0
- package/dist/features/ingestion/useCanvasIngestion.js +48 -0
- package/dist/features/ingestion/useCanvasIngestion.js.map +1 -0
- package/dist/features/ingestion/weaselJsonHandler.js +22 -14
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
- package/dist/features/longPress/longPressFeedback.js.map +1 -1
- package/dist/features/modes/modeLayers.js +7 -7
- package/dist/features/modes/modeLayers.js.map +1 -1
- package/dist/features/paths/editablePath.js +47 -0
- package/dist/features/paths/editablePath.js.map +1 -0
- package/dist/features/paths/index.js +9 -14
- package/dist/features/paths/pathEditState.js +41 -0
- package/dist/features/paths/pathEditState.js.map +1 -0
- package/dist/features/paths/pathEditingOverlayLayer.js +36 -38
- package/dist/features/paths/pathEditingOverlayLayer.js.map +1 -1
- package/dist/features/paths/pathLayer.js +3 -2
- package/dist/features/paths/pathLayer.js.map +1 -1
- package/dist/features/paths/penPreviewLayer.js +86 -88
- package/dist/features/paths/penPreviewLayer.js.map +1 -1
- package/dist/features/paths/usePathEdit.js +34 -0
- package/dist/features/paths/usePathEdit.js.map +1 -0
- package/dist/features/poseRun/usePoseRun.js +44 -52
- package/dist/features/poseRun/usePoseRun.js.map +1 -1
- package/dist/features/selection/overlay.js +171 -179
- package/dist/features/selection/overlay.js.map +1 -1
- package/dist/features/text/index.js +6 -0
- package/dist/features/text/textLayer.js +1 -1
- package/dist/features/text/textLayer.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +100 -93
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/viewportLayer.js +25 -36
- package/dist/features/viewports/viewportLayer.js.map +1 -1
- package/dist/index.d.ts +8473 -9141
- package/dist/index.js +269 -307
- package/dist/input/keyState.js +38 -39
- package/dist/input/keyState.js.map +1 -1
- package/dist/input/useKeyModifiers.js +11 -0
- package/dist/input/useKeyModifiers.js.map +1 -0
- package/dist/interactions/actions/actionShortcuts.js.map +1 -1
- package/dist/interactions/actions/{defaults/align.js → align/action.js} +18 -20
- package/dist/interactions/actions/align/action.js.map +1 -0
- package/dist/interactions/actions/align/align.js +20 -20
- package/dist/interactions/actions/align/align.js.map +1 -1
- package/dist/interactions/actions/booleans/action.js +65 -0
- package/dist/interactions/actions/booleans/action.js.map +1 -0
- package/dist/interactions/actions/booleans/booleans.js +69 -78
- package/dist/interactions/actions/booleans/booleans.js.map +1 -1
- package/dist/interactions/actions/booleans/operands.js +40 -0
- package/dist/interactions/actions/booleans/operands.js.map +1 -0
- package/dist/interactions/actions/booleans/pieces.js +45 -0
- package/dist/interactions/actions/booleans/pieces.js.map +1 -0
- package/dist/interactions/actions/booleans/placement.js +24 -0
- package/dist/interactions/actions/booleans/placement.js.map +1 -0
- package/dist/interactions/actions/booleans/useBooleans.js +11 -9
- package/dist/interactions/actions/booleans/useBooleans.js.map +1 -1
- package/dist/interactions/actions/booleans/useBooleansAdapter.js.map +1 -1
- package/dist/interactions/actions/{defaults/clipboard.js → clipboard/action.js} +31 -15
- package/dist/interactions/actions/clipboard/action.js.map +1 -0
- package/dist/interactions/actions/clipboard/clipboardOps.js +44 -42
- package/dist/interactions/actions/clipboard/clipboardOps.js.map +1 -1
- package/dist/interactions/actions/clipboard/materializePaste.js +10 -7
- package/dist/interactions/actions/clipboard/materializePaste.js.map +1 -1
- package/dist/interactions/actions/clipboard/wireFormat.js.map +1 -1
- package/dist/interactions/actions/clone/action.js +98 -0
- package/dist/interactions/actions/clone/action.js.map +1 -0
- package/dist/interactions/actions/clone/behaviors.js +52 -0
- package/dist/interactions/actions/clone/behaviors.js.map +1 -0
- package/dist/interactions/actions/defaultCommitAdapter.js +7 -32
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +60 -84
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/areaSelect.js +35 -38
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
- package/dist/interactions/actions/defaults/clearSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/copySubtree.js +40 -0
- package/dist/interactions/actions/defaults/copySubtree.js.map +1 -0
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +13 -53
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +40 -50
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js +24 -1
- package/dist/interactions/actions/defaults/icons/booleanIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js +39 -1
- package/dist/interactions/actions/defaults/icons/outlineIcons.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +44 -38
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +11 -12
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +40 -69
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/nudgeSteps.js +37 -0
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -0
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/reorder.js +2 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/requiresSelection.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +14 -8
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +7 -4
- package/dist/interactions/actions/defaults/setFillOpacity.js.map +1 -1
- package/dist/interactions/actions/defaults/setStroke.js +12 -12
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +6 -6
- package/dist/interactions/actions/defaults/sliceOps.js +8 -10
- package/dist/interactions/actions/defaults/sliceOps.js.map +1 -1
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportDragPan.js +37 -26
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/distribute/action.js +66 -0
- package/dist/interactions/actions/distribute/action.js.map +1 -0
- package/dist/interactions/actions/distribute/distribute.js +11 -11
- package/dist/interactions/actions/distribute/distribute.js.map +1 -1
- package/dist/interactions/actions/{defaults/editAnchors.js → edit-anchors/action.js} +7 -9
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -0
- package/dist/interactions/actions/edit-anchors/geometry.js +30 -27
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +124 -0
- package/dist/interactions/actions/flip/action.js.map +1 -0
- package/dist/interactions/actions/flip/helpers.js +30 -17
- package/dist/interactions/actions/flip/helpers.js.map +1 -1
- package/dist/interactions/actions/gestureFrames.js +18 -0
- package/dist/interactions/actions/gestureFrames.js.map +1 -0
- package/dist/interactions/actions/gestureLifecycle.js +47 -20
- package/dist/interactions/actions/gestureLifecycle.js.map +1 -1
- package/dist/interactions/actions/hitSelection.js +8 -0
- package/dist/interactions/actions/hitSelection.js.map +1 -0
- package/dist/interactions/actions/insert/action.js +72 -0
- package/dist/interactions/actions/insert/action.js.map +1 -0
- package/dist/interactions/actions/insert/commit.js +28 -0
- package/dist/interactions/actions/insert/commit.js.map +1 -0
- package/dist/interactions/actions/insert/extras.js +65 -0
- package/dist/interactions/actions/insert/extras.js.map +1 -0
- package/dist/interactions/actions/insert/frame.js +48 -0
- package/dist/interactions/actions/insert/frame.js.map +1 -0
- package/dist/interactions/actions/insert/geometry.js +35 -0
- package/dist/interactions/actions/insert/geometry.js.map +1 -0
- package/dist/interactions/actions/insert/rotateAction.js +21 -0
- package/dist/interactions/actions/insert/rotateAction.js.map +1 -0
- package/dist/interactions/actions/insert/session.js +59 -0
- package/dist/interactions/actions/insert/session.js.map +1 -0
- package/dist/interactions/actions/insert/shape.js +34 -0
- package/dist/interactions/actions/insert/shape.js.map +1 -0
- package/dist/interactions/actions/lasso-select/action.js +143 -0
- package/dist/interactions/actions/lasso-select/action.js.map +1 -0
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +14 -18
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
- package/dist/interactions/actions/move/action.js +87 -0
- package/dist/interactions/actions/move/action.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +51 -0
- package/dist/interactions/actions/move/behaviors/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +15 -0
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js.map +1 -0
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +5 -5
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js.map +1 -1
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +39 -27
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/capture.js +99 -0
- package/dist/interactions/actions/move/capture.js.map +1 -0
- package/dist/interactions/actions/move/commit/index.js +41 -0
- package/dist/interactions/actions/move/commit/index.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js +44 -0
- package/dist/interactions/actions/move/commit/layoutDrop.js.map +1 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js +100 -0
- package/dist/interactions/actions/move/commit/layoutRelease.js.map +1 -0
- package/dist/interactions/actions/move/commit/rebase.js +18 -0
- package/dist/interactions/actions/move/commit/rebase.js.map +1 -0
- package/dist/interactions/actions/move/commit/reparent.js +65 -0
- package/dist/interactions/actions/move/commit/reparent.js.map +1 -0
- package/dist/interactions/actions/move/delta.js +51 -0
- package/dist/interactions/actions/move/delta.js.map +1 -0
- package/dist/interactions/actions/move/frame.js +59 -0
- package/dist/interactions/actions/move/frame.js.map +1 -0
- package/dist/interactions/actions/move/gestureAdapter.js +22 -30
- package/dist/interactions/actions/move/gestureAdapter.js.map +1 -1
- package/dist/interactions/actions/move/landedDescendants.js +33 -0
- package/dist/interactions/actions/move/landedDescendants.js.map +1 -0
- package/dist/interactions/actions/move/layout/container.js +94 -0
- package/dist/interactions/actions/move/layout/container.js.map +1 -0
- package/dist/interactions/actions/move/layout/dragged.js +58 -0
- package/dist/interactions/actions/move/layout/dragged.js.map +1 -0
- package/dist/interactions/actions/move/layout/dropPass.js +122 -0
- package/dist/interactions/actions/move/layout/dropPass.js.map +1 -0
- package/dist/interactions/actions/move/layout/exits.js +38 -0
- package/dist/interactions/actions/move/layout/exits.js.map +1 -0
- package/dist/interactions/actions/move/layout/glide.js +48 -0
- package/dist/interactions/actions/move/layout/glide.js.map +1 -0
- package/dist/interactions/actions/move/session.js +63 -0
- package/dist/interactions/actions/move/session.js.map +1 -0
- package/dist/interactions/actions/move/translate.js +61 -0
- package/dist/interactions/actions/move/translate.js.map +1 -0
- package/dist/interactions/actions/outlines/createOutlines.js +16 -63
- package/dist/interactions/actions/outlines/createOutlines.js.map +1 -1
- package/dist/interactions/actions/outlines/createOutlinesAction.js +51 -0
- package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStroke.js +72 -0
- package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js +37 -0
- package/dist/interactions/actions/outlines/outlineStrokeAction.js.map +1 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js +54 -0
- package/dist/interactions/actions/outlines/replaceWithPaths.js.map +1 -0
- package/dist/interactions/actions/outlines/strokeRegion.js +27 -0
- package/dist/interactions/actions/outlines/strokeRegion.js.map +1 -0
- package/dist/interactions/actions/planeInput.js.map +1 -1
- package/dist/interactions/actions/pointerState.js +12 -0
- package/dist/interactions/actions/pointerState.js.map +1 -0
- package/dist/interactions/actions/poseDescriptorDep.js +16 -4
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +25 -20
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/resize/action.js +55 -0
- package/dist/interactions/actions/resize/action.js.map +1 -0
- package/dist/interactions/actions/resize/behaviors/lockAspect.js.map +1 -1
- package/dist/interactions/actions/resize/boxFrame.js +16 -0
- package/dist/interactions/actions/resize/boxFrame.js.map +1 -0
- package/dist/interactions/actions/resize/capture.js +85 -0
- package/dist/interactions/actions/resize/capture.js.map +1 -0
- package/dist/interactions/actions/resize/commit.js +69 -0
- package/dist/interactions/actions/resize/commit.js.map +1 -0
- package/dist/interactions/actions/resize/frame.js +74 -0
- package/dist/interactions/actions/resize/frame.js.map +1 -0
- package/dist/interactions/actions/resize/pointSnap.js +111 -0
- package/dist/interactions/actions/resize/pointSnap.js.map +1 -0
- package/dist/interactions/actions/resize/ruleBounds.js +9 -0
- package/dist/interactions/actions/resize/ruleBounds.js.map +1 -0
- package/dist/interactions/actions/resize/session.js +49 -0
- package/dist/interactions/actions/resize/session.js.map +1 -0
- package/dist/interactions/actions/resolveOverlays.js.map +1 -1
- package/dist/interactions/actions/resolvePreviews.js.map +1 -1
- package/dist/interactions/actions/rotate/action.js +56 -0
- package/dist/interactions/actions/rotate/action.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/index.js +7 -0
- package/dist/interactions/actions/rotate/behaviors/index.js.map +1 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js +12 -0
- package/dist/interactions/actions/rotate/behaviors/snapRotation.js.map +1 -0
- package/dist/interactions/actions/rotate/commit.js +40 -0
- package/dist/interactions/actions/rotate/commit.js.map +1 -0
- package/dist/interactions/actions/rotate/frame.js +65 -0
- package/dist/interactions/actions/rotate/frame.js.map +1 -0
- package/dist/interactions/actions/rotate/handle.js +12 -12
- package/dist/interactions/actions/rotate/handle.js.map +1 -1
- package/dist/interactions/actions/rotate/session.js +92 -0
- package/dist/interactions/actions/rotate/session.js.map +1 -0
- package/dist/interactions/actions/selectionSubtree.js +69 -0
- package/dist/interactions/actions/selectionSubtree.js.map +1 -0
- package/dist/interactions/actions/spatialReference.js.map +1 -1
- package/dist/interactions/actions/useStandardActions.js +87 -78
- package/dist/interactions/actions/useStandardActions.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragGesture.js +4 -7
- package/dist/interactions/gestures/dragGesture/dragGesture.js.map +1 -1
- package/dist/interactions/gestures/dragGesture/dragPointOf.js +23 -0
- package/dist/interactions/gestures/dragGesture/dragPointOf.js.map +1 -0
- package/dist/interactions/gestures/handleDrag/handleDrag.js +21 -26
- package/dist/interactions/gestures/handleDrag/handleDrag.js.map +1 -1
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +62 -41
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js.map +1 -1
- package/dist/interactions/gestures/shared/originProjection.js +1 -1
- package/dist/interactions/gestures/shared/originProjection.js.map +1 -1
- package/dist/interactions/gestures/shared/screenTolerance.js +8 -2
- package/dist/interactions/gestures/shared/screenTolerance.js.map +1 -1
- package/dist/interactions/gestures/shared/snap.js.map +1 -1
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +8 -4
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js.map +1 -1
- package/dist/layout/arrivals.js +20 -23
- package/dist/layout/arrivals.js.map +1 -1
- package/dist/math-CYUjoyyU.d.ts +33 -0
- package/dist/math.d.ts +5 -3
- package/dist/math.js +6 -6
- package/dist/mesh.d.ts +4 -268
- package/dist/mesh.js +3 -7
- package/dist/move.d.ts +14 -11
- package/dist/{originProjection-DEklpDc_.d.ts → originProjection-PPT88jZv.d.ts} +1 -1
- package/dist/patterns-builtin.d.ts +1 -118
- package/dist/patterns-builtin.js +2 -3
- package/dist/{poseDescriptor-D-OH-tu5.d.ts → poseDescriptor-Bqk-11Rl.d.ts} +26 -36
- package/dist/renderer.d.ts +1 -91
- package/dist/renderer.js +2 -18
- package/dist/resize.d.ts +10 -22
- package/dist/resize.js +6 -6
- package/dist/style.css +1 -1
- package/dist/test-hook/install.js +12 -6
- package/dist/test-hook/install.js.map +1 -1
- package/dist/test-hook/useTestHook.js +22 -0
- package/dist/test-hook/useTestHook.js.map +1 -0
- package/dist/test-seams-D0pyV3pR.d.ts +149 -0
- package/dist/test-seams.d.ts +4 -4
- package/dist/test-seams.js +2 -2
- package/dist/tools/builtin/bone/boneActions.js +130 -0
- package/dist/tools/builtin/bone/boneActions.js.map +1 -0
- package/dist/tools/builtin/bone/boneOverlay.js +58 -0
- package/dist/tools/builtin/bone/boneOverlay.js.map +1 -0
- package/dist/tools/builtin/bone/placedRig.js +24 -0
- package/dist/tools/builtin/bone/placedRig.js.map +1 -0
- package/dist/tools/builtin/bone/rigEditState.js +21 -0
- package/dist/tools/builtin/bone/rigEditState.js.map +1 -0
- package/dist/tools/builtin/bone/useBoneTool.js +98 -0
- package/dist/tools/builtin/bone/useBoneTool.js.map +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.js.map +1 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/hand/useHandTool.js +1 -0
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js +11 -11
- package/dist/tools/builtin/lasso/useLassoTool.js.map +1 -1
- package/dist/tools/builtin/line/useLineTool.js +1 -0
- package/dist/tools/builtin/line/useLineTool.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +198 -150
- package/dist/tools/builtin/pen/usePenTool.js.map +1 -1
- package/dist/tools/builtin/pencil/usePencilTool.js +1 -0
- package/dist/tools/builtin/pencil/usePencilTool.js.map +1 -1
- package/dist/tools/builtin/pickTopMostHit.js.map +1 -1
- package/dist/tools/builtin/polygon/usePolygonTool.js +13 -8
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/rect/useRectTool.js +1 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
- package/dist/tools/builtin/select/adapterPointQuery.js +36 -0
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +25 -24
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +42 -67
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/shared/pointerFollower.js +17 -0
- package/dist/tools/builtin/shared/pointerFollower.js.map +1 -0
- package/dist/tools/builtin/slice/useSliceTool.js +72 -82
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +22 -16
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +9 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/tools/builtin/weight/useWeightTool.js +77 -0
- package/dist/tools/builtin/weight/useWeightTool.js.map +1 -0
- package/dist/tools/builtin/weight/weightActions.js +112 -0
- package/dist/tools/builtin/weight/weightActions.js.map +1 -0
- package/dist/tools/builtin/weight/weightOverlay.js +61 -0
- package/dist/tools/builtin/weight/weightOverlay.js.map +1 -0
- package/dist/tools/overlayBinding.js.map +1 -1
- package/dist/tools/useKeybindings.js +12 -22
- package/dist/tools/useKeybindings.js.map +1 -1
- package/dist/{types-A37hYkeR.d.ts → types-CIKDwlsP.d.ts} +113 -169
- package/dist/util/color.js +3 -3
- package/dist/util/color.js.map +1 -1
- package/dist/util/paint.js +1 -1
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -21
- package/dist/animation/colorHelpers.js +0 -135
- package/dist/animation/colorHelpers.js.map +0 -1
- package/dist/animation/colorRegistry.js +0 -37
- package/dist/animation/colorRegistry.js.map +0 -1
- package/dist/animation/engine/axes.js +0 -36
- package/dist/animation/engine/axes.js.map +0 -1
- package/dist/animation/engine/codec.js +0 -170
- package/dist/animation/engine/codec.js.map +0 -1
- package/dist/animation/engine/integrator.js +0 -12
- package/dist/animation/engine/integrator.js.map +0 -1
- package/dist/animation/loop.js +0 -62
- package/dist/animation/loop.js.map +0 -1
- package/dist/animation/observe.js +0 -23
- package/dist/animation/observe.js.map +0 -1
- package/dist/animation/rig/blendPoses.js +0 -43
- package/dist/animation/rig/blendPoses.js.map +0 -1
- package/dist/animation/rig/mirrorPose.js +0 -19
- package/dist/animation/rig/mirrorPose.js.map +0 -1
- package/dist/animation/rig/resolveSkeleton.js +0 -33
- package/dist/animation/rig/resolveSkeleton.js.map +0 -1
- package/dist/animation/rig/solveIk.js +0 -103
- package/dist/animation/rig/solveIk.js.map +0 -1
- package/dist/animation/rig/types.js +0 -12
- package/dist/animation/rig/types.js.map +0 -1
- package/dist/animation/slew.js +0 -27
- package/dist/animation/slew.js.map +0 -1
- package/dist/animation/stagger.js +0 -138
- package/dist/animation/stagger.js.map +0 -1
- package/dist/animation/timeline/booking.js +0 -106
- package/dist/animation/timeline/booking.js.map +0 -1
- package/dist/animation/timeline/createTimeline.js +0 -116
- package/dist/animation/timeline/createTimeline.js.map +0 -1
- package/dist/animation/timeline/sampleTrack.js +0 -71
- package/dist/animation/timeline/sampleTrack.js.map +0 -1
- package/dist/animation/useAnimator.js +0 -378
- package/dist/animation/useAnimator.js.map +0 -1
- package/dist/builtins-C-VgUlWI.d.ts +0 -4514
- package/dist/canvas/MinimapCanvas.js +0 -139
- package/dist/canvas/MinimapCanvas.js.map +0 -1
- package/dist/canvas/deps/poseComposition.js +0 -11
- package/dist/canvas/deps/poseComposition.js.map +0 -1
- package/dist/canvas/minimapMath.js +0 -80
- package/dist/canvas/minimapMath.js.map +0 -1
- package/dist/canvas/toolPreview.js +0 -39
- package/dist/canvas/toolPreview.js.map +0 -1
- package/dist/core/adapters/arrayAdapter.js +0 -85
- package/dist/core/adapters/arrayAdapter.js.map +0 -1
- package/dist/core/adapters/useArrayAdapter.js +0 -13
- package/dist/core/adapters/useArrayAdapter.js.map +0 -1
- package/dist/core/fillInPoseFrame.js +0 -102
- package/dist/core/fillInPoseFrame.js.map +0 -1
- package/dist/core/geometry/poseRotation.js +0 -58
- package/dist/core/geometry/poseRotation.js.map +0 -1
- package/dist/core/gradient.js +0 -136
- package/dist/core/gradient.js.map +0 -1
- package/dist/core/isPlainObject.js.map +0 -1
- package/dist/core/markerInset.js +0 -24
- package/dist/core/markerInset.js.map +0 -1
- package/dist/core/mixed.js +0 -6
- package/dist/core/mixed.js.map +0 -1
- package/dist/core/paintKinds.js +0 -156
- package/dist/core/paintKinds.js.map +0 -1
- package/dist/core/strokeMarkerShapes.js +0 -139
- package/dist/core/strokeMarkerShapes.js.map +0 -1
- package/dist/core/strokeMarkers.js +0 -28
- package/dist/core/strokeMarkers.js.map +0 -1
- package/dist/core/viewport/meanScale.js +0 -8
- package/dist/core/viewport/meanScale.js.map +0 -1
- package/dist/core/viewport/pxExtent.js +0 -42
- package/dist/core/viewport/pxExtent.js.map +0 -1
- package/dist/debug/flag.js.map +0 -1
- package/dist/features/cursor/paintedCursorLayer.js.map +0 -1
- package/dist/features/focus/gateLayer.js +0 -14
- package/dist/features/focus/gateLayer.js.map +0 -1
- package/dist/features/focus/useCanvasFocus.js +0 -29
- package/dist/features/focus/useCanvasFocus.js.map +0 -1
- package/dist/features/groups/children.js.map +0 -1
- package/dist/features/groups/composePose.js.map +0 -1
- package/dist/features/groups/nestedHit.js.map +0 -1
- package/dist/features/groups/unionOfChildren.js.map +0 -1
- package/dist/features/images/imageCache.js +0 -94
- package/dist/features/images/imageCache.js.map +0 -1
- package/dist/features/ingestion/index.js +0 -8
- package/dist/features/meshPaint/bake.js +0 -79
- package/dist/features/meshPaint/bake.js.map +0 -1
- package/dist/features/meshPaint/bakeCache.js +0 -59
- package/dist/features/meshPaint/bakeCache.js.map +0 -1
- package/dist/features/meshPaint/handles.js +0 -86
- package/dist/features/meshPaint/handles.js.map +0 -1
- package/dist/features/meshPaint/lazyKind.js.map +0 -1
- package/dist/features/meshPaint/meshPaint.js +0 -236
- package/dist/features/meshPaint/meshPaint.js.map +0 -1
- package/dist/features/meshPaint/meshShader.js +0 -6
- package/dist/features/meshPaint/meshShader.js.map +0 -1
- package/dist/features/meshPaint/register.js +0 -7
- package/dist/features/meshPaint/register.js.map +0 -1
- package/dist/features/meshPaint/surface.js +0 -110
- package/dist/features/meshPaint/surface.js.map +0 -1
- package/dist/features/minimap/actions.js +0 -53
- package/dist/features/minimap/actions.js.map +0 -1
- package/dist/features/minimap/createMinimapContribution.js +0 -96
- package/dist/features/minimap/createMinimapContribution.js.map +0 -1
- package/dist/features/minimap/layers.js +0 -103
- package/dist/features/minimap/layers.js.map +0 -1
- package/dist/features/overlays/useNodeOverlayFrame.js +0 -103
- package/dist/features/overlays/useNodeOverlayFrame.js.map +0 -1
- package/dist/features/parallax/createParallaxLayer.js +0 -26
- package/dist/features/parallax/createParallaxLayer.js.map +0 -1
- package/dist/features/parallax/createParallaxPlane.js +0 -26
- package/dist/features/parallax/createParallaxPlane.js.map +0 -1
- package/dist/features/paths/anchorEdits.js +0 -156
- package/dist/features/paths/anchorEdits.js.map +0 -1
- package/dist/features/paths/anchors.js +0 -154
- package/dist/features/paths/anchors.js.map +0 -1
- package/dist/features/paths/booleans.js +0 -2
- package/dist/features/paths/markerCommands.js +0 -148
- package/dist/features/paths/markerCommands.js.map +0 -1
- package/dist/features/paths/markerSites.js +0 -59
- package/dist/features/paths/markerSites.js.map +0 -1
- package/dist/features/paths/markers.js +0 -95
- package/dist/features/paths/markers.js.map +0 -1
- package/dist/features/paths/nearestAnchor.js +0 -36
- package/dist/features/paths/nearestAnchor.js.map +0 -1
- package/dist/features/paths/pathInWorld.js +0 -41
- package/dist/features/paths/pathInWorld.js.map +0 -1
- package/dist/features/paths/poseDescriptor.js +0 -39
- package/dist/features/paths/poseDescriptor.js.map +0 -1
- package/dist/features/paths/tessellate/dash.js +0 -52
- package/dist/features/paths/tessellate/dash.js.map +0 -1
- package/dist/features/paths/tessellate/insets.js +0 -32
- package/dist/features/paths/tessellate/insets.js.map +0 -1
- package/dist/features/paths/tessellate/metric.js +0 -72
- package/dist/features/paths/tessellate/metric.js.map +0 -1
- package/dist/features/paths/tessellate/stroke.js +0 -170
- package/dist/features/paths/tessellate/stroke.js.map +0 -1
- package/dist/features/paths/tessellate/vertexWidths.js +0 -32
- package/dist/features/paths/tessellate/vertexWidths.js.map +0 -1
- package/dist/features/patterns/index.js +0 -23
- package/dist/features/patterns/index.js.map +0 -1
- package/dist/features/patterns/patterns-builtin.js +0 -38
- package/dist/features/patterns/patterns-builtin.js.map +0 -1
- package/dist/features/patterns/resolveSpec.js +0 -57
- package/dist/features/patterns/resolveSpec.js.map +0 -1
- package/dist/features/patterns/tileGeometry.js +0 -158
- package/dist/features/patterns/tileGeometry.js.map +0 -1
- package/dist/features/pointer/PointerContext.js +0 -45
- package/dist/features/pointer/PointerContext.js.map +0 -1
- package/dist/features/selection/SelectionContext.js +0 -46
- package/dist/features/selection/SelectionContext.js.map +0 -1
- package/dist/features/simulation/createSimulation.js +0 -61
- package/dist/features/simulation/createSimulation.js.map +0 -1
- package/dist/features/simulation/types.js +0 -6
- package/dist/features/simulation/types.js.map +0 -1
- package/dist/features/simulation/useSimulation.js +0 -74
- package/dist/features/simulation/useSimulation.js.map +0 -1
- package/dist/features/text/domRuns.js +0 -258
- package/dist/features/text/domRuns.js.map +0 -1
- package/dist/features/text/fitTextPose.js +0 -38
- package/dist/features/text/fitTextPose.js.map +0 -1
- package/dist/features/text/hitTest.js +0 -45
- package/dist/features/text/hitTest.js.map +0 -1
- package/dist/features/text/renderLabel.js +0 -14
- package/dist/features/text/renderLabel.js.map +0 -1
- package/dist/features/text/runs/effectiveRangeStyle.js +0 -66
- package/dist/features/text/runs/effectiveRangeStyle.js.map +0 -1
- package/dist/features/text/runs/flagRange.js +0 -53
- package/dist/features/text/runs/flagRange.js.map +0 -1
- package/dist/features/text/runs/rangeStyle.js +0 -135
- package/dist/features/text/runs/rangeStyle.js.map +0 -1
- package/dist/features/text/textCommand.js +0 -59
- package/dist/features/text/textCommand.js.map +0 -1
- package/dist/features/text/textToPath.js +0 -181
- package/dist/features/text/textToPath.js.map +0 -1
- package/dist/features/text/useTextEdit.js +0 -467
- package/dist/features/text/useTextEdit.js.map +0 -1
- package/dist/features/tiling/createTiledLayer.js +0 -63
- package/dist/features/tiling/createTiledLayer.js.map +0 -1
- package/dist/features/tiling/tiledProject.js +0 -14
- package/dist/features/tiling/tiledProject.js.map +0 -1
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js +0 -26
- package/dist/interactions/actions/clone/behaviors/cloneByAltDrag.js.map +0 -1
- package/dist/interactions/actions/defaults/align.js.map +0 -1
- package/dist/interactions/actions/defaults/booleans.js +0 -52
- package/dist/interactions/actions/defaults/booleans.js.map +0 -1
- package/dist/interactions/actions/defaults/clipboard.js.map +0 -1
- package/dist/interactions/actions/defaults/clone.js +0 -107
- package/dist/interactions/actions/defaults/clone.js.map +0 -1
- package/dist/interactions/actions/defaults/createOutlines.js +0 -47
- package/dist/interactions/actions/defaults/createOutlines.js.map +0 -1
- package/dist/interactions/actions/defaults/distribute.js +0 -66
- package/dist/interactions/actions/defaults/distribute.js.map +0 -1
- package/dist/interactions/actions/defaults/editAnchors.js.map +0 -1
- package/dist/interactions/actions/defaults/flip.js +0 -119
- package/dist/interactions/actions/defaults/flip.js.map +0 -1
- package/dist/interactions/actions/defaults/freshNodeId.js +0 -10
- package/dist/interactions/actions/defaults/freshNodeId.js.map +0 -1
- package/dist/interactions/actions/defaults/insert.js +0 -288
- package/dist/interactions/actions/defaults/insert.js.map +0 -1
- package/dist/interactions/actions/defaults/lassoSelect.js +0 -156
- package/dist/interactions/actions/defaults/lassoSelect.js.map +0 -1
- package/dist/interactions/actions/defaults/move.js +0 -760
- package/dist/interactions/actions/defaults/move.js.map +0 -1
- package/dist/interactions/actions/defaults/resize.js +0 -335
- package/dist/interactions/actions/defaults/resize.js.map +0 -1
- package/dist/interactions/actions/defaults/rotate.js +0 -184
- package/dist/interactions/actions/defaults/rotate.js.map +0 -1
- package/dist/interactions/actions/previewOverrides.js +0 -25
- package/dist/interactions/actions/previewOverrides.js.map +0 -1
- package/dist/interactions/actions/resize/autoPoseDescriptor.js.map +0 -1
- package/dist/math-Drrw4ewZ.d.ts +0 -160
- package/dist/registerProgram-BMZRDgrh.d.ts +0 -197
- package/dist/renderer/DrawCommand.js +0 -6
- package/dist/renderer/DrawCommand.js.map +0 -1
- package/dist/renderer/WeaselRenderer.js +0 -331
- package/dist/renderer/WeaselRenderer.js.map +0 -1
- package/dist/renderer/batchClip.js +0 -46
- package/dist/renderer/batchClip.js.map +0 -1
- package/dist/renderer/cache/GLImageCache.js +0 -64
- package/dist/renderer/cache/GLImageCache.js.map +0 -1
- package/dist/renderer/cache/GLMeshCache.js +0 -102
- package/dist/renderer/cache/GLMeshCache.js.map +0 -1
- package/dist/renderer/cache/GLTextureCache.js +0 -51
- package/dist/renderer/cache/GLTextureCache.js.map +0 -1
- package/dist/renderer/cache/GradientRampAtlas.js +0 -82
- package/dist/renderer/cache/GradientRampAtlas.js.map +0 -1
- package/dist/renderer/cache/cache.js +0 -13
- package/dist/renderer/cache/cache.js.map +0 -1
- package/dist/renderer/cache/markerCommandCache.js +0 -63
- package/dist/renderer/cache/markerCommandCache.js.map +0 -1
- package/dist/renderer/cache/outlineMeshCache.js +0 -15
- package/dist/renderer/cache/outlineMeshCache.js.map +0 -1
- package/dist/renderer/cache/outlineStrokeMeshCache.js +0 -36
- package/dist/renderer/cache/outlineStrokeMeshCache.js.map +0 -1
- package/dist/renderer/cache/strokeMeshCache.js +0 -55
- package/dist/renderer/cache/strokeMeshCache.js.map +0 -1
- package/dist/renderer/cullDrawCommands.js +0 -90
- package/dist/renderer/cullDrawCommands.js.map +0 -1
- package/dist/renderer/draw.js +0 -1135
- package/dist/renderer/draw.js.map +0 -1
- package/dist/renderer/drawBatch.js +0 -198
- package/dist/renderer/drawBatch.js.map +0 -1
- package/dist/renderer/effects/EffectTargets.js +0 -45
- package/dist/renderer/effects/EffectTargets.js.map +0 -1
- package/dist/renderer/effects/builtins.js +0 -31
- package/dist/renderer/effects/builtins.js.map +0 -1
- package/dist/renderer/effects/composite.js +0 -9
- package/dist/renderer/effects/composite.js.map +0 -1
- package/dist/renderer/effects/effectPrelude.js +0 -10
- package/dist/renderer/effects/effectPrelude.js.map +0 -1
- package/dist/renderer/effects/types.js +0 -10
- package/dist/renderer/effects/types.js.map +0 -1
- package/dist/renderer/glyphOutlineMesh.js +0 -67
- package/dist/renderer/glyphOutlineMesh.js.map +0 -1
- package/dist/renderer/index.js +0 -19
- package/dist/renderer/math/color.js +0 -341
- package/dist/renderer/math/color.js.map +0 -1
- package/dist/renderer/math/mat3.js +0 -76
- package/dist/renderer/math/mat3.js.map +0 -1
- package/dist/renderer/math/patternSpace.js +0 -22
- package/dist/renderer/math/patternSpace.js.map +0 -1
- package/dist/renderer/math/viewToMat3.js +0 -19
- package/dist/renderer/math/viewToMat3.js.map +0 -1
- package/dist/renderer/paintResources.js +0 -18
- package/dist/renderer/paintResources.js.map +0 -1
- package/dist/renderer/paintScratch.js +0 -37
- package/dist/renderer/paintScratch.js.map +0 -1
- package/dist/renderer/shaders/ShaderProgram.js +0 -74
- package/dist/renderer/shaders/ShaderProgram.js.map +0 -1
- package/dist/renderer/shaders/batchFill.js +0 -119
- package/dist/renderer/shaders/batchFill.js.map +0 -1
- package/dist/renderer/shaders/customPrelude.js +0 -34
- package/dist/renderer/shaders/customPrelude.js.map +0 -1
- package/dist/renderer/shaders/extractUniformNames.js +0 -184
- package/dist/renderer/shaders/extractUniformNames.js.map +0 -1
- package/dist/renderer/shaders/glyphPaint.js +0 -61
- package/dist/renderer/shaders/glyphPaint.js.map +0 -1
- package/dist/renderer/shaders/gradFill.js +0 -30
- package/dist/renderer/shaders/gradFill.js.map +0 -1
- package/dist/renderer/shaders/imageFill.js +0 -14
- package/dist/renderer/shaders/imageFill.js.map +0 -1
- package/dist/renderer/shaders/pathFill.js +0 -13
- package/dist/renderer/shaders/pathFill.js.map +0 -1
- package/dist/renderer/shaders/patternFill.js +0 -24
- package/dist/renderer/shaders/patternFill.js.map +0 -1
- package/dist/renderer/shaders/registerProgram.js +0 -18
- package/dist/renderer/shaders/registerProgram.js.map +0 -1
- package/dist/renderer/spriteSheet.js +0 -14
- package/dist/renderer/spriteSheet.js.map +0 -1
- package/dist/renderer/state/GroupState.js +0 -77
- package/dist/renderer/state/GroupState.js.map +0 -1
- package/dist/renderer/strokeLengths.js +0 -50
- package/dist/renderer/strokeLengths.js.map +0 -1
- package/dist/renderer/syntheticItalic.js +0 -6
- package/dist/renderer/syntheticItalic.js.map +0 -1
- package/dist/renderer/textures/registerTexture.js +0 -14
- package/dist/renderer/textures/registerTexture.js.map +0 -1
- package/dist/scheduling/useVisibleRaf.js +0 -69
- package/dist/scheduling/useVisibleRaf.js.map +0 -1
- package/dist/test-seams-CuIxe0xY.d.ts +0 -356
- package/dist/tools/prefs.js +0 -62
- package/dist/tools/prefs.js.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BUILTIN_MARKERS as e } from "./strokeMarkerShapes.js";
|
|
2
|
-
import { createReflectable as t } from "@weasel-js/registry";
|
|
3
|
-
//#region src/core/strokeMarkers.ts
|
|
4
|
-
var n = t();
|
|
5
|
-
function r() {
|
|
6
|
-
for (let t of e) n.push(t.id, t, { source: "kit" });
|
|
7
|
-
}
|
|
8
|
-
r();
|
|
9
|
-
var i = n.reflection;
|
|
10
|
-
function a() {
|
|
11
|
-
return n.getVersion();
|
|
12
|
-
}
|
|
13
|
-
function o(e) {
|
|
14
|
-
return n.push(e.id, e);
|
|
15
|
-
}
|
|
16
|
-
function s(e) {
|
|
17
|
-
return e === void 0 ? void 0 : n.get(e);
|
|
18
|
-
}
|
|
19
|
-
function c() {
|
|
20
|
-
return n.entries().map((e) => e.value);
|
|
21
|
-
}
|
|
22
|
-
function l() {
|
|
23
|
-
n.clear(), r();
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { l as _resetMarkersForTests, s as getMarker, c as listMarkers, a as markerGeneration, i as markerRegistry, o as registerMarker };
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=strokeMarkers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strokeMarkers.js","names":["MARKERS","createReflectable","seedBuiltins","entry","BUILTIN_MARKERS","markerRegistry","markerGeneration","registerMarker","getMarker","key","listMarkers","_resetMarkersForTests"],"sources":["../../src/core/strokeMarkers.ts"],"sourcesContent":["/**\n * The stroke-marker registry — arrowheads and other line terminators.\n *\n * Keyed by string, because a key is what sits in `stroke.markerEnd`. That is\n * the difference from `registerNodeShape`, which resolves by first-matching\n * predicate and whose `id` is only a label.\n *\n * A built-in's SVG slot lives in `@weasel-js/svg` and cannot be imported here\n * without inverting a package dependency, so an entry carries `toSvg` for that\n * package to consume — the same split `PaintKindEntry` uses.\n */\n\nimport type { FillStyle, MarkerKey, Stroke } from '@weasel-js/paint';\nimport type { Path } from '@weasel-js/geom';\nimport { createReflectable, type Reflection } from '@weasel-js/registry';\nimport { BUILTIN_MARKERS } from './strokeMarkerShapes';\n\n/** What an entry's `path` is given. Entries that ignore it may return a\n * constant path. */\nexport interface MarkerCtx {\n /** One geometry unit, in the same world units the ribbon is tessellated in.\n * Defaults to the resolved stroke width. */\n readonly size: number;\n /** The stroke this marker belongs to, already width-resolved. */\n readonly stroke: Stroke;\n}\n\n/** `'line'` means the stroke's own paint — SVG 2's `context-stroke`, as the\n * default rather than an opt-in. */\nexport type MarkerPaint = FillStyle | 'line' | 'none';\n\n/** A stroke-marker registry entry: a terminator's geometry, paint and inset. */\nexport interface MarkerEntry {\n /** `'kit:'`-free for built-ins so the key matches the SVG attribute value;\n * consumers should prefix (`'app-my-head'`). A key becomes the `id` of the\n * emitted `<marker>` def, so it must be a valid XML name — no colons. */\n id: MarkerKey;\n /** Geometry with its anchor at the origin, pointing +X, in units of\n * `ctx.size`. An arbitrary anchor is expressed by where the geometry is\n * drawn, which is why there is no `refX`/`refY`. */\n path(ctx: MarkerCtx): Path;\n /** Default `'line'`. */\n fill?: MarkerPaint;\n /** Outline width is in the same units as `path`. `false` (the default)\n * means no outline. */\n outline?: { width: number; paint?: MarkerPaint } | false;\n /** How far back along the line the stroke stops, in units of `ctx.size`.\n * Default 0. A property of the shape, not a setting on the stroke: an open\n * V needs 0 or its arms stop meeting the line. */\n inset?: number;\n /** `'auto'` (default) follows the line; a number is a fixed angle in\n * radians, ignoring the line — SVG's `orient=\"<angle>\"`. */\n orient?: 'auto' | number;\n /** The stroke fields `path` reads besides `ctx.size` — `[]` for a shape\n * drawn from size alone. Declared, a head is reused across stroke objects\n * whose listed fields are equal; omitted, only across frames that pass the\n * same stroke object, since `path` might read any of it. */\n reads?: readonly (keyof Stroke)[];\n /** Emits the `<marker>` def. Consumed by `@weasel-js/svg`. */\n toSvg?(id: string, entry: MarkerEntry): string;\n}\n\nconst MARKERS = createReflectable<MarkerEntry>();\n\nfunction seedBuiltins(): void {\n for (const entry of BUILTIN_MARKERS) MARKERS.push(entry.id, entry, { source: 'kit' });\n}\nseedBuiltins();\n\n/** Every registered marker, with the overrides each displaced. */\nexport const markerRegistry: Reflection<MarkerEntry> = MARKERS.reflection;\n\n/** Bumped whenever the registered set changes, for caches of marker geometry. */\nexport function markerGeneration(): number {\n return MARKERS.getVersion();\n}\n\n/** Register a marker. Returns a disposer. Re-registering an existing id is an\n * override; disposing it uncovers whatever it displaced rather than deleting the key. */\nexport function registerMarker(entry: MarkerEntry): () => void {\n return MARKERS.push(entry.id, entry);\n}\n\n/** The entry for `key`, or `undefined`. */\nexport function getMarker(key: string | undefined): MarkerEntry | undefined {\n return key === undefined ? undefined : MARKERS.get(key);\n}\n\n/** Every registered marker, built-ins first, in registration order. */\nexport function listMarkers(): readonly MarkerEntry[] {\n return MARKERS.entries().map((e) => e.value);\n}\n\n/** Test helper. Do not call from product code. */\nexport function _resetMarkersForTests(): void {\n MARKERS.clear();\n seedBuiltins();\n}\n"],"mappings":";;;AA8DA,IAAMA,IAAUC,EAA+B;AAE/C,SAASC,IAAqB;CAC5B,KAAK,IAAMC,KAASC,GAAiB,EAAQ,KAAKD,EAAM,IAAIA,GAAO,EAAE,QAAQ,MAAM,CAAC;AACtF;AACAD,EAAa;AAGb,IAAaG,IAA0CL,EAAQ;AAG/D,SAAgBM,IAA2B;CACzC,OAAON,EAAQ,WAAW;AAC5B;AAIA,SAAgBO,EAAe,GAAgC;CAC7D,OAAOP,EAAQ,KAAKG,EAAM,IAAIA,CAAK;AACrC;AAGA,SAAgBK,EAAU,GAAkD;CAC1E,OAAOC,MAAQ,KAAA,IAAY,KAAA,IAAYT,EAAQ,IAAIS,CAAG;AACxD;AAGA,SAAgBC,IAAsC;CACpD,OAAOV,EAAQ,QAAQ,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK;AAC7C;AAGA,SAAgBW,IAA8B;CAE5C,AADAX,EAAQ,MAAM,GACdE,EAAa;AACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meanScale.js","names":["meanScale","s"],"sources":["../../../src/core/viewport/meanScale.ts"],"sourcesContent":["/**\n * Geometric mean of a per-axis scale. Degenerates to `s.x` (or `s.y`) when the\n * two axes are equal; otherwise sits between them.\n *\n * **Not for hit-testing.** A screen-pixel length is not one world distance\n * under non-uniform zoom, and collapsing it to a scalar makes a pickable\n * region too generous on one axis and too mean on the other. Use `pxExtent`\n * for a per-axis world length, or `withinPxBox` / `withinPxRadius` to compare\n * in screen space directly. Chrome hit-tests moved off this in 2026-08.\n *\n * Nor for placing chrome or measuring a pick slop: `standoff` and\n * `strokeHitTest`'s `slop` work on screen, which stays exact under a rotated\n * target where no per-axis world answer exists.\n *\n * What legitimately remains is a stroke width for a line that is not\n * axis-aligned. A ribbon takes one world width, and the renderer resolves a\n * `{ px }` width through this same mean, so a picker reading ink widths must\n * too. An axis-aligned line has an exact answer — `pxExtent` on its cross\n * axis, as the grid layer does.\n */\nexport function meanScale(s: { x: number; y: number }): number {\n return Math.sqrt(s.x * s.y);\n}\n"],"mappings":";AAoBA,SAAgBA,EAAU,GAAqC;CAC7D,OAAO,KAAK,KAAKC,EAAE,IAAIA,EAAE,CAAC;AAC5B"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region src/core/viewport/pxExtent.ts
|
|
2
|
-
function e(e, t, n = 0) {
|
|
3
|
-
if (!n) return {
|
|
4
|
-
x: e / Math.abs(t.x),
|
|
5
|
-
y: e / Math.abs(t.y)
|
|
6
|
-
};
|
|
7
|
-
let r = Math.cos(n), i = Math.sin(n);
|
|
8
|
-
return {
|
|
9
|
-
x: e * Math.hypot(r / t.x, i / t.y),
|
|
10
|
-
y: e * Math.hypot(i / t.x, r / t.y)
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function t(e, t, n) {
|
|
14
|
-
return {
|
|
15
|
-
x: e * n.x,
|
|
16
|
-
y: t * n.y
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function n(e, n, r, i) {
|
|
20
|
-
let a = t(e, n, i);
|
|
21
|
-
return Math.abs(a.x) <= r && Math.abs(a.y) <= r;
|
|
22
|
-
}
|
|
23
|
-
function r(e, n, r, i) {
|
|
24
|
-
let a = t(e, n, i);
|
|
25
|
-
return a.x * a.x + a.y * a.y <= r * r;
|
|
26
|
-
}
|
|
27
|
-
function i(e, t, n, r) {
|
|
28
|
-
let i = Math.sign(r.x * r.y) || 1, a = t.x * r.y * i, o = t.y * r.x * i, s = Math.hypot(a, o) || 1;
|
|
29
|
-
return a /= s, o /= s, {
|
|
30
|
-
x: e.x + a * n / r.x,
|
|
31
|
-
y: e.y + o * n / r.y,
|
|
32
|
-
nx: a,
|
|
33
|
-
ny: o
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function a(e, t) {
|
|
37
|
-
return Math.atan2(Math.sin(e) * t.y, Math.cos(e) * t.x);
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { e as pxExtent, t as scaleDelta, a as screenAngleOf, i as standoff, n as withinPxBox, r as withinPxRadius };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=pxExtent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxExtent.js","names":["pxExtent","rotation","px","scale","c","s","scaleDelta","dx","dy","withinPxBox","withinPxRadius","standoff","k","nx","normal","ny","l","anchor","screenAngleOf"],"sources":["../../../src/core/viewport/pxExtent.ts"],"sourcesContent":["/**\n * Screen-pixel lengths in world units, per axis.\n *\n * Chrome declares its hit zones in screen pixels — an 8px handle stays 8px at\n * every zoom, because it paints in screen space. Converting one such length to\n * world units with a single scalar (see `meanScale`) is exact only under\n * uniform zoom; per-axis it is too generous on one axis and too mean on the\n * other, so the pickable region stops matching the painted one.\n *\n * Prefer {@link withinPxBox} / {@link withinPxRadius}, which compare in screen\n * space and so can't drift from the paint at all. {@link pxExtent} is for the\n * cases that must stay in world units — a tolerance handed to geometry that\n * doesn't know about the view.\n */\n\nexport interface Scale2 {\n x: number;\n y: number;\n}\n\n/** One screen-pixel length as world-space extents, per axis. `scale` is a\n * view's, so neither axis is zero (see `View`).\n *\n * With `rotation`, the axes are a frame turned that far from world, and each\n * extent is how far along it an edge across it must move to move `px` on\n * screen — which, under non-uniform zoom, is not the extent along the screen\n * axis nearest to it. */\nexport function pxExtent(px: number, scale: Scale2, rotation = 0): { x: number; y: number } {\n if (!rotation) {\n return {\n x: px / Math.abs(scale.x),\n y: px / Math.abs(scale.y),\n };\n }\n const c = Math.cos(rotation), s = Math.sin(rotation);\n return {\n x: px * Math.hypot(c / scale.x, s / scale.y),\n y: px * Math.hypot(s / scale.x, c / scale.y),\n };\n}\n\n/** World delta → screen delta. Only the scale participates: translation\n * cancels in a difference, and the kit's views carry no skew. */\nexport function scaleDelta(dx: number, dy: number, scale: Scale2): { x: number; y: number } {\n return { x: dx * scale.x, y: dy * scale.y };\n}\n\n/**\n * Is a world-space delta inside a screen-space square of half-extent `px`?\n *\n * The square is axis-aligned **on screen**, which is what a handle painted in\n * screen space actually is — so this stays true under non-uniform zoom and\n * under a rotated target, where an axis-aligned world-space test is a rotated\n * rectangle on screen.\n */\nexport function withinPxBox(dx: number, dy: number, px: number, scale: Scale2): boolean {\n const s = scaleDelta(dx, dy, scale);\n return Math.abs(s.x) <= px && Math.abs(s.y) <= px;\n}\n\n/** Is a world-space delta inside a screen-space circle of radius `px`? */\nexport function withinPxRadius(dx: number, dy: number, px: number, scale: Scale2): boolean {\n const s = scaleDelta(dx, dy, scale);\n return s.x * s.x + s.y * s.y <= px * px;\n}\n\n/**\n * A world point pushed `px` screen pixels off an edge, along the edge's normal\n * as it lands on screen. `normal` is the edge's outward normal in world space.\n *\n * Scaling the world normal by the view is not the same thing: under\n * non-uniform zoom the image of a normal is no longer perpendicular to the\n * image of its edge, so chrome placed that way drifts sideways and sits closer\n * than `px`. Returns the point in world coords and the on-screen unit normal.\n */\nexport function standoff(\n anchor: { x: number; y: number },\n normal: { x: number; y: number },\n px: number,\n scale: Scale2,\n): { x: number; y: number; nx: number; ny: number } {\n // The edge's screen normal is S⁻ᵀn, here scaled by det S to stay finite.\n const k = Math.sign(scale.x * scale.y) || 1;\n let nx = normal.x * scale.y * k;\n let ny = normal.y * scale.x * k;\n const l = Math.hypot(nx, ny) || 1;\n nx /= l;\n ny /= l;\n return { x: anchor.x + (nx * px) / scale.x, y: anchor.y + (ny * px) / scale.y, nx, ny };\n}\n\n/** The screen angle a frame turned `rotation` from world lands its x axis at.\n * Equals `rotation` under uniform zoom; non-uniform zoom bends it. */\nexport function screenAngleOf(rotation: number, scale: Scale2): number {\n return Math.atan2(Math.sin(rotation) * scale.y, Math.cos(rotation) * scale.x);\n}\n"],"mappings":";AA2BA,SAAgBA,EAAS,GAAY,GAAe,IAAW,GAA6B;CAC1F,IAAI,CAACC,GACH,OAAO;EACL,GAAGC,IAAK,KAAK,IAAIC,EAAM,CAAC;EACxB,GAAGD,IAAK,KAAK,IAAIC,EAAM,CAAC;CAC1B;CAEF,IAAMC,IAAI,KAAK,IAAIH,CAAQ,GAAGI,IAAI,KAAK,IAAIJ,CAAQ;CACnD,OAAO;EACL,GAAGC,IAAK,KAAK,MAAME,IAAID,EAAM,GAAGE,IAAIF,EAAM,CAAC;EAC3C,GAAGD,IAAK,KAAK,MAAMG,IAAIF,EAAM,GAAGC,IAAID,EAAM,CAAC;CAC7C;AACF;AAIA,SAAgBG,EAAW,GAAY,GAAY,GAAyC;CAC1F,OAAO;EAAE,GAAGC,IAAKJ,EAAM;EAAG,GAAGK,IAAKL,EAAM;CAAE;AAC5C;AAUA,SAAgBM,EAAY,GAAY,GAAY,GAAY,GAAwB;CACtF,IAAMJ,IAAIC,EAAWC,GAAIC,GAAIL,CAAK;CAClC,OAAO,KAAK,IAAIE,EAAE,CAAC,KAAKH,KAAM,KAAK,IAAIG,EAAE,CAAC,KAAKH;AACjD;AAGA,SAAgBQ,EAAe,GAAY,GAAY,GAAY,GAAwB;CACzF,IAAML,IAAIC,EAAWC,GAAIC,GAAIL,CAAK;CAClC,OAAOE,EAAE,IAAIA,EAAE,IAAIA,EAAE,IAAIA,EAAE,KAAKH,IAAKA;AACvC;AAWA,SAAgBS,EACd,GACA,GACA,GACA,GACkD;CAElD,IAAMC,IAAI,KAAK,KAAKT,EAAM,IAAIA,EAAM,CAAC,KAAK,GACtCU,IAAKC,EAAO,IAAIX,EAAM,IAAIS,GAC1BG,IAAKD,EAAO,IAAIX,EAAM,IAAIS,GACxBI,IAAI,KAAK,MAAMH,GAAIE,CAAE,KAAK;CAGhC,OAFA,KAAMC,GACN,KAAMA,GACC;EAAE,GAAGC,EAAO,IAAKJ,IAAKX,IAAMC,EAAM;EAAG,GAAGc,EAAO,IAAKF,IAAKb,IAAMC,EAAM;EAAG;EAAI;CAAG;AACxF;AAIA,SAAgBe,EAAc,GAAkB,GAAuB;CACrE,OAAO,KAAK,MAAM,KAAK,IAAIjB,CAAQ,IAAIE,EAAM,GAAG,KAAK,IAAIF,CAAQ,IAAIE,EAAM,CAAC;AAC9E"}
|
package/dist/debug/flag.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flag.js","names":["KEYS","cached","read","empty","k","v","get","isDebugEnabled","c","namespace","dlog","args","dwarn"],"sources":["../../src/debug/flag.ts"],"sourcesContent":["/**\n * Namespaced, opt-in console tracing for the kit.\n *\n * Enable in the browser:\n *\n * localStorage.setItem('weasel.debug', '*') // all namespaces\n * localStorage.setItem('weasel.debug', 'tools,dispatch') // specific ones\n * localStorage.setItem('weasel.debug', '1') // legacy \"all\"\n *\n * Each call site picks a stable namespace string. Off by default; the flag\n * is read once and cached per page session — reload to pick up a change.\n *\n * Mirrors `packages/ui/src/dlog.ts`. The two impls live in separate\n * packages because weasel-ui doesn't depend on the kit, but both read the\n * same localStorage keys so behavior is uniform from a debugger's POV.\n *\n * Known kit namespaces:\n * - tools — active-tool + hotkey transitions (useTools)\n * - dispatch — gesture start / end / cancel (dispatcher)\n * - drag-rect — useDragRect lifecycle\n * - drag-radial — useDragRadial lifecycle\n * - scene — restored-op replay gaps (history persistence)\n * - scene-canvas — SceneCanvas mount / unmount; adapter paste-translation warnings\n * - history — applyOps push, no-op suppression, serialize/restore\n * - clipboard — OS clipboard write/read failures, malformed payloads\n */\n\nconst KEYS = ['weasel.debug', 'weaseldraw.debug'] as const;\n\ninterface Cached {\n all: boolean;\n set: Set<string>;\n}\n\nlet cached: Cached | null = null;\n\nfunction read(): Cached {\n const empty: Cached = { all: false, set: new Set() };\n if (typeof localStorage === 'undefined') return empty;\n try {\n for (const k of KEYS) {\n const v = localStorage.getItem(k);\n if (v == null || v === '') continue;\n if (v === '1' || v === 'true' || v === '*') return { all: true, set: new Set() };\n return { all: false, set: new Set(v.split(/[\\s,]+/).filter(Boolean)) };\n }\n return empty;\n } catch {\n return empty;\n }\n}\n\nfunction get(): Cached {\n if (cached === null) cached = read();\n return cached;\n}\n\n/** True when `namespace` (or `*`) is enabled. Pass no argument to test\n * whether *any* namespace is on (legacy global-flag semantics). */\nexport function isDebugEnabled(namespace?: string): boolean {\n const c = get();\n if (c.all) return true;\n if (namespace === undefined) return c.set.size > 0;\n return c.set.has(namespace);\n}\n\n/** Conditional `console.debug` — no-op unless `namespace` (or `*`) is enabled.\n * Each call is prefixed with `[namespace]` so the source is searchable. */\nexport function dlog(namespace: string, ...args: unknown[]): void {\n if (!isDebugEnabled(namespace)) return;\n // eslint-disable-next-line no-console\n console.debug(`[${namespace}]`, ...args);\n}\n\n/** Conditional `console.warn` — like `dlog` but at warn level. Use for\n * diagnostics that indicate something worth surfacing during debugging\n * (e.g. no-op op batches suppressed). */\nexport function dwarn(namespace: string, ...args: unknown[]): void {\n if (!isDebugEnabled(namespace)) return;\n console.warn(`[${namespace}]`, ...args);\n}\n"],"mappings":";AA2BA,IAAMA,IAAO,CAAC,gBAAgB,kBAAkB,GAO5CC,IAAwB;AAE5B,SAASC,IAAe;CACtB,IAAMC,IAAgB;EAAE,KAAK;EAAO,qBAAK,IAAI,IAAI;CAAE;CACnD,IAAI,OAAO,eAAiB,KAAa,OAAOA;CAChD,IAAI;EACF,KAAK,IAAMC,KAAKJ,GAAM;GACpB,IAAMK,IAAI,aAAa,QAAQD,CAAC;GAChC,IAAIC,KAAK,QAAQA,MAAM,IAEvB,OADIA,MAAM,OAAOA,MAAM,UAAUA,MAAM,MAAY;IAAE,KAAK;IAAM,qBAAK,IAAI,IAAI;GAAE,IACxE;IAAE,KAAK;IAAO,KAAK,IAAI,IAAIA,EAAE,MAAM,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC;GAAE;EACvE;EACA,OAAOF;CACT,QAAQ;EACN,OAAOA;CACT;AACF;AAEA,SAASG,IAAc;CAErB,OADIL,MAAW,SAAM,IAASC,EAAK,IAC5BD;AACT;AAIA,SAAgBM,EAAe,GAA6B;CAC1D,IAAMC,IAAIF,EAAI;CAGd,OAFIE,EAAE,MAAY,KACdC,MAAc,KAAA,IAAkBD,EAAE,IAAI,OAAO,IAC1CA,EAAE,IAAI,IAAIC,CAAS;AAC5B;AAIA,SAAgBC,EAAK,GAAmB,GAAGC,GAAuB;CAChE,AAAKJ,EAAeE,CAAS,KAE7B,QAAQ,MAAM,IAAIA,EAAU,IAAI,GAAGE,CAAI;AACzC;AAKA,SAAgBC,EAAM,GAAmB,GAAGD,GAAuB;CACjE,AAAKJ,EAAeE,CAAS,KAC7B,QAAQ,KAAK,IAAIA,EAAU,IAAI,GAAGE,CAAI;AACxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paintedCursorLayer.js","names":["PAINTED_CURSOR_LAYER_ID","pathCache","pathFor","p","d","pathFromD","commandFor","op","createPaintedCursorLayer","frame","state","glyph","GLYPHS","cursor","scale","view","worldSized","size","cursorWorldSize","ops","cursorPaintOps","chromeLineWidthScale","a","b","c","e","f","cursorPaintMatrix"],"sources":["../../../src/features/cursor/paintedCursorLayer.ts"],"sourcesContent":["/**\n * The painted tier: draws a cursor glyph into the scene when it is too big,\n * or too tied to the view, to be a CSS `url()` cursor.\n *\n * A layer rather than something each tool draws in its own overlay, because\n * the alternative is every tool re-wiring the same thing. Riding the layer\n * system also means anything that reaches the cursor pipeline through a layer\n * claim — a HUD widget's `cursorAt` — gets the painted tier without knowing\n * this exists.\n *\n * Screen-space: the glyph is chrome at the pointer, not content in the\n * document, so it must not pan or zoom with the camera. What *does* track the\n * camera is a world-sized glyph's size, and `view.scale` is read for that.\n */\n\nimport { GLYPHS } from '@weasel-js/cursor';\nimport {\n chromeLineWidthScale,\n cursorPaintMatrix,\n cursorPaintOps,\n cursorWorldSize,\n} from '@weasel-js/cursor';\nimport type { CursorPaintOp } from '@weasel-js/cursor';\nimport type { DrawCommand, PathDrawCommand } from '../../renderer';\nimport type { RenderLayer } from 'core/layers/render';\nimport { pathFromD, type Path } from '@weasel-js/geom';\nimport type { PaintedCursorState } from '@weasel-js/cursor';\n\n/** Layer id, so a consumer can order or hide it like any other. */\nexport const PAINTED_CURSOR_LAYER_ID = 'painted-cursor';\n\n/**\n * `d` strings are fixed by the glyph set, so the parse is done once per glyph\n * member for the life of the process. Handing the renderer the same `Path`\n * object every frame also lets its own mesh cache hit.\n */\nconst pathCache = new Map<string, Path>();\nfunction pathFor(d: string): Path {\n let p = pathCache.get(d);\n if (p === undefined) {\n p = pathFromD(d);\n pathCache.set(d, p);\n }\n return p;\n}\n\nfunction commandFor(op: CursorPaintOp): PathDrawCommand {\n return {\n kind: 'path',\n path: pathFor(op.d),\n ...(op.fill !== undefined ? { fill: { color: op.fill } } : {}),\n ...(op.stroke !== undefined\n ? {\n stroke: {\n paint: { color: op.stroke.color },\n width: op.stroke.width,\n cap: 'round' as const,\n join: 'round' as const,\n },\n }\n : {}),\n };\n}\n\n/**\n * A screen-space layer that draws the glyph `state` currently holds at the pointer,\n * or nothing when it holds none. `<Canvas>` mounts one over its own state already.\n */\nexport function createPaintedCursorLayer(state: PaintedCursorState): RenderLayer<unknown> {\n return {\n id: PAINTED_CURSOR_LAYER_ID,\n label: 'Painted cursor',\n space: 'screen',\n draw: (_data, view) => {\n const frame = state.current();\n if (!frame) return [];\n const { cursor, at } = frame;\n const glyph = GLYPHS[cursor.glyph];\n if (!glyph) return [];\n\n // A world-sized glyph is measured against the live camera, and holds its\n // line weight in CSS px while its geometry grows — a ring at a 400px\n // radius drawn with scaled weight is a filled blob, not a cursor.\n // Radial, so a single radius needs one scale factor; average the axes.\n const scale = (view.scale.x + view.scale.y) / 2;\n const worldSized = cursor.worldRadius !== undefined;\n const size = worldSized\n ? cursorWorldSize(glyph, cursor.worldRadius as number, scale)\n : (cursor.size ?? 24);\n if (!(size > 0) || !Number.isFinite(size)) return [];\n\n const ops = cursorPaintOps(\n glyph,\n worldSized ? { lineWidthScale: chromeLineWidthScale(glyph, size) } : {},\n );\n const [a, b, c, d, e, f] = cursorPaintMatrix(glyph, {\n size,\n angle: cursor.angle,\n at,\n });\n // Column-major, the layout `Mat3` documents.\n const transform = new Float32Array([a, b, 0, c, d, 0, e, f, 1]);\n const children: DrawCommand[] = ops.map(commandFor);\n return [{ kind: 'group', transform, children }];\n },\n };\n}\n"],"mappings":";;;AA6BA,IAAaA,IAA0B,kBAOjCC,oBAAY,IAAI,IAAkB;AACxC,SAASC,EAAQ,GAAiB;CAChC,IAAIC,IAAIF,EAAU,IAAIG,CAAC;CAKvB,OAJID,MAAM,KAAA,MACR,IAAIE,EAAUD,CAAC,GACfH,EAAU,IAAIG,GAAGD,CAAC,IAEbA;AACT;AAEA,SAASG,EAAW,GAAoC;CACtD,OAAO;EACL,MAAM;EACN,MAAMJ,EAAQK,EAAG,CAAC;EAClB,GAAIA,EAAG,SAAS,KAAA,IAA2C,CAAC,IAAhC,EAAE,MAAM,EAAE,OAAOA,EAAG,KAAK,EAAE;EACvD,GAAIA,EAAG,WAAW,KAAA,IASd,CAAC,IARD,EACE,QAAQ;GACN,OAAO,EAAE,OAAOA,EAAG,OAAO,MAAM;GAChC,OAAOA,EAAG,OAAO;GACjB,KAAK;GACL,MAAM;EACR,EACF;CAEN;AACF;AAMA,SAAgBC,EAAyB,GAAiD;CACxF,OAAO;EACL,IAAIR;EACJ,OAAO;EACP,OAAO;EACP,OAAO,GAAO,MAAS;GACrB,IAAMS,IAAQC,EAAM,QAAQ;GAC5B,IAAI,CAACD,GAAO,OAAO,CAAC;GACpB,IAAM,EAAE,WAAQ,UAAOA,GACjBE,IAAQC,EAAOC,EAAO;GAC5B,IAAI,CAACF,GAAO,OAAO,CAAC;GAMpB,IAAMG,KAASC,EAAK,MAAM,IAAIA,EAAK,MAAM,KAAK,GACxCC,IAAaH,EAAO,gBAAgB,KAAA,GACpCI,IAAOD,IACTE,EAAgBP,GAAOE,EAAO,aAAuBC,CAAK,IACzDD,EAAO,QAAQ;GACpB,IAAI,EAAEI,IAAO,MAAM,CAAC,OAAO,SAASA,CAAI,GAAG,OAAO,CAAC;GAEnD,IAAME,IAAMC,EACVT,GACAK,IAAa,EAAE,gBAAgBK,EAAqBV,GAAOM,CAAI,EAAE,IAAI,CAAC,CACxE,GACM,CAACK,GAAGC,GAAGC,GAAGpB,GAAGqB,GAAGC,KAAKC,EAAkBhB,GAAO;IAClD;IACA,OAAOE,EAAO;IACd;GACF,CAAC;GAID,OAAO,CAAC;IAAE,MAAM;IAAS,WAAA,IAFH,aAAa;KAACS;KAAGC;KAAG;KAAGC;KAAGpB;KAAG;KAAGqB;KAAGC;KAAG;IAAC,CAEpC;IAAW,UADJP,EAAI,IAAIb,CACJ;GAAS,CAAC;EAChD;CACF;AACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { subscribeToSources as e } from "../../core/layers/render.js";
|
|
2
|
-
//#region src/features/focus/gateLayer.ts
|
|
3
|
-
function t(t) {
|
|
4
|
-
let { layer: n, visible: r } = t, i = {
|
|
5
|
-
id: n.id,
|
|
6
|
-
label: n.label,
|
|
7
|
-
draw: (e, t, i) => r() ? n.draw(e, t, i) : []
|
|
8
|
-
};
|
|
9
|
-
return n.defaultVisible !== void 0 && (i.defaultVisible = n.defaultVisible), n.alwaysOn !== void 0 && (i.alwaysOn = n.alwaysOn), n.space !== void 0 && (i.space = n.space), n.subscribe && (i.subscribe = e([n])), i;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { t as gateLayer };
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=gateLayer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateLayer.js","names":["gateLayer","opts","wrapped","layer","visible","data","view","dims","subscribeToSources"],"sources":["../../../src/features/focus/gateLayer.ts"],"sourcesContent":["/**\n * `RenderLayer` wrapper that conditionally emits draw commands based on a\n * predicate. Most common use: hide selection-overlay handles when the\n * canvas isn't focused.\n *\n * The predicate is a getter (`() => boolean`), not a static value, because\n * RenderLayers are constructed once but their `draw` runs every frame —\n * a static value would lock in whatever the predicate returned at\n * construction time.\n */\nimport { subscribeToSources, type RenderLayer } from 'core/layers/render';\n\n/** Options for `gateLayer`. */\nexport interface GateLayerOptions<TData> {\n /** The wrapped layer. Its `id`, `label`, `defaultVisible`, `alwaysOn`,\n * `space` flow through unchanged. */\n layer: RenderLayer<TData>;\n /** Returns `true` to render the layer this frame, `false` to skip. */\n visible: () => boolean;\n}\n\n/** Wrap a render layer so it only draws while `visible()` is true. The\n * predicate is consulted per frame, which is how chrome follows canvas focus\n * without the layer knowing anything about focus. */\nexport function gateLayer<TData>(opts: GateLayerOptions<TData>): RenderLayer<TData> {\n const { layer, visible } = opts;\n const wrapped: RenderLayer<TData> = {\n id: layer.id,\n label: layer.label,\n draw: (data, view, dims) => (visible() ? layer.draw(data, view, dims) : []),\n };\n if (layer.defaultVisible !== undefined) wrapped.defaultVisible = layer.defaultVisible;\n if (layer.alwaysOn !== undefined) wrapped.alwaysOn = layer.alwaysOn;\n if (layer.space !== undefined) wrapped.space = layer.space;\n if (layer.subscribe) wrapped.subscribe = subscribeToSources([layer]);\n return wrapped;\n}\n"],"mappings":";;AAwBA,SAAgBA,EAAiB,GAAmD;CAClF,IAAM,EAAE,UAAO,eAAYC,GACrBC,IAA8B;EAClC,IAAIC,EAAM;EACV,OAAOA,EAAM;EACb,OAAO,GAAM,GAAM,MAAUC,EAAQ,IAAID,EAAM,KAAKE,GAAMC,GAAMC,CAAI,IAAI,CAAC;CAC3E;CAKA,OAJIJ,EAAM,mBAAmB,KAAA,MAAW,EAAQ,iBAAiBA,EAAM,iBACnEA,EAAM,aAAa,KAAA,MAAW,EAAQ,WAAWA,EAAM,WACvDA,EAAM,UAAU,KAAA,MAAW,EAAQ,QAAQA,EAAM,QACjDA,EAAM,cAAW,EAAQ,YAAYK,EAAmB,CAACL,CAAK,CAAC,IAC5DD;AACT"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useCallback as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
2
|
-
//#region src/features/focus/useCanvasFocus.ts
|
|
3
|
-
function i(i = {}) {
|
|
4
|
-
let { initial: a = !1, tabIndex: o = 0 } = i, [s, c] = r(a), l = n(a), u = e(() => {
|
|
5
|
-
l.current || (l.current = !0, c(!0));
|
|
6
|
-
}, []), d = e(() => {
|
|
7
|
-
l.current && (l.current = !1, c(!1));
|
|
8
|
-
}, []), f = e(() => l.current, []), p = e((e) => {
|
|
9
|
-
l.current !== e && (l.current = e, c(e));
|
|
10
|
-
}, []);
|
|
11
|
-
return {
|
|
12
|
-
focused: s,
|
|
13
|
-
focusProps: t(() => ({
|
|
14
|
-
tabIndex: o,
|
|
15
|
-
onFocus: u,
|
|
16
|
-
onBlur: d
|
|
17
|
-
}), [
|
|
18
|
-
o,
|
|
19
|
-
u,
|
|
20
|
-
d
|
|
21
|
-
]),
|
|
22
|
-
getFocused: f,
|
|
23
|
-
setFocused: p
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { i as useCanvasFocus };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=useCanvasFocus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasFocus.js","names":["useCanvasFocus","options","focused","setFocusedState","useState","initial","focusedRef","useRef","onFocus","useCallback","onBlur","getFocused","setFocused","next","useMemo","tabIndex"],"sources":["../../../src/features/focus/useCanvasFocus.ts"],"sourcesContent":["/**\n * Track DOM focus on a canvas (or any focusable host element). Returns the\n * live `focused` boolean, props to spread onto the focusable element, and a\n * stable `getFocused()` getter for use inside per-frame closures (notably\n * `RenderLayer.draw`, which is constructed once but called every frame).\n *\n * Pure feature module — no Canvas/SceneCanvas integration. Consumers compose\n * the hook + `gateLayer` (or their own gate) to hide affordances when blurred.\n */\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\n/** Options for `useCanvasFocus`. */\nexport interface UseCanvasFocusOptions {\n /** Initial focus state. Default `false` — handles hidden until first click. */\n initial?: boolean;\n /** `tabIndex` to set on the focusable element. Default `0` (focusable in\n * document tab order). Set to `-1` for programmatic-only focus. */\n tabIndex?: number;\n}\n\n/** What `useCanvasFocus` hands back: the focus state, the props that\n * maintain it, and a getter for reading it from per-frame code. */\nexport interface CanvasFocusReturn {\n /** Live boolean — true when the element has DOM focus. Triggers re-renders\n * when the focus state changes (set via React state). */\n focused: boolean;\n /** Spread onto the focusable element (e.g. the canvas). Includes\n * `tabIndex`, `onFocus`, `onBlur`. */\n focusProps: {\n tabIndex: number;\n onFocus: () => void;\n onBlur: () => void;\n };\n /** Stable getter for the live focused state. Use inside per-frame closures\n * like `RenderLayer.draw`, where the layer is constructed once and\n * reading `focused` directly would capture the value at construction\n * time. The getter always returns the current value. */\n getFocused: () => boolean;\n /** Imperative focus / blur. Useful for tests and programmatic control. */\n setFocused: (next: boolean) => void;\n}\n\n/** Track DOM focus on the canvas, so chrome that should only show while the\n * canvas is focused can be gated on it. */\nexport function useCanvasFocus(options: UseCanvasFocusOptions = {}): CanvasFocusReturn {\n const { initial = false, tabIndex = 0 } = options;\n const [focused, setFocusedState] = useState<boolean>(initial);\n // Every state change goes through a handler below that writes this first.\n const focusedRef = useRef<boolean>(initial);\n\n const onFocus = useCallback(() => {\n if (!focusedRef.current) {\n focusedRef.current = true;\n setFocusedState(true);\n }\n }, []);\n const onBlur = useCallback(() => {\n if (focusedRef.current) {\n focusedRef.current = false;\n setFocusedState(false);\n }\n }, []);\n const getFocused = useCallback(() => focusedRef.current, []);\n const setFocused = useCallback((next: boolean) => {\n if (focusedRef.current === next) return;\n focusedRef.current = next;\n setFocusedState(next);\n }, []);\n\n // Stable until tabIndex changes, so it can be spread onto memoized elements\n // without retriggering downstream effects.\n const focusProps = useMemo(() => ({ tabIndex, onFocus, onBlur }), [tabIndex, onFocus, onBlur]);\n\n return {\n focused,\n focusProps,\n getFocused,\n setFocused,\n };\n}\n"],"mappings":";;AA4CA,SAAgBA,EAAe,IAAiC,CAAC,GAAsB;CACrF,IAAM,EAAE,aAAU,IAAO,cAAW,MAAMC,GACpC,CAACC,GAASC,KAAmBC,EAAkBC,CAAO,GAEtDC,IAAaC,EAAgBF,CAAO,GAEpCG,IAAUC,QAAkB;EAChC,AAAKH,EAAW,YACd,EAAW,UAAU,IACrBH,EAAgB,EAAI;CAExB,GAAG,CAAC,CAAC,GACCO,IAASD,QAAkB;EAC/B,AAAIH,EAAW,YACb,EAAW,UAAU,IACrBH,EAAgB,EAAK;CAEzB,GAAG,CAAC,CAAC,GACCQ,IAAaF,QAAkBH,EAAW,SAAS,CAAC,CAAC,GACrDM,IAAaH,GAAa,MAAkB;EAChD,AAAIH,EAAW,YAAYO,MAC3B,EAAW,UAAUA,GACrBV,EAAgBU,CAAI;CACtB,GAAG,CAAC,CAAC;CAML,OAAO;EACL;EACA,YAJiBC,SAAe;GAAE;GAAU;GAAS;EAAO,IAAI;GAACC;GAAUP;GAASE;EAAM,CAI1F;EACA;EACA;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"children.js","names":["createChildrenLayer","opts","getChildren","ids","out","id","sub","data","view","cmd"],"sources":["../../../src/features/groups/children.ts"],"sourcesContent":["/**\n * Z-ordered child renderer — replaces the manual `for (id of getChildren()) ...`\n * pattern with a `RenderLayer` factory that consumes an `OrderedAdapter`.\n *\n * Children are drawn in z-order (forward iteration: index 0 = bottom). The\n * caller supplies a `drawChild` callback that emits `DrawCommand[]` for one\n * object; this layer is the boilerplate-free way to plug a scene graph's\n * z-order into the layer composition system.\n *\n * If the adapter doesn't implement `getChildren` (it's optional on\n * `OrderedAdapter`), the layer is a silent no-op — adopt z-order incrementally\n * without breaking existing layers.\n */\n\nimport type { DrawCommand } from '../../renderer';\nimport type { RenderLayer } from 'core/layers/render';\nimport type { View } from 'core/viewport/view';\nimport type { OrderedAdapter } from 'core/adapters/types';\n\n/** Options for `createChildrenLayer`. */\nexport interface CreateChildrenLayerOpts<TData> {\n /** Layer id for the visibility/order map. Default `'children'`. */\n id?: string;\n /** Human-readable label. Default `'Children'`. */\n label?: string;\n /** Source of `getChildren`. Only the read side is used. */\n adapter: Pick<OrderedAdapter, 'getChildren'>;\n /** Parent id (null = root). Function form lets the layer follow a moving\n * selection or focus. Default `null`. */\n parentId?: string | null | (() => string | null);\n /** Draw one child. Called once per id in z-order (bottom → top). The\n * per-child outputs are concatenated into the layer's `DrawCommand[]`. */\n drawChild(id: string, data: TData, view: View): DrawCommand[];\n /** Forwarded to the produced `RenderLayer`. */\n defaultVisible?: boolean;\n /** Forwarded to the produced `RenderLayer`. */\n alwaysOn?: boolean;\n}\n\n/** Build a `RenderLayer` that draws an `OrderedAdapter`'s children in z-order. */\nexport function createChildrenLayer<TData = unknown>(\n opts: CreateChildrenLayerOpts<TData>,\n): RenderLayer<TData> {\n return {\n id: opts.id ?? 'children',\n label: opts.label ?? 'Children',\n defaultVisible: opts.defaultVisible,\n alwaysOn: opts.alwaysOn,\n draw: (data, view) => {\n const getChildren = opts.adapter.getChildren;\n if (!getChildren) return [];\n const parent =\n typeof opts.parentId === 'function'\n ? opts.parentId()\n : opts.parentId ?? null;\n const ids = getChildren(parent);\n const out: DrawCommand[] = [];\n for (const id of ids) {\n const sub = opts.drawChild(id, data, view);\n for (const cmd of sub) out.push(cmd);\n }\n return out;\n },\n };\n}\n"],"mappings":";AAwCA,SAAgBA,EACd,GACoB;CACpB,OAAO;EACL,IAAIC,EAAK,MAAM;EACf,OAAOA,EAAK,SAAS;EACrB,gBAAgBA,EAAK;EACrB,UAAUA,EAAK;EACf,OAAO,GAAM,MAAS;GACpB,IAAMC,IAAcD,EAAK,QAAQ;GACjC,IAAI,CAACC,GAAa,OAAO,CAAC;GAK1B,IAAMC,IAAMD,EAHV,OAAOD,EAAK,YAAa,aACrBA,EAAK,SAAS,IACdA,EAAK,YAAY,IACO,GACxBG,IAAqB,CAAC;GAC5B,KAAK,IAAMC,KAAMF,GAAK;IACpB,IAAMG,IAAML,EAAK,UAAUI,GAAIE,GAAMC,CAAI;IACzC,KAAK,IAAMC,KAAOH,GAAK,EAAI,KAAKG,CAAG;GACrC;GACA,OAAOL;EACT;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composePose.js","names":["composeRectPose","child","parent","translateRectPose","pose","dx","dy","decomposeRectPose","world","turn","c","r","s","cx","x","y","cy","composeRigidPose","pr","wcx","wcy","decomposeRigidPose","ux","uy","RECT_POSE_COMPOSITION","RIGID_POSE_COMPOSITION","worldPoseLookup","composeWorldPose","adapter","id","compose","IDENTITY_POSE_COMPOSITION","frameAtOrAbove","rebaseLocalPose"],"sources":["../../../src/features/groups/composePose.ts"],"sourcesContent":["/**\n * Pose composition for hierarchical scene graphs.\n *\n * As of the nesting change, `getPose(id)` on adapters returns the\n * **local** pose — relative to the object's direct parent. Anything in the\n * kit that needs to draw, hit-test, snap, or otherwise reason about world\n * coordinates routes through `composeWorldPose`, which walks the parent\n * chain and folds local poses together via a consumer-supplied `compose`.\n *\n * Pose shape is generic, so the compose strategy is too. For the common\n * `{x, y, width, height}` axis-aligned rect, use `composeRectPose` —\n * translation only, child dimensions preserved. Custom pose shapes (paths,\n * matrix transforms) supply their own.\n *\n * The inverse — `rebaseLocalPose` — converts a world-space pose into a\n * local pose under a target parent. Used when reparenting so the visual\n * world position of a child is preserved across the parent change.\n */\n\n/** Re-exported; the declaration lives in `core/scene/types.ts`, which names\n * it and may not import from features. */\nimport type { RectPose } from 'core/scene/types';\nexport type { RectPose };\n\n/** Re-exported from `core/scene/composeFrame.ts`, for the same reason. */\nimport {\n IDENTITY_POSE_COMPOSITION,\n composeWorldPose,\n frameAtOrAbove,\n rebaseLocalPose,\n type PoseAdapter,\n type PoseClosure,\n type PoseComposition,\n} from 'core/scene/composeFrame';\nexport { IDENTITY_POSE_COMPOSITION, composeWorldPose, frameAtOrAbove, rebaseLocalPose };\nexport type { PoseAdapter, PoseClosure, PoseComposition };\n\n/**\n * Default `compose` for axis-aligned rectangles. Adds translation; preserves\n * child width/height. Treat as the canonical compose for any\n * `{x, y, width, height}` pose under a translation-only hierarchy.\n *\n * Generic over the concrete pose type so callers with a wider pose\n * (e.g. `RectPose & { rotation }`) can pass it through; the extra fields\n * are taken from the child unchanged.\n */\nexport function composeRectPose<TPose extends RectPose>(parent: TPose, child: TPose): TPose {\n return {\n ...child,\n x: parent.x + child.x,\n y: parent.y + child.y,\n };\n}\n\n/**\n * Translate a `RectPose`-shaped pose by `(dx, dy)`. Suitable as the default\n * `translatePose` for `useMove` when poses carry top-level `x`/`y`. Other\n * fields (width/height, plus any extra props on `TPose`) are preserved.\n */\nexport function translateRectPose<TPose extends RectPose>(pose: TPose, dx: number, dy: number): TPose {\n return { ...pose, x: pose.x + dx, y: pose.y + dy };\n}\n\n/** Inverse of `composeRectPose` — subtracts parent translation. */\nexport function decomposeRectPose<TPose extends RectPose>(parent: TPose, world: TPose): TPose {\n return {\n ...world,\n x: world.x - parent.x,\n y: world.y - parent.y,\n };\n}\n\n/** Turn `(x, y)` about `(cx, cy)` by `r` radians. */\nfunction turn(cx: number, cy: number, r: number, x: number, y: number): [number, number] {\n const c = Math.cos(r);\n const s = Math.sin(r);\n return [cx + (x - cx) * c - (y - cy) * s, cy + (x - cx) * s + (y - cy) * c];\n}\n\n/**\n * `compose` for a container whose pose defines a **frame**: the child's local\n * pose is offset into the parent's unrotated box, then the whole thing is\n * turned about the parent's center. Rotations add; the child keeps its size.\n *\n * Reduces to `composeRectPose` when the parent is upright, so a scene that\n * never rotates a container behaves identically under either strategy.\n *\n * Exact for translation and rotation. A parent carrying scale is outside what\n * this can express — see `PoseClosure`.\n */\nexport function composeRigidPose<TPose extends RectPose>(parent: TPose, child: TPose): TPose {\n const pr = parent.rotation ?? 0;\n const [wcx, wcy] = turn(\n parent.x + parent.width / 2,\n parent.y + parent.height / 2,\n pr,\n parent.x + child.x + child.width / 2,\n parent.y + child.y + child.height / 2,\n );\n return {\n ...child,\n x: wcx - child.width / 2,\n y: wcy - child.height / 2,\n rotation: (child.rotation ?? 0) + pr,\n };\n}\n\n/** Inverse of `composeRigidPose` — un-turns about the parent's center, then\n * subtracts the parent's offset. */\nexport function decomposeRigidPose<TPose extends RectPose>(parent: TPose, world: TPose): TPose {\n const pr = parent.rotation ?? 0;\n const [ux, uy] = turn(\n parent.x + parent.width / 2,\n parent.y + parent.height / 2,\n -pr,\n world.x + world.width / 2,\n world.y + world.height / 2,\n );\n return {\n ...world,\n x: ux - parent.x - world.width / 2,\n y: uy - parent.y - world.height / 2,\n rotation: (world.rotation ?? 0) - pr,\n };\n}\n\n/** Translation-only composition over `RectPose`. What a scene wants when a\n * container groups its children but never turns them. */\nexport const RECT_POSE_COMPOSITION: PoseComposition<RectPose> = {\n compose: composeRectPose,\n decompose: decomposeRectPose,\n closure: 'translation',\n};\n\n/** Composition over `RectPose` where a container's pose is a frame: rotating\n * the container rotates its contents. */\nexport const RIGID_POSE_COMPOSITION: PoseComposition<RectPose> = {\n compose: composeRigidPose,\n decompose: decomposeRigidPose,\n closure: 'rigid',\n};\n\n/**\n * Build a `(id) => world pose | null` callback over a `PoseAdapter`.\n * Convenience for RenderLayers that take a `getPose` callback (selection\n * overlays, debug layers, etc.) so consumers don't hand-write a\n * `composeWorldPose` call per layer.\n *\n * Returns `null` when `adapter.getPose` or `adapter.getParent` throws — the\n * common case is an id removed mid-render between selection state and the\n * next paint. Layers should treat `null` as \"skip this id.\"\n */\nexport function worldPoseLookup<TPose>(\n adapter: PoseAdapter<TPose>,\n compose: (parent: TPose, child: TPose) => TPose,\n): (id: string) => TPose | null {\n return (id: string) => {\n try {\n return composeWorldPose(adapter, id, compose);\n } catch {\n return null;\n }\n };\n}\n"],"mappings":";;AA8CA,SAAgBA,EAAwC,GAAe,GAAqB;CAC1F,OAAO;EACL,GAAGC;EACH,GAAGC,EAAO,IAAID,EAAM;EACpB,GAAGC,EAAO,IAAID,EAAM;CACtB;AACF;AAOA,SAAgBE,EAA0C,GAAa,GAAY,GAAmB;CACpG,OAAO;EAAE,GAAGC;EAAM,GAAGA,EAAK,IAAIC;EAAI,GAAGD,EAAK,IAAIE;CAAG;AACnD;AAGA,SAAgBC,EAA0C,GAAe,GAAqB;CAC5F,OAAO;EACL,GAAGC;EACH,GAAGA,EAAM,IAAIN,EAAO;EACpB,GAAGM,EAAM,IAAIN,EAAO;CACtB;AACF;AAGA,SAASO,EAAK,GAAY,GAAY,GAAW,GAAW,GAA6B;CACvF,IAAMC,IAAI,KAAK,IAAIC,CAAC,GACdC,IAAI,KAAK,IAAID,CAAC;CACpB,OAAO,CAACE,KAAMC,IAAID,KAAMH,KAAKK,IAAIC,KAAMJ,GAAGI,KAAMF,IAAID,KAAMD,KAAKG,IAAIC,KAAMN,CAAC;AAC5E;AAaA,SAAgBO,EAAyC,GAAe,GAAqB;CAC3F,IAAMC,IAAKhB,EAAO,YAAY,GACxB,CAACiB,GAAKC,KAAOX,EACjBP,EAAO,IAAIA,EAAO,QAAQ,GAC1BA,EAAO,IAAIA,EAAO,SAAS,GAC3BgB,GACAhB,EAAO,IAAID,EAAM,IAAIA,EAAM,QAAQ,GACnCC,EAAO,IAAID,EAAM,IAAIA,EAAM,SAAS,CACtC;CACA,OAAO;EACL,GAAGA;EACH,GAAGkB,IAAMlB,EAAM,QAAQ;EACvB,GAAGmB,IAAMnB,EAAM,SAAS;EACxB,WAAWA,EAAM,YAAY,KAAKiB;CACpC;AACF;AAIA,SAAgBG,EAA2C,GAAe,GAAqB;CAC7F,IAAMH,IAAKhB,EAAO,YAAY,GACxB,CAACoB,GAAIC,KAAMd,EACfP,EAAO,IAAIA,EAAO,QAAQ,GAC1BA,EAAO,IAAIA,EAAO,SAAS,GAC3B,CAACgB,GACDV,EAAM,IAAIA,EAAM,QAAQ,GACxBA,EAAM,IAAIA,EAAM,SAAS,CAC3B;CACA,OAAO;EACL,GAAGA;EACH,GAAGc,IAAKpB,EAAO,IAAIM,EAAM,QAAQ;EACjC,GAAGe,IAAKrB,EAAO,IAAIM,EAAM,SAAS;EAClC,WAAWA,EAAM,YAAY,KAAKU;CACpC;AACF;AAIA,IAAaM,IAAmD;CAC9D,SAASxB;CACT,WAAWO;CACX,SAAS;AACX,GAIakB,IAAoD;CAC/D,SAASR;CACT,WAAWI;CACX,SAAS;AACX;AAYA,SAAgBK,EACd,GACA,GAC8B;CAC9B,QAAQ,MAAe;EACrB,IAAI;GACF,OAAOC,EAAiBC,GAASC,GAAIC,CAAO;EAC9C,QAAQ;GACN,OAAO;EACT;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nestedHit.js","names":["nestedHitTester","d","opts","AUTO_POSE_DESCRIPTOR","isGroup","worldOf","worldPoseLookup","adapter","ancestorChain","chain","cur","id","hitLeaf","objs","i","o","w","b","poseDescriptorForNode","wx","wy","leaf","alt","selection"],"sources":["../../../src/features/groups/nestedHit.ts"],"sourcesContent":["import { worldPoseLookup } from './composePose';\nimport { poseDescriptorForNode, type PoseDescriptor } from 'core/geometry/poseDescriptor';\nimport { AUTO_POSE_DESCRIPTOR } from 'interactions/actions/resize/autoPoseDescriptor';\n\n/** @internal */\ninterface HitAdapter<TNode extends { id: string }, TPose> {\n getNode: (id: string) => TNode | undefined;\n getNodes: () => TNode[];\n getPose: (id: string) => TPose;\n getParent: (id: string) => string | null;\n}\n\n/** Options for `nestedHitTester`. */\nexport interface NestedHitOpts<TNode extends { id: string }, TPose> {\n /** Compose a child's local pose into world coords given its parent's world\n * pose. Same shape as `composeRectPose` (the default expectation). */\n composePose: (parent: TPose, child: TPose) => TPose;\n /** How to read world poses. Default `AUTO_POSE_DESCRIPTOR`. */\n poseDescriptor?: PoseDescriptor<TPose>;\n /** Predicate for \"this object is a nesting parent body\". The leaf scan\n * skips objects for which this returns true so a click on a parent's\n * painted body resolves to a child leaf, not the parent itself. Default:\n * never (treat every object as hittable). */\n isGroup?: (id: string, obj: TNode | undefined) => boolean;\n}\n\n/** Hit-test entry points for a nested scene: one that always picks the\n * outermost ancestor, and one that steps deeper on alt-click. */\nexport interface NestedHitTester {\n /** Outermost-ancestor pick. Suitable as the chrome-level `pickEvery`: a\n * casual click selects the whole top-level ancestor. Returns `null` on\n * empty space. */\n pickOutermost: (worldX: number, worldY: number) => string | null;\n /** Alt-aware selection-update pick. Without `alt`, returns the outermost\n * ancestor (same as `pickOutermost`). With `alt`, returns one level\n * deeper than the deepest currently-selected ancestor in the leaf's\n * chain — repeated alt-clicks step ancestor → descendant → leaf. With\n * `alt` and nothing in the chain selected, jumps straight to the leaf.\n * Plug into `useSelectTool({ pickBest })`. */\n pickBest: (\n worldX: number,\n worldY: number,\n alt: boolean,\n selection: readonly string[],\n ) => string | null;\n}\n\n/** Build hit-testers that respect containers: a plain click selects the\n * top-level ancestor, and alt-clicking descends one level at a time toward\n * the leaf actually under the pointer. */\nexport function nestedHitTester<TNode extends { id: string }, TPose>(\n adapter: HitAdapter<TNode, TPose>,\n opts: NestedHitOpts<TNode, TPose>,\n): NestedHitTester {\n const d = (opts.poseDescriptor ?? AUTO_POSE_DESCRIPTOR) as PoseDescriptor<TPose>;\n const isGroup = opts.isGroup ?? (() => false);\n const worldOf = worldPoseLookup(adapter, opts.composePose);\n\n const ancestorChain = (id: string): string[] => {\n const chain: string[] = [];\n let cur: string | null = id;\n while (cur !== null) {\n chain.unshift(cur);\n cur = adapter.getParent(cur);\n }\n return chain;\n };\n\n const hitLeaf = (wx: number, wy: number): string | null => {\n const objs = adapter.getNodes();\n for (let i = objs.length - 1; i >= 0; i--) {\n const o = objs[i];\n if (isGroup(o.id, o)) continue;\n const w = worldOf(o.id);\n if (!w) continue;\n const b = poseDescriptorForNode(d, o).getBounds(w);\n if (wx >= b.x && wx <= b.x + b.width && wy >= b.y && wy <= b.y + b.height) {\n return o.id;\n }\n }\n return null;\n };\n\n const pickOutermost = (wx: number, wy: number): string | null => {\n const leaf = hitLeaf(wx, wy);\n return leaf === null ? null : ancestorChain(leaf)[0];\n };\n\n const pickBest = (\n wx: number,\n wy: number,\n alt: boolean,\n selection: readonly string[],\n ): string | null => {\n const leaf = hitLeaf(wx, wy);\n if (leaf === null) return null;\n const chain = ancestorChain(leaf);\n if (!alt) return chain[0];\n for (let i = chain.length - 1; i >= 0; i--) {\n if (selection.includes(chain[i])) {\n return chain[Math.min(i + 1, chain.length - 1)];\n }\n }\n return chain[chain.length - 1];\n };\n\n return { pickOutermost, pickBest };\n}\n"],"mappings":";;;;AAkDA,SAAgBA,EACd,GACA,GACiB;CACjB,IAAMC,IAAKC,EAAK,kBAAkBC,GAC5BC,IAAUF,EAAK,kBAAkB,KACjCG,IAAUC,EAAgBC,GAASL,EAAK,WAAW,GAEnDM,KAAiB,MAAyB;EAC9C,IAAMC,IAAkB,CAAC,GACrBC,IAAqBC;EACzB,OAAOD,MAAQ,OAEb,AADAD,EAAM,QAAQC,CAAG,GACjB,IAAMH,EAAQ,UAAUG,CAAG;EAE7B,OAAOD;CACT,GAEMG,KAAW,GAAY,MAA8B;EACzD,IAAMC,IAAON,EAAQ,SAAS;EAC9B,KAAK,IAAIO,IAAID,EAAK,SAAS,GAAGC,KAAK,GAAG,KAAK;GACzC,IAAMC,IAAIF,EAAKC;GACf,IAAIV,EAAQW,EAAE,IAAIA,CAAC,GAAG;GACtB,IAAMC,IAAIX,EAAQU,EAAE,EAAE;GACtB,IAAI,CAACC,GAAG;GACR,IAAMC,IAAIC,EAAsBjB,GAAGc,CAAC,CAAC,CAAC,UAAUC,CAAC;GACjD,IAAIG,KAAMF,EAAE,KAAKE,KAAMF,EAAE,IAAIA,EAAE,SAASG,KAAMH,EAAE,KAAKG,KAAMH,EAAE,IAAIA,EAAE,QACjE,OAAOF,EAAE;EAEb;EACA,OAAO;CACT;CAyBA,OAAO;EAAE,gBAvBc,GAAY,MAA8B;GAC/D,IAAMM,IAAOT,EAAQO,GAAIC,CAAE;GAC3B,OAAOC,MAAS,OAAO,OAAOb,EAAca,CAAI,CAAC,CAAC;EACpD;EAoBwB,WAjBtB,GACA,GACA,GACA,MACkB;GAClB,IAAMA,IAAOT,EAAQO,GAAIC,CAAE;GAC3B,IAAIC,MAAS,MAAM,OAAO;GAC1B,IAAMZ,IAAQD,EAAca,CAAI;GAChC,IAAI,CAACC,GAAK,OAAOb,EAAM;GACvB,KAAK,IAAIK,IAAIL,EAAM,SAAS,GAAGK,KAAK,GAAG,KACrC,IAAIS,EAAU,SAASd,EAAMK,EAAE,GAC7B,OAAOL,EAAM,KAAK,IAAIK,IAAI,GAAGL,EAAM,SAAS,CAAC;GAGjD,OAAOA,EAAMA,EAAM,SAAS;EAC9B;CAEiC;AACnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unionOfChildren.js","names":["unionOfChildrenVia","boxes","d","deps","visualBoundsViaDescriptor","poseDescriptorForNode","descriptor","u","unionAABB","node"],"sources":["../../../src/features/groups/unionOfChildren.ts"],"sourcesContent":["import { unionAABB } from 'core/geometry/unionBounds';\nimport {\n poseDescriptorForNode,\n visualBoundsViaDescriptor,\n type PoseDescriptor,\n} from 'interactions/actions/resize/geometry';\nimport type { DerivePoseFn } from 'core/scene/types';\n\n/**\n * A container's pose as the envelope of what it holds, read through\n * `descriptor` — a rotated member contributes the extent of its ink. Register\n * the result under `UNION_OF_CHILDREN` in `createScene`'s `registry` to teach\n * a scene how to size its groups around a pose shape the kit cannot read.\n *\n * Returns `null` for an emptied container, which falls back to its authored\n * pose rather than collapsing to a zero box at the origin.\n */\nexport function unionOfChildrenVia<TPose>(\n descriptor: PoseDescriptor<TPose>,\n): DerivePoseFn<TPose> {\n return (node, deps) => {\n const boxes = [];\n for (const d of deps) {\n if (d !== undefined) {\n boxes.push(visualBoundsViaDescriptor(d.pose, poseDescriptorForNode(descriptor, d)));\n }\n }\n const u = unionAABB(boxes);\n return u === null\n ? null\n : poseDescriptorForNode(descriptor, node).fromBounds(u, node.pose);\n };\n}\n"],"mappings":";;;AAiBA,SAAgBA,EACd,GACqB;CACrB,QAAQ,GAAM,MAAS;EACrB,IAAMC,IAAQ,CAAC;EACf,KAAK,IAAMC,KAAKC,GACd,AAAID,MAAM,KAAA,KACRD,EAAM,KAAKG,EAA0BF,EAAE,MAAMG,EAAsBC,GAAYJ,CAAC,CAAC,CAAC;EAGtF,IAAMK,IAAIC,EAAUP,CAAK;EACzB,OAAOM,MAAM,OACT,OACAF,EAAsBC,GAAYG,CAAI,CAAC,CAAC,WAAWF,GAAGE,EAAK,IAAI;CACrE;AACF"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { maxImageTextureSide as e, releaseImageSource as t } from "../../renderer/cache/GLImageCache.js";
|
|
2
|
-
//#region src/features/images/imageCache.ts
|
|
3
|
-
var n = 16777216, r = 4, i = 300, a = 150, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
4
|
-
function l(e) {
|
|
5
|
-
return /^data:image\/svg\+xml[;,]/i.test(e) ? !0 : !/^(data|blob):/i.test(e) && /\.svgz?$/i.test(e.replace(/[?#].*$/, ""));
|
|
6
|
-
}
|
|
7
|
-
function u() {
|
|
8
|
-
if (typeof Image > "u" || typeof createImageBitmap > "u") throw Error("weasel imageCache: no DOM image loader in this environment");
|
|
9
|
-
}
|
|
10
|
-
async function d(e) {
|
|
11
|
-
let t = new Image();
|
|
12
|
-
return t.crossOrigin = "anonymous", t.src = e, await t.decode(), t;
|
|
13
|
-
}
|
|
14
|
-
function f(e) {
|
|
15
|
-
let t = c.get(e);
|
|
16
|
-
return t || (t = d(e), c.set(e, t), t.catch(() => c.delete(e))), t;
|
|
17
|
-
}
|
|
18
|
-
async function p(e, t) {
|
|
19
|
-
let n = await f(e), r = t?.width ?? (n.naturalWidth || i), o = t?.height ?? (n.naturalHeight || a), s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(r, o) : Object.assign(document.createElement("canvas"), {
|
|
20
|
-
width: r,
|
|
21
|
-
height: o
|
|
22
|
-
}), c = s.getContext("2d");
|
|
23
|
-
if (!c) throw Error("weasel imageCache: no 2D context to rasterize an SVG");
|
|
24
|
-
return c.drawImage(n, 0, 0, r, o), createImageBitmap(s);
|
|
25
|
-
}
|
|
26
|
-
var m = async (e, t) => (u(), l(e) ? p(e, t) : createImageBitmap(await d(e)));
|
|
27
|
-
function h() {
|
|
28
|
-
for (let e of s) e();
|
|
29
|
-
}
|
|
30
|
-
function g(e) {
|
|
31
|
-
let t = { status: "loading" };
|
|
32
|
-
o.set(e, t), m(e).then((n) => {
|
|
33
|
-
o.get(e) === t && (o.set(e, {
|
|
34
|
-
status: "ready",
|
|
35
|
-
bitmap: n,
|
|
36
|
-
...l(e) ? { vector: {
|
|
37
|
-
natural: {
|
|
38
|
-
width: n.width,
|
|
39
|
-
height: n.height
|
|
40
|
-
},
|
|
41
|
-
scale: 1,
|
|
42
|
-
failed: /* @__PURE__ */ new Set()
|
|
43
|
-
} } : {}
|
|
44
|
-
}), h());
|
|
45
|
-
}, () => {
|
|
46
|
-
o.get(e) === t && (o.set(e, { status: "error" }), h());
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function _(t, r) {
|
|
50
|
-
let i = Math.max(r.width / t.width, r.height / t.height);
|
|
51
|
-
if (!(i > 0) || !Number.isFinite(i)) return;
|
|
52
|
-
let a = e(), o = Math.min(a / t.width, a / t.height, Math.sqrt(n / (t.width * t.height)));
|
|
53
|
-
return Math.min(2 ** Math.ceil(Math.log2(i)), o);
|
|
54
|
-
}
|
|
55
|
-
function v(e, n, i, a) {
|
|
56
|
-
if (i.pending !== void 0) return;
|
|
57
|
-
let s = _(i.natural, a);
|
|
58
|
-
if (s === void 0) return;
|
|
59
|
-
let c = s > i.scale;
|
|
60
|
-
if (!(!c && s * r > i.scale)) {
|
|
61
|
-
for (let e of i.failed) if (s === e || c && e > i.scale && s >= e) return;
|
|
62
|
-
i.pending = s, m(e, {
|
|
63
|
-
width: Math.max(1, Math.round(i.natural.width * s)),
|
|
64
|
-
height: Math.max(1, Math.round(i.natural.height * s))
|
|
65
|
-
}).then((r) => {
|
|
66
|
-
if (o.get(e) !== n) return;
|
|
67
|
-
i.pending = void 0;
|
|
68
|
-
let a = n.bitmap;
|
|
69
|
-
n.bitmap = r, i.scale = s, a && a !== r && t(a), h();
|
|
70
|
-
}, () => {
|
|
71
|
-
o.get(e) === n && (i.pending = void 0, i.failed.add(s));
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function y(e, t) {
|
|
76
|
-
let n = o.get(e);
|
|
77
|
-
if (!n) {
|
|
78
|
-
g(e);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
return t && n.vector && v(e, n, n.vector, t), n.bitmap;
|
|
82
|
-
}
|
|
83
|
-
function b(e) {
|
|
84
|
-
return o.get(e)?.status ?? "idle";
|
|
85
|
-
}
|
|
86
|
-
function x(e) {
|
|
87
|
-
return s.add(e), () => {
|
|
88
|
-
s.delete(e);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
export { y as getImageBitmap, b as imageStatus, l as isVectorImageSrc, x as subscribeImageReady };
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=imageCache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageCache.js","names":["MAX_VECTOR_RASTER_PIXELS","SHRINK_SLACK","FALLBACK_WIDTH","FALLBACK_HEIGHT","cache","subscribers","decodedVectors","isVectorImageSrc","src","requireDom","decodeImage","img","decodeVector","decoded","rasterizeVector","width","size","height","canvas","c2d","loader","notify","cb","startLoad","entry","bitmap","rasterScaleFor","need","drawnAt","natural","side","maxImageTextureSide","cap","maybeReraster","v","target","grow","f","old","releaseImageSource","getImageBitmap","imageStatus","subscribeImageReady"],"sources":["../../../src/features/images/imageCache.ts"],"sourcesContent":["/**\n * imageCache — the kit's per-`src` image loader + cache.\n *\n * The shape-painter chain (`kit:image` in `NodeShape.ts`) is synchronous, but\n * decoding an image is async. This module bridges the two: `getImageBitmap` is\n * a synchronous read that returns the decoded `ImageBitmap` when ready, and\n * otherwise returns `undefined` and lazily kicks off a de-duped async load.\n * When a load resolves (or errors), every `subscribeImageReady` listener fires\n * — `<SceneCanvas>` subscribes and calls `requestRedraw()`, so the painter\n * re-runs and emits the now-ready bitmap.\n *\n * `src` is any browser-loadable image string: a remote URL, a `blob:` URL, or\n * a `data:image/…;base64,…` URI (the embedded-bytes path). The decoded bitmap\n * lives only here, keyed by `src` — never in node `data` — so `scene.toJSON()`\n * round-trips the (serializable) `src` string untouched.\n */\n\nimport { maxImageTextureSide, releaseImageSource } from 'renderer/cache/GLImageCache';\n\n/** Public shape of an image node's `data`. `src` round-trips through\n * serialization; the decoded bitmap is held in this cache, not on the node. */\nexport interface ImageNodeData {\n image: {\n src: string;\n opacity?: number;\n /** The part of the bitmap drawn into the pose rect, as fractions of the\n * bitmap's width and height from its top-left. Omitted draws the whole\n * bitmap. Fractions, so the data means the same thing before the bitmap\n * has decoded and after `src` is swapped for another resolution. */\n source?: { x: number; y: number; width: number; height: number };\n /** Mirror the drawn region within the pose rect. The rect does not move. */\n flipX?: boolean;\n flipY?: boolean;\n };\n}\n\n/** Where an image is in its load: never requested, in flight, decoded, or\n * failed. Renderers paint a placeholder for anything but `'ready'`. */\nexport type ImageStatus = 'idle' | 'loading' | 'ready' | 'error';\n\n/** A size in device pixels. */\nexport interface ImageRasterSize {\n width: number;\n height: number;\n}\n\n/** A vector source's raster bookkeeping. `scale` is the current raster's size\n * over the natural one, always a power of two unless a cap cut it short. */\ninterface VectorRaster {\n natural: ImageRasterSize;\n scale: number;\n pending?: number;\n failed: Set<number>;\n}\n\ninterface Entry {\n status: ImageStatus;\n bitmap?: ImageBitmap;\n vector?: VectorRaster;\n}\n\n/** `size` is absent for the first load, which decodes at natural size. */\ntype Loader = (src: string, size?: ImageRasterSize) => Promise<ImageBitmap>;\n\n/** One vector raster may hold at most 64MB of RGBA. */\nconst MAX_VECTOR_RASTER_PIXELS = 4096 * 4096;\n/** A raster is only shrunk once it is this many times larger than needed, so\n * zooming back and forth across a bucket edge does not re-raster each way. */\nconst SHRINK_SLACK = 4;\n// CSS default object size, as `kit:svg` measures a viewBox-only SVG.\nconst FALLBACK_WIDTH = 300;\nconst FALLBACK_HEIGHT = 150;\n\nconst cache = new Map<string, Entry>();\nconst subscribers = new Set<() => void>();\nconst decodedVectors = new Map<string, Promise<HTMLImageElement>>();\n\n/** True when `src` names SVG — a `data:image/svg+xml` URI, or a URL whose path\n * ends in `.svg`/`.svgz`. Such sources re-rasterize at the size they are drawn\n * at; everything else decodes once. A `blob:` URL carries no type and counts\n * as raster. */\nexport function isVectorImageSrc(src: string): boolean {\n if (/^data:image\\/svg\\+xml[;,]/i.test(src)) return true;\n if (/^(data|blob):/i.test(src)) return false;\n return /\\.svgz?$/i.test(src.replace(/[?#].*$/, ''));\n}\n\nfunction requireDom(): void {\n if (typeof Image === 'undefined' || typeof createImageBitmap === 'undefined') {\n throw new Error('weasel imageCache: no DOM image loader in this environment');\n }\n}\n\nasync function decodeImage(src: string): Promise<HTMLImageElement> {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.src = src;\n await img.decode();\n return img;\n}\n\nfunction decodeVector(src: string): Promise<HTMLImageElement> {\n let decoded = decodedVectors.get(src);\n if (!decoded) {\n decoded = decodeImage(src);\n decodedVectors.set(src, decoded);\n decoded.catch(() => decodedVectors.delete(src));\n }\n return decoded;\n}\n\n// `createImageBitmap` rejects SVG blobs and resamples an SVG `<img>` rather\n// than re-drawing it, so vectors go through a canvas `drawImage` at full size.\nasync function rasterizeVector(src: string, size?: ImageRasterSize): Promise<ImageBitmap> {\n const img = await decodeVector(src);\n const width = size?.width ?? (img.naturalWidth || FALLBACK_WIDTH);\n const height = size?.height ?? (img.naturalHeight || FALLBACK_HEIGHT);\n const canvas: OffscreenCanvas | HTMLCanvasElement = typeof OffscreenCanvas !== 'undefined'\n ? new OffscreenCanvas(width, height)\n : Object.assign(document.createElement('canvas'), { width, height });\n const c2d = canvas.getContext('2d') as CanvasDrawImage | null;\n if (!c2d) throw new Error('weasel imageCache: no 2D context to rasterize an SVG');\n c2d.drawImage(img, 0, 0, width, height);\n return createImageBitmap(canvas);\n}\n\nconst defaultLoader: Loader = async (src, size) => {\n requireDom();\n if (isVectorImageSrc(src)) return rasterizeVector(src, size);\n return createImageBitmap(await decodeImage(src));\n};\n\nlet loader: Loader = defaultLoader;\n\nfunction notify(): void {\n for (const cb of subscribers) cb();\n}\n\nfunction startLoad(src: string): void {\n const entry: Entry = { status: 'loading' };\n cache.set(src, entry);\n loader(src).then(\n (bitmap) => {\n // The entry may have been replaced/cleared mid-flight (reset, etc.);\n // only commit if this src is still the one we started loading.\n if (cache.get(src) !== entry) return;\n cache.set(src, {\n status: 'ready',\n bitmap,\n ...(isVectorImageSrc(src)\n ? { vector: { natural: { width: bitmap.width, height: bitmap.height }, scale: 1, failed: new Set<number>() } }\n : {}),\n });\n notify();\n },\n () => {\n // Cache the error so a broken `src` doesn't reload-storm.\n if (cache.get(src) !== entry) return;\n cache.set(src, { status: 'error' });\n notify();\n },\n );\n}\n\n/** The raster scale `drawnAt` calls for: the next power of two at or above the\n * natural-to-drawn ratio, capped by texture size and the pixel ceiling. */\nfunction rasterScaleFor(natural: ImageRasterSize, drawnAt: ImageRasterSize): number | undefined {\n const need = Math.max(drawnAt.width / natural.width, drawnAt.height / natural.height);\n if (!(need > 0) || !Number.isFinite(need)) return undefined;\n const side = maxImageTextureSide();\n const cap = Math.min(\n side / natural.width,\n side / natural.height,\n Math.sqrt(MAX_VECTOR_RASTER_PIXELS / (natural.width * natural.height)),\n );\n return Math.min(2 ** Math.ceil(Math.log2(need)), cap);\n}\n\nfunction maybeReraster(src: string, entry: Entry, v: VectorRaster, drawnAt: ImageRasterSize): void {\n if (v.pending !== undefined) return;\n const target = rasterScaleFor(v.natural, drawnAt);\n if (target === undefined) return;\n const grow = target > v.scale;\n if (!grow && target * SHRINK_SLACK > v.scale) return;\n for (const f of v.failed) if (target === f || (grow && f > v.scale && target >= f)) return;\n\n v.pending = target;\n const size = {\n width: Math.max(1, Math.round(v.natural.width * target)),\n height: Math.max(1, Math.round(v.natural.height * target)),\n };\n loader(src, size).then(\n (bitmap) => {\n if (cache.get(src) !== entry) return;\n v.pending = undefined;\n const old = entry.bitmap;\n entry.bitmap = bitmap;\n v.scale = target;\n if (old && old !== bitmap) releaseImageSource(old);\n notify();\n },\n () => {\n // The previous raster keeps painting; only this scale is given up on.\n if (cache.get(src) !== entry) return;\n v.pending = undefined;\n v.failed.add(target);\n },\n );\n}\n\n/** Synchronous read. Returns the decoded bitmap when ready; otherwise returns\n * `undefined` and lazily starts a de-duped async load for `src`.\n *\n * `drawnAt` is the size in device pixels the image is about to cover. A\n * vector source ({@link isVectorImageSrc}) uses it to re-rasterize in\n * power-of-two steps — the current raster is returned until the sharper one\n * is ready. Raster sources ignore it. */\nexport function getImageBitmap(src: string, drawnAt?: ImageRasterSize): ImageBitmap | undefined {\n const entry = cache.get(src);\n if (!entry) {\n startLoad(src);\n return undefined;\n }\n if (drawnAt && entry.vector) maybeReraster(src, entry, entry.vector, drawnAt);\n return entry.bitmap;\n}\n\n/** Current load status for `src` (`'idle'` if never requested). */\nexport function imageStatus(src: string): ImageStatus {\n return cache.get(src)?.status ?? 'idle';\n}\n\n/** Subscribe to load-resolution events (fires after any `src` resolves or\n * errors). Returns an unsubscribe. */\nexport function subscribeImageReady(cb: () => void): () => void {\n subscribers.add(cb);\n return () => {\n subscribers.delete(cb);\n };\n}\n\n/** @internal test seam — override the async loader so unit tests don't need\n * a real DOM image. Not part of the public barrel. */\nexport function __setImageLoaderForTests(fn: Loader): void {\n loader = fn;\n}\n\n/** @internal test seam — clear cache + subscribers and restore the default\n * loader. Not part of the public barrel. */\nexport function _resetImageCacheForTests(): void {\n cache.clear();\n subscribers.clear();\n decodedVectors.clear();\n loader = defaultLoader;\n}\n"],"mappings":"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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { registerContentHandler as e } from "./contentHandlers.js";
|
|
2
|
-
import "./imageHandler.js";
|
|
3
|
-
import "./svgHandler.js";
|
|
4
|
-
import "./weaselJsonHandler.js";
|
|
5
|
-
import { acquireKitContentHandlers as t } from "./registerKitHandlers.js";
|
|
6
|
-
import { openFilePicker as n } from "./openFilePicker.js";
|
|
7
|
-
import { itemsFromFiles as r } from "@weasel-js/routing";
|
|
8
|
-
export { t as acquireKitContentHandlers, r as itemsFromFiles, n as openFilePicker, e as registerContentHandler };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { resolveColor as e } from "../../renderer/math/color.js";
|
|
2
|
-
import { evalPatch as t, isValidPatch as n, patchBounds as r } from "./surface.js";
|
|
3
|
-
import { lerpColorArray as i } from "@weasel-js/paint";
|
|
4
|
-
//#region src/features/meshPaint/bake.ts
|
|
5
|
-
var a = 256, o = 10;
|
|
6
|
-
function s(e) {
|
|
7
|
-
return Math.max(24, Math.ceil(e / o));
|
|
8
|
-
}
|
|
9
|
-
function c(e) {
|
|
10
|
-
let t = Infinity, i = Infinity, a = -Infinity, o = -Infinity;
|
|
11
|
-
for (let s of e) {
|
|
12
|
-
if (!n(s)) continue;
|
|
13
|
-
let e = r(s);
|
|
14
|
-
t = Math.min(t, e.x), i = Math.min(i, e.y), a = Math.max(a, e.x + e.width), o = Math.max(o, e.y + e.height);
|
|
15
|
-
}
|
|
16
|
-
return !Number.isFinite(t) || a <= t || o <= i ? null : {
|
|
17
|
-
x: t,
|
|
18
|
-
y: i,
|
|
19
|
-
width: a - t,
|
|
20
|
-
height: o - i
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function l(e, t, n, r) {
|
|
24
|
-
let a = i(e[0], e[1], t, r), o = i(e[3], e[2], t, r);
|
|
25
|
-
return i(a, o, n, r);
|
|
26
|
-
}
|
|
27
|
-
function u(r, i = "rgb", o = a) {
|
|
28
|
-
let u = c(r);
|
|
29
|
-
if (!u) return null;
|
|
30
|
-
let f = new Uint8ClampedArray(o * o * 4), p = s(o), m = (e) => ({
|
|
31
|
-
x: (e.x - u.x) / u.width * (o - 1) + .5,
|
|
32
|
-
y: (e.y - u.y) / u.height * (o - 1) + .5
|
|
33
|
-
});
|
|
34
|
-
for (let a of r) {
|
|
35
|
-
if (!n(a)) continue;
|
|
36
|
-
let r = a.colors.map((t) => e(t));
|
|
37
|
-
for (let e = 0; e < p; e++) for (let n = 0; n < p; n++) {
|
|
38
|
-
let s = e / p, c = (e + 1) / p, u = n / p, h = (n + 1) / p, g = [
|
|
39
|
-
{
|
|
40
|
-
at: m(t(a, s, u)),
|
|
41
|
-
color: l(r, s, u, i)
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
at: m(t(a, c, u)),
|
|
45
|
-
color: l(r, c, u, i)
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
at: m(t(a, c, h)),
|
|
49
|
-
color: l(r, c, h, i)
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
at: m(t(a, s, h)),
|
|
53
|
-
color: l(r, s, h, i)
|
|
54
|
-
}
|
|
55
|
-
];
|
|
56
|
-
d(f, o, g[0], g[1], g[2]), d(f, o, g[0], g[2], g[3]);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
pixels: f,
|
|
61
|
-
size: o,
|
|
62
|
-
box: u
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function d(e, t, n, r, i) {
|
|
66
|
-
let a = Math.max(0, Math.floor(Math.min(n.at.x, r.at.x, i.at.x))), o = Math.min(t - 1, Math.ceil(Math.max(n.at.x, r.at.x, i.at.x))), s = Math.max(0, Math.floor(Math.min(n.at.y, r.at.y, i.at.y))), c = Math.min(t - 1, Math.ceil(Math.max(n.at.y, r.at.y, i.at.y)));
|
|
67
|
-
if (o < a || c < s) return;
|
|
68
|
-
let l = (r.at.x - n.at.x) * (i.at.y - n.at.y) - (i.at.x - n.at.x) * (r.at.y - n.at.y);
|
|
69
|
-
if (!(Math.abs(l) < 1e-9)) for (let u = s; u <= c; u++) for (let s = a; s <= o; s++) {
|
|
70
|
-
let a = s + .5, o = u + .5, c = ((r.at.x - a) * (i.at.y - o) - (i.at.x - a) * (r.at.y - o)) / l, d = ((i.at.x - a) * (n.at.y - o) - (n.at.x - a) * (i.at.y - o)) / l, f = 1 - c - d;
|
|
71
|
-
if (c < -1e-6 || d < -1e-6 || f < -1e-6) continue;
|
|
72
|
-
let p = (u * t + s) * 4;
|
|
73
|
-
for (let t = 0; t < 4; t++) e[p + t] = (c * n.color[t] + d * r.color[t] + f * i.color[t]) * 255;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { a as MESH_BAKE_SIZE, u as bakeMesh, c as meshBounds };
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=bake.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bake.js","names":["MESH_BAKE_SIZE","TEXELS_PER_CELL","gridFor","size","meshBounds","minX","minY","maxX","maxY","patch","patches","isValidPatch","b","patchBounds","colorAt","bottom","lerpColorArray","corners","u","space","top","v","bakeMesh","box","pixels","grid","toTexel","p","resolveColor","c","i","j","u0","u1","v0","v1","quad","evalPatch","fillTriangle","a","area","y","x","px","py","w0","w1","w2","k","ch"],"sources":["../../../src/features/meshPaint/bake.ts"],"sourcesContent":["/**\n * A mesh paint baked into one RGBA bitmap.\n *\n * A patch is a surface over `(u, v)`, but a paint has to answer \"what color is\n * this fragment\", which is the inverse question — and inverting a bicubic is\n * Newton iteration per fragment. Every renderer that draws these instead\n * subdivides the patch into small quads and rasterizes them forward, which is\n * what this does, once per paint, into a texture the shader then samples. The\n * cost is a texture and a resolution; the gain is that the paint composes with\n * every fill the renderer already knows how to draw, clipping included.\n *\n * The bitmap is straight (non-premultiplied) RGBA, matching the ramp atlas;\n * the fragment shader premultiplies.\n */\n\nimport { resolveColor } from '../../renderer/math/color';\nimport { lerpColorArray, type ColorSpace } from '@weasel-js/paint';\nimport { evalPatch, isValidPatch, patchBounds, type MeshPatch } from './surface';\n\n/** Texels on a side of a bake when the caller names no size. The renderer\n * sizes each bake from how large the paint draws — see `meshBakeSize`. */\nexport const MESH_BAKE_SIZE = 256;\n\n/** Texels a rasterized cell spans at most. The rasterizer interpolates color\n * linearly inside a cell and draws a curved edge as its chord, so this is\n * what keeps a perceptual blend perceptual and an edge curved at any size. */\nconst TEXELS_PER_CELL = 10;\n\n/** Quads per patch on a side, never fewer than 24. */\nfunction gridFor(size: number): number {\n return Math.max(24, Math.ceil(size / TEXELS_PER_CELL));\n}\n\n/** The box a bake covers, in the paint's own space. */\nexport interface MeshBox {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** The bitmap `bakeMesh` produces, and the paint-space box it covers. */\nexport interface BakedMesh {\n /** `size` × `size` texels, straight RGBA. */\n pixels: Uint8ClampedArray;\n /** Texels on a side; `MESH_BAKE_SIZE` unless the caller asked otherwise. */\n size: number;\n /** Where the bitmap sits in paint space, which is what the shader maps a\n * fragment through. */\n box: MeshBox;\n}\n\n/** The union of every patch's bounds, or `null` when nothing is drawable. */\nexport function meshBounds(patches: readonly MeshPatch[]): MeshBox | null {\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const patch of patches) {\n if (!isValidPatch(patch)) continue;\n const b = patchBounds(patch);\n minX = Math.min(minX, b.x);\n minY = Math.min(minY, b.y);\n maxX = Math.max(maxX, b.x + b.width);\n maxY = Math.max(maxY, b.y + b.height);\n }\n if (!Number.isFinite(minX) || maxX <= minX || maxY <= minY) return null;\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n\ntype Rgba = readonly [number, number, number, number];\n\n/**\n * Corner colors blended at `(u, v)` in `space`.\n *\n * Bilinear as three lerps rather than four weights, because a perceptual space\n * has a midpoint between two colors and no meaningful four-way mix — OKLCh's\n * hue in particular is an arc, which only two endpoints define.\n */\nfunction colorAt(corners: Rgba[], u: number, v: number, space: ColorSpace): number[] {\n const bottom = lerpColorArray(corners[0], corners[1], u, space);\n const top = lerpColorArray(corners[3], corners[2], u, space);\n return lerpColorArray(bottom, top, v, space);\n}\n\n/**\n * Rasterize `patches` into a square bitmap covering their union.\n *\n * Returns `null` when no patch is drawable, which is the caller's cue to paint\n * nothing rather than a blank square.\n */\nexport function bakeMesh(\n patches: readonly MeshPatch[],\n space: ColorSpace = 'rgb',\n size: number = MESH_BAKE_SIZE,\n): BakedMesh | null {\n const box = meshBounds(patches);\n if (!box) return null;\n\n const pixels = new Uint8ClampedArray(size * size * 4);\n const grid = gridFor(size);\n // The box maps onto texel *centers*, not texel edges: a corner of the mesh\n // lands at the center of the corner texel, so the outermost row and column\n // are covered rather than half-missed by a rasterizer testing centers.\n const toTexel = (p: { x: number; y: number }): { x: number; y: number } => ({\n x: ((p.x - box.x) / box.width) * (size - 1) + 0.5,\n y: ((p.y - box.y) / box.height) * (size - 1) + 0.5,\n });\n\n for (const patch of patches) {\n if (!isValidPatch(patch)) continue;\n const corners = patch.colors.map((c) => resolveColor(c)) as Rgba[];\n\n for (let i = 0; i < grid; i++) {\n for (let j = 0; j < grid; j++) {\n const u0 = i / grid;\n const u1 = (i + 1) / grid;\n const v0 = j / grid;\n const v1 = (j + 1) / grid;\n const quad = [\n { at: toTexel(evalPatch(patch, u0, v0)), color: colorAt(corners, u0, v0, space) },\n { at: toTexel(evalPatch(patch, u1, v0)), color: colorAt(corners, u1, v0, space) },\n { at: toTexel(evalPatch(patch, u1, v1)), color: colorAt(corners, u1, v1, space) },\n { at: toTexel(evalPatch(patch, u0, v1)), color: colorAt(corners, u0, v1, space) },\n ];\n fillTriangle(pixels, size, quad[0], quad[1], quad[2]);\n fillTriangle(pixels, size, quad[0], quad[2], quad[3]);\n }\n }\n }\n\n return { pixels, size, box };\n}\n\ninterface Vertex {\n at: { x: number; y: number };\n color: number[];\n}\n\nconst EDGE_EPS = 1e-6;\n\n/**\n * One triangle, barycentric, colors interpolated across it.\n *\n * Neighboring cells share an edge, so a pixel exactly on one is claimed by\n * both — harmless here because both carry the same color there, and cheaper\n * than a fill rule.\n */\nfunction fillTriangle(\n pixels: Uint8ClampedArray, size: number, a: Vertex, b: Vertex, c: Vertex,\n): void {\n const minX = Math.max(0, Math.floor(Math.min(a.at.x, b.at.x, c.at.x)));\n const maxX = Math.min(size - 1, Math.ceil(Math.max(a.at.x, b.at.x, c.at.x)));\n const minY = Math.max(0, Math.floor(Math.min(a.at.y, b.at.y, c.at.y)));\n const maxY = Math.min(size - 1, Math.ceil(Math.max(a.at.y, b.at.y, c.at.y)));\n if (maxX < minX || maxY < minY) return;\n\n const area = (b.at.x - a.at.x) * (c.at.y - a.at.y) - (c.at.x - a.at.x) * (b.at.y - a.at.y);\n // A degenerate cell — a patch collapsed to a line — covers nothing.\n if (Math.abs(area) < 1e-9) return;\n\n for (let y = minY; y <= maxY; y++) {\n for (let x = minX; x <= maxX; x++) {\n const px = x + 0.5;\n const py = y + 0.5;\n const w0 = ((b.at.x - px) * (c.at.y - py) - (c.at.x - px) * (b.at.y - py)) / area;\n const w1 = ((c.at.x - px) * (a.at.y - py) - (a.at.x - px) * (c.at.y - py)) / area;\n const w2 = 1 - w0 - w1;\n // An edge texel's center sits exactly on the boundary, where rounding\n // can put it a hair outside; the epsilon is what keeps the border row\n // from dropping out.\n if (w0 < -EDGE_EPS || w1 < -EDGE_EPS || w2 < -EDGE_EPS) continue;\n const k = (y * size + x) * 4;\n for (let ch = 0; ch < 4; ch++) {\n pixels[k + ch] = (w0 * a.color[ch] + w1 * b.color[ch] + w2 * c.color[ch]) * 255;\n }\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { MESH_BAKE_SIZE as e } from "./bake.js";
|
|
2
|
-
//#region src/features/meshPaint/bakeCache.ts
|
|
3
|
-
var t = 32, n = 2048, r = 67108864, i = 256;
|
|
4
|
-
function a(r, i) {
|
|
5
|
-
let a = Math.min(n, o(i));
|
|
6
|
-
return Number.isNaN(r) ? Math.min(e, a) : r <= t ? Math.min(t, a) : r >= a ? a : Math.min(a, 2 ** Math.ceil(Math.log2(r)));
|
|
7
|
-
}
|
|
8
|
-
function o(e) {
|
|
9
|
-
return e >= 1 ? Number.isFinite(e) ? 2 ** Math.floor(Math.log2(e)) : n : t;
|
|
10
|
-
}
|
|
11
|
-
var s = class {
|
|
12
|
-
free;
|
|
13
|
-
budgetBytes;
|
|
14
|
-
maxEntries;
|
|
15
|
-
byPaint = /* @__PURE__ */ new WeakMap();
|
|
16
|
-
order = /* @__PURE__ */ new Set();
|
|
17
|
-
held = 0;
|
|
18
|
-
constructor(e, t = r, n = i) {
|
|
19
|
-
this.free = e, this.budgetBytes = t, this.maxEntries = n;
|
|
20
|
-
}
|
|
21
|
-
get bytes() {
|
|
22
|
-
return this.held;
|
|
23
|
-
}
|
|
24
|
-
get size() {
|
|
25
|
-
return this.order.size;
|
|
26
|
-
}
|
|
27
|
-
get(e, t) {
|
|
28
|
-
let n = this.byPaint.get(e)?.get(t);
|
|
29
|
-
if (n) return this.order.delete(n), this.order.add(n), n.value;
|
|
30
|
-
}
|
|
31
|
-
set(e, t, n) {
|
|
32
|
-
let r = this.byPaint.get(e);
|
|
33
|
-
r || (r = /* @__PURE__ */ new Map(), this.byPaint.set(e, r));
|
|
34
|
-
let i = r.get(t);
|
|
35
|
-
i && this.drop(i);
|
|
36
|
-
let a = {
|
|
37
|
-
value: n,
|
|
38
|
-
size: t,
|
|
39
|
-
bySize: r
|
|
40
|
-
};
|
|
41
|
-
r.set(t, a), this.order.add(a), this.held += t * t * 4, this.evict(a);
|
|
42
|
-
}
|
|
43
|
-
clear() {
|
|
44
|
-
for (let e of [...this.order]) this.drop(e);
|
|
45
|
-
}
|
|
46
|
-
evict(e) {
|
|
47
|
-
for (let t of this.order) {
|
|
48
|
-
if (this.held <= this.budgetBytes && this.order.size <= this.maxEntries) return;
|
|
49
|
-
t !== e && this.drop(t);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
drop(e) {
|
|
53
|
-
this.order.delete(e) && (e.bySize.delete(e.size), this.held -= e.size * e.size * 4, this.free(e.value));
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
export { r as MESH_BAKE_CACHE_BYTES, i as MESH_BAKE_CACHE_ENTRIES, n as MESH_BAKE_MAX, t as MESH_BAKE_MIN, s as MeshBakeCache, a as meshBakeSize };
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=bakeCache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bakeCache.js","names":["MESH_BAKE_MIN","MESH_BAKE_MAX","MESH_BAKE_CACHE_BYTES","MESH_BAKE_CACHE_ENTRIES","meshBakeSize","ceiling","floorPow2","maxTextureSize","devicePx","MESH_BAKE_SIZE","n","MeshBakeCache","free","budgetBytes","maxEntries","entry","paint","size","bySize","old","keep"],"sources":["../../../src/features/meshPaint/bakeCache.ts"],"sourcesContent":["/**\n * How large a mesh bake is, and the bounded cache the bakes live in.\n *\n * A gradient's ramp is one-dimensional, so 256 texels cover it at any size. A\n * mesh's bake is two-dimensional and is stretched over whatever the paint\n * covers, so a fixed size shows its texels once the paint draws large. The\n * bake is sized from the device pixels it covers instead, in power-of-two\n * buckets so a zoom inside one bucket reuses the bake it already has.\n */\n\nimport { MESH_BAKE_SIZE } from './bake';\n\n/** The smallest bake: below this a texture costs more in bookkeeping than in\n * bytes. */\nexport const MESH_BAKE_MIN = 32;\n\n/** The largest bake, whatever the context allows: 16 MiB of RGBA, and a bake\n * that already takes a noticeable moment on the CPU. */\nexport const MESH_BAKE_MAX = 2048;\n\n/** Bytes of baked texture one renderer keeps before evicting the least\n * recently drawn. */\nexport const MESH_BAKE_CACHE_BYTES = 64 * 1024 * 1024;\n\n/** Bakes one renderer keeps, however small, so a scene of many tiny meshes\n * cannot hold thousands of GL textures. */\nexport const MESH_BAKE_CACHE_ENTRIES = 256;\n\n/**\n * The bake side for a paint drawn `devicePx` device pixels across, on a\n * context accepting `maxTextureSize`: the next power of two at or above it,\n * clamped to `[MESH_BAKE_MIN, MESH_BAKE_MAX]` and to the context. A size that\n * cannot be measured gets `MESH_BAKE_SIZE`.\n */\nexport function meshBakeSize(devicePx: number, maxTextureSize: number): number {\n const ceiling = Math.min(MESH_BAKE_MAX, floorPow2(maxTextureSize));\n if (Number.isNaN(devicePx)) return Math.min(MESH_BAKE_SIZE, ceiling);\n if (devicePx <= MESH_BAKE_MIN) return Math.min(MESH_BAKE_MIN, ceiling);\n if (devicePx >= ceiling) return ceiling;\n return Math.min(ceiling, 2 ** Math.ceil(Math.log2(devicePx)));\n}\n\nfunction floorPow2(n: number): number {\n if (!(n >= 1)) return MESH_BAKE_MIN;\n if (!Number.isFinite(n)) return MESH_BAKE_MAX;\n return 2 ** Math.floor(Math.log2(n));\n}\n\ninterface Entry<T> {\n value: T;\n size: number;\n /** The paint's own bucket map, which is what eviction removes it from. */\n bySize: Map<number, Entry<T>>;\n}\n\n/**\n * Bakes keyed by paint and bake size, least recently used first out.\n *\n * The paint is held weakly, so a paint nobody draws any more does not pin its\n * key; its texture stays until eviction reaches it, which the bounds keep\n * finite. `free` runs for every value that leaves, by eviction, replacement or\n * `clear`.\n */\nexport class MeshBakeCache<T> {\n private readonly byPaint = new WeakMap<object, Map<number, Entry<T>>>();\n /** Insertion order is recency: a hit is deleted and re-added. */\n private readonly order = new Set<Entry<T>>();\n private held = 0;\n\n constructor(\n private readonly free: (value: T) => void,\n private readonly budgetBytes: number = MESH_BAKE_CACHE_BYTES,\n private readonly maxEntries: number = MESH_BAKE_CACHE_ENTRIES,\n ) {}\n\n /** Bytes the held bakes occupy, as RGBA8. */\n get bytes(): number { return this.held; }\n\n /** Bakes held. */\n get size(): number { return this.order.size; }\n\n get(paint: object, size: number): T | undefined {\n const entry = this.byPaint.get(paint)?.get(size);\n if (!entry) return undefined;\n this.order.delete(entry);\n this.order.add(entry);\n return entry.value;\n }\n\n set(paint: object, size: number, value: T): void {\n let bySize = this.byPaint.get(paint);\n if (!bySize) {\n bySize = new Map();\n this.byPaint.set(paint, bySize);\n }\n const old = bySize.get(size);\n if (old) this.drop(old);\n const entry: Entry<T> = { value, size, bySize };\n bySize.set(size, entry);\n this.order.add(entry);\n this.held += size * size * 4;\n this.evict(entry);\n }\n\n /** Free every bake. The cache stays usable. */\n clear(): void {\n for (const entry of [...this.order]) this.drop(entry);\n }\n\n /** Oldest first until both bounds hold, never evicting `keep` — the bake\n * the caller is about to draw. */\n private evict(keep: Entry<T>): void {\n for (const entry of this.order) {\n if (this.held <= this.budgetBytes && this.order.size <= this.maxEntries) return;\n if (entry !== keep) this.drop(entry);\n }\n }\n\n private drop(entry: Entry<T>): void {\n if (!this.order.delete(entry)) return;\n entry.bySize.delete(entry.size);\n this.held -= entry.size * entry.size * 4;\n this.free(entry.value);\n }\n}\n"],"mappings":";;AAcA,IAAaA,IAAgB,IAIhBC,IAAgB,MAIhBC,IAAwB,UAIxBC,IAA0B;AAQvC,SAAgBC,EAAa,GAAkB,GAAgC;CAC7E,IAAMC,IAAU,KAAK,IAAIJ,GAAeK,EAAUC,CAAc,CAAC;CAIjE,OAHI,OAAO,MAAMC,CAAQ,IAAU,KAAK,IAAIC,GAAgBJ,CAAO,IAC/DG,KAAYR,IAAsB,KAAK,IAAIA,GAAeK,CAAO,IACjEG,KAAYH,IAAgBA,IACzB,KAAK,IAAIA,GAAS,KAAK,KAAK,KAAK,KAAK,KAAKG,CAAQ,CAAC,CAAC;AAC9D;AAEA,SAASF,EAAU,GAAmB;CAGpC,OAFMI,KAAK,IACN,OAAO,SAASA,CAAC,IACf,KAAK,KAAK,MAAM,KAAK,KAAKA,CAAC,CAAC,IADHT,IADVD;AAGxB;AAiBA,IAAaW,IAAb,MAA8B;CAOT;CACA;CACA;CARnB,0BAA2B,IAAI,QAAuC;CAEtE,wBAAyB,IAAI,IAAc;CAC3C,OAAe;CAEf,YACE,GACA,IAAuCT,GACvC,IAAsCC,GACtC;EADiB,AAFA,KAAA,OAAAS,GACA,KAAA,cAAAC,GACA,KAAA,aAAAC;CAChB;CAGH,IAAI,QAAgB;EAAE,OAAO,KAAK;CAAM;CAGxC,IAAI,OAAe;EAAE,OAAO,KAAK,MAAM;CAAM;CAE7C,IAAI,GAAe,GAA6B;EAC9C,IAAMC,IAAQ,KAAK,QAAQ,IAAIC,CAAK,CAAC,EAAE,IAAIC,CAAI;EAC/C,IAAKF,GAGL,OAFA,KAAK,MAAM,OAAOA,CAAK,GACvB,KAAK,MAAM,IAAIA,CAAK,GACbA,EAAM;CACf;CAEA,IAAI,GAAe,GAAc,GAAgB;EAC/C,IAAIG,IAAS,KAAK,QAAQ,IAAIF,CAAK;EACnC,AAAKE,MACH,oBAAS,IAAI,IAAI,GACjB,KAAK,QAAQ,IAAIF,GAAOE,CAAM;EAEhC,IAAMC,IAAMD,EAAO,IAAID,CAAI;EAC3B,AAAIE,KAAK,KAAK,KAAKA,CAAG;EACtB,IAAMJ,IAAkB;GAAE;GAAO;GAAM;EAAO;EAI9C,AAHAG,EAAO,IAAID,GAAMF,CAAK,GACtB,KAAK,MAAM,IAAIA,CAAK,GACpB,KAAK,QAAQE,IAAOA,IAAO,GAC3B,KAAK,MAAMF,CAAK;CAClB;CAGA,QAAc;EACZ,KAAK,IAAMA,KAAS,CAAC,GAAG,KAAK,KAAK,GAAG,KAAK,KAAKA,CAAK;CACtD;CAIA,MAAc,GAAsB;EAClC,KAAK,IAAMA,KAAS,KAAK,OAAO;GAC9B,IAAI,KAAK,QAAQ,KAAK,eAAe,KAAK,MAAM,QAAQ,KAAK,YAAY;GACzE,AAAIA,MAAUK,KAAM,KAAK,KAAKL,CAAK;EACrC;CACF;CAEA,KAAa,GAAuB;EAClC,AAAK,KAAK,MAAM,OAAOA,CAAK,MAC5BA,EAAM,OAAO,OAAOA,EAAM,IAAI,GAC9B,KAAK,QAAQA,EAAM,OAAOA,EAAM,OAAO,GACvC,KAAK,KAAKA,EAAM,KAAK;CACvB;AACF"}
|