This MR implements the results of our discussions on working with annotation ids/ target ids and selectors.
Previously the annotations feature relied only on target.id
string. The connection with the text was in the end made by 'getElementbyId` in the simple case. Since the idea behind the Annotation API is to keep the content separated from the annotation object, we would "misuse" that feature by hardcoing and id selector into TIDO.
So the solution could be to mostly rely on selectors. In the Annotation API there is a target.selector
object which is already used in TIDO. So we now use the selector object as a central interaction point. To track down the active/inactive state of annotations we now use annotation.id
s instead of target.id
s.
This also prepares the code for having a text selection feature coming up next (#365 (closed)).
closes #372 (closed)