@silurus/ooxml 0.86.0 → 0.86.1
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/dist/assets/render-worker-D21h5TGR.js +10 -0
- package/dist/assets/render-worker-Dsfekaht.js +11 -0
- package/dist/assets/{render-worker-CB4DxjXg.js → render-worker-DxU7IrKo.js} +18 -18
- package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
- package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
- package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-lXwVOgjW.js} +1 -1
- package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-uopDjRde.js} +4501 -4456
- package/dist/{docx-DzDiGvqe.js → docx-wPzeF76A.js} +492 -307
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
- package/dist/{hyperlink-enyPbflR.js → hyperlink-BR1NCO7S.js} +934 -885
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-IsUGfHXm.js +1023 -0
- package/dist/node.mjs +272 -272
- package/dist/{pptx-D_U62nl-.js → pptx-BxJ_RBSY.js} +169 -161
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DSn0d35X.js → render-DEiun_AH.js} +1 -1
- package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-BEfLZvSL.js} +1 -1
- package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-Ba6Fchqr.js} +1 -1
- package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-C3xwtHnv.js} +1 -1
- package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CclArDRs.js} +9 -9
- package/dist/{session-C1GYhr6n.js → session-BuJL_xcp.js} +87 -87
- package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-Ck8wfRT_.js} +977 -903
- package/dist/types/docx.d.ts +1 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-CAvuf22q.js} +78 -78
- package/dist/{xlsx-CMHmYTHP.js → xlsx-Bblm5r1h.js} +574 -574
- package/dist/xlsx.mjs +5 -5
- package/package.json +1 -1
- package/dist/assets/render-worker-BCGnuBLj.js +0 -10
- package/dist/assets/render-worker-CHW0F0n6.js +0 -11
- package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
- package/dist/line-distribute-BFB575d6.js +0 -1023
- /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-CqejEuts.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, r as l, s as u, t as d, u as f } from "./slide-pull-client-
|
|
3
|
-
import { $ as p,
|
|
4
|
-
import { C as
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import { l as Ne, s as Pe } from "./pixel-budget-Dgjw269h.js";
|
|
2
|
+
import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, r as l, s as u, t as d, u as f } from "./slide-pull-client-Ck8wfRT_.js";
|
|
3
|
+
import { $ as p, Jt as m, L as h, R as g, U as _, W as v, Zt as y, _t as b, cn as x, et as S, ft as C, lt as w, r as T, sn as ee, z as te } from "./hyperlink-BR1NCO7S.js";
|
|
4
|
+
import { C as ne, D as re, M as ie, N as ae, O as oe, S as se, T as ce, _ as le, a as E, b as ue, c as D, d as de, f as fe, g as pe, h as me, i as O, l as k, m as he, n as ge, o as _e, p as ve, r as ye, s as be, t as xe, v as Se, w as Ce, x as we, y as A } from "./canvas-viewer-mechanics-DN5SqWGS.js";
|
|
5
|
+
import { a as Te, d as j, i as Ee, n as De, r as Oe, t as ke, u as Ae } from "./dom-interaction-boundary-CswB9Tzi.js";
|
|
6
|
+
import { l as je, s as Me } from "./pixel-budget-Dgjw269h.js";
|
|
8
7
|
import { i as M } from "./units-EJdC96r6.js";
|
|
9
|
-
import { i as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as
|
|
14
|
-
import { t as
|
|
8
|
+
import { i as Ne, s as Pe } from "./raster-target-ojDdQizC.js";
|
|
9
|
+
import { n as Fe } from "./resource-measurement-CclArDRs.js";
|
|
10
|
+
import { n as Ie } from "./renderer-module-contract-Cu-GKuPd.js";
|
|
11
|
+
import { t as Le } from "./visible-index-DPoQYSDt.js";
|
|
12
|
+
import { n as Re, t as N } from "./highlight-rect-FuUSmL3a.js";
|
|
13
|
+
import { n as ze, t as Be } from "./bounded-raw-part-cache-BfbSxRIL.js";
|
|
14
|
+
import { t as P } from "./comment-occurrence-CqejEuts.js";
|
|
15
15
|
//#region packages/core/src/nav/internal-target.ts
|
|
16
16
|
function Ve(e, t) {
|
|
17
17
|
let n = t.startsWith("/") ? [] : e.split("/").filter((e) => e !== "");
|
|
@@ -90,7 +90,7 @@ function L(e, t, n, r, i, a, o = {}) {
|
|
|
90
90
|
for (let r of e.slices) {
|
|
91
91
|
let e = t[r.runIndex];
|
|
92
92
|
if (!e) continue;
|
|
93
|
-
let i = a(e.font), { x: o, width: s } =
|
|
93
|
+
let i = a(e.font), { x: o, width: s } = Re(e.text, r.start, r.end, i);
|
|
94
94
|
if (s <= 0) continue;
|
|
95
95
|
let c = u(e), l = document.createElement("div");
|
|
96
96
|
l.style.cssText = `position:absolute;left:${N(e.inShapeX + o, c.w)};top:${N(e.inShapeY, c.h)};width:${N(s, c.w)};height:${N(e.h, c.h)};background:${n};pointer-events:none;`, c.div.appendChild(l);
|
|
@@ -170,8 +170,8 @@ var Je = class {
|
|
|
170
170
|
if (n !== this._generation) return [];
|
|
171
171
|
let o = r === this._runsRevision ? i : new Map([...i, ...this._slideRuns]), s = [];
|
|
172
172
|
for (let n = 0; n < a; n++) {
|
|
173
|
-
let r = o.get(n) ?? [], i =
|
|
174
|
-
for (let a of
|
|
173
|
+
let r = o.get(n) ?? [], i = he(r);
|
|
174
|
+
for (let a of me(i, e, t)) {
|
|
175
175
|
if (!qe(r, a.slices)) continue;
|
|
176
176
|
let e = a.slices.map((e) => r[e.runIndex].text.slice(e.start, e.end)).join("");
|
|
177
177
|
s.push({
|
|
@@ -184,10 +184,10 @@ var Je = class {
|
|
|
184
184
|
return this._runsRevision++, this._slideRuns = o, this._matches = s, this._active = -1, this.matches();
|
|
185
185
|
}
|
|
186
186
|
next() {
|
|
187
|
-
return this._active =
|
|
187
|
+
return this._active = fe(this._active, this._matches.length), this._activePublic();
|
|
188
188
|
}
|
|
189
189
|
prev() {
|
|
190
|
-
return this._active =
|
|
190
|
+
return this._active = ve(this._active, this._matches.length), this._activePublic();
|
|
191
191
|
}
|
|
192
192
|
_activePublic() {
|
|
193
193
|
let e = this._matches[this._active];
|
|
@@ -508,10 +508,10 @@ var _t = class {
|
|
|
508
508
|
#o;
|
|
509
509
|
constructor(e) {
|
|
510
510
|
if (!Number.isSafeInteger(e.slideCount) || e.slideCount < 0) throw TypeError("slideCount must be a non-negative safe integer");
|
|
511
|
-
this.#e = e.slideCount, this.#t = e.loadSlide, this.#n = new
|
|
511
|
+
this.#e = e.slideCount, this.#t = e.loadSlide, this.#n = new ze({
|
|
512
512
|
maxEntries: e.maxCachedSlides,
|
|
513
513
|
maxWeight: e.maxCachedStructuralBytes,
|
|
514
|
-
measure: (e) =>
|
|
514
|
+
measure: (e) => Fe(e).jsonBytes
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
get slideCount() {
|
|
@@ -559,7 +559,7 @@ var _t = class {
|
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
561
|
function vt(e) {
|
|
562
|
-
return e instanceof
|
|
562
|
+
return e instanceof x ? e : v(e);
|
|
563
563
|
}
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region packages/pptx/src/embedded-fonts.ts
|
|
@@ -593,7 +593,7 @@ async function bt(e, t) {
|
|
|
593
593
|
return null;
|
|
594
594
|
}
|
|
595
595
|
}))).filter((e) => e !== null);
|
|
596
|
-
if (o.length !== 0) for (let e of await
|
|
596
|
+
if (o.length !== 0) for (let e of await Ae(o)) a.has(e) ? j([e]) : (a.add(e), i.push(e));
|
|
597
597
|
}
|
|
598
598
|
let o = new Set(i.map((e) => W(e.family))), s = new Map([...r].filter(([, e]) => o.has(W(e))));
|
|
599
599
|
return {
|
|
@@ -731,7 +731,7 @@ function It(e, t, n, r = {}) {
|
|
|
731
731
|
for (let r = t.elements.length - 1; r >= 0; r--) {
|
|
732
732
|
let i = t.elements[r];
|
|
733
733
|
if (!At(i, n, o)) continue;
|
|
734
|
-
let s = i.type === "chart" ?
|
|
734
|
+
let s = i.type === "chart" ? de(i.chart, a) : Ft(Mt(i), a);
|
|
735
735
|
return {
|
|
736
736
|
format: "pptx",
|
|
737
737
|
kind: "element",
|
|
@@ -815,7 +815,7 @@ function q(e, t) {
|
|
|
815
815
|
} catch {}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function J(e, t, n, r) {
|
|
819
819
|
let i = K.get(e);
|
|
820
820
|
i || (i = /* @__PURE__ */ new Set(), K.set(e, i));
|
|
821
821
|
let a = Object.freeze({
|
|
@@ -836,7 +836,7 @@ function Rt(e, t, n, r) {
|
|
|
836
836
|
}
|
|
837
837
|
//#endregion
|
|
838
838
|
//#region packages/pptx/src/worker-task-scheduler.ts
|
|
839
|
-
function
|
|
839
|
+
function Rt() {
|
|
840
840
|
return new Promise((e) => {
|
|
841
841
|
let t = new MessageChannel();
|
|
842
842
|
t.port1.onmessage = () => {
|
|
@@ -846,7 +846,7 @@ function zt() {
|
|
|
846
846
|
}
|
|
847
847
|
//#endregion
|
|
848
848
|
//#region packages/pptx/src/presentation.ts
|
|
849
|
-
function
|
|
849
|
+
function zt() {
|
|
850
850
|
let e, t;
|
|
851
851
|
return {
|
|
852
852
|
promise: new Promise((n, r) => {
|
|
@@ -856,7 +856,7 @@ function Bt() {
|
|
|
856
856
|
reject: t
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
|
-
var
|
|
859
|
+
var Y = class e {
|
|
860
860
|
_metrics = null;
|
|
861
861
|
_worker;
|
|
862
862
|
_bridge;
|
|
@@ -864,8 +864,8 @@ var J = class e {
|
|
|
864
864
|
_bootstrap = null;
|
|
865
865
|
_preflight = null;
|
|
866
866
|
_availableSlideCount = 0;
|
|
867
|
-
_layoutLifecycle = new
|
|
868
|
-
_layoutObservers = new
|
|
867
|
+
_layoutLifecycle = new Ee();
|
|
868
|
+
_layoutObservers = new Oe();
|
|
869
869
|
_layoutCompletion = null;
|
|
870
870
|
_parseRequestId = null;
|
|
871
871
|
_progressive = null;
|
|
@@ -876,9 +876,9 @@ var J = class e {
|
|
|
876
876
|
_slidePullClient = null;
|
|
877
877
|
_resourceFailure = null;
|
|
878
878
|
_slidePartIndex = null;
|
|
879
|
-
_rawParts = new
|
|
879
|
+
_rawParts = new Be({
|
|
880
880
|
maxEntries: 64,
|
|
881
|
-
maxBytes:
|
|
881
|
+
maxBytes: y
|
|
882
882
|
});
|
|
883
883
|
_googleFontFaces = [];
|
|
884
884
|
_embeddedFontFaces = [];
|
|
@@ -893,9 +893,9 @@ var J = class e {
|
|
|
893
893
|
_chartEx;
|
|
894
894
|
_tiff;
|
|
895
895
|
constructor(e, t, n) {
|
|
896
|
-
this._worker = e, this._mode = t, this._bridge = new
|
|
896
|
+
this._worker = e, this._mode = t, this._bridge = new Ce(this._worker, {
|
|
897
897
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
898
|
-
toError: (e) => !("protocol" in e) && e.kind === "error" ?
|
|
898
|
+
toError: (e) => !("protocol" in e) && e.kind === "error" ? _(e) : void 0,
|
|
899
899
|
onUnsolicited: (e) => this._onWorkerLayoutPush(e)
|
|
900
900
|
});
|
|
901
901
|
let r = new URL(n ?? Tt, location.href).href;
|
|
@@ -908,11 +908,11 @@ var J = class e {
|
|
|
908
908
|
if (this._resourceFailure) throw this._resourceFailure;
|
|
909
909
|
}
|
|
910
910
|
_rethrowWithResourceFailure(e) {
|
|
911
|
-
let t = e instanceof
|
|
911
|
+
let t = e instanceof x ? e : v(e);
|
|
912
912
|
throw t ? (this._resourceFailure ??= t, this._resourceFailure) : e;
|
|
913
913
|
}
|
|
914
914
|
static async load(t, r = {}) {
|
|
915
|
-
let i =
|
|
915
|
+
let i = te(r), a = r.mode ?? "main", o = new h({
|
|
916
916
|
enabled: !0,
|
|
917
917
|
format: "pptx",
|
|
918
918
|
mode: a,
|
|
@@ -928,23 +928,23 @@ var J = class e {
|
|
|
928
928
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
929
929
|
s = await e.arrayBuffer();
|
|
930
930
|
} else s = t;
|
|
931
|
-
s =
|
|
932
|
-
let c = a === "worker" ? (await import("./render-worker-host-
|
|
931
|
+
s = ae(await ie(s, r.password)), o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
932
|
+
let c = a === "worker" ? (await import("./render-worker-host-BEfLZvSL.js")).createRenderWorker() : new wt(), l = a === "worker" ? Ie(r) : void 0, u;
|
|
933
933
|
try {
|
|
934
934
|
u = new e(c, a, r.wasmUrl), u._metrics = o, r.math && a === "worker" && !l?.math && console.warn("[ooxml] a custom math renderer cannot cross the worker boundary; equations will be skipped in mode: 'worker'. Use the math renderer from @silurus/ooxml/math."), r.threeD && a === "worker" && !l?.threeD && console.warn("[ooxml] a custom 3-D chart renderer cannot cross the worker boundary; charts use their 2-D family fallback in mode: 'worker'. Use the renderer from @silurus/ooxml/three-d."), u._math = a === "worker" ? void 0 : r.math, u._threeD = a === "worker" ? void 0 : r.threeD, r.regionMap && a === "worker" && !l?.regionMap && console.warn("[ooxml] a custom Region Map renderer cannot cross the worker boundary; geospatial charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/region-map."), u._regionMap = a === "worker" ? void 0 : r.regionMap, r.chartEx && a === "worker" && !l?.chartEx && console.warn("[ooxml] a custom ChartEx renderer cannot cross the worker boundary; ChartEx charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/chart-ex."), u._chartEx = a === "worker" ? void 0 : r.chartEx, r.tiff && a === "worker" && !l?.tiff && console.warn("[ooxml] a custom TIFF codec cannot cross the worker boundary; recognized TIFF images will use an unavailable-image placeholder in mode: 'worker'. Use the codec from @silurus/ooxml/tiff to display them."), u._tiff = a === "worker" ? void 0 : r.tiff;
|
|
935
935
|
let t = r.progressiveLayout ? {
|
|
936
936
|
onProgress: r.onLayoutProgress,
|
|
937
937
|
onPartial: r.onLayoutPartial,
|
|
938
938
|
onComplete: r.onLayoutComplete,
|
|
939
|
-
firstPublication:
|
|
939
|
+
firstPublication: zt(),
|
|
940
940
|
published: !1,
|
|
941
941
|
deferred: !1,
|
|
942
942
|
settled: !1
|
|
943
943
|
} : void 0;
|
|
944
|
-
return await u._parse(s, i.policy, !!r.useGoogleFonts, r.workerTimeoutMs, (e) => o.observeUsage(e), l, t), o.checkpoint("presentation preflight ready"), a === "main" && r.useGoogleFonts && u._preflight && !t && (u._googleFontFaces = await
|
|
944
|
+
return await u._parse(s, i.policy, !!r.useGoogleFonts, r.workerTimeoutMs, (e) => o.observeUsage(e), l, t), o.checkpoint("presentation preflight ready"), a === "main" && r.useGoogleFonts && u._preflight && !t && (u._googleFontFaces = await re(xt(u._preflight.fontPreloadNames, u._embeddedFontAliases), n)), o.succeed({ slides: u.slideCount }), u;
|
|
945
945
|
} catch (e) {
|
|
946
946
|
let t = u;
|
|
947
|
-
throw
|
|
947
|
+
throw ne(c, t ? () => t.destroy() : void 0), e;
|
|
948
948
|
}
|
|
949
949
|
} catch (e) {
|
|
950
950
|
throw o.fail(e), e;
|
|
@@ -991,20 +991,20 @@ var J = class e {
|
|
|
991
991
|
},
|
|
992
992
|
onUsage: a
|
|
993
993
|
});
|
|
994
|
-
let
|
|
994
|
+
let h;
|
|
995
995
|
try {
|
|
996
996
|
for (let e = 0; e < f.slideCount; e += 1) await this._slidePullClient.load(e, !1, i);
|
|
997
|
-
|
|
997
|
+
h = await this._bridge.request((e) => ({
|
|
998
998
|
kind: "finishPresentationPreflight",
|
|
999
999
|
id: e
|
|
1000
1000
|
}), void 0, { timeoutMs: i }), await p;
|
|
1001
1001
|
} catch (e) {
|
|
1002
1002
|
throw p.catch(() => void 0), e;
|
|
1003
1003
|
}
|
|
1004
|
-
this._preflight = c(
|
|
1004
|
+
this._preflight = c(h.preflight), this._availableSlideCount = this._preflight.slideCount, this._slides = new _t({
|
|
1005
1005
|
slideCount: this._preflight.slideCount,
|
|
1006
1006
|
maxCachedSlides: 8,
|
|
1007
|
-
maxCachedStructuralBytes:
|
|
1007
|
+
maxCachedStructuralBytes: m,
|
|
1008
1008
|
loadSlide: async (e) => {
|
|
1009
1009
|
let t = await this._slidePullClient?.load(e, !0, i);
|
|
1010
1010
|
if (!t) throw Error("PPTX slide pull client is unavailable");
|
|
@@ -1027,7 +1027,7 @@ var J = class e {
|
|
|
1027
1027
|
this._slidePullClient = this._createSlidePullClient(c.slideCount, a, o), this._slides = new _t({
|
|
1028
1028
|
slideCount: c.slideCount,
|
|
1029
1029
|
maxCachedSlides: 8,
|
|
1030
|
-
maxCachedStructuralBytes:
|
|
1030
|
+
maxCachedStructuralBytes: m,
|
|
1031
1031
|
loadSlide: async (e) => {
|
|
1032
1032
|
let t = await this._slidePullClient?.load(e, !0, a);
|
|
1033
1033
|
if (!t) throw Error("PPTX slide pull client is unavailable");
|
|
@@ -1039,13 +1039,13 @@ var J = class e {
|
|
|
1039
1039
|
let e = xt(d.currentFontPreloadNames, this._embeddedFontAliases).filter((e) => !!e && !f.has(e));
|
|
1040
1040
|
if (e.length !== 0) {
|
|
1041
1041
|
for (let t of e) f.add(t);
|
|
1042
|
-
this._googleFontFaces.push(...await
|
|
1042
|
+
this._googleFontFaces.push(...await re(e, n));
|
|
1043
1043
|
}
|
|
1044
1044
|
};
|
|
1045
1045
|
this._layoutCompletion = (async () => {
|
|
1046
1046
|
for (let e = 0; e < c.slideCount; e += 1) await this._slides.withSlide(e, (e) => {
|
|
1047
1047
|
d.addSlide(e);
|
|
1048
|
-
}), await p(), this._applyProgressivePrefix(d.snapshot(), s), e === 0 && s.deferred && await
|
|
1048
|
+
}), await p(), this._applyProgressivePrefix(d.snapshot(), s), e === 0 && s.deferred && await Rt();
|
|
1049
1049
|
await u, this._finishProgressiveLayout(d.finish(), s);
|
|
1050
1050
|
})().then(() => void 0, (e) => this._failProgressiveLayout(e, s)), await s.firstPublication.promise;
|
|
1051
1051
|
}
|
|
@@ -1084,7 +1084,7 @@ var J = class e {
|
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
1086
|
_onWorkerLayoutPush(e) {
|
|
1087
|
-
if (!
|
|
1087
|
+
if (!se((e, t) => this._worker.postMessage(e, t), e) && !(!("kind" in e) || e.kind !== "presentationLayoutPartial" || e.forId !== this._parseRequestId || !this._progressive)) try {
|
|
1088
1088
|
this._rearmProgressiveWatchdog(), e.usage && this._metrics?.observeUsage(e.usage), e.bootstrap && (this._bootstrap = t(e.bootstrap));
|
|
1089
1089
|
let n = this._bootstrap;
|
|
1090
1090
|
if (!n) throw Error("PPTX progressive worker published before bootstrap");
|
|
@@ -1094,7 +1094,7 @@ var J = class e {
|
|
|
1094
1094
|
...n,
|
|
1095
1095
|
slides: [...r, e.slide],
|
|
1096
1096
|
fontPreloadNames: e.fontPreloadNames
|
|
1097
|
-
}), this._progressive),
|
|
1097
|
+
}), this._progressive), Rt().then(() => {
|
|
1098
1098
|
this._destroyed || this._parseRequestId !== e.forId || this._bridge.post({
|
|
1099
1099
|
kind: "continuePresentationPreflight",
|
|
1100
1100
|
forId: e.forId,
|
|
@@ -1223,7 +1223,7 @@ var J = class e {
|
|
|
1223
1223
|
this._assertSlideIndex(t), await this._waitForSlide(t);
|
|
1224
1224
|
let i = this._preflight, a = this._slides;
|
|
1225
1225
|
if (!i || !a) throw Error("Presentation not loaded");
|
|
1226
|
-
let o = n.dpr ??
|
|
1226
|
+
let o = n.dpr ?? p(), s = n.width ?? ((S(e) ? e.offsetWidth : 0) || 960);
|
|
1227
1227
|
await a.withSlide(t, (t) => (this._assertResourceHealthy(), r(e, t, i.slideWidth, i.slideHeight, {
|
|
1228
1228
|
width: s,
|
|
1229
1229
|
dpr: o,
|
|
@@ -1252,7 +1252,7 @@ var J = class e {
|
|
|
1252
1252
|
this._assertResourceHealthy();
|
|
1253
1253
|
try {
|
|
1254
1254
|
this._assertSlideIndex(e), await this._waitForSlide(e);
|
|
1255
|
-
let n = t.width ?? 960, r = t.dpr ??
|
|
1255
|
+
let n = t.width ?? 960, r = t.dpr ?? p();
|
|
1256
1256
|
if (this._mode === "worker") {
|
|
1257
1257
|
let i = await this._bridge.request((i) => ({
|
|
1258
1258
|
kind: "renderSlide",
|
|
@@ -1267,7 +1267,7 @@ var J = class e {
|
|
|
1267
1267
|
try {
|
|
1268
1268
|
if (t.onTextRun) for (let e of i.runs) t.onTextRun(e);
|
|
1269
1269
|
} catch (e) {
|
|
1270
|
-
throw
|
|
1270
|
+
throw b(i.bitmap), e;
|
|
1271
1271
|
}
|
|
1272
1272
|
return i.bitmap;
|
|
1273
1273
|
}
|
|
@@ -1405,7 +1405,7 @@ var J = class e {
|
|
|
1405
1405
|
this._assertResourceHealthy();
|
|
1406
1406
|
try {
|
|
1407
1407
|
if (this._assertSlideIndex(t), await this._waitForSlide(t), !this._preflight) throw Error("Presentation not loaded");
|
|
1408
|
-
let r = n.dpr ??
|
|
1408
|
+
let r = n.dpr ?? p(), i = n.width ?? (e.offsetWidth || 960), a = this.slideWidth > 0 ? i * this.slideHeight / this.slideWidth : 0;
|
|
1409
1409
|
e.style.width = `${Math.round(i)}px`, e.style.height = `${Math.round(a)}px`, e.style.display || (e.style.display = "block");
|
|
1410
1410
|
let o = this._mode === "worker" ? async () => {
|
|
1411
1411
|
let a = await this.renderSlideToBitmap(t, {
|
|
@@ -1422,7 +1422,7 @@ var J = class e {
|
|
|
1422
1422
|
if (!t) throw Error("2D context not available");
|
|
1423
1423
|
t.drawImage(a, 0, 0);
|
|
1424
1424
|
} finally {
|
|
1425
|
-
|
|
1425
|
+
b(a);
|
|
1426
1426
|
}
|
|
1427
1427
|
} : () => this.renderSlide(e, t, {
|
|
1428
1428
|
width: i,
|
|
@@ -1446,13 +1446,13 @@ var J = class e {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
1448
|
destroy() {
|
|
1449
|
-
this._destroyed = !0, this._clearProgressiveWatchdog(), this._slidePullClient?.cancelAll(), this._bridge.terminate(), this._slides?.clear(), this._slides = null, this._slidePullClient = null, this._bootstrap = null, this._preflight = null, this._availableSlideCount = 0, this._layoutLifecycle.succeed(), this._layoutCompletion = null, this._progressive = null, this._parseRequestId = null, this._wakeLayoutWaiters(), this._resourceFailure = null, this._slidePartIndex = null, this._rawParts.clear(), this._googleFontFaces.length > 0 && (
|
|
1449
|
+
this._destroyed = !0, this._clearProgressiveWatchdog(), this._slidePullClient?.cancelAll(), this._bridge.terminate(), this._slides?.clear(), this._slides = null, this._slidePullClient = null, this._bootstrap = null, this._preflight = null, this._availableSlideCount = 0, this._layoutLifecycle.succeed(), this._layoutCompletion = null, this._progressive = null, this._parseRequestId = null, this._wakeLayoutWaiters(), this._resourceFailure = null, this._slidePartIndex = null, this._rawParts.clear(), this._googleFontFaces.length > 0 && (oe(this._googleFontFaces), this._googleFontFaces = []), this._embeddedFontFaces.length > 0 && (j(this._embeddedFontFaces), this._embeddedFontFaces = []), this._embeddedFontAliases = /* @__PURE__ */ new Map(), this._embeddedFontAuthoredFamilies = /* @__PURE__ */ new Map(), C(this._fetchImage), w(this._fetchImage);
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region packages/pptx/src/selection-context.ts
|
|
1454
|
-
function
|
|
1455
|
-
let a =
|
|
1454
|
+
function Bt(e, t, n, r, i = {}) {
|
|
1455
|
+
let a = De({
|
|
1456
1456
|
id: e.id,
|
|
1457
1457
|
author: e.author,
|
|
1458
1458
|
date: e.date,
|
|
@@ -1483,23 +1483,23 @@ function Vt(e, t, n, r, i = {}) {
|
|
|
1483
1483
|
maxTextCharacters: a.maxTextCharacters
|
|
1484
1484
|
});
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function X(e) {
|
|
1487
1487
|
if (e === void 0 || !/^\d+$/.test(e)) return null;
|
|
1488
1488
|
let t = Number(e);
|
|
1489
1489
|
return Number.isSafeInteger(t) ? t : null;
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function Vt(e) {
|
|
1492
1492
|
for (let t = e; t; t = t.parentElement) {
|
|
1493
|
-
let e =
|
|
1493
|
+
let e = X(t.dataset.slideIndex);
|
|
1494
1494
|
if (e !== null) return e;
|
|
1495
1495
|
}
|
|
1496
1496
|
return null;
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1499
|
-
let r =
|
|
1500
|
-
let t =
|
|
1498
|
+
function Z(e, t, n = {}) {
|
|
1499
|
+
let r = be(e, t, (e) => {
|
|
1500
|
+
let t = Vt(e), n = X(e.dataset.runIndex);
|
|
1501
1501
|
if (t === null || n === null) return null;
|
|
1502
|
-
let r =
|
|
1502
|
+
let r = X(e.dataset.elementIndex), i = e.dataset.elementOrigin, a = r !== null && (i === "master" || i === "layout" || i === "slide");
|
|
1503
1503
|
return {
|
|
1504
1504
|
slideIndex: t,
|
|
1505
1505
|
runIndex: n,
|
|
@@ -1531,10 +1531,43 @@ function X(e, t, n = {}) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
//#endregion
|
|
1533
1533
|
//#region packages/pptx/src/focused-view-runtime.ts
|
|
1534
|
-
function
|
|
1534
|
+
function Q(e, t, n, r, i) {
|
|
1535
1535
|
return r === "worker" ? e.renderSlideToBitmap(n, i) : e.renderSlide(t, n, i);
|
|
1536
1536
|
}
|
|
1537
1537
|
//#endregion
|
|
1538
|
+
//#region packages/pptx/src/loading-indicator.ts
|
|
1539
|
+
function Ht(e) {
|
|
1540
|
+
let t = e.createElement("span");
|
|
1541
|
+
t.style.cssText = [
|
|
1542
|
+
"position:absolute",
|
|
1543
|
+
"top:0",
|
|
1544
|
+
"right:0",
|
|
1545
|
+
"bottom:0",
|
|
1546
|
+
"left:0",
|
|
1547
|
+
"display:none",
|
|
1548
|
+
"align-items:center",
|
|
1549
|
+
"justify-content:center",
|
|
1550
|
+
"background:rgba(255,255,255,0.72)",
|
|
1551
|
+
"backdrop-filter:blur(2px)",
|
|
1552
|
+
"pointer-events:none",
|
|
1553
|
+
"z-index:4"
|
|
1554
|
+
].join(";"), t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-label", "Loading slide");
|
|
1555
|
+
let n = e.createElement("span");
|
|
1556
|
+
return n.className = "ooxml-pptx-progress-circle", n.style.cssText = [
|
|
1557
|
+
"width:34px",
|
|
1558
|
+
"height:34px",
|
|
1559
|
+
"box-sizing:border-box",
|
|
1560
|
+
"border-radius:50%",
|
|
1561
|
+
"border:3px solid var(--border-bright, rgba(100,116,139,0.28))",
|
|
1562
|
+
"border-top-color:var(--signal, #12bfd8)",
|
|
1563
|
+
"box-shadow:0 2px 10px rgba(15,23,42,0.08)"
|
|
1564
|
+
].join(";"), n.setAttribute("aria-hidden", "true"), t.appendChild(n), !(e.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1) && typeof n.animate == "function" && n.animate([{ transform: "rotate(0deg)" }, { transform: "rotate(360deg)" }], {
|
|
1565
|
+
duration: 800,
|
|
1566
|
+
iterations: Infinity,
|
|
1567
|
+
easing: "linear"
|
|
1568
|
+
}), t;
|
|
1569
|
+
}
|
|
1570
|
+
//#endregion
|
|
1538
1571
|
//#region packages/pptx/src/viewer.ts
|
|
1539
1572
|
var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
1540
1573
|
color: "#ffffff",
|
|
@@ -1591,29 +1624,18 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1591
1624
|
constructor(e, t = {}) {
|
|
1592
1625
|
this.opts = t, this.canvas = e;
|
|
1593
1626
|
let n = t[Ut];
|
|
1594
|
-
this.borrowed = n !== void 0, this._mode =
|
|
1627
|
+
this.borrowed = n !== void 0, this._mode = k("PptxViewer", t.mode, n), this.presentationOwner = new E("PptxViewer", n ?? null, !1);
|
|
1595
1628
|
let r = e.ownerDocument?.defaultView ?? (typeof window < "u" ? window : null);
|
|
1596
1629
|
if (!r) throw Error("PptxViewer requires a canvas with an active Window");
|
|
1597
1630
|
this.hostWindow = r;
|
|
1598
1631
|
let i = t.elementHitTolerance ?? 6;
|
|
1599
1632
|
if (!Number.isFinite(i) || i < 0) throw RangeError("elementHitTolerance must be a finite non-negative number.");
|
|
1600
|
-
this.elementHitTolerance = i, this._hiddenMode = t.hiddenSlideMode ?? "show", this.canvasMount = new
|
|
1633
|
+
this.elementHitTolerance = i, this._hiddenMode = t.hiddenSlideMode ?? "show", this.canvasMount = new xe(e, {
|
|
1601
1634
|
wrapperCssText: "position:relative;display:inline-block;vertical-align:top;",
|
|
1602
1635
|
forceDisplayBlock: !0
|
|
1603
|
-
}), this.wrapper = this.canvasMount.wrapper, this.renderDispatcher = new
|
|
1604
|
-
let a = new
|
|
1605
|
-
this.textLayer = a.textLayer, this.highlightLayer = a.highlightLayer, this.elementLayer = a.elementLayer, this._loadingLayer = this.wrapper.ownerDocument.
|
|
1606
|
-
"position:absolute",
|
|
1607
|
-
"inset:0",
|
|
1608
|
-
"display:none",
|
|
1609
|
-
"align-items:center",
|
|
1610
|
-
"justify-content:center",
|
|
1611
|
-
"background:rgba(255,255,255,0.72)",
|
|
1612
|
-
"pointer-events:none",
|
|
1613
|
-
"z-index:4"
|
|
1614
|
-
].join(";"), this._loadingLayer.setAttribute("role", "status"), this._loadingLayer.setAttribute("aria-live", "polite"), this._loadingLayer.setAttribute("aria-label", "Loading slide");
|
|
1615
|
-
let o = this.wrapper.ownerDocument.createElement("progress");
|
|
1616
|
-
o.setAttribute("aria-hidden", "true"), this._loadingLayer.appendChild(o), this.wrapper.insertBefore(this._loadingLayer, this.elementLayer), this.textLayer && (t.onSelectionContextChange || t.enableElementSelection) && (this.selectionChangeListener = () => this._emitSelectionContextChange(), this.wrapper.ownerDocument.addEventListener("selectionchange", this.selectionChangeListener)), t.enableElementSelection && (this.elementClickListener = (e) => {
|
|
1636
|
+
}), this.wrapper = this.canvasMount.wrapper, this.renderDispatcher = new O(e, this._mode === "worker" && !t.enableMediaPlayback), this.errorRouter = new ye("PptxViewer", t.onError);
|
|
1637
|
+
let a = new ge(this.wrapper, t.enableTextSelection === !0, t.enableElementSelection === !0);
|
|
1638
|
+
this.textLayer = a.textLayer, this.highlightLayer = a.highlightLayer, this.elementLayer = a.elementLayer, this._loadingLayer = Ht(this.wrapper.ownerDocument), this.wrapper.insertBefore(this._loadingLayer, this.elementLayer), this.textLayer && (t.onSelectionContextChange || t.enableElementSelection) && (this.selectionChangeListener = () => this._emitSelectionContextChange(), this.wrapper.ownerDocument.addEventListener("selectionchange", this.selectionChangeListener)), t.enableElementSelection && (this.elementClickListener = (e) => {
|
|
1617
1639
|
this._onElementClick(e).catch((e) => this._reportRenderError(e));
|
|
1618
1640
|
}, this.wrapper.addEventListener("click", this.elementClickListener)), t.onContextMenu && (this.contextMenuListener = (e) => this._onContextMenu(e), this.wrapper.addEventListener("contextmenu", this.contextMenuListener)), this._find = new Je(() => this.slideCount, (e) => this._collectSlideRuns(e)), n && this._bindLayoutPresentation(n);
|
|
1619
1641
|
}
|
|
@@ -1622,7 +1644,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1622
1644
|
if (this.borrowed) throw Error("PptxViewer.load() is unsupported on a Viewer created by fromPresentation(); the borrowed presentation is already loaded.");
|
|
1623
1645
|
let t = !1;
|
|
1624
1646
|
try {
|
|
1625
|
-
let n = await this.presentationOwner.replace(() =>
|
|
1647
|
+
let n = await this.presentationOwner.replace(() => Y.load(e, {
|
|
1626
1648
|
password: this.opts.password,
|
|
1627
1649
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
1628
1650
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
@@ -1712,7 +1734,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1712
1734
|
get visibleSlideCount() {
|
|
1713
1735
|
if (!this.engine) return 0;
|
|
1714
1736
|
let e = this.engine;
|
|
1715
|
-
return
|
|
1737
|
+
return Le((t) => e.isHidden(t), this.slideCount);
|
|
1716
1738
|
}
|
|
1717
1739
|
get slideIndex() {
|
|
1718
1740
|
return this.currentSlide;
|
|
@@ -1758,14 +1780,14 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1758
1780
|
return this.opts.zoomMax ?? 4;
|
|
1759
1781
|
}
|
|
1760
1782
|
async setScale(e) {
|
|
1761
|
-
let t =
|
|
1783
|
+
let t = pe(e, this._zoomMin(), this._zoomMax()), n = t !== this.getScale();
|
|
1762
1784
|
this._scale = t, await this.renderCurrentSlide(), n && this.opts.onScaleChange?.(t);
|
|
1763
1785
|
}
|
|
1764
1786
|
async zoomIn() {
|
|
1765
|
-
await this.setScale(
|
|
1787
|
+
await this.setScale(Se(this.getScale()));
|
|
1766
1788
|
}
|
|
1767
1789
|
async zoomOut() {
|
|
1768
|
-
await this.setScale(
|
|
1790
|
+
await this.setScale(A(this.getScale()));
|
|
1769
1791
|
}
|
|
1770
1792
|
async fitWidth() {
|
|
1771
1793
|
await this._fit("width");
|
|
@@ -1777,7 +1799,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1777
1799
|
if (!this.engine) return;
|
|
1778
1800
|
let t = this.wrapper.parentElement;
|
|
1779
1801
|
if (!t) return;
|
|
1780
|
-
let n =
|
|
1802
|
+
let n = le({
|
|
1781
1803
|
contentWidth: this.engine.slideWidth / M,
|
|
1782
1804
|
contentHeight: this.engine.slideHeight / M,
|
|
1783
1805
|
containerWidth: t.clientWidth,
|
|
@@ -1813,7 +1835,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1813
1835
|
}
|
|
1814
1836
|
this.handle = n;
|
|
1815
1837
|
} else if (l) {
|
|
1816
|
-
let e = await
|
|
1838
|
+
let e = await Q(this.engine, this.canvas, t, "worker", {
|
|
1817
1839
|
width: a,
|
|
1818
1840
|
dpr: o,
|
|
1819
1841
|
imageResources: this.opts.imageResources,
|
|
@@ -1821,7 +1843,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1821
1843
|
onTextRun: d
|
|
1822
1844
|
});
|
|
1823
1845
|
if (!this.renderDispatcher.commitBitmap(r, e)) return;
|
|
1824
|
-
} else if (await
|
|
1846
|
+
} else if (await Q(this.engine, this.canvas, t, "main", {
|
|
1825
1847
|
width: a,
|
|
1826
1848
|
dpr: o,
|
|
1827
1849
|
imageResources: this.opts.imageResources,
|
|
@@ -1839,7 +1861,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1839
1861
|
_bindLayoutPresentation(e) {
|
|
1840
1862
|
this._unbindLayoutPresentation(), this._layoutFailed = !1;
|
|
1841
1863
|
let t = !0;
|
|
1842
|
-
this._layoutUnsubscribe =
|
|
1864
|
+
this._layoutUnsubscribe = J(e, () => ({
|
|
1843
1865
|
availableSlides: e.availableSlideCount,
|
|
1844
1866
|
slideCount: e.slideCount,
|
|
1845
1867
|
exact: e.layoutComplete,
|
|
@@ -1960,7 +1982,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1960
1982
|
}
|
|
1961
1983
|
getSelectionContext(e = {}) {
|
|
1962
1984
|
if (this.destroyed) throw Error("PptxViewer is destroyed");
|
|
1963
|
-
return (this.textLayer ?
|
|
1985
|
+
return (this.textLayer ? Z(this.wrapper, this.wrapper.ownerDocument?.getSelection?.() ?? null, e) : null) ?? (this.elementContext ? Pt(this.elementContext, e.maxTextCharacters) : null);
|
|
1964
1986
|
}
|
|
1965
1987
|
_emitSelectionContextChange() {
|
|
1966
1988
|
let e = this.getSelectionContext();
|
|
@@ -1977,10 +1999,10 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
1977
1999
|
_redrawElementOutline() {
|
|
1978
2000
|
let e = this.elementContext, t = this.engine;
|
|
1979
2001
|
if (!e || !t || e.slideIndex !== this.currentSlide) {
|
|
1980
|
-
|
|
2002
|
+
D(this.elementLayer, null);
|
|
1981
2003
|
return;
|
|
1982
2004
|
}
|
|
1983
|
-
|
|
2005
|
+
D(this.elementLayer, {
|
|
1984
2006
|
x: e.bounds.x / t.slideWidth,
|
|
1985
2007
|
y: e.bounds.y / t.slideHeight,
|
|
1986
2008
|
width: e.bounds.width / t.slideWidth,
|
|
@@ -2001,7 +2023,7 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
2001
2023
|
async _resolveContextAt(e) {
|
|
2002
2024
|
let t = this.engine;
|
|
2003
2025
|
if (this.destroyed || !t) return null;
|
|
2004
|
-
if (this.textLayer &&
|
|
2026
|
+
if (this.textLayer && Z(this.wrapper, this.wrapper.ownerDocument?.getSelection?.() ?? null)) return this._emitSelectionContextChange(), this.destroyed ? null : this.getSelectionContext();
|
|
2005
2027
|
if (!this.opts.enableElementSelection) return this.getSelectionContext();
|
|
2006
2028
|
let n = this.canvas.getBoundingClientRect();
|
|
2007
2029
|
if (n.width <= 0 || n.height <= 0) return this._invalidateElementSelection(), null;
|
|
@@ -2025,11 +2047,11 @@ var Ut = Symbol("PptxViewer.borrowedPresentation"), Wt = {
|
|
|
2025
2047
|
destroy() {
|
|
2026
2048
|
this.destroyed || (this.destroyed = !0, this.errorRouter.close(), this.renderDispatcher.destroy(), o(this.canvas), this.handle?.destroy(), this.handle = null, this._unbindLayoutPresentation(), this.presentationOwner.close(), this._invalidateFind(), this.selectionChangeListener &&= (this.wrapper.ownerDocument.removeEventListener("selectionchange", this.selectionChangeListener), null), this.elementHitGeneration++, this.elementClickListener &&= (this.wrapper.removeEventListener("click", this.elementClickListener), null), this.contextMenuListener &&= (this.wrapper.removeEventListener("contextmenu", this.contextMenuListener), null), this.elementContext = null, this.canvasMount.restore());
|
|
2027
2049
|
}
|
|
2028
|
-
}, Kt = 150, qt = "0 1px 3px rgba(0,0,0,0.2)",
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2050
|
+
}, Kt = 150, qt = "0 1px 3px rgba(0,0,0,0.2)", Jt = 12, Yt;
|
|
2051
|
+
function Xt() {
|
|
2052
|
+
return Yt ??= import("./comment-ui-runtime-lXwVOgjW.js");
|
|
2031
2053
|
}
|
|
2032
|
-
var $ = 440,
|
|
2054
|
+
var $ = 440, Zt = 20, Qt = Symbol("PptxScrollViewer.borrowedPresentation"), $t = class e {
|
|
2033
2055
|
_presentationOwner;
|
|
2034
2056
|
get _pres() {
|
|
2035
2057
|
return this._presentationOwner.current;
|
|
@@ -2091,17 +2113,17 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2091
2113
|
static fromPresentation(t, n, r = {}) {
|
|
2092
2114
|
return new e(t, {
|
|
2093
2115
|
...r,
|
|
2094
|
-
[
|
|
2116
|
+
[Qt]: n
|
|
2095
2117
|
});
|
|
2096
2118
|
}
|
|
2097
2119
|
constructor(e, t = {}) {
|
|
2098
2120
|
if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
|
|
2099
|
-
this._container = e, this._opts = t, this._errorRouter = new
|
|
2121
|
+
this._container = e, this._opts = t, this._errorRouter = new ye("PptxScrollViewer", t.onError);
|
|
2100
2122
|
let n = t.elementHitTolerance ?? 6;
|
|
2101
2123
|
if (!Number.isFinite(n) || n < 0) throw RangeError("elementHitTolerance must be a finite non-negative number.");
|
|
2102
2124
|
this._elementHitTolerance = n, this._pageShadow = t.pageShadow ?? qt;
|
|
2103
|
-
let r = t[
|
|
2104
|
-
this._borrowed = r !== void 0, r ? (this._presentationOwner = new
|
|
2125
|
+
let r = t[Qt];
|
|
2126
|
+
this._borrowed = r !== void 0, r ? (this._presentationOwner = new E("PptxScrollViewer", r, !1), this._mode = k("PptxScrollViewer", t.mode, r), this._scanAvailableComments(r, !1)) : (this._presentationOwner = new E("PptxScrollViewer"), this._mode = k("PptxScrollViewer", t.mode, void 0)), this._wrapper = document.createElement("div"), this._wrapper.style.cssText = "position:relative;width:100%;height:100%;overflow:hidden;", this._scrollHost = document.createElement("div"), this._scrollHost.style.cssText = "position:absolute;inset:0;overflow:auto;", this._scrollHost.style.scrollbarGutter = "stable", t.background && (this._scrollHost.style.background = t.background), this._spacer = document.createElement("div"), this._spacer.style.cssText = "position:absolute;top:0;left:0;width:1px;height:0;pointer-events:none;", this._scrollHost.appendChild(this._spacer), this._wrapper.appendChild(this._scrollHost), this._container.appendChild(this._wrapper), this._commentsEnabled() && Xt().then((e) => {
|
|
2105
2127
|
if (!this._destroyed) {
|
|
2106
2128
|
this._commentUi = e;
|
|
2107
2129
|
for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
|
|
@@ -2109,7 +2131,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2109
2131
|
}).catch((e) => this._reportRenderError(e)), t.enableTextSelection && (t.onSelectionContextChange || t.enableElementSelection) && (this._selectionChangeListener = () => this._emitSelectionContextChange(), this._wrapper.ownerDocument.addEventListener("selectionchange", this._selectionChangeListener)), t.enableElementSelection && (this._elementClickListener = (e) => {
|
|
2110
2132
|
this._onElementClick(e).catch((e) => this._reportRenderError(e));
|
|
2111
2133
|
}, this._scrollHost.addEventListener("click", this._elementClickListener)), t.onContextMenu && (this._contextMenuListener = (e) => this._onContextMenu(e), this._scrollHost.addEventListener("contextmenu", this._contextMenuListener)), this._scrollListener = () => this._onScroll(), this._scrollHost.addEventListener("scroll", this._scrollListener), t.comments && (this._commentOutsidePointerListener = (e) => {
|
|
2112
|
-
if (!
|
|
2134
|
+
if (!ke(e, this._wrapper, "ooxmlCommentId") && this._activeCommentId !== null) {
|
|
2113
2135
|
this._activeCommentId = null, this._activeCommentSlide = null;
|
|
2114
2136
|
for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
|
|
2115
2137
|
this._emitSelectionContextChange();
|
|
@@ -2120,7 +2142,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2120
2142
|
this._pendingZoomAnchor = Number.isFinite(n) && Number.isFinite(r) ? {
|
|
2121
2143
|
x: n,
|
|
2122
2144
|
y: r
|
|
2123
|
-
} : null, this.setScale(
|
|
2145
|
+
} : null, this.setScale(we(this._scale, e.deltaY, e.deltaMode));
|
|
2124
2146
|
}, this._scrollHost.addEventListener("wheel", this._wheelListener, { passive: !1 })), typeof ResizeObserver < "u" && (this._resizeObserver = new ResizeObserver(() => this._onResize()), this._resizeObserver.observe(this._container)), this._borrowed && (this._bindLayoutPresentation(r), this.relayout());
|
|
2125
2147
|
}
|
|
2126
2148
|
async load(e) {
|
|
@@ -2128,7 +2150,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2128
2150
|
if (this._borrowed) throw Error("PptxScrollViewer.load() is unsupported on a Viewer created by fromPresentation(); the borrowed presentation is already loaded.");
|
|
2129
2151
|
let t = !1;
|
|
2130
2152
|
try {
|
|
2131
|
-
let n = await this._presentationOwner.replace(() =>
|
|
2153
|
+
let n = await this._presentationOwner.replace(() => Y.load(e, {
|
|
2132
2154
|
password: this._opts.password,
|
|
2133
2155
|
useGoogleFonts: this._opts.useGoogleFonts,
|
|
2134
2156
|
maxZipEntryBytes: this._opts.maxZipEntryBytes,
|
|
@@ -2191,7 +2213,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2191
2213
|
return r <= 0 ? 0 : r;
|
|
2192
2214
|
}
|
|
2193
2215
|
_commentMarginExtent() {
|
|
2194
|
-
return this._hasCommentMargin() ? (
|
|
2216
|
+
return this._hasCommentMargin() ? (Jt + $) * this._commentZoom() : 0;
|
|
2195
2217
|
}
|
|
2196
2218
|
_hasCommentMargin() {
|
|
2197
2219
|
return this._commentsEnabled() && this._hasComments && this._commentsOptions()?.cards !== !1;
|
|
@@ -2212,8 +2234,8 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2212
2234
|
_syncCommentMarginGeometry(e) {
|
|
2213
2235
|
if (!e) return;
|
|
2214
2236
|
e.style.display = this._hasCommentMargin() ? "" : "none";
|
|
2215
|
-
let t = this._commentZoom(), n = `calc(100% + ${
|
|
2216
|
-
e.style.left = this._commentSide() === "right" ? n : "", e.style.right = this._commentSide() === "left" ? n : "", e.style.width = `${$ * t}px`, e.style.fontSize = `${
|
|
2237
|
+
let t = this._commentZoom(), n = `calc(100% + ${Jt * t}px)`;
|
|
2238
|
+
e.style.left = this._commentSide() === "right" ? n : "", e.style.right = this._commentSide() === "left" ? n : "", e.style.width = `${$ * t}px`, e.style.fontSize = `${Zt}px`, e.dataset.ooxmlCommentZoom = String(t);
|
|
2217
2239
|
}
|
|
2218
2240
|
_scanAvailableComments(e, t) {
|
|
2219
2241
|
if (!this._commentsEnabled() || this._hasComments) return;
|
|
@@ -2280,10 +2302,10 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2280
2302
|
return this._pad().leading + e * (this._uniformSlideHeight + this._gap());
|
|
2281
2303
|
}
|
|
2282
2304
|
_slideIndexAtOffset(e) {
|
|
2283
|
-
return
|
|
2305
|
+
return Te(this._pres?.slideCount ?? 0, this._uniformSlideHeight, this._gap(), e, 0, 0, this._pad()).topIndex;
|
|
2284
2306
|
}
|
|
2285
2307
|
_rangeAt(e, t) {
|
|
2286
|
-
return
|
|
2308
|
+
return Te(this._pres?.slideCount ?? 0, this._uniformSlideHeight, this._gap(), e, this._scrollHost.clientHeight, t, this._pad());
|
|
2287
2309
|
}
|
|
2288
2310
|
_range() {
|
|
2289
2311
|
return this._rangeAt(this._scrollHost.scrollTop, this._overscan());
|
|
@@ -2333,42 +2355,28 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2333
2355
|
this._opts.enableTextSelection && (r = document.createElement("div"), r.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", t.appendChild(r));
|
|
2334
2356
|
let i = document.createElement("div");
|
|
2335
2357
|
i.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", t.appendChild(i);
|
|
2336
|
-
let a = document
|
|
2337
|
-
a
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
"bottom:0",
|
|
2342
|
-
"left:0",
|
|
2343
|
-
"display:none",
|
|
2344
|
-
"align-items:center",
|
|
2345
|
-
"justify-content:center",
|
|
2346
|
-
"background:rgba(255,255,255,0.72)",
|
|
2347
|
-
"pointer-events:none",
|
|
2348
|
-
"z-index:4"
|
|
2349
|
-
].join(";"), a.setAttribute("role", "status"), a.setAttribute("aria-live", "polite"), a.setAttribute("aria-label", "Loading slide");
|
|
2350
|
-
let o = document.createElement("progress");
|
|
2351
|
-
o.setAttribute("aria-hidden", "true"), a.appendChild(o), t.appendChild(a);
|
|
2352
|
-
let s = null, c = null, l = null;
|
|
2353
|
-
this._commentsEnabled() && (s = document.createElement("div"), s.style.cssText = "position:absolute;inset:0;overflow:hidden;pointer-events:none;", t.appendChild(s), this._commentsOptions()?.cards !== !1 && (c = document.createElement("div"), c.style.cssText = "position:absolute;top:0;height:100%;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;pointer-events:auto;", this._syncCommentMarginGeometry(c), this._commentsOptions()?.connectors !== void 0 && (l = document.createElement("div"), l.style.cssText = "position:absolute;top:0;left:0;overflow:visible;pointer-events:none;", t.appendChild(l)), t.appendChild(c)));
|
|
2354
|
-
let u = me(t, this._opts.enableElementSelection === !0);
|
|
2358
|
+
let a = Ht(document);
|
|
2359
|
+
t.appendChild(a);
|
|
2360
|
+
let o = null, s = null, c = null;
|
|
2361
|
+
this._commentsEnabled() && (o = document.createElement("div"), o.style.cssText = "position:absolute;inset:0;overflow:hidden;pointer-events:none;", t.appendChild(o), this._commentsOptions()?.cards !== !1 && (s = document.createElement("div"), s.style.cssText = "position:absolute;top:0;height:100%;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;pointer-events:auto;", this._syncCommentMarginGeometry(s), this._commentsOptions()?.connectors !== void 0 && (c = document.createElement("div"), c.style.cssText = "position:absolute;top:0;left:0;overflow:visible;pointer-events:none;", t.appendChild(c)), t.appendChild(s)));
|
|
2362
|
+
let l = _e(t, this._opts.enableElementSelection === !0);
|
|
2355
2363
|
return this._scrollHost.appendChild(t), {
|
|
2356
2364
|
wrapper: t,
|
|
2357
2365
|
canvas: n,
|
|
2358
2366
|
textLayer: r,
|
|
2359
2367
|
highlightLayer: i,
|
|
2360
|
-
elementLayer:
|
|
2368
|
+
elementLayer: l,
|
|
2361
2369
|
loadingLayer: a,
|
|
2362
|
-
commentMarkerLayer:
|
|
2363
|
-
commentMargin:
|
|
2364
|
-
commentDecorationLayer:
|
|
2370
|
+
commentMarkerLayer: o,
|
|
2371
|
+
commentMargin: s,
|
|
2372
|
+
commentDecorationLayer: c,
|
|
2365
2373
|
commentElementBounds: Object.freeze([]),
|
|
2366
2374
|
commentGeometry: null,
|
|
2367
2375
|
commentAnchorSlide: -1,
|
|
2368
2376
|
commentAnchorGeneration: 0,
|
|
2369
2377
|
renderedSlide: -1,
|
|
2370
2378
|
renderedScale: -1,
|
|
2371
|
-
dispatcher: new
|
|
2379
|
+
dispatcher: new O(n, this._mode === "worker" && !this._opts.enableMediaPlayback),
|
|
2372
2380
|
presentationHandle: null,
|
|
2373
2381
|
mediaInteractive: !1,
|
|
2374
2382
|
renderGeneration: 0,
|
|
@@ -2376,7 +2384,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2376
2384
|
};
|
|
2377
2385
|
}
|
|
2378
2386
|
_recycleSlot(e, t) {
|
|
2379
|
-
this._slots.delete(e), t.renderGeneration++, t.presentationGeneration++, t.presentationHandle?.destroy(), t.presentationHandle = null, t.mediaInteractive = !1, t.dispatcher.destroy(), this._destroyed || (t.dispatcher = new
|
|
2387
|
+
this._slots.delete(e), t.renderGeneration++, t.presentationGeneration++, t.presentationHandle?.destroy(), t.presentationHandle = null, t.mediaInteractive = !1, t.dispatcher.destroy(), this._destroyed || (t.dispatcher = new O(t.canvas, this._mode === "worker" && !this._opts.enableMediaPlayback)), t.textLayer && (t.textLayer.innerHTML = "", this._clearTextLayerPreview(t.textLayer)), t.highlightLayer.innerHTML = "", t.highlightLayer.style.transform = "", t.highlightLayer.style.transformOrigin = "", t.loadingLayer.style.display = "none", t.commentMarkerLayer && (t.commentMarkerLayer.replaceChildren(), t.commentMarkerLayer.style.visibility = ""), t.commentMargin && (this._commentUi?.disposeReadOnlyCommentMargin(t.commentMargin), this._commentUi || t.commentMargin.replaceChildren(), t.commentMargin.style.visibility = ""), t.commentDecorationLayer && (this._commentUi?.disposeReadOnlyCommentDecoration(t.commentDecorationLayer), this._commentUi || t.commentDecorationLayer.replaceChildren(), t.commentDecorationLayer.style.visibility = ""), t.commentElementBounds = Object.freeze([]), t.commentGeometry = null, t.commentAnchorSlide = -1, t.commentAnchorGeneration++, D(t.elementLayer, null), t.canvas.style.height = "", t.renderedSlide = -1, t.renderedScale = -1, t.wrapper.remove(), this._free.push(t);
|
|
2380
2388
|
}
|
|
2381
2389
|
_positionSlot(e, t, n) {
|
|
2382
2390
|
e.wrapper.dataset.slideIndex = String(t), e.wrapper.style.top = `${this._slideOffset(t)}px`;
|
|
@@ -2402,7 +2410,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2402
2410
|
if (this._opts.enableMediaPlayback && n) return t.mediaInteractive = !0, this._trackSlotLoading(e, t, i, this._renderInteractiveSlot(e, t, o, a, c, s, r));
|
|
2403
2411
|
if (t.mediaInteractive = !1, this._mode === "worker") return this._trackSlotLoading(e, t, i, this._renderSlotBitmap(e, t, o, a, c, i, l, u, r));
|
|
2404
2412
|
let d = [], f = !!this._opts.enableTextSelection && !!t.textLayer, p = f || this._findActive, m = p ? (e) => d.push(e) : void 0, h = t.canvas;
|
|
2405
|
-
return this._trackSlotLoading(e, t, i,
|
|
2413
|
+
return this._trackSlotLoading(e, t, i, Q(this._pres, h, e, "main", {
|
|
2406
2414
|
width: o,
|
|
2407
2415
|
dpr: a,
|
|
2408
2416
|
imageResources: this._opts.imageResources,
|
|
@@ -2424,7 +2432,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2424
2432
|
_bindLayoutPresentation(e) {
|
|
2425
2433
|
this._unbindLayoutPresentation();
|
|
2426
2434
|
let t = !0;
|
|
2427
|
-
this._layoutUnsubscribe =
|
|
2435
|
+
this._layoutUnsubscribe = J(e, () => ({
|
|
2428
2436
|
availableSlides: e.availableSlideCount,
|
|
2429
2437
|
slideCount: e.slideCount,
|
|
2430
2438
|
exact: e.layoutComplete,
|
|
@@ -2509,7 +2517,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2509
2517
|
this._slideInFlight.add(e);
|
|
2510
2518
|
let u = t.canvas, d = !1, f = !!this._opts.enableTextSelection && !!t.textLayer, p = f || this._findActive, m = [];
|
|
2511
2519
|
try {
|
|
2512
|
-
let c = await
|
|
2520
|
+
let c = await Q(this._pres, u, e, "worker", {
|
|
2513
2521
|
width: n,
|
|
2514
2522
|
dpr: r,
|
|
2515
2523
|
imageResources: this._opts.imageResources,
|
|
@@ -2553,7 +2561,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2553
2561
|
let h = Math.max(0, m.totalHeight - this._scrollHost.clientHeight), g = this._slideOffset(l) + d * this._uniformSlideHeight, _ = c < this._slideOffset(0) ? s : g - o;
|
|
2554
2562
|
if (this._scrollHost.scrollTop = Math.min(h, Math.max(0, _)), i) {
|
|
2555
2563
|
let e = Math.max(0, (this._spacer.offsetWidth || 0) - this._scrollHost.clientWidth);
|
|
2556
|
-
this._scrollHost.scrollLeft =
|
|
2564
|
+
this._scrollHost.scrollLeft = ue(p, i.x - f, a, r, { maxScroll: e });
|
|
2557
2565
|
}
|
|
2558
2566
|
this._previewVisible(), this._scheduleSettle(), this._opts.onScaleChange?.(r);
|
|
2559
2567
|
}
|
|
@@ -2561,10 +2569,10 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2561
2569
|
return this._scaleEstablished ? this._scale : this._pendingScale ?? 1;
|
|
2562
2570
|
}
|
|
2563
2571
|
zoomIn() {
|
|
2564
|
-
this.setScale(
|
|
2572
|
+
this.setScale(Se(this.getScale()));
|
|
2565
2573
|
}
|
|
2566
2574
|
zoomOut() {
|
|
2567
|
-
this.setScale(
|
|
2575
|
+
this.setScale(A(this.getScale(), this._effectiveZoomMin()));
|
|
2568
2576
|
}
|
|
2569
2577
|
_effectiveZoomMin() {
|
|
2570
2578
|
let e = this._opts.zoomMin ?? .1;
|
|
@@ -2578,7 +2586,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2578
2586
|
}
|
|
2579
2587
|
_fit(e) {
|
|
2580
2588
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
2581
|
-
let t =
|
|
2589
|
+
let t = le({
|
|
2582
2590
|
contentWidth: this._pres.slideWidth / M,
|
|
2583
2591
|
contentHeight: this._pres.slideHeight / M,
|
|
2584
2592
|
containerWidth: this._fitWidthPx(),
|
|
@@ -2642,8 +2650,8 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2642
2650
|
}
|
|
2643
2651
|
let o = document.createElement("canvas"), s = ++t.renderGeneration;
|
|
2644
2652
|
o.style.cssText = "display:block;background:#fff;", this._applyPageShadow(o);
|
|
2645
|
-
let c = new
|
|
2646
|
-
|
|
2653
|
+
let c = new O(o, !1), l = c.begin(), u = [], d = !!this._opts.enableTextSelection && !!t.textLayer, f = d || this._findActive, p = f ? (e) => u.push(e) : void 0;
|
|
2654
|
+
Q(this._pres, o, e, "main", {
|
|
2647
2655
|
width: r,
|
|
2648
2656
|
dpr: n,
|
|
2649
2657
|
onTextRun: p
|
|
@@ -2676,7 +2684,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2676
2684
|
return;
|
|
2677
2685
|
}
|
|
2678
2686
|
let d = t.canvas, f = t.presentationHandle;
|
|
2679
|
-
t.dispatcher.destroy(), t.wrapper.insertBefore(s, d), d.remove(), t.canvas = s, t.dispatcher = new
|
|
2687
|
+
t.dispatcher.destroy(), t.wrapper.insertBefore(s, d), d.remove(), t.canvas = s, t.dispatcher = new O(s, !1), t.presentationHandle = r, t.renderedScale = i, f?.destroy(), t.textLayer && (this._clearTextLayerPreview(t.textLayer), l && I(t.textLayer, c, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler(), e)), u && this._refreshFindRuns(e, c), this._commitSlotComments(e, t), this._redrawSlotHighlights(e, t);
|
|
2680
2688
|
}).catch((e) => {
|
|
2681
2689
|
o === t.presentationGeneration && this._reportRenderError(e);
|
|
2682
2690
|
});
|
|
@@ -2951,9 +2959,9 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2951
2959
|
if (this._destroyed) throw Error("PptxScrollViewer is destroyed");
|
|
2952
2960
|
if (this._pres && this._activeCommentId !== null && this._activeCommentSlide !== null) {
|
|
2953
2961
|
let t = this._pres.getComments(this._activeCommentSlide), n = t.findIndex((e, t) => P(e, t, this._activeCommentSlide) === this._activeCommentId), r = t[n];
|
|
2954
|
-
if (r && n >= 0) return
|
|
2962
|
+
if (r && n >= 0) return Bt(r, this._activeCommentSlide, n, this._activeCommentId, e);
|
|
2955
2963
|
}
|
|
2956
|
-
return (this._opts.enableTextSelection ?
|
|
2964
|
+
return (this._opts.enableTextSelection ? Z(this._wrapper, this._wrapper.ownerDocument?.getSelection?.() ?? null, e) : null) ?? (this._elementContext ? Pt(this._elementContext, e.maxTextCharacters) : null);
|
|
2957
2965
|
}
|
|
2958
2966
|
_emitSelectionContextChange() {
|
|
2959
2967
|
let e = this.getSelectionContext();
|
|
@@ -2973,10 +2981,10 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2973
2981
|
_redrawElementOutlineForSlot(e, t) {
|
|
2974
2982
|
let n = this._elementContext, r = this._pres;
|
|
2975
2983
|
if (!n || !r || n.slideIndex !== e) {
|
|
2976
|
-
|
|
2984
|
+
D(t.elementLayer, null);
|
|
2977
2985
|
return;
|
|
2978
2986
|
}
|
|
2979
|
-
|
|
2987
|
+
D(t.elementLayer, {
|
|
2980
2988
|
x: n.bounds.x / r.slideWidth,
|
|
2981
2989
|
y: n.bounds.y / r.slideHeight,
|
|
2982
2990
|
width: n.bounds.width / r.slideWidth,
|
|
@@ -2997,7 +3005,7 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
2997
3005
|
async _resolveContextAt(e) {
|
|
2998
3006
|
let t = this._pres;
|
|
2999
3007
|
if (this._destroyed || !t) return null;
|
|
3000
|
-
if (this._opts.enableTextSelection &&
|
|
3008
|
+
if (this._opts.enableTextSelection && Z(this._wrapper, this._wrapper.ownerDocument?.getSelection?.() ?? null)) return this._emitSelectionContextChange(), this._destroyed ? null : this.getSelectionContext();
|
|
3001
3009
|
if (!this._opts.enableElementSelection) return this.getSelectionContext();
|
|
3002
3010
|
let n = e.target, r = [...this._slots].find(([, e]) => n !== null && e.wrapper.contains(n));
|
|
3003
3011
|
if (!r) return this._invalidateElementSelection(), null;
|
|
@@ -3027,22 +3035,22 @@ var $ = 440, Xt = 20, Zt = Symbol("PptxScrollViewer.borrowedPresentation"), Qt =
|
|
|
3027
3035
|
this._free.length = 0, this._presentationOwner.close(), this._wrapper.remove();
|
|
3028
3036
|
}
|
|
3029
3037
|
}
|
|
3030
|
-
},
|
|
3031
|
-
OoxmlDecodedImageLimitError: () =>
|
|
3032
|
-
OoxmlError: () =>
|
|
3033
|
-
OoxmlResourceLimitError: () =>
|
|
3034
|
-
PptxPresentation: () =>
|
|
3035
|
-
PptxScrollViewer: () =>
|
|
3038
|
+
}, en = /* @__PURE__ */ e({
|
|
3039
|
+
OoxmlDecodedImageLimitError: () => Me,
|
|
3040
|
+
OoxmlError: () => ee,
|
|
3041
|
+
OoxmlResourceLimitError: () => x,
|
|
3042
|
+
PptxPresentation: () => Y,
|
|
3043
|
+
PptxScrollViewer: () => $t,
|
|
3036
3044
|
PptxViewer: () => Gt,
|
|
3037
|
-
TiffDecodeError: () =>
|
|
3038
|
-
autoResize: () =>
|
|
3045
|
+
TiffDecodeError: () => Ne,
|
|
3046
|
+
autoResize: () => ce,
|
|
3039
3047
|
buildPptxHighlightLayer: () => L,
|
|
3040
3048
|
buildPptxTextLayer: () => I,
|
|
3041
|
-
isOoxmlDecodedImageLimitError: () =>
|
|
3042
|
-
isTiffDecodeError: () =>
|
|
3049
|
+
isOoxmlDecodedImageLimitError: () => je,
|
|
3050
|
+
isTiffDecodeError: () => Pe,
|
|
3043
3051
|
openExternalHyperlink: () => T,
|
|
3044
|
-
readPptxTextSelectionContext: () =>
|
|
3052
|
+
readPptxTextSelectionContext: () => Z,
|
|
3045
3053
|
renderSlide: () => f
|
|
3046
3054
|
});
|
|
3047
3055
|
//#endregion
|
|
3048
|
-
export {
|
|
3056
|
+
export { Y as a, Z as i, $t as n, L as o, Gt as r, I as s, en as t };
|