@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.
Files changed (125) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/lib/FilePreviewContent.vue.d.ts +17 -6
  4. package/lib/FilePreviewEmbed.vue.d.ts +14 -6
  5. package/lib/FilePreviewModal.vue.d.ts +14 -6
  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
  7. package/lib/chunks/{avifLoader-CAUzjn-d-C0KRpetN.mjs → avifLoader-CAUzjn-d-CnJpGYJ2.mjs} +1 -1
  8. package/lib/chunks/{heicLoader-D_9PukkA-Czof_5FJ.mjs → heicLoader-D_9PukkA-g_dLrWLP.mjs} +1 -1
  9. package/lib/chunks/index-6XZXYqbp.mjs +125 -0
  10. package/lib/chunks/{index-B21EAyWz.mjs → index-BPSzwMOC.mjs} +51 -51
  11. package/lib/chunks/index-BYQ9S7Mk.mjs +104 -0
  12. package/lib/chunks/{index-8Vpbg2kS.mjs → index-Bf94DwQu.mjs} +105 -104
  13. package/lib/chunks/index-BfOWoMpY.mjs +359 -0
  14. package/lib/chunks/index-Bg8poMIm.mjs +117 -0
  15. package/lib/chunks/index-BzwJ0VWu.mjs +108 -0
  16. package/lib/chunks/index-C41YET0_.mjs +51 -0
  17. package/lib/chunks/{index-BvBqDq3O.mjs → index-C4hIk6pa.mjs} +2023 -2023
  18. package/lib/chunks/{index-BASg1cr4.mjs → index-C8lyQPe3.mjs} +1018 -1018
  19. package/lib/chunks/{index-C9mAajbD.mjs → index-CWPdNhoe.mjs} +200 -200
  20. package/lib/chunks/{index-BuqPb5mP.mjs → index-CrVQPnFj.mjs} +112 -112
  21. package/lib/chunks/{index-D30L8tm9.mjs → index-D5IF9F-D.mjs} +57 -57
  22. package/lib/chunks/{index-DN4Ui0Gh.mjs → index-DFeKS8tR.mjs} +120 -120
  23. package/lib/chunks/index-DM8Dfl-m.mjs +52 -0
  24. package/lib/chunks/index-DZe0BxAB.mjs +90 -0
  25. package/lib/chunks/{index-BlrFFeqc.mjs → index-GFcSJEwj.mjs} +75 -75
  26. package/lib/chunks/{index-Dkro_8Fy.mjs → index-LPGxJDnT.mjs} +32 -32
  27. package/lib/chunks/index-aKiIuKKx.mjs +157 -0
  28. package/lib/chunks/{index-DZZN3kYi.mjs → index-c-pYJEmH.mjs} +1589 -1394
  29. package/lib/chunks/{index-CxKZKUJj.mjs → index-z9RqL2wI.mjs} +1651 -1651
  30. package/lib/chunks/index-zLQlyNR2.mjs +383 -0
  31. package/lib/chunks/{jp2Loader-Dig19xyo-CKUaGhPl.mjs → jp2Loader-Dig19xyo-fCO1knZ0.mjs} +1 -1
  32. package/lib/chunks/{psdLoader-C0tKUXXl-CYWoQis5.mjs → psdLoader-C0tKUXXl-DihMskai.mjs} +1 -1
  33. package/lib/chunks/{rawLoader-C-tPeFAB-C35zC8nZ.mjs → rawLoader-C-tPeFAB-BSfDPl-z.mjs} +5 -5
  34. package/lib/chunks/{tiffLoader-BlhByX8w-BOxg_Du5.mjs → tiffLoader-BlhByX8w-JY5DaTre.mjs} +1 -1
  35. package/lib/chunks/{useShikiHighlight-BPmcxA-h.mjs → useShikiHighlight-C-ztcJBE.mjs} +1 -1
  36. package/lib/composables/useAudioPlayer.d.ts +1 -1
  37. package/lib/composables/usePreviewEvents.d.ts +27 -0
  38. package/lib/composables/useRequest.d.ts +16 -4
  39. package/lib/composables/useThemeMode.d.ts +1 -1
  40. package/lib/composables/useTranslator.d.ts +2 -2
  41. package/lib/core/events.d.ts +52 -0
  42. package/lib/core/i18n/index.d.ts +29 -0
  43. package/lib/core/i18n/messages/en-US.d.ts +5 -0
  44. package/lib/core/i18n/messages/index.d.ts +9 -0
  45. package/lib/core/i18n/messages/zh-CN.d.ts +5 -0
  46. package/lib/core/i18n/types.d.ts +23 -0
  47. package/lib/core/index.d.ts +34 -0
  48. package/lib/core/loaders/avifLoader.d.ts +22 -0
  49. package/lib/core/loaders/heicLoader.d.ts +21 -0
  50. package/lib/core/loaders/jp2Loader.d.ts +16 -0
  51. package/lib/core/loaders/jp2Worker.d.ts +1 -0
  52. package/lib/core/loaders/psdLoader.d.ts +14 -0
  53. package/lib/core/loaders/rawLoader.d.ts +14 -0
  54. package/lib/core/loaders/registry.d.ts +32 -0
  55. package/lib/core/loaders/tiffLoader.d.ts +28 -0
  56. package/lib/core/loaders/types.d.ts +56 -0
  57. package/lib/core/types.d.ts +89 -0
  58. package/lib/core/utils/csvParser.d.ts +31 -0
  59. package/lib/core/utils/emptyState.d.ts +28 -0
  60. package/lib/core/utils/excelDataConverter.d.ts +61 -0
  61. package/lib/core/utils/fileNormalizer.d.ts +21 -0
  62. package/lib/core/utils/fileType.d.ts +21 -0
  63. package/lib/core/utils/legacy-office/doc.d.ts +25 -0
  64. package/lib/core/utils/legacy-office/index.d.ts +8 -0
  65. package/lib/core/utils/legacy-office/ole.d.ts +8 -0
  66. package/lib/core/utils/legacy-office/ppt.d.ts +79 -0
  67. package/lib/core/utils/legacy-office/xls.d.ts +28 -0
  68. package/lib/core/utils/mimeTypes.d.ts +29 -0
  69. package/lib/core/utils/ooxml/docx.d.ts +17 -0
  70. package/lib/core/utils/ooxml/index.d.ts +4 -0
  71. package/lib/core/utils/ooxml/pptx.d.ts +7 -0
  72. package/lib/core/utils/ooxml/xml.d.ts +15 -0
  73. package/lib/core/utils/ooxml/zip.d.ts +3 -0
  74. package/lib/core/utils/pdfWorker.d.ts +61 -0
  75. package/lib/core/utils/previewMode.d.ts +7 -0
  76. package/lib/core/utils/request.d.ts +49 -0
  77. package/lib/core/utils/subtitleParser.d.ts +44 -0
  78. package/lib/core/utils/textDecoder.d.ts +30 -0
  79. package/lib/core/utils/uint8ArrayPolyfill.d.ts +18 -0
  80. package/lib/core/utils/zipReader.d.ts +51 -0
  81. package/lib/core/workers/imageDecoder.worker.d.ts +31 -0
  82. package/lib/core/workers/workerClient.d.ts +14 -0
  83. package/lib/i18n/localeKey.d.ts +1 -1
  84. package/lib/index.cjs +60 -60
  85. package/lib/index.css +1 -1
  86. package/lib/index.d.ts +11 -9
  87. package/lib/index.mjs +15 -12
  88. package/lib/renderers/Audio/index.vue.d.ts +1 -1
  89. package/lib/renderers/Cad/index.vue.d.ts +1 -1
  90. package/lib/renderers/Cad/toolbar.d.ts +2 -2
  91. package/lib/renderers/Csv/index.vue.d.ts +1 -1
  92. package/lib/renderers/Doc/index.vue.d.ts +1 -1
  93. package/lib/renderers/Docx/index.vue.d.ts +1 -1
  94. package/lib/renderers/Epub/index.vue.d.ts +1 -1
  95. package/lib/renderers/Font/index.vue.d.ts +1 -1
  96. package/lib/renderers/Image/index.vue.d.ts +2 -2
  97. package/lib/renderers/Json/index.vue.d.ts +2 -2
  98. package/lib/renderers/Markdown/index.vue.d.ts +1 -1
  99. package/lib/renderers/Mobi/index.vue.d.ts +1 -1
  100. package/lib/renderers/Msg/index.vue.d.ts +1 -1
  101. package/lib/renderers/Pdf/index.vue.d.ts +1 -1
  102. package/lib/renderers/Ppt/index.vue.d.ts +1 -1
  103. package/lib/renderers/Pptx/index.vue.d.ts +2 -2
  104. package/lib/renderers/Subtitle/index.vue.d.ts +1 -1
  105. package/lib/renderers/Text/index.vue.d.ts +2 -2
  106. package/lib/renderers/Unsupported/index.vue.d.ts +1 -1
  107. package/lib/renderers/Video/index.vue.d.ts +1 -1
  108. package/lib/renderers/Xlsx/index.vue.d.ts +2 -2
  109. package/lib/renderers/Xml/index.vue.d.ts +1 -1
  110. package/lib/renderers/Zip/TreeItem.vue.d.ts +1 -1
  111. package/lib/renderers/Zip/index.vue.d.ts +1 -1
  112. package/lib/renderers/base.types.d.ts +1 -1
  113. package/lib/renderers/registry.d.ts +1 -1
  114. package/lib/types.d.ts +3 -3
  115. package/package.json +2 -2
  116. package/lib/chunks/index--612Smof.mjs +0 -383
  117. package/lib/chunks/index-BB0i4QqI.mjs +0 -117
  118. package/lib/chunks/index-BVdrGK3Q.mjs +0 -356
  119. package/lib/chunks/index-Bp9CuvMZ.mjs +0 -157
  120. package/lib/chunks/index-Bxpf9v5j.mjs +0 -104
  121. package/lib/chunks/index-CDg6vIbT.mjs +0 -51
  122. package/lib/chunks/index-CWE-hKSs.mjs +0 -90
  123. package/lib/chunks/index-CY3xzGgt.mjs +0 -108
  124. package/lib/chunks/index-VdzIFJJW.mjs +0 -118
  125. package/lib/chunks/index-aoXgVLBb.mjs +0 -52
