@noldova/code.editor.diff.angular 0.0.0-stage → 0.0.1
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 +21 -0
- package/README.md +14 -2
- package/api/index.d.ts +17 -0
- package/api/index.js +16 -0
- package/app/components/diff-editor/diff-editor.component.d.ts +165 -0
- package/app/components/diff-editor/diff-editor.component.js +212 -0
- package/app/enums/diff-layout.d.ts +28 -0
- package/app/enums/diff-layout.js +13 -0
- package/app/interfaces/i-diff-navigator.d.ts +32 -0
- package/app/interfaces/i-diff-navigator.js +7 -0
- package/app/models/change-command.d.ts +15 -0
- package/app/models/change-command.js +23 -0
- package/app/models/diff-folds.d.ts +18 -0
- package/app/models/diff-folds.js +32 -0
- package/app/models/diff-layer.d.ts +26 -0
- package/app/models/diff-layer.js +62 -0
- package/app/models/inline-numbering.d.ts +16 -0
- package/app/models/inline-numbering.js +23 -0
- package/app/services/diff-editor-classes.d.ts +36 -0
- package/app/services/diff-editor-classes.js +14 -0
- package/app/services/diff-editor-commands.d.ts +37 -0
- package/app/services/diff-editor-commands.js +15 -0
- package/app/services/diff-editor-contribution.d.ts +44 -0
- package/app/services/diff-editor-contribution.js +28 -0
- package/app/services/diff-editor-features.d.ts +23 -0
- package/app/services/diff-editor-features.js +13 -0
- package/app/services/diff-editor-registries.d.ts +40 -0
- package/app/services/diff-editor-registries.js +25 -0
- package/app/services/diff-editor-settings.d.ts +49 -0
- package/app/services/diff-editor-settings.js +18 -0
- package/app/services/diff-worker.d.ts +42 -0
- package/app/services/diff-worker.js +13 -0
- package/app/workers/diff.worker.d.ts +8 -0
- package/app/workers/diff.worker.js +12 -0
- package/package.json +39 -4
- package/resources.d.ts +60 -0
- package/resources.js +72 -0
package/resources.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Resources {
|
|
9
|
+
static readonly empty: string;
|
|
10
|
+
static readonly keyDown: "keydown";
|
|
11
|
+
static readonly nextChangeKey: string;
|
|
12
|
+
static readonly previousChangeKey: string;
|
|
13
|
+
static readonly nextChangeCommand: string;
|
|
14
|
+
static readonly previousChangeCommand: string;
|
|
15
|
+
static readonly contextLinesSetting: string;
|
|
16
|
+
static readonly minimumHiddenLinesSetting: string;
|
|
17
|
+
static readonly characterDiffLimitSetting: string;
|
|
18
|
+
static readonly inlineBreakpointSetting: string;
|
|
19
|
+
static readonly hostClass: string;
|
|
20
|
+
static readonly inlineClass: string;
|
|
21
|
+
static readonly inlineClassBinding: string;
|
|
22
|
+
static readonly paneClass: string;
|
|
23
|
+
static readonly statusClass: string;
|
|
24
|
+
static readonly diffContribution: string;
|
|
25
|
+
static readonly navigatorFeature: string;
|
|
26
|
+
static readonly inDiffEditorCondition: string;
|
|
27
|
+
static readonly inDiffEditorDescription: string;
|
|
28
|
+
static readonly contextLinesDescription: string;
|
|
29
|
+
static readonly minimumHiddenLinesDescription: string;
|
|
30
|
+
static readonly characterDiffLimitDescription: string;
|
|
31
|
+
static readonly inlineBreakpointDescription: string;
|
|
32
|
+
static readonly defaultContextLines: number;
|
|
33
|
+
static readonly defaultMinimumHiddenLines: number;
|
|
34
|
+
static readonly defaultCharacterDiffLimit: number;
|
|
35
|
+
static readonly defaultInlineBreakpoint: number;
|
|
36
|
+
static readonly contextLinesMinimum: number;
|
|
37
|
+
static readonly minimumHiddenLinesMinimum: number;
|
|
38
|
+
static readonly characterDiffLimitMinimum: number;
|
|
39
|
+
static readonly inlineBreakpointMinimum: number;
|
|
40
|
+
static readonly addedSign: string;
|
|
41
|
+
static readonly removedSign: string;
|
|
42
|
+
static readonly addedColor: string;
|
|
43
|
+
static readonly removedColor: string;
|
|
44
|
+
static readonly addedBackground: string;
|
|
45
|
+
static readonly removedBackground: string;
|
|
46
|
+
static readonly addedChange: string;
|
|
47
|
+
static readonly removedChange: string;
|
|
48
|
+
static readonly noChanges: string;
|
|
49
|
+
static readonly oneLine: string;
|
|
50
|
+
static readonly manyLines: string;
|
|
51
|
+
static readonly partSeparator: string;
|
|
52
|
+
static readonly wordSeparator: string;
|
|
53
|
+
static readonly changeWord: string;
|
|
54
|
+
static readonly ofWord: string;
|
|
55
|
+
static readonly removedWord: string;
|
|
56
|
+
static readonly addedWord: string;
|
|
57
|
+
static formatChange(position: number, count: number, removed: number, added: number): string;
|
|
58
|
+
private static words;
|
|
59
|
+
private static linesWord;
|
|
60
|
+
}
|
package/resources.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { List } from "@noldova/context.collections";
|
|
9
|
+
export class Resources {
|
|
10
|
+
static empty = "";
|
|
11
|
+
static keyDown = "keydown";
|
|
12
|
+
static nextChangeKey = "alt+down";
|
|
13
|
+
static previousChangeKey = "alt+up";
|
|
14
|
+
static nextChangeCommand = "diffEditor.nextChange";
|
|
15
|
+
static previousChangeCommand = "diffEditor.previousChange";
|
|
16
|
+
static contextLinesSetting = "diff.contextLines";
|
|
17
|
+
static minimumHiddenLinesSetting = "diff.minimumHiddenLines";
|
|
18
|
+
static characterDiffLimitSetting = "diff.characterDiffLimit";
|
|
19
|
+
static inlineBreakpointSetting = "diff.inlineBreakpoint";
|
|
20
|
+
static hostClass = "nol-diff-editor";
|
|
21
|
+
static inlineClass = "nol-diff-editor-inline";
|
|
22
|
+
static inlineClassBinding = `[class.${Resources.inlineClass}]`;
|
|
23
|
+
static paneClass = "nol-diff-editor-pane";
|
|
24
|
+
static statusClass = "nol-diff-editor-status";
|
|
25
|
+
static diffContribution = "noldova.code.editor.diff.angular";
|
|
26
|
+
static navigatorFeature = "diffNavigator";
|
|
27
|
+
static inDiffEditorCondition = "inDiffEditor";
|
|
28
|
+
static inDiffEditorDescription = "The focus is in a diff view.";
|
|
29
|
+
static contextLinesDescription = "The unchanged lines a diff view keeps next to each change.";
|
|
30
|
+
static minimumHiddenLinesDescription = "The fewest unchanged lines a diff view folds away.";
|
|
31
|
+
static characterDiffLimitDescription = "The most characters on both sides of a change that a diff compares character by character.";
|
|
32
|
+
static inlineBreakpointDescription = "The width in rem below which a diff view in the automatic layout shows the change inline.";
|
|
33
|
+
static defaultContextLines = 3;
|
|
34
|
+
static defaultMinimumHiddenLines = 3;
|
|
35
|
+
static defaultCharacterDiffLimit = 20000;
|
|
36
|
+
static defaultInlineBreakpoint = 50;
|
|
37
|
+
static contextLinesMinimum = 0;
|
|
38
|
+
static minimumHiddenLinesMinimum = 1;
|
|
39
|
+
static characterDiffLimitMinimum = 0;
|
|
40
|
+
static inlineBreakpointMinimum = 0;
|
|
41
|
+
static addedSign = "+";
|
|
42
|
+
static removedSign = "-";
|
|
43
|
+
static addedColor = "var(--nol-added)";
|
|
44
|
+
static removedColor = "var(--nol-removed)";
|
|
45
|
+
static addedBackground = "var(--nol-added-background)";
|
|
46
|
+
static removedBackground = "var(--nol-removed-background)";
|
|
47
|
+
static addedChange = "var(--nol-added-change)";
|
|
48
|
+
static removedChange = "var(--nol-removed-change)";
|
|
49
|
+
static noChanges = "No changes";
|
|
50
|
+
static oneLine = "line";
|
|
51
|
+
static manyLines = "lines";
|
|
52
|
+
static partSeparator = ", ";
|
|
53
|
+
static wordSeparator = " ";
|
|
54
|
+
static changeWord = "Change";
|
|
55
|
+
static ofWord = "of";
|
|
56
|
+
static removedWord = "removed";
|
|
57
|
+
static addedWord = "added";
|
|
58
|
+
static formatChange(position, count, removed, added) {
|
|
59
|
+
const parts = new List();
|
|
60
|
+
if (removed > 0)
|
|
61
|
+
parts.add(Resources.words(String(removed), Resources.linesWord(removed), Resources.removedWord));
|
|
62
|
+
if (added > 0)
|
|
63
|
+
parts.add(removed > 0 ? Resources.words(String(added), Resources.addedWord) : Resources.words(String(added), Resources.linesWord(added), Resources.addedWord));
|
|
64
|
+
return [Resources.words(Resources.changeWord, String(position), Resources.ofWord, String(count)), ...parts.toArray()].join(Resources.partSeparator);
|
|
65
|
+
}
|
|
66
|
+
static words(...parts) {
|
|
67
|
+
return parts.join(Resources.wordSeparator);
|
|
68
|
+
}
|
|
69
|
+
static linesWord(count) {
|
|
70
|
+
return count === 1 ? Resources.oneLine : Resources.manyLines;
|
|
71
|
+
}
|
|
72
|
+
}
|