In attachments and richtext-tinymce
I have implemented something similar to what we have done on LEARN: a generic UI that does not rely on the specific editor API, integrated via a trivial plugin in the editor package.
I have used some of the api from the previous implementation, but to keep the interface "editor agnostic", I could not use any of the "CKEditor tech".
If you have a look at the plugin code for tinymce, there is actually very little going on: it opens an iframe to the attachments page and waits until the iframe sends a message containing the content we are supposed to inject on the page. I expect this to be possible In a very similar way for other editors, e.g. ckeditor5.
To test it, install the latest richtext-tinymce, then in the site-wide DefaultConfig parameter input something like like:
relative_urls "false"
menu "{insert: { title: 'Insert', items: 'oacsAttachments | charmap hr' }}"
external_plugins {{oacsAttachments: '/resources/richtext-tinymce/plugins/oacsAttachments.js'}}
plugins "oacsAttachments"
toolbar "blocks fontsize | bold italic underline strikethrough forecolor backcolor subscript superscript | link unlink anchor | oacsAttachments | alignleft aligncenter alignright alignjustify numlist bullist | removeformat table hr tlfMathJax | fullscreen code"
(the important is to load the plugin and make it part of menu, toolbar or both somehow)
Let me know if this goes in the right direction.
Ciao
Antonio