@eternalheart/vue-file-preview 1.6.13 → 1.7.0
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 +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/FilePreviewContent.vue.d.ts +17 -6
- package/lib/FilePreviewEmbed.vue.d.ts +14 -6
- package/lib/FilePreviewModal.vue.d.ts +14 -6
- package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs → EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs} +1 -1
- package/lib/chunks/{avifLoader-CAUzjn-d-C0KRpetN.mjs → avifLoader-CAUzjn-d-CnJpGYJ2.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-Czof_5FJ.mjs → heicLoader-D_9PukkA-g_dLrWLP.mjs} +1 -1
- package/lib/chunks/index-6XZXYqbp.mjs +125 -0
- package/lib/chunks/{index-B21EAyWz.mjs → index-BPSzwMOC.mjs} +51 -51
- package/lib/chunks/index-BYQ9S7Mk.mjs +104 -0
- package/lib/chunks/{index-8Vpbg2kS.mjs → index-Bf94DwQu.mjs} +105 -104
- package/lib/chunks/index-BfOWoMpY.mjs +359 -0
- package/lib/chunks/index-Bg8poMIm.mjs +117 -0
- package/lib/chunks/index-BzwJ0VWu.mjs +108 -0
- package/lib/chunks/index-C41YET0_.mjs +51 -0
- package/lib/chunks/{index-BvBqDq3O.mjs → index-C4hIk6pa.mjs} +2023 -2023
- package/lib/chunks/{index-BASg1cr4.mjs → index-C8lyQPe3.mjs} +1018 -1018
- package/lib/chunks/{index-C9mAajbD.mjs → index-CWPdNhoe.mjs} +200 -200
- package/lib/chunks/{index-BuqPb5mP.mjs → index-CrVQPnFj.mjs} +112 -112
- package/lib/chunks/{index-D30L8tm9.mjs → index-D5IF9F-D.mjs} +57 -57
- package/lib/chunks/{index-DN4Ui0Gh.mjs → index-DFeKS8tR.mjs} +120 -120
- package/lib/chunks/index-DM8Dfl-m.mjs +52 -0
- package/lib/chunks/index-DZe0BxAB.mjs +90 -0
- package/lib/chunks/{index-BlrFFeqc.mjs → index-GFcSJEwj.mjs} +75 -75
- package/lib/chunks/{index-Dkro_8Fy.mjs → index-LPGxJDnT.mjs} +32 -32
- package/lib/chunks/index-aKiIuKKx.mjs +157 -0
- package/lib/chunks/{index-DZZN3kYi.mjs → index-c-pYJEmH.mjs} +1589 -1394
- package/lib/chunks/{index-CxKZKUJj.mjs → index-z9RqL2wI.mjs} +1651 -1651
- package/lib/chunks/index-zLQlyNR2.mjs +383 -0
- package/lib/chunks/{jp2Loader-Dig19xyo-CKUaGhPl.mjs → jp2Loader-Dig19xyo-fCO1knZ0.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-CYWoQis5.mjs → psdLoader-C0tKUXXl-DihMskai.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-C35zC8nZ.mjs → rawLoader-C-tPeFAB-BSfDPl-z.mjs} +5 -5
- package/lib/chunks/{tiffLoader-BlhByX8w-BOxg_Du5.mjs → tiffLoader-BlhByX8w-JY5DaTre.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-BPmcxA-h.mjs → useShikiHighlight-C-ztcJBE.mjs} +1 -1
- package/lib/composables/useAudioPlayer.d.ts +1 -1
- package/lib/composables/usePreviewEvents.d.ts +27 -0
- package/lib/composables/useRequest.d.ts +16 -4
- package/lib/composables/useThemeMode.d.ts +1 -1
- package/lib/composables/useTranslator.d.ts +2 -2
- package/lib/core/events.d.ts +52 -0
- package/lib/core/i18n/index.d.ts +29 -0
- package/lib/core/i18n/messages/en-US.d.ts +5 -0
- package/lib/core/i18n/messages/index.d.ts +9 -0
- package/lib/core/i18n/messages/zh-CN.d.ts +5 -0
- package/lib/core/i18n/types.d.ts +23 -0
- package/lib/core/index.d.ts +34 -0
- package/lib/core/loaders/avifLoader.d.ts +22 -0
- package/lib/core/loaders/heicLoader.d.ts +21 -0
- package/lib/core/loaders/jp2Loader.d.ts +16 -0
- package/lib/core/loaders/jp2Worker.d.ts +1 -0
- package/lib/core/loaders/psdLoader.d.ts +14 -0
- package/lib/core/loaders/rawLoader.d.ts +14 -0
- package/lib/core/loaders/registry.d.ts +32 -0
- package/lib/core/loaders/tiffLoader.d.ts +28 -0
- package/lib/core/loaders/types.d.ts +56 -0
- package/lib/core/types.d.ts +89 -0
- package/lib/core/utils/csvParser.d.ts +31 -0
- package/lib/core/utils/emptyState.d.ts +28 -0
- package/lib/core/utils/excelDataConverter.d.ts +61 -0
- package/lib/core/utils/fileNormalizer.d.ts +21 -0
- package/lib/core/utils/fileType.d.ts +21 -0
- package/lib/core/utils/legacy-office/doc.d.ts +25 -0
- package/lib/core/utils/legacy-office/index.d.ts +8 -0
- package/lib/core/utils/legacy-office/ole.d.ts +8 -0
- package/lib/core/utils/legacy-office/ppt.d.ts +79 -0
- package/lib/core/utils/legacy-office/xls.d.ts +28 -0
- package/lib/core/utils/mimeTypes.d.ts +29 -0
- package/lib/core/utils/ooxml/docx.d.ts +17 -0
- package/lib/core/utils/ooxml/index.d.ts +4 -0
- package/lib/core/utils/ooxml/pptx.d.ts +7 -0
- package/lib/core/utils/ooxml/xml.d.ts +15 -0
- package/lib/core/utils/ooxml/zip.d.ts +3 -0
- package/lib/core/utils/pdfWorker.d.ts +61 -0
- package/lib/core/utils/previewMode.d.ts +7 -0
- package/lib/core/utils/request.d.ts +49 -0
- package/lib/core/utils/subtitleParser.d.ts +44 -0
- package/lib/core/utils/textDecoder.d.ts +30 -0
- package/lib/core/utils/uint8ArrayPolyfill.d.ts +18 -0
- package/lib/core/utils/zipReader.d.ts +51 -0
- package/lib/core/workers/imageDecoder.worker.d.ts +31 -0
- package/lib/core/workers/workerClient.d.ts +14 -0
- package/lib/i18n/localeKey.d.ts +1 -1
- package/lib/index.cjs +60 -60
- package/lib/index.css +1 -1
- package/lib/index.d.ts +11 -9
- package/lib/index.mjs +15 -12
- package/lib/renderers/Audio/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/toolbar.d.ts +2 -2
- package/lib/renderers/Csv/index.vue.d.ts +1 -1
- package/lib/renderers/Doc/index.vue.d.ts +1 -1
- package/lib/renderers/Docx/index.vue.d.ts +1 -1
- package/lib/renderers/Epub/index.vue.d.ts +1 -1
- package/lib/renderers/Font/index.vue.d.ts +1 -1
- package/lib/renderers/Image/index.vue.d.ts +2 -2
- package/lib/renderers/Json/index.vue.d.ts +2 -2
- package/lib/renderers/Markdown/index.vue.d.ts +1 -1
- package/lib/renderers/Mobi/index.vue.d.ts +1 -1
- package/lib/renderers/Msg/index.vue.d.ts +1 -1
- package/lib/renderers/Pdf/index.vue.d.ts +1 -1
- package/lib/renderers/Ppt/index.vue.d.ts +1 -1
- package/lib/renderers/Pptx/index.vue.d.ts +2 -2
- package/lib/renderers/Subtitle/index.vue.d.ts +1 -1
- package/lib/renderers/Text/index.vue.d.ts +2 -2
- package/lib/renderers/Unsupported/index.vue.d.ts +1 -1
- package/lib/renderers/Video/index.vue.d.ts +1 -1
- package/lib/renderers/Xlsx/index.vue.d.ts +2 -2
- package/lib/renderers/Xml/index.vue.d.ts +1 -1
- package/lib/renderers/Zip/TreeItem.vue.d.ts +1 -1
- package/lib/renderers/Zip/index.vue.d.ts +1 -1
- package/lib/renderers/base.types.d.ts +1 -1
- package/lib/renderers/registry.d.ts +1 -1
- package/lib/types.d.ts +3 -3
- package/package.json +2 -2
- package/lib/chunks/index--612Smof.mjs +0 -383
- package/lib/chunks/index-BB0i4QqI.mjs +0 -117
- package/lib/chunks/index-BVdrGK3Q.mjs +0 -356
- package/lib/chunks/index-Bp9CuvMZ.mjs +0 -157
- package/lib/chunks/index-Bxpf9v5j.mjs +0 -104
- package/lib/chunks/index-CDg6vIbT.mjs +0 -51
- package/lib/chunks/index-CWE-hKSs.mjs +0 -90
- package/lib/chunks/index-CY3xzGgt.mjs +0 -108
- package/lib/chunks/index-VdzIFJJW.mjs +0 -118
- package/lib/chunks/index-aoXgVLBb.mjs +0 -52
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ref as f, watch as
|
|
1
|
+
import { ref as f, watch as G, onUnmounted as O, defineComponent as W, toRef as X, computed as D, onMounted as K, onBeforeUnmount as Q, unref as e, openBlock as _, createBlock as N, createElementBlock as H, createElementVNode as a, normalizeClass as I, createVNode as T, toDisplayString as j, normalizeStyle as J, resolveDynamicComponent as Y, Transition as Z, withCtx as ee, createCommentVNode as te } from "vue";
|
|
2
2
|
import { VolumeX as ae, Volume1 as oe, Volume2 as ne, AudioLines as le, Pause as se, Play as re, SkipBack as ie, SkipForward as fe, Repeat as ve } from "lucide-vue-next";
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
function
|
|
6
|
-
const v = f(null), y = f(!1), p = f(!0), n = f(0),
|
|
3
|
+
import { b as ue, B as pe, J as de, u as ce } from "./index-c-pYJEmH.mjs";
|
|
4
|
+
import { _ as me } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
5
|
+
function ge(x) {
|
|
6
|
+
const v = f(null), y = f(!1), p = f(!0), n = f(0), P = f(0), m = f(1), g = f(!1), h = f(!1), u = f(null), d = ue();
|
|
7
7
|
let r = null;
|
|
8
|
-
const
|
|
8
|
+
const L = () => {
|
|
9
9
|
const t = v.value;
|
|
10
10
|
if (!t) return;
|
|
11
|
-
p.value = !0, u.value = null;
|
|
11
|
+
d.begin(x.value), p.value = !0, u.value = null;
|
|
12
12
|
const l = () => {
|
|
13
13
|
isNaN(t.currentTime) || (n.value = t.currentTime);
|
|
14
14
|
}, s = () => {
|
|
15
|
-
!isNaN(t.duration) && isFinite(t.duration) && (
|
|
16
|
-
}, c = () => {
|
|
17
|
-
p.value = !1, s();
|
|
15
|
+
!isNaN(t.duration) && isFinite(t.duration) && (P.value = t.duration);
|
|
18
16
|
}, b = () => {
|
|
19
|
-
p.value = !
|
|
17
|
+
p.value = !1, s();
|
|
20
18
|
}, w = () => {
|
|
19
|
+
p.value = !0;
|
|
20
|
+
}, c = () => {
|
|
21
21
|
p.value = !1, y.value = !0;
|
|
22
|
-
}, m = () => {
|
|
23
|
-
y.value = !0;
|
|
24
22
|
}, k = () => {
|
|
25
|
-
y.value = !
|
|
23
|
+
y.value = !0;
|
|
26
24
|
}, M = () => {
|
|
27
25
|
y.value = !1;
|
|
28
|
-
},
|
|
29
|
-
|
|
26
|
+
}, C = () => {
|
|
27
|
+
y.value = !1;
|
|
28
|
+
}, E = () => {
|
|
29
|
+
u.value = "audio.load_failed", p.value = !1, d.error(new de("audio.load_failed"), "request");
|
|
30
30
|
};
|
|
31
|
-
t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay",
|
|
32
|
-
t.removeEventListener("timeupdate", l), t.removeEventListener("loadedmetadata", s), t.removeEventListener("durationchange", s), t.removeEventListener("canplay",
|
|
31
|
+
t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay", b), t.addEventListener("waiting", w), t.addEventListener("playing", c), t.addEventListener("play", k), t.addEventListener("pause", M), t.addEventListener("ended", C), t.addEventListener("error", E), t.readyState >= 3 ? (p.value = !1, s()) : t.readyState >= 1 && s(), r = () => {
|
|
32
|
+
t.removeEventListener("timeupdate", l), t.removeEventListener("loadedmetadata", s), t.removeEventListener("durationchange", s), t.removeEventListener("canplay", b), t.removeEventListener("waiting", w), t.removeEventListener("playing", c), t.removeEventListener("play", k), t.removeEventListener("pause", M), t.removeEventListener("ended", C), t.removeEventListener("error", E);
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
return
|
|
36
|
-
|
|
35
|
+
return G(
|
|
36
|
+
x,
|
|
37
37
|
() => {
|
|
38
|
-
r == null || r(), r = null, requestAnimationFrame(() =>
|
|
38
|
+
r == null || r(), r = null, requestAnimationFrame(() => L());
|
|
39
39
|
},
|
|
40
40
|
{ flush: "post" }
|
|
41
|
-
),
|
|
41
|
+
), G(
|
|
42
42
|
v,
|
|
43
43
|
(t) => {
|
|
44
|
-
t &&
|
|
44
|
+
t && L();
|
|
45
45
|
},
|
|
46
46
|
{ flush: "post" }
|
|
47
|
-
),
|
|
47
|
+
), O(() => {
|
|
48
48
|
r == null || r(), r = null;
|
|
49
49
|
}), {
|
|
50
50
|
audioRef: v,
|
|
@@ -52,9 +52,9 @@ function ce(L) {
|
|
|
52
52
|
isLoading: p,
|
|
53
53
|
isLoop: h,
|
|
54
54
|
currentTime: n,
|
|
55
|
-
duration:
|
|
56
|
-
volume:
|
|
57
|
-
isMuted:
|
|
55
|
+
duration: P,
|
|
56
|
+
volume: m,
|
|
57
|
+
isMuted: g,
|
|
58
58
|
error: u,
|
|
59
59
|
togglePlay: () => {
|
|
60
60
|
const t = v.value;
|
|
@@ -76,11 +76,11 @@ function ce(L) {
|
|
|
76
76
|
const l = v.value;
|
|
77
77
|
if (!l) return;
|
|
78
78
|
const s = Math.max(0, Math.min(1, t));
|
|
79
|
-
l.volume = s,
|
|
79
|
+
l.volume = s, m.value = s, s > 0 && (l.muted = !1, g.value = !1);
|
|
80
80
|
},
|
|
81
81
|
toggleMute: () => {
|
|
82
82
|
const t = v.value;
|
|
83
|
-
t && (t.muted = !t.muted,
|
|
83
|
+
t && (t.muted = !t.muted, g.value = t.muted);
|
|
84
84
|
},
|
|
85
85
|
toggleLoop: () => {
|
|
86
86
|
const t = v.value;
|
|
@@ -88,87 +88,87 @@ function ce(L) {
|
|
|
88
88
|
const l = !t.loop;
|
|
89
89
|
t.loop = l, h.value = l;
|
|
90
90
|
},
|
|
91
|
-
formatTime:
|
|
91
|
+
formatTime: pe
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const xe = {
|
|
95
95
|
key: 1,
|
|
96
96
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-4 vfp-select-none vfp-overflow-auto"
|
|
97
|
-
},
|
|
97
|
+
}, ye = { class: "vfp-w-full vfp-max-w-xl vfp-flex-shrink-0 vfp-rounded-lg vfp-border vfp-border-line-weak vfp-bg-surface-1 vfp-p-4" }, he = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, be = { class: "vfp-min-w-0 vfp-flex-1 vfp-truncate vfp-text-sm vfp-font-medium vfp-text-fg-primary" }, we = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, ke = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-right vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, _e = { class: "vfp-relative vfp-h-4 vfp-flex vfp-flex-1 vfp-items-center" }, Le = { class: "vfp-absolute vfp-left-[6px] vfp-right-[6px] vfp-h-[3px] vfp-rounded-full vfp-bg-surface-3" }, Ee = ["max", "value", "disabled", "aria-label"], Te = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, Pe = { class: "vfp-flex vfp-items-center vfp-gap-1" }, Me = ["title", "aria-label"], Ce = ["title", "aria-label"], Ve = ["title", "aria-label"], Ne = ["title", "aria-label"], je = ["title", "aria-label"], Re = {
|
|
98
98
|
class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-2",
|
|
99
99
|
style: { height: "100px" }
|
|
100
|
-
},
|
|
100
|
+
}, Be = {
|
|
101
101
|
class: "vfp-relative vfp-flex vfp-items-center vfp-justify-center",
|
|
102
102
|
style: { width: "24px", height: "80px" }
|
|
103
|
-
},
|
|
103
|
+
}, Fe = ["value", "aria-label"], Se = { class: "vfp-text-[10px] vfp-tabular-nums vfp-text-fg-tertiary" }, $e = ["src"], ze = /* @__PURE__ */ W({
|
|
104
104
|
__name: "index",
|
|
105
105
|
props: {
|
|
106
106
|
url: {},
|
|
107
107
|
fileName: {}
|
|
108
108
|
},
|
|
109
|
-
setup(
|
|
110
|
-
const p =
|
|
111
|
-
audioRef:
|
|
112
|
-
isPlaying:
|
|
113
|
-
isLoop:
|
|
109
|
+
setup(x, { expose: v }) {
|
|
110
|
+
const p = X(x, "url"), { t: n } = ce(), {
|
|
111
|
+
audioRef: P,
|
|
112
|
+
isPlaying: m,
|
|
113
|
+
isLoop: g,
|
|
114
114
|
currentTime: h,
|
|
115
115
|
duration: u,
|
|
116
|
-
volume:
|
|
117
|
-
isMuted:
|
|
118
|
-
error:
|
|
116
|
+
volume: d,
|
|
117
|
+
isMuted: r,
|
|
118
|
+
error: L,
|
|
119
119
|
togglePlay: R,
|
|
120
|
-
seek:
|
|
120
|
+
seek: B,
|
|
121
121
|
skip: F,
|
|
122
|
-
setVolume:
|
|
123
|
-
toggleMute:
|
|
124
|
-
toggleLoop:
|
|
125
|
-
formatTime:
|
|
126
|
-
} =
|
|
127
|
-
let
|
|
128
|
-
const k =
|
|
129
|
-
w.value && !w.value.contains(
|
|
122
|
+
setVolume: A,
|
|
123
|
+
toggleMute: S,
|
|
124
|
+
toggleLoop: $,
|
|
125
|
+
formatTime: t
|
|
126
|
+
} = ge(p), l = f(!1), s = f(!1), b = f(0), w = f(null);
|
|
127
|
+
let c = null;
|
|
128
|
+
const k = D(() => s.value ? b.value : h.value), M = D(() => u.value > 0 ? k.value / u.value : 0), C = D(() => r.value || d.value === 0 ? ae : d.value < 0.5 ? oe : ne), E = (z) => {
|
|
129
|
+
w.value && !w.value.contains(z.target) && (l.value = !1);
|
|
130
130
|
};
|
|
131
131
|
K(() => {
|
|
132
|
-
document.addEventListener("mousedown",
|
|
132
|
+
document.addEventListener("mousedown", E);
|
|
133
133
|
}), Q(() => {
|
|
134
|
-
document.removeEventListener("mousedown",
|
|
134
|
+
document.removeEventListener("mousedown", E), c !== null && clearTimeout(c);
|
|
135
135
|
});
|
|
136
136
|
const U = () => {
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
c !== null && clearTimeout(c), l.value = !0;
|
|
138
|
+
}, q = () => {
|
|
139
|
+
c = window.setTimeout(() => {
|
|
140
|
+
l.value = !1;
|
|
141
141
|
}, 300);
|
|
142
142
|
};
|
|
143
143
|
return v({
|
|
144
144
|
getToolbarGroups: () => []
|
|
145
|
-
}), (
|
|
145
|
+
}), (z, o) => e(L) ? (_(), N(me, {
|
|
146
146
|
key: 0,
|
|
147
|
-
message: e(n)(e(
|
|
148
|
-
}, null, 8, ["message"])) : (_(), H("div",
|
|
149
|
-
a("div",
|
|
150
|
-
a("div",
|
|
147
|
+
message: e(n)(e(L))
|
|
148
|
+
}, null, 8, ["message"])) : (_(), H("div", xe, [
|
|
149
|
+
a("div", ye, [
|
|
150
|
+
a("div", he, [
|
|
151
151
|
a("div", {
|
|
152
152
|
"aria-hidden": "true",
|
|
153
|
-
class:
|
|
153
|
+
class: I([
|
|
154
154
|
"vfp-audio-mark vfp-w-10 vfp-h-10 vfp-flex vfp-items-center vfp-justify-center vfp-rounded-md vfp-flex-shrink-0",
|
|
155
|
-
e(
|
|
155
|
+
e(m) ? "vfp-audio-mark-playing" : ""
|
|
156
156
|
])
|
|
157
157
|
}, [
|
|
158
|
-
|
|
158
|
+
T(e(le), { class: "vfp-w-5 vfp-h-5" })
|
|
159
159
|
], 2),
|
|
160
|
-
a("div",
|
|
160
|
+
a("div", be, j(x.fileName), 1)
|
|
161
161
|
]),
|
|
162
|
-
a("div",
|
|
163
|
-
a("span",
|
|
164
|
-
a("div",
|
|
165
|
-
a("div",
|
|
162
|
+
a("div", we, [
|
|
163
|
+
a("span", ke, j(e(t)(k.value)), 1),
|
|
164
|
+
a("div", _e, [
|
|
165
|
+
a("div", Le, [
|
|
166
166
|
a("div", {
|
|
167
167
|
class: "vfp-h-full vfp-rounded-full vfp-pointer-events-none",
|
|
168
|
-
style:
|
|
168
|
+
style: J({
|
|
169
169
|
width: `${M.value * 100}%`,
|
|
170
170
|
background: "var(--fp-player-progress)",
|
|
171
|
-
transition:
|
|
171
|
+
transition: s.value ? "none" : "width 0.1s linear"
|
|
172
172
|
})
|
|
173
173
|
}, null, 4)
|
|
174
174
|
]),
|
|
@@ -182,22 +182,22 @@ const me = {
|
|
|
182
182
|
"aria-label": e(n)("audio.aria.progress"),
|
|
183
183
|
class: "audio-slider vfp-absolute vfp-w-full",
|
|
184
184
|
onPointerdown: o[0] || (o[0] = () => {
|
|
185
|
-
b.value = e(h),
|
|
185
|
+
b.value = e(h), s.value = !0;
|
|
186
186
|
}),
|
|
187
187
|
onInput: o[1] || (o[1] = (i) => {
|
|
188
|
-
const
|
|
189
|
-
|
|
188
|
+
const V = parseFloat(i.target.value);
|
|
189
|
+
s.value ? b.value = V : e(B)(V);
|
|
190
190
|
}),
|
|
191
191
|
onPointerup: o[2] || (o[2] = (i) => {
|
|
192
|
-
const
|
|
193
|
-
e(
|
|
192
|
+
const V = parseFloat(i.target.value);
|
|
193
|
+
e(B)(V), s.value = !1;
|
|
194
194
|
}),
|
|
195
|
-
onPointercancel: o[3] || (o[3] = (i) =>
|
|
196
|
-
}, null, 40,
|
|
195
|
+
onPointercancel: o[3] || (o[3] = (i) => s.value = !1)
|
|
196
|
+
}, null, 40, Ee)
|
|
197
197
|
]),
|
|
198
|
-
a("span",
|
|
198
|
+
a("span", Te, j(e(u) > 0 ? e(t)(e(u)) : "--:--"), 1)
|
|
199
199
|
]),
|
|
200
|
-
a("div",
|
|
200
|
+
a("div", Pe, [
|
|
201
201
|
a("button", {
|
|
202
202
|
type: "button",
|
|
203
203
|
class: "vfp-audio-control vfp-w-10 vfp-h-10 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-flex-shrink-0",
|
|
@@ -205,19 +205,19 @@ const me = {
|
|
|
205
205
|
background: "var(--fp-player-progress)",
|
|
206
206
|
color: "var(--fp-fg-inverse)"
|
|
207
207
|
},
|
|
208
|
-
title: e(
|
|
209
|
-
"aria-label": e(
|
|
208
|
+
title: e(m) ? e(n)("audio.aria.pause") : e(n)("audio.aria.play"),
|
|
209
|
+
"aria-label": e(m) ? e(n)("audio.aria.pause") : e(n)("audio.aria.play"),
|
|
210
210
|
onClick: o[4] || (o[4] = //@ts-ignore
|
|
211
211
|
(...i) => e(R) && e(R)(...i))
|
|
212
212
|
}, [
|
|
213
|
-
e(
|
|
213
|
+
e(m) ? (_(), N(e(se), {
|
|
214
214
|
key: 0,
|
|
215
215
|
class: "vfp-w-5 vfp-h-5"
|
|
216
|
-
})) : (_(),
|
|
216
|
+
})) : (_(), N(e(re), {
|
|
217
217
|
key: 1,
|
|
218
218
|
class: "vfp-w-5 vfp-h-5 vfp-ml-0.5"
|
|
219
219
|
}))
|
|
220
|
-
], 8,
|
|
220
|
+
], 8, Me),
|
|
221
221
|
a("button", {
|
|
222
222
|
type: "button",
|
|
223
223
|
class: "vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-text-fg-secondary hover:vfp-bg-surface-3 vfp-flex-shrink-0",
|
|
@@ -225,8 +225,8 @@ const me = {
|
|
|
225
225
|
"aria-label": e(n)("audio.aria.backward_10"),
|
|
226
226
|
onClick: o[5] || (o[5] = (i) => e(F)(-10))
|
|
227
227
|
}, [
|
|
228
|
-
|
|
229
|
-
], 8,
|
|
228
|
+
T(e(ie), { class: "vfp-w-[18px] vfp-h-[18px]" })
|
|
229
|
+
], 8, Ce),
|
|
230
230
|
a("button", {
|
|
231
231
|
type: "button",
|
|
232
232
|
class: "vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-text-fg-secondary hover:vfp-bg-surface-3 vfp-flex-shrink-0",
|
|
@@ -234,62 +234,62 @@ const me = {
|
|
|
234
234
|
"aria-label": e(n)("audio.aria.forward_10"),
|
|
235
235
|
onClick: o[6] || (o[6] = (i) => e(F)(10))
|
|
236
236
|
}, [
|
|
237
|
-
|
|
238
|
-
], 8,
|
|
237
|
+
T(e(fe), { class: "vfp-w-[18px] vfp-h-[18px]" })
|
|
238
|
+
], 8, Ve),
|
|
239
239
|
o[11] || (o[11] = a("div", { class: "vfp-w-px vfp-h-5 vfp-mx-1 vfp-bg-divide" }, null, -1)),
|
|
240
240
|
a("button", {
|
|
241
241
|
type: "button",
|
|
242
|
-
class:
|
|
242
|
+
class: I([
|
|
243
243
|
"vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-flex-shrink-0",
|
|
244
|
-
e(
|
|
244
|
+
e(g) ? "vfp-bg-surface-3 vfp-text-fg-primary" : "vfp-text-fg-tertiary hover:vfp-bg-surface-3"
|
|
245
245
|
]),
|
|
246
|
-
title: e(
|
|
247
|
-
"aria-label": e(
|
|
246
|
+
title: e(g) ? e(n)("audio.aria.loop_off") : e(n)("audio.aria.loop_on"),
|
|
247
|
+
"aria-label": e(g) ? e(n)("audio.aria.loop_off") : e(n)("audio.aria.loop_on"),
|
|
248
248
|
onClick: o[7] || (o[7] = //@ts-ignore
|
|
249
|
-
(...i) => e(
|
|
249
|
+
(...i) => e($) && e($)(...i))
|
|
250
250
|
}, [
|
|
251
|
-
|
|
252
|
-
], 10,
|
|
251
|
+
T(e(ve), { class: "vfp-w-4 vfp-h-4" })
|
|
252
|
+
], 10, Ne),
|
|
253
253
|
o[12] || (o[12] = a("div", { class: "vfp-flex-1" }, null, -1)),
|
|
254
254
|
a("div", {
|
|
255
255
|
ref_key: "volumeRef",
|
|
256
256
|
ref: w,
|
|
257
257
|
class: "vfp-relative",
|
|
258
258
|
onMouseenter: U,
|
|
259
|
-
onMouseleave:
|
|
259
|
+
onMouseleave: q
|
|
260
260
|
}, [
|
|
261
261
|
a("button", {
|
|
262
262
|
type: "button",
|
|
263
|
-
class:
|
|
263
|
+
class: I([
|
|
264
264
|
"vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-flex-shrink-0",
|
|
265
|
-
|
|
265
|
+
l.value ? "vfp-bg-surface-3 vfp-text-fg-primary" : "vfp-text-fg-secondary hover:vfp-bg-surface-3"
|
|
266
266
|
]),
|
|
267
|
-
title: e(
|
|
268
|
-
"aria-label": e(
|
|
267
|
+
title: e(r) ? e(n)("audio.aria.unmute") : e(n)("audio.aria.mute"),
|
|
268
|
+
"aria-label": e(r) ? e(n)("audio.aria.unmute") : e(n)("audio.aria.mute"),
|
|
269
269
|
onClick: o[8] || (o[8] = //@ts-ignore
|
|
270
|
-
(...i) => e(
|
|
270
|
+
(...i) => e(S) && e(S)(...i))
|
|
271
271
|
}, [
|
|
272
|
-
(_(),
|
|
273
|
-
], 10,
|
|
274
|
-
|
|
272
|
+
(_(), N(Y(C.value), { class: "vfp-w-4 vfp-h-4" }))
|
|
273
|
+
], 10, je),
|
|
274
|
+
T(Z, { name: "vfp-fade" }, {
|
|
275
275
|
default: ee(() => [
|
|
276
|
-
|
|
276
|
+
l.value ? (_(), H("div", {
|
|
277
277
|
key: 0,
|
|
278
278
|
class: "vfp-absolute vfp-right-0 vfp-bottom-full vfp-mb-2 vfp-w-[54px] vfp-rounded-md vfp-p-3 vfp-border vfp-bg-surface-toolbar vfp-border-line",
|
|
279
279
|
onMouseenter: U,
|
|
280
|
-
onMouseleave:
|
|
280
|
+
onMouseleave: q
|
|
281
281
|
}, [
|
|
282
|
-
a("div",
|
|
283
|
-
a("div",
|
|
282
|
+
a("div", Re, [
|
|
283
|
+
a("div", Be, [
|
|
284
284
|
o[10] || (o[10] = a("div", {
|
|
285
285
|
class: "vfp-absolute vfp-rounded-full vfp-bg-surface-2",
|
|
286
286
|
style: { width: "3px", height: "100%" }
|
|
287
287
|
}, null, -1)),
|
|
288
288
|
a("div", {
|
|
289
289
|
class: "vfp-absolute vfp-bottom-0 vfp-rounded-full vfp-pointer-events-none",
|
|
290
|
-
style:
|
|
290
|
+
style: J({
|
|
291
291
|
width: "3px",
|
|
292
|
-
height: `${(e(
|
|
292
|
+
height: `${(e(r) ? 0 : e(d)) * 100}%`,
|
|
293
293
|
background: "var(--fp-player-progress)",
|
|
294
294
|
transition: "height 0.1s linear"
|
|
295
295
|
})
|
|
@@ -299,14 +299,14 @@ const me = {
|
|
|
299
299
|
min: "0",
|
|
300
300
|
max: "1",
|
|
301
301
|
step: "0.01",
|
|
302
|
-
value: e(
|
|
302
|
+
value: e(r) ? 0 : e(d),
|
|
303
303
|
"aria-label": e(n)("audio.aria.volume"),
|
|
304
304
|
class: "volume-slider-vertical vfp-absolute",
|
|
305
305
|
style: { width: "80px", height: "24px", transform: "rotate(-90deg)", "transform-origin": "center center" },
|
|
306
|
-
onInput: o[9] || (o[9] = (i) => e(
|
|
307
|
-
}, null, 40,
|
|
306
|
+
onInput: o[9] || (o[9] = (i) => e(A)(parseFloat(i.target.value)))
|
|
307
|
+
}, null, 40, Fe)
|
|
308
308
|
]),
|
|
309
|
-
a("span", Se,
|
|
309
|
+
a("span", Se, j(Math.round((e(r) ? 0 : e(d)) * 100)), 1)
|
|
310
310
|
])
|
|
311
311
|
], 32)) : te("", !0)
|
|
312
312
|
]),
|
|
@@ -317,13 +317,13 @@ const me = {
|
|
|
317
317
|
]),
|
|
318
318
|
a("audio", {
|
|
319
319
|
ref_key: "audioRef",
|
|
320
|
-
ref:
|
|
321
|
-
src:
|
|
320
|
+
ref: P,
|
|
321
|
+
src: x.url,
|
|
322
322
|
class: "vfp-hidden"
|
|
323
|
-
}, null, 8,
|
|
323
|
+
}, null, 8, $e)
|
|
324
324
|
]));
|
|
325
325
|
}
|
|
326
326
|
});
|
|
327
327
|
export {
|
|
328
|
-
|
|
328
|
+
ze as default
|
|
329
329
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineComponent as m, ref as c, watch as h, openBlock as i, createElementBlock as u, createElementVNode as o, toDisplayString as g, unref as y, createBlock as w } from "vue";
|
|
2
|
+
import { u as x, a as k, b, J as T, U as B } from "./index-c-pYJEmH.mjs";
|
|
3
|
+
import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
4
|
+
const D = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vfp-renderer-loading"
|
|
7
|
+
}, G = { class: "vfp-renderer-loading-content" }, H = { class: "vfp-renderer-loading-text" }, L = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
|
|
10
|
+
}, M = { class: "vfp-flex vfp-flex-col vfp-items-center" }, U = { class: "vfp-legacy-doc-paper" }, C = ["innerHTML"], S = /* @__PURE__ */ m({
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
url: {}
|
|
14
|
+
},
|
|
15
|
+
setup(p, { expose: d }) {
|
|
16
|
+
const a = p, { t } = x(), v = k(), f = b(), l = c(""), n = c(!0), r = c(null), _ = async () => {
|
|
17
|
+
f.begin(a.url), n.value = !0, r.value = null, l.value = "";
|
|
18
|
+
try {
|
|
19
|
+
const e = await v.value(a.url);
|
|
20
|
+
if (!e.ok) throw new T("file.load_failed");
|
|
21
|
+
const s = await e.arrayBuffer();
|
|
22
|
+
l.value = await B(s);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error(t.value("doc.parse_failed") + ":", e), r.value = t.value("doc.parse_failed"), f.error(e);
|
|
25
|
+
} finally {
|
|
26
|
+
n.value = !1;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return h(() => a.url, (e) => {
|
|
30
|
+
e && _();
|
|
31
|
+
}, { immediate: !0 }), d({
|
|
32
|
+
getToolbarGroups: () => []
|
|
33
|
+
}), (e, s) => n.value ? (i(), u("div", D, [
|
|
34
|
+
o("div", G, [
|
|
35
|
+
s[0] || (s[0] = o("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
36
|
+
o("span", H, g(y(t)("common.loading")), 1)
|
|
37
|
+
])
|
|
38
|
+
])) : r.value ? (i(), w(E, {
|
|
39
|
+
key: 1,
|
|
40
|
+
message: r.value
|
|
41
|
+
}, null, 8, ["message"])) : (i(), u("div", L, [
|
|
42
|
+
o("div", M, [
|
|
43
|
+
o("div", U, [
|
|
44
|
+
o("div", { innerHTML: l.value }, null, 8, C)
|
|
45
|
+
])
|
|
46
|
+
])
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
S as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as M, ref as u, watch as D, computed as H, openBlock as l, createElementBlock as a, createElementVNode as t, toDisplayString as v, unref as m, createBlock as P, normalizeStyle as B, Fragment as k, renderList as E } from "vue";
|
|
2
|
+
import { u as F, a as G, b as N, h as X } from "./index-c-pYJEmH.mjs";
|
|
3
|
+
import { u as j } from "./useShikiHighlight-C-ztcJBE.mjs";
|
|
4
|
+
import { _ as q } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
5
|
+
const A = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "vfp-renderer-loading"
|
|
8
|
+
}, C = { class: "vfp-renderer-loading-content" }, I = { class: "vfp-renderer-loading-text" }, O = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
11
|
+
style: { background: "var(--fp-code-bg)" }
|
|
12
|
+
}, R = { class: "vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm vfp-whitespace-pre-wrap vfp-break-words" }, V = {
|
|
13
|
+
key: 3,
|
|
14
|
+
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
15
|
+
style: { background: "var(--fp-code-bg)" }
|
|
16
|
+
}, J = { class: "vfp-code-gutter" }, K = ["innerHTML"], re = /* @__PURE__ */ M({
|
|
17
|
+
__name: "index",
|
|
18
|
+
props: {
|
|
19
|
+
url: {},
|
|
20
|
+
fileName: {}
|
|
21
|
+
},
|
|
22
|
+
setup(x, { expose: b }) {
|
|
23
|
+
const f = x, { t: g } = F(), S = G(), _ = N(), i = u(""), d = u(!0), c = u(null), T = u("xml"), { lineHtmls: h } = j(i, T), $ = (e) => {
|
|
24
|
+
const r = " ", o = /(>)(<)(\/*)/g, s = e.replace(o, `$1
|
|
25
|
+
$2$3`);
|
|
26
|
+
let n = 0;
|
|
27
|
+
return s.split(`
|
|
28
|
+
`).map((p) => {
|
|
29
|
+
let y = 0;
|
|
30
|
+
/^<\/\w/.test(p) ? n = Math.max(n - 1, 0) : /^<\w[^>]*[^/]>.*$/.test(p) && !/<.+<\/.+>$/.test(p) && (y = 1);
|
|
31
|
+
const L = r.repeat(n) + p;
|
|
32
|
+
return n += y, L;
|
|
33
|
+
}).join(`
|
|
34
|
+
`);
|
|
35
|
+
}, z = (e) => {
|
|
36
|
+
try {
|
|
37
|
+
const o = new DOMParser().parseFromString(e, "application/xml");
|
|
38
|
+
if (o.querySelector("parsererror")) return e;
|
|
39
|
+
const n = new XMLSerializer().serializeToString(o);
|
|
40
|
+
return $(n);
|
|
41
|
+
} catch {
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
D(() => f.url, async () => {
|
|
46
|
+
_.begin(f.url), d.value = !0, c.value = null;
|
|
47
|
+
try {
|
|
48
|
+
const e = await X(f.url, { fetcher: S.value });
|
|
49
|
+
i.value = z(e);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.error(e), c.value = g.value("xml.load_failed"), _.error(e);
|
|
52
|
+
} finally {
|
|
53
|
+
d.value = !1;
|
|
54
|
+
}
|
|
55
|
+
}, { immediate: !0 });
|
|
56
|
+
const w = H(() => i.value.split(`
|
|
57
|
+
`));
|
|
58
|
+
return b({
|
|
59
|
+
getToolbarGroups: () => []
|
|
60
|
+
}), (e, r) => d.value ? (l(), a("div", A, [
|
|
61
|
+
t("div", C, [
|
|
62
|
+
r[0] || (r[0] = t("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
63
|
+
t("span", I, v(m(g)("common.loading")), 1)
|
|
64
|
+
])
|
|
65
|
+
])) : c.value ? (l(), P(q, {
|
|
66
|
+
key: 1,
|
|
67
|
+
message: c.value
|
|
68
|
+
}, null, 8, ["message"])) : m(h).length === 0 ? (l(), a("div", O, [
|
|
69
|
+
t("pre", R, v(i.value), 1)
|
|
70
|
+
])) : (l(), a("div", V, [
|
|
71
|
+
t("div", {
|
|
72
|
+
class: "vfp-code-block with-line-numbers vfp-w-full",
|
|
73
|
+
style: B({ gridTemplateRows: `repeat(${w.value.length}, auto) minmax(1.5rem, 1fr)` })
|
|
74
|
+
}, [
|
|
75
|
+
(l(!0), a(k, null, E(w.value, (o, s) => (l(), a(k, { key: s }, [
|
|
76
|
+
t("span", J, v(s + 1), 1),
|
|
77
|
+
t("span", {
|
|
78
|
+
class: "vfp-code-line",
|
|
79
|
+
innerHTML: m(h)[s] ?? ""
|
|
80
|
+
}, null, 8, K)
|
|
81
|
+
], 64))), 128)),
|
|
82
|
+
r[1] || (r[1] = t("span", { class: "vfp-code-gutter-filler" }, null, -1)),
|
|
83
|
+
r[2] || (r[2] = t("span", { class: "vfp-code-line-filler" }, null, -1))
|
|
84
|
+
], 4)
|
|
85
|
+
]));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
re as default
|
|
90
|
+
};
|