npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@editorjs/list

v2.0.2

Published

List Tool for EditorJS

Downloads

194,428

Readme

Editorjs List Tool

  • 🤩 Part of Editor.js ecosystem.
  • 📂 Nesting.
  • 🔥 Ordered and Unordered lists.
  • ✅ Checklists.
  • 🔢 Customizable start number.
  • 🏛️ Customizable counter type (e.g. lower-roman).
  • 🪜 Max nesting level configuration.
  • 📝 Compatible with List and Checklist.

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

Installation

Get the package

yarn add @editorjs/list

Include module at your application

import EditorjsList from '@editorjs/list';

Optionally, you can load this tool from CDN JsDelivr CDN

Usage

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

import EditorJS from '@editorjs/editorjs';
import EditorjsList from '@editorjs/list';

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

[!IMPORTANT] Note that in List 2.0 class name changed from List to EditorjsList.

Config Params

| Field | Type | Description | |--------------|----------|----------------------------------------------------------------| | defaultStyle | string | default list style: ordered, unordered or checklist, default is unordered | | maxLevel | number | maximum level of the list nesting, could be set to 1 to disable nesting, unlimited by default |

Output data

| Field | Type | Description | | ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | | style | string | list will be rendered with this style: ordered, unordered or checklist, default is defaultStyle from tool config | | meta | ItemMeta| Item meta based on the list style | | items | Item[] | the array of list's items |

Object Item:

| Field | Type | Description | | ------- | ---------- | --------------------------- | | content | string | item's string content | | meta | ItemMeta | meta information about item | | items | Item[] | the array of list's items |

Object ItemMeta for Checklist:

| Field | Type | Description | | ------- | --------- | ------------------------- | | checked | boolean | state of the checkbox |

Object ItemMeta for Ordered list

| Field | Type | Description | | ------- | --------- | ------------------------- | | start | number | number for list to start with, default is 1 | | counterType | string | counter type for list, it could be numeric, lower-roman, upper-roman, lower-alpha, upper-alpha, default is numeric |

Object ItemMeta for Unordered list would be empty.

Example of the content for Unordered List

{
  "type" : "list",
  "data" : {
    "style": "unordered",
    "items": [
      {
        "content": "Apples",
        "meta": {},
        "items": [
          {
            "content": "Red",
            "meta": {},
            "items": []
          },
        ]
      },
    ]
  }
},

Example of the content for Ordered List

{
  "type" : "list",
  "data" : {
    "style": "ordered",
    "meta": {
      "start": 2,
      "counterType": "upper-roman",
    },
    "items" : [
      {
        "content": "Apples",
        "meta": {},
        "items": [
          {
            "content": "Red",
            "meta": {},
            "items": []
          },
        ]
      },
    ]
  }
},

Example of the content for Checklist

{
  "type" : "list",
  "data" : {
    "style": "checklist",
    "items" : [
      {
        "content": "Apples",
        "meta": {
          "checked": false
        },
        "items": [
          {
            "content": "Red",
            "meta": {
              "checked": true
            },
            "items": []
          },
        ]
      },
    ]
  }
},