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,9 +1 @@
|
||||
import { getImageSelectionsCommand } from '@blocksuite/affine-shared/commands';
|
||||
import type { BlockCommands } from '@blocksuite/block-std';
|
||||
|
||||
import { insertImagesCommand } from './insert-images.js';
|
||||
|
||||
export const commands: BlockCommands = {
|
||||
getImageSelections: getImageSelectionsCommand,
|
||||
insertImages: insertImagesCommand,
|
||||
};
|
||||
export { insertImagesCommand } from './insert-images.js';
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import { getImageFilesFromLocal } from '@blocksuite/affine-shared/utils';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
import { addSiblingImageBlock } from '../utils.js';
|
||||
|
||||
export const insertImagesCommand: Command<
|
||||
'selectedModels',
|
||||
'insertedImageIds',
|
||||
{ removeEmptyLine?: boolean; place?: 'after' | 'before' }
|
||||
{
|
||||
selectedModels?: BlockModel[];
|
||||
removeEmptyLine?: boolean;
|
||||
place?: 'after' | 'before';
|
||||
},
|
||||
{
|
||||
insertedImageIds: Promise<string[]>;
|
||||
}
|
||||
> = (ctx, next) => {
|
||||
const { selectedModels, place, removeEmptyLine, std } = ctx;
|
||||
if (!selectedModels) return;
|
||||
|
||||
Reference in New Issue
Block a user