0.0.12 • Published 1 year ago
@kalebu2468/editor-subpoints v0.0.12
Heading Tool
Provides SubPoints Blocks for the Editor.js.
Installation
Get the package
yarn add @kalebu2468/editorjs-subpointsInclude module at your application
import SubPoint from "@kalebu2468/editorjs-subpoints";Usage
Add a new Tool to the tools property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
subpoints: SubPoints,
},
...
});Shortcut
You can insert this Block by a useful shortcut. Set it up with the tools[].shortcut property of the Editor's initial config.
var editor = EditorJS({
...
tools: {
...
subpoints: {
class: SubPoints,
},
},
...
});Config Params
All properties are optional.
| Field | Type | Description |
|---|---|---|
| placeholder | string | subpoint's placeholder string |
| levels | number[] | enabled subpoint levels |
| defaultLevel | number | default subpoint level |
var editor = EditorJS({
...
tools: {
...
subpoints: {
class: SubPoints,
config: {
placeholder: 'Enter a subpoint',
levels: [4],
defaultLevel: 4
}
}
}
...
});Tool's settings

You can select one of six levels for heading.
Output data
| Field | Type | Description |
|---|---|---|
| text | string | subpoint's text |
| level | number | level of subpoint |
{
"type": "subpoints",
"data": {
"text": "Why Telegram is the best messenger",
"level": 4
}
}