Access node-view instance

Is there a way to get at a node view instance from outside? e.g. pass in an editor and a pos, get back the instance?

e.g. I’d like to call a node view method from my editor.handleDrop.

I realise I could dispatch a transaction and set a decoration or something like that, but this is just for a bit of ephemeral UI stuff and calling a method on the node view feels like a nice light weight way to do that.


I know prosemirror-view internally has this:

There’s also prosemirror-view/viewdesc.ts at 2f9753dc5331cf5ee6852fcaa5a9a857463506f3 · ProseMirror/prosemirror-view · GitHub

No, this does not exist. I guess you could use a web component and add methods to the HTML element itself, or similar tricks, but ProseMirror treats node views as being directly derived from the document and decorations, and doesn’t allow direct manipulation.