@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,8 +1,8 @@
1
1
  import { defineComponent as be, ref as c, watch as ce, onMounted as ue, onBeforeUnmount as ve, openBlock as S, createElementBlock as D, createBlock as Se, createCommentVNode as W, createElementVNode as u, toDisplayString as de, unref as B, normalizeStyle as U, createVNode as me, h as N } from "vue";
2
- import { u as Ne, b as Re, k as he, _ as ze } from "./index-B3uQ1OoT.mjs";
2
+ import { u as Ne, c as Re, k as he, _ as ze } from "./index-DZZN3kYi.mjs";
3
3
  import { List as Ae, ChevronLeft as Le, ChevronRight as Fe, Minimize2 as Pe, Maximize2 as He, X as $e } from "lucide-vue-next";
4
4
  import "foliate-js/view.js";
5
- import { _ as De } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
+ import { _ as De } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
6
6
  import { T as We } from "./base.types-DaftHyg7.mjs";
7
7
  const Be = { class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-justify-center vfp-bg-surface-1 vfp-overflow-hidden" }, Ue = {
8
8
  key: 1,
@@ -0,0 +1,137 @@
1
+ import { defineComponent as S, ref as w, onMounted as E, watch as B, onBeforeUnmount as H, openBlock as d, createElementBlock as h, createElementVNode as x, toDisplayString as z, unref as k, createCommentVNode as g, createVNode as L, normalizeStyle as R } from "vue";
2
+ import { u as A, c as C, k as v, e as G, o as J, J as N, h as V, f as F, Z as O, W as Z } from "./index-DZZN3kYi.mjs";
3
+ import q from "exceljs";
4
+ import { S as I } from "./index-CyBXARuf.mjs";
5
+ import { _ as U } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
6
+ const X = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, $ = {
7
+ key: 0,
8
+ class: "vfp-renderer-overlay vfp-renderer-loading"
9
+ }, j = { class: "vfp-renderer-loading-content" }, K = { class: "vfp-renderer-loading-text" }, P = {
10
+ key: 1,
11
+ class: "vfp-renderer-overlay"
12
+ }, se = /* @__PURE__ */ S({
13
+ __name: "index",
14
+ props: {
15
+ url: {},
16
+ emptyHint: {}
17
+ },
18
+ setup(T, { expose: W }) {
19
+ async function D(e) {
20
+ try {
21
+ return await new q.Workbook().xlsx.load(e.slice().buffer);
22
+ } catch (t) {
23
+ throw t instanceof TypeError && /sheets/i.test(t.message) ? new v("xlsx.invalid_format") : t;
24
+ }
25
+ }
26
+ const _ = T, { t: o } = A(), M = C(), a = w(!0), n = w(null), l = w(null);
27
+ let i = null, m = 100, f = null, u = null, c = { width: 0, height: 0 };
28
+ const p = () => {
29
+ if (!l.value) return { width: 800, height: 600 };
30
+ const e = l.value.clientWidth, t = l.value.clientHeight, r = e > 100 ? e : 800, s = t > 100 ? t : 600;
31
+ return { width: r, height: s };
32
+ }, y = () => {
33
+ if (!l.value || !i) return;
34
+ l.value.innerHTML = "";
35
+ const { width: e, height: t } = p(), r = e < 640;
36
+ new I(l.value, {
37
+ mode: "read",
38
+ showToolbar: !1,
39
+ showContextmenu: !1,
40
+ showGrid: !0,
41
+ row: {
42
+ len: m,
43
+ height: 25
44
+ },
45
+ col: {
46
+ len: 26,
47
+ width: r ? 80 : 100,
48
+ indexWidth: r ? 40 : 60,
49
+ minWidth: r ? 40 : 60
50
+ },
51
+ view: {
52
+ height: () => t,
53
+ width: () => e
54
+ }
55
+ }).loadData(i);
56
+ }, b = async () => {
57
+ if (l.value) {
58
+ a.value = !0, n.value = null;
59
+ try {
60
+ const e = await M.value(_.url, {
61
+ mode: "cors",
62
+ credentials: "omit",
63
+ redirect: "follow"
64
+ });
65
+ if (!e.ok)
66
+ throw e.status === 404 ? new Error(o.value("xlsx.not_found")) : e.status === 403 ? new v("file.forbidden") : new v("file.load_failed_status", { status: e.status });
67
+ const t = G(await e.arrayBuffer());
68
+ let r;
69
+ if (t.byteLength === 0)
70
+ r = [{ name: "Sheet1" }];
71
+ else if (J(t)) {
72
+ const s = N(t);
73
+ if (!s || !Array.isArray(s.sheets))
74
+ throw new v("xlsx.invalid_legacy_data");
75
+ r = V(s);
76
+ } else
77
+ r = F(
78
+ await D(t)
79
+ );
80
+ i = r.length ? r : [{ name: "Sheet1" }], m = O(r), y(), a.value = !1;
81
+ } catch (e) {
82
+ console.error(o.value("xlsx.parse_failed") + ":", e);
83
+ let t = o.value("xlsx.parse_failed");
84
+ e instanceof Error && (t = Z(o.value, e)), n.value = t, a.value = !1;
85
+ }
86
+ }
87
+ };
88
+ return E(() => {
89
+ if (!l.value) return;
90
+ let e = !0;
91
+ f = new ResizeObserver(() => {
92
+ if (e) {
93
+ e = !1, c = p();
94
+ return;
95
+ }
96
+ const t = p(), r = Math.abs(c.width - t.width), s = Math.abs(c.height - t.height);
97
+ r < 10 && s < 10 || (c = t, u !== null && clearTimeout(u), u = window.setTimeout(() => {
98
+ i && y();
99
+ }, 500));
100
+ }), f.observe(l.value), setTimeout(() => {
101
+ requestAnimationFrame(() => b());
102
+ }, 100);
103
+ }), B(
104
+ () => _.url,
105
+ (e) => {
106
+ e && b();
107
+ }
108
+ ), H(() => {
109
+ f && f.disconnect(), u !== null && clearTimeout(u), i = null, m = 100, l.value && (l.value.innerHTML = "");
110
+ }), W({
111
+ getToolbarGroups: () => []
112
+ }), (e, t) => (d(), h("div", X, [
113
+ a.value ? (d(), h("div", $, [
114
+ x("div", j, [
115
+ t[0] || (t[0] = x("div", { class: "vfp-renderer-spinner" }, null, -1)),
116
+ x("p", K, z(k(o)("xlsx.loading")), 1)
117
+ ])
118
+ ])) : g("", !0),
119
+ n.value && !a.value ? (d(), h("div", P, [
120
+ L(U, {
121
+ message: k(o)("xlsx.load_failed"),
122
+ detail: n.value
123
+ }, null, 8, ["message", "detail"])
124
+ ])) : g("", !0),
125
+ n.value ? g("", !0) : (d(), h("div", {
126
+ key: 2,
127
+ ref_key: "containerRef",
128
+ ref: l,
129
+ class: "xlsx-spreadsheet-container vfp-w-full vfp-h-full",
130
+ style: R({ opacity: a.value ? 0 : 1 })
131
+ }, null, 4))
132
+ ]));
133
+ }
134
+ });
135
+ export {
136
+ se as default
137
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as er, ref as qe, watch as tr, computed as te, openBlock as J, createElementBlock as Q, createElementVNode as D, toDisplayString as ne, unref as ae, createBlock as rr, createVNode as he, createCommentVNode as oe, normalizeStyle as ir, Fragment as nr, renderList as ar, createTextVNode as sr, normalizeClass as or } from "vue";
2
- import { u as cr, b as fr, k as ur, _ as hr } from "./index-B3uQ1OoT.mjs";
2
+ import { u as cr, c as fr, k as ur, _ as hr } from "./index-DZZN3kYi.mjs";
3
3
  import { User as lr, Users as Ve, Calendar as mt, Clock as Et, Tag as gt, Mail as dr, Paperclip as pr, Hash as yr } from "lucide-vue-next";
4
- import { _ as br } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
+ import { _ as br } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
6
6
  function vr(e) {
7
7
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -0,0 +1,117 @@
1
+ import { defineComponent as F, ref as c, computed as f, watch as k, unref as m, openBlock as t, createElementBlock as i, createElementVNode as l, toDisplayString as h, createBlock as T, normalizeClass as H, normalizeStyle as $, Fragment as C, renderList as z } from "vue";
2
+ import { WrapText as G, Code as M, Eye as W } from "lucide-vue-next";
3
+ import { u as X, c as D, C as P, w as R, l as V, X as j } from "./index-DZZN3kYi.mjs";
4
+ import { u as q } from "./useShikiHighlight-BPmcxA-h.mjs";
5
+ import { _ as A } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
6
+ import { _ as I } from "./EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs";
7
+ import { T as J } from "./base.types-DaftHyg7.mjs";
8
+ const K = {
9
+ key: 0,
10
+ class: "vfp-renderer-loading"
11
+ }, O = { class: "vfp-renderer-loading-content" }, Q = { class: "vfp-renderer-loading-text" }, U = {
12
+ key: 3,
13
+ class: "vfp-w-full vfp-h-full vfp-bg-surface-toolbar"
14
+ }, Y = ["srcdoc", "title"], Z = {
15
+ key: 4,
16
+ class: "vfp-w-full vfp-h-full vfp-overflow-auto",
17
+ style: { background: "var(--fp-code-bg)" }
18
+ }, ee = {
19
+ key: 5,
20
+ class: "vfp-w-full vfp-h-full vfp-overflow-auto",
21
+ style: { background: "var(--fp-code-bg)" }
22
+ }, le = { class: "vfp-code-gutter" }, te = ["innerHTML"], fe = /* @__PURE__ */ F({
23
+ __name: "index",
24
+ props: {
25
+ url: {},
26
+ fileName: {},
27
+ emptyHint: {}
28
+ },
29
+ setup(w, { expose: E }) {
30
+ const d = w, _ = new J(), { t: s } = X(), L = D(), o = c(!0), a = c(!1), r = c(""), v = c(!0), p = c(null), n = f(() => P(d.fileName)), N = f(() => n.value !== "text" ? r.value : ""), { lineHtmls: y, loading: S } = q(N, n), b = f(() => n.value === "html"), B = f(
31
+ () => !v.value && !p.value && R(r.value) && V(d.emptyHint, "textual")
32
+ );
33
+ k([o, a, v, b], () => {
34
+ _.notify();
35
+ }), k(() => d.url, async () => {
36
+ v.value = !0, p.value = null;
37
+ try {
38
+ const e = await j(d.url, { fetcher: L.value });
39
+ r.value = e;
40
+ } catch (e) {
41
+ console.error(e), p.value = s.value("text.load_failed");
42
+ } finally {
43
+ v.value = !1;
44
+ }
45
+ }, { immediate: !0 });
46
+ const x = f(() => r.value.split(`
47
+ `));
48
+ return E({
49
+ getToolbarGroups: () => {
50
+ const e = [];
51
+ return e.push({
52
+ items: [
53
+ {
54
+ type: "button",
55
+ icon: G,
56
+ tooltip: o.value ? s.value("toolbar.wrap_off") : s.value("toolbar.wrap_on"),
57
+ action: () => {
58
+ o.value = !o.value;
59
+ },
60
+ active: o.value
61
+ }
62
+ ]
63
+ }), b.value && e.push({
64
+ items: [
65
+ {
66
+ type: "button",
67
+ icon: a.value ? M : W,
68
+ tooltip: a.value ? s.value("toolbar.source") : s.value("toolbar.preview"),
69
+ action: () => {
70
+ a.value = !a.value;
71
+ },
72
+ active: a.value
73
+ }
74
+ ]
75
+ }), e;
76
+ },
77
+ onToolbarChange: (e) => _.subscribe(e)
78
+ }), (e, u) => v.value || n.value !== "text" && m(S) ? (t(), i("div", K, [
79
+ l("div", O, [
80
+ u[0] || (u[0] = l("div", { class: "vfp-renderer-spinner" }, null, -1)),
81
+ l("span", Q, h(m(s)("common.loading")), 1)
82
+ ])
83
+ ])) : p.value ? (t(), T(A, {
84
+ key: 1,
85
+ message: p.value
86
+ }, null, 8, ["message"])) : B.value ? (t(), T(I, { key: 2 })) : a.value && n.value === "html" ? (t(), i("div", U, [
87
+ l("iframe", {
88
+ srcdoc: r.value,
89
+ sandbox: "allow-same-origin",
90
+ class: "vfp-w-full vfp-h-full vfp-border-0",
91
+ title: w.fileName
92
+ }, null, 8, Y)
93
+ ])) : n.value === "text" || m(y).length === 0 ? (t(), i("div", Z, [
94
+ l("pre", {
95
+ class: H(["vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm", o.value ? "vfp-whitespace-pre-wrap vfp-break-words" : "vfp-whitespace-pre"])
96
+ }, h(r.value), 3)
97
+ ])) : (t(), i("div", ee, [
98
+ l("div", {
99
+ class: H(["vfp-code-block with-line-numbers vfp-w-full", { "no-wrap": !o.value }]),
100
+ style: $({ gridTemplateRows: `repeat(${x.value.length}, auto) minmax(1.5rem, 1fr)` })
101
+ }, [
102
+ (t(!0), i(C, null, z(x.value, (se, g) => (t(), i(C, { key: g }, [
103
+ l("span", le, h(g + 1), 1),
104
+ l("span", {
105
+ class: "vfp-code-line",
106
+ innerHTML: m(y)[g] ?? ""
107
+ }, null, 8, te)
108
+ ], 64))), 128)),
109
+ u[1] || (u[1] = l("span", { class: "vfp-code-gutter-filler" }, null, -1)),
110
+ u[2] || (u[2] = l("span", { class: "vfp-code-line-filler" }, null, -1))
111
+ ], 6)
112
+ ]));
113
+ }
114
+ });
115
+ export {
116
+ fe as default
117
+ };
@@ -1,9 +1,9 @@
1
- import { defineComponent as V, ref as d, computed as $, onMounted as ie, onBeforeUnmount as J, watch as O, openBlock as r, createElementBlock as c, normalizeStyle as D, Fragment as F, createElementVNode as a, normalizeClass as U, toDisplayString as _, unref as g, withDirectives as Y, renderSlot as K, vShow as Z, resolveComponent as se, createVNode as N, createBlock as E, resolveDynamicComponent as q, renderList as Q, createCommentVNode as ee, defineAsyncComponent as re, withCtx as G, Teleport as ve } from "vue";
2
- import { u as te, _ as ne, P as fe, g as de, b as pe, r as X, k as ue, t as ce, D as me, Y as he, v as ge } from "./index-B3uQ1OoT.mjs";
3
- import { FileImage as we, FileText as be, FileCode as xe, File as ye, ChevronRight as ke, FolderOpen as Le, Folder as ze } from "lucide-vue-next";
4
- import { _ as A } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
1
+ import { defineComponent as Z, ref as d, computed as $, onMounted as ie, onBeforeUnmount as J, watch as O, openBlock as r, createElementBlock as c, normalizeStyle as E, Fragment as U, createElementVNode as a, normalizeClass as F, toDisplayString as _, unref as g, withDirectives as q, renderSlot as N, vShow as V, resolveComponent as se, createVNode as H, createBlock as D, resolveDynamicComponent as A, renderList as Q, createCommentVNode as ee, defineAsyncComponent as re, withCtx as G, Teleport as ve } from "vue";
2
+ import { u as te, _ as ne, q as fe, s as de, c as pe, r as X, k as ue, v as ce, x as me, z as he, A as ge } from "./index-DZZN3kYi.mjs";
3
+ import { FileImage as we, FileText as xe, FileCode as be, File as ye, ChevronRight as ke, FolderOpen as Le, Folder as ze } from "lucide-vue-next";
4
+ import { _ as Y } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  import { T as Se } from "./base.types-DaftHyg7.mjs";
6
- const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-weak vfp-bg-surface-toolbar" }, _e = { class: "vfp-flex-1 vfp-min-h-0 vfp-min-w-0 vfp-w-full vfp-overflow-hidden" }, $e = { class: "vfp-flex-1 vfp-min-h-0 vfp-min-w-0 vfp-w-full vfp-overflow-hidden" }, Re = { class: "vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden" }, Ce = /* @__PURE__ */ V({
6
+ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-weak vfp-bg-surface-toolbar" }, _e = { class: "vfp-flex-1 vfp-min-h-0 vfp-min-w-0 vfp-w-full vfp-overflow-hidden" }, $e = { class: "vfp-flex-1 vfp-min-h-0 vfp-min-w-0 vfp-w-full vfp-overflow-hidden" }, Re = { class: "vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden" }, Ce = /* @__PURE__ */ Z({
7
7
  name: "ResizableSplit",
8
8
  __name: "ResizableSplit",
9
9
  props: {
@@ -26,15 +26,15 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
26
26
  }
27
27
  return n.initialLeftWidth;
28
28
  })()
