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
@@ -1,7 +1,7 @@
import { ParagraphBlockModel } from '@blocksuite/affine-model';
import type { BlockModel } from '@blocksuite/store';
import { matchFlavours } from '../model/checker.js';
import { matchModels } from '../model/checker.js';
export function calculateCollapsedSiblings(
model: ParagraphBlockModel
@@ -15,7 +15,7 @@ export function calculateCollapsedSiblings(
const collapsedEdgeIndex = children.findIndex((child, i) => {
if (
i > index &&
matchFlavours(child, [ParagraphBlockModel]) &&
matchModels(child, [ParagraphBlockModel]) &&
child.type.startsWith('h')
) {
const modelLevel = parseInt(model.type.slice(1));
@@ -46,7 +46,7 @@ export function getNearestHeadingBefore(
for (let i = index - 1; i >= 0; i--) {
const sibling = parent.children[i];
if (
matchFlavours(sibling, [ParagraphBlockModel]) &&
matchModels(sibling, [ParagraphBlockModel]) &&
sibling.type.startsWith('h')
) {
return sibling;