This adjusts markup color slightly for the dark display, makes it fully
opaque, alternates the squiggly line between grammar and spelling
mistakes to visualize one-word-two-mistake-types, paints most important
mistakes last/on top etc.
All to make the markup as visible as possible.
The new name reflects the purpose of the panel better:
- panelParent → correctionPanel: This is our (0, 0) positioned <div>
inside which most of the magic happens. We do need it to be able to
position it's child properly.
- correctionPanel → scrollPanel: This is a <div> which size and
placement should exactly match the hostElement. We need it to provide
a scrollable (hence the name) viewport for our canvas.
Refactor the click detection logic to check if the click was inside the rectangle of the highlight element, rather than relying on stored rectangle coordinates.
Additionally, this update eliminates the need to attach event listeners to the entire window or the parent elements of the host element, simplifying the event handling and potentially improving performance.
This commit introduces the BesTAService class, which is designed to register a grammar checking service for textarea elements. The core logic has been written, although the class is not yet fully functional.