lt-ppt 1.0.31 → 1.0.34
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-CKqWtAgg.js → InnerApp-C2-PZLYN.js} +25321 -24858
- package/dist/{index-DXz_4ImI.js → index-D0lj_Nse.js} +1 -1
- package/dist/{index-uxTzsGcL.js → index-oZ9yJaJz.js} +1 -1
- package/dist/{lib-BKX8gHfd.js → lib-BkSt5-a-.js} +108 -100
- package/dist/lt-ppt.css +1 -1
- package/dist/lt-ppt.es.js +1 -1
- package/dist/lt-ppt.umd.js +151 -151
- package/dist/{screen-BkWg_x8E.js → screen-DPtasUXa.js} +1 -1
- package/dist/types/src/LtPPT.vue.d.ts +3 -1
- package/dist/types/src/lib.d.ts +1 -1
- package/dist/types/src/locales/en.d.ts +1 -0
- package/dist/types/src/locales/index.d.ts +2 -0
- package/dist/types/src/locales/zh-CN.d.ts +1 -0
- package/dist/types/src/types/lt-ppt.d.ts +5 -0
- package/dist/types/src/views/Editor/Canvas/MiniFloatingToolbar.vue.d.ts +16 -0
- package/dist/types/src/views/Editor/EditorHeader/index.vue.d.ts +0 -1
- package/dist/types/src/views/Editor/MiniSlidePreview.vue.d.ts +11 -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-BkSt5-a-.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 T, 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: "取消",
|
|
@@ -631,6 +631,7 @@ const G = {
|
|
|
631
631
|
aspectRatioPortrait: "纵横比(纵向)",
|
|
632
632
|
aspectRatioLandscape: "纵横比(横向)",
|
|
633
633
|
borderRadius: "圆角半径:",
|
|
634
|
+
quoteToChat: "引用到聊天",
|
|
634
635
|
replaceImageBtn: "替换图片",
|
|
635
636
|
resetStyleBtn: "重置样式",
|
|
636
637
|
setAsBackgroundBtn: "设为背景",
|
|
@@ -1269,7 +1270,7 @@ const G = {
|
|
|
1269
1270
|
latex: "公式"
|
|
1270
1271
|
}
|
|
1271
1272
|
}
|
|
1272
|
-
},
|
|
1273
|
+
}, Te = {
|
|
1273
1274
|
common: {
|
|
1274
1275
|
close: "Close",
|
|
1275
1276
|
cancel: "Cancel",
|
|
@@ -1748,6 +1749,7 @@ const G = {
|
|
|
1748
1749
|
aspectRatioPortrait: "Aspect Ratio (Portrait)",
|
|
1749
1750
|
aspectRatioLandscape: "Aspect Ratio (Landscape)",
|
|
1750
1751
|
borderRadius: "Border Radius:",
|
|
1752
|
+
quoteToChat: "Quote to Chat",
|
|
1751
1753
|
replaceImageBtn: "Replace Image",
|
|
1752
1754
|
resetStyleBtn: "Reset Style",
|
|
1753
1755
|
setAsBackgroundBtn: "Set as Background",
|
|
@@ -2390,41 +2392,41 @@ const G = {
|
|
|
2390
2392
|
latex: "Formula"
|
|
2391
2393
|
}
|
|
2392
2394
|
}
|
|
2393
|
-
}, W = Symbol("lt-ppt-i18n"),
|
|
2394
|
-
function
|
|
2395
|
+
}, W = Symbol("lt-ppt-i18n"), Pe = { "zh-CN": Ie, en: Te };
|
|
2396
|
+
function Z(n, i = "") {
|
|
2395
2397
|
return Object.entries(n).reduce((g, [c, m]) => {
|
|
2396
2398
|
const C = i ? `${i}.${c}` : c;
|
|
2397
|
-
return m && typeof m == "object" && !Array.isArray(m) ? Object.assign(g,
|
|
2399
|
+
return m && typeof m == "object" && !Array.isArray(m) ? Object.assign(g, Z(m, C)) : g[C] = String(m), g;
|
|
2398
2400
|
}, {});
|
|
2399
2401
|
}
|
|
2400
|
-
const
|
|
2401
|
-
Object.entries(
|
|
2402
|
+
const P = Object.fromEntries(
|
|
2403
|
+
Object.entries(Pe).map(([n, i]) => [n, Z(i)])
|
|
2402
2404
|
);
|
|
2403
|
-
function
|
|
2404
|
-
const n =
|
|
2405
|
+
function Oe() {
|
|
2406
|
+
const n = he(W, { locale: T("zh-CN") });
|
|
2405
2407
|
return { t: (g) => {
|
|
2406
2408
|
var c, m;
|
|
2407
|
-
return ((c =
|
|
2409
|
+
return ((c = P[n.locale.value]) == null ? void 0 : c[g]) ?? ((m = P["zh-CN"]) == null ? void 0 : m[g]) ?? g;
|
|
2408
2410
|
}, locale: n.locale };
|
|
2409
2411
|
}
|
|
2410
|
-
function
|
|
2412
|
+
function we(n) {
|
|
2411
2413
|
return (i) => {
|
|
2412
2414
|
var g, c;
|
|
2413
|
-
return ((g =
|
|
2415
|
+
return ((g = P[n.value]) == null ? void 0 : g[i]) ?? ((c = P["zh-CN"]) == null ? void 0 : c[i]) ?? i;
|
|
2414
2416
|
};
|
|
2415
2417
|
}
|
|
2416
|
-
function
|
|
2417
|
-
const i =
|
|
2418
|
+
function Be(n) {
|
|
2419
|
+
const i = T((n == null ? void 0 : n.locale) ?? "zh-CN");
|
|
2418
2420
|
return {
|
|
2419
2421
|
install() {
|
|
2420
2422
|
},
|
|
2421
2423
|
global: { locale: i, t: (c) => {
|
|
2422
2424
|
var m, C;
|
|
2423
|
-
return ((m =
|
|
2425
|
+
return ((m = P[i.value]) == null ? void 0 : m[c]) ?? ((C = P["zh-CN"]) == null ? void 0 : C[c]) ?? c;
|
|
2424
2426
|
} }
|
|
2425
2427
|
};
|
|
2426
2428
|
}
|
|
2427
|
-
const
|
|
2429
|
+
const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
|
|
2428
2430
|
__name: "LtPPT",
|
|
2429
2431
|
props: {
|
|
2430
2432
|
initData: {},
|
|
@@ -2437,20 +2439,21 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2437
2439
|
height: { default: "100%" },
|
|
2438
2440
|
readonly: { type: Boolean, default: !1 },
|
|
2439
2441
|
theme: { default: "dark" },
|
|
2442
|
+
mode: { default: "default" },
|
|
2440
2443
|
onReturn: {},
|
|
2441
2444
|
onImageAIEntryClick: {}
|
|
2442
2445
|
},
|
|
2443
2446
|
emits: ["image-ai-entry-click"],
|
|
2444
2447
|
setup(n, { expose: i, emit: g }) {
|
|
2445
|
-
const c = n, m = g, C =
|
|
2446
|
-
let
|
|
2447
|
-
const E =
|
|
2448
|
+
const c = n, m = g, C = fe(), L = T();
|
|
2449
|
+
let f = null, S = null, A = null, R = null, F = null, O = null, B = null;
|
|
2450
|
+
const E = T(c.locale ?? "zh-CN"), D = T(c.theme ?? "dark"), $ = T(c.mode ?? "default"), X = G(() => ({
|
|
2448
2451
|
width: c.width,
|
|
2449
2452
|
height: c.height
|
|
2450
|
-
})),
|
|
2453
|
+
})), J = () => {
|
|
2451
2454
|
const e = (C == null ? void 0 : C.vnode.props) || {};
|
|
2452
2455
|
return !!(e.onImageAIEntryClick || e.onImageAiEntryClick);
|
|
2453
|
-
},
|
|
2456
|
+
}, Y = G(() => !!c.onImageAIEntryClick || J()), q = (e) => new Promise((t) => {
|
|
2454
2457
|
if (typeof Image > "u") {
|
|
2455
2458
|
t(null);
|
|
2456
2459
|
return;
|
|
@@ -2459,7 +2462,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2459
2462
|
const s = (l) => {
|
|
2460
2463
|
o || (o = !0, r && clearTimeout(r), t(l));
|
|
2461
2464
|
};
|
|
2462
|
-
r = setTimeout(() => s(null),
|
|
2465
|
+
r = setTimeout(() => s(null), ke);
|
|
2463
2466
|
const a = new Image();
|
|
2464
2467
|
/^https?:\/\//i.test(e) && (a.crossOrigin = "anonymous"), a.decoding = "sync", a.onload = async () => {
|
|
2465
2468
|
var l;
|
|
@@ -2469,35 +2472,35 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2469
2472
|
}
|
|
2470
2473
|
s(a);
|
|
2471
2474
|
}, a.onerror = () => s(null), a.src = e;
|
|
2472
|
-
}),
|
|
2475
|
+
}), j = (e) => {
|
|
2473
2476
|
const t = Math.max(1, e.width || 1), o = Math.max(1, e.height || 1);
|
|
2474
2477
|
let r = Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, 2);
|
|
2475
|
-
return t * o * r * r >
|
|
2478
|
+
return t * o * r * r > _ && (r = Math.sqrt(_ / (t * o))), {
|
|
2476
2479
|
width: Math.max(1, Math.round(t * r)),
|
|
2477
2480
|
height: Math.max(1, Math.round(o * r)),
|
|
2478
2481
|
scale: r
|
|
2479
2482
|
};
|
|
2480
|
-
},
|
|
2483
|
+
}, Q = (e, t, o, r, s, a) => {
|
|
2481
2484
|
const l = Math.min(Math.max(a, 0), r / 2, s / 2);
|
|
2482
2485
|
if (!l) {
|
|
2483
2486
|
e.rect(t, o, r, s);
|
|
2484
2487
|
return;
|
|
2485
2488
|
}
|
|
2486
2489
|
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
|
-
},
|
|
2490
|
+
}, K = (e, t, o, r, s) => {
|
|
2488
2491
|
var p;
|
|
2489
|
-
const a =
|
|
2490
|
-
if (a.type ===
|
|
2492
|
+
const a = V[((p = t.clip) == null ? void 0 : p.shape) || "rect"] || V.rect;
|
|
2493
|
+
if (a.type === U.ELLIPSE) {
|
|
2491
2494
|
e.beginPath(), e.ellipse(o / 2, r / 2, o / 2, r / 2, 0, 0, Math.PI * 2), e.clip();
|
|
2492
2495
|
return;
|
|
2493
2496
|
}
|
|
2494
|
-
if (a.type ===
|
|
2497
|
+
if (a.type === U.POLYGON && a.createPath && typeof Path2D < "u") {
|
|
2495
2498
|
e.clip(new Path2D(a.createPath(o, r)));
|
|
2496
2499
|
return;
|
|
2497
2500
|
}
|
|
2498
2501
|
const l = a.radius !== void 0 ? (t.radius || Number.parseFloat(a.radius) || 0) * s : 0;
|
|
2499
|
-
e.beginPath(),
|
|
2500
|
-
},
|
|
2502
|
+
e.beginPath(), Q(e, 0, 0, o, r, l), e.clip();
|
|
2503
|
+
}, ee = (e, t, o) => {
|
|
2501
2504
|
if (!e.clip) return { left: 0, top: 0, width: t, height: o };
|
|
2502
2505
|
const [r, s] = e.clip.range, a = s[0] - r[0], l = s[1] - r[1];
|
|
2503
2506
|
return !Number.isFinite(a) || !Number.isFinite(l) || !a || !l ? { left: 0, top: 0, width: t, height: o } : {
|
|
@@ -2506,39 +2509,39 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2506
2509
|
width: 100 / a * t,
|
|
2507
2510
|
height: 100 / l * o
|
|
2508
2511
|
};
|
|
2509
|
-
},
|
|
2512
|
+
}, te = (e) => e.filters ? Object.keys(e.filters).map((t) => {
|
|
2510
2513
|
var r;
|
|
2511
2514
|
const o = (r = e.filters) == null ? void 0 : r[t];
|
|
2512
2515
|
return o ? `${t}(${o})` : "";
|
|
2513
|
-
}).filter(Boolean).join(" ") : "",
|
|
2516
|
+
}).filter(Boolean).join(" ") : "", oe = async (e) => {
|
|
2514
2517
|
if (!e.src || typeof document > "u") return e.src;
|
|
2515
2518
|
try {
|
|
2516
|
-
const t = await
|
|
2519
|
+
const t = await q(e.src);
|
|
2517
2520
|
if (!t) return e.src;
|
|
2518
|
-
const o = document.createElement("canvas"), { width: r, height: s, scale: a } =
|
|
2521
|
+
const o = document.createElement("canvas"), { width: r, height: s, scale: a } = j(e);
|
|
2519
2522
|
o.width = r, o.height = s;
|
|
2520
2523
|
const l = o.getContext("2d");
|
|
2521
2524
|
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 =
|
|
2525
|
+
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);
|
|
2526
|
+
const p = te(e);
|
|
2524
2527
|
p && (l.filter = p);
|
|
2525
|
-
const h =
|
|
2528
|
+
const h = ee(e, r, s);
|
|
2526
2529
|
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
2530
|
} catch {
|
|
2528
2531
|
return e.src;
|
|
2529
2532
|
}
|
|
2530
|
-
},
|
|
2533
|
+
}, ne = async (e) => {
|
|
2531
2534
|
var s, a;
|
|
2532
2535
|
const t = (s = e.detail) == null ? void 0 : s.element;
|
|
2533
2536
|
if (!t || t.type !== "image") return;
|
|
2534
2537
|
const o = JSON.parse(JSON.stringify(t));
|
|
2535
|
-
o.clipSrc = await
|
|
2538
|
+
o.clipSrc = await oe(t);
|
|
2536
2539
|
const r = {
|
|
2537
2540
|
element: o
|
|
2538
2541
|
};
|
|
2539
2542
|
(a = c.onImageAIEntryClick) == null || a.call(c, r), m("image-ai-entry-click", r);
|
|
2540
|
-
},
|
|
2541
|
-
if (!L.value ||
|
|
2543
|
+
}, ie = async () => {
|
|
2544
|
+
if (!L.value || f) return;
|
|
2542
2545
|
const [
|
|
2543
2546
|
{ createApp: e },
|
|
2544
2547
|
{ createPinia: t },
|
|
@@ -2548,14 +2551,14 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2548
2551
|
] = await Promise.all([
|
|
2549
2552
|
import("vue"),
|
|
2550
2553
|
import("./pinia-CVat9nJz.js"),
|
|
2551
|
-
import("./InnerApp-
|
|
2552
|
-
import("./index-
|
|
2553
|
-
import("./index-
|
|
2554
|
+
import("./InnerApp-C2-PZLYN.js"),
|
|
2555
|
+
import("./index-oZ9yJaJz.js"),
|
|
2556
|
+
import("./index-D0lj_Nse.js")
|
|
2554
2557
|
]);
|
|
2555
2558
|
if (!L.value) return;
|
|
2556
2559
|
A = s.useSlidesStore, R = s.useScreenStore, F = s.useMainStore, O = s.useSnapshotStore;
|
|
2557
2560
|
const a = document.createElement("div");
|
|
2558
|
-
a.style.width = "100%", a.style.height = "100%", L.value.appendChild(a),
|
|
2561
|
+
a.style.width = "100%", a.style.height = "100%", L.value.appendChild(a), f = e(o, {
|
|
2559
2562
|
initData: c.initData,
|
|
2560
2563
|
onUploadFile: c.onUploadFile,
|
|
2561
2564
|
readonly: c.readonly,
|
|
@@ -2564,20 +2567,24 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2564
2567
|
onInitFinished: c.onInitFinished,
|
|
2565
2568
|
onReturn: c.onReturn,
|
|
2566
2569
|
theme: D.value
|
|
2567
|
-
}),
|
|
2568
|
-
},
|
|
2569
|
-
|
|
2570
|
+
}), S = t(), f.use(S), f.provide(W, { locale: E }), f.provide("__lt_ppt_theme__", D), f.provide("__lt_ppt_mode__", $), f.provide("__lt_ppt_image_ai_entry_enabled__", Y), f.config.globalProperties.$t = we(E), f.use(r), f.mount(a);
|
|
2571
|
+
}, le = () => {
|
|
2572
|
+
f && (f.unmount(), f = null, S = null), L.value && (L.value.innerHTML = "");
|
|
2570
2573
|
};
|
|
2571
|
-
|
|
2572
|
-
B =
|
|
2573
|
-
}),
|
|
2574
|
-
|
|
2575
|
-
}),
|
|
2574
|
+
Se(() => {
|
|
2575
|
+
B = ie();
|
|
2576
|
+
}), Ce(() => {
|
|
2577
|
+
le();
|
|
2578
|
+
}), M(() => c.locale, (e) => {
|
|
2576
2579
|
E.value = e ?? "zh-CN";
|
|
2577
|
-
}),
|
|
2580
|
+
}), M(() => c.theme, (e) => {
|
|
2578
2581
|
D.value = e ?? "dark";
|
|
2582
|
+
}), M(() => c.mode, (e) => {
|
|
2583
|
+
$.value = e ?? "default";
|
|
2579
2584
|
});
|
|
2580
|
-
const
|
|
2585
|
+
const ae = (e) => {
|
|
2586
|
+
$.value = e;
|
|
2587
|
+
}, b = () => !S || !A ? null : A(S), w = () => !S || !F ? null : F(S), re = () => !S || !O ? null : O(S), k = async () => (!S && B && await B, !!S), N = (e) => new Promise((t) => {
|
|
2581
2588
|
if (typeof Image > "u") {
|
|
2582
2589
|
t(null);
|
|
2583
2590
|
return;
|
|
@@ -2594,7 +2601,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2594
2601
|
height: o.naturalHeight || o.height
|
|
2595
2602
|
});
|
|
2596
2603
|
}, o.onerror = () => t(null), o.src = e;
|
|
2597
|
-
}), I = (e, t) => Number.isFinite(e) && e > 0 ? e : t,
|
|
2604
|
+
}), I = (e, t) => Number.isFinite(e) && e > 0 ? e : t, z = (e, t, o, r, s) => {
|
|
2598
2605
|
let a = I(e.width, (t == null ? void 0 : t.width) || s.width), l = I(e.height, (t == null ? void 0 : t.height) || s.height);
|
|
2599
2606
|
if (e.width !== void 0 && e.height === void 0 && (t != null && t.width) && t.height)
|
|
2600
2607
|
l = a * t.height / t.width;
|
|
@@ -2605,7 +2612,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2605
2612
|
a = t.width * p, l = t.height * p;
|
|
2606
2613
|
}
|
|
2607
2614
|
return { width: a, height: l };
|
|
2608
|
-
},
|
|
2615
|
+
}, H = (e) => new Promise((t) => {
|
|
2609
2616
|
if (typeof document > "u") {
|
|
2610
2617
|
t(null);
|
|
2611
2618
|
return;
|
|
@@ -2617,20 +2624,20 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2617
2624
|
}, o.onerror = () => {
|
|
2618
2625
|
o.onloadedmetadata = null, o.onerror = null, o.removeAttribute("src"), o.load(), t(null);
|
|
2619
2626
|
}, o.src = e;
|
|
2620
|
-
}), v = (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,
|
|
2621
|
-
const a = await
|
|
2622
|
-
return
|
|
2627
|
+
}), v = (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 }) => {
|
|
2628
|
+
const a = await N(e);
|
|
2629
|
+
return z(t, a, o, r, s);
|
|
2623
2630
|
}, x = async () => {
|
|
2624
|
-
const e =
|
|
2631
|
+
const e = re();
|
|
2625
2632
|
e && await e.addSnapshot();
|
|
2626
|
-
},
|
|
2633
|
+
}, de = async (e) => {
|
|
2627
2634
|
if (!e.src || !await k()) return null;
|
|
2628
|
-
const t = b(), o =
|
|
2635
|
+
const t = b(), o = w();
|
|
2629
2636
|
if (!t || !o || !t.slides.length) return null;
|
|
2630
2637
|
const r = v(t, e);
|
|
2631
2638
|
if (r === -1) return null;
|
|
2632
2639
|
t.slideIndex !== r && t.updateSlideIndex(r);
|
|
2633
|
-
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, { width: l, height: p } = await
|
|
2640
|
+
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
2641
|
type: "image",
|
|
2635
2642
|
id: h(10),
|
|
2636
2643
|
src: e.src,
|
|
@@ -2642,7 +2649,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2642
2649
|
rotate: e.rotate ?? 0
|
|
2643
2650
|
};
|
|
2644
2651
|
return t.addElement(d), e.select !== !1 && o.setActiveElementIdList([d.id]), await x(), JSON.parse(JSON.stringify(d));
|
|
2645
|
-
},
|
|
2652
|
+
}, ce = (e, t, o) => {
|
|
2646
2653
|
var p, h;
|
|
2647
2654
|
const r = !!o.slideId || o.slideIndex !== void 0, s = v(e, o), a = o.elementId || (t.activeElementIdList.length === 1 ? t.activeElementIdList[0] : t.handleElementId);
|
|
2648
2655
|
if (!a) return null;
|
|
@@ -2658,28 +2665,28 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2658
2665
|
if ((u == null ? void 0 : u.type) === "image") return { slideIndex: d, element: u };
|
|
2659
2666
|
}
|
|
2660
2667
|
return null;
|
|
2661
|
-
},
|
|
2668
|
+
}, ue = async (e) => {
|
|
2662
2669
|
if (!e.src || !await k()) return null;
|
|
2663
|
-
const t = b(), o =
|
|
2670
|
+
const t = b(), o = w();
|
|
2664
2671
|
if (!t || !o || !t.slides.length) return null;
|
|
2665
|
-
const r =
|
|
2672
|
+
const r = ce(t, o, e);
|
|
2666
2673
|
if (!r) return null;
|
|
2667
2674
|
const { slideIndex: s, element: a } = r, l = { src: e.src };
|
|
2668
2675
|
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
|
|
2676
|
+
const d = await N(e.src), u = I(e.width, a.width);
|
|
2670
2677
|
let y = I(e.height, a.height);
|
|
2671
2678
|
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
2679
|
}
|
|
2673
2680
|
const h = t.slides[s].id;
|
|
2674
2681
|
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await x(), JSON.parse(JSON.stringify({ ...a, ...l }));
|
|
2675
|
-
},
|
|
2682
|
+
}, pe = async (e) => {
|
|
2676
2683
|
if (!e.src || !await k()) return null;
|
|
2677
|
-
const t = b(), o =
|
|
2684
|
+
const t = b(), o = w();
|
|
2678
2685
|
if (!t || !o || !t.slides.length) return null;
|
|
2679
2686
|
const r = v(t, e);
|
|
2680
2687
|
if (r === -1) return null;
|
|
2681
2688
|
t.slideIndex !== r && t.updateSlideIndex(r);
|
|
2682
|
-
const s = t.viewportSize, a = t.viewportSize * t.viewportRatio, l = await
|
|
2689
|
+
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
2690
|
type: "video",
|
|
2684
2691
|
id: d(10),
|
|
2685
2692
|
src: e.src,
|
|
@@ -2691,7 +2698,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2691
2698
|
autoplay: e.autoplay ?? !1
|
|
2692
2699
|
};
|
|
2693
2700
|
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 x(), JSON.parse(JSON.stringify(u));
|
|
2694
|
-
},
|
|
2701
|
+
}, ge = (e, t, o) => {
|
|
2695
2702
|
var p, h;
|
|
2696
2703
|
const r = !!o.slideId || o.slideIndex !== void 0, s = v(e, o), a = o.elementId || (t.activeElementIdList.length === 1 ? t.activeElementIdList[0] : t.handleElementId);
|
|
2697
2704
|
if (!a) return null;
|
|
@@ -2714,7 +2721,7 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2714
2721
|
return e ? JSON.parse(JSON.stringify(e.slides)) : [];
|
|
2715
2722
|
},
|
|
2716
2723
|
getSelectedElements: () => {
|
|
2717
|
-
const e =
|
|
2724
|
+
const e = w();
|
|
2718
2725
|
return e ? JSON.parse(JSON.stringify(e.activeElementList)) : [];
|
|
2719
2726
|
},
|
|
2720
2727
|
setSlides: (e) => {
|
|
@@ -2722,45 +2729,46 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2722
2729
|
t && t.setSlides(e);
|
|
2723
2730
|
},
|
|
2724
2731
|
startScreening: () => {
|
|
2725
|
-
if (!
|
|
2726
|
-
R(
|
|
2732
|
+
if (!S || !R) return;
|
|
2733
|
+
R(S).setScreening(!0);
|
|
2727
2734
|
},
|
|
2728
2735
|
getCurrentIndex: () => {
|
|
2729
2736
|
const e = b();
|
|
2730
2737
|
return e ? e.slideIndex : 0;
|
|
2731
2738
|
},
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2739
|
+
setMode: ae,
|
|
2740
|
+
insertImage: de,
|
|
2741
|
+
replaceImage: ue,
|
|
2742
|
+
insertVideo: pe,
|
|
2735
2743
|
replaceVideo: async (e) => {
|
|
2736
2744
|
if (!e.src || !await k()) return null;
|
|
2737
|
-
const t = b(), o =
|
|
2745
|
+
const t = b(), o = w();
|
|
2738
2746
|
if (!t || !o || !t.slides.length) return null;
|
|
2739
|
-
const r =
|
|
2747
|
+
const r = ge(t, o, e);
|
|
2740
2748
|
if (!r) return null;
|
|
2741
2749
|
const { slideIndex: s, element: a } = r, l = { src: e.src };
|
|
2742
2750
|
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
|
|
2751
|
+
const d = await H(e.src), u = I(e.width, a.width);
|
|
2744
2752
|
let y = I(e.height, a.height);
|
|
2745
2753
|
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
2754
|
}
|
|
2747
2755
|
const h = t.slides[s].id;
|
|
2748
2756
|
return t.updateElement({ id: a.id, props: l, slideId: h }), t.slideIndex !== s && t.updateSlideIndex(s), e.select !== !1 && o.setActiveElementIdList([a.id]), await x(), JSON.parse(JSON.stringify({ ...a, ...l }));
|
|
2749
2757
|
}
|
|
2750
|
-
}), (e, t) => (
|
|
2758
|
+
}), (e, t) => (ye(), be("div", {
|
|
2751
2759
|
ref_key: "containerRef",
|
|
2752
2760
|
ref: L,
|
|
2753
2761
|
class: "lt-ppt-container",
|
|
2754
|
-
style:
|
|
2755
|
-
onImageAiEntryClick:
|
|
2762
|
+
style: Le(X.value),
|
|
2763
|
+
onImageAiEntryClick: ne
|
|
2756
2764
|
}, null, 36));
|
|
2757
2765
|
}
|
|
2758
|
-
}),
|
|
2766
|
+
}), xe = (n, i) => {
|
|
2759
2767
|
const g = n.__vccOpts || n;
|
|
2760
2768
|
for (const [c, m] of i)
|
|
2761
2769
|
g[c] = m;
|
|
2762
2770
|
return g;
|
|
2763
|
-
},
|
|
2771
|
+
}, Ee = /* @__PURE__ */ xe(ve, [["__scopeId", "data-v-32a63510"]]), Ae = [
|
|
2764
2772
|
"SourceHanSans",
|
|
2765
2773
|
"SourceHanSerif",
|
|
2766
2774
|
"WenDingPLSongTi",
|
|
@@ -2789,20 +2797,20 @@ const V = 4096 * 4096, Pe = 8e3, we = /* @__PURE__ */ ge({
|
|
|
2789
2797
|
"Montserrat",
|
|
2790
2798
|
"SourceSansPro",
|
|
2791
2799
|
"Merriweather"
|
|
2792
|
-
],
|
|
2800
|
+
], De = (n = "/fonts") => {
|
|
2793
2801
|
if (typeof document > "u" || !document.head) return;
|
|
2794
2802
|
const i = n.replace(/\/$/, ""), g = document.createElement("style");
|
|
2795
|
-
g.textContent =
|
|
2803
|
+
g.textContent = Ae.map(
|
|
2796
2804
|
(c) => `@font-face { font-display: swap; font-family: ${c}; src: url('${i}/${c}.woff2') format('woff2'); }`
|
|
2797
2805
|
).join(`
|
|
2798
2806
|
`), document.head.appendChild(g);
|
|
2799
2807
|
};
|
|
2800
2808
|
export {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2809
|
+
U as C,
|
|
2810
|
+
Ee as L,
|
|
2811
|
+
xe as _,
|
|
2812
|
+
V as a,
|
|
2813
|
+
Be as c,
|
|
2814
|
+
De as l,
|
|
2815
|
+
Oe as u
|
|
2808
2816
|
};
|