Skip to content

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

Class: UIEventDispatcher

Constructors

new UIEventDispatcher()

new UIEventDispatcher(std): UIEventDispatcher

Parameters

std: BlockStdScope

Returns

UIEventDispatcher

Source

packages/framework/block-std/src/event/dispatcher.ts:101

Properties

_active

private _active: boolean = false

Source

packages/framework/block-std/src/event/dispatcher.ts:96


_clipboardControl

private _clipboardControl: ClipboardControl

Source

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


_handlersMap

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

Source

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


_keyboardControl

private _keyboardControl: KeyboardControl

Source

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


_pointerControl

private _pointerControl: PointerControl

Source

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


_rangeControl

private _rangeControl: RangeControl

Source

packages/framework/block-std/src/event/dispatcher.ts:93


disposables

disposables: DisposableGroup

Source

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


slots

slots: object

Deprecated

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

editorHostPanned

editorHostPanned: Slot<void>

parentScaleChanged

parentScaleChanged: Slot<number>

Source

packages/framework/block-std/src/event/dispatcher.ts:82


std

std: BlockStdScope

Source

packages/framework/block-std/src/event/dispatcher.ts:101

Accessors

_currentSelections

get private _currentSelections(): BaseSelection[]

Returns

BaseSelection[]

Source

packages/framework/block-std/src/event/dispatcher.ts:170


active

get active(): boolean

Returns

boolean

Source

packages/framework/block-std/src/event/dispatcher.ts:97


cumulativeParentScale

get cumulativeParentScale(): number

Deprecated

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

Returns

number

Source

packages/framework/block-std/src/event/dispatcher.ts:112


host

get host(): HTMLElement

Returns

HTMLElement

Source

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

Methods

_bindEvents()

private _bindEvents(): void

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:292


_buildEventScopeBySelection()

private _buildEventScopeBySelection(name): undefined | EventScope

Parameters

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

Returns

undefined | EventScope

Source

packages/framework/block-std/src/event/dispatcher.ts:264


_buildEventScopeByTarget()

private _buildEventScopeByTarget(name, target): undefined | EventScope

Parameters

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

target: Node

Returns

undefined | EventScope

Source

packages/framework/block-std/src/event/dispatcher.ts:229


_calculatePath()

private _calculatePath(model): string[]

Parameters

model: BlockModel<object>

Returns

string[]

Source

packages/framework/block-std/src/event/dispatcher.ts:254


_getEventScope()

private _getEventScope(name, state): undefined | EventScope

Parameters

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

state: EventSourceState

Returns

undefined | EventScope

Source

packages/framework/block-std/src/event/dispatcher.ts:174


add()

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

Parameters

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

handler: UIEventHandler

options?: EventOptions

Returns

Function

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:151


bindHotkey()

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

Parameters

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

Returns

Function

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:167


buildEventScope()

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

Parameters

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

flavours: string[]

paths: string[][]

Returns

undefined | EventScope

Source

packages/framework/block-std/src/event/dispatcher.ts:200


mount()

mount(): void

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:116


run()

run(name, context, scope?): void

Parameters

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

context: UIEventStateContext

scope?: EventScope

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:131


unmount()

unmount(): void

Returns

void

Source

packages/framework/block-std/src/event/dispatcher.ts:123