@fsegurai/codemirror-theme-cobalt2 6.0.5 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +40 -32
  2. package/dist/index.cjs +660 -411
  3. package/dist/index.js +660 -411
  4. package/package.json +12 -3
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EditorView } from '@codemirror/view';
2
1
  import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
2
+ import { EditorView } from '@codemirror/view';
3
3
  import { tags } from '@lezer/highlight';
4
4
 
5
5
  // Helper module for styling options
@@ -8,9 +8,6 @@ const generalContent = {
8
8
  fontFamily: 'JetBrains Mono, Consolas, monospace',
9
9
  lineHeight: '1.6',
10
10
  };
11
- const generalCursor = {
12
- borderLeftWidth: '2px',
13
- };
14
11
  const generalDiff = {
15
12
  insertedTextDecoration: 'none',
16
13
  deletedTextDecoration: 'line-through',
@@ -20,7 +17,6 @@ const generalGutter = {
20
17
  border: 'none',
21
18
  paddingRight: '8px',
22
19
  fontSize: '0.9em',
23
- fontWeight: '500',
24
20
  lineHeight: '1.78', // Adjusted to compensate for 0.9em fontSize (1.6 / 0.9 ≈ 1.78)
25
21
  };
26
22
  const generalPanel = {
@@ -103,6 +99,498 @@ function applyMergeRevertStyles(styles) {
103
99
  document.head.appendChild(styleEl);
104
100
  }
105
101
 
102
+ // Shared theme core: every theme package describes a palette (`ThemeDefinition`) and this module turns it into the
103
+ // CodeMirror extension. Generated into each package by `bun run generate:helpers`; edit only the copy in
104
+ // `packages/.helper/utils/`.
105
+ /** Parent of every fine role: an omitted fine role resolves to its parent. */
106
+ const ROLE_PARENTS = {
107
+ controlKeyword: 'keyword',
108
+ moduleKeyword: 'keyword',
109
+ definitionKeyword: 'keyword',
110
+ operatorKeyword: 'operator',
111
+ modifier: 'keyword',
112
+ arithmeticOperator: 'operator',
113
+ logicOperator: 'operator',
114
+ compareOperator: 'operator',
115
+ bitwiseOperator: 'operator',
116
+ updateOperator: 'operator',
117
+ derefOperator: 'operator',
118
+ definitionOperator: 'operator',
119
+ typeOperator: 'operator',
120
+ controlOperator: 'operator',
121
+ separator: 'punctuation',
122
+ bracket: 'punctuation',
123
+ paren: 'bracket',
124
+ brace: 'bracket',
125
+ squareBracket: 'bracket',
126
+ angleBracket: 'bracket',
127
+ character: 'name',
128
+ macroName: 'name',
129
+ variable: 'name',
130
+ localVariable: 'variable',
131
+ variableDefinition: 'variable',
132
+ nameDefinition: 'variableDefinition',
133
+ functionDefinition: 'function',
134
+ self: 'variable',
135
+ label: 'name',
136
+ propertyDefinition: 'property',
137
+ method: 'property',
138
+ methodDefinition: 'method',
139
+ specialProperty: 'property',
140
+ typeDefinition: 'type',
141
+ className: 'type',
142
+ namespace: 'type',
143
+ standardTag: 'tag',
144
+ annotation: 'meta',
145
+ documentMeta: 'meta',
146
+ processingInstruction: 'meta',
147
+ attributeValue: 'string',
148
+ literal: 'string',
149
+ docString: 'string',
150
+ regexp: 'string',
151
+ specialString: 'regexp',
152
+ escape: 'string',
153
+ unit: 'number',
154
+ atom: 'constant',
155
+ bool: 'atom',
156
+ null: 'constant',
157
+ constantName: 'constant',
158
+ standardName: 'constant',
159
+ color: 'standardName',
160
+ specialVariable: 'constant',
161
+ docComment: 'comment',
162
+ headingLevel: 'heading',
163
+ heading1: 'headingLevel',
164
+ heading2: 'headingLevel',
165
+ heading3: 'headingLevel',
166
+ heading4: 'headingLevel',
167
+ heading5: 'headingLevel',
168
+ heading6: 'headingLevel',
169
+ list: 'name',
170
+ quote: 'string',
171
+ monospace: 'string',
172
+ contentSeparator: 'punctuation',
173
+ };
174
+ /**
175
+ * Canonical tag → role table shared by every theme: every Lezer base tag and the modifier combinations that the
176
+ * official grammars emit. Each tag appears once, so no rule is shadowed by a later one.
177
+ */
178
+ const SYNTAX_TAGS = [
179
+ ['keyword', [tags.keyword]],
180
+ ['controlKeyword', [tags.controlKeyword]],
181
+ ['moduleKeyword', [tags.moduleKeyword]],
182
+ ['definitionKeyword', [tags.definitionKeyword]],
183
+ ['operatorKeyword', [tags.operatorKeyword]],
184
+ ['modifier', [tags.modifier]],
185
+ ['operator', [tags.operator]],
186
+ ['arithmeticOperator', [tags.arithmeticOperator]],
187
+ ['logicOperator', [tags.logicOperator]],
188
+ ['compareOperator', [tags.compareOperator]],
189
+ ['bitwiseOperator', [tags.bitwiseOperator]],
190
+ ['updateOperator', [tags.updateOperator]],
191
+ ['derefOperator', [tags.derefOperator]],
192
+ ['definitionOperator', [tags.definitionOperator]],
193
+ ['typeOperator', [tags.typeOperator]],
194
+ ['controlOperator', [tags.controlOperator]],
195
+ ['punctuation', [tags.punctuation, /*@__PURE__*/tags.function(tags.punctuation)]],
196
+ ['separator', [tags.separator]],
197
+ ['bracket', [tags.bracket]],
198
+ ['paren', [tags.paren]],
199
+ ['brace', [tags.brace, /*@__PURE__*/tags.special(tags.brace)]],
200
+ ['squareBracket', [tags.squareBracket]],
201
+ ['angleBracket', [tags.angleBracket]],
202
+ ['name', [tags.name, /*@__PURE__*/tags.special(tags.name)]],
203
+ ['character', [tags.character]],
204
+ ['macroName', [tags.macroName]],
205
+ ['variable', [tags.variableName, /*@__PURE__*/tags.standard(tags.variableName)]],
206
+ ['localVariable', [/*@__PURE__*/tags.local(tags.variableName)]],
207
+ ['variableDefinition', [/*@__PURE__*/tags.definition(tags.variableName)]],
208
+ ['nameDefinition', [/*@__PURE__*/tags.definition(tags.name)]],
209
+ ['function', [/*@__PURE__*/tags.function(tags.variableName)]],
210
+ ['functionDefinition', [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))]],
211
+ ['self', [tags.self]],
212
+ ['label', [tags.labelName]],
213
+ ['property', [tags.propertyName]],
214
+ ['propertyDefinition', [/*@__PURE__*/tags.definition(tags.propertyName)]],
215
+ ['method', [/*@__PURE__*/tags.function(tags.propertyName)]],
216
+ ['methodDefinition', [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.propertyName))]],
217
+ ['specialProperty', [/*@__PURE__*/tags.special(tags.propertyName), /*@__PURE__*/tags.definition(/*@__PURE__*/tags.special(tags.propertyName))]],
218
+ ['type', [tags.typeName, /*@__PURE__*/tags.standard(tags.typeName)]],
219
+ ['typeDefinition', [/*@__PURE__*/tags.definition(tags.typeName)]],
220
+ ['className', [tags.className, /*@__PURE__*/tags.definition(tags.className), /*@__PURE__*/tags.constant(tags.className)]],
221
+ ['namespace', [tags.namespace]],
222
+ ['tag', [tags.tagName]],
223
+ ['standardTag', [/*@__PURE__*/tags.standard(tags.tagName)]],
224
+ ['attribute', [tags.attributeName, /*@__PURE__*/tags.special(tags.attributeName)]],
225
+ ['attributeValue', [tags.attributeValue]],
226
+ ['literal', [tags.literal]],
227
+ ['string', [tags.string]],
228
+ ['docString', [tags.docString]],
229
+ ['regexp', [tags.regexp]],
230
+ ['specialString', [/*@__PURE__*/tags.special(tags.string), /*@__PURE__*/tags.special(tags.docString)]],
231
+ ['escape', [tags.escape]],
232
+ ['number', [tags.number, tags.integer, tags.float]],
233
+ ['unit', [tags.unit]],
234
+ ['atom', [tags.atom]],
235
+ ['bool', [tags.bool]],
236
+ ['null', [tags.null]],
237
+ ['constantName', [/*@__PURE__*/tags.constant(tags.name)]],
238
+ ['standardName', [/*@__PURE__*/tags.standard(tags.name)]],
239
+ ['color', [tags.color]],
240
+ ['specialVariable', [/*@__PURE__*/tags.special(tags.variableName)]],
241
+ ['comment', [tags.comment, tags.lineComment, tags.blockComment]],
242
+ ['docComment', [tags.docComment]],
243
+ ['meta', [tags.meta]],
244
+ ['documentMeta', [tags.documentMeta]],
245
+ ['processingInstruction', [tags.processingInstruction]],
246
+ ['annotation', [tags.annotation]],
247
+ ['content', [tags.content, /*@__PURE__*/tags.special(tags.content)]],
248
+ ['heading', [tags.heading]],
249
+ ['heading1', [tags.heading1]],
250
+ ['heading2', [tags.heading2]],
251
+ ['heading3', [tags.heading3]],
252
+ ['heading4', [tags.heading4]],
253
+ ['heading5', [tags.heading5]],
254
+ ['heading6', [tags.heading6]],
255
+ ['list', [tags.list]],
256
+ ['quote', [tags.quote]],
257
+ ['monospace', [tags.monospace]],
258
+ ['contentSeparator', [tags.contentSeparator]],
259
+ ['link', [tags.link]],
260
+ ['url', [tags.url]],
261
+ ['emphasis', [tags.emphasis]],
262
+ ['strong', [tags.strong]],
263
+ ['strikethrough', [tags.strikethrough]],
264
+ ['invalid', [tags.invalid]],
265
+ ['inserted', [tags.inserted]],
266
+ ['deleted', [tags.deleted]],
267
+ ['changed', [tags.changed]],
268
+ ];
269
+ /** Inline SVG image (same encoding as `@codemirror/lint`), used to draw lint markers in the theme colors. */
270
+ function svg(content, attrs = 'viewBox="0 0 40 40"') {
271
+ return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${attrs}>${encodeURIComponent(content)}</svg>')`;
272
+ }
273
+ /** Wavy underline of a lint range. */
274
+ function lintUnderline(color) {
275
+ return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${color}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
276
+ }
277
+ /**
278
+ * Canonical UI template: the same selectors for every theme, only palette values differ. Rules of equal specificity
279
+ * keep the order of the original theme files (later rules win).
280
+ */
281
+ function uiTemplate(ui) {
282
+ return {
283
+ '&': {
284
+ color: ui.foreground,
285
+ backgroundColor: ui.background,
286
+ border: ui.border,
287
+ fontSize: generalContent.fontSize,
288
+ fontFamily: generalContent.fontFamily,
289
+ },
290
+ '.cm-content': { caretColor: ui.cursor, lineHeight: generalContent.lineHeight },
291
+ '.cm-cursor, .cm-dropCursor': {
292
+ borderLeftColor: ui.cursor,
293
+ borderLeftWidth: ui.cursorWidth,
294
+ boxShadow: ui.cursorShadow,
295
+ },
296
+ '.cm-cursor-secondary': { borderLeftColor: ui.cursor, opacity: '0.6' },
297
+ '.cm-fat-cursor': {
298
+ backgroundColor: ui.fatCursor.background,
299
+ color: ui.background,
300
+ border: ui.fatCursor.border,
301
+ boxShadow: ui.cursorShadow,
302
+ },
303
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: ui.selection, color: ui.selectionForeground, outline: ui.selectionOutline },
304
+ '&:not(.cm-focused) .cm-selectionBackground': { backgroundColor: ui.selectionInactive },
305
+ '.cm-selectionLayer': { zIndex: 100 },
306
+ '.cm-searchMatch': {
307
+ backgroundColor: ui.searchMatch.background,
308
+ outline: `${ui.outlineWidth} solid ${ui.searchMatch.outline}`,
309
+ color: ui.searchMatch.foreground,
310
+ borderRadius: generalSearchField.borderRadius,
311
+ boxShadow: ui.searchMatch.shadow,
312
+ },
313
+ '.cm-searchMatch span': { color: ui.searchMatch.foreground },
314
+ '.cm-searchMatch.cm-searchMatch-selected': {
315
+ backgroundColor: ui.searchMatch.selectedBackground,
316
+ color: ui.searchMatch.selectedForeground,
317
+ padding: generalSearchField.padding,
318
+ outline: ui.searchMatch.selectedOutline,
319
+ boxShadow: ui.searchMatch.selectedShadow,
320
+ },
321
+ '.cm-searchMatch.cm-searchMatch-selected span': { color: ui.searchMatch.selectedForeground },
322
+ '.cm-search.cm-panel.cm-textfield': {
323
+ color: ui.panel.foreground,
324
+ borderRadius: generalSearchField.borderRadius,
325
+ padding: generalSearchField.padding,
326
+ },
327
+ '.cm-textfield': {
328
+ backgroundColor: ui.panel.inputBackground,
329
+ color: ui.panel.foreground,
330
+ border: ui.panel.inputBorder,
331
+ borderRadius: generalSearchField.borderRadius,
332
+ padding: generalSearchField.padding,
333
+ },
334
+ '.cm-panels': {
335
+ backgroundColor: ui.panel.background,
336
+ color: ui.panel.foreground,
337
+ border: ui.panel.outline,
338
+ borderRadius: generalPanel.borderRadius,
339
+ boxShadow: ui.panel.shadow,
340
+ },
341
+ '.cm-panels.cm-panels-top': { borderBottom: `${ui.panel.borderWidth} solid ${ui.panel.border}` },
342
+ '.cm-panels.cm-panels-bottom': { borderTop: `${ui.panel.borderWidth} solid ${ui.panel.border}` },
343
+ '.cm-panel.cm-gotoLine': { color: ui.panel.foreground, padding: generalPanel.padding },
344
+ '.cm-panel button, .cm-button': {
345
+ backgroundColor: ui.panel.buttonBackground,
346
+ backgroundImage: 'none',
347
+ color: ui.panel.buttonForeground,
348
+ border: ui.panel.buttonBorder,
349
+ borderRadius: generalPanel.borderRadius,
350
+ padding: generalPanel.padding,
351
+ },
352
+ '.cm-panel button:hover, .cm-button:hover': {
353
+ backgroundColor: ui.panel.buttonHoverBackground,
354
+ color: ui.panel.buttonHoverForeground,
355
+ border: ui.panel.buttonHoverBorder,
356
+ boxShadow: ui.panel.buttonHoverShadow,
357
+ },
358
+ '.cm-activeLine': {
359
+ backgroundColor: ui.activeLine,
360
+ borderLeft: ui.activeLineBorder.left,
361
+ borderRight: ui.activeLineBorder.right,
362
+ borderRadius: generalLine.borderRadius,
363
+ zIndex: 1,
364
+ },
365
+ '.cm-gutters': {
366
+ backgroundColor: ui.gutter.background,
367
+ color: ui.gutter.foreground,
368
+ border: generalGutter.border,
369
+ borderRight: `${ui.outlineWidth} solid ${ui.gutter.border}`,
370
+ paddingRight: generalGutter.paddingRight,
371
+ },
372
+ '.cm-activeLineGutter': {
373
+ backgroundColor: ui.gutter.activeBackground,
374
+ color: ui.gutter.activeForeground,
375
+ fontWeight: ui.gutter.activeFontWeight,
376
+ border: ui.gutter.activeBorder,
377
+ },
378
+ '.cm-lineNumbers': { fontSize: generalGutter.fontSize, lineHeight: generalGutter.lineHeight },
379
+ '.cm-foldGutter': { fontSize: generalGutter.fontSize, lineHeight: generalGutter.lineHeight },
380
+ '.cm-foldGutter .cm-gutterElement': { color: ui.gutter.foreground, cursor: 'pointer' },
381
+ '.cm-foldGutter .cm-gutterElement:hover': { color: ui.gutter.foldHover },
382
+ '.cm-gutter-lint': { color: ui.gutter.foreground },
383
+ '.cm-lint-marker': { width: '1em', height: '1em' },
384
+ '.cm-lint-marker-error': {
385
+ content: svg(`<circle cx="20" cy="20" r="15" fill="${ui.diagnostic.error}" stroke="${ui.background}" stroke-width="4"/>`),
386
+ },
387
+ '.cm-lint-marker-warning': {
388
+ content: svg(`<path fill="${ui.diagnostic.warning}" stroke="${ui.background}" stroke-width="4" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`),
389
+ },
390
+ '.cm-lint-marker-info': {
391
+ content: svg(`<path fill="${ui.diagnostic.info}" stroke="${ui.background}" stroke-width="4" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`),
392
+ },
393
+ '.cm-changeGutter': { backgroundColor: ui.gutter.background },
394
+ '.cm-merge-b .cm-changedLineGutter, .cm-inlineChangedLineGutter': { background: ui.diff.insertedForeground },
395
+ '.cm-merge-a .cm-changedLineGutter, .cm-deletedLineGutter': { background: ui.diff.deletedForeground },
396
+ '.cm-insertedLine': {
397
+ textDecoration: generalDiff.insertedTextDecoration,
398
+ backgroundColor: ui.diff.insertedBackground,
399
+ color: ui.diff.insertedForeground,
400
+ padding: generalDiff.insertedLinePadding,
401
+ borderRadius: generalDiff.borderRadius,
402
+ },
403
+ 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
404
+ textDecoration: generalDiff.insertedTextDecoration,
405
+ backgroundColor: `${ui.diff.insertedBackground} !important`,
406
+ color: ui.diff.insertedForeground,
407
+ padding: generalDiff.insertedLinePadding,
408
+ borderRadius: generalDiff.borderRadius,
409
+ border: ui.diff.insertedBorder,
410
+ },
411
+ 'ins.cm-insertedLine .cm-changedText': { background: 'transparent !important' },
412
+ '.cm-deletedLine': {
413
+ textDecoration: generalDiff.deletedTextDecoration,
414
+ backgroundColor: ui.diff.deletedBackground,
415
+ color: ui.diff.deletedForeground,
416
+ padding: generalDiff.insertedLinePadding,
417
+ borderRadius: generalDiff.borderRadius,
418
+ },
419
+ // Merge view deletions only: `del` decorations, inline deletion widgets and the lines of deleted chunks. `:where()`
420
+ // keeps the specificity of the former bare `del` selector without styling other `del` elements.
421
+ 'del.cm-deletedLine, del.cm-deletedText, :where(.cm-deletedChunk) del, :where(.cm-deletedChunk) del:not(:has(.cm-deletedText))': {
422
+ textDecoration: generalDiff.deletedTextDecoration,
423
+ backgroundColor: `${ui.diff.deletedBackground} !important`,
424
+ color: ui.diff.deletedForeground,
425
+ padding: generalDiff.insertedLinePadding,
426
+ borderRadius: generalDiff.borderRadius,
427
+ border: ui.diff.deletedBorder,
428
+ },
429
+ ':where(.cm-deletedChunk) del .cm-deletedText, :where(.cm-deletedChunk) del .cm-changedText, del:where(.cm-deletedLine) .cm-deletedText, del:where(.cm-deletedLine) .cm-changedText': { background: 'transparent !important' },
430
+ '.cm-merge-b .cm-changedLine, .cm-inlineChangedLine': { backgroundColor: ui.diff.insertedBackground },
431
+ '.cm-merge-a .cm-changedLine, .cm-deletedChunk': { backgroundColor: ui.diff.deletedBackground },
432
+ '.cm-collapsedLines': {
433
+ background: ui.foldPlaceholder.background,
434
+ color: ui.foldPlaceholder.foreground,
435
+ },
436
+ '.cm-mergeSpacer': { background: ui.merge.backgroundColor },
437
+ '.cm-tooltip': {
438
+ backgroundColor: ui.tooltip.background,
439
+ color: ui.tooltip.foreground,
440
+ border: `${ui.outlineWidth} solid ${ui.tooltip.border}`,
441
+ borderRadius: generalTooltip.borderRadius,
442
+ padding: generalTooltip.padding,
443
+ boxShadow: ui.tooltip.shadow,
444
+ },
445
+ '.cm-tooltip-autocomplete > ul': { backgroundColor: ui.tooltip.listBackground, border: ui.tooltip.listBorder },
446
+ '.cm-tooltip-autocomplete > ul > li': { padding: generalTooltip.padding, lineHeight: generalTooltip.lineHeight },
447
+ '.cm-tooltip-autocomplete > ul > li:hover': { backgroundColor: ui.tooltip.hoverBackground },
448
+ '.cm-tooltip-autocomplete > ul > li[aria-selected]': {
449
+ backgroundColor: ui.tooltip.selectedBackground,
450
+ color: ui.tooltip.selectedForeground,
451
+ border: ui.tooltip.selectedBorder,
452
+ borderRadius: generalTooltip.borderRadiusSelected,
453
+ },
454
+ '.cm-tooltip-autocomplete > ul > li > span.cm-completionIcon': {
455
+ color: ui.tooltip.icon,
456
+ paddingRight: generalTooltip.paddingRight,
457
+ },
458
+ '.cm-tooltip-autocomplete > ul > li > span.cm-completionDetail': { color: ui.tooltip.detail, fontStyle: 'italic' },
459
+ '.cm-completionMatchedText': {
460
+ color: 'inherit',
461
+ fontWeight: 'bold',
462
+ textDecoration: 'underline',
463
+ textDecorationColor: ui.matchingBracket.outline,
464
+ },
465
+ '.cm-completionInfo': {
466
+ backgroundColor: ui.tooltip.background,
467
+ color: ui.tooltip.foreground,
468
+ border: `${ui.outlineWidth} solid ${ui.tooltip.border}`,
469
+ padding: generalTooltip.padding,
470
+ },
471
+ '.cm-tooltip .cm-tooltip-arrow:before': { borderTopColor: 'transparent', borderBottomColor: 'transparent' },
472
+ '.cm-tooltip .cm-tooltip-arrow:after': {
473
+ borderTopColor: ui.tooltip.background,
474
+ borderBottomColor: ui.tooltip.background,
475
+ },
476
+ '.cm-tooltip-lint': { color: ui.tooltip.foreground, padding: '0' },
477
+ '.cm-tooltip-section:not(:first-child)': { borderTop: `1px solid ${ui.tooltip.border}` },
478
+ '.cm-diagnostic-error': {
479
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.error}`,
480
+ backgroundColor: ui.diagnostic.errorBackground,
481
+ },
482
+ '.cm-diagnostic-warning': {
483
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.warning}`,
484
+ backgroundColor: ui.diagnostic.warningBackground,
485
+ },
486
+ '.cm-diagnostic-info': {
487
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.info}`,
488
+ backgroundColor: ui.diagnostic.infoBackground,
489
+ },
490
+ '.cm-diagnostic-hint': { borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.hint}` },
491
+ '.cm-diagnosticAction': {
492
+ backgroundColor: ui.panel.buttonBackground,
493
+ color: ui.panel.buttonForeground,
494
+ border: ui.panel.buttonBorder,
495
+ borderRadius: generalPanel.borderRadius,
496
+ },
497
+ '.cm-lintRange-error': { backgroundImage: lintUnderline(ui.diagnostic.error) },
498
+ '.cm-lintRange-warning': { backgroundImage: lintUnderline(ui.diagnostic.warning) },
499
+ '.cm-lintRange-info': { backgroundImage: lintUnderline(ui.diagnostic.info) },
500
+ '.cm-lintRange-hint': { backgroundImage: lintUnderline(ui.diagnostic.hint) },
501
+ '.cm-lintPoint-error': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.error}` },
502
+ '.cm-lintPoint-warning': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.warning}` },
503
+ '.cm-lintPoint-info': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.info}` },
504
+ '.cm-matchingBracket': {
505
+ backgroundColor: ui.matchingBracket.background,
506
+ outline: `${ui.outlineWidth} solid ${ui.matchingBracket.outline}`,
507
+ borderRadius: generalMatching.borderRadius,
508
+ boxShadow: ui.matchingBracket.shadow,
509
+ },
510
+ '.cm-nonmatchingBracket': {
511
+ backgroundColor: ui.nonMatchingBracket.background,
512
+ outline: `${ui.outlineWidth} solid ${ui.nonMatchingBracket.outline}`,
513
+ borderRadius: generalMatching.borderRadius,
514
+ },
515
+ '.cm-selectionMatch': {
516
+ backgroundColor: ui.selectionMatch.background,
517
+ outline: `${ui.outlineWidth} solid ${ui.selectionMatch.outline}`,
518
+ borderRadius: generalMatching.borderRadius,
519
+ },
520
+ '.cm-snippetField': {
521
+ backgroundColor: ui.selectionMatch.background,
522
+ outline: `1px dashed ${ui.selectionMatch.outline}`,
523
+ borderRadius: generalMatching.borderRadius,
524
+ },
525
+ '.cm-snippetFieldPosition': { borderLeft: `1px dotted ${ui.cursor}` },
526
+ '.cm-foldPlaceholder': {
527
+ backgroundColor: ui.foldPlaceholder.background,
528
+ color: ui.foldPlaceholder.foreground,
529
+ border: `${ui.outlineWidth} ${ui.foldPlaceholder.borderStyle} ${ui.foldPlaceholder.border}`,
530
+ borderRadius: generalPlaceholder.borderRadius,
531
+ padding: generalPlaceholder.padding,
532
+ margin: generalPlaceholder.margin,
533
+ },
534
+ // Transparent outline: invisible normally, repainted with the system color in forced-colors mode (drops box-shadow).
535
+ '&.cm-focused': { outline: '2px solid transparent', boxShadow: ui.focusRing },
536
+ '& .cm-scroller::-webkit-scrollbar': { width: generalScroller.width, height: generalScroller.height },
537
+ '& .cm-scroller::-webkit-scrollbar-track': { background: ui.scrollbar.track, border: ui.scrollbar.trackBorder },
538
+ '& .cm-scroller::-webkit-scrollbar-thumb': {
539
+ backgroundColor: ui.scrollbar.thumb,
540
+ borderRadius: generalScroller.borderRadius,
541
+ border: ui.scrollbar.thumbBorder,
542
+ },
543
+ '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
544
+ backgroundColor: ui.scrollbar.thumbHover,
545
+ boxShadow: ui.scrollbar.thumbHoverShadow,
546
+ },
547
+ '.cm-ghostText': { opacity: ui.ghostTextOpacity, color: ui.ghostText },
548
+ '.cm-placeholder': { color: ui.ghostText },
549
+ '.cm-specialChar': { color: ui.specialChar },
550
+ '.cm-trailingSpace': { backgroundColor: ui.diff.deletedBackground },
551
+ '.cm-highlightSpace': {
552
+ backgroundImage: `radial-gradient(circle at 50% 55%, ${ui.gutter.foreground} 20%, transparent 0)`,
553
+ },
554
+ '.cm-crosshair': { cursor: 'crosshair' },
555
+ };
556
+ }
557
+ /** Drops `null` declarations and selectors left without declarations. */
558
+ function emittedRules(spec) {
559
+ const result = {};
560
+ for (const [selector, declarations] of Object.entries(spec)) {
561
+ const emitted = Object.entries(declarations).filter((entry) => entry[1] !== null);
562
+ if (emitted.length > 0)
563
+ result[selector] = Object.fromEntries(emitted);
564
+ }
565
+ return result;
566
+ }
567
+ /** Style of a role, falling back through `ROLE_PARENTS` for omitted fine roles. */
568
+ function resolveRole(syntax, role) {
569
+ let current = role;
570
+ while (current) {
571
+ const style = syntax[current];
572
+ if (style)
573
+ return style;
574
+ current = ROLE_PARENTS[current];
575
+ }
576
+ return {};
577
+ }
578
+ /** Highlight rules of a theme: one rule per entry of the canonical table. */
579
+ function highlightRules(definition) {
580
+ return SYNTAX_TAGS.map(([role, tagList]) => (Object.assign({ tag: [...tagList] }, resolveRole(definition.syntax, role))));
581
+ }
582
+ /** Builds the editor theme, the syntax highlighting and the merge view styles of a theme definition. */
583
+ function defineTheme(definition) {
584
+ const theme = EditorView.theme(emittedRules(uiTemplate(definition.ui)), { dark: definition.dark });
585
+ const highlightStyle = HighlightStyle.define(highlightRules(definition));
586
+ return {
587
+ extension: [theme, syntaxHighlighting(highlightStyle)],
588
+ theme,
589
+ highlightStyle,
590
+ mergeStyles: Object.assign({}, definition.ui.merge),
591
+ };
592
+ }
593
+
106
594
  /**
107
595
  * Cobalt2 theme color palette
108
596
  * ---------------------------------------------------------------------
@@ -112,10 +600,10 @@ function applyMergeRevertStyles(styles) {
112
600
  const background = '#193549', // Main editor background
113
601
  foreground = '#fff', // Main text color (exact from original)
114
602
  cursor = '#ffc600', // Cursor color (bright yellow)
115
- selection = '#0050A4', // Selection background
603
+ selection = '#09478e', // Selection background
116
604
  selectionInactive = '#003b8b', // Inactive selection
117
605
  selectionHighlight = '#0050A480', // Selection highlights (with transparency)
118
- lineHighlight = '#99eeff33', // The current line highlights
606
+ lineHighlight = '#99eeff0d', // The current line highlights
119
607
  // UI backgrounds (exact from original)
120
608
  darkBackground = '#122738', // Sidebar, panels, gutter
121
609
  panelBackground = '#15232d', // Panel background
@@ -123,24 +611,20 @@ gutterBackground = '#12273866', // Gutter background with transparency
123
611
  // Searches and finds colors (exact from original)
124
612
  findMatchCurrent = '#FF720066', // Currently found item
125
613
  findMatchOther = '#CAD40F66', // Other found items
126
- hoverHighlight = '#ffc60033', // Hover highlight
127
- // Word highlights (exact from original)
128
- wordHighlight = '#ffffff21', // Word highlight background
129
614
  // Accent colors from tokenColors (exact from original)
130
- blue = '#0088ff', // Comments, links
615
+ blue = '#83bafe', // Comments, links
131
616
  cyan = '#80fcff', // Special keywords, module exports
132
617
  lightBlue = '#9effff', // Meta, variables, properties
133
- yellow = '#ffc600', // Entities, storage, functions
134
- orange = '#ff9d00', // Keywords, support functions
135
- pink = '#ff628c', // Constants, deleted text
618
+ orange = '#fea22f', // Keywords, support functions
619
+ pink = '#fb9caf', // Constants, deleted text
136
620
  hotPink = '#fb94ff', // Language variables, storage.type.function
137
- lightPink = '#FF68B8', // Types, interfaces (semantic)
621
+ lightPink = '#fb99c8', // Types, interfaces (semantic)
138
622
  green = '#3ad900', // Template strings
139
623
  lightGreen = '#a5ff90', // Regular strings, markup inserted
140
- red = '#f44542', // Invalid, errors
624
+ red = '#ff9d93', // Invalid, errors
141
625
  errorRed = '#A22929', // Error foreground
142
626
  // Additional colors from the original palette
143
- gray = '#aaa', // Comments, secondary text
627
+ gray = '#b7b7b7', // Comments, secondary text
144
628
  lightGray = '#e1efff', // Punctuation, variables
145
629
  darkGray = '#0d3a58', // Borders, inactive elements
146
630
  parameterYellow = '#ffee80', // Parameters, template expressions
@@ -148,414 +632,179 @@ stringQuotes = '#92fc79', // String quotes (special)
148
632
  supportTeal = '#80ffbb'; // Support classes, TypeScript types
149
633
  // Diff/merge specific colors (exact from original)
150
634
  const addedBackground = '#3ad90033', // Light green with transparency for insertions
151
- removedBackground = '#ee3a4333', // Light red with transparency for deletions
152
- addedText = lightGreen, // Green for added text
153
- removedText = pink; // Pink for removed text
154
- /**
155
- * Enhanced editor theme styles for Cobalt2
156
- */
157
- const cobalt2Theme = /*@__PURE__*/EditorView.theme({
158
- // Base editor styles
159
- '&': {
160
- color: foreground,
161
- backgroundColor: background,
162
- fontSize: generalContent.fontSize,
163
- fontFamily: generalContent.fontFamily,
164
- },
165
- // Content and cursor
166
- '.cm-content': {
167
- caretColor: cursor,
168
- lineHeight: generalContent.lineHeight,
169
- },
170
- '.cm-cursor, .cm-dropCursor': {
171
- borderLeftColor: cursor,
172
- borderLeftWidth: generalCursor.borderLeftWidth,
173
- },
174
- '.cm-fat-cursor': {
175
- backgroundColor: `${cursor}99`,
176
- color: background,
177
- },
178
- // Selection
179
- '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
180
- backgroundColor: selection,
181
- color: foreground,
182
- },
183
- // Make sure selection appears above active line
184
- '.cm-selectionLayer': {
185
- zIndex: 100,
186
- },
187
- '.cm-activeLine .cm-selectionBackground': {
188
- backgroundColor: `${selection}DD`,
189
- border: `1px solid ${cyan}40`,
190
- borderRadius: '2px',
191
- },
192
- '&.cm-focused .cm-activeLine .cm-selectionBackground': {
193
- backgroundColor: `${selection}FF`,
194
- border: `1px solid ${cyan}60`,
195
- boxShadow: `0 0 3px ${cyan}30`,
196
- },
197
- '&:not(.cm-focused) .cm-selectionBackground': {
198
- backgroundColor: selectionInactive,
199
- },
200
- '&:not(.cm-focused) .cm-activeLine .cm-selectionBackground': {
201
- backgroundColor: `${selectionInactive}CC`,
202
- border: `1px solid ${darkGray}80`,
203
- },
204
- // Search functionality
205
- '.cm-searchMatch': {
206
- backgroundColor: findMatchCurrent,
207
- outline: `1px solid ${orange}`,
208
- color: foreground,
209
- borderRadius: generalSearchField.borderRadius,
210
- },
211
- '.cm-searchMatch.cm-searchMatch-selected': {
212
- backgroundColor: findMatchOther,
213
- color: foreground,
214
- },
215
- '.cm-search.cm-panel.cm-textfield': {
216
- color: yellow,
217
- backgroundColor: background,
218
- border: `1px solid ${darkGray}`,
219
- borderRadius: generalSearchField.borderRadius,
220
- padding: generalSearchField.padding,
221
- },
222
- // Panels
223
- '.cm-panels': {
224
- backgroundColor: darkBackground,
225
- color: gray,
226
- borderRadius: '4px',
227
- },
228
- '.cm-panels.cm-panels-top': {
229
- borderBottom: `1px solid ${yellow}`,
230
- },
231
- '.cm-panels.cm-panels-bottom': {
232
- borderTop: `1px solid ${yellow}`,
233
- },
234
- '.cm-panel button': {
235
- backgroundColor: blue,
236
- color: foreground,
237
- border: `1px solid ${darkGray}`,
238
- borderRadius: generalPanel.borderRadius,
239
- padding: generalPanel.padding,
240
- },
241
- '.cm-panel button:hover': {
242
- backgroundColor: orange,
243
- color: foreground,
244
- },
245
- // Line highlighting
246
- '.cm-activeLine': {
247
- backgroundColor: lineHighlight,
248
- borderRadius: generalLine.borderRadius,
249
- },
250
- // Gutters
251
- '.cm-gutters': {
252
- backgroundColor: gutterBackground,
253
- color: gray,
254
- border: generalGutter.border,
255
- borderRight: `1px solid ${darkGray}`,
256
- paddingRight: generalGutter.paddingRight,
257
- },
258
- '.cm-activeLineGutter': {
259
- backgroundColor: 'transparent',
260
- color: foreground,
261
- fontWeight: generalGutter.fontWeight,
262
- },
263
- '.cm-lineNumbers': {
264
- fontSize: generalGutter.fontSize,
265
- lineHeight: generalGutter.lineHeight,
266
- color: gray,
267
- },
268
- '.cm-foldGutter': {
269
- fontSize: generalGutter.fontSize,
270
- lineHeight: generalGutter.lineHeight,
271
- },
272
- '.cm-foldGutter .cm-gutterElement': {
273
- color: gray,
274
- cursor: 'pointer',
275
- },
276
- '.cm-foldGutter .cm-gutterElement:hover': {
277
- color: yellow,
278
- },
279
- // Diff/Merge View Styles
280
- // Inserted/Added Content
281
- '.cm-insertedLine': {
282
- textDecoration: generalDiff.insertedTextDecoration,
283
- backgroundColor: addedBackground,
284
- color: addedText,
285
- padding: generalDiff.insertedLinePadding,
286
- borderRadius: generalDiff.borderRadius,
287
- },
288
- 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
289
- textDecoration: generalDiff.insertedTextDecoration,
290
- backgroundColor: `${addedBackground} !important`,
291
- color: addedText,
292
- padding: generalDiff.insertedLinePadding,
293
- borderRadius: generalDiff.borderRadius,
294
- border: `1px solid ${addedText}30`,
295
- },
296
- 'ins.cm-insertedLine .cm-changedText': {
297
- background: 'transparent !important',
298
- },
299
- // Deleted/Removed Content
300
- '.cm-deletedLine': {
301
- textDecoration: generalDiff.deletedTextDecoration,
302
- backgroundColor: removedBackground,
303
- color: removedText,
304
- padding: generalDiff.insertedLinePadding,
305
- borderRadius: generalDiff.borderRadius,
306
- },
307
- 'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
308
- textDecoration: generalDiff.deletedTextDecoration,
309
- backgroundColor: `${removedBackground} !important`,
310
- color: removedText,
311
- padding: generalDiff.insertedLinePadding,
312
- borderRadius: generalDiff.borderRadius,
313
- border: `1px solid ${removedText}30`,
314
- },
315
- 'del .cm-deletedText, del .cm-changedText': {
316
- background: 'transparent !important',
317
- },
318
- // Tooltips and autocomplete
319
- '.cm-tooltip': {
320
- backgroundColor: panelBackground,
321
- border: `1px solid ${darkGray}`,
322
- borderRadius: generalTooltip.borderRadius,
323
- padding: generalTooltip.padding,
324
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.3)',
325
- color: gray, // Tooltip text color from the original
326
- },
327
- '.cm-tooltip-autocomplete': {
328
- '& > ul': {
329
- backgroundColor: panelBackground,
330
- border: 'none',
635
+ removedBackground = '#ee3a4333'; // Light red with transparency for deletions
636
+ const theme = /*@__PURE__*/defineTheme({
637
+ dark: true,
638
+ ui: {
639
+ background: background,
640
+ foreground: foreground,
641
+ border: 'none',
642
+ cursor: cursor,
643
+ cursorWidth: '2px',
644
+ cursorShadow: 'none',
645
+ fatCursor: { background: `${cursor}99`, border: 'none' },
646
+ selection: selection,
647
+ selectionInactive: selectionInactive,
648
+ selectionForeground: foreground,
649
+ selectionOutline: 'none',
650
+ activeLine: lineHighlight,
651
+ activeLineBorder: { left: 'none', right: 'none' },
652
+ ghostText: gray,
653
+ ghostTextOpacity: '0.5',
654
+ specialChar: '#ffffff52',
655
+ searchMatch: {
656
+ background: findMatchCurrent,
657
+ outline: orange,
658
+ foreground: foreground,
659
+ shadow: 'none',
660
+ selectedBackground: findMatchOther,
661
+ selectedForeground: foreground,
662
+ selectedOutline: `1px solid ${orange}`,
663
+ selectedShadow: 'none',
331
664
  },
332
- '& > ul > li': {
333
- padding: generalTooltip.padding,
334
- lineHeight: generalTooltip.lineHeight,
335
- color: gray,
665
+ selectionMatch: { background: selectionHighlight, outline: `${cyan}40` },
666
+ matchingBracket: { background: darkGray, outline: `${cursor}88`, shadow: 'none' },
667
+ nonMatchingBracket: { background: `${errorRed}20`, outline: errorRed },
668
+ panel: {
669
+ background: darkBackground,
670
+ foreground: gray,
671
+ border: cursor,
672
+ borderWidth: '1px',
673
+ outline: 'none',
674
+ shadow: 'none',
675
+ buttonBackground: blue,
676
+ buttonForeground: foreground,
677
+ buttonBorder: `1px solid ${darkGray}`,
678
+ buttonHoverBackground: orange,
679
+ buttonHoverForeground: foreground,
680
+ buttonHoverBorder: `1px solid ${darkGray}`,
681
+ buttonHoverShadow: 'none',
682
+ inputBackground: background,
683
+ inputBorder: `1px solid ${darkGray}`,
336
684
  },
337
- '& > ul > li[aria-selected]': {
338
- backgroundColor: background,
339
- color: yellow,
340
- borderRadius: generalTooltip.borderRadiusSelected,
685
+ gutter: {
686
+ background: gutterBackground,
687
+ foreground: gray,
688
+ border: darkGray,
689
+ activeBackground: 'transparent',
690
+ activeForeground: foreground,
691
+ activeFontWeight: '500',
692
+ activeBorder: 'none',
693
+ foldHover: cursor,
341
694
  },
342
- '& > ul > li > span.cm-completionIcon': {
343
- color: blue,
344
- paddingRight: generalTooltip.paddingRight,
695
+ foldPlaceholder: { background: 'transparent', foreground: gray, border: `${blue}50`, borderStyle: 'dotted' },
696
+ tooltip: {
697
+ background: panelBackground,
698
+ foreground: gray,
699
+ border: darkGray,
700
+ shadow: '0 4px 12px rgba(0, 0, 0, 0.3)',
701
+ listBackground: panelBackground,
702
+ listBorder: 'none',
703
+ hoverBackground: 'transparent',
704
+ selectedBackground: background,
705
+ selectedForeground: cursor,
706
+ selectedBorder: 'none',
707
+ icon: blue,
708
+ detail: gray,
345
709
  },
346
- '& > ul > li > span.cm-completionDetail': {
347
- color: gray,
348
- fontStyle: 'italic',
710
+ diff: {
711
+ insertedBackground: addedBackground,
712
+ insertedForeground: lightGreen,
713
+ insertedBorder: `1px solid ${lightGreen}30`,
714
+ deletedBackground: removedBackground,
715
+ deletedForeground: pink,
716
+ deletedBorder: `1px solid ${pink}30`,
349
717
  },
350
- },
351
- // Diagnostics styling
352
- '.cm-diagnostic': {
353
- '&-error': {
354
- borderLeft: `3px solid ${errorRed}`,
718
+ diagnostic: {
719
+ error: errorRed,
720
+ warning: cursor,
721
+ info: blue,
722
+ hint: blue,
723
+ errorBackground: 'transparent',
724
+ warningBackground: 'transparent',
725
+ infoBackground: 'transparent',
726
+ borderWidth: '3px',
727
+ underlineWidth: '2px',
355
728
  },
356
- '&-warning': {
357
- borderLeft: `3px solid ${yellow}`,
729
+ scrollbar: {
730
+ track: darkBackground,
731
+ trackBorder: 'none',
732
+ thumb: '#406179cc',
733
+ thumbBorder: `3px solid ${darkBackground}`,
734
+ thumbHover: '#437da3cc',
735
+ thumbHoverShadow: 'none',
358
736
  },
359
- '&-info': {
360
- borderLeft: `3px solid ${blue}`,
737
+ focusRing: `0 0 0 2px ${background}, 0 0 0 4px ${cyan}`,
738
+ outlineWidth: '1px',
739
+ merge: {
740
+ backgroundColor: panelBackground,
741
+ borderColor: darkGray,
742
+ buttonColor: gray,
743
+ buttonHoverColor: darkGray,
361
744
  },
362
745
  },
363
- '.cm-lintPoint-error': {
364
- borderBottom: `2px wavy ${errorRed}`,
365
- },
366
- '.cm-lintPoint-warning': {
367
- borderBottom: `2px wavy ${yellow}`,
368
- },
369
- // Matching brackets
370
- '.cm-matchingBracket': {
371
- backgroundColor: darkGray,
372
- outline: `1px solid ${cursor}80`,
373
- borderRadius: generalMatching.borderRadius,
374
- },
375
- '.cm-nonmatchingBracket': {
376
- backgroundColor: `${errorRed}20`,
377
- outline: `1px solid ${errorRed}`,
378
- borderRadius: generalMatching.borderRadius,
379
- },
380
- // Selection matches
381
- '.cm-selectionMatch': {
382
- backgroundColor: selectionHighlight,
383
- borderRadius: generalMatching.borderRadius,
384
- },
385
- '.cm-hoverHighlight': {
386
- backgroundColor: hoverHighlight,
387
- },
388
- '.cm-wordHighlight': {
389
- backgroundColor: wordHighlight,
390
- borderRadius: generalMatching.borderRadius,
391
- },
392
- // Fold placeholder
393
- '.cm-foldPlaceholder': {
394
- backgroundColor: 'transparent',
395
- color: gray,
396
- border: `1px dotted ${blue}50`,
397
- borderRadius: generalPlaceholder.borderRadius,
398
- padding: generalPlaceholder.padding,
399
- margin: generalPlaceholder.margin,
400
- },
401
- // Focus outline
402
- '&.cm-focused': {
403
- outline: 'none',
404
- },
405
- // Scrollbars - exact from original
406
- '& .cm-scroller::-webkit-scrollbar': {
407
- width: generalScroller.width,
408
- height: generalScroller.height,
409
- },
410
- '& .cm-scroller::-webkit-scrollbar-track': {
411
- background: darkBackground,
412
- },
413
- '& .cm-scroller::-webkit-scrollbar-thumb': {
414
- backgroundColor: '#406179cc',
415
- borderRadius: generalScroller.borderRadius,
416
- border: `3px solid ${darkBackground}`,
417
- },
418
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
419
- backgroundColor: '#437da3cc',
420
- },
421
- // Ghost text
422
- '.cm-ghostText': {
423
- opacity: '0.5',
424
- color: gray,
425
- },
426
- // Whitespace characters
427
- '.cm-specialChar': {
428
- color: '#ffffff52',
429
- },
430
- // Indent guides
431
- '.cm-indentGuide': {
432
- borderLeft: '1px solid #3B5364',
433
- },
434
- }, { dark: true });
435
- /**
436
- * Enhanced syntax highlighting for the Cobalt2 theme
437
- */
438
- const cobalt2HighlightStyle = /*@__PURE__*/HighlightStyle.define([
439
- // Comments
440
- { tag: tags.comment, color: blue, fontStyle: 'italic' },
441
- { tag: tags.docComment, color: blue, fontStyle: 'italic' },
442
- { tag: tags.lineComment, color: blue, fontStyle: 'italic' },
443
- { tag: tags.blockComment, color: blue, fontStyle: 'italic' },
444
- // Keywords and control flow
445
- { tag: tags.keyword, color: orange },
446
- { tag: tags.controlKeyword, color: orange },
447
- { tag: tags.operatorKeyword, color: orange },
448
- { tag: tags.moduleKeyword, color: cyan },
449
- { tag: tags.definitionKeyword, color: hotPink },
450
- // Special language constructs
451
- { tag: tags.self, color: hotPink },
452
- { tag: /*@__PURE__*/tags.special(tags.variableName), color: cyan },
453
- { tag: /*@__PURE__*/tags.special(tags.keyword), color: cyan },
454
- { tag: /*@__PURE__*/tags.special(tags.propertyName), color: cyan },
455
- // Variables - Enhanced for better distinction
456
- { tag: tags.variableName, color: foreground },
457
- { tag: /*@__PURE__*/tags.definition(tags.variableName), color: foreground },
458
- { tag: /*@__PURE__*/tags.local(tags.variableName), color: foreground },
459
- // Classes and types
460
- { tag: tags.typeName, color: lightPink, fontStyle: 'italic' },
461
- { tag: tags.className, color: lightPink, fontStyle: 'italic' },
462
- { tag: tags.namespace, color: lightPink, fontStyle: 'italic' },
463
- { tag: tags.macroName, color: lightPink, fontStyle: 'italic' },
464
- // Functions - specific function types first
465
- { tag: /*@__PURE__*/tags.function(tags.variableName), color: yellow },
466
- { tag: /*@__PURE__*/tags.function(/*@__PURE__*/tags.definition(tags.variableName)), color: yellow },
467
- { tag: /*@__PURE__*/tags.function(tags.propertyName), color: yellow },
468
- // Properties
469
- { tag: tags.propertyName, color: lightBlue },
470
- { tag: /*@__PURE__*/tags.definition(tags.propertyName), color: lightBlue },
471
- { tag: /*@__PURE__*/tags.standard(tags.propertyName), color: supportTeal },
472
- // Constants
473
- { tag: /*@__PURE__*/tags.constant(tags.name), color: pink },
474
- { tag: /*@__PURE__*/tags.standard(tags.name), color: pink },
475
- { tag: tags.number, color: pink },
476
- { tag: tags.integer, color: pink },
477
- { tag: tags.float, color: pink },
478
- { tag: tags.bool, color: pink },
479
- { tag: tags.atom, color: pink },
480
- { tag: tags.null, color: pink },
481
- // Strings - specific string types first
482
- { tag: /*@__PURE__*/tags.special(tags.string), color: green },
483
- { tag: tags.string, color: lightGreen },
484
- { tag: tags.regexp, color: lightGreen },
485
- // String quotes
486
- { tag: tags.quote, color: stringQuotes },
487
- // Parameters
488
- { tag: /*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName)), color: parameterYellow },
489
- // HTML/XML elements
490
- { tag: tags.tagName, color: lightBlue },
491
- { tag: /*@__PURE__*/tags.standard(tags.tagName), color: supportTeal },
492
- { tag: tags.attributeName, color: yellow, fontStyle: 'italic' },
493
- { tag: tags.attributeValue, color: lightGreen },
494
- // Operators and punctuation
495
- { tag: tags.operator, color: lightGray },
496
- { tag: tags.derefOperator, color: lightGray },
497
- { tag: tags.arithmeticOperator, color: lightGray },
498
- { tag: tags.logicOperator, color: lightGray },
499
- { tag: tags.bitwiseOperator, color: lightGray },
500
- { tag: tags.compareOperator, color: lightGray },
501
- { tag: tags.updateOperator, color: lightGray },
502
- { tag: tags.punctuation, color: lightGray },
503
- { tag: tags.bracket, color: lightGray },
504
- { tag: tags.brace, color: lightGray },
505
- { tag: tags.squareBracket, color: lightGray },
506
- { tag: tags.paren, color: yellow },
507
- { tag: tags.angleBracket, color: lightGray },
508
- // Storage and function keywords
509
- { tag: tags.modifier, color: yellow, fontStyle: 'italic' },
510
- // Meta and annotations
511
- { tag: tags.meta, color: lightBlue },
512
- { tag: tags.annotation, color: yellow, fontStyle: 'italic' },
513
- { tag: tags.processingInstruction, color: yellow },
514
- // Markdown elements
515
- { tag: tags.heading, color: yellow, fontWeight: 'bold' },
516
- { tag: tags.heading1, color: yellow, fontWeight: 'bold' },
517
- { tag: tags.heading2, color: yellow, fontWeight: 'bold' },
518
- { tag: tags.heading3, color: yellow, fontWeight: 'bold' },
519
- { tag: tags.heading4, color: yellow, fontWeight: 'bold' },
520
- { tag: tags.heading5, color: yellow, fontWeight: 'bold' },
521
- { tag: tags.heading6, color: yellow, fontWeight: 'bold' },
522
- { tag: tags.contentSeparator, color: yellow },
523
- { tag: tags.strong, color: lightBlue, fontWeight: 'bold' },
524
- { tag: tags.emphasis, color: lightBlue, fontStyle: 'italic' },
525
- { tag: tags.list, color: yellow },
526
- // Code blocks and inline code - Enhanced styling
527
- { tag: tags.monospace, color: lightBlue },
528
- { tag: /*@__PURE__*/tags.special(tags.monospace), color: green },
529
- { tag: tags.strikethrough, color: gray, textDecoration: 'line-through' },
530
- // Links and URLs
531
- { tag: tags.link, color: blue },
532
- { tag: tags.url, color: lightBlue },
533
- // Special states
534
- { tag: tags.invalid, color: red },
535
- { tag: tags.deleted, color: pink },
536
- { tag: tags.inserted, color: lightGreen },
537
- { tag: tags.changed, color: yellow },
538
- // Language-specific: CSS
539
- { tag: tags.unit, color: parameterYellow }, // CSS units
540
- // Entity names
541
- { tag: tags.labelName, color: yellow },
542
- { tag: tags.escape, color: yellow },
543
- ]);
746
+ syntax: {
747
+ keyword: { color: orange },
748
+ moduleKeyword: { color: cyan },
749
+ definitionKeyword: { color: hotPink },
750
+ operatorKeyword: { color: orange },
751
+ modifier: { color: cursor, fontStyle: 'italic' },
752
+ character: { color: lightGreen },
753
+ macroName: { color: lightPink, fontStyle: 'italic' },
754
+ paren: { color: cursor },
755
+ operator: { color: lightGray },
756
+ punctuation: { color: lightGray },
757
+ name: {},
758
+ variable: { color: foreground },
759
+ nameDefinition: {},
760
+ functionDefinition: { color: parameterYellow },
761
+ function: { color: cursor },
762
+ self: { color: hotPink },
763
+ label: { color: cursor },
764
+ specialProperty: { color: cyan },
765
+ method: { color: cursor },
766
+ standardTag: { color: supportTeal },
767
+ methodDefinition: { color: lightBlue },
768
+ property: { color: lightBlue },
769
+ type: { color: lightPink, fontStyle: 'italic' },
770
+ tag: { color: lightBlue },
771
+ attribute: { color: cursor, fontStyle: 'italic' },
772
+ content: { color: foreground },
773
+ string: { color: lightGreen },
774
+ escape: { color: cursor },
775
+ number: { color: pink },
776
+ unit: { color: parameterYellow },
777
+ color: {},
778
+ specialVariable: { color: cyan },
779
+ constant: { color: pink },
780
+ comment: { color: blue, fontStyle: 'italic' },
781
+ meta: { color: lightBlue },
782
+ processingInstruction: { color: cursor },
783
+ specialString: { color: green },
784
+ annotation: { color: cursor, fontStyle: 'italic' },
785
+ heading: { color: cursor, fontWeight: 'bold' },
786
+ list: { color: cursor },
787
+ quote: { color: stringQuotes },
788
+ monospace: { color: lightBlue },
789
+ contentSeparator: { color: cursor },
790
+ link: { color: blue },
791
+ url: { color: lightBlue },
792
+ emphasis: { color: lightBlue, fontStyle: 'italic' },
793
+ strong: { color: lightBlue, fontWeight: 'bold' },
794
+ strikethrough: { color: gray, textDecoration: 'line-through' },
795
+ invalid: { color: red },
796
+ inserted: { color: lightGreen },
797
+ deleted: { color: pink },
798
+ changed: { color: cursor },
799
+ },
800
+ });
544
801
  /**
545
802
  * Combined Cobalt2 theme extension
546
803
  */
547
- const cobalt2 = [
548
- cobalt2Theme,
549
- /*@__PURE__*/syntaxHighlighting(cobalt2HighlightStyle),
550
- ];
804
+ const cobalt2 = theme.extension;
551
805
  /**
552
806
  * Cobalt2 merge revert styles configuration
553
807
  */
554
- const cobalt2MergeStyles = {
555
- backgroundColor: panelBackground,
556
- borderColor: darkGray,
557
- buttonColor: gray,
558
- buttonHoverColor: darkGray,
559
- };
808
+ const cobalt2MergeStyles = theme.mergeStyles;
560
809
 
561
810
  export { applyMergeRevertStyles, cobalt2, cobalt2MergeStyles };