@theia/vsx-registry 1.34.2 → 1.34.3

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 (73) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +36 -36
  3. package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
  4. package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
  5. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
  6. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
  7. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
  8. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
  9. package/lib/browser/vsx-extension-commands.d.ts +13 -13
  10. package/lib/browser/vsx-extension-commands.js +63 -63
  11. package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
  12. package/lib/browser/vsx-extension-editor-manager.js +49 -49
  13. package/lib/browser/vsx-extension-editor.d.ts +21 -21
  14. package/lib/browser/vsx-extension-editor.js +109 -109
  15. package/lib/browser/vsx-extension.d.ts +141 -141
  16. package/lib/browser/vsx-extension.js +581 -581
  17. package/lib/browser/vsx-extensions-contribution.d.ts +54 -54
  18. package/lib/browser/vsx-extensions-contribution.js +328 -328
  19. package/lib/browser/vsx-extensions-model.d.ts +67 -67
  20. package/lib/browser/vsx-extensions-model.js +368 -368
  21. package/lib/browser/vsx-extensions-search-bar.d.ts +14 -14
  22. package/lib/browser/vsx-extensions-search-bar.js +75 -75
  23. package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
  24. package/lib/browser/vsx-extensions-search-model.js +70 -70
  25. package/lib/browser/vsx-extensions-source.d.ts +19 -19
  26. package/lib/browser/vsx-extensions-source.js +102 -102
  27. package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
  28. package/lib/browser/vsx-extensions-view-container.js +179 -179
  29. package/lib/browser/vsx-extensions-widget.d.ts +29 -29
  30. package/lib/browser/vsx-extensions-widget.js +143 -143
  31. package/lib/browser/vsx-language-quick-pick-service.d.ts +13 -13
  32. package/lib/browser/vsx-language-quick-pick-service.js +103 -103
  33. package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
  34. package/lib/browser/vsx-registry-frontend-module.js +101 -101
  35. package/lib/common/ovsx-client-provider.d.ts +6 -6
  36. package/lib/common/ovsx-client-provider.js +28 -28
  37. package/lib/common/vsx-environment.d.ts +7 -7
  38. package/lib/common/vsx-environment.js +20 -20
  39. package/lib/common/vsx-extension-uri.d.ts +3 -3
  40. package/lib/common/vsx-extension-uri.js +20 -20
  41. package/lib/node/vsx-environment-impl.d.ts +10 -10
  42. package/lib/node/vsx-environment-impl.js +53 -53
  43. package/lib/node/vsx-extension-resolver.d.ts +17 -17
  44. package/lib/node/vsx-extension-resolver.js +137 -137
  45. package/lib/node/vsx-registry-backend-module.d.ts +3 -3
  46. package/lib/node/vsx-registry-backend-module.js +35 -35
  47. package/lib/package.spec.js +25 -25
  48. package/package.json +10 -10
  49. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  50. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  51. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  52. package/src/browser/style/extensions.svg +4 -4
  53. package/src/browser/style/index.css +354 -354
  54. package/src/browser/vsx-extension-commands.ts +63 -63
  55. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  56. package/src/browser/vsx-extension-editor.tsx +96 -96
  57. package/src/browser/vsx-extension.tsx +662 -662
  58. package/src/browser/vsx-extensions-contribution.ts +315 -315
  59. package/src/browser/vsx-extensions-model.ts +366 -366
  60. package/src/browser/vsx-extensions-search-bar.tsx +69 -69
  61. package/src/browser/vsx-extensions-search-model.ts +61 -61
  62. package/src/browser/vsx-extensions-source.ts +83 -83
  63. package/src/browser/vsx-extensions-view-container.ts +179 -179
  64. package/src/browser/vsx-extensions-widget.tsx +138 -138
  65. package/src/browser/vsx-language-quick-pick-service.ts +97 -97
  66. package/src/browser/vsx-registry-frontend-module.ts +113 -113
  67. package/src/common/ovsx-client-provider.ts +30 -30
  68. package/src/common/vsx-environment.ts +24 -24
  69. package/src/common/vsx-extension-uri.ts +20 -20
  70. package/src/node/vsx-environment-impl.ts +41 -41
  71. package/src/node/vsx-extension-resolver.ts +111 -111
  72. package/src/node/vsx-registry-backend-module.ts +37 -37
  73. package/src/package.spec.ts +29 -29
