@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.
- package/LICENSE +641 -641
- package/README.md +32 -32
- package/lib/browser/history/index.d.ts +3 -3
- package/lib/browser/history/index.js +31 -31
- package/lib/browser/history/scm-history-constants.d.ts +38 -38
- package/lib/browser/history/scm-history-constants.js +41 -41
- package/lib/browser/history/scm-history-contribution.d.ts +18 -18
- package/lib/browser/history/scm-history-contribution.js +101 -101
- package/lib/browser/history/scm-history-frontend-module.d.ts +3 -3
- package/lib/browser/history/scm-history-frontend-module.js +33 -33
- package/lib/browser/history/scm-history-provider.d.ts +8 -8
- package/lib/browser/history/scm-history-provider.js +25 -25
- package/lib/browser/history/scm-history-widget.d.ts +89 -89
- package/lib/browser/history/scm-history-widget.js +487 -487
- package/lib/browser/scm-extra-contribution.d.ts +1 -1
- package/lib/browser/scm-extra-contribution.js +20 -20
- package/lib/browser/scm-extra-frontend-module.d.ts +3 -3
- package/lib/browser/scm-extra-frontend-module.js +26 -26
- package/lib/browser/scm-extra-layout-migrations.d.ts +5 -5
- package/lib/browser/scm-extra-layout-migrations.js +42 -42
- package/lib/browser/scm-file-change-label-provider.d.ts +16 -16
- package/lib/browser/scm-file-change-label-provider.js +79 -79
- package/lib/browser/scm-file-change-node.d.ts +23 -23
- package/lib/browser/scm-file-change-node.js +26 -26
- package/lib/browser/scm-navigable-list-widget.d.ts +56 -56
- package/lib/browser/scm-navigable-list-widget.js +179 -179
- package/package.json +8 -8
- package/src/browser/history/index.ts +21 -21
- package/src/browser/history/scm-history-constants.ts +69 -69
- package/src/browser/history/scm-history-contribution.ts +90 -90
- package/src/browser/history/scm-history-frontend-module.ts +36 -36
- package/src/browser/history/scm-history-provider.ts +27 -27
- package/src/browser/history/scm-history-widget.tsx +566 -566
- package/src/browser/scm-extra-contribution.ts +18 -18
- package/src/browser/scm-extra-frontend-module.ts +27 -27
- package/src/browser/scm-extra-layout-migrations.ts +32 -32
- package/src/browser/scm-file-change-label-provider.ts +73 -73
- package/src/browser/scm-file-change-node.ts +45 -45
- package/src/browser/scm-navigable-list-widget.tsx +197 -197
- package/src/browser/style/history.css +127 -127
|
@@ -1,180 +1,180 @@
|
|
|
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 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.ScmItemComponent = exports.ScmNavigableListWidget = void 0;
|
|
28
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
-
const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
|
|
30
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
31
|
-
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
32
|
-
const domutils_1 = require("@theia/core/shared/@phosphor/domutils");
|
|
33
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
34
|
-
const react_widget_1 = require("@theia/core/lib/browser/widgets/react-widget");
|
|
35
|
-
const React = require("@theia/core/shared/react");
|
|
36
|
-
const scm_file_change_label_provider_1 = require("./scm-file-change-label-provider");
|
|
37
|
-
let ScmNavigableListWidget = class ScmNavigableListWidget extends react_widget_1.ReactWidget {
|
|
38
|
-
constructor() {
|
|
39
|
-
super();
|
|
40
|
-
this.scmNodes = [];
|
|
41
|
-
this.node.tabIndex = 0;
|
|
42
|
-
}
|
|
43
|
-
onActivateRequest(msg) {
|
|
44
|
-
super.onActivateRequest(msg);
|
|
45
|
-
this.update();
|
|
46
|
-
this.node.focus();
|
|
47
|
-
}
|
|
48
|
-
set scrollContainer(id) {
|
|
49
|
-
this._scrollContainer = id + Date.now();
|
|
50
|
-
}
|
|
51
|
-
get scrollContainer() {
|
|
52
|
-
return this._scrollContainer;
|
|
53
|
-
}
|
|
54
|
-
onUpdateRequest(msg) {
|
|
55
|
-
if (!this.isAttached || !this.isVisible) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
super.onUpdateRequest(msg);
|
|
59
|
-
(async () => {
|
|
60
|
-
const selected = this.node.getElementsByClassName(browser_1.SELECTED_CLASS)[0];
|
|
61
|
-
if (selected) {
|
|
62
|
-
const container = document.getElementById(this.scrollContainer);
|
|
63
|
-
if (container) {
|
|
64
|
-
domutils_1.ElementExt.scrollIntoViewIfNeeded(container, selected);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
})();
|
|
68
|
-
}
|
|
69
|
-
onResize(msg) {
|
|
70
|
-
super.onResize(msg);
|
|
71
|
-
this.update();
|
|
72
|
-
}
|
|
73
|
-
getRepositoryLabel(uri) {
|
|
74
|
-
const repository = this.scmService.findRepository(new uri_1.default(uri));
|
|
75
|
-
const isSelectedRepo = this.scmService.selectedRepository && repository && this.scmService.selectedRepository.provider.rootUri === repository.provider.rootUri;
|
|
76
|
-
return repository && !isSelectedRepo ? this.labelProvider.getLongName(new uri_1.default(repository.provider.rootUri)) : undefined;
|
|
77
|
-
}
|
|
78
|
-
renderHeaderRow({ name, value, classNames, title }) {
|
|
79
|
-
if (!value) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const className = ['header-row', ...(classNames || [])].join(' ');
|
|
83
|
-
return React.createElement("div", { key: name, className: className, title: title },
|
|
84
|
-
React.createElement("div", { className: 'theia-header' }, name),
|
|
85
|
-
React.createElement("div", { className: 'header-value' }, value));
|
|
86
|
-
}
|
|
87
|
-
addListNavigationKeyListeners(container) {
|
|
88
|
-
this.addKeyListener(container, browser_1.Key.ARROW_LEFT, () => this.navigateLeft());
|
|
89
|
-
this.addKeyListener(container, browser_1.Key.ARROW_RIGHT, () => this.navigateRight());
|
|
90
|
-
this.addKeyListener(container, browser_1.Key.ARROW_UP, () => this.navigateUp());
|
|
91
|
-
this.addKeyListener(container, browser_1.Key.ARROW_DOWN, () => this.navigateDown());
|
|
92
|
-
this.addKeyListener(container, browser_1.Key.ENTER, () => this.handleListEnter());
|
|
93
|
-
}
|
|
94
|
-
navigateLeft() {
|
|
95
|
-
this.selectPreviousNode();
|
|
96
|
-
}
|
|
97
|
-
navigateRight() {
|
|
98
|
-
this.selectNextNode();
|
|
99
|
-
}
|
|
100
|
-
navigateUp() {
|
|
101
|
-
this.selectPreviousNode();
|
|
102
|
-
}
|
|
103
|
-
navigateDown() {
|
|
104
|
-
this.selectNextNode();
|
|
105
|
-
}
|
|
106
|
-
handleListEnter() {
|
|
107
|
-
}
|
|
108
|
-
getSelected() {
|
|
109
|
-
return this.scmNodes ? this.scmNodes.find(c => c.selected || false) : undefined;
|
|
110
|
-
}
|
|
111
|
-
selectNode(node) {
|
|
112
|
-
const n = this.getSelected();
|
|
113
|
-
if (n) {
|
|
114
|
-
n.selected = false;
|
|
115
|
-
}
|
|
116
|
-
node.selected = true;
|
|
117
|
-
this.update();
|
|
118
|
-
}
|
|
119
|
-
selectNextNode() {
|
|
120
|
-
const idx = this.indexOfSelected;
|
|
121
|
-
if (idx >= 0 && idx < this.scmNodes.length - 1) {
|
|
122
|
-
this.selectNode(this.scmNodes[idx + 1]);
|
|
123
|
-
}
|
|
124
|
-
else if (this.scmNodes.length > 0 && idx === -1) {
|
|
125
|
-
this.selectNode(this.scmNodes[0]);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
selectPreviousNode() {
|
|
129
|
-
const idx = this.indexOfSelected;
|
|
130
|
-
if (idx > 0) {
|
|
131
|
-
this.selectNode(this.scmNodes[idx - 1]);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
get indexOfSelected() {
|
|
135
|
-
if (this.scmNodes && this.scmNodes.length > 0) {
|
|
136
|
-
return this.scmNodes.findIndex(c => c.selected || false);
|
|
137
|
-
}
|
|
138
|
-
return -1;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
__decorate([
|
|
142
|
-
(0, inversify_1.inject)(scm_service_1.ScmService),
|
|
143
|
-
__metadata("design:type", scm_service_1.ScmService)
|
|
144
|
-
], ScmNavigableListWidget.prototype, "scmService", void 0);
|
|
145
|
-
__decorate([
|
|
146
|
-
(0, inversify_1.inject)(label_provider_1.LabelProvider),
|
|
147
|
-
__metadata("design:type", label_provider_1.LabelProvider)
|
|
148
|
-
], ScmNavigableListWidget.prototype, "labelProvider", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
(0, inversify_1.inject)(scm_file_change_label_provider_1.ScmFileChangeLabelProvider),
|
|
151
|
-
__metadata("design:type", scm_file_change_label_provider_1.ScmFileChangeLabelProvider)
|
|
152
|
-
], ScmNavigableListWidget.prototype, "scmLabelProvider", void 0);
|
|
153
|
-
ScmNavigableListWidget = __decorate([
|
|
154
|
-
(0, inversify_1.injectable)(),
|
|
155
|
-
__metadata("design:paramtypes", [])
|
|
156
|
-
], ScmNavigableListWidget);
|
|
157
|
-
exports.ScmNavigableListWidget = ScmNavigableListWidget;
|
|
158
|
-
class ScmItemComponent extends React.Component {
|
|
159
|
-
constructor() {
|
|
160
|
-
super(...arguments);
|
|
161
|
-
this.revealChange = () => this.props.revealChange(this.props.change);
|
|
162
|
-
this.selectNode = () => this.props.selectNode(this.props.change);
|
|
163
|
-
}
|
|
164
|
-
render() {
|
|
165
|
-
const { labelProvider, scmLabelProvider, change } = this.props;
|
|
166
|
-
const icon = labelProvider.getIcon(change);
|
|
167
|
-
const label = labelProvider.getName(change);
|
|
168
|
-
const description = labelProvider.getLongName(change);
|
|
169
|
-
const caption = scmLabelProvider.getCaption(change);
|
|
170
|
-
const statusCaption = scmLabelProvider.getStatusCaption(change);
|
|
171
|
-
return React.createElement("div", { className: `scmItem noselect${change.selected ? ' ' + browser_1.SELECTED_CLASS : ''}`, onDoubleClick: this.revealChange, onClick: this.selectNode },
|
|
172
|
-
React.createElement("span", { className: icon + ' file-icon' }),
|
|
173
|
-
React.createElement("div", { className: 'noWrapInfo', title: caption },
|
|
174
|
-
React.createElement("span", { className: 'name' }, label + ' '),
|
|
175
|
-
React.createElement("span", { className: 'path' }, description)),
|
|
176
|
-
React.createElement("div", { title: caption, className: change.fileChange.getClassNameForStatus() }, statusCaption.charAt(0)));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.ScmItemComponent = ScmItemComponent;
|
|
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 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.ScmItemComponent = exports.ScmNavigableListWidget = void 0;
|
|
28
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
+
const scm_service_1 = require("@theia/scm/lib/browser/scm-service");
|
|
30
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
31
|
+
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
32
|
+
const domutils_1 = require("@theia/core/shared/@phosphor/domutils");
|
|
33
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
34
|
+
const react_widget_1 = require("@theia/core/lib/browser/widgets/react-widget");
|
|
35
|
+
const React = require("@theia/core/shared/react");
|
|
36
|
+
const scm_file_change_label_provider_1 = require("./scm-file-change-label-provider");
|
|
37
|
+
let ScmNavigableListWidget = class ScmNavigableListWidget extends react_widget_1.ReactWidget {
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
this.scmNodes = [];
|
|
41
|
+
this.node.tabIndex = 0;
|
|
42
|
+
}
|
|
43
|
+
onActivateRequest(msg) {
|
|
44
|
+
super.onActivateRequest(msg);
|
|
45
|
+
this.update();
|
|
46
|
+
this.node.focus();
|
|
47
|
+
}
|
|
48
|
+
set scrollContainer(id) {
|
|
49
|
+
this._scrollContainer = id + Date.now();
|
|
50
|
+
}
|
|
51
|
+
get scrollContainer() {
|
|
52
|
+
return this._scrollContainer;
|
|
53
|
+
}
|
|
54
|
+
onUpdateRequest(msg) {
|
|
55
|
+
if (!this.isAttached || !this.isVisible) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
super.onUpdateRequest(msg);
|
|
59
|
+
(async () => {
|
|
60
|
+
const selected = this.node.getElementsByClassName(browser_1.SELECTED_CLASS)[0];
|
|
61
|
+
if (selected) {
|
|
62
|
+
const container = document.getElementById(this.scrollContainer);
|
|
63
|
+
if (container) {
|
|
64
|
+
domutils_1.ElementExt.scrollIntoViewIfNeeded(container, selected);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})();
|
|
68
|
+
}
|
|
69
|
+
onResize(msg) {
|
|
70
|
+
super.onResize(msg);
|
|
71
|
+
this.update();
|
|
72
|
+
}
|
|
73
|
+
getRepositoryLabel(uri) {
|
|
74
|
+
const repository = this.scmService.findRepository(new uri_1.default(uri));
|
|
75
|
+
const isSelectedRepo = this.scmService.selectedRepository && repository && this.scmService.selectedRepository.provider.rootUri === repository.provider.rootUri;
|
|
76
|
+
return repository && !isSelectedRepo ? this.labelProvider.getLongName(new uri_1.default(repository.provider.rootUri)) : undefined;
|
|
77
|
+
}
|
|
78
|
+
renderHeaderRow({ name, value, classNames, title }) {
|
|
79
|
+
if (!value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const className = ['header-row', ...(classNames || [])].join(' ');
|
|
83
|
+
return React.createElement("div", { key: name, className: className, title: title },
|
|
84
|
+
React.createElement("div", { className: 'theia-header' }, name),
|
|
85
|
+
React.createElement("div", { className: 'header-value' }, value));
|
|
86
|
+
}
|
|
87
|
+
addListNavigationKeyListeners(container) {
|
|
88
|
+
this.addKeyListener(container, browser_1.Key.ARROW_LEFT, () => this.navigateLeft());
|
|
89
|
+
this.addKeyListener(container, browser_1.Key.ARROW_RIGHT, () => this.navigateRight());
|
|
90
|
+
this.addKeyListener(container, browser_1.Key.ARROW_UP, () => this.navigateUp());
|
|
91
|
+
this.addKeyListener(container, browser_1.Key.ARROW_DOWN, () => this.navigateDown());
|
|
92
|
+
this.addKeyListener(container, browser_1.Key.ENTER, () => this.handleListEnter());
|
|
93
|
+
}
|
|
94
|
+
navigateLeft() {
|
|
95
|
+
this.selectPreviousNode();
|
|
96
|
+
}
|
|
97
|
+
navigateRight() {
|
|
98
|
+
this.selectNextNode();
|
|
99
|
+
}
|
|
100
|
+
navigateUp() {
|
|
101
|
+
this.selectPreviousNode();
|
|
102
|
+
}
|
|
103
|
+
navigateDown() {
|
|
104
|
+
this.selectNextNode();
|
|
105
|
+
}
|
|
106
|
+
handleListEnter() {
|
|
107
|
+
}
|
|
108
|
+
getSelected() {
|
|
109
|
+
return this.scmNodes ? this.scmNodes.find(c => c.selected || false) : undefined;
|
|
110
|
+
}
|
|
111
|
+
selectNode(node) {
|
|
112
|
+
const n = this.getSelected();
|
|
113
|
+
if (n) {
|
|
114
|
+
n.selected = false;
|
|
115
|
+
}
|
|
116
|
+
node.selected = true;
|
|
117
|
+
this.update();
|
|
118
|
+
}
|
|
119
|
+
selectNextNode() {
|
|
120
|
+
const idx = this.indexOfSelected;
|
|
121
|
+
if (idx >= 0 && idx < this.scmNodes.length - 1) {
|
|
122
|
+
this.selectNode(this.scmNodes[idx + 1]);
|
|
123
|
+
}
|
|
124
|
+
else if (this.scmNodes.length > 0 && idx === -1) {
|
|
125
|
+
this.selectNode(this.scmNodes[0]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
selectPreviousNode() {
|
|
129
|
+
const idx = this.indexOfSelected;
|
|
130
|
+
if (idx > 0) {
|
|
131
|
+
this.selectNode(this.scmNodes[idx - 1]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
get indexOfSelected() {
|
|
135
|
+
if (this.scmNodes && this.scmNodes.length > 0) {
|
|
136
|
+
return this.scmNodes.findIndex(c => c.selected || false);
|
|
137
|
+
}
|
|
138
|
+
return -1;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, inversify_1.inject)(scm_service_1.ScmService),
|
|
143
|
+
__metadata("design:type", scm_service_1.ScmService)
|
|
144
|
+
], ScmNavigableListWidget.prototype, "scmService", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, inversify_1.inject)(label_provider_1.LabelProvider),
|
|
147
|
+
__metadata("design:type", label_provider_1.LabelProvider)
|
|
148
|
+
], ScmNavigableListWidget.prototype, "labelProvider", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, inversify_1.inject)(scm_file_change_label_provider_1.ScmFileChangeLabelProvider),
|
|
151
|
+
__metadata("design:type", scm_file_change_label_provider_1.ScmFileChangeLabelProvider)
|
|
152
|
+
], ScmNavigableListWidget.prototype, "scmLabelProvider", void 0);
|
|
153
|
+
ScmNavigableListWidget = __decorate([
|
|
154
|
+
(0, inversify_1.injectable)(),
|
|
155
|
+
__metadata("design:paramtypes", [])
|
|
156
|
+
], ScmNavigableListWidget);
|
|
157
|
+
exports.ScmNavigableListWidget = ScmNavigableListWidget;
|
|
158
|
+
class ScmItemComponent extends React.Component {
|
|
159
|
+
constructor() {
|
|
160
|
+
super(...arguments);
|
|
161
|
+
this.revealChange = () => this.props.revealChange(this.props.change);
|
|
162
|
+
this.selectNode = () => this.props.selectNode(this.props.change);
|
|
163
|
+
}
|
|
164
|
+
render() {
|
|
165
|
+
const { labelProvider, scmLabelProvider, change } = this.props;
|
|
166
|
+
const icon = labelProvider.getIcon(change);
|
|
167
|
+
const label = labelProvider.getName(change);
|
|
168
|
+
const description = labelProvider.getLongName(change);
|
|
169
|
+
const caption = scmLabelProvider.getCaption(change);
|
|
170
|
+
const statusCaption = scmLabelProvider.getStatusCaption(change);
|
|
171
|
+
return React.createElement("div", { className: `scmItem noselect${change.selected ? ' ' + browser_1.SELECTED_CLASS : ''}`, onDoubleClick: this.revealChange, onClick: this.selectNode },
|
|
172
|
+
React.createElement("span", { className: icon + ' file-icon' }),
|
|
173
|
+
React.createElement("div", { className: 'noWrapInfo', title: caption },
|
|
174
|
+
React.createElement("span", { className: 'name' }, label + ' '),
|
|
175
|
+
React.createElement("span", { className: 'path' }, description)),
|
|
176
|
+
React.createElement("div", { title: caption, className: change.fileChange.getClassNameForStatus() }, statusCaption.charAt(0)));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.ScmItemComponent = ScmItemComponent;
|
|
180
180
|
//# sourceMappingURL=scm-navigable-list-widget.js.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/scm-extra",
|
|
3
|
-
"version": "1.34.
|
|
3
|
+
"version": "1.34.3",
|
|
4
4
|
"description": "Theia - Source control extras Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.34.
|
|
7
|
-
"@theia/editor": "1.34.
|
|
8
|
-
"@theia/filesystem": "1.34.
|
|
9
|
-
"@theia/navigator": "1.34.
|
|
10
|
-
"@theia/scm": "1.34.
|
|
6
|
+
"@theia/core": "1.34.3",
|
|
7
|
+
"@theia/editor": "1.34.3",
|
|
8
|
+
"@theia/filesystem": "1.34.3",
|
|
9
|
+
"@theia/navigator": "1.34.3",
|
|
10
|
+
"@theia/scm": "1.34.3"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"watch": "theiaext watch"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@theia/ext-scripts": "1.34.
|
|
45
|
+
"@theia/ext-scripts": "1.34.3"
|
|
46
46
|
},
|
|
47
47
|
"nyc": {
|
|
48
48
|
"extends": "../../configs/nyc.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "a6cf9fe96b1624d6e27a11dce2ebdeae820478e5"
|
|
51
51
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
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
|
-
export * from './scm-history-provider';
|
|
18
|
-
import { ScmHistorySupport } from './scm-history-widget';
|
|
19
|
-
|
|
20
|
-
export { ScmHistorySupport };
|
|
21
|
-
|
|
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
|
+
export * from './scm-history-provider';
|
|
18
|
+
import { ScmHistorySupport } from './scm-history-widget';
|
|
19
|
+
|
|
20
|
+
export { ScmHistorySupport };
|
|
21
|
+
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 Ericsson 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 { Command, Event, nls } from '@theia/core';
|
|
18
|
-
import { OpenViewArguments } from '@theia/core/lib/browser';
|
|
19
|
-
import { ScmFileChangeNode, ScmHistoryCommit } from '../scm-file-change-node';
|
|
20
|
-
|
|
21
|
-
export const SCM_HISTORY_ID = 'scm-history';
|
|
22
|
-
export const SCM_HISTORY_LABEL = nls.localize('theia/scm/history', 'History');
|
|
23
|
-
export const SCM_HISTORY_TOGGLE_KEYBINDING = 'alt+h';
|
|
24
|
-
export const SCM_HISTORY_MAX_COUNT = 100;
|
|
25
|
-
|
|
26
|
-
export namespace ScmHistoryCommands {
|
|
27
|
-
export const OPEN_FILE_HISTORY: Command = {
|
|
28
|
-
id: 'scm-history:open-file-history',
|
|
29
|
-
};
|
|
30
|
-
export const OPEN_BRANCH_HISTORY: Command = {
|
|
31
|
-
id: 'scm-history:open-branch-history',
|
|
32
|
-
label: SCM_HISTORY_LABEL
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ScmHistoryOpenViewArguments extends OpenViewArguments {
|
|
37
|
-
uri: string | undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const ScmHistorySupport = Symbol('scm-history-support');
|
|
41
|
-
export interface ScmHistorySupport {
|
|
42
|
-
getCommitHistory(options?: HistoryWidgetOptions): Promise<ScmHistoryCommit[]>;
|
|
43
|
-
readonly onDidChangeHistory: Event<void>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface ScmCommitNode {
|
|
47
|
-
commitDetails: ScmHistoryCommit;
|
|
48
|
-
authorAvatar: string;
|
|
49
|
-
fileChangeNodes: ScmFileChangeNode[];
|
|
50
|
-
expanded: boolean;
|
|
51
|
-
selected: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export namespace ScmCommitNode {
|
|
55
|
-
export function is(node: unknown): node is ScmCommitNode {
|
|
56
|
-
return !!node && typeof node === 'object' && 'commitDetails' in node && 'expanded' in node && 'selected' in node;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface HistoryWidgetOptions {
|
|
61
|
-
range?: {
|
|
62
|
-
toRevision?: string;
|
|
63
|
-
fromRevision?: string;
|
|
64
|
-
};
|
|
65
|
-
uri?: string;
|
|
66
|
-
maxCount?: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type ScmHistoryListNode = (ScmCommitNode | ScmFileChangeNode);
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Ericsson 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 { Command, Event, nls } from '@theia/core';
|
|
18
|
+
import { OpenViewArguments } from '@theia/core/lib/browser';
|
|
19
|
+
import { ScmFileChangeNode, ScmHistoryCommit } from '../scm-file-change-node';
|
|
20
|
+
|
|
21
|
+
export const SCM_HISTORY_ID = 'scm-history';
|
|
22
|
+
export const SCM_HISTORY_LABEL = nls.localize('theia/scm/history', 'History');
|
|
23
|
+
export const SCM_HISTORY_TOGGLE_KEYBINDING = 'alt+h';
|
|
24
|
+
export const SCM_HISTORY_MAX_COUNT = 100;
|
|
25
|
+
|
|
26
|
+
export namespace ScmHistoryCommands {
|
|
27
|
+
export const OPEN_FILE_HISTORY: Command = {
|
|
28
|
+
id: 'scm-history:open-file-history',
|
|
29
|
+
};
|
|
30
|
+
export const OPEN_BRANCH_HISTORY: Command = {
|
|
31
|
+
id: 'scm-history:open-branch-history',
|
|
32
|
+
label: SCM_HISTORY_LABEL
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ScmHistoryOpenViewArguments extends OpenViewArguments {
|
|
37
|
+
uri: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const ScmHistorySupport = Symbol('scm-history-support');
|
|
41
|
+
export interface ScmHistorySupport {
|
|
42
|
+
getCommitHistory(options?: HistoryWidgetOptions): Promise<ScmHistoryCommit[]>;
|
|
43
|
+
readonly onDidChangeHistory: Event<void>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ScmCommitNode {
|
|
47
|
+
commitDetails: ScmHistoryCommit;
|
|
48
|
+
authorAvatar: string;
|
|
49
|
+
fileChangeNodes: ScmFileChangeNode[];
|
|
50
|
+
expanded: boolean;
|
|
51
|
+
selected: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export namespace ScmCommitNode {
|
|
55
|
+
export function is(node: unknown): node is ScmCommitNode {
|
|
56
|
+
return !!node && typeof node === 'object' && 'commitDetails' in node && 'expanded' in node && 'selected' in node;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface HistoryWidgetOptions {
|
|
61
|
+
range?: {
|
|
62
|
+
toRevision?: string;
|
|
63
|
+
fromRevision?: string;
|
|
64
|
+
};
|
|
65
|
+
uri?: string;
|
|
66
|
+
maxCount?: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type ScmHistoryListNode = (ScmCommitNode | ScmFileChangeNode);
|