pds-dev-kit-web-test 0.2.13 → 0.2.14
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.
|
@@ -15,7 +15,7 @@ exports.getTextCSSPropKey = exports.parseStyleTextToCSSProp = void 0;
|
|
|
15
15
|
function parseStyleTextToCSSProp(_a) {
|
|
16
16
|
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
|
|
17
17
|
return availableSpecCodes.reduce(function (acc, currentKey) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19
19
|
var stringifiedKey = currentKey.toString();
|
|
20
20
|
var keyWithDevice = device === 'DESKTOP' ? currentKey : stringifiedKey + ":MOBILE" || currentKey;
|
|
21
21
|
var keyWithHover = keyWithDevice.toString() + ":HOVER";
|
|
@@ -36,9 +36,23 @@ function parseStyleTextToCSSProp(_a) {
|
|
|
36
36
|
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_d = {}, _d[cssPropertyKey] = getFontName(String(hoverValue)), _d))
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
if (cssPropertyKey === 'letterSpacing') {
|
|
40
|
+
var numValue = (Math.abs(+value) - 100) * (+value > 0 ? 0.01 : -0.01) + "em";
|
|
41
|
+
var numHoverValue = (Math.abs(+hoverValue) - 100) * (+hoverValue > 0 ? 0.01 : -0.01) + "em";
|
|
42
|
+
return {
|
|
43
|
+
style: __assign(__assign({}, acc.style), (_e = {}, _e[cssPropertyKey] = numValue, _e)),
|
|
44
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_f = {}, _f[cssPropertyKey] = numHoverValue, _f))
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (cssPropertyKey === 'fontSize') {
|
|
48
|
+
return {
|
|
49
|
+
style: __assign(__assign({}, acc.style), (_g = {}, _g[cssPropertyKey] = value + "px", _g)),
|
|
50
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_h = {}, _h[cssPropertyKey] = hoverValue + "px", _h))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
39
53
|
return {
|
|
40
|
-
style: __assign(__assign({}, acc.style), (
|
|
41
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
54
|
+
style: __assign(__assign({}, acc.style), (_j = {}, _j[cssPropertyKey] = value, _j)),
|
|
55
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_k = {}, _k[cssPropertyKey] = hoverValue, _k))
|
|
42
56
|
};
|
|
43
57
|
}, {
|
|
44
58
|
style: {},
|
|
@@ -20,8 +20,8 @@ function parseStylePropOpacity(namedProps, device) {
|
|
|
20
20
|
var value = specs[baseKey];
|
|
21
21
|
var hoverValue = specs[baseKey + ":HOVER"];
|
|
22
22
|
return {
|
|
23
|
-
style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = value, _a)),
|
|
24
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_b = {}, _b[cssPropertyKey] = hoverValue, _b))
|
|
23
|
+
style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = (value || 0) / 100, _a)),
|
|
24
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_b = {}, _b[cssPropertyKey] = (hoverValue || 0) / 100, _b))
|
|
25
25
|
};
|
|
26
26
|
}, {
|
|
27
27
|
style: {},
|
package/package.json
CHANGED
package/release-note.md
CHANGED