@theia/vsx-registry 1.53.0-next.55 → 1.53.0-next.64

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.
Files changed (34) hide show
  1. package/README.md +45 -45
  2. package/package.json +10 -10
  3. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  4. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  5. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  6. package/src/browser/style/extensions.svg +4 -4
  7. package/src/browser/style/index.css +436 -436
  8. package/src/browser/vsx-extension-argument-processor.ts +32 -32
  9. package/src/browser/vsx-extension-commands.ts +68 -68
  10. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  11. package/src/browser/vsx-extension-editor.tsx +96 -96
  12. package/src/browser/vsx-extension.tsx +710 -710
  13. package/src/browser/vsx-extensions-contribution.ts +373 -373
  14. package/src/browser/vsx-extensions-model.ts +456 -456
  15. package/src/browser/vsx-extensions-preferences.ts +58 -58
  16. package/src/browser/vsx-extensions-search-bar.tsx +107 -107
  17. package/src/browser/vsx-extensions-search-model.ts +61 -61
  18. package/src/browser/vsx-extensions-source.ts +83 -83
  19. package/src/browser/vsx-extensions-view-container.ts +179 -179
  20. package/src/browser/vsx-extensions-widget.tsx +165 -165
  21. package/src/browser/vsx-language-quick-pick-service.ts +112 -112
  22. package/src/browser/vsx-registry-frontend-module.ts +113 -113
  23. package/src/common/index.ts +19 -19
  24. package/src/common/ovsx-client-provider.ts +35 -35
  25. package/src/common/vsx-environment.ts +28 -28
  26. package/src/common/vsx-extension-uri.ts +20 -20
  27. package/src/common/vsx-registry-common-module.ts +85 -85
  28. package/src/node/vsx-cli-deployer-participant.ts +46 -46
  29. package/src/node/vsx-cli.ts +55 -55
  30. package/src/node/vsx-environment-impl.ts +54 -54
  31. package/src/node/vsx-extension-resolver.ts +134 -134
  32. package/src/node/vsx-registry-backend-module.ts +38 -38
  33. package/src/node/vsx-remote-cli.ts +39 -39
  34. package/src/package.spec.ts +29 -29
