mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 07:17:00 +08:00
refactor(editor): remove block models global type (#10086)
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
ParagraphBlockModel,
|
||||
type RootBlockModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import { matchModels } from '@blocksuite/affine-shared/utils';
|
||||
import { ShadowlessElement } from '@blocksuite/block-std';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { Store } from '@blocksuite/store';
|
||||
@@ -72,7 +72,7 @@ export class DocTitle extends WithDisposable(ShadowlessElement) {
|
||||
private _getOrCreateFirstPageVisibleNote() {
|
||||
const note = this._rootModel.children.find(
|
||||
(child): child is NoteBlockModel =>
|
||||
matchFlavours(child, [NoteBlockModel]) &&
|
||||
matchModels(child, [NoteBlockModel]) &&
|
||||
child.displayMode !== NoteDisplayMode.EdgelessOnly
|
||||
);
|
||||
if (note) return note;
|
||||
@@ -105,7 +105,7 @@ export class DocTitle extends WithDisposable(ShadowlessElement) {
|
||||
|
||||
const note = this._getOrCreateFirstPageVisibleNote();
|
||||
const firstText = note?.children.find(block =>
|
||||
matchFlavours(block, [
|
||||
matchModels(block, [
|
||||
ParagraphBlockModel,
|
||||
ListBlockModel,
|
||||
CodeBlockModel,
|
||||
|
||||
Reference in New Issue
Block a user