@pixerate/editor 0.225.0 → 0.227.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 (64) hide show
  1. package/dist/animation-editor/index.cjs +66 -66
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/{brushstrokeRender-C3UU6GVC.js → brushstrokeRender-MAHOXL7K.js} +2 -2
  4. package/dist/{brushstrokeRender-EAJNE6WP.cjs → brushstrokeRender-WDTKD54B.cjs} +5 -5
  5. package/dist/canvas/index.cjs +15 -15
  6. package/dist/canvas/index.js +2 -2
  7. package/dist/{chunk-WA4IS2EY.js → chunk-4MDWEX44.js} +1 -1
  8. package/dist/{chunk-7AAS3JO6.cjs → chunk-4PA6YS6W.cjs} +14 -14
  9. package/dist/{chunk-RDTCG5MS.js → chunk-56RFHF7O.js} +1 -1
  10. package/dist/{chunk-HKPLKISO.js → chunk-7DZ55AIE.js} +10 -5
  11. package/dist/{chunk-NTWR5TQB.cjs → chunk-ABQ2VGUB.cjs} +10 -5
  12. package/dist/{chunk-LCCMOWR7.cjs → chunk-ATKKG76G.cjs} +23 -23
  13. package/dist/{chunk-QAUIZPYI.cjs → chunk-BQE3Y6ZO.cjs} +2 -2
  14. package/dist/{chunk-MDNYYOBZ.cjs → chunk-C6CMQXMI.cjs} +7 -7
  15. package/dist/{chunk-G4E6RUPC.js → chunk-CDP2AKMA.js} +1 -1
  16. package/dist/{chunk-NDMXB4PR.js → chunk-CU6ANS5L.js} +1 -1
  17. package/dist/{chunk-ROVK6AXX.cjs → chunk-GNZI3KYK.cjs} +95 -23
  18. package/dist/{chunk-I7G3RSUJ.cjs → chunk-GXLZZVR5.cjs} +35 -35
  19. package/dist/{chunk-S6KKLFZO.js → chunk-KN3Y3FRY.js} +19 -4
  20. package/dist/{chunk-R35YOUP2.cjs → chunk-MXJP77K4.cjs} +104 -89
  21. package/dist/{chunk-F7YA3MMC.js → chunk-TQOL6CF7.js} +76 -4
  22. package/dist/{chunk-ZMHPQ6HP.cjs → chunk-V3L7U63N.cjs} +1 -1
  23. package/dist/{chunk-DJBYJOHM.js → chunk-XSVUNSDJ.js} +1 -1
  24. package/dist/{chunk-BGOCAUXH.js → chunk-YMREOA67.js} +1 -1
  25. package/dist/effects/index.cjs +44 -44
  26. package/dist/effects/index.js +2 -2
  27. package/dist/effects/tools.d.cts +6 -0
  28. package/dist/effects/tools.d.ts +6 -0
  29. package/dist/image-editor/controller.d.cts +12 -4
  30. package/dist/image-editor/controller.d.ts +12 -4
  31. package/dist/image-editor/index.cjs +944 -922
  32. package/dist/image-editor/index.js +49 -27
  33. package/dist/image-editor/layers/model.d.cts +6 -0
  34. package/dist/image-editor/layers/model.d.ts +6 -0
  35. package/dist/paint-editor/controller.d.cts +54 -3
  36. package/dist/paint-editor/controller.d.ts +54 -3
  37. package/dist/paint-editor/dab-stroke.d.cts +3 -0
  38. package/dist/paint-editor/dab-stroke.d.ts +3 -0
  39. package/dist/paint-editor/effect-paint.d.cts +47 -0
  40. package/dist/paint-editor/effect-paint.d.ts +47 -0
  41. package/dist/paint-editor/effect-tools.d.cts +4 -2
  42. package/dist/paint-editor/effect-tools.d.ts +4 -2
  43. package/dist/paint-editor/effects.d.cts +3 -0
  44. package/dist/paint-editor/effects.d.ts +3 -0
  45. package/dist/paint-editor/engine.d.cts +4 -0
  46. package/dist/paint-editor/engine.d.ts +4 -0
  47. package/dist/paint-editor/index.cjs +542 -315
  48. package/dist/paint-editor/index.d.cts +1 -0
  49. package/dist/paint-editor/index.d.ts +1 -0
  50. package/dist/paint-editor/index.js +252 -25
  51. package/dist/paint-editor/procedural.d.cts +4 -0
  52. package/dist/paint-editor/procedural.d.ts +4 -0
  53. package/dist/paint-editor/stroke.d.cts +9 -0
  54. package/dist/paint-editor/stroke.d.ts +9 -0
  55. package/dist/paint-editor/strokes.d.cts +6 -2
  56. package/dist/paint-editor/strokes.d.ts +6 -2
  57. package/dist/vector/index.cjs +968 -968
  58. package/dist/vector/index.js +5 -5
  59. package/dist/video-editor/index.cjs +309 -309
  60. package/dist/video-editor/index.js +3 -3
  61. package/package.json +1 -1
  62. package/skills/pixerate-canvas/SKILL.md +2 -1
  63. package/skills/pixerate-paint-editor/SKILL.md +42 -6
  64. package/skills/pixerate-paint-sketch-to-finish/SKILL.md +7 -0
@@ -28,6 +28,58 @@ import {
28
28
  tileKey
29
29
  } from "./chunk-HVVR5PZW.js";
30
30
 
