import { NodeType } from 'prosemirror-model' ; import { EditorState , Transaction } from 'prosemirror-state' ; import { Command , lift , wrapIn } from 'prosemirror-commands' ; import { isNodeActive } from 'ngx-editor/helpers' ; class Blockqote { toggle ( ) { return ( state , dispatch ? ) : boolean => { const { schema } = state ; const type = schema . nodes . blockquote ; if ( ! type ) { return false ; } if ( this . isActive ( state ) ) { return lift ( state , dispatch ) ; } return wrapIn ( type ) ( state , dispatch ) ; } ; } isActive ( state ) { const { schema } = state ; const type = schema . nodes . blockquote ; if ( ! type ) { return false ; } return isNodeActive ( state , type ) ; } canExecute ( state ) { return this . toggle ( ) ( state ) ; } } export default Blockqote ;