@calumk/editorjs-columns

中文文档
0.4.0发布于 2026/04/02MITCommonJS构建来源已验证近 30 天下载 1.7万

Columns, for EditorJS

原始使用文档
文档目录5 节
  1. Installation
  2. Demo
  3. Features
  4. ChangeLog
  5. Docs

@calumk/editorjs-Columns

A plugin which allows the user to have columns!

Please Read the Known Bugs Section! Pull requests are very much welcomed!

Installation

npm i @calumk/editorjs-columns

https://cdn.jsdelivr.net/npm/@calumk/editorjs-columns@latest

Demo

demo

Features

  • Support new vertical menu style
  • Save/Load
  • Support for 2 colums
  • Support for 3 columns
    • Migrate storage to array
    • Add tool to change type
    • Added tool to switch/roll arrays
  • Refactor code for legibility
  • Tests

ChangeLog

02/04/26 - Large changes -

  • Replaced SweetAlert with micromodal to reduce bundle size.
  • Added propergation fixes from #27 to fix the enter key and tab key issues, and reduce the copy/paste issues.

28/04/23 - Re-added feature - EditorJs must now be passed as instance through tool to child, to avoid duplicate editorjs installs, and ensure only one editor js instance is used. 16/05/22 - Removed global tool varable. Switched to config variable for column tools (see Example) 22/05/22 - EditorJs must now be passed as instance through tool to child, to avoid duplicate editorjs installs - Rolled Back

Known Bugs

  • Pressing enter key inside a column, will exit the column

    • Can be solved (sort-of) by using @calumk/editorjs-paragraph-linebreakable
  • Pressing tab key inside column will launch both column, and parent tools - This is hard to solve, as pasting triggers propergation up the column editor into the main editor

  • Copy/Pasting can cause duplication of data in the wrong place - This is hard to solve, as pasting triggers propergation up the column editor into the main editor

  • z-index issues with toolboxes

  • Tools are hosted as global var

  • All Styling is currently only in the example.html

    • Column styling should move to plugin
    • Opinionaited styling (Borders, rounded corners, hover shaddow) will remain in example.html
  • SVG logo is not rendering correctly in new vertical menu

Docs

None yet, see example/example.html for useage.


Note : Tools are passed to editorjs-columns using config.tools property

// first define the tools to be made avaliable in the columns
let column_tools = {
    header: Header,
    alert : Alert,
    paragraph : editorjsParagraphLinebreakable,
    delimiter : Delimiter
}

// next define the tools in the main block
// Warning - Dont just use main_tools - you will probably generate a circular reference 
let main_tools = {
// Load Official Tools
    header: Header,
    alert : Alert,
    paragraph : editorjsParagraphLinebreakable,
    delimiter : Delimiter,

    columns : {
        class : editorjsColumns,
        config : {
          EditorJsLibrary : EditorJs, // Pass the library instance to the columns instance.
          tools : column_tools // IMPORTANT! ref the column_tools
        }
      },
}


editor = new EditorJS({
    tools : main_tools,
});

You can also use the i18n feature of Editor.js to change the text of the tools.

i18n: {
    messages: {
        toolNames: {
            Columns: `Columnas`,
        },
        tools: {
            columns: {
                '2 Columns': `Dos columnas`,
                '3 Columns': `Tres columnas`, 
                'Roll Columns': `Rotar columnas`,
                'Are you sure?': `¿Está seguro?`,
                'This will delete Column 3!': `¡Esto eliminará la Columna 3!`,
                'Yes, delete it!': `¡Sí, eliminar!`,
                Cancel: `Cancelar`,
            },
        },
    },
};

版本与发布记录

@calumk/editorjs-columns 共发布 13 个版本,首次发布于 2022/05/08;过去 12 个月发布了 1 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.0latest2026/04/027 个月前
0.3.22024/03/222 年前
0.3.12023/06/213 年前
0.3.02023/06/103 年前
0.2.42022/05/224 年前
0.2.32022/05/224 年前

关于 @calumk/editorjs-columns 的常见问题

@calumk/editorjs-columns 是什么?

Columns, for EditorJS

如何安装 @calumk/editorjs-columns?

在项目目录运行 npm install @calumk/editorjs-columns,或使用 pnpm add / yarn add / bun add。

@calumk/editorjs-columns 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/calumk__editorjs-columns 是否存在。

@calumk/editorjs-columns 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@calumk/editorjs-columns 可以商用吗?

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

@calumk/editorjs-columns 的下载量有多少?

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

@calumk/editorjs-columns 还在维护吗?

最新版本 0.4.0 发布于 2026/04/02(7 个月前);至今共发布 13 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/05/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。