@eternalheart/vue-file-preview 1.6.5 → 1.6.7

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 (34) hide show
  1. package/README.md +9 -3
  2. package/README.zh-CN.md +9 -3
  3. package/lib/FilePreviewContent.vue.d.ts +6 -0
  4. package/lib/FilePreviewEmbed.vue.d.ts +6 -0
  5. package/lib/FilePreviewModal.vue.d.ts +6 -0
  6. package/lib/chunks/{index-CaChuF62.mjs → index--sqXkUEP.mjs} +18 -19
  7. package/lib/chunks/{index-e0CU-cuJ.mjs → index-06Ivpw6V.mjs} +1 -1
  8. package/lib/chunks/{index-Dq541Zfu.mjs → index-B3jcS1UB.mjs} +1 -1
  9. package/lib/chunks/index-B6UNmyiS.mjs +329 -0
  10. package/lib/chunks/{index-yvSDwlVY.mjs → index-BWNmKHd0.mjs} +2 -2
  11. package/lib/chunks/{index-DR87l2gD.mjs → index-BflKoE04.mjs} +1 -1
  12. package/lib/chunks/{index-Do_q3F1Q.mjs → index-BgTW_P3u.mjs} +1 -1
  13. package/lib/chunks/{index-COciDyvJ.mjs → index-BmsJxBJa.mjs} +2 -2
  14. package/lib/chunks/index-CBN0qoP1.mjs +270 -0
  15. package/lib/chunks/{index-5bftazEI.mjs → index-CK43N0Ho.mjs} +1 -1
  16. package/lib/chunks/{index-C4x3R4P6.mjs → index-CR3QkKJt.mjs} +1 -1
  17. package/lib/chunks/{index-CDdmBvY6.mjs → index-CSY197_j.mjs} +1 -1
  18. package/lib/chunks/{index-DjgGNQ_1.mjs → index-CXAEvuVP.mjs} +1 -1
  19. package/lib/chunks/{index-DLHCSwf3.mjs → index-Cr7raBmi.mjs} +1 -1
  20. package/lib/chunks/{index-Bjh8pgvO.mjs → index-Cv0lIWeI.mjs} +1 -1
  21. package/lib/chunks/{index-Bso3kiuo.mjs → index-CyIp8Xfg.mjs} +1 -1
  22. package/lib/chunks/{index-CVQmCNmf.mjs → index-D_XKzCZJ.mjs} +15 -15
  23. package/lib/chunks/{index-DwHqKJVc.mjs → index-DdbaVSB8.mjs} +768 -746
  24. package/lib/chunks/{index-CH0gyinl.mjs → index-DlIRXpmw.mjs} +1 -1
  25. package/lib/chunks/{index-DA_KAGO4.mjs → index-DoqCnKkl.mjs} +2 -2
  26. package/lib/chunks/{index-BFZyrk0b.mjs → index-Xta2zHnj.mjs} +1 -1
  27. package/lib/chunks/{index-BujnNIdi.mjs → index-sPfLaVRe.mjs} +1 -1
  28. package/lib/chunks/{useShikiHighlight-CMxdbY5k.mjs → useShikiHighlight-J62fUszo.mjs} +1 -1
  29. package/lib/index.cjs +50 -61
  30. package/lib/index.css +1 -1
  31. package/lib/index.mjs +1 -1
  32. package/package.json +1 -1
  33. package/lib/chunks/index-CmUWVGTa.mjs +0 -466
  34. package/lib/chunks/index-DezBKYfu.mjs +0 -264
package/README.md CHANGED
@@ -17,7 +17,7 @@ A modern, feature-rich file preview component for Vue 3 with support for images,
17
17
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4dd.svg" width="16" height="16" alt="📝" style="vertical-align: middle;" /> **Markdown Rendering** - GitHub Flavored Markdown support
18
18
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4bb.svg" width="16" height="16" alt="💻" style="vertical-align: middle;" /> **Code Highlighting** - Supports 40+ programming languages
19
19
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4f1.svg" width="16" height="16" alt="📱" style="vertical-align: middle;" /> **Responsive Design** - Adapts to all screen sizes
20
- - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/2328.svg" width="16" height="16" alt="⌨️" style="vertical-align: middle;" /> **Keyboard Navigation** - Arrow keys and ESC support
20
+ - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/2328.svg" width="16" height="16" alt="⌨️" style="vertical-align: middle;" /> **Keyboard Navigation** - Arrow, Home, End, and ESC key support
21
21
 
22
22
  ## <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4e6.svg" width="20" height="20" alt="📦" /> Installation
23
23
 
@@ -239,7 +239,7 @@ Differences from `FilePreviewModal`:
239
239
 
