1.4.0 • Published 6 months ago

@editorjs/warning v1.4.0

Weekly downloads
2,358
License
MIT
Repository
github
Last release
6 months ago

npm.io

Warning Tool

Provides Warning Block for the CodeX Editor. Block has title and message. It can be used, for example, for editorials notifications or appeals.

npm.io

Installation

Get the package

yarn add @editorjs/warning

Include module at your application

import Warning from '@editorjs/warning';

Optionally, you can load this tool from CDN JsDelivr CDN

Usage

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

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    warning: Warning,
  },
  
  ...
});

Or init Warning Tool with additional settings

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    warning: {
      class: Warning,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+W',
      config: {
        titlePlaceholder: 'Title',
        messagePlaceholder: 'Message',
      },
    },
  },
  
  ...
});

Config Params

FieldTypeDescription
titlePlaceholderstringWarning Tool's title placeholder
messagePlaceholderstringWarning Tool's message placeholder

Output data

FieldTypeDescription
titlestringwarning's title
messagestringwarning's message
{
    "type" : "warning",
    "data" : {
        "title" : "Note:",
        "message" : "Avoid using this method just for lulz. It can be very dangerous opposite your daily fun stuff."
    }
}
1.4.0

6 months ago

1.3.0

1 year ago

1.2.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago