Skip to main content

Class: OverlayController

Defined in: editor/overlayController.tsx:75

Controls UI overlays for the canvases, including dialogs and tasks.

Properties

PropertyModifierType

events

readonly

Events<OverlayControllerEvents>

Accessors

openedDialog

Get Signature

get openedDialog(): undefined | OpenedDialog

Defined in: editor/overlayController.tsx:123

Currently open dialog.

Returns undefined if no dialog is opened.

Returns

undefined | OpenedDialog

Methods

hideDialog()

hideDialog(): void

Defined in: editor/overlayController.tsx:366

Closes currently open dialog if any is active.

Returns

void

See

showDialog


showDialog()

showDialog(params): void

Defined in: editor/overlayController.tsx:285

Shows on-canvas dialog anchored to the target element or link.

Parameters

ParameterTypeDescription

params

{ content: ReactElement<any>; dialogType?: OverlayDialogType; holdSelection?: boolean; onClose?: () => void; style: DialogStyleProps; target?: Element | Link; }

params.content

ReactElement<any>

Dialog content.

params.dialogType?

OverlayDialogType

Well-known dialog type to check later if a specific dialog is currently open.

params.holdSelection?

boolean

Whether to prevent selection changes while dialog is open.

Default

false

params.onClose?

() => void

Callback which is called when dialog is closed for any reason (e.g. when another dialog is opened).

params.style

DialogStyleProps

Dialog style, placement and sizing options.

params.target?

Element | Link

Element or link to anchor dialog to.

Returns

void

See

hideDialog


showSpinnerWhile()

showSpinnerWhile(operation): void

Defined in: editor/overlayController.tsx:224

Creates a task via startTask for the operation defined by a Promise.

Parameters

ParameterType

operation

Promise<unknown>

Returns

void

See

startTask


startTask()

startTask(params): OverlayTask

Defined in: editor/overlayController.tsx:169

Starts a new foreground task which blocks canvas interaction and displays a loading indicator until the task has ended.

If multiple tasks are started at any given time, an indicator will be shown while at least one of them is still active.

Parameters

ParameterTypeDescription

params

{ delay?: number; title?: string; }

params.delay?

number

Delay in milliseconds before displaying loading indicator to avoid showing it in case the task ends quickly.

Default

0

params.title?

string

Task title to display.

Returns

OverlayTask