@builder.io/sdk-solid 0.7.2 → 0.7.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/dist/index.d.ts +4 -4
- package/lib/browser/dev.js +94 -139
- package/lib/browser/dev.jsx +109 -168
- package/lib/browser/index.js +94 -139
- package/lib/browser/index.jsx +109 -168
- package/lib/edge/dev.js +94 -139
- package/lib/edge/dev.jsx +109 -168
- package/lib/edge/index.js +94 -139
- package/lib/edge/index.jsx +109 -168
- package/lib/node/dev.js +94 -139
- package/lib/node/dev.jsx +109 -168
- package/lib/node/index.js +94 -139
- package/lib/node/index.jsx +109 -168
- package/package.json +8 -1
package/lib/edge/index.jsx
CHANGED
|
@@ -4522,10 +4522,10 @@ function SectionComponent(props) {
|
|
|
4522
4522
|
var section_default = SectionComponent;
|
|
4523
4523
|
|
|
4524
4524
|
// src/blocks/symbol/symbol.tsx
|
|
4525
|
-
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as
|
|
4525
|
+
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
4526
4526
|
|
|
4527
4527
|
// src/components/content-variants/content-variants.tsx
|
|
4528
|
-
import { Show as
|
|
4528
|
+
import { Show as Show12, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
4529
4529
|
|
|
4530
4530
|
// src/helpers/url.ts
|
|
4531
4531
|
var getTopLevelDomain = (host) => {
|
|
@@ -4719,7 +4719,7 @@ var handleABTesting = async ({
|
|
|
4719
4719
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
4720
4720
|
|
|
4721
4721
|
// src/components/content/content.tsx
|
|
4722
|
-
import { Show as
|
|
4722
|
+
import { Show as Show11, createSignal as createSignal12 } from "solid-js";
|
|
4723
4723
|
|
|
4724
4724
|
// src/blocks/button/component-info.ts
|
|
4725
4725
|
var componentInfo = {
|
|
@@ -5491,6 +5491,7 @@ var componentInfo11 = {
|
|
|
5491
5491
|
};
|
|
5492
5492
|
|
|
5493
5493
|
// src/blocks/video/video.tsx
|
|
5494
|
+
import { Show as Show9 } from "solid-js";
|
|
5494
5495
|
function Video(props) {
|
|
5495
5496
|
function videoProps() {
|
|
5496
5497
|
return {
|
|
@@ -5513,26 +5514,66 @@ function Video(props) {
|
|
|
5513
5514
|
}
|
|
5514
5515
|
function spreadProps() {
|
|
5515
5516
|
return {
|
|
5516
|
-
...props.attributes,
|
|
5517
5517
|
...videoProps()
|
|
5518
5518
|
};
|
|
5519
5519
|
}
|
|
5520
|
-
return <
|
|
5521
|
-
{...spreadProps()}
|
|
5522
|
-
preload={props.preload || "metadata"}
|
|
5520
|
+
return <div
|
|
5523
5521
|
style={{
|
|
5524
|
-
|
|
5525
|
-
height: "100%",
|
|
5526
|
-
...props.attributes?.style,
|
|
5527
|
-
"object-fit": props.fit,
|
|
5528
|
-
"object-position": props.position,
|
|
5529
|
-
// Hack to get object fit to work as expected and
|
|
5530
|
-
// not have the video overflow
|
|
5531
|
-
"border-radius": 1
|
|
5522
|
+
position: "relative"
|
|
5532
5523
|
}}
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5524
|
+
>
|
|
5525
|
+
<video
|
|
5526
|
+
class="builder-video"
|
|
5527
|
+
{...spreadProps()}
|
|
5528
|
+
preload={props.preload || "metadata"}
|
|
5529
|
+
style={{
|
|
5530
|
+
width: "100%",
|
|
5531
|
+
height: "100%",
|
|
5532
|
+
...props.attributes?.style,
|
|
5533
|
+
"object-fit": props.fit,
|
|
5534
|
+
"object-position": props.position,
|
|
5535
|
+
// Hack to get object fit to work as expected and
|
|
5536
|
+
// not have the video overflow
|
|
5537
|
+
"z-index": 2,
|
|
5538
|
+
"border-radius": "1px",
|
|
5539
|
+
...props.aspectRatio ? {
|
|
5540
|
+
position: "absolute"
|
|
5541
|
+
} : null
|
|
5542
|
+
}}
|
|
5543
|
+
src={props.video || "no-src"}
|
|
5544
|
+
poster={props.posterImage}
|
|
5545
|
+
><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
|
|
5546
|
+
<Show9
|
|
5547
|
+
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
5548
|
+
><div
|
|
5549
|
+
style={{
|
|
5550
|
+
width: "100%",
|
|
5551
|
+
"padding-top": props.aspectRatio * 100 + "%",
|
|
5552
|
+
"pointer-events": "none",
|
|
5553
|
+
"font-size": "0px"
|
|
5554
|
+
}}
|
|
5555
|
+
/></Show9>
|
|
5556
|
+
<Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
5557
|
+
style={{
|
|
5558
|
+
display: "flex",
|
|
5559
|
+
"flex-direction": "column",
|
|
5560
|
+
"align-items": "stretch"
|
|
5561
|
+
}}
|
|
5562
|
+
>{props.children}</div></Show9>
|
|
5563
|
+
<Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
5564
|
+
style={{
|
|
5565
|
+
"pointer-events": "none",
|
|
5566
|
+
display: "flex",
|
|
5567
|
+
"flex-direction": "column",
|
|
5568
|
+
"align-items": "stretch",
|
|
5569
|
+
position: "absolute",
|
|
5570
|
+
top: "0",
|
|
5571
|
+
left: "0",
|
|
5572
|
+
width: "100%",
|
|
5573
|
+
height: "100%"
|
|
5574
|
+
}}
|
|
5575
|
+
>{props.children}</div></Show9>
|
|
5576
|
+
</div>;
|
|
5536
5577
|
}
|
|
5537
5578
|
var video_default = Video;
|
|
5538
5579
|
|
|
@@ -5595,13 +5636,19 @@ var serializeComponentInfo = ({
|
|
|
5595
5636
|
}), {}))
|
|
5596
5637
|
});
|
|
5597
5638
|
|
|
5639
|
+
// src/components/content-variants/inlined-fns.ts
|
|
5640
|
+
var UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
|
|
5641
|
+
var UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
|
|
5642
|
+
|
|
5598
5643
|
// src/components/content-variants/helpers.ts
|
|
5644
|
+
var UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
5645
|
+
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
5599
5646
|
var getVariants = (content) => Object.values(content?.variations || {}).map((variant) => ({
|
|
5600
5647
|
...variant,
|
|
5601
5648
|
testVariationId: variant.id,
|
|
5602
5649
|
id: content?.id
|
|
5603
5650
|
}));
|
|
5604
|
-
var
|
|
5651
|
+
var checkShouldRenderVariants = ({
|
|
5605
5652
|
canTrack,
|
|
5606
5653
|
content
|
|
5607
5654
|
}) => {
|
|
@@ -5612,142 +5659,37 @@ var checkShouldRunVariants = ({
|
|
|
5612
5659
|
return false;
|
|
5613
5660
|
if (!canTrack)
|
|
5614
5661
|
return false;
|
|
5615
|
-
if (TARGET === "vue2" || TARGET === "vue3")
|
|
5662
|
+
if (TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte")
|
|
5616
5663
|
return true;
|
|
5617
5664
|
if (isBrowser())
|
|
5618
5665
|
return false;
|
|
5619
5666
|
return true;
|
|
5620
5667
|
};
|
|
5621
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
5622
|
-
function getAndSetVariantId2() {
|
|
5623
|
-
function setCookie2(name, value, days) {
|
|
5624
|
-
let expires = "";
|
|
5625
|
-
if (days) {
|
|
5626
|
-
const date = /* @__PURE__ */ new Date();
|
|
5627
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
|
|
5628
|
-
expires = "; expires=" + date.toUTCString();
|
|
5629
|
-
}
|
|
5630
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
5631
|
-
}
|
|
5632
|
-
function getCookie2(name) {
|
|
5633
|
-
const nameEQ = name + "=";
|
|
5634
|
-
const ca2 = document.cookie.split(";");
|
|
5635
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
5636
|
-
let c = ca2[i];
|
|
5637
|
-
while (c.charAt(0) === " ")
|
|
5638
|
-
c = c.substring(1, c.length);
|
|
5639
|
-
if (c.indexOf(nameEQ) === 0)
|
|
5640
|
-
return c.substring(nameEQ.length, c.length);
|
|
5641
|
-
}
|
|
5642
|
-
return null;
|
|
5643
|
-
}
|
|
5644
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
5645
|
-
const variantInCookie = getCookie2(cookieName);
|
|
5646
|
-
const availableIDs = variants.map((vr) => vr.id).concat(contentId);
|
|
5647
|
-
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
5648
|
-
return variantInCookie;
|
|
5649
|
-
}
|
|
5650
|
-
let n = 0;
|
|
5651
|
-
const random = Math.random();
|
|
5652
|
-
for (let i = 0; i < variants.length; i++) {
|
|
5653
|
-
const variant = variants[i];
|
|
5654
|
-
const testRatio = variant.testRatio;
|
|
5655
|
-
n += testRatio;
|
|
5656
|
-
if (random < n) {
|
|
5657
|
-
setCookie2(cookieName, variant.id);
|
|
5658
|
-
return variant.id;
|
|
5659
|
-
}
|
|
5660
|
-
}
|
|
5661
|
-
setCookie2(cookieName, contentId);
|
|
5662
|
-
return contentId;
|
|
5663
|
-
}
|
|
5664
|
-
const winningVariantId = getAndSetVariantId2();
|
|
5665
|
-
const styleEl = document.currentScript?.previousElementSibling;
|
|
5666
|
-
if (isHydrationTarget2) {
|
|
5667
|
-
styleEl.remove();
|
|
5668
|
-
const thisScriptEl = document.currentScript;
|
|
5669
|
-
thisScriptEl?.remove();
|
|
5670
|
-
} else {
|
|
5671
|
-
const newStyleStr = variants.concat({
|
|
5672
|
-
id: contentId
|
|
5673
|
-
}).filter((variant) => variant.id !== winningVariantId).map((value) => {
|
|
5674
|
-
return `.variant-${value.id} { display: none; }
|
|
5675
|
-
`;
|
|
5676
|
-
}).join("");
|
|
5677
|
-
styleEl.innerHTML = newStyleStr;
|
|
5678
|
-
}
|
|
5679
|
-
}
|
|
5680
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
5681
|
-
if (!navigator.cookieEnabled) {
|
|
5682
|
-
return;
|
|
5683
|
-
}
|
|
5684
|
-
function getCookie2(name) {
|
|
5685
|
-
const nameEQ = name + "=";
|
|
5686
|
-
const ca2 = document.cookie.split(";");
|
|
5687
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
5688
|
-
let c = ca2[i];
|
|
5689
|
-
while (c.charAt(0) === " ")
|
|
5690
|
-
c = c.substring(1, c.length);
|
|
5691
|
-
if (c.indexOf(nameEQ) === 0)
|
|
5692
|
-
return c.substring(nameEQ.length, c.length);
|
|
5693
|
-
}
|
|
5694
|
-
return null;
|
|
5695
|
-
}
|
|
5696
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
5697
|
-
const variantId = getCookie2(cookieName);
|
|
5698
|
-
const parentDiv = document.currentScript?.parentElement;
|
|
5699
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
5700
|
-
if (variantId === variantContentId) {
|
|
5701
|
-
if (variantIsDefaultContent) {
|
|
5702
|
-
return;
|
|
5703
|
-
}
|
|
5704
|
-
parentDiv?.removeAttribute("hidden");
|
|
5705
|
-
parentDiv?.removeAttribute("aria-hidden");
|
|
5706
|
-
} else {
|
|
5707
|
-
if (variantIsDefaultContent) {
|
|
5708
|
-
if (isHydrationTarget2) {
|
|
5709
|
-
parentDiv?.remove();
|
|
5710
|
-
} else {
|
|
5711
|
-
parentDiv?.setAttribute("hidden", "true");
|
|
5712
|
-
parentDiv?.setAttribute("aria-hidden", "true");
|
|
5713
|
-
}
|
|
5714
|
-
}
|
|
5715
|
-
return;
|
|
5716
|
-
}
|
|
5717
|
-
return;
|
|
5718
|
-
}
|
|
5719
5668
|
var getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
5720
5669
|
var isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
5721
|
-
var
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
5725
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
5726
|
-
return `
|
|
5727
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
5728
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
5670
|
+
var getScriptString = () => `
|
|
5671
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
5672
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
5729
5673
|
`;
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
var getRenderContentScriptString = ({
|
|
5674
|
+
var getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
5675
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
5676
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
5677
|
+
)`;
|
|
5678
|
+
var getUpdateVariantVisibilityScript = ({
|
|
5736
5679
|
contentId,
|
|
5737
5680
|
variationId
|
|
5738
|
-
}) => {
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
};
|
|
5681
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
5682
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
5683
|
+
)`;
|
|
5742
5684
|
|
|
5743
5685
|
// src/components/inlined-script.tsx
|
|
5744
5686
|
function InlinedScript(props) {
|
|
5745
|
-
return <script innerHTML={props.scriptStr} id={props.id} />;
|
|
5687
|
+
return <script innerHTML={props.scriptStr} id={props.id || ""} />;
|
|
5746
5688
|
}
|
|
5747
5689
|
var Inlined_script_default = InlinedScript;
|
|
5748
5690
|
|
|
5749
5691
|
// src/components/content/components/enable-editor.tsx
|
|
5750
|
-
import { Show as
|
|
5692
|
+
import { Show as Show10, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
5751
5693
|
|
|
5752
5694
|
// src/helpers/preview-lru-cache/get.ts
|
|
5753
5695
|
function getPreviewContent(_searchParams) {
|
|
@@ -6229,7 +6171,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
6229
6171
|
};
|
|
6230
6172
|
|
|
6231
6173
|
// src/constants/sdk-version.ts
|
|
6232
|
-
var SDK_VERSION = "0.7.
|
|
6174
|
+
var SDK_VERSION = "0.7.4";
|
|
6233
6175
|
|
|
6234
6176
|
// src/functions/register.ts
|
|
6235
6177
|
var registry = {};
|
|
@@ -6363,11 +6305,11 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
6363
6305
|
|
|
6364
6306
|
// src/components/content/components/enable-editor.tsx
|
|
6365
6307
|
function EnableEditor(props) {
|
|
6366
|
-
const [forceReRenderCount, setForceReRenderCount] =
|
|
6367
|
-
const [lastUpdated, setLastUpdated] =
|
|
6368
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] =
|
|
6369
|
-
const [httpReqsData, setHttpReqsData] =
|
|
6370
|
-
const [clicked, setClicked] =
|
|
6308
|
+
const [forceReRenderCount, setForceReRenderCount] = createSignal10(0);
|
|
6309
|
+
const [lastUpdated, setLastUpdated] = createSignal10(0);
|
|
6310
|
+
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal10(false);
|
|
6311
|
+
const [httpReqsData, setHttpReqsData] = createSignal10({});
|
|
6312
|
+
const [clicked, setClicked] = createSignal10(false);
|
|
6371
6313
|
function mergeNewContent(newContent) {
|
|
6372
6314
|
const newContentValue = {
|
|
6373
6315
|
...props.builderContextSignal.content,
|
|
@@ -6609,8 +6551,8 @@ function EnableEditor(props) {
|
|
|
6609
6551
|
emitStateUpdate();
|
|
6610
6552
|
}
|
|
6611
6553
|
createEffect2(on2(() => [props.builderContextSignal.rootState], onUpdateFn_4));
|
|
6612
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
6613
|
-
class={props.
|
|
6554
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><div
|
|
6555
|
+
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
6614
6556
|
{...{}}
|
|
6615
6557
|
key={forceReRenderCount()}
|
|
6616
6558
|
ref={elementRef}
|
|
@@ -6622,12 +6564,12 @@ function EnableEditor(props) {
|
|
|
6622
6564
|
hidden: true,
|
|
6623
6565
|
"aria-hidden": true
|
|
6624
6566
|
}}
|
|
6625
|
-
>{props.children}</div></
|
|
6567
|
+
>{props.children}</div></Show10></builder_context_default.Provider>;
|
|
6626
6568
|
}
|
|
6627
6569
|
var Enable_editor_default = EnableEditor;
|
|
6628
6570
|
|
|
6629
6571
|
// src/components/content/components/styles.tsx
|
|
6630
|
-
import { createSignal as
|
|
6572
|
+
import { createSignal as createSignal11 } from "solid-js";
|
|
6631
6573
|
|
|
6632
6574
|
// src/components/content/components/styles.helpers.ts
|
|
6633
6575
|
var getCssFromFont = (font) => {
|
|
@@ -6686,7 +6628,7 @@ var getCss = ({
|
|
|
6686
6628
|
|
|
6687
6629
|
// src/components/content/components/styles.tsx
|
|
6688
6630
|
function ContentStyles(props) {
|
|
6689
|
-
const [injectedStyles, setInjectedStyles] =
|
|
6631
|
+
const [injectedStyles, setInjectedStyles] = createSignal11(
|
|
6690
6632
|
`
|
|
6691
6633
|
${getCss({
|
|
6692
6634
|
cssCode: props.cssCode,
|
|
@@ -6754,15 +6696,15 @@ var getContentInitialValue = ({
|
|
|
6754
6696
|
|
|
6755
6697
|
// src/components/content/content.tsx
|
|
6756
6698
|
function ContentComponent(props) {
|
|
6757
|
-
const [scriptStr, setScriptStr] =
|
|
6758
|
-
|
|
6699
|
+
const [scriptStr, setScriptStr] = createSignal12(
|
|
6700
|
+
getUpdateVariantVisibilityScript({
|
|
6759
6701
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
6760
6702
|
variationId: props.content?.testVariationId,
|
|
6761
6703
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
6762
6704
|
contentId: props.content?.id
|
|
6763
6705
|
})
|
|
6764
6706
|
);
|
|
6765
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
6707
|
+
const [registeredComponents, setRegisteredComponents] = createSignal12(
|
|
6766
6708
|
[
|
|
6767
6709
|
...getDefaultRegisteredComponents(),
|
|
6768
6710
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -6783,7 +6725,7 @@ function ContentComponent(props) {
|
|
|
6783
6725
|
{}
|
|
6784
6726
|
)
|
|
6785
6727
|
);
|
|
6786
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
6728
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal12({
|
|
6787
6729
|
content: getContentInitialValue({
|
|
6788
6730
|
content: props.content,
|
|
6789
6731
|
data: props.data
|
|
@@ -6835,19 +6777,18 @@ function ContentComponent(props) {
|
|
|
6835
6777
|
locale={props.locale}
|
|
6836
6778
|
includeRefs={props.includeRefs}
|
|
6837
6779
|
enrich={props.enrich}
|
|
6838
|
-
classNameProp={props.classNameProp}
|
|
6839
6780
|
showContent={props.showContent}
|
|
6840
6781
|
builderContextSignal={builderContextSignal()}
|
|
6841
6782
|
{...{
|
|
6842
6783
|
setBuilderContextSignal
|
|
6843
6784
|
}}
|
|
6844
6785
|
>
|
|
6845
|
-
<
|
|
6846
|
-
<
|
|
6786
|
+
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
6787
|
+
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
6847
6788
|
contentId={builderContextSignal().content?.id}
|
|
6848
6789
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
6849
6790
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
6850
|
-
/></
|
|
6791
|
+
/></Show11>
|
|
6851
6792
|
<Blocks_default
|
|
6852
6793
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
6853
6794
|
context={builderContextSignal()}
|
|
@@ -6859,14 +6800,14 @@ var Content_default = ContentComponent;
|
|
|
6859
6800
|
|
|
6860
6801
|
// src/components/content-variants/content-variants.tsx
|
|
6861
6802
|
function ContentVariants(props) {
|
|
6862
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
6863
|
-
|
|
6803
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal13(
|
|
6804
|
+
checkShouldRenderVariants({
|
|
6864
6805
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6865
6806
|
content: props.content
|
|
6866
6807
|
})
|
|
6867
6808
|
);
|
|
6868
|
-
function
|
|
6869
|
-
return
|
|
6809
|
+
function updateCookieAndStylesScriptStr() {
|
|
6810
|
+
return getUpdateCookieAndStylesScript(
|
|
6870
6811
|
getVariants(props.content).map((value) => ({
|
|
6871
6812
|
id: value.testVariationId,
|
|
6872
6813
|
testRatio: value.testRatio
|
|
@@ -6890,20 +6831,21 @@ function ContentVariants(props) {
|
|
|
6890
6831
|
setShouldRenderVariants(false);
|
|
6891
6832
|
});
|
|
6892
6833
|
return <>
|
|
6893
|
-
<
|
|
6894
|
-
<
|
|
6834
|
+
<Show12 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
6835
|
+
<Show12 when={shouldRenderVariants()}>
|
|
6895
6836
|
<Inlined_styles_default
|
|
6896
6837
|
id={`variants-styles-${props.content?.id}`}
|
|
6897
6838
|
styles={hideVariantsStyleString()}
|
|
6898
6839
|
/>
|
|
6899
|
-
<Inlined_script_default
|
|
6840
|
+
<Inlined_script_default
|
|
6841
|
+
scriptStr={updateCookieAndStylesScriptStr()}
|
|
6842
|
+
/>
|
|
6900
6843
|
<For5 each={getVariants(props.content)}>{(variant, _index) => {
|
|
6901
6844
|
const index = _index();
|
|
6902
6845
|
return <Content_default
|
|
6903
6846
|
key={variant.testVariationId}
|
|
6904
6847
|
content={variant}
|
|
6905
6848
|
showContent={false}
|
|
6906
|
-
classNameProp={void 0}
|
|
6907
6849
|
model={props.model}
|
|
6908
6850
|
data={props.data}
|
|
6909
6851
|
context={props.context}
|
|
@@ -6917,11 +6859,10 @@ function ContentVariants(props) {
|
|
|
6917
6859
|
isSsrAbTest={shouldRenderVariants()}
|
|
6918
6860
|
/>;
|
|
6919
6861
|
}}</For5>
|
|
6920
|
-
</
|
|
6862
|
+
</Show12>
|
|
6921
6863
|
<Content_default
|
|
6922
6864
|
{...{}}
|
|
6923
6865
|
content={defaultContent()}
|
|
6924
|
-
classNameProp={`variant-${props.content?.id}`}
|
|
6925
6866
|
showContent={true}
|
|
6926
6867
|
model={props.model}
|
|
6927
6868
|
data={props.data}
|
|
@@ -6965,7 +6906,7 @@ var fetchSymbolContent = async ({
|
|
|
6965
6906
|
|
|
6966
6907
|
// src/blocks/symbol/symbol.tsx
|
|
6967
6908
|
function Symbol2(props) {
|
|
6968
|
-
const [contentToUse, setContentToUse] =
|
|
6909
|
+
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
6969
6910
|
function className() {
|
|
6970
6911
|
return [
|
|
6971
6912
|
...[props.attributes.class],
|