@pixerate/editor 0.124.1 → 0.126.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.
Files changed (97) hide show
  1. package/dist/agent/index.cjs +3 -3
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.js +3 -3
  4. package/dist/animation-editor/index.cjs +422 -85
  5. package/dist/animation-editor/index.cjs.map +1 -1
  6. package/dist/animation-editor/index.d.cts +174 -7
  7. package/dist/animation-editor/index.d.ts +174 -7
  8. package/dist/animation-editor/index.js +346 -9
  9. package/dist/animation-editor/index.js.map +1 -1
  10. package/dist/{chunk-ORHMVUR6.js → chunk-FICSDDDF.js} +5 -3
  11. package/dist/{chunk-ORHMVUR6.js.map → chunk-FICSDDDF.js.map} +1 -1
  12. package/dist/chunk-FJ3324TZ.js +59 -0
  13. package/dist/chunk-FJ3324TZ.js.map +1 -0
  14. package/dist/{chunk-5EO2IXQE.js → chunk-FPRIUR4T.js} +1 -1
  15. package/dist/chunk-FPRIUR4T.js.map +1 -0
  16. package/dist/{chunk-FHYDQOPC.cjs → chunk-JODTP4DP.cjs} +178 -7
  17. package/dist/chunk-JODTP4DP.cjs.map +1 -0
  18. package/dist/{chunk-NGYD3AMN.js → chunk-MPQAO33O.js} +2 -2
  19. package/dist/{chunk-PEHYWUVV.cjs → chunk-O5RVCDEC.cjs} +82 -82
  20. package/dist/{chunk-PEHYWUVV.cjs.map → chunk-O5RVCDEC.cjs.map} +1 -1
  21. package/dist/{chunk-JRXJTPES.js → chunk-QFSTQHZY.js} +176 -5
  22. package/dist/chunk-QFSTQHZY.js.map +1 -0
  23. package/dist/{chunk-5XXMLBH4.cjs → chunk-QQKTOA4U.cjs} +1 -1
  24. package/dist/chunk-QQKTOA4U.cjs.map +1 -0
  25. package/dist/{chunk-4QQZV5Y5.cjs → chunk-SFCPGMCT.cjs} +11 -9
  26. package/dist/chunk-SFCPGMCT.cjs.map +1 -0
  27. package/dist/{chunk-WE25VLCO.cjs → chunk-V5YGPRCZ.cjs} +36 -36
  28. package/dist/{chunk-WE25VLCO.cjs.map → chunk-V5YGPRCZ.cjs.map} +1 -1
  29. package/dist/chunk-W6QTLHZ3.cjs +59 -0
  30. package/dist/chunk-W6QTLHZ3.cjs.map +1 -0
  31. package/dist/{chunk-WATAQ2Z2.js → chunk-WUDPFWAN.js} +2 -2
  32. package/dist/effects/index.cjs +59 -33
  33. package/dist/effects/index.cjs.map +1 -1
  34. package/dist/effects/index.d.cts +4 -5
  35. package/dist/effects/index.d.ts +4 -5
  36. package/dist/effects/index.js +33 -7
  37. package/dist/effects/index.js.map +1 -1
  38. package/dist/{export-WmYoWmLM.d.cts → export-Bp7ji2r4.d.cts} +1 -2
  39. package/dist/{export-BdfY_lH0.d.ts → export-C1s4eolZ.d.ts} +1 -1
  40. package/dist/{export-BGtXgMJ3.d.ts → export-DAyPY94f.d.ts} +1 -2
  41. package/dist/{export-CbpjwxaI.d.cts → export-DVl4fWy5.d.cts} +1 -1
  42. package/dist/generation/index.cjs +3 -3
  43. package/dist/generation/index.cjs.map +1 -1
  44. package/dist/generation/index.js +3 -3
  45. package/dist/helpers-BBLlekuM.d.ts +2009 -0
  46. package/dist/helpers-i95Ob6Vi.d.cts +2009 -0
  47. package/dist/image-editor/index.cjs +627 -627
  48. package/dist/image-editor/index.cjs.map +1 -1
  49. package/dist/image-editor/index.d.cts +5 -7
  50. package/dist/image-editor/index.d.ts +5 -7
  51. package/dist/image-editor/index.js +13 -13
  52. package/dist/paint-editor/index.cjs +736 -115
  53. package/dist/paint-editor/index.cjs.map +1 -1
  54. package/dist/paint-editor/index.d.cts +248 -13
  55. package/dist/paint-editor/index.d.ts +248 -13
  56. package/dist/paint-editor/index.js +634 -13
  57. package/dist/paint-editor/index.js.map +1 -1
  58. package/dist/{svg-BDrjRnL1.d.cts → svg-BkRL-fZJ.d.cts} +1 -1
  59. package/dist/{svg-C-vZ3q50.d.ts → svg-DJKriJ4A.d.ts} +1 -1
  60. package/dist/tools/index.cjs +2 -2
  61. package/dist/tools/index.cjs.map +1 -1
  62. package/dist/tools/index.js +3 -3
  63. package/dist/{tools-C7JtLYzo.d.ts → tools-CM8Oe8F3.d.ts} +1 -1
  64. package/dist/{tools-DHKGHiSK.d.cts → tools-DZCv2kX1.d.cts} +1 -1
  65. package/dist/vector/index.cjs +1030 -883
  66. package/dist/vector/index.cjs.map +1 -1
  67. package/dist/vector/index.d.cts +61 -6
  68. package/dist/vector/index.d.ts +61 -6
  69. package/dist/vector/index.js +153 -6
  70. package/dist/vector/index.js.map +1 -1
  71. package/dist/video-editor/index.cjs +272 -273
  72. package/dist/video-editor/index.cjs.map +1 -1
  73. package/dist/video-editor/index.d.cts +4 -6
  74. package/dist/video-editor/index.d.ts +4 -6
  75. package/dist/video-editor/index.js +6 -7
  76. package/dist/video-editor/index.js.map +1 -1
  77. package/package.json +1 -1
  78. package/skills/pixerate-animation-editor/SKILL.md +24 -1
  79. package/skills/pixerate-paint-editor/SKILL.md +40 -1
  80. package/skills/pixerate-vector/SKILL.md +15 -0
  81. package/dist/chunk-4QQZV5Y5.cjs.map +0 -1
  82. package/dist/chunk-5EO2IXQE.js.map +0 -1
  83. package/dist/chunk-5XXMLBH4.cjs.map +0 -1
  84. package/dist/chunk-CN4PJHUG.cjs +0 -234
  85. package/dist/chunk-CN4PJHUG.cjs.map +0 -1
  86. package/dist/chunk-FHYDQOPC.cjs.map +0 -1
  87. package/dist/chunk-JRXJTPES.js.map +0 -1
  88. package/dist/chunk-QEG3GRN2.js +0 -234
  89. package/dist/chunk-QEG3GRN2.js.map +0 -1
  90. package/dist/flair-CxB3fOcU.d.ts +0 -739
  91. package/dist/flair-D7BxyBwL.d.cts +0 -739
  92. package/dist/helpers-777mC6dc.d.cts +0 -253
  93. package/dist/helpers-DX2_7L5t.d.ts +0 -253
  94. package/dist/types-BcX7sCsn.d.ts +0 -993
  95. package/dist/types-CznabG7m.d.cts +0 -993
  96. /package/dist/{chunk-NGYD3AMN.js.map → chunk-MPQAO33O.js.map} +0 -0
  97. /package/dist/{chunk-WATAQ2Z2.js.map → chunk-WUDPFWAN.js.map} +0 -0
