@pixerate/editor 0.269.1 → 0.270.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 (52) hide show
  1. package/README.md +5 -2
  2. package/dist/agent/index.cjs +32 -32
  3. package/dist/agent/index.js +4 -4
  4. package/dist/animation-editor/index.cjs +2 -2
  5. package/dist/animation-editor/index.js +1 -1
  6. package/dist/canvas/editorDocument.d.cts +3 -1
  7. package/dist/canvas/editorDocument.d.ts +3 -1
  8. package/dist/canvas/index.cjs +51 -25
  9. package/dist/canvas/index.js +33 -7
  10. package/dist/chart/index.cjs +21 -21
  11. package/dist/chart/index.js +2 -2
  12. package/dist/{chunk-GBEF2D4P.js → chunk-23YL2EAB.js} +1 -1
  13. package/dist/{chunk-QGVTOCNB.js → chunk-6ZSFRRJI.js} +1 -1
  14. package/dist/{chunk-T4JPGBW3.cjs → chunk-DGITFN73.cjs} +8 -8
  15. package/dist/{chunk-NS62CQ2B.js → chunk-GAZPHCTV.js} +23 -2
  16. package/dist/{chunk-YYBW6DF2.cjs → chunk-GSLOH2IN.cjs} +2 -2
  17. package/dist/{chunk-QCLY5SFS.js → chunk-IBXEQOGI.js} +4 -0
  18. package/dist/{chunk-MQ6MGIQM.js → chunk-NMZQMPFZ.js} +1 -1
  19. package/dist/{chunk-AI4F33IV.cjs → chunk-NQUKTRKN.cjs} +45 -45
  20. package/dist/{chunk-ZGXJ7BTR.cjs → chunk-NRBGAEFI.cjs} +4 -0
  21. package/dist/{chunk-WKPXOGZZ.cjs → chunk-WPLGZBNE.cjs} +23 -2
  22. package/dist/{chunk-N3UMQVKX.js → chunk-X4FTNFIA.js} +1 -1
  23. package/dist/{chunk-2OQGPEHH.cjs → chunk-XUDMRMXQ.cjs} +2 -2
  24. package/dist/diagram/index.cjs +2 -2
  25. package/dist/diagram/index.js +1 -1
  26. package/dist/effects/index.cjs +4 -4
  27. package/dist/effects/index.js +2 -2
  28. package/dist/extensions/index.cjs +5 -5
  29. package/dist/extensions/index.js +4 -4
  30. package/dist/gradient/index.cjs +2 -2
  31. package/dist/gradient/index.js +1 -1
  32. package/dist/history/HistoryManager.d.cts +9 -0
  33. package/dist/history/HistoryManager.d.ts +9 -0
  34. package/dist/history/index.cjs +2 -2
  35. package/dist/history/index.js +1 -1
  36. package/dist/history/types.d.cts +5 -2
  37. package/dist/history/types.d.ts +5 -2
  38. package/dist/index.cjs +10 -10
  39. package/dist/index.js +4 -4
  40. package/dist/parameters/index.cjs +2 -2
  41. package/dist/parameters/index.js +1 -1
  42. package/dist/tools/conformance.d.cts +13 -0
  43. package/dist/tools/conformance.d.ts +13 -0
  44. package/dist/tools/index.cjs +2 -2
  45. package/dist/tools/index.js +1 -1
  46. package/dist/vector/contract.d.cts +2 -1
  47. package/dist/vector/contract.d.ts +2 -1
  48. package/dist/vector/index.cjs +10 -6
  49. package/dist/vector/index.js +9 -5
  50. package/dist/video-editor/index.cjs +4 -4
  51. package/dist/video-editor/index.js +2 -2
  52. package/package.json +1 -1
