lt-ppt 1.0.33 → 1.0.35
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/{InnerApp-DDGLDGCZ.js → InnerApp-CNwfV0do.js} +25032 -24270
- package/dist/{index-C761lmXB.js → index-Bea9qCqB.js} +1 -1
- package/dist/{index-DRcLEfl8.js → index-DG55cbxA.js} +1 -1
- package/dist/{lib-CbJibfgd.js → lib-DPIfjgLV.js} +143 -114
- package/dist/lt-ppt.css +1 -1
- package/dist/lt-ppt.es.js +1 -1
- package/dist/lt-ppt.umd.js +157 -157
- package/dist/{screen-BQt2kxhW.js → screen-D7zFgugS.js} +1 -1
- package/dist/types/src/LtPPT.vue.d.ts +4 -1
- package/dist/types/src/lib.d.ts +1 -1
- package/dist/types/src/locales/en.d.ts +6 -0
- package/dist/types/src/locales/index.d.ts +12 -0
- package/dist/types/src/locales/zh-CN.d.ts +6 -0
- package/dist/types/src/types/lt-ppt.d.ts +7 -0
- package/dist/types/src/views/Editor/Canvas/MiniFloatingToolbar.vue.d.ts +16 -0
- package/dist/types/src/views/Editor/MiniSlidePreview.vue.d.ts +11 -0
- package/dist/types/src/views/Editor/MiniStatusBar.vue.d.ts +2 -0
- package/dist/types/src/views/Editor/MiniToolbar.vue.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as k, resolveComponent as P, openBlock as d, createElementBlock as c, Fragment as x, renderList as A, withModifiers as p, normalizeClass as L, createElementVNode as C, toDisplayString as I, createCommentVNode as v, createBlock as O, computed as S, normalizeStyle as U, createVNode as D, render as w } from "vue";
|
|
2
|
-
import { _ as b } from "./lib-
|
|
2
|
+
import { _ as b } from "./lib-DPIfjgLV.js";
|
|
3
3
|
import { t as G } from "./tippy.esm-Dos-q4Dz.js";
|
|
4
4
|
const R = { class: "menu-content" }, X = ["onClick"], V = { class: "text" }, W = {
|
|
5
5
|
key: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { inject as he, ref as P, defineComponent as me, getCurrentInstance as fe, computed as G, onMounted as Se, onBeforeUnmount as Ce, watch as M, openBlock as ye, createElementBlock as be, normalizeStyle as Le } from "vue";
|
|
2
|
+
var U = /* @__PURE__ */ ((n) => (n.RECT = "rect", n.ELLIPSE = "ellipse", n.POLYGON = "polygon", n))(U || {});
|
|
3
|
+
const V = {
|
|
4
4
|
rect: {
|
|
5
5
|
name: "矩形",
|
|
6
6
|
type: "rect",
|
|
@@ -120,7 +120,7 @@ const G = {
|
|
|
120
120
|
style: "polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",
|
|
121
121
|
createPath: (n, i) => `M 0 0 L ${n} 0 L ${n * 0.75} ${i} L ${n * 0.25} ${i} Z`
|
|
122
122
|
}
|
|
123
|
-
},
|
|
123
|
+
}, Ie = {
|
|
124
124
|
common: {
|
|
125
125
|
close: "关闭",
|
|
126
126
|
cancel: "取消",
|
|
@@ -206,6 +206,11 @@ const G = {
|
|
|
206
206
|
fitScreen: "适应屏幕",
|
|
207
207
|
fitScreenShortcut: "适应屏幕(Ctrl + 0)"
|
|
208
208
|
},
|
|
209
|
+
miniStatus: {
|
|
210
|
+
pagePrefix: "第",
|
|
211
|
+
pageUnit: "页",
|
|
212
|
+
totalPrefix: "共"
|
|
213
|
+
},
|
|
209
214
|
exportDialog: {
|
|
210
215
|
exportPptist: "导出 PPTIST 文件",
|
|
211
216
|
exportPptx: "导出 PPTX",
|
|
@@ -631,6 +636,7 @@ const G = {
|
|
|
631
636
|
aspectRatioPortrait: "纵横比(纵向)",
|
|
632
637
|
aspectRatioLandscape: "纵横比(横向)",
|
|
633
638
|
borderRadius: "圆角半径:",
|
|
639
|
+
quoteToChat: "引用到聊天",
|
|
634
640
|
replaceImageBtn: "替换图片",
|
|
635
641
|
resetStyleBtn: "重置样式",
|
|
636
642
|
setAsBackgroundBtn: "设为背景",
|
|
@@ -1269,7 +1275,7 @@ const G = {
|
|
|
1269
1275
|
latex: "公式"
|
|
1270
1276
|
}
|
|
1271
1277
|
}
|
|
1272
|
-
},
|
|
1278
|
+
}, Te = {
|
|
1273
1279
|
common: {
|
|
1274
1280
|
close: "Close",
|
|
1275
1281
|
cancel: "Cancel",
|
|
@@ -1355,6 +1361,11 @@ const G = {
|
|
|
1355
1361
|
fitScreen: "Fit Screen",
|
|
1356
1362
|
fitScreenShortcut: "Fit Screen (Ctrl + 0)"
|
|
1357
1363
|
},
|
|
1364
|
+
miniStatus: {
|
|
1365
|
+
pagePrefix: "Page",
|
|
1366
|
+
pageUnit: "",
|
|
1367
|
+
totalPrefix: "of"
|
|
1368
|
+
},
|
|
1358
1369
|
exportDialog: {
|
|
1359
1370
|
exportPptist: "Export PPTIST File",
|
|
1360
1371
|
exportPptx: "Export PPTX",
|
|
@@ -1748,6 +1759,7 @@ const G = {
|
|
|
1748
1759
|
aspectRatioPortrait: "Aspect Ratio (Portrait)",
|
|
1749
1760
|
aspectRatioLandscape: "Aspect Ratio (Landscape)",
|
|
1750
1761
|
borderRadius: "Border Radius:",
|
|
1762
|
+
quoteToChat: "Quote to Chat",
|
|
1751
1763
|
replaceImageBtn: "Replace Image",
|
|
1752
1764
|
resetStyleBtn: "Reset Style",
|
|
1753
1765
|
setAsBackgroundBtn: "Set as Background",
|
|
@@ -2390,41 +2402,41 @@ const G = {
|
|
|
2390
2402
|
latex: "Formula"
|
|
2391
2403
|
}
|
|
2392
2404
|
}
|
|
2393
|
-
}, W = Symbol("lt-ppt-i18n"),
|
|
2394
|
-
function
|
|
2405
|
+
}, W = Symbol("lt-ppt-i18n"), Pe = { "zh-CN": Ie, en: Te };
|
|
2406
|
+
function Z(n, i = "") {
|
|
2395
2407
|
return Object.entries(n).reduce((g, [c, m]) => {
|
|
2396
2408
|
const C = i ? `${i}.${c}` : c;
|
|
2397
|
-
return m && typeof m == "object" && !Array.isArray(m) ? Object.assign(g,
|
|
2409
|
+
return m && typeof m == "object" && !Array.isArray(m) ? Object.assign(g, Z(m, C)) : g[C] = String(m), g;
|
|
2398
2410
|
}, {});
|
|
2399
2411
|
}
|
|
2400
|
-
const
|
|
2401
|
-
Object.entries(
|
|
2412
|
+
const w = Object.fromEntries(
|
|
2413
|
+
Object.entries(Pe).map(([n, i]) => [n, Z(i)])
|
|
2402
2414
|
);
|
|
2403
|
-
function
|
|
2404
|
-
const n =
|
|
2415
|
+
function Be() {
|
|
2416
|
+
const n = he(W, { locale: P("zh-CN") });
|
|
2405
2417
|
return { t: (g) => {
|
|
2406
2418
|
var c, m;
|
|
2407
|
-
return ((c =
|
|
2419
|
+
return ((c = w[n.locale.value]) == null ? void 0 : c[g]) ?? ((m = w["zh-CN"]) == null ? void 0 : m[g]) ?? g;
|
|
2408
2420
|
}, locale: n.locale };
|
|
2409
2421
|
}
|
|
2410
|
-
function
|
|
2422
|
+
function we(n) {
|
|
2411
2423
|
return (i) => {
|
|
2412
2424
|
var g, c;
|
|
2413
|
-
return ((g =
|
|
2425
|
+
return ((g = w[n.value]) == null ? void 0 : g[i]) ?? ((c = w["zh-CN"]) == null ? void 0 : c[i]) ?? i;
|
|
2414
2426
|
};
|
|
2415
2427
|
}
|
|
2416
|
-
function
|
|
2417
|
-
const i =
|
|
2428
|
+
function Ee(n) {
|
|
2429
|
+
const i = P((n == null ? void 0 : n.locale) ?? "zh-CN");
|
|
2418
2430
|
return {
|
|
2419
2431
|
install() {
|
|
2420
2432
|
},
|
|
2421
2433
|
global: { locale: i, t: (c) => {
|
|
2422
2434
|
var m, C;
|
|
2423
|
-
return ((m =
|
|
2435
|
+
return ((m = w[i.value]) == null ? void 0 : m[c]) ?? ((C = w["zh-CN"]) == null ? void 0 : C[c]) ?? c;
|
|
2424
2436
|
} }
|
|
2425
2437
|
};
|
|
2426
2438
|
}
|
|
2427
|
-
const
|
|
2439
|
+
const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
|
|
2428
2440
|
__name: "LtPPT",
|
|
2429
2441
|
props: {
|
|
2430
2442
|
initData: {},
|
|
@@ -2437,20 +2449,21 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2437
2449
|
height: { default: "100%" },
|
|
2438
2450
|
readonly: { type: Boolean, default: !1 },
|
|
2439
2451
|
theme: { default: "dark" },
|
|
2452
|
+
mode: { default: "default" },
|
|
2440
2453
|
onReturn: {},
|
|
2441
2454
|
onImageAIEntryClick: {}
|
|
2442
2455
|
},
|
|
2443
2456
|
emits: ["image-ai-entry-click"],
|
|
2444
2457
|
setup(n, { expose: i, emit: g }) {
|
|
2445
|
-
const c = n, m = g, C =
|
|
2446
|
-
let S = null, f = null,
|
|
2447
|
-
const E =
|
|
2458
|
+
const c = n, m = g, C = fe(), L = P();
|
|
2459
|
+
let S = null, f = null, R = null, F = null, O = null, B = null, k = null;
|
|
2460
|
+
const E = P(c.locale ?? "zh-CN"), D = P(c.theme ?? "dark"), $ = P(c.mode ?? "default"), X = G(() => ({
|
|
2448
2461
|
width: c.width,
|
|
2449
2462
|
height: c.height
|
|
2450
|
-
})),
|
|
2463
|
+
})), J = () => {
|
|
2451
2464
|
const e = (C == null ? void 0 : C.vnode.props) || {};
|
|
2452
2465
|
return !!(e.onImageAIEntryClick || e.onImageAiEntryClick);
|
|
2453
|
-
},
|
|
2466
|
+
}, Y = G(() => !!c.onImageAIEntryClick || J()), q = (e) => new Promise((t) => {
|
|
2454
2467
|
if (typeof Image > "u") {
|
|
2455
2468
|
t(null);
|
|
2456
2469
|
return;
|
|
@@ -2459,7 +2472,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2459
2472
|
const s = (l) => {
|
|
2460
2473
|
o || (o = !0, r && clearTimeout(r), t(l));
|
|
2461
2474
|
};
|
|
2462
|
-
r = setTimeout(() => s(null),
|
|
2475
|
+
r = setTimeout(() => s(null), ke);
|
|
2463
2476
|
const a = new Image();
|
|
2464
2477
|
/^https?:\/\//i.test(e) && (a.crossOrigin = "anonymous"), a.decoding = "sync", a.onload = async () => {
|
|
2465
2478
|
var l;
|
|
@@ -2469,35 +2482,35 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2469
2482
|
}
|
|
2470
2483
|
s(a);
|
|
2471
2484
|
}, a.onerror = () => s(null), a.src = e;
|
|
2472
|
-
}),
|
|
2485
|
+
}), j = (e) => {
|
|
2473
2486
|
const t = Math.max(1, e.width || 1), o = Math.max(1, e.height || 1);
|
|
2474
2487
|
let r = Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, 2);
|
|
2475
|
-
return t * o * r * r >
|
|
2488
|
+
return t * o * r * r > _ && (r = Math.sqrt(_ / (t * o))), {
|
|
2476
2489
|
width: Math.max(1, Math.round(t * r)),
|
|
2477
2490
|
height: Math.max(1, Math.round(o * r)),
|
|
2478
2491
|
scale: r
|
|
2479
2492
|
};
|
|
2480
|
-
},
|
|
2493
|
+
}, Q = (e, t, o, r, s, a) => {
|
|
2481
2494
|
const l = Math.min(Math.max(a, 0), r / 2, s / 2);
|
|
2482
2495
|
if (!l) {
|
|
2483
2496
|
e.rect(t, o, r, s);
|
|
2484
2497
|
return;
|
|
2485
2498
|
}
|
|
2486
2499
|
e.moveTo(t + l, o), e.lineTo(t + r - l, o), e.quadraticCurveTo(t + r, o, t + r, o + l), e.lineTo(t + r, o + s - l), e.quadraticCurveTo(t + r, o + s, t + r - l, o + s), e.lineTo(t + l, o + s), e.quadraticCurveTo(t, o + s, t, o + s - l), e.lineTo(t, o + l), e.quadraticCurveTo(t, o, t + l, o);
|
|
2487
|
-
},
|
|
2500
|
+
}, K = (e, t, o, r, s) => {
|
|
2488
2501
|
var p;
|
|
2489
|
-
const a =
|
|
2490
|
-
if (a.type ===
|
|
2502
|
+
const a = V[((p = t.clip) == null ? void 0 : p.shape) || "rect"] || V.rect;
|
|
2503
|
+
if (a.type === U.ELLIPSE) {
|
|
2491
2504
|
e.beginPath(), e.ellipse(o / 2, r / 2, o / 2, r / 2, 0, 0, Math.PI * 2), e.clip();
|
|
2492
2505
|
return;
|
|
2493
2506
|
}
|
|
2494
|
-
if (a.type ===
|
|
2507
|
+
if (a.type === U.POLYGON && a.createPath && typeof Path2D < "u") {
|
|
2495
2508
|
e.clip(new Path2D(a.createPath(o, r)));
|
|
2496
2509
|
return;
|
|
2497
2510
|
}
|
|
2498
2511
|
const l = a.radius !== void 0 ? (t.radius || Number.parseFloat(a.radius) || 0) * s : 0;
|
|
2499
|
-
e.beginPath(),
|
|
2500
|
-
},
|
|
2512
|
+
e.beginPath(), Q(e, 0, 0, o, r, l), e.clip();
|
|
2513
|
+
}, ee = (e, t, o) => {
|
|
2501
2514
|
if (!e.clip) return { left: 0, top: 0, width: t, height: o };
|
|
2502
2515
|
const [r, s] = e.clip.range, a = s[0] - r[0], l = s[1] - r[1];
|
|
2503
2516
|
return !Number.isFinite(a) || !Number.isFinite(l) || !a || !l ? { left: 0, top: 0, width: t, height: o } : {
|
|
@@ -2506,38 +2519,38 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2506
2519
|
width: 100 / a * t,
|
|
2507
2520
|
height: 100 / l * o
|
|
2508
2521
|
};
|
|
2509
|
-
},
|
|
2522
|
+
}, te = (e) => e.filters ? Object.keys(e.filters).map((t) => {
|
|
2510
2523
|
var r;
|
|
2511
2524
|
const o = (r = e.filters) == null ? void 0 : r[t];
|
|
2512
2525
|
return o ? `${t}(${o})` : "";
|
|
2513
|
-
}).filter(Boolean).join(" ") : "",
|
|
2526
|
+
}).filter(Boolean).join(" ") : "", oe = async (e) => {
|
|
2514
2527
|
if (!e.src || typeof document > "u") return e.src;
|
|
2515
2528
|
try {
|
|
2516
|
-
const t = await
|
|
2529
|
+
const t = await q(e.src);
|
|
2517
2530
|
if (!t) return e.src;
|
|
2518
|
-
const o = document.createElement("canvas"), { width: r, height: s, scale: a } =
|
|
2531
|
+
const o = document.createElement("canvas"), { width: r, height: s, scale: a } = j(e);
|
|
2519
2532
|
o.width = r, o.height = s;
|
|
2520
2533
|
const l = o.getContext("2d");
|
|
2521
2534
|
if (!l) return e.src;
|
|
2522
|
-
l.save(), (e.flipH || e.flipV) && (l.translate(e.flipH ? r : 0, e.flipV ? s : 0), l.scale(e.flipH ? -1 : 1, e.flipV ? -1 : 1)),
|
|
2523
|
-
const p =
|
|
2535
|
+
l.save(), (e.flipH || e.flipV) && (l.translate(e.flipH ? r : 0, e.flipV ? s : 0), l.scale(e.flipH ? -1 : 1, e.flipV ? -1 : 1)), K(l, e, r, s, a);
|
|
2536
|
+
const p = te(e);
|
|
2524
2537
|
p && (l.filter = p);
|
|
2525
|
-
const h =
|
|
2538
|
+
const h = ee(e, r, s);
|
|
2526
2539
|
return l.drawImage(t, h.left, h.top, h.width, h.height), e.colorMask && (l.filter = "none", l.fillStyle = e.colorMask, l.fillRect(0, 0, r, s)), l.restore(), o.toDataURL("image/png");
|
|
2527
2540
|
} catch {
|
|
2528
2541
|
return e.src;
|
|
2529
2542
|
}
|
|
2530
|
-
},
|
|
2543
|
+
}, ne = async (e) => {
|
|
2531
2544
|
var s, a;
|
|
2532
2545
|
const t = (s = e.detail) == null ? void 0 : s.element;
|
|
2533
2546
|
if (!t || t.type !== "image") return;
|
|
2534
2547
|
const o = JSON.parse(JSON.stringify(t));
|
|
2535
|
-
o.clipSrc = await
|
|
2548
|
+
o.clipSrc = await oe(t);
|
|
2536
2549
|
const r = {
|
|
2537
2550
|
element: o
|
|
2538
2551
|
};
|
|
2539
2552
|
(a = c.onImageAIEntryClick) == null || a.call(c, r), m("image-ai-entry-click", r);
|
|
2540
|
-
},
|
|
2553
|
+
}, ie = async () => {
|
|
2541
2554
|
if (!L.value || S) return;
|
|
2542
2555
|
const [
|
|
2543
2556
|
{ createApp: e },
|
|
@@ -2548,12 +2561,12 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2548
2561
|
] = await Promise.all([
|
|
2549
2562
|
import("vue"),
|
|
2550
2563
|
import("./pinia-CVat9nJz.js"),
|
|
2551
|
-
import("./InnerApp-
|
|
2552
|
-
import("./index-
|
|
2553
|
-
import("./index-
|
|
2564
|
+
import("./InnerApp-CNwfV0do.js"),
|
|
2565
|
+
import("./index-DG55cbxA.js"),
|
|
2566
|
+
import("./index-Bea9qCqB.js")
|
|
2554
2567
|
]);
|
|
2555
2568
|
if (!L.value) return;
|
|
2556
|
-
|
|
2569
|
+
R = s.useSlidesStore, F = s.useScreenStore, O = s.useMainStore, B = s.useSnapshotStore;
|
|
2557
2570
|
const a = document.createElement("div");
|
|
2558
2571
|
a.style.width = "100%", a.style.height = "100%", L.value.appendChild(a), S = e(o, {
|
|
2559
2572
|
initData: c.initData,
|
|
@@ -2564,20 +2577,24 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2564
2577
|
onInitFinished: c.onInitFinished,
|
|
2565
2578
|
onReturn: c.onReturn,
|
|
2566
2579
|
theme: D.value
|
|
2567
|
-
}), f = t(), S.use(f), S.provide(W, { locale: E }), S.provide("__lt_ppt_theme__", D), S.provide("__lt_ppt_image_ai_entry_enabled__",
|
|
2568
|
-
},
|
|
2580
|
+
}), f = t(), S.use(f), S.provide(W, { locale: E }), S.provide("__lt_ppt_theme__", D), S.provide("__lt_ppt_mode__", $), S.provide("__lt_ppt_image_ai_entry_enabled__", Y), S.config.globalProperties.$t = we(E), S.use(r), S.mount(a);
|
|
2581
|
+
}, le = () => {
|
|
2569
2582
|
S && (S.unmount(), S = null, f = null), L.value && (L.value.innerHTML = "");
|
|
2570
2583
|
};
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
}),
|
|
2574
|
-
|
|
2575
|
-
}),
|
|
2584
|
+
Se(() => {
|
|
2585
|
+
k = ie();
|
|
2586
|
+
}), Ce(() => {
|
|
2587
|
+
le();
|
|
2588
|
+
}), M(() => c.locale, (e) => {
|
|
2576
2589
|
E.value = e ?? "zh-CN";
|
|
2577
|
-
}),
|
|
2590
|
+
}), M(() => c.theme, (e) => {
|
|
2578
2591
|
D.value = e ?? "dark";
|
|
2592
|
+
}), M(() => c.mode, (e) => {
|
|
2593
|
+
$.value = e ?? "default";
|
|
2579
2594
|
});
|
|
2580
|
-
const
|
|
2595
|
+
const ae = (e) => {
|
|
2596
|
+
$.value = e;
|
|
2597
|
+
}, b = () => !f || !R ? null : R(f), I = () => !f || !O ? null : O(f), re = () => !f || !B ? null : B(f), v = async () => (!f && k && await k, !!f), N = (e) => new Promise((t) => {
|
|
2581
2598
|
if (typeof Image > "u") {
|
|
2582
2599
|
t(null);
|
|
2583
2600
|
return;
|
|
@@ -2594,8 +2611,8 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2594
2611
|
height: o.naturalHeight || o.height
|
|
2595
2612
|
});
|
|
2596
2613
|
}, o.onerror = () => t(null), o.src = e;
|
|
2597
|
-
}),
|
|
2598
|
-
let a =
|
|
2614
|
+
}), T = (e, t) => Number.isFinite(e) && e > 0 ? e : t, z = (e, t, o, r, s) => {
|
|
2615
|
+
let a = T(e.width, (t == null ? void 0 : t.width) || s.width), l = T(e.height, (t == null ? void 0 : t.height) || s.height);
|
|
2599
2616
|
if (e.width !== void 0 && e.height === void 0 && (t != null && t.width) && t.height)
|
|
2600
2617
|
l = a * t.height / t.width;
|
|
2601
2618
|
else if (e.height !== void 0 && e.width === void 0 && (t != null && t.width) && t.height)
|
|
@@ -2605,7 +2622,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2605
2622
|
a = t.width * p, l = t.height * p;
|
|
2606
2623
|
}
|
|
2607
2624
|
return { width: a, height: l };
|
|
2608
|
-
},
|
|
2625
|
+
}, H = (e) => new Promise((t) => {
|
|
2609
2626
|
if (typeof document > "u") {
|
|
2610
2627
|
t(null);
|
|
2611
2628
|
return;
|
|
@@ -2617,20 +2634,20 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2617
2634
|
}, o.onerror = () => {
|
|
2618
2635
|
o.onloadedmetadata = null, o.onerror = null, o.removeAttribute("src"), o.load(), t(null);
|
|
2619
2636
|
}, o.src = e;
|
|
2620
|
-
}),
|
|
2621
|
-
const a = await
|
|
2622
|
-
return
|
|
2623
|
-
},
|
|
2624
|
-
const e =
|
|
2637
|
+
}), x = (e, t) => t.slideId ? e.slides.findIndex((o) => o.id === t.slideId) : t.slideIndex !== void 0 ? Number.isInteger(t.slideIndex) && t.slideIndex >= 0 && t.slideIndex < e.slides.length ? t.slideIndex : -1 : e.slideIndex, se = async (e, t, o, r, s = { width: 300, height: 200 }) => {
|
|
2638
|
+
const a = await N(e);
|
|
2639
|
+
return z(t, a, o, r, s);
|
|
2640
|
+
}, A = async () => {
|
|
2641
|
+
const e = re();
|
|
2625
2642
|
e && await e.addSnapshot();
|
|
2626
|
-
},
|
|
2627
|
-
if (!e.src || !await
|
|
2628
|
-
const t = b(), o =
|
|
2643
|
+
}, de = async (e) => {
|
|
2644
|
+
if (!e.src || !await v()) return null;
|
|
2645
|
+
const t = b(), o = I();
|
|
2629
2646
|
if (!t || !o || !t.slides.length) return null;
|
|
2630
|
-
const r =
|
|
2647
|
+
const r = x(t, e);
|
|
2631
2648
|
if (r === -1) return null;
|
|
2632
2649
|
t.slideIndex !== r && t.updateSlideIndex(r);
|
|
2633
|
-
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, { width: l, height: p } = await
|
|
2650
|
+
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, { width: l, height: p } = await se(e.src, e, s, a), { nanoid: h } = await import("./index.browser-Wq18ov6h.js"), d = {
|
|
2634
2651
|
type: "image",
|
|
2635
2652
|
id: h(10),
|
|
2636
2653
|
src: e.src,
|
|
@@ -2641,10 +2658,10 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2641
2658
|
fixedRatio: e.fixedRatio ?? !0,
|
|
2642
2659
|
rotate: e.rotate ?? 0
|
|
2643
2660
|
};
|
|
2644
|
-
return t.addElement(d), e.select !== !1 && o.setActiveElementIdList([d.id]), await
|
|
2645
|
-
},
|
|
2661
|
+
return t.addElement(d), e.select !== !1 && o.setActiveElementIdList([d.id]), await A(), JSON.parse(JSON.stringify(d));
|
|
2662
|
+
}, ce = (e, t, o) => {
|
|
2646
2663
|
var p, h;
|
|
2647
|
-
const r = !!o.slideId || o.slideIndex !== void 0, s =
|
|
2664
|
+
const r = !!o.slideId || o.slideIndex !== void 0, s = x(e, o), a = o.elementId || (t.activeElementIdList.length === 1 ? t.activeElementIdList[0] : t.handleElementId);
|
|
2648
2665
|
if (!a) return null;
|
|
2649
2666
|
if (r || !o.elementId) {
|
|
2650
2667
|
if (s === -1) return null;
|
|
@@ -2658,28 +2675,28 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2658
2675
|
if ((u == null ? void 0 : u.type) === "image") return { slideIndex: d, element: u };
|
|
2659
2676
|
}
|
|
2660
2677
|
return null;
|
|
2661
|
-
},
|
|
2662
|
-
if (!e.src || !await
|
|
2663
|
-
const t = b(), o =
|
|
2678
|
+
}, ue = async (e) => {
|
|
2679
|
+
if (!e.src || !await v()) return null;
|
|
2680
|
+
const t = b(), o = I();
|
|
2664
2681
|
if (!t || !o || !t.slides.length) return null;
|
|
2665
|
-
const r =
|
|
2682
|
+
const r = ce(t, o, e);
|
|
2666
2683
|
if (!r) return null;
|
|
2667
2684
|
const { slideIndex: s, element: a } = r, l = { src: e.src };
|
|
2668
2685
|
if (e.fixedRatio !== void 0 && (l.fixedRatio = e.fixedRatio), e.resetClip && (l.clip = void 0), !(e.keepSize === !0 && e.width === void 0 && e.height === void 0)) {
|
|
2669
|
-
const d = await
|
|
2670
|
-
let y =
|
|
2686
|
+
const d = await N(e.src), u = T(e.width, a.width);
|
|
2687
|
+
let y = T(e.height, a.height);
|
|
2671
2688
|
e.height === void 0 && (d != null && d.width) && d.height && (y = u * d.height / d.width), l.width = u, l.height = y, l.left = a.left, l.top = a.top, l.clip = void 0;
|
|
2672
2689
|
}
|
|
2673
2690
|
const h = t.slides[s].id;
|
|
2674
|
-
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await
|
|
2675
|
-
},
|
|
2676
|
-
if (!e.src || !await
|
|
2677
|
-
const t = b(), o =
|
|
2691
|
+
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await A(), JSON.parse(JSON.stringify({ ...a, ...l }));
|
|
2692
|
+
}, pe = async (e) => {
|
|
2693
|
+
if (!e.src || !await v()) return null;
|
|
2694
|
+
const t = b(), o = I();
|
|
2678
2695
|
if (!t || !o || !t.slides.length) return null;
|
|
2679
|
-
const r =
|
|
2696
|
+
const r = x(t, e);
|
|
2680
2697
|
if (r === -1) return null;
|
|
2681
2698
|
t.slideIndex !== r && t.updateSlideIndex(r);
|
|
2682
|
-
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, l = await
|
|
2699
|
+
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, l = await H(e.src), { width: p, height: h } = z(e, l, s, a, { width: 500, height: 300 }), { nanoid: d } = await import("./index.browser-Wq18ov6h.js"), u = {
|
|
2683
2700
|
type: "video",
|
|
2684
2701
|
id: d(10),
|
|
2685
2702
|
src: e.src,
|
|
@@ -2690,10 +2707,10 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2690
2707
|
rotate: e.rotate ?? 0,
|
|
2691
2708
|
autoplay: e.autoplay ?? !1
|
|
2692
2709
|
};
|
|
2693
|
-
return e.poster !== void 0 && (u.poster = e.poster), e.ext && (u.ext = e.ext), t.addElement(u), e.select !== !1 && o.setActiveElementIdList([u.id]), await
|
|
2694
|
-
},
|
|
2710
|
+
return e.poster !== void 0 && (u.poster = e.poster), e.ext && (u.ext = e.ext), t.addElement(u), e.select !== !1 && o.setActiveElementIdList([u.id]), await A(), JSON.parse(JSON.stringify(u));
|
|
2711
|
+
}, ge = (e, t, o) => {
|
|
2695
2712
|
var p, h;
|
|
2696
|
-
const r = !!o.slideId || o.slideIndex !== void 0, s =
|
|
2713
|
+
const r = !!o.slideId || o.slideIndex !== void 0, s = x(e, o), a = o.elementId || (t.activeElementIdList.length === 1 ? t.activeElementIdList[0] : t.handleElementId);
|
|
2697
2714
|
if (!a) return null;
|
|
2698
2715
|
if (r || !o.elementId) {
|
|
2699
2716
|
if (s === -1) return null;
|
|
@@ -2714,7 +2731,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2714
2731
|
return e ? JSON.parse(JSON.stringify(e.slides)) : [];
|
|
2715
2732
|
},
|
|
2716
2733
|
getSelectedElements: () => {
|
|
2717
|
-
const e =
|
|
2734
|
+
const e = I();
|
|
2718
2735
|
return e ? JSON.parse(JSON.stringify(e.activeElementList)) : [];
|
|
2719
2736
|
},
|
|
2720
2737
|
setSlides: (e) => {
|
|
@@ -2722,45 +2739,57 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2722
2739
|
t && t.setSlides(e);
|
|
2723
2740
|
},
|
|
2724
2741
|
startScreening: () => {
|
|
2725
|
-
if (!f || !
|
|
2726
|
-
|
|
2742
|
+
if (!f || !F) return;
|
|
2743
|
+
F(f).setScreening(!0);
|
|
2727
2744
|
},
|
|
2728
2745
|
getCurrentIndex: () => {
|
|
2729
2746
|
const e = b();
|
|
2730
2747
|
return e ? e.slideIndex : 0;
|
|
2731
2748
|
},
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2749
|
+
downloadPPT: () => {
|
|
2750
|
+
const e = () => {
|
|
2751
|
+
const t = I();
|
|
2752
|
+
t == null || t.setDialogForExport("pptx");
|
|
2753
|
+
};
|
|
2754
|
+
if (!f && k) {
|
|
2755
|
+
k.then(e);
|
|
2756
|
+
return;
|
|
2757
|
+
}
|
|
2758
|
+
e();
|
|
2759
|
+
},
|
|
2760
|
+
setMode: ae,
|
|
2761
|
+
insertImage: de,
|
|
2762
|
+
replaceImage: ue,
|
|
2763
|
+
insertVideo: pe,
|
|
2735
2764
|
replaceVideo: async (e) => {
|
|
2736
|
-
if (!e.src || !await
|
|
2737
|
-
const t = b(), o =
|
|
2765
|
+
if (!e.src || !await v()) return null;
|
|
2766
|
+
const t = b(), o = I();
|
|
2738
2767
|
if (!t || !o || !t.slides.length) return null;
|
|
2739
|
-
const r =
|
|
2768
|
+
const r = ge(t, o, e);
|
|
2740
2769
|
if (!r) return null;
|
|
2741
2770
|
const { slideIndex: s, element: a } = r, l = { src: e.src };
|
|
2742
2771
|
if (e.autoplay !== void 0 && (l.autoplay = e.autoplay), e.poster !== void 0 && (l.poster = e.poster || void 0), e.ext !== void 0 && (l.ext = e.ext || void 0), !(e.keepSize === !0 && e.width === void 0 && e.height === void 0)) {
|
|
2743
|
-
const d = await
|
|
2744
|
-
let y =
|
|
2772
|
+
const d = await H(e.src), u = T(e.width, a.width);
|
|
2773
|
+
let y = T(e.height, a.height);
|
|
2745
2774
|
e.height === void 0 && (d != null && d.width) && d.height && (y = u * d.height / d.width), l.width = u, l.height = y, l.left = a.left, l.top = a.top;
|
|
2746
2775
|
}
|
|
2747
2776
|
const h = t.slides[s].id;
|
|
2748
|
-
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await
|
|
2777
|
+
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await A(), JSON.parse(JSON.stringify({ ...a, ...l }));
|
|
2749
2778
|
}
|
|
2750
|
-
}), (e, t) => (
|
|
2779
|
+
}), (e, t) => (ye(), be("div", {
|
|
2751
2780
|
ref_key: "containerRef",
|
|
2752
2781
|
ref: L,
|
|
2753
2782
|
class: "lt-ppt-container",
|
|
2754
|
-
style:
|
|
2755
|
-
onImageAiEntryClick:
|
|
2783
|
+
style: Le(X.value),
|
|
2784
|
+
onImageAiEntryClick: ne
|
|
2756
2785
|
}, null, 36));
|
|
2757
2786
|
}
|
|
2758
|
-
}),
|
|
2787
|
+
}), xe = (n, i) => {
|
|
2759
2788
|
const g = n.__vccOpts || n;
|
|
2760
2789
|
for (const [c, m] of i)
|
|
2761
2790
|
g[c] = m;
|
|
2762
2791
|
return g;
|
|
2763
|
-
},
|
|
2792
|
+
}, De = /* @__PURE__ */ xe(ve, [["__scopeId", "data-v-ac370e87"]]), Ae = [
|
|
2764
2793
|
"SourceHanSans",
|
|
2765
2794
|
"SourceHanSerif",
|
|
2766
2795
|
"WenDingPLSongTi",
|
|
@@ -2789,20 +2818,20 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2789
2818
|
"Montserrat",
|
|
2790
2819
|
"SourceSansPro",
|
|
2791
2820
|
"Merriweather"
|
|
2792
|
-
],
|
|
2821
|
+
], $e = (n = "/fonts") => {
|
|
2793
2822
|
if (typeof document > "u" || !document.head) return;
|
|
2794
2823
|
const i = n.replace(/\/$/, ""), g = document.createElement("style");
|
|
2795
|
-
g.textContent =
|
|
2824
|
+
g.textContent = Ae.map(
|
|
2796
2825
|
(c) => `@font-face { font-display: swap; font-family: ${c}; src: url('${i}/${c}.woff2') format('woff2'); }`
|
|
2797
2826
|
).join(`
|
|
2798
2827
|
`), document.head.appendChild(g);
|
|
2799
2828
|
};
|
|
2800
2829
|
export {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2830
|
+
U as C,
|
|
2831
|
+
De as L,
|
|
2832
|
+
xe as _,
|
|
2833
|
+
V as a,
|
|
2834
|
+
Ee as c,
|
|
2835
|
+
$e as l,
|
|
2836
|
+
Be as u
|
|
2808
2837
|
};
|