@silurus/ooxml 0.82.0 → 0.83.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 +72 -3
- package/dist/assets/{render-worker-7-Zr7fSw.js → render-worker-Bu31cf1J.js} +4 -4
- package/dist/assets/render-worker-DuztdEcX.js +11 -0
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-BAe30Ct9.js → comment-ui-runtime-BelHJt73.js} +3 -3
- package/dist/{comment-ui-runtime-BUCj4hWn.js → comment-ui-runtime-DD5a3x3k.js} +3 -3
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-BCgmytqI.js → document-pull-client-BAhqoTmm.js} +4509 -3953
- package/dist/docx-Dg73PGgC.js +2707 -0
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-D7A_wnJg.js +1003 -0
- package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
- package/dist/node.mjs +308 -308
- package/dist/pptx-BcUCETmQ.js +2990 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{read-only-comment-margin-Dn2y55W6.js → read-only-comment-margin-DrUX-YrP.js} +1 -1
- package/dist/{render-CenWM4g1.js → render-CL-7V3E8.js} +1 -1
- package/dist/{render-worker-host-BNENN3qP.js → render-worker-host-DDZo0feh.js} +1 -1
- package/dist/{render-worker-host-BmH3kGSj.js → render-worker-host-FJ19-fUI.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Cky_swUj.js → session-BjydZEDF.js} +107 -94
- package/dist/{slide-pull-client-CqTVFb3W.js → slide-pull-client-CwvvncPA.js} +1199 -970
- package/dist/types/docx.d.ts +99 -7
- package/dist/types/index.d.ts +189 -12
- package/dist/types/node.d.ts +385 -379
- package/dist/types/pptx.d.ts +96 -5
- package/dist/types/xlsx.d.ts +4 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DlV37-0j.js → xlsx-BibrHQ52.js} +477 -477
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +4 -1
- package/dist/assets/render-worker-B5gsW6b5.js +0 -11
- package/dist/comment-ui-runtime-F4a3te6p.js +0 -2
- package/dist/docx-wokGKYfi.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DU8L8I2T.js +0 -2432
- /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
- /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
package/dist/docx.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { w as r } from "./canvas-viewer-mechanics-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as m, r as h } from "./comments-
|
|
6
|
-
export {
|
|
1
|
+
import { Qt as e, Zt as t, a as n } from "./line-metrics-Bpn7OeZD.js";
|
|
2
|
+
import { w as r } from "./canvas-viewer-mechanics-h07vpVOQ.js";
|
|
3
|
+
import { cn as i, ln as a } from "./plot-area-frame-DHV02PJU.js";
|
|
4
|
+
import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p } from "./docx-Dg73PGgC.js";
|
|
5
|
+
import { n as m, r as h } from "./comments-AAaNnQTi.js";
|
|
6
|
+
export { s as DocxDocument, f as DocxScrollViewer, c as DocxViewer, i as OoxmlDecodedImageLimitError, t as OoxmlError, e as OoxmlResourceLimitError, r as autoResize, d as buildDocxHighlightLayer, p as buildDocxTextLayer, a as isOoxmlDecodedImageLimitError, u as noteText, n as openExternalHyperlink, o as readDocxTextSelectionContext, m as resolveCommentAnchorRuns, h as resolveDocxCommentThreads, l as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Lt as e } from "./line-metrics-Bpn7OeZD.js";
|
|
2
|
+
import { c as t, o as n, r, s as i } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
3
|
+
//#region packages/core/src/fonts/embedded.ts
|
|
4
|
+
function a(e, t) {
|
|
5
|
+
let n = o(t), r = e.slice(), i = Math.min(32, r.length);
|
|
6
|
+
for (let e = 0; e < i; e++) r[e] ^= n[e % 16];
|
|
7
|
+
return r;
|
|
8
|
+
}
|
|
9
|
+
function o(e) {
|
|
10
|
+
let t = e.replace(/[{}\-\s]/g, "");
|
|
11
|
+
if (t.length !== 32 || /[^0-9a-fA-F]/.test(t)) throw Error(`invalid fontKey GUID: ${e}`);
|
|
12
|
+
let n = new Uint8Array(16);
|
|
13
|
+
for (let e = 0; e < 16; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
|
|
14
|
+
return n.reverse();
|
|
15
|
+
}
|
|
16
|
+
function s(e, t, n, r) {
|
|
17
|
+
let i = 2166136261;
|
|
18
|
+
for (let e = 0; e < r.length; e++) i ^= r[e], i = Math.imul(i, 16777619);
|
|
19
|
+
return `${e}|${t}|${n}|${r.length}|${(i >>> 0).toString(16)}`;
|
|
20
|
+
}
|
|
21
|
+
async function c(o, c = e) {
|
|
22
|
+
let l = r();
|
|
23
|
+
if (!l || typeof FontFace > "u") return [];
|
|
24
|
+
let u = [], d = /* @__PURE__ */ new Set(), f = [];
|
|
25
|
+
for (let e of o) try {
|
|
26
|
+
if (e.bytes.length === 0 || e.bytes.length > c) {
|
|
27
|
+
f.push(e.family);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
let n = e.odttf ? a(e.bytes, e.fontKey ?? "") : e.bytes, r = `embedded:${s(e.family, e.weight, e.style, n)}`;
|
|
31
|
+
if (d.has(r)) continue;
|
|
32
|
+
d.add(r);
|
|
33
|
+
let { face: i } = t(r, l, () => {
|
|
34
|
+
let t = n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength), r = new FontFace(e.family, t, {
|
|
35
|
+
weight: e.weight,
|
|
36
|
+
style: e.style
|
|
37
|
+
});
|
|
38
|
+
return l.add(r), r;
|
|
39
|
+
});
|
|
40
|
+
u.push(i);
|
|
41
|
+
} catch {
|
|
42
|
+
f.push(e.family);
|
|
43
|
+
}
|
|
44
|
+
let p = u;
|
|
45
|
+
if (u.length > 0) {
|
|
46
|
+
let e = await n(Promise.allSettled(u.map((e) => Promise.resolve().then(() => e.load()))));
|
|
47
|
+
Array.isArray(e) ? (p = [], e.forEach((e, t) => {
|
|
48
|
+
let n = u[t];
|
|
49
|
+
e.status === "fulfilled" ? p.push(n) : (f.push(n.family), i([n]));
|
|
50
|
+
}), await n(l.ready)) : (f.push(...u.map((e) => e.family)), i(u), p = []);
|
|
51
|
+
}
|
|
52
|
+
return f.length > 0 && console.warn(`[ooxml] failed to register embedded font(s): ${[...new Set(f)].join(", ")}; falling back to substitute fonts (text may shift or differ).`), p;
|
|
53
|
+
}
|
|
54
|
+
function l(e) {
|
|
55
|
+
i(e);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region packages/core/src/layout/virtual-scroll.ts
|
|
59
|
+
function u(e, t, n) {
|
|
60
|
+
return e < t ? t : e > n ? n : e;
|
|
61
|
+
}
|
|
62
|
+
function d(e, t, n) {
|
|
63
|
+
let r = e.length;
|
|
64
|
+
if (r === 0) return {
|
|
65
|
+
offsets: [],
|
|
66
|
+
totalHeight: 0
|
|
67
|
+
};
|
|
68
|
+
let i = n?.leading ?? 0, a = n?.trailing ?? 0, o = Array(r), s = 0;
|
|
69
|
+
for (let n = 0; n < r; n++) o[n] = i + s + n * t, s += e[n];
|
|
70
|
+
return {
|
|
71
|
+
offsets: o,
|
|
72
|
+
totalHeight: i + s + (r - 1) * t + a
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function f(e, t, n, r) {
|
|
76
|
+
let i = e.offsets, a = i.length;
|
|
77
|
+
if (a === 0) return {
|
|
78
|
+
start: 0,
|
|
79
|
+
end: -1,
|
|
80
|
+
topIndex: 0,
|
|
81
|
+
offsets: i,
|
|
82
|
+
totalHeight: 0
|
|
83
|
+
};
|
|
84
|
+
let o = 0, s = a;
|
|
85
|
+
for (; o < s;) {
|
|
86
|
+
let e = o + s >>> 1;
|
|
87
|
+
i[e] <= t ? o = e + 1 : s = e;
|
|
88
|
+
}
|
|
89
|
+
let c = u(o - 1, 0, a - 1), l = t + n;
|
|
90
|
+
for (o = 0, s = a; o < s;) {
|
|
91
|
+
let e = o + s >>> 1;
|
|
92
|
+
i[e] < l ? o = e + 1 : s = e;
|
|
93
|
+
}
|
|
94
|
+
let d = u(o - 1, 0, a - 1);
|
|
95
|
+
return {
|
|
96
|
+
start: u(c - r, 0, a - 1),
|
|
97
|
+
end: u(d + r, 0, a - 1),
|
|
98
|
+
topIndex: c,
|
|
99
|
+
offsets: i,
|
|
100
|
+
totalHeight: e.totalHeight
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function p(e, t, n, r, i, a, o) {
|
|
104
|
+
if (e === 0) return {
|
|
105
|
+
start: 0,
|
|
106
|
+
end: -1,
|
|
107
|
+
topIndex: 0,
|
|
108
|
+
totalHeight: 0
|
|
109
|
+
};
|
|
110
|
+
let s = o?.leading ?? 0, c = o?.trailing ?? 0, l = t + n, d = u(r < s ? 0 : l > 0 ? Math.floor((r - s) / l) : e - 1, 0, e - 1), f = r + i, p = u(f <= s ? 0 : l > 0 ? Math.ceil((f - s) / l) - 1 : e - 1, 0, e - 1);
|
|
111
|
+
return {
|
|
112
|
+
start: u(d - a, 0, e - 1),
|
|
113
|
+
end: u(p + a, 0, e - 1),
|
|
114
|
+
topIndex: d,
|
|
115
|
+
totalHeight: s + e * t + (e - 1) * n + c
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region packages/core/src/internal/progressive-layout-lifecycle.ts
|
|
120
|
+
var m = class {
|
|
121
|
+
state = Object.freeze({ status: "complete" });
|
|
122
|
+
get complete() {
|
|
123
|
+
return this.state.status === "complete";
|
|
124
|
+
}
|
|
125
|
+
get settled() {
|
|
126
|
+
return this.state.status !== "pending";
|
|
127
|
+
}
|
|
128
|
+
begin() {
|
|
129
|
+
this.state = Object.freeze({ status: "pending" });
|
|
130
|
+
}
|
|
131
|
+
succeed() {
|
|
132
|
+
this.state = Object.freeze({ status: "complete" });
|
|
133
|
+
}
|
|
134
|
+
fail(e) {
|
|
135
|
+
let t = e instanceof Error ? e : Error(String(e));
|
|
136
|
+
return this.state = Object.freeze({
|
|
137
|
+
status: "failed",
|
|
138
|
+
error: t
|
|
139
|
+
}), t;
|
|
140
|
+
}
|
|
141
|
+
throwIfFailed() {
|
|
142
|
+
if (this.state.status === "failed") throw this.state.error;
|
|
143
|
+
}
|
|
144
|
+
}, h = class {
|
|
145
|
+
failed = /* @__PURE__ */ new WeakMap();
|
|
146
|
+
notify(e, t, ...n) {
|
|
147
|
+
if (!(!t || this.failed.get(t)?.has(e))) try {
|
|
148
|
+
let r = t(...n);
|
|
149
|
+
r && typeof r.then == "function" && Promise.resolve(r).catch((n) => this.reportOnce(e, t, n));
|
|
150
|
+
} catch (n) {
|
|
151
|
+
this.reportOnce(e, t, n);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
reportOnce(e, t, n) {
|
|
155
|
+
let r = this.failed.get(t) ?? /* @__PURE__ */ new Set();
|
|
156
|
+
if (r.has(e)) return;
|
|
157
|
+
r.add(e), this.failed.has(t) || this.failed.set(t, r);
|
|
158
|
+
let i = n instanceof Error ? n : Error(String(n));
|
|
159
|
+
console.error(`[ooxml] ${e} callback failed and was disabled:`, i);
|
|
160
|
+
}
|
|
161
|
+
}, g = 65536;
|
|
162
|
+
function _(e, t) {
|
|
163
|
+
let n = Math.min(e.length, t);
|
|
164
|
+
if (n > 0 && n < e.length) {
|
|
165
|
+
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
166
|
+
t >= 55296 && t <= 56319 && r >= 56320 && r <= 57343 && n--;
|
|
167
|
+
}
|
|
168
|
+
return e.slice(0, n);
|
|
169
|
+
}
|
|
170
|
+
function v(e) {
|
|
171
|
+
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
172
|
+
return Math.min(g, Math.floor(e ?? 65536));
|
|
173
|
+
}
|
|
174
|
+
function y(e, t, n) {
|
|
175
|
+
let r = v(n), i = 0, a = !1, o = (e) => {
|
|
176
|
+
let t = _(e.text, Math.max(0, r - i));
|
|
177
|
+
return i += t.length, t.length < e.text.length && (a = !0), {
|
|
178
|
+
...e,
|
|
179
|
+
text: t
|
|
180
|
+
};
|
|
181
|
+
}, s = Object.freeze({
|
|
182
|
+
root: Object.freeze(o(e)),
|
|
183
|
+
replies: Object.freeze(t.map((e) => Object.freeze(o(e))))
|
|
184
|
+
});
|
|
185
|
+
return Object.freeze({
|
|
186
|
+
thread: s,
|
|
187
|
+
truncated: a,
|
|
188
|
+
textCharacters: i,
|
|
189
|
+
maxTextCharacters: r
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region packages/core/src/internal/dom-interaction-boundary.ts
|
|
194
|
+
function b(e, t) {
|
|
195
|
+
return e.dataset?.[t] !== void 0;
|
|
196
|
+
}
|
|
197
|
+
function x(e, t, n) {
|
|
198
|
+
let r = typeof e.composedPath == "function" ? e.composedPath() : [];
|
|
199
|
+
if (r.length > 0) {
|
|
200
|
+
let e = !1;
|
|
201
|
+
for (let i of r) {
|
|
202
|
+
if (i === t) return e;
|
|
203
|
+
b(i, n) && (e = !0);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
let i = e.target;
|
|
207
|
+
if (!i || !t.contains(i)) return !1;
|
|
208
|
+
let a = i;
|
|
209
|
+
for (; a;) {
|
|
210
|
+
if (b(a, n)) return !0;
|
|
211
|
+
if (a === t) break;
|
|
212
|
+
a = a.parentElement;
|
|
213
|
+
}
|
|
214
|
+
return !1;
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
export { p as a, c, m as i, l, y as n, f as o, h as r, d as s, x as t };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
export {
|
|
1
|
+
import { t as e } from "./xlsx-BibrHQ52.js";
|
|
2
|
+
import { t } from "./pptx-BcUCETmQ.js";
|
|
3
|
+
import { t as n } from "./docx-Dg73PGgC.js";
|
|
4
|
+
export { n as docx, t as pptx, e as xlsx };
|