@fsegurai/codemirror-theme-nord 6.1.4 → 6.2.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/dist/index.cjs +289 -135
- package/dist/index.d.cts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.js +289 -135
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img alt="CodeMirror 6 Themes Logo" src="https://raw.githubusercontent.com/fsegurai/codemirror-themes/main/
|
|
2
|
+
<img alt="CodeMirror 6 Themes Logo" src="https://raw.githubusercontent.com/fsegurai/codemirror-themes/main/public/codemirror-themes.png">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -69,32 +69,32 @@ Read the [CodeMirror documentation](https://codemirror.net/6/examples/styling/)
|
|
|
69
69
|
|
|
70
70
|
### Available Themes
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [
|
|
75
|
-
- [
|
|
76
|
-
- [
|
|
77
|
-
- [
|
|
78
|
-
- [
|
|
79
|
-
- [
|
|
80
|
-
|
|
81
|
-
- [
|
|
82
|
-
- [
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
87
|
-
- [
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- [
|
|
94
|
-
|
|
95
|
-
- [
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
| Theme | Package | Version |
|
|
73
|
+
|-------------------|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
|
|
74
|
+
| All - Bundle | [@fsegurai/codemirror-theme-bundle](https://www.npmjs.com/package/@fsegurai/codemirror-theme-bundle) |  |
|
|
75
|
+
| Abcdef | [@fsegurai/codemirror-theme-abcdef](https://www.npmjs.com/package/@fsegurai/codemirror-theme-abcdef) |  |
|
|
76
|
+
| Abyss | [@fsegurai/codemirror-theme-abyss](https://www.npmjs.com/package/@fsegurai/codemirror-theme-abyss) |  |
|
|
77
|
+
| Android Studio | [@fsegurai/codemirror-theme-android-studio](https://www.npmjs.com/package/@fsegurai/codemirror-theme-android-studio) |  |
|
|
78
|
+
| Andromeda | [@fsegurai/codemirror-theme-andromeda](https://www.npmjs.com/package/@fsegurai/codemirror-theme-andromeda) |  |
|
|
79
|
+
| Basic Light | [@fsegurai/codemirror-theme-basic-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-basic-light) |  |
|
|
80
|
+
| Basic Dark | [@fsegurai/codemirror-theme-basic-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-basic-dark) |  |
|
|
81
|
+
| Forest | [@fsegurai/codemirror-theme-forest](https://www.npmjs.com/package/@fsegurai/codemirror-theme-forest) |  |
|
|
82
|
+
| GitHub Light | [@fsegurai/codemirror-theme-github-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-github-light) |  |
|
|
83
|
+
| GitHub Dark | [@fsegurai/codemirror-theme-github-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-github-dark) |  |
|
|
84
|
+
| Gruvbox Light | [@fsegurai/codemirror-theme-gruvbox-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-gruvbox-light) |  |
|
|
85
|
+
| Gruvbox Dark | [@fsegurai/codemirror-theme-gruvbox-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-gruvbox-dark) |  |
|
|
86
|
+
| Material Light | [@fsegurai/codemirror-theme-material-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-material-light) |  |
|
|
87
|
+
| Material Dark | [@fsegurai/codemirror-theme-material-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-material-dark) |  |
|
|
88
|
+
| Monokai | [@fsegurai/codemirror-theme-monokai](https://www.npmjs.com/package/@fsegurai/codemirror-theme-monokai) |  |
|
|
89
|
+
| Nord | [@fsegurai/codemirror-theme-nord](https://www.npmjs.com/package/@fsegurai/codemirror-theme-nord) |  |
|
|
90
|
+
| Palenight | [@fsegurai/codemirror-theme-palenight](https://www.npmjs.com/package/@fsegurai/codemirror-theme-palenight) |  |
|
|
91
|
+
| Solarized Light | [@fsegurai/codemirror-theme-solarized-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-solarized-light) |  |
|
|
92
|
+
| Solarized Dark | [@fsegurai/codemirror-theme-solarized-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-solarized-dark) |  |
|
|
93
|
+
| Tokyo Night Storm | [@fsegurai/codemirror-theme-tokyo-night-storm](https://www.npmjs.com/package/@fsegurai/codemirror-theme-tokyo-night-storm) |  |
|
|
94
|
+
| Tokyo Night Day | [@fsegurai/codemirror-theme-tokyo-night-day](https://www.npmjs.com/package/@fsegurai/codemirror-theme-tokyo-night-day) |  |
|
|
95
|
+
| Volcano | [@fsegurai/codemirror-theme-volcano](https://www.npmjs.com/package/@fsegurai/codemirror-theme-volcano) |  |
|
|
96
|
+
| VS Code Dark | [@fsegurai/codemirror-theme-vscode-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-vscode-dark) |  |
|
|
97
|
+
| VS Code Light | [@fsegurai/codemirror-theme-vscode-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-vscode-light) |  |
|
|
98
98
|
|
|
99
99
|
### Demo Application
|
|
100
100
|
|
package/dist/index.cjs
CHANGED
|
@@ -3,80 +3,186 @@
|
|
|
3
3
|
var view = require('@codemirror/view');
|
|
4
4
|
var language = require('@codemirror/language');
|
|
5
5
|
var highlight = require('@lezer/highlight');
|
|
6
|
+
var _utils = require('@utils');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Enhanced Nord theme color definitions
|
|
10
|
+
* ------------------------------------
|
|
11
|
+
* Colors organized by function with visual color blocks
|
|
12
|
+
*/
|
|
8
13
|
// Polar Night
|
|
9
|
-
const base00 = '#2e3440'
|
|
10
|
-
base01 = '#3b4252'
|
|
11
|
-
base02 = '#434c5e'
|
|
14
|
+
const base00 = '#2e3440'; // Background - deep navy blue
|
|
15
|
+
const base01 = '#3b4252'; // Lighter background (popups, statuslines)
|
|
16
|
+
const base02 = '#434c5e'; // Selection background
|
|
17
|
+
const base03 = '#4c566a'; // Comments, invisibles
|
|
12
18
|
// Snow Storm
|
|
13
|
-
const base04 = '#d8dee9'
|
|
14
|
-
base05 = '#e5e9f0'
|
|
15
|
-
base06 = '#eceff4'; //
|
|
19
|
+
const base04 = '#d8dee9'; // Foreground - light blue-grey
|
|
20
|
+
// const base05 = '#e5e9f0'; // Light foreground
|
|
21
|
+
const base06 = '#eceff4'; // Light background
|
|
16
22
|
// Frost
|
|
17
|
-
const base07 = '#8fbcbb'
|
|
18
|
-
base08 = '#88c0d0'
|
|
19
|
-
base09 = '#81a1c1'
|
|
20
|
-
base0A = '#5e81ac'; //
|
|
23
|
+
const base07 = '#8fbcbb'; // Moss green - function names
|
|
24
|
+
const base08 = '#88c0d0'; // Ice blue - classes, attributes
|
|
25
|
+
const base09 = '#81a1c1'; // Water blue - methods
|
|
26
|
+
const base0A = '#5e81ac'; // Deep blue - keywords
|
|
21
27
|
// Aurora
|
|
22
|
-
const
|
|
23
|
-
base0C = '#d08770'
|
|
24
|
-
base0D = '#ebcb8b'
|
|
25
|
-
base0E = '#a3be8c'
|
|
26
|
-
base0F = '#b48ead'; //
|
|
27
|
-
|
|
28
|
+
const base0B = '#bf616a'; // Red - errors, brackets
|
|
29
|
+
const base0C = '#d08770'; // Orange - numbers, constants
|
|
30
|
+
const base0D = '#ebcb8b'; // Yellow - types, classes
|
|
31
|
+
const base0E = '#a3be8c'; // Green - strings
|
|
32
|
+
const base0F = '#b48ead'; // Purple - operators, special characters
|
|
33
|
+
// UI specific colors
|
|
34
|
+
const invalid = '#d30102'; // Bright red for errors
|
|
35
|
+
const darkBackground = '#252a33'; // Darker background for panels
|
|
36
|
+
const highlightBackground = '#3b425277'; // Active line highlight with opacity
|
|
37
|
+
const background = base00; // Main editor background
|
|
38
|
+
const tooltipBackground = base01; // Tooltip background
|
|
39
|
+
const selection = base02; // Selection background
|
|
40
|
+
const selectionMatch = '#4c566a80'; // Selection match with opacity
|
|
41
|
+
const cursor = base04; // Cursor color
|
|
42
|
+
const activeBracketBg = '#4c566a55'; // Active bracket background with opacity
|
|
43
|
+
const activeBracketBorder = base08; // Active bracket border - ice blue
|
|
44
|
+
const diagnosticWarning = base0D; // Warning color - yellow
|
|
45
|
+
const linkColor = base09; // Link color - water blue
|
|
46
|
+
const visitedLinkColor = base0F; // Visited link color - purple
|
|
28
47
|
/**
|
|
29
|
-
|
|
30
|
-
*/
|
|
48
|
+
* Enhanced editor theme styles for Nord
|
|
49
|
+
*/
|
|
31
50
|
const nordTheme = view.EditorView.theme({
|
|
51
|
+
// Base editor styles
|
|
32
52
|
'&': {
|
|
33
53
|
color: base04,
|
|
34
54
|
backgroundColor: background,
|
|
55
|
+
fontSize: _utils.generalContent.fontSize,
|
|
56
|
+
fontFamily: _utils.generalContent.fontFamily,
|
|
35
57
|
},
|
|
58
|
+
// Content and cursor
|
|
36
59
|
'.cm-content': {
|
|
37
60
|
caretColor: cursor,
|
|
61
|
+
lineHeight: _utils.generalContent.lineHeight,
|
|
62
|
+
},
|
|
63
|
+
'.cm-cursor, .cm-dropCursor': {
|
|
64
|
+
borderLeftColor: cursor,
|
|
65
|
+
borderLeftWidth: _utils.generalCursor.borderLeftWidth,
|
|
66
|
+
},
|
|
67
|
+
'.cm-fat-cursor': {
|
|
68
|
+
backgroundColor: `${cursor}99`,
|
|
69
|
+
color: background,
|
|
38
70
|
},
|
|
39
|
-
|
|
40
|
-
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
71
|
+
// Selection
|
|
72
|
+
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
73
|
+
backgroundColor: selection,
|
|
74
|
+
},
|
|
75
|
+
// Make sure selection appears above active line
|
|
76
|
+
'.cm-selectionLayer': {
|
|
77
|
+
zIndex: 100,
|
|
78
|
+
},
|
|
79
|
+
// Search functionality
|
|
44
80
|
'.cm-searchMatch': {
|
|
45
|
-
backgroundColor: '
|
|
81
|
+
backgroundColor: '#5e81ac80',
|
|
46
82
|
outline: `1px solid ${base07}`,
|
|
83
|
+
color: base04,
|
|
84
|
+
borderRadius: _utils.generalSearchField.borderRadius,
|
|
85
|
+
'& span': {
|
|
86
|
+
color: base04,
|
|
87
|
+
},
|
|
47
88
|
},
|
|
48
89
|
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
49
|
-
backgroundColor:
|
|
50
|
-
color:
|
|
90
|
+
backgroundColor: base09,
|
|
91
|
+
color: base06,
|
|
92
|
+
padding: _utils.generalSearchField.padding,
|
|
93
|
+
'& span': {
|
|
94
|
+
color: base06,
|
|
95
|
+
},
|
|
51
96
|
},
|
|
52
|
-
'.cm-
|
|
53
|
-
|
|
54
|
-
|
|
97
|
+
'.cm-search.cm-panel.cm-textfield': {
|
|
98
|
+
color: base04,
|
|
99
|
+
borderRadius: _utils.generalSearchField.borderRadius,
|
|
100
|
+
padding: _utils.generalSearchField.padding,
|
|
55
101
|
},
|
|
56
|
-
|
|
57
|
-
|
|
102
|
+
// Panels
|
|
103
|
+
'.cm-panels': {
|
|
104
|
+
backgroundColor: darkBackground,
|
|
105
|
+
color: base04,
|
|
106
|
+
borderRadius: '4px',
|
|
107
|
+
},
|
|
108
|
+
'.cm-panels.cm-panels-top': {
|
|
109
|
+
borderBottom: `1px solid ${base03}`,
|
|
110
|
+
},
|
|
111
|
+
'.cm-panels.cm-panels-bottom': {
|
|
112
|
+
borderTop: `1px solid ${base03}`,
|
|
113
|
+
},
|
|
114
|
+
'.cm-panel button': {
|
|
115
|
+
backgroundColor: tooltipBackground,
|
|
116
|
+
color: base04,
|
|
117
|
+
border: _utils.generalPanel.border,
|
|
118
|
+
borderRadius: _utils.generalPanel.borderRadius,
|
|
119
|
+
padding: _utils.generalPanel.padding,
|
|
120
|
+
},
|
|
121
|
+
'.cm-panel button:hover': {
|
|
122
|
+
backgroundColor: base02,
|
|
58
123
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
124
|
+
// Line highlighting
|
|
125
|
+
'.cm-activeLine': {
|
|
126
|
+
backgroundColor: highlightBackground,
|
|
127
|
+
borderRadius: _utils.generalLine.borderRadius,
|
|
128
|
+
zIndex: 1,
|
|
62
129
|
},
|
|
130
|
+
// Gutters
|
|
63
131
|
'.cm-gutters': {
|
|
64
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: darkBackground,
|
|
65
133
|
color: base03,
|
|
66
|
-
border:
|
|
134
|
+
border: _utils.generalGutter.border,
|
|
135
|
+
borderRight: `1px solid ${base02}`,
|
|
136
|
+
paddingRight: _utils.generalGutter.paddingRight,
|
|
67
137
|
},
|
|
68
138
|
'.cm-activeLineGutter': {
|
|
69
|
-
backgroundColor:
|
|
139
|
+
backgroundColor: base01,
|
|
70
140
|
color: base04,
|
|
141
|
+
fontWeight: _utils.generalGutter.fontWeight,
|
|
71
142
|
},
|
|
72
|
-
'.cm-
|
|
73
|
-
|
|
74
|
-
border: 'none',
|
|
75
|
-
color: '#ddd',
|
|
143
|
+
'.cm-lineNumbers': {
|
|
144
|
+
fontSize: _utils.generalGutter.fontSize,
|
|
76
145
|
},
|
|
146
|
+
'.cm-foldGutter': {
|
|
147
|
+
fontSize: _utils.generalGutter.fontSize,
|
|
148
|
+
},
|
|
149
|
+
'.cm-foldGutter .cm-gutterElement': {
|
|
150
|
+
color: base03,
|
|
151
|
+
cursor: 'pointer',
|
|
152
|
+
},
|
|
153
|
+
'.cm-foldGutter .cm-gutterElement:hover': {
|
|
154
|
+
color: base04,
|
|
155
|
+
},
|
|
156
|
+
// Tooltips and autocomplete
|
|
77
157
|
'.cm-tooltip': {
|
|
78
|
-
border: 'none',
|
|
79
158
|
backgroundColor: tooltipBackground,
|
|
159
|
+
border: `1px solid ${base03}`,
|
|
160
|
+
borderRadius: _utils.generalTooltip.borderRadius,
|
|
161
|
+
padding: _utils.generalTooltip.padding,
|
|
162
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
|
|
163
|
+
},
|
|
164
|
+
'.cm-tooltip-autocomplete': {
|
|
165
|
+
'& > ul': {
|
|
166
|
+
backgroundColor: tooltipBackground,
|
|
167
|
+
border: 'none',
|
|
168
|
+
},
|
|
169
|
+
'& > ul > li': {
|
|
170
|
+
padding: _utils.generalTooltip.padding,
|
|
171
|
+
lineHeight: _utils.generalTooltip.lineHeight,
|
|
172
|
+
},
|
|
173
|
+
'& > ul > li[aria-selected]': {
|
|
174
|
+
backgroundColor: base02,
|
|
175
|
+
color: base06,
|
|
176
|
+
borderRadius: _utils.generalTooltip.borderRadiusSelected,
|
|
177
|
+
},
|
|
178
|
+
'& > ul > li > span.cm-completionIcon': {
|
|
179
|
+
color: base03,
|
|
180
|
+
paddingRight: _utils.generalTooltip.paddingRight,
|
|
181
|
+
},
|
|
182
|
+
'& > ul > li > span.cm-completionDetail': {
|
|
183
|
+
color: base03,
|
|
184
|
+
fontStyle: 'italic',
|
|
185
|
+
},
|
|
80
186
|
},
|
|
81
187
|
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
82
188
|
borderTopColor: 'transparent',
|
|
@@ -86,115 +192,163 @@ const nordTheme = view.EditorView.theme({
|
|
|
86
192
|
borderTopColor: tooltipBackground,
|
|
87
193
|
borderBottomColor: tooltipBackground,
|
|
88
194
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
195
|
+
// Diagnostics styling
|
|
196
|
+
'.cm-diagnostic': {
|
|
197
|
+
'&-error': {
|
|
198
|
+
borderLeft: `3px solid ${base0B}`,
|
|
199
|
+
},
|
|
200
|
+
'&-warning': {
|
|
201
|
+
borderLeft: `3px solid ${diagnosticWarning}`,
|
|
202
|
+
},
|
|
203
|
+
'&-info': {
|
|
204
|
+
borderLeft: `3px solid ${linkColor}`,
|
|
93
205
|
},
|
|
94
206
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
The highlighting style for code in the Nord theme.
|
|
98
|
-
*/
|
|
99
|
-
const nordHighlightStyle = language.HighlightStyle.define([
|
|
100
|
-
{ tag: highlight.tags.keyword, color: base0A },
|
|
101
|
-
{
|
|
102
|
-
tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.propertyName, highlight.tags.macroName],
|
|
103
|
-
color: base08,
|
|
104
|
-
},
|
|
105
|
-
{ tag: [highlight.tags.variableName], color: base07 },
|
|
106
|
-
{ tag: [highlight.tags.function(highlight.tags.variableName)], color: base07 },
|
|
107
|
-
{ tag: [highlight.tags.labelName], color: base09 },
|
|
108
|
-
{
|
|
109
|
-
tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)],
|
|
110
|
-
color: base0A,
|
|
111
|
-
},
|
|
112
|
-
{ tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0E },
|
|
113
|
-
{ tag: [highlight.tags.brace], color: base07 },
|
|
114
|
-
{
|
|
115
|
-
tag: [highlight.tags.annotation],
|
|
116
|
-
color: invalid,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
tag: [highlight.tags.number, highlight.tags.changed, highlight.tags.annotation, highlight.tags.modifier, highlight.tags.self, highlight.tags.namespace],
|
|
120
|
-
color: base0F,
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
tag: [highlight.tags.typeName, highlight.tags.className],
|
|
124
|
-
color: base0D,
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
tag: [highlight.tags.operator, highlight.tags.operatorKeyword],
|
|
128
|
-
color: base0E,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
tag: [highlight.tags.tagName],
|
|
132
|
-
color: base0F,
|
|
207
|
+
'.cm-lintPoint-error': {
|
|
208
|
+
borderBottom: `2px wavy ${base0B}`,
|
|
133
209
|
},
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
color: base0b,
|
|
210
|
+
'.cm-lintPoint-warning': {
|
|
211
|
+
borderBottom: `2px wavy ${diagnosticWarning}`,
|
|
137
212
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
213
|
+
// Matching brackets
|
|
214
|
+
'.cm-matchingBracket': {
|
|
215
|
+
backgroundColor: activeBracketBg,
|
|
216
|
+
outline: `1px solid ${activeBracketBorder}`,
|
|
217
|
+
borderRadius: _utils.generalMatching.borderRadius,
|
|
141
218
|
},
|
|
142
|
-
{
|
|
143
|
-
|
|
144
|
-
|
|
219
|
+
'.cm-nonmatchingBracket': {
|
|
220
|
+
backgroundColor: `${base0B}40`,
|
|
221
|
+
outline: `1px solid ${invalid}`,
|
|
222
|
+
borderRadius: _utils.generalMatching.borderRadius,
|
|
145
223
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
224
|
+
// Selection matches
|
|
225
|
+
'.cm-selectionMatch': {
|
|
226
|
+
backgroundColor: selectionMatch,
|
|
227
|
+
outline: `1px solid ${base02}50`,
|
|
228
|
+
borderRadius: _utils.generalMatching.borderRadius,
|
|
149
229
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
230
|
+
// Fold placeholder
|
|
231
|
+
'.cm-foldPlaceholder': {
|
|
232
|
+
backgroundColor: tooltipBackground,
|
|
233
|
+
color: base03,
|
|
234
|
+
border: `1px dotted ${base03}70`,
|
|
235
|
+
borderRadius: _utils.generalPlaceholder.borderRadius,
|
|
236
|
+
padding: _utils.generalPlaceholder.padding,
|
|
237
|
+
margin: _utils.generalPlaceholder.margin,
|
|
238
|
+
},
|
|
239
|
+
// Focus outline
|
|
240
|
+
'&.cm-focused': {
|
|
241
|
+
outline: 'none',
|
|
242
|
+
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base08}40`,
|
|
243
|
+
},
|
|
244
|
+
// Scrollbars
|
|
245
|
+
'& .cm-scroller::-webkit-scrollbar': {
|
|
246
|
+
width: _utils.generalScroller.width,
|
|
247
|
+
height: _utils.generalScroller.height,
|
|
248
|
+
},
|
|
249
|
+
'& .cm-scroller::-webkit-scrollbar-track': {
|
|
250
|
+
background: darkBackground,
|
|
251
|
+
},
|
|
252
|
+
'& .cm-scroller::-webkit-scrollbar-thumb': {
|
|
253
|
+
backgroundColor: base02,
|
|
254
|
+
borderRadius: _utils.generalScroller.borderRadius,
|
|
255
|
+
border: `3px solid ${darkBackground}`,
|
|
256
|
+
},
|
|
257
|
+
'& .cm-scroller::-webkit-scrollbar-thumb:hover': {
|
|
258
|
+
backgroundColor: base03,
|
|
259
|
+
},
|
|
260
|
+
// Ghost text
|
|
261
|
+
'.cm-ghostText': {
|
|
262
|
+
opacity: '0.5',
|
|
263
|
+
color: base03,
|
|
153
264
|
},
|
|
154
|
-
|
|
265
|
+
}, { dark: true });
|
|
266
|
+
/**
|
|
267
|
+
* Enhanced syntax highlighting for Nord theme
|
|
268
|
+
*/
|
|
269
|
+
const nordHighlightStyle = language.HighlightStyle.define([
|
|
270
|
+
// Keywords and control flow
|
|
271
|
+
{ tag: highlight.tags.keyword, color: base0A, fontWeight: 'bold' },
|
|
272
|
+
{ tag: highlight.tags.controlKeyword, color: base0A, fontWeight: 'bold' },
|
|
273
|
+
{ tag: highlight.tags.moduleKeyword, color: base0A, fontWeight: 'bold' },
|
|
274
|
+
// Names and variables
|
|
275
|
+
{ tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base08 },
|
|
276
|
+
{ tag: [highlight.tags.variableName], color: base04 },
|
|
277
|
+
{ tag: [highlight.tags.propertyName], color: base08, fontStyle: 'normal' },
|
|
278
|
+
// Classes and types
|
|
279
|
+
{ tag: [highlight.tags.typeName], color: base0D },
|
|
280
|
+
{ tag: [highlight.tags.className], color: base0D, fontStyle: 'italic' },
|
|
281
|
+
{ tag: [highlight.tags.namespace], color: base09, fontStyle: 'italic' },
|
|
282
|
+
// Operators and punctuation
|
|
283
|
+
{ tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base0F },
|
|
284
|
+
{ tag: [highlight.tags.bracket], color: base04 },
|
|
285
|
+
{ tag: [highlight.tags.brace], color: base07 },
|
|
286
|
+
{ tag: [highlight.tags.punctuation], color: base04 },
|
|
287
|
+
// Functions and parameters
|
|
288
|
+
{ tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: base07 },
|
|
289
|
+
{ tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: base07 },
|
|
290
|
+
{ tag: [highlight.tags.definition(highlight.tags.variableName)], color: base0C },
|
|
291
|
+
// Constants and literals
|
|
292
|
+
{ tag: highlight.tags.number, color: base0C },
|
|
293
|
+
{ tag: highlight.tags.changed, color: base0F },
|
|
294
|
+
{ tag: highlight.tags.annotation, color: base0B, fontStyle: 'italic' },
|
|
295
|
+
{ tag: highlight.tags.modifier, color: base0F, fontStyle: 'italic' },
|
|
296
|
+
{ tag: highlight.tags.self, color: base0F },
|
|
297
|
+
{ tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base0C },
|
|
298
|
+
{ tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0F },
|
|
299
|
+
// Strings and regex
|
|
300
|
+
{ tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: base07 },
|
|
301
|
+
{ tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: base0F },
|
|
302
|
+
{ tag: highlight.tags.string, color: base0E },
|
|
303
|
+
// Punctuation and structure
|
|
304
|
+
{ tag: highlight.tags.definition(highlight.tags.typeName), color: base0D, fontWeight: 'bold' },
|
|
305
|
+
{ tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0E },
|
|
306
|
+
// Comments and documentation
|
|
307
|
+
{ tag: highlight.tags.meta, color: base03 },
|
|
308
|
+
{ tag: highlight.tags.comment, fontStyle: 'italic', color: base03 },
|
|
309
|
+
{ tag: highlight.tags.docComment, fontStyle: 'italic', color: base03 },
|
|
310
|
+
// HTML/XML elements
|
|
311
|
+
{ tag: [highlight.tags.tagName], color: base0B },
|
|
312
|
+
{ tag: [highlight.tags.attributeName], color: base0D },
|
|
313
|
+
// Markdown and text formatting
|
|
314
|
+
{ tag: [highlight.tags.heading], fontWeight: 'bold', color: base09 },
|
|
315
|
+
{ tag: [highlight.tags.strong], fontWeight: 'bold', color: base08 },
|
|
316
|
+
{ tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base0D },
|
|
317
|
+
// Links and URLs
|
|
155
318
|
{
|
|
156
|
-
tag: highlight.tags.link,
|
|
157
|
-
color:
|
|
319
|
+
tag: [highlight.tags.link],
|
|
320
|
+
color: visitedLinkColor,
|
|
321
|
+
fontWeight: '500',
|
|
158
322
|
textDecoration: 'underline',
|
|
159
323
|
textUnderlinePosition: 'under',
|
|
160
324
|
},
|
|
161
325
|
{
|
|
162
|
-
tag: [highlight.tags.url
|
|
163
|
-
color:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{ tag: [highlight.tags.monospace], color: base04, fontStyle: 'italic' },
|
|
167
|
-
{ tag: [highlight.tags.comment], color: base03, fontStyle: 'italic' },
|
|
168
|
-
{ tag: highlight.tags.strong, fontWeight: 'bold', color: base0A },
|
|
169
|
-
{ tag: highlight.tags.emphasis, fontStyle: 'italic', color: base0A },
|
|
170
|
-
{ tag: highlight.tags.strikethrough, textDecoration: 'line-through' },
|
|
171
|
-
{ tag: highlight.tags.heading, fontWeight: 'bold', color: base0A },
|
|
172
|
-
{ tag: highlight.tags.special(highlight.tags.heading1), fontWeight: 'bold', color: base0A },
|
|
173
|
-
{ tag: highlight.tags.heading1, fontWeight: 'bold', color: base0A },
|
|
174
|
-
{
|
|
175
|
-
tag: [highlight.tags.heading2, highlight.tags.heading3, highlight.tags.heading4],
|
|
176
|
-
fontWeight: 'bold',
|
|
177
|
-
color: base0A,
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
tag: [highlight.tags.heading5, highlight.tags.heading6],
|
|
181
|
-
color: base0A,
|
|
182
|
-
},
|
|
183
|
-
{ tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0C },
|
|
184
|
-
{
|
|
185
|
-
tag: [highlight.tags.processingInstruction, highlight.tags.inserted],
|
|
186
|
-
color: base07,
|
|
326
|
+
tag: [highlight.tags.url],
|
|
327
|
+
color: linkColor,
|
|
328
|
+
textDecoration: 'underline',
|
|
329
|
+
textUnderlineOffset: '2px',
|
|
187
330
|
},
|
|
331
|
+
// Special states
|
|
188
332
|
{
|
|
189
|
-
tag: [highlight.tags.
|
|
190
|
-
color:
|
|
191
|
-
|
|
192
|
-
|
|
333
|
+
tag: [highlight.tags.invalid],
|
|
334
|
+
color: base04,
|
|
335
|
+
textDecoration: 'underline wavy',
|
|
336
|
+
borderBottom: `1px wavy ${base0B}`,
|
|
337
|
+
},
|
|
338
|
+
{ tag: [highlight.tags.strikethrough], color: base0B, textDecoration: 'line-through' },
|
|
339
|
+
// Enhanced syntax highlighting
|
|
340
|
+
{ tag: highlight.tags.constant(highlight.tags.name), color: base0C },
|
|
341
|
+
{ tag: highlight.tags.deleted, color: base0B },
|
|
342
|
+
{ tag: highlight.tags.squareBracket, color: base0B },
|
|
343
|
+
{ tag: highlight.tags.angleBracket, color: base0C },
|
|
344
|
+
// Additional specific styles
|
|
345
|
+
{ tag: highlight.tags.monospace, color: base04, fontStyle: 'italic' },
|
|
346
|
+
{ tag: [highlight.tags.contentSeparator], color: base09 },
|
|
347
|
+
{ tag: highlight.tags.quote, color: base0F },
|
|
193
348
|
]);
|
|
194
349
|
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*/
|
|
350
|
+
* Combined Nord theme extension
|
|
351
|
+
*/
|
|
198
352
|
const nord = [
|
|
199
353
|
nordTheme,
|
|
200
354
|
language.syntaxHighlighting(nordHighlightStyle),
|
package/dist/index.d.cts
CHANGED
|
@@ -2,17 +2,16 @@ import { Extension } from '@codemirror/state';
|
|
|
2
2
|
import { HighlightStyle } from '@codemirror/language';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
*/
|
|
5
|
+
* Enhanced editor theme styles for Nord
|
|
6
|
+
*/
|
|
7
7
|
declare const nordTheme: Extension;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
*/
|
|
9
|
+
* Enhanced syntax highlighting for Nord theme
|
|
10
|
+
*/
|
|
11
11
|
declare const nordHighlightStyle: HighlightStyle;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
13
|
+
* Combined Nord theme extension
|
|
14
|
+
*/
|
|
16
15
|
declare const nord: Extension;
|
|
17
16
|
|
|
18
17
|
export { nord, nordHighlightStyle, nordTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,17 +2,16 @@ import { Extension } from '@codemirror/state';
|
|
|
2
2
|
import { HighlightStyle } from '@codemirror/language';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
*/
|
|
5
|
+
* Enhanced editor theme styles for Nord
|
|
6
|
+
*/
|
|
7
7
|
declare const nordTheme: Extension;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
*/
|
|
9
|
+
* Enhanced syntax highlighting for Nord theme
|
|
10
|
+
*/
|
|
11
11
|
declare const nordHighlightStyle: HighlightStyle;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
13
|
+
* Combined Nord theme extension
|
|
14
|
+
*/
|
|
16
15
|
declare const nord: Extension;
|
|
17
16
|
|
|
18
17
|
export { nord, nordHighlightStyle, nordTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,80 +1,186 @@
|
|
|
1
1
|
import { EditorView } from '@codemirror/view';
|
|
2
2
|
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
3
3
|
import { tags } from '@lezer/highlight';
|
|
4
|
+
import { generalScroller, generalPlaceholder, generalMatching, generalTooltip, generalGutter, generalLine, generalPanel, generalSearchField, generalCursor, generalContent } from '@utils';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Enhanced Nord theme color definitions
|
|
8
|
+
* ------------------------------------
|
|
9
|
+
* Colors organized by function with visual color blocks
|
|
10
|
+
*/
|
|
6
11
|
// Polar Night
|
|
7
|
-
const base00 = '#2e3440'
|
|
8
|
-
base01 = '#3b4252'
|
|
9
|
-
base02 = '#434c5e'
|
|
12
|
+
const base00 = '#2e3440'; // Background - deep navy blue
|
|
13
|
+
const base01 = '#3b4252'; // Lighter background (popups, statuslines)
|
|
14
|
+
const base02 = '#434c5e'; // Selection background
|
|
15
|
+
const base03 = '#4c566a'; // Comments, invisibles
|
|
10
16
|
// Snow Storm
|
|
11
|
-
const base04 = '#d8dee9'
|
|
12
|
-
base05 = '#e5e9f0'
|
|
13
|
-
base06 = '#eceff4'; //
|
|
17
|
+
const base04 = '#d8dee9'; // Foreground - light blue-grey
|
|
18
|
+
// const base05 = '#e5e9f0'; // Light foreground
|
|
19
|
+
const base06 = '#eceff4'; // Light background
|
|
14
20
|
// Frost
|
|
15
|
-
const base07 = '#8fbcbb'
|
|
16
|
-
base08 = '#88c0d0'
|
|
17
|
-
base09 = '#81a1c1'
|
|
18
|
-
base0A = '#5e81ac'; //
|
|
21
|
+
const base07 = '#8fbcbb'; // Moss green - function names
|
|
22
|
+
const base08 = '#88c0d0'; // Ice blue - classes, attributes
|
|
23
|
+
const base09 = '#81a1c1'; // Water blue - methods
|
|
24
|
+
const base0A = '#5e81ac'; // Deep blue - keywords
|
|
19
25
|
// Aurora
|
|
20
|
-
const
|
|
21
|
-
base0C = '#d08770'
|
|
22
|
-
base0D = '#ebcb8b'
|
|
23
|
-
base0E = '#a3be8c'
|
|
24
|
-
base0F = '#b48ead'; //
|
|
25
|
-
|
|
26
|
+
const base0B = '#bf616a'; // Red - errors, brackets
|
|
27
|
+
const base0C = '#d08770'; // Orange - numbers, constants
|
|
28
|
+
const base0D = '#ebcb8b'; // Yellow - types, classes
|
|
29
|
+
const base0E = '#a3be8c'; // Green - strings
|
|
30
|
+
const base0F = '#b48ead'; // Purple - operators, special characters
|
|
31
|
+
// UI specific colors
|
|
32
|
+
const invalid = '#d30102'; // Bright red for errors
|
|
33
|
+
const darkBackground = '#252a33'; // Darker background for panels
|
|
34
|
+
const highlightBackground = '#3b425277'; // Active line highlight with opacity
|
|
35
|
+
const background = base00; // Main editor background
|
|
36
|
+
const tooltipBackground = base01; // Tooltip background
|
|
37
|
+
const selection = base02; // Selection background
|
|
38
|
+
const selectionMatch = '#4c566a80'; // Selection match with opacity
|
|
39
|
+
const cursor = base04; // Cursor color
|
|
40
|
+
const activeBracketBg = '#4c566a55'; // Active bracket background with opacity
|
|
41
|
+
const activeBracketBorder = base08; // Active bracket border - ice blue
|
|
42
|
+
const diagnosticWarning = base0D; // Warning color - yellow
|
|
43
|
+
const linkColor = base09; // Link color - water blue
|
|
44
|
+
const visitedLinkColor = base0F; // Visited link color - purple
|
|
26
45
|
/**
|
|
27
|
-
|
|
28
|
-
*/
|
|
46
|
+
* Enhanced editor theme styles for Nord
|
|
47
|
+
*/
|
|
29
48
|
const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
49
|
+
// Base editor styles
|
|
30
50
|
'&': {
|
|
31
51
|
color: base04,
|
|
32
52
|
backgroundColor: background,
|
|
53
|
+
fontSize: generalContent.fontSize,
|
|
54
|
+
fontFamily: generalContent.fontFamily,
|
|
33
55
|
},
|
|
56
|
+
// Content and cursor
|
|
34
57
|
'.cm-content': {
|
|
35
58
|
caretColor: cursor,
|
|
59
|
+
lineHeight: generalContent.lineHeight,
|
|
60
|
+
},
|
|
61
|
+
'.cm-cursor, .cm-dropCursor': {
|
|
62
|
+
borderLeftColor: cursor,
|
|
63
|
+
borderLeftWidth: generalCursor.borderLeftWidth,
|
|
64
|
+
},
|
|
65
|
+
'.cm-fat-cursor': {
|
|
66
|
+
backgroundColor: `${cursor}99`,
|
|
67
|
+
color: background,
|
|
36
68
|
},
|
|
37
|
-
|
|
38
|
-
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
69
|
+
// Selection
|
|
70
|
+
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
71
|
+
backgroundColor: selection,
|
|
72
|
+
},
|
|
73
|
+
// Make sure selection appears above active line
|
|
74
|
+
'.cm-selectionLayer': {
|
|
75
|
+
zIndex: 100,
|
|
76
|
+
},
|
|
77
|
+
// Search functionality
|
|
42
78
|
'.cm-searchMatch': {
|
|
43
|
-
backgroundColor: '
|
|
79
|
+
backgroundColor: '#5e81ac80',
|
|
44
80
|
outline: `1px solid ${base07}`,
|
|
81
|
+
color: base04,
|
|
82
|
+
borderRadius: generalSearchField.borderRadius,
|
|
83
|
+
'& span': {
|
|
84
|
+
color: base04,
|
|
85
|
+
},
|
|
45
86
|
},
|
|
46
87
|
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
47
|
-
backgroundColor:
|
|
48
|
-
color:
|
|
88
|
+
backgroundColor: base09,
|
|
89
|
+
color: base06,
|
|
90
|
+
padding: generalSearchField.padding,
|
|
91
|
+
'& span': {
|
|
92
|
+
color: base06,
|
|
93
|
+
},
|
|
49
94
|
},
|
|
50
|
-
'.cm-
|
|
51
|
-
|
|
52
|
-
|
|
95
|
+
'.cm-search.cm-panel.cm-textfield': {
|
|
96
|
+
color: base04,
|
|
97
|
+
borderRadius: generalSearchField.borderRadius,
|
|
98
|
+
padding: generalSearchField.padding,
|
|
53
99
|
},
|
|
54
|
-
|
|
55
|
-
|
|
100
|
+
// Panels
|
|
101
|
+
'.cm-panels': {
|
|
102
|
+
backgroundColor: darkBackground,
|
|
103
|
+
color: base04,
|
|
104
|
+
borderRadius: '4px',
|
|
105
|
+
},
|
|
106
|
+
'.cm-panels.cm-panels-top': {
|
|
107
|
+
borderBottom: `1px solid ${base03}`,
|
|
108
|
+
},
|
|
109
|
+
'.cm-panels.cm-panels-bottom': {
|
|
110
|
+
borderTop: `1px solid ${base03}`,
|
|
111
|
+
},
|
|
112
|
+
'.cm-panel button': {
|
|
113
|
+
backgroundColor: tooltipBackground,
|
|
114
|
+
color: base04,
|
|
115
|
+
border: generalPanel.border,
|
|
116
|
+
borderRadius: generalPanel.borderRadius,
|
|
117
|
+
padding: generalPanel.padding,
|
|
118
|
+
},
|
|
119
|
+
'.cm-panel button:hover': {
|
|
120
|
+
backgroundColor: base02,
|
|
56
121
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
122
|
+
// Line highlighting
|
|
123
|
+
'.cm-activeLine': {
|
|
124
|
+
backgroundColor: highlightBackground,
|
|
125
|
+
borderRadius: generalLine.borderRadius,
|
|
126
|
+
zIndex: 1,
|
|
60
127
|
},
|
|
128
|
+
// Gutters
|
|
61
129
|
'.cm-gutters': {
|
|
62
|
-
backgroundColor:
|
|
130
|
+
backgroundColor: darkBackground,
|
|
63
131
|
color: base03,
|
|
64
|
-
border:
|
|
132
|
+
border: generalGutter.border,
|
|
133
|
+
borderRight: `1px solid ${base02}`,
|
|
134
|
+
paddingRight: generalGutter.paddingRight,
|
|
65
135
|
},
|
|
66
136
|
'.cm-activeLineGutter': {
|
|
67
|
-
backgroundColor:
|
|
137
|
+
backgroundColor: base01,
|
|
68
138
|
color: base04,
|
|
139
|
+
fontWeight: generalGutter.fontWeight,
|
|
69
140
|
},
|
|
70
|
-
'.cm-
|
|
71
|
-
|
|
72
|
-
border: 'none',
|
|
73
|
-
color: '#ddd',
|
|
141
|
+
'.cm-lineNumbers': {
|
|
142
|
+
fontSize: generalGutter.fontSize,
|
|
74
143
|
},
|
|
144
|
+
'.cm-foldGutter': {
|
|
145
|
+
fontSize: generalGutter.fontSize,
|
|
146
|
+
},
|
|
147
|
+
'.cm-foldGutter .cm-gutterElement': {
|
|
148
|
+
color: base03,
|
|
149
|
+
cursor: 'pointer',
|
|
150
|
+
},
|
|
151
|
+
'.cm-foldGutter .cm-gutterElement:hover': {
|
|
152
|
+
color: base04,
|
|
153
|
+
},
|
|
154
|
+
// Tooltips and autocomplete
|
|
75
155
|
'.cm-tooltip': {
|
|
76
|
-
border: 'none',
|
|
77
156
|
backgroundColor: tooltipBackground,
|
|
157
|
+
border: `1px solid ${base03}`,
|
|
158
|
+
borderRadius: generalTooltip.borderRadius,
|
|
159
|
+
padding: generalTooltip.padding,
|
|
160
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
|
|
161
|
+
},
|
|
162
|
+
'.cm-tooltip-autocomplete': {
|
|
163
|
+
'& > ul': {
|
|
164
|
+
backgroundColor: tooltipBackground,
|
|
165
|
+
border: 'none',
|
|
166
|
+
},
|
|
167
|
+
'& > ul > li': {
|
|
168
|
+
padding: generalTooltip.padding,
|
|
169
|
+
lineHeight: generalTooltip.lineHeight,
|
|
170
|
+
},
|
|
171
|
+
'& > ul > li[aria-selected]': {
|
|
172
|
+
backgroundColor: base02,
|
|
173
|
+
color: base06,
|
|
174
|
+
borderRadius: generalTooltip.borderRadiusSelected,
|
|
175
|
+
},
|
|
176
|
+
'& > ul > li > span.cm-completionIcon': {
|
|
177
|
+
color: base03,
|
|
178
|
+
paddingRight: generalTooltip.paddingRight,
|
|
179
|
+
},
|
|
180
|
+
'& > ul > li > span.cm-completionDetail': {
|
|
181
|
+
color: base03,
|
|
182
|
+
fontStyle: 'italic',
|
|
183
|
+
},
|
|
78
184
|
},
|
|
79
185
|
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
80
186
|
borderTopColor: 'transparent',
|
|
@@ -84,115 +190,163 @@ const nordTheme = /*@__PURE__*/EditorView.theme({
|
|
|
84
190
|
borderTopColor: tooltipBackground,
|
|
85
191
|
borderBottomColor: tooltipBackground,
|
|
86
192
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
193
|
+
// Diagnostics styling
|
|
194
|
+
'.cm-diagnostic': {
|
|
195
|
+
'&-error': {
|
|
196
|
+
borderLeft: `3px solid ${base0B}`,
|
|
197
|
+
},
|
|
198
|
+
'&-warning': {
|
|
199
|
+
borderLeft: `3px solid ${diagnosticWarning}`,
|
|
200
|
+
},
|
|
201
|
+
'&-info': {
|
|
202
|
+
borderLeft: `3px solid ${linkColor}`,
|
|
91
203
|
},
|
|
92
204
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
The highlighting style for code in the Nord theme.
|
|
96
|
-
*/
|
|
97
|
-
const nordHighlightStyle = /*@__PURE__*/HighlightStyle.define([
|
|
98
|
-
{ tag: tags.keyword, color: base0A },
|
|
99
|
-
{
|
|
100
|
-
tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
|
|
101
|
-
color: base08,
|
|
102
|
-
},
|
|
103
|
-
{ tag: [tags.variableName], color: base07 },
|
|
104
|
-
{ tag: [/*@__PURE__*/tags.function(tags.variableName)], color: base07 },
|
|
105
|
-
{ tag: [tags.labelName], color: base09 },
|
|
106
|
-
{
|
|
107
|
-
tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)],
|
|
108
|
-
color: base0A,
|
|
109
|
-
},
|
|
110
|
-
{ tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base0E },
|
|
111
|
-
{ tag: [tags.brace], color: base07 },
|
|
112
|
-
{
|
|
113
|
-
tag: [tags.annotation],
|
|
114
|
-
color: invalid,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
tag: [tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
|
|
118
|
-
color: base0F,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
tag: [tags.typeName, tags.className],
|
|
122
|
-
color: base0D,
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
tag: [tags.operator, tags.operatorKeyword],
|
|
126
|
-
color: base0E,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
tag: [tags.tagName],
|
|
130
|
-
color: base0F,
|
|
205
|
+
'.cm-lintPoint-error': {
|
|
206
|
+
borderBottom: `2px wavy ${base0B}`,
|
|
131
207
|
},
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
color: base0b,
|
|
208
|
+
'.cm-lintPoint-warning': {
|
|
209
|
+
borderBottom: `2px wavy ${diagnosticWarning}`,
|
|
135
210
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
211
|
+
// Matching brackets
|
|
212
|
+
'.cm-matchingBracket': {
|
|
213
|
+
backgroundColor: activeBracketBg,
|
|
214
|
+
outline: `1px solid ${activeBracketBorder}`,
|
|
215
|
+
borderRadius: generalMatching.borderRadius,
|
|
139
216
|
},
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
217
|
+
'.cm-nonmatchingBracket': {
|
|
218
|
+
backgroundColor: `${base0B}40`,
|
|
219
|
+
outline: `1px solid ${invalid}`,
|
|
220
|
+
borderRadius: generalMatching.borderRadius,
|
|
143
221
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
222
|
+
// Selection matches
|
|
223
|
+
'.cm-selectionMatch': {
|
|
224
|
+
backgroundColor: selectionMatch,
|
|
225
|
+
outline: `1px solid ${base02}50`,
|
|
226
|
+
borderRadius: generalMatching.borderRadius,
|
|
147
227
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
228
|
+
// Fold placeholder
|
|
229
|
+
'.cm-foldPlaceholder': {
|
|
230
|
+
backgroundColor: tooltipBackground,
|
|
231
|
+
color: base03,
|
|
232
|
+
border: `1px dotted ${base03}70`,
|
|
233
|
+
borderRadius: generalPlaceholder.borderRadius,
|
|
234
|
+
padding: generalPlaceholder.padding,
|
|
235
|
+
margin: generalPlaceholder.margin,
|
|
236
|
+
},
|
|
237
|
+
// Focus outline
|
|
238
|
+
'&.cm-focused': {
|
|
239
|
+
outline: 'none',
|
|
240
|
+
boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base08}40`,
|
|
241
|
+
},
|
|
242
|
+
// Scrollbars
|
|
243
|
+
'& .cm-scroller::-webkit-scrollbar': {
|
|
244
|
+
width: generalScroller.width,
|
|
245
|
+
height: generalScroller.height,
|
|
246
|
+
},
|
|
247
|
+
'& .cm-scroller::-webkit-scrollbar-track': {
|
|
248
|
+
background: darkBackground,
|
|
249
|
+
},
|
|
250
|
+
'& .cm-scroller::-webkit-scrollbar-thumb': {
|
|
251
|
+
backgroundColor: base02,
|
|
252
|
+
borderRadius: generalScroller.borderRadius,
|
|
253
|
+
border: `3px solid ${darkBackground}`,
|
|
254
|
+
},
|
|
255
|
+
'& .cm-scroller::-webkit-scrollbar-thumb:hover': {
|
|
256
|
+
backgroundColor: base03,
|
|
257
|
+
},
|
|
258
|
+
// Ghost text
|
|
259
|
+
'.cm-ghostText': {
|
|
260
|
+
opacity: '0.5',
|
|
261
|
+
color: base03,
|
|
151
262
|
},
|
|
152
|
-
|
|
263
|
+
}, { dark: true });
|
|
264
|
+
/**
|
|
265
|
+
* Enhanced syntax highlighting for Nord theme
|
|
266
|
+
*/
|
|
267
|
+
const nordHighlightStyle = /*@__PURE__*/HighlightStyle.define([
|
|
268
|
+
// Keywords and control flow
|
|
269
|
+
{ tag: tags.keyword, color: base0A, fontWeight: 'bold' },
|
|
270
|
+
{ tag: tags.controlKeyword, color: base0A, fontWeight: 'bold' },
|
|
271
|
+
{ tag: tags.moduleKeyword, color: base0A, fontWeight: 'bold' },
|
|
272
|
+
// Names and variables
|
|
273
|
+
{ tag: [tags.name, tags.deleted, tags.character, tags.macroName], color: base08 },
|
|
274
|
+
{ tag: [tags.variableName], color: base04 },
|
|
275
|
+
{ tag: [tags.propertyName], color: base08, fontStyle: 'normal' },
|
|
276
|
+
// Classes and types
|
|
277
|
+
{ tag: [tags.typeName], color: base0D },
|
|
278
|
+
{ tag: [tags.className], color: base0D, fontStyle: 'italic' },
|
|
279
|
+
{ tag: [tags.namespace], color: base09, fontStyle: 'italic' },
|
|
280
|
+
// Operators and punctuation
|
|
281
|
+
{ tag: [tags.operator, tags.operatorKeyword], color: base0F },
|
|
282
|
+
{ tag: [tags.bracket], color: base04 },
|
|
283
|
+
{ tag: [tags.brace], color: base07 },
|
|
284
|
+
{ tag: [tags.punctuation], color: base04 },
|
|
285
|
+
// Functions and parameters
|
|
286
|
+
{ tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color: base07 },
|
|
287
|
+
{ tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color: base07 },
|
|
288
|
+
{ tag: [/*@__PURE__*/tags.definition(tags.variableName)], color: base0C },
|
|
289
|
+
// Constants and literals
|
|
290
|
+
{ tag: tags.number, color: base0C },
|
|
291
|
+
{ tag: tags.changed, color: base0F },
|
|
292
|
+
{ tag: tags.annotation, color: base0B, fontStyle: 'italic' },
|
|
293
|
+
{ tag: tags.modifier, color: base0F, fontStyle: 'italic' },
|
|
294
|
+
{ tag: tags.self, color: base0F },
|
|
295
|
+
{ tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: base0C },
|
|
296
|
+
{ tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0F },
|
|
297
|
+
// Strings and regex
|
|
298
|
+
{ tag: [tags.processingInstruction, tags.inserted], color: base07 },
|
|
299
|
+
{ tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color: base0F },
|
|
300
|
+
{ tag: tags.string, color: base0E },
|
|
301
|
+
// Punctuation and structure
|
|
302
|
+
{ tag: /*@__PURE__*/tags.definition(tags.typeName), color: base0D, fontWeight: 'bold' },
|
|
303
|
+
{ tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base0E },
|
|
304
|
+
// Comments and documentation
|
|
305
|
+
{ tag: tags.meta, color: base03 },
|
|
306
|
+
{ tag: tags.comment, fontStyle: 'italic', color: base03 },
|
|
307
|
+
{ tag: tags.docComment, fontStyle: 'italic', color: base03 },
|
|
308
|
+
// HTML/XML elements
|
|
309
|
+
{ tag: [tags.tagName], color: base0B },
|
|
310
|
+
{ tag: [tags.attributeName], color: base0D },
|
|
311
|
+
// Markdown and text formatting
|
|
312
|
+
{ tag: [tags.heading], fontWeight: 'bold', color: base09 },
|
|
313
|
+
{ tag: [tags.strong], fontWeight: 'bold', color: base08 },
|
|
314
|
+
{ tag: [tags.emphasis], fontStyle: 'italic', color: base0D },
|
|
315
|
+
// Links and URLs
|
|
153
316
|
{
|
|
154
|
-
tag: tags.link,
|
|
155
|
-
color:
|
|
317
|
+
tag: [tags.link],
|
|
318
|
+
color: visitedLinkColor,
|
|
319
|
+
fontWeight: '500',
|
|
156
320
|
textDecoration: 'underline',
|
|
157
321
|
textUnderlinePosition: 'under',
|
|
158
322
|
},
|
|
159
323
|
{
|
|
160
|
-
tag: [tags.url
|
|
161
|
-
color:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
{ tag: [tags.monospace], color: base04, fontStyle: 'italic' },
|
|
165
|
-
{ tag: [tags.comment], color: base03, fontStyle: 'italic' },
|
|
166
|
-
{ tag: tags.strong, fontWeight: 'bold', color: base0A },
|
|
167
|
-
{ tag: tags.emphasis, fontStyle: 'italic', color: base0A },
|
|
168
|
-
{ tag: tags.strikethrough, textDecoration: 'line-through' },
|
|
169
|
-
{ tag: tags.heading, fontWeight: 'bold', color: base0A },
|
|
170
|
-
{ tag: /*@__PURE__*/tags.special(tags.heading1), fontWeight: 'bold', color: base0A },
|
|
171
|
-
{ tag: tags.heading1, fontWeight: 'bold', color: base0A },
|
|
172
|
-
{
|
|
173
|
-
tag: [tags.heading2, tags.heading3, tags.heading4],
|
|
174
|
-
fontWeight: 'bold',
|
|
175
|
-
color: base0A,
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
tag: [tags.heading5, tags.heading6],
|
|
179
|
-
color: base0A,
|
|
180
|
-
},
|
|
181
|
-
{ tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0C },
|
|
182
|
-
{
|
|
183
|
-
tag: [tags.processingInstruction, tags.inserted],
|
|
184
|
-
color: base07,
|
|
324
|
+
tag: [tags.url],
|
|
325
|
+
color: linkColor,
|
|
326
|
+
textDecoration: 'underline',
|
|
327
|
+
textUnderlineOffset: '2px',
|
|
185
328
|
},
|
|
329
|
+
// Special states
|
|
186
330
|
{
|
|
187
|
-
tag: [tags.
|
|
188
|
-
color:
|
|
189
|
-
|
|
190
|
-
|
|
331
|
+
tag: [tags.invalid],
|
|
332
|
+
color: base04,
|
|
333
|
+
textDecoration: 'underline wavy',
|
|
334
|
+
borderBottom: `1px wavy ${base0B}`,
|
|
335
|
+
},
|
|
336
|
+
{ tag: [tags.strikethrough], color: base0B, textDecoration: 'line-through' },
|
|
337
|
+
// Enhanced syntax highlighting
|
|
338
|
+
{ tag: /*@__PURE__*/tags.constant(tags.name), color: base0C },
|
|
339
|
+
{ tag: tags.deleted, color: base0B },
|
|
340
|
+
{ tag: tags.squareBracket, color: base0B },
|
|
341
|
+
{ tag: tags.angleBracket, color: base0C },
|
|
342
|
+
// Additional specific styles
|
|
343
|
+
{ tag: tags.monospace, color: base04, fontStyle: 'italic' },
|
|
344
|
+
{ tag: [tags.contentSeparator], color: base09 },
|
|
345
|
+
{ tag: tags.quote, color: base0F },
|
|
191
346
|
]);
|
|
192
347
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
*/
|
|
348
|
+
* Combined Nord theme extension
|
|
349
|
+
*/
|
|
196
350
|
const nord = [
|
|
197
351
|
nordTheme,
|
|
198
352
|
/*@__PURE__*/syntaxHighlighting(nordHighlightStyle),
|