@silurus/ooxml 0.88.0 → 0.89.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 +118 -23
- package/THIRD_PARTY_NOTICES.md +7 -6
- package/dist/abort-VrnK7mdP.js +10 -0
- package/dist/assets/render-worker-CUOU6mL2.js +16 -0
- package/dist/assets/render-worker-DOqrFhSU.js +15 -0
- package/dist/assets/render-worker-DvWUdZUN.js +35 -0
- package/dist/bounded-raw-part-cache-B7JoC1CD.js +64586 -0
- package/dist/bundled-asset-url-E2nXURF9.js +15 -0
- package/dist/canvas-viewer-mechanics-DfQqRKkD.js +675 -0
- package/dist/cfb-guard-9QTRTg7f.js +528 -0
- package/dist/chart-ex.mjs +692 -688
- package/dist/comment-overlay-controller-B5_zGgG5.js +994 -0
- package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
- package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-D_sb2K6s.js} +5 -5
- package/dist/{comment-ui-runtime-CWGqn5Vr.js → comment-ui-runtime-Jy-3goA9.js} +5 -5
- package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
- package/dist/document-model-source-BKNrXjAL.js +249 -0
- package/dist/document-pull-client-CxONDGbk.js +37833 -0
- package/dist/document-pull-worker-AMyXYpPq.js +104 -0
- package/dist/docx-D91ER1_S.js +495 -0
- package/dist/docx-DhDnKEI6.js +3563 -0
- package/dist/docx-model-source-CdrSt3hF.js +98 -0
- package/dist/docx-source-worker.mjs +455 -0
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/drawingml-shape-ChcGZNd8.js +310 -0
- package/dist/duotone-ekYik4ix.js +126 -0
- package/dist/emf-UT6I8rVi.js +1790 -0
- package/dist/font-preload-demand-CdJZUMCT.js +2058 -0
- package/dist/grid-geometry-uQOgViJU.js +384 -0
- package/dist/host-layout-DVMw8hDY.js +56 -0
- package/dist/host-layout-measure-CCEgaC_v.js +7 -0
- package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
- package/dist/index.mjs +4 -4
- package/dist/internal-companion.mjs +12 -0
- package/dist/line-distribute-CPOV6csk.js +2716 -0
- package/dist/math.mjs +2 -2
- package/dist/mathjax-stix2.js +10 -10
- package/dist/model-source-DJGzDtGb.js +61 -0
- package/dist/model-source-kz_NkZqT.js +179 -0
- package/dist/model-source-session-Bu9CHFHc.js +71 -0
- package/dist/model-source-session-CDuijwv1.js +85 -0
- package/dist/model-source-session-sKpNiIJI.js +58 -0
- package/dist/node.mjs +7 -1327
- package/dist/{pixel-budget-9P63Bsk5.js → pixel-budget-BpTYrepD.js} +13 -10
- package/dist/plot-area-frame-CaJFvZ7p.js +8502 -0
- package/dist/pptx-CDP9dZHe.js +2936 -0
- package/dist/pptx-C_uxLVKB.js +183 -0
- package/dist/pptx-model-source-O7LhpOjz.js +37 -0
- package/dist/pptx-source-worker.mjs +446 -0
- package/dist/pptx.mjs +8 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/presentation-model-source-tmROzteR.js +77 -0
- package/dist/raster-target-YQ4G6rxo.js +42 -0
- package/dist/region-map.mjs +114 -150
- package/dist/{render-D3iqVKCo.js → render-CJVglUHl.js} +3 -3
- package/dist/{render-worker-host-B5wQfB7U.js → render-worker-host-BseIaVvm.js} +1 -1
- package/dist/{render-worker-host-D4123J27.js → render-worker-host-CyxPU4JU.js} +1 -1
- package/dist/{render-worker-host-Di3LxLc0.js → render-worker-host-aF6aWkC0.js} +1 -1
- package/dist/renderer-CkGLj0CC.js +5170 -0
- package/dist/renderer-Czw1cCC7.js +5823 -0
- package/dist/resource-measurement-mXw-WjMF.js +771 -0
- package/dist/session-Csv9maad.js +656 -0
- package/dist/slide-pull-client-DRZYwBTu.js +6515 -0
- package/dist/three-d-BK5siJgJ.js +878 -0
- package/dist/three-d.mjs +960 -945
- package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
- package/dist/tiff.mjs +401 -248
- package/dist/types/chart-ex.d.ts +149 -2
- package/dist/types/docx.d.ts +333 -96
- package/dist/types/index.d.ts +566 -301
- package/dist/types/internal-companion.d.ts +11 -0
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +422 -9
- package/dist/types/pptx.d.ts +302 -95
- package/dist/types/region-map.d.ts +149 -2
- package/dist/types/three-d.d.ts +149 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +343 -132
- package/dist/wasm-loader-rlgHmcSv.js +35 -0
- package/dist/wasm-runtime-generation-DX4y0Ecl.js +97 -0
- package/dist/workbook-model-source-BTC4ISTS.js +94 -0
- package/dist/worker-source-I1cIYBel.js +22 -0
- package/dist/worker-source-SbudzjYL.js +22 -0
- package/dist/worker-source-UAi3GNcM.js +22 -0
- package/dist/worksheet-pull-client-CkHgbtyM.js +579 -0
- package/dist/xlsx-CpSDPAEU.js +5809 -0
- package/dist/xlsx-D5569TPf.js +534 -0
- package/dist/xlsx-model-source-DPSkjFic.js +309 -0
- package/dist/xlsx-source-worker.mjs +525 -0
- package/dist/xlsx.mjs +8 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +42 -16
- package/dist/assets/render-worker-1uPAxMZr.js +0 -31
- package/dist/assets/render-worker-BlvJybji.js +0 -10
- package/dist/assets/render-worker-CzmiJfFL.js +0 -11
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/dist/canvas-viewer-mechanics-DbLz0rYW.js +0 -1384
- package/dist/cjk-fallback-bLI3z70h.js +0 -46
- package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
- package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/dist/comments-Diid5ujN.js +0 -246
- package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
- package/dist/document-pull-client-B9PTM-pL.js +0 -27280
- package/dist/docx-BF9WXrYH.js +0 -3103
- package/dist/dom-interaction-boundary-Cnm8DSBN.js +0 -223
- package/dist/highlight-rect-C5hkRqUr.js +0 -13
- package/dist/hyperlink-Cxzhet30.js +0 -36446
- package/dist/line-distribute-D1WNHKz_.js +0 -1023
- package/dist/line-metrics-B60C86uh.js +0 -60
- package/dist/plot-area-frame-DLTYKHNP.js +0 -4354
- package/dist/pptx-DkyYBYoL.js +0 -3065
- package/dist/renderer-B4GZb5We.js +0 -6492
- package/dist/resource-measurement-SHQCbkh2.js +0 -150
- package/dist/session-BGq81gRQ.js +0 -743
- package/dist/slide-pull-client-DiPnm240.js +0 -6253
- package/dist/source-key-DIJG8BA0.js +0 -42
- package/dist/three-d-DJBl8g8M.js +0 -1162
- package/dist/transfer-p6iCC2R7.js +0 -6
- package/dist/units-BzZ0gAxs.js +0 -4
- package/dist/worksheet-pull-client-BM8ywvbu.js +0 -458
- package/dist/xlsx-C9NVjgaV.js +0 -8484
- /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
- /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
- /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
- /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
- /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
- /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { Sa as e } from "./plot-area-frame-CaJFvZ7p.js";
|
|
2
|
+
function t(e, t = 8) {
|
|
3
|
+
return Math.trunc((256 * e + Math.trunc(128 / t)) / 256 * t);
|
|
4
|
+
}
|
|
5
|
+
function n(e, n = 8) {
|
|
6
|
+
return t(Math.trunc((e * n + 5) / n * 256) / 256, n);
|
|
7
|
+
}
|
|
8
|
+
function r(e, t) {
|
|
9
|
+
return Math.ceil(Math.round(e * t + 5) / 8) * 8;
|
|
10
|
+
}
|
|
11
|
+
function i(e, t = 8) {
|
|
12
|
+
return e / t;
|
|
13
|
+
}
|
|
14
|
+
function a(t) {
|
|
15
|
+
return Math.round(t * e);
|
|
16
|
+
}
|
|
17
|
+
function o(t) {
|
|
18
|
+
return t / e;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region packages/xlsx/src/internal/grid-axis-geometry.ts
|
|
22
|
+
var s = class e {
|
|
23
|
+
maxIndex;
|
|
24
|
+
indices;
|
|
25
|
+
cumulativeDelta;
|
|
26
|
+
customPx;
|
|
27
|
+
defaultPx;
|
|
28
|
+
spans;
|
|
29
|
+
constructor(e, t, n, r, i, a) {
|
|
30
|
+
this.maxIndex = r, this.defaultPx = Number.isFinite(t) && t >= 0 ? t : 0, this.indices = i ? i.map((e) => e.index) : Object.keys(e).map(Number).filter((e) => e >= 1 && e <= r).sort((e, t) => e - t), this.cumulativeDelta = Array(this.indices.length), this.customPx = Array(this.indices.length);
|
|
31
|
+
let o = 0;
|
|
32
|
+
for (let t = 0; t < this.indices.length; t++) {
|
|
33
|
+
let r = i?.[t]?.px ?? n(e[this.indices[t]]), a = Number.isFinite(r) && r >= 0 ? r : this.defaultPx;
|
|
34
|
+
this.customPx[t] = a, o += a - this.defaultPx, this.cumulativeDelta[t] = o;
|
|
35
|
+
}
|
|
36
|
+
if (a?.length) {
|
|
37
|
+
let e = [...new Set([
|
|
38
|
+
1,
|
|
39
|
+
r + 1,
|
|
40
|
+
...a.flatMap((e) => [e.first, e.last + 1]),
|
|
41
|
+
...this.indices.flatMap((e) => [e, e + 1])
|
|
42
|
+
])].sort((e, t) => e - t), t = new Map(this.indices.map((e, t) => [e, this.customPx[t]])), n = [], i = [], o = 0, s = 0;
|
|
43
|
+
for (let r = 0; r < e.length; r++) {
|
|
44
|
+
let c = e[r];
|
|
45
|
+
for (; o < a.length && a[o].last < c;) o++;
|
|
46
|
+
let l = a[o], u = t.get(c) ?? (l && l.first <= c ? l.px : this.defaultPx);
|
|
47
|
+
i.push(s), n.push(u), r + 1 < e.length && (s += (e[r + 1] - c) * u);
|
|
48
|
+
}
|
|
49
|
+
this.spans = {
|
|
50
|
+
starts: e,
|
|
51
|
+
pixels: n,
|
|
52
|
+
offsets: i
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
deltaBefore(e) {
|
|
57
|
+
let t = 0, n = this.indices.length;
|
|
58
|
+
for (; t < n;) {
|
|
59
|
+
let r = t + n >> 1;
|
|
60
|
+
this.indices[r] < e ? t = r + 1 : n = r;
|
|
61
|
+
}
|
|
62
|
+
return t === 0 ? 0 : this.cumulativeDelta[t - 1];
|
|
63
|
+
}
|
|
64
|
+
offsetOf(e) {
|
|
65
|
+
if (this.spans) {
|
|
66
|
+
let t = 0, n = this.spans.starts.length;
|
|
67
|
+
for (; t < n;) {
|
|
68
|
+
let r = t + n >>> 1;
|
|
69
|
+
this.spans.starts[r] <= e ? t = r + 1 : n = r;
|
|
70
|
+
}
|
|
71
|
+
let r = Math.max(0, t - 1);
|
|
72
|
+
return this.spans.offsets[r] + (e - this.spans.starts[r]) * this.spans.pixels[r];
|
|
73
|
+
}
|
|
74
|
+
return (e - 1) * this.defaultPx + this.deltaBefore(e);
|
|
75
|
+
}
|
|
76
|
+
indexAt(e) {
|
|
77
|
+
if (e < 0) return {
|
|
78
|
+
index: 1,
|
|
79
|
+
partial: 0
|
|
80
|
+
};
|
|
81
|
+
let t = 1, n = this.maxIndex;
|
|
82
|
+
for (; t < n;) {
|
|
83
|
+
let r = t + n + 1 >> 1;
|
|
84
|
+
this.offsetOf(r) <= e ? t = r : n = r - 1;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
index: t,
|
|
88
|
+
partial: e - this.offsetOf(t)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
scrollableIndexAt(e, t) {
|
|
92
|
+
let n = e + this.offsetOf(t);
|
|
93
|
+
return n >= this.offsetOf(this.maxIndex) + this.sizeOf(this.maxIndex) ? null : this.indexAt(n).index;
|
|
94
|
+
}
|
|
95
|
+
sizeOf(e) {
|
|
96
|
+
return this.offsetOf(e + 1) - this.offsetOf(e);
|
|
97
|
+
}
|
|
98
|
+
scaled(t) {
|
|
99
|
+
return this.spans ? new e({}, Math.round(this.defaultPx * t), (e) => e, this.maxIndex, [], this.spans.starts.slice(0, -1).map((e, n) => ({
|
|
100
|
+
first: e,
|
|
101
|
+
last: this.spans.starts[n + 1] - 1,
|
|
102
|
+
px: Math.round(this.spans.pixels[n] * t)
|
|
103
|
+
}))) : new e({}, Math.round(this.defaultPx * t), (e) => e, this.maxIndex, this.indices.map((e, n) => ({
|
|
104
|
+
index: e,
|
|
105
|
+
px: Math.round(this.customPx[n] * t)
|
|
106
|
+
})));
|
|
107
|
+
}
|
|
108
|
+
positiveRanges() {
|
|
109
|
+
let e = [], t = (t, n, r) => {
|
|
110
|
+
if (r <= 0 || t > n) return;
|
|
111
|
+
let i = e.at(-1);
|
|
112
|
+
i && i.last + 1 === t ? i.last = n : e.push({
|
|
113
|
+
first: t,
|
|
114
|
+
last: n
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
if (this.spans) for (let e = 0; e + 1 < this.spans.starts.length; e++) t(this.spans.starts[e], this.spans.starts[e + 1] - 1, this.spans.pixels[e]);
|
|
118
|
+
else {
|
|
119
|
+
let e = 1;
|
|
120
|
+
for (let n = 0; n < this.indices.length; n++) t(e, this.indices[n] - 1, this.defaultPx), t(this.indices[n], this.indices[n], this.customPx[n]), e = this.indices[n] + 1;
|
|
121
|
+
t(e, this.maxIndex, this.defaultPx);
|
|
122
|
+
}
|
|
123
|
+
return e;
|
|
124
|
+
}
|
|
125
|
+
countToCover(e, t) {
|
|
126
|
+
if (e > this.maxIndex || t <= 0) return 0;
|
|
127
|
+
let n = this.offsetOf(e) + t;
|
|
128
|
+
if (n >= this.offsetOf(this.maxIndex) + this.sizeOf(this.maxIndex)) return this.maxIndex - e + 1;
|
|
129
|
+
let r = this.indexAt(n);
|
|
130
|
+
return r.index - e + +(r.partial > 0);
|
|
131
|
+
}
|
|
132
|
+
bandsToCover(e, t, n = Infinity) {
|
|
133
|
+
let r = Math.max(1, e), i = Math.min(this.maxIndex, t);
|
|
134
|
+
if (r > i || n <= 0) return [];
|
|
135
|
+
let a = [], o = 0, s = Math.max(r, this.indexAt(this.offsetOf(r)).index);
|
|
136
|
+
for (; s <= i && o < n;) {
|
|
137
|
+
let e = this.sizeOf(s);
|
|
138
|
+
if (Number.isFinite(e) && e > 0 && (a.push({
|
|
139
|
+
index: s,
|
|
140
|
+
size: e
|
|
141
|
+
}), o += e), s >= i) break;
|
|
142
|
+
let t = this.offsetOf(s + 1), n = this.indexAt(t).index;
|
|
143
|
+
s = Math.max(s + 1, n);
|
|
144
|
+
}
|
|
145
|
+
return a;
|
|
146
|
+
}
|
|
147
|
+
}, c = /* @__PURE__ */ new WeakMap(), l = Object.freeze([]);
|
|
148
|
+
function u(e, t) {
|
|
149
|
+
t.columns || t.rows ? c.set(e, t) : c.delete(e);
|
|
150
|
+
}
|
|
151
|
+
function d(e) {
|
|
152
|
+
return c.get(e)?.columns;
|
|
153
|
+
}
|
|
154
|
+
function f(e, t) {
|
|
155
|
+
return c.get(e)?.columns?.get(t);
|
|
156
|
+
}
|
|
157
|
+
function p(e, t, n) {
|
|
158
|
+
let r = c.get(e), i = r?.columns;
|
|
159
|
+
return n === null || !Number.isFinite(n) || n < 0 ? i?.delete(t) ? (i.size === 0 && (delete r.columns, u(e, r)), !0) : !1 : i?.get(t) === n ? !1 : (i ? i.set(t, n) : c.set(e, {
|
|
160
|
+
...r,
|
|
161
|
+
columns: new Map([[t, n]])
|
|
162
|
+
}), !0);
|
|
163
|
+
}
|
|
164
|
+
function m(e) {
|
|
165
|
+
return c.get(e)?.rows ?? l;
|
|
166
|
+
}
|
|
167
|
+
function h(e, t) {
|
|
168
|
+
let n = 0, r = e.length;
|
|
169
|
+
for (; n < r;) {
|
|
170
|
+
let i = n + r >>> 1;
|
|
171
|
+
e[i].first <= t ? n = i + 1 : r = i;
|
|
172
|
+
}
|
|
173
|
+
return n > 0 && e[n - 1].last >= t;
|
|
174
|
+
}
|
|
175
|
+
var g = 16384;
|
|
176
|
+
function _(e) {
|
|
177
|
+
if (e.length > 16384) throw RangeError("Too many row resize intervals.");
|
|
178
|
+
let t = 0;
|
|
179
|
+
for (let n of e) {
|
|
180
|
+
if (!Number.isInteger(n.first) || !Number.isInteger(n.last) || n.first <= t || n.last < n.first || n.last > 1048576 || !Number.isFinite(n.height) || n.height <= 0) throw RangeError("Invalid row resize interval.");
|
|
181
|
+
t = n.last;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function v(e, t) {
|
|
185
|
+
_(t);
|
|
186
|
+
let n = c.get(e) ?? {};
|
|
187
|
+
t.length ? n.rows = Object.isFrozen(t) && t.every(Object.isFrozen) ? t : Object.freeze(t.map((e) => Object.freeze({ ...e }))) : delete n.rows, u(e, n);
|
|
188
|
+
}
|
|
189
|
+
function y(e, t) {
|
|
190
|
+
let n = c.get(e);
|
|
191
|
+
n ? c.set(t, {
|
|
192
|
+
...n,
|
|
193
|
+
columns: n.columns && new Map(n.columns)
|
|
194
|
+
}) : c.delete(t);
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region packages/xlsx/src/internal/grid-geometry.ts
|
|
198
|
+
var b = 1048576, x = 16384, S = class e {
|
|
199
|
+
static cache = /* @__PURE__ */ new WeakMap();
|
|
200
|
+
static forWorksheet(t, n) {
|
|
201
|
+
let r = this.cache.get(t);
|
|
202
|
+
if (r && Object.is(r.mdw, n)) return r.geometry;
|
|
203
|
+
let i = new e(t, n);
|
|
204
|
+
return this.cache.set(t, {
|
|
205
|
+
mdw: n,
|
|
206
|
+
geometry: i
|
|
207
|
+
}), i;
|
|
208
|
+
}
|
|
209
|
+
static forWorksheetMeasured(e, t) {
|
|
210
|
+
let n = this.cache.get(e);
|
|
211
|
+
return n ? n.geometry : this.forWorksheet(e, t());
|
|
212
|
+
}
|
|
213
|
+
static invalidate(e) {
|
|
214
|
+
this.cache.delete(e);
|
|
215
|
+
}
|
|
216
|
+
col;
|
|
217
|
+
row;
|
|
218
|
+
maximumDigitWidth;
|
|
219
|
+
freezeRows;
|
|
220
|
+
freezeCols;
|
|
221
|
+
scaledCache = null;
|
|
222
|
+
constructor(e, i) {
|
|
223
|
+
this.maximumDigitWidth = i, this.freezeRows = Math.min(b, Math.max(0, e.freezeRows ?? 0)), this.freezeCols = Math.min(x, Math.max(0, e.freezeCols ?? 0));
|
|
224
|
+
let o = e.baseColWidth === void 0 ? e.defaultColWidthIsUi === !0 ? n(e.defaultColWidth, i) : t(e.defaultColWidth, i) : r(e.baseColWidth, i), c = new Float64Array(16385);
|
|
225
|
+
c.fill(NaN);
|
|
226
|
+
let l = new Int32Array(16386);
|
|
227
|
+
for (let e = 1; e < l.length; e++) l[e] = e;
|
|
228
|
+
let u = (e) => {
|
|
229
|
+
let t = e;
|
|
230
|
+
for (; l[t] !== t;) t = l[t];
|
|
231
|
+
let n = e;
|
|
232
|
+
for (; l[n] !== n;) {
|
|
233
|
+
let e = l[n];
|
|
234
|
+
l[n] = t, n = e;
|
|
235
|
+
}
|
|
236
|
+
return t;
|
|
237
|
+
}, f = e.colWidthRanges ?? [];
|
|
238
|
+
for (let e = f.length - 1; e >= 0; e--) {
|
|
239
|
+
let t = f[e], n = Math.max(1, Math.min(x, Math.trunc(t.min))), r = Math.max(1, Math.min(x, Math.trunc(t.max)));
|
|
240
|
+
if (r < n || !Number.isFinite(t.width) || t.width < 0) continue;
|
|
241
|
+
let i = u(n);
|
|
242
|
+
for (; i <= r;) c[i] = t.width, l[i] = u(i + 1), i = l[i];
|
|
243
|
+
}
|
|
244
|
+
for (let [t, n] of Object.entries(e.colWidths)) {
|
|
245
|
+
let e = Number(t);
|
|
246
|
+
Number.isInteger(e) && e >= 1 && e <= 16384 && (c[e] = n);
|
|
247
|
+
}
|
|
248
|
+
let p = d(e), g = [];
|
|
249
|
+
for (let e = 1; e <= x; e++) {
|
|
250
|
+
let n = p?.get(e), r = c[e];
|
|
251
|
+
if (n === void 0 && (!Number.isFinite(r) || r < 0)) continue;
|
|
252
|
+
let a = n ?? t(r, i);
|
|
253
|
+
a !== o && g.push({
|
|
254
|
+
index: e,
|
|
255
|
+
px: a
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
this.col = new s({}, o, (e) => t(e, i), x, g);
|
|
259
|
+
let _ = m(e), v = _.length ? Object.fromEntries(Object.entries(e.rowHeights).filter(([e, t]) => t === 0 || !h(_, Number(e)))) : e.rowHeights;
|
|
260
|
+
this.row = new s(v, a(e.defaultRowHeight), a, b, void 0, _.map((e) => ({
|
|
261
|
+
first: e.first,
|
|
262
|
+
last: e.last,
|
|
263
|
+
px: a(e.height)
|
|
264
|
+
})));
|
|
265
|
+
}
|
|
266
|
+
logicalFrozenExtent() {
|
|
267
|
+
return {
|
|
268
|
+
width: this.col.offsetOf(this.freezeCols + 1),
|
|
269
|
+
height: this.row.offsetOf(this.freezeRows + 1)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
roundedFrozenExtent(e) {
|
|
273
|
+
let t = this.axesAtScale(e);
|
|
274
|
+
return {
|
|
275
|
+
width: t.col.offsetOf(this.freezeCols + 1),
|
|
276
|
+
height: t.row.offsetOf(this.freezeRows + 1)
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
effectiveFrozenBands(e) {
|
|
280
|
+
let t = this.axesAtScale(e.scale), n = t.row.bandsToCover(1, Math.max(0, e.rows), Math.max(0, e.height - Math.round(e.headerHeight * e.scale))), r = t.col.bandsToCover(1, Math.max(0, e.cols), Math.max(0, e.width - Math.round(e.headerWidth * e.scale)));
|
|
281
|
+
return {
|
|
282
|
+
rows: n.at(-1)?.index ?? 0,
|
|
283
|
+
cols: r.at(-1)?.index ?? 0
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
logicalContentExtent(e, t, n, r) {
|
|
287
|
+
return {
|
|
288
|
+
width: n + this.col.offsetOf(Math.min(x, t) + 1),
|
|
289
|
+
height: r + this.row.offsetOf(Math.min(b, e) + 1)
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
roundedContentExtent(e, t, n, r, i) {
|
|
293
|
+
let a = this.axesAtScale(n);
|
|
294
|
+
return {
|
|
295
|
+
width: Math.round(r * n) + a.col.offsetOf(Math.min(x, t) + 1),
|
|
296
|
+
height: Math.round(i * n) + a.row.offsetOf(Math.min(b, e) + 1)
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
cellAt(e, t, n) {
|
|
300
|
+
if (e < 0 || t < 0) return null;
|
|
301
|
+
let r = this.rowAt(t, n.scrollY, n.scale);
|
|
302
|
+
if (r === null) return null;
|
|
303
|
+
let i = this.colAt(e, n.scrollX, n.scale);
|
|
304
|
+
return i === null ? null : {
|
|
305
|
+
row: r,
|
|
306
|
+
col: i
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
rowAt(e, t, n = 1) {
|
|
310
|
+
if (e < 0) return null;
|
|
311
|
+
let r = this.axesAtScale(n).row, i = r.offsetOf(this.freezeRows + 1);
|
|
312
|
+
return e < i ? this.indexWithinFrozen(r, e, this.freezeRows) : r.scrollableIndexAt(e - i + t, this.freezeRows + 1);
|
|
313
|
+
}
|
|
314
|
+
colAt(e, t, n = 1) {
|
|
315
|
+
if (e < 0) return null;
|
|
316
|
+
let r = this.axesAtScale(n).col, i = r.offsetOf(this.freezeCols + 1);
|
|
317
|
+
return e < i ? this.indexWithinFrozen(r, e, this.freezeCols) : r.scrollableIndexAt(e - i + t, this.freezeCols + 1);
|
|
318
|
+
}
|
|
319
|
+
cellRect(e, t, n) {
|
|
320
|
+
if (e < 1 || e > 1048576 || t < 1 || t > 16384) return null;
|
|
321
|
+
let r = this.axesAtScale(n.scale), i = Math.round(n.headerWidth * n.scale), a = Math.round(n.headerHeight * n.scale), o = this.roundedFrozenExtent(n.scale);
|
|
322
|
+
return {
|
|
323
|
+
x: t <= this.freezeCols ? i + r.col.offsetOf(t) : this.scrollableCellPosition(r.col, t, this.freezeCols, n.scrollX, i + o.width),
|
|
324
|
+
y: e <= this.freezeRows ? a + r.row.offsetOf(e) : this.scrollableCellPosition(r.row, e, this.freezeRows, n.scrollY, a + o.height),
|
|
325
|
+
w: r.col.sizeOf(t),
|
|
326
|
+
h: r.row.sizeOf(e)
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
visibleRange(e) {
|
|
330
|
+
let t = this.axesAtScale(e.scale), n = this.roundedFrozenExtent(e.scale), r = t.col.indexAt(e.scrollX + t.col.offsetOf(this.freezeCols + 1)), i = t.row.indexAt(e.scrollY + t.row.offsetOf(this.freezeRows + 1)), a = e.width - Math.round(e.headerWidth * e.scale) - n.width, o = e.height - Math.round(e.headerHeight * e.scale) - n.height, s = e.buffer ?? 0;
|
|
331
|
+
return {
|
|
332
|
+
range: {
|
|
333
|
+
row: i.index,
|
|
334
|
+
col: r.index,
|
|
335
|
+
rows: t.row.countToCover(i.index, o + i.partial * 2) + s,
|
|
336
|
+
cols: t.col.countToCover(r.index, a + r.partial * 2) + s
|
|
337
|
+
},
|
|
338
|
+
offsetX: r.partial / e.scale,
|
|
339
|
+
offsetY: i.partial / e.scale,
|
|
340
|
+
frozenWidth: n.width / e.scale,
|
|
341
|
+
frozenHeight: n.height / e.scale
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
scrollOffsetForCell(e, t, n) {
|
|
345
|
+
let r = this.roundedFrozenExtent(n.scale), i = Math.round(n.headerHeight * n.scale) + r.height, a = Math.round(n.headerWidth * n.scale) + r.width, o = n.currentY, s = this.axesAtScale(n.scale);
|
|
346
|
+
if (e > this.freezeRows && e <= 1048576) {
|
|
347
|
+
let t = s.row.offsetOf(e) - s.row.offsetOf(this.freezeRows + 1), r = s.row.sizeOf(e);
|
|
348
|
+
o = this.alignedOffset(t, r, n.currentY, i, n.viewportHeight, n.align);
|
|
349
|
+
}
|
|
350
|
+
let c = n.currentX;
|
|
351
|
+
if (t > this.freezeCols && t <= 16384) {
|
|
352
|
+
let e = s.col.offsetOf(t) - s.col.offsetOf(this.freezeCols + 1), r = s.col.sizeOf(t);
|
|
353
|
+
c = this.alignedOffset(e, r, n.currentX, a, n.viewportWidth, n.align);
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
x: Math.max(0, c),
|
|
357
|
+
y: Math.max(0, o)
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
axesAtScale(e) {
|
|
361
|
+
if (this.scaledCache?.scale === e) return this.scaledCache;
|
|
362
|
+
let t = {
|
|
363
|
+
scale: e,
|
|
364
|
+
row: this.row.scaled(e),
|
|
365
|
+
col: this.col.scaled(e)
|
|
366
|
+
};
|
|
367
|
+
return this.scaledCache = t, t;
|
|
368
|
+
}
|
|
369
|
+
indexWithinFrozen(e, t, n) {
|
|
370
|
+
if (n === 0) return null;
|
|
371
|
+
let r = e.indexAt(t).index;
|
|
372
|
+
return r <= n ? r : null;
|
|
373
|
+
}
|
|
374
|
+
scrollableCellPosition(e, t, n, r, i) {
|
|
375
|
+
let a = e.indexAt(r + e.offsetOf(n + 1));
|
|
376
|
+
return i - a.partial + e.offsetOf(t) - e.offsetOf(a.index);
|
|
377
|
+
}
|
|
378
|
+
alignedOffset(e, t, n, r, i, a) {
|
|
379
|
+
let o = r + e - n;
|
|
380
|
+
return a === "start" ? e : a === "center" ? e - (i - r - t) / 2 : a === "end" ? e - (i - r - t) : o < r ? e : o + t > i ? e - (i - r - t) : n;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
//#endregion
|
|
384
|
+
export { f as a, m as c, _ as d, i as f, g as i, p as l, a as m, x as n, y as o, o as p, b as r, h as s, S as t, v as u };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var e = "xlsx-host-layout-result", t = 4096, n = 255, r = 65535 / 20, i = 4096;
|
|
2
|
+
function a(e) {
|
|
3
|
+
if (!(e instanceof Uint8Array) || e.byteLength > t) throw RangeError("XLSX host layout request byte budget exceeded");
|
|
4
|
+
let n;
|
|
5
|
+
try {
|
|
6
|
+
n = JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e));
|
|
7
|
+
} catch {
|
|
8
|
+
throw TypeError("invalid XLSX host layout request");
|
|
9
|
+
}
|
|
10
|
+
return n === null ? null : o(n);
|
|
11
|
+
}
|
|
12
|
+
function o(e) {
|
|
13
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("invalid XLSX host layout font");
|
|
14
|
+
let t = Object.keys(e), i = [
|
|
15
|
+
"family",
|
|
16
|
+
"sizePt",
|
|
17
|
+
"bold",
|
|
18
|
+
"italic"
|
|
19
|
+
];
|
|
20
|
+
if (t.length !== i.length || !i.every((t) => Object.hasOwn(e, t))) throw TypeError("invalid XLSX host layout font");
|
|
21
|
+
let { family: a, sizePt: o, bold: s, italic: c } = e;
|
|
22
|
+
if (typeof a != "string" || a.length === 0 || a.length > n || typeof o != "number" || !Number.isFinite(o) || o <= 0 || o > r || typeof s != "boolean" || typeof c != "boolean") throw TypeError("invalid XLSX host layout font");
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
family: a,
|
|
25
|
+
sizePt: o,
|
|
26
|
+
bold: s,
|
|
27
|
+
italic: c
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function s(e) {
|
|
31
|
+
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= i ? e : void 0;
|
|
32
|
+
}
|
|
33
|
+
async function c(e, t) {
|
|
34
|
+
if (typeof e.host_layout_request != "function") return;
|
|
35
|
+
if (typeof e.configure_host_layout != "function") throw TypeError("XLSX model source archive must implement configure_host_layout()");
|
|
36
|
+
let n = a(e.host_layout_request()), r = n ? s(await t(n)) : void 0;
|
|
37
|
+
return e.configure_host_layout(r), r;
|
|
38
|
+
}
|
|
39
|
+
function l(t, n, r) {
|
|
40
|
+
if (typeof n != "object" || !n || n.type !== "xlsx-host-layout-request") return !1;
|
|
41
|
+
let i = n.requestId;
|
|
42
|
+
if (typeof i != "number") return !0;
|
|
43
|
+
let a;
|
|
44
|
+
try {
|
|
45
|
+
a = s(r(o(n.font)));
|
|
46
|
+
} catch {
|
|
47
|
+
a = void 0;
|
|
48
|
+
}
|
|
49
|
+
return t({
|
|
50
|
+
type: e,
|
|
51
|
+
requestId: i,
|
|
52
|
+
...a === void 0 ? {} : { maximumDigitWidth: a }
|
|
53
|
+
}), !0;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { l as n, c as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as e } from "./renderer-CkGLj0CC.js";
|
|
2
|
+
//#region packages/xlsx/src/internal/host-layout-measure.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
return e(t.family, t.sizePt, void 0, !1, t.bold ? 700 : 400, t.italic ? "italic" : "normal", n);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as measureHostLayoutFont };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region packages/core/src/internal/in-process-pull-transport.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
dispatch;
|
|
4
|
+
terminateHost;
|
|
5
|
+
nextRequestId = 1;
|
|
6
|
+
terminated = !1;
|
|
7
|
+
constructor(e, t) {
|
|
8
|
+
this.dispatch = e, this.terminateHost = t;
|
|
9
|
+
}
|
|
10
|
+
async request(e, t, n) {
|
|
11
|
+
if (this.terminated) throw Error("pull transport terminated");
|
|
12
|
+
if (n?.signal?.aborted) {
|
|
13
|
+
n.onCancel?.(this.nextRequestId, "abort");
|
|
14
|
+
let e = /* @__PURE__ */ Error("worker request aborted");
|
|
15
|
+
throw e.name = "AbortError", e;
|
|
16
|
+
}
|
|
17
|
+
let r = e(this.nextRequestId++), i;
|
|
18
|
+
if (await this.dispatch(r, (e) => {
|
|
19
|
+
i = e;
|
|
20
|
+
}), i === void 0) throw Error("in-process pull host did not respond");
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
forgetOrphaned(e) {}
|
|
24
|
+
terminate() {
|
|
25
|
+
this.terminated || (this.terminated = !0, this.terminateHost());
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { e as t };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./docx-
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
export { e as docx,
|
|
1
|
+
import { t as e } from "./docx-DhDnKEI6.js";
|
|
2
|
+
import { t } from "./pptx-CDP9dZHe.js";
|
|
3
|
+
import { t as n } from "./xlsx-CpSDPAEU.js";
|
|
4
|
+
export { e as docx, t as pptx, n as xlsx };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as e } from "./model-source-kz_NkZqT.js";
|
|
2
|
+
//#region src/companion-version.ts
|
|
3
|
+
var t = "0.89.0", n = class extends Error {
|
|
4
|
+
constructor(n, r) {
|
|
5
|
+
super(`Companion requires @silurus/ooxml ${n} (${r}); installed runtime is ${t} (${e})`), this.code = "companion-runtime-mismatch", this.name = "CompanionRuntimeMismatchError";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
function r(e, t) {
|
|
9
|
+
if (e !== "0.89.0" || t !== "ooxml-model-source-module/v2") throw new n(e, t);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as CompanionRuntimeMismatchError, e as MODEL_SOURCE_MODULE_PROTOCOL, r as assertCompanionRuntime };
|