@pixerate/editor 0.53.0 → 0.55.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 (129) hide show
  1. package/dist/agent/index.cjs +20 -12
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +4 -3
  4. package/dist/agent/index.d.ts +4 -3
  5. package/dist/agent/index.js +18 -10
  6. package/dist/agent/index.js.map +1 -1
  7. package/dist/animation/index.cjs +16 -2
  8. package/dist/animation/index.cjs.map +1 -1
  9. package/dist/animation/index.d.cts +4 -226
  10. package/dist/animation/index.d.ts +4 -226
  11. package/dist/animation/index.js +15 -1
  12. package/dist/animation-editor/index.cjs +2221 -0
  13. package/dist/animation-editor/index.cjs.map +1 -0
  14. package/dist/animation-editor/index.d.cts +1117 -0
  15. package/dist/animation-editor/index.d.ts +1117 -0
  16. package/dist/animation-editor/index.js +2221 -0
  17. package/dist/animation-editor/index.js.map +1 -0
  18. package/dist/bezier-BfwIbVTl.d.cts +548 -0
  19. package/dist/bezier-DYBvLgUH.d.ts +548 -0
  20. package/dist/bridge/cli.cjs +36 -0
  21. package/dist/bridge/cli.cjs.map +1 -0
  22. package/dist/bridge/cli.d.cts +1 -0
  23. package/dist/bridge/cli.d.ts +1 -0
  24. package/dist/bridge/cli.js +36 -0
  25. package/dist/bridge/cli.js.map +1 -0
  26. package/dist/bridge/index.cjs +16 -0
  27. package/dist/bridge/index.cjs.map +1 -0
  28. package/dist/bridge/index.d.cts +65 -0
  29. package/dist/bridge/index.d.ts +65 -0
  30. package/dist/bridge/index.js +16 -0
  31. package/dist/bridge/index.js.map +1 -0
  32. package/dist/bridge-client-C5OziCRK.d.cts +148 -0
  33. package/dist/bridge-client-C5dRjrz5.d.ts +148 -0
  34. package/dist/canvas/index.cjs +1564 -557
  35. package/dist/canvas/index.cjs.map +1 -1
  36. package/dist/canvas/index.d.cts +411 -7
  37. package/dist/canvas/index.d.ts +411 -7
  38. package/dist/canvas/index.js +1559 -552
  39. package/dist/canvas/index.js.map +1 -1
  40. package/dist/chart/index.cjs +34 -76
  41. package/dist/chart/index.cjs.map +1 -1
  42. package/dist/chart/index.d.cts +9 -38
  43. package/dist/chart/index.d.ts +9 -38
  44. package/dist/chart/index.js +23 -65
  45. package/dist/chart/index.js.map +1 -1
  46. package/dist/chunk-AWKPSOSX.js +401 -0
  47. package/dist/chunk-AWKPSOSX.js.map +1 -0
  48. package/dist/chunk-B6DSIEXA.js +96 -0
  49. package/dist/chunk-B6DSIEXA.js.map +1 -0
  50. package/dist/chunk-EGFUVXKK.cjs +96 -0
  51. package/dist/chunk-EGFUVXKK.cjs.map +1 -0
  52. package/dist/{chunk-AMWXSYCI.js → chunk-GPWNYQ7R.js} +2 -370
  53. package/dist/chunk-GPWNYQ7R.js.map +1 -0
  54. package/dist/{chunk-TO22LX34.js → chunk-GTMJ4Y3S.js} +2208 -2920
  55. package/dist/chunk-GTMJ4Y3S.js.map +1 -0
  56. package/dist/chunk-H5K77C7Y.cjs +3848 -0
  57. package/dist/chunk-H5K77C7Y.cjs.map +1 -0
  58. package/dist/chunk-K73CKYUM.cjs +458 -0
  59. package/dist/chunk-K73CKYUM.cjs.map +1 -0
  60. package/dist/chunk-MLREO6J3.cjs +737 -0
  61. package/dist/chunk-MLREO6J3.cjs.map +1 -0
  62. package/dist/chunk-NONDTTH7.js +5979 -0
  63. package/dist/chunk-NONDTTH7.js.map +1 -0
  64. package/dist/chunk-NV22EMOZ.cjs +401 -0
  65. package/dist/chunk-NV22EMOZ.cjs.map +1 -0
  66. package/dist/{chunk-YNSK4MGT.cjs → chunk-O2UH7LZE.cjs} +1549 -2261
  67. package/dist/chunk-O2UH7LZE.cjs.map +1 -0
  68. package/dist/chunk-PTMIGXZ2.js +467 -0
  69. package/dist/chunk-PTMIGXZ2.js.map +1 -0
  70. package/dist/chunk-QIWFEEWG.cjs +467 -0
  71. package/dist/chunk-QIWFEEWG.cjs.map +1 -0
  72. package/dist/chunk-VWZB6BCY.js +737 -0
  73. package/dist/chunk-VWZB6BCY.js.map +1 -0
  74. package/dist/chunk-WWJNC7SX.js +3848 -0
  75. package/dist/chunk-WWJNC7SX.js.map +1 -0
  76. package/dist/chunk-XCXQDPID.cjs +5979 -0
  77. package/dist/chunk-XCXQDPID.cjs.map +1 -0
  78. package/dist/color-E9pwm--w.d.cts +33 -0
  79. package/dist/color-E9pwm--w.d.ts +33 -0
  80. package/dist/commands/index.cjs +2 -2
  81. package/dist/commands/index.cjs.map +1 -1
  82. package/dist/commands/index.d.cts +1 -1
  83. package/dist/commands/index.d.ts +1 -1
  84. package/dist/commands/index.js +3 -3
  85. package/dist/diagram/index.cjs +1167 -0
  86. package/dist/diagram/index.cjs.map +1 -0
  87. package/dist/diagram/index.d.cts +810 -0
  88. package/dist/diagram/index.d.ts +810 -0
  89. package/dist/diagram/index.js +1167 -0
  90. package/dist/diagram/index.js.map +1 -0
  91. package/dist/{easing-DTmX99QG.d.cts → easing-CNGk-W6d.d.cts} +1 -1
  92. package/dist/{easing-DTmX99QG.d.ts → easing-CNGk-W6d.d.ts} +1 -1
  93. package/dist/generation/index.d.cts +2 -2
  94. package/dist/generation/index.d.ts +2 -2
  95. package/dist/image-editor/index.d.cts +1 -1
  96. package/dist/image-editor/index.d.ts +1 -1
  97. package/dist/parameters/index.d.cts +1 -1
  98. package/dist/parameters/index.d.ts +1 -1
  99. package/dist/pathfinder-BZL8aSu0.d.cts +469 -0
  100. package/dist/pathfinder-CNtsbCRK.d.ts +469 -0
  101. package/dist/player-Dg0FT0UI.d.cts +193 -0
  102. package/dist/player-W-5DX3Go.d.ts +193 -0
  103. package/dist/presence-Cb6WhcrQ.d.cts +77 -0
  104. package/dist/presence-Cb6WhcrQ.d.ts +77 -0
  105. package/dist/{registry-CSlH4iUn.d.ts → registry-7AZFuand.d.ts} +1 -1
  106. package/dist/{registry-B4l-lYts.d.cts → registry-DIpIaCkH.d.cts} +1 -1
  107. package/dist/svg-CLg2zqZA.d.cts +847 -0
  108. package/dist/svg-CPK82TtU.d.ts +847 -0
  109. package/dist/tools/index.cjs +10 -2
  110. package/dist/tools/index.cjs.map +1 -1
  111. package/dist/tools/index.d.cts +3 -74
  112. package/dist/tools/index.d.ts +3 -74
  113. package/dist/tools/index.js +12 -4
  114. package/dist/types-BULrFyuQ.d.cts +316 -0
  115. package/dist/types-BULrFyuQ.d.ts +316 -0
  116. package/dist/vector/index.cjs +1328 -6752
  117. package/dist/vector/index.cjs.map +1 -1
  118. package/dist/vector/index.d.cts +7 -847
  119. package/dist/vector/index.d.ts +7 -847
  120. package/dist/vector/index.js +645 -6069
  121. package/dist/vector/index.js.map +1 -1
  122. package/package.json +19 -1
  123. package/dist/chunk-AMWXSYCI.js.map +0 -1
  124. package/dist/chunk-TO22LX34.js.map +0 -1
  125. package/dist/chunk-XFYUFVAX.cjs +0 -826
  126. package/dist/chunk-XFYUFVAX.cjs.map +0 -1
  127. package/dist/chunk-YNSK4MGT.cjs.map +0 -1
  128. package/dist/pathfinder-B9xh_pCZ.d.ts +0 -1013
  129. package/dist/pathfinder-QdG70sr9.d.cts +0 -1013
