@matdata/yasgui 5.11.0 → 5.12.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.
- package/build/ts/src/PersistentConfig.d.ts +4 -0
- package/build/ts/src/PersistentConfig.js +12 -0
- package/build/ts/src/PersistentConfig.js.map +1 -1
- package/build/ts/src/Tab.js +2 -1
- package/build/ts/src/Tab.js.map +1 -1
- package/build/ts/src/TabSettingsModal.js +116 -0
- package/build/ts/src/TabSettingsModal.js.map +1 -1
- package/build/ts/src/ThemeManager.d.ts +3 -0
- package/build/ts/src/ThemeManager.js +11 -1
- package/build/ts/src/ThemeManager.js.map +1 -1
- package/build/ts/src/index.d.ts +1 -0
- package/build/ts/src/index.js +2 -0
- package/build/ts/src/index.js.map +1 -1
- package/build/ts/src/version.d.ts +1 -1
- package/build/ts/src/version.js +1 -1
- package/build/yasgui.min.css +1 -1
- package/build/yasgui.min.css.map +3 -3
- package/build/yasgui.min.js +124 -124
- package/build/yasgui.min.js.map +3 -3
- package/package.json +1 -1
- package/src/PersistentConfig.ts +15 -0
- package/src/Tab.ts +3 -2
- package/src/TabSettingsModal.ts +146 -0
- package/src/ThemeManager.ts +18 -1
- package/src/github-dark-theme.scss +167 -0
- package/src/index.ts +4 -0
- package/src/themes.scss +43 -43
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/PersistentConfig.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface PersistedJson {
|
|
|
19
19
|
orientation?: "vertical" | "horizontal";
|
|
20
20
|
showSnippetsBar?: boolean;
|
|
21
21
|
disabledDevButtons?: string[]; // Endpoints of developer-configured buttons that are disabled by user
|
|
22
|
+
codeMirrorThemeLight?: string; // User-selected CodeMirror theme for light mode
|
|
23
|
+
codeMirrorThemeDark?: string; // User-selected CodeMirror theme for dark mode
|
|
22
24
|
}
|
|
23
25
|
function getDefaults(): PersistedJson {
|
|
24
26
|
return {
|
|
@@ -182,6 +184,19 @@ export default class PersistentConfig {
|
|
|
182
184
|
this.toStorage();
|
|
183
185
|
}
|
|
184
186
|
|
|
187
|
+
public getCodeMirrorTheme(mode: "light" | "dark"): string | undefined {
|
|
188
|
+
return mode === "dark" ? this.persistedJson.codeMirrorThemeDark : this.persistedJson.codeMirrorThemeLight;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public setCodeMirrorTheme(mode: "light" | "dark", theme: string) {
|
|
192
|
+
if (mode === "dark") {
|
|
193
|
+
this.persistedJson.codeMirrorThemeDark = theme;
|
|
194
|
+
} else {
|
|
195
|
+
this.persistedJson.codeMirrorThemeLight = theme;
|
|
196
|
+
}
|
|
197
|
+
this.toStorage();
|
|
198
|
+
}
|
|
199
|
+
|
|
185
200
|
// New endpoint configuration methods
|
|
186
201
|
public getEndpointConfigs(): EndpointConfig[] {
|
|
187
202
|
return this.persistedJson.endpointConfigs || [];
|
package/src/Tab.ts
CHANGED
|
@@ -1216,9 +1216,10 @@ export class Tab extends EventEmitter {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
1218
|
private initYasqe() {
|
|
1219
|
-
// Set theme based on current
|
|
1219
|
+
// Set theme based on stored preference for current mode
|
|
1220
1220
|
const currentTheme = this.yasgui.getTheme();
|
|
1221
|
-
const
|
|
1221
|
+
const storedCmTheme = this.yasgui.persistentConfig.getCodeMirrorTheme(currentTheme);
|
|
1222
|
+
const cmTheme = storedCmTheme || (currentTheme === "dark" ? "github-dark" : "default");
|
|
1222
1223
|
|
|
1223
1224
|
const yasqeConf: Partial<YasqeConfig> = {
|
|
1224
1225
|
...this.yasgui.config.yasqe,
|
package/src/TabSettingsModal.ts
CHANGED
|
@@ -358,6 +358,123 @@ export default class TabSettingsModal {
|
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
// Available CodeMirror themes
|
|
362
|
+
const themes = [
|
|
363
|
+
{ value: "default", label: "Default" },
|
|
364
|
+
{ value: "github-dark", label: "GitHub Dark Default" },
|
|
365
|
+
{ value: "material-palenight", label: "Material Palenight" },
|
|
366
|
+
{ value: "monokai", label: "Monokai" },
|
|
367
|
+
{ value: "dracula", label: "Dracula" },
|
|
368
|
+
{ value: "nord", label: "Nord" },
|
|
369
|
+
{ value: "solarized dark", label: "Solarized Dark" },
|
|
370
|
+
{ value: "solarized light", label: "Solarized Light" },
|
|
371
|
+
{ value: "twilight", label: "Twilight" },
|
|
372
|
+
{ value: "material", label: "Material" },
|
|
373
|
+
{ value: "cobalt", label: "Cobalt" },
|
|
374
|
+
{ value: "darcula", label: "Darcula" },
|
|
375
|
+
{ value: "gruvbox-dark", label: "Gruvbox Dark" },
|
|
376
|
+
{ value: "oceanic-next", label: "Oceanic Next" },
|
|
377
|
+
{ value: "material-darker", label: "Material Darker" },
|
|
378
|
+
{ value: "blackboard", label: "Blackboard" },
|
|
379
|
+
{ value: "base16-dark", label: "Base16 Dark" },
|
|
380
|
+
{ value: "base16-light", label: "Base16 Light" },
|
|
381
|
+
{ value: "eclipse", label: "Eclipse" },
|
|
382
|
+
{ value: "elegant", label: "Elegant" },
|
|
383
|
+
{ value: "idea", label: "IntelliJ IDEA" },
|
|
384
|
+
{ value: "mbo", label: "MBO" },
|
|
385
|
+
{ value: "neat", label: "Neat" },
|
|
386
|
+
{ value: "neo", label: "Neo" },
|
|
387
|
+
{ value: "night", label: "Night" },
|
|
388
|
+
{ value: "paraiso-dark", label: "Paraiso Dark" },
|
|
389
|
+
{ value: "paraiso-light", label: "Paraiso Light" },
|
|
390
|
+
{ value: "pastel-on-dark", label: "Pastel on Dark" },
|
|
391
|
+
{ value: "rubyblue", label: "Ruby Blue" },
|
|
392
|
+
{ value: "the-matrix", label: "The Matrix" },
|
|
393
|
+
{ value: "tomorrow-night-bright", label: "Tomorrow Night Bright" },
|
|
394
|
+
{ value: "tomorrow-night-eighties", label: "Tomorrow Night 80s" },
|
|
395
|
+
{ value: "vibrant-ink", label: "Vibrant Ink" },
|
|
396
|
+
{ value: "xq-dark", label: "XQ Dark" },
|
|
397
|
+
{ value: "xq-light", label: "XQ Light" },
|
|
398
|
+
];
|
|
399
|
+
|
|
400
|
+
// Light Mode Theme Section
|
|
401
|
+
const themeLightSection = document.createElement("div");
|
|
402
|
+
addClass(themeLightSection, "settingsSection");
|
|
403
|
+
|
|
404
|
+
const themeLightLabel = document.createElement("label");
|
|
405
|
+
themeLightLabel.textContent = "Editor Theme (Light Mode)";
|
|
406
|
+
addClass(themeLightLabel, "settingsLabel");
|
|
407
|
+
|
|
408
|
+
const themeLightHelp = document.createElement("div");
|
|
409
|
+
themeLightHelp.textContent = "Syntax highlighting theme when using light mode.";
|
|
410
|
+
addClass(themeLightHelp, "settingsHelp");
|
|
411
|
+
|
|
412
|
+
const themeLightSelect = document.createElement("select");
|
|
413
|
+
themeLightSelect.id = "codeMirrorThemeLightSelect";
|
|
414
|
+
addClass(themeLightSelect, "settingsSelect");
|
|
415
|
+
|
|
416
|
+
themes.forEach((theme) => {
|
|
417
|
+
const option = document.createElement("option");
|
|
418
|
+
option.value = theme.value;
|
|
419
|
+
option.textContent = theme.label;
|
|
420
|
+
themeLightSelect.appendChild(option);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
const storedLightTheme = this.tab.yasgui.persistentConfig.getCodeMirrorTheme("light");
|
|
424
|
+
themeLightSelect.value = storedLightTheme || "default";
|
|
425
|
+
|
|
426
|
+
themeLightSection.appendChild(themeLightLabel);
|
|
427
|
+
themeLightSection.appendChild(themeLightHelp);
|
|
428
|
+
themeLightSection.appendChild(themeLightSelect);
|
|
429
|
+
container.appendChild(themeLightSection);
|
|
430
|
+
|
|
431
|
+
// Dark Mode Theme Section
|
|
432
|
+
const themeDarkSection = document.createElement("div");
|
|
433
|
+
addClass(themeDarkSection, "settingsSection");
|
|
434
|
+
|
|
435
|
+
const themeDarkLabel = document.createElement("label");
|
|
436
|
+
themeDarkLabel.textContent = "Editor Theme (Dark Mode)";
|
|
437
|
+
addClass(themeDarkLabel, "settingsLabel");
|
|
438
|
+
|
|
439
|
+
const themeDarkHelp = document.createElement("div");
|
|
440
|
+
themeDarkHelp.textContent = "Syntax highlighting theme when using dark mode.";
|
|
441
|
+
addClass(themeDarkHelp, "settingsHelp");
|
|
442
|
+
|
|
443
|
+
const themeDarkSelect = document.createElement("select");
|
|
444
|
+
themeDarkSelect.id = "codeMirrorThemeDarkSelect";
|
|
445
|
+
addClass(themeDarkSelect, "settingsSelect");
|
|
446
|
+
|
|
447
|
+
themes.forEach((theme) => {
|
|
448
|
+
const option = document.createElement("option");
|
|
449
|
+
option.value = theme.value;
|
|
450
|
+
option.textContent = theme.label;
|
|
451
|
+
themeDarkSelect.appendChild(option);
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const storedDarkTheme = this.tab.yasgui.persistentConfig.getCodeMirrorTheme("dark");
|
|
455
|
+
themeDarkSelect.value = storedDarkTheme || "material-palenight";
|
|
456
|
+
|
|
457
|
+
themeDarkSection.appendChild(themeDarkLabel);
|
|
458
|
+
themeDarkSection.appendChild(themeDarkHelp);
|
|
459
|
+
themeDarkSection.appendChild(themeDarkSelect);
|
|
460
|
+
container.appendChild(themeDarkSection);
|
|
461
|
+
|
|
462
|
+
// Theme reference link
|
|
463
|
+
const themeReferenceSection = document.createElement("div");
|
|
464
|
+
addClass(themeReferenceSection, "settingsSection");
|
|
465
|
+
|
|
466
|
+
const themeReferenceLink = document.createElement("a");
|
|
467
|
+
themeReferenceLink.href = "https://codemirror.net/5/demo/theme.html";
|
|
468
|
+
themeReferenceLink.target = "_blank";
|
|
469
|
+
themeReferenceLink.rel = "noopener noreferrer";
|
|
470
|
+
themeReferenceLink.textContent = "Preview CodeMirror themes →";
|
|
471
|
+
themeReferenceLink.style.display = "inline-block";
|
|
472
|
+
themeReferenceLink.style.marginTop = "5px";
|
|
473
|
+
themeReferenceLink.style.fontSize = "13px";
|
|
474
|
+
|
|
475
|
+
themeReferenceSection.appendChild(themeReferenceLink);
|
|
476
|
+
container.appendChild(themeReferenceSection);
|
|
477
|
+
|
|
361
478
|
// Formatter Type Section
|
|
362
479
|
const formatterSection = document.createElement("div");
|
|
363
480
|
addClass(formatterSection, "settingsSection");
|
|
@@ -1355,10 +1472,39 @@ export default class TabSettingsModal {
|
|
|
1355
1472
|
// Save editor settings
|
|
1356
1473
|
const yasqe = this.tab.getYasqe();
|
|
1357
1474
|
if (yasqe && yasqe.persistentConfig) {
|
|
1475
|
+
const codeMirrorThemeLightSelect = document.getElementById("codeMirrorThemeLightSelect") as HTMLSelectElement;
|
|
1476
|
+
const codeMirrorThemeDarkSelect = document.getElementById("codeMirrorThemeDarkSelect") as HTMLSelectElement;
|
|
1358
1477
|
const formatterSelect = document.getElementById("formatterTypeSelect") as HTMLSelectElement;
|
|
1359
1478
|
const autoformatCheckbox = document.getElementById("autoformatOnQuery") as HTMLInputElement;
|
|
1360
1479
|
const constructValidationCheckbox = document.getElementById("checkConstructVariables") as HTMLInputElement;
|
|
1361
1480
|
|
|
1481
|
+
// Save CodeMirror themes for both light and dark modes
|
|
1482
|
+
if (codeMirrorThemeLightSelect) {
|
|
1483
|
+
const selectedTheme = codeMirrorThemeLightSelect.value;
|
|
1484
|
+
this.tab.yasgui.persistentConfig.setCodeMirrorTheme("light", selectedTheme);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
if (codeMirrorThemeDarkSelect) {
|
|
1488
|
+
const selectedTheme = codeMirrorThemeDarkSelect.value;
|
|
1489
|
+
this.tab.yasgui.persistentConfig.setCodeMirrorTheme("dark", selectedTheme);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// Apply the appropriate theme based on current mode
|
|
1493
|
+
const currentMode = this.tab.yasgui.getTheme();
|
|
1494
|
+
const themeToApply =
|
|
1495
|
+
currentMode === "dark"
|
|
1496
|
+
? codeMirrorThemeDarkSelect?.value || "material-palenight"
|
|
1497
|
+
: codeMirrorThemeLightSelect?.value || "default";
|
|
1498
|
+
|
|
1499
|
+
// Apply theme to all CodeMirror instances
|
|
1500
|
+
const cmElements = document.querySelectorAll(".CodeMirror");
|
|
1501
|
+
cmElements.forEach((element) => {
|
|
1502
|
+
const cm = (element as any).CodeMirror;
|
|
1503
|
+
if (cm && cm.setOption) {
|
|
1504
|
+
cm.setOption("theme", themeToApply);
|
|
1505
|
+
}
|
|
1506
|
+
});
|
|
1507
|
+
|
|
1362
1508
|
if (formatterSelect) {
|
|
1363
1509
|
yasqe.persistentConfig.formatterType = formatterSelect.value as "sparql-formatter" | "legacy";
|
|
1364
1510
|
}
|
package/src/ThemeManager.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Storage as YStorage } from "@matdata/yasgui-utils";
|
|
2
|
+
import PersistentConfig from "./PersistentConfig";
|
|
2
3
|
|
|
3
4
|
export type Theme = "light" | "dark";
|
|
4
5
|
|
|
@@ -7,6 +8,7 @@ export class ThemeManager {
|
|
|
7
8
|
private storage: YStorage;
|
|
8
9
|
private currentTheme: Theme;
|
|
9
10
|
private rootElement: HTMLElement;
|
|
11
|
+
private persistentConfig?: PersistentConfig;
|
|
10
12
|
|
|
11
13
|
constructor(rootElement: HTMLElement) {
|
|
12
14
|
this.storage = new YStorage("yasgui");
|
|
@@ -15,6 +17,13 @@ export class ThemeManager {
|
|
|
15
17
|
this.applyTheme(this.currentTheme);
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Set PersistentConfig for accessing CodeMirror theme preference
|
|
22
|
+
*/
|
|
23
|
+
public setPersistentConfig(persistentConfig: PersistentConfig): void {
|
|
24
|
+
this.persistentConfig = persistentConfig;
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
/**
|
|
19
28
|
* Get the currently active theme
|
|
20
29
|
*/
|
|
@@ -61,7 +70,15 @@ export class ThemeManager {
|
|
|
61
70
|
* Update CodeMirror theme for all Yasqe editors
|
|
62
71
|
*/
|
|
63
72
|
private updateCodeMirrorTheme(theme: Theme): void {
|
|
64
|
-
|
|
73
|
+
// Get user's stored CodeMirror theme preference for the current mode, or use default
|
|
74
|
+
let cmTheme: string;
|
|
75
|
+
if (this.persistentConfig) {
|
|
76
|
+
const storedTheme = this.persistentConfig.getCodeMirrorTheme(theme);
|
|
77
|
+
cmTheme = storedTheme || (theme === "dark" ? "material-palenight" : "default");
|
|
78
|
+
} else {
|
|
79
|
+
// Fallback if persistentConfig not yet available
|
|
80
|
+
cmTheme = theme === "dark" ? "material-palenight" : "default";
|
|
81
|
+
}
|
|
65
82
|
|
|
66
83
|
// Find all CodeMirror instances within the root element
|
|
67
84
|
const cmElements = this.rootElement.querySelectorAll(".CodeMirror");
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// GitHub Dark Default CodeMirror Theme
|
|
2
|
+
// Based on GitHub's dark default color scheme
|
|
3
|
+
|
|
4
|
+
.cm-s-github-dark.CodeMirror {
|
|
5
|
+
background-color: #0d1117;
|
|
6
|
+
color: #c9d1d9;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Selection styles - using GitHub's subtle blue highlight
|
|
10
|
+
.cm-s-github-dark div.CodeMirror-selected {
|
|
11
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.cm-s-github-dark.CodeMirror ::selection {
|
|
15
|
+
background: rgba(56, 138, 253, 0.308) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.cm-s-github-dark.CodeMirror ::-moz-selection {
|
|
19
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cm-s-github-dark .CodeMirror-line::selection,
|
|
23
|
+
.cm-s-github-dark .CodeMirror-line > span::selection,
|
|
24
|
+
.cm-s-github-dark .CodeMirror-line > span > span::selection {
|
|
25
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cm-s-github-dark .CodeMirror-line::-moz-selection,
|
|
29
|
+
.cm-s-github-dark .CodeMirror-line > span::-moz-selection,
|
|
30
|
+
.cm-s-github-dark .CodeMirror-line > span > span::-moz-selection {
|
|
31
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cm-s-github-dark.CodeMirror-focused div.CodeMirror-selected {
|
|
35
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cm-s-github-dark .CodeMirror-gutters {
|
|
39
|
+
background: #0d1117;
|
|
40
|
+
border-right: 1px solid #30363d;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cm-s-github-dark .CodeMirror-guttermarker {
|
|
44
|
+
color: #c9d1d9;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.cm-s-github-dark .CodeMirror-guttermarker-subtle {
|
|
48
|
+
color: #6e7681;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cm-s-github-dark .CodeMirror-linenumber {
|
|
52
|
+
color: #6e7681;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cm-s-github-dark .CodeMirror-cursor {
|
|
56
|
+
border-left: 1px solid #c9d1d9;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// SPARQL syntax highlighting - GitHub Dark Default colors
|
|
60
|
+
.cm-s-github-dark span.cm-keyword {
|
|
61
|
+
color: #ff7b72; // Keywords (SELECT, WHERE, PREFIX, etc.)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cm-s-github-dark span.cm-atom {
|
|
65
|
+
color: #79c0ff; // Variables (?var, $var)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.cm-s-github-dark span.cm-string {
|
|
69
|
+
color: #a5d6ff; // Literals in quotes
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cm-s-github-dark span.cm-string-2 {
|
|
73
|
+
color: #ffa657; // Prefixed names (rdf:type, foaf:name)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.cm-s-github-dark span.cm-variable-3 {
|
|
77
|
+
color: #d2a8ff; // URIs in angle brackets
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.cm-s-github-dark span.cm-number {
|
|
81
|
+
color: #79c0ff; // Numbers
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cm-s-github-dark span.cm-comment {
|
|
85
|
+
color: #8b949e; // Comments
|
|
86
|
+
font-style: italic;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.cm-s-github-dark span.cm-meta {
|
|
90
|
+
color: #ffa657; // Metadata
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.cm-s-github-dark span.cm-operator {
|
|
94
|
+
color: #ff7b72; // Operators
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cm-s-github-dark span.cm-qualifier {
|
|
98
|
+
color: #79c0ff; // Qualifiers
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.cm-s-github-dark span.cm-property {
|
|
102
|
+
color: #79c0ff; // Properties
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.cm-s-github-dark span.cm-variable {
|
|
106
|
+
color: #c9d1d9; // Default variables
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.cm-s-github-dark span.cm-variable-2 {
|
|
110
|
+
color: #79c0ff;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cm-s-github-dark span.cm-def {
|
|
114
|
+
color: #d2a8ff; // Definitions
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.cm-s-github-dark span.cm-tag {
|
|
118
|
+
color: #7ee787; // Tags
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.cm-s-github-dark span.cm-attribute {
|
|
122
|
+
color: #79c0ff; // Attributes
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cm-s-github-dark span.cm-builtin {
|
|
126
|
+
color: #ffa657; // Built-in functions
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.cm-s-github-dark span.cm-bracket {
|
|
130
|
+
color: #c9d1d9; // Brackets
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.cm-s-github-dark span.cm-error {
|
|
134
|
+
color: #f85149;
|
|
135
|
+
border-bottom: 2px dotted #f85149;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Active line
|
|
139
|
+
.cm-s-github-dark .CodeMirror-activeline-background {
|
|
140
|
+
background: rgba(110, 118, 129, 0.1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Matching brackets
|
|
144
|
+
.cm-s-github-dark .CodeMirror-matchingbracket {
|
|
145
|
+
color: #7ee787 !important;
|
|
146
|
+
background-color: rgba(46, 160, 67, 0.15);
|
|
147
|
+
text-decoration: underline;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.cm-s-github-dark .CodeMirror-nonmatchingbracket {
|
|
151
|
+
color: #ff7b72 !important;
|
|
152
|
+
background-color: rgba(248, 81, 73, 0.15);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Search highlighting
|
|
156
|
+
.cm-s-github-dark .CodeMirror-searching {
|
|
157
|
+
background-color: rgba(255, 206, 0, 0.4);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Override match highlight to use subtle selection color
|
|
161
|
+
.cm-s-github-dark .cm-matchhighlight {
|
|
162
|
+
background-color: rgba(56, 138, 253, 0.5) !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.cm-s-github-dark .CodeMirror-focused .CodeMirror-selected {
|
|
166
|
+
background: rgba(56, 138, 253, 0.5) !important;
|
|
167
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { ThemeManager, Theme } from "./ThemeManager";
|
|
|
19
19
|
import QueryBrowser from "./queryManagement/QueryBrowser";
|
|
20
20
|
import "./index.scss";
|
|
21
21
|
import "./themes.scss";
|
|
22
|
+
import "./github-dark-theme.scss";
|
|
22
23
|
import "../../yasr/src/scss/global.scss";
|
|
23
24
|
import "codemirror/theme/material-palenight.css";
|
|
24
25
|
|
|
@@ -171,6 +172,9 @@ export class Yasgui extends EventEmitter {
|
|
|
171
172
|
this.themeManager.listenToSystemTheme();
|
|
172
173
|
this.persistentConfig = new PersistentConfig(this);
|
|
173
174
|
|
|
175
|
+
// Set persistentConfig reference in ThemeManager so it can access CodeMirror theme preference
|
|
176
|
+
this.themeManager.setPersistentConfig(this.persistentConfig);
|
|
177
|
+
|
|
174
178
|
// Load persisted showSnippetsBar if available
|
|
175
179
|
const persistedShowSnippetsBar = this.persistentConfig.getShowSnippetsBar();
|
|
176
180
|
if (persistedShowSnippetsBar !== undefined) {
|
package/src/themes.scss
CHANGED
|
@@ -52,49 +52,49 @@
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
[data-theme="dark"] {
|
|
55
|
-
// Dark theme colors
|
|
56
|
-
--yasgui-bg-primary: #
|
|
57
|
-
--yasgui-bg-secondary: #
|
|
58
|
-
--yasgui-bg-tertiary: #
|
|
59
|
-
--yasgui-bg-quaternary: #
|
|
60
|
-
--yasgui-text-primary: #
|
|
61
|
-
--yasgui-text-secondary: #
|
|
62
|
-
--yasgui-text-muted: #
|
|
63
|
-
--yasgui-border-color: #
|
|
64
|
-
--yasgui-border-color-secondary: rgba(
|
|
65
|
-
--yasgui-border-color-light: #
|
|
66
|
-
--yasgui-link-color: #
|
|
67
|
-
--yasgui-link-hover: #
|
|
68
|
-
--yasgui-accent-color: #
|
|
69
|
-
--yasgui-button-text: #
|
|
70
|
-
--yasgui-button-hover: #
|
|
71
|
-
--yasgui-chip-bg: #
|
|
72
|
-
--yasgui-chip-text: #
|
|
73
|
-
--yasgui-tab-bg: #
|
|
74
|
-
--yasgui-tab-bg-active: #
|
|
75
|
-
--yasgui-tab-border: #
|
|
76
|
-
--yasgui-tab-managed: #
|
|
77
|
-
--yasgui-input-border:
|
|
78
|
-
--yasgui-input-focus: #
|
|
79
|
-
--yasgui-label-color:
|
|
80
|
-
--yasgui-tooltip-bg:
|
|
81
|
-
--yasgui-tooltip-text: #
|
|
82
|
-
--yasgui-error-color: #
|
|
83
|
-
--yasgui-notification-bg: #
|
|
84
|
-
--yasgui-notification-text: #
|
|
85
|
-
--yasgui-help-bg: #
|
|
86
|
-
--yasgui-help-text: #
|
|
87
|
-
--yasgui-fallback-bg: #
|
|
88
|
-
--yasgui-fallback-border: #
|
|
89
|
-
--yasgui-resize-handle: #
|
|
90
|
-
--yasgui-nav-bg: #
|
|
91
|
-
--yasgui-match-highlight-bg: #
|
|
92
|
-
--yasgui-endpoint-button-bg: #
|
|
93
|
-
--yasgui-endpoint-button-border: #
|
|
94
|
-
--yasgui-endpoint-button-text: #
|
|
95
|
-
--yasgui-endpoint-button-hover-bg: #
|
|
96
|
-
--yasgui-endpoint-button-hover-border: #
|
|
97
|
-
--yasgui-endpoint-button-focus: #
|
|
55
|
+
// Dark theme colors - GitHub Dark Default inspired
|
|
56
|
+
--yasgui-bg-primary: #0d1117;
|
|
57
|
+
--yasgui-bg-secondary: #161b22;
|
|
58
|
+
--yasgui-bg-tertiary: #21262d;
|
|
59
|
+
--yasgui-bg-quaternary: #30363d;
|
|
60
|
+
--yasgui-text-primary: #c9d1d9;
|
|
61
|
+
--yasgui-text-secondary: #b1bac4;
|
|
62
|
+
--yasgui-text-muted: #8b949e;
|
|
63
|
+
--yasgui-border-color: #30363d;
|
|
64
|
+
--yasgui-border-color-secondary: rgba(240, 246, 252, 0.1);
|
|
65
|
+
--yasgui-border-color-light: #30363d;
|
|
66
|
+
--yasgui-link-color: #58a6ff;
|
|
67
|
+
--yasgui-link-hover: #79c0ff;
|
|
68
|
+
--yasgui-accent-color: #58a6ff;
|
|
69
|
+
--yasgui-button-text: #c9d1d9;
|
|
70
|
+
--yasgui-button-hover: #f0f6fc;
|
|
71
|
+
--yasgui-chip-bg: #21262d;
|
|
72
|
+
--yasgui-chip-text: #c9d1d9;
|
|
73
|
+
--yasgui-tab-bg: #0d1117;
|
|
74
|
+
--yasgui-tab-bg-active: #161b22;
|
|
75
|
+
--yasgui-tab-border: #30363d;
|
|
76
|
+
--yasgui-tab-managed: #1c2d41;
|
|
77
|
+
--yasgui-input-border: #30363d;
|
|
78
|
+
--yasgui-input-focus: #58a6ff;
|
|
79
|
+
--yasgui-label-color: #8b949e;
|
|
80
|
+
--yasgui-tooltip-bg: #161b22;
|
|
81
|
+
--yasgui-tooltip-text: #c9d1d9;
|
|
82
|
+
--yasgui-error-color: #f85149;
|
|
83
|
+
--yasgui-notification-bg: #21262d;
|
|
84
|
+
--yasgui-notification-text: #8b949e;
|
|
85
|
+
--yasgui-help-bg: #1c2d41;
|
|
86
|
+
--yasgui-help-text: #58a6ff;
|
|
87
|
+
--yasgui-fallback-bg: #161b22;
|
|
88
|
+
--yasgui-fallback-border: #30363d;
|
|
89
|
+
--yasgui-resize-handle: #30363d;
|
|
90
|
+
--yasgui-nav-bg: #161b22;
|
|
91
|
+
--yasgui-match-highlight-bg: #1f6feb;
|
|
92
|
+
--yasgui-endpoint-button-bg: #238636;
|
|
93
|
+
--yasgui-endpoint-button-border: #238636;
|
|
94
|
+
--yasgui-endpoint-button-text: #ffffff;
|
|
95
|
+
--yasgui-endpoint-button-hover-bg: #2ea043;
|
|
96
|
+
--yasgui-endpoint-button-hover-border: #2ea043;
|
|
97
|
+
--yasgui-endpoint-button-focus: #58a6ff;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// Apply theme colors to Yasgui components
|
package/src/version.ts
CHANGED