Files
AFFiNE-Mirror/blocksuite/affine/shared/src/commands/selection/get-surface-selection.ts

11 lines
348 B
TypeScript

import { SurfaceSelection } from '@blocksuite/std';
import type { GetSelectionCommand } from './types';
export const getSurfaceSelectionCommand: GetSelectionCommand = (ctx, next) => {
const currentSurfaceSelection = ctx.std.selection.filter(SurfaceSelection)[0];
if (!currentSurfaceSelection) return;
next({ currentSurfaceSelection });
};