@theia/vsx-registry 1.45.0 → 1.46.0-next.72
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/README.md +45 -45
- package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
- package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
- package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
- package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
- package/lib/browser/vsx-extension-commands.d.ts +14 -13
- package/lib/browser/vsx-extension-commands.d.ts.map +1 -1
- package/lib/browser/vsx-extension-commands.js +68 -63
- package/lib/browser/vsx-extension-commands.js.map +1 -1
- package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
- package/lib/browser/vsx-extension-editor-manager.js +49 -49
- package/lib/browser/vsx-extension-editor.d.ts +21 -21
- package/lib/browser/vsx-extension-editor.js +109 -109
- package/lib/browser/vsx-extension.d.ts +146 -143
- package/lib/browser/vsx-extension.d.ts.map +1 -1
- package/lib/browser/vsx-extension.js +616 -596
- package/lib/browser/vsx-extension.js.map +1 -1
- package/lib/browser/vsx-extensions-contribution.d.ts +70 -60
- package/lib/browser/vsx-extensions-contribution.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-contribution.js +375 -344
- package/lib/browser/vsx-extensions-contribution.js.map +1 -1
- package/lib/browser/vsx-extensions-model.d.ts +75 -72
- package/lib/browser/vsx-extensions-model.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-model.js +437 -391
- package/lib/browser/vsx-extensions-model.js.map +1 -1
- package/lib/browser/vsx-extensions-preferences.d.ts +12 -0
- package/lib/browser/vsx-extensions-preferences.d.ts.map +1 -0
- package/lib/browser/vsx-extensions-preferences.js +47 -0
- package/lib/browser/vsx-extensions-preferences.js.map +1 -0
- package/lib/browser/vsx-extensions-search-bar.d.ts +22 -14
- package/lib/browser/vsx-extensions-search-bar.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-search-bar.js +106 -75
- package/lib/browser/vsx-extensions-search-bar.js.map +1 -1
- package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
- package/lib/browser/vsx-extensions-search-model.js +70 -70
- package/lib/browser/vsx-extensions-source.d.ts +19 -19
- package/lib/browser/vsx-extensions-source.js +102 -102
- package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
- package/lib/browser/vsx-extensions-view-container.js +179 -179
- package/lib/browser/vsx-extensions-widget.d.ts +35 -34
- package/lib/browser/vsx-extensions-widget.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-widget.js +164 -156
- package/lib/browser/vsx-extensions-widget.js.map +1 -1
- package/lib/browser/vsx-language-quick-pick-service.d.ts +15 -15
- package/lib/browser/vsx-language-quick-pick-service.js +121 -121
- package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
- package/lib/browser/vsx-registry-frontend-module.d.ts.map +1 -1
- package/lib/browser/vsx-registry-frontend-module.js +99 -97
- package/lib/browser/vsx-registry-frontend-module.js.map +1 -1
- package/lib/common/index.d.ts +3 -3
- package/lib/common/index.js +25 -25
- package/lib/common/ovsx-client-provider.d.ts +13 -13
- package/lib/common/ovsx-client-provider.js +29 -29
- package/lib/common/vsx-environment.d.ts +9 -9
- package/lib/common/vsx-environment.js +20 -20
- package/lib/common/vsx-extension-uri.d.ts +3 -3
- package/lib/common/vsx-extension-uri.js +20 -20
- package/lib/common/vsx-registry-common-module.d.ts +3 -3
- package/lib/common/vsx-registry-common-module.js +57 -57
- package/lib/node/vsx-cli.d.ts +9 -9
- package/lib/node/vsx-cli.js +41 -41
- package/lib/node/vsx-environment-impl.d.ts +14 -14
- package/lib/node/vsx-environment-impl.js +61 -61
- package/lib/node/vsx-extension-resolver.d.ts +20 -20
- package/lib/node/vsx-extension-resolver.js +154 -154
- package/lib/node/vsx-registry-backend-module.d.ts +3 -3
- package/lib/node/vsx-registry-backend-module.js +35 -35
- package/lib/package.spec.js +25 -25
- package/package.json +12 -12
- package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
- package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
- package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
- package/src/browser/style/extensions.svg +4 -4
- package/src/browser/style/index.css +436 -373
- package/src/browser/vsx-extension-commands.ts +68 -63
- package/src/browser/vsx-extension-editor-manager.ts +42 -42
- package/src/browser/vsx-extension-editor.tsx +96 -96
- package/src/browser/vsx-extension.tsx +704 -675
- package/src/browser/vsx-extensions-contribution.ts +361 -327
- package/src/browser/vsx-extensions-model.ts +436 -389
- package/src/browser/vsx-extensions-preferences.ts +58 -0
- package/src/browser/vsx-extensions-search-bar.tsx +107 -69
- package/src/browser/vsx-extensions-search-model.ts +61 -61
- package/src/browser/vsx-extensions-source.ts +83 -83
- package/src/browser/vsx-extensions-view-container.ts +179 -179
- package/src/browser/vsx-extensions-widget.tsx +165 -156
- package/src/browser/vsx-language-quick-pick-service.ts +110 -110
- package/src/browser/vsx-registry-frontend-module.ts +108 -106
- package/src/common/index.ts +19 -19
- package/src/common/ovsx-client-provider.ts +35 -35
- package/src/common/vsx-environment.ts +27 -27
- package/src/common/vsx-extension-uri.ts +20 -20
- package/src/common/vsx-registry-common-module.ts +63 -63
- package/src/node/vsx-cli.ts +38 -38
- package/src/node/vsx-environment-impl.ts +50 -50
- package/src/node/vsx-extension-resolver.ts +125 -125
- package/src/node/vsx-registry-backend-module.ts +35 -35
- package/src/package.spec.ts +29 -29
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (C) 2020 TypeFox and others.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made available under the
|
|
6
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
*
|
|
9
|
-
* This Source Code may also be made available under the following Secondary
|
|
10
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
* with the GNU Classpath Exception which is available at
|
|
13
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
*
|
|
15
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
*******************************************************************************‚*/
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var VSXExtensionsViewContainer_1;
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.VSXExtensionsViewContainer = void 0;
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
-
const vsx_extensions_search_bar_1 = require("./vsx-extensions-search-bar");
|
|
32
|
-
const vsx_extensions_model_1 = require("./vsx-extensions-model");
|
|
33
|
-
const vsx_extensions_search_model_1 = require("./vsx-extensions-search-model");
|
|
34
|
-
const vsx_extensions_widget_1 = require("./vsx-extensions-widget");
|
|
35
|
-
const vsx_extensions_source_1 = require("./vsx-extensions-source");
|
|
36
|
-
const vsx_extension_commands_1 = require("./vsx-extension-commands");
|
|
37
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
38
|
-
let VSXExtensionsViewContainer = VSXExtensionsViewContainer_1 = class VSXExtensionsViewContainer extends browser_1.ViewContainer {
|
|
39
|
-
constructor() {
|
|
40
|
-
super(...arguments);
|
|
41
|
-
this.disableDNDBetweenContainers = true;
|
|
42
|
-
this.currentMode = vsx_extensions_search_model_1.VSXSearchMode.Initial;
|
|
43
|
-
this.lastModeState = new Map();
|
|
44
|
-
}
|
|
45
|
-
init() {
|
|
46
|
-
super.init();
|
|
47
|
-
this.id = VSXExtensionsViewContainer_1.ID;
|
|
48
|
-
this.addClass('theia-vsx-extensions-view-container');
|
|
49
|
-
this.setTitleOptions({
|
|
50
|
-
label: VSXExtensionsViewContainer_1.LABEL,
|
|
51
|
-
iconClass: (0, browser_1.codicon)('extensions'),
|
|
52
|
-
closeable: true
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
onActivateRequest(msg) {
|
|
56
|
-
this.searchBar.activate();
|
|
57
|
-
}
|
|
58
|
-
onAfterAttach(msg) {
|
|
59
|
-
super.onBeforeAttach(msg);
|
|
60
|
-
this.updateMode();
|
|
61
|
-
this.toDisposeOnDetach.push(this.model.search.onDidChangeQuery(() => this.updateMode()));
|
|
62
|
-
}
|
|
63
|
-
configureLayout(layout) {
|
|
64
|
-
layout.addWidget(this.searchBar);
|
|
65
|
-
super.configureLayout(layout);
|
|
66
|
-
}
|
|
67
|
-
updateMode() {
|
|
68
|
-
const currentMode = this.model.search.getModeForQuery();
|
|
69
|
-
if (currentMode === this.currentMode) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (this.currentMode !== vsx_extensions_search_model_1.VSXSearchMode.Initial) {
|
|
73
|
-
this.lastModeState.set(this.currentMode, super.doStoreState());
|
|
74
|
-
}
|
|
75
|
-
this.currentMode = currentMode;
|
|
76
|
-
const lastState = this.lastModeState.get(currentMode);
|
|
77
|
-
if (lastState) {
|
|
78
|
-
super.doRestoreState(lastState);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
for (const part of this.getParts()) {
|
|
82
|
-
this.applyModeToPart(part);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const specialWidgets = this.getWidgetsForMode();
|
|
86
|
-
if (specialWidgets === null || specialWidgets === void 0 ? void 0 : specialWidgets.length) {
|
|
87
|
-
const widgetChecker = new Set(specialWidgets);
|
|
88
|
-
const relevantParts = this.getParts().filter(part => widgetChecker.has(part.wrapped.id));
|
|
89
|
-
relevantParts.forEach(part => {
|
|
90
|
-
part.collapsed = false;
|
|
91
|
-
part.show();
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
registerPart(part) {
|
|
96
|
-
super.registerPart(part);
|
|
97
|
-
this.applyModeToPart(part);
|
|
98
|
-
}
|
|
99
|
-
applyModeToPart(part) {
|
|
100
|
-
if (this.shouldShowWidget(part)) {
|
|
101
|
-
part.show();
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
part.hide();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
shouldShowWidget(part) {
|
|
108
|
-
const widgetsToShow = this.getWidgetsForMode();
|
|
109
|
-
if (widgetsToShow.length) {
|
|
110
|
-
return widgetsToShow.includes(part.wrapped.id);
|
|
111
|
-
}
|
|
112
|
-
return part.wrapped.id !== (0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.SEARCH_RESULT);
|
|
113
|
-
}
|
|
114
|
-
getWidgetsForMode() {
|
|
115
|
-
switch (this.currentMode) {
|
|
116
|
-
case vsx_extensions_search_model_1.VSXSearchMode.Builtin:
|
|
117
|
-
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.BUILT_IN)];
|
|
118
|
-
case vsx_extensions_search_model_1.VSXSearchMode.Installed:
|
|
119
|
-
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.INSTALLED)];
|
|
120
|
-
case vsx_extensions_search_model_1.VSXSearchMode.Recommended:
|
|
121
|
-
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.RECOMMENDED)];
|
|
122
|
-
case vsx_extensions_search_model_1.VSXSearchMode.Search:
|
|
123
|
-
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.SEARCH_RESULT)];
|
|
124
|
-
default:
|
|
125
|
-
return [];
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
129
|
-
doStoreState() {
|
|
130
|
-
const modes = {};
|
|
131
|
-
for (const mode of this.lastModeState.keys()) {
|
|
132
|
-
modes[mode] = this.lastModeState.get(mode);
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
query: this.model.search.query,
|
|
136
|
-
modes
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
|
-
doRestoreState(state) {
|
|
141
|
-
// eslint-disable-next-line guard-for-in
|
|
142
|
-
for (const key in state.modes) {
|
|
143
|
-
const mode = Number(key);
|
|
144
|
-
const modeState = state.modes[mode];
|
|
145
|
-
if (modeState) {
|
|
146
|
-
this.lastModeState.set(mode, modeState);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
this.model.search.query = state.query;
|
|
150
|
-
}
|
|
151
|
-
updateToolbarItems(allParts) {
|
|
152
|
-
super.updateToolbarItems(allParts);
|
|
153
|
-
this.registerToolbarItem(vsx_extension_commands_1.VSXExtensionsCommands.INSTALL_FROM_VSIX.id, { tooltip: vsx_extension_commands_1.VSXExtensionsCommands.INSTALL_FROM_VSIX.label, group: 'other_1' });
|
|
154
|
-
this.registerToolbarItem(vsx_extension_commands_1.VSXExtensionsCommands.CLEAR_ALL.id, { tooltip: vsx_extension_commands_1.VSXExtensionsCommands.CLEAR_ALL.label, priority: 1, onDidChange: this.model.onDidChange });
|
|
155
|
-
}
|
|
156
|
-
getToggleVisibilityGroupLabel() {
|
|
157
|
-
return 'a/' + nls_1.nls.localizeByDefault('Views');
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
VSXExtensionsViewContainer.ID = 'vsx-extensions-view-container';
|
|
161
|
-
VSXExtensionsViewContainer.LABEL = nls_1.nls.localizeByDefault('Extensions');
|
|
162
|
-
__decorate([
|
|
163
|
-
(0, inversify_1.inject)(vsx_extensions_search_bar_1.VSXExtensionsSearchBar),
|
|
164
|
-
__metadata("design:type", vsx_extensions_search_bar_1.VSXExtensionsSearchBar)
|
|
165
|
-
], VSXExtensionsViewContainer.prototype, "searchBar", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
(0, inversify_1.inject)(vsx_extensions_model_1.VSXExtensionsModel),
|
|
168
|
-
__metadata("design:type", vsx_extensions_model_1.VSXExtensionsModel)
|
|
169
|
-
], VSXExtensionsViewContainer.prototype, "model", void 0);
|
|
170
|
-
__decorate([
|
|
171
|
-
(0, inversify_1.postConstruct)(),
|
|
172
|
-
__metadata("design:type", Function),
|
|
173
|
-
__metadata("design:paramtypes", []),
|
|
174
|
-
__metadata("design:returntype", void 0)
|
|
175
|
-
], VSXExtensionsViewContainer.prototype, "init", null);
|
|
176
|
-
VSXExtensionsViewContainer = VSXExtensionsViewContainer_1 = __decorate([
|
|
177
|
-
(0, inversify_1.injectable)()
|
|
178
|
-
], VSXExtensionsViewContainer);
|
|
179
|
-
exports.VSXExtensionsViewContainer = VSXExtensionsViewContainer;
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2020 TypeFox and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
*******************************************************************************‚*/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var VSXExtensionsViewContainer_1;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.VSXExtensionsViewContainer = void 0;
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
31
|
+
const vsx_extensions_search_bar_1 = require("./vsx-extensions-search-bar");
|
|
32
|
+
const vsx_extensions_model_1 = require("./vsx-extensions-model");
|
|
33
|
+
const vsx_extensions_search_model_1 = require("./vsx-extensions-search-model");
|
|
34
|
+
const vsx_extensions_widget_1 = require("./vsx-extensions-widget");
|
|
35
|
+
const vsx_extensions_source_1 = require("./vsx-extensions-source");
|
|
36
|
+
const vsx_extension_commands_1 = require("./vsx-extension-commands");
|
|
37
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
38
|
+
let VSXExtensionsViewContainer = VSXExtensionsViewContainer_1 = class VSXExtensionsViewContainer extends browser_1.ViewContainer {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.disableDNDBetweenContainers = true;
|
|
42
|
+
this.currentMode = vsx_extensions_search_model_1.VSXSearchMode.Initial;
|
|
43
|
+
this.lastModeState = new Map();
|
|
44
|
+
}
|
|
45
|
+
init() {
|
|
46
|
+
super.init();
|
|
47
|
+
this.id = VSXExtensionsViewContainer_1.ID;
|
|
48
|
+
this.addClass('theia-vsx-extensions-view-container');
|
|
49
|
+
this.setTitleOptions({
|
|
50
|
+
label: VSXExtensionsViewContainer_1.LABEL,
|
|
51
|
+
iconClass: (0, browser_1.codicon)('extensions'),
|
|
52
|
+
closeable: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
onActivateRequest(msg) {
|
|
56
|
+
this.searchBar.activate();
|
|
57
|
+
}
|
|
58
|
+
onAfterAttach(msg) {
|
|
59
|
+
super.onBeforeAttach(msg);
|
|
60
|
+
this.updateMode();
|
|
61
|
+
this.toDisposeOnDetach.push(this.model.search.onDidChangeQuery(() => this.updateMode()));
|
|
62
|
+
}
|
|
63
|
+
configureLayout(layout) {
|
|
64
|
+
layout.addWidget(this.searchBar);
|
|
65
|
+
super.configureLayout(layout);
|
|
66
|
+
}
|
|
67
|
+
updateMode() {
|
|
68
|
+
const currentMode = this.model.search.getModeForQuery();
|
|
69
|
+
if (currentMode === this.currentMode) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (this.currentMode !== vsx_extensions_search_model_1.VSXSearchMode.Initial) {
|
|
73
|
+
this.lastModeState.set(this.currentMode, super.doStoreState());
|
|
74
|
+
}
|
|
75
|
+
this.currentMode = currentMode;
|
|
76
|
+
const lastState = this.lastModeState.get(currentMode);
|
|
77
|
+
if (lastState) {
|
|
78
|
+
super.doRestoreState(lastState);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
for (const part of this.getParts()) {
|
|
82
|
+
this.applyModeToPart(part);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const specialWidgets = this.getWidgetsForMode();
|
|
86
|
+
if (specialWidgets === null || specialWidgets === void 0 ? void 0 : specialWidgets.length) {
|
|
87
|
+
const widgetChecker = new Set(specialWidgets);
|
|
88
|
+
const relevantParts = this.getParts().filter(part => widgetChecker.has(part.wrapped.id));
|
|
89
|
+
relevantParts.forEach(part => {
|
|
90
|
+
part.collapsed = false;
|
|
91
|
+
part.show();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
registerPart(part) {
|
|
96
|
+
super.registerPart(part);
|
|
97
|
+
this.applyModeToPart(part);
|
|
98
|
+
}
|
|
99
|
+
applyModeToPart(part) {
|
|
100
|
+
if (this.shouldShowWidget(part)) {
|
|
101
|
+
part.show();
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
part.hide();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
shouldShowWidget(part) {
|
|
108
|
+
const widgetsToShow = this.getWidgetsForMode();
|
|
109
|
+
if (widgetsToShow.length) {
|
|
110
|
+
return widgetsToShow.includes(part.wrapped.id);
|
|
111
|
+
}
|
|
112
|
+
return part.wrapped.id !== (0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.SEARCH_RESULT);
|
|
113
|
+
}
|
|
114
|
+
getWidgetsForMode() {
|
|
115
|
+
switch (this.currentMode) {
|
|
116
|
+
case vsx_extensions_search_model_1.VSXSearchMode.Builtin:
|
|
117
|
+
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.BUILT_IN)];
|
|
118
|
+
case vsx_extensions_search_model_1.VSXSearchMode.Installed:
|
|
119
|
+
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.INSTALLED)];
|
|
120
|
+
case vsx_extensions_search_model_1.VSXSearchMode.Recommended:
|
|
121
|
+
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.RECOMMENDED)];
|
|
122
|
+
case vsx_extensions_search_model_1.VSXSearchMode.Search:
|
|
123
|
+
return [(0, vsx_extensions_widget_1.generateExtensionWidgetId)(vsx_extensions_source_1.VSXExtensionsSourceOptions.SEARCH_RESULT)];
|
|
124
|
+
default:
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
129
|
+
doStoreState() {
|
|
130
|
+
const modes = {};
|
|
131
|
+
for (const mode of this.lastModeState.keys()) {
|
|
132
|
+
modes[mode] = this.lastModeState.get(mode);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
query: this.model.search.query,
|
|
136
|
+
modes
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
|
+
doRestoreState(state) {
|
|
141
|
+
// eslint-disable-next-line guard-for-in
|
|
142
|
+
for (const key in state.modes) {
|
|
143
|
+
const mode = Number(key);
|
|
144
|
+
const modeState = state.modes[mode];
|
|
145
|
+
if (modeState) {
|
|
146
|
+
this.lastModeState.set(mode, modeState);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
this.model.search.query = state.query;
|
|
150
|
+
}
|
|
151
|
+
updateToolbarItems(allParts) {
|
|
152
|
+
super.updateToolbarItems(allParts);
|
|
153
|
+
this.registerToolbarItem(vsx_extension_commands_1.VSXExtensionsCommands.INSTALL_FROM_VSIX.id, { tooltip: vsx_extension_commands_1.VSXExtensionsCommands.INSTALL_FROM_VSIX.label, group: 'other_1' });
|
|
154
|
+
this.registerToolbarItem(vsx_extension_commands_1.VSXExtensionsCommands.CLEAR_ALL.id, { tooltip: vsx_extension_commands_1.VSXExtensionsCommands.CLEAR_ALL.label, priority: 1, onDidChange: this.model.onDidChange });
|
|
155
|
+
}
|
|
156
|
+
getToggleVisibilityGroupLabel() {
|
|
157
|
+
return 'a/' + nls_1.nls.localizeByDefault('Views');
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
VSXExtensionsViewContainer.ID = 'vsx-extensions-view-container';
|
|
161
|
+
VSXExtensionsViewContainer.LABEL = nls_1.nls.localizeByDefault('Extensions');
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, inversify_1.inject)(vsx_extensions_search_bar_1.VSXExtensionsSearchBar),
|
|
164
|
+
__metadata("design:type", vsx_extensions_search_bar_1.VSXExtensionsSearchBar)
|
|
165
|
+
], VSXExtensionsViewContainer.prototype, "searchBar", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, inversify_1.inject)(vsx_extensions_model_1.VSXExtensionsModel),
|
|
168
|
+
__metadata("design:type", vsx_extensions_model_1.VSXExtensionsModel)
|
|
169
|
+
], VSXExtensionsViewContainer.prototype, "model", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, inversify_1.postConstruct)(),
|
|
172
|
+
__metadata("design:type", Function),
|
|
173
|
+
__metadata("design:paramtypes", []),
|
|
174
|
+
__metadata("design:returntype", void 0)
|
|
175
|
+
], VSXExtensionsViewContainer.prototype, "init", null);
|
|
176
|
+
VSXExtensionsViewContainer = VSXExtensionsViewContainer_1 = __decorate([
|
|
177
|
+
(0, inversify_1.injectable)()
|
|
178
|
+
], VSXExtensionsViewContainer);
|
|
179
|
+
exports.VSXExtensionsViewContainer = VSXExtensionsViewContainer;
|
|
180
180
|
//# sourceMappingURL=vsx-extensions-view-container.js.map
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
-
import { TreeModel, TreeNode } from '@theia/core/lib/browser';
|
|
4
|
-
import { SourceTreeWidget } from '@theia/core/lib/browser/source-tree';
|
|
5
|
-
import { VSXExtensionsSource, VSXExtensionsSourceOptions } from './vsx-extensions-source';
|
|
6
|
-
import { BadgeWidget } from '@theia/core/lib/browser/view-container';
|
|
7
|
-
import { Emitter, Event } from '@theia/core/lib/common';
|
|
8
|
-
import * as React from '@theia/core/shared/react';
|
|
9
|
-
export declare class VSXExtensionsWidgetOptions extends VSXExtensionsSourceOptions {
|
|
10
|
-
title?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const generateExtensionWidgetId: (widgetId: string) => string;
|
|
13
|
-
export declare class VSXExtensionsWidget extends SourceTreeWidget implements BadgeWidget {
|
|
14
|
-
static ID: string;
|
|
15
|
-
static createWidget(parent: interfaces.Container, options: VSXExtensionsWidgetOptions): VSXExtensionsWidget;
|
|
16
|
-
protected _badge?: number;
|
|
17
|
-
protected onDidChangeBadgeEmitter: Emitter<void>;
|
|
18
|
-
protected _badgeTooltip?: string;
|
|
19
|
-
protected onDidChangeBadgeTooltipEmitter: Emitter<void>;
|
|
20
|
-
protected readonly options: VSXExtensionsWidgetOptions;
|
|
21
|
-
protected readonly extensionsSource: VSXExtensionsSource;
|
|
22
|
-
protected init(): void;
|
|
23
|
-
get onDidChangeBadge(): Event<void>;
|
|
24
|
-
get badge(): number | undefined;
|
|
25
|
-
set badge(count: number | undefined);
|
|
26
|
-
get onDidChangeBadgeTooltip(): Event<void>;
|
|
27
|
-
get badgeTooltip(): string | undefined;
|
|
28
|
-
set badgeTooltip(tooltip: string | undefined);
|
|
29
|
-
protected computeTitle(): string;
|
|
30
|
-
protected resolveCount(): Promise<number | undefined>;
|
|
31
|
-
protected tapNode(node?: TreeNode): void;
|
|
32
|
-
protected handleDblClickEvent(): void;
|
|
33
|
-
protected renderTree(model: TreeModel): React.ReactNode;
|
|
34
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
+
import { Message, TreeModel, TreeNode } from '@theia/core/lib/browser';
|
|
4
|
+
import { SourceTreeWidget } from '@theia/core/lib/browser/source-tree';
|
|
5
|
+
import { VSXExtensionsSource, VSXExtensionsSourceOptions } from './vsx-extensions-source';
|
|
6
|
+
import { BadgeWidget } from '@theia/core/lib/browser/view-container';
|
|
7
|
+
import { Emitter, Event } from '@theia/core/lib/common';
|
|
8
|
+
import * as React from '@theia/core/shared/react';
|
|
9
|
+
export declare class VSXExtensionsWidgetOptions extends VSXExtensionsSourceOptions {
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const generateExtensionWidgetId: (widgetId: string) => string;
|
|
13
|
+
export declare class VSXExtensionsWidget extends SourceTreeWidget implements BadgeWidget {
|
|
14
|
+
static ID: string;
|
|
15
|
+
static createWidget(parent: interfaces.Container, options: VSXExtensionsWidgetOptions): VSXExtensionsWidget;
|
|
16
|
+
protected _badge?: number;
|
|
17
|
+
protected onDidChangeBadgeEmitter: Emitter<void>;
|
|
18
|
+
protected _badgeTooltip?: string;
|
|
19
|
+
protected onDidChangeBadgeTooltipEmitter: Emitter<void>;
|
|
20
|
+
protected readonly options: VSXExtensionsWidgetOptions;
|
|
21
|
+
protected readonly extensionsSource: VSXExtensionsSource;
|
|
22
|
+
protected init(): void;
|
|
23
|
+
get onDidChangeBadge(): Event<void>;
|
|
24
|
+
get badge(): number | undefined;
|
|
25
|
+
set badge(count: number | undefined);
|
|
26
|
+
get onDidChangeBadgeTooltip(): Event<void>;
|
|
27
|
+
get badgeTooltip(): string | undefined;
|
|
28
|
+
set badgeTooltip(tooltip: string | undefined);
|
|
29
|
+
protected computeTitle(): string;
|
|
30
|
+
protected resolveCount(): Promise<number | undefined>;
|
|
31
|
+
protected tapNode(node?: TreeNode): void;
|
|
32
|
+
protected handleDblClickEvent(): void;
|
|
33
|
+
protected renderTree(model: TreeModel): React.ReactNode;
|
|
34
|
+
protected onAfterShow(msg: Message): void;
|
|
35
|
+
}
|
|
35
36
|
//# sourceMappingURL=vsx-extensions-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vsx-extensions-widget.d.ts","sourceRoot":"","sources":["../../src/browser/vsx-extensions-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAc,UAAU,EAAyB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"vsx-extensions-widget.d.ts","sourceRoot":"","sources":["../../src/browser/vsx-extensions-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAc,UAAU,EAAyB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,qBACa,0BAA2B,SAAQ,0BAA0B;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,yBAAyB,aAAc,MAAM,KAAG,MAAiD,CAAC;AAE/G,qBACa,mBAAoB,SAAQ,gBAAiB,YAAW,WAAW;IAE5E,MAAM,CAAC,EAAE,SAAoB;IAE7B,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,0BAA0B,GAAG,mBAAmB;IAa3G,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,uBAAuB,gBAAuB;IAExD,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IACjC,SAAS,CAAC,8BAA8B,gBAAuB;IAG/D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;cAGtC,IAAI,IAAI,IAAI;IAkB/B,IAAI,gBAAgB,IAAI,KAAK,CAAC,IAAI,CAAC,CAElC;IAED,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAGlC;IAED,IAAI,uBAAuB,IAAI,KAAK,CAAC,IAAI,CAAC,CAEzC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAG3C;IAED,SAAS,CAAC,YAAY,IAAI,MAAM;cAehB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAQxC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI;cAK9B,mBAAmB,IAAI,IAAI;cAI3B,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS;cAgB7C,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CAQrD"}
|