@pixerate/editor 0.180.0 → 0.181.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 (37) hide show
  1. package/dist/agent/index.cjs +34 -34
  2. package/dist/agent/index.js +5 -5
  3. package/dist/canvas/index.cjs +6 -6
  4. package/dist/canvas/index.js +2 -2
  5. package/dist/chart/index.cjs +162 -157
  6. package/dist/chart/index.d.cts +1 -0
  7. package/dist/chart/index.d.ts +1 -0
  8. package/dist/chart/index.js +12 -7
  9. package/dist/chart/layout-streamgraph.d.cts +15 -0
  10. package/dist/chart/layout-streamgraph.d.ts +15 -0
  11. package/dist/chart/spec.d.cts +1 -1
  12. package/dist/chart/spec.d.ts +1 -1
  13. package/dist/chart/types.d.cts +2 -1
  14. package/dist/chart/types.d.ts +2 -1
  15. package/dist/{chunk-KPWG3PSW.js → chunk-23E5GI2U.js} +8 -2
  16. package/dist/{chunk-IMHRN4ZZ.js → chunk-3MO3ZS7E.js} +3 -3
  17. package/dist/{chunk-GXEC4FS6.cjs → chunk-5DQPDXOM.cjs} +82 -76
  18. package/dist/{chunk-ORZF4JOO.js → chunk-6ZZKRH7R.js} +3 -1
  19. package/dist/{chunk-FHNGNL3V.cjs → chunk-CZBRY4SW.cjs} +51 -51
  20. package/dist/{chunk-34UCPHYO.js → chunk-GOBOCZZI.js} +2 -2
  21. package/dist/{chunk-VKHJJUBK.cjs → chunk-HUAISCUX.cjs} +22 -18
  22. package/dist/{chunk-OLCHKGGO.js → chunk-L6Y7TSQ4.js} +5 -1
  23. package/dist/{chunk-TUXKLM5W.cjs → chunk-N76AMOKE.cjs} +224 -42
  24. package/dist/{chunk-RLOIEDA3.cjs → chunk-O7QXVGMP.cjs} +16 -16
  25. package/dist/{chunk-R2VHVQVY.js → chunk-PI2UYMZY.js} +3 -3
  26. package/dist/{chunk-E45AIIWY.cjs → chunk-RUONPPMC.cjs} +8 -8
  27. package/dist/{chunk-GTF4RYXJ.cjs → chunk-SOSBOS5T.cjs} +22 -22
  28. package/dist/{chunk-FKYGM35R.js → chunk-UFEDHACQ.js} +2 -2
  29. package/dist/{chunk-OJQVKJYD.js → chunk-WKMUBATU.js} +183 -1
  30. package/dist/{chunk-OUO3DSRT.cjs → chunk-WRZ6C4TU.cjs} +3 -1
  31. package/dist/export/index.cjs +4 -4
  32. package/dist/export/index.js +3 -3
  33. package/dist/extensions/index.cjs +7 -7
  34. package/dist/extensions/index.js +6 -6
  35. package/dist/index.cjs +13 -13
  36. package/dist/index.js +7 -7
  37. package/package.json +1 -1
@@ -7,7 +7,7 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkVKHJJUBKcjs = require('./chunk-VKHJJUBK.cjs');
10
+ var _chunkHUAISCUXcjs = require('./chunk-HUAISCUX.cjs');
11
11
 
12
12
 
13
13
  var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
@@ -34,10 +34,10 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
34
34
 
35
35
 
36
36
 
37
- var _chunkRLOIEDA3cjs = require('./chunk-RLOIEDA3.cjs');
37
+ var _chunkO7QXVGMPcjs = require('./chunk-O7QXVGMP.cjs');
38
38
 
39
39
 
40
- var _chunkOUO3DSRTcjs = require('./chunk-OUO3DSRT.cjs');
40
+ var _chunkWRZ6C4TUcjs = require('./chunk-WRZ6C4TU.cjs');
41
41
 
42
42
 
43
43
 
@@ -2464,13 +2464,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
2464
2464
  const charts = /* @__PURE__ */ new Map();
2465
2465
  if (options.charts === false) return charts;
