lt-ppt 1.0.34 → 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.
@@ -1,4 +1,4 @@
1
- import { u as a, a as o, b as r, c as S, d as t } from "./screen-DPtasUXa.js";
1
+ import { u as a, a as o, b as r, c as S, d as t } from "./screen-D7zFgugS.js";
2
2
  export {
3
3
  a as useKeyboardStore,
4
4
  o as useMainStore,
@@ -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-BkSt5-a-.js";
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,4 +1,4 @@
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";
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
2
  var U = /* @__PURE__ */ ((n) => (n.RECT = "rect", n.ELLIPSE = "ellipse", n.POLYGON = "polygon", n))(U || {});
3
3
  const V = {
4
4
  rect: {
@@ -206,6 +206,11 @@ const V = {
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",
@@ -1356,6 +1361,11 @@ const V = {
1356
1361
  fitScreen: "Fit Screen",
1357
1362
  fitScreenShortcut: "Fit Screen (Ctrl + 0)"
1358
1363
  },
1364
+ miniStatus: {
1365
+ pagePrefix: "Page",
1366
+ pageUnit: "",
1367
+ totalPrefix: "of"
1368
+ },
1359
1369
  exportDialog: {
1360
1370
  exportPptist: "Export PPTIST File",
1361
1371
  exportPptx: "Export PPTX",
@@ -2399,30 +2409,30 @@ function Z(n, i = "") {
2399
2409
  return m && typeof m == "object" && !Array.isArray(m) ? Object.assign(g, Z(m, C)) : g[C] = String(m), g;
2400
2410
  }, {});
2401
2411
  }
2402
- const P = Object.fromEntries(
2412
+ const w = Object.fromEntries(
2403
2413
  Object.entries(Pe).map(([n, i]) => [n, Z(i)])
2404
2414
  );
2405
- function Oe() {
2406
- const n = he(W, { locale: T("zh-CN") });
2415
+ function Be() {
2416
+ const n = he(W, { locale: P("zh-CN") });
2407
2417
  return { t: (g) => {
2408
2418
  var c, m;
2409
- return ((c = P[n.locale.value]) == null ? void 0 : c[g]) ?? ((m = P["zh-CN"]) == null ? void 0 : m[g]) ?? g;
2419
+ return ((c = w[n.locale.value]) == null ? void 0 : c[g]) ?? ((m = w["zh-CN"]) == null ? void 0 : m[g]) ?? g;
2410
2420
  }, locale: n.locale };
2411
2421
  }
2412
2422
  function we(n) {
2413
2423
  return (i) => {
2414
2424
  var g, c;
2415
- return ((g = P[n.value]) == null ? void 0 : g[i]) ?? ((c = P["zh-CN"]) == null ? void 0 : c[i]) ?? i;
2425
+ return ((g = w[n.value]) == null ? void 0 : g[i]) ?? ((c = w["zh-CN"]) == null ? void 0 : c[i]) ?? i;
2416
2426
  };
2417
2427
  }
2418
- function Be(n) {
2419
- const i = T((n == null ? void 0 : n.locale) ?? "zh-CN");
2428
+ function Ee(n) {
2429
+ const i = P((n == null ? void 0 : n.locale) ?? "zh-CN");
2420
2430
  return {
2421
2431
  install() {
2422
2432
  },
2423
2433
  global: { locale: i, t: (c) => {
2424
2434
  var m, C;
2425
- return ((m = P[i.value]) == null ? void 0 : m[c]) ?? ((C = P["zh-CN"]) == null ? void 0 : C[c]) ?? c;
2435
+ return ((m = w[i.value]) == null ? void 0 : m[c]) ?? ((C = w["zh-CN"]) == null ? void 0 : C[c]) ?? c;
2426
2436
  } }
2427
2437
  };
2428
2438
  }
@@ -2445,9 +2455,9 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2445
2455
  },
2446
2456
  emits: ["image-ai-entry-click"],
2447
2457
  setup(n, { expose: i, emit: g }) {
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(() => ({
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(() => ({
2451
2461
  width: c.width,
2452
2462
  height: c.height
2453
2463
  })), J = () => {
@@ -2541,7 +2551,7 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2541
2551
  };
2542
2552
  (a = c.onImageAIEntryClick) == null || a.call(c, r), m("image-ai-entry-click", r);
2543
2553
  }, ie = async () => {
2544
- if (!L.value || f) return;
2554
+ if (!L.value || S) return;
2545
2555
  const [
2546
2556
  { createApp: e },
2547
2557
  { createPinia: t },
@@ -2551,14 +2561,14 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2551
2561
  ] = await Promise.all([
2552
2562
  import("vue"),
2553
2563
  import("./pinia-CVat9nJz.js"),
2554
- import("./InnerApp-C2-PZLYN.js"),
2555
- import("./index-oZ9yJaJz.js"),
2556
- import("./index-D0lj_Nse.js")
2564
+ import("./InnerApp-CNwfV0do.js"),
2565
+ import("./index-DG55cbxA.js"),
2566
+ import("./index-Bea9qCqB.js")
2557
2567
  ]);
2558
2568
  if (!L.value) return;
2559
- A = s.useSlidesStore, R = s.useScreenStore, F = s.useMainStore, O = s.useSnapshotStore;
2569
+ R = s.useSlidesStore, F = s.useScreenStore, O = s.useMainStore, B = s.useSnapshotStore;
2560
2570
  const a = document.createElement("div");
2561
- a.style.width = "100%", a.style.height = "100%", L.value.appendChild(a), f = e(o, {
2571
+ a.style.width = "100%", a.style.height = "100%", L.value.appendChild(a), S = e(o, {
2562
2572
  initData: c.initData,
2563
2573
  onUploadFile: c.onUploadFile,
2564
2574
  readonly: c.readonly,
@@ -2567,12 +2577,12 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2567
2577
  onInitFinished: c.onInitFinished,
2568
2578
  onReturn: c.onReturn,
2569
2579
  theme: D.value
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);
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);
2571
2581
  }, le = () => {
2572
- f && (f.unmount(), f = null, S = null), L.value && (L.value.innerHTML = "");
2582
+ S && (S.unmount(), S = null, f = null), L.value && (L.value.innerHTML = "");
2573
2583
  };
2574
2584
  Se(() => {
2575
- B = ie();
2585
+ k = ie();
2576
2586
  }), Ce(() => {
2577
2587
  le();
2578
2588
  }), M(() => c.locale, (e) => {
@@ -2584,7 +2594,7 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2584
2594
  });
2585
2595
  const ae = (e) => {
2586
2596
  $.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) => {
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) => {
2588
2598
  if (typeof Image > "u") {
2589
2599
  t(null);
2590
2600
  return;
@@ -2601,8 +2611,8 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2601
2611
  height: o.naturalHeight || o.height
2602
2612
  });
2603
2613
  }, o.onerror = () => t(null), o.src = e;
2604
- }), I = (e, t) => Number.isFinite(e) && e > 0 ? e : t, z = (e, t, o, r, s) => {
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);
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);
2606
2616
  if (e.width !== void 0 && e.height === void 0 && (t != null && t.width) && t.height)
2607
2617
  l = a * t.height / t.width;
2608
2618
  else if (e.height !== void 0 && e.width === void 0 && (t != null && t.width) && t.height)
@@ -2624,17 +2634,17 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2624
2634
  }, o.onerror = () => {
2625
2635
  o.onloadedmetadata = null, o.onerror = null, o.removeAttribute("src"), o.load(), t(null);
2626
2636
  }, o.src = e;
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 }) => {
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 }) => {
2628
2638
  const a = await N(e);
2629
2639
  return z(t, a, o, r, s);
2630
- }, x = async () => {
2640
+ }, A = async () => {
2631
2641
  const e = re();
2632
2642
  e && await e.addSnapshot();
2633
2643
  }, de = async (e) => {
2634
- if (!e.src || !await k()) return null;
2635
- const t = b(), o = w();
2644
+ if (!e.src || !await v()) return null;
2645
+ const t = b(), o = I();
2636
2646
  if (!t || !o || !t.slides.length) return null;
2637
- const r = v(t, e);
2647
+ const r = x(t, e);
2638
2648
  if (r === -1) return null;
2639
2649
  t.slideIndex !== r && t.updateSlideIndex(r);
2640
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 = {
@@ -2648,10 +2658,10 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2648
2658
  fixedRatio: e.fixedRatio ?? !0,
2649
2659
  rotate: e.rotate ?? 0
2650
2660
  };
2651
- return t.addElement(d), e.select !== !1 && o.setActiveElementIdList([d.id]), await x(), JSON.parse(JSON.stringify(d));
2661
+ return t.addElement(d), e.select !== !1 && o.setActiveElementIdList([d.id]), await A(), JSON.parse(JSON.stringify(d));
2652
2662
  }, ce = (e, t, o) => {
2653
2663
  var p, h;
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);
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);
2655
2665
  if (!a) return null;
2656
2666
  if (r || !o.elementId) {
2657
2667
  if (s === -1) return null;
@@ -2666,24 +2676,24 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2666
2676
  }
2667
2677
  return null;
2668
2678
  }, ue = async (e) => {
2669
- if (!e.src || !await k()) return null;
2670
- const t = b(), o = w();
2679
+ if (!e.src || !await v()) return null;
2680
+ const t = b(), o = I();
2671
2681
  if (!t || !o || !t.slides.length) return null;
2672
2682
  const r = ce(t, o, e);
2673
2683
  if (!r) return null;
2674
2684
  const { slideIndex: s, element: a } = r, l = { src: e.src };
2675
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)) {
2676
- const d = await N(e.src), u = I(e.width, a.width);
2677
- let y = I(e.height, a.height);
2686
+ const d = await N(e.src), u = T(e.width, a.width);
2687
+ let y = T(e.height, a.height);
2678
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;
2679
2689
  }
