@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,51 +1,51 @@
1
- import { defineComponent as _, ref as n, watch as m, openBlock as i, createElementBlock as c, createElementVNode as r, toDisplayString as g, unref as h, createBlock as y } from "vue";
2
- import { u as w, b as k, k as x, J as T } from "./index-B3uQ1OoT.mjs";
3
- import { _ as b } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
- const B = {
1
+ import { defineComponent as m, ref as n, watch as _, openBlock as c, createElementBlock as p, createElementVNode as r, toDisplayString as g, unref as h, createBlock as y } from "vue";
2
+ import { u as w, c as k, k as x, B } from "./index-DZZN3kYi.mjs";
3
+ import { _ as T } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
+ const b = {
5
5
  key: 0,
6
6
  class: "vfp-renderer-loading"
7
7
  }, E = { class: "vfp-renderer-loading-content" }, G = { class: "vfp-renderer-loading-text" }, H = {
8
8
  key: 2,
9
9
  class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
10
- }, J = ["innerHTML"], F = /* @__PURE__ */ _({
10
+ }, L = ["innerHTML"], N = /* @__PURE__ */ m({
11
11
  __name: "index",
12
12
  props: {
13
13
  url: {}
14
14
  },
15
15
  setup(u, { expose: f }) {
16
- const p = u, { t: l } = w(), d = k(), t = n(""), s = n(!0), a = n(null), v = async () => {
16
+ const i = u, { t: l } = w(), d = k(), t = n(""), s = n(!0), a = n(null), v = async () => {
17
17
  s.value = !0, a.value = null, t.value = "";
18
18
  try {
19
- const e = await d.value(p.url);
19
+ const e = await d.value(i.url);
20
20
  if (!e.ok) throw new x("file.load_failed");
21
21
  const o = await e.arrayBuffer();
22
- t.value = await T(o);
22
+ t.value = await B(o);
23
23
  } catch (e) {
24
24
  console.error(l.value("ppt.parse_failed") + ":", e), a.value = l.value("ppt.parse_failed");
25
25
  } finally {
26
26
  s.value = !1;
27
27
  }
28
28
  };
29
- return m(() => p.url, (e) => {
29
+ return _(() => i.url, (e) => {
30
30
  e && v();
31
31
  }, { immediate: !0 }), f({
32
32
  getToolbarGroups: () => []
33
- }), (e, o) => s.value ? (i(), c("div", B, [
33
+ }), (e, o) => s.value ? (c(), p("div", b, [
34
34
  r("div", E, [
35
35
  o[0] || (o[0] = r("div", { class: "vfp-renderer-spinner" }, null, -1)),
36
36
  r("span", G, g(h(l)("common.loading")), 1)
37
37
  ])
38
- ])) : a.value ? (i(), y(b, {
38
+ ])) : a.value ? (c(), y(T, {
39
39
  key: 1,
40
40
  message: a.value
41
- }, null, 8, ["message"])) : (i(), c("div", H, [
41
+ }, null, 8, ["message"])) : (c(), p("div", H, [
42
42
  r("div", {
43
43
  class: "vfp-legacy-ppt-wrap",
44
44
  innerHTML: t.value
45
- }, null, 8, J)
45
+ }, null, 8, L)
46
46
  ]));
47
47
  }
48
48
  });
49
49
  export {
50
- F as default
50
+ N as default
51
51
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as L, ref as u, watch as M, computed as D, openBlock as l, createElementBlock as a, createElementVNode as r, toDisplayString as d, unref as v, createBlock as H, normalizeStyle as B, Fragment as w, renderList as F } from "vue";
2
- import { u as G, b as N, S as P } from "./index-B3uQ1OoT.mjs";
3
- import { u as X } from "./useShikiHighlight-DSyCygls.mjs";
4
- import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
1
+ import { defineComponent as L, ref as u, watch as M, computed as X, openBlock as l, createElementBlock as a, createElementVNode as r, toDisplayString as d, unref as v, createBlock as D, normalizeStyle as H, Fragment as w, renderList as B } from "vue";
2
+ import { u as F, c as G, X as N } from "./index-DZZN3kYi.mjs";
3
+ import { u as P } from "./useShikiHighlight-BPmcxA-h.mjs";
4
+ import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  const j = {
6
6
  key: 0,
7
7
  class: "vfp-renderer-loading"
@@ -20,7 +20,7 @@ const j = {
20
20
  fileName: {}
21
21
  },
22
22
  setup(k, { expose: x }) {
23
- const m = k, { t: g } = G(), b = N(), i = u(""), f = u(!0), c = u(null), S = u("xml"), { lineHtmls: _ } = X(i, S), T = (e) => {
23
+ const m = k, { t: g } = F(), b = G(), i = u(""), f = u(!0), c = u(null), S = u("xml"), { lineHtmls: _ } = P(i, S), T = (e) => {
24
24
  const t = " ", o = /(>)(<)(\/*)/g, s = e.replace(o, `$1
25
25
  $2$3`);
26
26
  let n = 0;
@@ -45,7 +45,7 @@ $2$3`);
45
45
  M(() => m.url, async () => {
46
46
  f.value = !0, c.value = null;
47
47
  try {
48
- const e = await P(m.url, { fetcher: b.value });
48
+ const e = await N(m.url, { fetcher: b.value });
49
49
  i.value = $(e);
50
50
  } catch (e) {
51
51
  console.error(e), c.value = g.value("xml.load_failed");
@@ -53,7 +53,7 @@ $2$3`);
53
53
  f.value = !1;
54
54
  }
55
55
  }, { immediate: !0 });
56
- const h = D(() => i.value.split(`
56
+ const h = X(() => i.value.split(`
57
57
  `));
58
58
  return x({
59
59
  getToolbarGroups: () => []
@@ -62,7 +62,7 @@ $2$3`);
62
62
  t[0] || (t[0] = r("div", { class: "vfp-renderer-spinner" }, null, -1)),
63
63
  r("span", A, d(v(g)("common.loading")), 1)
64
64
  ])
65
- ])) : c.value ? (l(), H(E, {
65
+ ])) : c.value ? (l(), D(E, {
66
66
  key: 1,
67
67
  message: c.value
68
68
  }, null, 8, ["message"])) : v(_).length === 0 ? (l(), a("div", C, [
@@ -70,9 +70,9 @@ $2$3`);
70
70
  ])) : (l(), a("div", O, [
71
71
  r("div", {
72
72
  class: "vfp-code-block with-line-numbers vfp-w-full",
73
- style: B({ gridTemplateRows: `repeat(${h.value.length}, auto) minmax(1.5rem, 1fr)` })
73
+ style: H({ gridTemplateRows: `repeat(${h.value.length}, auto) minmax(1.5rem, 1fr)` })
74
74
  }, [
75
- (l(!0), a(w, null, F(h.value, (o, s) => (l(), a(w, { key: s }, [
75
+ (l(!0), a(w, null, B(h.value, (o, s) => (l(), a(w, { key: s }, [
76
76
  r("span", R, d(s + 1), 1),
77
77
  r("span", {
78
78
  class: "vfp-code-line",
@@ -1,7 +1,7 @@
1
- import { defineComponent as M, ref as l, watch as y, nextTick as $, computed as T, openBlock as i, createElementBlock as p, createElementVNode as r, toDisplayString as B, unref as N, createBlock as I, normalizeStyle as d, Fragment as F, renderList as C } from "vue";
2
- import { u as R, b as j, H as q, k as z, h as O, m as U } from "./index-B3uQ1OoT.mjs";
1
+ import { defineComponent as M, ref as l, watch as y, nextTick as $, computed as k, openBlock as i, createElementBlock as p, createElementVNode as r, toDisplayString as B, unref as F, createBlock as N, normalizeStyle as d, Fragment as I, renderList as C } from "vue";
2
+ import { u as R, c as j, L as q, k as z, d as O, F as U } from "./index-DZZN3kYi.mjs";
3
3
  import V from "mammoth";
4
- import { _ as W } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
+ import { _ as W } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  const X = {
6
6
  key: 0,
7
7
  class: "vfp-renderer-loading"
@@ -9,13 +9,13 @@ const X = {
9
9
  key: 2,
10
10
  class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto",
11
11
  style: { background: "rgba(0, 0, 0, 0.15)" }
12
- }, Q = ["innerHTML"], Z = ["innerHTML"], k = 1123, w = 60, H = 50, ee = 24, re = /* @__PURE__ */ M({
12
+ }, Q = ["innerHTML"], Z = ["innerHTML"], T = 1123, w = 60, b = 50, ee = 24, re = /* @__PURE__ */ M({
13
13
  __name: "index",
14
14
  props: {
15
15
  url: {}
16
16
  },
17
- setup(b, { expose: G }) {
18
- const E = k - w * 2, h = b, { t: f } = R(), A = j(), a = l(""), v = l(!0), c = l(null), s = l([]), m = l({}), _ = l(null), P = async () => {
17
+ setup(G, { expose: H }) {
18
+ const E = T - w * 2, h = G, { t: f } = R(), A = j(), a = l(""), v = l(!0), c = l(null), s = l([]), m = l({}), _ = l(null), P = async () => {
19
19
  v.value = !0, c.value = null, a.value = "", s.value = [], m.value = {};
20
20
  try {
21
21
  const e = await A.value(h.url);
@@ -30,7 +30,7 @@ const X = {
30
30
  } finally {
31
31
  v.value = !1;
32
32
  }
33
- }, S = () => {
33
+ }, L = () => {
34
34
  const e = _.value;
35
35
  if (!e || !a.value) return;
36
36
  const n = Array.from(e.children);
@@ -49,48 +49,48 @@ const X = {
49
49
  y(() => h.url, (e) => {
50
50
  e && P();
51
51
  }, { immediate: !0 }), y(a, async () => {
52
- a.value && (await $(), requestAnimationFrame(() => S()));
52
+ a.value && (await $(), requestAnimationFrame(() => L()));
53
53
  });
54
- const g = T(() => q(m.value)), D = T(() => ({
54
+ const g = k(() => q(m.value)), S = k(() => ({
55
55
  ...g.value,
56
56
  position: "absolute",
57
57
  visibility: "hidden",
58
- width: `${794 - H * 2}px`,
58
+ width: `${794 - b * 2}px`,
59
59
  pointerEvents: "none"
60
- })), L = {
60
+ })), D = {
61
61
  width: "100%",
62
62
  maxWidth: "794px",
63
- minHeight: `${k}px`,
63
+ minHeight: `${T}px`,
64
64
  background: "white",
65
65
  boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)",
66
66
  flexShrink: 0,
67
- padding: `${w}px ${H}px`
67
+ padding: `${w}px ${b}px`
68
68
  };
69
- return G({
69
+ return H({
70
70
  getToolbarGroups: () => []
71
71
  }), (e, n) => v.value ? (i(), p("div", X, [
72
72
  r("div", Y, [
73
73
  n[0] || (n[0] = r("div", { class: "vfp-renderer-spinner" }, null, -1)),
74
- r("span", J, B(N(f)("common.loading")), 1)
74
+ r("span", J, B(F(f)("common.loading")), 1)
75
75
  ])
76
- ])) : c.value ? (i(), I(W, {
76
+ ])) : c.value ? (i(), N(W, {
77
77
  key: 1,
78
78
  message: c.value
79
79
  }, null, 8, ["message"])) : (i(), p("div", K, [
80
80
  r("div", {
81
81
  ref_key: "measureRef",
82
82
  ref: _,
83
- style: d(D.value),
83
+ style: d(S.value),
84
84
  innerHTML: a.value
85
85
  }, null, 12, Q),
86
86
  r("div", {
87
87
  class: "vfp-flex vfp-flex-col vfp-items-center",
88
88
  style: d({ gap: `${ee}px` })
89
89
  }, [
90
- (i(!0), p(F, null, C(s.value.length > 0 ? s.value : [""], (t, o) => (i(), p("div", {
90
+ (i(!0), p(I, null, C(s.value.length > 0 ? s.value : [""], (t, o) => (i(), p("div", {
91
91
  key: o,
92
92
  style: d({
93
- ...L,
93
+ ...D,
94
94
  boxShadow: "0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.10)"
95
95
  })
96
96
  }, [