mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 00:59:57 +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,5 +1,5 @@
|
||||
import type { DatabaseBlockModel } from '@blocksuite/affine-model';
|
||||
import type { BlockCommands, Command } from '@blocksuite/block-std';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import type { BlockModel, Store } from '@blocksuite/store';
|
||||
|
||||
import {
|
||||
@@ -8,12 +8,14 @@ import {
|
||||
} from './data-source';
|
||||
|
||||
export const insertDatabaseBlockCommand: Command<
|
||||
'selectedModels',
|
||||
'insertedDatabaseBlockId',
|
||||
{
|
||||
selectedModels?: BlockModel[];
|
||||
viewType: string;
|
||||
place?: 'after' | 'before';
|
||||
removeEmptyLine?: boolean;
|
||||
},
|
||||
{
|
||||
insertedDatabaseBlockId: string;
|
||||
}
|
||||
> = (ctx, next) => {
|
||||
const { selectedModels, viewType, place, removeEmptyLine, std } = ctx;
|
||||
@@ -65,7 +67,3 @@ export const initDatabaseBlock = (
|
||||
doc.addBlock('affine:paragraph', {}, parent.id);
|
||||
}
|
||||
};
|
||||
|
||||
export const commands: BlockCommands = {
|
||||
insertDatabaseBlock: insertDatabaseBlockCommand,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user