@freedom-editor/vanilla-paragraph-block

1.0.1 • Public • Published

Freedom Editor Vanilla Paragraph block

License Known Vulnerabilities Maintainability Codacy Badge

A paragraph block written in vanilla Javascript for Freedom Editor.

Installation

npm i @freedom-editor/vanilla-paragraph-block

Usage

Import paragraph block

Import paragraph block to the script where you config Freedom Editor. Create a new instance.

import { Paragraph } from '@freedom-editor/vanilla-paragraph-block'

const paragraphBlock = new Paragraph()

Register paragraph block in Freedom Editor instance

Register this block in options.registeredBlocks.

registeredBlocks: [
  paragraphBlock
],

Full example

//Pre-bundle by bundler like Rollup.js

import { FreedomEditor } from '@freedom-editor/core'
import { Paragraph } from '@freedom-editor/vanilla-paragraph-block'

const paragraphBlock = new Paragraph()

const editor = new FreedomEditor({
  containerId: 'freedom-editor',
  defaultBlock: paragraphBlock,
  registeredBlocks: {
    paragraphBlock: paragraphBlock
  },
  blockTemplate: [

  ],
  i18n: {
    rtl: 'ltr'
  }
})

editor.init([])

editor.loadBlocks()

API Reference

TODO

License

This project is licensed under the MIT License - see the license for more details.

/@freedom-editor/vanilla-paragraph-block/

    Package Sidebar

    Install

    npm i @freedom-editor/vanilla-paragraph-block

    Weekly Downloads

    4

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    10.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • johnwinston0410