@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
package/dist/renderer/draw.js
DELETED
|
@@ -1,1135 +0,0 @@
|
|
|
1
|
-
import { createPaintResources as e } from "./paintResources.js";
|
|
2
|
-
import { BATCH_TEXTURE_SLOTS as t, PAINT_MODE_CONIC as n, PAINT_MODE_PLAIN as r, PAINT_MODE_RADIAL as i } from "./shaders/batchFill.js";
|
|
3
|
-
import { resolveColor as a } from "./math/color.js";
|
|
4
|
-
import { mat3 as o } from "./math/mat3.js";
|
|
5
|
-
import { IDENTITY_COLOR_MATRIX as s } from "./state/GroupState.js";
|
|
6
|
-
import { getTexture as c } from "./textures/registerTexture.js";
|
|
7
|
-
import { getPaintKind as l } from "../core/paintKinds.js";
|
|
8
|
-
import { SPRITE_STRIDE as u } from "./DrawCommand.js";
|
|
9
|
-
import { patternTileSpace as d } from "./math/patternSpace.js";
|
|
10
|
-
import { getMesh as f } from "./cache/cache.js";
|
|
11
|
-
import { metricKeepsRects as p } from "../features/paths/tessellate/metric.js";
|
|
12
|
-
import { resolveStrokeWidth as m } from "../features/paths/tessellate/stroke.js";
|
|
13
|
-
import { strokeMesh as h } from "./cache/strokeMeshCache.js";
|
|
14
|
-
import { SYNTHETIC_ITALIC_RADIANS as g } from "./syntheticItalic.js";
|
|
15
|
-
import { outlineGroupMesh as _, outlineGroupStrokeMesh as v } from "./glyphOutlineMesh.js";
|
|
16
|
-
import { resolveStrokeLengths as y } from "./strokeLengths.js";
|
|
17
|
-
import { cachedMarkerCommands as b } from "./cache/markerCommandCache.js";
|
|
18
|
-
import { axisAlignedClipRect as ee, intersectClipRects as x } from "./batchClip.js";
|
|
19
|
-
import { COMPOSITE_PROGRAM_ID as S } from "./effects/composite.js";
|
|
20
|
-
import { GLYPH_MODE_MSDF as te, GLYPH_MODE_R8 as ne, dynamicPageTextureId as re, ensureFontTexture as ie, glyphFieldScale as ae, syncDynamicPageTexture as oe, textureCacheKey as se } from "@weasel-js/font";
|
|
21
|
-
import { cachedLayoutRuns as ce, resolveTextStyle as le, verticalAlignOffset as ue } from "@weasel-js/text";
|
|
22
|
-
import { tessellate as de } from "@weasel-js/geom/tessellate";
|
|
23
|
-
//#region src/renderer/draw.ts
|
|
24
|
-
function C(e, t, n) {
|
|
25
|
-
e.gl.drawElements(e.gl.TRIANGLES, t, n, 0), e.stats && e.stats.drawCalls++;
|
|
26
|
-
}
|
|
27
|
-
var fe = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap();
|
|
28
|
-
function w(e, t) {
|
|
29
|
-
let n = fe.get(e);
|
|
30
|
-
n || (n = /* @__PURE__ */ new WeakMap(), fe.set(e, n));
|
|
31
|
-
let r = n.get(t);
|
|
32
|
-
return r || (r = {}, n.set(t, r)), r;
|
|
33
|
-
}
|
|
34
|
-
function T(e, t) {
|
|
35
|
-
if (e === void 0 || e.length !== t.length) return !1;
|
|
36
|
-
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
37
|
-
return !0;
|
|
38
|
-
}
|
|
39
|
-
function me(e, t, n, r, i, a) {
|
|
40
|
-
let o = t.uniform("u_color");
|
|
41
|
-
if (o === void 0) return;
|
|
42
|
-
let s = w(e, t), c = s.color;
|
|
43
|
-
(c === void 0 || c[0] !== n || c[1] !== r || c[2] !== i || c[3] !== a) && (e.gl.uniform4f(o, n, r, i, a), s.color = [
|
|
44
|
-
n,
|
|
45
|
-
r,
|
|
46
|
-
i,
|
|
47
|
-
a
|
|
48
|
-
]);
|
|
49
|
-
}
|
|
50
|
-
function E(e, t, n) {
|
|
51
|
-
let r = t.uniform("u_alpha");
|
|
52
|
-
if (r === void 0) return;
|
|
53
|
-
let i = w(e, t);
|
|
54
|
-
i.alpha !== n && (e.gl.uniform1f(r, n), i.alpha = n);
|
|
55
|
-
}
|
|
56
|
-
var D = o.identity();
|
|
57
|
-
function he(e) {
|
|
58
|
-
let t = pe.get(e);
|
|
59
|
-
return t || (t = o.screenToClip(e.widthCss, e.heightCss), pe.set(e, t)), t;
|
|
60
|
-
}
|
|
61
|
-
var O = /* @__PURE__ */ new Float32Array(16);
|
|
62
|
-
function k(e, t, n = e.state.colorMatrix) {
|
|
63
|
-
let r = e.gl, i = w(e, t), a = t.uniform("u_colorMatrix");
|
|
64
|
-
if (a !== void 0) {
|
|
65
|
-
for (let e = 0; e < 4; e++) for (let t = 0; t < 4; t++) O[t * 4 + e] = n[e * 5 + t];
|
|
66
|
-
T(i.colorMatrix, O) || (r.uniformMatrix4fv(a, !1, O), i.colorMatrix = Float32Array.from(O));
|
|
67
|
-
}
|
|
68
|
-
let o = t.uniform("u_colorBias");
|
|
69
|
-
if (o !== void 0) {
|
|
70
|
-
let e = [
|
|
71
|
-
n[4],
|
|
72
|
-
n[9],
|
|
73
|
-
n[14],
|
|
74
|
-
n[19]
|
|
75
|
-
];
|
|
76
|
-
T(i.colorBias, e) || (r.uniform4f(o, e[0], e[1], e[2], e[3]), i.colorBias = Float32Array.from(e));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function ge(e, t) {
|
|
80
|
-
return e.flattenTolerance === void 0 ? f(t) : de(t, { flattenTolerance: e.flattenTolerance });
|
|
81
|
-
}
|
|
82
|
-
function _e(e, t) {
|
|
83
|
-
return e.flattenTolerance === void 0 ? e.meshCache.handleFor(t) : e.meshCache.uploadTransient(t);
|
|
84
|
-
}
|
|
85
|
-
function ve(e, t) {
|
|
86
|
-
return _e(e, ge(e, t));
|
|
87
|
-
}
|
|
88
|
-
function A(e, t) {
|
|
89
|
-
switch (t.kind) {
|
|
90
|
-
case "group": return Ae(e, t);
|
|
91
|
-
case "path": return Fe(e, t);
|
|
92
|
-
case "text": return Dt(e, t);
|
|
93
|
-
case "image": return Vt(e, t);
|
|
94
|
-
case "sprites": return Ht(e, t);
|
|
95
|
-
case "shader": return F(e), Ee(e, t);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
var ye = /* @__PURE__ */ new Set();
|
|
99
|
-
function be(e, t) {
|
|
100
|
-
let n = `${e}:${t}`;
|
|
101
|
-
ye.has(n) || (ye.add(n), (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel drawShader: uniform "${t}" not found in program "${e}". Check spelling, ensure it's used in the shader (unused uniforms are optimized away by the driver).`));
|
|
102
|
-
}
|
|
103
|
-
function xe(e, t, n, r, i) {
|
|
104
|
-
if (typeof n == "object" && n && !Array.isArray(n) && !(n instanceof Float32Array) && "id" in n && typeof n.id == "string") {
|
|
105
|
-
let a = n, o = c(a.id);
|
|
106
|
-
if (!o) {
|
|
107
|
-
(typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel setUniform: TextureHandle "${a.id}" not registered`);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
let s = i.value++;
|
|
111
|
-
r.upload(a.id, o.source), r.bind(a.id, s), e.uniform1i(t, s);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (n instanceof Float32Array) {
|
|
115
|
-
if (n.length === 9) e.uniformMatrix3fv(t, !1, n);
|
|
116
|
-
else if (n.length === 16) e.uniformMatrix4fv(t, !1, n);
|
|
117
|
-
else if (typeof process > "u" || process.env.NODE_ENV !== "production") throw TypeError(`weasel setUniform: Float32Array must be length 9 (mat3) or 16 (mat4), got ${n.length}`);
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (Array.isArray(n)) {
|
|
121
|
-
let r = n;
|
|
122
|
-
switch (r.length) {
|
|
123
|
-
case 2:
|
|
124
|
-
e.uniform2fv(t, r);
|
|
125
|
-
break;
|
|
126
|
-
case 3:
|
|
127
|
-
e.uniform3fv(t, r);
|
|
128
|
-
break;
|
|
129
|
-
case 4:
|
|
130
|
-
e.uniform4fv(t, r);
|
|
131
|
-
break;
|
|
132
|
-
default: if (typeof process > "u" || process.env.NODE_ENV !== "production") throw TypeError(`weasel setUniform: array length ${r.length} not supported`);
|
|
133
|
-
}
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (typeof n == "number") {
|
|
137
|
-
e.uniform1f(t, n);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
var Se = {
|
|
142
|
-
float: {
|
|
143
|
-
fn: "uniform1fv",
|
|
144
|
-
n: 1
|
|
145
|
-
},
|
|
146
|
-
vec2: {
|
|
147
|
-
fn: "uniform2fv",
|
|
148
|
-
n: 2
|
|
149
|
-
},
|
|
150
|
-
vec3: {
|
|
151
|
-
fn: "uniform3fv",
|
|
152
|
-
n: 3
|
|
153
|
-
},
|
|
154
|
-
vec4: {
|
|
155
|
-
fn: "uniform4fv",
|
|
156
|
-
n: 4
|
|
157
|
-
},
|
|
158
|
-
int: {
|
|
159
|
-
fn: "uniform1iv",
|
|
160
|
-
n: 1
|
|
161
|
-
},
|
|
162
|
-
ivec2: {
|
|
163
|
-
fn: "uniform2iv",
|
|
164
|
-
n: 2
|
|
165
|
-
},
|
|
166
|
-
ivec3: {
|
|
167
|
-
fn: "uniform3iv",
|
|
168
|
-
n: 3
|
|
169
|
-
},
|
|
170
|
-
ivec4: {
|
|
171
|
-
fn: "uniform4iv",
|
|
172
|
-
n: 4
|
|
173
|
-
},
|
|
174
|
-
bool: {
|
|
175
|
-
fn: "uniform1iv",
|
|
176
|
-
n: 1
|
|
177
|
-
},
|
|
178
|
-
bvec2: {
|
|
179
|
-
fn: "uniform2iv",
|
|
180
|
-
n: 2
|
|
181
|
-
},
|
|
182
|
-
bvec3: {
|
|
183
|
-
fn: "uniform3iv",
|
|
184
|
-
n: 3
|
|
185
|
-
},
|
|
186
|
-
bvec4: {
|
|
187
|
-
fn: "uniform4iv",
|
|
188
|
-
n: 4
|
|
189
|
-
},
|
|
190
|
-
uint: {
|
|
191
|
-
fn: "uniform1uiv",
|
|
192
|
-
n: 1
|
|
193
|
-
},
|
|
194
|
-
uvec2: {
|
|
195
|
-
fn: "uniform2uiv",
|
|
196
|
-
n: 2
|
|
197
|
-
},
|
|
198
|
-
uvec3: {
|
|
199
|
-
fn: "uniform3uiv",
|
|
200
|
-
n: 3
|
|
201
|
-
},
|
|
202
|
-
uvec4: {
|
|
203
|
-
fn: "uniform4uiv",
|
|
204
|
-
n: 4
|
|
205
|
-
},
|
|
206
|
-
mat2: {
|
|
207
|
-
fn: "uniformMatrix2fv",
|
|
208
|
-
n: 4,
|
|
209
|
-
matrix: !0
|
|
210
|
-
},
|
|
211
|
-
mat3: {
|
|
212
|
-
fn: "uniformMatrix3fv",
|
|
213
|
-
n: 9,
|
|
214
|
-
matrix: !0
|
|
215
|
-
},
|
|
216
|
-
mat4: {
|
|
217
|
-
fn: "uniformMatrix4fv",
|
|
218
|
-
n: 16,
|
|
219
|
-
matrix: !0
|
|
220
|
-
},
|
|
221
|
-
mat2x2: {
|
|
222
|
-
fn: "uniformMatrix2fv",
|
|
223
|
-
n: 4,
|
|
224
|
-
matrix: !0
|
|
225
|
-
},
|
|
226
|
-
mat3x3: {
|
|
227
|
-
fn: "uniformMatrix3fv",
|
|
228
|
-
n: 9,
|
|
229
|
-
matrix: !0
|
|
230
|
-
},
|
|
231
|
-
mat4x4: {
|
|
232
|
-
fn: "uniformMatrix4fv",
|
|
233
|
-
n: 16,
|
|
234
|
-
matrix: !0
|
|
235
|
-
},
|
|
236
|
-
mat2x3: {
|
|
237
|
-
fn: "uniformMatrix2x3fv",
|
|
238
|
-
n: 6,
|
|
239
|
-
matrix: !0
|
|
240
|
-
},
|
|
241
|
-
mat2x4: {
|
|
242
|
-
fn: "uniformMatrix2x4fv",
|
|
243
|
-
n: 8,
|
|
244
|
-
matrix: !0
|
|
245
|
-
},
|
|
246
|
-
mat3x2: {
|
|
247
|
-
fn: "uniformMatrix3x2fv",
|
|
248
|
-
n: 6,
|
|
249
|
-
matrix: !0
|
|
250
|
-
},
|
|
251
|
-
mat3x4: {
|
|
252
|
-
fn: "uniformMatrix3x4fv",
|
|
253
|
-
n: 12,
|
|
254
|
-
matrix: !0
|
|
255
|
-
},
|
|
256
|
-
mat4x2: {
|
|
257
|
-
fn: "uniformMatrix4x2fv",
|
|
258
|
-
n: 8,
|
|
259
|
-
matrix: !0
|
|
260
|
-
},
|
|
261
|
-
mat4x3: {
|
|
262
|
-
fn: "uniformMatrix4x3fv",
|
|
263
|
-
n: 12,
|
|
264
|
-
matrix: !0
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
function Ce(e) {
|
|
268
|
-
return Array.isArray(e) || e instanceof Float32Array || e instanceof Int32Array || e instanceof Uint32Array;
|
|
269
|
-
}
|
|
270
|
-
function we(e, t, n, r) {
|
|
271
|
-
let i = typeof process < "u" ? process.env.NODE_ENV !== "production" : !0, a = Se[n.type];
|
|
272
|
-
if (!a) {
|
|
273
|
-
i && console.warn(`weasel setUniform: array uniform "${t}" has type ${n.type}, which cannot be written as a whole`);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (r.length % a.n !== 0 || r.length > a.n * n.size) {
|
|
277
|
-
if (i) throw TypeError(`weasel setUniform: "${t}" is ${n.type}[${n.size}], so its value must hold a multiple of ${a.n} numbers, at most ${a.n * n.size}; got ${r.length}`);
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
if (r.length === 0) return;
|
|
281
|
-
let o = e[a.fn];
|
|
282
|
-
a.matrix ? o.call(e, n.location, !1, r) : o.call(e, n.location, r);
|
|
283
|
-
}
|
|
284
|
-
function Te(e, t, n, r, i, a) {
|
|
285
|
-
for (let [o, s] of Object.entries(r)) {
|
|
286
|
-
let r = t.uniformArray(o);
|
|
287
|
-
if (r && Ce(s)) {
|
|
288
|
-
we(e, o, r, s);
|
|
289
|
-
continue;
|
|
290
|
-
}
|
|
291
|
-
let c = t.uniform(o);
|
|
292
|
-
if (c === void 0) {
|
|
293
|
-
be(n, o);
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
xe(e, c, s, i, a);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function Ee(e, t) {
|
|
300
|
-
let { gl: n, programRegistry: r, quadVbo: i, quadIbo: a, textureCache: s } = e, c = r.get(t.program.id);
|
|
301
|
-
if (!c) {
|
|
302
|
-
console.warn(`weasel drawShader: program "${t.program.id}" not compiled on this renderer. Call renderer.registerProgram(handle) after the module-level registerProgram().`);
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
if (!i || !a) {
|
|
306
|
-
console.warn("weasel drawShader: quad geometry not initialized");
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
n.useProgram(c.handle);
|
|
310
|
-
let l = c.attribute("a_position"), u = c.attribute("a_uv");
|
|
311
|
-
n.bindBuffer(n.ARRAY_BUFFER, i), l !== void 0 && (n.enableVertexAttribArray(l), n.vertexAttribPointer(l, 2, n.FLOAT, !1, 16, 0)), u !== void 0 && (n.enableVertexAttribArray(u), n.vertexAttribPointer(u, 2, n.FLOAT, !1, 16, 8)), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, a);
|
|
312
|
-
let d = o.screenToClip(e.widthCss, e.heightCss), f = c.uniform("u_proj");
|
|
313
|
-
f !== void 0 && n.uniformMatrix3fv(f, !1, d);
|
|
314
|
-
let p = c.uniform("u_bounds");
|
|
315
|
-
p !== void 0 && n.uniform4f(p, t.bounds.x, t.bounds.y, t.bounds.w, t.bounds.h);
|
|
316
|
-
let m = c.uniform("u_view");
|
|
317
|
-
m !== void 0 && n.uniformMatrix3fv(m, !1, e.state.transform), Te(n, c, t.program.id, t.uniforms, s, { value: 1 }), Z(e), C(e, 6, e.gl.UNSIGNED_SHORT), l !== void 0 && n.disableVertexAttribArray(l), u !== void 0 && n.disableVertexAttribArray(u), n.bindBuffer(n.ARRAY_BUFFER, null), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, null);
|
|
318
|
-
}
|
|
319
|
-
function De(e, t, n, r, i) {
|
|
320
|
-
let a = e.gl;
|
|
321
|
-
F(e);
|
|
322
|
-
let o = e.renderTarget ?? null, s = e.clipDepth, c = e.clipStack, l = e.drawBatch.clip, u = a.isEnabled(a.SCISSOR_TEST), d = n.acquire(r, i), f = e.state.pushIsolated({ transform: t.transform });
|
|
323
|
-
e.clipDepth = 0, e.clipStack = [], e.drawBatch.clip = null, a.bindFramebuffer(a.FRAMEBUFFER, d.fbo), e.renderTarget = d, a.viewport(0, 0, r, i), a.disable(a.SCISSOR_TEST), a.stencilMask(255), a.clear(a.COLOR_BUFFER_BIT | a.STENCIL_BUFFER_BIT);
|
|
324
|
-
for (let n of t.children) A(e, n);
|
|
325
|
-
q(e), a.disable(a.BLEND);
|
|
326
|
-
for (let o of t.effects) {
|
|
327
|
-
let t = e.ensureProgram?.(o.program.id) ?? null;
|
|
328
|
-
if (!t) {
|
|
329
|
-
be(o.program.id, "(program)");
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
let s = n.acquire(r, i);
|
|
333
|
-
a.bindFramebuffer(a.FRAMEBUFFER, s.fbo), a.viewport(0, 0, r, i), a.clear(a.COLOR_BUFFER_BIT), ke(e, t, d.texture, r, i, o.uniforms, void 0, o.program.id), n.release(d), d = s;
|
|
334
|
-
}
|
|
335
|
-
a.enable(a.BLEND), e.state.pop(), e.clipDepth = s, e.clipStack = c, e.drawBatch.clip = l, e.renderTarget = o, Oe(e, r, i, u);
|
|
336
|
-
let p = e.ensureProgram?.(S) ?? null;
|
|
337
|
-
p && (Z(e), ke(e, p, d.texture, r, i, void 0, {
|
|
338
|
-
alpha: f.alpha,
|
|
339
|
-
colorMatrix: f.colorMatrix
|
|
340
|
-
})), n.release(d);
|
|
341
|
-
}
|
|
342
|
-
function Oe(e, t, n, r) {
|
|
343
|
-
let i = e.gl, a = e.renderTarget ?? null;
|
|
344
|
-
i.bindFramebuffer(i.FRAMEBUFFER, a ? a.fbo : null), a ? i.viewport(0, 0, t, n) : (e.restoreTargetRect?.(), r && i.enable(i.SCISSOR_TEST));
|
|
345
|
-
}
|
|
346
|
-
function ke(e, t, n, r, i, a, o, s) {
|
|
347
|
-
let c = e.gl;
|
|
348
|
-
c.useProgram(t.handle);
|
|
349
|
-
let l = t.attribute("a_position"), u = t.attribute("a_uv");
|
|
350
|
-
c.bindBuffer(c.ARRAY_BUFFER, e.quadVbo), c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, e.quadIbo), l !== void 0 && l >= 0 && (c.enableVertexAttribArray(l), c.vertexAttribPointer(l, 2, c.FLOAT, !1, 16, 0)), u !== void 0 && u >= 0 && (c.enableVertexAttribArray(u), c.vertexAttribPointer(u, 2, c.FLOAT, !1, 16, 8)), c.activeTexture(c.TEXTURE0), c.bindTexture(c.TEXTURE_2D, n);
|
|
351
|
-
let d = t.uniform("u_source");
|
|
352
|
-
d !== void 0 && c.uniform1i(d, 0);
|
|
353
|
-
let f = t.uniform("u_resolution");
|
|
354
|
-
f !== void 0 && c.uniform2f(f, r, i);
|
|
355
|
-
let p = t.uniform("u_texel");
|
|
356
|
-
if (p !== void 0 && c.uniform2f(p, 1 / r, 1 / i), o) {
|
|
357
|
-
let n = t.uniform("u_alpha");
|
|
358
|
-
n !== void 0 && c.uniform1f(n, o.alpha), k(e, t, o.colorMatrix);
|
|
359
|
-
}
|
|
360
|
-
a && Te(c, t, s ?? "effect", a, e.textureCache, { value: 1 }), C(e, 6, e.gl.UNSIGNED_SHORT), l !== void 0 && l >= 0 && c.disableVertexAttribArray(l), u !== void 0 && u >= 0 && c.disableVertexAttribArray(u), c.bindBuffer(c.ARRAY_BUFFER, null), c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, null);
|
|
361
|
-
}
|
|
362
|
-
function Ae(e, t) {
|
|
363
|
-
if (t.effects && t.effects.length > 0 && e.effectTargets && e.deviceWidth && e.deviceHeight) {
|
|
364
|
-
De(e, t, e.effectTargets, e.deviceWidth, e.deviceHeight);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
if (e.state.push({
|
|
368
|
-
transform: t.transform,
|
|
369
|
-
alpha: t.alpha,
|
|
370
|
-
colorMatrix: t.colorMatrix
|
|
371
|
-
}), t.clip) {
|
|
372
|
-
let n = e.clipStack.reduce((e, t) => e + +(t.depth === 0), 0);
|
|
373
|
-
if (e.clipDepth + n + 1 > 7) throw e.state.pop(), Error("weasel: clip nesting depth exceeded (max 7). You can't nest more than 7 levels of clipped containers in a single draw tree. Flatten the hierarchy or compose poses outside the scene graph.");
|
|
374
|
-
je(e, t.clip);
|
|
375
|
-
}
|
|
376
|
-
for (let n of t.children) A(e, n);
|
|
377
|
-
t.clip && Me(e), e.state.pop();
|
|
378
|
-
}
|
|
379
|
-
function je(e, t) {
|
|
380
|
-
let n = e.state.transform, r = ee(t, n);
|
|
381
|
-
if (r === null) {
|
|
382
|
-
j(e);
|
|
383
|
-
let r = e.clipDepth + 1;
|
|
384
|
-
_t(e, t, r), e.clipDepth = r, e.clipStack.push({
|
|
385
|
-
path: t,
|
|
386
|
-
transform: n,
|
|
387
|
-
rect: null,
|
|
388
|
-
depth: r
|
|
389
|
-
});
|
|
390
|
-
} else e.clipStack.push({
|
|
391
|
-
path: t,
|
|
392
|
-
transform: n,
|
|
393
|
-
rect: r,
|
|
394
|
-
depth: 0
|
|
395
|
-
});
|
|
396
|
-
Ne(e);
|
|
397
|
-
}
|
|
398
|
-
function Me(e) {
|
|
399
|
-
let t = e.clipStack.pop();
|
|
400
|
-
t.depth > 0 && (vt(e, t.path, t.depth - 1, t.transform), e.clipDepth = t.depth - 1), Ne(e);
|
|
401
|
-
}
|
|
402
|
-
function j(e) {
|
|
403
|
-
for (let t of e.clipStack) {
|
|
404
|
-
if (t.depth !== 0) continue;
|
|
405
|
-
let n = e.clipDepth + 1;
|
|
406
|
-
_t(e, t.path, n, t.transform), t.depth = n, e.clipDepth = n;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function Ne(e) {
|
|
410
|
-
let t = null;
|
|
411
|
-
for (let n of e.clipStack) n.rect && (t = t ? x(t, n.rect) : n.rect);
|
|
412
|
-
e.drawBatch.clip = t;
|
|
413
|
-
}
|
|
414
|
-
function Pe(e) {
|
|
415
|
-
let t = e.clipStack;
|
|
416
|
-
if (t.length === 0 || e.uncut) return e.clipDepth;
|
|
417
|
-
for (let e = t.length - 1; e >= 0; e--) if (t[e].rect === null) return t[e].depth;
|
|
418
|
-
for (let e of t) if (e.depth > 0) return e.depth - 1;
|
|
419
|
-
return e.clipDepth;
|
|
420
|
-
}
|
|
421
|
-
function M(e) {
|
|
422
|
-
j(e);
|
|
423
|
-
let t = e.drawBatch.clip;
|
|
424
|
-
return e.drawBatch.clip = null, e.uncut = !0, t;
|
|
425
|
-
}
|
|
426
|
-
function N(e, t) {
|
|
427
|
-
e.drawBatch.clip = t, e.uncut = !1;
|
|
428
|
-
}
|
|
429
|
-
function P(e, t, n, r) {
|
|
430
|
-
let i = M(e);
|
|
431
|
-
r(e, t, n), N(e, i);
|
|
432
|
-
}
|
|
433
|
-
function F(e) {
|
|
434
|
-
q(e), e.clipStack.length > 0 && j(e);
|
|
435
|
-
}
|
|
436
|
-
function Fe(e, t) {
|
|
437
|
-
t.fill && Ie(e, t), t.stroke?.paint && bt(e, t);
|
|
438
|
-
}
|
|
439
|
-
function Ie(e, t) {
|
|
440
|
-
let n = t.fill, r = n.fill === void 0 || n.fill === "solid", i = !!(t.vertexColors && t.vertexColors.length > 0), a = n, o = G(e, n, i);
|
|
441
|
-
if (o === null) return;
|
|
442
|
-
if (o !== void 0 && t.path.kind === "rect") {
|
|
443
|
-
o.kind === "ramp" ? $e(e, t.path, o) : Ge(e, t.path, o);
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
let s = ge(e, t.path);
|
|
447
|
-
if (K(e, s, o)) return;
|
|
448
|
-
let c = _e(e, s);
|
|
449
|
-
r && i ? nt(e, t, a, c) : c.requiresStencil ? yt(e, n, c) : ct(e, n, c);
|
|
450
|
-
}
|
|
451
|
-
var Le = new Int32Array(Array.from({ length: t }, (e, t) => t)), I = new Float32Array(2 * t);
|
|
452
|
-
function Re(e) {
|
|
453
|
-
return e === s || T(s, e);
|
|
454
|
-
}
|
|
455
|
-
function L(e, t, n, r, i = 0) {
|
|
456
|
-
if (t.clipDepth !== (e.clipStack.length === 0 ? e.clipDepth : Pe(e)) || t.synthBold !== i || !t.foldsAlpha && t.alpha !== e.state.alpha || n !== void 0 && ze(t, n, r) < 0) return !1;
|
|
457
|
-
let a = e.state.colorMatrix;
|
|
458
|
-
return t.colorMatrix === a || T(t.colorMatrix, a);
|
|
459
|
-
}
|
|
460
|
-
function ze(e, t, n) {
|
|
461
|
-
for (let r = 0; r < e.textures.length; r++) {
|
|
462
|
-
let i = e.textures[r];
|
|
463
|
-
if (i.kind === "bitmap" && i.image === t) return i.sampling === n ? r + 1 : -1;
|
|
464
|
-
}
|
|
465
|
-
return R(e);
|
|
466
|
-
}
|
|
467
|
-
function Be(e) {
|
|
468
|
-
for (let t = 0; t < e.textures.length; t++) if (e.textures[t].kind === "ramps") return t + 1;
|
|
469
|
-
return R(e);
|
|
470
|
-
}
|
|
471
|
-
function Ve(e, t) {
|
|
472
|
-
for (let n = 0; n < e.textures.length; n++) {
|
|
473
|
-
let r = e.textures[n];
|
|
474
|
-
if (r.kind === "atlas" && r.id === t) return n + 1;
|
|
475
|
-
}
|
|
476
|
-
return R(e);
|
|
477
|
-
}
|
|
478
|
-
function R(e) {
|
|
479
|
-
return e.textures.length + 1 < t ? e.textures.length + 1 : -1;
|
|
480
|
-
}
|
|
481
|
-
var z = {
|
|
482
|
-
maxVertices: 96,
|
|
483
|
-
maxVerticesInRun: 1024
|
|
484
|
-
};
|
|
485
|
-
function He(e, t) {
|
|
486
|
-
if (t.requiresStencil) return !1;
|
|
487
|
-
let n = e.drawBatch.length > 0 ? z.maxVerticesInRun : z.maxVertices;
|
|
488
|
-
return t.vertices.length >> 1 <= n;
|
|
489
|
-
}
|
|
490
|
-
function B(e, t) {
|
|
491
|
-
return e.batchState !== void 0 && !L(e, e.batchState) && q(e), e.drawBatch.wouldOverflow(t) && q(e), V(e);
|
|
492
|
-
}
|
|
493
|
-
function V(e) {
|
|
494
|
-
if (e.batchState === void 0) {
|
|
495
|
-
let t = e.state.colorMatrix, n = Re(t);
|
|
496
|
-
e.batchState = {
|
|
497
|
-
alpha: n ? 1 : e.state.alpha,
|
|
498
|
-
colorMatrix: t,
|
|
499
|
-
clipDepth: Pe(e),
|
|
500
|
-
synthBold: 0,
|
|
501
|
-
foldsAlpha: n,
|
|
502
|
-
textures: []
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
return e.batchState;
|
|
506
|
-
}
|
|
507
|
-
function H(e, t, n) {
|
|
508
|
-
e.batchState !== void 0 && !L(e, e.batchState, t, n) && q(e), e.drawBatch.wouldOverflow(4) && q(e);
|
|
509
|
-
let r = V(e), i = ze(r, t, n);
|
|
510
|
-
return i > r.textures.length && (r.textures.push({
|
|
511
|
-
kind: "bitmap",
|
|
512
|
-
image: t,
|
|
513
|
-
sampling: n
|
|
514
|
-
}), i = r.textures.length), {
|
|
515
|
-
staged: r,
|
|
516
|
-
slot: i
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
function U(e, t, n, r) {
|
|
520
|
-
e.batchState !== void 0 && (!L(e, e.batchState, void 0, void 0, r) || Ve(e.batchState, t) < 0) && q(e), e.drawBatch.wouldOverflow(4) && q(e);
|
|
521
|
-
let i = V(e);
|
|
522
|
-
i.synthBold = r;
|
|
523
|
-
let a = Ve(i, t);
|
|
524
|
-
return a > i.textures.length && (i.textures.push({
|
|
525
|
-
kind: "atlas",
|
|
526
|
-
id: t,
|
|
527
|
-
fieldScale: n
|
|
528
|
-
}), a = i.textures.length), {
|
|
529
|
-
staged: i,
|
|
530
|
-
slot: a
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
function Ue(e, t, n, r) {
|
|
534
|
-
e.gradRamps.wouldReshape(t, n) && q(e), e.batchState !== void 0 && (!L(e, e.batchState) || Be(e.batchState) < 0) && q(e), e.drawBatch.wouldOverflow(r) && q(e);
|
|
535
|
-
let i = V(e), a = Be(i);
|
|
536
|
-
return a > i.textures.length && (i.textures.push({ kind: "ramps" }), a = i.textures.length), {
|
|
537
|
-
staged: i,
|
|
538
|
-
slot: a,
|
|
539
|
-
rowV: e.gradRamps.rowV(e.gradRamps.upload(t, n))
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
function W(e, t, n) {
|
|
543
|
-
return (n ?? 1) * (t.foldsAlpha ? e.state.alpha : 1);
|
|
544
|
-
}
|
|
545
|
-
function We(e, t, n) {
|
|
546
|
-
let [r, i, o, s] = a(n.color);
|
|
547
|
-
return [
|
|
548
|
-
r,
|
|
549
|
-
i,
|
|
550
|
-
o,
|
|
551
|
-
s * W(e, t, n.opacity)
|
|
552
|
-
];
|
|
553
|
-
}
|
|
554
|
-
function Ge(e, t, n) {
|
|
555
|
-
let [r, i, a, o] = We(e, B(e, 4), n);
|
|
556
|
-
e.drawBatch.pushRect(t.x, t.y, t.width, t.height, e.state.transform, r, i, a, o) || P(e, t, n, Ge);
|
|
557
|
-
}
|
|
558
|
-
function Ke(e, t, n) {
|
|
559
|
-
let [r, i, a, o] = We(e, B(e, t.vertices.length >> 1), n);
|
|
560
|
-
e.drawBatch.pushMesh(t, e.state.transform, r, i, a, o) || P(e, t, n, Ke);
|
|
561
|
-
}
|
|
562
|
-
function G(e, t, a) {
|
|
563
|
-
if (a) return;
|
|
564
|
-
let o = t.fill ?? "solid";
|
|
565
|
-
if (o === "solid") {
|
|
566
|
-
let e = t;
|
|
567
|
-
return {
|
|
568
|
-
kind: "solid",
|
|
569
|
-
color: e.color,
|
|
570
|
-
opacity: e.opacity
|
|
571
|
-
};
|
|
572
|
-
}
|
|
573
|
-
if (o !== "linear-gradient" && o !== "radial-gradient" && o !== "conic-gradient") return;
|
|
574
|
-
let s = t, c = Je(e, s.units);
|
|
575
|
-
return c ? s.fill === "linear-gradient" ? qe(s, r, Ye(c, s)) : s.fill === "radial-gradient" ? qe(s, i, Xe(c, s)) : qe(s, n, Ze(c, s)) : null;
|
|
576
|
-
}
|
|
577
|
-
function qe(e, t, n) {
|
|
578
|
-
return {
|
|
579
|
-
kind: "ramp",
|
|
580
|
-
stops: e.stops,
|
|
581
|
-
space: e.interpolate ?? "rgb",
|
|
582
|
-
opacity: e.opacity,
|
|
583
|
-
mode: t,
|
|
584
|
-
uv: n
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
function Je(e, t) {
|
|
588
|
-
let n = X(e, t);
|
|
589
|
-
return n && o.multiply(n, e.state.transform);
|
|
590
|
-
}
|
|
591
|
-
function Ye(e, t) {
|
|
592
|
-
let n = t.to.x - t.from.x, r = t.to.y - t.from.y, i = Math.hypot(n, r) || 1, a = 1 / (i * i);
|
|
593
|
-
return {
|
|
594
|
-
ux: (e[0] * n + e[1] * r) * a,
|
|
595
|
-
uy: (e[3] * n + e[4] * r) * a,
|
|
596
|
-
u0: ((e[6] - t.from.x) * n + (e[7] - t.from.y) * r) * a,
|
|
597
|
-
vx: 0,
|
|
598
|
-
vy: 0,
|
|
599
|
-
v0: 0
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
function Xe(e, t) {
|
|
603
|
-
let n = 1 / Math.max(t.radius, 1e-4);
|
|
604
|
-
return {
|
|
605
|
-
ux: e[0] * n,
|
|
606
|
-
uy: e[3] * n,
|
|
607
|
-
u0: (e[6] - t.center.x) * n,
|
|
608
|
-
vx: e[1] * n,
|
|
609
|
-
vy: e[4] * n,
|
|
610
|
-
v0: (e[7] - t.center.y) * n
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
function Ze(e, t) {
|
|
614
|
-
let n = Math.cos(t.angle), r = Math.sin(t.angle), i = e[6] - t.center.x, a = e[7] - t.center.y;
|
|
615
|
-
return {
|
|
616
|
-
ux: n * e[0] + r * e[1],
|
|
617
|
-
uy: n * e[3] + r * e[4],
|
|
618
|
-
u0: n * i + r * a,
|
|
619
|
-
vx: n * e[1] - r * e[0],
|
|
620
|
-
vy: n * e[4] - r * e[3],
|
|
621
|
-
v0: n * a - r * i
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
function Qe(e, t) {
|
|
625
|
-
return e.mode === r ? {
|
|
626
|
-
uv: {
|
|
627
|
-
...e.uv,
|
|
628
|
-
v0: t
|
|
629
|
-
},
|
|
630
|
-
post: 1
|
|
631
|
-
} : {
|
|
632
|
-
uv: e.uv,
|
|
633
|
-
post: t
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
function $e(e, t, n) {
|
|
637
|
-
let { staged: r, slot: i, rowV: a } = Ue(e, n.stops, n.space, 4), { uv: o, post: s } = Qe(n, a);
|
|
638
|
-
e.drawBatch.pushGradientRect(t.x, t.y, t.width, t.height, e.state.transform, o, s, i, n.mode, 1, 1, 1, W(e, r, n.opacity)) || P(e, t, n, $e);
|
|
639
|
-
}
|
|
640
|
-
function et(e, t, n) {
|
|
641
|
-
let { staged: r, slot: i, rowV: a } = Ue(e, n.stops, n.space, t.vertices.length >> 1), { uv: o, post: s } = Qe(n, a);
|
|
642
|
-
e.drawBatch.pushGradientMesh(t, e.state.transform, o, s, i, n.mode, 1, 1, 1, W(e, r, n.opacity)) || P(e, t, n, et);
|
|
643
|
-
}
|
|
644
|
-
function K(e, t, n) {
|
|
645
|
-
return n !== void 0 && He(e, t) ? (n.kind === "ramp" ? et(e, t, n) : Ke(e, t, n), !0) : (F(e), !1);
|
|
646
|
-
}
|
|
647
|
-
function q(e) {
|
|
648
|
-
let t = e.drawBatch, n = e.batchState;
|
|
649
|
-
if (t.length === 0 || n === void 0) {
|
|
650
|
-
e.batchState = void 0;
|
|
651
|
-
return;
|
|
652
|
-
}
|
|
653
|
-
let r = e.gl, i = e.batchFill;
|
|
654
|
-
r.useProgram(i.handle);
|
|
655
|
-
let a = t.uploadAndBind();
|
|
656
|
-
J(e, i, D), me(e, i, 1, 1, 1, 1), E(e, i, n.alpha), r.uniform1f(i.uniform("u_synthBold"), n.synthBold), k(e, i, n.colorMatrix), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, e.whiteTexture);
|
|
657
|
-
for (let t = 0; t < n.textures.length; t++) {
|
|
658
|
-
let i = n.textures[t];
|
|
659
|
-
if (i.kind === "atlas") {
|
|
660
|
-
e.textureCache.bind(i.id, t + 1), I[2 * (t + 1)] = i.fieldScale[0], I[2 * (t + 1) + 1] = i.fieldScale[1];
|
|
661
|
-
continue;
|
|
662
|
-
}
|
|
663
|
-
if (i.kind === "ramps") {
|
|
664
|
-
e.gradRamps.bind(t + 1);
|
|
665
|
-
continue;
|
|
666
|
-
}
|
|
667
|
-
e.imageCache.bind(i.image, t + 1), e.imageCache.setMagFilter(i.image, i.sampling === "nearest" ? r.NEAREST : r.LINEAR);
|
|
668
|
-
}
|
|
669
|
-
r.uniform1iv(i.uniform("u_samplers"), Le), r.uniform2fv(i.uniform("u_fieldScale"), I), Z(e, n.clipDepth), C(e, a, e.gl.UNSIGNED_INT), r.activeTexture(r.TEXTURE0), r.bindVertexArray(null), t.reset(), e.batchState = void 0;
|
|
670
|
-
}
|
|
671
|
-
function tt(e, t) {
|
|
672
|
-
let n = t.anchorA, r = t.anchorB, i = t.anchorT;
|
|
673
|
-
if (!n || !r || !i) return new Float32Array(e);
|
|
674
|
-
let a = n.length, o = new Float32Array(a * 4);
|
|
675
|
-
for (let t = 0; t < a; t++) {
|
|
676
|
-
let a = n[t] * 4, s = r[t] * 4, c = i[t];
|
|
677
|
-
o[t * 4 + 0] = e[a + 0] + (e[s + 0] - e[a + 0]) * c, o[t * 4 + 1] = e[a + 1] + (e[s + 1] - e[a + 1]) * c, o[t * 4 + 2] = e[a + 2] + (e[s + 2] - e[a + 2]) * c, o[t * 4 + 3] = e[a + 3] + (e[s + 3] - e[a + 3]) * c;
|
|
678
|
-
}
|
|
679
|
-
return o;
|
|
680
|
-
}
|
|
681
|
-
function nt(e, t, n, r) {
|
|
682
|
-
let i = e.gl, a = e.pathFillVColor;
|
|
683
|
-
i.useProgram(a.handle), i.bindVertexArray(r.vao), J(e, a), Y(e, a, n.color, n.opacity), k(e, a);
|
|
684
|
-
let o = tt(t.vertexColors, r), s = i.createBuffer();
|
|
685
|
-
if (!s) throw Error("drawPathFillVColor: createBuffer (color VBO) returned null");
|
|
686
|
-
i.bindBuffer(i.ARRAY_BUFFER, s), i.bufferData(i.ARRAY_BUFFER, o, i.DYNAMIC_DRAW);
|
|
687
|
-
let c = a.attribute("a_vertexColor");
|
|
688
|
-
c !== void 0 && (i.enableVertexAttribArray(c), i.vertexAttribPointer(c, 4, i.FLOAT, !1, 0, 0)), Z(e), C(e, r.indexCount, e.gl.UNSIGNED_INT), i.bindVertexArray(null), i.deleteBuffer(s);
|
|
689
|
-
}
|
|
690
|
-
function J(e, t, n = e.state.transform, r = he(e)) {
|
|
691
|
-
let i = e.gl, a = w(e, t);
|
|
692
|
-
T(a.proj, r) || (i.uniformMatrix3fv(t.uniform("u_proj"), !1, r), a.proj = Float32Array.from(r)), T(a.model, n) || (i.uniformMatrix3fv(t.uniform("u_model"), !1, n), a.model = Float32Array.from(n));
|
|
693
|
-
}
|
|
694
|
-
function Y(e, t, n, r) {
|
|
695
|
-
let [i, o, s, c] = a(n);
|
|
696
|
-
me(e, t, i, o, s, c * (r ?? 1)), E(e, t, e.state.alpha);
|
|
697
|
-
}
|
|
698
|
-
function rt(e, t) {
|
|
699
|
-
let n = t.fill ?? "solid";
|
|
700
|
-
if (n === "solid") return lt(e, t);
|
|
701
|
-
if (n === "pattern") return ut(e, t);
|
|
702
|
-
if (n === "linear-gradient" || n === "radial-gradient" || n === "conic-gradient") return mt(e, t);
|
|
703
|
-
let r = l(n)?.bind;
|
|
704
|
-
return r ? r(it(e), t) : null;
|
|
705
|
-
}
|
|
706
|
-
function it(e) {
|
|
707
|
-
let t = at.get(e);
|
|
708
|
-
if (t) return t;
|
|
709
|
-
let n = {
|
|
710
|
-
gl: e.gl,
|
|
711
|
-
get alpha() {
|
|
712
|
-
return e.state.alpha;
|
|
713
|
-
},
|
|
714
|
-
program: (t) => e.ensureProgram?.(t) ?? e.programRegistry.get(t) ?? null,
|
|
715
|
-
setProjAndModel: (t) => J(e, t),
|
|
716
|
-
spaceInverse: (t) => X(e, t),
|
|
717
|
-
spaceToDevice: (t) => pt(e, t),
|
|
718
|
-
get maxTextureSize() {
|
|
719
|
-
return e.imageCache.maxTextureSide;
|
|
720
|
-
},
|
|
721
|
-
resources: e.paintResources ?? st(e.gl),
|
|
722
|
-
bindRamp: (t, n, r) => {
|
|
723
|
-
let i = e.gradRamps.upload(t, r);
|
|
724
|
-
return e.gradRamps.bind(n), e.gradRamps.rowV(i);
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
return at.set(e, n), n;
|
|
728
|
-
}
|
|
729
|
-
var at = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap();
|
|
730
|
-
function st(t) {
|
|
731
|
-
let n = ot.get(t);
|
|
732
|
-
return n || (n = e(), ot.set(t, n)), n;
|
|
733
|
-
}
|
|
734
|
-
function ct(e, t, n) {
|
|
735
|
-
if (!rt(e, t)) return;
|
|
736
|
-
let r = e.gl;
|
|
737
|
-
r.bindVertexArray(n.vao), Z(e), C(e, n.indexCount, e.gl.UNSIGNED_INT), r.bindVertexArray(null);
|
|
738
|
-
}
|
|
739
|
-
function lt(e, t) {
|
|
740
|
-
let n = e.pathFill;
|
|
741
|
-
return e.gl.useProgram(n.handle), J(e, n), Y(e, n, t.color, t.opacity), k(e, n), n;
|
|
742
|
-
}
|
|
743
|
-
function ut(e, t) {
|
|
744
|
-
return dt(e, e.patternFill, t, e.state.transform);
|
|
745
|
-
}
|
|
746
|
-
function dt(e, t, n, r) {
|
|
747
|
-
let i = n.pattern, a = c(i.id);
|
|
748
|
-
if (!a) return (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(`weasel: pattern TextureHandle "${i.id}" not registered`), null;
|
|
749
|
-
let o = X(e, n.units);
|
|
750
|
-
if (!o) return null;
|
|
751
|
-
let s = d(o, n.origin ?? {
|
|
752
|
-
x: 0,
|
|
753
|
-
y: 0
|
|
754
|
-
}, n.transform);
|
|
755
|
-
if (!s) return null;
|
|
756
|
-
e.textureCache.upload(i.id, a.source, "repeat");
|
|
757
|
-
let l = e.gl;
|
|
758
|
-
l.useProgram(t.handle), J(e, t, r), k(e, t), l.uniformMatrix3fv(t.uniform("u_worldInv"), !1, s);
|
|
759
|
-
let [u, f] = ft(a.source);
|
|
760
|
-
return l.uniform2f(t.uniform("u_tileSize"), u, f), e.textureCache.bind(i.id, 0), l.uniform1i(t.uniform("u_sampler"), 0), l.uniform1f(t.uniform("u_opacity"), n.opacity ?? 1), E(e, t, e.state.alpha), t;
|
|
761
|
-
}
|
|
762
|
-
function ft(e) {
|
|
763
|
-
let t = "naturalWidth" in e ? e.naturalWidth : e.width, n = "naturalHeight" in e ? e.naturalHeight : e.height;
|
|
764
|
-
return [t || 1, n || 1];
|
|
765
|
-
}
|
|
766
|
-
function X(e, t) {
|
|
767
|
-
return t === "local" ? o.invert(e.state.transform) : t === "world" && e.viewMatrix ? o.invert(e.viewMatrix) : o.identity();
|
|
768
|
-
}
|
|
769
|
-
function pt(e, t) {
|
|
770
|
-
let n = X(e, t), r = n && o.invert(n);
|
|
771
|
-
if (!r) return null;
|
|
772
|
-
let i = e.deviceWidth && e.widthCss > 0 ? e.deviceWidth / e.widthCss : 1;
|
|
773
|
-
return o.multiply(o.scaled(o.identity(), i, i), r);
|
|
774
|
-
}
|
|
775
|
-
function mt(e, t) {
|
|
776
|
-
return ht(e, e.gradFill, t, e.state.transform);
|
|
777
|
-
}
|
|
778
|
-
function ht(e, t, n, r) {
|
|
779
|
-
let i = X(e, n.units);
|
|
780
|
-
if (!i) return null;
|
|
781
|
-
let a = e.gl, o = e.gradRamps.upload(n.stops, n.interpolate ?? "rgb");
|
|
782
|
-
if (a.useProgram(t.handle), J(e, t, r), a.uniformMatrix3fv(t.uniform("u_worldInv"), !1, i), k(e, t), e.gradRamps.bind(0), a.uniform1i(t.uniform("u_ramp"), 0), a.uniform1f(t.uniform("u_rampV"), e.gradRamps.rowV(o)), E(e, t, e.state.alpha), a.uniform1f(t.uniform("u_opacity"), n.opacity ?? 1), n.fill === "linear-gradient") {
|
|
783
|
-
a.uniform1i(t.uniform("u_gradKind"), 0);
|
|
784
|
-
let e = n.to.x - n.from.x, r = n.to.y - n.from.y, i = Math.hypot(e, r) || 1;
|
|
785
|
-
a.uniform2f(t.uniform("u_gradP0"), n.from.x, n.from.y), a.uniform2f(t.uniform("u_gradDir"), e / i, r / i), a.uniform1f(t.uniform("u_gradLen"), i), a.uniform1f(t.uniform("u_gradRadius"), 0), a.uniform1f(t.uniform("u_gradAngle"), 0);
|
|
786
|
-
} else n.fill === "radial-gradient" ? (a.uniform1i(t.uniform("u_gradKind"), 1), a.uniform2f(t.uniform("u_gradP0"), n.center.x, n.center.y), a.uniform2f(t.uniform("u_gradDir"), 0, 0), a.uniform1f(t.uniform("u_gradLen"), 0), a.uniform1f(t.uniform("u_gradRadius"), n.radius), a.uniform1f(t.uniform("u_gradAngle"), 0)) : (a.uniform1i(t.uniform("u_gradKind"), 2), a.uniform2f(t.uniform("u_gradP0"), n.center.x, n.center.y), a.uniform2f(t.uniform("u_gradDir"), 0, 0), a.uniform1f(t.uniform("u_gradLen"), 0), a.uniform1f(t.uniform("u_gradRadius"), 0), a.uniform1f(t.uniform("u_gradAngle"), n.angle));
|
|
787
|
-
return t;
|
|
788
|
-
}
|
|
789
|
-
function Z(e, t = e.clipDepth) {
|
|
790
|
-
let n = e.gl;
|
|
791
|
-
if (t === 0) {
|
|
792
|
-
n.disable(n.STENCIL_TEST);
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
let r = Q(t);
|
|
796
|
-
n.enable(n.STENCIL_TEST), n.stencilFunc(n.EQUAL, r, r), n.stencilOp(n.KEEP, n.KEEP, n.KEEP);
|
|
797
|
-
}
|
|
798
|
-
function Q(e) {
|
|
799
|
-
return e === 0 ? 0 : (1 << e + 1) - 1 & 254;
|
|
800
|
-
}
|
|
801
|
-
function gt(e, t, n) {
|
|
802
|
-
let r = e.gl, i = ve(e, t);
|
|
803
|
-
r.useProgram(e.pathFill.handle), r.bindVertexArray(i.vao), J(e, e.pathFill, n), C(e, i.indexCount, e.gl.UNSIGNED_INT), r.bindVertexArray(null);
|
|
804
|
-
}
|
|
805
|
-
function _t(e, t, n, r = e.state.transform) {
|
|
806
|
-
q(e);
|
|
807
|
-
let i = e.gl, a = Q(n - 1), o = 1 << n, s = a | o;
|
|
808
|
-
i.enable(i.STENCIL_TEST), i.colorMask(!1, !1, !1, !1), i.stencilMask(o), i.stencilFunc(i.EQUAL, s, a), i.stencilOp(i.KEEP, i.KEEP, i.REPLACE), gt(e, t, r), i.colorMask(!0, !0, !0, !0), i.stencilMask(255);
|
|
809
|
-
}
|
|
810
|
-
function vt(e, t, n, r = e.state.transform) {
|
|
811
|
-
e.batchState !== void 0 && e.batchState.clipDepth > n && q(e);
|
|
812
|
-
let i = e.gl;
|
|
813
|
-
i.enable(i.STENCIL_TEST);
|
|
814
|
-
let a = 1 << n + 1, o = Q(n) | a;
|
|
815
|
-
i.colorMask(!1, !1, !1, !1), i.stencilMask(a), i.stencilFunc(i.EQUAL, o, o), i.stencilOp(i.KEEP, i.KEEP, i.ZERO), gt(e, t, r), i.colorMask(!0, !0, !0, !0), i.stencilMask(255);
|
|
816
|
-
}
|
|
817
|
-
function yt(e, t, n) {
|
|
818
|
-
let r = e.gl;
|
|
819
|
-
r.useProgram(e.pathFill.handle), r.bindVertexArray(n.vao), J(e, e.pathFill), r.enable(r.STENCIL_TEST), r.colorMask(!1, !1, !1, !1), r.stencilMask(1), r.stencilFunc(r.ALWAYS, 0, 1), r.stencilOp(r.KEEP, r.KEEP, r.INVERT), C(e, n.indexCount, e.gl.UNSIGNED_INT);
|
|
820
|
-
let i = Q(e.clipDepth);
|
|
821
|
-
r.colorMask(!0, !0, !0, !0), r.stencilFunc(r.EQUAL, i | 1, i | 1), r.stencilOp(r.KEEP, r.KEEP, r.KEEP), rt(e, t) && C(e, n.indexCount, e.gl.UNSIGNED_INT), r.stencilMask(1), r.clear(r.STENCIL_BUFFER_BIT), r.disable(r.STENCIL_TEST), r.bindVertexArray(null);
|
|
822
|
-
}
|
|
823
|
-
function bt(e, t) {
|
|
824
|
-
let { cmd: n, spaces: r } = y(e.state.transform, t), i = n.stroke, a = i.align ?? "center", o = r.ribbon?.metric;
|
|
825
|
-
(n.path.kind === "polygon" || o !== void 0 && !p(o)) && a !== "center" ? (F(e), wt(e, n, a, r)) : xt(e, n, r);
|
|
826
|
-
let s = m(i.width ?? 1, 1), c = b(n.path, t.stroke, i, s, e.flattenTolerance, r);
|
|
827
|
-
for (let t of c) Fe(e, t);
|
|
828
|
-
}
|
|
829
|
-
function xt(e, t, n) {
|
|
830
|
-
let r = t.stroke, i = r.paint, a = i.fill === void 0 || i.fill === "solid", o = i, s = h(t.path, r, e.flattenTolerance, n);
|
|
831
|
-
if (s.indices.length === 0) return;
|
|
832
|
-
let c = !!(r.vertexColors && r.vertexColors.length > 0), l = G(e, i, c);
|
|
833
|
-
if (l === null || K(e, s, l)) return;
|
|
834
|
-
let u = c ? e.meshCache.uploadTransient(s) : e.meshCache.uploadRecurring(s);
|
|
835
|
-
if (!a && !c) {
|
|
836
|
-
ct(e, i, u);
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
let d = e.gl;
|
|
840
|
-
if (c) {
|
|
841
|
-
let t = e.pathFillVColor;
|
|
842
|
-
d.useProgram(t.handle), d.bindVertexArray(u.vao), J(e, t), Y(e, t, a ? o.color : "#ffffff", i.opacity), k(e, t);
|
|
843
|
-
let n = tt(r.vertexColors, u), s = d.createBuffer();
|
|
844
|
-
if (!s) throw Error("drawPathStrokeUnclipped: createBuffer (color VBO) returned null");
|
|
845
|
-
d.bindBuffer(d.ARRAY_BUFFER, s), d.bufferData(d.ARRAY_BUFFER, n, d.DYNAMIC_DRAW);
|
|
846
|
-
let c = t.attribute("a_vertexColor");
|
|
847
|
-
c !== void 0 && (d.enableVertexAttribArray(c), d.vertexAttribPointer(c, 4, d.FLOAT, !1, 0, 0)), Z(e), C(e, u.indexCount, e.gl.UNSIGNED_INT), d.bindVertexArray(null), d.deleteBuffer(s);
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
d.useProgram(e.pathFill.handle), d.bindVertexArray(u.vao), J(e, e.pathFill), Y(e, e.pathFill, o.color, o.opacity), k(e, e.pathFill), Z(e), C(e, u.indexCount, e.gl.UNSIGNED_INT), d.bindVertexArray(null);
|
|
851
|
-
}
|
|
852
|
-
var St = /* @__PURE__ */ new WeakMap();
|
|
853
|
-
function Ct(e) {
|
|
854
|
-
let t = St.get(e);
|
|
855
|
-
return t === void 0 && (t = e.map((e) => e * 2), St.set(e, t)), t;
|
|
856
|
-
}
|
|
857
|
-
function wt(e, t, n, r) {
|
|
858
|
-
let i = t.stroke, a = i.paint, o = a.fill === void 0 || a.fill === "solid", s = a, c = {
|
|
859
|
-
...i,
|
|
860
|
-
width: m(i.width ?? 1, 1) * 2,
|
|
861
|
-
...i.vertexWidths ? { vertexWidths: Ct(i.vertexWidths) } : {},
|
|
862
|
-
align: "center"
|
|
863
|
-
}, l = !!(i.vertexColors && i.vertexColors.length > 0), u = ve(e, t.path), d = h(t.path, c, e.flattenTolerance, r);
|
|
864
|
-
if (d.indices.length === 0) return;
|
|
865
|
-
let f = l ? e.meshCache.uploadTransient(d) : e.meshCache.uploadRecurring(d), p = e.gl, g = l ? e.pathFillVColor : e.pathFill;
|
|
866
|
-
p.useProgram(g.handle), J(e, g), p.enable(p.STENCIL_TEST), p.colorMask(!1, !1, !1, !1), p.stencilMask(1), p.stencilFunc(p.ALWAYS, 1, 1), p.stencilOp(p.KEEP, p.KEEP, p.REPLACE), p.bindVertexArray(u.vao), C(e, u.indexCount, e.gl.UNSIGNED_INT);
|
|
867
|
-
let _ = Q(e.clipDepth);
|
|
868
|
-
p.colorMask(!0, !0, !0, !0), n === "inner" ? p.stencilFunc(p.EQUAL, _ | 1, _ | 1) : p.stencilFunc(p.EQUAL, _, _ | 1), p.stencilOp(p.KEEP, p.KEEP, p.KEEP);
|
|
869
|
-
let v = g;
|
|
870
|
-
if (l ? (Y(e, g, o ? s.color : "#ffffff", a.opacity), k(e, g)) : v = rt(e, a), !v) {
|
|
871
|
-
p.stencilMask(1), p.clear(p.STENCIL_BUFFER_BIT), p.disable(p.STENCIL_TEST), p.bindVertexArray(null);
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
p.bindVertexArray(f.vao);
|
|
875
|
-
let y = null;
|
|
876
|
-
if (l) {
|
|
877
|
-
let e = tt(i.vertexColors, f);
|
|
878
|
-
if (y = p.createBuffer(), !y) throw Error("drawPathStrokeStenciled: createBuffer (color VBO) returned null");
|
|
879
|
-
p.bindBuffer(p.ARRAY_BUFFER, y), p.bufferData(p.ARRAY_BUFFER, e, p.DYNAMIC_DRAW);
|
|
880
|
-
let t = v.attribute("a_vertexColor");
|
|
881
|
-
t !== void 0 && (p.enableVertexAttribArray(t), p.vertexAttribPointer(t, 4, p.FLOAT, !1, 0, 0));
|
|
882
|
-
}
|
|
883
|
-
C(e, f.indexCount, e.gl.UNSIGNED_INT), p.stencilMask(1), p.clear(p.STENCIL_BUFFER_BIT), p.disable(p.STENCIL_TEST), p.bindVertexArray(null), y && p.deleteBuffer(y);
|
|
884
|
-
}
|
|
885
|
-
var Tt = 48;
|
|
886
|
-
function Et(e) {
|
|
887
|
-
let t = Math.hypot(e[0], e[1]), n = Math.hypot(e[3], e[4]);
|
|
888
|
-
return Math.sqrt(t * n) || 1;
|
|
889
|
-
}
|
|
890
|
-
function Dt(e, t) {
|
|
891
|
-
let n = le(t.style), r = n.lineHeight, i = t.align ?? n.align, a = t.maxWidth ?? Infinity, o = e.textOutlineMinScreenSize ?? Tt, s = Number.isFinite(o) ? o / Et(e.state.transform) : void 0, c = ce(t.runs, {
|
|
892
|
-
maxWidth: a,
|
|
893
|
-
alignWidth: t.width,
|
|
894
|
-
lineHeight: r,
|
|
895
|
-
align: i,
|
|
896
|
-
justify: t.justify,
|
|
897
|
-
outlineMinSize: s
|
|
898
|
-
});
|
|
899
|
-
if (c.groups.length === 0 && c.decorations.length === 0) return;
|
|
900
|
-
let l = t.x, u = t.y + ue(t.verticalAlign, t.height, c.bounds.height);
|
|
901
|
-
for (let t of c.groups) t.source === "outline" ? Ot(e, t, l, u) : Nt(e, t, l, u);
|
|
902
|
-
At(e, c.decorations, l, u);
|
|
903
|
-
}
|
|
904
|
-
function Ot(e, t, n, r) {
|
|
905
|
-
let i = t.fill;
|
|
906
|
-
if (i !== null) {
|
|
907
|
-
let a = _(t, n, r);
|
|
908
|
-
a && kt(e, i, a);
|
|
909
|
-
}
|
|
910
|
-
let a = t.stroke?.paint;
|
|
911
|
-
if (!a) return;
|
|
912
|
-
let o = v(t, n, r, e.state.transform);
|
|
913
|
-
o && kt(e, a, o);
|
|
914
|
-
}
|
|
915
|
-
function kt(e, t, n) {
|
|
916
|
-
let r = G(e, t, !1);
|
|
917
|
-
r !== null && (K(e, n, r) || ct(e, t, e.meshCache.uploadTransient(n)));
|
|
918
|
-
}
|
|
919
|
-
function At(e, t, n, r) {
|
|
920
|
-
for (let i of t) {
|
|
921
|
-
if (Pt(i.fill) !== null) {
|
|
922
|
-
kt(e, i.fill, jt(i.x0 + n, i.y0 + r, i.x1 + n, i.y1 + r));
|
|
923
|
-
continue;
|
|
924
|
-
}
|
|
925
|
-
let [t, o, s, c] = "color" in i.fill ? a(i.fill.color) : [
|
|
926
|
-
0,
|
|
927
|
-
0,
|
|
928
|
-
0,
|
|
929
|
-
1
|
|
930
|
-
], l;
|
|
931
|
-
for (;;) {
|
|
932
|
-
let a = B(e, 4);
|
|
933
|
-
if (e.drawBatch.pushRect(i.x0 + n, i.y0 + r, i.x1 - i.x0, i.y1 - i.y0, e.state.transform, t, o, s, c * (a.foldsAlpha ? e.state.alpha : 1))) break;
|
|
934
|
-
l = M(e);
|
|
935
|
-
}
|
|
936
|
-
l !== void 0 && N(e, l);
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
function jt(e, t, n, r) {
|
|
940
|
-
return {
|
|
941
|
-
vertices: new Float32Array([
|
|
942
|
-
e,
|
|
943
|
-
t,
|
|
944
|
-
n,
|
|
945
|
-
t,
|
|
946
|
-
n,
|
|
947
|
-
r,
|
|
948
|
-
e,
|
|
949
|
-
r
|
|
950
|
-
]),
|
|
951
|
-
indices: new Uint32Array([
|
|
952
|
-
0,
|
|
953
|
-
1,
|
|
954
|
-
2,
|
|
955
|
-
0,
|
|
956
|
-
2,
|
|
957
|
-
3
|
|
958
|
-
])
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
var Mt = .08;
|
|
962
|
-
function Nt(e, t, n, r) {
|
|
963
|
-
if (t.source === "canvas") {
|
|
964
|
-
if (!oe(e.textureCache, t.page)) return;
|
|
965
|
-
} else if (!ie(t.family, t.weight, t.style, e.textureCache)) return;
|
|
966
|
-
if (t.quads.length === 0) return;
|
|
967
|
-
let i = t.source === "canvas" ? re(t.page) : se(t.family, t.weight, t.style), o = t.source === "canvas" ? ne : te, s = ae(t.source === "canvas" ? "canvas" : "atlas", t.family, t.weight, t.style);
|
|
968
|
-
if (!s) return;
|
|
969
|
-
let c = t.synthetic.bold ? Mt : 0, l = t.synthetic.italic ? Math.tan(g) : 0, u = Pt(t.fill);
|
|
970
|
-
if (u !== null) {
|
|
971
|
-
Ft(e, t, n, r, u, i, o, c, l, s);
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
let d = t.fill !== null && "color" in t.fill ? a(t.fill.color) : [
|
|
975
|
-
0,
|
|
976
|
-
0,
|
|
977
|
-
0,
|
|
978
|
-
1
|
|
979
|
-
], f = e.drawBatch, p = e.state.transform, { staged: m, slot: h } = U(e, i, s, c), _ = d[3] * (m.foldsAlpha ? e.state.alpha : 1);
|
|
980
|
-
for (let a of t.quads) {
|
|
981
|
-
f.wouldOverflow(4) && (q(e), {staged: m, slot: h} = U(e, i, s, c), _ = d[3] * (m.foldsAlpha ? e.state.alpha : 1));
|
|
982
|
-
let t;
|
|
983
|
-
for (; !f.pushGlyph(a.x0 + n, a.y0 + r, a.x1 + n, a.y1 + r, a.baselineY + r, l, p, a.u0, a.v0, a.u1, a.v1, d[0], d[1], d[2], _, h, o);) t = M(e), {staged: m, slot: h} = U(e, i, s, c), _ = d[3] * (m.foldsAlpha ? e.state.alpha : 1);
|
|
984
|
-
t !== void 0 && (N(e, t), {staged: m, slot: h} = U(e, i, s, c), _ = d[3] * (m.foldsAlpha ? e.state.alpha : 1));
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
function Pt(e) {
|
|
988
|
-
let t = e?.fill ?? "solid";
|
|
989
|
-
return t === "pattern" ? "pattern" : t === "linear-gradient" || t === "radial-gradient" || t === "conic-gradient" ? "gradient" : t === "solid" ? null : "texture";
|
|
990
|
-
}
|
|
991
|
-
var $ = 1;
|
|
992
|
-
function Ft(e, t, n, r, i, a, o, s, c, l) {
|
|
993
|
-
let u = e.glyphPaintProgram?.(i);
|
|
994
|
-
if (!u) return;
|
|
995
|
-
F(e);
|
|
996
|
-
let d = t.fill, f = e.state.transform, p;
|
|
997
|
-
if (i === "pattern") p = dt(e, u, d, D);
|
|
998
|
-
else if (i === "gradient") p = ht(e, u, d, D);
|
|
999
|
-
else {
|
|
1000
|
-
let i = zt(e, d, Lt(t, n, r, c, f));
|
|
1001
|
-
p = i && Bt(e, u, i);
|
|
1002
|
-
}
|
|
1003
|
-
if (!p) return;
|
|
1004
|
-
let m = e.gl;
|
|
1005
|
-
e.textureCache.bind(a, $), m.uniform1i(u.uniform("u_atlas"), $), m.uniform1f(u.uniform("u_synthBold"), s), m.uniform2f(u.uniform("u_fieldScale"), l[0], l[1]), Z(e);
|
|
1006
|
-
let h = e.drawBatch, g = h.clip;
|
|
1007
|
-
h.clip = null;
|
|
1008
|
-
for (let i of t.quads) h.wouldOverflow(4) && It(e), h.pushGlyph(i.x0 + n, i.y0 + r, i.x1 + n, i.y1 + r, i.baselineY + r, c, f, i.u0, i.v0, i.u1, i.v1, 1, 1, 1, 1, $, o);
|
|
1009
|
-
It(e), h.clip = g, m.activeTexture(m.TEXTURE0), m.bindVertexArray(null);
|
|
1010
|
-
}
|
|
1011
|
-
function It(e) {
|
|
1012
|
-
let t = e.drawBatch;
|
|
1013
|
-
t.length !== 0 && (C(e, t.uploadAndBind(), e.gl.UNSIGNED_INT), t.reset());
|
|
1014
|
-
}
|
|
1015
|
-
function Lt(e, t, n, r, i) {
|
|
1016
|
-
let a = {
|
|
1017
|
-
x0: Infinity,
|
|
1018
|
-
y0: Infinity,
|
|
1019
|
-
x1: -Infinity,
|
|
1020
|
-
y1: -Infinity
|
|
1021
|
-
}, o = (e, t) => {
|
|
1022
|
-
let n = i[0] * e + i[3] * t + i[6], r = i[1] * e + i[4] * t + i[7];
|
|
1023
|
-
n < a.x0 && (a.x0 = n), n > a.x1 && (a.x1 = n), r < a.y0 && (a.y0 = r), r > a.y1 && (a.y1 = r);
|
|
1024
|
-
};
|
|
1025
|
-
for (let i of e.quads) {
|
|
1026
|
-
let e = i.x0 + t, a = i.x1 + t, s = i.y0 + n, c = i.y1 + n, l = i.baselineY + n, u = (l - s) * r, d = (l - c) * r;
|
|
1027
|
-
o(e + u, s), o(a + u, s), o(a + d, c), o(e + d, c);
|
|
1028
|
-
}
|
|
1029
|
-
return a;
|
|
1030
|
-
}
|
|
1031
|
-
var Rt = {
|
|
1032
|
-
vertices: new Float32Array([
|
|
1033
|
-
0,
|
|
1034
|
-
0,
|
|
1035
|
-
1,
|
|
1036
|
-
0,
|
|
1037
|
-
1,
|
|
1038
|
-
1,
|
|
1039
|
-
0,
|
|
1040
|
-
1
|
|
1041
|
-
]),
|
|
1042
|
-
indices: new Uint32Array([
|
|
1043
|
-
0,
|
|
1044
|
-
1,
|
|
1045
|
-
2,
|
|
1046
|
-
0,
|
|
1047
|
-
2,
|
|
1048
|
-
3
|
|
1049
|
-
])
|
|
1050
|
-
};
|
|
1051
|
-
function zt(e, t, n) {
|
|
1052
|
-
let r = e.paintScratch, i = l(t.fill)?.bind;
|
|
1053
|
-
if (!r || !i) return null;
|
|
1054
|
-
let a = e.deviceWidth && e.widthCss > 0 ? e.deviceWidth / e.widthCss : 1, o = e.deviceWidth ?? Math.round(e.widthCss), s = e.deviceHeight ?? Math.round(e.heightCss), c = Math.max(0, Math.floor(n.x0 * a)), u = Math.max(0, Math.floor(n.y0 * a)), d = e.imageCache.maxTextureSide, f = Math.min(d, Math.min(o, Math.ceil(n.x1 * a)) - c), p = Math.min(d, Math.min(s, Math.ceil(n.y1 * a)) - u);
|
|
1055
|
-
if (!(f > 0 && p > 0)) return null;
|
|
1056
|
-
let m = c / a, h = u / a, g = f / a, _ = p / a, v = new Float32Array([
|
|
1057
|
-
g,
|
|
1058
|
-
0,
|
|
1059
|
-
0,
|
|
1060
|
-
0,
|
|
1061
|
-
_,
|
|
1062
|
-
0,
|
|
1063
|
-
m,
|
|
1064
|
-
h,
|
|
1065
|
-
1
|
|
1066
|
-
]), y = new Float32Array([
|
|
1067
|
-
2 / g,
|
|
1068
|
-
0,
|
|
1069
|
-
0,
|
|
1070
|
-
0,
|
|
1071
|
-
2 / _,
|
|
1072
|
-
0,
|
|
1073
|
-
-1 - 2 * m / g,
|
|
1074
|
-
-1 - 2 * h / _,
|
|
1075
|
-
1
|
|
1076
|
-
]), b = it(e), ee = {
|
|
1077
|
-
...b,
|
|
1078
|
-
alpha: e.state.alpha,
|
|
1079
|
-
maxTextureSize: b.maxTextureSize,
|
|
1080
|
-
setProjAndModel: (t) => J(e, t, v, y)
|
|
1081
|
-
}, x = e.gl, S = r.acquire(f, p), te = x.isEnabled(x.SCISSOR_TEST);
|
|
1082
|
-
x.activeTexture(x.TEXTURE0), x.bindTexture(x.TEXTURE_2D, null), x.bindFramebuffer(x.FRAMEBUFFER, S.fbo), x.viewport(0, 0, f, p), x.disable(x.SCISSOR_TEST), x.disable(x.STENCIL_TEST), x.clear(x.COLOR_BUFFER_BIT), x.disable(x.BLEND);
|
|
1083
|
-
let ne = i(ee, t);
|
|
1084
|
-
return ne && (x.bindVertexArray(e.meshCache.uploadRecurring(Rt).vao), C(e, Rt.indices.length, x.UNSIGNED_INT), x.bindVertexArray(null)), x.enable(x.BLEND), Oe(e, o, s, te), ne ? {
|
|
1085
|
-
texture: S.texture,
|
|
1086
|
-
uvFromScreen: new Float32Array([
|
|
1087
|
-
a / S.width,
|
|
1088
|
-
0,
|
|
1089
|
-
0,
|
|
1090
|
-
0,
|
|
1091
|
-
a / S.height,
|
|
1092
|
-
0,
|
|
1093
|
-
-c / S.width,
|
|
1094
|
-
-u / S.height,
|
|
1095
|
-
1
|
|
1096
|
-
])
|
|
1097
|
-
} : null;
|
|
1098
|
-
}
|
|
1099
|
-
function Bt(e, t, n) {
|
|
1100
|
-
let r = e.gl;
|
|
1101
|
-
return r.useProgram(t.handle), J(e, t, D), r.uniformMatrix3fv(t.uniform("u_worldInv"), !1, n.uvFromScreen), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, n.texture), r.uniform1i(t.uniform("u_sampler"), 0), t;
|
|
1102
|
-
}
|
|
1103
|
-
function Vt(e, t) {
|
|
1104
|
-
e.imageCache.upload(t.image, t.image);
|
|
1105
|
-
let { staged: n, slot: r } = H(e, t.image, t.sampling ?? "linear"), i = t.source, a = 0, o = 0, s = 1, c = 1;
|
|
1106
|
-
if (i) {
|
|
1107
|
-
let e = t.image.width, n = t.image.height;
|
|
1108
|
-
a = i.x / e, s = (i.x + i.w) / e, o = i.y / n, c = (i.y + i.h) / n;
|
|
1109
|
-
}
|
|
1110
|
-
if (t.flipX) {
|
|
1111
|
-
let e = a;
|
|
1112
|
-
a = s, s = e;
|
|
1113
|
-
}
|
|
1114
|
-
if (t.flipY) {
|
|
1115
|
-
let e = o;
|
|
1116
|
-
o = c, c = e;
|
|
1117
|
-
}
|
|
1118
|
-
e.drawBatch.pushQuad(t.x, t.y, t.w, t.h, e.state.transform, a, o, s, c, (t.opacity ?? 1) * (n.foldsAlpha ? e.state.alpha : 1), r) || P(e, t, void 0, Vt);
|
|
1119
|
-
}
|
|
1120
|
-
function Ht(e, t) {
|
|
1121
|
-
let n = t.sprites, r = Math.floor(n.length / u);
|
|
1122
|
-
if (r === 0) return;
|
|
1123
|
-
e.imageCache.upload(t.image, t.image);
|
|
1124
|
-
let i = t.sampling ?? "linear", { staged: a, slot: o } = H(e, t.image, i), s = e.drawBatch, c = e.state.transform, l = a.foldsAlpha ? e.state.alpha : 1, d = t.image.width, f = t.image.height;
|
|
1125
|
-
for (let p = 0, m = 0; p < r; p++, m += u) {
|
|
1126
|
-
s.wouldOverflow(4) && (q(e), {staged: a, slot: o} = H(e, t.image, i), l = a.foldsAlpha ? e.state.alpha : 1);
|
|
1127
|
-
let r = n[m + 4], u = n[m + 5], p = n[m + 6], h = n[m + 7], g;
|
|
1128
|
-
for (; !s.pushQuad(n[m], n[m + 1], n[m + 2], n[m + 3], c, r / d, u / f, (r + p) / d, (u + h) / f, n[m + 8] * l, o);) g = M(e), {staged: a, slot: o} = H(e, t.image, i), l = a.foldsAlpha ? e.state.alpha : 1;
|
|
1129
|
-
g !== void 0 && (N(e, g), {staged: a, slot: o} = H(e, t.image, i), l = a.foldsAlpha ? e.state.alpha : 1);
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
//#endregion
|
|
1133
|
-
export { Tt as OUTLINE_MIN_SCREEN_PX, A as dispatch, Ae as drawGroup, q as flushBatch, f as getMesh, o as mat3, z as meshBatching, vt as popClip, _t as pushClip, xe as setUniform, K as tryStageFill };
|
|
1134
|
-
|
|
1135
|
-
//# sourceMappingURL=draw.js.map
|