ReactEditor
ReactEditor
is added to Editor
when it is instantiated using the withReact
method.const [editor] = useState(() => withReact(withHistory(createEditor())))
Check if the user is currently composing inside the editor.
Check if the editor is focused.
Check if the editor is in read-only mode.
Blur the editor.
Focus the editor.
Deselect the editor.
Find a key for a Slate node.
Returns an instance of
Key
which looks like { id: string }
Find the path of Slate node.
Check if a DOM node is within the editor.
Find the native DOM element from a Slate node.
Find a native DOM selection point from a Slate point.
Find a native DOM range from a Slate
range
.Find a Slate node from a native DOM
element
.Get the target range from a DOM
event
.Find a Slate point from a DOM selection's
domNode
and domOffset
.Find a Slate range from a DOM range or selection.
Insert data from a
DataTransfer
into the editor. This is a proxy method to call in this order insertFragmentData(editor: ReactEditor, data: DataTransfer)
and then insertTextData(editor: ReactEditor, data: DataTransfer)
.Insert fragment data from a
DataTransfer
into the editor. Returns true if some content has been effectively inserted.Insert text data from a
DataTransfer
into the editor. Returns true if some content has been effectively inserted.Sets data from the currently selected fragment on a
DataTransfer
.Last modified 1mo ago