refactor(editor): remove selection global types (#9532)

Closes: [BS-2217](https://linear.app/affine-design/issue/BS-2217/remove-global-types-in-selection)
This commit is contained in:
Saul-Mirone
2025-01-06 03:45:10 +00:00
parent 8669936f2f
commit fc863e484c
105 changed files with 501 additions and 358 deletions
@@ -6,14 +6,18 @@ import {
} from '@blocksuite/affine-block-embed';
import { ParagraphBlockComponent } from '@blocksuite/affine-block-paragraph';
import { matchFlavours } from '@blocksuite/affine-shared/utils';
import type { BlockComponent, UIEventHandler } from '@blocksuite/block-std';
import {
type BlockComponent,
BlockSelection,
type UIEventHandler,
} from '@blocksuite/block-std';
import { IS_MAC, IS_WINDOWS } from '@blocksuite/global/env';
export class PageKeyboardManager {
private readonly _handleDelete: UIEventHandler = ctx => {
const event = ctx.get('keyboardState').raw;
const blockSelections = this._currentSelection.filter(sel =>
sel.is('block')
sel.is(BlockSelection)
);
if (blockSelections.length === 0) {
return;