@silurus/ooxml 0.36.0 → 0.38.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/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{pptx-CzgfHii0.js → pptx-D0gAnK18.js} +89 -89
- package/dist/pptx-ilzpAQLV.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/types/index.d.ts +18 -0
- package/dist/types/xlsx.d.ts +18 -0
- package/dist/xlsx-CU5kEVSN.cjs +11 -0
- package/dist/xlsx-DF_d5tXa.js +3193 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +2 -2
- package/dist/pptx-gWByFXpk.cjs +0 -1
- package/dist/xlsx-B_G9RPNS.cjs +0 -11
- package/dist/xlsx-g-Drk5UM.js +0 -3172
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./xlsx-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./xlsx-CU5kEVSN.cjs`),t=require(`./pptx-ilzpAQLV.cjs`),n=require(`./docx-BV9DuQ9z.cjs`);Object.defineProperty(exports,`docx`,{enumerable:!0,get:function(){return n.t}}),Object.defineProperty(exports,`pptx`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`xlsx`,{enumerable:!0,get:function(){return e.t}});
|
package/dist/index.mjs
CHANGED
|
@@ -22267,15 +22267,15 @@ function P(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
22267
22267
|
e.font = A;
|
|
22268
22268
|
let N = f.caps, P = f.text;
|
|
22269
22269
|
(N === "all" || N === "small") && (P = P.toUpperCase());
|
|
22270
|
-
let
|
|
22270
|
+
let ee = f.fieldType === "slidenum" && u !== void 0 ? String(u) : P, F = f.underline || f.hyperlink !== void 0, I = {
|
|
22271
22271
|
strikeDouble: f.strikeDouble === !0,
|
|
22272
22272
|
letterSpacingPx: f.letterSpacing == null ? 0 : f.letterSpacing * x * a,
|
|
22273
22273
|
underlineStyle: f.underlineStyle,
|
|
22274
22274
|
underlineColor: f.underlineColor ? C(f.underlineColor) : void 0,
|
|
22275
22275
|
shadow: f.shadow,
|
|
22276
22276
|
outline: f.outline
|
|
22277
|
-
},
|
|
22278
|
-
for (let r of
|
|
22277
|
+
}, L = ee.split(/(\s+)/);
|
|
22278
|
+
for (let r of L) {
|
|
22279
22279
|
if (!r) continue;
|
|
22280
22280
|
if (/^\t+$/.test(r)) {
|
|
22281
22281
|
let e = o + m, n = (t.tabStops ?? []).find((t) => S(t.pos, a) > e);
|
|
@@ -22283,13 +22283,13 @@ function P(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
22283
22283
|
px: _,
|
|
22284
22284
|
algn: n.algn,
|
|
22285
22285
|
segments: []
|
|
22286
|
-
}) : m = _ - o) : y(" ", A, b, E,
|
|
22286
|
+
}) : m = _ - o) : y(" ", A, b, E, F, f.strikethrough, void 0, I);
|
|
22287
22287
|
continue;
|
|
22288
22288
|
}
|
|
22289
22289
|
e.font = A;
|
|
22290
22290
|
let i = e.measureText(r).width, s = /^\s+$/.test(r);
|
|
22291
22291
|
if (g) {
|
|
22292
|
-
y(r, A, b, E,
|
|
22292
|
+
y(r, A, b, E, F, f.strikethrough, f.baseline ?? void 0, I);
|
|
22293
22293
|
continue;
|
|
22294
22294
|
}
|
|
22295
22295
|
let c = /[\u3000-\u9FFF\uAC00-\uD7FF\uF900-\uFAFF\uFF00-\uFFEF]/;
|
|
@@ -22298,53 +22298,53 @@ function P(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
22298
22298
|
let r = c.test(t) ? j : A;
|
|
22299
22299
|
e.font = r;
|
|
22300
22300
|
let i = e.measureText(t).width;
|
|
22301
|
-
m + i > n && m > 0 && v(), y(t, r, b, E,
|
|
22301
|
+
m + i > n && m > 0 && v(), y(t, r, b, E, F, f.strikethrough, f.baseline ?? void 0, I);
|
|
22302
22302
|
}
|
|
22303
22303
|
continue;
|
|
22304
22304
|
}
|
|
22305
|
-
if (m + i <= n) y(r, A, b, E,
|
|
22305
|
+
if (m + i <= n) y(r, A, b, E, F, f.strikethrough, f.baseline ?? void 0, I), s && (h = !0);
|
|
22306
22306
|
else if (s) m > 0 && v();
|
|
22307
22307
|
else if (i > n) {
|
|
22308
22308
|
m > 0 && v();
|
|
22309
22309
|
for (let t of r) {
|
|
22310
22310
|
e.font = A;
|
|
22311
22311
|
let r = e.measureText(t).width;
|
|
22312
|
-
m + r > n && m > 0 && v(), y(t, A, b, E,
|
|
22312
|
+
m + r > n && m > 0 && v(), y(t, A, b, E, F, f.strikethrough, f.baseline ?? void 0, I);
|
|
22313
22313
|
}
|
|
22314
|
-
} else h && v(), y(r, A, b, E,
|
|
22314
|
+
} else h && v(), y(r, A, b, E, F, f.strikethrough, f.baseline ?? void 0, I);
|
|
22315
22315
|
}
|
|
22316
22316
|
}
|
|
22317
22317
|
return f.push(p), f;
|
|
22318
22318
|
}
|
|
22319
|
-
function
|
|
22319
|
+
function ee(e, t, n, r) {
|
|
22320
22320
|
e.fillStyle = T(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
22321
22321
|
}
|
|
22322
|
-
function
|
|
22322
|
+
function F(e, t, n) {
|
|
22323
22323
|
if (!t) return;
|
|
22324
22324
|
let r = t.dir * Math.PI / 180, i = S(t.dist, n);
|
|
22325
22325
|
e.shadowColor = C(t.color, t.alpha), e.shadowBlur = S(t.blur, n), e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
22326
22326
|
}
|
|
22327
|
-
function
|
|
22327
|
+
function I(e, t, n) {
|
|
22328
22328
|
t && (e.shadowColor = C(t.color, t.alpha), e.shadowBlur = S(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
22329
22329
|
}
|
|
22330
|
-
function
|
|
22330
|
+
function L(e) {
|
|
22331
22331
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
22332
22332
|
}
|
|
22333
|
-
function
|
|
22333
|
+
function R(e, t, n, r = "#000000", i, a = {
|
|
22334
22334
|
themeMajorFont: null,
|
|
22335
22335
|
themeMinorFont: null
|
|
22336
22336
|
}, o) {
|
|
22337
22337
|
let s = S(t.x, n), l = S(t.y, n), u = S(t.width, n), d = S(t.height, n);
|
|
22338
22338
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
22339
|
-
if (t.stroke && (e.save(),
|
|
22339
|
+
if (t.stroke && (e.save(), K(e, t.stroke, n), e.beginPath(), e.moveTo(s, l), e.lineTo(s + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
22340
22340
|
let c = t.defaultTextColor ? C(t.defaultTextColor) : null;
|
|
22341
|
-
|
|
22341
|
+
V(e, t.textBody, s, l, u, d, n, c, t.rotation, t.flipH, t.flipV, r, i, a, o);
|
|
22342
22342
|
}
|
|
22343
22343
|
return;
|
|
22344
22344
|
}
|
|
22345
22345
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(s + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(s + u / 2), -(l + d / 2)));
|
|
22346
22346
|
let f = t.geometry.toLowerCase(), p = T(t.fill, e, s, l, u, d);
|
|
22347
|
-
|
|
22347
|
+
F(e, t.shadow ?? null, n), t.shadow || I(e, t.glow ?? null, n);
|
|
22348
22348
|
let m = new Set([
|
|
22349
22349
|
"line",
|
|
22350
22350
|
"straightconnector1",
|
|
@@ -22362,7 +22362,7 @@ function z(e, t, n, r = "#000000", i, a = {
|
|
|
22362
22362
|
"accentcallout1",
|
|
22363
22363
|
"accentbordercallout1"
|
|
22364
22364
|
]), g = t.stroke ? () => {
|
|
22365
|
-
|
|
22365
|
+
K(e, t.stroke, n), e.stroke();
|
|
22366
22366
|
} : null;
|
|
22367
22367
|
if (!t.custGeom && f !== "arc" && _(f) ? v(e, f, s, l, u, d, [
|
|
22368
22368
|
t.adj,
|
|
@@ -22373,7 +22373,7 @@ function z(e, t, n, r = "#000000", i, a = {
|
|
|
22373
22373
|
t.adj6,
|
|
22374
22374
|
t.adj7,
|
|
22375
22375
|
t.adj8
|
|
22376
|
-
], p, g, () =>
|
|
22376
|
+
], p, g, () => L(e)) : (e.beginPath(), t.custGeom && t.custGeom.length > 0 ? z(e, t.custGeom, s, l, u, d) : c(e, f, s, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), p && f !== "arc" && (e.fillStyle = p, f === "donut" || f === "smileyface" || f === "frame" ? e.fill("evenodd") : e.fill(), L(e)), g && g()), t.stroke && m.has(f)) {
|
|
22377
22377
|
let r = y(f, s, l, u, d, [
|
|
22378
22378
|
t.adj,
|
|
22379
22379
|
t.adj2,
|
|
@@ -22386,11 +22386,11 @@ function z(e, t, n, r = "#000000", i, a = {
|
|
|
22386
22386
|
]);
|
|
22387
22387
|
if (r) {
|
|
22388
22388
|
let i = t.stroke.cmpd;
|
|
22389
|
-
i && (f === "line" || f === "straightconnector1") &&
|
|
22389
|
+
i && (f === "line" || f === "straightconnector1") && W(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && G(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && G(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
22390
22390
|
}
|
|
22391
22391
|
} else if (t.stroke && h.has(f)) {
|
|
22392
22392
|
let r = (t.adj2 ?? -8333) / 1e5, i = (t.adj ?? 18750) / 1e5, a = (t.adj4 ?? -38333) / 1e5, o = (t.adj3 ?? 112500) / 1e5, c = s + r * u, f = l + i * d, p = s + a * u, m = l + o * d, h = Math.atan2(m - f, p - c), g = h + Math.PI;
|
|
22393
|
-
t.stroke.tailEnd &&
|
|
22393
|
+
t.stroke.tailEnd && G(e, p, m, h, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && G(e, c, f, g, t.stroke.headEnd, t.stroke, n);
|
|
22394
22394
|
}
|
|
22395
22395
|
if (t.textBody) {
|
|
22396
22396
|
let c = t.defaultTextColor ? C(t.defaultTextColor) : null;
|
|
@@ -22403,13 +22403,13 @@ function z(e, t, n, r = "#000000", i, a = {
|
|
|
22403
22403
|
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
22404
22404
|
p = s + e, m = l + t, h = u / Math.SQRT2, g = d / Math.SQRT2;
|
|
22405
22405
|
}
|
|
22406
|
-
|
|
22406
|
+
V(e, t.textBody, p, m, h, g, n, c, t.rotation, !1, !1, r, i, a, o), e.restore();
|
|
22407
22407
|
}
|
|
22408
22408
|
e.restore();
|
|
22409
22409
|
}
|
|
22410
|
-
var
|
|
22411
|
-
function
|
|
22412
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
22410
|
+
var z = i;
|
|
22411
|
+
function te(e, t) {
|
|
22412
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = B(e).toLowerCase(), o = B(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
22413
22413
|
switch (t) {
|
|
22414
22414
|
case "arabicPlain": return n;
|
|
22415
22415
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -22436,7 +22436,7 @@ function ee(e, t) {
|
|
|
22436
22436
|
default: return `${n}.`;
|
|
22437
22437
|
}
|
|
22438
22438
|
}
|
|
22439
|
-
function
|
|
22439
|
+
function B(e) {
|
|
22440
22440
|
let t = [
|
|
22441
22441
|
1e3,
|
|
22442
22442
|
900,
|
|
@@ -22469,7 +22469,7 @@ function V(e) {
|
|
|
22469
22469
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
22470
22470
|
return r;
|
|
22471
22471
|
}
|
|
22472
|
-
function
|
|
22472
|
+
function V(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
22473
22473
|
themeMajorFont: null,
|
|
22474
22474
|
themeMinorFont: null
|
|
22475
22475
|
}, m) {
|
|
@@ -22486,89 +22486,89 @@ function H(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
22486
22486
|
rotation: c,
|
|
22487
22487
|
textBodyRotation: _
|
|
22488
22488
|
}) : void 0;
|
|
22489
|
-
e.save(), e.translate(l, u), e.rotate(g ? -Math.PI / 2 : Math.PI / 2),
|
|
22489
|
+
e.save(), e.translate(l, u), e.rotate(g ? -Math.PI / 2 : Math.PI / 2), V(e, {
|
|
22490
22490
|
...t,
|
|
22491
22491
|
vert: "horz"
|
|
22492
22492
|
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v), e.restore();
|
|
22493
22493
|
return;
|
|
22494
22494
|
}
|
|
22495
|
-
let _ = S(t.lIns, o), v = S(t.rIns, o), y = S(t.tIns, o), b = S(t.bIns, o), w = t.wrap !== "none", T = t.autoFit === "sp" ? w && N(e, t, i, _, v, o, p) : w, D = Math.max(1, t.numCol ?? 1), A = S(t.spcCol ?? 0, o), j = t.defaultBold ?? !1,
|
|
22495
|
+
let _ = S(t.lIns, o), v = S(t.rIns, o), y = S(t.tIns, o), b = S(t.bIns, o), w = t.wrap !== "none", T = t.autoFit === "sp" ? w && N(e, t, i, _, v, o, p) : w, D = Math.max(1, t.numCol ?? 1), A = S(t.spcCol ?? 0, o), j = t.defaultBold ?? !1, ee = t.defaultItalic ?? !1, F = s ?? d, I = (r) => {
|
|
22496
22496
|
let a = (t.defaultFontSize ?? 18) * x * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
22497
|
-
for (let u
|
|
22498
|
-
let t = S(
|
|
22499
|
-
for (let e of
|
|
22497
|
+
for (let u = 0; u < t.paragraphs.length; u++) {
|
|
22498
|
+
let d = t.paragraphs[u], m = S(d.marL, o), h = S(d.marR, o), g = S(d.indent, o), y = d.defFontSize == null ? a : d.defFontSize * x * o * r, b = d.defColor ? C(d.defColor) : F, w = d.bullet.type === "char" || d.bullet.type === "autoNum", E = (() => {
|
|
22499
|
+
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
22500
22500
|
return null;
|
|
22501
|
-
})(),
|
|
22502
|
-
for (let e of
|
|
22501
|
+
})(), N = E == null ? y : E * x * o * r, I = (() => {
|
|
22502
|
+
for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
|
|
22503
22503
|
return null;
|
|
22504
|
-
})(),
|
|
22505
|
-
if (
|
|
22506
|
-
let e =
|
|
22507
|
-
|
|
22508
|
-
} else if (
|
|
22509
|
-
let e =
|
|
22510
|
-
l.has(t) ? l.set(t, l.get(t) + 1) : l.set(t, e.startAt ?? 1),
|
|
22504
|
+
})(), L = I ? C(I) : b, R = "", z = M(!1, !1, N, "sans-serif", p), B = L;
|
|
22505
|
+
if (d.bullet.type === "char") {
|
|
22506
|
+
let e = d.bullet, t = e.sizePct == null ? N : N * (e.sizePct / 100);
|
|
22507
|
+
R = O(e.char, e.fontFamily ?? ""), z = M(!1, !1, t, R === e.char ? k(e.fontFamily ?? null, p) : "sans-serif", p), B = e.color ? C(e.color) : L, l.clear();
|
|
22508
|
+
} else if (d.bullet.type === "autoNum") {
|
|
22509
|
+
let e = d.bullet, t = d.lvl;
|
|
22510
|
+
l.has(t) ? l.set(t, l.get(t) + 1) : l.set(t, e.startAt ?? 1), R = te(l.get(t), e.numType), z = M(!1, !1, N, "sans-serif", p), B = L;
|
|
22511
22511
|
} else l.clear();
|
|
22512
|
-
let
|
|
22513
|
-
for (let t = 0; t <
|
|
22514
|
-
let n =
|
|
22512
|
+
let V = D > 1 ? (i - _ - v - (D - 1) * A) / D : i - _ - v, H = n + _ + m, U = n + _ + m + g, W = V - m - h, G = P(e, d, T ? W : Infinity, y, b, o, m, j, ee, r, f, p), K = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * x * o * r, q = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * x * o * r;
|
|
22513
|
+
for (let t = 0; t < G.length; t++) {
|
|
22514
|
+
let n = G[t], r = t === 0, i = t === G.length - 1, a = 0;
|
|
22515
22515
|
for (let e of n.segments) e.sizePx > a && (a = e.sizePx);
|
|
22516
|
-
if (a === 0 && (a =
|
|
22517
|
-
e.font =
|
|
22516
|
+
if (a === 0 && (a = y), r && R) {
|
|
22517
|
+
e.font = z;
|
|
22518
22518
|
let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
|
|
22519
22519
|
n > a && (a = n);
|
|
22520
22520
|
}
|
|
22521
22521
|
let l;
|
|
22522
|
-
l =
|
|
22523
|
-
let
|
|
22522
|
+
l = d.spaceLine ? d.spaceLine.type === "pct" ? a * 1.2 * (d.spaceLine.val / 1e5) : d.spaceLine.val * x * o : a * 1.2;
|
|
22523
|
+
let f = l + (i ? q : 0), p = r && u > 0 ? K : 0, m = !w && r ? g : 0;
|
|
22524
22524
|
s.push({
|
|
22525
22525
|
line: n,
|
|
22526
|
-
linePx:
|
|
22526
|
+
linePx: f,
|
|
22527
22527
|
lineHeight: l,
|
|
22528
|
-
topGapPx:
|
|
22529
|
-
textXOffset:
|
|
22530
|
-
bulletLabel: r ?
|
|
22531
|
-
bulletFont:
|
|
22532
|
-
bulletColor:
|
|
22533
|
-
bulletX:
|
|
22534
|
-
textX:
|
|
22535
|
-
textMaxW:
|
|
22536
|
-
alignment:
|
|
22537
|
-
para:
|
|
22538
|
-
}), c +=
|
|
22528
|
+
topGapPx: p,
|
|
22529
|
+
textXOffset: m,
|
|
22530
|
+
bulletLabel: r ? R : "",
|
|
22531
|
+
bulletFont: z,
|
|
22532
|
+
bulletColor: B,
|
|
22533
|
+
bulletX: U,
|
|
22534
|
+
textX: H,
|
|
22535
|
+
textMaxW: W,
|
|
22536
|
+
alignment: d.alignment,
|
|
22537
|
+
para: d
|
|
22538
|
+
}), c += f + p;
|
|
22539
22539
|
}
|
|
22540
22540
|
}
|
|
22541
22541
|
return {
|
|
22542
22542
|
allLines: s,
|
|
22543
22543
|
totalHeight: c
|
|
22544
22544
|
};
|
|
22545
|
-
}, { allLines:
|
|
22545
|
+
}, { allLines: L, totalHeight: R } = I(1);
|
|
22546
22546
|
if (t.autoFit === "norm") {
|
|
22547
22547
|
let e = a - y - b;
|
|
22548
|
-
if (
|
|
22548
|
+
if (R > e && e > 0) {
|
|
22549
22549
|
let t = .1, n = 1;
|
|
22550
22550
|
for (let r = 0; r < 6; r++) {
|
|
22551
22551
|
let r = (t + n) / 2;
|
|
22552
|
-
|
|
22552
|
+
I(r).totalHeight <= e ? t = r : n = r;
|
|
22553
22553
|
}
|
|
22554
|
-
({allLines:
|
|
22554
|
+
({allLines: L, totalHeight: R} = I(t));
|
|
22555
22555
|
}
|
|
22556
22556
|
}
|
|
22557
|
-
let
|
|
22558
|
-
a === 0 &&
|
|
22559
|
-
let
|
|
22560
|
-
|
|
22561
|
-
let
|
|
22562
|
-
for (let t of
|
|
22557
|
+
let z = t.verticalAnchor ?? "t", B = r, H;
|
|
22558
|
+
a === 0 && z === "b" ? (H = y + R + b, B = r - H) : H = t.autoFit === "sp" ? Math.max(a, y + R + b) : a;
|
|
22559
|
+
let U, W = Math.max(0, H - y - b);
|
|
22560
|
+
U = z === "ctr" ? B + y + (W - R) / 2 : z === "b" ? B + H - b - R : B + y, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
22561
|
+
let G = U, K = D > 1 ? (i - _ - v - (D - 1) * A) / D + A : 0, q = Math.max(0, H - y - b), J = a === 0 || R <= q + .5, Y = D > 1 && !J ? Math.ceil(L.length / D) : L.length, X = 0, Z = 0;
|
|
22562
|
+
for (let t of L) {
|
|
22563
22563
|
let { line: s, linePx: l, lineHeight: u, topGapPx: d, textXOffset: f, bulletLabel: p, bulletFont: h, bulletColor: g, alignment: v } = t;
|
|
22564
|
-
D > 1 && X < D - 1 && Z >= Y && (X++, Z = 0,
|
|
22565
|
-
let y = X *
|
|
22564
|
+
D > 1 && X < D - 1 && Z >= Y && (X++, Z = 0, U = G), U += d, Z++;
|
|
22565
|
+
let y = X * K, b = t.textX + y, x = t.bulletX + y, w = t.textMaxW, T = 0, O = u * .8;
|
|
22566
22566
|
for (let t of s.segments) {
|
|
22567
22567
|
e.font = t.font;
|
|
22568
22568
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
22569
22569
|
T += t.text ? n.width + r * t.text.length : 0, n.actualBoundingBoxAscent > 0 && (O = Math.max(O, n.actualBoundingBoxAscent));
|
|
22570
22570
|
}
|
|
22571
|
-
let k =
|
|
22571
|
+
let k = U + O;
|
|
22572
22572
|
p && (e.font = h, e.fillStyle = g, e.fillText(p, x, k));
|
|
22573
22573
|
let A = b + f, j;
|
|
22574
22574
|
j = v === "ctr" ? A + (w - f - T) / 2 : v === "r" ? b + w - T : A;
|
|
@@ -22597,7 +22597,7 @@ function H(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
22597
22597
|
if (m && t.text && m({
|
|
22598
22598
|
text: t.text,
|
|
22599
22599
|
inShapeX: j - n,
|
|
22600
|
-
inShapeY:
|
|
22600
|
+
inShapeY: U - r,
|
|
22601
22601
|
w: p,
|
|
22602
22602
|
h: u,
|
|
22603
22603
|
fontSize: t.sizePx,
|
|
@@ -22637,7 +22637,7 @@ function H(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
22637
22637
|
m && t.text && m({
|
|
22638
22638
|
text: t.text,
|
|
22639
22639
|
inShapeX: l - n,
|
|
22640
|
-
inShapeY:
|
|
22640
|
+
inShapeY: U - r,
|
|
22641
22641
|
w: s,
|
|
22642
22642
|
h: u,
|
|
22643
22643
|
fontSize: t.sizePx,
|
|
@@ -22650,11 +22650,11 @@ function H(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
22650
22650
|
}), l += s;
|
|
22651
22651
|
}
|
|
22652
22652
|
}
|
|
22653
|
-
|
|
22653
|
+
U += l;
|
|
22654
22654
|
}
|
|
22655
22655
|
e.restore();
|
|
22656
22656
|
}
|
|
22657
|
-
async function
|
|
22657
|
+
async function H(e, t, n) {
|
|
22658
22658
|
try {
|
|
22659
22659
|
let r = await (await fetch(t.dataUrl)).blob(), i = await createImageBitmap(r);
|
|
22660
22660
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
@@ -22662,7 +22662,7 @@ async function U(e, t, n) {
|
|
|
22662
22662
|
if ((t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(a + s / 2, o + c / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(a + s / 2), -(o + c / 2))), t.clipAdjust != null) {
|
|
22663
22663
|
let n = Math.min(s, c), r = t.clipAdjust / 1e5 * n;
|
|
22664
22664
|
e.beginPath(), e.roundRect(a, o, s, c, r), e.clip();
|
|
22665
|
-
} else t.custGeom && t.custGeom.length > 0 && (
|
|
22665
|
+
} else t.custGeom && t.custGeom.length > 0 && (z(e, t.custGeom, a, o, s, c), e.clip());
|
|
22666
22666
|
let l = t.srcRect;
|
|
22667
22667
|
if (l && (l.l || l.t || l.r || l.b)) {
|
|
22668
22668
|
let t = i.width, n = i.height, r = Math.max(0, Math.min(1, l.l ?? 0)), u = Math.max(0, Math.min(1, l.t ?? 0)), d = Math.max(0, Math.min(1, l.r ?? 0)), f = Math.max(0, Math.min(1, l.b ?? 0)), p = r * t, m = u * n, h = Math.max(1, t - p - d * t), g = Math.max(1, n - m - f * n);
|
|
@@ -22671,7 +22671,7 @@ async function U(e, t, n) {
|
|
|
22671
22671
|
e.restore(), i.close();
|
|
22672
22672
|
} catch {}
|
|
22673
22673
|
}
|
|
22674
|
-
async function
|
|
22674
|
+
async function U(e, t, n, r, i) {
|
|
22675
22675
|
let a = S(t.x, n), o = S(t.y, n), s = S(t.width, n), c = S(t.height, n), u = !1;
|
|
22676
22676
|
if (t.posterPath && r) try {
|
|
22677
22677
|
let n = await r(t.posterPath), i = t.posterMimeType ? new Blob([n], { type: t.posterMimeType }) : n, l = await createImageBitmap(i);
|
|
@@ -22679,7 +22679,7 @@ async function W(e, t, n, r, i) {
|
|
|
22679
22679
|
} catch {}
|
|
22680
22680
|
u || (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), !i && l(e, a + s / 2, o + c / 2, s, c, "paused");
|
|
22681
22681
|
}
|
|
22682
|
-
function
|
|
22682
|
+
function W(e, t, n, r, i, a) {
|
|
22683
22683
|
let o = Math.max(.5, S(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
22684
22684
|
if (l === 0) return;
|
|
22685
22685
|
let u = -c / l, d = s / l, f;
|
|
@@ -22736,7 +22736,7 @@ function G(e, t, n, r, i, a) {
|
|
|
22736
22736
|
}
|
|
22737
22737
|
e.restore();
|
|
22738
22738
|
}
|
|
22739
|
-
function
|
|
22739
|
+
function G(e, t, n, r, i, a, o) {
|
|
22740
22740
|
if (i.type === "none") return;
|
|
22741
22741
|
let s = Math.max(.5, S(a.width, o)), c = i.w === "sm" ? 2 : i.w === "lg" ? 4 : 3, l = i.len === "sm" ? 2 : i.len === "lg" ? 4 : 3, u = s * c / 2, d = s * l, f = C(a.color);
|
|
22742
22742
|
switch (e.save(), e.translate(t, n), e.rotate(r), e.fillStyle = f, e.strokeStyle = f, e.lineWidth = s, e.setLineDash([]), e.beginPath(), i.type) {
|
|
@@ -22756,10 +22756,10 @@ function K(e, t, n, r, i, a, o) {
|
|
|
22756
22756
|
}
|
|
22757
22757
|
e.restore();
|
|
22758
22758
|
}
|
|
22759
|
-
function
|
|
22759
|
+
function K(e, t, n) {
|
|
22760
22760
|
o(e, t, n);
|
|
22761
22761
|
}
|
|
22762
|
-
function
|
|
22762
|
+
function q(e, t, n, r, i = {
|
|
22763
22763
|
themeMajorFont: null,
|
|
22764
22764
|
themeMinorFont: null
|
|
22765
22765
|
}) {
|
|
@@ -22777,7 +22777,7 @@ function te(e, t, n, r, i = {
|
|
|
22777
22777
|
let p = 0;
|
|
22778
22778
|
for (let e = 0; e < (a.rowSpan || 1); e++) p += c[o + e] ?? 0;
|
|
22779
22779
|
let m = w(a.fill);
|
|
22780
|
-
m && (e.fillStyle = m, e.fillRect(f, l, d, p)), a.textBody &&
|
|
22780
|
+
m && (e.fillStyle = m, e.fillRect(f, l, d, p)), a.textBody && V(e, a.textBody, f, l, d, p, n, null, 0, !1, !1, "#000000", r, i), e.save(), a.borderT && (K(e, a.borderT, n), e.beginPath(), e.moveTo(f, l), e.lineTo(f + d, l), e.stroke()), a.borderB && (K(e, a.borderB, n), e.beginPath(), e.moveTo(f, l + p), e.lineTo(f + d, l + p), e.stroke()), a.borderL && (K(e, a.borderL, n), e.beginPath(), e.moveTo(f, l), e.lineTo(f, l + p), e.stroke()), a.borderR && (K(e, a.borderR, n), e.beginPath(), e.moveTo(f + d, l), e.lineTo(f + d, l + p), e.stroke()), a.diagonalTL && (K(e, a.diagonalTL, n), e.beginPath(), e.moveTo(f, l), e.lineTo(f + d, l + p), e.stroke()), a.diagonalTR && (K(e, a.diagonalTR, n), e.beginPath(), e.moveTo(f + d, l), e.lineTo(f, l + p), e.stroke()), e.restore(), f += s[t] ?? 0;
|
|
22781
22781
|
}
|
|
22782
22782
|
l += d;
|
|
22783
22783
|
}
|
|
@@ -22793,12 +22793,12 @@ async function J(e, t, n, i, a = {}, o) {
|
|
|
22793
22793
|
themeMinorFont: a.minorFont ?? null,
|
|
22794
22794
|
themeHlinkColor: a.hlinkColor ?? null
|
|
22795
22795
|
};
|
|
22796
|
-
|
|
22796
|
+
ee(f, t.background, l, u);
|
|
22797
22797
|
let m = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", h = t.slideNumber;
|
|
22798
|
-
for (let e of t.elements) if (e.type === "shape")
|
|
22799
|
-
else if (e.type === "picture") await
|
|
22800
|
-
else if (e.type === "table")
|
|
22801
|
-
else if (e.type === "media") await
|
|
22798
|
+
for (let e of t.elements) if (e.type === "shape") R(f, e, c, m, h, p, o);
|
|
22799
|
+
else if (e.type === "picture") await H(f, e, c);
|
|
22800
|
+
else if (e.type === "table") q(f, e, c, h, p);
|
|
22801
|
+
else if (e.type === "media") await U(f, e, c, a.fetchMedia, a.skipMediaControls);
|
|
22802
22802
|
else if (e.type === "chart") {
|
|
22803
22803
|
let t = 12700 * c;
|
|
22804
22804
|
r(f, {
|