@codingame/monaco-vscode-theme-service-override 6.0.3 → 7.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-theme-service-override",
3
- "version": "6.0.3",
3
+ "version": "7.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@6.0.3",
30
- "@codingame/monaco-vscode-files-service-override": "6.0.3"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@7.0.1",
30
+ "@codingame/monaco-vscode-files-service-override": "7.0.1"
31
31
  }
32
32
  }
@@ -365,7 +365,7 @@ function handleParentFolder(key, selectors) {
365
365
  return key;
366
366
  }
367
367
  function escapeCSS(str) {
368
- str = str.replace(/[\11\12\14\15\40]/g, '/');
368
+ str = str.replace(/[\x11\x12\x14\x15\x40]/g, '/');
369
369
  return mainWindow.CSS.escape(str);
370
370
  }
371
371
 
@@ -121,6 +121,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
121
121
  this.onProductIconThemeChange = ( new Emitter());
122
122
  this.currentProductIconTheme = ProductIconThemeData.createUnloadedTheme('');
123
123
  this.productIconThemeSequencer = ( new Sequencer());
124
+ this._register(this.onDidColorThemeChange(theme => getColorRegistry().notifyThemeUpdate(theme)));
124
125
  let themeData = ColorThemeData.fromStorageData(this.storageService);
125
126
  const colorThemeSetting = this.settings.colorTheme;
126
127
  if (themeData && colorThemeSetting !== themeData.settingsId && this.settings.isDefaultColorTheme()) {
@@ -4,9 +4,9 @@ import { Color } from 'vscode/vscode/vs/base/common/color';
4
4
  import { THEME_SCOPE_OPEN_PAREN, THEME_SCOPE_CLOSE_PAREN, THEME_SCOPE_WILDCARD, themeScopeRegex, ExtensionData, VS_HC_LIGHT_THEME, VS_HC_THEME, VS_LIGHT_THEME } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
5
5
  import { convertSettings } from './themeCompatibility.js';
6
6
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
7
- import { isUndefined, isString, isObject, isBoolean } from 'vscode/vscode/vs/base/common/types';
7
+ import { isString, isObject, isBoolean } from 'vscode/vscode/vs/base/common/types';
8
8
  import { extname, joinPath, dirname } from 'vscode/vscode/vs/base/common/resources';
9
- import { Extensions } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
9
+ import { Extensions, DEFAULT_COLOR_CONFIG_VALUE } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
10
10
  import 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
11
11
  import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
12
12
  import { editorForeground, editorBackground } from 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
@@ -94,15 +94,20 @@ class ColorThemeData {
94
94
  return this.textMateThemingRules;
95
95
  }
96
96
  getColor(colorId, useDefault) {
97
- let color = this.customColorMap[colorId];
98
- if (color) {
99
- return color;
97
+ const customColor = this.customColorMap[colorId];
98
+ if (customColor instanceof Color) {
99
+ return customColor;
100
+ }
101
+ if (customColor === undefined) {
102
+ const color = this.colorMap[colorId];
103
+ if (color !== undefined) {
104
+ return color;
105
+ }
100
106
  }
101
- color = this.colorMap[colorId];
102
- if (useDefault !== false && isUndefined(color)) {
103
- color = this.getDefault(colorId);
107
+ if (useDefault !== false) {
108
+ return this.getDefault(colorId);
104
109
  }
105
- return color;
110
+ return undefined;
106
111
  }
107
112
  getTokenStyle(type, modifiers, language, useDefault = true, definitions = {}) {
108
113
  const result = {
@@ -286,7 +291,11 @@ class ColorThemeData {
286
291
  return undefined;
287
292
  }
288
293
  defines(colorId) {
289
- return this.customColorMap.hasOwnProperty(colorId) || this.colorMap.hasOwnProperty(colorId);
294
+ const customColor = this.customColorMap[colorId];
295
+ if (customColor instanceof Color) {
296
+ return true;
297
+ }
298
+ return customColor === undefined && this.colorMap.hasOwnProperty(colorId);
290
299
  }
291
300
  setCustomizations(settings) {
292
301
  this.setCustomColors(settings.colorCustomizations);
@@ -307,7 +316,10 @@ class ColorThemeData {
307
316
  overwriteCustomColors(colors) {
308
317
  for (const id in colors) {
309
318
  const colorVal = colors[id];
310
- if (typeof colorVal === 'string') {
319
+ if (colorVal === DEFAULT_COLOR_CONFIG_VALUE) {
320
+ this.customColorMap[id] = DEFAULT_COLOR_CONFIG_VALUE;
321
+ }
322
+ else if (typeof colorVal === 'string') {
311
323
  this.customColorMap[id] = ( (Color.fromHex(colorVal)));
312
324
  }
313
325
  }
@@ -625,8 +637,11 @@ async function _loadColorTheme(extensionResourceLoaderService, themeLocation, re
625
637
  ))))));
626
638
  }
627
639
  for (const colorId in colors) {
628
- const colorHex = colors[colorId];
629
- if (typeof colorHex === 'string') {
640
+ const colorVal = colors[colorId];
641
+ if (colorVal === DEFAULT_COLOR_CONFIG_VALUE) {
642
+ delete result.colors[colorId];
643
+ }
644
+ else if (typeof colorVal === 'string') {
630
645
  result.colors[colorId] = ( (Color.fromHex(colors[colorId])));
631
646
  }
632
647
  }