Skip to content

BlockSuite API Documentation / @blocksuite/block-std / UIEventDispatcher

Class: UIEventDispatcher

Constructors

new UIEventDispatcher(std)

new UIEventDispatcher(std): UIEventDispatcher

Parameters

std: BlockStdScope

Returns

UIEventDispatcher

Source

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

Properties

_active

private _active: boolean = false

Source

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


_clipboardControl

private _clipboardControl: ClipboardControl

Source

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


_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[]>

Source

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


_keyboardControl

private _keyboardControl: KeyboardControl

Source

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


_pointerControl

private _pointerControl: PointerControl

Source

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


_rangeControl

private _rangeControl: RangeControl

Source

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


disposables

disposables: DisposableGroup

Source

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


slots

slots: Object

Deprecated

This property is deprecated and will be removed in the future.

slots.editorHostPanned

editorHostPanned: Slot<void>

slots.parentScaleChanged

parentScaleChanged: Slot<number>

Source

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


std

std: BlockStdScope

Source

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

Accessors

_currentSelections

get private _currentSelections(): BaseSelection[]

Returns

BaseSelection[]

Source

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


active

get active(): boolean

Returns

boolean

Source

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


cumulativeParentScale

get cumulativeParentScale(): number

Deprecated

This method is deprecated and will be removed in the future.

Returns

number

Source

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


host

get host(): HTMLElement

Returns

HTMLElement

Source

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

Methods

_bindEvents()

private _bindEvents(): void

Returns

void

Source

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


_buildEventScopeBySelection()

private _buildEventScopeBySelection(name): undefined | EventScope

Parameters

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

Source

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


_buildEventScopeByTarget()

private _buildEventScopeByTarget(name, target): undefined | EventScope

Parameters

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"

target: Node

Returns

undefined | EventScope

Source

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


_getEventScope()

private _getEventScope(name, state): undefined | EventScope

Parameters

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"

state: EventSourceState

Returns

undefined | EventScope

Source

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


add()

add(name, handler, options?): () => void

Parameters

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"

handler: UIEventHandler

options?: EventOptions

Returns

Function

Returns

void

Source

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


bindHotkey()

bindHotkey(...args): () => void

Parameters

• ...args: [Record<string, UIEventHandler>, EventOptions]

Returns

Function

Returns

void

Source

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


buildEventScope()

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

Parameters

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"

flavours: string[]

paths: string[][]

Returns

undefined | EventScope

Source

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


mount()

mount(): void

Returns

void

Source

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


run()

run(name, context, scope?): void

Parameters

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"

context: UIEventStateContext

scope?: EventScope

Returns

void

Source

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


unmount()

unmount(): void

Returns

void

Source

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