@codingame/monaco-vscode-views-service-override 2.1.4 → 2.2.0-next.2
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/index.d.ts +11 -9
- package/index.js +8 -6
- package/package.json +11 -11
- package/tools/views.d.ts +102 -0
- package/tools/views.js +253 -0
- package/views.d.ts +4 -99
- package/views.js +52 -280
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
- package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
- package/vscode/src/vs/base/common/codicons.d.ts +0 -579
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
- package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
|
@@ -1,645 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
|
|
4
|
-
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
5
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
-
import { Disposable, DisposableMap, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { CompositeDragAndDrop, CompositeBar } from './compositeBar.js';
|
|
8
|
-
import { isMouseEvent, asCSSUrl, createCSSRule, Dimension } from 'vscode/vscode/vs/base/browser/dom';
|
|
9
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
10
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
11
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
12
|
-
import { CompositeBarAction, ToggleCompositePinnedAction, ToggleCompositeBadgeAction } from 'vscode/vscode/vs/workbench/browser/parts/compositeBarActions';
|
|
13
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
14
|
-
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
|
-
import { isString } from 'vscode/vscode/vs/base/common/types';
|
|
16
|
-
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
17
|
-
import { isNative } from 'vscode/vscode/vs/base/common/platform';
|
|
18
|
-
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
19
|
-
import { toAction } from 'vscode/vscode/vs/base/common/actions';
|
|
20
|
-
import { StringSHA1 } from 'vscode/vscode/vs/base/common/hash';
|
|
21
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
22
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
23
|
-
|
|
24
|
-
var ViewContainerActivityAction_1;
|
|
25
|
-
let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
26
|
-
constructor(options, part, paneCompositePart, instantiationService, storageService, extensionService, viewDescriptorService, contextKeyService, environmentService, layoutService) {
|
|
27
|
-
super();
|
|
28
|
-
this.options = options;
|
|
29
|
-
this.part = part;
|
|
30
|
-
this.paneCompositePart = paneCompositePart;
|
|
31
|
-
this.instantiationService = instantiationService;
|
|
32
|
-
this.storageService = storageService;
|
|
33
|
-
this.extensionService = extensionService;
|
|
34
|
-
this.viewDescriptorService = viewDescriptorService;
|
|
35
|
-
this.contextKeyService = contextKeyService;
|
|
36
|
-
this.environmentService = environmentService;
|
|
37
|
-
this.layoutService = layoutService;
|
|
38
|
-
this.viewContainerDisposables = this._register(( new DisposableMap()));
|
|
39
|
-
this.compositeActions = ( new Map());
|
|
40
|
-
this.hasExtensionsRegistered = false;
|
|
41
|
-
this._cachedViewContainers = undefined;
|
|
42
|
-
this.location = paneCompositePart.partId === "workbench.parts.panel"
|
|
43
|
-
? 1 : paneCompositePart.partId === "workbench.parts.auxiliarybar"
|
|
44
|
-
? 2 : 0 ;
|
|
45
|
-
this.dndHandler = ( new CompositeDragAndDrop(
|
|
46
|
-
this.viewDescriptorService,
|
|
47
|
-
this.location,
|
|
48
|
-
async (id, focus) => { return (await this.paneCompositePart.openPaneComposite(id, focus)) ?? null; },
|
|
49
|
-
(from, to, before) => this.compositeBar.move(from, to, this.options.orientation === 1 ? before?.verticallyBefore : before?.horizontallyBefore),
|
|
50
|
-
() => this.compositeBar.getCompositeBarItems()
|
|
51
|
-
));
|
|
52
|
-
const cachedItems = ( this.cachedViewContainers
|
|
53
|
-
.map(container => ({
|
|
54
|
-
id: container.id,
|
|
55
|
-
name: container.name,
|
|
56
|
-
visible: !this.shouldBeHidden(container.id, container),
|
|
57
|
-
order: container.order,
|
|
58
|
-
pinned: container.pinned,
|
|
59
|
-
})));
|
|
60
|
-
this.compositeBar = this.createCompositeBar(cachedItems);
|
|
61
|
-
this.onDidRegisterViewContainers(this.getViewContainers());
|
|
62
|
-
this.registerListeners();
|
|
63
|
-
}
|
|
64
|
-
createCompositeBar(cachedItems) {
|
|
65
|
-
return this._register(this.instantiationService.createInstance(CompositeBar, cachedItems, {
|
|
66
|
-
icon: this.options.icon,
|
|
67
|
-
compact: this.options.compact,
|
|
68
|
-
orientation: this.options.orientation,
|
|
69
|
-
activityHoverOptions: this.options.activityHoverOptions,
|
|
70
|
-
preventLoopNavigation: this.options.preventLoopNavigation,
|
|
71
|
-
openComposite: async (compositeId, preserveFocus) => {
|
|
72
|
-
return (await this.paneCompositePart.openPaneComposite(compositeId, !preserveFocus)) ?? null;
|
|
73
|
-
},
|
|
74
|
-
getActivityAction: compositeId => this.getCompositeActions(compositeId).activityAction,
|
|
75
|
-
getCompositePinnedAction: compositeId => this.getCompositeActions(compositeId).pinnedAction,
|
|
76
|
-
getCompositeBadgeAction: compositeId => this.getCompositeActions(compositeId).badgeAction,
|
|
77
|
-
getOnCompositeClickAction: compositeId => this.getCompositeActions(compositeId).activityAction,
|
|
78
|
-
fillExtraContextMenuActions: (actions, e) => ( this.options.fillExtraContextMenuActions(actions, e)),
|
|
79
|
-
getContextMenuActionsForComposite: compositeId => this.getContextMenuActionsForComposite(compositeId),
|
|
80
|
-
getDefaultCompositeId: () => this.viewDescriptorService.getDefaultViewContainer(this.location)?.id,
|
|
81
|
-
dndHandler: this.dndHandler,
|
|
82
|
-
compositeSize: this.options.compositeSize,
|
|
83
|
-
overflowActionSize: this.options.overflowActionSize,
|
|
84
|
-
colors: theme => this.options.colors(theme),
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
getContextMenuActionsForComposite(compositeId) {
|
|
88
|
-
const actions = [];
|
|
89
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(compositeId);
|
|
90
|
-
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(viewContainer);
|
|
91
|
-
if (defaultLocation !== this.viewDescriptorService.getViewContainerLocation(viewContainer)) {
|
|
92
|
-
actions.push(toAction({ id: 'resetLocationAction', label: ( localizeWithPath(
|
|
93
|
-
'vs/workbench/browser/parts/paneCompositeBar',
|
|
94
|
-
'resetLocation',
|
|
95
|
-
"Reset Location"
|
|
96
|
-
)), run: () => this.viewDescriptorService.moveViewContainerToLocation(viewContainer, defaultLocation, undefined, 'resetLocationAction') }));
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
100
|
-
if (viewContainerModel.allViewDescriptors.length === 1) {
|
|
101
|
-
const viewToReset = viewContainerModel.allViewDescriptors[0];
|
|
102
|
-
const defaultContainer = this.viewDescriptorService.getDefaultContainerById(viewToReset.id);
|
|
103
|
-
if (defaultContainer !== viewContainer) {
|
|
104
|
-
actions.push(toAction({ id: 'resetLocationAction', label: ( localizeWithPath(
|
|
105
|
-
'vs/workbench/browser/parts/paneCompositeBar',
|
|
106
|
-
'resetLocation',
|
|
107
|
-
"Reset Location"
|
|
108
|
-
)), run: () => this.viewDescriptorService.moveViewsToContainer([viewToReset], defaultContainer, undefined, 'resetLocationAction') }));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return actions;
|
|
113
|
-
}
|
|
114
|
-
registerListeners() {
|
|
115
|
-
this._register(this.viewDescriptorService.onDidChangeViewContainers(({ added, removed }) => this.onDidChangeViewContainers(added, removed)));
|
|
116
|
-
this._register(this.viewDescriptorService.onDidChangeContainerLocation(({ viewContainer, from, to }) => this.onDidChangeViewContainerLocation(viewContainer, from, to)));
|
|
117
|
-
this._register(this.paneCompositePart.onDidPaneCompositeOpen(e => this.onDidChangeViewContainerVisibility(e.getId(), true)));
|
|
118
|
-
this._register(this.paneCompositePart.onDidPaneCompositeClose(e => this.onDidChangeViewContainerVisibility(e.getId(), false)));
|
|
119
|
-
this.extensionService.whenInstalledExtensionsRegistered().then(() => {
|
|
120
|
-
if (this._store.isDisposed) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
this.onDidRegisterExtensions();
|
|
124
|
-
this._register(this.compositeBar.onDidChange(() => this.saveCachedViewContainers()));
|
|
125
|
-
this._register(this.storageService.onDidChangeValue(0 , this.options.pinnedViewContainersKey, this._store)(e => this.onDidPinnedViewContainersStorageValueChange(e)));
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
onDidChangeViewContainers(added, removed) {
|
|
129
|
-
removed.filter(({ location }) => location === this.location).forEach(({ container }) => this.onDidDeregisterViewContainer(container));
|
|
130
|
-
this.onDidRegisterViewContainers(( added.filter(({ location }) => location === this.location).map(({ container }) => container)));
|
|
131
|
-
}
|
|
132
|
-
onDidChangeViewContainerLocation(container, from, to) {
|
|
133
|
-
if (from === this.location) {
|
|
134
|
-
this.onDidDeregisterViewContainer(container);
|
|
135
|
-
}
|
|
136
|
-
if (to === this.location) {
|
|
137
|
-
this.onDidRegisterViewContainers([container]);
|
|
138
|
-
const visibleComposites = this.compositeBar.getVisibleComposites();
|
|
139
|
-
if (!this.paneCompositePart.getActivePaneComposite() && this.layoutService.isVisible(this.paneCompositePart.partId) && visibleComposites.length) {
|
|
140
|
-
this.paneCompositePart.openPaneComposite(visibleComposites[0].id);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
onDidChangeViewContainerVisibility(id, visible) {
|
|
145
|
-
if (visible) {
|
|
146
|
-
this.onDidViewContainerVisible(id);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.compositeBar.deactivateComposite(id);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
onDidRegisterExtensions() {
|
|
153
|
-
this.hasExtensionsRegistered = true;
|
|
154
|
-
for (const { id } of this.cachedViewContainers) {
|
|
155
|
-
const viewContainer = this.getViewContainer(id);
|
|
156
|
-
if (viewContainer) {
|
|
157
|
-
this.showOrHideViewContainer(viewContainer);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
if (this.viewDescriptorService.isViewContainerRemovedPermanently(id)) {
|
|
161
|
-
this.removeComposite(id);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
this.hideComposite(id);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
this.saveCachedViewContainers();
|
|
169
|
-
}
|
|
170
|
-
onDidViewContainerVisible(id) {
|
|
171
|
-
const viewContainer = this.getViewContainer(id);
|
|
172
|
-
if (viewContainer) {
|
|
173
|
-
this.addComposite(viewContainer);
|
|
174
|
-
this.compositeBar.activateComposite(viewContainer.id);
|
|
175
|
-
if (this.shouldBeHidden(viewContainer)) {
|
|
176
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
177
|
-
if (viewContainerModel.activeViewDescriptors.length === 0) {
|
|
178
|
-
this.hideComposite(viewContainer.id);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
create(parent) {
|
|
184
|
-
return this.compositeBar.create(parent);
|
|
185
|
-
}
|
|
186
|
-
getCompositeActions(compositeId) {
|
|
187
|
-
let compositeActions = this.compositeActions.get(compositeId);
|
|
188
|
-
if (!compositeActions) {
|
|
189
|
-
const viewContainer = this.getViewContainer(compositeId);
|
|
190
|
-
if (viewContainer) {
|
|
191
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
192
|
-
compositeActions = {
|
|
193
|
-
activityAction: this._register(this.instantiationService.createInstance(ViewContainerActivityAction, this.toCompositeBarActionItemFrom(viewContainerModel), this.part, this.paneCompositePart)),
|
|
194
|
-
pinnedAction: this._register(( new ToggleCompositePinnedAction(this.toCompositeBarActionItemFrom(viewContainerModel), this.compositeBar))),
|
|
195
|
-
badgeAction: this._register(( new ToggleCompositeBadgeAction(this.toCompositeBarActionItemFrom(viewContainerModel), this.compositeBar)))
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
const cachedComposite = this.cachedViewContainers.filter(c => c.id === compositeId)[0];
|
|
200
|
-
compositeActions = {
|
|
201
|
-
activityAction: this._register(this.instantiationService.createInstance(PlaceHolderViewContainerActivityAction, this.toCompositeBarActionItem(compositeId, cachedComposite?.name ?? compositeId, cachedComposite?.icon, undefined), this.part, this.paneCompositePart)),
|
|
202
|
-
pinnedAction: this._register(( new PlaceHolderToggleCompositePinnedAction(compositeId, this.compositeBar))),
|
|
203
|
-
badgeAction: this._register(( new PlaceHolderToggleCompositeBadgeAction(compositeId, this.compositeBar)))
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
this.compositeActions.set(compositeId, compositeActions);
|
|
207
|
-
}
|
|
208
|
-
return compositeActions;
|
|
209
|
-
}
|
|
210
|
-
onDidRegisterViewContainers(viewContainers) {
|
|
211
|
-
for (const viewContainer of viewContainers) {
|
|
212
|
-
this.addComposite(viewContainer);
|
|
213
|
-
const cachedViewContainer = this.cachedViewContainers.filter(({ id }) => id === viewContainer.id)[0];
|
|
214
|
-
if (!cachedViewContainer) {
|
|
215
|
-
this.compositeBar.pin(viewContainer.id);
|
|
216
|
-
}
|
|
217
|
-
const visibleViewContainer = this.paneCompositePart.getActivePaneComposite();
|
|
218
|
-
if (visibleViewContainer?.getId() === viewContainer.id) {
|
|
219
|
-
this.compositeBar.activateComposite(viewContainer.id);
|
|
220
|
-
}
|
|
221
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
222
|
-
this.updateCompositeBarActionItem(viewContainer, viewContainerModel);
|
|
223
|
-
this.showOrHideViewContainer(viewContainer);
|
|
224
|
-
const disposables = ( new DisposableStore());
|
|
225
|
-
disposables.add(viewContainerModel.onDidChangeContainerInfo(() => this.updateCompositeBarActionItem(viewContainer, viewContainerModel)));
|
|
226
|
-
disposables.add(viewContainerModel.onDidChangeActiveViewDescriptors(() => this.showOrHideViewContainer(viewContainer)));
|
|
227
|
-
this.viewContainerDisposables.set(viewContainer.id, disposables);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
onDidDeregisterViewContainer(viewContainer) {
|
|
231
|
-
this.viewContainerDisposables.deleteAndDispose(viewContainer.id);
|
|
232
|
-
this.removeComposite(viewContainer.id);
|
|
233
|
-
}
|
|
234
|
-
updateCompositeBarActionItem(viewContainer, viewContainerModel) {
|
|
235
|
-
const compositeBarActionItem = this.toCompositeBarActionItemFrom(viewContainerModel);
|
|
236
|
-
const { activityAction, pinnedAction } = this.getCompositeActions(viewContainer.id);
|
|
237
|
-
activityAction.updateCompositeBarActionItem(compositeBarActionItem);
|
|
238
|
-
if (pinnedAction instanceof PlaceHolderToggleCompositePinnedAction) {
|
|
239
|
-
pinnedAction.setActivity(compositeBarActionItem);
|
|
240
|
-
}
|
|
241
|
-
if (this.options.recomputeSizes) {
|
|
242
|
-
this.compositeBar.recomputeSizes();
|
|
243
|
-
}
|
|
244
|
-
this.saveCachedViewContainers();
|
|
245
|
-
}
|
|
246
|
-
toCompositeBarActionItemFrom(viewContainerModel) {
|
|
247
|
-
return this.toCompositeBarActionItem(viewContainerModel.viewContainer.id, viewContainerModel.title, viewContainerModel.icon, viewContainerModel.keybindingId);
|
|
248
|
-
}
|
|
249
|
-
toCompositeBarActionItem(id, name, icon, keybindingId) {
|
|
250
|
-
let classNames = undefined;
|
|
251
|
-
let iconUrl = undefined;
|
|
252
|
-
if (this.options.icon) {
|
|
253
|
-
if (URI.isUri(icon)) {
|
|
254
|
-
iconUrl = icon;
|
|
255
|
-
const cssUrl = asCSSUrl(icon);
|
|
256
|
-
const hash = ( new StringSHA1());
|
|
257
|
-
hash.update(cssUrl);
|
|
258
|
-
const iconId = `activity-${id.replace(/\./g, '-')}-${hash.digest()}`;
|
|
259
|
-
const iconClass = `.monaco-workbench .${this.options.partContainerClass} .monaco-action-bar .action-label.${iconId}`;
|
|
260
|
-
classNames = [iconId, 'uri-icon'];
|
|
261
|
-
createCSSRule(iconClass, `
|
|
262
|
-
mask: ${cssUrl} no-repeat 50% 50%;
|
|
263
|
-
mask-size: ${this.options.iconSize}px;
|
|
264
|
-
-webkit-mask: ${cssUrl} no-repeat 50% 50%;
|
|
265
|
-
-webkit-mask-size: ${this.options.iconSize}px;
|
|
266
|
-
mask-origin: padding;
|
|
267
|
-
-webkit-mask-origin: padding;
|
|
268
|
-
`);
|
|
269
|
-
}
|
|
270
|
-
else if (ThemeIcon.isThemeIcon(icon)) {
|
|
271
|
-
classNames = ThemeIcon.asClassNameArray(icon);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return { id, name, classNames, iconUrl, keybindingId };
|
|
275
|
-
}
|
|
276
|
-
showOrHideViewContainer(viewContainer) {
|
|
277
|
-
if (this.shouldBeHidden(viewContainer)) {
|
|
278
|
-
this.hideComposite(viewContainer.id);
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
this.addComposite(viewContainer);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
shouldBeHidden(viewContainerOrId, cachedViewContainer) {
|
|
285
|
-
const viewContainer = isString(viewContainerOrId) ? this.getViewContainer(viewContainerOrId) : viewContainerOrId;
|
|
286
|
-
const viewContainerId = isString(viewContainerOrId) ? viewContainerOrId : viewContainerOrId.id;
|
|
287
|
-
if (viewContainer) {
|
|
288
|
-
if (viewContainer.hideIfEmpty) {
|
|
289
|
-
if (this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.length > 0) {
|
|
290
|
-
return false;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
if (!this.hasExtensionsRegistered && !(this.part === "workbench.parts.sidebar" && this.environmentService.remoteAuthority && isNative)) {
|
|
298
|
-
cachedViewContainer = cachedViewContainer || this.cachedViewContainers.find(({ id }) => id === viewContainerId);
|
|
299
|
-
if (!viewContainer && cachedViewContainer?.isBuiltin && cachedViewContainer?.visible) {
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
if (cachedViewContainer?.views?.length) {
|
|
303
|
-
return cachedViewContainer.views.every(({ when }) => !!when && !this.contextKeyService.contextMatchesRules(ContextKeyExpr.deserialize(when)));
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return true;
|
|
307
|
-
}
|
|
308
|
-
addComposite(viewContainer) {
|
|
309
|
-
this.compositeBar.addComposite({ id: viewContainer.id, name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value, order: viewContainer.order, requestedIndex: viewContainer.requestedIndex });
|
|
310
|
-
}
|
|
311
|
-
hideComposite(compositeId) {
|
|
312
|
-
this.compositeBar.hideComposite(compositeId);
|
|
313
|
-
const compositeActions = this.compositeActions.get(compositeId);
|
|
314
|
-
if (compositeActions) {
|
|
315
|
-
compositeActions.activityAction.dispose();
|
|
316
|
-
compositeActions.pinnedAction.dispose();
|
|
317
|
-
this.compositeActions.delete(compositeId);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
removeComposite(compositeId) {
|
|
321
|
-
this.compositeBar.removeComposite(compositeId);
|
|
322
|
-
const compositeActions = this.compositeActions.get(compositeId);
|
|
323
|
-
if (compositeActions) {
|
|
324
|
-
compositeActions.activityAction.dispose();
|
|
325
|
-
compositeActions.pinnedAction.dispose();
|
|
326
|
-
this.compositeActions.delete(compositeId);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
getPinnedPaneCompositeIds() {
|
|
330
|
-
const pinnedCompositeIds = ( this.compositeBar.getPinnedComposites().map(v => v.id));
|
|
331
|
-
return ( this.getViewContainers()
|
|
332
|
-
.filter(v => this.compositeBar.isPinned(v.id))
|
|
333
|
-
.sort((v1, v2) => pinnedCompositeIds.indexOf(v1.id) - pinnedCompositeIds.indexOf(v2.id))
|
|
334
|
-
.map(v => v.id));
|
|
335
|
-
}
|
|
336
|
-
getVisiblePaneCompositeIds() {
|
|
337
|
-
return ( this.compositeBar.getVisibleComposites()
|
|
338
|
-
.filter(v => this.paneCompositePart.getActivePaneComposite()?.getId() === v.id || this.compositeBar.isPinned(v.id))
|
|
339
|
-
.map(v => v.id));
|
|
340
|
-
}
|
|
341
|
-
getContextMenuActions() {
|
|
342
|
-
return this.compositeBar.getContextMenuActions();
|
|
343
|
-
}
|
|
344
|
-
focus(index) {
|
|
345
|
-
this.compositeBar.focus(index);
|
|
346
|
-
}
|
|
347
|
-
layout(width, height) {
|
|
348
|
-
this.compositeBar.layout(( new Dimension(width, height)));
|
|
349
|
-
}
|
|
350
|
-
getViewContainer(id) {
|
|
351
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(id);
|
|
352
|
-
return viewContainer && this.viewDescriptorService.getViewContainerLocation(viewContainer) === this.location ? viewContainer : undefined;
|
|
353
|
-
}
|
|
354
|
-
getViewContainers() {
|
|
355
|
-
return this.viewDescriptorService.getViewContainersByLocation(this.location);
|
|
356
|
-
}
|
|
357
|
-
onDidPinnedViewContainersStorageValueChange(e) {
|
|
358
|
-
if (this.pinnedViewContainersValue !== this.getStoredPinnedViewContainersValue() ) {
|
|
359
|
-
this._placeholderViewContainersValue = undefined;
|
|
360
|
-
this._pinnedViewContainersValue = undefined;
|
|
361
|
-
this._cachedViewContainers = undefined;
|
|
362
|
-
const newCompositeItems = [];
|
|
363
|
-
const compositeItems = this.compositeBar.getCompositeBarItems();
|
|
364
|
-
for (const cachedViewContainer of this.cachedViewContainers) {
|
|
365
|
-
newCompositeItems.push({
|
|
366
|
-
id: cachedViewContainer.id,
|
|
367
|
-
name: cachedViewContainer.name,
|
|
368
|
-
order: cachedViewContainer.order,
|
|
369
|
-
pinned: cachedViewContainer.pinned,
|
|
370
|
-
visible: cachedViewContainer.visible && !!this.getViewContainer(cachedViewContainer.id),
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
for (const viewContainer of this.getViewContainers()) {
|
|
374
|
-
if (!( newCompositeItems.some(({ id }) => id === viewContainer.id))) {
|
|
375
|
-
const index = compositeItems.findIndex(({ id }) => id === viewContainer.id);
|
|
376
|
-
if (index !== -1) {
|
|
377
|
-
const compositeItem = compositeItems[index];
|
|
378
|
-
newCompositeItems.splice(index, 0, {
|
|
379
|
-
id: viewContainer.id,
|
|
380
|
-
name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value,
|
|
381
|
-
order: compositeItem.order,
|
|
382
|
-
pinned: compositeItem.pinned,
|
|
383
|
-
visible: compositeItem.visible,
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
newCompositeItems.push({
|
|
388
|
-
id: viewContainer.id,
|
|
389
|
-
name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value,
|
|
390
|
-
order: viewContainer.order,
|
|
391
|
-
pinned: true,
|
|
392
|
-
visible: !this.shouldBeHidden(viewContainer),
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
this.compositeBar.setCompositeBarItems(newCompositeItems);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
saveCachedViewContainers() {
|
|
401
|
-
const state = [];
|
|
402
|
-
const compositeItems = this.compositeBar.getCompositeBarItems();
|
|
403
|
-
for (const compositeItem of compositeItems) {
|
|
404
|
-
const viewContainer = this.getViewContainer(compositeItem.id);
|
|
405
|
-
if (viewContainer) {
|
|
406
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
407
|
-
const views = [];
|
|
408
|
-
for (const { when } of viewContainerModel.allViewDescriptors) {
|
|
409
|
-
views.push({ when: when ? when.serialize() : undefined });
|
|
410
|
-
}
|
|
411
|
-
state.push({
|
|
412
|
-
id: compositeItem.id,
|
|
413
|
-
name: viewContainerModel.title,
|
|
414
|
-
icon: URI.isUri(viewContainerModel.icon) && this.environmentService.remoteAuthority ? undefined : viewContainerModel.icon,
|
|
415
|
-
views,
|
|
416
|
-
pinned: compositeItem.pinned,
|
|
417
|
-
order: compositeItem.order,
|
|
418
|
-
visible: compositeItem.visible,
|
|
419
|
-
isBuiltin: !viewContainer.extensionId
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
state.push({ id: compositeItem.id, name: compositeItem.name, pinned: compositeItem.pinned, order: compositeItem.order, visible: false, isBuiltin: false });
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
this.storeCachedViewContainersState(state);
|
|
427
|
-
}
|
|
428
|
-
get cachedViewContainers() {
|
|
429
|
-
if (this._cachedViewContainers === undefined) {
|
|
430
|
-
this._cachedViewContainers = this.getPinnedViewContainers();
|
|
431
|
-
for (const placeholderViewContainer of this.getPlaceholderViewContainers()) {
|
|
432
|
-
const cachedViewContainer = this._cachedViewContainers.find(cached => cached.id === placeholderViewContainer.id);
|
|
433
|
-
if (cachedViewContainer) {
|
|
434
|
-
cachedViewContainer.visible = placeholderViewContainer.visible ?? cachedViewContainer.visible;
|
|
435
|
-
cachedViewContainer.name = placeholderViewContainer.name;
|
|
436
|
-
cachedViewContainer.icon = placeholderViewContainer.themeIcon ? placeholderViewContainer.themeIcon :
|
|
437
|
-
placeholderViewContainer.iconUrl ? URI.revive(placeholderViewContainer.iconUrl) : undefined;
|
|
438
|
-
if (URI.isUri(cachedViewContainer.icon) && this.environmentService.remoteAuthority) {
|
|
439
|
-
cachedViewContainer.icon = undefined;
|
|
440
|
-
}
|
|
441
|
-
cachedViewContainer.views = placeholderViewContainer.views;
|
|
442
|
-
cachedViewContainer.isBuiltin = placeholderViewContainer.isBuiltin;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
for (const viewContainerWorkspaceState of this.getViewContainersWorkspaceState()) {
|
|
446
|
-
const cachedViewContainer = this._cachedViewContainers.find(cached => cached.id === viewContainerWorkspaceState.id);
|
|
447
|
-
if (cachedViewContainer) {
|
|
448
|
-
cachedViewContainer.visible = viewContainerWorkspaceState.visible ?? cachedViewContainer.visible;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
return this._cachedViewContainers;
|
|
453
|
-
}
|
|
454
|
-
storeCachedViewContainersState(cachedViewContainers) {
|
|
455
|
-
const pinnedViewContainers = this.getPinnedViewContainers();
|
|
456
|
-
this.setPinnedViewContainers(( cachedViewContainers.map(({ id, pinned, order }) => ({
|
|
457
|
-
id,
|
|
458
|
-
pinned,
|
|
459
|
-
visible: pinnedViewContainers.find(({ id: pinnedId }) => pinnedId === id)?.visible,
|
|
460
|
-
order
|
|
461
|
-
}))));
|
|
462
|
-
this.setPlaceholderViewContainers(( cachedViewContainers.map(({ id, icon, name, views, isBuiltin }) => ({
|
|
463
|
-
id,
|
|
464
|
-
iconUrl: URI.isUri(icon) ? icon : undefined,
|
|
465
|
-
themeIcon: ThemeIcon.isThemeIcon(icon) ? icon : undefined,
|
|
466
|
-
name,
|
|
467
|
-
isBuiltin,
|
|
468
|
-
views
|
|
469
|
-
}))));
|
|
470
|
-
this.setViewContainersWorkspaceState(( cachedViewContainers.map(({ id, visible }) => ({
|
|
471
|
-
id,
|
|
472
|
-
visible,
|
|
473
|
-
}))));
|
|
474
|
-
}
|
|
475
|
-
getPinnedViewContainers() {
|
|
476
|
-
return JSON.parse(this.pinnedViewContainersValue);
|
|
477
|
-
}
|
|
478
|
-
setPinnedViewContainers(pinnedViewContainers) {
|
|
479
|
-
this.pinnedViewContainersValue = JSON.stringify(pinnedViewContainers);
|
|
480
|
-
}
|
|
481
|
-
get pinnedViewContainersValue() {
|
|
482
|
-
if (!this._pinnedViewContainersValue) {
|
|
483
|
-
this._pinnedViewContainersValue = this.getStoredPinnedViewContainersValue();
|
|
484
|
-
}
|
|
485
|
-
return this._pinnedViewContainersValue;
|
|
486
|
-
}
|
|
487
|
-
set pinnedViewContainersValue(pinnedViewContainersValue) {
|
|
488
|
-
if (this.pinnedViewContainersValue !== pinnedViewContainersValue) {
|
|
489
|
-
this._pinnedViewContainersValue = pinnedViewContainersValue;
|
|
490
|
-
this.setStoredPinnedViewContainersValue(pinnedViewContainersValue);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
getStoredPinnedViewContainersValue() {
|
|
494
|
-
return this.storageService.get(this.options.pinnedViewContainersKey, 0 , '[]');
|
|
495
|
-
}
|
|
496
|
-
setStoredPinnedViewContainersValue(value) {
|
|
497
|
-
this.storageService.store(this.options.pinnedViewContainersKey, value, 0 , 0 );
|
|
498
|
-
}
|
|
499
|
-
getPlaceholderViewContainers() {
|
|
500
|
-
return JSON.parse(this.placeholderViewContainersValue);
|
|
501
|
-
}
|
|
502
|
-
setPlaceholderViewContainers(placeholderViewContainers) {
|
|
503
|
-
this.placeholderViewContainersValue = JSON.stringify(placeholderViewContainers);
|
|
504
|
-
}
|
|
505
|
-
get placeholderViewContainersValue() {
|
|
506
|
-
if (!this._placeholderViewContainersValue) {
|
|
507
|
-
this._placeholderViewContainersValue = this.getStoredPlaceholderViewContainersValue();
|
|
508
|
-
}
|
|
509
|
-
return this._placeholderViewContainersValue;
|
|
510
|
-
}
|
|
511
|
-
set placeholderViewContainersValue(placeholderViewContainesValue) {
|
|
512
|
-
if (this.placeholderViewContainersValue !== placeholderViewContainesValue) {
|
|
513
|
-
this._placeholderViewContainersValue = placeholderViewContainesValue;
|
|
514
|
-
this.setStoredPlaceholderViewContainersValue(placeholderViewContainesValue);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
getStoredPlaceholderViewContainersValue() {
|
|
518
|
-
return this.storageService.get(this.options.placeholderViewContainersKey, 0 , '[]');
|
|
519
|
-
}
|
|
520
|
-
setStoredPlaceholderViewContainersValue(value) {
|
|
521
|
-
this.storageService.store(this.options.placeholderViewContainersKey, value, 0 , 1 );
|
|
522
|
-
}
|
|
523
|
-
getViewContainersWorkspaceState() {
|
|
524
|
-
return JSON.parse(this.viewContainersWorkspaceStateValue);
|
|
525
|
-
}
|
|
526
|
-
setViewContainersWorkspaceState(viewContainersWorkspaceState) {
|
|
527
|
-
this.viewContainersWorkspaceStateValue = JSON.stringify(viewContainersWorkspaceState);
|
|
528
|
-
}
|
|
529
|
-
get viewContainersWorkspaceStateValue() {
|
|
530
|
-
if (!this._viewContainersWorkspaceStateValue) {
|
|
531
|
-
this._viewContainersWorkspaceStateValue = this.getStoredViewContainersWorkspaceStateValue();
|
|
532
|
-
}
|
|
533
|
-
return this._viewContainersWorkspaceStateValue;
|
|
534
|
-
}
|
|
535
|
-
set viewContainersWorkspaceStateValue(viewContainersWorkspaceStateValue) {
|
|
536
|
-
if (this.viewContainersWorkspaceStateValue !== viewContainersWorkspaceStateValue) {
|
|
537
|
-
this._viewContainersWorkspaceStateValue = viewContainersWorkspaceStateValue;
|
|
538
|
-
this.setStoredViewContainersWorkspaceStateValue(viewContainersWorkspaceStateValue);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
getStoredViewContainersWorkspaceStateValue() {
|
|
542
|
-
return this.storageService.get(this.options.viewContainersWorkspaceStateKey, 1 , '[]');
|
|
543
|
-
}
|
|
544
|
-
setStoredViewContainersWorkspaceStateValue(value) {
|
|
545
|
-
this.storageService.store(this.options.viewContainersWorkspaceStateKey, value, 1 , 1 );
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
PaneCompositeBar = ( __decorate([
|
|
549
|
-
( __param(3, IInstantiationService)),
|
|
550
|
-
( __param(4, IStorageService)),
|
|
551
|
-
( __param(5, IExtensionService)),
|
|
552
|
-
( __param(6, IViewDescriptorService)),
|
|
553
|
-
( __param(7, IContextKeyService)),
|
|
554
|
-
( __param(8, IWorkbenchEnvironmentService)),
|
|
555
|
-
( __param(9, IWorkbenchLayoutService))
|
|
556
|
-
], PaneCompositeBar));
|
|
557
|
-
let ViewContainerActivityAction = class ViewContainerActivityAction extends CompositeBarAction {
|
|
558
|
-
static { ViewContainerActivityAction_1 = this; }
|
|
559
|
-
static { this.preventDoubleClickDelay = 300; }
|
|
560
|
-
constructor(compositeBarActionItem, part, paneCompositePart, layoutService, telemetryService, configurationService, activityService) {
|
|
561
|
-
super(compositeBarActionItem);
|
|
562
|
-
this.part = part;
|
|
563
|
-
this.paneCompositePart = paneCompositePart;
|
|
564
|
-
this.layoutService = layoutService;
|
|
565
|
-
this.telemetryService = telemetryService;
|
|
566
|
-
this.configurationService = configurationService;
|
|
567
|
-
this.activityService = activityService;
|
|
568
|
-
this.lastRun = 0;
|
|
569
|
-
this.updateActivity();
|
|
570
|
-
this._register(this.activityService.onDidChangeActivity(viewContainerOrAction => {
|
|
571
|
-
if (!isString(viewContainerOrAction) && viewContainerOrAction.id === this.compositeBarActionItem.id) {
|
|
572
|
-
this.updateActivity();
|
|
573
|
-
}
|
|
574
|
-
}));
|
|
575
|
-
}
|
|
576
|
-
updateCompositeBarActionItem(compositeBarActionItem) {
|
|
577
|
-
this.compositeBarActionItem = compositeBarActionItem;
|
|
578
|
-
}
|
|
579
|
-
updateActivity() {
|
|
580
|
-
const activities = this.activityService.getViewContainerActivities(this.compositeBarActionItem.id);
|
|
581
|
-
this.activity = activities[0];
|
|
582
|
-
}
|
|
583
|
-
async run(event) {
|
|
584
|
-
if (isMouseEvent(event) && event.button === 2) {
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
const now = Date.now();
|
|
588
|
-
if (now > this.lastRun && now - this.lastRun < ViewContainerActivityAction_1.preventDoubleClickDelay) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
this.lastRun = now;
|
|
592
|
-
const focus = (event && 'preserveFocus' in event) ? !event.preserveFocus : true;
|
|
593
|
-
if (this.part === "workbench.parts.activitybar" ) {
|
|
594
|
-
const sideBarVisible = this.layoutService.isVisible("workbench.parts.sidebar" );
|
|
595
|
-
const activeViewlet = this.paneCompositePart.getActivePaneComposite();
|
|
596
|
-
const focusBehavior = this.configurationService.getValue('workbench.activityBar.iconClickBehavior');
|
|
597
|
-
if (sideBarVisible && activeViewlet?.getId() === this.compositeBarActionItem.id) {
|
|
598
|
-
switch (focusBehavior) {
|
|
599
|
-
case 'focus':
|
|
600
|
-
this.logAction('refocus');
|
|
601
|
-
this.paneCompositePart.openPaneComposite(this.compositeBarActionItem.id, focus);
|
|
602
|
-
break;
|
|
603
|
-
case 'toggle':
|
|
604
|
-
default:
|
|
605
|
-
this.logAction('hide');
|
|
606
|
-
this.layoutService.setPartHidden(true, "workbench.parts.sidebar" );
|
|
607
|
-
break;
|
|
608
|
-
}
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
this.logAction('show');
|
|
612
|
-
}
|
|
613
|
-
await this.paneCompositePart.openPaneComposite(this.compositeBarActionItem.id, focus);
|
|
614
|
-
return this.activate();
|
|
615
|
-
}
|
|
616
|
-
logAction(action) {
|
|
617
|
-
this.telemetryService.publicLog2('activityBarAction', { viewletId: this.compositeBarActionItem.id, action });
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
ViewContainerActivityAction = ViewContainerActivityAction_1 = ( __decorate([
|
|
621
|
-
( __param(3, IWorkbenchLayoutService)),
|
|
622
|
-
( __param(4, ITelemetryService)),
|
|
623
|
-
( __param(5, IConfigurationService)),
|
|
624
|
-
( __param(6, IActivityService))
|
|
625
|
-
], ViewContainerActivityAction));
|
|
626
|
-
class PlaceHolderViewContainerActivityAction extends ViewContainerActivityAction {
|
|
627
|
-
}
|
|
628
|
-
class PlaceHolderToggleCompositePinnedAction extends ToggleCompositePinnedAction {
|
|
629
|
-
constructor(id, compositeBar) {
|
|
630
|
-
super({ id, name: id, classNames: undefined }, compositeBar);
|
|
631
|
-
}
|
|
632
|
-
setActivity(activity) {
|
|
633
|
-
this.label = activity.name;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
class PlaceHolderToggleCompositeBadgeAction extends ToggleCompositeBadgeAction {
|
|
637
|
-
constructor(id, compositeBar) {
|
|
638
|
-
super({ id, name: id, classNames: undefined }, compositeBar);
|
|
639
|
-
}
|
|
640
|
-
setCompositeBarActionItem(actionItem) {
|
|
641
|
-
this.label = actionItem.name;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
export { PaneCompositeBar };
|