@harbour-enterprises/superdoc 0.7.9 → 0.7.10

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 (27) hide show
  1. package/dist/chunks/{super-editor.es-BxlAyTUP.js → super-editor.es-BFSqj6T6.js} +19 -9
  2. package/dist/chunks/super-editor.es-BFSqj6T6.js.map +1 -0
  3. package/dist/super-editor/chunks/{converter-ChTIQKST.js → converter-CRvLgvZt.js} +12 -6
  4. package/dist/super-editor/chunks/{converter-ChTIQKST.js.map → converter-CRvLgvZt.js.map} +1 -1
  5. package/dist/super-editor/chunks/{docx-zipper-DXF4wSoE.js → docx-zipper-BMuukZkc.js} +2 -2
  6. package/dist/super-editor/chunks/{docx-zipper-DXF4wSoE.js.map → docx-zipper-BMuukZkc.js.map} +1 -1
  7. package/dist/super-editor/chunks/{editor-Bf82IeUi.js → editor-BdLNLP9a.js} +10 -6
  8. package/dist/super-editor/chunks/editor-BdLNLP9a.js.map +1 -0
  9. package/dist/super-editor/chunks/{toolbar-D4y_bTtu.js → toolbar-y0HedaTU.js} +3 -3
  10. package/dist/super-editor/chunks/{toolbar-D4y_bTtu.js.map → toolbar-y0HedaTU.js.map} +1 -1
  11. package/dist/super-editor/converter.es.js +1 -1
  12. package/dist/super-editor/core/helpers/createDocument.d.ts +3 -1
  13. package/dist/super-editor/core/helpers/createDocument.d.ts.map +1 -1
  14. package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts.map +1 -1
  15. package/dist/super-editor/core/super-converter/v2/importer/standardNodeImporter.d.ts.map +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.es.js +1 -1
  22. package/dist/superdoc.es.js +3 -3
  23. package/dist/superdoc.umd.js +19 -9
  24. package/dist/superdoc.umd.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/chunks/super-editor.es-BxlAyTUP.js.map +0 -1
  27. package/dist/super-editor/chunks/editor-Bf82IeUi.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { C } from "./chunks/converter-ChTIQKST.js";
1
+ import { C } from "./chunks/converter-CRvLgvZt.js";
2
2
  export {
3
3
  C as SuperConverter
4
4
  };
@@ -5,5 +5,7 @@
5
5
  * @param editor Editor
6
6
  * @returns Document.
7
7
  */
8
- export function createDocument(converter: any, schema: any, editor: any): any;
8
+ export function createDocument(converter: any, schema: any, editor: any, { check }?: {
9
+ check?: boolean;
10
+ }): any;
9
11
  //# sourceMappingURL=createDocument.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createDocument.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/createDocument.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,8EAQC"}
