@eternalheart/vue-file-preview 1.6.11 → 1.6.13

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 (54) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/lib/FilePreviewContent.vue.d.ts +9 -1
  4. package/lib/FilePreviewEmbed.vue.d.ts +4 -1
  5. package/lib/FilePreviewModal.vue.d.ts +4 -1
  6. package/lib/chunks/EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs +20 -0
  7. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs +32 -0
  8. package/lib/chunks/{avifLoader-CAUzjn-d-Bv80osgL.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
  9. package/lib/chunks/{heicLoader-D_9PukkA-c40agcEu.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
  10. package/lib/chunks/{index-CO713RPO.mjs → index--612Smof.mjs} +118 -118
  11. package/lib/chunks/{index-Dw6YZA28.mjs → index-8Vpbg2kS.mjs} +2 -2
  12. package/lib/chunks/index-B21EAyWz.mjs +137 -0
  13. package/lib/chunks/{index-CrLeFRdr.mjs → index-BASg1cr4.mjs} +2 -2
  14. package/lib/chunks/index-BB0i4QqI.mjs +117 -0
  15. package/lib/chunks/{index-C92b547K.mjs → index-BVdrGK3Q.mjs} +80 -80
  16. package/lib/chunks/index-BlrFFeqc.mjs +330 -0
  17. package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
  18. package/lib/chunks/index-BuqPb5mP.mjs +306 -0
  19. package/lib/chunks/{index-Df-1MbYj.mjs → index-BvBqDq3O.mjs} +2 -2
  20. package/lib/chunks/{index-BkqPtbFz.mjs → index-Bxpf9v5j.mjs} +29 -29
  21. package/lib/chunks/{index-DpY9eMSI.mjs → index-C9mAajbD.mjs} +231 -226
  22. package/lib/chunks/{index-DTZVumT8.mjs → index-CDg6vIbT.mjs} +14 -14
  23. package/lib/chunks/{index-By8q8XPn.mjs → index-CWE-hKSs.mjs} +10 -10
  24. package/lib/chunks/{index-DbOpSm8f.mjs → index-CY3xzGgt.mjs} +19 -19
  25. package/lib/chunks/{index-C8pOqpTq.mjs → index-CxKZKUJj.mjs} +521 -523
  26. package/lib/chunks/{index-Cyg4lWK-.mjs → index-D30L8tm9.mjs} +12 -12
  27. package/lib/chunks/{index-DfC_cA90.mjs → index-DN4Ui0Gh.mjs} +24 -24
  28. package/lib/chunks/{index-B3uQ1OoT.mjs → index-DZZN3kYi.mjs} +832 -812
  29. package/lib/chunks/{index-BpKvjFVp.mjs → index-Dkro_8Fy.mjs} +20 -20
  30. package/lib/chunks/{index-B35jLxPz.mjs → index-VdzIFJJW.mjs} +26 -26
  31. package/lib/chunks/{index--D2MwF_x.mjs → index-aoXgVLBb.mjs} +10 -10
  32. package/lib/chunks/{jp2Loader-Dig19xyo-82PXw2fC.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
  33. package/lib/chunks/{psdLoader-C0tKUXXl-DRn7RYLA.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
  34. package/lib/chunks/{rawLoader-C-tPeFAB-DP397Cnq.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
  35. package/lib/chunks/{tiffLoader-BlhByX8w-BC52z4Tf.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
  36. package/lib/chunks/{useShikiHighlight-DSyCygls.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
  37. package/lib/index.cjs +63 -63
  38. package/lib/index.css +1 -1
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.mjs +6 -6
  41. package/lib/renderers/Cad/toolbar.d.ts +1 -0
  42. package/lib/renderers/EmptyState.vue.d.ts +2 -0
  43. package/lib/renderers/Json/index.vue.d.ts +5 -0
  44. package/lib/renderers/Pptx/index.vue.d.ts +3 -0
  45. package/lib/renderers/Text/index.vue.d.ts +3 -0
  46. package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
  47. package/lib/renderers/registry.d.ts +3 -1
  48. package/package.json +1 -1
  49. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
  50. package/lib/chunks/index-2xdBoG-I.mjs +0 -141
  51. package/lib/chunks/index-B2xLxhp0.mjs +0 -133
  52. package/lib/chunks/index-DKJ_iQ70.mjs +0 -295
  53. package/lib/chunks/index-DMwZXKa4.mjs +0 -322
  54. package/lib/chunks/index-DyP3rhuf.mjs +0 -113
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as D, computed as K, ref as i, watch as k, nextTick as O, openBlock as d, createElementBlock as p, createElementVNode as y, toDisplayString as E, unref as R, createBlock as N } from "vue";
2
- import Y from "markdown-it";
3
- import F from "@traptitech/markdown-it-katex";
2
+ import X from "markdown-it";
3
+ import Y from "@traptitech/markdown-it-katex";
4
4
  import { codeToHtml as B } from "shiki";
5
- import { Code as W, Eye as z } from "lucide-vue-next";
6
- import { u as J, b as Q, j as U, S as X, _ as Z } from "./index-B3uQ1OoT.mjs";
7
- import { _ as ee } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
+ import { Code as F, Eye as W } from "lucide-vue-next";
6
+ import { u as z, c as J, g as Q, X as U, _ as Z } from "./index-DZZN3kYi.mjs";
7
+ import { _ as ee } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
8
8
  import { T as te } from "./base.types-DaftHyg7.mjs";
9
9
  const oe = {
10
10
  key: 0,
@@ -24,18 +24,18 @@ const oe = {
24
24
  props: {
25
25
  url: {}
26
26
  },
27
- setup(V, { expose: j }) {
28
- const x = V, C = new te(), { t: s } = J(), G = Q(), $ = U(), _ = K(() => $.value === "light" ? "github-light" : "github-dark"), c = i("preview"), b = i(""), v = i(""), h = i(""), u = i(!0), f = i(null), m = i(null);
27
+ setup(V, { expose: G }) {
28
+ const x = V, C = new te(), { t: s } = z(), $ = J(), j = Q(), _ = K(() => j.value === "light" ? "github-light" : "github-dark"), c = i("preview"), b = i(""), v = i(""), h = i(""), u = i(!0), f = i(null), m = i(null);
29
29
  k([c, u], () => {
30
30
  C.notify();
31
- }), j({
31
+ }), G({
32
32
  getToolbarGroups: () => {
33
33
  const e = [];
34
34
  return e.push({
35
35
  items: [
36
36
  {
37
37
  type: "button",
38
- icon: c.value === "preview" ? W : z,
38
+ icon: c.value === "preview" ? F : W,
39
39
  tooltip: c.value === "preview" ? s.value("toolbar.source") : s.value("toolbar.preview"),
40
40
  action: () => {
41
41
  c.value = c.value === "preview" ? "source" : "preview";
@@ -47,13 +47,13 @@ const oe = {
47
47
  },
48
48
  onToolbarChange: (e) => C.subscribe(e)
49
49
  });
50
- const a = new Y({
50
+ const a = new X({
51
51
  html: !0,
52
52
  linkify: !0,
53
53
  typographer: !1,
54
54
  breaks: !1
55
55
  });
56
- a.use(F), a.renderer.rules.fence = (e, r) => {
56
+ a.use(Y), a.renderer.rules.fence = (e, r) => {
57
57
  const t = e[r], n = t.info ? t.info.trim() : "", o = t.content;
58
58
  return n ? `<div class="code-block-wrapper">
59
59
  <div class="code-block-header">
@@ -76,7 +76,7 @@ const oe = {
76
76
  const T = async () => {
77
77
  u.value = !0, f.value = null;
78
78
  try {
79
- const e = await X(x.url, { fetcher: G.value });
79
+ const e = await U(x.url, { fetcher: $.value });
80
80
  b.value = e, v.value = a.render(e), u.value = !1;
81
81
  try {
82
82
  h.value = await B(e, { lang: "markdown", theme: _.value });
@@ -1,7 +1,7 @@
1
1
  import { ref as f, watch as q, onUnmounted as W, defineComponent as X, toRef as J, computed as B, onMounted as K, onBeforeUnmount as Q, unref as e, openBlock as _, createBlock as V, createElementBlock as H, createElementVNode as a, normalizeClass as D, createVNode as E, toDisplayString as N, normalizeStyle as O, 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 { C as ue, u as pe } from "./index-B3uQ1OoT.mjs";
4
- import { _ as de } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
3
+ import { S as ue, u as pe } from "./index-DZZN3kYi.mjs";
4
+ import { _ as de } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  function ce(L) {
6
6
  const v = f(null), y = f(!1), p = f(!0), n = f(0), T = f(0), g = f(1), x = f(!1), h = f(!1), u = f(null);
7
7
  let r = null;
@@ -23,13 +23,13 @@ function ce(L) {
23
23
  y.value = !0;
24
24
  }, k = () => {
25
25
  y.value = !1;
26
- }, C = () => {
27
- y.value = !1;
28
26
  }, M = () => {
27
+ y.value = !1;
28
+ }, P = () => {
29
29
  u.value = "audio.load_failed", p.value = !1;
30
30
  };
31
- t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay", c), t.addEventListener("waiting", b), t.addEventListener("playing", w), t.addEventListener("play", m), t.addEventListener("pause", k), t.addEventListener("ended", C), t.addEventListener("error", M), 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", c), t.removeEventListener("waiting", b), t.removeEventListener("playing", w), t.removeEventListener("play", m), t.removeEventListener("pause", k), t.removeEventListener("ended", C), t.removeEventListener("error", M);
31
+ t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay", c), t.addEventListener("waiting", b), t.addEventListener("playing", w), t.addEventListener("play", m), t.addEventListener("pause", k), t.addEventListener("ended", M), t.addEventListener("error", P), 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", c), t.removeEventListener("waiting", b), t.removeEventListener("playing", w), t.removeEventListener("play", m), t.removeEventListener("pause", k), t.removeEventListener("ended", M), t.removeEventListener("error", P);
33
33
  };
34
34
  };
35
35
  return q(
@@ -94,13 +94,13 @@ function ce(L) {
94
94
  const me = {
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
- }, ge = { 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" }, xe = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, ye = { class: "vfp-min-w-0 vfp-flex-1 vfp-truncate vfp-text-sm vfp-font-medium vfp-text-fg-primary" }, he = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, be = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-right vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, we = { class: "vfp-relative vfp-h-4 vfp-flex vfp-flex-1 vfp-items-center" }, ke = { class: "vfp-absolute vfp-left-[6px] vfp-right-[6px] vfp-h-[3px] vfp-rounded-full vfp-bg-surface-3" }, _e = ["max", "value", "disabled", "aria-label"], Le = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, Ee = { class: "vfp-flex vfp-items-center vfp-gap-1" }, Te = ["title", "aria-label"], Ce = ["title", "aria-label"], Me = ["title", "aria-label"], Pe = ["title", "aria-label"], Ve = ["title", "aria-label"], Ne = {
97
+ }, ge = { 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" }, xe = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, ye = { class: "vfp-min-w-0 vfp-flex-1 vfp-truncate vfp-text-sm vfp-font-medium vfp-text-fg-primary" }, he = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, be = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-right vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, we = { class: "vfp-relative vfp-h-4 vfp-flex vfp-flex-1 vfp-items-center" }, ke = { class: "vfp-absolute vfp-left-[6px] vfp-right-[6px] vfp-h-[3px] vfp-rounded-full vfp-bg-surface-3" }, _e = ["max", "value", "disabled", "aria-label"], Le = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, Ee = { class: "vfp-flex vfp-items-center vfp-gap-1" }, Te = ["title", "aria-label"], Me = ["title", "aria-label"], Pe = ["title", "aria-label"], Ce = ["title", "aria-label"], Ve = ["title", "aria-label"], Ne = {
98
98
  class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-2",
99
99
  style: { height: "100px" }
100
100
  }, je = {
101
101
  class: "vfp-relative vfp-flex vfp-items-center vfp-justify-center",
102
102
  style: { width: "24px", height: "80px" }
103
- }, Re = ["value", "aria-label"], Fe = { class: "vfp-text-[10px] vfp-tabular-nums vfp-text-fg-tertiary" }, Se = ["src"], Ue = /* @__PURE__ */ X({
103
+ }, Re = ["value", "aria-label"], Se = { class: "vfp-text-[10px] vfp-tabular-nums vfp-text-fg-tertiary" }, Fe = ["src"], Ue = /* @__PURE__ */ X({
104
104
  __name: "index",
105
105
  props: {
106
106
  url: {},
@@ -117,15 +117,15 @@ const me = {
117
117
  isMuted: d,
118
118
  error: j,
119
119
  togglePlay: R,
120
- seek: F,
121
- skip: S,
120
+ seek: S,
121
+ skip: F,
122
122
  setVolume: I,
123
123
  toggleMute: $,
124
124
  toggleLoop: t,
125
125
  formatTime: l
126
126
  } = ce(p), s = f(!1), c = f(!1), b = f(0), w = f(null);
127
127
  let m = null;
128
- const k = B(() => c.value ? b.value : h.value), C = B(() => u.value > 0 ? k.value / u.value : 0), M = B(() => d.value || r.value === 0 ? ae : r.value < 0.5 ? oe : ne), A = (G) => {
128
+ const k = B(() => c.value ? b.value : h.value), M = B(() => u.value > 0 ? k.value / u.value : 0), P = B(() => d.value || r.value === 0 ? ae : r.value < 0.5 ? oe : ne), A = (G) => {
129
129
  w.value && !w.value.contains(G.target) && (s.value = !1);
130
130
  };
131
131
  K(() => {
@@ -166,7 +166,7 @@ const me = {
166
166
  a("div", {
167
167
  class: "vfp-h-full vfp-rounded-full vfp-pointer-events-none",
168
168
  style: O({
169
- width: `${C.value * 100}%`,
169
+ width: `${M.value * 100}%`,
170
170
  background: "var(--fp-player-progress)",
171
171
  transition: c.value ? "none" : "width 0.1s linear"
172
172
  })
@@ -185,12 +185,12 @@ const me = {
185
185
  b.value = e(h), c.value = !0;
186
186
  }),
187
187
  onInput: o[1] || (o[1] = (i) => {
188
- const P = parseFloat(i.target.value);
189
- c.value ? b.value = P : e(F)(P);
188
+ const C = parseFloat(i.target.value);
189
+ c.value ? b.value = C : e(S)(C);
190
190
  }),
191
191
  onPointerup: o[2] || (o[2] = (i) => {
192
- const P = parseFloat(i.target.value);
193
- e(F)(P), c.value = !1;
192
+ const C = parseFloat(i.target.value);
193
+ e(S)(C), c.value = !1;
194
194
  }),
195
195
  onPointercancel: o[3] || (o[3] = (i) => c.value = !1)
196
196
  }, null, 40, _e)
@@ -223,19 +223,19 @@ const me = {
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",
224
224
  title: e(n)("audio.aria.backward_10"),
225
225
  "aria-label": e(n)("audio.aria.backward_10"),
226
- onClick: o[5] || (o[5] = (i) => e(S)(-10))
226
+ onClick: o[5] || (o[5] = (i) => e(F)(-10))
227
227
  }, [
228
228
  E(e(ie), { class: "vfp-w-[18px] vfp-h-[18px]" })
229
- ], 8, Ce),
229
+ ], 8, Me),
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",
233
233
  title: e(n)("audio.aria.forward_10"),
234
234
  "aria-label": e(n)("audio.aria.forward_10"),
235
- onClick: o[6] || (o[6] = (i) => e(S)(10))
235
+ onClick: o[6] || (o[6] = (i) => e(F)(10))
236
236
  }, [
237
237
  E(e(fe), { class: "vfp-w-[18px] vfp-h-[18px]" })
238
- ], 8, Me),
238
+ ], 8, Pe),
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",
@@ -249,7 +249,7 @@ const me = {
249
249
  (...i) => e(t) && e(t)(...i))
250
250
  }, [
251
251
  E(e(ve), { class: "vfp-w-4 vfp-h-4" })
252
- ], 10, Pe),
252
+ ], 10, Ce),
253
253
  o[12] || (o[12] = a("div", { class: "vfp-flex-1" }, null, -1)),
254
254
  a("div", {
255
255
  ref_key: "volumeRef",
@@ -269,7 +269,7 @@ const me = {
269
269
  onClick: o[8] || (o[8] = //@ts-ignore
270
270
  (...i) => e($) && e($)(...i))
271
271
  }, [
272
- (_(), V(Y(M.value), { class: "vfp-w-4 vfp-h-4" }))
272
+ (_(), V(Y(P.value), { class: "vfp-w-4 vfp-h-4" }))
273
273
  ], 10, Ve),
274
274
  E(Z, { name: "vfp-fade" }, {
275
275
  default: ee(() => [
@@ -306,7 +306,7 @@ const me = {
306
306
  onInput: o[9] || (o[9] = (i) => e(I)(parseFloat(i.target.value)))
307
307
  }, null, 40, Re)
308
308
  ]),
309
- a("span", Fe, N(Math.round((e(d) ? 0 : e(r)) * 100)), 1)
309
+ a("span", Se, N(Math.round((e(d) ? 0 : e(r)) * 100)), 1)
310
310
  ])
311
311
  ], 32)) : te("", !0)
312
312
  ]),
@@ -320,7 +320,7 @@ const me = {
320
320
  ref: T,
321
321
  src: L.url,
322
322
  class: "vfp-hidden"
323
- }, null, 8, Se)
323
+ }, null, 8, Fe)
324
324
  ]));
325
325
  }
326
326
  });