@pixerate/editor 0.99.0 → 0.101.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.
@@ -1,4 +1,4 @@
1
- import { C as CanvasGradientDef, S as SvgGradientDef, A as AffineMatrix } from './bezier-BfwIbVTl.cjs';
1
+ import { C as CanvasGradientDef, B as BezierPath, A as AffineMatrix, S as SvgGradientDef } from './bezier-BfwIbVTl.cjs';
2
2
  import { W as WarpStyle, a as WarpMesh } from './types-CwMPoRMU.cjs';
3
3
 
4
4
  /** An affine matrix `[a, b, c, d, e, f]`: `x' = a·x + c·y + e`, `y' = b·x + d·y + f` (SVG order). */
@@ -167,6 +167,41 @@ interface VectorWidthPoint {
167
167
  left: number;
168
168
  right: number;
169
169
  }
170
+ /**
171
+ * Blend modes of paint layers and nodes: the set SVG and CSS `mix-blend-mode` draw, named as the
172
+ * image editor names them (`@pixerate/editor/image-editor` `BlendMode`). `linear-dodge` draws as
173
+ * CSS `plus-lighter`. The image editor's other modes (linear burn, vivid light, pigment, …) have
174
+ * no SVG equivalent and are not offered.
175
+ */
176
+ type VectorBlendMode = 'normal' | 'darken' | 'multiply' | 'color-burn' | 'lighten' | 'screen' | 'color-dodge' | 'linear-dodge' | 'overlay' | 'soft-light' | 'hard-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
177
+ /** Every vector blend mode, in the image editor's (Photoshop's) menu order. */
178
+ declare const VECTOR_BLEND_MODES: readonly VectorBlendMode[];
179
+ /** One fill of a path's fill stack (`VectorStyle.fills`). */
180
+ interface VectorPaintLayer {
181
+ /** A colour, a gradient, or `null` for none. */
182
+ paint: VectorPaint;
183
+ /** 0–1, default 1. Multiplies the paint's own alpha. */
184
+ opacity?: number;
185
+ /** How the layer mixes with what is under it (the layers below, then the backdrop). Default `normal`. */
186
+ blendMode?: VectorBlendMode;
187
+ /** Hidden layers are kept but not drawn or hit. Default true. */
188
+ visible?: boolean;
189
+ }
190
+ /** The settings each stroke layer has of its own (the stroke shorthand fields of `VectorStyle`). */
191
+ type VectorStrokeSettings = Pick<VectorStyle, 'strokeWidth' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeDasharray' | 'strokeAlign' | 'startArrow' | 'endArrow' | 'arrowAlign' | 'startArrowScale' | 'endArrowScale' | 'strokeWidthProfile'>;
192
+ /**
193
+ * What a stroke layer draws. Only `paint` (a paint along the outline, the default) exists today.
194
+ * Other kinds are the extension point for strokes drawn some other way, such as a raster
195
+ * brushstroke from `@pixerate/editor/paint` laid along the path: a layer with an unknown kind is
196
+ * kept through edits, load and SVG round trips, listed to agents, and skipped when drawing and
197
+ * hit-testing.
198
+ */
199
+ type VectorStrokeLayerKind = 'paint';
200
+ /** One stroke of a path's stroke stack (`VectorStyle.strokes`): a paint plus its own stroke settings. */
201
+ interface VectorStrokeLayer extends VectorPaintLayer, VectorStrokeSettings {
202
+ /** Default `paint`. See `VectorStrokeLayerKind`. */
203
+ kind?: VectorStrokeLayerKind;
204
+ }
170
205
  /** Paint and stroke settings of a path. */
