@pixerate/editor 0.74.0 → 0.76.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 (62) hide show
  1. package/THIRD_PARTY_NOTICES.md +2 -0
  2. package/dist/agent/index.cjs +28 -28
  3. package/dist/agent/index.js +3 -3
  4. package/dist/animation-editor/index.cjs +322 -273
  5. package/dist/animation-editor/index.cjs.map +1 -1
  6. package/dist/animation-editor/index.d.cts +96 -3
  7. package/dist/animation-editor/index.d.ts +96 -3
  8. package/dist/animation-editor/index.js +138 -89
  9. package/dist/animation-editor/index.js.map +1 -1
  10. package/dist/canvas/index.cjs +26 -26
  11. package/dist/canvas/index.js +2 -2
  12. package/dist/{chunk-3TLL5OID.js → chunk-4JLB2USO.js} +2 -2
  13. package/dist/{chunk-YJLCBA7V.cjs → chunk-7MD7C6XQ.cjs} +87 -87
  14. package/dist/{chunk-YJLCBA7V.cjs.map → chunk-7MD7C6XQ.cjs.map} +1 -1
  15. package/dist/{chunk-OK7T2LHK.js → chunk-GNO5PEMH.js} +2 -2
  16. package/dist/{chunk-EIXXBKUB.js → chunk-IMSX4IVG.js} +7 -7
  17. package/dist/chunk-INZJALPY.js +87 -0
  18. package/dist/chunk-INZJALPY.js.map +1 -0
  19. package/dist/{chunk-MLREO6J3.cjs → chunk-JEYDXRWQ.cjs} +46 -46
  20. package/dist/{chunk-MLREO6J3.cjs.map → chunk-JEYDXRWQ.cjs.map} +1 -1
  21. package/dist/{chunk-PL3MPFPA.cjs → chunk-MXF4DP2C.cjs} +77 -77
  22. package/dist/{chunk-PL3MPFPA.cjs.map → chunk-MXF4DP2C.cjs.map} +1 -1
  23. package/dist/{chunk-T4XWVPJK.cjs → chunk-RKJDBXTY.cjs} +3 -3
  24. package/dist/{chunk-T4XWVPJK.cjs.map → chunk-RKJDBXTY.cjs.map} +1 -1
  25. package/dist/{chunk-HNDSPZ5T.cjs → chunk-ROXFP2LQ.cjs} +4 -4
  26. package/dist/{chunk-HNDSPZ5T.cjs.map → chunk-ROXFP2LQ.cjs.map} +1 -1
  27. package/dist/{chunk-WON34HKM.js → chunk-SVW2UNUC.js} +2 -2
  28. package/dist/{chunk-66IMF6OD.cjs → chunk-TYOAJDFD.cjs} +3 -3
  29. package/dist/{chunk-66IMF6OD.cjs.map → chunk-TYOAJDFD.cjs.map} +1 -1
  30. package/dist/chunk-WAJQKWQU.cjs +87 -0
  31. package/dist/chunk-WAJQKWQU.cjs.map +1 -0
  32. package/dist/{chunk-O2UH7LZE.cjs → chunk-XGD3FSNC.cjs} +239 -239
  33. package/dist/chunk-XGD3FSNC.cjs.map +1 -0
  34. package/dist/{chunk-VWZB6BCY.js → chunk-Y3NW4VJE.js} +2 -2
  35. package/dist/{chunk-GTMJ4Y3S.js → chunk-YCSFS3GK.js} +244 -244
  36. package/dist/{chunk-GTMJ4Y3S.js.map → chunk-YCSFS3GK.js.map} +1 -1
  37. package/dist/{chunk-UKI64KUD.js → chunk-ZQNDSUZO.js} +6 -6
  38. package/dist/extensions/index.cjs +7 -7
  39. package/dist/extensions/index.cjs.map +1 -1
  40. package/dist/extensions/index.js +6 -6
  41. package/dist/index.cjs +35 -35
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.js +17 -17
  44. package/dist/serializers/index.cjs +4 -4
  45. package/dist/serializers/index.cjs.map +1 -1
  46. package/dist/serializers/index.js +3 -3
  47. package/dist/vector/index.cjs +532 -532
  48. package/dist/vector/index.js +3 -3
  49. package/dist/video-editor/index.cjs +2219 -0
  50. package/dist/video-editor/index.cjs.map +1 -0
  51. package/dist/video-editor/index.d.cts +985 -0
  52. package/dist/video-editor/index.d.ts +985 -0
  53. package/dist/video-editor/index.js +2219 -0
  54. package/dist/video-editor/index.js.map +1 -0
  55. package/package.json +6 -1
  56. package/dist/chunk-O2UH7LZE.cjs.map +0 -1
  57. /package/dist/{chunk-3TLL5OID.js.map → chunk-4JLB2USO.js.map} +0 -0
  58. /package/dist/{chunk-OK7T2LHK.js.map → chunk-GNO5PEMH.js.map} +0 -0
  59. /package/dist/{chunk-EIXXBKUB.js.map → chunk-IMSX4IVG.js.map} +0 -0
  60. /package/dist/{chunk-WON34HKM.js.map → chunk-SVW2UNUC.js.map} +0 -0
  61. /package/dist/{chunk-VWZB6BCY.js.map → chunk-Y3NW4VJE.js.map} +0 -0
  62. /package/dist/{chunk-UKI64KUD.js.map → chunk-ZQNDSUZO.js.map} +0 -0