@@ -1,4 +1,4 @@
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; var _class3;
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;
2
2
 
3
3
 
4
4
 
@@ -141,6 +141,14 @@ require('../chunk-XP5IUZUO.cjs');
141
141
 
142
142
 
143
143
  var _chunkTNNJXF46cjs = require('../chunk-TNNJXF46.cjs');
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ var _chunkEGFUVXKKcjs = require('../chunk-EGFUVXKK.cjs');
144
152
  require('../chunk-QKLRAA4T.cjs');
145
153
 
146
154
  // src/chart/raster.ts
@@ -1629,44 +1637,11 @@ function blendChartScenes(from, to, t) {
1629
1637
  var easeChartTween = (t) => 1 - Math.pow(1 - Math.max(0, Math.min(1, t)), 3);
1630
1638
 
1631
1639
  // src/chart/presence.ts
1632
- var ChartPresence = (_class2 = class {constructor() { _class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this); }
1633
- __init4() {this.state = { actors: [] }}
1634
- __init5() {this.listeners = /* @__PURE__ */ new Set()}
1635
- __init6() {this.getState = () => this.state}
1636
- __init7() {this.subscribe = (listener) => {
1637
- this.listeners.add(listener);
1638
- return () => {
1639
- this.listeners.delete(listener);
1640
- };
1641
- }}
1642
- /** Adds or changes an actor. */
1643
- set(actor) {
1644
- const current = this.state.actors.find((a) => a.id === actor.id);
1645
- const next = { name: actor.id, color: CHART_PRESENCE_COLORS[this.state.actors.length % CHART_PRESENCE_COLORS.length], x: 0, y: 0, pressed: false, ...current, ...actor };
1646
- this.state = { actors: current ? this.state.actors.map((a) => a.id === actor.id ? next : a) : [...this.state.actors, next] };
1647
- this.listeners.forEach((l) => l(this.state));
1648
- }
1649
- remove(id) {
1650
- if (!this.state.actors.some((a) => a.id === id)) return;
1651
- this.state = { actors: this.state.actors.filter((a) => a.id !== id) };
1652
- this.listeners.forEach((l) => l(this.state));
1653
- }
1654
- }, _class2);
1655
- var CHART_PRESENCE_COLORS = ["#7c3aed", "#db2777", "#0891b2", "#ea580c", "#16a34a"];
1656
- var realChartClock = {
1657
- now: () => Date.now(),
1658
- wait: (ms) => new Promise((resolve2) => setTimeout(resolve2, Math.max(0, ms)))
1640
+ var ChartPresence = class extends _chunkEGFUVXKKcjs.PresenceStore {
1659
1641
  };
1660
- function createInstantChartClock(start = 0) {
1661
- let t = start;
1662
- return {
1663
- now: () => t,
1664
- wait: async (ms) => {
1665
- t += Math.max(0, ms);
1666
- },
1667
- elapsed: () => t - start
1668
- };
1669
- }
1642
+ var CHART_PRESENCE_COLORS = _chunkEGFUVXKKcjs.PRESENCE_COLORS;
1643
+ var realChartClock = _chunkEGFUVXKKcjs.realPresenceClock;
1644
+ var createInstantChartClock = _chunkEGFUVXKKcjs.createInstantPresenceClock;
1670
1645
  function chartPointAnchor(scene, seriesId, index) {
1671
1646
  const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access', _91 => _91.target, 'optionalAccess', _92 => _92.kind]) === "point" && m.target.seriesId === seriesId && m.target.index === index);
1672
1647
  if (!mark) return null;
@@ -1727,41 +1702,31 @@ function planChartCommand(spec, scene, command, speed = 1) {
1727
1702
  }
1728
1703
  }
1729
1704
  }
