@weasel-js/core 1.9.3 → 1.9.4
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 +356 -0
- package/README.md +2 -2
- package/dist/WeaselProvider.js +5 -5
- package/dist/affordances/composeAffordanceLayer.js +10 -20
- package/dist/affordances/composeAffordanceLayer.js.map +1 -1
- package/dist/affordances/cornerResize.js +25 -17
- package/dist/affordances/cornerResize.js.map +1 -1
- package/dist/affordances/hitAffordanceRegions.js +27 -20
- package/dist/affordances/hitAffordanceRegions.js.map +1 -1
- package/dist/affordances/rotationHandle.js +18 -18
- package/dist/affordances/rotationHandle.js.map +1 -1
- package/dist/animation/behaviors/momentum.js +93 -55
- package/dist/animation/behaviors/momentum.js.map +1 -1
- package/dist/animation/loop.js +10 -12
- package/dist/animation/loop.js.map +1 -1
- package/dist/animation/reflow.js +8 -8
- package/dist/animation/reflow.js.map +1 -1
- package/dist/animation/stagger.js +64 -56
- package/dist/animation/stagger.js.map +1 -1
- package/dist/animation/timeline/booking.js +62 -54
- package/dist/animation/timeline/booking.js.map +1 -1
- package/dist/animation/timeline/createTimeline.js +85 -76
- package/dist/animation/timeline/createTimeline.js.map +1 -1
- package/dist/animation/timeline/sampleTrack.js +13 -5
- package/dist/animation/timeline/sampleTrack.js.map +1 -1
- package/dist/animation/useAnimator.js +45 -35
- package/dist/animation/useAnimator.js.map +1 -1
- package/dist/animation/wrappers/animateLifecycle.js +31 -24
- package/dist/animation/wrappers/animateLifecycle.js.map +1 -1
- package/dist/animation/wrappers/animateOnSetPose.js +28 -26
- 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/{poseDescriptor-D-OH-tu5.d.ts → autoPoseDescriptor-Ct7yqivU.d.ts} +28 -3
- package/dist/barrel/chrome.js +16 -0
- package/dist/barrel/input.js +19 -0
- package/dist/barrel/interactions.js +42 -0
- package/dist/barrel/paint.js +18 -0
- package/dist/barrel/paths.js +19 -0
- package/dist/barrel/renderer.js +20 -0
- package/dist/barrel/routing.js +51 -0
- package/dist/barrel/text.js +18 -0
- package/dist/barrel/viewport.js +52 -0
- package/dist/builtins-DPcdghtB.d.ts +1223 -0
- package/dist/canvas/Canvas.js +363 -448
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +164 -165
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/CursorCoordsHud.js +37 -32
- package/dist/canvas/CursorCoordsHud.js.map +1 -1
- package/dist/canvas/DrawCanvas.js +49 -43
- package/dist/canvas/DrawCanvas.js.map +1 -1
- package/dist/canvas/MinimapCanvas.js +26 -25
- package/dist/canvas/MinimapCanvas.js.map +1 -1
- package/dist/canvas/NodeShape.js +59 -377
- 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/GestureDispatcherMounter.js +167 -0
- package/dist/canvas/SceneCanvas/GestureDispatcherMounter.js.map +1 -0
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +13 -13
- package/dist/canvas/SceneCanvas/StandardActionsRegistrar.js +67 -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 +10 -0
- package/dist/canvas/SceneCanvas/coordTrace.js.map +1 -0
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +112 -70
- 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/features.js +1 -0
- 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 +29 -28
- 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 +38 -0
- package/dist/canvas/SceneCanvas/props.js.map +1 -0
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +21 -62
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +46 -48
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +33 -33
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js.map +1 -1
- package/dist/canvas/SceneCanvas.js +534 -788
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +45 -43
- package/dist/canvas/SceneViewCanvas.js.map +1 -1
- package/dist/canvas/buildSceneLayer.js +91 -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 +68 -52
- package/dist/canvas/canvasRenderer.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/editAnchors.js +28 -28
- package/dist/canvas/deps/insert.js +119 -91
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/slice.js +46 -45
- package/dist/canvas/deps/slice.js.map +1 -1
- package/dist/canvas/deps/textEdit.js +10 -9
- package/dist/canvas/deps/textEdit.js.map +1 -1
- package/dist/canvas/derivedPath.js +46 -23
- package/dist/canvas/derivedPath.js.map +1 -1
- package/dist/canvas/getNodeAtPoint.js +7 -7
- 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/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/minimapMath.js +12 -10
- package/dist/canvas/minimapMath.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 +57 -0
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -0
- package/dist/canvas/nodeShapes/pathPainter.js +38 -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 +10 -11
- package/dist/canvas/paintCull.js.map +1 -1
- package/dist/canvas/pickWalk.js +52 -63
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/poseRotation.js +11 -23
- package/dist/canvas/poseRotation.js.map +1 -1
- package/dist/canvas/renderDebugSnapshot.js +5 -5
- package/dist/canvas/renderSceneToPixels.js +3 -1
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneAdapter.js +66 -148
- 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/sceneSlotWiring.js +4 -4
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +39 -40
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/useCanvasRenderer.js +14 -6
- package/dist/canvas/useCanvasRenderer.js.map +1 -1
- package/dist/canvas/useCanvasView.js +58 -0
- package/dist/canvas/useCanvasView.js.map +1 -0
- package/dist/canvas/useFrameLoop.js +35 -26
- package/dist/canvas/useFrameLoop.js.map +1 -1
- package/dist/canvas/useSceneLayerList.js +21 -0
- package/dist/canvas/useSceneLayerList.js.map +1 -0
- package/dist/clipboard.d.ts +10 -6
- package/dist/clone.d.ts +4 -3
- package/dist/core/adapters/arrayAdapter.js +48 -39
- package/dist/core/adapters/arrayAdapter.js.map +1 -1
- package/dist/core/device/index.js +5 -4
- 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/core/fillInPoseFrame.js.map +1 -1
- package/dist/core/geometry/poseDescriptor.js +21 -19
- package/dist/core/geometry/poseDescriptor.js.map +1 -1
- package/dist/core/geometry/poseFrame.js +44 -0
- package/dist/core/geometry/poseFrame.js.map +1 -0
- package/dist/core/geometry/poseRotation.js.map +1 -1
- package/dist/core/geometry/regionHit.js +9 -10
- package/dist/core/geometry/regionHit.js.map +1 -1
- package/dist/core/geometry/unionBounds.js +31 -29
- package/dist/core/geometry/unionBounds.js.map +1 -1
- package/dist/core/isPlainObject.js +2 -11
- 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/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/paintKinds.js +5 -5
- package/dist/core/paintKinds.js.map +1 -1
- package/dist/core/scene/NodeProperties.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 +101 -0
- package/dist/core/scene/arrivalWindow.js.map +1 -0
- package/dist/core/scene/derivedPath.js.map +1 -1
- package/dist/core/scene/historyFacade.js +84 -0
- package/dist/core/scene/historyFacade.js.map +1 -0
- package/dist/core/scene/kitOps.js +173 -0
- package/dist/core/scene/kitOps.js.map +1 -0
- package/dist/core/scene/layerStack.js +38 -0
- package/dist/core/scene/layerStack.js.map +1 -0
- package/dist/core/scene/lockGuard.js +37 -0
- package/dist/core/scene/lockGuard.js.map +1 -0
- package/dist/core/scene/nodeFnFields.js +5 -6
- 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 +126 -0
- package/dist/core/scene/nodeStore.js.map +1 -0
- package/dist/core/scene/pickability.js +6 -0
- package/dist/core/scene/pickability.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/poseOverrides.js +34 -38
- package/dist/core/scene/poseOverrides.js.map +1 -1
- package/dist/core/scene/renderOrder.js +84 -0
- package/dist/core/scene/renderOrder.js.map +1 -0
- package/dist/core/scene/scene.js +289 -866
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/serialization.js +68 -0
- package/dist/core/scene/serialization.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/types.js.map +1 -1
- package/dist/core/viewport/meanScale.js +1 -1
- package/dist/core/viewport/meanScale.js.map +1 -1
- package/dist/core/viewport/view.js +12 -12
- package/dist/core/viewport/view.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-CtCb8a3G.d.ts} +1 -1
- package/dist/debug/createDebugOverlayLayer.js +14 -14
- package/dist/debug/createDebugOverlayLayer.js.map +1 -1
- package/dist/debug/flag.js +2 -41
- package/dist/features/chrome-caps/useHoverTracking.js +22 -17
- package/dist/features/chrome-caps/useHoverTracking.js.map +1 -1
- package/dist/features/focus/gateLayer.js +3 -4
- package/dist/features/focus/gateLayer.js.map +1 -1
- package/dist/features/images/imageCache.js +19 -9
- package/dist/features/images/imageCache.js.map +1 -1
- package/dist/features/ingestion/contentHandlers.js +14 -11
- package/dist/features/ingestion/contentHandlers.js.map +1 -1
- package/dist/features/ingestion/index.js +1 -1
- package/dist/features/ingestion/registerKitHandlers.js +7 -7
- package/dist/features/ingestion/weaselJsonHandler.js +17 -14
- package/dist/features/ingestion/weaselJsonHandler.js.map +1 -1
- package/dist/features/meshPaint/lazyKind.js +201 -35
- package/dist/features/meshPaint/lazyKind.js.map +1 -1
- package/dist/features/meshPaint/meshPaint.js +82 -79
- package/dist/features/meshPaint/meshPaint.js.map +1 -1
- package/dist/features/minimap/createMinimapContribution.js +42 -42
- package/dist/features/minimap/layers.js +44 -62
- package/dist/features/minimap/layers.js.map +1 -1
- package/dist/features/parallax/createParallaxPlane.js +10 -14
- package/dist/features/parallax/createParallaxPlane.js.map +1 -1
- package/dist/features/paths/anchorEdits.js +19 -8
- package/dist/features/paths/anchorEdits.js.map +1 -1
- package/dist/features/paths/anchors.js +31 -26
- package/dist/features/paths/anchors.js.map +1 -1
- package/dist/features/paths/booleans.js +2 -2
- package/dist/features/paths/index.js +13 -11
- package/dist/features/paths/markerCommands.js +37 -36
- package/dist/features/paths/markerCommands.js.map +1 -1
- package/dist/features/paths/pathInWorld.js +19 -19
- package/dist/features/paths/pathInWorld.js.map +1 -1
- package/dist/features/paths/pathLayer.js.map +1 -1
- package/dist/features/paths/strokeToPath.js +40 -0
- package/dist/features/paths/strokeToPath.js.map +1 -0
- package/dist/features/paths/tessellate/stroke.js.map +1 -1
- package/dist/features/patterns/commandPaint.js +18 -0
- package/dist/features/patterns/commandPaint.js.map +1 -0
- package/dist/features/patterns/index.js +5 -17
- package/dist/features/patterns/index.js.map +1 -1
- package/dist/features/patterns/rasterizeTile.js +17 -0
- package/dist/features/patterns/rasterizeTile.js.map +1 -0
- package/dist/features/patterns/resolveSpec.js +52 -44
- package/dist/features/patterns/resolveSpec.js.map +1 -1
- package/dist/features/poseRun/usePoseRun.js +8 -3
- package/dist/features/poseRun/usePoseRun.js.map +1 -1
- package/dist/features/selection/SelectionContext.js +5 -0
- package/dist/features/selection/SelectionContext.js.map +1 -1
- package/dist/features/selection/overlay.js +18 -18
- package/dist/features/selection/overlay.js.map +1 -1
- package/dist/features/text/domOffsets.js +82 -0
- package/dist/features/text/domOffsets.js.map +1 -0
- package/dist/features/text/domRuns.js +103 -131
- package/dist/features/text/domRuns.js.map +1 -1
- package/dist/features/text/hitTest.js +5 -2
- package/dist/features/text/hitTest.js.map +1 -1
- package/dist/features/text/isTextData.js +8 -0
- package/dist/features/text/isTextData.js.map +1 -0
- package/dist/features/text/overlayDirection.js +15 -0
- package/dist/features/text/overlayDirection.js.map +1 -0
- package/dist/features/text/runs/rangeStyle.js +32 -34
- package/dist/features/text/runs/rangeStyle.js.map +1 -1
- package/dist/features/text/textCommand.js +34 -33
- package/dist/features/text/textCommand.js.map +1 -1
- package/dist/features/text/textToPath.js +40 -40
- package/dist/features/text/textToPath.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +76 -82
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/text/useTextEdit.js +184 -160
- package/dist/features/text/useTextEdit.js.map +1 -1
- package/dist/features/tiling/createTiledLayer.js +24 -22
- package/dist/features/tiling/createTiledLayer.js.map +1 -1
- package/dist/index.d.ts +11033 -7749
- package/dist/index.js +316 -309
- package/dist/input/keyState.js +42 -43
- 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/align/align.js +8 -8
- package/dist/interactions/actions/clipboard/clipboardOps.js +34 -32
- 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/behaviors/cloneByAltDrag.js.map +1 -1
- package/dist/interactions/actions/defaultCommitAdapter.js +20 -18
- package/dist/interactions/actions/defaultCommitAdapter.js.map +1 -1
- package/dist/interactions/actions/defaults/align.js +9 -10
- package/dist/interactions/actions/defaults/align.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +59 -81
- 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/clipboard.js +26 -10
- package/dist/interactions/actions/defaults/clipboard.js.map +1 -1
- package/dist/interactions/actions/defaults/clone.js +44 -60
- package/dist/interactions/actions/defaults/clone.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/distribute.js +14 -13
- package/dist/interactions/actions/defaults/distribute.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +17 -57
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/editAnchors.js +18 -18
- package/dist/interactions/actions/defaults/enterTextEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/flip.js +52 -46
- package/dist/interactions/actions/defaults/flip.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +43 -48
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +35 -33
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insert.js +50 -51
- package/dist/interactions/actions/defaults/insert.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +7 -7
- package/dist/interactions/actions/defaults/lassoSelect.js +67 -70
- package/dist/interactions/actions/defaults/lassoSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/move.js +267 -249
- package/dist/interactions/actions/defaults/move.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +40 -68
- 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/reorder.js +2 -0
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/resize.js +104 -98
- package/dist/interactions/actions/defaults/resize.js.map +1 -1
- package/dist/interactions/actions/defaults/rotate.js +111 -110
- package/dist/interactions/actions/defaults/rotate.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +7 -7
- package/dist/interactions/actions/defaults/setFillOpacity.js +4 -4
- package/dist/interactions/actions/defaults/setStroke.js +12 -12
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +6 -6
- package/dist/interactions/actions/defaults/sliceOps.js +19 -19
- package/dist/interactions/actions/defaults/viewportDragPan.js +37 -26
- package/dist/interactions/actions/defaults/viewportDragPan.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/geometry.js +28 -23
- package/dist/interactions/actions/edit-anchors/geometry.js.map +1 -1
- package/dist/interactions/actions/flip/helpers.js +30 -17
- package/dist/interactions/actions/flip/helpers.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/lasso-select/behaviors/selectFromLasso.js +14 -18
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js.map +1 -1
- 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 +32 -21
- package/dist/interactions/actions/move/behaviors/snapToContainer.js.map +1 -1
- package/dist/interactions/actions/move/gestureAdapter.js +32 -15
- 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/outlines/createOutlines.js +18 -18
- package/dist/interactions/actions/poseDescriptorDep.js +16 -4
- package/dist/interactions/actions/poseDescriptorDep.js.map +1 -1
- package/dist/interactions/actions/poseFrame.js +11 -6
- package/dist/interactions/actions/poseFrame.js.map +1 -1
- package/dist/interactions/actions/previewOverrides.js +5 -5
- package/dist/interactions/actions/previewOverrides.js.map +1 -1
- package/dist/interactions/actions/selectionSubtree.js +69 -0
- package/dist/interactions/actions/selectionSubtree.js.map +1 -0
- package/dist/interactions/actions/useStandardActions.js +66 -62
- 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 +8 -6
- package/dist/interactions/gestures/pointerDrag/pointerDrag.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/{math-Drrw4ewZ.d.ts → math-J-ACHyEg.d.ts} +1 -2
- package/dist/math.d.ts +2 -3
- package/dist/move.d.ts +12 -11
- package/dist/{originProjection-DEklpDc_.d.ts → originProjection-gHnOup4e.d.ts} +1 -1
- package/dist/{registerProgram-BMZRDgrh.d.ts → registerProgram-T9S_PfAX.d.ts} +18 -7
- package/dist/renderer/DrawCommand.js.map +1 -1
- package/dist/renderer/WeaselRenderer.js +75 -73
- package/dist/renderer/WeaselRenderer.js.map +1 -1
- package/dist/renderer/cache/GLImageCache.js +15 -5
- package/dist/renderer/cache/GLImageCache.js.map +1 -1
- package/dist/renderer/cache/GLMeshCache.js +23 -23
- package/dist/renderer/cache/GLMeshCache.js.map +1 -1
- package/dist/renderer/cache/GLTextureCache.js +18 -1
- package/dist/renderer/cache/GLTextureCache.js.map +1 -1
- package/dist/renderer/cache/cache.js.map +1 -1
- package/dist/renderer/cache/markerCommandCache.js.map +1 -1
- package/dist/renderer/cache/strokeMeshCache.js.map +1 -1
- package/dist/renderer/cullDrawCommands.js +11 -11
- package/dist/renderer/draw/batch.js +133 -0
- package/dist/renderer/draw/batch.js.map +1 -0
- package/dist/renderer/draw/clip.js +89 -0
- package/dist/renderer/draw/clip.js.map +1 -0
- package/dist/renderer/draw/customShader.js +230 -0
- package/dist/renderer/draw/customShader.js.map +1 -0
- package/dist/renderer/draw/drawTriangles.js +8 -0
- package/dist/renderer/draw/drawTriangles.js.map +1 -0
- package/dist/renderer/draw/effects.js +28 -0
- package/dist/renderer/draw/effects.js.map +1 -0
- package/dist/renderer/draw/flushBatch.js +35 -0
- package/dist/renderer/draw/flushBatch.js.map +1 -0
- package/dist/renderer/draw/gradient.js +90 -0
- package/dist/renderer/draw/gradient.js.map +1 -0
- package/dist/renderer/draw/image.js +38 -0
- package/dist/renderer/draw/image.js.map +1 -0
- package/dist/renderer/draw/mesh.js +16 -0
- package/dist/renderer/draw/mesh.js.map +1 -0
- package/dist/renderer/draw/paintBind.js +70 -0
- package/dist/renderer/draw/paintBind.js.map +1 -0
- package/dist/renderer/draw/pathPaint.js +142 -0
- package/dist/renderer/draw/pathPaint.js.map +1 -0
- package/dist/renderer/draw/scratchPass.js +83 -0
- package/dist/renderer/draw/scratchPass.js.map +1 -0
- package/dist/renderer/draw/stencil.js +28 -0
- package/dist/renderer/draw/stencil.js.map +1 -0
- package/dist/renderer/draw/text.js +167 -0
- package/dist/renderer/draw/text.js.map +1 -0
- package/dist/renderer/draw/uniforms.js +77 -0
- package/dist/renderer/draw/uniforms.js.map +1 -0
- package/dist/renderer/draw.js +60 -1116
- package/dist/renderer/draw.js.map +1 -1
- package/dist/renderer/effects/EffectTargets.js +3 -0
- package/dist/renderer/effects/EffectTargets.js.map +1 -1
- package/dist/renderer/effects/composite.js +7 -5
- package/dist/renderer/effects/composite.js.map +1 -1
- package/dist/renderer/index.js +18 -17
- package/dist/renderer/math/color.js +63 -83
- package/dist/renderer/math/color.js.map +1 -1
- package/dist/renderer/math/mat3.js +15 -11
- package/dist/renderer/math/mat3.js.map +1 -1
- package/dist/renderer/math/viewToMat3.js +1 -1
- package/dist/renderer/math/viewToMat3.js.map +1 -1
- package/dist/renderer/shaders/ShaderProgram.js +13 -13
- package/dist/renderer/shaders/ShaderProgram.js.map +1 -1
- package/dist/renderer/shaders/glyphPaint.js +3 -3
- package/dist/renderer/shaders/glyphPaint.js.map +1 -1
- package/dist/renderer/shaders/gradFill.js +2 -1
- package/dist/renderer/shaders/gradFill.js.map +1 -1
- package/dist/renderer/shaders/pathFill.js +2 -1
- package/dist/renderer/shaders/pathFill.js.map +1 -1
- package/dist/renderer/shaders/patternFill.js +2 -1
- package/dist/renderer/shaders/patternFill.js.map +1 -1
- package/dist/renderer/shaders/registerProgram.js.map +1 -1
- package/dist/renderer/strokeLengths.js.map +1 -1
- package/dist/renderer/textures/registerTexture.js +25 -5
- package/dist/renderer/textures/registerTexture.js.map +1 -1
- package/dist/renderer.d.ts +16 -15
- package/dist/renderer.js +17 -16
- package/dist/resize.d.ts +5 -6
- package/dist/resize.js +5 -5
- 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-seams-CuIxe0xY.d.ts → test-seams-DM2B87-g.d.ts} +4 -4
- package/dist/test-seams.d.ts +2 -2
- package/dist/tools/builtin/ellipse/useEllipseTool.js +1 -0
- package/dist/tools/builtin/ellipse/useEllipseTool.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/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 +153 -103
- 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/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/selectionContributions.js +24 -23
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +51 -48
- 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 +49 -54
- 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 +1 -0
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/tools/useKeybindings.js +14 -30
- package/dist/tools/useKeybindings.js.map +1 -1
- package/dist/{types-B_9g6hMM.d.ts → types-B4iJRHC3.d.ts} +5 -1
- package/dist/{types-A37hYkeR.d.ts → types-k-5Oqh-U.d.ts} +31 -7
- package/dist/util/color.js +3 -3
- package/dist/util/color.js.map +1 -1
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +20 -18
- package/dist/autoPoseDescriptor-vCdt55xm.d.ts +0 -27
- package/dist/builtins-C-VgUlWI.d.ts +0 -4514
- package/dist/core/isPlainObject.js.map +0 -1
- package/dist/debug/flag.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/renderer/shaders/imageFill.js +0 -14
- package/dist/renderer/shaders/imageFill.js.map +0 -1
- package/dist/tools/prefs.js +0 -62
- package/dist/tools/prefs.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { clientToWorld as e } from "../../core/viewport/clientToWorld.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useOptionalViewRegistry as t } from "../viewRegistry.js";
|
|
3
|
+
import { PointerContextProvider as n, usePointerContext as r } from "../../features/pointer/PointerContext.js";
|
|
4
4
|
import { useEffect as i } from "react";
|
|
5
5
|
import { Fragment as a, jsx as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/canvas/SceneCanvas/PointerProviderIfRoot.tsx
|
|
7
7
|
function s({ children: e }) {
|
|
8
|
-
return
|
|
8
|
+
return r() ? /* @__PURE__ */ o(a, { children: e }) : /* @__PURE__ */ o(n, { children: e });
|
|
9
9
|
}
|
|
10
|
-
function c({ canvasRef:
|
|
11
|
-
let a =
|
|
10
|
+
function c({ canvasRef: n }) {
|
|
11
|
+
let a = r(), o = t();
|
|
12
12
|
return i(() => {
|
|
13
13
|
if (!a) return;
|
|
14
|
-
let
|
|
15
|
-
if (!
|
|
16
|
-
let r = (
|
|
17
|
-
let s = o?.resolver.at(
|
|
14
|
+
let t = n.current;
|
|
15
|
+
if (!t) return;
|
|
16
|
+
let r = (n, r, i) => {
|
|
17
|
+
let s = o?.resolver.at(n, r, i), c = t.getBoundingClientRect(), [l, u] = e(r, i, s?.origin ?? c, s?.view ?? {
|
|
18
18
|
x: 0,
|
|
19
19
|
y: 0,
|
|
20
20
|
scale: {
|
|
@@ -34,14 +34,14 @@ function c({ canvasRef: t }) {
|
|
|
34
34
|
}
|
|
35
35
|
a.set(null);
|
|
36
36
|
}, c = (e) => {
|
|
37
|
-
e.target !==
|
|
37
|
+
e.target !== t && e.buttons !== 0 && r(e.pointerId, e.clientX, e.clientY);
|
|
38
38
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
39
|
+
return t.addEventListener("pointermove", i), t.addEventListener("pointerleave", s), document.addEventListener("pointermove", c), () => {
|
|
40
|
+
t.removeEventListener("pointermove", i), t.removeEventListener("pointerleave", s), document.removeEventListener("pointermove", c);
|
|
41
41
|
};
|
|
42
42
|
}, [
|
|
43
43
|
a,
|
|
44
|
-
|
|
44
|
+
n,
|
|
45
45
|
o
|
|
46
46
|
]), null;
|
|
47
47
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useDecayLoop as e } from "../../core/viewport/useDecayLoop.js";
|
|
2
|
+
import { usePointerContext as t } from "../../features/pointer/PointerContext.js";
|
|
3
|
+
import { useStandardActions as n } from "../../interactions/actions/useStandardActions.js";
|
|
4
|
+
import { usePoseDescriptorDepSource as r } from "../deps/poseDescriptor.js";
|
|
5
|
+
import { usePoseCompositionDepSource as i } from "../deps/poseComposition.js";
|
|
6
|
+
import { useSliceDepSource as a } from "../deps/slice.js";
|
|
7
|
+
import { useLayoutArrivals as o } from "../../layout/arrivals.js";
|
|
8
|
+
import { useViewDepSource as s } from "../deps/view.js";
|
|
9
|
+
import { useAreaSelectDepSource as c } from "../deps/areaSelect.js";
|
|
10
|
+
import { useNodeAtPointDepSource as l } from "../deps/nodeAtPoint.js";
|
|
11
|
+
import { useLassoSelectDepSource as u } from "../deps/lassoSelect.js";
|
|
12
|
+
import { useTextEditDepSource as d } from "../deps/textEdit.js";
|
|
13
|
+
import { useEditAnchorsDepSource as f } from "../deps/editAnchors.js";
|
|
14
|
+
import { useInsertDepSource as p } from "../deps/insert.js";
|
|
15
|
+
import { useSnapDepSource as m } from "../deps/snap.js";
|
|
16
|
+
import { useDebugDepSource as h } from "../deps/debug.js";
|
|
17
|
+
import { useDepChangeNotices as g } from "../deps/changes.js";
|
|
18
|
+
import { useDispatcherDepSource as _ } from "../deps/dispatcher.js";
|
|
19
|
+
import { useLayoutDepSource as ee } from "../deps/layout.js";
|
|
20
|
+
import { useIngestionDepSource as te } from "../deps/ingestion.js";
|
|
21
|
+
import { GeometryProjectionRegistrar as ne, ResizePolicyRegistrar as re } from "./poseRegistrars.js";
|
|
22
|
+
import { useActionsPropResolver as ie } from "./useActionsPropResolver.js";
|
|
23
|
+
import { useViewportActions as v } from "./useViewportActions.js";
|
|
24
|
+
import { useEffect as y } from "react";
|
|
25
|
+
import { useActionsRegistry as b, useDepSource as x } from "@weasel-js/routing/react";
|
|
26
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
27
|
+
//#region src/canvas/SceneCanvas/StandardActionsRegistrar.tsx
|
|
28
|
+
function T({ selection: T, scene: E, adapter: D, actions: O, excludeActions: k, currentViewRef: A, onViewChange: j, resizeOptions: M, poseDescriptor: N, geometryProjection: P, dispatcher: F, getActionRef: I, pickEvery: L, layerIsPainted: ae, alphaOf: R, viewportPanEnabled: z, viewportZoom: B, viewportPinchZoom: V, viewportRecenter: H, viewAnimation: U, editAnchorsExternalState: W, anchorEditingAllowed: G, poseComposition: K, layouts: q, layoutDropTarget: J, reflowTransition: oe, insertNodeFactories: se, insertPaint: ce, snapPoint: le, canvasRef: Y, canvasApiRef: X, ingestionResolveSrc: ue, ingestionSvg: de, ingestionClipboard: fe, actionsRegistryRef: Z }) {
|
|
29
|
+
let Q = b();
|
|
30
|
+
y(() => (Z.current = Q, () => {
|
|
31
|
+
Z.current = null;
|
|
32
|
+
}), [Q, Z]), y(() => {
|
|
33
|
+
if (Q) return Q.setDispatcher(F);
|
|
34
|
+
}, [Q, F]), y(() => {
|
|
35
|
+
if (Q) return I.current = (e) => Q.list().find((t) => t.id === e), () => {
|
|
36
|
+
I.current = null;
|
|
37
|
+
};
|
|
38
|
+
}, [Q, I]);
|
|
39
|
+
let pe = e(), $ = s(A, j, H, () => {
|
|
40
|
+
let e = Y.current;
|
|
41
|
+
return e ? {
|
|
42
|
+
width: e.clientWidth,
|
|
43
|
+
height: e.clientHeight
|
|
44
|
+
} : null;
|
|
45
|
+
}, U, pe, ae);
|
|
46
|
+
n({
|
|
47
|
+
selection: T,
|
|
48
|
+
scene: E,
|
|
49
|
+
view: $,
|
|
50
|
+
history: E.history,
|
|
51
|
+
exclude: k
|
|
52
|
+
}), x("rootView", () => $);
|
|
53
|
+
let me = t();
|
|
54
|
+
return x("pointer", () => me ?? void 0), v({
|
|
55
|
+
pan: z,
|
|
56
|
+
zoom: B,
|
|
57
|
+
pinchZoom: V
|
|
58
|
+
}), c(E, T, N, K, R), l(L), ee(E, q, J, oe), o(E, {
|
|
59
|
+
layouts: q,
|
|
60
|
+
poseDescriptor: N,
|
|
61
|
+
poseComposition: K
|
|
62
|
+
}), p(E, D, se, ce), a(E, T, D, K, N), m(le), h(X), g(E, T.current), te(Y, () => A.current, ue, de, fe), u(E, T, N, K, R), d(E), f(E, T, D, W, { anchorEditingAllowed: G }), _(F), r(N), i(K), ie(O, k.join("|")), /* @__PURE__ */ w(S, { children: [M ? /* @__PURE__ */ C(re, { options: M }) : null, P ? /* @__PURE__ */ C(ne, { projection: P }) : null] });
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { T as StandardActionsRegistrar };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=StandardActionsRegistrar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StandardActionsRegistrar.js","names":["_Fragment","StandardActionsRegistrar","registry","useActionsRegistry","useEffect","actionsRegistryRef","dispatcher","a","id","getActionRef","decayLoop","useDecayLoop","view","useViewDepSource","currentViewRef","onViewChange","viewportRecenter","el","canvasRef","viewAnimation","layerIsPainted","useStandardActions","scene","excludeActions","useDepSource","pointer","usePointerContext","useViewportActions","viewportPanEnabled","viewportZoom","viewportPinchZoom","useAreaSelectDepSource","selection","poseDescriptor","poseComposition","alphaOf","useNodeAtPointDepSource","pickEvery","useLayoutDepSource","layouts","layoutDropTarget","reflowTransition","useLayoutArrivals","useInsertDepSource","adapter","insertNodeFactories","insertPaint","useSliceDepSource","useSnapDepSource","snapPoint","useDebugDepSource","canvasApiRef","useDepChangeNotices","useIngestionDepSource","ingestionResolveSrc","ingestionSvg","ingestionClipboard","useLassoSelectDepSource","useTextEditDepSource","useEditAnchorsDepSource","editAnchorsExternalState","useDispatcherDepSource","usePoseDescriptorDepSource","usePoseCompositionDepSource","useActionsPropResolver","actions","Fragment","resizeOptions","ResizePolicyRegistrar","geometryProjection","GeometryProjectionRegistrar"],"sources":["../../../src/canvas/SceneCanvas/StandardActionsRegistrar.tsx"],"sourcesContent":["import type { Action, ActionsProp, ActionsRegistry } from '@weasel-js/routing';\nimport type { Dispatcher } from '@weasel-js/routing';\nimport { useActionsRegistry, useDepSource } from '@weasel-js/routing/react';\nimport type { Scene } from 'core/scene/types';\nimport type { SelectionApi } from 'core/selection/useSelection';\nimport { useDecayLoop } from 'core/viewport/useDecayLoop';\nimport type { ViewAnimationApi } from 'core/viewport/useViewAnimation';\nimport type { View } from 'core/viewport/view';\nimport { usePointerContext } from 'features/pointer/PointerContext';\nimport type { PinchZoomOptions } from 'interactions/actions/defaults/pinchZoom';\nimport type { WheelPanOptions } from 'interactions/actions/defaults/viewportWheelPan';\nimport type { ViewportZoomOptions } from 'interactions/actions/defaults/viewportZoom';\nimport type { ClipboardIngestCtx, SvgIngestOptions } from 'interactions/actions/depSchema';\nimport type { GeometryProjection } from 'interactions/actions/geometryProjection';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { UseResizeOptions } from 'interactions/actions/resize/options';\nimport { useStandardActions } from 'interactions/actions/useStandardActions';\nimport type React from 'react';\nimport { useEffect } from 'react';\nimport { useLayoutArrivals } from '../../layout/arrivals';\nimport type { LayoutDropTargetMode, ReflowTransition } from '../../layout/types';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport {\n useAreaSelectDepSource,\n useDebugDepSource,\n useDepChangeNotices,\n useDispatcherDepSource,\n useEditAnchorsDepSource,\n useIngestionDepSource,\n useInsertDepSource,\n useLassoSelectDepSource,\n useLayoutDepSource,\n useNodeAtPointDepSource,\n usePoseCompositionDepSource,\n usePoseDescriptorDepSource,\n useSliceDepSource,\n useSnapDepSource,\n useTextEditDepSource,\n useViewDepSource,\n type InsertNodeFactory,\n type InsertPaint\n} from '../deps';\nimport { GeometryProjectionRegistrar, ResizePolicyRegistrar } from './poseRegistrars';\nimport type { BridgeAdapter, SceneCanvasProps } from './props';\nimport { useActionsPropResolver } from './useActionsPropResolver';\nimport { useViewportActions } from './useViewportActions';\n\n/**\n * Registers the kit's default action set into this canvas's input scope.\n *\n * For `delete`, `duplicate`, `group`, and `ungroup` the descriptor's\n * invoker is a stub (those deps aren't in `DepSchema` yet — Phase 4 T8\n * TODO). This component registers legacy bridge overrides for them so the\n * consumer-facing `run` path is functional. The overrides land after the\n * descriptor registrations (last-writer-wins) and use the same id, so the\n * dispatcher and keybinding system see a real `run` body.\n */\nexport function StandardActionsRegistrar({\n selection,\n scene,\n adapter,\n actions,\n excludeActions,\n currentViewRef,\n onViewChange,\n resizeOptions,\n poseDescriptor,\n geometryProjection,\n dispatcher,\n getActionRef,\n pickEvery,\n layerIsPainted,\n alphaOf,\n viewportPanEnabled,\n viewportZoom,\n viewportPinchZoom,\n viewportRecenter,\n viewAnimation,\n editAnchorsExternalState,\n anchorEditingAllowed,\n poseComposition,\n layouts,\n layoutDropTarget,\n reflowTransition,\n insertNodeFactories,\n insertPaint,\n snapPoint,\n canvasRef,\n canvasApiRef,\n ingestionResolveSrc,\n ingestionSvg,\n ingestionClipboard,\n actionsRegistryRef,\n}: {\n selection: SelectionApi;\n scene: Scene<unknown, string, unknown>;\n adapter: BridgeAdapter;\n actionDefaults?: SceneCanvasProps<unknown, string, unknown>['actionDefaults'];\n actions?: ActionsProp;\n /** Kit-standard action ids this canvas's presets and tools leave out. */\n excludeActions: readonly string[];\n currentViewRef: React.RefObject<View>;\n onViewChange: (v: View) => void;\n /** Forwarded from `selectTool.resize` — wires the `resizePolicy` dep\n * consumed by the dispatcher-path `resizeAction`. The legacy\n * `useResizeTool` consumes the same options separately (both paths run\n * in parallel during the dispatcher migration). */\n resizeOptions?: UseResizeOptions<unknown>;\n /** Forwarded from `SceneCanvasProps.poseDescriptor` — wires the\n * `poseDescriptor` dep every built-in pose-touching action reads. */\n poseDescriptor: PoseDescriptor<unknown>;\n /** Forwarded from `SceneCanvasProps.geometryProjection` — wires the\n * `geometryProjection` dep consumed by pose-transform actions (move,\n * resize, nudge, flip). Conditionally mounted so absent → dep undefined. */\n geometryProjection?: GeometryProjection;\n /** Forwarded so `cancelGestureAction` and other actions that need to\n * abort in-flight handles can read the dispatcher's control surface. */\n dispatcher: Dispatcher;\n /** Ref populated with a live action-lookup function so the dispatcher's\n * `getAction` closure can resolve action ids after the registry is\n * mounted. Set on first render; cleared on unmount. */\n getActionRef: React.MutableRefObject<((id: string) => Action | undefined) | null>;\n /** World-space picker forwarded so the `nodeAtPoint` dep source can\n * reuse the same hit-test plumbing the tool dispatcher uses. */\n pickEvery: (worldX: number, worldY: number) => string[];\n /** This canvas's own view gate for scene layers, published on the `view`\n * dep and read by the selecting actions. Absent when it hides nothing. */\n layerIsPainted?: (layerId: string) => boolean;\n /** The composed paint alpha, when the consumer fades anything, so a region\n * select passes over what is painted at zero. */\n alphaOf?: (id: string) => number;\n /** Resolved `viewport.pan` flag — default true, false to disable. */\n viewportPanEnabled: boolean | WheelPanOptions;\n /** Resolved `viewport.zoom` setting — `true` (default Cmd+wheel zoom),\n * `false` (disabled), or a {@link ViewportZoomOptions} config. */\n viewportZoom: boolean | ViewportZoomOptions;\n /** Resolved `viewport.pinchZoom` setting — `true` (default two-finger pinch),\n * `false` (disabled), or a {@link PinchZoomOptions} scale clamp. */\n viewportPinchZoom: boolean | PinchZoomOptions;\n /** Optional recenter callback. When supplied, wires through to the\n * `view` dep so `viewport.zoom` reset (Cmd-0) calls it instead of\n * snapping to identity. A returned `View` is a target the kit may\n * animate to; `void` means the callback dispatched it itself. */\n viewportRecenter?: () => View | void;\n /** The canvas's camera runner, published on the `view` dep so\n * `viewport.zoom`'s discrete branches can animate. */\n viewAnimation: ViewAnimationApi;\n /** Lifted edit-mode state so the `pathEditingOverlay` chrome (rendered\n * outside this subtree) can read the same `editingId` the dep does. */\n editAnchorsExternalState: import('../deps/editAnchors').EditAnchorsStateRef;\n /** Present only when a mode registry is wired (`modes`); see\n * `EditAnchorsDepOptions.anchorEditingAllowed` for why absence — not a\n * predicate over an empty capability set — is the safe default. */\n anchorEditingAllowed?: () => boolean;\n /** Forwarded from `SceneCanvasProps` so the `layout` dep source can wire\n * the per-container layout strategy lookup consumed by `moveAction`. */\n layouts?: SceneCanvasProps<unknown, string, unknown>['layouts'];\n layoutDropTarget?: LayoutDropTargetMode;\n reflowTransition?: ReflowTransition<unknown> | null;\n /** Forwarded from `SceneCanvasProps` so the marquee and lasso dep sources\n * test where a node is drawn rather than where its pose is stored. */\n poseComposition?: SceneCanvasProps<unknown, string, unknown>['poseComposition'];\n /** Forwarded from `SceneCanvasProps` so `useInsertDepSource` can wire the\n * consumer's per-kind node factories into the `insert` dep. */\n insertNodeFactories?: Record<string, InsertNodeFactory>;\n insertPaint?: InsertPaint;\n /** Forwarded from `SceneCanvasProps.toolOptions.snapPoint` so the `snap`\n * dep source can expose grid snapping to `insertAction`. */\n snapPoint?: (p: { x: number; y: number }) => { x: number; y: number };\n /** The canvas element ref, so `useIngestionDepSource` can compute the\n * visible world rect from the client rect + current view. */\n canvasRef: React.RefObject<HTMLElement | null>;\n /** The canvas handle, whose debug sink backs the `debug` dep. */\n canvasApiRef: React.RefObject<CanvasExtensionApi | null>;\n /** Forwarded from `SceneCanvasProps.ingestion.resolveSrc` — consumer\n * file→src override for the kit image handler. */\n ingestionResolveSrc?: (file: File) => Promise<string>;\n /** Forwarded from `SceneCanvasProps.ingestion.svg` — kit SVG-handler\n * options (`unpack`). */\n ingestionSvg?: SvgIngestOptions;\n /** Clipboard-paste ctx (this canvas's adapter + the consumer's reviver)\n * for the kit weasel-JSON handler — built in SceneCanvasInner where the\n * typed adapter is in scope; absent when disabled. */\n ingestionClipboard?: ClipboardIngestCtx;\n /** Populated with the live registry so `CanvasExtensionApi.ingest`\n * (assembled in SceneCanvasInner, OUTSIDE the actions provider) can call\n * `registry.trigger('ingest', …)`. Cleared on unmount. */\n actionsRegistryRef: React.MutableRefObject<ActionsRegistry | null>;\n}) {\n const registry = useActionsRegistry();\n\n // Stash the registry for SceneCanvasInner's imperative `ingest` handle.\n useEffect(() => {\n actionsRegistryRef.current = registry;\n return () => { actionsRegistryRef.current = null; };\n }, [registry, actionsRegistryRef]);\n\n // Wire the dispatcher into the registry so registry.begin() can delegate\n // to dispatcher.beginUiOngoing() for UI-driven ongoing actions (color,\n // opacity).\n useEffect(() => {\n if (!registry) return;\n return registry.setDispatcher(dispatcher);\n }, [registry, dispatcher]);\n\n // Populate the action-lookup ref so the dispatcher's getAction closure\n // can resolve action ids once the registry is in scope.\n useEffect(() => {\n if (!registry) return;\n getActionRef.current = (id: string) => registry.list().find((a) => a.id === id);\n return () => { getActionRef.current = null; };\n }, [registry, getActionRef]);\n\n // Momentum for `viewport.dragPan`. The loop must be a hook (it owns a\n // `useVisibleRaf`), so it is built here and republished on the view dep.\n const decayLoop = useDecayLoop();\n\n // Build the ViewApi (stable identity, refreshed closures) and hand it to\n // useStandardActions (which publishes the `view` dep along with selection,\n // scene, history, pointer, activeTool). `hostSize` reads the live canvas\n // element so keyboard zoom (Cmd+=/-) can anchor at the visible center.\n const view = useViewDepSource(\n currentViewRef,\n onViewChange,\n viewportRecenter,\n () => {\n const el = canvasRef.current;\n return el ? { width: el.clientWidth, height: el.clientHeight } : null;\n },\n viewAnimation,\n decayLoop,\n layerIsPainted,\n );\n useStandardActions({ selection, scene, view, history: scene.history, exclude: excludeActions });\n // A view overlays `view` with its own camera; this name it leaves alone.\n useDepSource('rootView', () => view);\n const pointer = usePointerContext();\n useDepSource('pointer', () => pointer ?? undefined);\n\n // viewport.pan / viewport.zoom are SceneCanvas-coupled (need the `view` dep\n // published just above), so they're registered here rather than in\n // KIT_STANDARD_DESCRIPTORS. Both default ON; consumer opts out via\n // `viewport={{ pan: false }}` / `viewport={{ zoom: false }}`.\n useViewportActions({ pan: viewportPanEnabled, zoom: viewportZoom, pinchZoom: viewportPinchZoom });\n\n // Per-dep wiring modules under `src/canvas/deps/`. See each file for the\n // dep's contract and trade-offs.\n useAreaSelectDepSource(scene, selection, poseDescriptor, poseComposition, alphaOf);\n useNodeAtPointDepSource(pickEvery);\n useLayoutDepSource(scene, layouts, layoutDropTarget, reflowTransition);\n useLayoutArrivals(scene, { layouts, poseDescriptor, poseComposition });\n useInsertDepSource(scene, adapter, insertNodeFactories, insertPaint);\n useSliceDepSource(scene, selection, adapter, poseComposition, poseDescriptor);\n useSnapDepSource(snapPoint);\n useDebugDepSource(canvasApiRef);\n useDepChangeNotices(scene, selection.current);\n useIngestionDepSource(canvasRef, () => currentViewRef.current, ingestionResolveSrc, ingestionSvg, ingestionClipboard);\n useLassoSelectDepSource(scene, selection, poseDescriptor, poseComposition, alphaOf);\n useTextEditDepSource(scene);\n useEditAnchorsDepSource(scene, selection, adapter, editAnchorsExternalState, {\n anchorEditingAllowed,\n });\n useDispatcherDepSource(dispatcher);\n usePoseDescriptorDepSource(poseDescriptor);\n usePoseCompositionDepSource(poseComposition);\n\n // Keyed on the exclusion too: a re-registration of the standard set would\n // otherwise land over the overrides applied on top of it.\n useActionsPropResolver(actions, excludeActions.join('|'));\n\n // Gate the `resizePolicy` dep registration on the consumer having\n // passed `selectTool.resize`. When absent, consumers wire it via a child\n // component (see PointSnapDemo / GroupsDemo). Registering empty defaults\n // here would race with child-component registrations — React runs child\n // effects before parent effects, so the parent's empty default would\n // overwrite the child's real value. The conditional mount avoids that.\n //\n // Same pattern for `geometryProjection`: only mount when the consumer\n // passed the prop so absent → dep undefined → actions stay pose-only.\n return (\n <>\n {resizeOptions ? <ResizePolicyRegistrar options={resizeOptions} /> : null}\n {geometryProjection ? <GeometryProjectionRegistrar projection={geometryProjection} /> : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAgBC,EAAyB,EACvC,cACA,UACA,YACA,YACA,mBACA,mBACA,iBACA,kBACA,mBACA,uBACA,eACA,iBACA,cACA,oBACA,YACA,uBACA,iBACA,sBACA,qBACA,kBACA,6BACA,yBACA,oBACA,YACA,qBACA,sBACA,yBACA,iBACA,eACA,cACA,iBACA,yBACA,kBACA,wBACA,yBAgGC;CACD,IAAMC,IAAWC,EAAmB;CAkBpC,AAfAC,SACE,EAAmB,UAAUF,SAChB;EAAE,EAAmB,UAAU;CAAM,IACjD,CAACA,GAAUG,CAAkB,CAAC,GAKjCD,QAAgB;EACd,IAAKF,GACL,OAAOA,EAAS,cAAcI,CAAU;CAC1C,GAAG,CAACJ,GAAUI,CAAU,CAAC,GAIzBF,QAAgB;EACd,IAAKF,GAEL,OADA,EAAa,WAAW,MAAeA,EAAS,KAAK,CAAC,CAAC,MAAM,MAAMK,EAAE,OAAOC,CAAE,SACjE;GAAE,EAAa,UAAU;EAAM;CAC9C,GAAG,CAACN,GAAUO,CAAY,CAAC;CAI3B,IAAMC,KAAYC,EAAa,GAMzBC,IAAOC,EACXC,GACAC,GACAC,SACM;EACJ,IAAMC,IAAKC,EAAU;EACrB,OAAOD,IAAK;GAAE,OAAOA,EAAG;GAAa,QAAQA,EAAG;EAAa,IAAI;CACnE,GACAE,GACAT,IACAU,EACF;CAGA,AAFAC,EAAmB;EAAE;EAAW;EAAO;EAAM,SAASC,EAAM;EAAS,SAASC;CAAe,CAAC,GAE9FC,EAAa,kBAAkBZ,CAAI;CACnC,IAAMa,KAAUC,EAAkB;CA2ClC,OA1CAF,EAAa,iBAAiBC,MAAW,KAAA,CAAS,GAMlDE,EAAmB;EAAE,KAAKC;EAAoB,MAAMC;EAAc,WAAWC;CAAkB,CAAC,GAIhGC,EAAuBT,GAAOU,GAAWC,GAAgBC,GAAiBC,CAAO,GACjFC,EAAwBC,CAAS,GACjCC,GAAmBhB,GAAOiB,GAASC,GAAkBC,EAAgB,GACrEC,EAAkBpB,GAAO;EAAE;EAAS;EAAgB;CAAgB,CAAC,GACrEqB,EAAmBrB,GAAOsB,GAASC,IAAqBC,EAAW,GACnEC,EAAkBzB,GAAOU,GAAWY,GAASV,GAAiBD,CAAc,GAC5Ee,EAAiBC,EAAS,GAC1BC,EAAkBC,CAAY,GAC9BC,EAAoB9B,GAAOU,EAAU,OAAO,GAC5CqB,GAAsBnC,SAAiBJ,EAAe,SAASwC,IAAqBC,IAAcC,EAAkB,GACpHC,EAAwBnC,GAAOU,GAAWC,GAAgBC,GAAiBC,CAAO,GAClFuB,EAAqBpC,CAAK,GAC1BqC,EAAwBrC,GAAOU,GAAWY,GAASgB,GAA0B,EAC3E,wBACF,CAAC,GACDC,EAAuBvD,CAAU,GACjCwD,EAA2B7B,CAAc,GACzC8B,EAA4B7B,CAAe,GAI3C8B,GAAuBC,GAAS1C,EAAe,KAAK,GAAG,CAAC,GAYtD,kBAAAvB,GAAA,EAAA,UAAA,CACGmE,IAAgB,kBAACC,IAAD,EAAuB,SAASD,EAAgB,CAAA,IAAI,MACpEE,IAAqB,kBAACC,IAAD,EAA6B,YAAYD,EAAqB,CAAA,IAAI,IACxF,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useKeybindings as e } from "../../tools/useKeybindings.js";
|
|
2
|
+
import { useContributionRoles as t } from "./useContributionRoles.js";
|
|
3
|
+
//#region src/canvas/SceneCanvas/ToolKeybindingsMounter.tsx
|
|
4
|
+
function n({ internalTools: n, toolsTakeover: r, enableKeybindings: i, isToolEligible: a, canvasApi: o, versionCheck: s }) {
|
|
5
|
+
return e(n, {
|
|
6
|
+
disable: !!r || !i,
|
|
7
|
+
isToolEligible: a
|
|
8
|
+
}), e(r ?? n, {
|
|
9
|
+
disable: !r || !i,
|
|
10
|
+
isToolEligible: a
|
|
11
|
+
}), t(r ?? n, o, s), null;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as ToolKeybindingsMounter };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=ToolKeybindingsMounter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolKeybindingsMounter.js","names":["ToolKeybindingsMounter","useKeybindings","internalTools","toolsTakeover","enableKeybindings","useContributionRoles","canvasApi","versionCheck"],"sources":["../../../src/canvas/SceneCanvas/ToolKeybindingsMounter.tsx"],"sourcesContent":["import { useKeybindings } from 'tools/useKeybindings';\nimport type { ToolsApi } from '../../tools/overlayBinding';\nimport type { CanvasExtensionApi } from '../canvasExtension';\nimport { useContributionRoles, type VersionCheck } from './useContributionRoles';\n\n/**\n * Mounts the gesture dispatcher on this canvas's input scope.\n *\n * Accepts `selectionRef`, `boundsOf`, `pickEvery`, and `viewRef` so\n * it can wire `affordanceAt` + `classifyTarget` thunks into the dispatcher.\n * These thunks convert client coords → world coords via the canvas rect + view,\n * then classify the pointer position against affordances and scene bodies.\n */\n/**\n * Mounts `useKeybindings`, whose `tool.activate` / `tool.offhand` /\n * `tool.resetToDefault` registrations land in this canvas's scope.\n *\n * Two calls, mirroring the pair that used to live in `SceneCanvasInner`: the\n * hook snapshots the initial active tool for Escape-returns-to-default, so\n * the internal and consumer-supplied `ToolsApi` each need their own instance\n * and the hook count has to stay stable across the takeover branch.\n */\nexport function ToolKeybindingsMounter({\n internalTools,\n toolsTakeover,\n enableKeybindings,\n isToolEligible,\n canvasApi,\n versionCheck,\n}: {\n internalTools: ToolsApi;\n toolsTakeover?: ToolsApi;\n enableKeybindings: boolean;\n isToolEligible: (toolId: string) => boolean;\n canvasApi: CanvasExtensionApi | null;\n versionCheck?: VersionCheck;\n}) {\n useKeybindings(internalTools, {\n disable: !!toolsTakeover || !enableKeybindings,\n isToolEligible,\n });\n useKeybindings(toolsTakeover ?? internalTools, {\n disable: !toolsTakeover || !enableKeybindings,\n isToolEligible,\n });\n // Entry-owned roles: actions (polygon.adjustSides, …), deps and `attach`.\n // Same reason this lives here and not in the tool hooks: the hooks run above\n // the provider. Not gated on `enableKeybindings` — these back wheel and\n // pointer bindings too, not just keys.\n useContributionRoles(toolsTakeover ?? internalTools, canvasApi, versionCheck);\n return null;\n}\n"],"mappings":";;;AAsBA,SAAgBA,EAAuB,EACrC,kBACA,kBACA,sBACA,mBACA,cACA,mBAQC;CAcD,OAbAC,EAAeC,GAAe;EAC5B,SAAS,CAAC,CAACC,KAAiB,CAACC;EAC7B;CACF,CAAC,GACDH,EAAeE,KAAiBD,GAAe;EAC7C,SAAS,CAACC,KAAiB,CAACC;EAC5B;CACF,CAAC,GAKDC,EAAqBF,KAAiBD,GAAeI,GAAWC,CAAY,GACrE;AACT"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IS_DEV as e } from "./isDev.js";
|
|
2
|
+
//#region src/canvas/SceneCanvas/coordTrace.ts
|
|
3
|
+
var t = 200, n = [], r = e;
|
|
4
|
+
function i(e) {
|
|
5
|
+
r && (n.push(e), n.length > t && n.shift());
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { r as COORD_DEV, t as COORD_TRACE_LIMIT, n as coordTrace, i as recordCoordTrace };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=coordTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordTrace.js","names":["COORD_TRACE_LIMIT","coordTrace","COORD_DEV","IS_DEV","recordCoordTrace","entry"],"sources":["../../../src/canvas/SceneCanvas/coordTrace.ts"],"sourcesContent":["import { IS_DEV } from './isDev';\n\n// ---------------------------------------------------------------------------\n// Dev-only coord trace\n// ---------------------------------------------------------------------------\n\n/** Records every `clientToWorld` call so dev tools (and agents) can\n * reconcile cursor coords with computed world coords. Mirrors the\n * dispatcher's trace log. Exposed on `window.__weaselCoordLog__`. */\nexport interface CoordTraceEntry {\n ts: number;\n clientX: number;\n clientY: number;\n rect: { left: number; top: number; width: number; height: number } | null;\n view: { x: number; y: number; scaleX: number; scaleY: number } | null;\n world: { x: number; y: number };\n /** True when canvas/view weren't available and we returned identity. */\n fallback: boolean;\n}\n\nexport const COORD_TRACE_LIMIT = 200;\n\nexport const coordTrace: CoordTraceEntry[] = [];\n\nexport const COORD_DEV: boolean = IS_DEV;\n\nexport function recordCoordTrace(entry: CoordTraceEntry): void {\n if (!COORD_DEV) return;\n coordTrace.push(entry);\n if (coordTrace.length > COORD_TRACE_LIMIT) coordTrace.shift();\n}\n"],"mappings":";;AAoBA,IAAaA,IAAoB,KAEpBC,IAAgC,CAAC,GAEjCC,IAAqBC;AAElC,SAAgBC,EAAiB,GAA8B;CAC7D,AAAKF,MACLD,EAAW,KAAKI,CAAK,GACjBJ,EAAW,SAASD,KAAmBC,EAAW,MAAM;AAC9D"}
|
|
@@ -1,49 +1,68 @@
|
|
|
1
|
-
import { listMarkers as e } from "../../core/strokeMarkers.js";
|
|
2
|
-
import { KIT_SHAPE_KINDS as
|
|
3
|
-
import { prefUnit as n } from "../../tools/prefs.js";
|
|
1
|
+
import { listMarkers as e, markerGeneration as t } from "../../core/strokeMarkers.js";
|
|
2
|
+
import { KIT_SHAPE_KINDS as n } from "../../core/shapeKinds.js";
|
|
4
3
|
import { inferredNodeRouting as r } from "./defaultNodeRouting.js";
|
|
5
4
|
import { dashForStrokeStyle as i, strokeDashStyleOf as a } from "@weasel-js/paint";
|
|
6
5
|
import { resolveAlign as o } from "@weasel-js/text";
|
|
7
6
|
import { ANGLE_RADIANS as s } from "@weasel-js/quantity";
|
|
7
|
+
import { prefUnit as c } from "@weasel-js/prefs";
|
|
8
8
|
//#region src/canvas/SceneCanvas/defaultNodeProperties.ts
|
|
9
|
-
var
|
|
9
|
+
var l = c(s, "deg", {
|
|
10
10
|
precision: 1,
|
|
11
11
|
suffix: "°"
|
|
12
12
|
});
|
|
13
|
-
function
|
|
13
|
+
function u(e) {
|
|
14
14
|
let t = e?.width;
|
|
15
15
|
if (typeof t == "number" || typeof t == "object" && t && typeof t.px == "number") return t;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
read: (e, t) => t === void 0 ? void 0 : a(Array.isArray(e) ? e : void 0,
|
|
19
|
-
write: (e, t) => e === "dashed" || e === "dotted" ? i(e,
|
|
20
|
-
},
|
|
17
|
+
var d = {
|
|
18
|
+
read: (e, t) => t === void 0 ? void 0 : a(Array.isArray(e) ? e : void 0, u(t)),
|
|
19
|
+
write: (e, t) => e === "dashed" || e === "dotted" ? i(e, u(t)) : e === "solid" ? void 0 : t?.dash
|
|
20
|
+
}, f = {
|
|
21
21
|
read: (e) => typeof e == "string" ? e : e && typeof e == "object" && "key" in e ? String(e.key) : "",
|
|
22
22
|
write: (e) => e === "" ? void 0 : e
|
|
23
|
-
},
|
|
23
|
+
}, p = {
|
|
24
24
|
read: (e) => e === "italic",
|
|
25
25
|
write: (e) => e ? "italic" : void 0
|
|
26
|
-
},
|
|
26
|
+
}, m = {
|
|
27
27
|
read: (e, t) => {
|
|
28
28
|
if (e === void 0 || e === "justify") return e;
|
|
29
29
|
let n = t?.direction === "rtl" ? "rtl" : "ltr";
|
|
30
30
|
return o(e, n);
|
|
31
31
|
},
|
|
32
32
|
write: (e) => e
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
}, h;
|
|
34
|
+
function g() {
|
|
35
|
+
let n = t();
|
|
36
|
+
return h?.generation !== n && (h = {
|
|
37
|
+
generation: n,
|
|
38
|
+
options: [{
|
|
39
|
+
value: "",
|
|
40
|
+
label: "None"
|
|
41
|
+
}, ...e().map((e) => ({
|
|
42
|
+
value: e.id,
|
|
43
|
+
label: e.id
|
|
44
|
+
}))]
|
|
45
|
+
}), h.options;
|
|
46
|
+
}
|
|
47
|
+
function _(e) {
|
|
48
|
+
return {
|
|
49
|
+
kind: "enum",
|
|
50
|
+
default: "",
|
|
51
|
+
control: "select",
|
|
52
|
+
encoding: f,
|
|
53
|
+
...e,
|
|
54
|
+
get options() {
|
|
55
|
+
return g();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function v(e = {}) {
|
|
41
60
|
return {
|
|
42
61
|
name: "Properties",
|
|
43
|
-
|
|
62
|
+
members: {
|
|
44
63
|
layout: {
|
|
45
64
|
name: "Layout",
|
|
46
|
-
|
|
65
|
+
members: {
|
|
47
66
|
"pose.x": {
|
|
48
67
|
kind: "number",
|
|
49
68
|
name: "X",
|
|
@@ -84,23 +103,25 @@ function h(e = {}) {
|
|
|
84
103
|
description: "Rotation about the box center.",
|
|
85
104
|
default: 0,
|
|
86
105
|
step: 1,
|
|
87
|
-
unit:
|
|
106
|
+
unit: l,
|
|
107
|
+
absentIsDefault: !0
|
|
88
108
|
}
|
|
89
109
|
}
|
|
90
110
|
},
|
|
91
111
|
...e.text ? { content: {
|
|
92
112
|
name: "Content",
|
|
93
|
-
|
|
113
|
+
members: { "data.text": {
|
|
94
114
|
kind: "string",
|
|
95
115
|
name: "Text",
|
|
96
116
|
description: "Text content.",
|
|
117
|
+
absentIsDefault: !0,
|
|
97
118
|
default: "",
|
|
98
119
|
block: !0
|
|
99
120
|
} }
|
|
100
121
|
} } : {},
|
|
101
122
|
appearance: {
|
|
102
123
|
name: "",
|
|
103
|
-
|
|
124
|
+
members: {
|
|
104
125
|
"data.fill": {
|
|
105
126
|
kind: "paint",
|
|
106
127
|
name: "Fill",
|
|
@@ -129,6 +150,7 @@ function h(e = {}) {
|
|
|
129
150
|
kind: "number",
|
|
130
151
|
name: "Width",
|
|
131
152
|
description: "Stroke width, world units.",
|
|
153
|
+
absentIsDefault: !0,
|
|
132
154
|
default: 1,
|
|
133
155
|
min: 0,
|
|
134
156
|
max: 20,
|
|
@@ -152,6 +174,7 @@ function h(e = {}) {
|
|
|
152
174
|
kind: "enum",
|
|
153
175
|
name: "Cap",
|
|
154
176
|
description: "How an open end is drawn.",
|
|
177
|
+
absentIsDefault: !0,
|
|
155
178
|
default: "butt",
|
|
156
179
|
control: "toggle",
|
|
157
180
|
block: !0,
|
|
@@ -181,6 +204,7 @@ function h(e = {}) {
|
|
|
181
204
|
kind: "enum",
|
|
182
205
|
name: "Join",
|
|
183
206
|
description: "How a corner is drawn.",
|
|
207
|
+
absentIsDefault: !0,
|
|
184
208
|
default: "miter",
|
|
185
209
|
control: "toggle",
|
|
186
210
|
block: !0,
|
|
@@ -206,6 +230,7 @@ function h(e = {}) {
|
|
|
206
230
|
kind: "enum",
|
|
207
231
|
name: "Align",
|
|
208
232
|
description: "Where the ribbon sits relative to the edge.",
|
|
233
|
+
absentIsDefault: !0,
|
|
209
234
|
default: "center",
|
|
210
235
|
control: "toggle",
|
|
211
236
|
block: !0,
|
|
@@ -234,7 +259,7 @@ function h(e = {}) {
|
|
|
234
259
|
default: "solid",
|
|
235
260
|
control: "toggle",
|
|
236
261
|
block: !0,
|
|
237
|
-
encoding:
|
|
262
|
+
encoding: d,
|
|
238
263
|
options: [
|
|
239
264
|
{
|
|
240
265
|
value: "solid",
|
|
@@ -259,67 +284,55 @@ function h(e = {}) {
|
|
|
259
284
|
}
|
|
260
285
|
]
|
|
261
286
|
},
|
|
262
|
-
markerStart: {
|
|
263
|
-
kind: "enum",
|
|
287
|
+
markerStart: _({
|
|
264
288
|
name: "Start",
|
|
265
289
|
description: "Marker at the first vertex of each open subpath.",
|
|
266
|
-
default: "",
|
|
267
|
-
control: "select",
|
|
268
290
|
block: !0,
|
|
269
291
|
pair: {
|
|
270
292
|
with: ["data.stroke.markerMid", "data.stroke.markerEnd"],
|
|
271
293
|
label: "Markers"
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
markerMid: {
|
|
277
|
-
kind: "enum",
|
|
294
|
+
}
|
|
295
|
+
}),
|
|
296
|
+
markerMid: _({
|
|
278
297
|
name: "Mid",
|
|
279
298
|
description: "Marker at every interior authored vertex.",
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
encoding: d,
|
|
284
|
-
options: m()
|
|
285
|
-
},
|
|
286
|
-
markerEnd: {
|
|
287
|
-
kind: "enum",
|
|
299
|
+
block: !0
|
|
300
|
+
}),
|
|
301
|
+
markerEnd: _({
|
|
288
302
|
name: "End",
|
|
289
303
|
description: "Marker at the last vertex of each open subpath.",
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
block: !0,
|
|
293
|
-
encoding: d,
|
|
294
|
-
options: m()
|
|
295
|
-
}
|
|
304
|
+
block: !0
|
|
305
|
+
})
|
|
296
306
|
}
|
|
297
307
|
}
|
|
298
308
|
}
|
|
299
309
|
},
|
|
300
310
|
...e.text ? { text: {
|
|
301
311
|
name: "",
|
|
302
|
-
|
|
312
|
+
members: {
|
|
303
313
|
"data.style": {
|
|
304
314
|
kind: "object",
|
|
305
315
|
name: "Style",
|
|
306
316
|
description: "Typography for the whole node. Its color is the node's own `data.fill`, in Appearance.",
|
|
307
317
|
default: {},
|
|
318
|
+
absentIsDefault: !0,
|
|
308
319
|
block: !0,
|
|
309
320
|
children: {
|
|
310
321
|
character: {
|
|
311
322
|
name: "Character",
|
|
312
|
-
|
|
323
|
+
members: {
|
|
313
324
|
fontFamily: {
|
|
314
325
|
kind: "font-family",
|
|
315
326
|
name: "Font",
|
|
316
327
|
description: "Registered font family.",
|
|
328
|
+
absentIsDefault: !0,
|
|
317
329
|
default: "sans-serif"
|
|
318
330
|
},
|
|
319
331
|
fontSize: {
|
|
320
332
|
kind: "number",
|
|
321
333
|
name: "Size",
|
|
322
334
|
description: "Font size, world units.",
|
|
335
|
+
absentIsDefault: !0,
|
|
323
336
|
default: 16,
|
|
324
337
|
min: 1,
|
|
325
338
|
step: 1,
|
|
@@ -332,6 +345,7 @@ function h(e = {}) {
|
|
|
332
345
|
kind: "font-weight",
|
|
333
346
|
name: "Weight",
|
|
334
347
|
description: "Font weight, from the faces the family has.",
|
|
348
|
+
absentIsDefault: !0,
|
|
335
349
|
default: 400
|
|
336
350
|
},
|
|
337
351
|
fontStyle: {
|
|
@@ -351,12 +365,13 @@ function h(e = {}) {
|
|
|
351
365
|
],
|
|
352
366
|
label: "Style"
|
|
353
367
|
},
|
|
354
|
-
encoding:
|
|
368
|
+
encoding: p
|
|
355
369
|
},
|
|
356
370
|
underline: {
|
|
357
371
|
kind: "boolean",
|
|
358
372
|
name: "Underline",
|
|
359
373
|
description: "Underline the text.",
|
|
374
|
+
absentIsDefault: !0,
|
|
360
375
|
default: !1,
|
|
361
376
|
control: "toggle",
|
|
362
377
|
icon: "underline",
|
|
@@ -366,6 +381,7 @@ function h(e = {}) {
|
|
|
366
381
|
kind: "boolean",
|
|
367
382
|
name: "Strikethrough",
|
|
368
383
|
description: "Strike through the text.",
|
|
384
|
+
absentIsDefault: !0,
|
|
369
385
|
default: !1,
|
|
370
386
|
control: "toggle",
|
|
371
387
|
icon: "strikethrough",
|
|
@@ -375,6 +391,7 @@ function h(e = {}) {
|
|
|
375
391
|
kind: "boolean",
|
|
376
392
|
name: "Overline",
|
|
377
393
|
description: "Rule the text above its ascent.",
|
|
394
|
+
absentIsDefault: !0,
|
|
378
395
|
default: !1,
|
|
379
396
|
control: "toggle",
|
|
380
397
|
icon: "overline",
|
|
@@ -401,6 +418,7 @@ function h(e = {}) {
|
|
|
401
418
|
kind: "number",
|
|
402
419
|
name: "Tracking",
|
|
403
420
|
description: "Extra advance per glyph, world units.",
|
|
421
|
+
absentIsDefault: !0,
|
|
404
422
|
default: 0,
|
|
405
423
|
step: .1
|
|
406
424
|
},
|
|
@@ -408,6 +426,7 @@ function h(e = {}) {
|
|
|
408
426
|
kind: "enum",
|
|
409
427
|
name: "Case",
|
|
410
428
|
description: "Draw the text in capitals, lowercase or title case. The text itself is unchanged.",
|
|
429
|
+
absentIsDefault: !0,
|
|
411
430
|
default: "none",
|
|
412
431
|
control: "toggle",
|
|
413
432
|
options: [
|
|
@@ -437,6 +456,7 @@ function h(e = {}) {
|
|
|
437
456
|
kind: "enum",
|
|
438
457
|
name: "Small caps",
|
|
439
458
|
description: "Draw lowercase letters as smaller capitals. The text itself is unchanged.",
|
|
459
|
+
absentIsDefault: !0,
|
|
440
460
|
default: "normal",
|
|
441
461
|
control: "toggle",
|
|
442
462
|
options: [{
|
|
@@ -453,11 +473,12 @@ function h(e = {}) {
|
|
|
453
473
|
},
|
|
454
474
|
paragraph: {
|
|
455
475
|
name: "Paragraph",
|
|
456
|
-
|
|
476
|
+
members: {
|
|
457
477
|
lineHeight: {
|
|
458
478
|
kind: "number",
|
|
459
479
|
name: "Leading",
|
|
460
480
|
description: "Line height as a multiple of font size.",
|
|
481
|
+
absentIsDefault: !0,
|
|
461
482
|
default: 1.2,
|
|
462
483
|
min: .5,
|
|
463
484
|
step: .1
|
|
@@ -466,32 +487,52 @@ function h(e = {}) {
|
|
|
466
487
|
kind: "boolean",
|
|
467
488
|
name: "Wrap",
|
|
468
489
|
description: "Break lines between words at the box width.",
|
|
490
|
+
absentIsDefault: !0,
|
|
469
491
|
default: !1,
|
|
470
492
|
control: "switch"
|
|
471
493
|
},
|
|
494
|
+
tabSize: {
|
|
495
|
+
kind: "number",
|
|
496
|
+
name: "Tab size",
|
|
497
|
+
description: "Distance between tab stops, in spaces.",
|
|
498
|
+
absentIsDefault: !0,
|
|
499
|
+
default: 8,
|
|
500
|
+
min: 1,
|
|
501
|
+
step: 1
|
|
502
|
+
},
|
|
472
503
|
direction: {
|
|
473
504
|
kind: "enum",
|
|
474
505
|
name: "Direction",
|
|
475
|
-
description: "Reading direction.",
|
|
476
|
-
|
|
506
|
+
description: "Reading direction. Auto takes each paragraph's from its first strong character.",
|
|
507
|
+
absentIsDefault: !0,
|
|
508
|
+
default: "auto",
|
|
477
509
|
control: "toggle",
|
|
478
|
-
options: [
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
510
|
+
options: [
|
|
511
|
+
{
|
|
512
|
+
value: "auto",
|
|
513
|
+
label: "Auto",
|
|
514
|
+
short: ["Auto"]
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
value: "ltr",
|
|
518
|
+
label: "Left to right",
|
|
519
|
+
short: ["LTR"]
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
value: "rtl",
|
|
523
|
+
label: "Right to left",
|
|
524
|
+
short: ["RTL"]
|
|
525
|
+
}
|
|
526
|
+
]
|
|
487
527
|
},
|
|
488
528
|
align: {
|
|
489
529
|
kind: "enum",
|
|
490
530
|
name: "Align",
|
|
491
531
|
description: "Horizontal alignment.",
|
|
532
|
+
absentIsDefault: !0,
|
|
492
533
|
default: "left",
|
|
493
534
|
control: "toggle",
|
|
494
|
-
encoding:
|
|
535
|
+
encoding: m,
|
|
495
536
|
options: [
|
|
496
537
|
{
|
|
497
538
|
value: "left",
|
|
@@ -523,6 +564,7 @@ function h(e = {}) {
|
|
|
523
564
|
kind: "enum",
|
|
524
565
|
name: "Vertical",
|
|
525
566
|
description: "Where the lines sit in the box's height.",
|
|
567
|
+
absentIsDefault: !0,
|
|
526
568
|
default: "top",
|
|
527
569
|
control: "toggle",
|
|
528
570
|
options: [
|
|
@@ -548,14 +590,14 @@ function h(e = {}) {
|
|
|
548
590
|
}
|
|
549
591
|
};
|
|
550
592
|
}
|
|
551
|
-
var
|
|
593
|
+
var y = n.map((e) => ({
|
|
552
594
|
name: e,
|
|
553
|
-
schema:
|
|
554
|
-
})),
|
|
595
|
+
schema: v({ text: e === "text" })
|
|
596
|
+
})), b = r.map((e) => ({
|
|
555
597
|
name: e.name,
|
|
556
|
-
schema:
|
|
598
|
+
schema: v({ text: e.name === "text" })
|
|
557
599
|
}));
|
|
558
600
|
//#endregion
|
|
559
|
-
export {
|
|
601
|
+
export { y as defaultNodeProperties, b as inferredNodeProperties, l as rotationDegreesUnit };
|
|
560
602
|
|
|
561
603
|
//# sourceMappingURL=defaultNodeProperties.js.map
|