@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 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
- var codemirrorThemeUtils = require('@fsegurai/codemirror-theme-utils');
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'; // Background - deep navy blue
15
- const base01 = '#3b4252'; // Lighter background (popups, statuslines)
16
- const base02 = '#434c5e'; // Selection background
17
- const base03 = '#4c566a'; // Comments, invisibles
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
- const base04 = '#d8dee9'; // Foreground - light blue-grey
20
- // const base05 = '#e5e9f0'; // Light foreground
21
- const base06 = '#eceff4'; // Light background
119
+ base04 = '#d8dee9', // Foreground - light blue-grey
120
+ base05 = '#eceff4', // Light background
22
121
  // Frost
23
- const base07 = '#8fbcbb'; // Moss green - function names
24
- const base08 = '#88c0d0'; // Ice blue - classes, attributes
25
- const base09 = '#81a1c1'; // Water blue - methods
26
- const base0A = '#5e81ac'; // Deep blue - keywords
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
- const base0B = '#bf616a'; // Red - errors, brackets
29
- const base0C = '#d08770'; // Orange - numbers, constants
30
- const base0D = '#ebcb8b'; // Yellow - types, classes
31
- const base0E = '#a3be8c'; // Green - strings
32
- const base0F = '#b48ead'; // Purple - operators, special characters
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'; // Bright red for errors
35
- const darkBackground = '#252a33'; // Darker background for panels
36
- const highlightBackground = '#3b425277'; // Active line highlight with opacity
37
- const background = base00; // Main editor background
38
- const tooltipBackground = base01; // Tooltip background
39
- const selection = base02; // Selection background
40
- const selectionMatch = '#4c566a80'; // Selection match with opacity
41
- const cursor = base04; // Cursor color
42
- const activeBracketBg = '#4c566a55'; // Active bracket background with opacity
43
- const activeBracketBorder = base08; // Active bracket border - ice blue
44
- const diagnosticWarning = base0D; // Warning color - yellow
45
- const linkColor = base09; // Link color - water blue
46
- const visitedLinkColor = base0F; // Visited link color - purple
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: codemirrorThemeUtils.generalContent.fontSize,
56
- fontFamily: codemirrorThemeUtils.generalContent.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: codemirrorThemeUtils.generalContent.lineHeight,
165
+ lineHeight: generalContent.lineHeight,
62
166
  },
63
167
  '.cm-cursor, .cm-dropCursor': {
64
168
  borderLeftColor: cursor,
65
- borderLeftWidth: codemirrorThemeUtils.generalCursor.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 ${base07}`,
186
+ outline: `1px solid ${base06}`,
83
187
  color: base04,
84
- borderRadius: codemirrorThemeUtils.generalSearchField.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: base09,
91
- color: base06,
92
- padding: codemirrorThemeUtils.generalSearchField.padding,
194
+ backgroundColor: base08,
195
+ color: base05,
196
+ padding: generalSearchField.padding,
93
197
  '& span': {
94
- color: base06,
198
+ color: base05,
95
199
  },
96
200
  },
97
201
  '.cm-search.cm-panel.cm-textfield': {
98
202
  color: base04,
99
- borderRadius: codemirrorThemeUtils.generalSearchField.borderRadius,
100
- padding: codemirrorThemeUtils.generalSearchField.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: codemirrorThemeUtils.generalPanel.border,
118
- borderRadius: codemirrorThemeUtils.generalPanel.borderRadius,
119
- padding: codemirrorThemeUtils.generalPanel.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: codemirrorThemeUtils.generalLine.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: codemirrorThemeUtils.generalGutter.border,
238
+ border: generalGutter.border,
135
239
  borderRight: `1px solid ${base02}`,
136
- paddingRight: codemirrorThemeUtils.generalGutter.paddingRight,
240
+ paddingRight: generalGutter.paddingRight,
137
241
  },
138
242
  '.cm-activeLineGutter': {
139
243
  backgroundColor: base01,
140
244
  color: base04,
141
- fontWeight: codemirrorThemeUtils.generalGutter.fontWeight,
245
+ fontWeight: generalGutter.fontWeight,
142
246
  },
143
247
  '.cm-lineNumbers': {
144
- fontSize: codemirrorThemeUtils.generalGutter.fontSize,
248
+ fontSize: generalGutter.fontSize,
145
249
  },
146
250
  '.cm-foldGutter': {
147
- fontSize: codemirrorThemeUtils.generalGutter.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: codemirrorThemeUtils.generalTooltip.borderRadius,
161
- padding: codemirrorThemeUtils.generalTooltip.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: codemirrorThemeUtils.generalTooltip.padding,
171
- lineHeight: codemirrorThemeUtils.generalTooltip.lineHeight,
313
+ padding: generalTooltip.padding,
314
+ lineHeight: generalTooltip.lineHeight,
172
315
  },
173
316
  '& > ul > li[aria-selected]': {
174
317
  backgroundColor: base02,
175
- color: base06,
176
- borderRadius: codemirrorThemeUtils.generalTooltip.borderRadiusSelected,
318
+ color: base05,
319
+ borderRadius: generalTooltip.borderRadiusSelected,
177
320
  },
178
321
  '& > ul > li > span.cm-completionIcon': {
179
322
  color: base03,
180
- paddingRight: codemirrorThemeUtils.generalTooltip.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 ${base0B}`,
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 ${base0B}`,
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: codemirrorThemeUtils.generalMatching.borderRadius,
360
+ borderRadius: generalMatching.borderRadius,
218
361
  },
219
362
  '.cm-nonmatchingBracket': {
220
- backgroundColor: `${base0B}40`,
363
+ backgroundColor: `${base0A}40`,
221
364
  outline: `1px solid ${invalid}`,
222
- borderRadius: codemirrorThemeUtils.generalMatching.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: codemirrorThemeUtils.generalMatching.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: codemirrorThemeUtils.generalPlaceholder.borderRadius,
236
- padding: codemirrorThemeUtils.generalPlaceholder.padding,
237
- margin: codemirrorThemeUtils.generalPlaceholder.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 ${base08}40`,
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: codemirrorThemeUtils.generalScroller.width,
247
- height: codemirrorThemeUtils.generalScroller.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: codemirrorThemeUtils.generalScroller.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: base0A, fontWeight: 'bold' },
272
- { tag: highlight.tags.controlKeyword, color: base0A, fontWeight: 'bold' },
273
- { tag: highlight.tags.moduleKeyword, color: base0A, fontWeight: 'bold' },
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: base08 },
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: base08, fontStyle: 'normal' },
420
+ { tag: [highlight.tags.propertyName], color: base07, fontStyle: 'normal' },
278
421
  // Classes and types
