@theia/core 1.18.0 → 1.21.0-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +3 -2
  2. package/lib/browser/about-dialog.d.ts.map +1 -1
  3. package/lib/browser/about-dialog.js +1 -1
  4. package/lib/browser/about-dialog.js.map +1 -1
  5. package/lib/browser/authentication-service.d.ts.map +1 -1
  6. package/lib/browser/authentication-service.js +1 -1
  7. package/lib/browser/authentication-service.js.map +1 -1
  8. package/lib/browser/color-registry.d.ts +3 -69
  9. package/lib/browser/color-registry.d.ts.map +1 -1
  10. package/lib/browser/color-registry.js +13 -27
  11. package/lib/browser/color-registry.js.map +1 -1
  12. package/lib/browser/common-frontend-contribution.d.ts +7 -13
  13. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  14. package/lib/browser/common-frontend-contribution.js +213 -250
  15. package/lib/browser/common-frontend-contribution.js.map +1 -1
  16. package/lib/browser/core-preferences.d.ts +1 -0
  17. package/lib/browser/core-preferences.d.ts.map +1 -1
  18. package/lib/browser/core-preferences.js +29 -19
  19. package/lib/browser/core-preferences.js.map +1 -1
  20. package/lib/browser/dialogs.d.ts +6 -0
  21. package/lib/browser/dialogs.d.ts.map +1 -1
  22. package/lib/browser/dialogs.js +10 -3
  23. package/lib/browser/dialogs.js.map +1 -1
  24. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  25. package/lib/browser/frontend-application-module.js +9 -5
  26. package/lib/browser/frontend-application-module.js.map +1 -1
  27. package/lib/browser/frontend-application.d.ts +6 -0
  28. package/lib/browser/frontend-application.d.ts.map +1 -1
  29. package/lib/browser/frontend-application.js +13 -0
  30. package/lib/browser/frontend-application.js.map +1 -1
  31. package/lib/browser/index.d.ts +1 -0
  32. package/lib/browser/index.d.ts.map +1 -1
  33. package/lib/browser/index.js +1 -0
  34. package/lib/browser/index.js.map +1 -1
  35. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.d.ts.map +1 -1
  36. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +16 -11
  37. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
  38. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +1 -1
  39. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
  40. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +6 -4
  41. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
  42. package/lib/browser/keyboard/keys.d.ts +2 -251
  43. package/lib/browser/keyboard/keys.d.ts.map +1 -1
  44. package/lib/browser/keyboard/keys.js +12 -614
  45. package/lib/browser/keyboard/keys.js.map +1 -1
  46. package/lib/browser/menu/browser-context-menu-renderer.d.ts +1 -1
  47. package/lib/browser/menu/browser-context-menu-renderer.d.ts.map +1 -1
  48. package/lib/browser/menu/browser-menu-plugin.d.ts +3 -0
  49. package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
  50. package/lib/browser/menu/browser-menu-plugin.js +24 -4
  51. package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
  52. package/lib/browser/messaging/ws-connection-provider.d.ts +3 -3
  53. package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
  54. package/lib/browser/messaging/ws-connection-provider.js +14 -4
  55. package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
  56. package/lib/browser/{nls.d.ts → nls-loader.d.ts} +1 -6
  57. package/lib/browser/nls-loader.d.ts.map +1 -0
  58. package/lib/browser/nls-loader.js +29 -0
  59. package/lib/browser/nls-loader.js.map +1 -0
  60. package/lib/browser/preferences/preference-provider.d.ts +0 -2
  61. package/lib/browser/preferences/preference-provider.d.ts.map +1 -1
  62. package/lib/browser/preferences/preference-provider.js +1 -5
  63. package/lib/browser/preferences/preference-provider.js.map +1 -1
  64. package/lib/browser/preferences/preference-service.spec.js +0 -3
  65. package/lib/browser/preferences/preference-service.spec.js.map +1 -1
  66. package/lib/browser/progress-status-bar-item.d.ts +1 -2
  67. package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
  68. package/lib/browser/progress-status-bar-item.js.map +1 -1
  69. package/lib/browser/quick-input/quick-command-frontend-contribution.d.ts.map +1 -1
  70. package/lib/browser/quick-input/quick-command-frontend-contribution.js +2 -1
  71. package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
  72. package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
  73. package/lib/browser/quick-input/quick-command-service.js +2 -2
  74. package/lib/browser/quick-input/quick-command-service.js.map +1 -1
  75. package/lib/browser/quick-input/quick-input-service.d.ts +1 -201
  76. package/lib/browser/quick-input/quick-input-service.d.ts.map +1 -1
  77. package/lib/browser/quick-input/quick-input-service.js +11 -93
  78. package/lib/browser/quick-input/quick-input-service.js.map +1 -1
  79. package/lib/browser/quick-input/quick-view-service.d.ts +1 -2
  80. package/lib/browser/quick-input/quick-view-service.d.ts.map +1 -1
  81. package/lib/browser/quick-input/quick-view-service.js.map +1 -1
  82. package/lib/browser/shell/application-shell.d.ts +10 -8
  83. package/lib/browser/shell/application-shell.d.ts.map +1 -1
  84. package/lib/browser/shell/application-shell.js +11 -19
  85. package/lib/browser/shell/application-shell.js.map +1 -1
  86. package/lib/browser/shell/current-widget-command-adapter.d.ts +39 -0
  87. package/lib/browser/shell/current-widget-command-adapter.d.ts.map +1 -0
  88. package/lib/browser/shell/current-widget-command-adapter.js +42 -0
  89. package/lib/browser/shell/current-widget-command-adapter.js.map +1 -0
  90. package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
  91. package/lib/browser/shell/shell-layout-restorer.js +5 -3
  92. package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
  93. package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
  94. package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
  95. package/lib/browser/shell/tab-bar-decorator.js.map +1 -1
  96. package/lib/browser/shell/tab-bar-toolbar.d.ts.map +1 -1
  97. package/lib/browser/shell/tab-bar-toolbar.js +2 -1
  98. package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
  99. package/lib/browser/shell/tab-bars.d.ts +22 -3
  100. package/lib/browser/shell/tab-bars.d.ts.map +1 -1
  101. package/lib/browser/shell/tab-bars.js +129 -10
  102. package/lib/browser/shell/tab-bars.js.map +1 -1
  103. package/lib/browser/storage-service.spec.js +1 -1
  104. package/lib/browser/storage-service.spec.js.map +1 -1
  105. package/lib/browser/theming.d.ts +5 -14
  106. package/lib/browser/theming.d.ts.map +1 -1
  107. package/lib/browser/theming.js +14 -0
  108. package/lib/browser/theming.js.map +1 -1
  109. package/lib/browser/tooltip-service.d.ts +52 -0
  110. package/lib/browser/tooltip-service.d.ts.map +1 -0
  111. package/lib/browser/tooltip-service.js +89 -0
  112. package/lib/browser/tooltip-service.js.map +1 -0
  113. package/lib/browser/tree/tree-model.d.ts.map +1 -1
  114. package/lib/browser/view-container.d.ts +55 -14
  115. package/lib/browser/view-container.d.ts.map +1 -1
  116. package/lib/browser/view-container.js +284 -66
  117. package/lib/browser/view-container.js.map +1 -1
  118. package/lib/browser/window/default-window-service.js +2 -2
  119. package/lib/browser/window/default-window-service.js.map +1 -1
  120. package/lib/browser/window/window-service.d.ts +1 -7
  121. package/lib/browser/window/window-service.d.ts.map +1 -1
  122. package/lib/browser/window/window-service.js +1 -5
  123. package/lib/browser/window/window-service.js.map +1 -1
  124. package/lib/browser/window-contribution.d.ts.map +1 -1
  125. package/lib/browser/window-contribution.js +2 -2
  126. package/lib/browser/window-contribution.js.map +1 -1
  127. package/lib/common/color.d.ts +84 -0
  128. package/lib/common/color.d.ts.map +1 -0
  129. package/lib/common/color.js +44 -0
  130. package/lib/common/color.js.map +1 -0
  131. package/lib/common/command.d.ts +1 -0
  132. package/lib/common/command.d.ts.map +1 -1
  133. package/lib/common/command.js +5 -2
  134. package/lib/common/command.js.map +1 -1
  135. package/lib/common/i18n/localization.d.ts +14 -0
  136. package/lib/common/i18n/localization.d.ts.map +1 -1
  137. package/lib/common/i18n/localization.js +54 -1
  138. package/lib/common/i18n/localization.js.map +1 -1
  139. package/lib/common/index.d.ts +1 -0
  140. package/lib/common/index.d.ts.map +1 -1
  141. package/lib/common/index.js +1 -0
  142. package/lib/common/index.js.map +1 -1
  143. package/lib/common/keys.d.ts +269 -0
  144. package/lib/common/keys.d.ts.map +1 -0
  145. package/lib/common/keys.js +634 -0
  146. package/lib/common/keys.js.map +1 -0
  147. package/lib/common/messaging/abstract-connection-provider.d.ts +1 -1
  148. package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
  149. package/lib/common/messaging/abstract-connection-provider.js +3 -1
  150. package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
  151. package/lib/common/messaging/proxy-factory.js +1 -1
  152. package/lib/common/messaging/proxy-factory.js.map +1 -1
  153. package/lib/common/nls.d.ts +28 -0
  154. package/lib/common/nls.d.ts.map +1 -0
  155. package/lib/common/nls.js +91 -0
  156. package/lib/common/nls.js.map +1 -0
  157. package/lib/common/path.d.ts +6 -0
  158. package/lib/common/path.d.ts.map +1 -1
  159. package/lib/common/path.js +16 -4
  160. package/lib/common/path.js.map +1 -1
  161. package/lib/common/path.spec.js +12 -0
  162. package/lib/common/path.spec.js.map +1 -1
  163. package/lib/common/promise-util.d.ts +5 -2
  164. package/lib/common/promise-util.d.ts.map +1 -1
  165. package/lib/common/promise-util.js +16 -1
  166. package/lib/common/promise-util.js.map +1 -1
  167. package/lib/common/promise-util.spec.d.ts +2 -0
  168. package/lib/common/promise-util.spec.d.ts.map +1 -0
  169. package/lib/common/promise-util.spec.js +42 -0
  170. package/lib/common/promise-util.spec.js.map +1 -0
  171. package/lib/common/quick-pick-service.d.ts +219 -1
  172. package/lib/common/quick-pick-service.d.ts.map +1 -1
  173. package/lib/common/quick-pick-service.js +108 -1
  174. package/lib/common/quick-pick-service.js.map +1 -1
  175. package/lib/common/theme.d.ts +30 -0
  176. package/lib/common/theme.d.ts.map +1 -0
  177. package/lib/common/theme.js +18 -0
  178. package/lib/common/theme.js.map +1 -0
  179. package/lib/common/window.d.ts +29 -0
  180. package/lib/common/window.d.ts.map +1 -0
  181. package/lib/common/window.js +23 -0
  182. package/lib/common/window.js.map +1 -0
  183. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts +9 -5
  184. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
  185. package/lib/electron-browser/menu/electron-context-menu-renderer.js +40 -15
  186. package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
  187. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +5 -8
  188. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  189. package/lib/electron-browser/menu/electron-main-menu-factory.js +10 -17
  190. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  191. package/lib/electron-browser/menu/electron-menu-contribution.d.ts +15 -7
  192. package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
  193. package/lib/electron-browser/menu/electron-menu-contribution.js +112 -42
  194. package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
  195. package/lib/electron-browser/window/electron-window-preferences.d.ts +1 -0
  196. package/lib/electron-browser/window/electron-window-preferences.d.ts.map +1 -1
  197. package/lib/electron-browser/window/electron-window-preferences.js +12 -1
  198. package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
  199. package/lib/electron-browser/window/electron-window-service.d.ts +1 -1
  200. package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
  201. package/lib/electron-common/electron-main-window-service.d.ts +1 -1
  202. package/lib/electron-common/electron-main-window-service.d.ts.map +1 -1
  203. package/lib/electron-common/electron-main-window-service.js.map +1 -1
  204. package/lib/electron-common/messaging/electron-messages.d.ts +20 -0
  205. package/lib/electron-common/messaging/electron-messages.d.ts.map +1 -0
  206. package/lib/electron-common/messaging/electron-messages.js +23 -0
  207. package/lib/electron-common/messaging/electron-messages.js.map +1 -0
  208. package/lib/electron-main/electron-main-application.d.ts +16 -0
  209. package/lib/electron-main/electron-main-application.d.ts.map +1 -1
  210. package/lib/electron-main/electron-main-application.js +91 -25
  211. package/lib/electron-main/electron-main-application.js.map +1 -1
  212. package/lib/electron-main/electron-main-window-service-impl.d.ts +1 -1
  213. package/lib/electron-main/electron-main-window-service-impl.d.ts.map +1 -1
  214. package/lib/electron-main/electron-main-window-service-impl.js.map +1 -1
  215. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +1 -1
  216. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
  217. package/lib/electron-main/messaging/electron-messaging-contribution.js +1 -2
  218. package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
  219. package/package.json +7 -5
  220. package/shared/@theia/application-package/lib/api.d.ts +1 -0
  221. package/shared/@theia/application-package/lib/api.js +1 -0
  222. package/src/browser/about-dialog.tsx +2 -2
  223. package/src/browser/authentication-service.ts +1 -2
  224. package/src/browser/color-registry.ts +3 -85
  225. package/src/browser/common-frontend-contribution.ts +179 -232
  226. package/src/browser/core-preferences.ts +32 -19
  227. package/src/browser/dialogs.ts +10 -3
  228. package/src/browser/frontend-application-module.ts +10 -5
  229. package/src/browser/frontend-application.ts +13 -0
  230. package/src/browser/index.ts +1 -0
  231. package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +16 -11
  232. package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +10 -4
  233. package/src/browser/keyboard/keys.ts +2 -675
  234. package/src/browser/menu/browser-context-menu-renderer.ts +1 -1
  235. package/src/browser/menu/browser-menu-plugin.ts +25 -5
  236. package/src/browser/messaging/ws-connection-provider.ts +13 -4
  237. package/src/browser/nls-loader.ts +26 -0
  238. package/src/browser/preferences/preference-provider.ts +1 -5
  239. package/src/browser/preferences/preference-service.spec.ts +0 -3
  240. package/src/browser/progress-status-bar-item.ts +1 -2
  241. package/src/browser/quick-input/quick-command-frontend-contribution.ts +2 -2
  242. package/src/browser/quick-input/quick-command-service.ts +2 -2
  243. package/src/browser/quick-input/quick-input-service.ts +1 -278
  244. package/src/browser/quick-input/quick-view-service.ts +1 -2
  245. package/src/browser/shell/application-shell.ts +21 -25
  246. package/src/browser/shell/current-widget-command-adapter.ts +57 -0
  247. package/src/browser/shell/shell-layout-restorer.ts +4 -3
  248. package/src/browser/shell/tab-bar-decorator.ts +1 -1
  249. package/src/browser/shell/tab-bar-toolbar.tsx +3 -1
  250. package/src/browser/shell/tab-bars.ts +133 -13
  251. package/src/browser/storage-service.spec.ts +1 -1
  252. package/src/browser/style/index.css +5 -0
  253. package/src/browser/style/sidepanel.css +8 -2
  254. package/src/browser/style/tabs.css +30 -0
  255. package/src/browser/style/tooltip.css +28 -0
  256. package/src/browser/style/view-container.css +9 -9
  257. package/src/browser/theming.ts +6 -17
  258. package/src/browser/tooltip-service.tsx +98 -0
  259. package/src/browser/tree/tree-model.ts +1 -1
  260. package/src/browser/view-container.ts +312 -80
  261. package/src/browser/window/default-window-service.ts +2 -2
  262. package/src/browser/window/window-service.ts +1 -9
  263. package/src/browser/window-contribution.ts +2 -2
  264. package/src/common/color.ts +100 -0
  265. package/src/common/command.ts +11 -2
  266. package/src/common/i18n/localization.ts +54 -0
  267. package/src/common/i18n/nls.metadata.json +20421 -0
  268. package/src/common/index.ts +1 -0
  269. package/src/common/keys.ts +693 -0
  270. package/src/common/messaging/abstract-connection-provider.ts +3 -1
  271. package/src/common/messaging/proxy-factory.ts +1 -1
  272. package/src/common/nls.ts +104 -0
  273. package/src/common/path.spec.ts +15 -0
  274. package/src/common/path.ts +16 -4
  275. package/src/common/promise-util.spec.ts +41 -0
  276. package/src/common/promise-util.ts +23 -4
  277. package/src/common/quick-pick-service.ts +299 -4
  278. package/src/common/theme.ts +32 -0
  279. package/src/common/window.ts +30 -0
  280. package/src/electron-browser/menu/electron-context-menu-renderer.ts +38 -16
  281. package/src/electron-browser/menu/electron-main-menu-factory.ts +10 -15
  282. package/src/electron-browser/menu/electron-menu-contribution.ts +129 -39
  283. package/src/electron-browser/menu/electron-menu-style.css +84 -0
  284. package/src/electron-browser/window/electron-window-preferences.ts +13 -1
  285. package/src/electron-browser/window/electron-window-service.ts +1 -1
  286. package/src/electron-common/electron-main-window-service.ts +1 -2
  287. package/src/electron-common/messaging/electron-messages.ts +20 -0
  288. package/src/electron-main/electron-main-application.ts +107 -24
  289. package/src/electron-main/electron-main-window-service-impl.ts +1 -2
  290. package/src/electron-main/messaging/electron-messaging-contribution.ts +1 -2
  291. package/lib/browser/nls.d.ts.map +0 -1
  292. package/lib/browser/nls.js +0 -64
  293. package/lib/browser/nls.js.map +0 -1
  294. package/src/browser/nls.ts +0 -65