@@ -3,23 +3,21 @@ import { D as Dab, C as CoverageMap, B as BrushSettings, e as StrokePoint, g as
3
3
  export { v as DEFAULT_FLOW, w as DEFAULT_PAINT_GRADIENT, x as DEFAULT_PAINT_GRADIENT_MAPPING, y as DEFAULT_WET_PARAMS, z as MAX_BRUSH_SIZE, A as PAINT_COLOR_JSON_SCHEMA, E as PAINT_GRADIENT_FULL_SPEED, F as PAINT_GRADIENT_JSON_SCHEMA, G as PAINT_GRADIENT_KIT, H as PAINT_GRADIENT_MAPPINGS, I as PAINT_GRADIENT_MAPPING_LABELS, J as PAINT_GRADIENT_PRESETS, K as PAINT_GRADIENT_REPEATS, L as PAINT_GRADIENT_REPEAT_LABELS, N as PAINT_GRADIENT_SPACES, O as PAINT_GRADIENT_SPACE_LABELS, Q as PAINT_SOURCE_JSON_SCHEMA, U as PaintColorSource, V as PaintDabParams, X as PaintGradientKit, Y as PaintGradientMapping, Z as PaintGradientMappingKind, _ as PaintGradientRepeat, $ as PaintGradientSample, a0 as PaintGradientSampler, a1 as PaintGradientSpace, a2 as PaintGradientStop, a3 as PaintRgb, a4 as PaintSourceError, a5 as WET_FLOW_KINDS, a6 as WET_PARAM_KEYS, a7 as WetFlowKind, a8 as WetSupport, a9 as addPaintGradientStop, aa as hash2, ab as hexToPaintRgb, ac as isGradientPaint, ad as mix32, ae as normalizeFlow, af as normalizeHexColor, ag as normalizeWetParams, ah as paintGradientMappingFor, ai as paintSourceColor, aj as paintSourceCss, ak as parsePaintSource, al as rand01, am as readPaintSource, an as removePaintGradientStop, ao as resolvePaintGradient, ap as reversePaintGradient, aq as scalePaintGradient, ar as solidPaint, as as updatePaintGradientStop, at as wetSupport } from '../rand-CfinE-1c.cjs';
4
4
  import { R as RasterRect, T as TiledSurface, a as BlendMode, b as BlendModeInfo } from '../surface-1MRncXpF.cjs';
5
5
  export { B as BLEND_MODES, P as PAINTERLY_BLEND_MODES, i as Tile, v as isBlendMode, w as isPainterlyBlendMode, I as standardBlendMode } from '../surface-1MRncXpF.cjs';
6
- import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-WmYoWmLM.cjs';
7
- import { V as VideoProject, D as VideoFfmpegExport } from '../export-CbpjwxaI.cjs';
6
+ import { C as EffectValue, E as EffectProvider, D as EffectDescription, B as EffectRenderRequest, F as EffectPixels, W as EffectsSlot } from '../helpers-i95Ob6Vi.cjs';
7
+ import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-Bp7ji2r4.cjs';
8
+ import { V as VideoProject, D as VideoFfmpegExport } from '../export-DVl4fWy5.cjs';
8
9
  import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo, c as PresenceActor, f as PresenceState } from '../presence-Cb6WhcrQ.cjs';
