@dengnanhao/preview 0.0.2 → 0.0.3

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 (47) hide show
  1. package/README.md +167 -0
  2. package/README.zh-CN.md +167 -0
  3. package/package.json +1 -1
  4. package/dist/add-user-BN1JlY7e-BbH6gvZe.js +0 -8
  5. package/dist/book-nTEFXU2x-BvY35CMb.js +0 -8
  6. package/dist/build/config.d.ts +0 -3
  7. package/dist/build/config.es.d.ts +0 -2
  8. package/dist/build/config.umd.d.ts +0 -2
  9. package/dist/check-circle-fill-B_pd8ZSs-Bm7ZHLU4.js +0 -8
  10. package/dist/check-circle-szyAJiap-ClZivfVI.js +0 -8
  11. package/dist/close-CFnkhudp-DInt_GS9.js +0 -8
  12. package/dist/close-circle-CwmuN2C6-CHbRWPjt.js +0 -8
  13. package/dist/close-circle-fill-jSqPPw9i-dWW7Jy4a.js +0 -8
  14. package/dist/components/preview/constant.d.ts +0 -5
  15. package/dist/components/preview/index.d.ts +0 -4
  16. package/dist/components/preview/pdf.d.ts +0 -39
  17. package/dist/components/preview/types.d.ts +0 -12
  18. package/dist/eye-D_mEt17f-CVTb40Hq.js +0 -8
  19. package/dist/eye-close-BVr3NJtg-DC1RKLuy.js +0 -8
  20. package/dist/home-BUQ4USMk-C2nbhvtZ.js +0 -8
  21. package/dist/index-B1MazAOp.js +0 -113200
  22. package/dist/index.d.ts +0 -1
  23. package/dist/index.js +0 -4
  24. package/dist/info-circle-COnL5bTJ-CxNFZEW5.js +0 -8
  25. package/dist/info-circle-fill-DjI8gXS3-DAY0DgPh.js +0 -26
  26. package/dist/loading-Dcc5RApI-78qa8Z8G.js +0 -8
  27. package/dist/loading-scene-BMc2wqKm-Uorz2TPs.js +0 -8
  28. package/dist/lock-Cr7BnmWN-BHb11yDM.js +0 -8
  29. package/dist/message-D36_Zo2l-CjpTcvt4.js +0 -8
  30. package/dist/pdf-8k3nRqwL.js +0 -154
  31. package/dist/plugins/load-style.d.ts +0 -6
  32. package/dist/power-off-lQRbiBak-DcHnxku-.js +0 -8
  33. package/dist/preview-CJbz9GjO-DnoXuzit.js +0 -8
  34. package/dist/preview.js +0 -4
  35. package/dist/search-BWdfjyP8-CLaimEXc.js +0 -8
  36. package/dist/setting-DemlgzVC-DLC7fxEX.js +0 -8
  37. package/dist/sort-DWqiUONr-BHkxnzb7.js +0 -8
  38. package/dist/sprite-CH2zLtZy-CVdmSPKr.js +0 -145
  39. package/dist/team-tl4NJXPC-C1YuKw_w.js +0 -8
  40. package/dist/umd/index.umd.cjs +0 -1
  41. package/dist/unlock-CeU74z9n-BxB2opdV.js +0 -8
  42. package/dist/user-B-eVXwuk-B-jF4D1U.js +0 -8
  43. package/dist/utils/index.d.ts +0 -6
  44. package/dist/vite.config.d.ts +0 -6
  45. package/dist/warning-circle-DDUgEDIv-Df6_CD0s.js +0 -8
  46. package/dist/warning-circle-fill-lODUKz0i-Y2_L3s2r.js +0 -8
  47. package/dist/without-content-CdJw7vHM-DirXp6SF.js +0 -8
