Skip to content

SPANDigital/presidium-wysiwyg-quote

 
 

Repository files navigation

Quote Tool

Provides Quote Blocks for the Presidium WYSIWYG editor

Installation

Install via NPM

Get the package

yarn add @spandigital/presidium-wysiwyg-quote

Usage

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

var editor = EditorJS({
  ...
  
  tools: {
    ...
    quote: Quote,
  },
  
  ...
});

Or init Quote Tool with additional settings

var editor = EditorJS({
  ...
  
  tools: {
    ...
    quote: {
      class: Quote,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+O',
      config: {
        quotePlaceholder: 'Enter a quote',
        captionPlaceholder: 'Quote\'s author',
      },
    },
  },
  
  ...
});

Config Params

Field Type Description
quotePlaceholder string quote's placeholder string
captionPlaceholder string caption's placeholder string

Tool's settings

You can choose alignment for the quote. It takes no effect while editing, but saved the «alignment» param.

Output data

Field Type Description
text string quote's text
caption string caption or an author
alignment string left or center
{
    "type" : "quote",
    "data" : {
        "text" : "The unexamined life is not worth living.",
        "caption" : "Socrates",
        "alignment" : "left"
    }
}

Releases

Master

To release a new non-beta version, do the following:

  1. Merge your changes into master
  2. Increment the version in package.json (The release GitHub action will not run unless this is done)
  3. run npm i
  4. Commit and push

The package will then be published to the @spandigital registry.

Develop

Beta packages are automatically published whenever a commit is pushed to the develop branch.

About

Quote Tool for Editor.js 2.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 93.6%
  • CSS 6.4%