@silurus/ooxml 0.75.5 → 0.76.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 +66 -28
- package/dist/bounded-raw-part-cache-C6ro6Ezf.js +254 -0
- package/dist/{find-cursor-Dc5iM6s7.js → canvas-viewer-mechanics-CwVSOYke.js} +192 -64
- package/dist/{document-pull-client-BcNYhoAG.js → document-pull-client-AAnwzlig.js} +3625 -3601
- package/dist/docx-CCksIXd5.js +1301 -0
- package/dist/docx.mjs +4 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-B8sqT8kC.js → line-distribute-C1r2zvji.js} +141 -141
- package/dist/{line-metrics-D9gqQWHl.js → line-metrics-BdCACYlq.js} +4026 -1170
- package/dist/math.mjs +1 -1
- package/dist/node.mjs +779 -465
- package/dist/pptx-CKAk5e-J.js +1735 -0
- package/dist/pptx.mjs +5 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-CalC7GX4.js → render-CLcpSi0m.js} +11 -18
- package/dist/render-worker-host-B8HAb_sK.js +27 -0
- package/dist/render-worker-host-Bkf1jUcW.js +27 -0
- package/dist/render-worker-host-CKOmXdyr.js +27 -0
- package/dist/resource-measurement-E_S_iau4.js +119 -0
- package/dist/session-B4Y54cbT.js +730 -0
- package/dist/{renderer-B9R6F_QY.js → slide-pull-client-WCuYCjio.js} +973 -820
- package/dist/types/docx.d.ts +1181 -3994
- package/dist/types/index.d.ts +2733 -8171
- package/dist/types/math.d.ts +8 -33
- package/dist/types/node.d.ts +1852 -4433
- package/dist/types/pptx.d.ts +1030 -3678
- package/dist/types/xlsx.d.ts +1291 -3262
- package/dist/worksheet-pull-client-YzjJMOns.js +455 -0
- package/dist/xlsx-BBmmZNQn.js +6362 -0
- package/dist/xlsx.mjs +5 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +14 -7
- package/dist/bounded-raw-part-cache-BTfZD_Sz.js +0 -1248
- package/dist/docx-DjF8FgoP.js +0 -1274
- package/dist/duotone-bitmap-by-path-CWsSJkJu.js +0 -28
- package/dist/hyperlink-D85FexTa.js +0 -27
- package/dist/pptx-C17xP8AV.js +0 -1705
- package/dist/pptx-Dl8tOSmP.js +0 -822
- package/dist/preload-BEouWnlI.js +0 -132
- package/dist/render-worker-host-BG3a7brz.js +0 -27
- package/dist/render-worker-host-CsB-dPJv.js +0 -27
- package/dist/render-worker-host-Cyv5Hkbh.js +0 -27
- package/dist/resource-measurement-6aReN3K0.js +0 -93
- package/dist/slide-pull-client-D_T0AIoX.js +0 -175
- package/dist/svg-image-by-path-C1M3N2pT.js +0 -1623
- package/dist/worksheet-pull-worker-DCei8u-4.js +0 -347
- package/dist/xlsx-BaH9irS0.js +0 -5515
- /package/dist/{highlight-rect-cCvVU-MW.js → highlight-rect-CAkCWJ37.js} +0 -0
- /package/dist/{mathjax-Dqo857oC.js → mathjax-CMjda8Ip.js} +0 -0
- /package/dist/{transfer-3QEJrsJa.js → transfer-DCu4c2BL.js} +0 -0
- /package/dist/{visible-index-CKvgpUrf.js → visible-index-CgyJLAS_.js} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { At as e, Mt as t, wt as n, yt as r } from "./line-metrics-BdCACYlq.js";
|
|
2
|
+
//#region packages/core/src/image/duotone-bitmap-by-path.ts
|
|
3
|
+
function i(e, t) {
|
|
4
|
+
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
5
|
+
}
|
|
6
|
+
var a = "duotone";
|
|
7
|
+
async function o(o, s, c, l, u = {}) {
|
|
8
|
+
let { offscreenFactory: d, ...f } = u, p = await e(o, s, l, f);
|
|
9
|
+
return !c || !p ? p : t(a, i(o, c), l, async () => {
|
|
10
|
+
let { w: e, h: t } = n(p);
|
|
11
|
+
if (e <= 0 || t <= 0) return {
|
|
12
|
+
bitmap: p,
|
|
13
|
+
owned: !1
|
|
14
|
+
};
|
|
15
|
+
let i = await r(p, c, {
|
|
16
|
+
width: e,
|
|
17
|
+
height: t,
|
|
18
|
+
offscreenFactory: d
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
bitmap: i,
|
|
22
|
+
owned: i !== p
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region packages/core/src/internal/resource-measurement.ts
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
if (!Number.isSafeInteger(e) || e < 0) throw Error(`${t} must be a non-negative safe integer`);
|
|
30
|
+
}
|
|
31
|
+
function c(e, t, n) {
|
|
32
|
+
return s(e, "resource measurement"), s(t, "resource measurement"), s(n, "resource measurement limit"), e > n || t > n || t > n - e ? n === 2 ** 53 - 1 ? n : n + 1 : e + t;
|
|
33
|
+
}
|
|
34
|
+
function l(e, t = 2 ** 53 - 1) {
|
|
35
|
+
s(t, "resource measurement limit");
|
|
36
|
+
let n = 0;
|
|
37
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
38
|
+
let i = e.charCodeAt(r), a;
|
|
39
|
+
if (i <= 127) a = 1;
|
|
40
|
+
else if (i <= 2047) a = 2;
|
|
41
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
42
|
+
let t = e.charCodeAt(r + 1);
|
|
43
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 3;
|
|
44
|
+
} else a = 3;
|
|
45
|
+
if (n = c(n, a, t), n > t) return n;
|
|
46
|
+
}
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
function u(e, t = 2 ** 53 - 1) {
|
|
50
|
+
s(t, "resource measurement limit");
|
|
51
|
+
let n = c(0, 2, t);
|
|
52
|
+
if (n > t) return n;
|
|
53
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
54
|
+
let i = e.charCodeAt(r), a;
|
|
55
|
+
if (i === 34 || i === 92 || i === 8 || i === 9 || i === 10 || i === 12 || i === 13) a = 2;
|
|
56
|
+
else if (i <= 31) a = 6;
|
|
57
|
+
else if (i <= 127) a = 1;
|
|
58
|
+
else if (i <= 2047) a = 2;
|
|
59
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
60
|
+
let t = e.charCodeAt(r + 1);
|
|
61
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 6;
|
|
62
|
+
} else a = i >= 55296 && i <= 57343 ? 6 : 3;
|
|
63
|
+
if (n = c(n, a, t), n > t) return n;
|
|
64
|
+
}
|
|
65
|
+
return n;
|
|
66
|
+
}
|
|
67
|
+
function d(e, t) {
|
|
68
|
+
return c(0, e, t);
|
|
69
|
+
}
|
|
70
|
+
function f(e, t = 2 ** 53 - 1, n = !1) {
|
|
71
|
+
if (s(t, "resource measurement limit"), e === null) return {
|
|
72
|
+
jsonBytes: d(4, t),
|
|
73
|
+
stringValueUtf8Bytes: 0
|
|
74
|
+
};
|
|
75
|
+
if (typeof e == "string") return {
|
|
76
|
+
jsonBytes: u(e, t),
|
|
77
|
+
stringValueUtf8Bytes: l(e, t)
|
|
78
|
+
};
|
|
79
|
+
if (typeof e == "boolean") return {
|
|
80
|
+
jsonBytes: d(e ? 4 : 5, t),
|
|
81
|
+
stringValueUtf8Bytes: 0
|
|
82
|
+
};
|
|
83
|
+
if (typeof e == "number") return {
|
|
84
|
+
jsonBytes: d((Number.isFinite(e) ? String(Object.is(e, -0) ? 0 : e) : "null").length, t),
|
|
85
|
+
stringValueUtf8Bytes: 0
|
|
86
|
+
};
|
|
87
|
+
if (typeof e == "bigint") throw TypeError("BigInt values cannot be serialized to JSON");
|
|
88
|
+
if (Array.isArray(e)) {
|
|
89
|
+
let n = d(2, t), r = 0;
|
|
90
|
+
for (let i = 0; i < e.length; i += 1) {
|
|
91
|
+
i !== 0 && (n = c(n, 1, t));
|
|
92
|
+
let a = f(e[i], t, !0);
|
|
93
|
+
n = c(n, a.jsonBytes, t), r = c(r, a.stringValueUtf8Bytes, t);
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
jsonBytes: n,
|
|
97
|
+
stringValueUtf8Bytes: r
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (typeof e == "object") {
|
|
101
|
+
let n = d(2, t), r = 0, i = 0;
|
|
102
|
+
for (let [a, o] of Object.entries(e)) {
|
|
103
|
+
if (o === void 0 || typeof o == "function" || typeof o == "symbol") continue;
|
|
104
|
+
i++ !== 0 && (n = c(n, 1, t)), n = c(n, u(a, t), t), n = c(n, 1, t);
|
|
105
|
+
let e = f(o, t);
|
|
106
|
+
n = c(n, e.jsonBytes, t), r = c(r, e.stringValueUtf8Bytes, t);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
jsonBytes: n,
|
|
110
|
+
stringValueUtf8Bytes: r
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
jsonBytes: n ? d(4, t) : 0,
|
|
115
|
+
stringValueUtf8Bytes: 0
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { o as i, f as n, l as r, c as t };
|