superdoc 0.30.0-next.6 → 0.30.0-next.7

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 (35) hide show
  1. package/dist/chunks/{PdfViewer-CUTMj5RE.es.js → PdfViewer-CBfKTlkO.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-Br3uLtct.cjs → PdfViewer-DAfhpENU.cjs} +1 -1
  3. package/dist/chunks/{index-BKpU3J9C.es.js → index-D11q4Kk4.es.js} +3 -3
  4. package/dist/chunks/{index-BDHxhYs7.cjs → index-D6ktUpVF.cjs} +3 -3
  5. package/dist/chunks/{index-Cl-cHAOX-B0b2FNkc.es.js → index-K8x_ZMJI-BhsVHeXy.es.js} +1 -1
  6. package/dist/chunks/{index-Cl-cHAOX-KFl7ZmMz.cjs → index-K8x_ZMJI-BrnvF8W6.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-C5HSjMYm.cjs → super-editor.es-DKjs4Vsm.cjs} +44 -20
  8. package/dist/chunks/{super-editor.es-BHj2Pdqj.es.js → super-editor.es-DgBDoeNs.es.js} +44 -20
  9. package/dist/style.css +1 -0
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-B2Oi2KIq.js → converter-CV0ojpfw.js} +7 -9
  12. package/dist/super-editor/chunks/{docx-zipper-D26IydiB.js → docx-zipper-OIsx4R0Z.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-Dvy9zQYS.js → editor-Dj784nAk.js} +39 -13
  14. package/dist/super-editor/chunks/{index-Cl-cHAOX.js → index-K8x_ZMJI.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-C38kG3xU.js → toolbar-B9Usxj75.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/style.css +1 -0
  21. package/dist/super-editor/super-editor/src/core/helpers/list-numbering-helpers.d.ts.map +1 -1
  22. package/dist/super-editor/super-editor/src/core/helpers/orderedListUtils.d.ts.map +1 -1
  23. package/dist/super-editor/super-editor/src/extensions/paragraph/ParagraphNodeView.d.ts.map +1 -1
  24. package/dist/super-editor/super-editor/src/extensions/paragraph/numberingPlugin.d.ts.map +1 -1
  25. package/dist/super-editor/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts +1 -0
  26. package/dist/super-editor/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts.map +1 -1
  27. package/dist/super-editor/super-editor.es.js +6 -6
  28. package/dist/super-editor/toolbar.es.js +2 -2
  29. package/dist/super-editor.cjs +1 -1
  30. package/dist/super-editor.es.js +1 -1
  31. package/dist/superdoc.cjs +2 -2
  32. package/dist/superdoc.es.js +2 -2
  33. package/dist/superdoc.umd.js +46 -22
  34. package/dist/superdoc.umd.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, y as h, O as Transition, $ as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, v as createVNode, x as unref } from "./vue-CKmzTNVs.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-BKpU3J9C.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-D11q4Kk4.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-Cwv-wUpm.cjs");
