@eternalheart/vue-file-preview 1.6.6 → 1.6.8
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.
- package/README.md +26 -6
- package/README.zh-CN.md +26 -6
- package/lib/FilePreviewContent.vue.d.ts +6 -0
- package/lib/FilePreviewEmbed.vue.d.ts +6 -0
- package/lib/FilePreviewModal.vue.d.ts +6 -0
- package/lib/chunks/{index-DcNc3goP.mjs → index-B1OYfn_2.mjs} +1 -1
- package/lib/chunks/{index-D656tL42.mjs → index-BJpiAJuf.mjs} +2 -2
- package/lib/chunks/{index-BF0-zECZ.mjs → index-BgtFv2mf.mjs} +1 -1
- package/lib/chunks/{index-BHy2oKCa.mjs → index-C3isZ_ue.mjs} +1 -1
- package/lib/chunks/{index-C-hfrxhW.mjs → index-CG01fzip.mjs} +1 -1
- package/lib/chunks/{index-u7QUztr_.mjs → index-CJYCIk06.mjs} +1 -1
- package/lib/chunks/{index-DxBxbEDT.mjs → index-CRTvjRyt.mjs} +1 -1
- package/lib/chunks/{index-DXqRgna1.mjs → index-CVN9K0qA.mjs} +1 -1
- package/lib/chunks/{index-07rgqwSI.mjs → index-CodGY6nz.mjs} +1 -1
- package/lib/chunks/{index-BnDCjh8a.mjs → index-D18co0be.mjs} +1 -1
- package/lib/chunks/{index-CdsYIxSD.mjs → index-D4O2OC-3.mjs} +1 -1
- package/lib/chunks/index-D5JP7cnv.mjs +110 -0
- package/lib/chunks/{index-Dh91eAMV.mjs → index-D6tN6EZR.mjs} +1 -1
- package/lib/chunks/{index-tOax5IQg.mjs → index-DJAZU94G.mjs} +1 -1
- package/lib/chunks/{index-CUrAAk7J.mjs → index-DL3r7NGE.mjs} +1 -1
- package/lib/chunks/{index-hDUlDDey.mjs → index-DYI-zHxA.mjs} +15 -15
- package/lib/chunks/{index-lDd0gQfG.mjs → index-DbQYYr9C.mjs} +1 -1
- package/lib/chunks/{index-xY2bzsk7.mjs → index-Hj5oboUU.mjs} +355 -339
- package/lib/chunks/{index-CksNYAz_.mjs → index-TlmEk0Wz.mjs} +1 -1
- package/lib/chunks/{index-ChMheVNW.mjs → index-XEPcqTt4.mjs} +1 -1
- package/lib/chunks/index-Z3_lfqRQ.mjs +348 -0
- package/lib/chunks/{index-CybXawTx.mjs → index-bgq5MUC6.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-DwEsf_jW.mjs → useShikiHighlight-xcK26Bn3.mjs} +1 -1
- package/lib/index.cjs +36 -36
- package/lib/index.css +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-BV8V9hEs.mjs +0 -110
- package/lib/chunks/index-DWWV1OKd.mjs +0 -320
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
|
|
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
|
|
|
@@ -53,23 +53,29 @@ By default, the component automatically uses unpkg CDN to load PDF.js, no additi
|
|
|
53
53
|
1. Copy PDF.js files to your public directory:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
cp -r node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdfjs/
|
|
56
|
+
cp -r node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs public/pdfjs/
|
|
57
57
|
cp -r node_modules/pdfjs-dist/cmaps public/pdfjs/
|
|
58
|
+
cp -r node_modules/pdfjs-dist/standard_fonts public/pdfjs/
|
|
59
|
+
cp -r node_modules/pdfjs-dist/wasm public/pdfjs/
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
2. Configure PDF.js in your app entry:
|
|
61
63
|
|
|
62
64
|
```ts
|
|
63
|
-
import * as pdfjsLib from 'pdfjs-dist/build/pdf.mjs';
|
|
65
|
+
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.mjs';
|
|
64
66
|
import { configurePdfWorker } from '@eternalheart/vue-file-preview';
|
|
65
67
|
|
|
66
68
|
configurePdfWorker(pdfjsLib, {
|
|
67
69
|
workerSrc: '/pdfjs/pdf.worker.min.mjs',
|
|
68
70
|
cMapUrl: '/pdfjs/cmaps/',
|
|
69
71
|
cMapPacked: true,
|
|
72
|
+
standardFontDataUrl: '/pdfjs/standard_fonts/',
|
|
73
|
+
wasmUrl: '/pdfjs/wasm/',
|
|
70
74
|
});
|
|
71
75
|
```
|
|
72
76
|
|
|
77
|
+
Call this during client application initialization, before the first PDF render. The worker must use the legacy build matching the installed `pdfjs-dist` version.
|
|
78
|
+
|
|
73
79
|
#### Auto-copy with Vite (Recommended)
|
|
74
80
|
|
|
75
81
|
Configure auto-copy in `vite.config.ts`:
|
|
@@ -83,12 +89,20 @@ export default defineConfig({
|
|
|
83
89
|
viteStaticCopy({
|
|
84
90
|
targets: [
|
|
85
91
|
{
|
|
86
|
-
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
|
|
92
|
+
src: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs',
|
|
87
93
|
dest: 'pdfjs'
|
|
88
94
|
},
|
|
89
95
|
{
|
|
90
96
|
src: 'node_modules/pdfjs-dist/cmaps',
|
|
91
97
|
dest: 'pdfjs'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
src: 'node_modules/pdfjs-dist/standard_fonts',
|
|
101
|
+
dest: 'pdfjs'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
src: 'node_modules/pdfjs-dist/wasm',
|
|
105
|
+
dest: 'pdfjs'
|
|
92
106
|
}
|
|
93
107
|
]
|
|
94
108
|
})
|
|
@@ -239,7 +253,7 @@ Differences from `FilePreviewModal`:
|
|
|
239
253
|
|
|
240
254
|
- No teleport, no full-screen overlay, no `isOpen` / `@close`
|
|
241
255
|
- Does **not** show the close button in the toolbar
|
|
242
|
-
- Keyboard navigation (
|
|
256
|
+
- Keyboard navigation (←/→/Home/End) is scoped to the embed container (focus-based)
|
|
243
257
|
- Size defaults to `width: 100%; height: 100%`; override via `width` / `height` props
|
|
244
258
|
|
|
245
259
|
```vue
|
|
@@ -279,7 +293,7 @@ Differences from `FilePreviewModal`:
|
|
|
279
293
|
### Code & Text
|
|
280
294
|
- **Markdown**: GitHub Flavored Markdown, code highlighting
|
|
281
295
|
- **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.
|
|
296
|
+
- **Config/Logs**: YAML, TOML, INI, ENV, PROPERTIES, BAT, CMD, TEX, MAP, LOG, DIFF, PATCH, etc.
|
|
283
297
|
|
|
284
298
|
### Structured Data
|
|
285
299
|
- **JSON**: Auto formatting + syntax highlighting
|
|
@@ -366,6 +380,8 @@ Differences from `FilePreviewModal`:
|
|
|
366
380
|
| `theme` | `Theme` | ❌ | Theme mode: `'auto' \| 'dark' \| 'light'` (default `'dark'`) |
|
|
367
381
|
| `showDownload` | `boolean` | ❌ | Whether to show the download button (default `true`) |
|
|
368
382
|
| `showClose` | `boolean` | ❌ | Whether to show the close button (default `true` for modal) |
|
|
383
|
+
| `showNavigation` | `boolean` | ❌ | Whether to show file navigation arrows (default `true`) |
|
|
384
|
+
| `loopNavigation` | `boolean` | ❌ | Whether file navigation wraps around (default `false`) |
|
|
369
385
|
|
|
370
386
|
### FilePreviewModal Events
|
|
371
387
|
|
|
@@ -389,6 +405,8 @@ Differences from `FilePreviewModal`:
|
|
|
389
405
|
| `theme` | `Theme` | ❌ | `'dark'` | Theme mode: `'auto' \| 'dark' \| 'light'` |
|
|
390
406
|
| `showDownload` | `boolean` | ❌ | `true` | Whether to show the download button |
|
|
391
407
|
| `showClose` | `boolean` | ❌ | `false` | Whether to show the close button (default `false` for embed) |
|
|
408
|
+
| `showNavigation` | `boolean` | ❌ | `true` | Whether to show file navigation arrows |
|
|
409
|
+
| `loopNavigation` | `boolean` | ❌ | `false` | Whether file navigation wraps around |
|
|
392
410
|
|
|
393
411
|
### FilePreviewEmbed Events
|
|
394
412
|
|
|
@@ -836,6 +854,8 @@ Verify:
|
|
|
836
854
|
- `ESC` - Close preview
|
|
837
855
|
- `←` - Previous file
|
|
838
856
|
- `→` - Next file
|
|
857
|
+
- `Home` - First file
|
|
858
|
+
- `End` - Last file
|
|
839
859
|
- `Mouse Wheel` - Zoom image (image preview only)
|
|
840
860
|
|
|
841
861
|
## <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;" /> **键盘导航** -
|
|
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
|
|
|
@@ -53,23 +53,29 @@ import '@eternalheart/vue-file-preview/style.css';
|
|
|
53
53
|
1. 将 PDF.js 文件复制到你的 public 目录:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
cp -r node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdfjs/
|
|
56
|
+
cp -r node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs public/pdfjs/
|
|
57
57
|
cp -r node_modules/pdfjs-dist/cmaps public/pdfjs/
|
|
58
|
+
cp -r node_modules/pdfjs-dist/standard_fonts public/pdfjs/
|
|
59
|
+
cp -r node_modules/pdfjs-dist/wasm public/pdfjs/
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
2. 在应用入口配置 PDF.js:
|
|
61
63
|
|
|
62
64
|
```ts
|
|
63
|
-
import * as pdfjsLib from 'pdfjs-dist/build/pdf.mjs';
|
|
65
|
+
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.mjs';
|
|
64
66
|
import { configurePdfWorker } from '@eternalheart/vue-file-preview';
|
|
65
67
|
|
|
66
68
|
configurePdfWorker(pdfjsLib, {
|
|
67
69
|
workerSrc: '/pdfjs/pdf.worker.min.mjs',
|
|
68
70
|
cMapUrl: '/pdfjs/cmaps/',
|
|
69
71
|
cMapPacked: true,
|
|
72
|
+
standardFontDataUrl: '/pdfjs/standard_fonts/',
|
|
73
|
+
wasmUrl: '/pdfjs/wasm/',
|
|
70
74
|
});
|
|
71
75
|
```
|
|
72
76
|
|
|
77
|
+
请在客户端应用初始化阶段、首次渲染 PDF 前调用。Worker 必须使用与当前 `pdfjs-dist` 版本匹配的 legacy 构建。
|
|
78
|
+
|
|
73
79
|
#### 使用 Vite 自动复制(推荐)
|
|
74
80
|
|
|
75
81
|
在 `vite.config.ts` 中配置自动复制:
|
|
@@ -83,12 +89,20 @@ export default defineConfig({
|
|
|
83
89
|
viteStaticCopy({
|
|
84
90
|
targets: [
|
|
85
91
|
{
|
|
86
|
-
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
|
|
92
|
+
src: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs',
|
|
87
93
|
dest: 'pdfjs'
|
|
88
94
|
},
|
|
89
95
|
{
|
|
90
96
|
src: 'node_modules/pdfjs-dist/cmaps',
|
|
91
97
|
dest: 'pdfjs'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
src: 'node_modules/pdfjs-dist/standard_fonts',
|
|
101
|
+
dest: 'pdfjs'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
src: 'node_modules/pdfjs-dist/wasm',
|
|
105
|
+
dest: 'pdfjs'
|
|
92
106
|
}
|
|
93
107
|
]
|
|
94
108
|
})
|
|
@@ -239,7 +253,7 @@ const files = [
|
|
|
239
253
|
|
|
240
254
|
- 不使用 Teleport、无全屏遮罩、没有 `isOpen` / `@close`
|
|
241
255
|
- **不显示关闭按钮**
|
|
242
|
-
- 键盘导航 (
|
|
256
|
+
- 键盘导航 (←/→/Home/End) 作用域限定在嵌入容器内 (基于 focus)
|
|
243
257
|
- 尺寸默认 `width: 100%; height: 100%`,可通过 `width` / `height` props 覆盖
|
|
244
258
|
|
|
245
259
|
```vue
|
|
@@ -279,7 +293,7 @@ const files = [
|
|
|
279
293
|
### 代码 & 文本
|
|
280
294
|
- **Markdown**: GitHub Flavored Markdown,代码高亮
|
|
281
295
|
- **代码文件**: Vue、Svelte、Astro、JS/TS、Dart、GraphQL、Protobuf、Prisma、Terraform、PowerShell、Scala 等 40+ 种语言
|
|
282
|
-
- **配置 / 日志**: YAML, TOML, INI, ENV, LOG, DIFF, PATCH 等
|
|
296
|
+
- **配置 / 日志**: YAML, TOML, INI, ENV, PROPERTIES, BAT, CMD, TEX, MAP, LOG, DIFF, PATCH 等
|
|
283
297
|
|
|
284
298
|
### 结构化数据
|
|
285
299
|
- **JSON**: 自动格式化 + 语法高亮
|
|
@@ -366,6 +380,8 @@ const files = [
|
|
|
366
380
|
| `theme` | `Theme` | ❌ | 主题模式: `'auto' \| 'dark' \| 'light'`(默认 `'dark'`) |
|
|
367
381
|
| `showDownload` | `boolean` | ❌ | 是否显示下载按钮(默认 `true`) |
|
|
368
382
|
| `showClose` | `boolean` | ❌ | 是否显示关闭按钮(modal 模式默认 `true`) |
|
|
383
|
+
| `showNavigation` | `boolean` | ❌ | 是否显示文件导航箭头(默认 `true`) |
|
|
384
|
+
| `loopNavigation` | `boolean` | ❌ | 是否循环导航文件(默认 `false`) |
|
|
369
385
|
|
|
370
386
|
### FilePreviewModal 事件
|
|
371
387
|
|
|
@@ -389,6 +405,8 @@ const files = [
|
|
|
389
405
|
| `theme` | `Theme` | ❌ | `'dark'` | 主题模式: `'auto' \| 'dark' \| 'light'` |
|
|
390
406
|
| `showDownload` | `boolean` | ❌ | `true` | 是否显示下载按钮 |
|
|
391
407
|
| `showClose` | `boolean` | ❌ | `false` | 是否显示关闭按钮(embed 模式默认 `false`) |
|
|
408
|
+
| `showNavigation` | `boolean` | ❌ | `true` | 是否显示文件导航箭头 |
|
|
409
|
+
| `loopNavigation` | `boolean` | ❌ | `false` | 是否循环导航文件 |
|
|
392
410
|
|
|
393
411
|
### FilePreviewEmbed 事件
|
|
394
412
|
|
|
@@ -836,6 +854,8 @@ watch(resolvedTheme, highlightCode, { immediate: true });
|
|
|
836
854
|
- `ESC` - 关闭预览
|
|
837
855
|
- `←` - 上一个文件
|
|
838
856
|
- `→` - 下一个文件
|
|
857
|
+
- `Home` - 第一个文件
|
|
858
|
+
- `End` - 最后一个文件
|
|
839
859
|
- `滚轮` - 缩放图片 (仅图片预览)
|
|
840
860
|
|
|
841
861
|
## 📚 文档
|
|
@@ -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 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-
|
|
3
|
+
import { u as We, i as Be, Z as De, W as Oe, p as je, R as Ze } from "./index-Hj5oboUU.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,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as L, ref as c, watch as M, computed as D, openBlock as n, createElementBlock as a, createElementVNode as r, createBlock as H, unref as h, toDisplayString as w, normalizeStyle as B, Fragment as y, renderList as F } from "vue";
|
|
2
|
-
import { u as G, b as N, e as P } from "./index-
|
|
3
|
-
import { u as X } from "./useShikiHighlight-
|
|
2
|
+
import { u as G, b as N, e as P } from "./index-Hj5oboUU.mjs";
|
|
3
|
+
import { u as X } from "./useShikiHighlight-xcK26Bn3.mjs";
|
|
4
4
|
import { _ as j } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const E = {
|
|
6
6
|
key: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as E, ref as p, onMounted as D, watch as M, onBeforeUnmount as z, openBlock as v, createElementBlock as h, createElementVNode as m, toDisplayString as B, unref as _, createCommentVNode as w, createBlock as S, normalizeStyle as C } from "vue";
|
|
2
2
|
import W from "exceljs";
|
|
3
3
|
import { S as H } from "./index-CyBXARuf.mjs";
|
|
4
|
-
import { u as R, b as G, C as L, s as F, y as N, g as O } from "./index-
|
|
4
|
+
import { u as R, b as G, C as L, s as F, y as N, g as O } from "./index-Hj5oboUU.mjs";
|
|
5
5
|
import { _ as V } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
6
6
|
const $ = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, j = {
|
|
7
7
|
key: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as ie, ref as c, watch as U, onMounted as se, onBeforeUnmount as ue, openBlock as p, createElementBlock as v, createBlock as fe, createCommentVNode as C, createElementVNode as h, normalizeStyle as T, toDisplayString as N, unref as J, createVNode as ce, Fragment as O, renderList as K } from "vue";
|
|
2
2
|
import pe from "@likecoin/epub-ts";
|
|
3
3
|
import { List as ve, ChevronLeft as he, ChevronRight as de, Minimize2 as be, Maximize2 as me, X as ge } from "lucide-vue-next";
|
|
4
|
-
import { u as xe, b as ye } from "./index-
|
|
4
|
+
import { u as xe, b as ye } from "./index-Hj5oboUU.mjs";
|
|
5
5
|
import { _ as we } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
6
6
|
import { T as ke } from "./base.types-DaftHyg7.mjs";
|
|
7
7
|
const _e = { class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-justify-center vfp-bg-surface-1 vfp-overflow-hidden" }, Te = {
|
|
@@ -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-
|
|
3
|
+
import { u as H, b as I, D as N } from "./index-Hj5oboUU.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,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, ref as a, watch as _, openBlock as n, createElementBlock as c, createElementVNode as l, createBlock as h } from "vue";
|
|
2
|
-
import { u as w, b as y, T as x } from "./index-
|
|
2
|
+
import { u as w, b as y, T as x } from "./index-Hj5oboUU.mjs";
|
|
3
3
|
import { _ as g } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
4
4
|
const b = {
|
|
5
5
|
key: 0,
|
|
@@ -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-
|
|
2
|
+
import { u as Hr, b as Vr, c as zr } from "./index-Hj5oboUU.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() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as L, ref as a, watch as _, nextTick as M, computed as y, openBlock as s, createElementBlock as c, createElementVNode as f, createBlock as $, normalizeStyle as p, Fragment as N, renderList as j } from "vue";
|
|
2
2
|
import I from "mammoth";
|
|
3
|
-
import { u as F, b as X, X as C, j as R, B as q } from "./index-
|
|
3
|
+
import { u as F, b as X, X as C, j as R, B as q } from "./index-Hj5oboUU.mjs";
|
|
4
4
|
import { _ as z } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const O = {
|
|
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-
|
|
3
|
+
import { u as lr, b as dr, _ as pr } from "./index-Hj5oboUU.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) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as me, ref as p, watch as ue, onMounted as ce, onBeforeUnmount as ve, openBlock as S, createElementBlock as B, createBlock as Me, createCommentVNode as D, createElementVNode as h, normalizeStyle as W, toDisplayString as Ce, unref as K, createVNode as de, h as N } from "vue";
|
|
2
2
|
import { List as Se, ChevronLeft as Ne, ChevronRight as Re, Minimize2 as ze, Maximize2 as Ae, X as Le } from "lucide-vue-next";
|
|
3
3
|
import "foliate-js/view.js";
|
|
4
|
-
import { u as Fe, b as Pe, _ as $e } from "./index-
|
|
4
|
+
import { u as Fe, b as Pe, _ as $e } from "./index-Hj5oboUU.mjs";
|
|
5
5
|
import { _ as He } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
6
6
|
import { T as Be } from "./base.types-DaftHyg7.mjs";
|
|
7
7
|
const De = { class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-justify-center vfp-bg-surface-1 vfp-overflow-hidden" }, We = {
|
|
@@ -5,7 +5,7 @@ import { DXFLoader as ce } from "three-dxf-loader";
|
|
|
5
5
|
import { STLLoader as ue } from "three/examples/jsm/loaders/STLLoader";
|
|
6
6
|
import { OBJLoader as de } from "three/examples/jsm/loaders/OBJLoader";
|
|
7
7
|
import { GLTFLoader as pe } from "three/examples/jsm/loaders/GLTFLoader";
|
|
8
|
-
import { u as me, b as ve } from "./index-
|
|
8
|
+
import { u as me, b as ve } from "./index-Hj5oboUU.mjs";
|
|
9
9
|
import { T as ge } from "./base.types-DaftHyg7.mjs";
|
|
10
10
|
import { RotateCcw as we, Box as he, Grid3x3 as be, Axis3d as ye } from "lucide-vue-next";
|
|
11
11
|
function Me(c) {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent as S, ref as i, computed as c, watch as x, unref as h, openBlock as a, createElementBlock as n, createElementVNode as l, createBlock as B, normalizeClass as k, toDisplayString as T, normalizeStyle as F, Fragment as E, renderList as z } from "vue";
|
|
2
|
+
import { WrapText as G, Code as M, Eye as W } from "lucide-vue-next";
|
|
3
|
+
import { u as $, b as j, k as D, e as P } from "./index-Hj5oboUU.mjs";
|
|
4
|
+
import { u as R } from "./useShikiHighlight-xcK26Bn3.mjs";
|
|
5
|
+
import { _ as V } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
6
|
+
import { T as q } from "./base.types-DaftHyg7.mjs";
|
|
7
|
+
const A = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"
|
|
10
|
+
}, I = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "vfp-w-full vfp-h-full vfp-bg-surface-toolbar"
|
|
13
|
+
}, J = ["srcdoc", "title"], K = {
|
|
14
|
+
key: 3,
|
|
15
|
+
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
16
|
+
style: { background: "var(--fp-code-bg)" }
|
|
17
|
+
}, O = {
|
|
18
|
+
key: 4,
|
|
19
|
+
class: "vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
20
|
+
style: { background: "var(--fp-code-bg)" }
|
|
21
|
+
}, Q = { class: "vfp-code-gutter" }, U = ["innerHTML"], se = /* @__PURE__ */ S({
|
|
22
|
+
__name: "index",
|
|
23
|
+
props: {
|
|
24
|
+
url: {},
|
|
25
|
+
fileName: {}
|
|
26
|
+
},
|
|
27
|
+
setup(g, { expose: H }) {
|
|
28
|
+
const d = g, b = new q(), { t: u } = $(), C = j(), t = i(!0), o = i(!1), v = i(""), f = i(!0), p = i(null), r = c(() => D(d.fileName)), L = c(() => r.value !== "text" ? v.value : ""), { lineHtmls: w, loading: N } = R(L, r), y = c(() => r.value === "html");
|
|
29
|
+
x([t, o, f, y], () => {
|
|
30
|
+
b.notify();
|
|
31
|
+
}), x(() => d.url, async () => {
|
|
32
|
+
f.value = !0, p.value = null;
|
|
33
|
+
try {
|
|
34
|
+
const e = await P(d.url, { fetcher: C.value });
|
|
35
|
+
v.value = e;
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error(e), p.value = u.value("text.load_failed");
|
|
38
|
+
} finally {
|
|
39
|
+
f.value = !1;
|
|
40
|
+
}
|
|
41
|
+
}, { immediate: !0 });
|
|
42
|
+
const _ = c(() => v.value.split(`
|
|
43
|
+
`));
|
|
44
|
+
return H({
|
|
45
|
+
getToolbarGroups: () => {
|
|
46
|
+
const e = [];
|
|
47
|
+
return e.push({
|
|
48
|
+
items: [
|
|
49
|
+
{
|
|
50
|
+
type: "button",
|
|
51
|
+
icon: G,
|
|
52
|
+
tooltip: t.value ? u.value("toolbar.wrap_off") : u.value("toolbar.wrap_on"),
|
|
53
|
+
action: () => {
|
|
54
|
+
t.value = !t.value;
|
|
55
|
+
},
|
|
56
|
+
active: t.value
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}), y.value && e.push({
|
|
60
|
+
items: [
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
icon: o.value ? M : W,
|
|
64
|
+
tooltip: o.value ? u.value("toolbar.source") : u.value("toolbar.preview"),
|
|
65
|
+
action: () => {
|
|
66
|
+
o.value = !o.value;
|
|
67
|
+
},
|
|
68
|
+
active: o.value
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}), e;
|
|
72
|
+
},
|
|
73
|
+
onToolbarChange: (e) => b.subscribe(e)
|
|
74
|
+
}), (e, s) => f.value || r.value !== "text" && h(N) ? (a(), n("div", A, [...s[0] || (s[0] = [
|
|
75
|
+
l("div", { class: "vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin" }, null, -1)
|
|
76
|
+
])])) : p.value ? (a(), B(V, {
|
|
77
|
+
key: 1,
|
|
78
|
+
message: p.value
|
|
79
|
+
}, null, 8, ["message"])) : o.value && r.value === "html" ? (a(), n("div", I, [
|
|
80
|
+
l("iframe", {
|
|
81
|
+
srcdoc: v.value,
|
|
82
|
+
sandbox: "allow-same-origin",
|
|
83
|
+
class: "vfp-w-full vfp-h-full vfp-border-0",
|
|
84
|
+
title: g.fileName
|
|
85
|
+
}, null, 8, J)
|
|
86
|
+
])) : r.value === "text" || h(w).length === 0 ? (a(), n("div", K, [
|
|
87
|
+
l("pre", {
|
|
88
|
+
class: k(["vfp-py-6 vfp-px-4 vfp-text-fg-primary vfp-font-mono vfp-text-sm", t.value ? "vfp-whitespace-pre-wrap vfp-break-words" : "vfp-whitespace-pre"])
|
|
89
|
+
}, T(v.value), 3)
|
|
90
|
+
])) : (a(), n("div", O, [
|
|
91
|
+
l("div", {
|
|
92
|
+
class: k(["vfp-code-block with-line-numbers vfp-w-full", { "no-wrap": !t.value }]),
|
|
93
|
+
style: F({ gridTemplateRows: `repeat(${_.value.length}, auto) minmax(1.5rem, 1fr)` })
|
|
94
|
+
}, [
|
|
95
|
+
(a(!0), n(E, null, z(_.value, (Z, m) => (a(), n(E, { key: m }, [
|
|
96
|
+
l("span", Q, T(m + 1), 1),
|
|
97
|
+
l("span", {
|
|
98
|
+
class: "vfp-code-line",
|
|
99
|
+
innerHTML: h(w)[m] ?? ""
|
|
100
|
+
}, null, 8, U)
|
|
101
|
+
], 64))), 128)),
|
|
102
|
+
s[1] || (s[1] = l("span", { class: "vfp-code-gutter-filler" }, null, -1)),
|
|
103
|
+
s[2] || (s[2] = l("span", { class: "vfp-code-line-filler" }, null, -1))
|
|
104
|
+
], 6)
|
|
105
|
+
]));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
se as default
|
|
110
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { r as ue, u as pe } from "./index-
|
|
3
|
+
import { r as ue, u as pe } from "./index-Hj5oboUU.mjs";
|
|
4
4
|
import { _ as de } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as k, ref as p, onMounted as D, watch as z, onBeforeUnmount as M, openBlock as v, createElementBlock as h, createElementVNode as m, toDisplayString as S, unref as C, createCommentVNode as w, createBlock as N, normalizeStyle as B } from "vue";
|
|
2
2
|
import { S as H } from "./index-CyBXARuf.mjs";
|
|
3
|
-
import { u as O, b as R, e as W, d as G, O as V, l as E } from "./index-
|
|
3
|
+
import { u as O, b as R, e as W, d as G, O as V, l as E } from "./index-Hj5oboUU.mjs";
|
|
4
4
|
import { _ as F } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
5
5
|
const L = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, j = {
|
|
6
6
|
key: 0,
|
|
@@ -14,7 +14,7 @@ var $t = (u, e, t, s) => ({
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
import { defineComponent as jb, ref as Si, watch as aa, nextTick as wu, onMounted as Gb, onBeforeUnmount as _b, openBlock as zh, createElementBlock as Eu, normalizeStyle as Ep, createElementVNode as sn, toDisplayString as zb, unref as Im, createVNode as Vb, createCommentVNode as Su, createBlock as Wb } from "vue";
|
|
17
|
-
import { a as Xb, u as Yb, Y as Pm, A as Kb } from "./index-
|
|
17
|
+
import { a as Xb, u as Yb, Y as Pm, A as Kb } from "./index-Hj5oboUU.mjs";
|
|
18
18
|
import { _ as Jb } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
19
19
|
import { X as Qb, Menu as Zb, ChevronLeft as qb, ChevronRight as tA, ZoomOut as eA, ZoomIn as sA, RefreshCw as iA } from "lucide-vue-next";
|
|
20
20
|
import { T as nA } from "./base.types-DaftHyg7.mjs";
|
|
@@ -3,7 +3,7 @@ import N from "markdown-it";
|
|
|
3
3
|
import Y from "@traptitech/markdown-it-katex";
|
|
4
4
|
import { codeToHtml as E } from "shiki";
|
|
5
5
|
import { Code as F, Eye as W } from "lucide-vue-next";
|
|
6
|
-
import { u as z, b as J, c as Q, e as U, _ as X } from "./index-
|
|
6
|
+
import { u as z, b as J, c as Q, e as U, _ as X } from "./index-Hj5oboUU.mjs";
|
|
7
7
|
import { _ as Z } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
|
|
8
8
|
import { T as ee } from "./base.types-DaftHyg7.mjs";
|
|
9
9
|
const te = {
|
|
@@ -19,14 +19,14 @@ const te = {
|
|
|
19
19
|
}, ne = ["innerHTML"], le = {
|
|
20
20
|
key: 3,
|
|
21
21
|
class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
|
|
22
|
-
},
|
|
22
|
+
}, ae = ["innerHTML"], B = '<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>', L = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>', se = '<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>', ce = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>', ie = /* @__PURE__ */ P({
|
|
23
23
|
__name: "index",
|
|
24
24
|
props: {
|
|
25
25
|
url: {}
|
|
26
26
|
},
|
|
27
27
|
setup(q, { expose: V }) {
|
|
28
|
-
const _ = q, x = new ee(), { t: i } = z(), j = J(), G = Q(), y = D(() => G.value === "light" ? "github-light" : "github-dark"),
|
|
29
|
-
k([
|
|
28
|
+
const _ = q, x = new ee(), { t: i } = z(), j = J(), G = Q(), y = D(() => G.value === "light" ? "github-light" : "github-dark"), s = c("preview"), b = c(""), v = c(""), f = c(""), p = c(!0), h = c(null), m = c(null);
|
|
29
|
+
k([s, p], () => {
|
|
30
30
|
x.notify();
|
|
31
31
|
}), V({
|
|
32
32
|
getToolbarGroups: () => {
|
|
@@ -35,12 +35,12 @@ const te = {
|
|
|
35
35
|
items: [
|
|
36
36
|
{
|
|
37
37
|
type: "button",
|
|
38
|
-
icon:
|
|
39
|
-
tooltip:
|
|
38
|
+
icon: s.value === "preview" ? F : W,
|
|
39
|
+
tooltip: s.value === "preview" ? i.value("toolbar.source") : i.value("toolbar.preview"),
|
|
40
40
|
action: () => {
|
|
41
|
-
|
|
41
|
+
s.value = s.value === "preview" ? "source" : "preview";
|
|
42
42
|
},
|
|
43
|
-
active:
|
|
43
|
+
active: s.value === "source"
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
46
|
}), e;
|
|
@@ -96,7 +96,7 @@ const te = {
|
|
|
96
96
|
const o = document.createElement("textarea");
|
|
97
97
|
o.value = e, document.body.appendChild(o), o.select(), document.execCommand("copy"), document.body.removeChild(o);
|
|
98
98
|
}
|
|
99
|
-
t.innerHTML = r ?
|
|
99
|
+
t.innerHTML = r ? se : ce, t.title = i.value("markdown.copied"), setTimeout(() => {
|
|
100
100
|
t.innerHTML = r ? B : L, t.title = i.value("markdown.copy_code");
|
|
101
101
|
}, 2e3);
|
|
102
102
|
}), t;
|
|
@@ -105,9 +105,9 @@ const te = {
|
|
|
105
105
|
if (!m.value) return;
|
|
106
106
|
const e = m.value.querySelectorAll('pre[data-shiki-pending="1"]');
|
|
107
107
|
for (const o of e) {
|
|
108
|
-
const w = o.getAttribute("data-lang") || "text",
|
|
108
|
+
const w = o.getAttribute("data-lang") || "text", a = ((t = o.querySelector("code")) == null ? void 0 : t.textContent) || "";
|
|
109
109
|
try {
|
|
110
|
-
const g = await E(
|
|
110
|
+
const g = await E(a, { lang: w, theme: y.value }), M = document.createElement("div");
|
|
111
111
|
M.innerHTML = g;
|
|
112
112
|
const S = M.firstElementChild;
|
|
113
113
|
S && o.replaceWith(S);
|
|
@@ -118,7 +118,7 @@ const te = {
|
|
|
118
118
|
const r = m.value.querySelectorAll(".code-block-wrapper");
|
|
119
119
|
for (const o of r) {
|
|
120
120
|
if (o.querySelector(".code-copy-btn")) continue;
|
|
121
|
-
const w = o.querySelector(".code-block-header"),
|
|
121
|
+
const w = o.querySelector(".code-block-header"), a = o.querySelector("pre"), g = ((n = a == null ? void 0 : a.querySelector("code")) == null ? void 0 : n.textContent) ?? (a == null ? void 0 : a.textContent) ?? "";
|
|
122
122
|
w ? w.appendChild(T(g, !0)) : o.appendChild(T(g, !1));
|
|
123
123
|
}
|
|
124
124
|
};
|
|
@@ -131,7 +131,7 @@ const te = {
|
|
|
131
131
|
])])) : h.value ? (d(), O(Z, {
|
|
132
132
|
key: 1,
|
|
133
133
|
message: h.value
|
|
134
|
-
}, null, 8, ["message"])) :
|
|
134
|
+
}, null, 8, ["message"])) : s.value === "source" ? (d(), u("div", oe, [
|
|
135
135
|
f.value ? (d(), u("div", {
|
|
136
136
|
key: 1,
|
|
137
137
|
class: "shiki-wrapper",
|
|
@@ -143,10 +143,10 @@ const te = {
|
|
|
143
143
|
ref: m,
|
|
144
144
|
class: "markdown-body",
|
|
145
145
|
innerHTML: v.value
|
|
146
|
-
}, null, 8,
|
|
146
|
+
}, null, 8, ae)
|
|
147
147
|
]));
|
|
148
148
|
}
|
|
149
|
-
}), ke = /* @__PURE__ */ X(ie, [["__scopeId", "data-v-
|
|
149
|
+
}), ke = /* @__PURE__ */ X(ie, [["__scopeId", "data-v-ccd85c2a"]]);
|
|
150
150
|
export {
|
|
151
151
|
ke as default
|
|
152
152
|
};
|
|
@@ -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-
|
|
3
|
+
import { u as N, n as _ } from "./index-Hj5oboUU.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,
|