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

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-5",
4
+ "version": "0.0.8",
5
5
  "main": "src/index.js",
6
6
  "files": [
7
7
  "src"
@@ -17,11 +17,9 @@
17
17
  "react-native-video": "^5.1.1"
18
18
  },
19
19
  "peerDependencies": {
20
- "@react-native-async-storage/async-storage": "^1.17.10",
21
20
  "react-native": "^0.64.3"
22
21
  },
23
22
  "devDependencies": {
24
- "@react-native-async-storage/async-storage": "^1.17.10",
25
23
  "@types/react-native-video": "^5.0.9",
26
24
  "react-native": "^0.64.3"
27
25
  }
@@ -22,7 +22,8 @@ import {
22
22
  getContentVariationCookie,
23
23
  setContentVariationCookie
24
24
  } from "../../helpers/ab-tests.js";
25
- const checkIsBuilderContentWithVariations = (item) => !item.id || !item.variations || Object.keys(item.variations).length === 0;
25
+ import { checkIsDefined } from "../../helpers/nullable.js";
26
+ const checkIsBuilderContentWithVariations = (item) => checkIsDefined(item.id) && checkIsDefined(item.variations) && Object.keys(item.variations).length > 0;
26
27
  const getRandomVariationId = ({
27
28
  id,
28
29
  variations
@@ -50,9 +50,7 @@ const sanitizeBlockStyles = (styles) => {
50
50
  const newValue = parseFloat(propertyValue);
51
51
  const normalizedValue = normalizeNumber(newValue);
52
52
  if (normalizedValue) {
53
- const extraUnit = propertyValue.endsWith("px") ? "px" : "";
54
- const valueWithUnit = `${normalizedValue}${extraUnit}`;
55
- return __spreadProps(__spreadValues({}, acc), { [key]: valueWithUnit });
53
+ return __spreadProps(__spreadValues({}, acc), { [key]: normalizedValue });
56
54
  } else {
57
55
  return acc;
58
56
  }
@@ -44,7 +44,6 @@ const getCookie = (_0) => __async(void 0, [_0], function* ({
44
44
  }
45
45
  const parsedName = name.replace(/_/g, ".");
46
46
  const data = yield storage.load({ key: getStorageName(parsedName) });
47
- console.log("loaded data: ", data.value);
48
47
  return data.value;
49
48
  } catch (err) {
50
49
  console.debug("[COOKIE] GET error: ", err);
@@ -61,7 +60,6 @@ const setCookie = (_0) => __async(void 0, [_0], function* ({
61
60
  return void 0;
62
61
  }
63
62
  yield storage.save({ key: getStorageName(name), data: { value }, expires });
64
- console.log("saved data: ", { key: name, data: { value }, expires });
65
63
  } catch (err) {
66
64
  console.warn("[COOKIE] SET error: ", err);
67
65
  }