@builder.io/sdk-react-native 0.0.6-3 → 0.0.6-4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-native",
3
3
  "description": "Builder.io SDK for React Native",
4
- "version": "0.0.6-3",
4
+ "version": "0.0.6-4",
5
5
  "main": "src/index.js",
6
6
  "files": [
7
7
  "src"
@@ -44,13 +44,20 @@ const sanitizeBlockStyles = (styles) => {
44
44
  }
45
45
  return acc;
46
46
  }
47
- if (typeof propertyValue === "string" && propertyValue.match(/^-?(\d*)(\.?)(\d*)*px/)) {
48
- const newValue = parseFloat(propertyValue);
49
- const normalizedValue = normalizeNumber(newValue);
50
- if (normalizedValue) {
51
- return __spreadProps(__spreadValues({}, acc), { [key]: normalizedValue });
52
- } else {
53
- return acc;
47
+ if (typeof propertyValue === "string") {
48
+ const isPixelUnit = propertyValue.match(/^-?(\d*)(\.?)(\d*)*px$/);
49
+ if (isPixelUnit) {
50
+ const newValue = parseFloat(propertyValue);
51
+ const normalizedValue = normalizeNumber(newValue);
52
+ if (normalizedValue) {
53
+ const extraUnit = propertyValue.endsWith("px") ? "px" : "";
54
+ const valueWithUnit = `${normalizedValue}${extraUnit}`;
55
+ return __spreadProps(__spreadValues({}, acc), { [key]: valueWithUnit });
56
+ } else {
57
+ return acc;
58
+ }
59
+ } else if (propertyValue === "0") {
60
+ return __spreadProps(__spreadValues({}, acc), { [key]: 0 });
54
61
  }
55
62
  }
56
63
  return __spreadProps(__spreadValues({}, acc), { [key]: propertyValue });