@weasel-js/core 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/dist/WeaselProvider.js +1 -1
- package/dist/affordances/pathAnchors.js +10 -6
- package/dist/affordances/pathAnchors.js.map +1 -1
- package/dist/barrel/canvas.js +3 -1
- package/dist/barrel/paint.js +4 -4
- package/dist/barrel/paths.js +8 -4
- package/dist/barrel/renderer.js +3 -2
- package/dist/barrel/routing.js +4 -4
- package/dist/barrel/scene.js +2 -1
- package/dist/barrel/text.js +2 -2
- package/dist/barrel/viewport.js +6 -2
- package/dist/canvas/Canvas.js +2 -1
- package/dist/canvas/Canvas.js.map +1 -1
- package/dist/canvas/CanvasView.js +23 -34
- package/dist/canvas/CanvasView.js.map +1 -1
- package/dist/canvas/ModalityHud.js +1 -1
- package/dist/canvas/NodeShape.js +4 -1
- package/dist/canvas/NodeShape.js.map +1 -1
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +1 -1
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js +23 -0
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js.map +1 -0
- package/dist/canvas/SceneCanvas/canvasPassThrough.js +1 -0
- package/dist/canvas/SceneCanvas/canvasPassThrough.js.map +1 -1
- package/dist/canvas/SceneCanvas/props.js.map +1 -1
- package/dist/canvas/SceneCanvas/scenePointQuery.js +7 -3
- package/dist/canvas/SceneCanvas/scenePointQuery.js.map +1 -1
- package/dist/canvas/SceneCanvas/useActionTunings.js +6 -1
- package/dist/canvas/SceneCanvas/useActionTunings.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js +1 -0
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasTools.js +7 -2
- package/dist/canvas/SceneCanvas/useCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +9 -3
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +10 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +1 -0
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +19 -4
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js +2 -1
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
- package/dist/canvas/SceneCanvas.js +11 -10
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/ViewMarker.js +35 -0
- package/dist/canvas/ViewMarker.js.map +1 -0
- package/dist/canvas/defaultDrawOne.js +2 -0
- package/dist/canvas/defaultDrawOne.js.map +1 -1
- package/dist/canvas/deps/booleans.js +2 -1
- package/dist/canvas/deps/booleans.js.map +1 -1
- package/dist/canvas/deps/hitTestArea.js +2 -2
- package/dist/canvas/deps/hitTestArea.js.map +1 -1
- package/dist/canvas/deps/insert.js +6 -2
- package/dist/canvas/deps/insert.js.map +1 -1
- package/dist/canvas/deps/pathEditCommits.js +3 -7
- package/dist/canvas/deps/pathEditCommits.js.map +1 -1
- package/dist/canvas/drawnBounds.js +11 -3
- package/dist/canvas/drawnBounds.js.map +1 -1
- package/dist/canvas/inheritedPaints.js +44 -0
- package/dist/canvas/inheritedPaints.js.map +1 -0
- package/dist/canvas/nodeShapes/derivedPainter.js +15 -16
- package/dist/canvas/nodeShapes/derivedPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/nodePaint.js +13 -34
- package/dist/canvas/nodeShapes/nodePaint.js.map +1 -1
- package/dist/canvas/nodeShapes/pathPainter.js +9 -8
- package/dist/canvas/nodeShapes/pathPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +4 -5
- package/dist/canvas/nodeShapes/rectFallbackPainter.js.map +1 -1
- package/dist/canvas/nodeShapes/shapePainter.js +11 -10
- package/dist/canvas/nodeShapes/shapePainter.js.map +1 -1
- package/dist/canvas/nodeShapes/textPainter.js +13 -12
- package/dist/canvas/nodeShapes/textPainter.js.map +1 -1
- package/dist/canvas/pickReach.js +3 -3
- package/dist/canvas/pickReach.js.map +1 -1
- package/dist/canvas/pickWalk.js +3 -1
- package/dist/canvas/pickWalk.js.map +1 -1
- package/dist/canvas/renderSceneToPixels.js +1 -1
- package/dist/canvas/renderSceneToPixels.js.map +1 -1
- package/dist/canvas/sceneSlotWiring.js +2 -1
- package/dist/canvas/sceneSlotWiring.js.map +1 -1
- package/dist/canvas/sceneViewRender.js +2 -1
- package/dist/canvas/sceneViewRender.js.map +1 -1
- package/dist/canvas/surfaceContribution.js +12 -8
- package/dist/canvas/surfaceContribution.js.map +1 -1
- package/dist/canvas/useCanvasView.js +4 -2
- package/dist/canvas/useCanvasView.js.map +1 -1
- package/dist/canvas/useLayerStack.js +6 -2
- package/dist/canvas/useLayerStack.js.map +1 -1
- package/dist/canvas/useViewAim.js +121 -0
- package/dist/canvas/useViewAim.js.map +1 -0
- package/dist/canvas/useViewNesting.js +3 -2
- package/dist/canvas/useViewNesting.js.map +1 -1
- package/dist/canvas/useViewRegistrySurface.js +4 -2
- package/dist/canvas/useViewRegistrySurface.js.map +1 -1
- package/dist/canvas/viewMarkers.js +63 -0
- package/dist/canvas/viewMarkers.js.map +1 -0
- package/dist/canvas/viewRegistry.js +27 -1
- package/dist/canvas/viewRegistry.js.map +1 -1
- package/dist/core/pages/pageEdits.js +2 -3
- package/dist/core/pages/pageEdits.js.map +1 -1
- package/dist/core/paint/meshKindLazy.js +59 -2
- package/dist/core/paint/meshKindLazy.js.map +1 -1
- package/dist/core/scene/clipNothing.js +13 -0
- package/dist/core/scene/clipNothing.js.map +1 -0
- package/dist/core/scene/depMemo.js +11 -3
- package/dist/core/scene/depMemo.js.map +1 -1
- package/dist/core/scene/dependents.js +7 -1
- package/dist/core/scene/dependents.js.map +1 -1
- package/dist/core/scene/derivedParts.js +10 -11
- package/dist/core/scene/derivedParts.js.map +1 -1
- package/dist/core/scene/effectivePose.js +7 -2
- package/dist/core/scene/effectivePose.js.map +1 -1
- package/dist/core/scene/fontReads.js +37 -0
- package/dist/core/scene/fontReads.js.map +1 -0
- package/dist/core/scene/inheritedPaint.js +75 -0
- package/dist/core/scene/inheritedPaint.js.map +1 -0
- package/dist/core/scene/kitRegistry.js +5 -0
- package/dist/core/scene/kitRegistry.js.map +1 -1
- package/dist/core/scene/nodeMemo.js +15 -7
- package/dist/core/scene/nodeMemo.js.map +1 -1
- package/dist/core/scene/pathEffects/blend.js.map +1 -1
- package/dist/core/scene/pathEffects/derive.js +7 -2
- package/dist/core/scene/pathEffects/derive.js.map +1 -1
- package/dist/core/scene/pathEffects/effects.js +3 -1
- package/dist/core/scene/pathEffects/effects.js.map +1 -1
- package/dist/core/scene/pathEffects/textAlong.js +95 -0
- package/dist/core/scene/pathEffects/textAlong.js.map +1 -0
- package/dist/{cornerHandles-BHuoMs1o.d.ts → cornerHandles-p8fDIAKt.d.ts} +2 -1
- package/dist/{depSchema-BpZNOv7q.d.ts → depSchema-mG19aEdD.d.ts} +61 -13
- package/dist/devtools/registry.js +4 -4
- package/dist/devtools/registry.js.map +1 -1
- package/dist/features/measure/measureContribution.js +4 -2
- package/dist/features/measure/measureContribution.js.map +1 -1
- package/dist/features/modes/modeTriggers.js +7 -3
- package/dist/features/modes/modeTriggers.js.map +1 -1
- package/dist/features/pathEffects/effectSources.js +60 -0
- package/dist/features/pathEffects/effectSources.js.map +1 -0
- package/dist/features/pathEffects/readSource.js +17 -1
- package/dist/features/pathEffects/readSource.js.map +1 -1
- package/dist/features/pathEffects/textItems.js +53 -0
- package/dist/features/pathEffects/textItems.js.map +1 -0
- package/dist/features/pathEffects/useEffectSourcesLayer.js +57 -0
- package/dist/features/pathEffects/useEffectSourcesLayer.js.map +1 -0
- package/dist/features/paths/pathEditState.js +5 -2
- package/dist/features/paths/pathEditState.js.map +1 -1
- package/dist/features/text/sceneTextDrafts.js +65 -0
- package/dist/features/text/sceneTextDrafts.js.map +1 -0
- package/dist/features/text/textHitAt.js +31 -2
- package/dist/features/text/textHitAt.js.map +1 -1
- package/dist/features/text/useSceneTextEdit.js +22 -18
- package/dist/features/text/useSceneTextEdit.js.map +1 -1
- package/dist/features/viewports/aim.js +105 -0
- package/dist/features/viewports/aim.js.map +1 -0
- package/dist/features/viewports/viewMarker.js +82 -0
- package/dist/features/viewports/viewMarker.js.map +1 -0
- package/dist/features/viewports/viewMarkerDrag.js +55 -0
- package/dist/features/viewports/viewMarkerDrag.js.map +1 -0
- package/dist/index.d.ts +500 -201
- package/dist/index.js +23 -12
- package/dist/interactions/actions/booleans/booleans.js +2 -1
- package/dist/interactions/actions/booleans/booleans.js.map +1 -1
- package/dist/interactions/actions/booleans/operands.js +6 -5
- package/dist/interactions/actions/booleans/operands.js.map +1 -1
- package/dist/interactions/actions/clipboard/action.js +27 -17
- package/dist/interactions/actions/clipboard/action.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorEditing.js +44 -23
- package/dist/interactions/actions/defaults/anchorEditing.js.map +1 -1
- package/dist/interactions/actions/defaults/anchorJoin.js +12 -6
- package/dist/interactions/actions/defaults/anchorJoin.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +7 -4
- package/dist/interactions/actions/defaults/bendSegment.js.map +1 -1
- package/dist/interactions/actions/defaults/cancelGesture.js +11 -8
- package/dist/interactions/actions/defaults/cancelGesture.js.map +1 -1
- package/dist/interactions/actions/defaults/contextMenu.js +17 -8
- package/dist/interactions/actions/defaults/contextMenu.js.map +1 -1
- package/dist/interactions/actions/defaults/createPaintAction.js +1 -1
- package/dist/interactions/actions/defaults/createPaintAction.js.map +1 -1
- package/dist/interactions/actions/defaults/delete.js +28 -14
- package/dist/interactions/actions/defaults/delete.js.map +1 -1
- package/dist/interactions/actions/defaults/duplicate.js +11 -8
- package/dist/interactions/actions/defaults/duplicate.js.map +1 -1
- package/dist/interactions/actions/defaults/enterPathEdit.js +19 -9
- package/dist/interactions/actions/defaults/enterPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/escape.js +11 -8
- package/dist/interactions/actions/defaults/escape.js.map +1 -1
- package/dist/interactions/actions/defaults/exitPathEdit.js +7 -4
- package/dist/interactions/actions/defaults/exitPathEdit.js.map +1 -1
- package/dist/interactions/actions/defaults/group.js +19 -13
- package/dist/interactions/actions/defaults/group.js.map +1 -1
- package/dist/interactions/actions/defaults/ingest.js +10 -4
- package/dist/interactions/actions/defaults/ingest.js.map +1 -1
- package/dist/interactions/actions/defaults/insertPathAnchor.js +7 -4
- package/dist/interactions/actions/defaults/insertPathAnchor.js.map +1 -1
- package/dist/interactions/actions/defaults/nudge.js +8 -2
- package/dist/interactions/actions/defaults/nudge.js.map +1 -1
- package/dist/interactions/actions/defaults/pathEditTools.js +11 -8
- package/dist/interactions/actions/defaults/pathEditTools.js.map +1 -1
- package/dist/interactions/actions/defaults/pinchZoom.js +7 -4
- package/dist/interactions/actions/defaults/pinchZoom.js.map +1 -1
- package/dist/interactions/actions/defaults/reorder.js +24 -6
- package/dist/interactions/actions/defaults/reorder.js.map +1 -1
- package/dist/interactions/actions/defaults/selectAll.js +8 -5
- package/dist/interactions/actions/defaults/selectAll.js.map +1 -1
- package/dist/interactions/actions/defaults/setFill.js +7 -3
- package/dist/interactions/actions/defaults/setFill.js.map +1 -1
- package/dist/interactions/actions/defaults/setFillOpacity.js +1 -1
- package/dist/interactions/actions/defaults/setStroke.js +12 -11
- package/dist/interactions/actions/defaults/setStroke.js.map +1 -1
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +1 -1
- package/dist/interactions/actions/defaults/toolActivate.js +7 -1
- package/dist/interactions/actions/defaults/toolActivate.js.map +1 -1
- package/dist/interactions/actions/defaults/toolResetToDefault.js +7 -4
- package/dist/interactions/actions/defaults/toolResetToDefault.js.map +1 -1
- package/dist/interactions/actions/defaults/undoRedo.js +19 -13
- package/dist/interactions/actions/defaults/undoRedo.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportWheelPan.js +16 -7
- package/dist/interactions/actions/defaults/viewportWheelPan.js.map +1 -1
- package/dist/interactions/actions/defaults/viewportZoom.js +24 -6
- package/dist/interactions/actions/defaults/viewportZoom.js.map +1 -1
- package/dist/interactions/actions/edit-anchors/action.js +7 -4
- package/dist/interactions/actions/edit-anchors/action.js.map +1 -1
- package/dist/interactions/actions/flip/action.js +8 -2
- package/dist/interactions/actions/flip/action.js.map +1 -1
- package/dist/interactions/actions/insert/repositionAction.js +2 -1
- package/dist/interactions/actions/insert/repositionAction.js.map +1 -1
- package/dist/interactions/actions/move/action.js +7 -4
- package/dist/interactions/actions/move/action.js.map +1 -1
- package/dist/interactions/actions/outlines/createOutlinesAction.js +8 -5
- package/dist/interactions/actions/outlines/createOutlinesAction.js.map +1 -1
- package/dist/interactions/actions/outlines/outlineStroke.js +5 -3
- package/dist/interactions/actions/outlines/outlineStroke.js.map +1 -1
- package/dist/interactions/actions/pathCommands/cutJoin.js +8 -5
- package/dist/interactions/actions/pathCommands/cutJoin.js.map +1 -1
- package/dist/interactions/actions/resize/cornerHandles.js +2 -1
- package/dist/interactions/actions/resize/cornerHandles.js.map +1 -1
- package/dist/interactions/actions/selectionSubtree.js +12 -7
- package/dist/interactions/actions/selectionSubtree.js.map +1 -1
- package/dist/interactions/actions/transform-again/action.js +8 -5
- package/dist/interactions/actions/transform-again/action.js.map +1 -1
- package/dist/json.d.ts +4 -0
- package/dist/json.js +3 -0
- package/dist/kitSettingsSchema.js +8 -1
- package/dist/kitSettingsSchema.js.map +1 -1
- package/dist/{math-CrJULaZI.d.ts → math-B56zxVs5.d.ts} +10 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -1
- package/dist/resize.d.ts +1 -1
- 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/eyedropper/useEyedropperTool.js +2 -1
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js.map +1 -1
- package/dist/tools/builtin/hand/dragPanContribution.js +4 -1
- package/dist/tools/builtin/hand/dragPanContribution.js.map +1 -1
- package/dist/tools/builtin/hand/useHandTool.js +7 -4
- package/dist/tools/builtin/hand/useHandTool.js.map +1 -1
- package/dist/tools/builtin/image/useImageTool.js +1 -0
- package/dist/tools/builtin/image/useImageTool.js.map +1 -1
- package/dist/tools/builtin/lasso/useLassoTool.js +1 -0
- 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/measure/useMeasureTool.js +12 -5
- package/dist/tools/builtin/measure/useMeasureTool.js.map +1 -1
- package/dist/tools/builtin/pen/usePenTool.js +14 -6
- 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 -4
- package/dist/tools/builtin/polygon/usePolygonTool.js.map +1 -1
- package/dist/tools/builtin/rect/useRectTool.js +1 -0
- package/dist/tools/builtin/rect/useRectTool.js.map +1 -1
- package/dist/tools/builtin/select/adapterPointQuery.js +3 -2
- package/dist/tools/builtin/select/adapterPointQuery.js.map +1 -1
- package/dist/tools/builtin/select/pressDecision.js +32 -0
- package/dist/tools/builtin/select/pressDecision.js.map +1 -0
- package/dist/tools/builtin/select/selectionContributions.js +22 -13
- package/dist/tools/builtin/select/selectionContributions.js.map +1 -1
- package/dist/tools/builtin/select/useSelectTool.js +13 -10
- package/dist/tools/builtin/select/useSelectTool.js.map +1 -1
- package/dist/tools/builtin/slice/useSliceTool.js +22 -8
- package/dist/tools/builtin/slice/useSliceTool.js.map +1 -1
- package/dist/tools/builtin/star/useStarTool.js +13 -4
- package/dist/tools/builtin/star/useStarTool.js.map +1 -1
- package/dist/tools/builtin/sticky/stickyNode.js +4 -1
- package/dist/tools/builtin/sticky/stickyNode.js.map +1 -1
- package/dist/tools/builtin/sticky/useStickyTool.js +10 -5
- package/dist/tools/builtin/sticky/useStickyTool.js.map +1 -1
- package/dist/tools/builtin/text/useTextTool.js +3 -1
- package/dist/tools/builtin/text/useTextTool.js.map +1 -1
- package/dist/util/paint.js +1 -3
- package/dist/util/paint.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,189 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 13e597d: Text can follow a path. `@weasel-js/geom` adds a `'path'` track shape (`pathShape`), a `side` override on `trackRun`,
|
|
8
|
+
and `placeAlongRun`, which turns item lengths into places along a run, in `RunOrder` `'reading'` or `'track'`.
|
|
9
|
+
`TrackShape` gains a required `closed` member, so a shape implemented outside geom has to add it.
|
|
10
|
+
`runPlaces` and `runLength` moved there from `@weasel-js/ui`, which re-exports `runPlaces` by name, so its curved rows
|
|
11
|
+
come from geom's placement. `measurePath` takes `keepCorners`. `@weasel-js/text` adds `textClusters`, a line's
|
|
12
|
+
grapheme clusters as outlines with their advances. `@weasel-js/core` adds the `textAlong` path effect; every effect
|
|
13
|
+
takes `hideSources`, effect sources can carry a list of items, curved text is derived again when a font loads, a
|
|
14
|
+
hidden source is edited through its effect, and Delete, Cut and Expand now remove an effect's hidden sources with
|
|
15
|
+
it. A committed in-place text edit is labeled "Edit text" in history.
|
|
16
|
+
`@weasel-js/path-tools` adds Text Along Path (Alt+Shift+X), Release and Set Path. `useTextEdit` in
|
|
17
|
+
`@weasel-js/text-dom` gains `onDraft`.
|
|
18
|
+
|
|
19
|
+
<!-- bump-approved: minor: maintainer — 1.12.0 release requested 2026-10-22 -->
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 0996ce6: `captureGesture` captures the next click, double click, drag, right click or keystroke as a gesture
|
|
24
|
+
spec, for a binding editor that rebinds pointer input as well as keys. It tells a click from a drag
|
|
25
|
+
with the dispatcher's own recognizer and drag threshold, writes the platform's primary modifier as
|
|
26
|
+
`mod`, and takes every event of what it captures from the page; Escape or an abort resolves `null`.
|
|
27
|
+
`captureKey` is now `captureGesture` limited to a keystroke.
|
|
28
|
+
- 3716e73: The dev-time route-conflict check and devtools' registry listing now read contribution bindings under
|
|
29
|
+
their binding overrides, as dispatch does: a binding rebound onto a taken key is reported, and an
|
|
30
|
+
unbound one is no longer listed or reported. The conflict check runs again when the overrides change.
|
|
31
|
+
`overriddenBindings` returns a binding list under the overrides in force, and `findScopedConflicts`
|
|
32
|
+
takes them as `overrides`.
|
|
33
|
+
- b571ad6: A node's `fill: 'inherit'` or `stroke: 'inherit'` now takes its nearest enclosing container's fill or stroke whole. If that container inherits too, the lookup keeps going up, and at the root it is none. A container's fill and stroke are only a source: the built-in `kit:shape` and `kit:path` painters no longer paint a container's own fill or stroke, and its interior is no longer hit for picking.
|
|
34
|
+
|
|
35
|
+
The scene's draw wrapper passes the resolved paint to painters as `ctx.inherited` on `NodePaintCtx`, and pickers pass it on `NodeInkCtx`. A painter's memo has to key on it: `nodeMemo` takes an extra reference-compared key for this, and the paint stays the same object while its sources are unchanged. **A custom painter that does not read `ctx.inherited` paints an `'inherit'` field as none.** Pass the field and `ctx?.inherited?.fill` to `resolveFill` (or `resolveStroke`) to pick it up. `diagram:shape` reads it. Readers outside a painter can use `inheritedPaintIn(scene, node)` and `withInheritedPaint(data, inherited)`, and `paintAbove(scene, node)` says what inheriting would paint.
|
|
36
|
+
|
|
37
|
+
SVG import turns a `<g>`'s fill and stroke into its container's, and a child that sets none of them gets `'inherit'`. A gradient, or a child faded further than its group, is still copied onto the child. Export writes a container's paint on its `<g>` and leaves the attribute off a child that inherits a solid one.
|
|
38
|
+
|
|
39
|
+
`SelectionPanel` adds an Inherit choice beside None for a node's fill and stroke, showing the paint it would take. `PaintField` and `PaintInput` offer it when given `inherit` (`{ paint, onInherit }`); their `value` may be `'inherit'`, and `onChange` is unchanged.
|
|
40
|
+
- 1cc3d07: Pressing a node inside a selected group no longer selects that node on the press. A drag that starts
|
|
41
|
+
there moves the group, and a click that ends without a drag selects the node, as a press on one member
|
|
42
|
+
of a multi-selection already did. It used to select the member on the press, so the drag moved the
|
|
43
|
+
member alone and left the rest of the group behind.
|
|
44
|
+
|
|
45
|
+
A group here is a container whose pose derives from its children (`dependsOn: 'children'` with a
|
|
46
|
+
`derivePose`), which is what the `group` action makes in a scene that composes poses by identity. A
|
|
47
|
+
selected container with a pose of its own, such as a diagram container, still lets a press pick the
|
|
48
|
+
member out of it.
|
|
49
|
+
- 78f29de: Lenses in weaselforge. Alt+L opens the Loupe keymap, and `l` adds a lens: a bubble showing the patch
|
|
50
|
+
of a story under its reticle, magnified, or rendered with a comparison such as the opposite mode, an
|
|
51
|
+
arg or a DPR, as Swap, Split or Difference. A lens shows a Live second render or, from the dev
|
|
52
|
+
server, Pixels captured in headless Chromium; Playwright is a new optional peer of
|
|
53
|
+
`@weasel-js/forge`, and without it a lens offers Live only. Token, Contrast and pixel-grid readouts
|
|
54
|
+
sit in the lens chrome, and Alt+Slash opens a panel listing every key binding the workshop
|
|
55
|
+
registers.
|
|
56
|
+
|
|
57
|
+
Everything below is additive.
|
|
58
|
+
|
|
59
|
+
forge: the shell config takes `capture.allowOrigins`, naming what a capture page may load besides
|
|
60
|
+
the dev server, and `loupe.modeGlobal`, the global an opposite-mode comparison flips. A global
|
|
61
|
+
declaration may give `opposite(value, globals)`, the value that comparison flips it to.
|
|
62
|
+
`<TrialHost>` takes a `copy` prop, which makes the host a second copy of a trial's story, under
|
|
63
|
+
globals of its own. `@weasel-js/forge/shell` exports `followEdits`, and `@weasel-js/forge/frame`
|
|
64
|
+
exports `mountCapture`, which mounts a capture page.
|
|
65
|
+
|
|
66
|
+
labkit: the loupe entry gains `<LensOverlay>` (whose `renderReadouts` is handed `LensReadoutProps`),
|
|
67
|
+
`<LensActions>`, the lens scene and its ops, the `LensSource` contract, `createLoupeKeymap`,
|
|
68
|
+
`probeUnderLens` and `LENS_REST_MS`. A lab has an `overlay` chrome region, rendered over the trials
|
|
69
|
+
inside the lab surface, and `useLabEntries` reads the ambient entries installed on the lab, its
|
|
70
|
+
keymaps among them. Each lab surface gains a `'top'` canvas layer for one tenant above `'over'`,
|
|
71
|
+
made only while a tenant asks for it; a surface owner offers it by publishing `top` and `claimTop`
|
|
72
|
+
in its `SurfaceCanvases`. `surface.scope()` takes a list of elements as well as one
|
|
73
|
+
(`SurfaceScope`).
|
|
74
|
+
|
|
75
|
+
Elsewhere: `@weasel-js/core/json` exports `stableStringify` for Node; paint exports `contrastRatio`
|
|
76
|
+
and `wcagLevels`; svg exports `specificity`, `compareSpecificity` and `splitTopLevel`; an action's
|
|
77
|
+
`enabled` may return a reason as text (`ActionUnavailable` in routing, re-exported by core), which
|
|
78
|
+
the command palette shows as written.
|
|
79
|
+
- 92a0f2d: A keymap's leader triggered without a key can now hold its keymap open:
|
|
80
|
+
`trigger('keymap.<id>', { hold: true })` keeps it open through any number of
|
|
81
|
+
inputs until Escape, where a plain `trigger` still opens it for one input.
|
|
82
|
+
`KEYMAP_HOLD` is the `heldBy` such a level reports.
|
|
83
|
+
- c697535: Every binding the kit ships now declares an id, so a binding override names it by that id rather
|
|
84
|
+
than by its owner and position: `undo.key`, `rect.drag`, `nudge.left.big`, `selection.rotate.handle`,
|
|
85
|
+
`tool.activate.rect`. The scheme is `<owner>.<role>`, the owner being the action for an action's own
|
|
86
|
+
binding and the tool or entry for a contribution's (`docs/taxonomy.md`, "binding override"). An
|
|
87
|
+
override written against a positional id such as `select#3` no longer reaches its binding.
|
|
88
|
+
|
|
89
|
+
An action's `defaultBinding` that was a bare spec is now a one-entry `{ spec, opts: { id } }` array;
|
|
90
|
+
code reading `defaultBinding` as a spec reads it through `actionBindings`.
|
|
91
|
+
- c2fb65c: Keymaps behind a leader key. `keymapContribution` builds a keymap, whose bindings are live only while
|
|
92
|
+
it is open, and the leader that opens it: tap the leader for one input, or hold it to keep the keymap
|
|
93
|
+
open. Escape always closes it; a key it does not bind is ignored, or passed on under the new
|
|
94
|
+
`gestures.keymapUnbound` kit setting. `<KeymapHint>` lists an open keymap's keys, and `formatShortcut`
|
|
95
|
+
draws a key inside one as `Loupe ▸ 2`.
|
|
96
|
+
|
|
97
|
+
Bindings can now be rebound or removed by id, on actions and contributions alike:
|
|
98
|
+
`ActionsRegistry.overrideBindings` and `<SceneCanvas bindingOverrides>`, written as route strings or
|
|
99
|
+
with the new `key()`, `held()` and `unbound()` helpers. `captureKey` reads the next keystroke for a
|
|
100
|
+
binding editor.
|
|
101
|
+
|
|
102
|
+
`modeShortcutSpec` now reads through `key()`, so a mode shortcut written `'Space'` or `'Esc'` names
|
|
103
|
+
the key it says; before, either matched nothing.
|
|
104
|
+
|
|
105
|
+
Additive: `ActionsRegistry` gains `overrideBindings` and `bindingOverrides`, so a hand-written
|
|
106
|
+
registry must implement them.
|
|
107
|
+
- 24f2495: An absent fill or stroke now means none everywhere, read through `resolveFill` and `resolveStroke`. This breaks three things that used to fill in a default:
|
|
108
|
+
|
|
109
|
+
- **A text node built without a `fill` now draws no glyphs.** Write `fill: { paint: solid('#000') }`, or `DEFAULT_TEXT_FILL`, now exported from `@weasel-js/text` and `@weasel-js/core`. `DEFAULT_TEXT_STYLE.fill` is `null`. The text insert, the sticky note and SVG import write black themselves.
|
|
110
|
+
- **A derived part with no `fill` or `stroke` no longer takes its node's.** Write `INHERIT` (`'inherit'`) for that; `DerivedPart` allows it, and `resolvePartPaint` is the one reading of a part's paint.
|
|
111
|
+
- **`diagramShape` drops its `defaultFill` and `defaultStroke` options.** An outline paints what its data names; `diagramScene` already writes the default style onto every node. SVG import writes SVG's initial black onto text that names no fill, and SVG export writes `fill="none"` for text that has none.
|
|
112
|
+
|
|
113
|
+
`setFill` and `setStroke` write None as a record with no `paint` rather than `null`, so a stroke keeps its width and dash; a `paint: null` passed when the gesture starts used to be read as no paint given and painted the default color. The selection panel shows a fill or stroke paint as a paint, None or Mixed, never unset; `nestedPaintValue` is that reading. Booleans, Outline Stroke and the character bar read a fill with no paint as unfilled. Core re-exports `resolveFill`, `resolveStroke`, `INHERIT` and their types.
|
|
114
|
+
- d9fd036: `@weasel-js/pdf` rasterizes a group with effects over the group's bounds grown by how far its effects reach, rather than over the whole page, so a small blurred badge no longer costs a full-page bitmap. An `Effect` can now say how far it reaches with the new optional `reach`, in device pixels; `blur` sets it, and `effectsReach` (`@weasel-js/renderer`) adds up a stack's. An effect without one, such as `vignette`, still covers the whole page. The renderer's retained surfaces use the same bound, and `commandsBounds` takes the scale the commands will be drawn at.
|
|
115
|
+
|
|
116
|
+
`screen`-unit paint inside a rasterized group now lands in the PDF where the vector path puts it, in page points rather than raster pixels. `WeaselRenderer.render` takes `screen` in its options, naming what screen space is when it is not the drawing surface, and `renderSceneToPixels` and a raster session's `render` pass it through as `screen`.
|
|
117
|
+
- f461572: `DiagramView` now draws a node's perimeter port labels. A node's `portLabels` are children of its
|
|
118
|
+
container and sit outside its box, and a container clips its children to its painter's
|
|
119
|
+
silhouette, so every one of them was clipped away. `buildBody` now gives the container a `clipFromPose` that clips nothing.
|
|
120
|
+
|
|
121
|
+
Core exports that clip as `clipNothing` (from `@weasel-js/core` and `@weasel-js/core/math`),
|
|
122
|
+
for any container whose children may draw outside it. Every scene's registry carries it under
|
|
123
|
+
`CLIP_NOTHING`, so a container using it saves and loads with no registry entry of the consumer's.
|
|
124
|
+
A symmetry group now uses it too, and still saves under `SYMMETRY_CLIP_KEY`.
|
|
125
|
+
- 3bf5edb: Add `resolveFill` and `resolveStroke`, the one answer to what a fill or stroke field paints: absent, `null` and a record with no `paint` are none, a paint with alpha 0 is still a paint, and `INHERIT` (`'inherit'`) takes whatever the caller passes as inherited. `fillHasInk` and `strokeHasInk` now go through them, so `fillHasInk({ paint: null })` is `false` where it used to be `true`.
|
|
126
|
+
- 92b8df8: A node with no `data.fill` now paints no fill. It used to paint gray (`#888`) in the built-in
|
|
127
|
+
painters and in `svgLeafFromKit`'s export, so a container from Cmd+G drew a gray box behind its
|
|
128
|
+
members, and a shape inserted without a fill showed up gray. This changes what existing scenes look
|
|
129
|
+
like: a node that relied on the gray default needs an explicit `fill`. `DEFAULT_SHAPE_FILL` is
|
|
130
|
+
removed, since nothing falls back to it any more, and `resolveNodeFill` takes no fallback argument.
|
|
131
|
+
|
|
132
|
+
The rect fallback painter no longer matches containers. A container without `clipFromPose` used to
|
|
133
|
+
take that painter's box as its silhouette and clip its members to it, which cut off the outer half of
|
|
134
|
+
their strokes, since a group's derived pose leaves stroke width out. A container now paints
|
|
135
|
+
nothing, even a `data.fill` it declares, and clips nothing; one that should clip says so with
|
|
136
|
+
`clipFromPose`, and a background behind a group's members is a leaf among them.
|
|
137
|
+
- 91a1d84: `useVisibleRaf`, `defaultStorage` and the deprecated `cornerPoint` now carry a description, which
|
|
138
|
+
editors show on hover and the package pages show beside the name.
|
|
139
|
+
- eec50d7: Views answer what they show: `SceneCanvasApi.aimOf` and `setAim`, and `<CanvasView aim onAimChange>` for a view that holds its aim and derives its camera from it. `<ViewMarker>`, or a contribution's `markers`, draws one view's aim inside another's frame, and dragging the marker moves that view; `actions={null}` turns marker dragging off. kernel3d answers a frustum aim with `aimOf3d`.
|
|
140
|
+
|
|
141
|
+
`CanvasViewProps` is now a union: `aim` cannot be passed together with `view`, `defaultView`, `onViewChange` or `viewBounds`. Code that writes an interface extending `CanvasViewProps` needs a type alias instead. A `Partial<CanvasViewProps>` spread into `<CanvasView>` no longer type-checks, and `Omit<CanvasViewProps, …>` does not distribute over the union; type either over one of the named halves, `CanvasViewCommonProps` with `CameraHeldViewProps` or `AimHeldViewProps`.
|
|
142
|
+
|
|
143
|
+
`SceneCanvasApi` has two new required members, `aimOf` and `setAim`, so a hand-written fake of it needs both.
|
|
144
|
+
- Updated dependencies [dbd6711]
|
|
145
|
+
- Updated dependencies [f6db995]
|
|
146
|
+
- Updated dependencies [0996ce6]
|
|
147
|
+
- Updated dependencies [3716e73]
|
|
148
|
+
- Updated dependencies [b571ad6]
|
|
149
|
+
- Updated dependencies [13e597d]
|
|
150
|
+
- Updated dependencies [400b393]
|
|
151
|
+
- Updated dependencies [40d87f7]
|
|
152
|
+
- Updated dependencies [78f29de]
|
|
153
|
+
- Updated dependencies [2cf7da4]
|
|
154
|
+
- Updated dependencies [92a0f2d]
|
|
155
|
+
- Updated dependencies [448065a]
|
|
156
|
+
- Updated dependencies [c697535]
|
|
157
|
+
- Updated dependencies [c2fb65c]
|
|
158
|
+
- Updated dependencies [2c52cc5]
|
|
159
|
+
- Updated dependencies [94ebd35]
|
|
160
|
+
- Updated dependencies [24f2495]
|
|
161
|
+
- Updated dependencies [929736f]
|
|
162
|
+
- Updated dependencies [d9fd036]
|
|
163
|
+
- Updated dependencies [3bf5edb]
|
|
164
|
+
- Updated dependencies [e9304f4]
|
|
165
|
+
- Updated dependencies [91a1d84]
|
|
166
|
+
- @weasel-js/geom@1.12.0
|
|
167
|
+
- @weasel-js/routing@1.12.0
|
|
168
|
+
- @weasel-js/paint@1.12.0
|
|
169
|
+
- @weasel-js/text@1.12.0
|
|
170
|
+
- @weasel-js/text-dom@1.12.0
|
|
171
|
+
- @weasel-js/stroke@1.12.0
|
|
172
|
+
- @weasel-js/gestures@1.12.0
|
|
173
|
+
- @weasel-js/renderer@1.12.0
|
|
174
|
+
- @weasel-js/react@1.12.0
|
|
175
|
+
- @weasel-js/animator@1.12.0
|
|
176
|
+
- @weasel-js/prefs@1.12.0
|
|
177
|
+
- @weasel-js/simulation@1.12.0
|
|
178
|
+
- @weasel-js/cursor@1.12.0
|
|
179
|
+
- @weasel-js/font@1.12.0
|
|
180
|
+
- @weasel-js/history@1.12.0
|
|
181
|
+
- @weasel-js/icons@1.12.0
|
|
182
|
+
- @weasel-js/modes@1.12.0
|
|
183
|
+
- @weasel-js/quantity@1.12.0
|
|
184
|
+
- @weasel-js/registry@1.12.0
|
|
185
|
+
- @weasel-js/select@1.12.0
|
|
186
|
+
|
|
3
187
|
## 1.11.1
|
|
4
188
|
|
|
5
189
|
### Patch Changes
|
package/dist/WeaselProvider.js
CHANGED
|
@@ -2,8 +2,8 @@ import { PointerProviderIfRoot } from "./canvas/SceneCanvas/PointerProviderIfRoo
|
|
|
2
2
|
import { ActionsProviderIfRoot } from "./canvas/SceneCanvas/ActionsProviderIfRoot.js";
|
|
3
3
|
import { DepRegistryProviderIfRoot } from "./canvas/SceneCanvas/DepRegistryProviderIfRoot.js";
|
|
4
4
|
import { IconRegistryScope } from "./iconRegistry/IconRegistryProvider.js";
|
|
5
|
-
import { ActionsProvider, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, DepRegistryProvider, PointerContextProvider, SelectionContextProvider, SelectionContextProviderIfRoot } from "@weasel-js/routing/react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ActionsProvider, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, DepRegistryProvider, PointerContextProvider, SelectionContextProvider, SelectionContextProviderIfRoot } from "@weasel-js/routing/react";
|
|
7
7
|
|
|
8
8
|
//#region src/WeaselProvider.tsx
|
|
9
9
|
/**
|
|
@@ -21,12 +21,12 @@ var PATH_ANCHOR_CHROME_ID = "path-edit.anchors";
|
|
|
21
21
|
*/
|
|
22
22
|
function createPathAnchorAffordances(getAnchorState, opts = {}) {
|
|
23
23
|
const { hitRadius = 8, cursor = "pointer" } = opts;
|
|
24
|
-
/** Selected polygon paths, paired with their node id. */
|
|
24
|
+
/** Selected polygon paths, and the one being edited, paired with their node id. */
|
|
25
25
|
const editablePaths = (state) => {
|
|
26
26
|
const anchorState = getAnchorState();
|
|
27
27
|
if (!anchorState) return [];
|
|
28
28
|
const out = [];
|
|
29
|
-
for (const id of state.selection) {
|
|
29
|
+
for (const id of withEdited(state.selection, anchorState.editingId)) {
|
|
30
30
|
const pose = anchorState.getPose(id);
|
|
31
31
|
if (!pose || pose.kind !== "polygon") continue;
|
|
32
32
|
out.push({
|
|
@@ -119,17 +119,16 @@ function createPathAnchorAffordances(getAnchorState, opts = {}) {
|
|
|
119
119
|
controls
|
|
120
120
|
];
|
|
121
121
|
}
|
|
122
|
-
/** The parts path-edit extensions add to the path in edit mode
|
|
123
|
-
*
|
|
122
|
+
/** The parts path-edit extensions add to the path in edit mode, each pressed
|
|
123
|
+
* as its own `hitKind`. */
|
|
124
124
|
function extensionParts(getAnchorState, hitRadius, cursor) {
|
|
125
125
|
return {
|
|
126
126
|
id: PATH_ANCHOR_CHROME_ID,
|
|
127
|
-
regions(
|
|
127
|
+
regions() {
|
|
128
128
|
const anchorState = getAnchorState();
|
|
129
129
|
const editingId = anchorState?.editingId ?? null;
|
|
130
130
|
const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];
|
|
131
131
|
if (editingId === null || extensions.length === 0) return [];
|
|
132
|
-
if (!state.selection.includes(editingId)) return [];
|
|
133
132
|
const pose = anchorState.getPose(editingId);
|
|
134
133
|
const node = anchorState.getNode?.(editingId);
|
|
135
134
|
if (!node || !pose || pose.kind !== "polygon") return [];
|
|
@@ -157,6 +156,11 @@ function extensionParts(getAnchorState, hitRadius, cursor) {
|
|
|
157
156
|
}
|
|
158
157
|
};
|
|
159
158
|
}
|
|
159
|
+
/** `selection`, and the path being edited after it when the selection does not hold it: a path edited through the
|
|
160
|
+
* effect that hides it is edited while the effect is what is selected. */
|
|
161
|
+
function withEdited(selection, editingId) {
|
|
162
|
+
return editingId === null || selection.includes(editingId) ? selection : [...selection, editingId];
|
|
163
|
+
}
|
|
160
164
|
|
|
161
165
|
//#endregion
|
|
162
166
|
export { PATH_ANCHOR_CHROME_ID, createPathAnchorAffordances };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathAnchors.js","names":[],"sources":["../../src/affordances/pathAnchors.ts"],"sourcesContent":["/** Path anchor, control-handle, and segment affordances, and the parts path-edit extensions add. */\n\nimport type { CursorSpec } from '@weasel-js/cursor';\nimport type { Affordance, AffordanceBinding, AffordanceRegion, CommonAffordanceScratch } from './types';\nimport type { ChromeState } from 'core/selection/chromeState';\nimport { pathToAnchors, type AnchorSet, type PolygonPath } from '@weasel-js/geom';\nimport { enumerateAnchors } from 'interactions/actions/edit-anchors/geometry';\nimport type { PathEditExtension } from 'features/paths/pathEditExtension';\n\n/**\n * Live anchor-editing state. The thunk that returns it is called on every\n * pointer event, so it must be cheap (O(1) field reads).\n */\nexport interface AnchorState {\n /** Id of the path currently in anchor-edit mode, or `null`. Control handles\n * are only hittable on the path that is being edited. */\n editingId: string | null;\n /** Current editable path for a node id. Non-polygon values are ignored. */\n getPose(id: string): unknown;\n /** The committed pose and data of a node, which extensions' parts read. */\n getNode?(id: string): { pose: unknown; data: unknown } | null;\n /** The path-edit extensions whose parts are pressed, in order. */\n extensions?: readonly PathEditExtension[];\n /** The active path-edit tool, if any. While one is set, anchors and controls\n * carry no cursor of their own, so the tool's action shows its own. */\n tool?: string | null;\n /** The path whose outline counts as a segment press, when it is not\n * `getPose`'s: a path drawn from a form, edited through the form's edit\n * path. */\n getOutline?(id: string): unknown;\n}\n\n/** Options for the path-anchor affordances. */\nexport interface PathAnchorAffordanceOptions {\n /** Hit radius (screen-px) for anchor and control points. Default 8. */\n hitRadius?: number;\n /** Cursor while hovering an anchor or control, with no path-edit tool\n * active. Defaults to `'pointer'`. */\n cursor?: CursorSpec;\n}\n\n/** What an anchor hit hands to the action that follows. */\nexport interface AnchorScratch extends CommonAffordanceScratch {\n /** Node id of the path the anchor belongs to. */\n targetId: string;\n /** Sequential anchor index in path walk order. */\n anchorIndex: number;\n /** Which of the anchor's three grabbable points this is. */\n part: 'anchor' | 'controlIn' | 'controlOut';\n}\n\n/** Chrome-caps id gating the anchor, control, and segment affordances. */\nexport const PATH_ANCHOR_CHROME_ID = 'path-edit.anchors';\n\n/**\n * Segment, extension-part, anchor, and control affordances for the selected\n * paths, bottom → top.\n *\n * Three affordances rather than one, so that a control handle beats an anchor\n * regardless of which is nearer, the way controls draw on top, and both beat\n * the segment they sit on. Within each, nearest wins. A press on the edited\n * path's outline is a `segment` hit, which the segment bend binds to and a\n * selection move turns down. Anchors, controls, and segments share one id:\n * chrome-caps gates anchor editing as a single piece of chrome. A part a\n * path-edit extension adds (`PathEditExtension.parts`) may name a chrome id of\n * its own as well, so it can be shown apart from the anchors.\n *\n * Order matters — spread this into an affordance list in the returned order.\n */\nexport function createPathAnchorAffordances(\n getAnchorState: () => AnchorState | null,\n opts: PathAnchorAffordanceOptions = {},\n): Affordance[] {\n const { hitRadius = 8, cursor = 'pointer' } = opts;\n\n /** Selected polygon paths, paired with their node id. */\n const editablePaths = (state: ChromeState): Array<{ id: string; path: PolygonPath }> => {\n const anchorState = getAnchorState();\n if (!anchorState) return [];\n const out: Array<{ id: string; path: PolygonPath }> = [];\n for (const id of state.selection) {\n const pose = anchorState.getPose(id);\n if (!pose || (pose as { kind?: string }).kind !== 'polygon') continue;\n out.push({ id, path: pose as PolygonPath });\n }\n return out;\n };\n\n const point = (\n id: string,\n targetId: string,\n x: number,\n y: number,\n scratch: AnchorScratch,\n hitKind: string,\n ): AffordanceRegion => ({\n id,\n // Anchor coordinates are already world space, pose rotation baked in.\n // Anchoring to `null` keeps the framework from applying it twice.\n targetId: null,\n shape: { kind: 'point', x, y, hitRadiusPx: hitRadius },\n hitKind,\n ...(getAnchorState()?.tool ? {} : { cursor }),\n bind: (): AffordanceBinding => ({ initialScratch: { ...scratch, targetId } }),\n });\n\n const anchors: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // `editAnchorsAction` edits whatever path the dep says is in edit\n // mode, ignoring which one was hit — so once a path IS being edited,\n // only its own anchors may claim the press.\n if (editingId !== null && id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n out.push(point(\n `${id}:anchor:${a.anchorIndex}`,\n id, a.x, a.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'anchor' },\n `anchor:${a.anchorIndex}`,\n ));\n }\n }\n return out;\n },\n };\n\n const controls: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n if (editingId === null) return [];\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // Controls are grabbable only on the path actually in edit mode.\n if (id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n if (a.controlIn) {\n out.push(point(\n `${id}:controlIn:${a.anchorIndex}`,\n id, a.controlIn.x, a.controlIn.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlIn' },\n `controlIn:${a.anchorIndex}`,\n ));\n }\n if (a.controlOut) {\n out.push(point(\n `${id}:controlOut:${a.anchorIndex}`,\n id, a.controlOut.x, a.controlOut.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlOut' },\n `controlOut:${a.anchorIndex}`,\n ));\n }\n }\n }\n return out;\n },\n };\n\n const segments: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n if (editingId === null) return [];\n const edited = editablePaths(state).find(({ id }) => id === editingId);\n if (!edited) return [];\n const outline = getAnchorState()?.getOutline?.(editingId) as PolygonPath | null | undefined;\n return [{\n id: `${editingId}:segment`,\n targetId: null,\n shape: { kind: 'outline', path: outline?.kind === 'polygon' ? outline : edited.path, hitRadiusPx: hitRadius },\n hitKind: 'segment',\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n }];\n },\n };\n\n return [segments, extensionParts(getAnchorState, hitRadius, cursor), anchors, controls];\n}\n\n/** The parts path-edit extensions add to the path in edit mode while it is\n * selected, each pressed as its own `hitKind`. */\nfunction extensionParts(\n getAnchorState: () => AnchorState | null,\n hitRadius: number,\n cursor: CursorSpec,\n): Affordance {\n return {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];\n if (editingId === null || extensions.length === 0) return [];\n if (!(state.selection as readonly string[]).includes(editingId)) return [];\n const pose = anchorState!.getPose(editingId);\n const node = anchorState!.getNode?.(editingId);\n if (!node || !pose || (pose as { kind?: string }).kind !== 'polygon') return [];\n const target = {\n id: editingId, node, path: pose as PolygonPath, anchors: pathToAnchors(pose as PolygonPath) as AnchorSet,\n };\n return extensions.flatMap((ext) => ext.parts!(target).map((part): AffordanceRegion => ({\n id: `${editingId}:${part.hitKind}`,\n targetId: null,\n shape: {\n kind: 'point', x: part.x, y: part.y, hitRadiusPx: part.hitRadiusPx ?? hitRadius,\n ...(part.standoff ? { standoff: part.standoff } : {}),\n },\n hitKind: part.hitKind,\n ...(part.chromeId ? { chromeId: part.chromeId } : {}),\n cursor,\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n })));\n },\n };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"pathAnchors.js","names":[],"sources":["../../src/affordances/pathAnchors.ts"],"sourcesContent":["/** Path anchor, control-handle, and segment affordances, and the parts path-edit extensions add. */\n\nimport type { CursorSpec } from '@weasel-js/cursor';\nimport type { Affordance, AffordanceBinding, AffordanceRegion, CommonAffordanceScratch } from './types';\nimport type { ChromeState } from 'core/selection/chromeState';\nimport { pathToAnchors, type AnchorSet, type PolygonPath } from '@weasel-js/geom';\nimport { enumerateAnchors } from 'interactions/actions/edit-anchors/geometry';\nimport type { PathEditExtension } from 'features/paths/pathEditExtension';\n\n/**\n * Live anchor-editing state. The thunk that returns it is called on every\n * pointer event, so it must be cheap (O(1) field reads).\n */\nexport interface AnchorState {\n /** Id of the path currently in anchor-edit mode, or `null`. Control handles\n * are only hittable on the path that is being edited. */\n editingId: string | null;\n /** Current editable path for a node id. Non-polygon values are ignored. */\n getPose(id: string): unknown;\n /** The committed pose and data of a node, which extensions' parts read. */\n getNode?(id: string): { pose: unknown; data: unknown } | null;\n /** The path-edit extensions whose parts are pressed, in order. */\n extensions?: readonly PathEditExtension[];\n /** The active path-edit tool, if any. While one is set, anchors and controls\n * carry no cursor of their own, so the tool's action shows its own. */\n tool?: string | null;\n /** The path whose outline counts as a segment press, when it is not\n * `getPose`'s: a path drawn from a form, edited through the form's edit\n * path. */\n getOutline?(id: string): unknown;\n}\n\n/** Options for the path-anchor affordances. */\nexport interface PathAnchorAffordanceOptions {\n /** Hit radius (screen-px) for anchor and control points. Default 8. */\n hitRadius?: number;\n /** Cursor while hovering an anchor or control, with no path-edit tool\n * active. Defaults to `'pointer'`. */\n cursor?: CursorSpec;\n}\n\n/** What an anchor hit hands to the action that follows. */\nexport interface AnchorScratch extends CommonAffordanceScratch {\n /** Node id of the path the anchor belongs to. */\n targetId: string;\n /** Sequential anchor index in path walk order. */\n anchorIndex: number;\n /** Which of the anchor's three grabbable points this is. */\n part: 'anchor' | 'controlIn' | 'controlOut';\n}\n\n/** Chrome-caps id gating the anchor, control, and segment affordances. */\nexport const PATH_ANCHOR_CHROME_ID = 'path-edit.anchors';\n\n/**\n * Segment, extension-part, anchor, and control affordances for the selected\n * paths, bottom → top.\n *\n * Three affordances rather than one, so that a control handle beats an anchor\n * regardless of which is nearer, the way controls draw on top, and both beat\n * the segment they sit on. Within each, nearest wins. A press on the edited\n * path's outline is a `segment` hit, which the segment bend binds to and a\n * selection move turns down. Anchors, controls, and segments share one id:\n * chrome-caps gates anchor editing as a single piece of chrome. A part a\n * path-edit extension adds (`PathEditExtension.parts`) may name a chrome id of\n * its own as well, so it can be shown apart from the anchors.\n *\n * Order matters — spread this into an affordance list in the returned order.\n */\nexport function createPathAnchorAffordances(\n getAnchorState: () => AnchorState | null,\n opts: PathAnchorAffordanceOptions = {},\n): Affordance[] {\n const { hitRadius = 8, cursor = 'pointer' } = opts;\n\n /** Selected polygon paths, and the one being edited, paired with their node id. */\n const editablePaths = (state: ChromeState): Array<{ id: string; path: PolygonPath }> => {\n const anchorState = getAnchorState();\n if (!anchorState) return [];\n const out: Array<{ id: string; path: PolygonPath }> = [];\n for (const id of withEdited(state.selection, anchorState.editingId)) {\n const pose = anchorState.getPose(id);\n if (!pose || (pose as { kind?: string }).kind !== 'polygon') continue;\n out.push({ id, path: pose as PolygonPath });\n }\n return out;\n };\n\n const point = (\n id: string,\n targetId: string,\n x: number,\n y: number,\n scratch: AnchorScratch,\n hitKind: string,\n ): AffordanceRegion => ({\n id,\n // Anchor coordinates are already world space, pose rotation baked in.\n // Anchoring to `null` keeps the framework from applying it twice.\n targetId: null,\n shape: { kind: 'point', x, y, hitRadiusPx: hitRadius },\n hitKind,\n ...(getAnchorState()?.tool ? {} : { cursor }),\n bind: (): AffordanceBinding => ({ initialScratch: { ...scratch, targetId } }),\n });\n\n const anchors: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // `editAnchorsAction` edits whatever path the dep says is in edit\n // mode, ignoring which one was hit — so once a path IS being edited,\n // only its own anchors may claim the press.\n if (editingId !== null && id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n out.push(point(\n `${id}:anchor:${a.anchorIndex}`,\n id, a.x, a.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'anchor' },\n `anchor:${a.anchorIndex}`,\n ));\n }\n }\n return out;\n },\n };\n\n const controls: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n if (editingId === null) return [];\n const out: AffordanceRegion[] = [];\n for (const { id, path } of editablePaths(state)) {\n // Controls are grabbable only on the path actually in edit mode.\n if (id !== editingId) continue;\n for (const a of enumerateAnchors(path)) {\n if (a.controlIn) {\n out.push(point(\n `${id}:controlIn:${a.anchorIndex}`,\n id, a.controlIn.x, a.controlIn.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlIn' },\n `controlIn:${a.anchorIndex}`,\n ));\n }\n if (a.controlOut) {\n out.push(point(\n `${id}:controlOut:${a.anchorIndex}`,\n id, a.controlOut.x, a.controlOut.y,\n { targetId: id, anchorIndex: a.anchorIndex, part: 'controlOut' },\n `controlOut:${a.anchorIndex}`,\n ));\n }\n }\n }\n return out;\n },\n };\n\n const segments: Affordance = {\n id: PATH_ANCHOR_CHROME_ID,\n regions(state) {\n const editingId = getAnchorState()?.editingId ?? null;\n if (editingId === null) return [];\n const edited = editablePaths(state).find(({ id }) => id === editingId);\n if (!edited) return [];\n const outline = getAnchorState()?.getOutline?.(editingId) as PolygonPath | null | undefined;\n return [{\n id: `${editingId}:segment`,\n targetId: null,\n shape: { kind: 'outline', path: outline?.kind === 'polygon' ? outline : edited.path, hitRadiusPx: hitRadius },\n hitKind: 'segment',\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n }];\n },\n };\n\n return [segments, extensionParts(getAnchorState, hitRadius, cursor), anchors, controls];\n}\n\n/** The parts path-edit extensions add to the path in edit mode, each pressed\n * as its own `hitKind`. */\nfunction extensionParts(\n getAnchorState: () => AnchorState | null,\n hitRadius: number,\n cursor: CursorSpec,\n): Affordance {\n return {\n id: PATH_ANCHOR_CHROME_ID,\n regions() {\n const anchorState = getAnchorState();\n const editingId = anchorState?.editingId ?? null;\n const extensions = anchorState?.extensions?.filter((e) => e.parts) ?? [];\n if (editingId === null || extensions.length === 0) return [];\n const pose = anchorState!.getPose(editingId);\n const node = anchorState!.getNode?.(editingId);\n if (!node || !pose || (pose as { kind?: string }).kind !== 'polygon') return [];\n const target = {\n id: editingId, node, path: pose as PolygonPath, anchors: pathToAnchors(pose as PolygonPath) as AnchorSet,\n };\n return extensions.flatMap((ext) => ext.parts!(target).map((part): AffordanceRegion => ({\n id: `${editingId}:${part.hitKind}`,\n targetId: null,\n shape: {\n kind: 'point', x: part.x, y: part.y, hitRadiusPx: part.hitRadiusPx ?? hitRadius,\n ...(part.standoff ? { standoff: part.standoff } : {}),\n },\n hitKind: part.hitKind,\n ...(part.chromeId ? { chromeId: part.chromeId } : {}),\n cursor,\n bind: (): AffordanceBinding => ({ initialScratch: { targetId: editingId } }),\n })));\n },\n };\n}\n\n/** `selection`, and the path being edited after it when the selection does not hold it: a path edited through the\n * effect that hides it is edited while the effect is what is selected. */\nfunction withEdited(selection: readonly string[], editingId: string | null): readonly string[] {\n return editingId === null || selection.includes(editingId) ? selection : [...selection, editingId];\n}\n"],"mappings":"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"}
|
package/dist/barrel/canvas.js
CHANGED
|
@@ -2,6 +2,8 @@ import { DEFAULT_LAYER_RETAIN } from "../core/layers/retain.js";
|
|
|
2
2
|
import { subscribeToSources } from "../core/layers/redrawSource.js";
|
|
3
3
|
import { depsUnchanged, drawLayers, drawOneLayer, isLayerPainted, isLayerVisible, paintedLayers } from "../core/layers/render.js";
|
|
4
4
|
import { dlog, dwarn, isDebugEnabled } from "../debug/flag.js";
|
|
5
|
+
import { inheritedPaintOf, inheritsPaint, withInheritedPaint } from "../core/scene/inheritedPaint.js";
|
|
6
|
+
import { inheritedPaintIn, paintAbove, withInheritedPaints } from "../canvas/inheritedPaints.js";
|
|
5
7
|
import { OVERLAY_ROLE_STROKES } from "../canvas/overlayRoleStrokes.js";
|
|
6
8
|
import { DEFAULT_INK, findNodeShape, findShapeBounds, findShapeInk, findShapeSilhouette, getNodeShapes, registerNodeShape, shapeCoversPoint } from "../canvas/NodeShape.js";
|
|
7
9
|
import { drawnAABBOf, drawnBoundsOf, findShapeDrawnBounds, inkExtentsOf } from "../canvas/drawnBounds.js";
|
|
@@ -42,4 +44,4 @@ import { modeTriggers } from "../features/modes/modeTriggers.js";
|
|
|
42
44
|
import { createChildrenLayer } from "../core/layers/children.js";
|
|
43
45
|
import { bitmapSrc, getImageBitmap as getImageBitmap$1, imageStatus as imageStatus$1, isVectorImageSrc, releaseImage, retryImage, setImageCacheBudget, subscribeImageReady as subscribeImageReady$1 } from "@weasel-js/renderer";
|
|
44
46
|
|
|
45
|
-
export { CANVAS_CONTEXT_ATTRIBUTES, CursorCoordsHud, DEBUG_FEATURES, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_HANDLE_SIZE, DEFAULT_INK, DEFAULT_LAYER_RETAIN, DevtoolsLabel, LeanSceneCanvas, OVERLAY_ROLE_STROKES, PATH_OVERLAY_ROLES, PickHud, SceneCanvas, WeaselProvider, bitmapSrc, buildDebugOverlayCommands, createChildrenLayer, createDebugOverlayLayer, createDebugSink, createNodeProperties, createNodeRouting, createPathOverlay, defaultDrawOne, defaultNodeProperties, defaultNodeRouting, defaultPaintBounds, depsUnchanged, dlog, drawLayers, drawOneLayer, drawnAABBOf, drawnBoundsOf, drawnBoundsScene, dwarn, findNodeShape, findShapeBounds, findShapeDrawnBounds, findShapeInk, findShapeSilhouette, flattenPreviews, getImageBitmap$1 as getImageBitmap, getNodeShapes, groupNodeRouting, hostAnchorCss, hostAnchorRect, imageStatus$1 as imageStatus, inferredNodeProperties, inferredNodeRouting, inkExtentsOf, insertPreviewExtent, isDebugEnabled, isLayerPainted, isLayerVisible, isOverChildren, isVectorImageSrc, kitTextHandler, minSizeOf, modeDecorationLayer, modeTriggers, openFilePicker, overChildren, paintedLayers, parseDebugFlags, registerContentHandler, registerNodeShape, releaseImage, resolveOverlays, resolvePreviews, retryImage, rotationDegreesUnit, routeKind, sceneToAdapter, setImageCacheBudget, shapeCoversPoint, splitOverChildren, subscribeImageReady$1 as subscribeImageReady, subscribeToSources, useDevtoolsLabel, useHostAnchor, useSceneAdapter, workspaceTintLayer };
|
|
47
|
+
export { CANVAS_CONTEXT_ATTRIBUTES, CursorCoordsHud, DEBUG_FEATURES, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_HANDLE_SIZE, DEFAULT_INK, DEFAULT_LAYER_RETAIN, DevtoolsLabel, LeanSceneCanvas, OVERLAY_ROLE_STROKES, PATH_OVERLAY_ROLES, PickHud, SceneCanvas, WeaselProvider, bitmapSrc, buildDebugOverlayCommands, createChildrenLayer, createDebugOverlayLayer, createDebugSink, createNodeProperties, createNodeRouting, createPathOverlay, defaultDrawOne, defaultNodeProperties, defaultNodeRouting, defaultPaintBounds, depsUnchanged, dlog, drawLayers, drawOneLayer, drawnAABBOf, drawnBoundsOf, drawnBoundsScene, dwarn, findNodeShape, findShapeBounds, findShapeDrawnBounds, findShapeInk, findShapeSilhouette, flattenPreviews, getImageBitmap$1 as getImageBitmap, getNodeShapes, groupNodeRouting, hostAnchorCss, hostAnchorRect, imageStatus$1 as imageStatus, inferredNodeProperties, inferredNodeRouting, inheritedPaintIn, inheritedPaintOf, inheritsPaint, inkExtentsOf, insertPreviewExtent, isDebugEnabled, isLayerPainted, isLayerVisible, isOverChildren, isVectorImageSrc, kitTextHandler, minSizeOf, modeDecorationLayer, modeTriggers, openFilePicker, overChildren, paintAbove, paintedLayers, parseDebugFlags, registerContentHandler, registerNodeShape, releaseImage, resolveOverlays, resolvePreviews, retryImage, rotationDegreesUnit, routeKind, sceneToAdapter, setImageCacheBudget, shapeCoversPoint, splitOverChildren, subscribeImageReady$1 as subscribeImageReady, subscribeToSources, useDevtoolsLabel, useHostAnchor, useSceneAdapter, withInheritedPaint, withInheritedPaints, workspaceTintLayer };
|
package/dist/barrel/paint.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getAlpha01, mergeAlphaFromPrev, toHex8, withAlpha01 } from "../util/color.js";
|
|
2
|
-
import { DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, GHOST_STROKE, cycleFill, paintAlpha, paintWithAlpha, paintWithColor, solid, strokeOf, strokeWith } from "../util/paint.js";
|
|
3
1
|
import { pathPaintOf } from "../canvas/nodeShapes/nodePaint.js";
|
|
4
2
|
import { getPaintKind, listGradientKinds, listPaintKinds, paintKindOf, paintKindRegistry, patternFamily, registerPaintKind, registerPaintKindLoader, seedTile, switchGradientKind } from "../core/paint/paintKinds.js";
|
|
3
|
+
import { getAlpha01, mergeAlphaFromPrev, toHex8, withAlpha01 } from "../util/color.js";
|
|
4
|
+
import { DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, GHOST_STROKE, cycleFill, paintAlpha, paintWithAlpha, paintWithColor, solid, strokeOf, strokeWith } from "../util/paint.js";
|
|
5
5
|
import { asPaint } from "../core/paint/paintKindEntry.js";
|
|
6
6
|
import { useGradientKinds, usePaintKind, usePaintKinds } from "../core/usePaintKinds.js";
|
|
7
7
|
import { commandFill as commandFill$1, commandPaint as commandPaint$1, commandStroke as commandStroke$1, createTilePattern, fillInPoseFrame, fillToBoundsFrame, isPaintKindKnown as isPaintKindKnown$1, resolveFillPattern, resolvePatternSpec, warmPaintKinds as warmPaintKinds$1 } from "@weasel-js/renderer";
|
|
8
|
-
import { STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect as alignedStrokeRect$1, composePatternTransform, contrastLineColor, dashForStrokeStyle as dashForStrokeStyle$1, decomposePatternTransform, gradientForBounds as gradientForBounds$1, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint as isGradientPaint$1, isPatternPaint, isSolidPaint, isTileKind, isTilePaint as isTilePaint$1, lerpFill as lerpFill$1, lerpPaint, lerpStroke as lerpStroke$1, normalizeHex, parseColor, parseColorToRgba255, parseHexBytes, patternPlacementOf, resolveColor, resolveScreenLength as resolveScreenLength$1, rgbaToHex, sampleGradientStops, scaleVertexWidth as scaleVertexWidth$1, strokeDashStyleOf as strokeDashStyleOf$1, tileSpecOf, vertexHalfWidths as vertexHalfWidths$1, vertexWidthFromSides as vertexWidthFromSides$1, widestHalfWidth, withGradientKind as withGradientKind$1 } from "@weasel-js/paint";
|
|
8
|
+
import { INHERIT as INHERIT$1, STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect as alignedStrokeRect$1, composePatternTransform, contrastLineColor, contrastRatio, dashForStrokeStyle as dashForStrokeStyle$1, decomposePatternTransform, gradientForBounds as gradientForBounds$1, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint as isGradientPaint$1, isPatternPaint, isSolidPaint, isTileKind, isTilePaint as isTilePaint$1, lerpFill as lerpFill$1, lerpPaint, lerpStroke as lerpStroke$1, normalizeHex, parseColor, parseColorToRgba255, parseHexBytes, patternPlacementOf, resolveColor, resolveFill as resolveFill$1, resolveScreenLength as resolveScreenLength$1, resolveStroke as resolveStroke$1, rgbaToHex, sampleGradientStops, scaleVertexWidth as scaleVertexWidth$1, strokeDashStyleOf as strokeDashStyleOf$1, tileSpecOf, vertexHalfWidths as vertexHalfWidths$1, vertexWidthFromSides as vertexWidthFromSides$1, wcagLevels, widestHalfWidth, withGradientKind as withGradientKind$1 } from "@weasel-js/paint";
|
|
9
9
|
import { BUILTIN_MARKERS, getMarker, listMarkers as listMarkers$1, markerInset, markerKeyOf, markerRegistry, markerSites, registerMarker, resolveMarkerSize, resolveStrokeWidth as resolveStrokeWidth$1, strokeInsets as strokeInsets$1 } from "@weasel-js/stroke";
|
|
10
10
|
import { trimPolyline } from "@weasel-js/geom/tessellate";
|
|
11
11
|
|
|
12
|
-
export { BUILTIN_MARKERS, DEFAULT_FILL_COLOR, DEFAULT_PALETTE,
|
|
12
|
+
export { BUILTIN_MARKERS, DEFAULT_FILL_COLOR, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, GHOST_STROKE, INHERIT$1 as INHERIT, STROKE_DASH_RATIOS, TILE_KINDS, alignedStrokeRect$1 as alignedStrokeRect, asPaint, commandFill$1 as commandFill, commandPaint$1 as commandPaint, commandStroke$1 as commandStroke, composePatternTransform, contrastLineColor, contrastRatio, createTilePattern, cycleFill, dashForStrokeStyle$1 as dashForStrokeStyle, decomposePatternTransform, fillInPoseFrame, fillToBoundsFrame, getAlpha01, getMarker, getPaintKind, gradientForBounds$1 as gradientForBounds, gradientGeometry, hexToRgbBytes, hexToRgba, isGradientPaint$1 as isGradientPaint, isPaintKindKnown$1 as isPaintKindKnown, isPatternPaint, isSolidPaint, isTileKind, isTilePaint$1 as isTilePaint, lerpFill$1 as lerpFill, lerpPaint, lerpStroke$1 as lerpStroke, listGradientKinds, listMarkers$1 as listMarkers, listPaintKinds, markerInset, markerKeyOf, markerRegistry, markerSites, mergeAlphaFromPrev, normalizeHex, paintAlpha, paintKindOf, paintKindRegistry, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseHexBytes, pathPaintOf, patternFamily, patternPlacementOf, registerMarker, registerPaintKind, registerPaintKindLoader, resolveColor, resolveFill$1 as resolveFill, resolveFillPattern, resolveMarkerSize, resolvePatternSpec, resolveScreenLength$1 as resolveScreenLength, resolveStroke$1 as resolveStroke, resolveStrokeWidth$1 as resolveStrokeWidth, rgbaToHex, sampleGradientStops, scaleVertexWidth$1 as scaleVertexWidth, seedTile, solid, strokeDashStyleOf$1 as strokeDashStyleOf, strokeInsets$1 as strokeInsets, strokeOf, strokeWith, switchGradientKind, tileSpecOf, toHex8, trimPolyline, useGradientKinds, usePaintKind, usePaintKinds, vertexHalfWidths$1 as vertexHalfWidths, vertexWidthFromSides$1 as vertexWidthFromSides, warmPaintKinds$1 as warmPaintKinds, wcagLevels, widestHalfWidth, withAlpha01, withGradientKind$1 as withGradientKind };
|
package/dist/barrel/paths.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { noteFontRead } from "../core/scene/fontReads.js";
|
|
2
|
+
import { derivedPartsOf, pathFromParts, resolvePartPaint } from "../core/scene/derivedParts.js";
|
|
2
3
|
import { pathPoseDescriptor } from "../core/geometry/pathPoseDescriptor.js";
|
|
3
4
|
import { commitOps } from "../interactions/actions/defaultCommitAdapter.js";
|
|
4
5
|
import { HANDLE_LOCK_ROLES, locksInForce } from "../interactions/actions/edit-anchors/handleDrag.js";
|
|
@@ -7,6 +8,9 @@ import { finishPathEditFrame, pathEditPreview } from "../interactions/actions/ed
|
|
|
7
8
|
import { editedPathSymmetries } from "../interactions/actions/edit-anchors/symmetry.js";
|
|
8
9
|
import { deleteSelectedMark, editTargetOf, markUnder } from "../interactions/actions/defaults/pathEditMarks.js";
|
|
9
10
|
import { anchorEditWouldChange, commitAnchorEdit, depOf, requiresAnchorSelection } from "../interactions/actions/defaults/anchorEditing.js";
|
|
11
|
+
import { textAlongParts } from "../core/scene/pathEffects/textAlong.js";
|
|
12
|
+
import { PATH_EFFECT, createPathEffectDerivations, pathEffectNode, pathEffectOf, pathEffectParts, registeredPathEffects } from "../core/scene/pathEffects/derive.js";
|
|
13
|
+
import { effectSourceFor, hiddenSourcesTakenWith } from "../features/pathEffects/effectSources.js";
|
|
10
14
|
import { makeHandleCommand } from "../interactions/actions/defaults/anchorHandles.js";
|
|
11
15
|
import { joinSelectedAnchors } from "../interactions/actions/defaults/anchorJoin.js";
|
|
12
16
|
import { segmentUnder } from "../interactions/actions/defaults/segmentUnder.js";
|
|
@@ -23,12 +27,12 @@ import { PATH_SNAP_LABELS, pathSnapGlyph } from "../features/paths/pathSnap/glyp
|
|
|
23
27
|
import { nodeOutline } from "../features/paths/strokeOutline.js";
|
|
24
28
|
import { DEFAULT_OVERLAY_STYLE } from "../features/paths/anchorMarkers.js";
|
|
25
29
|
import { createPathEditingOverlayLayer } from "../features/paths/pathEditingOverlayLayer.js";
|
|
30
|
+
import { readEffectSource } from "../features/pathEffects/readSource.js";
|
|
31
|
+
import { useEffectSourcesLayer } from "../features/pathEffects/useEffectSourcesLayer.js";
|
|
26
32
|
import { createPathLayer } from "../features/paths/pathLayer.js";
|
|
27
33
|
import { pathOriginProjection } from "../features/paths/originProjection.js";
|
|
28
34
|
import { CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, DEFAULT_FLATTEN_TOLERANCE, PATH_C as PATH_C$1, PATH_CMD_LENGTHS, PATH_L as PATH_L$1, PATH_M as PATH_M$1, PATH_Q as PATH_Q$1, PATH_SNAP_KINDS as PATH_SNAP_KINDS$1, PATH_Z as PATH_Z$1, PathBuilder, asPolygonPath as asPolygonPath$1, averageAnchorsAt as averageAnchorsAt$1, bendAlongPath as bendAlongPath$1, blendPaths, boundsOfPath as boundsOfPath$1, circlePath as circlePath$1, composePath, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors as countPathAnchors$1, createPathSnapIndex as createPathSnapIndex$1, decomposePath, ellipsePath as ellipsePath$1, extendToMeet, findPathSnap as findPathSnap$1, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasOpenSubpath as hasOpenSubpath$1, intersectSegments, isCornerShape, joinAnchorsAt as joinAnchorsAt$1, lengthenOpenEnd, linePath as linePath$1, measurePath as measurePath$1, nextCornerShape, offsetPath, openEndRay, openPathEnds, pathCommandCoordCount, pathContainsPoint as pathContainsPoint$1, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathDivide, pathExclude, pathFromD as pathFromD$1, pathInPoseFrame as pathInPoseFrame$1, pathInWorld as pathInWorld$1, pathIntersect, pathIntersectsPolygon, pathIntersectsRect as pathIntersectsRect$1, pathSegments, pathSignedArea, pathSubtract, pathThroughPoseFrame as pathThroughPoseFrame$1, pathToAnchors as pathToAnchors$1, pathToD, pathUnion, pointAlongPath, pointInPath as pointInPath$1, polygonFromPoints as polygonFromPoints$1, polylineFromPoints as polylineFromPoints$1, poseFrameInverseOf as poseFrameInverseOf$1, poseFrameOf as poseFrameOf$1, poseLinearOf as poseLinearOf$1, poseRotationOf, prepareBlend as prepareBlend$1, rectMarkerPath as rectMarkerPath$1, rectPath as rectPath$1, regularPolygonPath as regularPolygonPath$1, remapPerAnchor, repeatAlongPath as repeatAlongPath$1, resolveCorners as resolveCorners$1, resolveCornersWithSources, reversePath, rotatePathAround as rotatePathAround$1, roundRectPath, scalePathToBounds, simplifyAnchorsAt, simplifyPath as simplifyPath$1, smudgePath, snipPathByPolyline, snipPathsAtCrossings, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath as squarePath$1, starPath as starPath$1, stationsAlongPath, strokeToPath, transformPath as transformPath$1, translatePath as translatePath$1, trianglesToPath, trimPathAt, unionBoundsPath, withCorner, withoutCorners, worldEditToStorage as worldEditToStorage$1 } from "../features/paths/index.js";
|
|
29
35
|
import { useAnchorFields } from "../features/paths/useAnchorFields.js";
|
|
30
|
-
import { PATH_EFFECT, createPathEffectDerivations, pathEffectNode, pathEffectOf, pathEffectParts, registeredPathEffects } from "../core/scene/pathEffects/derive.js";
|
|
31
|
-
import { readEffectSource } from "../features/pathEffects/readSource.js";
|
|
32
36
|
import { PATH_EFFECT_DERIVATIONS, withPathEffectsRegistry } from "../features/pathEffects/index.js";
|
|
33
37
|
import { useBooleans } from "../interactions/actions/booleans/useBooleans.js";
|
|
34
38
|
import { useBooleansAdapter } from "../interactions/actions/booleans/useBooleansAdapter.js";
|
|
@@ -36,4 +40,4 @@ import { commitBooleanPieces, resolveBooleanOperands } from "../interactions/act
|
|
|
36
40
|
import { CONSTRAINT_TOLERANCE, constrainPathEdit, constraintAnchors, pathAnchorPoints, solveConstraints, solvePathConstraints, unsatisfiedConstraints } from "@weasel-js/geom";
|
|
37
41
|
import { CURVE_REPS, bezierCubic, bezierQuadratic, nurbs, spiro } from "@weasel-js/geom/curves";
|
|
38
42
|
|
|
39
|
-
export { CONSTRAINT_TOLERANCE, CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, CURVE_REPS, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_OVERLAY_STYLE, DEFAULT_SIMPLIFY_TOLERANCE, GEOMETRY_BOUND_DATA, HANDLE_LOCK_ROLES, PATHFINDER_STROKES, PATH_C$1 as PATH_C, PATH_CMD_LENGTHS, PATH_EFFECT, PATH_EFFECT_DERIVATIONS, PATH_L$1 as PATH_L, PATH_M$1 as PATH_M, PATH_Q$1 as PATH_Q, PATH_SNAP_KINDS$1 as PATH_SNAP_KINDS, PATH_SNAP_LABELS, PATH_Z$1 as PATH_Z, PathBuilder, SHAPE_COUNT_RANGE, STAR_RATIO_RANGE, anchorEditWouldChange, applyBooleanOp, asPolygonPath$1 as asPolygonPath, averageAnchorsAt$1 as averageAnchorsAt, bendAlongPath$1 as bendAlongPath, bezierCubic, bezierQuadratic, blendPaths, boundsOfPath$1 as boundsOfPath, circlePath$1 as circlePath, clampShapeGenerator, classifyPathStorage, commitAnchorEdit, commitBooleanPieces, commitOps, composePath, constrainPathEdit, constraintAnchors, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors$1 as countPathAnchors, createPathEditingOverlayLayer, createPathEffectDerivations, createPathLayer, createPathSnapIndex$1 as createPathSnapIndex, createPenPreviewLayer, decomposePath, deleteNode, deleteSelectedMark, depOf, derivedPartsOf, editTargetOf, editedPathSymmetries, ellipsePath$1 as ellipsePath, extendToMeet, findPathSnap$1 as findPathSnap, finishPathEditFrame, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasEditablePath, hasOpenSubpath$1 as hasOpenSubpath, insertAt, intersectSegments, isCornerShape, isShapeGenerator, joinAnchorsAt$1 as joinAnchorsAt, joinPathsCommand, joinSelectedAnchors, lengthenOpenEnd, linePath$1 as linePath, livePathEdit, locksInForce, makeHandleCommand, markUnder, measurePath$1 as measurePath, nextCornerShape, nodeOutline, nurbs, offsetPath, openEndRay, openPathEnds, pathAnchorPoints, pathCommandCoordCount, pathContainsPoint$1 as pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCopy, pathCrossings, pathDistanceToPoint, pathDivide, pathEditPathOf, pathEditPreview, pathEffectNode, pathEffectOf, pathEffectParts, pathExclude, pathFromD$1 as pathFromD, pathFromParts, pathInPoseFrame$1 as pathInPoseFrame, pathInWorld$1 as pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect$1 as pathIntersectsRect, pathNodesOf, pathOriginProjection, pathPoseDescriptor, pathSegments, pathSignedArea, pathSnapGlyph, pathSubtract, pathThroughPoseFrame$1 as pathThroughPoseFrame, pathToAnchors$1 as pathToAnchors, pathToD, pathUnion, planJoin, pointAlongPath, pointInPath$1 as pointInPath, polygonFromPoints$1 as polygonFromPoints, polylineFromPoints$1 as polylineFromPoints, poseFrameInverseOf$1 as poseFrameInverseOf, poseFrameOf$1 as poseFrameOf, poseLinearOf$1 as poseLinearOf, poseRotationOf, prepareBlend$1 as prepareBlend, previewBooleanOp, readEffectSource, rectMarkerPath$1 as rectMarkerPath, rectPath$1 as rectPath, regenerateShape, registeredPathEffects, regularPolygonPath$1 as regularPolygonPath, remapPerAnchor, repeatAlongPath$1 as repeatAlongPath, requiresAnchorSelection, reshapeOps, reshapeTo, resolveBooleanOperands, resolveCorners$1 as resolveCorners, resolveCornersWithSources, resolveEditablePathOf, reversePath, rotatePathAround$1 as rotatePathAround, roundRectPath, scalePathToBounds, segmentUnder, selectedPathNodes, settleShapeGenerator, shapeGeneratorOf, shapeGeneratorPath, simplifyAnchorsAt, simplifyPath$1 as simplifyPath, slotOf, smudgePath, snipPathByPolyline, snipPathsAtCrossings, solveConstraints, solvePathConstraints, spiro, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath$1 as squarePath, starPath$1 as starPath, stationsAlongPath, storeEditablePath, strokeToPath, transformPath$1 as transformPath, translatePath$1 as translatePath, trianglesToPath, trimPathAt, unionBoundsPath, unsatisfiedConstraints, useAnchorFields, useBooleans, useBooleansAdapter, withCorner, withPath, withPathEffectsRegistry, withoutCorners, withoutGeometryBoundData, withoutShapeGenerator, worldEditToStorage$1 as worldEditToStorage };
|
|
43
|
+
export { CONSTRAINT_TOLERANCE, CORNER_FIT_TOLERANCE, CORNER_KEYWORDS, CURVE_REPS, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_OVERLAY_STYLE, DEFAULT_SIMPLIFY_TOLERANCE, GEOMETRY_BOUND_DATA, HANDLE_LOCK_ROLES, PATHFINDER_STROKES, PATH_C$1 as PATH_C, PATH_CMD_LENGTHS, PATH_EFFECT, PATH_EFFECT_DERIVATIONS, PATH_L$1 as PATH_L, PATH_M$1 as PATH_M, PATH_Q$1 as PATH_Q, PATH_SNAP_KINDS$1 as PATH_SNAP_KINDS, PATH_SNAP_LABELS, PATH_Z$1 as PATH_Z, PathBuilder, SHAPE_COUNT_RANGE, STAR_RATIO_RANGE, anchorEditWouldChange, applyBooleanOp, asPolygonPath$1 as asPolygonPath, averageAnchorsAt$1 as averageAnchorsAt, bendAlongPath$1 as bendAlongPath, bezierCubic, bezierQuadratic, blendPaths, boundsOfPath$1 as boundsOfPath, circlePath$1 as circlePath, clampShapeGenerator, classifyPathStorage, commitAnchorEdit, commitBooleanPieces, commitOps, composePath, constrainPathEdit, constraintAnchors, cornerAt, cornerFrameAt, cornerFrames, cornerKeywordOf, cornerShapeK, cornerShapePieces, cornerSpecAt, countPathAnchors$1 as countPathAnchors, createPathEditingOverlayLayer, createPathEffectDerivations, createPathLayer, createPathSnapIndex$1 as createPathSnapIndex, createPenPreviewLayer, decomposePath, deleteNode, deleteSelectedMark, depOf, derivedPartsOf, editTargetOf, editedPathSymmetries, effectSourceFor, ellipsePath$1 as ellipsePath, extendToMeet, findPathSnap$1 as findPathSnap, finishPathEditFrame, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, hasCorners, hasEditablePath, hasOpenSubpath$1 as hasOpenSubpath, hiddenSourcesTakenWith, insertAt, intersectSegments, isCornerShape, isShapeGenerator, joinAnchorsAt$1 as joinAnchorsAt, joinPathsCommand, joinSelectedAnchors, lengthenOpenEnd, linePath$1 as linePath, livePathEdit, locksInForce, makeHandleCommand, markUnder, measurePath$1 as measurePath, nextCornerShape, nodeOutline, noteFontRead, nurbs, offsetPath, openEndRay, openPathEnds, pathAnchorPoints, pathCommandCoordCount, pathContainsPoint$1 as pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCopy, pathCrossings, pathDistanceToPoint, pathDivide, pathEditPathOf, pathEditPreview, pathEffectNode, pathEffectOf, pathEffectParts, pathExclude, pathFromD$1 as pathFromD, pathFromParts, pathInPoseFrame$1 as pathInPoseFrame, pathInWorld$1 as pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect$1 as pathIntersectsRect, pathNodesOf, pathOriginProjection, pathPoseDescriptor, pathSegments, pathSignedArea, pathSnapGlyph, pathSubtract, pathThroughPoseFrame$1 as pathThroughPoseFrame, pathToAnchors$1 as pathToAnchors, pathToD, pathUnion, planJoin, pointAlongPath, pointInPath$1 as pointInPath, polygonFromPoints$1 as polygonFromPoints, polylineFromPoints$1 as polylineFromPoints, poseFrameInverseOf$1 as poseFrameInverseOf, poseFrameOf$1 as poseFrameOf, poseLinearOf$1 as poseLinearOf, poseRotationOf, prepareBlend$1 as prepareBlend, previewBooleanOp, readEffectSource, rectMarkerPath$1 as rectMarkerPath, rectPath$1 as rectPath, regenerateShape, registeredPathEffects, regularPolygonPath$1 as regularPolygonPath, remapPerAnchor, repeatAlongPath$1 as repeatAlongPath, requiresAnchorSelection, reshapeOps, reshapeTo, resolveBooleanOperands, resolveCorners$1 as resolveCorners, resolveCornersWithSources, resolveEditablePathOf, resolvePartPaint, reversePath, rotatePathAround$1 as rotatePathAround, roundRectPath, scalePathToBounds, segmentUnder, selectedPathNodes, settleShapeGenerator, shapeGeneratorOf, shapeGeneratorPath, simplifyAnchorsAt, simplifyPath$1 as simplifyPath, slotOf, smudgePath, snipPathByPolyline, snipPathsAtCrossings, solveConstraints, solvePathConstraints, spiro, splitByClosure, splitPathByPolyline, splitPathBySegment, splitSubpaths, squarePath$1 as squarePath, starPath$1 as starPath, stationsAlongPath, storeEditablePath, strokeToPath, textAlongParts, transformPath$1 as transformPath, translatePath$1 as translatePath, trianglesToPath, trimPathAt, unionBoundsPath, unsatisfiedConstraints, useAnchorFields, useBooleans, useBooleansAdapter, useEffectSourcesLayer, withCorner, withPath, withPathEffectsRegistry, withoutCorners, withoutGeometryBoundData, withoutShapeGenerator, worldEditToStorage$1 as worldEditToStorage };
|
package/dist/barrel/renderer.js
CHANGED
|
@@ -18,8 +18,9 @@ import { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, DRAW_TOOLS, PAGE_TOOLS, SELECT_TOOLS,
|
|
|
18
18
|
import { mergeContributions as mergeContributions$1 } from "../canvas/surfaceContribution.js";
|
|
19
19
|
import { SPRITE_STRIDE, blur, cullDrawCommands as cullDrawCommands$1, frameRect, mat3 as mat3$1, registerEffect, viewToMat3 as viewToMat3$1, vignette } from "@weasel-js/renderer";
|
|
20
20
|
import { createReflectable as createReflectable$1 } from "@weasel-js/registry";
|
|
21
|
-
import { assembleEntries, liveScope, modeShortcutSpec, modeShortcuts, scopeBindings } from "@weasel-js/routing";
|
|
21
|
+
import { KEYMAP_HOLD, assembleEntries, captureGesture, captureKey, createKeymapStack, describeKeymap, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, liveScope, modeShortcutSpec, modeShortcuts, scopeBindings } from "@weasel-js/routing";
|
|
22
22
|
import { canQueryLocalFonts, cssFamilyName, cssFontFamily, cssFontFamilyLoading, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, hasFontOutlines, isCanvasFont, listFontOutlines, loadFontOutlines, outlineStatus, refreshCanvasFont, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady as subscribeGlyphReady$1, unregisterCanvasFont, unregisterFontOutlines, warmFonts as warmFonts$1 } from "@weasel-js/font";
|
|
23
|
+
import { bindingSpec, held, key, keySpecRoute, unbound } from "@weasel-js/gestures";
|
|
23
24
|
import { CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, bakeCursor, createCursorSink as createCursorSink$1, createPaintedCursorState as createPaintedCursorState$1, cursorFor as cursorFor$1, resolveCursor, resolveCursorTier as resolveCursorTier$1 } from "@weasel-js/cursor";
|
|
24
25
|
|
|
25
|
-
export { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, COMPOSITE_FEATURES, CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, DRAW_TOOLS, FEATURE_ACTION_IDS, KIT_SHAPE_KINDS, KIT_VERSIONS, PAGE_TOOLS, PAINTED_CURSOR_LAYER_ID, SCENE_CANVAS_FEATURES, SELECT_TOOLS, SHAPE_KINDS, SHAPE_TOOLS, SPRITE_STRIDE, TOOL_DRIVEN_ACTION_IDS, TYPE_TOOLS, VIEW_TOOLS, arrangePreset, assembleEntries, bakeCursor, blur, canQueryLocalFonts, checkRequirements, createCursorSink$1 as createCursorSink, createPaintedCursorLayer, createPaintedCursorState$1 as createPaintedCursorState, createReflectable$1 as createReflectable, cssFamilyName, cssFontFamily, cssFontFamilyLoading, cullDrawCommands$1 as cullDrawCommands, cursorFor$1 as cursorFor, editPreset, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, frameRect, hasFontOutlines, ingestPreset, isCanvasFont, listFontOutlines, liveScope, loadFontOutlines, mat3$1 as mat3, mergeContributions$1 as mergeContributions, modeShortcutSpec, modeShortcuts, movePreset, outlinePreset, outlineStatus, paletteInsertPaint, pathsPreset, refreshCanvasFont, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, resizePreset, resolveCursor, resolveCursorTier$1 as resolveCursorTier, rotateAroundAABBCenter, rotatePreset, satisfiesRange, scopeBindings, selectPreset, subscribeGlyphReady$1 as subscribeGlyphReady, textBoxOf, unregisterCanvasFont, unregisterFontOutlines, useTransformFollower, viewPreset, viewToMat3$1 as viewToMat3, vignette, warmFonts$1 as warmFonts };
|
|
26
|
+
export { BUILTIN_TOOLS, BUILTIN_TOOL_IDS, COMPOSITE_FEATURES, CURSOR_ANGLE_STEPS, CURSOR_MAX_CSS_PX, DRAW_TOOLS, FEATURE_ACTION_IDS, KEYMAP_HOLD, KIT_SHAPE_KINDS, KIT_VERSIONS, PAGE_TOOLS, PAINTED_CURSOR_LAYER_ID, SCENE_CANVAS_FEATURES, SELECT_TOOLS, SHAPE_KINDS, SHAPE_TOOLS, SPRITE_STRIDE, TOOL_DRIVEN_ACTION_IDS, TYPE_TOOLS, VIEW_TOOLS, arrangePreset, assembleEntries, bakeCursor, bindingSpec, blur, canQueryLocalFonts, captureGesture, captureKey, checkRequirements, createCursorSink$1 as createCursorSink, createKeymapStack, createPaintedCursorLayer, createPaintedCursorState$1 as createPaintedCursorState, createReflectable$1 as createReflectable, cssFamilyName, cssFontFamily, cssFontFamilyLoading, cullDrawCommands$1 as cullDrawCommands, cursorFor$1 as cursorFor, describeKeymap, editPreset, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, frameRect, hasFontOutlines, held, ingestPreset, isCanvasFont, key, keySpecRoute, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, listFontOutlines, liveScope, loadFontOutlines, mat3$1 as mat3, mergeContributions$1 as mergeContributions, modeShortcutSpec, modeShortcuts, movePreset, outlinePreset, outlineStatus, paletteInsertPaint, pathsPreset, refreshCanvasFont, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, resizePreset, resolveCursor, resolveCursorTier$1 as resolveCursorTier, rotateAroundAABBCenter, rotatePreset, satisfiesRange, scopeBindings, selectPreset, subscribeGlyphReady$1 as subscribeGlyphReady, textBoxOf, unbound, unregisterCanvasFont, unregisterFontOutlines, useTransformFollower, viewPreset, viewToMat3$1 as viewToMat3, vignette, warmFonts$1 as warmFonts };
|
package/dist/barrel/routing.js
CHANGED
|
@@ -22,7 +22,7 @@ import { deleteAnchorsAction, nudgeAnchorsDownAction, nudgeAnchorsLeftAction, nu
|
|
|
22
22
|
import { selectFromLasso } from "../interactions/actions/lasso-select/behaviors/selectFromLasso.js";
|
|
23
23
|
import { lassoSelectAction } from "../interactions/actions/lasso-select/action.js";
|
|
24
24
|
import { sliceAction } from "../interactions/actions/defaults/slice.js";
|
|
25
|
-
import { commitDeleteToScene, createDeleteAction, deleteAction } from "../interactions/actions/defaults/delete.js";
|
|
25
|
+
import { commitDeleteToScene, createDeleteAction, deleteAction, hiddenSourceDeleteOps } from "../interactions/actions/defaults/delete.js";
|
|
26
26
|
import { makePinchZoomAction, pinchZoomAction } from "../interactions/actions/defaults/pinchZoom.js";
|
|
27
27
|
import { clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction } from "../interactions/actions/clipboard/action.js";
|
|
28
28
|
import { enterTextEditAction } from "../interactions/actions/defaults/enterTextEdit.js";
|
|
@@ -57,8 +57,8 @@ import { useSliceTool } from "../tools/builtin/slice/useSliceTool.js";
|
|
|
57
57
|
import { useMeasureTool } from "../tools/builtin/measure/useMeasureTool.js";
|
|
58
58
|
import { isToolSet, toolIdsOf as toolIdsOf$1, toolSet as toolSet$1, toolSetHas, withoutTools } from "../tools/index.js";
|
|
59
59
|
import { useLatest as useLatest$1 } from "@weasel-js/react";
|
|
60
|
-
import { ActionDisabledReason as ActionDisabledReason$1, actionBindings as actionBindings$1, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, buildDepsFromRequires as buildDepsFromRequires$1, createDepRegistry, createDispatcher as createDispatcher$1, deleteScratch, evaluateActive as evaluateActive$1, evaluateEnabled as evaluateEnabled$1, getScratch as getScratch$1, heldKeySpec as heldKeySpec$1, keySpecShortcut, keysHeld, matchActionItem, overlaysOf as overlaysOf$1, readActionSettings, resolveParams as resolveParams$1, resolveSchemaMenu, roleReader as roleReader$1, scratchKey as scratchKey$1, setScratch as setScratch$1, specificity, taggedActionItems, tuneAction } from "@weasel-js/routing";
|
|
60
|
+
import { ActionDisabledReason as ActionDisabledReason$1, actionBindings as actionBindings$1, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, bindingId, buildDepsFromRequires as buildDepsFromRequires$1, createDepRegistry, createDispatcher as createDispatcher$1, deleteScratch, evaluateActive as evaluateActive$1, evaluateEnabled as evaluateEnabled$1, getScratch as getScratch$1, heldKeySpec as heldKeySpec$1, keySpecShortcut, keysHeld, matchActionItem, overlaysOf as overlaysOf$1, readActionSettings, resolveBindingOverrides, resolveParams as resolveParams$1, resolveSchemaMenu, roleReader as roleReader$1, scratchKey as scratchKey$1, setScratch as setScratch$1, specificity, taggedActionItems, tuneAction } from "@weasel-js/routing";
|
|
61
61
|
import { bodyPredicate, hitPredicate as hitPredicate$1 } from "@weasel-js/gestures";
|
|
62
|
-
import { ActionsProvider as ActionsProvider$1, ActiveToolContextProvider as ActiveToolContextProvider$1, ActiveToolContextProviderIfRoot as ActiveToolContextProviderIfRoot$1, DepRegistryProvider as DepRegistryProvider$1, InputScope as InputScope$1, Yoke, useAction, useActionsRegistry as useActionsRegistry$1, useActiveToolContext, useCommand, useDepRegistry as useDepRegistry$1, useDepSource as useDepSource$1, useGestureDispatcher as useGestureDispatcher$1, useMenuHost as useMenuHost$1, useMenus, useOngoingAction, useOptionalActiveToolContext as useOptionalActiveToolContext$1, useOptionalDepRegistry as useOptionalDepRegistry$1, useYoke } from "@weasel-js/routing/react";
|
|
62
|
+
import { ActionsProvider as ActionsProvider$1, ActiveToolContextProvider as ActiveToolContextProvider$1, ActiveToolContextProviderIfRoot as ActiveToolContextProviderIfRoot$1, DepRegistryProvider as DepRegistryProvider$1, InputScope as InputScope$1, Yoke, useAction, useActionsRegistry as useActionsRegistry$1, useActiveToolContext, useCommand, useDepRegistry as useDepRegistry$1, useDepSource as useDepSource$1, useGestureDispatcher as useGestureDispatcher$1, useMenuHost as useMenuHost$1, useMenus, useOngoingAction, useOpenKeymap, useOptionalActiveToolContext as useOptionalActiveToolContext$1, useOptionalDepRegistry as useOptionalDepRegistry$1, useYoke } from "@weasel-js/routing/react";
|
|
63
63
|
|
|
64
|
-
export { AREA_SELECT_ID, ActionDisabledReason$1 as ActionDisabledReason, ActionsProvider$1 as ActionsProvider, ActiveToolContextProvider$1 as ActiveToolContextProvider, ActiveToolContextProviderIfRoot$1 as ActiveToolContextProviderIfRoot, CORNER_ANCHORS, DRAG_PAN_ID, DepRegistryProvider$1 as DepRegistryProvider, EDGE_HANDLE_MIN_RADII, INSERT_REPOSITION_BINDING, InputScope$1 as InputScope, KIT_STANDARD_ACTION_IDS, PATH_GESTURE_TAGS, RESIZE_HANDLE_ANCHORS, SELECTION_MOVE_ID, SELECTION_RESIZE_ID, SELECTION_ROTATE_ID, SELECTION_TRANSFORM_ID, STICKY_DEFAULTS, Yoke, actionBindings$1 as actionBindings, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, areaSelectAction, areaSelectContribution, bodyPredicate, buildDepsFromRequires$1 as buildDepsFromRequires, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction, cloneAction, commitDeleteToScene, computeSliceOps, contextMenuAction, cornerPoint, createDeleteAction, createDepRegistry, createDispatcher$1 as createDispatcher, createPointerFollower, createResizeAction, defaultCommitAdapter, defineTool, deleteAction, deleteAnchorsAction, deleteScratch, dragPanContribution, editAnchorsAction, editingLayer, enterTextEditAction, evaluateActive$1 as evaluateActive, evaluateEnabled$1 as evaluateEnabled, exitPathEditToolAction, flipAction, getScratch$1 as getScratch, handlePoint, heldKeySpec$1 as heldKeySpec, hitPredicate$1 as hitPredicate, inPlane, insertAction, insertLayer, insertRepositionAction, isCornerHandle, isToolSet, keySpecShortcut, keysHeld, lassoSelectAction, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, matchActionItem, moveAction, nudgeAnchorsDownAction, nudgeAnchorsLeftAction, nudgeAnchorsRightAction, nudgeAnchorsUpAction, onEmptyCanvas, openContextMenu, overlaysOf$1 as overlaysOf, pathEditToolAction, pathEditToolActive, pathOperationTags, pickTopMostHit, pinchZoomAction, placeAction, readActionSettings, resizeAction, resizeHandlesFor, resolveParams$1 as resolveParams, resolveSchemaMenu, roleReader$1 as roleReader, rotateAction, scratchKey$1 as scratchKey, selectAnchorAction, selectFromLasso, selectionLayer, selectionMoveBindings, selectionMoveContribution, selectionResizeBindings, selectionResizeContribution, selectionRotateBindings, selectionRotateContribution, selectionTransformBindings, selectionTransformContribution, setScratch$1 as setScratch, sliceAction, specificity, stickyData, stickyNodeFactory, taggedActionItems, toolIdsOf$1 as toolIdsOf, toolSet$1 as toolSet, toolSetHas, tuneAction, useAction, useActionsRegistry$1 as useActionsRegistry, useActiveToolContext, useBooleansAdapterSource, useCommand, useDepRegistry$1 as useDepRegistry, useDepSource$1 as useDepSource, useEllipseTool, useEyedropperTool, useGestureDispatcher$1 as useGestureDispatcher, useHandTool, useImageTool, useKeybindings, useLassoTool, useLatest$1 as useLatest, useLineTool, useMeasureTool, useMenuHost$1 as useMenuHost, useMenus, useOngoingAction, useOptionalActiveToolContext$1 as useOptionalActiveToolContext, useOptionalDepRegistry$1 as useOptionalDepRegistry, usePenTool, usePencilTool, usePolygonTool, usePoseDescriptorDepSource, useRectTool, useResizePolicy, useSelectTool, useSliceDep, useSliceDepSource, useSliceTool, useStandardActions, useStarTool, useStickyTool, useTextTool, useTools$1 as useTools, useYoke, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, withoutTools };
|
|
64
|
+
export { AREA_SELECT_ID, ActionDisabledReason$1 as ActionDisabledReason, ActionsProvider$1 as ActionsProvider, ActiveToolContextProvider$1 as ActiveToolContextProvider, ActiveToolContextProviderIfRoot$1 as ActiveToolContextProviderIfRoot, CORNER_ANCHORS, DRAG_PAN_ID, DepRegistryProvider$1 as DepRegistryProvider, EDGE_HANDLE_MIN_RADII, INSERT_REPOSITION_BINDING, InputScope$1 as InputScope, KIT_STANDARD_ACTION_IDS, PATH_GESTURE_TAGS, RESIZE_HANDLE_ANCHORS, SELECTION_MOVE_ID, SELECTION_RESIZE_ID, SELECTION_ROTATE_ID, SELECTION_TRANSFORM_ID, STICKY_DEFAULTS, Yoke, actionBindings$1 as actionBindings, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, actionsTagged, areaSelectAction, areaSelectContribution, bindingId, bodyPredicate, buildDepsFromRequires$1 as buildDepsFromRequires, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteEventAction, cloneAction, commitDeleteToScene, computeSliceOps, contextMenuAction, cornerPoint, createDeleteAction, createDepRegistry, createDispatcher$1 as createDispatcher, createPointerFollower, createResizeAction, defaultCommitAdapter, defineTool, deleteAction, deleteAnchorsAction, deleteScratch, dragPanContribution, editAnchorsAction, editingLayer, enterTextEditAction, evaluateActive$1 as evaluateActive, evaluateEnabled$1 as evaluateEnabled, exitPathEditToolAction, flipAction, getScratch$1 as getScratch, handlePoint, heldKeySpec$1 as heldKeySpec, hiddenSourceDeleteOps, hitPredicate$1 as hitPredicate, inPlane, insertAction, insertLayer, insertRepositionAction, isCornerHandle, isToolSet, keySpecShortcut, keysHeld, lassoSelectAction, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, matchActionItem, moveAction, nudgeAnchorsDownAction, nudgeAnchorsLeftAction, nudgeAnchorsRightAction, nudgeAnchorsUpAction, onEmptyCanvas, openContextMenu, overlaysOf$1 as overlaysOf, pathEditToolAction, pathEditToolActive, pathOperationTags, pickTopMostHit, pinchZoomAction, placeAction, readActionSettings, resizeAction, resizeHandlesFor, resolveBindingOverrides, resolveParams$1 as resolveParams, resolveSchemaMenu, roleReader$1 as roleReader, rotateAction, scratchKey$1 as scratchKey, selectAnchorAction, selectFromLasso, selectionLayer, selectionMoveBindings, selectionMoveContribution, selectionResizeBindings, selectionResizeContribution, selectionRotateBindings, selectionRotateContribution, selectionTransformBindings, selectionTransformContribution, setScratch$1 as setScratch, sliceAction, specificity, stickyData, stickyNodeFactory, taggedActionItems, toolIdsOf$1 as toolIdsOf, toolSet$1 as toolSet, toolSetHas, tuneAction, useAction, useActionsRegistry$1 as useActionsRegistry, useActiveToolContext, useBooleansAdapterSource, useCommand, useDepRegistry$1 as useDepRegistry, useDepSource$1 as useDepSource, useEllipseTool, useEyedropperTool, useGestureDispatcher$1 as useGestureDispatcher, useHandTool, useImageTool, useKeybindings, useLassoTool, useLatest$1 as useLatest, useLineTool, useMeasureTool, useMenuHost$1 as useMenuHost, useMenus, useOngoingAction, useOpenKeymap, useOptionalActiveToolContext$1 as useOptionalActiveToolContext, useOptionalDepRegistry$1 as useOptionalDepRegistry, usePenTool, usePencilTool, usePolygonTool, usePoseDescriptorDepSource, useRectTool, useResizePolicy, useSelectTool, useSliceDep, useSliceDepSource, useSliceTool, useStandardActions, useStarTool, useStickyTool, useTextTool, useTools$1 as useTools, useYoke, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, withoutTools };
|
package/dist/barrel/scene.js
CHANGED
|
@@ -21,6 +21,7 @@ import { createSetSelectionOp } from "../core/ops/select.js";
|
|
|
21
21
|
import { canBringForward, canSendBackward } from "../core/ops/reorder/algorithms.js";
|
|
22
22
|
import { createSetChildOrderOp } from "../core/ops/reorder/setChildOrder.js";
|
|
23
23
|
import { createMoveToIndexOp, createReorderOp } from "../core/ops/reorder/index.js";
|
|
24
|
+
import { CLIP_NOTHING, clipNothing } from "../core/scene/clipNothing.js";
|
|
24
25
|
import { UNION_OF_CHILDREN, unionOfChildren } from "../core/scene/kitRegistry.js";
|
|
25
26
|
import { createMeasurements, currentMeasureId, measureIds } from "../features/measure/measurements.js";
|
|
26
27
|
import { measureAt, measureEndSource } from "../features/measure/measureHit.js";
|
|
@@ -48,4 +49,4 @@ import { measurementsContribution } from "../features/measure/measureContributio
|
|
|
48
49
|
import { MIXED } from "@weasel-js/registry";
|
|
49
50
|
import { swapOp } from "@weasel-js/history";
|
|
50
51
|
|
|
51
|
-
export { IDENTITY_POSE_COMPOSITION, MEASURE_ACTION_IDS, MEASURE_AFFORDANCE_KIND, MEASURE_LAYER_ID, MIXED, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, SCENE_HISTORY_FORM, SceneArrivalRefused, UNION_OF_CHILDREN, annotationLayerIds, applyOpsTo, asNodeId, axisAlignedBounds, canBringForward, canSendBackward, carriedDescendants, composeRectPose, composeRigidPose, composeWorldPose, composesFrames, createArrangeOp, createDeleteOp, createHistory$1 as createHistory, createInsertOp, createMeasurements, createMoveToIndexOp, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createScene, createSetChildOrderOp, createSetDataOp, createSetDependsOnOp, createSetHiddenOp, createSetLayerOp, createSetLayoutOp, createSetLockedOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTransformOp, currentMeasureId, decomposeRectPose, decomposeRigidPose, definesFrame, derivedDepOf, derivedPose, dispatchApplyBatch, documentDepOf, documentPose, effectivePose, hidesSubtree, isAnnotationLayer, isAnnotationNode, isNodeHidden, isNodeLocked, measureAt, measureBetween, measureEndSource, measureEndsOf, measureIds, measureNode, measurePose, measurementOf, measurementsContribution, nestedHitTester, nodeGates, opFactoryRegistry, rebaseLocalPose, rebuildOp, reconcileSpecs, registerOpFactory, registeredOpNames, sceneCarrySource, sceneFromJSON, scenePoseAdapter, sceneSelectionStore, sceneSharedUnitScopes, sceneUnitScopes, swapOp, translateRectPose, unionAABB, unionBounds, unionOfChildren, unionOfChildrenVia, useScene, worldPoseLookup, writtenBy };
|
|
52
|
+
export { CLIP_NOTHING, IDENTITY_POSE_COMPOSITION, MEASURE_ACTION_IDS, MEASURE_AFFORDANCE_KIND, MEASURE_LAYER_ID, MIXED, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, SCENE_HISTORY_FORM, SceneArrivalRefused, UNION_OF_CHILDREN, annotationLayerIds, applyOpsTo, asNodeId, axisAlignedBounds, canBringForward, canSendBackward, carriedDescendants, clipNothing, composeRectPose, composeRigidPose, composeWorldPose, composesFrames, createArrangeOp, createDeleteOp, createHistory$1 as createHistory, createInsertOp, createMeasurements, createMoveToIndexOp, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createScene, createSetChildOrderOp, createSetDataOp, createSetDependsOnOp, createSetHiddenOp, createSetLayerOp, createSetLayoutOp, createSetLockedOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTransformOp, currentMeasureId, decomposeRectPose, decomposeRigidPose, definesFrame, derivedDepOf, derivedPose, dispatchApplyBatch, documentDepOf, documentPose, effectivePose, hidesSubtree, isAnnotationLayer, isAnnotationNode, isNodeHidden, isNodeLocked, measureAt, measureBetween, measureEndSource, measureEndsOf, measureIds, measureNode, measurePose, measurementOf, measurementsContribution, nestedHitTester, nodeGates, opFactoryRegistry, rebaseLocalPose, rebuildOp, reconcileSpecs, registerOpFactory, registeredOpNames, sceneCarrySource, sceneFromJSON, scenePoseAdapter, sceneSelectionStore, sceneSharedUnitScopes, sceneUnitScopes, swapOp, translateRectPose, unionAABB, unionBounds, unionOfChildren, unionOfChildrenVia, useScene, worldPoseLookup, writtenBy };
|
package/dist/barrel/text.js
CHANGED
|
@@ -5,6 +5,6 @@ import { createTextLayer } from "../features/text/textLayer.js";
|
|
|
5
5
|
import { useSceneTextEdit } from "../features/text/useSceneTextEdit.js";
|
|
6
6
|
import { TEXT_EDIT_FONT_HOLD, TextOutlinesError as TextOutlinesError$1, charOffsetToDomPosition, domPositionToCharOffset, domToRuns, loadTextOutlines as loadTextOutlines$1, runsToDom, textCommand, textCommandFromPose, textCommandFromRuns, textToPath as textToPath$1, textToPathsByPaint as textToPathsByPaint$1, useTextEdit } from "../features/text/index.js";
|
|
7
7
|
import { useCreateOutlinesAdapter } from "../interactions/actions/outlines/useCreateOutlinesAdapter.js";
|
|
8
|
-
import { DEFAULT_DECORATION_METRICS, DEFAULT_TEXT_STYLE, MARKDOWN_RUN_GRAMMAR, SCRIPT_METRICS, SMALL_CAPS_SCALE, applyStyleToRange, cachedLayoutRuns, cachedPaintRuns, caretIndexAt as caretIndexAt$1, createMarkdownRenderer, decorationMetrics, defaultLabelTextRenderer, effectiveRangeStyle, fitTextPose, fontString, isBoldWeight, isSmallCapsLetter, isTextData as isTextData$1, layoutMarkdown, layoutRuns, layoutTextPose, markdownToRuns, measureText, measureTextBounds as measureTextBounds$1, measuredWidth, nodeHasFlag, numericWeight, paintRuns, paragraphDirection, patchRangeStyle, pointInTextPose as pointInTextPose$1, rangeWeight, registerBidi, renderLabel, resolveAlign as resolveAlign$1, resolveRunFace, resolveRuns, resolveTextStyle, runsToMarkdown, runsToPlainText as runsToPlainText$1, scriptMetrics, scriptMetricsFor, setFlagOverRange, smallCapsScale, smallCapsScaleFor, smallCapsText, styleAtRange, textLineBoxes as textLineBoxes$1, textPoseLayoutInput, toRuns, transformRunTexts, unboldPatch, verticalAlignOffset } from "@weasel-js/text";
|
|
8
|
+
import { DEFAULT_DECORATION_METRICS, DEFAULT_TEXT_FILL as DEFAULT_TEXT_FILL$1, DEFAULT_TEXT_STYLE, MARKDOWN_RUN_GRAMMAR, SCRIPT_METRICS, SMALL_CAPS_SCALE, applyStyleToRange, cachedLayoutRuns, cachedPaintRuns, caretIndexAt as caretIndexAt$1, createMarkdownRenderer, decorationMetrics, defaultLabelTextRenderer, effectiveRangeStyle, fitTextPose, fontString, isBoldWeight, isSmallCapsLetter, isTextData as isTextData$1, layoutMarkdown, layoutRuns, layoutTextPose, markdownToRuns, measureText, measureTextBounds as measureTextBounds$1, measuredWidth, nodeHasFlag, numericWeight, paintRuns, paragraphDirection, patchRangeStyle, pointInTextPose as pointInTextPose$1, rangeWeight, registerBidi, renderLabel, resolveAlign as resolveAlign$1, resolveRunFace, resolveRuns, resolveTextStyle, runsToMarkdown, runsToPlainText as runsToPlainText$1, scriptMetrics, scriptMetricsFor, setFlagOverRange, smallCapsScale, smallCapsScaleFor, smallCapsText, styleAtRange, textLineBoxes as textLineBoxes$1, textPoseLayoutInput, toRuns, transformRunTexts, unboldPatch, verticalAlignOffset } from "@weasel-js/text";
|
|
9
9
|
|
|
10
|
-
export { DEFAULT_DECORATION_METRICS, DEFAULT_TEXT_STYLE, MARKDOWN_RUN_GRAMMAR, SCRIPT_METRICS, SMALL_CAPS_SCALE, TEXT_EDIT_FONT_HOLD, TextOutlinesError$1 as TextOutlinesError, applyCreateOutlines, applyOutlineStroke, applyStyleToRange, cachedLayoutRuns, cachedPaintRuns, caretIndexAt$1 as caretIndexAt, charOffsetToDomPosition, createMarkdownRenderer, createTextLayer, decorationMetrics, defaultLabelTextRenderer, domPositionToCharOffset, domToRuns, effectiveRangeStyle, fitTextPose, fontString, isBoldWeight, isSmallCapsLetter, isTextData$1 as isTextData, layoutMarkdown, layoutRuns, layoutTextPose, loadTextOutlines$1 as loadTextOutlines, markdownToRuns, measureText, measureTextBounds$1 as measureTextBounds, measuredWidth, nodeHasFlag, numericWeight, paintRuns, paragraphDirection, patchRangeStyle, pointInTextPose$1 as pointInTextPose, rangeWeight, registerBidi, renderLabel, resolveAlign$1 as resolveAlign, resolveRunFace, resolveRuns, resolveTextStyle, runsToDom, runsToMarkdown, runsToPlainText$1 as runsToPlainText, scriptMetrics, scriptMetricsFor, setFlagOverRange, smallCapsScale, smallCapsScaleFor, smallCapsText, strokeRegion, styleAtRange, textCommand, textCommandFromPose, textCommandFromRuns, textLineBoxes$1 as textLineBoxes, textPoseLayoutInput, textToPath$1 as textToPath, textToPathsByPaint$1 as textToPathsByPaint, toRuns, transformRunTexts, unboldPatch, useCreateOutlinesAdapter, useSceneTextEdit, useTextEdit, verticalAlignOffset };
|
|
10
|
+
export { DEFAULT_DECORATION_METRICS, DEFAULT_TEXT_FILL$1 as DEFAULT_TEXT_FILL, DEFAULT_TEXT_STYLE, MARKDOWN_RUN_GRAMMAR, SCRIPT_METRICS, SMALL_CAPS_SCALE, TEXT_EDIT_FONT_HOLD, TextOutlinesError$1 as TextOutlinesError, applyCreateOutlines, applyOutlineStroke, applyStyleToRange, cachedLayoutRuns, cachedPaintRuns, caretIndexAt$1 as caretIndexAt, charOffsetToDomPosition, createMarkdownRenderer, createTextLayer, decorationMetrics, defaultLabelTextRenderer, domPositionToCharOffset, domToRuns, effectiveRangeStyle, fitTextPose, fontString, isBoldWeight, isSmallCapsLetter, isTextData$1 as isTextData, layoutMarkdown, layoutRuns, layoutTextPose, loadTextOutlines$1 as loadTextOutlines, markdownToRuns, measureText, measureTextBounds$1 as measureTextBounds, measuredWidth, nodeHasFlag, numericWeight, paintRuns, paragraphDirection, patchRangeStyle, pointInTextPose$1 as pointInTextPose, rangeWeight, registerBidi, renderLabel, resolveAlign$1 as resolveAlign, resolveRunFace, resolveRuns, resolveTextStyle, runsToDom, runsToMarkdown, runsToPlainText$1 as runsToPlainText, scriptMetrics, scriptMetricsFor, setFlagOverRange, smallCapsScale, smallCapsScaleFor, smallCapsText, strokeRegion, styleAtRange, textCommand, textCommandFromPose, textCommandFromRuns, textLineBoxes$1 as textLineBoxes, textPoseLayoutInput, textToPath$1 as textToPath, textToPathsByPaint$1 as textToPathsByPaint, toRuns, transformRunTexts, unboldPatch, useCreateOutlinesAdapter, useSceneTextEdit, useTextEdit, verticalAlignOffset };
|
package/dist/barrel/viewport.js
CHANGED
|
@@ -3,6 +3,8 @@ import { DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, ZOOM_FLOOR, normalizeZoom as normal
|
|
|
3
3
|
import { normalizeView, viewToTransform, viewZoom } from "../core/viewport/view.js";
|
|
4
4
|
import { createViewportLayer } from "../features/viewports/viewportLayer.js";
|
|
5
5
|
import { createViewResolver } from "../features/viewports/viewResolver.js";
|
|
6
|
+
import { fitViewToBounds } from "../core/viewport/fitViewToBounds.js";
|
|
7
|
+
import { aimSpace2d, isRectAim, rectAim, viewForAim } from "../features/viewports/aim.js";
|
|
6
8
|
import { deriveParallaxView, fromPlane, planeMap, planeMatrix, planeToPlane, rectFromPlane, rectToPlane, toPlane } from "../core/viewport/parallax.js";
|
|
7
9
|
import { usePoseRun } from "../features/poseRun/usePoseRun.js";
|
|
8
10
|
import { watchDevicePixelRatio } from "../core/device/watchDevicePixelRatio.js";
|
|
@@ -18,7 +20,6 @@ import { startThresholdDrag } from "../interactions/gestures/thresholdDrag/thres
|
|
|
18
20
|
import { ANCHOR_HIT_BASE_PX, HANDLE_BASE_PX, ROTATION_HANDLE_BASE_PX } from "../core/device/targets.js";
|
|
19
21
|
import { COARSE_TARGET_SCALE, DEFAULT_DEVICE_PROFILE as DEFAULT_DEVICE_PROFILE$1, resolveDeviceProfile as resolveDeviceProfile$1 } from "../core/device/index.js";
|
|
20
22
|
import { fitToBounds, fitZoom } from "../core/viewport/fitToBounds.js";
|
|
21
|
-
import { fitViewToBounds } from "../core/viewport/fitViewToBounds.js";
|
|
22
23
|
import { adjacentPage, layoutPages, pageAt, pageHolding, pageName, pageOfBounds, pagesBounds } from "../core/pages/pages.js";
|
|
23
24
|
import { pagesLayer } from "../core/pages/pagesLayer.js";
|
|
24
25
|
import { fitViewToPage, pageInView } from "../core/pages/fitViewToPage.js";
|
|
@@ -34,7 +35,10 @@ import { useVelocityTracker } from "../core/viewport/useVelocityTracker.js";
|
|
|
34
35
|
import { useDecayLoop } from "../core/viewport/useDecayLoop.js";
|
|
35
36
|
import { interpolateView } from "../core/viewport/interpolateView.js";
|
|
36
37
|
import { VIEW_ANIMATION_KEY, useViewAnimation, useViewAnimationOn, viewAxes } from "../core/viewport/useViewAnimation.js";
|
|
38
|
+
import { VIEW_MARKER_DEFAULT_STYLE, VIEW_MARKER_HIT_SLOP_PX, createViewMarkerLayer, grabViewMarker } from "../features/viewports/viewMarker.js";
|
|
37
39
|
import { CanvasView } from "../canvas/CanvasView.js";
|
|
40
|
+
import { ViewMarker } from "../canvas/ViewMarker.js";
|
|
41
|
+
import { VIEW_MARKER_DRAG, createViewMarkerContribution, viewMarkerDragAction } from "../features/viewports/viewMarkerDrag.js";
|
|
38
42
|
import { SceneViewCanvas } from "../canvas/SceneViewCanvas.js";
|
|
39
43
|
import { DrawCanvas } from "../canvas/DrawCanvas.js";
|
|
40
44
|
import { FALLBACK_ACCENT, accentColorOf } from "../canvas/accentColor.js";
|
|
@@ -45,4 +49,4 @@ import { useSimulation } from "@weasel-js/simulation/react";
|
|
|
45
49
|
import { useCanvasFocus, useFrameClock, useVisibleRaf as useVisibleRaf$1 } from "@weasel-js/react";
|
|
46
50
|
import { clientToCanvas as clientToCanvas$1 } from "@weasel-js/routing";
|
|
47
51
|
|
|
48
|
-
export { ANCHOR_HIT_BASE_PX, COARSE_TARGET_SCALE, CanvasView, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEVICE_PROFILE$1 as DEFAULT_DEVICE_PROFILE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_VELOCITY_DECAY, DeviceProfileProvider, DrawCanvas, FALLBACK_ACCENT, HANDLE_BASE_PX, PAGES_DOC_KEY, ROTATION_HANDLE_BASE_PX, SceneViewCanvas, VERSION, VIEW_ANIMATION_KEY, WHEEL_ZOOM_STEP, ZOOM_FLOOR, accentColorOf, addPage, adjacentPage, axisZoomFactor, clampView, clientToCanvas$1 as clientToCanvas, computeFitViewport, computeWheelAction, createSimulation, createVelocityTracker, createViewResolver, createViewportLayer, deriveParallaxView, fitToBounds, fitViewToBounds, fitViewToPage, fitZoom, fromPlane, gateLayer, interpolateView, isPlainObject, layoutPages, meanScale$1 as meanScale, movePage, nextPageId, normalizeView, normalizeZoom$1 as normalizeZoom, pageAt, pageHolding, pageInView, pageMembers, pageName, pageOfBounds, pagesBounds, pagesLayer, pagesOf, placedPagesOf, planeMap, planeMatrix, planeToPlane, pxExtent$1 as pxExtent, rectFromPlane, rectToPlane, removePage, renamePage, resizePage, resolveDeviceProfile$1 as resolveDeviceProfile, scaleDelta$1 as scaleDelta, sceneNodeClientRect, screenAngleOf$1 as screenAngleOf, screenToWorld, setPages, stableStringify, standoff$1 as standoff, startThresholdDrag, toPlane, useAutoCenter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDragHandle, useDropZone, useElementSize, useFrameClock, useHandleDrag, useNodeOverlayFrame, usePoseRun, useSimulation, useVelocityTracker, useViewAnimation, useViewAnimationOn, useVisibleRaf$1 as useVisibleRaf, viewAxes, viewToTransform, viewZoom, viewportWorldRect, watchDevicePixelRatio, wheelPan, wheelZoom, wheelZoomFactor, withinPxBox, withinPxRadius$1 as withinPxRadius, worldToScreen, zoomAt };
|
|
52
|
+
export { ANCHOR_HIT_BASE_PX, COARSE_TARGET_SCALE, CanvasView, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEVICE_PROFILE$1 as DEFAULT_DEVICE_PROFILE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_VELOCITY_DECAY, DeviceProfileProvider, DrawCanvas, FALLBACK_ACCENT, HANDLE_BASE_PX, PAGES_DOC_KEY, ROTATION_HANDLE_BASE_PX, SceneViewCanvas, VERSION, VIEW_ANIMATION_KEY, VIEW_MARKER_DEFAULT_STYLE, VIEW_MARKER_DRAG, VIEW_MARKER_HIT_SLOP_PX, ViewMarker, WHEEL_ZOOM_STEP, ZOOM_FLOOR, accentColorOf, addPage, adjacentPage, aimSpace2d, axisZoomFactor, clampView, clientToCanvas$1 as clientToCanvas, computeFitViewport, computeWheelAction, createSimulation, createVelocityTracker, createViewMarkerContribution, createViewMarkerLayer, createViewResolver, createViewportLayer, deriveParallaxView, fitToBounds, fitViewToBounds, fitViewToPage, fitZoom, fromPlane, gateLayer, grabViewMarker, interpolateView, isPlainObject, isRectAim, layoutPages, meanScale$1 as meanScale, movePage, nextPageId, normalizeView, normalizeZoom$1 as normalizeZoom, pageAt, pageHolding, pageInView, pageMembers, pageName, pageOfBounds, pagesBounds, pagesLayer, pagesOf, placedPagesOf, planeMap, planeMatrix, planeToPlane, pxExtent$1 as pxExtent, rectAim, rectFromPlane, rectToPlane, removePage, renamePage, resizePage, resolveDeviceProfile$1 as resolveDeviceProfile, scaleDelta$1 as scaleDelta, sceneNodeClientRect, screenAngleOf$1 as screenAngleOf, screenToWorld, setPages, stableStringify, standoff$1 as standoff, startThresholdDrag, toPlane, useAutoCenter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDragHandle, useDropZone, useElementSize, useFrameClock, useHandleDrag, useNodeOverlayFrame, usePoseRun, useSimulation, useVelocityTracker, useViewAnimation, useViewAnimationOn, useVisibleRaf$1 as useVisibleRaf, viewAxes, viewForAim, viewMarkerDragAction, viewToTransform, viewZoom, viewportWorldRect, watchDevicePixelRatio, wheelPan, wheelZoom, wheelZoomFactor, withinPxBox, withinPxRadius$1 as withinPxRadius, worldToScreen, zoomAt };
|
package/dist/canvas/Canvas.js
CHANGED
|
@@ -130,7 +130,8 @@ function CanvasInner(props, ref) {
|
|
|
130
130
|
useViewRegistrySurface(viewRegistry, layers, frame, {
|
|
131
131
|
requestRedraw,
|
|
132
132
|
hitTestExtrasIn,
|
|
133
|
-
clientToWorld: toWorld
|
|
133
|
+
clientToWorld: toWorld,
|
|
134
|
+
setView: viewState.setViewFromInput
|
|
134
135
|
});
|
|
135
136
|
const layersWithDebug = useComposedLayers(layers, {
|
|
136
137
|
viewRegistry,
|