Niche Portobello Mushroom

    @convertkit/slate-keymap

    0.1.10 • Public • Published

    Slate Keymap

    View on Github

    A plugin for simplifying keyboard shortcuts with SlateJS. slate-keymap uses is-hotkey under the hood to check if an event matches the configured keys.

    Install

    yarn add @convertkit/slate-keymap

    Usage

    Keymap(object: Object, options: Object)

    Example

    import Keymap from "@convertkit/slate-keymap";
    
    const plugins = [
      Keymap({
        "mod+a": (event, editor) => editor.selectAll(),
        // You can also pass a string and it will call the command with that name
        "shift+enter": "softBreak"
      })
    ];

    Options

    • if: A function that is passed the editor instance. If it returns true, then the Keymap is active. Defaults to () => true

    Keywords

    none

    Install

    npm i @convertkit/slate-keymap

    DownloadsWeekly Downloads

    1,815

    Version

    0.1.10

    License

    MIT

    Unpacked Size

    18.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • ppiotrowicz
    • dylanfeltus
    • erinfox
    • ericathompson
    • corydhmiller
    • bcarney
    • christinacole
    • raquelxmoss
    • marksouthard
    • noelherrick
    • mbbbb
    • jurezove
    • ivanmp-convertkit
    • krishamoud
    • markthomasmiller
    • jenessaw
    • josephrexme