refactor(editor): remove block models global type (#10086)

This commit is contained in:
Saul-Mirone
2025-02-11 11:00:57 +00:00
parent a725df6ebe
commit 39eb8625d6
157 changed files with 402 additions and 621 deletions

View File

@@ -8,7 +8,7 @@ import {
} 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 { matchModels } from '@blocksuite/affine-shared/utils';
import {
BlockSelection,
TextSelection,
@@ -76,7 +76,7 @@ export class AffineDocRemoteSelectionWidget extends WidgetComponent {
private get _config(): DocRemoteSelectionConfig {
return {
blockSelectionBackgroundTransparent: block => {
return matchFlavours(block, [
return matchModels(block, [
CodeBlockModel,
DatabaseBlockModel,
ImageBlockModel,

View File

@@ -7,7 +7,10 @@ import {
requestThrottledConnectedFrame,
} from '@blocksuite/affine-shared/utils';
import { WidgetComponent } from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import {
GfxControllerIdentifier,
type GfxModel,
} from '@blocksuite/block-std/gfx';
import { pickValues } from '@blocksuite/global/utils';
import type { UserInfo } from '@blocksuite/store';
import { css, html, nothing } from 'lit';
@@ -118,7 +121,7 @@ export class EdgelessRemoteSelectionWidget extends WidgetComponent<RootBlockMode
const elements = selection.elements
.map(id => this.crud.getElementById(id))
.filter(element => element) as BlockSuite.EdgelessModel[];
.filter(element => element) as GfxModel[];
const rect = getSelectedRect(elements);
if (rect.width === 0 || rect.height === 0) return;