material-icon-theme 4.22.0 → 4.23.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.
Files changed (84) hide show
  1. package/.eslintrc.json +51 -51
  2. package/.github/workflows/build.yml +45 -45
  3. package/.github/workflows/color-check.yml +22 -22
  4. package/.github/workflows/release.yml +73 -73
  5. package/.vscodeignore +21 -21
  6. package/CHANGELOG.md +1292 -1267
  7. package/README.md +199 -199
  8. package/icons/craco.svg +45 -0
  9. package/icons/folder-changesets-open.svg +5 -0
  10. package/icons/folder-changesets.svg +2 -0
  11. package/icons/folder-decorators-open.svg +2 -2
  12. package/icons/folder-decorators.svg +5 -5
  13. package/icons/folder-supabase-open.svg +5 -5
  14. package/icons/folder-supabase.svg +2 -2
  15. package/icons/sonarcloud.svg +4 -4
  16. package/icons/stylable.svg +10 -10
  17. package/icons/supabase.svg +4 -4
  18. package/icons/vitest.svg +6 -0
  19. package/images/contributors.png +0 -0
  20. package/images/fileIcons.png +0 -0
  21. package/images/folderIcons.png +0 -0
  22. package/package.json +252 -252
  23. package/package.nls.de.json +32 -32
  24. package/package.nls.es.json +29 -29
  25. package/package.nls.fr.json +29 -29
  26. package/package.nls.ja.json +32 -32
  27. package/package.nls.json +32 -32
  28. package/package.nls.nl.json +32 -32
  29. package/package.nls.pl.json +32 -32
  30. package/package.nls.pt-BR.json +29 -29
  31. package/package.nls.pt-PT.json +29 -29
  32. package/package.nls.ru.json +29 -29
  33. package/package.nls.zh-CN.json +29 -29
  34. package/package.nls.zh-TW.json +29 -29
  35. package/src/commands/activate.ts +28 -28
  36. package/src/commands/explorerArrows.ts +55 -55
  37. package/src/commands/folderColor.ts +96 -96
  38. package/src/commands/folders.ts +55 -55
  39. package/src/commands/grayscale.ts +55 -55
  40. package/src/commands/iconPacks.ts +64 -64
  41. package/src/commands/index.ts +30 -30
  42. package/src/commands/opacity.ts +46 -46
  43. package/src/commands/saturation.ts +46 -46
  44. package/src/extension.ts +37 -37
  45. package/src/helpers/customIcons.ts +8 -8
  46. package/src/helpers/index.ts +88 -88
  47. package/src/i18n/index.ts +78 -78
  48. package/src/i18n/lang-de.ts +43 -43
  49. package/src/i18n/lang-en.ts +43 -43
  50. package/src/i18n/lang-es.ts +43 -43
  51. package/src/i18n/lang-fr.ts +43 -43
  52. package/src/i18n/lang-ja.ts +43 -43
  53. package/src/i18n/lang-nl.ts +43 -43
  54. package/src/i18n/lang-pl.ts +43 -43
  55. package/src/i18n/lang-pt-br.ts +43 -43
  56. package/src/i18n/lang-pt-pt.ts +43 -43
  57. package/src/i18n/lang-ru.ts +43 -43
  58. package/src/i18n/lang-uk.ts +43 -43
  59. package/src/i18n/lang-zh-cn.ts +43 -43
  60. package/src/i18n/lang-zh-tw.ts +43 -43
  61. package/src/icons/fileIcons.ts +2197 -2159
  62. package/src/icons/folderIcons.ts +806 -804
  63. package/src/icons/generator/folderGenerator.ts +340 -340
  64. package/src/icons/generator/iconOpacity.ts +111 -111
  65. package/src/icons/generator/iconSaturation.ts +140 -140
  66. package/src/icons/generator/jsonGenerator.ts +191 -191
  67. package/src/icons/languageIcons.ts +141 -141
  68. package/src/models/i18n/translation.ts +41 -41
  69. package/src/models/iconConfiguration.ts +37 -37
  70. package/src/models/icons/iconJsonOptions.ts +21 -21
  71. package/src/models/index.ts +3 -3
  72. package/src/scripts/contributors/index.ts +138 -138
  73. package/src/scripts/helpers/screenshots.ts +32 -32
  74. package/src/scripts/icons/checks/checkIconAvailability.ts +215 -215
  75. package/src/scripts/icons/checks/checkIconConflicts.ts +152 -152
  76. package/src/scripts/icons/checks/checkIconUsage.ts +137 -137
  77. package/src/scripts/icons/checks/index.ts +7 -7
  78. package/src/scripts/preview/index.ts +40 -40
  79. package/src/scripts/preview/preview.ts +163 -163
  80. package/src/test/runTest.ts +26 -26
  81. package/src/test/spec/i18n/i18n.spec.ts +54 -54
  82. package/src/test/spec/icons/fileIcons.spec.ts +250 -250
  83. package/src/test/spec/icons/folderIcons.spec.ts +418 -418
  84. package/src/test/spec/icons/languageIcons.spec.ts +184 -184
