@silurus/ooxml 0.86.1 → 0.88.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-1uPAxMZr.js +31 -0
- package/dist/assets/render-worker-BlvJybji.js +10 -0
- package/dist/assets/render-worker-CzmiJfFL.js +11 -0
- package/dist/{canvas-viewer-mechanics-DN5SqWGS.js → canvas-viewer-mechanics-DbLz0rYW.js} +75 -66
- package/dist/chart-ex.mjs +581 -616
- package/dist/cjk-fallback-bLI3z70h.js +46 -0
- package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
- package/dist/{comment-ui-runtime-lXwVOgjW.js → comment-ui-runtime-CWGqn5Vr.js} +5 -5
- 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-uopDjRde.js → document-pull-client-B9PTM-pL.js} +4693 -4621
- package/dist/{docx-wPzeF76A.js → docx-BF9WXrYH.js} +503 -388
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CswB9Tzi.js → dom-interaction-boundary-Cnm8DSBN.js} +22 -19
- package/dist/{hyperlink-BR1NCO7S.js → hyperlink-Cxzhet30.js} +842 -829
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-IsUGfHXm.js → line-distribute-D1WNHKz_.js} +2 -2
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +356 -352
- package/dist/plot-area-frame-DLTYKHNP.js +4354 -0
- package/dist/{pptx-BxJ_RBSY.js → pptx-DkyYBYoL.js} +444 -435
- package/dist/pptx.mjs +7 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +5 -5
- package/dist/{render-DEiun_AH.js → render-D3iqVKCo.js} +31 -29
- package/dist/{render-worker-host-Ba6Fchqr.js → render-worker-host-B5wQfB7U.js} +1 -1
- package/dist/{render-worker-host-BEfLZvSL.js → render-worker-host-D4123J27.js} +1 -1
- package/dist/{render-worker-host-C3xwtHnv.js → render-worker-host-Di3LxLc0.js} +1 -1
- package/dist/renderer-B4GZb5We.js +6492 -0
- package/dist/{resource-measurement-CclArDRs.js → resource-measurement-SHQCbkh2.js} +3 -3
- package/dist/{session-BuJL_xcp.js → session-BGq81gRQ.js} +98 -98
- package/dist/{slide-pull-client-Ck8wfRT_.js → slide-pull-client-DiPnm240.js} +767 -738
- package/dist/{three-d-YYghQndN.js → three-d-DJBl8g8M.js} +251 -435
- package/dist/three-d.mjs +998 -906
- package/dist/tiff.mjs +2 -2
- package/dist/types/chart-ex.d.ts +142 -4
- package/dist/types/docx.d.ts +155 -13
- package/dist/types/index.d.ts +131 -19
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +120 -8
- package/dist/types/pptx.d.ts +123 -13
- package/dist/types/region-map.d.ts +142 -4
- package/dist/types/three-d.d.ts +142 -4
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +155 -13
- package/dist/{worksheet-pull-client-CAvuf22q.js → worksheet-pull-client-BM8ywvbu.js} +51 -51
- package/dist/{xlsx-Bblm5r1h.js → xlsx-C9NVjgaV.js} +1592 -1564
- package/dist/xlsx.mjs +6 -6
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-D21h5TGR.js +0 -10
- package/dist/assets/render-worker-Dsfekaht.js +0 -11
- package/dist/assets/render-worker-DxU7IrKo.js +0 -31
- package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
- package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
- package/dist/renderer-XFSCOT6m.js +0 -5857
- /package/dist/{bounded-raw-part-cache-BfbSxRIL.js → bounded-raw-part-cache-Cg1BsSZQ.js} +0 -0
- /package/dist/{comment-occurrence-CqejEuts.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/{pixel-budget-Dgjw269h.js → pixel-budget-9P63Bsk5.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/{units-EJdC96r6.js → units-BzZ0gAxs.js} +0 -0
- /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Et as e,
|
|
2
|
-
import { i as n, r, s as i } from "./pixel-budget-
|
|
1
|
+
import { Et as e, ln as t } from "./hyperlink-Cxzhet30.js";
|
|
2
|
+
import { i as n, r, s as i } from "./pixel-budget-9P63Bsk5.js";
|
|
3
3
|
//#region packages/core/src/errors/cfb-sniff.ts
|
|
4
4
|
var a = [
|
|
5
5
|
208,
|
|
@@ -87,20 +87,20 @@ var y = [
|
|
|
87
87
|
177,
|
|
88
88
|
26,
|
|
89
89
|
225
|
|
90
|
-
], ee = 4294967290, b = 4294967294, te = 512,
|
|
91
|
-
function
|
|
90
|
+
], ee = 4294967290, b = 4294967294, te = 512, x = 128, S = 4e6, ne = 8e6, re = 65536, ie = 1e6;
|
|
91
|
+
function C(e, t) {
|
|
92
92
|
if (e.length < te) return null;
|
|
93
93
|
for (let t = 0; t < y.length; t++) if (e[t] !== y[t]) return null;
|
|
94
|
-
let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r =
|
|
94
|
+
let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = ae(n);
|
|
95
95
|
if (r === null) return null;
|
|
96
|
-
let i =
|
|
96
|
+
let i = oe(n, e.length, r);
|
|
97
97
|
if (i === null) return null;
|
|
98
|
-
let a =
|
|
98
|
+
let a = se(n, e.length, r, i, t);
|
|
99
99
|
if (a === null || a.target === null) return null;
|
|
100
100
|
let { target: o, root: s } = a;
|
|
101
|
-
return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : ue(n, e.length, r, i, s, o) :
|
|
101
|
+
return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : ue(n, e.length, r, i, s, o) : le(n, e.length, r, i, o.startSector, o.size);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function ae(e) {
|
|
104
104
|
let t = e.getUint16(30, !0);
|
|
105
105
|
if (t !== 9 && t !== 12) return null;
|
|
106
106
|
let n = e.getUint16(32, !0);
|
|
@@ -114,57 +114,57 @@ function oe(e) {
|
|
|
114
114
|
numDifatSectors: e.getUint32(72, !0)
|
|
115
115
|
} : null;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function w(e, t) {
|
|
118
118
|
return (e + 1) * t;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function T(e) {
|
|
121
121
|
return e >= 0 && e <= ee;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function oe(e, t, n) {
|
|
124
124
|
let { sectorSize: r } = n, i = [];
|
|
125
125
|
for (let t = 0; t < 109; t++) {
|
|
126
126
|
let n = e.getUint32(76 + t * 4, !0);
|
|
127
|
-
|
|
127
|
+
T(n) && i.push(n);
|
|
128
128
|
}
|
|
129
129
|
let a = r / 4 - 1, o = n.firstDifatSector, s = /* @__PURE__ */ new Set(), c = 0;
|
|
130
|
-
for (;
|
|
131
|
-
if (c++ >
|
|
130
|
+
for (; T(o);) {
|
|
131
|
+
if (c++ > ie) return null;
|
|
132
132
|
if (s.has(o)) break;
|
|
133
133
|
s.add(o);
|
|
134
|
-
let n =
|
|
134
|
+
let n = w(o, r);
|
|
135
135
|
if (n < 0 || n + r > t) return null;
|
|
136
136
|
for (let t = 0; t < a; t++) {
|
|
137
137
|
let r = e.getUint32(n + t * 4, !0);
|
|
138
|
-
|
|
138
|
+
T(r) && i.push(r);
|
|
139
139
|
}
|
|
140
140
|
o = e.getUint32(n + a * 4, !0);
|
|
141
141
|
}
|
|
142
142
|
return i;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function E(e, t, n, r, i) {
|
|
145
145
|
let a = n / 4, o = Math.floor(i / a), s = i % a;
|
|
146
146
|
if (o >= r.length) return null;
|
|
147
147
|
let c = r[o];
|
|
148
|
-
if (!
|
|
149
|
-
let l =
|
|
148
|
+
if (!T(c)) return null;
|
|
149
|
+
let l = w(c, n) + s * 4;
|
|
150
150
|
return l < 0 || l + 4 > t ? null : e.getUint32(l, !0);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
let { sectorSize: a } = n, o = Math.floor(a /
|
|
152
|
+
function se(e, t, n, r, i) {
|
|
153
|
+
let { sectorSize: a } = n, o = Math.floor(a / x);
|
|
154
154
|
if (o < 1) return null;
|
|
155
155
|
let s = null, c = null, l = /* @__PURE__ */ new Set(), u = n.firstDirSector, d = 0, f = 0;
|
|
156
|
-
for (;
|
|
157
|
-
if (d++ >
|
|
156
|
+
for (; T(u);) {
|
|
157
|
+
if (d++ > S) return null;
|
|
158
158
|
if (l.has(u)) break;
|
|
159
159
|
l.add(u);
|
|
160
|
-
let n =
|
|
160
|
+
let n = w(u, a);
|
|
161
161
|
if (n < 0 || n + a > t) return null;
|
|
162
162
|
for (let t = 0; t < o; t++) {
|
|
163
|
-
if (f++ >
|
|
163
|
+
if (f++ > re) return {
|
|
164
164
|
target: s,
|
|
165
165
|
root: c
|
|
166
166
|
};
|
|
167
|
-
let r = n + t *
|
|
167
|
+
let r = n + t * x, a = e.getUint8(r + 66);
|
|
168
168
|
if (a === 0) continue;
|
|
169
169
|
let o = e.getUint32(r + 116, !0), l = e.getUint32(r + 120, !0);
|
|
170
170
|
if (a === 5) {
|
|
@@ -174,12 +174,12 @@ function ce(e, t, n, r, i) {
|
|
|
174
174
|
};
|
|
175
175
|
continue;
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
ce(e, r) === i && (s = {
|
|
178
178
|
startSector: o,
|
|
179
179
|
size: l
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
let p =
|
|
182
|
+
let p = E(e, t, a, r, u);
|
|
183
183
|
if (p === null) break;
|
|
184
184
|
u = p;
|
|
185
185
|
}
|
|
@@ -188,7 +188,7 @@ function ce(e, t, n, r, i) {
|
|
|
188
188
|
root: c
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function ce(e, t) {
|
|
192
192
|
let n = e.getUint16(t + 64, !0);
|
|
193
193
|
if (n < 2 || n > 64) return "";
|
|
194
194
|
let r = n / 2 - 1, i = "";
|
|
@@ -199,27 +199,27 @@ function le(e, t) {
|
|
|
199
199
|
}
|
|
200
200
|
return i;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function le(e, t, n, r, i, a) {
|
|
203
203
|
let { sectorSize: o } = n, s = new Uint8Array(a), c = 0, l = i, u = /* @__PURE__ */ new Set(), d = 0;
|
|
204
|
-
for (;
|
|
205
|
-
if (d++ >
|
|
204
|
+
for (; T(l) && c < a;) {
|
|
205
|
+
if (d++ > S || u.has(l)) return null;
|
|
206
206
|
u.add(l);
|
|
207
|
-
let n =
|
|
207
|
+
let n = w(l, o);
|
|
208
208
|
if (n < 0 || n + o > t) return null;
|
|
209
209
|
let i = Math.min(o, a - c);
|
|
210
210
|
s.set(new Uint8Array(e.buffer, e.byteOffset + n, i), c), c += i;
|
|
211
|
-
let f =
|
|
211
|
+
let f = E(e, t, o, r, l);
|
|
212
212
|
if (f === null) return null;
|
|
213
213
|
l = f;
|
|
214
214
|
}
|
|
215
215
|
return c === a ? s : null;
|
|
216
216
|
}
|
|
217
217
|
function ue(e, t, n, r, i, a) {
|
|
218
|
-
let { sectorSize: o, miniSectorSize: s } = n, c =
|
|
218
|
+
let { sectorSize: o, miniSectorSize: s } = n, c = le(e, t, n, r, i.startSector, i.size);
|
|
219
219
|
if (c === null) return null;
|
|
220
220
|
let l = new Uint8Array(a.size), u = 0, d = a.startSector, f = /* @__PURE__ */ new Set(), p = 0, m = o / 4;
|
|
221
|
-
for (;
|
|
222
|
-
if (p++ >
|
|
221
|
+
for (; T(d) && u < a.size;) {
|
|
222
|
+
if (p++ > ne || f.has(d)) return null;
|
|
223
223
|
f.add(d);
|
|
224
224
|
let i = d * s;
|
|
225
225
|
if (i < 0 || i + s > c.length) return null;
|
|
@@ -234,14 +234,14 @@ function ue(e, t, n, r, i, a) {
|
|
|
234
234
|
function de(e, t, n, r, i, a) {
|
|
235
235
|
let { sectorSize: o } = n, s = Math.floor(a / i), c = a % i, l = n.firstMiniFatSector, u = /* @__PURE__ */ new Set();
|
|
236
236
|
for (let n = 0; n < s; n++) {
|
|
237
|
-
if (!
|
|
237
|
+
if (!T(l) || u.has(l)) return null;
|
|
238
238
|
u.add(l);
|
|
239
|
-
let n =
|
|
239
|
+
let n = E(e, t, o, r, l);
|
|
240
240
|
if (n === null) return null;
|
|
241
241
|
l = n;
|
|
242
242
|
}
|
|
243
|
-
if (!
|
|
244
|
-
let d =
|
|
243
|
+
if (!T(l)) return null;
|
|
244
|
+
let d = w(l, o) + c * 4;
|
|
245
245
|
if (d < 0 || d + 4 > t) return null;
|
|
246
246
|
let f = e.getUint32(d, !0);
|
|
247
247
|
return f === b ? b : f;
|
|
@@ -476,7 +476,7 @@ async function Se(e, t, n) {
|
|
|
476
476
|
//#region packages/core/src/crypto/decrypt-ooxml.ts
|
|
477
477
|
var Ce = "EncryptionInfo", we = "EncryptedPackage";
|
|
478
478
|
async function Te(e, t) {
|
|
479
|
-
let n =
|
|
479
|
+
let n = C(e, Ce), r = C(e, we);
|
|
480
480
|
if (n === null || r === null) return {
|
|
481
481
|
ok: !1,
|
|
482
482
|
reason: "corrupt"
|
|
@@ -576,25 +576,33 @@ function K(e) {
|
|
|
576
576
|
return Promise.race([e, new Promise((e) => setTimeout(e, ke))]);
|
|
577
577
|
}
|
|
578
578
|
var q = /* @__PURE__ */ new Map();
|
|
579
|
-
function Ae(e) {
|
|
580
|
-
let
|
|
581
|
-
for (;
|
|
582
|
-
let e =
|
|
583
|
-
if (!
|
|
584
|
-
let
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
579
|
+
function Ae(e, t) {
|
|
580
|
+
let n = [], r = /@font-face\s*\{([^}]*)\}/g, i;
|
|
581
|
+
for (; i = r.exec(e);) {
|
|
582
|
+
let e = i[1], r = (t) => e.match(RegExp(`(?:^|;|\\n)\\s*${t}\\s*:\\s*([^;]+)`, "i"))?.[1].trim(), a = r("font-family"), o = r("src");
|
|
583
|
+
if (!a || !o) continue;
|
|
584
|
+
let s = t ? o.replace(/url\(\s*(?:(['"])(.*?)\1|([^)]*?))\s*\)/gi, (e, n, r, i) => {
|
|
585
|
+
let a = (r ?? i ?? "").trim();
|
|
586
|
+
if (!a) return e;
|
|
587
|
+
try {
|
|
588
|
+
return `url("${new URL(a, t).href}")`;
|
|
589
|
+
} catch {
|
|
590
|
+
return e;
|
|
591
|
+
}
|
|
592
|
+
}) : o, c = {}, l = r("font-style");
|
|
593
|
+
l && (c.style = l);
|
|
594
|
+
let u = r("font-weight");
|
|
595
|
+
u && (c.weight = u);
|
|
596
|
+
let d = r("font-stretch");
|
|
597
|
+
d && (c.stretch = d);
|
|
598
|
+
let f = r("unicode-range");
|
|
599
|
+
f && (c.unicodeRange = f), n.push({
|
|
600
|
+
family: a.replace(/^['"]|['"]$/g, ""),
|
|
601
|
+
src: s,
|
|
602
|
+
descriptors: c
|
|
595
603
|
});
|
|
596
604
|
}
|
|
597
|
-
return
|
|
605
|
+
return n;
|
|
598
606
|
}
|
|
599
607
|
function J() {
|
|
600
608
|
return typeof document < "u" && document && document.fonts ? document.fonts : typeof self < "u" && self && "fonts" in self ? self.fonts : null;
|
|
@@ -625,11 +633,12 @@ async function Me(e, t, n = J()) {
|
|
|
625
633
|
i.add(r);
|
|
626
634
|
let c = t[r];
|
|
627
635
|
if (!c) continue;
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
636
|
+
let l = c.url;
|
|
637
|
+
o.add(l);
|
|
638
|
+
let u = (c.loadFamily ?? e).toLowerCase();
|
|
639
|
+
a.add(u);
|
|
640
|
+
let d = s.get(l);
|
|
641
|
+
d || (d = /* @__PURE__ */ new Set(), s.set(l, d)), d.add(u);
|
|
633
642
|
}
|
|
634
643
|
if (a.size === 0) return [];
|
|
635
644
|
let l = await K(Promise.all([...o].map(async (e) => {
|
|
@@ -642,7 +651,7 @@ async function Me(e, t, n = J()) {
|
|
|
642
651
|
try {
|
|
643
652
|
let t = await fetch(e);
|
|
644
653
|
if (!t.ok) throw Error(`HTTP ${t.status}`);
|
|
645
|
-
return Ae(await t.text());
|
|
654
|
+
return Ae(await t.text(), t.url || e);
|
|
646
655
|
} catch {
|
|
647
656
|
q.delete(e);
|
|
648
657
|
for (let t of s.get(e) ?? []) c.add(t);
|