/slate-plugins-next

Slate Plugins for the latest version of slate.

Primary LanguageTypeScriptOtherNOASSERTION

slate-plugins-next

          Netlify Status

Built on top of Slate framework, slate-plugins-next enables you to use a list of customizable plugins for your Slate editor.

Try out the existing ones and create your own plugins!

🚀 Included

  • ✨ 20+ Editor Plugins.
  • 🏷️ Separation of Concerns.
  • ⚛️ Atomic Design.
  • 🎌 Supports the latest version of slate@0.57.1.
  • 📖 Docs and Demos on Storybook.

🧩 Plugins

A list of provided plugins extracted from official examples.

Elements

A plugin for each type of element. All of these use renderElement.

blocks

Marks

A plugin for each type of leaf. All of these use renderLeaf.

marks

Utilities

📦 Install

yarn add slate-plugins-next

You will also need these peerDependencies:

yarn add slate slate-hyperscript slate-react styled-components react react-dom

👏 Contributing

You can use this repository to share your own plugins.

If your plugin is tree-shakeable, you can add it to packages/slate-plugins.

Otherwise, create a new package in packages

📥 Pull requests and 🌟 Stars are always welcome.

Development scripts

Useful scripts include:

yarn

Installs package dependencies

yarn storybook

Starts storybook dev

yarn lint

boolean check if code conforms to linting eslint rules

yarn release

Lint, build and push a release to git and npm will ask for version in interactive mode - using lerna.

📝 Notice

Why

Slate is a powerful editor framework that helps you deal with difficult parts when building an editor, such as events handlers, elements, formatting, commands, rendering, serializing, normalizing, etc.

While you are trying to build your own editors, it still need a lot of efforts to make something similar to Quill or ProseMirror. This repository allows you to build your editor right away with minimal slate knowledge.

Bundle size

For simplicity, a single package slate-plugins-next has been published to share all the plugins. It's not a problem as it is tree-shakeable. However, a few plugins use external dependencies. These should be moved into their own package in the future.

License

MIT