@pixerate/editor 0.137.0 → 0.138.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/dist/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/index.cjs +57 -57
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +4 -4
- package/dist/{arrange-CKXK_hf7.d.cts → arrange-j_mLiFMO.d.cts} +1 -1
- package/dist/{arrange-BUREmgD9.d.ts → arrange-q5HQvnnB.d.ts} +1 -1
- package/dist/{bezier-CZ2AhjID.d.cts → bezier-CUaH8hcK.d.cts} +1 -1
- package/dist/{bezier-Dywv3Bw8.d.ts → bezier-DPmdGwgR.d.ts} +1 -1
- package/dist/{brushTypes-C7N3EBK7.d.cts → brushTypes-MX5UVs_m.d.cts} +27 -2
- package/dist/{brushTypes-C7N3EBK7.d.ts → brushTypes-MX5UVs_m.d.ts} +27 -2
- package/dist/{brushes-DJmUbIgz.d.ts → brushes-B1ABdDAs.d.ts} +2 -108
- package/dist/{brushes-CnvZSYYU.d.cts → brushes-DnIdJYxN.d.cts} +2 -108
- package/dist/{brushstrokeRender-IMFY3FF6.cjs → brushstrokeRender-PP6NTF6M.cjs} +52 -24
- package/dist/brushstrokeRender-PP6NTF6M.cjs.map +1 -0
- package/dist/{brushstrokeRender-2FAXA3XC.js → brushstrokeRender-QGEYJ4OZ.js} +40 -12
- package/dist/brushstrokeRender-QGEYJ4OZ.js.map +1 -0
- package/dist/{builtins-Cc-bH-3U.d.cts → builtins-BakDiKWf.d.cts} +3 -2
- package/dist/{builtins-ZU1GJnUA.d.ts → builtins-CE33vyv2.d.ts} +3 -2
- package/dist/canvas/index.cjs +16 -9
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +56 -11
- package/dist/canvas/index.d.ts +56 -11
- package/dist/canvas/index.js +10 -3
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-QBWEH3IM.cjs → chunk-3T5O225T.cjs} +391 -76
- package/dist/chunk-3T5O225T.cjs.map +1 -0
- package/dist/{chunk-PRSRYHQD.cjs → chunk-7MN75BXI.cjs} +36 -36
- package/dist/{chunk-PRSRYHQD.cjs.map → chunk-7MN75BXI.cjs.map} +1 -1
- package/dist/{chunk-EQQMGO42.js → chunk-C2J7GOMJ.js} +18 -5
- package/dist/chunk-C2J7GOMJ.js.map +1 -0
- package/dist/{chunk-2XS6LTUP.cjs → chunk-C46AZEBE.cjs} +104 -339
- package/dist/chunk-C46AZEBE.cjs.map +1 -0
- package/dist/{chunk-XN2NBLV5.cjs → chunk-CM3LJPR3.cjs} +82 -82
- package/dist/{chunk-XN2NBLV5.cjs.map → chunk-CM3LJPR3.cjs.map} +1 -1
- package/dist/{chunk-HUO3TI4C.js → chunk-CPSMARTX.js} +6 -241
- package/dist/chunk-CPSMARTX.js.map +1 -0
- package/dist/{chunk-KEENUAFN.cjs → chunk-DLLUOVQX.cjs} +18 -5
- package/dist/chunk-DLLUOVQX.cjs.map +1 -0
- package/dist/{chunk-LSXXAJG3.js → chunk-J7DSKTKB.js} +5 -4
- package/dist/chunk-J7DSKTKB.js.map +1 -0
- package/dist/{chunk-6S6362D2.js → chunk-OV7253FC.js} +2 -2
- package/dist/{chunk-5FSRTP6E.js → chunk-PQFVLOMR.js} +319 -4
- package/dist/chunk-PQFVLOMR.js.map +1 -0
- package/dist/{chunk-OIBIRXRG.js → chunk-PSPLRQL6.js} +2 -2
- package/dist/{chunk-SYT2TLQF.js → chunk-QBARQGSG.js} +2 -2
- package/dist/{chunk-5OOIUXNJ.cjs → chunk-SXOTFV3V.cjs} +6 -6
- package/dist/{chunk-5OOIUXNJ.cjs.map → chunk-SXOTFV3V.cjs.map} +1 -1
- package/dist/{chunk-DFSZO2B5.cjs → chunk-UFL5N4DK.cjs} +5 -4
- package/dist/chunk-UFL5N4DK.cjs.map +1 -0
- package/dist/{chunk-3D77LOBM.js → chunk-V45ZTW4R.js} +3 -3
- package/dist/{chunk-TLCTTQFF.cjs → chunk-VEHVXRJU.cjs} +17 -17
- package/dist/{chunk-TLCTTQFF.cjs.map → chunk-VEHVXRJU.cjs.map} +1 -1
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.d.cts +3 -3
- package/dist/commands/index.d.ts +3 -3
- package/dist/commands/index.js +1 -1
- package/dist/{export-DwnZ_hvQ.d.ts → export-BwFRiItd.d.ts} +4 -4
- package/dist/{export-CyJdfP_Z.d.cts → export-DuN3dpCg.d.cts} +4 -4
- package/dist/{blending-NgF3qo3d.d.ts → grain-COgYMMHv.d.ts} +58 -1
- package/dist/{blending-D7jCmjO6.d.cts → grain-GCt_O2kv.d.cts} +58 -1
- package/dist/image-editor/index.cjs +695 -677
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +11 -11
- package/dist/image-editor/index.d.ts +11 -11
- package/dist/image-editor/index.js +23 -5
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-a1KAW-qs.d.ts → opentype-T7bkbR2D.d.ts} +1 -1
- package/dist/{opentype-KR_jj6b_.d.cts → opentype-n99lqxEZ.d.cts} +1 -1
- package/dist/paint/index.cjs +21 -3
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +72 -7
- package/dist/paint/index.d.ts +72 -7
- package/dist/paint/index.js +20 -2
- package/dist/paint-editor/index.cjs +171 -171
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +75 -29
- package/dist/paint-editor/index.d.ts +75 -29
- package/dist/paint-editor/index.js +12 -12
- package/dist/{pathfinder-BHS4vQNm.d.cts → pathfinder-CQlldanv.d.cts} +2 -2
- package/dist/{pathfinder-BVvTIBMo.d.ts → pathfinder-D-V6JLSw.d.ts} +2 -2
- package/dist/{rand-Cw9VLrVC.d.cts → rand-D7nfeD1p.d.cts} +18 -2
- package/dist/{rand-8xbUb6ur.d.ts → rand-DJGxSq9d.d.ts} +18 -2
- package/dist/{svg-CSz3mzkw.d.ts → svg-CnDCpIy9.d.ts} +1 -1
- package/dist/{svg-DTb40ICU.d.cts → svg-DPJMUSNt.d.cts} +1 -1
- package/dist/vector/index.cjs +944 -944
- package/dist/vector/index.d.cts +10 -10
- package/dist/vector/index.d.ts +10 -10
- package/dist/vector/index.js +4 -4
- package/dist/{warp-DTOp0lON.d.cts → warp-C7rMWUgW.d.cts} +1 -1
- package/dist/{warp-pd7hrH4T.d.ts → warp-Doasjpyr.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +12 -5
- package/dist/brushstrokeRender-2FAXA3XC.js.map +0 -1
- package/dist/brushstrokeRender-IMFY3FF6.cjs.map +0 -1
- package/dist/chunk-2XS6LTUP.cjs.map +0 -1
- package/dist/chunk-5FSRTP6E.js.map +0 -1
- package/dist/chunk-DFSZO2B5.cjs.map +0 -1
- package/dist/chunk-EQQMGO42.js.map +0 -1
- package/dist/chunk-HUO3TI4C.js.map +0 -1
- package/dist/chunk-KEENUAFN.cjs.map +0 -1
- package/dist/chunk-LSXXAJG3.js.map +0 -1
- package/dist/chunk-QBWEH3IM.cjs.map +0 -1
- /package/dist/{chunk-6S6362D2.js.map → chunk-OV7253FC.js.map} +0 -0
- /package/dist/{chunk-OIBIRXRG.js.map → chunk-PSPLRQL6.js.map} +0 -0
- /package/dist/{chunk-SYT2TLQF.js.map → chunk-QBARQGSG.js.map} +0 -0
- /package/dist/{chunk-3D77LOBM.js.map → chunk-V45ZTW4R.js.map} +0 -0
package/dist/canvas/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { R as Rect, c as CanvasNode, X as XYPosition, f as CanvasEdge, I as IncrementalLayoutOptions, S as Side, g as CanvasLayoutOptions, h as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, d as CanvasNodeStyle, i as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, j as CanvasClipboardPayload, k as Position, P as Point, C as CanvasBrush, a as CanvasBrushPaint, e as CanvasBrushstroke, b as CanvasBrushPreset } from '../brushTypes-
|
|
2
|
-
export { l as CanvasBrushPaintMapping, m as CanvasBrushPaintStop, n as
|
|
1
|
+
import { R as Rect, c as CanvasNode, X as XYPosition, f as CanvasEdge, I as IncrementalLayoutOptions, S as Side, g as CanvasLayoutOptions, h as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, d as CanvasNodeStyle, i as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, j as CanvasClipboardPayload, k as Position, P as Point, C as CanvasBrush, a as CanvasBrushPaint, e as CanvasBrushstroke, b as CanvasBrushPreset } from '../brushTypes-MX5UVs_m.cjs';
|
|
2
|
+
export { l as CanvasBrushPaintMapping, m as CanvasBrushPaintStop, n as CanvasBrushPaper, o as CanvasBrushSettings, p as CanvasDockingCallbacks, q as CollapseNodeOptions, r as DisplacementDirection, s as DockStrategy, E as ExplodeNodeOptions, t as ExplosionSnapshot, G as GraphDifferences, u as TrajectoryPoint } from '../brushTypes-MX5UVs_m.cjs';
|
|
3
3
|
import { C as Clock, b as AnimationPlayerState, A as AnimationPlayer } from '../player-CmbY3218.cjs';
|
|
4
4
|
export { a as AnimationPlayerOptions, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-CmbY3218.cjs';
|
|
5
|
-
import { b as CanvasNodeUpdate, N as NodeRectOptions, A as AlignEdge, c as AlignNodesOptions, D as DistributeAxis, a as DistributeMode, d as DistributeNodesOptions, S as SizeDimension, M as MatchSizeOptions, Z as ZOrderOperation, C as CanvasArrangeAction } from '../arrange-
|
|
6
|
-
export { e as ArrangeShortcutBinding, f as DEFAULT_ARRANGE_SHORTCUTS, L as LOCKED_DATA_KEY, g as LOCKED_PREVIOUS_FLAGS_KEY, h as alignNodes, i as applyNodeUpdates, j as createNodeLookup, k as distributeNodes, l as getAbsolutePosition, m as getNodeRect, n as getNodeSize, o as invertNodeUpdates, p as isLocked, q as lockNodes, r as matchArrangeShortcut, s as matchSize, t as readStyleSize, u as reorderNodes, v as toggleLockNodes, w as unlockNodes, x as withStyleSize } from '../arrange-
|
|
5
|
+
import { b as CanvasNodeUpdate, N as NodeRectOptions, A as AlignEdge, c as AlignNodesOptions, D as DistributeAxis, a as DistributeMode, d as DistributeNodesOptions, S as SizeDimension, M as MatchSizeOptions, Z as ZOrderOperation, C as CanvasArrangeAction } from '../arrange-j_mLiFMO.cjs';
|
|
6
|
+
export { e as ArrangeShortcutBinding, f as DEFAULT_ARRANGE_SHORTCUTS, L as LOCKED_DATA_KEY, g as LOCKED_PREVIOUS_FLAGS_KEY, h as alignNodes, i as applyNodeUpdates, j as createNodeLookup, k as distributeNodes, l as getAbsolutePosition, m as getNodeRect, n as getNodeSize, o as invertNodeUpdates, p as isLocked, q as lockNodes, r as matchArrangeShortcut, s as matchSize, t as readStyleSize, u as reorderNodes, v as toggleLockNodes, w as unlockNodes, x as withStyleSize } from '../arrange-j_mLiFMO.cjs';
|
|
7
7
|
import { C as Command, M as MergedExecutionOptions } from '../types-DsiXGmjo.cjs';
|
|
8
|
-
import { S as ShapeDescription, B as BezierPath, b as PolygonFillRule, e as PolygonRing, f as ShapeSize, a as BezierPathInput, g as PathShape, C as CanvasShapeEffect } from '../bezier-
|
|
9
|
-
export { A as AffineMatrix, h as BezierCommand, d as BezierContour, i as BezierPathToSvgOptions, c as BezierSegment, E as EllipseShape, F as FlattenOptions, G as GetShapeRenderDataOptions, M as MultiPolygon, j as PathCommand, k as PathPointAtLength, P as PolygonBooleanOperation, l as PolygonBooleanOptions, m as PolygonInput, n as PolygonOperand, o as PolygonPiece, p as PolygonToPathOptions, q as PolygonWithHoles, R as RectShape, r as RegularPolygonShape, s as SHAPE_KINDS, t as ShapeKind, u as ShapePaint, v as ShapeRenderData, w as StarShape, x as arcToCubics, y as bezierPathBounds, z as bezierPathLength, D as bezierPathPointAtLength, H as bezierPathSignedArea, I as bezierPathToSvg, J as closeContour, K as contourSignedArea, L as contoursToPath, N as countPathSegments, O as distanceToBezierPath, Q as dividePolygons, T as flattenSvgPath, U as formatNumber, V as getShapeRenderData, W as getShapeSvg, X as intersectPolygons, Y as isShapeDescription, Z as multiPolygonArea, _ as multiPolygonBounds, $ as parseSvgPath, a0 as pathToContours, a1 as pointInBezierPath, a2 as pointInMultiPolygon, a3 as pointInRings, a4 as polygonArea, a5 as polygonBoolean, a6 as polygonToSvgPath, a7 as ringSignedArea, a8 as segmentBounds, a9 as segmentCurvature, aa as segmentDerivative, ab as segmentExtrema, ac as segmentLength, ad as segmentNearest, ae as segmentParamAtLength, af as segmentPoint, ag as segmentTangent, ah as shapeToPolygon, ai as simplifyRing, aj as splitSegment, ak as subSegment, al as subtractPolygons, am as toBezierPath, an as transformBezierPath, ao as trimSegments, ap as unionPolygons, aq as windingNumber, ar as xorPolygons } from '../bezier-
|
|
10
|
-
import { S as StrokeJoin, a as StrokeCap } from '../pathfinder-
|
|
11
|
-
export { D as DashedPath, d as DividePathsResult, O as OffsetPathOptions, e as OutlineStrokeOptions, f as PATHFINDER_OPERATIONS, g as PathBooleanOperation, h as PathBooleanResult, i as PathOperand, j as PathOperandInput, k as PathOpsError, l as PathOpsOptions, m as PathOpsReport, n as PathPiece, o as PathSelectResult, b as PathfinderOperation, p as PathfinderPiece, q as PathfinderResult, c as PathfinderShape, r as PlanarChain, s as PlanarFace, t as PlanarInput, P as PlanarMap, u as PlanarMapOptions, v as PlanarSplitEdge, w as PlanarSplitResult, x as SegmentIntersection, y as bezierPathArea, z as contourEnclosesArea, A as cutOutPiece, B as dashContours, C as dividePaths, E as excludePaths, F as interiorPoint, G as intersectPaths, H as normalizeBezierPath, I as offsetPath, J as outlineStroke, K as pathBoolean, L as pathBooleanSelect, M as pathfinder, N as planarSplit, Q as segmentIntersections, R as strokeOutlineRings, T as subtractPaths, U as unitePaths } from '../pathfinder-
|
|
8
|
+
import { S as ShapeDescription, B as BezierPath, b as PolygonFillRule, e as PolygonRing, f as ShapeSize, a as BezierPathInput, g as PathShape, C as CanvasShapeEffect } from '../bezier-CUaH8hcK.cjs';
|
|
9
|
+
export { A as AffineMatrix, h as BezierCommand, d as BezierContour, i as BezierPathToSvgOptions, c as BezierSegment, E as EllipseShape, F as FlattenOptions, G as GetShapeRenderDataOptions, M as MultiPolygon, j as PathCommand, k as PathPointAtLength, P as PolygonBooleanOperation, l as PolygonBooleanOptions, m as PolygonInput, n as PolygonOperand, o as PolygonPiece, p as PolygonToPathOptions, q as PolygonWithHoles, R as RectShape, r as RegularPolygonShape, s as SHAPE_KINDS, t as ShapeKind, u as ShapePaint, v as ShapeRenderData, w as StarShape, x as arcToCubics, y as bezierPathBounds, z as bezierPathLength, D as bezierPathPointAtLength, H as bezierPathSignedArea, I as bezierPathToSvg, J as closeContour, K as contourSignedArea, L as contoursToPath, N as countPathSegments, O as distanceToBezierPath, Q as dividePolygons, T as flattenSvgPath, U as formatNumber, V as getShapeRenderData, W as getShapeSvg, X as intersectPolygons, Y as isShapeDescription, Z as multiPolygonArea, _ as multiPolygonBounds, $ as parseSvgPath, a0 as pathToContours, a1 as pointInBezierPath, a2 as pointInMultiPolygon, a3 as pointInRings, a4 as polygonArea, a5 as polygonBoolean, a6 as polygonToSvgPath, a7 as ringSignedArea, a8 as segmentBounds, a9 as segmentCurvature, aa as segmentDerivative, ab as segmentExtrema, ac as segmentLength, ad as segmentNearest, ae as segmentParamAtLength, af as segmentPoint, ag as segmentTangent, ah as shapeToPolygon, ai as simplifyRing, aj as splitSegment, ak as subSegment, al as subtractPolygons, am as toBezierPath, an as transformBezierPath, ao as trimSegments, ap as unionPolygons, aq as windingNumber, ar as xorPolygons } from '../bezier-CUaH8hcK.cjs';
|
|
10
|
+
import { S as StrokeJoin, a as StrokeCap } from '../pathfinder-CQlldanv.cjs';
|
|
11
|
+
export { D as DashedPath, d as DividePathsResult, O as OffsetPathOptions, e as OutlineStrokeOptions, f as PATHFINDER_OPERATIONS, g as PathBooleanOperation, h as PathBooleanResult, i as PathOperand, j as PathOperandInput, k as PathOpsError, l as PathOpsOptions, m as PathOpsReport, n as PathPiece, o as PathSelectResult, b as PathfinderOperation, p as PathfinderPiece, q as PathfinderResult, c as PathfinderShape, r as PlanarChain, s as PlanarFace, t as PlanarInput, P as PlanarMap, u as PlanarMapOptions, v as PlanarSplitEdge, w as PlanarSplitResult, x as SegmentIntersection, y as bezierPathArea, z as contourEnclosesArea, A as cutOutPiece, B as dashContours, C as dividePaths, E as excludePaths, F as interiorPoint, G as intersectPaths, H as normalizeBezierPath, I as offsetPath, J as outlineStroke, K as pathBoolean, L as pathBooleanSelect, M as pathfinder, N as planarSplit, Q as segmentIntersections, R as strokeOutlineRings, T as subtractPaths, U as unitePaths } from '../pathfinder-CQlldanv.cjs';
|
|
12
12
|
import { d as TokenModeContext, r as TokenType, o as TokenScope, f as TokenLiteral, c as TokenVariable, e as TokenResolution, T as TokenState } from '../model-C1zApQM8.cjs';
|
|
13
13
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.cjs';
|
|
14
14
|
export { A as ANIMATION_EASING_LABELS, a as ANIMATION_EASING_PRESETS, c as AnimationEasingPreset, C as CUBIC_BEZIER_PRESETS, d as CubicBezierEasing, E as ElasticEasing, S as SPRING_PRESETS, e as SpringEasing, f as cubicBezierAt, g as easingFromInfluence, h as easingLabel, i as easingToCss, j as elasticAt, k as evaluateEasing, l as isAnimationEasing, p as parseCssEasing, r as resolveEasing, m as reverseCubicBezier, s as springAt, n as springSettleMs } from '../easing-lM0Xo9Ni.cjs';
|
|
@@ -2765,6 +2765,11 @@ interface FreehandStrokeStyle {
|
|
|
2765
2765
|
* paths, exactly as before.
|
|
2766
2766
|
*/
|
|
2767
2767
|
brush?: CanvasBrush;
|
|
2768
|
+
/**
|
|
2769
|
+
* Brush diameter in canvas units for brushed strokes. Default: the preset's own size (tip
|
|
2770
|
+
* settings: their `size`, else `width`). Set it when the user picks a size.
|
|
2771
|
+
*/
|
|
2772
|
+
brushSize?: number;
|
|
2768
2773
|
/**
|
|
2769
2774
|
* Gradient paint (or one colour) for a brushed stroke instead of `color`, sampled dab by dab
|
|
2770
2775
|
* along the path; `color` still gives the alpha and fills `paint` stops. Only with `brush`.
|
|
@@ -2893,8 +2898,21 @@ interface CanvasBrushstrokeRenderer {
|
|
|
2893
2898
|
resolveCanvasBrush(brush: CanvasBrush, width: number): unknown;
|
|
2894
2899
|
/** Throws for paint that is not a colour or gradient paint a canvas stroke can use; the result is the paint engine's `PaintSource`. */
|
|
2895
2900
|
resolveCanvasPaint(paint: unknown): unknown;
|
|
2896
|
-
renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number
|
|
2897
|
-
|
|
2901
|
+
renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number, place?: {
|
|
2902
|
+
origin?: {
|
|
2903
|
+
x: number;
|
|
2904
|
+
y: number;
|
|
2905
|
+
};
|
|
2906
|
+
unit?: number;
|
|
2907
|
+
}): CanvasBrushstrokeImage | null;
|
|
2908
|
+
brushSwatchNow(brush: CanvasBrush, options: CanvasBrushSwatchOptions): string;
|
|
2909
|
+
brushedShapeSvgNow(shape: BrushedPathShape, size: ShapeSize, scale: number, place?: {
|
|
2910
|
+
origin?: {
|
|
2911
|
+
x: number;
|
|
2912
|
+
y: number;
|
|
2913
|
+
};
|
|
2914
|
+
unit?: number;
|
|
2915
|
+
}): string;
|
|
2898
2916
|
}
|
|
2899
2917
|
/**
|
|
2900
2918
|
* Loads the brushstroke renderer (the paint engine's dry brushes, the paint presets and a CSS
|
|
@@ -2916,7 +2934,19 @@ declare function validateCanvasBrushPaint(paint: CanvasBrushPaint): Promise<void
|
|
|
2916
2934
|
interface RenderShapeBrushstrokeOptions {
|
|
2917
2935
|
/** Image pixels per path unit; pass `brushstrokeScaleBucket(zoom × node scale, devicePixelRatio)` (default 1). */
|
|
2918
2936
|
scale?: number;
|
|
2937
|
+
/**
|
|
2938
|
+
* Where the path's (0, 0) is on the canvas, and canvas units per path unit (the node's
|
|
2939
|
+
* absolute position and width ÷ view box width). The paper grain is sampled there, so
|
|
2940
|
+
* neighbouring strokes share one sheet of paper. Default 0, 0 and 1.
|
|
2941
|
+
*/
|
|
2942
|
+
origin?: {
|
|
2943
|
+
x: number;
|
|
2944
|
+
y: number;
|
|
2945
|
+
};
|
|
2946
|
+
unit?: number;
|
|
2919
2947
|
}
|
|
2948
|
+
/** A stable character seed for a stroke (FNV-1a of its id). */
|
|
2949
|
+
declare function brushstrokeSeed(id: string): number;
|
|
2920
2950
|
/**
|
|
2921
2951
|
* Renders a brushed path shape to a cached PNG placed in path coordinates, or null for a shape
|
|
2922
2952
|
* without a brush or an empty path. Throws for an unknown or non-dry brush.
|
|
@@ -2928,6 +2958,21 @@ declare function renderShapeBrushstroke(shape: ShapeDescription, options?: Rende
|
|
|
2928
2958
|
* null (export them as paths).
|
|
2929
2959
|
*/
|
|
2930
2960
|
declare function getBrushedShapeSvg(shape: ShapeDescription, size: ShapeSize, options?: RenderShapeBrushstrokeOptions): Promise<string | null>;
|
|
2961
|
+
interface CanvasBrushSwatchOptions {
|
|
2962
|
+
/** Swatch size in pixels (default 96 × 24). */
|
|
2963
|
+
width?: number;
|
|
2964
|
+
height?: number;
|
|
2965
|
+
/** CSS colour (default `#1f2937`). */
|
|
2966
|
+
color?: string;
|
|
2967
|
+
/** Image pixels per swatch pixel (default 2, for sharp swatches on high-density screens). */
|
|
2968
|
+
scale?: number;
|
|
2969
|
+
}
|
|
2970
|
+
/**
|
|
2971
|
+
* A preview of a brush for a brush menu: a short wavy stroke with the brush's character (jitter
|
|
2972
|
+
* and grain), its size capped to fit, as a PNG data URL ('' when nothing renders). Throws for an
|
|
2973
|
+
* unknown or non-dry brush.
|
|
2974
|
+
*/
|
|
2975
|
+
declare function renderCanvasBrushSwatch(brush: CanvasBrush, options?: CanvasBrushSwatchOptions): Promise<string>;
|
|
2931
2976
|
|
|
2932
2977
|
/**
|
|
2933
2978
|
* Headless controller managing freehand drawing lifecycle, tool selection,
|
|
@@ -4038,4 +4083,4 @@ interface CanvasEffectsToolProviderOptions {
|
|
|
4038
4083
|
/** The effect tools for a canvas (see the module comment). */
|
|
4039
4084
|
declare function createCanvasEffectsToolProvider(controller: CanvasEffectsController, options?: CanvasEffectsToolProviderOptions): AgentToolProvider;
|
|
4040
4085
|
|
|
4041
|
-
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, type BrushedPathShape, CANVAS_CAPTURE_CHROME_SELECTORS, CANVAS_CAPTURE_OVERLAY_SELECTORS, CANVAS_CAPTURE_VIEWPORT_SELECTOR, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_EFFECT_PLACES, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, CanvasBrushstroke, type CanvasBrushstrokeImage, type CanvasBrushstrokeRenderer, type CanvasCaptureSurfaceOptions, type CanvasCaptureToolProviderOptions, type CanvasCaptureViewport, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, type CanvasEffectClock, type CanvasEffectPlace, type CanvasEffectTarget, type CanvasEffectsController, type CanvasEffectsControllerOptions, type CanvasEffectsToolProviderOptions, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasSceneTransition, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, CanvasShapeEffect, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type DrawStrokeInput, type DrawStrokeResult, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandPenSample, type FreehandPointerLike, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PathShape, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type RenderShapeBrushstrokeOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasEffectsPool, canvasHeight, canvasNodeCaptureRect, canvasNodeEffect, captureCanvasView, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasCaptureSurface, createCanvasCaptureToolProvider, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasEffectsController, createCanvasEffectsToolProvider, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, freehandBrushstroke, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getBrushedShapeSvg, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isBrushedShape, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasBrushes, listCanvasComponents, loadCanvasBrushstrokeRenderer, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pathDataToPolyline, pieScene, placeBeside, playCanvasSceneTransition, playWebAnimations, pointerPenSample, positionToSide, profileAlongPolyline, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, renderShapeBrushstroke, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runCanvasNodeEffect, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, transitionCanvasView, updateKeyframe, validateCanvasBrush, validateCanvasBrushPaint, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
|
4086
|
+
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, type BrushedPathShape, CANVAS_CAPTURE_CHROME_SELECTORS, CANVAS_CAPTURE_OVERLAY_SELECTORS, CANVAS_CAPTURE_VIEWPORT_SELECTOR, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_EFFECT_PLACES, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, type CanvasBrushSwatchOptions, CanvasBrushstroke, type CanvasBrushstrokeImage, type CanvasBrushstrokeRenderer, type CanvasCaptureSurfaceOptions, type CanvasCaptureToolProviderOptions, type CanvasCaptureViewport, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, type CanvasEffectClock, type CanvasEffectPlace, type CanvasEffectTarget, type CanvasEffectsController, type CanvasEffectsControllerOptions, type CanvasEffectsToolProviderOptions, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasSceneTransition, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, CanvasShapeEffect, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type DrawStrokeInput, type DrawStrokeResult, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandPenSample, type FreehandPointerLike, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PathShape, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type RenderShapeBrushstrokeOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, brushstrokeSeed, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasEffectsPool, canvasHeight, canvasNodeCaptureRect, canvasNodeEffect, captureCanvasView, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasCaptureSurface, createCanvasCaptureToolProvider, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasEffectsController, createCanvasEffectsToolProvider, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, freehandBrushstroke, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getBrushedShapeSvg, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isBrushedShape, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasBrushes, listCanvasComponents, loadCanvasBrushstrokeRenderer, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pathDataToPolyline, pieScene, placeBeside, playCanvasSceneTransition, playWebAnimations, pointerPenSample, positionToSide, profileAlongPolyline, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, renderCanvasBrushSwatch, renderShapeBrushstroke, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runCanvasNodeEffect, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, transitionCanvasView, updateKeyframe, validateCanvasBrush, validateCanvasBrushPaint, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { R as Rect, c as CanvasNode, X as XYPosition, f as CanvasEdge, I as IncrementalLayoutOptions, S as Side, g as CanvasLayoutOptions, h as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, d as CanvasNodeStyle, i as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, j as CanvasClipboardPayload, k as Position, P as Point, C as CanvasBrush, a as CanvasBrushPaint, e as CanvasBrushstroke, b as CanvasBrushPreset } from '../brushTypes-
|
|
2
|
-
export { l as CanvasBrushPaintMapping, m as CanvasBrushPaintStop, n as
|
|
1
|
+
import { R as Rect, c as CanvasNode, X as XYPosition, f as CanvasEdge, I as IncrementalLayoutOptions, S as Side, g as CanvasLayoutOptions, h as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, d as CanvasNodeStyle, i as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, j as CanvasClipboardPayload, k as Position, P as Point, C as CanvasBrush, a as CanvasBrushPaint, e as CanvasBrushstroke, b as CanvasBrushPreset } from '../brushTypes-MX5UVs_m.js';
|
|
2
|
+
export { l as CanvasBrushPaintMapping, m as CanvasBrushPaintStop, n as CanvasBrushPaper, o as CanvasBrushSettings, p as CanvasDockingCallbacks, q as CollapseNodeOptions, r as DisplacementDirection, s as DockStrategy, E as ExplodeNodeOptions, t as ExplosionSnapshot, G as GraphDifferences, u as TrajectoryPoint } from '../brushTypes-MX5UVs_m.js';
|
|
3
3
|
import { C as Clock, b as AnimationPlayerState, A as AnimationPlayer } from '../player-BK2kKbfd.js';
|
|
4
4
|
export { a as AnimationPlayerOptions, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-BK2kKbfd.js';
|
|
5
|
-
import { b as CanvasNodeUpdate, N as NodeRectOptions, A as AlignEdge, c as AlignNodesOptions, D as DistributeAxis, a as DistributeMode, d as DistributeNodesOptions, S as SizeDimension, M as MatchSizeOptions, Z as ZOrderOperation, C as CanvasArrangeAction } from '../arrange-
|
|
6
|
-
export { e as ArrangeShortcutBinding, f as DEFAULT_ARRANGE_SHORTCUTS, L as LOCKED_DATA_KEY, g as LOCKED_PREVIOUS_FLAGS_KEY, h as alignNodes, i as applyNodeUpdates, j as createNodeLookup, k as distributeNodes, l as getAbsolutePosition, m as getNodeRect, n as getNodeSize, o as invertNodeUpdates, p as isLocked, q as lockNodes, r as matchArrangeShortcut, s as matchSize, t as readStyleSize, u as reorderNodes, v as toggleLockNodes, w as unlockNodes, x as withStyleSize } from '../arrange-
|
|
5
|
+
import { b as CanvasNodeUpdate, N as NodeRectOptions, A as AlignEdge, c as AlignNodesOptions, D as DistributeAxis, a as DistributeMode, d as DistributeNodesOptions, S as SizeDimension, M as MatchSizeOptions, Z as ZOrderOperation, C as CanvasArrangeAction } from '../arrange-q5HQvnnB.js';
|
|
6
|
+
export { e as ArrangeShortcutBinding, f as DEFAULT_ARRANGE_SHORTCUTS, L as LOCKED_DATA_KEY, g as LOCKED_PREVIOUS_FLAGS_KEY, h as alignNodes, i as applyNodeUpdates, j as createNodeLookup, k as distributeNodes, l as getAbsolutePosition, m as getNodeRect, n as getNodeSize, o as invertNodeUpdates, p as isLocked, q as lockNodes, r as matchArrangeShortcut, s as matchSize, t as readStyleSize, u as reorderNodes, v as toggleLockNodes, w as unlockNodes, x as withStyleSize } from '../arrange-q5HQvnnB.js';
|
|
7
7
|
import { C as Command, M as MergedExecutionOptions } from '../types-DsiXGmjo.js';
|
|
8
|
-
import { S as ShapeDescription, B as BezierPath, b as PolygonFillRule, e as PolygonRing, f as ShapeSize, a as BezierPathInput, g as PathShape, C as CanvasShapeEffect } from '../bezier-
|
|
9
|
-
export { A as AffineMatrix, h as BezierCommand, d as BezierContour, i as BezierPathToSvgOptions, c as BezierSegment, E as EllipseShape, F as FlattenOptions, G as GetShapeRenderDataOptions, M as MultiPolygon, j as PathCommand, k as PathPointAtLength, P as PolygonBooleanOperation, l as PolygonBooleanOptions, m as PolygonInput, n as PolygonOperand, o as PolygonPiece, p as PolygonToPathOptions, q as PolygonWithHoles, R as RectShape, r as RegularPolygonShape, s as SHAPE_KINDS, t as ShapeKind, u as ShapePaint, v as ShapeRenderData, w as StarShape, x as arcToCubics, y as bezierPathBounds, z as bezierPathLength, D as bezierPathPointAtLength, H as bezierPathSignedArea, I as bezierPathToSvg, J as closeContour, K as contourSignedArea, L as contoursToPath, N as countPathSegments, O as distanceToBezierPath, Q as dividePolygons, T as flattenSvgPath, U as formatNumber, V as getShapeRenderData, W as getShapeSvg, X as intersectPolygons, Y as isShapeDescription, Z as multiPolygonArea, _ as multiPolygonBounds, $ as parseSvgPath, a0 as pathToContours, a1 as pointInBezierPath, a2 as pointInMultiPolygon, a3 as pointInRings, a4 as polygonArea, a5 as polygonBoolean, a6 as polygonToSvgPath, a7 as ringSignedArea, a8 as segmentBounds, a9 as segmentCurvature, aa as segmentDerivative, ab as segmentExtrema, ac as segmentLength, ad as segmentNearest, ae as segmentParamAtLength, af as segmentPoint, ag as segmentTangent, ah as shapeToPolygon, ai as simplifyRing, aj as splitSegment, ak as subSegment, al as subtractPolygons, am as toBezierPath, an as transformBezierPath, ao as trimSegments, ap as unionPolygons, aq as windingNumber, ar as xorPolygons } from '../bezier-
|
|
10
|
-
import { S as StrokeJoin, a as StrokeCap } from '../pathfinder-
|
|
11
|
-
export { D as DashedPath, d as DividePathsResult, O as OffsetPathOptions, e as OutlineStrokeOptions, f as PATHFINDER_OPERATIONS, g as PathBooleanOperation, h as PathBooleanResult, i as PathOperand, j as PathOperandInput, k as PathOpsError, l as PathOpsOptions, m as PathOpsReport, n as PathPiece, o as PathSelectResult, b as PathfinderOperation, p as PathfinderPiece, q as PathfinderResult, c as PathfinderShape, r as PlanarChain, s as PlanarFace, t as PlanarInput, P as PlanarMap, u as PlanarMapOptions, v as PlanarSplitEdge, w as PlanarSplitResult, x as SegmentIntersection, y as bezierPathArea, z as contourEnclosesArea, A as cutOutPiece, B as dashContours, C as dividePaths, E as excludePaths, F as interiorPoint, G as intersectPaths, H as normalizeBezierPath, I as offsetPath, J as outlineStroke, K as pathBoolean, L as pathBooleanSelect, M as pathfinder, N as planarSplit, Q as segmentIntersections, R as strokeOutlineRings, T as subtractPaths, U as unitePaths } from '../pathfinder-
|
|
8
|
+
import { S as ShapeDescription, B as BezierPath, b as PolygonFillRule, e as PolygonRing, f as ShapeSize, a as BezierPathInput, g as PathShape, C as CanvasShapeEffect } from '../bezier-DPmdGwgR.js';
|
|
9
|
+
export { A as AffineMatrix, h as BezierCommand, d as BezierContour, i as BezierPathToSvgOptions, c as BezierSegment, E as EllipseShape, F as FlattenOptions, G as GetShapeRenderDataOptions, M as MultiPolygon, j as PathCommand, k as PathPointAtLength, P as PolygonBooleanOperation, l as PolygonBooleanOptions, m as PolygonInput, n as PolygonOperand, o as PolygonPiece, p as PolygonToPathOptions, q as PolygonWithHoles, R as RectShape, r as RegularPolygonShape, s as SHAPE_KINDS, t as ShapeKind, u as ShapePaint, v as ShapeRenderData, w as StarShape, x as arcToCubics, y as bezierPathBounds, z as bezierPathLength, D as bezierPathPointAtLength, H as bezierPathSignedArea, I as bezierPathToSvg, J as closeContour, K as contourSignedArea, L as contoursToPath, N as countPathSegments, O as distanceToBezierPath, Q as dividePolygons, T as flattenSvgPath, U as formatNumber, V as getShapeRenderData, W as getShapeSvg, X as intersectPolygons, Y as isShapeDescription, Z as multiPolygonArea, _ as multiPolygonBounds, $ as parseSvgPath, a0 as pathToContours, a1 as pointInBezierPath, a2 as pointInMultiPolygon, a3 as pointInRings, a4 as polygonArea, a5 as polygonBoolean, a6 as polygonToSvgPath, a7 as ringSignedArea, a8 as segmentBounds, a9 as segmentCurvature, aa as segmentDerivative, ab as segmentExtrema, ac as segmentLength, ad as segmentNearest, ae as segmentParamAtLength, af as segmentPoint, ag as segmentTangent, ah as shapeToPolygon, ai as simplifyRing, aj as splitSegment, ak as subSegment, al as subtractPolygons, am as toBezierPath, an as transformBezierPath, ao as trimSegments, ap as unionPolygons, aq as windingNumber, ar as xorPolygons } from '../bezier-DPmdGwgR.js';
|
|
10
|
+
import { S as StrokeJoin, a as StrokeCap } from '../pathfinder-D-V6JLSw.js';
|
|
11
|
+
export { D as DashedPath, d as DividePathsResult, O as OffsetPathOptions, e as OutlineStrokeOptions, f as PATHFINDER_OPERATIONS, g as PathBooleanOperation, h as PathBooleanResult, i as PathOperand, j as PathOperandInput, k as PathOpsError, l as PathOpsOptions, m as PathOpsReport, n as PathPiece, o as PathSelectResult, b as PathfinderOperation, p as PathfinderPiece, q as PathfinderResult, c as PathfinderShape, r as PlanarChain, s as PlanarFace, t as PlanarInput, P as PlanarMap, u as PlanarMapOptions, v as PlanarSplitEdge, w as PlanarSplitResult, x as SegmentIntersection, y as bezierPathArea, z as contourEnclosesArea, A as cutOutPiece, B as dashContours, C as dividePaths, E as excludePaths, F as interiorPoint, G as intersectPaths, H as normalizeBezierPath, I as offsetPath, J as outlineStroke, K as pathBoolean, L as pathBooleanSelect, M as pathfinder, N as planarSplit, Q as segmentIntersections, R as strokeOutlineRings, T as subtractPaths, U as unitePaths } from '../pathfinder-D-V6JLSw.js';
|
|
12
12
|
import { d as TokenModeContext, r as TokenType, o as TokenScope, f as TokenLiteral, c as TokenVariable, e as TokenResolution, T as TokenState } from '../model-C1zApQM8.js';
|
|
13
13
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
14
14
|
export { A as ANIMATION_EASING_LABELS, a as ANIMATION_EASING_PRESETS, c as AnimationEasingPreset, C as CUBIC_BEZIER_PRESETS, d as CubicBezierEasing, E as ElasticEasing, S as SPRING_PRESETS, e as SpringEasing, f as cubicBezierAt, g as easingFromInfluence, h as easingLabel, i as easingToCss, j as elasticAt, k as evaluateEasing, l as isAnimationEasing, p as parseCssEasing, r as resolveEasing, m as reverseCubicBezier, s as springAt, n as springSettleMs } from '../easing-lM0Xo9Ni.js';
|
|
@@ -2765,6 +2765,11 @@ interface FreehandStrokeStyle {
|
|
|
2765
2765
|
* paths, exactly as before.
|
|
2766
2766
|
*/
|
|
2767
2767
|
brush?: CanvasBrush;
|
|
2768
|
+
/**
|
|
2769
|
+
* Brush diameter in canvas units for brushed strokes. Default: the preset's own size (tip
|
|
2770
|
+
* settings: their `size`, else `width`). Set it when the user picks a size.
|
|
2771
|
+
*/
|
|
2772
|
+
brushSize?: number;
|
|
2768
2773
|
/**
|
|
2769
2774
|
* Gradient paint (or one colour) for a brushed stroke instead of `color`, sampled dab by dab
|
|
2770
2775
|
* along the path; `color` still gives the alpha and fills `paint` stops. Only with `brush`.
|
|
@@ -2893,8 +2898,21 @@ interface CanvasBrushstrokeRenderer {
|
|
|
2893
2898
|
resolveCanvasBrush(brush: CanvasBrush, width: number): unknown;
|
|
2894
2899
|
/** Throws for paint that is not a colour or gradient paint a canvas stroke can use; the result is the paint engine's `PaintSource`. */
|
|
2895
2900
|
resolveCanvasPaint(paint: unknown): unknown;
|
|
2896
|
-
renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number
|
|
2897
|
-
|
|
2901
|
+
renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number, place?: {
|
|
2902
|
+
origin?: {
|
|
2903
|
+
x: number;
|
|
2904
|
+
y: number;
|
|
2905
|
+
};
|
|
2906
|
+
unit?: number;
|
|
2907
|
+
}): CanvasBrushstrokeImage | null;
|
|
2908
|
+
brushSwatchNow(brush: CanvasBrush, options: CanvasBrushSwatchOptions): string;
|
|
2909
|
+
brushedShapeSvgNow(shape: BrushedPathShape, size: ShapeSize, scale: number, place?: {
|
|
2910
|
+
origin?: {
|
|
2911
|
+
x: number;
|
|
2912
|
+
y: number;
|
|
2913
|
+
};
|
|
2914
|
+
unit?: number;
|
|
2915
|
+
}): string;
|
|
2898
2916
|
}
|
|
2899
2917
|
/**
|
|
2900
2918
|
* Loads the brushstroke renderer (the paint engine's dry brushes, the paint presets and a CSS
|
|
@@ -2916,7 +2934,19 @@ declare function validateCanvasBrushPaint(paint: CanvasBrushPaint): Promise<void
|
|
|
2916
2934
|
interface RenderShapeBrushstrokeOptions {
|
|
2917
2935
|
/** Image pixels per path unit; pass `brushstrokeScaleBucket(zoom × node scale, devicePixelRatio)` (default 1). */
|
|
2918
2936
|
scale?: number;
|
|
2937
|
+
/**
|
|
2938
|
+
* Where the path's (0, 0) is on the canvas, and canvas units per path unit (the node's
|
|
2939
|
+
* absolute position and width ÷ view box width). The paper grain is sampled there, so
|
|
2940
|
+
* neighbouring strokes share one sheet of paper. Default 0, 0 and 1.
|
|
2941
|
+
*/
|
|
2942
|
+
origin?: {
|
|
2943
|
+
x: number;
|
|
2944
|
+
y: number;
|
|
2945
|
+
};
|
|
2946
|
+
unit?: number;
|
|
2919
2947
|
}
|
|
2948
|
+
/** A stable character seed for a stroke (FNV-1a of its id). */
|
|
2949
|
+
declare function brushstrokeSeed(id: string): number;
|
|
2920
2950
|
/**
|
|
2921
2951
|
* Renders a brushed path shape to a cached PNG placed in path coordinates, or null for a shape
|
|
2922
2952
|
* without a brush or an empty path. Throws for an unknown or non-dry brush.
|
|
@@ -2928,6 +2958,21 @@ declare function renderShapeBrushstroke(shape: ShapeDescription, options?: Rende
|
|
|
2928
2958
|
* null (export them as paths).
|
|
2929
2959
|
*/
|
|
2930
2960
|
declare function getBrushedShapeSvg(shape: ShapeDescription, size: ShapeSize, options?: RenderShapeBrushstrokeOptions): Promise<string | null>;
|
|
2961
|
+
interface CanvasBrushSwatchOptions {
|
|
2962
|
+
/** Swatch size in pixels (default 96 × 24). */
|
|
2963
|
+
width?: number;
|
|
2964
|
+
height?: number;
|
|
2965
|
+
/** CSS colour (default `#1f2937`). */
|
|
2966
|
+
color?: string;
|
|
2967
|
+
/** Image pixels per swatch pixel (default 2, for sharp swatches on high-density screens). */
|
|
2968
|
+
scale?: number;
|
|
2969
|
+
}
|
|
2970
|
+
/**
|
|
2971
|
+
* A preview of a brush for a brush menu: a short wavy stroke with the brush's character (jitter
|
|
2972
|
+
* and grain), its size capped to fit, as a PNG data URL ('' when nothing renders). Throws for an
|
|
2973
|
+
* unknown or non-dry brush.
|
|
2974
|
+
*/
|
|
2975
|
+
declare function renderCanvasBrushSwatch(brush: CanvasBrush, options?: CanvasBrushSwatchOptions): Promise<string>;
|
|
2931
2976
|
|
|
2932
2977
|
/**
|
|
2933
2978
|
* Headless controller managing freehand drawing lifecycle, tool selection,
|
|
@@ -4038,4 +4083,4 @@ interface CanvasEffectsToolProviderOptions {
|
|
|
4038
4083
|
/** The effect tools for a canvas (see the module comment). */
|
|
4039
4084
|
declare function createCanvasEffectsToolProvider(controller: CanvasEffectsController, options?: CanvasEffectsToolProviderOptions): AgentToolProvider;
|
|
4040
4085
|
|
|
4041
|
-
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, type BrushedPathShape, CANVAS_CAPTURE_CHROME_SELECTORS, CANVAS_CAPTURE_OVERLAY_SELECTORS, CANVAS_CAPTURE_VIEWPORT_SELECTOR, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_EFFECT_PLACES, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, CanvasBrushstroke, type CanvasBrushstrokeImage, type CanvasBrushstrokeRenderer, type CanvasCaptureSurfaceOptions, type CanvasCaptureToolProviderOptions, type CanvasCaptureViewport, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, type CanvasEffectClock, type CanvasEffectPlace, type CanvasEffectTarget, type CanvasEffectsController, type CanvasEffectsControllerOptions, type CanvasEffectsToolProviderOptions, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasSceneTransition, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, CanvasShapeEffect, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type DrawStrokeInput, type DrawStrokeResult, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandPenSample, type FreehandPointerLike, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PathShape, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type RenderShapeBrushstrokeOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasEffectsPool, canvasHeight, canvasNodeCaptureRect, canvasNodeEffect, captureCanvasView, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasCaptureSurface, createCanvasCaptureToolProvider, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasEffectsController, createCanvasEffectsToolProvider, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, freehandBrushstroke, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getBrushedShapeSvg, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isBrushedShape, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasBrushes, listCanvasComponents, loadCanvasBrushstrokeRenderer, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pathDataToPolyline, pieScene, placeBeside, playCanvasSceneTransition, playWebAnimations, pointerPenSample, positionToSide, profileAlongPolyline, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, renderShapeBrushstroke, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runCanvasNodeEffect, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, transitionCanvasView, updateKeyframe, validateCanvasBrush, validateCanvasBrushPaint, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
|
4086
|
+
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, type BrushedPathShape, CANVAS_CAPTURE_CHROME_SELECTORS, CANVAS_CAPTURE_OVERLAY_SELECTORS, CANVAS_CAPTURE_VIEWPORT_SELECTOR, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_EFFECT_PLACES, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, type CanvasBrushSwatchOptions, CanvasBrushstroke, type CanvasBrushstrokeImage, type CanvasBrushstrokeRenderer, type CanvasCaptureSurfaceOptions, type CanvasCaptureToolProviderOptions, type CanvasCaptureViewport, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, type CanvasEffectClock, type CanvasEffectPlace, type CanvasEffectTarget, type CanvasEffectsController, type CanvasEffectsControllerOptions, type CanvasEffectsToolProviderOptions, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasSceneTransition, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, CanvasShapeEffect, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type DrawStrokeInput, type DrawStrokeResult, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandPenSample, type FreehandPointerLike, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PathShape, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type RenderShapeBrushstrokeOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, brushstrokeSeed, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasEffectsPool, canvasHeight, canvasNodeCaptureRect, canvasNodeEffect, captureCanvasView, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasCaptureSurface, createCanvasCaptureToolProvider, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasEffectsController, createCanvasEffectsToolProvider, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, freehandBrushstroke, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getBrushedShapeSvg, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isBrushedShape, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasBrushes, listCanvasComponents, loadCanvasBrushstrokeRenderer, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pathDataToPolyline, pieScene, placeBeside, playCanvasSceneTransition, playWebAnimations, pointerPenSample, positionToSide, profileAlongPolyline, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, renderCanvasBrushSwatch, renderShapeBrushstroke, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runCanvasNodeEffect, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, transitionCanvasView, updateKeyframe, validateCanvasBrush, validateCanvasBrushPaint, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
package/dist/canvas/index.js
CHANGED
|
@@ -42,16 +42,18 @@ import {
|
|
|
42
42
|
timelineGeometry
|
|
43
43
|
} from "../chunk-WJSCGBJ2.js";
|
|
44
44
|
import {
|
|
45
|
+
brushstrokeSeed,
|
|
45
46
|
getBrushedShapeSvg,
|
|
46
47
|
isBrushedShape,
|
|
47
48
|
listCanvasBrushes,
|
|
48
49
|
loadCanvasBrushstrokeRenderer,
|
|
49
50
|
pathDataToPolyline,
|
|
50
51
|
profileAlongPolyline,
|
|
52
|
+
renderCanvasBrushSwatch,
|
|
51
53
|
renderShapeBrushstroke,
|
|
52
54
|
validateCanvasBrush,
|
|
53
55
|
validateCanvasBrushPaint
|
|
54
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-C2J7GOMJ.js";
|
|
55
57
|
import {
|
|
56
58
|
TokenError,
|
|
57
59
|
getTokenCollection,
|
|
@@ -8242,7 +8244,7 @@ function freehandBrushstroke(brush, points, samples, profileLength = 32) {
|
|
|
8242
8244
|
}
|
|
8243
8245
|
function strokeToShapeNode(stroke, options = {}) {
|
|
8244
8246
|
const points = stroke.points;
|
|
8245
|
-
const strokeWidth = stroke.style.width || 3;
|
|
8247
|
+
const strokeWidth = stroke.style.brush !== void 0 && stroke.style.brushSize || stroke.style.width || 3;
|
|
8246
8248
|
const bounds = strokeBoundingBox(points, 0);
|
|
8247
8249
|
const localPoints = points.map(
|
|
8248
8250
|
([x, y]) => [x - bounds.x, y - bounds.y]
|
|
@@ -8279,7 +8281,10 @@ function strokeToShapeNode(stroke, options = {}) {
|
|
|
8279
8281
|
...stroke.style.brush !== void 0 ? {
|
|
8280
8282
|
brush: {
|
|
8281
8283
|
...freehandBrushstroke(stroke.style.brush, localPoints, stroke.samples, options.profileLength),
|
|
8282
|
-
...stroke.style.paint !== void 0 ? { paint: stroke.style.paint } : {}
|
|
8284
|
+
...stroke.style.paint !== void 0 ? { paint: stroke.style.paint } : {},
|
|
8285
|
+
// New strokes carry a character seed (jitter and grain) and their size, if chosen.
|
|
8286
|
+
seed: brushstrokeSeed(options.id ?? stroke.id),
|
|
8287
|
+
...stroke.style.brushSize !== void 0 && stroke.style.brushSize > 0 ? { size: stroke.style.brushSize } : {}
|
|
8283
8288
|
}
|
|
8284
8289
|
} : {},
|
|
8285
8290
|
fill: "none"
|
|
@@ -12077,6 +12082,7 @@ export {
|
|
|
12077
12082
|
blendLayout,
|
|
12078
12083
|
boundsOf,
|
|
12079
12084
|
brushstrokeScaleBucket,
|
|
12085
|
+
brushstrokeSeed,
|
|
12080
12086
|
c4Scene,
|
|
12081
12087
|
calculateCursorArrowRotation,
|
|
12082
12088
|
calculateCurvedPath,
|
|
@@ -12388,6 +12394,7 @@ export {
|
|
|
12388
12394
|
removeTrack,
|
|
12389
12395
|
renameCanvasVariantProperty,
|
|
12390
12396
|
renameCanvasVariantValue,
|
|
12397
|
+
renderCanvasBrushSwatch,
|
|
12391
12398
|
renderShapeBrushstroke,
|
|
12392
12399
|
reorderNodes,
|
|
12393
12400
|
repositionNodesTo,
|