Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a plugin to connect format ribbon component and the editor

Hierarchy

Index

Properties

dispose

dispose: () => void

Type declaration

    • (): void
    • The last method that editor will call to a plugin before it is disposed. Plugin can take this chance to clear the reference to editor. After this method is called, plugin should not call to any editor method since it will result in error.

      Returns void

getName

getName: () => string

Type declaration

    • (): string
    • Get a friendly name of this plugin

      Returns string

initialize

initialize: (editor: IEditor) => void

Type declaration

    • The first method that editor will call to a plugin when editor is initializing. It will pass in the editor instance, plugin should take this chance to save the editor reference so that it can call to any editor method or format API later.

      Parameters

      • editor: IEditor

        The editor object

      Returns void

onButtonClick

onButtonClick: <T>(button: RibbonButton<T>, key: T, strings?: LocalizedStrings<T, string>) => void

Type declaration

    • When user clicks on a button, call this method to let the plugin to handle this click event

      Type parameters

      • T: string

      Parameters

      • button: RibbonButton<T>

        The button that is clicked

      • key: T

        Key of child menu item that is clicked if any

      • Optional strings: LocalizedStrings<T, string>

        The localized string map for this button

      Returns void

Optional onPluginEvent

onPluginEvent: (event: PluginEvent) => void

Type declaration

    • Core method for a plugin. Once an event happens in editor, editor will call this method of each plugin to handle the event as long as the event is not handled exclusively by another plugin.

      Parameters

      Returns void

registerFormatChangedCallback

registerFormatChangedCallback: (callback: (formatState: ContentModelFormatState) => void) => () => void

Type declaration

startLivePreview

startLivePreview: <T>(button: RibbonButton<T>, key: T, strings?: LocalizedStrings<T, string>) => void

Type declaration

    • Enter live preview state (shadow edit) of editor if there is a non-collapsed selection

      Type parameters

      • T: string

      Parameters

      • button: RibbonButton<T>

        The button that triggered this action

      • key: T

        Key of the hovered button sub item

      • Optional strings: LocalizedStrings<T, string>

        The localized string map for this button

      Returns void

stopLivePreview

stopLivePreview: () => void

Type declaration

    • (): void
    • Leave live preview state (shadow edit) of editor

      Returns void

Optional willHandleEventExclusively

willHandleEventExclusively: (event: PluginEvent) => boolean

Type declaration

    • Check if the plugin should handle the given event exclusively. Handle an event exclusively means other plugin will not receive this event in onPluginEvent method. If two plugins will return true in willHandleEventExclusively() for the same event, the final result depends on the order of the plugins are added into editor

      Parameters

      Returns boolean

Methods

setUIUtilities

Generated using TypeDoc