Skip to content

API > @blocksuite/block-std > UIEventDispatcher

Class: UIEventDispatcher ​

Constructors ​

constructor ​

new UIEventDispatcher(std): UIEventDispatcher

Parameters ​

ParameterType
stdBlockStdProvider

Returns ​

UIEventDispatcher

Defined In ​

block-std/src/event/dispatcher.ts:80

Properties ​

_clipboardControl ​

private _clipboardControl: ClipboardControl

Defined In ​

block-std/src/event/dispatcher.ts:78


_handlersMap ​

private _handlersMap: Record< "cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu", EventHandlerRunner[] >

Defined In ​

block-std/src/event/dispatcher.ts:71


_keyboardControl ​

private _keyboardControl: KeyboardControl

Defined In ​

block-std/src/event/dispatcher.ts:76


_pointerControl ​

private _pointerControl: PointerControl

Defined In ​

block-std/src/event/dispatcher.ts:75


_rangeControl ​

private _rangeControl: RangeControl

Defined In ​

block-std/src/event/dispatcher.ts:77


disposables ​

disposables: DisposableGroup

Defined In ​

block-std/src/event/dispatcher.ts:69


std ​

std: BlockStdProvider

Defined In ​

block-std/src/event/dispatcher.ts:80

Accessors ​

_currentSelections ​

private get _currentSelections(): BaseSelection[]

Defined In ​

block-std/src/event/dispatcher.ts:139


root ​

get root(): HTMLElement

Defined In ​

block-std/src/event/dispatcher.ts:98

Methods ​

_bindEvents ​

private _bindEvents(): void

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:235


_buildEventScopeBySelection ​

private _buildEventScopeBySelection(name): undefined | EventScope

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"

Returns ​

undefined | EventScope

Defined In ​

block-std/src/event/dispatcher.ts:208


_buildEventScopeByTarget ​

private _buildEventScopeByTarget(name, target): undefined | EventScope

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"
targetNode

Returns ​

undefined | EventScope

Defined In ​

block-std/src/event/dispatcher.ts:189


_getEventScope ​

private _getEventScope(name, event): undefined | EventScope

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"
eventEvent

Returns ​

undefined | EventScope

Defined In ​

block-std/src/event/dispatcher.ts:143


add ​

add( name, handler, options?): function

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"
handlerUIEventHandler
options?EventOptions

Returns ​

(): void

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:127

Defined In ​

block-std/src/event/dispatcher.ts:120


bindHotkey ​

bindHotkey(...args): function

Parameters ​

ParameterType
...args[Record< string, UIEventHandler >, EventOptions]

Returns ​

(): void

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:127

Defined In ​

block-std/src/event/dispatcher.ts:136


buildEventScope ​

buildEventScope( name, flavours, paths): undefined | EventScope

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"
flavoursstring[]
pathsstring[][]

Returns ​

undefined | EventScope

Defined In ​

block-std/src/event/dispatcher.ts:160


mount ​

mount(): void

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:87


run ​

run( name, context, scope?): void

Parameters ​

ParameterType
name"cut" | "blur" | "click" | "copy" | "drop" | "focus" | "paste" | "wheel" | "doubleClick" | "tripleClick" | "pointerDown" | "pointerMove" | "pointerUp" | "pointerOut" | "dragStart" | "dragMove" | "dragEnd" | "keyDown" | "keyUp" | "selectionChange" | "compositionStart" | "compositionUpdate" | "compositionEnd" | "beforeInput" | "contextMenu"
contextUIEventStateContext
scope?EventScope

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:102


unmount ​

unmount(): void

Returns ​

void

Defined In ​

block-std/src/event/dispatcher.ts:94