@@ -1,418 +1,418 @@
1
- import { deepStrictEqual } from 'assert';
2
- import merge from 'lodash.merge';
3
- import {
4
- getDefaultIconOptions,
5
- loadFolderIconDefinitions,
6
- } from '../../../icons/index';
7
- import {
8
- FolderTheme,
9
- IconConfiguration,
10
- IconPack,
11
- } from '../../../models/index';
12
-
13
- describe('folder icons', () => {
14
- let folderIcons: FolderTheme[];
15
- let expectedConfig: IconConfiguration;
16
-
17
- before(() => {
18
- folderIcons = [
19
- {
20
- name: 'specific',
21
- defaultIcon: { name: 'folder' },
22
- rootFolder: { name: 'folder-root' },
23
- icons: [
24
- { name: 'folder-src', folderNames: ['src', 'source'] },
25
- {
26
- name: 'folder-angular',
27
- folderNames: ['angular', 'ng'],
28
- enabledFor: [IconPack.Angular, IconPack.Ngrx],
29
- },
30
- ],
31
- },
32
- {
33
- name: 'blue',
34
- defaultIcon: { name: 'folder-blue' },
35
- icons: [{ name: 'folder-blue-src', folderNames: ['src', 'source'] }],
36
- },
37
- { name: 'classic', defaultIcon: { name: 'folder' } },
38
- { name: 'none', defaultIcon: { name: '' } },
39
- ];
40
- });
41
-
42
- beforeEach(() => {
43
- expectedConfig = merge({}, new IconConfiguration(), {
44
- options: getDefaultIconOptions(),
45
- });
46
- });
47
-
48
- it('should configure icon definitions', () => {
49
- const options = getDefaultIconOptions();
50
- const iconConfig = merge({}, new IconConfiguration(), { options });
51
- const iconDefinitions = loadFolderIconDefinitions(
52
- folderIcons,
53
- iconConfig,
54
- options
55
- );
56
-
57
- expectedConfig.iconDefinitions = {
58
- folder: {
59
- iconPath: './../icons/folder.svg',
60
- },
61
- 'folder-open': {
62
- iconPath: './../icons/folder-open.svg',
63
- },
64
- 'folder-root': {
65
- iconPath: './../icons/folder-root.svg',
66
- },
67
- 'folder-root-open': {
68
- iconPath: './../icons/folder-root-open.svg',
69
- },
70
- 'folder-src': {
71
- iconPath: './../icons/folder-src.svg',
72
- },
73
- 'folder-src-open': {
74
- iconPath: './../icons/folder-src-open.svg',
75
- },
76
- 'folder-angular': {
77
- iconPath: './../icons/folder-angular.svg',
78
- },
79
- 'folder-angular-open': {
80
- iconPath: './../icons/folder-angular-open.svg',
81
- },
82
- };
83
- expectedConfig.folder = 'folder';
84
- expectedConfig.folderExpanded = 'folder-open';
85
- expectedConfig.rootFolder = 'folder-root';
86
- expectedConfig.rootFolderExpanded = 'folder-root-open';
87
- expectedConfig.folderNames = {
88
- src: 'folder-src',
89
- source: 'folder-src',
90
- angular: 'folder-angular',
91
- ng: 'folder-angular',
92
- };
93
- expectedConfig.folderNamesExpanded = {
94
- src: 'folder-src-open',
95
- source: 'folder-src-open',
96
- angular: 'folder-angular-open',
97
- ng: 'folder-angular-open',
98
- };
99
- expectedConfig.hidesExplorerArrows = false;
100
-
101
- deepStrictEqual(iconDefinitions, expectedConfig);
102
- });
103
-
104
- it('should deactivate folder icons', () => {
105
- const options = getDefaultIconOptions();
106
- options.folders.theme = 'none';
107
- const iconConfig = merge({}, new IconConfiguration(), { options });
108
- const iconDefinitions = loadFolderIconDefinitions(
109
- folderIcons,
110
- iconConfig,
111
- options
112
- );
113
-
114
- expectedConfig.iconDefinitions = {};
115
- expectedConfig.folderNames = {};
116
- expectedConfig.folderNamesExpanded = {};
117
- expectedConfig.hidesExplorerArrows = false;
118
- expectedConfig.options!.folders!.theme = 'none';
119
-
120
- deepStrictEqual(iconDefinitions, expectedConfig);
121
- });
122
-
123
- it('should enable folder theme', () => {
124
- const options = getDefaultIconOptions();
125
- options.folders.theme = 'blue';
126
- const iconConfig = merge({}, new IconConfiguration(), { options });
127
- const iconDefinitions = loadFolderIconDefinitions(
128
- folderIcons,
129
- iconConfig,
130
- options
131
- );
132
-
133
- expectedConfig.iconDefinitions = {
134
- 'folder-blue': {
135
- iconPath: './../icons/folder-blue.svg',
136
- },
137
- 'folder-blue-open': {
138
- iconPath: './../icons/folder-blue-open.svg',
139
- },
140
- 'folder-blue-src': {
141
- iconPath: './../icons/folder-blue-src.svg',
142
- },
143
- 'folder-blue-src-open': {
144
- iconPath: './../icons/folder-blue-src-open.svg',
145
- },
146
- };
147
- expectedConfig.folder = 'folder-blue';
148
- expectedConfig.folderExpanded = 'folder-blue-open';
149
- expectedConfig.rootFolder = 'folder-blue';
150
- expectedConfig.rootFolderExpanded = 'folder-blue-open';
151
- expectedConfig.folderNames = {
152
- src: 'folder-blue-src',
153
- source: 'folder-blue-src',
154
- };
155
- expectedConfig.folderNamesExpanded = {
156
- src: 'folder-blue-src-open',
157
- source: 'folder-blue-src-open',
158
- };
159
- expectedConfig.hidesExplorerArrows = false;
160
- expectedConfig.options!.folders!.theme = 'blue';
161
-
162
- deepStrictEqual(iconDefinitions, expectedConfig);
163
- });
164
-
165
- it('should configure custom icon associations', () => {
166
- const options = getDefaultIconOptions();
167
- options.folders.associations = {
168
- sample: 'src',
169
- };
170
- const iconConfig = merge({}, new IconConfiguration(), { options });
171
- const iconDefinitions = loadFolderIconDefinitions(
172
- folderIcons,
173
- iconConfig,
174
- options
175
- );
176
- expectedConfig.iconDefinitions = {
177
- folder: {
178
- iconPath: './../icons/folder.svg',
179
- },
180
- 'folder-open': {
181
- iconPath: './../icons/folder-open.svg',
182
- },
183
- 'folder-root': {
184
- iconPath: './../icons/folder-root.svg',
185
- },
186
- 'folder-root-open': {
187
- iconPath: './../icons/folder-root-open.svg',
188
- },
189
- 'folder-src': {
190
- iconPath: './../icons/folder-src.svg',
191
- },
192
- 'folder-src-open': {
193
- iconPath: './../icons/folder-src-open.svg',
194
- },
195
- 'folder-angular': {
196
- iconPath: './../icons/folder-angular.svg',
197
- },
198
- 'folder-angular-open': {
199
- iconPath: './../icons/folder-angular-open.svg',
200
- },
201
- };
202
- expectedConfig.folder = 'folder';
203
- expectedConfig.folderExpanded = 'folder-open';
204
- expectedConfig.rootFolder = 'folder-root';
205
- expectedConfig.rootFolderExpanded = 'folder-root-open';
206
- expectedConfig.folderNames = {
207
- src: 'folder-src',
208
- source: 'folder-src',
209
- angular: 'folder-angular',
210
- ng: 'folder-angular',
211
- sample: 'folder-src',
212
- };
213
- expectedConfig.folderNamesExpanded = {
214
- src: 'folder-src-open',
215
- source: 'folder-src-open',
216
- angular: 'folder-angular-open',
217
- ng: 'folder-angular-open',
218
- sample: 'folder-src-open',
219
- };
220
- expectedConfig.hidesExplorerArrows = false;
221
- expectedConfig.options!.folders!.associations = {
222
- sample: 'src',
223
- };
224
-
225
- deepStrictEqual(iconDefinitions, expectedConfig);
226
- });
227
-
228
- it('should disable icon packs', () => {
229
- const options = getDefaultIconOptions();
230
- options.activeIconPack = '';
231
- const iconConfig = merge({}, new IconConfiguration(), { options });
232
- const iconDefinitions = loadFolderIconDefinitions(
233
- folderIcons,
234
- iconConfig,
235
- options
236
- );
237
- expectedConfig.iconDefinitions = {
238
- folder: {
239
- iconPath: './../icons/folder.svg',
240
- },
241
- 'folder-open': {
242
- iconPath: './../icons/folder-open.svg',
243
- },
244
- 'folder-root': {
245
- iconPath: './../icons/folder-root.svg',
246
- },
247
- 'folder-root-open': {
248
- iconPath: './../icons/folder-root-open.svg',
249
- },
250
- 'folder-src': {
251
- iconPath: './../icons/folder-src.svg',
252
- },
253
- 'folder-src-open': {
254
- iconPath: './../icons/folder-src-open.svg',
255
- },
256
- };
257
- expectedConfig.folder = 'folder';
258
- expectedConfig.folderExpanded = 'folder-open';
259
- expectedConfig.rootFolder = 'folder-root';
260
- expectedConfig.rootFolderExpanded = 'folder-root-open';
261
- expectedConfig.folderNames = {
262
- src: 'folder-src',
263
- source: 'folder-src',
264
- };
265
- expectedConfig.folderNamesExpanded = {
266
- src: 'folder-src-open',
267
- source: 'folder-src-open',
268
- };
269
- expectedConfig.hidesExplorerArrows = false;
270
-
271
- // disable default icon pack by using empty string
272
- expectedConfig.options!.activeIconPack = '';
273
-
274
- deepStrictEqual(iconDefinitions, expectedConfig);
275
- });
276
-
277
- it('should configure folder icons for light and high contrast', () => {
278
- const options = getDefaultIconOptions();
279
- const lightHighContrastFolderIcons: FolderTheme[] = [
280
- {
281
- name: 'specific',
282
- defaultIcon: { name: 'folder', light: true, highContrast: true },
283
- rootFolder: { name: 'folder-root', light: true, highContrast: true },
284
- icons: [
285
- {
286
- name: 'folder-src',
287
- folderNames: ['src', 'source'],
288
- light: true,
289
- highContrast: true,
290
- },
291
- ],
292
- },
293
- ];
294
- const iconConfig = merge({}, new IconConfiguration(), { options });
295
- const iconDefinitions = loadFolderIconDefinitions(
296
- lightHighContrastFolderIcons,
297
- iconConfig,
298
- options
299
- );
300
- /* eslint-disable camelcase */
301
- expectedConfig.iconDefinitions = {
302
- folder: {
303
- iconPath: './../icons/folder.svg',
304
- },
305
- 'folder-open': {
306
- iconPath: './../icons/folder-open.svg',
307
- },
308
- folder_light: {
309
- iconPath: './../icons/folder_light.svg',
310
- },
311
- 'folder-open_light': {
312
- iconPath: './../icons/folder-open_light.svg',
313
- },
314
- folder_highContrast: {
315
- iconPath: './../icons/folder_highContrast.svg',
316
- },
317
- 'folder-open_highContrast': {
318
- iconPath: './../icons/folder-open_highContrast.svg',
319
- },
320
- 'folder-root': {
321
- iconPath: './../icons/folder-root.svg',
322
- },
323
- 'folder-root-open': {
324
- iconPath: './../icons/folder-root-open.svg',
325
- },
326
- 'folder-root_light': {
327
- iconPath: './../icons/folder-root_light.svg',
328
- },
329
- 'folder-root-open_light': {
330
- iconPath: './../icons/folder-root-open_light.svg',
331
- },
332
- 'folder-root_highContrast': {
333
- iconPath: './../icons/folder-root_highContrast.svg',
334
- },
335
- 'folder-root-open_highContrast': {
336
- iconPath: './../icons/folder-root-open_highContrast.svg',
337
- },
338
- 'folder-src': {
339
- iconPath: './../icons/folder-src.svg',
340
- },
341
- 'folder-src-open': {
342
- iconPath: './../icons/folder-src-open.svg',
343
- },
344
- 'folder-src_light': {
345
- iconPath: './../icons/folder-src_light.svg',
346
- },
347
- 'folder-src-open_light': {
348
- iconPath: './../icons/folder-src-open_light.svg',
349
- },
350
- 'folder-src_highContrast': {
351
- iconPath: './../icons/folder-src_highContrast.svg',
352
- },
353
- 'folder-src-open_highContrast': {
354
- iconPath: './../icons/folder-src-open_highContrast.svg',
355
- },
356
- };
357
- expectedConfig.folder = 'folder';
358
- expectedConfig.folderExpanded = 'folder-open';
359
- expectedConfig.rootFolder = 'folder-root';
360
- expectedConfig.rootFolderExpanded = 'folder-root-open';
361
- expectedConfig.folderNames = {
362
- src: 'folder-src',
363
- source: 'folder-src',
364
- };
365
- expectedConfig.folderNamesExpanded = {
366
- src: 'folder-src-open',
367
- source: 'folder-src-open',
368
- };
369
- expectedConfig.light = {
370
- fileExtensions: {},
371
- fileNames: {},
372
- folder: 'folder_light',
373
- folderExpanded: 'folder-open_light',
374
- rootFolder: 'folder-root_light',
375
- rootFolderExpanded: 'folder-root-open_light',
376
- folderNames: {
377
- src: 'folder-src_light',
378
- source: 'folder-src_light',
379
- },
380
- folderNamesExpanded: {
381
- src: 'folder-src-open_light',
382
- source: 'folder-src-open_light',
383
- },
384
- };
385
- expectedConfig.highContrast = {
386
- fileExtensions: {},
387
- fileNames: {},
388
- folder: 'folder_highContrast',
389
- folderExpanded: 'folder-open_highContrast',
390
- rootFolder: 'folder-root_highContrast',
391
- rootFolderExpanded: 'folder-root-open_highContrast',
392
- folderNames: {
393
- src: 'folder-src_highContrast',
394
- source: 'folder-src_highContrast',
395
- },
396
- folderNamesExpanded: {
397
- src: 'folder-src-open_highContrast',
398
- source: 'folder-src-open_highContrast',
399
- },
400
- };
401
- expectedConfig.hidesExplorerArrows = false;
402
- /* eslint-enable camelcase */
403
- deepStrictEqual(iconDefinitions, expectedConfig);
404
- });
405
-
406
- it('should hide explorer arrows', () => {
407
- const options = getDefaultIconOptions();
408
- options.hidesExplorerArrows = true;
409
- const iconConfig = merge({}, new IconConfiguration(), { options });
410
- const iconDefinitions = loadFolderIconDefinitions(
411
- folderIcons,
412
- iconConfig,
413
- options
414
- );
415
-
416
- deepStrictEqual(iconDefinitions.hidesExplorerArrows, true);
417
- });
418
- });
1
+ import { deepStrictEqual } from 'assert';
2
+ import merge from 'lodash.merge';
3
+ import {
4
+ getDefaultIconOptions,
5
+ loadFolderIconDefinitions,
6
+ } from '../../../icons/index';
7
+ import {
8
+ FolderTheme,
9
+ IconConfiguration,
10
+ IconPack,
11
+ } from '../../../models/index';
12
+
13
+ describe('folder icons', () => {
14
+ let folderIcons: FolderTheme[];
15
+ let expectedConfig: IconConfiguration;
16
+
17
+ before(() => {
18
+ folderIcons = [
19
+ {
20
+ name: 'specific',
21
+ defaultIcon: { name: 'folder' },
22
+ rootFolder: { name: 'folder-root' },
23
+ icons: [
24
+ { name: 'folder-src', folderNames: ['src', 'source'] },
25
+ {
26
+ name: 'folder-angular',
27
+ folderNames: ['angular', 'ng'],
28
+ enabledFor: [IconPack.Angular, IconPack.Ngrx],
29
+ },
30
+ ],
31
+ },
32
+ {
33
+ name: 'blue',
34
+ defaultIcon: { name: 'folder-blue' },
35
+ icons: [{ name: 'folder-blue-src', folderNames: ['src', 'source'] }],
36
+ },
37
+ { name: 'classic', defaultIcon: { name: 'folder' } },
38
+ { name: 'none', defaultIcon: { name: '' } },
39
+ ];
40
+ });
41
+
42
+ beforeEach(() => {
43
+ expectedConfig = merge({}, new IconConfiguration(), {
44
+ options: getDefaultIconOptions(),
45
+ });
46
+ });
47
+
48
+ it('should configure icon definitions', () => {
49
+ const options = getDefaultIconOptions();
50
+ const iconConfig = merge({}, new IconConfiguration(), { options });
51
+ const iconDefinitions = loadFolderIconDefinitions(
52
+ folderIcons,
53
+ iconConfig,
54
+ options
55
+ );
56
+
57
+ expectedConfig.iconDefinitions = {
58
+ folder: {
59
+ iconPath: './../icons/folder.svg',
60
+ },
61
+ 'folder-open': {
62
+ iconPath: './../icons/folder-open.svg',
63
+ },
64
+ 'folder-root': {
65
+ iconPath: './../icons/folder-root.svg',
66
+ },
67
+ 'folder-root-open': {
68
+ iconPath: './../icons/folder-root-open.svg',
69
+ },
70
+ 'folder-src': {
71
+ iconPath: './../icons/folder-src.svg',
72
+ },
73
+ 'folder-src-open': {
74
+ iconPath: './../icons/folder-src-open.svg',
75
+ },
76
+ 'folder-angular': {
77
+ iconPath: './../icons/folder-angular.svg',
78
+ },
79
+ 'folder-angular-open': {
80
+ iconPath: './../icons/folder-angular-open.svg',
81
+ },
82
+ };
83
+ expectedConfig.folder = 'folder';
84
+ expectedConfig.folderExpanded = 'folder-open';
85
+ expectedConfig.rootFolder = 'folder-root';
86
+ expectedConfig.rootFolderExpanded = 'folder-root-open';
87
+ expectedConfig.folderNames = {
88
+ src: 'folder-src',
89
+ source: 'folder-src',
90
+ angular: 'folder-angular',
91
+ ng: 'folder-angular',
92
+ };
93
+ expectedConfig.folderNamesExpanded = {
94
+ src: 'folder-src-open',
95
+ source: 'folder-src-open',
96
+ angular: 'folder-angular-open',
97
+ ng: 'folder-angular-open',
98
+ };
99
+ expectedConfig.hidesExplorerArrows = false;
100
+
101
+ deepStrictEqual(iconDefinitions, expectedConfig);
102
+ });
103
+
104
+ it('should deactivate folder icons', () => {
105
+ const options = getDefaultIconOptions();
106
+ options.folders.theme = 'none';
107
+ const iconConfig = merge({}, new IconConfiguration(), { options });
108
+ const iconDefinitions = loadFolderIconDefinitions(
109
+ folderIcons,
110
+ iconConfig,
111
+ options
112
+ );
113
+
114
+ expectedConfig.iconDefinitions = {};
115
+ expectedConfig.folderNames = {};
116
+ expectedConfig.folderNamesExpanded = {};
117
+ expectedConfig.hidesExplorerArrows = false;
118
+ expectedConfig.options!.folders!.theme = 'none';
119
+
120
+ deepStrictEqual(iconDefinitions, expectedConfig);
121
+ });
122
+
123
+ it('should enable folder theme', () => {
124
+ const options = getDefaultIconOptions();
125
+ options.folders.theme = 'blue';
126
+ const iconConfig = merge({}, new IconConfiguration(), { options });
127
+ const iconDefinitions = loadFolderIconDefinitions(
128
+ folderIcons,
129
+ iconConfig,
130
+ options
131
+ );
132
+
133
+ expectedConfig.iconDefinitions = {
134
+ 'folder-blue': {
135
+ iconPath: './../icons/folder-blue.svg',
136
+ },
137
+ 'folder-blue-open': {
138
+ iconPath: './../icons/folder-blue-open.svg',
139
+ },
140
+ 'folder-blue-src': {
141
+ iconPath: './../icons/folder-blue-src.svg',
142
+ },
143
+ 'folder-blue-src-open': {
144
+ iconPath: './../icons/folder-blue-src-open.svg',
145
+ },
146
+ };
147
+ expectedConfig.folder = 'folder-blue';
148
+ expectedConfig.folderExpanded = 'folder-blue-open';
149
+ expectedConfig.rootFolder = 'folder-blue';
150
+ expectedConfig.rootFolderExpanded = 'folder-blue-open';
151
+ expectedConfig.folderNames = {
152
+ src: 'folder-blue-src',
153
+ source: 'folder-blue-src',
154
+ };
155
+ expectedConfig.folderNamesExpanded = {
156
+ src: 'folder-blue-src-open',
157
+ source: 'folder-blue-src-open',
158
+ };
159
+ expectedConfig.hidesExplorerArrows = false;
160
+ expectedConfig.options!.folders!.theme = 'blue';
161
+
162
+ deepStrictEqual(iconDefinitions, expectedConfig);
163
+ });
164
+
165
+ it('should configure custom icon associations', () => {
166
+ const options = getDefaultIconOptions();
167
+ options.folders.associations = {
168
+ sample: 'src',
169
+ };
170
+ const iconConfig = merge({}, new IconConfiguration(), { options });
171
+ const iconDefinitions = loadFolderIconDefinitions(
172
+ folderIcons,
173
+ iconConfig,
174
+ options
175
+ );
176
+ expectedConfig.iconDefinitions = {
177
+ folder: {
178
+ iconPath: './../icons/folder.svg',
179
+ },
180
+ 'folder-open': {
181
+ iconPath: './../icons/folder-open.svg',
182
+ },
183
+ 'folder-root': {
184
+ iconPath: './../icons/folder-root.svg',
185
+ },
186
+ 'folder-root-open': {
187
+ iconPath: './../icons/folder-root-open.svg',
188
+ },
189
+ 'folder-src': {
190
+ iconPath: './../icons/folder-src.svg',
191
+ },
192
+ 'folder-src-open': {
193
+ iconPath: './../icons/folder-src-open.svg',
194
+ },
195
+ 'folder-angular': {
196
+ iconPath: './../icons/folder-angular.svg',
197
+ },
198
+ 'folder-angular-open': {
199
+ iconPath: './../icons/folder-angular-open.svg',
200
+ },
201
+ };
202
+ expectedConfig.folder = 'folder';
203
+ expectedConfig.folderExpanded = 'folder-open';
204
+ expectedConfig.rootFolder = 'folder-root';
205
+ expectedConfig.rootFolderExpanded = 'folder-root-open';
206
+ expectedConfig.folderNames = {
207
+ src: 'folder-src',
208
+ source: 'folder-src',
209
+ angular: 'folder-angular',
210
+ ng: 'folder-angular',
211
+ sample: 'folder-src',
212
+ };
213
+ expectedConfig.folderNamesExpanded = {
214
+ src: 'folder-src-open',
215
+ source: 'folder-src-open',
216
+ angular: 'folder-angular-open',
217
+ ng: 'folder-angular-open',
218
+ sample: 'folder-src-open',
219
+ };
220
+ expectedConfig.hidesExplorerArrows = false;
221
+ expectedConfig.options!.folders!.associations = {
222
+ sample: 'src',
223
+ };
224
+
225
+ deepStrictEqual(iconDefinitions, expectedConfig);
226
+ });
227
+
228
+ it('should disable icon packs', () => {
229
+ const options = getDefaultIconOptions();
230
+ options.activeIconPack = '';
231
+ const iconConfig = merge({}, new IconConfiguration(), { options });
232
+ const iconDefinitions = loadFolderIconDefinitions(
233
+ folderIcons,
234
+ iconConfig,
235
+ options
236
+ );
237
+ expectedConfig.iconDefinitions = {
238
+ folder: {
239
+ iconPath: './../icons/folder.svg',
240
+ },
241
+ 'folder-open': {
242
+ iconPath: './../icons/folder-open.svg',
243
+ },
244
+ 'folder-root': {
245
+ iconPath: './../icons/folder-root.svg',
246
+ },
247
+ 'folder-root-open': {
248
+ iconPath: './../icons/folder-root-open.svg',
249
+ },
250
+ 'folder-src': {
251
+ iconPath: './../icons/folder-src.svg',
252
+ },
253
+ 'folder-src-open': {
254
+ iconPath: './../icons/folder-src-open.svg',
255
+ },
256
+ };
257
+ expectedConfig.folder = 'folder';
258
+ expectedConfig.folderExpanded = 'folder-open';
259
+ expectedConfig.rootFolder = 'folder-root';
260
+ expectedConfig.rootFolderExpanded = 'folder-root-open';
261
+ expectedConfig.folderNames = {
262
+ src: 'folder-src',
263
+ source: 'folder-src',
264
+ };
265
+ expectedConfig.folderNamesExpanded = {
266
+ src: 'folder-src-open',
267
+ source: 'folder-src-open',
268
+ };
269
+ expectedConfig.hidesExplorerArrows = false;
270
+
271
+ // disable default icon pack by using empty string
272
+ expectedConfig.options!.activeIconPack = '';
273
+
274
+ deepStrictEqual(iconDefinitions, expectedConfig);
275
+ });
276
+
277
+ it('should configure folder icons for light and high contrast', () => {
278
+ const options = getDefaultIconOptions();
279
+ const lightHighContrastFolderIcons: FolderTheme[] = [
280
+ {
281
+ name: 'specific',
282
+ defaultIcon: { name: 'folder', light: true, highContrast: true },
283
+ rootFolder: { name: 'folder-root', light: true, highContrast: true },
284
+ icons: [
285
+ {
286
+ name: 'folder-src',
287
+ folderNames: ['src', 'source'],
288
+ light: true,
289
+ highContrast: true,
290
+ },
291
+ ],
292
+ },
293
+ ];
294
+ const iconConfig = merge({}, new IconConfiguration(), { options });
295
+ const iconDefinitions = loadFolderIconDefinitions(
296
+ lightHighContrastFolderIcons,
297
+ iconConfig,
298
+ options
299
+ );
300
+ /* eslint-disable camelcase */
301
+ expectedConfig.iconDefinitions = {
302
+ folder: {
303
+ iconPath: './../icons/folder.svg',
304
+ },
305
+ 'folder-open': {
306
+ iconPath: './../icons/folder-open.svg',
307
+ },
308
+ folder_light: {
309
+ iconPath: './../icons/folder_light.svg',
310
+ },
311
+ 'folder-open_light': {
312
+ iconPath: './../icons/folder-open_light.svg',
313
+ },
314
+ folder_highContrast: {
315
+ iconPath: './../icons/folder_highContrast.svg',
316
+ },
317
+ 'folder-open_highContrast': {
318
+ iconPath: './../icons/folder-open_highContrast.svg',
319
+ },
320
+ 'folder-root': {
321
+ iconPath: './../icons/folder-root.svg',
322
+ },
323
+ 'folder-root-open': {
324
+ iconPath: './../icons/folder-root-open.svg',
325
+ },
326
+ 'folder-root_light': {
327
+ iconPath: './../icons/folder-root_light.svg',
328
+ },
329
+ 'folder-root-open_light': {
330
+ iconPath: './../icons/folder-root-open_light.svg',
331
+ },
332
+ 'folder-root_highContrast': {
333
+ iconPath: './../icons/folder-root_highContrast.svg',
334
+ },
335
+ 'folder-root-open_highContrast': {
336
+ iconPath: './../icons/folder-root-open_highContrast.svg',
337
+ },
338
+ 'folder-src': {
339
+ iconPath: './../icons/folder-src.svg',
340
+ },
341
+ 'folder-src-open': {
342
+ iconPath: './../icons/folder-src-open.svg',
343
+ },
344
+ 'folder-src_light': {
345
+ iconPath: './../icons/folder-src_light.svg',
346
+ },
347
+ 'folder-src-open_light': {
348
+ iconPath: './../icons/folder-src-open_light.svg',
349
+ },
350
+ 'folder-src_highContrast': {
351
+ iconPath: './../icons/folder-src_highContrast.svg',
352
+ },
353
+ 'folder-src-open_highContrast': {
354
+ iconPath: './../icons/folder-src-open_highContrast.svg',
355
+ },
356
+ };
357
+ expectedConfig.folder = 'folder';
358
+ expectedConfig.folderExpanded = 'folder-open';
359
+ expectedConfig.rootFolder = 'folder-root';
360
+ expectedConfig.rootFolderExpanded = 'folder-root-open';
361
+ expectedConfig.folderNames = {
362
+ src: 'folder-src',
363
+ source: 'folder-src',
364
+ };
365
+ expectedConfig.folderNamesExpanded = {
366
+ src: 'folder-src-open',
367
+ source: 'folder-src-open',
368
+ };
369
+ expectedConfig.light = {
370
+ fileExtensions: {},
371
+ fileNames: {},
372
+ folder: 'folder_light',
373
+ folderExpanded: 'folder-open_light',
374
+ rootFolder: 'folder-root_light',
375
+ rootFolderExpanded: 'folder-root-open_light',
376
+ folderNames: {
377
+ src: 'folder-src_light',
378
+ source: 'folder-src_light',
379
+ },
380
+ folderNamesExpanded: {
381
+ src: 'folder-src-open_light',
382
+ source: 'folder-src-open_light',
383
+ },
384
+ };
385
+ expectedConfig.highContrast = {
386
+ fileExtensions: {},
387
+ fileNames: {},
388
+ folder: 'folder_highContrast',
389
+ folderExpanded: 'folder-open_highContrast',
390
+ rootFolder: 'folder-root_highContrast',
391
+ rootFolderExpanded: 'folder-root-open_highContrast',
392
+ folderNames: {
393
+ src: 'folder-src_highContrast',
394
+ source: 'folder-src_highContrast',
395
+ },
396
+ folderNamesExpanded: {
397
+ src: 'folder-src-open_highContrast',
398
+ source: 'folder-src-open_highContrast',
399
+ },
400
+ };
401
+ expectedConfig.hidesExplorerArrows = false;
402
+ /* eslint-enable camelcase */
403
+ deepStrictEqual(iconDefinitions, expectedConfig);
404
+ });
405
+
406
+ it('should hide explorer arrows', () => {
407
+ const options = getDefaultIconOptions();
408
+ options.hidesExplorerArrows = true;
409
+ const iconConfig = merge({}, new IconConfiguration(), { options });
410
+ const iconDefinitions = loadFolderIconDefinitions(
411
+ folderIcons,
412
+ iconConfig,
413
+ options
414
+ );
415
+
416
+ deepStrictEqual(iconDefinitions.hidesExplorerArrows, true);
417
+ });
418
+ });