Skip to content

Commit

Permalink
updated readme and images
Browse files Browse the repository at this point in the history
  • Loading branch information
e11sy committed Nov 2, 2024
1 parent b4b624c commit 8983b11
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 9 deletions.
154 changes: 145 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,53 +51,189 @@ var editor = EditorJS({

| Field | Type | Description |
|--------------|----------|----------------------------------------------------------------|
| defaultStyle | `string` | default list style: `ordered` or `unordered`, default is `unordered` |
| defaultStyle | `string` | default list style: `ordered`, `unordered` or `checklist`, default is `unordered` |

## Tool's settings
## Default list params

![](assets/bf5a42e4-1350-499d-a728-493b0fcaeda4.jpg)
| Field | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------|
| style | `string` | list will be rendered with this style: `ordered`, `unordered` or `checklist`, default is `defaultStyle` from tool config |

You can choose list`s type.
This params are supported in Ordered List and Checklist

## Output data
## Ordered list params

| Field | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------|
| start | `number` | list will start with this number, default is `1` |
| maxLevel | `number` | maximum level of the list nesting, could be set to `1` to disable nesting, unlimited by default |
| counterType | `string` | type of the counters: `numeric`, `lower-roman`, `upper-roman`, `lower-alpha`, `upper-alpha`, default is `numeric` |


## Default Tool's settings

![](assets/default_toolbox_demo.jpg)

- You can choose list`s type.

## Ordered list Tool's settings

![](assets/ordered_toolbox_demo.jpg)

- You can choose the number for list to start from.
- You can choose type of the counters.


## Default Output data

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

Object `Item`:
This is outputData o

Object `ItemMeta` for Checklist:

| Field | Type | Description |
| ------- | --------- | ------------------------- |
| content | `string` | item's string content |
| items | `Item[]` | the array of list's items |
| checked | `boolean` | state of the checkbox |

Object `ItemMeta` for Ordered and Unordered lists would be empty.

Object `Item`:

| Field | Type | Description |
| ------- | --------- | ------------------------- |
| content | `string` | item's string content |
| meta | `ItemMeta`| meta information about item |
| items | `Item[]` | the array of list's items |



## Example of the content for `Unordered List`
```json
{
"type" : "list",
"data" : {
"style": "unordered",
"maxLevel": 1,
"items": [
{
"content": "Apples",
"meta": {},
"items": [
{
"content": "Red",
"meta": {},
"items": []
},
{
"content": "Green",
"meta": {},
"items": []
},
]
},
{
"content": "Bananas",
"meta": {},
"items": [
{
"content": "Yellow",
"meta": {},
"items": []
},
]
},
]
}
},
```

## Example of the content for `Ordered List`
```json
{
"type" : "list",
"data" : {
"style": "ordered",
"start": 2,
"counterType": "upper-roman",
"maxLevel": 4,
"items" : [
{
"content": "Apples",
"meta": {},
"items": [
{
"content": "Red",
"meta": {},
"items": []
},
{
"content": "Green",
"meta": {},
"items": []
},
]
},
{
"content": "Bananas",
"meta": {},
"items": [
{
"content": "Yellow",
"meta": {},
"items": []
},
]
},
]
}
},
```

## Example of the content for `Checklist`
```json
{
"type" : "list",
"data" : {
"style" : "unordered",
"style": "checklist",
"maxLevel": 4,
"items" : [
{
"content": "Apples",
"meta": {
"checked": false
},
"items": [
{
"content": "Red",
"meta": {
"checked": true
},
"items": []
},
{
"content": "Green",
"meta": {
"checked": false
},
"items": []
},
]
},
{
"content": "Bananas",
"meta": {
"checked": true
},
"items": [
{
"content": "Yellow",
"meta": {
"checked": true
},
"items": []
},
]
Expand Down
Binary file removed assets/bf5a42e4-1350-499d-a728-493b0fcaeda4.jpg
Binary file not shown.
Binary file added assets/default_toolbox_demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ordered_toolbox_demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8983b11

Please sign in to comment.