1
+ {"version":3,"file":"createDocument.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/createDocument.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;QAeC"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotationImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/annotationImporter.js"],"names":[],"mappings":"AAGA;;GAEG;AACH,uCAkDE;AAOK,yDA+BN;AAED;;GAEG;AACH,8CAGE"}
1
+ {"version":3,"file":"annotationImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/annotationImporter.js"],"names":[],"mappings":"AAGA;;GAEG;AACH,uCAsDE;AAOK,yDA+BN;AAED;;GAEG;AACH,8CAGE"}
@@ -1 +1 @@
1
- {"version":3,"file":"standardNodeImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/standardNodeImporter.js"],"names":[],"mappings":"AAEA;;GAEG;AACH,qCA6DE;AAQF;;GAEG;AACH,4CAGE"}
1
+ {"version":3,"file":"standardNodeImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/standardNodeImporter.js"],"names":[],"mappings":"AAEA;;GAEG;AACH,qCAiEE;AAQF;;GAEG;AACH,4CAGE"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-ChTIQKST.js";
2
- import { D } from "./chunks/docx-zipper-DXF4wSoE.js";
1
+ import "./chunks/converter-CRvLgvZt.js";
2
+ import { D } from "./chunks/docx-zipper-BMuukZkc.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-Bf82IeUi.js";
2
- import "./chunks/converter-ChTIQKST.js";
3
- import "./chunks/docx-zipper-DXF4wSoE.js";
1
+ import { E } from "./chunks/editor-BdLNLP9a.js";
2
+ import "./chunks/converter-CRvLgvZt.js";
3
+ import "./chunks/docx-zipper-BMuukZkc.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DXF4wSoE.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BMuukZkc.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -9,13 +9,13 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _interceptedCommands, _SuperToolbar_instances, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions, j as Extension, A as Attribute, N as Node } from "./chunks/editor-Bf82IeUi.js";
13
- import { l, n, k, m } from "./chunks/editor-Bf82IeUi.js";
14
- import { O as getDefaultExportFromCjs, v as v4, T as TextSelection, U as vClickOutside, a as Plugin } from "./chunks/converter-ChTIQKST.js";
15
- import { C } from "./chunks/converter-ChTIQKST.js";
12
+ import { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions, j as Extension, A as Attribute, N as Node } from "./chunks/editor-BdLNLP9a.js";
13
+ import { l, n, k, m } from "./chunks/editor-BdLNLP9a.js";
14
+ import { O as getDefaultExportFromCjs, v as v4, T as TextSelection, U as vClickOutside, a as Plugin } from "./chunks/converter-CRvLgvZt.js";
15
+ import { C } from "./chunks/converter-CRvLgvZt.js";
16
16
  import { ref, createElementBlock, openBlock, createElementVNode, unref, getCurrentInstance, computed, watch, onMounted, createCommentVNode, withDirectives, withKeys, normalizeClass, withModifiers, vModelText, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-D4y_bTtu.js";
18
- import { D } from "./chunks/docx-zipper-DXF4wSoE.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-y0HedaTU.js";
18
+ import { D } from "./chunks/docx-zipper-BMuukZkc.js";
19
19
  import { createZip } from "./file-zipper.es.js";
20
20
  var eventemitter3 = { exports: {} };
21
21
  (function(module) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-D4y_bTtu.js";
3
- import "./chunks/editor-Bf82IeUi.js";
2
+ import { T } from "./chunks/toolbar-y0HedaTU.js";
3
+ import "./chunks/editor-BdLNLP9a.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,4 +1,4 @@
1
- import { _, D, E, a, S, b, c, d, T, e, i, g, f, h, j, k, l, m } from "./chunks/super-editor.es-BxlAyTUP.js";
1
+ import { _, D, E, a, S, b, c, d, T, e, i, g, f, h, j, k, l, m } from "./chunks/super-editor.es-BFSqj6T6.js";
2
2
  import "./chunks/vue-BjMDYCe1.js";
3
3
  export {
4
4
  _ as BasicUpload,
@@ -1,5 +1,5 @@
1
- import { E as Editor, j as getRichTextExtensions, c as SuperInput, b as SuperEditor, d as SuperToolbar, e as createZip } from "./chunks/super-editor.es-BxlAyTUP.js";
2
- import { S, i, l, m } from "./chunks/super-editor.es-BxlAyTUP.js";
1
+ import { E as Editor, j as getRichTextExtensions, c as SuperInput, b as SuperEditor, d as SuperToolbar, e as createZip } from "./chunks/super-editor.es-BFSqj6T6.js";
2
+ import { S, i, l, m } from "./chunks/super-editor.es-BFSqj6T6.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, C as toRef, i as inject, q as getCurrentInstance, l as watch, x as unref, a1 as hasInjectionContext, L as reactive, R as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, N as shallowRef, M as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, G as withDirectives, B as h, V as Teleport, S as renderSlot, W as isVNode, K as watchEffect, O as Transition, E as mergeProps, P as vShow, J as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, f as createBaseVNode, A as normalizeStyle, e as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, a6 as resolveDynamicComponent } from "./chunks/vue-BjMDYCe1.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-Df6uKve1.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.js";
@@ -45843,7 +45843,7 @@ class SuperDoc extends EventEmitter {
45843
45843
  this.config.colors = shuffleArray(this.config.colors);
45844
45844
  this.userColorMap = /* @__PURE__ */ new Map();
45845
45845
  this.colorIndex = 0;
45846
- this.version = "0.7.9";
45846
+ this.version = "0.7.10";
45847
45847
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
45848
45848
  this.superdocId = config.superdocId || v4();
45849
45849
  this.colors = this.config.colors;
@@ -26760,7 +26760,7 @@
26760
26760
  if (item.seen) continue;
26761
26761
  if (item.elements && !hasTextNode(item.elements)) {
26762
26762
  const n = handleStandardNode2({ ...params2, nodes: [item] }).nodes[0];
26763
- parsedListItems[parsedListItems.length - 1]?.content.push(n);
26763
+ if (n) parsedListItems[parsedListItems.length - 1]?.content.push(n);
26764
26764
  item.seen = true;
26765
26765
  continue;
26766
26766
  }
@@ -27374,6 +27374,9 @@
27374
27374
  fieldColor,
27375
27375
  multipleImage: isMultipleImage === "true"
27376
27376
  };
27377
+ if (!attrs.fieldId || !attrs.displayLabel) {
27378
+ return { nodes: [], consumed: 0 };
27379
+ }
27377
27380
  let result = {
27378
27381
  type: "text",
27379
27382
  text: `{{${attrs.displayLabel}}}`,
@@ -27431,6 +27434,9 @@
27431
27434
  const node2 = nodes[0];
27432
27435
  const { name } = node2;
27433
27436
  const { attributes, elements, marks = [] } = parseProperties(node2);
27437
+ if (name === "w:sdt") {
27438
+ return { nodes: [], consumed: 0 };
27439
+ }
27434
27440
  if (isPropertiesElement(node2)) {
27435
27441
  return {
27436
27442
  nodes: [{
@@ -27991,7 +27997,7 @@
27991
27997
  return;
27992
27998
  }
27993
27999
  }
27994
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.7.9") {
28000
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.7.10") {
27995
28001
  const customLocation = "docProps/custom.xml";
27996
28002
  if (!docx[customLocation]) {
27997
28003
  docx[customLocation] = generateCustomXml();
@@ -28227,8 +28233,8 @@
28227
28233
  { name: "w:ind", type: "textIndent", mark: "textStyle", property: "textIndent" },
28228
28234
  { name: "w:spacing", type: "lineHeight", mark: "textStyle", property: "lineHeight" },
28229
28235
  { name: "link", type: "link", mark: "link", property: "href" },
28230
- { name: "w:highlight", type: "highlight", mark: "highlight", property: "color" },
28231
- { name: "w:shd", type: "highlight", mark: "highlight", property: "color" }
28236
+ { name: "w:highlight", type: "highlight", mark: "highlight", property: "color" }
28237
+ // { name: 'w:shd', type: 'highlight', mark: 'highlight', property: 'color'}
28232
28238
  ]);
28233
28239
  __publicField$2(_SuperConverter, "propertyTypes", Object.freeze({
28234
28240
  "w:pPr": "paragraphProperties",
@@ -28264,7 +28270,7 @@
28264
28270
  function generateCustomXml() {
28265
28271
  return DEFAULT_CUSTOM_XML;
28266
28272
  }
28267
- function generateSuperdocVersion(pid = 2, version2 = "0.7.9") {
28273
+ function generateSuperdocVersion(pid = 2, version2 = "0.7.10") {
28268
28274
  return {
28269
28275
  type: "element",
28270
28276
  name: "property",
@@ -40553,10 +40559,14 @@
40553
40559
  return [editorFocusPlugin];
40554
40560
  }
40555
40561
  });
40556
- function createDocument(converter, schema, editor) {
40562
+ function createDocument(converter, schema, editor, { check = false } = {}) {
40557
40563
  const documentData = converter.getSchema(editor);
40558
40564
  if (documentData) {
40559
- return schema.nodeFromJSON(documentData);
40565
+ const documentNode = schema.nodeFromJSON(documentData);
40566
+ if (check) {
40567
+ documentNode.check();
40568
+ }
40569
+ return documentNode;
40560
40570
  }
40561
40571
  return schema.topNodeType.createAndFill();
40562
40572
  }
@@ -42495,7 +42505,7 @@
42495
42505
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
42496
42506
  */
42497
42507
  processCollaborationMigrations() {
42498
- console.debug("[checkVersionMigrations] Current editor version", "0.7.9");
42508
+ console.debug("[checkVersionMigrations] Current editor version", "0.7.10");
42499
42509
  if (!this.options.ydoc) return;
42500
42510
  const metaMap = this.options.ydoc.getMap("meta");
42501
42511
  let docVersion = metaMap.get("version");
@@ -110827,7 +110837,7 @@ ${style2}
110827
110837
  this.config.colors = shuffleArray(this.config.colors);
110828
110838
  this.userColorMap = /* @__PURE__ */ new Map();
110829
110839
  this.colorIndex = 0;
110830
- this.version = "0.7.9";
110840
+ this.version = "0.7.10";
110831
110841
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
110832
110842
  this.superdocId = config.superdocId || v4();
110833
110843
  this.colors = this.config.colors;