240
240
  - No teleport, no full-screen overlay, no `isOpen` / `@close`
241
241
  - Does **not** show the close button in the toolbar
242
- - Keyboard navigation (←/→) is scoped to the embed container (focus-based)
242
+ - Keyboard navigation (←/→/Home/End) is scoped to the embed container (focus-based)
243
243
  - Size defaults to `width: 100%; height: 100%`; override via `width` / `height` props
244
244
 
245
245
  ```vue
@@ -279,7 +279,7 @@ Differences from `FilePreviewModal`:
279
279
  ### Code & Text
280
280
  - **Markdown**: GitHub Flavored Markdown, code highlighting
281
281
  - **Code Files**: Vue, Svelte, Astro, JS/TS, Dart, GraphQL, Protobuf, Prisma, Terraform, PowerShell, Scala, and 40+ languages
282
- - **Config/Logs**: YAML, TOML, INI, ENV, LOG, DIFF, PATCH, etc.
282
+ - **Config/Logs**: YAML, TOML, INI, ENV, PROPERTIES, BAT, CMD, TEX, MAP, LOG, DIFF, PATCH, etc.
283
283
 
284
284
  ### Structured Data
285
285
  - **JSON**: Auto formatting + syntax highlighting
@@ -366,6 +366,8 @@ Differences from `FilePreviewModal`:
366
366
  | `theme` | `Theme` | ❌ | Theme mode: `'auto' \| 'dark' \| 'light'` (default `'dark'`) |
367
367
  | `showDownload` | `boolean` | ❌ | Whether to show the download button (default `true`) |
368
368
  | `showClose` | `boolean` | ❌ | Whether to show the close button (default `true` for modal) |
369
+ | `showNavigation` | `boolean` | ❌ | Whether to show file navigation arrows (default `true`) |
370
+ | `loopNavigation` | `boolean` | ❌ | Whether file navigation wraps around (default `false`) |
369
371
 
370
372
  ### FilePreviewModal Events
371
373
 
@@ -389,6 +391,8 @@ Differences from `FilePreviewModal`:
389
391
  | `theme` | `Theme` | ❌ | `'dark'` | Theme mode: `'auto' \| 'dark' \| 'light'` |
390
392
  | `showDownload` | `boolean` | ❌ | `true` | Whether to show the download button |
391
393
  | `showClose` | `boolean` | ❌ | `false` | Whether to show the close button (default `false` for embed) |
394
+ | `showNavigation` | `boolean` | ❌ | `true` | Whether to show file navigation arrows |
395
+ | `loopNavigation` | `boolean` | ❌ | `false` | Whether file navigation wraps around |
392
396
 
393
397
  ### FilePreviewEmbed Events
394
398
 
@@ -836,6 +840,8 @@ Verify:
836
840
  - `ESC` - Close preview
837
841
  - `←` - Previous file
838
842
  - `→` - Next file
843
+ - `Home` - First file
844
+ - `End` - Last file
839
845
  - `Mouse Wheel` - Zoom image (image preview only)
840
846
 
841
847
  ## <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4da.svg" width="20" height="20" alt="📚" /> Documentation
package/README.zh-CN.md CHANGED
@@ -17,7 +17,7 @@
17
17
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4dd.svg" width="16" height="16" alt="📝" style="vertical-align: middle;" /> **Markdown 渲染** - 支持 GitHub Flavored Markdown
18
18
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4bb.svg" width="16" height="16" alt="💻" style="vertical-align: middle;" /> **代码高亮** - 支持 40+ 种编程语言
19
19
  - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f4f1.svg" width="16" height="16" alt="📱" style="vertical-align: middle;" /> **响应式设计** - 适配各种屏幕尺寸
20
- - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/2328.svg" width="16" height="16" alt="⌨️" style="vertical-align: middle;" /> **键盘导航** - 支持方向键和 ESC 键
20
+ - <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/2328.svg" width="16" height="16" alt="⌨️" style="vertical-align: middle;" /> **键盘导航** - 支持方向键、Home、End 和 ESC 键
21
21
 
22
22
  ## 📦 安装
23
23
 
@@ -239,7 +239,7 @@ const files = [
239
239
 
240
240
  - 不使用 Teleport、无全屏遮罩、没有 `isOpen` / `@close`
241
241
  - **不显示关闭按钮**
242
- - 键盘导航 (←/→) 作用域限定在嵌入容器内 (基于 focus)
242
+ - 键盘导航 (←/→/Home/End) 作用域限定在嵌入容器内 (基于 focus)
243
243
  - 尺寸默认 `width: 100%; height: 100%`,可通过 `width` / `height` props 覆盖
244
244
 
245
245
  ```vue
