@silurus/ooxml 0.70.2 → 0.71.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 +106 -4
- package/THIRD_PARTY_NOTICES.md +283 -0
- package/dist/docx-B84Lzf0A.js +6396 -0
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{line-metrics-DG9p1RvA.js → find-cursor-DgyGlCIw.js} +3793 -688
- package/dist/{virtual-scroll-CsikPntn.js → highlight-rect-CBqVAarx.js} +117 -79
- package/dist/index.mjs +4 -4
- package/dist/pptx-C2qCkfTT.js +6434 -0
- package/dist/pptx.mjs +3 -3
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-B_mY9aaj.js +27 -0
- package/dist/render-worker-host-CSA5bTZW.js +27 -0
- package/dist/render-worker-host-DL0cvjox.js +27 -0
- package/dist/{segments-BTivjRMw.js → segments-BLmJVJRb.js} +1 -1
- package/dist/types/docx.d.ts +1902 -41
- package/dist/types/index.d.ts +2544 -87
- package/dist/types/pptx.d.ts +1199 -35
- package/dist/types/xlsx.d.ts +1200 -14
- package/dist/visible-index-C4c37k-n.js +17 -0
- package/dist/{xlsx-B1XUgnO7.js → xlsx-1PnsOb7Z.js} +2156 -1213
- package/dist/xlsx.mjs +3 -3
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +5 -2
- package/dist/docx-BKsYFx78.js +0 -3895
- package/dist/pptx-B4xa92BQ.js +0 -3325
- package/dist/render-worker-host-2V2UCnvB.js +0 -27
- package/dist/render-worker-host-BcmXt3yA.js +0 -27
- package/dist/render-worker-host-UUYE6Oqt.js +0 -27
- package/dist/visible-index-B4ljB_dg.js +0 -1266
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as e, L as t, V as n, Z as r, et as i, g as a } from "./find-cursor-DgyGlCIw.js";
|
|
2
2
|
//#region packages/core/src/fonts/symbol-font.ts
|
|
3
|
-
var
|
|
3
|
+
var o = {
|
|
4
4
|
167: "♣",
|
|
5
5
|
168: "♦",
|
|
6
6
|
169: "♥",
|
|
@@ -18,7 +18,7 @@ var i = {
|
|
|
18
18
|
177: "±",
|
|
19
19
|
163: "≤",
|
|
20
20
|
179: "≥"
|
|
21
|
-
},
|
|
21
|
+
}, s = {
|
|
22
22
|
33: "✏",
|
|
23
23
|
34: "✂",
|
|
24
24
|
36: "👓",
|
|
@@ -44,7 +44,7 @@ var i = {
|
|
|
44
44
|
229: "↙",
|
|
45
45
|
230: "↘"
|
|
46
46
|
};
|
|
47
|
-
function
|
|
47
|
+
function c(e) {
|
|
48
48
|
let t = {};
|
|
49
49
|
for (let n of Object.keys(e)) {
|
|
50
50
|
let r = Number(n);
|
|
@@ -52,25 +52,25 @@ function o(e) {
|
|
|
52
52
|
}
|
|
53
53
|
return t;
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
function
|
|
55
|
+
var l = c(o), u = c(s);
|
|
56
|
+
function d(e, t) {
|
|
57
57
|
if (!t) return e;
|
|
58
|
-
let n = t.trim().toLowerCase(), r = n === "wingdings" ?
|
|
58
|
+
let n = t.trim().toLowerCase(), r = n === "wingdings" ? u : n === "symbol" ? l : null;
|
|
59
59
|
return r ? r[e.charCodeAt(0)] ?? e : e;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function f(e) {
|
|
62
62
|
if (!e) return !1;
|
|
63
63
|
let t = e.toLowerCase();
|
|
64
64
|
return t === "symbol" || t.includes("wingdings");
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
if (!
|
|
66
|
+
function p(e, t) {
|
|
67
|
+
if (!f(t) || e.length === 0) return [{
|
|
68
68
|
text: e,
|
|
69
69
|
mapped: !1
|
|
70
70
|
}];
|
|
71
71
|
let n = [], r = "", i = null;
|
|
72
72
|
for (let a of e) {
|
|
73
|
-
let e =
|
|
73
|
+
let e = d(a, t), o = e !== a;
|
|
74
74
|
i === null || o === i ? (i = o, r += e) : (n.push({
|
|
75
75
|
text: r,
|
|
76
76
|
mapped: i
|
|
@@ -83,7 +83,7 @@ function d(e, t) {
|
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region packages/core/src/shape/custGeom.ts
|
|
86
|
-
function
|
|
86
|
+
function m(e, t, n, r, i, a) {
|
|
87
87
|
for (let o of t) {
|
|
88
88
|
let t = 0, s = 0;
|
|
89
89
|
for (let c of o) switch (c.cmd) {
|
|
@@ -111,7 +111,7 @@ function f(e, t, n, r, i, a) {
|
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region packages/core/src/shape/preset.ts
|
|
114
|
-
function
|
|
114
|
+
function h(e, t, n, r, i, a, o, s = -Math.PI / 2) {
|
|
115
115
|
let c = a * 2;
|
|
116
116
|
for (let l = 0; l < c; l++) {
|
|
117
117
|
let c = s + l * Math.PI / a, u = l % 2 == 0 ? 1 : o, d = t + r * u * Math.cos(c), f = n + i * u * Math.sin(c);
|
|
@@ -119,43 +119,43 @@ function p(e, t, n, r, i, a, o, s = -Math.PI / 2) {
|
|
|
119
119
|
}
|
|
120
120
|
e.closePath();
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function g(e, t, n, r, i, a, o = -Math.PI / 2) {
|
|
123
123
|
for (let s = 0; s < a; s++) {
|
|
124
124
|
let c = o + s * 2 * Math.PI / a, l = t + r * Math.cos(c), u = n + i * Math.sin(c);
|
|
125
125
|
s === 0 ? e.moveTo(l, u) : e.lineTo(l, u);
|
|
126
126
|
}
|
|
127
127
|
e.closePath();
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function _(e, t, n, r, i, a, o) {
|
|
130
130
|
let s = (e) => Math.atan2(r * Math.sin(e), i * Math.cos(e)), c = s(a), l = s(a + o), u = t - r * Math.cos(c), d = n - i * Math.sin(c);
|
|
131
131
|
return e.ellipse(u, d, Math.abs(r), Math.abs(i), 0, c, l, o < 0), {
|
|
132
132
|
x: u + r * Math.cos(l),
|
|
133
133
|
y: d + i * Math.sin(l)
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
var
|
|
136
|
+
var v = {
|
|
137
137
|
oval: "ellipse",
|
|
138
138
|
rtriangle: "rttriangle",
|
|
139
139
|
roundrectangle: "roundrect",
|
|
140
140
|
flowchartsumingjunction: "flowchartsummingjunction"
|
|
141
|
-
},
|
|
141
|
+
}, y = new Set(/* @__PURE__ */ "ellipse.rttriangle.triangle.diamond.trapezoid.roundrect.snip1rect.frame.irregularseal1.irregularseal2.star4.star8.star12.star16.star24.star32.line.straightconnector1.callout1.bordercallout1.leftuparrow.quadarrowcallout.mathequal.mathplus.mathminus.flowchartdecision.flowchartmanualinput.flowchartconnector.flowchartinputoutput.flowchartmerge.flowchartextract.flowchartpreparation.flowchartcollate".split(".")), b = new Set([
|
|
142
142
|
"accentcallout1",
|
|
143
143
|
"accentbordercallout1",
|
|
144
144
|
"flowchartpredefinedprocess",
|
|
145
145
|
"flowchartsort",
|
|
146
146
|
"flowchartinternalstorage",
|
|
147
147
|
"flowchartsummingjunction"
|
|
148
|
-
]),
|
|
148
|
+
]), x = new Set([
|
|
149
149
|
"round2samerect",
|
|
150
150
|
"round2diagrect",
|
|
151
151
|
"dodecagon",
|
|
152
152
|
"star10"
|
|
153
153
|
]);
|
|
154
|
-
function
|
|
154
|
+
function S(e, t, r, i, a, o, s = null, c = null, l = null, u = null) {
|
|
155
155
|
let d = r + a / 2, f = i + o / 2;
|
|
156
156
|
{
|
|
157
|
-
let d = t.toLowerCase(), f =
|
|
158
|
-
if ((
|
|
157
|
+
let d = t.toLowerCase(), f = v[d] ?? d;
|
|
158
|
+
if ((y.has(f) || b.has(f) || x.has(f)) && n(e, f, r, i, a, o, [
|
|
159
159
|
s,
|
|
160
160
|
c,
|
|
161
161
|
l,
|
|
@@ -169,29 +169,29 @@ function b(e, t, r, i, a, o, s = null, c = null, l = null, u = null) {
|
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
case "pentagon":
|
|
172
|
-
|
|
172
|
+
g(e, d, f, a / 2, o / 2, 5);
|
|
173
173
|
break;
|
|
174
174
|
case "hexagon":
|
|
175
|
-
|
|
175
|
+
g(e, d, f, a / 2, o / 2, 6, 0);
|
|
176
176
|
break;
|
|
177
177
|
case "heptagon":
|
|
178
|
-
|
|
178
|
+
g(e, d, f, a / 2, o / 2, 7);
|
|
179
179
|
break;
|
|
180
180
|
case "octagon":
|
|
181
|
-
|
|
181
|
+
g(e, d, f, a / 2, o / 2, 8, -Math.PI / 8);
|
|
182
182
|
break;
|
|
183
183
|
case "decagon":
|
|
184
|
-
|
|
184
|
+
g(e, d, f, a / 2, o / 2, 10);
|
|
185
185
|
break;
|
|
186
186
|
case "star5":
|
|
187
187
|
case "star":
|
|
188
|
-
|
|
188
|
+
h(e, d, f, a / 2, o / 2, 5, (s ?? 19098) / 5e4);
|
|
189
189
|
break;
|
|
190
190
|
case "star6":
|
|
191
|
-
|
|
191
|
+
h(e, d, f, a / 2, o / 2, 6, (s ?? 28868) / 5e4, 0);
|
|
192
192
|
break;
|
|
193
193
|
case "star7":
|
|
194
|
-
|
|
194
|
+
h(e, d, f, a / 2, o / 2, 7, (s ?? 34142) / 5e4);
|
|
195
195
|
break;
|
|
196
196
|
case "rightarrow": {
|
|
197
197
|
let t = o * Math.min(1, (s ?? 5e4) / 1e5), n = a * Math.min(1, (c ?? 5e4) / 1e5), l = i + (o - t) / 2;
|
|
@@ -601,27 +601,27 @@ function b(e, t, r, i, a, o, s = null, c = null, l = null, u = null) {
|
|
|
601
601
|
break;
|
|
602
602
|
}
|
|
603
603
|
case "curvedrightarrow": {
|
|
604
|
-
let t = Math.min(a, o), n = o / 2, u = 5e4 * o / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(d, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4,
|
|
605
|
-
e.moveTo(r, i + m),
|
|
604
|
+
let t = Math.min(a, o), n = o / 2, u = 5e4 * o / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(d, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4, h = (2 * m) ** 2 - f ** 2, g = 1e5 * (Math.sqrt(Math.max(0, h)) * a / (2 * m)) / t, v = t * Math.min(g, Math.max(0, l ?? 25e3)) / 1e5, y = Math.sqrt(Math.max(0, a * a - v * v)) * m / a, b = m + f, x = m + y, S = b + y, C = (p - f) / 2, w = x - C, T = S + C, E = o - p / 2, D = a - v, O = Math.atan2(v, y), k = -O, A = Math.PI - O;
|
|
605
|
+
e.moveTo(r, i + m), _(e, r, i + m, a, m, Math.PI, k), e.lineTo(r + D, i + w), e.lineTo(r + a, i + E), e.lineTo(r + D, i + T), e.lineTo(r + D, i + S), _(e, r + D, i + S, a, m, A, O), e.closePath();
|
|
606
606
|
break;
|
|
607
607
|
}
|
|
608
608
|
case "curvedleftarrow": {
|
|
609
|
-
let t = Math.min(a, o), n = o / 2, u = 5e4 * o / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(d, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4,
|
|
609
|
+
let t = Math.min(a, o), n = o / 2, u = 5e4 * o / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(d, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4, h = (2 * m) ** 2 - f ** 2, g = Math.sqrt(Math.max(0, h)) * a / (2 * m), v = 1e5 * g / t, y = t * Math.min(v, Math.max(0, l ?? 25e3)) / 1e5, b = Math.sqrt(Math.max(0, a * a - y * y)) * m / a, x = m + f, S = m + b, C = x + b, w = (p - f) / 2, T = S - w, E = C + w, D = o - p / 2, O = y, k = Math.atan2(y, b), A = f / 2, j = Math.atan2(A, g), M = j - k, N = k - j, P = -j;
|
|
610
610
|
e.moveTo(r, i + D), e.lineTo(r + O, i + T), e.lineTo(r + O, i + S);
|
|
611
|
-
let F =
|
|
612
|
-
|
|
611
|
+
let F = _(e, r + O, i + S, a, m, k, M);
|
|
612
|
+
_(e, F.x, F.y, a, m, P, N), e.lineTo(r + O, i + E), e.closePath();
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
615
|
case "curveduparrow": {
|
|
616
|
-
let t = Math.min(a, o), n = a / 2, u = 5e4 * a / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(1e5, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4,
|
|
616
|
+
let t = Math.min(a, o), n = a / 2, u = 5e4 * a / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(1e5, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4, h = (2 * m) ** 2 - f ** 2, g = Math.sqrt(Math.max(0, h)) * o / (2 * m), v = 1e5 * g / t, y = t * Math.min(v, Math.max(0, l ?? 25e3)) / 1e5, b = Math.sqrt(Math.max(0, o * o - y * y)) * m / o, x = m + f, S = m + b, C = x + b, w = (p - f) / 2, T = S - w, E = C + w, D = a - p / 2, O = y, k = Math.atan2(y, b), A = f / 2, j = Math.atan2(A, g), M = j - k, N = k - j, P = Math.PI / 2 - k, F = Math.PI / 2 - j;
|
|
617
617
|
e.moveTo(r + D, i), e.lineTo(r + E, i + O), e.lineTo(r + C, i + O);
|
|
618
|
-
let I =
|
|
619
|
-
|
|
618
|
+
let I = _(e, r + C, i + O, m, o, P, N);
|
|
619
|
+
_(e, I.x, I.y, m, o, F, M), e.lineTo(r + T, i + O), e.closePath();
|
|
620
620
|
break;
|
|
621
621
|
}
|
|
622
622
|
case "curveddownarrow": {
|
|
623
|
-
let t = Math.min(a, o), n = a / 2, u = 5e4 * a / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(1e5, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4,
|
|
624
|
-
3 * Math.PI / 2 - j, j - Math.PI / 2, Math.PI / 2 - j, e.moveTo(r + D, i + o), e.lineTo(r + T, i + O), e.lineTo(r + S, i + O),
|
|
623
|
+
let t = Math.min(a, o), n = a / 2, u = 5e4 * a / t, d = Math.min(u, Math.max(0, c ?? 5e4)), f = t * Math.min(1e5, Math.max(0, s ?? 25e3)) / 1e5, p = t * d / 1e5, m = n - (f + p) / 4, h = (2 * m) ** 2 - f ** 2, g = Math.sqrt(Math.max(0, h)) * o / (2 * m), v = 1e5 * g / t, y = t * Math.min(v, Math.max(0, l ?? 25e3)) / 1e5, b = Math.sqrt(Math.max(0, o * o - y * y)) * m / o, x = m + f, S = m + b, C = x + b, w = (p - f) / 2, T = S - w, E = C + w, D = a - p / 2, O = o - y, k = Math.atan2(y, b), A = f / 2, j = Math.atan2(A, g), M = 3 * Math.PI / 2 + k;
|
|
624
|
+
3 * Math.PI / 2 - j, j - Math.PI / 2, Math.PI / 2 - j, e.moveTo(r + D, i + o), e.lineTo(r + T, i + O), e.lineTo(r + S, i + O), _(e, r + S, i + O, m, o, M, -k), e.lineTo(r + x, i), _(e, r + x, i, m, o, 3 * Math.PI / 2, k), e.lineTo(r + E, i + O), e.closePath();
|
|
625
625
|
break;
|
|
626
626
|
}
|
|
627
627
|
case "stripedrightarrow": {
|
|
@@ -669,7 +669,7 @@ function b(e, t, r, i, a, o, s = null, c = null, l = null, u = null) {
|
|
|
669
669
|
}
|
|
670
670
|
//#endregion
|
|
671
671
|
//#region packages/core/src/shape/arrow.ts
|
|
672
|
-
function
|
|
672
|
+
function C(e, t, n) {
|
|
673
673
|
let r = Math.max(.5, t.width * n), i = e.w === "sm" ? 4 : e.w === "lg" ? 8 : 6, a = e.len === "sm" ? 4 : e.len === "lg" ? 8 : 6;
|
|
674
674
|
return {
|
|
675
675
|
lw: r,
|
|
@@ -677,16 +677,16 @@ function x(e, t, n) {
|
|
|
677
677
|
len: r * a
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
|
-
var
|
|
680
|
+
var w = new Set([
|
|
681
681
|
"triangle",
|
|
682
682
|
"stealth",
|
|
683
683
|
"diamond",
|
|
684
684
|
"oval"
|
|
685
685
|
]);
|
|
686
|
-
function
|
|
687
|
-
return
|
|
686
|
+
function T(e, t, n) {
|
|
687
|
+
return w.has(e.type) ? C(e, t, n).len : 0;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function E(e, t, n) {
|
|
690
690
|
if (n <= 0) return {
|
|
691
691
|
x: e.x,
|
|
692
692
|
y: e.y
|
|
@@ -702,35 +702,35 @@ function w(e, t, n) {
|
|
|
702
702
|
y: e.y + i * o
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function D(e, t, n, i, a, o, s) {
|
|
706
706
|
if (a.type === "none") return;
|
|
707
|
-
let { lw: c, halfW: l, len: u } =
|
|
708
|
-
switch (
|
|
707
|
+
let { lw: c, halfW: l, len: u } = C(a, o, s), d = r(o.color);
|
|
708
|
+
switch (e.save(), e.translate(t, n), e.rotate(i), e.fillStyle = d, e.strokeStyle = d, e.lineWidth = c, e.setLineDash([]), e.beginPath(), a.type) {
|
|
709
709
|
case "triangle":
|
|
710
710
|
case "stealth":
|
|
711
|
-
|
|
711
|
+
e.moveTo(0, 0), e.lineTo(-u, -l), e.lineTo(-u, l), e.closePath(), e.fill();
|
|
712
712
|
break;
|
|
713
713
|
case "arrow":
|
|
714
|
-
|
|
714
|
+
e.moveTo(0, 0), e.lineTo(-u, -l), e.moveTo(0, 0), e.lineTo(-u, l), e.stroke();
|
|
715
715
|
break;
|
|
716
716
|
case "diamond":
|
|
717
|
-
|
|
717
|
+
e.moveTo(0, 0), e.lineTo(-u / 2, -l), e.lineTo(-u, 0), e.lineTo(-u / 2, l), e.closePath(), e.fill();
|
|
718
718
|
break;
|
|
719
719
|
case "oval":
|
|
720
|
-
|
|
720
|
+
e.ellipse(-u / 2, 0, u / 2, l, 0, 0, Math.PI * 2), e.fill();
|
|
721
721
|
break;
|
|
722
722
|
}
|
|
723
|
-
|
|
723
|
+
e.restore();
|
|
724
724
|
}
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region packages/core/src/image/bitmap-image-by-path.ts
|
|
727
|
-
var
|
|
728
|
-
function
|
|
729
|
-
let t =
|
|
730
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
727
|
+
var O = 256, k = /* @__PURE__ */ new WeakMap();
|
|
728
|
+
function A(e) {
|
|
729
|
+
let t = k.get(e);
|
|
730
|
+
return t || (t = /* @__PURE__ */ new Map(), k.set(e, t)), t;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
733
|
-
let { widthPt: a = 0, heightPt: o = 0, suppressBoundaryFrame: s = !1 } = i, c =
|
|
732
|
+
function j(e, n, r, i = {}) {
|
|
733
|
+
let { widthPt: a = 0, heightPt: o = 0, suppressBoundaryFrame: s = !1 } = i, c = A(r), l = c.get(e);
|
|
734
734
|
if (l) return c.delete(e), c.set(e, l), l.promise;
|
|
735
735
|
let u = r(e, n).then((e) => t(e, {
|
|
736
736
|
widthPt: a,
|
|
@@ -739,29 +739,58 @@ function k(e, n, r, i = {}) {
|
|
|
739
739
|
})), d = { promise: u };
|
|
740
740
|
if (u.then((e) => {
|
|
741
741
|
d.bitmap = e;
|
|
742
|
-
}).catch(() => {}), u.catch(() => c.delete(e)), c.set(e, d), c.size >
|
|
742
|
+
}).catch(() => {}), u.catch(() => c.delete(e)), c.set(e, d), c.size > O) {
|
|
743
743
|
let e = c.keys().next().value, t = c.get(e);
|
|
744
744
|
c.delete(e), t?.promise.then((e) => e?.close()).catch(() => {});
|
|
745
745
|
}
|
|
746
746
|
return u;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
748
|
+
function M(e, t) {
|
|
749
|
+
return k.get(t)?.get(e)?.bitmap;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
752
|
-
let t =
|
|
751
|
+
function N(e) {
|
|
752
|
+
let t = k.get(e);
|
|
753
753
|
if (t) {
|
|
754
754
|
for (let e of t.values()) e.promise.then((e) => e?.close()).catch(() => {});
|
|
755
|
-
t.clear(),
|
|
755
|
+
t.clear(), k.delete(e);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
//#endregion
|
|
759
|
+
//#region packages/core/src/text/underline.ts
|
|
760
|
+
function P(t, n, r, a, o, s, c, l = 1) {
|
|
761
|
+
let u = Math.max(1, o * .05), d = c === "heavy" || (c?.endsWith("Heavy") ?? !1) ? u * 1.8 : u, f = r + Math.max(2, d), p = e(f, d, l);
|
|
762
|
+
if (t.strokeStyle = s, t.lineWidth = d, t.setLineDash([]), c && c.startsWith("wavy")) {
|
|
763
|
+
let e = d, r = d * 6;
|
|
764
|
+
t.beginPath(), t.moveTo(n, f);
|
|
765
|
+
let i = Math.max(1, d * .5);
|
|
766
|
+
for (let o = 0; o <= a; o += i) {
|
|
767
|
+
let i = f + Math.sin(o / r * Math.PI * 2) * e;
|
|
768
|
+
t.lineTo(n + o, i);
|
|
769
|
+
}
|
|
770
|
+
if (t.stroke(), c === "wavyDbl") {
|
|
771
|
+
t.beginPath(), t.moveTo(n, f + e * 2.5);
|
|
772
|
+
for (let o = 0; o <= a; o += i) {
|
|
773
|
+
let i = f + e * 2.5 + Math.sin(o / r * Math.PI * 2) * e;
|
|
774
|
+
t.lineTo(n + o, i);
|
|
775
|
+
}
|
|
776
|
+
t.stroke();
|
|
777
|
+
}
|
|
778
|
+
return;
|
|
756
779
|
}
|
|
780
|
+
if (c === "dbl") {
|
|
781
|
+
let r = d * 1.4, i = f - r / 2, o = f + r / 2;
|
|
782
|
+
t.beginPath(), t.moveTo(n, i + e(i, d, l)), t.lineTo(n + a, i + e(i, d, l)), t.moveTo(n, o + e(o, d, l)), t.lineTo(n + a, o + e(o, d, l)), t.stroke();
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
t.setLineDash(i(c ?? "sng", d)), t.beginPath(), t.moveTo(n, f + p), t.lineTo(n + a, f + p), t.stroke(), t.setLineDash([]);
|
|
757
786
|
}
|
|
758
787
|
//#endregion
|
|
759
788
|
//#region packages/core/src/text/line-distribute.ts
|
|
760
|
-
var
|
|
761
|
-
function
|
|
789
|
+
var F = (e) => e === 32 || e === 12288;
|
|
790
|
+
function I(e, t, n = {}) {
|
|
762
791
|
if (Math.abs(t) <= .5) return null;
|
|
763
|
-
let
|
|
764
|
-
for (let t =
|
|
792
|
+
let r = n.firstContentSi ?? 0, i = n.lastDrawnSi ?? e.length - 1, o = n.minPerGap ?? -Infinity, s = n.isGapChar ?? a, c = n.isWhitespace ?? F, l = [];
|
|
793
|
+
for (let t = r; t < e.length; t++) {
|
|
765
794
|
let n = e[t];
|
|
766
795
|
if (n === void 0) continue;
|
|
767
796
|
if (n.text === void 0) {
|
|
@@ -789,15 +818,15 @@ function N(e, t, n = {}) {
|
|
|
789
818
|
let f = Array(l.length).fill(!1), p = 0;
|
|
790
819
|
for (let e = u; e < d; e++) {
|
|
791
820
|
let t = l[e];
|
|
792
|
-
if (t.si ===
|
|
821
|
+
if (t.si === i) continue;
|
|
793
822
|
if (t.ws) {
|
|
794
823
|
f[e] = !0, p++;
|
|
795
824
|
continue;
|
|
796
825
|
}
|
|
797
826
|
let n = l[e + 1];
|
|
798
827
|
if (n.ws) continue;
|
|
799
|
-
let r = t.cp,
|
|
800
|
-
(r !== void 0 && s(r) ||
|
|
828
|
+
let r = t.cp, a = n.cp;
|
|
829
|
+
(r !== void 0 && s(r) || a !== void 0 && s(a)) && (f[e] = !0, p++);
|
|
801
830
|
}
|
|
802
831
|
if (p === 0) return null;
|
|
803
832
|
let m = t / p;
|
|
@@ -823,7 +852,7 @@ function N(e, t, n = {}) {
|
|
|
823
852
|
}
|
|
824
853
|
//#endregion
|
|
825
854
|
//#region packages/core/src/text/justify-positions.ts
|
|
826
|
-
function
|
|
855
|
+
function L(e, t, n, r, i = 0) {
|
|
827
856
|
let a = [], o = 0, s = 0;
|
|
828
857
|
for (let c of t) a.push({
|
|
829
858
|
text: e.slice(o, c).join(""),
|
|
@@ -836,10 +865,10 @@ function P(e, t, n, r, i = 0) {
|
|
|
836
865
|
}
|
|
837
866
|
//#endregion
|
|
838
867
|
//#region packages/core/src/layout/virtual-scroll.ts
|
|
839
|
-
function
|
|
868
|
+
function R(e, t, n) {
|
|
840
869
|
return e < t ? t : e > n ? n : e;
|
|
841
870
|
}
|
|
842
|
-
function
|
|
871
|
+
function z(e, t, n, r, i, a) {
|
|
843
872
|
let o = e.length;
|
|
844
873
|
if (o === 0) return {
|
|
845
874
|
start: 0,
|
|
@@ -855,19 +884,28 @@ function I(e, t, n, r, i, a) {
|
|
|
855
884
|
let e = f + p >>> 1;
|
|
856
885
|
l[e] <= n ? f = e + 1 : p = e;
|
|
857
886
|
}
|
|
858
|
-
let m =
|
|
887
|
+
let m = R(f - 1, 0, o - 1), h = n + r;
|
|
859
888
|
for (f = 0, p = o; f < p;) {
|
|
860
889
|
let e = f + p >>> 1;
|
|
861
890
|
l[e] < h ? f = e + 1 : p = e;
|
|
862
891
|
}
|
|
863
|
-
let g =
|
|
892
|
+
let g = R(f - 1, 0, o - 1);
|
|
864
893
|
return {
|
|
865
|
-
start:
|
|
866
|
-
end:
|
|
894
|
+
start: R(m - i, 0, o - 1),
|
|
895
|
+
end: R(g + i, 0, o - 1),
|
|
867
896
|
topIndex: m,
|
|
868
897
|
offsets: l,
|
|
869
898
|
totalHeight: d
|
|
870
899
|
};
|
|
871
900
|
}
|
|
872
901
|
//#endregion
|
|
873
|
-
|
|
902
|
+
//#region packages/core/src/search/highlight-rect.ts
|
|
903
|
+
function B(e, t, n, r) {
|
|
904
|
+
let i = t <= 0 ? 0 : r(e.slice(0, t)), a = n >= e.length ? r(e) : r(e.slice(0, n));
|
|
905
|
+
return {
|
|
906
|
+
x: i,
|
|
907
|
+
width: Math.max(0, a - i)
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
//#endregion
|
|
911
|
+
export { P as a, M as c, E as d, S as f, p as g, d as h, I as i, D as l, f as m, z as n, N as o, m as p, L as r, j as s, B as t, T as u };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./pptx-
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
export {
|
|
1
|
+
import { t as e } from "./pptx-C2qCkfTT.js";
|
|
2
|
+
import { t } from "./docx-B84Lzf0A.js";
|
|
3
|
+
import { t as n } from "./xlsx-1PnsOb7Z.js";
|
|
4
|
+
export { t as docx, e as pptx, n as xlsx };
|