devextreme-themebuilder 24.1.2-beta → 24.1.3

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.
@@ -1,81 +1,81 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.optimizeCss = exports.removeExternalResources = exports.fixSwatchCss = exports.autoPrefix = exports.cleanCss = exports.addInfoHeader = exports.addBasePath = void 0;
16
- const clean_css_1 = __importDefault(require("clean-css"));
17
- const autoprefixer_1 = __importDefault(require("autoprefixer"));
18
- const postcss_1 = __importDefault(require("postcss"));
19
- const clean_css_options_json_1 = __importDefault(require("../data/clean-css-options.json"));
20
- // eslint-disable-next-line import/extensions
21
- const dx_theme_builder_metadata_1 = require("../data/metadata/dx-theme-builder-metadata");
22
- function addBasePath(css, basePath) {
23
- const normalizedPath = `${basePath.replace(/[/\\]$/, '')}/`;
24
- return css.toString().replace(/(url\()("|')?(icons|fonts)/g, `$1$2${normalizedPath}$3`);
25
- }
26
- exports.addBasePath = addBasePath;
27
- function addInfoHeader(css, version) {
28
- const generatedBy = '* Generated by the DevExpress ThemeBuilder';
29
- const versionString = `* Version: ${version}`;
30
- const link = '* http://js.devexpress.com/ThemeBuilder/';
31
- const header = `/*${generatedBy}\n${versionString}\n${link}\n*/\n\n`;
32
- const source = css.toString();
33
- const encoding = '@charset "UTF-8";';
34
- if (source.startsWith(encoding)) {
35
- return `${encoding}\n${header}${source.replace(`${encoding}\n`, '')}`;
36
- }
37
- return `${header}${css}`;
38
- }
39
- exports.addInfoHeader = addInfoHeader;
40
- function cleanCss(css) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const promiseOptions = { returnPromise: true };
43
- const options = Object.assign(Object.assign({}, clean_css_options_json_1.default), promiseOptions);
44
- const cleaner = new clean_css_1.default(options);
45
- return (yield cleaner.minify(css)).styles;
46
- });
47
- }
48
- exports.cleanCss = cleanCss;
49
- function autoPrefix(css) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- return (yield (0, postcss_1.default)((0, autoprefixer_1.default)({
52
- overrideBrowserslist: dx_theme_builder_metadata_1.browsersList,
53
- })).process(css, {
54
- from: undefined,
55
- })).css;
56
- });
57
- }
58
- exports.autoPrefix = autoPrefix;
59
- function fixSwatchCss(css, swatchClass, colorScheme) {
60
- let result = css.toString();
61
- const escapedSelector = swatchClass.replace('.', '\\.');
62
- const swatchOrderRegex = new RegExp(`([ \\t]*)([\\w\\.#:\\*][\\w\\.#:\\*\\->()\\s]*)(${escapedSelector}\\s)([^,{+~]*)`, 'gm');
63
- const changeTypographyRulesOrderRegex = /(\.dx-swatch-.*?)\s(\.dx-theme-.*?-typography)(.*?)(\s{|,)/g;
64
- const themeMarkerRegex = /(\.dx-theme-marker\s*{\s*font-family:\s*['"]dx\..*?\.)(.*)(['"])/g;
65
- result = result
66
- .replace(swatchOrderRegex, '$1$3$2$4')
67
- .replace(changeTypographyRulesOrderRegex, '$2 $1$3,$2$1$3$4')
68
- .replace(themeMarkerRegex, `$1${colorScheme}$3`);
69
- return result;
70
- }
71
- exports.fixSwatchCss = fixSwatchCss;
72
- function removeExternalResources(css) {
73
- const fontRegex = /^\s*@import\surl\(.*googleapis.*\);[\n\r]{0,2}/gmi;
74
- return css.replace(fontRegex, '');
75
- }
76
- exports.removeExternalResources = removeExternalResources;
77
- function optimizeCss(css) {
78
- const optimizedCss = css.replace(/rgba\(0,0,0,0\)/g, 'transparent');
79
- return optimizedCss;
80
- }
81
- exports.optimizeCss = optimizeCss;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.optimizeCss = exports.removeExternalResources = exports.fixSwatchCss = exports.autoPrefix = exports.cleanCss = exports.addInfoHeader = exports.addBasePath = void 0;
16
+ const clean_css_1 = __importDefault(require("clean-css"));
17
+ const autoprefixer_1 = __importDefault(require("autoprefixer"));
18
+ const postcss_1 = __importDefault(require("postcss"));
19
+ const clean_css_options_json_1 = __importDefault(require("../data/clean-css-options.json"));
20
+ // eslint-disable-next-line import/extensions
21
+ const dx_theme_builder_metadata_1 = require("../data/metadata/dx-theme-builder-metadata");
22
+ function addBasePath(css, basePath) {
23
+ const normalizedPath = `${basePath.replace(/[/\\]$/, '')}/`;
24
+ return css.toString().replace(/(url\()("|')?(icons|fonts)/g, `$1$2${normalizedPath}$3`);
25
+ }
26
+ exports.addBasePath = addBasePath;
27
+ function addInfoHeader(css, version) {
28
+ const generatedBy = '* Generated by the DevExpress ThemeBuilder';
29
+ const versionString = `* Version: ${version}`;
30
+ const link = '* http://js.devexpress.com/ThemeBuilder/';
31
+ const header = `/*${generatedBy}\n${versionString}\n${link}\n*/\n\n`;
32
+ const source = css.toString();
33
+ const encoding = '@charset "UTF-8";';
34
+ if (source.startsWith(encoding)) {
35
+ return `${encoding}\n${header}${source.replace(`${encoding}\n`, '')}`;
36
+ }
37
+ return `${header}${css}`;
38
+ }
39
+ exports.addInfoHeader = addInfoHeader;
40
+ function cleanCss(css) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const promiseOptions = { returnPromise: true };
43
+ const options = Object.assign(Object.assign({}, clean_css_options_json_1.default), promiseOptions);
44
+ const cleaner = new clean_css_1.default(options);
45
+ return (yield cleaner.minify(css)).styles;
46
+ });
47
+ }
48
+ exports.cleanCss = cleanCss;
49
+ function autoPrefix(css) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ return (yield (0, postcss_1.default)((0, autoprefixer_1.default)({
52
+ overrideBrowserslist: dx_theme_builder_metadata_1.browsersList,
53
+ })).process(css, {
54
+ from: undefined,
55
+ })).css;
56
+ });
57
+ }
58
+ exports.autoPrefix = autoPrefix;
59
+ function fixSwatchCss(css, swatchClass, colorScheme) {
60
+ let result = css.toString();
61
+ const escapedSelector = swatchClass.replace('.', '\\.');
62
+ const swatchOrderRegex = new RegExp(`([ \\t]*)([\\w\\.#:\\*][\\w\\.#:\\*\\->()\\s]*)(${escapedSelector}\\s)([^,{+~]*)`, 'gm');
63
+ const changeTypographyRulesOrderRegex = /(\.dx-swatch-.*?)\s(\.dx-theme-.*?-typography)(.*?)(\s{|,)/g;
64
+ const themeMarkerRegex = /(\.dx-theme-marker\s*{\s*font-family:\s*['"]dx\..*?\.)(.*)(['"])/g;
65
+ result = result
66
+ .replace(swatchOrderRegex, '$1$3$2$4')
67
+ .replace(changeTypographyRulesOrderRegex, '$2 $1$3,$2$1$3$4')
68
+ .replace(themeMarkerRegex, `$1${colorScheme}$3`);
69
+ return result;
70
+ }
71
+ exports.fixSwatchCss = fixSwatchCss;
72
+ function removeExternalResources(css) {
73
+ const fontRegex = /^\s*@import\surl\(.*googleapis.*\);[\n\r]{0,2}/gmi;
74
+ return css.replace(fontRegex, '');
75
+ }
76
+ exports.removeExternalResources = removeExternalResources;
77
+ function optimizeCss(css) {
78
+ const optimizedCss = css.replace(/rgba\(0,0,0,0\)/g, 'transparent');
79
+ return optimizedCss;
80
+ }
81
+ exports.optimizeCss = optimizeCss;
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSassForSwatch = void 0;
4
- const SWATCH_SELECTOR_PREFIX = '.dx-swatch-';
5
- function createSassForSwatch(outColorScheme, sass) {
6
- const unchangedParts = [];
7
- const importRegex = /@import .*?;\n/g;
8
- const fontFaceRegex = /@font-face\s*{.*?}\n/gs;
9
- const replaceHandler = (substring) => {
10
- unchangedParts.push(substring);
11
- return '';
12
- };
13
- let source = sass.toString();
14
- source = source
15
- .replace(importRegex, replaceHandler)
16
- .replace(fontFaceRegex, replaceHandler);
17
- const selector = SWATCH_SELECTOR_PREFIX + outColorScheme;
18
- const cleanSass = source.replace('@charset "UTF-8";', '');
19
- return {
20
- sass: `${unchangedParts.join('')}${selector} { ${cleanSass} };`,
21
- selector,
22
- };
23
- }
24
- exports.createSassForSwatch = createSassForSwatch;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSassForSwatch = void 0;
4
+ const SWATCH_SELECTOR_PREFIX = '.dx-swatch-';
5
+ function createSassForSwatch(outColorScheme, sass) {
6
+ const unchangedParts = [];
7
+ const importRegex = /@import .*?;\n/g;
8
+ const fontFaceRegex = /@font-face\s*{.*?}\n/gs;
9
+ const replaceHandler = (substring) => {
10
+ unchangedParts.push(substring);
11
+ return '';
12
+ };
13
+ let source = sass.toString();
14
+ source = source
15
+ .replace(importRegex, replaceHandler)
16
+ .replace(fontFaceRegex, replaceHandler);
17
+ const selector = SWATCH_SELECTOR_PREFIX + outColorScheme;
18
+ const cleanSass = source.replace('@charset "UTF-8";', '');
19
+ return {
20
+ sass: `${unchangedParts.join('')}${selector} { ${cleanSass} };`,
21
+ selector,
22
+ };
23
+ }
24
+ exports.createSassForSwatch = createSassForSwatch;
package/modules/themes.js CHANGED
@@ -1,137 +1,137 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const themes = [
4
- {
5
- themeId: 1, name: 'generic', colorScheme: 'light', text: 'Light', group: 'Generic',
6
- },
7
- {
8
- themeId: 2, name: 'generic', colorScheme: 'dark', text: 'Dark', group: 'Generic',
9
- },
10
- {
11
- themeId: 13, name: 'generic', colorScheme: 'carmine', text: 'Carmine', group: 'Generic',
12
- },
13
- {
14
- themeId: 14, name: 'generic', colorScheme: 'darkmoon', text: 'Dark Moon', group: 'Generic',
15
- },
16
- {
17
- themeId: 15, name: 'generic', colorScheme: 'softblue', text: 'Soft Blue', group: 'Generic',
18
- },
19
- {
20
- themeId: 16, name: 'generic', colorScheme: 'darkviolet', text: 'Dark Violet', group: 'Generic',
21
- },
22
- {
23
- themeId: 17, name: 'generic', colorScheme: 'greenmist', text: 'Green Mist', group: 'Generic',
24
- },
25
- {
26
- themeId: 9, name: 'generic', colorScheme: 'light-compact', text: 'Light', group: 'Generic Compact',
27
- },
28
- {
29
- themeId: 10, name: 'generic', colorScheme: 'dark-compact', text: 'Dark', group: 'Generic Compact',
30
- },
31
- {
32
- themeId: 18, name: 'generic', colorScheme: 'carmine-compact', text: 'Carmine', group: 'Generic Compact',
33
- },
34
- {
35
- themeId: 19, name: 'generic', colorScheme: 'darkmoon-compact', text: 'Dark Moon', group: 'Generic Compact',
36
- },
37
- {
38
- themeId: 20, name: 'generic', colorScheme: 'softblue-compact', text: 'Soft Blue', group: 'Generic Compact',
39
- },
40
- {
41
- themeId: 21, name: 'generic', colorScheme: 'darkviolet-compact', text: 'Dark Violet', group: 'Generic Compact',
42
- },
43
- {
44
- themeId: 22, name: 'generic', colorScheme: 'greenmist-compact', text: 'Green Mist', group: 'Generic Compact',
45
- },
46
- {
47
- themeId: 43, name: 'generic', colorScheme: 'contrast', text: 'Contrast', group: 'Generic',
48
- },
49
- {
50
- themeId: 44, name: 'generic', colorScheme: 'contrast-compact', text: 'Contrast Compact', group: 'Generic Compact',
51
- },
52
- {
53
- themeId: 23, name: 'material', colorScheme: 'blue-light', text: 'Blue Light', group: 'Material Design',
54
- },
55
- {
56
- themeId: 28, name: 'material', colorScheme: 'blue-dark', text: 'Blue Dark', group: 'Material Design',
57
- },
58
- {
59
- themeId: 24, name: 'material', colorScheme: 'orange-light', text: 'Orange Light', group: 'Material Design',
60
- },
61
- {
62
- themeId: 29, name: 'material', colorScheme: 'orange-dark', text: 'Orange Dark', group: 'Material Design',
63
- },
64
- {
65
- themeId: 25, name: 'material', colorScheme: 'lime-light', text: 'Lime Light', group: 'Material Design',
66
- },
67
- {
68
- themeId: 30, name: 'material', colorScheme: 'lime-dark', text: 'Lime Dark', group: 'Material Design',
69
- },
70
- {
71
- themeId: 26, name: 'material', colorScheme: 'purple-light', text: 'Purple Light', group: 'Material Design',
72
- },
73
- {
74
- themeId: 31, name: 'material', colorScheme: 'purple-dark', text: 'Purple Dark', group: 'Material Design',
75
- },
76
- {
77
- themeId: 27, name: 'material', colorScheme: 'teal-light', text: 'Teal Light', group: 'Material Design',
78
- },
79
- {
80
- themeId: 32, name: 'material', colorScheme: 'teal-dark', text: 'Teal Dark', group: 'Material Design',
81
- },
82
- {
83
- themeId: 33, name: 'material', colorScheme: 'blue-light-compact', text: 'Blue Light Compact', group: 'Material Design (Compact)',
84
- },
85
- {
86
- themeId: 34, name: 'material', colorScheme: 'blue-dark-compact', text: 'Blue Dark Compact', group: 'Material Design (Compact)',
87
- },
88
- {
89
- themeId: 35, name: 'material', colorScheme: 'orange-light-compact', text: 'Orange Light Compact', group: 'Material Design (Compact)',
90
- },
91
- {
92
- themeId: 36, name: 'material', colorScheme: 'orange-dark-compact', text: 'Orange Dark Compact', group: 'Material Design (Compact)',
93
- },
94
- {
95
- themeId: 37, name: 'material', colorScheme: 'lime-light-compact', text: 'Lime Light Compact', group: 'Material Design (Compact)',
96
- },
97
- {
98
- themeId: 38, name: 'material', colorScheme: 'lime-dark-compact', text: 'Lime Dark Compact', group: 'Material Design (Compact)',
99
- },
100
- {
101
- themeId: 39, name: 'material', colorScheme: 'purple-light-compact', text: 'Purple Light Compact', group: 'Material Design (Compact)',
102
- },
103
- {
104
- themeId: 40, name: 'material', colorScheme: 'purple-dark-compact', text: 'Purple Dark Compact', group: 'Material Design (Compact)',
105
- },
106
- {
107
- themeId: 41, name: 'material', colorScheme: 'teal-light-compact', text: 'Teal Light Compact', group: 'Material Design (Compact)',
108
- },
109
- {
110
- themeId: 42, name: 'material', colorScheme: 'teal-dark-compact', text: 'Teal Dark Compact', group: 'Material Design (Compact)',
111
- },
112
- {
113
- themeId: 51, name: 'fluent', colorScheme: 'blue-light', text: 'Blue Light', group: 'Fluent Design',
114
- },
115
- {
116
- themeId: 52, name: 'fluent', colorScheme: 'blue-dark', text: 'Blue Dark', group: 'Fluent Design',
117
- },
118
- {
119
- themeId: 53, name: 'fluent', colorScheme: 'blue-light-compact', text: 'Blue Light Compact', group: 'Fluent Design (Compact)',
120
- },
121
- {
122
- themeId: 54, name: 'fluent', colorScheme: 'blue-dark-compact', text: 'Blue Dark Compact', group: 'Fluent Design (Compact)',
123
- },
124
- {
125
- themeId: 55, name: 'fluent', colorScheme: 'saas-light', text: 'SaaS Light', group: 'Fluent Design',
126
- },
127
- {
128
- themeId: 56, name: 'fluent', colorScheme: 'saas-dark', text: 'SaaS Dark', group: 'Fluent Design',
129
- },
130
- {
131
- themeId: 57, name: 'fluent', colorScheme: 'saas-light-compact', text: 'SaaS Light Compact', group: 'Fluent Design (Compact)',
132
- },
133
- {
134
- themeId: 58, name: 'fluent', colorScheme: 'saas-dark-compact', text: 'SaaS Dark Compact', group: 'Fluent Design (Compact)',
135
- },
136
- ];
137
- exports.default = themes;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const themes = [
4
+ {
5
+ themeId: 1, name: 'generic', colorScheme: 'light', text: 'Light', group: 'Generic',
6
+ },
7
+ {
8
+ themeId: 2, name: 'generic', colorScheme: 'dark', text: 'Dark', group: 'Generic',
9
+ },
10
+ {
11
+ themeId: 13, name: 'generic', colorScheme: 'carmine', text: 'Carmine', group: 'Generic',
12
+ },
13
+ {
14
+ themeId: 14, name: 'generic', colorScheme: 'darkmoon', text: 'Dark Moon', group: 'Generic',
15
+ },
16
+ {
17
+ themeId: 15, name: 'generic', colorScheme: 'softblue', text: 'Soft Blue', group: 'Generic',
18
+ },
19
+ {
20
+ themeId: 16, name: 'generic', colorScheme: 'darkviolet', text: 'Dark Violet', group: 'Generic',
21
+ },
22
+ {
23
+ themeId: 17, name: 'generic', colorScheme: 'greenmist', text: 'Green Mist', group: 'Generic',
24
+ },
25
+ {
26
+ themeId: 9, name: 'generic', colorScheme: 'light-compact', text: 'Light', group: 'Generic Compact',
27
+ },
28
+ {
29
+ themeId: 10, name: 'generic', colorScheme: 'dark-compact', text: 'Dark', group: 'Generic Compact',
30
+ },
31
+ {
32
+ themeId: 18, name: 'generic', colorScheme: 'carmine-compact', text: 'Carmine', group: 'Generic Compact',
33
+ },
34
+ {
35
+ themeId: 19, name: 'generic', colorScheme: 'darkmoon-compact', text: 'Dark Moon', group: 'Generic Compact',
36
+ },
37
+ {
38
+ themeId: 20, name: 'generic', colorScheme: 'softblue-compact', text: 'Soft Blue', group: 'Generic Compact',
39
+ },
40
+ {
41
+ themeId: 21, name: 'generic', colorScheme: 'darkviolet-compact', text: 'Dark Violet', group: 'Generic Compact',
42
+ },
43
+ {
44
+ themeId: 22, name: 'generic', colorScheme: 'greenmist-compact', text: 'Green Mist', group: 'Generic Compact',
45
+ },
46
+ {
47
+ themeId: 43, name: 'generic', colorScheme: 'contrast', text: 'Contrast', group: 'Generic',
48
+ },
49
+ {
50
+ themeId: 44, name: 'generic', colorScheme: 'contrast-compact', text: 'Contrast Compact', group: 'Generic Compact',
51
+ },
52
+ {
53
+ themeId: 23, name: 'material', colorScheme: 'blue-light', text: 'Blue Light', group: 'Material Design',
54
+ },
55
+ {
56
+ themeId: 28, name: 'material', colorScheme: 'blue-dark', text: 'Blue Dark', group: 'Material Design',
57
+ },
58
+ {
59
+ themeId: 24, name: 'material', colorScheme: 'orange-light', text: 'Orange Light', group: 'Material Design',
60
+ },
61
+ {
62
+ themeId: 29, name: 'material', colorScheme: 'orange-dark', text: 'Orange Dark', group: 'Material Design',
63
+ },
64
+ {
65
+ themeId: 25, name: 'material', colorScheme: 'lime-light', text: 'Lime Light', group: 'Material Design',
66
+ },
67
+ {
68
+ themeId: 30, name: 'material', colorScheme: 'lime-dark', text: 'Lime Dark', group: 'Material Design',
69
+ },
70
+ {
71
+ themeId: 26, name: 'material', colorScheme: 'purple-light', text: 'Purple Light', group: 'Material Design',
72
+ },
73
+ {
74
+ themeId: 31, name: 'material', colorScheme: 'purple-dark', text: 'Purple Dark', group: 'Material Design',
75
+ },
76
+ {
77
+ themeId: 27, name: 'material', colorScheme: 'teal-light', text: 'Teal Light', group: 'Material Design',
78
+ },
79
+ {
80
+ themeId: 32, name: 'material', colorScheme: 'teal-dark', text: 'Teal Dark', group: 'Material Design',
81
+ },
82
+ {
83
+ themeId: 33, name: 'material', colorScheme: 'blue-light-compact', text: 'Blue Light Compact', group: 'Material Design (Compact)',
84
+ },
85
+ {
86
+ themeId: 34, name: 'material', colorScheme: 'blue-dark-compact', text: 'Blue Dark Compact', group: 'Material Design (Compact)',
87
+ },
88
+ {
89
+ themeId: 35, name: 'material', colorScheme: 'orange-light-compact', text: 'Orange Light Compact', group: 'Material Design (Compact)',
90
+ },
91
+ {
92
+ themeId: 36, name: 'material', colorScheme: 'orange-dark-compact', text: 'Orange Dark Compact', group: 'Material Design (Compact)',
93
+ },
94
+ {
95
+ themeId: 37, name: 'material', colorScheme: 'lime-light-compact', text: 'Lime Light Compact', group: 'Material Design (Compact)',
96
+ },
97
+ {
98
+ themeId: 38, name: 'material', colorScheme: 'lime-dark-compact', text: 'Lime Dark Compact', group: 'Material Design (Compact)',
99
+ },
100
+ {
101
+ themeId: 39, name: 'material', colorScheme: 'purple-light-compact', text: 'Purple Light Compact', group: 'Material Design (Compact)',
102
+ },
103
+ {
104
+ themeId: 40, name: 'material', colorScheme: 'purple-dark-compact', text: 'Purple Dark Compact', group: 'Material Design (Compact)',
105
+ },
106
+ {
107
+ themeId: 41, name: 'material', colorScheme: 'teal-light-compact', text: 'Teal Light Compact', group: 'Material Design (Compact)',
108
+ },
109
+ {
110
+ themeId: 42, name: 'material', colorScheme: 'teal-dark-compact', text: 'Teal Dark Compact', group: 'Material Design (Compact)',
111
+ },
112
+ {
113
+ themeId: 51, name: 'fluent', colorScheme: 'blue-light', text: 'Blue Light', group: 'Fluent Design',
114
+ },
115
+ {
116
+ themeId: 52, name: 'fluent', colorScheme: 'blue-dark', text: 'Blue Dark', group: 'Fluent Design',
117
+ },
118
+ {
119
+ themeId: 53, name: 'fluent', colorScheme: 'blue-light-compact', text: 'Blue Light Compact', group: 'Fluent Design (Compact)',
120
+ },
121
+ {
122
+ themeId: 54, name: 'fluent', colorScheme: 'blue-dark-compact', text: 'Blue Dark Compact', group: 'Fluent Design (Compact)',
123
+ },
124
+ {
125
+ themeId: 55, name: 'fluent', colorScheme: 'saas-light', text: 'SaaS Light', group: 'Fluent Design',
126
+ },
127
+ {
128
+ themeId: 56, name: 'fluent', colorScheme: 'saas-dark', text: 'SaaS Dark', group: 'Fluent Design',
129
+ },
130
+ {
131
+ themeId: 57, name: 'fluent', colorScheme: 'saas-light-compact', text: 'SaaS Light Compact', group: 'Fluent Design (Compact)',
132
+ },
133
+ {
134
+ themeId: 58, name: 'fluent', colorScheme: 'saas-dark-compact', text: 'SaaS Dark Compact', group: 'Fluent Design (Compact)',
135
+ },
136
+ ];
137
+ exports.default = themes;
@@ -1,72 +1,72 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const fs_1 = require("fs");
13
- const path_1 = require("path");
14
- const widgetListComment = '// public widgets';
15
- class WidgetsHandler {
16
- constructor(widgets, bundlePath, dependencies) {
17
- const theme = bundlePath.includes('material') ? 'material' : 'generic';
18
- this.dependencies = dependencies || {};
19
- this.widgets = widgets ? widgets.map((w) => w.toLowerCase()) : [];
20
- this.indexPath = (0, path_1.join)((0, path_1.dirname)(bundlePath), '..', 'widgets', theme, '_index.scss');
21
- }
22
- getIndexWidgetItems(indexContent) {
23
- const widgetListIndex = indexContent.indexOf(widgetListComment);
24
- const widgetRegex = /@use "\.\/(\w+)";/g;
25
- const widgetsListString = indexContent.substr(widgetListIndex + widgetListComment.length);
26
- const result = [];
27
- this.baseIndexContent = indexContent.substr(0, widgetListIndex);
28
- let match = widgetRegex.exec(widgetsListString);
29
- while (match !== null) {
30
- result.push({ widgetName: match[1].toLowerCase(), widgetImportString: match[0] });
31
- match = widgetRegex.exec(widgetsListString);
32
- }
33
- return result;
34
- }
35
- getWidgetsWithDependencies() {
36
- return this.widgets.reduce((fullWidgetsList, widget) => {
37
- const notUnique = [
38
- ...fullWidgetsList,
39
- widget,
40
- ...this.dependencies[widget] || [],
41
- ];
42
- return [...new Set(notUnique)];
43
- }, []);
44
- }
45
- getWidgetLists(allWidgets) {
46
- const userWidgets = this.getWidgetsWithDependencies();
47
- const needWidgets = allWidgets.filter((w) => userWidgets.length === 0
48
- || userWidgets.includes(w.widgetName));
49
- const widgets = needWidgets.map((w) => w.widgetName);
50
- const widgetImports = needWidgets.map((w) => w.widgetImportString);
51
- const unusedWidgets = userWidgets.filter((w) => !widgets.includes(w));
52
- const indexContent = this.baseIndexContent + widgetImports.join('\n');
53
- return {
54
- widgets,
55
- unusedWidgets,
56
- indexContent,
57
- };
58
- }
59
- getIndexContent() {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- try {
62
- const initialContent = (yield fs_1.promises.readFile(this.indexPath)).toString();
63
- const fullWidgetList = this.getIndexWidgetItems(initialContent);
64
- return this.getWidgetLists(fullWidgetList);
65
- }
66
- catch (e) {
67
- return Promise.reject(e);
68
- }
69
- });
70
- }
71
- }
72
- exports.default = WidgetsHandler;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const fs_1 = require("fs");
13
+ const path_1 = require("path");
14
+ const widgetListComment = '// public widgets';
15
+ class WidgetsHandler {
16
+ constructor(widgets, bundlePath, dependencies) {
17
+ const theme = bundlePath.includes('material') ? 'material' : 'generic';
18
+ this.dependencies = dependencies || {};
19
+ this.widgets = widgets ? widgets.map((w) => w.toLowerCase()) : [];
20
+ this.indexPath = (0, path_1.join)((0, path_1.dirname)(bundlePath), '..', 'widgets', theme, '_index.scss');
21
+ }
22
+ getIndexWidgetItems(indexContent) {
23
+ const widgetListIndex = indexContent.indexOf(widgetListComment);
24
+ const widgetRegex = /@use "\.\/(\w+)";/g;
25
+ const widgetsListString = indexContent.substr(widgetListIndex + widgetListComment.length);
26
+ const result = [];
27
+ this.baseIndexContent = indexContent.substr(0, widgetListIndex);
28
+ let match = widgetRegex.exec(widgetsListString);
29
+ while (match !== null) {
30
+ result.push({ widgetName: match[1].toLowerCase(), widgetImportString: match[0] });
31
+ match = widgetRegex.exec(widgetsListString);
32
+ }
33
+ return result;
34
+ }
35
+ getWidgetsWithDependencies() {
36
+ return this.widgets.reduce((fullWidgetsList, widget) => {
37
+ const notUnique = [
38
+ ...fullWidgetsList,
39
+ widget,
40
+ ...this.dependencies[widget] || [],
41
+ ];
42
+ return [...new Set(notUnique)];
43
+ }, []);
44
+ }
45
+ getWidgetLists(allWidgets) {
46
+ const userWidgets = this.getWidgetsWithDependencies();
47
+ const needWidgets = allWidgets.filter((w) => userWidgets.length === 0
48
+ || userWidgets.includes(w.widgetName));
49
+ const widgets = needWidgets.map((w) => w.widgetName);
50
+ const widgetImports = needWidgets.map((w) => w.widgetImportString);
51
+ const unusedWidgets = userWidgets.filter((w) => !widgets.includes(w));
52
+ const indexContent = this.baseIndexContent + widgetImports.join('\n');
53
+ return {
54
+ widgets,
55
+ unusedWidgets,
56
+ indexContent,
57
+ };
58
+ }
59
+ getIndexContent() {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ try {
62
+ const initialContent = (yield fs_1.promises.readFile(this.indexPath)).toString();
63
+ const fullWidgetList = this.getIndexWidgetItems(initialContent);
64
+ return this.getWidgetLists(fullWidgetList);
65
+ }
66
+ catch (e) {
67
+ return Promise.reject(e);
68
+ }
69
+ });
70
+ }
71
+ }
72
+ exports.default = WidgetsHandler;