@@ -31,7 +31,6 @@ exports.CommonFrontendContribution = exports.RECENT_COMMANDS_STORAGE_KEY = expor
31
31
  /* eslint-disable max-len, @typescript-eslint/indent */
32
32
  const debounce = require("lodash.debounce");
33
33
  const inversify_1 = require("inversify");
34
- const widgets_1 = require("@phosphor/widgets");
35
34
  const menu_1 = require("../common/menu");
36
35
  const command_1 = require("../common/command");
37
36
  const uri_command_handler_1 = require("../common/uri-command-handler");
@@ -61,9 +60,11 @@ const encoding_registry_1 = require("./encoding-registry");
61
60
  const encodings_1 = require("../common/encodings");
62
61
  const env_variables_1 = require("../common/env-variables");
63
62
  const authentication_service_1 = require("./authentication-service");
63
+ const saveable_1 = require("./saveable");
64
64
  const quick_input_1 = require("./quick-input");
65
65
  const localization_1 = require("../common/i18n/localization");
66
- const nls_1 = require("./nls");
66
+ const nls_1 = require("../common/nls");
67
+ const current_widget_command_adapter_1 = require("./shell/current-widget-command-adapter");
67
68
  var CommonMenus;
68
69
  (function (CommonMenus) {
69
70
  CommonMenus.FILE = [...menu_1.MAIN_MENU_BAR, '1_file'];
@@ -92,185 +93,194 @@ var CommonMenus;
92
93
  })(CommonMenus = exports.CommonMenus || (exports.CommonMenus = {}));
