# @digit-fe/digit-editor-new

> 数字平台编辑器

Latest version **0.1.8** (published 2026-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @digit-fe/digit-editor-new
pnpm add @digit-fe/digit-editor-new
yarn add @digit-fe/digit-editor-new
bun add @digit-fe/digit-editor-new
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2026-07-23 |
| First published | 2023-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zhaojunzhe, tingyugetc |

## Links

- npm: https://www.npmjs.com/package/@digit-fe/digit-editor-new
- npm.io page: https://npm.io/package/@digit-fe/digit-editor-new

## Recent versions

- 0.1.8 (latest) — 2026-07-23
- 0.1.7 — 2026-06-02
- 0.1.6 — 2026-05-06
- 0.1.4-fix2 — 2025-11-21
- 0.1.4-fix1 — 2025-08-21
- 0.1.3 — 2025-07-14
- 0.1.2 — 2025-05-19
- 0.1.1 — 2024-11-19
- 0.1.0 — 2024-11-05
- 0.0.9 — 2024-08-01
- 0.0.8 — 2024-08-01
- 0.0.7 — 2024-07-01
- 0.0.6 — 2024-04-17
- 0.0.5 — 2023-11-09
- 0.0.4 — 2023-11-09
- … 3 more at https://npm.io/package/@digit-fe/digit-editor-new/versions

## README

# @digit-fe/digit-editor-new

[![NPM version](https://img.shields.io/npm/v/@digit-fe/digit-editor-new.svg?style=flat)](https://npmjs.org/package/@digit-fe/digit-editor-new)
[![NPM downloads](http://img.shields.io/npm/dm/@digit-fe/digit-editor-new.svg?style=flat)](https://npmjs.org/package/@digit-fe/digit-editor-new)

1 句话介绍：基于 Tiptap 和 Prosemirror 封装的富文本编辑器，适用于 React 工程中，<span style="color:red">Vue 工程暂不支持</span>  
采用 father.js(4.x 版本) [bundleless](https://zhuanlan.zhihu.com/p/349406330)模式进行编译打包，因此<span style="color:red">接入的工程需提供 less 的支持</span>

## 0.测试环境地址
https://testcert.fanruan.com/neweditor/

## 1.文档地址
https://admin.shequ.fanruan.com/digit

## 2.安装

```
npm install @digit-fe/digit-editor-new
```

```
yarn add @digit-fe/digit-editor-new
```

```
pnpm install @digit-fe/digit-editor-new
```

## 3.初始化

### 3.1 在 umi.js 工程中使用

在 umi(umi3,umi4)工程中，因为底层已经预设了对 less 的支持，所以可直接引用

```
  import Editor from '@digit-fe/digit-editor-new';
```

### 3.2 在 create-react-app 工程中使用

因为 CRA 中没有内置 less，所以得先安装 less 的相关依赖，具体方法如下
步骤 1:

```
npm run eject
```

步骤 2：

```
npm install less less-loader -D
```

步骤 3：
改写 config/webpack.config.js，增加如下代码

```
const lessRegex = /\.less$/;
const lessModuleRegex = /\.module\.less$/;
在sassRegex下 增加
{
  test: lessRegex,
  exclude: lessModuleRegex,
  use: getStyleLoaders(
    {
      importLoaders: 3,
      sourceMap: isEnvProduction ? shouldUseSourceMap: isEnvDevelopment,
    },
    'less-loader'
  ),
  sideEffects: true,
}
```

## 4.使用

具体使用方法参考[具体使用方法](components/editor)


## LICENSE

MIT

---
_Source: https://npm.io/package/@digit-fe/digit-editor-new · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
