@silurus/ooxml 0.86.0 → 0.87.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 +42 -2
- package/dist/assets/render-worker-CeK_iqK3.js +10 -0
- package/dist/assets/render-worker-DusrDhPk.js +11 -0
- package/dist/assets/render-worker-n2ZG0lrQ.js +31 -0
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +119 -0
- package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-Cpk0YFvM.js} +301 -155
- package/dist/chart-ex.mjs +1 -1
- package/dist/cjk-fallback-bLI3z70h.js +46 -0
- package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-BfE7MJZn.js} +4 -4
- package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
- package/dist/{comment-ui-runtime-DEtgcmj7.js → comment-ui-runtime-DcJOYlw-.js} +5 -5
- package/dist/{comments-CAn2A_Xh.js → comments-Diid5ujN.js} +1 -1
- package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-yKxI8aDH.js} +4326 -4238
- package/dist/{docx-DzDiGvqe.js → docx-BkSRiy07.js} +541 -349
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CBUQJsIM.js} +63 -57
- package/dist/{hyperlink-enyPbflR.js → hyperlink-ArrU3ArU.js} +1014 -951
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-Dtudnqhs.js +1023 -0
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +380 -376
- package/dist/{pptx-D_U62nl-.js → pptx-62MmVbYB.js} +462 -447
- package/dist/pptx.mjs +7 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +1 -1
- package/dist/{render-DSn0d35X.js → render-8Zo7dnds.js} +31 -29
- package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-BfbnEChF.js} +1 -1
- package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-DNL9dWRh.js} +1 -1
- package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-IkHrYOci.js} +1 -1
- package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CJsgolre.js} +9 -9
- package/dist/{session-C1GYhr6n.js → session-CrU8f8DI.js} +91 -91
- package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-B9KA8bU6.js} +1069 -966
- package/dist/three-d.mjs +1 -1
- package/dist/tiff.mjs +1 -1
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +15 -12
- package/dist/types/index.d.ts +23 -18
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +12 -6
- package/dist/types/pptx.d.ts +15 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +15 -11
- package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-eIcQ-xlD.js} +65 -65
- package/dist/{xlsx-CMHmYTHP.js → xlsx-CRcSzZNq.js} +1656 -1630
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-BCGnuBLj.js +0 -10
- package/dist/assets/render-worker-CB4DxjXg.js +0 -31
- package/dist/assets/render-worker-CHW0F0n6.js +0 -11
- package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
- package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
- package/dist/line-distribute-BFB575d6.js +0 -1023
- /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-C8Y2uoVr.js} +0 -0
- /package/dist/{delimited-text-worker-host-DcHj_JZt.js → delimited-text-worker-host-BVY-Ecni.js} +0 -0
- /package/dist/{highlight-rect-FuUSmL3a.js → highlight-rect-C5hkRqUr.js} +0 -0
- /package/dist/{line-metrics-CBbw80Ko.js → line-metrics-B60C86uh.js} +0 -0
- /package/dist/{mathjax-DS69BmJd.js → mathjax-DoyWZbSp.js} +0 -0
- /package/dist/{read-only-comment-decoration-BTnWEeo5.js → read-only-comment-decoration-Dz7eTQ4d.js} +0 -0
- /package/dist/{read-only-comment-margin-plStyGfE.js → read-only-comment-margin-DkgzASAl.js} +0 -0
- /package/dist/{renderer-module-contract-Cu-GKuPd.js → renderer-module-contract-D91rkYHH.js} +0 -0
- /package/dist/{source-key-Ktb1GRE5.js → source-key-DIJG8BA0.js} +0 -0
- /package/dist/{transfer-mIj7E7NB.js → transfer-p6iCC2R7.js} +0 -0
- /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.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 {
|
|
6
|
-
import { n as g, r as _ } from "./comments-
|
|
7
|
-
export {
|
|
1
|
+
import { ln as e, r as t, un as n } from "./hyperlink-ArrU3ArU.js";
|
|
2
|
+
import { T as r } from "./canvas-viewer-mechanics-Cpk0YFvM.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-BkSRiy07.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
|
+
import { n as g, r as _ } from "./comments-Diid5ujN.js";
|
|
7
|
+
export { a as DocxDocument, u as DocxScrollViewer, o as DocxViewer, p as OoxmlDecodedImageLimitError, e as OoxmlError, n 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,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Yt as e } from "./hyperlink-ArrU3ArU.js";
|
|
2
|
+
import { A as t, E as n, j as r, k as i } from "./canvas-viewer-mechanics-Cpk0YFvM.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) {
|
|
66
|
+
return Math.min(Math.max(0, t), Math.ceil(Math.max(0, e)));
|
|
67
|
+
}
|
|
68
|
+
function p(e, t, n) {
|
|
63
69
|
let r = e.length;
|
|
64
70
|
if (r === 0) return {
|
|
65
71
|
offsets: [],
|
|
@@ -72,7 +78,7 @@ function d(e, t, n) {
|
|
|
72
78
|
totalHeight: i + s + (r - 1) * t + a
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
|
-
function
|
|
81
|
+
function m(e, t, n, r) {
|
|
76
82
|
let i = e.offsets, a = i.length;
|
|
77
83
|
if (a === 0) return {
|
|
78
84
|
start: 0,
|
|
@@ -86,38 +92,38 @@ function f(e, t, n, r) {
|
|
|
86
92
|
let e = o + s >>> 1;
|
|
87
93
|
i[e] <= t ? o = e + 1 : s = e;
|
|
88
94
|
}
|
|
89
|
-
let c =
|
|
95
|
+
let c = d(o - 1, 0, a - 1), l = t + n;
|
|
90
96
|
for (o = 0, s = a; o < s;) {
|
|
91
97
|
let e = o + s >>> 1;
|
|
92
98
|
i[e] < l ? o = e + 1 : s = e;
|
|
93
99
|
}
|
|
94
|
-
let
|
|
100
|
+
let u = d(o - 1, 0, a - 1);
|
|
95
101
|
return {
|
|
96
|
-
start:
|
|
97
|
-
end: u
|
|
102
|
+
start: d(c - r, 0, a - 1),
|
|
103
|
+
end: d(u + r, 0, a - 1),
|
|
98
104
|
topIndex: c,
|
|
99
105
|
offsets: i,
|
|
100
106
|
totalHeight: e.totalHeight
|
|
101
107
|
};
|
|
102
108
|
}
|
|
103
|
-
function
|
|
109
|
+
function h(e, t, n, r, i, a, o) {
|
|
104
110
|
if (e === 0) return {
|
|
105
111
|
start: 0,
|
|
106
112
|
end: -1,
|
|
107
113
|
topIndex: 0,
|
|
108
114
|
totalHeight: 0
|
|
109
115
|
};
|
|
110
|
-
let s = o?.leading ?? 0, c = o?.trailing ?? 0, l = t + n,
|
|
116
|
+
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
117
|
return {
|
|
112
|
-
start: u
|
|
113
|
-
end:
|
|
114
|
-
topIndex:
|
|
118
|
+
start: d(u - a, 0, e - 1),
|
|
119
|
+
end: d(p + a, 0, e - 1),
|
|
120
|
+
topIndex: u,
|
|
115
121
|
totalHeight: s + e * t + (e - 1) * n + c
|
|
116
122
|
};
|
|
117
123
|
}
|
|
118
124
|
//#endregion
|
|
119
125
|
//#region packages/core/src/internal/progressive-layout-lifecycle.ts
|
|
120
|
-
var
|
|
126
|
+
var g = class {
|
|
121
127
|
state = Object.freeze({ status: "complete" });
|
|
122
128
|
get complete() {
|
|
123
129
|
return this.state.status === "complete";
|
|
@@ -141,7 +147,7 @@ var m = class {
|
|
|
141
147
|
throwIfFailed() {
|
|
142
148
|
if (this.state.status === "failed") throw this.state.error;
|
|
143
149
|
}
|
|
144
|
-
},
|
|
150
|
+
}, _ = class {
|
|
145
151
|
failed = /* @__PURE__ */ new WeakMap();
|
|
146
152
|
notify(e, t, ...n) {
|
|
147
153
|
if (!(!t || this.failed.get(t)?.has(e))) try {
|
|
@@ -158,8 +164,8 @@ var m = class {
|
|
|
158
164
|
let i = n instanceof Error ? n : Error(String(n));
|
|
159
165
|
console.error(`[ooxml] ${e} callback failed and was disabled:`, i);
|
|
160
166
|
}
|
|
161
|
-
},
|
|
162
|
-
function
|
|
167
|
+
}, v = 65536;
|
|
168
|
+
function y(e, t) {
|
|
163
169
|
let n = Math.min(e.length, t);
|
|
164
170
|
if (n > 0 && n < e.length) {
|
|
165
171
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -167,13 +173,13 @@ function _(e, t) {
|
|
|
167
173
|
}
|
|
168
174
|
return e.slice(0, n);
|
|
169
175
|
}
|
|
170
|
-
function
|
|
176
|
+
function b(e) {
|
|
171
177
|
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
172
|
-
return Math.min(
|
|
178
|
+
return Math.min(v, Math.floor(e ?? 65536));
|
|
173
179
|
}
|
|
174
|
-
function
|
|
175
|
-
let r =
|
|
176
|
-
let t =
|
|
180
|
+
function x(e, t, n) {
|
|
181
|
+
let r = b(n), i = 0, a = !1, o = (e) => {
|
|
182
|
+
let t = y(e.text, Math.max(0, r - i));
|
|
177
183
|
return i += t.length, t.length < e.text.length && (a = !0), {
|
|
178
184
|
...e,
|
|
179
185
|
text: t
|
|
@@ -191,27 +197,27 @@ function y(e, t, n) {
|
|
|
191
197
|
}
|
|
192
198
|
//#endregion
|
|
193
199
|
//#region packages/core/src/internal/dom-interaction-boundary.ts
|
|
194
|
-
function
|
|
200
|
+
function S(e, t) {
|
|
195
201
|
return e.dataset?.[t] !== void 0;
|
|
196
202
|
}
|
|
197
|
-
function
|
|
203
|
+
function C(e, t, n) {
|
|
198
204
|
let r = typeof e.composedPath == "function" ? e.composedPath() : [];
|
|
199
205
|
if (r.length > 0) {
|
|
200
206
|
let e = !1;
|
|
201
207
|
for (let i of r) {
|
|
202
208
|
if (i === t) return e;
|
|
203
|
-
|
|
209
|
+
S(i, n) && (e = !0);
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
let i = e.target;
|
|
207
213
|
if (!i || !t.contains(i)) return !1;
|
|
208
214
|
let a = i;
|
|
209
215
|
for (; a;) {
|
|
210
|
-
if (
|
|
216
|
+
if (S(a, n)) return !0;
|
|
211
217
|
if (a === t) break;
|
|
212
218
|
a = a.parentElement;
|
|
213
219
|
}
|
|
214
220
|
return !1;
|
|
215
221
|
}
|
|
216
222
|
//#endregion
|
|
217
|
-
export {
|
|
223
|
+
export { h as a, f as c, l as d, u as f, g as i, o as l, x as n, m as o, _ as r, p as s, C as t, a as u };
|