mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +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:
@@ -1,3 +1,4 @@
|
||||
import { ListBlockModel } from '@blocksuite/affine-model';
|
||||
import {
|
||||
getNextContentBlock,
|
||||
matchFlavours,
|
||||
@@ -25,7 +26,7 @@ export function forwardDelete(std: BlockStdScope): true | undefined {
|
||||
const isCollapsed = text.isCollapsed();
|
||||
const doc = std.store;
|
||||
const model = doc.getBlock(text.from.blockId)?.model;
|
||||
if (!model || !matchFlavours(model, ['affine:list'])) return;
|
||||
if (!model || !matchFlavours(model, [ListBlockModel])) return;
|
||||
const isEnd = isCollapsed && text.from.index === model.text.length;
|
||||
if (!isEnd) return;
|
||||
// Has children in list
|
||||
|
||||
Reference in New Issue
Block a user