93
94
  var CommonCommands;
94
95
  (function (CommonCommands) {
95
- const FILE_CATEGORY = 'File';
96
- const VIEW_CATEGORY = 'View';
96
+ CommonCommands.FILE_CATEGORY = 'File';
97
+ CommonCommands.VIEW_CATEGORY = 'View';
98
+ CommonCommands.PREFERENCES_CATEGORY = 'Preferences';
99
+ CommonCommands.FILE_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.FILE_CATEGORY);
100
+ CommonCommands.VIEW_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.VIEW_CATEGORY);
101
+ CommonCommands.PREFERENCES_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.PREFERENCES_CATEGORY);
97
102
  CommonCommands.OPEN = {
98
103
  id: 'core.open',
99
104
  };
100
- CommonCommands.CUT = {
105
+ CommonCommands.CUT = command_1.Command.toDefaultLocalizedCommand({
101
106
  id: 'core.cut',
102
107
  label: 'Cut'
103
- };
104
- CommonCommands.COPY = {
108
+ });
109
+ CommonCommands.COPY = command_1.Command.toDefaultLocalizedCommand({
105
110
  id: 'core.copy',
106
111
  label: 'Copy'
107
- };
108
- CommonCommands.PASTE = {
112
+ });
113
+ CommonCommands.PASTE = command_1.Command.toDefaultLocalizedCommand({
109
114
  id: 'core.paste',
110
115
  label: 'Paste'
111
- };
112
- CommonCommands.COPY_PATH = {
116
+ });
117
+ CommonCommands.COPY_PATH = command_1.Command.toDefaultLocalizedCommand({
113
118
  id: 'core.copy.path',
114
119
  label: 'Copy Path'
115
- };
116
- CommonCommands.UNDO = {
120
+ });
121
+ CommonCommands.UNDO = command_1.Command.toDefaultLocalizedCommand({
117
122
  id: 'core.undo',
118
123
  label: 'Undo'
119
- };
120
- CommonCommands.REDO = {
124
+ });
125
+ CommonCommands.REDO = command_1.Command.toDefaultLocalizedCommand({
121
126
  id: 'core.redo',
122
127
  label: 'Redo'
123
- };
124
- CommonCommands.SELECT_ALL = {
128
+ });
129
+ CommonCommands.SELECT_ALL = command_1.Command.toDefaultLocalizedCommand({
125
130
  id: 'core.selectAll',
126
131
  label: 'Select All'
127
- };
128
- CommonCommands.FIND = {
132
+ });
133
+ CommonCommands.FIND = command_1.Command.toDefaultLocalizedCommand({
129
134
  id: 'core.find',
130
135
  label: 'Find'
131
- };
132
- CommonCommands.REPLACE = {
136
+ });
137
+ CommonCommands.REPLACE = command_1.Command.toDefaultLocalizedCommand({
133
138
  id: 'core.replace',
134
139
  label: 'Replace'
135
- };
136
- CommonCommands.NEXT_TAB = {
140
+ });
141
+ CommonCommands.NEXT_TAB = command_1.Command.toDefaultLocalizedCommand({
137
142
  id: 'core.nextTab',
138
- category: VIEW_CATEGORY,
139
- label: 'Switch to Next Tab'
140
- };
141
- CommonCommands.PREVIOUS_TAB = {
143
+ category: CommonCommands.VIEW_CATEGORY,
144
+ label: 'Show Next Tab'
145
+ });
146
+ CommonCommands.PREVIOUS_TAB = command_1.Command.toDefaultLocalizedCommand({
142
147
  id: 'core.previousTab',
143
- category: VIEW_CATEGORY,
144
- label: 'Switch to Previous Tab'
145
- };
146
- CommonCommands.NEXT_TAB_IN_GROUP = {
148
+ category: CommonCommands.VIEW_CATEGORY,
149
+ label: 'Show Previous Tab'
150
+ });
151
+ CommonCommands.NEXT_TAB_IN_GROUP = command_1.Command.toLocalizedCommand({
147
152
  id: 'core.nextTabInGroup',
148
- category: VIEW_CATEGORY,
153
+ category: CommonCommands.VIEW_CATEGORY,
149
154
  label: 'Switch to Next Tab in Group'
150
- };
151
- CommonCommands.PREVIOUS_TAB_IN_GROUP = {
155
+ }, 'theia/core/common/showNextTabInGroup', CommonCommands.VIEW_CATEGORY_KEY);
156
+ CommonCommands.PREVIOUS_TAB_IN_GROUP = command_1.Command.toLocalizedCommand({
152
157
  id: 'core.previousTabInGroup',
153
- category: VIEW_CATEGORY,
158
+ category: CommonCommands.VIEW_CATEGORY,
154
159
  label: 'Switch to Previous Tab in Group'
155
- };
156
- CommonCommands.NEXT_TAB_GROUP = {
160
+ }, 'theia/core/common/showPreviousTabInGroup', CommonCommands.VIEW_CATEGORY_KEY);
161
+ CommonCommands.NEXT_TAB_GROUP = command_1.Command.toLocalizedCommand({
157
162
  id: 'core.nextTabGroup',
158
- category: VIEW_CATEGORY,
163
+ category: CommonCommands.VIEW_CATEGORY,
159
164
  label: 'Switch to Next Tab Group'
160
- };
161
- CommonCommands.PREVIOUS_TAB_GROUP = {
165
+ }, 'theia/core/common/showNextTabGroup', CommonCommands.VIEW_CATEGORY_KEY);
166
+ CommonCommands.PREVIOUS_TAB_GROUP = command_1.Command.toLocalizedCommand({
162
167
  id: 'core.previousTabBar',
163
- category: VIEW_CATEGORY,
168
+ category: CommonCommands.VIEW_CATEGORY,
164
169
  label: 'Switch to Previous Tab Group'
165
- };
166
- CommonCommands.CLOSE_TAB = {
170
+ }, 'theia/core/common/showPreviousTabGroup', CommonCommands.VIEW_CATEGORY_KEY);
171
+ CommonCommands.CLOSE_TAB = command_1.Command.toLocalizedCommand({
167
172
  id: 'core.close.tab',
168
- category: VIEW_CATEGORY,
173
+ category: CommonCommands.VIEW_CATEGORY,
169
174
  label: 'Close Tab'
170
- };
171
- CommonCommands.CLOSE_OTHER_TABS = {
175
+ }, 'theia/core/common/closeTab', CommonCommands.VIEW_CATEGORY_KEY);
176
+ CommonCommands.CLOSE_OTHER_TABS = command_1.Command.toLocalizedCommand({
172
177
  id: 'core.close.other.tabs',
173
- category: VIEW_CATEGORY,
178
+ category: CommonCommands.VIEW_CATEGORY,
174
179
  label: 'Close Other Tabs'
175
- };
176
- CommonCommands.CLOSE_RIGHT_TABS = {
180
+ }, 'theia/core/common/closeOthers', CommonCommands.VIEW_CATEGORY_KEY);
181
+ CommonCommands.CLOSE_SAVED_TABS = command_1.Command.toDefaultLocalizedCommand({
182
+ id: 'workbench.action.closeUnmodifiedEditors',
183
+ category: CommonCommands.VIEW_CATEGORY,
184
+ label: 'Close Saved Editors in Group',
185
+ });
186
+ CommonCommands.CLOSE_RIGHT_TABS = command_1.Command.toLocalizedCommand({
177
187
  id: 'core.close.right.tabs',
178
- category: VIEW_CATEGORY,
188
+ category: CommonCommands.VIEW_CATEGORY,
179
189
  label: 'Close Tabs to the Right'
180
- };
181
- CommonCommands.CLOSE_ALL_TABS = {
190
+ }, 'theia/core/common/closeRight', CommonCommands.VIEW_CATEGORY_KEY);
191
+ CommonCommands.CLOSE_ALL_TABS = command_1.Command.toLocalizedCommand({
182
192
  id: 'core.close.all.tabs',
183
- category: VIEW_CATEGORY,
193
+ category: CommonCommands.VIEW_CATEGORY,
184
194
  label: 'Close All Tabs'
185
- };
186
- CommonCommands.CLOSE_MAIN_TAB = {
195
+ }, 'theia/core/common/closeAll', CommonCommands.VIEW_CATEGORY_KEY);
196
+ CommonCommands.CLOSE_MAIN_TAB = command_1.Command.toLocalizedCommand({
187
197
  id: 'core.close.main.tab',
188
- category: VIEW_CATEGORY,
198
+ category: CommonCommands.VIEW_CATEGORY,
189
199
  label: 'Close Tab in Main Area'
190
- };
191
- CommonCommands.CLOSE_OTHER_MAIN_TABS = {
200
+ }, 'theia/core/common/closeTabMain', CommonCommands.VIEW_CATEGORY_KEY);
201
+ CommonCommands.CLOSE_OTHER_MAIN_TABS = command_1.Command.toLocalizedCommand({
192
202
  id: 'core.close.other.main.tabs',
193
- category: VIEW_CATEGORY,
203
+ category: CommonCommands.VIEW_CATEGORY,
194
204
  label: 'Close Other Tabs in Main Area'
195
- };
196
- CommonCommands.CLOSE_ALL_MAIN_TABS = {
205
+ }, 'theia/core/common/closeOtherTabMain', CommonCommands.VIEW_CATEGORY_KEY);
206
+ CommonCommands.CLOSE_ALL_MAIN_TABS = command_1.Command.toLocalizedCommand({
197
207
  id: 'core.close.all.main.tabs',
198
- category: VIEW_CATEGORY,
208
+ category: CommonCommands.VIEW_CATEGORY,
199
209
  label: 'Close All Tabs in Main Area'
200
- };
201
- CommonCommands.COLLAPSE_PANEL = {
210
+ }, 'theia/core/common/closeAllTabMain', CommonCommands.VIEW_CATEGORY_KEY);
211
+ CommonCommands.COLLAPSE_PANEL = command_1.Command.toLocalizedCommand({
202
212
  id: 'core.collapse.tab',
203
- category: VIEW_CATEGORY,
213
+ category: CommonCommands.VIEW_CATEGORY,
204
214
  label: 'Collapse Side Panel'
205
- };
206
- CommonCommands.COLLAPSE_ALL_PANELS = {
215
+ }, 'theia/core/common/collapseTab', CommonCommands.VIEW_CATEGORY_KEY);
216
+ CommonCommands.COLLAPSE_ALL_PANELS = command_1.Command.toLocalizedCommand({
207
217
  id: 'core.collapse.all.tabs',
208
- category: VIEW_CATEGORY,
218
+ category: CommonCommands.VIEW_CATEGORY,
209
219
  label: 'Collapse All Side Panels'
210
- };
211
- CommonCommands.TOGGLE_BOTTOM_PANEL = {
220
+ }, 'theia/core/common/collapseAllTabs', CommonCommands.VIEW_CATEGORY_KEY);
221
+ CommonCommands.TOGGLE_BOTTOM_PANEL = command_1.Command.toLocalizedCommand({
212
222
  id: 'core.toggle.bottom.panel',
213
- category: VIEW_CATEGORY,
223
+ category: CommonCommands.VIEW_CATEGORY,
214
224
  label: 'Toggle Bottom Panel'
215
- };
216
- CommonCommands.TOGGLE_STATUS_BAR = {
225
+ }, 'theia/core/common/collapseBottomPanel', CommonCommands.VIEW_CATEGORY_KEY);
226
+ CommonCommands.TOGGLE_STATUS_BAR = command_1.Command.toDefaultLocalizedCommand({
217
227
  id: 'workbench.action.toggleStatusbarVisibility',
218
- category: VIEW_CATEGORY,
228
+ category: CommonCommands.VIEW_CATEGORY,
219
229
  label: 'Toggle Status Bar Visibility'
220
- };
221
- CommonCommands.TOGGLE_MAXIMIZED = {
230
+ });
231
+ CommonCommands.TOGGLE_MAXIMIZED = command_1.Command.toLocalizedCommand({
222
232
  id: 'core.toggleMaximized',
223
- category: VIEW_CATEGORY,
233
+ category: CommonCommands.VIEW_CATEGORY,
224
234
  label: 'Toggle Maximized'
225
- };
226
- CommonCommands.OPEN_VIEW = {
235
+ }, 'theia/core/common/toggleMaximized', CommonCommands.VIEW_CATEGORY_KEY);
236
+ CommonCommands.OPEN_VIEW = command_1.Command.toDefaultLocalizedCommand({
227
237
  id: 'core.openView',
228
- category: VIEW_CATEGORY,
238
+ category: CommonCommands.VIEW_CATEGORY,
229
239
  label: 'Open View...'
230
- };
231
- CommonCommands.SAVE = {
240
+ });
241
+ CommonCommands.SAVE = command_1.Command.toDefaultLocalizedCommand({
232
242
  id: 'core.save',
233
- category: FILE_CATEGORY,
243
+ category: CommonCommands.FILE_CATEGORY,
234
244
  label: 'Save',
235
- };
236
- CommonCommands.SAVE_WITHOUT_FORMATTING = {
245
+ });
246
+ CommonCommands.SAVE_WITHOUT_FORMATTING = command_1.Command.toDefaultLocalizedCommand({
237
247
  id: 'core.saveWithoutFormatting',
238
- category: FILE_CATEGORY,
248
+ category: CommonCommands.FILE_CATEGORY,
239
249
  label: 'Save without Formatting',
240
- };
241
- CommonCommands.SAVE_ALL = {
250
+ });
251
+ CommonCommands.SAVE_ALL = command_1.Command.toDefaultLocalizedCommand({
242
252
  id: 'core.saveAll',
243
- category: FILE_CATEGORY,
253
+ category: CommonCommands.FILE_CATEGORY,
244
254
  label: 'Save All',
245
- };
246
- CommonCommands.AUTO_SAVE = {
255
+ });
256
+ CommonCommands.AUTO_SAVE = command_1.Command.toDefaultLocalizedCommand({
247
257
  id: 'textEditor.commands.autosave',
248
- category: FILE_CATEGORY,
258
+ category: CommonCommands.FILE_CATEGORY,
249
259
  label: 'Auto Save',
250
- };
251
- CommonCommands.ABOUT_COMMAND = {
260
+ });
261
+ CommonCommands.ABOUT_COMMAND = command_1.Command.toDefaultLocalizedCommand({
252
262
  id: 'core.about',
253
263
  label: 'About'
254
- };
255
- CommonCommands.OPEN_PREFERENCES = {
264
+ });
265
+ CommonCommands.OPEN_PREFERENCES = command_1.Command.toDefaultLocalizedCommand({
256
266
  id: 'preferences:open',
257
- category: 'Settings',
258
- label: 'Open Preferences',
259
- };
260
- CommonCommands.SELECT_COLOR_THEME = {
267
+ category: CommonCommands.PREFERENCES_CATEGORY,
268
+ label: 'Open Settings (UI)',
269
+ });
270
+ CommonCommands.SELECT_COLOR_THEME = command_1.Command.toDefaultLocalizedCommand({
261
271
  id: 'workbench.action.selectTheme',
262
272
  label: 'Color Theme',
263
- category: 'Preferences'
264
- };
265
- CommonCommands.SELECT_ICON_THEME = {
273
+ category: CommonCommands.PREFERENCES_CATEGORY
274
+ });
275
+ CommonCommands.SELECT_ICON_THEME = command_1.Command.toDefaultLocalizedCommand({
266
276
  id: 'workbench.action.selectIconTheme',
267
277
  label: 'File Icon Theme',
268
- category: 'Preferences'
269
- };
270
- CommonCommands.CONFIGURE_DISPLAY_LANGUAGE = command_1.Command.toLocalizedCommand({
278
+ category: CommonCommands.PREFERENCES_CATEGORY
279
+ });
280
+ CommonCommands.CONFIGURE_DISPLAY_LANGUAGE = command_1.Command.toDefaultLocalizedCommand({
271
281
  id: 'workbench.action.configureLanguage',
272
282
  label: 'Configure Display Language'
273
- }, 'vscode/localizationsActions/configureLocale');
283
+ });
274
284
  })(CommonCommands = exports.CommonCommands || (exports.CommonCommands = {}));
