mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +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,4 +1,13 @@
|
||||
import {
|
||||
AttachmentBlockModel,
|
||||
BookmarkBlockModel,
|
||||
CodeBlockModel,
|
||||
DatabaseBlockModel,
|
||||
ImageBlockModel,
|
||||
SurfaceRefBlockModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { getSelectionRectsCommand } from '@blocksuite/affine-shared/commands';
|
||||
import { EMBED_BLOCK_MODEL_LIST } from '@blocksuite/affine-shared/consts';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import {
|
||||
BlockSelection,
|
||||
@@ -67,16 +76,15 @@ export class AffineDocRemoteSelectionWidget extends WidgetComponent {
|
||||
private get _config(): DocRemoteSelectionConfig {
|
||||
return {
|
||||
blockSelectionBackgroundTransparent: block => {
|
||||
return (
|
||||
matchFlavours(block, [
|
||||
'affine:code',
|
||||
'affine:database',
|
||||
'affine:image',
|
||||
'affine:attachment',
|
||||
'affine:bookmark',
|
||||
'affine:surface-ref',
|
||||
]) || /affine:embed-*/.test(block.flavour)
|
||||
);
|
||||
return matchFlavours(block, [
|
||||
CodeBlockModel,
|
||||
DatabaseBlockModel,
|
||||
ImageBlockModel,
|
||||
AttachmentBlockModel,
|
||||
BookmarkBlockModel,
|
||||
SurfaceRefBlockModel,
|
||||
...EMBED_BLOCK_MODEL_LIST,
|
||||
]);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user