2680
2690
  const h = t.slides[s].id;
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 }));
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 }));
2682
2692
  }, pe = async (e) => {
2683
- if (!e.src || !await k()) return null;
2684
- const t = b(), o = w();
2693
+ if (!e.src || !await v()) return null;
2694
+ const t = b(), o = I();
2685
2695
  if (!t || !o || !t.slides.length) return null;
2686
- const r = v(t, e);
2696
+ const r = x(t, e);
2687
2697
  if (r === -1) return null;
2688
2698
  t.slideIndex !== r && t.updateSlideIndex(r);
2689
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 = {
@@ -2697,10 +2707,10 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2697
2707
  rotate: e.rotate ?? 0,
2698
2708
  autoplay: e.autoplay ?? !1
2699
2709
  };
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));
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));
2701
2711
  }, ge = (e, t, o) => {
2702
2712
  var p, h;
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);
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);
2704
2714
  if (!a) return null;
2705
2715
  if (r || !o.elementId) {
2706
2716
  if (s === -1) return null;
@@ -2721,7 +2731,7 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2721
2731
  return e ? JSON.parse(JSON.stringify(e.slides)) : [];
2722
2732
  },
2723
2733
  getSelectedElements: () => {
2724
- const e = w();
2734
+ const e = I();
2725
2735
  return e ? JSON.parse(JSON.stringify(e.activeElementList)) : [];
2726
2736
  },
