@silurus/ooxml 0.85.3 → 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/README.md +39 -7
- package/dist/assets/render-worker-D21h5TGR.js +10 -0
- package/dist/assets/render-worker-Dsfekaht.js +11 -0
- package/dist/assets/render-worker-DxU7IrKo.js +31 -0
- package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
- package/dist/{canvas-viewer-mechanics-CDNMJ-Yz.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
- package/dist/{comment-ui-runtime-DAKBCpsM.js → comment-ui-runtime-DEtgcmj7.js} +5 -5
- package/dist/comment-ui-runtime-TLHustXJ.js +2 -0
- package/dist/{comment-ui-runtime-CAbpuWi_.js → comment-ui-runtime-lXwVOgjW.js} +4 -4
- package/dist/{comments-Brfxa3hQ.js → comments-CAn2A_Xh.js} +1 -1
- package/dist/delimited-text-worker-host-DcHj_JZt.js +27 -0
- package/dist/{document-pull-client-F3ox_VXK.js → document-pull-client-uopDjRde.js} +4477 -4431
- package/dist/{docx-BYvm3TWw.js → docx-wPzeF76A.js} +519 -334
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CDGegIB5.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
- package/dist/{line-metrics-BGtFM-ec.js → hyperlink-BR1NCO7S.js} +954 -935
- package/dist/index.mjs +4 -4
- package/dist/{line-distribute-BsV4MVZ2.js → line-distribute-IsUGfHXm.js} +10 -10
- package/dist/line-metrics-CBbw80Ko.js +60 -0
- package/dist/node.mjs +266 -266
- package/dist/{pptx-BqpVTP8p.js → pptx-BxJ_RBSY.js} +173 -165
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DeZpRCfx.js → render-DEiun_AH.js} +1 -1
- package/dist/{render-worker-host-BKtXmlEF.js → render-worker-host-BEfLZvSL.js} +1 -1
- package/dist/{render-worker-host-CNKQ76tu.js → render-worker-host-Ba6Fchqr.js} +1 -1
- package/dist/{render-worker-host-CBcQXsR5.js → render-worker-host-C3xwtHnv.js} +1 -1
- package/dist/{resource-measurement-D41R-0Bl.js → resource-measurement-CclArDRs.js} +10 -10
- package/dist/{session-n2p5_jxV.js → session-BuJL_xcp.js} +87 -87
- package/dist/{slide-pull-client-Dwek7xW8.js → slide-pull-client-Ck8wfRT_.js} +1239 -1165
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +10 -11
- package/dist/types/index.d.ts +38 -19
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +6 -5
- package/dist/types/pptx.d.ts +10 -10
- 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 +34 -14
- package/dist/{worksheet-pull-client-C9sC36Vu.js → worksheet-pull-client-CAvuf22q.js} +72 -69
- package/dist/{xlsx-DSU6pV1O.js → xlsx-Bblm5r1h.js} +1752 -1592
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-D1O73gYW.js +0 -10
- package/dist/assets/render-worker-DHP0rgcW.js +0 -24
- package/dist/assets/render-worker-V2wWYA4O.js +0 -11
- package/dist/bounded-raw-part-cache-C6ro6Ezf.js +0 -254
- package/dist/comment-ui-runtime-DTaaZdXC.js +0 -2
- /package/dist/{comment-occurrence-tj54AXXB.js → comment-occurrence-CqejEuts.js} +0 -0
- /package/dist/{highlight-rect-DBcYVJDv.js → highlight-rect-FuUSmL3a.js} +0 -0
- /package/dist/{read-only-comment-decoration-Mv_SAiHy.js → read-only-comment-decoration-BTnWEeo5.js} +0 -0
- /package/dist/{read-only-comment-margin-Cqu-Ir0C.js → read-only-comment-margin-plStyGfE.js} +0 -0
- /package/dist/{source-key-BkBB3X82.js → source-key-Ktb1GRE5.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 };
|