@silurus/ooxml 0.88.0 → 0.89.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/README.md +118 -23
- package/THIRD_PARTY_NOTICES.md +8 -7
- package/dist/abort-VrnK7mdP.js +10 -0
- package/dist/assets/render-worker-C5G_Nr_A.js +35 -0
- package/dist/assets/render-worker-DQfWdNsm.js +16 -0
- package/dist/assets/render-worker-Ds7LjwU-.js +15 -0
- package/dist/{hyperlink-Cxzhet30.js → bounded-raw-part-cache-CsnNptAy.js} +4937 -7458
- package/dist/bundled-asset-url-E2nXURF9.js +15 -0
- package/dist/canvas-viewer-mechanics-BZ8QCrRi.js +675 -0
- package/dist/cfb-guard-dNeUiANF.js +528 -0
- package/dist/chart-ex.mjs +667 -663
- package/dist/comment-overlay-controller-CBvQx-En.js +994 -0
- package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
- package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-BKidRH36.js} +5 -5
- package/dist/{comment-ui-runtime-CWGqn5Vr.js → comment-ui-runtime-C47QoDUy.js} +5 -5
- package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
- package/dist/document-model-source-MzFPrxt0.js +249 -0
- package/dist/document-pull-client-BoJeuURD.js +35941 -0
- package/dist/document-pull-worker-CaP8XESP.js +104 -0
- package/dist/docx-BN70UhvX.js +495 -0
- package/dist/docx-BRRtSvk3.js +3563 -0
- package/dist/docx-model-source-CTO9iw_W.js +98 -0
- package/dist/docx-source-worker.mjs +455 -0
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/drawingml-shape-CHmq8kpM.js +310 -0
- package/dist/duotone-DN8P4aXe.js +126 -0
- package/dist/emf-CGFQIz6c.js +1790 -0
- package/dist/font-preload-demand-Dmy31xt-.js +2058 -0
- package/dist/grid-geometry-C3IG20ut.js +384 -0
- package/dist/host-layout-DVMw8hDY.js +56 -0
- package/dist/host-layout-measure-DsuQ2UJs.js +7 -0
- package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
- package/dist/index.mjs +4 -4
- package/dist/internal-companion.mjs +12 -0
- package/dist/line-distribute-Bu8psjGd.js +2799 -0
- package/dist/math.mjs +2 -2
- package/dist/mathjax-stix2.js +10 -10
- package/dist/model-source-kz_NkZqT.js +179 -0
- package/dist/model-source-s5hRpk4w.js +61 -0
- package/dist/model-source-session-6fuaqbGs.js +71 -0
- package/dist/model-source-session-DqrR4XHR.js +85 -0
- package/dist/model-source-session-cPJSF_Ak.js +58 -0
- package/dist/node.mjs +7 -1327
- package/dist/{pixel-budget-9P63Bsk5.js → pixel-budget-BpTYrepD.js} +13 -10
- package/dist/plot-area-frame-Bs_j4uu7.js +41811 -0
- package/dist/pptx-CaJ6ILnw.js +183 -0
- package/dist/pptx-_BOGcBym.js +2936 -0
- package/dist/pptx-model-source-B_9afw9R.js +37 -0
- package/dist/pptx-source-worker.mjs +446 -0
- package/dist/pptx.mjs +8 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/presentation-model-source-CGHLyX32.js +77 -0
- package/dist/raster-target-YQ4G6rxo.js +42 -0
- package/dist/region-map.mjs +117 -153
- package/dist/{render-D3iqVKCo.js → render-CzbDzRKa.js} +3 -3
- package/dist/{render-worker-host-B5wQfB7U.js → render-worker-host-B1u6BOUd.js} +1 -1
- package/dist/{render-worker-host-D4123J27.js → render-worker-host-C-EECo68.js} +1 -1
- package/dist/{render-worker-host-Di3LxLc0.js → render-worker-host-DDqZTCVf.js} +1 -1
- package/dist/renderer-CD2cvVAF.js +5823 -0
- package/dist/renderer-DRoeb14O.js +5170 -0
- package/dist/resource-measurement-Dhhm7P_l.js +772 -0
- package/dist/session-XPmC0CUd.js +656 -0
- package/dist/slide-pull-client-tq7U_fYg.js +6485 -0
- package/dist/three-d-BKwNPAP4.js +878 -0
- package/dist/three-d.mjs +925 -910
- package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
- package/dist/tiff.mjs +401 -248
- package/dist/types/chart-ex.d.ts +149 -2
- package/dist/types/docx.d.ts +333 -96
- package/dist/types/index.d.ts +566 -301
- package/dist/types/internal-companion.d.ts +11 -0
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +422 -9
- package/dist/types/pptx.d.ts +302 -95
- package/dist/types/region-map.d.ts +149 -2
- package/dist/types/three-d.d.ts +149 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +343 -132
- package/dist/wasm-loader-rlgHmcSv.js +35 -0
- package/dist/wasm-runtime-generation-D6TKZdNb.js +97 -0
- package/dist/workbook-model-source-BIGrfZy6.js +94 -0
- package/dist/worker-source-DrwhR9fw.js +22 -0
- package/dist/worker-source-SbudzjYL.js +22 -0
- package/dist/worker-source-UAi3GNcM.js +22 -0
- package/dist/worksheet-pull-client-ClvPO_Jf.js +579 -0
- package/dist/xlsx-CsmREBaZ.js +5819 -0
- package/dist/xlsx-DmHfeNNp.js +534 -0
- package/dist/xlsx-model-source-D1flORqy.js +309 -0
- package/dist/xlsx-source-worker.mjs +525 -0
- package/dist/xlsx.mjs +8 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +42 -16
- package/dist/assets/render-worker-1uPAxMZr.js +0 -31
- package/dist/assets/render-worker-BlvJybji.js +0 -10
- package/dist/assets/render-worker-CzmiJfFL.js +0 -11
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/dist/canvas-viewer-mechanics-DbLz0rYW.js +0 -1384
- package/dist/cjk-fallback-bLI3z70h.js +0 -46
- package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
- package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/dist/comments-Diid5ujN.js +0 -246
- package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
- package/dist/document-pull-client-B9PTM-pL.js +0 -27280
- package/dist/docx-BF9WXrYH.js +0 -3103
- package/dist/dom-interaction-boundary-Cnm8DSBN.js +0 -223
- package/dist/highlight-rect-C5hkRqUr.js +0 -13
- package/dist/line-distribute-D1WNHKz_.js +0 -1023
- package/dist/line-metrics-B60C86uh.js +0 -60
- package/dist/plot-area-frame-DLTYKHNP.js +0 -4354
- package/dist/pptx-DkyYBYoL.js +0 -3065
- package/dist/renderer-B4GZb5We.js +0 -6492
- package/dist/resource-measurement-SHQCbkh2.js +0 -150
- package/dist/session-BGq81gRQ.js +0 -743
- package/dist/slide-pull-client-DiPnm240.js +0 -6253
- package/dist/source-key-DIJG8BA0.js +0 -42
- package/dist/three-d-DJBl8g8M.js +0 -1162
- package/dist/transfer-p6iCC2R7.js +0 -6
- package/dist/units-BzZ0gAxs.js +0 -4
- package/dist/worksheet-pull-client-BM8ywvbu.js +0 -458
- package/dist/xlsx-C9NVjgaV.js +0 -8484
- /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
- /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
- /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
- /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
- /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
- /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { Yt as e } from "./hyperlink-Cxzhet30.js";
|
|
2
|
-
import { A as t, E as n, j as r, k as i } from "./canvas-viewer-mechanics-DbLz0rYW.js";
|
|
3
|
-
//#region packages/core/src/fonts/embedded.ts
|
|
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);
|
|
9
|
-
for (let e = 0; e < i; e++) r[e] ^= n[e % 16];
|
|
10
|
-
return r;
|
|
11
|
-
}
|
|
12
|
-
function s(e) {
|
|
13
|
-
let t = e.replace(/[{}\-\s]/g, "");
|
|
14
|
-
if (t.length !== 32 || /[^0-9a-fA-F]/.test(t)) throw Error(`invalid fontKey GUID: ${e}`);
|
|
15
|
-
let n = new Uint8Array(16);
|
|
16
|
-
for (let e = 0; e < 16; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
|
|
17
|
-
return n.reverse();
|
|
18
|
-
}
|
|
19
|
-
function c(e, t, n, r) {
|
|
20
|
-
let i = 2166136261;
|
|
21
|
-
for (let e = 0; e < r.length; e++) i ^= r[e], i = Math.imul(i, 16777619);
|
|
22
|
-
return `${e}|${t}|${n}|${r.length}|${(i >>> 0).toString(16)}`;
|
|
23
|
-
}
|
|
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);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
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, {
|
|
38
|
-
weight: e.weight,
|
|
39
|
-
style: e.style
|
|
40
|
-
});
|
|
41
|
-
return u.add(r), r;
|
|
42
|
-
});
|
|
43
|
-
d.push(i);
|
|
44
|
-
} catch {
|
|
45
|
-
p.push(e.family);
|
|
46
|
-
}
|
|
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 = []);
|
|
54
|
-
}
|
|
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;
|
|
56
|
-
}
|
|
57
|
-
function u(e) {
|
|
58
|
-
t(e);
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region packages/core/src/layout/virtual-scroll.ts
|
|
62
|
-
function d(e, t, n) {
|
|
63
|
-
return e < t ? t : e > n ? n : e;
|
|
64
|
-
}
|
|
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) {
|
|
69
|
-
let r = e.length;
|
|
70
|
-
if (r === 0) return {
|
|
71
|
-
offsets: [],
|
|
72
|
-
totalHeight: 0
|
|
73
|
-
};
|
|
74
|
-
let i = n?.leading ?? 0, a = n?.trailing ?? 0, o = Array(r), s = 0;
|
|
75
|
-
for (let n = 0; n < r; n++) o[n] = i + s + n * t, s += e[n];
|
|
76
|
-
return {
|
|
77
|
-
offsets: o,
|
|
78
|
-
totalHeight: i + s + (r - 1) * t + a
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function m(e, t, n, r) {
|
|
82
|
-
let i = e.offsets, a = i.length;
|
|
83
|
-
if (a === 0) return {
|
|
84
|
-
start: 0,
|
|
85
|
-
end: -1,
|
|
86
|
-
topIndex: 0,
|
|
87
|
-
offsets: i,
|
|
88
|
-
totalHeight: 0
|
|
89
|
-
};
|
|
90
|
-
let o = 0, s = a;
|
|
91
|
-
for (; o < s;) {
|
|
92
|
-
let e = o + s >>> 1;
|
|
93
|
-
i[e] <= t ? o = e + 1 : s = e;
|
|
94
|
-
}
|
|
95
|
-
let c = d(o - 1, 0, a - 1), l = t + n;
|
|
96
|
-
for (o = 0, s = a; o < s;) {
|
|
97
|
-
let e = o + s >>> 1;
|
|
98
|
-
i[e] < l ? o = e + 1 : s = e;
|
|
99
|
-
}
|
|
100
|
-
let u = d(o - 1, 0, a - 1);
|
|
101
|
-
return {
|
|
102
|
-
start: d(c - r, 0, a - 1),
|
|
103
|
-
end: d(u + r, 0, a - 1),
|
|
104
|
-
topIndex: c,
|
|
105
|
-
offsets: i,
|
|
106
|
-
totalHeight: e.totalHeight
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function h(e, t, n, r, i, a, o) {
|
|
110
|
-
if (e === 0) return {
|
|
111
|
-
start: 0,
|
|
112
|
-
end: -1,
|
|
113
|
-
topIndex: 0,
|
|
114
|
-
totalHeight: 0
|
|
115
|
-
};
|
|
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);
|
|
117
|
-
return {
|
|
118
|
-
start: d(u - a, 0, e - 1),
|
|
119
|
-
end: d(p + a, 0, e - 1),
|
|
120
|
-
topIndex: u,
|
|
121
|
-
totalHeight: s + e * t + (e - 1) * n + c
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region packages/core/src/internal/progressive-layout-lifecycle.ts
|
|
126
|
-
var g = class {
|
|
127
|
-
state = Object.freeze({ status: "complete" });
|
|
128
|
-
get complete() {
|
|
129
|
-
return this.state.status === "complete";
|
|
130
|
-
}
|
|
131
|
-
get settled() {
|
|
132
|
-
return this.state.status !== "pending";
|
|
133
|
-
}
|
|
134
|
-
begin() {
|
|
135
|
-
this.state = Object.freeze({ status: "pending" });
|
|
136
|
-
}
|
|
137
|
-
succeed() {
|
|
138
|
-
this.state = Object.freeze({ status: "complete" });
|
|
139
|
-
}
|
|
140
|
-
fail(e) {
|
|
141
|
-
let t = e instanceof Error ? e : Error(String(e));
|
|
142
|
-
return this.state = Object.freeze({
|
|
143
|
-
status: "failed",
|
|
144
|
-
error: t
|
|
145
|
-
}), t;
|
|
146
|
-
}
|
|
147
|
-
throwIfFailed() {
|
|
148
|
-
if (this.state.status === "failed") throw this.state.error;
|
|
149
|
-
}
|
|
150
|
-
}, _ = class {
|
|
151
|
-
failed = /* @__PURE__ */ new WeakMap();
|
|
152
|
-
notify(e, t, ...n) {
|
|
153
|
-
if (!(!t || this.failed.get(t)?.has(e))) try {
|
|
154
|
-
let r = t(...n);
|
|
155
|
-
r && typeof r.then == "function" && Promise.resolve(r).catch((n) => this.reportOnce(e, t, n));
|
|
156
|
-
} catch (n) {
|
|
157
|
-
this.reportOnce(e, t, n);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
reportOnce(e, t, n) {
|
|
161
|
-
let r = this.failed.get(t) ?? /* @__PURE__ */ new Set();
|
|
162
|
-
if (r.has(e)) return;
|
|
163
|
-
r.add(e), this.failed.has(t) || this.failed.set(t, r);
|
|
164
|
-
let i = n instanceof Error ? n : Error(String(n));
|
|
165
|
-
console.error(`[ooxml] ${e} callback failed and was disabled:`, i);
|
|
166
|
-
}
|
|
167
|
-
}, v = 65536;
|
|
168
|
-
function y(e, t) {
|
|
169
|
-
let n = Math.min(e.length, t);
|
|
170
|
-
if (n > 0 && n < e.length) {
|
|
171
|
-
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
172
|
-
t >= 55296 && t <= 56319 && r >= 56320 && r <= 57343 && n--;
|
|
173
|
-
}
|
|
174
|
-
return e.slice(0, n);
|
|
175
|
-
}
|
|
176
|
-
function b(e) {
|
|
177
|
-
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
178
|
-
return Math.min(v, Math.floor(e ?? 65536));
|
|
179
|
-
}
|
|
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));
|
|
183
|
-
return i += t.length, t.length < e.text.length && (a = !0), {
|
|
184
|
-
...e,
|
|
185
|
-
text: t
|
|
186
|
-
};
|
|
187
|
-
}, s = Object.freeze({
|
|
188
|
-
root: Object.freeze(o(e)),
|
|
189
|
-
replies: Object.freeze(t.map((e) => Object.freeze(o(e))))
|
|
190
|
-
});
|
|
191
|
-
return Object.freeze({
|
|
192
|
-
thread: s,
|
|
193
|
-
truncated: a,
|
|
194
|
-
textCharacters: i,
|
|
195
|
-
maxTextCharacters: r
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region packages/core/src/internal/dom-interaction-boundary.ts
|
|
200
|
-
function S(e, t) {
|
|
201
|
-
return e.dataset?.[t] !== void 0;
|
|
202
|
-
}
|
|
203
|
-
function C(e, t, n) {
|
|
204
|
-
let r = typeof e.composedPath == "function" ? e.composedPath() : [];
|
|
205
|
-
if (r.length > 0) {
|
|
206
|
-
let e = !1;
|
|
207
|
-
for (let i of r) {
|
|
208
|
-
if (i === t) return e;
|
|
209
|
-
S(i, n) && (e = !0);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
let i = e.target;
|
|
213
|
-
if (!i || !t.contains(i)) return !1;
|
|
214
|
-
let a = i;
|
|
215
|
-
for (; a;) {
|
|
216
|
-
if (S(a, n)) return !0;
|
|
217
|
-
if (a === t) break;
|
|
218
|
-
a = a.parentElement;
|
|
219
|
-
}
|
|
220
|
-
return !1;
|
|
221
|
-
}
|
|
222
|
-
//#endregion
|
|
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 };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region packages/core/src/search/highlight-rect.ts
|
|
2
|
-
function e(e, t, n, r) {
|
|
3
|
-
let i = t <= 0 ? 0 : r(e.slice(0, t)), a = n >= e.length ? r(e) : r(e.slice(0, n));
|
|
4
|
-
return {
|
|
5
|
-
x: i,
|
|
6
|
-
width: Math.max(0, a - i)
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function t(e, t) {
|
|
10
|
-
return t > 0 ? `${e / t * 100}%` : "0%";
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { e as n, t };
|