@@ -1,179 +1,179 @@
1
- /********************************************************************************
2
- * Copyright (C) 2020 TypeFox and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- *******************************************************************************‚*/
16
-
17
- import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
- import { ViewContainer, PanelLayout, ViewContainerPart, Message, codicon } from '@theia/core/lib/browser';
19
- import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
20
- import { VSXExtensionsModel } from './vsx-extensions-model';
21
- import { VSXSearchMode } from './vsx-extensions-search-model';
22
- import { generateExtensionWidgetId } from './vsx-extensions-widget';
23
- import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
24
- import { VSXExtensionsCommands } from './vsx-extension-commands';
25
- import { nls } from '@theia/core/lib/common/nls';
26
-
27
- @injectable()
28
- export class VSXExtensionsViewContainer extends ViewContainer {
29
-
30
- static ID = 'vsx-extensions-view-container';
31
- static LABEL = nls.localizeByDefault('Extensions');
32
-
33
- override disableDNDBetweenContainers = true;
34
-
35
- @inject(VSXExtensionsSearchBar)
36
- protected readonly searchBar: VSXExtensionsSearchBar;
37
-
38
- @inject(VSXExtensionsModel)
39
- protected readonly model: VSXExtensionsModel;
40
-
41
- @postConstruct()
42
- protected override init(): void {
43
- super.init();
44
- this.id = VSXExtensionsViewContainer.ID;
45
- this.addClass('theia-vsx-extensions-view-container');
46
-
47
- this.setTitleOptions({
48
- label: VSXExtensionsViewContainer.LABEL,
49
- iconClass: codicon('extensions'),
50
- closeable: true
51
- });
52
- }
53
-
54
- protected override onActivateRequest(msg: Message): void {
55
- this.searchBar.activate();
56
- }
57
-
58
- protected override onAfterAttach(msg: Message): void {
59
- super.onBeforeAttach(msg);
60
- this.updateMode();
61
- this.toDisposeOnDetach.push(this.model.search.onDidChangeQuery(() => this.updateMode()));
62
- }
63
-
64
- protected override configureLayout(layout: PanelLayout): void {
65
- layout.addWidget(this.searchBar);
66
- super.configureLayout(layout);
67
- }
68
-
69
- protected currentMode: VSXSearchMode = VSXSearchMode.Initial;
70
- protected readonly lastModeState = new Map<VSXSearchMode, ViewContainer.State>();
71
-
72
- protected updateMode(): void {
73
- const currentMode = this.model.search.getModeForQuery();
74
- if (currentMode === this.currentMode) {
75
- return;
76
- }
77
- if (this.currentMode !== VSXSearchMode.Initial) {
78
- this.lastModeState.set(this.currentMode, super.doStoreState());
79
- }
80
- this.currentMode = currentMode;
81
- const lastState = this.lastModeState.get(currentMode);
82
- if (lastState) {
83
- super.doRestoreState(lastState);
84
- } else {
85
- for (const part of this.getParts()) {
86
- this.applyModeToPart(part);
87
- }
88
- }
89
-
90
- const specialWidgets = this.getWidgetsForMode();
91
- if (specialWidgets?.length) {
92
- const widgetChecker = new Set(specialWidgets);
93
- const relevantParts = this.getParts().filter(part => widgetChecker.has(part.wrapped.id));
94
- relevantParts.forEach(part => {
95
- part.collapsed = false;
96
- part.show();
97
- });
98
- }
99
- }
100
-
101
- protected override registerPart(part: ViewContainerPart): void {
102
- super.registerPart(part);
103
- this.applyModeToPart(part);
104
- }
105
-
106
- protected applyModeToPart(part: ViewContainerPart): void {
107
- if (this.shouldShowWidget(part)) {
108
- part.show();
109
- } else {
110
- part.hide();
111
- }
112
- }
113
-
114
- protected shouldShowWidget(part: ViewContainerPart): boolean {
115
- const widgetsToShow = this.getWidgetsForMode();
116
- if (widgetsToShow.length) {
117
- return widgetsToShow.includes(part.wrapped.id);
118
- }
119
- return part.wrapped.id !== generateExtensionWidgetId(VSXExtensionsSourceOptions.SEARCH_RESULT);
120
- }
121
-
122
- protected getWidgetsForMode(): string[] {
123
- switch (this.currentMode) {
124
- case VSXSearchMode.Builtin:
125
- return [generateExtensionWidgetId(VSXExtensionsSourceOptions.BUILT_IN)];
126
- case VSXSearchMode.Installed:
127
- return [generateExtensionWidgetId(VSXExtensionsSourceOptions.INSTALLED)];
128
- case VSXSearchMode.Recommended:
129
- return [generateExtensionWidgetId(VSXExtensionsSourceOptions.RECOMMENDED)];
130
- case VSXSearchMode.Search:
131
- return [generateExtensionWidgetId(VSXExtensionsSourceOptions.SEARCH_RESULT)];
132
- default:
133
- return [];
134
- }
135
- }
136
-
137
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
- protected override doStoreState(): any {
139
- const modes: VSXExtensionsViewContainer.State['modes'] = {};
140
- for (const mode of this.lastModeState.keys()) {
141
- modes[mode] = this.lastModeState.get(mode);
142
- }
143
- return {
144
- query: this.model.search.query,
145
- modes
146
- };
147
- }
148
-
149
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
150
- protected override doRestoreState(state: any): void {
151
- // eslint-disable-next-line guard-for-in
152
- for (const key in state.modes) {
153
- const mode = Number(key) as VSXSearchMode;
154
- const modeState = state.modes[mode];
155
- if (modeState) {
156
- this.lastModeState.set(mode, modeState);
157
- }
158
- }
159
- this.model.search.query = state.query;
160
- }
161
-
162
- protected override updateToolbarItems(allParts: ViewContainerPart[]): void {
163
- super.updateToolbarItems(allParts);
164
- this.registerToolbarItem(VSXExtensionsCommands.INSTALL_FROM_VSIX.id, { tooltip: VSXExtensionsCommands.INSTALL_FROM_VSIX.label, group: 'other_1' });
165
- this.registerToolbarItem(VSXExtensionsCommands.CLEAR_ALL.id, { tooltip: VSXExtensionsCommands.CLEAR_ALL.label, priority: 1, onDidChange: this.model.onDidChange });
166
- }
167
-
168
- protected override getToggleVisibilityGroupLabel(): string {
169
- return 'a/' + nls.localizeByDefault('Views');
170
- }
171
- }
172
- export namespace VSXExtensionsViewContainer {
173
- export interface State {
174
- query: string;
175
- modes: {
176
- [mode: number]: ViewContainer.State | undefined
177
- }
178
- }
179
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2020 TypeFox and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ *******************************************************************************‚*/
16
+
17
+ import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
18
+ import { ViewContainer, PanelLayout, ViewContainerPart, Message, codicon } from '@theia/core/lib/browser';
19
+ import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
20
+ import { VSXExtensionsModel } from './vsx-extensions-model';
21
+ import { VSXSearchMode } from './vsx-extensions-search-model';
22
+ import { generateExtensionWidgetId } from './vsx-extensions-widget';
23
+ import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
24
+ import { VSXExtensionsCommands } from './vsx-extension-commands';
25
+ import { nls } from '@theia/core/lib/common/nls';
26
+
27
+ @injectable()
28
+ export class VSXExtensionsViewContainer extends ViewContainer {
29
+
30
+ static ID = 'vsx-extensions-view-container';
31
+ static LABEL = nls.localizeByDefault('Extensions');
32
+
33
+ override disableDNDBetweenContainers = true;
34
+
35
+ @inject(VSXExtensionsSearchBar)
36
+ protected readonly searchBar: VSXExtensionsSearchBar;
37
+
38
+ @inject(VSXExtensionsModel)
39
+ protected readonly model: VSXExtensionsModel;
40
+
41
+ @postConstruct()
42
+ protected override init(): void {
43
+ super.init();
44
+ this.id = VSXExtensionsViewContainer.ID;
45
+ this.addClass('theia-vsx-extensions-view-container');
46
+
47
+ this.setTitleOptions({
48
+ label: VSXExtensionsViewContainer.LABEL,
49
+ iconClass: codicon('extensions'),
50
+ closeable: true
51
+ });
52
+ }
53
+
54
+ protected override onActivateRequest(msg: Message): void {
55
+ this.searchBar.activate();
56
+ }
57
+
58
+ protected override onAfterAttach(msg: Message): void {
59
+ super.onBeforeAttach(msg);
60
+ this.updateMode();
61
+ this.toDisposeOnDetach.push(this.model.search.onDidChangeQuery(() => this.updateMode()));
62
+ }
63
+
64
+ protected override configureLayout(layout: PanelLayout): void {
65
+ layout.addWidget(this.searchBar);
66
+ super.configureLayout(layout);
67
+ }
68
+
69
+ protected currentMode: VSXSearchMode = VSXSearchMode.Initial;
70
+ protected readonly lastModeState = new Map<VSXSearchMode, ViewContainer.State>();
71
+
72
+ protected updateMode(): void {
73
+ const currentMode = this.model.search.getModeForQuery();
74
+ if (currentMode === this.currentMode) {
75
+ return;
76
+ }
77
+ if (this.currentMode !== VSXSearchMode.Initial) {
78
+ this.lastModeState.set(this.currentMode, super.doStoreState());
79
+ }
80
+ this.currentMode = currentMode;
81
+ const lastState = this.lastModeState.get(currentMode);
82
+ if (lastState) {
83
+ super.doRestoreState(lastState);
84
+ } else {
85
+ for (const part of this.getParts()) {
86
+ this.applyModeToPart(part);
87
+ }
88
+ }
89
+
90
+ const specialWidgets = this.getWidgetsForMode();
91
+ if (specialWidgets?.length) {
92
+ const widgetChecker = new Set(specialWidgets);
93
+ const relevantParts = this.getParts().filter(part => widgetChecker.has(part.wrapped.id));
94
+ relevantParts.forEach(part => {
95
+ part.collapsed = false;
96
+ part.show();
97
+ });
98
+ }
99
+ }
100
+
101
+ protected override registerPart(part: ViewContainerPart): void {
102
+ super.registerPart(part);
103
+ this.applyModeToPart(part);
104
+ }
105
+
106
+ protected applyModeToPart(part: ViewContainerPart): void {
107
+ if (this.shouldShowWidget(part)) {
108
+ part.show();
109
+ } else {
110
+ part.hide();
111
+ }
112
+ }
113
+
114
+ protected shouldShowWidget(part: ViewContainerPart): boolean {
115
+ const widgetsToShow = this.getWidgetsForMode();
116
+ if (widgetsToShow.length) {
117
+ return widgetsToShow.includes(part.wrapped.id);
118
+ }
119
+ return part.wrapped.id !== generateExtensionWidgetId(VSXExtensionsSourceOptions.SEARCH_RESULT);
120
+ }
121
+
122
+ protected getWidgetsForMode(): string[] {
123
+ switch (this.currentMode) {
124
+ case VSXSearchMode.Builtin:
125
+ return [generateExtensionWidgetId(VSXExtensionsSourceOptions.BUILT_IN)];
126
+ case VSXSearchMode.Installed:
127
+ return [generateExtensionWidgetId(VSXExtensionsSourceOptions.INSTALLED)];
128
+ case VSXSearchMode.Recommended:
129
+ return [generateExtensionWidgetId(VSXExtensionsSourceOptions.RECOMMENDED)];
130
+ case VSXSearchMode.Search:
131
+ return [generateExtensionWidgetId(VSXExtensionsSourceOptions.SEARCH_RESULT)];
132
+ default:
133
+ return [];
134
+ }
135
+ }
136
+
137
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
+ protected override doStoreState(): any {
139
+ const modes: VSXExtensionsViewContainer.State['modes'] = {};
140
+ for (const mode of this.lastModeState.keys()) {
141
+ modes[mode] = this.lastModeState.get(mode);
142
+ }
143
+ return {
144
+ query: this.model.search.query,
145
+ modes
146
+ };
147
+ }
148
+
149
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
150
+ protected override doRestoreState(state: any): void {
151
+ // eslint-disable-next-line guard-for-in
152
+ for (const key in state.modes) {
153
+ const mode = Number(key) as VSXSearchMode;
154
+ const modeState = state.modes[mode];
155
+ if (modeState) {
156
+ this.lastModeState.set(mode, modeState);
157
+ }
158
+ }
159
+ this.model.search.query = state.query;
160
+ }
161
+
162
+ protected override updateToolbarItems(allParts: ViewContainerPart[]): void {
163
+ super.updateToolbarItems(allParts);
164
+ this.registerToolbarItem(VSXExtensionsCommands.INSTALL_FROM_VSIX.id, { tooltip: VSXExtensionsCommands.INSTALL_FROM_VSIX.label, group: 'other_1' });
165
+ this.registerToolbarItem(VSXExtensionsCommands.CLEAR_ALL.id, { tooltip: VSXExtensionsCommands.CLEAR_ALL.label, priority: 1, onDidChange: this.model.onDidChange });
166
+ }
167
+
168
+ protected override getToggleVisibilityGroupLabel(): string {
169
+ return 'a/' + nls.localizeByDefault('Views');
170
+ }
171
+ }
172
+ export namespace VSXExtensionsViewContainer {
173
+ export interface State {
174
+ query: string;
175
+ modes: {
176
+ [mode: number]: ViewContainer.State | undefined
177
+ }
178
+ }
179
+ }