mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
fix(editor): edgeless selected block is missing in the return of getSelectedBlockCommand (#11813)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
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 });
|
||||
};
|
||||
@@ -7,5 +7,6 @@ export {
|
||||
getSelectionRectsCommand,
|
||||
type SelectionRect,
|
||||
} from './get-selection-rects';
|
||||
export { getSurfaceSelectionCommand } from './get-surface-selection';
|
||||
export { getTextSelectionCommand } from './get-text-selection.js';
|
||||
export { isNothingSelectedCommand } from './is-nothing-selected.js';
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import type { BlockSelection, Command, TextSelection } from '@blocksuite/std';
|
||||
import type {
|
||||
BlockSelection,
|
||||
Command,
|
||||
SurfaceSelection,
|
||||
TextSelection,
|
||||
} from '@blocksuite/std';
|
||||
|
||||
import type { ImageSelection } from '../../selection/image';
|
||||
|
||||
@@ -8,5 +13,6 @@ export type GetSelectionCommand = Command<
|
||||
currentTextSelection?: TextSelection;
|
||||
currentBlockSelections?: BlockSelection[];
|
||||
currentImageSelections?: ImageSelection[];
|
||||
currentSurfaceSelection?: SurfaceSelection;
|
||||
}
|
||||
>;
|
||||
|
||||
Reference in New Issue
Block a user