@harbour-enterprises/superdoc 0.6.63 → 0.6.64

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 (26) hide show
  1. package/dist/chunks/{super-editor.es-ChbpDgxj.js → super-editor.es-C1is8qI1.js} +19 -23
  2. package/dist/chunks/super-editor.es-C1is8qI1.js.map +1 -0
  3. package/dist/super-editor/chunks/{converter-DvoY_Ajb.js → converter-B0V53Xck.js} +18 -22
  4. package/dist/super-editor/chunks/{converter-DvoY_Ajb.js.map → converter-B0V53Xck.js.map} +1 -1
  5. package/dist/super-editor/chunks/{docx-zipper-BwzO_Kan.js → docx-zipper-CYnCVziT.js} +2 -2
  6. package/dist/super-editor/chunks/{docx-zipper-BwzO_Kan.js.map → docx-zipper-CYnCVziT.js.map} +1 -1
  7. package/dist/super-editor/chunks/{editor-Dlpffdvx.js → editor-DcR2sWNp.js} +4 -4
  8. package/dist/super-editor/chunks/{editor-Dlpffdvx.js.map → editor-DcR2sWNp.js.map} +1 -1
  9. package/dist/super-editor/chunks/{toolbar-DJKYESky.js → toolbar-CTHc0BuJ.js} +3 -3
  10. package/dist/super-editor/chunks/{toolbar-DJKYESky.js.map → toolbar-CTHc0BuJ.js.map} +1 -1
  11. package/dist/super-editor/converter.es.js +1 -1
  12. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  13. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  14. package/dist/super-editor/core/super-converter/v2/exporter/commentsExporter.d.ts +2 -2
  15. package/dist/super-editor/core/super-converter/v2/exporter/commentsExporter.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 -23
  24. package/dist/superdoc.umd.js.map +1 -1
  25. package/package.json +3 -1
  26. package/dist/chunks/super-editor.es-ChbpDgxj.js.map +0 -1
@@ -17391,9 +17391,9 @@ const prepareCommentsXmlFilesForExport = ({
17391
17391
  defs,
17392
17392
  commentsWithParaIds,
17393
17393
  exportType,
17394
- converter,
17395
- relationships = []
17394
+ converter
17396
17395
  }) => {
17396
+ const relationships = [];
17397
17397
  if (exportType === "clean") {
17398
17398
  const documentXml = removeCommentsFilesFromConvertedXml(convertedXml);
17399
17399
  return { documentXml, relationships };
@@ -17687,7 +17687,7 @@ function addNewLinkRelationship(params, link) {
17687
17687
  }
17688
17688
  function addNewImageRelationship(params, imagePath) {
17689
17689
  const newId = "rId" + generateDocxRandomId();
17690
- params.relationships.push({
17690
+ const newRel = {
17691
17691
  type: "element",
17692
17692
  name: "Relationship",
17693
17693
  attributes: {
@@ -17695,7 +17695,8 @@ function addNewImageRelationship(params, imagePath) {
17695
17695
  Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
17696
17696
  Target: imagePath
17697
17697
  }
17698
- });
17698
+ };
17699
+ params.relationships.push(newRel);
17699
17700
  return newId;
17700
17701
  }
17701
17702
  function translateList(params) {
@@ -20618,7 +20619,7 @@ const _SuperConverter = class _SuperConverter {
20618
20619
  return;
20619
20620
  }
20620
20621
  }
20621
- static updateDocumentVersion(docx = this.convertedXml, version = "0.6.63") {
20622
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.6.64") {
20622
20623
  const customLocation = "docProps/custom.xml";
20623
20624
  if (!docx[customLocation]) {
20624
20625
  docx[customLocation] = generateCustomXml();
@@ -20755,15 +20756,13 @@ const _SuperConverter = class _SuperConverter {
20755
20756
  ...params.media,
20756
20757
  ...this.media
20757
20758
  });
20758
- const { documentXml, relationships } = __privateMethod(this, _SuperConverter_instances, prepareCommentsXmlFilesForExport_fn).call(this, {
20759
+ const { documentXml: updatedXml, relationships } = __privateMethod(this, _SuperConverter_instances, prepareCommentsXmlFilesForExport_fn).call(this, {
20759
20760
  defs: params.exportedCommentDefs,
20760
20761
  exportType: commentsExportType,
20761
- commentsWithParaIds,
20762
- relationships: params.relationships
20762
+ commentsWithParaIds
20763
20763
  });
20764
- this.convertedXml = documentXml;
20765
- const updatedRelationships = relationships;
20766
- __privateMethod(this, _SuperConverter_instances, exportProcessNewRelationships_fn).call(this, updatedRelationships);
20764
+ this.convertedXml = { ...this.convertedXml, ...updatedXml };
20765
+ __privateMethod(this, _SuperConverter_instances, exportProcessNewRelationships_fn).call(this, [...params.relationships, ...relationships]);
20767
20766
  storeSuperdocVersion(this.convertedXml);
20768
20767
  return xml;
20769
20768
  }
@@ -20785,20 +20784,17 @@ prepareCommentsXmlFilesForExport_fn = function({ defs, exportType, commentsWithP
20785
20784
  exportProcessNewRelationships_fn = function(rels = []) {
20786
20785
  const relsData = this.convertedXml["word/_rels/document.xml.rels"];
20787
20786
  const relationships = relsData.elements.find((x) => x.name === "Relationships");
20788
- const newRels = [...relationships.elements];
20787
+ const newRels = [];
20789
20788
  let largestId = Math.max(...relationships.elements.map((el) => Number(el.attributes.Id.replace("rId", ""))));
20790
20789
  rels.forEach((rel) => {
20791
20790
  const existingTarget = relationships.elements.find((el) => el.attributes.Target === rel.attributes.Target);
20792
- if (existingTarget) {
20793
- console.debug("Duplicate relationship found", rel.attributes.Target);
20794
- return;
20795
- }
20796
- rel.attributes.Target = rel.attributes?.Target?.replace(/&/g, "&").replace(/-/g, "-");
20797
- rel.attributes.Id = `rId${++largestId}`;
20791
+ if (existingTarget) return;
20792
+ rel.attributes.Target = rel.attributes?.Target?.replace(/&/g, "&");
20793
+ const existingId = rel.attributes.Id;
20794
+ rel.attributes.Id = existingId.length > 6 ? existingId : `rId${++largestId}`;
20798
20795
  newRels.push(rel);
20799
20796
  });
20800
- relationships.elements = newRels;
20801
- console.debug("New relationships added", newRels, relsData);
20797
+ relationships.elements = [...relationships.elements, ...newRels];
20802
20798
  this.convertedXml["word/_rels/document.xml.rels"] = relsData;
20803
20799
  };
20804
20800
  exportProcessMediaFiles_fn = async function(media) {
@@ -20884,7 +20880,7 @@ function storeSuperdocVersion(docx) {
20884
20880
  function generateCustomXml() {
20885
20881
  return DEFAULT_CUSTOM_XML;
20886
20882
  }
20887
- function generateSuperdocVersion(pid = 2, version = "0.6.63") {
20883
+ function generateSuperdocVersion(pid = 2, version = "0.6.64") {
20888
20884
  return {
20889
20885
  type: "element",
20890
20886
  name: "property",
@@ -20955,4 +20951,4 @@ export {
20955
20951
  twipsToLines as y,
20956
20952
  pixelsToTwips as z
20957
20953
  };
20958
- //# sourceMappingURL=converter-DvoY_Ajb.js.map
20954
+ //# sourceMappingURL=converter-B0V53Xck.js.map