Skip to content

BlockSuite API Documentation / @blocksuite/blocks / EdgelessNoteBlockComponent

Class: EdgelessNoteBlockComponent

Extends

Constructors

new EdgelessNoteBlockComponent()

new EdgelessNoteBlockComponent(): EdgelessNoteBlockComponent

Returns

EdgelessNoteBlockComponent

Inherited from

toGfxBlockComponent( NoteBlockComponent ).constructor

Defined in

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

Other

_disposables

protected _disposables: DisposableGroup

Inherited from

toGfxBlockComponent( NoteBlockComponent )._disposables

Defined in

packages/framework/block-std/dist/view/utils/with-disposable.d.ts:4


[blockComponentSymbol]

[blockComponentSymbol]: boolean

Inherited from

toGfxBlockComponent( NoteBlockComponent ).[blockComponentSymbol]

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:13


[GfxElementSymbol]

[GfxElementSymbol]: boolean

Inherited from

toGfxBlockComponent( NoteBlockComponent ).[GfxElementSymbol]

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:7


disposables

readonly disposables: DisposableGroup

Inherited from

toGfxBlockComponent( NoteBlockComponent ).disposables

Defined in

packages/framework/block-std/dist/view/utils/with-disposable.d.ts:5


handleEvent()

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

Parameters

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

handler: UIEventHandler

options?

options.flavour?: boolean

options.global?: boolean

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).handleEvent

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:14


model

model: NoteBlockModel & EdgelessBlockModel<GfxCompatibleProps>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).model

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:23


service

service: NoteBlockService & BlockService

Inherited from

toGfxBlockComponent( NoteBlockComponent ).service

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:29


disableShadowRoot

static disableShadowRoot: boolean

Inherited from

toGfxBlockComponent( NoteBlockComponent ).disableShadowRoot

Defined in

packages/framework/block-std/dist/view/element/shadowless-element.d.ts:4


styles

static styles: CSSResult

Overrides

toGfxBlockComponent( NoteBlockComponent ).styles

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:108


_renderers

Inherited from

toGfxBlockComponent( NoteBlockComponent )._renderers

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:53


_zoom

get _zoom(): number

Returns

number

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:151


blockId

get blockId(): string

Returns

string

Inherited from

toGfxBlockComponent( NoteBlockComponent ).blockId

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:18


childBlocks

get childBlocks(): BlockComponent<BlockModel<object, object>, BlockService, string>[]

Returns

BlockComponent<BlockModel<object, object>, BlockService, string>[]

Inherited from

toGfxBlockComponent( NoteBlockComponent ).childBlocks

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:19


dirty

Inherited from

toGfxBlockComponent( NoteBlockComponent ).dirty

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:55


doc

Inherited from

toGfxBlockComponent( NoteBlockComponent ).doc

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:56


flavour

get flavour(): string

Returns

string

Inherited from

toGfxBlockComponent( NoteBlockComponent ).flavour

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:20


gfx

get gfx(): GfxController

Returns

GfxController

Inherited from

toGfxBlockComponent( NoteBlockComponent ).gfx

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:8


host

get host(): EditorHost

Returns

EditorHost

Inherited from

toGfxBlockComponent( NoteBlockComponent ).host

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:21


isVersionMismatch

get isVersionMismatch(): boolean

Returns

boolean

Inherited from

toGfxBlockComponent( NoteBlockComponent ).isVersionMismatch

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:22


parentComponent

get parentComponent(): null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Returns

null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).parentComponent

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:24


renderChildren

get renderChildren(): (model, filter?) => TemplateResult

Returns

Function

Parameters

model: BlockModel<object, SignaledProps<object>>

filter?

Returns

TemplateResult

Inherited from

toGfxBlockComponent( NoteBlockComponent ).renderChildren

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:25


rootComponent

get rootComponent(): null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Returns

null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).rootComponent

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:26


rootService

get rootService(): EdgelessRootService

Returns

EdgelessRootService

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:155


selected

get selected(): null | BaseSelection

Returns

null | BaseSelection

Inherited from

toGfxBlockComponent( NoteBlockComponent ).selected

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:27


selection

get selection(): SelectionManager

Returns

SelectionManager

Inherited from

toGfxBlockComponent( NoteBlockComponent ).selection

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:28


std

Inherited from

toGfxBlockComponent( NoteBlockComponent ).std

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:57


topContenteditableElement

get topContenteditableElement(): null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Returns

null | BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).topContenteditableElement

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:30


viewType

Inherited from

toGfxBlockComponent( NoteBlockComponent ).viewType

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:58


widgetComponents

get widgetComponents(): Partial<Record<WidgetName, WidgetComponent<BlockModel<object, SignaledProps<object>>, BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>, BlockService>>>

