@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.
- package/README.md +42 -2
- package/dist/assets/render-worker-CeK_iqK3.js +10 -0
- package/dist/assets/render-worker-DusrDhPk.js +11 -0
- package/dist/assets/render-worker-n2ZG0lrQ.js +31 -0
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +119 -0
- package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-Cpk0YFvM.js} +301 -155
- package/dist/chart-ex.mjs +1 -1
- package/dist/cjk-fallback-bLI3z70h.js +46 -0
- package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-BfE7MJZn.js} +4 -4
- package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
- package/dist/{comment-ui-runtime-DEtgcmj7.js → comment-ui-runtime-DcJOYlw-.js} +5 -5
- package/dist/{comments-CAn2A_Xh.js → comments-Diid5ujN.js} +1 -1
- package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-yKxI8aDH.js} +4326 -4238
- package/dist/{docx-DzDiGvqe.js → docx-BkSRiy07.js} +541 -349
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CBUQJsIM.js} +63 -57
- package/dist/{hyperlink-enyPbflR.js → hyperlink-ArrU3ArU.js} +1014 -951
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-Dtudnqhs.js +1023 -0
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +380 -376
- package/dist/{pptx-D_U62nl-.js → pptx-62MmVbYB.js} +462 -447
- package/dist/pptx.mjs +7 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +1 -1
- package/dist/{render-DSn0d35X.js → render-8Zo7dnds.js} +31 -29
- package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-BfbnEChF.js} +1 -1
- package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-DNL9dWRh.js} +1 -1
- package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-IkHrYOci.js} +1 -1
- package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CJsgolre.js} +9 -9
- package/dist/{session-C1GYhr6n.js → session-CrU8f8DI.js} +91 -91
- package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-B9KA8bU6.js} +1069 -966
- package/dist/three-d.mjs +1 -1
- package/dist/tiff.mjs +1 -1
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +15 -12
- package/dist/types/index.d.ts +23 -18
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +12 -6
- package/dist/types/pptx.d.ts +15 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +15 -11
- package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-eIcQ-xlD.js} +65 -65
- package/dist/{xlsx-CMHmYTHP.js → xlsx-CRcSzZNq.js} +1656 -1630
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-BCGnuBLj.js +0 -10
- package/dist/assets/render-worker-CB4DxjXg.js +0 -31
- package/dist/assets/render-worker-CHW0F0n6.js +0 -11
- package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
- package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
- package/dist/line-distribute-BFB575d6.js +0 -1023
- /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-C8Y2uoVr.js} +0 -0
- /package/dist/{delimited-text-worker-host-DcHj_JZt.js → delimited-text-worker-host-BVY-Ecni.js} +0 -0
- /package/dist/{highlight-rect-FuUSmL3a.js → highlight-rect-C5hkRqUr.js} +0 -0
- /package/dist/{line-metrics-CBbw80Ko.js → line-metrics-B60C86uh.js} +0 -0
- /package/dist/{mathjax-DS69BmJd.js → mathjax-DoyWZbSp.js} +0 -0
- /package/dist/{read-only-comment-decoration-BTnWEeo5.js → read-only-comment-decoration-Dz7eTQ4d.js} +0 -0
- /package/dist/{read-only-comment-margin-plStyGfE.js → read-only-comment-margin-DkgzASAl.js} +0 -0
- /package/dist/{renderer-module-contract-Cu-GKuPd.js → renderer-module-contract-D91rkYHH.js} +0 -0
- /package/dist/{source-key-Ktb1GRE5.js → source-key-DIJG8BA0.js} +0 -0
- /package/dist/{transfer-mIj7E7NB.js → transfer-p6iCC2R7.js} +0 -0
- /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.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 };
|