@filumo/vue2 0.0.0-stage → 0.1.1
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/LICENSE +20 -0
- package/README.md +153 -2
- package/README.zh-CN.md +160 -0
- package/dist/DocumentViewer.d.ts +19 -0
- package/dist/build-manifest.json +39 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +249 -0
- package/dist/styles.css +1 -0
- package/dist/toolbarIcons.d.ts +21 -0
- package/package.json +69 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gyxing
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @filumo/vue2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p>
|
|
4
|
+
<strong>English</strong> | <a href="https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/README.zh-CN.md">简体中文</a> ·
|
|
5
|
+
<a href="https://gyxing.github.io/filumo-viewer/playground" target="_blank" rel="noopener noreferrer">Live demo</a> ·
|
|
6
|
+
<a href="https://gyxing.github.io/filumo-viewer/docs" target="_blank" rel="noopener noreferrer">Integration docs</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
Vue 2 document viewer adapter for Filumo, with Options API integration, plugin-based formats and managed lifecycle cleanup.
|
|
10
|
+
|
|
11
|
+
A Filumo adapter for Vue 2.6/2.7 using Options API and native render functions, with the same format plugins as Vue 3 and React.
|
|
12
|
+
|
|
13
|
+
This documentation covers **0.1.1**. The commands below describe consumption after publication to npm. When using this source workspace, build the packages first as described in the integration guide.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- Uses Vue.extend. The component name is FilumoDocumentViewer and the export is DocumentViewer.
|
|
18
|
+
- Stores runtime viewers in an internal WeakMap outside Vue 2 deep reactivity. Destruction releases resources.
|
|
19
|
+
- Supports keep-alive activation/deactivation. Freeze the host plugin array or keep it outside deep reactivity.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm add @filumo/vue2 @filumo/office
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or with npm:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm install @filumo/vue2 @filumo/office
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use the example in a host project already configured for the corresponding framework. Supported framework versions are listed below.
|
|
34
|
+
|
|
35
|
+
## Minimal integration
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<script>
|
|
39
|
+
import { DocumentViewer } from '@filumo/vue2';
|
|
40
|
+
import { office } from '@filumo/office';
|
|
41
|
+
|
|
42
|
+
const plugins = Object.freeze([office()]);
|
|
43
|
+
export default {
|
|
44
|
+
components: { DocumentViewer },
|
|
45
|
+
data() {
|
|
46
|
+
return { file: undefined, plugins, options: { height: 640 } };
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
chooseFile(event) {
|
|
50
|
+
this.file = event.target.files && event.target.files[0];
|
|
51
|
+
},
|
|
52
|
+
onError(error) {
|
|
53
|
+
console.error(error);
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<section>
|
|
61
|
+
<input type="file" @change="chooseFile" />
|
|
62
|
+
<DocumentViewer
|
|
63
|
+
:source="file"
|
|
64
|
+
:plugins="plugins"
|
|
65
|
+
:options="options"
|
|
66
|
+
@error="onError"
|
|
67
|
+
/>
|
|
68
|
+
</section>
|
|
69
|
+
</template>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Common options
|
|
73
|
+
|
|
74
|
+
| Option | Default | Description |
|
|
75
|
+
| ---------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------- |
|
|
76
|
+
| `source` | undefined | Browser document input; changes open a new file. |
|
|
77
|
+
| `plugins` | Required | Format plugin array; Object.freeze is recommended to keep it stable. |
|
|
78
|
+
| `options` | Default shell configuration | ViewerConfiguration including height, theme, locale and resource policy. |
|
|
79
|
+
| `ready / error` | Events | Session ready or loading error. |
|
|
80
|
+
| `stateChange / capabilitiesChange` | Events | State and toolbar capability changes. |
|
|
81
|
+
| `Component ref` | Optional | Exposes open, update, setActive, getSnapshot, getCapabilities, destroy and other methods. |
|
|
82
|
+
|
|
83
|
+
See the public declarations and source for complete types. Features cannot be enabled by guessing undocumented option names.
|
|
84
|
+
|
|
85
|
+
## Lifecycle and Vue versions
|
|
86
|
+
|
|
87
|
+
The peer dependency is vue ^2.6.14 || ^2.7.16. The component creates the viewer on mounted and destroys it on beforeDestroy. Keep-alive deactivation/reactivation reuses the session. Wait for mounting before calling public methods through $refs.
|
|
88
|
+
|
|
89
|
+
The example freezes the plugin array to avoid Vue 2 deep observation of descriptors that need no reactivity. Resources, Workers and handles are managed by the component and should not enter serializable host state. Mount the viewer on the client only.
|
|
90
|
+
|
|
91
|
+
## Format selection and styles
|
|
92
|
+
|
|
93
|
+
The example registers only Office. Full format support requires directly installing @filumo/viewer and passing standardPlugins. The Vue 2 package does not implicitly install React or provide editing.
|
|
94
|
+
|
|
95
|
+
DOM and format packages load styles by default. External mode imports @filumo/dom/styles.css and the actual format styles.css; Office image overlays also need Image CSS. Vue 2 has no separate styles.css. PDF uses matching bundled resources by default; only custom external deployment requires a resource directory.
|
|
96
|
+
|
|
97
|
+
## Inputs and runtime environment
|
|
98
|
+
|
|
99
|
+
String input represents a URL, not document content. Use File/Blob for inline text. Other sources include Uint8Array, URL objects with name/mimeType/request, and custom DocumentSource factories. Remote files and supporting resources must satisfy the host's networking, CORS and CSP configuration.
|
|
100
|
+
|
|
101
|
+
Packages are published as ESM with TypeScript declarations and no CommonJS require entry. Viewer mounting, image decoding and file selection run in the browser. Importing a lightweight entry does not enable server-side document rendering. Create instances in the client lifecycle and destroy them when no longer needed.
|
|
102
|
+
|
|
103
|
+
## Public entries
|
|
104
|
+
|
|
105
|
+
| Public entry | Purpose |
|
|
106
|
+
| -------------- | -------------------------------------------------------------------------------------- |
|
|
107
|
+
| `@filumo/vue2` | DocumentViewer and types including DocumentInput, ViewerHandle and ViewerConfiguration |
|
|
108
|
+
|
|
109
|
+
Unlisted internal paths are not stable public APIs. Standalone format packages do not depend on React/Vue adapters; install only the formats and adapter your host needs.
|
|
110
|
+
|
|
111
|
+
## Filumo packages
|
|
112
|
+
|
|
113
|
+
The current package is bold. Each package is published independently. Package names link to npm, and source links point to this repository.
|
|
114
|
+
|
|
115
|
+
<!-- filumo-packages:start -->
|
|
116
|
+
|
|
117
|
+
| Package (npm) | Purpose | Source documentation |
|
|
118
|
+
| ------------------------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
119
|
+
| [@filumo/core](https://www.npmjs.com/package/@filumo/core) | Headless sources, plugin contracts, sessions and shared text utilities | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/core/README.md) |
|
|
120
|
+
| [@filumo/dom](https://www.npmjs.com/package/@filumo/dom) | Native DOM viewer, toolbars, source views, outlines and shared UI | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/dom/README.md) |
|
|
121
|
+
| [@filumo/viewer](https://www.npmjs.com/package/@filumo/viewer) | Standard preset and factories for ten format plugins | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/viewer/README.md) |
|
|
122
|
+
| [@filumo/office](https://www.npmjs.com/package/@filumo/office) | Word, Excel, PowerPoint and supported legacy formats | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/office/README.md) |
|
|
123
|
+
| [@filumo/pdf](https://www.npmjs.com/package/@filumo/pdf) | Continuous PDF reading, outlines, thumbnails and search | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/pdf/README.md) |
|
|
124
|
+
| [@filumo/image](https://www.npmjs.com/package/@filumo/image) | Image preview, zoom, rotation, panning and shared overlays | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/image/README.md) |
|
|
125
|
+
| [@filumo/text](https://www.npmjs.com/package/@filumo/text) | Plain text, logs, encoding detection and readable-text fallback | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/text/README.md) |
|
|
126
|
+
| [@filumo/json](https://www.npmjs.com/package/@filumo/json) | JSON / JSONC / JSONL / NDJSON source and structure views | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/json/README.md) |
|
|
127
|
+
| [@filumo/markdown](https://www.npmjs.com/package/@filumo/markdown) | Markdown reading, outlines, GFM layout and code highlighting | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/markdown/README.md) |
|
|
128
|
+
| [@filumo/csv](https://www.npmjs.com/package/@filumo/csv) | CSV / TSV read-only grids, virtual scrolling and search | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/csv/README.md) |
|
|
129
|
+
| [@filumo/xml](https://www.npmjs.com/package/@filumo/xml) | XML source, namespace-aware structure trees and node navigation | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/xml/README.md) |
|
|
130
|
+
| [@filumo/code](https://www.npmjs.com/package/@filumo/code) | Read-only highlighting for code, scripts, configuration and stylesheets | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/code/README.md) |
|
|
131
|
+
| [@filumo/react](https://www.npmjs.com/package/@filumo/react) | React 18/19 adapter | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/react/README.md) |
|
|
132
|
+
| [@filumo/vue](https://www.npmjs.com/package/@filumo/vue) | Vue 3 (>=3.3 <4) adapter | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue/README.md) |
|
|
133
|
+
| **[@filumo/vue2](https://www.npmjs.com/package/@filumo/vue2)** | Vue 2 (^2.6.14 or ^2.7.16) adapter | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/README.md) |
|
|
134
|
+
| [@filumo/archive](https://www.npmjs.com/package/@filumo/archive) | Archive directories, on-demand extraction and child previews | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/archive/README.md) |
|
|
135
|
+
|
|
136
|
+
<!-- filumo-packages:end -->
|
|
137
|
+
|
|
138
|
+
## Documentation and feedback
|
|
139
|
+
|
|
140
|
+
- [Source and complete types](https://github.com/gyxing/filumo-viewer/tree/master/packages/vue2/src)
|
|
141
|
+
- [Framework integration](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/preview-integration.md)
|
|
142
|
+
- [Format capabilities and limits](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/compatibility.md)
|
|
143
|
+
- [Text-based formats](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/text-formats.md)
|
|
144
|
+
- [Images and PDF deployment](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/image-pdf.md)
|
|
145
|
+
- [Standalone framework examples](https://github.com/gyxing/filumo-viewer/tree/master/examples)
|
|
146
|
+
- [Changelog](https://github.com/gyxing/filumo-viewer/blob/master/CHANGELOG.md)
|
|
147
|
+
- [Report an issue](https://github.com/gyxing/filumo-viewer/issues)
|
|
148
|
+
- [MIT license](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/LICENSE)
|
|
149
|
+
|
|
150
|
+
## Custom toolbar icons
|
|
151
|
+
|
|
152
|
+
Import ToolbarAction from @filumo/vue2 and use icon: (h, context) => h(MyIcon), or pass a native ToolbarIcon object. Each placement creates an independent VNode in a lightweight child component linked to the viewer parent, retaining host injections and reactive render dependencies. Removal and teardown destroy the child and release its DOM. undefined keeps the default, null suppresses the icon. ToolbarIconRenderer and framework-aware configuration/update types are exported. getCapabilities() exposes normalized DOM capabilities.
|
|
153
|
+
|
|
154
|
+
See the Chinese README and exported types for full usage examples.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# @filumo/vue2
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/README.md">English</a> | <strong>简体中文</strong> ·
|
|
5
|
+
<a href="https://gyxing.github.io/filumo-viewer/playground" target="_blank" rel="noopener noreferrer">在线示例</a> ·
|
|
6
|
+
<a href="https://gyxing.github.io/filumo-viewer/docs" target="_blank" rel="noopener noreferrer">对接文档</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
Vue 2.6/2.7 的 Filumo 适配组件,采用 Options API 和原生渲染函数,使用与 Vue 3、React 相同的格式插件。
|
|
10
|
+
|
|
11
|
+
本文档对应 **0.1.1**。以下命令展示 npm 发布后的消费方式;从当前源码工作区使用时,请先按接入指南构建各包。
|
|
12
|
+
|
|
13
|
+
## 主要能力
|
|
14
|
+
|
|
15
|
+
- 使用 Vue.extend,组件名为 FilumoDocumentViewer,导出名为 DocumentViewer。
|
|
16
|
+
- 运行时查看器保存在内部 WeakMap,不进入 Vue 2 深度响应式;组件销毁时释放资源。
|
|
17
|
+
- 支持 keep-alive 激活和停用;宿主中的插件数组也建议冻结或保持非深度响应式。
|
|
18
|
+
|
|
19
|
+
## 安装
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
pnpm add @filumo/vue2 @filumo/office
|
|
23
|
+
# 或使用 npm
|
|
24
|
+
npm install @filumo/vue2 @filumo/office
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
示例放在已配置相应框架的宿主项目中,框架版本范围见下文。
|
|
28
|
+
|
|
29
|
+
## 最小接入
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<script>
|
|
33
|
+
import { DocumentViewer } from '@filumo/vue2';
|
|
34
|
+
import { office } from '@filumo/office';
|
|
35
|
+
|
|
36
|
+
const plugins = Object.freeze([office()]);
|
|
37
|
+
export default {
|
|
38
|
+
components: { DocumentViewer },
|
|
39
|
+
data() {
|
|
40
|
+
return { file: undefined, plugins, options: { height: 640 } };
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
chooseFile(event) {
|
|
44
|
+
this.file = event.target.files && event.target.files[0];
|
|
45
|
+
},
|
|
46
|
+
onError(error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<section>
|
|
55
|
+
<input type="file" @change="chooseFile" />
|
|
56
|
+
<DocumentViewer
|
|
57
|
+
:source="file"
|
|
58
|
+
:plugins="plugins"
|
|
59
|
+
:options="options"
|
|
60
|
+
@error="onError"
|
|
61
|
+
/>
|
|
62
|
+
</section>
|
|
63
|
+
</template>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 常用配置
|
|
67
|
+
|
|
68
|
+
| 配置项 | 默认值 | 说明 |
|
|
69
|
+
| ---------------------------------- | ------------ | ------------------------------------------------------------------------------ |
|
|
70
|
+
| `source` | undefined | 浏览器文档输入,变化后打开新文件。 |
|
|
71
|
+
| `plugins` | 必填 | 格式插件数组,建议使用 Object.freeze 保持稳定。 |
|
|
72
|
+
| `options` | 默认外壳配置 | ViewerConfiguration,含高度、主题、语言和资源策略。 |
|
|
73
|
+
| `ready / error` | 事件 | 会话就绪或加载错误。 |
|
|
74
|
+
| `stateChange / capabilitiesChange` | 事件 | 状态及工具栏能力变化。 |
|
|
75
|
+
| `组件 ref` | 可选 | 可调用 open、update、setActive、getSnapshot、getCapabilities、destroy 等方法。 |
|
|
76
|
+
|
|
77
|
+
完整类型以公开声明与源码为准;没有列出的功能不能通过猜测选项名开启。
|
|
78
|
+
|
|
79
|
+
## 生命周期与框架版本
|
|
80
|
+
|
|
81
|
+
peerDependencies 为 vue ^2.6.14 || ^2.7.16。组件 mounted 时创建,beforeDestroy 时销毁;keep-alive 停用与恢复使用同一会话。通过 $refs 调用公开方法时等待挂载。
|
|
82
|
+
|
|
83
|
+
示例冻结插件数组,避免 Vue 2 深度观察不需响应式的描述符。资源、Worker 和句柄由组件管理,不应放入需序列化的宿主状态。查看器只能在客户端挂载。
|
|
84
|
+
|
|
85
|
+
## 格式选择与样式
|
|
86
|
+
|
|
87
|
+
示例只注册 Office;完整格式支持需直接安装 @filumo/viewer 并传入 standardPlugins。Vue 2 包不隐式安装 React,也不提供编辑功能。
|
|
88
|
+
|
|
89
|
+
默认样式由 DOM 和格式加载;external 模式导入 @filumo/dom/styles.css 及实际格式 styles.css,Office 图片弹层另需 Image CSS。Vue 2 适配包没有独立 styles.css。PDF 默认使用包内同版资源,只有自定义外部部署才需要提供资源目录。
|
|
90
|
+
|
|
91
|
+
## 输入与运行环境
|
|
92
|
+
|
|
93
|
+
字符串输入表示 URL,不表示文件正文;直接文本内容请使用 File/Blob。支持的来源还包括 Uint8Array、带 name/mimeType/request 的 URL 对象和自定义 DocumentSource 工厂。远程文件和辅助资源需要满足宿主的网络、CORS 与 CSP 配置。
|
|
94
|
+
|
|
95
|
+
包以 ESM 发布,包含 TypeScript 声明;不提供 CommonJS require 入口。查看器挂载、图片解码和文件选择在浏览器执行;导入轻量入口不等于支持在服务端渲染文件。宿主应在客户端生命周期创建实例,并在不再使用时销毁。
|
|
96
|
+
|
|
97
|
+
## 公开入口
|
|
98
|
+
|
|
99
|
+
| 公开入口 | 用途 |
|
|
100
|
+
| -------------- | --------------------------------------------------------------------------------- |
|
|
101
|
+
| `@filumo/vue2` | DocumentViewer 组件,以及 DocumentInput、ViewerHandle、ViewerConfiguration 等类型 |
|
|
102
|
+
|
|
103
|
+
未列出的包内路径不是稳定公共 API。独立格式不依赖 React/Vue 适配层,宿主只安装实际需要的格式和适配包。
|
|
104
|
+
|
|
105
|
+
## Filumo 包清单
|
|
106
|
+
|
|
107
|
+
当前包已加粗。每个包独立发布,包名链接到 npm,源码链接指向项目实际仓库。
|
|
108
|
+
|
|
109
|
+
<!-- filumo-packages:start -->
|
|
110
|
+
|
|
111
|
+
| 包(点击进入 npm) | 用途 | 源码说明 |
|
|
112
|
+
| ------------------------------------------------------------------ | -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
113
|
+
| [@filumo/core](https://www.npmjs.com/package/@filumo/core) | 无 UI 的来源、插件协议、会话和公共文本处理 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/core/README.zh-CN.md) |
|
|
114
|
+
| [@filumo/dom](https://www.npmjs.com/package/@filumo/dom) | 原生 DOM 查看器、工具栏、原文、大纲和共享 UI | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/dom/README.zh-CN.md) |
|
|
115
|
+
| [@filumo/viewer](https://www.npmjs.com/package/@filumo/viewer) | 十类格式插件的标准预设与工厂聚合 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/viewer/README.zh-CN.md) |
|
|
116
|
+
| [@filumo/office](https://www.npmjs.com/package/@filumo/office) | Word、Excel、PowerPoint 与受支持的旧格式 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/office/README.zh-CN.md) |
|
|
117
|
+
| [@filumo/pdf](https://www.npmjs.com/package/@filumo/pdf) | PDF 连续阅读、大纲、缩略图和查找 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/pdf/README.zh-CN.md) |
|
|
118
|
+
| [@filumo/image](https://www.npmjs.com/package/@filumo/image) | 图片预览、缩放、旋转、拖动及共享弹层 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/image/README.zh-CN.md) |
|
|
119
|
+
| [@filumo/text](https://www.npmjs.com/package/@filumo/text) | 纯文本、日志、编码识别与可读文本兜底 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/text/README.zh-CN.md) |
|
|
120
|
+
| [@filumo/json](https://www.npmjs.com/package/@filumo/json) | JSON / JSONC / JSONL / NDJSON 原文与结构 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/json/README.zh-CN.md) |
|
|
121
|
+
| [@filumo/markdown](https://www.npmjs.com/package/@filumo/markdown) | Markdown 阅读、大纲、GFM 排版与代码高亮 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/markdown/README.zh-CN.md) |
|
|
122
|
+
| [@filumo/csv](https://www.npmjs.com/package/@filumo/csv) | CSV / TSV 只读表格、虚拟滚动和查找 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/csv/README.zh-CN.md) |
|
|
123
|
+
| [@filumo/xml](https://www.npmjs.com/package/@filumo/xml) | XML 原文、命名空间结构树和节点定位 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/xml/README.zh-CN.md) |
|
|
124
|
+
| [@filumo/code](https://www.npmjs.com/package/@filumo/code) | 代码、脚本、配置及样式源码的只读高亮 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/code/README.zh-CN.md) |
|
|
125
|
+
| [@filumo/react](https://www.npmjs.com/package/@filumo/react) | React 18/19 适配组件 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/react/README.zh-CN.md) |
|
|
126
|
+
| [@filumo/vue](https://www.npmjs.com/package/@filumo/vue) | Vue 3(>=3.3 <4)适配组件 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue/README.zh-CN.md) |
|
|
127
|
+
| **[@filumo/vue2](https://www.npmjs.com/package/@filumo/vue2)** | Vue 2(^2.6.14 或 ^2.7.16)适配组件 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/README.zh-CN.md) |
|
|
128
|
+
| [@filumo/archive](https://www.npmjs.com/package/@filumo/archive) | 压缩包目录、按需提取与包内预览 | [README](https://github.com/gyxing/filumo-viewer/blob/master/packages/archive/README.zh-CN.md) |
|
|
129
|
+
|
|
130
|
+
<!-- filumo-packages:end -->
|
|
131
|
+
|
|
132
|
+
## 文档与反馈
|
|
133
|
+
|
|
134
|
+
- [本包源码与完整类型](https://github.com/gyxing/filumo-viewer/tree/master/packages/vue2/src)
|
|
135
|
+
- [框架接入指南](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/preview-integration.zh-CN.md)
|
|
136
|
+
- [格式能力与限制](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/compatibility.zh-CN.md)
|
|
137
|
+
- [文本类格式指南](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/text-formats.zh-CN.md)
|
|
138
|
+
- [图片与 PDF 部署](https://github.com/gyxing/filumo-viewer/blob/master/apps/docs/docs/guides/image-pdf.zh-CN.md)
|
|
139
|
+
- [独立框架示例](https://github.com/gyxing/filumo-viewer/tree/master/examples)
|
|
140
|
+
- [项目变更记录](https://github.com/gyxing/filumo-viewer/blob/master/CHANGELOG.md)
|
|
141
|
+
- [问题反馈](https://github.com/gyxing/filumo-viewer/issues)
|
|
142
|
+
- [MIT 许可证](https://github.com/gyxing/filumo-viewer/blob/master/packages/vue2/LICENSE)
|
|
143
|
+
|
|
144
|
+
## 自定义工具栏图标
|
|
145
|
+
|
|
146
|
+
从本包导入 `ToolbarAction`,`icon` 使用 `(h, context) => VNode | null` 渲染函数,也支持原生 `ToolbarIcon`。每个位置独立创建 VNode。
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
const actions = [
|
|
150
|
+
{
|
|
151
|
+
id: 'host.retry',
|
|
152
|
+
label: '重新生成',
|
|
153
|
+
kind: 'action',
|
|
154
|
+
icon: (h) => h('i', { class: 'el-icon-refresh' }),
|
|
155
|
+
run: retry,
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
将数组放入 `options.toolbarActions`。图标由关联查看器父实例的轻量子组件渲染,继承宿主注入,响应式依赖在子组件渲染时收集。移除与销毁执行 `$destroy()` 并清理节点。`undefined` 沿用默认图标,`null` 隐藏。公开 `ToolbarIconRenderer` 及框架侧配置、update 类型,`getCapabilities()` 返回归一化后的 DOM 能力。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DocumentInput, DocumentOpenOptions } from '@filumo/core';
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
import type { ViewOptions, ViewerConfiguration } from './toolbarIcons';
|
|
4
|
+
/** Vue 2 使用 Options API 适配同一 DOM 查看器,兼容 2.6/2.7。 */
|
|
5
|
+
export declare const DocumentViewer: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, unknown, {
|
|
6
|
+
mountViewer(): Promise<void>;
|
|
7
|
+
open(input: DocumentInput, selection?: DocumentOpenOptions): Promise<void>;
|
|
8
|
+
update(options: ViewOptions): void;
|
|
9
|
+
getSnapshot(): import("@filumo/core").ControllerSnapshot;
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
getCapabilities(): import("@filumo/dom").ViewerCapabilities;
|
|
12
|
+
subscribeCapabilities(listener: () => void): () => void;
|
|
13
|
+
setActive(active: boolean): void;
|
|
14
|
+
destroy(): Promise<void>;
|
|
15
|
+
}, unknown, {
|
|
16
|
+
source: DocumentInput;
|
|
17
|
+
plugins: unknown[];
|
|
18
|
+
options: ViewerConfiguration;
|
|
19
|
+
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"package": "@filumo/vue2",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"outputs": [
|
|
6
|
+
{
|
|
7
|
+
"file": "index.js",
|
|
8
|
+
"entryPoint": "src/index.ts",
|
|
9
|
+
"inputs": [
|
|
10
|
+
"src/DocumentViewer.ts",
|
|
11
|
+
"src/toolbarIcons.ts"
|
|
12
|
+
],
|
|
13
|
+
"imports": [
|
|
14
|
+
{
|
|
15
|
+
"path": "@filumo/core",
|
|
16
|
+
"kind": "import-statement",
|
|
17
|
+
"external": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "@filumo/dom",
|
|
21
|
+
"kind": "import-statement",
|
|
22
|
+
"external": true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "vue",
|
|
26
|
+
"kind": "import-statement",
|
|
27
|
+
"external": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "vue",
|
|
31
|
+
"kind": "import-statement",
|
|
32
|
+
"external": true
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"roles": {},
|
|
38
|
+
"styleCount": 0
|
|
39
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { DocumentInput } from '@filumo/core';
|
|
2
|
+
export type { ToolbarActionState, ToolbarIcon, ToolbarIconContext, ToolbarIconInstance, ViewerCapabilities, ViewerPlugin, } from '@filumo/dom';
|
|
3
|
+
export { DocumentViewer } from './DocumentViewer';
|
|
4
|
+
export type { ToolbarAction, ToolbarIconRenderer, ViewOptions, ViewerConfiguration, ViewerHandle, ViewerOptions, } from './toolbarIcons';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// packages/vue2/src/DocumentViewer.ts
|
|
2
|
+
import { notify } from "@filumo/core";
|
|
3
|
+
import { createViewer } from "@filumo/dom";
|
|
4
|
+
import Vue2 from "vue";
|
|
5
|
+
|
|
6
|
+
// packages/vue2/src/toolbarIcons.ts
|
|
7
|
+
import Vue from "vue";
|
|
8
|
+
function createToolbarIcons(owner) {
|
|
9
|
+
const records = /* @__PURE__ */ new Map();
|
|
10
|
+
const children = /* @__PURE__ */ new Set();
|
|
11
|
+
const convert = (options) => {
|
|
12
|
+
if (options.toolbarActions === void 0)
|
|
13
|
+
return options;
|
|
14
|
+
const wanted = /* @__PURE__ */ new Set();
|
|
15
|
+
const toolbarActions = options.toolbarActions.map(
|
|
16
|
+
(action) => {
|
|
17
|
+
if (typeof action.icon !== "function")
|
|
18
|
+
return { ...action, icon: action.icon };
|
|
19
|
+
wanted.add(action.id);
|
|
20
|
+
let record = records.get(action.id);
|
|
21
|
+
if (!record) {
|
|
22
|
+
const created = {
|
|
23
|
+
render: action.icon,
|
|
24
|
+
children: /* @__PURE__ */ new Set(),
|
|
25
|
+
icon: {
|
|
26
|
+
mount(container, context) {
|
|
27
|
+
let current = context;
|
|
28
|
+
const child = new Vue({
|
|
29
|
+
parent: owner,
|
|
30
|
+
render: (h) => created.render(h, current) ?? h("span")
|
|
31
|
+
});
|
|
32
|
+
try {
|
|
33
|
+
child.$mount();
|
|
34
|
+
container.appendChild(child.$el);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
child.$destroy();
|
|
37
|
+
child.$el?.parentNode?.removeChild(child.$el);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
children.add(child);
|
|
41
|
+
created.children.add(child);
|
|
42
|
+
return {
|
|
43
|
+
update(next) {
|
|
44
|
+
current = next;
|
|
45
|
+
child.$forceUpdate();
|
|
46
|
+
},
|
|
47
|
+
dispose() {
|
|
48
|
+
created.children.delete(child);
|
|
49
|
+
if (children.delete(child))
|
|
50
|
+
child.$destroy();
|
|
51
|
+
child.$el.parentNode?.removeChild(child.$el);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
records.set(action.id, created);
|
|
58
|
+
record = created;
|
|
59
|
+
} else if (record.render !== action.icon) {
|
|
60
|
+
record.render = action.icon;
|
|
61
|
+
for (const child of record.children)
|
|
62
|
+
child.$forceUpdate();
|
|
63
|
+
}
|
|
64
|
+
return { ...action, icon: record.icon };
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
for (const id of records.keys())
|
|
68
|
+
if (!wanted.has(id))
|
|
69
|
+
records.delete(id);
|
|
70
|
+
return { ...options, toolbarActions };
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
convert,
|
|
74
|
+
dispose() {
|
|
75
|
+
for (const child of children) {
|
|
76
|
+
child.$destroy();
|
|
77
|
+
child.$el.parentNode?.removeChild(child.$el);
|
|
78
|
+
}
|
|
79
|
+
children.clear();
|
|
80
|
+
records.clear();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// packages/vue2/src/DocumentViewer.ts
|
|
86
|
+
var states = /* @__PURE__ */ new WeakMap();
|
|
87
|
+
function getState(instance) {
|
|
88
|
+
let state = states.get(instance);
|
|
89
|
+
if (!state) {
|
|
90
|
+
state = {
|
|
91
|
+
generation: 0,
|
|
92
|
+
closed: false,
|
|
93
|
+
active: true,
|
|
94
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
95
|
+
capabilityListeners: /* @__PURE__ */ new Set(),
|
|
96
|
+
icons: createToolbarIcons(instance)
|
|
97
|
+
};
|
|
98
|
+
states.set(instance, state);
|
|
99
|
+
}
|
|
100
|
+
return state;
|
|
101
|
+
}
|
|
102
|
+
var DocumentViewer = Vue2.extend({
|
|
103
|
+
name: "FilumoDocumentViewer",
|
|
104
|
+
props: {
|
|
105
|
+
source: {
|
|
106
|
+
type: null,
|
|
107
|
+
default: void 0
|
|
108
|
+
},
|
|
109
|
+
plugins: { type: Array, required: true },
|
|
110
|
+
options: {
|
|
111
|
+
type: Object,
|
|
112
|
+
default: () => ({})
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
mounted() {
|
|
116
|
+
void this.mountViewer().catch(
|
|
117
|
+
(error) => this.$emit("error", error)
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
activated() {
|
|
121
|
+
const state = getState(this);
|
|
122
|
+
state.active = true;
|
|
123
|
+
state.viewer?.setActive(true);
|
|
124
|
+
},
|
|
125
|
+
deactivated() {
|
|
126
|
+
const state = getState(this);
|
|
127
|
+
state.active = false;
|
|
128
|
+
state.viewer?.setActive(false);
|
|
129
|
+
},
|
|
130
|
+
beforeDestroy() {
|
|
131
|
+
const state = getState(this);
|
|
132
|
+
state.closed = true;
|
|
133
|
+
state.icons.dispose();
|
|
134
|
+
state.listeners.clear();
|
|
135
|
+
state.capabilityListeners.clear();
|
|
136
|
+
state.generation++;
|
|
137
|
+
void state.viewer?.destroy().catch((error) => this.$emit("error", error));
|
|
138
|
+
state.viewer = void 0;
|
|
139
|
+
},
|
|
140
|
+
watch: {
|
|
141
|
+
source(value) {
|
|
142
|
+
if (value !== void 0)
|
|
143
|
+
void getState(this).viewer?.open(value).catch(() => void 0);
|
|
144
|
+
},
|
|
145
|
+
plugins() {
|
|
146
|
+
if (this.$el)
|
|
147
|
+
void this.mountViewer().catch(
|
|
148
|
+
(error) => this.$emit("error", error)
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
options: {
|
|
152
|
+
deep: true,
|
|
153
|
+
handler(value) {
|
|
154
|
+
const state = getState(this);
|
|
155
|
+
const key = JSON.stringify([
|
|
156
|
+
value.pluginId,
|
|
157
|
+
value.resourcePolicy,
|
|
158
|
+
value.stylePolicy
|
|
159
|
+
]);
|
|
160
|
+
if (state.viewer && state.configurationKey !== key) {
|
|
161
|
+
void this.mountViewer().catch(
|
|
162
|
+
(error) => this.$emit("error", error)
|
|
163
|
+
);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
state.viewer?.update(state.icons.convert(value));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
methods: {
|
|
171
|
+
async mountViewer() {
|
|
172
|
+
const state = getState(this);
|
|
173
|
+
const task = ++state.generation;
|
|
174
|
+
const previous = state.viewer;
|
|
175
|
+
state.viewer = void 0;
|
|
176
|
+
await previous?.destroy();
|
|
177
|
+
if (state.closed || state.generation !== task)
|
|
178
|
+
return;
|
|
179
|
+
state.configurationKey = JSON.stringify([
|
|
180
|
+
this.options.pluginId,
|
|
181
|
+
this.options.resourcePolicy,
|
|
182
|
+
this.options.stylePolicy
|
|
183
|
+
]);
|
|
184
|
+
const viewer = createViewer(this.$el, {
|
|
185
|
+
...state.icons.convert(this.options),
|
|
186
|
+
plugins: this.plugins,
|
|
187
|
+
onReady: (session) => this.$emit("ready", session),
|
|
188
|
+
onCapabilitiesChange: (capabilities) => {
|
|
189
|
+
if (!state.closed) {
|
|
190
|
+
notify(state.capabilityListeners);
|
|
191
|
+
this.$emit("capabilitiesChange", capabilities);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
onError: (error) => this.$emit("error", error),
|
|
195
|
+
onStateChange: (snapshot) => {
|
|
196
|
+
if (!state.closed) {
|
|
197
|
+
notify(state.listeners);
|
|
198
|
+
this.$emit("stateChange", snapshot);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
state.viewer = viewer;
|
|
203
|
+
viewer.setActive(state.active);
|
|
204
|
+
if (this.source !== void 0)
|
|
205
|
+
await viewer.open(this.source).catch(() => void 0);
|
|
206
|
+
},
|
|
207
|
+
open(input, selection) {
|
|
208
|
+
return getState(this).viewer?.open(input, selection) ?? Promise.reject(new Error("\u67E5\u770B\u5668\u5C1A\u672A\u6302\u8F7D"));
|
|
209
|
+
},
|
|
210
|
+
update(options) {
|
|
211
|
+
const state = getState(this);
|
|
212
|
+
state.viewer?.update(state.icons.convert(options));
|
|
213
|
+
},
|
|
214
|
+
getSnapshot() {
|
|
215
|
+
return getState(this).viewer?.getSnapshot() ?? { status: "idle" };
|
|
216
|
+
},
|
|
217
|
+
subscribe(listener) {
|
|
218
|
+
const state = getState(this);
|
|
219
|
+
state.listeners.add(listener);
|
|
220
|
+
return () => {
|
|
221
|
+
state.listeners.delete(listener);
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
getCapabilities() {
|
|
225
|
+
return getState(this).viewer?.getCapabilities() ?? {};
|
|
226
|
+
},
|
|
227
|
+
subscribeCapabilities(listener) {
|
|
228
|
+
const state = getState(this);
|
|
229
|
+
state.capabilityListeners.add(listener);
|
|
230
|
+
return () => {
|
|
231
|
+
state.capabilityListeners.delete(listener);
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
setActive(active) {
|
|
235
|
+
const state = getState(this);
|
|
236
|
+
state.active = active;
|
|
237
|
+
state.viewer?.setActive(active);
|
|
238
|
+
},
|
|
239
|
+
destroy() {
|
|
240
|
+
return getState(this).viewer?.destroy() ?? Promise.resolve();
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
render(h) {
|
|
244
|
+
return h("div");
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
export {
|
|
248
|
+
DocumentViewer
|
|
249
|
+
};
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --filumo-style-vue2: 0.1.1; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CapabilityAction, ViewerConfiguration as DomConfiguration, ViewerHandle as DomHandle, ViewerOptions as DomOptions, ViewOptions as DomViewOptions, ToolbarIcon, ToolbarIconContext } from '@filumo/dom';
|
|
2
|
+
import type { CreateElement, VNode } from 'vue';
|
|
3
|
+
import Vue from 'vue';
|
|
4
|
+
/** Vue 2 每个位置独立调用渲染函数,支持组件、SVG 和图标字体。 */
|
|
5
|
+
export type ToolbarIconRenderer = (h: CreateElement, context: ToolbarIconContext) => VNode | null;
|
|
6
|
+
export type ToolbarAction = Omit<CapabilityAction, 'icon'> & {
|
|
7
|
+
icon?: ToolbarIconRenderer | ToolbarIcon | null;
|
|
8
|
+
};
|
|
9
|
+
export type ViewOptions = Omit<DomViewOptions, 'toolbarActions'> & {
|
|
10
|
+
toolbarActions?: readonly ToolbarAction[];
|
|
11
|
+
};
|
|
12
|
+
export type ViewerConfiguration = Omit<DomConfiguration, 'toolbarActions'> & ViewOptions;
|
|
13
|
+
export type ViewerOptions = Omit<DomOptions, 'toolbarActions'> & ViewOptions;
|
|
14
|
+
export type ViewerHandle = Omit<DomHandle, 'update'> & {
|
|
15
|
+
update(options: ViewOptions): void;
|
|
16
|
+
};
|
|
17
|
+
/** 子组件关联查看器实例,继承宿主注入并通过生命周期释放渲染资源。 */
|
|
18
|
+
export declare function createToolbarIcons(owner: Vue): {
|
|
19
|
+
convert: (options: ViewerConfiguration) => DomConfiguration;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filumo/vue2",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Vue 2 document viewer adapter for Filumo, with Options API integration, plugin-based formats and managed lifecycle cleanup.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"filumo",
|
|
7
|
+
"vue",
|
|
8
|
+
"vue2",
|
|
9
|
+
"vue2-component",
|
|
10
|
+
"vue-document-viewer",
|
|
11
|
+
"vue-file-viewer",
|
|
12
|
+
"vue-file-preview",
|
|
13
|
+
"document-viewer",
|
|
14
|
+
"file-preview",
|
|
15
|
+
"options-api",
|
|
16
|
+
"keep-alive",
|
|
17
|
+
"typescript",
|
|
18
|
+
"esm",
|
|
19
|
+
"plugin-system",
|
|
20
|
+
"lazy-loading",
|
|
21
|
+
"readonly",
|
|
22
|
+
"vue2文件预览",
|
|
23
|
+
"vue2文档预览"
|
|
24
|
+
],
|
|
25
|
+
"homepage": "https://github.com/gyxing/filumo-viewer/tree/master/packages/vue2#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/gyxing/filumo-viewer/issues"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/gyxing/filumo-viewer.git",
|
|
32
|
+
"directory": "packages/vue2"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": {
|
|
36
|
+
"name": "gyxing",
|
|
37
|
+
"url": "https://github.com/gyxing"
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": [
|
|
40
|
+
"**/styles/**",
|
|
41
|
+
"**/*.css"
|
|
42
|
+
],
|
|
43
|
+
"type": "module",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"default": "./dist/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json"
|
|
51
|
+
},
|
|
52
|
+
"module": "./dist/index.js",
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"README.md",
|
|
57
|
+
"README.zh-CN.md"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@filumo/dom": "^0.1.1",
|
|
61
|
+
"@filumo/core": "^0.1.1"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"vue": "2.7.16"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"vue": "^2.6.14 || ^2.7.16"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
}
|
|
6
72
|
}
|