@codingame/monaco-vscode-view-title-bar-service-override 30.0.0 → 31.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": "30.0.0",
3
+ "version": "31.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - view-title-bar service-override",
6
6
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "30.0.0"
18
+ "@codingame/monaco-vscode-api": "31.0.0"
19
19
  },
20
20
  "main": "index.js",
21
21
  "module": "index.js",
@@ -8,6 +8,7 @@ import { SubmenuAction } from '@codingame/monaco-vscode-api/vscode/vs/base/commo
8
8
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
9
9
  import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
10
10
  import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
11
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
11
12
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
12
13
  import { createActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
13
14
  import { MenuWorkbenchToolBar, HiddenItemStrategy, WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
@@ -18,10 +19,10 @@ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platf
18
19
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
19
20
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
20
21
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
22
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
21
23
 
22
24
  var CommandCenterCenterViewItem_1;
23
25
  const AI_DISABLED_SETTING = "chat.disableAIFeatures";
24
- const AI_CUSTOMIZATION_MENU_ENABLED_SETTING = "chat.customizationsMenu.enabled";
25
26
  const AGENT_STATUS_ENABLED_SETTING = "chat.agentsControl.enabled";
26
27
  let CommandCenterControl = class CommandCenterControl {
27
28
  constructor(windowTitle, hoverDelegate, instantiationService, quickInputService) {
@@ -51,12 +52,25 @@ let CommandCenterControl = class CommandCenterControl {
51
52
  }
52
53
  }
53
54
  });
55
+ let quickInputVisible = false;
54
56
  this._disposables.add(Event.filter(
55
57
  quickInputService.onShow,
56
58
  () => isActiveDocument(this.element),
57
59
  this._disposables
58
- )(this._setVisibility.bind(this, false)));
59
- this._disposables.add(quickInputService.onHide(this._setVisibility.bind(this, true)));
60
+ )(() => {
61
+ quickInputVisible = true;
62
+ this._setVisibility(quickInputService.alignment.get() !== "top");
63
+ }));
64
+ this._disposables.add(quickInputService.onHide(() => {
65
+ quickInputVisible = false;
66
+ this._setVisibility(true);
67
+ }));
68
+ this._disposables.add(autorun(reader => {
69
+ const alignment = quickInputService.alignment.read(reader);
70
+ if (quickInputVisible) {
71
+ this._setVisibility(alignment !== "top");
72
+ }
73
+ }));
60
74
  this._disposables.add(titleToolbar);
61
75
  }
62
76
  _setVisibility(show) {
@@ -141,7 +155,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
141
155
  container.role = "button";
142
156
  container.setAttribute("aria-description", this.getTooltip());
143
157
  const aiFeaturesDisabled = that._configurationService.getValue(AI_DISABLED_SETTING) === true;
144
- const aiCustomizationsDisabled = that._configurationService.getValue("disableAICustomizations") === true || that._configurationService.getValue("workbench.disableAICustomizations") === true || that._configurationService.getValue(AI_CUSTOMIZATION_MENU_ENABLED_SETTING) === false;
158
+ const aiCustomizationsDisabled = that._configurationService.getValue("disableAICustomizations") === true || that._configurationService.getValue("workbench.disableAICustomizations") === true;
145
159
  const forcedHidden = aiFeaturesDisabled && aiCustomizationsDisabled;
146
160
  const agentControlValue = that._configurationService.getValue(AGENT_STATUS_ENABLED_SETTING);
147
161
  const isCompactMode = !forcedHidden && (agentControlValue === true || agentControlValue === undefined || agentControlValue === "compact");
@@ -402,6 +402,8 @@
402
402
  z-index: 2500;
403
403
  -webkit-app-region: no-drag;
404
404
  margin-right: auto;
405
+ min-width: 0;
406
+ overflow: hidden;
405
407
  }
406
408
 