@@ -56,6 +56,8 @@ reproduced at the end of this file. Paths are relative to each source repository
56
56
  - `crates/render/src/eval.rs` (`responsive_source_time` with `protected_regions`: when a composition is stretched, protected spans play at their own speed and the rest absorb the change at one shared rate) → `fitMotionScene` and the `fit_animation` tool in `packages/core/src/animation-editor/fit.ts`; whole shots are kept instead of marker spans, and the fit sets each shot's `speed`
57
57
  - `crates/lottie/src/anim.rs`, `shapes.rs` and `export.rs` (animated properties as Bodymovin keyframes, a cubic ease as the keys' `o` / `i` tangents and holds as `h: 1`; shapes as groups with `sh`, `fl`, `st`, `tm` and a closing `tr`, listed top first; markers; a warning for every feature with no Lottie equivalent) → `toLottie` in `packages/core/src/animation-editor/lottie.ts`; the scene is one shape layer, each node an outer group for its animated pose around an inner one for its own transform, and stretches no single ease describes are sampled
58
58
 
59
+ - `crates/text/src/selectors.rs` (`BasedOn` characters, words or lines and `random_order`: units animated in turn, forward, backward or seeded random) → `motionCommandSlots` and `motionCascade` in `packages/core/src/animation-editor/text.ts`; the units come from outlined text (letter paths sorted into lines and words by position) instead of laid-out glyphs, and centre-out and edges-in orders are added
60
+
59
61
  ## figcraft
60
62
 
61
63
  © 2026 ArtCraft Team and the FigCraft contributors.
@@ -70,7 +70,7 @@ var _chunkRIWPYSKUcjs = require('../chunk-RIWPYSKU.cjs');
70
70
 
71
71
 
72
72
 
73
- var _chunkT4XWVPJKcjs = require('../chunk-T4XWVPJK.cjs');
73
+ var _chunkRKJDBXTYcjs = require('../chunk-RKJDBXTY.cjs');
74
74
 
75
75
 
76
76
  var _chunkTKPPIVW7cjs = require('../chunk-TKPPIVW7.cjs');
@@ -82,9 +82,9 @@ var _chunkCKRNELPOcjs = require('../chunk-CKRNELPO.cjs');
82
82
 
83
83
 
84
84
 
85
- var _chunk66IMF6ODcjs = require('../chunk-66IMF6OD.cjs');
86
- require('../chunk-BVP3TSLH.cjs');
85
+ var _chunkTYOAJDFDcjs = require('../chunk-TYOAJDFD.cjs');
87
86
  require('../chunk-IFHKKVXH.cjs');
87
+ require('../chunk-BVP3TSLH.cjs');
88
88
  require('../chunk-UN33YOXW.cjs');
89
89
 
90
90
 
@@ -472,7 +472,7 @@ function describe(chart, includeSpec) {
472
472
  function sparklines(doc) {
473
473
  const found = [];
474
474
  doc.descendants((node, pos) => {
475
- if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkT4XWVPJKcjs.sparklineLabel.call(void 0, node) });
475
+ if (node.type.name === "sparkline") found.push({ pos, kind: node.attrs.kind, values: node.attrs.values, label: _chunkRKJDBXTYcjs.sparklineLabel.call(void 0, node) });
476
476
  });
477
477
  return found;
478
478
  }
