@harbour-enterprises/superdoc 0.6.53-RC2 → 0.6.53

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 (38) hide show
  1. package/dist/chunks/{index-CNRkrxU_.js → index-C9_loHlV.js} +2 -2
  2. package/dist/chunks/{index-CNRkrxU_.js.map → index-C9_loHlV.js.map} +1 -1
  3. package/dist/chunks/{index-nNmNp7xV.js → index-CYNgdiE-.js} +3 -3
  4. package/dist/chunks/{index-nNmNp7xV.js.map → index-CYNgdiE-.js.map} +1 -1
  5. package/dist/chunks/{super-editor.es-BNq7PTdY.js → super-editor.es-C8f8z8z9.js} +26 -33
  6. package/dist/chunks/super-editor.es-C8f8z8z9.js.map +1 -0
  7. package/dist/chunks/{url-fcWIKKAi.js → url-BEZ_vydO.js} +2 -2
  8. package/dist/chunks/{url-fcWIKKAi.js.map → url-BEZ_vydO.js.map} +1 -1
  9. package/dist/chunks/{xml-js-B_TKCasX.js → xml-js-thotvZIi.js} +12 -5
  10. package/dist/chunks/{xml-js-B_TKCasX.js.map → xml-js-thotvZIi.js.map} +1 -1
  11. package/dist/super-editor/chunks/{converter-GTDpz_PU.js → converter-R9v6ADEr.js} +25 -32
  12. package/dist/super-editor/chunks/{converter-GTDpz_PU.js.map → converter-R9v6ADEr.js.map} +1 -1
  13. package/dist/super-editor/chunks/{docx-zipper-BhLNuDo2.js → docx-zipper-CxrMu_LD.js} +2 -2
  14. package/dist/super-editor/chunks/{docx-zipper-BhLNuDo2.js.map → docx-zipper-CxrMu_LD.js.map} +1 -1
  15. package/dist/super-editor/chunks/{editor-CFNmEw2H.js → editor-Ckk2UTqU.js} +4 -4
  16. package/dist/super-editor/chunks/{editor-CFNmEw2H.js.map → editor-Ckk2UTqU.js.map} +1 -1
  17. package/dist/super-editor/chunks/{toolbar-CRJVoRLU.js → toolbar-qFyxvVMW.js} +3 -3
  18. package/dist/super-editor/chunks/{toolbar-CRJVoRLU.js.map → toolbar-qFyxvVMW.js.map} +1 -1
  19. package/dist/super-editor/converter.es.js +1 -1
  20. package/dist/super-editor/core/super-converter/SuperConverter.d.ts +1 -1
  21. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  22. package/dist/super-editor/core/super-converter/exporter.d.ts +1 -1
  23. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  24. package/dist/super-editor/docx-zipper.es.js +2 -2
  25. package/dist/super-editor/editor.es.js +3 -3
  26. package/dist/super-editor/file-zipper.es.js +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.es.js +1 -1
  30. package/dist/superdoc.es.js +6 -6
  31. package/dist/superdoc.umd.js +26 -33
  32. package/dist/superdoc.umd.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/chunks/super-editor.es-BNq7PTdY.js.map +0 -1
  35. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-L3cpx_h8.d.ts +0 -3
  36. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-L3cpx_h8.d.ts.map +0 -1
  37. package/dist/super-editor/tests/playwright/playwright-test/dist/assets/index-CRixhnI8.d.ts +0 -3
  38. package/dist/super-editor/tests/playwright/playwright-test/dist/assets/index-CRixhnI8.d.ts.map +0 -1
@@ -18498,35 +18498,33 @@ class DocxExporter {
18498
18498
  __privateAdd$2(this, _DocxExporter_instances);
18499
18499
  this.converter = converter;
18500
18500
  }
18501
- schemaToXml(data, debug = false) {
18501
+ schemaToXml(data) {
18502
18502
  console.debug("[SuperConverter] schemaToXml:", data);
18503
- const result = __privateMethod$2(this, _DocxExporter_instances, generate_xml_as_list_fn).call(this, data, debug);
18503
+ const result = __privateMethod$2(this, _DocxExporter_instances, generate_xml_as_list_fn).call(this, data);
18504
18504
  return result.join("");
18505
18505
  }
18506
18506
  }
18507
18507
  _DocxExporter_instances = /* @__PURE__ */ new WeakSet();
18508
- generate_xml_as_list_fn = function(data, debug = falase) {
18508
+ generate_xml_as_list_fn = function(data) {
18509
18509
  const json = JSON.parse(JSON.stringify(data));
18510
18510
  const declaration = this.converter.declaration.attributes;
18511
18511
  const xmlTag = `<?xml${Object.entries(declaration).map(([key, value]) => ` ${key}="${value}"`).join("")}?>`;
18512
- const result = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, json, debug);
18512
+ const result = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, json);
18513
18513
  const final = [xmlTag, ...result];
18514
18514
  return final;
18515
18515
  };
18516
18516
  replaceSpecialCharacters_fn = function(text) {
18517
18517
  if (!text) return;
18518
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
18518
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
18519
18519
  };