275
285
  exports.supportCut = browser.isNative || document.queryCommandSupported('cut');
276
286
  exports.supportCopy = browser.isNative || document.queryCommandSupported('copy');
@@ -311,14 +321,14 @@ let CommonFrontendContribution = class CommonFrontendContribution {
311
321
  app.shell.leftPanelHandler.addBottomMenu({
312
322
  id: 'settings-menu',
313
323
  iconClass: 'codicon codicon-settings-gear',
314
- title: 'Settings',
324
+ title: nls_1.nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY),
315
325
  menuPath: menu_1.SETTINGS_MENU,
316
326
  order: 0,
317
327
  });
318
328
  const accountsMenu = {
319
329
  id: 'accounts-menu',
320
330
  iconClass: 'codicon codicon-person',
321
- title: 'Accounts',
331
+ title: nls_1.nls.localizeByDefault('Accounts'),
322
332
  menuPath: menu_1.ACCOUNTS_MENU,
323
333
  order: 1,
324
334
  };
@@ -380,7 +390,7 @@ let CommonFrontendContribution = class CommonFrontendContribution {
380
390
  this.shell.leftPanelHandler.addTopMenu({
381
391
  id: mainMenuId,
382
392
  iconClass: 'codicon codicon-menu',
383
- title: 'Application Menu',
393
+ title: nls_1.nls.localizeByDefault('Application Menu'),
384
394
  menuPath: ['menubar'],
385
395
  order: 0,
386
396
  });
@@ -410,10 +420,10 @@ let CommonFrontendContribution = class CommonFrontendContribution {
410
420
  this.selectionService.onSelectionChanged(updateContextKeys);
411
421
  }
412
422
  registerMenus(registry) {
413
- registry.registerSubmenu(CommonMenus.FILE, 'File');
414
- registry.registerSubmenu(CommonMenus.EDIT, 'Edit');
415
- registry.registerSubmenu(CommonMenus.VIEW, 'View');
416
- registry.registerSubmenu(CommonMenus.HELP, 'Help');
423
+ registry.registerSubmenu(CommonMenus.FILE, nls_1.nls.localizeByDefault('File'));
424
+ registry.registerSubmenu(CommonMenus.EDIT, nls_1.nls.localizeByDefault('Edit'));
425
+ registry.registerSubmenu(CommonMenus.VIEW, nls_1.nls.localizeByDefault('View'));
426
+ registry.registerSubmenu(CommonMenus.HELP, nls_1.nls.localizeByDefault('Help'));
417
427
  registry.registerMenuAction(CommonMenus.FILE_SAVE, {
418
428
  commandId: CommonCommands.SAVE.id
419
429
  });
@@ -423,7 +433,7 @@ let CommonFrontendContribution = class CommonFrontendContribution {
423
433
  registry.registerMenuAction(CommonMenus.FILE_AUTOSAVE, {
424
434
  commandId: CommonCommands.AUTO_SAVE.id
425
435
  });
426
- registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, 'Settings');
436
+ registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls_1.nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY));
427
437
  registry.registerMenuAction(CommonMenus.EDIT_UNDO, {
428
438
  commandId: CommonCommands.UNDO.id,
429
439
  order: '0'
@@ -469,39 +479,49 @@ let CommonFrontendContribution = class CommonFrontendContribution {
469
479
  commandId: CommonCommands.COLLAPSE_ALL_PANELS.id,
470
480
  order: '2'
471
481
  });
472
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
482
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
473
483
  commandId: CommonCommands.CLOSE_TAB.id,
474
- label: 'Close',
484
+ label: nls_1.nls.localizeByDefault('Close'),
475
485
  order: '0'
476
486
  });