Returns

Partial<Record<WidgetName, WidgetComponent<BlockModel<object, SignaledProps<object>>, BlockComponent<BlockModel<object, SignaledProps<object>>, BlockService, string>, BlockService>>>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).widgetComponents

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:31


widgets

Inherited from

toGfxBlockComponent( NoteBlockComponent ).widgets

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:59


addRenderer()

addRenderer(renderer): void

Parameters

renderer

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).addRenderer

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:34


bindHotKey()

bindHotKey(keymap, options?): () => void

Parameters

keymap: Record<string, UIEventHandler>

options?

options.flavour?: boolean

options.global?: boolean

Returns

Function

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).bindHotKey

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:35


connectedCallback()

connectedCallback(): void

Returns

void

Overrides

toGfxBlockComponent( NoteBlockComponent ).connectedCallback

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:314


getRenderingRect()

getRenderingRect(): object

Returns

object

h

h: string | number

w

w: number = width

x

x: number = bound.x

y

y: number = bound.y

zIndex

zIndex: string

Overrides

toGfxBlockComponent( NoteBlockComponent ).getRenderingRect

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:363


renderBlock()

renderBlock(undefined)

renderBlock(): TemplateResult<1>

Returns

TemplateResult<1>

Inherited from

toGfxBlockComponent( NoteBlockComponent ).renderBlock

Defined in

packages/blocks/src/note-block/note-block.ts:25

renderBlock(undefined)

renderBlock(): unknown

Returns

unknown

Inherited from

toGfxBlockComponent( NoteBlockComponent ).renderBlock

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:17


renderGfxBlock()

renderGfxBlock(): TemplateResult<1> | typeof nothing

Returns

TemplateResult<1> | typeof nothing

Overrides

toGfxBlockComponent( NoteBlockComponent ).renderGfxBlock

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:380


renderPageContent()

renderPageContent(): unknown

Returns

unknown

Inherited from

toGfxBlockComponent( NoteBlockComponent ).renderPageContent

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:19


renderVersionMismatch()

renderVersionMismatch(expectedVersion, actualVersion): TemplateResult

Render a warning message when the block version is mismatched.

Parameters

expectedVersion: number

If the schema is not found, the expected version is -1. Which means the block is not supported in the current editor.

actualVersion: number

The version of the block's crdt data.

Returns

TemplateResult

Inherited from

toGfxBlockComponent( NoteBlockComponent ).renderVersionMismatch

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:50


toZIndex()

toZIndex(): string

Returns

string

Inherited from

toGfxBlockComponent( NoteBlockComponent ).toZIndex

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:21


updateZIndex()

updateZIndex(): void

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).updateZIndex

Defined in

packages/framework/block-std/dist/view/element/gfx-block-component.d.ts:22

lifecycle

disconnectedCallback()

disconnectedCallback(): void

Invoked when the component is removed from the document's DOM.

This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.

ts
disconnectedCallback() {
  super.disconnectedCallback();
  window.removeEventListener('keydown', this._handleKeydown);
}

An element may be re-connected after being disconnected.

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).disconnectedCallback

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:40

rendering

createRenderRoot()

createRenderRoot(): HTMLElement | DocumentFragment

Returns

HTMLElement | DocumentFragment

Inherited from

toGfxBlockComponent( NoteBlockComponent ).createRenderRoot

Defined in

packages/framework/block-std/dist/view/element/shadowless-element.d.ts:6


render()

render(): unknown

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

unknown

Inherited from

toGfxBlockComponent( NoteBlockComponent ).render

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:42

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

toGfxBlockComponent( NoteBlockComponent ).finalizeStyles

Defined in

packages/framework/block-std/dist/view/element/shadowless-element.d.ts:5

updates

firstUpdated()

firstUpdated(): void

Invoked when the element is first updated. Implement to perform one time work on the element after update.

ts
firstUpdated() {
  this.renderRoot.getElementById('my-text-area').focus();
}

Setting properties inside this method will trigger the element to update again after this update cycle completes.

Returns

void

Overrides

toGfxBlockComponent( NoteBlockComponent ).firstUpdated

Defined in

packages/blocks/src/note-block/note-edgeless-block.ts:331


getUpdateComplete()

protected 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.

Inherited from

toGfxBlockComponent( NoteBlockComponent ).getUpdateComplete

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:41


update()

protected update(changedProperties): void

Updates the element. This method reflects property values to attributes and calls render to render DOM via lit-html. Setting properties inside this method will not trigger another update.

Parameters

changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>

Map of changed properties with old values

Returns

void

Inherited from

toGfxBlockComponent( NoteBlockComponent ).update

Defined in

packages/framework/block-std/dist/view/element/block-component.d.ts:51