package/README.md ADDED
@@ -0,0 +1,167 @@
1
+ # @ranui/preview
2
+
3
+ [English](README.md) | [中文](README.zh-CN.md)
4
+
5
+ A powerful file preview component library that supports PDF and Office documents (DOCX, PPTX, XLSX, XLS) with a modern web interface.
6
+
7
+ ## Features
8
+
9
+ - 📄 **PDF Preview**: Full PDF document rendering with zoom and navigation
10
+ - 📊 **Office Documents**: Support for Microsoft Office formats
11
+ - Word documents (DOCX)
12
+ - PowerPoint presentations (PPTX)
13
+ - Excel spreadsheets (XLSX, XLS)
14
+ - 🎨 **Modern UI**: Clean and responsive design with loading states
15
+ - 🔧 **Customizable**: Configurable options for different use cases
16
+ - 🚀 **Lightweight**: Optimized bundle size for better performance
17
+ - 🛡️ **TypeScript**: Full TypeScript support with type definitions
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install @ranui/preview
23
+ # or
24
+ pnpm add @ranui/preview
25
+ # or
26
+ yarn add @ranui/preview
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ### Basic Usage
32
+
33
+ ```html
34
+ <!DOCTYPE html>
35
+ <html>
36
+ <head>
37
+ <title>File Preview Demo</title>
38
+ </head>
39
+ <body>
40
+ <input type="file" id="fileInput" />
41
+ <r-preview id="preview"></r-preview>
42
+
43
+ <script type="module">
44
+ import '@ranui/preview';
45
+
46
+ const fileInput = document.getElementById('fileInput');
47
+ const preview = document.getElementById('preview');
48
+
49
+ fileInput.addEventListener('change', (e) => {
50
+ const file = e.target.files[0];
51
+ if (file) {
52
+ const url = URL.createObjectURL(file);
53
+ preview.setAttribute('src', url);
54
+ }
55
+ });
56
+ </script>
57
+ </body>
58
+ </html>
59
+ ```
60
+
61
+ ### Programmatic Usage
62
+
63
+ ```javascript
64
+ import { preview } from '@ranui/preview';
65
+
66
+ // The component is automatically registered as a custom element
67
+ // You can now use <r-preview> in your HTML
68
+ ```
69
+
70
+ ## API Reference
71
+
72
+ ### Custom Element: `<r-preview>`
73
+
74
+ #### Attributes
75
+
76
+ | Attribute | Type | Default | Description |
77
+ |-----------|------|---------|-------------|
78
+ | `src` | string | - | File URL or blob URL to preview |
79
+ | `closeable` | boolean | false | Whether to show close button |
80
+ | `baseUrl` | string | 'https://ranuts.github.io/document' | Base URL for Office document rendering |
81
+ | `label` | string | - | Custom label for the preview |
82
+
83
+ #### Methods
84
+
85
+ | Method | Description |
86
+ |--------|-------------|
87
+ | `showPreview()` | Manually trigger preview display |
88
+ | `closePreview()` | Close the preview modal |
89
+
90
+ #### Events
91
+
92
+ | Event | Description |
93
+ |-------|-------------|
94
+ | `load` | Fired when file is successfully loaded |
95
+ | `error` | Fired when file loading fails |
96
+
97
+ ### Supported File Types
98
+
99
+ - **PDF**: `application/pdf`
100
+ - **Word**: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
101
+ - **PowerPoint**: `application/vnd.openxmlformats-officedocument.presentationml.presentation`
102
+ - **Excel**:
103
+ - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX)
104
+ - `application/vnd.ms-excel` (XLS)
105
+
106
+ ## Development
107
+
108
+ ### Prerequisites
109
+
110
+ - Node.js >= 23.10.0
111
+ - pnpm (recommended)
112
+
113
+ ### Setup
114
+
115
+ ```bash
116
+ # Clone the repository
117
+ git clone https://github.com/ranuts/fileview.git
118
+ cd fileview
119
+
120
+ # Install dependencies
121
+ pnpm install
122
+
123
+ # Start development server
124
+ pnpm dev
125
+
126
+ # Build for production
127
+ pnpm build
128
+
129
+ # Run tests
130
+ pnpm test
131
+ ```
132
+
133
+ ### Scripts
134
+
135
+ - `pnpm dev` - Start development server with hot reload
136
+ - `pnpm build` - Build for production
137
+ - `pnpm test` - Run test suite
138
+ - `pnpm test:ui` - Run tests with UI
139
+ - `pnpm test:report` - Show test report
140
+
141
+ ## Browser Support
142
+
143
+ - Chrome >= 88
144
+ - Firefox >= 85
145
+ - Safari >= 14
146
+ - Edge >= 88
147
+
148
+ ## License
149
+
150
+ AGPL-3.0 License - see [LICENSE](LICENSE) file for details.
151
+
152
+ ## Contributing
153
+
154
+ 1. Fork the repository
155
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
156
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
157
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
158
+ 5. Open a Pull Request
159
+
160
+ ## Related Projects
161
+
162
+ - [ranui](https://github.com/ranuts/ranui) - Modern UI component library
163
+ - [ranuts](https://github.com/ranuts/ranuts) - Utility library
164
+
165
+ ## Support
166
+
167
+ If you encounter any issues or have questions, please [open an issue](https://github.com/ranuts/fileview/issues) on GitHub.
@@ -0,0 +1,167 @@
1
+ # @ranui/preview
2
+
3
+ [English](README.md) | [中文](README.zh-CN.md)
4
+
5
+ 一个功能强大的文件预览组件库,支持 PDF 和 Office 文档(DOCX、PPTX、XLSX、XLS)的预览,具有现代化的 Web 界面。
6
+
7
+ ## 功能特性
8
+
9
+ - 📄 **PDF 预览**: 完整的 PDF 文档渲染,支持缩放和导航
10
+ - 📊 **Office 文档**: 支持 Microsoft Office 格式
11
+ - Word 文档 (DOCX)
12
+ - PowerPoint 演示文稿 (PPTX)
13
+ - Excel 电子表格 (XLSX, XLS)
14
+ - 🎨 **现代化 UI**: 简洁响应式设计,包含加载状态
15
+ - 🔧 **可定制**: 支持不同使用场景的配置选项
16
+ - 🚀 **轻量级**: 优化的包大小,提供更好的性能
17
+ - 🛡️ **TypeScript**: 完整的 TypeScript 支持和类型定义
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ npm install @ranui/preview
23
+ # 或
24
+ pnpm add @ranui/preview
25
+ # 或
26
+ yarn add @ranui/preview
27
+ ```
28
+
29
+ ## 快速开始
30
+
31
+ ### 基础用法
32
+
33
+ ```html
34
+ <!DOCTYPE html>
35
+ <html>
36
+ <head>
37
+ <title>文件预览演示</title>
38
+ </head>
39
+ <body>
40
+ <input type="file" id="fileInput" />
41
+ <r-preview id="preview"></r-preview>
42
+
43
+ <script type="module">
44
+ import '@ranui/preview';
45
+
46
+ const fileInput = document.getElementById('fileInput');
47
+ const preview = document.getElementById('preview');
48
+
49
+ fileInput.addEventListener('change', (e) => {
50
+ const file = e.target.files[0];
51
+ if (file) {
52
+ const url = URL.createObjectURL(file);
53
+ preview.setAttribute('src', url);
54
+ }
55
+ });
56
+ </script>
57
+ </body>
58
+ </html>
59
+ ```
60
+
61
+ ### 编程式用法
62
+
63
+ ```javascript
64
+ import { preview } from '@ranui/preview';
65
+
66
+ // 组件会自动注册为自定义元素
67
+ // 现在可以在 HTML 中使用 <r-preview>
68
+ ```
69
+
70
+ ## API 参考
71
+
72
+ ### 自定义元素:`<r-preview>`
73
+
74
+ #### 属性
75
+
76
+ | 属性 | 类型 | 默认值 | 描述 |
77
+ |------|------|--------|------|
78
+ | `src` | string | - | 要预览的文件 URL 或 blob URL |
79
+ | `closeable` | boolean | false | 是否显示关闭按钮 |
80
+ | `baseUrl` | string | 'https://ranuts.github.io/document' | Office 文档渲染的基础 URL |
81
+ | `label` | string | - | 预览的自定义标签 |
82
+
83
+ #### 方法
84
+
85
+ | 方法 | 描述 |
86
+ |------|------|
87
+ | `showPreview()` | 手动触发预览显示 |
88
+ | `closePreview()` | 关闭预览模态框 |
89
+
90
+ #### 事件
91
+
92
+ | 事件 | 描述 |
93
+ |------|------|
94
+ | `load` | 文件成功加载时触发 |
95
+ | `error` | 文件加载失败时触发 |
96
+
97
+ ### 支持的文件类型
98
+
99
+ - **PDF**: `application/pdf`
100
+ - **Word**: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
101
+ - **PowerPoint**: `application/vnd.openxmlformats-officedocument.presentationml.presentation`
102
+ - **Excel**:
103
+ - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX)
104
+ - `application/vnd.ms-excel` (XLS)
105
+
106
+ ## 开发
107
+
108
+ ### 环境要求
109
+
110
+ - Node.js >= 23.10.0
111
+ - pnpm (推荐)
112
+
113
+ ### 设置
114
+
115
+ ```bash
116
+ # 克隆仓库
117
+ git clone https://github.com/ranuts/fileview.git
118
+ cd fileview
119
+
120
+ # 安装依赖
121
+ pnpm install
122
+
123
+ # 启动开发服务器
124
+ pnpm dev
125
+
126
+ # 构建生产版本
127
+ pnpm build
128
+
129
+ # 运行测试
130
+ pnpm test
131
+ ```
132
+
133
+ ### 脚本命令
134
+
135
+ - `pnpm dev` - 启动开发服务器,支持热重载
136
+ - `pnpm build` - 构建生产版本
137
+ - `pnpm test` - 运行测试套件
138
+ - `pnpm test:ui` - 使用 UI 运行测试
139
+ - `pnpm test:report` - 显示测试报告
140
+
141
+ ## 浏览器支持
142
+
143
+ - Chrome >= 88
144
+ - Firefox >= 85
145
+ - Safari >= 14
146
+ - Edge >= 88
147
+
148
+ ## 许可证
149
+
150
+ AGPL-3.0 许可证 - 详情请查看 [LICENSE](LICENSE) 文件。
151
+
152
+ ## 贡献
153
+
154
+ 1. Fork 该仓库
155
+ 2. 创建你的特性分支 (`git checkout -b feature/amazing-feature`)
156
+ 3. 提交你的更改 (`git commit -m '添加一些很棒的特性'`)
157
+ 4. 推送到分支 (`git push origin feature/amazing-feature`)
158
+ 5. 打开一个 Pull Request
159
+
160
+ ## 相关项目
161
+
162
+ - [ranui](https://github.com/ranuts/ranui) - 现代化 UI 组件库
163
+ - [ranuts](https://github.com/ranuts/ranuts) - 工具库
164
+
165
+ ## 支持
166
+
167
+ 如果你遇到任何问题或有疑问,请在 GitHub 上[提交 issue](https://github.com/ranuts/fileview/issues)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dengnanhao/preview",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "ranui preview",
5
5
  "main": "dist/umd/index.umd.cjs",
6
6
  "module": "dist/index.js",
@@ -1,8 +0,0 @@
1
- const addUser = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667110768583" class="icon" viewBox="0 0 1024 1024" version="1.1"\n xmlns="http://www.w3.org/2000/svg" p-id="8046" width="200" height="200">\n <path\n d="M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h0.1c3 0 4.4-3.6 2.2-5.6-30.8-27.6-65.6-49.7-103.7-65.8-0.4-0.2-0.8-0.3-1.2-0.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-0.4 0.2-0.8 0.3-1.2 0.5-44.7 18.9-84.8 46-119.3 80.6-34.5 34.5-61.5 74.7-80.4 119.5C147.9 794.5 138 841 137 888.8c-0.1 4.5 3.5 8.2 8 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1 2.5 1.5 5.5 1.7 8.1 0.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4-32.4-32.5-50.3-75.7-50.3-121.6 0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4c32.4 32.5 50.3 75.7 50.3 121.6 0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"\n p-id="8047"></path>\n</svg>'
5
- };
6
- export {
7
- addUser as default
8
- };
@@ -1,8 +0,0 @@
1
- const book = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667110830636" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8464" width="200" height="200"><path d="M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32z m-260 72h96v209.9L621.5 312 572 347.4V136z m220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3 5.1 7.2 15.1 8.9 22.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z" p-id="8465"></path></svg>'
5
- };
6
- export {
7
- book as default
8
- };
@@ -1,3 +0,0 @@
1
- export declare const TIME_OUT = 1000;
2
- export declare const PORT = 5173;
3
- export declare const DEV_SERVER = "http://localhost:5173/";
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,8 +0,0 @@
1
- const checkCircleFill = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667965185400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8572" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m193.5 301.7l-210.6 292c-12.7 17.7-39 17.7-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" p-id="8573"></path></svg>'
5
- };
6
- export {
7
- checkCircleFill as default
8
- };
@@ -1,8 +0,0 @@
1
- const checkCircle = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667483538687" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8683" width="200" height="200"><path d="M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8c12.7 17.7 39 17.7 51.7 0l210.6-292c3.9-5.3 0.1-12.7-6.4-12.7z" p-id="8684"></path><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" p-id="8685"></path></svg>'
5
- };
6
- export {
7
- checkCircle as default
8
- };
@@ -1,8 +0,0 @@
1
- const close = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1688378016663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2608" width="128" height="128"><path d="M568 515.008l254.016-255.008q12-11.008 12-27.488t-11.488-28-28-11.488-27.488 12l-255.008 254.016-255.008-254.016q-11.008-12-27.488-12t-28 11.488-11.488 28 12 27.488l254.016 255.008-254.016 255.008q-12 11.008-12 27.488t11.488 28 28 11.488 27.488-12l255.008-255.008 255.008 255.008q11.008 12 27.488 12t28-11.488 11.488-28-12-27.488z" p-id="2609" ></path></svg>'
5
- };
6
- export {
7
- close as default
8
- };
@@ -1,8 +0,0 @@
1
- const closeCircle = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667483596224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8848" width="200" height="200"><path d="M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" p-id="8849"></path><path d="M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" p-id="8850"></path></svg>'
5
- };
6
- export {
7
- closeCircle as default
8
- };
@@ -1,8 +0,0 @@
1
- const closeCircleFill = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667965220951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8711" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m165.4 618.2l-66-0.3L512 563.4l-99.3 118.4-66.1 0.3c-4.4 0-8-3.5-8-8 0-1.9 0.7-3.7 1.9-5.2l130.1-155L340.5 359c-1.2-1.5-1.9-3.3-1.9-5.2 0-4.4 3.6-8 8-8l66.1 0.3L512 464.6l99.3-118.4 66-0.3c4.4 0 8 3.5 8 8 0 1.9-0.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" p-id="8712"></path></svg>'
5
- };
6
- export {
7
- closeCircleFill as default
8
- };
@@ -1,5 +0,0 @@
1
- export declare const PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
2
- export declare const PDF = "application/pdf";
3
- export declare const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
4
- export declare const XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
5
- export declare const XLS = "application/vnd.ms-excel";
@@ -1,4 +0,0 @@
1
- import "ranui/message";
2
- import "ranui/icon";
3
- declare const _default: Promise<void>;
4
- export default _default;
@@ -1,39 +0,0 @@
1
- import type { BaseReturn, RenderOptions } from '@/components/preview/types';
2
- export interface Viewport {
3
- width: number;
4
- height: number;
5
- viewBox: Array<number>;
6
- }
7
- export interface RenderContext {
8
- canvasContext: CanvasRenderingContext2D | null;
9
- transform: Array<number>;
10
- viewport: Viewport;
11
- }
12
- export interface PDFPageProxy {
13
- pageNumber: number;
14
- getViewport: ({ scale }: {
15
- scale: number;
16
- }) => Viewport;
17
- render: (options: RenderContext) => void;
18
- }
19
- export interface PDFDocumentProxy {
20
- numPages: number;
21
- getPage: (x: number) => Promise<PDFPageProxy>;
22
- }
23
- export declare class PdfPreview {
24
- private pdfDoc;
25
- pageNumber: number;
26
- total: number;
27
- dom: HTMLElement;
28
- pdf: string | ArrayBuffer;
29
- onError: ((msg: BaseReturn) => void) | undefined;
30
- onLoad: ((msg: BaseReturn) => void) | undefined;
31
- constructor(pdf: string | ArrayBuffer, options: RenderOptions);
32
- private getPdfPage;
33
- pdfPreview: () => Promise<BaseReturn>;
34
- showTotalPage: () => Promise<void>;
35
- changePage: (num: number) => number;
36
- prevPage: () => Promise<number>;
37
- nextPage: () => Promise<number>;
38
- }
39
- export declare const renderPdf: (file: File, options: RenderOptions) => Promise<void>;
@@ -1,12 +0,0 @@
1
- export interface BaseReturn<T = unknown> {
2
- success: boolean;
3
- data?: T;
4
- message?: string;
5
- }
6
- export interface RenderOptions {
7
- dom?: HTMLElement;
8
- onError?: (msg?: BaseReturn) => void;
9
- onLoad?: (msg?: BaseReturn) => void;
10
- iframe?: HTMLIFrameElement;
11
- baseUrl?: string;
12
- }
@@ -1,8 +0,0 @@
1
- const eye = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1665473580103" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7625" width="200" height="200">\n <path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3-7.7 16.2-7.7 35.2 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766z" p-id="7626"></path>\n <path d="M508 336c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176z m0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" p-id="7627"></path>\n</svg>'
5
- };
6
- export {
7
- eye as default
8
- };
@@ -1,8 +0,0 @@
1
- const eyeClose = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1665473540543" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7485" width="200" height="200">\n <path d="M942.3 486.4l-0.1-0.1-0.1-0.1c-36.4-76.7-80-138.7-130.7-186L760.7 351c43.7 40.2 81.5 93.7 114.1 160.9C791.5 684.2 673.4 766 512 766c-51.3 0-98.3-8.3-141.2-25.1l-54.7 54.7C374.6 823.8 439.8 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0.1-51.3zM878.3 154.2l-42.4-42.4c-3.1-3.1-8.2-3.1-11.3 0L707.8 228.5C649.4 200.2 584.2 186 512 186c-192.2 0-335.4 100.5-430.2 300.3v0.1c-7.7 16.2-7.7 35.2 0 51.5 36.4 76.7 80 138.7 130.7 186.1L111.8 824.5c-3.1 3.1-3.1 8.2 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0l712.8-712.8c3.1-3 3.1-8.1 0-11.2zM398.9 537.4c-1.9-8.2-2.9-16.7-2.9-25.4 0-61.9 50.1-112 112-112 8.7 0 17.3 1 25.4 2.9L398.9 537.4z m184.5-184.5C560.5 342.1 535 336 508 336c-97.2 0-176 78.8-176 176 0 27 6.1 52.5 16.9 75.4L263.3 673c-43.7-40.2-81.5-93.7-114.1-160.9C232.6 339.8 350.7 258 512 258c51.3 0 98.3 8.3 141.2 25.1l-69.8 69.8z" p-id="7486"></path>\n <path d="M508 624c-6.4 0-12.7-0.5-18.8-1.6l-51.1 51.1c21.4 9.3 45.1 14.4 69.9 14.4 97.2 0 176-78.8 176-176 0-24.8-5.1-48.5-14.4-69.9l-51.1 51.1c1 6.1 1.6 12.4 1.6 18.8C620 573.9 569.9 624 508 624z" p-id="7487"></path>\n</svg>'
5
- };
6
- export {
7
- eyeClose as default
8
- };
@@ -1,8 +0,0 @@
1
- const home = {
2
- "success": true,
3
- "_identification": true,
4
- "data": '<svg t="1667486325771" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8988" width="200" height="200"><path d="M946.5 505L560.1 118.8l-25.9-25.9c-12.3-12.2-32.1-12.2-44.4 0L77.5 505c-12.3 12.3-18.9 28.6-18.8 46 0.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8 12.1-12.1 18.7-28.2 18.7-45.3 0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204z m217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z" p-id="8989"></path></svg>'
5
- };
6
- export {
7
- home as default
8
- };