477
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
487
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
478
488
  commandId: CommonCommands.CLOSE_OTHER_TABS.id,
479
- label: 'Close Others',
489
+ label: nls_1.nls.localizeByDefault('Close Others'),
480
490
  order: '1'
481
491
  });
482
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
492
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
483
493
  commandId: CommonCommands.CLOSE_RIGHT_TABS.id,
484
- label: 'Close to the Right',
494
+ label: nls_1.nls.localizeByDefault('Close to the Right'),
485
495
  order: '2'
486
496
  });
487
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
497
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
498
+ commandId: CommonCommands.CLOSE_SAVED_TABS.id,
499
+ label: nls_1.nls.localizeByDefault('Close Saved'),
500
+ order: '3',
501
+ });
502
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
488
503
  commandId: CommonCommands.CLOSE_ALL_TABS.id,
489
- label: 'Close All',
490
- order: '3'
504
+ label: nls_1.nls.localizeByDefault('Close All'),
505
+ order: '4'
491
506
  });
492
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
507
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
493
508
  commandId: CommonCommands.COLLAPSE_PANEL.id,
494
- label: 'Collapse',
495
- order: '4'
509
+ label: CommonCommands.COLLAPSE_PANEL.label,
510
+ order: '5'
496
511
  });
497
- registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_MENU, {
512
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
498
513
  commandId: CommonCommands.TOGGLE_MAXIMIZED.id,
499
- label: 'Toggle Maximized',
500
- order: '5'
514
+ label: CommonCommands.TOGGLE_MAXIMIZED.label,
515
+ order: '6'
516
+ });
517
+ registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_COPY, {
518
+ commandId: CommonCommands.COPY_PATH.id,
519
+ label: CommonCommands.COPY_PATH.label,
520
+ order: '1',
501
521
  });
