@harbour-enterprises/superdoc 0.11.35 → 0.11.36

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 { Y as md, g as yd, c as bd, n as jo, F as Wo, H as wd, x as Sd, D as Dd, M as vd, a as Fd } from "./chunks/super-editor.es-Doc0izWg.es.js";
2
- import { O as Ib, X as Cb, R as fb } from "./chunks/super-editor.es-Doc0izWg.es.js";
1
+ import { Y as md, g as yd, c as bd, n as jo, F as Wo, H as wd, x as Sd, D as Dd, M as vd, a as Fd } from "./chunks/super-editor.es-DVRw0qaN.es.js";
2
+ import { O as Ib, X as Cb, R as fb } from "./chunks/super-editor.es-DVRw0qaN.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, D as dt, i as ht, q as ji, l as wt, y as Fe, a1 as kd, N as Zt, u as qt, a2 as xd, a3 as Rd, a4 as Xo, g as Ji, K as Us, O as jr, j as Ii, k as Di, h as da, U as Nd, s as Md, A as Wr, F as jt, R as GA, m as Ct, E as mi, I as ms, C as re, V as Ld, S as Gd, W as Td, J as qi, P as Es, G as ar, Q as Ud, H as Hd, T as Pd, b as ye, o as fe, t as yi, x as bi, z as zl, f as We, B as ri, e as Ze, v 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-DKS68Dra.es.js";
4
4
  import { B as qn } from "./chunks/jszip-OpmRHhd4.es.js";
5
5
  import { B as Yd } from "./chunks/blank-docx-BRvkcuiv.es.js";
@@ -32713,7 +32713,7 @@ class hb extends eg {
32713
32713
  this.config = {
32714
32714
  ...this.config,
32715
32715
  ...t
32716
- }, this.config.colors = NI(this.config.colors), this.userColorMap = /* @__PURE__ */ new Map(), this.colorIndex = 0, this.version = "0.11.35", 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);
32716
+ }, this.config.colors = NI(this.config.colors), this.userColorMap = /* @__PURE__ */ new Map(), this.colorIndex = 0, this.version = "0.11.36", 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);
32717
32717
  }
32718
32718
  get requiredNumberOfEditors() {
32719
32719
  return this.superdocStore.documents.filter((t) => t.type === on).length;
@@ -18415,19 +18415,26 @@ Actual: ` + p3.attribValue
18415
18415
  if (r22 != null)
18416
18416
  return r22 * 20;
18417
18417
  }
18418
- const qf$1 = async (r22) => {
18419
- const e = r22.includes(",") ? r22.split(",", 2)[1] : r22;
18420
- if (typeof globalThis.atob == "function") {
18421
- const n = globalThis.atob(e), i3 = n.length, s = new Uint8Array(i3);
18422
- for (let o = 0; o < i3; o++)
18423
- s[o] = n.charCodeAt(o);
18424
- return s.buffer;
18425
- }
18426
- const t = St$2.from(e, "base64");
18427
- return t.buffer.slice(
18428
- t.byteOffset,
18429
- t.byteOffset + t.byteLength
18430
- );
18418
+ const qf$1 = async (r22, e) => {
18419
+ const t = /^https?:|^blob:|^file:|^data:/i.test(r22);
18420
+ if (e && t && typeof fetch == "function") {
18421
+ const s = await fetch(r22);
18422
+ if (!s.ok) throw new Error(`Fetch failed: ${s.status} ${s.statusText}`);
18423
+ return await s.arrayBuffer();
18424
+ }
18425
+ const n = r22.includes(",") ? r22.split(",", 2)[1] : r22.trim().replace(/\s/g, "");
18426
+ try {
18427
+ if (typeof globalThis.atob == "function") {
18428
+ const s = globalThis.atob(n), o = new Uint8Array(s.length);
18429
+ for (let a = 0; a < s.length; a++)
18430
+ o[a] = s.charCodeAt(a);
18431
+ return o.buffer;
18432
+ }
18433
+ } catch (s) {
18434
+ console.warn("atob failed, falling back to Buffer:", s);
18435
+ }
18436
+ const i3 = St$2.from(n, "base64");
18437
+ return i3.buffer.slice(i3.byteOffset, i3.byteOffset + i3.byteLength);
18431
18438
  }, Kp$1 = (r22) => {
18432
18439
  const n = new window.DOMParser().parseFromString(r22, "text/xml").querySelectorAll("Default");
18433
18440
  return Array.from(n).map((i3) => i3.getAttribute("Extension"));
@@ -24148,7 +24155,7 @@ Actual: ` + p3.attribValue
24148
24155
  return;
24149
24156
  }
