@eternalheart/react-file-preview 1.0.2 → 1.0.4
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/FilePreviewModal.d.ts.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +601 -572
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { Presentation as
|
|
6
|
-
import { pdfjs as
|
|
7
|
-
import { pdfjs as
|
|
8
|
-
import
|
|
9
|
-
import * as
|
|
10
|
-
import { init as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Prism as
|
|
15
|
-
const
|
|
16
|
-
version:
|
|
1
|
+
import { jsxs as d, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as R, useEffect as L, useCallback as M, useMemo as q } from "react";
|
|
3
|
+
import { createPortal as le } from "react-dom";
|
|
4
|
+
import { motion as B, AnimatePresence as ne } from "framer-motion";
|
|
5
|
+
import { Presentation as se, Music as ae, SkipBack as ie, Pause as ce, Play as de, SkipForward as me, VolumeX as ue, Volume2 as he, FileText as pe, FileQuestion as fe, Download as Y, X as Z, ZoomOut as xe, ZoomIn as we, Minimize2 as ge, Maximize2 as be, RotateCcw as ve, RotateCw as ye, RefreshCw as Ne, ChevronLeft as ke, ChevronRight as je } from "lucide-react";
|
|
6
|
+
import { pdfjs as W, Document as Te, Page as Me } from "react-pdf";
|
|
7
|
+
import { pdfjs as ut } from "react-pdf";
|
|
8
|
+
import Ce from "mammoth";
|
|
9
|
+
import * as _ from "xlsx";
|
|
10
|
+
import { init as G } from "pptx-preview";
|
|
11
|
+
import Se from "video.js";
|
|
12
|
+
import Le from "react-markdown";
|
|
13
|
+
import Pe from "remark-gfm";
|
|
14
|
+
import { Prism as J } from "react-syntax-highlighter";
|
|
15
|
+
const Re = "1.0.4", Ee = {
|
|
16
|
+
version: Re
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function De(r) {
|
|
19
19
|
try {
|
|
20
|
-
const
|
|
21
|
-
return decodeURIComponent(
|
|
20
|
+
const a = new URL(r).pathname.split("/").pop() || "file";
|
|
21
|
+
return decodeURIComponent(a);
|
|
22
22
|
} catch {
|
|
23
|
-
const
|
|
24
|
-
return decodeURIComponent(
|
|
23
|
+
const t = r.split("/").pop() || "file";
|
|
24
|
+
return decodeURIComponent(t);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
var
|
|
29
|
-
const
|
|
27
|
+
function U(r) {
|
|
28
|
+
var a;
|
|
29
|
+
const t = ((a = r.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "";
|
|
30
30
|
return {
|
|
31
31
|
// 图片
|
|
32
32
|
jpg: "image/jpeg",
|
|
@@ -83,107 +83,107 @@ function A(t) {
|
|
|
83
83
|
rs: "text/x-rust",
|
|
84
84
|
yaml: "text/yaml",
|
|
85
85
|
yml: "text/yaml"
|
|
86
|
-
}[
|
|
86
|
+
}[t] || "application/octet-stream";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
if (
|
|
88
|
+
function ze(r, t = 0) {
|
|
89
|
+
if (r instanceof File)
|
|
90
90
|
return {
|
|
91
|
-
id: `file-${Date.now()}-${
|
|
92
|
-
name:
|
|
93
|
-
url: URL.createObjectURL(
|
|
94
|
-
type:
|
|
95
|
-
size:
|
|
91
|
+
id: `file-${Date.now()}-${t}`,
|
|
92
|
+
name: r.name,
|
|
93
|
+
url: URL.createObjectURL(r),
|
|
94
|
+
type: r.type || U(r.name),
|
|
95
|
+
size: r.size
|
|
96
96
|
};
|
|
97
|
-
if (typeof
|
|
98
|
-
const
|
|
97
|
+
if (typeof r == "string") {
|
|
98
|
+
const l = De(r);
|
|
99
99
|
return {
|
|
100
|
-
id: `url-${Date.now()}-${
|
|
101
|
-
name:
|
|
102
|
-
url:
|
|
103
|
-
type:
|
|
100
|
+
id: `url-${Date.now()}-${t}`,
|
|
101
|
+
name: l,
|
|
102
|
+
url: r,
|
|
103
|
+
type: U(l)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
|
-
id:
|
|
108
|
-
name:
|
|
109
|
-
url:
|
|
110
|
-
type:
|
|
111
|
-
size:
|
|
107
|
+
id: r.id || `link-${Date.now()}-${t}`,
|
|
108
|
+
name: r.name,
|
|
109
|
+
url: r.url,
|
|
110
|
+
type: r.type || U(r.name),
|
|
111
|
+
size: r.size
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function Fe(r) {
|
|
115
|
+
return r.map((t, l) => ze(t, l));
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
url:
|
|
119
|
-
zoom:
|
|
120
|
-
rotation:
|
|
121
|
-
onZoomChange:
|
|
117
|
+
const $e = ({
|
|
118
|
+
url: r,
|
|
119
|
+
zoom: t,
|
|
120
|
+
rotation: l,
|
|
121
|
+
onZoomChange: a
|
|
122
122
|
}) => {
|
|
123
|
-
const [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
}, [
|
|
123
|
+
const [n, c] = f(!1), [i, o] = f(null), [s, w] = f({ x: 0, y: 0 }), [h, m] = f(!1), [N, x] = f({ x: 0, y: 0 }), [b, p] = f(1), y = R(null);
|
|
124
|
+
L(() => {
|
|
125
|
+
c(!1), o(null), w({ x: 0, y: 0 }), p(1);
|
|
126
|
+
}, [r]), L(() => {
|
|
127
|
+
p(t);
|
|
128
|
+
}, [t]), L(() => {
|
|
129
129
|
w({ x: 0, y: 0 });
|
|
130
|
-
}, [
|
|
130
|
+
}, [t, l]);
|
|
131
131
|
const k = () => {
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
o("图片加载失败"),
|
|
135
|
-
},
|
|
132
|
+
c(!0);
|
|
133
|
+
}, j = () => {
|
|
134
|
+
o("图片加载失败"), c(!0);
|
|
135
|
+
}, u = () => {
|
|
136
136
|
w({ x: 0, y: 0 });
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
return
|
|
137
|
+
}, P = M((T) => {
|
|
138
|
+
T.preventDefault(), T.stopPropagation();
|
|
139
|
+
const z = T.deltaY > 0 ? -0.1 : 0.1;
|
|
140
|
+
p((D) => {
|
|
141
|
+
const H = Math.max(0.01, Math.min(10, D + z));
|
|
142
|
+
return a && a(H), H;
|
|
143
143
|
});
|
|
144
|
-
}, [
|
|
145
|
-
|
|
146
|
-
x:
|
|
147
|
-
y:
|
|
144
|
+
}, [a]), C = M((T) => {
|
|
145
|
+
T.button === 0 && (m(!0), x({
|
|
146
|
+
x: T.clientX - s.x,
|
|
147
|
+
y: T.clientY - s.y
|
|
148
148
|
}));
|
|
149
|
-
}, [
|
|
150
|
-
|
|
151
|
-
x:
|
|
152
|
-
y:
|
|
149
|
+
}, [s]), g = M((T) => {
|
|
150
|
+
h && w({
|
|
151
|
+
x: T.clientX - N.x,
|
|
152
|
+
y: T.clientY - N.y
|
|
153
153
|
});
|
|
154
|
-
}, [
|
|
155
|
-
|
|
154
|
+
}, [h, N]), S = M(() => {
|
|
155
|
+
m(!1);
|
|
156
156
|
}, []);
|
|
157
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ d(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
|
-
ref:
|
|
160
|
+
ref: y,
|
|
161
161
|
className: "flex items-center justify-center w-full h-full overflow-hidden",
|
|
162
|
-
onWheel:
|
|
163
|
-
onMouseDown:
|
|
162
|
+
onWheel: P,
|
|
163
|
+
onMouseDown: C,
|
|
164
164
|
onMouseMove: g,
|
|
165
|
-
onMouseUp:
|
|
166
|
-
onMouseLeave:
|
|
167
|
-
style: { cursor:
|
|
165
|
+
onMouseUp: S,
|
|
166
|
+
onMouseLeave: S,
|
|
167
|
+
style: { cursor: h ? "grabbing" : "grab" },
|
|
168
168
|
children: [
|
|
169
|
-
!
|
|
169
|
+
!n && !i && /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }),
|
|
170
170
|
i && /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: i }) }),
|
|
171
171
|
/* @__PURE__ */ e(
|
|
172
|
-
|
|
172
|
+
B.img,
|
|
173
173
|
{
|
|
174
|
-
src:
|
|
174
|
+
src: r,
|
|
175
175
|
alt: "Preview",
|
|
176
|
-
className: `max-w-none select-none ${
|
|
176
|
+
className: `max-w-none select-none ${n ? "" : "hidden"}`,
|
|
177
177
|
style: {
|
|
178
|
-
transform: `translate(${
|
|
178
|
+
transform: `translate(${s.x}px, ${s.y}px) scale(${b}) rotate(${l}deg)`,
|
|
179
179
|
transformOrigin: "center",
|
|
180
|
-
transition:
|
|
180
|
+
transition: h ? "none" : "transform 0.3s ease-out"
|
|
181
181
|
},
|
|
182
182
|
onLoad: k,
|
|
183
|
-
onError:
|
|
184
|
-
onDoubleClick:
|
|
183
|
+
onError: j,
|
|
184
|
+
onDoubleClick: u,
|
|
185
185
|
initial: { opacity: 0 },
|
|
186
|
-
animate: { opacity:
|
|
186
|
+
animate: { opacity: n ? 1 : 0 },
|
|
187
187
|
transition: { duration: 0.3 },
|
|
188
188
|
draggable: !1
|
|
189
189
|
}
|
|
@@ -192,75 +192,75 @@ const Le = ({
|
|
|
192
192
|
}
|
|
193
193
|
);
|
|
194
194
|
};
|
|
195
|
-
function
|
|
195
|
+
function We(r) {
|
|
196
196
|
if (typeof window > "u") return;
|
|
197
197
|
const {
|
|
198
|
-
workerSrc:
|
|
199
|
-
cMapUrl:
|
|
200
|
-
cMapPacked:
|
|
201
|
-
} =
|
|
202
|
-
|
|
198
|
+
workerSrc: t = `https://unpkg.com/pdfjs-dist@${W.version}/build/pdf.worker.min.mjs`,
|
|
199
|
+
cMapUrl: l = `https://unpkg.com/pdfjs-dist@${W.version}/cmaps/`,
|
|
200
|
+
cMapPacked: a = !0
|
|
201
|
+
} = r || {};
|
|
202
|
+
W.GlobalWorkerOptions.workerSrc = t, W.GlobalWorkerOptions.cMapUrl = l, W.GlobalWorkerOptions.cMapPacked = a;
|
|
203
203
|
}
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
url:
|
|
207
|
-
zoom:
|
|
208
|
-
currentPage:
|
|
209
|
-
onPageChange:
|
|
210
|
-
onTotalPagesChange:
|
|
204
|
+
We();
|
|
205
|
+
const Be = ({
|
|
206
|
+
url: r,
|
|
207
|
+
zoom: t,
|
|
208
|
+
currentPage: l,
|
|
209
|
+
onPageChange: a,
|
|
210
|
+
onTotalPagesChange: n
|
|
211
211
|
}) => {
|
|
212
|
-
const [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}, [
|
|
216
|
-
const
|
|
217
|
-
i(
|
|
218
|
-
},
|
|
219
|
-
console.error("PDF 加载错误:",
|
|
220
|
-
},
|
|
212
|
+
const [c, i] = f(0), [o, s] = f(null), w = R(null), h = R(/* @__PURE__ */ new Map());
|
|
213
|
+
L(() => {
|
|
214
|
+
s(null);
|
|
215
|
+
}, [r]);
|
|
216
|
+
const m = ({ numPages: p }) => {
|
|
217
|
+
i(p), n(p), a(1);
|
|
218
|
+
}, N = (p) => {
|
|
219
|
+
console.error("PDF 加载错误:", p), s("PDF 文件加载失败");
|
|
220
|
+
}, x = M(() => {
|
|
221
221
|
if (!w.current) return;
|
|
222
|
-
const
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
}, [
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
return
|
|
233
|
-
}, [
|
|
234
|
-
const
|
|
235
|
-
|
|
222
|
+
const p = w.current, y = p.scrollTop, k = p.clientHeight, j = y + k / 2;
|
|
223
|
+
let u = 1, P = 1 / 0;
|
|
224
|
+
h.current.forEach((C, g) => {
|
|
225
|
+
const S = C.getBoundingClientRect(), T = p.getBoundingClientRect(), z = S.top - T.top + S.height / 2 + y, D = Math.abs(z - j);
|
|
226
|
+
D < P && (P = D, u = g);
|
|
227
|
+
}), u !== l && a(u);
|
|
228
|
+
}, [l, a]);
|
|
229
|
+
L(() => {
|
|
230
|
+
const p = w.current;
|
|
231
|
+
if (p)
|
|
232
|
+
return p.addEventListener("scroll", x), () => p.removeEventListener("scroll", x);
|
|
233
|
+
}, [x]);
|
|
234
|
+
const b = M((p, y) => {
|
|
235
|
+
y ? h.current.set(p, y) : h.current.delete(p);
|
|
236
236
|
}, []);
|
|
237
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ d(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
240
240
|
ref: w,
|
|
241
|
-
className: "flex flex-col items-center w-full h-full overflow-auto py-8 px-4",
|
|
241
|
+
className: "flex flex-col items-center w-full h-full overflow-auto py-4 md:py-8 px-2 md:px-4",
|
|
242
242
|
children: [
|
|
243
243
|
o && /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: o }) }),
|
|
244
244
|
!o && /* @__PURE__ */ e(
|
|
245
|
-
|
|
245
|
+
Te,
|
|
246
246
|
{
|
|
247
|
-
file:
|
|
248
|
-
onLoadSuccess:
|
|
249
|
-
onLoadError:
|
|
247
|
+
file: r,
|
|
248
|
+
onLoadSuccess: m,
|
|
249
|
+
onLoadError: N,
|
|
250
250
|
loading: /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }),
|
|
251
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: Array.from(new Array(
|
|
252
|
-
const k =
|
|
253
|
-
return /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: Array.from(new Array(c), (p, y) => {
|
|
252
|
+
const k = y + 1;
|
|
253
|
+
return /* @__PURE__ */ d(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
256
|
-
ref: (
|
|
256
|
+
ref: (j) => b(k, j),
|
|
257
257
|
className: "relative",
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ e(
|
|
260
|
-
|
|
260
|
+
Me,
|
|
261
261
|
{
|
|
262
262
|
pageNumber: k,
|
|
263
|
-
scale:
|
|
263
|
+
scale: t,
|
|
264
264
|
loading: /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-8 bg-white/5 rounded-lg min-h-[600px]", children: /* @__PURE__ */ e("div", { className: "w-8 h-8 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }),
|
|
265
265
|
renderTextLayer: !0,
|
|
266
266
|
renderAnnotationLayer: !0,
|
|
@@ -275,38 +275,38 @@ const Re = ({
|
|
|
275
275
|
}) })
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
|
-
|
|
278
|
+
c > 0 && /* @__PURE__ */ d("div", { className: "sticky bottom-2 md:bottom-4 mt-4 md:mt-8 bg-black/60 backdrop-blur-xl text-white px-4 py-2 md:px-6 md:py-3 rounded-full text-xs md:text-sm font-medium shadow-2xl border border-white/10", children: [
|
|
279
279
|
"第 ",
|
|
280
|
-
|
|
280
|
+
l,
|
|
281
281
|
" 页 / 共 ",
|
|
282
|
-
|
|
282
|
+
c,
|
|
283
283
|
" 页"
|
|
284
284
|
] })
|
|
285
285
|
]
|
|
286
286
|
}
|
|
287
287
|
);
|
|
288
|
-
},
|
|
289
|
-
const [
|
|
290
|
-
return
|
|
288
|
+
}, He = ({ url: r }) => {
|
|
289
|
+
const [t, l] = f(""), [a, n] = f(!0), [c, i] = f(null);
|
|
290
|
+
return L(() => {
|
|
291
291
|
(async () => {
|
|
292
|
-
|
|
292
|
+
n(!0), i(null), l("");
|
|
293
293
|
try {
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
294
|
+
const s = await fetch(r);
|
|
295
|
+
if (!s.ok)
|
|
296
296
|
throw new Error("文件加载失败");
|
|
297
|
-
const w = await
|
|
298
|
-
|
|
299
|
-
} catch (
|
|
300
|
-
console.error("Docx 解析错误:",
|
|
297
|
+
const w = await s.arrayBuffer(), h = await Ce.convertToHtml({ arrayBuffer: w });
|
|
298
|
+
l(h.value);
|
|
299
|
+
} catch (s) {
|
|
300
|
+
console.error("Docx 解析错误:", s), i("Word 文档解析失败");
|
|
301
301
|
} finally {
|
|
302
|
-
|
|
302
|
+
n(!1);
|
|
303
303
|
}
|
|
304
304
|
})();
|
|
305
|
-
}, [
|
|
305
|
+
}, [r]), a ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }) : c ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: c }) }) }) : /* @__PURE__ */ e("div", { className: "w-full h-full overflow-auto p-4 md:p-8", children: /* @__PURE__ */ e(
|
|
306
306
|
"div",
|
|
307
307
|
{
|
|
308
|
-
className: "max-w-4xl mx-auto bg-white rounded-lg shadow-2xl p-12",
|
|
309
|
-
dangerouslySetInnerHTML: { __html:
|
|
308
|
+
className: "max-w-full md:max-w-4xl mx-auto bg-white rounded-lg shadow-2xl p-6 md:p-12",
|
|
309
|
+
dangerouslySetInnerHTML: { __html: t },
|
|
310
310
|
style: {
|
|
311
311
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
312
312
|
lineHeight: "1.6",
|
|
@@ -314,189 +314,189 @@ const Re = ({
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
) });
|
|
317
|
-
},
|
|
318
|
-
const [
|
|
319
|
-
if (
|
|
317
|
+
}, Ae = ({ url: r }) => {
|
|
318
|
+
const [t, l] = f([]), [a, n] = f(0), [c, i] = f(!0), [o, s] = f(null);
|
|
319
|
+
if (L(() => {
|
|
320
320
|
(async () => {
|
|
321
|
-
i(!0),
|
|
321
|
+
i(!0), s(null), l([]);
|
|
322
322
|
try {
|
|
323
|
-
const
|
|
324
|
-
if (!
|
|
323
|
+
const m = await fetch(r);
|
|
324
|
+
if (!m.ok)
|
|
325
325
|
throw new Error("文件加载失败");
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
return { name:
|
|
326
|
+
const N = await m.arrayBuffer(), x = _.read(N, { type: "array" }), b = x.SheetNames.map((p) => {
|
|
327
|
+
const y = x.Sheets[p], k = _.utils.sheet_to_json(y, { header: 1 });
|
|
328
|
+
return { name: p, data: k };
|
|
329
329
|
});
|
|
330
|
-
|
|
331
|
-
} catch (
|
|
332
|
-
console.error("Excel 解析错误:",
|
|
330
|
+
l(b), n(0);
|
|
331
|
+
} catch (m) {
|
|
332
|
+
console.error("Excel 解析错误:", m), s("Excel 文件解析失败");
|
|
333
333
|
} finally {
|
|
334
334
|
i(!1);
|
|
335
335
|
}
|
|
336
336
|
})();
|
|
337
|
-
}, [
|
|
337
|
+
}, [r]), c)
|
|
338
338
|
return /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) });
|
|
339
339
|
if (o)
|
|
340
340
|
return /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: o }) }) });
|
|
341
|
-
const w =
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
|
|
341
|
+
const w = t[a];
|
|
342
|
+
return /* @__PURE__ */ d("div", { className: "w-full h-full flex flex-col overflow-hidden", children: [
|
|
343
|
+
t.length > 1 && /* @__PURE__ */ e("div", { className: "flex gap-1 md:gap-2 p-2 md:p-4 bg-black/20 backdrop-blur-sm overflow-x-auto border-b border-white/10 scrollbar-hide", children: t.map((h, m) => /* @__PURE__ */ e(
|
|
344
344
|
"button",
|
|
345
345
|
{
|
|
346
|
-
onClick: () =>
|
|
347
|
-
className: `px-4 py-2 rounded-lg text-sm font-medium transition-all ${
|
|
348
|
-
children:
|
|
346
|
+
onClick: () => n(m),
|
|
347
|
+
className: `px-3 py-1.5 md:px-4 md:py-2 rounded-lg text-xs md:text-sm font-medium transition-all flex-shrink-0 ${a === m ? "bg-gradient-to-r from-purple-500 to-pink-500 text-white shadow-lg" : "bg-white/10 text-white hover:bg-white/20"}`,
|
|
348
|
+
children: h.name
|
|
349
349
|
},
|
|
350
|
-
|
|
350
|
+
m
|
|
351
351
|
)) }),
|
|
352
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-8", children: /* @__PURE__ */ e("div", { className: "inline-block min-w-full bg-gradient-to-br from-gray-800/90 to-gray-900/90 backdrop-blur-xl rounded-2xl shadow-2xl overflow-hidden border border-white/10", children: /* @__PURE__ */ e("table", { className: "min-w-full divide-y divide-white/10", children: /* @__PURE__ */ e("tbody", { className: "divide-y divide-white/10", children: w == null ? void 0 : w.data.map((
|
|
352
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-2 md:p-8", children: /* @__PURE__ */ e("div", { className: "inline-block min-w-full bg-gradient-to-br from-gray-800/90 to-gray-900/90 backdrop-blur-xl rounded-xl md:rounded-2xl shadow-2xl overflow-hidden border border-white/10", children: /* @__PURE__ */ e("table", { className: "min-w-full divide-y divide-white/10", children: /* @__PURE__ */ e("tbody", { className: "divide-y divide-white/10", children: w == null ? void 0 : w.data.map((h, m) => /* @__PURE__ */ e(
|
|
353
353
|
"tr",
|
|
354
354
|
{
|
|
355
|
-
className: `transition-colors ${
|
|
356
|
-
children:
|
|
355
|
+
className: `transition-colors ${m === 0 ? "bg-gradient-to-r from-purple-500/20 to-pink-500/20 font-semibold" : "hover:bg-white/5"}`,
|
|
356
|
+
children: h.map((N, x) => /* @__PURE__ */ e(
|
|
357
357
|
"td",
|
|
358
358
|
{
|
|
359
|
-
className: "px-6 py-4 whitespace-nowrap text-sm text-gray-200 border-r border-white/10",
|
|
360
|
-
children: String(
|
|
359
|
+
className: "px-3 py-2 md:px-6 md:py-4 whitespace-nowrap text-xs md:text-sm text-gray-200 border-r border-white/10",
|
|
360
|
+
children: String(N ?? "")
|
|
361
361
|
},
|
|
362
|
-
|
|
362
|
+
x
|
|
363
363
|
))
|
|
364
364
|
},
|
|
365
|
-
|
|
365
|
+
m
|
|
366
366
|
)) }) }) }) })
|
|
367
367
|
] });
|
|
368
|
-
},
|
|
369
|
-
const [
|
|
370
|
-
if (!
|
|
371
|
-
const
|
|
372
|
-
return console.log("计算尺寸:", { width:
|
|
373
|
-
}, []),
|
|
374
|
-
if (!(!
|
|
368
|
+
}, Ue = ({ url: r }) => {
|
|
369
|
+
const [t, l] = f(!0), [a, n] = f(null), c = R(null), i = R(null), o = R(null), s = R(null), w = R(null), h = R({ width: 0, height: 0 }), m = M(() => {
|
|
370
|
+
if (!c.current) return { width: 960, height: 540 };
|
|
371
|
+
const x = c.current.clientWidth, b = Math.floor(x * 9 / 16);
|
|
372
|
+
return console.log("计算尺寸:", { width: x, height: b }), { width: x, height: b };
|
|
373
|
+
}, []), N = M(async () => {
|
|
374
|
+
if (!(!c.current || !s.current)) {
|
|
375
375
|
console.log("重新初始化预览器...");
|
|
376
376
|
try {
|
|
377
377
|
if (i.current)
|
|
378
378
|
try {
|
|
379
379
|
i.current.destroy();
|
|
380
|
-
} catch (
|
|
381
|
-
console.error("销毁预览器失败:",
|
|
380
|
+
} catch (p) {
|
|
381
|
+
console.error("销毁预览器失败:", p);
|
|
382
382
|
}
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
console.log("重新初始化使用尺寸:",
|
|
386
|
-
const
|
|
387
|
-
width:
|
|
388
|
-
height:
|
|
383
|
+
c.current.innerHTML = "";
|
|
384
|
+
const x = m();
|
|
385
|
+
console.log("重新初始化使用尺寸:", x);
|
|
386
|
+
const b = G(c.current, {
|
|
387
|
+
width: x.width,
|
|
388
|
+
height: x.height
|
|
389
389
|
});
|
|
390
|
-
i.current =
|
|
391
|
-
} catch (
|
|
392
|
-
console.error("重新初始化失败:",
|
|
390
|
+
i.current = b, await b.preview(s.current), console.log("重新初始化成功");
|
|
391
|
+
} catch (x) {
|
|
392
|
+
console.error("重新初始化失败:", x);
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
}, [
|
|
396
|
-
return
|
|
397
|
-
if (!
|
|
398
|
-
let
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
|
|
395
|
+
}, [m]);
|
|
396
|
+
return L(() => {
|
|
397
|
+
if (!c.current) return;
|
|
398
|
+
let x = !0;
|
|
399
|
+
const b = () => {
|
|
400
|
+
if (x) {
|
|
401
|
+
x = !1;
|
|
402
|
+
const u = m();
|
|
403
|
+
h.current = u;
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
if (k < 10 &&
|
|
406
|
+
const p = m(), y = h.current, k = Math.abs(y.width - p.width), j = Math.abs(y.height - p.height);
|
|
407
|
+
if (k < 10 && j < 10) {
|
|
408
408
|
console.log("尺寸变化太小,忽略");
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
console.log("检测到尺寸变化:", {
|
|
412
|
-
old:
|
|
413
|
-
new:
|
|
414
|
-
diff: { width: k, height:
|
|
415
|
-
}),
|
|
416
|
-
i.current &&
|
|
412
|
+
old: y,
|
|
413
|
+
new: p,
|
|
414
|
+
diff: { width: k, height: j }
|
|
415
|
+
}), h.current = p, w.current && clearTimeout(w.current), w.current = window.setTimeout(() => {
|
|
416
|
+
i.current && s.current && (console.log("尺寸变化,准备重新初始化"), N());
|
|
417
417
|
}, 800);
|
|
418
418
|
};
|
|
419
419
|
return o.current = new ResizeObserver(() => {
|
|
420
|
-
|
|
421
|
-
}), o.current.observe(
|
|
420
|
+
b();
|
|
421
|
+
}), o.current.observe(c.current), () => {
|
|
422
422
|
o.current && o.current.disconnect(), w.current && clearTimeout(w.current);
|
|
423
423
|
};
|
|
424
|
-
}, [
|
|
425
|
-
let
|
|
426
|
-
const
|
|
427
|
-
if (!
|
|
424
|
+
}, [m, N]), L(() => {
|
|
425
|
+
let x = !0;
|
|
426
|
+
const b = async () => {
|
|
427
|
+
if (!c.current) {
|
|
428
428
|
console.log("Container ref not ready");
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
l(!0), n(null);
|
|
432
432
|
try {
|
|
433
|
-
console.log("开始加载 PPTX:",
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
433
|
+
console.log("开始加载 PPTX:", r);
|
|
434
|
+
const y = await fetch(r);
|
|
435
|
+
if (!y.ok)
|
|
436
436
|
throw new Error("文件加载失败");
|
|
437
|
-
const k = await
|
|
438
|
-
if (
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
console.log("使用尺寸:",
|
|
442
|
-
const
|
|
443
|
-
width:
|
|
444
|
-
height:
|
|
437
|
+
const k = await y.arrayBuffer();
|
|
438
|
+
if (s.current = k, console.log("文件加载成功,大小:", k.byteLength), !x) return;
|
|
439
|
+
c.current && (c.current.innerHTML = "");
|
|
440
|
+
const j = m();
|
|
441
|
+
console.log("使用尺寸:", j), console.log("初始化预览器...");
|
|
442
|
+
const u = G(c.current, {
|
|
443
|
+
width: j.width,
|
|
444
|
+
height: j.height
|
|
445
445
|
});
|
|
446
|
-
i.current =
|
|
447
|
-
console.log("预览成功"),
|
|
448
|
-
}).catch((
|
|
449
|
-
console.error("预览失败:",
|
|
446
|
+
i.current = u, console.log("开始预览..."), u.preview(k).then(() => {
|
|
447
|
+
console.log("预览成功"), x && l(!1);
|
|
448
|
+
}).catch((P) => {
|
|
449
|
+
console.error("预览失败:", P), x && (n("PPT 文件预览失败"), l(!1));
|
|
450
450
|
});
|
|
451
|
-
} catch (
|
|
452
|
-
console.error("PPTX 解析错误:",
|
|
451
|
+
} catch (y) {
|
|
452
|
+
console.error("PPTX 解析错误:", y), x && (n(y instanceof Error ? y.message : "PPT 文件解析失败"), l(!1));
|
|
453
453
|
}
|
|
454
|
-
},
|
|
455
|
-
|
|
454
|
+
}, p = setTimeout(() => {
|
|
455
|
+
b();
|
|
456
456
|
}, 100);
|
|
457
457
|
return () => {
|
|
458
|
-
if (
|
|
458
|
+
if (x = !1, clearTimeout(p), s.current = null, i.current)
|
|
459
459
|
try {
|
|
460
460
|
i.current.destroy();
|
|
461
|
-
} catch (
|
|
462
|
-
console.error("销毁预览器失败:",
|
|
461
|
+
} catch (y) {
|
|
462
|
+
console.error("销毁预览器失败:", y);
|
|
463
463
|
}
|
|
464
464
|
i.current = null;
|
|
465
465
|
};
|
|
466
|
-
}, [
|
|
467
|
-
|
|
468
|
-
/* @__PURE__ */ e("div", { className: "w-12 h-12 mx-auto mb-3 border-4 border-white/20 border-t-white rounded-full animate-spin" }),
|
|
469
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-white/70 font-medium", children: "加载 PPT 中..." })
|
|
466
|
+
}, [r, m]), /* @__PURE__ */ d("div", { className: "relative flex flex-col items-center w-full h-full pt-2 px-2 md:px-4", children: [
|
|
467
|
+
t && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm z-10 rounded-xl md:rounded-2xl", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
468
|
+
/* @__PURE__ */ e("div", { className: "w-10 h-10 md:w-12 md:h-12 mx-auto mb-3 border-4 border-white/20 border-t-white rounded-full animate-spin" }),
|
|
469
|
+
/* @__PURE__ */ e("p", { className: "text-xs md:text-sm text-white/70 font-medium", children: "加载 PPT 中..." })
|
|
470
470
|
] }) }),
|
|
471
|
-
|
|
472
|
-
/* @__PURE__ */ e("div", { className: "w-32 h-32 mx-auto mb-6 rounded-3xl bg-gradient-to-br from-orange-500 via-red-500 to-pink-500 flex items-center justify-center shadow-2xl", children: /* @__PURE__ */ e(
|
|
473
|
-
/* @__PURE__ */ e("p", { className: "text-xl text-white/90 mb-3 font-medium", children: "PPT 预览" }),
|
|
474
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-white/60 mb-6", children:
|
|
475
|
-
/* @__PURE__ */
|
|
471
|
+
a && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm z-10 rounded-xl md:rounded-2xl", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm md:max-w-md px-4", children: [
|
|
472
|
+
/* @__PURE__ */ e("div", { className: "w-24 h-24 md:w-32 md:h-32 mx-auto mb-4 md:mb-6 rounded-2xl md:rounded-3xl bg-gradient-to-br from-orange-500 via-red-500 to-pink-500 flex items-center justify-center shadow-2xl", children: /* @__PURE__ */ e(se, { className: "w-12 h-12 md:w-16 md:h-16 text-white" }) }),
|
|
473
|
+
/* @__PURE__ */ e("p", { className: "text-lg md:text-xl text-white/90 mb-2 md:mb-3 font-medium", children: "PPT 预览" }),
|
|
474
|
+
/* @__PURE__ */ e("p", { className: "text-xs md:text-sm text-white/60 mb-4 md:mb-6", children: a || "浏览器暂不支持直接预览 PPT 文件" }),
|
|
475
|
+
/* @__PURE__ */ d(
|
|
476
476
|
"a",
|
|
477
477
|
{
|
|
478
|
-
href:
|
|
478
|
+
href: r,
|
|
479
479
|
download: !0,
|
|
480
|
-
className: "inline-flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-xl hover:scale-105 transition-all shadow-lg",
|
|
480
|
+
className: "inline-flex items-center gap-2 px-4 py-2 md:px-6 md:py-3 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-sm md:text-base rounded-lg md:rounded-xl hover:scale-105 transition-all shadow-lg",
|
|
481
481
|
children: [
|
|
482
|
-
/* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }) }),
|
|
482
|
+
/* @__PURE__ */ e("svg", { className: "w-4 h-4 md:w-5 md:h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }) }),
|
|
483
483
|
"下载文件"
|
|
484
484
|
]
|
|
485
485
|
}
|
|
486
486
|
),
|
|
487
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 mt-4", children: "提示:可以使用 Microsoft PowerPoint 或 WPS 打开" })
|
|
487
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 mt-3 md:mt-4", children: "提示:可以使用 Microsoft PowerPoint 或 WPS 打开" })
|
|
488
488
|
] }) }),
|
|
489
489
|
/* @__PURE__ */ e(
|
|
490
490
|
"div",
|
|
491
491
|
{
|
|
492
|
-
ref:
|
|
493
|
-
className: "pptx-wrapper w-full max-w-6xl"
|
|
492
|
+
ref: c,
|
|
493
|
+
className: "pptx-wrapper w-full max-w-full md:max-w-6xl"
|
|
494
494
|
}
|
|
495
495
|
)
|
|
496
496
|
] });
|
|
497
|
-
},
|
|
498
|
-
var
|
|
499
|
-
const
|
|
497
|
+
}, Xe = (r) => {
|
|
498
|
+
var a;
|
|
499
|
+
const t = ((a = r.split(".").pop()) == null ? void 0 : a.toLowerCase().split("?")[0]) || "";
|
|
500
500
|
return {
|
|
501
501
|
mp4: "video/mp4",
|
|
502
502
|
webm: "video/webm",
|
|
@@ -509,14 +509,14 @@ const Re = ({
|
|
|
509
509
|
m4v: "video/mp4",
|
|
510
510
|
"3gp": "video/3gpp",
|
|
511
511
|
flv: "video/x-flv"
|
|
512
|
-
}[
|
|
513
|
-
},
|
|
514
|
-
const [
|
|
515
|
-
return
|
|
516
|
-
if (!i.current &&
|
|
512
|
+
}[t] || "video/mp4";
|
|
513
|
+
}, Oe = ({ url: r }) => {
|
|
514
|
+
const [t, l] = f(null), [a, n] = f(!0), c = R(null), i = R(null);
|
|
515
|
+
return L(() => {
|
|
516
|
+
if (!i.current && c.current) {
|
|
517
517
|
const o = document.createElement("video-js");
|
|
518
|
-
o.classList.add("vjs-big-play-centered", "vjs-theme-apple"),
|
|
519
|
-
const
|
|
518
|
+
o.classList.add("vjs-big-play-centered", "vjs-theme-apple"), c.current.appendChild(o);
|
|
519
|
+
const s = Xe(r), h = Se(o, {
|
|
520
520
|
controls: !0,
|
|
521
521
|
responsive: !0,
|
|
522
522
|
fluid: !0,
|
|
@@ -544,37 +544,37 @@ const Re = ({
|
|
|
544
544
|
nativeAudioTracks: !1,
|
|
545
545
|
nativeTextTracks: !1
|
|
546
546
|
},
|
|
547
|
-
sources:
|
|
548
|
-
{ src:
|
|
549
|
-
{ src:
|
|
547
|
+
sources: s === "video/quicktime" ? [
|
|
548
|
+
{ src: r, type: "video/quicktime" },
|
|
549
|
+
{ src: r, type: "video/mp4" }
|
|
550
550
|
// 备用方案
|
|
551
|
-
] : [{ src:
|
|
551
|
+
] : [{ src: r, type: s }]
|
|
552
552
|
});
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}),
|
|
556
|
-
const
|
|
557
|
-
console.error("Video.js error:",
|
|
558
|
-
}), i.current =
|
|
553
|
+
h.on("loadeddata", () => {
|
|
554
|
+
n(!1);
|
|
555
|
+
}), h.on("error", () => {
|
|
556
|
+
const m = h.error();
|
|
557
|
+
console.error("Video.js error:", m), l(`视频加载失败: ${(m == null ? void 0 : m.message) || "未知错误"}`), n(!1);
|
|
558
|
+
}), i.current = h;
|
|
559
559
|
}
|
|
560
|
-
}, [
|
|
560
|
+
}, [r]), L(() => {
|
|
561
561
|
const o = i.current;
|
|
562
562
|
return () => {
|
|
563
563
|
o && !o.isDisposed() && (o.dispose(), i.current = null);
|
|
564
564
|
};
|
|
565
|
-
}, []),
|
|
565
|
+
}, []), t ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
566
566
|
/* @__PURE__ */ e("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-red-500/10 flex items-center justify-center", children: /* @__PURE__ */ e("svg", { className: "w-8 h-8 text-red-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }),
|
|
567
567
|
/* @__PURE__ */ e("p", { className: "text-lg font-medium text-white/90 mb-2", children: "视频加载失败" }),
|
|
568
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-white/60", children:
|
|
569
|
-
] }) }) : /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full p-8", children: /* @__PURE__ */
|
|
570
|
-
|
|
568
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-white/60", children: t })
|
|
569
|
+
] }) }) : /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full p-4 md:p-8", children: /* @__PURE__ */ d("div", { className: "w-full max-w-full md:max-w-5xl relative", children: [
|
|
570
|
+
a && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20 backdrop-blur-sm rounded-2xl z-10", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
571
571
|
/* @__PURE__ */ e("div", { className: "w-12 h-12 mx-auto mb-3 border-3 border-white/20 border-t-white rounded-full animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ e("p", { className: "text-sm text-white/70 font-medium", children: "加载视频中..." })
|
|
573
573
|
] }) }),
|
|
574
574
|
/* @__PURE__ */ e(
|
|
575
575
|
"div",
|
|
576
576
|
{
|
|
577
|
-
ref:
|
|
577
|
+
ref: c,
|
|
578
578
|
className: "overflow-hidden",
|
|
579
579
|
style: {
|
|
580
580
|
boxShadow: "0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05)"
|
|
@@ -582,55 +582,55 @@ const Re = ({
|
|
|
582
582
|
}
|
|
583
583
|
)
|
|
584
584
|
] }) });
|
|
585
|
-
},
|
|
586
|
-
const [
|
|
587
|
-
|
|
588
|
-
const g =
|
|
585
|
+
}, Ve = ({ url: r, fileName: t }) => {
|
|
586
|
+
const [l, a] = f(null), [n, c] = f(!1), [i, o] = f(0), [s, w] = f(0), [h, m] = f(1), [N, x] = f(!1), b = R(null);
|
|
587
|
+
L(() => {
|
|
588
|
+
const g = b.current;
|
|
589
589
|
if (!g) return;
|
|
590
|
-
const
|
|
590
|
+
const S = () => {
|
|
591
591
|
isNaN(g.currentTime) || o(g.currentTime);
|
|
592
|
-
},
|
|
592
|
+
}, T = () => {
|
|
593
593
|
!isNaN(g.duration) && isFinite(g.duration) && w(g.duration);
|
|
594
|
-
},
|
|
595
|
-
return g.addEventListener("timeupdate",
|
|
596
|
-
g.removeEventListener("timeupdate",
|
|
594
|
+
}, z = () => c(!1), D = () => T();
|
|
595
|
+
return g.addEventListener("timeupdate", S), g.addEventListener("loadedmetadata", T), g.addEventListener("durationchange", T), g.addEventListener("canplay", D), g.addEventListener("ended", z), g.readyState >= 1 && T(), () => {
|
|
596
|
+
g.removeEventListener("timeupdate", S), g.removeEventListener("loadedmetadata", T), g.removeEventListener("durationchange", T), g.removeEventListener("canplay", D), g.removeEventListener("ended", z);
|
|
597
597
|
};
|
|
598
598
|
}, []);
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
const
|
|
603
|
-
o(
|
|
599
|
+
const p = () => {
|
|
600
|
+
b.current && (n ? b.current.pause() : b.current.play(), c(!n));
|
|
601
|
+
}, y = (g) => {
|
|
602
|
+
const S = parseFloat(g.target.value);
|
|
603
|
+
o(S), b.current && (b.current.currentTime = S);
|
|
604
604
|
}, k = (g) => {
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
},
|
|
608
|
-
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
},
|
|
605
|
+
const S = parseFloat(g.target.value);
|
|
606
|
+
m(S), b.current && (b.current.volume = S), S > 0 && x(!1);
|
|
607
|
+
}, j = () => {
|
|
608
|
+
b.current && (b.current.muted = !N, x(!N));
|
|
609
|
+
}, u = (g) => {
|
|
610
|
+
b.current && (b.current.currentTime += g);
|
|
611
|
+
}, P = (g) => {
|
|
612
612
|
if (!isFinite(g) || isNaN(g) || g < 0) return "0:00";
|
|
613
|
-
const
|
|
614
|
-
return `${
|
|
615
|
-
},
|
|
616
|
-
|
|
613
|
+
const S = Math.floor(g / 60), T = Math.floor(g % 60);
|
|
614
|
+
return `${S}:${T.toString().padStart(2, "0")}`;
|
|
615
|
+
}, C = () => {
|
|
616
|
+
a("音频加载失败");
|
|
617
617
|
};
|
|
618
|
-
return
|
|
619
|
-
/* @__PURE__ */ e("div", { className: "w-64 h-64 rounded-3xl bg-gradient-to-br from-purple-500 via-pink-500 to-rose-500 flex items-center justify-center shadow-2xl backdrop-blur-xl", children: /* @__PURE__ */ e(
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */ e("p", { className: "text-2xl font-medium mb-1", children:
|
|
622
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-white/60", children: "音频文件" })
|
|
618
|
+
return l ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: l }) }) }) : /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center w-full h-full p-4 md:p-8 gap-4 md:gap-8", children: [
|
|
619
|
+
/* @__PURE__ */ e("div", { className: "w-48 h-48 md:w-64 md:h-64 rounded-3xl bg-gradient-to-br from-purple-500 via-pink-500 to-rose-500 flex items-center justify-center shadow-2xl backdrop-blur-xl", children: /* @__PURE__ */ e(ae, { className: "w-24 h-24 md:w-32 md:h-32 text-white" }) }),
|
|
620
|
+
/* @__PURE__ */ d("div", { className: "text-white text-center max-w-sm md:max-w-md px-4", children: [
|
|
621
|
+
/* @__PURE__ */ e("p", { className: "text-xl md:text-2xl font-medium mb-1 truncate", children: t }),
|
|
622
|
+
/* @__PURE__ */ e("p", { className: "text-xs md:text-sm text-white/60", children: "音频文件" })
|
|
623
623
|
] }),
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ d("div", { className: "w-full max-w-sm md:max-w-md bg-white/10 backdrop-blur-xl rounded-2xl p-4 md:p-6 border border-white/20", children: [
|
|
625
|
+
/* @__PURE__ */ d("div", { className: "mb-4", children: [
|
|
626
|
+
/* @__PURE__ */ d("div", { className: "relative h-4 flex items-center", children: [
|
|
627
627
|
/* @__PURE__ */ e("div", { className: "absolute w-full h-[6px] bg-white/20 rounded-full" }),
|
|
628
628
|
/* @__PURE__ */ e(
|
|
629
629
|
"div",
|
|
630
630
|
{
|
|
631
631
|
className: "absolute h-[6px] bg-gradient-to-r from-purple-500 to-pink-500 rounded-full transition-all duration-100 ease-linear pointer-events-none",
|
|
632
632
|
style: {
|
|
633
|
-
width: `${
|
|
633
|
+
width: `${s > 0 ? i / s * 100 : i > 100 ? 100 : i}%`
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
),
|
|
@@ -639,61 +639,61 @@ const Re = ({
|
|
|
639
639
|
{
|
|
640
640
|
type: "range",
|
|
641
641
|
min: "0",
|
|
642
|
-
max:
|
|
642
|
+
max: s > 0 ? s : 100 + (i > 100 ? i % 100 : 0),
|
|
643
643
|
value: i,
|
|
644
|
-
onChange:
|
|
644
|
+
onChange: y,
|
|
645
645
|
className: "audio-slider absolute w-full"
|
|
646
646
|
}
|
|
647
647
|
)
|
|
648
648
|
] }),
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */ e("span", { children:
|
|
651
|
-
/* @__PURE__ */ e("span", { children:
|
|
649
|
+
/* @__PURE__ */ d("div", { className: "flex justify-between text-xs text-white/60 mt-3", children: [
|
|
650
|
+
/* @__PURE__ */ e("span", { children: P(i) }),
|
|
651
|
+
/* @__PURE__ */ e("span", { children: P(s) })
|
|
652
652
|
] })
|
|
653
653
|
] }),
|
|
654
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-4 mb-4", children: [
|
|
655
655
|
/* @__PURE__ */ e(
|
|
656
656
|
"button",
|
|
657
657
|
{
|
|
658
|
-
onClick: () =>
|
|
658
|
+
onClick: () => u(-10),
|
|
659
659
|
className: "w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center text-white transition-all",
|
|
660
|
-
children: /* @__PURE__ */ e(
|
|
660
|
+
children: /* @__PURE__ */ e(ie, { className: "w-5 h-5" })
|
|
661
661
|
}
|
|
662
662
|
),
|
|
663
663
|
/* @__PURE__ */ e(
|
|
664
664
|
"button",
|
|
665
665
|
{
|
|
666
|
-
onClick:
|
|
666
|
+
onClick: p,
|
|
667
667
|
className: "w-14 h-14 rounded-full bg-gradient-to-br from-purple-500 to-pink-500 hover:scale-105 flex items-center justify-center text-white transition-all shadow-lg",
|
|
668
|
-
children:
|
|
668
|
+
children: n ? /* @__PURE__ */ e(ce, { className: "w-6 h-6" }) : /* @__PURE__ */ e(de, { className: "w-6 h-6 ml-1" })
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
671
|
/* @__PURE__ */ e(
|
|
672
672
|
"button",
|
|
673
673
|
{
|
|
674
|
-
onClick: () =>
|
|
674
|
+
onClick: () => u(10),
|
|
675
675
|
className: "w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center text-white transition-all",
|
|
676
|
-
children: /* @__PURE__ */ e(
|
|
676
|
+
children: /* @__PURE__ */ e(me, { className: "w-5 h-5" })
|
|
677
677
|
}
|
|
678
678
|
)
|
|
679
679
|
] }),
|
|
680
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
|
|
681
681
|
/* @__PURE__ */ e(
|
|
682
682
|
"button",
|
|
683
683
|
{
|
|
684
|
-
onClick:
|
|
684
|
+
onClick: j,
|
|
685
685
|
className: "text-white/80 hover:text-white transition-colors",
|
|
686
|
-
children:
|
|
686
|
+
children: N || h === 0 ? /* @__PURE__ */ e(ue, { className: "w-5 h-5" }) : /* @__PURE__ */ e(he, { className: "w-5 h-5" })
|
|
687
687
|
}
|
|
688
688
|
),
|
|
689
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ d("div", { className: "flex-1 relative h-3 flex items-center", children: [
|
|
690
690
|
/* @__PURE__ */ e("div", { className: "absolute w-full h-[4px] bg-white/20 rounded-full" }),
|
|
691
691
|
/* @__PURE__ */ e(
|
|
692
692
|
"div",
|
|
693
693
|
{
|
|
694
694
|
className: "absolute h-[4px] bg-purple-500 rounded-full transition-all duration-100 pointer-events-none",
|
|
695
695
|
style: {
|
|
696
|
-
width: `${(
|
|
696
|
+
width: `${(N ? 0 : h) * 100}%`
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
),
|
|
@@ -704,7 +704,7 @@ const Re = ({
|
|
|
704
704
|
min: "0",
|
|
705
705
|
max: "1",
|
|
706
706
|
step: "0.01",
|
|
707
|
-
value:
|
|
707
|
+
value: N ? 0 : h,
|
|
708
708
|
onChange: k,
|
|
709
709
|
className: "volume-slider absolute w-full"
|
|
710
710
|
}
|
|
@@ -715,14 +715,14 @@ const Re = ({
|
|
|
715
715
|
/* @__PURE__ */ e(
|
|
716
716
|
"audio",
|
|
717
717
|
{
|
|
718
|
-
ref:
|
|
719
|
-
src:
|
|
720
|
-
onError:
|
|
718
|
+
ref: b,
|
|
719
|
+
src: r,
|
|
720
|
+
onError: C,
|
|
721
721
|
className: "hidden"
|
|
722
722
|
}
|
|
723
723
|
)
|
|
724
724
|
] });
|
|
725
|
-
},
|
|
725
|
+
}, K = {
|
|
726
726
|
'pre[class*="language-"]': {
|
|
727
727
|
color: "#d4d4d4",
|
|
728
728
|
fontSize: "13px",
|
|
@@ -1003,54 +1003,54 @@ const Re = ({
|
|
|
1003
1003
|
boxShadow: "inset 5px 0 0 #f7d87c",
|
|
1004
1004
|
zIndex: "0"
|
|
1005
1005
|
}
|
|
1006
|
-
},
|
|
1007
|
-
const [
|
|
1008
|
-
return
|
|
1006
|
+
}, qe = ({ url: r }) => {
|
|
1007
|
+
const [t, l] = f(""), [a, n] = f(!0), [c, i] = f(null);
|
|
1008
|
+
return L(() => {
|
|
1009
1009
|
(async () => {
|
|
1010
1010
|
try {
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
if (!
|
|
1011
|
+
n(!0), i(null);
|
|
1012
|
+
const s = await fetch(r);
|
|
1013
|
+
if (!s.ok)
|
|
1014
1014
|
throw new Error("加载失败");
|
|
1015
|
-
const w = await
|
|
1016
|
-
|
|
1017
|
-
} catch (
|
|
1018
|
-
i("Markdown 文件加载失败"), console.error(
|
|
1015
|
+
const w = await s.text();
|
|
1016
|
+
l(w);
|
|
1017
|
+
} catch (s) {
|
|
1018
|
+
i("Markdown 文件加载失败"), console.error(s);
|
|
1019
1019
|
} finally {
|
|
1020
|
-
|
|
1020
|
+
n(!1);
|
|
1021
1021
|
}
|
|
1022
1022
|
})();
|
|
1023
|
-
}, [
|
|
1024
|
-
|
|
1023
|
+
}, [r]), a ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }) : c ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: c }) }) }) : /* @__PURE__ */ e("div", { className: "w-full h-full overflow-auto p-4 md:p-8", children: /* @__PURE__ */ e("div", { className: "max-w-full md:max-w-4xl mx-auto bg-white/5 backdrop-blur-sm rounded-2xl p-4 md:p-8 border border-white/10", children: /* @__PURE__ */ e("div", { className: "prose prose-invert prose-sm md:prose-lg max-w-none", children: /* @__PURE__ */ e(
|
|
1024
|
+
Le,
|
|
1025
1025
|
{
|
|
1026
|
-
remarkPlugins: [
|
|
1026
|
+
remarkPlugins: [Pe],
|
|
1027
1027
|
components: {
|
|
1028
|
-
code({ node: o, inline:
|
|
1029
|
-
const
|
|
1030
|
-
return !
|
|
1031
|
-
|
|
1028
|
+
code({ node: o, inline: s, className: w, children: h, ...m }) {
|
|
1029
|
+
const N = /language-(\w+)/.exec(w || "");
|
|
1030
|
+
return !s && N ? /* @__PURE__ */ e(
|
|
1031
|
+
J,
|
|
1032
1032
|
{
|
|
1033
|
-
style:
|
|
1034
|
-
language:
|
|
1033
|
+
style: K,
|
|
1034
|
+
language: N[1],
|
|
1035
1035
|
PreTag: "div",
|
|
1036
1036
|
className: "rounded-lg",
|
|
1037
|
-
...
|
|
1038
|
-
children: String(
|
|
1037
|
+
...m,
|
|
1038
|
+
children: String(h).replace(/\n$/, "")
|
|
1039
1039
|
}
|
|
1040
|
-
) : /* @__PURE__ */ e("code", { className: "bg-white/10 px-1.5 py-0.5 rounded text-sm", ...
|
|
1040
|
+
) : /* @__PURE__ */ e("code", { className: "bg-white/10 px-1.5 py-0.5 rounded text-sm", ...m, children: h });
|
|
1041
1041
|
},
|
|
1042
1042
|
h1: ({ children: o }) => /* @__PURE__ */ e("h1", { className: "text-4xl font-bold mb-4 text-white border-b border-white/20 pb-2", children: o }),
|
|
1043
1043
|
h2: ({ children: o }) => /* @__PURE__ */ e("h2", { className: "text-3xl font-bold mb-3 text-white mt-8", children: o }),
|
|
1044
1044
|
h3: ({ children: o }) => /* @__PURE__ */ e("h3", { className: "text-2xl font-bold mb-2 text-white mt-6", children: o }),
|
|
1045
1045
|
p: ({ children: o }) => /* @__PURE__ */ e("p", { className: "text-white/90 mb-4 leading-relaxed", children: o }),
|
|
1046
|
-
a: ({ href: o, children:
|
|
1046
|
+
a: ({ href: o, children: s }) => /* @__PURE__ */ e(
|
|
1047
1047
|
"a",
|
|
1048
1048
|
{
|
|
1049
1049
|
href: o,
|
|
1050
1050
|
className: "text-blue-400 hover:text-blue-300 underline",
|
|
1051
1051
|
target: "_blank",
|
|
1052
1052
|
rel: "noopener noreferrer",
|
|
1053
|
-
children:
|
|
1053
|
+
children: s
|
|
1054
1054
|
}
|
|
1055
1055
|
),
|
|
1056
1056
|
ul: ({ children: o }) => /* @__PURE__ */ e("ul", { className: "list-disc list-inside mb-4 text-white/90", children: o }),
|
|
@@ -1061,14 +1061,14 @@ const Re = ({
|
|
|
1061
1061
|
th: ({ children: o }) => /* @__PURE__ */ e("th", { className: "border border-white/20 px-4 py-2 bg-white/10 text-white font-semibold", children: o }),
|
|
1062
1062
|
td: ({ children: o }) => /* @__PURE__ */ e("td", { className: "border border-white/20 px-4 py-2 text-white/90", children: o }),
|
|
1063
1063
|
hr: () => /* @__PURE__ */ e("hr", { className: "border-white/20 my-6" }),
|
|
1064
|
-
img: ({ src: o, alt:
|
|
1064
|
+
img: ({ src: o, alt: s }) => /* @__PURE__ */ e("img", { src: o, alt: s, className: "rounded-lg max-w-full h-auto my-4" })
|
|
1065
1065
|
},
|
|
1066
|
-
children:
|
|
1066
|
+
children: t
|
|
1067
1067
|
}
|
|
1068
1068
|
) }) }) });
|
|
1069
|
-
},
|
|
1070
|
-
var
|
|
1071
|
-
const
|
|
1069
|
+
}, Ze = (r) => {
|
|
1070
|
+
var a;
|
|
1071
|
+
const t = ((a = r.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "";
|
|
1072
1072
|
return {
|
|
1073
1073
|
js: "javascript",
|
|
1074
1074
|
jsx: "jsx",
|
|
@@ -1104,35 +1104,35 @@ const Re = ({
|
|
|
1104
1104
|
conf: "nginx",
|
|
1105
1105
|
md: "markdown",
|
|
1106
1106
|
txt: "text"
|
|
1107
|
-
}[
|
|
1108
|
-
},
|
|
1109
|
-
const [
|
|
1110
|
-
return
|
|
1107
|
+
}[t] || "text";
|
|
1108
|
+
}, _e = ({ url: r, fileName: t }) => {
|
|
1109
|
+
const [l, a] = f(""), [n, c] = f(!0), [i, o] = f(null), s = Ze(t);
|
|
1110
|
+
return L(() => {
|
|
1111
1111
|
(async () => {
|
|
1112
1112
|
try {
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
if (!
|
|
1113
|
+
c(!0), o(null);
|
|
1114
|
+
const h = await fetch(r);
|
|
1115
|
+
if (!h.ok)
|
|
1116
1116
|
throw new Error("加载失败");
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
} catch (
|
|
1120
|
-
o("文本文件加载失败"), console.error(
|
|
1117
|
+
const m = await h.text();
|
|
1118
|
+
a(m);
|
|
1119
|
+
} catch (h) {
|
|
1120
|
+
o("文本文件加载失败"), console.error(h);
|
|
1121
1121
|
} finally {
|
|
1122
|
-
|
|
1122
|
+
c(!1);
|
|
1123
1123
|
}
|
|
1124
1124
|
})();
|
|
1125
|
-
}, [
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */ e(
|
|
1128
|
-
/* @__PURE__ */ e("span", { className: "text-white font-medium", children:
|
|
1129
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-xs text-white/50 uppercase", children:
|
|
1125
|
+
}, [r]), n ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-4 border-white/20 border-t-white rounded-full animate-spin" }) }) : i ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ e("div", { className: "text-white/70 text-center", children: /* @__PURE__ */ e("p", { className: "text-lg", children: i }) }) }) : /* @__PURE__ */ e("div", { className: "w-full h-full overflow-auto p-4 md:p-8", children: /* @__PURE__ */ d("div", { className: "max-w-full md:max-w-6xl mx-auto bg-white/5 backdrop-blur-sm rounded-2xl border border-white/10 overflow-hidden", children: [
|
|
1126
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 md:gap-3 px-4 py-3 md:px-6 md:py-4 bg-white/5 border-b border-white/10", children: [
|
|
1127
|
+
/* @__PURE__ */ e(pe, { className: "w-4 h-4 md:w-5 md:h-5 text-white/70 flex-shrink-0" }),
|
|
1128
|
+
/* @__PURE__ */ e("span", { className: "text-white font-medium text-sm md:text-base truncate", children: t }),
|
|
1129
|
+
/* @__PURE__ */ e("span", { className: "ml-auto text-xs text-white/50 uppercase flex-shrink-0", children: s })
|
|
1130
1130
|
] }),
|
|
1131
|
-
/* @__PURE__ */ e("div", { className: "text-sm", children:
|
|
1132
|
-
|
|
1131
|
+
/* @__PURE__ */ e("div", { className: "text-sm", children: s === "text" ? /* @__PURE__ */ e("pre", { className: "p-6 text-white/90 font-mono whitespace-pre-wrap break-words", children: l }) : /* @__PURE__ */ e(
|
|
1132
|
+
J,
|
|
1133
1133
|
{
|
|
1134
|
-
language:
|
|
1135
|
-
style:
|
|
1134
|
+
language: s,
|
|
1135
|
+
style: K,
|
|
1136
1136
|
showLineNumbers: !0,
|
|
1137
1137
|
customStyle: {
|
|
1138
1138
|
margin: 0,
|
|
@@ -1146,55 +1146,55 @@ const Re = ({
|
|
|
1146
1146
|
color: "rgba(255, 255, 255, 0.3)",
|
|
1147
1147
|
userSelect: "none"
|
|
1148
1148
|
},
|
|
1149
|
-
children:
|
|
1149
|
+
children: l
|
|
1150
1150
|
}
|
|
1151
1151
|
) })
|
|
1152
1152
|
] }) });
|
|
1153
|
-
},
|
|
1154
|
-
fileName:
|
|
1155
|
-
fileType:
|
|
1156
|
-
onDownload:
|
|
1157
|
-
}) => /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */ e("div", { className: "w-32 h-32 rounded-full bg-white/10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */ e("p", { className: "text-xl font-medium mb-2", children:
|
|
1161
|
-
/* @__PURE__ */
|
|
1153
|
+
}, Ge = ({
|
|
1154
|
+
fileName: r,
|
|
1155
|
+
fileType: t,
|
|
1156
|
+
onDownload: l
|
|
1157
|
+
}) => /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center w-full h-full p-8 gap-6", children: [
|
|
1158
|
+
/* @__PURE__ */ e("div", { className: "w-32 h-32 rounded-full bg-white/10 flex items-center justify-center", children: /* @__PURE__ */ e(fe, { className: "w-16 h-16 text-white/70" }) }),
|
|
1159
|
+
/* @__PURE__ */ d("div", { className: "text-white text-center", children: [
|
|
1160
|
+
/* @__PURE__ */ e("p", { className: "text-xl font-medium mb-2", children: r }),
|
|
1161
|
+
/* @__PURE__ */ d("p", { className: "text-white/70", children: [
|
|
1162
1162
|
"不支持预览此文件类型 (",
|
|
1163
|
-
|
|
1163
|
+
t,
|
|
1164
1164
|
")"
|
|
1165
1165
|
] })
|
|
1166
1166
|
] }),
|
|
1167
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ d(
|
|
1168
1168
|
"button",
|
|
1169
1169
|
{
|
|
1170
|
-
onClick:
|
|
1170
|
+
onClick: l,
|
|
1171
1171
|
className: "flex items-center gap-2 px-6 py-3 bg-white/10 hover:bg-white/20 backdrop-blur-sm rounded-lg text-white font-medium transition-all",
|
|
1172
1172
|
children: [
|
|
1173
|
-
/* @__PURE__ */ e(
|
|
1173
|
+
/* @__PURE__ */ e(Y, { className: "w-5 h-5" }),
|
|
1174
1174
|
"下载文件查看"
|
|
1175
1175
|
]
|
|
1176
1176
|
}
|
|
1177
1177
|
)
|
|
1178
|
-
] }),
|
|
1179
|
-
var
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1178
|
+
] }), Ye = (r) => {
|
|
1179
|
+
var n;
|
|
1180
|
+
const t = ((n = r.name.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "", l = r.type.toLowerCase();
|
|
1181
|
+
if (l.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(t))
|
|
1182
1182
|
return "image";
|
|
1183
|
-
if (
|
|
1183
|
+
if (l.includes("pdf") || t === "pdf")
|
|
1184
1184
|
return "pdf";
|
|
1185
|
-
if (
|
|
1185
|
+
if (l.includes("wordprocessingml") || t === "docx")
|
|
1186
1186
|
return "docx";
|
|
1187
|
-
if (
|
|
1187
|
+
if (l.includes("spreadsheetml") || t === "xlsx")
|
|
1188
1188
|
return "xlsx";
|
|
1189
|
-
if (
|
|
1189
|
+
if (l.includes("presentationml") || t === "pptx" || t === "ppt")
|
|
1190
1190
|
return "pptx";
|
|
1191
|
-
if (
|
|
1191
|
+
if (l.startsWith("video/") || ["mp4", "webm", "ogg", "ogv", "mov", "avi", "mkv", "m4v", "3gp", "flv"].includes(t))
|
|
1192
1192
|
return "video";
|
|
1193
|
-
if (
|
|
1193
|
+
if (l.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a", "flac", "aac"].includes(t))
|
|
1194
1194
|
return "audio";
|
|
1195
|
-
if (
|
|
1195
|
+
if (t === "md" || t === "markdown")
|
|
1196
1196
|
return "markdown";
|
|
1197
|
-
const
|
|
1197
|
+
const a = [
|
|
1198
1198
|
"txt",
|
|
1199
1199
|
"log",
|
|
1200
1200
|
"csv",
|
|
@@ -1231,154 +1231,172 @@ const Re = ({
|
|
|
1231
1231
|
"zsh",
|
|
1232
1232
|
"sql"
|
|
1233
1233
|
];
|
|
1234
|
-
return
|
|
1235
|
-
},
|
|
1236
|
-
files:
|
|
1237
|
-
currentIndex:
|
|
1238
|
-
isOpen:
|
|
1239
|
-
onClose:
|
|
1240
|
-
onNavigate:
|
|
1241
|
-
customRenderers:
|
|
1234
|
+
return l.startsWith("text/") || a.includes(t) ? "text" : "unsupported";
|
|
1235
|
+
}, it = ({
|
|
1236
|
+
files: r,
|
|
1237
|
+
currentIndex: t,
|
|
1238
|
+
isOpen: l,
|
|
1239
|
+
onClose: a,
|
|
1240
|
+
onNavigate: n,
|
|
1241
|
+
customRenderers: c = []
|
|
1242
1242
|
}) => {
|
|
1243
|
-
const [i, o] =
|
|
1244
|
-
|
|
1245
|
-
o(1), w(0),
|
|
1246
|
-
}, [
|
|
1247
|
-
if (
|
|
1248
|
-
const
|
|
1249
|
-
return document.body.style.overflow = "hidden",
|
|
1250
|
-
document.body.style.overflow =
|
|
1243
|
+
const [i, o] = f(1), [s, w] = f(0), [h, m] = f(1), [, N] = f(1), [x, b] = f(null), [p, y] = f(null), k = 50, j = q(() => Fe(r), [r]), u = j[t], P = q(() => u ? c.find((v) => v.test(u)) : null, [u, c]), C = u ? Ye(u) : "unsupported";
|
|
1244
|
+
L(() => {
|
|
1245
|
+
o(1), w(0), m(1), N(1);
|
|
1246
|
+
}, [t]), L(() => {
|
|
1247
|
+
if (l) {
|
|
1248
|
+
const v = document.body.style.overflow, F = document.body.style.paddingRight, A = window.innerWidth - document.documentElement.clientWidth;
|
|
1249
|
+
return document.body.style.overflow = "hidden", A > 0 && (document.body.style.paddingRight = `${A}px`), () => {
|
|
1250
|
+
document.body.style.overflow = v, document.body.style.paddingRight = F;
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
|
-
}, [
|
|
1254
|
-
if (!
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1253
|
+
}, [l]), L(() => {
|
|
1254
|
+
if (!l) return;
|
|
1255
|
+
const v = (F) => {
|
|
1256
|
+
F.key === "Escape" ? a() : F.key === "ArrowLeft" && t > 0 ? n == null || n(t - 1) : F.key === "ArrowRight" && t < j.length - 1 && (n == null || n(t + 1));
|
|
1257
1257
|
};
|
|
1258
|
-
return window.addEventListener("keydown",
|
|
1259
|
-
}, [
|
|
1260
|
-
const
|
|
1261
|
-
o((
|
|
1258
|
+
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
1259
|
+
}, [l, t, j.length, a, n]);
|
|
1260
|
+
const g = M(() => {
|
|
1261
|
+
o((v) => Math.min(v + 0.25, 10));
|
|
1262
|
+
}, []), S = M(() => {
|
|
1263
|
+
o((v) => Math.max(v - 0.25, 0.01));
|
|
1262
1264
|
}, []), T = M(() => {
|
|
1263
|
-
|
|
1264
|
-
}, []), L = M(() => {
|
|
1265
|
-
w((y) => y + 90);
|
|
1266
|
-
}, []), R = M(() => {
|
|
1267
|
-
w((y) => y - 90);
|
|
1265
|
+
w((v) => v + 90);
|
|
1268
1266
|
}, []), z = M(() => {
|
|
1267
|
+
w((v) => v - 90);
|
|
1268
|
+
}, []), D = M(() => {
|
|
1269
1269
|
o(1), w(0);
|
|
1270
|
-
}, []),
|
|
1270
|
+
}, []), H = M(() => {
|
|
1271
1271
|
o(1);
|
|
1272
|
-
}, []),
|
|
1273
|
-
o(
|
|
1274
|
-
}, []),
|
|
1272
|
+
}, []), Q = M((v) => {
|
|
1273
|
+
o(v);
|
|
1274
|
+
}, []), I = M(() => {
|
|
1275
1275
|
o(1), w(0);
|
|
1276
|
-
}, []),
|
|
1277
|
-
if (!
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
}, [
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1276
|
+
}, []), X = M(() => {
|
|
1277
|
+
if (!u) return;
|
|
1278
|
+
const v = document.createElement("a");
|
|
1279
|
+
v.href = u.url, v.download = u.name, v.click();
|
|
1280
|
+
}, [u]), ee = M((v) => {
|
|
1281
|
+
y(null), b(v.targetTouches[0].clientX);
|
|
1282
|
+
}, []), te = M((v) => {
|
|
1283
|
+
y(v.targetTouches[0].clientX);
|
|
1284
|
+
}, []), re = M(() => {
|
|
1285
|
+
if (!x || !p) return;
|
|
1286
|
+
const v = x - p, F = v > k, A = v < -k;
|
|
1287
|
+
F && t < j.length - 1 && (n == null || n(t + 1)), A && t > 0 && (n == null || n(t - 1));
|
|
1288
|
+
}, [x, p, k, t, j.length, n]);
|
|
1289
|
+
if (!l || !u) return null;
|
|
1290
|
+
const O = C === "image" || C === "pdf", V = C === "image", oe = /* @__PURE__ */ e(ne, { children: l && /* @__PURE__ */ e(
|
|
1291
|
+
B.div,
|
|
1284
1292
|
{
|
|
1285
1293
|
initial: { opacity: 0 },
|
|
1286
1294
|
animate: { opacity: 1 },
|
|
1287
1295
|
exit: { opacity: 0 },
|
|
1288
1296
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-md overflow-hidden",
|
|
1289
|
-
onClick:
|
|
1290
|
-
onWheel: (
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1297
|
+
onClick: a,
|
|
1298
|
+
onWheel: (v) => v.stopPropagation(),
|
|
1299
|
+
children: /* @__PURE__ */ d(
|
|
1292
1300
|
"div",
|
|
1293
1301
|
{
|
|
1294
1302
|
className: "relative w-full h-full flex flex-col overflow-hidden",
|
|
1295
|
-
onClick: (
|
|
1303
|
+
onClick: (v) => v.stopPropagation(),
|
|
1296
1304
|
children: [
|
|
1297
1305
|
/* @__PURE__ */ e(
|
|
1298
|
-
|
|
1306
|
+
B.div,
|
|
1299
1307
|
{
|
|
1300
1308
|
initial: { y: -100 },
|
|
1301
1309
|
animate: { y: 0 },
|
|
1302
1310
|
exit: { y: -100 },
|
|
1303
1311
|
className: "absolute top-0 left-0 right-0 z-10 p-4",
|
|
1304
|
-
children: /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
+
children: /* @__PURE__ */ d("div", { className: "max-w-7xl mx-auto flex flex-col md:flex-row md:items-center md:justify-between bg-black/40 backdrop-blur-xl rounded-2xl px-3 md:px-6 py-3 md:py-4 shadow-2xl border border-white/10 gap-2 md:gap-0", children: [
|
|
1313
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between md:flex-1 md:min-w-0 md:mr-4", children: [
|
|
1314
|
+
/* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
|
|
1315
|
+
/* @__PURE__ */ e("h2", { className: "text-white font-medium text-sm md:text-lg truncate", children: u.name }),
|
|
1316
|
+
/* @__PURE__ */ d("p", { className: "text-white/60 text-xs md:text-sm", children: [
|
|
1317
|
+
t + 1,
|
|
1318
|
+
" / ",
|
|
1319
|
+
j.length
|
|
1320
|
+
] })
|
|
1321
|
+
] }),
|
|
1322
|
+
/* @__PURE__ */ e("div", { className: "md:hidden ml-2", children: /* @__PURE__ */ e(
|
|
1323
|
+
E,
|
|
1324
|
+
{
|
|
1325
|
+
icon: /* @__PURE__ */ e(Z, { className: "w-5 h-5" }),
|
|
1326
|
+
label: "关闭",
|
|
1327
|
+
onClick: a
|
|
1328
|
+
}
|
|
1329
|
+
) })
|
|
1312
1330
|
] }),
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
|
|
1331
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-1 md:gap-2 overflow-x-auto scrollbar-hide flex-shrink-0", children: [
|
|
1332
|
+
O && /* @__PURE__ */ d($, { children: [
|
|
1315
1333
|
/* @__PURE__ */ e(
|
|
1316
1334
|
E,
|
|
1317
1335
|
{
|
|
1318
|
-
icon: /* @__PURE__ */ e(
|
|
1336
|
+
icon: /* @__PURE__ */ e(xe, { className: "w-5 h-5" }),
|
|
1319
1337
|
label: "缩小",
|
|
1320
|
-
onClick:
|
|
1321
|
-
disabled: i <= 0.
|
|
1338
|
+
onClick: S,
|
|
1339
|
+
disabled: i <= 0.01
|
|
1322
1340
|
}
|
|
1323
1341
|
),
|
|
1324
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ d("span", { className: "text-white/70 text-sm min-w-[4rem] text-center font-medium", children: [
|
|
1325
1343
|
Math.round(i * 100),
|
|
1326
1344
|
"%"
|
|
1327
1345
|
] }),
|
|
1328
1346
|
/* @__PURE__ */ e(
|
|
1329
1347
|
E,
|
|
1330
1348
|
{
|
|
1331
|
-
icon: /* @__PURE__ */ e(
|
|
1349
|
+
icon: /* @__PURE__ */ e(we, { className: "w-5 h-5" }),
|
|
1332
1350
|
label: "放大",
|
|
1333
|
-
onClick:
|
|
1334
|
-
disabled: i >=
|
|
1351
|
+
onClick: g,
|
|
1352
|
+
disabled: i >= 10
|
|
1335
1353
|
}
|
|
1336
1354
|
),
|
|
1337
1355
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/20 mx-2" }),
|
|
1338
1356
|
/* @__PURE__ */ e(
|
|
1339
1357
|
E,
|
|
1340
1358
|
{
|
|
1341
|
-
icon: /* @__PURE__ */ e(
|
|
1359
|
+
icon: /* @__PURE__ */ e(ge, { className: "w-5 h-5" }),
|
|
1342
1360
|
label: "适应窗口",
|
|
1343
|
-
onClick:
|
|
1361
|
+
onClick: D
|
|
1344
1362
|
}
|
|
1345
1363
|
),
|
|
1346
1364
|
/* @__PURE__ */ e(
|
|
1347
1365
|
E,
|
|
1348
1366
|
{
|
|
1349
|
-
icon: /* @__PURE__ */ e(
|
|
1367
|
+
icon: /* @__PURE__ */ e(be, { className: "w-5 h-5" }),
|
|
1350
1368
|
label: "原始尺寸",
|
|
1351
|
-
onClick:
|
|
1369
|
+
onClick: H
|
|
1352
1370
|
}
|
|
1353
1371
|
),
|
|
1354
1372
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/20 mx-2" })
|
|
1355
1373
|
] }),
|
|
1356
|
-
|
|
1374
|
+
V && /* @__PURE__ */ d($, { children: [
|
|
1357
1375
|
/* @__PURE__ */ e(
|
|
1358
1376
|
E,
|
|
1359
1377
|
{
|
|
1360
|
-
icon: /* @__PURE__ */ e(
|
|
1378
|
+
icon: /* @__PURE__ */ e(ve, { className: "w-5 h-5" }),
|
|
1361
1379
|
label: "向左旋转",
|
|
1362
|
-
onClick:
|
|
1380
|
+
onClick: z
|
|
1363
1381
|
}
|
|
1364
1382
|
),
|
|
1365
1383
|
/* @__PURE__ */ e(
|
|
1366
1384
|
E,
|
|
1367
1385
|
{
|
|
1368
|
-
icon: /* @__PURE__ */ e(
|
|
1386
|
+
icon: /* @__PURE__ */ e(ye, { className: "w-5 h-5" }),
|
|
1369
1387
|
label: "向右旋转",
|
|
1370
|
-
onClick:
|
|
1388
|
+
onClick: T
|
|
1371
1389
|
}
|
|
1372
1390
|
),
|
|
1373
1391
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/20 mx-2" })
|
|
1374
1392
|
] }),
|
|
1375
|
-
(
|
|
1393
|
+
(O || V) && /* @__PURE__ */ d($, { children: [
|
|
1376
1394
|
/* @__PURE__ */ e(
|
|
1377
1395
|
E,
|
|
1378
1396
|
{
|
|
1379
|
-
icon: /* @__PURE__ */ e(
|
|
1397
|
+
icon: /* @__PURE__ */ e(Ne, { className: "w-5 h-5" }),
|
|
1380
1398
|
label: "复原",
|
|
1381
|
-
onClick:
|
|
1399
|
+
onClick: I
|
|
1382
1400
|
}
|
|
1383
1401
|
),
|
|
1384
1402
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/20 mx-2" })
|
|
@@ -1386,84 +1404,95 @@ const Re = ({
|
|
|
1386
1404
|
/* @__PURE__ */ e(
|
|
1387
1405
|
E,
|
|
1388
1406
|
{
|
|
1389
|
-
icon: /* @__PURE__ */ e(
|
|
1407
|
+
icon: /* @__PURE__ */ e(Y, { className: "w-5 h-5" }),
|
|
1390
1408
|
label: "下载",
|
|
1391
|
-
onClick:
|
|
1409
|
+
onClick: X
|
|
1392
1410
|
}
|
|
1393
1411
|
),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1412
|
+
/* @__PURE__ */ d("div", { className: "hidden md:flex items-center", children: [
|
|
1413
|
+
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/20 mx-2" }),
|
|
1414
|
+
/* @__PURE__ */ e(
|
|
1415
|
+
E,
|
|
1416
|
+
{
|
|
1417
|
+
icon: /* @__PURE__ */ e(Z, { className: "w-5 h-5" }),
|
|
1418
|
+
label: "关闭",
|
|
1419
|
+
onClick: a
|
|
1420
|
+
}
|
|
1421
|
+
)
|
|
1422
|
+
] })
|
|
1403
1423
|
] })
|
|
1404
1424
|
] })
|
|
1405
1425
|
}
|
|
1406
1426
|
),
|
|
1407
|
-
/* @__PURE__ */ e(
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1427
|
+
/* @__PURE__ */ e(
|
|
1428
|
+
"div",
|
|
1429
|
+
{
|
|
1430
|
+
className: "flex-1 flex items-center justify-center pt-32 md:pt-24 pb-4 md:pb-8 overflow-auto",
|
|
1431
|
+
onTouchStart: ee,
|
|
1432
|
+
onTouchMove: te,
|
|
1433
|
+
onTouchEnd: re,
|
|
1434
|
+
children: P ? (
|
|
1435
|
+
// 使用自定义渲染器
|
|
1436
|
+
P.render(u)
|
|
1437
|
+
) : /* @__PURE__ */ d($, { children: [
|
|
1438
|
+
C === "image" && /* @__PURE__ */ e(
|
|
1439
|
+
$e,
|
|
1440
|
+
{
|
|
1441
|
+
url: u.url,
|
|
1442
|
+
zoom: i,
|
|
1443
|
+
rotation: s,
|
|
1444
|
+
onZoomChange: Q
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
C === "pdf" && /* @__PURE__ */ e(
|
|
1448
|
+
Be,
|
|
1449
|
+
{
|
|
1450
|
+
url: u.url,
|
|
1451
|
+
zoom: i,
|
|
1452
|
+
currentPage: h,
|
|
1453
|
+
onPageChange: m,
|
|
1454
|
+
onTotalPagesChange: N
|
|
1455
|
+
}
|
|
1456
|
+
),
|
|
1457
|
+
C === "docx" && /* @__PURE__ */ e(He, { url: u.url }),
|
|
1458
|
+
C === "xlsx" && /* @__PURE__ */ e(Ae, { url: u.url }),
|
|
1459
|
+
C === "pptx" && /* @__PURE__ */ e(Ue, { url: u.url }),
|
|
1460
|
+
C === "video" && /* @__PURE__ */ e(Oe, { url: u.url }),
|
|
1461
|
+
C === "audio" && /* @__PURE__ */ e(Ve, { url: u.url, fileName: u.name }),
|
|
1462
|
+
C === "markdown" && /* @__PURE__ */ e(qe, { url: u.url }),
|
|
1463
|
+
C === "text" && /* @__PURE__ */ e(_e, { url: u.url, fileName: u.name }),
|
|
1464
|
+
C === "unsupported" && /* @__PURE__ */ e(
|
|
1465
|
+
Ge,
|
|
1466
|
+
{
|
|
1467
|
+
fileName: u.name,
|
|
1468
|
+
fileType: u.type,
|
|
1469
|
+
onDownload: X
|
|
1470
|
+
}
|
|
1471
|
+
)
|
|
1472
|
+
] })
|
|
1473
|
+
}
|
|
1474
|
+
),
|
|
1475
|
+
j.length > 1 && /* @__PURE__ */ d($, { children: [
|
|
1476
|
+
t > 0 && /* @__PURE__ */ e(
|
|
1477
|
+
B.button,
|
|
1449
1478
|
{
|
|
1450
1479
|
initial: { x: -100, opacity: 0 },
|
|
1451
1480
|
animate: { x: 0, opacity: 1 },
|
|
1452
1481
|
exit: { x: -100, opacity: 0 },
|
|
1453
|
-
onClick: () =>
|
|
1454
|
-
className: "absolute left-4 top-1/2 -translate-y-1/2 w-12 h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-white hover:bg-black/60 transition-all shadow-2xl",
|
|
1455
|
-
children: /* @__PURE__ */ e(
|
|
1482
|
+
onClick: () => n == null ? void 0 : n(t - 1),
|
|
1483
|
+
className: "absolute left-2 md:left-4 top-1/2 -translate-y-1/2 w-10 h-10 md:w-12 md:h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-white hover:bg-black/60 transition-all shadow-2xl",
|
|
1484
|
+
children: /* @__PURE__ */ e(ke, { className: "w-5 h-5 md:w-6 md:h-6" })
|
|
1456
1485
|
}
|
|
1457
1486
|
),
|
|
1458
|
-
|
|
1459
|
-
|
|
1487
|
+
t < j.length - 1 && /* @__PURE__ */ e(
|
|
1488
|
+
B.button,
|
|
1460
1489
|
{
|
|
1461
1490
|
initial: { x: 100, opacity: 0 },
|
|
1462
1491
|
animate: { x: 0, opacity: 1 },
|
|
1463
1492
|
exit: { x: 100, opacity: 0 },
|
|
1464
|
-
onClick: () =>
|
|
1465
|
-
className: "absolute right-4 top-1/2 -translate-y-1/2 w-12 h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-white hover:bg-black/60 transition-all shadow-2xl",
|
|
1466
|
-
children: /* @__PURE__ */ e(
|
|
1493
|
+
onClick: () => n == null ? void 0 : n(t + 1),
|
|
1494
|
+
className: "absolute right-2 md:right-4 top-1/2 -translate-y-1/2 w-10 h-10 md:w-12 md:h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-white hover:bg-black/60 transition-all shadow-2xl",
|
|
1495
|
+
children: /* @__PURE__ */ e(je, { className: "w-5 h-5 md:w-6 md:h-6" })
|
|
1467
1496
|
}
|
|
1468
1497
|
)
|
|
1469
1498
|
] })
|
|
@@ -1472,23 +1501,23 @@ const Re = ({
|
|
|
1472
1501
|
)
|
|
1473
1502
|
}
|
|
1474
1503
|
) });
|
|
1475
|
-
return
|
|
1476
|
-
}, E = ({ icon:
|
|
1504
|
+
return le(oe, document.body);
|
|
1505
|
+
}, E = ({ icon: r, label: t, onClick: l, disabled: a }) => /* @__PURE__ */ e(
|
|
1477
1506
|
"button",
|
|
1478
1507
|
{
|
|
1479
|
-
onClick:
|
|
1480
|
-
disabled:
|
|
1481
|
-
title:
|
|
1482
|
-
className: `p-2 rounded-lg transition-all ${
|
|
1483
|
-
children:
|
|
1508
|
+
onClick: l,
|
|
1509
|
+
disabled: a,
|
|
1510
|
+
title: t,
|
|
1511
|
+
className: `p-2 rounded-lg transition-all ${a ? "text-white/30 cursor-not-allowed" : "text-white hover:bg-white/10 active:bg-white/20"}`,
|
|
1512
|
+
children: r
|
|
1484
1513
|
}
|
|
1485
|
-
),
|
|
1514
|
+
), ct = Ee.version;
|
|
1486
1515
|
export {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1516
|
+
it as FilePreviewModal,
|
|
1517
|
+
ct as VERSION,
|
|
1518
|
+
We as configurePdfjs,
|
|
1519
|
+
ze as normalizeFile,
|
|
1520
|
+
Fe as normalizeFiles,
|
|
1521
|
+
ut as pdfjs
|
|
1493
1522
|
};
|
|
1494
1523
|
//# sourceMappingURL=index.mjs.map
|