@silurus/ooxml 0.86.0 → 0.87.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.
Files changed (67) hide show
  1. package/README.md +42 -2
  2. package/dist/assets/render-worker-CeK_iqK3.js +10 -0
  3. package/dist/assets/render-worker-DusrDhPk.js +11 -0
  4. package/dist/assets/render-worker-n2ZG0lrQ.js +31 -0
  5. package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +119 -0
  6. package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-Cpk0YFvM.js} +301 -155
  7. package/dist/chart-ex.mjs +1 -1
  8. package/dist/cjk-fallback-bLI3z70h.js +46 -0
  9. package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-BfE7MJZn.js} +4 -4
  10. package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
  11. package/dist/{comment-ui-runtime-DEtgcmj7.js → comment-ui-runtime-DcJOYlw-.js} +5 -5
  12. package/dist/{comments-CAn2A_Xh.js → comments-Diid5ujN.js} +1 -1
  13. package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-yKxI8aDH.js} +4326 -4238
  14. package/dist/{docx-DzDiGvqe.js → docx-BkSRiy07.js} +541 -349
  15. package/dist/docx.mjs +7 -7
  16. package/dist/docx_parser_bg.wasm +0 -0
  17. package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CBUQJsIM.js} +63 -57
  18. package/dist/{hyperlink-enyPbflR.js → hyperlink-ArrU3ArU.js} +1014 -951
  19. package/dist/index.mjs +4 -4
  20. package/dist/line-distribute-Dtudnqhs.js +1023 -0
  21. package/dist/math.mjs +2 -2
  22. package/dist/node.mjs +380 -376
  23. package/dist/{pptx-D_U62nl-.js → pptx-62MmVbYB.js} +462 -447
  24. package/dist/pptx.mjs +7 -7
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/region-map.mjs +1 -1
  27. package/dist/{render-DSn0d35X.js → render-8Zo7dnds.js} +31 -29
  28. package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-BfbnEChF.js} +1 -1
  29. package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-DNL9dWRh.js} +1 -1
  30. package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-IkHrYOci.js} +1 -1
  31. package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CJsgolre.js} +9 -9
  32. package/dist/{session-C1GYhr6n.js → session-CrU8f8DI.js} +91 -91
  33. package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-B9KA8bU6.js} +1069 -966
  34. package/dist/three-d.mjs +1 -1
  35. package/dist/tiff.mjs +1 -1
  36. package/dist/types/chart-ex.d.ts +2 -2
  37. package/dist/types/docx.d.ts +15 -12
  38. package/dist/types/index.d.ts +23 -18
  39. package/dist/types/math.d.ts +1 -1
  40. package/dist/types/node.d.ts +12 -6
  41. package/dist/types/pptx.d.ts +15 -11
  42. package/dist/types/region-map.d.ts +2 -2
  43. package/dist/types/three-d.d.ts +2 -2
  44. package/dist/types/tiff.d.ts +1 -1
  45. package/dist/types/xlsx.d.ts +15 -11
  46. package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-eIcQ-xlD.js} +65 -65
  47. package/dist/{xlsx-CMHmYTHP.js → xlsx-CRcSzZNq.js} +1656 -1630
  48. package/dist/xlsx.mjs +4 -4
  49. package/dist/xlsx_parser_bg.wasm +0 -0
  50. package/package.json +1 -1
  51. package/dist/assets/render-worker-BCGnuBLj.js +0 -10
  52. package/dist/assets/render-worker-CB4DxjXg.js +0 -31
  53. package/dist/assets/render-worker-CHW0F0n6.js +0 -11
  54. package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
  55. package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
  56. package/dist/line-distribute-BFB575d6.js +0 -1023
  57. /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-C8Y2uoVr.js} +0 -0
  58. /package/dist/{delimited-text-worker-host-DcHj_JZt.js → delimited-text-worker-host-BVY-Ecni.js} +0 -0
  59. /package/dist/{highlight-rect-FuUSmL3a.js → highlight-rect-C5hkRqUr.js} +0 -0
  60. /package/dist/{line-metrics-CBbw80Ko.js → line-metrics-B60C86uh.js} +0 -0
  61. /package/dist/{mathjax-DS69BmJd.js → mathjax-DoyWZbSp.js} +0 -0
  62. /package/dist/{read-only-comment-decoration-BTnWEeo5.js → read-only-comment-decoration-Dz7eTQ4d.js} +0 -0
  63. /package/dist/{read-only-comment-margin-plStyGfE.js → read-only-comment-margin-DkgzASAl.js} +0 -0
  64. /package/dist/{renderer-module-contract-Cu-GKuPd.js → renderer-module-contract-D91rkYHH.js} +0 -0
  65. /package/dist/{source-key-Ktb1GRE5.js → source-key-DIJG8BA0.js} +0 -0
  66. /package/dist/{transfer-mIj7E7NB.js → transfer-p6iCC2R7.js} +0 -0
  67. /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.js} +0 -0
package/dist/docx.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { on as e, r as t, sn as n } from "./hyperlink-enyPbflR.js";
2
- import { T as r } from "./canvas-viewer-mechanics-B3A7KLLi.js";
3
- import { l as i, s as a } from "./pixel-budget-Dgjw269h.js";
4
- import { i as o, s } from "./raster-target-ojDdQizC.js";
5
- import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./docx-DzDiGvqe.js";
6
- import { n as g, r as _ } from "./comments-CAn2A_Xh.js";
7
- export { l as DocxDocument, m as DocxScrollViewer, u as DocxViewer, a as OoxmlDecodedImageLimitError, e as OoxmlError, n as OoxmlResourceLimitError, o as TiffDecodeError, r as autoResize, p as buildDocxHighlightLayer, h as buildDocxTextLayer, i as isOoxmlDecodedImageLimitError, s as isTiffDecodeError, f as noteText, t as openExternalHyperlink, c as readDocxTextSelectionContext, g as resolveCommentAnchorRuns, _ as resolveDocxCommentThreads, d as resolveRevisionAnchorRuns };
1
+ import { ln as e, r as t, un as n } from "./hyperlink-ArrU3ArU.js";
2
+ import { T as r } from "./canvas-viewer-mechanics-Cpk0YFvM.js";
3
+ import { a as i, c as a, i as o, l as s, n as c, o as l, r as u, s as d } from "./docx-BkSRiy07.js";
4
+ import { l as f, s as p } from "./pixel-budget-Dgjw269h.js";
5
+ import { i as m, s as h } from "./raster-target-ojDdQizC.js";
6
+ import { n as g, r as _ } from "./comments-Diid5ujN.js";
7
+ export { a as DocxDocument, u as DocxScrollViewer, o as DocxViewer, p as OoxmlDecodedImageLimitError, e as OoxmlError, n as OoxmlResourceLimitError, m as TiffDecodeError, r as autoResize, l as buildDocxHighlightLayer, d as buildDocxTextLayer, f as isOoxmlDecodedImageLimitError, h as isTiffDecodeError, c as noteText, t as openExternalHyperlink, i as readDocxTextSelectionContext, g as resolveCommentAnchorRuns, _ as resolveDocxCommentThreads, s as resolveRevisionAnchorRuns };
Binary file
@@ -1,65 +1,71 @@
1
- import { Kt as e } from "./hyperlink-enyPbflR.js";
2
- import { c as t, o as n, r, s as i } from "./bounded-raw-part-cache-DVx3Camo.js";
1
+ import { Yt as e } from "./hyperlink-ArrU3ArU.js";
2
+ import { A as t, E as n, j as r, k as i } from "./canvas-viewer-mechanics-Cpk0YFvM.js";
3
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);
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);
6
9
  for (let e = 0; e < i; e++) r[e] ^= n[e % 16];
7
10
  return r;
8
11
  }
9
- function o(e) {
12
+ function s(e) {
10
13
  let t = e.replace(/[{}\-\s]/g, "");
11
14
  if (t.length !== 32 || /[^0-9a-fA-F]/.test(t)) throw Error(`invalid fontKey GUID: ${e}`);
12
15
  let n = new Uint8Array(16);
13
16
  for (let e = 0; e < 16; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
14
17
  return n.reverse();
15
18
  }
16
- function s(e, t, n, r) {
19
+ function c(e, t, n, r) {
17
20
  let i = 2166136261;
18
21
  for (let e = 0; e < r.length; e++) i ^= r[e], i = Math.imul(i, 16777619);
19
22
  return `${e}|${t}|${n}|${r.length}|${(i >>> 0).toString(16)}`;
20
23
  }
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);
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);
28
31
  continue;
29
32
  }
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, {
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, {
35
38
  weight: e.weight,
36
39
  style: e.style
37
40
  });
38
- return l.add(r), r;
41
+ return u.add(r), r;
39
42
  });
40
- u.push(i);
43
+ d.push(i);
41
44
  } catch {
42
- f.push(e.family);
45
+ p.push(e.family);
43
46
  }
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 = []);
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 = []);
51
54
  }
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;
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;
53
56
  }
