# @bigbinary/neeto-editor-frontend 中文文档

规范地址：https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/

版本：2\.7\.1
npm 元数据更新时间：2026-11-06T15:24:08.488Z
中文译文更新时间：2026-11-08T01:56:09.687Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bigbinary/neeto-editor-frontend
原文对照：https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/?lang=original
源码仓库：https://github.com/neetozone/neeto-editor-nano

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：42.1 MB，235 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.13
- 运行依赖：2 个
- peer 依赖：qs 6\.16\.2，yjs 13\.6\.20，yup 0\.32\.11，antd 5\.22\.1，util ^0\.12\.5，axios 1\.20\.0，ramda 0\.29\.0，react 18\.3\.1，formik 2\.4\.6，i18next 22\.5\.1，zustand 4\.4\.2，tippy\.js 6\.3\.7，dompurify 3\.4\.17，js-logger 1\.6\.1，react-dom 18\.3\.1，classnames 2\.5\.1，emoji-mart 5\.6\.0，autoprefixer 10\.4\.16，lucide-react ^0\.577\.0，react-helmet ^6\.1\.0，ua-parser-js ^2\.0\.3，framer-motion 11\.2\.14，linkify-react 4\.3\.2，react-i18next 12\.3\.1，@babel/runtime 7\.29\.7，@tippyjs/react 4\.2\.6，react-colorful 5\.6\.1，react-dropzone 14\.3\.8，react-toastify 8\.0\.2，avvvatars-react 0\.4\.2，react-resizable 3\.0\.5，react-router-dom 5\.3\.3，@bigbinary/neetoui 8\.8\.3，@honeybadger-io/js 6\.10\.1，@rails/actioncable 7\.2\.100，react-drag-listview 2\.0\.0，@rails/activestorage 7\.0\.8-3，@bigbinary/neeto-cist 1\.0\.17，@honeybadger-io/react 6\.1\.25，@tanstack/react-query 5\.59\.20，@bigbinary/neeto-atoms 1\.1\.8，@bigbinary/neeto-icons 1\.20\.89，@bigbinary/neeto-hotkeys 1\.0\.9，@bigbinary/neeto-molecules 5\.12\.6，@bigbinary/neeto-time-zones 0\.8\.26，@bigbinary/babel-preset-neeto \*，@tailwindcss/container-queries ^0\.1\.1，@tanstack/react-query-devtools 5\.59\.20，@bigbinary/neeto-commons-frontend 4\.15\.0，@bigbinary/neeto-filters-frontend 4\.7\.1，@wojtekmaj/react-timerange-picker 5\.5\.0，@bigbinary/neeto-team-members-frontend 5\.3\.4，@bigbinary/neeto-image-uploader-frontend 4\.2\.2
- 首次发布：2026-10-08T09:26:40.204Z
- 最新版本发布：2026-11-06T15:24:08.345Z
- 近 30 天下载量：43675（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：43（近 12 个月 43 个）

## 中文简介

needo Editor是驱动 BigBinary 所建所有 Needo 产品的丰富文本体验的图书馆

## 安装

```sh
npm install @bigbinary/neeto-editor-frontend
```

也可以使用：`pnpm add @bigbinary/neeto-editor-frontend`、`yarn add @bigbinary/neeto-editor-frontend`、`bun add @bigbinary/neeto-editor-frontend`

## README

# Neeto 编辑器

需要编辑纳米包括:

