Options
All
  • Public
  • Public/Protected
  • All
Menu

A class responsible for building the keyboard commands for the ProseMirror editor.

Hierarchy

Index

Constructors

  • new ProseMirrorKeyMaps(schema: Schema, [options]?: { onSave: Function }): ProseMirrorKeyMaps
  • Parameters

    • schema: Schema

      The ProseMirror schema to build keymaps for.

    • [options]: { onSave: Function } = {}

      Additional options to configure the plugin's behaviour.

      • onSave: Function

    Returns ProseMirrorKeyMaps

Methods

  • buildMapping(): any
  • Build keyboard commands for nodes and marks present in the schema.

    Returns any

    An object of keyboard shortcuts to editor functions.

  • #headingsMapping(mapping: any, maxLevel: number): void
  • Implement keyboard commands for heading levels.

    Parameters

    • mapping: any

      The keyboard mapping.

    • maxLevel: number

      The maximum level of headings.

    Returns void

  • #horizontalRuleMapping(mapping: any): void
  • Implement keyboard commands for horizontal rules.

    Parameters

    • mapping: any

      The keyboard mapping.

    Returns void

  • #lineBreakMapping(mapping: any): void
  • Implement line-break keyboard commands.

    Parameters

    • mapping: any

      The keyboard mapping.

    Returns void

  • #newLineMapping(mapping: any): void
  • Implement some custom logic for how to split special blocks.

    Parameters

    • mapping: any

      The keyboard mapping.

    Returns void

  • #addSaveMapping(mapping: any): void
  • Implement save shortcut.

    Parameters

    • mapping: any

      The keyboard mapping.

    Returns void

  • build(schema: any, options?: {}): Plugin<any>
  • Build the plugin.

    Parameters

    • schema: any

      The ProseMirror schema to build the plugin against.

    • options: {} = {}

      Returns Plugin<any>