54
- function l(e) {
55
- i(e);
57
+ function u(e) {
58
+ t(e);
56
59
  }
57
60
  //#endregion
58
61
  //#region packages/core/src/layout/virtual-scroll.ts
59
- function u(e, t, n) {
62
+ function d(e, t, n) {
60
63
  return e < t ? t : e > n ? n : e;
61
64
  }
62
- function d(e, t, n) {
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) {
63
69
  let r = e.length;
64
70
  if (r === 0) return {
65
71
  offsets: [],
@@ -72,7 +78,7 @@ function d(e, t, n) {
72
78
  totalHeight: i + s + (r - 1) * t + a
73
79
  };
74
80
  }
75
- function f(e, t, n, r) {
81
+ function m(e, t, n, r) {
76
82
  let i = e.offsets, a = i.length;
77
83
  if (a === 0) return {
78
84
  start: 0,
@@ -86,38 +92,38 @@ function f(e, t, n, r) {
86
92
  let e = o + s >>> 1;
87
93
  i[e] <= t ? o = e + 1 : s = e;
88
94
  }
89
- let c = u(o - 1, 0, a - 1), l = t + n;
95
+ let c = d(o - 1, 0, a - 1), l = t + n;
90
96
  for (o = 0, s = a; o < s;) {
91
97
  let e = o + s >>> 1;
92
98
  i[e] < l ? o = e + 1 : s = e;
93
99
  }
94
- let d = u(o - 1, 0, a - 1);
100
+ let u = d(o - 1, 0, a - 1);
95
101
  return {
96
- start: u(c - r, 0, a - 1),
97
- end: u(d + r, 0, a - 1),
102
+ start: d(c - r, 0, a - 1),
103
+ end: d(u + r, 0, a - 1),
98
104
  topIndex: c,
99
105
  offsets: i,
100
106
  totalHeight: e.totalHeight
101
107
  };
102
108
  }
103
- function p(e, t, n, r, i, a, o) {
109
+ function h(e, t, n, r, i, a, o) {
104
110
  if (e === 0) return {
105
111
  start: 0,
106
112
  end: -1,
107
113
  topIndex: 0,
108
114
  totalHeight: 0
109
115
  };
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);
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);
111
117
  return {
112
- start: u(d - a, 0, e - 1),
113
- end: u(p + a, 0, e - 1),
114
- topIndex: d,
118
+ start: d(u - a, 0, e - 1),
119
+ end: d(p + a, 0, e - 1),
120
+ topIndex: u,
115
121
  totalHeight: s + e * t + (e - 1) * n + c
116
122
  };
117
123
  }
118
124
  //#endregion
119
125
  //#region packages/core/src/internal/progressive-layout-lifecycle.ts
120
- var m = class {
126
+ var g = class {
121
127
  state = Object.freeze({ status: "complete" });
122
128
  get complete() {
123
129
  return this.state.status === "complete";
@@ -141,7 +147,7 @@ var m = class {
141
147
  throwIfFailed() {
142
148
  if (this.state.status === "failed") throw this.state.error;
143
149
  }
144
- }, h = class {
150
+ }, _ = class {
145
151
  failed = /* @__PURE__ */ new WeakMap();
146
152
  notify(e, t, ...n) {
147
153
  if (!(!t || this.failed.get(t)?.has(e))) try {
@@ -158,8 +164,8 @@ var m = class {
158
164
  let i = n instanceof Error ? n : Error(String(n));
159
165
  console.error(`[ooxml] ${e} callback failed and was disabled:`, i);
160
166
  }
161
- }, g = 65536;
162
- function _(e, t) {
167
+ }, v = 65536;
168
+ function y(e, t) {
163
169
  let n = Math.min(e.length, t);
164
170
  if (n > 0 && n < e.length) {
165
171
  let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
@@ -167,13 +173,13 @@ function _(e, t) {
167
173
  }
168
174
  return e.slice(0, n);
169
175
  }
170
- function v(e) {
176
+ function b(e) {
171
177
  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));
178
+ return Math.min(v, Math.floor(e ?? 65536));
173
179
  }
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));
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));
177
183
  return i += t.length, t.length < e.text.length && (a = !0), {
178
184
  ...e,
179
185
  text: t
@@ -191,27 +197,27 @@ function y(e, t, n) {
191
197
  }
192
198
  //#endregion
193
199
  //#region packages/core/src/internal/dom-interaction-boundary.ts
194
- function b(e, t) {
200
+ function S(e, t) {
195
201
  return e.dataset?.[t] !== void 0;
196
202
  }
197
- function x(e, t, n) {
203
+ function C(e, t, n) {
198
204
  let r = typeof e.composedPath == "function" ? e.composedPath() : [];
199
205
  if (r.length > 0) {
200
206
  let e = !1;
201
207
  for (let i of r) {
202
208
  if (i === t) return e;
203
- b(i, n) && (e = !0);
209
+ S(i, n) && (e = !0);
204
210
  }
205
211
  }
206
212
  let i = e.target;
207
213
  if (!i || !t.contains(i)) return !1;
208
214
  let a = i;
209
215
  for (; a;) {
210
- if (b(a, n)) return !0;
216
+ if (S(a, n)) return !0;
211
217
  if (a === t) break;
212
218
  a = a.parentElement;
213
219
  }
214
220
  return !1;
215
221
  }
216
222
  //#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 };
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 };