@contentful/field-editor-rich-text

中文文档
6.6.14发布于 2026/11/10MITTypeScriptESM + CJS近 30 天下载 1.5万

bash npm install @contentful/field-editor-rich-text

原始使用文档
文档目录5 节
  1. ⚠️ Important: Package Configuration
  2. Migrating to v2
  3. 1. By embedding @contentful/field-editor-rich-text npm pack…
  4. 2. By forking the source code
  5. Credits

@contentful/field-editor-rich-text

npm install @contentful/field-editor-rich-text

This package contains a React RichTextEditor component that is used as the default for RichText field type in the Contentful web application.

import { RichTextEditor } from '@contentful/field-editor-rich-text';

⚠️ Important: Package Configuration

Plate 53.3.14 pins slate-react to 0.126.4. To use the latest Slate React version tested by this package (0.127.1), update existing overrides in your application as shown below. Package-manager overrides in this repository are not inherited by applications that install the published package.

For npm:

{
  "overrides": {
    "slate": "0.126.2",
    "slate-react": "0.127.1"
  }
}

For yarn:

{
  "resolutions": {
    "slate": "0.126.2",
    "slate-react": "0.127.1"
  }
}

Migrating to v2

To bring support for Rich Text Tables we rewrote most of the internals of this package to adapt the latest version of Slate. We are releasing this change as v2.0.0.

There are two ways our users typically use the rich-text field editor:

1. By embedding @contentful/field-editor-rich-text npm package

Since the public API exposed by the package remains the same, upgrading to v2 should be seamless as it's just a matter of installing the latest version from npm. No migration is needed.

2. By forking the source code

You will need to adapt your fork to work with v2. Here is a highlight of the major changes:

  1. Using Slate >= v0.80.0. If you're upgrading from < 0.50.x Please check the library migration guide
  2. Using Plate as a plugin system. Plate is a powerful plugin system to make it easy to work with Slate. All of the existing rich text plugins were rewritten to use Plate. To learn more, please check Plate's website.

Credits

This package is based on Slate & Plate and also borrows some of their code. Without them, this project would not have been possible.

版本与发布记录

@contentful/field-editor-rich-text 共发布 802 个版本,首次发布于 2020/02/19;过去 12 个月发布了 271 个版本。

版本发布日期距今
6.6.14latest2026/11/10今天
6.6.14-canary.1canary2026/11/10今天
6.6.14-canary.02026/11/064 天前
6.6.132026/11/055 天前
6.6.13-canary.33npm-publisher-backfill2026/10/2813 天前
6.6.13-canary.342026/10/2813 天前

其他发布通道:next → 2.0.0-next.45,npm-publisher-backfill → 6.6.13-canary.33,canary → 6.6.14-canary.1。

关于 @contentful/field-editor-rich-text 的常见问题

@contentful/field-editor-rich-text 是什么?

bash npm install @contentful/field-editor-rich-text

如何安装 @contentful/field-editor-rich-text?

在项目目录运行 npm install @contentful/field-editor-rich-text,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.3.1)、react-dom(>=18.3.1)、@lingui/core(^5.3.0)、@tanstack/react-query(^4.3.9 || ^5.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@contentful/field-editor-rich-text 支持 TypeScript 吗?

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

@contentful/field-editor-rich-text 支持 ESM 还是 CommonJS?

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

@contentful/field-editor-rich-text 可以商用吗?

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

@contentful/field-editor-rich-text 的下载量有多少?

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

@contentful/field-editor-rich-text 还在维护吗?

最新版本 6.6.14 发布于 2026/11/10(今天);至今共发布 802 个版本,其中过去 12 个月发布了 271 个;首次发布于 2020/02/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。