4
- const superdoc = require("./index-BDHxhYs7.cjs");
4
+ const superdoc = require("./index-D6ktUpVF.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -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-BHj2Pdqj.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-DgBDoeNs.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-hYlnBzSA.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17202,7 +17202,7 @@ const _sfc_main = {
17202
17202
  __name: "SuperDoc",
17203
17203
  emits: ["selection-update"],
17204
17204
  setup(__props, { emit: __emit }) {
17205
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CUTMj5RE.es.js"));
17205
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CBfKTlkO.es.js"));
17206
17206
  const superdocStore = useSuperdocStore();
17207
17207
  const commentsStore = useCommentsStore();
17208
17208
  const {
@@ -17966,7 +17966,7 @@ class SuperDoc extends EventEmitter {
17966
17966
  this.config.colors = shuffleArray(this.config.colors);
17967
17967
  this.userColorMap = /* @__PURE__ */ new Map();
17968
17968
  this.colorIndex = 0;
17969
- this.version = "0.30.0-next.6";
17969
+ this.version = "0.30.0-next.7";
17970
17970
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17971
17971
  this.superdocId = config.superdocId || v4();
17972
17972
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C5HSjMYm.cjs");
2
+ const superEditor_es = require("./super-editor.es-DKjs4Vsm.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DmHNHvFX.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17219,7 +17219,7 @@ const _sfc_main = {
17219
17219
  __name: "SuperDoc",
17220
17220
  emits: ["selection-update"],
17221
17221
  setup(__props, { emit: __emit }) {
17222
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Br3uLtct.cjs")));
17222
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DAfhpENU.cjs")));
17223
17223
  const superdocStore = useSuperdocStore();
17224
17224
  const commentsStore = useCommentsStore();
17225
17225
  const {
@@ -17983,7 +17983,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
17983
17983
  this.config.colors = shuffleArray(this.config.colors);
17984
17984
  this.userColorMap = /* @__PURE__ */ new Map();
17985
17985
  this.colorIndex = 0;
17986
- this.version = "0.30.0-next.6";
17986
+ this.version = "0.30.0-next.7";
17987
17987
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17988
17988
  this.superdocId = config.superdocId || uuid.v4();
17989
17989
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BHj2Pdqj.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-DgBDoeNs.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-C5HSjMYm.cjs");
3
+ const superEditor_es = require("./super-editor.es-DKjs4Vsm.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -27482,7 +27482,12 @@ const getListDefinitionDetails = ({ numId, level, listType, editor, tries = 0 })
27482
27482
  }
27483
27483
  const findElement = (name) => listDefinition.elements?.find((item) => item.name === name);
27484
27484
  const startElement = findElement("w:start");
27485
- const numFmtElement = findElement("w:numFmt");
27485
+ let numFmtElement = findElement("w:numFmt");
27486
+ if (!numFmtElement) {
27487
+ const mcAlternate = listDefinition.elements?.find((item) => item.name === "mc:AlternateContent");
27488
+ const choice = mcAlternate?.elements?.find((el) => el.name === "mc:Choice");
27489
+ numFmtElement = choice?.elements?.find((item) => item.name === "w:numFmt");
27490
+ }
27486
27491
  const lvlTextElement = findElement("w:lvlText");
27487
27492
  const suffixElement = findElement("w:suff");
27488
27493
  const lvlJcElement = findElement("w:lvlJc");
@@ -33952,13 +33957,6 @@ function getNumberingDefinitions(docx, converter) {
33952
33957
  importListDefs[numericKey] = value;
33953
33958
  }
33954
33959
  });
33955
- const listDefsEntries = Object.entries(importListDefs);
33956
- const foundByDurableId = listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] === "485517411");
33957
- if (foundByDurableId.length > 1) {
33958
- importListDefs = Object.fromEntries(
33959
- listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] !== "485517411")
33960
- );
33961
- }
33962
33960
  return {
33963
33961
  abstracts: abstractDefinitions,
33964
33962
  definitions: importListDefs
@@ -35266,7 +35264,7 @@ const _SuperConverter = class _SuperConverter2 {
35266
35264
  static getStoredSuperdocVersion(docx) {
35267
35265
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35268
35266
  }
35269
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.30.0-next.6") {
35267
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.30.0-next.7") {
35270
35268
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35271
35269
  }
35272
35270
  /**
@@ -52588,7 +52586,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
52588
52586
  { default: remarkStringify },
52589
52587
  { default: remarkGfm }
52590
52588
  ] = await Promise.all([
52591
- Promise.resolve().then(() => require("./index-Cl-cHAOX-KFl7ZmMz.cjs")),
52589
+ Promise.resolve().then(() => require("./index-K8x_ZMJI-BrnvF8W6.cjs")),
52592
52590
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
52593
52591
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
52594
52592
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -52806,7 +52804,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
52806
52804
  * @returns {Object | void} Migration results
52807
52805
  */
52808
52806
  processCollaborationMigrations() {
52809
- console.debug("[checkVersionMigrations] Current editor version", "0.30.0-next.6");
52807
+ console.debug("[checkVersionMigrations] Current editor version", "0.30.0-next.7");
52810
52808
  if (!this.options.ydoc) return;
52811
52809
  const metaMap = this.options.ydoc.getMap("meta");
52812
52810
  let docVersion = metaMap.get("version");
@@ -57026,6 +57024,9 @@ function calculateTabStyle(nodeSize2, view, pos, blockParent2, paragraphContext,
57026
57024
  if (paragraphContext.tabHeight === void 0) {
57027
57025
  paragraphContext.tabHeight = calcTabHeight(blockParent2);
57028
57026
  }
57027
+ if (paragraphContext.paragraphWidth === void 0) {
57028
+ paragraphContext.paragraphWidth = getBlockNodeWidth(view, startPos);
57029
+ }
57029
57030
  const indentWidth = paragraphContext.indentWidth;
57030
57031
  const hanging = twipsToPixels(Number(paragraphContext.indent.hanging) || 0);
57031
57032
  if (hanging > 0) {
@@ -57037,7 +57038,7 @@ function calculateTabStyle(nodeSize2, view, pos, blockParent2, paragraphContext,
57037
57038
  if (tabStops.length) {
57038
57039
  const tabStop = tabStops.find((stop) => stop.pos > currentWidth && stop.val !== "clear");
57039
57040
  if (tabStop) {
57040
- tabWidth = tabStop.pos - currentWidth;
57041
+ tabWidth = Math.min(tabStop.pos, paragraphContext.paragraphWidth) - currentWidth;
57041
57042
  let val = tabStop.val;
57042
57043
  const aliases = { left: "start", right: "end" };
57043
57044
  if (aliases[val]) val = aliases[val];
@@ -57205,6 +57206,15 @@ function getIndentWidth(view, paragraphStartPos, indentAttrs = {}, coordCache =
57205
57206
  }
57206
57207
  return calculateIndentFallback(indentAttrs);
57207
57208
  }
57209
+ function getBlockNodeWidth(view, blockStartPos) {
57210
+ const blockDom = view.nodeDOM(blockStartPos - 1);
57211
+ if (blockDom instanceof HTMLElement) {
57212
+ const styles = window.getComputedStyle(blockDom);
57213
+ const width = blockDom.clientWidth + parseFloat(styles.marginLeft || "0") + parseFloat(styles.marginRight || "0") + parseFloat(styles.borderLeftWidth || "0") + parseFloat(styles.borderRightWidth || "0") + parseFloat(styles.paddingLeft || "0") + parseFloat(styles.paddingRight || "0");
57214
+ return width;
57215
+ }
57216
+ return defaultLineLength;
57217
+ }
57208
57218
  function calculateIndentFallback(indentAttrs = {}) {
57209
57219
  if (!indentAttrs) return 0;
57210
57220
  const left2 = twipsToPixels(Number(indentAttrs.left) || 0);
@@ -57333,6 +57343,20 @@ class ParagraphNodeView {
57333
57343
  if (mutation.type === "attributes" && mutation.target === this.dom && mutation.attributeName === "style") {
57334
57344
  return true;
57335
57345
  }
57346
+ if (mutation.type === "childList") {
57347
+ if (this.marker && Array.from(mutation.removedNodes).includes(this.marker)) {
57348
+ return true;
57349
+ }
57350
+ if (this.marker && Array.from(mutation.addedNodes).includes(this.marker)) {
57351
+ return true;
57352
+ }
57353
+ if (this.separator && Array.from(mutation.removedNodes).includes(this.separator)) {
57354
+ return true;
57355
+ }
57356
+ if (this.separator && Array.from(mutation.addedNodes).includes(this.separator)) {
57357
+ return true;
57358
+ }
57359
+ }
57336
57360
  return false;
57337
57361
  }
57338
57362
  destroy() {
@@ -57372,10 +57396,10 @@ checkIsList_fn = function() {
57372
57396
  createMarker_fn = function(markerText) {
57373
57397
  if (!this.marker) {
57374
57398
  this.marker = document.createElement("span");
57399
+ this.dom.insertBefore(this.marker, this.contentDOM);
57375
57400
  }
57376
57401
  this.marker.contentEditable = "false";
57377
57402
  this.marker.className = "list-marker";
57378
- this.dom.insertBefore(this.marker, this.contentDOM);
57379
57403
  this.marker.textContent = markerText;
57380
57404
  };
57381
57405
  createSeparator_fn = function(suffix2) {
@@ -57383,7 +57407,7 @@ createSeparator_fn = function(suffix2) {
57383
57407
  if (this.separator == null || this.separator.tagName?.toLowerCase() !== "span") {
57384
57408
  this.separator?.parentNode?.removeChild(this.separator);
57385
57409
  this.separator = document.createElement("span");
57386
- this.dom.insertBefore(this.separator, this.contentDOM);
57410
+ this.marker.after(this.separator);
57387
57411
  }
57388
57412
  this.separator.className = "sd-editor-tab";
57389
57413
  this.separator.contentEditable = "false";
@@ -57391,14 +57415,14 @@ createSeparator_fn = function(suffix2) {
57391
57415
  if (this.separator == null || this.separator.nodeType !== Node.TEXT_NODE) {
57392
57416
  this.separator?.parentNode?.removeChild(this.separator);
57393
57417
  this.separator = document.createTextNode(" ");
57394
- this.dom.insertBefore(this.separator, this.contentDOM);
57418
+ this.marker.after(this.separator);
57395
57419
  }
57396
57420
  this.separator.textContent = " ";
57397
57421
  } else if (suffix2 === "nothing") {
57398
57422
  if (this.separator == null || this.separator.nodeType !== Node.TEXT_NODE) {
57399
57423
  this.separator?.parentNode?.removeChild(this.separator);
57400
57424
  this.separator = document.createTextNode("");
57401
- this.dom.insertBefore(this.separator, this.contentDOM);
57425
+ this.marker.after(this.separator);
57402
57426
  }
57403
57427
  this.separator.textContent = "";
57404
57428
  }
@@ -57601,7 +57625,7 @@ function NumberingManager() {
57601
57625
  abstractIdMap[numId] = abstractId;
57602
57626
  const restartSetting = startsMap?.[numId]?.[level]?.restart;
57603
57627
  const startValue = startsMap?.[numId]?.[level]?.start ?? 1;
57604
- const levelData = countersMap?.[numId]?.[level] || {};
57628
+ const levelData = abstractCountersMap?.[abstractId]?.[level] || {};
57605
57629
  let previousPos = null;
57606
57630
  let previousCount = startValue - 1;
57607
57631
  if (cacheEnabled) {
@@ -57773,13 +57797,12 @@ const ordinalFormatter = (level) => {
57773
57797
  return p;
57774
57798
  };
57775
57799
  const generateFromCustom = (path, lvlText, customFormat) => {
57776
- if (customFormat !== "001, 002, 003, ...") return generateNumbering(path, lvlText, String);
57800
+ if (customFormat.match(/(?:[0]+\d,\s){3}\.{3}/) == null) return generateNumbering(path, lvlText, String);
57777
57801
  const match = customFormat.match(/(\d+)/);
57778
57802
  if (!match) throw new Error("Invalid format string: no numeric pattern found");
57779
57803
  const sample = match[1];
57780
57804
  const digitCount = sample.length;
57781
- const index2 = path.pop();
57782
- return String(index2).padStart(digitCount, "0");
57805
+ return generateNumbering(path, lvlText, (p) => String(p).padStart(digitCount, "0"));
57783
57806
  };
57784
57807
  const intToRoman = (num) => {
57785
57808
  const romanNumeralMap = [
@@ -57904,6 +57927,7 @@ function createNumberingPlugin(editor) {
57904
57927
  }
57905
57928
  let { lvlText, customFormat, listNumberingType, suffix: suffix2, justification, abstractId } = definitionDetails;
57906
57929
  let markerText = "";
57930
+ listNumberingType = listNumberingType || "decimal";
57907
57931
  const count = numberingManager.calculateCounter(numId, level, pos, abstractId);
57908
57932
  numberingManager.setCounter(numId, level, pos, count, abstractId);
57909
57933
  const path = numberingManager.calculatePath(numId, level, pos);
@@ -27465,7 +27465,12 @@ const getListDefinitionDetails = ({ numId, level, listType, editor, tries = 0 })
27465
27465
  }
27466
27466
  const findElement = (name) => listDefinition.elements?.find((item) => item.name === name);
27467
27467
  const startElement = findElement("w:start");
27468
- const numFmtElement = findElement("w:numFmt");
27468
+ let numFmtElement = findElement("w:numFmt");
27469
+ if (!numFmtElement) {
27470
+ const mcAlternate = listDefinition.elements?.find((item) => item.name === "mc:AlternateContent");
27471
+ const choice = mcAlternate?.elements?.find((el) => el.name === "mc:Choice");
27472
+ numFmtElement = choice?.elements?.find((item) => item.name === "w:numFmt");
27473
+ }
27469
27474
  const lvlTextElement = findElement("w:lvlText");
27470
27475
  const suffixElement = findElement("w:suff");
27471
27476
  const lvlJcElement = findElement("w:lvlJc");
@@ -33935,13 +33940,6 @@ function getNumberingDefinitions(docx, converter) {
33935
33940
  importListDefs[numericKey] = value;
33936
33941
  }
33937
33942
  });
33938
- const listDefsEntries = Object.entries(importListDefs);
33939
- const foundByDurableId = listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] === "485517411");
33940
- if (foundByDurableId.length > 1) {
33941
- importListDefs = Object.fromEntries(
33942
- listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] !== "485517411")
33943
- );
33944
- }
33945
33943
  return {
33946
33944
  abstracts: abstractDefinitions,
33947
33945
  definitions: importListDefs
@@ -35249,7 +35247,7 @@ const _SuperConverter = class _SuperConverter2 {
35249
35247
  static getStoredSuperdocVersion(docx) {
35250
35248
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35251
35249
  }
35252
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.30.0-next.6") {
35250
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.30.0-next.7") {
35253
35251
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35254
35252
  }
35255
35253
  /**
@@ -52571,7 +52569,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
52571
52569
  { default: remarkStringify },
52572
52570
  { default: remarkGfm }
52573
52571
  ] = await Promise.all([
52574
- import("./index-Cl-cHAOX-B0b2FNkc.es.js"),
52572
+ import("./index-K8x_ZMJI-BhsVHeXy.es.js"),
52575
52573
  import("./index-DRCvimau-Cw339678.es.js"),
52576
52574
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
52577
52575
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -52789,7 +52787,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
52789
52787
  * @returns {Object | void} Migration results
52790
52788
  */
52791
52789
  processCollaborationMigrations() {
52792
- console.debug("[checkVersionMigrations] Current editor version", "0.30.0-next.6");
52790
+ console.debug("[checkVersionMigrations] Current editor version", "0.30.0-next.7");
52793
52791
  if (!this.options.ydoc) return;
52794
52792
  const metaMap = this.options.ydoc.getMap("meta");
52795
52793
  let docVersion = metaMap.get("version");
@@ -57009,6 +57007,9 @@ function calculateTabStyle(nodeSize2, view, pos, blockParent2, paragraphContext,
57009
57007
  if (paragraphContext.tabHeight === void 0) {
57010
57008
  paragraphContext.tabHeight = calcTabHeight(blockParent2);
57011
57009
  }
57010
+ if (paragraphContext.paragraphWidth === void 0) {
57011
+ paragraphContext.paragraphWidth = getBlockNodeWidth(view, startPos);
57012
+ }
57012
57013
  const indentWidth = paragraphContext.indentWidth;
57013
57014
  const hanging = twipsToPixels(Number(paragraphContext.indent.hanging) || 0);
57014
57015
  if (hanging > 0) {
@@ -57020,7 +57021,7 @@ function calculateTabStyle(nodeSize2, view, pos, blockParent2, paragraphContext,
57020
57021
  if (tabStops.length) {
57021
57022
  const tabStop = tabStops.find((stop) => stop.pos > currentWidth && stop.val !== "clear");
57022
57023
  if (tabStop) {
57023
- tabWidth = tabStop.pos - currentWidth;
57024
+ tabWidth = Math.min(tabStop.pos, paragraphContext.paragraphWidth) - currentWidth;
57024
57025
  let val = tabStop.val;
57025
57026
  const aliases = { left: "start", right: "end" };
57026
57027
  if (aliases[val]) val = aliases[val];
@@ -57188,6 +57189,15 @@ function getIndentWidth(view, paragraphStartPos, indentAttrs = {}, coordCache =
57188
57189
  }
57189
57190
  return calculateIndentFallback(indentAttrs);
57190
57191
  }
57192
+ function getBlockNodeWidth(view, blockStartPos) {
57193
+ const blockDom = view.nodeDOM(blockStartPos - 1);
57194
+ if (blockDom instanceof HTMLElement) {
57195
+ const styles = window.getComputedStyle(blockDom);
57196
+ const width = blockDom.clientWidth + parseFloat(styles.marginLeft || "0") + parseFloat(styles.marginRight || "0") + parseFloat(styles.borderLeftWidth || "0") + parseFloat(styles.borderRightWidth || "0") + parseFloat(styles.paddingLeft || "0") + parseFloat(styles.paddingRight || "0");
57197
+ return width;
57198
+ }
57199
+ return defaultLineLength;
57200
+ }
57191
57201
  function calculateIndentFallback(indentAttrs = {}) {
57192
57202
  if (!indentAttrs) return 0;
57193
57203
  const left2 = twipsToPixels(Number(indentAttrs.left) || 0);
@@ -57316,6 +57326,20 @@ class ParagraphNodeView {
57316
57326
  if (mutation.type === "attributes" && mutation.target === this.dom && mutation.attributeName === "style") {
57317
57327
  return true;
57318
57328
  }
57329
+ if (mutation.type === "childList") {
57330
+ if (this.marker && Array.from(mutation.removedNodes).includes(this.marker)) {
57331
+ return true;
57332
+ }
57333
+ if (this.marker && Array.from(mutation.addedNodes).includes(this.marker)) {
57334
+ return true;
57335
+ }
57336
+ if (this.separator && Array.from(mutation.removedNodes).includes(this.separator)) {
57337
+ return true;
57338
+ }
57339
+ if (this.separator && Array.from(mutation.addedNodes).includes(this.separator)) {
57340
+ return true;
57341
+ }
57342
+ }
57319
57343
  return false;
57320
57344
  }
57321
57345
  destroy() {
@@ -57355,10 +57379,10 @@ checkIsList_fn = function() {
57355
57379
  createMarker_fn = function(markerText) {
57356
57380
  if (!this.marker) {
57357
57381
  this.marker = document.createElement("span");
57382
+ this.dom.insertBefore(this.marker, this.contentDOM);
57358
57383
  }
57359
57384
  this.marker.contentEditable = "false";
57360
57385
  this.marker.className = "list-marker";
57361
- this.dom.insertBefore(this.marker, this.contentDOM);
57362
57386
  this.marker.textContent = markerText;
57363
57387
  };
57364
57388
  createSeparator_fn = function(suffix2) {
@@ -57366,7 +57390,7 @@ createSeparator_fn = function(suffix2) {
57366
57390
  if (this.separator == null || this.separator.tagName?.toLowerCase() !== "span") {
57367
57391
  this.separator?.parentNode?.removeChild(this.separator);
57368
57392
  this.separator = document.createElement("span");
57369
- this.dom.insertBefore(this.separator, this.contentDOM);
57393
+ this.marker.after(this.separator);
57370
57394
  }
57371
57395
  this.separator.className = "sd-editor-tab";
57372
57396
  this.separator.contentEditable = "false";
@@ -57374,14 +57398,14 @@ createSeparator_fn = function(suffix2) {
57374
57398
  if (this.separator == null || this.separator.nodeType !== Node.TEXT_NODE) {
57375
57399
  this.separator?.parentNode?.removeChild(this.separator);
57376
57400
  this.separator = document.createTextNode(" ");
57377
- this.dom.insertBefore(this.separator, this.contentDOM);
57401
+ this.marker.after(this.separator);
57378
57402
  }
57379
57403
  this.separator.textContent = " ";
57380
57404
  } else if (suffix2 === "nothing") {
57381
57405
  if (this.separator == null || this.separator.nodeType !== Node.TEXT_NODE) {
57382
57406
  this.separator?.parentNode?.removeChild(this.separator);
57383
57407
  this.separator = document.createTextNode("");
57384
- this.dom.insertBefore(this.separator, this.contentDOM);
57408
+ this.marker.after(this.separator);
57385
57409
  }
57386
57410
  this.separator.textContent = "";
57387
57411
  }
@@ -57584,7 +57608,7 @@ function NumberingManager() {
57584
57608
  abstractIdMap[numId] = abstractId;
57585
57609
  const restartSetting = startsMap?.[numId]?.[level]?.restart;
57586
57610
  const startValue = startsMap?.[numId]?.[level]?.start ?? 1;
57587
- const levelData = countersMap?.[numId]?.[level] || {};
57611
+ const levelData = abstractCountersMap?.[abstractId]?.[level] || {};
57588
57612
  let previousPos = null;
57589
57613
  let previousCount = startValue - 1;
57590
57614
  if (cacheEnabled) {
@@ -57756,13 +57780,12 @@ const ordinalFormatter = (level) => {
57756
57780
  return p;
57757
57781
  };
57758
57782
  const generateFromCustom = (path, lvlText, customFormat) => {
57759
- if (customFormat !== "001, 002, 003, ...") return generateNumbering(path, lvlText, String);
57783
+ if (customFormat.match(/(?:[0]+\d,\s){3}\.{3}/) == null) return generateNumbering(path, lvlText, String);
57760
57784
  const match = customFormat.match(/(\d+)/);
57761
57785
  if (!match) throw new Error("Invalid format string: no numeric pattern found");
57762
57786
  const sample = match[1];
57763
57787
  const digitCount = sample.length;
57764
- const index2 = path.pop();
57765
- return String(index2).padStart(digitCount, "0");
57788
+ return generateNumbering(path, lvlText, (p) => String(p).padStart(digitCount, "0"));
57766
57789
  };
57767
57790
  const intToRoman = (num) => {
57768
57791
  const romanNumeralMap = [
@@ -57887,6 +57910,7 @@ function createNumberingPlugin(editor) {
57887
57910
  }
57888
57911
  let { lvlText, customFormat, listNumberingType, suffix: suffix2, justification, abstractId } = definitionDetails;
57889
57912
  let markerText = "";
57913
+ listNumberingType = listNumberingType || "decimal";
57890
57914
  const count = numberingManager.calculateCounter(numId, level, pos, abstractId);
57891
57915
  numberingManager.setCounter(numId, level, pos, count, abstractId);
57892
57916
  const path = numberingManager.calculatePath(numId, level, pos);
package/dist/style.css CHANGED
@@ -832,6 +832,7 @@ a {
832
832
  }
833
833
  .super-editor a {
834
834
  color: initial;
835
+ text-decoration: auto;
835
836
  }
836
837
  /**
837
838
  * Basic ProseMirror styles.
@@ -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-B2Oi2KIq.js";
3
- import { _ as _export_sfc } from "./chunks/editor-Dvy9zQYS.js";
2
+ import { T as TextSelection } from "./chunks/converter-CV0ojpfw.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-Dj784nAk.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 = {}) {
@@ -27471,7 +27471,12 @@ const getListDefinitionDetails = ({ numId, level, listType, editor, tries = 0 })
27471
27471
  }
27472
27472
  const findElement = (name) => listDefinition.elements?.find((item) => item.name === name);
27473
27473
  const startElement = findElement("w:start");
27474
- const numFmtElement = findElement("w:numFmt");
27474
+ let numFmtElement = findElement("w:numFmt");
27475
+ if (!numFmtElement) {
27476
+ const mcAlternate = listDefinition.elements?.find((item) => item.name === "mc:AlternateContent");
27477
+ const choice = mcAlternate?.elements?.find((el) => el.name === "mc:Choice");
27478
+ numFmtElement = choice?.elements?.find((item) => item.name === "w:numFmt");
27479
+ }
27475
27480
  const lvlTextElement = findElement("w:lvlText");
27476
27481
  const suffixElement = findElement("w:suff");
27477
27482
  const lvlJcElement = findElement("w:lvlJc");
@@ -34216,13 +34221,6 @@ function getNumberingDefinitions(docx, converter) {
34216
34221
  importListDefs[numericKey] = value;
34217
34222
  }
34218
34223
  });
34219
- const listDefsEntries = Object.entries(importListDefs);
34220
- const foundByDurableId = listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] === "485517411");
34221
- if (foundByDurableId.length > 1) {
34222
- importListDefs = Object.fromEntries(
34223
- listDefsEntries.filter(([, def]) => def.attributes?.["w16cid:durableId"] !== "485517411")
34224
- );
34225
- }
34226
34224
  return {
34227
34225
  abstracts: abstractDefinitions,
34228
34226
  definitions: importListDefs
@@ -35530,7 +35528,7 @@ const _SuperConverter = class _SuperConverter {
35530
35528
  static getStoredSuperdocVersion(docx) {
35531
35529
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
35532
35530
  }
35533
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.30.0-next.6") {
35531
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.30.0-next.7") {
35534
35532
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
35535
35533
  }
35536
35534
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aE as commonjsGlobal, B as Buffer, aF as getDefaultExportFromCjs, aG as getContentTypesFromXml, aH as xmljs } from "./converter-B2Oi2KIq.js";
1
+ import { p as process$1, aE as commonjsGlobal, B as Buffer, aF as getDefaultExportFromCjs, aG as getContentTypesFromXml, aH as xmljs } from "./converter-CV0ojpfw.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
  }