@@ -483,7 +483,7 @@ function checkPosition(editor, at) {
483
483
  function createDocumentChartTools(editor) {
484
484
  const chartType = () => editor().schema.nodes.chart;
485
485
  const findChart = (args) => {
486
- const charts = _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, editor().state.doc);
486
+ const charts = _chunkRKJDBXTYcjs.getDocumentCharts.call(void 0, editor().state.doc);
487
487
  const list = charts.map((c) => `"${c.id}" at ${c.pos}`).join(", ") || "none; add one with insert_chart";
488
488
  if (args.chartId !== void 0) {
489
489
  const chart = charts.find((c) => c.id === args.chartId);
@@ -510,7 +510,7 @@ function createDocumentChartTools(editor) {
510
510
  annotations: { title: "List charts in the document", ...READ },
511
511
  handler: ({ includeSpec = false }) => {
512
512
  const doc = editor().state.doc;
513
- return { charts: _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
513
+ return { charts: _chunkRKJDBXTYcjs.getDocumentCharts.call(void 0, doc).map((c) => describe(c, includeSpec)), sparklines: editor().schema.nodes.sparkline ? sparklines(doc) : [] };
514
514
  }
515
515
  };
516
516
  const insertChart = {
@@ -537,7 +537,7 @@ function createDocumentChartTools(editor) {
537
537
  const node = { type: "chart", attrs: { id, spec, width, ...height !== void 0 ? { height } : {} } };
538
538
  const chain = ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true));
539
539
  const ok = (at !== void 0 ? chain.insertContentAt(at, node) : chain.insertContent(node)).run();
540
- const chart = _chunkT4XWVPJKcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
540
+ const chart = _chunkRKJDBXTYcjs.getDocumentCharts.call(void 0, ed.state.doc).find((c) => c.id === id);
541
541
  if (!ok || !chart) throw new Error(`A chart cannot go at ${_nullishCoalesce(at, () => ( ed.state.selection.from))}; pass a position between blocks or inside a paragraph.`);
542
542
  return { id: chart.id, pos: chart.pos, spec: chart.spec, width: chart.node.attrs.width, height: chart.node.attrs.height };
543
543
  }
@@ -584,8 +584,8 @@ function createDocumentChartTools(editor) {
584
584
  inputSchema: {
585
585
  type: "object",
586
586
  properties: {
587
- values: { type: "array", items: _chunkDK6QBGCScjs.VALUE, minItems: 1, maxItems: _chunkT4XWVPJKcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
588
- kind: { type: "string", enum: [..._chunkT4XWVPJKcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
587
+ values: { type: "array", items: _chunkDK6QBGCScjs.VALUE, minItems: 1, maxItems: _chunkRKJDBXTYcjs.MAX_SPARKLINE_VALUES, description: "Values in order (null for a gap)." },
588
+ kind: { type: "string", enum: [..._chunkRKJDBXTYcjs.SPARKLINE_KINDS], description: "line (default), column, or win-loss (sign only)." },
589
589
  at: { type: "integer", minimum: 0, description: "Document position inside a paragraph (default: the selection)." },
590
590
  width: { type: "number", minimum: 4, maximum: 1e3, description: "Width in pixels (default 80)." },
591
591
  height: { type: "number", minimum: 4, maximum: 200, description: "Height in pixels (default 18)." },
@@ -604,7 +604,7 @@ function createDocumentChartTools(editor) {
604
604
  if (bad >= 0) throw new Error(`values[${bad}] ("${String(values[bad])}") is not a number; pass numbers, numeric text or null. Nothing was inserted.`);
605
605
  const pos = _nullishCoalesce(at, () => ( ed.state.selection.from));
606
606
  if (!ed.state.doc.resolve(pos).parent.inlineContent) throw new Error(`Position ${pos} is between blocks; a sparkline goes inside a paragraph (use a position from get_text {blocks: true}).`);
607
- const stored = _chunkT4XWVPJKcjs.normalizeSparklineValues.call(void 0, parsed);
607
+ const stored = _chunkRKJDBXTYcjs.normalizeSparklineValues.call(void 0, parsed);
608
608
  ed.chain().command(({ tr }) => (_history.closeHistory.call(void 0, tr), true)).insertContentAt(pos, { type: "sparkline", attrs: { values: stored, kind, width, height, color, label } }).run();
609
609
  return { pos, kind, values: stored };
610
610
  }
@@ -639,8 +639,8 @@ function createTextPresence(editor, providerId, option) {
639
639
  const config = option === false ? null : option === true || option === void 0 ? {} : option;
640
640
  const caret = {
641
641
  id: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _23 => _23.id]), () => ( providerId)),
642
- name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _24 => _24.name]), () => ( _chunkT4XWVPJKcjs.DEFAULT_AGENT_CARET_NAME)),
643
- color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _25 => _25.color]), () => ( _chunkT4XWVPJKcjs.DEFAULT_AGENT_CARET_COLOR))
642
+ name: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _24 => _24.name]), () => ( _chunkRKJDBXTYcjs.DEFAULT_AGENT_CARET_NAME)),
643
+ color: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _25 => _25.color]), () => ( _chunkRKJDBXTYcjs.DEFAULT_AGENT_CARET_COLOR))
644
644
  };
