-
Notifications
You must be signed in to change notification settings - Fork 60
Feature/disable tool elements #122
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
base: main
Are you sure you want to change the base?
Conversation
src/index.ts
Outdated
| ]; | ||
|
|
||
| return this.displayedEntries ? entries.filter( | ||
| ele => this.displayedEntries?.includes(ele.data.style as ListDataStyle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improve naming please
src/index.ts
Outdated
| /** | ||
| * | ||
| */ | ||
| private static displayedEntries?: ListDataStyle[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments missing
src/index.ts
Outdated
| if (EditorjsList.displayedEntries){ | ||
| if (this.listStyle === 'ordered') this.addAdditionalTunes(defaultTunes); | ||
| } else if (this.listStyle === 'ordered') this.addAdditionalTunes(defaultTunes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to check for EditorjsList.displayedEntries here
src/index.ts
Outdated
| }, | ||
| ]; | ||
|
|
||
| return this.displayedEntries ? entries.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot access this.displayedEntries since it is static
src/index.ts
Outdated
| tune => { | ||
| if ('title' in tune) { | ||
| if(tune.title === 'Start with' || tune.title === 'Counter type') return true; | ||
| else return EditorjsList.displayedEntries?.includes(tune.title!.toLowerCase() as ListDataStyle); | ||
| } else if (('type' in tune) && tune.type === 'separator') return true; | ||
| } | ||
| ) : defaultTunes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can firstly filter default tunes, and then add additional ones, then you won't need to check for Start with and Counter type in tunes
README.md
Outdated
| |--------------|----------|----------------------------------------------------------------| | ||
| | defaultStyle | `string` | default list style: `ordered`, `unordered` or `checklist`, default is `unordered` | | ||
| | maxLevel | `number` | maximum level of the list nesting, could be set to `1` to disable nesting, unlimited by default | | ||
| | displayedEntries | `listStyle[]` | List entries allowed to be displayed `ordered`, `unordered` or `checklist` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets call it styles?
|
Hi. |
|
I just wanted to express my support for this feature. The ability to disable checklists would be incredibly helpful for my workflow as well. I'm eagerly looking forward to its implementation. Thank you all for your hard work on this! |
|
I'm excited for this. We want to hide the checklist pretty bad. |
|
Can someone please merge this pull request? This feature would be really useful |
e11sy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems ok, can you fix eslint and resolve conflicts please?
overall, you did a nice job, feature close to be merged
|
Is this going to be merged? Really keen to be able to hide checklist since we're using this for emails and checkilists dont make sense there |
|
We also use Editor.js for emails and checklists don't make sense there |
Closes #119