@pixerate/editor 0.185.0 → 0.186.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/{chunk-GYYSPMVU.js → chunk-FW7N64XK.js} +295 -188
- package/dist/{chunk-C6TRAAG4.cjs → chunk-X2KQQZBT.cjs} +355 -248
- package/dist/image-editor/controller.d.cts +56 -0
- package/dist/image-editor/controller.d.ts +56 -0
- package/dist/image-editor/index.cjs +1461 -1030
- package/dist/image-editor/index.js +447 -16
- package/dist/image-editor/layers/model.d.cts +5 -1
- package/dist/image-editor/layers/model.d.ts +5 -1
- package/dist/image-editor/layers/paint-ui.d.cts +2 -1
- package/dist/image-editor/layers/paint-ui.d.ts +2 -1
- package/dist/image-editor/layers/serialize.d.cts +3 -0
- package/dist/image-editor/layers/serialize.d.ts +3 -0
- package/dist/image-editor/psd/channels.d.cts +24 -0
- package/dist/image-editor/psd/channels.d.ts +24 -0
- package/dist/image-editor/psd/export.d.cts +3 -0
- package/dist/image-editor/psd/export.d.ts +3 -0
- package/dist/image-editor/psd/import.d.cts +10 -0
- package/dist/image-editor/psd/import.d.ts +10 -0
- package/dist/image-editor/renderer.d.cts +6 -0
- package/dist/image-editor/renderer.d.ts +6 -0
- package/dist/image-editor/selection/channels.d.cts +52 -0
- package/dist/image-editor/selection/channels.d.ts +52 -0
- package/dist/image-editor/selection/gesture.d.cts +7 -0
- package/dist/image-editor/selection/gesture.d.ts +7 -0
- package/dist/image-editor/selection/index.d.cts +1 -0
- package/dist/image-editor/selection/index.d.ts +1 -0
- package/dist/image-editor/selection/overlay.d.cts +2 -0
- package/dist/image-editor/selection/overlay.d.ts +2 -0
- package/dist/image-editor/tools.d.cts +3 -1
- package/dist/image-editor/tools.d.ts +3 -1
- package/dist/image-editor/types.d.cts +10 -0
- package/dist/image-editor/types.d.ts +10 -0
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +7 -0
- package/skills/pixerate-image-selection-masking/SKILL.md +13 -1
|
@@ -9,6 +9,7 @@ import { type SelectionModifyOp } from './selection/modify.cjs';
|
|
|
9
9
|
import { type SegmentationProvider } from './selection/segmentation.cjs';
|
|
10
10
|
import { type RefineEdgeParams } from './selection/refine.cjs';
|
|
11
11
|
import { type LayerMaskProps } from './selection/layer-mask.cjs';
|
|
12
|
+
import { type AlphaChannel } from './selection/channels.cjs';
|
|
12
13
|
import type { AdjustmentLayerMask } from './types.cjs';
|
|
13
14
|
import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeFillRule, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TypeLayer, type ImageEffectAnimation } from './layers/model.cjs';
|
|
14
15
|
import { type TextLayout, type TextShaper } from './layers/text.cjs';
|
|
@@ -354,6 +355,8 @@ export interface FillOptions {
|
|
|
354
355
|
/** Limit to the selection when there is one (default true). */
|
|
355
356
|
useSelection?: boolean;
|
|
356
357
|
}
|
|
358
|
+
/** The `layerId` paint results report for Quick Mask edits (the selection, not a layer). */
|
|
359
|
+
export declare const QUICK_MASK_TARGET = "quick-mask";
|
|
357
360
|
/** Edit › Stroke (see `strokeSelection`). */
|
|
358
361
|
export interface StrokeSelectionOptions extends Omit<FillOptions, 'useSelection'> {
|
|
359
362
|
/** Width of the band in pixels (0 < width ≤ 250). */
|
|
@@ -1474,6 +1477,59 @@ export declare class ImageEditorController {
|
|
|
1474
1477
|
* it (the selection still applies). View state: no undo step, not saved.
|
|
1475
1478
|
*/
|
|
1476
1479
|
setSelectionDisplay(display: SelectionDisplay): void;
|
|
1480
|
+
/** The alpha channels (saved selections), in panel order. */
|
|
1481
|
+
getChannels(): readonly AlphaChannel[];
|
|
1482
|
+
getChannel(id: string): AlphaChannel | null;
|
|
1483
|
+
private requireChannel;
|
|
1484
|
+
private setChannels;
|
|
1485
|
+
private newChannelId;
|
|
1486
|
+
/**
|
|
1487
|
+
* Select › Save Selection: a new alpha channel (`name`, default "Alpha n") holding the
|
|
1488
|
+
* selection, or with `channelId` the selection combined into that channel by `mode` (replace,
|
|
1489
|
+
* add, subtract, intersect). One undo step. Throws without a selection.
|
|
1490
|
+
*/
|
|
1491
|
+
saveSelection(options?: {
|
|
1492
|
+
channelId?: string;
|
|
1493
|
+
name?: string;
|
|
1494
|
+
mode?: SelectionMode;
|
|
1495
|
+
}): AlphaChannel;
|
|
1496
|
+
/**
|
|
1497
|
+
* Select › Load Selection from an alpha channel (inverted with `invert`), combined with the
|
|
1498
|
+
* selection by `mode`. One undo step.
|
|
1499
|
+
*/
|
|
1500
|
+
loadSelectionFromChannel(id: string, options?: {
|
|
1501
|
+
mode?: SelectionMode;
|
|
1502
|
+
invert?: boolean;
|
|
1503
|
+
}): boolean;
|
|
1504
|
+
/** Changes a channel's name, overlay colour, opacity, what it indicates or visibility (one undo step). */
|
|
1505
|
+
setChannelProperties(id: string, props: Partial<Pick<AlphaChannel, 'name' | 'color' | 'opacity' | 'indicates' | 'visible'>>): AlphaChannel;
|
|
1506
|
+
/** Deletes an alpha channel (one undo step). */
|
|
1507
|
+
deleteChannel(id: string): void;
|
|
1508
|
+
/** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
|
|
1509
|
+
duplicateChannel(id: string, name?: string): AlphaChannel;
|
|
1510
|
+
/** Channel summaries (no pixels) for panels and agents. */
|
|
1511
|
+
describeChannels(): {
|
|
1512
|
+
bounds: CropBox | null;
|
|
1513
|
+
percent: number;
|
|
1514
|
+
id: string;
|
|
1515
|
+
name: string;
|
|
1516
|
+
color: string;
|
|
1517
|
+
opacity: number;
|
|
1518
|
+
indicates: "masked" | "selected";
|
|
1519
|
+
visible: boolean;
|
|
1520
|
+
}[];
|
|
1521
|
+
/** Whether Quick Mask mode is on (painting edits the selection). */
|
|
1522
|
+
get quickMaskEditing(): boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* Quick Mask mode (Q): on, the selection shows as a tint and painting, fills and strokes that
|
|
1525
|
+
* name no layer edit the selection itself (white selects, black deselects, grey partly);
|
|
1526
|
+
* off, it shows as marching ants again. View state: no undo step (the edits are).
|
|
1527
|
+
*/
|
|
1528
|
+
setQuickMaskMode(on: boolean): void;
|
|
1529
|
+
/** The selection as a 1-channel surface to paint in Quick Mask mode. */
|
|
1530
|
+
private quickMaskSurface;
|
|
1531
|
+
/** The selection a painted Quick Mask surface stands for (`rects` changed since `base`). */
|
|
1532
|
+
private selectionFromSurface;
|
|
1477
1533
|
private maskFromSelection;
|
|
1478
1534
|
/**
|
|
1479
1535
|
* Adds the selection as the layer's mask (Reveal Selection), replacing any mask, as one undo
|
|
@@ -9,6 +9,7 @@ import { type SelectionModifyOp } from './selection/modify.js';
|
|
|
9
9
|
import { type SegmentationProvider } from './selection/segmentation.js';
|
|
10
10
|
import { type RefineEdgeParams } from './selection/refine.js';
|
|
11
11
|
import { type LayerMaskProps } from './selection/layer-mask.js';
|
|
12
|
+
import { type AlphaChannel } from './selection/channels.js';
|
|
12
13
|
import type { AdjustmentLayerMask } from './types.js';
|
|
13
14
|
import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeFillRule, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TypeLayer, type ImageEffectAnimation } from './layers/model.js';
|
|
14
15
|
import { type TextLayout, type TextShaper } from './layers/text.js';
|
|
@@ -354,6 +355,8 @@ export interface FillOptions {
|
|
|
354
355
|
/** Limit to the selection when there is one (default true). */
|
|
355
356
|
useSelection?: boolean;
|
|
356
357
|
}
|
|
358
|
+
/** The `layerId` paint results report for Quick Mask edits (the selection, not a layer). */
|
|
359
|
+
export declare const QUICK_MASK_TARGET = "quick-mask";
|
|
357
360
|
/** Edit › Stroke (see `strokeSelection`). */
|
|
358
361
|
export interface StrokeSelectionOptions extends Omit<FillOptions, 'useSelection'> {
|
|
359
362
|
/** Width of the band in pixels (0 < width ≤ 250). */
|
|
@@ -1474,6 +1477,59 @@ export declare class ImageEditorController {
|
|
|
1474
1477
|
* it (the selection still applies). View state: no undo step, not saved.
|
|
1475
1478
|
*/
|
|
1476
1479
|
setSelectionDisplay(display: SelectionDisplay): void;
|
|
1480
|
+
/** The alpha channels (saved selections), in panel order. */
|
|
1481
|
+
getChannels(): readonly AlphaChannel[];
|
|
1482
|
+
getChannel(id: string): AlphaChannel | null;
|
|
1483
|
+
private requireChannel;
|
|
1484
|
+
private setChannels;
|
|
1485
|
+
private newChannelId;
|
|
1486
|
+
/**
|
|
1487
|
+
* Select › Save Selection: a new alpha channel (`name`, default "Alpha n") holding the
|
|
1488
|
+
* selection, or with `channelId` the selection combined into that channel by `mode` (replace,
|
|
1489
|
+
* add, subtract, intersect). One undo step. Throws without a selection.
|
|
1490
|
+
*/
|
|
1491
|
+
saveSelection(options?: {
|
|
1492
|
+
channelId?: string;
|
|
1493
|
+
name?: string;
|
|
1494
|
+
mode?: SelectionMode;
|
|
1495
|
+
}): AlphaChannel;
|
|
1496
|
+
/**
|
|
1497
|
+
* Select › Load Selection from an alpha channel (inverted with `invert`), combined with the
|
|
1498
|
+
* selection by `mode`. One undo step.
|
|
1499
|
+
*/
|
|
1500
|
+
loadSelectionFromChannel(id: string, options?: {
|
|
1501
|
+
mode?: SelectionMode;
|
|
1502
|
+
invert?: boolean;
|
|
1503
|
+
}): boolean;
|
|
1504
|
+
/** Changes a channel's name, overlay colour, opacity, what it indicates or visibility (one undo step). */
|
|
1505
|
+
setChannelProperties(id: string, props: Partial<Pick<AlphaChannel, 'name' | 'color' | 'opacity' | 'indicates' | 'visible'>>): AlphaChannel;
|
|
1506
|
+
/** Deletes an alpha channel (one undo step). */
|
|
1507
|
+
deleteChannel(id: string): void;
|
|
1508
|
+
/** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
|
|
1509
|
+
duplicateChannel(id: string, name?: string): AlphaChannel;
|
|
1510
|
+
/** Channel summaries (no pixels) for panels and agents. */
|
|
1511
|
+
describeChannels(): {
|
|
1512
|
+
bounds: CropBox | null;
|
|
1513
|
+
percent: number;
|
|
1514
|
+
id: string;
|
|
1515
|
+
name: string;
|
|
1516
|
+
color: string;
|
|
1517
|
+
opacity: number;
|
|
1518
|
+
indicates: "masked" | "selected";
|
|
1519
|
+
visible: boolean;
|
|
1520
|
+
}[];
|
|
1521
|
+
/** Whether Quick Mask mode is on (painting edits the selection). */
|
|
1522
|
+
get quickMaskEditing(): boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* Quick Mask mode (Q): on, the selection shows as a tint and painting, fills and strokes that
|
|
1525
|
+
* name no layer edit the selection itself (white selects, black deselects, grey partly);
|
|
1526
|
+
* off, it shows as marching ants again. View state: no undo step (the edits are).
|
|
1527
|
+
*/
|
|
1528
|
+
setQuickMaskMode(on: boolean): void;
|
|
1529
|
+
/** The selection as a 1-channel surface to paint in Quick Mask mode. */
|
|
1530
|
+
private quickMaskSurface;
|
|
1531
|
+
/** The selection a painted Quick Mask surface stands for (`rects` changed since `base`). */
|
|
1532
|
+
private selectionFromSurface;
|
|
1477
1533
|
private maskFromSelection;
|
|
1478
1534
|
/**
|
|
1479
1535
|
* Adds the selection as the layer's mask (Reveal Selection), replacing any mask, as one undo
|