mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 20:41:50 +08:00
refactor(editor): remove block models global type (#10086)
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
draftSelectedModelsCommand,
|
||||
getSelectedModelsCommand,
|
||||
} from '@blocksuite/affine-shared/commands';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import { matchModels } from '@blocksuite/affine-shared/utils';
|
||||
import {
|
||||
type BlockComponent,
|
||||
BlockSelection,
|
||||
@@ -38,7 +38,7 @@ export class PageKeyboardManager {
|
||||
const model = block.model;
|
||||
|
||||
if (
|
||||
matchFlavours(model, [ParagraphBlockModel]) &&
|
||||
matchModels(model, [ParagraphBlockModel]) &&
|
||||
model.type.startsWith('h') &&
|
||||
model.collapsed
|
||||
) {
|
||||
@@ -134,7 +134,7 @@ export class PageKeyboardManager {
|
||||
const selectedModels = ctx.selectedModels?.filter(
|
||||
block =>
|
||||
!block.flavour.startsWith('affine:embed-') &&
|
||||
matchFlavours(doc.getParent(block), [NoteBlockModel])
|
||||
matchModels(doc.getParent(block), [NoteBlockModel])
|
||||
);
|
||||
|
||||
const draftedModels = ctx.draftedModels;
|
||||
|
||||
Reference in New Issue
Block a user