mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 20:41:50 +08:00
refactor(editor): remove global types in model (#10082)
Closes: [BS-2249](https://linear.app/affine-design/issue/BS-2249/remove-global-types-in-model) ```ts // before matchFlavours(model, ['affine:page']); // after matchFlavours(model, [PageBlockModel]); ```
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
promptDocTitle,
|
||||
} from '@blocksuite/affine-block-embed';
|
||||
import { ParagraphBlockComponent } from '@blocksuite/affine-block-paragraph';
|
||||
import { NoteBlockModel, ParagraphBlockModel } from '@blocksuite/affine-model';
|
||||
import {
|
||||
draftSelectedModelsCommand,
|
||||
getSelectedModelsCommand,
|
||||
@@ -37,7 +38,7 @@ export class PageKeyboardManager {
|
||||
const model = block.model;
|
||||
|
||||
if (
|
||||
matchFlavours(model, ['affine:paragraph']) &&
|
||||
matchFlavours(model, [ParagraphBlockModel]) &&
|
||||
model.type.startsWith('h') &&
|
||||
model.collapsed
|
||||
) {
|
||||
@@ -133,7 +134,7 @@ export class PageKeyboardManager {
|
||||
const selectedModels = ctx.selectedModels?.filter(
|
||||
block =>
|
||||
!block.flavour.startsWith('affine:embed-') &&
|
||||
matchFlavours(doc.getParent(block), ['affine:note'])
|
||||
matchFlavours(doc.getParent(block), [NoteBlockModel])
|
||||
);
|
||||
|
||||
const draftedModels = ctx.draftedModels;
|
||||
|
||||
Reference in New Issue
Block a user