171
206
  interface VectorStyle {
172
207
  fill?: VectorPaint;
@@ -196,6 +231,19 @@ interface VectorStyle {
196
231
  * drawn as its filled outline.
197
232
  */
198
233
  strokeWidthProfile?: VectorWidthPoint[] | null;
234
+ /**
235
+ * The fill stack, bottom to top. Absent: `fill` alone is the stack (one layer, or none without
236
+ * a paint). Present: it is the truth, and `fill` mirrors its top layer's paint. The shorthand
237
+ * stays writable: setting `fill` to a paint repaints the top layer, `null` clears the stack.
238
+ * Stacks of one plain layer (full opacity, `normal`, visible) are stored as the shorthand.
239
+ */
240
+ fills?: VectorPaintLayer[] | null;
241
+ /**
242
+ * The stroke stack, bottom to top, drawn over every fill. Like `fills`: absent, `stroke` and the
243
+ * stroke settings above are the one stroke; present, they mirror its top layer, and writing them
244
+ * edits that layer (`stroke: null` clears the stack).
245
+ */
246
+ strokes?: VectorStrokeLayer[] | null;
199
247
  }
200
248
  interface VectorNodeBase {
201
249
  id: string;
@@ -229,6 +277,14 @@ interface VectorNodeBase {
229
277
  * it. Absent: the group's `liveBoolean` operation.
230
278
  */
231
279
  booleanOperation?: VectorBooleanOperation | null;
280
+ /** How the whole node (all its paint, filters included) mixes with what is under it. Default `normal`. */
281
+ blendMode?: VectorBlendMode;
282
+ /**
283
+ * Visual filters (drop and inner shadows, glows, blurs, feather), applied to everything the
284
+ * node draws. Unlike path `effects` they never change geometry: bounds, hit-testing and
285
+ * booleans ignore them.
286
+ */
287
+ filters?: VectorFilter[] | null;
232
288
  }
233
289
  /** A shape made of one or more subpaths (holes and compound shapes included). */
234
290
  interface VectorPathNode extends VectorNodeBase, VectorStyle {
@@ -499,6 +555,329 @@ interface VectorSegmentRef {
499
555
  subpath: number;
500
556
  segment: number;
501
557
  }
558
+ /**
559
+ * Visual filters: `dropShadow` (the node's silhouette, offset and blurred, under it),
560
+ * `innerShadow` (a shadow cast inside the edges), `outerGlow` / `innerGlow` (an unoffset glow
561
+ * outside or inside the edges), `layerBlur` (the whole node blurred) and `feather` (edges faded
562
+ * to transparent).
563
+ */
564
+ type VectorFilterType = 'dropShadow' | 'innerShadow' | 'outerGlow' | 'innerGlow' | 'layerBlur' | 'feather';
565
+ declare const VECTOR_FILTER_TYPES: readonly VectorFilterType[];
566
+ /** A shadow or glow: colour, offset, blur and spread in the node's own units. */
567
+ interface VectorShadowParams {
568
+ color: string;
569
+ /** 0–1: multiplies the colour's own alpha. */
570
+ opacity: number;
571
+ /** Blur radius (the SVG / CSS standard deviation is half of it). */
572
+ blur: number;
573
+ /** Grows the silhouette before blurring (inner effects: chokes it inwards). */
574
+ spread: number;
575
+ }
576
+ /** Parameters of each filter type. Lengths are in the node's own units. */
577
+ interface VectorFilterParamsMap {
578
+ dropShadow: VectorShadowParams & {
579
+ offsetX: number;
580
+ offsetY: number;
581
+ };
582
+ innerShadow: VectorShadowParams & {
583
+ offsetX: number;
584
+ offsetY: number;
585
+ };
586
+ outerGlow: VectorShadowParams;
587
+ innerGlow: VectorShadowParams;
588
+ layerBlur: {
589
+ radius: number;
590
+ };
591
+ /** Fades the edges over `radius` inwards. */
592
+ feather: {
593
+ radius: number;
594
+ };
595
+ }
596
+ /** One entry of a node's filter stack. */
597
+ type VectorFilter = {
598
+ [K in VectorFilterType]: {
599
+ /** Unique within the node. */
600
+ id: string;
601
+ type: K;
602
+ /** Disabled filters are skipped. Default true. */
603
+ enabled?: boolean;
604
+ params: VectorFilterParamsMap[K];
605
+ };
606
+ }[VectorFilterType];
607
+
608
+ /**
609
+ * Live appearance: path effect stacks and live boolean groups, evaluated on demand while the
610
+ * stored anchors and children stay editable.
611
+ *
612
+ * `expandVectorAppearance` is the one place the effected geometry is made (cached per node
613
+ * object, so an edit recomputes only the nodes it replaced). Rendering, hit-testing, bounds,
614
+ * snapping, booleans, the Pathfinder, the Shape Builder and SVG export all read it, the way they
615
+ * read live corners through `subpathsToBezier`; Expand Appearance stores it.
616
+ *
617
+ * Stacking follows After Effects' shape layers (effectcraft `crates/render/src/shapes.rs`): an
618
+ * effect acts on every path above it — the node's own outline, or for a group every path of its
619
+ * children (nested groups included, as drawn by their own effects) — in the order of the stack,
620
+ * and effects placed after a repeater act on its copies. The result paints with the style of the
621
+ * path each shape came from; Merge Paths and live booleans paint with the bottom one's.
622
+ *
623
+ * Live booleans fold their operands bottom to top, each combined with the result below it by its
624
+ * own operation or the group's, and every prefix of the fold is cached under a rolling hash of the
625
+ * operands it covers, so editing one operand recombines only the operands from it up; the cache
626
+ * drops its least recently used half when full. Live groups are hit by their result except while
627
+ * they are being edited (`vectorEnteredGroups`).
628
+ *
629
+ * Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
630
+ * THIRD_PARTY_NOTICES.md): the stacking rule of effectcraft `crates/render/src/shapes.rs`
631
+ * (`collect()`); figcraft `crates/render/src/boolean.rs` (`fold_cached`, `PathCache`) and
632
+ * `crates/engine/src/booleans.rs` (`operand_op`, `result_outline`); and the live-object model of
633
+ * vectorcraft `crates/doc/src/live.rs` (`expand_live`, `expanded_group`, `subtree_has_live`).
634
+ */
635
+
636
+ /** One shape of a node's appearance: a path in the node's own space, painted in `source`'s style. */
637
+ interface VectorAppearanceShape {
638
+ /** The path whose style paints it. */
639
+ source: VectorPathNode;
640
+ path: BezierPath;
641
+ /** Opacity factor relative to the node (its own opacity not included). */
642
+ opacity: number;
643
+ /** Draw-order key (compared element by element). */
644
+ order: number[];
645
+ }
646
+ /** Default parameters of each effect type. */
647
+ declare const VECTOR_EFFECT_DEFAULTS: {
648
+ readonly [K in VectorEffectType]: VectorEffectParamsMap[K];
649
+ };
650
+ declare const VECTOR_EFFECT_LABELS: Record<VectorEffectType, string>;
651
+ /** How a panel edits one effect parameter. */
652
+ type VectorEffectParamSpec = {
653
+ key: string;
654
+ label: string;
655
+ kind: 'number';
656
+ min?: number;
657
+ max?: number;
658
+ step: number;
659
+ slider?: boolean;
660
+ } | {
661
+ key: string;
662
+ label: string;
663
+ kind: 'vec2';
664
+ step: number;
665
+ } | {
666
+ key: string;
667
+ label: string;
668
+ kind: 'boolean';
669
+ } | {
670
+ key: string;
671
+ label: string;
672
+ kind: 'select';
673
+ options: {
674
+ value: string;
675
+ label: string;
676
+ }[];
677
+ };
678
+ /** The editable parameters of each effect type, in panel order. */
679
+ declare const VECTOR_EFFECT_PARAM_SPECS: Record<VectorEffectType, VectorEffectParamSpec[]>;
680
+ /** Envelope parameters. */
681
+ type VectorEnvelopeParams = VectorEffectParamsMap['envelope'];
682
+ /**
683
+ * The envelope's mesh over `bounds` (the paths' combined bounds), in the node's space: its own
684
+ * mesh, the flat mesh of `columns × rows` patches, or a preset split exactly into that many patches.
685
+ */
686
+ declare function vectorEnvelopeMesh(params: VectorEnvelopeParams, bounds: VectorBounds): VectorWarpMesh;
687
+ /** The envelope as a map of the node's space over `bounds`, or null when it changes nothing (or the box is empty). */
688
+ declare function vectorEnvelopeMap(params: VectorEnvelopeParams, bounds: VectorBounds | null): ((p: {
689
+ x: number;
690
+ y: number;
691
+ }) => {
692
+ x: number;
693
+ y: number;
694
+ }) | null;
695
+ /**
696
+ * Effect parameters with defaults filled in and invalid values dropped (unknown keys go too).
697
+ * Returns null for an unknown type.
698
+ */
699
+ declare function normalizeVectorEffectParams<K extends VectorEffectType>(type: K, params: Record<string, unknown> | null | undefined, base?: VectorEffectParamsMap[K]): VectorEffectParamsMap[K] | null;
700
+ /** A new effect of `type` (defaults merged with `params`), or null for an unknown type. */
701
+ declare function createVectorEffect<K extends VectorEffectType>(type: K, id: string, params?: Partial<VectorEffectParamsMap[K]> | Record<string, unknown>): Extract<VectorEffect, {
702
+ type: K;
703
+ }> | null;
704
+ /** The node's effects that take part (enabled, of a known type). */
705
+ declare function activeVectorEffects(node: VectorNode): VectorEffect[];
706
+ /** Whether the node itself draws differently from its stored geometry (effects or a live boolean). */
707
+ declare function hasOwnVectorAppearance(node: VectorNode): boolean;
708
+ /** Whether the node or anything inside it has a live appearance. */
709
+ declare function hasVectorAppearance(node: VectorNode): boolean;
710
+ /** A live boolean group (its children are operands). */
711
+ declare function isVectorLiveBoolean(node: VectorNode | null | undefined): node is VectorGroupNode & {
712
+ liveBoolean: VectorBooleanOperation;
713
+ };
714
+ /** How operand `child` of a live boolean group combines with the operands below it. */
715
+ declare function vectorOperandOperation(group: VectorGroupNode, child: VectorNode): VectorBooleanOperation;
716
+ /** How many boolean steps (one operand combined with the result below it) live booleans have computed: what a cache miss costs. */
717
+ declare function vectorLiveBooleanSteps(): number;
718
+ /** Empties the live boolean prefix cache. */
719
+ declare function clearVectorLiveBooleanCache(): void;
720
+ /** One operand of a live boolean: its outline (group space), fill rule and operation (unused for the bottom one). */
721
+ interface VectorBooleanOperand {
722
+ path: BezierPath;
723
+ fillRule: VectorFillRule;
724
+ operation: VectorBooleanOperation;
725
+ }
726
+ /**
727
+ * The result of folding `operands` bottom to top, reusing the longest cached prefix: only the
728
+ * operands above it are combined. Invalid geometry gives an empty path.
729
+ */
730
+ declare function foldVectorBooleanOperands(operands: readonly VectorBooleanOperand[]): BezierPath;
731
+ /** Applies an effect stack to shapes, top to bottom (disabled effects skipped). */
732
+ declare function applyVectorEffects(shapes: readonly VectorAppearanceShape[], effects: readonly VectorEffect[] | null | undefined): VectorAppearanceShape[];
733
+ /** The paths entering effect `effectId` of the node's stack (those above it applied), in the node's own space. */
734
+ declare function vectorEffectInputPaths(node: VectorNode, effectId: string): BezierPath[] | null;
735
+ /** The box effect `effectId` (an envelope) bends: the combined bounds of the paths entering it, in the node's own space. */
736
+ declare function vectorEffectInputBounds(node: VectorNode, effectId: string): VectorBounds | null;
737
+ /** The node's first enabled envelope effect, or null. */
738
+ declare function vectorNodeEnvelope(node: VectorNode | null | undefined): Extract<VectorEffect, {
739
+ type: 'envelope';
740
+ }> | null;
741
+ /**
742
+ * The editable mesh of a node's envelope (its own mesh, or the preset or flat mesh it stands for)
743
+ * with the box it bends, in the node's own space; null without an envelope or contents.
744
+ */
745
+ declare function vectorEnvelopeFrame(node: VectorNode, effectId?: string): {
746
+ effectId: string;
747
+ bounds: VectorBounds;
748
+ mesh: VectorWarpMesh;
749
+ } | null;
750
+ /**
751
+ * What a node draws as: shapes in its own space (its `transform` and opacity not applied),
752
+ * bottom to top, with its effects and those of everything inside it applied. Cached per node
753
+ * object.
754
+ */
755
+ declare function vectorAppearanceShapes(node: VectorNode): VectorAppearanceShape[];
756
+ /** Everything a node draws as one path in its own space (live corners cut, effects applied). */
757
+ declare function vectorAppearanceOutline(node: VectorNode): BezierPath;
758
+ /** What a node draws as, one plain path per shape (ids `<id>~fx<n>`, opacity relative to the node). */
759
+ declare function vectorAppearanceNodes(node: VectorNode): VectorPathNode[];
760
+ /**
761
+ * The node as plain geometry: path effects and live booleans evaluated into paths (the node
762
+ * itself when nothing inside it is live). A path keeps its id when it draws as one shape;
763
+ * otherwise, like any live group, it becomes a group with that id holding one path per shape
764
+ * (ids `<id>~fx<n>`). Groups without effects of their own keep their structure. Cached per node.
765
+ */
766
+ declare function expandVectorAppearance(node: VectorNode): VectorNode;
767
+ /** Every node of a list expanded (the same array when nothing in it is live). */
768
+ declare function expandVectorAppearances(nodes: readonly VectorNode[]): VectorNode[];
769
+ /**
770
+ * Reads effects from untrusted data (JSON, agent input): unknown types and malformed entries are
771
+ * dropped, parameters normalized, ids made unique.
772
+ */
773
+ declare function sanitizeVectorEffects(value: unknown): VectorEffect[];
774
+ /**
775
+ * Effect parameters carried through a linear map baked into a node's geometry (scaling or
776
+ * flipping it): offsets and positions move with it, angles turn the other way when it mirrors.
777
+ * Lengths such as sizes and radii are kept, like stroke widths.
778
+ */
779
+ declare function transformVectorEffects(effects: readonly VectorEffect[], m: AffineMatrix, node?: VectorNode): VectorEffect[];
780
+ /**
781
+ * The live groups (live booleans and groups with effects) being edited: those in `ids` and those
782
+ * holding a node in `ids`. Their children are hit and outlined as stored instead of as drawn, so
783
+ * each operand can be picked (figcraft `crates/engine/src/booleans.rs`, `result_outline`).
784
+ */
785
+ declare function vectorEnteredGroups(nodes: readonly VectorNode[], ids: readonly string[]): Set<string>;
786
+
787
+ /**
788
+ * Visual filters of vector nodes: drop shadow, inner shadow, outer and inner glow, layer blur and
789
+ * feather, drawn as one SVG `<filter>` per node (in the canvases and in SVG export alike).
790
+ *
791
+ * The filter takes everything the node draws (`SourceGraphic`) and its silhouette
792
+ * (`SourceAlpha`) in the node's own space, and builds, in this order:
793
+ *
794
+ * 1. Inner shadows and inner glows, in stack order, over the body: the inverse of the silhouette
795
+ * (offset for a shadow), grown by `spread` (which chokes the shadow inwards), blurred, coloured
796
+ * and clipped to the silhouette.
797
+ * 2. Feather: the body kept where the silhouette, eroded by half the radius and blurred by a
798
+ * quarter of it, is, so the edge fades from about nothing at the outline to full strength
799
+ * `radius` inside.
800
+ * 3. Drop shadows and outer glows, in stack order, under the body: the silhouette grown by
801
+ * `spread`, blurred, offset (shadows) and coloured.
802
+ * 4. Layer blurs, over the whole result (shadows included).
803
+ *
804
+ * Blur radii are CSS / Figma blur radii: the Gaussian's standard deviation is half the radius, and
805
+ * it reaches about 1.5 radii. Background blur needs the backdrop, which an SVG filter cannot read
806
+ * (`BackgroundImage` was dropped from browsers) and which other SVG readers cannot either, so it is
807
+ * left to the planned lens objects.
808
+ *
809
+ * The construction of feather, glows and inner shadows from blur, offset and clip follows
810
+ * designcraft `crates/render/src/fx.rs` (`draw_item_fx`, `inner_edge`, `split`); the effect set,
811
+ * defaults and reach follow figcraft `crates/doc/src/props.rs` (`EffectKind`, `Shadow`,
812
+ * `Effect::reach`). Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
813
+ * THIRD_PARTY_NOTICES.md).
814
+ */
815
+
816
+ /** Default parameters of each filter type. */
817
+ declare const VECTOR_FILTER_DEFAULTS: {
818
+ readonly [K in VectorFilterType]: VectorFilterParamsMap[K];
819
+ };
820
+ declare const VECTOR_FILTER_LABELS: Readonly<Record<VectorFilterType, string>>;
821
+ /** How a panel edits one filter parameter: an effect parameter spec, or a colour. */
822
+ type VectorFilterParamSpec = VectorEffectParamSpec | {
823
+ key: string;
824
+ label: string;
825
+ kind: 'color';
826
+ };
827
+ /** The editable parameters of each filter type, in panel order. */
828
+ declare const VECTOR_FILTER_PARAM_SPECS: Readonly<Record<VectorFilterType, readonly VectorFilterParamSpec[]>>;
829
+ declare function isVectorFilterType(value: unknown): value is VectorFilterType;
830
+ /**
831
+ * Filter parameters with defaults (or `base`) filled in; values of the wrong type are dropped,
832
+ * numbers clamped to their range, unknown keys ignored. Null for an unknown type.
833
+ */
834
+ declare function normalizeVectorFilterParams<K extends VectorFilterType>(type: K, params: Record<string, unknown> | null | undefined, base?: VectorFilterParamsMap[K]): VectorFilterParamsMap[K] | null;
835
+ /** The parameter keys a filter type takes (for error messages). */
836
+ declare function vectorFilterParamKeys(type: VectorFilterType): string[];
837
+ /** A new filter of `type` (defaults merged with `params`), or null for an unknown type. */
838
+ declare function createVectorFilter<K extends VectorFilterType>(type: K, id: string, params?: Partial<VectorFilterParamsMap[K]> | Record<string, unknown>): Extract<VectorFilter, {
839
+ type: K;
840
+ }> | null;
841
+ /**
842
+ * Reads filters from untrusted data (JSON, agent input, SVG): unknown types and malformed entries
843
+ * are dropped, parameters normalized, ids made unique.
844
+ */
845
+ declare function sanitizeVectorFilters(value: unknown): VectorFilter[];
846
+ /** The node's filters that draw something (enabled, known, with a visible result). */
847
+ declare function activeVectorFilters(node: Pick<VectorNode, 'filters'>): VectorFilter[];
848
+ /** How far a node's filters can paint past what it draws, in its own units. */
849
+ declare function vectorFilterReach(filters: readonly VectorFilter[]): number;
850
+ /** One SVG filter primitive as data: a tag (`feGaussianBlur`, …), its attributes and children. */
851
+ interface VectorFilterPrimitive {
852
+ tag: string;
853
+ attrs: Readonly<Record<string, string | number>>;
854
+ children?: VectorFilterPrimitive[];
855
+ }
856
+ /**
857
+ * A node's filter as data: draw `<filter id filterUnits="userSpaceOnUse" x y width height
858
+ * color-interpolation-filters="sRGB">` with the primitives inside, and reference it with
859
+ * `filter="url(#id)"` on the node's element. The region is in the node's own space.
860
+ */
861
+ interface VectorRenderFilter {
862
+ id: string;
863
+ x: number;
864
+ y: number;
865
+ width: number;
866
+ height: number;
867
+ primitives: VectorFilterPrimitive[];
868
+ }
869
+ /**
870
+ * The SVG filter for `filters` over a node whose drawing covers `bounds` (its own space, strokes
871
+ * included), or null when none of them draws.
872
+ */
873
+ declare function vectorFilterSvg(filters: readonly VectorFilter[], id: string, bounds: VectorBounds | null): VectorRenderFilter | null;
874
+ /** A render filter as SVG markup (`extra` is added to the `<filter>` element's attributes). */
875
+ declare function vectorFilterMarkup(filter: VectorRenderFilter, extra?: string): string;
876
+ /** Labels of the filter types, for menus. */
877
+ declare const VECTOR_FILTER_MENU: readonly {
878
+ type: VectorFilterType;
879
+ label: string;
880
+ }[];
502
881
 
503
882
  /** True when `paint` is a gradient (any style). */
504
883
  declare function isVectorGradient(paint: VectorPaint | undefined): paint is VectorGradient;
@@ -847,6 +1226,13 @@ interface VectorRenderStrokeParts {
847
1226
  }
848
1227
  /** The stroke parts of a path whose stroke needs more than one element, in its own space (undefined otherwise). */
849
1228
  declare function vectorStrokeSvgParts(node: VectorPathNode, clipId: string, precision?: number): VectorRenderStrokeParts | undefined;
1229
+ /**
1230
+ * The box a node draws over in its own space (its `transform` not applied): its geometry as drawn
1231
+ * (effects applied), padded by how far its strokes reach. Null when it draws nothing.
1232
+ */
1233
+ declare function vectorNodeLocalPaintBounds(node: VectorNode): VectorBounds | null;
1234
+ /** A node's filter (`node.filters`) as render data with id `id`, or null when none draws. Cached per node. */
1235
+ declare function vectorNodeFilterSvg(node: VectorNode, id: string): VectorRenderFilter | null;
850
1236
  /** A width profile as a data attribute: `t,left,right` points separated by `;`. */
851
1237
  declare function widthProfileToAttribute(points: readonly VectorWidthPoint[], precision?: number): string;
852
1238
  /** Reads `widthProfileToAttribute` output (invalid points are dropped). */
@@ -856,10 +1242,17 @@ declare function vectorDocumentToSvg(doc: VectorDocument, options?: VectorSvgExp
856
1242
  interface VectorSvgImportOptions {
857
1243
  /** Makes ids for elements without a usable `id` (default `node-1`, `node-2`, …). */
858
1244
  createId?: () => string;
1245
+ /**
1246
+ * Merge neighbouring shapes with the same outline into one path with stacked fills and strokes,
1247
+ * as design tools export several paints on one layer (default false: an SVG may hold identical
1248
+ * shapes on purpose). Shapes merge only when the paint order stays the same (no stroke under a
1249
+ * later fill) and they share opacity, visibility, filters and blend mode.
1250
+ */
1251
+ mergeStackedShapes?: boolean;
859
1252
  }
860
1253
  /** Parses an SVG `transform` attribute into one matrix. */
861
1254
  declare function parseSvgTransform(value: string | undefined): AffineMatrix;
862
1255
  /** Parses SVG markup into a vector document. Throws when there is no `<svg>` element. */
863
1256
  declare function parseVectorSvg(svg: string, options?: VectorSvgImportOptions): VectorDocument;
864
1257
 
865
- export { VECTOR_CORNER_KINDS as $, type VectorDefaults as A, type VectorStyle as B, type VectorHandleRef as C, type VectorSegmentRef as D, type VectorBlendOptions as E, type VectorModifiers as F, type VectorGradientPatch as G, type VectorAlign as H, type VectorDistribute as I, type VectorArrange as J, type VectorAverageAxis as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorRenderStrokeParts as S, type VectorPaintDef as T, type VectorArrowAlign as U, type VectorDocument as V, type VectorBlend as W, type VectorMergeMode as X, type VectorLineJoin as Y, VECTOR_ARROWHEADS as Z, VECTOR_BLEND_SPACINGS as _, type VectorNode as a, vectorGradientAspect as a$, VECTOR_EFFECT_TYPES as a0, VECTOR_GRADIENT_INTERPOLATIONS as a1, VECTOR_GRADIENT_MAX_PERIODS as a2, VECTOR_GRADIENT_MIN_STOPS as a3, VECTOR_GRADIENT_SPREADS as a4, VECTOR_GRADIENT_TYPES as a5, VECTOR_MERGE_MODES as a6, VECTOR_PATHFINDER_OPERATIONS as a7, VECTOR_STROKE_GRADIENT_MODES as a8, VECTOR_TOOLS as a9, isVectorGradient as aA, mapVectorGradient as aB, mapVectorPaint as aC, moveVectorGradientHandle as aD, moveVectorGradientStop as aE, parseSvgTransform as aF, parseVectorColor as aG, parseVectorSvg as aH, patternAttrs as aI, periodicVectorGradientStops as aJ, pinVectorGradient as aK, removeVectorGradientStop as aL, reverseVectorGradient as aM, samplePlainStops as aN, sampleVectorGradient as aO, sampleVectorGradientAt as aP, sampleVectorPaintDefAt as aQ, sanitizeVectorGradient as aR, setVectorGradientVector as aS, sortedVectorGradientStops as aT, spanVectorGradientStops as aU, transformVectorGradient as aV, transformVectorPaint as aW, vectorBoxMatrix as aX, vectorCornersAttribute as aY, vectorDocumentToSvg as aZ, vectorGradientArea as a_, VECTOR_TRANSFORM_HANDLES as aa, type VectorCorner as ab, type VectorGradientPoints as ac, type VectorGradientRamp as ad, type VectorGradientSvgOptions as ae, type VectorGradientUnits as af, type VectorLineCap as ag, type VectorMatrix as ah, type VectorPaintSvgOptions as ai, type VectorRgba as aj, type VectorSvgImportOptions as ak, type VectorSvgPatternDef as al, type VectorSvgWrapper as am, type VectorWarpStyle as an, applyVectorCornersAttribute as ao, applyVectorGradientPatch as ap, applyVectorGradientSpread as aq, convertVectorGradient as ar, defaultVectorGradient as as, expandVectorGradientSpread as at, expandVectorGradientStops as au, explicitVectorGradient as av, gradientMidpointRemap as aw, hasExplicitGradientGeometry as ax, insertVectorGradientStop as ay, isCentredVectorGradient as az, type VectorBounds as b, vectorGradientFocalParam as b0, vectorGradientHandles as b1, vectorGradientMatrix as b2, vectorGradientMidpointFromPosition as b3, vectorGradientMidpointPosition as b4, vectorGradientNeedsExpansion as b5, vectorGradientParam as b6, vectorGradientPoints as b7, vectorGradientRamp as b8, vectorGradientSvgDefs as b9, vectorGradientTAt as ba, vectorGradientUnitsMatrix as bb, vectorPaintToSvg as bc, vectorPathLocalBounds as bd, vectorStrokeSvgParts as be, widthProfileFromAttribute as bf, widthProfileToAttribute as bg, type VectorSvgExportOptions as c, type Vec2 as d, type VectorSubpath as e, type VectorAnchor as f, type VectorPathNode as g, type VectorAnchorType as h, type VectorPaint as i, type VectorGroupNode as j, type VectorCornerKind as k, type VectorWidthPoint as l, type VectorGradientHandle as m, type VectorGradient as n, type VectorGradientStop as o, type VectorViewport as p, type VectorEffectType as q, type VectorEffectParamsMap as r, type VectorFillRule as s, type VectorBooleanOperation as t, type VectorEffect as u, type VectorWarpMesh as v, type VectorTransformHandle as w, type VectorAnchorRef as x, type VectorPathfinderOperation as y, type VectorTool as z };
1258
+ export { type VectorStrokeLayer as $, type VectorGradientPatch as A, type VectorBlendMode as B, type VectorFilterType as C, type VectorEffectType as D, type VectorEnvelopeParams as E, type VectorAlign as F, type VectorDistribute as G, type VectorArrange as H, type VectorBooleanOperation as I, type VectorAverageAxis as J, type VectorWarpMesh as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorFilterParamSpec as S, type VectorEffectParamSpec as T, type VectorRenderStrokeParts as U, type VectorDocument as V, type VectorPaintDef as W, type VectorRenderFilter as X, type VectorArrowAlign as Y, type VectorEffect as Z, type VectorPaintLayer as _, type VectorNode as a, explicitVectorGradient as a$, type VectorFilter as a0, type VectorBlend as a1, type VectorMergeMode as a2, type VectorLineJoin as a3, type VectorEffectParamsMap as a4, type VectorStrokeSettings as a5, VECTOR_ARROWHEADS as a6, VECTOR_BLEND_MODES as a7, VECTOR_BLEND_SPACINGS as a8, VECTOR_CORNER_KINDS as a9, type VectorGradientRamp as aA, type VectorGradientSvgOptions as aB, type VectorGradientUnits as aC, type VectorLineCap as aD, type VectorMatrix as aE, type VectorPaintSvgOptions as aF, type VectorRgba as aG, type VectorStrokeLayerKind as aH, type VectorSvgImportOptions as aI, type VectorSvgPatternDef as aJ, type VectorSvgWrapper as aK, type VectorWarpStyle as aL, activeVectorEffects as aM, activeVectorFilters as aN, applyVectorCornersAttribute as aO, applyVectorEffects as aP, applyVectorGradientPatch as aQ, applyVectorGradientSpread as aR, clearVectorLiveBooleanCache as aS, convertVectorGradient as aT, createVectorEffect as aU, createVectorFilter as aV, defaultVectorGradient as aW, expandVectorAppearance as aX, expandVectorAppearances as aY, expandVectorGradientSpread as aZ, expandVectorGradientStops as a_, VECTOR_EFFECT_DEFAULTS as aa, VECTOR_EFFECT_LABELS as ab, VECTOR_EFFECT_PARAM_SPECS as ac, VECTOR_EFFECT_TYPES as ad, VECTOR_FILTER_DEFAULTS as ae, VECTOR_FILTER_LABELS as af, VECTOR_FILTER_MENU as ag, VECTOR_FILTER_PARAM_SPECS as ah, VECTOR_FILTER_TYPES as ai, VECTOR_GRADIENT_INTERPOLATIONS as aj, VECTOR_GRADIENT_MAX_PERIODS as ak, VECTOR_GRADIENT_MIN_STOPS as al, VECTOR_GRADIENT_SPREADS as am, VECTOR_GRADIENT_TYPES as an, VECTOR_MERGE_MODES as ao, VECTOR_PATHFINDER_OPERATIONS as ap, VECTOR_STROKE_GRADIENT_MODES as aq, VECTOR_TOOLS as ar, VECTOR_TRANSFORM_HANDLES as as, type VectorAppearanceShape as at, type VectorBooleanOperand as au, type VectorCorner as av, type VectorFillRule as aw, type VectorFilterParamsMap as ax, type VectorFilterPrimitive as ay, type VectorGradientPoints as az, type VectorBounds as b, vectorGradientRamp as b$, foldVectorBooleanOperands as b0, gradientMidpointRemap as b1, hasExplicitGradientGeometry as b2, hasOwnVectorAppearance as b3, hasVectorAppearance as b4, insertVectorGradientStop as b5, isCentredVectorGradient as b6, isVectorFilterType as b7, isVectorGradient as b8, isVectorLiveBoolean as b9, transformVectorPaint as bA, vectorAppearanceNodes as bB, vectorAppearanceOutline as bC, vectorAppearanceShapes as bD, vectorBoxMatrix as bE, vectorCornersAttribute as bF, vectorDocumentToSvg as bG, vectorEffectInputBounds as bH, vectorEffectInputPaths as bI, vectorEnteredGroups as bJ, vectorEnvelopeFrame as bK, vectorEnvelopeMap as bL, vectorEnvelopeMesh as bM, vectorFilterMarkup as bN, vectorFilterParamKeys as bO, vectorFilterReach as bP, vectorFilterSvg as bQ, vectorGradientArea as bR, vectorGradientAspect as bS, vectorGradientFocalParam as bT, vectorGradientHandles as bU, vectorGradientMatrix as bV, vectorGradientMidpointFromPosition as bW, vectorGradientMidpointPosition as bX, vectorGradientNeedsExpansion as bY, vectorGradientParam as bZ, vectorGradientPoints as b_, mapVectorGradient as ba, mapVectorPaint as bb, moveVectorGradientHandle as bc, moveVectorGradientStop as bd, normalizeVectorEffectParams as be, normalizeVectorFilterParams as bf, parseSvgTransform as bg, parseVectorColor as bh, parseVectorSvg as bi, patternAttrs as bj, periodicVectorGradientStops as bk, pinVectorGradient as bl, removeVectorGradientStop as bm, reverseVectorGradient as bn, samplePlainStops as bo, sampleVectorGradient as bp, sampleVectorGradientAt as bq, sampleVectorPaintDefAt as br, sanitizeVectorEffects as bs, sanitizeVectorFilters as bt, sanitizeVectorGradient as bu, setVectorGradientVector as bv, sortedVectorGradientStops as bw, spanVectorGradientStops as bx, transformVectorEffects as by, transformVectorGradient as bz, type VectorSvgExportOptions as c, vectorGradientSvgDefs as c0, vectorGradientTAt as c1, vectorGradientUnitsMatrix as c2, vectorLiveBooleanSteps as c3, vectorNodeEnvelope as c4, vectorNodeFilterSvg as c5, vectorNodeLocalPaintBounds as c6, vectorOperandOperation as c7, vectorPaintToSvg as c8, vectorPathLocalBounds as c9, vectorStrokeSvgParts as ca, widthProfileFromAttribute as cb, widthProfileToAttribute as cc, type Vec2 as d, type VectorSubpath as e, type VectorAnchor as f, type VectorPathNode as g, type VectorAnchorType as h, type VectorPaint as i, type VectorGroupNode as j, type VectorCornerKind as k, type VectorWidthPoint as l, type VectorGradientHandle as m, type VectorGradient as n, type VectorGradientStop as o, type VectorViewport as p, type VectorTransformHandle as q, type VectorAnchorRef as r, type VectorPathfinderOperation as s, type VectorTool as t, type VectorDefaults as u, type VectorStyle as v, type VectorHandleRef as w, type VectorSegmentRef as x, type VectorBlendOptions as y, type VectorModifiers as z };