mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 22:07:09 +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,5 +1,8 @@
|
||||
import { getSurfaceBlock } from '@blocksuite/affine-block-surface';
|
||||
import type { SurfaceRefProps } from '@blocksuite/affine-model';
|
||||
import {
|
||||
FrameBlockModel,
|
||||
type SurfaceRefProps,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
@@ -38,7 +41,7 @@ export const insertSurfaceRefBlockCommand: Command<
|
||||
|
||||
if (element?.type === 'group') {
|
||||
surfaceRefProps.refFlavour = 'group';
|
||||
} else if (matchFlavours(blockModel, ['affine:frame'])) {
|
||||
} else if (matchFlavours(blockModel, [FrameBlockModel])) {
|
||||
surfaceRefProps.refFlavour = 'frame';
|
||||
} else {
|
||||
console.error(`reference not found ${reference}`);
|
||||
|
||||
Reference in New Issue
Block a user