@harbour-enterprises/superdoc 0.12.36-next.3 → 0.12.36-next.4

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 (32) hide show
  1. package/dist/chunks/{index-BrSjd1Id.es.js → index-Bt9T0ivx.es.js} +1 -1
  2. package/dist/chunks/{index-CMBtuT02.cjs → index-C9VoBmK2.cjs} +1 -1
  3. package/dist/chunks/{index-B1MhwjTC.cjs → index-CZ7uYk9v.cjs} +2 -2
  4. package/dist/chunks/{index-SKpROzLW.es.js → index-WlcT4qSb.es.js} +2 -2
  5. package/dist/chunks/{super-editor.es-C0CYAawq.cjs → super-editor.es-D5ju1Vy3.cjs} +36 -25
  6. package/dist/chunks/{super-editor.es-CJ7JYnTb.es.js → super-editor.es-DSQJ1jVu.es.js} +36 -25
  7. package/dist/chunks/{url-CAZQTNP3.es.js → url-B8943xnh.es.js} +1 -1
  8. package/dist/chunks/{url-DuggQ5JR.cjs → url-ITkRdlXj.cjs} +1 -1
  9. package/dist/chunks/{xml-js-B7Vccv2s.cjs → xml-js-DUY8aVjn.cjs} +21 -7
  10. package/dist/chunks/{xml-js-BV-kCPOA.es.js → xml-js-O0pGoXNk.es.js} +21 -7
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-CgZg2BnJ.js → converter-C_7uxiuz.js} +12 -4
  13. package/dist/super-editor/chunks/{docx-zipper-af8QSGql.js → docx-zipper-DVTlb3Bj.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-DsMCF0TV.js → editor-BBDvpLkh.js} +26 -23
  15. package/dist/super-editor/chunks/{toolbar-n4Ej7u3_.js → toolbar-DFbQdspg.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
  18. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  19. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts +3 -3
  20. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
  21. package/dist/super-editor/docx-zipper.es.js +2 -2
  22. package/dist/super-editor/editor.es.js +3 -3
  23. package/dist/super-editor/file-zipper.es.js +1 -1
  24. package/dist/super-editor/super-editor.es.js +6 -6
  25. package/dist/super-editor/toolbar.es.js +2 -2
  26. package/dist/super-editor.cjs +1 -1
  27. package/dist/super-editor.es.js +1 -1
  28. package/dist/superdoc.cjs +5 -5
  29. package/dist/superdoc.es.js +6 -6
  30. package/dist/superdoc.umd.js +37 -26
  31. package/dist/superdoc.umd.js.map +1 -1
  32. package/package.json +1 -1
package/dist/superdoc.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C0CYAawq.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-D5ju1Vy3.cjs");
4
4
  const vue = require("./chunks/vue-DPZkajuO.cjs");
5
5
  const jszip = require("./chunks/jszip-Bwu_om3F.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -23172,13 +23172,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
23172
23172
  "./chunks/empty-lth7LH78.cjs"
23173
23173
  )), http = await Promise.resolve().then(() => require(
23174
23174
  /*webpackIgnore: true*/
23175
- "./chunks/index-B1MhwjTC.cjs"
23175
+ "./chunks/index-CZ7uYk9v.cjs"
23176
23176
  )).then((n) => n.index), https = await Promise.resolve().then(() => require(
23177
23177
  /*webpackIgnore: true*/
23178
- "./chunks/index-CMBtuT02.cjs"
23178
+ "./chunks/index-C9VoBmK2.cjs"
23179
23179
  )).then((n) => n.index), url = await Promise.resolve().then(() => require(
23180
23180
  /*webpackIgnore: true*/
23181
- "./chunks/url-DuggQ5JR.cjs"
23181
+ "./chunks/url-ITkRdlXj.cjs"
23182
23182
  )).then((n) => n.url);
23183
23183
  let canvas, path2d;
23184
23184
  try {
@@ -46571,7 +46571,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46571
46571
  this.config.colors = shuffleArray(this.config.colors);
46572
46572
  this.userColorMap = /* @__PURE__ */ new Map();
46573
46573
  this.colorIndex = 0;
46574
- this.version = "0.12.36-next.3";
46574
+ this.version = "0.12.36-next.4";
46575
46575
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46576
46576
  this.superdocId = config.superdocId || uuid.v4();
46577
46577
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-CJ7JYnTb.es.js";
2
- import { a, S, i, n } from "./chunks/super-editor.es-CJ7JYnTb.es.js";
1
+ import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-DSQJ1jVu.es.js";
2
+ import { a, S, i, n } from "./chunks/super-editor.es-DSQJ1jVu.es.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -23171,13 +23171,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
23171
23171
  "./chunks/empty-smM22Y5N.es.js"
23172
23172
  ), http = await import(
23173
23173
  /*webpackIgnore: true*/
23174
- "./chunks/index-SKpROzLW.es.js"
23174
+ "./chunks/index-WlcT4qSb.es.js"
23175
23175
  ).then((n2) => n2.i), https = await import(
23176
23176
  /*webpackIgnore: true*/
23177
- "./chunks/index-BrSjd1Id.es.js"
23177
+ "./chunks/index-Bt9T0ivx.es.js"
23178
23178
  ).then((n2) => n2.i), url = await import(
23179
23179
  /*webpackIgnore: true*/
23180
- "./chunks/url-CAZQTNP3.es.js"
23180
+ "./chunks/url-B8943xnh.es.js"
23181
23181
  ).then((n2) => n2.u);
23182
23182
  let canvas, path2d;
