New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@editorjs/nested-list

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@editorjs/nested-list

Nested list Tool for EditorJS

  • 1.4.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-0.69%
Maintainers
1
Weekly downloads
 
Created
Source

Nested List Tool for Editor.js

Multi-leveled lists for the Editor.js.

Use Tab and Shift+Tab keys to create or remove sublist with a padding.

Installation

Get the package

yarn add @editorjs/nested-list

Include module at your application

import NestedList from '@editorjs/nested-list';

Optionally, you can load this tool from CDN JsDelivr CDN

Usage

Add the NestedList Tool to the tools property of the Editor.js initial config.

import EditorJS from '@editorjs/editorjs';
import NestedList from '@editorjs/nested-list';

var editor = EditorJS({
  // ...
  tools: {
    ...
    list: {
      class: NestedList,
      inlineToolbar: true,
      config: {
        defaultStyle: 'unordered'
      },
    },
  },
});

Config Params

FieldTypeDescription
defaultStylestringdefault list style: ordered or unordered, default is unordered

Tool's settings

You can choose list`s type.

Output data

FieldTypeDescription
stylestringtype of a list: ordered or unordered
itemsItem[]the array of list's items

Object Item:

FieldTypeDescription
contentstringitem's string content
itemsItem[]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": []
                },
              ]
            },
        ]
    }
},

Keywords

FAQs

Package last updated on 30 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc