shortcuts.ts 919 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { FreeLayoutPluginContext, ShortcutsRegistry } from '@flowgram.ai/free-layout-editor';
  6. import { ZoomOutShortcut } from './zoom-out';
  7. import { ZoomInShortcut } from './zoom-in';
  8. import { SelectAllShortcut } from './select-all';
  9. import { PasteShortcut } from './paste';
  10. import { ExpandShortcut } from './expand';
  11. import { DeleteShortcut } from './delete';
  12. import { CopyShortcut } from './copy';
  13. import { CollapseShortcut } from './collapse';
  14. export function shortcuts(shortcutsRegistry: ShortcutsRegistry, ctx: FreeLayoutPluginContext) {
  15. shortcutsRegistry.addHandlers(
  16. new CopyShortcut(ctx),
  17. new PasteShortcut(ctx),
  18. new SelectAllShortcut(ctx),
  19. new CollapseShortcut(ctx),
  20. new ExpandShortcut(ctx),
  21. new DeleteShortcut(ctx),
  22. new ZoomInShortcut(ctx),
  23. new ZoomOutShortcut(ctx)
  24. );
  25. }