@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,113 +0,0 @@
1
- import { defineComponent as N, ref as v, computed as f, watch as k, unref as d, openBlock as a, createElementBlock as u, createElementVNode as l, toDisplayString as h, createBlock as B, normalizeClass as T, normalizeStyle as F, Fragment as S, renderList as z } from "vue";
2
- import { WrapText as G, Code as M, Eye as W } from "lucide-vue-next";
3
- import { u as $, b as D, w as P, S as R } from "./index-B3uQ1OoT.mjs";
4
- import { u as V } from "./useShikiHighlight-DSyCygls.mjs";
5
- import { _ as j } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
6
- import { T as q } from "./base.types-DaftHyg7.mjs";
7
- const A = {
8
- key: 0,
9
- class: "vfp-renderer-loading"
10
- }, I = { class: "vfp-renderer-loading-content" }, J = { class: "vfp-renderer-loading-text" }, K = {
11
- key: 2,
12
- class: "vfp-w-full vfp-h-full vfp-bg-surface-toolbar"
13
- }, O = ["srcdoc", "title"], Q = {
14
- key: 3,
15
- class: "vfp-w-full vfp-h-full vfp-overflow-auto",
16
- style: { background: "var(--fp-code-bg)" }
17
- }, U = {
18
- key: 4,
19
- class: "vfp-w-full vfp-h-full vfp-overflow-auto",
20
- style: { background: "var(--fp-code-bg)" }
21
- }, X = { class: "vfp-code-gutter" }, Y = ["innerHTML"], ue = /* @__PURE__ */ N({
22
- __name: "index",
23
- props: {
24
- url: {},
25
- fileName: {}
26
- },
27
- setup(w, { expose: E }) {
28
- const m = w, b = new q(), { t: s } = $(), H = D(), t = v(!0), o = v(!1), i = v(""), p = v(!0), c = v(null), r = f(() => P(m.fileName)), C = f(() => r.value !== "text" ? i.value : ""), { lineHtmls: _, loading: L } = V(C, r), y = f(() => r.value === "html");
29
- k([t, o, p, y], () => {
30
- b.notify();
31
- }), k(() => m.url, async () => {
32
- p.value = !0, c.value = null;
33
- try {
34
- const e = await R(m.url, { fetcher: H.value });
35
- i.value = e;
36
- } catch (e) {
37
- console.error(e), c.value = s.value("text.load_failed");
38
- } finally {
39
- p.value = !1;
40
- }
41
- }, { immediate: !0 });
42
- const x = f(() => i.value.split(`
43
- `));
44
- return E({
45
- getToolbarGroups: () => {
46
- const e = [];
47
- return e.push({
48
- items: [
49
- {
50
- type: "button",
51
- icon: G,
52
- tooltip: t.value ? s.value("toolbar.wrap_off") : s.value("toolbar.wrap_on"),
53
- action: () => {
54
- t.value = !t.value;
55
- },
56
- active: t.value
57
- }
58
- ]
59
- }), y.value && e.push({
60
- items: [
61
- {
62
- type: "button",
63
- icon: o.value ? M : W,
64
- tooltip: o.value ? s.value("toolbar.source") : s.value("toolbar.preview"),
65
- action: () => {
66
- o.value = !o.value;
67
- },
68
- active: o.value
69
- }
70
- ]
71
- }), e;
72
- },
73
- onToolbarChange: (e) => b.subscribe(e)
74
- }), (e, n) => p.value || r.value !== "text" && d(L) ? (a(), u("div", A, [
75
- l("div", I, [
76
- n[0] || (n[0] = l("div", { class: "vfp-renderer-spinner" }, null, -1)),
77
- l("span", J, h(d(s)("common.loading")), 1)
78
- ])
79
- ])) : c.value ? (a(), B(j, {
80
- key: 1,
81
- message: c.value
82
- }, null, 8, ["message"])) : o.value && r.value === "html" ? (a(), u("div", K, [
83
- l("iframe", {
84
- srcdoc: i.value,
85
- sandbox: "allow-same-origin",
86
- class: "vfp-w-full vfp-h-full vfp-border-0",
87
- title: w.fileName
88
- }, null, 8, O)
89
- ])) : r.value === "text" || d(_).length === 0 ? (a(), u("div", Q, [
90
- l("pre", {
91
- class: T(["vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm", t.value ? "vfp-whitespace-pre-wrap vfp-break-words" : "vfp-whitespace-pre"])
92
- }, h(i.value), 3)
93
- ])) : (a(), u("div", U, [
94
- l("div", {
95
- class: T(["vfp-code-block with-line-numbers vfp-w-full", { "no-wrap": !t.value }]),
96
- style: F({ gridTemplateRows: `repeat(${x.value.length}, auto) minmax(1.5rem, 1fr)` })
97
- }, [
98
- (a(!0), u(S, null, z(x.value, (le, g) => (a(), u(S, { key: g }, [
99
- l("span", X, h(g + 1), 1),
100
- l("span", {
101
- class: "vfp-code-line",
102
- innerHTML: d(_)[g] ?? ""
103
- }, null, 8, Y)
104
- ], 64))), 128)),
105
- n[1] || (n[1] = l("span", { class: "vfp-code-gutter-filler" }, null, -1)),
106
- n[2] || (n[2] = l("span", { class: "vfp-code-line-filler" }, null, -1))
107
- ], 6)
108
- ]));
109
- }
110
- });
111
- export {
112
- ue as default
113
- };