29
- ), S = d(!1), T = d(!1), b = d(!0), x = d("left");
29
+ ), S = d(!1), T = d(!1), x = d(!0), b = d("left");
30
30
  let l = null, t = null;
31
31
  const v = () => {
32
32
  l && (T.value = l.matches);
33
33
  }, L = $(
34
- () => T.value && b.value ? { width: `${f.value}px` } : void 0
35
- ), p = $(() => T.value && b.value), y = (i) => {
34
+ () => T.value && x.value ? { width: `${f.value}px` } : void 0
35
+ ), p = $(() => T.value && x.value), y = (i) => {
36
36
  if (!w.value) return;
37
- const k = w.value.getBoundingClientRect(), B = i.clientX - k.left, H = k.width - n.minRightWidth - 6, j = Math.min(n.maxLeftWidth, H);
37
+ const k = w.value.getBoundingClientRect(), B = i.clientX - k.left, P = k.width - n.minRightWidth - 6, j = Math.min(n.maxLeftWidth, P);
38
38
  f.value = Math.max(
39
39
  n.minLeftWidth,
40
40
  Math.min(j, B)
@@ -52,7 +52,7 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
52
52
  if (typeof window < "u") {
53
53
  l = window.matchMedia(n.desktopMedia), v(), l.addEventListener("change", v);
54
54
  const i = () => {
55
- w.value && (b.value = w.value.getBoundingClientRect().width >= n.minLeftWidth + n.minRightWidth + 6);
55
+ w.value && (x.value = w.value.getBoundingClientRect().width >= n.minLeftWidth + n.minRightWidth + 6);
56
56
  };
57
57
  i(), t = typeof ResizeObserver < "u" ? new ResizeObserver(i) : null, t == null || t.observe(w.value);
58
58
  }
@@ -65,61 +65,61 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
65
65
  }
66
66
  );
