@eternalheart/vue-file-preview 1.6.11 → 1.6.12
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.
- package/lib/chunks/{avifLoader-CAUzjn-d-Bv80osgL.mjs → avifLoader-CAUzjn-d-CTy7cevh.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-c40agcEu.mjs → heicLoader-D_9PukkA-DdDu94xL.mjs} +1 -1
- package/lib/chunks/{index-B2xLxhp0.mjs → index-2VQLB2Mi.mjs} +6 -6
- package/lib/chunks/{index-DbOpSm8f.mjs → index-BPmyF7Wr.mjs} +6 -6
- package/lib/chunks/{index-2xdBoG-I.mjs → index-Bfg5zM8l.mjs} +6 -6
- package/lib/chunks/{index-C92b547K.mjs → index-Bmqn45d_.mjs} +73 -73
- package/lib/chunks/{index-By8q8XPn.mjs → index-BxmX005K.mjs} +4 -4
- package/lib/chunks/{index-B3uQ1OoT.mjs → index-CEk6FKm3.mjs} +420 -420
- package/lib/chunks/{index-CO713RPO.mjs → index-CLM9sOKN.mjs} +41 -41
- package/lib/chunks/{index-DTZVumT8.mjs → index-CM11hSQu.mjs} +11 -11
- package/lib/chunks/{index-B35jLxPz.mjs → index-CiGUKdlt.mjs} +11 -11
- package/lib/chunks/{index-DMwZXKa4.mjs → index-Cud9j9Xy.mjs} +1 -1
- package/lib/chunks/{index-Cyg4lWK-.mjs → index-CuiEjR23.mjs} +10 -10
- package/lib/chunks/{index-DyP3rhuf.mjs → index-D4jhvs5m.mjs} +15 -15
- package/lib/chunks/{index-BpKvjFVp.mjs → index-D6Pjjxi0.mjs} +1 -1
- package/lib/chunks/{index-BkqPtbFz.mjs → index-D6te_qaB.mjs} +13 -13
- package/lib/chunks/{index-DpY9eMSI.mjs → index-D9z6lQat.mjs} +14 -14
- package/lib/chunks/{index-DfC_cA90.mjs → index-DOAOk6m5.mjs} +16 -16
- package/lib/chunks/{index-Df-1MbYj.mjs → index-DVG1fZAv.mjs} +1 -1
- package/lib/chunks/{index-Dw6YZA28.mjs → index-De-oaCgN.mjs} +1 -1
- package/lib/chunks/{index-CrLeFRdr.mjs → index-DmEMePjL.mjs} +1 -1
- package/lib/chunks/{index--D2MwF_x.mjs → index-WcAnJA2t.mjs} +8 -8
- package/lib/chunks/index-i-KacQvS.mjs +306 -0
- package/lib/chunks/{index-C8pOqpTq.mjs → index-t9kSzzMg.mjs} +1 -1
- package/lib/chunks/{jp2Loader-Dig19xyo-82PXw2fC.mjs → jp2Loader-Dig19xyo-BBR3tcPW.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-DRn7RYLA.mjs → psdLoader-C0tKUXXl-DGOmJwkQ.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-DP397Cnq.mjs → rawLoader-C-tPeFAB-CrCtXMup.mjs} +1 -1
- package/lib/chunks/{tiffLoader-BlhByX8w-BC52z4Tf.mjs → tiffLoader-BlhByX8w-jsxHlbyu.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-DSyCygls.mjs → useShikiHighlight-BdhPCj48.mjs} +1 -1
- package/lib/index.cjs +40 -40
- package/lib/index.mjs +7 -7
- package/lib/renderers/Cad/toolbar.d.ts +1 -0
- package/package.json +1 -1
- package/lib/chunks/index-DKJ_iQ70.mjs +0 -295
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as E, ref as m, onMounted as z, watch as B, onBeforeUnmount as S, openBlock as v, createElementBlock as w, createElementVNode as x, toDisplayString as H, unref as k, createCommentVNode as g, createBlock as L, normalizeStyle as R } from "vue";
|
|
2
|
-
import { u as A, b as C, k as u,
|
|
2
|
+
import { u as A, b as C, k as u, d as G, W as F, p as N, o as O, e as V, x as Z, Z as q } from "./index-CEk6FKm3.mjs";
|
|
3
3
|
import I from "exceljs";
|
|
4
4
|
import { S as J } from "./index-CyBXARuf.mjs";
|
|
5
5
|
import { _ as U } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
@@ -64,16 +64,16 @@ const X = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-fu
|
|
|
64
64
|
if (t.byteLength === 0)
|
|
65
65
|
throw new u("file.empty");
|
|
66
66
|
let r;
|
|
67
|
-
if (
|
|
68
|
-
const s =
|
|
67
|
+
if (F(t)) {
|
|
68
|
+
const s = N(t);
|
|
69
69
|
if (!s || !Array.isArray(s.sheets))
|
|
70
70
|
throw new u("xlsx.invalid_legacy_data");
|
|
71
|
-
r =
|
|
71
|
+
r = O(s);
|
|
72
72
|
} else
|
|
73
|
-
r =
|
|
73
|
+
r = V(
|
|
74
74
|
await D(t)
|
|
75
75
|
);
|
|
76
|
-
i = r, h =
|
|
76
|
+
i = r, h = Z(r), _(), a.value = !1;
|
|
77
77
|
} catch (e) {
|
|
78
78
|
console.error(o.value("xlsx.parse_failed") + ":", e);
|
|
79
79
|
let t = o.value("xlsx.parse_failed");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as M, ref as l, watch as y, nextTick as $, computed as
|
|
2
|
-
import { u as R, b as j,
|
|
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 N, createBlock as I, normalizeStyle as d, Fragment as F, renderList as C } from "vue";
|
|
2
|
+
import { u as R, b as j, m as q, k as z, H as O, c as U } from "./index-CEk6FKm3.mjs";
|
|
3
3
|
import V from "mammoth";
|
|
4
4
|
import { _ as W } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const X = {
|
|
@@ -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"],
|
|
12
|
+
}, Q = ["innerHTML"], Z = ["innerHTML"], T = 1123, w = 60, H = 50, ee = 24, re = /* @__PURE__ */ M({
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
15
15
|
url: {}
|
|
16
16
|
},
|
|
17
17
|
setup(b, { expose: G }) {
|
|
18
|
-
const E =
|
|
18
|
+
const E = T - 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 () => {
|
|
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);
|
|
@@ -51,7 +51,7 @@ const X = {
|
|
|
51
51
|
}, { immediate: !0 }), y(a, async () => {
|
|
52
52
|
a.value && (await $(), requestAnimationFrame(() => S()));
|
|
53
53
|
});
|
|
54
|
-
const g =
|
|
54
|
+
const g = k(() => q(m.value)), D = k(() => ({
|
|
55
55
|
...g.value,
|
|
56
56
|
position: "absolute",
|
|
57
57
|
visibility: "hidden",
|
|
@@ -60,7 +60,7 @@ const X = {
|
|
|
60
60
|
})), L = {
|
|
61
61
|
width: "100%",
|
|
62
62
|
maxWidth: "794px",
|
|
63
|
-
minHeight: `${
|
|
63
|
+
minHeight: `${T}px`,
|
|
64
64
|
background: "white",
|
|
65
65
|
boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)",
|
|
66
66
|
flexShrink: 0,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as I, b as N, k as x,
|
|
1
|
+
import { defineComponent as W, ref as y, onMounted as F, watch as P, onBeforeUnmount as q, openBlock as g, createElementBlock as _, createElementVNode as T, toDisplayString as A, unref as M, createCommentVNode as k, createBlock as G, normalizeStyle as H } from "vue";
|
|
2
|
+
import { u as I, b as N, k as x, L as O, Z as S } from "./index-CEk6FKm3.mjs";
|
|
3
3
|
import { init as B } from "pptx-preview";
|
|
4
4
|
import { _ as V } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const Z = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, U = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "vfp-absolute vfp-inset-0 vfp-renderer-loading vfp-bg-surface-toolbar vfp-backdrop-blur-sm vfp-z-10"
|
|
8
|
-
}, $ = { class: "vfp-renderer-loading-content" }, j = { class: "vfp-renderer-loading-text vfp-text-xs md:vfp-text-sm vfp-text-fg-secondary vfp-font-medium" }, ee = /* @__PURE__ */
|
|
8
|
+
}, $ = { class: "vfp-renderer-loading-content" }, j = { class: "vfp-renderer-loading-text vfp-text-xs md:vfp-text-sm vfp-text-fg-secondary vfp-font-medium" }, ee = /* @__PURE__ */ W({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
11
11
|
url: {},
|
|
@@ -19,7 +19,7 @@ const Z = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-fu
|
|
|
19
19
|
if (!r.value) return { width: 960, height: 540 };
|
|
20
20
|
const t = r.value.clientWidth, e = ((f = r.value.parentElement) == null ? void 0 : f.clientWidth) || 0, i = t > 100 ? t : e > 100 ? e : 300, n = Math.floor(i * D);
|
|
21
21
|
return { width: i, height: n };
|
|
22
|
-
},
|
|
22
|
+
}, L = async () => {
|
|
23
23
|
if (!(!r.value || !d || p.value === 0))
|
|
24
24
|
try {
|
|
25
25
|
if (l)
|
|
@@ -84,7 +84,7 @@ const Z = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-fu
|
|
|
84
84
|
e instanceof Error ? i = S(o.value, e) : typeof e == "string" && (i = e), u.value = i, a.value = !1;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
return
|
|
87
|
+
return F(() => {
|
|
88
88
|
if (!r.value) return;
|
|
89
89
|
let t = !0;
|
|
90
90
|
v = new ResizeObserver(() => {
|
|
@@ -94,7 +94,7 @@ const Z = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-fu
|
|
|
94
94
|
}
|
|
95
95
|
const e = m(), i = Math.abs(h.width - e.width), n = Math.abs(h.height - e.height);
|
|
96
96
|
i < 10 && n < 10 || (h = e, c !== null && clearTimeout(c), c = window.setTimeout(() => {
|
|
97
|
-
l && d &&
|
|
97
|
+
l && d && L();
|
|
98
98
|
}, 800));
|
|
99
99
|
}), v.observe(r.value), setTimeout(() => {
|
|
100
100
|
requestAnimationFrame(() => requestAnimationFrame(() => E()));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as te, _ as ne,
|
|
1
|
+
import { defineComponent as O, ref as d, computed as $, onMounted as ie, onBeforeUnmount as J, watch as G, openBlock as r, createElementBlock as c, normalizeStyle as E, Fragment as F, createElementVNode as a, normalizeClass as U, 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 Y, renderList as Q, createCommentVNode as ee, defineAsyncComponent as re, withCtx as Z, Teleport as ve } from "vue";
|
|
2
|
+
import { u as te, _ as ne, w as fe, C as de, b as pe, q as X, k as ue, r as ce, Y as me, G as he, v as ge } from "./index-CEk6FKm3.mjs";
|
|
3
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
4
|
import { _ as A } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.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" },
|
|
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" }, Ce = { class: "vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden" }, Re = /* @__PURE__ */ O({
|
|
7
7
|
name: "ResizableSplit",
|
|
8
8
|
__name: "ResizableSplit",
|
|
9
9
|
props: {
|
|
@@ -34,19 +34,19 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
34
34
|
() => T.value && b.value ? { width: `${f.value}px` } : void 0
|
|
35
35
|
), p = $(() => T.value && b.value), y = (i) => {
|
|
36
36
|
if (!w.value) return;
|
|
37
|
-
const k = w.value.getBoundingClientRect(), B = i.clientX - k.left,
|
|
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)
|
|
41
41
|
);
|
|
42
|
-
},
|
|
43
|
-
if (S.value && (S.value = !1, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup",
|
|
42
|
+
}, C = () => {
|
|
43
|
+
if (S.value && (S.value = !1, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", C), document.body.style.cursor = "", document.body.style.userSelect = "", n.storageKey))
|
|
44
44
|
try {
|
|
45
45
|
window.localStorage.setItem(n.storageKey, String(f.value));
|
|
46
46
|
} catch {
|
|
47
47
|
}
|
|
48
48
|
}, W = (i) => {
|
|
49
|
-
i.preventDefault(), S.value = !0, window.addEventListener("mousemove", y), window.addEventListener("mouseup",
|
|
49
|
+
i.preventDefault(), S.value = !0, window.addEventListener("mousemove", y), window.addEventListener("mouseup", C), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
50
50
|
};
|
|
51
51
|
ie(() => {
|
|
52
52
|
if (typeof window < "u") {
|
|
@@ -57,68 +57,68 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
57
57
|
i(), t = typeof ResizeObserver < "u" ? new ResizeObserver(i) : null, t == null || t.observe(w.value);
|
|
58
58
|
}
|
|
59
59
|
}), J(() => {
|
|
60
|
-
l && l.removeEventListener("change", v), t == null || t.disconnect(), t = null, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup",
|
|
61
|
-
}),
|
|
60
|
+
l && l.removeEventListener("change", v), t == null || t.disconnect(), t = null, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", C), S.value && (document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
61
|
+
}), G(
|
|
62
62
|
() => n.initialLeftWidth,
|
|
63
63
|
(i) => {
|
|
64
64
|
n.storageKey || (f.value = i);
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
const
|
|
67
|
+
const R = (i) => {
|
|
68
68
|
x.value = i;
|
|
69
69
|
};
|
|
70
|
-
return I({ switchTab:
|
|
70
|
+
return I({ switchTab: R }), (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:
|
|
74
|
+
style: E(p.value ? void 0 : { flexDirection: "column" })
|
|
75
75
|
}, [
|
|
76
76
|
s.mobileTabMode && !p.value ? (r(), c(F, { key: 0 }, [
|
|
77
77
|
a("div", Te, [
|
|
78
78
|
a("button", {
|
|
79
79
|
type: "button",
|
|
80
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"]),
|
|
81
|
-
onClick: k[0] || (k[0] = (B) =>
|
|
81
|
+
onClick: k[0] || (k[0] = (B) => R("left"))
|
|
82
82
|
}, _(s.leftTabLabel ?? g(u)("zip.file_tree")), 3),
|
|
83
83
|
a("button", {
|
|
84
84
|
type: "button",
|
|
85
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"]),
|
|
86
|
-
onClick: k[1] || (k[1] = (B) =>
|
|
86
|
+
onClick: k[1] || (k[1] = (B) => R("right"))
|
|
87
87
|
}, _(s.rightTabLabel ?? g(u)("toolbar.preview")), 3)
|
|
88
88
|
]),
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
q(a("div", _e, [
|
|
90
|
+
N(i.$slots, "left", {}, void 0, !0)
|
|
91
91
|
], 512), [
|
|
92
|
-
[
|
|
92
|
+
[V, x.value === "left"]
|
|
93
93
|
]),
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
q(a("div", $e, [
|
|
95
|
+
N(i.$slots, "right", {}, void 0, !0)
|
|
96
96
|
], 512), [
|
|
97
|
-
[
|
|
97
|
+
[V, x.value === "right"]
|
|
98
98
|
])
|
|
99
99
|
], 64)) : (r(), c(F, { 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:
|
|
102
|
+
style: E(L.value)
|
|
103
103
|
}, [
|
|
104
|
-
|
|
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
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:
|
|
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
|
-
a("div",
|
|
116
|
-
|
|
115
|
+
a("div", Ce, [
|
|
116
|
+
N(i.$slots, "right", {}, void 0, !0)
|
|
117
117
|
])
|
|
118
118
|
], 64))
|
|
119
119
|
], 4));
|
|
120
120
|
}
|
|
121
|
-
}), Me = /* @__PURE__ */ ne(
|
|
121
|
+
}), Me = /* @__PURE__ */ ne(Re, [["__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" }, Ue = { name: "ZipTreeItem" }, Fe = /* @__PURE__ */ O({
|
|
122
122
|
...Ue,
|
|
123
123
|
props: {
|
|
124
124
|
node: {},
|
|
@@ -141,18 +141,18 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
141
141
|
a("button", {
|
|
142
142
|
type: "button",
|
|
143
143
|
class: "tree-row dir-row",
|
|
144
|
-
style:
|
|
144
|
+
style: E(w.value),
|
|
145
145
|
onClick: t[0] || (t[0] = (L) => u("toggle", s.node.path)),
|
|
146
146
|
onMouseenter: b,
|
|
147
147
|
onMouseleave: x
|
|
148
148
|
}, [
|
|
149
|
-
|
|
149
|
+
H(g(ke), {
|
|
150
150
|
class: U(["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(),
|
|
153
|
-
a("span",
|
|
152
|
+
(r(), D(Y(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(),
|
|
155
|
+
f.value && s.node.children ? (r(!0), c(F, { 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,
|
|
@@ -167,34 +167,34 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
167
167
|
key: 1,
|
|
168
168
|
type: "button",
|
|
169
169
|
class: U(["tree-row file-row", { selected: S.value }]),
|
|
170
|
-
style:
|
|
170
|
+
style: E(w.value),
|
|
171
171
|
onClick: t[5] || (t[5] = (L) => u("select", s.node)),
|
|
172
172
|
onMouseenter: b,
|
|
173
173
|
onMouseleave: x
|
|
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(),
|
|
177
|
-
a("span",
|
|
176
|
+
(r(), D(Y(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"]]),
|
|
182
|
+
}), Be = /* @__PURE__ */ ne(Fe, [["__scopeId", "data-v-124c382d"]]), Ke = {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: "vfp-renderer-loading"
|
|
185
|
-
},
|
|
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" }, Ge = {
|
|
186
186
|
key: 0,
|
|
187
187
|
class: "vfp-renderer-loading vfp-flex-1"
|
|
188
|
-
},
|
|
188
|
+
}, Oe = { class: "vfp-renderer-loading-content" }, qe = { class: "vfp-renderer-loading-text" }, Ve = {
|
|
189
189
|
key: 1,
|
|
190
190
|
class: "vfp-flex-1"
|
|
191
|
-
},
|
|
191
|
+
}, Ye = {
|
|
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
|
+
}, Ze = {
|
|
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__ */
|
|
197
|
+
}, tt = /* @__PURE__ */ O({
|
|
198
198
|
__name: "index",
|
|
199
199
|
props: {
|
|
200
200
|
url: {},
|
|
@@ -202,12 +202,12 @@ 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-
|
|
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),
|
|
205
|
+
() => import("./index-CEk6FKm3.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), C = d(null), W = d(null), R = () => {
|
|
207
207
|
var e;
|
|
208
208
|
(e = v.value) != null && e.blobUrl && URL.revokeObjectURL(v.value.blobUrl);
|
|
209
209
|
}, i = async () => {
|
|
210
|
-
|
|
210
|
+
R(), v.value = null, x.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");
|
|
@@ -215,7 +215,7 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
215
215
|
T.value = m, b.value = h;
|
|
216
216
|
const M = /* @__PURE__ */ new Set([""]);
|
|
217
217
|
if (h.children)
|
|
218
|
-
for (const
|
|
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");
|
|
@@ -223,10 +223,10 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
223
223
|
x.value = !1;
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
G(() => u.url, (e) => {
|
|
227
227
|
e && i();
|
|
228
228
|
}, { immediate: !0 }), J(() => {
|
|
229
|
-
|
|
229
|
+
R();
|
|
230
230
|
});
|
|
231
231
|
const k = $(() => {
|
|
232
232
|
if (!b.value) return null;
|
|
@@ -237,11 +237,11 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
237
237
|
};
|
|
238
238
|
return z(b.value), { files: e, dirs: o, size: m };
|
|
239
239
|
});
|
|
240
|
-
|
|
240
|
+
G(k, () => w.notify()), I({
|
|
241
241
|
getToolbarGroups: () => [],
|
|
242
242
|
onToolbarChange: (e) => w.subscribe(e)
|
|
243
243
|
});
|
|
244
|
-
const
|
|
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) => {
|
|
@@ -252,29 +252,29 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
252
252
|
}, oe = async (e) => {
|
|
253
253
|
var o, m, z;
|
|
254
254
|
if (!(!T.value || e.isDir || ((o = v.value) == null ? void 0 : o.path) === e.path || W.value === e.path)) {
|
|
255
|
-
W.value = e.path,
|
|
255
|
+
W.value = e.path, R(), 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),
|
|
258
|
-
v.value = { path: e.path, name: e.name, size: e.size, blobUrl:
|
|
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 = C.value) == null || m.switchTab("right");
|
|
259
259
|
} catch (h) {
|
|
260
|
-
console.error(h), p.value = f.value("zip.entry_read_failed"), (z =
|
|
260
|
+
console.error(h), p.value = f.value("zip.entry_read_failed"), (z = C.value) == null || z.switchTab("right");
|
|
261
261
|
} finally {
|
|
262
262
|
L.value = !1, W.value === e.path && (W.value = null);
|
|
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",
|
|
267
|
-
a("div",
|
|
266
|
+
return (e, o) => x.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",
|
|
269
|
+
a("span", He, _(g(f)("common.loading")), 1)
|
|
270
270
|
])
|
|
271
|
-
])) : l.value || !b.value ? (r(),
|
|
271
|
+
])) : l.value || !b.value ? (r(), D(A, {
|
|
272
272
|
key: 1,
|
|
273
273
|
message: l.value || g(f)("zip.parse_failed")
|
|
274
274
|
}, null, 8, ["message"])) : (r(), c(F, { key: 2 }, [
|
|
275
|
-
|
|
275
|
+
H(Me, {
|
|
276
276
|
ref_key: "splitRef",
|
|
277
|
-
ref:
|
|
277
|
+
ref: C,
|
|
278
278
|
"initial-left-width": 280,
|
|
279
279
|
"min-left-width": 180,
|
|
280
280
|
"max-left-width": 560,
|
|
@@ -283,17 +283,17 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
283
283
|
"left-tab-label": g(f)("zip.file_tree"),
|
|
284
284
|
"right-tab-label": g(f)("toolbar.preview")
|
|
285
285
|
}, {
|
|
286
|
-
left:
|
|
287
|
-
a("div",
|
|
286
|
+
left: Z(() => [
|
|
287
|
+
a("div", Pe, [
|
|
288
288
|
(r(!0), c(F, null, Q(b.value.children || [], (m) => {
|
|
289
289
|
var z;
|
|
290
|
-
return r(),
|
|
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:
|
|
296
|
+
onToggle: P,
|
|
297
297
|
onSelect: oe,
|
|
298
298
|
onHover: j,
|
|
299
299
|
onLeave: le
|
|
@@ -301,32 +301,32 @@ const Te = { class: "vfp-flex vfp-flex-shrink-0 vfp-border-b vfp-border-line-wea
|
|
|
301
301
|
}), 128))
|
|
302
302
|
])
|
|
303
303
|
]),
|
|
304
|
-
right:
|
|
304
|
+
right: Z(() => [
|
|
305
305
|
a("div", je, [
|
|
306
|
-
L.value ? (r(), c("div",
|
|
307
|
-
a("div",
|
|
306
|
+
L.value ? (r(), c("div", Ge, [
|
|
307
|
+
a("div", Oe, [
|
|
308
308
|
o[1] || (o[1] = a("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
309
|
-
a("span",
|
|
309
|
+
a("span", qe, _(g(f)("common.loading")), 1)
|
|
310
310
|
])
|
|
311
|
-
])) : p.value ? (r(), c("div",
|
|
312
|
-
|
|
313
|
-
])) : v.value ? (r(), c("div",
|
|
314
|
-
|
|
311
|
+
])) : p.value ? (r(), c("div", Ve, [
|
|
312
|
+
H(A, { message: p.value }, null, 8, ["message"])
|
|
313
|
+
])) : v.value ? (r(), c("div", Ze, [
|
|
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",
|
|
320
|
+
])) : (r(), c("div", Ye, _(g(f)("zip.select_file")), 1))
|
|
321
321
|
])
|
|
322
322
|
]),
|
|
323
323
|
_: 1
|
|
324
324
|
}, 8, ["left-tab-label", "right-tab-label"]),
|
|
325
|
-
(r(),
|
|
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:
|
|
329
|
+
style: E({
|
|
330
330
|
position: "fixed",
|
|
331
331
|
zIndex: 2147483647,
|
|
332
332
|
pointerEvents: "none",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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,
|
|
3
|
-
import { u as X } from "./useShikiHighlight-
|
|
2
|
+
import { u as G, b as N, T as P } from "./index-CEk6FKm3.mjs";
|
|
3
|
+
import { u as X } from "./useShikiHighlight-BdhPCj48.mjs";
|
|
4
4
|
import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const j = {
|
|
6
6
|
key: 0,
|
|
@@ -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),
|
|
23
|
+
const m = k, { t: g } = G(), b = N(), i = u(""), f = u(!0), c = u(null), T = u("xml"), { lineHtmls: _ } = X(i, T), S = (e) => {
|
|
24
24
|
const t = " ", o = /(>)(<)(\/*)/g, s = e.replace(o, `$1
|
|
25
25
|
$2$3`);
|
|
26
26
|
let n = 0;
|
|
@@ -37,7 +37,7 @@ $2$3`);
|
|
|
37
37
|
const o = new DOMParser().parseFromString(e, "application/xml");
|
|
38
38
|
if (o.querySelector("parsererror")) return e;
|
|
39
39
|
const n = new XMLSerializer().serializeToString(o);
|
|
40
|
-
return
|
|
40
|
+
return S(n);
|
|
41
41
|
} catch {
|
|
42
42
|
return e;
|
|
43
43
|
}
|