ai-ppt-edit-component 0.0.21 → 0.0.23
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/index.mjs +120 -79
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -6682,19 +6682,60 @@ var zo = () => {
|
|
|
6682
6682
|
for (e = Os(e); l < e.length;) n = e.charCodeAt(l++), r = e.charCodeAt(l++), i = e.charCodeAt(l++), a = n >> 2, o = (n & 3) << 4 | r >> 4, s = (r & 15) << 2 | i >> 6, c = i & 63, isNaN(r) ? s = c = 64 : isNaN(i) && (c = 64), t = t + Es.charAt(a) + Es.charAt(o) + Es.charAt(s) + Es.charAt(c);
|
|
6683
6683
|
return t;
|
|
6684
6684
|
}, As = (e) => Ds + ks(new XMLSerializer().serializeToString(e)), js = "/api/proxy", Ms = () => {
|
|
6685
|
-
let { slides: e, theme: t, viewportRatio: n, title: i, viewportSize: a } = V(K()), o = r(() => 96 * (a.value / 960)), s = r(() => 96 / 72 * (a.value / 960)), c = C(!1), { t: l } = W()
|
|
6686
|
-
|
|
6685
|
+
let { slides: e, theme: t, viewportRatio: n, title: i, viewportSize: a } = V(K()), o = r(() => 96 * (a.value / 960)), s = r(() => 96 / 72 * (a.value / 960)), c = C(!1), { t: l } = W(), u = {
|
|
6686
|
+
Msyh: "微软雅黑",
|
|
6687
|
+
"Microsoft YaHei": "微软雅黑",
|
|
6688
|
+
"Microsoft YaHei UI": "微软雅黑",
|
|
6689
|
+
SourceHanSans: "微软雅黑",
|
|
6690
|
+
SourceHanSerif: "宋体",
|
|
6691
|
+
FangZhengHeiTi: "黑体",
|
|
6692
|
+
FangZhengKaiTi: "楷体",
|
|
6693
|
+
FangZhengShuSong: "宋体",
|
|
6694
|
+
FangZhengFangSong: "仿宋",
|
|
6695
|
+
AlibabaPuHuiTi: "微软雅黑",
|
|
6696
|
+
ZhuQueFangSong: "仿宋",
|
|
6697
|
+
LXGWWenKai: "楷体",
|
|
6698
|
+
WenDingPLKaiTi: "楷体",
|
|
6699
|
+
DeYiHei: "黑体",
|
|
6700
|
+
MiSans: "微软雅黑",
|
|
6701
|
+
CangerXiaowanzi: "微软雅黑",
|
|
6702
|
+
YousheTitleBlack: "黑体",
|
|
6703
|
+
FengguangMingrui: "黑体",
|
|
6704
|
+
ShetuModernSquare: "黑体",
|
|
6705
|
+
ZcoolHappy: "微软雅黑",
|
|
6706
|
+
ZizhiQuXiMai: "微软雅黑",
|
|
6707
|
+
SucaiJishiKangkang: "微软雅黑",
|
|
6708
|
+
SucaiJishiCoolSquare: "黑体",
|
|
6709
|
+
TuniuRounded: "微软雅黑",
|
|
6710
|
+
RuiziZhenyan: "黑体",
|
|
6711
|
+
"DM-Sans": "Calibri",
|
|
6712
|
+
Arial: "Arial",
|
|
6713
|
+
Calibri: "Calibri",
|
|
6714
|
+
SimSun: "宋体",
|
|
6715
|
+
SimHei: "黑体",
|
|
6716
|
+
FangSong: "仿宋",
|
|
6717
|
+
KaiTi: "楷体"
|
|
6718
|
+
}, d = (e) => {
|
|
6719
|
+
if (!e || typeof e != "string") return "微软雅黑";
|
|
6720
|
+
let t = e.split(",")[0].replace(/^['"]|['"]$/g, "").trim();
|
|
6721
|
+
if (!t) return "微软雅黑";
|
|
6722
|
+
let n = u[t];
|
|
6723
|
+
if (n) return n;
|
|
6724
|
+
let r = t.toLowerCase(), i = Object.keys(u).find((e) => e.toLowerCase() === r);
|
|
6725
|
+
return i ? u[i] : t;
|
|
6726
|
+
};
|
|
6727
|
+
function f(e) {
|
|
6687
6728
|
try {
|
|
6688
6729
|
return new URL(e), !0;
|
|
6689
6730
|
} catch {
|
|
6690
6731
|
return !1;
|
|
6691
6732
|
}
|
|
6692
6733
|
}
|
|
6693
|
-
function
|
|
6694
|
-
return
|
|
6734
|
+
function p(e) {
|
|
6735
|
+
return f(e) ? `${js}?url=${encodeURIComponent(e)}` : e;
|
|
6695
6736
|
}
|
|
6696
|
-
async function
|
|
6697
|
-
let t =
|
|
6737
|
+
async function m(e) {
|
|
6738
|
+
let t = f(e) ? p(e) : e, n = await fetch(t);
|
|
6698
6739
|
if (!n.ok) throw Error(`Fetch failed: ${n.status}`);
|
|
6699
6740
|
let r = await n.blob();
|
|
6700
6741
|
return await new Promise((e, t) => {
|
|
@@ -6702,10 +6743,10 @@ var zo = () => {
|
|
|
6702
6743
|
n.onload = () => e(String(n.result)), n.onerror = t, n.readAsDataURL(r);
|
|
6703
6744
|
});
|
|
6704
6745
|
}
|
|
6705
|
-
async function
|
|
6706
|
-
return
|
|
6746
|
+
async function h(e) {
|
|
6747
|
+
return O(e) || k(e) ? e : await m(e);
|
|
6707
6748
|
}
|
|
6708
|
-
let
|
|
6749
|
+
let g = (e, t, n, r = !0) => {
|
|
6709
6750
|
c.value = !0;
|
|
6710
6751
|
let a = t === "png" ? Le : Ie;
|
|
6711
6752
|
e.querySelectorAll("foreignObject [xmlns]").forEach((e) => e.removeAttribute("xmlns")), setTimeout(() => {
|
|
@@ -6719,7 +6760,7 @@ var zo = () => {
|
|
|
6719
6760
|
c.value = !1, Ai.error(l("EXPORT.IMAGE_FAIL"));
|
|
6720
6761
|
});
|
|
6721
6762
|
}, 200);
|
|
6722
|
-
},
|
|
6763
|
+
}, _ = (e) => {
|
|
6723
6764
|
let r = {
|
|
6724
6765
|
title: i.value,
|
|
6725
6766
|
width: a.value,
|
|
@@ -6728,7 +6769,7 @@ var zo = () => {
|
|
|
6728
6769
|
slides: e
|
|
6729
6770
|
};
|
|
6730
6771
|
Ne(new Blob([$a(JSON.stringify(r))], { type: "" }), `${i.value}.pptist`);
|
|
6731
|
-
},
|
|
6772
|
+
}, v = () => {
|
|
6732
6773
|
let r = {
|
|
6733
6774
|
title: i.value,
|
|
6734
6775
|
width: a.value,
|
|
@@ -6737,7 +6778,7 @@ var zo = () => {
|
|
|
6737
6778
|
slides: e.value
|
|
6738
6779
|
};
|
|
6739
6780
|
Ne(new Blob([JSON.stringify(r)], { type: "" }), `${i.value}.json`);
|
|
6740
|
-
},
|
|
6781
|
+
}, y = () => {
|
|
6741
6782
|
let r = {
|
|
6742
6783
|
title: i.value,
|
|
6743
6784
|
width: a.value,
|
|
@@ -6746,7 +6787,7 @@ var zo = () => {
|
|
|
6746
6787
|
slides: e.value
|
|
6747
6788
|
};
|
|
6748
6789
|
return JSON.stringify(r || "");
|
|
6749
|
-
},
|
|
6790
|
+
}, b = (e) => {
|
|
6750
6791
|
if (!e) return {
|
|
6751
6792
|
alpha: 0,
|
|
6752
6793
|
color: "#000000"
|
|
@@ -6756,7 +6797,7 @@ var zo = () => {
|
|
|
6756
6797
|
alpha: n,
|
|
6757
6798
|
color: n === 0 ? "#ffffff" : t.setAlpha(1).toHexString()
|
|
6758
6799
|
};
|
|
6759
|
-
},
|
|
6800
|
+
}, x = (e) => {
|
|
6760
6801
|
let t = Ss(e), n = !1, r = 0, i = [], a = (e, t = {}) => {
|
|
6761
6802
|
for (let o of e) {
|
|
6762
6803
|
if ("tagName" in o && [
|
|
@@ -6785,13 +6826,13 @@ var zo = () => {
|
|
|
6785
6826
|
});
|
|
6786
6827
|
else if ("content" in o) {
|
|
6787
6828
|
let t = o.content.replace(/ /g, " ").replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&").replace(/\n/g, ""), a = {};
|
|
6788
|
-
e["font-size"] && (a.fontSize = parseInt(e["font-size"]) / s.value), e.color && (a.color =
|
|
6829
|
+
e["font-size"] && (a.fontSize = parseInt(e["font-size"]) / s.value), e.color && (a.color = b(e.color).color), e["background-color"] && (a.highlight = b(e["background-color"]).color), e["text-decoration-line"] && (e["text-decoration-line"].indexOf("underline") !== -1 && (a.underline = {
|
|
6789
6830
|
color: a.color || "#000000",
|
|
6790
6831
|
style: "sng"
|
|
6791
6832
|
}), e["text-decoration-line"].indexOf("line-through") !== -1 && (a.strike = "sngStrike")), e["text-decoration"] && (e["text-decoration"].indexOf("underline") !== -1 && (a.underline = {
|
|
6792
6833
|
color: a.color || "#000000",
|
|
6793
6834
|
style: "sng"
|
|
6794
|
-
}), e["text-decoration"].indexOf("line-through") !== -1 && (a.strike = "sngStrike")), e["vertical-align"] && (e["vertical-align"] === "super" && (a.superscript = !0), e["vertical-align"] === "sub" && (a.subscript = !0)), e["text-align"] && (a.align = e["text-align"]), e["font-weight"] && (a.bold = e["font-weight"] === "bold"), e["font-style"] && (a.italic = e["font-style"] === "italic"), e["font-family"] && (a.fontFace = e["font-family"]), e.href && (a.hyperlink = { url: e.href }), n && e["list-type"] === "ol" && (a.bullet = {
|
|
6835
|
+
}), e["text-decoration"].indexOf("line-through") !== -1 && (a.strike = "sngStrike")), e["vertical-align"] && (e["vertical-align"] === "super" && (a.superscript = !0), e["vertical-align"] === "sub" && (a.subscript = !0)), e["text-align"] && (a.align = e["text-align"]), e["font-weight"] && (a.bold = e["font-weight"] === "bold"), e["font-style"] && (a.italic = e["font-style"] === "italic"), e["font-family"] && (a.fontFace = d(e["font-family"])), e.href && (a.hyperlink = { url: e.href }), n && e["list-type"] === "ol" && (a.bullet = {
|
|
6795
6836
|
type: "number",
|
|
6796
6837
|
indent: (a.fontSize || 16) * 1.25
|
|
6797
6838
|
}, a.paraSpaceBefore = .1, n = !1), n && e["list-type"] === "ul" && (a.bullet = { indent: (a.fontSize || 16) * 1.25 }, a.paraSpaceBefore = .1, n = !1), r &&= (a.indentLevel = r, 0), i.push({
|
|
@@ -6802,7 +6843,7 @@ var zo = () => {
|
|
|
6802
6843
|
}
|
|
6803
6844
|
};
|
|
6804
6845
|
return a(t), i;
|
|
6805
|
-
},
|
|
6846
|
+
}, S = (e, t = {
|
|
6806
6847
|
x: 1,
|
|
6807
6848
|
y: 1
|
|
6808
6849
|
}) => e.map((e) => {
|
|
@@ -6838,8 +6879,8 @@ var zo = () => {
|
|
|
6838
6879
|
x: e.x / o.value * t.x,
|
|
6839
6880
|
y: e.y / o.value * t.y
|
|
6840
6881
|
};
|
|
6841
|
-
}),
|
|
6842
|
-
let t =
|
|
6882
|
+
}), w = (e) => {
|
|
6883
|
+
let t = b(e.color), { h: n, v: r } = e, i = 4, a = 45;
|
|
6843
6884
|
return n === 0 && r === 0 ? (i = 4, a = 45) : n === 0 ? r > 0 ? (i = r, a = 90) : (i = -r, a = 270) : r === 0 ? n > 0 ? (i = n, a = 1) : (i = -n, a = 180) : n > 0 && r > 0 ? (i = Math.max(n, r), a = 45) : n > 0 && r < 0 ? (i = Math.max(n, -r), a = 315) : n < 0 && r > 0 ? (i = Math.max(-n, r), a = 135) : n < 0 && r < 0 && (i = Math.max(-n, -r), a = 225), {
|
|
6844
6885
|
type: "outer",
|
|
6845
6886
|
color: t.color.replace("#", ""),
|
|
@@ -6848,19 +6889,19 @@ var zo = () => {
|
|
|
6848
6889
|
offset: i,
|
|
6849
6890
|
angle: a
|
|
6850
6891
|
};
|
|
6851
|
-
},
|
|
6892
|
+
}, T = {
|
|
6852
6893
|
solid: "solid",
|
|
6853
6894
|
dashed: "dash",
|
|
6854
6895
|
dotted: "sysDot"
|
|
6855
|
-
},
|
|
6856
|
-
let t =
|
|
6896
|
+
}, E = (e) => {
|
|
6897
|
+
let t = b(e?.color || "#000000");
|
|
6857
6898
|
return {
|
|
6858
6899
|
color: t.color,
|
|
6859
6900
|
transparency: (1 - t.alpha) * 100,
|
|
6860
6901
|
width: (e.width || 1) / s.value,
|
|
6861
|
-
dashType: e.style ?
|
|
6902
|
+
dashType: e.style ? T[e.style] : "solid"
|
|
6862
6903
|
};
|
|
6863
|
-
},
|
|
6904
|
+
}, D = (t) => {
|
|
6864
6905
|
let { type: n, target: r } = t;
|
|
6865
6906
|
if (n === "web") return { url: r };
|
|
6866
6907
|
if (n === "slide") {
|
|
@@ -6868,29 +6909,29 @@ var zo = () => {
|
|
|
6868
6909
|
if (t !== -1) return { slide: t + 1 };
|
|
6869
6910
|
}
|
|
6870
6911
|
return null;
|
|
6871
|
-
},
|
|
6912
|
+
}, O = (e) => e.match(/^data:image\/[^;]+;base64,/) !== null, k = (e) => {
|
|
6872
6913
|
let t = /^data:image\/svg\+xml;base64,/.test(e), n = /\.svg$/.test(e);
|
|
6873
6914
|
return t || n;
|
|
6874
6915
|
};
|
|
6875
6916
|
return {
|
|
6876
6917
|
exporting: c,
|
|
6877
|
-
exportImage:
|
|
6878
|
-
exportJSON:
|
|
6879
|
-
exportSpecificFile:
|
|
6918
|
+
exportImage: g,
|
|
6919
|
+
exportJSON: v,
|
|
6920
|
+
exportSpecificFile: _,
|
|
6880
6921
|
exportPPTX: async (e, r, u) => {
|
|
6881
6922
|
c.value = !0;
|
|
6882
|
-
let
|
|
6883
|
-
if (n.value === .625 ?
|
|
6923
|
+
let f = new Pe();
|
|
6924
|
+
if (n.value === .625 ? f.layout = "LAYOUT_16x10" : n.value === .75 ? f.layout = "LAYOUT_4x3" : n.value === .70710678 ? (f.defineLayout({
|
|
6884
6925
|
name: "A3",
|
|
6885
6926
|
width: 10,
|
|
6886
6927
|
height: 7.0710678
|
|
6887
|
-
}),
|
|
6928
|
+
}), f.layout = "A3") : n.value === 1.41421356 ? (f.defineLayout({
|
|
6888
6929
|
name: "A3_V",
|
|
6889
6930
|
width: 10,
|
|
6890
6931
|
height: 14.1421356
|
|
6891
|
-
}),
|
|
6892
|
-
let { color: e, alpha: n } =
|
|
6893
|
-
|
|
6932
|
+
}), f.layout = "A3_V") : f.layout = "LAYOUT_16x9", r) {
|
|
6933
|
+
let { color: e, alpha: n } = b(t.value.backgroundColor);
|
|
6934
|
+
f.defineSlideMaster({
|
|
6894
6935
|
title: "PPTIST_MASTER",
|
|
6895
6936
|
background: {
|
|
6896
6937
|
color: e,
|
|
@@ -6899,24 +6940,24 @@ var zo = () => {
|
|
|
6899
6940
|
});
|
|
6900
6941
|
}
|
|
6901
6942
|
for (let t of e) {
|
|
6902
|
-
let e =
|
|
6943
|
+
let e = f.addSlide();
|
|
6903
6944
|
if (t.background) {
|
|
6904
6945
|
let r = t.background;
|
|
6905
|
-
if (r.type === "image" && r.image)
|
|
6946
|
+
if (r.type === "image" && r.image) k(r.image.src) ? e.addImage({
|
|
6906
6947
|
data: r.image.src,
|
|
6907
6948
|
x: 0,
|
|
6908
6949
|
y: 0,
|
|
6909
6950
|
w: a.value / o.value,
|
|
6910
6951
|
h: a.value * n.value / o.value
|
|
6911
|
-
}) :
|
|
6952
|
+
}) : O(r.image.src) ? e.background = { data: r.image.src } : e.background = { data: await h(r.image.src) };
|
|
6912
6953
|
else if (r.type === "solid" && r.color) {
|
|
6913
|
-
let t =
|
|
6954
|
+
let t = b(r.color);
|
|
6914
6955
|
e.background = {
|
|
6915
6956
|
color: t.color,
|
|
6916
6957
|
transparency: (1 - t.alpha) * 100
|
|
6917
6958
|
};
|
|
6918
6959
|
} else if (r.type === "gradient" && r.gradient) {
|
|
6919
|
-
let t = r.gradient.colors, n = t[0].color, i = t[t.length - 1].color, a =
|
|
6960
|
+
let t = r.gradient.colors, n = t[0].color, i = t[t.length - 1].color, a = b(Ae.mix(n, i).toHexString());
|
|
6920
6961
|
e.background = {
|
|
6921
6962
|
color: a.color,
|
|
6922
6963
|
transparency: (1 - a.alpha) * 100
|
|
@@ -6933,7 +6974,7 @@ var zo = () => {
|
|
|
6933
6974
|
}
|
|
6934
6975
|
if (t.elements) {
|
|
6935
6976
|
for (let n of t.elements) if (n.type === "text") {
|
|
6936
|
-
let t =
|
|
6977
|
+
let t = x(n.content), r = {
|
|
6937
6978
|
x: n.left / o.value,
|
|
6938
6979
|
y: n.top / o.value,
|
|
6939
6980
|
w: n.width / o.value,
|
|
@@ -6948,13 +6989,13 @@ var zo = () => {
|
|
|
6948
6989
|
autoFit: !0
|
|
6949
6990
|
};
|
|
6950
6991
|
if (n.rotate && (r.rotate = n.rotate), n.wordSpace && (r.charSpacing = n.wordSpace / s.value), n.lineHeight && (r.lineSpacingMultiple = n.lineHeight / 1.25), n.fill) {
|
|
6951
|
-
let e =
|
|
6992
|
+
let e = b(n.fill), t = n.opacity === void 0 ? 1 : n.opacity;
|
|
6952
6993
|
r.fill = {
|
|
6953
6994
|
color: e.color,
|
|
6954
6995
|
transparency: (1 - e.alpha * t) * 100
|
|
6955
6996
|
};
|
|
6956
6997
|
}
|
|
6957
|
-
n.defaultColor && (r.color =
|
|
6998
|
+
n.defaultColor && (r.color = b(n.defaultColor).color), n.defaultFontName && (r.fontFace = d(n.defaultFontName)), n.shadow && (r.shadow = w(n.shadow)), n.outline && n.outline.width && n.outline.width > 0 && (r.line = E(n.outline)), n.opacity !== void 0 && (r.transparency = (1 - n.opacity) * 100), n.paragraphSpace !== void 0 && (r.paraSpaceBefore = n.paragraphSpace / s.value), n.vertical && (r.vert = "eaVert"), e.addText(t, r);
|
|
6958
6999
|
} else if (n.type === "image") {
|
|
6959
7000
|
let t = {
|
|
6960
7001
|
x: n.left / o.value,
|
|
@@ -6962,8 +7003,8 @@ var zo = () => {
|
|
|
6962
7003
|
w: n.width / o.value,
|
|
6963
7004
|
h: n.height / o.value
|
|
6964
7005
|
};
|
|
6965
|
-
if (
|
|
6966
|
-
let e =
|
|
7006
|
+
if (O(n.src) ? t.data = n.src : t.data = await h(n.src), n.flipH && (t.flipH = n.flipH), n.flipV && (t.flipV = n.flipV), n.rotate && (t.rotate = n.rotate), n.link) {
|
|
7007
|
+
let e = D(n.link);
|
|
6967
7008
|
e && (t.hyperlink = e);
|
|
6968
7009
|
}
|
|
6969
7010
|
if (n.filters?.opacity && (t.transparency = 100 - parseInt(n.filters?.opacity)), n.clip) {
|
|
@@ -6991,11 +7032,11 @@ var zo = () => {
|
|
|
6991
7032
|
h: n.height / o.value
|
|
6992
7033
|
};
|
|
6993
7034
|
if (n.rotate && (r.rotate = n.rotate), n.flipH && (r.flipH = n.flipH), n.flipV && (r.flipV = n.flipV), n.fill) {
|
|
6994
|
-
let e =
|
|
7035
|
+
let e = b(n.fill), t = n.opacity === void 0 ? 1 : n.opacity, i = e.alpha * t;
|
|
6995
7036
|
i < 1 && (r.transparency = (1 - i) * 100);
|
|
6996
7037
|
} else n.opacity !== void 0 && n.opacity < 1 && (r.transparency = (1 - n.opacity) * 100);
|
|
6997
7038
|
if (n.link) {
|
|
6998
|
-
let e =
|
|
7039
|
+
let e = D(n.link);
|
|
6999
7040
|
e && (r.hyperlink = e);
|
|
7000
7041
|
}
|
|
7001
7042
|
e.addImage(r), t = !0;
|
|
@@ -7005,12 +7046,12 @@ var zo = () => {
|
|
|
7005
7046
|
let t = {
|
|
7006
7047
|
x: n.width / n.viewBox[0],
|
|
7007
7048
|
y: n.height / n.viewBox[1]
|
|
7008
|
-
}, r =
|
|
7049
|
+
}, r = S(ws(n.path), t), i = b(n.fill);
|
|
7009
7050
|
if (n.gradient) {
|
|
7010
7051
|
let e = n.gradient.colors, t = e[0].color, r = e[e.length - 1].color;
|
|
7011
|
-
i =
|
|
7052
|
+
i = b(Ae.mix(t, r).toHexString());
|
|
7012
7053
|
}
|
|
7013
|
-
n.pattern && (i =
|
|
7054
|
+
n.pattern && (i = b("#00000000"));
|
|
7014
7055
|
let a = n.opacity === void 0 ? 1 : n.opacity, s = {
|
|
7015
7056
|
x: n.left / o.value,
|
|
7016
7057
|
y: n.top / o.value,
|
|
@@ -7022,14 +7063,14 @@ var zo = () => {
|
|
|
7022
7063
|
},
|
|
7023
7064
|
points: r
|
|
7024
7065
|
};
|
|
7025
|
-
if (n.flipH && (s.flipH = n.flipH), n.flipV && (s.flipV = n.flipV), n.shadow && (s.shadow =
|
|
7026
|
-
let e =
|
|
7066
|
+
if (n.flipH && (s.flipH = n.flipH), n.flipV && (s.flipV = n.flipV), n.shadow && (s.shadow = w(n.shadow)), n.outline && n.outline.width && n.outline.width > 0 && (s.line = E(n.outline)), n.rotate && (s.rotate = n.rotate), n.link) {
|
|
7067
|
+
let e = D(n.link);
|
|
7027
7068
|
e && (s.hyperlink = e);
|
|
7028
7069
|
}
|
|
7029
7070
|
e.addShape("custGeom", s);
|
|
7030
7071
|
}
|
|
7031
7072
|
if (n.text) {
|
|
7032
|
-
let t =
|
|
7073
|
+
let t = x(n.text.content), r = {
|
|
7033
7074
|
x: n.left / o.value,
|
|
7034
7075
|
y: n.top / o.value,
|
|
7035
7076
|
w: n.width / o.value,
|
|
@@ -7040,7 +7081,7 @@ var zo = () => {
|
|
|
7040
7081
|
paraSpaceBefore: 5 / s.value,
|
|
7041
7082
|
valign: n.text.align
|
|
7042
7083
|
};
|
|
7043
|
-
n.rotate && (r.rotate = n.rotate), n.text.defaultColor && (r.color =
|
|
7084
|
+
n.rotate && (r.rotate = n.rotate), n.text.defaultColor && (r.color = b(n.text.defaultColor).color), n.text.defaultFontName && (r.fontFace = d(n.text.defaultFontName)), e.addText(t, r);
|
|
7044
7085
|
}
|
|
7045
7086
|
if (n.pattern) {
|
|
7046
7087
|
let t = {
|
|
@@ -7049,14 +7090,14 @@ var zo = () => {
|
|
|
7049
7090
|
w: n.width / o.value,
|
|
7050
7091
|
h: n.height / o.value
|
|
7051
7092
|
};
|
|
7052
|
-
if (
|
|
7053
|
-
let e =
|
|
7093
|
+
if (O(n.pattern) ? t.data = n.pattern : t.data = await h(n.pattern), n.flipH && (t.flipH = n.flipH), n.flipV && (t.flipV = n.flipV), n.rotate && (t.rotate = n.rotate), n.link) {
|
|
7094
|
+
let e = D(n.link);
|
|
7054
7095
|
e && (t.hyperlink = e);
|
|
7055
7096
|
}
|
|
7056
7097
|
e.addImage(t);
|
|
7057
7098
|
}
|
|
7058
7099
|
} else if (n.type === "line") {
|
|
7059
|
-
let t =
|
|
7100
|
+
let t = S(ws(Ja(n))), { minX: r, maxX: i, minY: a, maxY: c } = Ra(n), l = b(n.color), u = {
|
|
7060
7101
|
x: n.left / o.value,
|
|
7061
7102
|
y: n.top / o.value,
|
|
7062
7103
|
w: (i - r) / o.value,
|
|
@@ -7065,13 +7106,13 @@ var zo = () => {
|
|
|
7065
7106
|
color: l.color,
|
|
7066
7107
|
transparency: (1 - l.alpha) * 100,
|
|
7067
7108
|
width: n.width / s.value,
|
|
7068
|
-
dashType:
|
|
7109
|
+
dashType: T[n.style],
|
|
7069
7110
|
beginArrowType: n.points[0] ? "arrow" : "none",
|
|
7070
7111
|
endArrowType: n.points[1] ? "arrow" : "none"
|
|
7071
7112
|
},
|
|
7072
7113
|
points: t
|
|
7073
7114
|
};
|
|
7074
|
-
n.shadow && (u.shadow =
|
|
7115
|
+
n.shadow && (u.shadow = w(n.shadow)), e.addShape("custGeom", u);
|
|
7075
7116
|
} else if (n.type === "chart") {
|
|
7076
7117
|
let t = [];
|
|
7077
7118
|
for (let e = 0; e < n.data.series.length; e++) {
|
|
@@ -7083,11 +7124,11 @@ var zo = () => {
|
|
|
7083
7124
|
});
|
|
7084
7125
|
}
|
|
7085
7126
|
let r = [];
|
|
7086
|
-
if (n.themeColors.length === 10) r = n.themeColors.map((e) =>
|
|
7087
|
-
else if (n.themeColors.length === 1) r = Ae(n.themeColors[0]).analogous(10).map((e) =>
|
|
7127
|
+
if (n.themeColors.length === 10) r = n.themeColors.map((e) => b(e).color);
|
|
7128
|
+
else if (n.themeColors.length === 1) r = Ae(n.themeColors[0]).analogous(10).map((e) => b(e.toHexString()).color);
|
|
7088
7129
|
else {
|
|
7089
7130
|
let e = n.themeColors.length, t = Ae(n.themeColors[e - 1]).analogous(11 - e).map((e) => e.toHexString());
|
|
7090
|
-
r = [...n.themeColors.slice(0, e - 1), ...t].map((e) =>
|
|
7131
|
+
r = [...n.themeColors.slice(0, e - 1), ...t].map((e) => b(e).color);
|
|
7091
7132
|
}
|
|
7092
7133
|
let i = {
|
|
7093
7134
|
x: n.left / o.value,
|
|
@@ -7095,19 +7136,19 @@ var zo = () => {
|
|
|
7095
7136
|
w: n.width / o.value,
|
|
7096
7137
|
h: n.height / o.value,
|
|
7097
7138
|
chartColors: n.chartType === "pie" || n.chartType === "ring" ? r : r.slice(0, n.data.series.length)
|
|
7098
|
-
}, a =
|
|
7139
|
+
}, a = b(n.textColor || "#000000").color;
|
|
7099
7140
|
i.catAxisLabelColor = a, i.valAxisLabelColor = a;
|
|
7100
7141
|
let c = 14 / s.value;
|
|
7101
7142
|
if (i.catAxisLabelFontSize = c, i.valAxisLabelFontSize = c, n.fill || n.outline) {
|
|
7102
7143
|
let e = {};
|
|
7103
|
-
n.fill && (e.fill = { color:
|
|
7144
|
+
n.fill && (e.fill = { color: b(n.fill).color }), n.outline && (e.border = {
|
|
7104
7145
|
pt: n.outline.width / s.value,
|
|
7105
|
-
color:
|
|
7146
|
+
color: b(n.outline.color).color
|
|
7106
7147
|
}), i.plotArea = e;
|
|
7107
7148
|
}
|
|
7108
7149
|
(n.data.series.length > 1 && n.chartType !== "scatter" || n.chartType === "pie" || n.chartType === "ring") && (i.showLegend = !0, i.legendPos = "b", i.legendColor = a, i.legendFontSize = c);
|
|
7109
|
-
let u =
|
|
7110
|
-
n.chartType === "bar" ? (u =
|
|
7150
|
+
let u = f.ChartType.bar;
|
|
7151
|
+
n.chartType === "bar" ? (u = f.ChartType.bar, i.barDir = "col", n.options?.stack && (i.barGrouping = "stacked")) : n.chartType === "column" ? (u = f.ChartType.bar, i.barDir = "bar", n.options?.stack && (i.barGrouping = "stacked")) : n.chartType === "line" ? (u = f.ChartType.line, n.options?.lineSmooth && (i.lineSmooth = !0)) : n.chartType === "area" ? u = f.ChartType.area : n.chartType === "radar" ? u = f.ChartType.radar : n.chartType === "scatter" ? (u = f.ChartType.scatter, i.lineSize = 0) : n.chartType === "pie" ? u = f.ChartType.pie : n.chartType === "ring" && (u = f.ChartType.doughnut, i.holeSize = 60), e.addChart(u, t, i);
|
|
7111
7152
|
} else if (n.type === "table") {
|
|
7112
7153
|
let t = [];
|
|
7113
7154
|
for (let e = 0; e < n.data.length; e++) {
|
|
@@ -7118,11 +7159,11 @@ var zo = () => {
|
|
|
7118
7159
|
}
|
|
7119
7160
|
}
|
|
7120
7161
|
let r = [], i = n.theme, a = null, c = [];
|
|
7121
|
-
i && (a =
|
|
7162
|
+
i && (a = b(i.color), c = qa(i.color).map((e) => b(e)));
|
|
7122
7163
|
for (let e = 0; e < n.data.length; e++) {
|
|
7123
7164
|
let o = n.data[e], l = [];
|
|
7124
7165
|
for (let r = 0; r < o.length; r++) {
|
|
7125
|
-
let u = o[r],
|
|
7166
|
+
let u = o[r], f = {
|
|
7126
7167
|
colspan: u.colspan,
|
|
7127
7168
|
rowspan: u.rowspan,
|
|
7128
7169
|
bold: u.style?.bold || !1,
|
|
@@ -7130,26 +7171,26 @@ var zo = () => {
|
|
|
7130
7171
|
underline: { style: u.style?.underline ? "sng" : "none" },
|
|
7131
7172
|
align: u.style?.align || "left",
|
|
7132
7173
|
valign: "middle",
|
|
7133
|
-
fontFace: u.style?.fontname || "微软雅黑",
|
|
7174
|
+
fontFace: d(u.style?.fontname || "微软雅黑"),
|
|
7134
7175
|
fontSize: (u.style?.fontsize ? parseInt(u.style?.fontsize) : 14) / s.value
|
|
7135
7176
|
};
|
|
7136
7177
|
if (i && a) {
|
|
7137
7178
|
let t;
|
|
7138
|
-
t = e % 2 == 0 ? c[1] : c[0], (i.rowHeader && e === 0 || i.rowFooter && e === n.data.length - 1 || i.colHeader && r === 0 || i.colFooter && r === o.length - 1) && (t = a),
|
|
7179
|
+
t = e % 2 == 0 ? c[1] : c[0], (i.rowHeader && e === 0 || i.rowFooter && e === n.data.length - 1 || i.colHeader && r === 0 || i.colFooter && r === o.length - 1) && (t = a), f.fill = {
|
|
7139
7180
|
color: t.color,
|
|
7140
7181
|
transparency: (1 - t.alpha) * 100
|
|
7141
7182
|
};
|
|
7142
7183
|
}
|
|
7143
7184
|
if (u.style?.backcolor) {
|
|
7144
|
-
let e =
|
|
7145
|
-
|
|
7185
|
+
let e = b(u.style.backcolor);
|
|
7186
|
+
f.fill = {
|
|
7146
7187
|
color: e.color,
|
|
7147
7188
|
transparency: (1 - e.alpha) * 100
|
|
7148
7189
|
};
|
|
7149
7190
|
}
|
|
7150
|
-
u.style?.color && (
|
|
7191
|
+
u.style?.color && (f.color = b(u.style.color).color), t.includes(`${e}_${r}`) || l.push({
|
|
7151
7192
|
text: u.text,
|
|
7152
|
-
options:
|
|
7193
|
+
options: f
|
|
7153
7194
|
});
|
|
7154
7195
|
}
|
|
7155
7196
|
l.length && r.push(l);
|
|
@@ -7164,7 +7205,7 @@ var zo = () => {
|
|
|
7164
7205
|
n.theme && (l.fill = { color: "#ffffff" }), n.outline.width && n.outline.color && (l.border = {
|
|
7165
7206
|
type: n.outline.style === "solid" ? "solid" : "dash",
|
|
7166
7207
|
pt: n.outline.width / s.value,
|
|
7167
|
-
color:
|
|
7208
|
+
color: b(n.outline.color).color
|
|
7168
7209
|
}), e.addTable(r, l);
|
|
7169
7210
|
} else if (n.type === "latex") {
|
|
7170
7211
|
let t = {
|
|
@@ -7175,7 +7216,7 @@ var zo = () => {
|
|
|
7175
7216
|
h: n.height / o.value
|
|
7176
7217
|
};
|
|
7177
7218
|
if (n.link) {
|
|
7178
|
-
let e =
|
|
7219
|
+
let e = D(n.link);
|
|
7179
7220
|
e && (t.hyperlink = e);
|
|
7180
7221
|
}
|
|
7181
7222
|
e.addImage(t);
|
|
@@ -7188,7 +7229,7 @@ var zo = () => {
|
|
|
7188
7229
|
path: n.src,
|
|
7189
7230
|
type: n.type
|
|
7190
7231
|
};
|
|
7191
|
-
n.type === "video" && n.poster && (t.cover = await
|
|
7232
|
+
n.type === "video" && n.poster && (t.cover = await h(n.poster));
|
|
7192
7233
|
let r = n.src.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);
|
|
7193
7234
|
r && r[1] ? t.extn = r[1] : n.ext && (t.extn = n.ext);
|
|
7194
7235
|
let i = [
|
|
@@ -7209,12 +7250,12 @@ var zo = () => {
|
|
|
7209
7250
|
}
|
|
7210
7251
|
}
|
|
7211
7252
|
setTimeout(() => {
|
|
7212
|
-
|
|
7253
|
+
f.writeFile({ fileName: `${i.value}.pptx` }).then(() => c.value = !1).catch(() => {
|
|
7213
7254
|
c.value = !1, Ai.error(l("EXPORT.FAIL"));
|
|
7214
7255
|
});
|
|
7215
7256
|
}, 200);
|
|
7216
7257
|
},
|
|
7217
|
-
getSaveJSON:
|
|
7258
|
+
getSaveJSON: y
|
|
7218
7259
|
};
|
|
7219
7260
|
}, Ns = (e, t) => e.replace(/font-size:\s*([\d.]+)pt/g, (e, n) => `font-size: ${(parseFloat(n) * t).toFixed(1)}px`), Ps = () => {
|
|
7220
7261
|
let e = K(), { theme: t } = V(K()), { addHistorySnapshot: n } = Xa(), { addSlidesFromData: r } = Za(), { isEmptySlide: i } = ko(), { t: a } = W(), o = C(!1), s = (t) => {
|