@eigenpal/docx-js-editor 0.0.19 → 0.0.20
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 +83 -0
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/eigenpal/docx-js-editor">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/logo.png" alt="DOCX JS Editor" width="600" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-js-editor"><img src="https://img.shields.io/npm/v/@eigenpal/docx-js-editor.svg?style=flat-square&color=00C853" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-js-editor"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-js-editor.svg?style=flat-square&color=00C853" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/eigenpal/docx-js-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&color=00C853" alt="license" /></a>
|
|
11
|
+
<a href="https://docx-js-editor.vercel.app/"><img src="https://img.shields.io/badge/Live_Demo-00C853?style=flat-square&logo=vercel&logoColor=white" alt="Live Demo" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
# @eigenpal/docx-js-editor
|
|
15
|
+
|
|
16
|
+
Open-source WYSIWYG DOCX editor for the browser. No server required. **[Live demo](https://docx-js-editor.vercel.app/)**
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://docx-js-editor.vercel.app/">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/editor.png" alt="DOCX JS Editor screenshot" width="700" />
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
- WYSIWYG editing with Word fidelity — formatting, tables, images, hyperlinks
|
|
25
|
+
- Track changes (suggestion mode) with accept/reject
|
|
26
|
+
- Comments with replies, resolve/reopen, scroll-to-highlight
|
|
27
|
+
- Plugin system, undo/redo, find & replace, print preview
|
|
28
|
+
- Client-side only, zero server dependencies
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @eigenpal/docx-js-editor
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { useRef } from 'react';
|
|
38
|
+
import { DocxEditor, type DocxEditorRef } from '@eigenpal/docx-js-editor';
|
|
39
|
+
import '@eigenpal/docx-js-editor/styles.css';
|
|
40
|
+
|
|
41
|
+
function Editor({ file }: { file: ArrayBuffer }) {
|
|
42
|
+
const editorRef = useRef<DocxEditorRef>(null);
|
|
43
|
+
return <DocxEditor ref={editorRef} documentBuffer={file} onChange={() => {}} />;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Next.js / SSR:** Use dynamic import — the editor requires the DOM.
|
|
48
|
+
|
|
49
|
+
## Packages
|
|
50
|
+
|
|
51
|
+
| Package | Description |
|
|
52
|
+
| -------------------------------------------- | ------------------------------------------------------------ |
|
|
53
|
+
| [`@eigenpal/docx-js-editor`](https://github.com/eigenpal/docx-js-editor/tree/main/packages/react) | React UI — toolbar, paged editor, plugins. **Install this.** |
|
|
54
|
+
| [`@eigenpal/docx-editor-vue`](https://github.com/eigenpal/docx-js-editor/tree/main/packages/vue) | Vue.js scaffold — contributions welcome |
|
|
55
|
+
|
|
56
|
+
## Plugins
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { DocxEditor, PluginHost, templatePlugin } from '@eigenpal/docx-js-editor';
|
|
60
|
+
|
|
61
|
+
<PluginHost plugins={[templatePlugin]}>
|
|
62
|
+
<DocxEditor documentBuffer={file} />
|
|
63
|
+
</PluginHost>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
See [docs/PLUGINS.md](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PLUGINS.md) for the full plugin API.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bun install
|
|
72
|
+
bun run dev # localhost:5173
|
|
73
|
+
bun run build
|
|
74
|
+
bun run typecheck
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Examples: [Vite](https://github.com/eigenpal/docx-js-editor/tree/main/examples/vite) | [Next.js](https://github.com/eigenpal/docx-js-editor/tree/main/examples/nextjs) | [Remix](https://github.com/eigenpal/docx-js-editor/tree/main/examples/remix) | [Astro](https://github.com/eigenpal/docx-js-editor/tree/main/examples/astro) | [Vue](https://github.com/eigenpal/docx-js-editor/tree/main/examples/vue)
|
|
78
|
+
|
|
79
|
+
**[Props & Ref Methods](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PROPS.md)** | **[Plugins](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PLUGINS.md)** | **[Architecture](https://github.com/eigenpal/docx-js-editor/blob/main/docs/ARCHITECTURE.md)**
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eigenpal/docx-js-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "A browser-based DOCX template editor with variable insertion support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsup && bun run build:css",
|
|
77
77
|
"build:css": "tailwindcss -c ../../tailwind.config.lib.js -i ./src/styles/editor.css -o ./dist/styles.css --minify",
|
|
78
|
+
"prepublishOnly": "sed -e 's|\\./assets/|https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/|g' -e 's|(packages/|(https://github.com/eigenpal/docx-js-editor/tree/main/packages/|g' -e 's|(docs/|(https://github.com/eigenpal/docx-js-editor/blob/main/docs/|g' -e 's|(examples/|(https://github.com/eigenpal/docx-js-editor/tree/main/examples/|g' ../../README.md > README.md",
|
|
78
79
|
"typecheck": "tsc --noEmit"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|