@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,103 +1,103 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.DiffComputer = void 0;
19
- const jsdiff = require("diff");
20
- class DiffComputer {
21
- computeDiff(previous, current) {
22
- const diffResult = diffArrays(previous, current);
23
- return diffResult;
24
- }
25
- computeDirtyDiff(previous, current) {
26
- const added = [];
27
- const removed = [];
28
- const modified = [];
29
- const changes = this.computeDiff(previous, current);
30
- let lastLine = -1;
31
- for (let i = 0; i < changes.length; i++) {
32
- const change = changes[i];
33
- const next = changes[i + 1];
34
- if (change.added) {
35
- // case: addition
36
- const start = lastLine + 1;
37
- const end = lastLine + change.count;
38
- added.push({ start, end });
39
- lastLine = end;
40
- }
41
- else if (change.removed && next && next.added) {
42
- const isFirstChange = i === 0;
43
- const isLastChange = i === changes.length - 2;
44
- const isNextEmptyLine = next.value.length > 0 && current[next.value[0]].length === 0;
45
- const isPrevEmptyLine = change.value.length > 0 && previous[change.value[0]].length === 0;
46
- if (isFirstChange && isNextEmptyLine) {
47
- // special case: removing at the beginning
48
- removed.push(0);
49
- }
50
- else if (isFirstChange && isPrevEmptyLine) {
51
- // special case: adding at the beginning
52
- const start = 0;
53
- const end = next.count - 1;
54
- added.push({ start, end });
55
- lastLine = end;
56
- }
57
- else if (isLastChange && isNextEmptyLine) {
58
- removed.push(lastLine + 1 /* = empty line */);
59
- }
60
- else {
61
- // default case is a modification
62
- const start = lastLine + 1;
63
- const end = lastLine + next.count;
64
- modified.push({ start, end });
65
- lastLine = end;
66
- }
67
- i++; // consume next eagerly
68
- }
69
- else if (change.removed && !(next && next.added)) {
70
- removed.push(Math.max(0, lastLine));
71
- }
72
- else {
73
- lastLine += change.count;
74
- }
75
- }
76
- return { added, removed, modified };
77
- }
78
- }
79
- exports.DiffComputer = DiffComputer;
80
- class ArrayDiff extends jsdiff.Diff {
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
- tokenize(value) {
83
- return value;
84
- }
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- join(value) {
87
- return value;
88
- }
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- removeEmpty(value) {
91
- return value;
92
- }
93
- }
94
- const arrayDiff = new ArrayDiff();
95
- /**
96
- * Computes diff without copying data.
97
- */
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- function diffArrays(oldArr, newArr) {
100
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
- return arrayDiff.diff(oldArr, newArr);
102
- }
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DiffComputer = void 0;
19
+ const jsdiff = require("diff");
20
+ class DiffComputer {
21
+ computeDiff(previous, current) {
22
+ const diffResult = diffArrays(previous, current);
23
+ return diffResult;
24
+ }
25
+ computeDirtyDiff(previous, current) {
26
+ const added = [];
27
+ const removed = [];
28
+ const modified = [];
29
+ const changes = this.computeDiff(previous, current);
30
+ let lastLine = -1;
31
+ for (let i = 0; i < changes.length; i++) {
32
+ const change = changes[i];
33
+ const next = changes[i + 1];
34
+ if (change.added) {
35
+ // case: addition
36
+ const start = lastLine + 1;
37
+ const end = lastLine + change.count;
38
+ added.push({ start, end });
39
+ lastLine = end;
40
+ }
41
+ else if (change.removed && next && next.added) {
42
+ const isFirstChange = i === 0;
43
+ const isLastChange = i === changes.length - 2;
44
+ const isNextEmptyLine = next.value.length > 0 && current[next.value[0]].length === 0;
45
+ const isPrevEmptyLine = change.value.length > 0 && previous[change.value[0]].length === 0;
46
+ if (isFirstChange && isNextEmptyLine) {
47
+ // special case: removing at the beginning
48
+ removed.push(0);
49
+ }
50
+ else if (isFirstChange && isPrevEmptyLine) {
51
+ // special case: adding at the beginning
52
+ const start = 0;
53
+ const end = next.count - 1;
54
+ added.push({ start, end });
55
+ lastLine = end;
56
+ }
57
+ else if (isLastChange && isNextEmptyLine) {
58
+ removed.push(lastLine + 1 /* = empty line */);
59
+ }
60
+ else {
61
+ // default case is a modification
62
+ const start = lastLine + 1;
63
+ const end = lastLine + next.count;
64
+ modified.push({ start, end });
65
+ lastLine = end;
66
+ }
67
+ i++; // consume next eagerly
68
+ }
69
+ else if (change.removed && !(next && next.added)) {
70
+ removed.push(Math.max(0, lastLine));
71
+ }
72
+ else {
73
+ lastLine += change.count;
74
+ }
75
+ }
76
+ return { added, removed, modified };
77
+ }
78
+ }
79
+ exports.DiffComputer = DiffComputer;
80
+ class ArrayDiff extends jsdiff.Diff {
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
+ tokenize(value) {
83
+ return value;
84
+ }
85
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
+ join(value) {
87
+ return value;
88
+ }
89
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
+ removeEmpty(value) {
91
+ return value;
92
+ }
93
+ }
94
+ const arrayDiff = new ArrayDiff();
95
+ /**
96
+ * Computes diff without copying data.
97
+ */
98
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
+ function diffArrays(oldArr, newArr) {
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ return arrayDiff.diff(oldArr, newArr);
102
+ }
103
103
  //# sourceMappingURL=diff-computer.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=diff-computer.spec.d.ts.map