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:93

Properties

_clipboardControl

private _clipboardControl: ClipboardControl

Source

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


_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:84


_keyboardControl

private _keyboardControl: KeyboardControl

Source

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


_pointerControl

private _pointerControl: PointerControl

Source

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


_rangeControl

private _rangeControl: RangeControl

Source

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


disposables

disposables: DisposableGroup

Source

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


slots

slots: Object

Type declaration

editorHostPanned

editorHostPanned: Slot<void>

parentScaleChanged

parentScaleChanged: Slot<number>

Source

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


std

std: BlockStdScope

Source

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


_activeDispatcher

private static _activeDispatcher: null | UIEventDispatcher = null

Source

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


slots

static slots: Object

Type declaration

activeChanged

activeChanged: Slot<void>

Source

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

Accessors

_currentSelections

get private _currentSelections(): BaseSelection[]

Returns

BaseSelection[]

Source

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


cumulativeParentScale

get cumulativeParentScale(): number

Returns

number

Source

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


host

get host(): HTMLElement

Returns

HTMLElement

Source

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


isActive

get isActive(): boolean

Returns

boolean

Source

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

Methods

_bindEvents()

private _bindEvents(): void

Returns

void

Source

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


_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:261


_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:240


_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:185


activate()

activate(): void

Returns

void

Source

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


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:162


bindHotkey()

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

Parameters

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

Returns

Function

Returns

void

Source

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


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:211


deactivate()

deactivate(): void

Returns

void

Source

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


mount()

mount(): void

Returns

void

Source

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


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:144


unmount()

unmount(): void

Returns

void

Source

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


Generated using TypeDoc and typedoc-plugin-markdown.