@codingame/monaco-vscode-view-title-bar-service-override 34.1.1 → 35.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": "34.1.1",
3
+ "version": "35.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": "34.1.1"
18
+ "@codingame/monaco-vscode-api": "35.0.0"
19
19
  },
20
20
  "main": "index.js",
21
21
  "module": "index.js",
@@ -208,13 +208,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
208
208
  label = that._windowTitle.fileName ?? label;
209
209
  }
210
210
  if (!label) {
211
- label = ( localize(3849, "Search"));
211
+ label = ( localize(3926, "Search"));
212
212
  }
213
213
  if (prefix) {
214
- label = ( localize(3850, "{0} {1}", prefix, label));
214
+ label = ( localize(3927, "{0} {1}", prefix, label));
215
215
  }
216
216
  if (suffix) {
217
- label = ( localize(3851, "{0} {1}", label, suffix));
217
+ label = ( localize(3928, "{0} {1}", label, suffix));
218
218
  }
219
219
  return label.replaceAll(/\r\n|\r|\n/g, "⏎");
220
220
  }
@@ -235,13 +235,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
235
235
  getTooltip() {
236
236
  const kb = this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();
237
237
  const title = kb ? ( localize(
238
- 3852,
238
+ 3929,
239
239
  "Search {0} ({1}) — {2}",
240
240
  this._windowTitle.workspaceName,
241
241
  kb,
242
242
  this._windowTitle.value
243
243
  )) : ( localize(
244
- 3853,
244
+ 3930,
245
245
  "Search {0} — {1}",
246
246
  this._windowTitle.workspaceName,
247
247
  this._windowTitle.value
@@ -252,7 +252,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
252
252
  CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( __decorate([( __param(3, IHoverService)), ( __param(4, IKeybindingService)), ( __param(5, IInstantiationService)), ( __param(6, IEditorGroupsService)), ( __param(7, IConfigurationService))], CommandCenterCenterViewItem));
253
253
  MenuRegistry.appendMenuItem(MenuId.CommandCenter, {
254
254
  submenu: MenuId.CommandCenterCenter,
255
- title: ( localize(3854, "Command Center")),
255
+ title: ( localize(3931, "Command Center")),
256
256
  icon: Codicon.shield,
257
257
  order: 101
258
258
  });
@@ -402,14 +402,17 @@
402
402
  z-index: 2500;
403
403
  -webkit-app-region: no-drag;
404
404
  margin-right: auto;
405
- min-width: 0;
406
- overflow: hidden;
407
405
  }
408
406
 
409
407
  .monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.has-no-actions {
410
408
  display: none;
411
409
  }
412
410
 
411
+ /* Hidden when the title bar is too narrow to fit it without pushing the window controls off-screen (#303222). */
412
+ .monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.overflowing {
413
+ display: none;
414
+ }
415
+
413
416
  /* Action Tool Bar Controls */
414
417
  .monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container {
415
418
  display: none;
@@ -100,6 +100,7 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
100
100
  private readonly editorActionsChangeDisposable;
101
101
  private actionToolBarElement;
102
102
  private readonly centerAdjacentToolBarDisposable;
103
+ private centerAdjacentToolBarElement;
103
104
  private globalToolbarMenu;
104
105
  private layoutToolbarMenu;
105
106
  private readonly globalToolbarMenuDisposables;
@@ -147,6 +148,12 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
147
148
  get hasZoomableElements(): boolean;
148
149
  get preventZoom(): boolean;
149
150
  layout(width: number, height: number): void;
151
+ /**
152
+ * Hides the optional center-adjacent toolbar (e.g. the update indicator) when showing it would push the title bar
153
+ * content—most notably the trailing window controls—off-screen as the window is collapsed horizontally (#303222).
154
+ * Overflow is measured against actual rendered widths so the toolbar stays visible whenever it fits.
155
+ */
156
+ private updateCenterAdjacentToolBarOverflow;
150
157
  private updateLayout;
151
158
  focus(): void;
152
159
  toJSON(): object;
@@ -77,7 +77,7 @@ let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
77
77
  constructor() {
78
78
  super({
79
79
  id: `workbench.action.focusTitleBar`,
80
- title: ( localize2(3890, "Focus Title Bar")),
80
+ title: ( localize2(3968, "Focus Title Bar")),
81
81
  category: Categories.View,
82
82
  f1: true,
83
83
  precondition: TitleBarVisibleContext
@@ -363,7 +363,8 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
363
363
  this.createTitle();
364
364
  {
365
365
  const centerAdjacentToolBarElement = append(this.rightContent, $("div.center-adjacent-toolbar-container"));
366
- this.centerAdjacentToolBarDisposable.add(this.instantiationService.createInstance(
366
+ this.centerAdjacentToolBarElement = centerAdjacentToolBarElement;
367
+ const centerAdjacentToolBar = this.centerAdjacentToolBarDisposable.add(this.instantiationService.createInstance(
367
368
  MenuWorkbenchToolBar,
368
369
  centerAdjacentToolBarElement,
369
370
  MenuId.TitleBarAdjacentCenter,
@@ -377,6 +378,9 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
377
378
  hoverDelegate: this.hoverDelegate
378
379
  }
379
380
  ));
381
+ this.centerAdjacentToolBarDisposable.add(
382
+ centerAdjacentToolBar.onDidChangeMenuItems(() => this.updateCenterAdjacentToolBarOverflow())
383
+ );
380
384
  }
381
385
  {
382
386
  this.actionToolBarElement = append(this.rightContent, $("div.action-toolbar-container"));
@@ -504,7 +508,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
504
508
  this.instantiationService.createInstance(WorkbenchToolBar, this.actionToolBarElement, {
505
509
  contextMenu: MenuId.TitleBarContext,
506
510
  orientation: ActionsOrientation.HORIZONTAL,
507
- ariaLabel: ( localize(3891, "Title actions")),
511
+ ariaLabel: ( localize(3969, "Title actions")),
508
512
  getKeyBinding: action => this.getKeybinding(action),
509
513
  overflowBehavior: {
510
514
  maxItems: 12,
@@ -708,6 +712,20 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
708
712
  layout(width, height) {
709
713
  this.updateLayout(( new Dimension(width, height)));
710
714
  super.layoutContents(width, height);
715
+ this.updateCenterAdjacentToolBarOverflow();
716
+ }
717
+ updateCenterAdjacentToolBarOverflow() {
718
+ const element = this.centerAdjacentToolBarElement;
719
+ if (!element) {
720
+ return;
721
+ }
722
+ if (element.classList.contains("has-no-actions")) {
723
+ element.classList.remove("overflowing");
724
+ return;
725
+ }
726
+ element.classList.remove("overflowing");
727
+ const overflows = this.rootContainer.scrollWidth > this.rootContainer.clientWidth;
728
+ element.classList.toggle("overflowing", overflows);
711
729
  }
712
730
  updateLayout(dimension) {
713
731
  this.lastLayoutDimensions = dimension;