material-icon-theme 4.23.1 → 4.24.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 (94) 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 +1305 -1292
  8. package/CONTRIBUTING.md +199 -29
  9. package/README.md +199 -199
  10. package/icons/craco.svg +45 -45
  11. package/icons/folder-changesets-open.svg +5 -5
  12. package/icons/folder-changesets.svg +2 -2
  13. package/icons/folder-decorators-open.svg +2 -2
  14. package/icons/folder-decorators.svg +5 -5
  15. package/icons/folder-supabase-open.svg +5 -5
  16. package/icons/folder-supabase.svg +2 -2
  17. package/icons/sonarcloud.svg +4 -4
  18. package/icons/stylable.svg +10 -10
  19. package/icons/supabase.svg +4 -4
  20. package/icons/vitest.svg +6 -6
  21. package/images/contributors.png +0 -0
  22. package/images/how-tos/folder-icon-parts.png +0 -0
  23. package/images/how-tos/pick-folder-colors.png +0 -0
  24. package/images/how-tos/pick-folder-colors.svg +301 -0
  25. package/images/how-tos/svg-folder-icon-with-correct-colors.png +0 -0
  26. package/images/how-tos/svg-folder-icon-with-wrong-colors.png +0 -0
  27. package/images/how-tos/svg-with-light-color.png +0 -0
  28. package/images/how-tos/svg-with-spacing.png +0 -0
  29. package/images/how-tos/svg-with-too-dark-color.png +0 -0
  30. package/images/how-tos/svg-with-wrong-color.png +0 -0
  31. package/images/how-tos/svg-without-spacing.png +0 -0
  32. package/package.json +252 -252
  33. package/package.nls.de.json +32 -32
  34. package/package.nls.es.json +29 -29
  35. package/package.nls.fr.json +29 -29
  36. package/package.nls.ja.json +32 -32
  37. package/package.nls.json +32 -32
  38. package/package.nls.nl.json +32 -32
  39. package/package.nls.pl.json +32 -32
  40. package/package.nls.pt-BR.json +29 -29
  41. package/package.nls.pt-PT.json +29 -29
  42. package/package.nls.ru.json +29 -29
  43. package/package.nls.zh-CN.json +29 -29
  44. package/package.nls.zh-TW.json +29 -29
  45. package/src/commands/activate.ts +28 -28
  46. package/src/commands/explorerArrows.ts +55 -55
  47. package/src/commands/folderColor.ts +96 -96
  48. package/src/commands/folders.ts +55 -55
  49. package/src/commands/grayscale.ts +55 -55
  50. package/src/commands/iconPacks.ts +64 -64
  51. package/src/commands/index.ts +30 -30
  52. package/src/commands/opacity.ts +46 -46
  53. package/src/commands/saturation.ts +46 -46
  54. package/src/extension.ts +37 -37
  55. package/src/helpers/customIcons.ts +8 -8
  56. package/src/helpers/index.ts +88 -88
  57. package/src/i18n/index.ts +78 -78
  58. package/src/i18n/lang-de.ts +43 -43
  59. package/src/i18n/lang-en.ts +43 -43
  60. package/src/i18n/lang-es.ts +43 -43
  61. package/src/i18n/lang-fr.ts +43 -43
  62. package/src/i18n/lang-ja.ts +43 -43
  63. package/src/i18n/lang-nl.ts +43 -43
  64. package/src/i18n/lang-pl.ts +43 -43
  65. package/src/i18n/lang-pt-br.ts +43 -43
  66. package/src/i18n/lang-pt-pt.ts +43 -43
  67. package/src/i18n/lang-ru.ts +43 -43
  68. package/src/i18n/lang-uk.ts +43 -43
  69. package/src/i18n/lang-zh-cn.ts +43 -43
  70. package/src/i18n/lang-zh-tw.ts +43 -43
  71. package/src/icons/fileIcons.ts +2206 -2197
  72. package/src/icons/folderIcons.ts +818 -806
  73. package/src/icons/generator/folderGenerator.ts +340 -340
  74. package/src/icons/generator/iconOpacity.ts +111 -111
  75. package/src/icons/generator/iconSaturation.ts +140 -140
  76. package/src/icons/generator/jsonGenerator.ts +191 -191
  77. package/src/icons/languageIcons.ts +141 -141
  78. package/src/models/i18n/translation.ts +41 -41
  79. package/src/models/iconConfiguration.ts +37 -37
  80. package/src/models/icons/iconJsonOptions.ts +21 -21
  81. package/src/models/index.ts +3 -3
  82. package/src/scripts/contributors/index.ts +138 -138
  83. package/src/scripts/helpers/screenshots.ts +32 -32
  84. package/src/scripts/icons/checks/checkIconAvailability.ts +215 -215
  85. package/src/scripts/icons/checks/checkIconConflicts.ts +152 -152
  86. package/src/scripts/icons/checks/checkIconUsage.ts +137 -137
  87. package/src/scripts/icons/checks/index.ts +7 -7
  88. package/src/scripts/preview/index.ts +40 -40
  89. package/src/scripts/preview/preview.ts +163 -163
  90. package/src/test/runTest.ts +26 -26
  91. package/src/test/spec/i18n/i18n.spec.ts +54 -54
  92. package/src/test/spec/icons/fileIcons.spec.ts +250 -250
  93. package/src/test/spec/icons/folderIcons.spec.ts +418 -418
  94. package/src/test/spec/icons/languageIcons.spec.ts +184 -184