67
67
  const C = (i) => {
68
- x.value = i;
68
+ b.value = i;
69
69
  };
70
70
  return I({ switchTab: C }), (i, k) => (r(), c("div", {
71
71
  ref_key: "containerRef",
72
72
  ref: w,
73
73
  class: "vfp-w-full vfp-h-full vfp-flex vfp-flex-col md:vfp-flex-row vfp-min-h-0 vfp-min-w-0",
74
- style: D(p.value ? void 0 : { flexDirection: "column" })
74
+ style: E(p.value ? void 0 : { flexDirection: "column" })
75
75
  }, [
76
- s.mobileTabMode && !p.value ? (r(), c(F, { key: 0 }, [
76
+ s.mobileTabMode && !p.value ? (r(), c(U, { key: 0 }, [
77
77
  a("div", Te, [
78
78
  a("button", {
79
79
  type: "button",
80
- class: U(["vfp-flex-1 vfp-py-2.5 vfp-text-sm vfp-transition-colors", x.value === "left" ? "vfp-text-fg-primary vfp-border-b-2 vfp-border-fg-primary -vfp-mb-px" : "vfp-text-fg-secondary"]),
80
+ class: F(["vfp-flex-1 vfp-py-2.5 vfp-text-sm vfp-transition-colors", b.value === "left" ? "vfp-text-fg-primary vfp-border-b-2 vfp-border-fg-primary -vfp-mb-px" : "vfp-text-fg-secondary"]),
81
81
  onClick: k[0] || (k[0] = (B) => C("left"))
82
82
  }, _(s.leftTabLabel ?? g(u)("zip.file_tree")), 3),
83
83
  a("button", {
84
84
  type: "button",
85
- class: U(["vfp-flex-1 vfp-py-2.5 vfp-text-sm vfp-transition-colors", x.value === "right" ? "vfp-text-fg-primary vfp-border-b-2 vfp-border-fg-primary -vfp-mb-px" : "vfp-text-fg-secondary"]),
85
+ class: F(["vfp-flex-1 vfp-py-2.5 vfp-text-sm vfp-transition-colors", b.value === "right" ? "vfp-text-fg-primary vfp-border-b-2 vfp-border-fg-primary -vfp-mb-px" : "vfp-text-fg-secondary"]),
86
86
  onClick: k[1] || (k[1] = (B) => C("right"))
87
87
  }, _(s.rightTabLabel ?? g(u)("toolbar.preview")), 3)
88
88
  ]),
89
- Y(a("div", _e, [
90
- K(i.$slots, "left", {}, void 0, !0)
89
+ q(a("div", _e, [
90
+ N(i.$slots, "left", {}, void 0, !0)
91
91
  ], 512), [
92
- [Z, x.value === "left"]
92
+ [V, b.value === "left"]
93
93
  ]),
94
- Y(a("div", $e, [
95
- K(i.$slots, "right", {}, void 0, !0)
94
+ q(a("div", $e, [
95
+ N(i.$slots, "right", {}, void 0, !0)
96
96
  ], 512), [
97
- [Z, x.value === "right"]
97
+ [V, b.value === "right"]
98
98
  ])
99
- ], 64)) : (r(), c(F, { key: 1 }, [
99
+ ], 64)) : (r(), c(U, { key: 1 }, [
100
100
  a("div", {
101
101
  class: "vfp-min-h-0 vfp-min-w-0 vfp-flex-shrink-0 vfp-w-full vfp-max-h-60 md:vfp-h-full md:vfp-max-h-none",
102
- style: D(L.value)
102
+ style: E(L.value)
103
103
  }, [
104
- K(i.$slots, "left", {}, void 0, !0)
104
+ N(i.$slots, "left", {}, void 0, !0)
105
105
  ], 4),
106
106
  a("div", {
107
107
  role: "separator",
108
108
  "aria-orientation": "vertical",
109
- class: U(["split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors", S.value ? "dragging" : ""]),
110
- style: D(p.value ? void 0 : { display: "none" }),
109
+ class: F(["split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors", S.value ? "dragging" : ""]),
110
+ style: E(p.value ? void 0 : { display: "none" }),
111
111
  onMousedown: W
112
112
  }, [...k[2] || (k[2] = [
113
113
  a("span", { class: "vfp-absolute vfp-inset-y-0 hit-area" }, null, -1)
114
114
  ])], 38),
115
115
  a("div", Re, [
116
- K(i.$slots, "right", {}, void 0, !0)
116
+ N(i.$slots, "right", {}, void 0, !0)
117
117
  ])
118
118
  ], 64))
119
119
  ], 4));
120
120
  }
121
- }), Me = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-45379cb1"]]), We = { key: 0 }, De = { class: "vfp-truncate vfp-flex-1 vfp-min-w-0" }, Ee = { class: "vfp-flex-1 vfp-truncate vfp-min-w-0" }, Ie = { class: "vfp-text-xs vfp-text-fg-disabled vfp-flex-shrink-0 vfp-ml-2" }, Ue = { name: "ZipTreeItem" }, Fe = /* @__PURE__ */ V({
122
- ...Ue,
121
+ }), Me = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-45379cb1"]]), We = { key: 0 }, Ee = { class: "vfp-truncate vfp-flex-1 vfp-min-w-0" }, De = { class: "vfp-flex-1 vfp-truncate vfp-min-w-0" }, Ie = { class: "vfp-text-xs vfp-text-fg-disabled vfp-flex-shrink-0 vfp-ml-2" }, Fe = { name: "ZipTreeItem" }, Ue = /* @__PURE__ */ Z({
122
+ ...Fe,
123
123
  props: {
124
124
  node: {},
125
125
  depth: {},
@@ -130,29 +130,29 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
130
130
  setup(s, { emit: I }) {
131
131
  const n = s, u = I, w = $(() => ({ paddingLeft: `${n.depth * 14 + 10}px` })), f = $(() => n.expanded.has(n.node.path)), S = $(() => n.selectedPath === n.node.path), T = $(() => {
132
132
  const l = fe({ name: n.node.name, type: "" });
133
- return l === "image" ? we : l === "text" || l === "markdown" || l === "json" || l === "csv" || l === "xml" || l === "subtitle" ? n.node.name.endsWith(".md") || n.node.name.endsWith(".markdown") ? be : xe : ye;
134
- }), b = (l) => {
133
+ return l === "image" ? we : l === "text" || l === "markdown" || l === "json" || l === "csv" || l === "xml" || l === "subtitle" ? n.node.name.endsWith(".md") || n.node.name.endsWith(".markdown") ? xe : be : ye;
134
+ }), x = (l) => {
135
135
  const t = l.currentTarget.getBoundingClientRect();
136
136
  u("hover", n.node.name || "/", t);
137
- }, x = () => u("leave");
137
+ }, b = () => u("leave");
138
138
  return (l, t) => {
139
139
  const v = se("ZipTreeItem");
140
140
  return s.node.isDir ? (r(), c("div", We, [
141
141
  a("button", {
142
142
  type: "button",
143
143
  class: "tree-row dir-row",
144
- style: D(w.value),
144
+ style: E(w.value),
145
145
  onClick: t[0] || (t[0] = (L) => u("toggle", s.node.path)),
146
- onMouseenter: b,
147
- onMouseleave: x
146
+ onMouseenter: x,
147
+ onMouseleave: b
148
148
  }, [
149
- N(g(ke), {
150
- class: U(["vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform", { "vfp-rotate-90": f.value }])
149
+ H(g(ke), {
150
+ class: F(["vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform", { "vfp-rotate-90": f.value }])
151
151
  }, null, 8, ["class"]),
152
- (r(), E(q(f.value ? g(Le) : g(ze)), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80" })),
153
- a("span", De, _(s.node.name || "/"), 1)
152
+ (r(), D(A(f.value ? g(Le) : g(ze)), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80" })),
153
+ a("span", Ee, _(s.node.name || "/"), 1)
154
154
  ], 36),
155
- f.value && s.node.children ? (r(!0), c(F, { key: 0 }, Q(s.node.children, (L) => (r(), E(v, {
155
+ f.value && s.node.children ? (r(!0), c(U, { key: 0 }, Q(s.node.children, (L) => (r(), D(v, {
156
156
  key: L.path,
157
157
  node: L,
158
158
  depth: s.depth + 1,
@@ -166,35 +166,35 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
166
166
  ])) : (r(), c("button", {
167
167
  key: 1,
168
168
  type: "button",
169
- class: U(["tree-row file-row", { selected: S.value }]),
170
- style: D(w.value),
169
+ class: F(["tree-row file-row", { selected: S.value }]),
170
+ style: E(w.value),
171
171
  onClick: t[5] || (t[5] = (L) => u("select", s.node)),
172
- onMouseenter: b,
173
- onMouseleave: x
172
+ onMouseenter: x,
173
+ onMouseleave: b
174
174
  }, [
175
175
  t[6] || (t[6] = a("span", { class: "vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0" }, null, -1)),
176
- (r(), E(q(T.value), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-fg-tertiary" })),
177
- a("span", Ee, _(s.node.name), 1),
176
+ (r(), D(A(T.value), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-fg-tertiary" })),
177
+ a("span", De, _(s.node.name), 1),
178
178
  a("span", Ie, _(g(de)(s.node.size)), 1)
179
179
  ], 38));
180
180
  };
181
181
  }
182
- }), Be = /* @__PURE__ */ ne(Fe, [["__scopeId", "data-v-124c382d"]]), Pe = {
182
+ }), Be = /* @__PURE__ */ ne(Ue, [["__scopeId", "data-v-124c382d"]]), Ke = {
183
183
  key: 0,
184
184
  class: "vfp-renderer-loading"
185
- }, Ke = { class: "vfp-renderer-loading-content" }, Ne = { class: "vfp-renderer-loading-text" }, He = { class: "vfp-w-full vfp-h-full vfp-overflow-auto" }, je = { class: "vfp-w-full vfp-h-full vfp-flex vfp-flex-col" }, Oe = {
185
+ }, Ne = { class: "vfp-renderer-loading-content" }, He = { class: "vfp-renderer-loading-text" }, Pe = { class: "vfp-w-full vfp-h-full vfp-overflow-auto" }, je = { class: "vfp-w-full vfp-h-full vfp-flex vfp-flex-col" }, Oe = {
186
186
  key: 0,
187
187
  class: "vfp-renderer-loading vfp-flex-1"
188
- }, Ve = { class: "vfp-renderer-loading-content" }, Ye = { class: "vfp-renderer-loading-text" }, Ze = {
188
+ }, Ze = { class: "vfp-renderer-loading-content" }, qe = { class: "vfp-renderer-loading-text" }, Ve = {
189
189
  key: 1,
190
190
  class: "vfp-flex-1"
191
- }, qe = {
191
+ }, Ae = {
192
192
  key: 2,
193
193
  class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-fg-muted vfp-text-sm vfp-p-6"
194
194
  }, Ge = {
195
195
  key: 3,
196
196
  class: "vfp-flex-1 vfp-min-h-0 vfp-overflow-hidden vfp-flex vfp-relative vfp-z-0"
197
- }, tt = /* @__PURE__ */ V({
197
+ }, tt = /* @__PURE__ */ Z({
198
198
  __name: "index",
199
199
  props: {
200
200
  url: {},
@@ -202,25 +202,25 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
202
202
  },
203
203
  setup(s, { expose: I }) {
204
204
  const n = re(
205
- () => import("./index-B3uQ1OoT.mjs").then((e) => e.U)
206
- ), u = s, w = new Se(), { t: f } = te(), S = pe(), T = d(null), b = d(null), x = d(!0), l = d(null), t = d(/* @__PURE__ */ new Set([""])), v = d(null), L = d(!1), p = d(null), y = d(null), R = d(null), W = d(null), C = () => {
205
+ () => import("./index-DZZN3kYi.mjs").then((e) => e.$)
206
+ ), u = s, w = new Se(), { t: f } = te(), S = pe(), T = d(null), x = d(null), b = d(!0), l = d(null), t = d(/* @__PURE__ */ new Set([""])), v = d(null), L = d(!1), p = d(null), y = d(null), R = d(null), W = d(null), C = () => {
207
207
  var e;
208
208
  (e = v.value) != null && e.blobUrl && URL.revokeObjectURL(v.value.blobUrl);
209
209
  }, i = async () => {
210
- C(), v.value = null, x.value = !0, l.value = null;
210
+ C(), v.value = null, b.value = !0, l.value = null;
211
211
  try {
212
212
  const e = await S.value(u.url);
213
213
  if (!e.ok) throw new ue("common.load_failed");
214
214
  const o = await e.arrayBuffer(), m = await ce(o), z = me(m), h = he(z);
215
- T.value = m, b.value = h;
215
+ T.value = m, x.value = h;
216
216
  const M = /* @__PURE__ */ new Set([""]);
217
217
  if (h.children)
218
- for (const P of h.children) P.isDir && M.add(P.path);
218
+ for (const K of h.children) K.isDir && M.add(K.path);
219
219
  t.value = M;
220
220
  } catch (e) {
221
221
  console.error(e), l.value = f.value("zip.load_failed");
222
222
  } finally {
223
- x.value = !1;
223
+ b.value = !1;
224
224
  }
225
225
  };
226
226
  O(() => u.url, (e) => {
@@ -229,19 +229,19 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
229
229
  C();
230
230
  });
231
231
  const k = $(() => {
232
- if (!b.value) return null;
232
+ if (!x.value) return null;
233
233
  let e = 0, o = 0, m = 0;
234
234
  const z = (h) => {
235
235
  var M;
236
236
  h.isDir ? (h.path && o++, (M = h.children) == null || M.forEach(z)) : (e++, m += h.size);
237
237
  };
238
- return z(b.value), { files: e, dirs: o, size: m };
238
+ return z(x.value), { files: e, dirs: o, size: m };
239
239
  });
240
240
  O(k, () => w.notify()), I({
241
241
  getToolbarGroups: () => [],
242
242
  onToolbarChange: (e) => w.subscribe(e)
243
243
  });
244
- const H = (e) => {
244
+ const P = (e) => {
245
245
  const o = new Set(t.value);
246
246
  o.has(e) ? o.delete(e) : o.add(e), t.value = o;
247
247
  }, j = (e, o) => {
@@ -254,8 +254,8 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
254
254
  if (!(!T.value || e.isDir || ((o = v.value) == null ? void 0 : o.path) === e.path || W.value === e.path)) {
255
255
  W.value = e.path, C(), v.value = null, L.value = !0, p.value = null;
256
256
  try {
257
- const h = X(e.name), M = await ge(T.value, e.path, h !== "application/octet-stream" ? h : void 0), P = URL.createObjectURL(M);
258
- v.value = { path: e.path, name: e.name, size: e.size, blobUrl: P }, (m = R.value) == null || m.switchTab("right");
257
+ const h = X(e.name), M = await ge(T.value, e.path, h !== "application/octet-stream" ? h : void 0), K = URL.createObjectURL(M);
258
+ v.value = { path: e.path, name: e.name, size: e.size, blobUrl: K }, (m = R.value) == null || m.switchTab("right");
259
259
  } catch (h) {
260
260
  console.error(h), p.value = f.value("zip.entry_read_failed"), (z = R.value) == null || z.switchTab("right");
261
261
  } finally {
@@ -263,16 +263,16 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
263
263
  }
264
264
  }
265
265
  }, ae = $(() => v.value ? [{ name: v.value.name, url: v.value.blobUrl, type: X(v.value.name) }] : []);
266
- return (e, o) => x.value ? (r(), c("div", Pe, [
267
- a("div", Ke, [
266
+ return (e, o) => b.value ? (r(), c("div", Ke, [
267
+ a("div", Ne, [
268
268
  o[0] || (o[0] = a("div", { class: "vfp-renderer-spinner" }, null, -1)),
269
- a("span", Ne, _(g(f)("common.loading")), 1)
269
+ a("span", He, _(g(f)("common.loading")), 1)
270
270
  ])
271
- ])) : l.value || !b.value ? (r(), E(A, {
271
+ ])) : l.value || !x.value ? (r(), D(Y, {
272
272
  key: 1,
273
273
  message: l.value || g(f)("zip.parse_failed")
274
- }, null, 8, ["message"])) : (r(), c(F, { key: 2 }, [
275
- N(Me, {
274
+ }, null, 8, ["message"])) : (r(), c(U, { key: 2 }, [
275
+ H(Me, {
276
276
  ref_key: "splitRef",
277
277
  ref: R,
278
278
  "initial-left-width": 280,
@@ -284,16 +284,16 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
284
284
  "right-tab-label": g(f)("toolbar.preview")
285
285
  }, {
286
286
  left: G(() => [
287
- a("div", He, [
288
- (r(!0), c(F, null, Q(b.value.children || [], (m) => {
287
+ a("div", Pe, [
288
+ (r(!0), c(U, null, Q(x.value.children || [], (m) => {
289
289
  var z;
290
- return r(), E(Be, {
290
+ return r(), D(Be, {
291
291
  key: m.path,
292
292
  node: m,
293
293
  depth: 0,
294
294
  "selected-path": ((z = v.value) == null ? void 0 : z.path) ?? null,
295
295
  expanded: t.value,
296
- onToggle: H,
296
+ onToggle: P,
297
297
  onSelect: oe,
298
298
  onHover: j,
299
299
  onLeave: le
@@ -304,29 +304,29 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
304
304
  right: G(() => [
305
305
  a("div", je, [
306
306
  L.value ? (r(), c("div", Oe, [
307
- a("div", Ve, [
307
+ a("div", Ze, [
308
308
  o[1] || (o[1] = a("div", { class: "vfp-renderer-spinner" }, null, -1)),
309
- a("span", Ye, _(g(f)("common.loading")), 1)
309
+ a("span", qe, _(g(f)("common.loading")), 1)
310
310
  ])
311
- ])) : p.value ? (r(), c("div", Ze, [
312
- N(A, { message: p.value }, null, 8, ["message"])
311
+ ])) : p.value ? (r(), c("div", Ve, [
312
+ H(Y, { message: p.value }, null, 8, ["message"])
313
313
  ])) : v.value ? (r(), c("div", Ge, [
314
- N(g(n), {
314
+ H(g(n), {
315
315
  mode: "embed",
316
316
  files: ae.value,
317
317
  "current-index": 0,
318
318
  "zip-nesting-depth": s.nestingDepth + 1
319
319
  }, null, 8, ["files", "zip-nesting-depth"])
320
- ])) : (r(), c("div", qe, _(g(f)("zip.select_file")), 1))
320
+ ])) : (r(), c("div", Ae, _(g(f)("zip.select_file")), 1))
321
321
  ])
322
322
  ]),
323
323
  _: 1
324
324
  }, 8, ["left-tab-label", "right-tab-label"]),
325
- (r(), E(ve, { to: "body" }, [
325
+ (r(), D(ve, { to: "body" }, [
326
326
  y.value ? (r(), c("div", {
327
327
  key: 0,
328
328
  class: "vfp-zip-tip",
329
- style: D({
329
+ style: E({
330
330
  position: "fixed",
331
331
  zIndex: 2147483647,
332
332
  pointerEvents: "none",