@@ -1,15 +1,15 @@
1
- /// <reference types="react" />
2
- import * as React from '@theia/core/shared/react';
3
- import { ReactWidget, Message } from '@theia/core/lib/browser/widgets';
4
- import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
5
- export declare class VSXExtensionsSearchBar extends ReactWidget {
6
- protected readonly model: VSXExtensionsSearchModel;
7
- protected init(): void;
8
- protected input: HTMLInputElement | undefined;
9
- protected render(): React.ReactNode;
10
- protected updateQuery: (e: React.ChangeEvent<HTMLInputElement>) => string;
11
- protected updateSearchTerm(term: string): void;
12
- protected onActivateRequest(msg: Message): void;
13
- protected onAfterAttach(msg: Message): void;
14
- }
1
+ /// <reference types="react" />
2
+ import * as React from '@theia/core/shared/react';
3
+ import { ReactWidget, Message } from '@theia/core/lib/browser/widgets';
4
+ import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
5
+ export declare class VSXExtensionsSearchBar extends ReactWidget {
6
+ protected readonly model: VSXExtensionsSearchModel;
7
+ protected init(): void;
8
+ protected input: HTMLInputElement | undefined;
9
+ protected render(): React.ReactNode;
10
+ protected updateQuery: (e: React.ChangeEvent<HTMLInputElement>) => string;
11
+ protected updateSearchTerm(term: string): void;
12
+ protected onActivateRequest(msg: Message): void;
13
+ protected onAfterAttach(msg: Message): void;
14
+ }
15
15
  //# sourceMappingURL=vsx-extensions-search-bar.d.ts.map