31
+ // src/paint-editor/effect-paint.ts
32
+ function effectPaintKey(p) {
33
+ return JSON.stringify({ type: "effect", effect: p.effect, provider: p.provider, values: p.values, time: p.time });
34
+ }
35
+ function isPaintEffectPaint(raw) {
36
+ return Boolean(raw) && typeof raw === "object" && raw.type === "effect";
37
+ }
38
+ function readPaintEffectPaint(raw) {
39
+ if (!isPaintEffectPaint(raw)) return null;
40
+ const r = raw;
41
+ if (typeof r.effect !== "string" || !r.effect || !r.values || typeof r.values !== "object" || Array.isArray(r.values)) return null;
42
+ return {
43
+ type: "effect",
44
+ effect: r.effect,
45
+ provider: typeof r.provider === "string" ? r.provider : "",
46
+ values: JSON.parse(JSON.stringify(r.values)),
47
+ time: typeof r.time === "number" && Number.isFinite(r.time) && r.time > 0 ? r.time : 0
48
+ };
49
+ }
50
+ function sampleEffectField(img, rect, vals, field) {
51
+ const { width, height, data } = img;
52
+ for (let yy = 0, k = 0; yy < rect.height; yy++) {
53
+ const y = rect.y + yy;
54
+ const inY = y >= 0 && y < height;
55
+ for (let xx = 0; xx < rect.width; xx++, k++) {
56
+ const x = rect.x + xx;
57
+ const f = k * 3;
58
+ if (!inY || x < 0 || x >= width) {
59
+ vals[k] = 0;
60
+ field[f] = field[f + 1] = field[f + 2] = 0;
61
+ continue;
62
+ }
63
+ const i = (y * width + x) * 4;
64
+ const a = data[i + 3];
65
+ if (a < 255) vals[k] *= a / 255;
66
+ field[f] = data[i] / 255;
67
+ field[f + 1] = data[i + 1] / 255;
68
+ field[f + 2] = data[i + 2] / 255;
69
+ }
70
+ }
71
+ }
72
+ function sampleEffectAt(img, x, y, out) {
73
+ const px = Math.floor(x);
74
+ const py = Math.floor(y);
75
+ if (px < 0 || py < 0 || px >= img.width || py >= img.height) return 0;
76
+ const i = (py * img.width + px) * 4;
77
+ out[0] = img.data[i] / 255;
78
+ out[1] = img.data[i + 1] / 255;
79
+ out[2] = img.data[i + 2] / 255;
80
+ return img.data[i + 3] / 255;
81
+ }
82
+
31
83
  // src/paint-editor/paper.ts
32
84
  var PAPER_FAMILIES = ["watercolor", "drawing", "pastel", "canvas", "panel", "smooth"];
33
85
  var unit = (v, d) => typeof v === "number" && Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : d;
