mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 22:18:54 +08:00
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:
@@ -1,4 +1,4 @@
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import { type Command, TextSelection } from '@blocksuite/block-std';
|
||||
|
||||
export const clearAndSelectFirstModelCommand: Command<'selectedModels'> = (
|
||||
ctx,
|
||||
@@ -17,7 +17,7 @@ export const clearAndSelectFirstModelCommand: Command<'selectedModels'> = (
|
||||
const firstModel = models[0];
|
||||
if (firstModel.text) {
|
||||
firstModel.text.clear();
|
||||
const selection = ctx.std.selection.create('text', {
|
||||
const selection = ctx.std.selection.create(TextSelection, {
|
||||
from: {
|
||||
blockId: firstModel.id,
|
||||
index: 0,
|
||||
|
||||
@@ -32,7 +32,7 @@ export const getSelectedModelsCommand: Command<
|
||||
never,
|
||||
'selectedModels',
|
||||
{
|
||||
types?: Extract<BlockSuite.SelectionType, 'block' | 'text' | 'image'>[];
|
||||
types?: Array<'image' | 'text' | 'block'>;
|
||||
mode?: 'all' | 'flat' | 'highest';
|
||||
}
|
||||
> = (ctx, next) => {
|
||||
|
||||
Reference in New Issue
Block a user