@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,235 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Dimension, EventType, addDisposableListener, findParentWithClass } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { MutableDisposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
8
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
10
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
12
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
13
|
-
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
14
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
15
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
16
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
17
|
-
import { ViewPane, ViewPaneShowActions } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
18
|
-
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
19
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
20
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
21
|
-
import { ExtensionKeyedWebviewOriginStore, IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
|
|
22
|
-
import { WebviewWindowDragMonitor } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor';
|
|
23
|
-
import { IWebviewViewService } from 'vscode/vscode/vs/workbench/contrib/webviewView/browser/webviewViewService';
|
|
24
|
-
import { NumberBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
|
|
25
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
26
|
-
|
|
27
|
-
var WebviewViewPane_1;
|
|
28
|
-
const storageKeys = {
|
|
29
|
-
webviewState: 'webviewState',
|
|
30
|
-
};
|
|
31
|
-
let WebviewViewPane = class WebviewViewPane extends ViewPane {
|
|
32
|
-
static { WebviewViewPane_1 = this; }
|
|
33
|
-
static getOriginStore(storageService) {
|
|
34
|
-
this._originStore ??= ( new ExtensionKeyedWebviewOriginStore('webviewViews.origins', storageService));
|
|
35
|
-
return this._originStore;
|
|
36
|
-
}
|
|
37
|
-
constructor(options, configurationService, contextKeyService, contextMenuService, instantiationService, keybindingService, openerService, telemetryService, themeService, viewDescriptorService, activityService, extensionService, progressService, storageService, viewService, webviewService, webviewViewService) {
|
|
38
|
-
super({ ...options, titleMenuId: MenuId.ViewTitle, showActions: ViewPaneShowActions.WhenExpanded }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
39
|
-
this.activityService = activityService;
|
|
40
|
-
this.extensionService = extensionService;
|
|
41
|
-
this.progressService = progressService;
|
|
42
|
-
this.storageService = storageService;
|
|
43
|
-
this.viewService = viewService;
|
|
44
|
-
this.webviewService = webviewService;
|
|
45
|
-
this.webviewViewService = webviewViewService;
|
|
46
|
-
this._webview = this._register(( new MutableDisposable()));
|
|
47
|
-
this._webviewDisposables = this._register(( new DisposableStore()));
|
|
48
|
-
this._activated = false;
|
|
49
|
-
this._onDidChangeVisibility = this._register(( new Emitter()));
|
|
50
|
-
this.onDidChangeVisibility = this._onDidChangeVisibility.event;
|
|
51
|
-
this._onDispose = this._register(( new Emitter()));
|
|
52
|
-
this.onDispose = this._onDispose.event;
|
|
53
|
-
this.extensionId = options.fromExtensionId;
|
|
54
|
-
this.defaultTitle = this.title;
|
|
55
|
-
this.memento = ( new Memento(`webviewView.${this.id}`, storageService));
|
|
56
|
-
this.viewState = this.memento.getMemento(1 , 1 );
|
|
57
|
-
this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()));
|
|
58
|
-
this._register(this.webviewViewService.onNewResolverRegistered(e => {
|
|
59
|
-
if (e.viewType === this.id) {
|
|
60
|
-
this.updateTreeVisibility();
|
|
61
|
-
}
|
|
62
|
-
}));
|
|
63
|
-
this.updateTreeVisibility();
|
|
64
|
-
}
|
|
65
|
-
dispose() {
|
|
66
|
-
this._onDispose.fire();
|
|
67
|
-
clearTimeout(this._repositionTimeout);
|
|
68
|
-
super.dispose();
|
|
69
|
-
}
|
|
70
|
-
focus() {
|
|
71
|
-
super.focus();
|
|
72
|
-
this._webview.value?.focus();
|
|
73
|
-
}
|
|
74
|
-
renderBody(container) {
|
|
75
|
-
super.renderBody(container);
|
|
76
|
-
this._container = container;
|
|
77
|
-
this._rootContainer = undefined;
|
|
78
|
-
if (!this._resizeObserver) {
|
|
79
|
-
this._resizeObserver = ( new ResizeObserver(() => {
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
this.layoutWebview();
|
|
82
|
-
}, 0);
|
|
83
|
-
}));
|
|
84
|
-
this._register(toDisposable(() => {
|
|
85
|
-
this._resizeObserver.disconnect();
|
|
86
|
-
}));
|
|
87
|
-
this._resizeObserver.observe(container);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
saveState() {
|
|
91
|
-
if (this._webview.value) {
|
|
92
|
-
this.viewState[storageKeys.webviewState] = this._webview.value.state;
|
|
93
|
-
}
|
|
94
|
-
this.memento.saveMemento();
|
|
95
|
-
super.saveState();
|
|
96
|
-
}
|
|
97
|
-
layoutBody(height, width) {
|
|
98
|
-
super.layoutBody(height, width);
|
|
99
|
-
this.layoutWebview(( new Dimension(width, height)));
|
|
100
|
-
}
|
|
101
|
-
updateTreeVisibility() {
|
|
102
|
-
if (this.isBodyVisible()) {
|
|
103
|
-
this.activate();
|
|
104
|
-
this._webview.value?.claim(this, undefined);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this._webview.value?.release(this);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
activate() {
|
|
111
|
-
if (this._activated) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
this._activated = true;
|
|
115
|
-
const origin = this.extensionId ? WebviewViewPane_1.getOriginStore(this.storageService).getOrigin(this.id, this.extensionId) : undefined;
|
|
116
|
-
const webview = this.webviewService.createWebviewOverlay({
|
|
117
|
-
origin,
|
|
118
|
-
providedViewType: this.id,
|
|
119
|
-
title: this.title,
|
|
120
|
-
options: { purpose: "webviewView" },
|
|
121
|
-
contentOptions: {},
|
|
122
|
-
extension: this.extensionId ? { id: this.extensionId } : undefined
|
|
123
|
-
});
|
|
124
|
-
webview.state = this.viewState[storageKeys.webviewState];
|
|
125
|
-
this._webview.value = webview;
|
|
126
|
-
if (this._container) {
|
|
127
|
-
this.layoutWebview();
|
|
128
|
-
}
|
|
129
|
-
this._webviewDisposables.add(toDisposable(() => {
|
|
130
|
-
this._webview.value?.release(this);
|
|
131
|
-
}));
|
|
132
|
-
this._webviewDisposables.add(webview.onDidUpdateState(() => {
|
|
133
|
-
this.viewState[storageKeys.webviewState] = webview.state;
|
|
134
|
-
}));
|
|
135
|
-
for (const event of [EventType.DRAG, EventType.DRAG_END, EventType.DRAG_ENTER, EventType.DRAG_LEAVE, EventType.DRAG_START]) {
|
|
136
|
-
this._webviewDisposables.add(addDisposableListener(this._webview.value.container, event, e => {
|
|
137
|
-
e.preventDefault();
|
|
138
|
-
e.stopImmediatePropagation();
|
|
139
|
-
this.dropTargetElement.dispatchEvent(( new DragEvent(e.type, e)));
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
this._webviewDisposables.add(( new WebviewWindowDragMonitor(() => this._webview.value)));
|
|
143
|
-
const source = this._webviewDisposables.add(( new CancellationTokenSource()));
|
|
144
|
-
this.withProgress(async () => {
|
|
145
|
-
await this.extensionService.activateByEvent(`onView:${this.id}`);
|
|
146
|
-
const self = this;
|
|
147
|
-
const webviewView = {
|
|
148
|
-
webview,
|
|
149
|
-
onDidChangeVisibility: this.onDidChangeBodyVisibility,
|
|
150
|
-
onDispose: this.onDispose,
|
|
151
|
-
get title() { return self.setTitle; },
|
|
152
|
-
set title(value) { self.updateTitle(value); },
|
|
153
|
-
get description() { return self.titleDescription; },
|
|
154
|
-
set description(value) { self.updateTitleDescription(value); },
|
|
155
|
-
get badge() { return self.badge; },
|
|
156
|
-
set badge(badge) { self.updateBadge(badge); },
|
|
157
|
-
dispose: () => {
|
|
158
|
-
this._activated = false;
|
|
159
|
-
this._webview.clear();
|
|
160
|
-
this._webviewDisposables.clear();
|
|
161
|
-
},
|
|
162
|
-
show: (preserveFocus) => {
|
|
163
|
-
this.viewService.openView(this.id, !preserveFocus);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
await this.webviewViewService.resolve(this.id, webviewView, source.token);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
updateTitle(value) {
|
|
170
|
-
this.setTitle = value;
|
|
171
|
-
super.updateTitle(typeof value === 'string' ? value : this.defaultTitle);
|
|
172
|
-
}
|
|
173
|
-
updateBadge(badge) {
|
|
174
|
-
if (this.badge?.value === badge?.value &&
|
|
175
|
-
this.badge?.tooltip === badge?.tooltip) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (this.activity) {
|
|
179
|
-
this.activity.dispose();
|
|
180
|
-
this.activity = undefined;
|
|
181
|
-
}
|
|
182
|
-
this.badge = badge;
|
|
183
|
-
if (badge) {
|
|
184
|
-
const activity = {
|
|
185
|
-
badge: ( new NumberBadge(badge.value, () => badge.tooltip)),
|
|
186
|
-
priority: 150
|
|
187
|
-
};
|
|
188
|
-
this.activityService.showViewActivity(this.id, activity);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
async withProgress(task) {
|
|
192
|
-
return this.progressService.withProgress({ location: this.id, delay: 500 }, task);
|
|
193
|
-
}
|
|
194
|
-
onDidScrollRoot() {
|
|
195
|
-
this.layoutWebview();
|
|
196
|
-
}
|
|
197
|
-
doLayoutWebview(dimension) {
|
|
198
|
-
const webviewEntry = this._webview.value;
|
|
199
|
-
if (!this._container || !webviewEntry) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (!this._rootContainer || !this._rootContainer.isConnected) {
|
|
203
|
-
this._rootContainer = this.findRootContainer(this._container);
|
|
204
|
-
}
|
|
205
|
-
webviewEntry.layoutWebviewOverElement(this._container, dimension, this._rootContainer);
|
|
206
|
-
}
|
|
207
|
-
layoutWebview(dimension) {
|
|
208
|
-
this.doLayoutWebview(dimension);
|
|
209
|
-
clearTimeout(this._repositionTimeout);
|
|
210
|
-
this._repositionTimeout = setTimeout(() => this.doLayoutWebview(dimension), 200);
|
|
211
|
-
}
|
|
212
|
-
findRootContainer(container) {
|
|
213
|
-
return findParentWithClass(container, 'monaco-scrollable-element') ?? undefined;
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
WebviewViewPane = WebviewViewPane_1 = ( __decorate([
|
|
217
|
-
( __param(1, IConfigurationService)),
|
|
218
|
-
( __param(2, IContextKeyService)),
|
|
219
|
-
( __param(3, IContextMenuService)),
|
|
220
|
-
( __param(4, IInstantiationService)),
|
|
221
|
-
( __param(5, IKeybindingService)),
|
|
222
|
-
( __param(6, IOpenerService)),
|
|
223
|
-
( __param(7, ITelemetryService)),
|
|
224
|
-
( __param(8, IThemeService)),
|
|
225
|
-
( __param(9, IViewDescriptorService)),
|
|
226
|
-
( __param(10, IActivityService)),
|
|
227
|
-
( __param(11, IExtensionService)),
|
|
228
|
-
( __param(12, IProgressService)),
|
|
229
|
-
( __param(13, IStorageService)),
|
|
230
|
-
( __param(14, IViewsService)),
|
|
231
|
-
( __param(15, IWebviewService)),
|
|
232
|
-
( __param(16, IWebviewViewService))
|
|
233
|
-
], WebviewViewPane));
|
|
234
|
-
|
|
235
|
-
export { WebviewViewPane };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
|
|
3
|
-
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
5
|
-
import { ACCOUNTS_ACTIVITY_ID, GLOBAL_ACTIVITY_ID } from 'vscode/vscode/vs/workbench/common/activity';
|
|
6
|
-
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
7
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
-
import { isUndefined } from 'vscode/vscode/vs/base/common/types';
|
|
9
|
-
|
|
10
|
-
let ViewContainerActivityByView = class ViewContainerActivityByView extends Disposable {
|
|
11
|
-
constructor(viewId, viewDescriptorService, activityService) {
|
|
12
|
-
super();
|
|
13
|
-
this.viewId = viewId;
|
|
14
|
-
this.viewDescriptorService = viewDescriptorService;
|
|
15
|
-
this.activityService = activityService;
|
|
16
|
-
this.activity = undefined;
|
|
17
|
-
this.activityDisposable = Disposable.None;
|
|
18
|
-
this._register(Event.filter(this.viewDescriptorService.onDidChangeContainer, e => ( e.views.some(view => view.id === viewId)))(() => this.update()));
|
|
19
|
-
this._register(Event.filter(this.viewDescriptorService.onDidChangeLocation, e => ( e.views.some(view => view.id === viewId)))(() => this.update()));
|
|
20
|
-
}
|
|
21
|
-
setActivity(activity) {
|
|
22
|
-
this.activity = activity;
|
|
23
|
-
this.update();
|
|
24
|
-
}
|
|
25
|
-
clearActivity() {
|
|
26
|
-
this.activity = undefined;
|
|
27
|
-
this.update();
|
|
28
|
-
}
|
|
29
|
-
update() {
|
|
30
|
-
this.activityDisposable.dispose();
|
|
31
|
-
const container = this.viewDescriptorService.getViewContainerByViewId(this.viewId);
|
|
32
|
-
if (container && this.activity) {
|
|
33
|
-
this.activityDisposable = this.activityService.showViewContainerActivity(container.id, this.activity);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
dispose() {
|
|
37
|
-
this.activityDisposable.dispose();
|
|
38
|
-
super.dispose();
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
ViewContainerActivityByView = ( __decorate([
|
|
42
|
-
( __param(1, IViewDescriptorService)),
|
|
43
|
-
( __param(2, IActivityService))
|
|
44
|
-
], ViewContainerActivityByView));
|
|
45
|
-
let ActivityService = class ActivityService extends Disposable {
|
|
46
|
-
constructor(viewDescriptorService, instantiationService) {
|
|
47
|
-
super();
|
|
48
|
-
this.viewDescriptorService = viewDescriptorService;
|
|
49
|
-
this.instantiationService = instantiationService;
|
|
50
|
-
this.viewActivities = ( new Map());
|
|
51
|
-
this._onDidChangeActivity = this._register(( new Emitter()));
|
|
52
|
-
this.onDidChangeActivity = this._onDidChangeActivity.event;
|
|
53
|
-
this.viewContainerActivities = ( new Map());
|
|
54
|
-
this.globalActivities = ( new Map());
|
|
55
|
-
}
|
|
56
|
-
showViewContainerActivity(viewContainerId, activity) {
|
|
57
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(viewContainerId);
|
|
58
|
-
if (viewContainer) {
|
|
59
|
-
let activities = this.viewContainerActivities.get(viewContainerId);
|
|
60
|
-
if (!activities) {
|
|
61
|
-
activities = [];
|
|
62
|
-
this.viewContainerActivities.set(viewContainerId, activities);
|
|
63
|
-
}
|
|
64
|
-
for (let i = 0; i <= activities.length; i++) {
|
|
65
|
-
if (i === activities.length || isUndefined(activity.priority)) {
|
|
66
|
-
activities.push(activity);
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
else if (isUndefined(activities[i].priority) || activities[i].priority <= activity.priority) {
|
|
70
|
-
activities.splice(i, 0, activity);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
this._onDidChangeActivity.fire(viewContainer);
|
|
75
|
-
return toDisposable(() => {
|
|
76
|
-
activities.splice(activities.indexOf(activity), 1);
|
|
77
|
-
if (activities.length === 0) {
|
|
78
|
-
this.viewContainerActivities.delete(viewContainerId);
|
|
79
|
-
}
|
|
80
|
-
this._onDidChangeActivity.fire(viewContainer);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
return Disposable.None;
|
|
84
|
-
}
|
|
85
|
-
getViewContainerActivities(viewContainerId) {
|
|
86
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(viewContainerId);
|
|
87
|
-
if (viewContainer) {
|
|
88
|
-
return this.viewContainerActivities.get(viewContainerId) ?? [];
|
|
89
|
-
}
|
|
90
|
-
return [];
|
|
91
|
-
}
|
|
92
|
-
showViewActivity(viewId, activity) {
|
|
93
|
-
let maybeItem = this.viewActivities.get(viewId);
|
|
94
|
-
if (maybeItem) {
|
|
95
|
-
maybeItem.id++;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
maybeItem = {
|
|
99
|
-
id: 1,
|
|
100
|
-
activity: this.instantiationService.createInstance(ViewContainerActivityByView, viewId)
|
|
101
|
-
};
|
|
102
|
-
this.viewActivities.set(viewId, maybeItem);
|
|
103
|
-
}
|
|
104
|
-
const id = maybeItem.id;
|
|
105
|
-
maybeItem.activity.setActivity(activity);
|
|
106
|
-
const item = maybeItem;
|
|
107
|
-
return toDisposable(() => {
|
|
108
|
-
if (item.id === id) {
|
|
109
|
-
item.activity.dispose();
|
|
110
|
-
this.viewActivities.delete(viewId);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
showAccountsActivity(activity) {
|
|
115
|
-
return this.showActivity(ACCOUNTS_ACTIVITY_ID, activity);
|
|
116
|
-
}
|
|
117
|
-
showGlobalActivity(activity) {
|
|
118
|
-
return this.showActivity(GLOBAL_ACTIVITY_ID, activity);
|
|
119
|
-
}
|
|
120
|
-
getActivity(id) {
|
|
121
|
-
return this.globalActivities.get(id) ?? [];
|
|
122
|
-
}
|
|
123
|
-
showActivity(id, activity) {
|
|
124
|
-
let activities = this.globalActivities.get(id);
|
|
125
|
-
if (!activities) {
|
|
126
|
-
activities = [];
|
|
127
|
-
this.globalActivities.set(id, activities);
|
|
128
|
-
}
|
|
129
|
-
activities.push(activity);
|
|
130
|
-
this._onDidChangeActivity.fire(id);
|
|
131
|
-
return toDisposable(() => {
|
|
132
|
-
activities.splice(activities.indexOf(activity), 1);
|
|
133
|
-
if (activities.length === 0) {
|
|
134
|
-
this.globalActivities.delete(id);
|
|
135
|
-
}
|
|
136
|
-
this._onDidChangeActivity.fire(id);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
ActivityService = ( __decorate([
|
|
141
|
-
( __param(0, IViewDescriptorService)),
|
|
142
|
-
( __param(1, IInstantiationService))
|
|
143
|
-
], ActivityService));
|
|
144
|
-
|
|
145
|
-
export { ActivityService };
|