@harbour-enterprises/superdoc 0.10.64 → 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-DrbFuM-S.es.js";
2
- import { P as Ib, b as Cb, e as fb } from "./chunks/super-editor.es-DrbFuM-S.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.64", 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;
@@ -23834,7 +23834,10 @@ Actual: ` + p3.attribValue
23834
23834
  const Ap$1 = (r22, e, t) => {
23835
23835
  const i3 = r22["word/_rels/document.xml.rels"].elements.find((g) => g.name === "Relationships"), { elements: s } = i3, o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", a = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", u = s.filter((g) => g.attributes.Type === o), f3 = s.filter((g) => g.attributes.Type === a), h3 = (Eu$2(r22["word/document.xml"]) || []).flatMap((g) => g.elements);
23836
23836
  u.forEach((g) => {
23837
- const { rId: v, referenceFile: A, currentFileName: E3 } = qo$1(g, r22), w = h3.find((D3) => D3.name === "w:headerReference" && D3.attributes["r:id"] === v)?.attributes["w:type"], B = Jt$2(), R = B.handler({
23837
+ const { rId: v, referenceFile: A, currentFileName: E3 } = qo$1(g, r22);
23838
+ let w = h3.find((D3) => D3.name === "w:headerReference" && D3.attributes["r:id"] === v)?.attributes["w:type"];
23839
+ e.headerIds[w] && (w = null);
23840
+ const B = Jt$2(), R = B.handler({
23838
23841
  nodes: A.elements[0].elements,
23839
23842
  nodeListHandler: B,
23840
23843
  docx: r22,
@@ -23842,7 +23845,7 @@ Actual: ` + p3.attribValue
23842
23845
  editor: t,
23843
23846
  filename: E3
23844
23847
  });
23845
- e.headerIds.ids || (e.headerIds.ids = []), e.headerIds.ids.push(v), e.headers[v] = { type: "doc", content: [...R] }, e.headerIds[w] = v;
23848
+ e.headerIds.ids || (e.headerIds.ids = []), e.headerIds.ids.push(v), e.headers[v] = { type: "doc", content: [...R] }, w && (e.headerIds[w] = v);
23846
23849
  }), f3.forEach((g) => {
23847
23850
  const { rId: v, referenceFile: A, currentFileName: E3 } = qo$1(g, r22), w = h3.find((D3) => D3.name === "w:footerReference" && D3.attributes["r:id"] === v)?.attributes["w:type"], B = Jt$2(), R = B.handler({
23848
23851
  nodes: A.elements[0].elements,
@@ -23916,7 +23919,7 @@ Actual: ` + p3.attribValue
23916
23919
  return;
23917
23920
  }
23918
23921
  }
23919
- static updateDocumentVersion(e = this.convertedXml, t = "0.10.64") {
23922
+ static updateDocumentVersion(e = this.convertedXml, t = "0.10.66") {
23920
23923
  const n = "docProps/custom.xml";
23921
23924
  e[n] || (e[n] = Fu$2());
23922
23925
  const i3 = e["docProps/custom.xml"];
@@ -23965,18 +23968,20 @@ Actual: ` + p3.attribValue
23965
23968
  }, []), o = this.convertedXml["word/_rels/fontTable.xml.rels"]?.elements.find((f3) => f3.name === "Relationships") || {}, { elements: a } = o;
23966
23969
  let u = "";
23967
23970
  for (const f3 of i3) {
23968
- 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;
23969
23972
  if (!l) return;
23970
- const h3 = Vf$1(this.fonts[`word/${l}`], f3.attributes["w:fontKey"]);
23971
- if (!h3) return;
23972
- 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");
23973
23978
  u += `
23974
23979
  @font-face {
23975
- font-style: ${F3 ? "italic" : "normal"};
23976
- 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"};
23977
23982
  font-display: swap;
23978
23983
  font-family: ${f3.fontFamily};
23979
- src: url(${v}) format('truetype');
23984
+ src: url(${E3}) format('truetype');
23980
23985
  }
23981
23986
  `;
23982
23987
  }
@@ -24177,7 +24182,7 @@ Actual: ` + p3.attribValue
24177
24182
  function Fu$2() {
24178
24183
  return Gf$2;
24179
24184
  }
24180
- function Bu$2(r22 = 2, e = "0.10.64") {
24185
+ function Bu$2(r22 = 2, e = "0.10.66") {
24181
24186
  return {
24182
24187
  type: "element",
24183
24188
  name: "property",
@@ -26548,8 +26553,8 @@ Actual: ` + p3.attribValue
26548
26553
  const i3 = new File([v], m.name, { type: v.type }), d = URL.createObjectURL(i3);
26549
26554
  this.media[m.name] = d;
26550
26555
  }
26551
- else if (!_3 && m.name.startsWith("word/fonts") && m.name !== "word/fonts/") {
26552
- 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");
26553
26558
  this.fonts[m.name] = v;
26554
26559
  }
26555
26560
  }
@@ -36687,7 +36692,7 @@ Actual: ` + p3.attribValue
36687
36692
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
36688
36693
  */
36689
36694
  processCollaborationMigrations() {
36690
- if (console.debug("[checkVersionMigrations] Current editor version", "0.10.64"), !this.options.ydoc) return;
36695
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.10.66"), !this.options.ydoc) return;
36691
36696
  let r = this.options.ydoc.getMap("meta").get("version");
36692
36697
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
36693
36698
  const o = ol$1(r) || [], s = this.state.plugins.find((c3) => c3.key.startsWith("y-sync"));
@@ -36720,7 +36725,7 @@ Actual: ` + p3.attribValue
36720
36725
  }
36721
36726
  n.element = n.isHeadless ? null : n.element || document.createElement("div");
36722
36727
  }, $d$1 = function(n) {
36723
- 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(() => {
36724
36729
  this.isDestroyed || this.emit("create", { editor: this });
36725
36730
  }, 0));
36726
36731
  }, Xi$1 = function(n) {
@@ -69967,7 +69972,7 @@ ${style2}
69967
69972
  this.config.colors = shuffleArray(this.config.colors);
69968
69973
  this.userColorMap = /* @__PURE__ */ new Map();
69969
69974
  this.colorIndex = 0;
69970
- this.version = "0.10.64";
69975
+ this.version = "0.10.66";
69971
69976
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
69972
69977
  this.superdocId = config.superdocId || v4();
69973
69978
  this.colors = this.config.colors;