@theia/scm-extra 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 (40) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +32 -32
  3. package/lib/browser/history/index.d.ts +3 -3
  4. package/lib/browser/history/index.js +31 -31
  5. package/lib/browser/history/scm-history-constants.d.ts +38 -38
  6. package/lib/browser/history/scm-history-constants.js +41 -41
  7. package/lib/browser/history/scm-history-contribution.d.ts +18 -18
  8. package/lib/browser/history/scm-history-contribution.js +101 -101
  9. package/lib/browser/history/scm-history-frontend-module.d.ts +3 -3
  10. package/lib/browser/history/scm-history-frontend-module.js +33 -33
  11. package/lib/browser/history/scm-history-provider.d.ts +8 -8
  12. package/lib/browser/history/scm-history-provider.js +25 -25
  13. package/lib/browser/history/scm-history-widget.d.ts +89 -89
  14. package/lib/browser/history/scm-history-widget.js +487 -487
  15. package/lib/browser/scm-extra-contribution.d.ts +1 -1
  16. package/lib/browser/scm-extra-contribution.js +20 -20
  17. package/lib/browser/scm-extra-frontend-module.d.ts +3 -3
  18. package/lib/browser/scm-extra-frontend-module.js +26 -26
  19. package/lib/browser/scm-extra-layout-migrations.d.ts +5 -5
  20. package/lib/browser/scm-extra-layout-migrations.js +42 -42
  21. package/lib/browser/scm-file-change-label-provider.d.ts +16 -16
  22. package/lib/browser/scm-file-change-label-provider.js +79 -79
  23. package/lib/browser/scm-file-change-node.d.ts +23 -23
  24. package/lib/browser/scm-file-change-node.js +26 -26
  25. package/lib/browser/scm-navigable-list-widget.d.ts +56 -56
  26. package/lib/browser/scm-navigable-list-widget.js +179 -179
  27. package/package.json +8 -8
  28. package/src/browser/history/index.ts +21 -21
  29. package/src/browser/history/scm-history-constants.ts +69 -69
  30. package/src/browser/history/scm-history-contribution.ts +90 -90
  31. package/src/browser/history/scm-history-frontend-module.ts +36 -36
  32. package/src/browser/history/scm-history-provider.ts +27 -27
  33. package/src/browser/history/scm-history-widget.tsx +566 -566
  34. package/src/browser/scm-extra-contribution.ts +18 -18
  35. package/src/browser/scm-extra-frontend-module.ts +27 -27
  36. package/src/browser/scm-extra-layout-migrations.ts +32 -32
  37. package/src/browser/scm-file-change-label-provider.ts +73 -73
  38. package/src/browser/scm-file-change-node.ts +45 -45
  39. package/src/browser/scm-navigable-list-widget.tsx +197 -197
  40. package/src/browser/style/history.css +127 -127
@@ -1,2 +1,2 @@
1
- export declare const EDITOR_CONTEXT_MENU_SCM: string[];
1
+ export declare const EDITOR_CONTEXT_MENU_SCM: string[];
2
2
  //# sourceMappingURL=scm-extra-contribution.d.ts.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EDITOR_CONTEXT_MENU_SCM = void 0;
4
- // *****************************************************************************
5
- // Copyright (C) 2019 Arm and others.
6
- //
7
- // This program and the accompanying materials are made available under the
8
- // terms of the Eclipse Public License v. 2.0 which is available at
9
- // http://www.eclipse.org/legal/epl-2.0.
10
- //
11
- // This Source Code may also be made available under the following Secondary
12
- // Licenses when the conditions for such availability set forth in the Eclipse
13
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- // with the GNU Classpath Exception which is available at
15
- // https://www.gnu.org/software/classpath/license.html.
16
- //
17
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
- // *****************************************************************************
19
- const browser_1 = require("@theia/editor/lib/browser");
20
- exports.EDITOR_CONTEXT_MENU_SCM = [...browser_1.EDITOR_CONTEXT_MENU, '3_scm'];
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EDITOR_CONTEXT_MENU_SCM = void 0;
4
+ // *****************************************************************************
5
+ // Copyright (C) 2019 Arm and others.
6
+ //
7
+ // This program and the accompanying materials are made available under the
8
+ // terms of the Eclipse Public License v. 2.0 which is available at
9
+ // http://www.eclipse.org/legal/epl-2.0.
10
+ //
11
+ // This Source Code may also be made available under the following Secondary
12
+ // Licenses when the conditions for such availability set forth in the Eclipse
13
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ // with the GNU Classpath Exception which is available at
15
+ // https://www.gnu.org/software/classpath/license.html.
16
+ //
17
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
+ // *****************************************************************************
19
+ const browser_1 = require("@theia/editor/lib/browser");
20
+ exports.EDITOR_CONTEXT_MENU_SCM = [...browser_1.EDITOR_CONTEXT_MENU, '3_scm'];
21
21
  //# sourceMappingURL=scm-extra-contribution.js.map
@@ -1,4 +1,4 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
4
  //# sourceMappingURL=scm-extra-frontend-module.d.ts.map
@@ -1,27 +1,27 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Arm 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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const scm_history_frontend_module_1 = require("./history/scm-history-frontend-module");
20
- const scm_file_change_label_provider_1 = require("./scm-file-change-label-provider");
21
- const browser_1 = require("@theia/core/lib/browser");
22
- exports.default = new inversify_1.ContainerModule(bind => {
23
- (0, scm_history_frontend_module_1.bindScmHistoryModule)(bind);
24
- bind(scm_file_change_label_provider_1.ScmFileChangeLabelProvider).toSelf().inSingletonScope();
25
- bind(browser_1.LabelProviderContribution).toService(scm_file_change_label_provider_1.ScmFileChangeLabelProvider);
26
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 Arm 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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const inversify_1 = require("@theia/core/shared/inversify");
19
+ const scm_history_frontend_module_1 = require("./history/scm-history-frontend-module");
20
+ const scm_file_change_label_provider_1 = require("./scm-file-change-label-provider");
21
+ const browser_1 = require("@theia/core/lib/browser");
22
+ exports.default = new inversify_1.ContainerModule(bind => {
23
+ (0, scm_history_frontend_module_1.bindScmHistoryModule)(bind);
24
+ bind(scm_file_change_label_provider_1.ScmFileChangeLabelProvider).toSelf().inSingletonScope();
25
+ bind(browser_1.LabelProviderContribution).toService(scm_file_change_label_provider_1.ScmFileChangeLabelProvider);
26
+ });
27
27
  //# sourceMappingURL=scm-extra-frontend-module.js.map
@@ -1,6 +1,6 @@
1
- import { ApplicationShellLayoutMigration, WidgetDescription, ApplicationShellLayoutMigrationContext } from '@theia/core/lib/browser/shell/shell-layout-restorer';
2
- export declare class ScmExtraLayoutVersion4Migration implements ApplicationShellLayoutMigration {
3
- readonly layoutVersion = 4;
4
- onWillInflateWidget(desc: WidgetDescription, { parent }: ApplicationShellLayoutMigrationContext): WidgetDescription | undefined;
5
- }
1
+ import { ApplicationShellLayoutMigration, WidgetDescription, ApplicationShellLayoutMigrationContext } from '@theia/core/lib/browser/shell/shell-layout-restorer';
2
+ export declare class ScmExtraLayoutVersion4Migration implements ApplicationShellLayoutMigration {
3
+ readonly layoutVersion = 4;
4
+ onWillInflateWidget(desc: WidgetDescription, { parent }: ApplicationShellLayoutMigrationContext): WidgetDescription | undefined;
5
+ }
6
6
  //# sourceMappingURL=scm-extra-layout-migrations.d.ts.map
@@ -1,43 +1,43 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2020 Arm 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.ScmExtraLayoutVersion4Migration = void 0;
25
- const inversify_1 = require("@theia/core/shared/inversify");
26
- const scm_history_contribution_1 = require("./history/scm-history-contribution");
27
- let ScmExtraLayoutVersion4Migration = class ScmExtraLayoutVersion4Migration {
28
- constructor() {
29
- this.layoutVersion = 4.0;
30
- }
31
- onWillInflateWidget(desc, { parent }) {
32
- if (desc.constructionOptions.factoryId === 'git-history') {
33
- desc.constructionOptions.factoryId = scm_history_contribution_1.SCM_HISTORY_ID;
34
- return desc;
35
- }
36
- return undefined;
37
- }
38
- };
39
- ScmExtraLayoutVersion4Migration = __decorate([
40
- (0, inversify_1.injectable)()
41
- ], ScmExtraLayoutVersion4Migration);
42
- exports.ScmExtraLayoutVersion4Migration = ScmExtraLayoutVersion4Migration;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2020 Arm 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.ScmExtraLayoutVersion4Migration = void 0;
25
+ const inversify_1 = require("@theia/core/shared/inversify");
26
+ const scm_history_contribution_1 = require("./history/scm-history-contribution");
27
+ let ScmExtraLayoutVersion4Migration = class ScmExtraLayoutVersion4Migration {
28
+ constructor() {
29
+ this.layoutVersion = 4.0;
30
+ }
31
+ onWillInflateWidget(desc, { parent }) {
32
+ if (desc.constructionOptions.factoryId === 'git-history') {
33
+ desc.constructionOptions.factoryId = scm_history_contribution_1.SCM_HISTORY_ID;
34
+ return desc;
35
+ }
36
+ return undefined;
37
+ }
38
+ };
39
+ ScmExtraLayoutVersion4Migration = __decorate([
40
+ (0, inversify_1.injectable)()
41
+ ], ScmExtraLayoutVersion4Migration);
42
+ exports.ScmExtraLayoutVersion4Migration = ScmExtraLayoutVersion4Migration;
43
43
  //# sourceMappingURL=scm-extra-layout-migrations.js.map
@@ -1,17 +1,17 @@
1
- import { LabelProviderContribution, DidChangeLabelEvent, LabelProvider } from '@theia/core/lib/browser/label-provider';
2
- import { ScmFileChangeNode } from './scm-file-change-node';
3
- import URI from '@theia/core/lib/common/uri';
4
- import { ScmService } from '@theia/scm/lib/browser/scm-service';
5
- export declare class ScmFileChangeLabelProvider implements LabelProviderContribution {
6
- protected readonly labelProvider: LabelProvider;
7
- protected readonly scmService: ScmService;
8
- canHandle(element: object): number;
9
- getIcon(node: ScmFileChangeNode): string;
10
- getName(node: ScmFileChangeNode): string;
11
- getDescription(node: ScmFileChangeNode): string;
12
- affects(node: ScmFileChangeNode, event: DidChangeLabelEvent): boolean;
13
- getCaption(node: ScmFileChangeNode): string;
14
- relativePath(uri: URI | string): string;
15
- getStatusCaption(node: ScmFileChangeNode): string;
16
- }
1
+ import { LabelProviderContribution, DidChangeLabelEvent, LabelProvider } from '@theia/core/lib/browser/label-provider';
2
+ import { ScmFileChangeNode } from './scm-file-change-node';
3
+ import URI from '@theia/core/lib/common/uri';
4
+ import { ScmService } from '@theia/scm/lib/browser/scm-service';
5
+ export declare class ScmFileChangeLabelProvider implements LabelProviderContribution {
6
+ protected readonly labelProvider: LabelProvider;
7
+ protected readonly scmService: ScmService;
8
+ canHandle(element: object): number;
9
+ getIcon(node: ScmFileChangeNode): string;
10
+ getName(node: ScmFileChangeNode): string;
11
+ getDescription(node: ScmFileChangeNode): string;
12
+ affects(node: ScmFileChangeNode, event: DidChangeLabelEvent): boolean;
13
+ getCaption(node: ScmFileChangeNode): string;
14
+ relativePath(uri: URI | string): string;
15
+ getStatusCaption(node: ScmFileChangeNode): string;
16
+ }
17
17
  //# sourceMappingURL=scm-file-change-label-provider.d.ts.map
@@ -1,80 +1,80 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 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.ScmFileChangeLabelProvider = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const label_provider_1 = require("@theia/core/lib/browser/label-provider");
30
- const scm_file_change_node_1 = require("./scm-file-change-node");
31
- const uri_1 = require("@theia/core/lib/common/uri");
32
- const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
33
- let ScmFileChangeLabelProvider = class ScmFileChangeLabelProvider {
34
- canHandle(element) {
35
- return scm_file_change_node_1.ScmFileChangeNode.is(element) ? 100 : 0;
36
- }
37
- getIcon(node) {
38
- return this.labelProvider.getIcon(new uri_1.default(node.fileChange.uri));
39
- }
40
- getName(node) {
41
- return this.labelProvider.getName(new uri_1.default(node.fileChange.uri));
42
- }
43
- getDescription(node) {
44
- return this.relativePath(new uri_1.default(node.fileChange.uri).parent);
45
- }
46
- affects(node, event) {
47
- return event.affects(new uri_1.default(node.fileChange.uri));
48
- }
49
- getCaption(node) {
50
- return node.fileChange.getCaption();
51
- }
52
- relativePath(uri) {
53
- const parsedUri = typeof uri === 'string' ? new uri_1.default(uri) : uri;
54
- const repo = this.scmService.findRepository(parsedUri);
55
- if (repo) {
56
- const repositoryUri = new uri_1.default(repo.provider.rootUri);
57
- const relativePath = repositoryUri.relative(parsedUri);
58
- if (relativePath) {
59
- return relativePath.toString();
60
- }
61
- }
62
- return this.labelProvider.getLongName(parsedUri);
63
- }
64
- getStatusCaption(node) {
65
- return node.fileChange.getStatusCaption();
66
- }
67
- };
68
- __decorate([
69
- (0, inversify_1.inject)(label_provider_1.LabelProvider),
70
- __metadata("design:type", label_provider_1.LabelProvider)
71
- ], ScmFileChangeLabelProvider.prototype, "labelProvider", void 0);
72
- __decorate([
73
- (0, inversify_1.inject)(scm_service_1.ScmService),
74
- __metadata("design:type", scm_service_1.ScmService)
75
- ], ScmFileChangeLabelProvider.prototype, "scmService", void 0);
76
- ScmFileChangeLabelProvider = __decorate([
77
- (0, inversify_1.injectable)()
78
- ], ScmFileChangeLabelProvider);
79
- exports.ScmFileChangeLabelProvider = ScmFileChangeLabelProvider;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 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.ScmFileChangeLabelProvider = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const label_provider_1 = require("@theia/core/lib/browser/label-provider");
30
+ const scm_file_change_node_1 = require("./scm-file-change-node");
31
+ const uri_1 = require("@theia/core/lib/common/uri");
32
+ const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
33
+ let ScmFileChangeLabelProvider = class ScmFileChangeLabelProvider {
34
+ canHandle(element) {
35
+ return scm_file_change_node_1.ScmFileChangeNode.is(element) ? 100 : 0;
36
+ }
37
+ getIcon(node) {
38
+ return this.labelProvider.getIcon(new uri_1.default(node.fileChange.uri));
39
+ }
40
+ getName(node) {
41
+ return this.labelProvider.getName(new uri_1.default(node.fileChange.uri));
42
+ }
43
+ getDescription(node) {
44
+ return this.relativePath(new uri_1.default(node.fileChange.uri).parent);
45
+ }
46
+ affects(node, event) {
47
+ return event.affects(new uri_1.default(node.fileChange.uri));
48
+ }
49
+ getCaption(node) {
50
+ return node.fileChange.getCaption();
51
+ }
52
+ relativePath(uri) {
53
+ const parsedUri = typeof uri === 'string' ? new uri_1.default(uri) : uri;
54
+ const repo = this.scmService.findRepository(parsedUri);
55
+ if (repo) {
56
+ const repositoryUri = new uri_1.default(repo.provider.rootUri);
57
+ const relativePath = repositoryUri.relative(parsedUri);
58
+ if (relativePath) {
59
+ return relativePath.toString();
60
+ }
61
+ }
62
+ return this.labelProvider.getLongName(parsedUri);
63
+ }
64
+ getStatusCaption(node) {
65
+ return node.fileChange.getStatusCaption();
66
+ }
67
+ };
68
+ __decorate([
69
+ (0, inversify_1.inject)(label_provider_1.LabelProvider),
70
+ __metadata("design:type", label_provider_1.LabelProvider)
71
+ ], ScmFileChangeLabelProvider.prototype, "labelProvider", void 0);
72
+ __decorate([
73
+ (0, inversify_1.inject)(scm_service_1.ScmService),
74
+ __metadata("design:type", scm_service_1.ScmService)
75
+ ], ScmFileChangeLabelProvider.prototype, "scmService", void 0);
76
+ ScmFileChangeLabelProvider = __decorate([
77
+ (0, inversify_1.injectable)()
78
+ ], ScmFileChangeLabelProvider);
79
+ exports.ScmFileChangeLabelProvider = ScmFileChangeLabelProvider;
80
80
  //# sourceMappingURL=scm-file-change-label-provider.js.map
@@ -1,24 +1,24 @@
1
- import { ScmCommit } from '@theia/scm/lib/browser/scm-provider';
2
- import URI from '@theia/core/lib/common/uri';
3
- export interface ScmFileChangeNode {
4
- readonly fileChange: ScmFileChange;
5
- readonly commitId: string;
6
- selected?: boolean;
7
- }
8
- export declare namespace ScmFileChangeNode {
9
- function is(node: unknown): node is ScmFileChangeNode;
10
- }
11
- export interface ScmHistoryCommit extends ScmCommit {
12
- readonly commitDetailUri: URI;
13
- readonly fileChanges: ScmFileChange[];
14
- readonly commitDetailOptions: {};
15
- }
16
- export interface ScmFileChange {
17
- readonly uri: string;
18
- getCaption(): string;
19
- getStatusCaption(): string;
20
- getStatusAbbreviation(): string;
21
- getClassNameForStatus(): string;
22
- getUriToOpen(): URI;
23
- }
1
+ import { ScmCommit } from '@theia/scm/lib/browser/scm-provider';
2
+ import URI from '@theia/core/lib/common/uri';
3
+ export interface ScmFileChangeNode {
4
+ readonly fileChange: ScmFileChange;
5
+ readonly commitId: string;
6
+ selected?: boolean;
7
+ }
8
+ export declare namespace ScmFileChangeNode {
9
+ function is(node: unknown): node is ScmFileChangeNode;
10
+ }
11
+ export interface ScmHistoryCommit extends ScmCommit {
12
+ readonly commitDetailUri: URI;
13
+ readonly fileChanges: ScmFileChange[];
14
+ readonly commitDetailOptions: {};
15
+ }
16
+ export interface ScmFileChange {
17
+ readonly uri: string;
18
+ getCaption(): string;
19
+ getStatusCaption(): string;
20
+ getStatusAbbreviation(): string;
21
+ getClassNameForStatus(): string;
22
+ getUriToOpen(): URI;
23
+ }
24
24
  //# sourceMappingURL=scm-file-change-node.d.ts.map
@@ -1,27 +1,27 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 Ericsson 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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ScmFileChangeNode = void 0;
19
- const common_1 = require("@theia/core/lib/common");
20
- var ScmFileChangeNode;
21
- (function (ScmFileChangeNode) {
22
- function is(node) {
23
- return (0, common_1.isObject)(node) && 'fileChange' in node && 'commitId' in node;
24
- }
25
- ScmFileChangeNode.is = is;
26
- })(ScmFileChangeNode = exports.ScmFileChangeNode || (exports.ScmFileChangeNode = {}));
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 Ericsson 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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ScmFileChangeNode = void 0;
19
+ const common_1 = require("@theia/core/lib/common");
20
+ var ScmFileChangeNode;
21
+ (function (ScmFileChangeNode) {
22
+ function is(node) {
23
+ return (0, common_1.isObject)(node) && 'fileChange' in node && 'commitId' in node;
24
+ }
25
+ ScmFileChangeNode.is = is;
26
+ })(ScmFileChangeNode = exports.ScmFileChangeNode || (exports.ScmFileChangeNode = {}));
27
27
  //# sourceMappingURL=scm-file-change-node.js.map
@@ -1,57 +1,57 @@
1
- /// <reference types="react" />
2
- import { Widget } from '@theia/core/lib/browser';
3
- import { ScmService } from '@theia/scm/lib/browser/scm-service';
4
- import { LabelProvider } from '@theia/core/lib/browser/label-provider';
5
- import { Message } from '@theia/core/shared/@phosphor/messaging';
6
- import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
7
- import * as React from '@theia/core/shared/react';
8
- import { ScmFileChangeLabelProvider } from './scm-file-change-label-provider';
9
- import { ScmFileChangeNode } from './scm-file-change-node';
10
- export declare abstract class ScmNavigableListWidget<T extends {
11
- selected?: boolean;
12
- }> extends ReactWidget {
13
- protected scmNodes: T[];
14
- private _scrollContainer;
15
- protected readonly scmService: ScmService;
16
- protected readonly labelProvider: LabelProvider;
17
- protected readonly scmLabelProvider: ScmFileChangeLabelProvider;
18
- constructor();
19
- protected onActivateRequest(msg: Message): void;
20
- protected set scrollContainer(id: string);
21
- protected get scrollContainer(): string;
22
- protected onUpdateRequest(msg: Message): void;
23
- protected onResize(msg: Widget.ResizeMessage): void;
24
- protected getRepositoryLabel(uri: string): string | undefined;
25
- protected renderHeaderRow({ name, value, classNames, title }: {
26
- name: string;
27
- value: React.ReactNode;
28
- classNames?: string[];
29
- title?: string;
30
- }): React.ReactNode;
31
- protected addListNavigationKeyListeners(container: HTMLElement): void;
32
- protected navigateLeft(): void;
33
- protected navigateRight(): void;
34
- protected navigateUp(): void;
35
- protected navigateDown(): void;
36
- protected handleListEnter(): void;
37
- protected getSelected(): T | undefined;
38
- protected selectNode(node: T): void;
39
- protected selectNextNode(): void;
40
- protected selectPreviousNode(): void;
41
- protected get indexOfSelected(): number;
42
- }
43
- export declare namespace ScmItemComponent {
44
- interface Props {
45
- labelProvider: LabelProvider;
46
- scmLabelProvider: ScmFileChangeLabelProvider;
47
- change: ScmFileChangeNode;
48
- revealChange: (change: ScmFileChangeNode) => void;
49
- selectNode: (change: ScmFileChangeNode) => void;
50
- }
51
- }
52
- export declare class ScmItemComponent extends React.Component<ScmItemComponent.Props> {
53
- render(): JSX.Element;
54
- protected readonly revealChange: () => void;
55
- protected readonly selectNode: () => void;
56
- }
1
+ /// <reference types="react" />
2
+ import { Widget } from '@theia/core/lib/browser';
3
+ import { ScmService } from '@theia/scm/lib/browser/scm-service';
4
+ import { LabelProvider } from '@theia/core/lib/browser/label-provider';
5
+ import { Message } from '@theia/core/shared/@phosphor/messaging';
6
+ import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
7
+ import * as React from '@theia/core/shared/react';
8
+ import { ScmFileChangeLabelProvider } from './scm-file-change-label-provider';
9
+ import { ScmFileChangeNode } from './scm-file-change-node';
10
+ export declare abstract class ScmNavigableListWidget<T extends {
11
+ selected?: boolean;
12
+ }> extends ReactWidget {
13
+ protected scmNodes: T[];
14
+ private _scrollContainer;
15
+ protected readonly scmService: ScmService;
16
+ protected readonly labelProvider: LabelProvider;
17
+ protected readonly scmLabelProvider: ScmFileChangeLabelProvider;
18
+ constructor();
19
+ protected onActivateRequest(msg: Message): void;
20
+ protected set scrollContainer(id: string);
21
+ protected get scrollContainer(): string;
22
+ protected onUpdateRequest(msg: Message): void;
23
+ protected onResize(msg: Widget.ResizeMessage): void;
24
+ protected getRepositoryLabel(uri: string): string | undefined;
25
+ protected renderHeaderRow({ name, value, classNames, title }: {
26
+ name: string;
27
+ value: React.ReactNode;
28
+ classNames?: string[];
29
+ title?: string;
30
+ }): React.ReactNode;
31
+ protected addListNavigationKeyListeners(container: HTMLElement): void;
32
+ protected navigateLeft(): void;
33
+ protected navigateRight(): void;
34
+ protected navigateUp(): void;
35
+ protected navigateDown(): void;
36
+ protected handleListEnter(): void;
37
+ protected getSelected(): T | undefined;
38
+ protected selectNode(node: T): void;
39
+ protected selectNextNode(): void;
40
+ protected selectPreviousNode(): void;
41
+ protected get indexOfSelected(): number;
42
+ }
43
+ export declare namespace ScmItemComponent {
44
+ interface Props {
45
+ labelProvider: LabelProvider;
46
+ scmLabelProvider: ScmFileChangeLabelProvider;
47
+ change: ScmFileChangeNode;
48
+ revealChange: (change: ScmFileChangeNode) => void;
49
+ selectNode: (change: ScmFileChangeNode) => void;
50
+ }
51
+ }
52
+ export declare class ScmItemComponent extends React.Component<ScmItemComponent.Props> {
53
+ render(): JSX.Element;
54
+ protected readonly revealChange: () => void;
55
+ protected readonly selectNode: () => void;
56
+ }
57
57
  //# sourceMappingURL=scm-navigable-list-widget.d.ts.map