Interface IContentWidget

Expand description

A content widget renders inline with the text and can be easily placed 'near' an editor position.

interface IContentWidget {
    allowEditorOverflow?: boolean;
    suppressMouseDown?: boolean;
    afterRender?(
        position: ContentWidgetPositionPreference,
        coordinate: IContentWidgetRenderedCoordinate,
    ): void;
    beforeRender?(): IDimension;
    getDomNode(): HTMLElement;
    getId(): string;
    getPosition(): IContentWidgetPosition;
}

Properties§

§allowEditorOverflow?: boolean

Render this content widget in a location where it could overflow the editor's view dom node.

§suppressMouseDown?: boolean

Call preventDefault() on mousedown events that target the content widget.

Methods§

§

afterRender?(
    position: ContentWidgetPositionPreference,
    coordinate: IContentWidgetRenderedCoordinate,
): void

Optional function that is invoked after rendering the content widget. Is being invoked with the selected position preference or null if not rendered.

§

beforeRender?(): IDimension

Optional function that is invoked before rendering the content widget. If a dimension is returned the editor will attempt to use it.

§

getDomNode(): HTMLElement

Get the dom node of the content widget.

§

getId(): string

Get a unique identifier of the content widget.

§

getPosition(): IContentWidgetPosition

Get the placement of the content widget. If null is returned, the content widget will be placed off screen.