407
409
  .monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.has-no-actions {
@@ -66,11 +66,9 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
66
66
  private readonly contextMenuService;
67
67
  protected readonly configurationService: IConfigurationService;
68
68
  protected readonly environmentService: IBrowserWorkbenchEnvironmentService;
69
- protected readonly instantiationService: IInstantiationService;
70
69
  private readonly storageService;
71
70
  protected readonly contextKeyService: IContextKeyService;
72
71
  private readonly hostService;
73
- private readonly editorService;
74
72
  private readonly menuService;
75
73
  private readonly keybindingService;
76
74
  readonly minimumWidth: number;
@@ -112,6 +110,7 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
112
110
  private isCompact;
113
111
  private readonly isCompactContextKey;
114
112
  private readonly windowTitle;
113
+ protected readonly instantiationService: IInstantiationService;
115
114
  constructor(id: string, targetWindow: CodeWindow, editorGroupsContainer: IEditorGroupsContainer, contextMenuService: IContextMenuService, configurationService: IConfigurationService, environmentService: IBrowserWorkbenchEnvironmentService, instantiationService: IInstantiationService, themeService: IThemeService, storageService: IStorageService, layoutService: IWorkbenchLayoutService, contextKeyService: IContextKeyService, hostService: IHostService, editorService: IEditorService, menuService: IMenuService, keybindingService: IKeybindingService);
116
115
  private registerListeners;
117
116
  private onBlur;
@@ -50,6 +50,7 @@ import { createInstantHoverDelegate } from '@codingame/monaco-vscode-api/vscode/
50
50
  import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
51
51
  import { safeIntl } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
52
52
  import { TitleBarVisibleContext, IsCompactTitleBarContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
53
+ import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
53
54
  import { AnchorAlignment } from '@codingame/monaco-vscode-api/vscode/vs/base/common/layout';
54
55
 
55
56
  var AuxiliaryBrowserTitlebarPart_1;
@@ -200,11 +201,9 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
200
201
  this.contextMenuService = contextMenuService;
201
202
  this.configurationService = configurationService;
202
203
  this.environmentService = environmentService;
203
- this.instantiationService = instantiationService;
204
204
  this.storageService = storageService;
205
205
  this.contextKeyService = contextKeyService;
206
206
  this.hostService = hostService;
207
- this.editorService = editorService;
208
207
  this.menuService = menuService;
209
208
  this.keybindingService = keybindingService;
210
209
  this.minimumWidth = 0;
@@ -224,10 +223,12 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
224
223
  this.titleDisposables = this._register(( new DisposableStore()));
225
224
  this.isInactive = false;
226
225
  this.isCompact = false;
226
+ const scopedEditorService = editorService.createScoped(editorGroupsContainer, this._store);
227
+ this.instantiationService = this._register(instantiationService.createChild(( new ServiceCollection([IEditorService, scopedEditorService]))));
227
228
  this.isAuxiliary = targetWindow.vscodeWindowId !== mainWindow.vscodeWindowId;
228
229
  this.isCompactContextKey = IsCompactTitleBarContext.bindTo(this.contextKeyService);
229
230
  this.titleBarStyle = getTitleBarStyle(this.configurationService);
230
- this.windowTitle = this._register(instantiationService.createInstance(WindowTitle, targetWindow));
231
+ this.windowTitle = this._register(this.instantiationService.createInstance(WindowTitle, targetWindow));
231
232
  this.hoverDelegate = this._register(createInstantHoverDelegate());
232
233
  this.registerListeners(getWindowId(targetWindow));
233
234
  }
@@ -555,7 +556,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
555
556
  };
556
557
  if (update.editorActions) {
557
558
  this.editorToolbarMenuDisposables.clear();
558
- if (this.editorActionsEnabled && this.editorService.activeEditor !== undefined) {
559
+ if (this.editorActionsEnabled && this.editorGroupsContainer.activeGroup?.activeEditor) {
559
560
  const context = {
560
561
  groupId: this.editorGroupsContainer.activeGroup.id
561
562
  };