Insert HTML snippets to prosemirror document

My plan is to build a library of HTML blocks that are compatible with prosemirrors nodes (text/links already imported into the Schema).

However I would like to have this library outside of prosemirror in some react components as they need preview functionality and many more things - like a database to store them.

From this component I would like to insert the selected HTML block as node to the cursor position of prosemirror - at best at the end of the cursor positions node - perhaps as read only node that can not be edited but only deleted.

Are there any examples I could follow (codesandbox did not show any results)? My first bet is to write a command and trigger it from outside of prosemirror.

If someone could point me, I would be quite thankful!

The approach would basically be to create a node type—either for a specific type of HTML element or as a generic HTML blob node that has its content in an attribute. Its toDOM would render the appropriate HTML, with an extra attribute or something that you can match in parseDOM rules.

I undestand the node definitions of a schema - but how could one trigger the insertion of such a node at the cursor from a component surrounding the editor? Is there maybe some code example to find? Thanks