storage-explorer.ts105 lines · main
| 1 | // @ts-nocheck |
| 2 | import { RegistryDefinations } from '../types' |
| 3 | |
| 4 | /** |
| 5 | * Shortcuts scoped to the Storage Explorer (file browser inside a bucket). |
| 6 | * |
| 7 | * `Shift+F` (focus search) is provided by the shared `LIST_PAGE_FOCUS_SEARCH` |
| 8 | * shortcut and reused here via a contextual `label` override. |
| 9 | */ |
| 10 | export const STORAGE_EXPLORER_SHORTCUT_IDS = { |
| 11 | STORAGE_EXPLORER_REFRESH: 'storage-explorer.refresh', |
| 12 | STORAGE_EXPLORER_UPLOAD: 'storage-explorer.upload', |
| 13 | STORAGE_EXPLORER_NEW_FOLDER: 'storage-explorer.new-folder', |
| 14 | STORAGE_EXPLORER_VIEW_COLUMNS: 'storage-explorer.view-columns', |
| 15 | STORAGE_EXPLORER_VIEW_LIST: 'storage-explorer.view-list', |
| 16 | STORAGE_EXPLORER_DOWNLOAD_SELECTED: 'storage-explorer.download-selected', |
| 17 | STORAGE_EXPLORER_MOVE_SELECTED: 'storage-explorer.move-selected', |
| 18 | STORAGE_EXPLORER_DELETE_SELECTED: 'storage-explorer.delete-selected', |
| 19 | STORAGE_EXPLORER_EXIT_SELECTION: 'storage-explorer.exit-selection', |
| 20 | STORAGE_EXPLORER_CLOSE_PREVIEW: 'storage-explorer.close-preview', |
| 21 | STORAGE_EXPLORER_CLOSE_SEARCH: 'storage-explorer.close-search', |
| 22 | } |
| 23 | |
| 24 | export type StorageExplorerShortcutId = |
| 25 | (typeof STORAGE_EXPLORER_SHORTCUT_IDS)[keyof typeof STORAGE_EXPLORER_SHORTCUT_IDS] |
| 26 | |
| 27 | export const storageExplorerRegistry: RegistryDefinations<StorageExplorerShortcutId> = { |
| 28 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_REFRESH]: { |
| 29 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_REFRESH, |
| 30 | label: 'Refresh', |
| 31 | sequence: ['Shift+R'], |
| 32 | showInSettings: false, |
| 33 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 34 | }, |
| 35 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_UPLOAD]: { |
| 36 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_UPLOAD, |
| 37 | label: 'Upload files', |
| 38 | sequence: ['I', 'F'], |
| 39 | showInSettings: false, |
| 40 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 41 | }, |
| 42 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_NEW_FOLDER]: { |
| 43 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_NEW_FOLDER, |
| 44 | label: 'Create folder', |
| 45 | sequence: ['I', 'N'], |
| 46 | showInSettings: false, |
| 47 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 48 | }, |
| 49 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_VIEW_COLUMNS]: { |
| 50 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_VIEW_COLUMNS, |
| 51 | label: 'View as columns', |
| 52 | sequence: ['V', 'C'], |
| 53 | showInSettings: false, |
| 54 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 55 | }, |
| 56 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_VIEW_LIST]: { |
| 57 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_VIEW_LIST, |
| 58 | label: 'View as list', |
| 59 | sequence: ['V', 'L'], |
| 60 | showInSettings: false, |
| 61 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 62 | }, |
| 63 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_DOWNLOAD_SELECTED]: { |
| 64 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_DOWNLOAD_SELECTED, |
| 65 | label: 'Download selected items', |
| 66 | sequence: ['Shift+D'], |
| 67 | showInSettings: false, |
| 68 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 69 | }, |
| 70 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_MOVE_SELECTED]: { |
| 71 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_MOVE_SELECTED, |
| 72 | label: 'Move selected items', |
| 73 | sequence: ['Shift+M'], |
| 74 | showInSettings: false, |
| 75 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 76 | }, |
| 77 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_DELETE_SELECTED]: { |
| 78 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_DELETE_SELECTED, |
| 79 | label: 'Delete selected items', |
| 80 | sequence: ['Mod+Backspace'], |
| 81 | showInSettings: false, |
| 82 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 83 | }, |
| 84 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_EXIT_SELECTION]: { |
| 85 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_EXIT_SELECTION, |
| 86 | label: 'Clear item selection', |
| 87 | sequence: ['Escape'], |
| 88 | showInSettings: false, |
| 89 | options: { conflictBehavior: 'allow' }, |
| 90 | }, |
| 91 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_CLOSE_PREVIEW]: { |
| 92 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_CLOSE_PREVIEW, |
| 93 | label: 'Close file preview', |
| 94 | sequence: ['Escape'], |
| 95 | showInSettings: false, |
| 96 | options: { conflictBehavior: 'allow' }, |
| 97 | }, |
| 98 | [STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_CLOSE_SEARCH]: { |
| 99 | id: STORAGE_EXPLORER_SHORTCUT_IDS.STORAGE_EXPLORER_CLOSE_SEARCH, |
| 100 | label: 'Close search', |
| 101 | sequence: ['Escape'], |
| 102 | showInSettings: false, |
| 103 | options: { conflictBehavior: 'allow' }, |
| 104 | }, |
| 105 | } |