9
10
  import { a as AgentToolProvider, A as AgentTool } from '../registry-BqA1AZt0.cjs';
10
11
  import '../types-CwMPoRMU.cjs';
11
- import '../builtin-CY97ppKM.cjs';
12
- import '../bezier-CBzKKDjl.cjs';
13
- import '../brushTypes-IG7ZZjIN.cjs';
14
- import '../gradient-KDfCvhuj.cjs';
15
- import '../warp-CH9MM435.cjs';
16
- import '../types-CznabG7m.cjs';
17
- import '../helpers-777mC6dc.cjs';
18
12
  import '../schema-Di0CS6Pe.cjs';
19
- import '../flair-D7BxyBwL.cjs';
20
13
  import '../behavior-Ymbld6jL.cjs';
21
14
  import '../easing-lM0Xo9Ni.cjs';
22
15
  import '../evaluate-2S3vSPLy.cjs';
16
+ import '../gradient-KDfCvhuj.cjs';
17
+ import '../builtin-CY97ppKM.cjs';
18
+ import '../bezier-CBzKKDjl.cjs';
19
+ import '../brushTypes-IG7ZZjIN.cjs';
20
+ import '../warp-CH9MM435.cjs';
23
21
 
24
22
  /**
25
23
  * Seeded, deterministic noise for paper grain and brush jitter (photocraft's counter-based
@@ -1450,6 +1448,96 @@ declare function thickToJSON(ch: ThickChannels): SavedThickChannels | null;
1450
1448
  /** Saved form → channels; throws a sentence when it cannot be read. */
1451
1449
  declare function thickFromJSON(raw: unknown): ThickChannels;
1452
1450
 
