@l1yp/file-viewer 0.1.0 → 0.1.1
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 +1 -0
- package/dist/components/DocxNavigationPane.js +7 -0
- package/dist/components/DocxNavigationPane.vue.d.ts +23 -0
- package/dist/components/DocxNavigationPane.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/DocxViewer.js +1 -1
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +70 -37
- package/dist/components/FileViewerBody.js +1 -1
- package/dist/components/FileViewerBody.vue.d.ts +5 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +248 -247
- package/dist/components/PptxNavigationPane.js +7 -0
- package/dist/components/PptxNavigationPane.vue.d.ts +20 -0
- package/dist/components/PptxNavigationPane.vue_vue_type_script_setup_true_lang.js +118 -0
- package/dist/components/PptxViewer.js +1 -1
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +64 -38
- package/dist/components/XlsxViewer.js +1 -1
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +299 -304
- package/dist/components/ZipBrowser.js +1 -1
- package/dist/components/ZipBrowser.vue.d.ts +3 -1
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +152 -122
- package/dist/composables/useElementNavigation.d.ts +21 -0
- package/dist/composables/useElementNavigation.js +61 -0
- package/dist/lib/archiveHtml.d.ts +49 -0
- package/dist/lib/archiveHtml.js +375 -0
- package/dist/lib/docxNavigation.d.ts +31 -0
- package/dist/lib/docxNavigation.js +63 -0
- package/dist/lib/pptxNavigation.d.ts +7 -0
- package/dist/lib/pptxNavigation.js +27 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -30,40 +30,40 @@ var ue = { class: "fvb" }, de = {
|
|
|
30
30
|
}, ve = ["href", "download"], ye = { class: "fvb__openas" }, be = { class: "fvb__openas-grid" }, xe = ["onClick"], Se = {
|
|
31
31
|
key: 38,
|
|
32
32
|
class: "fvb__msg"
|
|
33
|
-
},
|
|
33
|
+
}, Ce = {
|
|
34
34
|
key: 39,
|
|
35
35
|
class: "fvb__msg fvb__msg--error"
|
|
36
|
-
},
|
|
36
|
+
}, S = {
|
|
37
37
|
key: 40,
|
|
38
38
|
class: "fvb__scroll fvb__scroll--doc"
|
|
39
|
-
},
|
|
39
|
+
}, C = { class: "fvb__markdown" }, w = {
|
|
40
40
|
key: 41,
|
|
41
41
|
class: "fvb__html"
|
|
42
|
-
},
|
|
42
|
+
}, T = { class: "fvb__htmlbar" }, E = ["title"], D = ["src", "sandbox"], O = {
|
|
43
43
|
key: 0,
|
|
44
44
|
class: "fvb__fs"
|
|
45
|
-
},
|
|
45
|
+
}, k = { class: "fvb__fsbar" }, A = ["title"], we = ["src", "sandbox"], Te = {
|
|
46
46
|
key: 42,
|
|
47
47
|
class: "fvb__svg"
|
|
48
|
-
},
|
|
48
|
+
}, Ee = ["src", "alt"], De = {
|
|
49
49
|
key: 43,
|
|
50
50
|
class: "fvb__fill"
|
|
51
|
-
},
|
|
51
|
+
}, Oe = {
|
|
52
52
|
key: 44,
|
|
53
53
|
class: "fvb__fill"
|
|
54
|
-
},
|
|
54
|
+
}, ke = {
|
|
55
55
|
key: 45,
|
|
56
56
|
class: "fvb__fill"
|
|
57
|
-
},
|
|
57
|
+
}, Ae = {
|
|
58
58
|
key: 46,
|
|
59
59
|
class: "fvb__fill"
|
|
60
|
-
},
|
|
60
|
+
}, je = {
|
|
61
61
|
key: 47,
|
|
62
62
|
class: "fvb__fill"
|
|
63
|
-
},
|
|
63
|
+
}, Me = {
|
|
64
64
|
key: 48,
|
|
65
65
|
class: "fvb__fill"
|
|
66
|
-
},
|
|
66
|
+
}, Ne = "<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'\">", Pe = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'unsafe-inline' 'unsafe-eval' data: blob: https: http:; connect-src data: blob: https: http: ws: wss:; object-src 'none'; base-uri 'none'\">", j = /*@__PURE__*/ m({
|
|
67
67
|
__name: "FileViewerBody",
|
|
68
68
|
props: {
|
|
69
69
|
file: {},
|
|
@@ -71,31 +71,32 @@ var ue = { class: "fvb" }, de = {
|
|
|
71
71
|
hostChooser: {
|
|
72
72
|
type: Boolean,
|
|
73
73
|
default: !1
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
htmlPreview: {}
|
|
75
76
|
},
|
|
76
77
|
emits: [
|
|
77
78
|
"loaded",
|
|
78
79
|
"formatchange",
|
|
79
80
|
"formatpick"
|
|
80
81
|
],
|
|
81
|
-
setup(m, { expose:
|
|
82
|
-
let
|
|
83
|
-
function
|
|
84
|
-
|
|
82
|
+
setup(m, { expose: j, emit: Fe }) {
|
|
83
|
+
let M = m, N = Fe, Ie = p(() => import("./ZipBrowser.js")), Le = p(() => import("./SevenZipBrowser.js")), Re = p(() => import("./ArchiveBrowser.js")), ze = p(() => import("./BinObjBrowser.js")), Be = p(() => import("./EplViewer.js")), Ve = p(() => import("./ClassViewer.js")), He = p(() => import("./HprofViewer.js")), Ue = p(() => import("./MsiViewer.js")), We = p(() => import("./AppxViewer.js")), Ge = r(() => import("./DicomViewer.js"), "dicom-parser", "DICOM 影像"), Ke = r(() => import("./DocxViewer.js"), "docx-preview", "Word 文档"), qe = r(() => import("./XlsxViewer.js"), ["exceljs", "numfmt"], "Excel 表格"), Je = r(() => import("./PptxViewer.js"), ["@aiden0z/pptx-renderer", "pdfjs-dist"], "PowerPoint"), Ye = p(() => import("./RtfViewer.js")), Xe = r(() => import("./PdfViewer.js"), "pdfjs-dist", "PDF"), Ze = p(() => import("./MindMapView.js")), Qe = p(() => import("./XmindViewer.js")), $e = p(() => import("./EmlViewer.js")), P = p(() => import("./MhtViewer.js")), et = p(() => import("./HarViewer.js")), tt = r(() => import("./SqliteViewer.js"), "sql.js", "SQLite 数据库"), nt = p(() => import("./SubtitleViewer.js")), rt = p(() => import("./FontViewer.js")), it = p(() => import("./NotebookViewer.js")), at = p(() => import("./GeoViewer.js")), ot = p(() => import("./CsvViewer.js")), st = p(() => import("./JsonlViewer.js")), ct = p(() => import("./CertViewer.js")), lt = p(() => import("./JksViewer.js")), ut = p(() => import("./AudioViewer.js")), dt = p(() => import("./QmcAudioViewer.js")), ft = p(() => import("./LrcViewer.js")), pt = p(() => import("./LogViewer.js")), mt = r(() => import("./ModelViewer.js"), "three", "3D 模型"), ht = p(() => import("./RasterViewer.js")), gt = p(() => import("./PsdViewer.js")), _t = p(() => import("./EbookViewer.js")), vt = p(() => import("./DrawioViewer.js")), yt = p(() => import("./DxfViewer.js")), bt = p(() => import("./HexViewer.js")), F = _(""), I = _(null), L = s(() => I.value ?? M.file);
|
|
84
|
+
function R(e) {
|
|
85
|
+
F.value = e.key, I.value = ee(M.file, e);
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function xt(e) {
|
|
87
88
|
let t = te(e);
|
|
88
|
-
t &&
|
|
89
|
+
t && R(t);
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
91
|
+
function St() {
|
|
92
|
+
F.value = "", I.value = null;
|
|
92
93
|
}
|
|
93
|
-
x(
|
|
94
|
-
let
|
|
94
|
+
x(F, (e) => N("formatpick", e));
|
|
95
|
+
let z = _("loading"), B = _(""), V = _(""), Ct = s(() => L.value.mindmap === !0 && z.value === "ready" && t(B.value, e(L.value.name))), H = s(() => L.value.lang === "markdown" ? ne(B.value) : {
|
|
95
96
|
data: {},
|
|
96
|
-
body:
|
|
97
|
-
}),
|
|
98
|
-
function
|
|
97
|
+
body: B.value
|
|
98
|
+
}), wt = s(() => Object.keys(H.value.data).length > 0), Tt = s(() => B.value.replace(/\n$/, "")), Et = s(() => B.value ? `data:image/svg+xml,${encodeURIComponent(B.value)}` : "");
|
|
99
|
+
function U(e, t) {
|
|
99
100
|
let n = e.match(/<head[^>]*>/i);
|
|
100
101
|
if (n) {
|
|
101
102
|
let r = (n.index ?? 0) + n[0].length;
|
|
@@ -103,491 +104,491 @@ var ue = { class: "fvb" }, de = {
|
|
|
103
104
|
}
|
|
104
105
|
return `<!doctype html><html><head><meta charset="utf-8">${t}</head><body>${e}</body></html>`;
|
|
105
106
|
}
|
|
106
|
-
let
|
|
107
|
+
let W = _(""), G = _(""), K = _(!1), q = _(!1), J = s(() => K.value ? G.value : W.value), Y = s(() => M.htmlPreview ?? B.value);
|
|
107
108
|
function X() {
|
|
108
|
-
|
|
109
|
+
W.value &&= (URL.revokeObjectURL(W.value), ""), G.value &&= (URL.revokeObjectURL(G.value), "");
|
|
109
110
|
}
|
|
110
|
-
x([() =>
|
|
111
|
-
X(),
|
|
111
|
+
x([() => L.value.html, Y], ([e, t]) => {
|
|
112
|
+
X(), K.value = !1, q.value = !1, e && typeof URL < "u" && URL.createObjectURL && (W.value = URL.createObjectURL(new Blob([U(t, Ne)], { type: "text/html" })));
|
|
112
113
|
});
|
|
113
114
|
function Z() {
|
|
114
|
-
if (
|
|
115
|
-
|
|
115
|
+
if (K.value) {
|
|
116
|
+
K.value = !1;
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
|
-
typeof URL < "u" && URL.createObjectURL && !
|
|
119
|
+
typeof URL < "u" && URL.createObjectURL && !G.value && (G.value = URL.createObjectURL(new Blob([U(Y.value, Pe)], { type: "text/html" }))), K.value = !0;
|
|
119
120
|
}
|
|
120
121
|
function Q(e) {
|
|
121
|
-
e.key === "Escape" && (
|
|
122
|
+
e.key === "Escape" && (q.value = !1);
|
|
122
123
|
}
|
|
123
|
-
x(
|
|
124
|
+
x(q, (e) => {
|
|
124
125
|
typeof window > "u" || (e ? (window.addEventListener("keydown", Q), document.body.style.overflow = "hidden") : (window.removeEventListener("keydown", Q), document.body.style.overflow = ""));
|
|
125
126
|
});
|
|
126
127
|
async function $(e = !1) {
|
|
127
|
-
let t =
|
|
128
|
+
let t = L.value;
|
|
128
129
|
if (n(t)) {
|
|
129
|
-
|
|
130
|
+
B.value = "", z.value = "ready";
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
133
|
if (t.content != null) {
|
|
133
|
-
|
|
134
|
+
B.value = t.content, z.value = "ready", N("loaded", t.content);
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
137
|
if (!t.url) {
|
|
137
|
-
|
|
138
|
+
B.value = "", z.value = "ready";
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
z.value = "loading", V.value = "";
|
|
141
142
|
try {
|
|
142
143
|
let n = await fetch(t.url, e ? { cache: "no-store" } : {});
|
|
143
144
|
if (!n.ok) throw Error(`HTTP ${n.status}`);
|
|
144
145
|
let r = await n.text();
|
|
145
|
-
|
|
146
|
+
B.value = r, z.value = "ready", N("loaded", r);
|
|
146
147
|
} catch (e) {
|
|
147
|
-
|
|
148
|
+
V.value = String(e), z.value = "error";
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
|
-
return x(() =>
|
|
151
|
-
|
|
152
|
-
}), x(
|
|
153
|
-
|
|
151
|
+
return x(() => M.file, () => {
|
|
152
|
+
I.value = null, F.value = "";
|
|
153
|
+
}), x(L, (e) => {
|
|
154
|
+
N("formatchange", e), $();
|
|
154
155
|
}, { immediate: !0 }), le(() => {
|
|
155
156
|
X(), typeof window < "u" && (window.removeEventListener("keydown", Q), document.body.style.overflow = "");
|
|
156
|
-
}),
|
|
157
|
+
}), j({
|
|
157
158
|
reload: () => $(!0),
|
|
158
|
-
pickFormat:
|
|
159
|
-
resetFormat:
|
|
160
|
-
}), (e, t) => (g(), u("div", ue, [
|
|
159
|
+
pickFormat: xt,
|
|
160
|
+
resetFormat: St
|
|
161
|
+
}), (e, t) => (g(), u("div", ue, [I.value && !m.hostChooser ? (g(), u("div", de, [t[3] ||= d("span", { class: "fvb__fmtbar-label" }, "格式", -1), (g(!0), u(o, null, v(b(i), (e) => (g(), u("button", {
|
|
161
162
|
key: e.key,
|
|
162
163
|
type: "button",
|
|
163
|
-
class: h(["fvb__fmtchip", { "fvb__fmtchip--on":
|
|
164
|
-
onClick: (t) =>
|
|
164
|
+
class: h(["fvb__fmtchip", { "fvb__fmtchip--on": F.value === e.key }]),
|
|
165
|
+
onClick: (t) => R(e)
|
|
165
166
|
}, [f(a, {
|
|
166
167
|
name: e.icon,
|
|
167
168
|
size: 13
|
|
168
|
-
}, null, 8, ["name"]), d("span", null, y(e.label), 1)], 10, fe))), 128))])) : l("", !0),
|
|
169
|
+
}, null, 8, ["name"]), d("span", null, y(e.label), 1)], 10, fe))), 128))])) : l("", !0), L.value.zip ? (g(), c(b(Ie), {
|
|
169
170
|
key: 1,
|
|
170
|
-
url:
|
|
171
|
-
name:
|
|
172
|
-
}, null, 8, ["url", "name"])) :
|
|
171
|
+
url: L.value.url ?? "",
|
|
172
|
+
name: L.value.name
|
|
173
|
+
}, null, 8, ["url", "name"])) : L.value.sevenZip ? (g(), c(b(Le), {
|
|
173
174
|
key: 2,
|
|
174
|
-
url:
|
|
175
|
-
name:
|
|
176
|
-
}, null, 8, ["url", "name"])) :
|
|
175
|
+
url: L.value.url ?? "",
|
|
176
|
+
name: L.value.name
|
|
177
|
+
}, null, 8, ["url", "name"])) : L.value.archive ? (g(), c(b(Re), {
|
|
177
178
|
key: 3,
|
|
178
|
-
url:
|
|
179
|
-
name:
|
|
180
|
-
kind:
|
|
179
|
+
url: L.value.url ?? "",
|
|
180
|
+
name: L.value.name,
|
|
181
|
+
kind: L.value.archive
|
|
181
182
|
}, null, 8, [
|
|
182
183
|
"url",
|
|
183
184
|
"name",
|
|
184
185
|
"kind"
|
|
185
|
-
])) :
|
|
186
|
+
])) : L.value.binobj ? (g(), c(b(ze), {
|
|
186
187
|
key: 4,
|
|
187
|
-
url:
|
|
188
|
-
name:
|
|
189
|
-
size:
|
|
188
|
+
url: L.value.url ?? "",
|
|
189
|
+
name: L.value.name,
|
|
190
|
+
size: L.value.size
|
|
190
191
|
}, null, 8, [
|
|
191
192
|
"url",
|
|
192
193
|
"name",
|
|
193
194
|
"size"
|
|
194
|
-
])) :
|
|
195
|
+
])) : L.value.epl ? (g(), c(b(Be), {
|
|
195
196
|
key: 5,
|
|
196
|
-
url:
|
|
197
|
-
name:
|
|
198
|
-
size:
|
|
197
|
+
url: L.value.url ?? "",
|
|
198
|
+
name: L.value.name,
|
|
199
|
+
size: L.value.size
|
|
199
200
|
}, null, 8, [
|
|
200
201
|
"url",
|
|
201
202
|
"name",
|
|
202
203
|
"size"
|
|
203
|
-
])) :
|
|
204
|
+
])) : L.value.javaClass ? (g(), c(b(Ve), {
|
|
204
205
|
key: 6,
|
|
205
|
-
url:
|
|
206
|
-
name:
|
|
207
|
-
size:
|
|
206
|
+
url: L.value.url ?? "",
|
|
207
|
+
name: L.value.name,
|
|
208
|
+
size: L.value.size
|
|
208
209
|
}, null, 8, [
|
|
209
210
|
"url",
|
|
210
211
|
"name",
|
|
211
212
|
"size"
|
|
212
|
-
])) :
|
|
213
|
+
])) : L.value.hprof ? (g(), c(b(He), {
|
|
213
214
|
key: 7,
|
|
214
|
-
url:
|
|
215
|
-
name:
|
|
216
|
-
size:
|
|
215
|
+
url: L.value.url ?? "",
|
|
216
|
+
name: L.value.name,
|
|
217
|
+
size: L.value.size
|
|
217
218
|
}, null, 8, [
|
|
218
219
|
"url",
|
|
219
220
|
"name",
|
|
220
221
|
"size"
|
|
221
|
-
])) :
|
|
222
|
+
])) : L.value.msi ? (g(), c(b(Ue), {
|
|
222
223
|
key: 8,
|
|
223
|
-
url:
|
|
224
|
-
name:
|
|
225
|
-
size:
|
|
224
|
+
url: L.value.url ?? "",
|
|
225
|
+
name: L.value.name,
|
|
226
|
+
size: L.value.size
|
|
226
227
|
}, null, 8, [
|
|
227
228
|
"url",
|
|
228
229
|
"name",
|
|
229
230
|
"size"
|
|
230
|
-
])) :
|
|
231
|
+
])) : L.value.appx ? (g(), c(b(We), {
|
|
231
232
|
key: 9,
|
|
232
|
-
url:
|
|
233
|
-
name:
|
|
234
|
-
size:
|
|
233
|
+
url: L.value.url ?? "",
|
|
234
|
+
name: L.value.name,
|
|
235
|
+
size: L.value.size
|
|
235
236
|
}, null, 8, [
|
|
236
237
|
"url",
|
|
237
238
|
"name",
|
|
238
239
|
"size"
|
|
239
|
-
])) :
|
|
240
|
+
])) : L.value.xmind ? (g(), c(b(Qe), {
|
|
240
241
|
key: 10,
|
|
241
|
-
url:
|
|
242
|
-
name:
|
|
243
|
-
size:
|
|
242
|
+
url: L.value.url ?? "",
|
|
243
|
+
name: L.value.name,
|
|
244
|
+
size: L.value.size
|
|
244
245
|
}, null, 8, [
|
|
245
246
|
"url",
|
|
246
247
|
"name",
|
|
247
248
|
"size"
|
|
248
|
-
])) :
|
|
249
|
+
])) : L.value.dxf ? (g(), c(b(yt), {
|
|
249
250
|
key: 11,
|
|
250
|
-
url:
|
|
251
|
-
name:
|
|
252
|
-
size:
|
|
251
|
+
url: L.value.url ?? "",
|
|
252
|
+
name: L.value.name,
|
|
253
|
+
size: L.value.size
|
|
253
254
|
}, null, 8, [
|
|
254
255
|
"url",
|
|
255
256
|
"name",
|
|
256
257
|
"size"
|
|
257
|
-
])) :
|
|
258
|
+
])) : L.value.dicom ? (g(), c(b(Ge), {
|
|
258
259
|
key: 12,
|
|
259
|
-
url:
|
|
260
|
-
name:
|
|
261
|
-
size:
|
|
260
|
+
url: L.value.url ?? "",
|
|
261
|
+
name: L.value.name,
|
|
262
|
+
size: L.value.size
|
|
262
263
|
}, null, 8, [
|
|
263
264
|
"url",
|
|
264
265
|
"name",
|
|
265
266
|
"size"
|
|
266
|
-
])) :
|
|
267
|
+
])) : L.value.docx ? (g(), c(b(Ke), {
|
|
267
268
|
key: 13,
|
|
268
|
-
url:
|
|
269
|
-
name:
|
|
270
|
-
size:
|
|
269
|
+
url: L.value.url ?? "",
|
|
270
|
+
name: L.value.name,
|
|
271
|
+
size: L.value.size
|
|
271
272
|
}, null, 8, [
|
|
272
273
|
"url",
|
|
273
274
|
"name",
|
|
274
275
|
"size"
|
|
275
|
-
])) :
|
|
276
|
+
])) : L.value.xlsx ? (g(), c(b(qe), {
|
|
276
277
|
key: 14,
|
|
277
|
-
url:
|
|
278
|
-
name:
|
|
279
|
-
size:
|
|
278
|
+
url: L.value.url ?? "",
|
|
279
|
+
name: L.value.name,
|
|
280
|
+
size: L.value.size
|
|
280
281
|
}, null, 8, [
|
|
281
282
|
"url",
|
|
282
283
|
"name",
|
|
283
284
|
"size"
|
|
284
|
-
])) :
|
|
285
|
+
])) : L.value.pptx ? (g(), c(b(Je), {
|
|
285
286
|
key: 15,
|
|
286
|
-
url:
|
|
287
|
-
name:
|
|
288
|
-
size:
|
|
287
|
+
url: L.value.url ?? "",
|
|
288
|
+
name: L.value.name,
|
|
289
|
+
size: L.value.size
|
|
289
290
|
}, null, 8, [
|
|
290
291
|
"url",
|
|
291
292
|
"name",
|
|
292
293
|
"size"
|
|
293
|
-
])) :
|
|
294
|
+
])) : L.value.rtf ? (g(), c(b(Ye), {
|
|
294
295
|
key: 16,
|
|
295
|
-
url:
|
|
296
|
-
name:
|
|
297
|
-
size:
|
|
296
|
+
url: L.value.url ?? "",
|
|
297
|
+
name: L.value.name,
|
|
298
|
+
size: L.value.size
|
|
298
299
|
}, null, 8, [
|
|
299
300
|
"url",
|
|
300
301
|
"name",
|
|
301
302
|
"size"
|
|
302
|
-
])) :
|
|
303
|
+
])) : L.value.pdf ? (g(), c(b(Xe), {
|
|
303
304
|
key: 17,
|
|
304
|
-
url:
|
|
305
|
-
name:
|
|
306
|
-
size:
|
|
305
|
+
url: L.value.url ?? "",
|
|
306
|
+
name: L.value.name,
|
|
307
|
+
size: L.value.size
|
|
307
308
|
}, null, 8, [
|
|
308
309
|
"url",
|
|
309
310
|
"name",
|
|
310
311
|
"size"
|
|
311
|
-
])) :
|
|
312
|
+
])) : L.value.eml ? (g(), c(b($e), {
|
|
312
313
|
key: 18,
|
|
313
|
-
url:
|
|
314
|
-
name:
|
|
315
|
-
size:
|
|
314
|
+
url: L.value.url ?? "",
|
|
315
|
+
name: L.value.name,
|
|
316
|
+
size: L.value.size
|
|
316
317
|
}, null, 8, [
|
|
317
318
|
"url",
|
|
318
319
|
"name",
|
|
319
320
|
"size"
|
|
320
|
-
])) :
|
|
321
|
+
])) : L.value.mht ? (g(), c(b(P), {
|
|
321
322
|
key: 19,
|
|
322
|
-
url:
|
|
323
|
-
name:
|
|
324
|
-
size:
|
|
323
|
+
url: L.value.url ?? "",
|
|
324
|
+
name: L.value.name,
|
|
325
|
+
size: L.value.size
|
|
325
326
|
}, null, 8, [
|
|
326
327
|
"url",
|
|
327
328
|
"name",
|
|
328
329
|
"size"
|
|
329
|
-
])) :
|
|
330
|
+
])) : L.value.har ? (g(), c(b(et), {
|
|
330
331
|
key: 20,
|
|
331
|
-
url:
|
|
332
|
-
name:
|
|
333
|
-
size:
|
|
332
|
+
url: L.value.url ?? "",
|
|
333
|
+
name: L.value.name,
|
|
334
|
+
size: L.value.size
|
|
334
335
|
}, null, 8, [
|
|
335
336
|
"url",
|
|
336
337
|
"name",
|
|
337
338
|
"size"
|
|
338
|
-
])) :
|
|
339
|
+
])) : L.value.sqlite ? (g(), c(b(tt), {
|
|
339
340
|
key: 21,
|
|
340
|
-
url:
|
|
341
|
-
name:
|
|
342
|
-
size:
|
|
341
|
+
url: L.value.url ?? "",
|
|
342
|
+
name: L.value.name,
|
|
343
|
+
size: L.value.size
|
|
343
344
|
}, null, 8, [
|
|
344
345
|
"url",
|
|
345
346
|
"name",
|
|
346
347
|
"size"
|
|
347
|
-
])) :
|
|
348
|
+
])) : L.value.cert ? (g(), c(b(ct), {
|
|
348
349
|
key: 22,
|
|
349
|
-
url:
|
|
350
|
-
name:
|
|
351
|
-
size:
|
|
350
|
+
url: L.value.url ?? "",
|
|
351
|
+
name: L.value.name,
|
|
352
|
+
size: L.value.size
|
|
352
353
|
}, null, 8, [
|
|
353
354
|
"url",
|
|
354
355
|
"name",
|
|
355
356
|
"size"
|
|
356
|
-
])) :
|
|
357
|
+
])) : L.value.jks ? (g(), c(b(lt), {
|
|
357
358
|
key: 23,
|
|
358
|
-
url:
|
|
359
|
-
name:
|
|
360
|
-
size:
|
|
359
|
+
url: L.value.url ?? "",
|
|
360
|
+
name: L.value.name,
|
|
361
|
+
size: L.value.size
|
|
361
362
|
}, null, 8, [
|
|
362
363
|
"url",
|
|
363
364
|
"name",
|
|
364
365
|
"size"
|
|
365
|
-
])) :
|
|
366
|
+
])) : L.value.font ? (g(), c(b(rt), {
|
|
366
367
|
key: 24,
|
|
367
|
-
url:
|
|
368
|
-
name:
|
|
369
|
-
size:
|
|
368
|
+
url: L.value.url ?? "",
|
|
369
|
+
name: L.value.name,
|
|
370
|
+
size: L.value.size
|
|
370
371
|
}, null, 8, [
|
|
371
372
|
"url",
|
|
372
373
|
"name",
|
|
373
374
|
"size"
|
|
374
|
-
])) :
|
|
375
|
+
])) : L.value.ipynb ? (g(), c(b(it), {
|
|
375
376
|
key: 25,
|
|
376
|
-
url:
|
|
377
|
-
name:
|
|
378
|
-
size:
|
|
377
|
+
url: L.value.url ?? "",
|
|
378
|
+
name: L.value.name,
|
|
379
|
+
size: L.value.size
|
|
379
380
|
}, null, 8, [
|
|
380
381
|
"url",
|
|
381
382
|
"name",
|
|
382
383
|
"size"
|
|
383
|
-
])) :
|
|
384
|
+
])) : L.value.audio ? (g(), c(b(ut), {
|
|
384
385
|
key: 26,
|
|
385
|
-
url:
|
|
386
|
-
name:
|
|
387
|
-
size:
|
|
386
|
+
url: L.value.url ?? "",
|
|
387
|
+
name: L.value.name,
|
|
388
|
+
size: L.value.size
|
|
388
389
|
}, null, 8, [
|
|
389
390
|
"url",
|
|
390
391
|
"name",
|
|
391
392
|
"size"
|
|
392
|
-
])) :
|
|
393
|
+
])) : L.value.qmc ? (g(), c(b(dt), {
|
|
393
394
|
key: 27,
|
|
394
|
-
url:
|
|
395
|
-
name:
|
|
396
|
-
size:
|
|
395
|
+
url: L.value.url ?? "",
|
|
396
|
+
name: L.value.name,
|
|
397
|
+
size: L.value.size
|
|
397
398
|
}, null, 8, [
|
|
398
399
|
"url",
|
|
399
400
|
"name",
|
|
400
401
|
"size"
|
|
401
|
-
])) :
|
|
402
|
+
])) : L.value.lrc ? (g(), c(b(ft), {
|
|
402
403
|
key: 28,
|
|
403
|
-
url:
|
|
404
|
-
name:
|
|
405
|
-
size:
|
|
404
|
+
url: L.value.url ?? "",
|
|
405
|
+
name: L.value.name,
|
|
406
|
+
size: L.value.size
|
|
406
407
|
}, null, 8, [
|
|
407
408
|
"url",
|
|
408
409
|
"name",
|
|
409
410
|
"size"
|
|
410
|
-
])) :
|
|
411
|
+
])) : L.value.log ? (g(), c(b(pt), {
|
|
411
412
|
key: 29,
|
|
412
|
-
url:
|
|
413
|
-
name:
|
|
414
|
-
size:
|
|
413
|
+
url: L.value.url ?? "",
|
|
414
|
+
name: L.value.name,
|
|
415
|
+
size: L.value.size
|
|
415
416
|
}, null, 8, [
|
|
416
417
|
"url",
|
|
417
418
|
"name",
|
|
418
419
|
"size"
|
|
419
|
-
])) :
|
|
420
|
+
])) : L.value.model ? (g(), c(b(mt), {
|
|
420
421
|
key: 30,
|
|
421
|
-
url:
|
|
422
|
-
name:
|
|
423
|
-
size:
|
|
422
|
+
url: L.value.url ?? "",
|
|
423
|
+
name: L.value.name,
|
|
424
|
+
size: L.value.size
|
|
424
425
|
}, null, 8, [
|
|
425
426
|
"url",
|
|
426
427
|
"name",
|
|
427
428
|
"size"
|
|
428
|
-
])) :
|
|
429
|
+
])) : L.value.raster === "psd" ? (g(), c(b(gt), {
|
|
429
430
|
key: 31,
|
|
430
|
-
url:
|
|
431
|
-
name:
|
|
432
|
-
size:
|
|
431
|
+
url: L.value.url ?? "",
|
|
432
|
+
name: L.value.name,
|
|
433
|
+
size: L.value.size
|
|
433
434
|
}, null, 8, [
|
|
434
435
|
"url",
|
|
435
436
|
"name",
|
|
436
437
|
"size"
|
|
437
|
-
])) :
|
|
438
|
+
])) : L.value.raster ? (g(), c(b(ht), {
|
|
438
439
|
key: 32,
|
|
439
|
-
url:
|
|
440
|
-
name:
|
|
441
|
-
size:
|
|
442
|
-
kind:
|
|
440
|
+
url: L.value.url ?? "",
|
|
441
|
+
name: L.value.name,
|
|
442
|
+
size: L.value.size,
|
|
443
|
+
kind: L.value.raster
|
|
443
444
|
}, null, 8, [
|
|
444
445
|
"url",
|
|
445
446
|
"name",
|
|
446
447
|
"size",
|
|
447
448
|
"kind"
|
|
448
|
-
])) :
|
|
449
|
+
])) : L.value.ebook ? (g(), c(b(_t), {
|
|
449
450
|
key: 33,
|
|
450
|
-
url:
|
|
451
|
-
name:
|
|
452
|
-
size:
|
|
453
|
-
kind:
|
|
451
|
+
url: L.value.url ?? "",
|
|
452
|
+
name: L.value.name,
|
|
453
|
+
size: L.value.size,
|
|
454
|
+
kind: L.value.ebook
|
|
454
455
|
}, null, 8, [
|
|
455
456
|
"url",
|
|
456
457
|
"name",
|
|
457
458
|
"size",
|
|
458
459
|
"kind"
|
|
459
|
-
])) :
|
|
460
|
+
])) : L.value.hex ? (g(), c(b(bt), {
|
|
460
461
|
key: 34,
|
|
461
|
-
url:
|
|
462
|
-
name:
|
|
463
|
-
size:
|
|
462
|
+
url: L.value.url ?? "",
|
|
463
|
+
name: L.value.name,
|
|
464
|
+
size: L.value.size
|
|
464
465
|
}, null, 8, [
|
|
465
466
|
"url",
|
|
466
467
|
"name",
|
|
467
468
|
"size"
|
|
468
|
-
])) :
|
|
469
|
-
src:
|
|
470
|
-
alt:
|
|
471
|
-
}, null, 8, ["src", "alt"])])) :
|
|
469
|
+
])) : L.value.image ? (g(), u("div", pe, [f(se, {
|
|
470
|
+
src: L.value.url ?? "",
|
|
471
|
+
alt: L.value.name
|
|
472
|
+
}, null, 8, ["src", "alt"])])) : L.value.video ? (g(), u("div", me, [d("video", {
|
|
472
473
|
class: "fvb__videoel",
|
|
473
|
-
src:
|
|
474
|
+
src: L.value.url ?? "",
|
|
474
475
|
controls: "",
|
|
475
476
|
preload: "metadata"
|
|
476
|
-
}, null, 8, he)])) :
|
|
477
|
+
}, null, 8, he)])) : L.value.binary ? (g(), u("div", ge, [
|
|
477
478
|
f(a, {
|
|
478
479
|
name: "archive",
|
|
479
480
|
size: 34
|
|
480
481
|
}),
|
|
481
482
|
t[5] ||= d("p", null, "无法预览的二进制文件", -1),
|
|
482
|
-
|
|
483
|
+
L.value.size ? (g(), u("p", _e, y(b(re)(L.value.size)), 1)) : l("", !0),
|
|
483
484
|
d("a", {
|
|
484
485
|
class: "fvb__dlbtn",
|
|
485
|
-
href:
|
|
486
|
-
download:
|
|
486
|
+
href: L.value.url,
|
|
487
|
+
download: L.value.name
|
|
487
488
|
}, "下载", 8, ve),
|
|
488
489
|
d("div", ye, [t[4] ||= d("span", { class: "fvb__openas-label" }, "用查看器打开:", -1), d("div", be, [(g(!0), u(o, null, v(b(i), (e) => (g(), u("button", {
|
|
489
490
|
key: e.key,
|
|
490
491
|
type: "button",
|
|
491
492
|
class: "fvb__fmtchip",
|
|
492
|
-
onClick: (t) =>
|
|
493
|
+
onClick: (t) => R(e)
|
|
493
494
|
}, [f(a, {
|
|
494
495
|
name: e.icon,
|
|
495
496
|
size: 13
|
|
496
497
|
}, null, 8, ["name"]), d("span", null, y(e.label), 1)], 8, xe))), 128))])])
|
|
497
|
-
])) :
|
|
498
|
+
])) : z.value === "loading" ? (g(), u("p", Se, "加载文件中…")) : z.value === "error" ? (g(), u("div", Ce, [d("p", null, "加载失败:" + y(V.value), 1), d("button", {
|
|
498
499
|
type: "button",
|
|
499
500
|
class: "fvb__retry",
|
|
500
501
|
onClick: t[0] ||= (e) => $(!0)
|
|
501
|
-
}, "重试")])) :
|
|
502
|
+
}, "重试")])) : L.value.lang === "markdown" && m.mode === "render" ? (g(), u("div", S, [d("div", C, [wt.value ? (g(), c(oe, {
|
|
502
503
|
key: 0,
|
|
503
|
-
data:
|
|
504
|
+
data: H.value.data
|
|
504
505
|
}, null, 8, ["data"])) : l("", !0), f(b(ae), {
|
|
505
|
-
text:
|
|
506
|
+
text: H.value.body,
|
|
506
507
|
kp: "fv"
|
|
507
|
-
}, null, 8, ["text"])])])) :
|
|
508
|
-
d("div",
|
|
508
|
+
}, null, 8, ["text"])])])) : L.value.html && m.mode === "render" ? (g(), u("div", w, [
|
|
509
|
+
d("div", T, [d("button", {
|
|
509
510
|
type: "button",
|
|
510
|
-
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on":
|
|
511
|
-
title:
|
|
511
|
+
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on": K.value }]),
|
|
512
|
+
title: K.value ? "交互脚本已启用(点击禁用)—— 隔离沙箱内运行:可加载外部 CDN 并发起网络请求(fetch/XHR/WebSocket),但无法访问本站会话 / cookie(不透明源隔离)" : "启用交互脚本(隔离沙箱执行:可加载 CDN、可联网,但无法访问本站会话 / cookie;建议先切到源码视图审查再启用)",
|
|
512
513
|
onClick: Z
|
|
513
514
|
}, [f(a, {
|
|
514
515
|
name: "play",
|
|
515
516
|
size: 13
|
|
516
|
-
})], 10,
|
|
517
|
+
})], 10, E), d("button", {
|
|
517
518
|
type: "button",
|
|
518
519
|
class: "fvb__htmlbtn",
|
|
519
520
|
title: "全屏预览(在应用内放大查看;可在全屏内开启交互脚本)",
|
|
520
|
-
onClick: t[1] ||= (e) =>
|
|
521
|
+
onClick: t[1] ||= (e) => q.value = !0
|
|
521
522
|
}, [f(a, {
|
|
522
523
|
name: "maximize",
|
|
523
524
|
size: 13
|
|
524
525
|
})])]),
|
|
525
526
|
(g(), u("iframe", {
|
|
526
|
-
key:
|
|
527
|
+
key: K.value ? "interactive" : "inert",
|
|
527
528
|
class: "fvb__frame",
|
|
528
|
-
src:
|
|
529
|
+
src: J.value,
|
|
529
530
|
title: "HTML 预览",
|
|
530
|
-
sandbox:
|
|
531
|
+
sandbox: K.value ? "allow-scripts" : "",
|
|
531
532
|
loading: "lazy",
|
|
532
533
|
referrerpolicy: "no-referrer"
|
|
533
|
-
}, null, 8,
|
|
534
|
-
(g(), c(ce, { to: "body" }, [
|
|
534
|
+
}, null, 8, D)),
|
|
535
|
+
(g(), c(ce, { to: "body" }, [q.value ? (g(), u("div", O, [d("div", k, [d("button", {
|
|
535
536
|
type: "button",
|
|
536
|
-
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on":
|
|
537
|
-
title:
|
|
537
|
+
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on": K.value }]),
|
|
538
|
+
title: K.value ? "交互脚本已启用(点击禁用)—— 隔离沙箱内运行,可联网但访问不到本站会话 / cookie" : "启用交互脚本(隔离沙箱执行:可加载 CDN、可联网,访问不到本站会话 / cookie)",
|
|
538
539
|
onClick: Z
|
|
539
540
|
}, [f(a, {
|
|
540
541
|
name: "play",
|
|
541
542
|
size: 15
|
|
542
|
-
})], 10,
|
|
543
|
+
})], 10, A), d("button", {
|
|
543
544
|
type: "button",
|
|
544
545
|
class: "fvb__htmlbtn",
|
|
545
546
|
title: "关闭全屏 (Esc)",
|
|
546
|
-
onClick: t[2] ||= (e) =>
|
|
547
|
+
onClick: t[2] ||= (e) => q.value = !1
|
|
547
548
|
}, [f(a, {
|
|
548
549
|
name: "close",
|
|
549
550
|
size: 15,
|
|
550
551
|
"stroke-width": 2.2
|
|
551
552
|
})])]), (g(), u("iframe", {
|
|
552
|
-
key:
|
|
553
|
+
key: K.value ? "fs-interactive" : "fs-inert",
|
|
553
554
|
class: "fvb__fsframe",
|
|
554
|
-
src:
|
|
555
|
+
src: J.value,
|
|
555
556
|
title: "HTML 全屏预览",
|
|
556
|
-
sandbox:
|
|
557
|
+
sandbox: K.value ? "allow-scripts" : "",
|
|
557
558
|
referrerpolicy: "no-referrer"
|
|
558
|
-
}, null, 8,
|
|
559
|
-
])) :
|
|
559
|
+
}, null, 8, we))])) : l("", !0)]))
|
|
560
|
+
])) : L.value.svg && m.mode === "render" ? (g(), u("div", Te, [d("img", {
|
|
560
561
|
class: "fvb__svgimg",
|
|
561
|
-
src:
|
|
562
|
-
alt:
|
|
563
|
-
}, null, 8,
|
|
564
|
-
text:
|
|
565
|
-
name:
|
|
566
|
-
}, null, 8, ["text", "name"])])) :
|
|
567
|
-
text:
|
|
568
|
-
name:
|
|
569
|
-
}, null, 8, ["text", "name"])])) :
|
|
570
|
-
text:
|
|
571
|
-
name:
|
|
572
|
-
}, null, 8, ["text", "name"])])) :
|
|
573
|
-
text:
|
|
574
|
-
name:
|
|
575
|
-
}, null, 8, ["text", "name"])])) :
|
|
576
|
-
text:
|
|
577
|
-
name:
|
|
578
|
-
}, null, 8, ["text", "name"])])) :
|
|
579
|
-
text:
|
|
580
|
-
name:
|
|
581
|
-
kind:
|
|
562
|
+
src: Et.value,
|
|
563
|
+
alt: L.value.name
|
|
564
|
+
}, null, 8, Ee)])) : Ct.value && m.mode === "render" ? (g(), u("div", De, [f(b(Ze), {
|
|
565
|
+
text: B.value,
|
|
566
|
+
name: L.value.name
|
|
567
|
+
}, null, 8, ["text", "name"])])) : L.value.subtitle && m.mode === "render" ? (g(), u("div", Oe, [f(b(nt), {
|
|
568
|
+
text: B.value,
|
|
569
|
+
name: L.value.name
|
|
570
|
+
}, null, 8, ["text", "name"])])) : L.value.geo && m.mode === "render" ? (g(), u("div", ke, [f(b(at), {
|
|
571
|
+
text: B.value,
|
|
572
|
+
name: L.value.name
|
|
573
|
+
}, null, 8, ["text", "name"])])) : L.value.csv && m.mode === "render" ? (g(), u("div", Ae, [f(b(ot), {
|
|
574
|
+
text: B.value,
|
|
575
|
+
name: L.value.name
|
|
576
|
+
}, null, 8, ["text", "name"])])) : L.value.jsonl && m.mode === "render" ? (g(), u("div", je, [f(b(st), {
|
|
577
|
+
text: B.value,
|
|
578
|
+
name: L.value.name
|
|
579
|
+
}, null, 8, ["text", "name"])])) : L.value.diagram && m.mode === "render" ? (g(), u("div", Me, [f(b(vt), {
|
|
580
|
+
text: B.value,
|
|
581
|
+
name: L.value.name,
|
|
582
|
+
kind: L.value.diagram
|
|
582
583
|
}, null, 8, [
|
|
583
584
|
"text",
|
|
584
585
|
"name",
|
|
585
586
|
"kind"
|
|
586
587
|
])])) : (g(), c(ie, {
|
|
587
588
|
key: 49,
|
|
588
|
-
code:
|
|
589
|
-
lang:
|
|
590
|
-
name:
|
|
589
|
+
code: Tt.value,
|
|
590
|
+
lang: L.value.lang ?? "",
|
|
591
|
+
name: L.value.name
|
|
591
592
|
}, null, 8, [
|
|
592
593
|
"code",
|
|
593
594
|
"lang",
|
|
@@ -596,4 +597,4 @@ var ue = { class: "fvb" }, de = {
|
|
|
596
597
|
}
|
|
597
598
|
});
|
|
598
599
|
//#endregion
|
|
599
|
-
export {
|
|
600
|
+
export { j as default };
|