v-code-diff 0.3.12 → 1.0.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/src/var.scss ADDED
@@ -0,0 +1,439 @@
1
+ .file {
2
+ --color-canvas-default-transparent: rgba(255,255,255,0);
3
+ --color-page-header-bg: #f6f8fa;
4
+ --color-marketing-icon-primary: #218bff;
5
+ --color-marketing-icon-secondary: #54aeff;
6
+ --color-diff-blob-addition-num-text: #24292f;
7
+ --color-diff-blob-addition-fg: #24292f;
8
+ --color-diff-blob-addition-num-bg: #ccffd8;
9
+ --color-diff-blob-addition-line-bg: #e6ffec;
10
+ --color-diff-blob-addition-word-bg: #abf2bc;
11
+ --color-diff-blob-deletion-num-text: #24292f;
12
+ --color-diff-blob-deletion-fg: #24292f;
13
+ --color-diff-blob-deletion-num-bg: #ffd7d5;
14
+ --color-diff-blob-deletion-line-bg: #ffebe9;
15
+ --color-diff-blob-deletion-word-bg: rgba(255,129,130,0.4);
16
+ --color-diff-blob-hunk-num-bg: rgba(84,174,255,0.4);
17
+ --color-diff-blob-expander-icon: #57606a;
18
+ --color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;
19
+ --color-diffstat-deletion-border: rgba(27,31,36,0.15);
20
+ --color-diffstat-addition-border: rgba(27,31,36,0.15);
21
+ --color-diffstat-addition-bg: #2da44e;
22
+ --color-search-keyword-hl: #fff8c5;
23
+ --color-prettylights-syntax-comment: #6e7781;
24
+ --color-prettylights-syntax-constant: #0550ae;
25
+ --color-prettylights-syntax-entity: #8250df;
26
+ --color-prettylights-syntax-storage-modifier-import: #24292f;
27
+ --color-prettylights-syntax-entity-tag: #116329;
28
+ --color-prettylights-syntax-keyword: #cf222e;
29
+ --color-prettylights-syntax-string: #0a3069;
30
+ --color-prettylights-syntax-variable: #953800;
31
+ --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
32
+ --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
33
+ --color-prettylights-syntax-invalid-illegal-bg: #82071e;
34
+ --color-prettylights-syntax-carriage-return-text: #f6f8fa;
35
+ --color-prettylights-syntax-carriage-return-bg: #cf222e;
36
+ --color-prettylights-syntax-string-regexp: #116329;
37
+ --color-prettylights-syntax-markup-list: #3b2300;
38
+ --color-prettylights-syntax-markup-heading: #0550ae;
39
+ --color-prettylights-syntax-markup-italic: #24292f;
40
+ --color-prettylights-syntax-markup-bold: #24292f;
41
+ --color-prettylights-syntax-markup-deleted-text: #82071e;
42
+ --color-prettylights-syntax-markup-deleted-bg: #ffebe9;
43
+ --color-prettylights-syntax-markup-inserted-text: #116329;
44
+ --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
45
+ --color-prettylights-syntax-markup-changed-text: #953800;
46
+ --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
47
+ --color-prettylights-syntax-markup-ignored-text: #eaeef2;
48
+ --color-prettylights-syntax-markup-ignored-bg: #0550ae;
49
+ --color-prettylights-syntax-meta-diff-range: #8250df;
50
+ --color-prettylights-syntax-brackethighlighter-angle: #57606a;
51
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
52
+ --color-prettylights-syntax-constant-other-reference-link: #0a3069;
53
+ --color-codemirror-text: #24292f;
54
+ --color-codemirror-bg: #ffffff;
55
+ --color-codemirror-gutters-bg: #ffffff;
56
+ --color-codemirror-guttermarker-text: #ffffff;
57
+ --color-codemirror-guttermarker-subtle-text: #6e7781;
58
+ --color-codemirror-linenumber-text: #57606a;
59
+ --color-codemirror-cursor: #24292f;
60
+ --color-codemirror-selection-bg: rgba(84,174,255,0.4);
61
+ --color-codemirror-activeline-bg: rgba(234,238,242,0.5);
62
+ --color-codemirror-matchingbracket-text: #24292f;
63
+ --color-codemirror-lines-bg: #ffffff;
64
+ --color-codemirror-syntax-comment: #24292f;
65
+ --color-codemirror-syntax-constant: #0550ae;
66
+ --color-codemirror-syntax-entity: #8250df;
67
+ --color-codemirror-syntax-keyword: #cf222e;
68
+ --color-codemirror-syntax-storage: #cf222e;
69
+ --color-codemirror-syntax-string: #0a3069;
70
+ --color-codemirror-syntax-support: #0550ae;
71
+ --color-codemirror-syntax-variable: #953800;
72
+ --color-checks-bg: #24292f;
73
+ --color-checks-run-border-width: 0px;
74
+ --color-checks-container-border-width: 0px;
75
+ --color-checks-text-primary: #f6f8fa;
76
+ --color-checks-text-secondary: #8c959f;
77
+ --color-checks-text-link: #54aeff;
78
+ --color-checks-btn-icon: #afb8c1;
79
+ --color-checks-btn-hover-icon: #f6f8fa;
80
+ --color-checks-btn-hover-bg: rgba(255,255,255,0.125);
81
+ --color-checks-input-text: #eaeef2;
82
+ --color-checks-input-placeholder-text: #8c959f;
83
+ --color-checks-input-focus-text: #8c959f;
84
+ --color-checks-input-bg: #32383f;
85
+ --color-checks-input-shadow: none;
86
+ --color-checks-donut-error: #fa4549;
87
+ --color-checks-donut-pending: #bf8700;
88
+ --color-checks-donut-success: #2da44e;
89
+ --color-checks-donut-neutral: #afb8c1;
90
+ --color-checks-dropdown-text: #afb8c1;
91
+ --color-checks-dropdown-bg: #32383f;
92
+ --color-checks-dropdown-border: #424a53;
93
+ --color-checks-dropdown-shadow: rgba(27,31,36,0.3);
94
+ --color-checks-dropdown-hover-text: #f6f8fa;
95
+ --color-checks-dropdown-hover-bg: #424a53;
96
+ --color-checks-dropdown-btn-hover-text: #f6f8fa;
97
+ --color-checks-dropdown-btn-hover-bg: #32383f;
98
+ --color-checks-scrollbar-thumb-bg: #57606a;
99
+ --color-checks-header-label-text: #d0d7de;
100
+ --color-checks-header-label-open-text: #f6f8fa;
101
+ --color-checks-header-border: #32383f;
102
+ --color-checks-header-icon: #8c959f;
103
+ --color-checks-line-text: #d0d7de;
104
+ --color-checks-line-num-text: rgba(140,149,159,0.75);
105
+ --color-checks-line-timestamp-text: #8c959f;
106
+ --color-checks-line-hover-bg: #32383f;
107
+ --color-checks-line-selected-bg: rgba(33,139,255,0.15);
108
+ --color-checks-line-selected-num-text: #54aeff;
109
+ --color-checks-line-dt-fm-text: #24292f;
110
+ --color-checks-line-dt-fm-bg: #9a6700;
111
+ --color-checks-gate-bg: rgba(125,78,0,0.15);
112
+ --color-checks-gate-text: #d0d7de;
113
+ --color-checks-gate-waiting-text: #d4a72c;
114
+ --color-checks-step-header-open-bg: #32383f;
115
+ --color-checks-step-error-text: #ff8182;
116
+ --color-checks-step-warning-text: #d4a72c;
117
+ --color-checks-logline-text: #8c959f;
118
+ --color-checks-logline-num-text: rgba(140,149,159,0.75);
119
+ --color-checks-logline-debug-text: #c297ff;
120
+ --color-checks-logline-error-text: #d0d7de;
121
+ --color-checks-logline-error-num-text: #ff8182;
122
+ --color-checks-logline-error-bg: rgba(164,14,38,0.15);
123
+ --color-checks-logline-warning-text: #d0d7de;
124
+ --color-checks-logline-warning-num-text: #d4a72c;
125
+ --color-checks-logline-warning-bg: rgba(125,78,0,0.15);
126
+ --color-checks-logline-command-text: #54aeff;
127
+ --color-checks-logline-section-text: #4ac26b;
128
+ --color-checks-ansi-black: #24292f;
129
+ --color-checks-ansi-black-bright: #32383f;
130
+ --color-checks-ansi-white: #d0d7de;
131
+ --color-checks-ansi-white-bright: #d0d7de;
132
+ --color-checks-ansi-gray: #8c959f;
133
+ --color-checks-ansi-red: #ff8182;
134
+ --color-checks-ansi-red-bright: #ffaba8;
135
+ --color-checks-ansi-green: #4ac26b;
136
+ --color-checks-ansi-green-bright: #6fdd8b;
137
+ --color-checks-ansi-yellow: #d4a72c;
138
+ --color-checks-ansi-yellow-bright: #eac54f;
139
+ --color-checks-ansi-blue: #54aeff;
140
+ --color-checks-ansi-blue-bright: #80ccff;
141
+ --color-checks-ansi-magenta: #c297ff;
142
+ --color-checks-ansi-magenta-bright: #d8b9ff;
143
+ --color-checks-ansi-cyan: #76e3ea;
144
+ --color-checks-ansi-cyan-bright: #b3f0ff;
145
+ --color-project-header-bg: #24292f;
146
+ --color-project-sidebar-bg: #ffffff;
147
+ --color-project-gradient-in: #ffffff;
148
+ --color-project-gradient-out: rgba(255,255,255,0);
149
+ --color-mktg-btn-bg: #1b1f23;
150
+ --color-mktg-btn-shadow-outline: rgb(0 0 0 / 15%) 0 0 0 1px inset;
151
+ --color-mktg-btn-shadow-focus: rgb(0 0 0 / 15%) 0 0 0 4px;
152
+ --color-mktg-btn-shadow-hover: 0 3px 2px rgba(0, 0, 0, 0.07), 0 7px 5px rgba(0, 0, 0, 0.04), 0 12px 10px rgba(0, 0, 0, 0.03), 0 22px 18px rgba(0, 0, 0, 0.03), 0 42px 33px rgba(0, 0, 0, 0.02), 0 100px 80px rgba(0, 0, 0, 0.02);
153
+ --color-mktg-btn-shadow-hover-muted: rgb(0 0 0 / 70%) 0 0 0 2px inset;
154
+ --color-avatar-bg: #ffffff;
155
+ --color-avatar-border: rgba(27,31,36,0.15);
156
+ --color-avatar-stack-fade: #afb8c1;
157
+ --color-avatar-stack-fade-more: #d0d7de;
158
+ --color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,0.8);
159
+ --color-topic-tag-border: rgba(0,0,0,0);
160
+ --color-counter-border: rgba(0,0,0,0);
161
+ --color-select-menu-backdrop-border: rgba(0,0,0,0);
162
+ --color-select-menu-tap-highlight: rgba(175,184,193,0.5);
163
+ --color-select-menu-tap-focus-bg: #b6e3ff;
164
+ --color-overlay-shadow: 0 1px 3px rgba(27,31,36,0.12), 0 8px 24px rgba(66,74,83,0.12);
165
+ --color-header-text: rgba(255,255,255,0.7);
166
+ --color-header-bg: #24292f;
167
+ --color-header-divider: #57606a;
168
+ --color-header-logo: #ffffff;
169
+ --color-header-search-bg: #24292f;
170
+ --color-header-search-border: #57606a;
171
+ --color-sidenav-selected-bg: #ffffff;
172
+ --color-menu-bg-active: rgba(0,0,0,0);
173
+ --color-input-disabled-bg: rgba(175,184,193,0.2);
174
+ --color-timeline-badge-bg: #eaeef2;
175
+ --color-ansi-black: #24292f;
176
+ --color-ansi-black-bright: #57606a;
177
+ --color-ansi-white: #6e7781;
178
+ --color-ansi-white-bright: #8c959f;
179
+ --color-ansi-gray: #6e7781;
180
+ --color-ansi-red: #cf222e;
181
+ --color-ansi-red-bright: #a40e26;
182
+ --color-ansi-green: #116329;
183
+ --color-ansi-green-bright: #1a7f37;
184
+ --color-ansi-yellow: #4d2d00;
185
+ --color-ansi-yellow-bright: #633c01;
186
+ --color-ansi-blue: #0969da;
187
+ --color-ansi-blue-bright: #218bff;
188
+ --color-ansi-magenta: #8250df;
189
+ --color-ansi-magenta-bright: #a475f9;
190
+ --color-ansi-cyan: #1b7c83;
191
+ --color-ansi-cyan-bright: #3192aa;
192
+ --color-btn-text: #24292f;
193
+ --color-btn-bg: #f6f8fa;
194
+ --color-btn-border: rgba(27,31,36,0.15);
195
+ --color-btn-shadow: 0 1px 0 rgba(27,31,36,0.04);
196
+ --color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
197
+ --color-btn-hover-bg: #f3f4f6;
198
+ --color-btn-hover-border: rgba(27,31,36,0.15);
199
+ --color-btn-active-bg: hsla(220,14%,93%,1);
200
+ --color-btn-active-border: rgba(27,31,36,0.15);
201
+ --color-btn-selected-bg: hsla(220,14%,94%,1);
202
+ --color-btn-focus-bg: #f6f8fa;
203
+ --color-btn-focus-border: rgba(27,31,36,0.15);
204
+ --color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,0.3);
205
+ --color-btn-shadow-active: inset 0 0.15em 0.3em rgba(27,31,36,0.15);
206
+ --color-btn-shadow-input-focus: 0 0 0 0.2em rgba(9,105,218,0.3);
207
+ --color-btn-counter-bg: rgba(27,31,36,0.08);
208
+ --color-btn-primary-text: #ffffff;
209
+ --color-btn-primary-bg: #2da44e;
210
+ --color-btn-primary-border: rgba(27,31,36,0.15);
211
+ --color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,0.1);
212
+ --color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
213
+ --color-btn-primary-hover-bg: #2c974b;
214
+ --color-btn-primary-hover-border: rgba(27,31,36,0.15);
215
+ --color-btn-primary-selected-bg: hsla(137,55%,36%,1);
216
+ --color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,0.2);
217
+ --color-btn-primary-disabled-text: rgba(255,255,255,0.8);
218
+ --color-btn-primary-disabled-bg: #94d3a2;
219
+ --color-btn-primary-disabled-border: rgba(27,31,36,0.15);
220
+ --color-btn-primary-focus-bg: #2da44e;
221
+ --color-btn-primary-focus-border: rgba(27,31,36,0.15);
222
+ --color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,0.4);
223
+ --color-btn-primary-icon: rgba(255,255,255,0.8);
224
+ --color-btn-primary-counter-bg: rgba(255,255,255,0.2);
225
+ --color-btn-outline-text: #0969da;
226
+ --color-btn-outline-hover-text: #ffffff;
227
+ --color-btn-outline-hover-bg: #0969da;
228
+ --color-btn-outline-hover-border: rgba(27,31,36,0.15);
229
+ --color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,0.1);
230
+ --color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
231
+ --color-btn-outline-hover-counter-bg: rgba(255,255,255,0.2);
232
+ --color-btn-outline-selected-text: #ffffff;
233
+ --color-btn-outline-selected-bg: hsla(212,92%,42%,1);
234
+ --color-btn-outline-selected-border: rgba(27,31,36,0.15);
235
+ --color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,0.2);
236
+ --color-btn-outline-disabled-text: rgba(9,105,218,0.5);
237
+ --color-btn-outline-disabled-bg: #f6f8fa;
238
+ --color-btn-outline-disabled-counter-bg: rgba(9,105,218,0.05);
239
+ --color-btn-outline-focus-border: rgba(27,31,36,0.15);
240
+ --color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,0.4);
241
+ --color-btn-outline-counter-bg: rgba(9,105,218,0.1);
242
+ --color-btn-danger-text: #cf222e;
243
+ --color-btn-danger-hover-text: #ffffff;
244
+ --color-btn-danger-hover-bg: #a40e26;
245
+ --color-btn-danger-hover-border: rgba(27,31,36,0.15);
246
+ --color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,0.1);
247
+ --color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
248
+ --color-btn-danger-hover-counter-bg: rgba(255,255,255,0.2);
249
+ --color-btn-danger-selected-text: #ffffff;
250
+ --color-btn-danger-selected-bg: hsla(356,72%,44%,1);
251
+ --color-btn-danger-selected-border: rgba(27,31,36,0.15);
252
+ --color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,0.2);
253
+ --color-btn-danger-disabled-text: rgba(207,34,46,0.5);
254
+ --color-btn-danger-disabled-bg: #f6f8fa;
255
+ --color-btn-danger-disabled-counter-bg: rgba(207,34,46,0.05);
256
+ --color-btn-danger-focus-border: rgba(27,31,36,0.15);
257
+ --color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,0.4);
258
+ --color-btn-danger-counter-bg: rgba(207,34,46,0.1);
259
+ --color-btn-danger-icon: #cf222e;
260
+ --color-btn-danger-hover-icon: #ffffff;
261
+ --color-underlinenav-icon: #6e7781;
262
+ --color-underlinenav-border-hover: rgba(175,184,193,0.2);
263
+ --color-action-list-item-inline-divider: rgba(208,215,222,0.48);
264
+ --color-action-list-item-default-hover-bg: rgba(208,215,222,0.32);
265
+ --color-action-list-item-default-hover-border: rgba(0,0,0,0);
266
+ --color-action-list-item-default-active-bg: rgba(208,215,222,0.48);
267
+ --color-action-list-item-default-active-border: rgba(0,0,0,0);
268
+ --color-action-list-item-default-selected-bg: rgba(208,215,222,0.24);
269
+ --color-action-list-item-danger-hover-bg: rgba(255,235,233,0.64);
270
+ --color-action-list-item-danger-active-bg: #ffebe9;
271
+ --color-action-list-item-danger-hover-text: #cf222e;
272
+ --color-switch-track-bg: #eaeef2;
273
+ --color-switch-track-border: #afb8c1;
274
+ --color-switch-track-checked-bg: #ddf4ff;
275
+ --color-switch-track-checked-hover-bg: #b6e3ff;
276
+ --color-switch-track-checked-active-bg: #80ccff;
277
+ --color-switch-track-checked-border: #54aeff;
278
+ --color-switch-knob-checked-bg: #0969da;
279
+ --color-switch-knob-checked-disabled-bg: #6e7781;
280
+ --color-segmented-control-bg: #eaeef2;
281
+ --color-segmented-control-button-hover-bg: rgba(175,184,193,0.2);
282
+ --color-segmented-control-button-active-bg: rgba(175,184,193,0.4);
283
+ --color-segmented-control-button-selected-border: #6e7781;
284
+ --color-fg-default: #24292f;
285
+ --color-fg-muted: #57606a;
286
+ --color-fg-subtle: #6e7781;
287
+ --color-fg-on-emphasis: #ffffff;
288
+ --color-canvas-default: #ffffff;
289
+ --color-canvas-overlay: #ffffff;
290
+ --color-canvas-inset: #f6f8fa;
291
+ --color-canvas-subtle: #f6f8fa;
292
+ --color-border-default: #d0d7de;
293
+ --color-border-muted: hsla(210,18%,87%,1);
294
+ --color-border-subtle: rgba(27,31,36,0.15);
295
+ --color-shadow-small: 0 1px 0 rgba(27,31,36,0.04);
296
+ --color-shadow-medium: 0 3px 6px rgba(140,149,159,0.15);
297
+ --color-shadow-large: 0 8px 24px rgba(140,149,159,0.2);
298
+ --color-shadow-extra-large: 0 12px 28px rgba(140,149,159,0.3);
299
+ --color-neutral-emphasis-plus: #24292f;
300
+ --color-neutral-emphasis: #6e7781;
301
+ --color-neutral-muted: rgba(175,184,193,0.2);
302
+ --color-neutral-subtle: rgba(234,238,242,0.5);
303
+ --color-accent-fg: #0969da;
304
+ --color-accent-emphasis: #0969da;
305
+ --color-accent-muted: rgba(84,174,255,0.4);
306
+ --color-accent-subtle: #ddf4ff;
307
+ --color-success-fg: #1a7f37;
308
+ --color-success-emphasis: #2da44e;
309
+ --color-success-muted: rgba(74,194,107,0.4);
310
+ --color-success-subtle: #dafbe1;
311
+ --color-attention-fg: #9a6700;
312
+ --color-attention-emphasis: #bf8700;
313
+ --color-attention-muted: rgba(212,167,44,0.4);
314
+ --color-attention-subtle: #fff8c5;
315
+ --color-severe-fg: #bc4c00;
316
+ --color-severe-emphasis: #bc4c00;
317
+ --color-severe-muted: rgba(251,143,68,0.4);
318
+ --color-severe-subtle: #fff1e5;
319
+ --color-danger-fg: #cf222e;
320
+ --color-danger-emphasis: #cf222e;
321
+ --color-danger-muted: rgba(255,129,130,0.4);
322
+ --color-danger-subtle: #ffebe9;
323
+ --color-open-fg: #1a7f37;
324
+ --color-open-emphasis: #2da44e;
325
+ --color-open-muted: rgba(74,194,107,0.4);
326
+ --color-open-subtle: #dafbe1;
327
+ --color-closed-fg: #cf222e;
328
+ --color-closed-emphasis: #cf222e;
329
+ --color-closed-muted: rgba(255,129,130,0.4);
330
+ --color-closed-subtle: #ffebe9;
331
+ --color-done-fg: #8250df;
332
+ --color-done-emphasis: #8250df;
333
+ --color-done-muted: rgba(194,151,255,0.4);
334
+ --color-done-subtle: #fbefff;
335
+ --color-sponsors-fg: #bf3989;
336
+ --color-sponsors-emphasis: #bf3989;
337
+ --color-sponsors-muted: rgba(255,128,200,0.4);
338
+ --color-sponsors-subtle: #ffeff7;
339
+ --color-primer-fg-disabled: #8c959f;
340
+ --color-primer-canvas-backdrop: rgba(27,31,36,0.5);
341
+ --color-primer-canvas-sticky: rgba(255,255,255,0.95);
342
+ --color-primer-border-active: #fd8c73;
343
+ --color-primer-border-contrast: rgba(27,31,36,0.1);
344
+ --color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,0.25);
345
+ --color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,0.2);
346
+ --color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,0.3);
347
+ --color-scale-black: #1b1f24;
348
+ --color-scale-white: #ffffff;
349
+ --color-scale-gray-0: #f6f8fa;
350
+ --color-scale-gray-1: #eaeef2;
351
+ --color-scale-gray-2: #d0d7de;
352
+ --color-scale-gray-3: #afb8c1;
353
+ --color-scale-gray-4: #8c959f;
354
+ --color-scale-gray-5: #6e7781;
355
+ --color-scale-gray-6: #57606a;
356
+ --color-scale-gray-7: #424a53;
357
+ --color-scale-gray-8: #32383f;
358
+ --color-scale-gray-9: #24292f;
359
+ --color-scale-blue-0: #ddf4ff;
360
+ --color-scale-blue-1: #b6e3ff;
361
+ --color-scale-blue-2: #80ccff;
362
+ --color-scale-blue-3: #54aeff;
363
+ --color-scale-blue-4: #218bff;
364
+ --color-scale-blue-5: #0969da;
365
+ --color-scale-blue-6: #0550ae;
366
+ --color-scale-blue-7: #033d8b;
367
+ --color-scale-blue-8: #0a3069;
368
+ --color-scale-blue-9: #002155;
369
+ --color-scale-green-0: #dafbe1;
370
+ --color-scale-green-1: #aceebb;
371
+ --color-scale-green-2: #6fdd8b;
372
+ --color-scale-green-3: #4ac26b;
373
+ --color-scale-green-4: #2da44e;
374
+ --color-scale-green-5: #1a7f37;
375
+ --color-scale-green-6: #116329;
376
+ --color-scale-green-7: #044f1e;
377
+ --color-scale-green-8: #003d16;
378
+ --color-scale-green-9: #002d11;
379
+ --color-scale-yellow-0: #fff8c5;
380
+ --color-scale-yellow-1: #fae17d;
381
+ --color-scale-yellow-2: #eac54f;
382
+ --color-scale-yellow-3: #d4a72c;
383
+ --color-scale-yellow-4: #bf8700;
384
+ --color-scale-yellow-5: #9a6700;
385
+ --color-scale-yellow-6: #7d4e00;
386
+ --color-scale-yellow-7: #633c01;
387
+ --color-scale-yellow-8: #4d2d00;
388
+ --color-scale-yellow-9: #3b2300;
389
+ --color-scale-orange-0: #fff1e5;
390
+ --color-scale-orange-1: #ffd8b5;
391
+ --color-scale-orange-2: #ffb77c;
392
+ --color-scale-orange-3: #fb8f44;
393
+ --color-scale-orange-4: #e16f24;
394
+ --color-scale-orange-5: #bc4c00;
395
+ --color-scale-orange-6: #953800;
396
+ --color-scale-orange-7: #762c00;
397
+ --color-scale-orange-8: #5c2200;
398
+ --color-scale-orange-9: #471700;
399
+ --color-scale-red-0: #ffebe9;
400
+ --color-scale-red-1: #ffcecb;
401
+ --color-scale-red-2: #ffaba8;
402
+ --color-scale-red-3: #ff8182;
403
+ --color-scale-red-4: #fa4549;
404
+ --color-scale-red-5: #cf222e;
405
+ --color-scale-red-6: #a40e26;
406
+ --color-scale-red-7: #82071e;
407
+ --color-scale-red-8: #660018;
408
+ --color-scale-red-9: #4c0014;
409
+ --color-scale-purple-0: #fbefff;
410
+ --color-scale-purple-1: #ecd8ff;
411
+ --color-scale-purple-2: #d8b9ff;
412
+ --color-scale-purple-3: #c297ff;
413
+ --color-scale-purple-4: #a475f9;
414
+ --color-scale-purple-5: #8250df;
415
+ --color-scale-purple-6: #6639ba;
416
+ --color-scale-purple-7: #512a97;
417
+ --color-scale-purple-8: #3e1f79;
418
+ --color-scale-purple-9: #2e1461;
419
+ --color-scale-pink-0: #ffeff7;
420
+ --color-scale-pink-1: #ffd3eb;
421
+ --color-scale-pink-2: #ffadda;
422
+ --color-scale-pink-3: #ff80c8;
423
+ --color-scale-pink-4: #e85aad;
424
+ --color-scale-pink-5: #bf3989;
425
+ --color-scale-pink-6: #99286e;
426
+ --color-scale-pink-7: #772057;
427
+ --color-scale-pink-8: #611347;
428
+ --color-scale-pink-9: #4d0336;
429
+ --color-scale-coral-0: #fff0eb;
430
+ --color-scale-coral-1: #ffd6cc;
431
+ --color-scale-coral-2: #ffb4a1;
432
+ --color-scale-coral-3: #fd8c73;
433
+ --color-scale-coral-4: #ec6547;
434
+ --color-scale-coral-5: #c4432b;
435
+ --color-scale-coral-6: #9e2f1c;
436
+ --color-scale-coral-7: #801f0f;
437
+ --color-scale-coral-8: #691105;
438
+ --color-scale-coral-9: #510901;
439
+ }
@@ -0,0 +1,14 @@
1
+ import { HLJSApi } from "highlight.js"
2
+ import { DefineComponent } from "vue-demi"
3
+
4
+ declare const _default: {
5
+ install: (app: any) => void,
6
+ hljs: HLJSApi
7
+ }
8
+
9
+ declare const CodeDiff: DefineComponent<{}, {}, any>
10
+ export {
11
+ CodeDiff
12
+ }
13
+
14
+ export default _default
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Plugin } from 'vue-demi';
2
- import CodeDiff from './v-code-diff';
3
- declare const install: (app: any) => void;
4
- export { install, CodeDiff };
5
- declare const _default: Plugin;
6
- export default _default;
@@ -1,2 +0,0 @@
1
- import CodeDiff from './v-code-diff';
2
- export default CodeDiff;
@@ -1,3 +0,0 @@
1
- import './highlight.scss';
2
- import './style.scss';
3
- import 'diff2html/bundles/css/diff2html.min.css';
@@ -1,21 +0,0 @@
1
- import { SetupContext } from 'vue-demi';
2
- declare type Props = Readonly<{
3
- highlight: boolean;
4
- oldString: string;
5
- newString: string;
6
- context: number;
7
- outputFormat: 'side-by-side' | 'line-by-line';
8
- drawFileList: boolean;
9
- renderNothingWhenEmpty: boolean;
10
- fileName: string;
11
- isShowNoChange: boolean;
12
- diffStyle: 'word' | 'char';
13
- trim: boolean;
14
- language: string;
15
- noDiffLineFeed: boolean;
16
- } & {}>;
17
- export declare function useDebounceFn(fn: any, delay: any): () => void;
18
- export declare const createHtml: (props: Props) => string;
19
- export declare function highlightElements(element: Element, props: any, ctx: SetupContext<any>): Promise<void>;
20
- export declare function syncScroll(selector: any): void;
21
- export {};
@@ -1,129 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import './styles';
3
- declare const _default: import("vue-demi").DefineComponent<{
4
- highlight: {
5
- type: BooleanConstructor;
6
- default: boolean;
7
- };
8
- oldString: {
9
- type: StringConstructor;
10
- default: string;
11
- };
12
- newString: {
13
- type: StringConstructor;
14
- default: string;
15
- };
16
- context: {
17
- type: NumberConstructor;
18
- default: number;
19
- };
20
- outputFormat: {
21
- type: PropType<"line-by-line" | "side-by-side">;
22
- default: string;
23
- };
24
- drawFileList: {
25
- type: BooleanConstructor;
26
- default: boolean;
27
- };
28
- renderNothingWhenEmpty: {
29
- type: BooleanConstructor;
30
- default: boolean;
31
- };
32
- diffStyle: {
33
- type: PropType<"word" | "char">;
34
- default: string;
35
- };
36
- fileName: {
37
- type: StringConstructor;
38
- default: string;
39
- };
40
- isShowNoChange: {
41
- type: BooleanConstructor;
42
- default: boolean;
43
- };
44
- trim: {
45
- type: BooleanConstructor;
46
- default: boolean;
47
- };
48
- language: {
49
- type: StringConstructor;
50
- default: string;
51
- };
52
- noDiffLineFeed: {
53
- type: BooleanConstructor;
54
- default: boolean;
55
- };
56
- }, {
57
- html: import("vue-demi").Ref<string>;
58
- }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("before-render" | "after-render")[], "before-render" | "after-render", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
59
- highlight: {
60
- type: BooleanConstructor;
61
- default: boolean;
62
- };
63
- oldString: {
64
- type: StringConstructor;
65
- default: string;
66
- };
67
- newString: {
68
- type: StringConstructor;
69
- default: string;
70
- };
71
- context: {
72
- type: NumberConstructor;
73
- default: number;
74
- };
75
- outputFormat: {
76
- type: PropType<"line-by-line" | "side-by-side">;
77
- default: string;
78
- };
79
- drawFileList: {
80
- type: BooleanConstructor;
81
- default: boolean;
82
- };
83
- renderNothingWhenEmpty: {
84
- type: BooleanConstructor;
85
- default: boolean;
86
- };
87
- diffStyle: {
88
- type: PropType<"word" | "char">;
89
- default: string;
90
- };
91
- fileName: {
92
- type: StringConstructor;
93
- default: string;
94
- };
95
- isShowNoChange: {
96
- type: BooleanConstructor;
97
- default: boolean;
98
- };
99
- trim: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- language: {
104
- type: StringConstructor;
105
- default: string;
106
- };
107
- noDiffLineFeed: {
108
- type: BooleanConstructor;
109
- default: boolean;
110
- };
111
- }>> & {
112
- "onBefore-render"?: ((...args: any[]) => any) | undefined;
113
- "onAfter-render"?: ((...args: any[]) => any) | undefined;
114
- }, {
115
- trim: boolean;
116
- highlight: boolean;
117
- oldString: string;
118
- newString: string;
119
- context: number;
120
- outputFormat: "line-by-line" | "side-by-side";
121
- drawFileList: boolean;
122
- renderNothingWhenEmpty: boolean;
123
- diffStyle: "word" | "char";
124
- fileName: string;
125
- isShowNoChange: boolean;
126
- language: string;
127
- noDiffLineFeed: boolean;
128
- }>;
129
- export default _default;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue-demi"),n=require("diff"),t=require("diff2html"),r=require("highlight.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}require("diff2html/bundles/css/diff2html.min.css");var a=l(t),d=i(r);const o=e=>{let t=e.trim?e.oldString.trim():e.oldString,r=e.trim?e.newString.trim():e.newString;t=e.noDiffLineFeed?t.replace(/(\r\n)/g,"\n"):t,r=e.noDiffLineFeed?r.replace(/(\r\n)/g,"\n"):r;let i=e.context;e.isShowNoChange&&t===r&&(t="File Without Change\tOldString: ======================== \n"+t,r="File Without Change\tNewString: ======================== \n"+r,i=99999);const l=n.createPatch(e.fileName,t,r,"","",{context:i});return a.html(l,{outputFormat:e.outputFormat,drawFileList:e.drawFileList,matching:"lines",diffStyle:e.diffStyle,renderNothingWhenEmpty:e.renderNothingWhenEmpty})};async function p(e,n,t){t.emit("before-render");const r=await async function(e){return new Promise((n=>{setTimeout((()=>{const t=e.querySelectorAll(".d2h-wrapper .d2h-code-line-ctn");n(Array.from(t))}),0)}))}(e),i=Array.from(r).map((e=>async function(e,n){return new Promise((t=>{setTimeout((()=>{if(n){const t=e.innerText;e.innerHTML=d.default.highlight(t,{language:n}).value}else d.default.highlightElement(e);t(!0)}),0)}))}(e,n.language)));await Promise.all(i),t.emit("after-render")}function h(e){let n=document.createElement("div");document.querySelectorAll(e).forEach((function(t){t.addEventListener("mouseenter",(function(e){n=e.target})),t.addEventListener("scroll",(function(t){t.target===n&&document.querySelectorAll(e).forEach((function(e){n!==e&&(e.scrollTop=n.scrollTop,e.scrollLeft=n.scrollLeft)}))}))}))}var s=[],u=[];function c(e,n){if(e&&"undefined"!=typeof document){var t,r=!0===n.prepend?"prepend":"append",i=!0===n.singleTag,l="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(i){var a=s.indexOf(l);-1===a&&(a=s.push(l)-1,u[a]={}),t=u[a]&&u[a][r]?u[a][r]:u[a][r]=d()}else t=d();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function d(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),i=0;i<t.length;i++)e.setAttribute(t[i],n.attributes[t[i]]);var a="prepend"===r?"afterbegin":"beforeend";return l.insertAdjacentElement(a,e),e}}c(".d2h-wrapper .hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n.d2h-wrapper .hljs-comment,\n.d2h-wrapper .hljs-quote {\n color: #800;\n}\n.d2h-wrapper .hljs-keyword,\n.d2h-wrapper .hljs-selector-tag,\n.d2h-wrapper .hljs-section,\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-name {\n color: #008;\n}\n.d2h-wrapper .hljs-variable,\n.d2h-wrapper .hljs-template-variable {\n color: #660;\n}\n.d2h-wrapper .hljs-string,\n.d2h-wrapper .hljs-selector-attr,\n.d2h-wrapper .hljs-selector-pseudo,\n.d2h-wrapper .hljs-regexp {\n color: #080;\n}\n.d2h-wrapper .hljs-literal,\n.d2h-wrapper .hljs-symbol,\n.d2h-wrapper .hljs-bullet,\n.d2h-wrapper .hljs-meta,\n.d2h-wrapper .hljs-number,\n.d2h-wrapper .hljs-link {\n color: #066;\n}\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-type,\n.d2h-wrapper .hljs-attr,\n.d2h-wrapper .hljs-built_in,\n.d2h-wrapper .hljs-builtin-name,\n.d2h-wrapper .hljs-params {\n color: #606;\n}\n.d2h-wrapper .hljs-attribute,\n.d2h-wrapper .hljs-subst {\n color: #000;\n}\n.d2h-wrapper .hljs-formula {\n background-color: #eee;\n font-style: italic;\n}\n.d2h-wrapper .hljs-selector-id,\n.d2h-wrapper .hljs-selector-class {\n color: #9B703F;\n}\n.d2h-wrapper .hljs-addition {\n background-color: #baeeba;\n}\n.d2h-wrapper .hljs-deletion {\n background-color: #ffc8bd;\n}\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-strong {\n font-weight: bold;\n}\n.d2h-wrapper .hljs-emphasis {\n font-style: italic;\n}",{});c(".d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-file-header {\n display: none;\n}\n.d2h-wrapper .d2h-files-diff {\n display: flex;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-cntx,\n.d2h-wrapper .d2h-del,\n.d2h-wrapper .d2h-ins {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n line-height: 20px;\n height: 20px;\n}\n.d2h-wrapper tr {\n height: 20px;\n}",{});var f=e.defineComponent({name:"CodeDiff",props:{highlight:{type:Boolean,default:!0},oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},diffStyle:{type:String,default:"word"},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1},trim:{type:Boolean,default:!1},language:{type:String,default:""},noDiffLineFeed:{type:Boolean,default:!1}},emits:["before-render","after-render"],setup(n,t){const r=e.ref(o(n)),i=function(e,n){let t;return function(){const r=this,i=arguments;clearTimeout(t),t=setTimeout((function(){e.apply(r,i)}),n)}}((async()=>{if(r.value=o(n),n.highlight){const e=document.createElement("div");e.innerHTML=r.value,await p(e,n,t),r.value=e.innerHTML}}),200);return e.watch(n,i,{deep:!0,immediate:!0}),e.onMounted((()=>{"side-by-side"===n.outputFormat&&h(".d2h-file-side-diff")})),e.onUpdated((()=>{"side-by-side"===n.outputFormat&&h(".d2h-file-side-diff")})),{html:r}},render(){return e.isVue3?e.h("div",{innerHTML:this.html}):e.h("div",{domProps:{innerHTML:this.html}})}});const m=e=>{e.component(f.name,f)};var g={install:m};exports.CodeDiff=f,exports.default=g,exports.install=m;
@@ -1 +0,0 @@
1
- import{defineComponent as e,ref as n,watch as t,onMounted as r,onUpdated as i,isVue3 as l,h as a}from"vue-demi";import{createPatch as d}from"diff";import*as o from"diff2html";import p from"highlight.js";import"diff2html/bundles/css/diff2html.min.css";const h=e=>{let n=e.trim?e.oldString.trim():e.oldString,t=e.trim?e.newString.trim():e.newString;n=e.noDiffLineFeed?n.replace(/(\r\n)/g,"\n"):n,t=e.noDiffLineFeed?t.replace(/(\r\n)/g,"\n"):t;let r=e.context;e.isShowNoChange&&n===t&&(n="File Without Change\tOldString: ======================== \n"+n,t="File Without Change\tNewString: ======================== \n"+t,r=99999);const i=d(e.fileName,n,t,"","",{context:r});return o.html(i,{outputFormat:e.outputFormat,drawFileList:e.drawFileList,matching:"lines",diffStyle:e.diffStyle,renderNothingWhenEmpty:e.renderNothingWhenEmpty})};async function s(e,n,t){t.emit("before-render");const r=await async function(e){return new Promise((n=>{setTimeout((()=>{const t=e.querySelectorAll(".d2h-wrapper .d2h-code-line-ctn");n(Array.from(t))}),0)}))}(e),i=Array.from(r).map((e=>async function(e,n){return new Promise((t=>{setTimeout((()=>{if(n){const t=e.innerText;e.innerHTML=p.highlight(t,{language:n}).value}else p.highlightElement(e);t(!0)}),0)}))}(e,n.language)));await Promise.all(i),t.emit("after-render")}function c(e){let n=document.createElement("div");document.querySelectorAll(e).forEach((function(t){t.addEventListener("mouseenter",(function(e){n=e.target})),t.addEventListener("scroll",(function(t){t.target===n&&document.querySelectorAll(e).forEach((function(e){n!==e&&(e.scrollTop=n.scrollTop,e.scrollLeft=n.scrollLeft)}))}))}))}var u=[],f=[];function m(e,n){if(e&&"undefined"!=typeof document){var t,r=!0===n.prepend?"prepend":"append",i=!0===n.singleTag,l="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(i){var a=u.indexOf(l);-1===a&&(a=u.push(l)-1,f[a]={}),t=f[a]&&f[a][r]?f[a][r]:f[a][r]=d()}else t=d();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function d(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),i=0;i<t.length;i++)e.setAttribute(t[i],n.attributes[t[i]]);var a="prepend"===r?"afterbegin":"beforeend";return l.insertAdjacentElement(a,e),e}}m(".d2h-wrapper .hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n.d2h-wrapper .hljs-comment,\n.d2h-wrapper .hljs-quote {\n color: #800;\n}\n.d2h-wrapper .hljs-keyword,\n.d2h-wrapper .hljs-selector-tag,\n.d2h-wrapper .hljs-section,\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-name {\n color: #008;\n}\n.d2h-wrapper .hljs-variable,\n.d2h-wrapper .hljs-template-variable {\n color: #660;\n}\n.d2h-wrapper .hljs-string,\n.d2h-wrapper .hljs-selector-attr,\n.d2h-wrapper .hljs-selector-pseudo,\n.d2h-wrapper .hljs-regexp {\n color: #080;\n}\n.d2h-wrapper .hljs-literal,\n.d2h-wrapper .hljs-symbol,\n.d2h-wrapper .hljs-bullet,\n.d2h-wrapper .hljs-meta,\n.d2h-wrapper .hljs-number,\n.d2h-wrapper .hljs-link {\n color: #066;\n}\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-type,\n.d2h-wrapper .hljs-attr,\n.d2h-wrapper .hljs-built_in,\n.d2h-wrapper .hljs-builtin-name,\n.d2h-wrapper .hljs-params {\n color: #606;\n}\n.d2h-wrapper .hljs-attribute,\n.d2h-wrapper .hljs-subst {\n color: #000;\n}\n.d2h-wrapper .hljs-formula {\n background-color: #eee;\n font-style: italic;\n}\n.d2h-wrapper .hljs-selector-id,\n.d2h-wrapper .hljs-selector-class {\n color: #9B703F;\n}\n.d2h-wrapper .hljs-addition {\n background-color: #baeeba;\n}\n.d2h-wrapper .hljs-deletion {\n background-color: #ffc8bd;\n}\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-strong {\n font-weight: bold;\n}\n.d2h-wrapper .hljs-emphasis {\n font-style: italic;\n}",{});m(".d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-file-header {\n display: none;\n}\n.d2h-wrapper .d2h-files-diff {\n display: flex;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-cntx,\n.d2h-wrapper .d2h-del,\n.d2h-wrapper .d2h-ins {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n line-height: 20px;\n height: 20px;\n}\n.d2h-wrapper tr {\n height: 20px;\n}",{});var g=e({name:"CodeDiff",props:{highlight:{type:Boolean,default:!0},oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},diffStyle:{type:String,default:"word"},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1},trim:{type:Boolean,default:!1},language:{type:String,default:""},noDiffLineFeed:{type:Boolean,default:!1}},emits:["before-render","after-render"],setup(e,l){const a=n(h(e)),d=function(e,n){let t;return function(){const r=this,i=arguments;clearTimeout(t),t=setTimeout((function(){e.apply(r,i)}),n)}}((async()=>{if(a.value=h(e),e.highlight){const n=document.createElement("div");n.innerHTML=a.value,await s(n,e,l),a.value=n.innerHTML}}),200);return t(e,d,{deep:!0,immediate:!0}),r((()=>{"side-by-side"===e.outputFormat&&c(".d2h-file-side-diff")})),i((()=>{"side-by-side"===e.outputFormat&&c(".d2h-file-side-diff")})),{html:a}},render(){return a("div",l?{innerHTML:this.html}:{domProps:{innerHTML:this.html}})}});const w=e=>{e.component(g.name,g)};var y={install:w};export{g as CodeDiff,y as default,w as install};
@@ -1 +0,0 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue-demi"),require("diff"),require("diff2html"),require("highlight.js"),require("diff2html/bundles/css/diff2html.min.css")):"function"==typeof define&&define.amd?define(["exports","vue-demi","diff","diff2html","highlight.js","diff2html/bundles/css/diff2html.min.css"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["v-code-diff"]={},e.VueDemi,e.diff,e.d2h,e.hljs)}(this,(function(e,n,t,r,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var a=d(r),o=l(i);const h=e=>{let n=e.trim?e.oldString.trim():e.oldString,r=e.trim?e.newString.trim():e.newString;n=e.noDiffLineFeed?n.replace(/(\r\n)/g,"\n"):n,r=e.noDiffLineFeed?r.replace(/(\r\n)/g,"\n"):r;let i=e.context;e.isShowNoChange&&n===r&&(n="File Without Change\tOldString: ======================== \n"+n,r="File Without Change\tNewString: ======================== \n"+r,i=99999);const l=t.createPatch(e.fileName,n,r,"","",{context:i});return a.html(l,{outputFormat:e.outputFormat,drawFileList:e.drawFileList,matching:"lines",diffStyle:e.diffStyle,renderNothingWhenEmpty:e.renderNothingWhenEmpty})};async function p(e,n,t){t.emit("before-render");const r=await async function(e){return new Promise((n=>{setTimeout((()=>{const t=e.querySelectorAll(".d2h-wrapper .d2h-code-line-ctn");n(Array.from(t))}),0)}))}(e),i=Array.from(r).map((e=>async function(e,n){return new Promise((t=>{setTimeout((()=>{if(n){const t=e.innerText;e.innerHTML=o.default.highlight(t,{language:n}).value}else o.default.highlightElement(e);t(!0)}),0)}))}(e,n.language)));await Promise.all(i),t.emit("after-render")}function s(e){let n=document.createElement("div");document.querySelectorAll(e).forEach((function(t){t.addEventListener("mouseenter",(function(e){n=e.target})),t.addEventListener("scroll",(function(t){t.target===n&&document.querySelectorAll(e).forEach((function(e){n!==e&&(e.scrollTop=n.scrollTop,e.scrollLeft=n.scrollLeft)}))}))}))}var f=[],u=[];function c(e,n){if(e&&"undefined"!=typeof document){var t,r=!0===n.prepend?"prepend":"append",i=!0===n.singleTag,l="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(i){var d=f.indexOf(l);-1===d&&(d=f.push(l)-1,u[d]={}),t=u[d]&&u[d][r]?u[d][r]:u[d][r]=a()}else t=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),i=0;i<t.length;i++)e.setAttribute(t[i],n.attributes[t[i]]);var d="prepend"===r?"afterbegin":"beforeend";return l.insertAdjacentElement(d,e),e}}c(".d2h-wrapper .hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n.d2h-wrapper .hljs-comment,\n.d2h-wrapper .hljs-quote {\n color: #800;\n}\n.d2h-wrapper .hljs-keyword,\n.d2h-wrapper .hljs-selector-tag,\n.d2h-wrapper .hljs-section,\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-name {\n color: #008;\n}\n.d2h-wrapper .hljs-variable,\n.d2h-wrapper .hljs-template-variable {\n color: #660;\n}\n.d2h-wrapper .hljs-string,\n.d2h-wrapper .hljs-selector-attr,\n.d2h-wrapper .hljs-selector-pseudo,\n.d2h-wrapper .hljs-regexp {\n color: #080;\n}\n.d2h-wrapper .hljs-literal,\n.d2h-wrapper .hljs-symbol,\n.d2h-wrapper .hljs-bullet,\n.d2h-wrapper .hljs-meta,\n.d2h-wrapper .hljs-number,\n.d2h-wrapper .hljs-link {\n color: #066;\n}\n.d2h-wrapper .hljs-title,\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-type,\n.d2h-wrapper .hljs-attr,\n.d2h-wrapper .hljs-built_in,\n.d2h-wrapper .hljs-builtin-name,\n.d2h-wrapper .hljs-params {\n color: #606;\n}\n.d2h-wrapper .hljs-attribute,\n.d2h-wrapper .hljs-subst {\n color: #000;\n}\n.d2h-wrapper .hljs-formula {\n background-color: #eee;\n font-style: italic;\n}\n.d2h-wrapper .hljs-selector-id,\n.d2h-wrapper .hljs-selector-class {\n color: #9B703F;\n}\n.d2h-wrapper .hljs-addition {\n background-color: #baeeba;\n}\n.d2h-wrapper .hljs-deletion {\n background-color: #ffc8bd;\n}\n.d2h-wrapper .hljs-doctag,\n.d2h-wrapper .hljs-strong {\n font-weight: bold;\n}\n.d2h-wrapper .hljs-emphasis {\n font-style: italic;\n}",{});c(".d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-file-header {\n display: none;\n}\n.d2h-wrapper .d2h-files-diff {\n display: flex;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-cntx,\n.d2h-wrapper .d2h-del,\n.d2h-wrapper .d2h-ins {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n line-height: 20px;\n height: 20px;\n}\n.d2h-wrapper tr {\n height: 20px;\n}",{});var m=n.defineComponent({name:"CodeDiff",props:{highlight:{type:Boolean,default:!0},oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},diffStyle:{type:String,default:"word"},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1},trim:{type:Boolean,default:!1},language:{type:String,default:""},noDiffLineFeed:{type:Boolean,default:!1}},emits:["before-render","after-render"],setup(e,t){const r=n.ref(h(e)),i=function(e,n){let t;return function(){const r=this,i=arguments;clearTimeout(t),t=setTimeout((function(){e.apply(r,i)}),n)}}((async()=>{if(r.value=h(e),e.highlight){const n=document.createElement("div");n.innerHTML=r.value,await p(n,e,t),r.value=n.innerHTML}}),200);return n.watch(e,i,{deep:!0,immediate:!0}),n.onMounted((()=>{"side-by-side"===e.outputFormat&&s(".d2h-file-side-diff")})),n.onUpdated((()=>{"side-by-side"===e.outputFormat&&s(".d2h-file-side-diff")})),{html:r}},render(){return n.isVue3?n.h("div",{innerHTML:this.html}):n.h("div",{domProps:{innerHTML:this.html}})}});const g=e=>{e.component(m.name,m)};var w={install:g};e.CodeDiff=m,e.default=w,e.install=g,Object.defineProperty(e,"__esModule",{value:!0})}));