@eternalheart/vue-file-preview 1.6.12 → 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 (51) 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-CTy7cevh.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
  9. package/lib/chunks/{heicLoader-D_9PukkA-DdDu94xL.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
  10. package/lib/chunks/{index-CLM9sOKN.mjs → index--612Smof.mjs} +112 -112
  11. package/lib/chunks/{index-De-oaCgN.mjs → index-8Vpbg2kS.mjs} +2 -2
  12. package/lib/chunks/{index-2VQLB2Mi.mjs → index-B21EAyWz.mjs} +53 -49
  13. package/lib/chunks/{index-DmEMePjL.mjs → index-BASg1cr4.mjs} +2 -2
  14. package/lib/chunks/index-BB0i4QqI.mjs +117 -0
  15. package/lib/chunks/{index-Bmqn45d_.mjs → index-BVdrGK3Q.mjs} +72 -72
  16. package/lib/chunks/index-BlrFFeqc.mjs +330 -0
  17. package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
  18. package/lib/chunks/{index-i-KacQvS.mjs → index-BuqPb5mP.mjs} +3 -3
  19. package/lib/chunks/{index-DVG1fZAv.mjs → index-BvBqDq3O.mjs} +2 -2
  20. package/lib/chunks/{index-D6te_qaB.mjs → index-Bxpf9v5j.mjs} +26 -26
  21. package/lib/chunks/{index-D9z6lQat.mjs → index-C9mAajbD.mjs} +225 -220
  22. package/lib/chunks/{index-CM11hSQu.mjs → index-CDg6vIbT.mjs} +11 -11
  23. package/lib/chunks/{index-BxmX005K.mjs → index-CWE-hKSs.mjs} +11 -11
  24. package/lib/chunks/{index-BPmyF7Wr.mjs → index-CY3xzGgt.mjs} +18 -18
  25. package/lib/chunks/{index-t9kSzzMg.mjs → index-CxKZKUJj.mjs} +521 -523
  26. package/lib/chunks/{index-CuiEjR23.mjs → index-D30L8tm9.mjs} +15 -15
  27. package/lib/chunks/{index-DOAOk6m5.mjs → index-DN4Ui0Gh.mjs} +11 -11
  28. package/lib/chunks/{index-CEk6FKm3.mjs → index-DZZN3kYi.mjs} +551 -531
  29. package/lib/chunks/{index-D6Pjjxi0.mjs → index-Dkro_8Fy.mjs} +20 -20
  30. package/lib/chunks/{index-CiGUKdlt.mjs → index-VdzIFJJW.mjs} +23 -23
  31. package/lib/chunks/{index-WcAnJA2t.mjs → index-aoXgVLBb.mjs} +14 -14
  32. package/lib/chunks/{jp2Loader-Dig19xyo-BBR3tcPW.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
  33. package/lib/chunks/{psdLoader-C0tKUXXl-DGOmJwkQ.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
  34. package/lib/chunks/{rawLoader-C-tPeFAB-CrCtXMup.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
  35. package/lib/chunks/{tiffLoader-BlhByX8w-jsxHlbyu.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
  36. package/lib/chunks/{useShikiHighlight-BdhPCj48.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
  37. package/lib/index.cjs +59 -59
  38. package/lib/index.css +1 -1
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.mjs +4 -4
  41. package/lib/renderers/EmptyState.vue.d.ts +2 -0
  42. package/lib/renderers/Json/index.vue.d.ts +5 -0
  43. package/lib/renderers/Pptx/index.vue.d.ts +3 -0
  44. package/lib/renderers/Text/index.vue.d.ts +3 -0
  45. package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
  46. package/lib/renderers/registry.d.ts +3 -1
  47. package/package.json +1 -1
  48. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
  49. package/lib/chunks/index-Bfg5zM8l.mjs +0 -141
  50. package/lib/chunks/index-Cud9j9Xy.mjs +0 -322
  51. package/lib/chunks/index-D4jhvs5m.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, h as U, T as X, _ as Z } from "./index-CEk6FKm3.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,
@@ -25,9 +25,9 @@ const oe = {
25
25
  url: {}
26
26
  },
27
27
  setup(V, { expose: G }) {
28
- const x = V, T = new te(), { t: s } = J(), $ = Q(), j = U(), _ = 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);
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
- T.notify();
30
+ C.notify();
31
31
  }), G({
32
32
  getToolbarGroups: () => {
33
33
  const e = [];
@@ -35,7 +35,7 @@ const oe = {
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";
@@ -45,15 +45,15 @@ const oe = {
45
45
  ]
46
46
  }), e;
47
47
  },
48
- onToolbarChange: (e) => T.subscribe(e)
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">
@@ -73,10 +73,10 @@ const oe = {
73
73
  a.renderer.rules.table_open = (e, r, t, n, o) => '<div class="table-wrapper">' + A(e, r, t, n, o);
74
74
  const I = a.renderer.rules.table_close || ((e, r, t, n, o) => o.renderToken(e, r, t));
75
75
  a.renderer.rules.table_close = (e, r, t, n, o) => I(e, r, t, n, o) + "</div>";
76
- const C = async () => {
76
+ const T = async () => {
77
77
  u.value = !0, f.value = null;
78
78
  try {
79
- const e = await X(x.url, { fetcher: $.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 });
@@ -122,10 +122,10 @@ const oe = {
122
122
  w ? w.appendChild(M(g, !0)) : o.appendChild(M(g, !1));
123
123
  }
124
124
  };
125
- return k(() => x.url, C, { immediate: !0 }), k(v, async () => {
125
+ return k(() => x.url, T, { immediate: !0 }), k(v, async () => {
126
126
  v.value && (await O(), P());
127
127
  }), k(_, () => {
128
- b.value && C();
128
+ b.value && T();
129
129
  }), (e, r) => u.value ? (d(), p("div", oe, [
130
130
  y("div", re, [
131
131
  r[0] || (r[0] = y("div", { class: "vfp-renderer-spinner" }, null, -1)),
@@ -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 { y as ue, u as pe } from "./index-CEk6FKm3.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;
@@ -100,7 +100,7 @@ const me = {
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,8 +117,8 @@ 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,
@@ -186,11 +186,11 @@ const me = {
186
186
  }),
187
187
  onInput: o[1] || (o[1] = (i) => {
188
188
  const C = parseFloat(i.target.value);
189
- c.value ? b.value = C : e(F)(C);
189
+ c.value ? b.value = C : e(S)(C);
190
190
  }),
191
191
  onPointerup: o[2] || (o[2] = (i) => {
192
192
  const C = parseFloat(i.target.value);
193
- e(F)(C), c.value = !1;
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,7 +223,7 @@ 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
229
  ], 8, Me),
@@ -232,7 +232,7 @@ const me = {
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
238
  ], 8, Pe),
@@ -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
  });