@bigbinary/neeto-editor-frontend

中文文档
2.7.1发布于 2026/11/06MITTypeScriptESM + CJS近 30 天下载 4.4万

neetoEditor is the library that drives the rich text experience in all neeto products built at BigBinary

原始使用文档
文档目录9 节
  1. Contents
  2. Installation
  3. Backend
  4. Frontend
  5. Usage
  6. Utils
  7. Instructions for development
  8. Instructions for Publishing
  9. Documentation

NeetoEditorNano

The neetoEditor nano consists of:

  • neeto-editor-engine: A Ruby gem that manages the asset uploads in neetoEditor. Each uploaded asset will be associated with an organization. Besides managing assets it does a few other things too.
  • @bigbinary/neeto-editor-frontend: The library that drives the rich text experience in the neeto products built at BigBinary.

Contents

  1. Installation
  2. Usage
  3. Instructions for development
  4. Instructions for publishing
  5. Documentation

Installation

Backend

  1. Add the following line to your application's Gemfile:
source "NEETO_GEM_SERVER_URL" do
  # ..existing gems

  gem "neeto-editor-engine"
end
  1. Execute the following command:
bundle install
  1. Add the following line to config/routes.rb file to mount the engine at /neeto_editor route.
mount NeetoEditorEngine::Engine, at: "/neeto_editor"
  1. Add the following line to models/organization.rb file.
has_many :neeto_editor_assets, class_name: "NeetoEditorEngine::Asset", dependent: :destroy
  1. Execute the following command to generate the migration to generate the neeto_editor_engine_assets table.
rails g neeto_editor_engine:install:migrations
  1. Run migrations.
rails db:migrate

Frontend

yarn add @bigbinary/neeto-editor-frontend

For setting up image upload refer https://neeto-editor.neeto.com/?path=/docs/examples-customize-options-addons--addons.

Usage

Utils

  1. trim_empty_lines: This util is added to the String class. It will help you to remove leading and trailing empty lines.

    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 editor HTML for safe server-side rendering. Uses Rails::HTML::PermitScrubber with an allowlist of tags and attributes matching the editor's output. Preserves CSS variables (--custom-property and var()) and validates iframe src domains (YouTube, Vimeo, Loom, NeetoRecord, SupaDemo).

    NeetoEditorEngine.sanitize(html)
    

Instructions for development

Install all the dependencies by executing the following command.

yarn

Running the yarn storybook command starts a storybook application. Use this application to test out changes.

When developing frontend packages, it's crucial to test changes in a live environment using a host application. There are two ways to do this:

  1. Using yalc package manager: https://youtu.be/F4zZFnrNTq8

  2. Directly updating the node_modules of the host application.

    1. Start the host application server.

    2. Inside the package, execute the command:

      yarn build --watch --app ../neeto-site-web
      

      Here replace ../neeto-site-web with path to the host project. Now, any changes made to the neetoEditor codebase will be instantly reflected in the UI.

    3. Run the following command in the host application to reset to the initial state.

      yarn install --check-files
      

Instructions for Publishing

Consult the building and releasing packages guide for details on how to publish.

Documentation

Read the frontend docs here: https://neeto-editor.neeto.com.

版本与发布记录

@bigbinary/neeto-editor-frontend 共发布 43 个版本,首次发布于 2026/10/08;过去 12 个月发布了 43 个版本。

版本发布日期距今
2.7.1latest2026/11/061 天前
2.7.02026/11/062 天前
2.7.0-beta1beta2026/11/062 天前
2.6.02026/11/062 天前
2.6.0-beta12026/11/062 天前
2.5.12026/11/053 天前

关于 @bigbinary/neeto-editor-frontend 的常见问题

@bigbinary/neeto-editor-frontend 是什么?

neetoEditor is the library that drives the rich text experience in all neeto products built at BigBinary

如何安装 @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 和提交记录判断。