I've been diving into #LexicalJS recently which is Meta's new-ish open source #Editor framework for building #RichText (or plaintext if that's your jam) editing experiences.
Here's an interesting talk from one of the core team covering it's design philosophy: