1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 19:52:32 +02:00

Add controller (#2221)

* fold Stack into Editor

* switch Change objects to be tied to editors, not values

* introduce controller

* add the "commands" concept

* convert history into commands on `value.data`

* add the ability to not normalize on editor creation/setting

* convert schema to a mutable constructor

* add editor.command method

* convert plugin handlers to receive `next`

* switch commands to use the onCommand middleware

* add queries support, convert schema to queries

* split out browser plugin

* remove noop util

* fixes

* fixes

* start fixing tests, refactor hyperscript to be more literal

* fix slate-html-serializer tests

* fix schema tests with hyperscript

* fix text model tests with hyperscript

* fix more tests

* get all tests passing

* fix lint

* undo decorations example update

* update examples

* small changes to the api to make it nicer

* update docs

* update commands/queries plugin logic

* change normalizeNode and validateNode to be middleware

* fix decoration removal

* rename commands tests

* add useful errors to existing APIs

* update changelogs

* cleanup

* fixes

* update docs

* add editor docs
This commit is contained in:
Ian Storm Taylor
2018-10-09 14:03:27 -07:00
committed by GitHub
parent e6372d829a
commit 7a71de387c
709 changed files with 6073 additions and 5927 deletions

View File

@@ -11,11 +11,6 @@ Plugins that add specific behaviors to your editor.
| [`slate-auto-replace`](https://yarnpkg.com/en/package/slate-auto-replace) | Automatically transform certain input as a user types. | ![](https://img.shields.io/npm/dm/slate-auto-replace.svg?maxAge=3600&label=⬇) |
| [`slate-collapse-on-escape`](https://yarnpkg.com/en/package/slate-collapse-on-escape) | Collapse the selection when users hit <kbd>esc</kbd>. | ![](https://img.shields.io/npm/dm/slate-collapse-on-escape.svg?maxAge=3600&label=⬇) |
| [`slate-drop-or-paste-images`](https://yarnpkg.com/en/package/slate-drop-or-paste-images) | Allows users to insert images by drag-dropping or copy-pasting. | ![](https://img.shields.io/npm/dm/slate-drop-or-paste-images.svg?maxAge=3600&label=⬇) |
| [`slate-edit-blockquote`](https://yarnpkg.com/en/package/slate-edit-blockquote) | Adds blockquote editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-blockquote.svg?maxAge=3600&label=⬇) |
| [`slate-edit-code`](https://yarnpkg.com/en/package/slate-edit-code) | Adds code block editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-code.svg?maxAge=3600&label=⬇) |
| [`slate-edit-footnote`](https://yarnpkg.com/en/package/slate-edit-footnote) | Adds footnote editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-footnote.svg?maxAge=3600&label=⬇) |
| [`slate-edit-list`](https://yarnpkg.com/en/package/slate-edit-list) | Adds list editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-list.svg?maxAge=3600&label=⬇) |
| [`slate-edit-table`](https://yarnpkg.com/en/package/slate-edit-table) | Adds common table editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-table.svg?maxAge=3600&label=⬇) |
| [`slate-mark-hotkeys`](https://yarnpkg.com/en/package/slate-mark-hotkeys) | Adds common hotkey formatting utils to an editor. | ![](https://img.shields.io/npm/dm/slate-mark-hotkeys.svg?maxAge=3600&label=⬇) |
| [`slate-no-empty`](https://yarnpkg.com/en/package/slate-no-empty) | Prevents documents from being empty. | ![](https://img.shields.io/npm/dm/slate-no-empty.svg?maxAge=3600&label=⬇) |
| [`slate-paste-linkify`](https://yarnpkg.com/en/package/slate-paste-linkify) | Automatically linkify URLs when they are pasted. | ![](https://img.shields.io/npm/dm/slate-paste-linkify.svg?maxAge=3600&label=⬇) |

View File

@@ -17,9 +17,10 @@ These tools are helpful when developing with Slate:
## Products
These products are built with Slate, and can give you an idea of what's possible:
These products use Slate, and can give you an idea of what's possible:
* [Cake](https://www.cake.co/)
* [Chatterbug](https://chatterbug.com)
* [GitBook](https://www.gitbook.com/)
* [Grafana](https://grafana.com/)
* [Guru](https://www.getguru.com/)
@@ -36,4 +37,6 @@ These pre-packaged editors are built on top of Slate, and can be helpful to see
* [Nossas Editor](http://slate-editor.bonde.org/) is a drop-in WYSIWYG editor.
* [ORY Editor](https://editor.ory.am/) is a self-contained, inline WYSIWYG editor library.
* [Outline Editor](https://github.com/outline/rich-markdown-editor) is the editor that powers the [Outline](https://www.getoutline.com/) wiki.
* [Chatterslate](https://github.com/chatterbugapp/chatterslate) helps teach language grammar and more at [Chatterbug](https://chatterbug.com)
* [Chatterslate](https://github.com/chatterbugapp/chatterslate) helps teach language grammar and more at [Chatterbug](https://chatterbug.com).
(Or, if you have their exact use case, can be a drop-in editor for you.)