@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.
Files changed (36) hide show
  1. package/dist/assets/render-worker-D21h5TGR.js +10 -0
  2. package/dist/assets/render-worker-Dsfekaht.js +11 -0
  3. package/dist/assets/{render-worker-CB4DxjXg.js → render-worker-DxU7IrKo.js} +18 -18
  4. package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
  5. package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
  6. package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-lXwVOgjW.js} +1 -1
  7. package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-uopDjRde.js} +4501 -4456
  8. package/dist/{docx-DzDiGvqe.js → docx-wPzeF76A.js} +492 -307
  9. package/dist/docx.mjs +6 -6
  10. package/dist/docx_parser_bg.wasm +0 -0
  11. package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
  12. package/dist/{hyperlink-enyPbflR.js → hyperlink-BR1NCO7S.js} +934 -885
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-IsUGfHXm.js +1023 -0
  15. package/dist/node.mjs +272 -272
  16. package/dist/{pptx-D_U62nl-.js → pptx-BxJ_RBSY.js} +169 -161
  17. package/dist/pptx.mjs +5 -5
  18. package/dist/pptx_parser_bg.wasm +0 -0
  19. package/dist/{render-DSn0d35X.js → render-DEiun_AH.js} +1 -1
  20. package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-BEfLZvSL.js} +1 -1
  21. package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-Ba6Fchqr.js} +1 -1
  22. package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-C3xwtHnv.js} +1 -1
  23. package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CclArDRs.js} +9 -9
  24. package/dist/{session-C1GYhr6n.js → session-BuJL_xcp.js} +87 -87
  25. package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-Ck8wfRT_.js} +977 -903
  26. package/dist/types/docx.d.ts +1 -2
  27. package/dist/types/index.d.ts +1 -2
  28. package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-CAvuf22q.js} +78 -78
  29. package/dist/{xlsx-CMHmYTHP.js → xlsx-Bblm5r1h.js} +574 -574
  30. package/dist/xlsx.mjs +5 -5
  31. package/package.json +1 -1
  32. package/dist/assets/render-worker-BCGnuBLj.js +0 -10
  33. package/dist/assets/render-worker-CHW0F0n6.js +0 -11
  34. package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
  35. package/dist/line-distribute-BFB575d6.js +0 -1023
  36. /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-CqejEuts.js} +0 -0
@@ -2013,7 +2013,7 @@ interface RenderPageOptions {
2013
2013
  showTrackedChanges?: boolean;
2014
2014
  }
2015
2015
  //#endregion
2016
- //#region dist/.types-work/docx-Do8lNaT5.d.ts
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>;
@@ -2220,7 +2220,7 @@ interface RenderPageOptions {
2220
2220
  showTrackedChanges?: boolean;
2221
2221
  }
2222
2222
  //#endregion
