@silurus/ooxml 0.84.1 → 0.85.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.
Files changed (68) hide show
  1. package/README.md +44 -18
  2. package/dist/assets/render-worker-BRKOyWVH.js +24 -0
  3. package/dist/assets/render-worker-CtLMFj9r.js +10 -0
  4. package/dist/assets/render-worker-NZPOUOTU.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-CIfhCgYA.js → canvas-viewer-mechanics-CfRzOhz5.js} +308 -234
  6. package/dist/chart-ex.mjs +270 -270
  7. package/dist/{comment-ui-runtime-CdMMApEN.js → comment-ui-runtime-CAbpuWi_.js} +4 -4
  8. package/dist/{comment-ui-runtime-C5qimVMD.js → comment-ui-runtime-DAKBCpsM.js} +5 -5
  9. package/dist/comment-ui-runtime-DTaaZdXC.js +2 -0
  10. package/dist/{comments-BAlAyIhb.js → comments-Brfxa3hQ.js} +1 -1
  11. package/dist/{document-pull-client-BXw6AAhY.js → document-pull-client-BkHHIdR4.js} +4661 -4357
  12. package/dist/{docx-BA1vB0V-.js → docx-_uelcAui.js} +338 -304
  13. package/dist/docx.mjs +7 -6
  14. package/dist/docx_parser_bg.wasm +0 -0
  15. package/dist/{dom-interaction-boundary-DS6BVyHA.js → dom-interaction-boundary-CMDDgICk.js} +1 -1
  16. package/dist/index.mjs +3 -3
  17. package/dist/line-distribute-CiKeWjBF.js +1023 -0
  18. package/dist/{line-metrics-CXyjyYd5.js → line-metrics-u87yCAfV.js} +2182 -705
  19. package/dist/math.mjs +2 -2
  20. package/dist/node.mjs +404 -394
  21. package/dist/pixel-budget-Dgjw269h.js +37 -0
  22. package/dist/{plot-area-frame-DuXZzovH.js → plot-area-frame-D5hEOgkJ.js} +691 -1418
  23. package/dist/{pptx-C17oBD8Z.js → pptx-WpBbS0mq.js} +255 -222
  24. package/dist/pptx.mjs +7 -6
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/raster-target-whZhvVMt.js +87 -0
  27. package/dist/region-map.mjs +5 -5
  28. package/dist/{render-CVeGktZG.js → render-DrAAZWwH.js} +9 -6
  29. package/dist/{render-worker-host-BbhwA24Y.js → render-worker-host-CBVe8aeD.js} +1 -1
  30. package/dist/{render-worker-host-BWdhjVH_.js → render-worker-host-CHlwYJdK.js} +1 -1
  31. package/dist/{render-worker-host-CbaQivE7.js → render-worker-host-XDMsyVsv.js} +1 -1
  32. package/dist/{renderer-Bmky2yBc.js → renderer-XFSCOT6m.js} +1937 -1936
  33. package/dist/resource-measurement-6uR3Huao.js +150 -0
  34. package/dist/{session-Cl0RVnMs.js → session-DoPwA4gv.js} +79 -79
  35. package/dist/{slide-pull-client-BS0EeZo2.js → slide-pull-client-8i8C4VyD.js} +1054 -824
  36. package/dist/{three-d-B7LsKeOS.js → three-d-YYghQndN.js} +109 -110
  37. package/dist/three-d.mjs +726 -726
  38. package/dist/tiff.mjs +664 -78
  39. package/dist/types/chart-ex.d.ts +2 -2
  40. package/dist/types/docx.d.ts +31 -13
  41. package/dist/types/index.d.ts +46 -21
  42. package/dist/types/math.d.ts +1 -1
  43. package/dist/types/node.d.ts +11 -7
  44. package/dist/types/pptx.d.ts +35 -15
  45. package/dist/types/region-map.d.ts +2 -2
  46. package/dist/types/three-d.d.ts +2 -2
  47. package/dist/types/tiff.d.ts +13 -3
  48. package/dist/types/xlsx.d.ts +30 -13
  49. package/dist/{worksheet-pull-client-B0zfEVau.js → worksheet-pull-client-Btydoxto.js} +47 -47
  50. package/dist/{xlsx-FyKAiNo-.js → xlsx-Bd16V4Xx.js} +1395 -1196
  51. package/dist/xlsx.mjs +7 -6
  52. package/package.json +2 -2
  53. package/dist/assets/render-worker-BWPpayBu.js +0 -10
  54. package/dist/assets/render-worker-CiEWCh_T.js +0 -11
  55. package/dist/assets/render-worker-Cpmy3GDF.js +0 -24
  56. package/dist/comment-ui-runtime-aPzHfV_A.js +0 -2
  57. package/dist/line-distribute-MqInuujx.js +0 -1003
  58. package/dist/resource-measurement-esyGbzAF.js +0 -120
  59. package/dist/tiff-contract-Xjn3qXqK.js +0 -69
  60. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-tj54AXXB.js} +0 -0
  61. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-DBcYVJDv.js} +0 -0
  62. /package/dist/{mathjax-DPEX346v.js → mathjax-DS69BmJd.js} +0 -0
  63. /package/dist/{read-only-comment-decoration-BYCXoSdC.js → read-only-comment-decoration-Mv_SAiHy.js} +0 -0
  64. /package/dist/{read-only-comment-margin-C7b3l0ro.js → read-only-comment-margin-Cqu-Ir0C.js} +0 -0
  65. /package/dist/{renderer-module-contract-C6sYZvTV.js → renderer-module-contract-Cu-GKuPd.js} +0 -0
  66. /package/dist/{source-key-DORuuFb-.js → source-key-BkBB3X82.js} +0 -0
  67. /package/dist/{transfer-vNOFQuvv.js → transfer-mIj7E7NB.js} +0 -0
  68. /package/dist/{visible-index-DwJzuGmJ.js → visible-index-DPoQYSDt.js} +0 -0
