@fsegurai/codemirror-theme-catppuccin-mocha 6.0.2 → 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 +656 -355
  3. package/dist/index.js +656 -355
  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,11 +17,9 @@ 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 = {
27
- border: 'none',
28
23
  borderRadius: '4px',
29
24
  padding: '2px 10px',
30
25
  };
@@ -104,6 +99,498 @@ function applyMergeRevertStyles(styles) {
104
99
  document.head.appendChild(styleEl);
105
100
  }
106
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
+
107
594
  /**
108
595
  * Catppuccin Mocha theme color definitions
109
596
  * ----------------------------------------
@@ -112,374 +599,188 @@ function applyMergeRevertStyles(styles) {
112
599
  // Base colors (Mocha variant)
113
600
  const base00 = '#1e1e2e', // Background - dark navy
114
601
  base01 = '#313244', // Selection background
115
- base02 = '#45475a', // Comments
116
- base03 = '#585b70', // Dark grey
602
+ base02 = '#9c9fb5', // Comments
603
+ base03 = '#9b9fb6', // Dark grey
117
604
  base04 = '#cdd6f4', // Foreground - light blue
118
605
  base05 = '#f5e0dc', // Light foreground
119
606
  // Catppuccin Mocha colors
120
- rosewater = '#f5e0dc', flamingo = '#f2cdcd', pink = '#f5c2e7', mauve = '#cba6f7', red = '#f38ba8', maroon = '#eba0ac', peach = '#fab387', yellow = '#f9e2af', green = '#a6e3a1', teal = '#94e2d5', sky = '#89dceb', sapphire = '#74c7ec', blue = '#89b4fa', lavender = '#b4befe';
607
+ flamingo = '#f2cdcd', pink = '#f5c2e7', mauve = '#cba6f7', red = '#f38ba8', maroon = '#eba0ac', peach = '#fab387', yellow = '#f9e2af', green = '#a6e3a1', teal = '#94e2d5', sky = '#89dceb', sapphire = '#74c7ec', blue = '#89b4fa', lavender = '#b4befe';
121
608
  // UI specific colors
122
- const invalid = '#f38ba8', darkBackground = '#181825', background = base00, tooltipBackground = base01, selectionMatch = '#45475a80', cursor = rosewater, activeBracketBg = '#45475a55', activeBracketBorder = lavender, diagnosticWarning = yellow, linkColor = blue, visitedLinkColor = mauve;
609
+ const darkBackground = '#181825', selectionMatch = '#45475a80', activeBracketBg = '#45475a55';
123
610
  // Diff/merge specific colors
124
- const addedBackground = '#a6e3a140', removedBackground = '#f38ba840', addedText = green, removedText = red;
125
- /**
126
- * Enhanced editor theme styles for Catppuccin Mocha
127
- */
128
- const catppuccinMochaTheme = /*@__PURE__*/EditorView.theme({
129
- // Base editor styles
130
- '&': {
131
- color: base04,
132
- backgroundColor: background,
133
- fontSize: generalContent.fontSize,
134
- fontFamily: generalContent.fontFamily,
135
- },
136
- // Content and cursor
137
- '.cm-content': {
138
- caretColor: cursor,
139
- lineHeight: generalContent.lineHeight,
140
- },
141
- '.cm-cursor, .cm-dropCursor': {
142
- borderLeftColor: cursor,
143
- borderLeftWidth: generalCursor.borderLeftWidth,
144
- },
145
- '.cm-fat-cursor': {
146
- backgroundColor: `${cursor}99`,
147
- color: background,
148
- },
149
- // Selection
150
- '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
151
- backgroundColor: '#585b7080',
152
- outline: `1px solid ${mauve}`,
153
- },
154
- // Make sure selection appears above active line
155
- '.cm-selectionLayer': {
156
- zIndex: 100,
157
- },
158
- // Search functionality
159
- '.cm-searchMatch': {
160
- backgroundColor: '#89b4fa40',
161
- outline: `1px solid ${sapphire}`,
162
- color: base04,
163
- borderRadius: generalSearchField.borderRadius,
164
- '& span': {
165
- color: base04,
166
- },
167
- },
168
- '.cm-searchMatch.cm-searchMatch-selected': {
169
- backgroundColor: blue,
170
- color: base00,
171
- padding: generalSearchField.padding,
172
- '& span': {
173
- color: base00,
174
- },
175
- },
176
- '.cm-search.cm-panel.cm-textfield': {
177
- color: base04,
178
- borderRadius: generalSearchField.borderRadius,
179
- padding: generalSearchField.padding,
180
- },
181
- // Panels
182
- '.cm-panels': {
183
- backgroundColor: darkBackground,
184
- color: base04,
185
- borderRadius: '4px',
186
- },
187
- '.cm-panels.cm-panels-top': {
188
- borderBottom: `1px solid ${base02}`,
189
- },
190
- '.cm-panels.cm-panels-bottom': {
191
- borderTop: `1px solid ${base02}`,
192
- },
193
- '.cm-panel button': {
194
- backgroundColor: tooltipBackground,
195
- color: base04,
196
- border: generalPanel.border,
197
- borderRadius: generalPanel.borderRadius,
198
- padding: generalPanel.padding,
199
- },
200
- '.cm-panel button:hover': {
201
- backgroundColor: base01,
202
- },
203
- // Line highlighting
204
- '.cm-activeLine': {
205
- backgroundColor: '#3a3a5266',
206
- borderRadius: generalLine.borderRadius,
207
- borderLeft: `2px solid ${lavender}`,
208
- zIndex: 1,
209
- },
210
- // Gutters
211
- '.cm-gutters': {
212
- backgroundColor: darkBackground,
213
- color: base02,
214
- border: generalGutter.border,
215
- borderRight: `1px solid ${base01}`,
216
- paddingRight: generalGutter.paddingRight,
217
- },
218
- '.cm-activeLineGutter': {
219
- backgroundColor: base01,
220
- color: base04,
221
- fontWeight: generalGutter.fontWeight,
222
- },
223
- '.cm-lineNumbers': {
224
- fontSize: generalGutter.fontSize,
225
- lineHeight: generalGutter.lineHeight,
226
- },
227
- '.cm-foldGutter': {
228
- fontSize: generalGutter.fontSize,
229
- lineHeight: generalGutter.lineHeight,
230
- },
231
- '.cm-foldGutter .cm-gutterElement': {
232
- color: base02,
233
- cursor: 'pointer',
234
- },
235
- '.cm-foldGutter .cm-gutterElement:hover': {
236
- color: base04,
237
- },
238
- // Diff/Merge View Styles
239
- '.cm-insertedLine': {
240
- textDecoration: generalDiff.insertedTextDecoration,
241
- backgroundColor: addedBackground,
242
- color: addedText,
243
- padding: generalDiff.insertedLinePadding,
244
- borderRadius: generalDiff.borderRadius,
245
- },
246
- 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
247
- textDecoration: generalDiff.insertedTextDecoration,
248
- backgroundColor: `${addedBackground} !important`,
249
- color: addedText,
250
- padding: generalDiff.insertedLinePadding,
251
- borderRadius: generalDiff.borderRadius,
252
- border: `1px solid ${addedText}40`,
253
- },
254
- 'ins.cm-insertedLine .cm-changedText': {
255
- background: 'transparent !important',
256
- },
257
- '.cm-deletedLine': {
258
- textDecoration: generalDiff.deletedTextDecoration,
259
- backgroundColor: removedBackground,
260
- color: removedText,
261
- padding: generalDiff.insertedLinePadding,
262
- borderRadius: generalDiff.borderRadius,
263
- },
264
- 'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
265
- textDecoration: generalDiff.deletedTextDecoration,
266
- backgroundColor: `${removedBackground} !important`,
267
- color: removedText,
268
- padding: generalDiff.insertedLinePadding,
269
- borderRadius: generalDiff.borderRadius,
270
- border: `1px solid ${removedText}40`,
271
- },
272
- 'del .cm-deletedText, del .cm-changedText': {
273
- background: 'transparent !important',
274
- },
275
- // Tooltips and autocomplete
276
- '.cm-tooltip': {
277
- backgroundColor: tooltipBackground,
278
- border: `1px solid ${base02}`,
279
- borderRadius: generalTooltip.borderRadius,
280
- padding: generalTooltip.padding,
281
- boxShadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
282
- },
283
- '.cm-tooltip-autocomplete': {
284
- '& > ul': {
285
- backgroundColor: tooltipBackground,
286
- border: 'none',
611
+ const addedBackground = '#a6e3a140', removedBackground = '#f38ba840';
612
+ const theme = /*@__PURE__*/defineTheme({
613
+ dark: true,
614
+ ui: {
615
+ background: base00,
616
+ foreground: base04,
617
+ border: 'none',
618
+ cursor: base05,
619
+ cursorWidth: '2px',
620
+ cursorShadow: 'none',
621
+ fatCursor: { background: `${base05}99`, border: 'none' },
622
+ selection: '#585b7066',
623
+ selectionInactive: '#585b7066',
624
+ selectionForeground: null,
625
+ selectionOutline: `1px solid ${mauve}`,
626
+ activeLine: '#3a3a525f',
627
+ activeLineBorder: { left: `2px solid ${lavender}`, right: 'none' },
628
+ ghostText: base02,
629
+ ghostTextOpacity: '0.5',
630
+ specialChar: red,
631
+ focusRing: `0 0 0 2px ${base00}, 0 0 0 4px ${lavender}`,
632
+ outlineWidth: '1px',
633
+ searchMatch: {
634
+ background: `${blue}40`,
635
+ outline: sapphire,
636
+ foreground: base04,
637
+ shadow: 'none',
638
+ selectedBackground: blue,
639
+ selectedForeground: base00,
640
+ selectedOutline: `1px solid ${sapphire}`,
641
+ selectedShadow: 'none',
287
642
  },
288
- '& > ul > li': {
289
- padding: generalTooltip.padding,
290
- lineHeight: generalTooltip.lineHeight,
643
+ selectionMatch: { background: selectionMatch, outline: `${base01}50` },
644
+ matchingBracket: { background: activeBracketBg, outline: lavender, shadow: 'none' },
645
+ nonMatchingBracket: { background: removedBackground, outline: red },
646
+ panel: {
647
+ background: darkBackground,
648
+ foreground: base04,
649
+ border: base02,
650
+ borderWidth: '1px',
651
+ outline: 'none',
652
+ shadow: 'none',
653
+ buttonBackground: base01,
654
+ buttonForeground: base04,
655
+ buttonBorder: 'none',
656
+ buttonHoverBackground: base01,
657
+ buttonHoverForeground: base04,
658
+ buttonHoverBorder: 'none',
659
+ buttonHoverShadow: 'none',
660
+ inputBackground: base00,
661
+ inputBorder: `1px solid ${base02}`,
291
662
  },
292
- '& > ul > li[aria-selected]': {
293
- backgroundColor: base01,
294
- color: base05,
295
- borderRadius: generalTooltip.borderRadiusSelected,
663
+ gutter: {
664
+ background: darkBackground,
665
+ foreground: base02,
666
+ border: base01,
667
+ activeBackground: base01,
668
+ activeForeground: base04,
669
+ activeFontWeight: '500',
670
+ activeBorder: 'none',
671
+ foldHover: base04,
296
672
  },
297
- '& > ul > li > span.cm-completionIcon': {
298
- color: base02,
299
- paddingRight: generalTooltip.paddingRight,
673
+ foldPlaceholder: { background: base01, foreground: base02, border: `${base02}70`, borderStyle: 'dotted' },
674
+ tooltip: {
675
+ background: base01,
676
+ foreground: base04,
677
+ border: base02,
678
+ shadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
679
+ listBackground: base01,
680
+ listBorder: 'none',
681
+ hoverBackground: 'transparent',
682
+ selectedBackground: base01,
683
+ selectedForeground: base05,
684
+ selectedBorder: 'none',
685
+ icon: base02,
686
+ detail: base02,
300
687
  },
301
- '& > ul > li > span.cm-completionDetail': {
302
- color: base02,
303
- fontStyle: 'italic',
688
+ diff: {
689
+ insertedBackground: addedBackground,
690
+ insertedForeground: green,
691
+ insertedBorder: `1px solid ${green}40`,
692
+ deletedBackground: removedBackground,
693
+ deletedForeground: red,
694
+ deletedBorder: `1px solid ${red}40`,
304
695
  },
305
- },
306
- '.cm-tooltip .cm-tooltip-arrow:before': {
307
- borderTopColor: 'transparent',
308
- borderBottomColor: 'transparent',
309
- },
310
- '.cm-tooltip .cm-tooltip-arrow:after': {
311
- borderTopColor: tooltipBackground,
312
- borderBottomColor: tooltipBackground,
313
- },
314
- // Diagnostics styling
315
- '.cm-diagnostic': {
316
- '&-error': {
317
- borderLeft: `3px solid ${red}`,
696
+ diagnostic: {
697
+ error: red,
698
+ warning: yellow,
699
+ info: blue,
700
+ hint: blue,
701
+ errorBackground: 'transparent',
702
+ warningBackground: 'transparent',
703
+ infoBackground: 'transparent',
704
+ borderWidth: '3px',
705
+ underlineWidth: '2px',
318
706
  },
319
- '&-warning': {
320
- borderLeft: `3px solid ${diagnosticWarning}`,
707
+ scrollbar: {
708
+ track: darkBackground,
709
+ trackBorder: 'none',
710
+ thumb: base01,
711
+ thumbBorder: `3px solid ${darkBackground}`,
712
+ thumbHover: base02,
713
+ thumbHoverShadow: 'none',
321
714
  },
322
- '&-info': {
323
- borderLeft: `3px solid ${linkColor}`,
715
+ merge: {
716
+ backgroundColor: darkBackground,
717
+ borderColor: base02,
718
+ buttonColor: base04,
719
+ buttonHoverColor: base01,
324
720
  },
325
721
  },
326
- '.cm-lintPoint-error': {
327
- borderBottom: `2px wavy ${red}`,
328
- },
329
- '.cm-lintPoint-warning': {
330
- borderBottom: `2px wavy ${diagnosticWarning}`,
331
- },
332
- // Matching brackets
333
- '.cm-matchingBracket': {
334
- backgroundColor: activeBracketBg,
335
- outline: `1px solid ${activeBracketBorder}`,
336
- borderRadius: generalMatching.borderRadius,
337
- },
338
- '.cm-nonmatchingBracket': {
339
- backgroundColor: `${red}40`,
340
- outline: `1px solid ${invalid}`,
341
- borderRadius: generalMatching.borderRadius,
342
- },
343
- // Selection matches
344
- '.cm-selectionMatch': {
345
- backgroundColor: selectionMatch,
346
- outline: `1px solid ${base01}50`,
347
- borderRadius: generalMatching.borderRadius,
348
- },
349
- // Fold placeholder
350
- '.cm-foldPlaceholder': {
351
- backgroundColor: tooltipBackground,
352
- color: base02,
353
- border: `1px dotted ${base02}70`,
354
- borderRadius: generalPlaceholder.borderRadius,
355
- padding: generalPlaceholder.padding,
356
- margin: generalPlaceholder.margin,
357
- },
358
- // Focus outline
359
- '&.cm-focused': {
360
- outline: 'none',
361
- boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${lavender}40`,
362
- },
363
- // Scrollbars
364
- '& .cm-scroller::-webkit-scrollbar': {
365
- width: generalScroller.width,
366
- height: generalScroller.height,
367
- },
368
- '& .cm-scroller::-webkit-scrollbar-track': {
369
- background: darkBackground,
370
- },
371
- '& .cm-scroller::-webkit-scrollbar-thumb': {
372
- backgroundColor: base01,
373
- borderRadius: generalScroller.borderRadius,
374
- border: `3px solid ${darkBackground}`,
375
- },
376
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
377
- backgroundColor: base02,
378
- },
379
- // Ghost text
380
- '.cm-ghostText': {
381
- opacity: '0.5',
382
- color: base02,
383
- },
384
- }, { dark: true });
385
- /**
386
- * Enhanced syntax highlighting for Catppuccin Mocha theme
387
- */
388
- const catppuccinMochaHighlightStyle = /*@__PURE__*/HighlightStyle.define([
389
- // Keywords and control flow
390
- { tag: tags.keyword, color: mauve, fontWeight: 'bold' },
391
- { tag: tags.controlKeyword, color: mauve, fontWeight: 'bold' },
392
- { tag: tags.moduleKeyword, color: mauve, fontWeight: 'bold' },
393
- // Names and variables
394
- { tag: [tags.name, tags.deleted, tags.character, tags.macroName], color: base04 },
395
- { tag: [tags.variableName], color: base04 },
396
- { tag: [tags.propertyName], color: blue, fontStyle: 'normal' },
397
- // Classes and types
398
- { tag: [tags.typeName], color: yellow },
399
- { tag: [tags.className], color: yellow, fontStyle: 'italic' },
400
- { tag: [tags.namespace], color: peach, fontStyle: 'italic' },
401
- // Operators and punctuation
402
- { tag: [tags.operator, tags.operatorKeyword], color: sky },
403
- { tag: [tags.bracket], color: base03 },
404
- { tag: [tags.brace], color: teal },
405
- { tag: [tags.punctuation], color: base03 },
406
- // Functions and parameters
407
- { tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color: blue },
408
- { tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color: blue },
409
- { tag: [/*@__PURE__*/tags.definition(tags.variableName)], color: peach },
410
- // Constants and literals
411
- { tag: tags.number, color: peach },
412
- { tag: tags.changed, color: yellow },
413
- { tag: tags.annotation, color: red, fontStyle: 'italic' },
414
- { tag: tags.modifier, color: mauve, fontStyle: 'italic' },
415
- { tag: tags.self, color: red },
416
- { tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: peach },
417
- { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: peach },
418
- // Strings and regex
419
- { tag: [tags.processingInstruction, tags.inserted], color: green },
420
- { tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color: pink },
421
- { tag: tags.string, color: green },
422
- // Punctuation and structure
423
- { tag: /*@__PURE__*/tags.definition(tags.typeName), color: yellow, fontWeight: 'bold' },
424
- { tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: flamingo },
425
- // Comments and documentation
426
- { tag: tags.meta, color: base02 },
427
- { tag: tags.comment, fontStyle: 'italic', color: base02 },
428
- { tag: tags.docComment, fontStyle: 'italic', color: base02 },
429
- // HTML/XML elements
430
- { tag: [tags.tagName], color: pink },
431
- { tag: [tags.attributeName], color: yellow },
432
- // Markdown and text formatting
433
- { tag: [tags.heading], fontWeight: 'bold', color: mauve },
434
- { tag: [tags.strong], fontWeight: 'bold', color: maroon },
435
- { tag: [tags.emphasis], fontStyle: 'italic', color: pink },
436
- // Links and URLs
437
- {
438
- tag: [tags.link],
439
- color: visitedLinkColor,
440
- fontWeight: '500',
441
- textDecoration: 'underline',
442
- textUnderlinePosition: 'under',
443
- },
444
- {
445
- tag: [tags.url],
446
- color: linkColor,
447
- textDecoration: 'underline',
448
- textUnderlineOffset: '2px',
449
- },
450
- // Special states
451
- {
452
- tag: [tags.invalid],
453
- color: red,
454
- textDecoration: 'underline wavy',
455
- borderBottom: `1px wavy ${red}`,
456
- },
457
- { tag: [tags.strikethrough], color: red, textDecoration: 'line-through' },
458
- // Enhanced syntax highlighting
459
- { tag: /*@__PURE__*/tags.constant(tags.name), color: peach },
460
- { tag: tags.deleted, color: red },
461
- { tag: tags.squareBracket, color: maroon },
462
- { tag: tags.angleBracket, color: sky },
463
- // Additional specific styles
464
- { tag: tags.monospace, color: teal, fontStyle: 'italic' },
465
- { tag: [tags.contentSeparator], color: sapphire },
466
- { tag: tags.quote, color: lavender },
467
- ]);
722
+ syntax: {
723
+ keyword: { color: mauve, fontWeight: 'bold' },
724
+ definitionKeyword: { color: mauve },
725
+ modifier: { color: mauve, fontStyle: 'italic' },
726
+ separator: { color: flamingo },
727
+ angleBracket: { color: sky },
728
+ squareBracket: { color: maroon },
729
+ brace: { color: teal },
730
+ operator: { color: sky },
731
+ punctuation: { color: base03 },
732
+ name: { color: base04 },
733
+ localVariable: { color: peach },
734
+ variableDefinition: { color: peach },
735
+ nameDefinition: { color: flamingo },
736
+ function: { color: blue },
737
+ self: { color: red },
738
+ label: { color: blue },
739
+ property: { color: blue, fontStyle: 'normal' },
740
+ type: { color: yellow },
741
+ typeDefinition: { color: yellow, fontWeight: 'bold' },
742
+ className: { color: yellow, fontStyle: 'italic' },
743
+ namespace: { color: peach, fontStyle: 'italic' },
744
+ tag: { color: pink },
745
+ attribute: { color: yellow },
746
+ content: { color: base04 },
747
+ string: { color: green },
748
+ regexp: { color: pink },
749
+ number: { color: peach },
750
+ constant: { color: peach },
751
+ comment: { fontStyle: 'italic', color: base02 },
752
+ meta: { color: base02 },
753
+ processingInstruction: { color: green },
754
+ annotation: { color: red, fontStyle: 'italic' },
755
+ heading: { fontWeight: 'bold', color: mauve },
756
+ headingLevel: { color: mauve },
757
+ list: { color: mauve },
758
+ quote: { color: lavender },
759
+ monospace: { color: teal, fontStyle: 'italic' },
760
+ contentSeparator: { color: sapphire },
761
+ link: {
762
+ color: mauve,
763
+ fontWeight: '500',
764
+ textDecoration: 'underline',
765
+ textUnderlinePosition: 'under',
766
+ },
767
+ url: { color: blue, textDecoration: 'underline', textUnderlineOffset: '2px' },
768
+ emphasis: { fontStyle: 'italic', color: pink },
769
+ strong: { fontWeight: 'bold', color: maroon },
770
+ strikethrough: { color: red, textDecoration: 'line-through' },
771
+ invalid: { color: red, textDecoration: 'underline wavy', borderBottom: `1px wavy ${red}` },
772
+ inserted: { color: green },
773
+ deleted: { color: red },
774
+ changed: { color: yellow },
775
+ },
776
+ });
468
777
  /**
469
778
  * Combined Catppuccin Mocha theme extension
470
779
  */
471
- const catppuccinMocha = [
472
- catppuccinMochaTheme,
473
- /*@__PURE__*/syntaxHighlighting(catppuccinMochaHighlightStyle),
474
- ];
780
+ const catppuccinMocha = theme.extension;
475
781
  /**
476
782
  * Catppuccin Mocha merge revert styles configuration
477
783
  */
478
- const catppuccinMochaMergeStyles = {
479
- backgroundColor: darkBackground,
480
- borderColor: base02,
481
- buttonColor: base04,
482
- buttonHoverColor: base01,
483
- };
784
+ const catppuccinMochaMergeStyles = theme.mergeStyles;
484
785
 
485
786
  export { applyMergeRevertStyles, catppuccinMocha, catppuccinMochaMergeStyles };