some fixes
This commit is contained in:
@@ -9,7 +9,7 @@ declare module '../Editor' {
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor, emitUpdate = false): ClearContent => emitUpdate => {
|
||||
export default (next: Function, editor: Editor): ClearContent => (emitUpdate = false) => {
|
||||
editor.setContent('', emitUpdate)
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function resolveSelection(editor: Editor, position: Position = null): ResolvedSe
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor, position: Position = null): Focus => async () => {
|
||||
export default (next: Function, editor: Editor): Focus => async (position = null) => {
|
||||
const { view, state } = editor
|
||||
|
||||
if ((view.hasFocus() && position === null)) {
|
||||
|
||||
@@ -10,7 +10,7 @@ declare module '../Editor' {
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor, value: string): InsertHTML => () => {
|
||||
export default (next: Function, editor: Editor): InsertHTML => value => {
|
||||
const { view, state } = editor
|
||||
const { selection } = state
|
||||
const element = elementFromString(value)
|
||||
|
||||
@@ -8,7 +8,7 @@ declare module '../Editor' {
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor, value: string): InsertText => () => {
|
||||
export default (next: Function, editor: Editor): InsertText => value => {
|
||||
const { view, state } = editor
|
||||
const transaction = state.tr.insertText(value)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ declare module '../Editor' {
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor): SetContent => (content, emitUpdate, parseOptions) => {
|
||||
export default (next: Function, editor: Editor): SetContent => (content, emitUpdate = false, parseOptions = {}) => {
|
||||
if (content === null) {
|
||||
next()
|
||||
return
|
||||
|
||||
@@ -21,10 +21,9 @@ export default (next: Function, editor: Editor): ToggleBlockType => (type, toggl
|
||||
|
||||
if (isActive) {
|
||||
setBlockType(toggleType)(view.state, view.dispatch)
|
||||
next()
|
||||
return
|
||||
} else {
|
||||
setBlockType(type, attrs)(view.state, view.dispatch)
|
||||
}
|
||||
|
||||
setBlockType(type, attrs)(view.state, view.dispatch)
|
||||
next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user