import Tools from "../../lib/Tools"; import { injectable } from "inversify"; import { Commands } from "wax-prosemirror-utilities"; @injectable() export default class Heading2 extends Tools { title = "Change to heading level 2"; content = "Heading 2"; get run() { return (state, dispatch) => { Commands.setBlockType(state.config.schema.nodes.heading, { level: 2 })( state, dispatch ); }; } get enable() { return state => { return Commands.setBlockType(state.config.schema.nodes.heading, { level: 2 })(state); }; } }