279
- { tag: [highlight.tags.typeName], color: base0D },
280
- { tag: [highlight.tags.className], color: base0D, fontStyle: 'italic' },
281
- { tag: [highlight.tags.namespace], color: base09, fontStyle: 'italic' },
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: base0F },
426
+ { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base0E },
284
427
  { tag: [highlight.tags.bracket], color: base04 },
285
- { tag: [highlight.tags.brace], color: base07 },
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: base07 },
289
- { tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: base07 },
290
- { tag: [highlight.tags.definition(highlight.tags.variableName)], color: base0C },
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: base0C },
293
- { tag: highlight.tags.changed, color: base0F },
294
- { tag: highlight.tags.annotation, color: base0B, fontStyle: 'italic' },
295
- { tag: highlight.tags.modifier, color: base0F, fontStyle: 'italic' },
296
- { tag: highlight.tags.self, color: base0F },
297
- { tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base0C },
298
- { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0F },
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: base07 },
301
- { tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: base0F },
302
- { tag: highlight.tags.string, color: base0E },
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: base0D, fontWeight: 'bold' },
305
- { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0E },
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: base0B },
312
- { tag: [highlight.tags.attributeName], color: base0D },
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: base09 },
315
- { tag: [highlight.tags.strong], fontWeight: 'bold', color: base08 },
316
- { tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base0D },
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 ${base0B}`,
479
+ borderBottom: `1px wavy ${base0A}`,
337
480
  },
338
- { tag: [highlight.tags.strikethrough], color: base0B, textDecoration: 'line-through' },
481
+ { tag: [highlight.tags.strikethrough], color: base0A, textDecoration: 'line-through' },
339
482
  // Enhanced syntax highlighting
340
- { tag: highlight.tags.constant(highlight.tags.name), color: base0C },
341
- { tag: highlight.tags.deleted, color: base0B },
342
- { tag: highlight.tags.squareBracket, color: base0B },
343
- { tag: highlight.tags.angleBracket, color: base0C },
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: base09 },
347
- { tag: highlight.tags.quote, color: base0F },
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.nordHighlightStyle = nordHighlightStyle;
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
- * Enhanced editor theme styles for Nord
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 const nordTheme: Extension;
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 { nord, nordHighlightStyle, nordTheme };
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
- * Enhanced editor theme styles for Nord
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 const nordTheme: Extension;
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 { nord, nordHighlightStyle, nordTheme };
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
- import { generalScroller, generalPlaceholder, generalMatching, generalTooltip, generalGutter, generalLine, generalPanel, generalSearchField, generalCursor, generalContent } from '@fsegurai/codemirror-theme-utils';
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'; // Background - deep navy blue
13
- const base01 = '#3b4252'; // Lighter background (popups, statuslines)
14
- const base02 = '#434c5e'; // Selection background
15
- const base03 = '#4c566a'; // Comments, invisibles
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
- const base04 = '#d8dee9'; // Foreground - light blue-grey
18
- // const base05 = '#e5e9f0'; // Light foreground
19
- const base06 = '#eceff4'; // Light background
117
+ base04 = '#d8dee9', // Foreground - light blue-grey
118
+ base05 = '#eceff4', // Light background
20
119
  // Frost
21
- const base07 = '#8fbcbb'; // Moss green - function names
22
- const base08 = '#88c0d0'; // Ice blue - classes, attributes
23
- const base09 = '#81a1c1'; // Water blue - methods
24
- const base0A = '#5e81ac'; // Deep blue - keywords
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
- const base0B = '#bf616a'; // Red - errors, brackets
27
- const base0C = '#d08770'; // Orange - numbers, constants
28
- const base0D = '#ebcb8b'; // Yellow - types, classes
29
- const base0E = '#a3be8c'; // Green - strings
30
- const base0F = '#b48ead'; // Purple - operators, special characters
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'; // Bright red for errors
33
- const darkBackground = '#252a33'; // Darker background for panels
34
- const highlightBackground = '#3b425277'; // Active line highlight with opacity
35
- const background = base00; // Main editor background
36
- const tooltipBackground = base01; // Tooltip background
37
- const selection = base02; // Selection background
38
- const selectionMatch = '#4c566a80'; // Selection match with opacity
39
- const cursor = base04; // Cursor color
40
- const activeBracketBg = '#4c566a55'; // Active bracket background with opacity
41
- const activeBracketBorder = base08; // Active bracket border - ice blue
42
- const diagnosticWarning = base0D; // Warning color - yellow
43
- const linkColor = base09; // Link color - water blue
44
- const visitedLinkColor = base0F; // Visited link color - purple
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 ${base07}`,
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: base09,
89
- color: base06,
192
+ backgroundColor: base08,
193
+ color: base05,
90
194
  padding: generalSearchField.padding,