502
522
  registry.registerMenuAction(CommonMenus.HELP, {
503
523
  commandId: CommonCommands.ABOUT_COMMAND.id,
504
- label: 'About',
524
+ label: CommonCommands.ABOUT_COMMAND.label,
505
525
  order: '9'
506
526
  });
507
527
  registry.registerMenuAction(CommonMenus.VIEW_PRIMARY, {
@@ -555,6 +575,8 @@ let CommonFrontendContribution = class CommonFrontendContribution {
555
575
  }
556
576
  });
557
577
  commandRegistry.registerCommand(CommonCommands.COPY_PATH, uri_command_handler_1.UriAwareCommandHandler.MultiSelect(this.selectionService, {
578
+ isVisible: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
579
+ isEnabled: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
558
580
  execute: async (uris) => {
559
581
  if (uris.length) {
560
582
  const lineDelimiter = os_1.isWindows ? '\r\n' : '\n';
@@ -605,62 +627,58 @@ let CommonFrontendContribution = class CommonFrontendContribution {
605
627
  isEnabled: () => this.shell.previousTabBar() !== undefined,
606
628
  execute: () => this.shell.activatePreviousTabBar()
607
629
  });
608
- commandRegistry.registerCommand(CommonCommands.CLOSE_TAB, {
609
- isEnabled: (event) => {
610
- const tabBar = this.shell.findTabBar(event);
611
- if (!tabBar) {
612
- return false;
613
- }
614
- const currentTitle = this.shell.findTitle(tabBar, event);
615
- return currentTitle !== undefined && currentTitle.closable;
616
- },
617
- execute: (event) => {
618
- const tabBar = this.shell.findTabBar(event);
619
- const currentTitle = this.shell.findTitle(tabBar, event);
620
- this.shell.closeTabs(tabBar, title => title === currentTitle);
621
- }
622
- });
623
- commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_TABS, {
624
- isEnabled: (event) => {
625
- const tabBar = this.shell.findTabBar(event);
626
- if (!tabBar) {
627
- return false;
628
- }
629
- const currentTitle = this.shell.findTitle(tabBar, event);
630
- return tabBar.titles.some(title => title !== currentTitle && title.closable);
631
- },
632
- execute: (event) => {
633
- const tabBar = this.shell.findTabBar(event);
634
- const currentTitle = this.shell.findTitle(tabBar, event);
635
- this.shell.closeTabs(tabBar, title => title !== currentTitle && title.closable);
636
- }
637
- });
638
- commandRegistry.registerCommand(CommonCommands.CLOSE_RIGHT_TABS, {
639
- isEnabled: (event) => {
640
- const tabBar = this.shell.findTabBar(event);
641
- if (!tabBar) {
642
- return false;
643
- }
644
- const currentIndex = this.findTitleIndex(tabBar, event);
645
- return tabBar.titles.some((title, index) => index > currentIndex && title.closable);
630
+ commandRegistry.registerCommand(CommonCommands.CLOSE_TAB, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
631
+ isEnabled: title => Boolean(title === null || title === void 0 ? void 0 : title.closable),
632
+ execute: (title, tabBar) => tabBar && this.shell.closeTabs(tabBar, candidate => candidate === title),
633
+ }));
634
+ commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
635
+ isEnabled: (title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate !== title && candidate.closable)),
636
+ execute: (title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate !== title && candidate.closable),
637
+ }));
638
+ commandRegistry.registerCommand(CommonCommands.CLOSE_SAVED_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
639
+ isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner))),
640
+ execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner)),
641
+ }));
642
+ commandRegistry.registerCommand(CommonCommands.CLOSE_RIGHT_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
643
+ isEnabled: (title, tabbar) => {
644
+ let targetSeen = false;
645
+ return Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => {
646
+ if (targetSeen && candidate.closable) {
647
+ return true;
648
+ }
649
+ ;
650
+ if (candidate === title) {
651
+ targetSeen = true;
652
+ }
653
+ ;
654
+ }));
646
655
  },
