filens-preview 0.1.4 → 0.3.0
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.
- package/README.md +152 -30
- package/dist/all-in-one/THIRD-PARTY-NOTICES.txt +969 -0
- package/dist/all-in-one/archive/7zz.wasm +0 -0
- package/dist/all-in-one/assets/archive-worker-Cy3bEdVg.js +2 -0
- package/dist/all-in-one/filens.js +71714 -63448
- package/dist/all-in-one/index.html +12 -3
- package/dist/index.d.ts +9 -0
- package/dist/split/THIRD-PARTY-NOTICES.txt +969 -0
- package/dist/split/archive/7zz.wasm +0 -0
- package/dist/split/assets/archive-worker-Cy3bEdVg.js +2 -0
- package/dist/split/assets/iwork-worker-B9KPoDW3.js +27 -0
- package/dist/split/chunks/archive-B4jVwD9o.js +921 -0
- package/dist/split/chunks/{cad-CsU3TiHK.js → cad-DMg-lGJX.js} +1 -1
- package/dist/split/chunks/{core-BvtuMqS1.js → core--zVW212C.js} +4692 -4213
- package/dist/split/chunks/{diagram-BxRNHzmO.js → diagram-CDwCA6LZ.js} +2 -2
- package/dist/split/chunks/{docx-Ch1AvEUX.js → docx-CuQfFJqr.js} +2 -2
- package/dist/split/chunks/{ebook-P42eILp5.js → ebook-CLlJ8KX3.js} +2 -2
- package/dist/split/chunks/{iwork-HnghW_EB.js → iwork-dNVC0X8j.js} +57 -57
- package/dist/split/chunks/media-runtime-gcsBQMuo.js +48 -0
- package/dist/split/chunks/{mindmap-vFlOJSIq.js → mindmap-g0-VoK-K.js} +2 -2
- package/dist/split/chunks/{model3d-DoNu7iyY.js → model3d-1G1CC52V.js} +3 -3
- package/dist/split/chunks/{panorama-Bw_8HQsv.js → panorama-D7GVivtM.js} +1005 -989
- package/dist/split/chunks/{vendor-Cv2Fxtsf.js → vendor-DPFNKNkh.js} +27630 -22859
- package/dist/split/chunks/{xlsx-ypLtJxeq.js → xlsx-Co26yo-R.js} +2 -2
- package/dist/split/converter-core.wasm +0 -0
- package/dist/split/converter-office.wasm +0 -0
- package/dist/split/filens.js +4133 -1301
- package/dist/split/index.html +12 -3
- package/package.json +2 -2
- package/dist/split/assets/iwork-worker-D64s_rsm.js +0 -34
- package/dist/split/chunks/archive-Drem4a-o.js +0 -731
- package/dist/split/chunks/media-runtime-kbzoW8bd.js +0 -48
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
2
|
var R = (e, t, r) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var f = (e, t, r) => R(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { c as G } from "./core
|
|
5
|
-
import { J as Y, i as W, a as H, s as j } from "./vendor-
|
|
4
|
+
import { c as G } from "./core--zVW212C.js";
|
|
5
|
+
import { J as Y, i as W, a as H, s as j } from "./vendor-DPFNKNkh.js";
|
|
6
6
|
const q = [
|
|
7
7
|
{
|
|
8
8
|
extensions: ["drawio", "dio", "vdx", "vsdx"],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
2
|
var H = (o, s, t) => s in o ? A(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
3
|
var v = (o, s, t) => H(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import { h as R, i as B,
|
|
4
|
+
import { am as j, an as k } from "./vendor-DPFNKNkh.js";
|
|
5
|
+
import { h as R, i as B, y as E, f as U, a as T, k as W, v as _, c as z, b as I } from "./core--zVW212C.js";
|
|
6
6
|
const x = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
async function X(o, s) {
|
|
8
8
|
var r, c;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var q = Object.defineProperty;
|
|
2
2
|
var G = (t, e, r) => e in t ? q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var T = (t, e, r) => G(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { J as N } from "./vendor-
|
|
5
|
-
import { c as Z } from "./core
|
|
4
|
+
import { J as N } from "./vendor-DPFNKNkh.js";
|
|
5
|
+
import { c as Z } from "./core--zVW212C.js";
|
|
6
6
|
async function W(t, e) {
|
|
7
7
|
const r = [];
|
|
8
8
|
for (let i = 0; i < t.length; ) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (e, t, n) =>
|
|
4
|
-
import { M as se, r as we, c as pe, b as be, a as J, d as ve, e as K, f as Z, g as ke } from "./core
|
|
5
|
-
import { R as j, c as Se, a as ye } from "./xlsx-
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var me = (e, t, n) => t in e ? ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var S = (e, t, n) => me(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { M as se, r as we, c as pe, b as be, a as J, d as ve, e as K, f as Z, g as ke } from "./core--zVW212C.js";
|
|
5
|
+
import { R as j, c as Se, a as ye } from "./xlsx-Co26yo-R.js";
|
|
6
6
|
async function Ee(e, t = {}) {
|
|
7
7
|
if (q(t.signal), typeof e == "string") {
|
|
8
8
|
const n = await fetch(e, {
|
|
@@ -75,7 +75,7 @@ class Le {
|
|
|
75
75
|
if (this.destroyed) throw new Error("iWork parser worker has been destroyed.");
|
|
76
76
|
return this.worker ? this.worker : (this.worker = new Worker(new URL(
|
|
77
77
|
/* @vite-ignore */
|
|
78
|
-
"" + new URL("../assets/iwork-worker-
|
|
78
|
+
"" + new URL("../assets/iwork-worker-B9KPoDW3.js", import.meta.url).href,
|
|
79
79
|
import.meta.url
|
|
80
80
|
), {
|
|
81
81
|
type: "module"
|
|
@@ -84,8 +84,8 @@ class Le {
|
|
|
84
84
|
parse(t, n, s) {
|
|
85
85
|
this.pending.size && this.cancel();
|
|
86
86
|
const i = ++this.requestId, a = t.buffer instanceof ArrayBuffer && t.byteOffset === 0 && t.byteLength === t.buffer.byteLength ? t.buffer : t.slice().buffer;
|
|
87
|
-
return new Promise((u,
|
|
88
|
-
this.pending.set(i, { resolve: u, reject:
|
|
87
|
+
return new Promise((u, g) => {
|
|
88
|
+
this.pending.set(i, { resolve: u, reject: g }), this.postRequest(
|
|
89
89
|
i,
|
|
90
90
|
{
|
|
91
91
|
kind: "document",
|
|
@@ -146,10 +146,10 @@ function U(e) {
|
|
|
146
146
|
function Q(e, t, n, s) {
|
|
147
147
|
const i = Fe(t, n.slide), a = s ?? new se(i), u = e.createElement("div");
|
|
148
148
|
u.className = t.kind === "numbers" ? "iworkv-page-shell iworkv-sheet-shell" : "iworkv-page-shell";
|
|
149
|
-
const
|
|
149
|
+
const g = we(n.slide, i, {
|
|
150
150
|
mediaRegistry: a
|
|
151
151
|
});
|
|
152
|
-
return u.appendChild(
|
|
152
|
+
return u.appendChild(g), u;
|
|
153
153
|
}
|
|
154
154
|
function Fe(e, t) {
|
|
155
155
|
return e.kind === "key" ? {
|
|
@@ -181,7 +181,7 @@ function Pe(e) {
|
|
|
181
181
|
function Ae(e, t = {}) {
|
|
182
182
|
var G;
|
|
183
183
|
const n = /* @__PURE__ */ new Map(), s = new Le(), i = t.fit === void 0;
|
|
184
|
-
let a = null, u = null,
|
|
184
|
+
let a = null, u = null, g = null, R = 0, v = !1;
|
|
185
185
|
const r = {
|
|
186
186
|
loading: !1,
|
|
187
187
|
error: null,
|
|
@@ -198,7 +198,7 @@ function Ae(e, t = {}) {
|
|
|
198
198
|
e.classList.add("iworkv-root"), e.innerHTML = '<div class="iworkv-stage"></div>';
|
|
199
199
|
const k = e.querySelector(".iworkv-stage");
|
|
200
200
|
let C = null, F = [];
|
|
201
|
-
const
|
|
201
|
+
const B = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Map();
|
|
202
202
|
let N, P = 0;
|
|
203
203
|
const y = (o, h) => {
|
|
204
204
|
var l;
|
|
@@ -210,7 +210,7 @@ function Ae(e, t = {}) {
|
|
|
210
210
|
warnings: r.warnings.slice()
|
|
211
211
|
}), O = () => {
|
|
212
212
|
const o = u;
|
|
213
|
-
u = null, o == null || o.abort(), s.cancel(),
|
|
213
|
+
u = null, o == null || o.abort(), s.cancel(), g == null || g.abort(), g = null, C == null || C.disconnect(), C = null, P && typeof cancelAnimationFrame < "u" && cancelAnimationFrame(P), P = 0, k.replaceChildren(), k.classList.remove("iworkv-numbers-stage"), F = [], B.clear(), L.clear(), D.clear(), a == null || a.destroy(), a = null, Object.assign(r, {
|
|
214
214
|
document: null,
|
|
215
215
|
kind: null,
|
|
216
216
|
loading: !1,
|
|
@@ -223,7 +223,7 @@ function Ae(e, t = {}) {
|
|
|
223
223
|
}), e.scrollTop = 0, e.scrollLeft = 0;
|
|
224
224
|
}, I = () => {
|
|
225
225
|
var h;
|
|
226
|
-
if (
|
|
226
|
+
if (g == null || g.abort(), g = new AbortController(), k.innerHTML = "", k.classList.toggle("iworkv-numbers-stage", ((h = r.document) == null ? void 0 : h.kind) === "numbers"), F = [], B.clear(), L.clear(), !r.document)
|
|
227
227
|
return;
|
|
228
228
|
const o = U(r.document);
|
|
229
229
|
if (o.length) {
|
|
@@ -235,9 +235,9 @@ function Ae(e, t = {}) {
|
|
|
235
235
|
const l = document.createElement("div");
|
|
236
236
|
l.className = "iworkv-pages";
|
|
237
237
|
const c = k.getBoundingClientRect();
|
|
238
|
-
o.forEach((d,
|
|
238
|
+
o.forEach((d, m) => {
|
|
239
239
|
const w = document.createElement("div");
|
|
240
|
-
w.className = "iworkv-page-shell", z(w, d.width, d.height, _(d.width, d.height, c)), w.dataset.pageIndex = String(
|
|
240
|
+
w.className = "iworkv-page-shell", z(w, d.width, d.height, _(d.width, d.height, c)), w.dataset.pageIndex = String(m), l.appendChild(w), F.push(w);
|
|
241
241
|
}), k.appendChild(l), L.add(r.currentPage), V();
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
@@ -251,13 +251,13 @@ function Ae(e, t = {}) {
|
|
|
251
251
|
const h = document.createElement("div");
|
|
252
252
|
h.className = "xlsxv-sheet-tabs", r.document.sheets.forEach((f, M) => {
|
|
253
253
|
const b = document.createElement("button");
|
|
254
|
-
b.type = "button", b.className = "xlsxv-sheet-tab", b.classList.toggle("is-active", M === r.currentSheet), b.textContent = f.name, b.addEventListener("click", () => Y(M), { signal:
|
|
254
|
+
b.type = "button", b.className = "xlsxv-sheet-tab", b.classList.toggle("is-active", M === r.currentSheet), b.textContent = f.name, b.addEventListener("click", () => Y(M), { signal: g.signal }), h.appendChild(b);
|
|
255
255
|
});
|
|
256
256
|
const l = document.createElement("div");
|
|
257
257
|
l.className = "xlsxv-grid";
|
|
258
258
|
const c = document.createElement("div");
|
|
259
259
|
c.className = "iworkv-numbers-tables";
|
|
260
|
-
const d = r.document.sheets[r.currentSheet],
|
|
260
|
+
const d = r.document.sheets[r.currentSheet], m = ((d == null ? void 0 : d.tables) ?? []).map(({ item: f }, M) => {
|
|
261
261
|
const b = Ie(f, M), x = document.createElement("section");
|
|
262
262
|
if (x.className = "iworkv-numbers-table", x.style.containIntrinsicBlockSize = `auto ${(Math.min(Math.max(b.rowCount, 1), j) + 1) * 26}px`, ((d == null ? void 0 : d.tables.length) ?? 0) > 1) {
|
|
263
263
|
const $ = document.createElement("h3");
|
|
@@ -280,33 +280,33 @@ function Ae(e, t = {}) {
|
|
|
280
280
|
}
|
|
281
281
|
l.appendChild(c), l.addEventListener("scroll", () => {
|
|
282
282
|
if (!(l.scrollHeight - l.scrollTop - l.clientHeight > l.clientHeight * 2))
|
|
283
|
-
for (const { sheet: f, item: M, table: b, body: x } of
|
|
283
|
+
for (const { sheet: f, item: M, table: b, body: x } of m) {
|
|
284
284
|
const T = x.rows.length;
|
|
285
285
|
T < f.rowCount && (ye(x, f, T + 1, Math.min(T + j, f.rowCount)), ee(b, M, a));
|
|
286
286
|
}
|
|
287
|
-
}, { passive: !0, signal:
|
|
287
|
+
}, { passive: !0, signal: g.signal }), o.replaceChildren(h, l), k.appendChild(o);
|
|
288
288
|
}, V = () => {
|
|
289
289
|
if (!r.document || r.document.kind === "numbers")
|
|
290
290
|
return;
|
|
291
291
|
const o = U(r.document), l = t.virtual ?? r.document.kind === "pages" ? L : new Set(F.map((c, d) => d));
|
|
292
|
-
for (const [c, d] of
|
|
293
|
-
l.has(c) || (d.remove(),
|
|
292
|
+
for (const [c, d] of B)
|
|
293
|
+
l.has(c) || (d.remove(), B.delete(c));
|
|
294
294
|
for (const c of l) {
|
|
295
|
-
if (
|
|
295
|
+
if (B.has(c))
|
|
296
296
|
continue;
|
|
297
|
-
const d = F[c],
|
|
298
|
-
if (!d || !
|
|
297
|
+
const d = F[c], m = o[c];
|
|
298
|
+
if (!d || !m)
|
|
299
299
|
continue;
|
|
300
|
-
const w = Q(document, r.document,
|
|
301
|
-
w && (d.appendChild(w), z(d,
|
|
300
|
+
const w = Q(document, r.document, m, a ?? void 0).firstElementChild;
|
|
301
|
+
w && (d.appendChild(w), z(d, m.width, m.height, r.scale), B.set(c, w));
|
|
302
302
|
}
|
|
303
303
|
}, H = () => {
|
|
304
304
|
if (P = 0, !r.document || r.document.kind === "numbers" || !F.length)
|
|
305
305
|
return;
|
|
306
|
-
const o =
|
|
306
|
+
const o = De(e), h = (o.top + o.bottom) / 2, l = Math.max(o.height, 1);
|
|
307
307
|
let c = r.currentPage, d = Number.POSITIVE_INFINITY;
|
|
308
|
-
L.clear(), F.forEach((
|
|
309
|
-
const p =
|
|
308
|
+
L.clear(), F.forEach((m, w) => {
|
|
309
|
+
const p = m.getBoundingClientRect();
|
|
310
310
|
p.bottom >= o.top - l && p.top <= o.bottom + l && L.add(w);
|
|
311
311
|
const f = Math.abs((p.top + p.bottom) / 2 - h);
|
|
312
312
|
f < d && (d = f, c = w);
|
|
@@ -330,8 +330,8 @@ function Ae(e, t = {}) {
|
|
|
330
330
|
}, _ = (o, h, l) => {
|
|
331
331
|
if (r.fit === "none")
|
|
332
332
|
return r.scale;
|
|
333
|
-
const c = l ?? k.getBoundingClientRect(), d = Math.max(c.width - 32, 1),
|
|
334
|
-
return r.fit === "width" ? (r.scale = d / Math.max(o, 1), r.scale) : r.fit === "height" ? (r.scale =
|
|
333
|
+
const c = l ?? k.getBoundingClientRect(), d = Math.max(c.width - 32, 1), m = Math.max(c.height - 32, 1);
|
|
334
|
+
return r.fit === "width" ? (r.scale = d / Math.max(o, 1), r.scale) : r.fit === "height" ? (r.scale = m / Math.max(h, 1), r.scale) : (r.scale = Math.min(d / Math.max(o, 1), m / Math.max(h, 1)), r.scale);
|
|
335
335
|
}, le = () => {
|
|
336
336
|
C == null || C.disconnect(), C = null, !(typeof ResizeObserver > "u") && (C = new ResizeObserver(() => {
|
|
337
337
|
var h;
|
|
@@ -354,21 +354,21 @@ function Ae(e, t = {}) {
|
|
|
354
354
|
}, ce = (o) => {
|
|
355
355
|
var c, d;
|
|
356
356
|
const h = ((c = r.document) == null ? void 0 : c.kind) === "numbers" ? r.document : null;
|
|
357
|
-
if (!h || ((d = h.sheets[o]) == null ? void 0 : d.loaded) !== !1 || (r.currentSheet === o && (e.classList.add("is-loading"), e.dataset.status = "Loading sheet..."),
|
|
357
|
+
if (!h || ((d = h.sheets[o]) == null ? void 0 : d.loaded) !== !1 || (r.currentSheet === o && (e.classList.add("is-loading"), e.dataset.status = "Loading sheet..."), D.has(o)))
|
|
358
358
|
return;
|
|
359
|
-
const l = s.parseSheet(o).then((
|
|
360
|
-
r.document === h && (h.sheets[o] =
|
|
361
|
-
}).catch((
|
|
359
|
+
const l = s.parseSheet(o).then((m) => {
|
|
360
|
+
r.document === h && (h.sheets[o] = m, r.currentSheet === o && (I(), A()), y("sheetchange", E()));
|
|
361
|
+
}).catch((m) => {
|
|
362
362
|
if (r.document !== h)
|
|
363
363
|
return;
|
|
364
|
-
const w =
|
|
364
|
+
const w = m instanceof Error ? m : new Error(String(m));
|
|
365
365
|
r.currentSheet === o && (r.error = w.message, A(), y("error", w));
|
|
366
366
|
}).finally(() => {
|
|
367
|
-
|
|
367
|
+
D.get(o) === l && D.delete(o);
|
|
368
368
|
});
|
|
369
|
-
|
|
369
|
+
D.set(o, l);
|
|
370
370
|
}, de = async (o, h = {}) => {
|
|
371
|
-
var
|
|
371
|
+
var m, w;
|
|
372
372
|
if (v) throw new Error("iWork viewer has been destroyed.");
|
|
373
373
|
const l = ++R;
|
|
374
374
|
O();
|
|
@@ -377,7 +377,7 @@ function Ae(e, t = {}) {
|
|
|
377
377
|
const d = () => {
|
|
378
378
|
u === c && (O(), A(), y("loadingchange", E()));
|
|
379
379
|
};
|
|
380
|
-
if ((
|
|
380
|
+
if ((m = h.signal) == null || m.addEventListener("abort", d, { once: !0 }), c.signal.addEventListener("abort", () => {
|
|
381
381
|
var p;
|
|
382
382
|
return (p = h.signal) == null ? void 0 : p.removeEventListener("abort", d);
|
|
383
383
|
}, { once: !0 }), (w = h.signal) != null && w.aborted)
|
|
@@ -388,7 +388,7 @@ function Ae(e, t = {}) {
|
|
|
388
388
|
if (c.signal.aborted) throw new DOMException("The operation was aborted.", "AbortError");
|
|
389
389
|
const f = await X(s.parse(p, t.type, Re(o)), c.signal);
|
|
390
390
|
if (c.signal.aborted) throw new DOMException("The operation was aborted.", "AbortError");
|
|
391
|
-
if (r.document = f, r.kind = f.kind, r.warnings = f.warnings.slice(), i && (f.kind === "key" || f.kind === "pages") && r.fit === "contain" && (r.fit = "width"), r.currentPage = 0, r.currentSheet = 0,
|
|
391
|
+
if (r.document = f, r.kind = f.kind, r.warnings = f.warnings.slice(), i && (f.kind === "key" || f.kind === "pages") && r.fit === "contain" && (r.fit = "width"), r.currentPage = 0, r.currentSheet = 0, D.clear(), r.pageCount = f.kind === "numbers" ? 0 : f.kind === "key" ? f.slides.length : f.pages.length, r.sheetCount = f.kind === "numbers" ? f.sheets.length : 0, a == null || a.destroy(), a = Te(f), r.loading = !1, I(), le(), A(), y("loadingchange", E()), u !== c) return;
|
|
392
392
|
y("warnings", r.warnings), u === c && y("rendered", E());
|
|
393
393
|
} catch (p) {
|
|
394
394
|
if (v || R !== l) return;
|
|
@@ -425,8 +425,8 @@ function Ae(e, t = {}) {
|
|
|
425
425
|
N = void 0;
|
|
426
426
|
}
|
|
427
427
|
e.scrollTop = o, e.scrollLeft = h;
|
|
428
|
-
const
|
|
429
|
-
|
|
428
|
+
const m = k.querySelector(".xlsxv-grid");
|
|
429
|
+
m && (m.scrollTop = c, m.scrollLeft = d), y("rendered", E());
|
|
430
430
|
},
|
|
431
431
|
destroy() {
|
|
432
432
|
var o;
|
|
@@ -464,7 +464,7 @@ function Ie(e, t) {
|
|
|
464
464
|
ref: `${i}:${s.column + 1}`,
|
|
465
465
|
row: i,
|
|
466
466
|
column: s.column + 1,
|
|
467
|
-
value: s.textFrame.paragraphs.map((u) => u.runs.map((
|
|
467
|
+
value: s.textFrame.paragraphs.map((u) => u.runs.map((g) => g.text).join("")).join(`
|
|
468
468
|
`)
|
|
469
469
|
}), n.set(i, a);
|
|
470
470
|
}
|
|
@@ -485,17 +485,17 @@ function ee(e, t, n) {
|
|
|
485
485
|
const u = (i = (s = e.tBodies[0]) == null ? void 0 : s.rows[a.row]) == null ? void 0 : i.cells[a.column + 1];
|
|
486
486
|
if (!u || u.querySelector(".iworkv-cell-image"))
|
|
487
487
|
continue;
|
|
488
|
-
const
|
|
489
|
-
|
|
488
|
+
const g = document.createElement("img");
|
|
489
|
+
g.className = "iworkv-cell-image", g.src = n.getUrl(a.fill.mediaId), g.alt = "", g.loading = "lazy", u.prepend(g);
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
function Re(e) {
|
|
493
493
|
if (typeof e == "string")
|
|
494
|
-
return
|
|
494
|
+
return Be(e);
|
|
495
495
|
if (typeof File < "u" && e instanceof File)
|
|
496
496
|
return e.name;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Be(e) {
|
|
499
499
|
var i;
|
|
500
500
|
const s = (((i = e.split("?")[0]) == null ? void 0 : i.split("#")[0]) ?? "").split(/[\\/]/).filter(Boolean).at(-1);
|
|
501
501
|
if (s)
|
|
@@ -505,15 +505,15 @@ function De(e) {
|
|
|
505
505
|
return s;
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function De(e) {
|
|
509
509
|
const t = e.ownerDocument.defaultView, n = e.getBoundingClientRect();
|
|
510
510
|
let s = t ? 0 : n.top, i = t ? t.innerHeight : n.bottom;
|
|
511
511
|
for (let a = e; a; a = a.parentElement) {
|
|
512
512
|
const u = (t == null ? void 0 : t.getComputedStyle(a).overflowY) ?? "visible";
|
|
513
513
|
if (!/^(auto|scroll|hidden|clip)$/.test(u))
|
|
514
514
|
continue;
|
|
515
|
-
const
|
|
516
|
-
s = Math.max(s,
|
|
515
|
+
const g = a.getBoundingClientRect();
|
|
516
|
+
s = Math.max(s, g.top), i = Math.min(i, g.bottom);
|
|
517
517
|
}
|
|
518
518
|
if (i <= s) {
|
|
519
519
|
const a = t ? 0 : n.top, u = t ? t.innerHeight : n.bottom;
|
|
@@ -675,14 +675,14 @@ class We {
|
|
|
675
675
|
!t && this.host.requestFullscreen && await this.host.requestFullscreen();
|
|
676
676
|
}
|
|
677
677
|
updateState(t) {
|
|
678
|
-
const n = t.document, s = n ? n.kind === "key" ? n.presentation.slides : n.kind === "pages" ? n.pages.map((u) => u.canvas.slide) : n.sheets.map((u) => u.canvas.slide) : [], i = (n == null ? void 0 : n.kind) === "numbers" ? n.sheets.flatMap((u) => u.tables.map((
|
|
679
|
-
if (n !== this.fontDocument || a.length !== this.fontScenes.length || a.some((u,
|
|
678
|
+
const n = t.document, s = n ? n.kind === "key" ? n.presentation.slides : n.kind === "pages" ? n.pages.map((u) => u.canvas.slide) : n.sheets.map((u) => u.canvas.slide) : [], i = (n == null ? void 0 : n.kind) === "numbers" ? n.sheets.flatMap((u) => u.tables.map((g) => g.item)) : [], a = [...s, ...i];
|
|
679
|
+
if (n !== this.fontDocument || a.length !== this.fontScenes.length || a.some((u, g) => u !== this.fontScenes[g])) {
|
|
680
680
|
this.fontDocument = n, this.fontScenes = a;
|
|
681
|
-
const u = i.length ? [{ items: i }] : [],
|
|
681
|
+
const u = i.length ? [{ items: i }] : [], g = ke([...s, ...u]);
|
|
682
682
|
if (this.fontUpdate) {
|
|
683
683
|
const R = new Map(this.fontUpdate.references.map((v) => [v.fontFamily, v]));
|
|
684
|
-
this.fontAnalysis = Z({ ...this.fontUpdate, references:
|
|
685
|
-
} else this.fontAnalysis = J(
|
|
684
|
+
this.fontAnalysis = Z({ ...this.fontUpdate, references: g.map((v) => R.get(v.fontFamily) ?? v) }, this.host.ownerDocument), K([...s, ...u], this.fontUpdate.references);
|
|
685
|
+
} else this.fontAnalysis = J(g, this.host.ownerDocument);
|
|
686
686
|
}
|
|
687
687
|
this.lastState = {
|
|
688
688
|
...ne(t),
|