@kalebu2468/editorjs-points
v0.0.16
Published
Point Tool for Editor.js
Maintainers
Readme
Point Tool
Provides Points Blocks for the Editor.js.
Installation
Get the package
yarn add @kalebu2468/editorjs-pointsInclude module at your application
import Point from "@kalebu2468/editorjs-points";Optionally, you can load this tool from CDN JsDelivr CDN
Usage
Add a new Tool to the tools property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
points: Point,
},
...
});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: {
...
points: {
class: Point,
},
},
...
});Config Params
All properties are optional.
| Field | Type | Description |
| ------------ | ---------- | -------------------------- |
| placeholder | string | point's placeholder string |
| levels | number[] | enabled point levels |
| defaultLevel | number | default point level |
var editor = EditorJS({
...
tools: {
...
points: {
class: Point,
config: {
placeholder: 'Enter a point',
levels: [3],
defaultLevel: 3
}
}
}
...
});Tool's settings

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