import { CaptionedBlockComponent } from '@blocksuite/affine-components/caption'; import type { DividerBlockModel } from '@blocksuite/affine-model'; import { BLOCK_CHILDREN_CONTAINER_PADDING_LEFT } from '@blocksuite/affine-shared/consts'; import { BlockSelection } from '@blocksuite/std'; import { html } from 'lit'; import { dividerBlockStyles } from './styles.js'; export class DividerBlockComponent extends CaptionedBlockComponent { static override styles = dividerBlockStyles; override connectedCallback() { super.connectedCallback(); this.contentEditable = 'false'; this.handleEvent('click', () => { this.host.selection.setGroup('note', [ this.host.selection.create(BlockSelection, { blockId: this.blockId, }), ]); }); } override renderBlock() { const children = html`
${this.renderChildren(this.model)}
`; return html`

${children}
`; } override accessor useZeroWidth = true; } declare global { interface HTMLElementTagNameMap { 'affine-divider': DividerBlockComponent; } }