@codingame/monaco-vscode-theme-service-override 1.83.16 → 1.85.0-next.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/package.json +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +18 -1
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +4 -5
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +72 -0
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-theme-service-override",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.85.0-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
22
|
-
"monaco-editor": "0.
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "1.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.0",
|
|
22
|
+
"monaco-editor": "0.45.0",
|
|
23
|
+
"@codingame/monaco-vscode-files-service-override": "1.85.0-next.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -5,6 +5,7 @@ import * as json from 'monaco-editor/esm/vs/base/common/json.js';
|
|
|
5
5
|
import { ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
6
6
|
import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMessages';
|
|
7
7
|
import { asCSSUrl } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
8
|
+
import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
|
|
8
9
|
|
|
9
10
|
class FileIconThemeData {
|
|
10
11
|
static { this.STORAGE_KEY = 'iconThemeData'; }
|
|
@@ -223,6 +224,22 @@ class FileIconThemeLoader {
|
|
|
223
224
|
result.hasFolderIcons = true;
|
|
224
225
|
}
|
|
225
226
|
}
|
|
227
|
+
const rootFolderNames = associations.rootFolderNames;
|
|
228
|
+
if (rootFolderNames) {
|
|
229
|
+
for (const key in rootFolderNames) {
|
|
230
|
+
const name = key.toLowerCase();
|
|
231
|
+
addSelector(`${qualifier} .${escapeCSS(name)}-root-name-folder-icon.rootfolder-icon::before`, rootFolderNames[key]);
|
|
232
|
+
result.hasFolderIcons = true;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const rootFolderNamesExpanded = associations.rootFolderNamesExpanded;
|
|
236
|
+
if (rootFolderNamesExpanded) {
|
|
237
|
+
for (const key in rootFolderNamesExpanded) {
|
|
238
|
+
const name = key.toLowerCase();
|
|
239
|
+
addSelector(`${qualifier} ${expanded} .${escapeCSS(name)}-root-name-folder-icon.rootfolder-icon::before`, rootFolderNamesExpanded[key]);
|
|
240
|
+
result.hasFolderIcons = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
226
243
|
const languageIds = associations.languageIds;
|
|
227
244
|
if (languageIds) {
|
|
228
245
|
if (!languageIds.jsonc && languageIds.json) {
|
|
@@ -351,7 +368,7 @@ function handleParentFolder(key, selectors) {
|
|
|
351
368
|
}
|
|
352
369
|
function escapeCSS(str) {
|
|
353
370
|
str = str.replace(/[\11\12\14\15\40]/g, '/');
|
|
354
|
-
return
|
|
371
|
+
return mainWindow.CSS.escape(str);
|
|
355
372
|
}
|
|
356
373
|
|
|
357
374
|
export { FileIconThemeData, FileIconThemeLoader };
|
|
@@ -35,6 +35,7 @@ import { IUserDataInitializationService } from 'vscode/vscode/vs/workbench/servi
|
|
|
35
35
|
import { getIconsStyleSheet } from 'monaco-editor/esm/vs/platform/theme/browser/iconsStyleSheet.js';
|
|
36
36
|
import { getColorRegistry, asCssVariableName } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
37
37
|
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
38
|
+
import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
|
|
38
39
|
|
|
39
40
|
const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme';
|
|
40
41
|
const PERSISTED_OS_COLOR_SCHEME_SCOPE = -1 ;
|
|
@@ -69,7 +70,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
69
70
|
this.userDataInitializationService = userDataInitializationService;
|
|
70
71
|
this.hasDefaultUpdated = false;
|
|
71
72
|
this.themeExtensionsActivated = ( new Map());
|
|
72
|
-
this.container = layoutService.
|
|
73
|
+
this.container = layoutService.mainContainer;
|
|
73
74
|
this.settings = ( new ThemeConfiguration(configurationService));
|
|
74
75
|
this.colorThemeRegistry = ( new ThemeRegistry(colorThemesExtPoint, ColorThemeData.fromExtensionTheme));
|
|
75
76
|
this.colorThemeWatcher = ( new ThemeFileWatcher(fileService, environmentService, this.reloadCurrentColorTheme.bind(this)));
|
|
@@ -738,13 +739,11 @@ class ThemeFileWatcher {
|
|
|
738
739
|
}
|
|
739
740
|
}
|
|
740
741
|
function _applyRules(styleSheetContent, rulesClassName) {
|
|
741
|
-
const themeStyles = document.head.getElementsByClassName(rulesClassName);
|
|
742
|
+
const themeStyles = mainWindow.document.head.getElementsByClassName(rulesClassName);
|
|
742
743
|
if (themeStyles.length === 0) {
|
|
743
|
-
const elStyle =
|
|
744
|
-
elStyle.type = 'text/css';
|
|
744
|
+
const elStyle = createStyleSheet();
|
|
745
745
|
elStyle.className = rulesClassName;
|
|
746
746
|
elStyle.textContent = styleSheetContent;
|
|
747
|
-
document.head.appendChild(elStyle);
|
|
748
747
|
}
|
|
749
748
|
else {
|
|
750
749
|
themeStyles[0].textContent = styleSheetContent;
|
|
@@ -33,6 +33,54 @@ const schema = {
|
|
|
33
33
|
'The default file icon, shown for all files that don\'t match any extension, filename or language id.'
|
|
34
34
|
))
|
|
35
35
|
},
|
|
36
|
+
rootFolder: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: ( nls.localizeWithPath(
|
|
39
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
40
|
+
'schema.rootFolder',
|
|
41
|
+
'The folder icon for collapsed root folders, and if rootFolderExpanded is not set, also for expanded root folders.'
|
|
42
|
+
))
|
|
43
|
+
},
|
|
44
|
+
rootFolderExpanded: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: ( nls.localizeWithPath(
|
|
47
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
48
|
+
'schema.rootFolderExpanded',
|
|
49
|
+
'The folder icon for expanded root folders. The expanded root folder icon is optional. If not set, the icon defined for root folder will be shown.'
|
|
50
|
+
))
|
|
51
|
+
},
|
|
52
|
+
rootFolderNames: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
description: ( nls.localizeWithPath(
|
|
55
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
56
|
+
'schema.rootFolderNames',
|
|
57
|
+
'Associates root folder names to icons. The object key is the root folder name. No patterns or wildcards are allowed. Root folder name matching is case insensitive.'
|
|
58
|
+
)),
|
|
59
|
+
additionalProperties: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: ( nls.localizeWithPath(
|
|
62
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
63
|
+
'schema.folderName',
|
|
64
|
+
'The ID of the icon definition for the association.'
|
|
65
|
+
))
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
rootFolderNamesExpanded: {
|
|
69
|
+
type: 'object',
|
|
70
|
+
description: ( nls.localizeWithPath(
|
|
71
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
72
|
+
'schema.rootFolderNamesExpanded',
|
|
73
|
+
'Associates root folder names to icons for expanded root folders. The object key is the root folder name. No patterns or wildcards are allowed. Root folder name matching is case insensitive.'
|
|
74
|
+
)),
|
|
75
|
+
additionalProperties: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: ( nls.localizeWithPath(
|
|
78
|
+
'vs/workbench/services/themes/common/fileIconThemeSchema',
|
|
79
|
+
'schema.rootFolderNameExpanded',
|
|
80
|
+
'The ID of the icon definition for the association.'
|
|
81
|
+
))
|
|
82
|
+
}
|
|
83
|
+
},
|
|
36
84
|
folderNames: {
|
|
37
85
|
type: 'object',
|
|
38
86
|
description: ( nls.localizeWithPath(
|
|
@@ -131,6 +179,18 @@ const schema = {
|
|
|
131
179
|
folderNamesExpanded: {
|
|
132
180
|
$ref: '#/definitions/folderNamesExpanded'
|
|
133
181
|
},
|
|
182
|
+
rootFolder: {
|
|
183
|
+
$ref: '#/definitions/rootFolder'
|
|
184
|
+
},
|
|
185
|
+
rootFolderExpanded: {
|
|
186
|
+
$ref: '#/definitions/rootFolderExpanded'
|
|
187
|
+
},
|
|
188
|
+
rootFolderNames: {
|
|
189
|
+
$ref: '#/definitions/rootFolderNames'
|
|
190
|
+
},
|
|
191
|
+
rootFolderNamesExpanded: {
|
|
192
|
+
$ref: '#/definitions/rootFolderNamesExpanded'
|
|
193
|
+
},
|
|
134
194
|
fileExtensions: {
|
|
135
195
|
$ref: '#/definitions/fileExtensions'
|
|
136
196
|
},
|
|
@@ -311,6 +371,18 @@ const schema = {
|
|
|
311
371
|
folderNamesExpanded: {
|
|
312
372
|
$ref: '#/definitions/folderNamesExpanded'
|
|
313
373
|
},
|
|
374
|
+
rootFolder: {
|
|
375
|
+
$ref: '#/definitions/rootFolder'
|
|
376
|
+
},
|
|
377
|
+
rootFolderExpanded: {
|
|
378
|
+
$ref: '#/definitions/rootFolderExpanded'
|
|
379
|
+
},
|
|
380
|
+
rootFolderNames: {
|
|
381
|
+
$ref: '#/definitions/rootFolderNames'
|
|
382
|
+
},
|
|
383
|
+
rootFolderNamesExpanded: {
|
|
384
|
+
$ref: '#/definitions/rootFolderNamesExpanded'
|
|
385
|
+
},
|
|
314
386
|
fileExtensions: {
|
|
315
387
|
$ref: '#/definitions/fileExtensions'
|
|
316
388
|
},
|
|
@@ -184,7 +184,7 @@ const detectHCSchemeSettingSchema = {
|
|
|
184
184
|
markdownDescription: ( nls.localizeWithPath(
|
|
185
185
|
'vs/workbench/services/themes/common/themeConfiguration',
|
|
186
186
|
{ key: 'autoDetectHighContrast', comment: ['{0} and {1} will become links to other settings.'] },
|
|
187
|
-
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by {0} and {1}",
|
|
187
|
+
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by {0} and {1}.",
|
|
188
188
|
formatSettingAsLink(ThemeSettings.PREFERRED_HC_DARK_THEME),
|
|
189
189
|
formatSettingAsLink(ThemeSettings.PREFERRED_HC_LIGHT_THEME)
|
|
190
190
|
)),
|