@eternalheart/vue-file-preview 1.6.11 → 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 (54) 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-Bv80osgL.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
  9. package/lib/chunks/{heicLoader-D_9PukkA-c40agcEu.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
  10. package/lib/chunks/{index-CO713RPO.mjs → index--612Smof.mjs} +118 -118
  11. package/lib/chunks/{index-Dw6YZA28.mjs → index-8Vpbg2kS.mjs} +2 -2
  12. package/lib/chunks/index-B21EAyWz.mjs +137 -0
  13. package/lib/chunks/{index-CrLeFRdr.mjs → index-BASg1cr4.mjs} +2 -2
  14. package/lib/chunks/index-BB0i4QqI.mjs +117 -0
  15. package/lib/chunks/{index-C92b547K.mjs → index-BVdrGK3Q.mjs} +80 -80
  16. package/lib/chunks/index-BlrFFeqc.mjs +330 -0
  17. package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
  18. package/lib/chunks/index-BuqPb5mP.mjs +306 -0
  19. package/lib/chunks/{index-Df-1MbYj.mjs → index-BvBqDq3O.mjs} +2 -2
  20. package/lib/chunks/{index-BkqPtbFz.mjs → index-Bxpf9v5j.mjs} +29 -29
  21. package/lib/chunks/{index-DpY9eMSI.mjs → index-C9mAajbD.mjs} +231 -226
  22. package/lib/chunks/{index-DTZVumT8.mjs → index-CDg6vIbT.mjs} +14 -14
  23. package/lib/chunks/{index-By8q8XPn.mjs → index-CWE-hKSs.mjs} +10 -10
  24. package/lib/chunks/{index-DbOpSm8f.mjs → index-CY3xzGgt.mjs} +19 -19
  25. package/lib/chunks/{index-C8pOqpTq.mjs → index-CxKZKUJj.mjs} +521 -523
  26. package/lib/chunks/{index-Cyg4lWK-.mjs → index-D30L8tm9.mjs} +12 -12
  27. package/lib/chunks/{index-DfC_cA90.mjs → index-DN4Ui0Gh.mjs} +24 -24
  28. package/lib/chunks/{index-B3uQ1OoT.mjs → index-DZZN3kYi.mjs} +832 -812
  29. package/lib/chunks/{index-BpKvjFVp.mjs → index-Dkro_8Fy.mjs} +20 -20
  30. package/lib/chunks/{index-B35jLxPz.mjs → index-VdzIFJJW.mjs} +26 -26
  31. package/lib/chunks/{index--D2MwF_x.mjs → index-aoXgVLBb.mjs} +10 -10
  32. package/lib/chunks/{jp2Loader-Dig19xyo-82PXw2fC.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
  33. package/lib/chunks/{psdLoader-C0tKUXXl-DRn7RYLA.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
  34. package/lib/chunks/{rawLoader-C-tPeFAB-DP397Cnq.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
  35. package/lib/chunks/{tiffLoader-BlhByX8w-BC52z4Tf.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
  36. package/lib/chunks/{useShikiHighlight-DSyCygls.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
  37. package/lib/index.cjs +63 -63
  38. package/lib/index.css +1 -1
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.mjs +6 -6
  41. package/lib/renderers/Cad/toolbar.d.ts +1 -0
  42. package/lib/renderers/EmptyState.vue.d.ts +2 -0
  43. package/lib/renderers/Json/index.vue.d.ts +5 -0
  44. package/lib/renderers/Pptx/index.vue.d.ts +3 -0
  45. package/lib/renderers/Text/index.vue.d.ts +3 -0
  46. package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
  47. package/lib/renderers/registry.d.ts +3 -1
  48. package/package.json +1 -1
  49. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
  50. package/lib/chunks/index-2xdBoG-I.mjs +0 -141
  51. package/lib/chunks/index-B2xLxhp0.mjs +0 -133
  52. package/lib/chunks/index-DKJ_iQ70.mjs +0 -295
  53. package/lib/chunks/index-DMwZXKa4.mjs +0 -322
  54. package/lib/chunks/index-DyP3rhuf.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, l as _ } from "./index-B3uQ1OoT.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 V, normalizeClass as b, Fragment as h, renderList as k, createCommentVNode as B } from "vue";
2
- import { u as z, b as D, A as I, B as d, S as M, _ as O } from "./index-B3uQ1OoT.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
- setup(T, { expose: C }) {
20
- const v = T, { t: i } = z(), F = D(), p = y(""), f = y(!0), u = y(null), N = {
19
+ setup(B, { expose: C }) {
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
- }, S = (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, S(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
- }), A = (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(), V(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
  }, [
@@ -84,20 +84,20 @@ const X = {
84
84
  s[1] || (s[1] = e("span", { class: "cue-arrow" }, "→", -1)),
85
85
  e("span", P, o(n(d)(l.end)), 1),
86
86
  e("span", Q, "#" + o(l.id ?? w + 1), 1),
87
- l.style ? (a(), r("span", U, o(l.style), 1)) : B("", !0)
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(A(_.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
  ])
@@ -108,11 +108,11 @@ const X = {
108
108
  x.value.length ? (a(), r(h, { key: 0 }, [
109
109
  s[4] || (s[4] = e("span", { class: "dot" }, "·", -1)),
110
110
  e("span", null, o(x.value.length), 1)
111
- ], 64)) : B("", !0)
111
+ ], 64)) : T("", !0)
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, E as T } from "./index-B3uQ1OoT.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
- }, E = { class: "vfp-renderer-loading-content" }, D = { 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" }, L = { class: "vfp-legacy-doc-paper" }, M = ["innerHTML"], V = /* @__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,16 +30,16 @@ 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", E, [
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
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, [
41
+ }, null, 8, ["message"])) : (c(), f("div", E, [
42
+ o("div", G, [
43
43
  o("div", L, [
44
44
  o("div", { innerHTML: r.value }, null, 8, M)
45
45
  ])