91
195
  '& span': {
92
- color: base06,
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: base06,
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 ${base0B}`,
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 ${base0B}`,
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: `${base0B}40`,
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 ${base08}40`,
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: base0A, fontWeight: 'bold' },
270
- { tag: tags.controlKeyword, color: base0A, fontWeight: 'bold' },
271
- { tag: tags.moduleKeyword, color: base0A, fontWeight: 'bold' },
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: base08 },
416
+ { tag: [tags.name, tags.deleted, tags.character, tags.macroName], color: base07 },
274
417
  { tag: [tags.variableName], color: base04 },
275
- { tag: [tags.propertyName], color: base08, fontStyle: 'normal' },
418
+ { tag: [tags.propertyName], color: base07, fontStyle: 'normal' },
276
419
  // Classes and types
277
- { tag: [tags.typeName], color: base0D },
278
- { tag: [tags.className], color: base0D, fontStyle: 'italic' },
279
- { tag: [tags.namespace], color: base09, fontStyle: 'italic' },
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: base0F },
424
+ { tag: [tags.operator, tags.operatorKeyword], color: base0E },
282
425
  { tag: [tags.bracket], color: base04 },
283
- { tag: [tags.brace], color: base07 },
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: base07 },
287
- { tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color: base07 },
288
- { tag: [/*@__PURE__*/tags.definition(tags.variableName)], color: base0C },
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: base0C },
291
- { tag: tags.changed, color: base0F },
292
- { tag: tags.annotation, color: base0B, fontStyle: 'italic' },
293
- { tag: tags.modifier, color: base0F, fontStyle: 'italic' },
294
- { tag: tags.self, color: base0F },
295
- { tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: base0C },
296
- { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0F },
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: base07 },
299
- { tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color: base0F },
300
- { tag: tags.string, color: base0E },
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: base0D, fontWeight: 'bold' },
303
- { tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base0E },
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: base0B },
310
- { tag: [tags.attributeName], color: base0D },
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: base09 },
313
- { tag: [tags.strong], fontWeight: 'bold', color: base08 },
314
- { tag: [tags.emphasis], fontStyle: 'italic', color: base0D },
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 ${base0B}`,
477
+ borderBottom: `1px wavy ${base0A}`,
335
478
  },
336
- { tag: [tags.strikethrough], color: base0B, textDecoration: 'line-through' },
479
+ { tag: [tags.strikethrough], color: base0A, textDecoration: 'line-through' },
337
480
  // Enhanced syntax highlighting
338
- { tag: /*@__PURE__*/tags.constant(tags.name), color: base0C },
339
- { tag: tags.deleted, color: base0B },
340
- { tag: tags.squareBracket, color: base0B },
341
- { tag: tags.angleBracket, color: base0C },
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: base09 },
345
- { tag: tags.quote, color: base0F },
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 { nord, nordHighlightStyle, nordTheme };
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",
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"