2727
2737
  setSlides: (e) => {
@@ -2729,31 +2739,42 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2729
2739
  t && t.setSlides(e);
2730
2740
  },
2731
2741
  startScreening: () => {
2732
- if (!S || !R) return;
2733
- R(S).setScreening(!0);
2742
+ if (!f || !F) return;
2743
+ F(f).setScreening(!0);
2734
2744
  },
2735
2745
  getCurrentIndex: () => {
2736
2746
  const e = b();
2737
2747
  return e ? e.slideIndex : 0;
2738
2748
  },
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
+ },
2739
2760
  setMode: ae,
2740
2761
  insertImage: de,
2741
2762
  replaceImage: ue,
2742
2763
  insertVideo: pe,
2743
2764
  replaceVideo: async (e) => {
2744
- if (!e.src || !await k()) return null;
2745
- const t = b(), o = w();
2765
+ if (!e.src || !await v()) return null;
2766
+ const t = b(), o = I();
2746
2767
  if (!t || !o || !t.slides.length) return null;
2747
2768
  const r = ge(t, o, e);
2748
2769
  if (!r) return null;
2749
2770
  const { slideIndex: s, element: a } = r, l = { src: e.src };
2750
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)) {
2751
- const d = await H(e.src), u = I(e.width, a.width);
2752
- let y = I(e.height, a.height);
2772
+ const d = await H(e.src), u = T(e.width, a.width);
2773
+ let y = T(e.height, a.height);
2753
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;
2754
2775
  }
2755
2776
  const h = t.slides[s].id;
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 }));
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 }));
2757
2778
  }
2758
2779
  }), (e, t) => (ye(), be("div", {
2759
2780
  ref_key: "containerRef",
@@ -2768,7 +2789,7 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2768
2789
  for (const [c, m] of i)
2769
2790
  g[c] = m;
2770
2791
  return g;
2771
- }, Ee = /* @__PURE__ */ xe(ve, [["__scopeId", "data-v-32a63510"]]), Ae = [
2792
+ }, De = /* @__PURE__ */ xe(ve, [["__scopeId", "data-v-ac370e87"]]), Ae = [
2772
2793
  "SourceHanSans",
2773
2794
  "SourceHanSerif",
2774
2795
  "WenDingPLSongTi",
@@ -2797,7 +2818,7 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2797
2818
  "Montserrat",
2798
2819
  "SourceSansPro",
2799
2820
  "Merriweather"
2800
- ], De = (n = "/fonts") => {
2821
+ ], $e = (n = "/fonts") => {
2801
2822
  if (typeof document > "u" || !document.head) return;
2802
2823
  const i = n.replace(/\/$/, ""), g = document.createElement("style");
2803
2824
  g.textContent = Ae.map(
@@ -2807,10 +2828,10 @@ const _ = 4096 * 4096, ke = 8e3, ve = /* @__PURE__ */ me({
2807
2828
  };
2808
2829
  export {
2809
2830
  U as C,
2810
- Ee as L,
2831
+ De as L,
2811
2832
  xe as _,
2812
2833
  V as a,
2813
- Be as c,
2814
- De as l,
2815
- Oe as u
2834
+ Ee as c,
2835
+ $e as l,
2836
+ Be as u
2816
2837
  };