@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
package/dist/docx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as r } from "./canvas-viewer-mechanics-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { cn as e, r as t, sn as n } from "./hyperlink-BR1NCO7S.js";
|
|
2
|
+
import { T as r } from "./canvas-viewer-mechanics-DN5SqWGS.js";
|
|
3
|
+
import { a as i, c as a, i as o, l as s, n as c, o as l, r as u, s as d } from "./docx-wPzeF76A.js";
|
|
4
|
+
import { l as f, s as p } from "./pixel-budget-Dgjw269h.js";
|
|
5
|
+
import { i as m, s as h } from "./raster-target-ojDdQizC.js";
|
|
6
6
|
import { n as g, r as _ } from "./comments-CAn2A_Xh.js";
|
|
7
|
-
export {
|
|
7
|
+
export { a as DocxDocument, u as DocxScrollViewer, o as DocxViewer, p as OoxmlDecodedImageLimitError, n as OoxmlError, e as OoxmlResourceLimitError, m as TiffDecodeError, r as autoResize, l as buildDocxHighlightLayer, d as buildDocxTextLayer, f as isOoxmlDecodedImageLimitError, h as isTiffDecodeError, c as noteText, t as openExternalHyperlink, i as readDocxTextSelectionContext, g as resolveCommentAnchorRuns, _ as resolveDocxCommentThreads, s as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { qt as e } from "./hyperlink-BR1NCO7S.js";
|
|
2
|
+
import { A as t, E as n, j as r, k as i } from "./canvas-viewer-mechanics-DN5SqWGS.js";
|
|
3
3
|
//#region packages/core/src/fonts/embedded.ts
|
|
4
|
-
function a(
|
|
5
|
-
|
|
4
|
+
function a(t, n = e) {
|
|
5
|
+
return t.byteLength > 0 && t.byteLength <= n;
|
|
6
|
+
}
|
|
7
|
+
function o(e, t) {
|
|
8
|
+
let n = s(t), r = e.slice(), i = Math.min(32, r.length);
|
|
6
9
|
for (let e = 0; e < i; e++) r[e] ^= n[e % 16];
|
|
7
10
|
return r;
|
|
8
11
|
}
|
|
9
|
-
function
|
|
12
|
+
function s(e) {
|
|
10
13
|
let t = e.replace(/[{}\-\s]/g, "");
|
|
11
14
|
if (t.length !== 32 || /[^0-9a-fA-F]/.test(t)) throw Error(`invalid fontKey GUID: ${e}`);
|
|
12
15
|
let n = new Uint8Array(16);
|
|
13
16
|
for (let e = 0; e < 16; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
|
|
14
17
|
return n.reverse();
|
|
15
18
|
}
|
|
16
|
-
function
|
|
19
|
+
function c(e, t, n, r) {
|
|
17
20
|
let i = 2166136261;
|
|
18
21
|
for (let e = 0; e < r.length; e++) i ^= r[e], i = Math.imul(i, 16777619);
|
|
19
22
|
return `${e}|${t}|${n}|${r.length}|${(i >>> 0).toString(16)}`;
|
|
20
23
|
}
|
|
21
|
-
async function
|
|
22
|
-
let
|
|
23
|
-
if (!
|
|
24
|
-
let
|
|
25
|
-
for (let e of
|
|
26
|
-
if (e.bytes
|
|
27
|
-
|
|
24
|
+
async function l(s, l = e) {
|
|
25
|
+
let u = n();
|
|
26
|
+
if (!u || typeof FontFace > "u") return [];
|
|
27
|
+
let d = [], f = /* @__PURE__ */ new Set(), p = [];
|
|
28
|
+
for (let e of s) try {
|
|
29
|
+
if (!a(e.bytes, l)) {
|
|
30
|
+
p.push(e.family);
|
|
28
31
|
continue;
|
|
29
32
|
}
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
let { face: i } =
|
|
34
|
-
let
|
|
33
|
+
let t = e.odttf ? o(e.bytes, e.fontKey ?? "") : e.bytes, n = `embedded:${c(e.family, e.weight, e.style, t)}`;
|
|
34
|
+
if (f.has(n)) continue;
|
|
35
|
+
f.add(n);
|
|
36
|
+
let { face: i } = r(n, u, () => {
|
|
37
|
+
let n = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength), r = new FontFace(e.family, n, {
|
|
35
38
|
weight: e.weight,
|
|
36
39
|
style: e.style
|
|
37
40
|
});
|
|
38
|
-
return
|
|
41
|
+
return u.add(r), r;
|
|
39
42
|
});
|
|
40
|
-
|
|
43
|
+
d.push(i);
|
|
41
44
|
} catch {
|
|
42
|
-
|
|
45
|
+
p.push(e.family);
|
|
43
46
|
}
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
let e = await
|
|
47
|
-
Array.isArray(e) ? (
|
|
48
|
-
let
|
|
49
|
-
e.status === "fulfilled" ?
|
|
50
|
-
}), await
|
|
47
|
+
let m = d;
|
|
48
|
+
if (d.length > 0) {
|
|
49
|
+
let e = await i(Promise.allSettled(d.map((e) => Promise.resolve().then(() => e.load()))));
|
|
50
|
+
Array.isArray(e) ? (m = [], e.forEach((e, n) => {
|
|
51
|
+
let r = d[n];
|
|
52
|
+
e.status === "fulfilled" ? m.push(r) : (p.push(r.family), t([r]));
|
|
53
|
+
}), await i(u.ready)) : (p.push(...d.map((e) => e.family)), t(d), m = []);
|
|
51
54
|
}
|
|
52
|
-
return
|
|
55
|
+
return p.length > 0 && console.warn(`[ooxml] failed to register embedded font(s): ${[...new Set(p)].join(", ")}; falling back to substitute fonts (text may shift or differ).`), m;
|
|
53
56
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
57
|
+
function u(e) {
|
|
58
|
+
t(e);
|
|
56
59
|
}
|
|
57
60
|
//#endregion
|
|
58
61
|
//#region packages/core/src/layout/virtual-scroll.ts
|
|
59
|
-
function
|
|
62
|
+
function d(e, t, n) {
|
|
60
63
|
return e < t ? t : e > n ? n : e;
|
|
61
64
|
}
|
|
62
|
-
function
|
|
65
|
+
function f(e, t, n) {
|
|
63
66
|
let r = e.length;
|
|
64
67
|
if (r === 0) return {
|
|
65
68
|
offsets: [],
|
|
@@ -72,7 +75,7 @@ function d(e, t, n) {
|
|
|
72
75
|
totalHeight: i + s + (r - 1) * t + a
|
|
73
76
|
};
|
|
74
77
|
}
|
|
75
|
-
function
|
|
78
|
+
function p(e, t, n, r) {
|
|
76
79
|
let i = e.offsets, a = i.length;
|
|
77
80
|
if (a === 0) return {
|
|
78
81
|
start: 0,
|
|
@@ -86,38 +89,38 @@ function f(e, t, n, r) {
|
|
|
86
89
|
let e = o + s >>> 1;
|
|
87
90
|
i[e] <= t ? o = e + 1 : s = e;
|
|
88
91
|
}
|
|
89
|
-
let c =
|
|
92
|
+
let c = d(o - 1, 0, a - 1), l = t + n;
|
|
90
93
|
for (o = 0, s = a; o < s;) {
|
|
91
94
|
let e = o + s >>> 1;
|
|
92
95
|
i[e] < l ? o = e + 1 : s = e;
|
|
93
96
|
}
|
|
94
|
-
let
|
|
97
|
+
let u = d(o - 1, 0, a - 1);
|
|
95
98
|
return {
|
|
96
|
-
start:
|
|
97
|
-
end: u
|
|
99
|
+
start: d(c - r, 0, a - 1),
|
|
100
|
+
end: d(u + r, 0, a - 1),
|
|
98
101
|
topIndex: c,
|
|
99
102
|
offsets: i,
|
|
100
103
|
totalHeight: e.totalHeight
|
|
101
104
|
};
|
|
102
105
|
}
|
|
103
|
-
function
|
|
106
|
+
function m(e, t, n, r, i, a, o) {
|
|
104
107
|
if (e === 0) return {
|
|
105
108
|
start: 0,
|
|
106
109
|
end: -1,
|
|
107
110
|
topIndex: 0,
|
|
108
111
|
totalHeight: 0
|
|
109
112
|
};
|
|
110
|
-
let s = o?.leading ?? 0, c = o?.trailing ?? 0, l = t + n,
|
|
113
|
+
let s = o?.leading ?? 0, c = o?.trailing ?? 0, l = t + n, u = d(r < s ? 0 : l > 0 ? Math.floor((r - s) / l) : e - 1, 0, e - 1), f = r + i, p = d(f <= s ? 0 : l > 0 ? Math.ceil((f - s) / l) - 1 : e - 1, 0, e - 1);
|
|
111
114
|
return {
|
|
112
|
-
start: u
|
|
113
|
-
end:
|
|
114
|
-
topIndex:
|
|
115
|
+
start: d(u - a, 0, e - 1),
|
|
116
|
+
end: d(p + a, 0, e - 1),
|
|
117
|
+
topIndex: u,
|
|
115
118
|
totalHeight: s + e * t + (e - 1) * n + c
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
//#endregion
|
|
119
122
|
//#region packages/core/src/internal/progressive-layout-lifecycle.ts
|
|
120
|
-
var
|
|
123
|
+
var h = class {
|
|
121
124
|
state = Object.freeze({ status: "complete" });
|
|
122
125
|
get complete() {
|
|
123
126
|
return this.state.status === "complete";
|
|
@@ -141,7 +144,7 @@ var m = class {
|
|
|
141
144
|
throwIfFailed() {
|
|
142
145
|
if (this.state.status === "failed") throw this.state.error;
|
|
143
146
|
}
|
|
144
|
-
},
|
|
147
|
+
}, g = class {
|
|
145
148
|
failed = /* @__PURE__ */ new WeakMap();
|
|
146
149
|
notify(e, t, ...n) {
|
|
147
150
|
if (!(!t || this.failed.get(t)?.has(e))) try {
|
|
@@ -158,8 +161,8 @@ var m = class {
|
|
|
158
161
|
let i = n instanceof Error ? n : Error(String(n));
|
|
159
162
|
console.error(`[ooxml] ${e} callback failed and was disabled:`, i);
|
|
160
163
|
}
|
|
161
|
-
},
|
|
162
|
-
function
|
|
164
|
+
}, _ = 65536;
|
|
165
|
+
function v(e, t) {
|
|
163
166
|
let n = Math.min(e.length, t);
|
|
164
167
|
if (n > 0 && n < e.length) {
|
|
165
168
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -167,13 +170,13 @@ function _(e, t) {
|
|
|
167
170
|
}
|
|
168
171
|
return e.slice(0, n);
|
|
169
172
|
}
|
|
170
|
-
function
|
|
173
|
+
function y(e) {
|
|
171
174
|
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
172
|
-
return Math.min(
|
|
175
|
+
return Math.min(_, Math.floor(e ?? 65536));
|
|
173
176
|
}
|
|
174
|
-
function
|
|
175
|
-
let r =
|
|
176
|
-
let t =
|
|
177
|
+
function b(e, t, n) {
|
|
178
|
+
let r = y(n), i = 0, a = !1, o = (e) => {
|
|
179
|
+
let t = v(e.text, Math.max(0, r - i));
|
|
177
180
|
return i += t.length, t.length < e.text.length && (a = !0), {
|
|
178
181
|
...e,
|
|
179
182
|
text: t
|
|
@@ -191,27 +194,27 @@ function y(e, t, n) {
|
|
|
191
194
|
}
|
|
192
195
|
//#endregion
|
|
193
196
|
//#region packages/core/src/internal/dom-interaction-boundary.ts
|
|
194
|
-
function
|
|
197
|
+
function x(e, t) {
|
|
195
198
|
return e.dataset?.[t] !== void 0;
|
|
196
199
|
}
|
|
197
|
-
function
|
|
200
|
+
function S(e, t, n) {
|
|
198
201
|
let r = typeof e.composedPath == "function" ? e.composedPath() : [];
|
|
199
202
|
if (r.length > 0) {
|
|
200
203
|
let e = !1;
|
|
201
204
|
for (let i of r) {
|
|
202
205
|
if (i === t) return e;
|
|
203
|
-
|
|
206
|
+
x(i, n) && (e = !0);
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
let i = e.target;
|
|
207
210
|
if (!i || !t.contains(i)) return !1;
|
|
208
211
|
let a = i;
|
|
209
212
|
for (; a;) {
|
|
210
|
-
if (
|
|
213
|
+
if (x(a, n)) return !0;
|
|
211
214
|
if (a === t) break;
|
|
212
215
|
a = a.parentElement;
|
|
213
216
|
}
|
|
214
217
|
return !1;
|
|
215
218
|
}
|
|
216
219
|
//#endregion
|
|
217
|
-
export {
|
|
220
|
+
export { m as a, o as c, u as d, h as i, a as l, b as n, p as o, g as r, f as s, S as t, l as u };
|