replace toggleBlockType with toggleNode(
This commit is contained in:
@@ -6,7 +6,7 @@ import getNodeType from '../utils/getNodeType'
|
||||
/**
|
||||
* Toggle a node with another node.
|
||||
*/
|
||||
export const toggleBlockType = (typeOrName: string | NodeType, toggleTypeOrName: string | NodeType, attrs = {}): Command => ({ state, commands }) => {
|
||||
export const toggleNode = (typeOrName: string | NodeType, toggleTypeOrName: string | NodeType, attrs = {}): Command => ({ state, commands }) => {
|
||||
const type = getNodeType(typeOrName, state.schema)
|
||||
const toggleType = getNodeType(toggleTypeOrName, state.schema)
|
||||
const isActive = nodeIsActive(state, type, attrs)
|
||||
@@ -21,9 +21,9 @@ import * as setNode from '../commands/setNode'
|
||||
import * as sinkListItem from '../commands/sinkListItem'
|
||||
import * as splitBlock from '../commands/splitBlock'
|
||||
import * as splitListItem from '../commands/splitListItem'
|
||||
import * as toggleBlockType from '../commands/toggleBlockType'
|
||||
import * as toggleList from '../commands/toggleList'
|
||||
import * as toggleMark from '../commands/toggleMark'
|
||||
import * as toggleNode from '../commands/toggleNode'
|
||||
import * as toggleWrap from '../commands/toggleWrap'
|
||||
import * as unsetMark from '../commands/unsetMark'
|
||||
import * as unsetMarks from '../commands/unsetMarks'
|
||||
@@ -56,9 +56,9 @@ export const Commands = Extension.create({
|
||||
...sinkListItem,
|
||||
...splitBlock,
|
||||
...splitListItem,
|
||||
...toggleBlockType,
|
||||
...toggleList,
|
||||
...toggleMark,
|
||||
...toggleNode,
|
||||
...toggleWrap,
|
||||
...unsetMark,
|
||||
...unsetMarks,
|
||||
|
||||
Reference in New Issue
Block a user