feat(editor): show doc title in page block (#9975)

Close [BS-2392](https://linear.app/affine-design/issue/BS-2392/page-block-需要显示文章title)

### What Changes
- Add `<doc-title>` to edgeless page block (a.k.a the first page visible note block)
- Refactors:
  - Move `<doc-title>` to `@blocksuite/affine-component`, but you can aslo import it from `@blocksuite/preset`
  - Extract `<edgeless-note-mask>` and `<edgeless-note-background>` from `<affine-edgeless-note>` to a seperate file
  - Rewrite styles of `<affine-edgeless-note>` with `@vanilla-extract/css`

https://github.com/user-attachments/assets/a0c03239-803e-4bfa-b30e-33b919213b12
This commit is contained in:
L-Sun
2025-02-06 21:18:27 +00:00
parent 41107eafae
commit 891d9df0b1
33 changed files with 626 additions and 337 deletions

View File

@@ -145,8 +145,8 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
.getFlag('enable_advanced_block_visibility');
}
private get _pageBlockHeaderEnabled() {
return this.doc.get(FeatureFlagService).getFlag('enable_page_block_header');
private get _pageBlockEnabled() {
return this.doc.get(FeatureFlagService).getFlag('enable_page_block');
}
private get doc() {
@@ -155,7 +155,7 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
private get _enableAutoHeight() {
return !(
this._pageBlockHeaderEnabled &&
this._pageBlockEnabled &&
this.notes.length === 1 &&
this.notes[0].parent?.children.find(child =>
matchFlavours(child, ['affine:note'])
@@ -373,7 +373,7 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
onlyOne &&
!isFirstNote &&
this._pageBlockHeaderEnabled &&
this._pageBlockEnabled &&
!this._advancedVisibilityEnabled
? html`<editor-icon-button
aria-label="Display In Page"