docx-vue-viewer 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +54 -14
  2. package/dist/index.js +1960 -1828
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,31 +1,71 @@
1
1
  # docx-vue-viewer
2
2
 
3
- The DOCX editor for Vue 3. One self-contained package: the editor web component, the layout engine, the legacy Word 97-2003 `.doc` reader and the Vue 3 adapter are bundled in, so you install nothing else from this project except `docx-core` (the document model, `createDocument`, `loadDocx` and `saveDocx`).
3
+ [![npm version](https://img.shields.io/npm/v/docx-vue-viewer.svg)](https://www.npmjs.com/package/docx-vue-viewer)
4
+ [![license](https://img.shields.io/npm/l/docx-vue-viewer.svg)](https://github.com/ChristopherVR/docx-viewer/blob/main/LICENSE)
5
+ [![types](https://img.shields.io/npm/types/docx-vue-viewer.svg)](https://www.npmjs.com/package/docx-vue-viewer)
4
6
 
5
- ```sh
6
- npm install docx-vue-viewer docx-core vue
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 { ref } from 'vue';
12
- import { createDocument } from 'docx-core';
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 = ref(createDocument());
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
- The shared option types and the `loadDocument` / `detectDocumentFormat` helpers are exported from the package root.
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
- Notes:
66
+ [Framework guide](https://christophervr.github.io/docx-viewer/frameworks/vue) |
67
+ [Bindings](https://christophervr.github.io/docx-viewer/bindings)
25
68
 
26
- - DOCX and legacy `.doc` files are both opened; the format is sniffed from the bytes, never from the file name. Legacy `.doc` support is limited to main-body text with constrained paragraph edits.
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
- Documentation: [bindings guide](https://github.com/ChristopherVR/docx-viewer/blob/main/docs/bindings.md), [Vue 3 guide](https://github.com/ChristopherVR/docx-viewer/blob/main/docs/frameworks/vue.md). Licensed under Apache-2.0.
71
+ Apache-2.0.