Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested checklist support #11

Closed
mqtik opened this issue Mar 20, 2021 · 4 comments · Fixed by #104
Closed

Nested checklist support #11

mqtik opened this issue Mar 20, 2021 · 4 comments · Fixed by #104

Comments

@mqtik
Copy link

mqtik commented Mar 20, 2021

The list is amazing. It would be really nice to do a module with nested checklists

@calumk
Copy link

calumk commented Apr 11, 2022

@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?

example2.mp4

Calum

@talyguryn
Copy link
Member

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

@calumk
Copy link

calumk commented Apr 12, 2022

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

Output data

Field Type Description
style string type of a list: ordered or unordered or none
items Item[] the array of list's items

Object 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

Screenshot 2022-04-12 at 07 40 28

I will upload a test repo soon.

@calumk
Copy link

calumk commented Apr 19, 2022

I published here :

@calumk/editorjs-nested-checklist

@e11sy e11sy mentioned this issue Nov 3, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants