mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
refactor(editor): remove block models global type (#10086)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user