How to create binding for TinyMCE?

I see that there exists already bindings for multiple WYSIWYG editors but TinyMCE doesn’t yet have binding.

What kind of events the TinyMCE would be able to emit for implementing collaboration with Yjs with good performance? For example, it has events for any change to the content and any change to caret position or selection. Is that enough? Would the TinyMCE need to be able to compute change deltas or is it okay to just have the final content and caret position / selection after whatever change TinyMCE has internally made?

How about undo/redo? Should Yjs binding override the native redo/undo feature of TinyMCE?

1 Like

I’m looking into this as well now. Are there any updates?

A Yjs binding for TinyMCE would be awesome. I was researching this topic a bit, and it is definitely possible. You could have a look at the TinyMCE collab extension and check how they do it. TinyMCE represents data in something similar to the Y.Text type. There were a lot of companies approaching me about that. However, I don’t think it’s worth paying me, as using the existing (proprietary) service is definitely cheaper.

Would the TinyMCE need to be able to compute change deltas or is it okay to just have the final content and caret position / selection after whatever change TinyMCE has internally made?

It makes more sense to apply only the differences and not always replace the complete state. Otherwise, concurrent edits won’t be synced.

As time goes by, we might eventually add support for TinyMCE. But it’s not a priority right now. If there is a company that wants to make a significant investment to add support for TinyMCE (and finance maintenance), I’d find somebody to implement this and maintain it in the future.

Oh, and if anyone else wants to implement this: I’m happy to give input when you have concrete questions.

1 Like