material-icon-theme 4.23.1 → 4.25.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.
Files changed (108) hide show
  1. package/.eslintrc.json +51 -51
  2. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +7 -0
  3. package/.github/workflows/build.yml +45 -45
  4. package/.github/workflows/color-check.yml +22 -22
  5. package/.github/workflows/release.yml +73 -73
  6. package/.vscodeignore +21 -21
  7. package/CHANGELOG.md +1325 -1292
  8. package/CONTRIBUTING.md +199 -29
  9. package/README.md +198 -199
  10. package/icons/bitbucket.svg +13 -1
  11. package/icons/bun.svg +2 -0
  12. package/icons/bun_light.svg +2 -0
  13. package/icons/craco.svg +45 -45
  14. package/icons/folder-changesets-open.svg +5 -5
  15. package/icons/folder-changesets.svg +2 -2
  16. package/icons/folder-decorators-open.svg +2 -2
  17. package/icons/folder-decorators.svg +5 -5
  18. package/icons/folder-gamemaker-open.svg +2 -0
  19. package/icons/folder-gamemaker.svg +2 -0
  20. package/icons/folder-supabase-open.svg +5 -5
  21. package/icons/folder-supabase.svg +2 -2
  22. package/icons/gamemaker.svg +4 -0
  23. package/icons/objective-c.svg +1 -0
  24. package/icons/objective-cpp.svg +1 -0
  25. package/icons/pascal.svg +6 -1
  26. package/icons/sonarcloud.svg +4 -4
  27. package/icons/stylable.svg +10 -10
  28. package/icons/supabase.svg +4 -4
  29. package/icons/tldraw.svg +4 -0
  30. package/icons/tldraw_light.svg +4 -0
  31. package/icons/vitest.svg +6 -6
  32. package/images/contributors.png +0 -0
  33. package/images/fileIcons.png +0 -0
  34. package/images/folderIcons.png +0 -0
  35. package/images/how-tos/folder-icon-parts.png +0 -0
  36. package/images/how-tos/pick-folder-colors.png +0 -0
  37. package/images/how-tos/pick-folder-colors.svg +301 -0
  38. package/images/how-tos/svg-folder-icon-with-correct-colors.png +0 -0
  39. package/images/how-tos/svg-folder-icon-with-wrong-colors.png +0 -0
  40. package/images/how-tos/svg-with-light-color.png +0 -0
  41. package/images/how-tos/svg-with-spacing.png +0 -0
  42. package/images/how-tos/svg-with-too-dark-color.png +0 -0
  43. package/images/how-tos/svg-with-wrong-color.png +0 -0
  44. package/images/how-tos/svg-without-spacing.png +0 -0
  45. package/package.json +252 -252
  46. package/package.nls.de.json +32 -32
  47. package/package.nls.es.json +29 -29
  48. package/package.nls.fr.json +29 -29
  49. package/package.nls.ja.json +32 -32
  50. package/package.nls.json +32 -32
  51. package/package.nls.nl.json +32 -32
  52. package/package.nls.pl.json +32 -32
  53. package/package.nls.pt-BR.json +29 -29
  54. package/package.nls.pt-PT.json +29 -29
  55. package/package.nls.ru.json +29 -29
  56. package/package.nls.zh-CN.json +29 -29
  57. package/package.nls.zh-TW.json +29 -29
  58. package/src/commands/activate.ts +28 -28
  59. package/src/commands/explorerArrows.ts +55 -55
  60. package/src/commands/folderColor.ts +96 -96
  61. package/src/commands/folders.ts +55 -55
  62. package/src/commands/grayscale.ts +55 -55
  63. package/src/commands/iconPacks.ts +64 -64
  64. package/src/commands/index.ts +30 -30
  65. package/src/commands/opacity.ts +46 -46
  66. package/src/commands/saturation.ts +46 -46
  67. package/src/extension.ts +37 -37
  68. package/src/helpers/customIcons.ts +8 -8
  69. package/src/helpers/index.ts +88 -88
  70. package/src/i18n/index.ts +78 -78
  71. package/src/i18n/lang-de.ts +43 -43
  72. package/src/i18n/lang-en.ts +43 -43
  73. package/src/i18n/lang-es.ts +43 -43
  74. package/src/i18n/lang-fr.ts +43 -43
  75. package/src/i18n/lang-ja.ts +43 -43
  76. package/src/i18n/lang-nl.ts +43 -43
  77. package/src/i18n/lang-pl.ts +43 -43
  78. package/src/i18n/lang-pt-br.ts +43 -43
  79. package/src/i18n/lang-pt-pt.ts +43 -43
  80. package/src/i18n/lang-ru.ts +43 -43
  81. package/src/i18n/lang-uk.ts +43 -43
  82. package/src/i18n/lang-zh-cn.ts +43 -43
  83. package/src/i18n/lang-zh-tw.ts +43 -43
  84. package/src/icons/fileIcons.ts +2240 -2197
  85. package/src/icons/folderIcons.ts +823 -806
  86. package/src/icons/generator/folderGenerator.ts +340 -340
  87. package/src/icons/generator/iconOpacity.ts +111 -111
  88. package/src/icons/generator/iconSaturation.ts +140 -140
  89. package/src/icons/generator/jsonGenerator.ts +191 -191
  90. package/src/icons/languageIcons.ts +144 -141
  91. package/src/models/i18n/translation.ts +41 -41
  92. package/src/models/iconConfiguration.ts +37 -37
  93. package/src/models/icons/iconJsonOptions.ts +21 -21
  94. package/src/models/index.ts +3 -3
  95. package/src/scripts/contributors/index.ts +138 -138
  96. package/src/scripts/helpers/screenshots.ts +32 -32
  97. package/src/scripts/icons/checks/checkIconAvailability.ts +215 -215
  98. package/src/scripts/icons/checks/checkIconConflicts.ts +152 -152
  99. package/src/scripts/icons/checks/checkIconUsage.ts +137 -137
  100. package/src/scripts/icons/checks/index.ts +7 -7
  101. package/src/scripts/preview/index.ts +40 -40
  102. package/src/scripts/preview/preview.ts +163 -163
  103. package/src/test/runTest.ts +26 -26
  104. package/src/test/spec/i18n/i18n.spec.ts +54 -54
  105. package/src/test/spec/icons/fileIcons.spec.ts +250 -250
  106. package/src/test/spec/icons/folderIcons.spec.ts +418 -418
  107. package/src/test/spec/icons/languageIcons.spec.ts +184 -184
  108. package/images/bloop.png +0 -0
