@fresh-editor/fresh-editor 0.3.2 → 0.3.4

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.
@@ -1,41 +1,436 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "ThemeFile",
4
- "description": "Serializable theme definition (matches JSON structure)",
4
+ "description": "Serializable theme definition (matches JSON structure)\n\nThe five color sections (`editor`, `ui`, `search`, `diagnostic`, `syntax`)\nare all optional. Every leaf field within each section already has a\n`#[serde(default = \"…\")]` fallback, so a theme JSON only needs to specify\nthe colors it cares about. This matches the minimal example shipped in\n`docs/features/themes.md` and unblocks user-authored themes that override\njust `editor`/`syntax` (issue #1281).\n\n**Inheritance**: when a theme omits whole sections, the unset fields are\nresolved against a *base* theme rather than against the per-field hardcoded\nfallback. The base is chosen in this order:\n\n1. Explicit `extends` field (`\"builtin://light\"`, `\"dark\"`, etc.).\n2. If `editor.bg` is provided, the relative-luminance of that color picks\n `builtin://light` or `builtin://dark` automatically — so a user theme\n that sets a cream background gets light UI chrome without any extra\n configuration.\n3. Otherwise, fall through to the per-field hardcoded defaults.\n\nOnly built-in themes are valid `extends` targets in this version. Chained\ninheritance across user themes is intentionally out of scope here.",
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "name": {
8
8
  "description": "Theme name",
9
9
  "type": "string"
10
10
  },
11
+ "extends": {
12
+ "description": "Optional base theme to inherit from. Accepts `\"builtin://NAME\"` or a\nbare built-in name (e.g. `\"dark\"`, `\"light\"`, `\"high-contrast\"`).\nWhen set, every field this theme does not specify is taken from the\nbase; explicit fields override the base. See [`ThemeFile`] for the\nfull inheritance resolution order.",
13
+ "type": [
14
+ "string",
15
+ "null"
16
+ ]
17
+ },
11
18
  "editor": {
12
19
  "description": "Editor area colors",
13
- "$ref": "#/$defs/EditorColors"
20
+ "$ref": "#/$defs/EditorColors",
21
+ "default": {
22
+ "bg": [
23
+ 30,
24
+ 30,
25
+ 30
26
+ ],
27
+ "fg": [
28
+ 212,
29
+ 212,
30
+ 212
31
+ ],
32
+ "cursor": [
33
+ 255,
34
+ 255,
35
+ 255
36
+ ],
37
+ "inactive_cursor": "DarkGray",
38
+ "selection_bg": [
39
+ 38,
40
+ 79,
41
+ 120
42
+ ],
43
+ "current_line_bg": [
44
+ 40,
45
+ 40,
46
+ 40
47
+ ],
48
+ "line_number_fg": [
49
+ 100,
50
+ 100,
51
+ 100
52
+ ],
53
+ "line_number_bg": [
54
+ 30,
55
+ 30,
56
+ 30
57
+ ],
58
+ "diff_add_bg": [
59
+ 35,
60
+ 60,
61
+ 35
62
+ ],
63
+ "diff_remove_bg": [
64
+ 70,
65
+ 35,
66
+ 35
67
+ ],
68
+ "diff_add_highlight_bg": null,
69
+ "diff_remove_highlight_bg": null,
70
+ "diff_modify_bg": [
71
+ 40,
72
+ 38,
73
+ 30
74
+ ],
75
+ "ruler_bg": [
76
+ 50,
77
+ 50,
78
+ 50
79
+ ],
80
+ "whitespace_indicator_fg": [
81
+ 70,
82
+ 70,
83
+ 70
84
+ ],
85
+ "after_eof_bg": null
86
+ }
14
87
  },
