@harbour-enterprises/superdoc 0.10.65 → 0.10.66

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.
@@ -1,5 +1,5 @@
1
- import { f as md, g as yd, c as bd, K as jo, J as Wo, A as wd, d as Sd, E as Dd, x as vd, a as Fd } from "./chunks/super-editor.es-Br9eH3cn.es.js";
2
- import { P as Ib, b as Cb, e as fb } from "./chunks/super-editor.es-Br9eH3cn.es.js";
1
+ import { f as md, g as yd, c as bd, K as jo, J as Wo, A as wd, d as Sd, E as Dd, x as vd, a as Fd } from "./chunks/super-editor.es-DEOcinxf.es.js";
2
+ import { P as Ib, b as Cb, e as fb } from "./chunks/super-editor.es-DEOcinxf.es.js";
3
3
  import { Y as Vl, r as W, Z as ui, p as Ge, _ as Vn, a as ae, $ as zn, a0 as ua, C as dt, i as ht, q as ji, l as wt, x as ke, a1 as kd, L as Zt, R as qt, a2 as xd, a3 as Rd, a4 as Xo, g as Ji, N as Us, M as jr, j as Ii, k as Di, h as da, U as Nd, s as Md, A as Wr, F as jt, Q as GA, m as Ct, D as mi, G as ms, B as re, V as Ld, S as Gd, W as Td, K as qi, O as Es, E as ar, P as Ud, J as Hd, T as Pd, b as ye, o as fe, t as yi, v as bi, y as zl, f as We, z as ri, e as Ze, u as hi, w as Qi, n as Xs, a5 as Zl, d as gn, c as $l, X as Od, a6 as Jd } from "./chunks/vue-D254cI7X.es.js";
4
4
  import { B as qn } from "./chunks/jszip-ChtTJmXO.es.js";
5
5
  import { B as Yd } from "./chunks/blank-docx-BRvkcuiv.es.js";
@@ -32694,7 +32694,7 @@ class hb extends eg {
32694
32694
  this.config = {
32695
32695
  ...this.config,
32696
32696
  ...t
32697
- }, this.config.colors = NI(this.config.colors), this.userColorMap = /* @__PURE__ */ new Map(), this.colorIndex = 0, this.version = "0.10.65", console.debug("🦋 [superdoc] Using SuperDoc version:", this.version), this.superdocId = t.superdocId || ig(), this.colors = this.config.colors, this.#t(), await this.#r(this.config.modules), this.#i(), this.#s(), this.user = this.config.user, this.users = this.config.users || [], this.socket = null, this.isDev = this.config.isDev || !1, this.activeEditor = null, this.comments = [], this.app.mount(this.config.selector), this.readyEditors = 0, this.isLocked = this.config.isLocked || !1, this.lockedBy = this.config.lockedBy || null, this.#a(this);
32697
+ }, this.config.colors = NI(this.config.colors), this.userColorMap = /* @__PURE__ */ new Map(), this.colorIndex = 0, this.version = "0.10.66", console.debug("🦋 [superdoc] Using SuperDoc version:", this.version), this.superdocId = t.superdocId || ig(), this.colors = this.config.colors, this.#t(), await this.#r(this.config.modules), this.#i(), this.#s(), this.user = this.config.user, this.users = this.config.users || [], this.socket = null, this.isDev = this.config.isDev || !1, this.activeEditor = null, this.comments = [], this.app.mount(this.config.selector), this.readyEditors = 0, this.isLocked = this.config.isLocked || !1, this.lockedBy = this.config.lockedBy || null, this.#a(this);
32698
32698
  }
32699
32699
  get requiredNumberOfEditors() {
32700
32700
  return this.superdocStore.documents.filter((t) => t.type === on).length;
@@ -23919,7 +23919,7 @@ Actual: ` + p3.attribValue
23919
23919
  return;
23920
23920
  }
23921
23921
  }
23922
- static updateDocumentVersion(e = this.convertedXml, t = "0.10.65") {
23922
+ static updateDocumentVersion(e = this.convertedXml, t = "0.10.66") {
23923
23923
  const n = "docProps/custom.xml";
23924
23924
  e[n] || (e[n] = Fu$2());
23925
23925
  const i3 = e["docProps/custom.xml"];
@@ -23968,18 +23968,20 @@ Actual: ` + p3.attribValue
23968
23968
  }, []), o = this.convertedXml["word/_rels/fontTable.xml.rels"]?.elements.find((f3) => f3.name === "Relationships") || {}, { elements: a } = o;
23969
23969
  let u = "";
23970
23970
  for (const f3 of i3) {
23971
- const l = a.find((R) => R.attributes.Id === f3.attributes["r:id"])?.attributes?.Target;
23971
+ const l = a.find((k) => k.attributes.Id === f3.attributes["r:id"])?.attributes?.Target;
23972
23972
  if (!l) return;
23973
- const h3 = Vf$1(this.fonts[`word/${l}`], f3.attributes["w:fontKey"]);
23974
- if (!h3) return;
23975
- const g = new Blob([h3], { type: "font/ttf" }), v = URL.createObjectURL(g), A = f3.name.includes("Regular"), E3 = f3.name.includes("Bold"), F3 = f3.name.includes("Italic"), w = f3.name.includes("Light");
23973
+ const g = this.fonts[`word/${l}`]?.buffer;
23974
+ if (!g) return;
23975
+ const v = Vf$1(g, f3.attributes["w:fontKey"]);
23976
+ if (!v) return;
23977
+ const A = new Blob([v], { type: "font/ttf" }), E3 = URL.createObjectURL(A), F3 = f3.name.includes("Regular"), w = f3.name.includes("Bold"), B = f3.name.includes("Italic"), R = f3.name.includes("Light");
23976
23978
  u += `
23977
23979
  @font-face {
23978
- font-style: ${F3 ? "italic" : "normal"};
23979
- font-weight: ${A ? "normal" : E3 ? "bold" : w ? "200" : "normal"};
23980
+ font-style: ${B ? "italic" : "normal"};
23981
+ font-weight: ${F3 ? "normal" : w ? "bold" : R ? "200" : "normal"};
23980
23982
  font-display: swap;
23981
23983
  font-family: ${f3.fontFamily};
23982
- src: url(${v}) format('truetype');
23984
+ src: url(${E3}) format('truetype');
23983
23985
  }
23984
23986
  `;
23985
23987
  }