package/CONTRIBUTING.md CHANGED
@@ -1,62 +1,232 @@
1
- <h1>Contributing</h1>
1
+ <h1>How to contribute</h1>
2
+
3
+ Glad you're here and interested in expanding this project 🎉 In order to make this work in the best possible way, there are hints and tips for successful contributors on this page. Please read everything carefully and your contributions will be valuable and gratefully received.
2
4
 
3
5
  <!-- TOC -->
4
6
 
5
- - [Create issues](#create-issues)
7
+ - [Icon Requests](#icon-requests)
6
8
  - [Add new icons](#add-new-icons)
7
- - [Icon color](#icon-color)
8
- - [Free software to create/edit SVG icons](#free-software-to-createedit-svg-icons)
9
- - [Use icons from here](#use-icons-from-here)
9
+ - [How-To's](#how-tos)
10
+ - [Create icon as SVG](#create-icon-as-svg)
11
+ - [Use Material Design colors](#material-design-colors)
12
+ - [Design folder icons](#design-folder-icons)
13
+ - [Icon spacing](#icon-spacing)
14
+ - [Icons for color themes](#icons-for-color-themes)
15
+ - [Unique assignment to file and folder names](#icon-assignments)
16
+ - [Create icon packs](#icon-packs)
10
17
  - [Add translations](#add-translations)
11
18
  - [Update API](#update-api)
12
19
 
13
20
  <!-- /TOC -->
14
21
 
15
- ## Create issues
22
+ ## Icon Requests
16
23
 
17
- You need an icon for a specific file ending? No problem, just follow these guidelines:
24
+ A new icon for a file name, file extension or folder name is needed? Please create an issue and follow the rules below:
18
25
 
19
- - describe the file ending (e.g. '.xml') and the language (e.g. XML)
20
- - show an example image of the icon or link to official website
26
+ - Describe if a file and/or folder icon is needed
27
+ - List the file names/endings and folder names
28
+ - Mention some graphic ideas (how can the icon look like)
29
+ - Show an example image of the icon or provide a link to the related website
21
30
 
22
31
  ## Add new icons
23
32
 
24
- 1. Create icon as SVG
25
- 2. Copy icon to `icons`-folder
26
- 3. Edit the icon configuration files under `src/icons` folder:
27
- - fileIcons.ts
28
- - folderIcons.ts
29
- - languageIcons.ts
33
+ It is always welcome to add new icons to the extension. However, there are a few things you should take into account so that the icon can be included in the extension.
34
+
35
+ **Checklist**
30
36
 
31
- ### Icon color
37
+ 1. [ ] Create icon as SVG ([how to](#create-icon-as-svg))
38
+ 2. [ ] Icon color fits to Material Design ([how to](#material-design-colors))
39
+ 3. [ ] SVG has some space around the icon ([how to](#spacing))
40
+ 4. [ ] Unique assignment to file and folder names ([how to](#icon-assignments))
41
+ 5. [ ] Provide separate icons for color themes if necessary ([how to](#icons-for-color-themes))
32
42
 
33
- Choose your icon colors from the [material design colors](https://material.io/design/color/the-color-system.html#tools-for-picking-colors). Alternatively, the [Material Color Converter](https://pkief.github.io/material-color-converter/) allows you to pick the correct color by matching a custom color code with the colors of the Material Design color palette.
43
+ ## How tos
34
44
 
35
- ### Free software to create/edit SVG icons
45
+ <h3 id="create-icon-as-svg">Create icon as SVG</h3>
46
+
47
+ These free tools are recommended to create or edit new SVG icons:
36
48
 
37
49
  - [Inkscape](https://inkscape.org/en/) is a free, open source SVG editor
38
50
  - There are tools available to convert PNG/JPG images to SVG - [Autotracer.org](https://autotracer.org) and [Vectorizer.io](https://vectorizer.io) are two examples.
39
- - It's important to produce fully _vectorized_ graphic (don't include a base64 image string in the svg).
40
51
 
41
- ### Use icons from here
52
+ > **Note**
53
+ > It's important to produce fully _vectorized_ graphic (don't include a base64 image string in the svg).
54
+
55
+ When you create a folder icon, please keep in mind that two SVG files are needed here: one that represents the folder closed and another that represents it open.
56
+
57
+ ```
58
+ 📁 folder-example.svg
59
+ 📂 folder-example-open.svg
60
+ ```
61
+
62
+ Of course, there is also the possibility to add existing SVGs. Mostly, however, the color has to be adjusted or the styling has to be changed, so that the other points from the above checklist are also fulfilled.
63
+
64
+ <h4>Known icon sources</h4>
42
65
 
43
66
  - [Material Design Icons](https://materialdesignicons.com/)
44
- - download them as SVG and edit the icons e.g. with Inkscape
45
- - you can use any other source **as long as the icons are free to use!** This icon theme is absolutely non-commercial, but you should always check the license of your sources!
46
67
 
47
- ### Test your icons before submitting
48
- - Preview your own custom icons locally before submitting a Pull Request. See [Custom icon associations](README.md#custom-icon-associations) in README.md for instructions.
68
+ <h3 id="material-design-colors">Use Material Design colors</h3>
69
+
70
+ An important success factor of this icon extension is the fact that all colors fit together harmoniously. This is due to the fact that all icons exist only from colors of the [Material Design color palette](https://material.io/design/color/the-color-system.html#tools-for-picking-colors). This creates nice contrasts and the icons are easily recognizable.
71
+
72
+ Now it often happens that many programming languages already have icons with their own colors. To find the matching color from the Material Design color palette based on a known color, there is the [Material Color Converter](https://pkief.github.io/material-color-converter/). With its help any color can be converted into a Material Design color.
73
+
74
+ Continue reading [here](#design-folder-icons) to find out about colors for the folder icons.
75
+
76
+ | ✅ | ❌ |
77
+ | ----------------------------------------------------------------- | --------------------------------------------------------------------- |
78
+ | <img src="./images/how-tos/svg-with-spacing.png" width="200px" /> | <img src="./images/how-tos/svg-with-wrong-color.png" width="200px" /> |
79
+
80
+ <h3 id="design-folder-icons">Design folder icons</h3>
81
+
82
+ When designing folder icons there are also a few points to consider. A folder icon always consists of two icons - the folder in the background and a motive in the foreground:
83
+
84
+ <img src="./images/how-tos/folder-icon-parts.png" width="300px" />
85
+
86
+ For the motive, only colors from the second row in the [color palette](https://pkief.com/material-color-converter/) are allowed. For the background choose a slightly darker hue (mostly in rows 4-6 in the palette).
87
+
88
+ <img src="./images/how-tos/pick-folder-colors.png" width="500px" />
89
+
90
+ This uniform color selection makes the folder icons look more consistent and fit well together. This ensures a good quality of the icons.
91
+
92
+ | ✅ | ❌ |
93
+ | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
94
+ | <img src="./images/how-tos/svg-folder-icon-with-correct-colors.png" width="200px" /> | <img src="./images/how-tos/svg-folder-icon-with-wrong-colors.png" width="200px" /> |
95
+
96
+ <h3 id="icon-spacing">Icon spacing</h3>
97
+
98
+ All icons have a small distance to the edge. This way they don't seem so pressed together and have a little more air. It is not defined how much margin you have to leave them, because this is always a bit different. Just make sure that there is a space to the outside.
99
+
100
+ | ✅ | ❌ |
101
+ | ----------------------------------------------------------------- | -------------------------------------------------------------------- |
102
+ | <img src="./images/how-tos/svg-with-spacing.png" width="200px" /> | <img src="./images/how-tos/svg-without-spacing.png" width="200px" /> |
103
+
104
+ <h3 id="icon-assignments">Assignment to file and folder names and language ids</h3>
105
+
106
+ Icons are assigned to file names, folder names or registered languages of VS Code in these files:
107
+
108
+ - [fileIcons.ts](src/icons/fileIcons.ts)
109
+ - [folderIcons.ts](src/icons/folderIcons.ts)
110
+ - [languageIcons.ts](src/icons/languageIcons.ts)
111
+
112
+ > **Note**
113
+ > It is very important that icons are only assigned to the file and folder names that really apply to them. This means that you should be careful which files and folders you assign icons to. There are many people with different projects all over the world and not everyone expects that e.g. a file name will have a special framework based icon even though the framework is not used at all by this one user.
114
+ >
115
+ > A solution for this can be [icon packs](#icon-packs).
116
+
117
+ #### File icons
118
+
119
+ Here's an example of how the SVG icon 'sample.svg' is assigned to file names and extensions:
120
+
121
+ ```ts
122
+ {
123
+ name: 'sample',
124
+ fileNames: ['sample.js', 'sample.ts', 'sample.html'],
125
+ fileExtensions: ['sample'],
126
+ }
127
+ ```
128
+
129
+ This will apply an icon for the files 'sample.js', 'sample.ts' and 'sample.html' as well as for files that end with 'sample' like 'another-file.sample'.
49
130
 
131
+ #### Folder icons
132
+
133
+ Here's an example of how a folder icon can be assigned to folder icons:
134
+
135
+ ```ts
136
+ {
137
+ name: 'folder-sample',
138
+ folderNames: ['sample', 'samples'],
139
+ }
140
+ ```
141
+
142
+ This will apply a folder icon for the folders 'sample' and 'samples'.
143
+
144
+ #### Language icons
145
+
146
+ Here's an example of how a file icon can be assigned to language ids:
147
+
148
+ ```ts
149
+ { icon: { name: 'sample' }, ids: ['css'] },
150
+ ```
151
+
152
+ This will apply the sample.svg icon to all files which could be associated by VS Code with the CSS programming language.
153
+
154
+ <h3 id="icons-for-color-themes">Icons for color themes</h3>
155
+
156
+ VS Code can be customized so that the background color is either light or dark. This must also be considered for the icons, because a dark icon on a dark background does not provide the necessary contrast it needs to be recognizable.
157
+
158
+ | ✅ | ❌ |
159
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
160
+ | <img src="./images/how-tos/svg-with-light-color.png" width="200px" /> | <img src="./images/how-tos/svg-with-too-dark-color.png" width="200px" /> |
161
+
162
+ Preferably, the icon has a color that looks good on both backgrounds. If this is ever not possible because it would otherwise no longer match the icon's branding, different icons can be provided for the respective color scheme.
163
+
164
+ This separation is possible by using the `light` attribute in the icon configuration:
165
+
166
+ ```ts
167
+ { name: 'sample', fileNames: ['sample.txt'], light: true },
168
+ ```
169
+
170
+ If the `light` attribute is set to `true`, it is necessary to provide two icon files:
171
+
172
+ - sample.svg
173
+ - sample_light.svg
174
+
175
+ The icon with the ending '\_light' will be automatically chosen when VS Code is using a light background color. So the icon should then look a bit darker to have a good contrast on the lighter background.
176
+
177
+ In addition, there's also the possibility to provide a separate icon for high contrast backgrounds like this:
178
+
179
+ ```ts
180
+ { name: 'sample', fileNames: ['sample.txt'], highContrast: true },
181
+ ```
182
+
183
+ If the `highContrast` attribute is set to `true`, it is necessary to provide two icon files:
184
+
185
+ - sample.svg
186
+ - sample_highContrast.svg
187
+
188
+ <h3 id="icon-packs">Create icon packs</h3>
189
+
190
+ Sometimes it can happen that certain files or folders need an icon, but you cannot avoid that there could be different icons for them. An icon pack can bundle different icons and as an end user you can decide which icons to display.
191
+
192
+ Here's an example that shows how two icons can be assigned to the same file name by using icon packs:
193
+
194
+ ```ts
195
+ {
196
+ name: 'sample-blue',
197
+ fileNames: ['sample.txt'],
198
+ enabledFor: [IconPack.Blue],
199
+ },
200
+ {
201
+ name: 'sample-red',
202
+ fileNames: ['sample.txt'],
203
+ enabledFor: [IconPack.Red],
204
+ }
205
+ ```
206
+
207
+ To create an icon pack, the following steps have to be completed:
208
+
209
+ 1. Add the name of the icon pack to the enum in [iconPack.ts](src/models/icons/iconPack.ts)
210
+ 2. Add translations to the package.nls.\*.json files under the section `configuration.activeIconPack` (at least to [package.nls.json](package.nls.json), the English translation file)
211
+ 3. Adjust [package.json](package.json) under `configuration.properties.material-icon-theme.activeIconPack`
212
+ 4. Use the icon pack inside the [fileIcons.ts](src/icons/fileIcons.ts),[folderIcons.ts](src/icons/folderIcons.ts) or [languageIcons.ts](src/icons/languageIcons.ts) files in the `enabledFor` attribute
50
213
 
51
214
  ## Add translations
52
215
 
216
+ This project offers translations into different languages. If you notice an error here, please help to fix it. You can do this as follows:
217
+
53
218
  - Create or edit the translations in the `src/i18n` directory.
54
219
  - Create or edit the `package.nls.*.json` files in the root folder
55
220
 
56
- ## Update API
221
+ ## Debug extension locally
222
+
223
+ This icon extension consists not only of icons but also brings some code. This is necessary to simplify various things and enable multiple functionalities. If you want to change something here, the following steps are to be considered:
57
224
 
58
- 1. Install node dependencies with `npm install`
59
- 2. Open project with VS Code
60
- 3. Press `F5` or run `Launch Extension` in the debug window
61
- 4. Run tests with `Launch Tests`
225
+ 1. Install [Node.js](https://nodejs.org/en/) on your machine
226
+ 2. Install node dependencies with `npm install`
227
+ 3. Open project with VS Code
228
+ 4. Install required [VS Code extensions](.vscode/extensions.json)
229
+ 5. Press `F5` or run `Launch Extension` in the debug window
230
+ 6. Run tests with `Launch Tests`
62
231
 
232
+ You will find more information about the official extension API in the [extension guides of VS Code](https://code.visualstudio.com/api/extension-guides/file-icon-theme).