Hey, sorry for taking long to answer. I've been doing a lot of investigation on this, trying to figure out how it could work.
First, as far as I can tell, displaying a TinyMCE editor in a popup with a plugin seems nearly impossible. I think all the logic from TinyMCE.tsx would have to reimplemented. I haven't found any good alternative to that.
The markdown editor is closer to the realm of possibility. I did manage to get a proof of concept to work, but it's kinda hacky. (here's a gist with the plugin files for anyone interested)
The idea is to just require in the CodeMirror/Editor.tsx along with react and mount it. This can only be done from windows which have a url coming from the joplin package, so just having an html file bundled with the plugin and opening that won't wort. But the window used for sandboxing the plugin is perfectly suitable, requiring from there works fine, it's just hidden by default. So the plugin can just call window.open to open another instance of itself and then in that window we can mount the editor.
Getting the editor's settings is another hack: I registered a CodeMirror content script, which patches the CodeMirror object and sends all the settings to the plugin. Plugins could be supported by sending a list of callbacks registered on the CM object and when one of them is needed in the popup the call could be relayed by the patching plugin.
So yeah, I kind of underestimated the difficulty of this idea and I understand why you don't think it's suitable for gsoc. Nevertheless I learned a lot investigating this.
1 Like