@theia/scm-extra 1.45.1 → 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.
Files changed (39) hide show
  1. package/README.md +32 -32
  2. package/lib/browser/history/index.d.ts +3 -3
  3. package/lib/browser/history/index.js +31 -31
  4. package/lib/browser/history/scm-history-constants.d.ts +38 -38
  5. package/lib/browser/history/scm-history-constants.js +41 -41
  6. package/lib/browser/history/scm-history-contribution.d.ts +18 -18
  7. package/lib/browser/history/scm-history-contribution.js +101 -101
  8. package/lib/browser/history/scm-history-frontend-module.d.ts +3 -3
  9. package/lib/browser/history/scm-history-frontend-module.js +33 -33
  10. package/lib/browser/history/scm-history-provider.d.ts +8 -8
  11. package/lib/browser/history/scm-history-provider.js +25 -25
  12. package/lib/browser/history/scm-history-widget.d.ts +89 -89
  13. package/lib/browser/history/scm-history-widget.js +492 -492
  14. package/lib/browser/scm-extra-contribution.d.ts +1 -1
  15. package/lib/browser/scm-extra-contribution.js +20 -20
  16. package/lib/browser/scm-extra-frontend-module.d.ts +3 -3
  17. package/lib/browser/scm-extra-frontend-module.js +26 -26
  18. package/lib/browser/scm-extra-layout-migrations.d.ts +5 -5
  19. package/lib/browser/scm-extra-layout-migrations.js +42 -42
  20. package/lib/browser/scm-file-change-label-provider.d.ts +16 -16
  21. package/lib/browser/scm-file-change-label-provider.js +79 -79
  22. package/lib/browser/scm-file-change-node.d.ts +23 -23
  23. package/lib/browser/scm-file-change-node.js +26 -26
  24. package/lib/browser/scm-navigable-list-widget.d.ts +56 -56
  25. package/lib/browser/scm-navigable-list-widget.js +179 -179
  26. package/package.json +8 -8
  27. package/src/browser/history/index.ts +21 -21
  28. package/src/browser/history/scm-history-constants.ts +69 -69
  29. package/src/browser/history/scm-history-contribution.ts +90 -90
  30. package/src/browser/history/scm-history-frontend-module.ts +36 -36
  31. package/src/browser/history/scm-history-provider.ts +27 -27
  32. package/src/browser/history/scm-history-widget.tsx +571 -571
  33. package/src/browser/scm-extra-contribution.ts +18 -18
  34. package/src/browser/scm-extra-frontend-module.ts +27 -27
  35. package/src/browser/scm-extra-layout-migrations.ts +32 -32
  36. package/src/browser/scm-file-change-label-provider.ts +73 -73
  37. package/src/browser/scm-file-change-node.ts +45 -45
  38. package/src/browser/scm-navigable-list-widget.tsx +197 -197
  39. package/src/browser/style/history.css +164 -164
package/README.md CHANGED
@@ -1,32 +1,32 @@
1
- <div align='center'>
2
-
3
- <br />
4
-
5
- <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
-
7
- <h2>ECLIPSE THEIA - SCM-EXTRA EXTENSION</h2>
8
-
9
- <hr />
10
-
11
- </div>
12
-
13
- ## Description
14
-
15
- The `@theia/scm-extra` extension contributes additional functionality compared to the base `@theia/scm` extension.
16
- This includes:
17
- - `SCM History`: a dedicated view to visualize a repository's commit history.
18
-
19
- ## Additional Information
20
-
21
- - [API documentation for `@theia/scm-extra`](https://eclipse-theia.github.io/theia/docs/next/modules/scm_extra.html)
22
- - [Theia - GitHub](https://github.com/eclipse-theia/theia)
23
- - [Theia - Website](https://theia-ide.org/)
24
-
25
- ## License
26
-
27
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
28
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
29
-
30
- ## Trademark
31
- "Theia" is a trademark of the Eclipse Foundation
32
- https://www.eclipse.org/theia
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - SCM-EXTRA EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/scm-extra` extension contributes additional functionality compared to the base `@theia/scm` extension.
16
+ This includes:
17
+ - `SCM History`: a dedicated view to visualize a repository's commit history.
18
+
19
+ ## Additional Information
20
+
21
+ - [API documentation for `@theia/scm-extra`](https://eclipse-theia.github.io/theia/docs/next/modules/scm_extra.html)
22
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
23
+ - [Theia - Website](https://theia-ide.org/)
24
+
25
+ ## License
26
+
27
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
28
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
29
+
30
+ ## Trademark
31
+ "Theia" is a trademark of the Eclipse Foundation
32
+ https://www.eclipse.org/theia
@@ -1,4 +1,4 @@
1
- export * from './scm-history-provider';
2
- import { ScmHistorySupport } from './scm-history-widget';
3
- export { ScmHistorySupport };
1
+ export * from './scm-history-provider';
2
+ import { ScmHistorySupport } from './scm-history-widget';
3
+ export { ScmHistorySupport };
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,32 +1,32 @@
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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.ScmHistorySupport = void 0;
29
- __exportStar(require("./scm-history-provider"), exports);
30
- const scm_history_widget_1 = require("./scm-history-widget");
31
- Object.defineProperty(exports, "ScmHistorySupport", { enumerable: true, get: function () { return scm_history_widget_1.ScmHistorySupport; } });
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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.ScmHistorySupport = void 0;
29
+ __exportStar(require("./scm-history-provider"), exports);
30
+ const scm_history_widget_1 = require("./scm-history-widget");
31
+ Object.defineProperty(exports, "ScmHistorySupport", { enumerable: true, get: function () { return scm_history_widget_1.ScmHistorySupport; } });
32
32
  //# sourceMappingURL=index.js.map
@@ -1,39 +1,39 @@
1
- import { Command, Event } from '@theia/core';
2
- import { OpenViewArguments } from '@theia/core/lib/browser';
3
- import { ScmFileChangeNode, ScmHistoryCommit } from '../scm-file-change-node';
4
- export declare const SCM_HISTORY_ID = "scm-history";
5
- export declare const SCM_HISTORY_LABEL: string;
6
- export declare const SCM_HISTORY_TOGGLE_KEYBINDING = "alt+h";
7
- export declare const SCM_HISTORY_MAX_COUNT = 100;
8
- export declare namespace ScmHistoryCommands {
9
- const OPEN_FILE_HISTORY: Command;
10
- const OPEN_BRANCH_HISTORY: Command;
11
- }
12
- export interface ScmHistoryOpenViewArguments extends OpenViewArguments {
13
- uri: string | undefined;
14
- }
15
- export declare const ScmHistorySupport: unique symbol;
16
- export interface ScmHistorySupport {
17
- getCommitHistory(options?: HistoryWidgetOptions): Promise<ScmHistoryCommit[]>;
18
- readonly onDidChangeHistory: Event<void>;
19
- }
20
- export interface ScmCommitNode {
21
- commitDetails: ScmHistoryCommit;
22
- authorAvatar: string;
23
- fileChangeNodes: ScmFileChangeNode[];
24
- expanded: boolean;
25
- selected: boolean;
26
- }
27
- export declare namespace ScmCommitNode {
28
- function is(node: unknown): node is ScmCommitNode;
29
- }
30
- export interface HistoryWidgetOptions {
31
- range?: {
32
- toRevision?: string;
33
- fromRevision?: string;
34
- };
35
- uri?: string;
36
- maxCount?: number;
37
- }
38
- export declare type ScmHistoryListNode = (ScmCommitNode | ScmFileChangeNode);
1
+ import { Command, Event } from '@theia/core';
2
+ import { OpenViewArguments } from '@theia/core/lib/browser';
3
+ import { ScmFileChangeNode, ScmHistoryCommit } from '../scm-file-change-node';
4
+ export declare const SCM_HISTORY_ID = "scm-history";
5
+ export declare const SCM_HISTORY_LABEL: string;
6
+ export declare const SCM_HISTORY_TOGGLE_KEYBINDING = "alt+h";
7
+ export declare const SCM_HISTORY_MAX_COUNT = 100;
8
+ export declare namespace ScmHistoryCommands {
9
+ const OPEN_FILE_HISTORY: Command;
10
+ const OPEN_BRANCH_HISTORY: Command;
11
+ }
12
+ export interface ScmHistoryOpenViewArguments extends OpenViewArguments {
13
+ uri: string | undefined;
14
+ }
15
+ export declare const ScmHistorySupport: unique symbol;
16
+ export interface ScmHistorySupport {
17
+ getCommitHistory(options?: HistoryWidgetOptions): Promise<ScmHistoryCommit[]>;
18
+ readonly onDidChangeHistory: Event<void>;
19
+ }
20
+ export interface ScmCommitNode {
21
+ commitDetails: ScmHistoryCommit;
22
+ authorAvatar: string;
23
+ fileChangeNodes: ScmFileChangeNode[];
24
+ expanded: boolean;
25
+ selected: boolean;
26
+ }
27
+ export declare namespace ScmCommitNode {
28
+ function is(node: unknown): node is ScmCommitNode;
29
+ }
30
+ export interface HistoryWidgetOptions {
31
+ range?: {
32
+ toRevision?: string;
33
+ fromRevision?: string;
34
+ };
35
+ uri?: string;
36
+ maxCount?: number;
37
+ }
38
+ export declare type ScmHistoryListNode = (ScmCommitNode | ScmFileChangeNode);
39
39
  //# sourceMappingURL=scm-history-constants.d.ts.map
@@ -1,42 +1,42 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2022 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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ScmCommitNode = exports.ScmHistorySupport = exports.ScmHistoryCommands = exports.SCM_HISTORY_MAX_COUNT = exports.SCM_HISTORY_TOGGLE_KEYBINDING = exports.SCM_HISTORY_LABEL = exports.SCM_HISTORY_ID = void 0;
19
- const core_1 = require("@theia/core");
20
- exports.SCM_HISTORY_ID = 'scm-history';
21
- exports.SCM_HISTORY_LABEL = core_1.nls.localize('theia/scm/history', 'History');
22
- exports.SCM_HISTORY_TOGGLE_KEYBINDING = 'alt+h';
23
- exports.SCM_HISTORY_MAX_COUNT = 100;
24
- var ScmHistoryCommands;
25
- (function (ScmHistoryCommands) {
26
- ScmHistoryCommands.OPEN_FILE_HISTORY = {
27
- id: 'scm-history:open-file-history',
28
- };
29
- ScmHistoryCommands.OPEN_BRANCH_HISTORY = {
30
- id: 'scm-history:open-branch-history',
31
- label: exports.SCM_HISTORY_LABEL
32
- };
33
- })(ScmHistoryCommands = exports.ScmHistoryCommands || (exports.ScmHistoryCommands = {}));
34
- exports.ScmHistorySupport = Symbol('scm-history-support');
35
- var ScmCommitNode;
36
- (function (ScmCommitNode) {
37
- function is(node) {
38
- return !!node && typeof node === 'object' && 'commitDetails' in node && 'expanded' in node && 'selected' in node;
39
- }
40
- ScmCommitNode.is = is;
41
- })(ScmCommitNode = exports.ScmCommitNode || (exports.ScmCommitNode = {}));
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ScmCommitNode = exports.ScmHistorySupport = exports.ScmHistoryCommands = exports.SCM_HISTORY_MAX_COUNT = exports.SCM_HISTORY_TOGGLE_KEYBINDING = exports.SCM_HISTORY_LABEL = exports.SCM_HISTORY_ID = void 0;
19
+ const core_1 = require("@theia/core");
20
+ exports.SCM_HISTORY_ID = 'scm-history';
21
+ exports.SCM_HISTORY_LABEL = core_1.nls.localize('theia/scm/history', 'History');
22
+ exports.SCM_HISTORY_TOGGLE_KEYBINDING = 'alt+h';
23
+ exports.SCM_HISTORY_MAX_COUNT = 100;
24
+ var ScmHistoryCommands;
25
+ (function (ScmHistoryCommands) {
26
+ ScmHistoryCommands.OPEN_FILE_HISTORY = {
27
+ id: 'scm-history:open-file-history',
28
+ };
29
+ ScmHistoryCommands.OPEN_BRANCH_HISTORY = {
30
+ id: 'scm-history:open-branch-history',
31
+ label: exports.SCM_HISTORY_LABEL
32
+ };
33
+ })(ScmHistoryCommands = exports.ScmHistoryCommands || (exports.ScmHistoryCommands = {}));
34
+ exports.ScmHistorySupport = Symbol('scm-history-support');
35
+ var ScmCommitNode;
36
+ (function (ScmCommitNode) {
37
+ function is(node) {
38
+ return !!node && typeof node === 'object' && 'commitDetails' in node && 'expanded' in node && 'selected' in node;
39
+ }
40
+ ScmCommitNode.is = is;
41
+ })(ScmCommitNode = exports.ScmCommitNode || (exports.ScmCommitNode = {}));
42
42
  //# sourceMappingURL=scm-history-constants.js.map
@@ -1,19 +1,19 @@
1
- import { MenuModelRegistry, CommandRegistry, SelectionService } from '@theia/core';
2
- import { AbstractViewContribution } from '@theia/core/lib/browser';
3
- import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
4
- import URI from '@theia/core/lib/common/uri';
5
- import { ScmHistoryWidget } from './scm-history-widget';
6
- import { ScmService } from '@theia/scm/lib/browser/scm-service';
7
- import { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments } from './scm-history-constants';
8
- export { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments };
9
- export declare class ScmHistoryContribution extends AbstractViewContribution<ScmHistoryWidget> {
10
- protected readonly selectionService: SelectionService;
11
- protected readonly scmService: ScmService;
12
- constructor();
13
- openView(args?: Partial<ScmHistoryOpenViewArguments>): Promise<ScmHistoryWidget>;
14
- registerMenus(menus: MenuModelRegistry): void;
15
- registerCommands(commands: CommandRegistry): void;
16
- protected refreshWidget(uri: string | undefined): Promise<void>;
17
- protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI>;
18
- }
1
+ import { MenuModelRegistry, CommandRegistry, SelectionService } from '@theia/core';
2
+ import { AbstractViewContribution } from '@theia/core/lib/browser';
3
+ import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
4
+ import URI from '@theia/core/lib/common/uri';
5
+ import { ScmHistoryWidget } from './scm-history-widget';
6
+ import { ScmService } from '@theia/scm/lib/browser/scm-service';
7
+ import { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments } from './scm-history-constants';
8
+ export { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments };
9
+ export declare class ScmHistoryContribution extends AbstractViewContribution<ScmHistoryWidget> {
10
+ protected readonly selectionService: SelectionService;
11
+ protected readonly scmService: ScmService;
12
+ constructor();
13
+ openView(args?: Partial<ScmHistoryOpenViewArguments>): Promise<ScmHistoryWidget>;
14
+ registerMenus(menus: MenuModelRegistry): void;
15
+ registerCommands(commands: CommandRegistry): void;
16
+ protected refreshWidget(uri: string | undefined): Promise<void>;
17
+ protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI>;
18
+ }
19
19
  //# sourceMappingURL=scm-history-contribution.d.ts.map
@@ -1,102 +1,102 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 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
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.ScmHistoryContribution = exports.SCM_HISTORY_TOGGLE_KEYBINDING = exports.ScmHistoryCommands = exports.SCM_HISTORY_LABEL = exports.SCM_HISTORY_ID = void 0;
28
- const core_1 = require("@theia/core");
29
- const browser_1 = require("@theia/core/lib/browser");
30
- const inversify_1 = require("@theia/core/shared/inversify");
31
- const navigator_contribution_1 = require("@theia/navigator/lib/browser/navigator-contribution");
32
- const uri_command_handler_1 = require("@theia/core/lib/common/uri-command-handler");
33
- const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
34
- const scm_extra_contribution_1 = require("../scm-extra-contribution");
35
- const scm_history_constants_1 = require("./scm-history-constants");
36
- Object.defineProperty(exports, "SCM_HISTORY_ID", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_ID; } });
37
- Object.defineProperty(exports, "SCM_HISTORY_LABEL", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_LABEL; } });
38
- Object.defineProperty(exports, "ScmHistoryCommands", { enumerable: true, get: function () { return scm_history_constants_1.ScmHistoryCommands; } });
39
- Object.defineProperty(exports, "SCM_HISTORY_TOGGLE_KEYBINDING", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_TOGGLE_KEYBINDING; } });
40
- let ScmHistoryContribution = class ScmHistoryContribution extends browser_1.AbstractViewContribution {
41
- constructor() {
42
- super({
43
- widgetId: scm_history_constants_1.SCM_HISTORY_ID,
44
- widgetName: scm_history_constants_1.SCM_HISTORY_LABEL,
45
- defaultWidgetOptions: {
46
- area: 'left',
47
- rank: 500
48
- },
49
- toggleCommandId: scm_history_constants_1.ScmHistoryCommands.OPEN_BRANCH_HISTORY.id,
50
- toggleKeybinding: scm_history_constants_1.SCM_HISTORY_TOGGLE_KEYBINDING
51
- });
52
- }
53
- async openView(args) {
54
- const widget = await super.openView(args);
55
- this.refreshWidget(args.uri);
56
- return widget;
57
- }
58
- registerMenus(menus) {
59
- menus.registerMenuAction(navigator_contribution_1.NavigatorContextMenu.SEARCH, {
60
- commandId: scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY.id,
61
- label: scm_history_constants_1.SCM_HISTORY_LABEL
62
- });
63
- menus.registerMenuAction(scm_extra_contribution_1.EDITOR_CONTEXT_MENU_SCM, {
64
- commandId: scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY.id,
65
- label: scm_history_constants_1.SCM_HISTORY_LABEL
66
- });
67
- super.registerMenus(menus);
68
- }
69
- registerCommands(commands) {
70
- commands.registerCommand(scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY, this.newUriAwareCommandHandler({
71
- isEnabled: (uri) => !!this.scmService.findRepository(uri),
72
- isVisible: (uri) => !!this.scmService.findRepository(uri),
73
- execute: async (uri) => this.openView({ activate: true, uri: uri.toString() }),
74
- }));
75
- super.registerCommands(commands);
76
- }
77
- async refreshWidget(uri) {
78
- const widget = this.tryGetWidget();
79
- if (!widget) {
80
- // the widget doesn't exist, so don't wake it up
81
- return;
82
- }
83
- await widget.setContent({ uri });
84
- }
85
- newUriAwareCommandHandler(handler) {
86
- return uri_command_handler_1.UriAwareCommandHandler.MonoSelect(this.selectionService, handler);
87
- }
88
- };
89
- __decorate([
90
- (0, inversify_1.inject)(core_1.SelectionService),
91
- __metadata("design:type", core_1.SelectionService)
92
- ], ScmHistoryContribution.prototype, "selectionService", void 0);
93
- __decorate([
94
- (0, inversify_1.inject)(scm_service_1.ScmService),
95
- __metadata("design:type", scm_service_1.ScmService)
96
- ], ScmHistoryContribution.prototype, "scmService", void 0);
97
- ScmHistoryContribution = __decorate([
98
- (0, inversify_1.injectable)(),
99
- __metadata("design:paramtypes", [])
100
- ], ScmHistoryContribution);
101
- exports.ScmHistoryContribution = ScmHistoryContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 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
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.ScmHistoryContribution = exports.SCM_HISTORY_TOGGLE_KEYBINDING = exports.ScmHistoryCommands = exports.SCM_HISTORY_LABEL = exports.SCM_HISTORY_ID = void 0;
28
+ const core_1 = require("@theia/core");
29
+ const browser_1 = require("@theia/core/lib/browser");
30
+ const inversify_1 = require("@theia/core/shared/inversify");
31
+ const navigator_contribution_1 = require("@theia/navigator/lib/browser/navigator-contribution");
32
+ const uri_command_handler_1 = require("@theia/core/lib/common/uri-command-handler");
33
+ const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
34
+ const scm_extra_contribution_1 = require("../scm-extra-contribution");
35
+ const scm_history_constants_1 = require("./scm-history-constants");
36
+ Object.defineProperty(exports, "SCM_HISTORY_ID", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_ID; } });
37
+ Object.defineProperty(exports, "SCM_HISTORY_LABEL", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_LABEL; } });
38
+ Object.defineProperty(exports, "ScmHistoryCommands", { enumerable: true, get: function () { return scm_history_constants_1.ScmHistoryCommands; } });
39
+ Object.defineProperty(exports, "SCM_HISTORY_TOGGLE_KEYBINDING", { enumerable: true, get: function () { return scm_history_constants_1.SCM_HISTORY_TOGGLE_KEYBINDING; } });
40
+ let ScmHistoryContribution = class ScmHistoryContribution extends browser_1.AbstractViewContribution {
41
+ constructor() {
42
+ super({
43
+ widgetId: scm_history_constants_1.SCM_HISTORY_ID,
44
+ widgetName: scm_history_constants_1.SCM_HISTORY_LABEL,
45
+ defaultWidgetOptions: {
46
+ area: 'left',
47
+ rank: 500
48
+ },
49
+ toggleCommandId: scm_history_constants_1.ScmHistoryCommands.OPEN_BRANCH_HISTORY.id,
50
+ toggleKeybinding: scm_history_constants_1.SCM_HISTORY_TOGGLE_KEYBINDING
51
+ });
52
+ }
53
+ async openView(args) {
54
+ const widget = await super.openView(args);
55
+ this.refreshWidget(args.uri);
56
+ return widget;
57
+ }
58
+ registerMenus(menus) {
59
+ menus.registerMenuAction(navigator_contribution_1.NavigatorContextMenu.SEARCH, {
60
+ commandId: scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY.id,
61
+ label: scm_history_constants_1.SCM_HISTORY_LABEL
62
+ });
63
+ menus.registerMenuAction(scm_extra_contribution_1.EDITOR_CONTEXT_MENU_SCM, {
64
+ commandId: scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY.id,
65
+ label: scm_history_constants_1.SCM_HISTORY_LABEL
66
+ });
67
+ super.registerMenus(menus);
68
+ }
69
+ registerCommands(commands) {
70
+ commands.registerCommand(scm_history_constants_1.ScmHistoryCommands.OPEN_FILE_HISTORY, this.newUriAwareCommandHandler({
71
+ isEnabled: (uri) => !!this.scmService.findRepository(uri),
72
+ isVisible: (uri) => !!this.scmService.findRepository(uri),
73
+ execute: async (uri) => this.openView({ activate: true, uri: uri.toString() }),
74
+ }));
75
+ super.registerCommands(commands);
76
+ }
77
+ async refreshWidget(uri) {
78
+ const widget = this.tryGetWidget();
79
+ if (!widget) {
80
+ // the widget doesn't exist, so don't wake it up
81
+ return;
82
+ }
83
+ await widget.setContent({ uri });
84
+ }
85
+ newUriAwareCommandHandler(handler) {
86
+ return uri_command_handler_1.UriAwareCommandHandler.MonoSelect(this.selectionService, handler);
87
+ }
88
+ };
89
+ __decorate([
90
+ (0, inversify_1.inject)(core_1.SelectionService),
91
+ __metadata("design:type", core_1.SelectionService)
92
+ ], ScmHistoryContribution.prototype, "selectionService", void 0);
93
+ __decorate([
94
+ (0, inversify_1.inject)(scm_service_1.ScmService),
95
+ __metadata("design:type", scm_service_1.ScmService)
96
+ ], ScmHistoryContribution.prototype, "scmService", void 0);
97
+ ScmHistoryContribution = __decorate([
98
+ (0, inversify_1.injectable)(),
99
+ __metadata("design:paramtypes", [])
100
+ ], ScmHistoryContribution);
101
+ exports.ScmHistoryContribution = ScmHistoryContribution;
102
102
  //# sourceMappingURL=scm-history-contribution.js.map
@@ -1,4 +1,4 @@
1
- import { interfaces } from '@theia/core/shared/inversify';
2
- import '../../../src/browser/style/history.css';
3
- export declare function bindScmHistoryModule(bind: interfaces.Bind): void;
1
+ import { interfaces } from '@theia/core/shared/inversify';
2
+ import '../../../src/browser/style/history.css';
3
+ export declare function bindScmHistoryModule(bind: interfaces.Bind): void;
4
4
  //# sourceMappingURL=scm-history-frontend-module.d.ts.map
@@ -1,34 +1,34 @@
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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.bindScmHistoryModule = void 0;
19
- const scm_history_contribution_1 = require("./scm-history-contribution");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const scm_history_widget_1 = require("./scm-history-widget");
22
- const scm_extra_layout_migrations_1 = require("../scm-extra-layout-migrations");
23
- require("../../../src/browser/style/history.css");
24
- function bindScmHistoryModule(bind) {
25
- bind(scm_history_widget_1.ScmHistoryWidget).toSelf();
26
- bind(browser_1.WidgetFactory).toDynamicValue(ctx => ({
27
- id: scm_history_contribution_1.SCM_HISTORY_ID,
28
- createWidget: () => ctx.container.get(scm_history_widget_1.ScmHistoryWidget)
29
- }));
30
- (0, browser_1.bindViewContribution)(bind, scm_history_contribution_1.ScmHistoryContribution);
31
- bind(browser_1.ApplicationShellLayoutMigration).to(scm_extra_layout_migrations_1.ScmExtraLayoutVersion4Migration).inSingletonScope();
32
- }
33
- exports.bindScmHistoryModule = bindScmHistoryModule;
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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.bindScmHistoryModule = void 0;
19
+ const scm_history_contribution_1 = require("./scm-history-contribution");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const scm_history_widget_1 = require("./scm-history-widget");
22
+ const scm_extra_layout_migrations_1 = require("../scm-extra-layout-migrations");
23
+ require("../../../src/browser/style/history.css");
24
+ function bindScmHistoryModule(bind) {
25
+ bind(scm_history_widget_1.ScmHistoryWidget).toSelf();
26
+ bind(browser_1.WidgetFactory).toDynamicValue(ctx => ({
27
+ id: scm_history_contribution_1.SCM_HISTORY_ID,
28
+ createWidget: () => ctx.container.get(scm_history_widget_1.ScmHistoryWidget)
29
+ }));
30
+ (0, browser_1.bindViewContribution)(bind, scm_history_contribution_1.ScmHistoryContribution);
31
+ bind(browser_1.ApplicationShellLayoutMigration).to(scm_extra_layout_migrations_1.ScmExtraLayoutVersion4Migration).inSingletonScope();
32
+ }
33
+ exports.bindScmHistoryModule = bindScmHistoryModule;
34
34
  //# sourceMappingURL=scm-history-frontend-module.js.map