1.0.3 • Published 11 months ago

@coolbytes/editorjs-delimiter v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Delimiter block tool for Editor.js

This Editor.js block tool extends @editorjs/delimiter to include more styles - dash and line. For line style, more options are also available under block settings menu (see Preview).

Preview

Block Tool

delimiter

Block Settings

settings

Installation

Using npm

npm install @coolbytes/editorjs-delimiter

Using yarn

yarn add @coolbytes/editorjs-delimiter

Usage

Include it in the tools property of Editor.js config:

const editor = new EditorJS({
  tools: {
    delimiter: Delimiter
  }
});

Config Params

FieldTypeOptionalDefaultDescription
styleOptionsstring[]Yes'star', 'dash', 'line'All supported delimiter styles
defaultStylestringYes'star'Preferred delimiter style
lineWidthOptionsnumber[]Yes8, 15, 25, 35, 50, 60, 100All supported line width options (%). Applicable for 'line' style only
defaultLineWidthnumberYes25Preferred line width. Applicable for 'line' style only
lineThicknessOptionsnumber[]Yes1, 2, 3, 4, 5, 6All supported line thickness options. Applicable for 'line' style only
defaultLineThicknessnumberYes2Preferred line thickness. Applicable for 'line' style only

 

const editor = EditorJS({
  tools: {
    delimiter: {
      class: Delimiter,
      config: {
        styleOptions: ['star', 'dash', 'line'],
        defaultStyle: 'star',
        lineWidthOptions: [8, 15, 25, 35, 50, 60, 100],
        defaultLineWidth: 25,
        lineThicknessOptions: [1, 2, 3, 4, 5, 6],
        defaultLineThickness: 2,
      }
    }
  }
});

Output data

FieldTypeAvailabilityDescription
stylestringAll StylesDelimiter Style
lineWidthnumberlineWidth of line style delimiter
lineThicknessnumberlineThickness of line style delimiter

 

Example:

{
  "time": 1715969561758,
  "blocks": [
    {
      "id": "_K5QcJHHuK",
      "type": "delimiter",
      "data": {
        "style": "line",
        "lineWidth": 25,
        "lineThickness": 2
      }
    }
  ],
  "version": "2.29.1"
}
1.0.3

11 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago