Extract isomorphic @getpaseo/highlight package with syntax-highlighted file preview
- Create packages/highlight with shared Lezer-based syntax highlighting (types, parsers, highlighter, color maps) - Add syntax highlighting and line numbers to file-pane.tsx with memoized CodeLine component - Import shared highlight colors in git-diff-pane.tsx instead of local definitions - Delete duplicated syntax-highlighter.ts from both app and server - Fix TSX dialect to "ts jsx" (correct per Lezer docs)
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import type { HighlightStyle } from './types.js'
|
||||
|
||||
export const darkHighlightColors: Record<HighlightStyle, string> = {
|
||||
keyword: '#ff7b72',
|
||||
comment: '#8b949e',
|
||||
string: '#a5d6ff',
|
||||
number: '#79c0ff',
|
||||
literal: '#79c0ff',
|
||||
function: '#d2a8ff',
|
||||
definition: '#d2a8ff',
|
||||
class: '#ffa657',
|
||||
type: '#ff7b72',
|
||||
tag: '#7ee787',
|
||||
attribute: '#79c0ff',
|
||||
property: '#79c0ff',
|
||||
variable: '#c9d1d9',
|
||||
operator: '#79c0ff',
|
||||
punctuation: '#c9d1d9',
|
||||
regexp: '#a5d6ff',
|
||||
escape: '#79c0ff',
|
||||
meta: '#8b949e',
|
||||
heading: '#79c0ff',
|
||||
link: '#a5d6ff',
|
||||
}
|
||||
|
||||
export const lightHighlightColors: Record<HighlightStyle, string> = {
|
||||
keyword: '#cf222e',
|
||||
comment: '#6e7781',
|
||||
string: '#0a3069',
|
||||
number: '#0550ae',
|
||||
literal: '#0550ae',
|
||||
function: '#8250df',
|
||||
definition: '#8250df',
|
||||
class: '#953800',
|
||||
type: '#cf222e',
|
||||
tag: '#116329',
|
||||
attribute: '#0550ae',
|
||||
property: '#0550ae',
|
||||
variable: '#24292f',
|
||||
operator: '#0550ae',
|
||||
punctuation: '#24292f',
|
||||
regexp: '#0a3069',
|
||||
escape: '#0550ae',
|
||||
meta: '#6e7781',
|
||||
heading: '#0550ae',
|
||||
link: '#0a3069',
|
||||
}
|
||||
Reference in New Issue
Block a user