@@ -1,76 +1,76 @@
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 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
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.VSXExtensionsSearchBar = void 0;
28
- const React = require("@theia/core/shared/react");
29
- const inversify_1 = require("@theia/core/shared/inversify");
30
- const widgets_1 = require("@theia/core/lib/browser/widgets");
31
- const vsx_extensions_search_model_1 = require("./vsx-extensions-search-model");
32
- const nls_1 = require("@theia/core/lib/common/nls");
33
- let VSXExtensionsSearchBar = class VSXExtensionsSearchBar extends widgets_1.ReactWidget {
34
- constructor() {
35
- super(...arguments);
36
- this.updateQuery = (e) => this.model.query = e.target.value;
37
- }
38
- init() {
39
- this.id = 'vsx-extensions-search-bar';
40
- this.addClass('theia-vsx-extensions-search-bar');
41
- this.model.onDidChangeQuery((query) => this.updateSearchTerm(query));
42
- }
43
- render() {
44
- return React.createElement("input", { type: 'text', ref: input => this.input = input || undefined, defaultValue: this.model.query, spellCheck: false, className: 'theia-input', placeholder: nls_1.nls.localize('theia/vsx-registry/searchPlaceholder', 'Search Extensions in {0}', 'Open VSX Registry'), onChange: this.updateQuery });
45
- }
46
- updateSearchTerm(term) {
47
- if (this.input) {
48
- this.input.value = term;
49
- }
50
- }
51
- onActivateRequest(msg) {
52
- super.onActivateRequest(msg);
53
- if (this.input) {
54
- this.input.focus();
55
- }
56
- }
57
- onAfterAttach(msg) {
58
- super.onAfterAttach(msg);
59
- this.update();
60
- }
61
- };
62
- __decorate([
63
- (0, inversify_1.inject)(vsx_extensions_search_model_1.VSXExtensionsSearchModel),
64
- __metadata("design:type", vsx_extensions_search_model_1.VSXExtensionsSearchModel)
65
- ], VSXExtensionsSearchBar.prototype, "model", void 0);
66
- __decorate([
67
- (0, inversify_1.postConstruct)(),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", []),
70
- __metadata("design:returntype", void 0)
71
- ], VSXExtensionsSearchBar.prototype, "init", null);
72
- VSXExtensionsSearchBar = __decorate([
73
- (0, inversify_1.injectable)()
74
- ], VSXExtensionsSearchBar);
75
- exports.VSXExtensionsSearchBar = VSXExtensionsSearchBar;
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 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
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.VSXExtensionsSearchBar = void 0;
28
+ const React = require("@theia/core/shared/react");
29
+ const inversify_1 = require("@theia/core/shared/inversify");
30
+ const widgets_1 = require("@theia/core/lib/browser/widgets");
31
+ const vsx_extensions_search_model_1 = require("./vsx-extensions-search-model");
32
+ const nls_1 = require("@theia/core/lib/common/nls");
33
+ let VSXExtensionsSearchBar = class VSXExtensionsSearchBar extends widgets_1.ReactWidget {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.updateQuery = (e) => this.model.query = e.target.value;
37
+ }
38
+ init() {
39
+ this.id = 'vsx-extensions-search-bar';
40
+ this.addClass('theia-vsx-extensions-search-bar');
41
+ this.model.onDidChangeQuery((query) => this.updateSearchTerm(query));
42
+ }
43
+ render() {
44
+ return React.createElement("input", { type: 'text', ref: input => this.input = input || undefined, defaultValue: this.model.query, spellCheck: false, className: 'theia-input', placeholder: nls_1.nls.localize('theia/vsx-registry/searchPlaceholder', 'Search Extensions in {0}', 'Open VSX Registry'), onChange: this.updateQuery });
45
+ }
46
+ updateSearchTerm(term) {
47
+ if (this.input) {
48
+ this.input.value = term;
49
+ }
50
+ }
51
+ onActivateRequest(msg) {
52
+ super.onActivateRequest(msg);
53
+ if (this.input) {
54
+ this.input.focus();
55
+ }
56
+ }
57
+ onAfterAttach(msg) {
58
+ super.onAfterAttach(msg);
59
+ this.update();
60
+ }
61
+ };
62
+ __decorate([
63
+ (0, inversify_1.inject)(vsx_extensions_search_model_1.VSXExtensionsSearchModel),
64
+ __metadata("design:type", vsx_extensions_search_model_1.VSXExtensionsSearchModel)
65
+ ], VSXExtensionsSearchBar.prototype, "model", void 0);
66
+ __decorate([
67
+ (0, inversify_1.postConstruct)(),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", []),
70
+ __metadata("design:returntype", void 0)
71
+ ], VSXExtensionsSearchBar.prototype, "init", null);
72
+ VSXExtensionsSearchBar = __decorate([
73
+ (0, inversify_1.injectable)()
74
+ ], VSXExtensionsSearchBar);
75
+ exports.VSXExtensionsSearchBar = VSXExtensionsSearchBar;
76
76
  //# sourceMappingURL=vsx-extensions-search-bar.js.map