1451
+ /**
1452
+ * Provider effects in the paint editor (see `@pixerate/editor/effects`):
1453
+ *
1454
+ * - **Effect paper**: a generator drawn over the paper, under the paint (multiplied by default, so
1455
+ * the paper's grain and colour still show). It is part of the document: undo, save and export.
1456
+ * - **Effect layers**: pixel layers drawn by a generator, overlay or title effect. The layer keeps
1457
+ * its effect, so it can be drawn again with new values; painting on it works as on any layer.
1458
+ * - **Effect fills**: a generator, overlay or title effect composited onto a layer's pixels.
1459
+ * - **Light on dried paint**: a filter effect (light, glow, grade) run on a layer's paint and baked
1460
+ * in. Wet paint is dried first, in the same undo step; thick paint keeps its relief.
1461
+ *
1462
+ * Effects render asynchronously, so each change renders first and commits after (one undo step).
1463
+ */
1464
+
1465
+ /** Which uses each place in the paint editor takes. */
1466
+ declare const PAINT_EFFECT_PLACES: {
1467
+ /** Effect paper: drawn over the whole sheet. */
1468
+ readonly paper: readonly ["generator"];
1469
+ /** An effect layer: drawn at the canvas size. */
1470
+ readonly layer: readonly ["generator", "overlay", "title"];
1471
+ /** An effect fill: composited onto a layer's pixels. */
1472
+ readonly fill: readonly ["generator", "overlay", "title"];
1473
+ /** Light (or any filter) on a layer's dried paint. */
1474
+ readonly light: readonly ["filter"];
1475
+ };
1476
+ type PaintEffectPlace = keyof typeof PAINT_EFFECT_PLACES;
1477
+ /** Refuses an effect that cannot go in `place`, saying what to use instead. */
1478
+ declare function checkPaintEffectPlace(d: EffectDescription, place: PaintEffectPlace): void;
1479
+ /** The provider effect a layer or the paper is drawn from. */
1480
+ interface PaintEffectSource {
1481
+ effect: string;
1482
+ /** The provider's id when it was drawn. */
1483
+ provider?: string;
1484
+ /** The effect's name when it was drawn (for placeholders without the provider). */
1485
+ name?: string;
1486
+ /** Every control value. */
1487
+ values: Record<string, EffectValue>;
1488
+ /** Which moment of an animated effect, in ms (missing: 0). */
1489
+ time?: number;
1490
+ }
1491
+ /** Blend modes effect paper draws with. */
1492
+ declare const PAPER_EFFECT_BLENDS: readonly ["multiply", "normal", "overlay", "soft-light", "screen", "color"];
1493
+ type PaperEffectBlend = (typeof PAPER_EFFECT_BLENDS)[number];
1494
+ /** Effect paper: its effect, how it is drawn over the sheet, and its rendered pixels. */
1495
+ interface PaintPaperEffect extends PaintEffectSource {
1496
+ /** 0..1 (default 1). */
1497
+ opacity: number;
1498
+ /** How it draws over the paper (default `multiply`, which keeps the paper's grain and colour). */
1499
+ blend: PaperEffectBlend;
1500
+ /** Canvas-sized straight-alpha RGBA. */
1501
+ image: {
1502
+ width: number;
1503
+ height: number;
1504
+ data: Uint8ClampedArray;
1505
+ };
1506
+ /** Changes whenever the pixels change (render caches key on it). */
1507
+ version: number;
1508
+ }
1509
+ /** A new version number for effect paper pixels. */
1510
+ declare function nextPaperEffectVersion(): number;
1511
+ /** Over-composites `top` onto `base` at `opacity` (straight alpha, same size). */
1512
+ declare function overPixels(base: Uint8ClampedArray, top: ArrayLike<number>, opacity?: number): Uint8ClampedArray;
1513
+ /** Mixes `after` back towards `before` by `1 - amount` (for a filter at partial strength), keeping `before`'s alpha. */
1514
+ declare function mixPixels(before: Uint8ClampedArray, after: ArrayLike<number>, amount: number): Uint8ClampedArray;
1515
+ /**
1516
+ * Renders effects for one paint editor through a small renderer pool (GPU providers hold a
1517
+ * graphics context per renderer). Output always has the asked size.
1518
+ */
1519
+ declare class PaintEffectsRenderer {
1520
+ private readonly pool;
1521
+ private readonly descriptions;
1522
+ private provider;
1523
+ /** Forgets cached descriptions and renderers when the provider changes. */
1524
+ follow(provider: EffectProvider | null): void;
1525
+ describe(provider: EffectProvider, id: string): Promise<EffectDescription>;
1526
+ render(provider: EffectProvider, id: string, size: {
1527
+ width: number;
1528
+ height: number;
1529
+ }, request: EffectRenderRequest): Promise<EffectPixels>;
1530
+ dispose(): void;
1531
+ }
1532
+ /** A saved effect source, or `null` when it is not one. */
1533
+ declare function readPaintEffectSource(raw: unknown): PaintEffectSource | null;
1534
+ /** Effect paper as saved: its settings and its pixels as a PNG data URL. */
1535
+ declare function paperEffectToJSON(p: PaintPaperEffect): Record<string, unknown>;
1536
+ /** Reads saved effect paper for a `width × height` canvas (throws saying what is wrong). */
1537
+ declare function paperEffectFromJSON(raw: unknown, width: number, height: number): PaintPaperEffect;
1538
+ /** Effect layers as saved (layer id → effect). */
1539
+ declare function effectLayersToJSON(map: Readonly<Record<string, PaintEffectSource>>, keep: (id: string) => boolean): Record<string, PaintEffectSource> | undefined;
1540
+
1453
1541
  /**
1454
1542
  * The paint editor's document: a canvas (size and resolution), a paper, and the shared raster
1455
1543
  * layer stack (`@pixerate/editor/raster`: pixel layers and groups with masks, clipping, locks and
@@ -1491,6 +1579,10 @@ interface PaintDocumentState {
1491
1579
  stickers?: Readonly<Record<string, Sticker[]>>;
1492
1580
  /** Thick paint: each layer's height and material channels (layers without relief are missing). */
1493
1581
  thick?: Readonly<Record<string, ThickChannels>>;
1582
+ /** Effect layers: the provider effect each one is drawn from (layers that are gone are ignored). */
1583
+ effectLayers?: Readonly<Record<string, PaintEffectSource>>;
1584
+ /** Effect paper: a provider generator drawn over the paper, under the paint. */
1585
+ paperEffect?: PaintPaperEffect;
1494
1586
  }
1495
1587
  /** A change a replay repeats besides strokes, recorded with how many strokes came before it. */
1496
1588
  interface PaintEvent {
@@ -1744,14 +1836,14 @@ interface PaperNode extends CompositorLayer {
1744
1836
  elevation: number;
1745
1837
  };
1746
1838
  }
