@theia/scm 1.53.0-next.55 → 1.53.0-next.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -31
- package/lib/browser/scm-commit-widget.js +1 -1
- package/lib/browser/scm-contribution.js +5 -5
- package/package.json +6 -6
- package/src/browser/decorations/scm-decorations-service.ts +102 -102
- package/src/browser/decorations/scm-navigator-decorator.ts +121 -121
- package/src/browser/decorations/scm-tab-bar-decorator.ts +83 -83
- package/src/browser/dirty-diff/content-lines.spec.ts +42 -42
- package/src/browser/dirty-diff/content-lines.ts +121 -121
- package/src/browser/dirty-diff/diff-computer.spec.ts +455 -455
- package/src/browser/dirty-diff/diff-computer.ts +177 -177
- package/src/browser/dirty-diff/dirty-diff-decorator.ts +114 -114
- package/src/browser/dirty-diff/dirty-diff-module.ts +33 -33
- package/src/browser/dirty-diff/dirty-diff-navigator.ts +288 -288
- package/src/browser/dirty-diff/dirty-diff-widget.ts +364 -364
- package/src/browser/scm-amend-component.tsx +600 -600
- package/src/browser/scm-amend-widget.tsx +77 -77
- package/src/browser/scm-avatar-service.ts +27 -27
- package/src/browser/scm-colors.ts +21 -21
- package/src/browser/scm-commit-widget.tsx +215 -215
- package/src/browser/scm-context-key-service.ts +46 -46
- package/src/browser/scm-contribution.ts +452 -452
- package/src/browser/scm-frontend-module.ts +149 -149
- package/src/browser/scm-groups-tree-model.ts +78 -78
- package/src/browser/scm-input.ts +164 -164
- package/src/browser/scm-layout-migrations.ts +64 -64
- package/src/browser/scm-no-repository-widget.tsx +41 -41
- package/src/browser/scm-preferences.ts +63 -63
- package/src/browser/scm-provider.ts +91 -91
- package/src/browser/scm-quick-open-service.ts +48 -48
- package/src/browser/scm-repository.ts +52 -52
- package/src/browser/scm-service.ts +108 -108
- package/src/browser/scm-tree-label-provider.ts +44 -44
- package/src/browser/scm-tree-model.ts +405 -405
- package/src/browser/scm-tree-widget.tsx +838 -838
- package/src/browser/scm-widget.tsx +204 -204
- package/src/browser/style/dirty-diff-decorator.css +53 -53
- package/src/browser/style/dirty-diff.css +50 -50
- package/src/browser/style/index.css +271 -271
- package/src/browser/style/scm-amend-component.css +94 -94
- package/src/browser/style/scm.svg +4 -4
|
@@ -1,77 +1,77 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { SelectionService } from '@theia/core/lib/common';
|
|
19
|
-
import * as React from '@theia/core/shared/react';
|
|
20
|
-
import {
|
|
21
|
-
ContextMenuRenderer, ReactWidget, LabelProvider, KeybindingRegistry, StorageService
|
|
22
|
-
} from '@theia/core/lib/browser';
|
|
23
|
-
import { ScmService } from './scm-service';
|
|
24
|
-
import { ScmAvatarService } from './scm-avatar-service';
|
|
25
|
-
import { ScmAmendComponent } from './scm-amend-component';
|
|
26
|
-
|
|
27
|
-
@injectable()
|
|
28
|
-
export class ScmAmendWidget extends ReactWidget {
|
|
29
|
-
|
|
30
|
-
static ID = 'scm-amend-widget';
|
|
31
|
-
|
|
32
|
-
@inject(ScmService) protected readonly scmService: ScmService;
|
|
33
|
-
@inject(ScmAvatarService) protected readonly avatarService: ScmAvatarService;
|
|
34
|
-
@inject(StorageService) protected readonly storageService: StorageService;
|
|
35
|
-
@inject(SelectionService) protected readonly selectionService: SelectionService;
|
|
36
|
-
@inject(LabelProvider) protected readonly labelProvider: LabelProvider;
|
|
37
|
-
@inject(KeybindingRegistry) protected readonly keybindings: KeybindingRegistry;
|
|
38
|
-
|
|
39
|
-
protected shouldScrollToRow = true;
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
@inject(ContextMenuRenderer) protected readonly contextMenuRenderer: ContextMenuRenderer,
|
|
43
|
-
) {
|
|
44
|
-
super();
|
|
45
|
-
this.scrollOptions = {
|
|
46
|
-
suppressScrollX: true,
|
|
47
|
-
minScrollbarLength: 35
|
|
48
|
-
};
|
|
49
|
-
this.id = ScmAmendWidget.ID;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
protected render(): React.ReactNode {
|
|
53
|
-
const repository = this.scmService.selectedRepository;
|
|
54
|
-
if (repository && repository.provider.amendSupport) {
|
|
55
|
-
return React.createElement(
|
|
56
|
-
ScmAmendComponent,
|
|
57
|
-
{
|
|
58
|
-
key: `amend:${repository.provider.rootUri}`,
|
|
59
|
-
style: { flexGrow: 0 },
|
|
60
|
-
repository: repository,
|
|
61
|
-
scmAmendSupport: repository.provider.amendSupport,
|
|
62
|
-
setCommitMessage: this.setInputValue,
|
|
63
|
-
avatarService: this.avatarService,
|
|
64
|
-
storageService: this.storageService,
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
protected setInputValue = (event: React.FormEvent<HTMLTextAreaElement> | React.ChangeEvent<HTMLTextAreaElement> | string) => {
|
|
71
|
-
const repository = this.scmService.selectedRepository;
|
|
72
|
-
if (repository) {
|
|
73
|
-
repository.input.value = typeof event === 'string' ? event : event.currentTarget.value;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
}
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { SelectionService } from '@theia/core/lib/common';
|
|
19
|
+
import * as React from '@theia/core/shared/react';
|
|
20
|
+
import {
|
|
21
|
+
ContextMenuRenderer, ReactWidget, LabelProvider, KeybindingRegistry, StorageService
|
|
22
|
+
} from '@theia/core/lib/browser';
|
|
23
|
+
import { ScmService } from './scm-service';
|
|
24
|
+
import { ScmAvatarService } from './scm-avatar-service';
|
|
25
|
+
import { ScmAmendComponent } from './scm-amend-component';
|
|
26
|
+
|
|
27
|
+
@injectable()
|
|
28
|
+
export class ScmAmendWidget extends ReactWidget {
|
|
29
|
+
|
|
30
|
+
static ID = 'scm-amend-widget';
|
|
31
|
+
|
|
32
|
+
@inject(ScmService) protected readonly scmService: ScmService;
|
|
33
|
+
@inject(ScmAvatarService) protected readonly avatarService: ScmAvatarService;
|
|
34
|
+
@inject(StorageService) protected readonly storageService: StorageService;
|
|
35
|
+
@inject(SelectionService) protected readonly selectionService: SelectionService;
|
|
36
|
+
@inject(LabelProvider) protected readonly labelProvider: LabelProvider;
|
|
37
|
+
@inject(KeybindingRegistry) protected readonly keybindings: KeybindingRegistry;
|
|
38
|
+
|
|
39
|
+
protected shouldScrollToRow = true;
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
@inject(ContextMenuRenderer) protected readonly contextMenuRenderer: ContextMenuRenderer,
|
|
43
|
+
) {
|
|
44
|
+
super();
|
|
45
|
+
this.scrollOptions = {
|
|
46
|
+
suppressScrollX: true,
|
|
47
|
+
minScrollbarLength: 35
|
|
48
|
+
};
|
|
49
|
+
this.id = ScmAmendWidget.ID;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
protected render(): React.ReactNode {
|
|
53
|
+
const repository = this.scmService.selectedRepository;
|
|
54
|
+
if (repository && repository.provider.amendSupport) {
|
|
55
|
+
return React.createElement(
|
|
56
|
+
ScmAmendComponent,
|
|
57
|
+
{
|
|
58
|
+
key: `amend:${repository.provider.rootUri}`,
|
|
59
|
+
style: { flexGrow: 0 },
|
|
60
|
+
repository: repository,
|
|
61
|
+
scmAmendSupport: repository.provider.amendSupport,
|
|
62
|
+
setCommitMessage: this.setInputValue,
|
|
63
|
+
avatarService: this.avatarService,
|
|
64
|
+
storageService: this.storageService,
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected setInputValue = (event: React.FormEvent<HTMLTextAreaElement> | React.ChangeEvent<HTMLTextAreaElement> | string) => {
|
|
71
|
+
const repository = this.scmService.selectedRepository;
|
|
72
|
+
if (repository) {
|
|
73
|
+
repository.input.value = typeof event === 'string' ? event : event.currentTarget.value;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { Md5 } from 'ts-md5';
|
|
19
|
-
|
|
20
|
-
@injectable()
|
|
21
|
-
export class ScmAvatarService {
|
|
22
|
-
|
|
23
|
-
async getAvatar(email: string): Promise<string> {
|
|
24
|
-
const hash = Md5.hashStr(email);
|
|
25
|
-
return `https://www.gravatar.com/avatar/${hash}?d=robohash`;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { Md5 } from 'ts-md5';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class ScmAvatarService {
|
|
22
|
+
|
|
23
|
+
async getAvatar(email: string): Promise<string> {
|
|
24
|
+
const hash = Md5.hashStr(email);
|
|
25
|
+
return `https://www.gravatar.com/avatar/${hash}?d=robohash`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
export namespace ScmColors {
|
|
18
|
-
export const editorGutterModifiedBackground = 'editorGutter.modifiedBackground';
|
|
19
|
-
export const editorGutterAddedBackground = 'editorGutter.addedBackground';
|
|
20
|
-
export const editorGutterDeletedBackground = 'editorGutter.deletedBackground';
|
|
21
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
export namespace ScmColors {
|
|
18
|
+
export const editorGutterModifiedBackground = 'editorGutter.modifiedBackground';
|
|
19
|
+
export const editorGutterAddedBackground = 'editorGutter.addedBackground';
|
|
20
|
+
export const editorGutterDeletedBackground = 'editorGutter.deletedBackground';
|
|
21
|
+
}
|