Interface IContentWidgetPosition

A position for rendering content widgets.

interface IContentWidgetPosition {
    position: IPosition;
    positionAffinity?: PositionAffinity;
    preference: ContentWidgetPositionPreference[];
    secondaryPosition?: IPosition;
}

Properties

position: IPosition

Desired position which serves as an anchor for placing the content widget. The widget will be placed above, at, or below the specified position, based on the provided preference. The widget will always touch this position.

Given sufficient horizontal space, the widget will be placed to the right of the passed in position. This can be tweaked by providing a secondaryPosition.

See

  • preference
  • secondaryPosition
positionAffinity?: PositionAffinity

Placement preference when multiple view positions refer to the same (model) position. This plays a role when injected text is involved.

Placement preference for position, in order of preference.

secondaryPosition?: IPosition

Optionally, a secondary position can be provided to further define the placing of the content widget. The secondary position must have the same line number as the primary position. If possible, the widget will be placed such that it also touches the secondary position.