@harbour-enterprises/superdoc 0.6.88 → 0.6.89

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.
@@ -20599,7 +20599,7 @@ const _SuperConverter = class _SuperConverter2 {
20599
20599
  return;
20600
20600
  }
20601
20601
  }
20602
- static updateDocumentVersion(docx = this.convertedXml, version = "0.6.88") {
20602
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.6.89") {
20603
20603
  const customLocation = "docProps/custom.xml";
20604
20604
  if (!docx[customLocation]) {
20605
20605
  docx[customLocation] = generateCustomXml();
@@ -20855,18 +20855,23 @@ function storeSuperdocVersion(docx) {
20855
20855
  const properties = customXml.elements.find((el) => el.name === "Properties");
20856
20856
  if (!properties.elements) properties.elements = [];
20857
20857
  const elements = properties.elements;
20858
+ const cleanProperties = elements.filter((prop) => typeof prop === "object" && prop !== null).filter((prop) => {
20859
+ const { attributes } = prop;
20860
+ return attributes.name !== "SuperdocVersion";
20861
+ });
20858
20862
  let pid = 2;
20859
20863
  try {
20860
- pid = elements.length ? Math.max(...elements.map((el) => el.attributes.pid)) + 1 : 2;
20864
+ pid = cleanProperties.length ? Math.max(...elements.map((el) => el.attributes.pid)) + 1 : 2;
20861
20865
  } catch (error) {
20862
20866
  }
20863
- elements.push(pid, generateSuperdocVersion());
20867
+ cleanProperties.push(pid, generateSuperdocVersion());
20868
+ properties.elements = cleanProperties;
20864
20869
  return docx;
20865
20870
  }
20866
20871
  function generateCustomXml() {
20867
20872
  return DEFAULT_CUSTOM_XML;
20868
20873
  }
20869
- function generateSuperdocVersion(pid = 2, version = "0.6.88") {
20874
+ function generateSuperdocVersion(pid = 2, version = "0.6.89") {
20870
20875
  return {
20871
20876
  type: "element",
20872
20877
  name: "property",
@@ -35050,7 +35055,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
35050
35055
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
35051
35056
  */
35052
35057
  processCollaborationMigrations() {
35053
- console.debug("[checkVersionMigrations] Current editor version", "0.6.88");
35058
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.89");
35054
35059
  if (!this.options.ydoc) return;
35055
35060
  const metaMap = this.options.ydoc.getMap("meta");
35056
35061
  let docVersion = metaMap.get("version");
@@ -58543,4 +58548,4 @@ export {
58543
58548
  helpers as k,
58544
58549
  index as l
58545
58550
  };
58546
- //# sourceMappingURL=super-editor.es-B9wZhLXC.js.map
58551
+ //# sourceMappingURL=super-editor.es-CMnNT5PV.js.map