@pixerate/editor 0.234.0 → 0.236.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 (45) hide show
  1. package/dist/agent/index.cjs +286 -27
  2. package/dist/agent/index.d.cts +1 -0
  3. package/dist/agent/index.d.ts +1 -0
  4. package/dist/agent/index.js +261 -2
  5. package/dist/agent/reviewTools.d.cts +16 -0
  6. package/dist/agent/reviewTools.d.ts +16 -0
  7. package/dist/animation-editor/controller.d.cts +25 -0
  8. package/dist/animation-editor/controller.d.ts +25 -0
  9. package/dist/animation-editor/index.cjs +159 -50
  10. package/dist/animation-editor/index.d.cts +1 -0
  11. package/dist/animation-editor/index.d.ts +1 -0
  12. package/dist/animation-editor/index.js +115 -6
  13. package/dist/animation-editor/layers.d.cts +2 -0
  14. package/dist/animation-editor/layers.d.ts +2 -0
  15. package/dist/animation-editor/sequence.d.cts +33 -0
  16. package/dist/animation-editor/sequence.d.ts +33 -0
  17. package/dist/{chunk-PI2UYMZY.js → chunk-FSLKBQU7.js} +269 -15
  18. package/dist/{chunk-I277KJLQ.js → chunk-G3RUKJ5C.js} +105 -1
  19. package/dist/{chunk-6RZVFYGJ.cjs → chunk-JWCKJNDR.cjs} +105 -1
  20. package/dist/{chunk-3MO3ZS7E.js → chunk-PHYOZK3B.js} +59 -311
  21. package/dist/{chunk-CZBRY4SW.cjs → chunk-WPWHT4Z6.cjs} +122 -374
  22. package/dist/{chunk-O7QXVGMP.cjs → chunk-WV5WTOC6.cjs} +295 -41
  23. package/dist/effects/index.cjs +19 -11
  24. package/dist/effects/index.d.cts +1 -0
  25. package/dist/effects/index.d.ts +1 -0
  26. package/dist/effects/index.js +9 -1
  27. package/dist/effects/template-tools.d.cts +25 -0
  28. package/dist/effects/template-tools.d.ts +25 -0
  29. package/dist/effects/templates.d.cts +30 -1
  30. package/dist/effects/templates.d.ts +30 -1
  31. package/dist/extensions/index.cjs +6 -6
  32. package/dist/extensions/index.js +10 -10
  33. package/dist/index.cjs +11 -11
  34. package/dist/index.js +10 -10
  35. package/dist/video-editor/controller.d.cts +26 -0
  36. package/dist/video-editor/controller.d.ts +26 -0
  37. package/dist/video-editor/index.cjs +187 -42
  38. package/dist/video-editor/index.d.cts +1 -0
  39. package/dist/video-editor/index.d.ts +1 -0
  40. package/dist/video-editor/index.js +145 -0
  41. package/dist/video-editor/sequence.d.cts +38 -0
  42. package/dist/video-editor/sequence.d.ts +38 -0
  43. package/package.json +1 -1
  44. package/skills/pixerate-rich-text/SKILL.md +28 -1
  45. package/skills/pixerate-rich-text-revise/SKILL.md +8 -1
@@ -1,20 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
2
2
 
3
+ var _chunkGXLZZVR5cjs = require('../chunk-GXLZZVR5.cjs');
3
4
 
4
5
 
5
6
 
6
- var _chunk6RZVFYGJcjs = require('../chunk-6RZVFYGJ.cjs');
7
7
 
8
8
 
9
- var _chunkGXLZZVR5cjs = require('../chunk-GXLZZVR5.cjs');
10
9
 
11
10
 
11
+ var _chunkDGWOGQJ5cjs = require('../chunk-DGWOGQJ5.cjs');
12
+
12
13
 
13
14
 
14
15
 
15
16
 
16
17
 
17
- var _chunkDGWOGQJ5cjs = require('../chunk-DGWOGQJ5.cjs');
18
+
19
+ var _chunkJWCKJNDRcjs = require('../chunk-JWCKJNDR.cjs');
18
20
 
19
21
 
20
22
 
@@ -498,7 +500,7 @@ function shotLayersShapeProblems(shot, name) {
498
500
  if (layer.effect === void 0 && layer.subject === void 0) problems.push(`${where} needs an "effect", a "subject" or both.`);
499
501
  if (layer.effect !== void 0 && (typeof layer.effect !== "string" || !layer.effect)) problems.push(`${where}: "effect" must be an effect id.`);
500
502
  if (layer.subject !== void 0) {
501
- const kind = _chunk6RZVFYGJcjs.effectSubjectKind.call(void 0, layer.subject);
503
+ const kind = _chunkJWCKJNDRcjs.effectSubjectKind.call(void 0, layer.subject);
502
504
  if (kind === "video") problems.push(`${where}: an animation layer cannot play a video; use { "image" }, { "svg" }, { "text" } or { "slot" } (the video editor plays video).`);
503
505
  else if (!kind || !String(layer.subject[kind]).trim()) problems.push(`${where}: "subject" must be { "image": url }, { "svg": markup }, { "text": words } or { "slot": name }.`);
504
506
  }
@@ -1663,7 +1665,7 @@ function motionLayerSpans(scene) {
1663
1665
  (_nullishCoalesce(shot.layers, () => ( []))).forEach((layer, index) => {
1664
1666
  const start = at(shotIndex2, layer.from, shots[shotIndex2].start);
1665
1667
  const end = Math.max(start, at(shotIndex2, _nullishCoalesce(layer.until, () => ( { shots: 1 })), total));
1666
- out.push({ layer, shot: shot.id, shotIndex: shotIndex2, index, role: _chunk6RZVFYGJcjs.effectLayerRole.call(void 0, layer), start, end });
1668
+ out.push({ layer, shot: shot.id, shotIndex: shotIndex2, index, role: _chunkJWCKJNDRcjs.effectLayerRole.call(void 0, layer), start, end });
1667
1669
  });
1668
1670
  });
1669
1671
  spanCache.set(scene, out);
@@ -1757,7 +1759,7 @@ var MotionLayersEngine = (_class = class {
1757
1759
 
1758
1760
  __init6() {this.generation = 0}
1759
1761
 
1760
- constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
1762
+ constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);
1761
1763
  this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkJAOSL334cjs.EffectsSlot)()));
1762
1764
  this.host = _nullishCoalesce(options.host, () => ( null));
1763
1765
  this.frameSvg = options.frameSvg;
