@eternalheart/vue-file-preview 1.6.12 → 1.6.13

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.
Files changed (51) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/lib/FilePreviewContent.vue.d.ts +9 -1
  4. package/lib/FilePreviewEmbed.vue.d.ts +4 -1
  5. package/lib/FilePreviewModal.vue.d.ts +4 -1
  6. package/lib/chunks/EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs +20 -0
  7. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs +32 -0
  8. package/lib/chunks/{avifLoader-CAUzjn-d-CTy7cevh.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
  9. package/lib/chunks/{heicLoader-D_9PukkA-DdDu94xL.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
  10. package/lib/chunks/{index-CLM9sOKN.mjs → index--612Smof.mjs} +112 -112
  11. package/lib/chunks/{index-De-oaCgN.mjs → index-8Vpbg2kS.mjs} +2 -2
  12. package/lib/chunks/{index-2VQLB2Mi.mjs → index-B21EAyWz.mjs} +53 -49
  13. package/lib/chunks/{index-DmEMePjL.mjs → index-BASg1cr4.mjs} +2 -2
  14. package/lib/chunks/index-BB0i4QqI.mjs +117 -0
  15. package/lib/chunks/{index-Bmqn45d_.mjs → index-BVdrGK3Q.mjs} +72 -72
  16. package/lib/chunks/index-BlrFFeqc.mjs +330 -0
  17. package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
  18. package/lib/chunks/{index-i-KacQvS.mjs → index-BuqPb5mP.mjs} +3 -3
  19. package/lib/chunks/{index-DVG1fZAv.mjs → index-BvBqDq3O.mjs} +2 -2
  20. package/lib/chunks/{index-D6te_qaB.mjs → index-Bxpf9v5j.mjs} +26 -26
  21. package/lib/chunks/{index-D9z6lQat.mjs → index-C9mAajbD.mjs} +225 -220
  22. package/lib/chunks/{index-CM11hSQu.mjs → index-CDg6vIbT.mjs} +11 -11
  23. package/lib/chunks/{index-BxmX005K.mjs → index-CWE-hKSs.mjs} +11 -11
  24. package/lib/chunks/{index-BPmyF7Wr.mjs → index-CY3xzGgt.mjs} +18 -18
  25. package/lib/chunks/{index-t9kSzzMg.mjs → index-CxKZKUJj.mjs} +521 -523
  26. package/lib/chunks/{index-CuiEjR23.mjs → index-D30L8tm9.mjs} +15 -15
  27. package/lib/chunks/{index-DOAOk6m5.mjs → index-DN4Ui0Gh.mjs} +11 -11
  28. package/lib/chunks/{index-CEk6FKm3.mjs → index-DZZN3kYi.mjs} +551 -531
  29. package/lib/chunks/{index-D6Pjjxi0.mjs → index-Dkro_8Fy.mjs} +20 -20
  30. package/lib/chunks/{index-CiGUKdlt.mjs → index-VdzIFJJW.mjs} +23 -23
  31. package/lib/chunks/{index-WcAnJA2t.mjs → index-aoXgVLBb.mjs} +14 -14
  32. package/lib/chunks/{jp2Loader-Dig19xyo-BBR3tcPW.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
  33. package/lib/chunks/{psdLoader-C0tKUXXl-DGOmJwkQ.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
  34. package/lib/chunks/{rawLoader-C-tPeFAB-CrCtXMup.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
  35. package/lib/chunks/{tiffLoader-BlhByX8w-jsxHlbyu.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
  36. package/lib/chunks/{useShikiHighlight-BdhPCj48.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
  37. package/lib/index.cjs +59 -59
  38. package/lib/index.css +1 -1
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.mjs +4 -4
  41. package/lib/renderers/EmptyState.vue.d.ts +2 -0
  42. package/lib/renderers/Json/index.vue.d.ts +5 -0
  43. package/lib/renderers/Pptx/index.vue.d.ts +3 -0
  44. package/lib/renderers/Text/index.vue.d.ts +3 -0
  45. package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
  46. package/lib/renderers/registry.d.ts +3 -1
  47. package/package.json +1 -1
  48. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
  49. package/lib/chunks/index-Bfg5zM8l.mjs +0 -141
  50. package/lib/chunks/index-Cud9j9Xy.mjs +0 -322
  51. package/lib/chunks/index-D4jhvs5m.mjs +0 -113
@@ -1,40 +1,40 @@
1
- import { defineComponent as h, ref as v, onMounted as x, watch as w, onBeforeUnmount as b, openBlock as c, createBlock as E, createElementBlock as m, createElementVNode as a, toDisplayString as C, unref as D, createCommentVNode as B } from "vue";
1
+ import { defineComponent as h, ref as v, onMounted as w, watch as x, onBeforeUnmount as b, openBlock as c, createBlock as E, createElementBlock as m, createElementVNode as a, toDisplayString as C, unref as D, createCommentVNode as B } from "vue";
2
2
  import N from "video.js";
3
- import { u as P, g as _ } from "./index-CEk6FKm3.mjs";
4
- import { _ as R } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
3
+ import { u as P, y } from "./index-DZZN3kYi.mjs";
4
+ import { _ as R } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  const S = {
6
6
  key: 1,
7
7
  class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
8
8
  }, U = { class: "vfp-w-full vfp-h-full vfp-relative" }, V = {
9
9
  key: 0,
10
10
  class: "vfp-absolute vfp-inset-0 vfp-renderer-loading vfp-bg-surface-3 vfp-backdrop-blur-sm vfp-z-10"
11
- }, j = { class: "vfp-renderer-loading-content" }, q = { class: "vfp-renderer-loading-text vfp-text-sm vfp-text-fg-secondary vfp-font-medium" }, M = /* @__PURE__ */ h({
11
+ }, j = { class: "vfp-renderer-loading-content" }, q = { class: "vfp-renderer-loading-text" }, M = /* @__PURE__ */ h({
12
12
  __name: "index",
13
13
  props: {
14
14
  url: {},
15
15
  fileName: {},
16
16
  mimeType: {}
17
17
  },
18
- setup(y, { expose: g }) {
19
- const o = y, { t: l } = P(), k = /* @__PURE__ */ new Set(["avi", "wmv", "flv"]), i = v(null), u = v(!0), d = v(null);
18
+ setup(_, { expose: g }) {
19
+ const o = _, { t } = P(), k = /* @__PURE__ */ new Set(["avi", "wmv", "flv"]), i = v(null), u = v(!0), d = v(null);
20
20
  let e = null;
21
21
  const T = (s, r) => {
22
22
  var n;
23
23
  return ((n = (r || s).split(".").pop()) == null ? void 0 : n.toLowerCase().split("?")[0]) || "";
24
24
  };
25
- return x(() => {
25
+ return w(() => {
26
26
  if (!d.value || e) return;
27
27
  const s = T(o.url, o.fileName);
28
28
  if (k.has(s)) {
29
29
  i.value = {
30
- title: l.value("video.unsupported_title"),
31
- detail: l.value("video.unsupported_detail", { format: s.toUpperCase() })
30
+ title: t.value("video.unsupported_title"),
31
+ detail: t.value("video.unsupported_detail", { format: s.toUpperCase() })
32
32
  }, u.value = !1;
33
33
  return;
34
34
  }
35
35
  const r = document.createElement("video-js");
36
36
  r.classList.add("vjs-big-play-centered", "rfp-video-player"), d.value.appendChild(r);
37
- const p = _(o.url, o.mimeType);
37
+ const p = y(o.url, o.mimeType);
38
38
  let n;
39
39
  p === "video/quicktime" ? n = [
40
40
  { src: o.url, type: "video/quicktime" },
@@ -71,21 +71,21 @@ const S = {
71
71
  f && (f.style.objectFit = "contain"), e.on("loadeddata", () => {
72
72
  u.value = !1;
73
73
  }), e.on("error", () => {
74
- const t = e == null ? void 0 : e.error();
75
- console.warn("[VideoRenderer] Video playback error:", (t == null ? void 0 : t.message) || "Unknown error"), (t == null ? void 0 : t.code) === 4 ? i.value = {
76
- title: l.value("video.unsupported_title"),
77
- detail: l.value("video.unsupported_detail", {
78
- format: s ? s.toUpperCase() : l.value("common.unknown_error")
74
+ const l = e == null ? void 0 : e.error();
75
+ console.warn("[VideoRenderer] Video playback error:", (l == null ? void 0 : l.message) || "Unknown error"), (l == null ? void 0 : l.code) === 4 ? i.value = {
76
+ title: t.value("video.unsupported_title"),
77
+ detail: t.value("video.unsupported_detail", {
78
+ format: s ? s.toUpperCase() : t.value("common.unknown_error")
79
79
  })
80
80
  } : i.value = {
81
- title: l.value("video.load_failed"),
82
- detail: (t == null ? void 0 : t.message) || l.value("common.unknown_error")
81
+ title: t.value("video.load_failed"),
82
+ detail: (l == null ? void 0 : l.message) || t.value("common.unknown_error")
83
83
  }, u.value = !1;
84
84
  });
85
- }), w(
85
+ }), x(
86
86
  [() => o.url, () => o.mimeType],
87
87
  () => {
88
- e && !e.isDisposed() && e.src({ src: o.url, type: _(o.url, o.mimeType) });
88
+ e && !e.isDisposed() && e.src({ src: o.url, type: y(o.url, o.mimeType) });
89
89
  }
90
90
  ), b(() => {
91
91
  e && !e.isDisposed() && (e.dispose(), e = null);
@@ -100,7 +100,7 @@ const S = {
100
100
  u.value ? (c(), m("div", V, [
101
101
  a("div", j, [
102
102
  r[0] || (r[0] = a("div", { class: "vfp-renderer-spinner" }, null, -1)),
103
- a("p", q, C(D(l)("video.loading")), 1)
103
+ a("p", q, C(D(t)("video.loading")), 1)
104
104
  ])
105
105
  ])) : B("", !0),
106
106
  a("div", {
@@ -1,23 +1,23 @@
1
- import { defineComponent as L, ref as y, watch as G, computed as g, openBlock as a, createElementBlock as r, createElementVNode as e, toDisplayString as o, unref as n, createBlock as S, normalizeClass as b, Fragment as h, renderList as k, createCommentVNode as T } from "vue";
2
- import { u as V, b as z, D as I, A as d, T as M, _ as O } from "./index-CEk6FKm3.mjs";
3
- import { _ as R } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
- const X = {
1
+ import { defineComponent as X, ref as y, watch as Y, computed as g, openBlock as a, createElementBlock as r, createElementVNode as e, toDisplayString as o, unref as n, createBlock as S, normalizeClass as k, Fragment as h, renderList as b, createCommentVNode as T } from "vue";
2
+ import { u as V, c as z, G as A, Y as d, X as D, _ as I } from "./index-DZZN3kYi.mjs";
3
+ import { _ as M } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
+ const O = {
5
5
  key: 0,
6
6
  class: "vfp-renderer-loading vfp-bg-[#0f0f12]"
7
- }, Y = { class: "vfp-renderer-loading-content" }, $ = { class: "vfp-renderer-loading-text" }, j = { class: "content-scroll" }, q = { class: "timeline" }, H = { class: "cues" }, J = { class: "cue-meta" }, K = { class: "cue-time" }, P = { class: "cue-time" }, Q = { class: "cue-id" }, U = {
7
+ }, R = { class: "vfp-renderer-loading-content" }, $ = { class: "vfp-renderer-loading-text" }, j = { class: "content-scroll" }, q = { class: "timeline" }, H = { class: "cues" }, J = { class: "cue-meta" }, K = { class: "cue-time" }, P = { class: "cue-time" }, Q = { class: "cue-id" }, U = {
8
8
  key: 0,
9
9
  class: "cue-style"
10
10
  }, W = {
11
11
  key: 0,
12
12
  class: "cue-words"
13
- }, Z = ["title"], ee = { class: "cue-word-time" }, se = { class: "cue-word-text" }, te = { class: "status-pill" }, le = /* @__PURE__ */ L({
13
+ }, Z = ["title"], ee = { class: "cue-word-time" }, se = { class: "cue-word-text" }, te = { class: "status-pill" }, le = /* @__PURE__ */ X({
14
14
  __name: "index",
15
15
  props: {
16
16
  url: {},
17
17
  fileName: {}
18
18
  },
19
19
  setup(B, { expose: C }) {
20
- const v = B, { t: i } = V(), F = z(), p = y(""), f = y(!0), u = y(null), N = {
20
+ const v = B, { t: i } = V(), F = z(), p = y(""), f = y(!0), u = y(null), G = {
21
21
  srt: "srt",
22
22
  vtt: "vtt",
23
23
  lrc: "lrc",
@@ -26,15 +26,15 @@ const X = {
26
26
  ssa: "ssa",
27
27
  ttml: "ttml",
28
28
  dfxp: "ttml"
29
- }, A = (t) => {
29
+ }, N = (t) => {
30
30
  var l;
31
31
  const s = ((l = t.split(".").pop()) == null ? void 0 : l.toLowerCase()) || "";
32
- return N[s];
32
+ return G[s];
33
33
  };
34
- G(() => v.url, async () => {
34
+ Y(() => v.url, async () => {
35
35
  f.value = !0, u.value = null;
36
36
  try {
37
- p.value = await M(v.url, { fetcher: F.value });
37
+ p.value = await D(v.url, { fetcher: F.value });
38
38
  } catch (t) {
39
39
  console.error(t), u.value = i.value("subtitle.load_failed");
40
40
  } finally {
@@ -44,7 +44,7 @@ const X = {
44
44
  const c = g(() => {
45
45
  if (!p.value) return null;
46
46
  try {
47
- return I(p.value, A(v.fileName));
47
+ return A(p.value, N(v.fileName));
48
48
  } catch (t) {
49
49
  return console.error(t), null;
50
50
  }
@@ -54,27 +54,27 @@ const X = {
54
54
  }), x = g(() => {
55
55
  var t;
56
56
  return ((t = c.value) == null ? void 0 : t.metadata) ?? {};
57
- }), D = (t) => d(t).slice(3, 8);
57
+ }), E = (t) => d(t).slice(3, 8);
58
58
  return C({
59
59
  getToolbarGroups: () => []
60
- }), (t, s) => f.value ? (a(), r("div", X, [
61
- e("div", Y, [
60
+ }), (t, s) => f.value ? (a(), r("div", O, [
61
+ e("div", R, [
62
62
  s[0] || (s[0] = e("div", { class: "vfp-renderer-spinner" }, null, -1)),
63
63
  e("span", $, o(n(i)("common.loading")), 1)
64
64
  ])
65
- ])) : u.value || !c.value ? (a(), S(R, {
65
+ ])) : u.value || !c.value ? (a(), S(M, {
66
66
  key: 1,
67
67
  message: u.value || n(i)("subtitle.parse_failed"),
68
68
  class: "vfp-bg-[#0f0f12]"
69
69
  }, null, 8, ["message"])) : (a(), r("div", {
70
70
  key: 2,
71
- class: b(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", m.value ? "flavor-lyric" : "flavor-subtitle"])
71
+ class: k(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", m.value ? "flavor-lyric" : "flavor-subtitle"])
72
72
  }, [
73
73
  e("div", j, [
74
74
  e("div", q, [
75
75
  s[3] || (s[3] = e("div", { class: "timeline-line" }, null, -1)),
76
76
  e("ol", H, [
77
- (a(!0), r(h, null, k(c.value.cues, (l, w) => (a(), r("li", {
77
+ (a(!0), r(h, null, b(c.value.cues, (l, w) => (a(), r("li", {
78
78
  key: "cue-" + w,
79
79
  class: "cue-row"
80
80
  }, [
@@ -87,17 +87,17 @@ const X = {
87
87
  l.style ? (a(), r("span", U, o(l.style), 1)) : T("", !0)
88
88
  ]),
89
89
  l.words && l.words.length > 0 ? (a(), r("div", W, [
90
- (a(!0), r(h, null, k(l.words, (_, E) => (a(), r("span", {
91
- key: "w-" + E,
90
+ (a(!0), r(h, null, b(l.words, (_, L) => (a(), r("span", {
91
+ key: "w-" + L,
92
92
  class: "cue-word",
93
93
  title: n(d)(_.start)
94
94
  }, [
95
- e("span", ee, o(D(_.start)), 1),
95
+ e("span", ee, o(E(_.start)), 1),
96
96
  e("span", se, o(_.text), 1)
97
97
  ], 8, Z))), 128))
98
98
  ])) : (a(), r("p", {
99
99
  key: 1,
100
- class: b(["cue-text", { lyric: m.value }])
100
+ class: k(["cue-text", { lyric: m.value }])
101
101
  }, o(l.text), 3))
102
102
  ]))), 128))
103
103
  ])
@@ -112,7 +112,7 @@ const X = {
112
112
  ])
113
113
  ], 2));
114
114
  }
115
- }), ie = /* @__PURE__ */ O(le, [["__scopeId", "data-v-e2b8685e"]]);
115
+ }), ie = /* @__PURE__ */ I(le, [["__scopeId", "data-v-e2b8685e"]]);
116
116
  export {
117
117
  ie as default
118
118
  };
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as _, ref as n, watch as m, openBlock as c, createElementBlock as f, createElementVNode as o, toDisplayString as h, unref as g, createBlock as y } from "vue";
2
- import { u as x, b as k, k as w, J as T } from "./index-CEk6FKm3.mjs";
3
- import { _ as b } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
- const B = {
2
+ import { u as x, c as k, k as w, H as T } from "./index-DZZN3kYi.mjs";
3
+ import { _ as B } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
+ const H = {
5
5
  key: 0,
6
6
  class: "vfp-renderer-loading"
7
- }, D = { class: "vfp-renderer-loading-content" }, E = { class: "vfp-renderer-loading-text" }, G = {
7
+ }, b = { class: "vfp-renderer-loading-content" }, D = { class: "vfp-renderer-loading-text" }, E = {
8
8
  key: 2,
9
9
  class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
10
- }, H = { class: "vfp-flex vfp-flex-col vfp-items-center" }, J = { class: "vfp-legacy-doc-paper" }, L = ["innerHTML"], S = /* @__PURE__ */ _({
10
+ }, G = { class: "vfp-flex vfp-flex-col vfp-items-center" }, L = { class: "vfp-legacy-doc-paper" }, M = ["innerHTML"], V = /* @__PURE__ */ _({
11
11
  __name: "index",
12
12
  props: {
13
13
  url: {}
@@ -30,23 +30,23 @@ const B = {
30
30
  e && v();
31
31
  }, { immediate: !0 }), d({
32
32
  getToolbarGroups: () => []
33
- }), (e, a) => t.value ? (c(), f("div", B, [
34
- o("div", D, [
33
+ }), (e, a) => t.value ? (c(), f("div", H, [
34
+ o("div", b, [
35
35
  a[0] || (a[0] = o("div", { class: "vfp-renderer-spinner" }, null, -1)),
36
- o("span", E, h(g(l)("common.loading")), 1)
36
+ o("span", D, h(g(l)("common.loading")), 1)
37
37
  ])
38
- ])) : s.value ? (c(), y(b, {
38
+ ])) : s.value ? (c(), y(B, {
39
39
  key: 1,
40
40
  message: s.value
41
- }, null, 8, ["message"])) : (c(), f("div", G, [
42
- o("div", H, [
43
- o("div", J, [
44
- o("div", { innerHTML: r.value }, null, 8, L)
41
+ }, null, 8, ["message"])) : (c(), f("div", E, [
42
+ o("div", G, [
43
+ o("div", L, [
44
+ o("div", { innerHTML: r.value }, null, 8, M)
45
45
  ])
46
46
  ])
47
47
  ]));
48
48
  }
49
49
  });
50
50
  export {
51
- S as default
51
+ V as default
52
52
  };