2466
2466
  for (const el of descendants(root, "chart")) {
2467
- if (el.namespaceURI !== _chunkVKHJJUBKcjs.CHART_OOXML_NS) continue;
2467
+ if (el.namespaceURI !== _chunkHUAISCUXcjs.CHART_OOXML_NS) continue;
2468
2468
  const id = attr(el, "id");
2469
2469
  const rel = id ? rels.get(id) : void 0;
2470
2470
  if (!id || !rel || rel.external || charts.has(id)) continue;
2471
2471
  const entry = zip.get(rel.target);
2472
2472
  if (!entry) continue;
2473
- const read = _chunkVKHJJUBKcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2473
+ const read = _chunkHUAISCUXcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2474
2474
  charts.set(id, {
2475
2475
  id: `chart-${charts.size + 1}`,
2476
2476
  path: rel.target,
@@ -2484,7 +2484,7 @@ async function loadCharts(zip, Parser, root, rels, options) {
2484
2484
  return charts;
2485
2485
  }
2486
2486
  function chartBlockHtml(chart) {
2487
- const [head, ...rows] = _chunkOUO3DSRTcjs.chartDataToTable.call(void 0, chart.spec);
2487
+ const [head, ...rows] = _chunkWRZ6C4TUcjs.chartDataToTable.call(void 0, chart.spec);
2488
2488
  const cell = (v, tag) => `<${tag}><p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
2489
2489
  const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
2490
2490
  const caption = `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
@@ -3137,7 +3137,7 @@ var ParagraphRenderer = (_class2 = class {
3137
3137
  };
3138
3138
  if (child.localName === "AlternateContent") {
3139
3139
  const branch = childElements(child).find(
3140
- (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunkVKHJJUBKcjs.CHART_OOXML_NS)
3140
+ (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunkHUAISCUXcjs.CHART_OOXML_NS)
3141
3141
  );
3142
3142
  if (branch) this.image(branch, format, push);
3143
3143
  return;
@@ -3204,7 +3204,7 @@ var ParagraphRenderer = (_class2 = class {
3204
3204
  /** Charts this paragraph contains, in order. */
3205
3205
  __init4() {this.charts = []}
3206
3206
  image(container, format, push) {
3207
- const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunkVKHJJUBKcjs.CHART_OOXML_NS);
3207
+ const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunkHUAISCUXcjs.CHART_OOXML_NS);
3208
3208
  const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
3209
3209
  if (chart) {
3210
3210
  if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
@@ -3643,9 +3643,9 @@ function insertImportedDocument(target, content, options = {}) {
3643
3643
  if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
3644
3644
  from = to = _state.Selection.near(state.doc.resolve(from)).from;
3645
3645
  }
3646
- if (htmlSlice && _chunkRLOIEDA3cjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkRLOIEDA3cjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3646
+ if (htmlSlice && _chunkO7QXVGMPcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkO7QXVGMPcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3647
3647
  const tr2 = state.tr;
3648
- const end2 = _chunkRLOIEDA3cjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3648
+ const end2 = _chunkO7QXVGMPcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3649
3649
  if (end2 !== null) {
3650
3650
  if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
3651
3651
  view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
@@ -3822,7 +3822,7 @@ var RichClipboard = _core.Extension.create({
3822
3822
  const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
3823
3823
  if (!slice) return false;
3824
3824
  event.preventDefault();
3825
- if (_chunkRLOIEDA3cjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3825
+ if (_chunkO7QXVGMPcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3826
3826
  view.dispatch(
3827
3827
  view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
3828
3828
  );
@@ -4223,7 +4223,7 @@ function createOutlineStore(editor) {
4223
4223
  if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
4224
4224
  const headings = getOutline(editor);
4225
4225
  const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
4226
- const sameStructure = _chunkRLOIEDA3cjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4226
+ const sameStructure = _chunkO7QXVGMPcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4227
4227
  if (sameStructure && snapshot.activeId === activeId) return snapshot;
4228
4228
  return {
4229
4229
  headings: sameStructure ? snapshot.headings : headings,
@@ -4271,7 +4271,7 @@ function navigateToHeading(editor, heading, options = {}) {
4271
4271
  editor.view.dispatch(tr);
4272
4272
  editor.view.focus();
4273
4273
  }
4274
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4274
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4275
4275
  return true;
4276
4276
  }
4277
4277
  function assignHeadingIds(state, types, generateId) {
@@ -4296,11 +4296,11 @@ function assignHeadingIds(state, types, generateId) {
4296
4296
  }
4297
4297
  var Outline = _core.Extension.create({
4298
4298
  name: "outline",
4299
- priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY,
4299
+ priority: _chunkO7QXVGMPcjs.STRUCTURE_PRIORITY,
4300
4300
  addOptions() {
4301
4301
  return {
4302
4302
  types: ["heading"],
4303
- generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "h"),
4303
+ generateId: () => _chunkO7QXVGMPcjs.generateStructureId.call(void 0, "h"),
4304
4304
  onUpdate: void 0
4305
4305
  };
4306
4306
  },
@@ -4333,14 +4333,14 @@ var Outline = _core.Extension.create({
4333
4333
  tr.scrollIntoView();
4334
4334
  _optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
4335
4335
  }
4336
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4336
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4337
4337
  }
4338
4338
  return true;
4339
4339
  },
4340
4340
  scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
4341
4341
  const heading = findHeading(state, id);
4342
4342
  if (!heading) return false;
4343
- if (dispatch) _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4343
+ if (dispatch) _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4344
4344
  return true;
4345
4345
  }
4346
4346
  };
@@ -4361,7 +4361,7 @@ var Outline = _core.Extension.create({
4361
4361
  apply: (tr, prev, _oldState, newState) => {
4362
4362
  if (!tr.docChanged) return prev;
4363
4363
  const next = computeOutline(newState.doc, types);
4364
- if (_chunkRLOIEDA3cjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4364
+ if (_chunkO7QXVGMPcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4365
4365
  storage.headings = next;
4366
4366
  _optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
4367
4367
  return next;
@@ -4379,7 +4379,7 @@ var Outline = _core.Extension.create({
4379
4379
  },
4380
4380
  onBeforeCreate() {
4381
4381
  const { types, generateId } = this.options;
4382
- _chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4382
+ _chunkO7QXVGMPcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4383
4383
  }
4384
4384
  });
4385
4385
 
@@ -4549,7 +4549,7 @@ function syncTableOfContents(state, headingTypes) {
4549
4549
  node.attrs.minLevel,
4550
4550
  node.attrs.maxLevel
4551
4551
  );
4552
- if (!_chunkRLOIEDA3cjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4552
+ if (!_chunkO7QXVGMPcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4553
4553
  tr = _nullishCoalesce(tr, () => ( state.tr));
4554
4554
  tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
4555
4555
  }
@@ -4561,7 +4561,7 @@ function syncTableOfContents(state, headingTypes) {
4561
4561
  }
4562
4562
  var TableOfContents = _core.Node.create({
4563
4563
  name: "tableOfContents",
4564
- priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
4564
+ priority: _chunkO7QXVGMPcjs.STRUCTURE_PRIORITY - 5,
4565
4565
  group: "block",
4566
4566
  atom: true,
4567
4567
  selectable: true,
@@ -4672,7 +4672,7 @@ var TableOfContents = _core.Node.create({
4672
4672
  return [
4673
4673
  new (0, _state.Plugin)({
4674
4674
  key: tableOfContentsPluginKey,
4675
- state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [this.name]),
4675
+ state: _chunkO7QXVGMPcjs.presenceStateSpec.call(void 0, [this.name]),
4676
4676
  appendTransaction: (transactions, _oldState, newState) => {
4677
4677
  if (!transactions.some((tr) => tr.docChanged)) return null;
4678
4678
  if (!tableOfContentsPluginKey.getState(newState)) return null;
@@ -4696,7 +4696,7 @@ var TableOfContents = _core.Node.create({
4696
4696
  );
4697
4697
  view.focus();
4698
4698
  }
4699
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, heading.pos);
4699
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, heading.pos);
4700
4700
  return true;
4701
4701
  }
4702
4702
  }
@@ -4706,7 +4706,7 @@ var TableOfContents = _core.Node.create({
4706
4706
  },
4707
4707
  onBeforeCreate() {
4708
4708
  const { headingTypes } = this.options;
4709
- _chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4709
+ _chunkO7QXVGMPcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4710
4710
  }
4711
4711
  });
4712
4712
 
@@ -4764,7 +4764,7 @@ function syncFootnotes(tr, options = {}) {
4764
4764
  const listType = schema.nodes[LIST];
4765
4765
  const itemType = schema.nodes[ITEM];
4766
4766
  if (!listType || !itemType) return false;
4767
- const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "fn"))));
4767
+ const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkO7QXVGMPcjs.generateStructureId.call(void 0, "fn"))));
4768
4768
  const refs = [];
4769
4769
  const lists = [];
4770
4770
  const existing = /* @__PURE__ */ new Map();
@@ -4848,7 +4848,7 @@ function findReferences(doc, id) {
4848
4848
  }
4849
4849
  var FootnoteReference = _core.Node.create({
4850
4850
  name: REFERENCE,
4851
- priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
4851
+ priority: _chunkO7QXVGMPcjs.STRUCTURE_PRIORITY - 5,
4852
4852
  group: "inline",
4853
4853
  inline: true,
4854
4854
  atom: true,
@@ -4856,7 +4856,7 @@ var FootnoteReference = _core.Node.create({
4856
4856
  addOptions() {
4857
4857
  return {
4858
4858
  HTMLAttributes: {},
4859
- generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "fn")
4859
+ generateId: () => _chunkO7QXVGMPcjs.generateStructureId.call(void 0, "fn")
4860
4860
  };
4861
4861
  },
4862
4862
  addAttributes() {
@@ -4967,7 +4967,7 @@ var FootnoteReference = _core.Node.create({
4967
4967
  _state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
4968
4968
  );
4969
4969
  tr.scrollIntoView();
4970
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4970
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4971
4971
  }
4972
4972
  return true;
4973
4973
  },
@@ -4977,7 +4977,7 @@ var FootnoteReference = _core.Node.create({
4977
4977
  if (dispatch) {
4978
4978
  tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
4979
4979
  tr.scrollIntoView();
4980
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, ref.pos);
4980
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, ref.pos);
4981
4981
  }
4982
4982
  return true;
4983
4983
  }
@@ -4989,7 +4989,7 @@ var FootnoteReference = _core.Node.create({
4989
4989
  return [
4990
4990
  new (0, _state.Plugin)({
4991
4991
  key: footnotesPluginKey,
4992
- state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4992
+ state: _chunkO7QXVGMPcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4993
4993
  appendTransaction: (transactions, _oldState, newState) => {
4994
4994
  if (!transactions.some((tr2) => tr2.docChanged)) return null;
4995
4995
  if (!footnotesPluginKey.getState(newState)) return null;
@@ -5010,7 +5010,7 @@ var FootnoteReference = _core.Node.create({
5010
5010
  },
5011
5011
  onBeforeCreate() {
5012
5012
  const { generateId } = this.options;
5013
- _chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => {
5013
+ _chunkO7QXVGMPcjs.syncInitialContent.call(void 0, this.editor, (state) => {
5014
5014
  const tr = state.tr;
5015
5015
  return syncFootnotes(tr, { generateId }) ? tr : null;
5016
5016
  });
@@ -5150,7 +5150,7 @@ var Bookmark = _core.Mark.create({
5150
5150
  addOptions() {
5151
5151
  return {
5152
5152
  HTMLAttributes: {},
5153
- generateId: () => _chunkRLOIEDA3cjs.generateStructureId.call(void 0, "bm")
5153
+ generateId: () => _chunkO7QXVGMPcjs.generateStructureId.call(void 0, "bm")
5154
5154
  };
5155
5155
  },
5156
5156
  addAttributes() {
@@ -5235,7 +5235,7 @@ var Bookmark = _core.Mark.create({
5235
5235
  tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
5236
5236
  tr.scrollIntoView();
5237
5237
  const domPos = state.doc.resolve(bookmark.from);
5238
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5238
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5239
5239
  }
5240
5240
  return true;
5241
5241
  }
@@ -5300,7 +5300,7 @@ function syncCrossReferences(state, headingTypes) {
5300
5300
  }
5301
5301
  var CrossReference = _core.Node.create({
5302
5302
  name: NAME,
5303
- priority: _chunkRLOIEDA3cjs.STRUCTURE_PRIORITY - 5,
5303
+ priority: _chunkO7QXVGMPcjs.STRUCTURE_PRIORITY - 5,
5304
5304
  group: "inline",
5305
5305
  inline: true,
5306
5306
  atom: true,
@@ -5402,7 +5402,7 @@ var CrossReference = _core.Node.create({
5402
5402
  if (dispatch) {
5403
5403
  tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
5404
5404
  tr.scrollIntoView();
5405
- _chunkRLOIEDA3cjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5405
+ _chunkO7QXVGMPcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5406
5406
  }
5407
5407
  return true;
5408
5408
  }
@@ -5414,7 +5414,7 @@ var CrossReference = _core.Node.create({
5414
5414
  return [
5415
5415
  new (0, _state.Plugin)({
5416
5416
  key: crossReferencePluginKey,
5417
- state: _chunkRLOIEDA3cjs.presenceStateSpec.call(void 0, [NAME]),
5417
+ state: _chunkO7QXVGMPcjs.presenceStateSpec.call(void 0, [NAME]),
5418
5418
  appendTransaction: (transactions, _oldState, newState) => {
5419
5419
  if (!transactions.some((tr) => tr.docChanged)) return null;
5420
5420
  if (!crossReferencePluginKey.getState(newState)) return null;
@@ -5433,7 +5433,7 @@ var CrossReference = _core.Node.create({
5433
5433
  },
5434
5434
  onBeforeCreate() {
5435
5435
  const { headingTypes } = this.options;
5436
- _chunkRLOIEDA3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5436
+ _chunkO7QXVGMPcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5437
5437
  }
5438
5438
  });
5439
5439
 
@@ -5688,7 +5688,7 @@ var FindReplace = _core.Extension.create({
5688
5688
  if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
5689
5689
  if (dispatch) {
5690
5690
  _history.closeHistory.call(void 0, tr);
5691
- const [end] = _chunkRLOIEDA3cjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5691
+ const [end] = _chunkO7QXVGMPcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5692
5692
  tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
5693
5693
  meta(tr, { type: "replaced", anchor: end, count: 1 });
5694
5694
  }
@@ -5699,7 +5699,7 @@ var FindReplace = _core.Extension.create({
5699
5699
  if (!s || !s.active || !s.matches.length) return false;
5700
5700
  if (dispatch) {
5701
5701
  _history.closeHistory.call(void 0, tr);
5702
- const ends = _chunkRLOIEDA3cjs.applyReplacements.call(void 0, tr, s.matches);
5702
+ const ends = _chunkO7QXVGMPcjs.applyReplacements.call(void 0, tr, s.matches);
5703
5703
  meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
5704
5704
  }
5705
5705
  return true;
@@ -5731,7 +5731,7 @@ var FindReplace = _core.Extension.create({
5731
5731
  if (!s.active || !s.query) {
5732
5732
  return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
5733
5733
  }
5734
- const result = _chunkRLOIEDA3cjs.searchDocument.call(void 0, doc, s.query, s.options, {
5734
+ const result = _chunkO7QXVGMPcjs.searchDocument.call(void 0, doc, s.query, s.options, {
5735
5735
  replacement: s.replacement,
5736
5736
  clipboardText: safeClipboard(options.getClipboardText),
5737
5737
  timeLimitMs: options.timeLimitMs,
@@ -6318,7 +6318,7 @@ function createRichTextPreset(options = {}) {
6318
6318
  })
6319
6319
  ];
6320
6320
  if (options.table !== false) {
6321
- extensions2.push(..._chunkRLOIEDA3cjs.createTableExtensions.call(void 0, optionObject(options.table)));
6321
+ extensions2.push(..._chunkO7QXVGMPcjs.createTableExtensions.call(void 0, optionObject(options.table)));
6322
6322
  }
6323
6323
  if (characterLimit) {
6324
6324
  extensions2.push(
@@ -6425,8 +6425,8 @@ function createRichTextPreset(options = {}) {
6425
6425
  }
6426
6426
  if (options.chart) {
6427
6427
  const { sparkline = true, ...chartOptions } = optionObject(options.chart);
6428
- extensions2.push(_chunkRLOIEDA3cjs.Chart.configure(chartOptions));
6429
- if (sparkline) extensions2.push(_chunkRLOIEDA3cjs.Sparkline.configure(optionObject(sparkline)));
6428
+ extensions2.push(_chunkO7QXVGMPcjs.Chart.configure(chartOptions));
6429
+ if (sparkline) extensions2.push(_chunkO7QXVGMPcjs.Sparkline.configure(optionObject(sparkline)));
6430
6430
  }
6431
6431
  if (options.paragraphStyles) {
6432
6432
  extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
@@ -6567,7 +6567,7 @@ function createFindReplaceCommands(editor, options = {}) {
6567
6567
  ];
6568
6568
  }
6569
6569
  function validateFindPattern(query, options = {}) {
6570
- const result = _chunkRLOIEDA3cjs.compileFindPattern.call(void 0, query, options);
6570
+ const result = _chunkO7QXVGMPcjs.compileFindPattern.call(void 0, query, options);
6571
6571
  return result.ok ? null : result.error;
6572
6572
  }
6573
6573
 
@@ -6576,8 +6576,8 @@ var PARAMS = {
6576
6576
  insertTable: {
6577
6577
  type: "object",
6578
6578
  properties: {
6579
- rows: { type: "integer", minimum: 1, maximum: _chunkRLOIEDA3cjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6580
- cols: { type: "integer", minimum: 1, maximum: _chunkRLOIEDA3cjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6579
+ rows: { type: "integer", minimum: 1, maximum: _chunkO7QXVGMPcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6580
+ cols: { type: "integer", minimum: 1, maximum: _chunkO7QXVGMPcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6581
6581
  withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
6582
6582
  },
6583
6583
  additionalProperties: false
@@ -6608,7 +6608,7 @@ function createTableCommands(editor, options = {}) {
6608
6608
  const group = _nullishCoalesce(options.group, () => ( "Table"));
6609
6609
  const scope = options.scope ? { scope: options.scope } : {};
6610
6610
  const focus = _nullishCoalesce(options.focus, () => ( true));
6611
- return _chunkRLOIEDA3cjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6611
+ return _chunkO7QXVGMPcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6612
6612
  const params = PARAMS[action];
6613
6613
  return {
6614
6614
  id: `${prefix}${action}`,
@@ -6618,13 +6618,13 @@ function createTableCommands(editor, options = {}) {
6618
6618
  description,
6619
6619
  ...params ? { params } : {},
6620
6620
  ...scope,
6621
- enabled: (_ctx, p) => _chunkRLOIEDA3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6621
+ enabled: (_ctx, p) => _chunkO7QXVGMPcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6622
6622
  run: (_ctx, p) => {
6623
- if (!_chunkRLOIEDA3cjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6624
- const reason = _chunkRLOIEDA3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6623
+ if (!_chunkO7QXVGMPcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6624
+ const reason = _chunkO7QXVGMPcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6625
6625
  throw new Error(reason === true ? `${label} did not change the document.` : reason);
6626
6626
  }
6627
- const state = _chunkRLOIEDA3cjs.getTableState.call(void 0, editor);
6627
+ const state = _chunkO7QXVGMPcjs.getTableState.call(void 0, editor);
6628
6628
  return {
6629
6629
  done: true,
6630
6630
  table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
@@ -18,7 +18,7 @@ import {
18
18
  CHART_STACKINGS,
19
19
  CHART_TRENDLINE_TYPES,
20
20
  CHART_TYPES
21
- } from "./chunk-ORZF4JOO.js";
21
+ } from "./chunk-6ZZKRH7R.js";
22
22
 
23
23
  // src/chart/schemas.ts
24
24
  var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
@@ -158,7 +158,7 @@ var SERIES_PROPS = {
158
158
  xErrorBars: ERROR_BARS("Error bars along the x axis (scatter and bubble charts with numeric x values; amounts in x units).")
159
159
  };
160
160
  var CHART_UPDATE_PROPERTIES = {
161
- type: { type: "string", enum: [...CHART_TYPES], description: "Chart type. slope joins each category from the first series (before) to the second (after); likert reads each category as a question and the series as answers from most negative to most positive; parliament draws the first series as seats; sunburst draws the grouped data (set_chart_tree) as rings, and a treemap with grouped data nests its groups; sankey draws the flows (set_chart_links); barrace reads categories as time points and series as names, and animates their ranking; choropleth shades the regions of a map, each category naming a region by code (FRA) or name (France)." },
161
+ type: { type: "string", enum: [...CHART_TYPES], description: "Chart type. streamgraph stacks areas symmetrically around a center baseline; slope joins each category from the first series (before) to the second (after); likert reads each category as a question and the series as answers from most negative to most positive; parliament draws the first series as seats; sunburst draws the grouped data (set_chart_tree) as rings, and a treemap with grouped data nests its groups; sankey draws the flows (set_chart_links); barrace reads categories as time points and series as names, and animates their ranking; choropleth shades the regions of a map, each category naming a region by code (FRA) or name (France)." },
162
162
  title: { type: "string", description: 'Title ("" for none).' },
163
163
  subtitle: { type: "string", description: 'Subtitle ("" for none).' },
164
164
  xAxis: AXIS("Category axis (or numeric x axis of scatter / bubble charts)."),
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkOUO3DSRTcjs = require('./chunk-OUO3DSRT.cjs');
11
+ var _chunkWRZ6C4TUcjs = require('./chunk-WRZ6C4TU.cjs');
12
12
 
13
13
  // src/chart/ooxml.ts
14
14
  var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
@@ -111,11 +111,11 @@ function chartFromOoxml(xml, options = {}) {
111
111
  try {
112
112
  doc = new (parser(options))().parseFromString(xml, "application/xml");
113
113
  } catch (error) {
114
- return { spec: _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
114
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
115
115
  }
116
116
  const root = doc.documentElement;
117
117
  if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
118
- return { spec: _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
118
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
119
119
  }
120
120
  if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
121
121
  const chart = kid(root, "chart");
@@ -280,7 +280,7 @@ function chartFromOoxml(xml, options = {}) {
280
280
  }
281
281
  if (!types.length) {
282
282
  issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
283
- return { spec: _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
283
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
284
284
  }
285
285
  const first = types[0];
286
286
  const combo = types.some((t) => t !== first);
@@ -290,14 +290,14 @@ function chartFromOoxml(xml, options = {}) {
290
290
  if (!combo) {
291
291
  for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
292
292
  }
293
- if (types.some((t) => !_chunkOUO3DSRTcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
293
+ if (types.some((t) => !_chunkWRZ6C4TUcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
294
294
  input.series = series;
295
295
  input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
296
296
  input.stacking = stacking;
297
297
  input.orientation = orientation;
298
298
  input.dataLabels = dataLabels;
299
299
  input.points = points || first !== "line";
300
- if (bool(val(groups[0], "varyColors")) && !combo && _chunkOUO3DSRTcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
300
+ if (bool(val(groups[0], "varyColors")) && !combo && _chunkWRZ6C4TUcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
301
301
  const readAxis = (a, fallback) => {
302
302
  const axis = { ...fallback, format: {} };
303
303
  if (!a) return axis;
@@ -324,12 +324,12 @@ function chartFromOoxml(xml, options = {}) {
324
324
  };
325
325
  const xy = first === "scatter" || first === "bubble";
326
326
  const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
327
- input.xAxis = readAxis(catAxis, _chunkOUO3DSRTcjs.defaultChartAxis.call(void 0, false));
327
+ input.xAxis = readAxis(catAxis, _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, false));
328
328
  if (kid(plot, "dateAx")) input.xAxis.kind = "date";
329
- input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkOUO3DSRTcjs.defaultChartAxis.call(void 0, true));
329
+ input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, true));
330
330
  const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
331
- if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkOUO3DSRTcjs.defaultChartAxis.call(void 0, false));
332
- const { spec, issues: specIssues } = _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, input);
331
+ if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, false));
332
+ const { spec, issues: specIssues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
333
333
  issues.push(...specIssues);
334
334
  const uniq = [...new Set(unsupported)];
335
335
  return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
@@ -382,7 +382,7 @@ function readChartex(root, issues, unsupported) {
382
382
  const type = layouts[layout];
383
383
  if (!type) {
384
384
  issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
385
- return { spec: _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
385
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
386
386
  }
387
387
  if (layout === "paretoLine") unsupported.push("pareto line");
388
388
  const series = [];
@@ -409,18 +409,18 @@ function readChartex(root, issues, unsupported) {
409
409
  const first = data.get(_nullishCoalesce(_optionalChain([kid, 'call', _35 => _35(seriesEls[0], "dataId"), 'optionalAccess', _36 => _36.getAttribute, 'call', _37 => _37("val")]), () => ( "0")));
410
410
  if ((type === "treemap" || type === "sunburst") && _optionalChain([first, 'optionalAccess', _38 => _38.paths])) {
411
411
  const treeIssues = [];
412
- input.tree = _chunkOUO3DSRTcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
412
+ input.tree = _chunkWRZ6C4TUcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
413
413
  for (const t of treeIssues) issues.push({ path: "chartData", message: t.message });
414
414
  }
415
- const { spec, issues: specIssues } = _chunkOUO3DSRTcjs.normalizeChartSpec.call(void 0, input);
415
+ const { spec, issues: specIssues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
416
416
  issues.push(...specIssues);
417
417
  return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
418
418
  }
419
419
  var esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
420
420
  var hex = (color) => {
421
421
  if (!color) return null;
422
- const rgb = _chunkOUO3DSRTcjs.parseChartColor.call(void 0, color);
423
- return rgb ? _chunkOUO3DSRTcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
422
+ const rgb = _chunkWRZ6C4TUcjs.parseChartColor.call(void 0, color);
423
+ return rgb ? _chunkWRZ6C4TUcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
424
424
  };
425
425
  var fillXml = (color, line = false) => {
426
426
  const h = hex(color);
@@ -464,7 +464,7 @@ function errBarsXml(bars, dir) {
464
464
  var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
465
465
  function chartToOoxml(spec) {
466
466
  const issues = [];
467
- const family = _chunkOUO3DSRTcjs.chartFamily.call(void 0, spec);
467
+ const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, spec);
468
468
  let type = spec.type;
469
469
  if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
470
470
  issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
@@ -481,6 +481,10 @@ function chartToOoxml(spec) {
481
481
  } else if (family === "barrace") {
482
482
  issues.push("Bar chart races are written as clustered bar charts of every name at every time point: DrawingML has no animation.");
483
483
  type = "bar";
484
+ } else if (family === "streamgraph") {
485
+ issues.push("Streamgraphs are written as stacked area charts: DrawingML has no streamgraph type.");
486
+ spec = { ...spec, type: "area", stacking: "stacked" };
487
+ type = "area";
484
488
  } else if (family === "sankey") {
485
489
  issues.push("Sankey diagrams are written as bar charts of how much passes through each node: DrawingML has no flows.");
486
490
  type = "bar";
@@ -508,7 +512,7 @@ function chartToOoxml(spec) {
508
512
  const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
509
513
  const xy = family === "xy" || type === "scatter" || type === "bubble";
510
514
  const pieLike = type === "pie" || type === "donut";
511
- const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkOUO3DSRTcjs.chartSeriesType.call(void 0, { type }, s);
515
+ const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkWRZ6C4TUcjs.chartSeriesType.call(void 0, { type }, s);
512
516
  const groups = [];
513
517
  visible.forEach((s) => {
514
518
  const kind = typed(s);
@@ -571,7 +575,7 @@ function chartToOoxml(spec) {
571
575
  return `<c:ser>${parts.join("")}</c:ser>`;
572
576
  };
573
577
  const dLbls = `<c:dLbls><c:showLegendKey val="0"/><c:showVal val="${spec.dataLabels ? 1 : 0}"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>`;
574
- const vary = _chunkOUO3DSRTcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
578
+ const vary = _chunkWRZ6C4TUcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
575
579
  const groupXml = groups.map((g) => {
576
580
  const axes2 = g.secondary ? `<c:axId val="${ids.cat2}"/><c:axId val="${ids.val2}"/>` : `<c:axId val="${ids.cat}"/><c:axId val="${ids.val}"/>`;
577
581
  const sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join("");
@@ -8,7 +8,7 @@ import {
8
8
  isCartesianChart,
9
9
  normalizeChartSpec,
10
10
  parseChartColor
11
- } from "./chunk-ORZF4JOO.js";
11
+ } from "./chunk-6ZZKRH7R.js";
12
12
 
13
13
  // src/chart/ooxml.ts
14
14
  var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
@@ -481,6 +481,10 @@ function chartToOoxml(spec) {
481
481
  } else if (family === "barrace") {
482
482
  issues.push("Bar chart races are written as clustered bar charts of every name at every time point: DrawingML has no animation.");
483
483
  type = "bar";
484
+ } else if (family === "streamgraph") {
485
+ issues.push("Streamgraphs are written as stacked area charts: DrawingML has no streamgraph type.");
486
+ spec = { ...spec, type: "area", stacking: "stacked" };
487
+ type = "area";
484
488
  } else if (family === "sankey") {
485
489
  issues.push("Sankey diagrams are written as bar charts of how much passes through each node: DrawingML has no flows.");
486
490
  type = "bar";