@pixerate/editor 0.37.0 → 0.38.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/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/canvas/index.cjs +37 -25
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +2 -2
- package/dist/canvas/index.d.ts +2 -2
- package/dist/canvas/index.js +13 -1
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-GVB7ZPLZ.cjs → chunk-7EDLVBOO.cjs} +649 -18
- package/dist/chunk-7EDLVBOO.cjs.map +1 -0
- package/dist/{chunk-HPEKB352.js → chunk-ZCCU3VNI.js} +646 -15
- package/dist/chunk-ZCCU3VNI.js.map +1 -0
- package/dist/{stroke-CWjFKal4.d.cts → pathfinder-Bd87_lsQ.d.cts} +234 -1
- package/dist/{stroke-ysgaPpAo.d.ts → pathfinder-fLmmFOJw.d.ts} +234 -1
- package/dist/vector/index.cjs +860 -274
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +242 -3
- package/dist/vector/index.d.ts +242 -3
- package/dist/vector/index.js +611 -25
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GVB7ZPLZ.cjs.map +0 -1
- package/dist/chunk-HPEKB352.js.map +0 -1
package/dist/vector/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CanvasGradientDef, A as AffineMatrix, B as BezierPathInput, a as BezierPath, S as SvgGradientDef, b as StrokeJoin, c as StrokeCap } from '../
|
|
1
|
+
import { C as CanvasGradientDef, A as AffineMatrix, B as BezierPathInput, a as BezierPath, S as SvgGradientDef, b as StrokeJoin, c as StrokeCap, d as BezierSegment, P as PlanarMap, e as PathfinderOperation, f as PathfinderShape } from '../pathfinder-Bd87_lsQ.cjs';
|
|
2
2
|
import { P as Point } from '../types-BFkYA4eF.cjs';
|
|
3
3
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
4
4
|
import { C as CommandSpec } from '../registry-D0GADKc7.cjs';
|
|
@@ -173,8 +173,10 @@ interface VectorHandleRef extends VectorAnchorRef {
|
|
|
173
173
|
* Canvas tools. `direct` edits anchors, handles and segments; the shape tools drag out a new
|
|
174
174
|
* shape; `scissors` cuts a path at a point, `knife` cuts filled shapes along a freehand stroke,
|
|
175
175
|
* `eraser` rubs out the area under one and `width` drags a stroke's width at a point.
|
|
176
|
+
* `shapeBuilder` merges (Alt: deletes) the faces the selected shapes make, and `paintBucket`
|
|
177
|
+
* fills the region the visible outlines enclose around a click with a new shape.
|
|
176
178
|
*/
|
|
177
|
-
type VectorTool = 'select' | 'direct' | 'pen' | 'pencil' | 'rect' | 'ellipse' | 'polygon' | 'star' | 'line' | 'scissors' | 'knife' | 'eraser' | 'width';
|
|
179
|
+
type VectorTool = 'select' | 'direct' | 'pen' | 'pencil' | 'rect' | 'ellipse' | 'polygon' | 'star' | 'line' | 'scissors' | 'knife' | 'eraser' | 'width' | 'shapeBuilder' | 'paintBucket';
|
|
178
180
|
declare const VECTOR_TOOLS: readonly VectorTool[];
|
|
179
181
|
/** Keyboard modifiers held during a pointer event. */
|
|
180
182
|
interface VectorModifiers {
|
|
@@ -209,6 +211,14 @@ interface VectorDefaults extends VectorStyle {
|
|
|
209
211
|
type VectorAlign = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
|
210
212
|
type VectorDistribute = 'horizontal' | 'vertical';
|
|
211
213
|
type VectorBooleanOperation = 'union' | 'subtract' | 'intersect' | 'exclude';
|
|
214
|
+
/**
|
|
215
|
+
* Pathfinder operations: `divide` (every face its own shape), `trim` (hidden parts removed),
|
|
216
|
+
* `merge` (Trim, then touching parts of one fill joined), `crop` (the top shape crops the others),
|
|
217
|
+
* `outline` (outlines cut into open strokes where they meet) and `minusBack` (the top shape minus
|
|
218
|
+
* everything below it).
|
|
219
|
+
*/
|
|
220
|
+
type VectorPathfinderOperation = 'divide' | 'trim' | 'merge' | 'crop' | 'outline' | 'minusBack';
|
|
221
|
+
declare const VECTOR_PATHFINDER_OPERATIONS: readonly VectorPathfinderOperation[];
|
|
212
222
|
type VectorArrange = 'front' | 'forward' | 'backward' | 'back';
|
|
213
223
|
/** Average: line anchors up on a horizontal line (same y), a vertical one (same x), or both. */
|
|
214
224
|
type VectorAverageAxis = 'horizontal' | 'vertical' | 'both';
|
|
@@ -886,7 +896,14 @@ interface VectorPathEditOptions {
|
|
|
886
896
|
* only, `all` for any pointer that reports pressure, `off` never.
|
|
887
897
|
*/
|
|
888
898
|
pencilPressure: 'pen' | 'all' | 'off';
|
|
899
|
+
/**
|
|
900
|
+
* Paint bucket: gaps up to this distance (document units) between loose ends of outlines are
|
|
901
|
+
* closed when finding the region to fill (default 0, off).
|
|
902
|
+
*/
|
|
903
|
+
fillGap: number;
|
|
889
904
|
}
|
|
905
|
+
/** The gap the toolbars' "Close gaps" toggle sets (document units). */
|
|
906
|
+
declare const VECTOR_FILL_GAP = 6;
|
|
890
907
|
/** Path-editing options new editors start with. */
|
|
891
908
|
declare const DEFAULT_VECTOR_PATH_EDIT: Readonly<VectorPathEditOptions>;
|
|
892
909
|
/** Longest pencil lazy-mouse string (at smoothing 1), in screen pixels. */
|
|
@@ -1004,6 +1021,10 @@ type VectorInteraction = {
|
|
|
1004
1021
|
tool: 'knife' | 'eraser';
|
|
1005
1022
|
points: Vec2[];
|
|
1006
1023
|
width: number;
|
|
1024
|
+
} | {
|
|
1025
|
+
type: 'builder';
|
|
1026
|
+
mode: 'merge' | 'erase';
|
|
1027
|
+
points: Vec2[];
|
|
1007
1028
|
} | {
|
|
1008
1029
|
type: 'width';
|
|
1009
1030
|
ref: VectorWidthPointRef;
|
|
@@ -1049,6 +1070,8 @@ interface VectorEditorState {
|
|
|
1049
1070
|
} | null;
|
|
1050
1071
|
/** Last pointer position in document units (for the pen preview), or null when outside. */
|
|
1051
1072
|
pointer: Vec2 | null;
|
|
1073
|
+
/** Shape Builder and paint bucket highlight: faces, line pieces and the gesture's trail. */
|
|
1074
|
+
builder: VectorBuilderPreview | null;
|
|
1052
1075
|
canUndo: boolean;
|
|
1053
1076
|
canRedo: boolean;
|
|
1054
1077
|
undoLabel: string;
|
|
@@ -1062,6 +1085,37 @@ type VectorActionResult = {
|
|
|
1062
1085
|
ok: false;
|
|
1063
1086
|
message: string;
|
|
1064
1087
|
};
|
|
1088
|
+
/**
|
|
1089
|
+
* What the Shape Builder or paint bucket highlights, in document units: the faces (filled paths
|
|
1090
|
+
* as SVG path data) under the pointer or touched by the drag, the line pieces an erase would
|
|
1091
|
+
* delete, and the drag's trail. `mode` is `merge`, `erase` (Alt) or `fill` (paint bucket).
|
|
1092
|
+
*/
|
|
1093
|
+
interface VectorBuilderPreview {
|
|
1094
|
+
mode: 'merge' | 'erase' | 'fill';
|
|
1095
|
+
faces: BezierPath[];
|
|
1096
|
+
lines: BezierPath[];
|
|
1097
|
+
trail: Vec2[] | null;
|
|
1098
|
+
}
|
|
1099
|
+
/** Result of a Shape Builder gesture. */
|
|
1100
|
+
interface VectorShapeBuilderResult {
|
|
1101
|
+
ok: boolean;
|
|
1102
|
+
message?: string;
|
|
1103
|
+
/** Id of the merged shape (none when erasing). */
|
|
1104
|
+
merged: string | null;
|
|
1105
|
+
faces: number;
|
|
1106
|
+
lines: number;
|
|
1107
|
+
}
|
|
1108
|
+
/** A face of the Shape Builder map (document units). */
|
|
1109
|
+
interface VectorShapeBuilderFace {
|
|
1110
|
+
index: number;
|
|
1111
|
+
/** SVG path data. */
|
|
1112
|
+
d: string;
|
|
1113
|
+
area: number;
|
|
1114
|
+
/** Ids of the paths whose fill covers it, bottom to top (empty for an area only outlines enclose). */
|
|
1115
|
+
sources: string[];
|
|
1116
|
+
/** A point inside it. */
|
|
1117
|
+
point: Vec2 | null;
|
|
1118
|
+
}
|
|
1065
1119
|
interface AddVectorNodeOptions {
|
|
1066
1120
|
/** Group to add into (default: the root). */
|
|
1067
1121
|
parentId?: string;
|
|
@@ -1212,6 +1266,8 @@ declare function vectorToolLabel(tool: VectorTool): string;
|
|
|
1212
1266
|
declare const VECTOR_TOOL_SHORTCUTS: Readonly<Record<VectorTool, string>>;
|
|
1213
1267
|
/** Short glyphs for tool buttons (pair them with `vectorToolLabel` for the accessible name). */
|
|
1214
1268
|
declare const VECTOR_TOOL_GLYPHS: Readonly<Record<VectorTool, string>>;
|
|
1269
|
+
/** Names of the Pathfinder operations (undo steps, groups and buttons). */
|
|
1270
|
+
declare const VECTOR_PATHFINDER_LABELS: Readonly<Record<VectorPathfinderOperation, string>>;
|
|
1215
1271
|
/**
|
|
1216
1272
|
* Headless state for a vector editor: a document of paths and groups, select / direct /
|
|
1217
1273
|
* pen / pencil / shape tools driven by pointer and key events, undo, transforms, boolean
|
|
@@ -1244,6 +1300,13 @@ declare class VectorEditorController {
|
|
|
1244
1300
|
private hoverTargets;
|
|
1245
1301
|
private spaceHeld;
|
|
1246
1302
|
private clipboard;
|
|
1303
|
+
/** Shape Builder map of the selection, kept while the document and the selection stay the same. */
|
|
1304
|
+
private builderCache;
|
|
1305
|
+
/** Paint bucket map of the visible outlines. */
|
|
1306
|
+
private fillCache;
|
|
1307
|
+
private builderPreview;
|
|
1308
|
+
/** What the highlight shows, to skip notifying when the pointer stays over the same face. */
|
|
1309
|
+
private builderHoverKey;
|
|
1247
1310
|
private readonly createId;
|
|
1248
1311
|
private readonly onChange?;
|
|
1249
1312
|
private readonly listeners;
|
|
@@ -1498,6 +1561,56 @@ declare class VectorEditorController {
|
|
|
1498
1561
|
breakApart(options?: {
|
|
1499
1562
|
ids?: readonly string[];
|
|
1500
1563
|
}): VectorActionResult;
|
|
1564
|
+
/**
|
|
1565
|
+
* Pathfinder: Divide, Trim, Merge, Crop, Outline or Minus Back over the selected (or given)
|
|
1566
|
+
* paths, in document space (rotated nodes and groups included, live corners cut). Unfilled
|
|
1567
|
+
* stroked paths take part as the area their stroke paints (Divide: open ones cut instead).
|
|
1568
|
+
* The results replace the operands at the place of the top-most one, grouped when there are
|
|
1569
|
+
* several; each keeps the style of the operand whose area it is. Returns the new path ids,
|
|
1570
|
+
* or an empty list when nothing came out.
|
|
1571
|
+
*/
|
|
1572
|
+
pathfinder(op: VectorPathfinderOperation, options?: {
|
|
1573
|
+
ids?: readonly string[];
|
|
1574
|
+
}): string[];
|
|
1575
|
+
/** The Shape Builder map of the selected (or given) paths, cached per document and selection. */
|
|
1576
|
+
private shapeBuilderMap;
|
|
1577
|
+
/** The faces the Shape Builder offers for the selected (or given) paths (document units). */
|
|
1578
|
+
getShapeBuilderFaces(options?: {
|
|
1579
|
+
ids?: readonly string[];
|
|
1580
|
+
}): VectorShapeBuilderFace[];
|
|
1581
|
+
/** Pick distance of the Shape Builder's erase for line pieces (document units). */
|
|
1582
|
+
private builderLineTolerance;
|
|
1583
|
+
/**
|
|
1584
|
+
* Shape Builder gesture along `points` (document units; one point is a click) over the faces
|
|
1585
|
+
* the selected (or given) paths make. Merges the faces touched into one shape styled like the
|
|
1586
|
+
* top-most shape over the first face (the current fill for a face only outlines enclose);
|
|
1587
|
+
* with `erase` deletes them, and the pieces of unfilled open paths within `tolerance`. Every
|
|
1588
|
+
* shape covering a touched face loses that area. One undo step.
|
|
1589
|
+
*/
|
|
1590
|
+
shapeBuilder(points: readonly Vec2[], options?: {
|
|
1591
|
+
ids?: readonly string[];
|
|
1592
|
+
erase?: boolean;
|
|
1593
|
+
tolerance?: number;
|
|
1594
|
+
}): VectorShapeBuilderResult;
|
|
1595
|
+
private applyShapeBuilder;
|
|
1596
|
+
/** The paint bucket's map of the visible outlines, cached per document and gap. */
|
|
1597
|
+
private fillMap;
|
|
1598
|
+
/**
|
|
1599
|
+
* Paint bucket: the region the visible outlines enclose around `point` (document units),
|
|
1600
|
+
* crossings split and islands left as holes, becomes a new path filled with the current fill
|
|
1601
|
+
* default, placed just below the selection (or on top when nothing is selected). `gap`
|
|
1602
|
+
* (default `editing.fillGap`) closes gaps up to that size between loose ends. Returns the new
|
|
1603
|
+
* path's id, or null when nothing encloses the point.
|
|
1604
|
+
*/
|
|
1605
|
+
fillRegion(point: Vec2, options?: {
|
|
1606
|
+
gap?: number;
|
|
1607
|
+
}): string | null;
|
|
1608
|
+
/** Updates the Shape Builder / paint bucket highlight for the pointer at `p`; true when it changed. */
|
|
1609
|
+
private hoverBuilder;
|
|
1610
|
+
private builderPreviewOf;
|
|
1611
|
+
private downBuilder;
|
|
1612
|
+
private moveBuilder;
|
|
1613
|
+
private upBuilder;
|
|
1501
1614
|
private updateAnchors;
|
|
1502
1615
|
/** Moves anchors by a document-space offset (converted into each node's own space). */
|
|
1503
1616
|
private movedAnchors;
|
|
@@ -1860,6 +1973,17 @@ interface VectorOverlayRenderData {
|
|
|
1860
1973
|
left: Vec2;
|
|
1861
1974
|
right: Vec2;
|
|
1862
1975
|
} | null;
|
|
1976
|
+
/**
|
|
1977
|
+
* Shape Builder and paint bucket highlight (screen space): `faces` are filled paths (fill
|
|
1978
|
+
* them translucent and outline them), `lines` are line pieces an erase deletes, `trail` is
|
|
1979
|
+
* the drag's polyline. `mode` is `merge`, `erase` (Alt) or `fill` (paint bucket).
|
|
1980
|
+
*/
|
|
1981
|
+
builder: {
|
|
1982
|
+
mode: 'merge' | 'erase' | 'fill';
|
|
1983
|
+
faces: string[];
|
|
1984
|
+
lines: string[];
|
|
1985
|
+
trail: string | null;
|
|
1986
|
+
} | null;
|
|
1863
1987
|
/** A short status, e.g. "W 120 × H 80" or "45°". */
|
|
1864
1988
|
status: string | null;
|
|
1865
1989
|
}
|
|
@@ -1888,6 +2012,11 @@ declare const VECTOR_OVERLAY_THEME: {
|
|
|
1888
2012
|
readonly cornerWidgetRadius: 4;
|
|
1889
2013
|
/** Half the diagonal of a width point's diamond. */
|
|
1890
2014
|
readonly widthPointSize: 5;
|
|
2015
|
+
/** Shape Builder faces to merge and paint bucket regions. */
|
|
2016
|
+
readonly builderFill: "rgba(14, 165, 233, 0.22)";
|
|
2017
|
+
/** Shape Builder faces and line pieces an Alt gesture deletes. */
|
|
2018
|
+
readonly builderErase: "#ef4444";
|
|
2019
|
+
readonly builderEraseFill: "rgba(239, 68, 68, 0.22)";
|
|
1891
2020
|
};
|
|
1892
2021
|
/** SVG path data of the diamond a width point is drawn with (screen pixels). */
|
|
1893
2022
|
declare function vectorDiamondPath(x: number, y: number, r?: number): string;
|
|
@@ -1992,6 +2121,16 @@ interface VectorPathAction {
|
|
|
1992
2121
|
}
|
|
1993
2122
|
/** Join, Average, Cut at Points, Remove Redundant Points, Smooth and Outline Stroke, as the toolbars show them. */
|
|
1994
2123
|
declare const VECTOR_PATH_ACTIONS: readonly VectorPathAction[];
|
|
2124
|
+
/** A Pathfinder button of the bundled toolbars. */
|
|
2125
|
+
interface VectorPathfinderAction {
|
|
2126
|
+
id: VectorPathfinderOperation;
|
|
2127
|
+
label: string;
|
|
2128
|
+
title: string;
|
|
2129
|
+
/** Paths (or groups) it needs selected. */
|
|
2130
|
+
min: number;
|
|
2131
|
+
}
|
|
2132
|
+
/** Divide, Trim, Merge, Crop, Outline and Minus Back, as the toolbars show them. */
|
|
2133
|
+
declare const VECTOR_PATHFINDER_ACTIONS: readonly VectorPathfinderAction[];
|
|
1995
2134
|
/** The on / off path-editing settings the toolbars toggle. */
|
|
1996
2135
|
declare const VECTOR_EDIT_TOGGLES: readonly {
|
|
1997
2136
|
key: 'keepShapeOnDelete' | 'curvatureMoves' | 'recognizeShapes';
|
|
@@ -2356,4 +2495,104 @@ declare function strokePositionPoint(path: BezierPath, index: number, t: number)
|
|
|
2356
2495
|
tangent: Vec;
|
|
2357
2496
|
} | null;
|
|
2358
2497
|
|
|
2359
|
-
|
|
2498
|
+
/** A path node with the matrix of its parent space (parent → document). */
|
|
2499
|
+
interface VectorPathEntry {
|
|
2500
|
+
node: VectorPathNode;
|
|
2501
|
+
parent: AffineMatrix;
|
|
2502
|
+
}
|
|
2503
|
+
/**
|
|
2504
|
+
* The path nodes inside `roots` (or every node when `roots` is null), bottom to top, with their
|
|
2505
|
+
* parent matrices. Hidden nodes are skipped, and locked ones unless `locked` is true.
|
|
2506
|
+
*/
|
|
2507
|
+
declare function vectorPathEntries(doc: VectorDocument, roots: readonly string[] | null, options?: {
|
|
2508
|
+
locked?: boolean;
|
|
2509
|
+
}): VectorPathEntry[];
|
|
2510
|
+
/** Whether a subpath, closed, encloses an area (rather than retracing itself). */
|
|
2511
|
+
declare function subpathEnclosesArea(sp: VectorSubpath): boolean;
|
|
2512
|
+
/** How an operand takes part in a Pathfinder operation: its fill, its stroke's area, a cutting line or its bare outline. */
|
|
2513
|
+
type VectorPathfinderPaint = 'fill' | 'stroke' | 'line' | 'outline';
|
|
2514
|
+
/** The Pathfinder shape of a path (document space), and what it stands for. */
|
|
2515
|
+
declare function vectorPathfinderShape(entry: VectorPathEntry, op: PathfinderOperation): PathfinderShape & {
|
|
2516
|
+
paint: VectorPathfinderPaint;
|
|
2517
|
+
};
|
|
2518
|
+
/**
|
|
2519
|
+
* Style of a Pathfinder or Shape Builder result taken from `node`: the node's own style for a
|
|
2520
|
+
* filled area, the stroke's paint as a fill for a stroke's area, or (for Outline edges) a stroke
|
|
2521
|
+
* in the paint of the area the edge bounds. Never carries the node's id, transform or geometry.
|
|
2522
|
+
*/
|
|
2523
|
+
declare function vectorResultStyle(node: VectorPathNode, paint: VectorPathfinderPaint, edge?: boolean): Omit<VectorPathNode, 'id' | 'subpaths'>;
|
|
2524
|
+
/** A piece of an unfilled open path between the points where other paths meet it. */
|
|
2525
|
+
interface VectorBuilderLinePiece {
|
|
2526
|
+
path: BezierPath;
|
|
2527
|
+
segments: BezierSegment[];
|
|
2528
|
+
/** Index of the entry it belongs to. */
|
|
2529
|
+
source: number;
|
|
2530
|
+
bounds: {
|
|
2531
|
+
minX: number;
|
|
2532
|
+
minY: number;
|
|
2533
|
+
maxX: number;
|
|
2534
|
+
maxY: number;
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2537
|
+
/** The Shape Builder's planar map of a set of paths. */
|
|
2538
|
+
interface VectorShapeBuilderMap {
|
|
2539
|
+
entries: VectorPathEntry[];
|
|
2540
|
+
map: PlanarMap;
|
|
2541
|
+
/** Entries with no closed subpath (cutting lines; their pieces can be erased). */
|
|
2542
|
+
lines: boolean[];
|
|
2543
|
+
pieces: VectorBuilderLinePiece[];
|
|
2544
|
+
}
|
|
2545
|
+
/** What a Shape Builder gesture touches at a point. */
|
|
2546
|
+
type VectorBuilderHit = {
|
|
2547
|
+
face: number;
|
|
2548
|
+
} | {
|
|
2549
|
+
line: number;
|
|
2550
|
+
};
|
|
2551
|
+
/** The faces and line pieces a gesture touched, in the order touched. */
|
|
2552
|
+
interface VectorBuilderTouched {
|
|
2553
|
+
faces: number[];
|
|
2554
|
+
lines: number[];
|
|
2555
|
+
}
|
|
2556
|
+
/**
|
|
2557
|
+
* The Shape Builder map of `entries` (bottom to top). Filled open subpaths that enclose an area
|
|
2558
|
+
* are closed. Null when nothing can be mapped.
|
|
2559
|
+
*/
|
|
2560
|
+
declare function vectorShapeBuilderMap(entries: readonly VectorPathEntry[]): VectorShapeBuilderMap | null;
|
|
2561
|
+
/** The face under `p`, or with `lineTolerance` (erasing) first the line piece that close. */
|
|
2562
|
+
declare function vectorShapeBuilderHit(m: VectorShapeBuilderMap, p: Vec2, lineTolerance?: number | null): VectorBuilderHit | null;
|
|
2563
|
+
/** Points along a polyline no more than `step` apart (the pointer's path through faces). */
|
|
2564
|
+
declare function samplePolyline(points: readonly Vec2[], step: number): Vec2[];
|
|
2565
|
+
/** Adds what a point hits to `touched` (each face or piece once). */
|
|
2566
|
+
declare function addBuilderHit(touched: VectorBuilderTouched, hit: VectorBuilderHit | null): boolean;
|
|
2567
|
+
/** What becomes of one entry: unchanged (absent), removed (`null`), or new outlines (document space). */
|
|
2568
|
+
type VectorBuilderReplacement = {
|
|
2569
|
+
kind: 'fill';
|
|
2570
|
+
path: BezierPath;
|
|
2571
|
+
} | {
|
|
2572
|
+
kind: 'pieces';
|
|
2573
|
+
paths: BezierPath[];
|
|
2574
|
+
} | null;
|
|
2575
|
+
interface VectorShapeBuilderPlan {
|
|
2576
|
+
replace: Map<number, VectorBuilderReplacement>;
|
|
2577
|
+
/** The merged shape (document space), styled like entry `style`; `currentFill` when only outlines enclosed it. */
|
|
2578
|
+
merged: {
|
|
2579
|
+
path: BezierPath;
|
|
2580
|
+
style: number;
|
|
2581
|
+
currentFill: boolean;
|
|
2582
|
+
} | null;
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* What a gesture does: merging (or with `erase`, deleting) the touched faces takes them away
|
|
2586
|
+
* from every shape covering them; line pieces touched (erasing) or lying between touched faces
|
|
2587
|
+
* go; merging adds the union of the faces as a new shape styled like the top-most shape over the
|
|
2588
|
+
* first face touched (or, for a face only outlines enclose, the top-most shape with the current
|
|
2589
|
+
* fill).
|
|
2590
|
+
*/
|
|
2591
|
+
declare function planShapeBuilder(m: VectorShapeBuilderMap, touched: VectorBuilderTouched, erase: boolean): VectorShapeBuilderPlan;
|
|
2592
|
+
/**
|
|
2593
|
+
* The planar map of every visible path's outline as drawn (locked ones included), for the paint
|
|
2594
|
+
* bucket. `gap` closes gaps up to that distance between loose ends.
|
|
2595
|
+
*/
|
|
2596
|
+
declare function vectorFillMap(doc: VectorDocument, gap?: number): PlanarMap | null;
|
|
2597
|
+
|
|
2598
|
+
export { type AddVectorNodeOptions, AffineMatrix, DEFAULT_VECTOR_PATH_EDIT, DEFAULT_VECTOR_SNAP, IDENTITY_MATRIX, KAPPA, LazyMouse, type NearestSegment, type RecognizeInkOptions, SvgGradientDef, VECTOR_ARROWHEADS, VECTOR_ARROWHEAD_LABELS, VECTOR_CLIPBOARD_TYPE, VECTOR_CONSTRUCTION_ANGLES, VECTOR_CORNER_KINDS, VECTOR_CORNER_KIND_LABELS, VECTOR_CORNER_WIDGET_INSET, VECTOR_EDIT_TOGGLES, VECTOR_FILL_GAP, VECTOR_INK_MAX_CORNERS, VECTOR_OVERLAY_THEME, VECTOR_PATHFINDER_ACTIONS, VECTOR_PATHFINDER_LABELS, VECTOR_PATHFINDER_OPERATIONS, VECTOR_PATH_ACTIONS, VECTOR_PENCIL_STRING_PX, VECTOR_PRESSURE_NOMINAL, VECTOR_ROTATE_HANDLE_OFFSET, VECTOR_STROKE_ALIGN_LABELS, VECTOR_STYLE_KEYS, VECTOR_TOOLS, VECTOR_TOOL_GLYPHS, VECTOR_TOOL_SHORTCUTS, VECTOR_TRANSFORM_HANDLES, VECTOR_WIDTH_PRESETS, VECTOR_WIDTH_PRESET_IDS, VECTOR_WIDTH_PROFILE_MAX_POINTS, VECTOR_WIDTH_PROFILE_MAX_SCALE, VECTOR_WIDTH_SAME_T, type VariableStrokeOptions, type Vec2, type VectorActionResult, type VectorAlign, type VectorAnchor, type VectorAnchorRef, type VectorAnchorType, type VectorArrange, type VectorArrowAlign, type VectorArrowhead, type VectorArrowheadShape, type VectorAverageAxis, type VectorBooleanOperation, type VectorBounds, type VectorBuilderHit, type VectorBuilderLinePiece, type VectorBuilderPreview, type VectorBuilderReplacement, type VectorBuilderTouched, type VectorCommandOptions, type VectorCorner, type VectorCornerInfo, type VectorCornerKind, type VectorCornerWidget, type VectorDefaults, type VectorDistribute, type VectorDocument, VectorEditorController, type VectorEditorOptions, type VectorEditorState, type VectorFillRule, type VectorGroupNode, type VectorGuideKind, type VectorGuideLabel, type VectorGuideLine, type VectorHandleRef, type VectorHover, type VectorInkShape, type VectorInteraction, type VectorKeyInput, type VectorLineCap, type VectorLineJoin, type VectorMatrix, type VectorModifiers, type VectorNode, type VectorNodeListing, type VectorOverlayRenderData, type VectorPaint, type VectorPathAction, type VectorPathEditOptions, type VectorPathEntry, type VectorPathNode, type VectorPathfinderAction, type VectorPathfinderOperation, type VectorPathfinderPaint, type VectorPointSnap, type VectorPointerInput, type VectorRectSnap, type VectorRenderAnchor, type VectorRenderCornerWidget, type VectorRenderGroup, type VectorRenderGuideLabel, type VectorRenderGuideLine, type VectorRenderHandle, type VectorRenderNode, type VectorRenderPath, type VectorRenderStrokeParts, type VectorRenderWidthPoint, type VectorScaleSnap, type VectorSceneRenderData, type VectorSegmentRef, type VectorSelectionBoxGeometry, type VectorSelectionFrame, type VectorSelectionStyle, type VectorShapeBuilderFace, type VectorShapeBuilderMap, type VectorShapeBuilderPlan, type VectorShapeBuilderResult, type VectorShapeInput, type VectorSnapGuides, type VectorSnapKind, type VectorSnapLeave, type VectorSnapOptions, VectorSnapTargets, type VectorStrokeAlign, type VectorStrokeParts, type VectorStrokeSpot, type VectorStyle, type VectorSubpath, type VectorSvgExportOptions, type VectorSvgImportOptions, type VectorTaperOptions, type VectorTool, type VectorTransformHandle, type VectorViewport, type VectorWaveOptions, type VectorWidthHandle, type VectorWidthPoint, type VectorWidthPointRef, type VectorWidthPreset, type VectorWidthPresetInfo, addBuilderHit, applyMatrix, applyMatrixLinear, applyVectorCornersAttribute, arrowheadInset, arrowheadPath, arrowheadWeight, bendSegment, bezierToSubpaths, boundsFromPoints, boundsIntersect, cloneAnchor, cloneSubpath, cloneVectorDocument, cloneVectorNode, collectPathNodes, constrainToLeave, convertAnchor, cornerBisectorPoint, cornerRadiusChange, cornerSetback, createVectorCommands, curvatureMoveAnchor, cutSubpathAt, dashIntervals, decomposeRigid, effectiveStrokeAlign, ellipseSubpath, eraseFromFill, eraseFromOutline, eraserRegion, expandVectorCorners, expandVectorCornersOf, findVectorNode, fitCornerRadius, generateWidthProfile, getAnchor, getAnchorWorld, getEditablePathIds, getTransformHandlePositions, getVectorCornerWidgets, getVectorOverlayRenderData, getVectorSceneRenderData, getVectorSelectionBoxGeometry, getVectorSelectionFrame, getVectorSelectionStyle, getVectorWidthHandles, getVisibleAnchors, getVisibleHandles, hasPaint, hasStrokeExtras, hasVectorCorners, hitTestVectorNode, hitTestVectorNodes, hitTestVectorStroke, inferAnchorType, insertAnchor, insertWidthPoint, invertMatrix, isClosedBezierShape, isIdentityMatrix, isUniformWidthProfile, isVectorTextTarget, joinSubpaths, knifePath, lineSubpath, locateVectorNode, matrixRotation, mirrorWidthProfile, moveAnchorHandle, multiplyMatrices, nearestSegment, nearestStrokePosition, nextVectorCornerKind, nodeMatrix, parseSvgTransform, parseVectorSvg, planShapeBuilder, polygonSubpath, polylineBounds, pressureWidthProfile, recognizeInkShape, rectSubpath, removeAnchorKeepingShape, removeAnchors, removeAnchorsKeepingShape, removeRedundantPoints, removeWidthPoints, reverseSubpath, reverseWidthProfile, rotateMatrix, roundSubpaths, samplePolyline, sanitizeWidthProfile, scaleFor, scaleMatrix, setAnchorCorner, setSubpathCorners, setWidthPoint, simplifyPolyline, smoothSubpath, splitIntoFaces, splitSubpathAt, starSubpath, strokePositionPoint, strokeWidthProfileOf, subpathEnclosesArea, subpathPointAt, subpathSegment, subpathSegmentCount, subpathsToBezier, taperWaveFactor, toVectorKeyInput, toVectorModifiers, toVectorPointerInput, transformVectorNode, translateAnchor, translateMatrix, unionBounds, variableStrokeOutline, variableStrokeRings, vectorCornerAt, vectorCorners, vectorCornersAttribute, vectorDiamondPath, vectorDocumentToSvg, vectorFillMap, vectorInkShapeName, vectorNodeBounds, vectorNodeRotation, vectorNodeToBezier, vectorPaintToHex, vectorPaintToSvg, vectorParentMatrix, vectorPathData, vectorPathEntries, vectorPathWorldBezier, vectorPathfinderShape, vectorResizeCursor, vectorResultStyle, vectorShapeBuilderHit, vectorShapeBuilderMap, vectorStrokeLineArea, vectorStrokeOutline, vectorStrokeOutlinePath, vectorStrokeParts, vectorStrokeReach, vectorStrokeSvgParts, vectorStrokeWidthGeometry, vectorToolLabel, vectorWorldMatrix, walkVectorNodes, widthProfileAt, widthProfileFromAttribute, widthProfileMaxScale, widthProfilePreset, widthProfilePresetId, widthProfileToAttribute };
|