@@ -1,22 +1,22 @@
1
- import { Emitter } from '@theia/core/lib/common/event';
2
- export declare enum VSXSearchMode {
3
- Initial = 0,
4
- None = 1,
5
- Search = 2,
6
- Installed = 3,
7
- Builtin = 4,
8
- Recommended = 5
9
- }
10
- export declare const BUILTIN_QUERY = "@builtin";
11
- export declare const INSTALLED_QUERY = "@installed";
12
- export declare const RECOMMENDED_QUERY = "@recommended";
13
- export declare class VSXExtensionsSearchModel {
14
- protected readonly onDidChangeQueryEmitter: Emitter<string>;
15
- readonly onDidChangeQuery: import("@theia/core/lib/common/event").Event<string>;
16
- protected readonly specialQueries: Map<string, VSXSearchMode>;
17
- protected _query: string;
18
- set query(query: string);
19
- get query(): string;
20
- getModeForQuery(): VSXSearchMode;
21
- }
1
+ import { Emitter } from '@theia/core/lib/common/event';
2
+ export declare enum VSXSearchMode {
3
+ Initial = 0,
4
+ None = 1,
5
+ Search = 2,
6
+ Installed = 3,
7
+ Builtin = 4,
8
+ Recommended = 5
9
+ }
10
+ export declare const BUILTIN_QUERY = "@builtin";
11
+ export declare const INSTALLED_QUERY = "@installed";
12
+ export declare const RECOMMENDED_QUERY = "@recommended";
13
+ export declare class VSXExtensionsSearchModel {
14
+ protected readonly onDidChangeQueryEmitter: Emitter<string>;
15
+ readonly onDidChangeQuery: import("@theia/core/lib/common/event").Event<string>;
16
+ protected readonly specialQueries: Map<string, VSXSearchMode>;
17
+ protected _query: string;
18
+ set query(query: string);
19
+ get query(): string;
20
+ getModeForQuery(): VSXSearchMode;
21
+ }
22
22
  //# sourceMappingURL=vsx-extensions-search-model.d.ts.map
@@ -1,71 +1,71 @@
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 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
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.VSXExtensionsSearchModel = exports.RECOMMENDED_QUERY = exports.INSTALLED_QUERY = exports.BUILTIN_QUERY = exports.VSXSearchMode = void 0;
25
- const inversify_1 = require("@theia/core/shared/inversify");
26
- const event_1 = require("@theia/core/lib/common/event");
27
- var VSXSearchMode;
28
- (function (VSXSearchMode) {
29
- VSXSearchMode[VSXSearchMode["Initial"] = 0] = "Initial";
30
- VSXSearchMode[VSXSearchMode["None"] = 1] = "None";
31
- VSXSearchMode[VSXSearchMode["Search"] = 2] = "Search";
32
- VSXSearchMode[VSXSearchMode["Installed"] = 3] = "Installed";
33
- VSXSearchMode[VSXSearchMode["Builtin"] = 4] = "Builtin";
34
- VSXSearchMode[VSXSearchMode["Recommended"] = 5] = "Recommended";
35
- })(VSXSearchMode = exports.VSXSearchMode || (exports.VSXSearchMode = {}));
36
- exports.BUILTIN_QUERY = '@builtin';
37
- exports.INSTALLED_QUERY = '@installed';
38
- exports.RECOMMENDED_QUERY = '@recommended';
39
- let VSXExtensionsSearchModel = class VSXExtensionsSearchModel {
40
- constructor() {
41
- this.onDidChangeQueryEmitter = new event_1.Emitter();
42
- this.onDidChangeQuery = this.onDidChangeQueryEmitter.event;
43
- this.specialQueries = new Map([
44
- [exports.BUILTIN_QUERY, VSXSearchMode.Builtin],
45
- [exports.INSTALLED_QUERY, VSXSearchMode.Installed],
46
- [exports.RECOMMENDED_QUERY, VSXSearchMode.Recommended],
47
- ]);
48
- this._query = '';
49
- }
50
- set query(query) {
51
- if (this._query === query) {
52
- return;
53
- }
54
- this._query = query;
55
- this.onDidChangeQueryEmitter.fire(this._query);
56
- }
57
- get query() {
58
- return this._query;
59
- }
60
- getModeForQuery() {
61
- var _a;
62
- return this.query
63
- ? (_a = this.specialQueries.get(this.query)) !== null && _a !== void 0 ? _a : VSXSearchMode.Search
64
- : VSXSearchMode.None;
65
- }
66
- };
67
- VSXExtensionsSearchModel = __decorate([
68
- (0, inversify_1.injectable)()
69
- ], VSXExtensionsSearchModel);
70
- exports.VSXExtensionsSearchModel = VSXExtensionsSearchModel;
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 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
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.VSXExtensionsSearchModel = exports.RECOMMENDED_QUERY = exports.INSTALLED_QUERY = exports.BUILTIN_QUERY = exports.VSXSearchMode = void 0;
25
+ const inversify_1 = require("@theia/core/shared/inversify");
26
+ const event_1 = require("@theia/core/lib/common/event");
27
+ var VSXSearchMode;
28
+ (function (VSXSearchMode) {
29
+ VSXSearchMode[VSXSearchMode["Initial"] = 0] = "Initial";
30
+ VSXSearchMode[VSXSearchMode["None"] = 1] = "None";
31
+ VSXSearchMode[VSXSearchMode["Search"] = 2] = "Search";
32
+ VSXSearchMode[VSXSearchMode["Installed"] = 3] = "Installed";
33
+ VSXSearchMode[VSXSearchMode["Builtin"] = 4] = "Builtin";
34
+ VSXSearchMode[VSXSearchMode["Recommended"] = 5] = "Recommended";
35
+ })(VSXSearchMode = exports.VSXSearchMode || (exports.VSXSearchMode = {}));
36
+ exports.BUILTIN_QUERY = '@builtin';
37
+ exports.INSTALLED_QUERY = '@installed';
38
+ exports.RECOMMENDED_QUERY = '@recommended';
39
+ let VSXExtensionsSearchModel = class VSXExtensionsSearchModel {
40
+ constructor() {
41
+ this.onDidChangeQueryEmitter = new event_1.Emitter();
42
+ this.onDidChangeQuery = this.onDidChangeQueryEmitter.event;
43
+ this.specialQueries = new Map([
44
+ [exports.BUILTIN_QUERY, VSXSearchMode.Builtin],
45
+ [exports.INSTALLED_QUERY, VSXSearchMode.Installed],
46
+ [exports.RECOMMENDED_QUERY, VSXSearchMode.Recommended],
47
+ ]);
48
+ this._query = '';
49
+ }
50
+ set query(query) {
51
+ if (this._query === query) {
52
+ return;
53
+ }
54
+ this._query = query;
55
+ this.onDidChangeQueryEmitter.fire(this._query);
56
+ }
57
+ get query() {
58
+ return this._query;
59
+ }
60
+ getModeForQuery() {
61
+ var _a;
62
+ return this.query
63
+ ? (_a = this.specialQueries.get(this.query)) !== null && _a !== void 0 ? _a : VSXSearchMode.Search
64
+ : VSXSearchMode.None;
65
+ }
66
+ };
67
+ VSXExtensionsSearchModel = __decorate([
68
+ (0, inversify_1.injectable)()
69
+ ], VSXExtensionsSearchModel);
70
+ exports.VSXExtensionsSearchModel = VSXExtensionsSearchModel;
71
71
  //# sourceMappingURL=vsx-extensions-search-model.js.map
