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)
|
editor.setContent('', emitUpdate)
|
||||||
next()
|
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
|
const { view, state } = editor
|
||||||
|
|
||||||
if ((view.hasFocus() && position === null)) {
|
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 { view, state } = editor
|
||||||
const { selection } = state
|
const { selection } = state
|
||||||
const element = elementFromString(value)
|
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 { view, state } = editor
|
||||||
const transaction = state.tr.insertText(value)
|
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) {
|
if (content === null) {
|
||||||
next()
|
next()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ export default (next: Function, editor: Editor): ToggleBlockType => (type, toggl
|
|||||||
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
setBlockType(toggleType)(view.state, view.dispatch)
|
setBlockType(toggleType)(view.state, view.dispatch)
|
||||||
next()
|
} else {
|
||||||
return
|
setBlockType(type, attrs)(view.state, view.dispatch)
|
||||||
}
|
}
|
||||||
|
|
||||||
setBlockType(type, attrs)(view.state, view.dispatch)
|
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user