* Fix (tasks): Toggle dropdown on re-click and narrow mark decoration range
- Clicking the dropdown icon now dismisses the completion menu if it
is already open (`closeCompletion`).
- The `data-task-state` mark decoration now covers only the inner state
text (excluding brackets). This prevents CodeMirror cursor/editing
issues when the caret is inside the brackets and allows bracket-aware
CSS styling. Example:
```space-style
[data-task-state="DONE"] { color: green; }
[data-task-state="PLANNED"] { color: orange; }
[data-task-state] { font-weight: bold; }
```
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
* Refactor (tasks): Unify task state data attribute to `data-task-state`
Rename `data-state` to `data-task-state` on extended task state spans in
Markdown renderer and update the corresponding places.
Previously the editor (CodeMirror mark decoration) used
`data-task-state` while the widget HTML renderer used `data-state`,
requiring duplicate CSS selectors. Now a single attribute selector works
everywhere (for example tasks rendered using `template.taskItem` also
follow the styling now):
```css
[data-task-state="PLANNED"] { /* cool CSS here */; }
```
Note: Checkbox inputs (`[ ]`/`[x]`/`[X]`) still use `data-state` since
they follow a different code path.
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
---------
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>