@pixerate/editor 0.211.0 → 0.213.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.
@@ -2,7 +2,7 @@ import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, Creat
2
2
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.js';
3
3
  import { type MagneticEdgeOptions } from './selection/magnetic.js';
4
4
  import type { ObjectTarget } from './selection/segment/grabcut.js';
5
- import { type DocumentPath } from './paths.js';
5
+ import { type DocumentPath, type PathEditTarget } from './paths.js';
6
6
  import { type SelectionJob, type SelectionJobResult, type SelectionWorkerFactory } from './selection/worker.js';
7
7
  import type { SelectionProgress } from './selection/segment/work.js';
8
8
  import type { FocusAreaOptions } from './selection/segment/focus.js';
@@ -20,7 +20,7 @@ import { type RefineEdit } from './selection/refine-edits.js';
20
20
  import { type LayerMaskProps } from './selection/layer-mask.js';
21
21
  import { type AlphaChannel } from './selection/channels.js';
22
22
  import type { AdjustmentLayerMask } from './types.js';
23
- import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeFillRule, type VectorMask, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TextOrientation, type TypeLayer, type ImageEffectAnimation } from './layers/model.js';
23
+ import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeComponent, type ShapeFillRule, type VectorMask, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TextOrientation, type TypeLayer, type ImageEffectAnimation } from './layers/model.js';
24
24
  import { type TextLayout, type TextShaper } from './layers/text.js';
25
25
  import type { VectorSubpath } from '../vector/types.js';
26
26
  import { EffectsSlot } from '../effects/helpers.js';
@@ -479,12 +479,17 @@ export interface StrokeSelectionOptions extends Omit<FillOptions, 'useSelection'
479
479
  /** Where the band lies against the selection edge (default `outside`). */
480
480
  location?: 'inside' | 'center' | 'outside';
481
481
  }
482
+ /** Where Content-Aware Fill puts its result. */
483
+ export type ContentAwareFillOutput = 'current' | 'new-layer' | 'duplicate-layer';
482
484
  /** Edit › Content-Aware Fill (see `contentAwareFill`). */
483
485
  export interface ContentAwareFillOptions {
484
486
  /** The pixel layer to sample and fill (default the active layer). */
485
487
  layerId?: string;
486
- /** `current` (default) paints into the layer; `new-layer` puts the fill on a new layer above it. */
487
- output?: 'current' | 'new-layer';
488
+ /**
489
+ * `current` (default) paints into the layer; `new-layer` puts the fill on a new layer above it;
490
+ * `duplicate-layer` paints it into a copy of the layer, above it.
491
+ */
492
+ output?: ContentAwareFillOutput;
488
493
  /** How far around the selection to sample, in pixels (default its larger side, at least 32). */
489
494
  sampleRadius?: number;
490
495
  /** Random seed: the same seed gives the same fill (default 0). */
@@ -1106,6 +1111,26 @@ export declare class ImageEditorController {
1106
1111
  }): DocumentPath;
1107
1112
  /** Replaces a path's geometry (its name is kept). One undo step. */
1108
1113
  setPathGeometry(id: string, input: VectorMaskPathInput): DocumentPath;
1114
+ /**
1115
+ * What the path tools (Path Selection, Direct Selection, Pen) edit: the active path in the Paths
1116
+ * panel, else the active layer when it is a shape, else the active layer's vector mask; null
1117
+ * when there is none of these (the Pen then starts a new Work Path).
1118
+ */
1119
+ pathEditTarget(): PathEditTarget | null;
1120
+ /** The components a path tool target holds (document pixels). Throws for a target that is gone. */
1121
+ getPathEditComponents(target: PathEditTarget): ShapeComponent[];
1122
+ /**
1123
+ * Replaces a path tool target's components: one undo step, or none with `commitToHistory` false
1124
+ * (the later moves of a drag whose first move recorded one). A component that still has its
1125
+ * `live` shape is kept as given (drop `live` from one whose anchors changed); a shape layer keeps
1126
+ * at least one component.
1127
+ */
1128
+ setPathEditComponents(target: PathEditTarget, components: readonly ShapeComponent[], commitToHistory?: boolean): void;
1129
+ /**
1130
+ * The Pen with no path to add to: a new Work Path from `components` (replacing the last one,
1131
+ * unless it was saved), made the active path. One undo step. Returns the path.
1132
+ */
1133
+ startWorkPath(components: readonly ShapeComponent[]): DocumentPath;
1109
1134
  /** Renames a path; renaming the Work Path saves it (Photoshop's Save Path). One undo step. */
1110
1135
  renamePath(id: string, name: string): DocumentPath;
1111
1136
  /** Duplicates a path as a saved path. One undo step. */
@@ -1528,7 +1553,7 @@ export declare class ImageEditorController {
1528
1553
  contentAwareFill(options?: ContentAwareFillOptions): {
1529
1554
  layerId: string;
1530
1555
  bounds: CropBox;
1531
- output: 'current' | 'new-layer';
1556
+ output: ContentAwareFillOutput;
1532
1557
  };
1533
1558
  /**
1534
1559
  * `contentAwareFill` with the synthesis in the selection worker when there is one, with
@@ -1540,7 +1565,7 @@ export declare class ImageEditorController {
1540
1565
  }): Promise<{
1541
1566
  layerId: string;
1542
1567
  bounds: CropBox;
1543
- output: 'current' | 'new-layer';
1568
+ output: ContentAwareFillOutput;
1544
1569
  }>;
1545
1570
  /**
1546
1571
  * The fill without changing anything: the window, its pixels before and after (RGBA, the fill