Event for listening to changes to a code/markdown cell's input area?

I’m working on a change that adds a cell toolbar inside each cell in JupyterLab — you can see a work-in-progress pull request here: PR 12028

One concern I have is how to listen to changes in the code/markdown cell as they are made. I’d like to be able to detect when the code overlaps with the toolbar so that I can get the toolbar out of the way. Currently I do this once when the user focuses on a cell, but I’d like to do this with every change, large (e.g., a paste) or small (e.g., a keystroke) to the cell’s input area.

Which events should I be attaching to so that I can keep the cell toolbar from overlapping with the input area?

Thanks for your help!