Skip to content

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

Class: EditorHost

Extends

Constructors

new EditorHost()

new EditorHost(): EditorHost

Returns

EditorHost

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).constructor

Defined in

node_modules/@lit/reactive-element/development/reactive-element.d.ts:504

Other

_disposables

protected _disposables: DisposableGroup

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) )._disposables

Defined in

packages/framework/global/dist/utils/with-disposable.d.ts:5


disposables

readonly disposables: DisposableGroup

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).disposables

Defined in

packages/framework/global/dist/utils/with-disposable.d.ts:6


slots

readonly slots: object

unmounted

unmounted: Slot<void>

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:105


virtualKeyboardPolicy

virtualKeyboardPolicy: string

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).virtualKeyboardPolicy

Defined in

packages/framework/global/dist/types/virtual-keyboard.d.ts:20


connectedCount

static connectedCount: WeakMap<Constructor, WeakMap<Node, number>>

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).connectedCount

Defined in

packages/framework/block-std/src/view/element/shadowless-element.ts:9


onDisconnectedMap

static onDisconnectedMap: WeakMap<Constructor, null | () => void>

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).onDisconnectedMap

Defined in

packages/framework/block-std/src/view/element/shadowless-element.ts:14


styles

static styles: CSSResult

Overrides

SignalWatcher( WithDisposable(ShadowlessElement) ).styles

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:39


command

Get Signature

get command(): CommandManager

Returns

CommandManager

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:109


doc

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:196


event

Get Signature

get event(): UIEventDispatcher

Returns

UIEventDispatcher

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:113


range

Get Signature

get range(): RangeManager

Returns

RangeManager

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:117


selection

Get Signature

get selection(): SelectionManager

Returns

SelectionManager

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:121


std

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:200


view

Get Signature

get view(): ViewStore

Returns

ViewStore

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:125


connectedCallback()

connectedCallback(): void

Returns

void

Overrides

SignalWatcher( WithDisposable(ShadowlessElement) ).connectedCallback

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:129


dangerouslyRenderModel()

dangerouslyRenderModel(model): TemplateResult

Parameters

model

BlockModel<object, SignaledProps<object>>

Returns

TemplateResult

Deprecated

Render a block model manually instead of let blocksuite render it. If you render the same block model multiple times, the event flow and data binding will be broken. Only use this method as a last resort.

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:90


disconnectedCallback()

disconnectedCallback(): void

Returns

void

Overrides

SignalWatcher( WithDisposable(ShadowlessElement) ).disconnectedCallback

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:143


renderChildren()

renderChildren(model, filter?): TemplateResult

Parameters

model

BlockModel<object, SignaledProps<object>>

filter?

(model) => boolean

Returns

TemplateResult

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:94

rendering

createRenderRoot()

createRenderRoot(): EditorHost

Returns

EditorHost

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).createRenderRoot

Defined in

packages/framework/block-std/src/view/element/shadowless-element.ts:78


render()

render(): TemplateResult | typeof nothing

Invoked on each update to perform rendering tasks. This method may return any value renderable by lit-html's ChildPart - typically a TemplateResult. Setting properties inside this method will not trigger the element to update.

Returns

TemplateResult | typeof nothing

Overrides

SignalWatcher( WithDisposable(ShadowlessElement) ).render

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:187

styles

finalizeStyles()

protected static finalizeStyles(styles?): CSSResultOrNative[]

Takes the styles the user supplied via the static styles property and returns the array of styles to apply to the element. Override this method to integrate into a style management system.

Styles are deduplicated preserving the last instance in the list. This is a performance optimization to avoid duplicated styles that can occur especially when composing via subclassing. The last item is kept to try to preserve the cascade order with the assumption that it's most important that last added styles override previous styles.

Parameters

styles?

CSSResultGroup

Returns

CSSResultOrNative[]

Nocollapse

Inherited from

SignalWatcher( WithDisposable(ShadowlessElement) ).finalizeStyles

Defined in

packages/framework/block-std/src/view/element/shadowless-element.ts:21

updates

getUpdateComplete()

getUpdateComplete(): Promise<boolean>

Override point for the updateComplete promise.

It is not safe to override the updateComplete getter directly due to a limitation in TypeScript which means it is not possible to call a superclass getter (e.g. super.updateComplete.then(...)) when the target language is ES5 (https://github.com/microsoft/TypeScript/issues/338). This method should be overridden instead. For example:

ts
class MyElement extends LitElement {
  override async getUpdateComplete() {
    const result = await super.getUpdateComplete();
    await this._myChild.updateComplete;
    return result;
  }
}

Returns

Promise<boolean>

A promise of a boolean that resolves to true if the update completed without triggering another update.

Overrides

SignalWatcher( WithDisposable(ShadowlessElement) ).getUpdateComplete

Defined in

packages/framework/block-std/src/view/element/lit-host.ts:150