@@ -1,90 +0,0 @@
1
- import { defineComponent as L, ref as u, watch as M, computed as X, openBlock as l, createElementBlock as a, createElementVNode as r, toDisplayString as d, unref as v, createBlock as D, normalizeStyle as H, Fragment as w, renderList as B } from "vue";
2
- import { u as F, c as G, X as N } from "./index-DZZN3kYi.mjs";
3
- import { u as P } from "./useShikiHighlight-BPmcxA-h.mjs";
4
- import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
- const j = {
6
- key: 0,
7
- class: "vfp-renderer-loading"
8
- }, q = { class: "vfp-renderer-loading-content" }, A = { class: "vfp-renderer-loading-text" }, C = {
9
- key: 2,
10
- class: "vfp-w-full vfp-h-full vfp-overflow-auto",
11
- style: { background: "var(--fp-code-bg)" }
12
- }, I = { class: "vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm vfp-whitespace-pre-wrap vfp-break-words" }, O = {
13
- key: 3,
14
- class: "vfp-w-full vfp-h-full vfp-overflow-auto",
15
- style: { background: "var(--fp-code-bg)" }
16
- }, R = { class: "vfp-code-gutter" }, V = ["innerHTML"], Z = /* @__PURE__ */ L({
17
- __name: "index",
18
- props: {
19
- url: {},
20
- fileName: {}
21
- },
22
- setup(k, { expose: x }) {
23
- const m = k, { t: g } = F(), b = G(), i = u(""), f = u(!0), c = u(null), S = u("xml"), { lineHtmls: _ } = P(i, S), T = (e) => {
24
- const t = " ", 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 z = t.repeat(n) + p;
32
- return n += y, z;
33
- }).join(`
34
- `);
35
- }, $ = (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 T(n);
41
- } catch {
42
- return e;
43
- }
44
- };
45
- M(() => m.url, async () => {
46
- f.value = !0, c.value = null;
47
- try {
48
- const e = await N(m.url, { fetcher: b.value });
49
- i.value = $(e);
50
- } catch (e) {
51
- console.error(e), c.value = g.value("xml.load_failed");
52
- } finally {
53
- f.value = !1;
54
- }
55
- }, { immediate: !0 });
56
- const h = X(() => i.value.split(`
57
- `));
58
- return x({
59
- getToolbarGroups: () => []
60
- }), (e, t) => f.value ? (l(), a("div", j, [
61
- r("div", q, [
62
- t[0] || (t[0] = r("div", { class: "vfp-renderer-spinner" }, null, -1)),
63
- r("span", A, d(v(g)("common.loading")), 1)
64
- ])
65
- ])) : c.value ? (l(), D(E, {
66
- key: 1,
67
- message: c.value
68
- }, null, 8, ["message"])) : v(_).length === 0 ? (l(), a("div", C, [
69
- r("pre", I, d(i.value), 1)
70
- ])) : (l(), a("div", O, [
71
- r("div", {
72
- class: "vfp-code-block with-line-numbers vfp-w-full",
73
- style: H({ gridTemplateRows: `repeat(${h.value.length}, auto) minmax(1.5rem, 1fr)` })
74
- }, [
75
- (l(!0), a(w, null, B(h.value, (o, s) => (l(), a(w, { key: s }, [
76
- r("span", R, d(s + 1), 1),
77
- r("span", {
78
- class: "vfp-code-line",
79
- innerHTML: v(_)[s] ?? ""
80
- }, null, 8, V)
81
- ], 64))), 128)),
82
- t[1] || (t[1] = r("span", { class: "vfp-code-gutter-filler" }, null, -1)),
83
- t[2] || (t[2] = r("span", { class: "vfp-code-line-filler" }, null, -1))
84
- ], 4)
85
- ]));
86
- }
87
- });
88
- export {
89
- Z as default
90
- };
@@ -1,108 +0,0 @@
1
- import { defineComponent as M, ref as l, watch as y, nextTick as $, computed as k, openBlock as i, createElementBlock as p, createElementVNode as r, toDisplayString as B, unref as F, createBlock as N, normalizeStyle as d, Fragment as I, renderList as C } from "vue";
2
- import { u as R, c as j, L as q, k as z, d as O, F as U } from "./index-DZZN3kYi.mjs";
3
- import V from "mammoth";
4
- import { _ as W } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
- const X = {
6
- key: 0,
7
- class: "vfp-renderer-loading"
8
- }, Y = { class: "vfp-renderer-loading-content" }, J = { class: "vfp-renderer-loading-text" }, K = {
9
- key: 2,
10
- class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto",
11
- style: { background: "rgba(0, 0, 0, 0.15)" }
12
- }, Q = ["innerHTML"], Z = ["innerHTML"], T = 1123, w = 60, b = 50, ee = 24, re = /* @__PURE__ */ M({
13
- __name: "index",
14
- props: {
15
- url: {}
16
- },
17
- setup(G, { expose: H }) {
18
- const E = T - w * 2, h = G, { t: f } = R(), A = j(), a = l(""), v = l(!0), c = l(null), s = l([]), m = l({}), _ = l(null), P = async () => {
19
- v.value = !0, c.value = null, a.value = "", s.value = [], m.value = {};
20
- try {
21
- const e = await A.value(h.url);
22
- if (!e.ok) throw new z("file.load_failed");
23
- const n = await e.arrayBuffer(), [t, o] = await Promise.all([
24
- V.convertToHtml({ arrayBuffer: n }, { styleMap: O }),
25
- U(n).catch(() => ({}))
26
- ]);
27
- m.value = o, a.value = t.value;
28
- } catch (e) {
29
- console.error(f.value("docx.parse_failed") + ":", e), c.value = f.value("docx.parse_failed");
30
- } finally {
31
- v.value = !1;
32
- }
33
- }, L = () => {
34
- const e = _.value;
35
- if (!e || !a.value) return;
36
- const n = Array.from(e.children);
37
- if (n.length === 0) {
38
- s.value = [a.value];
39
- return;
40
- }
41
- const t = [[]];
42
- let o = 0;
43
- for (const u of n) {
44
- const x = u.offsetHeight;
45
- o > 0 && o + x > E && (t.push([]), o = 0), t[t.length - 1].push(u.outerHTML), o += x;
46
- }
47
- t.length === 0 && t.push([]), s.value = t.map((u) => u.join(""));
48
- };
49
- y(() => h.url, (e) => {
50
- e && P();
51
- }, { immediate: !0 }), y(a, async () => {
52
- a.value && (await $(), requestAnimationFrame(() => L()));
53
- });
54
- const g = k(() => q(m.value)), S = k(() => ({
55
- ...g.value,
56
- position: "absolute",
57
- visibility: "hidden",
58
- width: `${794 - b * 2}px`,
59
- pointerEvents: "none"
60
- })), D = {
61
- width: "100%",
62
- maxWidth: "794px",
63
- minHeight: `${T}px`,
64
- background: "white",
65
- boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)",
66
- flexShrink: 0,
67
- padding: `${w}px ${b}px`
68
- };
69
- return H({
70
- getToolbarGroups: () => []
71
- }), (e, n) => v.value ? (i(), p("div", X, [
72
- r("div", Y, [
73
- n[0] || (n[0] = r("div", { class: "vfp-renderer-spinner" }, null, -1)),
74
- r("span", J, B(F(f)("common.loading")), 1)
75
- ])
76
- ])) : c.value ? (i(), N(W, {
77
- key: 1,
78
- message: c.value
79
- }, null, 8, ["message"])) : (i(), p("div", K, [
80
- r("div", {
81
- ref_key: "measureRef",
82
- ref: _,
83
- style: d(S.value),
84
- innerHTML: a.value
85
- }, null, 12, Q),
86
- r("div", {
87
- class: "vfp-flex vfp-flex-col vfp-items-center",
88
- style: d({ gap: `${ee}px` })
89
- }, [
90
- (i(!0), p(I, null, C(s.value.length > 0 ? s.value : [""], (t, o) => (i(), p("div", {
91
- key: o,
92
- style: d({
93
- ...D,
94
- boxShadow: "0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.10)"
95
- })
96
- }, [
97
- r("div", {
98
- style: d(g.value),
99
- innerHTML: t
100
- }, null, 12, Z)
101
- ], 4))), 128))
102
- ], 4)
103
- ]));
104
- }
105
- });
106
- export {
107
- re as default
108
- };
@@ -1,118 +0,0 @@
1
- import { defineComponent as X, ref as y, watch as Y, computed as g, openBlock as a, createElementBlock as r, createElementVNode as e, toDisplayString as o, unref as n, createBlock as S, normalizeClass as k, Fragment as h, renderList as b, createCommentVNode as T } from "vue";
2
- import { u as V, c as z, G as A, Y as d, X as D, _ as I } from "./index-DZZN3kYi.mjs";
3
- import { _ as M } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
- const O = {
5
- key: 0,
6
- class: "vfp-renderer-loading vfp-bg-[#0f0f12]"
7
- }, R = { class: "vfp-renderer-loading-content" }, $ = { class: "vfp-renderer-loading-text" }, j = { class: "content-scroll" }, q = { class: "timeline" }, H = { class: "cues" }, J = { class: "cue-meta" }, K = { class: "cue-time" }, P = { class: "cue-time" }, Q = { class: "cue-id" }, U = {
8
- key: 0,
9
- class: "cue-style"
10
- }, W = {
11
- key: 0,
12
- class: "cue-words"
13
- }, Z = ["title"], ee = { class: "cue-word-time" }, se = { class: "cue-word-text" }, te = { class: "status-pill" }, le = /* @__PURE__ */ X({
14
- __name: "index",
15
- props: {
16
- url: {},
17
- fileName: {}
18
- },
19
- setup(B, { expose: C }) {
20
- const v = B, { t: i } = V(), F = z(), p = y(""), f = y(!0), u = y(null), G = {
21
- srt: "srt",
22
- vtt: "vtt",
23
- lrc: "lrc",
24
- elrc: "elrc",
25
- ass: "ass",
26
- ssa: "ssa",
27
- ttml: "ttml",
28
- dfxp: "ttml"
29
- }, N = (t) => {
30
- var l;
31
- const s = ((l = t.split(".").pop()) == null ? void 0 : l.toLowerCase()) || "";
32
- return G[s];
33
- };
34
- Y(() => v.url, async () => {
35
- f.value = !0, u.value = null;
36
- try {
37
- p.value = await D(v.url, { fetcher: F.value });
38
- } catch (t) {
39
- console.error(t), u.value = i.value("subtitle.load_failed");
40
- } finally {
41
- f.value = !1;
42
- }
43
- }, { immediate: !0 });
44
- const c = g(() => {
45
- if (!p.value) return null;
46
- try {
47
- return A(p.value, N(v.fileName));
48
- } catch (t) {
49
- return console.error(t), null;
50
- }
51
- }), m = g(() => {
52
- var t, s;
53
- return ((t = c.value) == null ? void 0 : t.format) === "lrc" || ((s = c.value) == null ? void 0 : s.format) === "elrc";
54
- }), x = g(() => {
55
- var t;
56
- return ((t = c.value) == null ? void 0 : t.metadata) ?? {};
57
- }), E = (t) => d(t).slice(3, 8);
58
- return C({
59
- getToolbarGroups: () => []
60
- }), (t, s) => f.value ? (a(), r("div", O, [
61
- e("div", R, [
62
- s[0] || (s[0] = e("div", { class: "vfp-renderer-spinner" }, null, -1)),
63
- e("span", $, o(n(i)("common.loading")), 1)
64
- ])
65
- ])) : u.value || !c.value ? (a(), S(M, {
66
- key: 1,
67
- message: u.value || n(i)("subtitle.parse_failed"),
68
- class: "vfp-bg-[#0f0f12]"
69
- }, null, 8, ["message"])) : (a(), r("div", {
70
- key: 2,
71
- class: k(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", m.value ? "flavor-lyric" : "flavor-subtitle"])
72
- }, [
73
- e("div", j, [
74
- e("div", q, [
75
- s[3] || (s[3] = e("div", { class: "timeline-line" }, null, -1)),
76
- e("ol", H, [
77
- (a(!0), r(h, null, b(c.value.cues, (l, w) => (a(), r("li", {
78
- key: "cue-" + w,
79
- class: "cue-row"
80
- }, [
81
- s[2] || (s[2] = e("div", { class: "cue-dot" }, null, -1)),
82
- e("div", J, [
83
- e("span", K, o(n(d)(l.start)), 1),
84
- s[1] || (s[1] = e("span", { class: "cue-arrow" }, "→", -1)),
85
- e("span", P, o(n(d)(l.end)), 1),
86
- e("span", Q, "#" + o(l.id ?? w + 1), 1),
87
- l.style ? (a(), r("span", U, o(l.style), 1)) : T("", !0)
88
- ]),
89
- l.words && l.words.length > 0 ? (a(), r("div", W, [
90
- (a(!0), r(h, null, b(l.words, (_, L) => (a(), r("span", {
91
- key: "w-" + L,
92
- class: "cue-word",
93
- title: n(d)(_.start)
94
- }, [
95
- e("span", ee, o(E(_.start)), 1),
96
- e("span", se, o(_.text), 1)
97
- ], 8, Z))), 128))
98
- ])) : (a(), r("p", {
99
- key: 1,
100
- class: k(["cue-text", { lyric: m.value }])
101
- }, o(l.text), 3))
102
- ]))), 128))
103
- ])
104
- ])
105
- ]),
106
- e("div", te, [
107
- e("span", null, o(c.value.cues.length) + " " + o(m.value ? n(i)("subtitle.lines") : n(i)("subtitle.cues")), 1),
108
- x.value.length ? (a(), r(h, { key: 0 }, [
109
- s[4] || (s[4] = e("span", { class: "dot" }, "·", -1)),
110
- e("span", null, o(x.value.length), 1)
111
- ], 64)) : T("", !0)
112
- ])
113
- ], 2));
114
- }
115
- }), ie = /* @__PURE__ */ I(le, [["__scopeId", "data-v-e2b8685e"]]);
116
- export {
117
- ie as default
118
- };
@@ -1,52 +0,0 @@
1
- import { defineComponent as _, ref as n, watch as m, openBlock as c, createElementBlock as f, createElementVNode as o, toDisplayString as h, unref as g, createBlock as y } from "vue";
2
- import { u as x, c as k, k as w, H as T } from "./index-DZZN3kYi.mjs";
3
- import { _ as B } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
- const H = {
5
- key: 0,
6
- class: "vfp-renderer-loading"
7
- }, b = { class: "vfp-renderer-loading-content" }, D = { class: "vfp-renderer-loading-text" }, E = {
8
- key: 2,
9
- class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
10
- }, G = { class: "vfp-flex vfp-flex-col vfp-items-center" }, L = { class: "vfp-legacy-doc-paper" }, M = ["innerHTML"], V = /* @__PURE__ */ _({
11
- __name: "index",
12
- props: {
13
- url: {}
14
- },
15
- setup(u, { expose: d }) {
16
- const i = u, { t: l } = x(), p = k(), r = n(""), t = n(!0), s = n(null), v = async () => {
17
- t.value = !0, s.value = null, r.value = "";
18
- try {
19
- const e = await p.value(i.url);
20
- if (!e.ok) throw new w("file.load_failed");
21
- const a = await e.arrayBuffer();
22
- r.value = await T(a);
23
- } catch (e) {
24
- console.error(l.value("doc.parse_failed") + ":", e), s.value = l.value("doc.parse_failed");
25
- } finally {
26
- t.value = !1;
27
- }
28
- };
29
- return m(() => i.url, (e) => {
30
- e && v();
31
- }, { immediate: !0 }), d({
32
- getToolbarGroups: () => []
33
- }), (e, a) => t.value ? (c(), f("div", H, [
34
- o("div", b, [
35
- a[0] || (a[0] = o("div", { class: "vfp-renderer-spinner" }, null, -1)),
36
- o("span", D, h(g(l)("common.loading")), 1)
37
- ])
38
- ])) : s.value ? (c(), y(B, {
39
- key: 1,
40
- message: s.value
41
- }, null, 8, ["message"])) : (c(), f("div", E, [
42
- o("div", G, [
43
- o("div", L, [
44
- o("div", { innerHTML: r.value }, null, 8, M)
45
- ])
46
- ])
47
- ]));
48
- }
49
- });
50
- export {
51
- V as default
52
- };