custom-electron-titlebar 3.2.6 → 3.2.10
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/.github/FUNDING.yml +1 -0
- package/README.md +15 -24
- package/_config.yml +1 -0
- package/{lib → build}/browser/browser.d.ts +0 -0
- package/{lib → build}/browser/browser.js +0 -0
- package/{lib → build}/browser/browser.js.map +0 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +2 -1
- package/{lib → build}/browser/event.js.map +1 -1
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib → build}/browser/iframe.js +0 -0
- package/{lib → build}/browser/iframe.js.map +0 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +0 -0
- package/{lib → build}/browser/keyboardEvent.js.map +0 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +0 -0
- package/{lib → build}/browser/mouseEvent.js.map +0 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +0 -0
- package/{lib → build}/common/arrays.js.map +0 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +0 -0
- package/{lib → build}/common/async.js.map +0 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib → build}/common/charCode.js +0 -0
- package/{lib → build}/common/charCode.js.map +0 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +0 -0
- package/{lib → build}/common/color.js.map +0 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +16 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +1 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +0 -0
- package/{lib → build}/common/iterator.js.map +0 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +0 -0
- package/{lib → build}/common/keyCodes.js.map +0 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +0 -0
- package/{lib → build}/common/lifecycle.js.map +0 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +0 -0
- package/{lib → build}/common/linkedList.js.map +0 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +0 -0
- package/{lib → build}/common/platform.js.map +0 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +0 -0
- package/{lib → build}/index.js.map +0 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +38 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +70 -34
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +29 -30
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +2 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +61 -58
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/common/dom.js.map +0 -1
- package/lib/common/enableNativeMenuCommands.d.ts +0 -1
- package/lib/common/enableNativeMenuCommands.js +0 -32
- package/lib/common/enableNativeMenuCommands.js.map +0 -1
- package/lib/common/event.js.map +0 -1
- package/lib/main.d.ts +0 -1
- package/lib/main.js +0 -14
- package/lib/main.js.map +0 -1
- package/lib/menu/menu.js.map +0 -1
- package/lib/menu/menuitem.js.map +0 -1
- package/lib/menubar.js.map +0 -1
- package/lib/themebar.js.map +0 -1
- package/lib/titlebar.js.map +0 -1
- package/lib/vs/base/browser/browser.js +0 -150
- package/lib/vs/base/browser/canIUse.js +0 -58
- package/lib/vs/base/browser/codicons.js +0 -37
- package/lib/vs/base/browser/contextmenu.js +0 -9
- package/lib/vs/base/browser/dnd.js +0 -113
- package/lib/vs/base/browser/dom.js +0 -1417
- package/lib/vs/base/browser/event.js +0 -36
- package/lib/vs/base/browser/fastDomNode.js +0 -265
- package/lib/vs/base/browser/formattedTextRenderer.js +0 -248
- package/lib/vs/base/browser/globalMouseMoveMonitor.js +0 -137
- package/lib/vs/base/browser/history.js +0 -9
- package/lib/vs/base/browser/iframe.js +0 -126
- package/lib/vs/base/browser/keyboardEvent.js +0 -599
- package/lib/vs/base/browser/mouseEvent.js +0 -155
- package/lib/vs/base/browser/touch.js +0 -315
- package/lib/vs/base/browser/ui/actionbar/actionViewItems.js +0 -397
- package/lib/vs/base/browser/ui/actionbar/actionbar.js +0 -583
- package/lib/vs/base/browser/ui/checkbox/checkbox.js +0 -251
- package/lib/vs/base/browser/ui/codicons/codiconLabel.js +0 -31
- package/lib/vs/base/browser/ui/codicons/codiconStyles.js +0 -47
- package/lib/vs/base/browser/ui/contextview/contextview.js +0 -367
- package/lib/vs/base/browser/ui/dropdown/dropdown.js +0 -256
- package/lib/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +0 -120
- package/lib/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +0 -118
- package/lib/vs/base/browser/ui/list/list.js +0 -54
- package/lib/vs/base/browser/ui/list/listPaging.js +0 -322
- package/lib/vs/base/browser/ui/list/listView.js +0 -1388
- package/lib/vs/base/browser/ui/list/listWidget.js +0 -1709
- package/lib/vs/base/browser/ui/list/rangeMap.js +0 -223
- package/lib/vs/base/browser/ui/list/rowCache.js +0 -113
- package/lib/vs/base/browser/ui/list/splice.js +0 -23
- package/lib/vs/base/browser/ui/menu/menu.js +0 -1371
- package/lib/vs/base/browser/ui/menu/menubar.js +0 -1139
- package/lib/vs/base/browser/ui/scrollbar/abstractScrollbar.js +0 -278
- package/lib/vs/base/browser/ui/scrollbar/horizontalScrollbar.js +0 -115
- package/lib/vs/base/browser/ui/scrollbar/scrollableElement.js +0 -646
- package/lib/vs/base/browser/ui/scrollbar/scrollableElementOptions.js +0 -9
- package/lib/vs/base/browser/ui/scrollbar/scrollbarArrow.js +0 -106
- package/lib/vs/base/browser/ui/scrollbar/scrollbarState.js +0 -184
- package/lib/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js +0 -116
- package/lib/vs/base/browser/ui/scrollbar/verticalScrollbar.js +0 -114
- package/lib/vs/base/browser/ui/selectBox/selectBox.js +0 -85
- package/lib/vs/base/browser/ui/selectBox/selectBoxCustom.js +0 -985
- package/lib/vs/base/browser/ui/selectBox/selectBoxNative.js +0 -188
- package/lib/vs/base/browser/ui/toolbar/toolbar.js +0 -206
- package/lib/vs/base/browser/ui/widget.js +0 -69
- package/lib/vs/base/common/actions.js +0 -224
- package/lib/vs/base/common/amd.js +0 -31
- package/lib/vs/base/common/arrays.js +0 -641
- package/lib/vs/base/common/assert.js +0 -21
- package/lib/vs/base/common/async.js +0 -966
- package/lib/vs/base/common/buffer.js +0 -250
- package/lib/vs/base/common/cache.js +0 -40
- package/lib/vs/base/common/cancellation.js +0 -146
- package/lib/vs/base/common/charCode.js +0 -9
- package/lib/vs/base/common/codicon.js +0 -136
- package/lib/vs/base/common/codicons.js +0 -1378
- package/lib/vs/base/common/collections.js +0 -133
- package/lib/vs/base/common/color.js +0 -716
- package/lib/vs/base/common/comparers.js +0 -280
- package/lib/vs/base/common/console.js +0 -142
- package/lib/vs/base/common/date.js +0 -113
- package/lib/vs/base/common/decorators.js +0 -169
- package/lib/vs/base/common/errorMessage.js +0 -93
- package/lib/vs/base/common/errors.js +0 -213
- package/lib/vs/base/common/errorsWithActions.js +0 -28
- package/lib/vs/base/common/event.js +0 -873
- package/lib/vs/base/common/extpath.js +0 -401
- package/lib/vs/base/common/filters.js +0 -948
- package/lib/vs/base/common/functional.js +0 -28
- package/lib/vs/base/common/fuzzyScorer.js +0 -811
- package/lib/vs/base/common/glob.js +0 -696
- package/lib/vs/base/common/hash.js +0 -359
- package/lib/vs/base/common/history.js +0 -116
- package/lib/vs/base/common/htmlContent.js +0 -162
- package/lib/vs/base/common/idGenerator.js +0 -25
- package/lib/vs/base/common/iterator.js +0 -118
- package/lib/vs/base/common/json.js +0 -1624
- package/lib/vs/base/common/jsonEdit.js +0 -272
- package/lib/vs/base/common/jsonErrorMessages.js +0 -69
- package/lib/vs/base/common/jsonFormatter.js +0 -316
- package/lib/vs/base/common/jsonSchema.js +0 -9
- package/lib/vs/base/common/keyCodes.js +0 -591
- package/lib/vs/base/common/keybindingLabels.js +0 -231
- package/lib/vs/base/common/keybindingParser.js +0 -142
- package/lib/vs/base/common/labels.js +0 -430
- package/lib/vs/base/common/lazy.js +0 -71
- package/lib/vs/base/common/lifecycle.js +0 -308
- package/lib/vs/base/common/linkedList.js +0 -152
- package/lib/vs/base/common/linkedText.js +0 -73
- package/lib/vs/base/common/map.js +0 -1108
- package/lib/vs/base/common/marshalling.js +0 -80
- package/lib/vs/base/common/mime.js +0 -321
- package/lib/vs/base/common/navigator.js +0 -50
- package/lib/vs/base/common/network.js +0 -160
- package/lib/vs/base/common/normalization.js +0 -78
- package/lib/vs/base/common/numbers.js +0 -55
- package/lib/vs/base/common/objects.js +0 -268
- package/lib/vs/base/common/paging.js +0 -190
- package/lib/vs/base/common/parsers.js +0 -78
- package/lib/vs/base/common/path.js +0 -1550
- package/lib/vs/base/common/platform.js +0 -245
- package/lib/vs/base/common/process.js +0 -52
- package/lib/vs/base/common/processes.js +0 -32
- package/lib/vs/base/common/range.js +0 -79
- package/lib/vs/base/common/resourceTree.js +0 -185
- package/lib/vs/base/common/resources.js +0 -421
- package/lib/vs/base/common/scanCode.js +0 -1472
- package/lib/vs/base/common/scrollable.js +0 -397
- package/lib/vs/base/common/search.js +0 -55
- package/lib/vs/base/common/sequence.js +0 -64
- package/lib/vs/base/common/severity.js +0 -55
- package/lib/vs/base/common/skipList.js +0 -234
- package/lib/vs/base/common/stopwatch.js +0 -45
- package/lib/vs/base/common/stream.js +0 -418
- package/lib/vs/base/common/strings.js +0 -1283
- package/lib/vs/base/common/styler.js +0 -9
- package/lib/vs/base/common/types.js +0 -296
- package/lib/vs/base/common/uint.js +0 -46
- package/lib/vs/base/common/uri.js +0 -756
- package/lib/vs/base/common/uriIpc.js +0 -154
- package/lib/vs/base/common/uuid.js +0 -70
- package/lib/vs/nls.mock.js +0 -31
- package/lib/vs/platform/actions/browser/menuEntryActionViewItem.js +0 -342
- package/lib/vs/platform/actions/common/actions.js +0 -456
- package/lib/vs/platform/actions/common/menuService.js +0 -194
- package/lib/vs/platform/clipboard/browser/clipboardService.js +0 -99
- package/lib/vs/platform/clipboard/common/clipboardService.js +0 -14
- package/lib/vs/platform/contextkey/common/contextkey.js +0 -1210
- package/lib/vs/platform/contextkey/common/contextkeys.js +0 -23
- package/lib/vs/platform/contextview/browser/contextView.js +0 -15
- package/lib/vs/platform/contextview/browser/contextViewService.js +0 -96
- package/lib/vs/platform/environment/common/argv.js +0 -9
- package/lib/vs/platform/environment/common/environment.js +0 -15
- package/lib/vs/platform/instantiation/common/descriptors.js +0 -25
- package/lib/vs/platform/instantiation/common/extensions.js +0 -26
- package/lib/vs/platform/instantiation/common/graph.js +0 -93
- package/lib/vs/platform/instantiation/common/instantiation.js +0 -84
- package/lib/vs/platform/instantiation/common/instantiationService.js +0 -361
- package/lib/vs/platform/instantiation/common/serviceCollection.js +0 -39
- package/lib/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -73
- package/lib/vs/platform/keybinding/common/keybinding.js +0 -14
- package/lib/vs/platform/keybinding/common/keybindingResolver.js +0 -391
- package/lib/vs/platform/keybinding/common/keybindingsRegistry.js +0 -229
- package/lib/vs/platform/keybinding/common/resolvedKeybindingItem.js +0 -47
- package/lib/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +0 -160
- package/lib/vs/platform/layout/browser/layoutService.js +0 -14
- package/lib/vs/platform/menubar/common/menubar.js +0 -34
- package/lib/vs/platform/registry/common/platform.js +0 -38
- package/lib/vs/platform/theme/browser/checkbox.js +0 -32
- package/lib/vs/platform/theme/common/colorRegistry.js +0 -1154
- package/lib/vs/platform/theme/common/styler.js +0 -290
- package/lib/vs/platform/theme/common/theme.js +0 -21
- package/lib/vs/platform/theme/common/themeService.js +0 -176
- package/lib/vs/platform/theme/common/tokenClassificationRegistry.js +0 -540
- package/lib/vs/platform/theme/test/common/testThemeService.js +0 -98
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
8
|
-
var c = arguments.length,
|
|
9
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
10
|
-
d;
|
|
11
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var __param = this && this.__param || function (paramIndex, decorator) {
|
|
16
|
-
return function (target, key) {
|
|
17
|
-
decorator(target, key, paramIndex);
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
Object.defineProperty(exports, "__esModule", {
|
|
22
|
-
value: true
|
|
23
|
-
});
|
|
24
|
-
exports.registerAction2 = exports.Action2 = exports.SyncActionDescriptor = exports.MenuItemAction = exports.SubmenuItemAction = exports.ExecuteCommandAction = exports.MenuRegistry = exports.IMenuService = exports.MenuId = exports.isISubmenuItem = exports.isIMenuItem = void 0;
|
|
25
|
-
|
|
26
|
-
const actions_1 = require("../../../base/common/actions");
|
|
27
|
-
|
|
28
|
-
const descriptors_1 = require("../../instantiation/common/descriptors");
|
|
29
|
-
|
|
30
|
-
const instantiation_1 = require("../../instantiation/common/instantiation");
|
|
31
|
-
|
|
32
|
-
const keybindingsRegistry_1 = require("../../keybinding/common/keybindingsRegistry");
|
|
33
|
-
|
|
34
|
-
const contextkey_1 = require("../../contextkey/common/contextkey");
|
|
35
|
-
|
|
36
|
-
const lifecycle_1 = require("../../../base/common/lifecycle");
|
|
37
|
-
|
|
38
|
-
const event_1 = require("../../../base/common/event");
|
|
39
|
-
|
|
40
|
-
const iterator_1 = require("../../../base/common/iterator");
|
|
41
|
-
|
|
42
|
-
const linkedList_1 = require("../../../base/common/linkedList");
|
|
43
|
-
|
|
44
|
-
function isIMenuItem(item) {
|
|
45
|
-
return item.command !== undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exports.isIMenuItem = isIMenuItem;
|
|
49
|
-
|
|
50
|
-
function isISubmenuItem(item) {
|
|
51
|
-
return item.submenu !== undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
exports.isISubmenuItem = isISubmenuItem;
|
|
55
|
-
|
|
56
|
-
class MenuId {
|
|
57
|
-
constructor(debugName) {
|
|
58
|
-
this.id = MenuId._idPool++;
|
|
59
|
-
this._debugName = debugName;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
exports.MenuId = MenuId;
|
|
65
|
-
MenuId._idPool = 0;
|
|
66
|
-
MenuId.CommandPalette = new MenuId('CommandPalette');
|
|
67
|
-
MenuId.DebugBreakpointsContext = new MenuId('DebugBreakpointsContext');
|
|
68
|
-
MenuId.DebugCallStackContext = new MenuId('DebugCallStackContext');
|
|
69
|
-
MenuId.DebugConsoleContext = new MenuId('DebugConsoleContext');
|
|
70
|
-
MenuId.DebugVariablesContext = new MenuId('DebugVariablesContext');
|
|
71
|
-
MenuId.DebugWatchContext = new MenuId('DebugWatchContext');
|
|
72
|
-
MenuId.DebugToolBar = new MenuId('DebugToolBar');
|
|
73
|
-
MenuId.EditorContext = new MenuId('EditorContext');
|
|
74
|
-
MenuId.EditorContextPeek = new MenuId('EditorContextPeek');
|
|
75
|
-
MenuId.EditorTitle = new MenuId('EditorTitle');
|
|
76
|
-
MenuId.EditorTitleContext = new MenuId('EditorTitleContext');
|
|
77
|
-
MenuId.EmptyEditorGroupContext = new MenuId('EmptyEditorGroupContext');
|
|
78
|
-
MenuId.ExplorerContext = new MenuId('ExplorerContext');
|
|
79
|
-
MenuId.ExtensionContext = new MenuId('ExtensionContext');
|
|
80
|
-
MenuId.GlobalActivity = new MenuId('GlobalActivity');
|
|
81
|
-
MenuId.MenubarAppearanceMenu = new MenuId('MenubarAppearanceMenu');
|
|
82
|
-
MenuId.MenubarDebugMenu = new MenuId('MenubarDebugMenu');
|
|
83
|
-
MenuId.MenubarEditMenu = new MenuId('MenubarEditMenu');
|
|
84
|
-
MenuId.MenubarFileMenu = new MenuId('MenubarFileMenu');
|
|
85
|
-
MenuId.MenubarGoMenu = new MenuId('MenubarGoMenu');
|
|
86
|
-
MenuId.MenubarHelpMenu = new MenuId('MenubarHelpMenu');
|
|
87
|
-
MenuId.MenubarLayoutMenu = new MenuId('MenubarLayoutMenu');
|
|
88
|
-
MenuId.MenubarNewBreakpointMenu = new MenuId('MenubarNewBreakpointMenu');
|
|
89
|
-
MenuId.MenubarPreferencesMenu = new MenuId('MenubarPreferencesMenu');
|
|
90
|
-
MenuId.MenubarRecentMenu = new MenuId('MenubarRecentMenu');
|
|
91
|
-
MenuId.MenubarSelectionMenu = new MenuId('MenubarSelectionMenu');
|
|
92
|
-
MenuId.MenubarSwitchEditorMenu = new MenuId('MenubarSwitchEditorMenu');
|
|
93
|
-
MenuId.MenubarSwitchGroupMenu = new MenuId('MenubarSwitchGroupMenu');
|
|
94
|
-
MenuId.MenubarTerminalMenu = new MenuId('MenubarTerminalMenu');
|
|
95
|
-
MenuId.MenubarViewMenu = new MenuId('MenubarViewMenu');
|
|
96
|
-
MenuId.MenubarWebNavigationMenu = new MenuId('MenubarWebNavigationMenu');
|
|
97
|
-
MenuId.OpenEditorsContext = new MenuId('OpenEditorsContext');
|
|
98
|
-
MenuId.ProblemsPanelContext = new MenuId('ProblemsPanelContext');
|
|
99
|
-
MenuId.SCMChangeContext = new MenuId('SCMChangeContext');
|
|
100
|
-
MenuId.SCMResourceContext = new MenuId('SCMResourceContext');
|
|
101
|
-
MenuId.SCMResourceFolderContext = new MenuId('SCMResourceFolderContext');
|
|
102
|
-
MenuId.SCMResourceGroupContext = new MenuId('SCMResourceGroupContext');
|
|
103
|
-
MenuId.SCMSourceControl = new MenuId('SCMSourceControl');
|
|
104
|
-
MenuId.SCMTitle = new MenuId('SCMTitle');
|
|
105
|
-
MenuId.SearchContext = new MenuId('SearchContext');
|
|
106
|
-
MenuId.StatusBarWindowIndicatorMenu = new MenuId('StatusBarWindowIndicatorMenu');
|
|
107
|
-
MenuId.TouchBarContext = new MenuId('TouchBarContext');
|
|
108
|
-
MenuId.TitleBarContext = new MenuId('TitleBarContext');
|
|
109
|
-
MenuId.TunnelContext = new MenuId('TunnelContext');
|
|
110
|
-
MenuId.TunnelInline = new MenuId('TunnelInline');
|
|
111
|
-
MenuId.TunnelTitle = new MenuId('TunnelTitle');
|
|
112
|
-
MenuId.ViewItemContext = new MenuId('ViewItemContext');
|
|
113
|
-
MenuId.ViewContainerTitleContext = new MenuId('ViewContainerTitleContext');
|
|
114
|
-
MenuId.ViewTitle = new MenuId('ViewTitle');
|
|
115
|
-
MenuId.ViewTitleContext = new MenuId('ViewTitleContext');
|
|
116
|
-
MenuId.CommentThreadTitle = new MenuId('CommentThreadTitle');
|
|
117
|
-
MenuId.CommentThreadActions = new MenuId('CommentThreadActions');
|
|
118
|
-
MenuId.CommentTitle = new MenuId('CommentTitle');
|
|
119
|
-
MenuId.CommentActions = new MenuId('CommentActions');
|
|
120
|
-
MenuId.NotebookCellTitle = new MenuId('NotebookCellTitle');
|
|
121
|
-
MenuId.NotebookCellInsert = new MenuId('NotebookCellInsert');
|
|
122
|
-
MenuId.NotebookCellBetween = new MenuId('NotebookCellBetween');
|
|
123
|
-
MenuId.NotebookCellListTop = new MenuId('NotebookCellTop');
|
|
124
|
-
MenuId.NotebookDiffCellInputTitle = new MenuId('NotebookDiffCellInputTitle');
|
|
125
|
-
MenuId.NotebookDiffCellMetadataTitle = new MenuId('NotebookDiffCellMetadataTitle');
|
|
126
|
-
MenuId.NotebookDiffCellOutputsTitle = new MenuId('NotebookDiffCellOutputsTitle');
|
|
127
|
-
MenuId.BulkEditTitle = new MenuId('BulkEditTitle');
|
|
128
|
-
MenuId.BulkEditContext = new MenuId('BulkEditContext');
|
|
129
|
-
MenuId.TimelineItemContext = new MenuId('TimelineItemContext');
|
|
130
|
-
MenuId.TimelineTitle = new MenuId('TimelineTitle');
|
|
131
|
-
MenuId.TimelineTitleContext = new MenuId('TimelineTitleContext');
|
|
132
|
-
MenuId.AccountsContext = new MenuId('AccountsContext');
|
|
133
|
-
exports.IMenuService = instantiation_1.createDecorator('menuService');
|
|
134
|
-
exports.MenuRegistry = new class {
|
|
135
|
-
constructor() {
|
|
136
|
-
this._commands = new Map();
|
|
137
|
-
this._menuItems = new Map();
|
|
138
|
-
this._onDidChangeMenu = new event_1.Emitter();
|
|
139
|
-
this.onDidChangeMenu = this._onDidChangeMenu.event;
|
|
140
|
-
this._commandPaletteChangeEvent = {
|
|
141
|
-
has: id => id === MenuId.CommandPalette
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
addCommand(command) {
|
|
146
|
-
return this.addCommands(iterator_1.Iterable.single(command));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
addCommands(commands) {
|
|
150
|
-
for (const command of commands) {
|
|
151
|
-
this._commands.set(command.id, command);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
this._onDidChangeMenu.fire(this._commandPaletteChangeEvent);
|
|
155
|
-
|
|
156
|
-
return lifecycle_1.toDisposable(() => {
|
|
157
|
-
let didChange = false;
|
|
158
|
-
|
|
159
|
-
for (const command of commands) {
|
|
160
|
-
didChange = this._commands.delete(command.id) || didChange;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (didChange) {
|
|
164
|
-
this._onDidChangeMenu.fire(this._commandPaletteChangeEvent);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
getCommand(id) {
|
|
170
|
-
return this._commands.get(id);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
getCommands() {
|
|
174
|
-
const map = new Map();
|
|
175
|
-
|
|
176
|
-
this._commands.forEach((value, key) => map.set(key, value));
|
|
177
|
-
|
|
178
|
-
return map;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
appendMenuItem(id, item) {
|
|
182
|
-
return this.appendMenuItems(iterator_1.Iterable.single({
|
|
183
|
-
id,
|
|
184
|
-
item
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
appendMenuItems(items) {
|
|
189
|
-
const changedIds = new Set();
|
|
190
|
-
const toRemove = new linkedList_1.LinkedList();
|
|
191
|
-
|
|
192
|
-
for (const {
|
|
193
|
-
id,
|
|
194
|
-
item
|
|
195
|
-
} of items) {
|
|
196
|
-
let list = this._menuItems.get(id);
|
|
197
|
-
|
|
198
|
-
if (!list) {
|
|
199
|
-
list = new linkedList_1.LinkedList();
|
|
200
|
-
|
|
201
|
-
this._menuItems.set(id, list);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
toRemove.push(list.push(item));
|
|
205
|
-
changedIds.add(id);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
this._onDidChangeMenu.fire(changedIds);
|
|
209
|
-
|
|
210
|
-
return lifecycle_1.toDisposable(() => {
|
|
211
|
-
if (toRemove.size > 0) {
|
|
212
|
-
for (let fn of toRemove) {
|
|
213
|
-
fn();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
this._onDidChangeMenu.fire(changedIds);
|
|
217
|
-
|
|
218
|
-
toRemove.clear();
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
getMenuItems(id) {
|
|
224
|
-
let result;
|
|
225
|
-
|
|
226
|
-
if (this._menuItems.has(id)) {
|
|
227
|
-
result = [...this._menuItems.get(id)];
|
|
228
|
-
} else {
|
|
229
|
-
result = [];
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (id === MenuId.CommandPalette) {
|
|
233
|
-
// CommandPalette is special because it shows
|
|
234
|
-
// all commands by default
|
|
235
|
-
this._appendImplicitItems(result);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return result;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
_appendImplicitItems(result) {
|
|
242
|
-
const set = new Set();
|
|
243
|
-
|
|
244
|
-
for (const item of result) {
|
|
245
|
-
if (isIMenuItem(item)) {
|
|
246
|
-
set.add(item.command.id);
|
|
247
|
-
|
|
248
|
-
if (item.alt) {
|
|
249
|
-
set.add(item.alt.id);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
this._commands.forEach((command, id) => {
|
|
255
|
-
if (!set.has(id)) {
|
|
256
|
-
result.push({
|
|
257
|
-
command
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
}();
|
|
264
|
-
|
|
265
|
-
class ExecuteCommandAction extends actions_1.Action {
|
|
266
|
-
constructor(id, label) {
|
|
267
|
-
super(id, label);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
exports.ExecuteCommandAction = ExecuteCommandAction;
|
|
273
|
-
|
|
274
|
-
class SubmenuItemAction extends actions_1.SubmenuAction {
|
|
275
|
-
constructor(item, menuService, contextKeyService, options) {
|
|
276
|
-
const result = [];
|
|
277
|
-
const menu = menuService.createMenu(item.submenu, contextKeyService);
|
|
278
|
-
const groups = menu.getActions(options);
|
|
279
|
-
menu.dispose();
|
|
280
|
-
|
|
281
|
-
for (let group of groups) {
|
|
282
|
-
const [, actions] = group;
|
|
283
|
-
|
|
284
|
-
if (actions.length > 0) {
|
|
285
|
-
result.push(...actions);
|
|
286
|
-
result.push(new actions_1.Separator());
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (result.length) {
|
|
291
|
-
result.pop(); // remove last separator
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
super(`submenuitem.${item.submenu.id}`, typeof item.title === 'string' ? item.title : item.title.value, result, 'submenu');
|
|
295
|
-
this.item = item;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
exports.SubmenuItemAction = SubmenuItemAction;
|
|
301
|
-
let MenuItemAction = class MenuItemAction extends ExecuteCommandAction {
|
|
302
|
-
constructor(item, alt, options, contextKeyService) {
|
|
303
|
-
typeof item.title === 'string' ? super(item.id, item.title) : super(item.id, item.title.value);
|
|
304
|
-
this._cssClass = undefined;
|
|
305
|
-
this._enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition);
|
|
306
|
-
this._tooltip = item.tooltip ? typeof item.tooltip === 'string' ? item.tooltip : item.tooltip.value : undefined;
|
|
307
|
-
|
|
308
|
-
if (item.toggled) {
|
|
309
|
-
const toggled = item.toggled.condition ? item.toggled : {
|
|
310
|
-
condition: item.toggled
|
|
311
|
-
};
|
|
312
|
-
this._checked = contextKeyService.contextMatchesRules(toggled.condition);
|
|
313
|
-
|
|
314
|
-
if (this._checked && toggled.tooltip) {
|
|
315
|
-
this._tooltip = typeof toggled.tooltip === 'string' ? toggled.tooltip : toggled.tooltip.value;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
this._options = options || {};
|
|
320
|
-
this.item = item;
|
|
321
|
-
this.alt = alt ? new MenuItemAction(alt, undefined, this._options, contextKeyService) : undefined;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
dispose() {
|
|
325
|
-
if (this.alt) {
|
|
326
|
-
this.alt.dispose();
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
super.dispose();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
run(...args) {
|
|
333
|
-
let runArgs = [];
|
|
334
|
-
|
|
335
|
-
if (this._options.arg) {
|
|
336
|
-
runArgs = [...runArgs, this._options.arg];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
if (this._options.shouldForwardArgs) {
|
|
340
|
-
runArgs = [...runArgs, ...args];
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
return super.run(...runArgs);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
};
|
|
347
|
-
MenuItemAction = __decorate([__param(3, contextkey_1.IContextKeyService)], MenuItemAction);
|
|
348
|
-
exports.MenuItemAction = MenuItemAction;
|
|
349
|
-
|
|
350
|
-
class SyncActionDescriptor {
|
|
351
|
-
constructor(ctor, id, label, keybindings, keybindingContext, keybindingWeight) {
|
|
352
|
-
this._id = id;
|
|
353
|
-
this._label = label;
|
|
354
|
-
this._keybindings = keybindings;
|
|
355
|
-
this._keybindingContext = keybindingContext;
|
|
356
|
-
this._keybindingWeight = keybindingWeight;
|
|
357
|
-
this._descriptor = descriptors_1.createSyncDescriptor(ctor, this._id, this._label);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
static create(ctor, id, label, keybindings, keybindingContext, keybindingWeight) {
|
|
361
|
-
return new SyncActionDescriptor(ctor, id, label, keybindings, keybindingContext, keybindingWeight);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
static from(ctor, keybindings, keybindingContext, keybindingWeight) {
|
|
365
|
-
return SyncActionDescriptor.create(ctor, ctor.ID, ctor.LABEL, keybindings, keybindingContext, keybindingWeight);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
get syncDescriptor() {
|
|
369
|
-
return this._descriptor;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
get id() {
|
|
373
|
-
return this._id;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
get label() {
|
|
377
|
-
return this._label;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
get keybindings() {
|
|
381
|
-
return this._keybindings;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
get keybindingContext() {
|
|
385
|
-
return this._keybindingContext;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
get keybindingWeight() {
|
|
389
|
-
return this._keybindingWeight;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
exports.SyncActionDescriptor = SyncActionDescriptor;
|
|
395
|
-
|
|
396
|
-
class Action2 {
|
|
397
|
-
constructor(desc) {
|
|
398
|
-
this.desc = desc;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
exports.Action2 = Action2;
|
|
404
|
-
|
|
405
|
-
function registerAction2(ctor) {
|
|
406
|
-
const disposables = new lifecycle_1.DisposableStore();
|
|
407
|
-
const action = new ctor();
|
|
408
|
-
const {
|
|
409
|
-
f1,
|
|
410
|
-
menu,
|
|
411
|
-
keybinding,
|
|
412
|
-
...command
|
|
413
|
-
} = action.desc; // menu
|
|
414
|
-
|
|
415
|
-
if (Array.isArray(menu)) {
|
|
416
|
-
disposables.add(exports.MenuRegistry.appendMenuItems(menu.map(item => ({
|
|
417
|
-
id: item.id,
|
|
418
|
-
item: {
|
|
419
|
-
command,
|
|
420
|
-
...item
|
|
421
|
-
}
|
|
422
|
-
}))));
|
|
423
|
-
} else if (menu) {
|
|
424
|
-
disposables.add(exports.MenuRegistry.appendMenuItem(menu.id, {
|
|
425
|
-
command,
|
|
426
|
-
...menu
|
|
427
|
-
}));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
if (f1) {
|
|
431
|
-
disposables.add(exports.MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
432
|
-
command,
|
|
433
|
-
when: command.precondition
|
|
434
|
-
}));
|
|
435
|
-
disposables.add(exports.MenuRegistry.addCommand(command));
|
|
436
|
-
} // keybinding
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
if (Array.isArray(keybinding)) {
|
|
440
|
-
for (let item of keybinding) {
|
|
441
|
-
keybindingsRegistry_1.KeybindingsRegistry.registerKeybindingRule({ ...item,
|
|
442
|
-
id: command.id,
|
|
443
|
-
when: command.precondition ? contextkey_1.ContextKeyExpr.and(command.precondition, item.when) : item.when
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
} else if (keybinding) {
|
|
447
|
-
keybindingsRegistry_1.KeybindingsRegistry.registerKeybindingRule({ ...keybinding,
|
|
448
|
-
id: command.id,
|
|
449
|
-
when: command.precondition ? contextkey_1.ContextKeyExpr.and(command.precondition, keybinding.when) : keybinding.when
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
return disposables;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
exports.registerAction2 = registerAction2; //#endregion
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
8
|
-
var c = arguments.length,
|
|
9
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
10
|
-
d;
|
|
11
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var __param = this && this.__param || function (paramIndex, decorator) {
|
|
16
|
-
return function (target, key) {
|
|
17
|
-
decorator(target, key, paramIndex);
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
Object.defineProperty(exports, "__esModule", {
|
|
22
|
-
value: true
|
|
23
|
-
});
|
|
24
|
-
exports.MenuService = void 0;
|
|
25
|
-
|
|
26
|
-
const event_1 = require("../../../base/common/event");
|
|
27
|
-
|
|
28
|
-
const lifecycle_1 = require("../../../base/common/lifecycle");
|
|
29
|
-
|
|
30
|
-
const actions_1 = require("./actions");
|
|
31
|
-
|
|
32
|
-
const contextkey_1 = require("../../contextkey/common/contextkey");
|
|
33
|
-
|
|
34
|
-
class MenuService {
|
|
35
|
-
constructor() {//
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
createMenu(id, contextKeyService) {
|
|
39
|
-
return new Menu(id, contextKeyService, this);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.MenuService = MenuService;
|
|
45
|
-
let Menu = class Menu {
|
|
46
|
-
constructor(_id, _contextKeyService, _menuService) {
|
|
47
|
-
this._id = _id;
|
|
48
|
-
this._contextKeyService = _contextKeyService;
|
|
49
|
-
this._menuService = _menuService;
|
|
50
|
-
this._onDidChange = new event_1.Emitter();
|
|
51
|
-
this._dispoables = new lifecycle_1.DisposableStore();
|
|
52
|
-
this._menuGroups = [];
|
|
53
|
-
this._contextKeys = new Set();
|
|
54
|
-
|
|
55
|
-
this._build(); // rebuild this menu whenever the menu registry reports an
|
|
56
|
-
// event for this MenuId
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this._dispoables.add(event_1.Event.debounce(event_1.Event.filter(actions_1.MenuRegistry.onDidChangeMenu, set => set.has(this._id)), () => {}, 50)(this._build, this)); // when context keys change we need to check if the menu also
|
|
60
|
-
// has changed
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this._dispoables.add(event_1.Event.debounce(this._contextKeyService.onDidChangeContext, (last, event) => last || event.affectsSome(this._contextKeys), 50)(e => e && this._onDidChange.fire(undefined), this));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
dispose() {
|
|
67
|
-
this._dispoables.dispose();
|
|
68
|
-
|
|
69
|
-
this._onDidChange.dispose();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
_build() {
|
|
73
|
-
// reset
|
|
74
|
-
this._menuGroups.length = 0;
|
|
75
|
-
|
|
76
|
-
this._contextKeys.clear();
|
|
77
|
-
|
|
78
|
-
const menuItems = actions_1.MenuRegistry.getMenuItems(this._id);
|
|
79
|
-
let group;
|
|
80
|
-
menuItems.sort(Menu._compareMenuItems);
|
|
81
|
-
|
|
82
|
-
for (let item of menuItems) {
|
|
83
|
-
// group by groupId
|
|
84
|
-
const groupName = item.group || '';
|
|
85
|
-
|
|
86
|
-
if (!group || group[0] !== groupName) {
|
|
87
|
-
group = [groupName, []];
|
|
88
|
-
|
|
89
|
-
this._menuGroups.push(group);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
group[1].push(item); // keep keys for eventing
|
|
93
|
-
|
|
94
|
-
Menu._fillInKbExprKeys(item.when, this._contextKeys); // keep precondition keys for event if applicable
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (actions_1.isIMenuItem(item) && item.command.precondition) {
|
|
98
|
-
Menu._fillInKbExprKeys(item.command.precondition, this._contextKeys);
|
|
99
|
-
} // keep toggled keys for event if applicable
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (actions_1.isIMenuItem(item) && item.command.toggled) {
|
|
103
|
-
const toggledExpression = item.command.toggled.condition || item.command.toggled;
|
|
104
|
-
|
|
105
|
-
Menu._fillInKbExprKeys(toggledExpression, this._contextKeys);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
this._onDidChange.fire(this);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
get onDidChange() {
|
|
113
|
-
return this._onDidChange.event;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
getActions(options) {
|
|
117
|
-
const result = [];
|
|
118
|
-
|
|
119
|
-
for (let group of this._menuGroups) {
|
|
120
|
-
const [id, items] = group;
|
|
121
|
-
const activeActions = [];
|
|
122
|
-
|
|
123
|
-
for (const item of items) {
|
|
124
|
-
if (this._contextKeyService.contextMatchesRules(item.when)) {
|
|
125
|
-
const action = actions_1.isIMenuItem(item) ? new actions_1.MenuItemAction(item.command, item.alt, options, this._contextKeyService) : new actions_1.SubmenuItemAction(item, this._menuService, this._contextKeyService, options);
|
|
126
|
-
activeActions.push(action);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (activeActions.length > 0) {
|
|
131
|
-
result.push([id, activeActions]);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
static _fillInKbExprKeys(exp, set) {
|
|
139
|
-
if (exp) {
|
|
140
|
-
for (let key of exp.keys()) {
|
|
141
|
-
set.add(key);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
static _compareMenuItems(a, b) {
|
|
147
|
-
let aGroup = a.group;
|
|
148
|
-
let bGroup = b.group;
|
|
149
|
-
|
|
150
|
-
if (aGroup !== bGroup) {
|
|
151
|
-
// Falsy groups come last
|
|
152
|
-
if (!aGroup) {
|
|
153
|
-
return 1;
|
|
154
|
-
} else if (!bGroup) {
|
|
155
|
-
return -1;
|
|
156
|
-
} // 'navigation' group comes first
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (aGroup === 'navigation') {
|
|
160
|
-
return -1;
|
|
161
|
-
} else if (bGroup === 'navigation') {
|
|
162
|
-
return 1;
|
|
163
|
-
} // lexical sort for groups
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
let value = aGroup.localeCompare(bGroup);
|
|
167
|
-
|
|
168
|
-
if (value !== 0) {
|
|
169
|
-
return value;
|
|
170
|
-
}
|
|
171
|
-
} // sort on priority - default is 0
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
let aPrio = a.order || 0;
|
|
175
|
-
let bPrio = b.order || 0;
|
|
176
|
-
|
|
177
|
-
if (aPrio < bPrio) {
|
|
178
|
-
return -1;
|
|
179
|
-
} else if (aPrio > bPrio) {
|
|
180
|
-
return 1;
|
|
181
|
-
} // sort on titles
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return Menu._compareTitles(actions_1.isIMenuItem(a) ? a.command.title : a.title, actions_1.isIMenuItem(b) ? b.command.title : b.title);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
static _compareTitles(a, b) {
|
|
188
|
-
const aStr = typeof a === 'string' ? a : a.value;
|
|
189
|
-
const bStr = typeof b === 'string' ? b : b.value;
|
|
190
|
-
return aStr.localeCompare(bStr);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
};
|
|
194
|
-
Menu = __decorate([__param(1, contextkey_1.IContextKeyService), __param(2, actions_1.IMenuService)], Menu);
|