@@ -279,7 +279,7 @@ const files = [
279
279
  ### 代码 & 文本
280
280
  - **Markdown**: GitHub Flavored Markdown,代码高亮
281
281
  - **代码文件**: Vue、Svelte、Astro、JS/TS、Dart、GraphQL、Protobuf、Prisma、Terraform、PowerShell、Scala 等 40+ 种语言
282
- - **配置 / 日志**: YAML, TOML, INI, ENV, LOG, DIFF, PATCH 等
282
+ - **配置 / 日志**: YAML, TOML, INI, ENV, PROPERTIES, BAT, CMD, TEX, MAP, LOG, DIFF, PATCH 等
283
283
 
284
284
  ### 结构化数据
285
285
  - **JSON**: 自动格式化 + 语法高亮
@@ -366,6 +366,8 @@ const files = [
366
366
  | `theme` | `Theme` | ❌ | 主题模式: `'auto' \| 'dark' \| 'light'`(默认 `'dark'`) |
367
367
  | `showDownload` | `boolean` | ❌ | 是否显示下载按钮(默认 `true`) |
368
368
  | `showClose` | `boolean` | ❌ | 是否显示关闭按钮(modal 模式默认 `true`) |
369
+ | `showNavigation` | `boolean` | ❌ | 是否显示文件导航箭头(默认 `true`) |
370
+ | `loopNavigation` | `boolean` | ❌ | 是否循环导航文件(默认 `false`) |
369
371
 
370
372
  ### FilePreviewModal 事件
371
373
 
@@ -389,6 +391,8 @@ const files = [
389
391
  | `theme` | `Theme` | ❌ | `'dark'` | 主题模式: `'auto' \| 'dark' \| 'light'` |
390
392
  | `showDownload` | `boolean` | ❌ | `true` | 是否显示下载按钮 |
391
393
  | `showClose` | `boolean` | ❌ | `false` | 是否显示关闭按钮(embed 模式默认 `false`) |
394
+ | `showNavigation` | `boolean` | ❌ | `true` | 是否显示文件导航箭头 |
395
+ | `loopNavigation` | `boolean` | ❌ | `false` | 是否循环导航文件 |
392
396
 
393
397
  ### FilePreviewEmbed 事件
394
398
 
@@ -836,6 +840,8 @@ watch(resolvedTheme, highlightCode, { immediate: true });
836
840
  - `ESC` - 关闭预览
837
841
  - `←` - 上一个文件
838
842
  - `→` - 下一个文件
843
+ - `Home` - 第一个文件
844
+ - `End` - 最后一个文件
839
845
  - `滚轮` - 缩放图片 (仅图片预览)
840
846
 
841
847
  ## 📚 文档
@@ -30,6 +30,10 @@ interface Props {
30
30
  showClose?: boolean;
31
31
  /** 是否显示下载按钮,默认 true */
32
32
  showDownload?: boolean;
33
+ /** 是否显示文件导航箭头,默认 true */
34
+ showNavigation?: boolean;
35
+ /** 是否循环导航文件,默认 false */
36
+ loopNavigation?: boolean;
33
37
  }
34
38
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
35
39
  close: () => any;
@@ -54,5 +58,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
54
58
  onDownload: (file: PreviewFile) => void | Promise<void>;
55
59
  showClose: boolean;
56
60
  showDownload: boolean;
61
+ showNavigation: boolean;
62
+ loopNavigation: boolean;
57
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
64
  export default _default;
@@ -30,6 +30,10 @@ interface Props {
30
30
  showClose?: boolean;
31
31
  /** 是否显示下载按钮,默认 true */
32
32
  showDownload?: boolean;
33
+ /** 是否显示文件导航箭头,默认 true */
34
+ showNavigation?: boolean;
35
+ /** 是否循环导航文件,默认 false */
36
+ loopNavigation?: boolean;
33
37
  }
34
38
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
35
39
  close: () => any;
@@ -55,5 +59,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
55
59
  onDownload: (file: PreviewFile) => void | Promise<void>;
56
60
  showClose: boolean;
57
61
  showDownload: boolean;
62
+ showNavigation: boolean;
63
+ loopNavigation: boolean;
58
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
65
  export default _default;
@@ -25,6 +25,10 @@ interface Props {
25
25
  showClose?: boolean;
26
26
  /** 是否显示下载按钮,默认 true */
27
27
  showDownload?: boolean;
28
+ /** 是否显示文件导航箭头,默认 true */
29
+ showNavigation?: boolean;
30
+ /** 是否循环导航文件,默认 false */
31
+ loopNavigation?: boolean;
28
32
  }
29
33
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
30
34
  close: () => any;
@@ -46,5 +50,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
46
50
  onDownload: (file: PreviewFile) => void | Promise<void>;
47
51
  showClose: boolean;
48
52
  showDownload: boolean;
53
+ showNavigation: boolean;
54
+ loopNavigation: boolean;
49
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
56
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, ref as d, onMounted as b, watch as w, onBeforeUnmount as T, openBlock as f, createBlock as E, createElementBlock as m, createElementVNode as a, toDisplayString as C, unref as D, createCommentVNode as j } from "vue";
2
2
  import B from "video.js";
3
- import { u as N, n as _ } from "./index-DwHqKJVc.mjs";
3
+ import { u as N, n as _ } from "./index-DdbaVSB8.mjs";
4
4
  import { _ as P } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
5
  const R = {
6
6
  key: 1,
@@ -15,30 +15,30 @@ const R = {
15
15
  fileName: {}
16
16
  },
17
17
  setup(y, { expose: g }) {
18
- const o = y, { t: l } = N(), h = /* @__PURE__ */ new Set(["avi", "wmv", "flv"]), i = d(null), u = d(!0), p = d(null);
18
+ const o = y, { t: l } = N(), h = /* @__PURE__ */ new Set(["avi", "wmv", "flv"]), i = d(null), u = d(!0), v = d(null);
19
19
  let e = null;
20
- const k = (r, s) => {
20
+ const k = (s, r) => {
21
21
  var n;
22
- return ((n = (s || r).split(".").pop()) == null ? void 0 : n.toLowerCase().split("?")[0]) || "";
22
+ return ((n = (r || s).split(".").pop()) == null ? void 0 : n.toLowerCase().split("?")[0]) || "";
23
23
  };
24
24
  return b(() => {
25
- if (!p.value || e) return;
26
- const r = k(o.url, o.fileName);
27
- if (h.has(r)) {
25
+ if (!v.value || e) return;
26
+ const s = k(o.url, o.fileName);
27
+ if (h.has(s)) {
28
28
  i.value = {
29
29
  title: l.value("video.unsupported_title"),
30
- detail: l.value("video.unsupported_detail", { format: r.toUpperCase() })
30
+ detail: l.value("video.unsupported_detail", { format: s.toUpperCase() })
31
31
  }, u.value = !1;
32
32
  return;
33
33
  }
34
- const s = document.createElement("video-js");
35
- s.classList.add("vjs-big-play-centered", "vjs-theme-apple"), p.value.appendChild(s);
36
- const v = _(o.url);
34
+ const r = document.createElement("video-js");
35
+ r.classList.add("vjs-big-play-centered", "rfp-video-player"), v.value.appendChild(r);
36
+ const p = _(o.url);
37
37
  let n;
38
- v === "video/quicktime" ? n = [
38
+ p === "video/quicktime" ? n = [
39
39
  { src: o.url, type: "video/quicktime" },
40
40
  { src: o.url, type: "video/mp4" }
41
- ] : n = [{ src: o.url, type: v }], e = B(s, {
41
+ ] : n = [{ src: o.url, type: p }], e = B(r, {
42
42
  controls: !0,
43
43
  fill: !0,
44
44
  preload: "auto",
@@ -50,11 +50,10 @@ const R = {
50
50
  "timeDivider",
51
51
  "durationDisplay",
52
52
  "progressControl",
53
- "remainingTimeDisplay",
54
53
  "fullscreenToggle"
55
54
  ],
56
55
  volumePanel: {
57
- inline: !1
56
+ inline: !0
58
57
  }
59
58
  },
60
59
  html5: {
@@ -75,7 +74,7 @@ const R = {
75
74
  console.warn("[VideoRenderer] Video playback error:", (t == null ? void 0 : t.message) || "Unknown error"), (t == null ? void 0 : t.code) === 4 ? i.value = {
76
75
  title: l.value("video.unsupported_title"),
77
76
  detail: l.value("video.unsupported_detail", {
78
- format: r ? r.toUpperCase() : l.value("common.unknown_error")
77
+ format: s ? s.toUpperCase() : l.value("common.unknown_error")
79
78
  })
80
79
  } : i.value = {
81
80
  title: l.value("video.load_failed"),
@@ -91,7 +90,7 @@ const R = {
91
90
  e && !e.isDisposed() && (e.dispose(), e = null);
92
91
  }), g({
93
92
  getToolbarGroups: () => []
94
- }), (r, s) => i.value ? (f(), E(P, {
93
+ }), (s, r) => i.value ? (f(), E(P, {
95
94
  key: 0,
96
95
  message: i.value.title,
97
96
  detail: i.value.detail
@@ -99,13 +98,13 @@ const R = {
99
98
  a("div", S, [
100
99
  u.value ? (f(), m("div", U, [
101
100
  a("div", V, [
102
- s[0] || (s[0] = a("div", { class: "vfp-w-12 vfp-h-12 vfp-mx-auto vfp-mb-3 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)),
101
+ r[0] || (r[0] = a("div", { class: "vfp-w-12 vfp-h-12 vfp-mx-auto vfp-mb-3 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)),
103
102
  a("p", q, C(D(l)("video.loading")), 1)
104
103
  ])
105
104
  ])) : j("", !0),
106
105
  a("div", {
107
106
  ref_key: "videoContainerRef",
108
- ref: p,
107
+ ref: v,
109
108
  class: "vfp-overflow-hidden vfp-w-full vfp-h-full",
110
109
  style: { "box-shadow": "0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05)" }
111
110
  }, null, 512)
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as Me, ref as i, watch as $, onBeforeUnmount as ee, onMounted as Re, computed as te, openBlock as x, createElementBlock as C, normalizeStyle as ae, createVNode as _e, unref as le, createElementVNode as X, createTextVNode as Le, toDisplayString as S, createCommentVNode as L, createBlock as oe, normalizeClass as ke } from "vue";
2
2
  import { ZoomOut as Ee, ZoomIn as Ce, Scan as Te, Maximize2 as Ue, RotateCcw as Ye, RotateCw as ze, RefreshCw as Se, Loader2 as Xe } from "lucide-vue-next";
3
- import { u as We, i as Be, Z as De, W as Oe, p as je, R as Ze } from "./index-DwHqKJVc.mjs";
3
+ import { u as We, i as Be, Z as De, W as Oe, p as je, R as Ze } from "./index-DdbaVSB8.mjs";
4
4
  import { _ as ne } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
5
  import { T as Pe } from "./base.types-DaftHyg7.mjs";
6
6
  const $e = {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as Os, ref as Ie, onMounted as ws, onBeforeUnmount as Es, watch as Mr, openBlock as ge, createElementBlock as ke, normalizeStyle as Pr, toDisplayString as K, computed as mt, createElementVNode as P, unref as ae, createBlock as Br, Fragment as Dn, createCommentVNode as Wt, withDirectives as Nr, vModelText as _r, renderList as Gr, createVNode as qt } from "vue";
2
- import { u as Hr, b as Vr, c as zr } from "./index-DwHqKJVc.mjs";
2
+ import { u as Hr, b as Vr, c as zr } from "./index-DdbaVSB8.mjs";
3
3
  import { _ as jr } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
4
  var mn = 0, Rs = -3;
5
5
  function at() {
@@ -0,0 +1,329 @@
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
+ 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 { r as ue, u as pe } from "./index-DdbaVSB8.mjs";
4
+ import { _ as de } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
+ function ce(L) {
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
+ let r = null;
8
+ const d = () => {
9
+ const t = v.value;
10
+ if (!t) return;
11
+ p.value = !0, u.value = null;
12
+ const l = () => {
13
+ isNaN(t.currentTime) || (n.value = t.currentTime);
14
+ }, s = () => {
15
+ !isNaN(t.duration) && isFinite(t.duration) && (T.value = t.duration);
16
+ }, c = () => {
17
+ p.value = !1, s();
18
+ }, b = () => {
19
+ p.value = !0;
20
+ }, w = () => {
21
+ p.value = !1, y.value = !0;
22
+ }, m = () => {
23
+ y.value = !0;
24
+ }, k = () => {
25
+ y.value = !1;
26
+ }, M = () => {
27
+ y.value = !1;
28
+ }, P = () => {
29
+ u.value = "音频加载失败", p.value = !1;
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", 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
+ };
34
+ };
35
+ return q(
36
+ L,
37
+ () => {
38
+ r == null || r(), r = null, requestAnimationFrame(() => d());
39
+ },
40
+ { flush: "post" }
41
+ ), q(
42
+ v,
43
+ (t) => {
44
+ t && d();
45
+ },
46
+ { flush: "post" }
47
+ ), W(() => {
48
+ r == null || r(), r = null;
49
+ }), {
50
+ audioRef: v,
51
+ isPlaying: y,
52
+ isLoading: p,
53
+ isLoop: h,
54
+ currentTime: n,
55
+ duration: T,
56
+ volume: g,
57
+ isMuted: x,
58
+ error: u,
59
+ togglePlay: () => {
60
+ const t = v.value;
61
+ t && (t.paused ? t.play().catch(() => {
62
+ }) : t.pause());
63
+ },
64
+ seek: (t) => {
65
+ const l = v.value;
66
+ l && (l.currentTime = t, n.value = t);
67
+ },
68
+ skip: (t) => {
69
+ const l = v.value;
70
+ l && (l.currentTime = Math.max(
71
+ 0,
72
+ Math.min(l.currentTime + t, l.duration || 1 / 0)
73
+ ));
74
+ },
75
+ setVolume: (t) => {
76
+ const l = v.value;
77
+ if (!l) return;
78
+ const s = Math.max(0, Math.min(1, t));
79
+ l.volume = s, g.value = s, s > 0 && (l.muted = !1, x.value = !1);
80
+ },
81
+ toggleMute: () => {
82
+ const t = v.value;
83
+ t && (t.muted = !t.muted, x.value = t.muted);
84
+ },
85
+ toggleLoop: () => {
86
+ const t = v.value;
87
+ if (!t) return;
88
+ const l = !t.loop;
89
+ t.loop = l, h.value = l;
90
+ },
91
+ formatTime: ue
92
+ };
93
+ }
94
+ const me = {
95
+ key: 1,
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"], Me = ["title", "aria-label"], Pe = ["title", "aria-label"], Ce = ["title", "aria-label"], Ve = ["title", "aria-label"], Ne = {
98
+ class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-2",
99
+ style: { height: "100px" }
100
+ }, je = {
101
+ class: "vfp-relative vfp-flex vfp-items-center vfp-justify-center",
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({
104
+ __name: "index",
105
+ props: {
106
+ url: {},
107
+ fileName: {}
108
+ },
109
+ setup(L, { expose: v }) {
110
+ const p = J(L, "url"), { t: n } = pe(), {
111
+ audioRef: T,
112
+ isPlaying: g,
113
+ isLoop: x,
114
+ currentTime: h,
115
+ duration: u,
116
+ volume: r,
117
+ isMuted: d,
118
+ error: j,
119
+ togglePlay: R,
120
+ seek: F,
121
+ skip: S,
122
+ setVolume: I,
123
+ toggleMute: $,
124
+ toggleLoop: t,
125
+ formatTime: l
126
+ } = ce(p), s = f(!1), c = f(!1), b = f(0), w = f(null);
127
+ let m = null;
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
+ w.value && !w.value.contains(G.target) && (s.value = !1);
130
+ };
131
+ K(() => {
132
+ document.addEventListener("mousedown", A);
133
+ }), Q(() => {
134
+ document.removeEventListener("mousedown", A), m !== null && clearTimeout(m);
135
+ });
136
+ const U = () => {
137
+ m !== null && clearTimeout(m), s.value = !0;
138
+ }, z = () => {
139
+ m = window.setTimeout(() => {
140
+ s.value = !1;
141
+ }, 300);
142
+ };
143
+ return v({
144
+ getToolbarGroups: () => []
145
+ }), (G, o) => e(j) ? (_(), V(de, {
146
+ key: 0,
147
+ message: e(j)
148
+ }, null, 8, ["message"])) : (_(), H("div", me, [
149
+ a("div", ge, [
150
+ a("div", xe, [
151
+ a("div", {
152
+ "aria-hidden": "true",
153
+ class: D([
154
+ "vfp-audio-mark vfp-w-10 vfp-h-10 vfp-flex vfp-items-center vfp-justify-center vfp-rounded-md vfp-flex-shrink-0",
155
+ e(g) ? "vfp-audio-mark-playing" : ""
156
+ ])
157
+ }, [
158
+ E(e(le), { class: "vfp-w-5 vfp-h-5" })
159
+ ], 2),
160
+ a("div", ye, N(L.fileName), 1)
161
+ ]),
162
+ a("div", he, [
163
+ a("span", be, N(e(l)(k.value)), 1),
164
+ a("div", we, [
165
+ a("div", ke, [
166
+ a("div", {
167
+ class: "vfp-h-full vfp-rounded-full vfp-pointer-events-none",
168
+ style: O({
169
+ width: `${M.value * 100}%`,
170
+ background: "var(--fp-player-progress)",
171
+ transition: c.value ? "none" : "width 0.1s linear"
172
+ })
173
+ }, null, 4)
174
+ ]),
175
+ a("input", {
176
+ type: "range",
177
+ min: "0",
178
+ max: e(u) > 0 ? e(u) : e(h) || 100,
179
+ step: "any",
180
+ value: k.value,
181
+ disabled: e(u) <= 0,
182
+ "aria-label": e(n)("audio.aria.progress"),
183
+ class: "audio-slider vfp-absolute vfp-w-full",
184
+ onPointerdown: o[0] || (o[0] = () => {
185
+ b.value = e(h), c.value = !0;
186
+ }),
187
+ onInput: o[1] || (o[1] = (i) => {
188
+ const C = parseFloat(i.target.value);
189
+ c.value ? b.value = C : e(F)(C);
190
+ }),
191
+ onPointerup: o[2] || (o[2] = (i) => {
192
+ const C = parseFloat(i.target.value);
193
+ e(F)(C), c.value = !1;
194
+ }),
195
+ onPointercancel: o[3] || (o[3] = (i) => c.value = !1)
196
+ }, null, 40, _e)
197
+ ]),
198
+ a("span", Le, N(e(u) > 0 ? e(l)(e(u)) : "--:--"), 1)
199
+ ]),
200
+ a("div", Ee, [
201
+ a("button", {
202
+ type: "button",
203
+ class: "vfp-audio-control vfp-w-10 vfp-h-10 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-flex-shrink-0",
204
+ style: {
205
+ background: "var(--fp-player-progress)",
206
+ color: "var(--fp-fg-inverse)"
207
+ },
208
+ title: e(g) ? e(n)("audio.aria.pause") : e(n)("audio.aria.play"),
209
+ "aria-label": e(g) ? e(n)("audio.aria.pause") : e(n)("audio.aria.play"),
210
+ onClick: o[4] || (o[4] = //@ts-ignore
211
+ (...i) => e(R) && e(R)(...i))
212
+ }, [
213
+ e(g) ? (_(), V(e(se), {
214
+ key: 0,
215
+ class: "vfp-w-5 vfp-h-5"
216
+ })) : (_(), V(e(re), {
217
+ key: 1,
218
+ class: "vfp-w-5 vfp-h-5 vfp-ml-0.5"
219
+ }))
220
+ ], 8, Te),
221
+ a("button", {
222
+ type: "button",
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
+ title: e(n)("audio.aria.backward_10"),
225
+ "aria-label": e(n)("audio.aria.backward_10"),
226
+ onClick: o[5] || (o[5] = (i) => e(S)(-10))
227
+ }, [
228
+ E(e(ie), { class: "vfp-w-[18px] vfp-h-[18px]" })
229
+ ], 8, Me),
230
+ a("button", {
231
+ type: "button",
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
+ title: e(n)("audio.aria.forward_10"),
234
+ "aria-label": e(n)("audio.aria.forward_10"),
235
+ onClick: o[6] || (o[6] = (i) => e(S)(10))
236
+ }, [
237
+ E(e(fe), { class: "vfp-w-[18px] vfp-h-[18px]" })
238
+ ], 8, Pe),
239
+ o[11] || (o[11] = a("div", { class: "vfp-w-px vfp-h-5 vfp-mx-1 vfp-bg-divide" }, null, -1)),
240
+ a("button", {
241
+ type: "button",
242
+ class: D([
243
+ "vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-flex-shrink-0",
244
+ e(x) ? "vfp-bg-surface-3 vfp-text-fg-primary" : "vfp-text-fg-tertiary hover:vfp-bg-surface-3"
245
+ ]),
246
+ title: e(x) ? e(n)("audio.aria.loop_off") : e(n)("audio.aria.loop_on"),
247
+ "aria-label": e(x) ? e(n)("audio.aria.loop_off") : e(n)("audio.aria.loop_on"),
248
+ onClick: o[7] || (o[7] = //@ts-ignore
249
+ (...i) => e(t) && e(t)(...i))
250
+ }, [
251
+ E(e(ve), { class: "vfp-w-4 vfp-h-4" })
252
+ ], 10, Ce),
253
+ o[12] || (o[12] = a("div", { class: "vfp-flex-1" }, null, -1)),
254
+ a("div", {
255
+ ref_key: "volumeRef",
256
+ ref: w,
257
+ class: "vfp-relative",
258
+ onMouseenter: U,
259
+ onMouseleave: z
260
+ }, [
261
+ a("button", {
262
+ type: "button",
263
+ class: D([
264
+ "vfp-audio-control vfp-w-9 vfp-h-9 vfp-rounded-md vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-flex-shrink-0",
265
+ s.value ? "vfp-bg-surface-3 vfp-text-fg-primary" : "vfp-text-fg-secondary hover:vfp-bg-surface-3"
266
+ ]),
267
+ title: e(d) ? e(n)("audio.aria.unmute") : e(n)("audio.aria.mute"),
268
+ "aria-label": e(d) ? e(n)("audio.aria.unmute") : e(n)("audio.aria.mute"),
269
+ onClick: o[8] || (o[8] = //@ts-ignore
270
+ (...i) => e($) && e($)(...i))
271
+ }, [
272
+ (_(), V(Y(P.value), { class: "vfp-w-4 vfp-h-4" }))
273
+ ], 10, Ve),
274
+ E(Z, { name: "vfp-fade" }, {
275
+ default: ee(() => [
276
+ s.value ? (_(), H("div", {
277
+ key: 0,
278
+ class: "vfp-absolute vfp-right-0 vfp-bottom-full vfp-mb-2 vfp-w-[54px] vfp-rounded-md vfp-p-3 vfp-border vfp-bg-surface-toolbar vfp-border-line",
279
+ onMouseenter: U,
280
+ onMouseleave: z
281
+ }, [
282
+ a("div", Ne, [
283
+ a("div", je, [
284
+ o[10] || (o[10] = a("div", {
285
+ class: "vfp-absolute vfp-rounded-full vfp-bg-surface-2",
286
+ style: { width: "3px", height: "100%" }
287
+ }, null, -1)),
288
+ a("div", {
289
+ class: "vfp-absolute vfp-bottom-0 vfp-rounded-full vfp-pointer-events-none",
290
+ style: O({
291
+ width: "3px",
292
+ height: `${(e(d) ? 0 : e(r)) * 100}%`,
293
+ background: "var(--fp-player-progress)",
294
+ transition: "height 0.1s linear"
295
+ })
296
+ }, null, 4),
297
+ a("input", {
298
+ type: "range",
299
+ min: "0",
300
+ max: "1",
301
+ step: "0.01",
302
+ value: e(d) ? 0 : e(r),
303
+ "aria-label": e(n)("audio.aria.volume"),
304
+ class: "volume-slider-vertical vfp-absolute",
305
+ style: { width: "80px", height: "24px", transform: "rotate(-90deg)", "transform-origin": "center center" },
306
+ onInput: o[9] || (o[9] = (i) => e(I)(parseFloat(i.target.value)))
307
+ }, null, 40, Re)
308
+ ]),
309
+ a("span", Fe, N(Math.round((e(d) ? 0 : e(r)) * 100)), 1)
310
+ ])
311
+ ], 32)) : te("", !0)
312
+ ]),
313
+ _: 1
314
+ })
315
+ ], 544)
316
+ ])
317
+ ]),
318
+ a("audio", {
319
+ ref_key: "audioRef",
320
+ ref: T,
321
+ src: L.url,
322
+ class: "vfp-hidden"
323
+ }, null, 8, Se)
324
+ ]));
325
+ }
326
+ });
327
+ export {
328
+ Ue as default
329
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as S, ref as f, computed as c, watch as _, openBlock as a, createElementBlock as s, createElementVNode as l, createBlock as B, unref as x, normalizeClass as k, toDisplayString as T, normalizeStyle as F, Fragment as E, renderList as L } from "vue";
2
2
  import { WrapText as z, Code as G, Eye as M } from "lucide-vue-next";
3
- import { u as W, b as $, k as j, e as D } from "./index-DwHqKJVc.mjs";
4
- import { u as P } from "./useShikiHighlight-CMxdbY5k.mjs";
3
+ import { u as W, b as $, k as j, e as D } from "./index-DdbaVSB8.mjs";
4
+ import { u as P } from "./useShikiHighlight-J62fUszo.mjs";
5
5
  import { _ as R } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
6
6
  import { T as V } from "./base.types-DaftHyg7.mjs";
7
7
  const q = {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as W, ref as y, onMounted as F, watch as L, onBeforeUnmount as P, openBlock as g, createElementBlock as x, createElementVNode as _, toDisplayString as q, unref as B, createCommentVNode as T, createBlock as A, normalizeStyle as G } from "vue";
2
2
  import { init as E } from "pptx-preview";
3
- import { u as H, b as I, D as N } from "./index-DwHqKJVc.mjs";
3
+ import { u as H, b as I, D as N } from "./index-DdbaVSB8.mjs";
4
4
  import { _ as O } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
5
  const S = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, V = {
6
6
  key: 0,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as er, ref as qe, watch as tr, computed as te, openBlock as J, createElementBlock as Q, createElementVNode as F, createBlock as rr, unref as se, toDisplayString as ne, createVNode as he, createCommentVNode as oe, normalizeStyle as ir, Fragment as nr, renderList as ar, createTextVNode as sr, normalizeClass as or } from "vue";
2
2
  import { User as cr, Users as Ve, Calendar as mt, Clock as Et, Tag as gt, Mail as fr, Paperclip as ur, Hash as hr } from "lucide-vue-next";
3
- import { u as lr, b as dr, _ as pr } from "./index-DwHqKJVc.mjs";
3
+ import { u as lr, b as dr, _ as pr } from "./index-DdbaVSB8.mjs";
4
4
  import { _ as yr } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
5
5
  var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
6
6
  function br(e) {