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

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-5",
5
5
  "main": "src/index.js",
6
6
  "files": [
7
7
  "src"
@@ -11,6 +11,7 @@
11
11
  "release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
12
12
  },
13
13
  "dependencies": {
14
+ "@react-native-async-storage/async-storage": "^1.17.10",
14
15
  "react-native-render-html": "^6.3.4",
15
16
  "react-native-storage": "^1.0.1",
16
17
  "react-native-video": "^5.1.1"
@@ -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 });