@harbour-enterprises/superdoc 0.14.9-next.1 → 0.14.9-next.3

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 (30) hide show
  1. package/dist/chunks/{index-CtKTO471.es.js → index-BvK-G6B1.es.js} +2 -2
  2. package/dist/chunks/{index-NNBaoa7m.cjs → index-CCRVYhTn.cjs} +1 -1
  3. package/dist/chunks/{index-BYM9Q-5k.cjs → index-CgJ5KVh6.cjs} +2 -2
  4. package/dist/chunks/{index-CtmwketW.es.js → index-oHslWah4.es.js} +1 -1
  5. package/dist/chunks/{super-editor.es-aq3c4S5T.es.js → super-editor.es-Cm485wgf.es.js} +20 -11
  6. package/dist/chunks/{super-editor.es-yUyLWBnh.cjs → super-editor.es-D4w4gOxp.cjs} +20 -11
  7. package/dist/chunks/{url-CHbZrfPf.cjs → url-BG1Z_Z2_.cjs} +1 -1
  8. package/dist/chunks/{url-CGuSEi6H.es.js → url-Dvx6wrNT.es.js} +1 -1
  9. package/dist/chunks/{xml-js-BjZxwY3_.cjs → xml-js-BHJlXtfU.cjs} +111 -83
  10. package/dist/chunks/{xml-js-pilYeQmG.es.js → xml-js-DNISVjNF.es.js} +111 -83
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-ClWai7D4.js → converter-wprLSvGf.js} +2 -2
  13. package/dist/super-editor/chunks/{docx-zipper-UoYB441C.js → docx-zipper-XpZaObsQ.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-QzIAZx5N.js → editor-B-syl6XT.js} +20 -11
  15. package/dist/super-editor/chunks/{toolbar-DIjrr1N2.js → toolbar-D0Pksjxw.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/core/migrations/0.14-listsv2/listsv2migration.d.ts.map +1 -1
  18. package/dist/super-editor/docx-zipper.es.js +2 -2
  19. package/dist/super-editor/editor.es.js +3 -3
  20. package/dist/super-editor/extensions/image/image.d.ts.map +1 -1
  21. package/dist/super-editor/file-zipper.es.js +1 -1
  22. package/dist/super-editor/super-editor.es.js +6 -6
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +5 -5
  27. package/dist/superdoc.es.js +6 -6
  28. package/dist/superdoc.umd.js +21 -12
  29. package/dist/superdoc.umd.js.map +1 -1
  30. package/package.json +2 -2
@@ -33754,7 +33754,7 @@
33754
33754
  return;
33755
33755
  }
33756
33756
  }
33757
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.1") {
33757
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.3") {
33758
33758
  const customLocation = "docProps/custom.xml";
33759
33759
  if (!docx[customLocation]) {
33760
33760
  docx[customLocation] = generateCustomXml();
@@ -34230,7 +34230,7 @@
34230
34230
  function generateCustomXml() {
34231
34231
  return DEFAULT_CUSTOM_XML;
34232
34232
  }
34233
- function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.1") {
34233
+ function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.3") {
34234
34234
  return {
34235
34235
  type: "element",
34236
34236
  name: "property",
@@ -49501,11 +49501,9 @@
49501
49501
  const value = matchedAnnotation?.input_value;
49502
49502
  if (!value) continue;
49503
49503
  await new Promise((resolve2, reject) => {
49504
- const mockDocument = editor.options.mockDocument;
49505
- const element = mockDocument.createElement("div");
49506
- element.id = `child-editor-${Date.now()}-${Math.random()}`;
49504
+ const element = document.createElement("div");
49507
49505
  editor.createChildEditor({
49508
- element: { mount: element },
49506
+ element,
49509
49507
  html: value,
49510
49508
  onCreate: ({ editor: localEditor }) => {
49511
49509
  const { migrated } = localEditor.options;
@@ -50319,7 +50317,7 @@
50319
50317
  * @returns {Object | void} Migration results
50320
50318
  */
50321
50319
  processCollaborationMigrations() {
50322
- console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.1");
50320
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.3");
50323
50321
  if (!this.options.ydoc) return;
50324
50322
  const metaMap = this.options.ydoc.getMap("meta");
50325
50323
  let docVersion = metaMap.get("version");
@@ -58000,11 +57998,16 @@
58000
57998
  },
58001
57999
  marginOffset: {
58002
58000
  default: {},
58003
- renderDOM: ({ marginOffset }) => {
58001
+ renderDOM: ({ marginOffset, anchorData }) => {
58002
+ const relativeFromPageV = anchorData?.vRelativeFrom === "page";
58003
+ const maxMarginV = 500;
58004
58004
  const { left: left2 = 0, top: top2 = 0 } = marginOffset ?? {};
58005
58005
  let style2 = "";
58006
58006
  if (left2) style2 += `margin-left: ${left2}px;`;
58007
- if (top2) style2 += `margin-top: ${top2}px;`;
58007
+ if (top2) {
58008
+ if (relativeFromPageV && top2 >= maxMarginV) style2 += `margin-top: ${maxMarginV}px;`;
58009
+ else style2 += `margin-top: ${top2}px;`;
58010
+ }
58008
58011
  return { style: style2 };
58009
58012
  }
58010
58013
  },
@@ -63795,7 +63798,9 @@
63795
63798
  let currentPos = pos;
63796
63799
  coords = view?.coordsAtPos(currentPos);
63797
63800
  if (!coords) return;
63798
- let shouldAddPageBreak = coords.bottom > pageHeightThreshold;
63801
+ const endPos = currentPos + currentNode.nodeSize;
63802
+ const endCoords = view.coordsAtPos(endPos);
63803
+ let shouldAddPageBreak = currentNode.isBlock ? endCoords && endCoords.bottom > pageHeightThreshold : coords.bottom > pageHeightThreshold;
63799
63804
  let isHardBreakNode = currentNode.type.name === "hardBreak";
63800
63805
  const paragraphSectPrBreak = currentNode.attrs?.pageBreakSource;
63801
63806
  if (paragraphSectPrBreak === "sectPr") {
@@ -63825,11 +63830,15 @@
63825
63830
  const table = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "table");
63826
63831
  const tableRow = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "tableRow");
63827
63832
  let isInTable2 = table || tableRow ? true : false;
63828
- const {
63833
+ let {
63829
63834
  top: actualBreakTop,
63830
63835
  bottom: actualBreakBottom,
63831
63836
  pos: breakPos
63832
63837
  } = getActualBreakCoords(view, currentPos, pageHeightThreshold);
63838
+ const $breakPos = view.state.doc.resolve(breakPos);
63839
+ if ($breakPos.parent.type.name === "listItem") {
63840
+ breakPos = $breakPos.before($breakPos.depth);
63841
+ }
63833
63842
  const footerId2 = getHeaderFooterId(currentPageNumber, "footerIds", editor, currentNode);
63834
63843
  currentPageNumber++;
63835
63844
  const headerId2 = getHeaderFooterId(currentPageNumber, "headerIds", editor);
@@ -96079,7 +96088,7 @@ ${style2}
96079
96088
  this.config.colors = shuffleArray(this.config.colors);
96080
96089
  this.userColorMap = /* @__PURE__ */ new Map();
96081
96090
  this.colorIndex = 0;
96082
- this.version = "0.14.9-next.1";
96091
+ this.version = "0.14.9-next.3";
96083
96092
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
96084
96093
  this.superdocId = config.superdocId || v4();
96085
96094
  this.colors = this.config.colors;