mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +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,18 @@
|
||||
import { getSurfaceBlock } from '@blocksuite/affine-block-surface';
|
||||
import type { SurfaceRefProps } from '@blocksuite/affine-model';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import type { BlockCommands, Command } from '@blocksuite/block-std';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
export const insertSurfaceRefBlockCommand: Command<
|
||||
'selectedModels',
|
||||
'insertedSurfaceRefBlockId',
|
||||
{
|
||||
reference: string;
|
||||
place: 'after' | 'before';
|
||||
removeEmptyLine?: boolean;
|
||||
selectedModels?: BlockModel[];
|
||||
},
|
||||
{
|
||||
insertedSurfaceRefBlockId: string;
|
||||
}
|
||||
> = (ctx, next) => {
|
||||
const { selectedModels, reference, place, removeEmptyLine, std } = ctx;
|
||||
@@ -57,7 +60,3 @@ export const insertSurfaceRefBlockCommand: Command<
|
||||
insertedSurfaceRefBlockId: result[0],
|
||||
});
|
||||
};
|
||||
|
||||
export const commands: BlockCommands = {
|
||||
insertSurfaceRefBlock: insertSurfaceRefBlockCommand,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user