@silurus/ooxml 0.86.0 → 0.86.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/dist/assets/render-worker-D21h5TGR.js +10 -0
- package/dist/assets/render-worker-Dsfekaht.js +11 -0
- package/dist/assets/{render-worker-CB4DxjXg.js → render-worker-DxU7IrKo.js} +18 -18
- package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
- package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
- package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-lXwVOgjW.js} +1 -1
- package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-uopDjRde.js} +4501 -4456
- package/dist/{docx-DzDiGvqe.js → docx-wPzeF76A.js} +492 -307
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
- package/dist/{hyperlink-enyPbflR.js → hyperlink-BR1NCO7S.js} +934 -885
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-IsUGfHXm.js +1023 -0
- package/dist/node.mjs +272 -272
- package/dist/{pptx-D_U62nl-.js → pptx-BxJ_RBSY.js} +169 -161
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DSn0d35X.js → render-DEiun_AH.js} +1 -1
- package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-BEfLZvSL.js} +1 -1
- package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-Ba6Fchqr.js} +1 -1
- package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-C3xwtHnv.js} +1 -1
- package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CclArDRs.js} +9 -9
- package/dist/{session-C1GYhr6n.js → session-BuJL_xcp.js} +87 -87
- package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-Ck8wfRT_.js} +977 -903
- package/dist/types/docx.d.ts +1 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-CAvuf22q.js} +78 -78
- package/dist/{xlsx-CMHmYTHP.js → xlsx-Bblm5r1h.js} +574 -574
- package/dist/xlsx.mjs +5 -5
- package/package.json +1 -1
- package/dist/assets/render-worker-BCGnuBLj.js +0 -10
- package/dist/assets/render-worker-CHW0F0n6.js +0 -11
- package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
- package/dist/line-distribute-BFB575d6.js +0 -1023
- /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-CqejEuts.js} +0 -0
package/dist/types/docx.d.ts
CHANGED
|
@@ -2013,7 +2013,7 @@ interface RenderPageOptions {
|
|
|
2013
2013
|
showTrackedChanges?: boolean;
|
|
2014
2014
|
}
|
|
2015
2015
|
//#endregion
|
|
2016
|
-
//#region dist/.types-work/docx-
|
|
2016
|
+
//#region dist/.types-work/docx-A9oFlQYX.d.ts
|
|
2017
2017
|
interface CommentAnchorRange {
|
|
2018
2018
|
readonly commentId: string;
|
|
2019
2019
|
readonly source: Readonly<DocxStorySource>;
|
|
@@ -2179,7 +2179,6 @@ declare class DocxDocument {
|
|
|
2179
2179
|
private readonly _rawParts;
|
|
2180
2180
|
private _embeddedFontFaces;
|
|
2181
2181
|
private _googleFontFaces;
|
|
2182
|
-
private _localMetricFontFaces;
|
|
2183
2182
|
private readonly _fetchImage;
|
|
2184
2183
|
private constructor();
|
|
2185
2184
|
static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<DocxDocument>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2220,7 +2220,7 @@ interface RenderPageOptions {
|
|
|
2220
2220
|
showTrackedChanges?: boolean;
|
|
2221
2221
|
}
|
|
2222
2222
|
//#endregion
|
|
2223
|
-
//#region dist/.types-work/docx-
|
|
2223
|
+
//#region dist/.types-work/docx-A9oFlQYX.d.ts
|
|
2224
2224
|
interface CommentAnchorRange {
|
|
2225
2225
|
readonly commentId: string;
|
|
2226
2226
|
readonly source: Readonly<DocxStorySource>;
|
|
@@ -2386,7 +2386,6 @@ declare class DocxDocument {
|
|
|
2386
2386
|
private readonly _rawParts;
|
|
2387
2387
|
private _embeddedFontFaces;
|
|
2388
2388
|
private _googleFontFaces;
|
|
2389
|
-
private _localMetricFontFaces;
|
|
2390
2389
|
private readonly _fetchImage;
|
|
2391
2390
|
private constructor();
|
|
2392
2391
|
static load(source: string | ArrayBuffer, opts?: LoadOptions$2): Promise<DocxDocument>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $t as e,
|
|
2
|
-
import { n as h, r as g, t as _ } from "./resource-measurement-
|
|
1
|
+
import { $t as e, F as t, G as n, H as r, M as i, N as a, P as o, an as s, cn as c, en as l, in as u, nn as d, on as f, rn as p, tn as m } from "./hyperlink-BR1NCO7S.js";
|
|
2
|
+
import { n as h, r as g, t as _ } from "./resource-measurement-CclArDRs.js";
|
|
3
3
|
import { t as v } from "./transfer-mIj7E7NB.js";
|
|
4
4
|
//#region packages/xlsx/src/worksheet-resource-limits.ts
|
|
5
|
-
var y =
|
|
5
|
+
var y = f, b = p, x = u, S = s, C = d, w = e, T = l, E = m, D = Object.freeze({
|
|
6
6
|
archiveEntryCount: 0,
|
|
7
7
|
declaredInflatedBytes: 0,
|
|
8
8
|
distinctInflatedBytes: 0,
|
|
@@ -48,7 +48,7 @@ function M(e, t, n = {}) {
|
|
|
48
48
|
}
|
|
49
49
|
function N(e, t, n, r, i, a, o) {
|
|
50
50
|
let s = n === "worksheet-json" ? "serialization" : "parsing";
|
|
51
|
-
return new
|
|
51
|
+
return new c(`OOXML resource limit exceeded${t ? ` for ${t}` : ""}: ${r} ${a} > ${i}`, {
|
|
52
52
|
stage: s,
|
|
53
53
|
violation: {
|
|
54
54
|
format: "xlsx",
|
|
@@ -142,7 +142,7 @@ function z(e, t, n, r) {
|
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region packages/xlsx/src/worksheet-pull-worker.ts
|
|
144
144
|
var B = 64 * 1024 * 1024, V = class {
|
|
145
|
-
coordinator = new
|
|
145
|
+
coordinator = new t();
|
|
146
146
|
sessions = /* @__PURE__ */ new Map();
|
|
147
147
|
operationTail = Promise.resolve();
|
|
148
148
|
pendingOpens = /* @__PURE__ */ new Map();
|
|
@@ -162,21 +162,21 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
162
162
|
get pendingOpenCount() {
|
|
163
163
|
return this.pendingOpens.size;
|
|
164
164
|
}
|
|
165
|
-
async open(e, t,
|
|
165
|
+
async open(e, t, n) {
|
|
166
166
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
167
|
-
let
|
|
168
|
-
if (!
|
|
169
|
-
let
|
|
170
|
-
|
|
167
|
+
let r = this.pendingOpens.get(n.sessionId);
|
|
168
|
+
if (!r || r.identity.operationId !== n.operationId || r.identity.generation !== n.generation) throw Error("worksheet pull session open reservation is stale or missing");
|
|
169
|
+
let i, a = new Promise((e) => {
|
|
170
|
+
i = e;
|
|
171
171
|
}), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
172
|
-
if (
|
|
172
|
+
if (r.canceled) throw Error("worksheet pull session open was canceled");
|
|
173
173
|
this.executeArchive((n) => n.open_sheet_cursor(e, t));
|
|
174
|
-
let
|
|
174
|
+
let a = [], s = {
|
|
175
175
|
rows: 0,
|
|
176
176
|
cells: 0,
|
|
177
177
|
ownedUtf8Bytes: 0
|
|
178
|
-
},
|
|
179
|
-
...
|
|
178
|
+
}, l, u = !1, d = new o({
|
|
179
|
+
...n,
|
|
180
180
|
maxByteCredit: B,
|
|
181
181
|
coordinator: this.coordinator,
|
|
182
182
|
driver: {
|
|
@@ -187,13 +187,13 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
187
187
|
try {
|
|
188
188
|
if (n.kind === "rows") {
|
|
189
189
|
let e = j(s, O(n.rows));
|
|
190
|
-
P(e, "get-worksheet-worker", void 0, this.readResourceUsage()),
|
|
191
|
-
} else
|
|
190
|
+
P(e, "get-worksheet-worker", void 0, this.readResourceUsage()), a.push(...n.rows), s = e;
|
|
191
|
+
} else l = n.worksheet;
|
|
192
192
|
} catch (e) {
|
|
193
|
-
throw e instanceof
|
|
193
|
+
throw e instanceof c && (this.resourceFailure ??= e), e;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
u = t;
|
|
197
197
|
let n = v(e);
|
|
198
198
|
return {
|
|
199
199
|
payload: n,
|
|
@@ -204,54 +204,54 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
204
204
|
},
|
|
205
205
|
measureChunk: ({ payload: e }) => e.byteLength,
|
|
206
206
|
acknowledge: () => {
|
|
207
|
-
if (!
|
|
208
|
-
let t,
|
|
207
|
+
if (!u) return;
|
|
208
|
+
let t, r;
|
|
209
209
|
try {
|
|
210
210
|
if (this.acceptWorksheet) {
|
|
211
|
-
if (!
|
|
212
|
-
|
|
213
|
-
let
|
|
211
|
+
if (!l) throw Error("worksheet terminal payload is missing");
|
|
212
|
+
l.rows = l.parseError ? [] : a;
|
|
213
|
+
let n = l.parseError ? {
|
|
214
214
|
rows: 0,
|
|
215
215
|
cells: 0,
|
|
216
216
|
ownedUtf8Bytes: 0
|
|
217
|
-
} : s, i = A(
|
|
218
|
-
P(i, "get-worksheet-worker", void 0,
|
|
219
|
-
let
|
|
220
|
-
typeof
|
|
217
|
+
} : s, i = A(l, n), o = this.readResourceUsage();
|
|
218
|
+
P(i, "get-worksheet-worker", void 0, o), F(i.jsonBytes, "get-worksheet-worker", void 0, o);
|
|
219
|
+
let c = this.acceptWorksheet(e, l, i, o);
|
|
220
|
+
typeof c == "function" ? t = c : c && ({rollback: t, commit: r} = c);
|
|
221
221
|
}
|
|
222
|
-
this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()),
|
|
222
|
+
this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), r?.();
|
|
223
223
|
} catch (e) {
|
|
224
|
-
throw t?.(), e instanceof
|
|
224
|
+
throw t?.(), e instanceof c && (this.resourceFailure ??= e), e;
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
u = !1, this.sessions.delete(n.sessionId), i();
|
|
227
227
|
},
|
|
228
228
|
cancel: () => {
|
|
229
229
|
try {
|
|
230
230
|
this.archive() && this.executeArchive((e) => e.cancel_sheet_cursor());
|
|
231
231
|
} finally {
|
|
232
|
-
this.sessions.delete(
|
|
232
|
+
this.sessions.delete(n.sessionId), i();
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
close: () => {
|
|
236
236
|
try {
|
|
237
237
|
this.archive() && this.executeArchive((e) => e.close_sheet_cursor());
|
|
238
238
|
} finally {
|
|
239
|
-
this.sessions.delete(
|
|
239
|
+
this.sessions.delete(n.sessionId), i();
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
resourceUsage: () => this.readResourceUsage()
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
|
-
this.sessions.set(
|
|
246
|
-
host:
|
|
247
|
-
identity:
|
|
248
|
-
}), this.pendingOpens.delete(
|
|
245
|
+
this.sessions.set(n.sessionId, {
|
|
246
|
+
host: d,
|
|
247
|
+
identity: n
|
|
248
|
+
}), this.pendingOpens.delete(n.sessionId);
|
|
249
249
|
}));
|
|
250
|
-
this.operationTail = s.then(() =>
|
|
250
|
+
this.operationTail = s.then(() => a, () => void 0);
|
|
251
251
|
try {
|
|
252
252
|
await s;
|
|
253
253
|
} catch (e) {
|
|
254
|
-
throw this.pendingOpens.delete(
|
|
254
|
+
throw this.pendingOpens.delete(n.sessionId), i(), e;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
async postOpenedSafely(e, t, n) {
|
|
@@ -264,14 +264,14 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
264
264
|
} catch {}
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
dispatch(e,
|
|
267
|
+
dispatch(e, t) {
|
|
268
268
|
let r = this.sessions.get(e.sessionId);
|
|
269
|
-
if (r) return r.host.dispatch(e,
|
|
269
|
+
if (r) return r.host.dispatch(e, t);
|
|
270
270
|
let i = this.pendingOpens.get(e.sessionId);
|
|
271
271
|
if (i && (e.kind === "cancel" || e.kind === "close")) {
|
|
272
|
-
let
|
|
273
|
-
return
|
|
274
|
-
protocol:
|
|
272
|
+
let n = i.identity.operationId === e.operationId && i.identity.generation === e.generation;
|
|
273
|
+
return n && (i.canceled = !0), t(n ? {
|
|
274
|
+
protocol: a,
|
|
275
275
|
kind: "accepted",
|
|
276
276
|
sessionId: e.sessionId,
|
|
277
277
|
operationId: e.operationId,
|
|
@@ -279,7 +279,7 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
279
279
|
requestId: e.requestId,
|
|
280
280
|
command: e.kind
|
|
281
281
|
} : {
|
|
282
|
-
protocol:
|
|
282
|
+
protocol: a,
|
|
283
283
|
kind: "error",
|
|
284
284
|
sessionId: e.sessionId,
|
|
285
285
|
operationId: e.operationId,
|
|
@@ -292,37 +292,37 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
292
292
|
}
|
|
293
293
|
}), Promise.resolve();
|
|
294
294
|
}
|
|
295
|
-
return e.kind === "cancel" || e.kind === "close" ? (
|
|
296
|
-
protocol:
|
|
295
|
+
return e.kind === "cancel" || e.kind === "close" ? (t({
|
|
296
|
+
protocol: a,
|
|
297
297
|
kind: "accepted",
|
|
298
298
|
sessionId: e.sessionId,
|
|
299
299
|
operationId: e.operationId,
|
|
300
300
|
generation: e.generation,
|
|
301
301
|
requestId: e.requestId,
|
|
302
302
|
command: e.kind
|
|
303
|
-
}), Promise.resolve()) : (
|
|
304
|
-
protocol:
|
|
303
|
+
}), Promise.resolve()) : (t({
|
|
304
|
+
protocol: a,
|
|
305
305
|
kind: "error",
|
|
306
306
|
sessionId: e.sessionId,
|
|
307
307
|
operationId: e.operationId,
|
|
308
308
|
generation: e.generation,
|
|
309
309
|
requestId: e.requestId,
|
|
310
|
-
error:
|
|
310
|
+
error: n(/* @__PURE__ */ Error("worksheet pull session is not open"))
|
|
311
311
|
}), Promise.resolve());
|
|
312
312
|
}
|
|
313
|
-
async dispatchSafely(e,
|
|
313
|
+
async dispatchSafely(e, t) {
|
|
314
314
|
try {
|
|
315
|
-
await this.dispatch(e,
|
|
315
|
+
await this.dispatch(e, t);
|
|
316
316
|
} catch (r) {
|
|
317
317
|
try {
|
|
318
|
-
|
|
319
|
-
protocol:
|
|
318
|
+
t({
|
|
319
|
+
protocol: a,
|
|
320
320
|
kind: "error",
|
|
321
321
|
sessionId: e.sessionId,
|
|
322
322
|
operationId: e.operationId,
|
|
323
323
|
generation: e.generation,
|
|
324
324
|
requestId: e.requestId,
|
|
325
|
-
error:
|
|
325
|
+
error: n(r)
|
|
326
326
|
});
|
|
327
327
|
} catch {}
|
|
328
328
|
}
|
|
@@ -332,17 +332,17 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
332
332
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
333
333
|
return e();
|
|
334
334
|
})).catch((e) => {
|
|
335
|
-
throw e instanceof
|
|
335
|
+
throw e instanceof c && (this.resourceFailure ??= e), e;
|
|
336
336
|
});
|
|
337
337
|
return this.operationTail = t.then(() => void 0, () => void 0), t;
|
|
338
338
|
}
|
|
339
339
|
async reset() {
|
|
340
340
|
for (let e of this.pendingOpens.values()) e.canceled = !0;
|
|
341
341
|
let e = 1;
|
|
342
|
-
for (let { host:
|
|
343
|
-
protocol:
|
|
342
|
+
for (let { host: t, identity: n } of [...this.sessions.values()]) await t.dispatch({
|
|
343
|
+
protocol: a,
|
|
344
344
|
kind: "close",
|
|
345
|
-
...
|
|
345
|
+
...n,
|
|
346
346
|
requestId: e++
|
|
347
347
|
}, () => void 0);
|
|
348
348
|
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.resourceFailure = void 0;
|
|
@@ -353,22 +353,22 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
353
353
|
return e;
|
|
354
354
|
}
|
|
355
355
|
async closeIdentity(e) {
|
|
356
|
-
let
|
|
357
|
-
if (
|
|
358
|
-
await
|
|
359
|
-
protocol:
|
|
356
|
+
let t = this.sessions.get(e.sessionId);
|
|
357
|
+
if (t) {
|
|
358
|
+
await t.host.dispatch({
|
|
359
|
+
protocol: a,
|
|
360
360
|
kind: "close",
|
|
361
361
|
...e,
|
|
362
362
|
requestId: 1
|
|
363
363
|
}, () => void 0);
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
let
|
|
367
|
-
|
|
366
|
+
let n = this.pendingOpens.get(e.sessionId);
|
|
367
|
+
n && n.identity.operationId === e.operationId && n.identity.generation === e.generation && (n.canceled = !0);
|
|
368
368
|
}
|
|
369
369
|
readResourceUsage() {
|
|
370
370
|
try {
|
|
371
|
-
return
|
|
371
|
+
return r(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
|
|
372
372
|
} catch (e) {
|
|
373
373
|
if (String(e).includes("worksheet cursor usage is unavailable")) return;
|
|
374
374
|
throw e;
|
|
@@ -384,24 +384,24 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
384
384
|
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("sheetIndex must be a non-negative safe integer");
|
|
385
385
|
if (!t) throw TypeError("sheetName must be non-empty");
|
|
386
386
|
G(n);
|
|
387
|
-
let r = this.nextSessionId++,
|
|
387
|
+
let r = this.nextSessionId++, a = {
|
|
388
388
|
sessionId: r,
|
|
389
389
|
operationId: r,
|
|
390
390
|
generation: this.options.generation ?? 1
|
|
391
|
-
},
|
|
392
|
-
...
|
|
391
|
+
}, o = new i(this.options.transport, {
|
|
392
|
+
...a,
|
|
393
393
|
maxByteCredit: B,
|
|
394
394
|
timeoutMs: this.options.timeoutMs,
|
|
395
395
|
disposeTransferred: this.options.disposeTransferred
|
|
396
396
|
});
|
|
397
|
-
this.active.add(
|
|
398
|
-
let
|
|
397
|
+
this.active.add(o);
|
|
398
|
+
let s = !1, c;
|
|
399
399
|
try {
|
|
400
|
-
for (await this.options.open(e, t,
|
|
400
|
+
for (await this.options.open(e, t, a, this.options.timeoutMs);;) {
|
|
401
401
|
G(n);
|
|
402
|
-
let e = await
|
|
402
|
+
let e = await o.pull(B, { signal: n });
|
|
403
403
|
try {
|
|
404
|
-
let t = e.usage ??
|
|
404
|
+
let t = e.usage ?? o.usageCheckpoint;
|
|
405
405
|
t && this.options.onUsage?.(t);
|
|
406
406
|
let r = z(e.payload, e.done, this.options.sharedStrings);
|
|
407
407
|
if (yield r.kind === "rows" ? {
|
|
@@ -417,7 +417,7 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
417
417
|
wireBytes: e.byteLength,
|
|
418
418
|
usage: t
|
|
419
419
|
}, await e.ack({ signal: n }), r.kind === "finished") {
|
|
420
|
-
|
|
420
|
+
s = !0;
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
423
|
} finally {
|
|
@@ -425,17 +425,17 @@ var B = 64 * 1024 * 1024, V = class {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
} catch (e) {
|
|
428
|
-
throw
|
|
428
|
+
throw c = e, e;
|
|
429
429
|
} finally {
|
|
430
430
|
let e;
|
|
431
431
|
try {
|
|
432
|
-
|
|
432
|
+
s || await o.cancel(W(c));
|
|
433
433
|
} catch (t) {
|
|
434
434
|
e = t;
|
|
435
435
|
} finally {
|
|
436
|
-
this.active.delete(
|
|
436
|
+
this.active.delete(o);
|
|
437
437
|
}
|
|
438
|
-
if (
|
|
438
|
+
if (c === void 0 && e !== void 0) throw e;
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
async cancelAll(e = "closed") {
|