@codingame/monaco-vscode-view-title-bar-service-override 4.5.2 → 5.0.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-view-title-bar-service-override",
3
- "version": "4.5.2",
3
+ "version": "5.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
30
30
  }
31
31
  }
@@ -2,7 +2,6 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { isActiveDocument, reset } from 'vscode/vscode/vs/base/browser/dom';
3
3
  import { BaseActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
4
4
  import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
5
- import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
6
5
  import { renderIcon } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
7
6
  import { SubmenuAction } from 'vscode/vscode/vs/base/common/actions';
8
7
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
@@ -16,6 +15,7 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
16
15
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
17
16
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
18
17
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
18
+ import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
19
19
 
20
20
  var CommandCenterCenterViewItem_1;
21
21
  const _moduleId = "vs/workbench/browser/parts/titlebar/commandCenterControl";
@@ -61,10 +61,11 @@ CommandCenterControl = ( (__decorate([
61
61
  let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends BaseActionViewItem {
62
62
  static { CommandCenterCenterViewItem_1 = this; }
63
63
  static { this._quickOpenCommandId = 'workbench.action.quickOpenWithModes'; }
64
- constructor(_submenu, _windowTitle, options, _keybindingService, _instaService, _editorGroupService) {
64
+ constructor(_submenu, _windowTitle, options, _hoverService, _keybindingService, _instaService, _editorGroupService) {
65
65
  super(undefined, _submenu.actions.find(action => action.id === 'workbench.action.quickOpenWithModes') ?? _submenu.actions[0], options);
66
66
  this._submenu = _submenu;
67
67
  this._windowTitle = _windowTitle;
68
+ this._hoverService = _hoverService;
68
69
  this._keybindingService = _keybindingService;
69
70
  this._instaService = _instaService;
70
71
  this._editorGroupService = _editorGroupService;
@@ -74,7 +75,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
74
75
  super.render(container);
75
76
  container.classList.add('command-center-center');
76
77
  container.classList.toggle('multiple', (this._submenu.actions.length > 1));
77
- const hover = this._store.add(setupCustomHover(this._hoverDelegate, container, this.getTooltip()));
78
+ const hover = this._store.add(this._hoverService.setupUpdatableHover(this._hoverDelegate, container, this.getTooltip()));
78
79
  this._store.add(this._windowTitle.onDidChange(() => {
79
80
  hover.update(this.getTooltip());
80
81
  }));
@@ -118,7 +119,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
118
119
  labelElement.classList.add('search-label');
119
120
  labelElement.innerText = label;
120
121
  reset(container, searchIcon, labelElement);
121
- const hover = this._store.add(setupCustomHover(that._hoverDelegate, container, this.getTooltip()));
122
+ const hover = this._store.add(that._hoverService.setupUpdatableHover(that._hoverDelegate, container, this.getTooltip()));
122
123
  this._store.add(that._windowTitle.onDidChange(() => {
123
124
  hover.update(this.getTooltip());
124
125
  labelElement.innerText = this._getLabel();
@@ -189,9 +190,10 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
189
190
  }
190
191
  };
191
192
  CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( (__decorate([
192
- ( (__param(3, IKeybindingService))),
193
- ( (__param(4, IInstantiationService))),
194
- ( (__param(5, IEditorGroupsService)))
193
+ ( (__param(3, IHoverService))),
194
+ ( (__param(4, IKeybindingService))),
195
+ ( (__param(5, IInstantiationService))),
196
+ ( (__param(6, IEditorGroupsService)))
195
197
  ], CommandCenterCenterViewItem)));
196
198
  MenuRegistry.appendMenuItem(MenuId.CommandCenter, {
197
199
  submenu: MenuId.CommandCenterCenter,
@@ -9,11 +9,12 @@ import { IsAuxiliaryWindowFocusedContext, TitleBarStyleContext, IsMainWindowFull
9
9
 
10
10
  const _moduleId = "vs/workbench/browser/parts/titlebar/titlebarActions";
11
11
  class ToggleConfigAction extends Action2 {
12
- constructor(section, title, order, mainWindowOnly) {
12
+ constructor(section, title, description, order, mainWindowOnly) {
13
13
  const when = mainWindowOnly ? ( (IsAuxiliaryWindowFocusedContext.toNegated())) : ContextKeyExpr.true();
14
14
  super({
15
15
  id: `toggle.${section}`,
16
16
  title,
17
+ metadata: description ? { description } : undefined,
17
18
  toggled: ( (ContextKeyExpr.equals(`config.${section}`, true))),
18
19
  menu: [
19
20
  {
@@ -40,19 +41,19 @@ class ToggleConfigAction extends Action2 {
40
41
  }
41
42
  registerAction2(class ToggleCommandCenter extends ToggleConfigAction {
42
43
  constructor() {
43
- super("window.commandCenter" , ( localizeWithPath(_moduleId, 0, 'Command Center')), 1, false);
44
+ super("window.commandCenter" , ( localizeWithPath(_moduleId, 0, 'Command Center')), ( localizeWithPath(_moduleId, 1, "Toggle visibility of the Command Center in title bar")), 1, false);
44
45
  }
45
46
  });
46
47
  registerAction2(class ToggleLayoutControl extends ToggleConfigAction {
47
48
  constructor() {
48
- super('workbench.layoutControl.enabled', ( localizeWithPath(_moduleId, 1, 'Layout Controls')), 2, true);
49
+ super('workbench.layoutControl.enabled', ( localizeWithPath(_moduleId, 2, 'Layout Controls')), ( localizeWithPath(_moduleId, 3, "Toggle visibility of the Layout Controls in title bar")), 2, true);
49
50
  }
50
51
  });
51
52
  registerAction2(class ToggleCustomTitleBar extends Action2 {
52
53
  constructor() {
53
54
  super({
54
55
  id: `toggle.${"window.customTitleBarVisibility" }`,
55
- title: ( localizeWithPath(_moduleId, 2, 'Hide Custom Title Bar')),
56
+ title: ( localizeWithPath(_moduleId, 4, 'Hide Custom Title Bar')),
56
57
  menu: [
57
58
  { id: MenuId.TitleBarContext, order: 0, when: ( (ContextKeyExpr.equals(TitleBarStyleContext.key, "native" ))), group: '3_toggle' },
58
59
  { id: MenuId.TitleBarTitleContext, order: 0, when: ( (ContextKeyExpr.equals(TitleBarStyleContext.key, "native" ))), group: '3_toggle' },
@@ -68,7 +69,7 @@ registerAction2(class ToggleCustomTitleBarWindowed extends Action2 {
68
69
  constructor() {
69
70
  super({
70
71
  id: `toggle.${"window.customTitleBarVisibility" }.windowed`,
71
- title: ( localizeWithPath(_moduleId, 3, 'Hide Custom Title Bar In Full Screen')),
72
+ title: ( localizeWithPath(_moduleId, 5, 'Hide Custom Title Bar In Full Screen')),
72
73
  menu: [
73
74
  { id: MenuId.TitleBarContext, order: 1, when: IsMainWindowFullscreenContext, group: '3_toggle' },
74
75
  { id: MenuId.TitleBarTitleContext, order: 1, when: IsMainWindowFullscreenContext, group: '3_toggle' },
@@ -84,7 +85,7 @@ class ToggleCustomTitleBar extends Action2 {
84
85
  constructor() {
85
86
  super({
86
87
  id: `toggle.toggleCustomTitleBar`,
87
- title: ( localizeWithPath(_moduleId, 4, 'Custom Title Bar')),
88
+ title: ( localizeWithPath(_moduleId, 6, 'Custom Title Bar')),
88
89
  toggled: TitleBarVisibleContext,
89
90
  menu: [
90
91
  {
@@ -135,7 +136,7 @@ registerAction2(class ShowCustomTitleBar extends Action2 {
135
136
  constructor() {
136
137
  super({
137
138
  id: `showCustomTitleBar`,
138
- title: ( localize2WithPath(_moduleId, 5, "Show Custom Title Bar")),
139
+ title: ( localize2WithPath(_moduleId, 7, "Show Custom Title Bar")),
139
140
  precondition: ( (TitleBarVisibleContext.negate())),
140
141
  f1: true
141
142
  });
@@ -149,7 +150,7 @@ registerAction2(class HideCustomTitleBar extends Action2 {
149
150
  constructor() {
150
151
  super({
151
152
  id: `hideCustomTitleBar`,
152
- title: ( localize2WithPath(_moduleId, 6, "Hide Custom Title Bar")),
153
+ title: ( localize2WithPath(_moduleId, 8, "Hide Custom Title Bar")),
153
154
  precondition: TitleBarVisibleContext,
154
155
  f1: true
155
156
  });
@@ -163,7 +164,7 @@ registerAction2(class HideCustomTitleBar extends Action2 {
163
164
  constructor() {
164
165
  super({
165
166
  id: `hideCustomTitleBarInFullScreen`,
166
- title: ( localize2WithPath(_moduleId, 7, "Hide Custom Title Bar In Full Screen")),
167
+ title: ( localize2WithPath(_moduleId, 9, "Hide Custom Title Bar In Full Screen")),
167
168
  precondition: ( (ContextKeyExpr.and(TitleBarVisibleContext, IsMainWindowFullscreenContext))),
168
169
  f1: true
169
170
  });
@@ -182,7 +183,7 @@ registerAction2(class ToggleEditorActions extends Action2 {
182
183
  )))?.negate();
183
184
  super({
184
185
  id: `toggle.${ToggleEditorActions.settingsID}`,
185
- title: ( localizeWithPath(_moduleId, 8, 'Editor Actions')),
186
+ title: ( localizeWithPath(_moduleId, 10, 'Editor Actions')),
186
187
  toggled: ( (( (ContextKeyExpr.equals(`config.${ToggleEditorActions.settingsID}`, 'hidden'))).negate())),
187
188
  menu: [
188
189
  { id: MenuId.TitleBarContext, order: 3, when: titleBarContextCondition, group: '2_config' },
@@ -213,16 +214,16 @@ registerAction2(class ToggleEditorActions extends Action2 {
213
214
  });
214
215
  const ACCOUNTS_ACTIVITY_TILE_ACTION = {
215
216
  id: ACCOUNTS_ACTIVITY_ID,
216
- label: ( localizeWithPath(_moduleId, 9, "Accounts")),
217
- tooltip: ( localizeWithPath(_moduleId, 9, "Accounts")),
217
+ label: ( localizeWithPath(_moduleId, 11, "Accounts")),
218
+ tooltip: ( localizeWithPath(_moduleId, 11, "Accounts")),
218
219
  class: undefined,
219
220
  enabled: true,
220
221
  run: function () { }
221
222
  };
222
223
  const GLOBAL_ACTIVITY_TITLE_ACTION = {
223
224
  id: GLOBAL_ACTIVITY_ID,
224
- label: ( localizeWithPath(_moduleId, 10, "Manage")),
225
- tooltip: ( localizeWithPath(_moduleId, 10, "Manage")),
225
+ label: ( localizeWithPath(_moduleId, 12, "Manage")),
226
+ tooltip: ( localizeWithPath(_moduleId, 12, "Manage")),
226
227
  class: undefined,
227
228
  enabled: true,
228
229
  run: function () { }
@@ -32,7 +32,7 @@ import { CommandCenterControl } from './commandCenterControl.js';
32
32
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
33
33
  import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
34
34
  import { GLOBAL_ACTIVITY_ID, ACCOUNTS_ACTIVITY_ID } from 'vscode/vscode/vs/workbench/common/activity';
35
- import { SimpleGlobalActivityActionViewItem, SimpleAccountActivityActionViewItem } from 'vscode/vscode/vs/workbench/browser/parts/globalCompositeBar';
35
+ import { SimpleGlobalActivityActionViewItem, SimpleAccountActivityActionViewItem, isAccountsActionVisible, AccountsActivityActionViewItem } from 'vscode/vscode/vs/workbench/browser/parts/globalCompositeBar';
36
36
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
37
37
  import { ActionRunner } from 'vscode/vscode/vs/base/common/actions';
38
38
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
@@ -130,6 +130,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
130
130
  this.configurationService = configurationService;
131
131
  this.environmentService = environmentService;
132
132
  this.instantiationService = instantiationService;
133
+ this.storageService = storageService;
133
134
  this.contextKeyService = contextKeyService;
134
135
  this.hostService = hostService;
135
136
  this.editorGroupService = editorGroupService;
@@ -145,6 +146,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
145
146
  this.editorActionsChangeDisposable = this._register(( (new DisposableStore())));
146
147
  this.editorToolbarMenuDisposables = this._register(( (new DisposableStore())));
147
148
  this.layoutToolbarMenuDisposables = this._register(( (new DisposableStore())));
149
+ this.activityToolbarDisposables = this._register(( (new DisposableStore())));
148
150
  this.titleDisposables = this._register(( (new DisposableStore())));
149
151
  this.titleBarStyle = getTitleBarStyle(this.configurationService);
150
152
  this.isInactive = false;
@@ -378,7 +380,9 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
378
380
  );
379
381
  }
380
382
  if (this.activityActionsEnabled) {
381
- actions.primary.push(ACCOUNTS_ACTIVITY_TILE_ACTION);
383
+ if (isAccountsActionVisible(this.storageService)) {
384
+ actions.primary.push(ACCOUNTS_ACTIVITY_TILE_ACTION);
385
+ }
382
386
  actions.primary.push(GLOBAL_ACTIVITY_TITLE_ACTION);
383
387
  }
384
388
  this.actionToolBar.setActions(prepareActions(actions.primary), prepareActions(actions.secondary));
@@ -408,6 +412,12 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
408
412
  this.layoutToolbarMenu = undefined;
409
413
  }
410
414
  }
415
+ if (update.activityActions) {
416
+ this.activityToolbarDisposables.clear();
417
+ if (this.activityActionsEnabled) {
418
+ this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(0 , AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, this._store)(() => updateToolBarActions()));
419
+ }
420
+ }
411
421
  updateToolBarActions();
412
422
  }
413
423
  updateStyles() {