diff --git a/blocksuite/affine/block-note/src/components/edgeless-note-background.ts b/blocksuite/affine/block-note/src/components/edgeless-note-background.ts index c91af88cc7..88f838098e 100644 --- a/blocksuite/affine/block-note/src/components/edgeless-note-background.ts +++ b/blocksuite/affine/block-note/src/components/edgeless-note-background.ts @@ -36,7 +36,6 @@ import { property } from 'lit/decorators.js'; import { styleMap } from 'lit/directives/style-map.js'; import { NoteConfigExtension } from '../config'; -import { isPageBlock } from '../utils'; import * as styles from './edgeless-note-background.css'; @requiredProperties({ @@ -162,7 +161,7 @@ export class EdgelessNoteBackground extends SignalWatcher( @pointerdown=${stopPropagation} @click=${this._handleClickAtBackground} > - ${isPageBlock(this.std, this.note) ? this._renderHeader() : nothing} + ${this.note.isPageBlock() ? this._renderHeader() : nothing} `; } diff --git a/blocksuite/affine/block-note/src/components/edgeless-page-block-title.ts b/blocksuite/affine/block-note/src/components/edgeless-page-block-title.ts index 6ece191c60..e27f7d016b 100644 --- a/blocksuite/affine/block-note/src/components/edgeless-page-block-title.ts +++ b/blocksuite/affine/block-note/src/components/edgeless-page-block-title.ts @@ -12,7 +12,6 @@ import { html } from 'lit'; import { property } from 'lit/decorators.js'; import { NoteConfigExtension } from '../config'; -import { isPageBlock } from '../utils'; import * as styles from './edgeless-page-block-title.css'; @requiredProperties({ @@ -22,7 +21,7 @@ export class EdgelessPageBlockTitle extends SignalWatcher( WithDisposable(ShadowlessElement) ) { override render() { - if (!isPageBlock(this.std, this.note)) return; + if (!this.note.isPageBlock()) return; const title = this.std .getOptional(NoteConfigExtension.identifier) diff --git a/blocksuite/affine/block-note/src/index.ts b/blocksuite/affine/block-note/src/index.ts index 2163db36e5..af41585d04 100644 --- a/blocksuite/affine/block-note/src/index.ts +++ b/blocksuite/affine/block-note/src/index.ts @@ -6,4 +6,3 @@ export * from './note-block'; export * from './note-edgeless-block'; export * from './note-service'; export * from './note-spec'; -export { isPageBlock } from './utils'; diff --git a/blocksuite/affine/block-note/src/note-edgeless-block.ts b/blocksuite/affine/block-note/src/note-edgeless-block.ts index 02372048be..fa660e49b7 100644 --- a/blocksuite/affine/block-note/src/note-edgeless-block.ts +++ b/blocksuite/affine/block-note/src/note-edgeless-block.ts @@ -12,10 +12,10 @@ import { ifDefined } from 'lit/directives/if-defined.js'; import { styleMap } from 'lit/directives/style-map.js'; import { MoreIndicator } from './components/more-indicator'; +import { NoteConfigExtension } from './config'; import { NoteBlockComponent } from './note-block'; import { ACTIVE_NOTE_EXTRA_PADDING } from './note-edgeless-block.css'; import * as styles from './note-edgeless-block.css'; -import { isPageBlock } from './utils'; export const AFFINE_EDGELESS_NOTE = 'affine-edgeless-note'; @@ -219,6 +219,9 @@ export class EdgelessNoteBlockComponent extends toGfxBlockComponent( ? this._noteFullHeight < height : !!collapsedHeight && collapsedHeight < height; + const hasHeader = !!this.std.getOptional(NoteConfigExtension.identifier) + ?.edgelessNoteHeader; + return html`