Module

widget/widgettypearound/utils

@ckeditor/ckeditor5-widget/src/widgettypearound/utils

module

Filtering

Constants

  • TYPE_AROUND_SELECTION_ATTRIBUTE

    static

    The name of the type around model selection attribute responsible for displaying a "fake caret" next to a selected widget.

Functions

  • getClosestTypeAroundDomButton( domElement ) → HTMLElement | null

    static

    For the passed HTML element, this helper finds the closest type around button ancestor.

    Parameters

    domElement : HTMLElement

    Returns

    HTMLElement | null
  • getClosestWidgetViewElement( domElement, domConverter ) → Element

    static

    For the passed HTML element, this helper returns the closest view widget ancestor.

    Parameters

    domElement : HTMLElement
    domConverter : DomConverter

    Returns

    Element
  • getTypeAroundButtonPosition( domElement ) → 'before' | 'after'

    static

    For the passed type around button element, this helper determines at which position the paragraph would be inserted into the content if, for instance, the button was clicked by the user.

    Parameters

    domElement : HTMLElement

    Returns

    'before' | 'after'

    Position of the button.

  • getTypeAroundFakeCaretPosition( selection ) → 'before' | 'after' | null

    static

    For the passed selection instance, it returns the position of the "fake caret" displayed next to a widget.

    Note: If the "fake caret" is not currently displayed, null is returned.

    Parameters

    selection : Selection | DocumentSelection

    Returns

    'before' | 'after' | null

    Position of the fake caret or null when none is preset.

  • isTypeAroundWidget( viewElement, modelElement, schema ) → Boolean

    static

    Checks if an element is a widget that qualifies to get the type around UI.

    Parameters

    viewElement : Element
    modelElement : Element
    schema : Schema

    Returns

    Boolean