react-diff-viewer-continued 3.2.5 → 3.3.0
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/.all-contributorsrc +9 -0
- package/CHANGELOG.md +19 -0
- package/README.md +9 -7
- package/package.json +38 -38
- package/tsconfig.json +3 -2
- package/webpack.config.js +1 -1
- package/lib/compute-lines.d.ts +0 -54
- package/lib/compute-lines.js +0 -201
- package/lib/index.d.ts +0 -148
- package/lib/index.js +0 -342
- package/lib/styles.d.ts +0 -81
- package/lib/styles.js +0 -287
- package/tsconfig.examples.json +0 -14
package/lib/index.js
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiffMethod = exports.LineNumberPrefix = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const PropTypes = require("prop-types");
|
|
6
|
-
const classnames_1 = require("classnames");
|
|
7
|
-
const compute_lines_1 = require("./compute-lines");
|
|
8
|
-
Object.defineProperty(exports, "DiffMethod", { enumerable: true, get: function () { return compute_lines_1.DiffMethod; } });
|
|
9
|
-
const styles_1 = require("./styles");
|
|
10
|
-
const m = require('memoize-one');
|
|
11
|
-
const memoize = m.default || m;
|
|
12
|
-
var LineNumberPrefix;
|
|
13
|
-
(function (LineNumberPrefix) {
|
|
14
|
-
LineNumberPrefix["LEFT"] = "L";
|
|
15
|
-
LineNumberPrefix["RIGHT"] = "R";
|
|
16
|
-
})(LineNumberPrefix = exports.LineNumberPrefix || (exports.LineNumberPrefix = {}));
|
|
17
|
-
class DiffViewer extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
/**
|
|
21
|
-
* Resets code block expand to the initial stage. Will be exposed to the parent component via
|
|
22
|
-
* refs.
|
|
23
|
-
*/
|
|
24
|
-
this.resetCodeBlocks = () => {
|
|
25
|
-
if (this.state.expandedBlocks.length > 0) {
|
|
26
|
-
this.setState({
|
|
27
|
-
expandedBlocks: [],
|
|
28
|
-
});
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Pushes the target expanded code block to the state. During the re-render,
|
|
35
|
-
* this value is used to expand/fold unmodified code.
|
|
36
|
-
*/
|
|
37
|
-
this.onBlockExpand = (id) => {
|
|
38
|
-
const prevState = this.state.expandedBlocks.slice();
|
|
39
|
-
prevState.push(id);
|
|
40
|
-
this.setState({
|
|
41
|
-
expandedBlocks: prevState,
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Computes final styles for the diff viewer. It combines the default styles with the user
|
|
46
|
-
* supplied overrides. The computed styles are cached with performance in mind.
|
|
47
|
-
*
|
|
48
|
-
* @param styles User supplied style overrides.
|
|
49
|
-
*/
|
|
50
|
-
this.computeStyles = memoize(styles_1.default);
|
|
51
|
-
/**
|
|
52
|
-
* Returns a function with clicked line number in the closure. Returns an no-op function when no
|
|
53
|
-
* onLineNumberClick handler is supplied.
|
|
54
|
-
*
|
|
55
|
-
* @param id Line id of a line.
|
|
56
|
-
*/
|
|
57
|
-
this.onLineNumberClickProxy = (id) => {
|
|
58
|
-
if (this.props.onLineNumberClick) {
|
|
59
|
-
return (e) => this.props.onLineNumberClick(id, e);
|
|
60
|
-
}
|
|
61
|
-
return () => { };
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Maps over the word diff and constructs the required React elements to show word diff.
|
|
65
|
-
*
|
|
66
|
-
* @param diffArray Word diff information derived from line information.
|
|
67
|
-
* @param renderer Optional renderer to format diff words. Useful for syntax highlighting.
|
|
68
|
-
*/
|
|
69
|
-
this.renderWordDiff = (diffArray, renderer) => {
|
|
70
|
-
return diffArray.map((wordDiff, i) => {
|
|
71
|
-
return (React.createElement("span", { key: i, className: (0, classnames_1.default)(this.styles.wordDiff, {
|
|
72
|
-
[this.styles.wordAdded]: wordDiff.type === compute_lines_1.DiffType.ADDED,
|
|
73
|
-
[this.styles.wordRemoved]: wordDiff.type === compute_lines_1.DiffType.REMOVED,
|
|
74
|
-
}) }, renderer ? renderer(wordDiff.value) : wordDiff.value));
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Maps over the line diff and constructs the required react elements to show line diff. It calls
|
|
79
|
-
* renderWordDiff when encountering word diff. This takes care of both inline and split view line
|
|
80
|
-
* renders.
|
|
81
|
-
*
|
|
82
|
-
* @param lineNumber Line number of the current line.
|
|
83
|
-
* @param type Type of diff of the current line.
|
|
84
|
-
* @param prefix Unique id to prefix with the line numbers.
|
|
85
|
-
* @param value Content of the line. It can be a string or a word diff array.
|
|
86
|
-
* @param additionalLineNumber Additional line number to be shown. Useful for rendering inline
|
|
87
|
-
* diff view. Right line number will be passed as additionalLineNumber.
|
|
88
|
-
* @param additionalPrefix Similar to prefix but for additional line number.
|
|
89
|
-
*/
|
|
90
|
-
this.renderLine = (lineNumber, type, prefix, value, additionalLineNumber, additionalPrefix) => {
|
|
91
|
-
const lineNumberTemplate = `${prefix}-${lineNumber}`;
|
|
92
|
-
const additionalLineNumberTemplate = `${additionalPrefix}-${additionalLineNumber}`;
|
|
93
|
-
const highlightLine = this.props.highlightLines.includes(lineNumberTemplate) ||
|
|
94
|
-
this.props.highlightLines.includes(additionalLineNumberTemplate);
|
|
95
|
-
const added = type === compute_lines_1.DiffType.ADDED;
|
|
96
|
-
const removed = type === compute_lines_1.DiffType.REMOVED;
|
|
97
|
-
const changed = type === compute_lines_1.DiffType.CHANGED;
|
|
98
|
-
let content;
|
|
99
|
-
if (Array.isArray(value)) {
|
|
100
|
-
content = this.renderWordDiff(value, this.props.renderContent);
|
|
101
|
-
}
|
|
102
|
-
else if (this.props.renderContent) {
|
|
103
|
-
content = this.props.renderContent(value);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
content = value;
|
|
107
|
-
}
|
|
108
|
-
return (React.createElement(React.Fragment, null,
|
|
109
|
-
!this.props.hideLineNumbers && (React.createElement("td", { onClick: lineNumber && this.onLineNumberClickProxy(lineNumberTemplate), className: (0, classnames_1.default)(this.styles.gutter, {
|
|
110
|
-
[this.styles.emptyGutter]: !lineNumber,
|
|
111
|
-
[this.styles.diffAdded]: added,
|
|
112
|
-
[this.styles.diffRemoved]: removed,
|
|
113
|
-
[this.styles.diffChanged]: changed,
|
|
114
|
-
[this.styles.highlightedGutter]: highlightLine,
|
|
115
|
-
}) },
|
|
116
|
-
React.createElement("pre", { className: this.styles.lineNumber }, lineNumber))),
|
|
117
|
-
!this.props.splitView && !this.props.hideLineNumbers && (React.createElement("td", { onClick: additionalLineNumber &&
|
|
118
|
-
this.onLineNumberClickProxy(additionalLineNumberTemplate), className: (0, classnames_1.default)(this.styles.gutter, {
|
|
119
|
-
[this.styles.emptyGutter]: !additionalLineNumber,
|
|
120
|
-
[this.styles.diffAdded]: added,
|
|
121
|
-
[this.styles.diffRemoved]: removed,
|
|
122
|
-
[this.styles.diffChanged]: changed,
|
|
123
|
-
[this.styles.highlightedGutter]: highlightLine,
|
|
124
|
-
}) },
|
|
125
|
-
React.createElement("pre", { className: this.styles.lineNumber }, additionalLineNumber))),
|
|
126
|
-
this.props.renderGutter
|
|
127
|
-
? this.props.renderGutter({
|
|
128
|
-
lineNumber,
|
|
129
|
-
type,
|
|
130
|
-
prefix,
|
|
131
|
-
value,
|
|
132
|
-
additionalLineNumber,
|
|
133
|
-
additionalPrefix,
|
|
134
|
-
styles: this.styles,
|
|
135
|
-
})
|
|
136
|
-
: null,
|
|
137
|
-
React.createElement("td", { className: (0, classnames_1.default)(this.styles.marker, {
|
|
138
|
-
[this.styles.emptyLine]: !content,
|
|
139
|
-
[this.styles.diffAdded]: added,
|
|
140
|
-
[this.styles.diffRemoved]: removed,
|
|
141
|
-
[this.styles.diffChanged]: changed,
|
|
142
|
-
[this.styles.highlightedLine]: highlightLine,
|
|
143
|
-
}) },
|
|
144
|
-
React.createElement("pre", null,
|
|
145
|
-
added && '+',
|
|
146
|
-
removed && '-')),
|
|
147
|
-
React.createElement("td", { className: (0, classnames_1.default)(this.styles.content, {
|
|
148
|
-
[this.styles.emptyLine]: !content,
|
|
149
|
-
[this.styles.diffAdded]: added,
|
|
150
|
-
[this.styles.diffRemoved]: removed,
|
|
151
|
-
[this.styles.diffChanged]: changed,
|
|
152
|
-
[this.styles.highlightedLine]: highlightLine,
|
|
153
|
-
}) },
|
|
154
|
-
React.createElement("pre", { className: this.styles.contentText }, content))));
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* Generates lines for split view.
|
|
158
|
-
*
|
|
159
|
-
* @param obj Line diff information.
|
|
160
|
-
* @param obj.left Life diff information for the left pane of the split view.
|
|
161
|
-
* @param obj.right Life diff information for the right pane of the split view.
|
|
162
|
-
* @param index React key for the lines.
|
|
163
|
-
*/
|
|
164
|
-
this.renderSplitView = ({ left, right }, index) => {
|
|
165
|
-
return (React.createElement("tr", { key: index, className: this.styles.line },
|
|
166
|
-
this.renderLine(left.lineNumber, left.type, LineNumberPrefix.LEFT, left.value),
|
|
167
|
-
this.renderLine(right.lineNumber, right.type, LineNumberPrefix.RIGHT, right.value)));
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Generates lines for inline view.
|
|
171
|
-
*
|
|
172
|
-
* @param obj Line diff information.
|
|
173
|
-
* @param obj.left Life diff information for the added section of the inline view.
|
|
174
|
-
* @param obj.right Life diff information for the removed section of the inline view.
|
|
175
|
-
* @param index React key for the lines.
|
|
176
|
-
*/
|
|
177
|
-
this.renderInlineView = ({ left, right }, index) => {
|
|
178
|
-
let content;
|
|
179
|
-
if (left.type === compute_lines_1.DiffType.REMOVED && right.type === compute_lines_1.DiffType.ADDED) {
|
|
180
|
-
return (React.createElement(React.Fragment, { key: index },
|
|
181
|
-
React.createElement("tr", { className: this.styles.line }, this.renderLine(left.lineNumber, left.type, LineNumberPrefix.LEFT, left.value, null)),
|
|
182
|
-
React.createElement("tr", { className: this.styles.line }, this.renderLine(null, right.type, LineNumberPrefix.RIGHT, right.value, right.lineNumber))));
|
|
183
|
-
}
|
|
184
|
-
if (left.type === compute_lines_1.DiffType.REMOVED) {
|
|
185
|
-
content = this.renderLine(left.lineNumber, left.type, LineNumberPrefix.LEFT, left.value, null);
|
|
186
|
-
}
|
|
187
|
-
if (left.type === compute_lines_1.DiffType.DEFAULT) {
|
|
188
|
-
content = this.renderLine(left.lineNumber, left.type, LineNumberPrefix.LEFT, left.value, right.lineNumber, LineNumberPrefix.RIGHT);
|
|
189
|
-
}
|
|
190
|
-
if (right.type === compute_lines_1.DiffType.ADDED) {
|
|
191
|
-
content = this.renderLine(null, right.type, LineNumberPrefix.RIGHT, right.value, right.lineNumber);
|
|
192
|
-
}
|
|
193
|
-
return (React.createElement("tr", { key: index, className: this.styles.line }, content));
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Returns a function with clicked block number in the closure.
|
|
197
|
-
*
|
|
198
|
-
* @param id Cold fold block id.
|
|
199
|
-
*/
|
|
200
|
-
this.onBlockClickProxy = (id) => () => this.onBlockExpand(id);
|
|
201
|
-
/**
|
|
202
|
-
* Generates cold fold block. It also uses the custom message renderer when available to show
|
|
203
|
-
* cold fold messages.
|
|
204
|
-
*
|
|
205
|
-
* @param num Number of skipped lines between two blocks.
|
|
206
|
-
* @param blockNumber Code fold block id.
|
|
207
|
-
* @param leftBlockLineNumber First left line number after the current code fold block.
|
|
208
|
-
* @param rightBlockLineNumber First right line number after the current code fold block.
|
|
209
|
-
*/
|
|
210
|
-
this.renderSkippedLineIndicator = (num, blockNumber, leftBlockLineNumber, rightBlockLineNumber) => {
|
|
211
|
-
const { hideLineNumbers, splitView } = this.props;
|
|
212
|
-
const message = this.props.codeFoldMessageRenderer ? (this.props.codeFoldMessageRenderer(num, leftBlockLineNumber, rightBlockLineNumber)) : (React.createElement("pre", { className: this.styles.codeFoldContent },
|
|
213
|
-
"Expand ",
|
|
214
|
-
num,
|
|
215
|
-
" lines ..."));
|
|
216
|
-
const content = (React.createElement("td", null,
|
|
217
|
-
React.createElement("a", { onClick: this.onBlockClickProxy(blockNumber), tabIndex: 0 }, message)));
|
|
218
|
-
const isUnifiedViewWithoutLineNumbers = !splitView && !hideLineNumbers;
|
|
219
|
-
return (React.createElement("tr", { key: `${leftBlockLineNumber}-${rightBlockLineNumber}`, className: this.styles.codeFold },
|
|
220
|
-
!hideLineNumbers && React.createElement("td", { className: this.styles.codeFoldGutter }),
|
|
221
|
-
this.props.renderGutter ? (React.createElement("td", { className: this.styles.codeFoldGutter })) : null,
|
|
222
|
-
React.createElement("td", { className: (0, classnames_1.default)({
|
|
223
|
-
[this.styles.codeFoldGutter]: isUnifiedViewWithoutLineNumbers,
|
|
224
|
-
}) }),
|
|
225
|
-
isUnifiedViewWithoutLineNumbers ? (React.createElement(React.Fragment, null,
|
|
226
|
-
React.createElement("td", null),
|
|
227
|
-
content)) : (React.createElement(React.Fragment, null,
|
|
228
|
-
content,
|
|
229
|
-
this.props.renderGutter ? React.createElement("td", null) : null,
|
|
230
|
-
React.createElement("td", null))),
|
|
231
|
-
React.createElement("td", null),
|
|
232
|
-
React.createElement("td", null)));
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* Generates the entire diff view.
|
|
236
|
-
*/
|
|
237
|
-
this.renderDiff = () => {
|
|
238
|
-
const { oldValue, newValue, splitView, disableWordDiff, compareMethod, linesOffset, } = this.props;
|
|
239
|
-
const { lineInformation, diffLines } = (0, compute_lines_1.computeLineInformation)(oldValue, newValue, disableWordDiff, compareMethod, linesOffset);
|
|
240
|
-
const extraLines = this.props.extraLinesSurroundingDiff < 0
|
|
241
|
-
? 0
|
|
242
|
-
: this.props.extraLinesSurroundingDiff;
|
|
243
|
-
let skippedLines = [];
|
|
244
|
-
return lineInformation.map((line, i) => {
|
|
245
|
-
const diffBlockStart = diffLines[0];
|
|
246
|
-
const currentPosition = diffBlockStart - i;
|
|
247
|
-
if (this.props.showDiffOnly) {
|
|
248
|
-
if (currentPosition === -extraLines) {
|
|
249
|
-
skippedLines = [];
|
|
250
|
-
diffLines.shift();
|
|
251
|
-
}
|
|
252
|
-
if (line.left.type === compute_lines_1.DiffType.DEFAULT &&
|
|
253
|
-
(currentPosition > extraLines ||
|
|
254
|
-
typeof diffBlockStart === 'undefined') &&
|
|
255
|
-
!this.state.expandedBlocks.includes(diffBlockStart)) {
|
|
256
|
-
skippedLines.push(i + 1);
|
|
257
|
-
// show skipped line indicator only if there is more than one line to hide
|
|
258
|
-
if (i === lineInformation.length - 1 && skippedLines.length > 1) {
|
|
259
|
-
return this.renderSkippedLineIndicator(skippedLines.length, diffBlockStart, line.left.lineNumber, line.right.lineNumber);
|
|
260
|
-
// if we are trying to hide the last line, just show it
|
|
261
|
-
}
|
|
262
|
-
else if (i < lineInformation.length - 1) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const diffNodes = splitView
|
|
268
|
-
? this.renderSplitView(line, i)
|
|
269
|
-
: this.renderInlineView(line, i);
|
|
270
|
-
if (currentPosition === extraLines && skippedLines.length > 0) {
|
|
271
|
-
const { length } = skippedLines;
|
|
272
|
-
skippedLines = [];
|
|
273
|
-
return (React.createElement(React.Fragment, { key: i },
|
|
274
|
-
this.renderSkippedLineIndicator(length, diffBlockStart, line.left.lineNumber, line.right.lineNumber),
|
|
275
|
-
diffNodes));
|
|
276
|
-
}
|
|
277
|
-
return diffNodes;
|
|
278
|
-
});
|
|
279
|
-
};
|
|
280
|
-
this.render = () => {
|
|
281
|
-
const { oldValue, newValue, useDarkTheme, leftTitle, rightTitle, splitView, hideLineNumbers, } = this.props;
|
|
282
|
-
if (this.props.compareMethod !== compute_lines_1.DiffMethod.JSON) {
|
|
283
|
-
if (typeof oldValue !== 'string' || typeof newValue !== 'string') {
|
|
284
|
-
throw Error('"oldValue" and "newValue" should be strings');
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
this.styles = this.computeStyles(this.props.styles, useDarkTheme);
|
|
288
|
-
const nodes = this.renderDiff();
|
|
289
|
-
const colSpanOnSplitView = hideLineNumbers ? 2 : 3;
|
|
290
|
-
const colSpanOnInlineView = hideLineNumbers ? 2 : 4;
|
|
291
|
-
let columnExtension = this.props.renderGutter ? 1 : 0;
|
|
292
|
-
const title = (leftTitle || rightTitle) && (React.createElement("tr", null,
|
|
293
|
-
React.createElement("td", { colSpan: (splitView ? colSpanOnSplitView : colSpanOnInlineView) +
|
|
294
|
-
columnExtension, className: this.styles.titleBlock },
|
|
295
|
-
React.createElement("pre", { className: this.styles.contentText }, leftTitle)),
|
|
296
|
-
splitView && (React.createElement("td", { colSpan: colSpanOnSplitView + columnExtension, className: this.styles.titleBlock },
|
|
297
|
-
React.createElement("pre", { className: this.styles.contentText }, rightTitle)))));
|
|
298
|
-
return (React.createElement("table", { className: (0, classnames_1.default)(this.styles.diffContainer, {
|
|
299
|
-
[this.styles.splitView]: splitView,
|
|
300
|
-
}) },
|
|
301
|
-
React.createElement("tbody", null,
|
|
302
|
-
title,
|
|
303
|
-
nodes)));
|
|
304
|
-
};
|
|
305
|
-
this.state = {
|
|
306
|
-
expandedBlocks: [],
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
DiffViewer.defaultProps = {
|
|
311
|
-
oldValue: '',
|
|
312
|
-
newValue: '',
|
|
313
|
-
splitView: true,
|
|
314
|
-
highlightLines: [],
|
|
315
|
-
disableWordDiff: false,
|
|
316
|
-
compareMethod: compute_lines_1.DiffMethod.CHARS,
|
|
317
|
-
styles: {},
|
|
318
|
-
hideLineNumbers: false,
|
|
319
|
-
extraLinesSurroundingDiff: 3,
|
|
320
|
-
showDiffOnly: true,
|
|
321
|
-
useDarkTheme: false,
|
|
322
|
-
linesOffset: 0,
|
|
323
|
-
};
|
|
324
|
-
DiffViewer.propTypes = {
|
|
325
|
-
oldValue: PropTypes.any.isRequired,
|
|
326
|
-
newValue: PropTypes.any.isRequired,
|
|
327
|
-
splitView: PropTypes.bool,
|
|
328
|
-
disableWordDiff: PropTypes.bool,
|
|
329
|
-
compareMethod: PropTypes.oneOf(Object.values(compute_lines_1.DiffMethod)),
|
|
330
|
-
renderContent: PropTypes.func,
|
|
331
|
-
renderGutter: PropTypes.func,
|
|
332
|
-
onLineNumberClick: PropTypes.func,
|
|
333
|
-
extraLinesSurroundingDiff: PropTypes.number,
|
|
334
|
-
styles: PropTypes.object,
|
|
335
|
-
hideLineNumbers: PropTypes.bool,
|
|
336
|
-
showDiffOnly: PropTypes.bool,
|
|
337
|
-
highlightLines: PropTypes.arrayOf(PropTypes.string),
|
|
338
|
-
leftTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
339
|
-
rightTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
340
|
-
linesOffset: PropTypes.number,
|
|
341
|
-
};
|
|
342
|
-
exports.default = DiffViewer;
|
package/lib/styles.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Interpolation } from 'emotion';
|
|
2
|
-
export interface ReactDiffViewerStyles {
|
|
3
|
-
diffContainer?: string;
|
|
4
|
-
diffRemoved?: string;
|
|
5
|
-
diffAdded?: string;
|
|
6
|
-
diffChanged?: string;
|
|
7
|
-
line?: string;
|
|
8
|
-
highlightedGutter?: string;
|
|
9
|
-
contentText?: string;
|
|
10
|
-
gutter?: string;
|
|
11
|
-
highlightedLine?: string;
|
|
12
|
-
lineNumber?: string;
|
|
13
|
-
marker?: string;
|
|
14
|
-
wordDiff?: string;
|
|
15
|
-
wordAdded?: string;
|
|
16
|
-
wordRemoved?: string;
|
|
17
|
-
codeFoldGutter?: string;
|
|
18
|
-
emptyGutter?: string;
|
|
19
|
-
emptyLine?: string;
|
|
20
|
-
codeFold?: string;
|
|
21
|
-
titleBlock?: string;
|
|
22
|
-
content?: string;
|
|
23
|
-
splitView?: string;
|
|
24
|
-
[key: string]: string | undefined;
|
|
25
|
-
}
|
|
26
|
-
export interface ReactDiffViewerStylesVariables {
|
|
27
|
-
diffViewerBackground?: string;
|
|
28
|
-
diffViewerTitleBackground?: string;
|
|
29
|
-
diffViewerColor?: string;
|
|
30
|
-
diffViewerTitleColor?: string;
|
|
31
|
-
diffViewerTitleBorderColor?: string;
|
|
32
|
-
addedBackground?: string;
|
|
33
|
-
addedColor?: string;
|
|
34
|
-
removedBackground?: string;
|
|
35
|
-
removedColor?: string;
|
|
36
|
-
changedBackground?: string;
|
|
37
|
-
wordAddedBackground?: string;
|
|
38
|
-
wordRemovedBackground?: string;
|
|
39
|
-
addedGutterBackground?: string;
|
|
40
|
-
removedGutterBackground?: string;
|
|
41
|
-
gutterBackground?: string;
|
|
42
|
-
gutterBackgroundDark?: string;
|
|
43
|
-
highlightBackground?: string;
|
|
44
|
-
highlightGutterBackground?: string;
|
|
45
|
-
codeFoldGutterBackground?: string;
|
|
46
|
-
codeFoldBackground?: string;
|
|
47
|
-
emptyLineBackground?: string;
|
|
48
|
-
gutterColor?: string;
|
|
49
|
-
addedGutterColor?: string;
|
|
50
|
-
removedGutterColor?: string;
|
|
51
|
-
codeFoldContentColor?: string;
|
|
52
|
-
}
|
|
53
|
-
export interface ReactDiffViewerStylesOverride {
|
|
54
|
-
variables?: {
|
|
55
|
-
dark?: ReactDiffViewerStylesVariables;
|
|
56
|
-
light?: ReactDiffViewerStylesVariables;
|
|
57
|
-
};
|
|
58
|
-
diffContainer?: Interpolation;
|
|
59
|
-
diffRemoved?: Interpolation;
|
|
60
|
-
diffAdded?: Interpolation;
|
|
61
|
-
diffChanged?: Interpolation;
|
|
62
|
-
marker?: Interpolation;
|
|
63
|
-
emptyGutter?: Interpolation;
|
|
64
|
-
highlightedLine?: Interpolation;
|
|
65
|
-
lineNumber?: Interpolation;
|
|
66
|
-
highlightedGutter?: Interpolation;
|
|
67
|
-
contentText?: Interpolation;
|
|
68
|
-
gutter?: Interpolation;
|
|
69
|
-
line?: Interpolation;
|
|
70
|
-
wordDiff?: Interpolation;
|
|
71
|
-
wordAdded?: Interpolation;
|
|
72
|
-
wordRemoved?: Interpolation;
|
|
73
|
-
codeFoldGutter?: Interpolation;
|
|
74
|
-
codeFold?: Interpolation;
|
|
75
|
-
emptyLine?: Interpolation;
|
|
76
|
-
content?: Interpolation;
|
|
77
|
-
titleBlock?: Interpolation;
|
|
78
|
-
splitView?: Interpolation;
|
|
79
|
-
}
|
|
80
|
-
declare const _default: (styleOverride: ReactDiffViewerStylesOverride, useDarkTheme?: boolean) => ReactDiffViewerStyles;
|
|
81
|
-
export default _default;
|