@eternalheart/vue-file-preview 1.6.4 → 1.6.6
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 +3 -3
- package/README.zh-CN.md +3 -3
- package/lib/chunks/{index-CNVufPKA.mjs → index-07rgqwSI.mjs} +1 -1
- package/lib/chunks/{index-BjLnlWld.mjs → index-BF0-zECZ.mjs} +44 -45
- package/lib/chunks/{index-BkpKhifq.mjs → index-BHy2oKCa.mjs} +15 -15
- package/lib/chunks/{index-DHAH_W8y.mjs → index-BV8V9hEs.mjs} +26 -26
- package/lib/chunks/index-BnDCjh8a.mjs +320 -0
- package/lib/chunks/{index-CbEYsjU9.mjs → index-C-hfrxhW.mjs} +50 -50
- package/lib/chunks/{index-RshnMles.mjs → index-CUrAAk7J.mjs} +213 -207
- package/lib/chunks/index-CdsYIxSD.mjs +270 -0
- package/lib/chunks/{index-BW6Z1etg.mjs → index-ChMheVNW.mjs} +20 -20
- package/lib/chunks/index-CksNYAz_.mjs +48 -0
- package/lib/chunks/{index-CAM2s3GD.mjs → index-CybXawTx.mjs} +19 -19
- package/lib/chunks/{index-Ck-FSxNL.mjs → index-D656tL42.mjs} +21 -21
- package/lib/chunks/{index-Ccdi178q.mjs → index-DWWV1OKd.mjs} +77 -77
- package/lib/chunks/index-DXqRgna1.mjs +105 -0
- package/lib/chunks/{index-Cyps3Pjb.mjs → index-DcNc3goP.mjs} +131 -129
- package/lib/chunks/index-Dh91eAMV.mjs +329 -0
- package/lib/chunks/{index-DnmsSoFY.mjs → index-DxBxbEDT.mjs} +1 -1
- package/lib/chunks/{index-Df8-y_Ok.mjs → index-hDUlDDey.mjs} +18 -18
- package/lib/chunks/{index-Dl0SQhkc.mjs → index-lDd0gQfG.mjs} +35 -36
- package/lib/chunks/{index-C9ju7INJ.mjs → index-tOax5IQg.mjs} +26 -26
- package/lib/chunks/index-u7QUztr_.mjs +49 -0
- package/lib/chunks/{index-CeCl4UNc.mjs → index-xY2bzsk7.mjs} +3747 -1100
- package/lib/chunks/{useShikiHighlight-D2eoQi-e.mjs → useShikiHighlight-DwEsf_jW.mjs} +5 -5
- package/lib/index.cjs +74 -55
- package/lib/index.css +1 -1
- package/lib/index.mjs +7 -7
- package/lib/renderers/Doc/index.vue.d.ts +9 -0
- package/lib/renderers/Ppt/index.vue.d.ts +9 -0
- package/lib/renderers/lazy.d.ts +2 -0
- package/package.json +2 -2
- package/lib/chunks/index-Bts2l6ss.mjs +0 -300
- package/lib/chunks/index-CyXt4Rjo.mjs +0 -264
- package/lib/chunks/index-DXECkJ55.mjs +0 -106
- package/lib/chunks/index-ntrMGZWG.mjs +0 -466
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { defineComponent as ie, ref as S, onMounted as ne, onUnmounted as se, watch as ae, openBlock as H, createElementBlock as W, createElementVNode as B, toDisplayString as U, createCommentVNode as Z, unref as le } from "vue";
|
|
2
|
+
import * as o from "three";
|
|
3
|
+
import { OrbitControls as fe } from "three/examples/jsm/controls/OrbitControls";
|
|
4
|
+
import { DXFLoader as ce } from "three-dxf-loader";
|
|
5
|
+
import { STLLoader as ue } from "three/examples/jsm/loaders/STLLoader";
|
|
6
|
+
import { OBJLoader as de } from "three/examples/jsm/loaders/OBJLoader";
|
|
7
|
+
import { GLTFLoader as pe } from "three/examples/jsm/loaders/GLTFLoader";
|
|
8
|
+
import { u as me, b as ve } from "./index-xY2bzsk7.mjs";
|
|
9
|
+
import { T as ge } from "./base.types-DaftHyg7.mjs";
|
|
10
|
+
import { RotateCcw as we, Box as he, Grid3x3 as be, Axis3d as ye } from "lucide-vue-next";
|
|
11
|
+
function Me(c) {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
items: [
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
icon: we,
|
|
18
|
+
tooltip: c.t("toolbar.reset"),
|
|
19
|
+
action: () => {
|
|
20
|
+
var p;
|
|
21
|
+
return (p = c.cadRef) == null ? void 0 : p.resetView();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
items: [
|
|
28
|
+
{
|
|
29
|
+
type: "button",
|
|
30
|
+
icon: he,
|
|
31
|
+
tooltip: c.wireframe ? c.t("cad.solid") : c.t("cad.wireframe"),
|
|
32
|
+
active: c.wireframe,
|
|
33
|
+
action: () => {
|
|
34
|
+
var p;
|
|
35
|
+
return (p = c.cadRef) == null ? void 0 : p.toggleWireframe();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
icon: be,
|
|
41
|
+
tooltip: c.t("cad.grid"),
|
|
42
|
+
active: c.showGrid,
|
|
43
|
+
action: () => {
|
|
44
|
+
var p;
|
|
45
|
+
return (p = c.cadRef) == null ? void 0 : p.toggleGrid();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
icon: ye,
|
|
51
|
+
tooltip: c.t("cad.axes"),
|
|
52
|
+
active: c.showAxes,
|
|
53
|
+
action: () => {
|
|
54
|
+
var p;
|
|
55
|
+
return (p = c.cadRef) == null ? void 0 : p.toggleAxes();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
const xe = {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "vfp-absolute vfp-inset-0 vfp-flex vfp-items-center vfp-justify-center vfp-bg-surface-3 vfp-z-10"
|
|
65
|
+
}, Le = { class: "vfp-text-center" }, Ee = { class: "vfp-text-fg-primary" }, _e = {
|
|
66
|
+
key: 1,
|
|
67
|
+
class: "vfp-absolute vfp-inset-0 vfp-flex vfp-items-center vfp-justify-center vfp-bg-surface-3 vfp-z-10"
|
|
68
|
+
}, Ae = { class: "vfp-text-center" }, ze = { class: "vfp-mt-4 vfp-text-fg-secondary" }, Ve = /* @__PURE__ */ ie({
|
|
69
|
+
__name: "index",
|
|
70
|
+
props: {
|
|
71
|
+
url: {},
|
|
72
|
+
file: {},
|
|
73
|
+
fileName: {}
|
|
74
|
+
},
|
|
75
|
+
setup(c, { expose: p }) {
|
|
76
|
+
const x = c, { t: R } = me(), q = ve(), y = S(null), _ = S(!0), A = S(null), F = S(!1), G = S(!0), P = S(!0);
|
|
77
|
+
let r = null, a = null, s = null, l = null, M = null, u = null, d = null, V = null, z = null, v = !1;
|
|
78
|
+
const T = new ge(), J = (e, t, i) => {
|
|
79
|
+
var m, g, w;
|
|
80
|
+
return i != null && i.name ? ((m = i.name.split(".").pop()) == null ? void 0 : m.toLowerCase()) || "" : t ? ((g = t.split(".").pop()) == null ? void 0 : g.toLowerCase()) || "" : ((w = e.split(".").pop()) == null ? void 0 : w.toLowerCase().split("?")[0]) || "";
|
|
81
|
+
}, X = () => {
|
|
82
|
+
if (!l || !a || !M) return;
|
|
83
|
+
const e = new o.Box3().setFromObject(M), t = e.getCenter(new o.Vector3()), i = e.getSize(new o.Vector3()), m = Math.max(i.x, i.y, i.z), g = a.fov * (Math.PI / 180);
|
|
84
|
+
let w = Math.abs(m / 2 / Math.tan(g / 2));
|
|
85
|
+
w *= 1.5, a.position.set(t.x + w, t.y + w, t.z + w), a.lookAt(t), l.target.copy(t), l.update();
|
|
86
|
+
}, K = () => {
|
|
87
|
+
F.value = !F.value, M && M.traverse((e) => {
|
|
88
|
+
if (e instanceof o.Mesh) {
|
|
89
|
+
const t = e.material;
|
|
90
|
+
t && (Array.isArray(t) ? t.forEach((i) => {
|
|
91
|
+
i.wireframe = F.value;
|
|
92
|
+
}) : t.wireframe = F.value);
|
|
93
|
+
}
|
|
94
|
+
}), T.notify();
|
|
95
|
+
}, Q = () => {
|
|
96
|
+
G.value = !G.value, u && (u.visible = G.value), T.notify();
|
|
97
|
+
}, Y = () => {
|
|
98
|
+
P.value = !P.value, d && (d.visible = P.value), T.notify();
|
|
99
|
+
}, $ = (e) => {
|
|
100
|
+
if (!r) return;
|
|
101
|
+
const t = Number.isFinite(e) && e > 0 ? e : 1, i = t * 0.5, m = t * 2;
|
|
102
|
+
u && (u.geometry.dispose(), u.material.dispose(), r.remove(u)), d && (d.geometry.dispose(), d.material.dispose(), r.remove(d)), u = new o.GridHelper(m, 20, 4473924, 2236962), u.visible = G.value, r.add(u), d = new o.AxesHelper(i), d.visible = P.value, r.add(d);
|
|
103
|
+
};
|
|
104
|
+
p({
|
|
105
|
+
getToolbarGroups: () => Me({
|
|
106
|
+
cadRef: { resetView: X, toggleWireframe: K, toggleGrid: Q, toggleAxes: Y },
|
|
107
|
+
wireframe: F.value,
|
|
108
|
+
showGrid: G.value,
|
|
109
|
+
showAxes: P.value,
|
|
110
|
+
t: R.value
|
|
111
|
+
}),
|
|
112
|
+
onToolbarChange: (e) => T.subscribe(e)
|
|
113
|
+
});
|
|
114
|
+
const ee = (e) => {
|
|
115
|
+
e.traverse((t) => {
|
|
116
|
+
t.geometry && t.geometry.dispose(), t.material && (Array.isArray(t.material) ? t.material.forEach((i) => {
|
|
117
|
+
D(i);
|
|
118
|
+
}) : D(t.material));
|
|
119
|
+
});
|
|
120
|
+
}, D = (e) => {
|
|
121
|
+
e.map && e.map.dispose(), e.lightMap && e.lightMap.dispose(), e.bumpMap && e.bumpMap.dispose(), e.normalMap && e.normalMap.dispose(), e.specularMap && e.specularMap.dispose(), e.envMap && e.envMap.dispose(), e.dispose();
|
|
122
|
+
}, N = () => {
|
|
123
|
+
if (!y.value) return;
|
|
124
|
+
v = !1, z = new AbortController();
|
|
125
|
+
const e = y.value, t = e.clientWidth, i = e.clientHeight;
|
|
126
|
+
r = new o.Scene(), r.background = new o.Color(1710618), a = new o.PerspectiveCamera(45, t / i, 0.1, 1e4), a.position.set(100, 100, 100), s = new o.WebGLRenderer({ antialias: !0 }), s.setSize(t, i), s.setPixelRatio(window.devicePixelRatio), e.appendChild(s.domElement), l = new fe(a, s.domElement), l.enableDamping = !0, l.dampingFactor = 0.05;
|
|
127
|
+
const m = new o.AmbientLight(16777215, 0.6);
|
|
128
|
+
r.add(m);
|
|
129
|
+
const g = new o.DirectionalLight(16777215, 0.8);
|
|
130
|
+
g.position.set(1, 1, 1), r.add(g);
|
|
131
|
+
const w = new o.DirectionalLight(16777215, 0.4);
|
|
132
|
+
w.position.set(-1, -1, -1), r.add(w), te();
|
|
133
|
+
const n = () => {
|
|
134
|
+
v || (V = requestAnimationFrame(n), l == null || l.update(), r && a && s && s.render(r, a));
|
|
135
|
+
};
|
|
136
|
+
n(), window.addEventListener("resize", O);
|
|
137
|
+
}, te = () => {
|
|
138
|
+
if (!r || !a || !l || v) return;
|
|
139
|
+
const e = J(x.url, x.fileName, x.file);
|
|
140
|
+
let t;
|
|
141
|
+
const i = new o.LoadingManager();
|
|
142
|
+
if (e === "dxf")
|
|
143
|
+
t = new ce();
|
|
144
|
+
else if (e === "stl")
|
|
145
|
+
t = new ue(i);
|
|
146
|
+
else if (e === "obj")
|
|
147
|
+
t = new de(i);
|
|
148
|
+
else if (e === "gltf" || e === "glb")
|
|
149
|
+
t = new pe(i);
|
|
150
|
+
else {
|
|
151
|
+
A.value = R.value("cad.parse_failed"), _.value = !1;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const m = (n, h) => {
|
|
155
|
+
if (v) return;
|
|
156
|
+
if (!n) {
|
|
157
|
+
A.value = R.value("cad.parse_failed"), _.value = !1;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let b;
|
|
161
|
+
if (h === "stl") {
|
|
162
|
+
const k = n, re = new o.MeshPhongMaterial({
|
|
163
|
+
color: 8947848,
|
|
164
|
+
flatShading: !0,
|
|
165
|
+
side: o.DoubleSide
|
|
166
|
+
});
|
|
167
|
+
b = new o.Mesh(k, re);
|
|
168
|
+
} else h === "gltf" || h === "glb" ? b = n.scene : (b = n, b.traverse((k) => {
|
|
169
|
+
k instanceof o.Mesh && !k.material && (k.material = new o.MeshPhongMaterial({
|
|
170
|
+
color: 8947848,
|
|
171
|
+
side: o.DoubleSide
|
|
172
|
+
}));
|
|
173
|
+
}));
|
|
174
|
+
r.add(b), M = b;
|
|
175
|
+
const L = new o.Box3().setFromObject(b), f = L.getCenter(new o.Vector3()), E = L.getSize(new o.Vector3()), C = Math.max(E.x, E.y, E.z);
|
|
176
|
+
$(C);
|
|
177
|
+
const oe = a.fov * (Math.PI / 180);
|
|
178
|
+
let j = Math.abs(C / 2 / Math.tan(oe / 2));
|
|
179
|
+
j *= 1.5, a.position.set(f.x + j, f.y + j, f.z + j), a.lookAt(f), l.target.copy(f), l.update(), _.value = !1, T.notify();
|
|
180
|
+
}, g = (n) => {
|
|
181
|
+
v || n.name !== "AbortError" && (A.value = R.value("cad.load_failed"), _.value = !1);
|
|
182
|
+
};
|
|
183
|
+
(x.file ? x.file.arrayBuffer() : q.value(x.url, { signal: z == null ? void 0 : z.signal }).then((n) => {
|
|
184
|
+
if (!v) {
|
|
185
|
+
if (!n.ok) throw new Error("Failed to fetch file");
|
|
186
|
+
return n.arrayBuffer();
|
|
187
|
+
}
|
|
188
|
+
})).then((n) => {
|
|
189
|
+
if (!(v || !n)) {
|
|
190
|
+
if (e === "stl") {
|
|
191
|
+
const h = t.parse(n);
|
|
192
|
+
m(h, e);
|
|
193
|
+
} else if (e === "obj") {
|
|
194
|
+
const b = new TextDecoder("utf-8").decode(n), L = t.parse(b);
|
|
195
|
+
m(L, e);
|
|
196
|
+
} else if (e === "gltf" || e === "glb")
|
|
197
|
+
t.parse(
|
|
198
|
+
n,
|
|
199
|
+
"",
|
|
200
|
+
(h) => {
|
|
201
|
+
v || m(h, e);
|
|
202
|
+
},
|
|
203
|
+
(h) => g(h)
|
|
204
|
+
);
|
|
205
|
+
else if (e === "dxf") {
|
|
206
|
+
const b = new TextDecoder("utf-8").decode(n), L = o.BufferGeometry.prototype.setFromPoints;
|
|
207
|
+
o.BufferGeometry.prototype.setFromPoints = function(f) {
|
|
208
|
+
const E = (f || []).filter(
|
|
209
|
+
(C) => C && C.x !== void 0 && C.y !== void 0
|
|
210
|
+
);
|
|
211
|
+
return L.call(this, E);
|
|
212
|
+
};
|
|
213
|
+
try {
|
|
214
|
+
t.loadString(
|
|
215
|
+
b,
|
|
216
|
+
(f) => {
|
|
217
|
+
if (!v) {
|
|
218
|
+
const E = (f == null ? void 0 : f.entity) || f;
|
|
219
|
+
m(E, e);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
(f) => {
|
|
223
|
+
g(f);
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
} catch (f) {
|
|
227
|
+
g(f);
|
|
228
|
+
} finally {
|
|
229
|
+
o.BufferGeometry.prototype.setFromPoints = L;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}).catch((n) => {
|
|
234
|
+
v || g(n);
|
|
235
|
+
});
|
|
236
|
+
}, O = () => {
|
|
237
|
+
if (!y.value || !a || !s || v) return;
|
|
238
|
+
const e = y.value.clientWidth, t = y.value.clientHeight;
|
|
239
|
+
a.aspect = e / t, a.updateProjectionMatrix(), s.setSize(e, t);
|
|
240
|
+
}, I = () => {
|
|
241
|
+
v = !0, z && z.abort(), V !== null && (cancelAnimationFrame(V), V = null), window.removeEventListener("resize", O), M && (ee(M), r == null || r.remove(M), M = null), u && (u.geometry.dispose(), u.material.dispose(), r == null || r.remove(u), u = null), d && (d.geometry.dispose(), d.material.dispose(), r == null || r.remove(d), d = null), l == null || l.dispose(), s == null || s.dispose(), y.value && (s != null && s.domElement) && y.value.contains(s.domElement) && y.value.removeChild(s.domElement), r = null, a = null, s = null, l = null;
|
|
242
|
+
};
|
|
243
|
+
return ne(() => {
|
|
244
|
+
N();
|
|
245
|
+
}), se(() => {
|
|
246
|
+
I();
|
|
247
|
+
}), ae(() => x.url, () => {
|
|
248
|
+
I(), _.value = !0, A.value = null, y.value && N();
|
|
249
|
+
}), (e, t) => (H(), W("div", {
|
|
250
|
+
ref_key: "containerRef",
|
|
251
|
+
ref: y,
|
|
252
|
+
class: "vfp-relative vfp-w-full vfp-h-full vfp-bg-media-bg"
|
|
253
|
+
}, [
|
|
254
|
+
A.value ? (H(), W("div", xe, [
|
|
255
|
+
B("div", Le, [
|
|
256
|
+
B("p", Ee, U(A.value), 1)
|
|
257
|
+
])
|
|
258
|
+
])) : Z("", !0),
|
|
259
|
+
_.value ? (H(), W("div", _e, [
|
|
260
|
+
B("div", Ae, [
|
|
261
|
+
t[0] || (t[0] = B("div", { class: "vfp-inline-block vfp-w-8 vfp-h-8 vfp-border-4 vfp-border-spinner-track vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)),
|
|
262
|
+
B("p", ze, U(le(R)("cad.loading")), 1)
|
|
263
|
+
])
|
|
264
|
+
])) : Z("", !0)
|
|
265
|
+
], 512));
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
export {
|
|
269
|
+
Ve as default
|
|
270
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as V,
|
|
1
|
+
import { defineComponent as $, ref as y, watch as G, computed as h, openBlock as a, createElementBlock as r, createElementVNode as e, createBlock as S, unref as u, normalizeClass as x, Fragment as g, renderList as k, toDisplayString as o, createCommentVNode as T } from "vue";
|
|
2
|
+
import { u as V, b as j, M as z, $ as d, e as A, _ as D } from "./index-xY2bzsk7.mjs";
|
|
3
3
|
import { _ as I } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
4
|
-
const
|
|
4
|
+
const O = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-bg-[#0f0f12]"
|
|
7
|
-
},
|
|
7
|
+
}, R = { class: "content-scroll" }, X = { class: "timeline" }, Y = { class: "cues" }, q = { class: "cue-meta" }, H = { class: "cue-time" }, J = { class: "cue-time" }, K = { class: "cue-id" }, P = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "cue-style"
|
|
10
10
|
}, Q = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "cue-words"
|
|
13
|
-
}, U = ["title"], W = { class: "cue-word-time" }, Z = { class: "cue-word-text" }, ee = { class: "status-pill" }, se = /* @__PURE__ */
|
|
13
|
+
}, U = ["title"], W = { class: "cue-word-time" }, Z = { class: "cue-word-text" }, ee = { class: "status-pill" }, se = /* @__PURE__ */ $({
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
16
16
|
url: {},
|
|
17
17
|
fileName: {}
|
|
18
18
|
},
|
|
19
19
|
setup(B, { expose: C }) {
|
|
20
|
-
const
|
|
20
|
+
const p = B, { t: c } = V(), F = j(), v = y(""), f = y(!0), i = y(null), N = {
|
|
21
21
|
srt: "srt",
|
|
22
22
|
vtt: "vtt",
|
|
23
23
|
lrc: "lrc",
|
|
@@ -26,15 +26,15 @@ const R = {
|
|
|
26
26
|
ssa: "ssa",
|
|
27
27
|
ttml: "ttml",
|
|
28
28
|
dfxp: "ttml"
|
|
29
|
-
},
|
|
29
|
+
}, E = (t) => {
|
|
30
30
|
var l;
|
|
31
31
|
const s = ((l = t.split(".").pop()) == null ? void 0 : l.toLowerCase()) || "";
|
|
32
|
-
return
|
|
32
|
+
return N[s];
|
|
33
33
|
};
|
|
34
|
-
G(() =>
|
|
34
|
+
G(() => p.url, async () => {
|
|
35
35
|
f.value = !0, i.value = null;
|
|
36
36
|
try {
|
|
37
|
-
|
|
37
|
+
v.value = await A(p.url, { fetcher: F.value });
|
|
38
38
|
} catch (t) {
|
|
39
39
|
console.error(t), i.value = c.value("subtitle.load_failed");
|
|
40
40
|
} finally {
|
|
@@ -42,9 +42,9 @@ const R = {
|
|
|
42
42
|
}
|
|
43
43
|
}, { immediate: !0 });
|
|
44
44
|
const n = h(() => {
|
|
45
|
-
if (!
|
|
45
|
+
if (!v.value) return null;
|
|
46
46
|
try {
|
|
47
|
-
return z(
|
|
47
|
+
return z(v.value, E(p.fileName));
|
|
48
48
|
} catch (t) {
|
|
49
49
|
return console.error(t), null;
|
|
50
50
|
}
|
|
@@ -54,10 +54,10 @@ const R = {
|
|
|
54
54
|
}), b = h(() => {
|
|
55
55
|
var t;
|
|
56
56
|
return ((t = n.value) == null ? void 0 : t.metadata) ?? {};
|
|
57
|
-
}),
|
|
57
|
+
}), L = (t) => d(t).slice(3, 8);
|
|
58
58
|
return C({
|
|
59
59
|
getToolbarGroups: () => []
|
|
60
|
-
}), (t, s) => f.value ? (a(), r("div",
|
|
60
|
+
}), (t, s) => f.value ? (a(), r("div", O, [...s[0] || (s[0] = [
|
|
61
61
|
e("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
62
62
|
])])) : i.value || !n.value ? (a(), S(I, {
|
|
63
63
|
key: 1,
|
|
@@ -67,10 +67,10 @@ const R = {
|
|
|
67
67
|
key: 2,
|
|
68
68
|
class: x(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", m.value ? "flavor-lyric" : "flavor-subtitle"])
|
|
69
69
|
}, [
|
|
70
|
-
e("div",
|
|
71
|
-
e("div",
|
|
70
|
+
e("div", R, [
|
|
71
|
+
e("div", X, [
|
|
72
72
|
s[3] || (s[3] = e("div", { class: "timeline-line" }, null, -1)),
|
|
73
|
-
e("ol",
|
|
73
|
+
e("ol", Y, [
|
|
74
74
|
(a(!0), r(g, null, k(n.value.cues, (l, w) => (a(), r("li", {
|
|
75
75
|
key: "cue-" + w,
|
|
76
76
|
class: "cue-row"
|
|
@@ -84,12 +84,12 @@ const R = {
|
|
|
84
84
|
l.style ? (a(), r("span", P, o(l.style), 1)) : T("", !0)
|
|
85
85
|
]),
|
|
86
86
|
l.words && l.words.length > 0 ? (a(), r("div", Q, [
|
|
87
|
-
(a(!0), r(g, null, k(l.words, (_,
|
|
88
|
-
key: "w-" +
|
|
87
|
+
(a(!0), r(g, null, k(l.words, (_, M) => (a(), r("span", {
|
|
88
|
+
key: "w-" + M,
|
|
89
89
|
class: "cue-word",
|
|
90
90
|
title: u(d)(_.start)
|
|
91
91
|
}, [
|
|
92
|
-
e("span", W, o(
|
|
92
|
+
e("span", W, o(L(_.start)), 1),
|
|
93
93
|
e("span", Z, o(_.text), 1)
|
|
94
94
|
], 8, U))), 128))
|
|
95
95
|
])) : (a(), r("p", {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as m, ref as a, watch as _, openBlock as s, createElementBlock as f, createElementVNode as p, createBlock as h } from "vue";
|
|
2
|
+
import { u as w, b as y, S as g } from "./index-xY2bzsk7.mjs";
|
|
3
|
+
import { _ as b } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
4
|
+
const k = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
7
|
+
}, x = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
|
|
10
|
+
}, T = ["innerHTML"], L = /* @__PURE__ */ m({
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
url: {}
|
|
14
|
+
},
|
|
15
|
+
setup(u, { expose: v }) {
|
|
16
|
+
const n = u, { t: c } = w(), i = y(), t = a(""), o = a(!0), r = a(null), d = async () => {
|
|
17
|
+
o.value = !0, r.value = null, t.value = "";
|
|
18
|
+
try {
|
|
19
|
+
const e = await i.value(n.url);
|
|
20
|
+
if (!e.ok) throw new Error("load failed");
|
|
21
|
+
const l = await e.arrayBuffer();
|
|
22
|
+
t.value = await g(l);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error("Ppt 解析错误:", e), r.value = c.value("ppt.parse_failed");
|
|
25
|
+
} finally {
|
|
26
|
+
o.value = !1;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return _(() => n.url, (e) => {
|
|
30
|
+
e && d();
|
|
31
|
+
}, { immediate: !0 }), v({
|
|
32
|
+
getToolbarGroups: () => []
|
|
33
|
+
}), (e, l) => o.value ? (s(), f("div", k, [...l[0] || (l[0] = [
|
|
34
|
+
p("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
35
|
+
])])) : r.value ? (s(), h(b, {
|
|
36
|
+
key: 1,
|
|
37
|
+
message: r.value
|
|
38
|
+
}, null, 8, ["message"])) : (s(), f("div", x, [
|
|
39
|
+
p("div", {
|
|
40
|
+
class: "vfp-legacy-ppt-wrap",
|
|
41
|
+
innerHTML: t.value
|
|
42
|
+
}, null, 8, T)
|
|
43
|
+
]));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
L as default
|
|
48
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as d, ref as
|
|
2
|
-
import { u as le,
|
|
1
|
+
import { defineComponent as d, ref as U, watch as h, openBlock as $, createElementBlock as q, createElementVNode as x, createBlock as K, createVNode as C, unref as ee, h as g, inject as ne, computed as H } from "vue";
|
|
2
|
+
import { u as le, b as te, e as ie, L as ue, G as fe, c as oe } from "./index-xY2bzsk7.mjs";
|
|
3
3
|
import { _ as se } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
4
4
|
import { ChevronDown as ce, ChevronRight as pe } from "lucide-vue-next";
|
|
5
5
|
function ke(e, f = !1) {
|
|
@@ -240,13 +240,13 @@ var Q;
|
|
|
240
240
|
(function(e) {
|
|
241
241
|
e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
|
|
242
242
|
})(Q || (Q = {}));
|
|
243
|
-
var
|
|
243
|
+
var I;
|
|
244
244
|
(function(e) {
|
|
245
245
|
e.DEFAULT = {
|
|
246
246
|
allowTrailingComma: !1
|
|
247
247
|
};
|
|
248
|
-
})(
|
|
249
|
-
function ge(e, f = [], c =
|
|
248
|
+
})(I || (I = {}));
|
|
249
|
+
function ge(e, f = [], c = I.DEFAULT) {
|
|
250
250
|
let n = null, t = [];
|
|
251
251
|
const o = [];
|
|
252
252
|
function i(p) {
|
|
@@ -276,7 +276,7 @@ function ge(e, f = [], c = U.DEFAULT) {
|
|
|
276
276
|
}
|
|
277
277
|
}, c), t[0];
|
|
278
278
|
}
|
|
279
|
-
function re(e, f, c =
|
|
279
|
+
function re(e, f, c = I.DEFAULT) {
|
|
280
280
|
const n = ke(e, !1), t = [];
|
|
281
281
|
let o = 0;
|
|
282
282
|
function i(s) {
|
|
@@ -362,20 +362,20 @@ function re(e, f, c = U.DEFAULT) {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function u(s, m = [],
|
|
366
|
-
if (l(s), m.length +
|
|
365
|
+
function u(s, m = [], J = []) {
|
|
366
|
+
if (l(s), m.length + J.length > 0) {
|
|
367
367
|
let E = n.getToken();
|
|
368
368
|
for (; E !== 17; ) {
|
|
369
369
|
if (m.indexOf(E) !== -1) {
|
|
370
370
|
k();
|
|
371
371
|
break;
|
|
372
|
-
} else if (
|
|
372
|
+
} else if (J.indexOf(E) !== -1)
|
|
373
373
|
break;
|
|
374
374
|
E = k();
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function G(s) {
|
|
379
379
|
const m = n.getTokenValue();
|
|
380
380
|
return s ? A(m) : (L(m), t.push(m)), k(), !0;
|
|
381
381
|
}
|
|
@@ -408,7 +408,7 @@ function re(e, f, c = U.DEFAULT) {
|
|
|
408
408
|
2,
|
|
409
409
|
5
|
|
410
410
|
/* SyntaxKind.CommaToken */
|
|
411
|
-
]), !1) : (
|
|
411
|
+
]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(), F() || u(4, [], [
|
|
412
412
|
2,
|
|
413
413
|
5
|
|
414
414
|
/* SyntaxKind.CommaToken */
|
|
@@ -463,7 +463,7 @@ function re(e, f, c = U.DEFAULT) {
|
|
|
463
463
|
case 1:
|
|
464
464
|
return S();
|
|
465
465
|
case 10:
|
|
466
|
-
return
|
|
466
|
+
return G(!0);
|
|
467
467
|
default:
|
|
468
468
|
return X();
|
|
469
469
|
}
|
|
@@ -479,10 +479,10 @@ var z;
|
|
|
479
479
|
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
480
480
|
})(z || (z = {}));
|
|
481
481
|
const me = ge;
|
|
482
|
-
var
|
|
482
|
+
var Y;
|
|
483
483
|
(function(e) {
|
|
484
484
|
e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
|
|
485
|
-
})(
|
|
485
|
+
})(Y || (Y = {}));
|
|
486
486
|
const ae = {
|
|
487
487
|
key: 0,
|
|
488
488
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
@@ -514,7 +514,7 @@ function Oe(e) {
|
|
|
514
514
|
function ye(e, f) {
|
|
515
515
|
return e === null ? g("span", { class: "json-null", style: { color: f.keyword } }, "null") : e === void 0 ? g("span", { class: "json-null", style: { color: f.keyword } }, "undefined") : typeof e == "boolean" ? g("span", { style: { color: f.keyword } }, String(e)) : typeof e == "number" ? g("span", { style: { color: f.number } }, String(e)) : typeof e == "string" ? g("span", { style: { color: f.string } }, `"${e}"`) : g("span", { style: { color: f.bracket } }, String(e));
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function M(e, f, c, n, t) {
|
|
518
518
|
return g("div", { class: "json-row", style: { paddingLeft: `${c}px` } }, [
|
|
519
519
|
g("span", { class: "json-arrow-placeholder" }),
|
|
520
520
|
e !== void 0 ? g("span", { class: "json-key", style: { color: n.key } }, [
|
|
@@ -533,7 +533,7 @@ const D = d({
|
|
|
533
533
|
defaultExpanded: { type: Boolean, default: !1 }
|
|
534
534
|
},
|
|
535
535
|
setup(e) {
|
|
536
|
-
const f =
|
|
536
|
+
const f = U(e.defaultExpanded), c = () => {
|
|
537
537
|
f.value = !f.value;
|
|
538
538
|
}, n = ne(ue, null), t = H(() => (n == null ? void 0 : n.t.value) ?? fe({ locale: "zh-CN" })), o = oe(), i = H(() => Oe(o.value));
|
|
539
539
|
return { expanded: f, toggle: c, tFunc: t, colors: i };
|
|
@@ -541,10 +541,10 @@ const D = d({
|
|
|
541
541
|
render() {
|
|
542
542
|
const { keyName: e, value: f, depth: c, expanded: n, toggle: t, tFunc: o, colors: i } = this, a = c * 20;
|
|
543
543
|
if (f == null || typeof f != "object")
|
|
544
|
-
return
|
|
544
|
+
return M(e, f, a, i);
|
|
545
545
|
const p = Array.isArray(f), b = (p ? f : Object.entries(f)).length, r = p ? "[" : "{", L = p ? "]" : "}";
|
|
546
546
|
if (b === 0)
|
|
547
|
-
return
|
|
547
|
+
return M(e, null, a, i, `${r}${L}`);
|
|
548
548
|
const O = [];
|
|
549
549
|
return O.push(
|
|
550
550
|
g("div", {
|
|
@@ -586,7 +586,7 @@ const D = d({
|
|
|
586
586
|
fileName: {}
|
|
587
587
|
},
|
|
588
588
|
setup(e, { expose: f }) {
|
|
589
|
-
const c = e, { t: n } = le(), t = te(), o =
|
|
589
|
+
const c = e, { t: n } = le(), t = te(), o = U(null), i = U(!0), a = U(null);
|
|
590
590
|
return h(() => c.url, async () => {
|
|
591
591
|
i.value = !0, a.value = null;
|
|
592
592
|
try {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as G,
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as c, watch as M, computed as D, openBlock as n, createElementBlock as a, createElementVNode as r, createBlock as H, unref as h, toDisplayString as w, normalizeStyle as B, Fragment as y, renderList as F } from "vue";
|
|
2
|
+
import { u as G, b as N, e as P } from "./index-xY2bzsk7.mjs";
|
|
3
|
+
import { u as X } from "./useShikiHighlight-DwEsf_jW.mjs";
|
|
4
|
+
import { _ as j } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
|
+
const E = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
8
|
-
},
|
|
8
|
+
}, q = {
|
|
9
9
|
key: 2,
|
|
10
10
|
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
11
11
|
style: { background: "var(--fp-code-bg)" }
|
|
12
|
-
},
|
|
12
|
+
}, A = { class: "vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm vfp-whitespace-pre-wrap vfp-break-words" }, C = {
|
|
13
13
|
key: 3,
|
|
14
14
|
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
15
15
|
style: { background: "var(--fp-code-bg)" }
|
|
16
|
-
},
|
|
16
|
+
}, I = { class: "vfp-code-gutter" }, O = ["innerHTML"], W = /* @__PURE__ */ L({
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
19
19
|
url: {},
|
|
20
20
|
fileName: {}
|
|
21
21
|
},
|
|
22
|
-
setup(_, { expose:
|
|
23
|
-
const v = _, { t:
|
|
22
|
+
setup(_, { expose: b }) {
|
|
23
|
+
const v = _, { t: k } = G(), x = N(), p = c(""), u = c(!0), i = c(null), S = c("xml"), { lineHtmls: d } = X(p, S), T = (e) => {
|
|
24
24
|
const t = " ", o = /(>)(<)(\/*)/g, l = e.replace(o, `$1
|
|
25
25
|
$2$3`);
|
|
26
26
|
let s = 0;
|
|
@@ -42,39 +42,39 @@ $2$3`);
|
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
M(() => v.url, async () => {
|
|
46
46
|
u.value = !0, i.value = null;
|
|
47
47
|
try {
|
|
48
|
-
const e = await
|
|
48
|
+
const e = await P(v.url, { fetcher: x.value });
|
|
49
49
|
p.value = $(e);
|
|
50
50
|
} catch (e) {
|
|
51
|
-
console.error(e), i.value =
|
|
51
|
+
console.error(e), i.value = k.value("xml.load_failed");
|
|
52
52
|
} finally {
|
|
53
53
|
u.value = !1;
|
|
54
54
|
}
|
|
55
55
|
}, { immediate: !0 });
|
|
56
56
|
const m = D(() => p.value.split(`
|
|
57
57
|
`));
|
|
58
|
-
return
|
|
58
|
+
return b({
|
|
59
59
|
getToolbarGroups: () => []
|
|
60
|
-
}), (e, t) => u.value ? (n(), a("div",
|
|
60
|
+
}), (e, t) => u.value ? (n(), a("div", E, [...t[0] || (t[0] = [
|
|
61
61
|
r("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
62
|
-
])])) : i.value ? (n(), H(
|
|
62
|
+
])])) : i.value ? (n(), H(j, {
|
|
63
63
|
key: 1,
|
|
64
64
|
message: i.value
|
|
65
|
-
}, null, 8, ["message"])) : h(d).length === 0 ? (n(), a("div",
|
|
66
|
-
r("pre",
|
|
67
|
-
])) : (n(), a("div",
|
|
65
|
+
}, null, 8, ["message"])) : h(d).length === 0 ? (n(), a("div", q, [
|
|
66
|
+
r("pre", A, w(p.value), 1)
|
|
67
|
+
])) : (n(), a("div", C, [
|
|
68
68
|
r("div", {
|
|
69
69
|
class: "vfp-code-block with-line-numbers vfp-w-full",
|
|
70
70
|
style: B({ gridTemplateRows: `repeat(${m.value.length}, auto) minmax(1.5rem, 1fr)` })
|
|
71
71
|
}, [
|
|
72
72
|
(n(!0), a(y, null, F(m.value, (o, l) => (n(), a(y, { key: l }, [
|
|
73
|
-
r("span",
|
|
73
|
+
r("span", I, w(l + 1), 1),
|
|
74
74
|
r("span", {
|
|
75
75
|
class: "vfp-code-line",
|
|
76
76
|
innerHTML: h(d)[l] ?? ""
|
|
77
|
-
}, null, 8,
|
|
77
|
+
}, null, 8, O)
|
|
78
78
|
], 64))), 128)),
|
|
79
79
|
t[1] || (t[1] = r("span", { class: "vfp-code-gutter-filler" }, null, -1)),
|
|
80
80
|
t[2] || (t[2] = r("span", { class: "vfp-code-line-filler" }, null, -1))
|