23183
23183
  try {
@@ -46570,7 +46570,7 @@ class SuperDoc extends EventEmitter {
46570
46570
  this.config.colors = shuffleArray(this.config.colors);
46571
46571
  this.userColorMap = /* @__PURE__ */ new Map();
46572
46572
  this.colorIndex = 0;
46573
- this.version = "0.12.36-next.3";
46573
+ this.version = "0.12.36-next.4";
46574
46574
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46575
46575
  this.superdocId = config.superdocId || v4();
46576
46576
  this.colors = this.config.colors;
@@ -26661,7 +26661,10 @@
26661
26661
  if (Array.isArray(outputNode)) {
26662
26662
  const mapped = [];
26663
26663
  outputNode.forEach((el, index22) => {
26664
- mapped.push(...el.elements);
26664
+ el.elements.forEach((element) => {
26665
+ if (element.name === "w:pPr") return;
26666
+ mapped.push(element);
26667
+ });
26665
26668
  if (index22 < outputNode.length - 1) mapped.push({ name: "w:br", type: "element" });
26666
26669
  });
26667
26670
  mapped.unshift(carbonCopy(pPr));
@@ -29415,7 +29418,12 @@
29415
29418
  return indent;
29416
29419
  };
29417
29420
  const getParagraphSpacing = (node2, docx, styleId = "", marks = []) => {
29418
- const spacing = {};
29421
+ const spacing = {
29422
+ lineSpaceAfter: 0,
29423
+ lineSpaceBefore: 0,
29424
+ line: 0,
29425
+ lineRule: null
29426
+ };
29419
29427
  const { spacing: pDefaultSpacing = {} } = getDefaultParagraphStyle(docx, styleId);
29420
29428
  let lineSpaceAfter, lineSpaceBefore, line, lineRuleStyle;
29421
29429
  const pPr = node2.elements?.find((el) => el.name === "w:pPr");
@@ -30664,7 +30672,7 @@
30664
30672
  return;
30665
30673
  }
30666
30674
  }
30667
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.3") {
30675
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.4") {
30668
30676
  const customLocation = "docProps/custom.xml";
30669
30677
  if (!docx[customLocation]) {
30670
30678
  docx[customLocation] = generateCustomXml();
@@ -31131,7 +31139,7 @@
31131
31139
  function generateCustomXml() {
31132
31140
  return DEFAULT_CUSTOM_XML;
31133
31141
  }
31134
- function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.3") {
31142
+ function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.4") {
31135
31143
  return {
31136
31144
  type: "element",
31137
31145
  name: "property",
@@ -47604,27 +47612,30 @@
47604
47612
  (node22) => node22.type.name === "listItem"
47605
47613
  );
47606
47614
  if (!listItem) return;
47607
- if (listItem.node.childCount !== 1) {
47608
- let remainingNodes = listItem.node.childCount;
47609
- let matchingNodesFound = 0;
47610
- let hasOtherNodes = false;
47611
- listItem.node.children.forEach((child, index2) => {
47612
- const { type: type2 } = child;
47613
- if (type2.name !== "paragraph") return;
47614
- child.children.forEach((inline) => {
47615
- const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
47616
- const isMatchingField = inline.type.name === "fieldAnnotation" && isFieldToDelete;
47617
- const isEmpty2 = inline.childCount === 0;
47618
- if (!isEmpty2 && !isMatchingField) hasOtherNodes = true;
47619
- if (isMatchingField) matchingNodesFound += 1;
47620
- });
47621
- });
47622
- if (!hasOtherNodes && matchingNodesFound > 0) {
47623
- remainingNodes -= matchingNodesFound;
47624
- }
47625
- if (remainingNodes > 0) {
47626
- return;
47615
+ let remainingNodes = 0;
47616
+ listItem.node.descendants((node22) => {
47617
+ if (node22.type.name === "fieldAnnotation") {
47618
+ remainingNodes += 1;
47627
47619
  }
47620
+ });
47621
+ let matchingNodesFound = 0;
47622
+ let hasOtherNodes = false;
47623
+ listItem.node.children.forEach((child, index2) => {
47624
+ const { type: type2 } = child;
47625
+ if (type2.name !== "paragraph" && type2.name !== "fieldAnnotation") return;
47626
+ child.children.forEach((inline) => {
47627
+ const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
47628
+ const isMatchingField = inline.type.name === "fieldAnnotation" && isFieldToDelete;
47629
+ const isEmpty2 = inline.childCount === 0;
47630
+ if (!isEmpty2 && !isMatchingField) hasOtherNodes = true;
47631
+ if (isMatchingField) matchingNodesFound += 1;
47632
+ });
47633
+ });
47634
+ if (!hasOtherNodes && matchingNodesFound > 0) {
47635
+ remainingNodes -= matchingNodesFound;
47636
+ }
47637
+ if (remainingNodes > 0) {
47638
+ return;
47628
47639
  }
47629
47640
  let { pos, node: node2, depth } = listItem;
47630
47641
  let $pos = doc2.resolve(pos);
@@ -48468,7 +48479,7 @@
48468
48479
  * @returns {Object | void} Migration results
48469
48480
  */
48470
48481
  processCollaborationMigrations() {
48471
- console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.3");
48482
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.4");
48472
48483
  if (!this.options.ydoc) return;
48473
48484
  const metaMap = this.options.ydoc.getMap("meta");
48474
48485
  let docVersion = metaMap.get("version");
@@ -90020,7 +90031,7 @@ ${style2}
90020
90031
  this.config.colors = shuffleArray(this.config.colors);
90021
90032
  this.userColorMap = /* @__PURE__ */ new Map();
90022
90033
  this.colorIndex = 0;
90023
- this.version = "0.12.36-next.3";
90034
+ this.version = "0.12.36-next.4";
90024
90035
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
90025
90036
  this.superdocId = config.superdocId || v4();
90026
90037
  this.colors = this.config.colors;