-   `neeto-editor-engine`: 管理资产上传到 需要编辑。 每个上传资产都将与一个组织相关联. 除了管理资产外,它确实 [还有几件事情](https://github.com/neetozone/neeto-editor-nano/issues/1279)。 。 。 .
-   `@bigbinary/neeto-editor-frontend`: 驱动丰富文本的库 经验 [产品](https://neeto.com/) 建造于 [大边形](https://www.bigbinary.com/)。 。 。 .

## 目录

1.  [安装](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-installation)
    -   [后端](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-backend)
    -   [前端](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-frontend)
2.  [使用量](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-usage)
3.  [发展指示](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-instructions-for-development)
4.  [出版说明](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-instructions-for-publishing)
5.  [文档](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/#readme-documentation)

## 安装

### 后端

1.  在您的应用程序的 Gemfile 中添加以下一行:

```zsh
source "NEETO_GEM_SERVER_URL" do
  # ..existing gems

  gem "neeto-editor-engine"
end
```

2.  执行以下命令:

```zsh
bundle install
```

3.  添加以下一行为 `config/routes.rb` 要挂载引擎的文件 `/neeto_editor` 路线.

```ruby
mount NeetoEditorEngine::Engine, at: "/neeto_editor"
```

4.  添加以下一行为 `models/organization.rb` 文档.

```ruby
has_many :neeto_editor_assets, class_name: "NeetoEditorEngine::Asset", dependent: :destroy
```

5.  执行以下命令以生成迁移以生成 `neeto_editor_engine_assets` 页:1.

```zsh
rails g neeto_editor_engine:install:migrations
```

6.  运行迁移.

```zsh
rails db:migrate
```

### 前端

```zsh
yarn add @bigbinary/neeto-editor-frontend
```

用于设置图像上传参考 https://neeto-editor.neeto.com/?path=/docs/examples-customize-options-addons-addons. 页面存档备份,存于互联网档案馆.

## 使用量

-   [主计长](https://npmcn.com/package/%40bigbinary/neeto-editor-frontend/docs/engine/controllers.md)

### 用户

1.  `trim_empty_lines`: 此乌提尔被添加到 `String` 课。 会有帮助的 您可以删除正后方的空行.
    
    ```rb
    str = "<p></p><h1></h1><br><h1>Hello world</h1><h1></h1><span></span>"
    str.trim_empty_lines # <h1>Hello world</h1>
    ```
    
2.  `sanitize`: Sanitizes 编辑器 HTML用于安全服务器侧渲染. 用途 `Rails::HTML::PermitScrubber` 带有标签和属性的许可列表 匹配编辑器的输出。 保存 CSS 变量 (% 1)`--custom-property` 财务报告和审定财务报表 `var()`)并验证iframe `src` 域(YouTube、Vimeo、Loom、, (原始内容存档于2017-10-12). Neeto Record, SupaDemo.
    
    ```rb
    NeetoEditorEngine.sanitize(html)
    ```
    

## 发展指示

通过执行以下命令安装所有依赖性 .

```zsh
yarn
```

运行 `yarn storybook` 命令启动故事本应用程序。 使用这个 用于测试更改的应用程序.

当开发前端软件包时,测试活的改变至关重要 使用主机应用程序的环境。 这样做有两种方法:

1.  使用 yalc 包管理器 : [https://youtu.be/F4zZFnrNTq8 请检查isbn=值 (帮助)](https://youtu.be/F4zZFnrNTq8)
    
2.  直接更新主机应用程序的节点 模块.
    
    1.  启动主机应用程序服务器 .
        
    2.  在软件包内,执行命令:
        
        ```zsh
        yarn build --watch --app ../neeto-site-web
        ```
        
        这里替换 `../neeto-site-web` 带有主机项目的路径。 现在,任何 对 netoEditor 代码库所作的修改将立即反映在 联合调查组.
        
    3.  在主机应用程序中运行以下命令以重置到 初始状态.
        
        ```zsh
        yarn install --check-files
        ```
        

## 出版指令

咨询 [构建和释放软件包](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) 关于如何出版的详细指南.

## 文档

在此读取前端文件 : [https://neeto-editor.neeto.com (中文(简体) )](https://neeto-editor.neeto.com/)。 。 。 .

## 常见问题

### @bigbinary/neeto-editor-frontend 是什么？

needo Editor是驱动 BigBinary 所建所有 Needo 产品的丰富文本体验的图书馆

### 如何安装 @bigbinary/neeto-editor-frontend？

在项目目录运行 npm install @bigbinary/neeto-editor-frontend，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：qs（6\.16\.2）、yjs（13\.6\.20）、yup（0\.32\.11）、antd（5\.22\.1）、util（^0\.12\.5）、axios（1\.20\.0）、ramda（0\.29\.0）、react（18\.3\.1）、formik（2\.4\.6）、i18next（22\.5\.1）、zustand（4\.4\.2）、tippy\.js（6\.3\.7）、dompurify（3\.4\.17）、js-logger（1\.6\.1）、react-dom（18\.3\.1）、classnames（2\.5\.1）、emoji-mart（5\.6\.0）、autoprefixer（10\.4\.16）、lucide-react（^0\.577\.0）、react-helmet（^6\.1\.0）、ua-parser-js（^2\.0\.3）、framer-motion（11\.2\.14）、linkify-react（4\.3\.2）、react-i18next（12\.3\.1）、@babel/runtime（7\.29\.7）、@tippyjs/react（4\.2\.6）、react-colorful（5\.6\.1）、react-dropzone（14\.3\.8）、react-toastify（8\.0\.2）、avvvatars-react（0\.4\.2）、react-resizable（3\.0\.5）、react-router-dom（5\.3\.3）、@bigbinary/neetoui（8\.8\.3）、@honeybadger-io/js（6\.10\.1）、@rails/actioncable（7\.2\.100）、react-drag-listview（2\.0\.0）、@rails/activestorage（7\.0\.8-3）、@bigbinary/neeto-cist（1\.0\.17）、@honeybadger-io/react（6\.1\.25）、@tanstack/react-query（5\.59\.20）、@bigbinary/neeto-atoms（1\.1\.8）、@bigbinary/neeto-icons（1\.20\.89）、@bigbinary/neeto-hotkeys（1\.0\.9）、@bigbinary/neeto-molecules（5\.12\.6）、@bigbinary/neeto-time-zones（0\.8\.26）、@bigbinary/babel-preset-neeto（\*）、@tailwindcss/container-queries（^0\.1\.1）、@tanstack/react-query-devtools（5\.59\.20）、@bigbinary/neeto-commons-frontend（4\.15\.0）、@bigbinary/neeto-filters-frontend（4\.7\.1）、@wojtekmaj/react-timerange-picker（5\.5\.0）、@bigbinary/neeto-team-members-frontend（5\.3\.4）、@bigbinary/neeto-image-uploader-frontend（4\.2\.2）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bigbinary/neeto-editor-frontend 支持 TypeScript 吗？

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

### @bigbinary/neeto-editor-frontend 支持 ESM 还是 CommonJS？

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

### @bigbinary/neeto-editor-frontend 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.13。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bigbinary/neeto-editor-frontend 可以商用吗？

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

### @bigbinary/neeto-editor-frontend 的下载量有多少？

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

### @bigbinary/neeto-editor-frontend 还在维护吗？

最新版本 2\.7\.1 发布于 2026/11/06（1 天前）；至今共发布 43 个版本，其中过去 12 个月发布了 43 个；首次发布于 2026/10/08。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

