material-icon-theme 4.21.0 → 4.22.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/.vscodeignore +2 -1
- package/CHANGELOG.md +1267 -1233
- package/README.md +7 -16
- package/icons/actionscript.svg +1 -1
- package/icons/android.svg +1 -1
- package/icons/antlr.svg +1 -0
- package/icons/architecture.svg +1 -5
- package/icons/asciidoc.svg +1 -1
- package/icons/assembly.svg +1 -1
- package/icons/astyle.svg +1 -4
- package/icons/aurelia.svg +1 -1
- package/icons/auto.svg +1 -10
- package/icons/auto_light.svg +1 -10
- package/icons/autohotkey.svg +1 -1
- package/icons/autoit.svg +1 -1
- package/icons/azure-pipelines.svg +1 -1
- package/icons/azure.svg +1 -10
- package/icons/ballerina.svg +1 -1
- package/icons/bazel.svg +1 -1
- package/icons/bitbucket.svg +1 -1
- package/icons/blink.svg +1 -1
- package/icons/blink_light.svg +1 -1
- package/icons/blitz.svg +1 -4
- package/icons/brainfuck.svg +1 -1
- package/icons/buck.svg +1 -1
- package/icons/bucklescript.svg +1 -1
- package/icons/buildkite.svg +1 -9
- package/icons/caddy.svg +1 -9
- package/icons/cadence.svg +1 -10
- package/icons/cloudfoundry.svg +1 -1
- package/icons/coala.svg +1 -1
- package/icons/codecov.svg +1 -1
- package/icons/coldfusion.svg +1 -1
- package/icons/commitlint.svg +1 -1
- package/icons/crystal.svg +1 -1
- package/icons/crystal_light.svg +1 -1
- package/icons/cucumber.svg +1 -1
- package/icons/cuda.svg +1 -1
- package/icons/cypress.svg +1 -4
- package/icons/dart_generated.svg +1 -9
- package/icons/dependabot.svg +1 -4
- package/icons/dinophp.svg +1 -16
- package/icons/docker.svg +1 -1
- package/icons/drawio.svg +1 -1
- package/icons/drone.svg +1 -6
- package/icons/drone_light.svg +1 -6
- package/icons/editorconfig.svg +1 -1
- package/icons/elm.svg +1 -1
- package/icons/figma.svg +1 -10
- package/icons/folder-angular-open.svg +1 -2
- package/icons/folder-angular.svg +1 -2
- package/icons/folder-ansible-open.svg +1 -1
- package/icons/folder-ansible.svg +1 -1
- package/icons/folder-apollo.svg +1 -1
- package/icons/folder-aurelia-open.svg +1 -1
- package/icons/folder-aurelia.svg +1 -1
- package/icons/folder-bower-open.svg +1 -1
- package/icons/folder-bower.svg +1 -1
- package/icons/folder-buildkite-open.svg +1 -9
- package/icons/folder-buildkite.svg +1 -8
- package/icons/folder-cart-open.svg +1 -1
- package/icons/folder-cart.svg +1 -1
- package/icons/folder-ci-open.svg +1 -1
- package/icons/folder-ci.svg +1 -1
- package/icons/folder-cobol-open.svg +1 -1
- package/icons/folder-cobol.svg +1 -1
- package/icons/folder-config-open.svg +1 -1
- package/icons/folder-config.svg +1 -1
- package/icons/folder-container-open.svg +1 -1
- package/icons/folder-container.svg +1 -1
- package/icons/folder-controller-open.svg +1 -1
- package/icons/folder-controller.svg +1 -1
- package/icons/folder-cypress-open.svg +1 -5
- package/icons/folder-cypress.svg +1 -5
- package/icons/folder-decorators-open.svg +2 -0
- package/icons/folder-decorators.svg +5 -0
- package/icons/folder-docker-open.svg +1 -1
- package/icons/folder-docker.svg +1 -1
- package/icons/folder-expo.svg +1 -1
- package/icons/folder-fastlane-open.svg +1 -1
- package/icons/folder-fastlane.svg +1 -1
- package/icons/folder-generator-open.svg +1 -1
- package/icons/folder-generator.svg +1 -1
- package/icons/folder-gitlab-open.svg +1 -2
- package/icons/folder-gitlab.svg +1 -2
- package/icons/folder-gradle-open.svg +1 -1
- package/icons/folder-gradle.svg +1 -1
- package/icons/folder-helper-open.svg +1 -1
- package/icons/folder-helper.svg +1 -1
- package/icons/folder-ios-open.svg +1 -1
- package/icons/folder-ios.svg +1 -1
- package/icons/folder-java-open.svg +1 -2
- package/icons/folder-java.svg +1 -2
- package/icons/folder-kubernetes-open.svg +1 -1
- package/icons/folder-kubernetes.svg +1 -1
- package/icons/folder-less-open.svg +1 -1
- package/icons/folder-less.svg +1 -1
- package/icons/folder-lib-open.svg +1 -1
- package/icons/folder-lib.svg +1 -1
- package/icons/folder-lua-open.svg +1 -1
- package/icons/folder-lua.svg +1 -1
- package/icons/folder-markdown-open.svg +1 -1
- package/icons/folder-markdown.svg +1 -1
- package/icons/folder-mjml.svg +1 -1
- package/icons/folder-netlify-open.svg +1 -5
- package/icons/folder-netlify.svg +1 -2
- package/icons/folder-next-open.svg +1 -2
- package/icons/folder-next.svg +1 -2
- package/icons/folder-nuxt-open.svg +1 -2
- package/icons/folder-nuxt.svg +1 -2
- package/icons/folder-pdf-open.svg +1 -2
- package/icons/folder-pdf.svg +1 -2
- package/icons/folder-php-open.svg +1 -1
- package/icons/folder-php.svg +1 -1
- package/icons/folder-pipe.svg +1 -1
- package/icons/folder-proto-open.svg +1 -2
- package/icons/folder-proto.svg +1 -2
- package/icons/folder-public-open.svg +1 -1
- package/icons/folder-python-open.svg +1 -1
- package/icons/folder-python.svg +1 -1
- package/icons/folder-queue-open.svg +1 -2
- package/icons/folder-queue.svg +1 -2
- package/icons/folder-react-components-open.svg +1 -1
- package/icons/folder-react-components.svg +1 -1
- package/icons/folder-redux-actions-open.svg +1 -1
- package/icons/folder-redux-actions.svg +1 -1
- package/icons/folder-redux-reducer-open.svg +1 -1
- package/icons/folder-redux-reducer.svg +1 -1
- package/icons/folder-redux-selector-open.svg +1 -1
- package/icons/folder-redux-selector.svg +1 -1
- package/icons/folder-redux-store-open.svg +1 -1
- package/icons/folder-redux-store.svg +1 -1
- package/icons/folder-resolver-open.svg +1 -2
- package/icons/folder-resolver.svg +1 -2
- package/icons/folder-resource-open.svg +1 -1
- package/icons/folder-resource.svg +1 -1
- package/icons/folder-sass-open.svg +1 -1
- package/icons/folder-sass.svg +1 -1
- package/icons/folder-scala-open.svg +1 -1
- package/icons/folder-scala.svg +1 -1
- package/icons/folder-server-open.svg +1 -1
- package/icons/folder-server.svg +1 -1
- package/icons/folder-serverless-open.svg +1 -5
- package/icons/folder-serverless.svg +1 -5
- package/icons/folder-shader-open.svg +1 -8
- package/icons/folder-shader.svg +1 -7
- package/icons/folder-src-open.svg +1 -1
- package/icons/folder-src.svg +1 -1
- package/icons/folder-stencil-open.svg +1 -1
- package/icons/folder-stencil.svg +1 -1
- package/icons/folder-supabase-open.svg +5 -0
- package/icons/folder-supabase.svg +2 -0
- package/icons/folder-svelte-open.svg +1 -1
- package/icons/folder-target-open.svg +1 -2
- package/icons/folder-target.svg +1 -2
- package/icons/folder-terraform-open.svg +1 -1
- package/icons/folder-terraform.svg +1 -1
- package/icons/folder-typescript-open.svg +1 -1
- package/icons/folder-typescript.svg +1 -1
- package/icons/folder-unity-open.svg +1 -2
- package/icons/folder-unity.svg +1 -2
- package/icons/folder-vercel-open.svg +1 -4
- package/icons/folder-vercel.svg +1 -4
- package/icons/folder-verdaccio-open.svg +1 -8
- package/icons/folder-verdaccio.svg +1 -8
- package/icons/folder-vue-directives-open.svg +1 -1
- package/icons/folder-vue-directives.svg +1 -1
- package/icons/folder-vue-open.svg +1 -1
- package/icons/folder-vue.svg +1 -1
- package/icons/folder-vuepress-open.svg +1 -1
- package/icons/folder-wakatime-open.svg +1 -1
- package/icons/folder-wakatime.svg +1 -1
- package/icons/folder-wordpress-open.svg +1 -1
- package/icons/folder-wordpress.svg +1 -1
- package/icons/forth.svg +1 -1
- package/icons/foxpro.svg +1 -1
- package/icons/fusebox.svg +1 -1
- package/icons/gatsby.svg +1 -1
- package/icons/gcp.svg +1 -1
- package/icons/gitlab.svg +1 -1
- package/icons/gleam.svg +1 -4
- package/icons/go-mod.svg +1 -1
- package/icons/go.svg +1 -1
- package/icons/graphcool.svg +1 -1
- package/icons/graphql.svg +1 -1
- package/icons/gridsome.svg +1 -4
- package/icons/grunt.svg +1 -1
- package/icons/hack.svg +1 -1
- package/icons/haml.svg +1 -1
- package/icons/hardhat.svg +1 -4
- package/icons/helm.svg +1 -1
- package/icons/heroku.svg +1 -1
- package/icons/hex.svg +1 -1
- package/icons/idris.svg +1 -1
- package/icons/jenkins.svg +1 -1
- package/icons/jest.svg +1 -1
- package/icons/jinja.svg +1 -1
- package/icons/jinja_light.svg +1 -1
- package/icons/kivy.svg +1 -1
- package/icons/kl.svg +1 -1
- package/icons/kusto.svg +1 -1
- package/icons/laravel.svg +1 -1
- package/icons/less.svg +1 -1
- package/icons/lighthouse.svg +1 -3
- package/icons/livescript.svg +1 -1
- package/icons/mdsvex.svg +1 -5
- package/icons/merlin.svg +1 -1
- package/icons/mjml.svg +1 -1
- package/icons/mocha.svg +1 -1
- package/icons/modernizr.svg +1 -1
- package/icons/nano-staged.svg +1 -0
- package/icons/nano-staged_light.svg +1 -0
- package/icons/ndst.svg +1 -7
- package/icons/netlify.svg +1 -1
- package/icons/next.svg +1 -3
- package/icons/next_light.svg +1 -3
- package/icons/npm.svg +1 -1
- package/icons/nrwl.svg +1 -1
- package/icons/nunjucks.svg +1 -1
- package/icons/nuxt.svg +1 -5
- package/icons/odin.svg +1 -6
- package/icons/otne.svg +1 -16
- package/icons/parcel.svg +1 -4
- package/icons/pdf.svg +1 -4
- package/icons/percy.svg +1 -1
- package/icons/pinejs.svg +1 -0
- package/icons/playwright.svg +1 -7
- package/icons/plop.svg +1 -4
- package/icons/pnpm.svg +1 -9
- package/icons/pnpm_light.svg +1 -7
- package/icons/poetry.svg +1 -1
- package/icons/postcss.svg +1 -1
- package/icons/posthtml.svg +1 -1
- package/icons/processing.svg +1 -10
- package/icons/prolog.svg +1 -1
- package/icons/protractor.svg +1 -1
- package/icons/pug.svg +1 -1
- package/icons/puppet.svg +1 -1
- package/icons/purescript.svg +1 -1
- package/icons/python.svg +1 -1
- package/icons/racket.svg +1 -1
- package/icons/red.svg +1 -1
- package/icons/remix.svg +1 -4
- package/icons/remix_light.svg +1 -4
- package/icons/replit.svg +1 -1
- package/icons/rescript-interface.svg +1 -5
- package/icons/restql.svg +1 -1
- package/icons/roadmap.svg +1 -1
- package/icons/robot.svg +1 -1
- package/icons/rollup.svg +1 -1
- package/icons/rome.svg +1 -5
- package/icons/rubocop.svg +1 -1
- package/icons/rubocop_light.svg +1 -1
- package/icons/ruby.svg +1 -1
- package/icons/san.svg +1 -1
- package/icons/sass.svg +1 -1
- package/icons/scala.svg +1 -1
- package/icons/sequelize.svg +1 -1
- package/icons/serverless.svg +1 -4
- package/icons/shader.svg +1 -4
- package/icons/silverstripe.svg +1 -1
- package/icons/siyuan.svg +1 -9
- package/icons/sketch.svg +1 -1
- package/icons/snyk.svg +1 -1
- package/icons/sonarcloud.svg +4 -0
- package/icons/steadybit.svg +1 -1
- package/icons/stencil.svg +1 -1
- package/icons/stitches.svg +1 -1
- package/icons/stitches_light.svg +1 -1
- package/icons/stylable.svg +10 -0
- package/icons/supabase.svg +4 -0
- package/icons/svgr.svg +1 -4
- package/icons/tauri.svg +1 -9
- package/icons/template.svg +1 -4
- package/icons/tobi.svg +1 -4
- package/icons/tobimake.svg +1 -14
- package/icons/tree.svg +1 -2
- package/icons/tsconfig.svg +1 -1
- package/icons/turborepo.svg +1 -12
- package/icons/turborepo_light.svg +1 -12
- package/icons/twine.svg +1 -1
- package/icons/vagrant.svg +1 -1
- package/icons/verdaccio.svg +1 -5
- package/icons/vscode.svg +1 -1
- package/icons/vue-config.svg +1 -1
- package/icons/vue.svg +1 -1
- package/icons/webhint.svg +1 -1
- package/icons/zig.svg +1 -1
- package/images/contributors.png +0 -0
- package/images/fileIcons.png +0 -0
- package/images/folderIcons.png +0 -0
- package/package.json +252 -267
- package/package.nls.de.json +0 -3
- package/package.nls.es.json +0 -3
- package/package.nls.fr.json +0 -3
- package/package.nls.ja.json +0 -3
- package/package.nls.json +0 -3
- package/package.nls.nl.json +0 -3
- package/package.nls.pl.json +0 -3
- package/package.nls.pt-BR.json +0 -3
- package/package.nls.pt-PT.json +0 -3
- package/package.nls.ru.json +0 -3
- package/package.nls.zh-CN.json +0 -3
- package/package.nls.zh-TW.json +0 -3
- package/src/commands/activate.ts +11 -9
- package/src/commands/explorerArrows.ts +18 -18
- package/src/commands/folderColor.ts +12 -12
- package/src/commands/folders.ts +17 -17
- package/src/commands/grayscale.ts +17 -17
- package/src/commands/iconPacks.ts +12 -16
- package/src/commands/index.ts +5 -5
- package/src/commands/opacity.ts +8 -8
- package/src/commands/saturation.ts +8 -8
- package/src/extension.ts +8 -13
- package/src/helpers/customIcons.ts +2 -2
- package/src/helpers/index.ts +10 -22
- package/src/i18n/index.ts +2 -2
- package/src/i18n/lang-de.ts +0 -11
- package/src/i18n/lang-en.ts +5 -15
- package/src/i18n/lang-es.ts +0 -10
- package/src/i18n/lang-fr.ts +0 -10
- package/src/i18n/lang-ja.ts +0 -11
- package/src/i18n/lang-nl.ts +0 -11
- package/src/i18n/lang-pl.ts +0 -9
- package/src/i18n/lang-pt-br.ts +0 -10
- package/src/i18n/lang-pt-pt.ts +0 -10
- package/src/i18n/lang-ru.ts +0 -9
- package/src/i18n/lang-uk.ts +0 -11
- package/src/i18n/lang-zh-cn.ts +0 -9
- package/src/i18n/lang-zh-tw.ts +0 -9
- package/src/icons/fileIcons.ts +2159 -2113
- package/src/icons/folderIcons.ts +804 -790
- package/src/icons/generator/folderGenerator.ts +7 -7
- package/src/icons/generator/iconOpacity.ts +10 -10
- package/src/icons/generator/iconSaturation.ts +10 -10
- package/src/icons/generator/jsonGenerator.ts +21 -17
- package/src/icons/languageIcons.ts +1 -0
- package/src/models/i18n/translation.ts +0 -9
- package/src/models/iconConfiguration.ts +1 -1
- package/src/models/icons/iconJsonOptions.ts +0 -2
- package/src/models/index.ts +0 -1
- package/src/scripts/contributors/index.ts +14 -14
- package/src/scripts/helpers/screenshots.ts +4 -4
- package/src/scripts/icons/checks/checkIconAvailability.ts +12 -12
- package/src/scripts/icons/checks/checkIconConflicts.ts +6 -8
- package/src/scripts/icons/checks/checkIconUsage.ts +9 -13
- package/src/scripts/icons/checks/index.ts +6 -6
- package/src/scripts/preview/preview.ts +8 -10
- package/src/test/runTest.ts +3 -3
- package/src/test/spec/i18n/i18n.spec.ts +13 -20
- package/src/test/spec/icons/fileIcons.spec.ts +5 -5
- package/src/test/spec/icons/folderIcons.spec.ts +8 -8
- package/src/test/spec/icons/languageIcons.spec.ts +6 -6
- package/images/oneclickactivation.png +0 -0
- package/src/helpers/versioning.ts +0 -73
- package/src/messages/outdated.ts +0 -33
- package/src/messages/reload.ts +0 -32
- package/src/messages/start.ts +0 -12
- package/src/messages/update.ts +0 -48
- package/src/messages/welcome.ts +0 -47
- package/src/models/helpers/index.ts +0 -1
- package/src/models/helpers/themeStatus.ts +0 -5
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { equal } from 'assert';
|
|
2
2
|
import { getObjectPropertyValue } from '../../../helpers/objects';
|
|
3
|
-
import
|
|
3
|
+
import { getTranslationValue, initTranslations, replace } from '../../../i18n';
|
|
4
4
|
import { Translation } from '../../../models';
|
|
5
5
|
|
|
6
6
|
describe('i18n', () => {
|
|
7
7
|
it('should initialize translations', () => {
|
|
8
|
-
return
|
|
8
|
+
return initTranslations();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('should translate key', () => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
equal(
|
|
13
|
+
getTranslationValue('activate', { activate: 'b' } as Translation),
|
|
14
14
|
'b'
|
|
15
15
|
);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
it('should return undefined if translation is not defined', () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'activate',
|
|
22
|
-
{} as Translation,
|
|
23
|
-
{} as Translation
|
|
24
|
-
),
|
|
19
|
+
equal(
|
|
20
|
+
getTranslationValue('activate', {} as Translation, {} as Translation),
|
|
25
21
|
undefined
|
|
26
22
|
);
|
|
27
23
|
});
|
|
28
24
|
|
|
29
25
|
it('should use fallback if translation is not defined', () => {
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
equal(
|
|
27
|
+
getTranslationValue(
|
|
32
28
|
'activate',
|
|
33
29
|
{} as Translation,
|
|
34
30
|
{ activate: 'fb' } as Translation
|
|
@@ -45,16 +41,13 @@ describe('i18n', () => {
|
|
|
45
41
|
},
|
|
46
42
|
},
|
|
47
43
|
};
|
|
48
|
-
|
|
44
|
+
equal(getObjectPropertyValue(translation, 'a.b.c'), 'c');
|
|
49
45
|
});
|
|
50
46
|
|
|
51
47
|
it('should use placeholder in translation', () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
);
|
|
56
|
-
assert.equal(
|
|
57
|
-
i18n.replace('%0 with %1', 'test', 'placeholder'),
|
|
48
|
+
equal(replace('%0 with placeholder', 'test'), 'test with placeholder');
|
|
49
|
+
equal(
|
|
50
|
+
replace('%0 with %1', 'test', 'placeholder'),
|
|
58
51
|
'test with placeholder'
|
|
59
52
|
);
|
|
60
53
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { deepStrictEqual } from 'assert';
|
|
2
2
|
import merge from 'lodash.merge';
|
|
3
3
|
import {
|
|
4
4
|
getDefaultIconOptions,
|
|
@@ -60,7 +60,7 @@ describe('file icons', () => {
|
|
|
60
60
|
'filename.js': 'javascript',
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('should disable icon packs', () => {
|
|
@@ -108,7 +108,7 @@ describe('file icons', () => {
|
|
|
108
108
|
// disable default icon pack by using empty string
|
|
109
109
|
expectedConfig.options!.activeIconPack = '';
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
it('should configure custom icon associations', () => {
|
|
@@ -165,7 +165,7 @@ describe('file icons', () => {
|
|
|
165
165
|
'sample.js': 'javascript',
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
it('should configure language icons for light and high contrast', () => {
|
|
@@ -245,6 +245,6 @@ describe('file icons', () => {
|
|
|
245
245
|
'filename.js': 'javascript',
|
|
246
246
|
};
|
|
247
247
|
/* eslint-enable camelcase */
|
|
248
|
-
|
|
248
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
249
249
|
});
|
|
250
250
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { deepStrictEqual } from 'assert';
|
|
2
2
|
import merge from 'lodash.merge';
|
|
3
3
|
import {
|
|
4
4
|
getDefaultIconOptions,
|
|
@@ -98,7 +98,7 @@ describe('folder icons', () => {
|
|
|
98
98
|
};
|
|
99
99
|
expectedConfig.hidesExplorerArrows = false;
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
it('should deactivate folder icons', () => {
|
|
@@ -117,7 +117,7 @@ describe('folder icons', () => {
|
|
|
117
117
|
expectedConfig.hidesExplorerArrows = false;
|
|
118
118
|
expectedConfig.options!.folders!.theme = 'none';
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
it('should enable folder theme', () => {
|
|
@@ -159,7 +159,7 @@ describe('folder icons', () => {
|
|
|
159
159
|
expectedConfig.hidesExplorerArrows = false;
|
|
160
160
|
expectedConfig.options!.folders!.theme = 'blue';
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it('should configure custom icon associations', () => {
|
|
@@ -222,7 +222,7 @@ describe('folder icons', () => {
|
|
|
222
222
|
sample: 'src',
|
|
223
223
|
};
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
226
226
|
});
|
|
227
227
|
|
|
228
228
|
it('should disable icon packs', () => {
|
|
@@ -271,7 +271,7 @@ describe('folder icons', () => {
|
|
|
271
271
|
// disable default icon pack by using empty string
|
|
272
272
|
expectedConfig.options!.activeIconPack = '';
|
|
273
273
|
|
|
274
|
-
|
|
274
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
275
275
|
});
|
|
276
276
|
|
|
277
277
|
it('should configure folder icons for light and high contrast', () => {
|
|
@@ -400,7 +400,7 @@ describe('folder icons', () => {
|
|
|
400
400
|
};
|
|
401
401
|
expectedConfig.hidesExplorerArrows = false;
|
|
402
402
|
/* eslint-enable camelcase */
|
|
403
|
-
|
|
403
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
404
404
|
});
|
|
405
405
|
|
|
406
406
|
it('should hide explorer arrows', () => {
|
|
@@ -413,6 +413,6 @@ describe('folder icons', () => {
|
|
|
413
413
|
options
|
|
414
414
|
);
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
deepStrictEqual(iconDefinitions.hidesExplorerArrows, true);
|
|
417
417
|
});
|
|
418
418
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { deepStrictEqual } from 'assert';
|
|
2
2
|
import merge from 'lodash.merge';
|
|
3
3
|
import {
|
|
4
4
|
getDefaultIconOptions,
|
|
@@ -50,7 +50,7 @@ describe('language icons', () => {
|
|
|
50
50
|
c: 'c',
|
|
51
51
|
d: 'c',
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it('should disable icon definitions', () => {
|
|
@@ -74,7 +74,7 @@ describe('language icons', () => {
|
|
|
74
74
|
expectedConfig.languageIds = {
|
|
75
75
|
a: 'a',
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('should disable icon packs', () => {
|
|
@@ -92,7 +92,7 @@ describe('language icons', () => {
|
|
|
92
92
|
|
|
93
93
|
expectedConfig.iconDefinitions = {};
|
|
94
94
|
expectedConfig.languageIds = {};
|
|
95
|
-
|
|
95
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
it('should configure language icons for light and high contrast', () => {
|
|
@@ -149,7 +149,7 @@ describe('language icons', () => {
|
|
|
149
149
|
},
|
|
150
150
|
};
|
|
151
151
|
/* eslint-enable camelcase */
|
|
152
|
-
|
|
152
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
it('should configure custom icon associations', () => {
|
|
@@ -179,6 +179,6 @@ describe('language icons', () => {
|
|
|
179
179
|
expectedConfig.options!.languages!.associations = {
|
|
180
180
|
xml: 'json',
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
deepStrictEqual(iconDefinitions, expectedConfig);
|
|
183
183
|
});
|
|
184
184
|
});
|
|
Binary file
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { extensions, Memento, workspace } from 'vscode';
|
|
2
|
-
import { isThemeActivated } from '.';
|
|
3
|
-
import { ThemeStatus } from '../models/helpers/themeStatus';
|
|
4
|
-
|
|
5
|
-
/** Get configuration of vs code. */
|
|
6
|
-
export const getConfig = (section?: string) => {
|
|
7
|
-
return workspace.getConfiguration(section);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const versionKey = 'material-icon-theme.version';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Check the current status of the theme
|
|
14
|
-
* @param state Global state of context (Memento API)
|
|
15
|
-
*/
|
|
16
|
-
export const checkThemeStatus = async (
|
|
17
|
-
state: Memento
|
|
18
|
-
): Promise<ThemeStatus> => {
|
|
19
|
-
try {
|
|
20
|
-
// get the version from the state
|
|
21
|
-
const stateVersion = state.get(versionKey);
|
|
22
|
-
const packageVersion = getCurrentExtensionVersion();
|
|
23
|
-
|
|
24
|
-
// check if the theme was used before
|
|
25
|
-
if (stateVersion === undefined || typeof stateVersion !== 'string') {
|
|
26
|
-
await updateExtensionVersionInMemento(state);
|
|
27
|
-
return themeIsAlreadyActivated()
|
|
28
|
-
? ThemeStatus.updated
|
|
29
|
-
: ThemeStatus.neverUsedBefore;
|
|
30
|
-
}
|
|
31
|
-
// compare the version in the state with the package version
|
|
32
|
-
else if (packageVersion && isGreaterVersion(packageVersion, stateVersion)) {
|
|
33
|
-
await updateExtensionVersionInMemento(state);
|
|
34
|
-
return ThemeStatus.updated;
|
|
35
|
-
} else {
|
|
36
|
-
return ThemeStatus.current;
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error(error);
|
|
40
|
-
return ThemeStatus.current;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Compares two version numbers (e.g. 1.0.0 with 1.0.1)
|
|
46
|
-
* @param a version b
|
|
47
|
-
* @param b version a
|
|
48
|
-
* @returns true if version `a` is greater than version `b`
|
|
49
|
-
*/
|
|
50
|
-
const isGreaterVersion = (a: string, b: string): boolean => {
|
|
51
|
-
return (
|
|
52
|
-
a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }) === 1
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
/** Check if the theme was used before */
|
|
57
|
-
const themeIsAlreadyActivated = () => {
|
|
58
|
-
return isThemeActivated() || isThemeActivated(true);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/** Update the version number to the current version in the memento. */
|
|
62
|
-
const updateExtensionVersionInMemento = (state: Memento) => {
|
|
63
|
-
const currentVersion = getCurrentExtensionVersion();
|
|
64
|
-
if (currentVersion) {
|
|
65
|
-
return state.update(versionKey, currentVersion);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/** Get the current version of the extension */
|
|
70
|
-
const getCurrentExtensionVersion = (): string | undefined => {
|
|
71
|
-
return extensions.getExtension('PKief.material-icon-theme')?.packageJSON
|
|
72
|
-
.version;
|
|
73
|
-
};
|
package/src/messages/outdated.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as vscode from 'vscode';
|
|
2
|
-
import { translate } from '../i18n';
|
|
3
|
-
|
|
4
|
-
/** Show message that the editor version is outdated. */
|
|
5
|
-
export const showOutdatedMessage = () => {
|
|
6
|
-
vscode.window
|
|
7
|
-
.showWarningMessage(
|
|
8
|
-
translate('outdatedVersion'),
|
|
9
|
-
translate('updateVSCode'),
|
|
10
|
-
translate('howToActivate')
|
|
11
|
-
)
|
|
12
|
-
.then(handleActivateActions);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/** Handle the actions from the outdatedMessage command message */
|
|
16
|
-
const handleActivateActions = (value: string | undefined) => {
|
|
17
|
-
switch (value) {
|
|
18
|
-
case translate('howToActivate'):
|
|
19
|
-
vscode.env.openExternal(
|
|
20
|
-
vscode.Uri.parse(
|
|
21
|
-
'https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes'
|
|
22
|
-
)
|
|
23
|
-
);
|
|
24
|
-
break;
|
|
25
|
-
|
|
26
|
-
case translate('updateVSCode'):
|
|
27
|
-
open('https://code.visualstudio.com/download');
|
|
28
|
-
break;
|
|
29
|
-
|
|
30
|
-
default:
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
};
|
package/src/messages/reload.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as vscode from 'vscode';
|
|
2
|
-
import { getThemeConfig, setThemeConfig } from '../helpers';
|
|
3
|
-
import { translate } from '../i18n';
|
|
4
|
-
|
|
5
|
-
/** User has to confirm if he wants to reload the editor */
|
|
6
|
-
export const showConfirmToReloadMessage = async (): Promise<boolean> => {
|
|
7
|
-
// if the user does not want to see the reload message
|
|
8
|
-
if (getThemeConfig('showReloadMessage')?.globalValue === false) false;
|
|
9
|
-
|
|
10
|
-
const response = await vscode.window.showInformationMessage(
|
|
11
|
-
translate('confirmReload'),
|
|
12
|
-
translate('reload'),
|
|
13
|
-
translate('neverShowAgain')
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
switch (response) {
|
|
17
|
-
case translate('reload'):
|
|
18
|
-
return true;
|
|
19
|
-
|
|
20
|
-
case translate('neverShowAgain'):
|
|
21
|
-
disableReloadMessage();
|
|
22
|
-
return false;
|
|
23
|
-
|
|
24
|
-
default:
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** Disable the reload message in the global settings */
|
|
30
|
-
const disableReloadMessage = () => {
|
|
31
|
-
setThemeConfig('showReloadMessage', false, true);
|
|
32
|
-
};
|
package/src/messages/start.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ThemeStatus } from '../models/helpers/themeStatus';
|
|
2
|
-
import { showUpdateMessage } from './update';
|
|
3
|
-
import { showWelcomeMessage } from './welcome';
|
|
4
|
-
|
|
5
|
-
/** Initialization of the icons every time the theme get activated */
|
|
6
|
-
export const showStartMessages = (status: ThemeStatus) => {
|
|
7
|
-
if (status === ThemeStatus.updated) {
|
|
8
|
-
showUpdateMessage();
|
|
9
|
-
} else if (status === ThemeStatus.neverUsedBefore) {
|
|
10
|
-
showWelcomeMessage();
|
|
11
|
-
}
|
|
12
|
-
};
|
package/src/messages/update.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as vscode from 'vscode';
|
|
2
|
-
import { activateIcons } from '../commands/activate';
|
|
3
|
-
import { getThemeConfig, isThemeNotVisible, setThemeConfig } from '../helpers';
|
|
4
|
-
import { translate } from './../i18n';
|
|
5
|
-
|
|
6
|
-
/** Show the update message if the icon theme has been updated. */
|
|
7
|
-
export const showUpdateMessage = () => {
|
|
8
|
-
// if the user does not want to see the update message
|
|
9
|
-
if (getThemeConfig('showUpdateMessage')?.globalValue !== true) return;
|
|
10
|
-
|
|
11
|
-
vscode.window
|
|
12
|
-
.showInformationMessage(
|
|
13
|
-
translate('themeUpdated'),
|
|
14
|
-
isThemeNotVisible() ? translate('activate') : '',
|
|
15
|
-
translate('readChangelog'),
|
|
16
|
-
translate('neverShowAgain')
|
|
17
|
-
)
|
|
18
|
-
.then(handleUpdateMessageActions);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/** Handle the actions of the update message. */
|
|
22
|
-
const handleUpdateMessageActions = (value: string | undefined) => {
|
|
23
|
-
switch (value) {
|
|
24
|
-
case translate('activate'):
|
|
25
|
-
activateIcons();
|
|
26
|
-
break;
|
|
27
|
-
|
|
28
|
-
case translate('readChangelog'):
|
|
29
|
-
vscode.env.openExternal(
|
|
30
|
-
vscode.Uri.parse(
|
|
31
|
-
'https://marketplace.visualstudio.com/items/PKief.material-icon-theme/changelog'
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
break;
|
|
35
|
-
|
|
36
|
-
case translate('neverShowAgain'):
|
|
37
|
-
disableUpdateMessage();
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
default:
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/** Disable the update messages in the global settings */
|
|
46
|
-
const disableUpdateMessage = () => {
|
|
47
|
-
setThemeConfig('showUpdateMessage', false, true);
|
|
48
|
-
};
|
package/src/messages/welcome.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as vscode from 'vscode';
|
|
2
|
-
import { activateIcons } from '../commands/activate';
|
|
3
|
-
import { getThemeConfig, isThemeNotVisible, setThemeConfig } from '../helpers';
|
|
4
|
-
import { translate } from '../i18n';
|
|
5
|
-
|
|
6
|
-
/** Show the welcome message if the icon theme has been installed the first time. */
|
|
7
|
-
export const showWelcomeMessage = () => {
|
|
8
|
-
// if the user does not want to see the welcome message
|
|
9
|
-
if (getThemeConfig('showWelcomeMessage')?.globalValue === false) return;
|
|
10
|
-
|
|
11
|
-
vscode.window
|
|
12
|
-
.showInformationMessage(
|
|
13
|
-
translate('themeInstalled'),
|
|
14
|
-
isThemeNotVisible() ? translate('activate') : '',
|
|
15
|
-
translate('neverShowAgain')
|
|
16
|
-
)
|
|
17
|
-
.then(handleWelcomeMessageActions);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/** Handle the actions of the welcome message. */
|
|
21
|
-
const handleWelcomeMessageActions = (value: string | undefined) => {
|
|
22
|
-
switch (value) {
|
|
23
|
-
case translate('activate'):
|
|
24
|
-
activateIcons();
|
|
25
|
-
break;
|
|
26
|
-
|
|
27
|
-
case translate('howToActivate'):
|
|
28
|
-
vscode.env.openExternal(
|
|
29
|
-
vscode.Uri.parse(
|
|
30
|
-
'https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes'
|
|
31
|
-
)
|
|
32
|
-
);
|
|
33
|
-
break;
|
|
34
|
-
|
|
35
|
-
case translate('neverShowAgain'):
|
|
36
|
-
disableWelcomeMessage();
|
|
37
|
-
break;
|
|
38
|
-
|
|
39
|
-
default:
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/** Disable the welcome messages in the global settings */
|
|
45
|
-
const disableWelcomeMessage = () => {
|
|
46
|
-
setThemeConfig('showWelcomeMessage', false, true);
|
|
47
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './themeStatus';
|