15
88
  "ui": {
16
89
  "description": "UI element colors (tabs, menus, status bar, etc.)",
17
- "$ref": "#/$defs/UiColors"
90
+ "$ref": "#/$defs/UiColors",
91
+ "default": {
92
+ "tab_active_fg": "Yellow",
93
+ "tab_active_bg": "Blue",
94
+ "tab_inactive_fg": "White",
95
+ "tab_inactive_bg": "DarkGray",
96
+ "tab_separator_bg": "Black",
97
+ "tab_close_hover_fg": [
98
+ 255,
99
+ 100,
100
+ 100
101
+ ],
102
+ "tab_hover_bg": [
103
+ 70,
104
+ 70,
105
+ 75
106
+ ],
107
+ "menu_bg": [
108
+ 60,
109
+ 60,
110
+ 65
111
+ ],
112
+ "menu_fg": [
113
+ 220,
114
+ 220,
115
+ 220
116
+ ],
117
+ "menu_active_bg": [
118
+ 60,
119
+ 60,
120
+ 60
121
+ ],
122
+ "menu_active_fg": [
123
+ 255,
124
+ 255,
125
+ 255
126
+ ],
127
+ "menu_dropdown_bg": [
128
+ 50,
129
+ 50,
130
+ 50
131
+ ],
132
+ "menu_dropdown_fg": [
133
+ 220,
134
+ 220,
135
+ 220
136
+ ],
137
+ "menu_highlight_bg": [
138
+ 70,
139
+ 130,
140
+ 180
141
+ ],
142
+ "menu_highlight_fg": [
143
+ 255,
144
+ 255,
145
+ 255
146
+ ],
147
+ "menu_border_fg": [
148
+ 100,
149
+ 100,
150
+ 100
151
+ ],
152
+ "menu_separator_fg": [
153
+ 80,
154
+ 80,
155
+ 80
156
+ ],
157
+ "menu_hover_bg": [
158
+ 55,
159
+ 55,
160
+ 55
161
+ ],
162
+ "menu_hover_fg": [
163
+ 255,
164
+ 255,
165
+ 255
166
+ ],
167
+ "menu_disabled_fg": [
168
+ 100,
169
+ 100,
170
+ 100
171
+ ],
172
+ "menu_disabled_bg": [
173
+ 50,
174
+ 50,
175
+ 50
176
+ ],
177
+ "status_bar_fg": "White",
178
+ "status_bar_bg": "DarkGray",
179
+ "status_palette_fg": null,
180
+ "status_palette_bg": null,
181
+ "status_lsp_on_fg": null,
182
+ "status_lsp_on_bg": null,
183
+ "prompt_fg": "White",
184
+ "prompt_bg": "Black",
185
+ "prompt_selection_fg": "White",
186
+ "prompt_selection_bg": [
187
+ 58,
188
+ 79,
189
+ 120
190
+ ],
191
+ "popup_border_fg": "Gray",
192
+ "popup_bg": [
193
+ 30,
194
+ 30,
195
+ 30
196
+ ],
197
+ "popup_selection_bg": [
198
+ 58,
199
+ 79,
200
+ 120
201
+ ],
202
+ "popup_selection_fg": [
203
+ 255,
204
+ 255,
205
+ 255
206
+ ],
207
+ "popup_text_fg": "White",
208
+ "suggestion_bg": [
209
+ 30,
210
+ 30,
211
+ 30
212
+ ],
213
+ "suggestion_selected_bg": [
214
+ 58,
215
+ 79,
216
+ 120
217
+ ],
218
+ "help_bg": "Black",
219
+ "help_fg": "White",
220
+ "help_key_fg": "Cyan",
221
+ "help_separator_fg": "DarkGray",
222
+ "help_indicator_fg": "Red",
223
+ "help_indicator_bg": "Black",
224
+ "inline_code_bg": "DarkGray",
225
+ "split_separator_fg": [
226
+ 100,
227
+ 100,
228
+ 100
229
+ ],
230
+ "split_separator_hover_fg": [
231
+ 100,
232
+ 149,
233
+ 237
234
+ ],
235
+ "scrollbar_track_fg": "DarkGray",
236
+ "scrollbar_thumb_fg": "Gray",
237
+ "scrollbar_track_hover_fg": "Gray",
238
+ "scrollbar_thumb_hover_fg": "White",
239
+ "compose_margin_bg": [
240
+ 18,
241
+ 18,
242
+ 18
243
+ ],
244
+ "semantic_highlight_bg": [
245
+ 60,
246
+ 60,
247
+ 80
248
+ ],
249
+ "terminal_bg": "Default",
250
+ "terminal_fg": "Default",
251
+ "status_warning_indicator_bg": [
252
+ 181,
253
+ 137,
254
+ 0
255
+ ],
256
+ "status_warning_indicator_fg": [
257
+ 0,
258
+ 0,
259
+ 0
260
+ ],
261
+ "status_error_indicator_bg": [
262
+ 220,
263
+ 50,
264
+ 47
265
+ ],
266
+ "status_error_indicator_fg": [
267
+ 255,
268
+ 255,
269
+ 255
270
+ ],
271
+ "status_warning_indicator_hover_bg": [
272
+ 211,
273
+ 167,
274
+ 30
275
+ ],
276
+ "status_warning_indicator_hover_fg": [
277
+ 0,
278
+ 0,
279
+ 0
280
+ ],
281
+ "status_error_indicator_hover_bg": [
282
+ 250,
283
+ 80,
284
+ 77
285
+ ],
286
+ "status_error_indicator_hover_fg": [
287
+ 255,
288
+ 255,
289
+ 255
290
+ ],
291
+ "tab_drop_zone_bg": [
292
+ 70,
293
+ 130,
294
+ 180
295
+ ],
296
+ "tab_drop_zone_border": [
297
+ 100,
298
+ 149,
299
+ 237
300
+ ],
301
+ "settings_selected_bg": [
302
+ 60,
303
+ 60,
304
+ 70
305
+ ],
306
+ "settings_selected_fg": [
307
+ 255,
308
+ 255,
309
+ 255
310
+ ],
311
+ "file_status_added_fg": null,
312
+ "file_status_modified_fg": null,
313
+ "file_status_deleted_fg": null,
314
+ "file_status_renamed_fg": null,
315
+ "file_status_untracked_fg": null,
316
+ "file_status_conflicted_fg": null
317
+ }
18
318
  },
