This post is aimed at @marijn but I wanted to forum it because I think it merits discussion.
A while ago (as I mentioned on this forum) I had to hijack one of the “Enter” commands so that I could have nodes inherit classes from their predecessors (such that text would continue to be aligned left/right/center based on the previous line of text). At the time, we weren’t sure how client developers could get around this kind of problem (the nature of a WYSIWYM library makes life tough on that front). I speculated event-hook callbacks that you feed into commands; but maybe that’s over-complicating things. I think I have a solution because I’m kind of in the same boat once again (I have some very specific behaviour involving splitting lists that I just can’t get right without essentially rewriting splitListItem).
I think the library really needs some more complex transaction structures. because of how transactions currently work (if I’ve read your code correctly and based on various chain experiments), once I’ve called dispatch the window of opportunity to perform actions is shut.
The solution, as I see it, would be to have a series of prototypically inherited transaction methods that behave like commands.
This would greatly increase the power and modularity of the library in my eyes and make for a much more versatile platform from which to develop frameworks and so on.
I’ll give a more detailed example once I’ve got a working demo of my design.
for my part I’d be happy to fork ProseMirror once I’ve got a few useful things together!