645
645
  const typing = !_optionalChain([config, 'optionalAccess', _26 => _26.typing]) ? null : config.typing === true ? {} : config.typing;
646
646
  const idleMs = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _27 => _27.idleMs]), () => ( 12e3));
@@ -653,19 +653,19 @@ function createTextPresence(editor, providerId, option) {
653
653
  };
654
654
  const touch = () => {
655
655
  clearTimeout(idleTimer);
656
- if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
656
+ if (idleMs > 0) idleTimer = setTimeout(() => live() && _chunkRKJDBXTYcjs.clearAgentCaret.call(void 0, live(), caret.id), idleMs);
657
657
  };
658
658
  const tint = (ed, ranges) => {
659
659
  clearTimeout(tintTimer);
660
- _chunkT4XWVPJKcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
661
- if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
660
+ _chunkRKJDBXTYcjs.markAgentChanges.call(void 0, ed, caret.id, ranges);
661
+ if (changedMs > 0 && ranges.length) tintTimer = setTimeout(() => live() && _chunkRKJDBXTYcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
662
662
  };
663
663
  return {
664
664
  /** Puts the caret at `head`, selecting from `anchor`. */
665
665
  show(anchor, head = anchor) {
666
666
  const ed = live();
667
667
  if (!ed) return;
668
- _chunkT4XWVPJKcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
668
+ _chunkRKJDBXTYcjs.setAgentCaret.call(void 0, ed, { ...caret, from: anchor, to: head });
669
669
  touch();
670
670
  },
671
671
  /** Shows the caret after ranges just changed by a tool, tinting them. */
@@ -673,7 +673,7 @@ function createTextPresence(editor, providerId, option) {
673
673
  const ed = live();
674
674
  if (!ed || !ranges.length) return;
675
675
  const last = ranges[ranges.length - 1];
676
- _chunkT4XWVPJKcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
676
+ _chunkRKJDBXTYcjs.setAgentCaret.call(void 0, ed, { ...caret, from: last.to });
677
677
  tint(ed, ranges);
678
678
  touch();
679
679
  },
@@ -681,12 +681,12 @@ function createTextPresence(editor, providerId, option) {
681
681
  async write(ed, from, to, text, signal) {
682
682
  if (live() && typing) {
683
683
  clearTimeout(tintTimer);
684
- const range2 = await _chunkT4XWVPJKcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
685
- if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkT4XWVPJKcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
684
+ const range2 = await _chunkRKJDBXTYcjs.typeAgentText.call(void 0, ed, { ...typing, from, to, text, caret, signal });
685
+ if (changedMs > 0) tintTimer = setTimeout(() => live() && _chunkRKJDBXTYcjs.markAgentChanges.call(void 0, live(), caret.id, []), changedMs);
686
686
  touch();
687
687
  return range2;
688
688
  }
689
- const tr = _chunkT4XWVPJKcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text);
689
+ const tr = _chunkRKJDBXTYcjs.replaceWithTextTransaction.call(void 0, ed.state, from, to, text);
690
690
  const end = tr.mapping.map(to, 1);
691
691
  const range = { from: Math.min(tr.mapping.map(from, -1), end), to: end };
692
692
  ed.view.dispatch(tr.scrollIntoView());
@@ -715,7 +715,7 @@ function findMatches(editor, query, args, replacement) {
715
715
  wholeWord: !!args.wholeWord,
716
716
  ...args.regex ? { regex: true } : { literal: true }
717
717
  };
718
- const result = _chunkT4XWVPJKcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
718
+ const result = _chunkRKJDBXTYcjs.searchDocument.call(void 0, editor.state.doc, query, options, replacement !== void 0 ? { replacement } : {});
719
719
  if (result.error) throw new Error(`Invalid search pattern: ${result.error.message}`);
720
720
  return { matches: result.matches, truncated: result.truncated };
721
721
  }
@@ -751,7 +751,7 @@ function createRichTextToolProvider(target, options) {
751
751
  },
752
752
  handler: ({ format = "text", blocks = false }) => {
753
753
  const ed = editor();
754
- const content = format === "html" ? ed.getHTML() : format === "markdown" ? _chunk66IMF6ODcjs.getEditorMarkdown.call(void 0, ed) : _chunk66IMF6ODcjs.getEditorText.call(void 0, ed);
754
+ const content = format === "html" ? ed.getHTML() : format === "markdown" ? _chunkTYOAJDFDcjs.getEditorMarkdown.call(void 0, ed) : _chunkTYOAJDFDcjs.getEditorText.call(void 0, ed);
755
755
  return {
756
756
  format,
757
757
  content,
@@ -869,7 +869,7 @@ function createRichTextToolProvider(target, options) {
869
869
  replacement: String(replace).replace(/\r\n?|\n/g, "\r")
870
870
  }));
871
871
  const tr = ed.state.tr;
872
- const ends = _chunkT4XWVPJKcjs.applyReplacements.call(void 0, tr, chosen);
872
+ const ends = _chunkRKJDBXTYcjs.applyReplacements.call(void 0, tr, chosen);
873
873
  ed.view.dispatch(tr.scrollIntoView());
874
874
  const ranges = chosen.map((m, i) => ({ from: tr.mapping.map(m.from, -1), to: ends[i] }));
875
875
  presence.changed(ranges.filter((r) => r.from < r.to));
@@ -970,7 +970,7 @@ function createRichTextToolProvider(target, options) {
970
970
  inputSchema: {
971
971
  type: "object",
972
972
  properties: {
973
- operation: { type: "string", enum: _chunkT4XWVPJKcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
973
+ operation: { type: "string", enum: _chunkRKJDBXTYcjs.TABLE_ACTIONS.map((a) => a.action), description: "Table operation." },
974
974
  at: { type: "integer", minimum: 0, description: "Document position to place the cursor first (e.g. inside a cell)." },
975
975
  rows: { type: "integer", minimum: 1, maximum: 100, description: "insertTable: rows (default 3)." },
976
976
  cols: { type: "integer", minimum: 1, maximum: 50, description: "insertTable: columns (default 3)." },
@@ -1000,10 +1000,10 @@ function createRichTextToolProvider(target, options) {
1000
1000
  ed.view.dispatch(ed.state.tr.setSelection(_state.TextSelection.near(ed.state.doc.resolve(at))));
1001
1001
  }
1002
1002
  const action = operation;
1003
- const state = _chunkT4XWVPJKcjs.getTableActionState.call(void 0, ed, action, params);
1003
+ const state = _chunkRKJDBXTYcjs.getTableActionState.call(void 0, ed, action, params);
1004
1004
  if (state !== true) throw new Error(state);
1005
- _chunkT4XWVPJKcjs.runTableAction.call(void 0, ed, action, params);
1006
- const table = _chunkT4XWVPJKcjs.getTableState.call(void 0, ed);
1005
+ _chunkRKJDBXTYcjs.runTableAction.call(void 0, ed, action, params);
1006
+ const table = _chunkRKJDBXTYcjs.getTableState.call(void 0, ed);
1007
1007
  return {
1008
1008
  operation,
1009
1009
  table: table.inTable ? { rows: table.rows, columns: table.columns, row: table.row, column: table.column } : null,
@@ -1019,7 +1019,7 @@ function createRichTextToolProvider(target, options) {
1019
1019
  if (!ed || ed.isDestroyed) return [];
1020
1020
  if (!ed.isEditable) return [getText, findText, ...charts.read()];
1021
1021
  const tools = [getText, findText, insertText, replaceText, replaceRange, replaceSelection, setSelection];
1022
- return [...tools, ..._chunkT4XWVPJKcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write()];
1022
+ return [...tools, ..._chunkRKJDBXTYcjs.isTableEnabled.call(void 0, ed) ? [editTable] : [], ...charts.read(), ...charts.write()];
1023
1023
  },
1024
1024
  subscribe: (notify) => {
1025
1025
  const ed = editor();
@@ -70,7 +70,7 @@ import {
70
70
  setAgentCaret,
71
71
  sparklineLabel,
72
72
  typeAgentText
73
- } from "../chunk-OK7T2LHK.js";
73
+ } from "../chunk-GNO5PEMH.js";
74
74
  import {
75
75
  describeChart
76
76
  } from "../chunk-ZOH6X3VR.js";
@@ -82,9 +82,9 @@ import {
82
82
  import {
83
83
  getEditorMarkdown,
84
84
  getEditorText
85
- } from "../chunk-UKI64KUD.js";
86
- import "../chunk-O5RYH2PG.js";
85
+ } from "../chunk-ZQNDSUZO.js";
87
86
  import "../chunk-SWE3NPOU.js";
87
+ import "../chunk-O5RYH2PG.js";
88
88
  import "../chunk-JQ3BB3E6.js";
89
89
  import {
90
90
  colNameToIndex,