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

draft-js-list-depth-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draft-js-list-depth-plugin

List depth Plugin for DraftJS

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-99.15%
Maintainers
1
Weekly downloads
 
Created
Source

Draft.js List Depth plugin

This is a plugin for the draft-js-plugins-editor, a plugin system that sits on top of Draft.js.

When working with a list in DraftJS you can't decrease list depth level by pressing Return on an empty list item, but you would expect it to behave this way because it is a common pattern for rich text editors.

This plugin adds this missing piece of functionality. Moreover, it also adds a Tab/Shift + Tab press support to move list item to the next depth level. So you don't need to worry about this anymore!

demo

Usage

npm i --save draft-js-list-depth-plugin

then import the plugin creator function

import createListDepthPlugin from 'draft-js-list-depth-plugin'
const listDepthPlugin = createListDepthPlugin()

Plugin object can then be passed into a draft-js-plugins-editor component:

import createListDepthPslugin from 'draft-js-list-depth-plugin'
import Editor from 'draft-js-plugins-editor'

const listDepthPlugin = createListDepthPlugin()
const plugins = [listDepthPlugin]

<Editor plugins={plugins} />

Optional configuration object

You can pass options object to the plugin as you call it:

const options = {
  maxDepth: 4
}

const listDepthPlugin = createListDepthPlugin(options)
OptionDescriptionDefault valueRequired
maxDepthThe limit of the depth level for nested lists (zero-based numbering)4false

Keywords

FAQs

Package last updated on 20 Aug 2018

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