docx-vue-viewer 0.4.0 → 0.4.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.
- package/README.md +54 -14
- package/dist/index.d.ts +40 -1306
- package/dist/index.js +142 -18994
- package/package.json +4 -12
package/README.md
CHANGED
|
@@ -1,31 +1,71 @@
|
|
|
1
1
|
# docx-vue-viewer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/docx-vue-viewer)
|
|
4
|
+
[](https://github.com/ChristopherVR/docx-viewer/blob/main/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/docx-vue-viewer)
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
> A browser Word document editor for Vue 3, using one shared editor and the canonical OOXML document engine.
|
|
8
|
+
|
|
9
|
+
[Live demo](https://christophervr.github.io/docx-viewer/demo/) | [npm](https://www.npmjs.com/package/docx-vue-viewer) | [Full docs](https://christophervr.github.io/docx-viewer/) | [Source](https://github.com/ChristopherVR/docx-viewer)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install docx-vue-viewer
|
|
7
15
|
```
|
|
8
16
|
|
|
17
|
+
Use the framework peers declared by this package: `vue` (`^3.5.0`). Existing framework apps normally already provide them.
|
|
18
|
+
|
|
19
|
+
The package bundles its editor UI and adapter. The core model and shared controls
|
|
20
|
+
are installed as regular registry dependencies and the model API is re-exported.
|
|
21
|
+
One viewer package is enough; no separate core install is required.
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
9
25
|
```vue
|
|
10
26
|
<script setup lang="ts">
|
|
11
|
-
import {
|
|
12
|
-
import { createDocument } from 'docx-
|
|
13
|
-
import { WordEditor } from 'docx-vue-viewer';
|
|
27
|
+
import { shallowRef } from 'vue';
|
|
28
|
+
import { createDocument, WordEditor } from 'docx-vue-viewer';
|
|
14
29
|
|
|
15
|
-
const model =
|
|
30
|
+
const model = shallowRef(createDocument());
|
|
16
31
|
</script>
|
|
17
32
|
<template>
|
|
18
33
|
<WordEditor :document-model="model" @document-change="model = $event" />
|
|
19
34
|
</template>
|
|
20
35
|
```
|
|
21
36
|
|
|
22
|
-
|
|
37
|
+
Mount in the browser and give the host a height. Use one editor package per
|
|
38
|
+
application: each registers the same editor custom element.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
| Feature | Description |
|
|
43
|
+
| ---------- | ------------------------------------------------------------------------------- |
|
|
44
|
+
| Editing | Shared ProseMirror editor, ribbon, dialogs and document change events. |
|
|
45
|
+
| Files | Modern DOCX and limited legacy Word 97-2003 DOC loading through core. |
|
|
46
|
+
| Model | `createDocument`, `loadDocx`, `saveDocx` and core types from the package entry. |
|
|
47
|
+
| Frameworks | The same `<docx-editor>` UI behind six thin adapters. |
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
The shared props, event handlers, `loadDocument` and `detectDocumentFormat` helpers
|
|
52
|
+
are available from the package. Framework handles expose `load`, `save` and
|
|
53
|
+
`download`. The vanilla package supplies `mountEditor(container, options)` for
|
|
54
|
+
framework-free lifecycle management. ProseMirror, `docx-core`, `ooxml-core` and `ooxml-ui` are regular
|
|
55
|
+
dependencies; document and layout algorithms live in OOXML core.
|
|
56
|
+
|
|
57
|
+
## Limitations
|
|
58
|
+
|
|
59
|
+
This is an early editor. It does not establish Microsoft Word layout parity or
|
|
60
|
+
lossless saving for unsupported features. Legacy DOC support is limited to
|
|
61
|
+
main-body text with constrained paragraph edits. SmartArt is display-only and
|
|
62
|
+
charts render as placeholders.
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
23
65
|
|
|
24
|
-
|
|
66
|
+
[Framework guide](https://christophervr.github.io/docx-viewer/frameworks/vue) |
|
|
67
|
+
[Bindings](https://christophervr.github.io/docx-viewer/bindings)
|
|
25
68
|
|
|
26
|
-
|
|
27
|
-
- The ProseMirror libraries are regular dependencies so your package manager can dedupe them with other ProseMirror users. vue is a peer dependency.
|
|
28
|
-
- Use one editor package per application: each bundles its own copy of the editor and registers the `<docx-editor>` element.
|
|
29
|
-
- An early editor: not Microsoft Word layout parity, and saving is not lossless for unsupported features. See the [support roadmap](https://github.com/ChristopherVR/docx-viewer/blob/main/docs/parity-roadmap.md).
|
|
69
|
+
## License
|
|
30
70
|
|
|
31
|
-
|
|
71
|
+
Apache-2.0.
|