@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drawBatch.js","names":["MAX_VERTICES_PER_BATCH","FLOATS_PER_VERTEX","INITIAL_VERTICES","INITIAL_INDICES","WHITE_U","WHITE_V","PLAIN_WHITE","packSlot","WHITE_SLOT","PAINT_MODE_PLAIN","SOLID_RING_SIZE","BATCH_TIERS","SOLID_RING_SLOT_VERTICES","SOLID_LARGE_RING_SIZE","doubledTo","capacity","from","need","quadIndices","out","quads","q","b","j","DrawBatch","aPos","prog","aColor","aUv","aPost","aSlot","gl","vertices","i","ma","m","mb","mc","md","mtx","mty","x1","x","w","y1","y","h","ax","ay","bx","by","cx","cy","dx","dy","P","r","g","a","slot","u0","v0","post","u1","v1","topShift","baselineY","y0","tanItalic","botShift","tx0","x0","tx1","bx0","bx1","mode","corner","at","uv","src","mesh","srcIdx","n","v","k","base","tier","t","set","ring","u","packed","F","minX","maxX","minY","maxY","rect","i0","clipConvexPolygon","poly","needVerts","grown","needIdx","indices","existing","vao","vbo","ibo"],"sources":["../../src/renderer/drawBatch.ts"],"sourcesContent":["/**\n * Growable vertex staging for a run of solid-fill geometry, image quads and\n * glyphs.\n *\n * Geometry only: `draw.ts` owns when a run starts, what breaks it, and the\n * uniforms the flush draws under.\n *\n * **One batch for all three, because a page interleaves them.** A grid of\n * thumbnails is a ground rect under an atlas quad under a caption, per cell,\n * and while each kind staged separately every one had to drain the others\n * before it could stage — so a shape that batches perfectly in any one half\n * alone paid a flush per command. Everything a vertex needs to say which it is\n * fits in the same vertex: solids carry the UV of a 1x1 white texel and are\n * their own color, quads carry their atlas UV and a white color, glyphs carry\n * a font atlas UV, their text color, and a paint mode saying the texel is a\n * distance field rather than a color. Gradients join as a fourth off the ramp\n * atlas — a linear one without a mode of its own, since (ramp position, row) is\n * what the plain mode already samples, and a radial or conic one with a mode\n * that says its UV is a gradient-space coordinate to take a `length` or an\n * `atan` of. See `shaders/batchFill.ts`.\n *\n * Colors ride the vertices because shapes in a run differ in color and a merged\n * draw has one set of uniforms — and so does the model transform, applied here\n * rather than uploaded, so shapes under different transforms still share a\n * draw. The texture rides them too, as a slot index into the units the flush\n * binds: slot 0 is the white texel every solid samples, and `draw.ts` hands out\n * the rest per bitmap. A run holds as many bitmaps as there are slots, so an\n * atlas is what makes a wall of one sheet coalesce and a handful of loose\n * bitmaps no longer breaks a run per command.\n */\n\nimport type { Mesh } from '@weasel-js/geom/tessellate';\nimport type { GlMat3 } from './math/mat3';\nimport type { ShaderProgram } from './shaders/ShaderProgram';\nimport { PAINT_MODE_PLAIN, WHITE_SLOT, packSlot } from './shaders/batchFill';\nimport { clipConvexPolygon, type ClipRect } from './batchClip';\n\n/** Vertices per flush. Caps staging memory; a longer run flushes in chunks,\n * which stays correct because painter's order survives a flush. */\nexport const MAX_VERTICES_PER_BATCH = 32768;\n\n/** vec2 a_position + vec4 a_vertexColor + vec2 a_uv + float a_post + float\n * a_texSlot. Exported so the buffer-replay tests read fields by name rather\n * than by a stride they repeat — a hard-coded one silently reads a different\n * field when the vertex grows, instead of failing. */\nexport const FLOATS_PER_VERTEX = 10;\n\n/** Float offset of `a_texSlot` within a vertex, which carries the paint mode\n * packed alongside the slot — `paintModeOf` unpacks it. */\nexport const TEX_SLOT_OFFSET = 9;\nconst INITIAL_VERTICES = 256;\nconst INITIAL_INDICES = 384;\n\n/** UV of the white texel bound at slot 0. Its texture is 1x1, so any\n * coordinate lands on it; the center is the one that stays on it under either\n * filter. */\nexport const WHITE_U = 0.5;\nexport const WHITE_V = 0.5;\n\n/**\n * A gradient vertex's `a_uv`, each channel affine in the coordinates the\n * geometry arrives in: `u = ux*x + uy*y + u0`, and the same for `v`.\n *\n * One shape for all three gradients. A linear one's `v` row is the constant\n * atlas row and its `u` row is the ramp position; a radial or conic one's two\n * rows are the gradient-space coordinate, and the row rides `a_post` instead.\n */\nexport interface GradientUV {\n ux: number; uy: number; u0: number;\n vx: number; vy: number; v0: number;\n}\n\n/** What `a_texSlot` carries on a vertex that is its own color: the white texel\n * at the plain paint mode. */\nconst PLAIN_WHITE = packSlot(WHITE_SLOT, PAINT_MODE_PLAIN);\n\n/**\n * Flushes between one ring slot's write and its next.\n *\n * Sized for a driver that tracks a write hazard per buffer object, where\n * rewriting one buffer before every flush makes each write wait on the draw\n * still reading it. That was measured on an M2 Max by timing blocks of frames,\n * a method since retired (`tests/perf/README.md`, \"Timing a frame\"), and on\n * teitou (M5 Max, ANGLE Metal, 2026-10-05) one frame a task does not show it:\n * `tests/perf/image-quad.spec.ts` puts a quad through a ring of 64 at 3.3–5.2 us\n * over two sittings, through one buffer rewritten each time at 2.5–3.0, and\n * through a buffer nothing writes at 0.16–0.22.\n */\nexport const SOLID_RING_SIZE = 64;\n\n/**\n * Slot sizes, smallest first. A flush takes the first it fits in.\n *\n * **Tiered because a write into a big slot costs more than the same write into\n * a small one.** On teitou (M5 Max, ANGLE Metal, 2026-10-05), a frame of 20,000\n * quads each drawn alone (`tests/perf/image-quad.spec.ts`, `renderer/unmerged`)\n * costs 19.2–19.9 us a quad with these tiers against 21.0 with 1,024 vertices\n * as the smallest slot, and a merged run is unmoved either way. The 92 ms\n * against 53 recorded before came from timing blocks of frames, a method since\n * retired. The run that most wants a small buffer — one command, because the\n * next broke it — is exactly the run a batch is otherwise pure overhead for.\n */\nexport const BATCH_TIERS: readonly { vertices: number; indices: number }[] = [\n { vertices: 16, indices: 24 },\n { vertices: 1024, indices: 3072 },\n];\n\n/** What a standard slot holds, named for the tests and the flush-cost specs. */\nexport const SOLID_RING_SLOT_VERTICES = BATCH_TIERS[BATCH_TIERS.length - 1].vertices;\n\n/** Slots for flushes past the largest tier. These grow to fit, so they are few:\n * a run that big is a run few things broke, and there are not many of them in\n * a frame to cycle between. */\nexport const SOLID_LARGE_RING_SIZE = 4;\n\n/** One VAO and the two buffers its attribute and element bindings name. */\ninterface BufferSet {\n vao: WebGLVertexArrayObject;\n vbo: WebGLBuffer;\n ibo: WebGLBuffer;\n /** What the GPU buffers are currently sized for. */\n vertexCapacity: number;\n indexCapacity: number;\n /**\n * Quads for which this slot's element buffer holds the canonical pattern,\n * or 0 for contents that cannot be named that way (a mesh's rebased indices,\n * or a buffer just respecified).\n *\n * The pattern for N quads is a prefix of the pattern for any larger N, so a\n * slot written to its capacity serves every quad flush it ever takes and the\n * upload happens once per slot rather than once per flush. Rects and image\n * quads share it: both wind 0-1-2 / 0-2-3.\n */\n canonicalQuads: number;\n}\n\nfunction doubledTo(from: number, need: number): number {\n let capacity = from;\n while (capacity < need) capacity *= 2;\n return capacity;\n}\n\n/** The canonical quad index pattern for `quads` quads, as the push helpers\n * wind them: two triangles over corners 0-1-2 and 0-2-3. */\nfunction quadIndices(quads: number): Uint32Array {\n const out = new Uint32Array(quads * 6);\n for (let q = 0; q < quads; q++) {\n const b = q * 4;\n const j = q * 6;\n out[j] = b; out[j + 1] = b + 1; out[j + 2] = b + 2;\n out[j + 3] = b; out[j + 4] = b + 2; out[j + 5] = b + 3;\n }\n return out;\n}\n\nexport class DrawBatch {\n private readonly gl: WebGL2RenderingContext;\n private readonly aPos: number;\n private readonly aColor: number;\n private readonly aUv: number;\n private readonly aPost: number;\n private readonly aSlot: number;\n\n /** One ring per tier, cycled per flush. Slots are created on first use, so a\n * renderer that flushes rarely allocates as few as it flushes. */\n private readonly rings: (BufferSet | undefined)[][] =\n BATCH_TIERS.map(() => new Array(SOLID_RING_SIZE).fill(undefined));\n private readonly nextInRing: number[] = BATCH_TIERS.map(() => 0);\n /** The same, for flushes past the largest tier; these sets grow to fit. */\n private readonly largeRing: (BufferSet | undefined)[] =\n new Array(SOLID_LARGE_RING_SIZE).fill(undefined);\n private nextLarge = 0;\n\n private verts = new Float32Array(INITIAL_VERTICES * FLOATS_PER_VERTEX);\n private idx = new Uint32Array(INITIAL_INDICES);\n private nVerts = 0;\n private nIdx = 0;\n /** Whether the staged run is quads alone, so its indices are the canonical\n * pattern and a slot already holding that pattern needs no upload. */\n private pureRects = true;\n\n /** The rect every push is cut to, or `null`. `draw.ts` sets it as rect\n * clips enter and leave — see `batchClip.ts`. A push returns `false`, having\n * staged nothing, for geometry it cannot cut exactly; see `clipQuad`. */\n clip: ClipRect | null = null;\n /** Polygon scratch for `clip`: a quad cut by four edges has at most eight\n * corners. */\n private readonly polyIn = new Float32Array(8 * FLOATS_PER_VERTEX);\n private readonly polyOut = new Float32Array(8 * FLOATS_PER_VERTEX);\n private readonly polyTmp = new Float32Array(8 * FLOATS_PER_VERTEX);\n\n constructor(gl: WebGL2RenderingContext, prog: ShaderProgram) {\n const aPos = prog.attribute('a_position');\n const aColor = prog.attribute('a_vertexColor');\n const aUv = prog.attribute('a_uv');\n const aPost = prog.attribute('a_post');\n const aSlot = prog.attribute('a_texSlot');\n if (aPos === undefined || aColor === undefined || aUv === undefined\n || aPost === undefined || aSlot === undefined) {\n throw new Error(\n 'DrawBatch: batch program is missing a_position / a_vertexColor / a_uv / '\n + 'a_post / a_texSlot',\n );\n }\n this.gl = gl;\n this.aPos = aPos;\n this.aColor = aColor;\n this.aUv = aUv;\n this.aPost = aPost;\n this.aSlot = aSlot;\n }\n\n get length(): number {\n return this.nIdx;\n }\n\n /** Whether staging `vertices` more would put the run past the per-flush cap. */\n wouldOverflow(vertices: number): boolean {\n return this.nVerts + vertices > MAX_VERTICES_PER_BATCH;\n }\n\n /**\n * Append one rect's four corners through `m`, all carrying `rgba` (straight\n * alpha). An affine maps a rect to a parallelogram, so two triangles still\n * cover it and the batch draws at `u_model` identity.\n */\n pushRect(\n x: number, y: number, w: number, h: number, m: GlMat3,\n r: number, g: number, b: number, a: number,\n ): boolean {\n this.reserve(4, 6);\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n const x1 = x + w;\n const y1 = y + h;\n const ax = ma * x + mc * y + mtx, ay = mb * x + md * y + mty;\n const bx = ma * x1 + mc * y + mtx, by = mb * x1 + md * y + mty;\n const cx = ma * x1 + mc * y1 + mtx, cy = mb * x1 + md * y1 + mty;\n const dx = ma * x + mc * y1 + mtx, dy = mb * x + md * y1 + mty;\n const P = PLAIN_WHITE;\n i = this.writeVertex(i, ax, ay, r, g, b, a, WHITE_U, WHITE_V, 1, P);\n i = this.writeVertex(i, bx, by, r, g, b, a, WHITE_U, WHITE_V, 1, P);\n i = this.writeVertex(i, cx, cy, r, g, b, a, WHITE_U, WHITE_V, 1, P);\n this.writeVertex(i, dx, dy, r, g, b, a, WHITE_U, WHITE_V, 1, P);\n this.pushQuadIndices();\n return this.clip === null || this.clipQuad(this.nVerts - 4, this.nIdx - 6, this.clip);\n }\n\n /**\n * Append one image quad: the destination rect `(x, y, w, h)` mapped through\n * `m`, sampling `(u0, v0)`-`(u1, v1)`, every corner carrying `post` as the\n * after-the-color-matrix alpha factor.\n *\n * Corners wind top-left, top-right, bottom-right, bottom-left with UVs\n * following — the same winding `pushRect` uses, which is what lets a run of\n * mixed rects and quads keep the canonical index pattern. The flips a command\n * asks for are already in the `u` / `v` the caller passes.\n *\n * `slot` is the texture unit the corners sample, which `draw.ts` assigns per\n * bitmap within the run.\n */\n pushQuad(\n x: number, y: number, w: number, h: number, m: GlMat3,\n u0: number, v0: number, u1: number, v1: number,\n post: number, slot: number,\n ): boolean {\n this.reserve(4, 6);\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n const x1 = x + w;\n const y1 = y + h;\n const ax = ma * x + mc * y + mtx, ay = mb * x + md * y + mty;\n const bx = ma * x1 + mc * y + mtx, by = mb * x1 + md * y + mty;\n const cx = ma * x1 + mc * y1 + mtx, cy = mb * x1 + md * y1 + mty;\n const dx = ma * x + mc * y1 + mtx, dy = mb * x + md * y1 + mty;\n const P = packSlot(slot, PAINT_MODE_PLAIN);\n i = this.writeVertex(i, ax, ay, 1, 1, 1, 1, u0, v0, post, P);\n i = this.writeVertex(i, bx, by, 1, 1, 1, 1, u1, v0, post, P);\n i = this.writeVertex(i, cx, cy, 1, 1, 1, 1, u1, v1, post, P);\n this.writeVertex(i, dx, dy, 1, 1, 1, 1, u0, v1, post, P);\n this.pushQuadIndices();\n return this.clip === null || this.clipQuad(this.nVerts - 4, this.nIdx - 6, this.clip);\n }\n\n /**\n * Append one glyph quad: the box `(x0, y0)`-`(x1, y1)` mapped through `m`,\n * sampling `(u0, v0)`-`(u1, v1)` of the font atlas at `slot`, painted in\n * `rgba`.\n *\n * `mode` says which channels of that atlas carry the distance field, and\n * rides the vertices packed into the slot — so a run off a baked MSDF atlas\n * and one off the runtime canvas bake still share a draw. The synthetic-bold\n * threshold does not: it is `u_synthBold`, and `draw.ts` breaks the run when\n * it changes.\n *\n * **A synthetic oblique is sheared here rather than in the shader.** The old\n * text program carried the baseline per vertex and skewed against\n * `u_synthItalic`; the batch places its own corners, so the shear is one\n * multiply while they are being placed, and `tanItalic` is 0 for an upright\n * face. It has to happen before `m`, which is where the shader had it too.\n *\n * Corners wind top-left, top-right, bottom-right, bottom-left — `pushQuad`'s\n * winding, which is what lets a run of mixed rects, image quads and glyphs\n * keep the canonical index pattern.\n */\n pushGlyph(\n x0: number, y0: number, x1: number, y1: number,\n baselineY: number, tanItalic: number, m: GlMat3,\n u0: number, v0: number, u1: number, v1: number,\n r: number, g: number, b: number, a: number,\n slot: number, mode: number,\n ): boolean {\n this.reserve(4, 6);\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n // Above-baseline corners (lower y in screen coords) lean further right.\n const topShift = (baselineY - y0) * tanItalic;\n const botShift = (baselineY - y1) * tanItalic;\n const tx0 = x0 + topShift, tx1 = x1 + topShift;\n const bx0 = x0 + botShift, bx1 = x1 + botShift;\n const ax = ma * tx0 + mc * y0 + mtx, ay = mb * tx0 + md * y0 + mty;\n const bx = ma * tx1 + mc * y0 + mtx, by = mb * tx1 + md * y0 + mty;\n const cx = ma * bx1 + mc * y1 + mtx, cy = mb * bx1 + md * y1 + mty;\n const dx = ma * bx0 + mc * y1 + mtx, dy = mb * bx0 + md * y1 + mty;\n const P = packSlot(slot, mode);\n i = this.writeVertex(i, ax, ay, r, g, b, a, u0, v0, 1, P);\n i = this.writeVertex(i, bx, by, r, g, b, a, u1, v0, 1, P);\n i = this.writeVertex(i, cx, cy, r, g, b, a, u1, v1, 1, P);\n this.writeVertex(i, dx, dy, r, g, b, a, u0, v1, 1, P);\n this.pushQuadIndices();\n return this.clip === null || this.clipQuad(this.nVerts - 4, this.nIdx - 6, this.clip);\n }\n\n /**\n * Append one rect filled by a gradient: the corners of `(x, y, w, h)` mapped\n * through `m`, sampling the ramp atlas at `slot`.\n *\n * `uv` gives each channel of `a_uv` as an affine function of the coordinates\n * the corners arrive in, which is what lets a gradient ride the vertices at\n * all: a linear one's ramp position is affine in position outright, and a\n * radial or conic one's gradient-space *coordinate* is, even though the ramp\n * position it yields is not. Either way the rasterizer's interpolation across\n * a triangle is exact. `mode` says which of the two the fragment shader is\n * looking at, and `post` carries the atlas row for the modes that read it —\n * see `shaders/batchFill.ts`.\n *\n * Values outside 0..1 are the sampler's business; the atlas clamps to the\n * edge texel, which is what the gradient shader's own `clamp` did.\n */\n pushGradientRect(\n x: number, y: number, w: number, h: number, m: GlMat3,\n uv: GradientUV, post: number, slot: number, mode: number,\n r: number, g: number, b: number, a: number,\n ): boolean {\n this.reserve(4, 6);\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n const x1 = x + w;\n const y1 = y + h;\n const P = packSlot(slot, mode);\n const corner = (cx: number, cy: number): number => {\n const at = i;\n i = this.writeVertex(\n at, ma * cx + mc * cy + mtx, mb * cx + md * cy + mty,\n r, g, b, a,\n uv.ux * cx + uv.uy * cy + uv.u0,\n uv.vx * cx + uv.vy * cy + uv.v0,\n post, P,\n );\n return i;\n };\n corner(x, y);\n corner(x1, y);\n corner(x1, y1);\n corner(x, y1);\n this.pushQuadIndices();\n return this.clip === null || this.clipQuad(this.nVerts - 4, this.nIdx - 6, this.clip);\n }\n\n /** `pushMesh` for a mesh filled by a gradient — see `pushGradientRect` for\n * what `uv`, `post` and `mode` carry. */\n pushGradientMesh(\n mesh: Mesh, m: GlMat3,\n uv: GradientUV, post: number, slot: number, mode: number,\n r: number, g: number, b: number, a: number,\n ): boolean {\n const src = mesh.vertices;\n const srcIdx = mesh.indices;\n const n = src.length >> 1;\n this.reserve(n, srcIdx.length);\n this.pureRects = false;\n const v = this.verts;\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n const P = packSlot(slot, mode);\n for (let k = 0; k < n; k++) {\n const x = src[k * 2];\n const y = src[k * 2 + 1];\n v[i++] = ma * x + mc * y + mtx;\n v[i++] = mb * x + md * y + mty;\n v[i++] = r; v[i++] = g; v[i++] = b; v[i++] = a;\n v[i++] = uv.ux * x + uv.uy * y + uv.u0;\n v[i++] = uv.vx * x + uv.vy * y + uv.v0;\n v[i++] = post; v[i++] = P;\n }\n const base = this.nVerts;\n const out = this.idx;\n let j = this.nIdx;\n for (let k = 0; k < srcIdx.length; k++) out[j++] = base + srcIdx[k];\n this.nVerts += n;\n this.nIdx += srcIdx.length;\n return this.clip === null || this.clipMesh(base, this.nIdx - srcIdx.length, this.clip);\n }\n\n /**\n * Append a tessellated mesh through `m`, all vertices carrying `rgba`. The\n * mesh's own indices are rebased onto the staged vertices, which is why the\n * index buffer is uploaded per flush rather than written once.\n */\n pushMesh(\n mesh: Mesh, m: GlMat3,\n r: number, g: number, b: number, a: number,\n ): boolean {\n const src = mesh.vertices;\n const srcIdx = mesh.indices;\n const n = src.length >> 1;\n this.reserve(n, srcIdx.length);\n this.pureRects = false;\n const v = this.verts;\n let i = this.nVerts * FLOATS_PER_VERTEX;\n const ma = m[0], mb = m[1], mc = m[3], md = m[4], mtx = m[6], mty = m[7];\n for (let k = 0; k < n; k++) {\n const x = src[k * 2];\n const y = src[k * 2 + 1];\n v[i++] = ma * x + mc * y + mtx;\n v[i++] = mb * x + md * y + mty;\n v[i++] = r; v[i++] = g; v[i++] = b; v[i++] = a;\n v[i++] = WHITE_U; v[i++] = WHITE_V; v[i++] = 1; v[i++] = PLAIN_WHITE;\n }\n const base = this.nVerts;\n const out = this.idx;\n let j = this.nIdx;\n for (let k = 0; k < srcIdx.length; k++) out[j++] = base + srcIdx[k];\n this.nVerts += n;\n this.nIdx += srcIdx.length;\n return this.clip === null || this.clipMesh(base, this.nIdx - srcIdx.length, this.clip);\n }\n\n /** Upload the staged geometry into the next set of buffers and bind its VAO.\n * Returns the index count for the caller's `drawElements`. */\n uploadAndBind(): number {\n const gl = this.gl;\n const tier = BATCH_TIERS.findIndex(\n (t) => this.nVerts <= t.vertices && this.nIdx <= t.indices,\n );\n const set = tier < 0 ? this.nextLargeSlot() : this.nextRingSlot(tier);\n gl.bindVertexArray(set.vao);\n gl.bindBuffer(gl.ARRAY_BUFFER, set.vbo);\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verts, 0, this.nVerts * FLOATS_PER_VERTEX);\n if (!this.pureRects) {\n gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, this.idx, 0, this.nIdx);\n set.canonicalQuads = 0;\n } else if (set.canonicalQuads < this.nVerts >> 2) {\n // Written to the slot's capacity, not this flush's length: the extra\n // costs one upload the slot never repeats.\n const quads = Math.min(set.vertexCapacity >> 2, Math.floor(set.indexCapacity / 6));\n gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, quadIndices(quads));\n set.canonicalQuads = quads;\n }\n return this.nIdx;\n }\n\n reset(): void {\n this.nVerts = 0;\n this.nIdx = 0;\n this.pureRects = true;\n }\n\n dispose(): void {\n for (const set of [...this.rings.flat(), ...this.largeRing]) {\n if (set) this.deleteSet(set);\n }\n for (const ring of this.rings) ring.fill(undefined);\n this.largeRing.fill(undefined);\n }\n\n private writeVertex(\n i: number,\n x: number, y: number,\n r: number, g: number, b: number, a: number,\n u: number, v: number, post: number, packed: number,\n ): number {\n const out = this.verts;\n out[i] = x; out[i + 1] = y;\n out[i + 2] = r; out[i + 3] = g; out[i + 4] = b; out[i + 5] = a;\n out[i + 6] = u; out[i + 7] = v; out[i + 8] = post; out[i + 9] = packed;\n return i + FLOATS_PER_VERTEX;\n }\n\n /**\n * Fit the quad just written at `v0` to `rect`: keep it if it lies inside,\n * drop it if it misses, and cut it if it crosses — but only if its edges\n * run along the axes. Cutting a slanted edge moves its endpoint off the\n * subpixel grid the rasterizer snaps to, and the shortened edge then covers\n * different samples than the whole one did; along an axis the cut edge is\n * the same line exactly. So a slanted quad that crosses is rolled back and\n * refused, for `draw.ts` to clip through the stencil instead.\n *\n * A cut axis-aligned quad is still four corners, so the run stays pure.\n */\n private clipQuad(v0: number, i0: number, rect: ClipRect): boolean {\n const v = this.verts;\n const at = v0 * FLOATS_PER_VERTEX;\n const F = FLOATS_PER_VERTEX;\n const ax = v[at], ay = v[at + 1], bx = v[at + F], by = v[at + F + 1];\n const cx = v[at + 2 * F], cy = v[at + 2 * F + 1], dx = v[at + 3 * F], dy = v[at + 3 * F + 1];\n const minX = Math.min(ax, bx, cx, dx), maxX = Math.max(ax, bx, cx, dx);\n const minY = Math.min(ay, by, cy, dy), maxY = Math.max(ay, by, cy, dy);\n if (minX >= rect.x0 && maxX <= rect.x1 && minY >= rect.y0 && maxY <= rect.y1) return true;\n this.nVerts = v0;\n this.nIdx = i0;\n if (maxX <= rect.x0 || minX >= rect.x1 || maxY <= rect.y0 || minY >= rect.y1) return true;\n const alongAxes = (ay === by && bx === cx && cy === dy && dx === ax)\n || (ax === bx && by === cy && cx === dx && dy === ay);\n if (!alongAxes) return false;\n this.polyIn.set(v.subarray(at, at + 4 * F));\n const n = clipConvexPolygon(this.polyIn, 4, F, rect, this.polyOut, this.polyTmp);\n this.appendFan(this.polyOut, n);\n return true;\n }\n\n /** `clipQuad` for a mesh staged from `v0`. A mesh's edges are slanted in\n * general, so one that crosses is refused rather than cut. */\n private clipMesh(v0: number, i0: number, rect: ClipRect): boolean {\n const v = this.verts;\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (let i = v0 * FLOATS_PER_VERTEX; i < this.nVerts * FLOATS_PER_VERTEX; i += FLOATS_PER_VERTEX) {\n const x = v[i];\n const y = v[i + 1];\n if (x < minX) minX = x; if (x > maxX) maxX = x;\n if (y < minY) minY = y; if (y > maxY) maxY = y;\n }\n if (minX >= rect.x0 && maxX <= rect.x1 && minY >= rect.y0 && maxY <= rect.y1) return true;\n this.nVerts = v0;\n this.nIdx = i0;\n return maxX <= rect.x0 || minX >= rect.x1 || maxY <= rect.y0 || minY >= rect.y1;\n }\n\n /** Append the `n`-corner convex polygon in `poly` as a triangle fan. */\n private appendFan(poly: Float32Array, n: number): void {\n if (n < 3) return;\n this.reserve(n, (n - 2) * 3);\n if (n !== 4) this.pureRects = false;\n const base = this.nVerts;\n this.verts.set(poly.subarray(0, n * FLOATS_PER_VERTEX), base * FLOATS_PER_VERTEX);\n let j = this.nIdx;\n for (let k = 1; k < n - 1; k++) {\n this.idx[j++] = base; this.idx[j++] = base + k; this.idx[j++] = base + k + 1;\n }\n this.nVerts += n;\n this.nIdx = j;\n }\n\n /** Two triangles over the four corners just written. */\n private pushQuadIndices(): void {\n const base = this.nVerts;\n let j = this.nIdx;\n this.idx[j++] = base; this.idx[j++] = base + 1; this.idx[j++] = base + 2;\n this.idx[j++] = base; this.idx[j++] = base + 2; this.idx[j++] = base + 3;\n this.nVerts += 4;\n this.nIdx += 6;\n }\n\n /** Grow the CPU arrays so `vertices` / `indices` more fit. */\n private reserve(vertices: number, indices: number): void {\n const needVerts = (this.nVerts + vertices) * FLOATS_PER_VERTEX;\n if (needVerts > this.verts.length) {\n const grown = new Float32Array(doubledTo(this.verts.length, needVerts));\n grown.set(this.verts);\n this.verts = grown;\n }\n const needIdx = this.nIdx + indices;\n if (needIdx > this.idx.length) {\n const grown = new Uint32Array(doubledTo(this.idx.length, needIdx));\n grown.set(this.idx);\n this.idx = grown;\n }\n }\n\n private nextRingSlot(tier: number): BufferSet {\n const ring = this.rings[tier];\n const slot = this.nextInRing[tier];\n this.nextInRing[tier] = (slot + 1) % ring.length;\n const existing = ring[slot];\n if (existing) return existing;\n const set = this.createSet(BATCH_TIERS[tier].vertices, BATCH_TIERS[tier].indices);\n ring[slot] = set;\n return set;\n }\n\n private nextLargeSlot(): BufferSet {\n const gl = this.gl;\n const slot = this.nextLarge;\n this.nextLarge = (slot + 1) % SOLID_LARGE_RING_SIZE;\n let set = this.largeRing[slot];\n if (!set) {\n set = this.createSet(\n doubledTo(SOLID_RING_SLOT_VERTICES, this.nVerts),\n doubledTo(BATCH_TIERS[BATCH_TIERS.length - 1].indices, this.nIdx),\n );\n this.largeRing[slot] = set;\n return set;\n }\n if (this.nVerts > set.vertexCapacity) {\n set.vertexCapacity = doubledTo(set.vertexCapacity, this.nVerts);\n gl.bindBuffer(gl.ARRAY_BUFFER, set.vbo);\n gl.bufferData(gl.ARRAY_BUFFER, set.vertexCapacity * FLOATS_PER_VERTEX * 4, gl.DYNAMIC_DRAW);\n }\n if (this.nIdx > set.indexCapacity) {\n set.indexCapacity = doubledTo(set.indexCapacity, this.nIdx);\n gl.bindVertexArray(set.vao);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, set.ibo);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, set.indexCapacity * 4, gl.DYNAMIC_DRAW);\n gl.bindVertexArray(null);\n // Respecified, so whatever pattern it held is gone.\n set.canonicalQuads = 0;\n }\n return set;\n }\n\n private createSet(vertices: number, indices: number): BufferSet {\n const gl = this.gl;\n const vao = gl.createVertexArray();\n const vbo = gl.createBuffer();\n const ibo = gl.createBuffer();\n if (!vao || !vbo || !ibo) throw new Error('DrawBatch: failed to create GL objects');\n const stride = FLOATS_PER_VERTEX * 4;\n gl.bindVertexArray(vao);\n gl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n gl.bufferData(gl.ARRAY_BUFFER, vertices * stride, gl.DYNAMIC_DRAW);\n gl.enableVertexAttribArray(this.aPos);\n gl.vertexAttribPointer(this.aPos, 2, gl.FLOAT, false, stride, 0);\n gl.enableVertexAttribArray(this.aColor);\n gl.vertexAttribPointer(this.aColor, 4, gl.FLOAT, false, stride, 8);\n gl.enableVertexAttribArray(this.aUv);\n gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, stride, 24);\n gl.enableVertexAttribArray(this.aPost);\n gl.vertexAttribPointer(this.aPost, 1, gl.FLOAT, false, stride, 32);\n gl.enableVertexAttribArray(this.aSlot);\n gl.vertexAttribPointer(this.aSlot, 1, gl.FLOAT, false, stride, 36);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ibo);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices * 4, gl.DYNAMIC_DRAW);\n gl.bindVertexArray(null);\n return { vao, vbo, ibo, vertexCapacity: vertices, indexCapacity: indices, canonicalQuads: 0 };\n }\n\n private deleteSet(set: BufferSet): void {\n const gl = this.gl;\n gl.deleteBuffer(set.vbo);\n gl.deleteBuffer(set.ibo);\n gl.deleteVertexArray(set.vao);\n }\n}\n"],"mappings":";;;AAuCA,IAAaA,IAAyB,OAMzBC,IAAoB,IAK3BC,IAAmB,KACnBC,IAAkB,KAKXC,IAAU,IACVC,IAAU,IAiBjBC,IAAcC,EAASC,GAAYC,CAAgB,GAc5CC,IAAkB,IAclBC,IAAgE,CAC3E;CAAE,UAAU;CAAI,SAAS;AAAG,GAC5B;CAAE,UAAU;CAAM,SAAS;AAAK,CAClC,GAGaC,IAA2BD,EAAYA,EAAY,SAAS,EAAE,CAAC,UAK/DE,IAAwB;AAuBrC,SAASC,EAAU,GAAc,GAAsB;CACrD,IAAIC,IAAWC;CACf,OAAOD,IAAWE,IAAM,KAAY;CACpC,OAAOF;AACT;AAIA,SAASG,EAAY,GAA4B;CAC/C,IAAMC,IAAM,IAAI,YAAYC,IAAQ,CAAC;CACrC,KAAK,IAAIC,IAAI,GAAGA,IAAID,GAAO,KAAK;EAC9B,IAAME,IAAID,IAAI,GACRE,IAAIF,IAAI;EAEsB,AADpC,EAAIE,KAAKD,GAAG,EAAIC,IAAI,KAAKD,IAAI,GAAG,EAAIC,IAAI,KAAKD,IAAI,GAC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AChB;GAAE;GAAK;GAAK;GAAK,gBAAgBC;GAAU,eAAewE;GAAS,gBAAgB;EAAE;CAC9F;CAEA,UAAkB,GAAsB;EACtC,IAAMzE,IAAK,KAAK;EAGhB,AAFAA,EAAG,aAAayD,EAAI,GAAG,GACvBzD,EAAG,aAAayD,EAAI,GAAG,GACvBzD,EAAG,kBAAkByD,EAAI,GAAG;CAC9B;AACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region src/renderer/effects/EffectTargets.ts
|
|
2
|
-
var e = class {
|
|
3
|
-
gl;
|
|
4
|
-
all = [];
|
|
5
|
-
free = [];
|
|
6
|
-
width = 0;
|
|
7
|
-
height = 0;
|
|
8
|
-
constructor(e) {
|
|
9
|
-
this.gl = e;
|
|
10
|
-
}
|
|
11
|
-
get allocated() {
|
|
12
|
-
return this.all.length > 0;
|
|
13
|
-
}
|
|
14
|
-
acquire(e, t) {
|
|
15
|
-
(e !== this.width || t !== this.height) && (this.free = [], this.releaseAll(), this.width = e, this.height = t);
|
|
16
|
-
let n = this.free.pop();
|
|
17
|
-
if (n) return n;
|
|
18
|
-
let r = this.create(e, t);
|
|
19
|
-
return this.all.push(r), r;
|
|
20
|
-
}
|
|
21
|
-
release(e) {
|
|
22
|
-
this.free.push(e);
|
|
23
|
-
}
|
|
24
|
-
releaseAll() {
|
|
25
|
-
let e = this.gl;
|
|
26
|
-
for (let t of this.all) e.deleteFramebuffer(t.fbo), e.deleteTexture(t.texture), e.deleteRenderbuffer(t.stencil);
|
|
27
|
-
this.all.length = 0, this.free = [], this.width = 0, this.height = 0;
|
|
28
|
-
}
|
|
29
|
-
create(e, t) {
|
|
30
|
-
let n = this.gl, r = n.createTexture();
|
|
31
|
-
n.bindTexture(n.TEXTURE_2D, r), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA8, e, t, 0, n.RGBA, n.UNSIGNED_BYTE, null), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), n.bindTexture(n.TEXTURE_2D, null);
|
|
32
|
-
let i = n.createRenderbuffer();
|
|
33
|
-
n.bindRenderbuffer(n.RENDERBUFFER, i), n.renderbufferStorage(n.RENDERBUFFER, n.DEPTH24_STENCIL8, e, t), n.bindRenderbuffer(n.RENDERBUFFER, null);
|
|
34
|
-
let a = n.createFramebuffer();
|
|
35
|
-
return n.bindFramebuffer(n.FRAMEBUFFER, a), n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, r, 0), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.DEPTH_STENCIL_ATTACHMENT, n.RENDERBUFFER, i), n.bindFramebuffer(n.FRAMEBUFFER, null), {
|
|
36
|
-
fbo: a,
|
|
37
|
-
texture: r,
|
|
38
|
-
stencil: i
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
//#endregion
|
|
43
|
-
export { e as EffectTargets };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=EffectTargets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EffectTargets.js","names":["EffectTargets","gl","width","height","pooled","made","target","texture","stencil","fbo"],"sources":["../../../src/renderer/effects/EffectTargets.ts"],"sourcesContent":["/**\n * Offscreen colour buffers for effect passes, pooled per renderer.\n *\n * Nothing is allocated until a group with effects asks for one, so a canvas\n * with no effects pays nothing — which is the whole cost story for a feature\n * that would otherwise carry a device-resolution buffer per frame.\n *\n * Every target is the size of the drawing buffer. A group's effects run in\n * screen space, so a smaller buffer would have to reason about where the\n * group's content lands and how far a kernel reaches past it; that is a real\n * optimisation and not the first version of one.\n *\n * The stencil is the part that is easy to get wrong. Clips and even-odd fills\n * live in the stencil buffer, and an FBO does not inherit the default\n * framebuffer's — one without its own attachment renders even-odd paths with\n * their holes filled and clips that do not clip, with no GL error and nothing\n * in a call-sequence test to catch it. Every target here gets a\n * DEPTH24_STENCIL8 renderbuffer of its own.\n */\n\nexport interface EffectTarget {\n readonly fbo: WebGLFramebuffer;\n readonly texture: WebGLTexture;\n /** @internal — the pool's own bookkeeping. */\n readonly stencil: WebGLRenderbuffer;\n}\n\nexport class EffectTargets {\n private readonly gl: WebGL2RenderingContext;\n private readonly all: EffectTarget[] = [];\n private free: EffectTarget[] = [];\n private width = 0;\n private height = 0;\n\n constructor(gl: WebGL2RenderingContext) {\n this.gl = gl;\n }\n\n /** True once anything has been allocated — what a test asks instead of\n * reaching for the private arrays. */\n get allocated(): boolean {\n return this.all.length > 0;\n }\n\n /**\n * Borrow a target sized `width` × `height` device pixels. A size change\n * drops every pooled buffer rather than resizing in place: a borrowed one\n * cannot be resized under its holder, and a resize is not a per-frame event.\n */\n acquire(width: number, height: number): EffectTarget {\n if (width !== this.width || height !== this.height) {\n this.free = [];\n this.releaseAll();\n this.width = width;\n this.height = height;\n }\n const pooled = this.free.pop();\n if (pooled) return pooled;\n const made = this.create(width, height);\n this.all.push(made);\n return made;\n }\n\n /** Hand one back. Order does not matter — every target is interchangeable. */\n release(target: EffectTarget): void {\n this.free.push(target);\n }\n\n /** Drop every buffer. Called on dispose and on context loss, where the\n * handles are already invalid and only the bookkeeping has to go. */\n releaseAll(): void {\n const gl = this.gl;\n for (const t of this.all) {\n gl.deleteFramebuffer(t.fbo);\n gl.deleteTexture(t.texture);\n gl.deleteRenderbuffer(t.stencil);\n }\n this.all.length = 0;\n this.free = [];\n this.width = 0;\n this.height = 0;\n }\n\n private create(width: number, height: number): EffectTarget {\n const gl = this.gl;\n const texture = gl.createTexture()!;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n // LINEAR so an effect can sample between texels; CLAMP_TO_EDGE so a kernel\n // reaching past the edge repeats the border instead of wrapping the\n // opposite side of the screen into frame.\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n const stencil = gl.createRenderbuffer()!;\n gl.bindRenderbuffer(gl.RENDERBUFFER, stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, width, height);\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n const fbo = gl.createFramebuffer()!;\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencil);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return { fbo, texture, stencil };\n }\n}\n"],"mappings":";AA2BA,IAAaA,IAAb,MAA2B;CACzB;CACA,MAAuC,CAAC;CACxC,OAA+B,CAAC;CAChC,QAAgB;CAChB,SAAiB;CAEjB,YAAY,GAA4B;EACtC,KAAK,KAAKC;CACZ;CAIA,IAAI,YAAqB;EACvB,OAAO,KAAK,IAAI,SAAS;CAC3B;CAOA,QAAQ,GAAe,GAA8B;EACnD,CAAIC,MAAU,KAAK,SAASC,MAAW,KAAK,YAC1C,KAAK,OAAO,CAAC,GACb,KAAK,WAAW,GAChB,KAAK,QAAQD,GACb,KAAK,SAASC;EAEhB,IAAMC,IAAS,K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gBAAgBA,EAAG,aAAaQ,CAAG,GACtCR,EAAG,qBAAqBA,EAAG,aAAaA,EAAG,mBAAmBA,EAAG,YAAYM,GAAS,CAAC,GACvFN,EAAG,wBAAwBA,EAAG,aAAaA,EAAG,0BAA0BA,EAAG,cAAcO,CAAO,GAChGP,EAAG,gBAAgBA,EAAG,aAAa,IAAI,GAEhC;GAAE;GAAK;GAAS;EAAQ;CACjC;AACF"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { registerEffect as e } from "./types.js";
|
|
2
|
-
//#region src/renderer/effects/builtins.ts
|
|
3
|
-
var t = "#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform vec2 u_texel;\nuniform vec2 u_direction;\nuniform float u_radius;\nout vec4 outColor;\n\nvoid main() {\n // Nine taps on a Gaussian, spread across the requested radius. The weights\n // are a normalized binomial row, so a radius of 0 collapses to a copy.\n const float W[5] = float[5](0.2270270, 0.1945946, 0.1216216, 0.0540541, 0.0162162);\n vec2 step = u_direction * u_texel * (u_radius / 4.0);\n vec4 sum = texture(u_source, v_uv) * W[0];\n for (int i = 1; i < 5; i++) {\n vec2 off = step * float(i);\n sum += texture(u_source, v_uv + off) * W[i];\n sum += texture(u_source, v_uv - off) * W[i];\n }\n outColor = sum;\n}\n", n = "#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform float u_amount;\nuniform float u_feather;\nout vec4 outColor;\n\nvoid main() {\n vec4 src = texture(u_source, v_uv);\n float d = distance(v_uv, vec2(0.5)) * 1.41421356;\n float shade = 1.0 - u_amount * smoothstep(1.0 - u_feather, 1.0, d);\n // Premultiplied in, premultiplied out: scaling all four channels darkens\n // toward transparent black, which is what a vignette over a transparent\n // canvas should do.\n outColor = src * shade;\n}\n", r = e("weasel:blur", t), i = e("weasel:vignette", n);
|
|
4
|
-
function a({ radius: e }) {
|
|
5
|
-
return [{
|
|
6
|
-
program: r,
|
|
7
|
-
uniforms: {
|
|
8
|
-
u_direction: [1, 0],
|
|
9
|
-
u_radius: e
|
|
10
|
-
}
|
|
11
|
-
}, {
|
|
12
|
-
program: r,
|
|
13
|
-
uniforms: {
|
|
14
|
-
u_direction: [0, 1],
|
|
15
|
-
u_radius: e
|
|
16
|
-
}
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
function o({ amount: e, feather: t = .6 }) {
|
|
20
|
-
return [{
|
|
21
|
-
program: i,
|
|
22
|
-
uniforms: {
|
|
23
|
-
u_amount: e,
|
|
24
|
-
u_feather: t
|
|
25
|
-
}
|
|
26
|
-
}];
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { a as blur, o as vignette };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=builtins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.js","names":["BLUR_FRAG","VIGNETTE_FRAG","BLUR","registerEffect","VIGNETTE","blur","radius","vignette","amount","feather"],"sources":["../../../src/renderer/effects/builtins.ts"],"sourcesContent":["/**\n * Effects that ship with the kit.\n *\n * Each is a function returning `Effect[]`, not a single `Effect`, because a\n * separable kernel is genuinely two passes and hiding that behind one entry\n * would make the cost invisible at the callsite:\n *\n * effects={[...blur({ radius: 4 }), ...vignette({ amount: 0.6 })]}\n */\nimport type { Effect } from './types';\nimport { registerEffect } from './types';\n\nconst BLUR_FRAG = /* glsl */ `#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform vec2 u_texel;\nuniform vec2 u_direction;\nuniform float u_radius;\nout vec4 outColor;\n\nvoid main() {\n // Nine taps on a Gaussian, spread across the requested radius. The weights\n // are a normalized binomial row, so a radius of 0 collapses to a copy.\n const float W[5] = float[5](0.2270270, 0.1945946, 0.1216216, 0.0540541, 0.0162162);\n vec2 step = u_direction * u_texel * (u_radius / 4.0);\n vec4 sum = texture(u_source, v_uv) * W[0];\n for (int i = 1; i < 5; i++) {\n vec2 off = step * float(i);\n sum += texture(u_source, v_uv + off) * W[i];\n sum += texture(u_source, v_uv - off) * W[i];\n }\n outColor = sum;\n}\n`;\n\nconst VIGNETTE_FRAG = /* glsl */ `#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform float u_amount;\nuniform float u_feather;\nout vec4 outColor;\n\nvoid main() {\n vec4 src = texture(u_source, v_uv);\n float d = distance(v_uv, vec2(0.5)) * 1.41421356;\n float shade = 1.0 - u_amount * smoothstep(1.0 - u_feather, 1.0, d);\n // Premultiplied in, premultiplied out: scaling all four channels darkens\n // toward transparent black, which is what a vignette over a transparent\n // canvas should do.\n outColor = src * shade;\n}\n`;\n\nconst BLUR = registerEffect('weasel:blur', BLUR_FRAG);\nconst VIGNETTE = registerEffect('weasel:vignette', VIGNETTE_FRAG);\n\n/**\n * Gaussian blur, as a horizontal pass followed by a vertical one.\n *\n * `radius` is in device pixels and is the distance of the outermost tap, not a\n * standard deviation — 0 is a copy, and the falloff is the same nine-tap\n * kernel at every radius, so a large one is a wide blur rather than a better\n * one. Two passes at O(9) beat one at O(81) and look the same.\n */\nexport function blur({ radius }: { radius: number }): Effect[] {\n return [\n { program: BLUR, uniforms: { u_direction: [1, 0], u_radius: radius } },\n { program: BLUR, uniforms: { u_direction: [0, 1], u_radius: radius } },\n ];\n}\n\n/**\n * Darken toward the corners. `amount` is how dark the corner gets (0..1) and\n * `feather` how much of the radius the falloff occupies.\n */\nexport function vignette(\n { amount, feather = 0.6 }: { amount: number; feather?: number },\n): Effect[] {\n return [{ program: VIGNETTE, uniforms: { u_amount: amount, u_feather: feather } }];\n}\n"],"mappings":";;AAYA,IAAMA,IAAuB,kuBAwBvBC,IAA2B,miBAmB3BC,IAAOC,EAAe,eAAeH,CAAS,GAC9CI,IAAWD,EAAe,mBAAmBF,CAAa;AAUhE,SAAgBI,EAAK,EAAE,aAAwC;CAC7D,OAAO,CACL;EAAE,SAASH;EAAM,UAAU;GAAE,aAAa,CAAC,GAAG,CAAC;GAAG,UAAUI;EAAO;CAAE,GACrE;EAAE,SAASJ;EAAM,UAAU;GAAE,aAAa,CAAC,GAAG,CAAC;GAAG,UAAUI;EAAO;CAAE,CACvE;AACF;AAMA,SAAgBC,EACd,EAAE,WAAQ,aAAU,MACV;CACV,OAAO,CAAC;EAAE,SAASH;EAAU,UAAU;GAAE,UAAUI;GAAQ,WAAWC;EAAQ;CAAE,CAAC;AACnF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { registerProgram as e } from "../shaders/registerProgram.js";
|
|
2
|
-
import { COMPOSITE_FRAG_SRC as t, EFFECT_VERT_SRC as n } from "./effectPrelude.js";
|
|
3
|
-
//#region src/renderer/effects/composite.ts
|
|
4
|
-
var r = "weasel:effect-composite";
|
|
5
|
-
e(r, n, t);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { r as COMPOSITE_PROGRAM_ID };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=composite.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composite.js","names":["COMPOSITE_PROGRAM_ID","registerProgram","EFFECT_VERT_SRC","COMPOSITE_FRAG_SRC"],"sources":["../../../src/renderer/effects/composite.ts"],"sourcesContent":["/**\n * The pass that puts a group's finished texture back into its parent, and the\n * shared mechanics every effect pass uses to draw a full-screen quad.\n *\n * Registered as an ordinary program so it compiles through the same\n * `ensureProgram` path a consumer's effect does — one compile path, one place\n * a compile failure is reported.\n */\nimport { registerProgram } from '../shaders/registerProgram';\nimport { EFFECT_VERT_SRC, COMPOSITE_FRAG_SRC } from './effectPrelude';\n\n/** Reserved id. The `weasel:` prefix is not enforced anywhere; it is here so a\n * consumer reading a shader-compile error knows whose program it is. */\nexport const COMPOSITE_PROGRAM_ID = 'weasel:effect-composite';\n\nregisterProgram(COMPOSITE_PROGRAM_ID, EFFECT_VERT_SRC, COMPOSITE_FRAG_SRC);\n"],"mappings":";;;AAaA,IAAaA,IAAuB;AAEpCC,EAAgBD,GAAsBE,GAAiBC,CAAkB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region src/renderer/effects/effectPrelude.ts
|
|
2
|
-
var e = "#version 300 es\nin vec2 a_position;\nin vec2 a_uv;\nout vec2 v_uv;\n\nvoid main() {\n v_uv = a_uv;\n gl_Position = vec4(a_position, 0.0, 1.0);\n}\n", t = [
|
|
3
|
-
"u_source",
|
|
4
|
-
"u_resolution",
|
|
5
|
-
"u_texel"
|
|
6
|
-
], n = "#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform float u_alpha;\nuniform mat4 u_colorMatrix;\nuniform vec4 u_colorBias;\nout vec4 outColor;\n\nvoid main() {\n vec4 src = texture(u_source, v_uv);\n // Undo premultiplication before the colour matrix, which is defined on\n // straight alpha, then put it back for the blend.\n float a = src.a;\n vec3 rgb = a > 0.0 ? src.rgb / a : vec3(0.0);\n vec4 c = u_colorMatrix * vec4(rgb, a) + u_colorBias;\n c.a *= u_alpha;\n outColor = vec4(clamp(c.rgb, 0.0, 1.0) * c.a, c.a);\n}\n";
|
|
7
|
-
//#endregion
|
|
8
|
-
export { n as COMPOSITE_FRAG_SRC, t as EFFECT_KIT_UNIFORMS, e as EFFECT_VERT_SRC };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=effectPrelude.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"effectPrelude.js","names":["EFFECT_VERT_SRC","EFFECT_KIT_UNIFORMS","COMPOSITE_FRAG_SRC"],"sources":["../../../src/renderer/effects/effectPrelude.ts"],"sourcesContent":["/**\n * Kit-supplied vertex shader for a full-screen effect pass.\n *\n * Distinct from `CUSTOM_VERT_SRC` on purpose. That one places its quad through\n * `u_bounds` and `u_proj`, so its `v_uv` runs top-down in *screen* space; an\n * effect samples a texture the scene was just rendered into, whose v axis runs\n * the other way. Passing `a_position` straight to `gl_Position` and `a_uv`\n * straight out keeps the two aligned — `QUAD_VERTICES` already carries\n * `a_uv == (a_position + 1) / 2` on both axes.\n *\n * PUBLIC CONTRACT — what every effect fragment shader may read:\n *\n * in vec2 v_uv 0..1 across the source texture\n * uniform sampler2D u_source what has been drawn so far\n * uniform vec2 u_resolution source size in device pixels\n * uniform vec2 u_texel 1.0 / u_resolution — one texel step\n *\n * PREMULTIPLIED ALPHA: `u_source` holds premultiplied RGBA, because that is\n * what the scene blends into it. An effect that weights neighbouring samples\n * (a blur) is doing the right thing on premultiplied values; one that\n * manipulates rgb against a must premultiply its own output the same way the\n * custom-shader prelude requires.\n */\nexport const EFFECT_VERT_SRC = /* glsl */ `#version 300 es\nin vec2 a_position;\nin vec2 a_uv;\nout vec2 v_uv;\n\nvoid main() {\n v_uv = a_uv;\n gl_Position = vec4(a_position, 0.0, 1.0);\n}\n`;\n\n/** Attribute names the effect vertex shader binds. Same layout as the custom\n * prelude's, so `QUAD_VERTICES` serves both. */\nexport const EFFECT_ATTRIBUTES = ['a_position', 'a_uv'] as const;\n\n/** Uniforms the renderer sets on every effect pass. An effect must not\n * redeclare them with different meanings; it may leave any of them out. */\nexport const EFFECT_KIT_UNIFORMS = ['u_source', 'u_resolution', 'u_texel'] as const;\n\n/** The pass that puts a group's finished texture back into its parent. Not an\n * effect — no consumer registers it — but it runs on the same quad and the\n * same vertex shader. `u_alpha` and the colour matrix are the parent group's,\n * applied here rather than inside the offscreen render, so an effect samples\n * the group's own pixels rather than pixels the parent has already faded. */\nexport const COMPOSITE_FRAG_SRC = /* glsl */ `#version 300 es\nprecision highp float;\nin vec2 v_uv;\nuniform sampler2D u_source;\nuniform float u_alpha;\nuniform mat4 u_colorMatrix;\nuniform vec4 u_colorBias;\nout vec4 outColor;\n\nvoid main() {\n vec4 src = texture(u_source, v_uv);\n // Undo premultiplication before the colour matrix, which is defined on\n // straight alpha, then put it back for the blend.\n float a = src.a;\n vec3 rgb = a > 0.0 ? src.rgb / a : vec3(0.0);\n vec4 c = u_colorMatrix * vec4(rgb, a) + u_colorBias;\n c.a *= u_alpha;\n outColor = vec4(clamp(c.rgb, 0.0, 1.0) * c.a, c.a);\n}\n`;\n"],"mappings":";AAuBA,IAAaA,IAA6B,0JAiB7BC,IAAsB;CAAC;CAAY;CAAgB;AAAS,GAO5DC,IAAgC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { registerProgram as e } from "../shaders/registerProgram.js";
|
|
2
|
-
import { EFFECT_VERT_SRC as t } from "./effectPrelude.js";
|
|
3
|
-
//#region src/renderer/effects/types.ts
|
|
4
|
-
function n(n, r) {
|
|
5
|
-
return e(n, t, r);
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { n as registerEffect };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["registerEffect","registerProgram","id","EFFECT_VERT_SRC","frag"],"sources":["../../../src/renderer/effects/types.ts"],"sourcesContent":["import { registerProgram, type ShaderProgramHandle, type ShaderUniform } from '../shaders/registerProgram';\nimport { EFFECT_VERT_SRC } from './effectPrelude';\n\n/**\n * One full-screen pass over what a group has already drawn.\n *\n * The renderer runs a group's effects in order, each reading the previous\n * one's output through `u_source` and writing a whole new buffer — so an\n * effect is free to read neighbouring pixels, which is the entire point and\n * the one thing `colorMatrix` can never do.\n *\n * `uniforms` are the effect's own; `u_source`, `u_resolution` and `u_texel`\n * come from the renderer and must not be passed here.\n */\nexport interface Effect {\n program: ShaderProgramHandle;\n uniforms?: Record<string, ShaderUniform>;\n}\n\n/**\n * Register a fragment shader as an effect. Sugar over `registerProgram` with\n * the effect vertex shader, and the reason a consumer never imports the\n * prelude: an effect that registers with the *custom-shader* vertex shader\n * compiles, runs, and samples its source upside down.\n *\n * The fragment shader reads `v_uv` and `u_source`, and may declare\n * `u_resolution` / `u_texel`. See `effectPrelude.ts` for the full contract,\n * including the premultiplied-alpha requirement.\n *\n * @experimental\n */\nexport function registerEffect(id: string, frag: string): ShaderProgramHandle {\n return registerProgram(id, EFFECT_VERT_SRC, frag);\n}\n"],"mappings":";;;AA+BA,SAAgBA,EAAe,GAAY,GAAmC;CAC5E,OAAOC,EAAgBC,GAAIC,GAAiBC,CAAI;AAClD"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { strokeSpaceOf as e } from "../features/paths/tessellate/metric.js";
|
|
2
|
-
import { quantizeStrokeScale as t } from "./cache/strokeMeshCache.js";
|
|
3
|
-
import { outlineMesh as n } from "./cache/outlineMeshCache.js";
|
|
4
|
-
import { outlineStrokeMesh as r, quantizeEmWidth as i } from "./cache/outlineStrokeMeshCache.js";
|
|
5
|
-
import { SYNTHETIC_ITALIC_RADIANS as a } from "./syntheticItalic.js";
|
|
6
|
-
//#region src/renderer/glyphOutlineMesh.ts
|
|
7
|
-
function o(e, t, r) {
|
|
8
|
-
return l(e, t, r, (e) => n(e.key, e.d));
|
|
9
|
-
}
|
|
10
|
-
function s(n, a, o, s) {
|
|
11
|
-
let u = n.stroke;
|
|
12
|
-
if (!u) return null;
|
|
13
|
-
let d = u.width ?? 1;
|
|
14
|
-
if (typeof d == "object") {
|
|
15
|
-
if (!(d.px > 0)) return null;
|
|
16
|
-
let i = c(n), [f, p, m, h] = [
|
|
17
|
-
s[0],
|
|
18
|
-
s[1],
|
|
19
|
-
s[3],
|
|
20
|
-
s[4]
|
|
21
|
-
];
|
|
22
|
-
return l(n, a, o, (n) => {
|
|
23
|
-
if (!(n.scale > 0)) return null;
|
|
24
|
-
let a = n.scale, o = e(a * f, a * p, a * (m - f * i), a * (h - p * i)), s = t(d.px, o.scale);
|
|
25
|
-
if (!(s > 0)) return null;
|
|
26
|
-
let c = u.dash?.map((e) => e / s);
|
|
27
|
-
return r(n.key, n.d, d.px / s, {
|
|
28
|
-
...u,
|
|
29
|
-
dash: c
|
|
30
|
-
}, o.metric ?? void 0);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return d > 0 ? l(n, a, o, (e) => e.scale > 0 ? r(e.key, e.d, i(d / e.scale), {
|
|
34
|
-
...u,
|
|
35
|
-
dash: u.dash?.map((t) => t / e.scale)
|
|
36
|
-
}) : null) : null;
|
|
37
|
-
}
|
|
38
|
-
var c = (e) => e.synthetic.italic ? Math.tan(a) : 0;
|
|
39
|
-
function l(e, t, n, r) {
|
|
40
|
-
let i = [], a = 0, o = 0;
|
|
41
|
-
for (let t of e.glyphs) {
|
|
42
|
-
let e = r(t);
|
|
43
|
-
e && e.indices.length !== 0 && (i.push({
|
|
44
|
-
mesh: e,
|
|
45
|
-
glyph: t
|
|
46
|
-
}), a += e.vertices.length, o += e.indices.length);
|
|
47
|
-
}
|
|
48
|
-
if (i.length === 0) return null;
|
|
49
|
-
let s = c(e), l = new Float32Array(a), u = new Uint32Array(o), d = 0, f = 0, p = 0;
|
|
50
|
-
for (let { mesh: e, glyph: r } of i) {
|
|
51
|
-
let { x: i, baselineY: a, scale: o } = r;
|
|
52
|
-
for (let r = 0; r < e.vertices.length; r += 2) {
|
|
53
|
-
let c = e.vertices[r], u = e.vertices[r + 1];
|
|
54
|
-
l[d++] = i + t + (c - u * s) * o, l[d++] = a + n + u * o;
|
|
55
|
-
}
|
|
56
|
-
for (let t = 0; t < e.indices.length; t++) u[f++] = p + e.indices[t];
|
|
57
|
-
p += e.vertices.length / 2;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
vertices: l,
|
|
61
|
-
indices: u
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
export { o as outlineGroupMesh, s as outlineGroupStrokeMesh };
|
|
66
|
-
|
|
67
|
-
//# sourceMappingURL=glyphOutlineMesh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glyphOutlineMesh.js","names":["outlineGroupMesh","mergeGlyphMeshes","group","dx","dy","outlineMesh","glyph","outlineGroupStrokeMesh","stroke","width","shear","shearOf","a","b","c","d","transform","s","space","strokeSpaceOf","pxPerEm","quantizeStrokeScale","dash","v","outlineStrokeMesh","quantizeEmWidth","SYNTHETIC_ITALIC_RADIANS","parts","vertexFloats","indexCount","mesh","meshFor","vertices","indices","vi","ii","base","k","ex","ey","x","scale","baselineY"],"sources":["../../src/renderer/glyphOutlineMesh.ts"],"sourcesContent":["/**\n * Glyph outlines as world-space meshes: each glyph's em-space fill or stroke\n * mesh, placed and concatenated so a run of outlined text is one draw.\n */\nimport type { Mesh } from '@weasel-js/geom/tessellate';\nimport type { LaidOutGroup, LaidOutOutlineGlyph } from '@weasel-js/text';\nimport { strokeSpaceOf } from 'features/paths/tessellate/metric';\nimport type { GlMat3 } from './math/mat3';\nimport { quantizeStrokeScale } from './cache/strokeMeshCache';\nimport { outlineMesh } from './cache/outlineMeshCache';\nimport { outlineStrokeMesh, quantizeEmWidth } from './cache/outlineStrokeMeshCache';\nimport { SYNTHETIC_ITALIC_RADIANS } from './syntheticItalic';\n\n/**\n * Merge a group's glyphs into one world-space mesh, or `null` when nothing in\n * it has area.\n *\n * Every glyph mesh here is `'nonzero'` (that is what `pathFromD` produces and\n * what a font outline means), so none of them sets `requiresStencil` and\n * concatenating their triangles is sound — an even-odd mesh would be a naive\n * per-contour fan that only resolves correctly through a stencil pass, and\n * merging one into a batch would fill its counters solid.\n */\nexport function outlineGroupMesh(group: LaidOutGroup, dx: number, dy: number): Mesh | null {\n return mergeGlyphMeshes(group, dx, dy, (glyph) => outlineMesh(glyph.key, glyph.d));\n}\n\n/**\n * The same merge for the group's stroke: one ribbon per glyph, tessellated in\n * em space and batched into one buffer, so a stroked paragraph is one extra\n * draw call rather than one per glyph.\n *\n * A world width crosses into em space by dividing by the glyph's `scale`,\n * which is world units per em — so `stroke.width` stays a world-unit measure\n * and does not grow with `fontSize`, matching every other stroke in the kit.\n * Dashes cross with it.\n *\n * A synthetic oblique shears a world-width ribbon along with the glyph. That\n * is a real (small) distortion — a sheared circle is an ellipse, so the\n * outline is marginally thicker across the lean than along it — and it is\n * deliberate: shearing the finished ribbon is what keeps the outline glued to\n * the glyph it outlines, which re-tessellating in sheared space would not.\n *\n * A `{ px }` ribbon is built in the stretch of the whole em-to-screen map,\n * shear included, as a path's is in its transform's (see `metric.ts`), so it\n * is that many pixels wide in every direction on every glyph.\n */\nexport function outlineGroupStrokeMesh(\n group: LaidOutGroup,\n dx: number,\n dy: number,\n transform: GlMat3,\n): Mesh | null {\n const stroke = group.stroke;\n if (!stroke) return null;\n const width = stroke.width ?? 1;\n if (typeof width === 'object') {\n if (!(width.px > 0)) return null;\n const shear = shearOf(group);\n const [a, b, c, d] = [transform[0], transform[1], transform[3], transform[4]];\n return mergeGlyphMeshes(group, dx, dy, (glyph) => {\n if (!(glyph.scale > 0)) return null;\n const s = glyph.scale;\n const space = strokeSpaceOf(s * a, s * b, s * (c - a * shear), s * (d - b * shear));\n const pxPerEm = quantizeStrokeScale(width.px, space.scale);\n if (!(pxPerEm > 0)) return null;\n const dash = stroke.dash?.map((v) => v / pxPerEm);\n return outlineStrokeMesh(\n glyph.key, glyph.d, width.px / pxPerEm, { ...stroke, dash }, space.metric ?? undefined,\n );\n });\n }\n if (!(width > 0)) return null;\n return mergeGlyphMeshes(group, dx, dy, (glyph) =>\n glyph.scale > 0\n ? outlineStrokeMesh(\n glyph.key, glyph.d, quantizeEmWidth(width / glyph.scale),\n { ...stroke, dash: stroke.dash?.map((v) => v / glyph.scale) },\n )\n : null);\n}\n\nconst shearOf = (group: LaidOutGroup): number =>\n group.synthetic.italic ? Math.tan(SYNTHETIC_ITALIC_RADIANS) : 0;\n\n/**\n * Transform each glyph's em-space mesh into world space and concatenate.\n * Shared by the fill and stroke paths, which differ only in which mesh they\n * ask for per glyph — the placement math must not fork, or an outline would\n * drift off the glyph it outlines.\n */\nfunction mergeGlyphMeshes(\n group: LaidOutGroup,\n dx: number,\n dy: number,\n meshFor: (glyph: LaidOutOutlineGlyph) => Mesh | null,\n): Mesh | null {\n const parts: { mesh: Mesh; glyph: LaidOutOutlineGlyph }[] = [];\n let vertexFloats = 0;\n let indexCount = 0;\n for (const glyph of group.glyphs) {\n const mesh = meshFor(glyph);\n if (!mesh || mesh.indices.length === 0) continue;\n parts.push({ mesh, glyph });\n vertexFloats += mesh.vertices.length;\n indexCount += mesh.indices.length;\n }\n if (parts.length === 0) return null;\n\n // Matches the SDF vertex shader's skew exactly: x moves by\n // `(baselineY - y) * tan(angle)`, and in em space `baselineY - y` is\n // `-ey * scale`, so above-baseline vertices (negative ey) lean right.\n const shear = shearOf(group);\n\n const vertices = new Float32Array(vertexFloats);\n const indices = new Uint32Array(indexCount);\n let vi = 0;\n let ii = 0;\n let base = 0;\n for (const { mesh, glyph } of parts) {\n const { x, baselineY, scale } = glyph;\n for (let k = 0; k < mesh.vertices.length; k += 2) {\n const ex = mesh.vertices[k];\n const ey = mesh.vertices[k + 1];\n vertices[vi++] = x + dx + (ex - ey * shear) * scale;\n vertices[vi++] = baselineY + dy + ey * scale;\n }\n for (let k = 0; k < mesh.indices.length; k++) indices[ii++] = base + mesh.indices[k];\n base += mesh.vertices.length / 2;\n }\n return { vertices, indices };\n}\n"],"mappings":";;;;;;AAuBA,SAAgBA,EAAiB,GAAqB,GAAY,GAAyB;CACzF,OAAOC,EAAiBC,GAAOC,GAAIC,IAAK,MAAUC,EAAYC,EAAM,KAAKA,EAAM,CAAC,CAAC;AACnF;AAsBA,SAAgBC,EACd,GACA,GACA,GACA,GACa;CACb,IAAMC,IAASN,EAAM;CACrB,IAAI,CAACM,GAAQ,OAAO;CACpB,IAAMC,IAAQD,EAAO,SAAS;CAC9B,IAAI,OAAOC,KAAU,UAAU;EAC7B,IAAI,EAAEA,EAAM,KAAK,IAAI,OAAO;EAC5B,IAAMC,IAAQC,EAAQT,CAAK,GACrB,CAACU,GAAGC,GAAGC,GAAGC,KAAK;GAACC,EAAU;GAAIA,EAAU;GAAIA,EAAU;GAAIA,EAAU;EAAE;EAC5E,OAAOf,EAAiBC,GAAOC,GAAIC,IAAK,MAAU;GAChD,IAAI,EAAEE,EAAM,QAAQ,IAAI,OAAO;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,IAAK,GACLC,IAAO;CACX,KAAK,IAAM,EAAE,SAAM,cAAWT,GAAO;EACnC,IAAM,EAAE,MAAG,cAAW,aAAUrB;EAChC,KAAK,IAAI+B,IAAI,GAAGA,IAAIP,EAAK,SAAS,QAAQ,KAAK,GAAG;GAChD,IAAMQ,IAAKR,EAAK,SAASO,IACnBE,IAAKT,EAAK,SAASO,IAAI;GAE7B,AADA,EAAS,OAAQG,IAAIrC,KAAMmC,IAAKC,IAAK7B,KAAS+B,GAC9C,EAAS,OAAQC,IAAYtC,IAAKmC,IAAKE;EACzC;EACA,KAAK,IAAIJ,IAAI,GAAGA,IAAIP,EAAK,QAAQ,QAAQ,KAAK,EAAQ,OAAQM,IAAON,EAAK,QAAQO;EAClF,KAAQP,EAAK,SAAS,SAAS;CACjC;CACA,OAAO;EAAE;EAAU;CAAQ;AAC7B"}
|
package/dist/renderer/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ShaderCompileError as e } from "./shaders/ShaderProgram.js";
|
|
2
|
-
import { buildGradientRamp as t } from "./cache/GradientRampAtlas.js";
|
|
3
|
-
import { mat3 as n } from "./math/mat3.js";
|
|
4
|
-
import { IDENTITY_COLOR_MATRIX as r } from "./state/GroupState.js";
|
|
5
|
-
import { registerTexture as i, textureRegistry as a } from "./textures/registerTexture.js";
|
|
6
|
-
import { programSourceRegistry as o, registerProgram as s } from "./shaders/registerProgram.js";
|
|
7
|
-
import { SPRITE_STRIDE as c } from "./DrawCommand.js";
|
|
8
|
-
import { tessellateStroke as l } from "../features/paths/tessellate/stroke.js";
|
|
9
|
-
import { EFFECT_KIT_UNIFORMS as u, EFFECT_VERT_SRC as d } from "./effects/effectPrelude.js";
|
|
10
|
-
import { OUTLINE_MIN_SCREEN_PX as f } from "./draw.js";
|
|
11
|
-
import { WeaselRenderer as p } from "./WeaselRenderer.js";
|
|
12
|
-
import { frameRect as m } from "./spriteSheet.js";
|
|
13
|
-
import { viewToMat3 as h } from "./math/viewToMat3.js";
|
|
14
|
-
import { cullDrawCommands as g } from "./cullDrawCommands.js";
|
|
15
|
-
import { registerEffect as _ } from "./effects/types.js";
|
|
16
|
-
import { blur as v, vignette as y } from "./effects/builtins.js";
|
|
17
|
-
import { canQueryLocalFonts as b, cssFontFamily as x, cssFontFamilyLoading as S, enableLocalFontOutlines as C, fontOutlineRegistry as w, fontRegistry as T, hasFontOutlines as E, isCanvasFont as D, listFontOutlines as O, loadFontOutlines as k, outlineStatus as A, registerCanvasFont as j, registerFont as M, registerFontOutlines as N, subscribeGlyphReady as P, unregisterCanvasFont as F, unregisterFontOutlines as I } from "@weasel-js/font";
|
|
18
|
-
import { tessellate as L } from "@weasel-js/geom/tessellate";
|
|
19
|
-
export { u as EFFECT_KIT_UNIFORMS, d as EFFECT_VERT_SRC, r as IDENTITY_COLOR_MATRIX, f as OUTLINE_MIN_SCREEN_PX, c as SPRITE_STRIDE, e as ShaderCompileError, p as WeaselRenderer, v as blur, t as buildGradientRamp, b as canQueryLocalFonts, x as cssFontFamily, S as cssFontFamilyLoading, g as cullDrawCommands, C as enableLocalFontOutlines, w as fontOutlineRegistry, T as fontRegistry, m as frameRect, E as hasFontOutlines, D as isCanvasFont, O as listFontOutlines, k as loadFontOutlines, n as mat3, A as outlineStatus, o as programSourceRegistry, j as registerCanvasFont, _ as registerEffect, M as registerFont, N as registerFontOutlines, s as registerProgram, i as registerTexture, P as subscribeGlyphReady, L as tessellate, l as tessellateStroke, a as textureRegistry, F as unregisterCanvasFont, I as unregisterFontOutlines, h as viewToMat3, y as vignette };
|