@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
@@ -0,0 +1,119 @@
1
+ //#region packages/core/src/internal/bounded-async-lru-cache.ts
2
+ function e(e, t) {
3
+ if (!Number.isSafeInteger(e) || e <= 0) throw TypeError(`${t} must be a positive safe integer`);
4
+ }
5
+ function t(e) {
6
+ if (!Number.isSafeInteger(e) || e < 0) throw TypeError("cache entry weight must be a non-negative safe integer");
7
+ }
8
+ var n = class {
9
+ #e;
10
+ #t;
11
+ #n;
12
+ #r;
13
+ #i = /* @__PURE__ */ new Map();
14
+ #a = /* @__PURE__ */ new Map();
15
+ #o = 0;
16
+ constructor(t) {
17
+ e(t.maxEntries, "maxEntries"), e(t.maxWeight, "maxWeight"), this.#e = t.maxEntries, this.#t = t.maxWeight, this.#n = t.measure, this.#r = t.onRemove;
18
+ }
19
+ get usage() {
20
+ return {
21
+ entries: this.#i.size,
22
+ weight: this.#o,
23
+ pending: this.#a.size
24
+ };
25
+ }
26
+ has(e) {
27
+ return this.#i.has(e);
28
+ }
29
+ get(e) {
30
+ let t = this.#i.get(e);
31
+ if (t !== void 0) return this.#i.delete(e), this.#i.set(e, t), t.value;
32
+ }
33
+ getOrLoad(e, t) {
34
+ let n = this.get(e);
35
+ if (n !== void 0 || this.#i.has(e)) return Promise.resolve(n);
36
+ let r = this.#a.get(e);
37
+ if (r !== void 0) return r.promise;
38
+ let i = {}, a = Promise.resolve().then(t).then((t) => this.#c(e, i, t), (t) => {
39
+ throw this.#s(e, i), t;
40
+ });
41
+ return this.#a.set(e, {
42
+ token: i,
43
+ promise: a
44
+ }), a;
45
+ }
46
+ delete(e) {
47
+ let t = this.#a.delete(e), n = this.#i.get(e);
48
+ return n === void 0 ? t : (this.#i.delete(e), this.#o -= n.weight, this.#l(n.value, e, "deleted"), !0);
49
+ }
50
+ clear() {
51
+ this.#a.clear();
52
+ let e = [...this.#i];
53
+ this.#i.clear(), this.#o = 0;
54
+ for (let [t, n] of e) this.#l(n.value, t, "cleared");
55
+ }
56
+ #s(e, t) {
57
+ this.#a.get(e)?.token === t && this.#a.delete(e);
58
+ }
59
+ #c(e, n, r) {
60
+ if (this.#a.get(e)?.token !== n) return r;
61
+ let i;
62
+ try {
63
+ i = this.#n(r), t(i);
64
+ } catch (t) {
65
+ throw this.#s(e, n), t;
66
+ }
67
+ if (this.#a.get(e)?.token !== n || (this.#a.delete(e), i > this.#t)) return r;
68
+ let a = [];
69
+ for (; this.#i.size >= this.#e || i > this.#t - this.#o;) {
70
+ let e = this.#i.entries().next().value;
71
+ if (e === void 0) break;
72
+ let [t, n] = e;
73
+ this.#i.delete(t), this.#o -= n.weight, a.push([t, n]);
74
+ }
75
+ this.#i.set(e, {
76
+ value: r,
77
+ weight: i
78
+ }), this.#o += i;
79
+ for (let [e, t] of a) this.#l(t.value, e, "evicted");
80
+ return r;
81
+ }
82
+ #l(e, t, n) {
83
+ try {
84
+ this.#r?.(e, t, n);
85
+ } catch {}
86
+ }
87
+ }, r = class {
88
+ #e;
89
+ constructor(e) {
90
+ this.#e = new n({
91
+ maxEntries: e.maxEntries,
92
+ maxWeight: e.maxBytes,
93
+ measure: (e) => e.size
94
+ });
95
+ }
96
+ get usage() {
97
+ let e = this.#e.usage;
98
+ return {
99
+ entries: e.entries,
100
+ bytes: e.weight,
101
+ pending: e.pending
102
+ };
103
+ }
104
+ async get(e, t, n) {
105
+ if (typeof e != "string" || e.length === 0) throw TypeError("raw package part path must be a non-empty string");
106
+ if (typeof t != "string") throw TypeError("raw package part MIME type must be a string");
107
+ let r = await this.#e.getOrLoad(e, async () => {
108
+ let e = await n();
109
+ if (!(e instanceof Blob)) throw TypeError("raw package part loader must return a Blob");
110
+ return e;
111
+ });
112
+ return t === "" || r.type === t ? r : r.slice(0, r.size, t);
113
+ }
114
+ clear() {
115
+ this.#e.clear();
116
+ }
117
+ };
118
+ //#endregion
119
+ export { n, r as t };