@codingame/monaco-vscode-view-title-bar-service-override 3.2.3 → 4.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": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { reset, isActiveDocument } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { BaseActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
4
|
-
import {
|
|
4
|
+
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
5
|
+
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
5
6
|
import { renderIcon } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
7
|
import { SubmenuAction } from 'vscode/vscode/vs/base/common/actions';
|
|
7
8
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
@@ -31,12 +32,12 @@ let CommandCenterControl = class CommandCenterControl {
|
|
|
31
32
|
primaryGroup: () => true,
|
|
32
33
|
},
|
|
33
34
|
telemetrySource: 'commandCenter',
|
|
34
|
-
actionViewItemProvider: (action) => {
|
|
35
|
+
actionViewItemProvider: (action, options) => {
|
|
35
36
|
if (action instanceof SubmenuItemAction && action.item.submenu === MenuId.CommandCenterCenter) {
|
|
36
|
-
return instantiationService.createInstance(CommandCenterCenterViewItem, action, windowTitle,
|
|
37
|
+
return instantiationService.createInstance(CommandCenterCenterViewItem, action, windowTitle, { ...options, hoverDelegate });
|
|
37
38
|
}
|
|
38
39
|
else {
|
|
39
|
-
return createActionViewItem(instantiationService, action, { hoverDelegate });
|
|
40
|
+
return createActionViewItem(instantiationService, action, { ...options, hoverDelegate });
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
});
|
|
@@ -59,14 +60,14 @@ CommandCenterControl = ( __decorate([
|
|
|
59
60
|
let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends BaseActionViewItem {
|
|
60
61
|
static { CommandCenterCenterViewItem_1 = this; }
|
|
61
62
|
static { this._quickOpenCommandId = 'workbench.action.quickOpenWithModes'; }
|
|
62
|
-
constructor(_submenu, _windowTitle,
|
|
63
|
+
constructor(_submenu, _windowTitle, options, _keybindingService, _instaService, _editorGroupService) {
|
|
63
64
|
super(undefined, _submenu.actions.find(action => action.id === 'workbench.action.quickOpenWithModes') ?? _submenu.actions[0], options);
|
|
64
65
|
this._submenu = _submenu;
|
|
65
66
|
this._windowTitle = _windowTitle;
|
|
66
|
-
this._hoverDelegate = _hoverDelegate;
|
|
67
67
|
this._keybindingService = _keybindingService;
|
|
68
68
|
this._instaService = _instaService;
|
|
69
69
|
this._editorGroupService = _editorGroupService;
|
|
70
|
+
this._hoverDelegate = options.hoverDelegate ?? getDefaultHoverDelegate('mouse');
|
|
70
71
|
}
|
|
71
72
|
render(container) {
|
|
72
73
|
super.render(container);
|
|
@@ -203,9 +204,9 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
203
204
|
}
|
|
204
205
|
};
|
|
205
206
|
CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( __decorate([
|
|
206
|
-
( __param(
|
|
207
|
-
( __param(
|
|
208
|
-
( __param(
|
|
207
|
+
( __param(3, IKeybindingService)),
|
|
208
|
+
( __param(4, IInstantiationService)),
|
|
209
|
+
( __param(5, IEditorGroupsService))
|
|
209
210
|
], CommandCenterCenterViewItem));
|
|
210
211
|
MenuRegistry.appendMenuItem(MenuId.CommandCenter, {
|
|
211
212
|
submenu: MenuId.CommandCenterCenter,
|
|
@@ -108,7 +108,7 @@ class ToggleCustomTitleBar extends Action2 {
|
|
|
108
108
|
{
|
|
109
109
|
id: MenuId.MenubarAppearanceMenu,
|
|
110
110
|
order: 6,
|
|
111
|
-
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(( ContextKeyExpr.equals(TitleBarStyleContext.key, "native" )), ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.workbench.layoutControl.enabled', false)), ( ContextKeyExpr.equals('config.window.commandCenter', false)), ( ContextKeyExpr.notEquals('config.workbench.editor.editorActionsLocation', 'titleBar')), ( ContextKeyExpr.notEquals('config.workbench.activityBar.location', 'top'))))?.negate())), IsMainWindowFullscreenContext)),
|
|
111
|
+
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(( ContextKeyExpr.equals(TitleBarStyleContext.key, "native" )), ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.workbench.layoutControl.enabled', false)), ( ContextKeyExpr.equals('config.window.commandCenter', false)), ( ContextKeyExpr.notEquals('config.workbench.editor.editorActionsLocation', 'titleBar')), ( ContextKeyExpr.notEquals('config.workbench.activityBar.location', 'top')), ( ContextKeyExpr.notEquals('config.workbench.activityBar.location', 'bottom'))))?.negate())), IsMainWindowFullscreenContext)),
|
|
112
112
|
group: '2_workbench_layout'
|
|
113
113
|
},
|
|
114
114
|
],
|
|
@@ -42,7 +42,7 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
|
|
|
42
42
|
import { EditorCommandsContextActionRunner } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorTabsControl';
|
|
43
43
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
44
44
|
import { ACCOUNTS_ACTIVITY_TILE_ACTION, GLOBAL_ACTIVITY_TITLE_ACTION } from './titlebarActions.js';
|
|
45
|
-
import {
|
|
45
|
+
import { createInstantHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
46
46
|
|
|
47
47
|
var AuxiliaryBrowserTitlebarPart_1;
|
|
48
48
|
let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
|
|
@@ -61,7 +61,7 @@ let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
|
|
|
61
61
|
}
|
|
62
62
|
registerActions() {
|
|
63
63
|
const that = this;
|
|
64
|
-
registerAction2(class FocusTitleBar extends Action2 {
|
|
64
|
+
this._register(registerAction2(class FocusTitleBar extends Action2 {
|
|
65
65
|
constructor() {
|
|
66
66
|
super({
|
|
67
67
|
id: `workbench.action.focusTitleBar`,
|
|
@@ -77,7 +77,7 @@ let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
|
|
|
77
77
|
run() {
|
|
78
78
|
that.getPartByDocument(getActiveDocument()).focus();
|
|
79
79
|
}
|
|
80
|
-
});
|
|
80
|
+
}));
|
|
81
81
|
}
|
|
82
82
|
createAuxiliaryTitlebarPart(container, editorGroupsContainer) {
|
|
83
83
|
const titlebarPartContainer = document.createElement('div');
|
|
@@ -154,7 +154,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
154
154
|
this.editorService = editorService.createScoped(editorGroupsContainer, this._store);
|
|
155
155
|
this.editorGroupsContainer = editorGroupsContainer === 'main' ? editorGroupService.mainPart : editorGroupsContainer;
|
|
156
156
|
this.windowTitle = this._register(instantiationService.createInstance(WindowTitle, targetWindow, editorGroupsContainer));
|
|
157
|
-
this.hoverDelegate = this._register(
|
|
157
|
+
this.hoverDelegate = this._register(createInstantHoverDelegate());
|
|
158
158
|
this.registerListeners(getWindowId(targetWindow));
|
|
159
159
|
}
|
|
160
160
|
registerListeners(targetWindowId) {
|
|
@@ -330,12 +330,12 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
330
330
|
}
|
|
331
331
|
const activeEditorPane = this.editorGroupsContainer.activeGroup?.activeEditorPane;
|
|
332
332
|
if (activeEditorPane && activeEditorPane instanceof EditorPane) {
|
|
333
|
-
const result = activeEditorPane.getActionViewItem(action,
|
|
333
|
+
const result = activeEditorPane.getActionViewItem(action, options);
|
|
334
334
|
if (result) {
|
|
335
335
|
return result;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
return createActionViewItem(this.instantiationService, action, { ...options,
|
|
338
|
+
return createActionViewItem(this.instantiationService, action, { ...options, menuAsChild: false });
|
|
339
339
|
}
|
|
340
340
|
getKeybinding(action) {
|
|
341
341
|
const editorPaneAwareContextKeyService = this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService ?? this.contextKeyService;
|
|
@@ -356,7 +356,8 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
356
356
|
anchorAlignmentProvider: () => 1 ,
|
|
357
357
|
telemetrySource: 'titlePart',
|
|
358
358
|
highlightToggledItems: this.editorActionsEnabled,
|
|
359
|
-
actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options)
|
|
359
|
+
actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
|
|
360
|
+
hoverDelegate: this.hoverDelegate
|
|
360
361
|
}));
|
|
361
362
|
if (this.editorActionsEnabled) {
|
|
362
363
|
this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(() => this.createActionToolBarMenus({ editorActions: true })));
|
|
@@ -469,7 +470,8 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
469
470
|
((this.editorGroupService.partOptions.editorActionsLocation === "default" && this.editorGroupService.partOptions.showTabs === "none") );
|
|
470
471
|
}
|
|
471
472
|
get activityActionsEnabled() {
|
|
472
|
-
|
|
473
|
+
const activityBarPosition = this.configurationService.getValue("workbench.activityBar.location" );
|
|
474
|
+
return !this.isAuxiliary && ((activityBarPosition === "top" || activityBarPosition === "bottom") );
|
|
473
475
|
}
|
|
474
476
|
get hasZoomableElements() {
|
|
475
477
|
const hasMenubar = !(this.currentMenubarVisibility === 'hidden' || this.currentMenubarVisibility === 'compact' || (!isWeb && isMacintosh));
|