How correctly to insert auxiliary custom tools in the ProseMirror?

Hi, guys!

  1. I use the ProseMirror in my Vue project.
  2. I have auxiliary custom tools in my editor, by the type of menu that appears when text is selected.

My first question:
What is the correct way to insert, for example, an emerging menu into the editor? Right now I build tools around editor by using vue components, It works correctly but I know about the ProseMirror decorations, widgets, I’m curious if this path is fundamentally wrong?

My second question:
I asked my first question because now I need to make a top-level drag handle element for dnd. Do I have to necessarily insert this element into the draggable node? Or is it possible only by using the ProseMirror decorations?
The core realisation of dnd in the ProseMirror works with the selection by the mouse but I need to “select” a node fully by start of dragging by the node handle element. How to make so the behaviour?

up :face_holding_back_tears:

@marijn Maybe you could find some time for me. I’ll be really grateful to you

Please don’t ‘bump’ your topic. If anything, it makes me less likely to make time for you.

As for how to add a menu, an overlay over the editor DOM is usually a great way to do that. Inserting stuff into the content can trigger contenteditable bugs and add complications, so if there’s no reason you need to do it, then overlays are often preferable.

Drag handles should generally be part of the node that’s being dragged, yes. You’ll often need to do some clever stuff in an ignoreEvent method to make sure the dragging that uses the handle goes through to the editor.

Thanks for reply! And sorry, I wont bump anymore