2223
- //#region dist/.types-work/docx-Do8lNaT5.d.ts
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, M as t, N as n, P as r, Qt as i, V as a, W as o, an as s, en as c, in as l, j as u, nn as d, rn as f, sn as p, tn as m } from "./hyperlink-enyPbflR.js";
2
- import { n as h, r as g, t as _ } from "./resource-measurement-Do07ZRcR.js";
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 = s, b = d, x = f, S = l, C = m, w = i, T = e, E = c, D = Object.freeze({
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 p(`OOXML resource limit exceeded${t ? ` for ${t}` : ""}: ${r} ${a} > ${i}`, {
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 r();
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, r) {
165
+ async open(e, t, n) {
166
166
  if (this.resourceFailure) throw this.resourceFailure;
167
- let i = this.pendingOpens.get(r.sessionId);
168
- if (!i || i.identity.operationId !== r.operationId || i.identity.generation !== r.generation) throw Error("worksheet pull session open reservation is stale or missing");
169
- let a, o = new Promise((e) => {
170
- a = e;
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 (i.canceled) throw Error("worksheet pull session open was canceled");
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 o = [], s = {
174
+ let a = [], s = {
175
175
  rows: 0,
176
176
  cells: 0,
177
177
  ownedUtf8Bytes: 0
178
- }, c, l = !1, u = new n({
179
- ...r,
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()), o.push(...n.rows), s = e;
191
- } else c = n.worksheet;
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 p && (this.resourceFailure ??= e), e;
193
+ throw e instanceof c && (this.resourceFailure ??= e), e;
194
194
  }
195
195
  }
196
- l = t;
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 (!l) return;
208
- let t, n;
207
+ if (!u) return;
208
+ let t, r;
209
209
  try {
210
210
  if (this.acceptWorksheet) {
211
- if (!c) throw Error("worksheet terminal payload is missing");
212
- c.rows = c.parseError ? [] : o;
213
- let r = c.parseError ? {
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(c, r), a = this.readResourceUsage();
218
- P(i, "get-worksheet-worker", void 0, a), F(i.jsonBytes, "get-worksheet-worker", void 0, a);
219
- let l = this.acceptWorksheet(e, c, i, a);
220
- typeof l == "function" ? t = l : l && ({rollback: t, commit: n} = l);
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()), n?.();
222
+ this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), r?.();
223
223
  } catch (e) {
224
- throw t?.(), e instanceof p && (this.resourceFailure ??= e), e;
224
+ throw t?.(), e instanceof c && (this.resourceFailure ??= e), e;
225
225
  }
226
- l = !1, this.sessions.delete(r.sessionId), a();
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(r.sessionId), a();
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(r.sessionId), a();
239
+ this.sessions.delete(n.sessionId), i();
240
240
  }
241
241
  },
242
242
  resourceUsage: () => this.readResourceUsage()
243
243
  }
244
244
  });
245
- this.sessions.set(r.sessionId, {
246
- host: u,
247
- identity: r
248
- }), this.pendingOpens.delete(r.sessionId);
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(() => o, () => void 0);
250
+ this.operationTail = s.then(() => a, () => void 0);
251
251
  try {
252
252
  await s;
253
253
  } catch (e) {
254
- throw this.pendingOpens.delete(r.sessionId), a(), e;
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, n) {
267
+ dispatch(e, t) {
268
268
  let r = this.sessions.get(e.sessionId);
269
- if (r) return r.host.dispatch(e, n);
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 r = i.identity.operationId === e.operationId && i.identity.generation === e.generation;
273
- return r && (i.canceled = !0), n(r ? {
274
- protocol: t,
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: t,
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" ? (n({
296
- protocol: t,
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()) : (n({
304
- protocol: t,
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: o(/* @__PURE__ */ Error("worksheet pull session is not open"))
310
+ error: n(/* @__PURE__ */ Error("worksheet pull session is not open"))
311
311
  }), Promise.resolve());
312
312
  }
313
- async dispatchSafely(e, n) {
313
+ async dispatchSafely(e, t) {
314
314
  try {
315
- await this.dispatch(e, n);
315
+ await this.dispatch(e, t);
316
316
  } catch (r) {
317
317
  try {
318
- n({
319
- protocol: t,
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: o(r)
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 p && (this.resourceFailure ??= e), e;
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: n, identity: r } of [...this.sessions.values()]) await n.dispatch({
343
- protocol: t,
342
+ for (let { host: t, identity: n } of [...this.sessions.values()]) await t.dispatch({
343
+ protocol: a,
344
344
  kind: "close",
345
- ...r,
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 n = this.sessions.get(e.sessionId);
357
- if (n) {
358
- await n.host.dispatch({
359
- protocol: t,
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 r = this.pendingOpens.get(e.sessionId);
367
- r && r.identity.operationId === e.operationId && r.identity.generation === e.generation && (r.canceled = !0);
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 a(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
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++, i = {
387
+ let r = this.nextSessionId++, a = {
388
388
  sessionId: r,
389
389
  operationId: r,
390
390
  generation: this.options.generation ?? 1
391
- }, a = new u(this.options.transport, {
392
- ...i,
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(a);
398
- let o = !1, s;
397
+ this.active.add(o);
398
+ let s = !1, c;
399
399
  try {
400
- for (await this.options.open(e, t, i, this.options.timeoutMs);;) {
400
+ for (await this.options.open(e, t, a, this.options.timeoutMs);;) {
401
401
  G(n);
402
- let e = await a.pull(B, { signal: n });
402
+ let e = await o.pull(B, { signal: n });
403
403
  try {
404
- let t = e.usage ?? a.usageCheckpoint;
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
- o = !0;
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 s = e, e;
428
+ throw c = e, e;
429
429
  } finally {
430
430
  let e;
431
431
  try {
432
- o || await a.cancel(W(s));
432
+ s || await o.cancel(W(c));
433
433
  } catch (t) {
434
434
  e = t;
435
435
  } finally {
436
- this.active.delete(a);
436
+ this.active.delete(o);
437
437
  }
438
- if (s === void 0 && e !== void 0) throw e;
438
+ if (c === void 0 && e !== void 0) throw e;
439
439
  }
440
440
  }
441
441
  async cancelAll(e = "closed") {