@builder.io/sdk-svelte 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.
- package/package/--package.json +1 -1
- package/package/CHANGELOG.md +4 -0
- package/package/components/render-block/render-repeated-block.svelte +1 -10
- package/package/components/render-content-variants/helpers.js +3 -1
- package/package/constants/sdk-version.d.ts +1 -1
- package/package/constants/sdk-version.js +1 -1
- package/package/functions/track/index.js +1 -1
- package/package.json +1 -1
- package/src/components/render-block/render-repeated-block.svelte +0 -10
- package/src/components/render-content-variants/helpers.ts +4 -1
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/track/index.ts +1 -1
package/package/--package.json
CHANGED
package/package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
<script context="module"
|
|
2
|
-
* We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
|
|
3
|
-
*
|
|
4
|
-
* ```vue
|
|
5
|
-
*
|
|
6
|
-
* <slot></slot>
|
|
7
|
-
*
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
</script>
|
|
1
|
+
<script context="module"></script>
|
|
11
2
|
|
|
12
3
|
<script>import { setContext } from "svelte";
|
|
13
4
|
import { writable } from "svelte/store";
|
|
@@ -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
|
|
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.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.4.
|
|
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
|
@@ -3,16 +3,6 @@
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
repeatContext: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
|
|
9
|
-
*
|
|
10
|
-
* ```vue
|
|
11
|
-
* <template>
|
|
12
|
-
* <slot></slot>
|
|
13
|
-
* </template>
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
6
|
</script>
|
|
17
7
|
|
|
18
8
|
<script lang="ts">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TARGET } from '../../constants/target';
|
|
1
2
|
import { isBrowser } from '../../functions/is-browser';
|
|
2
3
|
import type { Nullable } from '../../helpers/nullable';
|
|
3
4
|
import type { BuilderContent } from '../../types/builder-content';
|
|
@@ -202,12 +203,14 @@ function bldrCntntScrpt(
|
|
|
202
203
|
return;
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
const
|
|
206
|
+
const getIsHydrationTarget = (target: Target) =>
|
|
206
207
|
target === 'react' ||
|
|
207
208
|
target === 'reactNative' ||
|
|
208
209
|
target === 'vue3' ||
|
|
209
210
|
target === 'vue2';
|
|
210
211
|
|
|
212
|
+
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
213
|
+
|
|
211
214
|
/**
|
|
212
215
|
* We hardcode explicit function names here, because the `.toString()` of a function can change depending on the bundler.
|
|
213
216
|
* Some bundlers will minify the fn name, etc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.4.
|
|
1
|
+
export const SDK_VERSION = "0.4.4"
|
|
@@ -118,7 +118,7 @@ export async function _track(eventProps: EventProps) {
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
return fetch(`https://builder.io/api/v1/track`, {
|
|
121
|
+
return fetch(`https://cdn.builder.io/api/v1/track`, {
|
|
122
122
|
method: 'POST',
|
|
123
123
|
body: JSON.stringify({
|
|
124
124
|
events: [await createEvent(eventProps)],
|