@@ -41,7 +41,8 @@ export declare function vectorContracts(options: {
41
41
  * A fresh vector editor for replaying a conformance scenario (`domains/vector/fixtures`): every
42
42
  * vector tool provider in one registry that validates arguments, and the saved document. Node ids
43
43
  * come from a counter (`n1`, `n2`, …), so they are part of the contract; text uses the metric
44
- * shaper, the one every implementation can match. `setup` is the scenario's artboard size
44
+ * shaper, the one every implementation can match. `render` is the scene the canvases draw
45
+ * (`getVectorSceneRenderData` with its defaults). `setup` is the scenario's artboard size
45
46
  * (`{ width, height }`, default the editor's); `effects` is the effect provider the effect tools use.
46
47
  */
47
48
  export declare function createVectorConformanceHost(setup: {
@@ -625,7 +625,7 @@ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
625
625
  require('../chunk-2BSBFBOA.cjs');
626
626
 
627
627
 
628
- var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
628
+ var _chunkWPLGZBNEcjs = require('../chunk-WPLGZBNE.cjs');
629
629
  require('../chunk-DWJJI6RT.cjs');
630
630
  require('../chunk-4ZC5QJE2.cjs');
631
631
 
@@ -7164,7 +7164,7 @@ var VectorEditorController = (_class7 = class _VectorEditorController {
7164
7164
  this.brushLibrary = _nullishCoalesce(options.brushLibrary, () => ( null));
7165
7165
  this.brushPreview = _nullishCoalesce(options.brushPreview, () => ( null));
7166
7166
  this.brushes = options.brushLibrary ? _chunkEU2ZZA6Lcjs.snapshotBrushLibrary.call(void 0, options.brushLibrary, () => this.notify()) : null;
7167
- this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWKPXOGZZcjs.HistoryManager)()));
7167
+ this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWPLGZBNEcjs.HistoryManager)()));
7168
7168
  this.doc = options.document ? loadedDocument(options.document) : { width: 800, height: 600, nodes: [] };
7169
7169
  this.doc = this.refreshed(this.doc);
7170
7170
  this.tool = _nullishCoalesce(options.tool, () => ( "select"));
@@ -18984,17 +18984,19 @@ function vectorContracts(options) {
18984
18984
  const files = {
18985
18985
  "document.schema.json": { $schema: "https://json-schema.org/draft/2020-12/schema", $id: "document.schema.json", ...VECTOR_DOCUMENT_JSON_SCHEMA },
18986
18986
  "tools.json": { providers },
18987
- // The commands agents run with run_command: `shortcut` is as written (`Mod` is ⌘ / Ctrl).
18987
+ // The commands agents run with run_command: `shortcut` is as written (`Mod` is ⌘ / Ctrl). A
18988
+ // command without `params` takes none (run_command refuses any); `undoable` and `readOnly`
18989
+ // are the spec's own flags (unset is false), as the registry reads them.
18988
18990
  "commands.json": specs.map((s) => ({
18989
18991
  id: s.id,
18990
18992
  label: s.label,
18991
18993
  ...s.group ? { group: s.group } : {},
18992
18994
  ..._optionalChain([s, 'access', _783 => _783.keywords, 'optionalAccess', _784 => _784.length]) ? { keywords: s.keywords } : {},
18993
18995
  ...s.description ? { description: s.description } : {},
18994
- params: _nullishCoalesce(s.params, () => ( { type: "object", properties: {}, additionalProperties: false })),
18996
+ ...s.params ? { params: s.params } : {},
18995
18997
  ...s.shortcut !== void 0 ? { shortcut: s.shortcut } : {},
18996
18998
  ...s.scope ? { scope: s.scope } : {},
18997
- undoable: s.undoable !== false,
18999
+ undoable: !!s.undoable,
18998
19000
  readOnly: !!s.readOnly,
18999
19001
  ...s.hidden ? { hidden: true } : {}
19000
19002
  })),
@@ -19024,8 +19026,10 @@ function createVectorConformanceHost(setup, options) {
19024
19026
  callTool: (name, args) => registry.callTool(name, args),
19025
19027
  document: () => _chunkSJ2CPTQCcjs.toEditorDocumentFile.call(void 0, document),
19026
19028
  pixels: () => {
19027
- throw new Error("The vector editor has no pixels; compare its document, results and SVG export.");
19029
+ throw new Error("The vector editor has no pixels; compare its document, results, render data and SVG export.");
19028
19030
  },
19031
+ // What the React and Svelte canvases draw, with the default options (no viewport culling).
19032
+ render: () => getVectorSceneRenderData(controller.getState()),
19029
19033
  dispose: () => {
19030
19034
  _optionalChain([document, 'access', _787 => _787.destroy, 'optionalCall', _788 => _788()]);
19031
19035
  _chunk56RHCIJVcjs.setVectorTextShaper.call(void 0, shaper);
@@ -625,7 +625,7 @@ import {
625
625
  import "../chunk-HF5QZS7Z.js";
626
626
  import {
627
627
  HistoryManager
628
- } from "../chunk-NS62CQ2B.js";
628
+ } from "../chunk-GAZPHCTV.js";
629
629
  import "../chunk-5UJHB3BW.js";
630
630
  import "../chunk-M2TPMYJE.js";
631
631
  import {
@@ -18984,17 +18984,19 @@ function vectorContracts(options) {
18984
18984
  const files = {
18985
18985
  "document.schema.json": { $schema: "https://json-schema.org/draft/2020-12/schema", $id: "document.schema.json", ...VECTOR_DOCUMENT_JSON_SCHEMA },
18986
18986
  "tools.json": { providers },
18987
- // The commands agents run with run_command: `shortcut` is as written (`Mod` is ⌘ / Ctrl).
18987
+ // The commands agents run with run_command: `shortcut` is as written (`Mod` is ⌘ / Ctrl). A
18988
+ // command without `params` takes none (run_command refuses any); `undoable` and `readOnly`
18989
+ // are the spec's own flags (unset is false), as the registry reads them.
18988
18990
  "commands.json": specs.map((s) => ({
18989
18991
  id: s.id,
18990
18992
  label: s.label,
18991
18993
  ...s.group ? { group: s.group } : {},
18992
18994
  ...s.keywords?.length ? { keywords: s.keywords } : {},
18993
18995
  ...s.description ? { description: s.description } : {},
18994
- params: s.params ?? { type: "object", properties: {}, additionalProperties: false },
18996
+ ...s.params ? { params: s.params } : {},
18995
18997
  ...s.shortcut !== void 0 ? { shortcut: s.shortcut } : {},
18996
18998
  ...s.scope ? { scope: s.scope } : {},
18997
- undoable: s.undoable !== false,
18999
+ undoable: !!s.undoable,
18998
19000
  readOnly: !!s.readOnly,
18999
19001
  ...s.hidden ? { hidden: true } : {}
19000
19002
  })),
@@ -19024,8 +19026,10 @@ function createVectorConformanceHost(setup, options) {
19024
19026
  callTool: (name, args) => registry.callTool(name, args),
19025
19027
  document: () => toEditorDocumentFile(document),
19026
19028
  pixels: () => {
19027
- throw new Error("The vector editor has no pixels; compare its document, results and SVG export.");
19029
+ throw new Error("The vector editor has no pixels; compare its document, results, render data and SVG export.");
19028
19030
  },
19031
+ // What the React and Svelte canvases draw, with the default options (no viewport culling).
19032
+ render: () => getVectorSceneRenderData(controller.getState()),
19029
19033
  dispose: () => {
19030
19034
  document.destroy?.();
19031
19035
  setVectorTextShaper(shaper);
@@ -1,6 +1,6 @@
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; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
2
2
 
3
- var _chunk2OQGPEHHcjs = require('../chunk-2OQGPEHH.cjs');
3
+ var _chunkXUDMRMXQcjs = require('../chunk-XUDMRMXQ.cjs');
4
4
 
5
5
 
6
6
 
@@ -179,7 +179,7 @@ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
179
179
  require('../chunk-2BSBFBOA.cjs');
180
180
 
181
181
 
182
- var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
182
+ var _chunkWPLGZBNEcjs = require('../chunk-WPLGZBNE.cjs');
183
183
 
184
184
 
185
185
  var _chunkM5GLQQWGcjs = require('../chunk-M5GLQQWG.cjs');
@@ -3664,7 +3664,7 @@ var VideoEditorController = (_class8 = class _VideoEditorController {
3664
3664
  __init54() {this.planBasis = /* @__PURE__ */ new Map()}
3665
3665
  __init55() {this.planCount = 0}
3666
3666
  constructor(options = {}) {;_class8.prototype.__init46.call(this);_class8.prototype.__init47.call(this);_class8.prototype.__init48.call(this);_class8.prototype.__init49.call(this);_class8.prototype.__init50.call(this);_class8.prototype.__init51.call(this);_class8.prototype.__init52.call(this);_class8.prototype.__init53.call(this);_class8.prototype.__init54.call(this);_class8.prototype.__init55.call(this);_class8.prototype.__init56.call(this);_class8.prototype.__init57.call(this);_class8.prototype.__init58.call(this);
3667
- this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWKPXOGZZcjs.HistoryManager)()));
3667
+ this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWPLGZBNEcjs.HistoryManager)()));
3668
3668
  this.audioPeaks = options.audioPeaks instanceof VideoAudioPeaksCache ? options.audioPeaks : new VideoAudioPeaksCache(options.audioPeaks);
3669
3669
  this.luts = options.luts instanceof _chunkCBVNCWJMcjs.VideoLutCache ? options.luts : new (0, _chunkCBVNCWJMcjs.VideoLutCache)(options.luts);
3670
3670
  this.frameCache = _nullishCoalesce(options.frameCache, () => ( null));
@@ -6774,7 +6774,7 @@ async function openVideoClipEffectAuthoring(controller, clip, instance, options
6774
6774
  const at = _chunkCBVNCWJMcjs.findVideoClip.call(void 0, controller.getProject(), clip);
6775
6775
  if (!at) throw new Error(`There is no clip "${clip}".`);
6776
6776
  const doc = videoClipEffectDocument(at.clip, instance, provider.id);
6777
- const session = await _chunk2OQGPEHHcjs.createEffectAuthoringSession.call(void 0, { document: doc }, { ...options, provider });
6777
+ const session = await _chunkXUDMRMXQcjs.createEffectAuthoringSession.call(void 0, { document: doc }, { ...options, provider });
6778
6778
  return {
6779
6779
  clip,
6780
6780
  instance,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createEffectAuthoringSession
3
- } from "../chunk-GBEF2D4P.js";
3
+ } from "../chunk-23YL2EAB.js";
4
4
  import {
5
5
  VIDEO_ADJUSTMENT_SCOPES,
6
6
  VIDEO_BLEND_MODES,
@@ -179,7 +179,7 @@ import {
179
179
  import "../chunk-HF5QZS7Z.js";
180
180
  import {
181
181
  HistoryManager
182
- } from "../chunk-NS62CQ2B.js";
182
+ } from "../chunk-GAZPHCTV.js";
183
183
  import {
184
184
  AnimationPlayer
185
185
  } from "../chunk-F6R67I3A.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.269.1",
3
+ "version": "0.270.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",