647
- isVisible: (event) => {
648
- const area = this.findTabArea(event);
656
+ isVisible: (_title, tabbar) => {
657
+ var _a;
658
+ const area = (_a = (tabbar && this.shell.getAreaFor(tabbar))) !== null && _a !== void 0 ? _a : this.shell.currentTabArea;
649
659
  return area !== undefined && area !== 'left' && area !== 'right';
650
660
  },
651
- execute: (event) => {
652
- const tabBar = this.shell.findTabBar(event);
653
- const currentIndex = this.findTitleIndex(tabBar, event);
654
- this.shell.closeTabs(tabBar, (title, index) => index > currentIndex && title.closable);
661
+ execute: (title, tabbar) => {
662
+ if (tabbar) {
663
+ let targetSeen = false;
664
+ this.shell.closeTabs(tabbar, candidate => {
665
+ if (targetSeen && candidate.closable) {
666
+ return true;
667
+ }
668
+ ;
669
+ if (candidate === title) {
670
+ targetSeen = true;
671
+ }
672
+ ;
673
+ return false;
674
+ });
675
+ }
655
676
  }
656
- });
657
- commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, {
658
- isEnabled: (event) => {
659
- const tabBar = this.shell.findTabBar(event);
660
- return tabBar !== undefined && tabBar.titles.some(title => title.closable);
661
- },
662
- execute: (event) => this.shell.closeTabs(this.shell.findTabBar(event), title => title.closable)
663
- });
677
+ }));
678
+ commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
679
+ isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(title => title.closable)),
680
+ execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable),
681
+ }));
664
682
  commandRegistry.registerCommand(CommonCommands.CLOSE_MAIN_TAB, {
665
683
  isEnabled: () => {
666
684
  const currentWidget = this.shell.getCurrentWidget('main');
@@ -683,11 +701,11 @@ let CommonFrontendContribution = class CommonFrontendContribution {
683
701
  isEnabled: () => this.shell.mainAreaTabBars.some(tb => tb.titles.some(title => title.closable)),
684
702
  execute: () => this.shell.closeTabs('main', title => title.closable)
685
703
  });
686
- commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, {
687
- isEnabled: (event) => application_shell_1.ApplicationShell.isSideArea(this.findTabArea(event)),
688
- isVisible: (event) => application_shell_1.ApplicationShell.isSideArea(this.findTabArea(event)),
689
- execute: (event) => this.shell.collapsePanel(this.findTabArea(event))
690
- });
704
+ commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
705
+ isEnabled: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
706
+ isVisible: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
707
+ execute: (_title, tabbar) => tabbar && this.shell.collapsePanel(this.shell.getAreaFor(tabbar))
708
+ }));
691
709
  commandRegistry.registerCommand(CommonCommands.COLLAPSE_ALL_PANELS, {
692
710
  execute: () => {
693
711
  this.shell.collapsePanel('left');
@@ -709,11 +727,11 @@ let CommonFrontendContribution = class CommonFrontendContribution {
709
727
  commandRegistry.registerCommand(CommonCommands.TOGGLE_STATUS_BAR, {
710
728
  execute: () => this.preferenceService.updateValue('workbench.statusBar.visible', !this.preferences['workbench.statusBar.visible'])
711
729
  });
712
- commandRegistry.registerCommand(CommonCommands.TOGGLE_MAXIMIZED, {
713
- isEnabled: (event) => this.canToggleMaximized(event),
714
- isVisible: (event) => this.canToggleMaximized(event),
715
- execute: (event) => this.toggleMaximized(event)
716
- });
730
+ commandRegistry.registerCommand(CommonCommands.TOGGLE_MAXIMIZED, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
731
+ isEnabled: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
732
+ isVisible: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
733
+ execute: title => (title === null || title === void 0 ? void 0 : title.owner) && this.shell.toggleMaximized(title === null || title === void 0 ? void 0 : title.owner),
734
+ }));
717
735
  commandRegistry.registerCommand(CommonCommands.SAVE, {
718
736
  execute: () => this.shell.save({ formatType: 1 /* ON */ })
719
737
  });
@@ -739,61 +757,6 @@ let CommonFrontendContribution = class CommonFrontendContribution {
739
757
  execute: () => this.configureDisplayLanguage()
740
758
  });
741
759
  }
