2020-11-18 23:43:27 +08:00
|
|
|
import { selectParentNode as originalSelectParentNode } from 'prosemirror-commands'
|
2021-02-10 16:59:35 +08:00
|
|
|
import { Command, Commands } from '../types'
|
2020-11-05 05:38:52 +08:00
|
|
|
|
2021-02-10 16:59:35 +08:00
|
|
|
declare module '@tiptap/core' {
|
|
|
|
interface Commands {
|
2021-02-11 01:05:02 +08:00
|
|
|
/**
|
|
|
|
* Select the parent node.
|
|
|
|
*/
|
2021-02-10 16:59:35 +08:00
|
|
|
selectParentNode: () => Command,
|
|
|
|
}
|
|
|
|
}
|
2021-02-11 01:05:02 +08:00
|
|
|
|
|
|
|
export const selectParentNode: Commands['selectParentNode'] = () => ({ state, dispatch }) => {
|
|
|
|
return originalSelectParentNode(state, dispatch)
|
|
|
|
}
|