@theia/scm 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 (95) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +31 -31
  3. package/lib/browser/decorations/scm-decorations-service.d.ts +14 -14
  4. package/lib/browser/decorations/scm-decorations-service.js +101 -101
  5. package/lib/browser/decorations/scm-navigator-decorator.d.ts +25 -25
  6. package/lib/browser/decorations/scm-navigator-decorator.js +132 -132
  7. package/lib/browser/decorations/scm-tab-bar-decorator.d.ts +17 -17
  8. package/lib/browser/decorations/scm-tab-bar-decorator.js +93 -93
  9. package/lib/browser/dirty-diff/content-lines.d.ts +12 -12
  10. package/lib/browser/dirty-diff/content-lines.js +106 -106
  11. package/lib/browser/dirty-diff/content-lines.spec.d.ts +1 -1
  12. package/lib/browser/dirty-diff/content-lines.spec.js +39 -39
  13. package/lib/browser/dirty-diff/diff-computer.d.ts +29 -29
  14. package/lib/browser/dirty-diff/diff-computer.js +102 -102
  15. package/lib/browser/dirty-diff/diff-computer.spec.d.ts +1 -1
  16. package/lib/browser/dirty-diff/diff-computer.spec.js +315 -315
  17. package/lib/browser/dirty-diff/dirty-diff-decorator.d.ts +14 -14
  18. package/lib/browser/dirty-diff/dirty-diff-decorator.js +98 -98
  19. package/lib/browser/dirty-diff/dirty-diff-module.d.ts +3 -3
  20. package/lib/browser/dirty-diff/dirty-diff-module.js +24 -24
  21. package/lib/browser/scm-amend-component.d.ts +123 -123
  22. package/lib/browser/scm-amend-component.js +423 -423
  23. package/lib/browser/scm-amend-widget.d.ts +20 -20
  24. package/lib/browser/scm-amend-widget.js +101 -101
  25. package/lib/browser/scm-avatar-service.d.ts +3 -3
  26. package/lib/browser/scm-avatar-service.js +36 -36
  27. package/lib/browser/scm-commit-widget.d.ts +52 -52
  28. package/lib/browser/scm-commit-widget.js +199 -199
  29. package/lib/browser/scm-context-key-service.d.ts +10 -10
  30. package/lib/browser/scm-context-key-service.js +58 -58
  31. package/lib/browser/scm-contribution.d.ts +83 -83
  32. package/lib/browser/scm-contribution.js +353 -353
  33. package/lib/browser/scm-frontend-module.d.ts +6 -6
  34. package/lib/browser/scm-frontend-module.js +130 -130
  35. package/lib/browser/scm-groups-tree-model.d.ts +14 -14
  36. package/lib/browser/scm-groups-tree-model.js +97 -97
  37. package/lib/browser/scm-input.d.ts +53 -53
  38. package/lib/browser/scm-input.js +127 -127
  39. package/lib/browser/scm-layout-migrations.d.ts +9 -9
  40. package/lib/browser/scm-layout-migrations.js +79 -79
  41. package/lib/browser/scm-no-repository-widget.d.ts +8 -8
  42. package/lib/browser/scm-no-repository-widget.js +49 -49
  43. package/lib/browser/scm-preferences.d.ts +11 -11
  44. package/lib/browser/scm-preferences.js +51 -51
  45. package/lib/browser/scm-provider.d.ts +56 -56
  46. package/lib/browser/scm-provider.js +19 -19
  47. package/lib/browser/scm-quick-open-service.d.ts +11 -11
  48. package/lib/browser/scm-quick-open-service.js +73 -73
  49. package/lib/browser/scm-repository.d.ts +17 -17
  50. package/lib/browser/scm-repository.js +41 -41
  51. package/lib/browser/scm-service.d.ts +26 -26
  52. package/lib/browser/scm-service.js +108 -108
  53. package/lib/browser/scm-tree-label-provider.d.ts +7 -7
  54. package/lib/browser/scm-tree-label-provider.js +57 -57
  55. package/lib/browser/scm-tree-model.d.ts +74 -74
  56. package/lib/browser/scm-tree-model.js +348 -348
  57. package/lib/browser/scm-tree-widget.d.ts +201 -201
  58. package/lib/browser/scm-tree-widget.js +664 -664
  59. package/lib/browser/scm-widget.d.ts +40 -40
  60. package/lib/browser/scm-widget.js +218 -218
  61. package/package.json +6 -6
  62. package/src/browser/decorations/scm-decorations-service.ts +78 -78
  63. package/src/browser/decorations/scm-navigator-decorator.ts +121 -121
  64. package/src/browser/decorations/scm-tab-bar-decorator.ts +83 -83
  65. package/src/browser/dirty-diff/content-lines.spec.ts +42 -42
  66. package/src/browser/dirty-diff/content-lines.ts +112 -112
  67. package/src/browser/dirty-diff/diff-computer.spec.ts +387 -387
  68. package/src/browser/dirty-diff/diff-computer.ts +129 -129
  69. package/src/browser/dirty-diff/dirty-diff-decorator.ts +107 -107
  70. package/src/browser/dirty-diff/dirty-diff-module.ts +24 -24
  71. package/src/browser/scm-amend-component.tsx +600 -600
  72. package/src/browser/scm-amend-widget.tsx +77 -77
  73. package/src/browser/scm-avatar-service.ts +27 -27
  74. package/src/browser/scm-commit-widget.tsx +215 -215
  75. package/src/browser/scm-context-key-service.ts +46 -46
  76. package/src/browser/scm-contribution.ts +361 -361
  77. package/src/browser/scm-frontend-module.ts +149 -149
  78. package/src/browser/scm-groups-tree-model.ts +78 -78
  79. package/src/browser/scm-input.ts +164 -164
  80. package/src/browser/scm-layout-migrations.ts +64 -64
  81. package/src/browser/scm-no-repository-widget.tsx +41 -41
  82. package/src/browser/scm-preferences.ts +63 -63
  83. package/src/browser/scm-provider.ts +89 -89
  84. package/src/browser/scm-quick-open-service.ts +48 -48
  85. package/src/browser/scm-repository.ts +52 -52
  86. package/src/browser/scm-service.ts +108 -108
  87. package/src/browser/scm-tree-label-provider.ts +44 -44
  88. package/src/browser/scm-tree-model.ts +405 -405
  89. package/src/browser/scm-tree-widget.tsx +809 -809
  90. package/src/browser/scm-widget.tsx +204 -204
  91. package/src/browser/style/dirty-diff-decorator.css +52 -52
  92. package/src/browser/style/dirty-diff.css +50 -50
  93. package/src/browser/style/index.css +267 -267
  94. package/src/browser/style/scm-amend-component.css +94 -94
  95. package/src/browser/style/scm.svg +4 -4