742
- findTabArea(event) {
743
- const tabBar = this.shell.findTabBar(event);
744
- if (tabBar) {
745
- return this.shell.getAreaFor(tabBar);
746
- }
747
- return this.shell.currentTabArea;
748
- }
749
- /**
750
- * Finds the index of the selected title from the tab-bar.
751
- * @param tabBar: used for providing an array of titles.
752
- * @returns the index of the selected title if it is available in the tab-bar, else returns the index of currently-selected title.
753
- */
754
- findTitleIndex(tabBar, event) {
755
- if (event) {
756
- const targetTitle = this.shell.findTitle(tabBar, event);
757
- return targetTitle ? tabBar.titles.indexOf(targetTitle) : tabBar.currentIndex;
758
- }
759
- return tabBar.currentIndex;
760
- }
761
- canToggleMaximized(event) {
762
- if ((event === null || event === void 0 ? void 0 : event.target) instanceof HTMLElement) {
763
- const widget = this.shell.findWidgetForElement(event.target);
764
- if (widget) {
765
- return this.shell.mainPanel.contains(widget) || this.shell.bottomPanel.contains(widget);
766
- }
767
- }
768
- return this.shell.canToggleMaximized();
769
- }
770
- /**
771
- * Maximize the bottom or the main dockpanel based on the widget.
772
- * @param event used to find the selected widget.
773
- */
774
- toggleMaximized(event) {
775
- if ((event === null || event === void 0 ? void 0 : event.target) instanceof HTMLElement) {
776
- const widget = this.shell.findWidgetForElement(event.target);
777
- if (widget) {
778
- if (this.shell.mainPanel.contains(widget)) {
779
- this.shell.mainPanel.toggleMaximized();
780
- }
781
- else if (this.shell.bottomPanel.contains(widget)) {
782
- this.shell.bottomPanel.toggleMaximized();
783
- }
784
- if (widget instanceof widgets_1.TabBar) {
785
- // reveals the widget when maximized.
786
- const title = this.shell.findTitle(widget, event);
787
- if (title) {
788
- this.shell.revealWidget(title.owner.id);
789
- }
790
- }
791
- }
792
- }
793
- else {
794
- this.shell.toggleMaximized();
795
- }
796
- }
797
760
  isElectron() {
798
761
  return environment_1.environment.electron.is();
799
762
  }
@@ -963,7 +926,7 @@ let CommonFrontendContribution = class CommonFrontendContribution {
963
926
  return a.label.localeCompare(b.label);
964
927
  });
965
928
  (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
966
- placeholder: 'Select File Icon Theme',
929
+ placeholder: nls_1.nls.localizeByDefault('Select File Icon Theme'),
967
930
  activeItem: items.find(item => item.id === resetTo),
968
931
  onDidChangeSelection: (quickPick, selectedItems) => {
969
932
  resetTo = undefined;
@@ -1000,7 +963,7 @@ let CommonFrontendContribution = class CommonFrontendContribution {
1000
963
  }
1001
964
  const items = [...itemsByTheme.light, ...itemsByTheme.dark, ...itemsByTheme.hc];
1002
965
  (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
1003
- placeholder: 'Select Color Theme (Up/Down Keys to Preview)',
966
+ placeholder: nls_1.nls.localizeByDefault('Select Color Theme (Up/Down Keys to Preview)'),
1004
967
  activeItem: items.find((item) => item.id === resetTo),
1005
968
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1006
969
  onDidChangeSelection: (quickPick, selectedItems) => {