@weasel-js/core 1.9.2 → 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 +393 -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 +146 -92
- 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 +11010 -7700
- 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 +13 -2
- 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 -47
- package/dist/tools/prefs.js.map +0 -1
|
@@ -1,62 +1,83 @@
|
|
|
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",
|
|
50
69
|
description: "Left edge, world units.",
|
|
51
70
|
default: 0,
|
|
52
|
-
pair:
|
|
71
|
+
pair: {
|
|
72
|
+
with: "pose.y",
|
|
73
|
+
label: "Position"
|
|
74
|
+
}
|
|
53
75
|
},
|
|
54
76
|
"pose.y": {
|
|
55
77
|
kind: "number",
|
|
56
78
|
name: "Y",
|
|
57
79
|
description: "Top edge, world units.",
|
|
58
|
-
default: 0
|
|
59
|
-
pair: "Position"
|
|
80
|
+
default: 0
|
|
60
81
|
},
|
|
61
82
|
"pose.width": {
|
|
62
83
|
kind: "number",
|
|
@@ -64,15 +85,17 @@ function h(e = {}) {
|
|
|
64
85
|
description: "Width, world units.",
|
|
65
86
|
default: 0,
|
|
66
87
|
min: 0,
|
|
67
|
-
pair:
|
|
88
|
+
pair: {
|
|
89
|
+
with: "pose.height",
|
|
90
|
+
label: "Size"
|
|
91
|
+
}
|
|
68
92
|
},
|
|
69
93
|
"pose.height": {
|
|
70
94
|
kind: "number",
|
|
71
95
|
name: "H",
|
|
72
96
|
description: "Height, world units.",
|
|
73
97
|
default: 0,
|
|
74
|
-
min: 0
|
|
75
|
-
pair: "Size"
|
|
98
|
+
min: 0
|
|
76
99
|
},
|
|
77
100
|
"pose.rotation": {
|
|
78
101
|
kind: "number",
|
|
@@ -80,23 +103,25 @@ function h(e = {}) {
|
|
|
80
103
|
description: "Rotation about the box center.",
|
|
81
104
|
default: 0,
|
|
82
105
|
step: 1,
|
|
83
|
-
unit:
|
|
106
|
+
unit: l,
|
|
107
|
+
absentIsDefault: !0
|
|
84
108
|
}
|
|
85
109
|
}
|
|
86
110
|
},
|
|
87
111
|
...e.text ? { content: {
|
|
88
112
|
name: "Content",
|
|
89
|
-
|
|
113
|
+
members: { "data.text": {
|
|
90
114
|
kind: "string",
|
|
91
115
|
name: "Text",
|
|
92
116
|
description: "Text content.",
|
|
117
|
+
absentIsDefault: !0,
|
|
93
118
|
default: "",
|
|
94
119
|
block: !0
|
|
95
120
|
} }
|
|
96
121
|
} } : {},
|
|
97
122
|
appearance: {
|
|
98
123
|
name: "",
|
|
99
|
-
|
|
124
|
+
members: {
|
|
100
125
|
"data.fill": {
|
|
101
126
|
kind: "paint",
|
|
102
127
|
name: "Fill",
|
|
@@ -125,6 +150,7 @@ function h(e = {}) {
|
|
|
125
150
|
kind: "number",
|
|
126
151
|
name: "Width",
|
|
127
152
|
description: "Stroke width, world units.",
|
|
153
|
+
absentIsDefault: !0,
|
|
128
154
|
default: 1,
|
|
129
155
|
min: 0,
|
|
130
156
|
max: 20,
|
|
@@ -148,10 +174,14 @@ function h(e = {}) {
|
|
|
148
174
|
kind: "enum",
|
|
149
175
|
name: "Cap",
|
|
150
176
|
description: "How an open end is drawn.",
|
|
177
|
+
absentIsDefault: !0,
|
|
151
178
|
default: "butt",
|
|
152
179
|
control: "toggle",
|
|
153
180
|
block: !0,
|
|
154
|
-
pair:
|
|
181
|
+
pair: {
|
|
182
|
+
with: ["data.stroke.join", "data.stroke.align"],
|
|
183
|
+
label: "Line"
|
|
184
|
+
},
|
|
155
185
|
options: [
|
|
156
186
|
{
|
|
157
187
|
value: "butt",
|
|
@@ -174,10 +204,10 @@ function h(e = {}) {
|
|
|
174
204
|
kind: "enum",
|
|
175
205
|
name: "Join",
|
|
176
206
|
description: "How a corner is drawn.",
|
|
207
|
+
absentIsDefault: !0,
|
|
177
208
|
default: "miter",
|
|
178
209
|
control: "toggle",
|
|
179
210
|
block: !0,
|
|
180
|
-
pair: "Line",
|
|
181
211
|
options: [
|
|
182
212
|
{
|
|
183
213
|
value: "miter",
|
|
@@ -200,10 +230,10 @@ function h(e = {}) {
|
|
|
200
230
|
kind: "enum",
|
|
201
231
|
name: "Align",
|
|
202
232
|
description: "Where the ribbon sits relative to the edge.",
|
|
233
|
+
absentIsDefault: !0,
|
|
203
234
|
default: "center",
|
|
204
235
|
control: "toggle",
|
|
205
236
|
block: !0,
|
|
206
|
-
pair: "Line",
|
|
207
237
|
options: [
|
|
208
238
|
{
|
|
209
239
|
value: "inner",
|
|
@@ -229,7 +259,7 @@ function h(e = {}) {
|
|
|
229
259
|
default: "solid",
|
|
230
260
|
control: "toggle",
|
|
231
261
|
block: !0,
|
|
232
|
-
encoding:
|
|
262
|
+
encoding: d,
|
|
233
263
|
options: [
|
|
234
264
|
{
|
|
235
265
|
value: "solid",
|
|
@@ -254,77 +284,69 @@ function h(e = {}) {
|
|
|
254
284
|
}
|
|
255
285
|
]
|
|
256
286
|
},
|
|
257
|
-
markerStart: {
|
|
258
|
-
kind: "enum",
|
|
287
|
+
markerStart: _({
|
|
259
288
|
name: "Start",
|
|
260
289
|
description: "Marker at the first vertex of each open subpath.",
|
|
261
|
-
default: "",
|
|
262
|
-
control: "select",
|
|
263
290
|
block: !0,
|
|
264
|
-
pair:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
291
|
+
pair: {
|
|
292
|
+
with: ["data.stroke.markerMid", "data.stroke.markerEnd"],
|
|
293
|
+
label: "Markers"
|
|
294
|
+
}
|
|
295
|
+
}),
|
|
296
|
+
markerMid: _({
|
|
270
297
|
name: "Mid",
|
|
271
298
|
description: "Marker at every interior authored vertex.",
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
pair: "Markers",
|
|
276
|
-
encoding: d,
|
|
277
|
-
options: m()
|
|
278
|
-
},
|
|
279
|
-
markerEnd: {
|
|
280
|
-
kind: "enum",
|
|
299
|
+
block: !0
|
|
300
|
+
}),
|
|
301
|
+
markerEnd: _({
|
|
281
302
|
name: "End",
|
|
282
303
|
description: "Marker at the last vertex of each open subpath.",
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
block: !0,
|
|
286
|
-
pair: "Markers",
|
|
287
|
-
encoding: d,
|
|
288
|
-
options: m()
|
|
289
|
-
}
|
|
304
|
+
block: !0
|
|
305
|
+
})
|
|
290
306
|
}
|
|
291
307
|
}
|
|
292
308
|
}
|
|
293
309
|
},
|
|
294
310
|
...e.text ? { text: {
|
|
295
311
|
name: "",
|
|
296
|
-
|
|
312
|
+
members: {
|
|
297
313
|
"data.style": {
|
|
298
314
|
kind: "object",
|
|
299
315
|
name: "Style",
|
|
300
316
|
description: "Typography for the whole node. Its color is the node's own `data.fill`, in Appearance.",
|
|
301
317
|
default: {},
|
|
318
|
+
absentIsDefault: !0,
|
|
302
319
|
block: !0,
|
|
303
320
|
children: {
|
|
304
321
|
character: {
|
|
305
322
|
name: "Character",
|
|
306
|
-
|
|
323
|
+
members: {
|
|
307
324
|
fontFamily: {
|
|
308
325
|
kind: "font-family",
|
|
309
326
|
name: "Font",
|
|
310
327
|
description: "Registered font family.",
|
|
328
|
+
absentIsDefault: !0,
|
|
311
329
|
default: "sans-serif"
|
|
312
330
|
},
|
|
313
331
|
fontSize: {
|
|
314
332
|
kind: "number",
|
|
315
333
|
name: "Size",
|
|
316
334
|
description: "Font size, world units.",
|
|
335
|
+
absentIsDefault: !0,
|
|
317
336
|
default: 16,
|
|
318
337
|
min: 1,
|
|
319
338
|
step: 1,
|
|
320
|
-
pair:
|
|
339
|
+
pair: {
|
|
340
|
+
with: "data.style.fontWeight",
|
|
341
|
+
label: "Size / weight"
|
|
342
|
+
}
|
|
321
343
|
},
|
|
322
344
|
fontWeight: {
|
|
323
345
|
kind: "font-weight",
|
|
324
346
|
name: "Weight",
|
|
325
347
|
description: "Font weight, from the faces the family has.",
|
|
326
|
-
|
|
327
|
-
|
|
348
|
+
absentIsDefault: !0,
|
|
349
|
+
default: 400
|
|
328
350
|
},
|
|
329
351
|
fontStyle: {
|
|
330
352
|
kind: "boolean",
|
|
@@ -334,38 +356,46 @@ function h(e = {}) {
|
|
|
334
356
|
control: "toggle",
|
|
335
357
|
icon: "italic",
|
|
336
358
|
short: ["I"],
|
|
337
|
-
pair:
|
|
338
|
-
|
|
359
|
+
pair: {
|
|
360
|
+
with: [
|
|
361
|
+
"data.style.underline",
|
|
362
|
+
"data.style.strikethrough",
|
|
363
|
+
"data.style.overline",
|
|
364
|
+
"data.style.script"
|
|
365
|
+
],
|
|
366
|
+
label: "Style"
|
|
367
|
+
},
|
|
368
|
+
encoding: p
|
|
339
369
|
},
|
|
340
370
|
underline: {
|
|
341
371
|
kind: "boolean",
|
|
342
372
|
name: "Underline",
|
|
343
373
|
description: "Underline the text.",
|
|
374
|
+
absentIsDefault: !0,
|
|
344
375
|
default: !1,
|
|
345
376
|
control: "toggle",
|
|
346
377
|
icon: "underline",
|
|
347
|
-
short: ["U"]
|
|
348
|
-
pair: "Style"
|
|
378
|
+
short: ["U"]
|
|
349
379
|
},
|
|
350
380
|
strikethrough: {
|
|
351
381
|
kind: "boolean",
|
|
352
382
|
name: "Strikethrough",
|
|
353
383
|
description: "Strike through the text.",
|
|
384
|
+
absentIsDefault: !0,
|
|
354
385
|
default: !1,
|
|
355
386
|
control: "toggle",
|
|
356
387
|
icon: "strikethrough",
|
|
357
|
-
short: ["S"]
|
|
358
|
-
pair: "Style"
|
|
388
|
+
short: ["S"]
|
|
359
389
|
},
|
|
360
390
|
overline: {
|
|
361
391
|
kind: "boolean",
|
|
362
392
|
name: "Overline",
|
|
363
393
|
description: "Rule the text above its ascent.",
|
|
394
|
+
absentIsDefault: !0,
|
|
364
395
|
default: !1,
|
|
365
396
|
control: "toggle",
|
|
366
397
|
icon: "overline",
|
|
367
|
-
short: ["O"]
|
|
368
|
-
pair: "Style"
|
|
398
|
+
short: ["O"]
|
|
369
399
|
},
|
|
370
400
|
script: {
|
|
371
401
|
kind: "enum",
|
|
@@ -374,7 +404,6 @@ function h(e = {}) {
|
|
|
374
404
|
default: void 0,
|
|
375
405
|
control: "toggle",
|
|
376
406
|
clearable: !0,
|
|
377
|
-
pair: "Style",
|
|
378
407
|
options: [{
|
|
379
408
|
value: "super",
|
|
380
409
|
label: "Superscript",
|
|
@@ -389,6 +418,7 @@ function h(e = {}) {
|
|
|
389
418
|
kind: "number",
|
|
390
419
|
name: "Tracking",
|
|
391
420
|
description: "Extra advance per glyph, world units.",
|
|
421
|
+
absentIsDefault: !0,
|
|
392
422
|
default: 0,
|
|
393
423
|
step: .1
|
|
394
424
|
},
|
|
@@ -396,6 +426,7 @@ function h(e = {}) {
|
|
|
396
426
|
kind: "enum",
|
|
397
427
|
name: "Case",
|
|
398
428
|
description: "Draw the text in capitals, lowercase or title case. The text itself is unchanged.",
|
|
429
|
+
absentIsDefault: !0,
|
|
399
430
|
default: "none",
|
|
400
431
|
control: "toggle",
|
|
401
432
|
options: [
|
|
@@ -425,6 +456,7 @@ function h(e = {}) {
|
|
|
425
456
|
kind: "enum",
|
|
426
457
|
name: "Small caps",
|
|
427
458
|
description: "Draw lowercase letters as smaller capitals. The text itself is unchanged.",
|
|
459
|
+
absentIsDefault: !0,
|
|
428
460
|
default: "normal",
|
|
429
461
|
control: "toggle",
|
|
430
462
|
options: [{
|
|
@@ -441,11 +473,12 @@ function h(e = {}) {
|
|
|
441
473
|
},
|
|
442
474
|
paragraph: {
|
|
443
475
|
name: "Paragraph",
|
|
444
|
-
|
|
476
|
+
members: {
|
|
445
477
|
lineHeight: {
|
|
446
478
|
kind: "number",
|
|
447
479
|
name: "Leading",
|
|
448
480
|
description: "Line height as a multiple of font size.",
|
|
481
|
+
absentIsDefault: !0,
|
|
449
482
|
default: 1.2,
|
|
450
483
|
min: .5,
|
|
451
484
|
step: .1
|
|
@@ -454,32 +487,52 @@ function h(e = {}) {
|
|
|
454
487
|
kind: "boolean",
|
|
455
488
|
name: "Wrap",
|
|
456
489
|
description: "Break lines between words at the box width.",
|
|
490
|
+
absentIsDefault: !0,
|
|
457
491
|
default: !1,
|
|
458
492
|
control: "switch"
|
|
459
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
|
+
},
|
|
460
503
|
direction: {
|
|
461
504
|
kind: "enum",
|
|
462
505
|
name: "Direction",
|
|
463
|
-
description: "Reading direction.",
|
|
464
|
-
|
|
506
|
+
description: "Reading direction. Auto takes each paragraph's from its first strong character.",
|
|
507
|
+
absentIsDefault: !0,
|
|
508
|
+
default: "auto",
|
|
465
509
|
control: "toggle",
|
|
466
|
-
options: [
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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
|
+
]
|
|
475
527
|
},
|
|
476
528
|
align: {
|
|
477
529
|
kind: "enum",
|
|
478
530
|
name: "Align",
|
|
479
531
|
description: "Horizontal alignment.",
|
|
532
|
+
absentIsDefault: !0,
|
|
480
533
|
default: "left",
|
|
481
534
|
control: "toggle",
|
|
482
|
-
encoding:
|
|
535
|
+
encoding: m,
|
|
483
536
|
options: [
|
|
484
537
|
{
|
|
485
538
|
value: "left",
|
|
@@ -511,6 +564,7 @@ function h(e = {}) {
|
|
|
511
564
|
kind: "enum",
|
|
512
565
|
name: "Vertical",
|
|
513
566
|
description: "Where the lines sit in the box's height.",
|
|
567
|
+
absentIsDefault: !0,
|
|
514
568
|
default: "top",
|
|
515
569
|
control: "toggle",
|
|
516
570
|
options: [
|
|
@@ -536,14 +590,14 @@ function h(e = {}) {
|
|
|
536
590
|
}
|
|
537
591
|
};
|
|
538
592
|
}
|
|
539
|
-
var
|
|
593
|
+
var y = n.map((e) => ({
|
|
540
594
|
name: e,
|
|
541
|
-
schema:
|
|
542
|
-
})),
|
|
595
|
+
schema: v({ text: e === "text" })
|
|
596
|
+
})), b = r.map((e) => ({
|
|
543
597
|
name: e.name,
|
|
544
|
-
schema:
|
|
598
|
+
schema: v({ text: e.name === "text" })
|
|
545
599
|
}));
|
|
546
600
|
//#endregion
|
|
547
|
-
export {
|
|
601
|
+
export { y as defaultNodeProperties, b as inferredNodeProperties, l as rotationDegreesUnit };
|
|
548
602
|
|
|
549
603
|
//# sourceMappingURL=defaultNodeProperties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultNodeProperties.js","names":["rotationDegreesUnit","prefUnit","ANGLE_RADIANS","strokeWidthOf","w","stroke","strokeDashEncoding","strokeDashStyleOf","dash","style","dashForStrokeStyle","markerEncoding","ref","value","italicEncoding","stored","on","alignEncoding","direction","resolveAlign","edge","markerOptions","listMarkers","m","shapeSchema","opts","defaultNodeProperties","KIT_SHAPE_KINDS","name","inferredNodeProperties","inferredNodeRouting"],"sources":["../../../src/canvas/SceneCanvas/defaultNodeProperties.ts"],"sourcesContent":["import { inferredNodeRouting } from './defaultNodeRouting';\nimport { KIT_SHAPE_KINDS } from 'core/shapeKinds';\nimport { listMarkers } from 'core/strokeMarkers';\nimport { dashForStrokeStyle, strokeDashStyleOf } from '@weasel-js/paint';\nimport { resolveAlign, type TextAlign } from '@weasel-js/text';\nimport type { NodePropertiesEntry } from 'core/scene/NodeProperties';\nimport { ANGLE_RADIANS } from '@weasel-js/quantity';\nimport { prefUnit, type ToolPrefBooleanEncoding, type ToolPrefEnumEncoding, type ToolPrefGroup, type ToolPrefNumberUnit } from 'tools/prefs';\n\n/** Radians-stored / degrees-shown conversion for `pose.rotation` leaves.\n * Display rounds to 0.1° so a canonical radian value doesn't render as\n * a 15-digit float. */\nexport const rotationDegreesUnit: ToolPrefNumberUnit = prefUnit(ANGLE_RADIANS, 'deg', {\n precision: 1,\n suffix: '°',\n});\n\n/** `Stroke.width` off a partly-typed stroke object, or `undefined`. */\nfunction strokeWidthOf(stroke: Record<string, unknown> | undefined): number | { px: number } | undefined {\n const w = stroke?.width;\n if (typeof w === 'number') return w;\n if (typeof w === 'object' && w !== null && typeof (w as { px?: unknown }).px === 'number') {\n return w as { px: number };\n }\n return undefined;\n}\n\n/** `Stroke.dash` — a stored array of lengths — read and written as a named\n * style. The presets are multiples of the sibling `width`, which is why the\n * encoding is handed the whole stroke rather than the field. */\nconst strokeDashEncoding: ToolPrefEnumEncoding = {\n read: (dash, stroke) =>\n stroke === undefined\n ? undefined\n : strokeDashStyleOf(Array.isArray(dash) ? (dash as number[]) : undefined, strokeWidthOf(stroke)),\n write: (style, stroke) =>\n style === 'dashed' || style === 'dotted'\n ? dashForStrokeStyle(style, strokeWidthOf(stroke))\n // `solid` is stored as no dash at all. `custom` is reportable, not\n // authorable: it names an imported array, and the array it names is the\n // one already stored.\n : style === 'solid'\n ? undefined\n : stroke?.dash,\n};\n\n/** `Stroke.markerStart` / `markerMid` / `markerEnd` — a `MarkerRef` — read and\n * written as a bare key, with the empty string standing for no marker. */\nconst markerEncoding: ToolPrefEnumEncoding = {\n read: (ref) => {\n if (typeof ref === 'string') return ref;\n if (ref && typeof ref === 'object' && 'key' in ref) return String((ref as { key: string }).key);\n return '';\n },\n write: (value) => (value === '' ? undefined : value),\n};\n\n/** `TextStyle.fontStyle` as an Italic flag. Off removes the field rather than\n * storing `'normal'`, which is what an absent one already means. */\nconst italicEncoding: ToolPrefBooleanEncoding = {\n read: (stored) => stored === 'italic',\n write: (on) => (on ? 'italic' : undefined),\n};\n\n/** `TextStyle.align` read as the edge that paints, or as `justify`. The model\n * also holds the reading-order pair `start` / `end`, which the segments would\n * otherwise leave unlit; they read through `direction`, and a click writes the\n * edge. */\nconst alignEncoding: ToolPrefEnumEncoding = {\n read: (stored, style) => {\n if (stored === undefined || stored === 'justify') return stored;\n const direction = style?.direction === 'rtl' ? 'rtl' : 'ltr';\n return resolveAlign(stored as TextAlign, direction);\n },\n write: (edge) => edge,\n};\n\n/** Options come from the registry, so a consumer's registered entry appears in\n * the picker with no kit edit. A `select` rather than a `toggle`: nine options\n * will not fit a segmented strip. */\nconst markerOptions = () => [\n { value: '', label: 'None' },\n ...listMarkers().map((m) => ({ value: m.id, label: m.id })),\n];\n\n/** Build the standard shape schema — Layout (pose box + rotation) +\n * Appearance (fill / stroke), optionally a Text group. Matches the kit's\n * builtin-shape data template (`{ path, fill, stroke?, text? }`,\n * `useBuiltinShapeTools`). */\nfunction shapeSchema(opts: { text?: boolean } = {}): ToolPrefGroup {\n return {\n name: 'Properties',\n children: {\n layout: {\n name: 'Layout',\n children: {\n 'pose.x': { kind: 'number', name: 'X', description: 'Left edge, world units.', default: 0, pair: 'Position' },\n 'pose.y': { kind: 'number', name: 'Y', description: 'Top edge, world units.', default: 0, pair: 'Position' },\n 'pose.width': { kind: 'number', name: 'W', description: 'Width, world units.', default: 0, min: 0, pair: 'Size' },\n 'pose.height': { kind: 'number', name: 'H', description: 'Height, world units.', default: 0, min: 0, pair: 'Size' },\n 'pose.rotation': { kind: 'number', name: 'Rotation', description: 'Rotation about the box center.', default: 0, step: 1, unit: rotationDegreesUnit },\n },\n },\n // What the node *is* outranks how it is painted: a text node's copy is\n // the first thing an editor reaches for.\n ...(opts.text\n ? {\n content: {\n name: 'Content',\n children: {\n // `block`: the content is the section, so a 64px label column\n // reading \"Text\" inside a section reading \"Text\" is one word\n // twice and a narrower field for the sake of it.\n 'data.text': { kind: 'string', name: 'Text', description: 'Text content.', default: '', block: true },\n },\n },\n }\n : {}),\n appearance: {\n // Headless: `Fill` and `Stroke` head their own blocks, and an\n // `Appearance` rule over them names neither of the two paints a\n // reader is looking at.\n name: '',\n children: {\n // A `paint` leaf, not a `color` one: `data.fill` is the tagged\n // `FillStyle` union, so a color control pointed at it would read\n // `undefined` off a gradient and write a bare string over it.\n // `block` for the same reason every stroke field is: the kind bar\n // and the per-kind editor want the width a 64px label column takes.\n 'data.fill': { kind: 'paint', name: 'Fill', description: 'Fill paint.', default: { fill: 'solid', color: '#000000ff' }, alpha: true, block: true },\n // An object leaf: `data.stroke` is a whole `Stroke`, and its fields\n // belong to one value. Sibling leaves addressing into it would each\n // write one field of a value they can only half see.\n 'data.stroke': {\n kind: 'object',\n name: 'Stroke',\n description: 'Stroke paint and line geometry.',\n default: { paint: { fill: 'solid', color: '#000000ff' }, width: 1 },\n block: true,\n children: {\n // Every row is `block`: under a heading already reading STROKE,\n // a 64px label column spells the section name again and takes\n // the width the controls need. Each field leads with its own\n // glyph instead.\n // Unpaired: the paint field is a whole paint editor — a kind bar\n // over a per-kind body — and cannot share a row with a slider.\n width: { kind: 'number', name: 'Width', description: 'Stroke width, world units.', default: 1, min: 0, max: 20, step: 0.5, control: 'slider', icon: 'strokeWidth', block: true },\n paint: { kind: 'paint', name: 'Paint', description: 'Stroke paint.', default: { fill: 'solid', color: '#000000ff' }, alpha: true, block: true },\n // Three options each: a segmented control shows every one at\n // once where a select shows the current one and hides the rest\n // behind a click.\n cap: { kind: 'enum', name: 'Cap', description: 'How an open end is drawn.', default: 'butt', control: 'toggle', block: true, pair: 'Line', options: [{ value: 'butt', label: 'Butt', icon: 'capButt' }, { value: 'round', label: 'Round', icon: 'capRound' }, { value: 'square', label: 'Square', icon: 'capSquare' }] },\n join: { kind: 'enum', name: 'Join', description: 'How a corner is drawn.', default: 'miter', control: 'toggle', block: true, pair: 'Line', options: [{ value: 'miter', label: 'Miter', icon: 'joinMiter' }, { value: 'round', label: 'Round', icon: 'joinRound' }, { value: 'bevel', label: 'Bevel', icon: 'joinBevel' }] },\n align: { kind: 'enum', name: 'Align', description: 'Where the ribbon sits relative to the edge.', default: 'center', control: 'toggle', block: true, pair: 'Line', options: [{ value: 'inner', label: 'Inner', icon: 'alignInner' }, { value: 'center', label: 'Center', icon: 'alignCenter' }, { value: 'outer', label: 'Outer', icon: 'alignOuter' }] },\n // Its own row: three bars already fill the one above, and the\n // dash pattern is a property of the line rather than of how the\n // ribbon meets the geometry.\n dash: { kind: 'enum', name: 'Style', description: 'Solid, dashed or dotted. Dash lengths are multiples of the stroke width, so a style holds as the width changes.', default: 'solid', control: 'toggle', block: true, encoding: strokeDashEncoding, options: [{ value: 'solid', label: 'Solid', icon: 'dashSolid' }, { value: 'dashed', label: 'Dashed', icon: 'dashDashed' }, { value: 'dotted', label: 'Dotted', icon: 'dashDotted' }, { value: 'custom', label: 'Custom', icon: 'dashCustom', disabled: true }] },\n markerStart: { kind: 'enum', name: 'Start', description: 'Marker at the first vertex of each open subpath.', default: '', control: 'select', block: true, pair: 'Markers', encoding: markerEncoding, options: markerOptions() },\n markerMid: { kind: 'enum', name: 'Mid', description: 'Marker at every interior authored vertex.', default: '', control: 'select', block: true, pair: 'Markers', encoding: markerEncoding, options: markerOptions() },\n markerEnd: { kind: 'enum', name: 'End', description: 'Marker at the last vertex of each open subpath.', default: '', control: 'select', block: true, pair: 'Markers', encoding: markerEncoding, options: markerOptions() },\n },\n },\n },\n },\n ...(opts.text\n ? {\n text: {\n // Headless: `Character` and `Paragraph` carry the labels, and a\n // `Typography` heading over them names nothing a reader can't\n // already see.\n name: '',\n children: {\n // One object leaf, not a row of siblings addressing into it:\n // `data.style` is a `TextStyle`, and its character and\n // paragraph fields are one value that reads as two lists.\n // The groups head those lists and contribute nothing to the\n // path — a field inside one is still a field of the style.\n 'data.style': {\n kind: 'object',\n name: 'Style',\n description: 'Typography for the whole node. Its color is the node\\'s own `data.fill`, in Appearance.',\n default: {},\n block: true,\n children: {\n character: {\n name: 'Character',\n children: {\n fontFamily: { kind: 'font-family', name: 'Font', description: 'Registered font family.', default: 'sans-serif' },\n fontSize: { kind: 'number', name: 'Size', description: 'Font size, world units.', default: 16, min: 1, step: 1, pair: 'Size / weight' },\n fontWeight: { kind: 'font-weight', name: 'Weight', description: 'Font weight, from the faces the family has.', default: 400, pair: 'Size / weight' },\n // One row of segments, the strip every text editor\n // draws: the slant, the three rules, then the two\n // scripts. Italic is a flag here although the field\n // is `fontStyle`, whose only other value is upright.\n fontStyle: { kind: 'boolean', name: 'Italic', description: 'Set the text in its italic face.', default: false, control: 'toggle', icon: 'italic', short: ['I'], pair: 'Style', encoding: italicEncoding },\n underline: { kind: 'boolean', name: 'Underline', description: 'Underline the text.', default: false, control: 'toggle', icon: 'underline', short: ['U'], pair: 'Style' },\n strikethrough: { kind: 'boolean', name: 'Strikethrough', description: 'Strike through the text.', default: false, control: 'toggle', icon: 'strikethrough', short: ['S'], pair: 'Style' },\n overline: { kind: 'boolean', name: 'Overline', description: 'Rule the text above its ascent.', default: false, control: 'toggle', icon: 'overline', short: ['O'], pair: 'Style' },\n script: { kind: 'enum', name: 'Script', description: 'Set the text smaller and raised or lowered, on the line it would otherwise hold.', default: undefined, control: 'toggle', clearable: true, pair: 'Style', options: [{ value: 'super', label: 'Superscript', icon: 'superscript' }, { value: 'sub', label: 'Subscript', icon: 'subscript' }] },\n letterSpacing: { kind: 'number', name: 'Tracking', description: 'Extra advance per glyph, world units.', default: 0, step: 0.1 },\n textTransform: { kind: 'enum', name: 'Case', description: 'Draw the text in capitals, lowercase or title case. The text itself is unchanged.', default: 'none', control: 'toggle', options: [{ value: 'none', label: 'None', short: ['–'] }, { value: 'uppercase', label: 'Uppercase', short: ['AA'] }, { value: 'lowercase', label: 'Lowercase', short: ['aa'] }, { value: 'capitalize', label: 'Capitalize', short: ['Aa'] }] },\n fontVariantCaps: { kind: 'enum', name: 'Small caps', description: 'Draw lowercase letters as smaller capitals. The text itself is unchanged.', default: 'normal', control: 'toggle', options: [{ value: 'normal', label: 'Normal', short: ['–'] }, { value: 'small-caps', label: 'Small caps', short: ['Sc'] }] },\n },\n },\n paragraph: {\n name: 'Paragraph',\n children: {\n lineHeight: { kind: 'number', name: 'Leading', description: 'Line height as a multiple of font size.', default: 1.2, min: 0.5, step: 0.1 },\n wrap: { kind: 'boolean', name: 'Wrap', description: 'Break lines between words at the box width.', default: false, control: 'switch' },\n direction: { kind: 'enum', name: 'Direction', description: 'Reading direction.', default: 'ltr', control: 'toggle', options: [{ value: 'ltr', label: 'Left to right', short: ['LTR'] }, { value: 'rtl', label: 'Right to left', short: ['RTL'] }] },\n // Last, so the box's vertical alignment — a field of\n // the node rather than of its style — follows it.\n align: { kind: 'enum', name: 'Align', description: 'Horizontal alignment.', default: 'left', control: 'toggle', encoding: alignEncoding, options: [{ value: 'left', label: 'Left', icon: 'textAlignLeft' }, { value: 'center', label: 'Center', icon: 'textAlignCenter' }, { value: 'right', label: 'Right', icon: 'textAlignRight' }, { value: 'justify', label: 'Justify', icon: 'textAlignJustify' }] },\n },\n },\n },\n },\n 'data.verticalAlign': { kind: 'enum', name: 'Vertical', description: 'Where the lines sit in the box\\'s height.', default: 'top', control: 'toggle', options: [{ value: 'top', label: 'Top', icon: 'textAlignTop' }, { value: 'center', label: 'Middle', icon: 'textAlignMiddle' }, { value: 'bottom', label: 'Bottom', icon: 'textAlignBottom' }] },\n },\n },\n }\n : {}),\n },\n };\n}\n\n/**\n * Default properties-trait entries covering the kit's built-in shape\n * kinds (`KIT_SHAPE_KINDS`) — the sibling of `defaultNodeRouting`. Every\n * kind gets the standard box schema; `text` adds a Text group. In\n * lockstep with `KIT_SHAPE_KINDS` by construction (derived via `.map`).\n */\nexport const defaultNodeProperties: readonly NodePropertiesEntry[] =\n KIT_SHAPE_KINDS.map((name) => ({\n name,\n schema: shapeSchema({ text: name === 'text' }),\n }));\n\n/**\n * Properties-trait entries for the *inferred* routing kinds\n * (`inferredNodeRouting`: `text` / `path` / `image`) — the vocabulary\n * consumers produce when they don't tag `data.kind` (e.g. WeaselDraw).\n * In lockstep with `inferredNodeRouting` by construction.\n */\nexport const inferredNodeProperties: readonly NodePropertiesEntry[] =\n inferredNodeRouting.map((e) => ({\n name: e.name,\n schema: shapeSchema({ text: e.name === 'text' }),\n }));\n"],"mappings":";;;;;;;;AAYA,IAAaA,IAA0CC,EAASC,GAAe,OAAO;CACpF,WAAW;CACX,QAAQ;AACV,CAAC;AAGD,SAASC,EAAc,GAAkF;CACvG,IAAMC,IAAIC,GAAQ;CAElB,IADI,OAAOD,KAAM,YACb,OAAOA,KAAM,YAAYA,KAAc,OAAQA,EAAuB,MAAO,UAC/E,OAAOA;AAGX;AAKA,IAAME,IAA2C;CAC/C,OAAO,GAAM,MACXD,MAAW,KAAA,IACP,KAAA,IACAE,EAAkB,MAAM,QAAQC,CAAI,IAAKA,IAAoB,KAAA,GAAWL,EAAcE,CAAM,CAAC;CACnG,QAAQ,GAAO,MACbI,MAAU,YAAYA,MAAU,WAC5BC,EAAmBD,GAAON,EAAcE,CAAM,CAAC,IAI/CI,MAAU,UACR,KAAA,IACAJ,GAAQ;AAClB,GAIMM,IAAuC;CAC3C,OAAO,MACD,OAAOC,KAAQ,WAAiBA,IAChCA,KAAO,OAAOA,KAAQ,YAAY,SAASA,IAAY,OAAQA,EAAwB,GAAG,IACvF;CAET,QAAQ,MAAWC,MAAU,KAAK,KAAA,IAAYA;AAChD,GAIMC,IAA0C;CAC9C,OAAO,MAAWC,MAAW;CAC7B,QAAQ,MAAQC,IAAK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K,OAAU;CAC7B;CACA,QAAQH,EAAY,EAAE,MAAMI,MAAS,OAAO,CAAC;AAC/C,EAAE,GAQSC,IACXC,EAAoB,KAAK,OAAO;CAC9B,MAAM,EAAE;CACR,QAAQN,EAAY,EAAE,MAAM,EAAE,SAAS,OAAO,CAAC;AACjD,EAAE"}
|
|
1
|
+
{"version":3,"file":"defaultNodeProperties.js","names":["rotationDegreesUnit","prefUnit","ANGLE_RADIANS","strokeWidthOf","w","stroke","strokeDashEncoding","strokeDashStyleOf","dash","style","dashForStrokeStyle","markerEncoding","ref","value","italicEncoding","stored","on","alignEncoding","direction","resolveAlign","edge","markerOptionsCache","markerOptions","generation","markerGeneration","listMarkers","m","markerLeaf","leaf","shapeSchema","opts","defaultNodeProperties","KIT_SHAPE_KINDS","name","inferredNodeProperties","inferredNodeRouting"],"sources":["../../../src/canvas/SceneCanvas/defaultNodeProperties.ts"],"sourcesContent":["import { prefUnit, type PrefBooleanEncoding, type PrefEnum, type PrefEnumEncoding, type PrefNumberUnit, type PrefSection } from '@weasel-js/prefs';\nimport { inferredNodeRouting } from './defaultNodeRouting';\nimport { KIT_SHAPE_KINDS } from 'core/shapeKinds';\nimport { listMarkers, markerGeneration } from 'core/strokeMarkers';\nimport { dashForStrokeStyle, strokeDashStyleOf } from '@weasel-js/paint';\nimport { resolveAlign, type TextAlign } from '@weasel-js/text';\nimport type { NodePropertiesEntry } from 'core/scene/NodeProperties';\nimport { ANGLE_RADIANS } from '@weasel-js/quantity';\n\n/** Radians-stored / degrees-shown conversion for `pose.rotation` leaves.\n * Display rounds to 0.1° so a canonical radian value doesn't render as\n * a 15-digit float. */\nexport const rotationDegreesUnit: PrefNumberUnit = prefUnit(ANGLE_RADIANS, 'deg', {\n precision: 1,\n suffix: '°',\n});\n\n/** `Stroke.width` off a partly-typed stroke object, or `undefined`. */\nfunction strokeWidthOf(stroke: Record<string, unknown> | undefined): number | { px: number } | undefined {\n const w = stroke?.width;\n if (typeof w === 'number') return w;\n if (typeof w === 'object' && w !== null && typeof (w as { px?: unknown }).px === 'number') {\n return w as { px: number };\n }\n return undefined;\n}\n\n/** `Stroke.dash` — a stored array of lengths — read and written as a named\n * style. The presets are multiples of the sibling `width`, which is why the\n * encoding is handed the whole stroke rather than the field. */\nconst strokeDashEncoding: PrefEnumEncoding = {\n read: (dash, stroke) =>\n stroke === undefined\n ? undefined\n : strokeDashStyleOf(Array.isArray(dash) ? (dash as number[]) : undefined, strokeWidthOf(stroke)),\n write: (style, stroke) =>\n style === 'dashed' || style === 'dotted'\n ? dashForStrokeStyle(style, strokeWidthOf(stroke))\n // `solid` is stored as no dash at all. `custom` is reportable, not\n // authorable: it names an imported array, and the array it names is the\n // one already stored.\n : style === 'solid'\n ? undefined\n : stroke?.dash,\n};\n\n/** `Stroke.markerStart` / `markerMid` / `markerEnd` — a `MarkerRef` — read and\n * written as a bare key, with the empty string standing for no marker. */\nconst markerEncoding: PrefEnumEncoding = {\n read: (ref) => {\n if (typeof ref === 'string') return ref;\n if (ref && typeof ref === 'object' && 'key' in ref) return String((ref as { key: string }).key);\n return '';\n },\n write: (value) => (value === '' ? undefined : value),\n};\n\n/** `TextStyle.fontStyle` as an Italic flag. Off removes the field rather than\n * storing `'normal'`, which is what an absent one already means. */\nconst italicEncoding: PrefBooleanEncoding = {\n read: (stored) => stored === 'italic',\n write: (on) => (on ? 'italic' : undefined),\n};\n\n/** `TextStyle.align` read as the edge that paints, or as `justify`. The model\n * also holds the reading-order pair `start` / `end`, which the segments would\n * otherwise leave unlit; they read through `direction`, and a click writes the\n * edge. */\nconst alignEncoding: PrefEnumEncoding = {\n read: (stored, style) => {\n if (stored === undefined || stored === 'justify') return stored;\n const direction = style?.direction === 'rtl' ? 'rtl' : 'ltr';\n return resolveAlign(stored as TextAlign, direction);\n },\n write: (edge) => edge,\n};\n\ntype MarkerOptions = PrefEnum['options'];\nlet markerOptionsCache: { generation: number; options: MarkerOptions } | undefined;\n\n/** A `select` rather than a `toggle`: nine options will not fit a segmented\n * strip. One array per state of the registry, so a reader comparing\n * references sees a change only when the set changed. */\nfunction markerOptions(): MarkerOptions {\n const generation = markerGeneration();\n if (markerOptionsCache?.generation !== generation) {\n markerOptionsCache = {\n generation,\n options: [\n { value: '', label: 'None' },\n ...listMarkers().map((m) => ({ value: m.id, label: m.id })),\n ],\n };\n }\n return markerOptionsCache.options;\n}\n\n// An accessor: these schemas are built at module load, before a consumer can\n// have registered a marker, so the list is read from the registry when asked.\nfunction markerLeaf(leaf: Omit<PrefEnum, 'kind' | 'options' | 'default' | 'control' | 'encoding' | 'clearable'>): PrefEnum {\n return {\n kind: 'enum', default: '', control: 'select', encoding: markerEncoding, ...leaf,\n get options() { return markerOptions(); },\n };\n}\n\n/** Build the standard shape schema — Layout (pose box + rotation) +\n * Appearance (fill / stroke), optionally a Text group. Matches the kit's\n * builtin-shape data template (`{ path, fill, stroke?, text? }`,\n * `useBuiltinShapeTools`). */\nfunction shapeSchema(opts: { text?: boolean } = {}): PrefSection {\n return {\n name: 'Properties',\n members: {\n layout: {\n name: 'Layout',\n members: {\n 'pose.x': { kind: 'number', name: 'X', description: 'Left edge, world units.', default: 0, pair: { with: 'pose.y', label: 'Position' } },\n 'pose.y': { kind: 'number', name: 'Y', description: 'Top edge, world units.', default: 0 },\n 'pose.width': { kind: 'number', name: 'W', description: 'Width, world units.', default: 0, min: 0, pair: { with: 'pose.height', label: 'Size' } },\n 'pose.height': { kind: 'number', name: 'H', description: 'Height, world units.', default: 0, min: 0 },\n 'pose.rotation': { kind: 'number', name: 'Rotation', description: 'Rotation about the box center.', default: 0, step: 1, unit: rotationDegreesUnit, absentIsDefault: true },\n },\n },\n // What the node *is* outranks how it is painted: a text node's copy is\n // the first thing an editor reaches for.\n ...(opts.text\n ? {\n content: {\n name: 'Content',\n members: {\n // `block`: the content is the section, so a 64px label column\n // reading \"Text\" inside a section reading \"Text\" is one word\n // twice and a narrower field for the sake of it.\n 'data.text': { kind: 'string', name: 'Text', description: 'Text content.', absentIsDefault: true, default: '', block: true },\n },\n },\n }\n : {}),\n appearance: {\n // Headless: `Fill` and `Stroke` head their own blocks, and an\n // `Appearance` rule over them names neither of the two paints a\n // reader is looking at.\n name: '',\n members: {\n // A `paint` leaf, not a `color` one: `data.fill` is the tagged\n // `FillStyle` union, so a color control pointed at it would read\n // `undefined` off a gradient and write a bare string over it.\n // `block` for the same reason every stroke field is: the kind bar\n // and the per-kind editor want the width a 64px label column takes.\n 'data.fill': { kind: 'paint', name: 'Fill', description: 'Fill paint.', default: { fill: 'solid', color: '#000000ff' }, alpha: true, block: true },\n // An object leaf: `data.stroke` is a whole `Stroke`, and its fields\n // belong to one value. Sibling leaves addressing into it would each\n // write one field of a value they can only half see.\n 'data.stroke': {\n kind: 'object',\n name: 'Stroke',\n description: 'Stroke paint and line geometry.',\n default: { paint: { fill: 'solid', color: '#000000ff' }, width: 1 },\n block: true,\n children: {\n // Every row is `block`: under a heading already reading STROKE,\n // a 64px label column spells the section name again and takes\n // the width the controls need. Each field leads with its own\n // glyph instead.\n // Unpaired: the paint field is a whole paint editor — a kind bar\n // over a per-kind body — and cannot share a row with a slider.\n width: { kind: 'number', name: 'Width', description: 'Stroke width, world units.', absentIsDefault: true, default: 1, min: 0, max: 20, step: 0.5, control: 'slider', icon: 'strokeWidth', block: true },\n paint: { kind: 'paint', name: 'Paint', description: 'Stroke paint.', default: { fill: 'solid', color: '#000000ff' }, alpha: true, block: true },\n // Three options each: a segmented control shows every one at\n // once where a select shows the current one and hides the rest\n // behind a click.\n cap: { kind: 'enum', name: 'Cap', description: 'How an open end is drawn.', absentIsDefault: true, default: 'butt', control: 'toggle', block: true, pair: { with: ['data.stroke.join', 'data.stroke.align'], label: 'Line' }, options: [{ value: 'butt', label: 'Butt', icon: 'capButt' }, { value: 'round', label: 'Round', icon: 'capRound' }, { value: 'square', label: 'Square', icon: 'capSquare' }] },\n join: { kind: 'enum', name: 'Join', description: 'How a corner is drawn.', absentIsDefault: true, default: 'miter', control: 'toggle', block: true, options: [{ value: 'miter', label: 'Miter', icon: 'joinMiter' }, { value: 'round', label: 'Round', icon: 'joinRound' }, { value: 'bevel', label: 'Bevel', icon: 'joinBevel' }] },\n align: { kind: 'enum', name: 'Align', description: 'Where the ribbon sits relative to the edge.', absentIsDefault: true, default: 'center', control: 'toggle', block: true, options: [{ value: 'inner', label: 'Inner', icon: 'alignInner' }, { value: 'center', label: 'Center', icon: 'alignCenter' }, { value: 'outer', label: 'Outer', icon: 'alignOuter' }] },\n // Its own row: three bars already fill the one above, and the\n // dash pattern is a property of the line rather than of how the\n // ribbon meets the geometry.\n dash: { kind: 'enum', name: 'Style', description: 'Solid, dashed or dotted. Dash lengths are multiples of the stroke width, so a style holds as the width changes.', default: 'solid', control: 'toggle', block: true, encoding: strokeDashEncoding, options: [{ value: 'solid', label: 'Solid', icon: 'dashSolid' }, { value: 'dashed', label: 'Dashed', icon: 'dashDashed' }, { value: 'dotted', label: 'Dotted', icon: 'dashDotted' }, { value: 'custom', label: 'Custom', icon: 'dashCustom', disabled: true }] },\n markerStart: markerLeaf({ name: 'Start', description: 'Marker at the first vertex of each open subpath.', block: true, pair: { with: ['data.stroke.markerMid', 'data.stroke.markerEnd'], label: 'Markers' } }),\n markerMid: markerLeaf({ name: 'Mid', description: 'Marker at every interior authored vertex.', block: true }),\n markerEnd: markerLeaf({ name: 'End', description: 'Marker at the last vertex of each open subpath.', block: true }),\n },\n },\n },\n },\n ...(opts.text\n ? {\n text: {\n // Headless: `Character` and `Paragraph` carry the labels, and a\n // `Typography` heading over them names nothing a reader can't\n // already see.\n name: '',\n members: {\n // One object leaf, not a row of siblings addressing into it:\n // `data.style` is a `TextStyle`, and its character and\n // paragraph fields are one value that reads as two lists.\n // The groups head those lists and contribute nothing to the\n // path — a field inside one is still a field of the style.\n 'data.style': {\n kind: 'object',\n name: 'Style',\n description: 'Typography for the whole node. Its color is the node\\'s own `data.fill`, in Appearance.',\n default: {},\n absentIsDefault: true,\n block: true,\n children: {\n character: {\n name: 'Character',\n members: {\n fontFamily: { kind: 'font-family', name: 'Font', description: 'Registered font family.', absentIsDefault: true, default: 'sans-serif' },\n fontSize: { kind: 'number', name: 'Size', description: 'Font size, world units.', absentIsDefault: true, default: 16, min: 1, step: 1, pair: { with: 'data.style.fontWeight', label: 'Size / weight' } },\n fontWeight: { kind: 'font-weight', name: 'Weight', description: 'Font weight, from the faces the family has.', absentIsDefault: true, default: 400 },\n // One row of segments, the strip every text editor\n // draws: the slant, the three rules, then the two\n // scripts. Italic is a flag here although the field\n // is `fontStyle`, whose only other value is upright.\n fontStyle: { kind: 'boolean', name: 'Italic', description: 'Set the text in its italic face.', default: false, control: 'toggle', icon: 'italic', short: ['I'], pair: { with: ['data.style.underline', 'data.style.strikethrough', 'data.style.overline', 'data.style.script'], label: 'Style' }, encoding: italicEncoding },\n underline: { kind: 'boolean', name: 'Underline', description: 'Underline the text.', absentIsDefault: true, default: false, control: 'toggle', icon: 'underline', short: ['U'] },\n strikethrough: { kind: 'boolean', name: 'Strikethrough', description: 'Strike through the text.', absentIsDefault: true, default: false, control: 'toggle', icon: 'strikethrough', short: ['S'] },\n overline: { kind: 'boolean', name: 'Overline', description: 'Rule the text above its ascent.', absentIsDefault: true, default: false, control: 'toggle', icon: 'overline', short: ['O'] },\n script: { kind: 'enum', name: 'Script', description: 'Set the text smaller and raised or lowered, on the line it would otherwise hold.', default: undefined, control: 'toggle', clearable: true, options: [{ value: 'super', label: 'Superscript', icon: 'superscript' }, { value: 'sub', label: 'Subscript', icon: 'subscript' }] },\n letterSpacing: { kind: 'number', name: 'Tracking', description: 'Extra advance per glyph, world units.', absentIsDefault: true, default: 0, step: 0.1 },\n textTransform: { kind: 'enum', name: 'Case', description: 'Draw the text in capitals, lowercase or title case. The text itself is unchanged.', absentIsDefault: true, default: 'none', control: 'toggle', options: [{ value: 'none', label: 'None', short: ['–'] }, { value: 'uppercase', label: 'Uppercase', short: ['AA'] }, { value: 'lowercase', label: 'Lowercase', short: ['aa'] }, { value: 'capitalize', label: 'Capitalize', short: ['Aa'] }] },\n fontVariantCaps: { kind: 'enum', name: 'Small caps', description: 'Draw lowercase letters as smaller capitals. The text itself is unchanged.', absentIsDefault: true, default: 'normal', control: 'toggle', options: [{ value: 'normal', label: 'Normal', short: ['–'] }, { value: 'small-caps', label: 'Small caps', short: ['Sc'] }] },\n },\n },\n paragraph: {\n name: 'Paragraph',\n members: {\n lineHeight: { kind: 'number', name: 'Leading', description: 'Line height as a multiple of font size.', absentIsDefault: true, default: 1.2, min: 0.5, step: 0.1 },\n wrap: { kind: 'boolean', name: 'Wrap', description: 'Break lines between words at the box width.', absentIsDefault: true, default: false, control: 'switch' },\n tabSize: { kind: 'number', name: 'Tab size', description: 'Distance between tab stops, in spaces.', absentIsDefault: true, default: 8, min: 1, step: 1 },\n direction: { kind: 'enum', name: 'Direction', description: 'Reading direction. Auto takes each paragraph\\'s from its first strong character.', absentIsDefault: true, default: 'auto', control: 'toggle', options: [{ value: 'auto', label: 'Auto', short: ['Auto'] }, { value: 'ltr', label: 'Left to right', short: ['LTR'] }, { value: 'rtl', label: 'Right to left', short: ['RTL'] }] },\n // Last, so the box's vertical alignment — a field of\n // the node rather than of its style — follows it.\n align: { kind: 'enum', name: 'Align', description: 'Horizontal alignment.', absentIsDefault: true, default: 'left', control: 'toggle', encoding: alignEncoding, options: [{ value: 'left', label: 'Left', icon: 'textAlignLeft' }, { value: 'center', label: 'Center', icon: 'textAlignCenter' }, { value: 'right', label: 'Right', icon: 'textAlignRight' }, { value: 'justify', label: 'Justify', icon: 'textAlignJustify' }] },\n },\n },\n },\n },\n 'data.verticalAlign': { kind: 'enum', name: 'Vertical', description: 'Where the lines sit in the box\\'s height.', absentIsDefault: true, default: 'top', control: 'toggle', options: [{ value: 'top', label: 'Top', icon: 'textAlignTop' }, { value: 'center', label: 'Middle', icon: 'textAlignMiddle' }, { value: 'bottom', label: 'Bottom', icon: 'textAlignBottom' }] },\n },\n },\n }\n : {}),\n },\n };\n}\n\n/**\n * Default properties-trait entries covering the kit's built-in shape\n * kinds (`KIT_SHAPE_KINDS`) — the sibling of `defaultNodeRouting`. Every\n * kind gets the standard box schema; `text` adds a Text group. In\n * lockstep with `KIT_SHAPE_KINDS` by construction (derived via `.map`).\n */\nexport const defaultNodeProperties: readonly NodePropertiesEntry[] =\n KIT_SHAPE_KINDS.map((name) => ({\n name,\n schema: shapeSchema({ text: name === 'text' }),\n }));\n\n/**\n * Properties-trait entries for the *inferred* routing kinds\n * (`inferredNodeRouting`: `text` / `path` / `image`) — the vocabulary\n * consumers produce when they don't tag `data.kind` (e.g. WeaselDraw).\n * In lockstep with `inferredNodeRouting` by construction.\n */\nexport const inferredNodeProperties: readonly NodePropertiesEntry[] =\n inferredNodeRouting.map((e) => ({\n name: e.name,\n schema: shapeSchema({ text: e.name === 'text' }),\n }));\n"],"mappings":";;;;;;;;AAYA,IAAaA,IAAsCC,EAASC,GAAe,OAAO;CAChF,WAAW;CACX,QAAQ;AACV,CAAC;AAGD,SAASC,EAAc,GAAkF;CACvG,IAAMC,IAAIC,GAAQ;CAElB,IADI,OAAOD,KAAM,YACb,OAAOA,KAAM,YAAYA,KAAc,OAAQA,EAAuB,MAAO,UAC/E,OAAOA;AAGX;AAKA,IAAME,IAAuC;CAC3C,OAAO,GAAM,MACXD,MAAW,KAAA,IACP,KAAA,IACAE,EAAkB,MAAM,QAAQC,CAAI,IAAKA,IAAoB,KAAA,GAAWL,EAAcE,CAAM,CAAC;CACnG,QAAQ,GAAO,MACbI,MAAU,YAAYA,MAAU,WAC5BC,EAAmBD,GAAON,EAAcE,CAAM,CAAC,IAI/CI,MAAU,UACR,KAAA,IACAJ,GAAQ;AAClB,GAIMM,IAAmC;CACvC,OAAO,MACD,OAAOC,KAAQ,WAAiBA,IAChCA,KAAO,OAAOA,KAAQ,YAAY,SAASA,IAAY,OAAQA,EAAwB,GAAG,IACvF;CAET,QAAQ,MAAWC,MAAU,KAAK,KAAA,IAAYA;AAChD,GAIMC,IAAsC;CAC1C,OAAO,MAAWC,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