diff --git a/README.md b/README.md index e99b17a..df5a9fd 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,6 @@ # Editorjs List Tool -Multi-leveled lists for the [Editor.js](https://editorjs.io). - -Use `Tab` and `Shift+Tab` keys to create or remove sublist with a padding. - -![](assets/example.gif) - -## Features - - 🤩 Part of [Editor.js](https://editorjs.io/) ecosystem. - 📂 Nesting. - 🔥 Ordered and Unordered lists. @@ -19,6 +11,11 @@ Use `Tab` and `Shift+Tab` keys to create or remove sublist with a padding. - 🪜 Max nesting level configuration. - 📝 Compatible with [List](https://github.com/editor-js/list) and [Checklist](https://github.com/editor-js/checklist). + +![](assets/example.gif) + +Use `Tab` and `Shift+Tab` keys to create or remove sublist with a padding. + ## Installation Get the package @@ -67,12 +64,11 @@ var editor = EditorJS({ ## Output data -| Field | Type | Description | List type | -| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -| style | `string` | list will be rendered with this style: `ordered`, `unordered` or `checklist`, default is `defaultStyle` from tool config | `ordered`, `unordered`, `checklist` | -| start | `number` | list will start with this number, default is `1` | `ordered` | -| counterType | `number` | type of the counters: `numeric`, `lower-roman`, `upper-roman`, `lower-alpha`, `upper-alpha`, default is `numeric` | `ordered` | -| items | `Item[]` | the array of list's items | `ordered`, `unordered`, `checklist` | +| Field | Type | Description | +| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | +| style | `string` | list will be rendered with this style: `ordered`, `unordered` or `checklist`, default is `defaultStyle` from tool config | +| meta | `ItemMeta`| Item meta based on the list style | +| items | `Item[]` | the array of list's items | Object `Item`: @@ -88,7 +84,15 @@ Object `ItemMeta` for Checklist: | ------- | --------- | ------------------------- | | checked | `boolean` | state of the checkbox | -Object `ItemMeta` for Ordered and Unordered lists would be empty. +Object `ItemMeta` for Ordered list + +| Field | Type | Description | +| ------- | --------- | ------------------------- | +| start | `number` | number for list to start with, default is 1 | +| counterType | `string` | counter type for list, it could be `numeric`, `lower-roman`, `upper-roman`, `lower-alpha`, `upper-alpha`, default is `numeric` | + + +Object `ItemMeta` for Unordered list would be empty. ## Example of the content for `Unordered List` @@ -97,7 +101,6 @@ Object `ItemMeta` for Ordered and Unordered lists would be empty. "type" : "list", "data" : { "style": "unordered", - "maxLevel": 1, "items": [ { "content": "Apples", @@ -121,9 +124,10 @@ Object `ItemMeta` for Ordered and Unordered lists would be empty. "type" : "list", "data" : { "style": "ordered", - "start": 2, - "counterType": "upper-roman", - "maxLevel": 4, + "meta": { + "start": 2, + "counterType": "upper-roman", + }, "items" : [ { "content": "Apples", @@ -147,7 +151,6 @@ Object `ItemMeta` for Ordered and Unordered lists would be empty. "type" : "list", "data" : { "style": "checklist", - "maxLevel": 4, "items" : [ { "content": "Apples", diff --git a/example/example.html b/example/example.html deleted file mode 100644 index 6f6f363..0000000 --- a/example/example.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - Editor.js 🤩🧦🤨 example - - - - - - -
-
- - - -
-
-
- -
- editor.save() -
- -
- Readonly: - - Off - -
- toggle -
-
-
-
-

-
-      
-    
-
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/assets/codex2x.png b/playground/assets/codex2x.png similarity index 100% rename from example/assets/codex2x.png rename to playground/assets/codex2x.png diff --git a/example/assets/demo.css b/playground/assets/demo.css similarity index 100% rename from example/assets/demo.css rename to playground/assets/demo.css diff --git a/example/assets/json-preview.js b/playground/assets/json-preview.js similarity index 100% rename from example/assets/json-preview.js rename to playground/assets/json-preview.js diff --git a/index.html b/playground/index.html similarity index 96% rename from index.html rename to playground/index.html index 3d949a1..c33e701 100644 --- a/index.html +++ b/playground/index.html @@ -4,8 +4,8 @@ Editor.js 🤩🧦🤨 example - - + + @@ -62,7 +62,7 @@