From e31f848c56c918605cbcfea371cb6cf28666003d Mon Sep 17 00:00:00 2001 From: sunshinesmilelk Date: Tue, 5 Dec 2023 19:32:06 +0800 Subject: [PATCH] fix: delete filetree menu --- .../mana-app/src/file-tree/file-tree-menu.ts | 26 ------------------- packages/mana-app/src/file-tree/index.ts | 1 - packages/mana-app/src/file-tree/module.ts | 3 +-- 3 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 packages/mana-app/src/file-tree/file-tree-menu.ts diff --git a/packages/mana-app/src/file-tree/file-tree-menu.ts b/packages/mana-app/src/file-tree/file-tree-menu.ts deleted file mode 100644 index 1e195ef..0000000 --- a/packages/mana-app/src/file-tree/file-tree-menu.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { CommandRegistry, MenuRegistry } from '@difizen/mana-core'; -import { CommandContribution, MenuContribution } from '@difizen/mana-core'; -import { singleton } from '@difizen/mana-syringe'; -import { PlusOutlined } from '@ant-design/icons'; -import { FileTreeContextMenuPath } from './file-tree-protocol'; - -export const FileTreeCommand = { - REMOVE: { - id: 'fileTree.command.remove', - icon: PlusOutlined, - label: '删除', - }, -}; - -@singleton({ contrib: [CommandContribution, MenuContribution] }) -export class FileTreeMenuContribution implements CommandContribution, MenuContribution { - registerCommands(command: CommandRegistry): void { - command.registerCommand(FileTreeCommand.REMOVE); - } - registerMenus(menu: MenuRegistry) { - menu.registerMenuAction(FileTreeContextMenuPath, { - id: 'fileTree.remove', - command: FileTreeCommand.REMOVE.id, - }); - } -} diff --git a/packages/mana-app/src/file-tree/index.ts b/packages/mana-app/src/file-tree/index.ts index 41e57be..5f6a2ba 100644 --- a/packages/mana-app/src/file-tree/index.ts +++ b/packages/mana-app/src/file-tree/index.ts @@ -2,6 +2,5 @@ export * from './files'; export * from './file-tree'; export * from './file-service'; export * from './file-tree-model'; -export * from './file-tree-menu'; export * from './file-tree-view'; export * from './module'; diff --git a/packages/mana-app/src/file-tree/module.ts b/packages/mana-app/src/file-tree/module.ts index f76755f..5353ec0 100644 --- a/packages/mana-app/src/file-tree/module.ts +++ b/packages/mana-app/src/file-tree/module.ts @@ -5,11 +5,10 @@ import { DefaultTreeNodeComponents, TreeModule, TreeNodeComponents } from '../tr import { FileService } from './file-service'; import { TreeNodeIcon } from './file-tree-icon'; import { FileTreeLabelProvider } from './file-tree-label-provider'; -import { FileTreeMenuContribution } from './file-tree-menu'; import { FileTreeView } from './file-tree-view'; export const FileTreeModule = ManaModule.create() - .register(FileTreeView, FileTreeMenuContribution) + .register(FileTreeView) .register(FileService, FileTreeLabelProvider) .register({ token: TreeNodeComponents,