@builder.io/sdk-react 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,15 +1,6 @@
1
1
  'use client';
2
2
  import * as React from "react";
3
3
  import { useState } from "react";
4
- /**
5
- * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
6
- *
7
- * ```vue
8
- * <template>
9
- * <slot></slot>
10
- * </template>
11
- * ```
12
- */
13
4
  import BuilderContext from "../../context/builder.context.js";
14
5
  import RenderBlock from "./render-block";
15
6
  function RenderRepeatedBlock(props) {
@@ -1,3 +1,4 @@
1
+ import { TARGET } from '../../constants/target';
1
2
  import { isBrowser } from '../../functions/is-browser';
2
3
  export const getVariants = (content) => Object.values(content?.variations || {});
3
4
  export const checkShouldRunVariants = ({ canTrack, content, }) => {
@@ -155,10 +156,11 @@ function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget) {
155
156
  }
156
157
  return;
157
158
  }
158
- const isHydrationTarget = (target) => target === 'react' ||
159
+ const getIsHydrationTarget = (target) => target === 'react' ||
159
160
  target === 'reactNative' ||
160
161
  target === 'vue3' ||
161
162
  target === 'vue2';
163
+ const isHydrationTarget = getIsHydrationTarget(TARGET);
162
164
  /**
163
165
  * We hardcode explicit function names here, because the `.toString()` of a function can change depending on the bundler.
164
166
  * Some bundlers will minify the fn name, etc.
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.2";
1
+ export declare const SDK_VERSION = "0.4.4";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.4.2";
1
+ export const SDK_VERSION = "0.4.4";
@@ -43,7 +43,7 @@ export async function _track(eventProps) {
43
43
  if (!(isBrowser() || TARGET === 'reactNative')) {
44
44
  return;
45
45
  }
46
- return fetch(`https://builder.io/api/v1/track`, {
46
+ return fetch(`https://cdn.builder.io/api/v1/track`, {
47
47
  method: 'POST',
48
48
  body: JSON.stringify({
49
49
  events: [await createEvent(eventProps)],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react",
3
3
  "description": "Builder.io SDK for React",
4
- "version": "0.4.2",
4
+ "version": "0.4.4",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"