@codingame/monaco-vscode-extension-gallery-service-override 32.0.0 → 32.0.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.js +4 -4
- package/package.json +2 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionTipsService.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/browserRuntimeExtensionsEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/browserRuntimeExtensionsEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/common/reportExtensionIssueAction.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.js +14 -14
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.js +4 -4
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +46 -46
- package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.d.ts +0 -14
- package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.js +0 -145
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.d.ts +0 -19
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.js +0 -25
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.d.ts +0 -76
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +0 -470
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +0 -83
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +0 -66
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.d.ts +0 -83
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +0 -1353
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +0 -49
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +0 -728
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +0 -522
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.js +0 -18
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.d.ts +0 -71
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.js +0 -263
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +0 -2227
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +0 -40
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +0 -77
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +0 -93
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +0 -100
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.d.ts +0 -151
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +0 -1031
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.d.ts +0 -235
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +0 -1600
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.d.ts +0 -314
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +0 -3449
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +0 -368
- package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.js +0 -30
- package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.js +0 -30
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css +0 -910
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionManagement.css +0 -12
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css +0 -229
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading-dark.svg +0 -31
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading-hc.svg +0 -31
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading.svg +0 -31
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css +0 -86
- package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.js +0 -38
- package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.js +0 -41
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +0 -38
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +0 -179
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.js +0 -90
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +0 -50
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +0 -47
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +0 -35
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +0 -876
|
@@ -1,728 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { $, append, addDisposableListener, EventType, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
-
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
7
|
-
import { SplitView, Sizing } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/splitview/splitview';
|
|
8
|
-
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
9
|
-
import { IExtensionFeaturesManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures.service';
|
|
10
|
-
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
11
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
|
-
import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
14
|
-
import { getExtensionId } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
15
|
-
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
16
|
-
import { defaultButtonStyles, defaultKeybindingLabelStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
17
|
-
import { getErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
18
|
-
import { PANEL_SECTION_BORDER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
19
|
-
import { Themable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
20
|
-
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
21
|
-
import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
22
|
-
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
23
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
24
|
-
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
25
|
-
import { errorIcon, warningIcon, infoIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons';
|
|
26
|
-
import { SeverityIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/severityIcon/severityIcon';
|
|
27
|
-
import { KeybindingLabel } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/keybindingLabel/keybindingLabel';
|
|
28
|
-
import { OS } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
29
|
-
import { MarkdownString, isMarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
30
|
-
import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
|
|
31
|
-
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
32
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
33
|
-
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
34
|
-
import { ResolvedKeybinding } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindings';
|
|
35
|
-
import { asCssVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
36
|
-
import { foreground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
|
|
37
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
38
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
|
|
39
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
|
|
40
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
|
|
41
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
|
|
42
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
43
|
-
import { chartAxis, chartGuide, chartLine } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
44
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
45
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
46
|
-
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
47
|
-
import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
|
|
48
|
-
import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
|
|
49
|
-
|
|
50
|
-
let RuntimeStatusMarkdownRenderer = class RuntimeStatusMarkdownRenderer extends Disposable {
|
|
51
|
-
static {
|
|
52
|
-
this.ID = "runtimeStatus";
|
|
53
|
-
}
|
|
54
|
-
constructor(
|
|
55
|
-
extensionService,
|
|
56
|
-
hoverService,
|
|
57
|
-
extensionFeaturesManagementService,
|
|
58
|
-
markdownRendererService
|
|
59
|
-
) {
|
|
60
|
-
super();
|
|
61
|
-
this.extensionService = extensionService;
|
|
62
|
-
this.hoverService = hoverService;
|
|
63
|
-
this.extensionFeaturesManagementService = extensionFeaturesManagementService;
|
|
64
|
-
this.markdownRendererService = markdownRendererService;
|
|
65
|
-
this.type = "element";
|
|
66
|
-
}
|
|
67
|
-
shouldRender(manifest) {
|
|
68
|
-
const extensionId = ( new ExtensionIdentifier(getExtensionId(manifest.publisher, manifest.name)));
|
|
69
|
-
if (!( this.extensionService.extensions.some(e => ExtensionIdentifier.equals(e.identifier, extensionId)))) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
return !!manifest.main || !!manifest.browser;
|
|
73
|
-
}
|
|
74
|
-
render(manifest) {
|
|
75
|
-
const disposables = ( new DisposableStore());
|
|
76
|
-
const extensionId = ( new ExtensionIdentifier(getExtensionId(manifest.publisher, manifest.name)));
|
|
77
|
-
const emitter = disposables.add(( new Emitter()));
|
|
78
|
-
disposables.add(this.extensionService.onDidChangeExtensionsStatus(e => {
|
|
79
|
-
if (( e.some(extension => ExtensionIdentifier.equals(extension, extensionId)))) {
|
|
80
|
-
emitter.fire(this.createElement(manifest, disposables));
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
disposables.add(
|
|
84
|
-
this.extensionFeaturesManagementService.onDidChangeAccessData(e => emitter.fire(this.createElement(manifest, disposables)))
|
|
85
|
-
);
|
|
86
|
-
return {
|
|
87
|
-
onDidChange: emitter.event,
|
|
88
|
-
data: this.createElement(manifest, disposables),
|
|
89
|
-
dispose: () => disposables.dispose()
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
createElement(manifest, disposables) {
|
|
93
|
-
const container = $(".runtime-status");
|
|
94
|
-
const extensionId = ( new ExtensionIdentifier(getExtensionId(manifest.publisher, manifest.name)));
|
|
95
|
-
const status = this.extensionService.getExtensionsStatus()[extensionId.value];
|
|
96
|
-
if (( this.extensionService.extensions.some(extension => ExtensionIdentifier.equals(extension.identifier, extensionId)))) {
|
|
97
|
-
const data = ( new MarkdownString());
|
|
98
|
-
data.appendMarkdown(`### ${( localize(9407, "Activation"))}\n\n`);
|
|
99
|
-
if (status.activationTimes) {
|
|
100
|
-
if (status.activationTimes.activationReason.startup) {
|
|
101
|
-
data.appendMarkdown(`Activated on Startup: \`${status.activationTimes.activateCallTime}ms\``);
|
|
102
|
-
} else {
|
|
103
|
-
data.appendMarkdown(
|
|
104
|
-
`Activated by \`${status.activationTimes.activationReason.activationEvent}\` event: \`${status.activationTimes.activateCallTime}ms\``
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
data.appendMarkdown("Not yet activated");
|
|
109
|
-
}
|
|
110
|
-
this.renderMarkdown(data, container, disposables);
|
|
111
|
-
}
|
|
112
|
-
const features = ( Registry.as(Extensions.ExtensionFeaturesRegistry)).getExtensionFeatures();
|
|
113
|
-
for (const feature of features) {
|
|
114
|
-
const accessData = this.extensionFeaturesManagementService.getAccessData(extensionId, feature.id);
|
|
115
|
-
if (accessData) {
|
|
116
|
-
this.renderMarkdown(( new MarkdownString(`\n ### ${( localize(9408, "{0} Usage", feature.label))}\n\n`)), container, disposables);
|
|
117
|
-
if (accessData.accessTimes.length) {
|
|
118
|
-
const description = append(container, $(".feature-chart-description", undefined, ( localize(
|
|
119
|
-
9409,
|
|
120
|
-
"There were {0} {1} requests from this extension in the last 30 days.",
|
|
121
|
-
accessData?.accessTimes.length,
|
|
122
|
-
feature.accessDataLabel ?? feature.label
|
|
123
|
-
))));
|
|
124
|
-
description.style.marginBottom = "8px";
|
|
125
|
-
this.renderRequestsChart(container, accessData.accessTimes, disposables);
|
|
126
|
-
}
|
|
127
|
-
const status = accessData?.current?.status;
|
|
128
|
-
if (status) {
|
|
129
|
-
const data = ( new MarkdownString());
|
|
130
|
-
if (status?.severity === Severity.Error) {
|
|
131
|
-
data.appendMarkdown(`$(${errorIcon.id}) ${status.message}\n\n`);
|
|
132
|
-
}
|
|
133
|
-
if (status?.severity === Severity.Warning) {
|
|
134
|
-
data.appendMarkdown(`$(${warningIcon.id}) ${status.message}\n\n`);
|
|
135
|
-
}
|
|
136
|
-
if (data.value) {
|
|
137
|
-
this.renderMarkdown(data, container, disposables);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (status.runtimeErrors.length || status.messages.length) {
|
|
143
|
-
const data = ( new MarkdownString());
|
|
144
|
-
if (status.runtimeErrors.length) {
|
|
145
|
-
data.appendMarkdown(`\n ### ${( localize(9410, "Uncaught Errors ({0})", status.runtimeErrors.length))}\n`);
|
|
146
|
-
for (const error of status.runtimeErrors) {
|
|
147
|
-
data.appendMarkdown(`$(${Codicon.error.id}) ${getErrorMessage(error)}\n\n`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (status.messages.length) {
|
|
151
|
-
data.appendMarkdown(`\n ### ${( localize(9411, "Messages ({0})", status.messages.length))}\n`);
|
|
152
|
-
for (const message of status.messages) {
|
|
153
|
-
data.appendMarkdown(
|
|
154
|
-
`$(${(message.type === Severity.Error ? Codicon.error : message.type === Severity.Warning ? Codicon.warning : Codicon.info).id}) ${message.message}\n\n`
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
if (data.value) {
|
|
159
|
-
this.renderMarkdown(data, container, disposables);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return container;
|
|
163
|
-
}
|
|
164
|
-
renderMarkdown(markdown, container, disposables) {
|
|
165
|
-
const {
|
|
166
|
-
element
|
|
167
|
-
} = disposables.add(this.markdownRendererService.render({
|
|
168
|
-
value: markdown.value,
|
|
169
|
-
isTrusted: markdown.isTrusted,
|
|
170
|
-
supportThemeIcons: true
|
|
171
|
-
}));
|
|
172
|
-
append(container, element);
|
|
173
|
-
}
|
|
174
|
-
renderRequestsChart(container, accessTimes, disposables) {
|
|
175
|
-
const width = 450;
|
|
176
|
-
const height = 250;
|
|
177
|
-
const margin = {
|
|
178
|
-
top: 0,
|
|
179
|
-
right: 4,
|
|
180
|
-
bottom: 20,
|
|
181
|
-
left: 4
|
|
182
|
-
};
|
|
183
|
-
const innerWidth = width - margin.left - margin.right;
|
|
184
|
-
const innerHeight = height - margin.top - margin.bottom;
|
|
185
|
-
const chartContainer = append(container, $(".feature-chart-container"));
|
|
186
|
-
chartContainer.style.position = "relative";
|
|
187
|
-
const tooltip = append(chartContainer, $(".feature-chart-tooltip"));
|
|
188
|
-
tooltip.style.position = "absolute";
|
|
189
|
-
tooltip.style.width = "0px";
|
|
190
|
-
tooltip.style.height = "0px";
|
|
191
|
-
let maxCount = 100;
|
|
192
|
-
const map = ( new Map());
|
|
193
|
-
for (const accessTime of accessTimes) {
|
|
194
|
-
const day = `${accessTime.getDate()} ${accessTime.toLocaleString("default", {
|
|
195
|
-
month: "short"
|
|
196
|
-
})}`;
|
|
197
|
-
map.set(day, (map.get(day) ?? 0) + 1);
|
|
198
|
-
maxCount = Math.max(maxCount, map.get(day));
|
|
199
|
-
}
|
|
200
|
-
const now = ( new Date());
|
|
201
|
-
const points = [];
|
|
202
|
-
for (let i = 0; i <= 30; i++) {
|
|
203
|
-
const date = ( new Date(now));
|
|
204
|
-
date.setDate(now.getDate() - (30 - i));
|
|
205
|
-
const dateString = `${date.getDate()} ${date.toLocaleString("default", {
|
|
206
|
-
month: "short"
|
|
207
|
-
})}`;
|
|
208
|
-
const count = map.get(dateString) ?? 0;
|
|
209
|
-
const x = (i / 30) * innerWidth;
|
|
210
|
-
const y = innerHeight - (count / maxCount) * innerHeight;
|
|
211
|
-
points.push({
|
|
212
|
-
x,
|
|
213
|
-
y,
|
|
214
|
-
date: dateString,
|
|
215
|
-
count
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const chart = append(chartContainer, $(".feature-chart"));
|
|
219
|
-
const svg = append(chart, $.SVG("svg"));
|
|
220
|
-
svg.setAttribute("width", `${width}px`);
|
|
221
|
-
svg.setAttribute("height", `${height}px`);
|
|
222
|
-
svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
223
|
-
const g = $.SVG("g");
|
|
224
|
-
g.setAttribute("transform", `translate(${margin.left},${margin.top})`);
|
|
225
|
-
svg.appendChild(g);
|
|
226
|
-
const xAxisLine = $.SVG("line");
|
|
227
|
-
xAxisLine.setAttribute("x1", "0");
|
|
228
|
-
xAxisLine.setAttribute("y1", `${innerHeight}`);
|
|
229
|
-
xAxisLine.setAttribute("x2", `${innerWidth}`);
|
|
230
|
-
xAxisLine.setAttribute("y2", `${innerHeight}`);
|
|
231
|
-
xAxisLine.setAttribute("stroke", asCssVariable(chartAxis));
|
|
232
|
-
xAxisLine.setAttribute("stroke-width", "1px");
|
|
233
|
-
g.appendChild(xAxisLine);
|
|
234
|
-
for (let i = 1; i <= 30; i += 7) {
|
|
235
|
-
const date = ( new Date(now));
|
|
236
|
-
date.setDate(now.getDate() - (30 - i));
|
|
237
|
-
const dateString = `${date.getDate()} ${date.toLocaleString("default", {
|
|
238
|
-
month: "short"
|
|
239
|
-
})}`;
|
|
240
|
-
const x = (i / 30) * innerWidth;
|
|
241
|
-
const tick = $.SVG("line");
|
|
242
|
-
tick.setAttribute("x1", `${x}`);
|
|
243
|
-
tick.setAttribute("y1", `${innerHeight}`);
|
|
244
|
-
tick.setAttribute("x2", `${x}`);
|
|
245
|
-
tick.setAttribute("y2", `${innerHeight + 10}`);
|
|
246
|
-
tick.setAttribute("stroke", asCssVariable(chartAxis));
|
|
247
|
-
tick.setAttribute("stroke-width", "1px");
|
|
248
|
-
g.appendChild(tick);
|
|
249
|
-
const ruler = $.SVG("line");
|
|
250
|
-
ruler.setAttribute("x1", `${x}`);
|
|
251
|
-
ruler.setAttribute("y1", `0`);
|
|
252
|
-
ruler.setAttribute("x2", `${x}`);
|
|
253
|
-
ruler.setAttribute("y2", `${innerHeight}`);
|
|
254
|
-
ruler.setAttribute("stroke", asCssVariable(chartGuide));
|
|
255
|
-
ruler.setAttribute("stroke-width", "1px");
|
|
256
|
-
g.appendChild(ruler);
|
|
257
|
-
const xAxisDate = $.SVG("text");
|
|
258
|
-
xAxisDate.setAttribute("x", `${x}`);
|
|
259
|
-
xAxisDate.setAttribute("y", `${height}`);
|
|
260
|
-
xAxisDate.setAttribute("text-anchor", "middle");
|
|
261
|
-
xAxisDate.setAttribute("fill", asCssVariable(foreground));
|
|
262
|
-
xAxisDate.setAttribute("font-size", "10px");
|
|
263
|
-
xAxisDate.textContent = dateString;
|
|
264
|
-
g.appendChild(xAxisDate);
|
|
265
|
-
}
|
|
266
|
-
const line = $.SVG("polyline");
|
|
267
|
-
line.setAttribute("fill", "none");
|
|
268
|
-
line.setAttribute("stroke", asCssVariable(chartLine));
|
|
269
|
-
line.setAttribute("stroke-width", `2px`);
|
|
270
|
-
line.setAttribute("points", ( points.map(p => `${p.x},${p.y}`)).join(" "));
|
|
271
|
-
g.appendChild(line);
|
|
272
|
-
const highlightCircle = $.SVG("circle");
|
|
273
|
-
highlightCircle.setAttribute("r", `4px`);
|
|
274
|
-
highlightCircle.style.display = "none";
|
|
275
|
-
g.appendChild(highlightCircle);
|
|
276
|
-
const hoverDisposable = disposables.add(( new MutableDisposable()));
|
|
277
|
-
const mouseMoveListener = event => {
|
|
278
|
-
const rect = svg.getBoundingClientRect();
|
|
279
|
-
const mouseX = event.clientX - rect.left - margin.left;
|
|
280
|
-
let closestPoint;
|
|
281
|
-
let minDistance = Infinity;
|
|
282
|
-
points.forEach(point => {
|
|
283
|
-
const distance = Math.abs(point.x - mouseX);
|
|
284
|
-
if (distance < minDistance) {
|
|
285
|
-
minDistance = distance;
|
|
286
|
-
closestPoint = point;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
if (closestPoint) {
|
|
290
|
-
highlightCircle.setAttribute("cx", `${closestPoint.x}`);
|
|
291
|
-
highlightCircle.setAttribute("cy", `${closestPoint.y}`);
|
|
292
|
-
highlightCircle.style.display = "block";
|
|
293
|
-
tooltip.style.left = `${closestPoint.x + 24}px`;
|
|
294
|
-
tooltip.style.top = `${closestPoint.y + 14}px`;
|
|
295
|
-
hoverDisposable.value = this.hoverService.showInstantHover({
|
|
296
|
-
content: ( new MarkdownString(`${closestPoint.date}: ${closestPoint.count} requests`)),
|
|
297
|
-
target: tooltip,
|
|
298
|
-
appearance: {
|
|
299
|
-
showPointer: true,
|
|
300
|
-
skipFadeInAnimation: true
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
} else {
|
|
304
|
-
hoverDisposable.value = undefined;
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
disposables.add(addDisposableListener(svg, EventType.MOUSE_MOVE, mouseMoveListener));
|
|
308
|
-
const mouseLeaveListener = () => {
|
|
309
|
-
highlightCircle.style.display = "none";
|
|
310
|
-
hoverDisposable.value = undefined;
|
|
311
|
-
};
|
|
312
|
-
disposables.add(addDisposableListener(svg, EventType.MOUSE_LEAVE, mouseLeaveListener));
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
RuntimeStatusMarkdownRenderer = ( __decorate([( __param(0, IExtensionService)), ( __param(1, IHoverService)), ( __param(2, IExtensionFeaturesManagementService)), ( __param(3, IMarkdownRendererService))], RuntimeStatusMarkdownRenderer));
|
|
316
|
-
const runtimeStatusFeature = {
|
|
317
|
-
id: RuntimeStatusMarkdownRenderer.ID,
|
|
318
|
-
label: ( localize(9412, "Runtime Status")),
|
|
319
|
-
access: {
|
|
320
|
-
canToggle: false
|
|
321
|
-
},
|
|
322
|
-
renderer: ( new SyncDescriptor(RuntimeStatusMarkdownRenderer))
|
|
323
|
-
};
|
|
324
|
-
let ExtensionFeaturesTab = class ExtensionFeaturesTab extends Themable {
|
|
325
|
-
constructor(manifest, feature, themeService, instantiationService) {
|
|
326
|
-
super(themeService);
|
|
327
|
-
this.manifest = manifest;
|
|
328
|
-
this.feature = feature;
|
|
329
|
-
this.instantiationService = instantiationService;
|
|
330
|
-
this.featureView = this._register(( new MutableDisposable()));
|
|
331
|
-
this.layoutParticipants = [];
|
|
332
|
-
this.extensionId = ( new ExtensionIdentifier(getExtensionId(manifest.publisher, manifest.name)));
|
|
333
|
-
this.domNode = $("div.subcontent.feature-contributions");
|
|
334
|
-
this.create();
|
|
335
|
-
}
|
|
336
|
-
layout(height, width) {
|
|
337
|
-
this.layoutParticipants.forEach(participant => participant.layout(height, width));
|
|
338
|
-
}
|
|
339
|
-
create() {
|
|
340
|
-
const features = this.getFeatures();
|
|
341
|
-
if (features.length === 0) {
|
|
342
|
-
append($(".no-features"), this.domNode).textContent = ( localize(9413, "No features contributed."));
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const splitView = this._register(( new SplitView(this.domNode, {
|
|
346
|
-
orientation: Orientation.HORIZONTAL,
|
|
347
|
-
proportionalLayout: true
|
|
348
|
-
})));
|
|
349
|
-
this.layoutParticipants.push({
|
|
350
|
-
layout: (height, width) => {
|
|
351
|
-
splitView.el.style.height = `${height - 14}px`;
|
|
352
|
-
splitView.layout(width);
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
const featuresListContainer = $(".features-list-container");
|
|
356
|
-
const list = this._register(this.createFeaturesList(featuresListContainer));
|
|
357
|
-
list.splice(0, list.length, features);
|
|
358
|
-
const featureViewContainer = $(".feature-view-container");
|
|
359
|
-
this._register(list.onDidChangeSelection(e => {
|
|
360
|
-
const feature = e.elements[0];
|
|
361
|
-
if (feature) {
|
|
362
|
-
this.showFeatureView(feature, featureViewContainer);
|
|
363
|
-
}
|
|
364
|
-
}));
|
|
365
|
-
const index = this.feature ? features.findIndex(f => f.id === this.feature) : 0;
|
|
366
|
-
list.setSelection([index === -1 ? 0 : index]);
|
|
367
|
-
splitView.addView({
|
|
368
|
-
onDidChange: Event.None,
|
|
369
|
-
element: featuresListContainer,
|
|
370
|
-
minimumSize: 100,
|
|
371
|
-
maximumSize: Number.POSITIVE_INFINITY,
|
|
372
|
-
layout: (width, _, height) => {
|
|
373
|
-
featuresListContainer.style.width = `${width}px`;
|
|
374
|
-
list.layout(height, width);
|
|
375
|
-
}
|
|
376
|
-
}, 200, undefined, true);
|
|
377
|
-
splitView.addView({
|
|
378
|
-
onDidChange: Event.None,
|
|
379
|
-
element: featureViewContainer,
|
|
380
|
-
minimumSize: 500,
|
|
381
|
-
maximumSize: Number.POSITIVE_INFINITY,
|
|
382
|
-
layout: (width, _, height) => {
|
|
383
|
-
featureViewContainer.style.width = `${width}px`;
|
|
384
|
-
this.featureViewDimension = {
|
|
385
|
-
height,
|
|
386
|
-
width
|
|
387
|
-
};
|
|
388
|
-
this.layoutFeatureView();
|
|
389
|
-
}
|
|
390
|
-
}, Sizing.Distribute, undefined, true);
|
|
391
|
-
splitView.style({
|
|
392
|
-
separatorBorder: this.theme.getColor(PANEL_SECTION_BORDER)
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
createFeaturesList(container) {
|
|
396
|
-
const renderer = this.instantiationService.createInstance(ExtensionFeatureItemRenderer, this.extensionId);
|
|
397
|
-
const delegate = ( new ExtensionFeatureItemDelegate());
|
|
398
|
-
const list = this.instantiationService.createInstance(
|
|
399
|
-
WorkbenchList,
|
|
400
|
-
"ExtensionFeaturesList",
|
|
401
|
-
append(container, $(".features-list-wrapper")),
|
|
402
|
-
delegate,
|
|
403
|
-
[renderer],
|
|
404
|
-
{
|
|
405
|
-
multipleSelectionSupport: false,
|
|
406
|
-
setRowLineHeight: false,
|
|
407
|
-
horizontalScrolling: false,
|
|
408
|
-
accessibilityProvider: {
|
|
409
|
-
getAriaLabel(extensionFeature) {
|
|
410
|
-
return extensionFeature?.label ?? "";
|
|
411
|
-
},
|
|
412
|
-
getWidgetAriaLabel() {
|
|
413
|
-
return localize(9414, "Extension Features");
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
openOnSingleClick: true
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
return list;
|
|
420
|
-
}
|
|
421
|
-
layoutFeatureView() {
|
|
422
|
-
this.featureView.value?.layout(this.featureViewDimension?.height, this.featureViewDimension?.width);
|
|
423
|
-
}
|
|
424
|
-
showFeatureView(feature, container) {
|
|
425
|
-
if (this.featureView.value?.feature.id === feature.id) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
clearNode(container);
|
|
429
|
-
this.featureView.value = this.instantiationService.createInstance(ExtensionFeatureView, this.extensionId, this.manifest, feature);
|
|
430
|
-
container.appendChild(this.featureView.value.domNode);
|
|
431
|
-
this.layoutFeatureView();
|
|
432
|
-
}
|
|
433
|
-
getFeatures() {
|
|
434
|
-
const features = ( Registry.as(Extensions.ExtensionFeaturesRegistry)).getExtensionFeatures().filter(feature => {
|
|
435
|
-
const renderer = this.getRenderer(feature);
|
|
436
|
-
const shouldRender = renderer?.shouldRender(this.manifest);
|
|
437
|
-
renderer?.dispose();
|
|
438
|
-
return shouldRender;
|
|
439
|
-
}).sort((a, b) => a.label.localeCompare(b.label));
|
|
440
|
-
const renderer = this.getRenderer(runtimeStatusFeature);
|
|
441
|
-
if (renderer?.shouldRender(this.manifest)) {
|
|
442
|
-
features.splice(0, 0, runtimeStatusFeature);
|
|
443
|
-
}
|
|
444
|
-
renderer?.dispose();
|
|
445
|
-
return features;
|
|
446
|
-
}
|
|
447
|
-
getRenderer(feature) {
|
|
448
|
-
return feature.renderer ? this.instantiationService.createInstance(feature.renderer) : undefined;
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
ExtensionFeaturesTab = ( __decorate([( __param(2, IThemeService)), ( __param(3, IInstantiationService))], ExtensionFeaturesTab));
|
|
452
|
-
class ExtensionFeatureItemDelegate {
|
|
453
|
-
getHeight() {
|
|
454
|
-
return 22;
|
|
455
|
-
}
|
|
456
|
-
getTemplateId() {
|
|
457
|
-
return "extensionFeatureDescriptor";
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
let ExtensionFeatureItemRenderer = class ExtensionFeatureItemRenderer {
|
|
461
|
-
constructor(extensionId, extensionFeaturesManagementService) {
|
|
462
|
-
this.extensionId = extensionId;
|
|
463
|
-
this.extensionFeaturesManagementService = extensionFeaturesManagementService;
|
|
464
|
-
this.templateId = "extensionFeatureDescriptor";
|
|
465
|
-
}
|
|
466
|
-
renderTemplate(container) {
|
|
467
|
-
container.classList.add("extension-feature-list-item");
|
|
468
|
-
const label = append(container, $(".extension-feature-label"));
|
|
469
|
-
const disabledElement = append(container, $(".extension-feature-disabled-label"));
|
|
470
|
-
disabledElement.textContent = ( localize(9415, "No Access"));
|
|
471
|
-
const statusElement = append(container, $(".extension-feature-status"));
|
|
472
|
-
return {
|
|
473
|
-
label,
|
|
474
|
-
disabledElement,
|
|
475
|
-
statusElement,
|
|
476
|
-
disposables: ( new DisposableStore())
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
renderElement(element, index, templateData) {
|
|
480
|
-
templateData.disposables.clear();
|
|
481
|
-
templateData.label.textContent = element.label;
|
|
482
|
-
templateData.disabledElement.style.display = element.id === runtimeStatusFeature.id || this.extensionFeaturesManagementService.isEnabled(this.extensionId, element.id) ? "none" : "inherit";
|
|
483
|
-
templateData.disposables.add(this.extensionFeaturesManagementService.onDidChangeEnablement((
|
|
484
|
-
{
|
|
485
|
-
extension,
|
|
486
|
-
featureId,
|
|
487
|
-
enabled
|
|
488
|
-
}
|
|
489
|
-
) => {
|
|
490
|
-
if (ExtensionIdentifier.equals(extension, this.extensionId) && featureId === element.id) {
|
|
491
|
-
templateData.disabledElement.style.display = enabled ? "none" : "inherit";
|
|
492
|
-
}
|
|
493
|
-
}));
|
|
494
|
-
const statusElementClassName = templateData.statusElement.className;
|
|
495
|
-
const updateStatus = () => {
|
|
496
|
-
const accessData = this.extensionFeaturesManagementService.getAccessData(this.extensionId, element.id);
|
|
497
|
-
if (accessData?.current?.status) {
|
|
498
|
-
templateData.statusElement.style.display = "inherit";
|
|
499
|
-
templateData.statusElement.className = `${statusElementClassName} ${SeverityIcon.className(accessData.current.status.severity)}`;
|
|
500
|
-
} else {
|
|
501
|
-
templateData.statusElement.style.display = "none";
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
updateStatus();
|
|
505
|
-
templateData.disposables.add(this.extensionFeaturesManagementService.onDidChangeAccessData((
|
|
506
|
-
{
|
|
507
|
-
extension,
|
|
508
|
-
featureId
|
|
509
|
-
}
|
|
510
|
-
) => {
|
|
511
|
-
if (ExtensionIdentifier.equals(extension, this.extensionId) && featureId === element.id) {
|
|
512
|
-
updateStatus();
|
|
513
|
-
}
|
|
514
|
-
}));
|
|
515
|
-
}
|
|
516
|
-
disposeElement(element, index, templateData) {
|
|
517
|
-
templateData.disposables.dispose();
|
|
518
|
-
}
|
|
519
|
-
disposeTemplate(templateData) {
|
|
520
|
-
templateData.disposables.dispose();
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
ExtensionFeatureItemRenderer = ( __decorate([( __param(1, IExtensionFeaturesManagementService))], ExtensionFeatureItemRenderer));
|
|
524
|
-
let ExtensionFeatureView = class ExtensionFeatureView extends Disposable {
|
|
525
|
-
constructor(
|
|
526
|
-
extensionId,
|
|
527
|
-
manifest,
|
|
528
|
-
feature,
|
|
529
|
-
instantiationService,
|
|
530
|
-
extensionFeaturesManagementService,
|
|
531
|
-
dialogService,
|
|
532
|
-
markdownRendererService
|
|
533
|
-
) {
|
|
534
|
-
super();
|
|
535
|
-
this.extensionId = extensionId;
|
|
536
|
-
this.manifest = manifest;
|
|
537
|
-
this.feature = feature;
|
|
538
|
-
this.instantiationService = instantiationService;
|
|
539
|
-
this.extensionFeaturesManagementService = extensionFeaturesManagementService;
|
|
540
|
-
this.dialogService = dialogService;
|
|
541
|
-
this.markdownRendererService = markdownRendererService;
|
|
542
|
-
this.layoutParticipants = [];
|
|
543
|
-
this.domNode = $(".extension-feature-content");
|
|
544
|
-
this.create(this.domNode);
|
|
545
|
-
}
|
|
546
|
-
create(content) {
|
|
547
|
-
const header = append(content, $(".feature-header"));
|
|
548
|
-
const title = append(header, $(".feature-title"));
|
|
549
|
-
title.textContent = this.feature.label;
|
|
550
|
-
if (this.feature.access.canToggle) {
|
|
551
|
-
const actionsContainer = append(header, $(".feature-actions"));
|
|
552
|
-
const button = ( new Button(actionsContainer, defaultButtonStyles));
|
|
553
|
-
this.updateButtonLabel(button);
|
|
554
|
-
this._register(this.extensionFeaturesManagementService.onDidChangeEnablement((
|
|
555
|
-
{
|
|
556
|
-
extension,
|
|
557
|
-
featureId
|
|
558
|
-
}
|
|
559
|
-
) => {
|
|
560
|
-
if (ExtensionIdentifier.equals(extension, this.extensionId) && featureId === this.feature.id) {
|
|
561
|
-
this.updateButtonLabel(button);
|
|
562
|
-
}
|
|
563
|
-
}));
|
|
564
|
-
this._register(button.onDidClick(async () => {
|
|
565
|
-
const enabled = this.extensionFeaturesManagementService.isEnabled(this.extensionId, this.feature.id);
|
|
566
|
-
const confirmationResult = await this.dialogService.confirm({
|
|
567
|
-
title: ( localize(9416, "Enable '{0}' Feature", this.feature.label)),
|
|
568
|
-
message: enabled ? ( localize(
|
|
569
|
-
9417,
|
|
570
|
-
"Would you like to revoke '{0}' extension to access '{1}' feature?",
|
|
571
|
-
this.manifest.displayName ?? this.extensionId.value,
|
|
572
|
-
this.feature.label
|
|
573
|
-
)) : ( localize(
|
|
574
|
-
9418,
|
|
575
|
-
"Would you like to allow '{0}' extension to access '{1}' feature?",
|
|
576
|
-
this.manifest.displayName ?? this.extensionId.value,
|
|
577
|
-
this.feature.label
|
|
578
|
-
)),
|
|
579
|
-
custom: true,
|
|
580
|
-
primaryButton: enabled ? ( localize(9419, "Revoke Access")) : ( localize(9420, "Allow Access")),
|
|
581
|
-
cancelButton: ( localize(9421, "Cancel"))
|
|
582
|
-
});
|
|
583
|
-
if (confirmationResult.confirmed) {
|
|
584
|
-
this.extensionFeaturesManagementService.setEnablement(this.extensionId, this.feature.id, !enabled);
|
|
585
|
-
}
|
|
586
|
-
}));
|
|
587
|
-
}
|
|
588
|
-
const body = append(content, $(".feature-body"));
|
|
589
|
-
const bodyContent = $(".feature-body-content");
|
|
590
|
-
const scrollableContent = this._register(( new DomScrollableElement(bodyContent, {})));
|
|
591
|
-
append(body, scrollableContent.getDomNode());
|
|
592
|
-
this.layoutParticipants.push({
|
|
593
|
-
layout: () => scrollableContent.scanDomNode()
|
|
594
|
-
});
|
|
595
|
-
scrollableContent.scanDomNode();
|
|
596
|
-
if (this.feature.description) {
|
|
597
|
-
const description = append(bodyContent, $(".feature-description"));
|
|
598
|
-
description.textContent = this.feature.description;
|
|
599
|
-
}
|
|
600
|
-
const accessData = this.extensionFeaturesManagementService.getAccessData(this.extensionId, this.feature.id);
|
|
601
|
-
if (accessData?.current?.status) {
|
|
602
|
-
append(
|
|
603
|
-
bodyContent,
|
|
604
|
-
$(".feature-status", undefined, $(`span${ThemeIcon.asCSSSelector(
|
|
605
|
-
accessData.current.status.severity === Severity.Error ? errorIcon : accessData.current.status.severity === Severity.Warning ? warningIcon : infoIcon
|
|
606
|
-
)}`, undefined), $("span", undefined, accessData.current.status.message))
|
|
607
|
-
);
|
|
608
|
-
}
|
|
609
|
-
const featureContentElement = append(bodyContent, $(".feature-content"));
|
|
610
|
-
if (this.feature.renderer) {
|
|
611
|
-
const renderer = this.instantiationService.createInstance(this.feature.renderer);
|
|
612
|
-
if (renderer.type === "table") {
|
|
613
|
-
this.renderTableData(featureContentElement, renderer);
|
|
614
|
-
} else if (renderer.type === "markdown") {
|
|
615
|
-
this.renderMarkdownData(featureContentElement, renderer);
|
|
616
|
-
} else if (renderer.type === "markdown+table") {
|
|
617
|
-
this.renderMarkdownAndTableData(featureContentElement, renderer);
|
|
618
|
-
} else if (renderer.type === "element") {
|
|
619
|
-
this.renderElementData(featureContentElement, renderer);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
updateButtonLabel(button) {
|
|
624
|
-
button.label = this.extensionFeaturesManagementService.isEnabled(this.extensionId, this.feature.id) ? ( localize(9419, "Revoke Access")) : ( localize(9422, "Allow Access"));
|
|
625
|
-
}
|
|
626
|
-
renderTableData(container, renderer) {
|
|
627
|
-
const tableData = this._register(renderer.render(this.manifest));
|
|
628
|
-
const tableDisposable = this._register(( new MutableDisposable()));
|
|
629
|
-
if (tableData.onDidChange) {
|
|
630
|
-
this._register(tableData.onDidChange(data => {
|
|
631
|
-
clearNode(container);
|
|
632
|
-
tableDisposable.value = this.renderTable(data, container);
|
|
633
|
-
}));
|
|
634
|
-
}
|
|
635
|
-
tableDisposable.value = this.renderTable(tableData.data, container);
|
|
636
|
-
}
|
|
637
|
-
renderTable(tableData, container) {
|
|
638
|
-
const disposables = ( new DisposableStore());
|
|
639
|
-
append(container, $("table", undefined, $("tr", undefined, ...( tableData.headers.map(header => $("th", undefined, header)))), ...( tableData.rows.map(row => {
|
|
640
|
-
return $("tr", undefined, ...( row.map(rowData => {
|
|
641
|
-
if (typeof rowData === "string") {
|
|
642
|
-
return $("td", undefined, $("p", undefined, rowData));
|
|
643
|
-
}
|
|
644
|
-
const data = Array.isArray(rowData) ? rowData : [rowData];
|
|
645
|
-
return $("td", undefined, ...( data.map(item => {
|
|
646
|
-
const result = [];
|
|
647
|
-
if (isMarkdownString(rowData)) {
|
|
648
|
-
const element = $("", undefined);
|
|
649
|
-
this.renderMarkdown(rowData, element);
|
|
650
|
-
result.push(element);
|
|
651
|
-
} else if (item instanceof ResolvedKeybinding) {
|
|
652
|
-
const element = $("");
|
|
653
|
-
const kbl = disposables.add(( new KeybindingLabel(element, OS, defaultKeybindingLabelStyles)));
|
|
654
|
-
kbl.set(item);
|
|
655
|
-
result.push(element);
|
|
656
|
-
} else if (item instanceof Color) {
|
|
657
|
-
result.push($("span", {
|
|
658
|
-
class: "colorBox",
|
|
659
|
-
style: "background-color: " + Color.Format.CSS.format(item)
|
|
660
|
-
}, ""));
|
|
661
|
-
result.push($("code", undefined, Color.Format.CSS.formatHex(item)));
|
|
662
|
-
}
|
|
663
|
-
return result;
|
|
664
|
-
})).flat());
|
|
665
|
-
})));
|
|
666
|
-
}))));
|
|
667
|
-
return disposables;
|
|
668
|
-
}
|
|
669
|
-
renderMarkdownAndTableData(container, renderer) {
|
|
670
|
-
const markdownAndTableData = this._register(renderer.render(this.manifest));
|
|
671
|
-
if (markdownAndTableData.onDidChange) {
|
|
672
|
-
this._register(markdownAndTableData.onDidChange(data => {
|
|
673
|
-
clearNode(container);
|
|
674
|
-
this.renderMarkdownAndTable(data, container);
|
|
675
|
-
}));
|
|
676
|
-
}
|
|
677
|
-
this.renderMarkdownAndTable(markdownAndTableData.data, container);
|
|
678
|
-
}
|
|
679
|
-
renderMarkdownData(container, renderer) {
|
|
680
|
-
container.classList.add("markdown");
|
|
681
|
-
const markdownData = this._register(renderer.render(this.manifest));
|
|
682
|
-
if (markdownData.onDidChange) {
|
|
683
|
-
this._register(markdownData.onDidChange(data => {
|
|
684
|
-
clearNode(container);
|
|
685
|
-
this.renderMarkdown(data, container);
|
|
686
|
-
}));
|
|
687
|
-
}
|
|
688
|
-
this.renderMarkdown(markdownData.data, container);
|
|
689
|
-
}
|
|
690
|
-
renderMarkdown(markdown, container) {
|
|
691
|
-
const {
|
|
692
|
-
element
|
|
693
|
-
} = this._register(this.markdownRendererService.render({
|
|
694
|
-
value: markdown.value,
|
|
695
|
-
isTrusted: markdown.isTrusted,
|
|
696
|
-
supportThemeIcons: true
|
|
697
|
-
}));
|
|
698
|
-
append(container, element);
|
|
699
|
-
}
|
|
700
|
-
renderMarkdownAndTable(data, container) {
|
|
701
|
-
for (const markdownOrTable of data) {
|
|
702
|
-
if (isMarkdownString(markdownOrTable)) {
|
|
703
|
-
const element = $("", undefined);
|
|
704
|
-
this.renderMarkdown(markdownOrTable, element);
|
|
705
|
-
append(container, element);
|
|
706
|
-
} else {
|
|
707
|
-
const tableElement = append(container, $("table"));
|
|
708
|
-
this.renderTable(markdownOrTable, tableElement);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
renderElementData(container, renderer) {
|
|
713
|
-
const elementData = this._register(renderer.render(this.manifest));
|
|
714
|
-
if (elementData.onDidChange) {
|
|
715
|
-
this._register(elementData.onDidChange(data => {
|
|
716
|
-
clearNode(container);
|
|
717
|
-
container.appendChild(data);
|
|
718
|
-
}));
|
|
719
|
-
}
|
|
720
|
-
container.appendChild(elementData.data);
|
|
721
|
-
}
|
|
722
|
-
layout(height, width) {
|
|
723
|
-
this.layoutParticipants.forEach(p => p.layout(height, width));
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
ExtensionFeatureView = ( __decorate([( __param(3, IInstantiationService)), ( __param(4, IExtensionFeaturesManagementService)), ( __param(5, IDialogService)), ( __param(6, IMarkdownRendererService))], ExtensionFeatureView));
|
|
727
|
-
|
|
728
|
-
export { ExtensionFeaturesTab };
|