@eigenpal/docx-editor-react 0.0.0 → 1.0.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/README.md +52 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.docx-editor.dev/">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-editor/main/assets/header.png" alt="DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side." width="500" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-editor-react"><img src="https://img.shields.io/npm/v/@eigenpal/docx-editor-react.svg?style=flat-square&color=3B5BDB" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-editor-react"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-editor-react.svg?style=flat-square&color=3B5BDB" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/eigenpal/docx-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat-square&color=3B5BDB" alt="license" /></a>
|
|
11
|
+
<a href="https://docx-editor.dev/editor"><img src="https://img.shields.io/badge/Live_Demo-3B5BDB?style=flat-square&logo=vercel&logoColor=white" alt="Demo" /></a>
|
|
12
|
+
<a href="https://www.docx-editor.dev/docs"><img src="https://img.shields.io/badge/Docs-3B5BDB?style=flat-square&logo=readthedocs&logoColor=white" alt="Documentation" /></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
1
15
|
# @eigenpal/docx-editor-react
|
|
2
16
|
|
|
3
17
|
React adapter for the [docx-editor](https://docx-editor.dev). WYSIWYG `.docx` editing with canonical OOXML, tracked changes, comments, real-time collaboration, and an AI agent bridge.
|
|
@@ -31,6 +45,35 @@ export function App() {
|
|
|
31
45
|
|
|
32
46
|
> **Next.js / SSR:** Use dynamic import. The editor requires the DOM.
|
|
33
47
|
|
|
48
|
+
## Start with a blank document
|
|
49
|
+
|
|
50
|
+
Skip the file picker for new documents. `createEmptyDocument` returns a fresh `Document` model you can pass straight to the editor:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { DocxEditor, createEmptyDocument } from '@eigenpal/docx-editor-react';
|
|
54
|
+
import '@eigenpal/docx-editor-react/styles.css';
|
|
55
|
+
|
|
56
|
+
const doc = createEmptyDocument();
|
|
57
|
+
// Or with options:
|
|
58
|
+
// createEmptyDocument({ initialText: 'Untitled', pageWidth: 12240 })
|
|
59
|
+
|
|
60
|
+
<DocxEditor document={doc} mode="editing" />;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`createDocumentWithText(text, options?)` is the same idea with a starting paragraph already typed. Both helpers are re-exported from `@eigenpal/docx-editor-core` so you don't need a separate dependency.
|
|
64
|
+
|
|
65
|
+
## Packages
|
|
66
|
+
|
|
67
|
+
| Package | Description |
|
|
68
|
+
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
69
|
+
| [`@eigenpal/docx-editor-react`](https://www.npmjs.com/package/@eigenpal/docx-editor-react) | <img src="https://cdn.simpleicons.org/react/61DAFB" width="20" align="middle" /> React adapter. Toolbar, paged editor, plugins. |
|
|
70
|
+
| [`@eigenpal/docx-editor-vue`](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) | <img src="https://cdn.simpleicons.org/vuedotjs/4FC08D" width="20" align="middle" /> Vue 3 adapter. Toolbar, paged editor, plugins. |
|
|
71
|
+
| [`@eigenpal/docx-editor-core`](https://www.npmjs.com/package/@eigenpal/docx-editor-core) | Framework-agnostic core: OOXML parser, serializer, layout engine, ProseMirror schema. Depend on this if you fork the React or Vue adapter. |
|
|
72
|
+
| [`@eigenpal/docx-editor-i18n`](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) | Shared locale strings and types consumed by both adapters. |
|
|
73
|
+
| [`@eigenpal/docx-editor-agents`](https://www.npmjs.com/package/@eigenpal/docx-editor-agents) | Agent SDK and chat UI: framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI. |
|
|
74
|
+
|
|
75
|
+
> **Forking the adapter?** Keep your fork thin. Depend on `@eigenpal/docx-editor-core` directly so parser, serializer, and rendering fixes land in your build automatically, without backporting each upstream change by hand.
|
|
76
|
+
|
|
34
77
|
## Imperative mounting
|
|
35
78
|
|
|
36
79
|
```ts
|
|
@@ -68,3 +111,12 @@ Full props and ref reference: **[docx-editor.dev/docs/props](https://www.docx-ed
|
|
|
68
111
|
`@eigenpal/docx-editor-core` is installed transitively. Add it to your `package.json` only if your own code imports core APIs directly. Strict installers like pnpm with peer auto-install disabled may also need the ProseMirror peers listed in `package.json`.
|
|
69
112
|
|
|
70
113
|
Examples: [Vite](https://github.com/eigenpal/docx-editor/tree/main/examples/vite) · [Next.js](https://github.com/eigenpal/docx-editor/tree/main/examples/nextjs) · [Remix](https://github.com/eigenpal/docx-editor/tree/main/examples/remix) · [Astro](https://github.com/eigenpal/docx-editor/tree/main/examples/astro)
|
|
114
|
+
|
|
115
|
+
## Contributing
|
|
116
|
+
|
|
117
|
+
Contributions welcome. See [CONTRIBUTING.md](https://github.com/eigenpal/docx-editor/blob/main/CONTRIBUTING.md) for setup, tests, and the one-time CLA signature.
|
|
118
|
+
|
|
119
|
+
## Commercial Support
|
|
120
|
+
|
|
121
|
+
> [!TIP]
|
|
122
|
+
> Questions or custom features? Email **[docx-editor@eigenpal.com](mailto:docx-editor@eigenpal.com)**.
|
package/dist/index.d.mts
CHANGED
|
@@ -32,6 +32,7 @@ import { SelectionState } from '@eigenpal/docx-editor-core/prosemirror';
|
|
|
32
32
|
import { Layout } from '@eigenpal/docx-editor-core/layout-engine';
|
|
33
33
|
import { RenderedDomContext } from '@eigenpal/docx-editor-core/plugin-api';
|
|
34
34
|
import { EditorHandle } from '@eigenpal/docx-editor-core';
|
|
35
|
+
export { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from '@eigenpal/docx-editor-core';
|
|
35
36
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
36
37
|
|
|
37
38
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { SelectionState } from '@eigenpal/docx-editor-core/prosemirror';
|
|
|
32
32
|
import { Layout } from '@eigenpal/docx-editor-core/layout-engine';
|
|
33
33
|
import { RenderedDomContext } from '@eigenpal/docx-editor-core/plugin-api';
|
|
34
34
|
import { EditorHandle } from '@eigenpal/docx-editor-core';
|
|
35
|
+
export { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from '@eigenpal/docx-editor-core';
|
|
35
36
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
36
37
|
|
|
37
38
|
/**
|