@@ -1,424 +1,424 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Arm and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ScmAmendComponent = void 0;
19
- require("../../src/browser/style/scm-amend-component.css");
20
- const React = require("@theia/core/shared/react");
21
- const browser_1 = require("@theia/core/lib/browser");
22
- const core_1 = require("@theia/core");
23
- const nls_1 = require("@theia/core/lib/common/nls");
24
- const TRANSITION_TIME_MS = 300;
25
- const REPOSITORY_STORAGE_KEY = 'scmRepository';
26
- class ScmAmendComponent extends React.Component {
27
- constructor(props) {
28
- super(props);
29
- /**
30
- * a hint on how to animate an update, set by certain user action handlers
31
- * and used when updating the view based on a repository change
32
- */
33
- this.transitionHint = 'none';
34
- this.lastCommitHeight = 0;
35
- this.lastCommitScrollRef = (instance) => {
36
- if (instance && this.lastCommitHeight === 0) {
37
- this.lastCommitHeight = instance.getBoundingClientRect().height;
38
- }
39
- };
40
- this.toDisposeOnUnmount = new core_1.DisposableCollection();
41
- /**
42
- * This function will update the 'model' (lastCommit, amendingCommits) only
43
- * when the repository sees the last commit change.
44
- * 'render' can be called at any time, so be sure we don't update any 'model'
45
- * fields until we actually start the transition.
46
- */
47
- this.amend = async () => {
48
- if (this.state.transition.state !== 'none' && this.transitionHint !== 'none') {
49
- return;
50
- }
51
- this.transitionHint = 'amend';
52
- await this.resetAndSetMessage('HEAD~', 'HEAD');
53
- };
54
- this.unamend = async () => {
55
- if (this.state.transition.state !== 'none' && this.transitionHint !== 'none') {
56
- return;
57
- }
58
- const commitToRestore = (this.state.amendingCommits.length >= 1)
59
- ? this.state.amendingCommits[this.state.amendingCommits.length - 1]
60
- : undefined;
61
- const oldestAmendCommit = (this.state.amendingCommits.length >= 2)
62
- ? this.state.amendingCommits[this.state.amendingCommits.length - 2]
63
- : undefined;
64
- if (commitToRestore) {
65
- const commitToUseForMessage = oldestAmendCommit
66
- ? oldestAmendCommit.commit.id
67
- : undefined;
68
- this.transitionHint = 'unamend';
69
- await this.resetAndSetMessage(commitToRestore.commit.id, commitToUseForMessage);
70
- }
71
- };
72
- this.unamendAll = () => this.doUnamendAll();
73
- this.clearAmending = () => this.doClearAmending();
74
- this.state = {
75
- transition: { state: 'none' },
76
- amendingCommits: [],
77
- lastCommit: undefined
78
- };
79
- const setState = this.setState.bind(this);
80
- this.setState = newState => {
81
- if (!this.toDisposeOnUnmount.disposed) {
82
- setState(newState);
83
- }
84
- };
85
- }
86
- async componentDidMount() {
87
- this.toDisposeOnUnmount.push(core_1.Disposable.create(() => { }));
88
- const lastCommit = await this.getLastCommit();
89
- this.setState({ amendingCommits: await this.buildAmendingList(lastCommit ? lastCommit.commit : undefined), lastCommit });
90
- if (this.toDisposeOnUnmount.disposed) {
91
- return;
92
- }
93
- this.toDisposeOnUnmount.push(this.props.repository.provider.onDidChange(() => this.fetchStatusAndSetState()));
94
- }
95
- componentWillUnmount() {
96
- this.toDisposeOnUnmount.dispose();
97
- }
98
- async fetchStatusAndSetState() {
99
- const storageKey = this.getStorageKey();
100
- const nextCommit = await this.getLastCommit();
101
- if (nextCommit && this.state.lastCommit && nextCommit.commit.id === this.state.lastCommit.commit.id) {
102
- // No change here
103
- }
104
- else if (nextCommit === undefined && this.state.lastCommit === undefined) {
105
- // No change here
106
- }
107
- else if (this.transitionHint === 'none') {
108
- // If the 'last' commit changes, but we are not expecting an 'amend'
109
- // or 'unamend' to occur, then we clear out the list of amended commits.
110
- // This is because an unexpected change has happened to the repository,
111
- // perhaps the user committed, merged, or something. The amended commits
112
- // will no longer be valid.
113
- // Note that there may or may not have been a previous lastCommit (if the
114
- // repository was previously empty with no initial commit then lastCommit
115
- // will be undefined). Either way we clear the amending commits.
116
- await this.clearAmendingCommits();
117
- // There is a change to the last commit, but no transition hint so
118
- // the view just updates without transition.
119
- this.setState({ amendingCommits: [], lastCommit: nextCommit });
120
- }
121
- else {
122
- const amendingCommits = this.state.amendingCommits.concat([]); // copy the array
123
- const direction = this.transitionHint === 'amend' ? 'up' : 'down';
124
- switch (this.transitionHint) {
125
- case 'amend':
126
- if (this.state.lastCommit) {
127
- amendingCommits.push(this.state.lastCommit);
128
- const serializedState = JSON.stringify({
129
- amendingHeadCommitSha: amendingCommits[0].commit.id,
130
- latestCommitSha: nextCommit ? nextCommit.commit.id : undefined
131
- });
132
- this.props.storageService.setData(storageKey, serializedState);
133
- }
134
- break;
135
- case 'unamend':
136
- amendingCommits.pop();
137
- if (amendingCommits.length === 0) {
138
- this.props.storageService.setData(storageKey, undefined);
139
- }
140
- else {
141
- const serializedState = JSON.stringify({
142
- amendingHeadCommitSha: amendingCommits[0].commit.id,
143
- latestCommitSha: nextCommit ? nextCommit.commit.id : undefined
144
- });
145
- this.props.storageService.setData(storageKey, serializedState);
146
- }
147
- break;
148
- }
149
- if (this.state.lastCommit && nextCommit) {
150
- const transitionData = { direction, previousLastCommit: this.state.lastCommit };
151
- this.setState({ lastCommit: nextCommit, amendingCommits, transition: Object.assign(Object.assign({}, transitionData), { state: 'start' }) });
152
- this.onNextFrame(() => {
153
- this.setState({ transition: Object.assign(Object.assign({}, transitionData), { state: 'transitioning' }) });
154
- });
155
- setTimeout(() => {
156
- this.setState({ transition: { state: 'none' } });
157
- }, TRANSITION_TIME_MS);
158
- }
159
- else {
160
- // No previous last commit so no transition
161
- this.setState({ transition: { state: 'none' }, amendingCommits, lastCommit: nextCommit });
162
- }
163
- }
164
- this.transitionHint = 'none';
165
- }
166
- async clearAmendingCommits() {
167
- const storageKey = this.getStorageKey();
168
- await this.props.storageService.setData(storageKey, undefined);
169
- }
170
- async buildAmendingList(lastCommit) {
171
- const storageKey = this.getStorageKey();
172
- const storedState = await this.props.storageService.getData(storageKey, undefined);
173
- // Restore list of commits from saved amending head commit up through parents until the
174
- // current commit. (If we don't reach the current commit, the repository has been changed in such
175
- // a way then unamending commits can no longer be done).
176
- if (storedState) {
177
- const { amendingHeadCommitSha, latestCommitSha } = JSON.parse(storedState);
178
- if (!this.commitsAreEqual(lastCommit, latestCommitSha)) {
179
- // The head commit in the repository has changed. It is not the same commit that was the
180
- // head commit after the last 'amend'.
181
- return [];
182
- }
183
- const commits = await this.props.scmAmendSupport.getInitialAmendingCommits(amendingHeadCommitSha, lastCommit ? lastCommit.id : undefined);
184
- const amendingCommitPromises = commits.map(async (commit) => {
185
- const avatar = await this.props.avatarService.getAvatar(commit.authorEmail);
186
- return { commit, avatar };
187
- });
188
- return Promise.all(amendingCommitPromises);
189
- }
190
- else {
191
- return [];
192
- }
193
- }
194
- getStorageKey() {
195
- return REPOSITORY_STORAGE_KEY + ':' + this.props.repository.provider.rootUri;
196
- }
197
- /**
198
- * Commits are equal if the ids are equal or if both are undefined.
199
- * (If a commit is undefined, it represents the initial empty state of a repository,
200
- * before the initial commit).
201
- */
202
- commitsAreEqual(lastCommit, savedLastCommitId) {
203
- return lastCommit
204
- ? lastCommit.id === savedLastCommitId
205
- : savedLastCommitId === undefined;
206
- }
207
- async resetAndSetMessage(commitToRestore, commitToUseForMessage) {
208
- const message = commitToUseForMessage
209
- ? await this.props.scmAmendSupport.getMessage(commitToUseForMessage)
210
- : '';
211
- await this.props.scmAmendSupport.reset(commitToRestore);
212
- this.props.setCommitMessage(message);
213
- }
214
- render() {
215
- const neverShrink = this.state.amendingCommits.length <= 3;
216
- const style = neverShrink
217
- ? Object.assign(Object.assign({}, this.props.style), { flexShrink: 0 }) : Object.assign(Object.assign({}, this.props.style), { flexShrink: 1, minHeight: 240 // height with three commits
218
- });
219
- return (React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_CONTAINER + ' no-select', style: style },
220
- this.state.amendingCommits.length > 0 || (this.state.lastCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'down')
221
- ? this.renderAmendingCommits()
222
- : '',
223
- this.state.lastCommit ?
224
- React.createElement("div", null,
225
- React.createElement("div", { id: 'lastCommit', className: 'theia-scm-amend' },
226
- React.createElement("div", { className: 'theia-header scm-theia-header' }, nls_1.nls.localize('theia/scm/amendHeadCommit', 'HEAD Commit')),
227
- this.renderLastCommit()))
228
- : ''));
229
- }
230
- async getLastCommit() {
231
- const commit = await this.props.scmAmendSupport.getLastCommit();
232
- if (commit) {
233
- const avatar = await this.props.avatarService.getAvatar(commit.authorEmail);
234
- return { commit, avatar };
235
- }
236
- return undefined;
237
- }
238
- renderAmendingCommits() {
239
- const neverShrink = this.state.amendingCommits.length <= 3;
240
- const style = neverShrink
241
- ? {
242
- flexShrink: 0,
243
- }
244
- : {
245
- flexShrink: 1,
246
- // parent minHeight controls height, we just need any value smaller than
247
- // what the height would be when the parent is at its minHeight
248
- minHeight: 0
249
- };
250
- return React.createElement("div", { id: 'amendedCommits', className: 'theia-scm-amend-outer-container', style: style },
251
- React.createElement("div", { className: 'theia-header scm-theia-header' },
252
- React.createElement("div", { className: 'noWrapInfo' }, "Commits being Amended"),
253
- this.renderAmendCommitListButtons(),
254
- this.renderCommitCount(this.state.amendingCommits.length)),
255
- React.createElement("div", { style: this.styleAmendedCommits() },
256
- this.state.amendingCommits.map((commitData, index, array) => this.renderCommitBeingAmended(commitData, index === array.length - 1)),
257
- this.state.lastCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'down'
258
- ? this.renderCommitBeingAmended(this.state.lastCommit, false)
259
- : ''));
260
- }
261
- renderAmendCommitListButtons() {
262
- return React.createElement("div", { className: 'theia-scm-inline-actions-container' },
263
- React.createElement("div", { className: 'theia-scm-inline-actions' },
264
- React.createElement("div", { className: 'theia-scm-inline-action' },
265
- React.createElement("a", { className: (0, browser_1.codicon)('dash'), title: 'Unamend All Commits', onClick: this.unamendAll })),
266
- React.createElement("div", { className: 'theia-scm-inline-action' },
267
- React.createElement("a", { className: (0, browser_1.codicon)('close'), title: 'Clear Amending Commits', onClick: this.clearAmending }))));
268
- }
269
- renderLastCommit() {
270
- if (!this.state.lastCommit) {
271
- return '';
272
- }
273
- const canAmend = true;
274
- return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AND_BUTTON, style: { flexGrow: 0, flexShrink: 0 }, key: this.state.lastCommit.commit.id },
275
- this.renderLastCommitNoButton(this.state.lastCommit),
276
- canAmend
277
- ? React.createElement("div", { className: ScmAmendComponent.Styles.FLEX_CENTER },
278
- React.createElement("button", { className: 'theia-button', title: nls_1.nls.localize('theia/scm/amendLastCommit', 'Amend last commit'), onClick: this.amend }, nls_1.nls.localize('theia/scm/amend', 'Amend')))
279
- : '');
280
- }
281
- renderLastCommitNoButton(lastCommit) {
282
- switch (this.state.transition.state) {
283
- case 'none':
284
- return React.createElement("div", { ref: this.lastCommitScrollRef, className: 'theia-scm-scrolling-container' }, this.renderCommitAvatarAndDetail(lastCommit));
285
- case 'start':
286
- case 'transitioning':
287
- switch (this.state.transition.direction) {
288
- case 'up':
289
- return React.createElement("div", { style: this.styleLastCommitMovingUp(this.state.transition.state) },
290
- this.renderCommitAvatarAndDetail(this.state.transition.previousLastCommit),
291
- this.renderCommitAvatarAndDetail(lastCommit));
292
- case 'down':
293
- return React.createElement("div", { style: this.styleLastCommitMovingDown(this.state.transition.state) },
294
- this.renderCommitAvatarAndDetail(lastCommit),
295
- this.renderCommitAvatarAndDetail(this.state.transition.previousLastCommit));
296
- }
297
- }
298
- }
299
- /**
300
- * See https://stackoverflow.com/questions/26556436/react-after-render-code
301
- *
302
- * @param callback
303
- */
304
- onNextFrame(callback) {
305
- setTimeout(() => window.requestAnimationFrame(callback), 0);
306
- }
307
- renderCommitAvatarAndDetail(commitData) {
308
- const { commit, avatar } = commitData;
309
- return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, key: commit.id },
310
- React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_MESSAGE_AVATAR },
311
- React.createElement("img", { src: avatar })),
312
- React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_DETAILS },
313
- React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_MESSAGE_SUMMARY }, commit.summary),
314
- React.createElement("div", { className: ScmAmendComponent.Styles.LAST_COMMIT_MESSAGE_TIME }, `${commit.authorDateRelative} by ${commit.authorName}`)));
315
- }
316
- renderCommitCount(commits) {
317
- return React.createElement("div", { className: 'notification-count-container scm-change-count' },
318
- React.createElement("span", { className: 'notification-count' }, commits));
319
- }
320
- renderCommitBeingAmended(commitData, isOldestAmendCommit) {
321
- if (isOldestAmendCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'up') {
322
- return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, style: { flexGrow: 0, flexShrink: 0 }, key: commitData.commit.id },
323
- React.createElement("div", { className: 'fixed-height-commit-container' }, this.renderCommitAvatarAndDetail(commitData)));
324
- }
325
- else {
326
- return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, style: { flexGrow: 0, flexShrink: 0 }, key: commitData.commit.id },
327
- this.renderCommitAvatarAndDetail(commitData),
328
- isOldestAmendCommit
329
- ? React.createElement("div", { className: ScmAmendComponent.Styles.FLEX_CENTER },
330
- React.createElement("button", { className: 'theia-button', title: nls_1.nls.localize('theia/scm/unamendCommit', 'Unamend commit'), onClick: this.unamend }, nls_1.nls.localize('theia/scm/unamend', 'Unamend')))
331
- : '');
332
- }
333
- }
334
- /*
335
- * The style for the <div> containing the list of commits being amended.
336
- * This div is scrollable.
337
- */
338
- styleAmendedCommits() {
339
- const base = {
340
- display: 'flex',
341
- whitespace: 'nowrap',
342
- width: '100%',
343
- minHeight: 0,
344
- flexShrink: 1,
345
- paddingTop: '2px',
346
- };
347
- switch (this.state.transition.state) {
348
- case 'none':
349
- return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'auto', marginBottom: '0' });
350
- case 'start':
351
- case 'transitioning':
352
- let startingMargin = 0;
353
- let endingMargin = 0;
354
- switch (this.state.transition.direction) {
355
- case 'down':
356
- startingMargin = 0;
357
- endingMargin = -32;
358
- break;
359
- case 'up':
360
- startingMargin = -32;
361
- endingMargin = 0;
362
- break;
363
- }
364
- switch (this.state.transition.state) {
365
- case 'start':
366
- return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'hidden', marginBottom: `${startingMargin}px` });
367
- case 'transitioning':
368
- return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'hidden', marginBottom: `${endingMargin}px`, transitionProperty: 'margin-bottom', transitionDuration: `${TRANSITION_TIME_MS}ms`, transitionTimingFunction: 'linear' });
369
- }
370
- }
371
- }
372
- styleLastCommitMovingUp(transitionState) {
373
- return this.styleLastCommit(transitionState, 0, -28);
374
- }
375
- styleLastCommitMovingDown(transitionState) {
376
- return this.styleLastCommit(transitionState, -28, 0);
377
- }
378
- styleLastCommit(transitionState, startingMarginTop, startingMarginBottom) {
379
- const base = {
380
- display: 'flex',
381
- width: '100%',
382
- overflow: 'hidden',
383
- paddingTop: 0,
384
- paddingBottom: 0,
385
- borderTop: 0,
386
- borderBottom: 0,
387
- height: this.lastCommitHeight * 2
388
- };
389
- // We end with top and bottom margins switched
390
- const endingMarginTop = startingMarginBottom;
391
- const endingMarginBottom = startingMarginTop;
392
- switch (transitionState) {
393
- case 'start':
394
- return Object.assign(Object.assign({}, base), { position: 'relative', flexDirection: 'column', marginTop: startingMarginTop, marginBottom: startingMarginBottom });
395
- case 'transitioning':
396
- return Object.assign(Object.assign({}, base), { position: 'relative', flexDirection: 'column', marginTop: endingMarginTop, marginBottom: endingMarginBottom, transitionProperty: 'margin-top margin-bottom', transitionDuration: `${TRANSITION_TIME_MS}ms`, transitionTimingFunction: 'linear' });
397
- }
398
- }
399
- async doUnamendAll() {
400
- while (this.state.amendingCommits.length > 0) {
401
- this.unamend();
402
- await new Promise(resolve => setTimeout(resolve, TRANSITION_TIME_MS));
403
- }
404
- }
405
- async doClearAmending() {
406
- await this.clearAmendingCommits();
407
- this.setState({ amendingCommits: [] });
408
- }
409
- }
410
- exports.ScmAmendComponent = ScmAmendComponent;
411
- (function (ScmAmendComponent) {
412
- let Styles;
413
- (function (Styles) {
414
- Styles.COMMIT_CONTAINER = 'theia-scm-commit-container';
415
- Styles.COMMIT_AND_BUTTON = 'theia-scm-commit-and-button';
416
- Styles.COMMIT_AVATAR_AND_TEXT = 'theia-scm-commit-avatar-and-text';
417
- Styles.COMMIT_DETAILS = 'theia-scm-commit-details';
418
- Styles.COMMIT_MESSAGE_AVATAR = 'theia-scm-commit-message-avatar';
419
- Styles.COMMIT_MESSAGE_SUMMARY = 'theia-scm-commit-message-summary';
420
- Styles.LAST_COMMIT_MESSAGE_TIME = 'theia-scm-commit-message-time';
421
- Styles.FLEX_CENTER = 'theia-scm-flex-container-center';
422
- })(Styles = ScmAmendComponent.Styles || (ScmAmendComponent.Styles = {}));
423
- })(ScmAmendComponent = exports.ScmAmendComponent || (exports.ScmAmendComponent = {}));
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 Arm and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ScmAmendComponent = void 0;
19
+ require("../../src/browser/style/scm-amend-component.css");
20
+ const React = require("@theia/core/shared/react");
21
+ const browser_1 = require("@theia/core/lib/browser");
22
+ const core_1 = require("@theia/core");
23
+ const nls_1 = require("@theia/core/lib/common/nls");
24
+ const TRANSITION_TIME_MS = 300;
25
+ const REPOSITORY_STORAGE_KEY = 'scmRepository';
26
+ class ScmAmendComponent extends React.Component {
27
+ constructor(props) {
28
+ super(props);
29
+ /**
30
+ * a hint on how to animate an update, set by certain user action handlers
31
+ * and used when updating the view based on a repository change
32
+ */
33
+ this.transitionHint = 'none';
34
+ this.lastCommitHeight = 0;
35
+ this.lastCommitScrollRef = (instance) => {
36
+ if (instance && this.lastCommitHeight === 0) {
37
+ this.lastCommitHeight = instance.getBoundingClientRect().height;
38
+ }
39
+ };
40
+ this.toDisposeOnUnmount = new core_1.DisposableCollection();
41
+ /**
42
+ * This function will update the 'model' (lastCommit, amendingCommits) only
43
+ * when the repository sees the last commit change.
44
+ * 'render' can be called at any time, so be sure we don't update any 'model'
45
+ * fields until we actually start the transition.
46
+ */
47
+ this.amend = async () => {
48
+ if (this.state.transition.state !== 'none' && this.transitionHint !== 'none') {
49
+ return;
50
+ }
51
+ this.transitionHint = 'amend';
52
+ await this.resetAndSetMessage('HEAD~', 'HEAD');
53
+ };
54
+ this.unamend = async () => {
55
+ if (this.state.transition.state !== 'none' && this.transitionHint !== 'none') {
56
+ return;
57
+ }
58
+ const commitToRestore = (this.state.amendingCommits.length >= 1)
59
+ ? this.state.amendingCommits[this.state.amendingCommits.length - 1]
60
+ : undefined;
61
+ const oldestAmendCommit = (this.state.amendingCommits.length >= 2)
62
+ ? this.state.amendingCommits[this.state.amendingCommits.length - 2]
63
+ : undefined;
64
+ if (commitToRestore) {
65
+ const commitToUseForMessage = oldestAmendCommit
66
+ ? oldestAmendCommit.commit.id
67
+ : undefined;
68
+ this.transitionHint = 'unamend';
69
+ await this.resetAndSetMessage(commitToRestore.commit.id, commitToUseForMessage);
70
+ }
71
+ };
72
+ this.unamendAll = () => this.doUnamendAll();
73
+ this.clearAmending = () => this.doClearAmending();
74
+ this.state = {
75
+ transition: { state: 'none' },
76
+ amendingCommits: [],
77
+ lastCommit: undefined
78
+ };
79
+ const setState = this.setState.bind(this);
80
+ this.setState = newState => {
81
+ if (!this.toDisposeOnUnmount.disposed) {
82
+ setState(newState);
83
+ }
84
+ };
85
+ }
86
+ async componentDidMount() {
87
+ this.toDisposeOnUnmount.push(core_1.Disposable.create(() => { }));
88
+ const lastCommit = await this.getLastCommit();
89
+ this.setState({ amendingCommits: await this.buildAmendingList(lastCommit ? lastCommit.commit : undefined), lastCommit });
90
+ if (this.toDisposeOnUnmount.disposed) {
91
+ return;
92
+ }
93
+ this.toDisposeOnUnmount.push(this.props.repository.provider.onDidChange(() => this.fetchStatusAndSetState()));
94
+ }
95
+ componentWillUnmount() {
96
+ this.toDisposeOnUnmount.dispose();
97
+ }
98
+ async fetchStatusAndSetState() {
99
+ const storageKey = this.getStorageKey();
100
+ const nextCommit = await this.getLastCommit();
101
+ if (nextCommit && this.state.lastCommit && nextCommit.commit.id === this.state.lastCommit.commit.id) {
102
+ // No change here
103
+ }
104
+ else if (nextCommit === undefined && this.state.lastCommit === undefined) {
105
+ // No change here
106
+ }
107
+ else if (this.transitionHint === 'none') {
108
+ // If the 'last' commit changes, but we are not expecting an 'amend'
109
+ // or 'unamend' to occur, then we clear out the list of amended commits.
110
+ // This is because an unexpected change has happened to the repository,
111
+ // perhaps the user committed, merged, or something. The amended commits
112
+ // will no longer be valid.
113
+ // Note that there may or may not have been a previous lastCommit (if the
114
+ // repository was previously empty with no initial commit then lastCommit
115
+ // will be undefined). Either way we clear the amending commits.
116
+ await this.clearAmendingCommits();
117
+ // There is a change to the last commit, but no transition hint so
118
+ // the view just updates without transition.
119
+ this.setState({ amendingCommits: [], lastCommit: nextCommit });
120
+ }
121
+ else {
122
+ const amendingCommits = this.state.amendingCommits.concat([]); // copy the array
123
+ const direction = this.transitionHint === 'amend' ? 'up' : 'down';
124
+ switch (this.transitionHint) {
125
+ case 'amend':
126
+ if (this.state.lastCommit) {
127
+ amendingCommits.push(this.state.lastCommit);
128
+ const serializedState = JSON.stringify({
129
+ amendingHeadCommitSha: amendingCommits[0].commit.id,
130
+ latestCommitSha: nextCommit ? nextCommit.commit.id : undefined
131
+ });
132
+ this.props.storageService.setData(storageKey, serializedState);
133
+ }
134
+ break;
135
+ case 'unamend':
136
+ amendingCommits.pop();
137
+ if (amendingCommits.length === 0) {
138
+ this.props.storageService.setData(storageKey, undefined);
139
+ }
140
+ else {
141
+ const serializedState = JSON.stringify({
142
+ amendingHeadCommitSha: amendingCommits[0].commit.id,
143
+ latestCommitSha: nextCommit ? nextCommit.commit.id : undefined
144
+ });
145
+ this.props.storageService.setData(storageKey, serializedState);
146
+ }
147
+ break;
148
+ }
149
+ if (this.state.lastCommit && nextCommit) {
150
+ const transitionData = { direction, previousLastCommit: this.state.lastCommit };
151
+ this.setState({ lastCommit: nextCommit, amendingCommits, transition: Object.assign(Object.assign({}, transitionData), { state: 'start' }) });
152
+ this.onNextFrame(() => {
153
+ this.setState({ transition: Object.assign(Object.assign({}, transitionData), { state: 'transitioning' }) });
154
+ });
155
+ setTimeout(() => {
156
+ this.setState({ transition: { state: 'none' } });
157
+ }, TRANSITION_TIME_MS);
158
+ }
159
+ else {
160
+ // No previous last commit so no transition
161
+ this.setState({ transition: { state: 'none' }, amendingCommits, lastCommit: nextCommit });
162
+ }
163
+ }
164
+ this.transitionHint = 'none';
165
+ }
166
+ async clearAmendingCommits() {
167
+ const storageKey = this.getStorageKey();
168
+ await this.props.storageService.setData(storageKey, undefined);
169
+ }
170
+ async buildAmendingList(lastCommit) {
171
+ const storageKey = this.getStorageKey();
172
+ const storedState = await this.props.storageService.getData(storageKey, undefined);
173
+ // Restore list of commits from saved amending head commit up through parents until the
174
+ // current commit. (If we don't reach the current commit, the repository has been changed in such
175
+ // a way then unamending commits can no longer be done).
176
+ if (storedState) {
177
+ const { amendingHeadCommitSha, latestCommitSha } = JSON.parse(storedState);
178
+ if (!this.commitsAreEqual(lastCommit, latestCommitSha)) {
179
+ // The head commit in the repository has changed. It is not the same commit that was the
180
+ // head commit after the last 'amend'.
181
+ return [];
182
+ }
183
+ const commits = await this.props.scmAmendSupport.getInitialAmendingCommits(amendingHeadCommitSha, lastCommit ? lastCommit.id : undefined);
184
+ const amendingCommitPromises = commits.map(async (commit) => {
185
+ const avatar = await this.props.avatarService.getAvatar(commit.authorEmail);
186
+ return { commit, avatar };
187
+ });
188
+ return Promise.all(amendingCommitPromises);
189
+ }
190
+ else {
191
+ return [];
192
+ }
193
+ }
194
+ getStorageKey() {
195
+ return REPOSITORY_STORAGE_KEY + ':' + this.props.repository.provider.rootUri;
196
+ }
197
+ /**
198
+ * Commits are equal if the ids are equal or if both are undefined.
199
+ * (If a commit is undefined, it represents the initial empty state of a repository,
200
+ * before the initial commit).
201
+ */
202
+ commitsAreEqual(lastCommit, savedLastCommitId) {
203
+ return lastCommit
204
+ ? lastCommit.id === savedLastCommitId
205
+ : savedLastCommitId === undefined;
206
+ }
207
+ async resetAndSetMessage(commitToRestore, commitToUseForMessage) {
208
+ const message = commitToUseForMessage
209
+ ? await this.props.scmAmendSupport.getMessage(commitToUseForMessage)
210
+ : '';
211
+ await this.props.scmAmendSupport.reset(commitToRestore);
212
+ this.props.setCommitMessage(message);
213
+ }
214
+ render() {
215
+ const neverShrink = this.state.amendingCommits.length <= 3;
216
+ const style = neverShrink
217
+ ? Object.assign(Object.assign({}, this.props.style), { flexShrink: 0 }) : Object.assign(Object.assign({}, this.props.style), { flexShrink: 1, minHeight: 240 // height with three commits
218
+ });
219
+ return (React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_CONTAINER + ' no-select', style: style },
220
+ this.state.amendingCommits.length > 0 || (this.state.lastCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'down')
221
+ ? this.renderAmendingCommits()
222
+ : '',
223
+ this.state.lastCommit ?
224
+ React.createElement("div", null,
225
+ React.createElement("div", { id: 'lastCommit', className: 'theia-scm-amend' },
226
+ React.createElement("div", { className: 'theia-header scm-theia-header' }, nls_1.nls.localize('theia/scm/amendHeadCommit', 'HEAD Commit')),
227
+ this.renderLastCommit()))
228
+ : ''));
229
+ }
230
+ async getLastCommit() {
231
+ const commit = await this.props.scmAmendSupport.getLastCommit();
232
+ if (commit) {
233
+ const avatar = await this.props.avatarService.getAvatar(commit.authorEmail);
234
+ return { commit, avatar };
235
+ }
236
+ return undefined;
237
+ }
238
+ renderAmendingCommits() {
239
+ const neverShrink = this.state.amendingCommits.length <= 3;
240
+ const style = neverShrink
241
+ ? {
242
+ flexShrink: 0,
243
+ }
244
+ : {
245
+ flexShrink: 1,
246
+ // parent minHeight controls height, we just need any value smaller than
247
+ // what the height would be when the parent is at its minHeight
248
+ minHeight: 0
249
+ };
250
+ return React.createElement("div", { id: 'amendedCommits', className: 'theia-scm-amend-outer-container', style: style },
251
+ React.createElement("div", { className: 'theia-header scm-theia-header' },
252
+ React.createElement("div", { className: 'noWrapInfo' }, "Commits being Amended"),
253
+ this.renderAmendCommitListButtons(),
254
+ this.renderCommitCount(this.state.amendingCommits.length)),
255
+ React.createElement("div", { style: this.styleAmendedCommits() },
256
+ this.state.amendingCommits.map((commitData, index, array) => this.renderCommitBeingAmended(commitData, index === array.length - 1)),
257
+ this.state.lastCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'down'
258
+ ? this.renderCommitBeingAmended(this.state.lastCommit, false)
259
+ : ''));
260
+ }
261
+ renderAmendCommitListButtons() {
262
+ return React.createElement("div", { className: 'theia-scm-inline-actions-container' },
263
+ React.createElement("div", { className: 'theia-scm-inline-actions' },
264
+ React.createElement("div", { className: 'theia-scm-inline-action' },
265
+ React.createElement("a", { className: (0, browser_1.codicon)('dash'), title: 'Unamend All Commits', onClick: this.unamendAll })),
266
+ React.createElement("div", { className: 'theia-scm-inline-action' },
267
+ React.createElement("a", { className: (0, browser_1.codicon)('close'), title: 'Clear Amending Commits', onClick: this.clearAmending }))));
268
+ }
269
+ renderLastCommit() {
270
+ if (!this.state.lastCommit) {
271
+ return '';
272
+ }
273
+ const canAmend = true;
274
+ return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AND_BUTTON, style: { flexGrow: 0, flexShrink: 0 }, key: this.state.lastCommit.commit.id },
275
+ this.renderLastCommitNoButton(this.state.lastCommit),
276
+ canAmend
277
+ ? React.createElement("div", { className: ScmAmendComponent.Styles.FLEX_CENTER },
278
+ React.createElement("button", { className: 'theia-button', title: nls_1.nls.localize('theia/scm/amendLastCommit', 'Amend last commit'), onClick: this.amend }, nls_1.nls.localize('theia/scm/amend', 'Amend')))
279
+ : '');
280
+ }
281
+ renderLastCommitNoButton(lastCommit) {
282
+ switch (this.state.transition.state) {
283
+ case 'none':
284
+ return React.createElement("div", { ref: this.lastCommitScrollRef, className: 'theia-scm-scrolling-container' }, this.renderCommitAvatarAndDetail(lastCommit));
285
+ case 'start':
286
+ case 'transitioning':
287
+ switch (this.state.transition.direction) {
288
+ case 'up':
289
+ return React.createElement("div", { style: this.styleLastCommitMovingUp(this.state.transition.state) },
290
+ this.renderCommitAvatarAndDetail(this.state.transition.previousLastCommit),
291
+ this.renderCommitAvatarAndDetail(lastCommit));
292
+ case 'down':
293
+ return React.createElement("div", { style: this.styleLastCommitMovingDown(this.state.transition.state) },
294
+ this.renderCommitAvatarAndDetail(lastCommit),
295
+ this.renderCommitAvatarAndDetail(this.state.transition.previousLastCommit));
296
+ }
297
+ }
298
+ }
299
+ /**
300
+ * See https://stackoverflow.com/questions/26556436/react-after-render-code
301
+ *
302
+ * @param callback
303
+ */
304
+ onNextFrame(callback) {
305
+ setTimeout(() => window.requestAnimationFrame(callback), 0);
306
+ }
307
+ renderCommitAvatarAndDetail(commitData) {
308
+ const { commit, avatar } = commitData;
309
+ return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, key: commit.id },
310
+ React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_MESSAGE_AVATAR },
311
+ React.createElement("img", { src: avatar })),
312
+ React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_DETAILS },
313
+ React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_MESSAGE_SUMMARY }, commit.summary),
314
+ React.createElement("div", { className: ScmAmendComponent.Styles.LAST_COMMIT_MESSAGE_TIME }, `${commit.authorDateRelative} by ${commit.authorName}`)));
315
+ }
316
+ renderCommitCount(commits) {
317
+ return React.createElement("div", { className: 'notification-count-container scm-change-count' },
318
+ React.createElement("span", { className: 'notification-count' }, commits));
319
+ }
320
+ renderCommitBeingAmended(commitData, isOldestAmendCommit) {
321
+ if (isOldestAmendCommit && this.state.transition.state !== 'none' && this.state.transition.direction === 'up') {
322
+ return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, style: { flexGrow: 0, flexShrink: 0 }, key: commitData.commit.id },
323
+ React.createElement("div", { className: 'fixed-height-commit-container' }, this.renderCommitAvatarAndDetail(commitData)));
324
+ }
325
+ else {
326
+ return React.createElement("div", { className: ScmAmendComponent.Styles.COMMIT_AVATAR_AND_TEXT, style: { flexGrow: 0, flexShrink: 0 }, key: commitData.commit.id },
327
+ this.renderCommitAvatarAndDetail(commitData),
328
+ isOldestAmendCommit
329
+ ? React.createElement("div", { className: ScmAmendComponent.Styles.FLEX_CENTER },
330
+ React.createElement("button", { className: 'theia-button', title: nls_1.nls.localize('theia/scm/unamendCommit', 'Unamend commit'), onClick: this.unamend }, nls_1.nls.localize('theia/scm/unamend', 'Unamend')))
331
+ : '');
332
+ }
333
+ }
334
+ /*
335
+ * The style for the <div> containing the list of commits being amended.
336
+ * This div is scrollable.
337
+ */
338
+ styleAmendedCommits() {
339
+ const base = {
340
+ display: 'flex',
341
+ whitespace: 'nowrap',
342
+ width: '100%',
343
+ minHeight: 0,
344
+ flexShrink: 1,
345
+ paddingTop: '2px',
346
+ };
347
+ switch (this.state.transition.state) {
348
+ case 'none':
349
+ return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'auto', marginBottom: '0' });
350
+ case 'start':
351
+ case 'transitioning':
352
+ let startingMargin = 0;
353
+ let endingMargin = 0;
354
+ switch (this.state.transition.direction) {
355
+ case 'down':
356
+ startingMargin = 0;
357
+ endingMargin = -32;
358
+ break;
359
+ case 'up':
360
+ startingMargin = -32;
361
+ endingMargin = 0;
362
+ break;
363
+ }
364
+ switch (this.state.transition.state) {
365
+ case 'start':
366
+ return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'hidden', marginBottom: `${startingMargin}px` });
367
+ case 'transitioning':
368
+ return Object.assign(Object.assign({}, base), { flexDirection: 'column', overflowY: 'hidden', marginBottom: `${endingMargin}px`, transitionProperty: 'margin-bottom', transitionDuration: `${TRANSITION_TIME_MS}ms`, transitionTimingFunction: 'linear' });
369
+ }
370
+ }
371
+ }
372
+ styleLastCommitMovingUp(transitionState) {
373
+ return this.styleLastCommit(transitionState, 0, -28);
374
+ }
375
+ styleLastCommitMovingDown(transitionState) {
376
+ return this.styleLastCommit(transitionState, -28, 0);
377
+ }
378
+ styleLastCommit(transitionState, startingMarginTop, startingMarginBottom) {
379
+ const base = {
380
+ display: 'flex',
381
+ width: '100%',
382
+ overflow: 'hidden',
383
+ paddingTop: 0,
384
+ paddingBottom: 0,
385
+ borderTop: 0,
386
+ borderBottom: 0,
387
+ height: this.lastCommitHeight * 2
388
+ };
389
+ // We end with top and bottom margins switched
390
+ const endingMarginTop = startingMarginBottom;
391
+ const endingMarginBottom = startingMarginTop;
392
+ switch (transitionState) {
393
+ case 'start':
394
+ return Object.assign(Object.assign({}, base), { position: 'relative', flexDirection: 'column', marginTop: startingMarginTop, marginBottom: startingMarginBottom });
395
+ case 'transitioning':
396
+ return Object.assign(Object.assign({}, base), { position: 'relative', flexDirection: 'column', marginTop: endingMarginTop, marginBottom: endingMarginBottom, transitionProperty: 'margin-top margin-bottom', transitionDuration: `${TRANSITION_TIME_MS}ms`, transitionTimingFunction: 'linear' });
397
+ }
398
+ }
399
+ async doUnamendAll() {
400
+ while (this.state.amendingCommits.length > 0) {
401
+ this.unamend();
402
+ await new Promise(resolve => setTimeout(resolve, TRANSITION_TIME_MS));
403
+ }
404
+ }
405
+ async doClearAmending() {
406
+ await this.clearAmendingCommits();
407
+ this.setState({ amendingCommits: [] });
408
+ }
409
+ }
410
+ exports.ScmAmendComponent = ScmAmendComponent;
411
+ (function (ScmAmendComponent) {
412
+ let Styles;
413
+ (function (Styles) {
414
+ Styles.COMMIT_CONTAINER = 'theia-scm-commit-container';
415
+ Styles.COMMIT_AND_BUTTON = 'theia-scm-commit-and-button';
416
+ Styles.COMMIT_AVATAR_AND_TEXT = 'theia-scm-commit-avatar-and-text';
417
+ Styles.COMMIT_DETAILS = 'theia-scm-commit-details';
418
+ Styles.COMMIT_MESSAGE_AVATAR = 'theia-scm-commit-message-avatar';
419
+ Styles.COMMIT_MESSAGE_SUMMARY = 'theia-scm-commit-message-summary';
420
+ Styles.LAST_COMMIT_MESSAGE_TIME = 'theia-scm-commit-message-time';
421
+ Styles.FLEX_CENTER = 'theia-scm-flex-container-center';
422
+ })(Styles = ScmAmendComponent.Styles || (ScmAmendComponent.Styles = {}));
423
+ })(ScmAmendComponent = exports.ScmAmendComponent || (exports.ScmAmendComponent = {}));
424
424
  //# sourceMappingURL=scm-amend-component.js.map