@freedom-editor/keybindings-controller

1.0.4 • Public • Published

Freedom Editor Keybindings Controller

License Codacy Badge Known Vulnerabilities Maintainability

A controller to apply custom keybindings to blocks for controlling their behaviors.

Installation

npm i @freedom-editor/keybindings-controller

Usage

Step 1: Import the controller

Import this controller to the script where you configurate Freedom Editor.

import {
  FreedomEditorKeyBindings
} from '@freedom-editor/keybindings-controller'

Step2: Hook the controller to blocks

Hook this controller to the Freedom Editor instance in FreedomEditorInstance.init(). The controller will then apply to all blocks.

const editor = new FreedomEditor({
  containerId: 'freedom-editor',
  //Options here...
  }
})

editor.init([
  //Hook controllers here
  new FreedomEditorKeyBindings({

  })
])

You can also hook this controller to block instance. The controller will then apply to specific block only.

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

const paragraphBlock = new Paragraph({
  controllers: [
    //Hook controllers here
    new FreedomEditorKeyBindings({

    })
  ]
})

API Reference

TODO

License

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

Package Sidebar

Install

npm i @freedom-editor/keybindings-controller

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

13.2 kB

Total Files

13

Last publish

Collaborators

  • johnwinston0410