Closed mqtik closed 1 week ago
@talyguryn
I have a proof of concept for this, built on the nested-list addon. Is it worth submitting it as a pull request, or better to release as an unofficial block?
https://user-images.githubusercontent.com/1183991/162813240-482109a5-97f4-42df-87ad-4aa8226f3359.mp4
Calum
firstly i think checklist should look the same as editor-js/checklist
may be we need to use nested-list
's code as base logic and implement there an updated method for creating an item. also need to add click listener for checkbox and there it is — nested-checklist
I updated the styling (not perfect yet, but getting closer)
I added "None" Style, so we can represent None | Unordered | Ordered
The "Checked" paramerter is currently boolen, with the option of being "null", to allow for three states. This is a bit of an odd way to store, but i did it to reflect the way that remark-gfm imports markdown lists, as for me this is part of a larger project.
I could change it to be represented as an int : -1 = None, 0 = False, 1 = True;
The data is exported as follows
Field | Type | Description |
---|---|---|
style | string |
type of a list: ordered or unordered or none |
items | Item[] |
the array of list's items |
Item
:Field | Type | Description |
---|---|---|
content | string |
item's string content |
checked | Boolean |
Item is checked : true or false or null |
items | Item[] |
the array of list's items |
I will upload a test repo soon.
I published here :
The list is amazing. It would be really nice to do a module with nested checklists