mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 21:25:45 +08:00
chore(editor): reorg packages (#10702)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
type BlockComponent,
|
||||
BlockSelection,
|
||||
type Command,
|
||||
} from '@blocksuite/block-std';
|
||||
|
||||
export const selectBlock: Command<{
|
||||
focusBlock?: BlockComponent;
|
||||
}> = (ctx, next) => {
|
||||
const { focusBlock, std } = ctx;
|
||||
if (!focusBlock) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { selection } = std;
|
||||
|
||||
selection.setGroup('note', [
|
||||
selection.create(BlockSelection, { blockId: focusBlock.blockId }),
|
||||
]);
|
||||
|
||||
return next();
|
||||
};
|
||||
Reference in New Issue
Block a user