Best way to create a medium like editor built on ProseMirror

I am looking for a way to create a medium style like editor. Currently I have stripped down a lot, but now comes the hard part.

  • Where do I catch an enter or a new paragraph, so I can show a plus on that position near the editor. Clicking this plus button should open a menu on which one can select a h1, h2, h3 etc… also how do I get these coords?

  • When selecting text, how do I get the coords to show a menu to mark the text or update the node type.