material-icon-theme 4.26.0 → 4.27.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/dist/material-icons.json +5704 -0
- package/icons/file.svg +1 -0
- package/icons/folder-open.svg +1 -0
- package/icons/folder-root-open.svg +1 -0
- package/icons/folder-root.svg +1 -0
- package/icons/folder.svg +1 -0
- package/icons/ifanr-cloud.svg +10 -0
- package/icons/mermaid.svg +4 -0
- package/icons/qwik.svg +2 -0
- package/package.json +7 -1
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -51
- package/.github/FUNDING.yml +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -34
- package/.github/ISSUE_TEMPLATE/icon_request.md +0 -27
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -7
- package/.github/workflows/build.yml +0 -45
- package/.github/workflows/color-check.yml +0 -22
- package/.github/workflows/release.yml +0 -73
- package/.prettierrc +0 -7
- package/.vscode/extensions.json +0 -3
- package/.vscode/launch.json +0 -43
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -32
- package/.vscodeignore +0 -22
- package/CHANGELOG.md +0 -1343
- package/CONTRIBUTING.md +0 -232
- package/build/web-extension.webpack.config.js +0 -62
- package/build/webpack.config.js +0 -39
- package/changelog.config.json +0 -4
- package/images/commandPalette.png +0 -0
- package/images/contributors.png +0 -0
- package/images/fileIcons.png +0 -0
- package/images/folderIcons.png +0 -0
- package/images/how-tos/folder-icon-parts.png +0 -0
- package/images/how-tos/pick-folder-colors.png +0 -0
- package/images/how-tos/pick-folder-colors.svg +0 -301
- package/images/how-tos/svg-folder-icon-with-correct-colors.png +0 -0
- package/images/how-tos/svg-folder-icon-with-wrong-colors.png +0 -0
- package/images/how-tos/svg-with-light-color.png +0 -0
- package/images/how-tos/svg-with-spacing.png +0 -0
- package/images/how-tos/svg-with-too-dark-color.png +0 -0
- package/images/how-tos/svg-with-wrong-color.png +0 -0
- package/images/how-tos/svg-without-spacing.png +0 -0
- package/images/set-folder-color.gif +0 -0
- package/images/set-folder-theme.gif +0 -0
- package/logo.png +0 -0
- package/logo.svg +0 -21
- package/material-colors.yml +0 -257
- package/package.nls.de.json +0 -34
- package/package.nls.es.json +0 -29
- package/package.nls.fr.json +0 -29
- package/package.nls.ja.json +0 -32
- package/package.nls.json +0 -34
- package/package.nls.nl.json +0 -32
- package/package.nls.pl.json +0 -32
- package/package.nls.pt-BR.json +0 -29
- package/package.nls.pt-PT.json +0 -29
- package/package.nls.ru.json +0 -29
- package/package.nls.zh-CN.json +0 -29
- package/package.nls.zh-TW.json +0 -29
- package/src/commands/activate.ts +0 -28
- package/src/commands/explorerArrows.ts +0 -55
- package/src/commands/fileColor.ts +0 -96
- package/src/commands/folderColor.ts +0 -96
- package/src/commands/folders.ts +0 -55
- package/src/commands/grayscale.ts +0 -55
- package/src/commands/iconPacks.ts +0 -64
- package/src/commands/index.ts +0 -32
- package/src/commands/opacity.ts +0 -46
- package/src/commands/restoreConfig.ts +0 -15
- package/src/commands/saturation.ts +0 -46
- package/src/extension.ts +0 -37
- package/src/helpers/changeDetection.ts +0 -109
- package/src/helpers/customIcons.ts +0 -8
- package/src/helpers/fileConfig.ts +0 -38
- package/src/helpers/index.ts +0 -88
- package/src/helpers/objects.ts +0 -58
- package/src/helpers/types.ts +0 -7
- package/src/i18n/index.ts +0 -78
- package/src/i18n/lang-de.ts +0 -45
- package/src/i18n/lang-en.ts +0 -45
- package/src/i18n/lang-es.ts +0 -45
- package/src/i18n/lang-fr.ts +0 -45
- package/src/i18n/lang-ja.ts +0 -45
- package/src/i18n/lang-nl.ts +0 -45
- package/src/i18n/lang-pl.ts +0 -45
- package/src/i18n/lang-pt-br.ts +0 -45
- package/src/i18n/lang-pt-pt.ts +0 -45
- package/src/i18n/lang-ru.ts +0 -45
- package/src/i18n/lang-uk.ts +0 -45
- package/src/i18n/lang-zh-cn.ts +0 -45
- package/src/i18n/lang-zh-tw.ts +0 -45
- package/src/icons/fileIcons.ts +0 -2294
- package/src/icons/folderIcons.ts +0 -835
- package/src/icons/generator/constants.ts +0 -29
- package/src/icons/generator/fileGenerator.ts +0 -233
- package/src/icons/generator/folderGenerator.ts +0 -340
- package/src/icons/generator/iconOpacity.ts +0 -111
- package/src/icons/generator/iconSaturation.ts +0 -140
- package/src/icons/generator/index.ts +0 -7
- package/src/icons/generator/jsonGenerator.ts +0 -207
- package/src/icons/generator/languageGenerator.ts +0 -127
- package/src/icons/index.ts +0 -4
- package/src/icons/languageIcons.ts +0 -144
- package/src/models/i18n/index.ts +0 -1
- package/src/models/i18n/translation.ts +0 -43
- package/src/models/iconConfiguration.ts +0 -37
- package/src/models/icons/defaultIcon.ts +0 -16
- package/src/models/icons/files/fileIcon.ts +0 -49
- package/src/models/icons/files/fileTypes.ts +0 -14
- package/src/models/icons/files/index.ts +0 -2
- package/src/models/icons/folders/folderIcon.ts +0 -34
- package/src/models/icons/folders/folderTheme.ts +0 -23
- package/src/models/icons/folders/index.ts +0 -2
- package/src/models/icons/iconJsonOptions.ts +0 -22
- package/src/models/icons/iconPack.ts +0 -12
- package/src/models/icons/index.ts +0 -6
- package/src/models/icons/languages/index.ts +0 -1
- package/src/models/icons/languages/languageIdentifier.ts +0 -26
- package/src/models/index.ts +0 -3
- package/src/models/scripts/contributors/contributor.ts +0 -22
- package/src/models/scripts/contributors/contributorsConfig.ts +0 -10
- package/src/scripts/contributors/contributors.css +0 -24
- package/src/scripts/contributors/index.ts +0 -138
- package/src/scripts/helpers/painter.ts +0 -5
- package/src/scripts/helpers/screenshots.ts +0 -32
- package/src/scripts/helpers/similarity.ts +0 -47
- package/src/scripts/helpers/titleCase.ts +0 -7
- package/src/scripts/icons/checks/checkIconAvailability.ts +0 -215
- package/src/scripts/icons/checks/checkIconConflicts.ts +0 -152
- package/src/scripts/icons/checks/checkIconUsage.ts +0 -137
- package/src/scripts/icons/checks/index.ts +0 -7
- package/src/scripts/icons/generateJson.ts +0 -11
- package/src/scripts/preview/index.ts +0 -40
- package/src/scripts/preview/preview.ts +0 -163
- package/src/scripts/preview/style.css +0 -48
- package/src/test/runTest.ts +0 -26
- package/src/test/spec/i18n/i18n.spec.ts +0 -54
- package/src/test/spec/icons/fileIcons.spec.ts +0 -250
- package/src/test/spec/icons/folderIcons.spec.ts +0 -418
- package/src/test/spec/icons/languageIcons.spec.ts +0 -184
- package/src/test/spec/index.ts +0 -36
- package/src/web/extension.ts +0 -10
- package/svgo.config.js +0 -12
- package/tsconfig.json +0 -23
|
@@ -1,163 +0,0 @@
|
|
|
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,48 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--main-bg-color: #1e1e1e;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
body {
|
|
6
|
-
margin: 0;
|
|
7
|
-
padding: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
table {
|
|
11
|
-
font-family: arial, sans-serif;
|
|
12
|
-
border-collapse: collapse;
|
|
13
|
-
width: 100%;
|
|
14
|
-
background: var(--main-bg-color);
|
|
15
|
-
color: rgb(250, 250, 250);
|
|
16
|
-
font-size: 1rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
td,
|
|
20
|
-
th {
|
|
21
|
-
border: 0px solid #dddddd;
|
|
22
|
-
text-align: left;
|
|
23
|
-
padding: 8px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
tr:last-child {
|
|
27
|
-
border-bottom: 0.5rem solid var(--main-bg-color);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
tr:first-child {
|
|
31
|
-
border-top: 0.5rem solid var(--main-bg-color);
|
|
32
|
-
border-bottom: 0.5rem solid var(--main-bg-color);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.icon {
|
|
36
|
-
width: 2rem;
|
|
37
|
-
text-align: center;
|
|
38
|
-
padding: 0.5rem 1rem 0.5rem 1rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.iconName {
|
|
42
|
-
min-width: 9rem;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
img {
|
|
46
|
-
width: 30px;
|
|
47
|
-
height: auto;
|
|
48
|
-
}
|
package/src/test/runTest.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,250 +0,0 @@
|
|
|
1
|
-
import { deepStrictEqual } from 'assert';
|
|
2
|
-
import merge from 'lodash.merge';
|
|
3
|
-
import {
|
|
4
|
-
getDefaultIconOptions,
|
|
5
|
-
loadFileIconDefinitions,
|
|
6
|
-
} from '../../../icons/index';
|
|
7
|
-
import { FileIcons, IconConfiguration, IconPack } from '../../../models/index';
|
|
8
|
-
|
|
9
|
-
describe('file icons', () => {
|
|
10
|
-
let expectedConfig: IconConfiguration;
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
expectedConfig = merge({}, new IconConfiguration(), {
|
|
14
|
-
options: getDefaultIconOptions(),
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should configure icon definitions', () => {
|
|
19
|
-
const fileIcons: FileIcons = {
|
|
20
|
-
defaultIcon: { name: 'file' },
|
|
21
|
-
icons: [
|
|
22
|
-
{
|
|
23
|
-
name: 'angular',
|
|
24
|
-
fileNames: ['.angular-cli.json', 'angular-cli.json'],
|
|
25
|
-
enabledFor: [IconPack.Angular, IconPack.Ngrx],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'javascript',
|
|
29
|
-
fileNames: ['filename.js'],
|
|
30
|
-
fileExtensions: ['js'],
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
const options = getDefaultIconOptions();
|
|
35
|
-
const iconConfig = merge({}, new IconConfiguration(), { options });
|
|
36
|
-
const iconDefinitions = loadFileIconDefinitions(
|
|
37
|
-
fileIcons,
|
|
38
|
-
iconConfig,
|
|
39
|
-
options
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
expectedConfig.iconDefinitions = {
|
|
43
|
-
angular: {
|
|
44
|
-
iconPath: './../icons/angular.svg',
|
|
45
|
-
},
|
|
46
|
-
javascript: {
|
|
47
|
-
iconPath: './../icons/javascript.svg',
|
|
48
|
-
},
|
|
49
|
-
file: {
|
|
50
|
-
iconPath: './../icons/file.svg',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
expectedConfig.file = 'file';
|
|
54
|
-
expectedConfig.fileExtensions = {
|
|
55
|
-
js: 'javascript',
|
|
56
|
-
};
|
|
57
|
-
expectedConfig.fileNames = {
|
|
58
|
-
'.angular-cli.json': 'angular',
|
|
59
|
-
'angular-cli.json': 'angular',
|
|
60
|
-
'filename.js': 'javascript',
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should disable icon packs', () => {
|
|
67
|
-
const fileIcons: FileIcons = {
|
|
68
|
-
defaultIcon: { name: 'file' },
|
|
69
|
-
icons: [
|
|
70
|
-
{
|
|
71
|
-
name: 'angular',
|
|
72
|
-
fileNames: ['.angular-cli.json', 'angular-cli.json'],
|
|
73
|
-
enabledFor: [IconPack.Ngrx],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'javascript',
|
|
77
|
-
fileNames: ['filename.js'],
|
|
78
|
-
fileExtensions: ['js'],
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const options = getDefaultIconOptions();
|
|
84
|
-
options.activeIconPack = '';
|
|
85
|
-
const iconConfig = merge({}, new IconConfiguration(), { options });
|
|
86
|
-
const iconDefinitions = loadFileIconDefinitions(
|
|
87
|
-
fileIcons,
|
|
88
|
-
iconConfig,
|
|
89
|
-
options
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
expectedConfig.iconDefinitions = {
|
|
93
|
-
file: {
|
|
94
|
-
iconPath: './../icons/file.svg',
|
|
95
|
-
},
|
|
96
|
-
javascript: {
|
|
97
|
-
iconPath: './../icons/javascript.svg',
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
expectedConfig.file = 'file';
|
|
101
|
-
expectedConfig.fileExtensions = {
|
|
102
|
-
js: 'javascript',
|
|
103
|
-
};
|
|
104
|
-
expectedConfig.fileNames = {
|
|
105
|
-
'filename.js': 'javascript',
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// disable default icon pack by using empty string
|
|
109
|
-
expectedConfig.options!.activeIconPack = '';
|
|
110
|
-
|
|
111
|
-
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should configure custom icon associations', () => {
|
|
115
|
-
const fileIcons: FileIcons = {
|
|
116
|
-
defaultIcon: { name: 'file' },
|
|
117
|
-
icons: [
|
|
118
|
-
{
|
|
119
|
-
name: 'angular',
|
|
120
|
-
fileNames: ['.angular-cli.json', 'angular-cli.json'],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: 'javascript',
|
|
124
|
-
fileNames: ['filename.js'],
|
|
125
|
-
fileExtensions: ['js'],
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
const options = getDefaultIconOptions();
|
|
130
|
-
options.files.associations = {
|
|
131
|
-
'*.sample.ts': 'angular',
|
|
132
|
-
'sample.js': 'javascript',
|
|
133
|
-
};
|
|
134
|
-
const iconConfig = merge({}, new IconConfiguration(), { options });
|
|
135
|
-
const iconDefinitions = loadFileIconDefinitions(
|
|
136
|
-
fileIcons,
|
|
137
|
-
iconConfig,
|
|
138
|
-
options
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
expectedConfig.iconDefinitions = {
|
|
142
|
-
file: {
|
|
143
|
-
iconPath: './../icons/file.svg',
|
|
144
|
-
},
|
|
145
|
-
javascript: {
|
|
146
|
-
iconPath: './../icons/javascript.svg',
|
|
147
|
-
},
|
|
148
|
-
angular: {
|
|
149
|
-
iconPath: './../icons/angular.svg',
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
expectedConfig.file = 'file';
|
|
153
|
-
expectedConfig.fileExtensions = {
|
|
154
|
-
js: 'javascript',
|
|
155
|
-
'sample.ts': 'angular',
|
|
156
|
-
};
|
|
157
|
-
expectedConfig.fileNames = {
|
|
158
|
-
'.angular-cli.json': 'angular',
|
|
159
|
-
'angular-cli.json': 'angular',
|
|
160
|
-
'sample.js': 'javascript',
|
|
161
|
-
'filename.js': 'javascript',
|
|
162
|
-
};
|
|
163
|
-
expectedConfig.options!.files!.associations = {
|
|
164
|
-
'*.sample.ts': 'angular',
|
|
165
|
-
'sample.js': 'javascript',
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should configure language icons for light and high contrast', () => {
|
|
172
|
-
const fileIcons: FileIcons = {
|
|
173
|
-
defaultIcon: { name: 'file', light: true, highContrast: true },
|
|
174
|
-
icons: [
|
|
175
|
-
{
|
|
176
|
-
name: 'angular',
|
|
177
|
-
fileNames: ['.angular-cli.json', 'angular-cli.json'],
|
|
178
|
-
enabledFor: [IconPack.Angular, IconPack.Ngrx],
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
name: 'javascript',
|
|
182
|
-
fileNames: ['filename.js'],
|
|
183
|
-
fileExtensions: ['js'],
|
|
184
|
-
light: true,
|
|
185
|
-
highContrast: true,
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
};
|
|
189
|
-
const options = getDefaultIconOptions();
|
|
190
|
-
const iconConfig = merge({}, new IconConfiguration(), { options });
|
|
191
|
-
const iconDefinitions = loadFileIconDefinitions(
|
|
192
|
-
fileIcons,
|
|
193
|
-
iconConfig,
|
|
194
|
-
options
|
|
195
|
-
);
|
|
196
|
-
/* eslint-disable camelcase */
|
|
197
|
-
expectedConfig.iconDefinitions = {
|
|
198
|
-
file: {
|
|
199
|
-
iconPath: './../icons/file.svg',
|
|
200
|
-
},
|
|
201
|
-
file_light: {
|
|
202
|
-
iconPath: './../icons/file_light.svg',
|
|
203
|
-
},
|
|
204
|
-
file_highContrast: {
|
|
205
|
-
iconPath: './../icons/file_highContrast.svg',
|
|
206
|
-
},
|
|
207
|
-
javascript: {
|
|
208
|
-
iconPath: './../icons/javascript.svg',
|
|
209
|
-
},
|
|
210
|
-
javascript_light: {
|
|
211
|
-
iconPath: './../icons/javascript_light.svg',
|
|
212
|
-
},
|
|
213
|
-
javascript_highContrast: {
|
|
214
|
-
iconPath: './../icons/javascript_highContrast.svg',
|
|
215
|
-
},
|
|
216
|
-
angular: {
|
|
217
|
-
iconPath: './../icons/angular.svg',
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
expectedConfig.file = 'file';
|
|
221
|
-
expectedConfig.fileExtensions = {
|
|
222
|
-
js: 'javascript',
|
|
223
|
-
};
|
|
224
|
-
expectedConfig.light = {
|
|
225
|
-
file: 'file_light',
|
|
226
|
-
fileExtensions: {
|
|
227
|
-
js: 'javascript_light',
|
|
228
|
-
},
|
|
229
|
-
fileNames: {
|
|
230
|
-
'filename.js': 'javascript_light',
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
expectedConfig.highContrast = {
|
|
234
|
-
file: 'file_highContrast',
|
|
235
|
-
fileExtensions: {
|
|
236
|
-
js: 'javascript_highContrast',
|
|
237
|
-
},
|
|
238
|
-
fileNames: {
|
|
239
|
-
'filename.js': 'javascript_highContrast',
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
expectedConfig.fileNames = {
|
|
243
|
-
'.angular-cli.json': 'angular',
|
|
244
|
-
'angular-cli.json': 'angular',
|
|
245
|
-
'filename.js': 'javascript',
|
|
246
|
-
};
|
|
247
|
-
/* eslint-enable camelcase */
|
|
248
|
-
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
249
|
-
});
|
|
250
|
-
});
|