This type of interaction seem to be working from a model that treats the document as a flat list of textblocks, each of which can have a list style associated with them. That’s not how ProseMirror works, as I’m sure you noticed—lists involve a single parent node for the entire list, sub-lists are children of the outer list node, and so on. As such, this kind of toggling command introduces a bunch of dubious corner cases that the built-in list manipulation commands intentionally avoid dealing with.
-
What happens if your range of selected blocks spans the start/end of some other node (say, a blockquote)
-
What happens if some of the blocks are nested list items?
-
Should lists created this way always automatically be joined to adjacent lists?
It’s probably possible to write something more or less reasonable that covers the use cases you have in mind, but you’ll have to precisely formulate it in terms of ProseMirror’s document model first, before you start implementing.