24150
24157
  }
24151
- static updateDocumentVersion(e = this.convertedXml, t = "0.11.35") {
24158
+ static updateDocumentVersion(e = this.convertedXml, t = "0.11.36") {
24152
24159
  const n = "docProps/custom.xml";
24153
24160
  e[n] || (e[n] = Fu$2());
24154
24161
  const i3 = e["docProps/custom.xml"];
@@ -24270,7 +24277,7 @@ Actual: ` + p3.attribValue
24270
24277
  ...n,
24271
24278
  ...h3.media,
24272
24279
  ...this.media
24273
- });
24280
+ }, a);
24274
24281
  let A3 = { ...this.convertedXml }, v = [];
24275
24282
  if (o.length) {
24276
24283
  const { documentXml: F, relationships: w } = Ke(this, it$2, Cu$2).call(this, {
@@ -24335,17 +24342,17 @@ Actual: ` + p3.attribValue
24335
24342
  const u = a.attributes.Id, c3 = n.elements.find((h3) => h3.attributes.Target === a.attributes.Target), l = a.attributes.Target?.startsWith("media/") && u.length > 6;
24336
24343
  c3 && !l || (a.attributes.Target = a.attributes?.Target?.replace(/&/g, "&amp;"), a.attributes.Id = u.length > 6 ? u : `rId${++o}`, i3.push(a));
24337
24344
  }), n.elements = [...n.elements, ...i3], this.convertedXml["word/_rels/document.xml.rels"] = t;
24338
- }, Tu$2 = async function(e) {
24339
- const t = {};
24340
- for (const n in e) {
24341
- if (typeof e[n] != "string") return;
24342
- const i3 = n.split("/").pop();
24343
- t[i3] = await qf$1(e[n]);
24345
+ }, Tu$2 = async function(e, t) {
24346
+ const n = {};
24347
+ for (const i3 in e) {
24348
+ if (typeof e[i3] != "string") return;
24349
+ const s = i3.split("/").pop();
24350
+ n[s] = await qf$1(e[i3], t.options.isHeadless);
24344
24351
  }
24345
24352
  this.convertedXml.media = {
24346
24353
  ...this.convertedXml.media,
24347
- ...t
24348
- }, this.media = this.convertedXml.media, this.addedMedia = t;
24354
+ ...n
24355
+ }, this.media = this.convertedXml.media, this.addedMedia = n;
24349
24356
  }, Mt$1(pt$1, "allowedElements", Object.freeze({
24350
24357
  "w:document": "doc",
24351
24358
  "w:body": "body",
@@ -24411,7 +24418,7 @@ Actual: ` + p3.attribValue
24411
24418
  function Fu$2() {
24412
24419
  return Gf$1;
24413
24420
  }
24414
- function Bu$2(r22 = 2, e = "0.11.35") {
24421
+ function Bu$2(r22 = 2, e = "0.11.36") {
24415
24422
  return {
24416
24423
  type: "element",
24417
24424
  name: "property",
@@ -37209,7 +37216,7 @@ Actual: ` + p3.attribValue
37209
37216
  * @returns {Object | void} Migration results
37210
37217
  */
37211
37218
  processCollaborationMigrations() {
37212
- if (console.debug("[checkVersionMigrations] Current editor version", "0.11.35"), !this.options.ydoc) return;
37219
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.11.36"), !this.options.ydoc) return;
37213
37220
  let r = this.options.ydoc.getMap("meta").get("version");
37214
37221
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
37215
37222
  const o = hl$1(r) || [], s = this.state.plugins.find((c3) => c3.key.startsWith("y-sync"));
@@ -71486,7 +71493,7 @@ ${style2}
71486
71493
  this.config.colors = shuffleArray(this.config.colors);
71487
71494
  this.userColorMap = /* @__PURE__ */ new Map();
71488
71495
  this.colorIndex = 0;
71489
- this.version = "0.11.35";
71496
+ this.version = "0.11.36";
71490
71497
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
71491
71498
  this.superdocId = config.superdocId || v4();
71492
71499
  this.colors = this.config.colors;