Hmmm, ProseMirror has changed recently how it sets up the commands. Assuming you have something like makeHeading1 where you can execute it using makeHeading1.run(pm). You can then do makeHeading1.active(pm) to determine if it is active. I do this on all of my paragraph/heading commands to find the currently active one.
I’m not using the ‘menuitem’ and related helper, since I already had my toolbar before migrating to prosemirror. Is there a way to do it without using the menu related stuff?
@erwanl, yes, check at menu/menu.js how the the menuitems are implemented, than you can do it the same way in your own menubar. I am planning to do that myself next.
You can resolve the cursor position, and check, depending on the kind of node you’re interested in, either its direct parent, or all of its ancestor nodes. How you treat selections that span multiple blocks is up to you.