@codingame/monaco-vscode-theme-service-override 37.6.0 → 38.0.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/index.js +2 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +46 -46
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +2 -2
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +12 -12
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.d.ts +7 -2
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +40 -5
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +16 -16
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +39 -39
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +7 -7
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +36 -36
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +21 -21
- package/vscode/src/vs/sessions/common/sizes.d.ts +0 -22
- package/vscode/src/vs/sessions/common/sizes.js +0 -20
package/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
5
5
|
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
6
6
|
import getServiceOverride$1 from '@codingame/monaco-vscode-files-service-override';
|
|
7
7
|
import './vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js';
|
|
8
|
-
import '@codingame/monaco-vscode-api/vscode/vs/
|
|
9
|
-
import '
|
|
8
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/common/agentsColors';
|
|
9
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/common/agentsSizes';
|
|
10
10
|
|
|
11
11
|
class StandaloneWorkbenchThemeService extends WorkbenchThemeService {
|
|
12
12
|
registerEditorContainer() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-theme-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "38.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - theme service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "38.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "38.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -53,7 +53,7 @@ import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/com
|
|
|
53
53
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
54
54
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
55
55
|
|
|
56
|
-
const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(
|
|
56
|
+
const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(23077, "Icon for the 'Manage' action in the theme selection quick pick.")));
|
|
57
57
|
var ConfigureItem;
|
|
58
58
|
(function(ConfigureItem) {
|
|
59
59
|
ConfigureItem["BROWSE_GALLERY"] = "marketplace";
|
|
@@ -184,7 +184,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
184
184
|
quickpick.matchOnDescription = true;
|
|
185
185
|
quickpick.buttons = [this.quickInputService.backButton];
|
|
186
186
|
quickpick.title = "Marketplace Themes";
|
|
187
|
-
quickpick.placeholder = ( localize(
|
|
187
|
+
quickpick.placeholder = ( localize(23078, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
|
|
188
188
|
quickpick.canSelectMany = false;
|
|
189
189
|
disposables.add(quickpick.onDidChangeValue(() => this.trigger(quickpick.value)));
|
|
190
190
|
disposables.add(quickpick.onDidAccept(async _ => {
|
|
@@ -238,7 +238,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
238
238
|
});
|
|
239
239
|
} else if (items.length === 0 && this._searchError) {
|
|
240
240
|
items = [{
|
|
241
|
-
label: `$(error) ${( localize(
|
|
241
|
+
label: `$(error) ${( localize(23079, "Error while searching for themes: {0}", this._searchError))}`,
|
|
242
242
|
id: undefined,
|
|
243
243
|
alwaysShow: true
|
|
244
244
|
}];
|
|
@@ -260,12 +260,12 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
260
260
|
this.extensionsWorkbenchService.openSearch(`@id:${galleryExtension.identifier.id}`);
|
|
261
261
|
const result = await this.dialogService.confirm({
|
|
262
262
|
message: ( localize(
|
|
263
|
-
|
|
263
|
+
23080,
|
|
264
264
|
"This will install extension '{0}' published by '{1}'. Do you want to continue?",
|
|
265
265
|
galleryExtension.displayName,
|
|
266
266
|
galleryExtension.publisherDisplayName
|
|
267
267
|
)),
|
|
268
|
-
primaryButton: ( localize(
|
|
268
|
+
primaryButton: ( localize(23081, "OK"))
|
|
269
269
|
});
|
|
270
270
|
if (!result.confirmed) {
|
|
271
271
|
return false;
|
|
@@ -273,7 +273,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
273
273
|
try {
|
|
274
274
|
await this.progressService.withProgress({
|
|
275
275
|
location: ProgressLocation.Notification,
|
|
276
|
-
title: ( localize(
|
|
276
|
+
title: ( localize(23082, "Installing Extension {0}...", galleryExtension.displayName))
|
|
277
277
|
}, async () => {
|
|
278
278
|
await this.extensionManagementService.installFromGallery(galleryExtension, {
|
|
279
279
|
isMachineScoped: false
|
|
@@ -424,7 +424,7 @@ registerAction2(class extends Action2 {
|
|
|
424
424
|
constructor() {
|
|
425
425
|
super({
|
|
426
426
|
id: SelectColorThemeCommandId,
|
|
427
|
-
title: ( localize2(
|
|
427
|
+
title: ( localize2(23083, "Color Theme")),
|
|
428
428
|
category: Categories.Preferences,
|
|
429
429
|
f1: true,
|
|
430
430
|
keybinding: {
|
|
@@ -436,15 +436,15 @@ registerAction2(class extends Action2 {
|
|
|
436
436
|
getTitle(colorScheme) {
|
|
437
437
|
switch (colorScheme) {
|
|
438
438
|
case ColorScheme.DARK:
|
|
439
|
-
return localize(
|
|
439
|
+
return localize(23084, "Select Color Theme for System Dark Mode");
|
|
440
440
|
case ColorScheme.LIGHT:
|
|
441
|
-
return localize(
|
|
441
|
+
return localize(23085, "Select Color Theme for System Light Mode");
|
|
442
442
|
case ColorScheme.HIGH_CONTRAST_DARK:
|
|
443
|
-
return localize(
|
|
443
|
+
return localize(23086, "Select Color Theme for High Contrast Dark Mode");
|
|
444
444
|
case ColorScheme.HIGH_CONTRAST_LIGHT:
|
|
445
|
-
return localize(
|
|
445
|
+
return localize(23087, "Select Color Theme for High Contrast Light Mode");
|
|
446
446
|
default:
|
|
447
|
-
return localize(
|
|
447
|
+
return localize(23088, "Select Color Theme (detect system color mode disabled)");
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
async run(accessor) {
|
|
@@ -452,13 +452,13 @@ registerAction2(class extends Action2 {
|
|
|
452
452
|
const preferencesService = accessor.get(IPreferencesService);
|
|
453
453
|
const preferredColorScheme = themeService.getPreferredColorScheme();
|
|
454
454
|
const modeConfigureButton = {
|
|
455
|
-
tooltip: preferredColorScheme ? ( localize(
|
|
455
|
+
tooltip: preferredColorScheme ? ( localize(23089, "Detect system color mode enabled. Click to configure.")) : ( localize(23090, "Detect system color mode disabled. Click to configure.")),
|
|
456
456
|
iconClass: ThemeIcon.asClassName(Codicon.colorMode),
|
|
457
457
|
location: QuickInputButtonLocation.Inline
|
|
458
458
|
};
|
|
459
459
|
const options = {
|
|
460
|
-
installMessage: ( localize(
|
|
461
|
-
browseMessage: "$(plus) " + ( localize(
|
|
460
|
+
installMessage: ( localize(23091, "Install Additional Color Themes...")),
|
|
461
|
+
browseMessage: "$(plus) " + ( localize(23092, "Browse Additional Color Themes...")),
|
|
462
462
|
placeholderMessage: this.getTitle(preferredColorScheme),
|
|
463
463
|
marketplaceTag: "category:themes",
|
|
464
464
|
buttons: [modeConfigureButton],
|
|
@@ -475,9 +475,9 @@ registerAction2(class extends Action2 {
|
|
|
475
475
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
476
476
|
const themes = await themeService.getColorThemes();
|
|
477
477
|
const currentTheme = themeService.getColorTheme();
|
|
478
|
-
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(
|
|
479
|
-
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(
|
|
480
|
-
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(
|
|
478
|
+
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(23093, "light themes")));
|
|
479
|
+
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(23094, "dark themes")));
|
|
480
|
+
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(23095, "high contrast themes")));
|
|
481
481
|
let picks;
|
|
482
482
|
switch (preferredColorScheme) {
|
|
483
483
|
case ColorScheme.DARK:
|
|
@@ -500,7 +500,7 @@ registerAction2(class extends Action2 {
|
|
|
500
500
|
constructor() {
|
|
501
501
|
super({
|
|
502
502
|
id: SelectFileIconThemeCommandId,
|
|
503
|
-
title: ( localize2(
|
|
503
|
+
title: ( localize2(23096, "File Icon Theme")),
|
|
504
504
|
category: Categories.Preferences,
|
|
505
505
|
f1: true
|
|
506
506
|
});
|
|
@@ -508,8 +508,8 @@ registerAction2(class extends Action2 {
|
|
|
508
508
|
async run(accessor) {
|
|
509
509
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
510
510
|
const options = {
|
|
511
|
-
installMessage: ( localize(
|
|
512
|
-
placeholderMessage: ( localize(
|
|
511
|
+
installMessage: ( localize(23097, "Install Additional File Icon Themes...")),
|
|
512
|
+
placeholderMessage: ( localize(23098, "Select File Icon Theme (Up/Down Keys to Preview)")),
|
|
513
513
|
marketplaceTag: "tag:icon-theme"
|
|
514
514
|
};
|
|
515
515
|
const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
|
|
@@ -518,12 +518,12 @@ registerAction2(class extends Action2 {
|
|
|
518
518
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
519
519
|
const picks = [{
|
|
520
520
|
type: "separator",
|
|
521
|
-
label: ( localize(
|
|
521
|
+
label: ( localize(23099, "file icon themes"))
|
|
522
522
|
}, {
|
|
523
523
|
id: "",
|
|
524
524
|
theme: FileIconThemeData.noIconTheme,
|
|
525
|
-
label: ( localize(
|
|
526
|
-
description: ( localize(
|
|
525
|
+
label: ( localize(23100, "None")),
|
|
526
|
+
description: ( localize(23101, "Disable File Icons"))
|
|
527
527
|
}, ...toEntries(await themeService.getFileIconThemes())];
|
|
528
528
|
await picker.openQuickPick(picks, themeService.getFileIconTheme());
|
|
529
529
|
}
|
|
@@ -533,7 +533,7 @@ registerAction2(class extends Action2 {
|
|
|
533
533
|
constructor() {
|
|
534
534
|
super({
|
|
535
535
|
id: SelectProductIconThemeCommandId,
|
|
536
|
-
title: ( localize2(
|
|
536
|
+
title: ( localize2(23102, "Product Icon Theme")),
|
|
537
537
|
category: Categories.Preferences,
|
|
538
538
|
f1: true
|
|
539
539
|
});
|
|
@@ -541,9 +541,9 @@ registerAction2(class extends Action2 {
|
|
|
541
541
|
async run(accessor) {
|
|
542
542
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
543
543
|
const options = {
|
|
544
|
-
installMessage: ( localize(
|
|
545
|
-
browseMessage: "$(plus) " + ( localize(
|
|
546
|
-
placeholderMessage: ( localize(
|
|
544
|
+
installMessage: ( localize(23103, "Install Additional Product Icon Themes...")),
|
|
545
|
+
browseMessage: "$(plus) " + ( localize(23104, "Browse Additional Product Icon Themes...")),
|
|
546
|
+
placeholderMessage: ( localize(23105, "Select Product Icon Theme (Up/Down Keys to Preview)")),
|
|
547
547
|
marketplaceTag: "tag:product-icon-theme"
|
|
548
548
|
};
|
|
549
549
|
const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
|
|
@@ -552,11 +552,11 @@ registerAction2(class extends Action2 {
|
|
|
552
552
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
553
553
|
const picks = [{
|
|
554
554
|
type: "separator",
|
|
555
|
-
label: ( localize(
|
|
555
|
+
label: ( localize(23106, "product icon themes"))
|
|
556
556
|
}, {
|
|
557
557
|
id: DEFAULT_PRODUCT_ICON_THEME_ID,
|
|
558
558
|
theme: ProductIconThemeData.defaultTheme,
|
|
559
|
-
label: ( localize(
|
|
559
|
+
label: ( localize(23107, "Default"))
|
|
560
560
|
}, ...toEntries(await themeService.getProductIconThemes())];
|
|
561
561
|
await picker.openQuickPick(picks, themeService.getProductIconTheme());
|
|
562
562
|
}
|
|
@@ -565,7 +565,7 @@ registerAction2(class extends Action2 {
|
|
|
565
565
|
constructor() {
|
|
566
566
|
super({
|
|
567
567
|
id: "workbench.action.tryNewDefaultThemes",
|
|
568
|
-
title: ( localize2(
|
|
568
|
+
title: ( localize2(23108, "Try New Default Themes")),
|
|
569
569
|
category: Categories.Preferences,
|
|
570
570
|
f1: true
|
|
571
571
|
});
|
|
@@ -589,7 +589,7 @@ registerAction2(class extends Action2 {
|
|
|
589
589
|
const disposables = ( new DisposableStore());
|
|
590
590
|
const picker = disposables.add(quickInputService.createQuickPick());
|
|
591
591
|
picker.items = items;
|
|
592
|
-
picker.placeholder = ( localize(
|
|
592
|
+
picker.placeholder = ( localize(23109, "Pick a new default theme"));
|
|
593
593
|
picker.canSelectMany = false;
|
|
594
594
|
const preferredId = (previousTheme.type === ColorScheme.LIGHT || previousTheme.type === ColorScheme.HIGH_CONTRAST_LIGHT) ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
|
|
595
595
|
const activeItem = items.find(i => themes.find(t => t.id === i.id)?.settingsId === preferredId);
|
|
@@ -672,11 +672,11 @@ function configurationEntry(label, configureItem) {
|
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
function isItem(i) {
|
|
675
|
-
return i
|
|
675
|
+
return i.type !== "separator";
|
|
676
676
|
}
|
|
677
677
|
const defaultThemeDescriptions = {
|
|
678
|
-
[ThemeSettingDefaults.COLOR_THEME_LIGHT]: ( localize(
|
|
679
|
-
[ThemeSettingDefaults.COLOR_THEME_DARK]: ( localize(
|
|
678
|
+
[ThemeSettingDefaults.COLOR_THEME_LIGHT]: ( localize(23110, "Default Light")),
|
|
679
|
+
[ThemeSettingDefaults.COLOR_THEME_DARK]: ( localize(23111, "Default Dark"))
|
|
680
680
|
};
|
|
681
681
|
function toEntry(theme) {
|
|
682
682
|
const settingId = theme.settingsId ?? undefined;
|
|
@@ -715,13 +715,13 @@ function toEntries(themes, label) {
|
|
|
715
715
|
}
|
|
716
716
|
const configureButton = {
|
|
717
717
|
iconClass: ThemeIcon.asClassName(manageExtensionIcon),
|
|
718
|
-
tooltip: ( localize(
|
|
718
|
+
tooltip: ( localize(23112, "Manage Extension"))
|
|
719
719
|
};
|
|
720
720
|
registerAction2(class extends Action2 {
|
|
721
721
|
constructor() {
|
|
722
722
|
super({
|
|
723
723
|
id: "workbench.action.generateColorTheme",
|
|
724
|
-
title: ( localize2(
|
|
724
|
+
title: ( localize2(23113, "Generate Color Theme From Current Settings")),
|
|
725
725
|
category: Categories.Developer,
|
|
726
726
|
f1: true
|
|
727
727
|
});
|
|
@@ -776,7 +776,7 @@ registerAction2(class extends Action2 {
|
|
|
776
776
|
constructor() {
|
|
777
777
|
super({
|
|
778
778
|
id: toggleLightDarkThemesCommandId,
|
|
779
|
-
title: ( localize2(
|
|
779
|
+
title: ( localize2(23114, "Toggle between Light/Dark Themes")),
|
|
780
780
|
category: Categories.Preferences,
|
|
781
781
|
f1: true
|
|
782
782
|
});
|
|
@@ -788,12 +788,12 @@ registerAction2(class extends Action2 {
|
|
|
788
788
|
const preferencesService = accessor.get(IPreferencesService);
|
|
789
789
|
if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
790
790
|
const message = ( localize(
|
|
791
|
-
|
|
791
|
+
23115,
|
|
792
792
|
"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
|
|
793
793
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
794
794
|
));
|
|
795
795
|
notificationService.prompt(Severity.Info, message, [{
|
|
796
|
-
label: ( localize(
|
|
796
|
+
label: ( localize(23116, "Open Settings")),
|
|
797
797
|
run: () => {
|
|
798
798
|
return preferencesService.openUserSettings({
|
|
799
799
|
query: ThemeSettings.DETECT_COLOR_SCHEME
|
|
@@ -832,7 +832,7 @@ registerAction2(class extends Action2 {
|
|
|
832
832
|
constructor() {
|
|
833
833
|
super({
|
|
834
834
|
id: browseColorThemesInMarketplaceCommandId,
|
|
835
|
-
title: ( localize2(
|
|
835
|
+
title: ( localize2(23117, "Browse Color Themes in Marketplace")),
|
|
836
836
|
category: Categories.Preferences,
|
|
837
837
|
f1: true
|
|
838
838
|
});
|
|
@@ -873,13 +873,13 @@ registerAction2(class extends Action2 {
|
|
|
873
873
|
});
|
|
874
874
|
const ThemesSubMenu = ( new MenuId("ThemesSubMenu"));
|
|
875
875
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
876
|
-
title: ( localize(
|
|
876
|
+
title: ( localize(23118, "Themes")),
|
|
877
877
|
submenu: ThemesSubMenu,
|
|
878
878
|
group: "2_configuration",
|
|
879
879
|
order: 7
|
|
880
880
|
});
|
|
881
881
|
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
882
|
-
title: ( localize(
|
|
882
|
+
title: ( localize(23119, "&&Themes")),
|
|
883
883
|
submenu: ThemesSubMenu,
|
|
884
884
|
group: "2_configuration",
|
|
885
885
|
order: 7
|
|
@@ -887,21 +887,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
|
887
887
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
888
888
|
command: {
|
|
889
889
|
id: SelectColorThemeCommandId,
|
|
890
|
-
title: ( localize(
|
|
890
|
+
title: ( localize(23083, "Color Theme"))
|
|
891
891
|
},
|
|
892
892
|
order: 1
|
|
893
893
|
});
|
|
894
894
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
895
895
|
command: {
|
|
896
896
|
id: SelectFileIconThemeCommandId,
|
|
897
|
-
title: ( localize(
|
|
897
|
+
title: ( localize(23120, "File Icon Theme"))
|
|
898
898
|
},
|
|
899
899
|
order: 2
|
|
900
900
|
});
|
|
901
901
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
902
902
|
command: {
|
|
903
903
|
id: SelectProductIconThemeCommandId,
|
|
904
|
-
title: ( localize(
|
|
904
|
+
title: ( localize(23121, "Product Icon Theme"))
|
|
905
905
|
},
|
|
906
906
|
order: 3
|
|
907
907
|
});
|
|
@@ -149,12 +149,12 @@ class FileIconThemeLoader {
|
|
|
149
149
|
const contentValue = parse(content, errors);
|
|
150
150
|
if (errors.length > 0) {
|
|
151
151
|
return Promise.reject(( new Error(( localize(
|
|
152
|
-
|
|
152
|
+
24936,
|
|
153
153
|
"Problems parsing file icons file: {0}",
|
|
154
154
|
errors.map(e => getParseErrorMessage(e.error)).join(", ")
|
|
155
155
|
)))));
|
|
156
156
|
} else if (getNodeType(contentValue) !== "object") {
|
|
157
|
-
return Promise.reject(( new Error(( localize(
|
|
157
|
+
return Promise.reject(( new Error(( localize(24937, "Invalid format for file icons theme file: Object expected.")))));
|
|
158
158
|
}
|
|
159
159
|
return Promise.resolve(contentValue);
|
|
160
160
|
});
|
|
@@ -43,7 +43,7 @@ class ProductIconThemeData {
|
|
|
43
43
|
this.isLoaded = true;
|
|
44
44
|
if (warnings.length) {
|
|
45
45
|
logService.error(( localize(
|
|
46
|
-
|
|
46
|
+
24938,
|
|
47
47
|
"Problems processing product icons definitions in {0}:\n{1}",
|
|
48
48
|
(location.toString()),
|
|
49
49
|
warnings.join("\n")
|
|
@@ -76,7 +76,7 @@ class ProductIconThemeData {
|
|
|
76
76
|
static get defaultTheme() {
|
|
77
77
|
let themeData = ProductIconThemeData._defaultProductIconTheme;
|
|
78
78
|
if (!themeData) {
|
|
79
|
-
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(
|
|
79
|
+
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(24939, "Default")), ThemeSettingDefaults.PRODUCT_ICON_THEME));
|
|
80
80
|
themeData.isLoaded = true;
|
|
81
81
|
themeData.extensionData = undefined;
|
|
82
82
|
themeData.watch = false;
|
|
@@ -187,15 +187,15 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
187
187
|
const contentValue = parse(content, parseErrors);
|
|
188
188
|
if (parseErrors.length > 0) {
|
|
189
189
|
return Promise.reject(( new Error(( localize(
|
|
190
|
-
|
|
190
|
+
24940,
|
|
191
191
|
"Problems parsing product icons file: {0}",
|
|
192
192
|
parseErrors.map(e => getParseErrorMessage(e.error)).join(", ")
|
|
193
193
|
)))));
|
|
194
194
|
} else if (getNodeType(contentValue) !== "object") {
|
|
195
|
-
return Promise.reject(( new Error(( localize(
|
|
195
|
+
return Promise.reject(( new Error(( localize(24941, "Invalid format for product icons theme file: Object expected.")))));
|
|
196
196
|
} else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
|
|
197
197
|
return Promise.reject(( new Error(( localize(
|
|
198
|
-
|
|
198
|
+
24942,
|
|
199
199
|
"Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
|
|
200
200
|
)))));
|
|
201
201
|
}
|
|
@@ -208,13 +208,13 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
208
208
|
if (isString(font.weight) && font.weight.match(fontWeightRegex)) {
|
|
209
209
|
fontWeight = font.weight;
|
|
210
210
|
} else {
|
|
211
|
-
warnings.push(( localize(
|
|
211
|
+
warnings.push(( localize(24943, "Invalid font weight in font '{0}'. Ignoring setting.", font.id)));
|
|
212
212
|
}
|
|
213
213
|
let fontStyle = undefined;
|
|
214
214
|
if (isString(font.style) && font.style.match(fontStyleRegex)) {
|
|
215
215
|
fontStyle = font.style;
|
|
216
216
|
} else {
|
|
217
|
-
warnings.push(( localize(
|
|
217
|
+
warnings.push(( localize(24944, "Invalid font style in font '{0}'. Ignoring setting.", font.id)));
|
|
218
218
|
}
|
|
219
219
|
const sanitizedSrc = [];
|
|
220
220
|
if (Array.isArray(font.src)) {
|
|
@@ -226,7 +226,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
226
226
|
format: s.format
|
|
227
227
|
});
|
|
228
228
|
} else {
|
|
229
|
-
warnings.push(( localize(
|
|
229
|
+
warnings.push(( localize(24945, "Invalid font source in font '{0}'. Ignoring source.", font.id)));
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -238,14 +238,14 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
238
238
|
});
|
|
239
239
|
} else {
|
|
240
240
|
warnings.push(( localize(
|
|
241
|
-
|
|
241
|
+
24946,
|
|
242
242
|
"No valid font source in font '{0}'. Ignoring font definition.",
|
|
243
243
|
font.id
|
|
244
244
|
)));
|
|
245
245
|
}
|
|
246
246
|
} else {
|
|
247
247
|
warnings.push(( localize(
|
|
248
|
-
|
|
248
|
+
24947,
|
|
249
249
|
"Missing or invalid font id '{0}'. Skipping font definition.",
|
|
250
250
|
font.id
|
|
251
251
|
)));
|
|
@@ -268,10 +268,10 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
268
268
|
font
|
|
269
269
|
});
|
|
270
270
|
} else {
|
|
271
|
-
warnings.push(( localize(
|
|
271
|
+
warnings.push(( localize(24948, "Skipping icon definition '{0}'. Unknown font.", iconId)));
|
|
272
272
|
}
|
|
273
273
|
} else {
|
|
274
|
-
warnings.push(( localize(
|
|
274
|
+
warnings.push(( localize(24949, "Skipping icon definition '{0}': Needs to be defined", iconId)));
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
2
|
-
import { IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettingTarget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService";
|
|
2
|
+
import { IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettingTarget, IColorMap } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService";
|
|
3
3
|
import { IWorkbenchThemeService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService.service";
|
|
4
4
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
5
5
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
6
6
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
7
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
8
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
8
|
+
import { IDisposable, Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
9
9
|
import { FileIconThemeData } from "./fileIconThemeData.js";
|
|
10
10
|
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
11
11
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
@@ -40,6 +40,7 @@ export declare class WorkbenchThemeService extends Disposable implements IWorkbe
|
|
|
40
40
|
private readonly colorThemeWatcher;
|
|
41
41
|
private colorThemingParticipantChangeListener;
|
|
42
42
|
private readonly colorThemeSequencer;
|
|
43
|
+
private readonly colorThemeOverlays;
|
|
43
44
|
private readonly fileIconThemeRegistry;
|
|
44
45
|
private currentFileIconTheme;
|
|
45
46
|
private readonly onFileIconThemeChange;
|
|
@@ -68,6 +69,10 @@ export declare class WorkbenchThemeService extends Disposable implements IWorkbe
|
|
|
68
69
|
getPreferredColorScheme(): ColorScheme | undefined;
|
|
69
70
|
getMarketplaceColorThemes(publisher: string, name: string, version: string): Promise<IWorkbenchColorTheme[]>;
|
|
70
71
|
get onDidColorThemeChange(): Event<IWorkbenchColorTheme>;
|
|
72
|
+
registerColorThemeOverlay(getColors: (theme: IWorkbenchColorTheme) => IColorMap): IDisposable;
|
|
73
|
+
getBaseColorTheme(): IWorkbenchColorTheme;
|
|
74
|
+
private refreshColorThemeOverlays;
|
|
75
|
+
private applyColorThemeOverlays;
|
|
71
76
|
setColorTheme(themeIdOrTheme: string | undefined | IWorkbenchColorTheme, settingsTarget: ThemeSettingTarget): Promise<IWorkbenchColorTheme | null>;
|
|
72
77
|
private internalSetColorTheme;
|
|
73
78
|
private reloadCurrentColorTheme;
|
|
@@ -16,7 +16,7 @@ import { ColorThemeData } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
16
16
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
17
17
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
18
18
|
import { registerFileIconThemeSchemas } from '../common/fileIconThemeSchema.js';
|
|
19
|
-
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
19
|
+
import { Disposable, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
20
20
|
import { FileIconThemeData, FileIconThemeLoader } from './fileIconThemeData.js';
|
|
21
21
|
import { createStyleSheet, shadowRootContainer } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
|
|
22
22
|
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
@@ -115,6 +115,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
115
115
|
this.languageService = languageService;
|
|
116
116
|
this.notificationService = notificationService;
|
|
117
117
|
this.hostService = hostService;
|
|
118
|
+
this.colorThemeOverlays = ( new Set());
|
|
118
119
|
this.themeExtensionsActivated = ( new Map());
|
|
119
120
|
this.container = layoutService.mainContainer;
|
|
120
121
|
this.settings = ( new ThemeConfiguration(configurationService, hostColorService));
|
|
@@ -291,16 +292,16 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
291
292
|
}
|
|
292
293
|
const keepTheme = await ( new Promise(resolve => {
|
|
293
294
|
this.notificationService.prompt(Severity.Info, ( localize(
|
|
294
|
-
|
|
295
|
+
24950,
|
|
295
296
|
"VS Code has a new default theme: '{0}'.",
|
|
296
297
|
this.getColorTheme().label
|
|
297
298
|
)), [toAction({
|
|
298
299
|
id: "themeUpdated.tryItOut",
|
|
299
|
-
label: ( localize(
|
|
300
|
+
label: ( localize(24951, "Keep It")),
|
|
300
301
|
run: () => resolve(true)
|
|
301
302
|
}), toAction({
|
|
302
303
|
id: "themeUpdated.noThanks",
|
|
303
|
-
label: ( localize(
|
|
304
|
+
label: ( localize(24952, "No Thanks")),
|
|
304
305
|
run: () => resolve(false)
|
|
305
306
|
})], {
|
|
306
307
|
onCancel: () => resolve(false)
|
|
@@ -363,6 +364,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
363
364
|
hasColorChanges = true;
|
|
364
365
|
}
|
|
365
366
|
if (hasColorChanges) {
|
|
367
|
+
this.applyColorThemeOverlays(this.currentColorTheme);
|
|
366
368
|
this.updateDynamicCSSRules(this.currentColorTheme);
|
|
367
369
|
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
368
370
|
}
|
|
@@ -475,6 +477,38 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
475
477
|
get onDidColorThemeChange() {
|
|
476
478
|
return this.onColorThemeChange.event;
|
|
477
479
|
}
|
|
480
|
+
registerColorThemeOverlay(getColors) {
|
|
481
|
+
const overlay = {
|
|
482
|
+
getColors
|
|
483
|
+
};
|
|
484
|
+
this.colorThemeOverlays.add(overlay);
|
|
485
|
+
this.refreshColorThemeOverlays();
|
|
486
|
+
return toDisposable(() => {
|
|
487
|
+
if (this.colorThemeOverlays.delete(overlay) && !this._store.isDisposed) {
|
|
488
|
+
this.refreshColorThemeOverlays();
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
getBaseColorTheme() {
|
|
493
|
+
return this.currentColorTheme.getBaseTheme();
|
|
494
|
+
}
|
|
495
|
+
refreshColorThemeOverlays() {
|
|
496
|
+
this.applyColorThemeOverlays(this.currentColorTheme);
|
|
497
|
+
this.updateDynamicCSSRules(this.currentColorTheme);
|
|
498
|
+
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
499
|
+
}
|
|
500
|
+
applyColorThemeOverlays(theme) {
|
|
501
|
+
if (this.colorThemeOverlays.size) {
|
|
502
|
+
const baseTheme = theme.getBaseTheme();
|
|
503
|
+
const colors = {};
|
|
504
|
+
for (const overlay of this.colorThemeOverlays) {
|
|
505
|
+
Object.assign(colors, overlay.getColors(baseTheme));
|
|
506
|
+
}
|
|
507
|
+
theme.setTransientColors(colors);
|
|
508
|
+
} else {
|
|
509
|
+
theme.setTransientColors(undefined);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
478
512
|
setColorTheme(themeIdOrTheme, settingsTarget) {
|
|
479
513
|
return this.colorThemeSequencer.queue(async () => {
|
|
480
514
|
return this.internalSetColorTheme(themeIdOrTheme, settingsTarget);
|
|
@@ -505,7 +539,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
505
539
|
return this.applyTheme(themeData, settingsTarget);
|
|
506
540
|
} catch (error) {
|
|
507
541
|
throw ( new Error(( localize(
|
|
508
|
-
|
|
542
|
+
24953,
|
|
509
543
|
"Unable to load {0}: {1}",
|
|
510
544
|
themeData.location?.toString(),
|
|
511
545
|
error.message
|
|
@@ -551,6 +585,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
551
585
|
_applyRules(css.code, colorThemeRulesClassName);
|
|
552
586
|
}
|
|
553
587
|
applyTheme(newTheme, settingsTarget, silent = false) {
|
|
588
|
+
this.applyColorThemeOverlays(newTheme);
|
|
554
589
|
this.updateDynamicCSSRules(newTheme);
|
|
555
590
|
if (this.currentColorTheme.id) {
|
|
556
591
|
this.container.classList.remove(...this.currentColorTheme.classNames);
|