mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 10:31:50 +08:00
refactor(editor): remove dependency of command global types (#9903)
Closes: [BS-2216](https://linear.app/affine-design/issue/BS-2216/remove-global-types-in-command)
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import '@blocksuite/affine-shared/commands';
|
||||
|
||||
import { TableModelFlavour } from '@blocksuite/affine-model';
|
||||
import { generateFractionalIndexingKeyBetween } from '@blocksuite/affine-shared/utils';
|
||||
import type { BlockCommands, Command } from '@blocksuite/block-std';
|
||||
import { nanoid, Text } from '@blocksuite/store';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import { type BlockModel, nanoid, Text } from '@blocksuite/store';
|
||||
export const insertTableBlockCommand: Command<
|
||||
'selectedModels',
|
||||
'insertedTableBlockId',
|
||||
{
|
||||
place?: 'after' | 'before';
|
||||
removeEmptyLine?: boolean;
|
||||
selectedModels?: BlockModel[];
|
||||
},
|
||||
{
|
||||
insertedTableBlockId: string;
|
||||
}
|
||||
> = (ctx, next) => {
|
||||
const { selectedModels, place, removeEmptyLine, std } = ctx;
|
||||
@@ -61,7 +61,3 @@ export const insertTableBlockCommand: Command<
|
||||
|
||||
next({ insertedTableBlockId: blockId });
|
||||
};
|
||||
|
||||
export const tableCommands: BlockCommands = {
|
||||
insertTableBlock: insertTableBlockCommand,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user