@vkontakte/vkui-tokens 4.20.3-dev-bfc10d.0 → 4.21.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/build/compilers/cssVars/declarations/compileBreakpointsCssVarsDeclaration.js +12 -14
- package/build/compilers/cssVars/declarations/compileBreakpointsCssVarsDeclaration.test.js +9 -9
- package/build/compilers/cssVars/helpers/accumulateValues.js +1 -1
- package/build/compilers/cssVars/helpers/getVarString.js +1 -1
- package/build/compilers/cssVars/jsUtils/compileGetDeclarationString.js +3 -6
- package/build/compilers/cssVars/jsUtils/compileGetDeclarationString.test.js +3 -3
- package/build/compilers/docs/compileDocsJSON.js +2 -2
- package/build/compilers/docs/compileDocsJSON.test.js +2 -2
- package/build/compilers/index.js +27 -27
- package/build/compilers/json/compileJSON.test.js +1 -1
- package/build/compilers/structJSON/compileStructJSON.test.js +1 -1
- package/build/compilers/styles/compileStyles.js +20 -20
- package/build/compilers/styles/compileStyles.test.js +66 -66
- package/build/compilers/styles/helpers/tokenProcessors.js +32 -32
- package/build/compilers/styles/helpers/tokenRecognition.js +1 -1
- package/build/compilers/ts/compileTypeScript.js +2 -2
- package/build/compilers/ts/compileTypeScript.test.js +1 -1
- package/build/expandTheme.js +7 -7
- package/build/expandTheme.test.js +7 -7
- package/build/helpers/capitalize.js +1 -1
- package/build/helpers/capitalize.test.js +4 -4
- package/build/helpers/convertCamelToSnake.js +1 -1
- package/build/helpers/convertCamelToSnake.test.js +6 -6
- package/build/helpers/cssHelpers.js +3 -3
- package/build/helpers/cssHelpers.test.js +4 -4
- package/build/helpers/flatifyTheme.test.js +7 -7
- package/build/helpers/getAllButColors.test.js +1 -1
- package/build/helpers/getAllButSizes.test.js +1 -1
- package/build/helpers/getGradientPointsFromColor.js +2 -2
- package/build/helpers/getGradientPointsFromColor.test.js +1 -1
- package/build/helpers/getOnlyColors.test.js +1 -1
- package/build/helpers/getStateFunctions.js +10 -10
- package/build/helpers/getStateFunctions.test.js +16 -16
- package/build/helpers/overrideOnlyNeeded.test.js +4 -4
- package/build/helpers/replacePropDeep.test.js +5 -5
- package/build/helpers/tokenHelpers.test.js +3 -3
- package/build/helpers/unCamelcasify.js +1 -1
- package/build/helpers/unCamelcasify.test.js +4 -4
- package/build/themeProcessors/createPseudoRootFromCssVars/createPseudoRootFromCssVars.test.js +6 -6
- package/build/themeProcessors/customMedia/customMedia.js +16 -12
- package/build/themeProcessors/customMedia/customMedia.test.js +9 -9
- package/build/themeProcessors/expandColors/expandColors.js +4 -4
- package/build/themeProcessors/expandColors/expandColors.test.js +7 -7
- package/build/themeProcessors/expandColors/mixColors.js +3 -3
- package/build/themeProcessors/expandColors/mixColors.test.js +5 -5
- package/build/themeProcessors/expandColors/overlayColors.js +8 -8
- package/build/themeProcessors/expandColors/overlayColors.test.js +4 -4
- package/build/themeProcessors/extractCssVarsStrict/extractCssVarsStrict.test.js +6 -6
- package/build/themeProcessors/extractGeneralTokens/extractGeneralTokens.test.js +3 -3
- package/build/themeProcessors/extractVarsNames/extractVarsNames.js +19 -15
- package/build/themeProcessors/extractVarsNames/extractVarsNames.test.js +17 -17
- package/build/themeProcessors/extractViewports/extractViewports.js +9 -5
- package/build/themeProcessors/extractViewports/extractViewports.test.js +4 -4
- package/build/themeProcessors/pixelifyValues/pixelifyValues.js +1 -1
- package/build/themeProcessors/pixelifyValues/pixelifyValues.test.js +5 -5
- package/interfaces/themes/octavius/index.d.ts +2 -0
- package/package.json +33 -7
- package/themeDescriptions/base/paradigm.js +11 -18
- package/themeDescriptions/base/vk.js +8 -15
- package/themes/octavius/cssVars/declarations/index.css +6 -0
- package/themes/octavius/cssVars/declarations/noSizes.css +6 -0
- package/themes/octavius/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octavius/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octavius/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octavius/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octavius/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octavius/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octavius/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octavius/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octavius/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octavius/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octavius/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octavius/cssVars/theme/index.js +28 -0
- package/themes/octavius/cssVars/theme/index.json +28 -0
- package/themes/octavius/docs.json +8 -0
- package/themes/octavius/index.css +6 -0
- package/themes/octavius/index.js +10 -0
- package/themes/octavius/index.json +10 -0
- package/themes/octavius/index.less +6 -0
- package/themes/octavius/index.pcss +6 -0
- package/themes/octavius/index.scss +6 -0
- package/themes/octavius/index.styl +6 -0
- package/themes/octavius/struct.json +10 -0
- package/themes/octaviusCompact/cssVars/declarations/index.css +6 -0
- package/themes/octaviusCompact/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusCompact/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusCompact/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusCompact/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusCompact/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusCompact/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusCompact/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusCompact/cssVars/theme/index.js +28 -0
- package/themes/octaviusCompact/cssVars/theme/index.json +28 -0
- package/themes/octaviusCompact/docs.json +8 -0
- package/themes/octaviusCompact/index.css +6 -0
- package/themes/octaviusCompact/index.js +10 -0
- package/themes/octaviusCompact/index.json +10 -0
- package/themes/octaviusCompact/index.less +6 -0
- package/themes/octaviusCompact/index.pcss +6 -0
- package/themes/octaviusCompact/index.scss +6 -0
- package/themes/octaviusCompact/index.styl +6 -0
- package/themes/octaviusCompact/struct.json +10 -0
- package/themes/octaviusCompactDark/cssVars/declarations/index.css +6 -0
- package/themes/octaviusCompactDark/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusCompactDark/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusCompactDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusCompactDark/cssVars/theme/index.js +28 -0
- package/themes/octaviusCompactDark/cssVars/theme/index.json +28 -0
- package/themes/octaviusCompactDark/docs.json +8 -0
- package/themes/octaviusCompactDark/index.css +6 -0
- package/themes/octaviusCompactDark/index.js +10 -0
- package/themes/octaviusCompactDark/index.json +10 -0
- package/themes/octaviusCompactDark/index.less +6 -0
- package/themes/octaviusCompactDark/index.pcss +6 -0
- package/themes/octaviusCompactDark/index.scss +6 -0
- package/themes/octaviusCompactDark/index.styl +6 -0
- package/themes/octaviusCompactDark/struct.json +10 -0
- package/themes/octaviusDark/cssVars/declarations/index.css +6 -0
- package/themes/octaviusDark/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusDark/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusDark/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusDark/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusDark/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusDark/cssVars/theme/index.js +28 -0
- package/themes/octaviusDark/cssVars/theme/index.json +28 -0
- package/themes/octaviusDark/docs.json +8 -0
- package/themes/octaviusDark/index.css +6 -0
- package/themes/octaviusDark/index.js +10 -0
- package/themes/octaviusDark/index.json +10 -0
- package/themes/octaviusDark/index.less +6 -0
- package/themes/octaviusDark/index.pcss +6 -0
- package/themes/octaviusDark/index.scss +6 -0
- package/themes/octaviusDark/index.styl +6 -0
- package/themes/octaviusDark/struct.json +10 -0
- package/themes/octaviusVK/cssVars/declarations/index.css +6 -0
- package/themes/octaviusVK/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusVK/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusVK/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusVK/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusVK/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusVK/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusVK/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusVK/cssVars/theme/index.js +28 -0
- package/themes/octaviusVK/cssVars/theme/index.json +28 -0
- package/themes/octaviusVK/docs.json +8 -0
- package/themes/octaviusVK/index.css +6 -0
- package/themes/octaviusVK/index.js +10 -0
- package/themes/octaviusVK/index.json +10 -0
- package/themes/octaviusVK/index.less +6 -0
- package/themes/octaviusVK/index.pcss +6 -0
- package/themes/octaviusVK/index.scss +6 -0
- package/themes/octaviusVK/index.styl +6 -0
- package/themes/octaviusVK/struct.json +10 -0
- package/themes/octaviusVKDark/cssVars/declarations/index.css +6 -0
- package/themes/octaviusVKDark/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusVKDark/cssVars/theme/index.js +28 -0
- package/themes/octaviusVKDark/cssVars/theme/index.json +28 -0
- package/themes/octaviusVKDark/docs.json +8 -0
- package/themes/octaviusVKDark/index.css +6 -0
- package/themes/octaviusVKDark/index.js +10 -0
- package/themes/octaviusVKDark/index.json +10 -0
- package/themes/octaviusVKDark/index.less +6 -0
- package/themes/octaviusVKDark/index.pcss +6 -0
- package/themes/octaviusVKDark/index.scss +6 -0
- package/themes/octaviusVKDark/index.styl +6 -0
- package/themes/octaviusVKDark/struct.json +10 -0
- package/themes/octaviusWhite/cssVars/declarations/index.css +6 -0
- package/themes/octaviusWhite/cssVars/declarations/noSizes.css +6 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyColors.css +6 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusWhite/cssVars/declarations/onlyVariables.css +6 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusWhite/cssVars/declarations/onlyVariablesLocal.css +6 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyVariablesLocalIncremental.css +6 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.css +6 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.less +6 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.pcss +6 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.scss +6 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.styl +6 -0
- package/themes/octaviusWhite/cssVars/theme/index.js +28 -0
- package/themes/octaviusWhite/cssVars/theme/index.json +28 -0
- package/themes/octaviusWhite/docs.json +8 -0
- package/themes/octaviusWhite/index.css +6 -0
- package/themes/octaviusWhite/index.js +10 -0
- package/themes/octaviusWhite/index.json +10 -0
- package/themes/octaviusWhite/index.less +6 -0
- package/themes/octaviusWhite/index.pcss +6 -0
- package/themes/octaviusWhite/index.scss +6 -0
- package/themes/octaviusWhite/index.styl +6 -0
- package/themes/octaviusWhite/struct.json +10 -0
- package/utils/common/fontSizes/index.js +8 -8
|
@@ -25,16 +25,16 @@ function compileBreakpointsCssVarsDeclaration(sourceTheme, type) {
|
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
var breakpoints = sourceTheme['breakpoints'];
|
|
28
|
-
var customMedia = customMedia_1.processCustomMedia(sourceTheme);
|
|
29
|
-
var theme = type === 'onlyColors' ? getOnlyColors_1.getOnlyColors(sourceTheme) : sourceTheme;
|
|
30
|
-
var adaptiveValues = accumulateValues_1.accumulateValues({
|
|
28
|
+
var customMedia = (0, customMedia_1.processCustomMedia)(sourceTheme);
|
|
29
|
+
var theme = type === 'onlyColors' ? (0, getOnlyColors_1.getOnlyColors)(sourceTheme) : sourceTheme;
|
|
30
|
+
var adaptiveValues = (0, accumulateValues_1.accumulateValues)({
|
|
31
31
|
theme: theme,
|
|
32
32
|
}).adaptiveValues;
|
|
33
33
|
var result = '';
|
|
34
34
|
if (!Object.keys(adaptiveValues.auto).length) {
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
|
-
result += common_tags_1.stripIndent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t:root {\n", "\n\t}"], ["\n\t:root {\n", "\n\t}"])), getVarString_1.getVarString({ valuesObject: adaptiveValues.auto, prefix: '\t\t' }));
|
|
37
|
+
result += (0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t:root {\n", "\n\t}"], ["\n\t:root {\n", "\n\t}"])), (0, getVarString_1.getVarString)({ valuesObject: adaptiveValues.auto, prefix: '\t\t' }));
|
|
38
38
|
var adaptivityStatesLength = Object.keys(adaptiveValues).length;
|
|
39
39
|
// только regular и auto
|
|
40
40
|
if (adaptivityStatesLength === 2) {
|
|
@@ -53,33 +53,31 @@ function compileBreakpointsCssVarsDeclaration(sourceTheme, type) {
|
|
|
53
53
|
if (adaptivityState === 'auto') {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
var usedViewport = findViewportByAdaptivityState_1.findViewportByAdaptivityState(breakpoints, adaptivityState);
|
|
57
|
-
mediaValues += common_tags_1.stripIndent(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\t@media ", " {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t"], ["\n\t\t\t@media ", " {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t",
|
|
58
|
-
"\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-", " {\n\t\t\t\t",
|
|
59
|
-
"\n\t\t\t}\n\t\t\t"])), customMedia["width" + capitalize_1.capitalize(usedViewport)], common_tags_1.stripIndents(isRegular
|
|
56
|
+
var usedViewport = (0, findViewportByAdaptivityState_1.findViewportByAdaptivityState)(breakpoints, adaptivityState);
|
|
57
|
+
mediaValues += (0, common_tags_1.stripIndent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\t@media ", " {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t"], ["\n\t\t\t@media ", " {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t", "\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t"])), customMedia["width".concat((0, capitalize_1.capitalize)(usedViewport))], (0, common_tags_1.stripIndents)(isRegular
|
|
60
58
|
? regularValues
|
|
61
|
-
: getVarString_1.getVarString({
|
|
59
|
+
: (0, getVarString_1.getVarString)({
|
|
62
60
|
valuesObject: valuesObject,
|
|
63
61
|
prefix: '',
|
|
64
62
|
callback: function (name) {
|
|
65
63
|
if (isRegular) {
|
|
66
64
|
return;
|
|
67
65
|
}
|
|
68
|
-
var regularName = name.replace(new RegExp(adaptivityState
|
|
66
|
+
var regularName = name.replace(new RegExp("".concat(adaptivityState, "$")), 'regular');
|
|
69
67
|
var regularValue = adaptiveValues.regular[regularName];
|
|
70
68
|
if (regularValue) {
|
|
71
|
-
regularValues += regularName
|
|
69
|
+
regularValues += "".concat(regularName, ": ").concat(regularValue, ";\n");
|
|
72
70
|
}
|
|
73
71
|
},
|
|
74
|
-
})), convertCamelToSnake_1.convertCamelToSnake(usedViewport), common_tags_1.stripIndents(isRegular
|
|
72
|
+
})), (0, convertCamelToSnake_1.convertCamelToSnake)(usedViewport), (0, common_tags_1.stripIndents)(isRegular
|
|
75
73
|
? regularValues
|
|
76
|
-
: getVarString_1.getVarString({
|
|
74
|
+
: (0, getVarString_1.getVarString)({
|
|
77
75
|
valuesObject: valuesObject,
|
|
78
76
|
prefix: '',
|
|
79
77
|
})));
|
|
80
78
|
mediaValues += '\n\n';
|
|
81
79
|
});
|
|
82
|
-
return common_tags_1.stripIndent(result
|
|
80
|
+
return (0, common_tags_1.stripIndent)("".concat(result, "\n\n").concat(mediaValues));
|
|
83
81
|
}
|
|
84
82
|
exports.compileBreakpointsCssVarsDeclaration = compileBreakpointsCssVarsDeclaration;
|
|
85
83
|
var templateObject_1, templateObject_2;
|
|
@@ -9,7 +9,7 @@ var compileBreakpointsCssVarsDeclaration_1 = require("./compileBreakpointsCssVar
|
|
|
9
9
|
describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
10
10
|
it('should not work without breakpoints', function () {
|
|
11
11
|
var theme = {};
|
|
12
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme)).toBe(null);
|
|
12
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme)).toBe(null);
|
|
13
13
|
});
|
|
14
14
|
it('should work with breakpoints and empty vals', function () {
|
|
15
15
|
var theme = {
|
|
@@ -24,7 +24,7 @@ describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme)).toBe(null);
|
|
27
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme)).toBe(null);
|
|
28
28
|
});
|
|
29
29
|
it('should work with non adaptive values', function () {
|
|
30
30
|
var theme = {
|
|
@@ -44,7 +44,7 @@ describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
|
44
44
|
originalValue: '4px',
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme)).toBe(null);
|
|
47
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme)).toBe(null);
|
|
48
48
|
});
|
|
49
49
|
it('should work with flat adaptive values and several breakpotins', function () {
|
|
50
50
|
var theme = {
|
|
@@ -75,8 +75,8 @@ describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme))
|
|
79
|
-
.toBe(common_tags_1.stripIndent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\t\t\t"]))));
|
|
78
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme))
|
|
79
|
+
.toBe((0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--size_popup_base_padding: var(--vkui--size_popup_base_padding--regular);\n\t\t\t}\n\t\t\t"]))));
|
|
80
80
|
});
|
|
81
81
|
it('should work with flat adaptive values and several breakpotins and without overriding', function () {
|
|
82
82
|
var theme = {
|
|
@@ -102,8 +102,8 @@ describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
};
|
|
105
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme))
|
|
106
|
-
.toBe(common_tags_1.stripIndent(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: 20px;\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: 20px;\n\t\t\t}\n\t\t\t"]))));
|
|
105
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme))
|
|
106
|
+
.toBe((0, common_tags_1.stripIndent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: 20px;\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--size_popup_base_padding: 20px;\n\t\t\t}\n\t\t\t"]))));
|
|
107
107
|
});
|
|
108
108
|
it('should work with adaptive complex object', function () {
|
|
109
109
|
var theme = {
|
|
@@ -149,8 +149,8 @@ describe('compileBreakpointsCssVarsDeclaration', function () {
|
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
151
|
};
|
|
152
|
-
expect(compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme))
|
|
153
|
-
.toBe(common_tags_1.stripIndent(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t--vkui--font_h1--line_height: var(--vkui--font_h1--line_height--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t--vkui--font_h1--line_height: var(--vkui--font_h1--line_height--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t}\n\t\t\t"]))));
|
|
152
|
+
expect((0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme))
|
|
153
|
+
.toBe((0, common_tags_1.stripIndent)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\t\t\t:root {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t--vkui--font_h1--line_height: var(--vkui--font_h1--line_height--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t}\n\t\t\t"], ["\n\t\t\t:root {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t--vkui--font_h1--line_height: var(--vkui--font_h1--line_height--regular);\n\t\t\t}\n\n\t\t\t@media (max-width: 767px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-touch {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--compact);\n\t\t\t}\n\n\t\t\t@media (min-width: 768px) {\n\t\t\t\t:root, .vkui--force-auto {\n\t\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.vkui--force-desktop_s {\n\t\t\t\t--vkui--font_h1--font_size: var(--vkui--font_h1--font_size--regular);\n\t\t\t}\n\t\t\t"]))));
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -21,7 +21,7 @@ var constructSourceVal = function (_a) {
|
|
|
21
21
|
var destination = _a.destination, value = _a.value, autoValue = _a.autoValue, singleBreakpoint = _a.singleBreakpoint;
|
|
22
22
|
if (autoValue && 'name' in autoValue) {
|
|
23
23
|
destination[autoValue.name] = !singleBreakpoint
|
|
24
|
-
? "var("
|
|
24
|
+
? "var(".concat(value.name, ")")
|
|
25
25
|
: value.originalValue;
|
|
26
26
|
}
|
|
27
27
|
else if (value.originalValue !== undefined) {
|
|
@@ -7,7 +7,7 @@ var getVarString = function (_a) {
|
|
|
7
7
|
.map(function (_a) {
|
|
8
8
|
var name = _a[0], value = _a[1];
|
|
9
9
|
callback === null || callback === void 0 ? void 0 : callback(name, value);
|
|
10
|
-
return ""
|
|
10
|
+
return "".concat(prefix).concat(name, ": ").concat(value, ";");
|
|
11
11
|
})
|
|
12
12
|
.join(delimeter);
|
|
13
13
|
};
|
|
@@ -11,14 +11,11 @@ var getVarString_1 = require("../helpers/getVarString");
|
|
|
11
11
|
var getOnlyColors_1 = require("../../../helpers/getOnlyColors");
|
|
12
12
|
function compileGetDeclarationString(sourceTheme, type) {
|
|
13
13
|
if (type === void 0) { type = 'default'; }
|
|
14
|
-
var theme = type === 'onlyColors' ? getOnlyColors_1.getOnlyColors(sourceTheme) : sourceTheme;
|
|
15
|
-
var flatValues = accumulateValues_1.accumulateValues({
|
|
14
|
+
var theme = type === 'onlyColors' ? (0, getOnlyColors_1.getOnlyColors)(sourceTheme) : sourceTheme;
|
|
15
|
+
var flatValues = (0, accumulateValues_1.accumulateValues)({
|
|
16
16
|
theme: theme,
|
|
17
17
|
}).flatValues;
|
|
18
|
-
return common_tags_1.stripIndent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\timport {Properties} from 'csstype';\n\n\texport function getDeclarationVar", "String(): string {\n\t\treturn `", "`;\n\t}\n\n\texport function getDeclarationVar", "Object(): Properties {\n\t\treturn ", " as Properties;\n\t}\n\t"], ["\n\timport {Properties} from 'csstype';\n\n\texport function getDeclarationVar",
|
|
19
|
-
"String(): string {\n\t\treturn \\`",
|
|
20
|
-
"\\`;\n\t}\n\n\texport function getDeclarationVar",
|
|
21
|
-
"Object(): Properties {\n\t\treturn ", " as Properties;\n\t}\n\t"])), type === 'onlyColors' ? 'Colors' : '', getVarString_1.getVarString({
|
|
18
|
+
return (0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\timport {Properties} from 'csstype';\n\n\texport function getDeclarationVar", "String(): string {\n\t\treturn `", "`;\n\t}\n\n\texport function getDeclarationVar", "Object(): Properties {\n\t\treturn ", " as Properties;\n\t}\n\t"], ["\n\timport {Properties} from 'csstype';\n\n\texport function getDeclarationVar", "String(): string {\n\t\treturn \\`", "\\`;\n\t}\n\n\texport function getDeclarationVar", "Object(): Properties {\n\t\treturn ", " as Properties;\n\t}\n\t"])), type === 'onlyColors' ? 'Colors' : '', (0, getVarString_1.getVarString)({
|
|
22
19
|
valuesObject: flatValues,
|
|
23
20
|
prefix: '',
|
|
24
21
|
delimeter: '',
|
|
@@ -9,7 +9,7 @@ var compileGetDeclarationString_1 = require("./compileGetDeclarationString");
|
|
|
9
9
|
describe('compileGetDeclarationString', function () {
|
|
10
10
|
it('should work with empty', function () {
|
|
11
11
|
var theme = {};
|
|
12
|
-
expect(compileGetDeclarationString_1.compileGetDeclarationString(theme)).toBe(common_tags_1.stripIndent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn ``;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn \\`\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
12
|
+
expect((0, compileGetDeclarationString_1.compileGetDeclarationString)(theme)).toBe((0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn ``;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn \\`\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
13
13
|
});
|
|
14
14
|
it('should work with any values', function () {
|
|
15
15
|
var theme = {
|
|
@@ -52,7 +52,7 @@ describe('compileGetDeclarationString', function () {
|
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
-
expect(compileGetDeclarationString_1.compileGetDeclarationString(theme)).toBe(common_tags_1.stripIndent(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn `--paradigm--x1: 4px;--vkui--size_popup_base_padding--compact: 16px;--vkui--size_popup_base_padding--regular: 20px;--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {\"--paradigm--x1\":\"4px\",\"--vkui--size_popup_base_padding--compact\":\"16px\",\"--vkui--size_popup_base_padding--regular\":\"20px\",\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn \\`--paradigm--x1: 4px;--vkui--size_popup_base_padding--compact: 16px;--vkui--size_popup_base_padding--regular: 20px;--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {\"--paradigm--x1\":\"4px\",\"--vkui--size_popup_base_padding--compact\":\"16px\",\"--vkui--size_popup_base_padding--regular\":\"20px\",\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
55
|
+
expect((0, compileGetDeclarationString_1.compileGetDeclarationString)(theme)).toBe((0, common_tags_1.stripIndent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn `--paradigm--x1: 4px;--vkui--size_popup_base_padding--compact: 16px;--vkui--size_popup_base_padding--regular: 20px;--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {\"--paradigm--x1\":\"4px\",\"--vkui--size_popup_base_padding--compact\":\"16px\",\"--vkui--size_popup_base_padding--regular\":\"20px\",\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarString(): string {\n\t\t\t\treturn \\`--paradigm--x1: 4px;--vkui--size_popup_base_padding--compact: 16px;--vkui--size_popup_base_padding--regular: 20px;--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarObject(): Properties {\n\t\t\t\treturn {\"--paradigm--x1\":\"4px\",\"--vkui--size_popup_base_padding--compact\":\"16px\",\"--vkui--size_popup_base_padding--regular\":\"20px\",\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
56
56
|
});
|
|
57
57
|
it('should work onlyColorsMode', function () {
|
|
58
58
|
var theme = {
|
|
@@ -95,7 +95,7 @@ describe('compileGetDeclarationString', function () {
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
|
-
expect(compileGetDeclarationString_1.compileGetDeclarationString(theme, 'onlyColors')).toBe(common_tags_1.stripIndent(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarColorsString(): string {\n\t\t\t\treturn `--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarColorsObject(): Properties {\n\t\t\t\treturn {\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarColorsString(): string {\n\t\t\t\treturn \\`--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarColorsObject(): Properties {\n\t\t\t\treturn {\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
98
|
+
expect((0, compileGetDeclarationString_1.compileGetDeclarationString)(theme, 'onlyColors')).toBe((0, common_tags_1.stripIndent)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarColorsString(): string {\n\t\t\t\treturn `--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarColorsObject(): Properties {\n\t\t\t\treturn {\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"], ["\n\t\t\timport {Properties} from 'csstype';\n\n\t\t\texport function getDeclarationVarColorsString(): string {\n\t\t\t\treturn \\`--vkui--color_text_accent: white;--vkui--color_text_accent--hover: black;--vkui--color_text_accent--active: red;\\`;\n\t\t\t}\n\n\t\t\texport function getDeclarationVarColorsObject(): Properties {\n\t\t\t\treturn {\"--vkui--color_text_accent\":\"white\",\"--vkui--color_text_accent--hover\":\"black\",\"--vkui--color_text_accent--active\":\"red\"} as Properties;\n\t\t\t}\n\t\t\t"]))));
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -112,8 +112,8 @@ exports.getTypeDocs = getTypeDocs;
|
|
|
112
112
|
* - export { BaseTheme as MyTheme } from 'path/to/baseTheme.ts'
|
|
113
113
|
*/
|
|
114
114
|
function compileDocsJSON(theme) {
|
|
115
|
-
var themeFilePath = path_1.default.resolve("src/interfaces/themes/"
|
|
116
|
-
var themeInterfaceName = "Theme"
|
|
115
|
+
var themeFilePath = path_1.default.resolve("src/interfaces/themes/".concat(theme.themeName, "/index.ts"));
|
|
116
|
+
var themeInterfaceName = "Theme".concat((0, capitalize_1.capitalize)(theme.themeName));
|
|
117
117
|
var docs = getTypeDocs(themeFilePath, themeInterfaceName);
|
|
118
118
|
return JSON.stringify(docs, null, ' ');
|
|
119
119
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var compileDocsJSON_1 = require("./compileDocsJSON");
|
|
4
4
|
describe('compileDocsJSON', function () {
|
|
5
5
|
it('should correct compile documentation with reexported interface', function () {
|
|
6
|
-
var docs = compileDocsJSON_1.getTypeDocs('src/build/compilers/docs/__test__/testRecursiveReexport.ts', 'BaseTheme');
|
|
6
|
+
var docs = (0, compileDocsJSON_1.getTypeDocs)('src/build/compilers/docs/__test__/testRecursiveReexport.ts', 'BaseTheme');
|
|
7
7
|
expect(docs).toEqual({
|
|
8
8
|
importedBaseProp: {
|
|
9
9
|
desc: 'Short desc tag',
|
|
@@ -12,7 +12,7 @@ describe('compileDocsJSON', function () {
|
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
14
|
it('should correct compile documentation with imports', function () {
|
|
15
|
-
var docs = compileDocsJSON_1.getTypeDocs('src/build/compilers/docs/__test__/testTheme.ts', 'ThemeTest');
|
|
15
|
+
var docs = (0, compileDocsJSON_1.getTypeDocs)('src/build/compilers/docs/__test__/testTheme.ts', 'ThemeTest');
|
|
16
16
|
expect(docs).toEqual({
|
|
17
17
|
prop: {
|
|
18
18
|
desc: '',
|
package/build/compilers/index.js
CHANGED
|
@@ -31,18 +31,18 @@ function writeStructJsonFile(themePath, theme, _) {
|
|
|
31
31
|
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043D\u044B\u0439 json...");
|
|
32
32
|
var fileName = "struct.json";
|
|
33
33
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
34
|
-
var content = compileStructJSON_1.compileStructJSON(theme);
|
|
34
|
+
var content = (0, compileStructJSON_1.compileStructJSON)(theme);
|
|
35
35
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
36
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
36
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
37
37
|
}
|
|
38
38
|
exports.writeStructJsonFile = writeStructJsonFile;
|
|
39
39
|
function writeJsonFile(themePath, theme, _) {
|
|
40
40
|
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C json...");
|
|
41
41
|
var fileName = "index.json";
|
|
42
42
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
43
|
-
var content = compileJSON_1.compileJSON(theme);
|
|
43
|
+
var content = (0, compileJSON_1.compileJSON)(theme);
|
|
44
44
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
45
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
45
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
46
46
|
}
|
|
47
47
|
exports.writeJsonFile = writeJsonFile;
|
|
48
48
|
function writeTsFile(themePath, theme, type, themeName) {
|
|
@@ -50,42 +50,42 @@ function writeTsFile(themePath, theme, type, themeName) {
|
|
|
50
50
|
var fileName = "index.ts";
|
|
51
51
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
52
52
|
var content = null;
|
|
53
|
-
var sourceContent = compileTypeScript_1.compileTypeScript(theme);
|
|
53
|
+
var sourceContent = (0, compileTypeScript_1.compileTypeScript)(theme);
|
|
54
54
|
switch (type) {
|
|
55
55
|
case 'flat':
|
|
56
56
|
content = sourceContent
|
|
57
|
-
.replace(/\$\$InterfaceName\$\$/g, "Theme"
|
|
58
|
-
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/"
|
|
57
|
+
.replace(/\$\$InterfaceName\$\$/g, "Theme".concat((0, capitalize_1.capitalize)(theme.themeName), "Flat"))
|
|
58
|
+
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/".concat(theme.themeName));
|
|
59
59
|
break;
|
|
60
60
|
case 'subtheme':
|
|
61
61
|
content = sourceContent
|
|
62
|
-
.replace(/\$\$InterfaceName\$\$/g, "SubTheme"
|
|
63
|
-
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/"
|
|
62
|
+
.replace(/\$\$InterfaceName\$\$/g, "SubTheme".concat((0, capitalize_1.capitalize)(theme.parentThemeName)))
|
|
63
|
+
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/".concat(theme.parentThemeName, "/subthemes"));
|
|
64
64
|
break;
|
|
65
65
|
case 'cssVars':
|
|
66
66
|
content = sourceContent
|
|
67
|
-
.replace(/\$\$InterfaceName\$\$/g, "Theme"
|
|
68
|
-
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/"
|
|
67
|
+
.replace(/\$\$InterfaceName\$\$/g, "Theme".concat((0, capitalize_1.capitalize)(themeName), "CssVars"))
|
|
68
|
+
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/".concat(themeName));
|
|
69
69
|
break;
|
|
70
70
|
case 'root':
|
|
71
71
|
default:
|
|
72
72
|
content = sourceContent
|
|
73
|
-
.replace(/\$\$InterfaceName\$\$/g, "Theme"
|
|
74
|
-
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/"
|
|
73
|
+
.replace(/\$\$InterfaceName\$\$/g, "Theme".concat((0, capitalize_1.capitalize)(theme.themeName)))
|
|
74
|
+
.replace(/\$\$InterfaceURL\$\$/g, "@/interfaces/themes/".concat(theme.themeName));
|
|
75
75
|
}
|
|
76
76
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
77
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
77
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
78
78
|
}
|
|
79
79
|
exports.writeTsFile = writeTsFile;
|
|
80
80
|
function writeStyleFiles(themePath, theme) {
|
|
81
81
|
var a = ['css', 'less', 'styl', 'scss', 'pcss'];
|
|
82
82
|
a.forEach(function (format) {
|
|
83
|
-
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C "
|
|
84
|
-
var fileName = "index."
|
|
83
|
+
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C ".concat(format, "..."));
|
|
84
|
+
var fileName = "index.".concat(format);
|
|
85
85
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
86
|
-
var content = compileStyles_1.compileStyles(format, theme);
|
|
86
|
+
var content = (0, compileStyles_1.compileStyles)(format, theme);
|
|
87
87
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
88
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
88
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
exports.writeStyleFiles = writeStyleFiles;
|
|
@@ -95,11 +95,11 @@ function writeCssVarsSourceFile(themePath, theme, cssVarsTheme, themeBase) {
|
|
|
95
95
|
for (var _i = 0, cssModes_1 = cssModes; _i < cssModes_1.length; _i++) {
|
|
96
96
|
var modeConfig = cssModes_1[_i];
|
|
97
97
|
var filePath = path_1.default.resolve(themePath, modeConfig.fileName);
|
|
98
|
-
var compiledVars = compileStyles_1.compileStyles('css', theme, modeConfig.mode === 'default'
|
|
98
|
+
var compiledVars = (0, compileStyles_1.compileStyles)('css', theme, modeConfig.mode === 'default'
|
|
99
99
|
? 'withAdaptiveGroups'
|
|
100
100
|
: modeConfig.mode, themeBase);
|
|
101
101
|
var compiledBreakpoints = modeConfig.mode === 'default'
|
|
102
|
-
? "\n\n"
|
|
102
|
+
? "\n\n".concat((_a = (0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(cssVarsTheme)) !== null && _a !== void 0 ? _a : '')
|
|
103
103
|
: '';
|
|
104
104
|
if (compiledBreakpoints.includes('null')) {
|
|
105
105
|
console.error(modeConfig);
|
|
@@ -107,7 +107,7 @@ function writeCssVarsSourceFile(themePath, theme, cssVarsTheme, themeBase) {
|
|
|
107
107
|
}
|
|
108
108
|
var content = compiledVars + compiledBreakpoints;
|
|
109
109
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
110
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
110
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(modeConfig.fileName));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
exports.writeCssVarsSourceFile = writeCssVarsSourceFile;
|
|
@@ -115,10 +115,10 @@ function writeCssVarsSourceMediaFile(themePath, theme) {
|
|
|
115
115
|
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C \u043C\u0435\u0434\u0438\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u0434\u043B\u044F css vars \u0442\u0435\u043C...");
|
|
116
116
|
var fileName = 'onlyMedia.css';
|
|
117
117
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
118
|
-
var content = compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(theme);
|
|
118
|
+
var content = (0, compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration)(theme);
|
|
119
119
|
if (content !== null) {
|
|
120
120
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
121
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
121
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
exports.writeCssVarsSourceMediaFile = writeCssVarsSourceMediaFile;
|
|
@@ -130,9 +130,9 @@ function writeCssVarsJsUtils(themePath, theme) {
|
|
|
130
130
|
].forEach(function (_a) {
|
|
131
131
|
var mode = _a.mode, fileName = _a.fileName;
|
|
132
132
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
133
|
-
var content = compileGetDeclarationString_1.compileGetDeclarationString(theme, mode);
|
|
133
|
+
var content = (0, compileGetDeclarationString_1.compileGetDeclarationString)(theme, mode);
|
|
134
134
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
135
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
135
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
exports.writeCssVarsJsUtils = writeCssVarsJsUtils;
|
|
@@ -140,8 +140,8 @@ function writeDocsFiles(themePath, theme) {
|
|
|
140
140
|
console.log("\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u043C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044E...");
|
|
141
141
|
var fileName = "docs.json";
|
|
142
142
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
143
|
-
var content = compileDocsJSON_1.compileDocsJSON(theme);
|
|
143
|
+
var content = (0, compileDocsJSON_1.compileDocsJSON)(theme);
|
|
144
144
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
145
|
-
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B "
|
|
145
|
+
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B ".concat(fileName));
|
|
146
146
|
}
|
|
147
147
|
exports.writeDocsFiles = writeDocsFiles;
|
|
@@ -9,6 +9,6 @@ describe('compileJSON', function () {
|
|
|
9
9
|
},
|
|
10
10
|
toneValueHover: 0.04,
|
|
11
11
|
};
|
|
12
|
-
expect(compileJSON_1.compileJSON(testData)).toBe('{\n\t"colorState": {\n\t\t"normal": "#00103D"\n\t},\n\t"toneValueHover": 0.04\n}');
|
|
12
|
+
expect((0, compileJSON_1.compileJSON)(testData)).toBe('{\n\t"colorState": {\n\t\t"normal": "#00103D"\n\t},\n\t"toneValueHover": 0.04\n}');
|
|
13
13
|
});
|
|
14
14
|
});
|
|
@@ -8,6 +8,6 @@ describe('compileJSON', function () {
|
|
|
8
8
|
colorsScheme: 'scheme',
|
|
9
9
|
randomToken: 123,
|
|
10
10
|
};
|
|
11
|
-
expect(compileStructJSON_1.compileStructJSON(testData)).toBe("{\n\t\"color\": {\n\t\t\"colorA\": \"#fff\"\n\t},\n\t\"colorsScheme\": {\n\t\t\"colorsScheme\": \"scheme\"\n\t},\n\t\"other\": {\n\t\t\"randomToken\": 123\n\t}\n}");
|
|
11
|
+
expect((0, compileStructJSON_1.compileStructJSON)(testData)).toBe("{\n\t\"color\": {\n\t\t\"colorA\": \"#fff\"\n\t},\n\t\"colorsScheme\": {\n\t\t\"colorsScheme\": \"scheme\"\n\t},\n\t\"other\": {\n\t\t\"randomToken\": 123\n\t}\n}");
|
|
12
12
|
});
|
|
13
13
|
});
|
|
@@ -19,7 +19,7 @@ function isClassicCssType(format) {
|
|
|
19
19
|
return format === tokenProcessors_1.EStyleTypes.CSS || format === tokenProcessors_1.EStyleTypes.PCSS;
|
|
20
20
|
}
|
|
21
21
|
function getPrefix(format, theme) {
|
|
22
|
-
var prefix = theme.prefix ? theme.prefix
|
|
22
|
+
var prefix = theme.prefix ? "".concat(theme.prefix, "-") : '';
|
|
23
23
|
if (isClassicCssType(format) && prefix) {
|
|
24
24
|
prefix += '-';
|
|
25
25
|
}
|
|
@@ -46,12 +46,12 @@ function getRootSelector(theme, mode) {
|
|
|
46
46
|
if (!isLocal(mode)) {
|
|
47
47
|
return ':root';
|
|
48
48
|
}
|
|
49
|
-
return "."
|
|
49
|
+
return ".".concat(getPrefix(tokenProcessors_1.EStyleTypes.CSS, theme)).concat(getThemeNameBase(theme), "--").concat(theme.colorsScheme);
|
|
50
50
|
}
|
|
51
51
|
exports.getRootSelector = getRootSelector;
|
|
52
52
|
function isDeepEqual(actual, expected) {
|
|
53
53
|
try {
|
|
54
|
-
assert_1.deepStrictEqual(actual, expected);
|
|
54
|
+
(0, assert_1.deepStrictEqual)(actual, expected);
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
catch (_) {
|
|
@@ -75,13 +75,13 @@ var compileStyles = function (format, theme, mode, themeBase) {
|
|
|
75
75
|
var groupTokens = '';
|
|
76
76
|
switch (mode) {
|
|
77
77
|
case 'onlyColors':
|
|
78
|
-
theme = getOnlyColors_1.getOnlyColors(theme);
|
|
78
|
+
theme = (0, getOnlyColors_1.getOnlyColors)(theme);
|
|
79
79
|
break;
|
|
80
80
|
case 'noSizes':
|
|
81
|
-
theme = getAllButSizes_1.getAllButSizes(theme, theme.themeNameBase);
|
|
81
|
+
theme = (0, getAllButSizes_1.getAllButSizes)(theme, theme.themeNameBase);
|
|
82
82
|
break;
|
|
83
83
|
case 'noColors':
|
|
84
|
-
theme = getAllButColors_1.getAllButColors(theme, theme.themeNameBase);
|
|
84
|
+
theme = (0, getAllButColors_1.getAllButColors)(theme, theme.themeNameBase);
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
Object.keys(theme).forEach(function (key) {
|
|
@@ -95,22 +95,22 @@ var compileStyles = function (format, theme, mode, themeBase) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
// если переменная — строка (например, имя темы)
|
|
98
|
-
if (tokenRecognition_1.isString(token, key)) {
|
|
99
|
-
variables += getVariableStatement(getDeclaration(key, prefix), "'"
|
|
98
|
+
if ((0, tokenRecognition_1.isString)(token, key)) {
|
|
99
|
+
variables += getVariableStatement(getDeclaration(key, prefix), "'".concat(CSS.escape(token), "'"));
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
// если переменная — цвет
|
|
103
|
-
if (tokenRecognition_1.isColor(token)) {
|
|
103
|
+
if ((0, tokenRecognition_1.isColor)(token)) {
|
|
104
104
|
Object.keys(token).forEach(function (colorState) {
|
|
105
105
|
var value = token[colorState];
|
|
106
|
-
variables += getVariableStatement(getDeclaration(key, prefix), value, colorState !== 'normal' ? "--"
|
|
106
|
+
variables += getVariableStatement(getDeclaration(key, prefix), value, colorState !== 'normal' ? "--".concat(colorState) : '');
|
|
107
107
|
});
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
// если переменная — это объект (группа значений)
|
|
111
111
|
// например — шрифты
|
|
112
|
-
if (tokenRecognition_1.isGroupToken(token)) {
|
|
113
|
-
var groupTokenResult = tokenProcessors_1.processGroupToken({
|
|
112
|
+
if ((0, tokenRecognition_1.isGroupToken)(token)) {
|
|
113
|
+
var groupTokenResult = (0, tokenProcessors_1.processGroupToken)({
|
|
114
114
|
format: format,
|
|
115
115
|
prefix: prefix,
|
|
116
116
|
token: token,
|
|
@@ -121,14 +121,14 @@ var compileStyles = function (format, theme, mode, themeBase) {
|
|
|
121
121
|
groupTokens += groupTokenResult.groupTokens;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (tokenRecognition_1.isAdaptiveFlatToken(token)) {
|
|
124
|
+
if ((0, tokenRecognition_1.isAdaptiveFlatToken)(token)) {
|
|
125
125
|
Object.keys(token).forEach(function (adaptivivityState) {
|
|
126
126
|
var value = token[adaptivivityState];
|
|
127
|
-
variables += getVariableStatement(getDeclaration(key, prefix), value, "--"
|
|
127
|
+
variables += getVariableStatement(getDeclaration(key, prefix), value, "--".concat((0, unCamelcasify_1.unCamelcasify)(adaptivivityState, classicCssType ? '_' : '-')));
|
|
128
128
|
});
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
if (tokenRecognition_1.isCustomMediaToken(key)) {
|
|
131
|
+
if ((0, tokenRecognition_1.isCustomMediaToken)(key)) {
|
|
132
132
|
if (getCustomMediaDeclaration) {
|
|
133
133
|
groupTokens += getCustomMediaDeclaration(key, token);
|
|
134
134
|
}
|
|
@@ -139,16 +139,16 @@ var compileStyles = function (format, theme, mode, themeBase) {
|
|
|
139
139
|
});
|
|
140
140
|
result = variables;
|
|
141
141
|
if (classicCssType && variables) {
|
|
142
|
-
result = common_tags_1.stripIndent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t", " {\n\t\t", "}\n\t\t"], ["\n\t\t", " {\n\t\t", "}\n\t\t"])), rootSelector, variables.split('\n').join('\n\t\t'));
|
|
142
|
+
result = (0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t", " {\n\t\t", "}\n\t\t"], ["\n\t\t", " {\n\t\t", "}\n\t\t"])), rootSelector, variables.split('\n').join('\n\t\t'));
|
|
143
143
|
}
|
|
144
144
|
if (isOnlyVariables(mode)) {
|
|
145
|
-
return common_tags_1.stripIndent(result);
|
|
145
|
+
return (0, common_tags_1.stripIndent)(result);
|
|
146
146
|
}
|
|
147
147
|
if (mode === 'onlyAdaptiveGroups') {
|
|
148
|
-
return common_tags_1.stripIndent(groupTokens);
|
|
148
|
+
return (0, common_tags_1.stripIndent)(groupTokens);
|
|
149
149
|
}
|
|
150
|
-
result += "\n\n"
|
|
151
|
-
return common_tags_1.stripIndent(result);
|
|
150
|
+
result += "\n\n".concat(groupTokens);
|
|
151
|
+
return (0, common_tags_1.stripIndent)(result);
|
|
152
152
|
};
|
|
153
153
|
exports.compileStyles = compileStyles;
|
|
154
154
|
var templateObject_1;
|