diff --git a/docs/reference/components/editor.md b/docs/reference/components/editor.md index d6c14661c..12b1fd89d 100644 --- a/docs/reference/components/editor.md +++ b/docs/reference/components/editor.md @@ -21,15 +21,16 @@ The top-level React component that renders the Slate editor itself. - [`placeholderClassName`](#placeholderclassname) - [`placeholderStyle`](#placeholderstyle) - [Plugin-like Properties](#plugin-like-properties) - - [`onBeforeInput`](#onbeforeinput-function) - - [`onKeyDown`](#onkeydown-function) - - [`onPaste`](#onpaste-function) - - [`renderDecorations`](#renderdecorations-function) - - [`renderMark`](#rendermark-function) - - [`renderNode`](#rendernode-function) + - [`onBeforeInput`](#onbeforeinput) + - [`onDrop`](#ondrop) + - [`onKeyDown`](#onkeydown) + - [`onPaste`](#onpaste) + - [`renderDecorations`](#renderdecorations) + - [`renderMark`](#rendermark) + - [`renderNode`](#rendernode) - [Methods](#methods) - - [`getState()`](#getstate-state) - - [`onChange(state)`](#onchange-state-void) + - [`getState()`](#getstate) + - [`onChange(state)`](#onchange) ## Properties @@ -148,6 +149,14 @@ const plugins = [ /> ``` +### `onBeforeInput` +### `onDrop` +### `onKeyDown` +### `onPaste` +### `renderDecorations` +### `renderMark` +### `renderNode` + To see how these properties behave, check out the [Plugins reference](../plugins/plugins.md). diff --git a/docs/reference/plugins/core.md b/docs/reference/plugins/core.md index cc426e63f..352abb0be 100644 --- a/docs/reference/plugins/core.md +++ b/docs/reference/plugins/core.md @@ -11,19 +11,23 @@ Slate's editor is very unopinionated. The only logic it handles by default is lo The default behavior of the core plugin performs the following logic: -#### `onBeforeInput` +### `onBeforeInput` When text is entered, the core plugin inserts the text from `event.data` into the editor. -#### `onKeyDown` +### `onDrop` + +When the user drops content into the editor, the core plugin handles drops of type `text` and `html` as plain text, and does nothing for drops of type `files`. + +### `onKeyDown` When a key is pressed, the core plugin handles performing some of the "native" behavior that `contenteditable` elements must do. For example it splits blocks on `enter`, removes characters `backspace`, triggers an undo state from the history on `cmd-z`, etc. -#### `onPaste` +### `onPaste` When the user pastes content into the editor, the core plugin handles all pastes of type `text` and `html` as plain text, and does nothing for pastes of type `files`. -#### `renderNode` +### `renderNode` The core plugin renders a default block and inline node, wrapping in a `