@fsegurai/codemirror-theme-nord 6.2.0-beta.4 → 6.2.0-beta.5
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/dist/index.cjs +263 -111
- package/dist/index.d.cts +19 -8
- package/dist/index.d.ts +19 -8
- package/dist/index.js +230 -78
- package/package.json +2 -3
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,107 @@
|
|
|
3
3
|
var view = require('@codemirror/view');
|
|
4
4
|
var language = require('@codemirror/language');
|
|
5
5
|
var highlight = require('@lezer/highlight');
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
// Helper module for styling options
|
|
8
|
+
const generalContent = {
|
|
9
|
+
fontSize: '14px',
|
|
10
|
+
fontFamily: 'JetBrains Mono, Consolas, monospace',
|
|
11
|
+
lineHeight: '1.6',
|
|
12
|
+
};
|
|
13
|
+
const generalCursor = {
|
|
14
|
+
borderLeftWidth: '2px',
|
|
15
|
+
};
|
|
16
|
+
const generalDiff = {
|
|
17
|
+
insertedTextDecoration: 'none',
|
|
18
|
+
deletedTextDecoration: 'line-through',
|
|
19
|
+
insertedLinePadding: '1px 3px',
|
|
20
|
+
borderRadious: '3px'};
|
|
21
|
+
const generalGutter = {
|
|
22
|
+
border: 'none',
|
|
23
|
+
paddingRight: '8px',
|
|
24
|
+
fontSize: '0.9em',
|
|
25
|
+
fontWeight: '500',
|
|
26
|
+
};
|
|
27
|
+
const generalPanel = {
|
|
28
|
+
border: 'none',
|
|
29
|
+
borderRadius: '4px',
|
|
30
|
+
padding: '2px 10px',
|
|
31
|
+
};
|
|
32
|
+
const generalLine = {
|
|
33
|
+
borderRadius: '2px',
|
|
34
|
+
};
|
|
35
|
+
const generalMatching = {
|
|
36
|
+
borderRadius: '2px',
|
|
37
|
+
};
|
|
38
|
+
const generalPlaceholder = {
|
|
39
|
+
borderRadius: '4px',
|
|
40
|
+
padding: '0 5px',
|
|
41
|
+
margin: '0 2px',
|
|
42
|
+
};
|
|
43
|
+
const generalScroller = {
|
|
44
|
+
width: '12px',
|
|
45
|
+
height: '12px',
|
|
46
|
+
borderRadius: '6px',
|
|
47
|
+
};
|
|
48
|
+
const generalSearchField = {
|
|
49
|
+
borderRadius: '4px',
|
|
50
|
+
padding: '2px 6px',
|
|
51
|
+
};
|
|
52
|
+
const generalTooltip = {
|
|
53
|
+
borderRadius: '4px',
|
|
54
|
+
borderRadiusSelected: '3px',
|
|
55
|
+
lineHeight: '1.3',
|
|
56
|
+
padding: '4px 8px',
|
|
57
|
+
paddingRight: '8px',
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Function to apply merge revert styles for a theme
|
|
61
|
+
* @param styles Styles for the merge revert buttons
|
|
62
|
+
* @param styles.backgroundColor Background color of the revert area
|
|
63
|
+
* @param styles.borderColor Border color of the revert area
|
|
64
|
+
* @param styles.buttonColor Color of the revert buttons
|
|
65
|
+
* @param styles.buttonHoverColor Hover color of the revert buttons
|
|
66
|
+
*/
|
|
67
|
+
function applyMergeRevertStyles(styles) {
|
|
68
|
+
// Create a stylesheet
|
|
69
|
+
const styleEl = document.createElement('style');
|
|
70
|
+
styleEl.id = 'cm-merge-revert-styles';
|
|
71
|
+
// Define CSS with the theme-specific values
|
|
72
|
+
styleEl.textContent = `
|
|
73
|
+
.cm-merge-revert {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: flex-start;
|
|
78
|
+
padding: 4px;
|
|
79
|
+
background-color: ${styles.backgroundColor};
|
|
80
|
+
border-left: 1px solid ${styles.borderColor};
|
|
81
|
+
border-right: 1px solid ${styles.borderColor};
|
|
82
|
+
width: 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cm-merge-revert button {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: auto;
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
border: none;
|
|
90
|
+
color: ${styles.buttonColor};
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
margin: 0 auto;
|
|
93
|
+
font-size: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.cm-merge-revert button:hover {
|
|
97
|
+
background-color: ${styles.buttonHoverColor};
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
// Remove any existing merge styles
|
|
101
|
+
const existingStyle = document.getElementById('cm-merge-revert-styles');
|
|
102
|
+
if (existingStyle)
|
|
103
|
+
existingStyle.remove();
|
|
104
|
+
// Add the new styles
|
|
105
|
+
document.head.appendChild(styleEl);
|
|
106
|
+
}
|
|
7
107
|
|
|
8
108
|
/**
|
|
9
109
|
* Enhanced Nord theme color definitions
|
|
@@ -11,39 +111,43 @@ var codemirrorThemeUtils = require('@fsegurai/codemirror-theme-utils');
|
|
|
11
111
|
* Colors organized by function with visual color blocks
|
|
12
112
|
*/
|
|
13
113
|
// Polar Night
|
|
14
|
-
const base00 = '#2e3440'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
114
|
+
const base00 = '#2e3440', // Background - deep navy blue
|
|
115
|
+
base01 = '#3b4252', // Lighter background (popups, statuslines)
|
|
116
|
+
base02 = '#434c5e', // Selection background
|
|
117
|
+
base03 = '#4c566a', // Comments, invisibles
|
|
18
118
|
// Snow Storm
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const base06 = '#eceff4'; // Light background
|
|
119
|
+
base04 = '#d8dee9', // Foreground - light blue-grey
|
|
120
|
+
base05 = '#eceff4', // Light background
|
|
22
121
|
// Frost
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
122
|
+
base06 = '#8fbcbb', // Moss green - function names
|
|
123
|
+
base07 = '#88c0d0', // Ice blue - classes, attributes
|
|
124
|
+
base08 = '#81a1c1', // Water blue - methods
|
|
125
|
+
base09 = '#5e81ac', // Deep blue - keywords
|
|
27
126
|
// Aurora
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
127
|
+
base0A = '#bf616a', // Red - errors, brackets
|
|
128
|
+
base0B = '#d08770', // Orange - numbers, constants
|
|
129
|
+
base0C = '#ebcb8b', // Yellow - types, classes
|
|
130
|
+
base0D = '#a3be8c', // Green - strings
|
|
131
|
+
base0E = '#b48ead'; // Purple - operators, special characters
|
|
33
132
|
// UI specific colors
|
|
34
|
-
const invalid = '#d30102'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
133
|
+
const invalid = '#d30102', // Bright red for errors
|
|
134
|
+
darkBackground = '#252a33', // Darker background for panels
|
|
135
|
+
highlightBackground = '#3b425277', // Active line highlight with opacity
|
|
136
|
+
background = base00, // Main editor background
|
|
137
|
+
tooltipBackground = base01, // Tooltip background
|
|
138
|
+
selection = base02, // Selection background
|
|
139
|
+
selectionMatch = '#4c566a80', // Selection match with opacity
|
|
140
|
+
cursor = base04, // Cursor color
|
|
141
|
+
activeBracketBg = '#4c566a55', // Active bracket background with opacity
|
|
142
|
+
activeBracketBorder = base07, // Active bracket border - ice blue
|
|
143
|
+
diagnosticWarning = base0C, // Warning color - yellow
|
|
144
|
+
linkColor = base08, // Link color - water blue
|
|
145
|
+
visitedLinkColor = base0E; // Visited link color - purple
|
|
146
|
+
// Diff/merge specific colors
|
|
147
|
+
const addedBackground = '#3b4a3880', // Dark green with transparency for insertions
|
|
148
|
+
removedBackground = '#4a393a80', // Dark red with transparency for deletions
|
|
149
|
+
addedText = '#a3be8c', // Nord green for added text
|
|
150
|
+
removedText = '#bf616a'; // Nord red for removed text
|
|
47
151
|
/**
|
|
48
152
|
* Enhanced editor theme styles for Nord
|
|
49
153
|
*/
|
|
@@ -52,17 +156,17 @@ const nordTheme = view.EditorView.theme({
|
|
|
52
156
|
'&': {
|
|
53
157
|
color: base04,
|
|
54
158
|
backgroundColor: background,
|
|
55
|
-
fontSize:
|
|
56
|
-
fontFamily:
|
|
159
|
+
fontSize: generalContent.fontSize,
|
|
160
|
+
fontFamily: generalContent.fontFamily,
|
|
57
161
|
},
|
|
58
162
|
// Content and cursor
|
|
59
163
|
'.cm-content': {
|
|
60
164
|
caretColor: cursor,
|
|
61
|
-
lineHeight:
|
|
165
|
+
lineHeight: generalContent.lineHeight,
|
|
62
166
|
},
|
|
63
167
|
'.cm-cursor, .cm-dropCursor': {
|
|
64
168
|
borderLeftColor: cursor,
|
|
65
|
-
borderLeftWidth:
|
|
169
|
+
borderLeftWidth: generalCursor.borderLeftWidth,
|
|
66
170
|
},
|
|
67
171
|
'.cm-fat-cursor': {
|
|
68
172
|
backgroundColor: `${cursor}99`,
|
|
@@ -79,25 +183,25 @@ const nordTheme = view.EditorView.theme({
|
|
|
79
183
|
// Search functionality
|
|
80
184
|
'.cm-searchMatch': {
|
|
81
185
|
backgroundColor: '#5e81ac80',
|
|
82
|
-
outline: `1px solid ${
|
|
186
|
+
outline: `1px solid ${base06}`,
|
|
83
187
|
color: base04,
|
|
84
|
-
borderRadius:
|
|
188
|
+
borderRadius: generalSearchField.borderRadius,
|
|
85
189
|
'& span': {
|
|
86
190
|
color: base04,
|
|
87
191
|
},
|
|
88
192
|
},
|
|
89
193
|
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
90
|
-
backgroundColor:
|
|
91
|
-
color:
|
|
92
|
-
padding:
|
|
194
|
+
backgroundColor: base08,
|
|
195
|
+
color: base05,
|
|
196
|
+
padding: generalSearchField.padding,
|
|
93
197
|
'& span': {
|
|
94
|
-
color:
|
|
198
|
+
color: base05,
|
|
95
199
|
},
|
|
96
200
|
},
|
|
97
201
|
'.cm-search.cm-panel.cm-textfield': {
|
|
98
202
|
color: base04,
|
|
99
|
-
borderRadius:
|
|
100
|
-
padding:
|
|
203
|
+
borderRadius: generalSearchField.borderRadius,
|
|
204
|
+
padding: generalSearchField.padding,
|
|
101
205
|
},
|
|
102
206
|
// Panels
|
|
103
207
|
'.cm-panels': {
|
|
@@ -114,9 +218,9 @@ const nordTheme = view.EditorView.theme({
|
|
|
114
218
|
'.cm-panel button': {
|
|
115
219
|
backgroundColor: tooltipBackground,
|
|
116
220
|
color: base04,
|
|
117
|
-
border:
|
|
118
|
-
borderRadius:
|
|
119
|
-
padding:
|
|
221
|
+
border: generalPanel.border,
|
|
222
|
+
borderRadius: generalPanel.borderRadius,
|
|
223
|
+
padding: generalPanel.padding,
|
|
120
224
|
},
|
|
121
225
|
'.cm-panel button:hover': {
|
|
122
226
|
backgroundColor: base02,
|
|
@@ -124,27 +228,27 @@ const nordTheme = view.EditorView.theme({
|
|
|
124
228
|
// Line highlighting
|
|
125
229
|
'.cm-activeLine': {
|
|
126
230
|
backgroundColor: highlightBackground,
|
|
127
|
-
borderRadius:
|
|
231
|
+
borderRadius: generalLine.borderRadius,
|
|
128
232
|
zIndex: 1,
|
|
129
233
|
},
|
|
130
234
|
// Gutters
|
|
131
235
|
'.cm-gutters': {
|
|
132
236
|
backgroundColor: darkBackground,
|
|
133
237
|
color: base03,
|
|
134
|
-
border:
|
|
238
|
+
border: generalGutter.border,
|
|
135
239
|
borderRight: `1px solid ${base02}`,
|
|
136
|
-
paddingRight:
|
|
240
|
+
paddingRight: generalGutter.paddingRight,
|
|
137
241
|
},
|
|
138
242
|
'.cm-activeLineGutter': {
|
|
139
243
|
backgroundColor: base01,
|
|
140
244
|
color: base04,
|
|
141
|
-
fontWeight:
|
|
245
|
+
fontWeight: generalGutter.fontWeight,
|
|
142
246
|
},
|
|
143
247
|
'.cm-lineNumbers': {
|
|
144
|
-
fontSize:
|
|
248
|
+
fontSize: generalGutter.fontSize,
|
|
145
249
|
},
|
|
146
250
|
'.cm-foldGutter': {
|
|
147
|
-
fontSize:
|
|
251
|
+
fontSize: generalGutter.fontSize,
|
|
148
252
|
},
|
|
149
253
|
'.cm-foldGutter .cm-gutterElement': {
|
|
150
254
|
color: base03,
|
|
@@ -153,12 +257,51 @@ const nordTheme = view.EditorView.theme({
|
|
|
153
257
|
'.cm-foldGutter .cm-gutterElement:hover': {
|
|
154
258
|
color: base04,
|
|
155
259
|
},
|
|
260
|
+
// Diff/Merge View Styles
|
|
261
|
+
// Inserted/Added Content
|
|
262
|
+
'.cm-insertedLine': {
|
|
263
|
+
textDecoration: generalDiff.insertedTextDecoration,
|
|
264
|
+
backgroundColor: addedBackground,
|
|
265
|
+
color: addedText,
|
|
266
|
+
padding: generalDiff.insertedLinePadding,
|
|
267
|
+
borderRadius: generalDiff.borderRadious,
|
|
268
|
+
},
|
|
269
|
+
'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
|
|
270
|
+
textDecoration: generalDiff.insertedTextDecoration,
|
|
271
|
+
backgroundColor: `${addedBackground} !important`,
|
|
272
|
+
color: addedText,
|
|
273
|
+
padding: generalDiff.insertedLinePadding,
|
|
274
|
+
borderRadius: generalDiff.borderRadious,
|
|
275
|
+
border: `1px solid ${addedText}40`,
|
|
276
|
+
},
|
|
277
|
+
'ins.cm-insertedLine .cm-changedText': {
|
|
278
|
+
background: 'transparent !important',
|
|
279
|
+
},
|
|
280
|
+
// Deleted/Removed Content
|
|
281
|
+
'.cm-deletedLine': {
|
|
282
|
+
textDecoration: generalDiff.deletedTextDecoration,
|
|
283
|
+
backgroundColor: removedBackground,
|
|
284
|
+
color: removedText,
|
|
285
|
+
padding: generalDiff.insertedLinePadding,
|
|
286
|
+
borderRadius: generalDiff.borderRadious,
|
|
287
|
+
},
|
|
288
|
+
'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
|
|
289
|
+
textDecoration: generalDiff.deletedTextDecoration,
|
|
290
|
+
backgroundColor: `${removedBackground} !important`,
|
|
291
|
+
color: removedText,
|
|
292
|
+
padding: generalDiff.insertedLinePadding,
|
|
293
|
+
borderRadius: generalDiff.borderRadious,
|
|
294
|
+
border: `1px solid ${removedText}40`,
|
|
295
|
+
},
|
|
296
|
+
'del .cm-deletedText, del .cm-changedText': {
|
|
297
|
+
background: 'transparent !important',
|
|
298
|
+
},
|
|
156
299
|
// Tooltips and autocomplete
|
|
157
300
|
'.cm-tooltip': {
|
|
158
301
|
backgroundColor: tooltipBackground,
|
|
159
302
|
border: `1px solid ${base03}`,
|
|
160
|
-
borderRadius:
|
|
161
|
-
padding:
|
|
303
|
+
borderRadius: generalTooltip.borderRadius,
|
|
304
|
+
padding: generalTooltip.padding,
|
|
162
305
|
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
|
|
163
306
|
},
|
|
164
307
|
'.cm-tooltip-autocomplete': {
|
|
@@ -167,17 +310,17 @@ const nordTheme = view.EditorView.theme({
|
|
|
167
310
|
border: 'none',
|
|
168
311
|
},
|
|
169
312
|
'& > ul > li': {
|
|
170
|
-
padding:
|
|
171
|
-
lineHeight:
|
|
313
|
+
padding: generalTooltip.padding,
|
|
314
|
+
lineHeight: generalTooltip.lineHeight,
|
|
172
315
|
},
|
|
173
316
|
'& > ul > li[aria-selected]': {
|
|
174
317
|
backgroundColor: base02,
|
|
175
|
-
color:
|
|
176
|
-
borderRadius:
|
|
318
|
+
color: base05,
|
|
319
|
+
borderRadius: generalTooltip.borderRadiusSelected,
|
|
177
320
|
},
|
|
178
321
|
'& > ul > li > span.cm-completionIcon': {
|
|
179
322
|
color: base03,
|
|
180
|
-
paddingRight:
|
|
323
|
+
paddingRight: generalTooltip.paddingRight,
|
|
181
324
|
},
|
|
182
325
|
'& > ul > li > span.cm-completionDetail': {
|
|
183
326
|
color: base03,
|
|
@@ -195,7 +338,7 @@ const nordTheme = view.EditorView.theme({
|
|
|
195
338
|
// Diagnostics styling
|
|
196
339
|
'.cm-diagnostic': {
|
|
197
340
|
'&-error': {
|
|
198
|
-
borderLeft: `3px solid ${
|
|
341
|
+
borderLeft: `3px solid ${base0A}`,
|
|
199
342
|
},
|
|
200
343
|
'&-warning': {
|
|
201
344
|
borderLeft: `3px solid ${diagnosticWarning}`,
|
|
@@ -205,7 +348,7 @@ const nordTheme = view.EditorView.theme({
|
|
|
205
348
|
},
|
|
206
349
|
},
|
|
207
350
|
'.cm-lintPoint-error': {
|
|
208
|
-
borderBottom: `2px wavy ${
|
|
351
|
+
borderBottom: `2px wavy ${base0A}`,
|
|
209
352
|
},
|
|
210
353
|
'.cm-lintPoint-warning': {
|
|
211
354
|
borderBottom: `2px wavy ${diagnosticWarning}`,
|
|
@@ -214,44 +357,44 @@ const nordTheme = view.EditorView.theme({
|
|
|
214
357
|
'.cm-matchingBracket': {
|
|
215
358
|
backgroundColor: activeBracketBg,
|
|
216
359
|
outline: `1px solid ${activeBracketBorder}`,
|
|
217
|
-
borderRadius:
|
|
360
|
+
borderRadius: generalMatching.borderRadius,
|
|
218
361
|
},
|
|
219
362
|
'.cm-nonmatchingBracket': {
|
|
220
|
-
backgroundColor: `${
|
|
363
|
+
backgroundColor: `${base0A}40`,
|
|
221
364
|
outline: `1px solid ${invalid}`,
|
|
222
|
-
borderRadius:
|
|
365
|
+
borderRadius: generalMatching.borderRadius,
|
|
223
366
|
},
|
|
224
367
|
// Selection matches
|
|
225
368
|
'.cm-selectionMatch': {
|
|
226
369
|
backgroundColor: selectionMatch,
|
|
227
370
|
outline: `1px solid ${base02}50`,
|
|
228
|
-
borderRadius:
|
|
371
|
+
borderRadius: generalMatching.borderRadius,
|
|
229
372
|
},
|
|
230
373
|
// Fold placeholder
|
|
231
374
|
'.cm-foldPlaceholder': {
|
|
232
375
|
backgroundColor: tooltipBackground,
|
|
233
376
|
color: base03,
|
|
234
377
|
border: `1px dotted ${base03}70`,
|
|
235
|
-
borderRadius:
|
|
236
|
-
padding:
|
|
237
|
-
margin:
|
|
378
|
+
borderRadius: generalPlaceholder.borderRadius,
|
|
379
|
+
padding: generalPlaceholder.padding,
|
|
380
|
+
margin: generalPlaceholder.margin,
|
|
238
381
|
},
|
|
239
382
|
// Focus outline
|
|
240
383
|
'&.cm-focused': {
|
|
241
384
|
outline: 'none',
|
|
242
|
-
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${
|
|
385
|
+
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base07}40`,
|
|
243
386
|
},
|
|
244
387
|
// Scrollbars
|
|
245
388
|
'& .cm-scroller::-webkit-scrollbar': {
|
|
246
|
-
width:
|
|
247
|
-
height:
|
|
389
|
+
width: generalScroller.width,
|
|
390
|
+
height: generalScroller.height,
|
|
248
391
|
},
|
|
249
392
|
'& .cm-scroller::-webkit-scrollbar-track': {
|
|
250
393
|
background: darkBackground,
|
|
251
394
|
},
|
|
252
395
|
'& .cm-scroller::-webkit-scrollbar-thumb': {
|
|
253
396
|
backgroundColor: base02,
|
|
254
|
-
borderRadius:
|
|
397
|
+
borderRadius: generalScroller.borderRadius,
|
|
255
398
|
border: `3px solid ${darkBackground}`,
|
|
256
399
|
},
|
|
257
400
|
'& .cm-scroller::-webkit-scrollbar-thumb:hover': {
|
|
@@ -268,52 +411,52 @@ const nordTheme = view.EditorView.theme({
|
|
|
268
411
|
*/
|
|
269
412
|
const nordHighlightStyle = language.HighlightStyle.define([
|
|
270
413
|
// Keywords and control flow
|
|
271
|
-
{ tag: highlight.tags.keyword, color:
|
|
272
|
-
{ tag: highlight.tags.controlKeyword, color:
|
|
273
|
-
{ tag: highlight.tags.moduleKeyword, color:
|
|
414
|
+
{ tag: highlight.tags.keyword, color: base09, fontWeight: 'bold' },
|
|
415
|
+
{ tag: highlight.tags.controlKeyword, color: base09, fontWeight: 'bold' },
|
|
416
|
+
{ tag: highlight.tags.moduleKeyword, color: base09, fontWeight: 'bold' },
|
|
274
417
|
// Names and variables
|
|
275
|
-
{ tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color:
|
|
418
|
+
{ tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base07 },
|
|
276
419
|
{ tag: [highlight.tags.variableName], color: base04 },
|
|
277
|
-
{ tag: [highlight.tags.propertyName], color:
|
|
420
|
+
{ tag: [highlight.tags.propertyName], color: base07, fontStyle: 'normal' },
|
|
278
421
|
// Classes and types
|
|
279
|
-
{ tag: [highlight.tags.typeName], color:
|
|
280
|
-
{ tag: [highlight.tags.className], color:
|
|
281
|
-
{ tag: [highlight.tags.namespace], color:
|
|
422
|
+
{ tag: [highlight.tags.typeName], color: base0C },
|
|
423
|
+
{ tag: [highlight.tags.className], color: base0C, fontStyle: 'italic' },
|
|
424
|
+
{ tag: [highlight.tags.namespace], color: base08, fontStyle: 'italic' },
|
|
282
425
|
// Operators and punctuation
|
|
283
|
-
{ tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color:
|
|
426
|
+
{ tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base0E },
|
|
284
427
|
{ tag: [highlight.tags.bracket], color: base04 },
|
|
285
|
-
{ tag: [highlight.tags.brace], color:
|
|
428
|
+
{ tag: [highlight.tags.brace], color: base06 },
|
|
286
429
|
{ tag: [highlight.tags.punctuation], color: base04 },
|
|
287
430
|
// Functions and parameters
|
|
288
|
-
{ tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color:
|
|
289
|
-
{ tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color:
|
|
290
|
-
{ tag: [highlight.tags.definition(highlight.tags.variableName)], color:
|
|
431
|
+
{ tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: base06 },
|
|
432
|
+
{ tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: base06 },
|
|
433
|
+
{ tag: [highlight.tags.definition(highlight.tags.variableName)], color: base0B },
|
|
291
434
|
// Constants and literals
|
|
292
|
-
{ tag: highlight.tags.number, color:
|
|
293
|
-
{ tag: highlight.tags.changed, color:
|
|
294
|
-
{ tag: highlight.tags.annotation, color:
|
|
295
|
-
{ tag: highlight.tags.modifier, color:
|
|
296
|
-
{ tag: highlight.tags.self, color:
|
|
297
|
-
{ tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color:
|
|
298
|
-
{ tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color:
|
|
435
|
+
{ tag: highlight.tags.number, color: base0B },
|
|
436
|
+
{ tag: highlight.tags.changed, color: base0E },
|
|
437
|
+
{ tag: highlight.tags.annotation, color: base0A, fontStyle: 'italic' },
|
|
438
|
+
{ tag: highlight.tags.modifier, color: base0E, fontStyle: 'italic' },
|
|
439
|
+
{ tag: highlight.tags.self, color: base0E },
|
|
440
|
+
{ tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base0B },
|
|
441
|
+
{ tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0E },
|
|
299
442
|
// Strings and regex
|
|
300
|
-
{ tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color:
|
|
301
|
-
{ tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color:
|
|
302
|
-
{ tag: highlight.tags.string, color:
|
|
443
|
+
{ tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: base06 },
|
|
444
|
+
{ tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: base0E },
|
|
445
|
+
{ tag: highlight.tags.string, color: base0D },
|
|
303
446
|
// Punctuation and structure
|
|
304
|
-
{ tag: highlight.tags.definition(highlight.tags.typeName), color:
|
|
305
|
-
{ tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color:
|
|
447
|
+
{ tag: highlight.tags.definition(highlight.tags.typeName), color: base0C, fontWeight: 'bold' },
|
|
448
|
+
{ tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0D },
|
|
306
449
|
// Comments and documentation
|
|
307
450
|
{ tag: highlight.tags.meta, color: base03 },
|
|
308
451
|
{ tag: highlight.tags.comment, fontStyle: 'italic', color: base03 },
|
|
309
452
|
{ tag: highlight.tags.docComment, fontStyle: 'italic', color: base03 },
|
|
310
453
|
// HTML/XML elements
|
|
311
|
-
{ tag: [highlight.tags.tagName], color:
|
|
312
|
-
{ tag: [highlight.tags.attributeName], color:
|
|
454
|
+
{ tag: [highlight.tags.tagName], color: base0A },
|
|
455
|
+
{ tag: [highlight.tags.attributeName], color: base0C },
|
|
313
456
|
// Markdown and text formatting
|
|
314
|
-
{ tag: [highlight.tags.heading], fontWeight: 'bold', color:
|
|
315
|
-
{ tag: [highlight.tags.strong], fontWeight: 'bold', color:
|
|
316
|
-
{ tag: [highlight.tags.emphasis], fontStyle: 'italic', color:
|
|
457
|
+
{ tag: [highlight.tags.heading], fontWeight: 'bold', color: base08 },
|
|
458
|
+
{ tag: [highlight.tags.strong], fontWeight: 'bold', color: base07 },
|
|
459
|
+
{ tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base0C },
|
|
317
460
|
// Links and URLs
|
|
318
461
|
{
|
|
319
462
|
tag: [highlight.tags.link],
|
|
@@ -333,18 +476,18 @@ const nordHighlightStyle = language.HighlightStyle.define([
|
|
|
333
476
|
tag: [highlight.tags.invalid],
|
|
334
477
|
color: base04,
|
|
335
478
|
textDecoration: 'underline wavy',
|
|
336
|
-
borderBottom: `1px wavy ${
|
|
479
|
+
borderBottom: `1px wavy ${base0A}`,
|
|
337
480
|
},
|
|
338
|
-
{ tag: [highlight.tags.strikethrough], color:
|
|
481
|
+
{ tag: [highlight.tags.strikethrough], color: base0A, textDecoration: 'line-through' },
|
|
339
482
|
// Enhanced syntax highlighting
|
|
340
|
-
{ tag: highlight.tags.constant(highlight.tags.name), color:
|
|
341
|
-
{ tag: highlight.tags.deleted, color:
|
|
342
|
-
{ tag: highlight.tags.squareBracket, color:
|
|
343
|
-
{ tag: highlight.tags.angleBracket, color:
|
|
483
|
+
{ tag: highlight.tags.constant(highlight.tags.name), color: base0B },
|
|
484
|
+
{ tag: highlight.tags.deleted, color: base0A },
|
|
485
|
+
{ tag: highlight.tags.squareBracket, color: base0A },
|
|
486
|
+
{ tag: highlight.tags.angleBracket, color: base0B },
|
|
344
487
|
// Additional specific styles
|
|
345
488
|
{ tag: highlight.tags.monospace, color: base04, fontStyle: 'italic' },
|
|
346
|
-
{ tag: [highlight.tags.contentSeparator], color:
|
|
347
|
-
{ tag: highlight.tags.quote, color:
|
|
489
|
+
{ tag: [highlight.tags.contentSeparator], color: base08 },
|
|
490
|
+
{ tag: highlight.tags.quote, color: base0E },
|
|
348
491
|
]);
|
|
349
492
|
/**
|
|
350
493
|
* Combined Nord theme extension
|
|
@@ -353,7 +496,16 @@ const nord = [
|
|
|
353
496
|
nordTheme,
|
|
354
497
|
language.syntaxHighlighting(nordHighlightStyle),
|
|
355
498
|
];
|
|
499
|
+
/**
|
|
500
|
+
* Nord merge revert styles configuration
|
|
501
|
+
*/
|
|
502
|
+
const nordMergeStyles = {
|
|
503
|
+
backgroundColor: darkBackground,
|
|
504
|
+
borderColor: base03,
|
|
505
|
+
buttonColor: base04,
|
|
506
|
+
buttonHoverColor: base02,
|
|
507
|
+
};
|
|
356
508
|
|
|
509
|
+
exports.applyMergeRevertStyles = applyMergeRevertStyles;
|
|
357
510
|
exports.nord = nord;
|
|
358
|
-
exports.
|
|
359
|
-
exports.nordTheme = nordTheme;
|
|
511
|
+
exports.nordMergeStyles = nordMergeStyles;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { Extension } from '@codemirror/state';
|
|
2
|
-
import { HighlightStyle } from '@codemirror/language';
|
|
3
2
|
|
|
3
|
+
interface IMergeRevertStyles {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
buttonColor: string;
|
|
7
|
+
buttonHoverColor: string;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
|
-
*
|
|
10
|
+
* Function to apply merge revert styles for a theme
|
|
11
|
+
* @param styles Styles for the merge revert buttons
|
|
12
|
+
* @param styles.backgroundColor Background color of the revert area
|
|
13
|
+
* @param styles.borderColor Border color of the revert area
|
|
14
|
+
* @param styles.buttonColor Color of the revert buttons
|
|
15
|
+
* @param styles.buttonHoverColor Hover color of the revert buttons
|
|
6
16
|
*/
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
* Enhanced syntax highlighting for Nord theme
|
|
10
|
-
*/
|
|
11
|
-
declare const nordHighlightStyle: HighlightStyle;
|
|
17
|
+
declare function applyMergeRevertStyles(styles: IMergeRevertStyles): void;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Combined Nord theme extension
|
|
14
21
|
*/
|
|
15
22
|
declare const nord: Extension;
|
|
23
|
+
/**
|
|
24
|
+
* Nord merge revert styles configuration
|
|
25
|
+
*/
|
|
26
|
+
declare const nordMergeStyles: IMergeRevertStyles;
|
|
16
27
|
|
|
17
|
-
export {
|
|
28
|
+
export { applyMergeRevertStyles, nord, nordMergeStyles };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { Extension } from '@codemirror/state';
|
|
2
|
-
import { HighlightStyle } from '@codemirror/language';
|
|
3
2
|
|
|
3
|
+
interface IMergeRevertStyles {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
buttonColor: string;
|
|
7
|
+
buttonHoverColor: string;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
|
-
*
|
|
10
|
+
* Function to apply merge revert styles for a theme
|
|
11
|
+
* @param styles Styles for the merge revert buttons
|
|
12
|
+
* @param styles.backgroundColor Background color of the revert area
|
|
13
|
+
* @param styles.borderColor Border color of the revert area
|
|
14
|
+
* @param styles.buttonColor Color of the revert buttons
|
|
15
|
+
* @param styles.buttonHoverColor Hover color of the revert buttons
|
|
6
16
|
*/
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
* Enhanced syntax highlighting for Nord theme
|
|
10
|
-
*/
|
|
11
|
-
declare const nordHighlightStyle: HighlightStyle;
|
|
17
|
+
declare function applyMergeRevertStyles(styles: IMergeRevertStyles): void;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Combined Nord theme extension
|
|
14
21
|
*/
|
|
15
22
|
declare const nord: Extension;
|
|
23
|
+
/**
|
|
24
|
+
* Nord merge revert styles configuration
|
|
25
|
+
*/
|
|
26
|
+
declare const nordMergeStyles: IMergeRevertStyles;
|
|
16
27
|
|
|
17
|
-
export {
|
|
28
|
+
export { applyMergeRevertStyles, nord, nordMergeStyles };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,107 @@
|
|
|
1
1
|
import { EditorView } from '@codemirror/view';
|
|
2
2
|
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
3
3
|
import { tags } from '@lezer/highlight';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
// Helper module for styling options
|
|
6
|
+
const generalContent = {
|
|
7
|
+
fontSize: '14px',
|
|
8
|
+
fontFamily: 'JetBrains Mono, Consolas, monospace',
|
|
9
|
+
lineHeight: '1.6',
|
|
10
|
+
};
|
|
11
|
+
const generalCursor = {
|
|
12
|
+
borderLeftWidth: '2px',
|
|
13
|
+
};
|
|
14
|
+
const generalDiff = {
|
|
15
|
+
insertedTextDecoration: 'none',
|
|
16
|
+
deletedTextDecoration: 'line-through',
|
|
17
|
+
insertedLinePadding: '1px 3px',
|
|
18
|
+
borderRadious: '3px'};
|
|
19
|
+
const generalGutter = {
|
|
20
|
+
border: 'none',
|
|
21
|
+
paddingRight: '8px',
|
|
22
|
+
fontSize: '0.9em',
|
|
23
|
+
fontWeight: '500',
|
|
24
|
+
};
|
|
25
|
+
const generalPanel = {
|
|
26
|
+
border: 'none',
|
|
27
|
+
borderRadius: '4px',
|
|
28
|
+
padding: '2px 10px',
|
|
29
|
+
};
|
|
30
|
+
const generalLine = {
|
|
31
|
+
borderRadius: '2px',
|
|
32
|
+
};
|
|
33
|
+
const generalMatching = {
|
|
34
|
+
borderRadius: '2px',
|
|
35
|
+
};
|
|
36
|
+
const generalPlaceholder = {
|
|
37
|
+
borderRadius: '4px',
|
|
38
|
+
padding: '0 5px',
|
|
39
|
+
margin: '0 2px',
|
|
40
|
+
};
|
|
41
|
+
const generalScroller = {
|
|
42
|
+
width: '12px',
|
|
43
|
+
height: '12px',
|
|
44
|
+
borderRadius: '6px',
|
|
45
|
+
};
|
|
46
|
+
const generalSearchField = {
|
|
47
|
+
borderRadius: '4px',
|
|
48
|
+
padding: '2px 6px',
|
|
49
|
+
};
|
|
50
|
+
const generalTooltip = {
|
|
51
|
+
borderRadius: '4px',
|
|
52
|
+
borderRadiusSelected: '3px',
|
|
53
|
+
lineHeight: '1.3',
|
|
54
|
+
padding: '4px 8px',
|
|
55
|
+
paddingRight: '8px',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Function to apply merge revert styles for a theme
|
|
59
|
+
* @param styles Styles for the merge revert buttons
|
|
60
|
+
* @param styles.backgroundColor Background color of the revert area
|
|
61
|
+
* @param styles.borderColor Border color of the revert area
|
|
62
|
+
* @param styles.buttonColor Color of the revert buttons
|
|
63
|
+
* @param styles.buttonHoverColor Hover color of the revert buttons
|
|
64
|
+
*/
|
|
65
|
+
function applyMergeRevertStyles(styles) {
|
|
66
|
+
// Create a stylesheet
|
|
67
|
+
const styleEl = document.createElement('style');
|
|
68
|
+
styleEl.id = 'cm-merge-revert-styles';
|
|
69
|
+
// Define CSS with the theme-specific values
|
|
70
|
+
styleEl.textContent = `
|
|
71
|
+
.cm-merge-revert {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
padding: 4px;
|
|
77
|
+
background-color: ${styles.backgroundColor};
|
|
78
|
+
border-left: 1px solid ${styles.borderColor};
|
|
79
|
+
border-right: 1px solid ${styles.borderColor};
|
|
80
|
+
width: 32px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.cm-merge-revert button {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: auto;
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
border: none;
|
|
88
|
+
color: ${styles.buttonColor};
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
margin: 0 auto;
|
|
91
|
+
font-size: 20px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.cm-merge-revert button:hover {
|
|
95
|
+
background-color: ${styles.buttonHoverColor};
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
// Remove any existing merge styles
|
|
99
|
+
const existingStyle = document.getElementById('cm-merge-revert-styles');
|
|
100
|
+
if (existingStyle)
|
|
101
|
+
existingStyle.remove();
|
|
102
|
+
// Add the new styles
|
|
103
|
+
document.head.appendChild(styleEl);
|
|
104
|
+
}
|
|
5
105
|
|
|
6
106
|
/**
|
|
7
107
|
* Enhanced Nord theme color definitions
|
|
@@ -9,39 +109,43 @@ import { generalScroller, generalPlaceholder, generalMatching, generalTooltip, g
|
|
|
9
109
|
* Colors organized by function with visual color blocks
|
|
10
110
|
*/
|
|
11
111
|
// Polar Night
|
|
12
|
-
const base00 = '#2e3440'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
112
|
+
const base00 = '#2e3440', // Background - deep navy blue
|
|
113
|
+
base01 = '#3b4252', // Lighter background (popups, statuslines)
|
|
114
|
+
base02 = '#434c5e', // Selection background
|
|
115
|
+
base03 = '#4c566a', // Comments, invisibles
|
|
16
116
|
// Snow Storm
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const base06 = '#eceff4'; // Light background
|
|
117
|
+
base04 = '#d8dee9', // Foreground - light blue-grey
|
|
118
|
+
base05 = '#eceff4', // Light background
|
|
20
119
|
// Frost
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
120
|
+
base06 = '#8fbcbb', // Moss green - function names
|
|
121
|
+
base07 = '#88c0d0', // Ice blue - classes, attributes
|
|
122
|
+
base08 = '#81a1c1', // Water blue - methods
|
|
123
|
+
base09 = '#5e81ac', // Deep blue - keywords
|
|
25
124
|
// Aurora
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
125
|
+
base0A = '#bf616a', // Red - errors, brackets
|
|
126
|
+
base0B = '#d08770', // Orange - numbers, constants
|
|
127
|
+
base0C = '#ebcb8b', // Yellow - types, classes
|
|
128
|
+
base0D = '#a3be8c', // Green - strings
|
|
129
|
+
base0E = '#b48ead'; // Purple - operators, special characters
|
|
31
130
|
// UI specific colors
|
|
32
|
-
const invalid = '#d30102'
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
131
|
+
const invalid = '#d30102', // Bright red for errors
|
|
132
|
+
darkBackground = '#252a33', // Darker background for panels
|
|
133
|
+
highlightBackground = '#3b425277', // Active line highlight with opacity
|
|
134
|
+
background = base00, // Main editor background
|
|
135
|
+
tooltipBackground = base01, // Tooltip background
|
|
136
|
+
selection = base02, // Selection background
|
|
137
|
+
selectionMatch = '#4c566a80', // Selection match with opacity
|
|
138
|
+
cursor = base04, // Cursor color
|
|
139
|
+
activeBracketBg = '#4c566a55', // Active bracket background with opacity
|
|
140
|
+
activeBracketBorder = base07, // Active bracket border - ice blue
|
|
141
|
+
diagnosticWarning = base0C, // Warning color - yellow
|
|
142
|
+
linkColor = base08, // Link color - water blue
|
|
143
|
+
visitedLinkColor = base0E; // Visited link color - purple
|
|
144
|
+
// Diff/merge specific colors
|
|
145
|
+
const addedBackground = '#3b4a3880', // Dark green with transparency for insertions
|
|
146
|
+
removedBackground = '#4a393a80', // Dark red with transparency for deletions
|
|
147
|
+
addedText = '#a3be8c', // Nord green for added text
|
|
148
|
+
removedText = '#bf616a'; // Nord red for removed text
|
|
45
149
|
/**
|
|
46
150
|
* Enhanced editor theme styles for Nord
|
|
47
151
|
*/
|
|
@@ -77,7 +181,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
77
181
|
// Search functionality
|
|
78
182
|
'.cm-searchMatch': {
|
|
79
183
|
backgroundColor: '#5e81ac80',
|
|
80
|
-
outline: `1px solid ${
|
|
184
|
+
outline: `1px solid ${base06}`,
|
|
81
185
|
color: base04,
|
|
82
186
|
borderRadius: generalSearchField.borderRadius,
|
|
83
187
|
'& span': {
|
|
@@ -85,11 +189,11 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
85
189
|
},
|
|
86
190
|
},
|
|
87
191
|
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
88
|
-
backgroundColor:
|
|
89
|
-
color:
|
|
192
|
+
backgroundColor: base08,
|
|
193
|
+
color: base05,
|
|
90
194
|
padding: generalSearchField.padding,
|
|
91
195
|
'& span': {
|
|
92
|
-
color:
|
|
196
|
+
color: base05,
|
|
93
197
|
},
|
|
94
198
|
},
|
|
95
199
|
'.cm-search.cm-panel.cm-textfield': {
|
|
@@ -151,6 +255,45 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
151
255
|
'.cm-foldGutter .cm-gutterElement:hover': {
|
|
152
256
|
color: base04,
|
|
153
257
|
},
|
|
258
|
+
// Diff/Merge View Styles
|
|
259
|
+
// Inserted/Added Content
|
|
260
|
+
'.cm-insertedLine': {
|
|
261
|
+
textDecoration: generalDiff.insertedTextDecoration,
|
|
262
|
+
backgroundColor: addedBackground,
|
|
263
|
+
color: addedText,
|
|
264
|
+
padding: generalDiff.insertedLinePadding,
|
|
265
|
+
borderRadius: generalDiff.borderRadious,
|
|
266
|
+
},
|
|
267
|
+
'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
|
|
268
|
+
textDecoration: generalDiff.insertedTextDecoration,
|
|
269
|
+
backgroundColor: `${addedBackground} !important`,
|
|
270
|
+
color: addedText,
|
|
271
|
+
padding: generalDiff.insertedLinePadding,
|
|
272
|
+
borderRadius: generalDiff.borderRadious,
|
|
273
|
+
border: `1px solid ${addedText}40`,
|
|
274
|
+
},
|
|
275
|
+
'ins.cm-insertedLine .cm-changedText': {
|
|
276
|
+
background: 'transparent !important',
|
|
277
|
+
},
|
|
278
|
+
// Deleted/Removed Content
|
|
279
|
+
'.cm-deletedLine': {
|
|
280
|
+
textDecoration: generalDiff.deletedTextDecoration,
|
|
281
|
+
backgroundColor: removedBackground,
|
|
282
|
+
color: removedText,
|
|
283
|
+
padding: generalDiff.insertedLinePadding,
|
|
284
|
+
borderRadius: generalDiff.borderRadious,
|
|
285
|
+
},
|
|
286
|
+
'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
|
|
287
|
+
textDecoration: generalDiff.deletedTextDecoration,
|
|
288
|
+
backgroundColor: `${removedBackground} !important`,
|
|
289
|
+
color: removedText,
|
|
290
|
+
padding: generalDiff.insertedLinePadding,
|
|
291
|
+
borderRadius: generalDiff.borderRadious,
|
|
292
|
+
border: `1px solid ${removedText}40`,
|
|
293
|
+
},
|
|
294
|
+
'del .cm-deletedText, del .cm-changedText': {
|
|
295
|
+
background: 'transparent !important',
|
|
296
|
+
},
|
|
154
297
|
// Tooltips and autocomplete
|
|
155
298
|
'.cm-tooltip': {
|
|
156
299
|
backgroundColor: tooltipBackground,
|
|
@@ -170,7 +313,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
170
313
|
},
|
|
171
314
|
'& > ul > li[aria-selected]': {
|
|
172
315
|
backgroundColor: base02,
|
|
173
|
-
color:
|
|
316
|
+
color: base05,
|
|
174
317
|
borderRadius: generalTooltip.borderRadiusSelected,
|
|
175
318
|
},
|
|
176
319
|
'& > ul > li > span.cm-completionIcon': {
|
|
@@ -193,7 +336,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
193
336
|
// Diagnostics styling
|
|
194
337
|
'.cm-diagnostic': {
|
|
195
338
|
'&-error': {
|
|
196
|
-
borderLeft: `3px solid ${
|
|
339
|
+
borderLeft: `3px solid ${base0A}`,
|
|
197
340
|
},
|
|
198
341
|
'&-warning': {
|
|
199
342
|
borderLeft: `3px solid ${diagnosticWarning}`,
|
|
@@ -203,7 +346,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
203
346
|
},
|
|
204
347
|
},
|
|
205
348
|
'.cm-lintPoint-error': {
|
|
206
|
-
borderBottom: `2px wavy ${
|
|
349
|
+
borderBottom: `2px wavy ${base0A}`,
|
|
207
350
|
},
|
|
208
351
|
'.cm-lintPoint-warning': {
|
|
209
352
|
borderBottom: `2px wavy ${diagnosticWarning}`,
|
|
@@ -215,7 +358,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
215
358
|
borderRadius: generalMatching.borderRadius,
|
|
216
359
|
},
|
|
217
360
|
'.cm-nonmatchingBracket': {
|
|
218
|
-
backgroundColor: `${
|
|
361
|
+
backgroundColor: `${base0A}40`,
|
|
219
362
|
outline: `1px solid ${invalid}`,
|
|
220
363
|
borderRadius: generalMatching.borderRadius,
|
|
221
364
|
},
|
|
@@ -237,7 +380,7 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
237
380
|
// Focus outline
|
|
238
381
|
'&.cm-focused': {
|
|
239
382
|
outline: 'none',
|
|
240
|
-
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${
|
|
383
|
+
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base07}40`,
|
|
241
384
|
},
|
|
242
385
|
// Scrollbars
|
|
243
386
|
'& .cm-scroller::-webkit-scrollbar': {
|
|
@@ -266,52 +409,52 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
266
409
|
*/
|
|
267
410
|
const nordHighlightStyle = /*@__PURE__*/HighlightStyle.define([
|
|
268
411
|
// Keywords and control flow
|
|
269
|
-
{ tag: tags.keyword, color:
|
|
270
|
-
{ tag: tags.controlKeyword, color:
|
|
271
|
-
{ tag: tags.moduleKeyword, color:
|
|
412
|
+
{ tag: tags.keyword, color: base09, fontWeight: 'bold' },
|
|
413
|
+
{ tag: tags.controlKeyword, color: base09, fontWeight: 'bold' },
|
|
414
|
+
{ tag: tags.moduleKeyword, color: base09, fontWeight: 'bold' },
|
|
272
415
|
// Names and variables
|
|
273
|
-
{ tag: [tags.name, tags.deleted, tags.character, tags.macroName], color:
|
|
416
|
+
{ tag: [tags.name, tags.deleted, tags.character, tags.macroName], color: base07 },
|
|
274
417
|
{ tag: [tags.variableName], color: base04 },
|
|
275
|
-
{ tag: [tags.propertyName], color:
|
|
418
|
+
{ tag: [tags.propertyName], color: base07, fontStyle: 'normal' },
|
|
276
419
|
// Classes and types
|
|
277
|
-
{ tag: [tags.typeName], color:
|
|
278
|
-
{ tag: [tags.className], color:
|
|
279
|
-
{ tag: [tags.namespace], color:
|
|
420
|
+
{ tag: [tags.typeName], color: base0C },
|
|
421
|
+
{ tag: [tags.className], color: base0C, fontStyle: 'italic' },
|
|
422
|
+
{ tag: [tags.namespace], color: base08, fontStyle: 'italic' },
|
|
280
423
|
// Operators and punctuation
|
|
281
|
-
{ tag: [tags.operator, tags.operatorKeyword], color:
|
|
424
|
+
{ tag: [tags.operator, tags.operatorKeyword], color: base0E },
|
|
282
425
|
{ tag: [tags.bracket], color: base04 },
|
|
283
|
-
{ tag: [tags.brace], color:
|
|
426
|
+
{ tag: [tags.brace], color: base06 },
|
|
284
427
|
{ tag: [tags.punctuation], color: base04 },
|
|
285
428
|
// Functions and parameters
|
|
286
|
-
{ tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color:
|
|
287
|
-
{ tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color:
|
|
288
|
-
{ tag: [/*@__PURE__*/tags.definition(tags.variableName)], color:
|
|
429
|
+
{ tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color: base06 },
|
|
430
|
+
{ tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color: base06 },
|
|
431
|
+
{ tag: [/*@__PURE__*/tags.definition(tags.variableName)], color: base0B },
|
|
289
432
|
// Constants and literals
|
|
290
|
-
{ tag: tags.number, color:
|
|
291
|
-
{ tag: tags.changed, color:
|
|
292
|
-
{ tag: tags.annotation, color:
|
|
293
|
-
{ tag: tags.modifier, color:
|
|
294
|
-
{ tag: tags.self, color:
|
|
295
|
-
{ tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color:
|
|
296
|
-
{ tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color:
|
|
433
|
+
{ tag: tags.number, color: base0B },
|
|
434
|
+
{ tag: tags.changed, color: base0E },
|
|
435
|
+
{ tag: tags.annotation, color: base0A, fontStyle: 'italic' },
|
|
436
|
+
{ tag: tags.modifier, color: base0E, fontStyle: 'italic' },
|
|
437
|
+
{ tag: tags.self, color: base0E },
|
|
438
|
+
{ tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: base0B },
|
|
439
|
+
{ tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0E },
|
|
297
440
|
// Strings and regex
|
|
298
|
-
{ tag: [tags.processingInstruction, tags.inserted], color:
|
|
299
|
-
{ tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color:
|
|
300
|
-
{ tag: tags.string, color:
|
|
441
|
+
{ tag: [tags.processingInstruction, tags.inserted], color: base06 },
|
|
442
|
+
{ tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color: base0E },
|
|
443
|
+
{ tag: tags.string, color: base0D },
|
|
301
444
|
// Punctuation and structure
|
|
302
|
-
{ tag: /*@__PURE__*/tags.definition(tags.typeName), color:
|
|
303
|
-
{ tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color:
|
|
445
|
+
{ tag: /*@__PURE__*/tags.definition(tags.typeName), color: base0C, fontWeight: 'bold' },
|
|
446
|
+
{ tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base0D },
|
|
304
447
|
// Comments and documentation
|
|
305
448
|
{ tag: tags.meta, color: base03 },
|
|
306
449
|
{ tag: tags.comment, fontStyle: 'italic', color: base03 },
|
|
307
450
|
{ tag: tags.docComment, fontStyle: 'italic', color: base03 },
|
|
308
451
|
// HTML/XML elements
|
|
309
|
-
{ tag: [tags.tagName], color:
|
|
310
|
-
{ tag: [tags.attributeName], color:
|
|
452
|
+
{ tag: [tags.tagName], color: base0A },
|
|
453
|
+
{ tag: [tags.attributeName], color: base0C },
|
|
311
454
|
// Markdown and text formatting
|
|
312
|
-
{ tag: [tags.heading], fontWeight: 'bold', color:
|
|
313
|
-
{ tag: [tags.strong], fontWeight: 'bold', color:
|
|
314
|
-
{ tag: [tags.emphasis], fontStyle: 'italic', color:
|
|
455
|
+
{ tag: [tags.heading], fontWeight: 'bold', color: base08 },
|
|
456
|
+
{ tag: [tags.strong], fontWeight: 'bold', color: base07 },
|
|
457
|
+
{ tag: [tags.emphasis], fontStyle: 'italic', color: base0C },
|
|
315
458
|
// Links and URLs
|
|
316
459
|
{
|
|
317
460
|
tag: [tags.link],
|
|
@@ -331,18 +474,18 @@ const nordHighlightStyle = /*@__PURE__*/HighlightStyle.define([
|
|
|
331
474
|
tag: [tags.invalid],
|
|
332
475
|
color: base04,
|
|
333
476
|
textDecoration: 'underline wavy',
|
|
334
|
-
borderBottom: `1px wavy ${
|
|
477
|
+
borderBottom: `1px wavy ${base0A}`,
|
|
335
478
|
},
|
|
336
|
-
{ tag: [tags.strikethrough], color:
|
|
479
|
+
{ tag: [tags.strikethrough], color: base0A, textDecoration: 'line-through' },
|
|
337
480
|
// Enhanced syntax highlighting
|
|
338
|
-
{ tag: /*@__PURE__*/tags.constant(tags.name), color:
|
|
339
|
-
{ tag: tags.deleted, color:
|
|
340
|
-
{ tag: tags.squareBracket, color:
|
|
341
|
-
{ tag: tags.angleBracket, color:
|
|
481
|
+
{ tag: /*@__PURE__*/tags.constant(tags.name), color: base0B },
|
|
482
|
+
{ tag: tags.deleted, color: base0A },
|
|
483
|
+
{ tag: tags.squareBracket, color: base0A },
|
|
484
|
+
{ tag: tags.angleBracket, color: base0B },
|
|
342
485
|
// Additional specific styles
|
|
343
486
|
{ tag: tags.monospace, color: base04, fontStyle: 'italic' },
|
|
344
|
-
{ tag: [tags.contentSeparator], color:
|
|
345
|
-
{ tag: tags.quote, color:
|
|
487
|
+
{ tag: [tags.contentSeparator], color: base08 },
|
|
488
|
+
{ tag: tags.quote, color: base0E },
|
|
346
489
|
]);
|
|
347
490
|
/**
|
|
348
491
|
* Combined Nord theme extension
|
|
@@ -351,5 +494,14 @@ const nord = [
|
|
|
351
494
|
nordTheme,
|
|
352
495
|
/*@__PURE__*/syntaxHighlighting(nordHighlightStyle),
|
|
353
496
|
];
|
|
497
|
+
/**
|
|
498
|
+
* Nord merge revert styles configuration
|
|
499
|
+
*/
|
|
500
|
+
const nordMergeStyles = {
|
|
501
|
+
backgroundColor: darkBackground,
|
|
502
|
+
borderColor: base03,
|
|
503
|
+
buttonColor: base04,
|
|
504
|
+
buttonHoverColor: base02,
|
|
505
|
+
};
|
|
354
506
|
|
|
355
|
-
export {
|
|
507
|
+
export { applyMergeRevertStyles, nord, nordMergeStyles };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fsegurai/codemirror-theme-nord",
|
|
3
3
|
"description": "Nord theme for the CodeMirror code editor",
|
|
4
|
-
"version": "6.2.0-beta.
|
|
4
|
+
"version": "6.2.0-beta.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"exports": {
|
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
"@lezer/highlight": "^1.0.0",
|
|
35
35
|
"@codemirror/language": "^6.0.0",
|
|
36
36
|
"@codemirror/state": "^6.0.0",
|
|
37
|
-
"@codemirror/view": "^6.0.0"
|
|
38
|
-
"@fsegurai/codemirror-theme-utils": "6.2.0-beta.3"
|
|
37
|
+
"@codemirror/view": "^6.0.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@codemirror/buildhelper": "^1.0.2"
|