1730
- var ChartDirector = (_class3 = class {
1731
- constructor(controller, presence, options) {;_class3.prototype.__init8.call(this);_class3.prototype.__init9.call(this);
1705
+ var ChartDirector = class {
1706
+ constructor(controller, presence, options) {
1732
1707
  this.controller = controller;
1733
1708
  this.presence = presence;
1734
1709
  this.options = options;
1735
1710
  this.clock = _nullishCoalesce(options.clock, () => ( realChartClock));
1711
+ this.queue = new (0, _chunkEGFUVXKKcjs.PerformanceQueue)(presence, {
1712
+ clock: this.clock,
1713
+ linger: options.linger,
1714
+ beginGesture: (key) => controller.beginGesture(key),
1715
+ endGesture: () => controller.endGesture()
1716
+ });
1736
1717
  }
1737
1718
 
1738
1719
 
1739
1720
 
1740
- __init8() {this.queues = /* @__PURE__ */ new Map()}
1741
1721
 
1742
- __init9() {this.calls = 0}
1722
+
1743
1723
  /** Acts out `commands` in order for `actor`. Resolves with one result per command. */
1744
1724
  perform(actor, commands) {
1745
- const prev = _nullishCoalesce(this.queues.get(actor.id), () => ( Promise.resolve()));
1746
- const run = prev.then(async () => {
1725
+ return this.queue.run(actor, async () => {
1747
1726
  const results = [];
1748
- this.presence.set({ id: actor.id, ...actor.name ? { name: actor.name } : {}, ...actor.color ? { color: actor.color } : {} });
1749
- this.controller.beginGesture(`agent:${actor.id}:${++this.calls}`);
1750
- try {
1751
- for (const command of commands) results.push(await this.performOne(actor.id, command));
1752
- } finally {
1753
- this.controller.endGesture();
1754
- this.presence.set({ id: actor.id, message: void 0, pressed: false });
1755
- }
1756
- const linger = _nullishCoalesce(this.options.linger, () => ( 1500));
1757
- if (linger > 0) {
1758
- await this.clock.wait(linger);
1759
- if (this.queues.get(actor.id) === run) this.presence.remove(actor.id);
1760
- }
1727
+ for (const command of commands) results.push(await this.performOne(actor.id, command));
1761
1728
  return results;
1762
1729
  });
1763
- this.queues.set(actor.id, run.catch(() => void 0));
1764
- return run;
1765
1730
  }
1766
1731
  stale(command) {
1767
1732
  const spec = this.controller.getSpec();
@@ -1773,15 +1738,8 @@ var ChartDirector = (_class3 = class {
1773
1738
  }
1774
1739
  return null;
1775
1740
  }
1776
- async move(id, from, to, ms, each) {
1777
- const frames = Math.max(1, Math.round(ms / 16));
1778
- for (let f = 1; f <= frames; f++) {
1779
- const t = f / frames;
1780
- const e = 1 - Math.pow(1 - t, 3);
1781
- this.presence.set({ id, x: from.x + (to.x - from.x) * e, y: from.y + (to.y - from.y) * e });
1782
- _optionalChain([each, 'optionalCall', _100 => _100(e)]);
1783
- await this.clock.wait(ms / frames);
1784
- }
1741
+ move(id, from, to, ms, each) {
1742
+ return _chunkEGFUVXKKcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, id, from, to, ms, each);
1785
1743
  }
1786
1744
  async performOne(id, command) {
1787
1745
  const stale = this.stale(command);
@@ -1811,7 +1769,7 @@ var ChartDirector = (_class3 = class {
1811
1769
  if (command.kind !== "setValue") break;
1812
1770
  const stale2 = this.stale(command);
1813
1771
  if (stale2) return { ok: false, command, message: stale2 };
1814
- const label = `${_nullishCoalesce(_optionalChain([this, 'access', _101 => _101.presence, 'access', _102 => _102.getState, 'call', _103 => _103(), 'access', _104 => _104.actors, 'access', _105 => _105.find, 'call', _106 => _106((a) => a.id === id), 'optionalAccess', _107 => _107.name]), () => ( "Agent"))}: edit value`;
1772
+ const label = `${_nullishCoalesce(_optionalChain([this, 'access', _100 => _100.presence, 'access', _101 => _101.getState, 'call', _102 => _102(), 'access', _103 => _103.actors, 'access', _104 => _104.find, 'call', _105 => _105((a) => a.id === id), 'optionalAccess', _106 => _106.name]), () => ( "Agent"))}: edit value`;
1815
1773
  await this.move(id, where(), step.to, step.ms, (e) => {
1816
1774
  const v = step.from + (step.value - step.from) * e;
1817
1775
  this.controller.setValue(command.seriesId, command.index, Number(v.toPrecision(12)), { label });
@@ -1832,7 +1790,7 @@ var ChartDirector = (_class3 = class {
1832
1790
  return { ok: true, command };
1833
1791
  }
1834
1792
  }
1835
- }, _class3);
1793
+ };
1836
1794
 
1837
1795
  // src/chart/office-files.ts
1838
1796
  var OfficeChartsError = class extends Error {
@@ -1859,7 +1817,7 @@ function elements(root, localName) {
1859
1817
  }
1860
1818
  function relId(el, localName = "id") {
1861
1819
  for (const a of Array.from(el.attributes)) {
1862
- if (a.localName === localName && (_optionalChain([a, 'access', _108 => _108.namespaceURI, 'optionalAccess', _109 => _109.includes, 'call', _110 => _110("relationships")]) || a.prefix === "r")) return a.value;
1820
+ if (a.localName === localName && (_optionalChain([a, 'access', _107 => _107.namespaceURI, 'optionalAccess', _108 => _108.includes, 'call', _109 => _109("relationships")]) || a.prefix === "r")) return a.value;
1863
1821
  }
1864
1822
  return void 0;
1865
1823
  }
@@ -1878,7 +1836,7 @@ async function readRels(r, partPath) {
1878
1836
  const id = rel.getAttribute("Id");
1879
1837
  if (!id) continue;
1880
1838
  const target = _nullishCoalesce(rel.getAttribute("Target"), () => ( ""));
1881
- const external = _optionalChain([rel, 'access', _111 => _111.getAttribute, 'call', _112 => _112("TargetMode"), 'optionalAccess', _113 => _113.toLowerCase, 'call', _114 => _114()]) === "external";
1839
+ const external = _optionalChain([rel, 'access', _110 => _110.getAttribute, 'call', _111 => _111("TargetMode"), 'optionalAccess', _112 => _112.toLowerCase, 'call', _113 => _113()]) === "external";
1882
1840
  rels.set(id, { type: _nullishCoalesce(rel.getAttribute("Type"), () => ( "")), target: external ? target : resolvePartPath(dirname(partPath), target), external });
1883
1841
  }
1884
1842
  return rels;
@@ -1888,7 +1846,7 @@ function frameName(ref) {
1888
1846
  for (let el = ref.parentElement; el; el = el.parentElement) {
1889
1847
  if (el.localName === "graphicFrame") {
1890
1848
  const nv = elements(el, "cNvPr")[0];
1891
- return _optionalChain([nv, 'optionalAccess', _115 => _115.getAttribute, 'call', _116 => _116("name")]) || void 0;
1849
+ return _optionalChain([nv, 'optionalAccess', _114 => _114.getAttribute, 'call', _115 => _115("name")]) || void 0;
1892
1850
  }
1893
1851
  }
1894
1852
  return void 0;
@@ -1924,8 +1882,8 @@ function columnName(index) {
1924
1882
  return name;
1925
1883
  }
1926
1884
  function anchorCell(marker) {
1927
- const col = Number(_optionalChain([firstChild, 'call', _117 => _117(marker, "col"), 'optionalAccess', _118 => _118.textContent]));
1928
- const row = Number(_optionalChain([firstChild, 'call', _119 => _119(marker, "row"), 'optionalAccess', _120 => _120.textContent]));
1885
+ const col = Number(_optionalChain([firstChild, 'call', _116 => _116(marker, "col"), 'optionalAccess', _117 => _117.textContent]));
1886
+ const row = Number(_optionalChain([firstChild, 'call', _118 => _118(marker, "row"), 'optionalAccess', _119 => _119.textContent]));
1929
1887
  return Number.isInteger(col) && Number.isInteger(row) && col >= 0 && row >= 0 ? `${columnName(col)}${row + 1}` : void 0;
1930
1888
  }
1931
1889
  function drawingPlace(ref) {
@@ -2088,7 +2046,7 @@ function createOfficeChartToolProvider(options = {}) {
2088
2046
  description: "Lists the Office files the user opened that charts can be read from. Returns their names and sizes in bytes.",
2089
2047
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
2090
2048
  annotations: { title: "List open files", ...READ2 },
2091
- handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _121 => _121.files, 'optionalCall', _122 => _122()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2049
+ handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _120 => _120.files, 'optionalCall', _121 => _121()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2092
2050
  };
2093
2051
  const listCharts = {
2094
2052
  name: "list_file_charts",