1747
- /** A view-only RGBA image under the paint (the tracing image), drawn at its opacity. */
1839
+ /** An RGBA image under the paint (the tracing image, effect paper), drawn at its opacity and blend. */
1748
1840
  interface ImageNode extends CompositorLayer {
1749
1841
  type: 'image';
1750
1842
  id: string;
1751
1843
  name: string;
1752
1844
  visible: boolean;
1753
1845
  opacity: number;
1754
- blend: 'normal';
1846
+ blend: string;
1755
1847
  /** Canvas-sized RGBA. */
1756
1848
  image: {
1757
1849
  width: number;
@@ -1764,6 +1856,7 @@ interface ImageNode extends CompositorLayer {
1764
1856
  type ViewLayer = PaintLayer | PaperNode | ImageNode;
1765
1857
  declare const PAPER_NODE_ID = "__paper";
1766
1858
  declare const TRACING_NODE_ID = "__tracing";
1859
+ declare const PAPER_EFFECT_NODE_ID = "__paper_effect";
1767
1860
  declare function paperKey(p: PaperSettings, light?: {
1768
1861
  azimuth: number;
1769
1862
  elevation: number;
@@ -2518,6 +2611,10 @@ declare class PaintEditorController {
2518
2611
  private liveThick;
2519
2612
  /** Set while an operation that changes wet paint runs: the simulation before it (for undo). */
2520
2613
  private wetOp;
2614
+ /** The effects provider slot (see `setEffectsProvider`). */
2615
+ readonly effects: EffectsSlot;
2616
+ private readonly effectsRenderer;
2617
+ private paperEffectNodeCache;
2521
2618
  constructor(options?: PaintEditorOptions);
2522
2619
  subscribe(listener: () => void): () => void;
2523
2620
  private emit;
@@ -2531,6 +2628,11 @@ declare class PaintEditorController {
2531
2628
  takeDirty(): RasterRect[] | 'all';
2532
2629
  private requireIdle;
2533
2630
  private commit;
2631
+ /**
2632
+ * Commits `next` as a new undo step, or with `commitToHistory` false folds it into the last step
2633
+ * when that step has the same label (the later values of one slider drag).
2634
+ */
2635
+ private commitOrAmend;
2534
2636
  /** Keeps the wet snapshots in history within the wet undo memory, dropping the oldest. */
2535
2637
  private trimWetHistory;
2536
2638
  /** Throws when wet paint is mid-step (a batch in worker threads); `wetIdle()` waits for it. */
@@ -2608,6 +2710,117 @@ declare class PaintEditorController {
2608
2710
  bounds: RasterRect;
2609
2711
  };
2610
2712
  private applyCoverage;
2713
+ /** The registered effects provider, or `null`. */
2714
+ get effectsProvider(): EffectProvider | null;
2715
+ /** Registers (or with `null` removes) the effects provider. Not an edit: no undo step. */
2716
+ setEffectsProvider(provider: EffectProvider | null): void;
2717
+ /** Registers `provider` and returns a function that removes it again (if it is still the one set). */
2718
+ useEffects(provider: EffectProvider): () => void;
2719
+ /** The provider's description of an effect, checked for `place` (rejects without a provider or for an unknown id). */
2720
+ describeEffect(effect: string, place?: PaintEffectPlace): Promise<EffectDescription>;
2721
+ /** Every effect layer (top first) with its effect. */
2722
+ listEffectLayers(): {
2723
+ layerId: string;
2724
+ name: string;
2725
+ source: PaintEffectSource;
2726
+ }[];
2727
+ /** The effect a layer is drawn from, or `undefined` for other layers. */
2728
+ getEffectLayer(layerId: string): PaintEffectSource | undefined;
2729
+ /** The effect paper (without its pixels), or `null`. */
2730
+ getPaperEffect(): Omit<PaintPaperEffect, 'image' | 'version'> | null;
2731
+ /** Values over `base` (`null` resets a control to its default), checked against the effect's controls. */
2732
+ private effectValues;
2733
+ /** Renders a generator, overlay or title effect at the canvas size. */
2734
+ private renderEffectCanvas;
2735
+ private sourceOf;
2736
+ private checkTime;
2737
+ private checkOpacity;
2738
+ /** A pixel layer that takes effect pixels: unlocked, visible, no sticker layer, no wet paint. */
2739
+ private effectTarget;
2740
+ /** After an effect rendered: the layer must be as it was when the render started. */
2741
+ private sameLayerAfterRender;
2742
+ /** The canvas rectangle in a layer's own coordinates. */
2743
+ private canvasRectOf;
2744
+ /**
2745
+ * Sets the effect paper: a provider generator drawn over the paper and under the paint, at the
2746
+ * canvas size (`multiply` by default, so the paper's colour and grain still show). `null` removes
2747
+ * it. One undo step. Returns the effect paper (without pixels), or `null`.
2748
+ */
2749
+ setPaperEffect(effect: string | null, options?: {
2750
+ values?: Record<string, EffectValue>;
2751
+ opacity?: number;
2752
+ blend?: PaperEffectBlend;
2753
+ time?: number;
2754
+ }): Promise<ReturnType<PaintEditorController['getPaperEffect']>>;
2755
+ /**
2756
+ * Changes the effect paper: new control `values` (merged over its own; `null` resets one) or
2757
+ * `time` draw it again at the canvas size; `opacity` and `blend` only change how it is drawn.
2758
+ * One undo step; with `commitToHistory` false it joins the previous effect paper step (a slider
2759
+ * drag). Returns the effect paper (without pixels).
2760
+ */
2761
+ updatePaperEffect(changes: {
2762
+ values?: Record<string, EffectValue | null>;
2763
+ opacity?: number;
2764
+ blend?: PaperEffectBlend;
2765
+ time?: number;
2766
+ }, commitToHistory?: boolean): Promise<NonNullable<ReturnType<PaintEditorController['getPaperEffect']>>>;
2767
+ /**
2768
+ * Adds an effect layer above the active layer (or `aboveId`): a pixel layer drawn by a provider
2769
+ * generator, overlay or title effect at the canvas size. It keeps its effect, so
2770
+ * `updateEffectLayer` draws it again. One undo step. Returns the layer and its effect.
2771
+ */
2772
+ addEffectLayer(effect: string, options?: {
2773
+ values?: Record<string, EffectValue>;
2774
+ name?: string;
2775
+ aboveId?: string;
2776
+ opacity?: number;
2777
+ blend?: BlendMode;
2778
+ time?: number;
2779
+ }): Promise<{
2780
+ layer: PaintLayerInfo;
2781
+ source: PaintEffectSource;
2782
+ }>;
2783
+ /**
2784
+ * Draws an effect layer again with new `values` (merged over its own; `null` resets one) or
2785
+ * `time`, at the canvas size, replacing its pixels (paint on it is lost). One undo step; with
2786
+ * `commitToHistory` false it joins the previous effect layer step (a slider drag).
2787
+ */
2788
+ updateEffectLayer(layerId: string, changes: {
2789
+ values?: Record<string, EffectValue | null>;
2790
+ time?: number;
2791
+ }, commitToHistory?: boolean): Promise<PaintEffectSource>;
2792
+ /** Turns an effect layer into a plain pixel layer, keeping its pixels (one undo step). */
2793
+ rasterizeEffectLayer(layerId: string): PaintLayerInfo;
2794
+ /**
2795
+ * Fills a layer with a provider generator, overlay or title effect: its pixels, rendered at the
2796
+ * canvas size, are composited onto the layer's paint at `opacity` (only where it is already
2797
+ * painted with `lockTransparency`, or when the layer's transparency is locked). One undo step.
2798
+ */
2799
+ fillLayerWithEffect(effect: string, options?: {
2800
+ layerId?: string;
2801
+ values?: Record<string, EffectValue>;
2802
+ opacity?: number;
2803
+ time?: number;
2804
+ lockTransparency?: boolean;
2805
+ }): Promise<{
2806
+ layerId: string;
2807
+ source: PaintEffectSource;
2808
+ }>;
2809
+ /**
2810
+ * Runs a filter effect (light, glow, colour grade …) on a layer's dried paint and bakes it in, at
2811
+ * `amount` strength (0..1, default 1). Transparent areas stay transparent; thick paint keeps its
2812
+ * relief, and an effect with a `height` input gets the relief as a height map. Wet paint is
2813
+ * refused (dry it first). One undo step.
2814
+ */
2815
+ applyLightEffect(layerId: string | undefined, effect: string, options?: {
2816
+ values?: Record<string, EffectValue>;
2817
+ amount?: number;
2818
+ time?: number;
2819
+ }): Promise<{
2820
+ layerId: string;
2821
+ source: PaintEffectSource;
2822
+ amount: number;
2823
+ }>;
2611
2824
  private findBrush;
2612
2825
  /** A library brush by id (`undefined` when unknown). */
2613
2826
  getBrush(id: string): PaintBrush | undefined;
@@ -2866,6 +3079,8 @@ declare class PaintEditorController {
2866
3079
  private currentLayers;
2867
3080
  /** View-only layers between the paper and the paint (the painting guides add the tracing image). */
2868
3081
  protected underlayLayers(): ViewLayer[];
3082
+ /** The effect paper as a compositor layer (one object per effect paper, so caches hold). */
3083
+ private paperEffectNode;
2869
3084
  /** The tracing image resampled onto the canvas (cached until it or the canvas changes). */
2870
3085
  private tracingNode;
2871
3086
  /** The layers with every wet layer dried where it is (what saving and exporting see). */
@@ -3498,4 +3713,24 @@ declare function createPaintReplayTools(c: PaintEditorController): AgentTool[];
3498
3713
 
3499
3714
  declare function createPaintStickerTools(c: PaintEditorController): AgentTool[];
3500
3715
 
3501
- export { type Affine, BLEND_MENU_GROUPS, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, type BlendMenuGroup, BlendMode, BlendModeInfo, type BristleSettings, BristleStroke, type BrushBehavior, type BrushBehaviorInput, type BrushDynamics, type BrushEngineControls, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, type CoverageStroke, DEFAULT_BEHAVIOR, DEFAULT_BRISTLE, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_IMPASTO, DEFAULT_LIGHTING, DEFAULT_MULTI_COLOR, DEFAULT_PAPER, DEFAULT_PARTICLE, DEFAULT_STICKER, DEFAULT_SWATCHES, DEFAULT_VIEW, DEFAULT_WET_BRUSH, DryStroke, type DryStrokeOptions, type FillLayerOptions, GPU_LEAD, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, IMPASTO_TOOLS, IMPASTO_TOOL_LABELS, type ImageEncoder, type ImageFormat, type ImageNode, type ImpastoSettings, type ImpastoTool, LIGHT_SLIDERS, type LayerUpdate, type Linear2, LitCache, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MULTI_COLOR_MODES, MixingPad, type MixingPadTool, type MultiColorMode, type MultiColorSettings, PAD_SAMPLE_SIZES, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, PARTICLE_KINDS, PARTICLE_KIND_LABELS, PARTICLE_RENDERS, PARTICLE_RENDER_LABELS, type PadMixOptions, type PadMixPart, type Paint2DContext, type PaintAgentCommand, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDabStroke, type PaintDabStrokeOptions, PaintDirector, type PaintDirectorOptions, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, type PaintEvent, PaintGesture, PaintGradientSource, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintLighting, type PaintPerformanceResult, type PaintPixelLayer, type PaintPointerEvent, PaintPresence, type PaintPresenceActor, type PaintPresenceState, type PaintReplayOptions, PaintSource, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaintWetHost, PaintWetLayers, type PaintWetOptions, type PaintWetStateInfo, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type ParticleKind, type ParticleRender, type ParticleSettings, ParticleStroke, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type ProceduralStrokeOptions, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayFrame, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, STAMP_KINDS, STAMP_LABELS, STENCIL_KINDS, STENCIL_SHAPES, STICKER_SLIDERS, SYMMETRY_MODES, type SavedMixingPadInfo, type SavedThickChannels, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StampKind, type Stencil, type StencilInput, type StencilKind, type StencilShape, StencilSnapper, type Sticker, type StickerSettings, StickerSpray, type StickerSprayInit, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, type ThickChannels, ThickStrokeDriver, type ThickStrokeInit, TileableNoise, type TimeLapse, type TimeLapseOptions, type TracingImage, type ViewLayer, type ViewportBox, WET_GPU_MODES, WET_GPU_OPTIONS, WET_MEDIA, WET_MEDIUM_LABELS, WET_MEDIUM_PARAMS, WET_PARAM_SCHEMA, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, WET_TOOLS, WET_TOOL_LABELS, WetBackendInfo, type WetBrushSettings, type WetEngineInfo, type WetEvent, WetFlowSpec, type WetGpuMode, type WetLayerInfo, type WetLayerSettings, type WetMediumKind, WetParams, WetStrokeDriver, type WetStrokeInit, WetTilt, type WetTool, affineCopy, applyAffine, brushEngineControls, brushLoadColor, brushLoadForStroke, brushTakesPaint, brushToJSON, buildTimeLapse, clonePaper, colorHarmony, composeAffine, contactSheet, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintLayer, createPaintReplayTools, createPaintStickerTools, createPaintThickTools, createPaintWetTools, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, drawSticker, drawWaterOverlay, emptiedLayers, emptyThickChannels, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, isWetBrush, isWetCapable, lightTile, lightingKey, mapPenPoint, mixerLoadForStroke, mixerTip, multiColorForDab, multiColorGradient, multiColorPalette, multiColorSliders, multiColorToPaint, newPaintLayerId, normalizeBehavior, normalizeBristle, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizeImpasto, normalizeLighting, normalizeMultiColor, normalizePaintBrush, normalizePaper, normalizeParticle, normalizePerspective, normalizeRotation, normalizeStencil, normalizeStickerSettings, normalizeStickerUpdate, normalizeSymmetry, normalizeView, normalizeWetBrush, padSampleRadius, paintToMultiColor, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchBrushValue, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, quickStencil, randSigned, readPath, readSwatch, reliefInfo, renderBrushThumbnail, renderColorWheel, renderPaper, renderStickers, replayFrame, replayItems, replayPainting, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, scaleStencil, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, stampCoverage, startWetClock, stencilMask, stencilOutline, stickerRect, stickerSurface, strokeBounds, strokeDuration, strokeSchedule, sweepPath, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thickFromJSON, thickToJSON, thumbnailStroke, tiltToOrientation, timeLapseVideo, timeLapseZip, toStrokePoint, toggleStamp, usesPaintExchange, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wetEngineSummary, wetPaperInput, wetPigmentOf, wheelAngle, wheelPick, wheelPoint, wheelToHue };
3716
+ /**
3717
+ * Agent tools for provider effects in the paint editor: the shared effect tools, where
3718
+ * `apply_effect` runs a filter (light, glow, grade) on a layer's dried paint and bakes it in, and
3719
+ * the target `paper` is the effect paper; plus `set_paper_effect`, `add_effect_layer` and
3720
+ * `fill_layer_with_effect`.
3721
+ */
3722
+
3723
+ interface PaintEffectsToolProviderOptions {
3724
+ /** Provider id (unique per registry). Default `paint-effects`. */
3725
+ id?: string;
3726
+ /** Always prefix tool names with `<namespace>__`. */
3727
+ namespace?: string;
3728
+ /** The painting cannot be edited: write tools are hidden. A string is the reason. */
3729
+ readOnly?: boolean | string | (() => boolean | string);
3730
+ }
3731
+ /** The target id of the effect paper. */
3732
+ declare const PAPER_TARGET = "paper";
3733
+ /** The effect tools for a paint editor (see the module comment). */
3734
+ declare function createPaintEffectsToolProvider(controller: PaintEditorController, options?: PaintEffectsToolProviderOptions): AgentToolProvider;
3735
+
3736
+ export { type Affine, BLEND_MENU_GROUPS, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, type BlendMenuGroup, BlendMode, BlendModeInfo, type BristleSettings, BristleStroke, type BrushBehavior, type BrushBehaviorInput, type BrushDynamics, type BrushEngineControls, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, type CoverageStroke, DEFAULT_BEHAVIOR, DEFAULT_BRISTLE, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_IMPASTO, DEFAULT_LIGHTING, DEFAULT_MULTI_COLOR, DEFAULT_PAPER, DEFAULT_PARTICLE, DEFAULT_STICKER, DEFAULT_SWATCHES, DEFAULT_VIEW, DEFAULT_WET_BRUSH, DryStroke, type DryStrokeOptions, type FillLayerOptions, GPU_LEAD, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, IMPASTO_TOOLS, IMPASTO_TOOL_LABELS, type ImageEncoder, type ImageFormat, type ImageNode, type ImpastoSettings, type ImpastoTool, LIGHT_SLIDERS, type LayerUpdate, type Linear2, LitCache, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MULTI_COLOR_MODES, MixingPad, type MixingPadTool, type MultiColorMode, type MultiColorSettings, PAD_SAMPLE_SIZES, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_EFFECT_PLACES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_EFFECT_BLENDS, PAPER_EFFECT_NODE_ID, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, PAPER_TARGET, PARTICLE_KINDS, PARTICLE_KIND_LABELS, PARTICLE_RENDERS, PARTICLE_RENDER_LABELS, type PadMixOptions, type PadMixPart, type Paint2DContext, type PaintAgentCommand, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDabStroke, type PaintDabStrokeOptions, PaintDirector, type PaintDirectorOptions, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, type PaintEffectPlace, type PaintEffectSource, PaintEffectsRenderer, type PaintEffectsToolProviderOptions, type PaintEvent, PaintGesture, PaintGradientSource, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintLighting, type PaintPaperEffect, type PaintPerformanceResult, type PaintPixelLayer, type PaintPointerEvent, PaintPresence, type PaintPresenceActor, type PaintPresenceState, type PaintReplayOptions, PaintSource, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaintWetHost, PaintWetLayers, type PaintWetOptions, type PaintWetStateInfo, type PaperEffectBlend, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type ParticleKind, type ParticleRender, type ParticleSettings, ParticleStroke, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type ProceduralStrokeOptions, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayFrame, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, STAMP_KINDS, STAMP_LABELS, STENCIL_KINDS, STENCIL_SHAPES, STICKER_SLIDERS, SYMMETRY_MODES, type SavedMixingPadInfo, type SavedThickChannels, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StampKind, type Stencil, type StencilInput, type StencilKind, type StencilShape, StencilSnapper, type Sticker, type StickerSettings, StickerSpray, type StickerSprayInit, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, type ThickChannels, ThickStrokeDriver, type ThickStrokeInit, TileableNoise, type TimeLapse, type TimeLapseOptions, type TracingImage, type ViewLayer, type ViewportBox, WET_GPU_MODES, WET_GPU_OPTIONS, WET_MEDIA, WET_MEDIUM_LABELS, WET_MEDIUM_PARAMS, WET_PARAM_SCHEMA, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, WET_TOOLS, WET_TOOL_LABELS, WetBackendInfo, type WetBrushSettings, type WetEngineInfo, type WetEvent, WetFlowSpec, type WetGpuMode, type WetLayerInfo, type WetLayerSettings, type WetMediumKind, WetParams, WetStrokeDriver, type WetStrokeInit, WetTilt, type WetTool, affineCopy, applyAffine, brushEngineControls, brushLoadColor, brushLoadForStroke, brushTakesPaint, brushToJSON, buildTimeLapse, checkPaintEffectPlace, clonePaper, colorHarmony, composeAffine, contactSheet, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintEffectsToolProvider, createPaintLayer, createPaintReplayTools, createPaintStickerTools, createPaintThickTools, createPaintWetTools, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, drawSticker, drawWaterOverlay, effectLayersToJSON, emptiedLayers, emptyThickChannels, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, isWetBrush, isWetCapable, lightTile, lightingKey, mapPenPoint, mixPixels, mixerLoadForStroke, mixerTip, multiColorForDab, multiColorGradient, multiColorPalette, multiColorSliders, multiColorToPaint, newPaintLayerId, nextPaperEffectVersion, normalizeBehavior, normalizeBristle, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizeImpasto, normalizeLighting, normalizeMultiColor, normalizePaintBrush, normalizePaper, normalizeParticle, normalizePerspective, normalizeRotation, normalizeStencil, normalizeStickerSettings, normalizeStickerUpdate, normalizeSymmetry, normalizeView, normalizeWetBrush, overPixels, padSampleRadius, paintToMultiColor, paperEffectFromJSON, paperEffectToJSON, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchBrushValue, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, quickStencil, randSigned, readPaintEffectSource, readPath, readSwatch, reliefInfo, renderBrushThumbnail, renderColorWheel, renderPaper, renderStickers, replayFrame, replayItems, replayPainting, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, scaleStencil, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, stampCoverage, startWetClock, stencilMask, stencilOutline, stickerRect, stickerSurface, strokeBounds, strokeDuration, strokeSchedule, sweepPath, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thickFromJSON, thickToJSON, thumbnailStroke, tiltToOrientation, timeLapseVideo, timeLapseZip, toStrokePoint, toggleStamp, usesPaintExchange, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wetEngineSummary, wetPaperInput, wetPigmentOf, wheelAngle, wheelPick, wheelPoint, wheelToHue };