@silurus/ooxml 0.88.0 → 0.89.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 +118 -23
- package/THIRD_PARTY_NOTICES.md +8 -7
- package/dist/abort-VrnK7mdP.js +10 -0
- package/dist/assets/render-worker-C5G_Nr_A.js +35 -0
- package/dist/assets/render-worker-DQfWdNsm.js +16 -0
- package/dist/assets/render-worker-Ds7LjwU-.js +15 -0
- package/dist/{hyperlink-Cxzhet30.js → bounded-raw-part-cache-CsnNptAy.js} +4937 -7458
- package/dist/bundled-asset-url-E2nXURF9.js +15 -0
- package/dist/canvas-viewer-mechanics-BZ8QCrRi.js +675 -0
- package/dist/cfb-guard-dNeUiANF.js +528 -0
- package/dist/chart-ex.mjs +667 -663
- package/dist/comment-overlay-controller-CBvQx-En.js +994 -0
- package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
- package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-BKidRH36.js} +5 -5
- package/dist/{comment-ui-runtime-CWGqn5Vr.js → comment-ui-runtime-C47QoDUy.js} +5 -5
- package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
- package/dist/document-model-source-MzFPrxt0.js +249 -0
- package/dist/document-pull-client-BoJeuURD.js +35941 -0
- package/dist/document-pull-worker-CaP8XESP.js +104 -0
- package/dist/docx-BN70UhvX.js +495 -0
- package/dist/docx-BRRtSvk3.js +3563 -0
- package/dist/docx-model-source-CTO9iw_W.js +98 -0
- package/dist/docx-source-worker.mjs +455 -0
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/drawingml-shape-CHmq8kpM.js +310 -0
- package/dist/duotone-DN8P4aXe.js +126 -0
- package/dist/emf-CGFQIz6c.js +1790 -0
- package/dist/font-preload-demand-Dmy31xt-.js +2058 -0
- package/dist/grid-geometry-C3IG20ut.js +384 -0
- package/dist/host-layout-DVMw8hDY.js +56 -0
- package/dist/host-layout-measure-DsuQ2UJs.js +7 -0
- package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
- package/dist/index.mjs +4 -4
- package/dist/internal-companion.mjs +12 -0
- package/dist/line-distribute-Bu8psjGd.js +2799 -0
- package/dist/math.mjs +2 -2
- package/dist/mathjax-stix2.js +10 -10
- package/dist/model-source-kz_NkZqT.js +179 -0
- package/dist/model-source-s5hRpk4w.js +61 -0
- package/dist/model-source-session-6fuaqbGs.js +71 -0
- package/dist/model-source-session-DqrR4XHR.js +85 -0
- package/dist/model-source-session-cPJSF_Ak.js +58 -0
- package/dist/node.mjs +7 -1327
- package/dist/{pixel-budget-9P63Bsk5.js → pixel-budget-BpTYrepD.js} +13 -10
- package/dist/plot-area-frame-Bs_j4uu7.js +41811 -0
- package/dist/pptx-CaJ6ILnw.js +183 -0
- package/dist/pptx-_BOGcBym.js +2936 -0
- package/dist/pptx-model-source-B_9afw9R.js +37 -0
- package/dist/pptx-source-worker.mjs +446 -0
- package/dist/pptx.mjs +8 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/presentation-model-source-CGHLyX32.js +77 -0
- package/dist/raster-target-YQ4G6rxo.js +42 -0
- package/dist/region-map.mjs +117 -153
- package/dist/{render-D3iqVKCo.js → render-CzbDzRKa.js} +3 -3
- package/dist/{render-worker-host-B5wQfB7U.js → render-worker-host-B1u6BOUd.js} +1 -1
- package/dist/{render-worker-host-D4123J27.js → render-worker-host-C-EECo68.js} +1 -1
- package/dist/{render-worker-host-Di3LxLc0.js → render-worker-host-DDqZTCVf.js} +1 -1
- package/dist/renderer-CD2cvVAF.js +5823 -0
- package/dist/renderer-DRoeb14O.js +5170 -0
- package/dist/resource-measurement-Dhhm7P_l.js +772 -0
- package/dist/session-XPmC0CUd.js +656 -0
- package/dist/slide-pull-client-tq7U_fYg.js +6485 -0
- package/dist/three-d-BKwNPAP4.js +878 -0
- package/dist/three-d.mjs +925 -910
- package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
- package/dist/tiff.mjs +401 -248
- package/dist/types/chart-ex.d.ts +149 -2
- package/dist/types/docx.d.ts +333 -96
- package/dist/types/index.d.ts +566 -301
- package/dist/types/internal-companion.d.ts +11 -0
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +422 -9
- package/dist/types/pptx.d.ts +302 -95
- package/dist/types/region-map.d.ts +149 -2
- package/dist/types/three-d.d.ts +149 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +343 -132
- package/dist/wasm-loader-rlgHmcSv.js +35 -0
- package/dist/wasm-runtime-generation-D6TKZdNb.js +97 -0
- package/dist/workbook-model-source-BIGrfZy6.js +94 -0
- package/dist/worker-source-DrwhR9fw.js +22 -0
- package/dist/worker-source-SbudzjYL.js +22 -0
- package/dist/worker-source-UAi3GNcM.js +22 -0
- package/dist/worksheet-pull-client-ClvPO_Jf.js +579 -0
- package/dist/xlsx-CsmREBaZ.js +5819 -0
- package/dist/xlsx-DmHfeNNp.js +534 -0
- package/dist/xlsx-model-source-D1flORqy.js +309 -0
- package/dist/xlsx-source-worker.mjs +525 -0
- package/dist/xlsx.mjs +8 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +42 -16
- package/dist/assets/render-worker-1uPAxMZr.js +0 -31
- package/dist/assets/render-worker-BlvJybji.js +0 -10
- package/dist/assets/render-worker-CzmiJfFL.js +0 -11
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/dist/canvas-viewer-mechanics-DbLz0rYW.js +0 -1384
- package/dist/cjk-fallback-bLI3z70h.js +0 -46
- package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
- package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/dist/comments-Diid5ujN.js +0 -246
- package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
- package/dist/document-pull-client-B9PTM-pL.js +0 -27280
- package/dist/docx-BF9WXrYH.js +0 -3103
- package/dist/dom-interaction-boundary-Cnm8DSBN.js +0 -223
- package/dist/highlight-rect-C5hkRqUr.js +0 -13
- package/dist/line-distribute-D1WNHKz_.js +0 -1023
- package/dist/line-metrics-B60C86uh.js +0 -60
- package/dist/plot-area-frame-DLTYKHNP.js +0 -4354
- package/dist/pptx-DkyYBYoL.js +0 -3065
- package/dist/renderer-B4GZb5We.js +0 -6492
- package/dist/resource-measurement-SHQCbkh2.js +0 -150
- package/dist/session-BGq81gRQ.js +0 -743
- package/dist/slide-pull-client-DiPnm240.js +0 -6253
- package/dist/source-key-DIJG8BA0.js +0 -42
- package/dist/three-d-DJBl8g8M.js +0 -1162
- package/dist/transfer-p6iCC2R7.js +0 -6
- package/dist/units-BzZ0gAxs.js +0 -4
- package/dist/worksheet-pull-client-BM8ywvbu.js +0 -458
- package/dist/xlsx-C9NVjgaV.js +0 -8484
- /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
- /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
- /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
- /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
- /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
- /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-Bs_j4uu7.js";
|
|
2
|
+
import { At as c, Bt as l, Ct as u, Dt as d, Ft as f, Ht as p, It as m, Mt as h, Ot as g, St as _, Ut as v, Vt as y, Wt as b, jt as x, kt as S, zt as C } from "./bounded-raw-part-cache-CsnNptAy.js";
|
|
3
|
+
//#region packages/core/src/shape/drawingml-geometry.ts
|
|
4
|
+
var w = new Set([
|
|
5
|
+
"line",
|
|
6
|
+
"straightconnector1",
|
|
7
|
+
"bentconnector2",
|
|
8
|
+
"bentconnector3",
|
|
9
|
+
"bentconnector4",
|
|
10
|
+
"bentconnector5",
|
|
11
|
+
"curvedconnector2",
|
|
12
|
+
"curvedconnector3",
|
|
13
|
+
"curvedconnector4",
|
|
14
|
+
"curvedconnector5"
|
|
15
|
+
]), T = new Set([
|
|
16
|
+
"callout1",
|
|
17
|
+
"callout2",
|
|
18
|
+
"callout3",
|
|
19
|
+
"bordercallout1",
|
|
20
|
+
"bordercallout2",
|
|
21
|
+
"bordercallout3",
|
|
22
|
+
"accentcallout1",
|
|
23
|
+
"accentcallout2",
|
|
24
|
+
"accentcallout3",
|
|
25
|
+
"accentbordercallout1",
|
|
26
|
+
"accentbordercallout2",
|
|
27
|
+
"accentbordercallout3"
|
|
28
|
+
]);
|
|
29
|
+
function E(e) {
|
|
30
|
+
return T.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector");
|
|
31
|
+
}
|
|
32
|
+
function D(e) {
|
|
33
|
+
return JSON.stringify({
|
|
34
|
+
geometry: e.geometry,
|
|
35
|
+
stroke: e.stroke,
|
|
36
|
+
fill: e.fill
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var O = 1;
|
|
40
|
+
function k(e, t, n = Infinity) {
|
|
41
|
+
let r = 0;
|
|
42
|
+
if (!(n === Infinity || Number.isSafeInteger(n) && n > 0)) throw new C("Invalid DrawingML geometry budget");
|
|
43
|
+
let i = (e) => {
|
|
44
|
+
if (r += e, !Number.isSafeInteger(r) || r > n) throw new C("DrawingML geometry work budget exceeded");
|
|
45
|
+
}, { x: a, y: o, w: l, h: u } = e.rect;
|
|
46
|
+
if (![
|
|
47
|
+
t,
|
|
48
|
+
e.rect.x,
|
|
49
|
+
e.rect.y,
|
|
50
|
+
l,
|
|
51
|
+
u,
|
|
52
|
+
e.transform.rotationDeg
|
|
53
|
+
].every(Number.isFinite) || t < 0 || l < 0 || u < 0) throw RangeError("Invalid DrawingML geometry frame");
|
|
54
|
+
i(1);
|
|
55
|
+
let f = e.stroke;
|
|
56
|
+
if (i(f?.customDash?.length ?? 0), e.geometry.kind === "preset" && e.geometry.adjustments.some((e) => e !== null && !Number.isFinite(e))) throw RangeError("Non-finite DrawingML adjustment");
|
|
57
|
+
let _ = f ? s(f, t) : null, y = [], k = [], A = (e, t, n, r = "nonzero") => {
|
|
58
|
+
y.push(Object.freeze({
|
|
59
|
+
path: e,
|
|
60
|
+
fill: t,
|
|
61
|
+
stroke: n,
|
|
62
|
+
fillRule: r
|
|
63
|
+
}));
|
|
64
|
+
}, j = (e, n, r, a) => {
|
|
65
|
+
if (!a || !f) return;
|
|
66
|
+
let o = g(a, f, t, O, i);
|
|
67
|
+
if (o) {
|
|
68
|
+
if (![
|
|
69
|
+
e,
|
|
70
|
+
n,
|
|
71
|
+
r
|
|
72
|
+
].every(Number.isFinite)) throw RangeError("Invalid resolved DrawingML arrow frame");
|
|
73
|
+
k.push(Object.freeze({
|
|
74
|
+
tipX: e,
|
|
75
|
+
tipY: n,
|
|
76
|
+
angle: r,
|
|
77
|
+
end: Object.freeze({ ...a }),
|
|
78
|
+
geometry: o
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
}, M = f?.headEnd ? d(f.headEnd, f, t, O) : 0, N = f?.tailEnd ? d(f.tailEnd, f, t, O) : 0, P = (e, t, n, r, a) => {
|
|
82
|
+
if (!(r > 0 || a > 0) || !_) {
|
|
83
|
+
A(e, t, _, n);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
let o = S(e, r, a);
|
|
87
|
+
i(o.reduce((e, t) => e + 1 + t.args.length, 0)), t !== "none" && A(e, t, null, n), A(o, "none", _, n);
|
|
88
|
+
}, F = p(i);
|
|
89
|
+
if (e.geometry.kind === "preset") {
|
|
90
|
+
i(e.geometry.adjustments.length);
|
|
91
|
+
let t = e.geometry.name.toLowerCase(), n = [...e.geometry.adjustments], r = E(t) && !!(f?.headEnd || f?.tailEnd), s = t.startsWith("curvedconnector"), d = m(t, l, u, n, i, a, o);
|
|
92
|
+
if (d) d.forEach((e, t) => {
|
|
93
|
+
let n = t === d.length - 1 && (e.fill === "none" || e.fill == null);
|
|
94
|
+
s && n && e.stroke ? P(e.path, e.fill, "nonzero", M, N) : A(e.path, e.fill, e.stroke && !(r && n) ? _ : null);
|
|
95
|
+
});
|
|
96
|
+
else {
|
|
97
|
+
let e = p(i);
|
|
98
|
+
c(e.sink, t, a, o, l, u, n[0], n[1], n[2], n[3]), A(Object.freeze(e.commands), null, _, "nonzero");
|
|
99
|
+
}
|
|
100
|
+
if (x(F.sink, e.geometry.name, a, o, l, u, n) || c(F.sink, e.geometry.name, a, o, l, u, n[0], n[1], n[2], n[3]), f && (w.has(t) || T.has(t))) {
|
|
101
|
+
let e = h(t, a, o, l, u, n);
|
|
102
|
+
if (e) {
|
|
103
|
+
if (r && e.vertices.length >= 2) {
|
|
104
|
+
let t = p(i), n = e.vertices;
|
|
105
|
+
t.sink.moveTo(n[0].x, n[0].y);
|
|
106
|
+
for (let e = 1; e < n.length; e++) t.sink.lineTo(n[e].x, n[e].y);
|
|
107
|
+
let r = S(Object.freeze(t.commands), M, N);
|
|
108
|
+
r.length >= 2 && A(r, "none", _);
|
|
109
|
+
}
|
|
110
|
+
j(e.end.x, e.end.y, e.end.angle, f.tailEnd), j(e.start.x, e.start.y, e.start.angle, f.headEnd);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
let { subpaths: t } = e.geometry;
|
|
115
|
+
for (let e of t) i(e.length + 1);
|
|
116
|
+
let n = e.geometry.paint?.length === t.length ? e.geometry.paint : null, r = f && (M > 0 || N > 0) ? v(t) : null, s = r?.start ? M : 0, c = r?.end ? N : 0;
|
|
117
|
+
if (n) t.forEach((e, r) => {
|
|
118
|
+
let d = p(i);
|
|
119
|
+
b(d.sink, [e], a, o, l, u);
|
|
120
|
+
let f = Object.freeze(d.commands), m = n[r].fill ?? null;
|
|
121
|
+
n[r].stroke === !1 ? A(f, m, null, n[r].fillRule) : P(f, m, n[r].fillRule ?? "nonzero", r === 0 ? s : 0, r === t.length - 1 ? c : 0);
|
|
122
|
+
});
|
|
123
|
+
else {
|
|
124
|
+
let e = p(i);
|
|
125
|
+
b(e.sink, t, a, o, l, u), P(Object.freeze(e.commands), null, "nonzero", s, c);
|
|
126
|
+
}
|
|
127
|
+
if (b(F.sink, n ? t.filter((e, t) => n[t].fill !== "none") : t, a, o, l, u), f) {
|
|
128
|
+
let e = v(t);
|
|
129
|
+
e.start && j(a + e.start.x * l, o + e.start.y * u, Math.atan2(e.start.dy * u, e.start.dx * l), f.headEnd), e.end && j(a + e.end.x * l, o + e.end.y * u, Math.atan2(e.end.dy * u, e.end.dx * l), f.tailEnd);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return Object.freeze({
|
|
133
|
+
width: l,
|
|
134
|
+
height: u,
|
|
135
|
+
scale: t,
|
|
136
|
+
originX: a,
|
|
137
|
+
originY: o,
|
|
138
|
+
sourceKey: D(e),
|
|
139
|
+
paths: Object.freeze(y),
|
|
140
|
+
arrows: Object.freeze(k),
|
|
141
|
+
fillSilhouette: Object.freeze(F.commands),
|
|
142
|
+
workUnits: r
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function A(e, t) {
|
|
146
|
+
let n = e.resolvedGeometry;
|
|
147
|
+
if (![
|
|
148
|
+
t,
|
|
149
|
+
e.rect.x,
|
|
150
|
+
e.rect.y,
|
|
151
|
+
e.rect.w,
|
|
152
|
+
e.rect.h,
|
|
153
|
+
e.transform.rotationDeg
|
|
154
|
+
].every(Number.isFinite) || t < 0 || e.rect.w < 0 || e.rect.h < 0 || typeof e.transform.flipH != "boolean" || typeof e.transform.flipV != "boolean") throw RangeError("Invalid retained DrawingML frame");
|
|
155
|
+
if (!n || n.width !== e.rect.w || n.height !== e.rect.h || n.scale !== t || n.sourceKey !== D(e)) throw RangeError("Missing or stale retained DrawingML geometry");
|
|
156
|
+
if (![n.originX, n.originY].every(Number.isFinite)) throw RangeError("Invalid retained DrawingML origin");
|
|
157
|
+
if (!Number.isSafeInteger(n.workUnits) || n.workUnits < 1 || !Array.isArray(n.paths) || !Array.isArray(n.arrows)) throw RangeError("Invalid retained DrawingML work/scheduling");
|
|
158
|
+
if (n.paths.length + n.arrows.length > n.workUnits) throw new C("Retained geometry scheduling exceeds its acquired work");
|
|
159
|
+
let r = 0, i = (e) => {
|
|
160
|
+
if (r += e, r > n.workUnits) throw new C("Retained geometry paths exceed their acquired work");
|
|
161
|
+
}, a = (e) => {
|
|
162
|
+
if (!Number.isFinite(e.lineWidth) || e.lineWidth < 0 || !Number.isFinite(e.miterLimit) || e.miterLimit <= 0 || ![
|
|
163
|
+
"butt",
|
|
164
|
+
"round",
|
|
165
|
+
"square"
|
|
166
|
+
].includes(e.lineCap) || ![
|
|
167
|
+
"round",
|
|
168
|
+
"bevel",
|
|
169
|
+
"miter"
|
|
170
|
+
].includes(e.lineJoin) || !Array.isArray(e.dash) || e.dash.length > n.workUnits || !e.dash.every((e) => Number.isFinite(e) && e >= 0)) throw RangeError("Invalid retained stroke geometry");
|
|
171
|
+
};
|
|
172
|
+
for (let e of n.paths) {
|
|
173
|
+
if (y(e.path, i), e.fill !== null && ![
|
|
174
|
+
"norm",
|
|
175
|
+
"none",
|
|
176
|
+
"lighten",
|
|
177
|
+
"lightenLess",
|
|
178
|
+
"darken",
|
|
179
|
+
"darkenLess"
|
|
180
|
+
].includes(e.fill)) throw RangeError("Invalid retained path fill");
|
|
181
|
+
if (e.fillRule !== "nonzero" && e.fillRule !== "evenodd") throw RangeError("Invalid retained fill rule");
|
|
182
|
+
e.stroke && a(e.stroke);
|
|
183
|
+
}
|
|
184
|
+
y(n.fillSilhouette, i);
|
|
185
|
+
for (let e of n.arrows) {
|
|
186
|
+
if (![
|
|
187
|
+
e.tipX,
|
|
188
|
+
e.tipY,
|
|
189
|
+
e.angle
|
|
190
|
+
].every(Number.isFinite) || !["fill", "stroke"].includes(e.geometry.paint)) throw RangeError("Invalid retained arrow frame");
|
|
191
|
+
y(e.geometry.path, i), a(e.geometry.stroke);
|
|
192
|
+
}
|
|
193
|
+
return n;
|
|
194
|
+
}
|
|
195
|
+
function j(e, t) {
|
|
196
|
+
let n = {
|
|
197
|
+
a: e.a * t.a + e.c * t.b,
|
|
198
|
+
b: e.b * t.a + e.d * t.b,
|
|
199
|
+
c: e.a * t.c + e.c * t.d,
|
|
200
|
+
d: e.b * t.c + e.d * t.d,
|
|
201
|
+
e: e.a * t.e + e.c * t.f + e.e,
|
|
202
|
+
f: e.b * t.e + e.d * t.f + e.f
|
|
203
|
+
};
|
|
204
|
+
if (!Object.values(n).every(Number.isFinite) || !Number.isFinite(n.a * n.d - n.b * n.c) || n.a * n.d - n.b * n.c === 0) throw RangeError("Invalid DrawingML geometry transform");
|
|
205
|
+
return n;
|
|
206
|
+
}
|
|
207
|
+
var M = {
|
|
208
|
+
a: 1,
|
|
209
|
+
b: 0,
|
|
210
|
+
c: 0,
|
|
211
|
+
d: 1,
|
|
212
|
+
e: 0,
|
|
213
|
+
f: 0
|
|
214
|
+
}, N = (e, t) => ({
|
|
215
|
+
...M,
|
|
216
|
+
e,
|
|
217
|
+
f: t
|
|
218
|
+
}), P = (e) => ({
|
|
219
|
+
a: Math.cos(e),
|
|
220
|
+
b: Math.sin(e),
|
|
221
|
+
c: -Math.sin(e),
|
|
222
|
+
d: Math.cos(e),
|
|
223
|
+
e: 0,
|
|
224
|
+
f: 0
|
|
225
|
+
});
|
|
226
|
+
function F(e, t = M) {
|
|
227
|
+
let n = A(e, 1), { x: i, y: a, w: o, h: c } = e.rect, l = e.transform, u = t;
|
|
228
|
+
(l.rotationDeg !== 0 || l.flipH || l.flipV) && (u = j(u, N(i + o / 2, a + c / 2)), l.rotationDeg !== 0 && (u = j(u, P(l.rotationDeg * Math.PI / 180))), u = j(u, {
|
|
229
|
+
...M,
|
|
230
|
+
a: l.flipH ? -1 : 1,
|
|
231
|
+
d: l.flipV ? -1 : 1
|
|
232
|
+
}), u = j(u, N(-(i + o / 2), -(a + c / 2)))), u = j(u, N(i - n.originX, a - n.originY));
|
|
233
|
+
let d = [], f = s(null, 1), p = (e, t, n) => {
|
|
234
|
+
let i = r(e, t, n);
|
|
235
|
+
i && d.push(i);
|
|
236
|
+
};
|
|
237
|
+
for (let t of n.paths) e.fill && e.fill.fillType !== "none" && t.fill !== "none" && p(t.path, u, f), t.stroke && p(t.path, u, t.stroke);
|
|
238
|
+
for (let e of n.arrows) {
|
|
239
|
+
let t = j(j(u, N(e.tipX, e.tipY)), P(e.angle));
|
|
240
|
+
p(e.geometry.path, t, e.geometry.paint === "stroke" ? e.geometry.stroke : f);
|
|
241
|
+
}
|
|
242
|
+
if (d.length === 0) return null;
|
|
243
|
+
let m = Infinity, h = Infinity, g = -Infinity, _ = -Infinity;
|
|
244
|
+
for (let e of d) m = Math.min(m, e.x), h = Math.min(h, e.y), g = Math.max(g, e.x + e.w), _ = Math.max(_, e.y + e.h);
|
|
245
|
+
let v = {
|
|
246
|
+
x: m,
|
|
247
|
+
y: h,
|
|
248
|
+
w: g - m,
|
|
249
|
+
h: _ - h
|
|
250
|
+
};
|
|
251
|
+
if (!Object.values(v).every(Number.isFinite)) throw RangeError("Non-finite DrawingML enclosure");
|
|
252
|
+
return v;
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region packages/core/src/shape/drawingml-shape.ts
|
|
256
|
+
var I = 1;
|
|
257
|
+
function L(e, t, n) {
|
|
258
|
+
let { x: r, y: i, w: a, h: o } = t.rect, { rotationDeg: s, flipH: c, flipV: l } = t.transform;
|
|
259
|
+
e.save();
|
|
260
|
+
try {
|
|
261
|
+
(s !== 0 || c || l) && (e.translate(r + a / 2, i + o / 2), s !== 0 && e.rotate(s * Math.PI / 180), e.scale(c ? -1 : 1, l ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), n();
|
|
262
|
+
} finally {
|
|
263
|
+
e.restore();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function R(e, t, n, r, i, a) {
|
|
267
|
+
let o = t.resolvedGeometry ? A(t, t.resolvedGeometry.scale) : k(t, 1);
|
|
268
|
+
if (i !== o.width || a !== o.height) throw RangeError("Retained DrawingML silhouette frame mismatch");
|
|
269
|
+
l(e, o.fillSilhouette, n - o.originX, r - o.originY);
|
|
270
|
+
}
|
|
271
|
+
function z(e, t) {
|
|
272
|
+
let { x: n, y: r, w: i, h: a } = t.rect;
|
|
273
|
+
e.beginPath(), R(e, t, n, r, i, a), e.clip();
|
|
274
|
+
}
|
|
275
|
+
function B(t, r, a, s, c) {
|
|
276
|
+
if (t.strokeStyle = e(r.color), o(t, a), r.fill) {
|
|
277
|
+
let e = i(r.fill, t, s.x, s.y, s.w, s.h, c, I, void 0, void 0, n(t));
|
|
278
|
+
e && (t.strokeStyle = e);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function V(e, n, r) {
|
|
282
|
+
let o = n.resolvedGeometry ? A(n, r) : k(n, r), s = n.resolvedGeometry ? n : {
|
|
283
|
+
...n,
|
|
284
|
+
resolvedGeometry: o
|
|
285
|
+
};
|
|
286
|
+
t(n.stroke?.fill) && (e = a(e));
|
|
287
|
+
let { x: c, y: d, w: p, h: m } = n.rect;
|
|
288
|
+
L(e, n, () => {
|
|
289
|
+
let t = i(n.fill, e, c, d, p, m, n.transform.rotationDeg, I, void 0, (e, t, n, r, i) => R(e, s, t, n, r, i)), a = n.stroke;
|
|
290
|
+
for (let r of o.paths) {
|
|
291
|
+
if (e.beginPath(), l(e, r.path, c - o.originX, d - o.originY), t && r.fill !== "none") {
|
|
292
|
+
e.save();
|
|
293
|
+
try {
|
|
294
|
+
e.fillStyle = t, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill();
|
|
295
|
+
let n = f(r.fill);
|
|
296
|
+
n && (e.fillStyle = n, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill());
|
|
297
|
+
} finally {
|
|
298
|
+
e.restore();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
a && r.stroke && (B(e, a, r.stroke, n.rect, n.transform.rotationDeg), e.stroke());
|
|
302
|
+
}
|
|
303
|
+
if (a) for (let t of o.arrows) {
|
|
304
|
+
let i = c - o.originX + t.tipX, s = d - o.originY + t.tipY;
|
|
305
|
+
_(e, i, s, t.angle, t.geometry, a, u(e, a, r, I, i, s, t.angle, t.end, n.rect, n.transform.rotationDeg, I));
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
export { A as a, F as i, V as n, k as o, L as r, z as t };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Zr as e, ni as t } from "./plot-area-frame-Bs_j4uu7.js";
|
|
2
|
+
import { r as n } from "./raster-target-YQ4G6rxo.js";
|
|
3
|
+
//#region packages/core/src/shape/color-space.ts
|
|
4
|
+
function r([e, t, n], r = [
|
|
5
|
+
0,
|
|
6
|
+
0,
|
|
7
|
+
0
|
|
8
|
+
]) {
|
|
9
|
+
let i = e / 255, a = t / 255, o = n / 255, s = Math.max(i, a, o), c = Math.min(i, a, o), l = (s + c) / 2, u = s - c;
|
|
10
|
+
if (u === 0) return r[0] = 0, r[1] = 0, r[2] = l, r;
|
|
11
|
+
let d = u / (1 - Math.abs(2 * l - 1));
|
|
12
|
+
return r[0] = ((s === i ? (a - o) / u % 6 : s === a ? (o - i) / u + 2 : (i - a) / u + 4) * 60 + 360) % 360, r[1] = d, r[2] = l, r;
|
|
13
|
+
}
|
|
14
|
+
function i(e, t, n, r = [
|
|
15
|
+
0,
|
|
16
|
+
0,
|
|
17
|
+
0
|
|
18
|
+
]) {
|
|
19
|
+
let i = (1 - Math.abs(2 * n - 1)) * t, a = (e % 360 + 360) % 360 / 60, o = i * (1 - Math.abs(a % 2 - 1)), [s, c, l] = a < 1 ? [
|
|
20
|
+
i,
|
|
21
|
+
o,
|
|
22
|
+
0
|
|
23
|
+
] : a < 2 ? [
|
|
24
|
+
o,
|
|
25
|
+
i,
|
|
26
|
+
0
|
|
27
|
+
] : a < 3 ? [
|
|
28
|
+
0,
|
|
29
|
+
i,
|
|
30
|
+
o
|
|
31
|
+
] : a < 4 ? [
|
|
32
|
+
0,
|
|
33
|
+
o,
|
|
34
|
+
i
|
|
35
|
+
] : a < 5 ? [
|
|
36
|
+
o,
|
|
37
|
+
0,
|
|
38
|
+
i
|
|
39
|
+
] : [
|
|
40
|
+
i,
|
|
41
|
+
0,
|
|
42
|
+
o
|
|
43
|
+
], u = n - i / 2;
|
|
44
|
+
return r[0] = (s + u) * 255, r[1] = (c + u) * 255, r[2] = (l + u) * 255, r;
|
|
45
|
+
}
|
|
46
|
+
function a(e, t, n) {
|
|
47
|
+
return Math.round(Math.max(0, Math.min(255, e + (t - e) * n)));
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region packages/core/src/image/duotone.ts
|
|
51
|
+
function o(e) {
|
|
52
|
+
return /^[0-9a-fA-F]{6}$/.test(e) ? [
|
|
53
|
+
parseInt(e.slice(0, 2), 16),
|
|
54
|
+
parseInt(e.slice(2, 4), 16),
|
|
55
|
+
parseInt(e.slice(4, 6), 16)
|
|
56
|
+
] : null;
|
|
57
|
+
}
|
|
58
|
+
function s(e, t, n) {
|
|
59
|
+
return (.299 * e + .587 * t + .114 * n) / 255;
|
|
60
|
+
}
|
|
61
|
+
function c(e, t, n) {
|
|
62
|
+
let r = /^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t) ? o(t.slice(0, 6)) : null, i = /^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(n) ? o(n.slice(0, 6)) : null;
|
|
63
|
+
if (!r || !i) return e;
|
|
64
|
+
let c = t.length === 8 ? parseInt(t.slice(6), 16) / 255 : 1, l = n.length === 8 ? parseInt(n.slice(6), 16) / 255 : 1, [u, d, f] = r, [p, m, h] = i, g = e.data;
|
|
65
|
+
for (let e = 0; e < g.length; e += 4) {
|
|
66
|
+
let t = s(g[e], g[e + 1], g[e + 2]);
|
|
67
|
+
g[e] = a(u, p, t), g[e + 1] = a(d, m, t), g[e + 2] = a(f, h, t), g[e + 3] = Math.round(g[e + 3] * (c + (l - c) * t));
|
|
68
|
+
}
|
|
69
|
+
return e;
|
|
70
|
+
}
|
|
71
|
+
var l = (t, n) => e(t, n);
|
|
72
|
+
async function u(e, t, n) {
|
|
73
|
+
return d(e, (e) => {
|
|
74
|
+
c(e, t.clr1, t.clr2);
|
|
75
|
+
}, n);
|
|
76
|
+
}
|
|
77
|
+
async function d(e, r, i) {
|
|
78
|
+
let { width: a, height: o } = i;
|
|
79
|
+
if (a <= 0 || o <= 0 || typeof createImageBitmap > "u") return e;
|
|
80
|
+
let s = (i.offscreenFactory ?? l)(a, o);
|
|
81
|
+
if (!s) return e;
|
|
82
|
+
let c = !1;
|
|
83
|
+
try {
|
|
84
|
+
let l = s.getContext("2d");
|
|
85
|
+
if (!l) return e;
|
|
86
|
+
l.drawImage(e, 0, 0);
|
|
87
|
+
let u;
|
|
88
|
+
try {
|
|
89
|
+
u = l.getImageData(0, 0, a, o);
|
|
90
|
+
} catch (t) {
|
|
91
|
+
if (i.strict) throw t;
|
|
92
|
+
return e;
|
|
93
|
+
}
|
|
94
|
+
let d = s;
|
|
95
|
+
i.releaseReadbackSurface && (d.width = 0);
|
|
96
|
+
let f = r(u), p = {
|
|
97
|
+
width: f?.width ?? a,
|
|
98
|
+
height: f?.height ?? o
|
|
99
|
+
}, m = f?.frame;
|
|
100
|
+
if (f && f !== u) {
|
|
101
|
+
if (i.releaseReadbackSurface || (d.width = 0), typeof ImageData < "u") u = new ImageData(f.data, f.width, f.height);
|
|
102
|
+
else {
|
|
103
|
+
if (!l.createImageData) throw Error("ImageData allocation is unavailable");
|
|
104
|
+
let e = l.createImageData(f.width, f.height);
|
|
105
|
+
e.data.set(f.data), u = e;
|
|
106
|
+
}
|
|
107
|
+
f = void 0;
|
|
108
|
+
}
|
|
109
|
+
(i.releaseReadbackSurface || p.width !== a || p.height !== o || d.width === 0) && (d.width = p.width, d.height = p.height), l.putImageData(u, 0, 0);
|
|
110
|
+
let h = n(p.width, p.height, i.targetWidthPx, i.targetHeightPx), g = h ? await createImageBitmap(s, h) : await createImageBitmap(s);
|
|
111
|
+
if (m) {
|
|
112
|
+
let e = g.width / p.width, n = g.height / p.height;
|
|
113
|
+
t(g, {
|
|
114
|
+
x: m.x * e,
|
|
115
|
+
y: m.y * n,
|
|
116
|
+
width: m.width * e,
|
|
117
|
+
height: m.height * n
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return c = !0, g;
|
|
121
|
+
} finally {
|
|
122
|
+
c || (s.width = 0);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { o as a, a as c, c as i, r as l, d as n, s as o, l as r, i as s, u as t };
|