@eigenpal/docx-js-editor

中文文档
0.5.3发布于 2026/06/01MITTypeScriptESM + CJS构建来源已验证近 30 天下载 8.5万

DEPRECATED: renamed to @eigenpal/docx-editor-react. A browser-based DOCX editor. Migration guide: https://www.docx-editor.dev/docs/latest/migration

此软件包已被标记为弃用

deprecated

原始使用文档
文档目录7 节
  1. Quick Start
  2. Packages
  3. Plugins
  4. Development
  5. Contributing
  6. Translations
  7. Commercial Support

⚠️ @eigenpal/docx-js-editor is deprecated. It has been renamed to @eigenpal/docx-editor-react, with breaking API changes (component renames, a removed prop, new i18n imports), so it is not a drop-in find/replace. This 0.x line receives critical fixes only.

Install the new package: npm install @eigenpal/docx-editor-react, then follow the migration guide before upgrading.

DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side.

npm version npm downloads license Demo Documentation

Open-source WYSIWYG .docx editor for React with canonical OOXML, tracked changes, and real-time collaboration. Agent-ready. Live demo | Documentation

Quick Start

npm install @eigenpal/docx-js-editor
import { useRef } from 'react';
import { DocxEditor, type DocxEditorRef } from '@eigenpal/docx-js-editor';
import '@eigenpal/docx-js-editor/styles.css';

function Editor({ file }: { file: ArrayBuffer }) {
  const editorRef = useRef<DocxEditorRef>(null);
  return <DocxEditor ref={editorRef} documentBuffer={file} mode="editing" onChange={() => {}} />;
}

Next.js / SSR: Use dynamic import — the editor requires the DOM.

DOCX JS Editor screenshot

Packages

PackageDescription
@eigenpal/docx-js-editorReact UI — toolbar, paged editor, plugins. Install this.
@eigenpal/docx-editor-vueVue.js scaffold — contributions welcome

Plugins

import { DocxEditor, PluginHost, templatePlugin } from '@eigenpal/docx-js-editor';

<PluginHost plugins={[templatePlugin]}>
  <DocxEditor documentBuffer={file} />
</PluginHost>;

See the plugin documentation for the full plugin API.

Development

bun install
bun run dev        # localhost:5173
bun run build
bun run typecheck

A live preview of main is auto-deployed at latest.docx-editor.dev — useful for trying out changes before they ship to npm.

Examples: Vite | Next.js | Remix | Astro | Vue

Documentation | Props & Ref Methods | Plugins | Architecture

Contributing

Contributions welcome. See CONTRIBUTING.md for setup, tests, and the one-time CLA signature.

Translations

LocaleLanguageCoverage
enEnglish100%
deGerman100%
plPolish100%
pt-BRPortuguese (Brazil)100%

Help translate the editor into your language! See the full i18n contribution guide.

bun run i18n:new de      # scaffold German locale
bun run i18n:status      # check translation coverage

Commercial Support

[!TIP] Questions or custom features? Email [email protected].

版本与发布记录

@eigenpal/docx-js-editor 共发布 48 个版本,首次发布于 2026/02/05;过去 12 个月发布了 48 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.3latest2026/06/015 个月前
0.5.22026/05/185 个月前
0.5.12026/05/126 个月前
0.5.02026/05/086 个月前
0.4.32026/05/076 个月前
0.4.22026/05/066 个月前

关于 @eigenpal/docx-js-editor 的常见问题

@eigenpal/docx-js-editor 是什么?

DEPRECATED: renamed to @eigenpal/docx-editor-react. A browser-based DOCX editor. Migration guide: https://www.docx-editor.dev/docs/latest/migration注意:该包已被作者标记为弃用——deprecated

如何安装 @eigenpal/docx-js-editor?

在项目目录运行 npm install @eigenpal/docx-js-editor,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:prosemirror-view(^1.41.6)、prosemirror-model(^1.19.4)、prosemirror-state(^1.4.3)、prosemirror-keymap(^1.2.2)、prosemirror-tables(^1.8.5)、prosemirror-history(^1.4.0)、prosemirror-commands(^1.5.2)、prosemirror-transform(^1.10.2)、prosemirror-dropcursor(^1.8.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@eigenpal/docx-js-editor 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eigenpal/docx-js-editor 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@eigenpal/docx-js-editor 可以商用吗?

@eigenpal/docx-js-editor 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@eigenpal/docx-js-editor 的下载量有多少?

根据 npm 官方下载统计,@eigenpal/docx-js-editor 在 2026/10/13 – 2026/11/11 这 30 天内被下载 84,583 次,日均约 2,819 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eigenpal/docx-js-editor 还在维护吗?

最新版本 0.5.3 发布于 2026/06/01(5 个月前);至今共发布 48 个版本,其中过去 12 个月发布了 48 个;首次发布于 2026/02/05。作者已将其标记为弃用,新项目建议寻找替代方案。