@@ -386,6 +438,7 @@ var DryStroke = class {
386
438
  copies;
387
439
  depth;
388
440
  buf = new Float32Array(0);
441
+ field = new Float32Array(0);
389
442
  lastRaw = null;
390
443
  lastFed = null;
391
444
  /** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
@@ -426,7 +479,13 @@ var DryStroke = class {
426
479
  }
427
480
  }
428
481
  }
429
- this.coverage.accumulate(rect, vals, d.opacity);
482
+ let field = null;
483
+ if (this.options.effect) {
484
+ if (this.field.length < n * 3) this.field = new Float32Array(n * 3);
485
+ field = this.field.subarray(0, n * 3);
486
+ sampleEffectField(this.options.effect, rect, vals, field);
487
+ }
488
+ this.coverage.accumulate(rect, vals, d.opacity, null, field);
430
489
  rects.push(rect);
431
490
  this.dabCount++;
432
491
  }
@@ -719,6 +778,7 @@ var MarkStroke = class {
719
778
  walkers;
720
779
  depth;
721
780
  buf = new Float32Array(0);
781
+ field = new Float32Array(0);
722
782
  lastRaw = null;
723
783
  lastFed = null;
724
784
  seed;
@@ -785,9 +845,16 @@ var MarkStroke = class {
785
845
  for (let yy = 0, k = 0; yy < rect.height; yy++)
786
846
  for (let xx = 0; xx < rect.width; xx++, k++) if (vals[k] > 0) vals[k] *= grainCatch(grain.at(rect.x + xx + 0.5, rect.y + yy + 0.5), this.depth, pressure);
787
847
  }
788
- const color = this.markColor(x, y);
789
- if (color && color.alpha < 1) for (let k = 0; k < n; k++) vals[k] *= color.alpha;
790
- this.coverage.accumulate(rect, vals, dab.opacity, color ? color.rgb : null);
848
+ if (this.options.effect) {
849
+ if (this.field.length < n * 3) this.field = new Float32Array(n * 3);
850
+ const field = this.field.subarray(0, n * 3);
851
+ sampleEffectField(this.options.effect, rect, vals, field);
852
+ this.coverage.accumulate(rect, vals, dab.opacity, null, field);
853
+ } else {
854
+ const color = this.markColor(x, y);
855
+ if (color && color.alpha < 1) for (let k = 0; k < n; k++) vals[k] *= color.alpha;
856
+ this.coverage.accumulate(rect, vals, dab.opacity, color ? color.rgb : null);
857
+ }
791
858
  rects.push(rect);
792
859
  this.dabCount++;
793
860
  }
@@ -1782,6 +1849,11 @@ function parseBrushLibrary(raw, problems = []) {
1782
1849
  }
1783
1850
 
1784
1851
  export {
1852
+ effectPaintKey,
1853
+ isPaintEffectPaint,
1854
+ readPaintEffectPaint,
1855
+ sampleEffectField,
1856
+ sampleEffectAt,
1785
1857
  PAPER_FAMILIES,
1786
1858
  PAPER_LIBRARY,
1787
1859
  DEFAULT_PAPER,
@@ -74,7 +74,7 @@ function profileAlongPolyline(points, values, count = 32) {
74
74
  var round3 = (v) => Math.round(v * 1e3) / 1e3;
75
75
  var loading = null;
76
76
  function loadCanvasBrushstrokeRenderer() {
77
- loading ??= Promise.resolve().then(() => _interopRequireWildcard(require("./brushstrokeRender-EAJNE6WP.cjs"))).catch((error) => {
77
+ loading ??= Promise.resolve().then(() => _interopRequireWildcard(require("./brushstrokeRender-WDTKD54B.cjs"))).catch((error) => {
78
78
  loading = null;
79
79
  throw error;
80
80
  });
@@ -5,7 +5,7 @@ import {
5
5
  moveAnchorHandle,
6
6
  subpathSegment,
7
7
  subpathSegmentCount
8
- } from "./chunk-NDMXB4PR.js";
8
+ } from "./chunk-CU6ANS5L.js";
9
9
  import {
10
10
  segmentPoint
11
11
  } from "./chunk-WEIK3UYB.js";
@@ -18,7 +18,7 @@ import {
18
18
  unionBounds,
19
19
  vectorGradientPoints,
20
20
  widthProfileAt
21
- } from "./chunk-NDMXB4PR.js";
21
+ } from "./chunk-CU6ANS5L.js";
22
22
  import {
23
23
  segmentLength,
24
24
  segmentParamAtLength,
@@ -3,7 +3,7 @@
3
3
  var _chunk4XSBOGMKcjs = require('../chunk-4XSBOGMK.cjs');
4
4
 
5
5
 
6
- var _chunk7AAS3JO6cjs = require('../chunk-7AAS3JO6.cjs');
6
+ var _chunk4PA6YS6Wcjs = require('../chunk-4PA6YS6W.cjs');
7
7
 
8
8
 
9
9
  var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
@@ -37,7 +37,7 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
37
37
 
38
38
 
39
39
 
40
- var _chunkNTWR5TQBcjs = require('../chunk-NTWR5TQB.cjs');
40
+ var _chunkABQ2VGUBcjs = require('../chunk-ABQ2VGUB.cjs');
41
41
  require('../chunk-WOFXZ3XU.cjs');
42
42
  require('../chunk-FJ2MSI43.cjs');
43
43
 
@@ -45,7 +45,7 @@ require('../chunk-FJ2MSI43.cjs');
45
45
  var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
46
46
 
47
47
  // src/effects/conformance.ts
48
- var codeOf = (e) => _chunkNTWR5TQBcjs.isEffectError.call(void 0, e) ? e.code : e instanceof Error ? `untyped ${e.name}: ${e.message}` : String(e);
48
+ var codeOf = (e) => _chunkABQ2VGUBcjs.isEffectError.call(void 0, e) ? e.code : e instanceof Error ? `untyped ${e.name}: ${e.message}` : String(e);
49
49
  async function rejectsWith(code, run) {
50
50
  try {
51
51
  await run();
@@ -59,10 +59,10 @@ function checkSummary(e, issues) {
59
59
  const at = (message) => issues.push({ effectId: e.id, message });
60
60
  if (!e.id || typeof e.id !== "string") at("summary has no id");
61
61
  if (!e.name) at("summary has no name");
62
- if (!_chunkNTWR5TQBcjs.EFFECT_KINDS.includes(e.kind)) at(`kind "${e.kind}" is not one of ${_chunkNTWR5TQBcjs.EFFECT_KINDS.join(", ")}`);
62
+ if (!_chunkABQ2VGUBcjs.EFFECT_KINDS.includes(e.kind)) at(`kind "${e.kind}" is not one of ${_chunkABQ2VGUBcjs.EFFECT_KINDS.join(", ")}`);
63
63
  if (!e.category) at("summary has no category");
64
64
  if (!Array.isArray(e.uses) || !e.uses.length) at("summary has no uses");
65
- for (const u of _nullishCoalesce(e.uses, () => ( []))) if (!_chunkNTWR5TQBcjs.EFFECT_USES.includes(u)) at(`use "${u}" is not one of ${_chunkNTWR5TQBcjs.EFFECT_USES.join(", ")}`);
65
+ for (const u of _nullishCoalesce(e.uses, () => ( []))) if (!_chunkABQ2VGUBcjs.EFFECT_USES.includes(u)) at(`use "${u}" is not one of ${_chunkABQ2VGUBcjs.EFFECT_USES.join(", ")}`);
66
66
  if (typeof e.transparent !== "boolean") at("transparent is not a boolean");
67
67
  if (typeof e.loop !== "boolean") at("loop is not a boolean");
68
68
  if (e.duration !== void 0 && !(e.duration > 0)) at("duration must be a positive number of ms when present");
@@ -72,7 +72,7 @@ function checkSummary(e, issues) {
72
72
  const m = e.camera;
73
73
  if (!m) at("a camera effect needs camera: { role, durationMs }");
74
74
  else {
75
- if (!_chunkNTWR5TQBcjs.CAMERA_MOVE_ROLES.includes(m.role)) at(`camera.role "${m.role}" is not one of ${_chunkNTWR5TQBcjs.CAMERA_MOVE_ROLES.join(", ")}`);
75
+ if (!_chunkABQ2VGUBcjs.CAMERA_MOVE_ROLES.includes(m.role)) at(`camera.role "${m.role}" is not one of ${_chunkABQ2VGUBcjs.CAMERA_MOVE_ROLES.join(", ")}`);
76
76
  if (!(Number.isFinite(m.durationMs) && m.durationMs >= 0)) at("camera.durationMs must be a number of ms \u2265 0");
77
77
  if (m.cut !== void 0 && !(m.cut >= 0 && m.cut <= 1)) at("camera.cut must be 0\u20131 when present");
78
78
  if (e.duration !== void 0 && e.duration !== m.durationMs) at(`duration ${e.duration} differs from camera.durationMs ${m.durationMs}`);
@@ -98,8 +98,8 @@ function checkDescription(id, d, issues) {
98
98
  if (!control) at(`backgroundOpacity "${d.backgroundOpacity}" is not a control`);
99
99
  else if (control.type !== "number" || control.minimum !== 0 || control.maximum !== 1) at(`backgroundOpacity "${d.backgroundOpacity}" must be a number control from 0 to 1`);
100
100
  }
101
- for (const e of _chunkNTWR5TQBcjs.effectValueErrors.call(void 0, d, d.defaults)) at(`default ${e.path}: ${e.message}`);
102
- for (const p of _nullishCoalesce(d.presets, () => ( []))) for (const e of _chunkNTWR5TQBcjs.effectValueErrors.call(void 0, d, p.values)) at(`preset "${p.name}" ${e.path}: ${e.message}`);
101
+ for (const e of _chunkABQ2VGUBcjs.effectValueErrors.call(void 0, d, d.defaults)) at(`default ${e.path}: ${e.message}`);
102
+ for (const p of _nullishCoalesce(d.presets, () => ( []))) for (const e of _chunkABQ2VGUBcjs.effectValueErrors.call(void 0, d, p.values)) at(`preset "${p.name}" ${e.path}: ${e.message}`);
103
103
  for (const input2 of _nullishCoalesce(d.inputs, () => ( []))) {
104
104
  if (!input2.name || !input2.description) at("every input needs a name and a description");
105
105
  if (input2.kind !== "image" && input2.kind !== "audio") at(`input "${input2.name}" has kind "${input2.kind}"`);
@@ -110,7 +110,7 @@ function checkDescription(id, d, issues) {
110
110
  }
111
111
  }
112
112
  function grey(size) {
113
- const p = _chunkNTWR5TQBcjs.createEffectPixels.call(void 0, size, size);
113
+ const p = _chunkABQ2VGUBcjs.createEffectPixels.call(void 0, size, size);
114
114
  p.data.fill(128);
115
115
  return p;
116
116
  }
@@ -127,7 +127,7 @@ async function checkRender(provider, d, size, issues) {
127
127
  }
128
128
  try {
129
129
  const out = await renderer.render({ time: 0, inputs });
130
- if (!_chunkNTWR5TQBcjs.isEffectPixels.call(void 0, out)) at("render did not return EffectPixels");
130
+ if (!_chunkABQ2VGUBcjs.isEffectPixels.call(void 0, out)) at("render did not return EffectPixels");
131
131
  else if (out.width !== size || out.height !== size || out.data.length !== size * size * 4) at(`render returned ${out.width}\xD7${out.height}, not ${size}\xD7${size}`);
132
132
  } catch (e) {
133
133
  at(`render failed: ${codeOf(e)}`);
@@ -157,10 +157,10 @@ async function checkCamera(provider, d, issues) {
157
157
  at("cameraView must be synchronous; it returned a Promise");
158
158
  return;
159
159
  }
160
- if (!_chunkNTWR5TQBcjs.isCameraView.call(void 0, view)) at(`cameraView at u ${u} is not a CameraView (zoom > 0, finite scrollX and scrollY): ${JSON.stringify(view)}`);
160
+ if (!_chunkABQ2VGUBcjs.isCameraView.call(void 0, view)) at(`cameraView at u ${u} is not a CameraView (zoom > 0, finite scrollX and scrollY): ${JSON.stringify(view)}`);
161
161
  else views.push(view);
162
162
  const again = provider.cameraView(d.id, ctx(u));
163
- if (_chunkNTWR5TQBcjs.isCameraView.call(void 0, view) && !sameView(view, again)) at(`cameraView is not pure: two calls at u ${u} gave different views`);
163
+ if (_chunkABQ2VGUBcjs.isCameraView.call(void 0, view) && !sameView(view, again)) at(`cameraView is not pure: two calls at u ${u} gave different views`);
164
164
  } catch (e) {
165
165
  at(`cameraView at u ${u} failed: ${codeOf(e)}`);
166
166
  }
@@ -173,7 +173,7 @@ async function checkCamera(provider, d, issues) {
173
173
  const keys = _optionalChain([sample, 'optionalAccess', _11 => _11.keys]);
174
174
  if (!Array.isArray(keys) || keys.length < 2) at("sampleCameraMove returned fewer than two keys");
175
175
  else {
176
- if (keys.some((k, i) => !_chunkNTWR5TQBcjs.isCameraView.call(void 0, k.view) || !Number.isFinite(k.t) || i > 0 && k.t < keys[i - 1].t)) at("sampleCameraMove keys must be CameraViews in time order");
176
+ if (keys.some((k, i) => !_chunkABQ2VGUBcjs.isCameraView.call(void 0, k.view) || !Number.isFinite(k.t) || i > 0 && k.t < keys[i - 1].t)) at("sampleCameraMove keys must be CameraViews in time order");
177
177
  if (keys[0].t !== 0 || keys[keys.length - 1].t !== ms) at(`sampleCameraMove keys must run from 0 to ${ms} ms, got ${keys[0].t} to ${keys[keys.length - 1].t}`);
178
178
  else if (!near(keys[0].view, views[0]) || !near(keys[keys.length - 1].view, views[4])) at("sampleCameraMove disagrees with cameraView at the start or end of the move");
179
179
  if (camera.cut !== void 0 && sample.cut === void 0) at("sampleCameraMove gave no cut for a move that cuts");
@@ -543,15 +543,15 @@ var smooth = (t) => t * t * (3 - 2 * t);
543
543
  var clamp01 = (v) => v < 0 ? 0 : v > 1 ? 1 : v;
544
544
  function input(request, name, id, width, height) {
545
545
  const src = _optionalChain([request, 'access', _24 => _24.inputs, 'optionalAccess', _25 => _25[name]]);
546
- if (!src) throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`Effect "${id}" needs an input named "${name}".`, id);
547
- if (!_chunkNTWR5TQBcjs.isEffectPixels.call(void 0, src)) throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`The fake provider only takes EffectPixels inputs ("${name}").`, id);
546
+ if (!src) throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`Effect "${id}" needs an input named "${name}".`, id);
547
+ if (!_chunkABQ2VGUBcjs.isEffectPixels.call(void 0, src)) throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`The fake provider only takes EffectPixels inputs ("${name}").`, id);
548
548
  if (src.width !== width || src.height !== height) {
549
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`Input "${name}" is ${src.width}\xD7${src.height}; the renderer is ${width}\xD7${height}.`, id);
549
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`Input "${name}" is ${src.width}\xD7${src.height}; the renderer is ${width}\xD7${height}.`, id);
550
550
  }
551
551
  return src;
552
552
  }
553
553
  function renderPixels(d, v, request, width, height) {
554
- const out = _chunkNTWR5TQBcjs.createEffectPixels.call(void 0, width, height);
554
+ const out = _chunkABQ2VGUBcjs.createEffectPixels.call(void 0, width, height);
555
555
  const o = out.data;
556
556
  switch (d.id) {
557
557
  case "fake.invert": {
@@ -617,7 +617,7 @@ function renderPixels(d, v, request, width, height) {
617
617
  break;
618
618
  }
619
619
  default:
620
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect; use applyVectorEffect.`, d.id);
620
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect; use applyVectorEffect.`, d.id);
621
621
  }
622
622
  return out;
623
623
  }
@@ -647,22 +647,22 @@ function cameraViewOf(d, ctx, v) {
647
647
  case "fake.drift":
648
648
  return viewAt(x0, y0, from.zoom * lerp(1, v.scale, smooth(u)), ctx);
649
649
  default:
650
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect, not a camera move.`, d.id);
650
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect, not a camera move.`, d.id);
651
651
  }
652
652
  }
653
653
  function toFloat(p) {
654
654
  const f = new Float32Array(p.data.length);
655
655
  for (let i = 0; i < f.length; i += 4) {
656
- f[i] = _chunkNTWR5TQBcjs.srgbToLinear.call(void 0, p.data[i] / 255);
657
- f[i + 1] = _chunkNTWR5TQBcjs.srgbToLinear.call(void 0, p.data[i + 1] / 255);
658
- f[i + 2] = _chunkNTWR5TQBcjs.srgbToLinear.call(void 0, p.data[i + 2] / 255);
656
+ f[i] = _chunkABQ2VGUBcjs.srgbToLinear.call(void 0, p.data[i] / 255);
657
+ f[i + 1] = _chunkABQ2VGUBcjs.srgbToLinear.call(void 0, p.data[i + 1] / 255);
658
+ f[i + 2] = _chunkABQ2VGUBcjs.srgbToLinear.call(void 0, p.data[i + 2] / 255);
659
659
  f[i + 3] = p.data[i + 3] / 255;
660
660
  }
661
- return _chunkNTWR5TQBcjs.encodeEffectFloat.call(void 0, { ...p, float: f });
661
+ return _chunkABQ2VGUBcjs.encodeEffectFloat.call(void 0, { ...p, float: f });
662
662
  }
663
663
  function maskResult(out, mask, source, id) {
664
- if (!_chunkNTWR5TQBcjs.isEffectPixels.call(void 0, mask) || mask.width !== out.width || mask.height !== out.height) {
665
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)("The mask must be EffectPixels the size of the renderer.", id);
664
+ if (!_chunkABQ2VGUBcjs.isEffectPixels.call(void 0, mask) || mask.width !== out.width || mask.height !== out.height) {
665
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)("The mask must be EffectPixels the size of the renderer.", id);
666
666
  }
667
667
  const o = out.data;
668
668
  for (let i = 0; i < o.length; i += 4) {
@@ -688,32 +688,32 @@ function createFakeEffectProvider(options = {}) {
688
688
  const byId = new Map(all.map((d) => [d.id, d]));
689
689
  const get = (id) => {
690
690
  const d = byId.get(id);
691
- if (!d) throw new (0, _chunkNTWR5TQBcjs.UnknownEffectError)(id, "the fake provider");
691
+ if (!d) throw new (0, _chunkABQ2VGUBcjs.UnknownEffectError)(id, "the fake provider");
692
692
  return d;
693
693
  };
694
694
  const summaries = all.map(summaryOf);
695
695
  const camera = (id, ctx, values) => {
696
696
  const d = get(id);
697
- if (d.kind !== "camera") throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a camera move.`, id);
698
- if (!(ctx.u >= 0 && ctx.u <= 1)) throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`u must be 0\u20131 through the move, got ${ctx.u}.`, id);
699
- return cameraViewOf(d, ctx, _chunkNTWR5TQBcjs.resolveEffectValues.call(void 0, d, values));
697
+ if (d.kind !== "camera") throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a camera move.`, id);
698
+ if (!(ctx.u >= 0 && ctx.u <= 1)) throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`u must be 0\u20131 through the move, got ${ctx.u}.`, id);
699
+ return cameraViewOf(d, ctx, _chunkABQ2VGUBcjs.resolveEffectValues.call(void 0, d, values));
700
700
  };
701
701
  const provider = {
702
702
  id: "fake",
703
703
  name: "Fake effects",
704
704
  version: "1",
705
705
  capabilities,
706
- list: (o) => _chunkNTWR5TQBcjs.searchEffectSummaries.call(void 0, summaries, "", o),
707
- search: (q, o) => _chunkNTWR5TQBcjs.searchEffectSummaries.call(void 0, summaries, q, o),
706
+ list: (o) => _chunkABQ2VGUBcjs.searchEffectSummaries.call(void 0, summaries, "", o),
707
+ search: (q, o) => _chunkABQ2VGUBcjs.searchEffectSummaries.call(void 0, summaries, q, o),
708
708
  describe: (id) => structuredClone(get(id)),
709
709
  createRenderer(id, ro) {
710
710
  const d = get(id);
711
- if (d.kind === "camera") throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${id}" is a camera move: it moves a scene's camera and draws no pixels. Use cameraView.`, id);
712
- if (d.kind !== "shader") throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect; use applyVectorEffect.`, id);
711
+ if (d.kind === "camera") throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${id}" is a camera move: it moves a scene's camera and draws no pixels. Use cameraView.`, id);
712
+ if (d.kind !== "shader") throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect; use applyVectorEffect.`, id);
713
713
  const { width, height } = ro;
714
714
  const depth = _nullishCoalesce(ro.depth, () => ( 8));
715
715
  if (!(width > 0 && height > 0) || width > capabilities.maxSize || height > capabilities.maxSize) {
716
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`Renderer size ${width}\xD7${height} is outside 1\u2013${capabilities.maxSize}.`, id);
716
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`Renderer size ${width}\xD7${height} is outside 1\u2013${capabilities.maxSize}.`, id);
717
717
  }
718
718
  let disposed = false;
719
719
  return {
@@ -722,15 +722,15 @@ function createFakeEffectProvider(options = {}) {
722
722
  height,
723
723
  depth,
724
724
  async render(request) {
725
- if (disposed) throw new (0, _chunkNTWR5TQBcjs.EffectDisposedError)(id);
725
+ if (disposed) throw new (0, _chunkABQ2VGUBcjs.EffectDisposedError)(id);
726
726
  if (!Number.isFinite(request.time) || request.time < 0) {
727
- throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
727
+ throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
728
728
  }
729
- const values = _chunkNTWR5TQBcjs.resolveEffectValues.call(void 0, d, request.values);
729
+ const values = _chunkABQ2VGUBcjs.resolveEffectValues.call(void 0, d, request.values);
730
730
  _optionalChain([options, 'access', _26 => _26.onRender, 'optionalCall', _27 => _27(id, request)]);
731
731
  const out = renderPixels(d, values, request, width, height);
732
732
  if (request.mask) {
733
- if (!capabilities.supportsMask) throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)("This provider does not take masks.", id);
733
+ if (!capabilities.supportsMask) throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)("This provider does not take masks.", id);
734
734
  const source = d.uses.includes("filter") ? _optionalChain([request, 'access', _28 => _28.inputs, 'optionalAccess', _29 => _29.source]) : void 0;
735
735
  maskResult(out, request.mask, source, id);
736
736
  }
@@ -743,8 +743,8 @@ function createFakeEffectProvider(options = {}) {
743
743
  },
744
744
  applyVectorEffect(id, target, values) {
745
745
  const d = get(id);
746
- if (d.kind !== "motion" && d.kind !== "vector") throw new (0, _chunkNTWR5TQBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a vector one.`, id);
747
- const v = _chunkNTWR5TQBcjs.resolveEffectValues.call(void 0, d, values);
746
+ if (d.kind !== "motion" && d.kind !== "vector") throw new (0, _chunkABQ2VGUBcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a vector one.`, id);
747
+ const v = _chunkABQ2VGUBcjs.resolveEffectValues.call(void 0, d, values);
748
748
  if (d.kind === "vector") {
749
749
  return { svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100"><circle id="badge" cx="50" cy="50" r="40" fill="${v.color}"/></svg>`, animate: [{ id: "badge", ms: v.ms, attrs: { opacity: [0, 1] } }], duration: v.ms, loop: false };
750
750
  }
@@ -764,11 +764,11 @@ function createFakeEffectProvider(options = {}) {
764
764
  sampleCameraMove: (id, request) => {
765
765
  const d = get(id);
766
766
  const { from, to, ms, stage, fps, values } = request;
767
- return _chunkNTWR5TQBcjs.sampleCameraViews.call(void 0, (u) => camera(id, { from, to, u, ms, stage }, values), { ms, fps, cut: _optionalChain([d, 'access', _30 => _30.camera, 'optionalAccess', _31 => _31.cut]) });
767
+ return _chunkABQ2VGUBcjs.sampleCameraViews.call(void 0, (u) => camera(id, { from, to, u, ms, stage }, values), { ms, fps, cut: _optionalChain([d, 'access', _30 => _30.camera, 'optionalAccess', _31 => _31.cut]) });
768
768
  }
769
769
  } : {},
770
770
  ...supportsAuthoring ? {
771
- openAuthoring: (from) => _chunk7AAS3JO6cjs.createEffectAuthoringSession.call(void 0, from, { provider })
771
+ openAuthoring: (from) => _chunk4PA6YS6Wcjs.createEffectAuthoringSession.call(void 0, from, { provider })
772
772
  } : {}
773
773
  };
774
774
  return provider;
@@ -849,7 +849,7 @@ var effectFieldValue = (field, value) => {
849
849
  return value === void 0 || value === null || typeof value === "object" && !Array.isArray(value) ? field.default : value;
850
850
  };
851
851
  function effectSamplePicture(width, height, variant = 0) {
852
- const p = _chunkNTWR5TQBcjs.createEffectPixels.call(void 0, width, height);
852
+ const p = _chunkABQ2VGUBcjs.createEffectPixels.call(void 0, width, height);
853
853
  for (let y = 0, i = 0; y < height; y++) {
854
854
  for (let x = 0; x < width; x++, i += 4) {
855
855
  const u = x / Math.max(1, width - 1);
@@ -1336,4 +1336,4 @@ function createEffectAuthoringToolProvider(host, options) {
1336
1336
 
1337
1337
 
1338
1338
 
1339
- exports.CAMERA_MOVE_ROLES = _chunkNTWR5TQBcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ERROR_CODES = _chunkNTWR5TQBcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkNTWR5TQBcjs.EFFECT_KINDS; exports.EFFECT_USES = _chunkNTWR5TQBcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkNTWR5TQBcjs.EffectControlError; exports.EffectDisposedError = _chunkNTWR5TQBcjs.EffectDisposedError; exports.EffectError = _chunkNTWR5TQBcjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkNTWR5TQBcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkNTWR5TQBcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkNTWR5TQBcjs.NoEffectsProviderError; exports.UnknownEffectError = _chunkNTWR5TQBcjs.UnknownEffectError; exports.applyEffectMask = _chunkNTWR5TQBcjs.applyEffectMask; exports.checkEffectProvider = checkEffectProvider; exports.countEffectTags = _chunkNTWR5TQBcjs.countEffectTags; exports.createEffectAuthoringSession = _chunk7AAS3JO6cjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkNTWR5TQBcjs.createEffectPixels; exports.createEffectToolProvider = _chunkNTWR5TQBcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectOffered = _chunkNTWR5TQBcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectValueErrors = _chunkNTWR5TQBcjs.effectValueErrors; exports.encodeEffectFloat = _chunkNTWR5TQBcjs.encodeEffectFloat; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkNTWR5TQBcjs.hasEffectTags; exports.isCameraView = _chunkNTWR5TQBcjs.isCameraView; exports.isEffectError = _chunkNTWR5TQBcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkNTWR5TQBcjs.isEffectPixels; exports.linearToSrgb = _chunkNTWR5TQBcjs.linearToSrgb; exports.normaliseEffectTag = _chunkNTWR5TQBcjs.normaliseEffectTag; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveEffectValues = _chunkNTWR5TQBcjs.resolveEffectValues; exports.sampleCameraViews = _chunkNTWR5TQBcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkNTWR5TQBcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkNTWR5TQBcjs.searchEffectSummaries; exports.srgbToLinear = _chunkNTWR5TQBcjs.srgbToLinear;
1339
+ exports.CAMERA_MOVE_ROLES = _chunkABQ2VGUBcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ERROR_CODES = _chunkABQ2VGUBcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkABQ2VGUBcjs.EFFECT_KINDS; exports.EFFECT_USES = _chunkABQ2VGUBcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkABQ2VGUBcjs.EffectControlError; exports.EffectDisposedError = _chunkABQ2VGUBcjs.EffectDisposedError; exports.EffectError = _chunkABQ2VGUBcjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkABQ2VGUBcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkABQ2VGUBcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkABQ2VGUBcjs.NoEffectsProviderError; exports.UnknownEffectError = _chunkABQ2VGUBcjs.UnknownEffectError; exports.applyEffectMask = _chunkABQ2VGUBcjs.applyEffectMask; exports.checkEffectProvider = checkEffectProvider; exports.countEffectTags = _chunkABQ2VGUBcjs.countEffectTags; exports.createEffectAuthoringSession = _chunk4PA6YS6Wcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkABQ2VGUBcjs.createEffectPixels; exports.createEffectToolProvider = _chunkABQ2VGUBcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectOffered = _chunkABQ2VGUBcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectValueErrors = _chunkABQ2VGUBcjs.effectValueErrors; exports.encodeEffectFloat = _chunkABQ2VGUBcjs.encodeEffectFloat; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkABQ2VGUBcjs.hasEffectTags; exports.isCameraView = _chunkABQ2VGUBcjs.isCameraView; exports.isEffectError = _chunkABQ2VGUBcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkABQ2VGUBcjs.isEffectPixels; exports.linearToSrgb = _chunkABQ2VGUBcjs.linearToSrgb; exports.normaliseEffectTag = _chunkABQ2VGUBcjs.normaliseEffectTag; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveEffectValues = _chunkABQ2VGUBcjs.resolveEffectValues; exports.sampleCameraViews = _chunkABQ2VGUBcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkABQ2VGUBcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkABQ2VGUBcjs.searchEffectSummaries; exports.srgbToLinear = _chunkABQ2VGUBcjs.srgbToLinear;
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-N4ZXW3WB.js";
4
4
  import {
5
5
  createEffectAuthoringSession
6
- } from "../chunk-WA4IS2EY.js";
6
+ } from "../chunk-4MDWEX44.js";
7
7
  import {
8
8
  EffectRendererPool
9
9
  } from "../chunk-EHLOCVWB.js";
@@ -37,7 +37,7 @@ import {
37
37
  sampleEffectCameraMove,
38
38
  searchEffectSummaries,
39
39
  srgbToLinear
40
- } from "../chunk-HKPLKISO.js";
40
+ } from "../chunk-7DZ55AIE.js";
41
41
  import "../chunk-V2ZCJRDM.js";
42
42
  import "../chunk-RNSANXPT.js";
43
43
  import {
@@ -68,17 +68,23 @@ export interface EffectToolHost {
68
68
  readOnlyReason(): string | null;
69
69
  /** Every target with effects, or one target (throws for an unknown id, naming valid ones). */
70
70
  list(target?: string): EffectTargetEffects[];
71
+ /** Arguments `apply_effect` takes on this editor besides the shared ones (name → schema); given ones reach `apply` in `args`. */
72
+ applyOptions?: Record<string, JsonSchema>;
73
+ /** Arguments `update_effect` takes on this editor besides the shared ones; given ones reach `update` in `changes`. */
74
+ updateOptions?: Record<string, JsonSchema>;
71
75
  apply(target: string, effect: string, args: {
72
76
  values?: Record<string, unknown>;
73
77
  index?: number;
74
78
  enabled?: boolean;
75
79
  opacity?: number;
80
+ [option: string]: unknown;
76
81
  }): Promise<EffectChangeResult>;
77
82
  update(target: string, instance: string, changes: {
78
83
  values?: Record<string, unknown>;
79
84
  index?: number;
80
85
  enabled?: boolean;
81
86
  opacity?: number;
87
+ [option: string]: unknown;
82
88
  }): Promise<EffectChangeResult>;
83
89
  remove(target: string, instance: string): Promise<EffectChangeResult>;
84
90
  /** Editor-specific effect tools (transitions, effect clips, effect layers, keyframes). */
@@ -68,17 +68,23 @@ export interface EffectToolHost {
68
68
  readOnlyReason(): string | null;
69
69
  /** Every target with effects, or one target (throws for an unknown id, naming valid ones). */
70
70
  list(target?: string): EffectTargetEffects[];
71
+ /** Arguments `apply_effect` takes on this editor besides the shared ones (name → schema); given ones reach `apply` in `args`. */
72
+ applyOptions?: Record<string, JsonSchema>;
73
+ /** Arguments `update_effect` takes on this editor besides the shared ones; given ones reach `update` in `changes`. */
74
+ updateOptions?: Record<string, JsonSchema>;
71
75
  apply(target: string, effect: string, args: {
72
76
  values?: Record<string, unknown>;
73
77
  index?: number;
74
78
  enabled?: boolean;
75
79
  opacity?: number;
80
+ [option: string]: unknown;
76
81
  }): Promise<EffectChangeResult>;
77
82
  update(target: string, instance: string, changes: {
78
83
  values?: Record<string, unknown>;
79
84
  index?: number;
80
85
  enabled?: boolean;
81
86
  opacity?: number;
87
+ [option: string]: unknown;
82
88
  }): Promise<EffectChangeResult>;
83
89
  remove(target: string, instance: string): Promise<EffectChangeResult>;
84
90
  /** Editor-specific effect tools (transitions, effect clips, effect layers, keyframes). */
@@ -225,7 +225,8 @@ export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind>
225
225
  * Mask the new layer with the selection when there is one and no `mask` is given (Photoshop's
226
226
  * behaviour). Default false here, for compatibility; the agent tool and the panels pass true.
227
227
  */
228
- useSelection?: boolean;
228
+ useSelection?: boolean; /** Clip the new layer to the layer below it (a clipping mask), so it only adjusts that layer. Default false. */
229
+ clipped?: boolean;
229
230
  }
230
231
  /** A new pixel layer: empty, a solid colour over the canvas, or given pixels, plus its properties and position. */
231
232
  export interface PixelLayerInit extends LayerPlacement {
@@ -859,6 +860,8 @@ export declare class ImageEditorController {
859
860
  enabled?: boolean;
860
861
  blend?: string;
861
862
  opacity?: number;
863
+ /** Keep the layer's transparency: the result never fills transparent pixels. Default false (the effect's alpha replaces the layer's). */
864
+ preserveTransparency?: boolean;
862
865
  /** Limit the filter to the selection (sets the filter mask from it, same undo step). Default false. */
863
866
  useSelection?: boolean;
864
867
  }): Promise<{
@@ -869,7 +872,8 @@ export declare class ImageEditorController {
869
872
  }>;
870
873
  /**
871
874
  * Changes an effect smart filter: `values` merged over its own (`null` resets a control to the
872
- * effect's default), `enabled`, `blend`, `opacity` or its place in the stack (`index`). Values
875
+ * effect's default), `enabled`, `blend`, `opacity`, `preserveTransparency` or its place in the
876
+ * stack (`index`). Values
873
877
  * are checked against the provider's controls. One undo step (none with `commitToHistory`
874
878
  * false, during a drag).
875
879
  */
@@ -878,6 +882,7 @@ export declare class ImageEditorController {
878
882
  enabled?: boolean;
879
883
  blend?: string;
880
884
  opacity?: number;
885
+ preserveTransparency?: boolean;
881
886
  index?: number;
882
887
  }, commitToHistory?: boolean): Promise<SmartFilter>;
883
888
  /**
@@ -885,8 +890,9 @@ export declare class ImageEditorController {
885
890
  * the document's size and bit depth (at `time` ms, default 0), placed like `addPixelLayer`. One
886
891
  * undo step. Masks, blend and opacity apply as to any layer. An effect with a background of its
887
892
  * own (`backgroundOpacity`) starts with it transparent when there are layers below it, unless
888
- * `values` set it. `animate` makes it play when the document is output as an animation. Returns
889
- * its id.
893
+ * `values` set it. `animate` makes it play when the document is output as an animation.
894
+ * `clipped` clips it to the layer below (a clipping mask) in the same step, so it only shows
895
+ * over that layer's pixels. Returns its id.
890
896
  */
891
897
  addEffectLayer(effect: string, options?: LayerPlacement & {
892
898
  values?: Record<string, EffectValue>;
@@ -896,6 +902,7 @@ export declare class ImageEditorController {
896
902
  opacity?: number;
897
903
  blend?: string;
898
904
  id?: string;
905
+ clipped?: boolean;
899
906
  }): Promise<string>;
900
907
  /**
901
908
  * Draws an effect layer again, replacing its pixels (painting on it is lost): with new `values`
@@ -1757,6 +1764,7 @@ export declare class ImageEditorController {
1757
1764
  * above the other adjustment layers (or, without any, above the topmost non-annotation layer,
1758
1765
  * so annotations stay on top); `index` counts adjustment layers (0 = below the others);
1759
1766
  * `aboveId` / `parentId` place it anywhere in the stack. `kind` alone gives neutral parameters.
1767
+ * `clipped` clips it to the layer below in the same step, so it only adjusts that layer.
1760
1768
  */
1761
1769
  addAdjustmentLayer<K extends AdjustmentKind>(init: K | AdjustmentLayerInit<K>, index?: number): string;
1762
1770
  /**
@@ -225,7 +225,8 @@ export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind>
225
225
  * Mask the new layer with the selection when there is one and no `mask` is given (Photoshop's
226
226
  * behaviour). Default false here, for compatibility; the agent tool and the panels pass true.
227
227
  */
228
- useSelection?: boolean;
228
+ useSelection?: boolean; /** Clip the new layer to the layer below it (a clipping mask), so it only adjusts that layer. Default false. */
229
+ clipped?: boolean;
229
230
  }
230
231
  /** A new pixel layer: empty, a solid colour over the canvas, or given pixels, plus its properties and position. */
231
232
  export interface PixelLayerInit extends LayerPlacement {
@@ -859,6 +860,8 @@ export declare class ImageEditorController {
859
860
  enabled?: boolean;
860
861
  blend?: string;
861
862
  opacity?: number;
863
+ /** Keep the layer's transparency: the result never fills transparent pixels. Default false (the effect's alpha replaces the layer's). */
864
+ preserveTransparency?: boolean;
862
865
  /** Limit the filter to the selection (sets the filter mask from it, same undo step). Default false. */
863
866
  useSelection?: boolean;
864
867
  }): Promise<{
@@ -869,7 +872,8 @@ export declare class ImageEditorController {
869
872
  }>;
870
873
  /**
871
874
  * Changes an effect smart filter: `values` merged over its own (`null` resets a control to the
872
- * effect's default), `enabled`, `blend`, `opacity` or its place in the stack (`index`). Values
875
+ * effect's default), `enabled`, `blend`, `opacity`, `preserveTransparency` or its place in the
876
+ * stack (`index`). Values
873
877
  * are checked against the provider's controls. One undo step (none with `commitToHistory`
874
878
  * false, during a drag).
875
879
  */
@@ -878,6 +882,7 @@ export declare class ImageEditorController {
878
882
  enabled?: boolean;
879
883
  blend?: string;
880
884
  opacity?: number;
885
+ preserveTransparency?: boolean;
881
886
  index?: number;
882
887
  }, commitToHistory?: boolean): Promise<SmartFilter>;
883
888
  /**
@@ -885,8 +890,9 @@ export declare class ImageEditorController {
885
890
  * the document's size and bit depth (at `time` ms, default 0), placed like `addPixelLayer`. One
886
891
  * undo step. Masks, blend and opacity apply as to any layer. An effect with a background of its
887
892
  * own (`backgroundOpacity`) starts with it transparent when there are layers below it, unless
888
- * `values` set it. `animate` makes it play when the document is output as an animation. Returns
889
- * its id.
893
+ * `values` set it. `animate` makes it play when the document is output as an animation.
894
+ * `clipped` clips it to the layer below (a clipping mask) in the same step, so it only shows
895
+ * over that layer's pixels. Returns its id.
890
896
  */
891
897
  addEffectLayer(effect: string, options?: LayerPlacement & {
892
898
  values?: Record<string, EffectValue>;
@@ -896,6 +902,7 @@ export declare class ImageEditorController {
896
902
  opacity?: number;
897
903
  blend?: string;
898
904
  id?: string;
905
+ clipped?: boolean;
899
906
  }): Promise<string>;
900
907
  /**
901
908
  * Draws an effect layer again, replacing its pixels (painting on it is lost): with new `values`
@@ -1757,6 +1764,7 @@ export declare class ImageEditorController {
1757
1764
  * above the other adjustment layers (or, without any, above the topmost non-annotation layer,
1758
1765
  * so annotations stay on top); `index` counts adjustment layers (0 = below the others);
1759
1766
  * `aboveId` / `parentId` place it anywhere in the stack. `kind` alone gives neutral parameters.
1767
+ * `clipped` clips it to the layer below in the same step, so it only adjusts that layer.
1760
1768
  */
1761
1769
  addAdjustmentLayer<K extends AdjustmentKind>(init: K | AdjustmentLayerInit<K>, index?: number): string;
1762
1770
  /**