0.1.0 • Published 4 years ago

editorjs-editable-block v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

npm.io

EditorJS Editable Block

Editable block tool for Editor.js.

npm.io

Notes

Allows empty blocks.

Replaces built-in paragraph tool.

Based on paragraph tool.

Installation

Install via NPM

Get the package

$ npm i --save-dev editorjs-editable-block

Include module at your application

import EditableBlock from 'editorjs-editable-block';

Usage

Add a new Tool to the tools property of the Editor.js initial config.

const editor = EditorJS({
  tools: {
    paragraph: {
      class: EditableBlock,
      inlineToolbar: true,
    },
  }
});

Config Params

No config param required.

Output data

FieldTypeDescription
textstringBlock's text

Data

{
  "type": "paragraph",
    "data": {
        "text": "Hello world!"
    }
}

Development

Development mode

$ yarn build:dev

Production release 1. Create a production bundle

$ yarn build
  1. Commit dist/bundle.js

Run tests

$ yarn test