Menu bar controll over multiple editors

Hello Prosemirror community :blush: I’m researching whether it is possible to create multiple text nodes which can be binded to one single menubar? Has this been done before?

Thank you for reading.

Could you share more details on what you’re aiming to achieve, I think we’d have a better idea of how to help if you described what you mean by “menubar” and “binding”. Could you share info about the problem you’re solving or the experience you’re trying to create?

Cheers!

Reading a second time, I have an idea that you might be trying to use one set of buttons for many different editor instances. Is that what you’re asking about?

If so, you should be able to simply apply the commands based on the currently focused editor. With some commands like “insert new block”, you’ll have to define the experience you’re aiming for.

For example, if the user has no focus in any editor, should you just hide that button? Or should you default to inserting into the last focused editor? Or the last editor in a list? etc.

Sorry Colel for being unclear I’m coming from tiptap so my terminology is sort of off. But I’m building a a page with two text nodes for user input, and I would like to have one central menubar that can affect both nodes. For example: ability to make text bold in both nodes.

Hope this makes more sense. Do you have any sort of direction I could take a look at? :slight_smile:

As far as limitations go, ProseMirror’s interfaces (even through tiptap) should support what you’re describing.

The tricky part might be history management, though. I have little experience managing history at this point, so I can’t comment further, there.

I would define your menubar buttons in vue, and then make calls through tiptap’s interface to ProseMirror.

Thank you very much! As far I understand prosemirror, to implement this functionality I should look at the prosemirror-view module?

Generally, when diving into prosemirror anything, the best place to start is at the top of the library guide which gives a strong overview of the different components of prosemirror in a concise way.

https://prosemirror.net/docs/guide/

As you start digging, you may want to look into how commands are implemented so you can wire up your buttons to simply send commands to all editors.

https://prosemirror.net/docs/guide/#commands

Good luck!

Thanks very much Colel for your help. :kissing_smiling_eyes: