refactor(editor): refactor page note empty checker (#9570)

Close [BS-2320](https://linear.app/affine-design/issue/BS-2320/内容为空的状态判断)
This commit is contained in:
L-Sun
2025-01-07 11:24:40 +00:00
parent 482b534a90
commit 440239809c
11 changed files with 187 additions and 18 deletions

View File

@@ -112,6 +112,10 @@ export class PageRootBlockComponent extends BlockComponent<
clipboardController = new PageClipboard(this);
/**
* Focus the first paragraph in the default note block.
* If there is no paragraph, create one.
*/
focusFirstParagraph = () => {
const defaultNote = this._getDefaultNoteBlock();
const firstText = defaultNote?.children.find(block =>