@eternalheart/vue-file-preview 1.3.8 → 1.3.10
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/README.md +4 -0
- package/README.zh-CN.md +4 -0
- package/lib/FilePreviewContent.vue.d.ts +13 -1
- package/lib/FilePreviewContent.vue.d.ts.map +1 -1
- package/lib/FilePreviewEmbed.vue.d.ts +13 -1
- package/lib/FilePreviewEmbed.vue.d.ts.map +1 -1
- package/lib/FilePreviewModal.vue.d.ts +13 -1
- package/lib/FilePreviewModal.vue.d.ts.map +1 -1
- package/lib/chunks/{index-BYzQg-jL.mjs → index-7TEaCdxH.mjs} +25 -25
- package/lib/chunks/index-7TEaCdxH.mjs.map +1 -0
- package/lib/chunks/{index-BM9FaQUl.mjs → index-B4_-Yo-b.mjs} +2 -2
- package/lib/chunks/{index-BM9FaQUl.mjs.map → index-B4_-Yo-b.mjs.map} +1 -1
- package/lib/chunks/index-BD0HLPzh.mjs +116 -0
- package/lib/chunks/index-BD0HLPzh.mjs.map +1 -0
- package/lib/chunks/{index-DAo-7spn.mjs → index-BOL895ZO.mjs} +35 -35
- package/lib/chunks/index-BOL895ZO.mjs.map +1 -0
- package/lib/chunks/index-BUn7C84b.mjs +281 -0
- package/lib/chunks/index-BUn7C84b.mjs.map +1 -0
- package/lib/chunks/{index-lHlugUBI.mjs → index-BY_XuO1z.mjs} +2 -2
- package/lib/chunks/{index-lHlugUBI.mjs.map → index-BY_XuO1z.mjs.map} +1 -1
- package/lib/chunks/{index-DXlcF1Dk.mjs → index-BcXyjt8Z.mjs} +2 -2
- package/lib/chunks/{index-DXlcF1Dk.mjs.map → index-BcXyjt8Z.mjs.map} +1 -1
- package/lib/chunks/{index-BoL1b2w-.mjs → index-BlNjLD3A.mjs} +28 -28
- package/lib/chunks/index-BlNjLD3A.mjs.map +1 -0
- package/lib/chunks/index-BuYJGBLT.mjs +2204 -0
- package/lib/chunks/index-BuYJGBLT.mjs.map +1 -0
- package/lib/chunks/{index-D9wf6m37.mjs → index-CuChO3jv.mjs} +53 -53
- package/lib/chunks/index-CuChO3jv.mjs.map +1 -0
- package/lib/chunks/index-CxiRIgnd.mjs +111 -0
- package/lib/chunks/index-CxiRIgnd.mjs.map +1 -0
- package/lib/chunks/index-D-j14MHC.mjs +164 -0
- package/lib/chunks/index-D-j14MHC.mjs.map +1 -0
- package/lib/chunks/{index-C7uOM7XL.mjs → index-DhQPH7M7.mjs} +53 -53
- package/lib/chunks/index-DhQPH7M7.mjs.map +1 -0
- package/lib/chunks/{index-dzB4jd9b.mjs → index-DheF8bvY.mjs} +106 -106
- package/lib/chunks/index-DheF8bvY.mjs.map +1 -0
- package/lib/chunks/{index-Bri7VeRx.mjs → index-DsZdtQJg.mjs} +46 -46
- package/lib/chunks/index-DsZdtQJg.mjs.map +1 -0
- package/lib/chunks/{index-BCkcZs4y.mjs → index-fD12G5fh.mjs} +31 -31
- package/lib/chunks/index-fD12G5fh.mjs.map +1 -0
- package/lib/chunks/index-h8VDgpZB.mjs +244 -0
- package/lib/chunks/index-h8VDgpZB.mjs.map +1 -0
- package/lib/chunks/{index-CTsscgqY.mjs → index-xBRMnurm.mjs} +32 -32
- package/lib/chunks/index-xBRMnurm.mjs.map +1 -0
- package/lib/chunks/{index-5Smm2vx0.mjs → index-y5WgRh6y.mjs} +24 -24
- package/lib/chunks/index-y5WgRh6y.mjs.map +1 -0
- package/lib/composables/useRequest.d.ts +24 -0
- package/lib/composables/useRequest.d.ts.map +1 -0
- package/lib/index.cjs +28 -24
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +9 -8
- package/lib/renderers/Csv/index.vue.d.ts.map +1 -1
- package/lib/renderers/Docx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Epub/index.vue.d.ts.map +1 -1
- package/lib/renderers/Font/FontPreviewLine.vue.d.ts +18 -0
- package/lib/renderers/Font/FontPreviewLine.vue.d.ts.map +1 -0
- package/lib/renderers/Font/index.vue.d.ts +6 -0
- package/lib/renderers/Font/index.vue.d.ts.map +1 -0
- package/lib/renderers/Json/index.vue.d.ts.map +1 -1
- package/lib/renderers/Markdown/index.vue.d.ts.map +1 -1
- package/lib/renderers/Mobi/index.vue.d.ts.map +1 -1
- package/lib/renderers/Msg/index.vue.d.ts.map +1 -1
- package/lib/renderers/Pdf/index.vue.d.ts.map +1 -1
- package/lib/renderers/Pptx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Subtitle/index.vue.d.ts.map +1 -1
- package/lib/renderers/Text/index.vue.d.ts.map +1 -1
- package/lib/renderers/Xlsx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Xml/index.vue.d.ts.map +1 -1
- package/lib/renderers/Zip/index.vue.d.ts.map +1 -1
- package/lib/renderers/lazy.d.ts +1 -0
- package/lib/renderers/lazy.d.ts.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/lib/chunks/index-5Smm2vx0.mjs.map +0 -1
- package/lib/chunks/index-BCkcZs4y.mjs.map +0 -1
- package/lib/chunks/index-BYzQg-jL.mjs.map +0 -1
- package/lib/chunks/index-BoL1b2w-.mjs.map +0 -1
- package/lib/chunks/index-Bri7VeRx.mjs.map +0 -1
- package/lib/chunks/index-C324a7kV.mjs +0 -2017
- package/lib/chunks/index-C324a7kV.mjs.map +0 -1
- package/lib/chunks/index-C7uOM7XL.mjs.map +0 -1
- package/lib/chunks/index-CTsscgqY.mjs.map +0 -1
- package/lib/chunks/index-Ch7AEfnk.mjs +0 -116
- package/lib/chunks/index-Ch7AEfnk.mjs.map +0 -1
- package/lib/chunks/index-D9wf6m37.mjs.map +0 -1
- package/lib/chunks/index-DAEQe-RI.mjs +0 -111
- package/lib/chunks/index-DAEQe-RI.mjs.map +0 -1
- package/lib/chunks/index-DAo-7spn.mjs.map +0 -1
- package/lib/chunks/index-ELyTQZeF.mjs +0 -281
- package/lib/chunks/index-ELyTQZeF.mjs.map +0 -1
- package/lib/chunks/index-cZn4ih-x.mjs +0 -111
- package/lib/chunks/index-cZn4ih-x.mjs.map +0 -1
- package/lib/chunks/index-dzB4jd9b.mjs.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { u as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as a, watch as y, nextTick as D, openBlock as i, createElementBlock as f, createElementVNode as r, toDisplayString as S, normalizeStyle as L, Fragment as M, renderList as N } from "vue";
|
|
2
|
+
import $ from "mammoth";
|
|
3
|
+
import { u as B, a as F } from "./index-BuYJGBLT.mjs";
|
|
4
|
+
const I = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
7
|
-
},
|
|
7
|
+
}, j = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
10
|
-
},
|
|
10
|
+
}, C = { class: "vfp-text-fg-secondary vfp-text-center" }, R = { class: "vfp-text-lg" }, q = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
13
13
|
style: { background: "rgba(0, 0, 0, 0.15)" }
|
|
14
|
-
},
|
|
14
|
+
}, z = ["innerHTML"], O = ["innerHTML"], _ = 1123, x = 60, g = 50, U = 24, Y = /* @__PURE__ */ P({
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
17
17
|
url: {}
|
|
18
18
|
},
|
|
19
19
|
setup(w) {
|
|
20
|
-
const H = _ - x * 2, v = w, { t: k } =
|
|
20
|
+
const H = _ - x * 2, v = w, { t: k } = B(), E = F(), n = a(""), p = a(!0), c = a(null), o = a([]), d = a(null), T = async () => {
|
|
21
21
|
p.value = !0, c.value = null, n.value = "", o.value = [];
|
|
22
22
|
try {
|
|
23
|
-
const t = await
|
|
23
|
+
const t = await E.value(v.url);
|
|
24
24
|
if (!t.ok) throw new Error("文件加载失败");
|
|
25
|
-
const l = await t.arrayBuffer(), e = await
|
|
25
|
+
const l = await t.arrayBuffer(), e = await $.convertToHtml({ arrayBuffer: l });
|
|
26
26
|
n.value = e.value;
|
|
27
27
|
} catch (t) {
|
|
28
28
|
console.error("Docx 解析错误:", t), c.value = k.value("docx.parse_failed");
|
|
29
29
|
} finally {
|
|
30
30
|
p.value = !1;
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, b = () => {
|
|
33
33
|
const t = d.value;
|
|
34
34
|
if (!t || !n.value) return;
|
|
35
35
|
const l = Array.from(t.children);
|
|
@@ -38,27 +38,27 @@ const B = {
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
const e = [[]];
|
|
41
|
-
let
|
|
41
|
+
let s = 0;
|
|
42
42
|
for (const u of l) {
|
|
43
43
|
const m = u.offsetHeight;
|
|
44
|
-
|
|
44
|
+
s > 0 && s + m > H && (e.push([]), s = 0), e[e.length - 1].push(u.outerHTML), s += m;
|
|
45
45
|
}
|
|
46
46
|
e.length === 0 && e.push([]), o.value = e.map((u) => u.join(""));
|
|
47
47
|
};
|
|
48
|
-
y(() => v.url,
|
|
49
|
-
n.value && (await
|
|
48
|
+
y(() => v.url, T, { immediate: !0 }), y(n, async () => {
|
|
49
|
+
n.value && (await D(), requestAnimationFrame(() => b()));
|
|
50
50
|
});
|
|
51
51
|
const h = {
|
|
52
52
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
53
53
|
lineHeight: "1.8",
|
|
54
54
|
color: "#333"
|
|
55
|
-
},
|
|
55
|
+
}, A = {
|
|
56
56
|
...h,
|
|
57
57
|
position: "absolute",
|
|
58
58
|
visibility: "hidden",
|
|
59
59
|
width: `${794 - g * 2}px`,
|
|
60
60
|
pointerEvents: "none"
|
|
61
|
-
},
|
|
61
|
+
}, G = {
|
|
62
62
|
width: "100%",
|
|
63
63
|
maxWidth: "794px",
|
|
64
64
|
minHeight: `${_}px`,
|
|
@@ -67,37 +67,37 @@ const B = {
|
|
|
67
67
|
flexShrink: 0,
|
|
68
68
|
padding: `${x}px ${g}px`
|
|
69
69
|
};
|
|
70
|
-
return (t, l) => p.value ? (i(), f("div",
|
|
71
|
-
|
|
72
|
-
])])) : c.value ? (i(), f("div",
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
return (t, l) => p.value ? (i(), f("div", I, [...l[0] || (l[0] = [
|
|
71
|
+
r("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
72
|
+
])])) : c.value ? (i(), f("div", j, [
|
|
73
|
+
r("div", C, [
|
|
74
|
+
r("p", R, S(c.value), 1)
|
|
75
75
|
])
|
|
76
|
-
])) : (i(), f("div",
|
|
77
|
-
|
|
76
|
+
])) : (i(), f("div", q, [
|
|
77
|
+
r("div", {
|
|
78
78
|
ref_key: "measureRef",
|
|
79
79
|
ref: d,
|
|
80
|
-
style:
|
|
80
|
+
style: A,
|
|
81
81
|
innerHTML: n.value
|
|
82
|
-
}, null, 8,
|
|
83
|
-
|
|
82
|
+
}, null, 8, z),
|
|
83
|
+
r("div", {
|
|
84
84
|
class: "vfp-py-6 md:vfp-py-10 vfp-flex vfp-flex-col vfp-items-center",
|
|
85
|
-
style:
|
|
85
|
+
style: L({ gap: `${U}px` })
|
|
86
86
|
}, [
|
|
87
|
-
(i(!0), f(
|
|
88
|
-
key:
|
|
89
|
-
style:
|
|
87
|
+
(i(!0), f(M, null, N(o.value.length > 0 ? o.value : [""], (e, s) => (i(), f("div", {
|
|
88
|
+
key: s,
|
|
89
|
+
style: G
|
|
90
90
|
}, [
|
|
91
|
-
|
|
91
|
+
r("div", {
|
|
92
92
|
style: h,
|
|
93
93
|
innerHTML: e
|
|
94
|
-
}, null, 8,
|
|
94
|
+
}, null, 8, O)
|
|
95
95
|
]))), 128))
|
|
96
96
|
], 4)
|
|
97
97
|
]));
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
export {
|
|
101
|
-
|
|
101
|
+
Y as default
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=index-
|
|
103
|
+
//# sourceMappingURL=index-BOL895ZO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BOL895ZO.mjs","sources":["../../src/renderers/Docx/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, watch, nextTick } from 'vue';\nimport mammoth from 'mammoth';\nimport { useTranslator } from '../../composables/useTranslator';\nimport { useFetcher } from '../../composables/useRequest';\n\nconst PAGE_HEIGHT = 1123;\nconst PAGE_PADDING_Y = 60;\nconst PAGE_PADDING_X = 50;\nconst PAGE_CONTENT_HEIGHT = PAGE_HEIGHT - PAGE_PADDING_Y * 2;\nconst PAGE_GAP = 24;\n\nconst props = defineProps<{\n url: string;\n}>();\n\nconst { t } = useTranslator();\nconst fetcher = useFetcher();\n\nconst html = ref('');\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst pages = ref<string[]>([]);\nconst measureRef = ref<HTMLDivElement | null>(null);\n\nconst loadDocx = async () => {\n loading.value = true;\n error.value = null;\n html.value = '';\n pages.value = [];\n\n try {\n const response = await fetcher.value(props.url);\n if (!response.ok) throw new Error('文件加载失败');\n const arrayBuffer = await response.arrayBuffer();\n const result = await mammoth.convertToHtml({ arrayBuffer });\n html.value = result.value;\n } catch (err) {\n console.error('Docx 解析错误:', err);\n error.value = t.value('docx.parse_failed');\n } finally {\n loading.value = false;\n }\n};\n\nconst paginate = () => {\n const container = measureRef.value;\n if (!container || !html.value) return;\n\n const children = Array.from(container.children) as HTMLElement[];\n if (children.length === 0) {\n pages.value = [html.value];\n return;\n }\n\n const result: string[][] = [[]];\n let currentPageUsed = 0;\n\n for (const child of children) {\n const h = child.offsetHeight;\n\n if (currentPageUsed > 0 && currentPageUsed + h > PAGE_CONTENT_HEIGHT) {\n result.push([]);\n currentPageUsed = 0;\n }\n\n result[result.length - 1].push(child.outerHTML);\n currentPageUsed += h;\n }\n\n if (result.length === 0) result.push([]);\n\n pages.value = result.map((blocks) => blocks.join(''));\n};\n\nwatch(() => props.url, loadDocx, { immediate: true });\n\nwatch(html, async () => {\n if (!html.value) return;\n await nextTick();\n requestAnimationFrame(() => paginate());\n});\n\nconst contentStyle = {\n fontFamily: 'system-ui, -apple-system, sans-serif',\n lineHeight: '1.8',\n color: '#333',\n};\n\nconst measureStyle = {\n ...contentStyle,\n position: 'absolute' as const,\n visibility: 'hidden' as const,\n width: `${794 - PAGE_PADDING_X * 2}px`,\n pointerEvents: 'none' as const,\n};\n\nconst pageStyle = {\n width: '100%',\n maxWidth: '794px',\n minHeight: `${PAGE_HEIGHT}px`,\n background: 'white',\n boxShadow: '0 2px 12px rgba(0, 0, 0, 0.15)',\n flexShrink: 0,\n padding: `${PAGE_PADDING_Y}px ${PAGE_PADDING_X}px`,\n};\n</script>\n\n<template>\n <div v-if=\"loading\" class=\"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full\">\n <div\n class=\"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin\"\n />\n </div>\n\n <div v-else-if=\"error\" class=\"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full\">\n <div class=\"vfp-text-fg-secondary vfp-text-center\">\n <p class=\"vfp-text-lg\">{{ error }}</p>\n </div>\n </div>\n\n <div v-else class=\"vfp-w-full vfp-h-full vfp-overflow-auto\" style=\"background: rgba(0, 0, 0, 0.15)\">\n <!-- 隐藏测量区 -->\n <div ref=\"measureRef\" :style=\"measureStyle\" v-html=\"html\" />\n\n <!-- 实际页面 -->\n <div\n class=\"vfp-py-6 md:vfp-py-10 vfp-flex vfp-flex-col vfp-items-center\"\n :style=\"{ gap: `${PAGE_GAP}px` }\"\n >\n <div v-for=\"(pageHtml, i) in pages.length > 0 ? pages : ['']\" :key=\"i\" :style=\"pageStyle\">\n <div :style=\"contentStyle\" v-html=\"pageHtml\" />\n </div>\n </div>\n </div>\n</template>\n"],"names":["PAGE_HEIGHT","PAGE_PADDING_Y","PAGE_PADDING_X","PAGE_GAP","PAGE_CONTENT_HEIGHT","props","__props","t","useTranslator","fetcher","useFetcher","html","ref","loading","error","pages","measureRef","loadDocx","response","arrayBuffer","result","mammoth","err","paginate","container","children","currentPageUsed","child","h","blocks","watch","nextTick","contentStyle","measureStyle","pageStyle","_openBlock","_createElementBlock","_hoisted_1","_cache","_createElementVNode","_hoisted_2","_hoisted_3","_hoisted_4","_toDisplayString","_hoisted_5","_Fragment","_renderList","pageHtml","i"],"mappings":";;;;;;;;;;;;;yCAMMA,IAAc,MACdC,IAAiB,IACjBC,IAAiB,IAEjBC,IAAW;;;;;;AADjB,UAAMC,IAAsBJ,IAAcC,IAAiB,GAGrDI,IAAQC,GAIR,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAOC,EAAI,EAAE,GACbC,IAAUD,EAAI,EAAI,GAClBE,IAAQF,EAAmB,IAAI,GAC/BG,IAAQH,EAAc,EAAE,GACxBI,IAAaJ,EAA2B,IAAI,GAE5CK,IAAW,YAAY;AAC3B,MAAAJ,EAAQ,QAAQ,IAChBC,EAAM,QAAQ,MACdH,EAAK,QAAQ,IACbI,EAAM,QAAQ,CAAA;AAEd,UAAI;AACF,cAAMG,IAAW,MAAMT,EAAQ,MAAMJ,EAAM,GAAG;AAC9C,YAAI,CAACa,EAAS,GAAI,OAAM,IAAI,MAAM,QAAQ;AAC1C,cAAMC,IAAc,MAAMD,EAAS,YAAA,GAC7BE,IAAS,MAAMC,EAAQ,cAAc,EAAE,aAAAF,GAAa;AAC1D,QAAAR,EAAK,QAAQS,EAAO;AAAA,MACtB,SAASE,GAAK;AACZ,gBAAQ,MAAM,cAAcA,CAAG,GAC/BR,EAAM,QAAQ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A,MACzB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,SAAS,GAAGC,CAAc,MAAMC,CAAc;AAAA,IAAA;qBAKnCW,EAAA,SAAXsB,EAAA,GAAAC,EAIM,OAJNC,GAIM,CAAA,GAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,MAHJC,EAEE,OAAA,EADA,OAAM,oHAAA,GAAmH,MAAA,EAAA;AAAA,IAAA,QAI7GzB,EAAA,SAAhBqB,EAAA,GAAAC,EAIM,OAJNI,GAIM;AAAA,MAHJD,EAEM,OAFNE,GAEM;AAAA,QADJF,EAAsC,KAAtCG,GAAsCC,EAAZ7B,EAAA,KAAK,GAAA,CAAA;AAAA,MAAA;WAInCqB,EAAA,GAAAC,EAaM,OAbNQ,GAaM;AAAA,MAXJL,EAA4D,OAAA;AAAA,iBAAnD;AAAA,QAAJ,KAAIvB;AAAA,QAAc,OAAOiB;AAAA,QAAc,WAAQtB,EAAA;AAAA,MAAA;MAGpD4B,EAOM,OAAA;AAAA,QANJ,OAAM;AAAA,QACL,mBAAiBpC,CAAQ,MAAA;AAAA,MAAA;gBAE1BiC,EAEMS,GAAA,MAAAC,EAFuB/B,QAAM,aAAaA,EAAA,QAAK,CAAA,EAAA,GAAA,CAAxCgC,GAAUC,YAAvBZ,EAEM,OAAA;AAAA,UAFyD,KAAKY;AAAA,UAAI,OAAOd;AAAA,QAAA;UAC7EK,EAA+C,OAAA;AAAA,YAAzC,OAAOP;AAAA,YAAc,WAAQe;AAAA,UAAA;;;;;;"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { defineComponent as U, ref as p, computed as z, onMounted as Q, onBeforeUnmount as $, watch as D, openBlock as s, createElementBlock as c, createElementVNode as v, normalizeStyle as T, renderSlot as B, normalizeClass as W, resolveComponent as Y, createVNode as F, unref as C, createBlock as R, resolveDynamicComponent as K, toDisplayString as _, Fragment as I, renderList as O, createCommentVNode as P, defineAsyncComponent as ee, withCtx as N, Teleport as te } from "vue";
|
|
2
|
+
import { _ as V, f as ne, h as le, u as oe, a as se, k as H, i as ae, S as ie, T as re, E as fe } from "./index-BuYJGBLT.mjs";
|
|
3
|
+
import { FileImage as ve, FileText as de, FileCode as ue, File as pe, ChevronRight as ce, FolderOpen as me, Folder as he } from "lucide-vue-next";
|
|
4
|
+
const we = { class: "vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden" }, xe = /* @__PURE__ */ U({
|
|
5
|
+
name: "ResizableSplit",
|
|
6
|
+
__name: "ResizableSplit",
|
|
7
|
+
props: {
|
|
8
|
+
initialLeftWidth: { default: 280 },
|
|
9
|
+
minLeftWidth: { default: 160 },
|
|
10
|
+
maxLeftWidth: { default: 640 },
|
|
11
|
+
minRightWidth: { default: 200 },
|
|
12
|
+
storageKey: {},
|
|
13
|
+
desktopMedia: { default: "(min-width: 768px)" }
|
|
14
|
+
},
|
|
15
|
+
setup(a) {
|
|
16
|
+
const r = a, f = p(null), i = p(
|
|
17
|
+
(() => {
|
|
18
|
+
if (r.storageKey && typeof window < "u") {
|
|
19
|
+
const t = Number(window.localStorage.getItem(r.storageKey));
|
|
20
|
+
if (!isNaN(t) && t > 0) return t;
|
|
21
|
+
}
|
|
22
|
+
return r.initialLeftWidth;
|
|
23
|
+
})()
|
|
24
|
+
), m = p(!1), b = p(!1);
|
|
25
|
+
let h = null;
|
|
26
|
+
const k = () => {
|
|
27
|
+
h && (b.value = h.matches);
|
|
28
|
+
}, w = z(
|
|
29
|
+
() => b.value ? { width: `${i.value}px` } : void 0
|
|
30
|
+
), x = (t) => {
|
|
31
|
+
if (!f.value) return;
|
|
32
|
+
const d = f.value.getBoundingClientRect(), u = t.clientX - d.left, y = d.width - r.minRightWidth - 6, E = Math.min(r.maxLeftWidth, y);
|
|
33
|
+
i.value = Math.max(
|
|
34
|
+
r.minLeftWidth,
|
|
35
|
+
Math.min(E, u)
|
|
36
|
+
);
|
|
37
|
+
}, o = () => {
|
|
38
|
+
if (m.value && (m.value = !1, window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", o), document.body.style.cursor = "", document.body.style.userSelect = "", r.storageKey))
|
|
39
|
+
try {
|
|
40
|
+
window.localStorage.setItem(r.storageKey, String(i.value));
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}, n = (t) => {
|
|
44
|
+
t.preventDefault(), m.value = !0, window.addEventListener("mousemove", x), window.addEventListener("mouseup", o), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
45
|
+
};
|
|
46
|
+
return Q(() => {
|
|
47
|
+
typeof window < "u" && (h = window.matchMedia(r.desktopMedia), k(), h.addEventListener("change", k));
|
|
48
|
+
}), $(() => {
|
|
49
|
+
h && h.removeEventListener("change", k), window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", o), m.value && (document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
50
|
+
}), D(
|
|
51
|
+
() => r.initialLeftWidth,
|
|
52
|
+
(t) => {
|
|
53
|
+
r.storageKey || (i.value = t);
|
|
54
|
+
}
|
|
55
|
+
), (t, d) => (s(), c("div", {
|
|
56
|
+
ref_key: "containerRef",
|
|
57
|
+
ref: f,
|
|
58
|
+
class: "vfp-w-full vfp-h-full vfp-flex vfp-flex-col md:vfp-flex-row vfp-min-h-0 vfp-min-w-0"
|
|
59
|
+
}, [
|
|
60
|
+
v("div", {
|
|
61
|
+
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",
|
|
62
|
+
style: T(w.value)
|
|
63
|
+
}, [
|
|
64
|
+
B(t.$slots, "left", {}, void 0, !0)
|
|
65
|
+
], 4),
|
|
66
|
+
v("div", {
|
|
67
|
+
role: "separator",
|
|
68
|
+
"aria-orientation": "vertical",
|
|
69
|
+
class: W(["split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors", m.value ? "dragging" : ""]),
|
|
70
|
+
onMousedown: n
|
|
71
|
+
}, [...d[0] || (d[0] = [
|
|
72
|
+
v("span", { class: "vfp-absolute vfp-inset-y-0 hit-area" }, null, -1)
|
|
73
|
+
])], 34),
|
|
74
|
+
v("div", we, [
|
|
75
|
+
B(t.$slots, "right", {}, void 0, !0)
|
|
76
|
+
])
|
|
77
|
+
], 512));
|
|
78
|
+
}
|
|
79
|
+
}), ye = /* @__PURE__ */ V(xe, [["__scopeId", "data-v-790c366f"]]), ge = { key: 0 }, be = { class: "vfp-truncate vfp-flex-1 vfp-min-w-0" }, ke = { class: "vfp-flex-1 vfp-truncate vfp-min-w-0" }, Le = { class: "vfp-text-xs vfp-text-fg-disabled vfp-flex-shrink-0 vfp-ml-2" }, Se = { name: "ZipTreeItem" }, ze = /* @__PURE__ */ U({
|
|
80
|
+
...Se,
|
|
81
|
+
props: {
|
|
82
|
+
node: {},
|
|
83
|
+
depth: {},
|
|
84
|
+
selectedPath: {},
|
|
85
|
+
expanded: {}
|
|
86
|
+
},
|
|
87
|
+
emits: ["toggle", "select", "hover", "leave"],
|
|
88
|
+
setup(a, { emit: r }) {
|
|
89
|
+
const f = a, i = r, m = z(() => ({ paddingLeft: `${f.depth * 14 + 10}px` })), b = z(() => f.expanded.has(f.node.path)), h = z(() => f.selectedPath === f.node.path), k = z(() => {
|
|
90
|
+
const o = ne({ name: f.node.name, type: "" });
|
|
91
|
+
return o === "image" ? ve : o === "text" || o === "markdown" || o === "json" || o === "csv" || o === "xml" || o === "subtitle" ? f.node.name.endsWith(".md") || f.node.name.endsWith(".markdown") ? de : ue : pe;
|
|
92
|
+
}), w = (o) => {
|
|
93
|
+
const n = o.currentTarget.getBoundingClientRect();
|
|
94
|
+
i("hover", f.node.name || "/", n);
|
|
95
|
+
}, x = () => i("leave");
|
|
96
|
+
return (o, n) => {
|
|
97
|
+
const t = Y("ZipTreeItem");
|
|
98
|
+
return a.node.isDir ? (s(), c("div", ge, [
|
|
99
|
+
v("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
class: "tree-row dir-row",
|
|
102
|
+
style: T(m.value),
|
|
103
|
+
onClick: n[0] || (n[0] = (d) => i("toggle", a.node.path)),
|
|
104
|
+
onMouseenter: w,
|
|
105
|
+
onMouseleave: x
|
|
106
|
+
}, [
|
|
107
|
+
F(C(ce), {
|
|
108
|
+
class: W(["vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform", { "vfp-rotate-90": b.value }])
|
|
109
|
+
}, null, 8, ["class"]),
|
|
110
|
+
(s(), R(K(b.value ? C(me) : C(he)), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80" })),
|
|
111
|
+
v("span", be, _(a.node.name || "/"), 1)
|
|
112
|
+
], 36),
|
|
113
|
+
b.value && a.node.children ? (s(!0), c(I, { key: 0 }, O(a.node.children, (d) => (s(), R(t, {
|
|
114
|
+
key: d.path,
|
|
115
|
+
node: d,
|
|
116
|
+
depth: a.depth + 1,
|
|
117
|
+
"selected-path": a.selectedPath,
|
|
118
|
+
expanded: a.expanded,
|
|
119
|
+
onToggle: n[1] || (n[1] = (u) => i("toggle", u)),
|
|
120
|
+
onSelect: n[2] || (n[2] = (u) => i("select", u)),
|
|
121
|
+
onHover: n[3] || (n[3] = (u, y) => i("hover", u, y)),
|
|
122
|
+
onLeave: n[4] || (n[4] = (u) => i("leave"))
|
|
123
|
+
}, null, 8, ["node", "depth", "selected-path", "expanded"]))), 128)) : P("", !0)
|
|
124
|
+
])) : (s(), c("button", {
|
|
125
|
+
key: 1,
|
|
126
|
+
type: "button",
|
|
127
|
+
class: W(["tree-row file-row", { selected: h.value }]),
|
|
128
|
+
style: T(m.value),
|
|
129
|
+
onClick: n[5] || (n[5] = (d) => i("select", a.node)),
|
|
130
|
+
onMouseenter: w,
|
|
131
|
+
onMouseleave: x
|
|
132
|
+
}, [
|
|
133
|
+
n[6] || (n[6] = v("span", { class: "vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0" }, null, -1)),
|
|
134
|
+
(s(), R(K(k.value), { class: "vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-fg-tertiary" })),
|
|
135
|
+
v("span", ke, _(a.node.name), 1),
|
|
136
|
+
v("span", Le, _(C(le)(a.node.size)), 1)
|
|
137
|
+
], 38));
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}), Ce = /* @__PURE__ */ V(ze, [["__scopeId", "data-v-c8c0f0ee"]]), _e = {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
143
|
+
}, Ee = {
|
|
144
|
+
key: 1,
|
|
145
|
+
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
146
|
+
}, Me = { class: "vfp-text-fg-secondary vfp-text-center" }, Re = { class: "vfp-text-lg" }, Te = { class: "vfp-w-full vfp-h-full vfp-overflow-auto" }, $e = { class: "vfp-w-full vfp-h-full vfp-flex vfp-flex-col" }, De = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-fg-muted vfp-text-sm vfp-p-6"
|
|
149
|
+
}, We = {
|
|
150
|
+
key: 1,
|
|
151
|
+
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center"
|
|
152
|
+
}, Fe = {
|
|
153
|
+
key: 2,
|
|
154
|
+
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-fg-secondary"
|
|
155
|
+
}, Ie = {
|
|
156
|
+
key: 3,
|
|
157
|
+
class: "vfp-flex-1 vfp-min-h-0 vfp-overflow-hidden vfp-flex vfp-relative vfp-z-0"
|
|
158
|
+
}, Ne = /* @__PURE__ */ U({
|
|
159
|
+
__name: "index",
|
|
160
|
+
props: {
|
|
161
|
+
url: {},
|
|
162
|
+
nestingDepth: { default: 0 }
|
|
163
|
+
},
|
|
164
|
+
emits: ["statsChange"],
|
|
165
|
+
setup(a, { emit: r }) {
|
|
166
|
+
const f = ee(
|
|
167
|
+
() => import("./index-BuYJGBLT.mjs").then((e) => e.s)
|
|
168
|
+
), i = a, m = r, { t: b } = oe(), h = se(), k = p(null), w = p(null), x = p(!0), o = p(null), n = p(/* @__PURE__ */ new Set([""])), t = p(null), d = p(!1), u = p(null), y = p(null), E = () => {
|
|
169
|
+
var e;
|
|
170
|
+
(e = t.value) != null && e.blobUrl && URL.revokeObjectURL(t.value.blobUrl);
|
|
171
|
+
};
|
|
172
|
+
D(() => i.url, async () => {
|
|
173
|
+
E(), t.value = null, x.value = !0, o.value = null;
|
|
174
|
+
try {
|
|
175
|
+
const e = await h.value(i.url);
|
|
176
|
+
if (!e.ok) throw new Error("加载失败");
|
|
177
|
+
const l = await e.arrayBuffer(), g = await ae(l), L = ie(g), S = re(L);
|
|
178
|
+
k.value = g, w.value = S;
|
|
179
|
+
const M = /* @__PURE__ */ new Set([""]);
|
|
180
|
+
if (S.children)
|
|
181
|
+
for (const j of S.children) j.isDir && M.add(j.path);
|
|
182
|
+
n.value = M;
|
|
183
|
+
} catch (e) {
|
|
184
|
+
console.error(e), o.value = b.value("zip.load_failed");
|
|
185
|
+
} finally {
|
|
186
|
+
x.value = !1;
|
|
187
|
+
}
|
|
188
|
+
}, { immediate: !0 }), $(() => {
|
|
189
|
+
E();
|
|
190
|
+
});
|
|
191
|
+
const Z = z(() => {
|
|
192
|
+
if (!w.value) return null;
|
|
193
|
+
let e = 0, l = 0, g = 0;
|
|
194
|
+
const L = (S) => {
|
|
195
|
+
var M;
|
|
196
|
+
S.isDir ? (S.path && l++, (M = S.children) == null || M.forEach(L)) : (e++, g += S.size);
|
|
197
|
+
};
|
|
198
|
+
return L(w.value), { files: e, dirs: l, size: g };
|
|
199
|
+
});
|
|
200
|
+
D(Z, (e) => m("statsChange", e), { immediate: !0 }), $(() => m("statsChange", null));
|
|
201
|
+
const q = (e) => {
|
|
202
|
+
const l = new Set(n.value);
|
|
203
|
+
l.has(e) ? l.delete(e) : l.add(e), n.value = l;
|
|
204
|
+
}, A = (e, l) => {
|
|
205
|
+
y.value = { text: e, x: l.right + 8, y: l.top + l.height / 2 };
|
|
206
|
+
}, X = () => {
|
|
207
|
+
y.value = null;
|
|
208
|
+
}, G = async (e) => {
|
|
209
|
+
if (!(!k.value || e.isDir)) {
|
|
210
|
+
E(), d.value = !0, u.value = null;
|
|
211
|
+
try {
|
|
212
|
+
const l = H(e.name), g = await fe(k.value, e.path, l !== "application/octet-stream" ? l : void 0), L = URL.createObjectURL(g);
|
|
213
|
+
t.value = { path: e.path, name: e.name, size: e.size, blobUrl: L };
|
|
214
|
+
} catch (l) {
|
|
215
|
+
console.error(l), u.value = "条目读取失败";
|
|
216
|
+
} finally {
|
|
217
|
+
d.value = !1;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}, J = z(() => t.value ? [{ name: t.value.name, url: t.value.blobUrl, type: H(t.value.name) }] : []);
|
|
221
|
+
return (e, l) => x.value ? (s(), c("div", _e, [...l[0] || (l[0] = [
|
|
222
|
+
v("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
223
|
+
])])) : o.value || !w.value ? (s(), c("div", Ee, [
|
|
224
|
+
v("div", Me, [
|
|
225
|
+
v("p", Re, _(o.value || C(b)("zip.parse_failed")), 1)
|
|
226
|
+
])
|
|
227
|
+
])) : (s(), c(I, { key: 2 }, [
|
|
228
|
+
F(ye, {
|
|
229
|
+
"initial-left-width": 280,
|
|
230
|
+
"min-left-width": 180,
|
|
231
|
+
"max-left-width": 560,
|
|
232
|
+
"storage-key": "vfp-zip-split-left"
|
|
233
|
+
}, {
|
|
234
|
+
left: N(() => [
|
|
235
|
+
v("div", Te, [
|
|
236
|
+
(s(!0), c(I, null, O(w.value.children || [], (g) => {
|
|
237
|
+
var L;
|
|
238
|
+
return s(), R(Ce, {
|
|
239
|
+
key: g.path,
|
|
240
|
+
node: g,
|
|
241
|
+
depth: 0,
|
|
242
|
+
"selected-path": ((L = t.value) == null ? void 0 : L.path) ?? null,
|
|
243
|
+
expanded: n.value,
|
|
244
|
+
onToggle: q,
|
|
245
|
+
onSelect: G,
|
|
246
|
+
onHover: A,
|
|
247
|
+
onLeave: X
|
|
248
|
+
}, null, 8, ["node", "selected-path", "expanded"]);
|
|
249
|
+
}), 128))
|
|
250
|
+
])
|
|
251
|
+
]),
|
|
252
|
+
right: N(() => [
|
|
253
|
+
v("div", $e, [
|
|
254
|
+
t.value ? d.value ? (s(), c("div", We, [...l[1] || (l[1] = [
|
|
255
|
+
v("div", { class: "vfp-w-8 vfp-h-8 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
256
|
+
])])) : u.value ? (s(), c("div", Fe, _(u.value), 1)) : (s(), c("div", Ie, [
|
|
257
|
+
F(C(f), {
|
|
258
|
+
mode: "embed",
|
|
259
|
+
files: J.value,
|
|
260
|
+
"current-index": 0,
|
|
261
|
+
"zip-nesting-depth": a.nestingDepth + 1
|
|
262
|
+
}, null, 8, ["files", "zip-nesting-depth"])
|
|
263
|
+
])) : (s(), c("div", De, " 从左侧选择一个文件以预览 "))
|
|
264
|
+
])
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
}),
|
|
268
|
+
(s(), R(te, { to: "body" }, [
|
|
269
|
+
y.value ? (s(), c("div", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: "vfp-zip-tip",
|
|
272
|
+
style: T({ left: y.value.x + "px", top: y.value.y + "px" })
|
|
273
|
+
}, _(y.value.text), 5)) : P("", !0)
|
|
274
|
+
]))
|
|
275
|
+
], 64));
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
export {
|
|
279
|
+
Ne as default
|
|
280
|
+
};
|
|
281
|
+
//# sourceMappingURL=index-BUn7C84b.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BUn7C84b.mjs","sources":["../../src/components/ResizableSplit.vue","../../src/renderers/Zip/TreeItem.vue","../../src/renderers/Zip/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, onBeforeUnmount, onMounted, watch } from 'vue';\n\ninterface Props {\n /** 左侧初始宽度(px);传入 storageKey 时会从 localStorage 读取 */\n initialLeftWidth?: number;\n /** 左侧最小宽度(px) */\n minLeftWidth?: number;\n /** 左侧最大宽度(px) */\n maxLeftWidth?: number;\n /** 右侧至少保留的宽度(px) */\n minRightWidth?: number;\n /** localStorage 持久化 key */\n storageKey?: string;\n /** 启用横向拖动的媒体查询 */\n desktopMedia?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n initialLeftWidth: 280,\n minLeftWidth: 160,\n maxLeftWidth: 640,\n minRightWidth: 200,\n desktopMedia: '(min-width: 768px)',\n});\n\ndefineOptions({ name: 'ResizableSplit' });\n\nconst containerRef = ref<HTMLDivElement | null>(null);\nconst leftWidth = ref<number>(\n (() => {\n if (props.storageKey && typeof window !== 'undefined') {\n const saved = Number(window.localStorage.getItem(props.storageKey));\n if (!isNaN(saved) && saved > 0) return saved;\n }\n return props.initialLeftWidth;\n })()\n);\nconst dragging = ref(false);\nconst isDesktop = ref(false);\n\nlet mq: MediaQueryList | null = null;\nconst mqHandler = () => {\n if (mq) isDesktop.value = mq.matches;\n};\n\nconst leftStyle = computed(() =>\n isDesktop.value ? { width: `${leftWidth.value}px` } : undefined\n);\n\nconst onMove = (e: MouseEvent) => {\n if (!containerRef.value) return;\n const rect = containerRef.value.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const cap = rect.width - props.minRightWidth - 6;\n const effectiveMax = Math.min(props.maxLeftWidth, cap);\n leftWidth.value = Math.max(\n props.minLeftWidth,\n Math.min(effectiveMax, x)\n );\n};\n\nconst onUp = () => {\n if (!dragging.value) return;\n dragging.value = false;\n window.removeEventListener('mousemove', onMove);\n window.removeEventListener('mouseup', onUp);\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n if (props.storageKey) {\n try {\n window.localStorage.setItem(props.storageKey, String(leftWidth.value));\n } catch {\n // ignore\n }\n }\n};\n\nconst onDividerDown = (e: MouseEvent) => {\n e.preventDefault();\n dragging.value = true;\n window.addEventListener('mousemove', onMove);\n window.addEventListener('mouseup', onUp);\n document.body.style.cursor = 'col-resize';\n document.body.style.userSelect = 'none';\n};\n\nonMounted(() => {\n if (typeof window !== 'undefined') {\n mq = window.matchMedia(props.desktopMedia);\n mqHandler();\n mq.addEventListener('change', mqHandler);\n }\n});\n\nonBeforeUnmount(() => {\n if (mq) mq.removeEventListener('change', mqHandler);\n window.removeEventListener('mousemove', onMove);\n window.removeEventListener('mouseup', onUp);\n if (dragging.value) {\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n }\n});\n\nwatch(\n () => props.initialLeftWidth,\n (w) => {\n if (!props.storageKey) leftWidth.value = w;\n }\n);\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"vfp-w-full vfp-h-full vfp-flex vfp-flex-col md:vfp-flex-row vfp-min-h-0 vfp-min-w-0\"\n >\n <div\n 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\"\n :style=\"leftStyle\"\n >\n <slot name=\"left\" />\n </div>\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n class=\"split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors\"\n :class=\"dragging ? 'dragging' : ''\"\n @mousedown=\"onDividerDown\"\n >\n <span class=\"vfp-absolute vfp-inset-y-0 hit-area\" />\n </div>\n <div class=\"vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden\">\n <slot name=\"right\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.split-divider {\n background: rgba(255, 255, 255, 0.1);\n}\n.split-divider:hover {\n background: rgba(255, 255, 255, 0.3);\n}\n.split-divider.dragging {\n background: rgba(255, 255, 255, 0.4);\n}\n.hit-area {\n left: -4px;\n right: -4px;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport {\n Folder,\n FolderOpen,\n FileText,\n FileImage,\n FileCode,\n File as FileIcon,\n ChevronRight,\n} from 'lucide-vue-next';\nimport { formatFileSize, getFileType, type ZipTreeNode } from '@eternalheart/file-preview-core';\n\nconst props = defineProps<{\n node: ZipTreeNode;\n depth: number;\n selectedPath: string | null;\n expanded: Set<string>;\n}>();\n\nconst emit = defineEmits<{\n (e: 'toggle', path: string): void;\n (e: 'select', node: ZipTreeNode): void;\n (e: 'hover', text: string, rect: DOMRect): void;\n (e: 'leave'): void;\n}>();\n\nconst padStyle = computed(() => ({ paddingLeft: `${props.depth * 14 + 10}px` }));\nconst isOpen = computed(() => props.expanded.has(props.node.path));\nconst isSelected = computed(() => props.selectedPath === props.node.path);\n\nconst fileIcon = computed(() => {\n const ft = getFileType({ id: '', name: props.node.name, url: '', type: '' });\n if (ft === 'image') return FileImage;\n if (ft === 'text' || ft === 'markdown' || ft === 'json' || ft === 'csv' || ft === 'xml' || ft === 'subtitle') {\n return (props.node.name.endsWith('.md') || props.node.name.endsWith('.markdown')) ? FileText : FileCode;\n }\n return FileIcon;\n});\n\nconst handleEnter = (e: MouseEvent) => {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n emit('hover', props.node.name || '/', rect);\n};\n\nconst handleLeave = () => emit('leave');\n</script>\n\n<template>\n <div v-if=\"node.isDir\">\n <button\n type=\"button\"\n class=\"tree-row dir-row\"\n :style=\"padStyle\"\n @click=\"emit('toggle', node.path)\"\n @mouseenter=\"handleEnter\"\n @mouseleave=\"handleLeave\"\n >\n <ChevronRight\n class=\"vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform\"\n :class=\"{ 'vfp-rotate-90': isOpen }\"\n />\n <component\n :is=\"isOpen ? FolderOpen : Folder\"\n class=\"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80\"\n />\n <span class=\"vfp-truncate vfp-flex-1 vfp-min-w-0\">{{ node.name || '/' }}</span>\n </button>\n <template v-if=\"isOpen && node.children\">\n <ZipTreeItem\n v-for=\"child in node.children\"\n :key=\"child.path\"\n :node=\"child\"\n :depth=\"depth + 1\"\n :selected-path=\"selectedPath\"\n :expanded=\"expanded\"\n @toggle=\"(p) => emit('toggle', p)\"\n @select=\"(n) => emit('select', n)\"\n @hover=\"(t, r) => emit('hover', t, r)\"\n @leave=\"emit('leave')\"\n />\n </template>\n </div>\n <button\n v-else\n type=\"button\"\n class=\"tree-row file-row\"\n :class=\"{ selected: isSelected }\"\n :style=\"padStyle\"\n @click=\"emit('select', node)\"\n @mouseenter=\"handleEnter\"\n @mouseleave=\"handleLeave\"\n >\n <span class=\"vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0\" />\n <component :is=\"fileIcon\" class=\"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-fg-tertiary\" />\n <span class=\"vfp-flex-1 vfp-truncate vfp-min-w-0\">{{ node.name }}</span>\n <span class=\"vfp-text-xs vfp-text-fg-disabled vfp-flex-shrink-0 vfp-ml-2\">{{ formatFileSize(node.size) }}</span>\n </button>\n</template>\n\n<script lang=\"ts\">\nexport default { name: 'ZipTreeItem' };\n</script>\n\n<style scoped>\n.tree-row {\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n padding-right: 0.5rem;\n text-align: left;\n font-size: 0.875rem;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n.dir-row {\n color: var(--fp-fg-secondary);\n}\n.file-row {\n color: var(--fp-fg-secondary);\n}\n.tree-row:hover {\n background: var(--fp-surface-1);\n}\n.file-row.selected {\n background: var(--fp-line);\n color: #fff;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref, computed, watch, onBeforeUnmount, defineAsyncComponent } from 'vue';\nimport type JSZip from 'jszip';\nimport {\n loadZip,\n listZipEntries,\n buildZipTree,\n readZipEntryBlob,\n inferMimeType,\n type ZipTreeNode,\n} from '@eternalheart/file-preview-core';\nimport ResizableSplit from '../../components/ResizableSplit.vue';\nimport TreeItem from './TreeItem.vue';\nimport type { ZipToolbarStats } from './toolbar';\nimport { useTranslator } from '../../composables/useTranslator';\nimport { useFetcher } from '../../composables/useRequest';\n\n// 懒加载 FilePreviewContent 以打破循环依赖\nconst LazyFilePreviewContent = defineAsyncComponent(\n () => import('../../FilePreviewContent.vue')\n);\n\nconst props = withDefaults(defineProps<{\n url: string;\n /** ZIP 嵌套深度(由 FilePreviewContent 传入) */\n nestingDepth?: number;\n}>(), {\n nestingDepth: 0,\n});\n\nconst emit = defineEmits<{\n (e: 'statsChange', stats: ZipToolbarStats | null): void;\n}>();\n\nconst { t } = useTranslator();\nconst fetcher = useFetcher();\n\ninterface SelectedPreview {\n path: string;\n name: string;\n size: number;\n blobUrl: string;\n}\n\ninterface HoverTipState {\n text: string;\n x: number;\n y: number;\n}\n\nconst zip = ref<JSZip | null>(null);\nconst tree = ref<ZipTreeNode | null>(null);\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst expanded = ref<Set<string>>(new Set(['']));\nconst selected = ref<SelectedPreview | null>(null);\nconst previewLoading = ref(false);\nconst previewError = ref<string | null>(null);\nconst hoverTip = ref<HoverTipState | null>(null);\n\nconst revokeCurrent = () => {\n if (selected.value?.blobUrl) URL.revokeObjectURL(selected.value.blobUrl);\n};\n\nconst load = async () => {\n revokeCurrent();\n selected.value = null;\n loading.value = true;\n error.value = null;\n try {\n const res = await fetcher.value(props.url);\n if (!res.ok) throw new Error('加载失败');\n const buf = await res.arrayBuffer();\n const z = await loadZip(buf);\n const entries = listZipEntries(z);\n const root = buildZipTree(entries);\n zip.value = z;\n tree.value = root;\n const init = new Set<string>(['']);\n if (root.children) for (const c of root.children) if (c.isDir) init.add(c.path);\n expanded.value = init;\n } catch (err) {\n console.error(err);\n error.value = t.value('zip.load_failed');\n } finally {\n loading.value = false;\n }\n};\n\nwatch(() => props.url, load, { immediate: true });\nonBeforeUnmount(() => { revokeCurrent(); });\n\nconst totalStats = computed<ZipToolbarStats | null>(() => {\n if (!tree.value) return null;\n let files = 0, dirs = 0, size = 0;\n const walk = (n: ZipTreeNode) => {\n if (n.isDir) { if (n.path) dirs++; n.children?.forEach(walk); }\n else { files++; size += n.size; }\n };\n walk(tree.value);\n return { files, dirs, size };\n});\n\nwatch(totalStats, (s) => emit('statsChange', s), { immediate: true });\nonBeforeUnmount(() => emit('statsChange', null));\n\nconst handleToggle = (path: string) => {\n const next = new Set(expanded.value);\n if (next.has(path)) next.delete(path);\n else next.add(path);\n expanded.value = next;\n};\n\nconst handleHover = (text: string, rect: DOMRect) => {\n hoverTip.value = { text, x: rect.right + 8, y: rect.top + rect.height / 2 };\n};\nconst handleLeave = () => { hoverTip.value = null; };\n\nconst handleSelect = async (node: ZipTreeNode) => {\n if (!zip.value || node.isDir) return;\n revokeCurrent();\n previewLoading.value = true;\n previewError.value = null;\n\n try {\n const mime = inferMimeType(node.name);\n const blob = await readZipEntryBlob(zip.value, node.path, mime !== 'application/octet-stream' ? mime : undefined);\n const blobUrl = URL.createObjectURL(blob);\n selected.value = { path: node.path, name: node.name, size: node.size, blobUrl };\n } catch (err) {\n console.error(err);\n previewError.value = '条目读取失败';\n } finally {\n previewLoading.value = false;\n }\n};\n\n/** 为嵌入的 FilePreviewContent 构建 files 数组 */\nconst previewFiles = computed(() => {\n if (!selected.value) return [];\n return [{ name: selected.value.name, url: selected.value.blobUrl, type: inferMimeType(selected.value.name) }];\n});\n</script>\n\n<template>\n <div v-if=\"loading\" class=\"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full\">\n <div class=\"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin\" />\n </div>\n\n <div v-else-if=\"error || !tree\" class=\"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full\">\n <div class=\"vfp-text-fg-secondary vfp-text-center\"><p class=\"vfp-text-lg\">{{ error || t('zip.parse_failed') }}</p></div>\n </div>\n\n <template v-else>\n <ResizableSplit\n :initial-left-width=\"280\"\n :min-left-width=\"180\"\n :max-left-width=\"560\"\n storage-key=\"vfp-zip-split-left\"\n >\n <template #left>\n <div class=\"vfp-w-full vfp-h-full vfp-overflow-auto\">\n <TreeItem\n v-for=\"child in tree.children || []\"\n :key=\"child.path\"\n :node=\"child\"\n :depth=\"0\"\n :selected-path=\"selected?.path ?? null\"\n :expanded=\"expanded\"\n @toggle=\"handleToggle\"\n @select=\"handleSelect\"\n @hover=\"handleHover\"\n @leave=\"handleLeave\"\n />\n </div>\n </template>\n\n <template #right>\n <div class=\"vfp-w-full vfp-h-full vfp-flex vfp-flex-col\">\n <div v-if=\"!selected\" class=\"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-fg-muted vfp-text-sm vfp-p-6\">\n 从左侧选择一个文件以预览\n </div>\n <div v-else-if=\"previewLoading\" class=\"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center\">\n <div class=\"vfp-w-8 vfp-h-8 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin\" />\n </div>\n <div v-else-if=\"previewError\" class=\"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-fg-secondary\">{{ previewError }}</div>\n <template v-else>\n <div class=\"vfp-flex-1 vfp-min-h-0 vfp-overflow-hidden vfp-flex vfp-relative vfp-z-0\">\n <LazyFilePreviewContent\n mode=\"embed\"\n :files=\"previewFiles\"\n :current-index=\"0\"\n :zip-nesting-depth=\"nestingDepth + 1\"\n />\n </div>\n </template>\n </div>\n </template>\n </ResizableSplit>\n\n <!-- 文件名 hover tooltip (teleport 到 body 避免被滚动区裁剪) -->\n <Teleport to=\"body\">\n <div\n v-if=\"hoverTip\"\n class=\"vfp-zip-tip\"\n :style=\"{ left: hoverTip.x + 'px', top: hoverTip.y + 'px' }\"\n >\n {{ hoverTip.text }}\n </div>\n </Teleport>\n </template>\n</template>\n\n<style>\n/* 全局 tooltip(不能 scoped,因 Teleport 到 body) */\n.vfp-zip-tip {\n position: fixed;\n z-index: 9999;\n pointer-events: none;\n transform: translateY(-50%);\n padding: 4px 8px;\n background: rgba(0, 0, 0, 0.85);\n color: #fff;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 4px;\n white-space: nowrap;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n}\n</style>\n"],"names":["props","__props","containerRef","ref","leftWidth","saved","dragging","isDesktop","mq","mqHandler","leftStyle","computed","onMove","e","rect","x","cap","effectiveMax","onUp","onDividerDown","onMounted","onBeforeUnmount","watch","w","_createElementBlock","_createElementVNode","_renderSlot","_ctx","_normalizeClass","_hoisted_1","__default__","emit","__emit","padStyle","isOpen","isSelected","fileIcon","ft","getFileType","FileImage","FileText","FileCode","FileIcon","handleEnter","handleLeave","_cache","$event","_createVNode","_unref","ChevronRight","_createBlock","_resolveDynamicComponent","FolderOpen","Folder","_hoisted_2","_toDisplayString","_openBlock","_Fragment","_renderList","child","_component_ZipTreeItem","p","n","t","r","_hoisted_3","_hoisted_4","LazyFilePreviewContent","defineAsyncComponent","useTranslator","fetcher","useFetcher","zip","tree","loading","error","expanded","selected","previewLoading","previewError","hoverTip","revokeCurrent","_a","res","buf","z","loadZip","entries","listZipEntries","root","buildZipTree","init","c","err","totalStats","files","dirs","size","walk","s","handleToggle","path","next","handleHover","text","handleSelect","node","mime","inferMimeType","blob","readZipEntryBlob","blobUrl","previewFiles","ResizableSplit","_hoisted_5","TreeItem","_hoisted_6","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_7","_Teleport"],"mappings":";;;;;;;;;;;;;;;AAkBA,UAAMA,IAAQC,GAURC,IAAeC,EAA2B,IAAI,GAC9CC,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AA,cAAA;wBAbtCuB,EAEM,OAFNgG,IAA4H,gBAE5H;AAAA;;;;YAoBNtE,EAQWuE,IAAA,EARD,IAAG,UAAM;AAAA,QAETzC,EAAA,cADRxD,EAMM,OAAA;AAAA;UAJJ,OAAM;AAAA,UACL,iBAAewD,EAAA,MAAS,IAAC,MAAA,KAAcA,EAAA,MAAS,IAAC,MAAA;AAAA,QAAA,GAE/CzB,EAAAyB,EAAA,MAAS,IAAI,GAAA,CAAA;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as p, watch as z, onUnmounted as D, defineComponent as U, toRef as O, computed as $, onMounted as q, onBeforeUnmount as H, unref as t, openBlock as b, createElementBlock as I, createElementVNode as a, toDisplayString as G, normalizeStyle as M, createStaticVNode as W, normalizeClass as A, createVNode as C, createBlock as R, resolveDynamicComponent as X, Transition as J, withCtx as K, createCommentVNode as Q } from "vue";
|
|
2
2
|
import { VolumeX as Y, Volume1 as Z, Volume2 as ee, Repeat as te, SkipBack as ae, Pause as re, Play as ne, SkipForward as oe } from "lucide-vue-next";
|
|
3
|
-
import {
|
|
3
|
+
import { g as se, u as le, _ as ie } from "./index-BuYJGBLT.mjs";
|
|
4
4
|
function pe(x) {
|
|
5
5
|
const f = p(null), m = p(!1), o = p(!0), h = p(0), d = p(0), y = p(1), u = p(!1), v = p(!1), c = p(null);
|
|
6
6
|
let l = null;
|
|
@@ -388,4 +388,4 @@ const fe = {
|
|
|
388
388
|
export {
|
|
389
389
|
ze as default
|
|
390
390
|
};
|
|
391
|
-
//# sourceMappingURL=index-
|
|
391
|
+
//# sourceMappingURL=index-BY_XuO1z.mjs.map
|