@coolbytes/editorjs-list
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

List block tool for Editor.js

This is a clone of this Editor.js nested-list block tool. It fixes the ordered list issue.

Preview

list

Installation

Using npm

npm install @coolbytes/editorjs-list

Using yarn

yarn add @coolbytes/editorjs-list

Usage

Include it in the tools property of Editor.js config:

const editor = new EditorJS({
  tools: {
    list: List
  }
});

Or init the List tool with additional settings

const editor = new EditorJS({
  tools: {
    list: {
      class: List,
      inlineToolbar: true,
      config: {
        defaultStyle: 'unordered'
      },
    },
  },
});

Config Params

Field Type Description
defaultStyle string default list style: ordered or unordered, default is unordered

Output data

Field Type Description
style string type of a list: ordered or unordered
items Item[] the array of list's items

Object Item:

Field Type Description
content string item's string content
items Item[] the array of list's items
{
    "type" : "list",
    "data" : {
        "style" : "unordered",
        "items" : [
            {
              "content": "Apples",
              "items": [
                {
                  "content": "Red",
                  "items": []
                },
                {
                  "content": "Green",
                  "items": []
                },
              ]
            },
            {
              "content": "Bananas",
              "items": [
                {
                  "content": "Yellow",
                  "items": []
                },
              ]
            },
        ]
    }
},

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i @coolbytes/editorjs-list

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

47.6 kB

Total Files

10

Last publish

Collaborators

  • coolbytes.in