@@ -1,20 +1,20 @@
1
- /// <reference types="lodash" />
2
- import { TreeSource, TreeElement } from '@theia/core/lib/browser/source-tree';
3
- import { VSXExtensionsModel } from './vsx-extensions-model';
4
- export declare class VSXExtensionsSourceOptions {
5
- static INSTALLED: string;
6
- static BUILT_IN: string;
7
- static SEARCH_RESULT: string;
8
- static RECOMMENDED: string;
9
- readonly id: string;
10
- }
11
- export declare class VSXExtensionsSource extends TreeSource {
12
- protected readonly options: VSXExtensionsSourceOptions;
13
- protected readonly model: VSXExtensionsModel;
14
- protected init(): Promise<void>;
15
- protected scheduleFireDidChange: import("lodash").DebouncedFunc<() => void>;
16
- getModel(): VSXExtensionsModel;
17
- getElements(): IterableIterator<TreeElement>;
18
- protected doGetElements(): IterableIterator<string>;
19
- }
1
+ /// <reference types="lodash" />
2
+ import { TreeSource, TreeElement } from '@theia/core/lib/browser/source-tree';
3
+ import { VSXExtensionsModel } from './vsx-extensions-model';
4
+ export declare class VSXExtensionsSourceOptions {
5
+ static INSTALLED: string;
6
+ static BUILT_IN: string;
7
+ static SEARCH_RESULT: string;
8
+ static RECOMMENDED: string;
9
+ readonly id: string;
10
+ }
11
+ export declare class VSXExtensionsSource extends TreeSource {
12
+ protected readonly options: VSXExtensionsSourceOptions;
13
+ protected readonly model: VSXExtensionsModel;
14
+ protected init(): Promise<void>;
15
+ protected scheduleFireDidChange: import("lodash").DebouncedFunc<() => void>;
16
+ getModel(): VSXExtensionsModel;
17
+ getElements(): IterableIterator<TreeElement>;
18
+ protected doGetElements(): IterableIterator<string>;
19
+ }
20
20
  //# sourceMappingURL=vsx-extensions-source.d.ts.map