@@ -1,163 +1,163 @@
1
- import { writeFileSync } from 'fs';
2
- import { join } from 'path';
3
- import { green, red } from '../helpers/painter';
4
- import { createScreenshot } from '../helpers/screenshots';
5
- import { toTitleCase } from './../helpers/titleCase';
6
-
7
- const htmlDoctype = '<!DOCTYPE html>';
8
- const cssFilePath = 'style.css';
9
- const styling = `<link rel="stylesheet" href="${cssFilePath}">`;
10
-
11
- const createHTMLTableHeadRow = (amount: number) => {
12
- const pair = `
13
- <th class="icon">Icon</th>
14
- <th class="iconName">Name</th>
15
- `;
16
- const columns = [...Array(amount)].map(() => pair).join('');
17
- return `
18
- <tr>
19
- ${columns}
20
- </tr>
21
- `;
22
- };
23
-
24
- const createHTMLTableBodyRows = (items: IconDefinition[][]) => {
25
- let rows = '';
26
- items.forEach((row) => {
27
- const columns = row
28
- .map(
29
- (icon) => `
30
- <td class="icon">
31
- <img src="./../../../icons/${icon.iconName}.svg" alt="${
32
- icon.label
33
- }">
34
- </td>
35
- <td class="iconName">${toTitleCase(icon.label)}</td>
36
- `
37
- )
38
- .join('');
39
- const tableRow = `
40
- <tr>
41
- ${columns}
42
- </tr>
43
- `;
44
- rows = rows + tableRow;
45
- });
46
- return rows;
47
- };
48
-
49
- const createHTMLTable = (headRow: string, bodyRows: string) => `
50
- <table>
51
- ${headRow}
52
- ${bodyRows}
53
- </table>
54
- `;
55
-
56
- const createPreviewTable = (icons: IconDefinition[][], size: number) => {
57
- const table =
58
- htmlDoctype +
59
- styling +
60
- createHTMLTable(
61
- createHTMLTableHeadRow(size),
62
- createHTMLTableBodyRows(icons)
63
- );
64
- return table;
65
- };
66
-
67
- const savePreview = (
68
- fileName: string,
69
- size: number,
70
- icons: IconDefinition[][]
71
- ) => {
72
- const filePath = join(__dirname, fileName + '.html');
73
-
74
- // write the html file with the icon table
75
- writeFileSync(filePath, createPreviewTable(icons, size));
76
-
77
- // create the image
78
- createScreenshot(filePath, fileName)
79
- .then(() => {
80
- console.log(
81
- '> Material Icon Theme:',
82
- green(`Successfully created ${fileName} preview image!`)
83
- );
84
- })
85
- .catch(() => {
86
- throw Error(red(`Error while creating ${fileName} preview image`));
87
- });
88
- };
89
-
90
- const getIconDefinitionsMatrix = (
91
- icons: IconDefinition[],
92
- size: number,
93
- excluded: string[] = []
94
- ): IconDefinition[][] => {
95
- const iconList = icons.sort((a, b) => a.label.localeCompare(b.label));
96
- trimIconListToSize(iconList, size, excluded);
97
-
98
- // list for the columns with the icons
99
- const matrix: IconDefinition[][] = [];
100
-
101
- // calculate the amount of icons per column
102
- const itemsPerColumn = Math.floor(iconList.length / size);
103
-
104
- // create the columns with the icons
105
- let counter = 0;
106
- for (let c = 0; c < itemsPerColumn; c++) {
107
- matrix[c] = [];
108
- }
109
- for (let s = 0; s < size; s++) {
110
- for (let i = 0; i < itemsPerColumn; i++) {
111
- matrix[i][s] = iconList[counter];
112
- counter++;
113
- }
114
- }
115
-
116
- return matrix;
117
- };
118
-
119
- /**
120
- * Function that generates the preview image for specific icons.
121
- * @param name name of the preview
122
- * @param icons icons for the preview
123
- * @param size amount of table columns
124
- * @param trimmableIcons List of icons that can possibly be trimmed
125
- */
126
- export const generatePreview = (
127
- name: string,
128
- icons: IconDefinition[],
129
- size: number,
130
- trimmableIcons: string[] = []
131
- ) => {
132
- savePreview(
133
- name,
134
- size,
135
- getIconDefinitionsMatrix(icons, size, trimmableIcons)
136
- );
137
- };
138
-
139
- interface IconDefinition {
140
- iconName: string;
141
- label: string;
142
- }
143
-
144
- /**
145
- * Trim the list of icons into the matrix
146
- * @param iconList List of icons
147
- * @param size Amount of columns
148
- * @param trimmableIcons List of icons that can possibly be trimmed
149
- */
150
- const trimIconListToSize = (
151
- iconList: IconDefinition[],
152
- size: number,
153
- trimmableIcons: string[]
154
- ) => {
155
- while (iconList.length % size !== 0) {
156
- iconList.splice(
157
- iconList.findIndex(
158
- (i) => i.iconName === trimmableIcons[iconList.length % size]
159
- ),
160
- 1
161
- );
162
- }
163
- };
1
+ import { writeFileSync } from 'fs';
2
+ import { join } from 'path';
3
+ import { green, red } from '../helpers/painter';
4
+ import { createScreenshot } from '../helpers/screenshots';
5
+ import { toTitleCase } from './../helpers/titleCase';
6
+
7
+ const htmlDoctype = '<!DOCTYPE html>';
8
+ const cssFilePath = 'style.css';
9
+ const styling = `<link rel="stylesheet" href="${cssFilePath}">`;
10
+
11
+ const createHTMLTableHeadRow = (amount: number) => {
12
+ const pair = `
13
+ <th class="icon">Icon</th>
14
+ <th class="iconName">Name</th>
15
+ `;
16
+ const columns = [...Array(amount)].map(() => pair).join('');
17
+ return `
18
+ <tr>
19
+ ${columns}
20
+ </tr>
21
+ `;
22
+ };
23
+
24
+ const createHTMLTableBodyRows = (items: IconDefinition[][]) => {
25
+ let rows = '';
26
+ items.forEach((row) => {
27
+ const columns = row
28
+ .map(
29
+ (icon) => `
30
+ <td class="icon">
31
+ <img src="./../../../icons/${icon.iconName}.svg" alt="${
32
+ icon.label
33
+ }">
34
+ </td>
35
+ <td class="iconName">${toTitleCase(icon.label)}</td>
36
+ `
37
+ )
38
+ .join('');
39
+ const tableRow = `
40
+ <tr>
41
+ ${columns}
42
+ </tr>
43
+ `;
44
+ rows = rows + tableRow;
45
+ });
46
+ return rows;
47
+ };
48
+
49
+ const createHTMLTable = (headRow: string, bodyRows: string) => `
50
+ <table>
51
+ ${headRow}
52
+ ${bodyRows}
53
+ </table>
54
+ `;
55
+
56
+ const createPreviewTable = (icons: IconDefinition[][], size: number) => {
57
+ const table =
58
+ htmlDoctype +
59
+ styling +
60
+ createHTMLTable(
61
+ createHTMLTableHeadRow(size),
62
+ createHTMLTableBodyRows(icons)
63
+ );
64
+ return table;
65
+ };
66
+
67
+ const savePreview = (
68
+ fileName: string,
69
+ size: number,
70
+ icons: IconDefinition[][]
71
+ ) => {
72
+ const filePath = join(__dirname, fileName + '.html');
73
+
74
+ // write the html file with the icon table
75
+ writeFileSync(filePath, createPreviewTable(icons, size));
76
+
77
+ // create the image
78
+ createScreenshot(filePath, fileName)
79
+ .then(() => {
80
+ console.log(
81
+ '> Material Icon Theme:',
82
+ green(`Successfully created ${fileName} preview image!`)
83
+ );
84
+ })
85
+ .catch(() => {
86
+ throw Error(red(`Error while creating ${fileName} preview image`));
87
+ });
88
+ };
89
+
90
+ const getIconDefinitionsMatrix = (
91
+ icons: IconDefinition[],
92
+ size: number,
93
+ excluded: string[] = []
94
+ ): IconDefinition[][] => {
95
+ const iconList = icons.sort((a, b) => a.label.localeCompare(b.label));
96
+ trimIconListToSize(iconList, size, excluded);
97
+
98
+ // list for the columns with the icons
99
+ const matrix: IconDefinition[][] = [];
100
+
101
+ // calculate the amount of icons per column
102
+ const itemsPerColumn = Math.floor(iconList.length / size);
103
+
104
+ // create the columns with the icons
105
+ let counter = 0;
106
+ for (let c = 0; c < itemsPerColumn; c++) {
107
+ matrix[c] = [];
108
+ }
109
+ for (let s = 0; s < size; s++) {
110
+ for (let i = 0; i < itemsPerColumn; i++) {
111
+ matrix[i][s] = iconList[counter];
112
+ counter++;
113
+ }
114
+ }
115
+
116
+ return matrix;
117
+ };
118
+
119
+ /**
120
+ * Function that generates the preview image for specific icons.
121
+ * @param name name of the preview
122
+ * @param icons icons for the preview
123
+ * @param size amount of table columns
124
+ * @param trimmableIcons List of icons that can possibly be trimmed
125
+ */
126
+ export const generatePreview = (
127
+ name: string,
128
+ icons: IconDefinition[],
129
+ size: number,
130
+ trimmableIcons: string[] = []
131
+ ) => {
132
+ savePreview(
133
+ name,
134
+ size,
135
+ getIconDefinitionsMatrix(icons, size, trimmableIcons)
136
+ );
137
+ };
138
+
139
+ interface IconDefinition {
140
+ iconName: string;
141
+ label: string;
142
+ }
143
+
144
+ /**
145
+ * Trim the list of icons into the matrix
146
+ * @param iconList List of icons
147
+ * @param size Amount of columns
148
+ * @param trimmableIcons List of icons that can possibly be trimmed
149
+ */
150
+ const trimIconListToSize = (
151
+ iconList: IconDefinition[],
152
+ size: number,
153
+ trimmableIcons: string[]
154
+ ) => {
155
+ while (iconList.length % size !== 0) {
156
+ iconList.splice(
157
+ iconList.findIndex(
158
+ (i) => i.iconName === trimmableIcons[iconList.length % size]
159
+ ),
160
+ 1
161
+ );
162
+ }
163
+ };
@@ -1,26 +1,26 @@
1
- import { resolve } from 'path';
2
- import { runTests } from 'vscode-test';
3
-
4
- const main = async () => {
5
- try {
6
- // The folder containing the Extension Manifest package.json
7
- // Passed to `--extensionDevelopmentPath`
8
- const extensionDevelopmentPath = resolve(__dirname, '../../');
9
-
10
- // The path to the extension test script
11
- // Passed to --extensionTestsPath
12
- const extensionTestsPath = resolve(__dirname, './spec/index');
13
-
14
- // Download VS Code, unzip it and run the integration test
15
- await runTests({
16
- extensionDevelopmentPath,
17
- extensionTestsPath,
18
- launchArgs: ['--disable-gpu', '--disable-workspace-trust'],
19
- });
20
- } catch (err) {
21
- console.error('Failed to run tests');
22
- process.exit(1);
23
- }
24
- };
25
-
26
- main();
1
+ import { resolve } from 'path';
2
+ import { runTests } from 'vscode-test';
3
+
4
+ const main = async () => {
5
+ try {
6
+ // The folder containing the Extension Manifest package.json
7
+ // Passed to `--extensionDevelopmentPath`
8
+ const extensionDevelopmentPath = resolve(__dirname, '../../');
9
+
10
+ // The path to the extension test script
11
+ // Passed to --extensionTestsPath
12
+ const extensionTestsPath = resolve(__dirname, './spec/index');
13
+
14
+ // Download VS Code, unzip it and run the integration test
15
+ await runTests({
16
+ extensionDevelopmentPath,
17
+ extensionTestsPath,
18
+ launchArgs: ['--disable-gpu', '--disable-workspace-trust'],
19
+ });
20
+ } catch (err) {
21
+ console.error('Failed to run tests');
22
+ process.exit(1);
23
+ }
24
+ };
25
+
26
+ main();
@@ -1,54 +1,54 @@
1
- import { equal } from 'assert';
2
- import { getObjectPropertyValue } from '../../../helpers/objects';
3
- import { getTranslationValue, initTranslations, replace } from '../../../i18n';
4
- import { Translation } from '../../../models';
5
-
6
- describe('i18n', () => {
7
- it('should initialize translations', () => {
8
- return initTranslations();
9
- });
10
-
11
- it('should translate key', () => {
12
- equal(
13
- getTranslationValue('activate', { activate: 'b' } as Translation),
14
- 'b'
15
- );
16
- });
17
-
18
- it('should return undefined if translation is not defined', () => {
19
- equal(
20
- getTranslationValue('activate', {} as Translation, {} as Translation),
21
- undefined
22
- );
23
- });
24
-
25
- it('should use fallback if translation is not defined', () => {
26
- equal(
27
- getTranslationValue(
28
- 'activate',
29
- {} as Translation,
30
- { activate: 'fb' } as Translation
31
- ),
32
- 'fb'
33
- );
34
- });
35
-
36
- it('should get the correct translation value of the translation object', () => {
37
- const translation = {
38
- a: {
39
- b: {
40
- c: 'c',
41
- },
42
- },
43
- };
44
- equal(getObjectPropertyValue(translation, 'a.b.c'), 'c');
45
- });
46
-
47
- it('should use placeholder in translation', () => {
48
- equal(replace('%0 with placeholder', 'test'), 'test with placeholder');
49
- equal(
50
- replace('%0 with %1', 'test', 'placeholder'),
51
- 'test with placeholder'
52
- );
53
- });
54
- });
1
+ import { equal } from 'assert';
2
+ import { getObjectPropertyValue } from '../../../helpers/objects';
3
+ import { getTranslationValue, initTranslations, replace } from '../../../i18n';
4
+ import { Translation } from '../../../models';
5
+
6
+ describe('i18n', () => {
7
+ it('should initialize translations', () => {
8
+ return initTranslations();
9
+ });
10
+
11
+ it('should translate key', () => {
12
+ equal(
13
+ getTranslationValue('activate', { activate: 'b' } as Translation),
14
+ 'b'
15
+ );
16
+ });
17
+
18
+ it('should return undefined if translation is not defined', () => {
19
+ equal(
20
+ getTranslationValue('activate', {} as Translation, {} as Translation),
21
+ undefined
22
+ );
23
+ });
24
+
25
+ it('should use fallback if translation is not defined', () => {
26
+ equal(
27
+ getTranslationValue(
28
+ 'activate',
29
+ {} as Translation,
30
+ { activate: 'fb' } as Translation
31
+ ),
32
+ 'fb'
33
+ );
34
+ });
35
+
36
+ it('should get the correct translation value of the translation object', () => {
37
+ const translation = {
38
+ a: {
39
+ b: {
40
+ c: 'c',
41
+ },
42
+ },
43
+ };
44
+ equal(getObjectPropertyValue(translation, 'a.b.c'), 'c');
45
+ });
46
+
47
+ it('should use placeholder in translation', () => {
48
+ equal(replace('%0 with placeholder', 'test'), 'test with placeholder');
49
+ equal(
50
+ replace('%0 with %1', 'test', 'placeholder'),
51
+ 'test with placeholder'
52
+ );
53
+ });
54
+ });