@eternalheart/vue-file-preview 1.6.13 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +4 -0
  2. package/README.zh-CN.md +4 -0
  3. package/lib/FilePreviewContent.vue.d.ts +25 -6
  4. package/lib/FilePreviewEmbed.vue.d.ts +19 -6
  5. package/lib/FilePreviewModal.vue.d.ts +19 -6
  6. package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs → EmptyState.vue_vue_type_script_setup_true_lang-DSQp7H-K.mjs} +1 -1
  7. package/lib/chunks/{avifLoader-CAUzjn-d-C0KRpetN.mjs → avifLoader-CAUzjn-d-Cf00sjt2.mjs} +1 -1
  8. package/lib/chunks/{heicLoader-D_9PukkA-Czof_5FJ.mjs → heicLoader-D_9PukkA-cn1P7b2x.mjs} +1 -1
  9. package/lib/chunks/{index-BASg1cr4.mjs → index-0VXtKKev.mjs} +1018 -1018
  10. package/lib/chunks/index-0fXL30y0.mjs +333 -0
  11. package/lib/chunks/{index-C9mAajbD.mjs → index-B1AwVHWI.mjs} +191 -191
  12. package/lib/chunks/{index-BvBqDq3O.mjs → index-B77rFiau.mjs} +2023 -2023
  13. package/lib/chunks/index-BB10as16.mjs +108 -0
  14. package/lib/chunks/index-BBIn-k4u.mjs +359 -0
  15. package/lib/chunks/index-BSzaI9ea.mjs +122 -0
  16. package/lib/chunks/index-BZvy39tn.mjs +117 -0
  17. package/lib/chunks/index-BlJEM2Lb.mjs +383 -0
  18. package/lib/chunks/{index-CxKZKUJj.mjs → index-CZlnxQFA.mjs} +1385 -1385
  19. package/lib/chunks/index-ClhTPqDI.mjs +137 -0
  20. package/lib/chunks/{index-8Vpbg2kS.mjs → index-D690gnNu.mjs} +118 -117
  21. package/lib/chunks/index-D7WykPYL.mjs +51 -0
  22. package/lib/chunks/{index-DZZN3kYi.mjs → index-DBzyeU0G.mjs} +1609 -1375
  23. package/lib/chunks/{index-Dkro_8Fy.mjs → index-DKFX5ToE.mjs} +33 -33
  24. package/lib/chunks/index-DRmKaFXK.mjs +157 -0
  25. package/lib/chunks/index-DXf3wXT5.mjs +155 -0
  26. package/lib/chunks/{index-BuqPb5mP.mjs → index-Dp7QQjNH.mjs} +114 -114
  27. package/lib/chunks/index-FzI__DHC.mjs +104 -0
  28. package/lib/chunks/index-PWjCziZG.mjs +90 -0
  29. package/lib/chunks/index-bT6XWKO_.mjs +52 -0
  30. package/lib/chunks/{index-DN4Ui0Gh.mjs → index-tX9VR6Vo.mjs} +122 -122
  31. package/lib/chunks/{jp2Loader-Dig19xyo-CKUaGhPl.mjs → jp2Loader-Dig19xyo-D-OEDL3n.mjs} +1 -1
  32. package/lib/chunks/{psdLoader-C0tKUXXl-CYWoQis5.mjs → psdLoader-C0tKUXXl-CVN06LUc.mjs} +1 -1
  33. package/lib/chunks/{rawLoader-C-tPeFAB-C35zC8nZ.mjs → rawLoader-C-tPeFAB-DBqcJPFK.mjs} +5 -5
  34. package/lib/chunks/{tiffLoader-BlhByX8w-BOxg_Du5.mjs → tiffLoader-BlhByX8w-8-0icdyL.mjs} +1 -1
  35. package/lib/chunks/{useShikiHighlight-BPmcxA-h.mjs → useShikiHighlight-a_GUszuU.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 +69 -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-B21EAyWz.mjs +0 -137
  118. package/lib/chunks/index-BB0i4QqI.mjs +0 -117
  119. package/lib/chunks/index-BVdrGK3Q.mjs +0 -356
  120. package/lib/chunks/index-BlrFFeqc.mjs +0 -330
  121. package/lib/chunks/index-Bp9CuvMZ.mjs +0 -157
  122. package/lib/chunks/index-Bxpf9v5j.mjs +0 -104
  123. package/lib/chunks/index-CDg6vIbT.mjs +0 -51
  124. package/lib/chunks/index-CWE-hKSs.mjs +0 -90
  125. package/lib/chunks/index-CY3xzGgt.mjs +0 -108
  126. package/lib/chunks/index-D30L8tm9.mjs +0 -155
  127. package/lib/chunks/index-VdzIFJJW.mjs +0 -118
  128. package/lib/chunks/index-aoXgVLBb.mjs +0 -52
@@ -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
- };