19
319
  "search": {
20
320
  "description": "Search result highlighting colors",
21
- "$ref": "#/$defs/SearchColors"
321
+ "$ref": "#/$defs/SearchColors",
322
+ "default": {
323
+ "match_bg": [
324
+ 100,
325
+ 100,
326
+ 20
327
+ ],
328
+ "match_fg": [
329
+ 255,
330
+ 255,
331
+ 255
332
+ ],
333
+ "label_bg": [
334
+ 199,
335
+ 78,
336
+ 189
337
+ ],
338
+ "label_fg": [
339
+ 255,
340
+ 255,
341
+ 255
342
+ ]
343
+ }
22
344
  },
23
345
  "diagnostic": {
24
346
  "description": "LSP diagnostic colors (errors, warnings, etc.)",
25
- "$ref": "#/$defs/DiagnosticColors"
347
+ "$ref": "#/$defs/DiagnosticColors",
348
+ "default": {
349
+ "error_fg": "Red",
350
+ "error_bg": [
351
+ 60,
352
+ 20,
353
+ 20
354
+ ],
355
+ "warning_fg": "Yellow",
356
+ "warning_bg": [
357
+ 60,
358
+ 50,
359
+ 0
360
+ ],
361
+ "info_fg": "Blue",
362
+ "info_bg": [
363
+ 0,
364
+ 30,
365
+ 60
366
+ ],
367
+ "hint_fg": "Gray",
368
+ "hint_bg": [
369
+ 30,
370
+ 30,
371
+ 30
372
+ ]
373
+ }
26
374
  },
27
375
  "syntax": {
28
376
  "description": "Syntax highlighting colors",
29
- "$ref": "#/$defs/SyntaxColors"
377
+ "$ref": "#/$defs/SyntaxColors",
378
+ "default": {
379
+ "keyword": [
380
+ 86,
381
+ 156,
382
+ 214
383
+ ],
384
+ "string": [
385
+ 206,
386
+ 145,
387
+ 120
388
+ ],
389
+ "comment": [
390
+ 106,
391
+ 153,
392
+ 85
393
+ ],
394
+ "function": [
395
+ 220,
396
+ 220,
397
+ 170
398
+ ],
399
+ "type": [
400
+ 78,
401
+ 201,
402
+ 176
403
+ ],
404
+ "variable": [
405
+ 156,
406
+ 220,
407
+ 254
408
+ ],
409
+ "constant": [
410
+ 79,
411
+ 193,
412
+ 255
413
+ ],
414
+ "operator": [
415
+ 212,
416
+ 212,
417
+ 212
418
+ ],
419
+ "punctuation_bracket": [
420
+ 212,
421
+ 212,
422
+ 212
423
+ ],
424
+ "punctuation_delimiter": [
425
+ 212,
426
+ 212,
427
+ 212
428
+ ]
429
+ }
30
430
  }
31
431
  },
32
432
  "required": [
33
- "name",
34
- "editor",
35
- "ui",
36
- "search",
37
- "diagnostic",
38
- "syntax"
433
+ "name"
39
434
  ],
40
435
  "$defs": {
41
436
  "EditorColors": {
@@ -83,6 +478,18 @@
83
478
  120
84
479
  ]
85
480
  },
