Skip to content

BlockSuite API Documentation / @blocksuite/blocks / EdgelessTemplatePanel

Class: EdgelessTemplatePanel

Extends

Constructors

new EdgelessTemplatePanel()

new EdgelessTemplatePanel(): EdgelessTemplatePanel

Returns

EdgelessTemplatePanel

Inherited from

WithDisposable(LitElement).constructor

Defined in

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

Other

_disposables

protected _disposables: DisposableGroup

Inherited from

WithDisposable(LitElement)._disposables

Defined in

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


disposables

readonly disposables: DisposableGroup

Inherited from

WithDisposable(LitElement).disposables

Defined in

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


draggableController

draggableController: EdgelessDraggableElementController<Template>

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:201


styles

static styles: CSSResult

Overrides

WithDisposable(LitElement).styles

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:33


templates

static templates: object = builtInTemplates

categories()

categories: () => Promise<string[]>

Returns

Promise<string[]>

list()

list: (category) => Promise<Template[]>

Parameters

category: string

Returns

Promise<Template[]>

search: (keyword, cateName?) => Promise<Template[]>

Parameters

keyword: string

cateName?: string

Returns

Promise<Template[]>

extend()

Parameters

manager: TemplateManager

Returns

void

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:197


edgeless

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:542


isDragging

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:545

lifecycle

connectedCallback()

connectedCallback(): void

Invoked when the component is added to the document's DOM.

In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.

ts
connectedCallback() {
  super.connectedCallback();
  addEventListener('keydown', this._handleKeydown);
}

Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().

Returns

void

Overrides

WithDisposable(LitElement).connectedCallback

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:378

rendering

render()

render(): TemplateResult<1>

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<1>

Overrides

WithDisposable(LitElement).render

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:408

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

WithDisposable(LitElement).firstUpdated

Defined in

packages/blocks/src/root-block/edgeless/components/toolbar/template/template-panel.ts:392