refactor(editor): remove block models global type (#10086)

This commit is contained in:
Saul-Mirone
2025-02-11 11:00:57 +00:00
parent a725df6ebe
commit 39eb8625d6
157 changed files with 402 additions and 621 deletions

View File

@@ -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,