restructure commands
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { lift } from 'prosemirror-commands'
|
||||
import { lift as originalLift } from 'prosemirror-commands'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
|
||||
export default (typeOrName: string | NodeType, attributes = {}): Command => ({ state, dispatch }) => {
|
||||
/**
|
||||
* Removes an existing wrap.
|
||||
*/
|
||||
export const lift = (typeOrName: string | NodeType, attributes = {}): Command => ({ state, dispatch }) => {
|
||||
const type = getNodeType(typeOrName, state.schema)
|
||||
const isActive = nodeIsActive(state, type, attributes)
|
||||
|
||||
@@ -12,5 +15,5 @@ export default (typeOrName: string | NodeType, attributes = {}): Command => ({ s
|
||||
return false
|
||||
}
|
||||
|
||||
return lift(state, dispatch)
|
||||
return originalLift(state, dispatch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user