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 🙏

© 2026 – Pkg Stats / Ryan Hefner

prosemirror-flat-list

v0.5.8

Published

Powerful list support for ProseMirror

Readme

prosemirror-flat-list

NPM version

online demo

prosemirror-flat-list introduces a new ProseMirror list design different from the prosemirror-schema-list.

Features

Simpler data structure

This project simplifies the list design in ProseMirror by providing only one node type: list. You can add any block nodes as a children of a list node, including another list node. The first child can also be any block type, not just a paragraph.

This design is “flat” because it does not use <ul> (bullet_list) and <ol> (order_list) elements to wrap list items. This makes the data structure simpler and easier to manipulate. The list node will render as a <div> element.

New list kinds

We adds two new kinds of lists: task and toggle. You can interact with them using the mouse. These types are in addition to the existing bullet and ordered lists from prosemirror-schema-list.

task-and-toggle

Accurate indent and dedent range

This module improves how the indent and dedent commands work (they are called liftListItem and sinkListItem in prosemirror-schema-list). These two commands now try to move only the selected part of the document.

⬇ Unselected paragraph (e.g. "A complex list") is also moved when using the old sinkListItem command in prosemirror-schema-list.

old-dedent

⬇ Only selected paragraph are moved when using the new dedent command in prosemirror-flat-list.

new-dedent

Arbitrary indentations

Since the first child of a list node can also be a list node, we can have multiple bullet points on one line. This feature allows a list item to have arbitrary indentations by hiding all the bullets except the last one in one line.

arbitrary indentation

Input rules

prosemirror-flat-list provides some input rules for creating list nodes. You can type:

  • - or * followed by a space to create a bullet list node
  • 1. followed by a space to create an ordered list node
  • [ ] or [x] followed by a space to create a task list node
  • >> followed by a space to create a toggle list node

You can also use wrappingListInputRule function from this module to create your own input rules.

Migration

If you want to migrate your existing documents that use prosemirror-schema-list, you can use migrateDocJSON function from this module. It accepts an ProseMirror document JSON object and returns an updated document JSON object (or null if no migration is needed). It will replace all the old list nodes with the new list nodes. For example:

import { migrateDocJSON } from 'prosemirror-flat-list'

const oldDoc = {
  type: 'doc',
  content: [
    {
      type: 'ordered_list',
      content: [
        {
          type: 'list_item',
          content: [{ type: 'paragraph', text: 'Item 1' }],
        },
        {
          type: 'list_item',
          content: [{ type: 'paragraph', text: 'Item 2' }],
        },
      ],
    },
  ],
}

const newDoc = migrateDocJSON(oldDoc)

console.log(newDoc)
// {
//   type: 'doc',
//   content: [{
//     type: 'list',
//     attrs: { kind: 'ordered' },
//     content: [
//       { type: 'paragraph', text: 'Item 1' },
//       { type: 'paragraph', text: 'Item 2' }
//     ]
//   }]
// }

API Reference

Changelog