mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-02 19:52:32 +02:00
Remove commands (#3351)
* remove commands in favor of editor-level functions * update examples * fix lint
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { jsx } from '../..'
|
||||
|
||||
export const run = editor => {
|
||||
editor.exec({ type: 'insert_text', text: 'text' })
|
||||
editor.insertText('text')
|
||||
}
|
||||
|
||||
export const input = (
|
||||
|
@@ -3,9 +3,9 @@
|
||||
import { jsx } from '../..'
|
||||
|
||||
export const run = editor => {
|
||||
editor.exec({ type: 'insert_text', text: 't' })
|
||||
editor.exec({ type: 'insert_text', text: 'w' })
|
||||
editor.exec({ type: 'insert_text', text: 'o' })
|
||||
editor.insertText('t')
|
||||
editor.insertText('w')
|
||||
editor.insertText('o')
|
||||
}
|
||||
|
||||
export const input = (
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Editor } from 'slate'
|
||||
import { Transforms } from 'slate'
|
||||
import { jsx } from '../..'
|
||||
|
||||
export const run = editor => {
|
||||
editor.exec({ type: 'insert_text', text: 't' })
|
||||
Editor.move(editor, { reverse: true })
|
||||
editor.exec({ type: 'insert_text', text: 'w' })
|
||||
Editor.move(editor, { reverse: true })
|
||||
editor.exec({ type: 'insert_text', text: 'o' })
|
||||
editor.insertText('t')
|
||||
Transforms.move(editor, { reverse: true })
|
||||
editor.insertText('w')
|
||||
Transforms.move(editor, { reverse: true })
|
||||
editor.insertText('o')
|
||||
}
|
||||
|
||||
export const input = (
|
||||
|
Reference in New Issue
Block a user