fix(shortcut): fix delete drawing shortcut (#6401)

This commit is contained in:
wpxp123456
2025-12-29 18:13:47 +08:00
committed by GitHub
parent 57c51eea58
commit 203f7cbc01
2 changed files with 4 additions and 2 deletions
@@ -17,13 +17,14 @@
import type { IContextService } from '@univerjs/core';
import type { IShortcutItem } from '@univerjs/ui';
import type { IMoveDrawingsCommandParams } from '../../commands/commands/move-drawings.command';
import { Direction, FOCUSING_COMMON_DRAWINGS, FOCUSING_UNIVER_EDITOR } from '@univerjs/core';
import { Direction, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_UNIVER_EDITOR } from '@univerjs/core';
import { KeyCode } from '@univerjs/ui';
import { DeleteDocDrawingsCommand } from '../../commands/commands/delete-doc-drawing.command';
import { MoveDocDrawingsCommand } from '../../commands/commands/move-drawings.command';
export function whenDocDrawingFocused(contextService: IContextService): boolean {
return (
contextService.getContextValue(FOCUSING_DOC) &&
contextService.getContextValue(FOCUSING_UNIVER_EDITOR) &&
contextService.getContextValue(FOCUSING_COMMON_DRAWINGS)
);
@@ -17,13 +17,14 @@
import type { IContextService } from '@univerjs/core';
import type { IShortcutItem } from '@univerjs/ui';
import type { IMoveDrawingsCommandParams } from '../../commands/commands/move-drawings.command';
import { Direction, EDITOR_ACTIVATED, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR } from '@univerjs/core';
import { Direction, EDITOR_ACTIVATED, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHEET } from '@univerjs/core';
import { KeyCode } from '@univerjs/ui';
import { DeleteDrawingsCommand } from '../../commands/commands/delete-drawings.command';
import { MoveDrawingsCommand } from '../../commands/commands/move-drawings.command';
export function whenSheetDrawingFocused(contextService: IContextService): boolean {
return (
contextService.getContextValue(FOCUSING_SHEET) &&
!contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) &&
!contextService.getContextValue(EDITOR_ACTIVATED) &&
!contextService.getContextValue(FOCUSING_PANEL_EDITOR) &&