Files
AFFiNE-Mirror/blocksuite/affine/shared/src/commands/selection/get-block-selections.ts
T
2025-03-28 07:20:34 +00:00

11 lines
349 B
TypeScript

import { BlockSelection } from '@blocksuite/std';
import type { GetSelectionCommand } from './types';
export const getBlockSelectionsCommand: GetSelectionCommand = (ctx, next) => {
const currentBlockSelections = ctx.std.selection.filter(BlockSelection);
if (currentBlockSelections.length === 0) return;
next({ currentBlockSelections });
};