@@ -1,103 +1,103 @@
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 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
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.VSXExtensionsSource = exports.VSXExtensionsSourceOptions = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const source_tree_1 = require("@theia/core/lib/browser/source-tree");
30
- const vsx_extensions_model_1 = require("./vsx-extensions-model");
31
- const debounce = require("@theia/core/shared/lodash.debounce");
32
- let VSXExtensionsSourceOptions = class VSXExtensionsSourceOptions {
33
- };
34
- VSXExtensionsSourceOptions.INSTALLED = 'installed';
35
- VSXExtensionsSourceOptions.BUILT_IN = 'builtin';
36
- VSXExtensionsSourceOptions.SEARCH_RESULT = 'searchResult';
37
- VSXExtensionsSourceOptions.RECOMMENDED = 'recommended';
38
- VSXExtensionsSourceOptions = __decorate([
39
- (0, inversify_1.injectable)()
40
- ], VSXExtensionsSourceOptions);
41
- exports.VSXExtensionsSourceOptions = VSXExtensionsSourceOptions;
42
- let VSXExtensionsSource = class VSXExtensionsSource extends source_tree_1.TreeSource {
43
- constructor() {
44
- super(...arguments);
45
- this.scheduleFireDidChange = debounce(() => this.fireDidChange(), 100, { leading: false, trailing: true });
46
- }
47
- async init() {
48
- this.fireDidChange();
49
- this.toDispose.push(this.model.onDidChange(() => this.scheduleFireDidChange()));
50
- }
51
- getModel() {
52
- return this.model;
53
- }
54
- *getElements() {
55
- for (const id of this.doGetElements()) {
56
- const extension = this.model.getExtension(id);
57
- if (!extension) {
58
- continue;
59
- }
60
- if (this.options.id === VSXExtensionsSourceOptions.RECOMMENDED) {
61
- if (this.model.isInstalled(id)) {
62
- continue;
63
- }
64
- }
65
- if (this.options.id === VSXExtensionsSourceOptions.BUILT_IN) {
66
- if (extension.builtin) {
67
- yield extension;
68
- }
69
- }
70
- else if (!extension.builtin) {
71
- yield extension;
72
- }
73
- }
74
- }
75
- doGetElements() {
76
- if (this.options.id === VSXExtensionsSourceOptions.SEARCH_RESULT) {
77
- return this.model.searchResult;
78
- }
79
- if (this.options.id === VSXExtensionsSourceOptions.RECOMMENDED) {
80
- return this.model.recommended;
81
- }
82
- return this.model.installed;
83
- }
84
- };
85
- __decorate([
86
- (0, inversify_1.inject)(VSXExtensionsSourceOptions),
87
- __metadata("design:type", VSXExtensionsSourceOptions)
88
- ], VSXExtensionsSource.prototype, "options", void 0);
89
- __decorate([
90
- (0, inversify_1.inject)(vsx_extensions_model_1.VSXExtensionsModel),
91
- __metadata("design:type", vsx_extensions_model_1.VSXExtensionsModel)
92
- ], VSXExtensionsSource.prototype, "model", void 0);
93
- __decorate([
94
- (0, inversify_1.postConstruct)(),
95
- __metadata("design:type", Function),
96
- __metadata("design:paramtypes", []),
97
- __metadata("design:returntype", Promise)
98
- ], VSXExtensionsSource.prototype, "init", null);
99
- VSXExtensionsSource = __decorate([
100
- (0, inversify_1.injectable)()
101
- ], VSXExtensionsSource);
102
- exports.VSXExtensionsSource = VSXExtensionsSource;
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 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
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.VSXExtensionsSource = exports.VSXExtensionsSourceOptions = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const source_tree_1 = require("@theia/core/lib/browser/source-tree");
30
+ const vsx_extensions_model_1 = require("./vsx-extensions-model");
31
+ const debounce = require("@theia/core/shared/lodash.debounce");
32
+ let VSXExtensionsSourceOptions = class VSXExtensionsSourceOptions {
33
+ };
34
+ VSXExtensionsSourceOptions.INSTALLED = 'installed';
35
+ VSXExtensionsSourceOptions.BUILT_IN = 'builtin';
36
+ VSXExtensionsSourceOptions.SEARCH_RESULT = 'searchResult';
37
+ VSXExtensionsSourceOptions.RECOMMENDED = 'recommended';
38
+ VSXExtensionsSourceOptions = __decorate([
39
+ (0, inversify_1.injectable)()
40
+ ], VSXExtensionsSourceOptions);
41
+ exports.VSXExtensionsSourceOptions = VSXExtensionsSourceOptions;
42
+ let VSXExtensionsSource = class VSXExtensionsSource extends source_tree_1.TreeSource {
43
+ constructor() {
44
+ super(...arguments);
45
+ this.scheduleFireDidChange = debounce(() => this.fireDidChange(), 100, { leading: false, trailing: true });
46
+ }
47
+ async init() {
48
+ this.fireDidChange();
49
+ this.toDispose.push(this.model.onDidChange(() => this.scheduleFireDidChange()));
50
+ }
51
+ getModel() {
52
+ return this.model;
53
+ }
54
+ *getElements() {
55
+ for (const id of this.doGetElements()) {
56
+ const extension = this.model.getExtension(id);
57
+ if (!extension) {
58
+ continue;
59
+ }
60
+ if (this.options.id === VSXExtensionsSourceOptions.RECOMMENDED) {
61
+ if (this.model.isInstalled(id)) {
62
+ continue;
63
+ }
64
+ }
65
+ if (this.options.id === VSXExtensionsSourceOptions.BUILT_IN) {
66
+ if (extension.builtin) {
67
+ yield extension;
68
+ }
69
+ }
70
+ else if (!extension.builtin) {
71
+ yield extension;
72
+ }
73
+ }
74
+ }
75
+ doGetElements() {
76
+ if (this.options.id === VSXExtensionsSourceOptions.SEARCH_RESULT) {
77
+ return this.model.searchResult;
78
+ }
79
+ if (this.options.id === VSXExtensionsSourceOptions.RECOMMENDED) {
80
+ return this.model.recommended;
81
+ }
82
+ return this.model.installed;
83
+ }
84
+ };
85
+ __decorate([
86
+ (0, inversify_1.inject)(VSXExtensionsSourceOptions),
87
+ __metadata("design:type", VSXExtensionsSourceOptions)
88
+ ], VSXExtensionsSource.prototype, "options", void 0);
89
+ __decorate([
90
+ (0, inversify_1.inject)(vsx_extensions_model_1.VSXExtensionsModel),
91
+ __metadata("design:type", vsx_extensions_model_1.VSXExtensionsModel)
92
+ ], VSXExtensionsSource.prototype, "model", void 0);
93
+ __decorate([
94
+ (0, inversify_1.postConstruct)(),
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", []),
97
+ __metadata("design:returntype", Promise)
98
+ ], VSXExtensionsSource.prototype, "init", null);
99
+ VSXExtensionsSource = __decorate([
100
+ (0, inversify_1.injectable)()
101
+ ], VSXExtensionsSource);
102
+ exports.VSXExtensionsSource = VSXExtensionsSource;
103
103
  //# sourceMappingURL=vsx-extensions-source.js.map