* Ported from #1046:
* disabling buttons will clear button highlight
* enabling button will set button highlight
* move caret to end executed before enabling buttons (so button highlight will be for actual position of caret)
* move caret to end will also be executed if previousActiveElement is null, which will only be the case before the first onBlur was executed:
* so that caret will be moved to end on opening editor
- using :host-context(.nightMode) allows for applying the nightmode
scroll bar inside the component
- apply max-width: 100% to all element within editable, not just images
1. Clicking away from the editor window, and back on it should not focus old field
2. Clicking on a field, which is not fully visible, should scroll it into view
This is to provide minimal closures for the mutable file-local variables:
- changeTimer
- previousActiveElement
- currentNoteId
This makes it clear, that they should not be used, but rather the
functions which wrap them in an API