@harbour-enterprises/superdoc 0.11.29 → 0.11.31

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.
@@ -24080,7 +24080,7 @@ Actual: ` + p3.attribValue
24080
24080
  return;
24081
24081
  }
24082
24082
  }
24083
- static updateDocumentVersion(e = this.convertedXml, t = "0.11.29") {
24083
+ static updateDocumentVersion(e = this.convertedXml, t = "0.11.31") {
24084
24084
  const n = "docProps/custom.xml";
24085
24085
  e[n] || (e[n] = Fu$2());
24086
24086
  const i3 = e["docProps/custom.xml"];
@@ -24343,7 +24343,7 @@ Actual: ` + p3.attribValue
24343
24343
  function Fu$2() {
24344
24344
  return Gf$1;
24345
24345
  }
24346
- function Bu$2(r22 = 2, e = "0.11.29") {
24346
+ function Bu$2(r22 = 2, e = "0.11.31") {
24347
24347
  return {
24348
24348
  type: "element",
24349
24349
  name: "property",
@@ -36983,7 +36983,7 @@ Actual: ` + p3.attribValue
36983
36983
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
36984
36984
  */
36985
36985
  processCollaborationMigrations() {
36986
- if (console.debug("[checkVersionMigrations] Current editor version", "0.11.29"), !this.options.ydoc) return;
36986
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.11.31"), !this.options.ydoc) return;
36987
36987
  let r = this.options.ydoc.getMap("meta").get("version");
36988
36988
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
36989
36989
  const i3 = hl$1(r) || [], s = this.state.plugins.find((c3) => c3.key.startsWith("y-sync"));
@@ -37023,18 +37023,20 @@ Actual: ` + p3.attribValue
37023
37023
  * pre-process the document as needed prior to running in the annotator.
37024
37024
  *
37025
37025
  * Currently this is only used for table generation but additional pre-processing can be done here.
37026
- * @param {Array[Object]} annotationValues
37026
+ *
37027
+ * @param {FieldValue[]} annotationValues
37027
37028
  * @returns {void}
37028
37029
  */
37029
- prepareForAnnotations(n = [], r = []) {
37030
- const { tr: i3 } = this.state, { dispatch: o } = this.view, s = ko$2.processTables({ editor: this, tr: i3, annotationValues: n, hiddenIds: r });
37031
- this.view.dispatch(s);
37030
+ prepareForAnnotations(n = []) {
37031
+ const { tr: r } = this.state, { dispatch: i3 } = this.view, o = ko$2.processTables({ editor: this, tr: r, annotationValues: n });
37032
+ this.view.dispatch(o);
37032
37033
  }
37033
37034
  /**
37034
37035
  * Annotate the document with the given annotation values.
37035
37036
  *
37036
- * @param {Array[Object]} annotationValues
37037
- * @param {Array[String]} hiddenIds
37037
+ * @param {FieldValue[]} annotationValues List of field values to apply.
37038
+ * @param {String[]} hiddenIds List of field ids to remove from the document.
37039
+ * @returns {void}
37038
37040
  */
37039
37041
  annotate(n = [], r = []) {
37040
37042
  const { state: i3, view: o, schema: s } = this;
@@ -70949,7 +70951,7 @@ ${style2}
70949
70951
  this.config.colors = shuffleArray(this.config.colors);
70950
70952
  this.userColorMap = /* @__PURE__ */ new Map();
70951
70953
  this.colorIndex = 0;
70952
- this.version = "0.11.29";
70954
+ this.version = "0.11.31";
70953
70955
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
70954
70956
  this.superdocId = config.superdocId || v4();
70955
70957
  this.colors = this.config.colors;
@@ -71273,10 +71275,11 @@ ${style2}
71273
71275
  commentsType,
71274
71276
  exportedName,
71275
71277
  additionalFiles = [],
71276
- additionalFileNames = []
71278
+ additionalFileNames = [],
71279
+ isFinalDoc = false
71277
71280
  } = {}) {
71278
71281
  const baseFileName = exportedName ? cleanName(exportedName) : cleanName(this.config.title);
71279
- const docxFiles = await this.exportEditorsToDOCX({ commentsType });
71282
+ const docxFiles = await this.exportEditorsToDOCX({ commentsType, isFinalDoc });
71280
71283
  const blobsToZip = [...additionalFiles];
71281
71284
  const filenames = [...additionalFileNames];
71282
71285
  if (exportType.includes("docx")) {
@@ -71292,7 +71295,7 @@ ${style2}
71292
71295
  createDownload(zip, baseFileName, "zip");
71293
71296
  }
71294
71297
  }
71295
- async exportEditorsToDOCX({ commentsType } = {}) {
71298
+ async exportEditorsToDOCX({ commentsType, isFinalDoc } = {}) {
71296
71299
  const comments = [];
71297
71300
  if (commentsType !== "clean") {
71298
71301
  comments.push(...this.commentsStore?.translateCommentsForExport());
@@ -71301,7 +71304,7 @@ ${style2}
71301
71304
  this.superdocStore.documents.forEach((doc2) => {
71302
71305
  const editor = doc2.getEditor();
71303
71306
  if (editor) {
71304
- docxPromises.push(editor.exportDocx({ comments, commentsType }));
71307
+ docxPromises.push(editor.exportDocx({ isFinalDoc, comments, commentsType }));
71305
71308
  }
71306
71309
  });
71307
71310
  return await Promise.all(docxPromises);