storage-explorer.ts 4.3 KB

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