ai-ppt-edit-component 0.0.26 → 0.0.27
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/es/assets/index2.css +1 -1
- package/es/index.mjs +147 -136
- package/lib/assets/index2.css +1 -1
- package/lib/index.js +17 -17
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -2907,6 +2907,9 @@ var Aa = pe("snapshot", {
|
|
|
2907
2907
|
};
|
|
2908
2908
|
await ka.snapshots.add(t), this.setSnapshotCursor(0), this.setSnapshotLength(1);
|
|
2909
2909
|
},
|
|
2910
|
+
async clearSnapshots() {
|
|
2911
|
+
await ka.snapshots.clear(), this.setSnapshotCursor(-1), this.setSnapshotLength(0);
|
|
2912
|
+
},
|
|
2910
2913
|
async addSnapshot() {
|
|
2911
2914
|
let e = Ta(Qr), t = await ka.snapshots.orderBy("id").keys(), n = [];
|
|
2912
2915
|
this.snapshotCursor >= 0 && this.snapshotCursor < t.length - 1 && (n = t.slice(this.snapshotCursor + 1));
|
|
@@ -7331,41 +7334,49 @@ var zo = () => {
|
|
|
7331
7334
|
}), Rs = async (e) => {
|
|
7332
7335
|
for (let t of e) if (t?.elements) for (let e of t.elements) e.type === "image" && e.src && (e.src = await Ls(e.src)), e.type === "shape" && e.pattern && (e.pattern = await Ls(e.pattern));
|
|
7333
7336
|
}, zs = () => {
|
|
7334
|
-
let e = K(), { theme:
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7337
|
+
let e = K(), t = G(), n = Na(), { theme: r } = V(K()), { addHistorySnapshot: i } = Xa(), { addSlidesFromData: a } = Za(), { isEmptySlide: o } = ko(), { t: s } = W(), c = C(!1), l = async (r) => {
|
|
7338
|
+
t.setActiveElementIdList([]), t.updateSelectedSlidesIndex([]), e.updateSlideIndex(0), e.setSlides(JSON.parse(JSON.stringify(r))), await n.clearSnapshots(), i();
|
|
7339
|
+
}, u = async (t, n = !0) => {
|
|
7340
|
+
let { title: r, width: c, height: u, theme: d, slides: f } = t;
|
|
7341
|
+
if (!Array.isArray(f)) {
|
|
7342
|
+
Ai.error(s("IMPORT.FILE_PARSE_FAIL"));
|
|
7343
|
+
return;
|
|
7344
|
+
}
|
|
7345
|
+
r && e.setTitle(r), c && e.setViewportSize(c), c && u && e.setViewportRatio(u / c), d && e.setTheme(d), n ? await l(f) : o.value ? (e.setSlides(JSON.parse(JSON.stringify(f))), i()) : a(f);
|
|
7346
|
+
}, d = async (e) => {
|
|
7338
7347
|
try {
|
|
7339
|
-
|
|
7348
|
+
await u(JSON.parse(e), !0);
|
|
7340
7349
|
} catch {
|
|
7341
|
-
Ai.error(
|
|
7350
|
+
Ai.error(s("IMPORT.FILE_PARSE_FAIL"));
|
|
7342
7351
|
}
|
|
7343
|
-
},
|
|
7344
|
-
let n = e[0]
|
|
7352
|
+
}, f = (e, t = !0) => {
|
|
7353
|
+
let n = e[0];
|
|
7354
|
+
if (!n) return;
|
|
7355
|
+
let r = new FileReader();
|
|
7345
7356
|
r.addEventListener("load", () => {
|
|
7346
|
-
|
|
7347
|
-
s(
|
|
7348
|
-
}
|
|
7349
|
-
Ai.error(a("IMPORT.FILE_PARSE_FAIL"));
|
|
7350
|
-
}
|
|
7357
|
+
u(JSON.parse(r.result), t).catch(() => {
|
|
7358
|
+
Ai.error(s("IMPORT.FILE_PARSE_FAIL"));
|
|
7359
|
+
});
|
|
7351
7360
|
}), r.readAsText(n);
|
|
7352
|
-
},
|
|
7353
|
-
let n = e[0]
|
|
7361
|
+
}, p = (e, t = !0) => {
|
|
7362
|
+
let n = e[0];
|
|
7363
|
+
if (!n) return;
|
|
7364
|
+
let r = new FileReader();
|
|
7354
7365
|
r.addEventListener("load", () => {
|
|
7355
7366
|
try {
|
|
7356
|
-
|
|
7367
|
+
u(JSON.parse(eo(r.result)), t);
|
|
7357
7368
|
} catch {
|
|
7358
|
-
Ai.error(
|
|
7369
|
+
Ai.error(s("IMPORT.FILE_PARSE_FAIL"));
|
|
7359
7370
|
}
|
|
7360
7371
|
}), r.readAsText(n);
|
|
7361
|
-
},
|
|
7372
|
+
}, m = (e, t) => {
|
|
7362
7373
|
let { start: n, end: r } = e, i = t * Math.PI / 180, a = (n[0] + r[0]) / 2, o = (n[1] + r[1]) / 2, s = n[0] - a, c = n[1] - o, l = r[0] - a, u = r[1] - o, d = Math.cos(i), f = Math.sin(i), p = s * d - c * f, m = s * f + c * d, h = l * d - u * f, g = l * f + u * d, _ = p + a, v = m + o, y = h + a, b = g + o, x = Math.min(n[0], r[0]), S = Math.min(n[1], r[1]), C = Math.min(_, y), w = Math.min(v, b), T = _ - C, E = v - w, D = y - C, O = b - w;
|
|
7363
7374
|
return {
|
|
7364
7375
|
start: [T, E],
|
|
7365
7376
|
end: [D, O],
|
|
7366
7377
|
offset: [C - x, w - S]
|
|
7367
7378
|
};
|
|
7368
|
-
},
|
|
7379
|
+
}, h = (e, t) => {
|
|
7369
7380
|
let n = [0, 0], r = [0, 0];
|
|
7370
7381
|
!e.isFlipV && !e.isFlipH ? (n = [0, 0], r = [e.width, e.height]) : e.isFlipV && e.isFlipH ? (n = [e.width, e.height], r = [0, 0]) : e.isFlipV && !e.isFlipH ? (n = [0, e.height], r = [e.width, 0]) : (n = [e.width, 0], r = [0, e.height]);
|
|
7371
7382
|
let i = {
|
|
@@ -7381,7 +7392,7 @@ var zo = () => {
|
|
|
7381
7392
|
points: ["", /straightConnector/.test(e.shapType) ? "arrow" : ""]
|
|
7382
7393
|
};
|
|
7383
7394
|
if (e.rotate) {
|
|
7384
|
-
let { start: t, end: n, offset: r } =
|
|
7395
|
+
let { start: t, end: n, offset: r } = m(i, e.rotate);
|
|
7385
7396
|
i.start = t, i.end = n, i.left += r[0], i.top += r[1];
|
|
7386
7397
|
}
|
|
7387
7398
|
if (/bentConnector/.test(e.shapType) && (i.broken2 = [Math.abs(i.start[0] - i.end[0]) / 2, Math.abs(i.start[1] - i.end[1]) / 2]), /curvedConnector/.test(e.shapType)) {
|
|
@@ -7389,13 +7400,13 @@ var zo = () => {
|
|
|
7389
7400
|
i.cubic = [e, e];
|
|
7390
7401
|
}
|
|
7391
7402
|
return i;
|
|
7392
|
-
},
|
|
7403
|
+
}, g = (e, t) => {
|
|
7393
7404
|
let n = Math.min(...e.map((e) => e.left)), r = Math.max(...e.map((e) => e.left + e.width)), i = Math.min(...e.map((e) => e.top)), a = Math.max(...e.map((e) => e.top + e.height)), o = (n + r) / 2, s = (i + a) / 2;
|
|
7394
7405
|
return e.map((e) => {
|
|
7395
7406
|
let n = { ...e };
|
|
7396
7407
|
return t === "y" && (n.left = 2 * o - e.left - e.width), t === "x" && (n.top = 2 * s - e.top - e.height), n;
|
|
7397
7408
|
});
|
|
7398
|
-
},
|
|
7409
|
+
}, _ = (e, t, n, r, i, a, o) => {
|
|
7399
7410
|
let s = Math.PI / 180 * o, c = e + n / 2, l = t + r / 2, u = i - n / 2, d = a - r / 2, f = u * Math.cos(s) + d * Math.sin(s), p = -u * Math.sin(s) + d * Math.cos(s);
|
|
7400
7411
|
return {
|
|
7401
7412
|
x: c + f,
|
|
@@ -7403,63 +7414,63 @@ var zo = () => {
|
|
|
7403
7414
|
};
|
|
7404
7415
|
};
|
|
7405
7416
|
return {
|
|
7406
|
-
importSpecificFile:
|
|
7407
|
-
importJSON:
|
|
7408
|
-
importPPTXFile: (
|
|
7409
|
-
let { cover:
|
|
7417
|
+
importSpecificFile: p,
|
|
7418
|
+
importJSON: f,
|
|
7419
|
+
importPPTXFile: (t, n) => {
|
|
7420
|
+
let { cover: u, fixedViewport: d } = {
|
|
7410
7421
|
cover: !1,
|
|
7411
7422
|
fixedViewport: !1,
|
|
7412
|
-
...
|
|
7413
|
-
},
|
|
7414
|
-
if (!
|
|
7415
|
-
|
|
7416
|
-
let
|
|
7417
|
-
for (let e of go)
|
|
7418
|
-
let
|
|
7419
|
-
|
|
7420
|
-
let
|
|
7423
|
+
...n
|
|
7424
|
+
}, f = t[0];
|
|
7425
|
+
if (!f) return;
|
|
7426
|
+
c.value = !0;
|
|
7427
|
+
let p = [];
|
|
7428
|
+
for (let e of go) p.push(...e.children);
|
|
7429
|
+
let m = new FileReader();
|
|
7430
|
+
m.onload = async (t) => {
|
|
7431
|
+
let n = null;
|
|
7421
7432
|
try {
|
|
7422
|
-
|
|
7433
|
+
n = await Be(t.target.result);
|
|
7423
7434
|
} catch {
|
|
7424
|
-
|
|
7435
|
+
c.value = !1, Ai.error(s("IMPORT.FILE_PARSE_FAIL"));
|
|
7425
7436
|
return;
|
|
7426
7437
|
}
|
|
7427
|
-
let
|
|
7428
|
-
|
|
7429
|
-
let
|
|
7430
|
-
for (let e of
|
|
7431
|
-
let { type:
|
|
7432
|
-
i =
|
|
7438
|
+
let f = 96 / 72, m = n.size.width;
|
|
7439
|
+
d ? f = 1e3 / m : e.setViewportSize(m * f), e.setTheme({ themeColors: n.themeColors });
|
|
7440
|
+
let v = [];
|
|
7441
|
+
for (let e of n.slides) {
|
|
7442
|
+
let { type: t, value: n } = e.fill, i;
|
|
7443
|
+
i = t === "image" ? {
|
|
7433
7444
|
type: "image",
|
|
7434
7445
|
image: {
|
|
7435
|
-
src:
|
|
7446
|
+
src: n.picBase64,
|
|
7436
7447
|
size: "cover"
|
|
7437
7448
|
}
|
|
7438
|
-
} :
|
|
7449
|
+
} : t === "gradient" ? {
|
|
7439
7450
|
type: "gradient",
|
|
7440
7451
|
gradient: {
|
|
7441
|
-
type:
|
|
7442
|
-
colors:
|
|
7452
|
+
type: n.path === "line" ? "linear" : "radial",
|
|
7453
|
+
colors: n.colors.map((e) => ({
|
|
7443
7454
|
...e,
|
|
7444
7455
|
pos: parseInt(e.pos)
|
|
7445
7456
|
})),
|
|
7446
|
-
rotate:
|
|
7457
|
+
rotate: n.rot + 90
|
|
7447
7458
|
}
|
|
7448
7459
|
} : {
|
|
7449
7460
|
type: "solid",
|
|
7450
|
-
color:
|
|
7461
|
+
color: n || "#fff"
|
|
7451
7462
|
};
|
|
7452
|
-
let
|
|
7463
|
+
let a = {
|
|
7453
7464
|
id: H(10),
|
|
7454
7465
|
elements: [],
|
|
7455
7466
|
background: i,
|
|
7456
7467
|
remark: e.note || ""
|
|
7457
|
-
},
|
|
7458
|
-
let
|
|
7459
|
-
for (let e of
|
|
7460
|
-
let
|
|
7461
|
-
if (e.width *=
|
|
7462
|
-
let
|
|
7468
|
+
}, o = (e) => {
|
|
7469
|
+
let t = (Array.isArray(e) ? e : []).filter((e) => e && typeof e == "object").sort((e, t) => (e.order || 0) - (t.order || 0));
|
|
7470
|
+
for (let e of t) {
|
|
7471
|
+
let t = e.width || 1, n = e.height || 1, i = e.left, c = e.top;
|
|
7472
|
+
if (e.width *= f, e.height *= f, e.left *= f, e.top *= f, e.type === "text") {
|
|
7473
|
+
let t = {
|
|
7463
7474
|
type: "text",
|
|
7464
7475
|
id: H(10),
|
|
7465
7476
|
width: e.width,
|
|
@@ -7467,24 +7478,24 @@ var zo = () => {
|
|
|
7467
7478
|
left: e.left,
|
|
7468
7479
|
top: e.top,
|
|
7469
7480
|
rotate: e.rotate,
|
|
7470
|
-
defaultFontName:
|
|
7471
|
-
defaultColor:
|
|
7472
|
-
content: Ns(e.content,
|
|
7481
|
+
defaultFontName: r.value.fontName,
|
|
7482
|
+
defaultColor: r.value.fontColor,
|
|
7483
|
+
content: Ns(e.content, f),
|
|
7473
7484
|
lineHeight: 1,
|
|
7474
7485
|
outline: {
|
|
7475
7486
|
color: e.borderColor,
|
|
7476
|
-
width: +(e.borderWidth *
|
|
7487
|
+
width: +(e.borderWidth * f).toFixed(2),
|
|
7477
7488
|
style: e.borderType
|
|
7478
7489
|
},
|
|
7479
7490
|
fill: "",
|
|
7480
7491
|
vertical: e.isVertical
|
|
7481
7492
|
};
|
|
7482
|
-
e.shadow && (
|
|
7483
|
-
h: e.shadow.h *
|
|
7484
|
-
v: e.shadow.v *
|
|
7485
|
-
blur: e.shadow.blur *
|
|
7493
|
+
e.shadow && (t.shadow = {
|
|
7494
|
+
h: e.shadow.h * f,
|
|
7495
|
+
v: e.shadow.v * f,
|
|
7496
|
+
blur: e.shadow.blur * f,
|
|
7486
7497
|
color: e.shadow.color
|
|
7487
|
-
}),
|
|
7498
|
+
}), a.elements.push(t);
|
|
7488
7499
|
} else if (e.type === "image") {
|
|
7489
7500
|
let t = {
|
|
7490
7501
|
type: "image",
|
|
@@ -7501,7 +7512,7 @@ var zo = () => {
|
|
|
7501
7512
|
};
|
|
7502
7513
|
e.borderWidth && (t.outline = {
|
|
7503
7514
|
color: e.borderColor,
|
|
7504
|
-
width: +(e.borderWidth *
|
|
7515
|
+
width: +(e.borderWidth * f).toFixed(2),
|
|
7505
7516
|
style: e.borderType
|
|
7506
7517
|
});
|
|
7507
7518
|
let n = [
|
|
@@ -7522,8 +7533,8 @@ var zo = () => {
|
|
|
7522
7533
|
} : e.geom && n.includes(e.geom) && (t.clip = {
|
|
7523
7534
|
shape: e.geom,
|
|
7524
7535
|
range: [[0, 0], [100, 100]]
|
|
7525
|
-
}),
|
|
7526
|
-
} else if (e.type === "math")
|
|
7536
|
+
}), a.elements.push(t);
|
|
7537
|
+
} else if (e.type === "math") a.elements.push({
|
|
7527
7538
|
type: "image",
|
|
7528
7539
|
id: H(10),
|
|
7529
7540
|
src: e.picBase64,
|
|
@@ -7534,7 +7545,7 @@ var zo = () => {
|
|
|
7534
7545
|
fixedRatio: !0,
|
|
7535
7546
|
rotate: 0
|
|
7536
7547
|
});
|
|
7537
|
-
else if (e.type === "audio")
|
|
7548
|
+
else if (e.type === "audio") a.elements.push({
|
|
7538
7549
|
type: "audio",
|
|
7539
7550
|
id: H(10),
|
|
7540
7551
|
src: e.blob,
|
|
@@ -7544,11 +7555,11 @@ var zo = () => {
|
|
|
7544
7555
|
top: e.top,
|
|
7545
7556
|
rotate: 0,
|
|
7546
7557
|
fixedRatio: !1,
|
|
7547
|
-
color:
|
|
7558
|
+
color: r.value.themeColors[0],
|
|
7548
7559
|
loop: !1,
|
|
7549
7560
|
autoplay: !1
|
|
7550
7561
|
});
|
|
7551
|
-
else if (e.type === "video")
|
|
7562
|
+
else if (e.type === "video") a.elements.push({
|
|
7552
7563
|
type: "video",
|
|
7553
7564
|
id: H(10),
|
|
7554
7565
|
src: e.blob || e.src,
|
|
@@ -7560,10 +7571,10 @@ var zo = () => {
|
|
|
7560
7571
|
autoplay: !1
|
|
7561
7572
|
});
|
|
7562
7573
|
else if (e.type === "shape") if (e.shapType === "line" || /Connector/.test(e.shapType)) {
|
|
7563
|
-
let t =
|
|
7564
|
-
|
|
7574
|
+
let t = h(e, f);
|
|
7575
|
+
a.elements.push(t);
|
|
7565
7576
|
} else {
|
|
7566
|
-
let i =
|
|
7577
|
+
let i = p.find((t) => t.pptxShapeType === e.shapType), o = {
|
|
7567
7578
|
mid: "middle",
|
|
7568
7579
|
down: "bottom",
|
|
7569
7580
|
up: "top"
|
|
@@ -7590,22 +7601,22 @@ var zo = () => {
|
|
|
7590
7601
|
rotate: e.rotate,
|
|
7591
7602
|
outline: {
|
|
7592
7603
|
color: e.borderColor,
|
|
7593
|
-
width: +(e.borderWidth *
|
|
7604
|
+
width: +(e.borderWidth * f).toFixed(2),
|
|
7594
7605
|
style: e.borderType
|
|
7595
7606
|
},
|
|
7596
7607
|
text: {
|
|
7597
|
-
content: Ns(e.content,
|
|
7598
|
-
defaultFontName:
|
|
7599
|
-
defaultColor:
|
|
7600
|
-
align:
|
|
7608
|
+
content: Ns(e.content, f),
|
|
7609
|
+
defaultFontName: r.value.fontName,
|
|
7610
|
+
defaultColor: r.value.fontColor,
|
|
7611
|
+
align: o[e.vAlign] || "middle"
|
|
7601
7612
|
},
|
|
7602
7613
|
flipH: e.isFlipH,
|
|
7603
7614
|
flipV: e.isFlipV
|
|
7604
7615
|
};
|
|
7605
7616
|
if (e.shadow && (u.shadow = {
|
|
7606
|
-
h: e.shadow.h *
|
|
7607
|
-
v: e.shadow.v *
|
|
7608
|
-
blur: e.shadow.blur *
|
|
7617
|
+
h: e.shadow.h * f,
|
|
7618
|
+
v: e.shadow.v * f,
|
|
7619
|
+
blur: e.shadow.blur * f,
|
|
7609
7620
|
color: e.shadow.color
|
|
7610
7621
|
}), i) {
|
|
7611
7622
|
if (u.path = i.path, u.viewBox = i.viewBox, i.pathFormula) {
|
|
@@ -7614,31 +7625,31 @@ var zo = () => {
|
|
|
7614
7625
|
"editable" in t && t.editable ? (u.path = t.formula(e.width, e.height, t.defaultValue), u.keypoints = t.defaultValue) : u.path = t.formula(e.width, e.height);
|
|
7615
7626
|
}
|
|
7616
7627
|
} else if (e.path && e.path.indexOf("NaN") === -1) {
|
|
7617
|
-
let { maxX:
|
|
7618
|
-
u.path = e.path,
|
|
7628
|
+
let { maxX: r, maxY: i } = Ts(e.path);
|
|
7629
|
+
u.path = e.path, r / i > t / n ? u.viewBox = [r, r * n / t] : u.viewBox = [i * t / n, i];
|
|
7619
7630
|
}
|
|
7620
7631
|
if (e.shapType === "custom") {
|
|
7621
7632
|
e.path.indexOf("NaN") === -1 ? (u.special = !0, u.path = e.path) : (u.width === 0 && (u.width = .1), u.height === 0 && (u.height = .1), u.path = e.path.replace(/NaN/g, "0"));
|
|
7622
|
-
let { maxX:
|
|
7623
|
-
|
|
7633
|
+
let { maxX: r, maxY: i } = Ts(u.path);
|
|
7634
|
+
r / i > t / n ? u.viewBox = [r, r * n / t] : u.viewBox = [i * t / n, i];
|
|
7624
7635
|
}
|
|
7625
|
-
u.path &&
|
|
7636
|
+
u.path && a.elements.push(u);
|
|
7626
7637
|
}
|
|
7627
7638
|
else if (e.type === "table") {
|
|
7628
|
-
let
|
|
7629
|
-
fontname:
|
|
7630
|
-
color:
|
|
7631
|
-
},
|
|
7632
|
-
for (let
|
|
7633
|
-
let
|
|
7634
|
-
for (let a = 0; a <
|
|
7635
|
-
let
|
|
7636
|
-
o.innerHTML =
|
|
7637
|
-
let s = o.querySelector("p")?.style.textAlign || "left", c = o.querySelector("span"), l = c?.style.fontSize ? (parseInt(c?.style.fontSize) *
|
|
7638
|
-
|
|
7639
|
+
let t = e.data.length, n = e.data[0].length, i = {
|
|
7640
|
+
fontname: r.value.fontName,
|
|
7641
|
+
color: r.value.fontColor
|
|
7642
|
+
}, o = [];
|
|
7643
|
+
for (let r = 0; r < t; r++) {
|
|
7644
|
+
let t = [];
|
|
7645
|
+
for (let a = 0; a < n; a++) {
|
|
7646
|
+
let n = e.data[r][a], o = document.createElement("div");
|
|
7647
|
+
o.innerHTML = n.text;
|
|
7648
|
+
let s = o.querySelector("p")?.style.textAlign || "left", c = o.querySelector("span"), l = c?.style.fontSize ? (parseInt(c?.style.fontSize) * f).toFixed(1) + "px" : "", u = c?.style.fontFamily || "", d = c?.style.color || n.fontColor;
|
|
7649
|
+
t.push({
|
|
7639
7650
|
id: H(10),
|
|
7640
|
-
colspan:
|
|
7641
|
-
rowspan:
|
|
7651
|
+
colspan: n.colSpan || 1,
|
|
7652
|
+
rowspan: n.rowSpan || 1,
|
|
7642
7653
|
text: o.innerText,
|
|
7643
7654
|
style: {
|
|
7644
7655
|
...i,
|
|
@@ -7649,16 +7660,16 @@ var zo = () => {
|
|
|
7649
7660
|
].includes(s) ? s : "left",
|
|
7650
7661
|
fontsize: l,
|
|
7651
7662
|
fontname: u,
|
|
7652
|
-
color:
|
|
7653
|
-
bold:
|
|
7654
|
-
backcolor:
|
|
7663
|
+
color: d,
|
|
7664
|
+
bold: n.fontBold,
|
|
7665
|
+
backcolor: n.fillColor
|
|
7655
7666
|
}
|
|
7656
7667
|
}), o = null;
|
|
7657
7668
|
}
|
|
7658
|
-
|
|
7669
|
+
o.push(t);
|
|
7659
7670
|
}
|
|
7660
|
-
let s = e.colWidths.reduce((e, t) => e + t, 0), c = e.colWidths.map((e) => e / s), l = e.data[0][0], u = l.borders.top || l.borders.bottom || e.borders.top || e.borders.bottom || l.borders.left || l.borders.right || e.borders.left || e.borders.right,
|
|
7661
|
-
|
|
7671
|
+
let s = e.colWidths.reduce((e, t) => e + t, 0), c = e.colWidths.map((e) => e / s), l = e.data[0][0], u = l.borders.top || l.borders.bottom || e.borders.top || e.borders.bottom || l.borders.left || l.borders.right || e.borders.left || e.borders.right, d = u?.borderWidth || 0, p = u?.borderType || "solid", m = u?.borderColor || "#eeece1";
|
|
7672
|
+
a.elements.push({
|
|
7662
7673
|
type: "table",
|
|
7663
7674
|
id: H(10),
|
|
7664
7675
|
width: e.width,
|
|
@@ -7667,34 +7678,34 @@ var zo = () => {
|
|
|
7667
7678
|
top: e.top,
|
|
7668
7679
|
colWidths: c,
|
|
7669
7680
|
rotate: 0,
|
|
7670
|
-
data:
|
|
7681
|
+
data: o,
|
|
7671
7682
|
outline: {
|
|
7672
|
-
width: +(
|
|
7683
|
+
width: +(d * f || 2).toFixed(2),
|
|
7673
7684
|
style: p,
|
|
7674
7685
|
color: m
|
|
7675
7686
|
},
|
|
7676
|
-
cellMinHeight: e.rowHeights[0] ? e.rowHeights[0] *
|
|
7687
|
+
cellMinHeight: e.rowHeights[0] ? e.rowHeights[0] * f : 36
|
|
7677
7688
|
});
|
|
7678
7689
|
} else if (e.type === "chart") {
|
|
7679
|
-
let
|
|
7680
|
-
if (e.chartType === "scatterChart" || e.chartType === "bubbleChart")
|
|
7690
|
+
let t, n, i;
|
|
7691
|
+
if (e.chartType === "scatterChart" || e.chartType === "bubbleChart") t = e.data[0].map((e, t) => s("CHART.DEFAULT.COORD", { index: t + 1 })), n = ["X", "Y"], i = e.data;
|
|
7681
7692
|
else {
|
|
7682
|
-
let
|
|
7683
|
-
|
|
7693
|
+
let r = e.data;
|
|
7694
|
+
t = Object.values(r[0].xlabels), n = r.map((e) => e.key), i = r.map((e) => e.values.map((e) => e.y));
|
|
7684
7695
|
}
|
|
7685
|
-
let
|
|
7696
|
+
let o = {}, c = "bar";
|
|
7686
7697
|
switch (e.chartType) {
|
|
7687
7698
|
case "barChart":
|
|
7688
7699
|
case "bar3DChart":
|
|
7689
|
-
c = "bar", e.barDir === "bar" && (c = "column"), (e.grouping === "stacked" || e.grouping === "percentStacked") && (
|
|
7700
|
+
c = "bar", e.barDir === "bar" && (c = "column"), (e.grouping === "stacked" || e.grouping === "percentStacked") && (o.stack = !0);
|
|
7690
7701
|
break;
|
|
7691
7702
|
case "lineChart":
|
|
7692
7703
|
case "line3DChart":
|
|
7693
|
-
(e.grouping === "stacked" || e.grouping === "percentStacked") && (
|
|
7704
|
+
(e.grouping === "stacked" || e.grouping === "percentStacked") && (o.stack = !0), c = "line";
|
|
7694
7705
|
break;
|
|
7695
7706
|
case "areaChart":
|
|
7696
7707
|
case "area3DChart":
|
|
7697
|
-
(e.grouping === "stacked" || e.grouping === "percentStacked") && (
|
|
7708
|
+
(e.grouping === "stacked" || e.grouping === "percentStacked") && (o.stack = !0), c = "area";
|
|
7698
7709
|
break;
|
|
7699
7710
|
case "scatterChart":
|
|
7700
7711
|
case "bubbleChart":
|
|
@@ -7712,7 +7723,7 @@ var zo = () => {
|
|
|
7712
7723
|
break;
|
|
7713
7724
|
default:
|
|
7714
7725
|
}
|
|
7715
|
-
|
|
7726
|
+
a.elements.push({
|
|
7716
7727
|
type: "chart",
|
|
7717
7728
|
id: H(10),
|
|
7718
7729
|
chartType: c,
|
|
@@ -7721,44 +7732,44 @@ var zo = () => {
|
|
|
7721
7732
|
left: e.left,
|
|
7722
7733
|
top: e.top,
|
|
7723
7734
|
rotate: 0,
|
|
7724
|
-
themeColors: e.colors.length ? e.colors :
|
|
7725
|
-
textColor:
|
|
7735
|
+
themeColors: e.colors.length ? e.colors : r.value.themeColors,
|
|
7736
|
+
textColor: r.value.fontColor,
|
|
7726
7737
|
data: {
|
|
7727
|
-
labels:
|
|
7728
|
-
legends:
|
|
7738
|
+
labels: t,
|
|
7739
|
+
legends: n,
|
|
7729
7740
|
series: i
|
|
7730
7741
|
},
|
|
7731
|
-
options:
|
|
7742
|
+
options: o
|
|
7732
7743
|
});
|
|
7733
7744
|
} else if (e.type === "group") {
|
|
7734
|
-
let
|
|
7735
|
-
let a =
|
|
7745
|
+
let r = e.elements.map((r) => {
|
|
7746
|
+
let a = r.left + i, o = r.top + c;
|
|
7736
7747
|
if (e.rotate) {
|
|
7737
|
-
let { x: s, y: l } =
|
|
7748
|
+
let { x: s, y: l } = _(i, c, t, n, r.left, r.top, e.rotate);
|
|
7738
7749
|
a = s, o = l;
|
|
7739
7750
|
}
|
|
7740
7751
|
let s = {
|
|
7741
|
-
...
|
|
7752
|
+
...r,
|
|
7742
7753
|
left: a,
|
|
7743
7754
|
top: o
|
|
7744
7755
|
};
|
|
7745
7756
|
return e.isFlipH && "isFlipH" in s && (s.isFlipH = !0), e.isFlipV && "isFlipV" in s && (s.isFlipV = !0), s;
|
|
7746
7757
|
});
|
|
7747
|
-
e.isFlipH && (
|
|
7748
|
-
} else e.type === "diagram" &&
|
|
7758
|
+
e.isFlipH && (r = g(r, "y")), e.isFlipV && (r = g(r, "x")), o(r);
|
|
7759
|
+
} else e.type === "diagram" && o(e.elements.map((e) => ({
|
|
7749
7760
|
...e,
|
|
7750
7761
|
left: e.left + i,
|
|
7751
7762
|
top: e.top + c
|
|
7752
7763
|
})));
|
|
7753
7764
|
}
|
|
7754
7765
|
};
|
|
7755
|
-
|
|
7766
|
+
o([...Array.isArray(e.elements) ? e.elements : [], ...Array.isArray(e.layoutElements) ? e.layoutElements : []]), a.elements = Ps(a.elements), v.push(a);
|
|
7756
7767
|
}
|
|
7757
|
-
await Rs(
|
|
7758
|
-
},
|
|
7768
|
+
await Rs(v), u ? await l(v) : o.value ? (e.setSlides(v), i()) : a(v), c.value = !1;
|
|
7769
|
+
}, m.readAsArrayBuffer(f);
|
|
7759
7770
|
},
|
|
7760
|
-
importJSONStr:
|
|
7761
|
-
importing:
|
|
7771
|
+
importJSONStr: d,
|
|
7772
|
+
importing: c
|
|
7762
7773
|
};
|
|
7763
7774
|
}, Bs = { class: "hotkey-doc" }, Vs = { class: "title" }, Hs = { class: "label ppt-ellipsis-oneline" }, Us = { class: "value" }, Ws = {
|
|
7764
7775
|
key: 1,
|
|
@@ -8170,7 +8181,7 @@ var zo = () => {
|
|
|
8170
8181
|
class: "import-block",
|
|
8171
8182
|
accept: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
8172
8183
|
onChange: r[0] ||= (e) => {
|
|
8173
|
-
M(v)(e), E.value = !1;
|
|
8184
|
+
M(v)(e, { cover: !0 }), E.value = !1;
|
|
8174
8185
|
}
|
|
8175
8186
|
}, {
|
|
8176
8187
|
default: L(() => [
|
|
@@ -8355,7 +8366,7 @@ var zo = () => {
|
|
|
8355
8366
|
]);
|
|
8356
8367
|
};
|
|
8357
8368
|
}
|
|
8358
|
-
}, [["__scopeId", "data-v-
|
|
8369
|
+
}, [["__scopeId", "data-v-b963ae43"]]), Ec = Symbol(), Dc = Symbol(), Oc = () => {
|
|
8359
8370
|
let e = window.getSelection();
|
|
8360
8371
|
e && e.removeAllRanges();
|
|
8361
8372
|
}, kc = (e) => {
|