@@ -24180,7 +24182,7 @@ Actual: ` + p3.attribValue
24180
24182
  function Fu$2() {
24181
24183
  return Gf$2;
24182
24184
  }
24183
- function Bu$2(r22 = 2, e = "0.10.65") {
24185
+ function Bu$2(r22 = 2, e = "0.10.66") {
24184
24186
  return {
24185
24187
  type: "element",
24186
24188
  name: "property",
@@ -26551,8 +26553,8 @@ Actual: ` + p3.attribValue
26551
26553
  const i3 = new File([v], m.name, { type: v.type }), d = URL.createObjectURL(i3);
26552
26554
  this.media[m.name] = d;
26553
26555
  }
26554
- else if (!_3 && m.name.startsWith("word/fonts") && m.name !== "word/fonts/") {
26555
- const v = await m.async("arraybuffer");
26556
+ else if (m.name.startsWith("word/fonts") && m.name !== "word/fonts/") {
26557
+ const v = await m.async("uint8array");
26556
26558
  this.fonts[m.name] = v;
26557
26559
  }
26558
26560
  }
@@ -36690,7 +36692,7 @@ Actual: ` + p3.attribValue
36690
36692
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
36691
36693
  */
36692
36694
  processCollaborationMigrations() {
36693
- if (console.debug("[checkVersionMigrations] Current editor version", "0.10.65"), !this.options.ydoc) return;
36695
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.10.66"), !this.options.ydoc) return;
36694
36696
  let r = this.options.ydoc.getMap("meta").get("version");
36695
36697
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
36696
36698
  const o = ol$1(r) || [], s = this.state.plugins.find((c3) => c3.key.startsWith("y-sync"));
@@ -36723,7 +36725,7 @@ Actual: ` + p3.attribValue
36723
36725
  }
36724
36726
  n.element = n.isHeadless ? null : n.element || document.createElement("div");
36725
36727
  }, $d$1 = function(n) {
36726
- N$1(this, S, Gi$1).call(this), N$1(this, S, Zi$1).call(this), N$1(this, S, ts$1).call(this), N$1(this, S, Qi$1).call(this), N$1(this, S, es$1).call(this), N$1(this, S, Hd$1).call(this), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.on("exception", this.options.onException), N$1(this, S, is$1).call(this), this.initDefaultStyles(), this.setDocumentMode(n.documentMode), !this.options.isHeadless && (this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", N$1(this, S, Ji$1)), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("trackedChangesUpdate", this.options.onTrackedChangesUpdate), this.on("commentsLoaded", this.options.onCommentsLoaded), this.on("commentClick", this.options.onCommentClicked), this.on("commentsUpdate", this.options.onCommentsUpdate), this.on("locked", this.options.onDocumentLocked), this.on("collaborationReady", N$1(this, S, jd$1)), this.on("paginationUpdate", this.options.onPaginationUpdate), this.on("comment-positions", this.options.onCommentLocationsUpdate), this.initializeCollaborationData(), this.options.ydoc || (N$1(this, S, Qn$2).call(this), N$1(this, S, Zn$2).call(this)), window.setTimeout(() => {
36728
+ N$1(this, S, Gi$1).call(this), N$1(this, S, Zi$1).call(this), N$1(this, S, ts$1).call(this), N$1(this, S, Qi$1).call(this), N$1(this, S, es$1).call(this), this.options.isHeadless || N$1(this, S, Hd$1).call(this), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.on("exception", this.options.onException), N$1(this, S, is$1).call(this), this.initDefaultStyles(), this.setDocumentMode(n.documentMode), !this.options.isHeadless && (this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", N$1(this, S, Ji$1)), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("trackedChangesUpdate", this.options.onTrackedChangesUpdate), this.on("commentsLoaded", this.options.onCommentsLoaded), this.on("commentClick", this.options.onCommentClicked), this.on("commentsUpdate", this.options.onCommentsUpdate), this.on("locked", this.options.onDocumentLocked), this.on("collaborationReady", N$1(this, S, jd$1)), this.on("paginationUpdate", this.options.onPaginationUpdate), this.on("comment-positions", this.options.onCommentLocationsUpdate), this.initializeCollaborationData(), this.options.ydoc || (N$1(this, S, Qn$2).call(this), N$1(this, S, Zn$2).call(this)), window.setTimeout(() => {
36727
36729
  this.isDestroyed || this.emit("create", { editor: this });
36728
36730
  }, 0));
36729
36731
  }, Xi$1 = function(n) {
@@ -69970,7 +69972,7 @@ ${style2}
69970
69972
  this.config.colors = shuffleArray(this.config.colors);
69971
69973
  this.userColorMap = /* @__PURE__ */ new Map();
69972
69974
  this.colorIndex = 0;
69973
- this.version = "0.10.65";
69975
+ this.version = "0.10.66";
69974
69976
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
69975
69977
  this.superdocId = config.superdocId || v4();
69976
69978
  this.colors = this.config.colors;