@@ -1802,7 +1804,10 @@ var MotionLayersEngine = (_class = class {
1802
1804
  this.reset();
1803
1805
  this.listeners.clear();
1804
1806
  }
1807
+ /** Goes up each time pictures come in or are cleared, so a view that caches frames knows to draw again. */
1808
+ __init7() {this.revision = 0}
1805
1809
  notify() {
1810
+ this.revision++;
1806
1811
  this.listeners.forEach((l) => l());
1807
1812
  }
1808
1813
  size(b) {
@@ -1876,7 +1881,7 @@ var MotionLayersEngine = (_class = class {
1876
1881
  this.request(key, { layer: layer.id }, async () => {
1877
1882
  const d = await this.describe(effect);
1878
1883
  const values = _chunkJAOSL334cjs.resolveEffectValues.call(void 0, d, layer.values);
1879
- const input = _chunk6RZVFYGJcjs.effectLayerInput.call(void 0, d);
1884
+ const input = _chunkJWCKJNDRcjs.effectLayerInput.call(void 0, d);
1880
1885
  const inputs = layer.subject && input ? { [input]: await this.subjectPixels(layer.subject, size) } : void 0;
1881
1886
  const pixels = await this.pool.render(provider, effect, size, { time, values, ...inputs ? { inputs } : {} });
1882
1887
  return host.encode(pixels);
@@ -1915,7 +1920,7 @@ var MotionLayersEngine = (_class = class {
1915
1920
  });
1916
1921
  return this.get(key);
1917
1922
  }
1918
- __init7() {this.fromPixels = /* @__PURE__ */ new Map()}
1923
+ __init8() {this.fromPixels = /* @__PURE__ */ new Map()}
1919
1924
  async idleExcept(key) {
1920
1925
  for (; ; ) {
1921
1926
  const others = [...this.pending].filter(([k]) => k !== key && !k.startsWith("transition:")).map(([, p]) => p);
@@ -4430,8 +4435,8 @@ async function resolveMotionShotLayer(provider, layer) {
4430
4435
  }
4431
4436
  if (!provider) throw new (0, _chunkJAOSL334cjs.NoEffectsProviderError)();
4432
4437
  const d = await provider.describe(layer.effect);
4433
- if (!_chunk6RZVFYGJcjs.effectLayerOffered.call(void 0, d)) throw new (0, _chunkJAOSL334cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) cannot be a layer; ${kindHint(d)}. A layer's effect is a generator, filter, overlay or title (search_effects with use "generator", "filter", "overlay" or "title").`, d.id);
4434
- const input = _chunk6RZVFYGJcjs.effectLayerInput.call(void 0, d);
4438
+ if (!_chunkJWCKJNDRcjs.effectLayerOffered.call(void 0, d)) throw new (0, _chunkJAOSL334cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) cannot be a layer; ${kindHint(d)}. A layer's effect is a generator, filter, overlay or title (search_effects with use "generator", "filter", "overlay" or "title").`, d.id);
4439
+ const input = _chunkJWCKJNDRcjs.effectLayerInput.call(void 0, d);
4435
4440
  if (layer.subject && !input) throw new (0, _chunkJAOSL334cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) draws its own picture and takes no subject; leave "subject" out, or pick a filter to change the subject.`, d.id);
4436
4441
  if (!layer.subject && input && _optionalChain([d, 'access', _198 => _198.inputs, 'access', _199 => _199.find, 'call', _200 => _200((i) => i.name === input), 'optionalAccess', _201 => _201.required])) throw new (0, _chunkJAOSL334cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) changes a picture; give a "subject": { "image": url }, { "svg": markup }, { "text": words } or { "slot": name }.`, d.id);
4437
4442
  const values = withPreset(d, layer.preset, layer.values);
@@ -4484,6 +4489,57 @@ async function checkMotionShotLayers(scene, provider) {
4484
4489
  return issues;
4485
4490
  }
4486
4491
 
4492
+ // src/animation-editor/sequence.ts
4493
+ var fresh = (used, base) => {
4494
+ const clean = base.replace(/[^\w.-]+/g, "-").replace(/^[^A-Za-z_]+/, "") || "item";
4495
+ if (!used.has(clean)) return used.add(clean), clean;
4496
+ for (let i = 2; ; i++) if (!used.has(`${clean}-${i}`)) return used.add(`${clean}-${i}`), `${clean}-${i}`;
4497
+ };
4498
+ function motionShotsFromSequence(sequence, options = {}) {
4499
+ const sx = (_nullishCoalesce(options.width, () => ( sequence.stage.width))) / sequence.stage.width;
4500
+ const sy = (_nullishCoalesce(options.height, () => ( sequence.stage.height))) / sequence.stage.height;
4501
+ const scale = (r) => ({ x: r.x * sx, y: r.y * sy, width: r.width * sx, height: r.height * sy });
4502
+ const full = { x: 0, y: 0, width: sequence.stage.width * sx, height: sequence.stage.height * sy };
4503
+ const shotIds = new Set(_nullishCoalesce(options.shotIds, () => ( [])));
4504
+ const layerIds = new Set(_nullishCoalesce(options.layerIds, () => ( [])));
4505
+ const notes = [];
4506
+ const provider = options.provider ? { provider: options.provider } : {};
4507
+ const shots = sequence.shots.map((s, i) => {
4508
+ const id = fresh(shotIds, `shot${i + 1}`);
4509
+ const framing = _optionalChain([s, 'access', _205 => _205.camera, 'optionalAccess', _206 => _206.framing]) ? scale(s.camera.framing) : void 0;
4510
+ const view = _nullishCoalesce(framing, () => ( full));
4511
+ const layers = [];
4512
+ for (const layer of s.layers) {
4513
+ if (layer.subject && "video" in layer.subject) {
4514
+ notes.push(`Shot ${i + 1}: a layer plays a video, which an animation cannot; it was left out (the video editor plays it).`);
4515
+ continue;
4516
+ }
4517
+ const { id: given, rect, subject, ...rest } = layer;
4518
+ layers.push({ ...rest, id: fresh(layerIds, _nullishCoalesce(given, () => ( "layer"))), ...subject ? { subject } : {}, ...rect ? { rect: scale(rect) } : {}, ...layer.effect ? provider : {} });
4519
+ }
4520
+ if (s.title) layers.push({ id: fresh(layerIds, `${id}-title`), subject: { text: s.title }, role: "overlay", rect: { x: view.x + view.width * 0.1, y: view.y + view.height * 0.38, width: view.width * 0.8, height: view.height * 0.24 } });
4521
+ if (s.caption) layers.push({ id: fresh(layerIds, `${id}-caption`), subject: { text: s.caption }, role: "overlay", rect: { x: view.x + view.width * 0.1, y: view.y + view.height * 0.8, width: view.width * 0.8, height: view.height * 0.1 } });
4522
+ const camera = framing || _optionalChain([s, 'access', _207 => _207.camera, 'optionalAccess', _208 => _208.in]) !== void 0 || _optionalChain([s, 'access', _209 => _209.camera, 'optionalAccess', _210 => _210.during]) !== void 0 ? { ..._nullishCoalesce(framing, () => ( {})), ..._optionalChain([s, 'access', _211 => _211.camera, 'optionalAccess', _212 => _212.in]) !== void 0 ? { in: s.camera.in } : {}, ..._optionalChain([s, 'access', _213 => _213.camera, 'optionalAccess', _214 => _214.during]) !== void 0 ? { during: s.camera.during } : {} } : void 0;
4523
+ return {
4524
+ id,
4525
+ label: _nullishCoalesce(_nullishCoalesce(s.title, () => ( s.caption)), () => ( `Shot ${i + 1}`)),
4526
+ ...camera ? { camera } : {},
4527
+ run: [],
4528
+ hold: s.hold,
4529
+ ...layers.length ? { layers } : {},
4530
+ ...i > 0 && s.transition ? { transition: { ...s.transition, ...provider } } : {}
4531
+ };
4532
+ });
4533
+ return { shots, notes };
4534
+ }
4535
+ function motionSceneFromSequence(sequence, options = {}) {
4536
+ const { shots, notes } = motionShotsFromSequence(sequence, options);
4537
+ return {
4538
+ scene: { version: 1, name: sequence.name, ...sequence.title ? { description: sequence.title } : {}, artwork: { width: sequence.stage.width, height: sequence.stage.height, background: _nullishCoalesce(options.background, () => ( "#000000")), nodes: [] }, shots },
4539
+ notes
4540
+ };
4541
+ }
4542
+
4487
4543
  // src/animation-editor/effects.ts
4488
4544
  var sourceOf = (c) => c.source;
4489
4545
  function motionSceneEffects(scene) {
@@ -4562,7 +4618,7 @@ function withoutMotionEffect(scene, instance) {
4562
4618
  const shots = [];
4563
4619
  for (const shot of scene.shots) {
4564
4620
  const run = shot.run.filter((c, i) => {
4565
- const mine = _optionalChain([sourceOf, 'call', _205 => _205(c), 'optionalAccess', _206 => _206.instance]) === instance;
4621
+ const mine = _optionalChain([sourceOf, 'call', _215 => _215(c), 'optionalAccess', _216 => _216.instance]) === instance;
4566
4622
  if (mine && !place) place = { shot: shot.id, index: i };
4567
4623
  return !mine;
4568
4624
  });
@@ -4582,22 +4638,22 @@ var AnimationEditorController = (_class2 = class {
4582
4638
 
4583
4639
 
4584
4640
  /** The effects provider slot (see `setEffectsProvider`). */
4585
- __init8() {this.effects = new (0, _chunkJAOSL334cjs.EffectsSlot)()}
4641
+ __init9() {this.effects = new (0, _chunkJAOSL334cjs.EffectsSlot)()}
4586
4642
  /** Renders shot layer and transition pictures for frames (see `MotionLayersEngine`). */
4587
4643
 
4588
4644
 
4589
4645
 
4590
- __init9() {this.selection = null}
4646
+ __init10() {this.selection = null}
4591
4647
 
4592
- __init10() {this.error = null}
4593
- __init11() {this.revision = 0}
4594
- __init12() {this.applying = false}
4648
+ __init11() {this.error = null}
4649
+ __init12() {this.revision = 0}
4650
+ __init13() {this.applying = false}
4595
4651
 
4596
- __init13() {this.listeners = /* @__PURE__ */ new Set()}
4597
- __init14() {this.unsubscribers = []}
4652
+ __init14() {this.listeners = /* @__PURE__ */ new Set()}
4653
+ __init15() {this.unsubscribers = []}
4598
4654
 
4599
- __init15() {this.recording = null}
4600
- constructor(options = {}) {;_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);
4655
+ __init16() {this.recording = null}
4656
+ constructor(options = {}) {;_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);
4601
4657
  this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkFJ2MSI43cjs.HistoryManager)()));
4602
4658
  this.scene = options.scene ? parseMotionScene(options.scene) : createMotionScene(BLANK);
4603
4659
  this.issues = checkMotionScene(this.scene);
@@ -4633,8 +4689,8 @@ var AnimationEditorController = (_class2 = class {
4633
4689
  this.player.pause();
4634
4690
  this.unsubscribers.splice(0).forEach((u) => u());
4635
4691
  }
4636
- __init16() {this.getState = () => this.state}
4637
- __init17() {this.subscribe = (listener) => {
4692
+ __init17() {this.getState = () => this.state}
4693
+ __init18() {this.subscribe = (listener) => {
4638
4694
  this.connect();
4639
4695
  this.listeners.add(listener);
4640
4696
  return () => {
@@ -4657,7 +4713,7 @@ var AnimationEditorController = (_class2 = class {
4657
4713
  time: p.time,
4658
4714
  playing: p.playing,
4659
4715
  loop: p.loop,
4660
- currentShot: _nullishCoalesce(_optionalChain([motionShotAt, 'call', _207 => _207(timeline, p.time), 'optionalAccess', _208 => _208.id]), () => ( null)),
4716
+ currentShot: _nullishCoalesce(_optionalChain([motionShotAt, 'call', _217 => _217(timeline, p.time), 'optionalAccess', _218 => _218.id]), () => ( null)),
4661
4717
  selection: this.selection,
4662
4718
  readOnly: this.readOnly,
4663
4719
  error: this.error,
@@ -4667,6 +4723,7 @@ var AnimationEditorController = (_class2 = class {
4667
4723
  redoLabel: h.redoName,
4668
4724
  revision: this.revision,
4669
4725
  effectsProvider: this.effects.provider,
4726
+ layerPictures: this.layers.revision,
4670
4727
  recording: this.recording ? {
4671
4728
  shot: this.recording.options.id,
4672
4729
  at: this.recording.options.at,
@@ -4705,7 +4762,7 @@ var AnimationEditorController = (_class2 = class {
4705
4762
  this.applying = false;
4706
4763
  }
4707
4764
  this.notify();
4708
- _optionalChain([this, 'access', _209 => _209.onChange, 'optionalCall', _210 => _210(scene)]);
4765
+ _optionalChain([this, 'access', _219 => _219.onChange, 'optionalCall', _220 => _220(scene)]);
4709
4766
  }
4710
4767
  commit(label, next, merge) {
4711
4768
  const before = this.scene;
@@ -4867,7 +4924,7 @@ var AnimationEditorController = (_class2 = class {
4867
4924
  const { group, shots: shots2, notes: notes2 } = motionPartsFromVectorEffect(bare.artwork, motion2, source);
4868
4925
  const index = this.scene.artwork.nodes.findIndex((n2) => n2.id === instance);
4869
4926
  const nodes = [...bare.artwork.nodes];
4870
- nodes.splice(Math.max(0, index), 0, _optionalChain([old, 'optionalAccess', _211 => _211.transform]) ? { ...group, transform: old.transform } : group);
4927
+ nodes.splice(Math.max(0, index), 0, _optionalChain([old, 'optionalAccess', _221 => _221.transform]) ? { ...group, transform: old.transform } : group);
4871
4928
  const at = this.scene.shots.findIndex((s) => was.shots.includes(s.id));
4872
4929
  const kept = bare.shots;
4873
4930
  const nextShots = [...kept.slice(0, Math.max(0, at)), ...shots2, ...kept.slice(Math.max(0, at))];
@@ -4878,7 +4935,7 @@ var AnimationEditorController = (_class2 = class {
4878
4935
  let shots = bare.shots;
4879
4936
  if (place && shots.some((s) => s.id === place.shot)) shots = shots.map((s) => s.id === place.shot ? { ...s, run: [...s.run.slice(0, place.index), ...commands, ...s.run.slice(place.index)] } : s);
4880
4937
  else {
4881
- const at = this.scene.shots.findIndex((s) => s.id === _optionalChain([place, 'optionalAccess', _212 => _212.shot]));
4938
+ const at = this.scene.shots.findIndex((s) => s.id === _optionalChain([place, 'optionalAccess', _222 => _222.shot]));
4882
4939
  shots = [...shots.slice(0, Math.max(0, at)), { id: instance, label: d.name, run: commands }, ...shots.slice(Math.max(0, at))];
4883
4940
  }
4884
4941
  return { scene: { ...bare, shots }, label: `Change ${d.name}`, instance, notes };
@@ -4932,7 +4989,7 @@ var AnimationEditorController = (_class2 = class {
4932
4989
  const found = this.scene.shots.find((s) => s.id === shot);
4933
4990
  if (!found) return this.refuse(`There is no shot "${shot}"; the shots are ${this.scene.shots.map((s) => `"${s.id}"`).join(", ") || "none yet"}.`);
4934
4991
  const field = _chunkJAOSL334cjs.cameraMoveField.call(void 0, role);
4935
- if (_optionalChain([found, 'access', _213 => _213.camera, 'optionalAccess', _214 => _214[field]]) === void 0) return this.refuse(`Shot "${shot}" has no camera "${field}" move to clear${_optionalChain([found, 'access', _215 => _215.camera, 'optionalAccess', _216 => _216[field === "in" ? "during" : "in"]]) !== void 0 ? `; it has a "${field === "in" ? "during" : "in"}" move (role ${role === "hold" ? "transition" : "hold"})` : ""}.`);
4992
+ if (_optionalChain([found, 'access', _223 => _223.camera, 'optionalAccess', _224 => _224[field]]) === void 0) return this.refuse(`Shot "${shot}" has no camera "${field}" move to clear${_optionalChain([found, 'access', _225 => _225.camera, 'optionalAccess', _226 => _226[field === "in" ? "during" : "in"]]) !== void 0 ? `; it has a "${field === "in" ? "during" : "in"}" move (role ${role === "hold" ? "transition" : "hold"})` : ""}.`);
4936
4993
  const rest = { ...found.camera };
4937
4994
  delete rest[field];
4938
4995
  const keep = motionCameraFramed(rest) || rest.in !== void 0 || rest.during !== void 0;
@@ -4942,7 +4999,7 @@ var AnimationEditorController = (_class2 = class {
4942
4999
  }
4943
5000
  cameraMoveResult(shot, role, move) {
4944
5001
  const timing = compileMotionScene(this.scene).shots.find((s) => s.id === shot);
4945
- const camera = _nullishCoalesce(_optionalChain([this, 'access', _217 => _217.scene, 'access', _218 => _218.shots, 'access', _219 => _219.find, 'call', _220 => _220((s) => s.id === shot), 'optionalAccess', _221 => _221.camera]), () => ( null));
5002
+ const camera = _nullishCoalesce(_optionalChain([this, 'access', _227 => _227.scene, 'access', _228 => _228.shots, 'access', _229 => _229.find, 'call', _230 => _230((s) => s.id === shot), 'optionalAccess', _231 => _231.camera]), () => ( null));
4946
5003
  const window = role === "transition" ? { start: timing.start, end: timing.commandsStart } : { start: timing.commandsEnd, end: timing.end };
4947
5004
  const notes = [];
4948
5005
  if (move && role === "transition" && timing.index === 0) notes.push('This is the first shot, which cuts to its framing, so its "in" move does not play; it plays from the second shot on.');
@@ -5013,7 +5070,7 @@ var AnimationEditorController = (_class2 = class {
5013
5070
  viewScene() {
5014
5071
  const r = this.recording;
5015
5072
  if (!r) return this.scene;
5016
- if (_optionalChain([r, 'access', _222 => _222.preview, 'optionalAccess', _223 => _223.count]) === r.samples.length) return r.preview.scene;
5073
+ if (_optionalChain([r, 'access', _232 => _232.preview, 'optionalAccess', _233 => _233.count]) === r.samples.length) return r.preview.scene;
5017
5074
  let scene = this.scene;
5018
5075
  if (r.samples.length) {
5019
5076
  try {
@@ -5162,7 +5219,7 @@ var AnimationEditorController = (_class2 = class {
5162
5219
  const r = this.apply({ op: "update_shot", shot, set: { transition: resolved } }, `Transition ${_nullishCoalesce(resolved.name, () => ( resolved.effect))}`, { merge: options.merge });
5163
5220
  if (!r.ok) return r;
5164
5221
  const camera = this.scene.shots.find((s) => s.id === shot).camera;
5165
- return this.layerResult(shot, void 0, _optionalChain([camera, 'optionalAccess', _224 => _224.in]) === void 0 ? ["With no camera move in, the camera cuts to this shot's framing and the transition does the move."] : []);
5222
+ return this.layerResult(shot, void 0, _optionalChain([camera, 'optionalAccess', _234 => _234.in]) === void 0 ? ["With no camera move in, the camera cuts to this shot's framing and the transition does the move."] : []);
5166
5223
  }
5167
5224
  /** Removes a shot's transition. One undo step. Works without a provider. */
5168
5225
  clearShotTransition(shot) {
@@ -5175,6 +5232,42 @@ var AnimationEditorController = (_class2 = class {
5175
5232
  if (!r.ok) return r;
5176
5233
  return this.layerResult(shot, void 0);
5177
5234
  }
5235
+ /**
5236
+ * Fills a provider sequence template and loads it: `replace` (default) makes a new scene the
5237
+ * size of the template's stage from its shots; `append` adds its shots after the current ones,
5238
+ * scaled to the artwork. Values are checked first and every problem is refused at once. One
5239
+ * undo step. Returns the new shot and layer ids, slots left open and notes.
5240
+ */
5241
+ async fillTemplate(template, values = {}, options = {}) {
5242
+ const reason = this.readOnlyReason();
5243
+ if (reason) return this.refuse(reason);
5244
+ const mode = _nullishCoalesce(options.mode, () => ( "replace"));
5245
+ let filled;
5246
+ try {
5247
+ filled = await _chunkJWCKJNDRcjs.fillEffectTemplate.call(void 0, this.effects.provider, template, values, options.name ? { name: options.name } : {});
5248
+ } catch (error) {
5249
+ if (_chunkJAOSL334cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
5250
+ throw error;
5251
+ }
5252
+ const provider = this.effects.provider.id;
5253
+ const label = `Template ${filled.template.name}`;
5254
+ let shots;
5255
+ let notes;
5256
+ let r;
5257
+ if (mode === "replace") {
5258
+ const made = motionSceneFromSequence(filled.sequence, { provider });
5259
+ shots = made.scene.shots;
5260
+ notes = made.notes;
5261
+ r = this.apply({ op: "replace_scene", scene: made.scene }, label);
5262
+ } else {
5263
+ const made = motionShotsFromSequence(filled.sequence, { provider, width: this.scene.artwork.width, height: this.scene.artwork.height, shotIds: this.scene.shots.map((s) => s.id), layerIds: this.scene.shots.flatMap((s) => (_nullishCoalesce(s.layers, () => ( []))).map((l) => l.id)) });
5264
+ shots = made.shots;
5265
+ notes = made.notes;
5266
+ r = this.apply({ op: "insert_shots", shots: made.shots }, label);
5267
+ }
5268
+ if (!r.ok) return r;
5269
+ return { ok: true, template, mode, shots: shots.map((s) => s.id), layers: shots.flatMap((s) => (_nullishCoalesce(s.layers, () => ( []))).map((l) => l.id)), openSlots: filled.openSlots, notes: [...filled.notes, ...notes] };
5270
+ }
5178
5271
  // ---------------------------------------------------------------------------------------
5179
5272
  // Recording
5180
5273
  // ---------------------------------------------------------------------------------------
@@ -5240,13 +5333,13 @@ var AnimationEditorController = (_class2 = class {
5240
5333
  }
5241
5334
  /** Records the drag's pose with the pointer at `point` (document units). */
5242
5335
  updateRecordGesture(point) {
5243
- const g = _optionalChain([this, 'access', _225 => _225.recording, 'optionalAccess', _226 => _226.gesture]);
5336
+ const g = _optionalChain([this, 'access', _235 => _235.recording, 'optionalAccess', _236 => _236.gesture]);
5244
5337
  if (g) this.recordGesture(g.pose, point);
5245
5338
  }
5246
5339
  /** Ends the stage drag (the take keeps recording). */
5247
5340
  endRecordGesture() {
5248
5341
  const r = this.recording;
5249
- if (!_optionalChain([r, 'optionalAccess', _227 => _227.gesture])) return;
5342
+ if (!_optionalChain([r, 'optionalAccess', _237 => _237.gesture])) return;
5250
5343
  r.gesture = null;
5251
5344
  this.notify();
5252
5345
  }
@@ -5260,7 +5353,7 @@ var AnimationEditorController = (_class2 = class {
5260
5353
  this.recordSample(g.node, { scaleX: Math.max(0.01, pose.scaleX * f), scaleY: Math.max(0.01, pose.scaleY * f) });
5261
5354
  } else {
5262
5355
  const turn = (Math.atan2(point.y - c.y, point.x - c.x) - Math.atan2(g.from.y - c.y, g.from.x - c.x)) * (180 / Math.PI);
5263
- const was = _nullishCoalesce(_optionalChain([this, 'access', _228 => _228.recording, 'access', _229 => _229.samples, 'access', _230 => _230.filter, 'call', _231 => _231((s) => s.node === g.node && s.rotation !== void 0), 'access', _232 => _232.at, 'call', _233 => _233(-1), 'optionalAccess', _234 => _234.rotation]), () => ( pose.rotation));
5356
+ const was = _nullishCoalesce(_optionalChain([this, 'access', _238 => _238.recording, 'access', _239 => _239.samples, 'access', _240 => _240.filter, 'call', _241 => _241((s) => s.node === g.node && s.rotation !== void 0), 'access', _242 => _242.at, 'call', _243 => _243(-1), 'optionalAccess', _244 => _244.rotation]), () => ( pose.rotation));
5264
5357
  let next = pose.rotation + turn;
5265
5358
  next += 360 * Math.round((was - next) / 360);
5266
5359
  this.recordSample(g.node, { rotation: next });
@@ -5354,7 +5447,7 @@ function elementsOf(args) {
5354
5447
  if (Array.isArray(args.ops)) {
5355
5448
  for (const op of args.ops) {
5356
5449
  fromShot(op);
5357
- if (Array.isArray(_optionalChain([op, 'optionalAccess', _235 => _235.shots]))) op.shots.forEach(fromShot);
5450
+ if (Array.isArray(_optionalChain([op, 'optionalAccess', _245 => _245.shots]))) op.shots.forEach(fromShot);
5358
5451
  }
5359
5452
  }
5360
5453
  return out.slice(0, 4);
@@ -5536,7 +5629,7 @@ var MOTION_COMMAND_SCHEMA = {
5536
5629
  oneOf: MOTION_COMMAND_TYPES.map((type) => MOTION_COMMAND_TYPE_SCHEMAS[type])
5537
5630
  };
5538
5631
  var REF2 = (name, description) => ({ $ref: `#/$defs/${name}`, ...description ? { description } : {} });
5539
- var firstSentence = (text) => _nullishCoalesce(_optionalChain([/^.*?[.;](?=\s|$)/, 'access', _236 => _236.exec, 'call', _237 => _237(text), 'optionalAccess', _238 => _238[0]]), () => ( text));
5632
+ var firstSentence = (text) => _nullishCoalesce(_optionalChain([/^.*?[.;](?=\s|$)/, 'access', _246 => _246.exec, 'call', _247 => _247(text), 'optionalAccess', _248 => _248[0]]), () => ( text));
5540
5633
  var COMMAND_TYPE_LINES = MOTION_COMMAND_TYPES.map((type) => `${type}: ${firstSentence(_nullishCoalesce(MOTION_COMMAND_TYPE_SCHEMAS[type].description, () => ( "")))}`);
5541
5634
  var EASE_COMPACT = {
5542
5635
  description: `Easing: a preset, or a curve { "type": "cubic-bezier", x1, y1, x2, y2 }, { "type": "spring", stiffness, damping, mass, velocity } (spring presets are Figma's; with no "duration" it lasts until it settles) or { "type": "elastic", amplitude, period, mode }. Default: ease-out for entrances, ease-in-out for moves.`,
@@ -5945,9 +6038,9 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5945
6038
  handler: ({ from = 0, to, limit = 200 }) => {
5946
6039
  const s = scene();
5947
6040
  const timeline = compileMotionScene(s);
5948
- const words = _nullishCoalesce(_optionalChain([s, 'access', _239 => _239.narration, 'optionalAccess', _240 => _240.words]), () => ( []));
6041
+ const words = _nullishCoalesce(_optionalChain([s, 'access', _249 => _249.narration, 'optionalAccess', _250 => _250.words]), () => ( []));
5949
6042
  const end = _nullishCoalesce(to, () => ( Math.max(timeline.duration, words.length ? _nullishCoalesce(words[words.length - 1].end, () => ( words[words.length - 1].start)) : 0)));
5950
- const shotAt = (ms2) => _optionalChain([timeline, 'access', _241 => _241.shots, 'access', _242 => _242.find, 'call', _243 => _243((x) => ms2 >= x.start && ms2 < x.end), 'optionalAccess', _244 => _244.id]);
6043
+ const shotAt = (ms2) => _optionalChain([timeline, 'access', _251 => _251.shots, 'access', _252 => _252.find, 'call', _253 => _253((x) => ms2 >= x.start && ms2 < x.end), 'optionalAccess', _254 => _254.id]);
5951
6044
  const beats = [];
5952
6045
  if (s.beat && s.beat.bpm > 0) {
5953
6046
  const first = Math.max(0, Math.ceil(motionBeatAt(s.beat, from).beat - 1e-9));
@@ -6323,7 +6416,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
6323
6416
  inputSchema: object({ shot: SHOT_ID, commands: { type: "array", items: REF2("command"), minItems: 1, description: "Commands to add." }, at: { type: "integer", minimum: 0, description: "Index in the run (default: the end)." } }, ["shot", "commands"]),
6324
6417
  annotations: { title: "Add commands to a shot", ...WRITE },
6325
6418
  handler: ({ shot, commands, at }) => {
6326
- const before = _nullishCoalesce(_optionalChain([scene, 'call', _245 => _245(), 'access', _246 => _246.shots, 'access', _247 => _247.find, 'call', _248 => _248((s) => s.id === shot), 'optionalAccess', _249 => _249.run, 'access', _250 => _250.length]), () => ( 0));
6419
+ const before = _nullishCoalesce(_optionalChain([scene, 'call', _255 => _255(), 'access', _256 => _256.shots, 'access', _257 => _257.find, 'call', _258 => _258((s) => s.id === shot), 'optionalAccess', _259 => _259.run, 'access', _260 => _260.length]), () => ( 0));
6327
6420
  const first = _nullishCoalesce(at, () => ( before));
6328
6421
  return apply({ op: "add_commands", shot, commands, at }, "Add commands", (s) => {
6329
6422
  const shots = describeMotionShots(s);
@@ -6524,7 +6617,7 @@ var TIMING = /* @__PURE__ */ new Set(["duration", "delay", "stagger", "with", "e
6524
6617
  var COLORS = /* @__PURE__ */ new Set(["fill", "stroke", "color"]);
6525
6618
  var NODES = /* @__PURE__ */ new Set(["into", "path"]);
6526
6619
  function branch(type) {
6527
- return (_nullishCoalesce(MOTION_COMMAND_SCHEMA.oneOf, () => ( []))).find((b) => _optionalChain([b, 'access', _251 => _251.properties, 'optionalAccess', _252 => _252.type, 'optionalAccess', _253 => _253.const]) === type);
6620
+ return (_nullishCoalesce(MOTION_COMMAND_SCHEMA.oneOf, () => ( []))).find((b) => _optionalChain([b, 'access', _261 => _261.properties, 'optionalAccess', _262 => _262.type, 'optionalAccess', _263 => _263.const]) === type);
6528
6621
  }
6529
6622
  function unitOf(type, name) {
6530
6623
  if (name === "duration" || name === "delay" || name === "stagger") return "ms";
@@ -6559,7 +6652,7 @@ function kindOf(name, schema) {
6559
6652
  }
6560
6653
  function motionCommandFields(type) {
6561
6654
  const schema = branch(type);
6562
- if (!_optionalChain([schema, 'optionalAccess', _254 => _254.properties])) return [];
6655
+ if (!_optionalChain([schema, 'optionalAccess', _264 => _264.properties])) return [];
6563
6656
  const required = new Set(_nullishCoalesce(schema.required, () => ( [])));
6564
6657
  const fields2 = Object.entries(schema.properties).filter(([name]) => name !== "type").map(([name, s]) => {
6565
6658
  const kind = kindOf(name, s);
@@ -6616,7 +6709,7 @@ function defaultMotionCommand(type, targets, scene) {
6616
6709
  if (type === "wait") return { type: "wait", duration: 500 };
6617
6710
  if (!targets.length) return { error: "Pick a target first: click an element on the stage." };
6618
6711
  const nodes = [...indexMotionNodes(scene.artwork.nodes).values()];
6619
- const other = (pred) => _optionalChain([nodes, 'access', _255 => _255.find, 'call', _256 => _256((e) => !targets.includes(e.node.id) && pred(e)), 'optionalAccess', _257 => _257.node, 'access', _258 => _258.id]);
6712
+ const other = (pred) => _optionalChain([nodes, 'access', _265 => _265.find, 'call', _266 => _266((e) => !targets.includes(e.node.id) && pred(e)), 'optionalAccess', _267 => _267.node, 'access', _268 => _268.id]);
6620
6713
  const base = { targets: [...targets] };
6621
6714
  switch (type) {
6622
6715
  case "scale":
@@ -6647,8 +6740,8 @@ function defaultMotionCommand(type, targets, scene) {
6647
6740
  }
6648
6741
  case "effect": {
6649
6742
  for (const id of targets) {
6650
- const node = _optionalChain([nodes, 'access', _259 => _259.find, 'call', _260 => _260((e) => e.node.id === id), 'optionalAccess', _261 => _261.node]);
6651
- for (const effect of _nullishCoalesce(_optionalChain([node, 'optionalAccess', _262 => _262.effects]), () => ( []))) {
6743
+ const node = _optionalChain([nodes, 'access', _269 => _269.find, 'call', _270 => _270((e) => e.node.id === id), 'optionalAccess', _271 => _271.node]);
6744
+ for (const effect of _nullishCoalesce(_optionalChain([node, 'optionalAccess', _272 => _272.effects]), () => ( []))) {
6652
6745
  const param = Object.entries(effect.params).find(([, v]) => typeof v === "number");
6653
6746
  if (param) return { type, ...base, effect: effect.id, param: param[0], to: param[1] + 1 };
6654
6747
  }
@@ -6673,11 +6766,11 @@ function motionCommandRows(scene, shotId) {
6673
6766
  return scene.shots[index].run.map((command3, i) => {
6674
6767
  const t = timeline.commands.find((c) => c.shotIndex === index && c.command === i);
6675
6768
  const primitive = motionFlairPrimitive(command3);
6676
- return { index: i, command: command3, summary: motionCommandSummary(command3), start: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _263 => _263.start]), () => ( 0)), end: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _264 => _264.end]), () => ( 0)), ...primitive ? { flairPrimitive: primitive } : {} };
6769
+ return { index: i, command: command3, summary: motionCommandSummary(command3), start: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _273 => _273.start]), () => ( 0)), end: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _274 => _274.end]), () => ( 0)), ...primitive ? { flairPrimitive: primitive } : {} };
6677
6770
  });
6678
6771
  }
6679
6772
  function duplicateMotionCommandEdit(scene, shot, command3) {
6680
- const run = _nullishCoalesce(_optionalChain([scene, 'access', _265 => _265.shots, 'access', _266 => _266.find, 'call', _267 => _267((s) => s.id === shot), 'optionalAccess', _268 => _268.run]), () => ( []));
6773
+ const run = _nullishCoalesce(_optionalChain([scene, 'access', _275 => _275.shots, 'access', _276 => _276.find, 'call', _277 => _277((s) => s.id === shot), 'optionalAccess', _278 => _278.run]), () => ( []));
6681
6774
  return { op: "add_commands", shot, commands: run[command3] ? [structuredClone(run[command3])] : [], at: command3 + 1 };
6682
6775
  }
6683
6776
  var MOTION_EASE_CHOICES = [
@@ -6762,7 +6855,7 @@ function motionCueFromKey(key) {
6762
6855
  function motionCueChoices(scene, limit = 256) {
6763
6856
  const choices = [];
6764
6857
  const s = (ms2) => `${(ms2 / 1e3).toFixed(2)} s`;
6765
- const end = Math.max(compileMotionScene(scene).duration, ..._nullishCoalesce(_optionalChain([scene, 'access', _269 => _269.narration, 'optionalAccess', _270 => _270.words, 'access', _271 => _271.map, 'call', _272 => _272((w) => _nullishCoalesce(w.end, () => ( w.start)))]), () => ( [0]))) + 2e3;
6858
+ const end = Math.max(compileMotionScene(scene).duration, ..._nullishCoalesce(_optionalChain([scene, 'access', _279 => _279.narration, 'optionalAccess', _280 => _280.words, 'access', _281 => _281.map, 'call', _282 => _282((w) => _nullishCoalesce(w.end, () => ( w.start)))]), () => ( [0]))) + 2e3;
6766
6859
  if (scene.beat && scene.beat.bpm > 0) {
6767
6860
  for (let beat = 0; choices.length < limit; beat++) {
6768
6861
  const time = motionBeatTime(scene.beat, beat);
@@ -6772,7 +6865,7 @@ function motionCueChoices(scene, limit = 256) {
6772
6865
  choices.push({ value: `beat:${beat}`, label: `Beat ${beat} (bar ${at.bar}.${at.beatInBar}) \xB7 ${s(time)}`, time });
6773
6866
  }
6774
6867
  }
6775
- _optionalChain([scene, 'access', _273 => _273.narration, 'optionalAccess', _274 => _274.words, 'access', _275 => _275.forEach, 'call', _276 => _276((w, i) => {
6868
+ _optionalChain([scene, 'access', _283 => _283.narration, 'optionalAccess', _284 => _284.words, 'access', _285 => _285.forEach, 'call', _286 => _286((w, i) => {
6776
6869
  if (choices.length < limit * 2) choices.push({ value: `word:${i}`, label: `Word ${i} \u201C${w.text}\u201D \xB7 ${s(w.start)}`, time: w.start });
6777
6870
  })]);
6778
6871
  return choices;
@@ -6781,7 +6874,7 @@ function motionShotCueTime(scene, cue) {
6781
6874
  return cue ? motionCueTime(scene, cue) : void 0;
6782
6875
  }
6783
6876
  function formatMotionNarration(narration) {
6784
- return (_nullishCoalesce(_optionalChain([narration, 'optionalAccess', _277 => _277.words]), () => ( []))).map((w) => `${w.start} ${w.text}`).join("\n");
6877
+ return (_nullishCoalesce(_optionalChain([narration, 'optionalAccess', _287 => _287.words]), () => ( []))).map((w) => `${w.start} ${w.text}`).join("\n");
6785
6878
  }
6786
6879
  function parseMotionNarration(text) {
6787
6880
  const lines = text.split("\n").map((l) => l.trim()).filter(Boolean);
@@ -6824,7 +6917,7 @@ var ROLE = {
6824
6917
  enum: ["transition", "hold"],
6825
6918
  description: `transition: the move the camera gets into the shot with (its camera "in": a glide, whip pan, punch zoom, cut). hold: the move it makes while the shot holds (its camera "during": a Ken Burns drift, a crash zoom), played across the shot's hold.`
6826
6919
  };
6827
- var summary = (e) => ({ id: e.id, name: e.name, role: e.camera.role, durationMs: e.camera.durationMs, ...e.camera.cut !== void 0 ? { cut: e.camera.cut } : {}, ...e.description ? { description: e.description } : {}, ..._optionalChain([e, 'access', _278 => _278.tags, 'optionalAccess', _279 => _279.length]) ? { tags: e.tags } : {} });
6920
+ var summary = (e) => ({ id: e.id, name: e.name, role: e.camera.role, durationMs: e.camera.durationMs, ...e.camera.cut !== void 0 ? { cut: e.camera.cut } : {}, ...e.description ? { description: e.description } : {}, ..._optionalChain([e, 'access', _288 => _288.tags, 'optionalAccess', _289 => _289.length]) ? { tags: e.tags } : {} });
6828
6921
  var done = (r) => {
6829
6922
  if (!r.ok) throw new Error(r.error);
6830
6923
  return { shot: r.shot, camera: r.camera, ...r.window ? { window: r.window } : {}, ...r.notes.length ? { notes: r.notes } : {} };
@@ -7087,6 +7180,20 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
7087
7180
  extraTools: (ctx) => [
7088
7181
  ...animationCameraMoveTools(controller, ctx),
7089
7182
  ...animationShotLayerTools(controller, ctx),
7183
+ ..._chunkJWCKJNDRcjs.effectTemplateTools.call(void 0,
7184
+ {
7185
+ provider: () => controller.effectsProvider,
7186
+ fillDetails: "mode replace (default) makes a new scene from the template's shots, the size of its stage; mode append adds its shots after the current ones, scaled to the artwork. Each shot keeps its framing and camera moves, its layers and its transition; its title and caption become overlay word layers. Returns { template, mode, shots (new shot ids), layers (new layer ids), openSlots, notes }. Check the result with render_animation_frame.",
7187
+ fillOptions: { mode: { type: "string", enum: ["replace", "append"], description: "replace (default): a new scene from the template; append: its shots after the current ones." } },
7188
+ fill: async (template, values, options2) => {
7189
+ const r = await controller.fillTemplate(template, values, { name: options2.name, mode: options2.mode });
7190
+ if (!r.ok) throw new Error(r.error);
7191
+ const { ok: _ok, ...rest } = r;
7192
+ return rest;
7193
+ }
7194
+ },
7195
+ ctx
7196
+ ),
7090
7197
  {
7091
7198
  name: "add_vector_effect",
7092
7199
  title: "Add a vector effect",
@@ -7343,4 +7450,6 @@ function createAnimationEditorDocument(controller) {
7343
7450
 
7344
7451
 
7345
7452
 
7346
- exports.ANIMATION_EDITOR_AGENT_INSTRUCTIONS = ANIMATION_EDITOR_AGENT_INSTRUCTIONS; exports.AnimationEditorController = AnimationEditorController; exports.FLAIR_EASES = FLAIR_EASES; exports.FLAIR_EXPORT_VERSION = FLAIR_EXPORT_VERSION; exports.MOTION_ADDITIVE_PROPERTIES = MOTION_ADDITIVE_PROPERTIES; exports.MOTION_BLENDS = MOTION_BLENDS; exports.MOTION_CAMERA_MS = MOTION_CAMERA_MS; exports.MOTION_CASCADES = MOTION_CASCADES; exports.MOTION_CLIP_TARGET = MOTION_CLIP_TARGET; exports.MOTION_COMMAND_FIELDS = MOTION_COMMAND_FIELDS; exports.MOTION_COMMAND_SCHEMA = MOTION_COMMAND_SCHEMA; exports.MOTION_COMMAND_TYPES = MOTION_COMMAND_TYPES; exports.MOTION_COMMAND_TYPE_SCHEMAS = MOTION_COMMAND_TYPE_SCHEMAS; exports.MOTION_DEFAULT_DURATIONS = MOTION_DEFAULT_DURATIONS; exports.MOTION_DEFAULT_HOLD = MOTION_DEFAULT_HOLD; exports.MOTION_DIRECTIONS = MOTION_DIRECTIONS; exports.MOTION_DRAW_EFFECT_ID = MOTION_DRAW_EFFECT_ID; exports.MOTION_DRAW_MS_PER_UNIT = MOTION_DRAW_MS_PER_UNIT; exports.MOTION_DRAW_RANGE = MOTION_DRAW_RANGE; exports.MOTION_DRIVEN_PROPERTIES = MOTION_DRIVEN_PROPERTIES; exports.MOTION_EASE_CHOICES = MOTION_EASE_CHOICES; exports.MOTION_EASE_IN_OUT = MOTION_EASE_IN_OUT; exports.MOTION_EASE_OUT = MOTION_EASE_OUT; exports.MOTION_EDIT_OPS = MOTION_EDIT_OPS; exports.MOTION_ENTER_STYLES = MOTION_ENTER_STYLES; exports.MOTION_EXIT_STYLES = MOTION_EXIT_STYLES; exports.MOTION_IRIS_SHAPES = MOTION_IRIS_SHAPES; exports.MOTION_ISSUE_CODES = _chunkDGWOGQJ5cjs.MOTION_ISSUE_CODES; exports.MOTION_MAX_TAKE_MS = MOTION_MAX_TAKE_MS; exports.MOTION_MIN_CHANGE_MS = MOTION_MIN_CHANGE_MS; exports.MOTION_RECORD_GESTURE_MODES = MOTION_RECORD_GESTURE_MODES; exports.MOTION_REPEAT_MODES = MOTION_REPEAT_MODES; exports.MOTION_SPEED_RANGE = MOTION_SPEED_RANGE; exports.MOTION_SPLIT_ORIENTATIONS = MOTION_SPLIT_ORIENTATIONS; exports.MOTION_TEXT_STAGGER = MOTION_TEXT_STAGGER; exports.MOTION_TEXT_UNITS = MOTION_TEXT_UNITS; exports.MOTION_TRIGGERS = MOTION_TRIGGERS; exports.MotionLayersEngine = MotionLayersEngine; exports.MotionSceneFormatError = MotionSceneFormatError; exports.activeSegment = activeSegment; exports.animationCameraMoveTools = animationCameraMoveTools; exports.animationShotLayerTools = animationShotLayerTools; exports.applyMotionControlValues = applyMotionControlValues; exports.applyMotionDrivers = applyMotionDrivers; exports.applyMotionEdits = applyMotionEdits; exports.browserMotionLayerHost = browserMotionLayerHost; exports.checkMotionCameraMoves = checkMotionCameraMoves; exports.checkMotionScene = checkMotionScene; exports.checkMotionShotLayers = checkMotionShotLayers; exports.clipsShapeProblems = clipsShapeProblems; exports.commandShapeProblems = commandShapeProblems; exports.compileMotionScene = compileMotionScene; exports.createAnimationEditorDocument = createAnimationEditorDocument; exports.createAnimationEditorToolProvider = createAnimationEditorToolProvider; exports.createAnimationEffectsToolProvider = createAnimationEffectsToolProvider; exports.createMotionScene = createMotionScene; exports.defaultMotionCommand = defaultMotionCommand; exports.describeMotionElements = describeMotionElements; exports.describeMotionShots = describeMotionShots; exports.driversShapeProblems = driversShapeProblems; exports.duplicateMotionCommandEdit = duplicateMotionCommandEdit; exports.effectsPlayCamera = effectsPlayCamera; exports.findMotionShotLayer = findMotionShotLayer; exports.fitMotionRect = fitMotionRect; exports.fitMotionScene = fitMotionScene; exports.fitMotionSceneEdits = fitMotionSceneEdits; exports.flairAtLeast = flairAtLeast; exports.flairCurveFor = flairCurveFor; exports.flairEaseFor = flairEaseFor; exports.formatMotionDrivers = formatMotionDrivers; exports.formatMotionNarration = formatMotionNarration; exports.freshMotionLayerId = freshMotionLayerId; exports.freshShotId = freshShotId; exports.fromFlairSvgMotion = fromFlairSvgMotion; exports.fromFlairVectorEffect = fromFlairVectorEffect; exports.fromPptxAnimation = fromPptxAnimation; exports.highlightMotionSvg = highlightMotionSvg; exports.indexMotionNodes = indexMotionNodes; exports.interpolateMotionValue = interpolateMotionValue; exports.isMotionCommand = isMotionCommand; exports.isMotionShot = isMotionShot; exports.matchMotionNodes = matchMotionNodes; exports.motionAddTrackKey = motionAddTrackKey; exports.motionArtworkSvg = motionArtworkSvg; exports.motionBeatAt = motionBeatAt; exports.motionBeatTime = motionBeatTime; exports.motionBlurTimes = motionBlurTimes; exports.motionCameraBox = motionCameraBox; exports.motionCameraFramed = motionCameraFramed; exports.motionCameraMoves = motionCameraMoves; exports.motionCameraStage = motionCameraStage; exports.motionCameraTransform = motionCameraTransform; exports.motionCameraViewAt = motionCameraViewAt; exports.motionCameraWindows = motionCameraWindows; exports.motionCascade = motionCascade; exports.motionClientToDocument = motionClientToDocument; exports.motionClipAttrs = motionClipAttrs; exports.motionClipLayout = motionClipLayout; exports.motionCommandDuration = motionCommandDuration; exports.motionCommandFields = motionCommandFields; exports.motionCommandRepeat = motionCommandRepeat; exports.motionCommandRows = motionCommandRows; exports.motionCommandSlots = motionCommandSlots; exports.motionCommandSummary = motionCommandSummary; exports.motionCommandsFromEffect = motionCommandsFromEffect; exports.motionContactSheetSvg = motionContactSheetSvg; exports.motionCueChoices = motionCueChoices; exports.motionCueFromKey = motionCueFromKey; exports.motionCueKey = motionCueKey; exports.motionCueTime = motionCueTime; exports.motionCycleDuration = motionCycleDuration; exports.motionDrivenNodes = motionDrivenNodes; exports.motionDriverSources = motionDriverSources; exports.motionEaseKey = motionEaseKey; exports.motionEasingCurve = motionEasingCurve; exports.motionEasingGuides = motionEasingGuides; exports.motionEasingPath = motionEasingPath; exports.motionFieldEdit = motionFieldEdit; exports.motionFieldLabel = motionFieldLabel; exports.motionFlairPrimitive = motionFlairPrimitive; exports.motionFollowRoute = motionFollowRoute; exports.motionFrameAt = motionFrameAt; exports.motionFrameToSvg = motionFrameToSvg; exports.motionGhosts = motionGhosts; exports.motionIssue = _chunkDGWOGQJ5cjs.motionIssue; exports.motionIssueKey = _chunkDGWOGQJ5cjs.motionIssueKey; exports.motionIssueLine = _chunkDGWOGQJ5cjs.motionIssueLine; exports.motionLayerIds = motionLayerIds; exports.motionLayerSlot = motionLayerSlot; exports.motionLayerSpans = motionLayerSpans; exports.motionLayersAt = motionLayersAt; exports.motionMovingIds = motionMovingIds; exports.motionNodeAtElement = motionNodeAtElement; exports.motionNodeClips = motionNodeClips; exports.motionNodeOffset = motionNodeOffset; exports.motionNodePose = motionNodePose; exports.motionPartsFromVectorEffect = motionPartsFromVectorEffect; exports.motionPath = motionPath; exports.motionPathLength = motionPathLength; exports.motionPathsSvg = motionPathsSvg; exports.motionPropertyValue = motionPropertyValue; exports.motionRestValue = motionRestValue; exports.motionRevealClip = motionRevealClip; exports.motionRevealPadding = motionRevealPadding; exports.motionRulerTicks = motionRulerTicks; exports.motionSceneEffects = motionSceneEffects; exports.motionSceneHasLayers = motionSceneHasLayers; exports.motionSceneShapeProblems = motionSceneShapeProblems; exports.motionSceneToJson = motionSceneToJson; exports.motionShotAt = motionShotAt; exports.motionShotCameraMove = motionShotCameraMove; exports.motionShotCueTime = motionShotCueTime; exports.motionShotLayersInfo = motionShotLayersInfo; exports.motionShotTimeScale = motionShotTimeScale; exports.motionStageSvg = motionStageSvg; exports.motionTakeProblems = motionTakeProblems; exports.motionTakeShot = motionTakeShot; exports.motionTextLayout = motionTextLayout; exports.motionTextUnits = motionTextUnits; exports.motionTrackKey = motionTrackKey; exports.motionTransitionAt = motionTransitionAt; exports.motionTransitionSvg = motionTransitionSvg; exports.namedWithSuggestion = _chunkDGWOGQJ5cjs.namedWithSuggestion; exports.nextMotionEffectInstance = nextMotionEffectInstance; exports.parseMotionDrivers = parseMotionDrivers; exports.parseMotionFieldInput = parseMotionFieldInput; exports.parseMotionNarration = parseMotionNarration; exports.parseMotionScene = parseMotionScene; exports.planAnimationToolPlayback = planAnimationToolPlayback; exports.resolveMotionCamera = resolveMotionCamera; exports.resolveMotionEditRefs = resolveMotionEditRefs; exports.resolveMotionShotLayer = resolveMotionShotLayer; exports.resolveMotionShotTransition = resolveMotionShotTransition; exports.segmentProgress = segmentProgress; exports.segmentValue = segmentValue; exports.shotLayersShapeProblems = shotLayersShapeProblems; exports.shotShapeProblems = shotShapeProblems; exports.simplifyTimedSamples = simplifyTimedSamples; exports.smoothMotionLegs = smoothMotionLegs; exports.smoothMotionTimes = smoothMotionTimes; exports.suggestName = _chunkDGWOGQJ5cjs.suggestName; exports.svgDataUrl = svgDataUrl; exports.toFlairEffectDocument = toFlairEffectDocument; exports.toFlairSvgMotion = toFlairSvgMotion; exports.toFlairVectorEffect = toFlairVectorEffect; exports.toLottie = toLottie; exports.trackValue = trackValue; exports.withAnimationPlayback = withAnimationPlayback; exports.withCameraViewEffects = withCameraViewEffects; exports.withMotionLayers = withMotionLayers; exports.withMotionShotLayers = withMotionShotLayers; exports.withViewBox = withViewBox; exports.withoutMotionEffect = withoutMotionEffect;
7453
+
7454
+
7455
+ exports.ANIMATION_EDITOR_AGENT_INSTRUCTIONS = ANIMATION_EDITOR_AGENT_INSTRUCTIONS; exports.AnimationEditorController = AnimationEditorController; exports.FLAIR_EASES = FLAIR_EASES; exports.FLAIR_EXPORT_VERSION = FLAIR_EXPORT_VERSION; exports.MOTION_ADDITIVE_PROPERTIES = MOTION_ADDITIVE_PROPERTIES; exports.MOTION_BLENDS = MOTION_BLENDS; exports.MOTION_CAMERA_MS = MOTION_CAMERA_MS; exports.MOTION_CASCADES = MOTION_CASCADES; exports.MOTION_CLIP_TARGET = MOTION_CLIP_TARGET; exports.MOTION_COMMAND_FIELDS = MOTION_COMMAND_FIELDS; exports.MOTION_COMMAND_SCHEMA = MOTION_COMMAND_SCHEMA; exports.MOTION_COMMAND_TYPES = MOTION_COMMAND_TYPES; exports.MOTION_COMMAND_TYPE_SCHEMAS = MOTION_COMMAND_TYPE_SCHEMAS; exports.MOTION_DEFAULT_DURATIONS = MOTION_DEFAULT_DURATIONS; exports.MOTION_DEFAULT_HOLD = MOTION_DEFAULT_HOLD; exports.MOTION_DIRECTIONS = MOTION_DIRECTIONS; exports.MOTION_DRAW_EFFECT_ID = MOTION_DRAW_EFFECT_ID; exports.MOTION_DRAW_MS_PER_UNIT = MOTION_DRAW_MS_PER_UNIT; exports.MOTION_DRAW_RANGE = MOTION_DRAW_RANGE; exports.MOTION_DRIVEN_PROPERTIES = MOTION_DRIVEN_PROPERTIES; exports.MOTION_EASE_CHOICES = MOTION_EASE_CHOICES; exports.MOTION_EASE_IN_OUT = MOTION_EASE_IN_OUT; exports.MOTION_EASE_OUT = MOTION_EASE_OUT; exports.MOTION_EDIT_OPS = MOTION_EDIT_OPS; exports.MOTION_ENTER_STYLES = MOTION_ENTER_STYLES; exports.MOTION_EXIT_STYLES = MOTION_EXIT_STYLES; exports.MOTION_IRIS_SHAPES = MOTION_IRIS_SHAPES; exports.MOTION_ISSUE_CODES = _chunkDGWOGQJ5cjs.MOTION_ISSUE_CODES; exports.MOTION_MAX_TAKE_MS = MOTION_MAX_TAKE_MS; exports.MOTION_MIN_CHANGE_MS = MOTION_MIN_CHANGE_MS; exports.MOTION_RECORD_GESTURE_MODES = MOTION_RECORD_GESTURE_MODES; exports.MOTION_REPEAT_MODES = MOTION_REPEAT_MODES; exports.MOTION_SPEED_RANGE = MOTION_SPEED_RANGE; exports.MOTION_SPLIT_ORIENTATIONS = MOTION_SPLIT_ORIENTATIONS; exports.MOTION_TEXT_STAGGER = MOTION_TEXT_STAGGER; exports.MOTION_TEXT_UNITS = MOTION_TEXT_UNITS; exports.MOTION_TRIGGERS = MOTION_TRIGGERS; exports.MotionLayersEngine = MotionLayersEngine; exports.MotionSceneFormatError = MotionSceneFormatError; exports.activeSegment = activeSegment; exports.animationCameraMoveTools = animationCameraMoveTools; exports.animationShotLayerTools = animationShotLayerTools; exports.applyMotionControlValues = applyMotionControlValues; exports.applyMotionDrivers = applyMotionDrivers; exports.applyMotionEdits = applyMotionEdits; exports.browserMotionLayerHost = browserMotionLayerHost; exports.checkMotionCameraMoves = checkMotionCameraMoves; exports.checkMotionScene = checkMotionScene; exports.checkMotionShotLayers = checkMotionShotLayers; exports.clipsShapeProblems = clipsShapeProblems; exports.commandShapeProblems = commandShapeProblems; exports.compileMotionScene = compileMotionScene; exports.createAnimationEditorDocument = createAnimationEditorDocument; exports.createAnimationEditorToolProvider = createAnimationEditorToolProvider; exports.createAnimationEffectsToolProvider = createAnimationEffectsToolProvider; exports.createMotionScene = createMotionScene; exports.defaultMotionCommand = defaultMotionCommand; exports.describeMotionElements = describeMotionElements; exports.describeMotionShots = describeMotionShots; exports.driversShapeProblems = driversShapeProblems; exports.duplicateMotionCommandEdit = duplicateMotionCommandEdit; exports.effectsPlayCamera = effectsPlayCamera; exports.findMotionShotLayer = findMotionShotLayer; exports.fitMotionRect = fitMotionRect; exports.fitMotionScene = fitMotionScene; exports.fitMotionSceneEdits = fitMotionSceneEdits; exports.flairAtLeast = flairAtLeast; exports.flairCurveFor = flairCurveFor; exports.flairEaseFor = flairEaseFor; exports.formatMotionDrivers = formatMotionDrivers; exports.formatMotionNarration = formatMotionNarration; exports.freshMotionLayerId = freshMotionLayerId; exports.freshShotId = freshShotId; exports.fromFlairSvgMotion = fromFlairSvgMotion; exports.fromFlairVectorEffect = fromFlairVectorEffect; exports.fromPptxAnimation = fromPptxAnimation; exports.highlightMotionSvg = highlightMotionSvg; exports.indexMotionNodes = indexMotionNodes; exports.interpolateMotionValue = interpolateMotionValue; exports.isMotionCommand = isMotionCommand; exports.isMotionShot = isMotionShot; exports.matchMotionNodes = matchMotionNodes; exports.motionAddTrackKey = motionAddTrackKey; exports.motionArtworkSvg = motionArtworkSvg; exports.motionBeatAt = motionBeatAt; exports.motionBeatTime = motionBeatTime; exports.motionBlurTimes = motionBlurTimes; exports.motionCameraBox = motionCameraBox; exports.motionCameraFramed = motionCameraFramed; exports.motionCameraMoves = motionCameraMoves; exports.motionCameraStage = motionCameraStage; exports.motionCameraTransform = motionCameraTransform; exports.motionCameraViewAt = motionCameraViewAt; exports.motionCameraWindows = motionCameraWindows; exports.motionCascade = motionCascade; exports.motionClientToDocument = motionClientToDocument; exports.motionClipAttrs = motionClipAttrs; exports.motionClipLayout = motionClipLayout; exports.motionCommandDuration = motionCommandDuration; exports.motionCommandFields = motionCommandFields; exports.motionCommandRepeat = motionCommandRepeat; exports.motionCommandRows = motionCommandRows; exports.motionCommandSlots = motionCommandSlots; exports.motionCommandSummary = motionCommandSummary; exports.motionCommandsFromEffect = motionCommandsFromEffect; exports.motionContactSheetSvg = motionContactSheetSvg; exports.motionCueChoices = motionCueChoices; exports.motionCueFromKey = motionCueFromKey; exports.motionCueKey = motionCueKey; exports.motionCueTime = motionCueTime; exports.motionCycleDuration = motionCycleDuration; exports.motionDrivenNodes = motionDrivenNodes; exports.motionDriverSources = motionDriverSources; exports.motionEaseKey = motionEaseKey; exports.motionEasingCurve = motionEasingCurve; exports.motionEasingGuides = motionEasingGuides; exports.motionEasingPath = motionEasingPath; exports.motionFieldEdit = motionFieldEdit; exports.motionFieldLabel = motionFieldLabel; exports.motionFlairPrimitive = motionFlairPrimitive; exports.motionFollowRoute = motionFollowRoute; exports.motionFrameAt = motionFrameAt; exports.motionFrameToSvg = motionFrameToSvg; exports.motionGhosts = motionGhosts; exports.motionIssue = _chunkDGWOGQJ5cjs.motionIssue; exports.motionIssueKey = _chunkDGWOGQJ5cjs.motionIssueKey; exports.motionIssueLine = _chunkDGWOGQJ5cjs.motionIssueLine; exports.motionLayerIds = motionLayerIds; exports.motionLayerSlot = motionLayerSlot; exports.motionLayerSpans = motionLayerSpans; exports.motionLayersAt = motionLayersAt; exports.motionMovingIds = motionMovingIds; exports.motionNodeAtElement = motionNodeAtElement; exports.motionNodeClips = motionNodeClips; exports.motionNodeOffset = motionNodeOffset; exports.motionNodePose = motionNodePose; exports.motionPartsFromVectorEffect = motionPartsFromVectorEffect; exports.motionPath = motionPath; exports.motionPathLength = motionPathLength; exports.motionPathsSvg = motionPathsSvg; exports.motionPropertyValue = motionPropertyValue; exports.motionRestValue = motionRestValue; exports.motionRevealClip = motionRevealClip; exports.motionRevealPadding = motionRevealPadding; exports.motionRulerTicks = motionRulerTicks; exports.motionSceneEffects = motionSceneEffects; exports.motionSceneFromSequence = motionSceneFromSequence; exports.motionSceneHasLayers = motionSceneHasLayers; exports.motionSceneShapeProblems = motionSceneShapeProblems; exports.motionSceneToJson = motionSceneToJson; exports.motionShotAt = motionShotAt; exports.motionShotCameraMove = motionShotCameraMove; exports.motionShotCueTime = motionShotCueTime; exports.motionShotLayersInfo = motionShotLayersInfo; exports.motionShotTimeScale = motionShotTimeScale; exports.motionShotsFromSequence = motionShotsFromSequence; exports.motionStageSvg = motionStageSvg; exports.motionTakeProblems = motionTakeProblems; exports.motionTakeShot = motionTakeShot; exports.motionTextLayout = motionTextLayout; exports.motionTextUnits = motionTextUnits; exports.motionTrackKey = motionTrackKey; exports.motionTransitionAt = motionTransitionAt; exports.motionTransitionSvg = motionTransitionSvg; exports.namedWithSuggestion = _chunkDGWOGQJ5cjs.namedWithSuggestion; exports.nextMotionEffectInstance = nextMotionEffectInstance; exports.parseMotionDrivers = parseMotionDrivers; exports.parseMotionFieldInput = parseMotionFieldInput; exports.parseMotionNarration = parseMotionNarration; exports.parseMotionScene = parseMotionScene; exports.planAnimationToolPlayback = planAnimationToolPlayback; exports.resolveMotionCamera = resolveMotionCamera; exports.resolveMotionEditRefs = resolveMotionEditRefs; exports.resolveMotionShotLayer = resolveMotionShotLayer; exports.resolveMotionShotTransition = resolveMotionShotTransition; exports.segmentProgress = segmentProgress; exports.segmentValue = segmentValue; exports.shotLayersShapeProblems = shotLayersShapeProblems; exports.shotShapeProblems = shotShapeProblems; exports.simplifyTimedSamples = simplifyTimedSamples; exports.smoothMotionLegs = smoothMotionLegs; exports.smoothMotionTimes = smoothMotionTimes; exports.suggestName = _chunkDGWOGQJ5cjs.suggestName; exports.svgDataUrl = svgDataUrl; exports.toFlairEffectDocument = toFlairEffectDocument; exports.toFlairSvgMotion = toFlairSvgMotion; exports.toFlairVectorEffect = toFlairVectorEffect; exports.toLottie = toLottie; exports.trackValue = trackValue; exports.withAnimationPlayback = withAnimationPlayback; exports.withCameraViewEffects = withCameraViewEffects; exports.withMotionLayers = withMotionLayers; exports.withMotionShotLayers = withMotionShotLayers; exports.withViewBox = withViewBox; exports.withoutMotionEffect = withoutMotionEffect;
@@ -34,6 +34,7 @@ export * from './camera-tools.cjs';
34
34
  export * from './layers.cjs';
35
35
  export * from './layer-edit.cjs';
36
36
  export * from './layer-tools.cjs';
37
+ export * from './sequence.cjs';
37
38
  export * from './effect-tools.cjs';
38
39
  export * from './playback.cjs';
39
40
  export * from './editorDocument.cjs';
@@ -34,6 +34,7 @@ export * from './camera-tools.js';
34
34
  export * from './layers.js';
35
35
  export * from './layer-edit.js';
36
36
  export * from './layer-tools.js';
37
+ export * from './sequence.js';
37
38
  export * from './effect-tools.js';
38
39
  export * from './playback.js';
39
40
  export * from './editorDocument.js';