18520
- generateXml_fn = function(node2, debug = false) {
18520
+ generateXml_fn = function(node2) {
18521
18521
  if (!node2) return null;
18522
- let { name } = node2;
18523
- const { elements, attributes } = node2;
18522
+ const { name, elements, attributes } = node2;
18524
18523
  let tag = `<${name}`;
18525
18524
  for (let attr in attributes) {
18526
- const parsedAttrName = typeof attributes[attr] === "string" ? __privateMethod$2(this, _DocxExporter_instances, replaceSpecialCharacters_fn).call(this, attributes[attr]) : attributes[attr];
18527
- tag += ` ${attr}="${parsedAttrName}"`;
18525
+ tag += ` ${attr}="${attributes[attr]}"`;
18528
18526
  }
18529
- const selfClosing = name && (!elements || !elements.length);
18527
+ const selfClosing = !elements || !elements.length;
18530
18528
  if (selfClosing) tag += " />";
18531
18529
  else tag += ">";
18532
18530
  let tags = [tag];
@@ -18540,10 +18538,7 @@ generateXml_fn = function(node2, debug = false) {
18540
18538
  for (let child of elements) {
18541
18539
  const newElements = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, child);
18542
18540
  if (!newElements) continue;
18543
- const removeUndefined = newElements.filter((el) => {
18544
- return el !== "<undefined>" && el !== "</undefined>";
18545
- });
18546
- tags.push(...removeUndefined);
18541
+ tags.push(...newElements);
18547
18542
  }
18548
18543
  }
18549
18544
  }
@@ -20569,14 +20564,14 @@ const _SuperConverter = class _SuperConverter2 {
20569
20564
  if (!properties.elements) return;
20570
20565
  const superdocVersion = properties.elements.find((el) => el.name === "property" && el.attributes.name === "SuperdocVersion");
20571
20566
  if (!superdocVersion) return;
20572
- const version = superdocVersion.elements[0].elements[0].text;
20567
+ const version = superdocVersion.elements[0].elements[0].elements[0].text;
20573
20568
  return version;
20574
20569
  } catch (e) {
20575
20570
  console.warn("Error getting Superdoc version", e);
20576
20571
  return;
20577
20572
  }
20578
20573
  }
20579
- static updateDocumentVersion(docx = this.convertedXml, version = "0.6.53-RC2") {
20574
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.6.53") {
20580
20575
  const customLocation = "docProps/custom.xml";
20581
20576
  if (!docx[customLocation]) {
20582
20577
  docx[customLocation] = generateCustomXml();
@@ -20684,9 +20679,9 @@ const _SuperConverter = class _SuperConverter2 {
20684
20679
  return null;
20685
20680
  }
20686
20681
  }
20687
- schemaToXml(data, debug = false) {
20682
+ schemaToXml(data) {
20688
20683
  const exporter = new DocxExporter(this);
20689
- return exporter.schemaToXml(data, debug);
20684
+ return exporter.schemaToXml(data);
20690
20685
  }
20691
20686
  async exportToDocx(jsonData, editorSchema, documentMedia, isFinalDoc = false, commentsExportType, comments = []) {
20692
20687
  const bodyNode = this.savedTagsToRestore.find((el) => el.name === "w:body");
@@ -20828,34 +20823,32 @@ function storeSuperdocVersion(docx) {
20828
20823
  const properties = customXml.elements.find((el) => el.name === "Properties");
20829
20824
  if (!properties.elements) properties.elements = [];
20830
20825
  const elements = properties.elements;
20831
- let pid = 2;
20832
- try {
20833
- pid = elements.length ? Math.max(...elements.map((el) => el.attributes.pid)) + 1 : 2;
20834
- } catch (error) {
20835
- }
20836
- elements.push(pid, generateSuperdocVersion());
20826
+ elements.push(generateSuperdocVersion());
20837
20827
  return docx;
20838
20828
  }
20839
20829
  function generateCustomXml() {
20840
20830
  return DEFAULT_CUSTOM_XML;
20841
20831
  }
20842
- function generateSuperdocVersion(pid = 2, version = "0.6.53-RC2") {
20832
+ function generateSuperdocVersion(version = "0.6.53") {
20843
20833
  return {
20844
20834
  type: "element",
20845
20835
  name: "property",
20846
20836
  attributes: {
20847
20837
  name: "SuperdocVersion",
20848
- fmtid: "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
20849
- pid
20838
+ formatId: "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
20839
+ pid: "2"
20850
20840
  },
20851
20841
  elements: [
20852
20842
  {
20853
20843
  type: "element",
20854
- name: "vt:lpwstr",
20844
+ name: "vt:superdoc",
20855
20845
  elements: [
20856
20846
  {
20857
- type: "text",
20858
- text: version
20847
+ name: "w:t",
20848
+ elements: [{
20849
+ type: "text",
20850
+ text: version
20851
+ }]
20859
20852
  }
20860
20853
  ]
20861
20854
  }
@@ -34865,7 +34858,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
34865
34858
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
34866
34859
  */
34867
34860
  processCollaborationMigrations() {
34868
- console.debug("[checkVersionMigrations] Current editor version", "0.6.53-RC2");
34861
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.53");
34869
34862
  if (!this.options.ydoc) return;
34870
34863
  const metaMap = this.options.ydoc.getMap("meta");
34871
34864
  let docVersion = metaMap.get("version");
@@ -58325,4 +58318,4 @@ export {
58325
58318
  helpers as k,
58326
58319
  index as l
58327
58320
  };
58328
- //# sourceMappingURL=super-editor.es-BNq7PTdY.js.map
58321
+ //# sourceMappingURL=super-editor.es-C8f8z8z9.js.map