481
+ "selection_modifier": {
482
+ "description": "Optional text-attribute modifiers (e.g. `[\"reversed\"]`) layered\non top of `selection_bg`. Themes that want a terminal-adaptive\nvisual selection (the canonical pattern for native-palette\nthemes — vim/neovim Visual, helix term16, htop, less) set\n`[\"reversed\"]` here; the renderer ORs `Modifier::REVERSED` into\nthe selected cells, which works on any terminal because it\ninverts whatever fg/bg the terminal already uses.",
483
+ "anyOf": [
484
+ {
485
+ "$ref": "#/$defs/ModifierDef"
486
+ },
487
+ {
488
+ "type": "null"
489
+ }
490
+ ],
491
+ "default": null
492
+ },
86
493
  "current_line_bg": {
87
494
  "description": "Background of the line containing cursor",
88
495
  "$ref": "#/$defs/ColorDef",
@@ -228,6 +635,13 @@
228
635
  }
229
636
  ]
230
637
  },
638
+ "ModifierDef": {
639
+ "description": "Serializable text-attribute modifier list.\n\nLets a theme specify SGR text attributes (reverse video, bold,\nitalic, underline, dim) on top of fg/bg colors. Designed for\nterminal-adaptive themes that want to use `[\"reversed\"]` on the\nvisual selection — the canonical pattern documented for native-\npalette themes (vim/neovim Visual mode, helix term16, htop, less)\nbecause reverse video automatically inverts the terminal's\ncurrent fg/bg and so adapts to both light and dark backgrounds\nwithout a separate variant.\n\nJSON form: `[\"reversed\"]` or `[\"bold\", \"underlined\"]`. Unknown\nstrings are silently dropped so a typo can't crash a render.",
640
+ "type": "array",
641
+ "items": {
642
+ "type": "string"
643
+ }
644
+ },
231
645
  "UiColors": {
232
646
  "description": "UI element colors (tabs, menus, status bar, etc.)",
233
647
  "type": "object",
@@ -459,6 +873,30 @@
459
873
  ],
460
874
  "default": null
461
875
  },
876
+ "status_lsp_actionable_fg": {
877
+ "description": "Status bar LSP indicator text color when LSP options are available\nto act on (configured-but-not-running). Drawn prominently to signal\n\"click here to enable\". Falls back to `status_warning_indicator_fg`.",
878
+ "anyOf": [
879
+ {
880
+ "$ref": "#/$defs/ColorDef"
881
+ },
882
+ {
883
+ "type": "null"
884
+ }
885
+ ],
886
+ "default": null
887
+ },
888
+ "status_lsp_actionable_bg": {
889
+ "description": "Status bar LSP indicator background when LSP options are available\nto act on. Falls back to `status_warning_indicator_bg`.",
890
+ "anyOf": [
891
+ {
892
+ "$ref": "#/$defs/ColorDef"
893
+ },
894
+ {
895
+ "type": "null"
896
+ }
897
+ ],
898
+ "default": null
899
+ },
462
900
  "prompt_fg": {
463
901
  "description": "Command prompt text color",
464
902
  "$ref": "#/$defs/ColorDef",
@@ -629,6 +1067,18 @@
629
1067
  80
630
1068
  ]
631
1069
  },
1070
+ "semantic_highlight_modifier": {
1071
+ "description": "Optional text-attribute modifiers (e.g. `[\"bold\"]` or\n`[\"reversed\"]`) layered on top of `semantic_highlight_bg`.\nPer the canonical native-palette pattern, current-word\nhighlights are often shown via `Bold` (so the word stands\nout against other variables without altering its color slot)\nor `Reversed`. See `EditorColors::selection_modifier`.",
1072
+ "anyOf": [
1073
+ {
1074
+ "$ref": "#/$defs/ModifierDef"
1075
+ },
1076
+ {
1077
+ "type": "null"
1078
+ }
1079
+ ],
1080
+ "default": null
1081
+ },
632
1082
  "terminal_bg": {
633
1083
  "description": "Embedded terminal background (use Default for transparency)",
634
1084
  "$ref": "#/$defs/ColorDef",
@@ -750,6 +750,11 @@ async function openPanel(): Promise<void> {
750
750
  entries: buildPanelEntries(),
751
751
  ratio: 0.6,
752
752
  panelId: "search-replace-panel",
753
+ // Opt into the Utility Dock (issue #1796 / Section 2 of
754
+ // docs/internal/tui-editor-layout-design.md). When the dock
755
+ // already exists, the editor swaps the dock's active buffer
756
+ // to the search-replace panel instead of spawning a new split.
757
+ role: "utility_dock",
753
758
  showLineNumbers: false,
754
759
  showCursors: false,
755
760
  editingDisabled: true,