@harbour-enterprises/superdoc 0.28.0-next.16 → 0.28.0-next.17

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 (31) hide show
  1. package/dist/chunks/{PdfViewer-qq7VuheG.cjs → PdfViewer-C-Ze6JeA.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-511UYFts.es.js → PdfViewer-CgO84Z8T.es.js} +1 -1
  3. package/dist/chunks/{index-DXsRgDI8.cjs → index-D1umTiDg.cjs} +2 -2
  4. package/dist/chunks/{index-R92AJa-b-BK_BPu-7.es.js → index-cOCdMICZ-Ci7PU968.es.js} +1 -1
  5. package/dist/chunks/{index-R92AJa-b-814itwOQ.cjs → index-cOCdMICZ-DD6pWThu.cjs} +1 -1
  6. package/dist/chunks/{index-QrjpYZxu.es.js → index-kTCzN97h.es.js} +2 -2
  7. package/dist/chunks/{super-editor.es-DmerK7HX.es.js → super-editor.es-CPgOO-fX.es.js} +54 -15
  8. package/dist/chunks/{super-editor.es-C7rGSq3G.cjs → super-editor.es-Dc0PuIBh.cjs} +54 -15
  9. package/dist/core/types/index.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-DCADSoU6.js → converter-DxFe92HN.js} +42 -10
  12. package/dist/super-editor/chunks/{docx-zipper-DiRUh82P.js → docx-zipper-cuctY57Z.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-S-V_9zg8.js → editor-CMem2X8B.js} +14 -7
  14. package/dist/super-editor/chunks/{index-R92AJa-b.js → index-cOCdMICZ.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-CKze0avT.js → toolbar-DhuSaHbu.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/listImporter.d.ts +1 -1
  21. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/numberingCache.d.ts +2 -2
  22. package/dist/super-editor/super-editor/src/utils/headless-helpers.d.ts +1 -0
  23. package/dist/super-editor/super-editor.es.js +6 -6
  24. package/dist/super-editor/toolbar.es.js +2 -2
  25. package/dist/super-editor.cjs +1 -1
  26. package/dist/super-editor.es.js +1 -1
  27. package/dist/superdoc.cjs +2 -2
  28. package/dist/superdoc.es.js +2 -2
  29. package/dist/superdoc.umd.js +55 -16
  30. package/dist/superdoc.umd.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
- const superdoc = require("./index-DXsRgDI8.cjs");
4
+ const superdoc = require("./index-D1umTiDg.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-ZWZLQtoU.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-QrjpYZxu.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-kTCzN97h.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C7rGSq3G.cjs");
2
+ const superEditor_es = require("./super-editor.es-Dc0PuIBh.cjs");
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
4
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
@@ -17173,7 +17173,7 @@ const _sfc_main = {
17173
17173
  __name: "SuperDoc",
17174
17174
  emits: ["selection-update"],
17175
17175
  setup(__props, { emit: __emit }) {
17176
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-qq7VuheG.cjs")));
17176
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-C-Ze6JeA.cjs")));
17177
17177
  const superdocStore = useSuperdocStore();
17178
17178
  const commentsStore = useCommentsStore();
17179
17179
  const {
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-DmerK7HX.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-CPgOO-fX.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-C7rGSq3G.cjs");
3
+ const superEditor_es = require("./super-editor.es-Dc0PuIBh.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DmerK7HX.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-CPgOO-fX.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-ZWZLQtoU.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
@@ -17156,7 +17156,7 @@ const _sfc_main = {
17156
17156
  __name: "SuperDoc",
17157
17157
  emits: ["selection-update"],
17158
17158
  setup(__props, { emit: __emit }) {
17159
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-511UYFts.es.js"));
17159
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CgO84Z8T.es.js"));
17160
17160
  const superdocStore = useSuperdocStore();
17161
17161
  const commentsStore = useCommentsStore();
17162
17162
  const {
@@ -20591,7 +20591,23 @@ const baseNumbering = {
20591
20591
  ]
20592
20592
  };
20593
20593
  const docxNumberingCacheStore = /* @__PURE__ */ new WeakMap();
20594
+ const NUMBERING_CACHE_KEY = "numbering-cache";
20594
20595
  const LEVELS_MAP_KEY = Symbol("superdoc.numbering.levels");
20596
+ const NUMBERING_CACHE_DOCX_KEY = Symbol("superdoc.numbering.docx");
20597
+ const clearConverterCache = (converter) => {
20598
+ if (!converter) return;
20599
+ delete converter[NUMBERING_CACHE_KEY];
20600
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20601
+ };
20602
+ const setConverterCache = (converter, cache2, docx) => {
20603
+ if (!converter) return;
20604
+ converter[NUMBERING_CACHE_KEY] = cache2;
20605
+ if (docx && typeof docx === "object") {
20606
+ converter[NUMBERING_CACHE_DOCX_KEY] = docx;
20607
+ } else {
20608
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20609
+ }
20610
+ };
20595
20611
  const createEmptyCache = () => ({
20596
20612
  numToAbstractId: /* @__PURE__ */ new Map(),
20597
20613
  abstractById: /* @__PURE__ */ new Map(),
@@ -20663,12 +20679,27 @@ const buildNumberingCache = (docx) => {
20663
20679
  }
20664
20680
  return { numToAbstractId, abstractById, templateById, numToDefinition, numNodesById };
20665
20681
  };
20666
- const ensureNumberingCache = (docx) => {
20682
+ const ensureNumberingCache = (docx, converter) => {
20683
+ if (converter?.[NUMBERING_CACHE_KEY]) {
20684
+ const cachedDocx = converter[NUMBERING_CACHE_DOCX_KEY];
20685
+ if (docx && cachedDocx && cachedDocx !== docx) {
20686
+ clearConverterCache(converter);
20687
+ } else {
20688
+ return converter[NUMBERING_CACHE_KEY];
20689
+ }
20690
+ }
20667
20691
  if (!docx || typeof docx !== "object") return createEmptyCache();
20668
20692
  const existingCache = docxNumberingCacheStore.get(docx);
20669
- if (existingCache) return existingCache;
20693
+ if (existingCache) {
20694
+ setConverterCache(converter, existingCache, docx);
20695
+ return existingCache;
20696
+ }
20670
20697
  const cache2 = buildNumberingCache(docx);
20671
- docxNumberingCacheStore.set(docx, cache2);
20698
+ if (converter) {
20699
+ setConverterCache(converter, cache2, docx);
20700
+ } else {
20701
+ docxNumberingCacheStore.set(docx, cache2);
20702
+ }
20672
20703
  return cache2;
20673
20704
  };
20674
20705
  const handleListNode = (params2) => {
@@ -20925,11 +20956,11 @@ const getListNumIdFromStyleRef = (styleId, docx) => {
20925
20956
  }
20926
20957
  return { numId, ilvl };
20927
20958
  };
20928
- const getAbstractDefinition = (numId, docx) => {
20959
+ const getAbstractDefinition = (numId, docx, converter) => {
20929
20960
  const numberingXml = docx["word/numbering.xml"];
20930
20961
  if (!numberingXml) return {};
20931
20962
  if (numId == null) return void 0;
20932
- const cache2 = ensureNumberingCache(docx);
20963
+ const cache2 = ensureNumberingCache(docx, converter);
20933
20964
  const numKey = String(numId);
20934
20965
  let listDefinitionForThisNumId = cache2.numToDefinition.get(numKey);
20935
20966
  if (!listDefinitionForThisNumId) {
@@ -24442,10 +24473,11 @@ const getListItemStyleDefinitions = ({ styleId, numId, level, editor, tries }) =
24442
24473
  if (typeof numId === "string") numId = Number(numId);
24443
24474
  if (typeof level === "string") level = Number(level);
24444
24475
  const docx = editor?.converter?.convertedXml;
24445
- const numbering = editor?.converter?.numbering;
24476
+ const converter = editor?.converter;
24477
+ const numbering = converter?.numbering;
24446
24478
  const styleDefinition = docx ? getStyleTagFromStyleId(styleId, docx) : null;
24447
24479
  const stylePpr = styleDefinition?.elements.find((el) => el.name === "w:pPr");
24448
- let abstractDefinition = docx ? getAbstractDefinition(numId, docx) : null;
24480
+ let abstractDefinition = docx ? getAbstractDefinition(numId, docx, converter) : null;
24449
24481
  if (!abstractDefinition) {
24450
24482
  const listDef = numbering?.definitions?.[numId];
24451
24483
  const abstractId = listDef?.elements?.find((item) => item.name === "w:abstractNumId")?.attributes?.["w:val"];
@@ -33546,7 +33578,7 @@ const createDocumentJson = (docx, converter, editor) => {
33546
33578
  comments,
33547
33579
  inlineDocumentFonts,
33548
33580
  linkedStyles: getStyleDefinitions(docx),
33549
- numbering: getNumberingDefinitions(docx)
33581
+ numbering: getNumberingDefinitions(docx, converter)
33550
33582
  };
33551
33583
  }
33552
33584
  return null;
@@ -33945,8 +33977,8 @@ function filterOutRootInlineNodes(content = []) {
33945
33977
  ]);
33946
33978
  return content.filter((node) => node && typeof node.type === "string" && !INLINE_TYPES.has(node.type));
33947
33979
  }
33948
- function getNumberingDefinitions(docx) {
33949
- const cache2 = ensureNumberingCache(docx);
33980
+ function getNumberingDefinitions(docx, converter) {
33981
+ const cache2 = ensureNumberingCache(docx, converter);
33950
33982
  const abstractDefinitions = {};
33951
33983
  cache2.abstractById.forEach((value, key2) => {
33952
33984
  const numericKey = Number(key2);
@@ -49747,10 +49779,12 @@ const _ExtensionService = class _ExtensionService2 {
49747
49779
  type: getNodeType(extension.name, this.schema)
49748
49780
  };
49749
49781
  const addNodeView = getExtensionConfigField(extension, "addNodeView", context);
49750
- if (!addNodeView) return [];
49782
+ if (!addNodeView) return null;
49783
+ const nodeViewFunction = addNodeView();
49784
+ if (!nodeViewFunction) return null;
49751
49785
  const nodeview = (node, _view, getPos, decorations) => {
49752
49786
  const htmlAttributes = Attribute2.getAttributesToRender(node, extensionAttrs);
49753
- return addNodeView()({
49787
+ return nodeViewFunction({
49754
49788
  editor,
49755
49789
  node,
49756
49790
  getPos,
@@ -49760,7 +49794,7 @@ const _ExtensionService = class _ExtensionService2 {
49760
49794
  });
49761
49795
  };
49762
49796
  return [extension.name, nodeview];
49763
- });
49797
+ }).filter(Boolean);
49764
49798
  return Object.fromEntries(entries);
49765
49799
  }
49766
49800
  };
@@ -53729,7 +53763,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53729
53763
  { default: remarkStringify },
53730
53764
  { default: remarkGfm }
53731
53765
  ] = await Promise.all([
53732
- import("./index-R92AJa-b-BK_BPu-7.es.js"),
53766
+ import("./index-cOCdMICZ-Ci7PU968.es.js"),
53733
53767
  import("./index-DRCvimau-Cw339678.es.js"),
53734
53768
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
53735
53769
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -59021,6 +59055,9 @@ function orderedListSync(editor) {
59021
59055
  }
59022
59056
  });
59023
59057
  }
59058
+ const shouldSkipNodeView = (editor) => {
59059
+ return editor.options.isHeadless;
59060
+ };
59024
59061
  const ListItem = Node$1.create({
59025
59062
  name: "listItem",
59026
59063
  content: "paragraph* block*",
@@ -59047,9 +59084,11 @@ const ListItem = Node$1.create({
59047
59084
  },
59048
59085
  /**
59049
59086
  * Important: The listItem node uses a custom node view.
59050
- * @returns {import('@core/NodeView.js').NodeView}
59087
+ * Skip node view in headless mode for performance.
59088
+ * @returns {import('@core/NodeView.js').NodeView|null}
59051
59089
  */
59052
59090
  addNodeView() {
59091
+ if (shouldSkipNodeView(this.editor)) return null;
59053
59092
  return ({ node, editor, getPos, decorations }) => {
59054
59093
  return new ListItemNodeView(node, getPos, decorations, editor);
59055
59094
  };
@@ -20608,7 +20608,23 @@ const baseNumbering = {
20608
20608
  ]
20609
20609
  };
20610
20610
  const docxNumberingCacheStore = /* @__PURE__ */ new WeakMap();
20611
+ const NUMBERING_CACHE_KEY = "numbering-cache";
20611
20612
  const LEVELS_MAP_KEY = Symbol("superdoc.numbering.levels");
20613
+ const NUMBERING_CACHE_DOCX_KEY = Symbol("superdoc.numbering.docx");
20614
+ const clearConverterCache = (converter) => {
20615
+ if (!converter) return;
20616
+ delete converter[NUMBERING_CACHE_KEY];
20617
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20618
+ };
20619
+ const setConverterCache = (converter, cache2, docx) => {
20620
+ if (!converter) return;
20621
+ converter[NUMBERING_CACHE_KEY] = cache2;
20622
+ if (docx && typeof docx === "object") {
20623
+ converter[NUMBERING_CACHE_DOCX_KEY] = docx;
20624
+ } else {
20625
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20626
+ }
20627
+ };
20612
20628
  const createEmptyCache = () => ({
20613
20629
  numToAbstractId: /* @__PURE__ */ new Map(),
20614
20630
  abstractById: /* @__PURE__ */ new Map(),
@@ -20680,12 +20696,27 @@ const buildNumberingCache = (docx) => {
20680
20696
  }
20681
20697
  return { numToAbstractId, abstractById, templateById, numToDefinition, numNodesById };
20682
20698
  };
20683
- const ensureNumberingCache = (docx) => {
20699
+ const ensureNumberingCache = (docx, converter) => {
20700
+ if (converter?.[NUMBERING_CACHE_KEY]) {
20701
+ const cachedDocx = converter[NUMBERING_CACHE_DOCX_KEY];
20702
+ if (docx && cachedDocx && cachedDocx !== docx) {
20703
+ clearConverterCache(converter);
20704
+ } else {
20705
+ return converter[NUMBERING_CACHE_KEY];
20706
+ }
20707
+ }
20684
20708
  if (!docx || typeof docx !== "object") return createEmptyCache();
20685
20709
  const existingCache = docxNumberingCacheStore.get(docx);
20686
- if (existingCache) return existingCache;
20710
+ if (existingCache) {
20711
+ setConverterCache(converter, existingCache, docx);
20712
+ return existingCache;
20713
+ }
20687
20714
  const cache2 = buildNumberingCache(docx);
20688
- docxNumberingCacheStore.set(docx, cache2);
20715
+ if (converter) {
20716
+ setConverterCache(converter, cache2, docx);
20717
+ } else {
20718
+ docxNumberingCacheStore.set(docx, cache2);
20719
+ }
20689
20720
  return cache2;
20690
20721
  };
20691
20722
  const handleListNode = (params2) => {
@@ -20942,11 +20973,11 @@ const getListNumIdFromStyleRef = (styleId, docx) => {
20942
20973
  }
20943
20974
  return { numId, ilvl };
20944
20975
  };
20945
- const getAbstractDefinition = (numId, docx) => {
20976
+ const getAbstractDefinition = (numId, docx, converter) => {
20946
20977
  const numberingXml = docx["word/numbering.xml"];
20947
20978
  if (!numberingXml) return {};
20948
20979
  if (numId == null) return void 0;
20949
- const cache2 = ensureNumberingCache(docx);
20980
+ const cache2 = ensureNumberingCache(docx, converter);
20950
20981
  const numKey = String(numId);
20951
20982
  let listDefinitionForThisNumId = cache2.numToDefinition.get(numKey);
20952
20983
  if (!listDefinitionForThisNumId) {
@@ -24459,10 +24490,11 @@ const getListItemStyleDefinitions = ({ styleId, numId, level, editor, tries }) =
24459
24490
  if (typeof numId === "string") numId = Number(numId);
24460
24491
  if (typeof level === "string") level = Number(level);
24461
24492
  const docx = editor?.converter?.convertedXml;
24462
- const numbering = editor?.converter?.numbering;
24493
+ const converter = editor?.converter;
24494
+ const numbering = converter?.numbering;
24463
24495
  const styleDefinition = docx ? getStyleTagFromStyleId(styleId, docx) : null;
24464
24496
  const stylePpr = styleDefinition?.elements.find((el) => el.name === "w:pPr");
24465
- let abstractDefinition = docx ? getAbstractDefinition(numId, docx) : null;
24497
+ let abstractDefinition = docx ? getAbstractDefinition(numId, docx, converter) : null;
24466
24498
  if (!abstractDefinition) {
24467
24499
  const listDef = numbering?.definitions?.[numId];
24468
24500
  const abstractId = listDef?.elements?.find((item) => item.name === "w:abstractNumId")?.attributes?.["w:val"];
@@ -33563,7 +33595,7 @@ const createDocumentJson = (docx, converter, editor) => {
33563
33595
  comments,
33564
33596
  inlineDocumentFonts,
33565
33597
  linkedStyles: getStyleDefinitions(docx),
33566
- numbering: getNumberingDefinitions(docx)
33598
+ numbering: getNumberingDefinitions(docx, converter)
33567
33599
  };
33568
33600
  }
33569
33601
  return null;
@@ -33962,8 +33994,8 @@ function filterOutRootInlineNodes(content = []) {
33962
33994
  ]);
33963
33995
  return content.filter((node) => node && typeof node.type === "string" && !INLINE_TYPES.has(node.type));
33964
33996
  }
33965
- function getNumberingDefinitions(docx) {
33966
- const cache2 = ensureNumberingCache(docx);
33997
+ function getNumberingDefinitions(docx, converter) {
33998
+ const cache2 = ensureNumberingCache(docx, converter);
33967
33999
  const abstractDefinitions = {};
33968
34000
  cache2.abstractById.forEach((value, key2) => {
33969
34001
  const numericKey = Number(key2);
@@ -49764,10 +49796,12 @@ const _ExtensionService = class _ExtensionService2 {
49764
49796
  type: getNodeType(extension.name, this.schema)
49765
49797
  };
49766
49798
  const addNodeView = getExtensionConfigField(extension, "addNodeView", context);
49767
- if (!addNodeView) return [];
49799
+ if (!addNodeView) return null;
49800
+ const nodeViewFunction = addNodeView();
49801
+ if (!nodeViewFunction) return null;
49768
49802
  const nodeview = (node, _view, getPos, decorations) => {
49769
49803
  const htmlAttributes = Attribute2.getAttributesToRender(node, extensionAttrs);
49770
- return addNodeView()({
49804
+ return nodeViewFunction({
49771
49805
  editor,
49772
49806
  node,
49773
49807
  getPos,
@@ -49777,7 +49811,7 @@ const _ExtensionService = class _ExtensionService2 {
49777
49811
  });
49778
49812
  };
49779
49813
  return [extension.name, nodeview];
49780
- });
49814
+ }).filter(Boolean);
49781
49815
  return Object.fromEntries(entries);
49782
49816
  }
49783
49817
  };
@@ -53746,7 +53780,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53746
53780
  { default: remarkStringify },
53747
53781
  { default: remarkGfm }
53748
53782
  ] = await Promise.all([
53749
- Promise.resolve().then(() => require("./index-R92AJa-b-814itwOQ.cjs")),
53783
+ Promise.resolve().then(() => require("./index-cOCdMICZ-DD6pWThu.cjs")),
53750
53784
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
53751
53785
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
53752
53786
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -59038,6 +59072,9 @@ function orderedListSync(editor) {
59038
59072
  }
59039
59073
  });
59040
59074
  }
59075
+ const shouldSkipNodeView = (editor) => {
59076
+ return editor.options.isHeadless;
59077
+ };
59041
59078
  const ListItem = Node$1.create({
59042
59079
  name: "listItem",
59043
59080
  content: "paragraph* block*",
@@ -59064,9 +59101,11 @@ const ListItem = Node$1.create({
59064
59101
  },
59065
59102
  /**
59066
59103
  * Important: The listItem node uses a custom node view.
59067
- * @returns {import('@core/NodeView.js').NodeView}
59104
+ * Skip node view in headless mode for performance.
59105
+ * @returns {import('@core/NodeView.js').NodeView|null}
59068
59106
  */
59069
59107
  addNodeView() {
59108
+ if (shouldSkipNodeView(this.editor)) return null;
59070
59109
  return ({ node, editor, getPos, decorations }) => {
59071
59110
  return new ListItemNodeView(node, getPos, decorations, editor);
59072
59111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.js"],"names":[],"mappings":";;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AAQ,CAAA;KAAE,KAAK,IAAI;;;;uBACxC,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI;;;;wBAC/C,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,QAAQ,CAAC;QAAC,MAAM,QAAO;KAAE,KAAK,IAAI;;;;eACtD,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI;;;;yBACvD,MAAM,IAAI;;;;sBACV,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;;;;2BAC3B,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;qBACpC,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;kBACpC,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI;;;;2BAClC,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;;;;8BACzC,CAAC,MAAM,EAAE,EAAE,KAAC,GAAA;;;;aACZ,MAAM;;;;uBACN,KAAQ;;;;iBACR,OAAO;;;;YACP,MAAM;;;;oBACN,KAAQ;;;;eACR,OAAO;;;;wBACP,CAAS,IAAI,EAAJ,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;;;;eAC/B,IAAI;;;;aACJ,OAAO;;;;gCACP,OAAO;;;;;;;;yBAEP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;cACN,OAAO"}
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-DCADSoU6.js";
3
- import { _ as _export_sfc } from "./chunks/editor-S-V_9zg8.js";
2
+ import { T as TextSelection } from "./chunks/converter-DxFe92HN.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-CMem2X8B.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -20589,7 +20589,23 @@ const baseNumbering = {
20589
20589
  ]
20590
20590
  };
20591
20591
  const docxNumberingCacheStore = /* @__PURE__ */ new WeakMap();
20592
+ const NUMBERING_CACHE_KEY = "numbering-cache";
20592
20593
  const LEVELS_MAP_KEY = Symbol("superdoc.numbering.levels");
20594
+ const NUMBERING_CACHE_DOCX_KEY = Symbol("superdoc.numbering.docx");
20595
+ const clearConverterCache = (converter) => {
20596
+ if (!converter) return;
20597
+ delete converter[NUMBERING_CACHE_KEY];
20598
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20599
+ };
20600
+ const setConverterCache = (converter, cache, docx) => {
20601
+ if (!converter) return;
20602
+ converter[NUMBERING_CACHE_KEY] = cache;
20603
+ if (docx && typeof docx === "object") {
20604
+ converter[NUMBERING_CACHE_DOCX_KEY] = docx;
20605
+ } else {
20606
+ delete converter[NUMBERING_CACHE_DOCX_KEY];
20607
+ }
20608
+ };
20593
20609
  const createEmptyCache = () => ({
20594
20610
  numToAbstractId: /* @__PURE__ */ new Map(),
20595
20611
  abstractById: /* @__PURE__ */ new Map(),
@@ -20661,12 +20677,27 @@ const buildNumberingCache = (docx) => {
20661
20677
  }
20662
20678
  return { numToAbstractId, abstractById, templateById, numToDefinition, numNodesById };
20663
20679
  };
20664
- const ensureNumberingCache = (docx) => {
20680
+ const ensureNumberingCache = (docx, converter) => {
20681
+ if (converter?.[NUMBERING_CACHE_KEY]) {
20682
+ const cachedDocx = converter[NUMBERING_CACHE_DOCX_KEY];
20683
+ if (docx && cachedDocx && cachedDocx !== docx) {
20684
+ clearConverterCache(converter);
20685
+ } else {
20686
+ return converter[NUMBERING_CACHE_KEY];
20687
+ }
20688
+ }
20665
20689
  if (!docx || typeof docx !== "object") return createEmptyCache();
20666
20690
  const existingCache = docxNumberingCacheStore.get(docx);
20667
- if (existingCache) return existingCache;
20691
+ if (existingCache) {
20692
+ setConverterCache(converter, existingCache, docx);
20693
+ return existingCache;
20694
+ }
20668
20695
  const cache = buildNumberingCache(docx);
20669
- docxNumberingCacheStore.set(docx, cache);
20696
+ if (converter) {
20697
+ setConverterCache(converter, cache, docx);
20698
+ } else {
20699
+ docxNumberingCacheStore.set(docx, cache);
20700
+ }
20670
20701
  return cache;
20671
20702
  };
20672
20703
  const handleListNode = (params) => {
@@ -20923,11 +20954,11 @@ const getListNumIdFromStyleRef = (styleId, docx) => {
20923
20954
  }
20924
20955
  return { numId, ilvl };
20925
20956
  };
20926
- const getAbstractDefinition = (numId, docx) => {
20957
+ const getAbstractDefinition = (numId, docx, converter) => {
20927
20958
  const numberingXml = docx["word/numbering.xml"];
20928
20959
  if (!numberingXml) return {};
20929
20960
  if (numId == null) return void 0;
20930
- const cache = ensureNumberingCache(docx);
20961
+ const cache = ensureNumberingCache(docx, converter);
20931
20962
  const numKey = String(numId);
20932
20963
  let listDefinitionForThisNumId = cache.numToDefinition.get(numKey);
20933
20964
  if (!listDefinitionForThisNumId) {
@@ -24440,10 +24471,11 @@ const getListItemStyleDefinitions = ({ styleId, numId, level, editor, tries }) =
24440
24471
  if (typeof numId === "string") numId = Number(numId);
24441
24472
  if (typeof level === "string") level = Number(level);
24442
24473
  const docx = editor?.converter?.convertedXml;
24443
- const numbering = editor?.converter?.numbering;
24474
+ const converter = editor?.converter;
24475
+ const numbering = converter?.numbering;
24444
24476
  const styleDefinition = docx ? getStyleTagFromStyleId(styleId, docx) : null;
24445
24477
  const stylePpr = styleDefinition?.elements.find((el) => el.name === "w:pPr");
24446
- let abstractDefinition = docx ? getAbstractDefinition(numId, docx) : null;
24478
+ let abstractDefinition = docx ? getAbstractDefinition(numId, docx, converter) : null;
24447
24479
  if (!abstractDefinition) {
24448
24480
  const listDef = numbering?.definitions?.[numId];
24449
24481
  const abstractId = listDef?.elements?.find((item) => item.name === "w:abstractNumId")?.attributes?.["w:val"];
@@ -33553,7 +33585,7 @@ const createDocumentJson = (docx, converter, editor) => {
33553
33585
  comments,
33554
33586
  inlineDocumentFonts,
33555
33587
  linkedStyles: getStyleDefinitions(docx),
33556
- numbering: getNumberingDefinitions(docx)
33588
+ numbering: getNumberingDefinitions(docx, converter)
33557
33589
  };
33558
33590
  }
33559
33591
  return null;
@@ -33952,8 +33984,8 @@ function filterOutRootInlineNodes(content = []) {
33952
33984
  ]);
33953
33985
  return content.filter((node) => node && typeof node.type === "string" && !INLINE_TYPES.has(node.type));
33954
33986
  }
33955
- function getNumberingDefinitions(docx) {
33956
- const cache = ensureNumberingCache(docx);
33987
+ function getNumberingDefinitions(docx, converter) {
33988
+ const cache = ensureNumberingCache(docx, converter);
33957
33989
  const abstractDefinitions = {};
33958
33990
  cache.abstractById.forEach((value, key) => {
33959
33991
  const numericKey = Number(key);
@@ -1,4 +1,4 @@
1
- import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-DCADSoU6.js";
1
+ import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-DxFe92HN.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, applyIndentStyling_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-DCADSoU6.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-DxFe92HN.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-DiRUh82P.js";
17
+ import { D as DocxZipper } from "./docx-zipper-cuctY57Z.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -11017,10 +11017,12 @@ const _ExtensionService = class _ExtensionService {
11017
11017
  type: getNodeType(extension.name, this.schema)
11018
11018
  };
11019
11019
  const addNodeView = getExtensionConfigField(extension, "addNodeView", context);
11020
- if (!addNodeView) return [];
11020
+ if (!addNodeView) return null;
11021
+ const nodeViewFunction = addNodeView();
11022
+ if (!nodeViewFunction) return null;
11021
11023
  const nodeview = (node, _view, getPos, decorations) => {
11022
11024
  const htmlAttributes = Attribute.getAttributesToRender(node, extensionAttrs);
11023
- return addNodeView()({
11025
+ return nodeViewFunction({
11024
11026
  editor,
11025
11027
  node,
11026
11028
  getPos,
@@ -11030,7 +11032,7 @@ const _ExtensionService = class _ExtensionService {
11030
11032
  });
11031
11033
  };
11032
11034
  return [extension.name, nodeview];
11033
- });
11035
+ }).filter(Boolean);
11034
11036
  return Object.fromEntries(entries);
11035
11037
  }
11036
11038
  };
@@ -15055,7 +15057,7 @@ const _Editor = class _Editor extends EventEmitter {
15055
15057
  { default: remarkStringify },
15056
15058
  { default: remarkGfm }
15057
15059
  ] = await Promise.all([
15058
- import("./index-R92AJa-b.js"),
15060
+ import("./index-cOCdMICZ.js"),
15059
15061
  import("./index-DRCvimau.js"),
15060
15062
  import("./index-C_x_N6Uh.js"),
15061
15063
  import("./index-D_sWOSiG.js"),
@@ -20468,6 +20470,9 @@ function orderedListSync(editor) {
20468
20470
  }
20469
20471
  });
20470
20472
  }
20473
+ const shouldSkipNodeView = (editor) => {
20474
+ return editor.options.isHeadless;
20475
+ };
20471
20476
  const ListItem = Node$1.create({
20472
20477
  name: "listItem",
20473
20478
  content: "paragraph* block*",
@@ -20494,9 +20499,11 @@ const ListItem = Node$1.create({
20494
20499
  },
20495
20500
  /**
20496
20501
  * Important: The listItem node uses a custom node view.
20497
- * @returns {import('@core/NodeView.js').NodeView}
20502
+ * Skip node view in headless mode for performance.
20503
+ * @returns {import('@core/NodeView.js').NodeView|null}
20498
20504
  */
20499
20505
  addNodeView() {
20506
+ if (shouldSkipNodeView(this.editor)) return null;
20500
20507
  return ({ node, editor, getPos, decorations }) => {
20501
20508
  return new ListItemNodeView(node, getPos, decorations, editor);
20502
20509
  };
@@ -1,4 +1,4 @@
1
- import { aA as getDefaultExportFromCjs } from "./converter-DCADSoU6.js";
1
+ import { aA as getDefaultExportFromCjs } from "./converter-DxFe92HN.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { p as process$1 } from "./converter-DCADSoU6.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-S-V_9zg8.js";
2
+ import { p as process$1 } from "./converter-DxFe92HN.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CMem2X8B.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { a5 } from "./chunks/converter-DCADSoU6.js";
1
+ import { a5 } from "./chunks/converter-DxFe92HN.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-DCADSoU6.js";
2
- import { D } from "./chunks/docx-zipper-DiRUh82P.js";
1
+ import "./chunks/converter-DxFe92HN.js";
2
+ import { D } from "./chunks/docx-zipper-cuctY57Z.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-S-V_9zg8.js";
2
- import "./chunks/converter-DCADSoU6.js";
3
- import "./chunks/docx-zipper-DiRUh82P.js";
1
+ import { E } from "./chunks/editor-CMem2X8B.js";
2
+ import "./chunks/converter-DxFe92HN.js";
3
+ import "./chunks/docx-zipper-cuctY57Z.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DiRUh82P.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-cuctY57Z.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {