@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,90 +1,90 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { MenuModelRegistry, CommandRegistry, SelectionService } from '@theia/core';
18
- import { AbstractViewContribution } from '@theia/core/lib/browser';
19
- import { injectable, inject } from '@theia/core/shared/inversify';
20
- import { NavigatorContextMenu } from '@theia/navigator/lib/browser/navigator-contribution';
21
- import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
22
- import URI from '@theia/core/lib/common/uri';
23
- import { ScmHistoryWidget } from './scm-history-widget';
24
- import { ScmService } from '@theia/scm/lib/browser/scm-service';
25
- import { EDITOR_CONTEXT_MENU_SCM } from '../scm-extra-contribution';
26
- import { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments } from './scm-history-constants';
27
- export { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments };
28
-
29
- @injectable()
30
- export class ScmHistoryContribution extends AbstractViewContribution<ScmHistoryWidget> {
31
-
32
- @inject(SelectionService)
33
- protected readonly selectionService: SelectionService;
34
- @inject(ScmService)
35
- protected readonly scmService: ScmService;
36
-
37
- constructor() {
38
- super({
39
- widgetId: SCM_HISTORY_ID,
40
- widgetName: SCM_HISTORY_LABEL,
41
- defaultWidgetOptions: {
42
- area: 'left',
43
- rank: 500
44
- },
45
- toggleCommandId: ScmHistoryCommands.OPEN_BRANCH_HISTORY.id,
46
- toggleKeybinding: SCM_HISTORY_TOGGLE_KEYBINDING
47
- });
48
- }
49
-
50
- override async openView(args?: Partial<ScmHistoryOpenViewArguments>): Promise<ScmHistoryWidget> {
51
- const widget = await super.openView(args);
52
- this.refreshWidget(args!.uri);
53
- return widget;
54
- }
55
-
56
- override registerMenus(menus: MenuModelRegistry): void {
57
- menus.registerMenuAction(NavigatorContextMenu.SEARCH, {
58
- commandId: ScmHistoryCommands.OPEN_FILE_HISTORY.id,
59
- label: SCM_HISTORY_LABEL
60
- });
61
- menus.registerMenuAction(EDITOR_CONTEXT_MENU_SCM, {
62
- commandId: ScmHistoryCommands.OPEN_FILE_HISTORY.id,
63
- label: SCM_HISTORY_LABEL
64
- });
65
- super.registerMenus(menus);
66
- }
67
-
68
- override registerCommands(commands: CommandRegistry): void {
69
- commands.registerCommand(ScmHistoryCommands.OPEN_FILE_HISTORY, this.newUriAwareCommandHandler({
70
- isEnabled: (uri: URI) => !!this.scmService.findRepository(uri),
71
- isVisible: (uri: URI) => !!this.scmService.findRepository(uri),
72
- execute: async uri => this.openView({ activate: true, uri: uri.toString() }),
73
- }));
74
- super.registerCommands(commands);
75
- }
76
-
77
- protected async refreshWidget(uri: string | undefined): Promise<void> {
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
-
86
- protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI> {
87
- return UriAwareCommandHandler.MonoSelect(this.selectionService, handler);
88
- }
89
-
90
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { MenuModelRegistry, CommandRegistry, SelectionService } from '@theia/core';
18
+ import { AbstractViewContribution } from '@theia/core/lib/browser';
19
+ import { injectable, inject } from '@theia/core/shared/inversify';
20
+ import { NavigatorContextMenu } from '@theia/navigator/lib/browser/navigator-contribution';
21
+ import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
22
+ import URI from '@theia/core/lib/common/uri';
23
+ import { ScmHistoryWidget } from './scm-history-widget';
24
+ import { ScmService } from '@theia/scm/lib/browser/scm-service';
25
+ import { EDITOR_CONTEXT_MENU_SCM } from '../scm-extra-contribution';
26
+ import { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments } from './scm-history-constants';
27
+ export { SCM_HISTORY_ID, SCM_HISTORY_LABEL, ScmHistoryCommands, SCM_HISTORY_TOGGLE_KEYBINDING, ScmHistoryOpenViewArguments };
28
+
29
+ @injectable()
30
+ export class ScmHistoryContribution extends AbstractViewContribution<ScmHistoryWidget> {
31
+
32
+ @inject(SelectionService)
33
+ protected readonly selectionService: SelectionService;
34
+ @inject(ScmService)
35
+ protected readonly scmService: ScmService;
36
+
37
+ constructor() {
38
+ super({
39
+ widgetId: SCM_HISTORY_ID,
40
+ widgetName: SCM_HISTORY_LABEL,
41
+ defaultWidgetOptions: {
42
+ area: 'left',
43
+ rank: 500
44
+ },
45
+ toggleCommandId: ScmHistoryCommands.OPEN_BRANCH_HISTORY.id,
46
+ toggleKeybinding: SCM_HISTORY_TOGGLE_KEYBINDING
47
+ });
48
+ }
49
+
50
+ override async openView(args?: Partial<ScmHistoryOpenViewArguments>): Promise<ScmHistoryWidget> {
51
+ const widget = await super.openView(args);
52
+ this.refreshWidget(args!.uri);
53
+ return widget;
54
+ }
55
+
56
+ override registerMenus(menus: MenuModelRegistry): void {
57
+ menus.registerMenuAction(NavigatorContextMenu.SEARCH, {
58
+ commandId: ScmHistoryCommands.OPEN_FILE_HISTORY.id,
59
+ label: SCM_HISTORY_LABEL
60
+ });
61
+ menus.registerMenuAction(EDITOR_CONTEXT_MENU_SCM, {
62
+ commandId: ScmHistoryCommands.OPEN_FILE_HISTORY.id,
63
+ label: SCM_HISTORY_LABEL
64
+ });
65
+ super.registerMenus(menus);
66
+ }
67
+
68
+ override registerCommands(commands: CommandRegistry): void {
69
+ commands.registerCommand(ScmHistoryCommands.OPEN_FILE_HISTORY, this.newUriAwareCommandHandler({
70
+ isEnabled: (uri: URI) => !!this.scmService.findRepository(uri),
71
+ isVisible: (uri: URI) => !!this.scmService.findRepository(uri),
72
+ execute: async uri => this.openView({ activate: true, uri: uri.toString() }),
73
+ }));
74
+ super.registerCommands(commands);
75
+ }
76
+
77
+ protected async refreshWidget(uri: string | undefined): Promise<void> {
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
+
86
+ protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI> {
87
+ return UriAwareCommandHandler.MonoSelect(this.selectionService, handler);
88
+ }
89
+
90
+ }
@@ -1,36 +1,36 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Arm and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { interfaces } from '@theia/core/shared/inversify';
18
- import { ScmHistoryContribution, SCM_HISTORY_ID } from './scm-history-contribution';
19
- import { WidgetFactory, bindViewContribution, ApplicationShellLayoutMigration } from '@theia/core/lib/browser';
20
- import { ScmHistoryWidget } from './scm-history-widget';
21
- import { ScmExtraLayoutVersion4Migration } from '../scm-extra-layout-migrations';
22
-
23
- import '../../../src/browser/style/history.css';
24
-
25
- export function bindScmHistoryModule(bind: interfaces.Bind): void {
26
-
27
- bind(ScmHistoryWidget).toSelf();
28
- bind(WidgetFactory).toDynamicValue(ctx => ({
29
- id: SCM_HISTORY_ID,
30
- createWidget: () => ctx.container.get<ScmHistoryWidget>(ScmHistoryWidget)
31
- }));
32
-
33
- bindViewContribution(bind, ScmHistoryContribution);
34
-
35
- bind(ApplicationShellLayoutMigration).to(ScmExtraLayoutVersion4Migration).inSingletonScope();
36
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Arm and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { interfaces } from '@theia/core/shared/inversify';
18
+ import { ScmHistoryContribution, SCM_HISTORY_ID } from './scm-history-contribution';
19
+ import { WidgetFactory, bindViewContribution, ApplicationShellLayoutMigration } from '@theia/core/lib/browser';
20
+ import { ScmHistoryWidget } from './scm-history-widget';
21
+ import { ScmExtraLayoutVersion4Migration } from '../scm-extra-layout-migrations';
22
+
23
+ import '../../../src/browser/style/history.css';
24
+
25
+ export function bindScmHistoryModule(bind: interfaces.Bind): void {
26
+
27
+ bind(ScmHistoryWidget).toSelf();
28
+ bind(WidgetFactory).toDynamicValue(ctx => ({
29
+ id: SCM_HISTORY_ID,
30
+ createWidget: () => ctx.container.get<ScmHistoryWidget>(ScmHistoryWidget)
31
+ }));
32
+
33
+ bindViewContribution(bind, ScmHistoryContribution);
34
+
35
+ bind(ApplicationShellLayoutMigration).to(ScmExtraLayoutVersion4Migration).inSingletonScope();
36
+ }
@@ -1,27 +1,27 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 Arm and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { ScmProvider } from '@theia/scm/lib/browser/scm-provider';
18
- import { ScmHistorySupport } from './scm-history-constants';
19
-
20
- export interface ScmHistoryProvider extends ScmProvider {
21
- historySupport?: ScmHistorySupport;
22
- }
23
- export namespace ScmHistoryProvider {
24
- export function is(scmProvider: ScmProvider | undefined): scmProvider is ScmHistoryProvider {
25
- return !!scmProvider && 'historySupport' in scmProvider;
26
- }
27
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 Arm and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ScmProvider } from '@theia/scm/lib/browser/scm-provider';
18
+ import { ScmHistorySupport } from './scm-history-constants';
19
+
20
+ export interface ScmHistoryProvider extends ScmProvider {
21
+ historySupport?: ScmHistorySupport;
22
+ }
23
+ export namespace ScmHistoryProvider {
24
+ export function is(scmProvider: ScmProvider | undefined): scmProvider is ScmHistoryProvider {
25
+ return !!scmProvider && 'historySupport' in scmProvider;
26
+ }
27
+ }