@builder.io/sdk-react-native 0.4.2 → 0.4.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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVariantsScriptString = exports.getVariants = exports.getRenderContentScriptString = exports.checkShouldRunVariants = void 0;
4
+ const target_1 = require("../../constants/target");
4
5
  const is_browser_1 = require("../../functions/is-browser");
5
6
  const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {});
6
7
  exports.getVariants = getVariants;
@@ -117,7 +118,8 @@ function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2)
117
118
  }
118
119
  return;
119
120
  }
120
- const isHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
121
+ const getIsHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
122
+ const isHydrationTarget = getIsHydrationTarget(target_1.TARGET);
121
123
  const AB_TEST_FN_NAME = "bldrAbTest";
122
124
  const CONTENT_FN_NAME = "bldrCntntScrpt";
123
125
  const getVariantsScriptString = (variants, contentId) => {
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.4.2";
4
+ exports.SDK_VERSION = "0.4.4";
@@ -106,7 +106,7 @@ function _track(eventProps) {
106
106
  if (!((0, is_browser_js_1.isBrowser)() || target_js_1.TARGET === "reactNative")) {
107
107
  return;
108
108
  }
109
- return fetch(`https://builder.io/api/v1/track`, {
109
+ return fetch(`https://cdn.builder.io/api/v1/track`, {
110
110
  method: "POST",
111
111
  body: JSON.stringify({
112
112
  events: [yield createEvent(eventProps)]
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.4.2",
4
+ "version": "0.4.4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,3 +1,4 @@
1
+ import { TARGET } from "../../constants/target";
1
2
  import { isBrowser } from "../../functions/is-browser";
2
3
  const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {});
3
4
  const checkShouldRunVariants = ({
@@ -112,7 +113,8 @@ function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2)
112
113
  }
113
114
  return;
114
115
  }
115
- const isHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
116
+ const getIsHydrationTarget = (target) => target === "react" || target === "reactNative" || target === "vue3" || target === "vue2";
117
+ const isHydrationTarget = getIsHydrationTarget(TARGET);
116
118
  const AB_TEST_FN_NAME = "bldrAbTest";
117
119
  const CONTENT_FN_NAME = "bldrCntntScrpt";
118
120
  const getVariantsScriptString = (variants, contentId) => {
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.4.2"
1
+ export const SDK_VERSION = "0.4.4"
@@ -108,7 +108,7 @@ function _track(eventProps) {
108
108
  if (!(isBrowser() || TARGET === "reactNative")) {
109
109
  return;
110
110
  }
111
- return fetch(`https://builder.io/api/v1/track`, {
111
+ return fetch(`https://cdn.builder.io/api/v1/track`, {
112
112
  method: "POST",
113
113
  body: JSON.stringify({
114
114
  events: [yield createEvent(eventProps)]