@@ -1,120 +0,0 @@
1
- import { ht as e, ot as t, pt as n } from "./line-metrics-CXyjyYd5.js";
2
- import { rn as r } from "./plot-area-frame-DuXZzovH.js";
3
- //#region packages/core/src/image/duotone-bitmap-by-path.ts
4
- function i(e, t) {
5
- return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
6
- }
7
- var a = "duotone";
8
- async function o(o, s, c, l, u = {}) {
9
- let { offscreenFactory: d, failClosedOnDuotoneFailure: f = !1, ...p } = u, m = await n(o, s, l, p);
10
- return !c || !m ? m : e(a, `${i(o, c)}${f ? "|strict" : ""}`, l, async () => {
11
- let { w: e, h: n } = r(m);
12
- if (e <= 0 || n <= 0) return {
13
- bitmap: f ? null : m,
14
- owned: !1
15
- };
16
- let i = await t(m, c, {
17
- width: e,
18
- height: n,
19
- offscreenFactory: d
20
- }), a = f && i === m ? null : i;
21
- return {
22
- bitmap: a,
23
- owned: a !== m
24
- };
25
- });
26
- }
27
- //#endregion
28
- //#region packages/core/src/internal/resource-measurement.ts
29
- function s(e, t) {
30
- if (!Number.isSafeInteger(e) || e < 0) throw Error(`${t} must be a non-negative safe integer`);
31
- }
32
- function c(e, t, n) {
33
- 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;
34
- }
35
- function l(e, t = 2 ** 53 - 1) {
36
- s(t, "resource measurement limit");
37
- let n = 0;
38
- for (let r = 0; r < e.length; r += 1) {
39
- let i = e.charCodeAt(r), a;
40
- if (i <= 127) a = 1;
41
- else if (i <= 2047) a = 2;
42
- else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
43
- let t = e.charCodeAt(r + 1);
44
- t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 3;
45
- } else a = 3;
46
- if (n = c(n, a, t), n > t) return n;
47
- }
48
- return n;
49
- }
50
- function u(e, t = 2 ** 53 - 1) {
51
- s(t, "resource measurement limit");
52
- let n = c(0, 2, t);
53
- if (n > t) return n;
54
- for (let r = 0; r < e.length; r += 1) {
55
- let i = e.charCodeAt(r), a;
56
- if (i === 34 || i === 92 || i === 8 || i === 9 || i === 10 || i === 12 || i === 13) a = 2;
57
- else if (i <= 31) a = 6;
58
- else if (i <= 127) a = 1;
59
- else if (i <= 2047) a = 2;
60
- else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
61
- let t = e.charCodeAt(r + 1);
62
- t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 6;
63
- } else a = i >= 55296 && i <= 57343 ? 6 : 3;
64
- if (n = c(n, a, t), n > t) return n;
65
- }
66
- return n;
67
- }
68
- function d(e, t) {
69
- return c(0, e, t);
70
- }
71
- function f(e, t = 2 ** 53 - 1, n = !1) {
72
- if (s(t, "resource measurement limit"), e === null) return {
73
- jsonBytes: d(4, t),
74
- stringValueUtf8Bytes: 0
75
- };
76
- if (typeof e == "string") return {
77
- jsonBytes: u(e, t),
78
- stringValueUtf8Bytes: l(e, t)
79
- };
80
- if (typeof e == "boolean") return {
81
- jsonBytes: d(e ? 4 : 5, t),
82
- stringValueUtf8Bytes: 0
83
- };
84
- if (typeof e == "number") return {
85
- jsonBytes: d((Number.isFinite(e) ? String(Object.is(e, -0) ? 0 : e) : "null").length, t),
86
- stringValueUtf8Bytes: 0
87
- };
88
- if (typeof e == "bigint") throw TypeError("BigInt values cannot be serialized to JSON");
89
- if (Array.isArray(e)) {
90
- let n = d(2, t), r = 0;
91
- for (let i = 0; i < e.length; i += 1) {
92
- i !== 0 && (n = c(n, 1, t));
93
- let a = f(e[i], t, !0);
94
- n = c(n, a.jsonBytes, t), r = c(r, a.stringValueUtf8Bytes, t);
95
- }
96
- return {
97
- jsonBytes: n,
98
- stringValueUtf8Bytes: r
99
- };
100
- }
101
- if (typeof e == "object") {
102
- let n = d(2, t), r = 0, i = 0;
103
- for (let [a, o] of Object.entries(e)) {
104
- if (o === void 0 || typeof o == "function" || typeof o == "symbol") continue;
105
- i++ !== 0 && (n = c(n, 1, t)), n = c(n, u(a, t), t), n = c(n, 1, t);
106
- let e = f(o, t);
107
- n = c(n, e.jsonBytes, t), r = c(r, e.stringValueUtf8Bytes, t);
108
- }
109
- return {
110
- jsonBytes: n,
111
- stringValueUtf8Bytes: r
112
- };
113
- }
114
- return {
115
- jsonBytes: n ? d(4, t) : 0,
116
- stringValueUtf8Bytes: 0
117
- };
118
- }
119
- //#endregion
120
- export { o as i, f as n, l as r, c as t };
@@ -1,69 +0,0 @@
1
- //#region packages/core/src/canvas/aux-canvas.ts
2
- function e(e, t) {
3
- return [Math.max(1, Math.ceil(e)), Math.max(1, Math.ceil(t))];
4
- }
5
- function t(t, n) {
6
- let [r, i] = e(t, n);
7
- if (typeof OffscreenCanvas < "u") return new OffscreenCanvas(r, i);
8
- if (typeof document < "u") {
9
- let e = document.createElement("canvas");
10
- return e.width = r, e.height = i, e;
11
- }
12
- return null;
13
- }
14
- function n(t, n, r) {
15
- let [i, a] = e(n, r);
16
- if (typeof OffscreenCanvas < "u") try {
17
- return new OffscreenCanvas(i, a);
18
- } catch {}
19
- if (typeof document < "u") try {
20
- let e = document.createElement("canvas");
21
- return e.width = i, e.height = a, e;
22
- } catch {}
23
- try {
24
- let e = t.canvas?.constructor;
25
- return typeof e == "function" ? new e(i, a) : null;
26
- } catch {
27
- return null;
28
- }
29
- }
30
- //#endregion
31
- //#region packages/core/src/image/pixel-budget.ts
32
- var r = 32767, i = 1 << 25, a = i * 4, o = class e extends RangeError {
33
- code = "ooxml-decoded-image-limit";
34
- constructor(t, n, r) {
35
- super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`), this.metric = t, this.limit = n, this.observed = r, this.name = "OoxmlDecodedImageLimitError", Object.setPrototypeOf(this, e.prototype);
36
- }
37
- };
38
- function s(e) {
39
- return e instanceof o || !!e && typeof e == "object" && e.code === "ooxml-decoded-image-limit";
40
- }
41
- //#endregion
42
- //#region packages/core/src/image/tiff-contract.ts
43
- function c(e) {
44
- if (e.length < 4) return !1;
45
- let t = e[0] === 73 && e[1] === 73, n = e[0] === 77 && e[1] === 77;
46
- return !t && !n ? !1 : new DataView(e.buffer, e.byteOffset, e.byteLength).getUint16(2, t) === 42;
47
- }
48
- function l(e) {
49
- if (!c(e) || e.length < 8) return null;
50
- let t = e[0] === 73, n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = (e, t) => Number.isSafeInteger(e) && e >= 0 && t >= 0 && e <= n.byteLength - t, i = n.getUint32(4, t);
51
- if (!r(i, 2)) return null;
52
- let a = n.getUint16(i, t);
53
- if (!r(i + 2, a * 12 + 4)) return null;
54
- let o, s;
55
- for (let e = 0; e < a; e++) {
56
- let r = i + 2 + e * 12, a = n.getUint16(r, t);
57
- if (a !== 256 && a !== 257) continue;
58
- let c = n.getUint16(r + 2, t);
59
- if (n.getUint32(r + 4, t) !== 1 || c !== 1 && c !== 3 && c !== 4) return null;
60
- let l = c === 1 ? n.getUint8(r + 8) : c === 3 ? n.getUint16(r + 8, t) : n.getUint32(r + 8, t);
61
- a === 256 ? o = l : s = l;
62
- }
63
- return o === void 0 || s === void 0 ? null : {
64
- width: o,
65
- height: s
66
- };
67
- }
68
- //#endregion
69
- export { i as a, t as c, r as i, n as l, l as n, o, a as r, s, c as t };