@builder.io/sdk-svelte 5.2.3 → 5.2.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/lib/browser/components/content-variants/content-variants.svelte +5 -6
- package/lib/browser/components/content-variants/helpers.js +10 -2
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/edge/components/content-variants/content-variants.svelte +5 -6
- package/lib/edge/components/content-variants/helpers.js +10 -2
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/node/components/content-variants/content-variants.svelte +5 -6
- package/lib/node/components/content-variants/helpers.js +10 -2
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/package.json +1 -1
- package/src/components/content-variants/content-variants.svelte +5 -6
- package/src/components/content-variants/helpers.ts +10 -2
- package/src/constants/sdk-version.ts +1 -1
|
@@ -63,12 +63,6 @@ onMount(() => {
|
|
|
63
63
|
</script>
|
|
64
64
|
|
|
65
65
|
{#if !isNestedRender && TARGET !== "reactNative"}
|
|
66
|
-
<InlinedScript
|
|
67
|
-
id="builderio-init-variants-fns"
|
|
68
|
-
scriptStr={getInitVariantsFnsScriptString()}
|
|
69
|
-
nonce={nonce || ""}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
66
|
{#if SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET)}
|
|
73
67
|
<InlinedScript
|
|
74
68
|
id="builderio-init-personalization-variants-fns"
|
|
@@ -79,6 +73,11 @@ onMount(() => {
|
|
|
79
73
|
{/if}
|
|
80
74
|
|
|
81
75
|
{#if shouldRenderVariants}
|
|
76
|
+
<InlinedScript
|
|
77
|
+
id="builderio-init-variants-fns"
|
|
78
|
+
scriptStr={getInitVariantsFnsScriptString()}
|
|
79
|
+
nonce={nonce || ""}
|
|
80
|
+
/>
|
|
82
81
|
<InlinedStyles
|
|
83
82
|
id="builderio-variants"
|
|
84
83
|
styles={hideVariantsStyleString()}
|
|
@@ -44,8 +44,16 @@ const getIsHydrationTarget = (target) => target === 'react' || target === 'react
|
|
|
44
44
|
const isAngularSDK = TARGET === 'angular';
|
|
45
45
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
46
46
|
export const getInitVariantsFnsScriptString = () => `
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
(function() {
|
|
48
|
+
if (!window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}) {
|
|
49
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT};
|
|
50
|
+
}
|
|
51
|
+
if (!window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}) {
|
|
52
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT};
|
|
53
|
+
}${isHydrationTarget ? `
|
|
54
|
+
var thisScriptEl = document.currentScript;
|
|
55
|
+
if (thisScriptEl) { thisScriptEl.remove(); }` : ''}
|
|
56
|
+
})();
|
|
49
57
|
`;
|
|
50
58
|
export const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
51
59
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.4";
|
|
@@ -63,12 +63,6 @@ onMount(() => {
|
|
|
63
63
|
</script>
|
|
64
64
|
|
|
65
65
|
{#if !isNestedRender && TARGET !== "reactNative"}
|
|
66
|
-
<InlinedScript
|
|
67
|
-
id="builderio-init-variants-fns"
|
|
68
|
-
scriptStr={getInitVariantsFnsScriptString()}
|
|
69
|
-
nonce={nonce || ""}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
66
|
{#if SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET)}
|
|
73
67
|
<InlinedScript
|
|
74
68
|
id="builderio-init-personalization-variants-fns"
|
|
@@ -79,6 +73,11 @@ onMount(() => {
|
|
|
79
73
|
{/if}
|
|
80
74
|
|
|
81
75
|
{#if shouldRenderVariants}
|
|
76
|
+
<InlinedScript
|
|
77
|
+
id="builderio-init-variants-fns"
|
|
78
|
+
scriptStr={getInitVariantsFnsScriptString()}
|
|
79
|
+
nonce={nonce || ""}
|
|
80
|
+
/>
|
|
82
81
|
<InlinedStyles
|
|
83
82
|
id="builderio-variants"
|
|
84
83
|
styles={hideVariantsStyleString()}
|
|
@@ -44,8 +44,16 @@ const getIsHydrationTarget = (target) => target === 'react' || target === 'react
|
|
|
44
44
|
const isAngularSDK = TARGET === 'angular';
|
|
45
45
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
46
46
|
export const getInitVariantsFnsScriptString = () => `
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
(function() {
|
|
48
|
+
if (!window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}) {
|
|
49
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT};
|
|
50
|
+
}
|
|
51
|
+
if (!window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}) {
|
|
52
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT};
|
|
53
|
+
}${isHydrationTarget ? `
|
|
54
|
+
var thisScriptEl = document.currentScript;
|
|
55
|
+
if (thisScriptEl) { thisScriptEl.remove(); }` : ''}
|
|
56
|
+
})();
|
|
49
57
|
`;
|
|
50
58
|
export const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
51
59
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.4";
|
|
@@ -63,12 +63,6 @@ onMount(() => {
|
|
|
63
63
|
</script>
|
|
64
64
|
|
|
65
65
|
{#if !isNestedRender && TARGET !== "reactNative"}
|
|
66
|
-
<InlinedScript
|
|
67
|
-
id="builderio-init-variants-fns"
|
|
68
|
-
scriptStr={getInitVariantsFnsScriptString()}
|
|
69
|
-
nonce={nonce || ""}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
66
|
{#if SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET)}
|
|
73
67
|
<InlinedScript
|
|
74
68
|
id="builderio-init-personalization-variants-fns"
|
|
@@ -79,6 +73,11 @@ onMount(() => {
|
|
|
79
73
|
{/if}
|
|
80
74
|
|
|
81
75
|
{#if shouldRenderVariants}
|
|
76
|
+
<InlinedScript
|
|
77
|
+
id="builderio-init-variants-fns"
|
|
78
|
+
scriptStr={getInitVariantsFnsScriptString()}
|
|
79
|
+
nonce={nonce || ""}
|
|
80
|
+
/>
|
|
82
81
|
<InlinedStyles
|
|
83
82
|
id="builderio-variants"
|
|
84
83
|
styles={hideVariantsStyleString()}
|
|
@@ -44,8 +44,16 @@ const getIsHydrationTarget = (target) => target === 'react' || target === 'react
|
|
|
44
44
|
const isAngularSDK = TARGET === 'angular';
|
|
45
45
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
46
46
|
export const getInitVariantsFnsScriptString = () => `
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
(function() {
|
|
48
|
+
if (!window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}) {
|
|
49
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT};
|
|
50
|
+
}
|
|
51
|
+
if (!window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}) {
|
|
52
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT};
|
|
53
|
+
}${isHydrationTarget ? `
|
|
54
|
+
var thisScriptEl = document.currentScript;
|
|
55
|
+
if (thisScriptEl) { thisScriptEl.remove(); }` : ''}
|
|
56
|
+
})();
|
|
49
57
|
`;
|
|
50
58
|
export const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
51
59
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.4";
|
package/package.json
CHANGED
|
@@ -93,12 +93,6 @@
|
|
|
93
93
|
</script>
|
|
94
94
|
|
|
95
95
|
{#if !isNestedRender && TARGET !== "reactNative"}
|
|
96
|
-
<InlinedScript
|
|
97
|
-
id="builderio-init-variants-fns"
|
|
98
|
-
scriptStr={getInitVariantsFnsScriptString()}
|
|
99
|
-
nonce={nonce || ""}
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
96
|
{#if SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET)}
|
|
103
97
|
<InlinedScript
|
|
104
98
|
id="builderio-init-personalization-variants-fns"
|
|
@@ -109,6 +103,11 @@
|
|
|
109
103
|
{/if}
|
|
110
104
|
|
|
111
105
|
{#if shouldRenderVariants}
|
|
106
|
+
<InlinedScript
|
|
107
|
+
id="builderio-init-variants-fns"
|
|
108
|
+
scriptStr={getInitVariantsFnsScriptString()}
|
|
109
|
+
nonce={nonce || ""}
|
|
110
|
+
/>
|
|
112
111
|
<InlinedStyles
|
|
113
112
|
id="builderio-variants"
|
|
114
113
|
styles={hideVariantsStyleString()}
|
|
@@ -55,8 +55,16 @@ const getIsHydrationTarget = (target: Target) => target === 'react' || target ==
|
|
|
55
55
|
const isAngularSDK = TARGET === 'angular';
|
|
56
56
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
57
57
|
export const getInitVariantsFnsScriptString = () => `
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
(function() {
|
|
59
|
+
if (!window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}) {
|
|
60
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT};
|
|
61
|
+
}
|
|
62
|
+
if (!window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}) {
|
|
63
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT};
|
|
64
|
+
}${isHydrationTarget ? `
|
|
65
|
+
var thisScriptEl = document.currentScript;
|
|
66
|
+
if (thisScriptEl) { thisScriptEl.remove(); }` : ''}
|
|
67
|
+
})();
|
|
60
68
|
`;
|
|
61
69
|
export const getUpdateCookieAndStylesScript = (variants: VariantData[], contentId: string) => `
|
|
62
70
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.4"
|