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

Hierarchy (view full)

Constructors

  • Parameters

    • schema: Schema

      The ProseMirror schema to build keymaps for.

    • Optional options: {
          onSave: Function;
      } = {}

      Additional options to configure the plugin's behaviour.

      • onSave: Function

        A function to call when Ctrl+S is pressed.

    Returns ProseMirrorKeyMaps

Methods

  • Build keyboard commands for nodes and marks present in the schema.

    Returns Record<string, ProseMirrorCommand>

    An object of keyboard shortcuts to editor functions.

  • Implement keyboard commands for heading levels.

    Parameters

    • mapping: Record<string, ProseMirrorCommand>

      The keyboard mapping.

    • maxLevel: number

      The maximum level of headings.

    Returns void

  • Implement keyboard commands for horizontal rules.

    Parameters

    Returns void

  • Implement line-break keyboard commands.

    Parameters

    Returns void

  • Implement some custom logic for how to split special blocks.

    Parameters

    Returns void

  • Implement save shortcut.

    Parameters

    Returns void

  • Build the plugin.

    Parameters

    • schema: any

      The ProseMirror schema to build the plugin against.

    • options: {} = {}

      Additional options to pass to the plugin.

      Returns Plugin<any>

      Abstract