@builder.io/sdk-solid 0.7.3 → 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/dev.jsx
CHANGED
|
@@ -4530,10 +4530,10 @@ function SectionComponent(props) {
|
|
|
4530
4530
|
var section_default = SectionComponent;
|
|
4531
4531
|
|
|
4532
4532
|
// src/blocks/symbol/symbol.tsx
|
|
4533
|
-
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as
|
|
4533
|
+
import { onMount as onMount4, on as on3, createEffect as createEffect3, createSignal as createSignal14 } from "solid-js";
|
|
4534
4534
|
|
|
4535
4535
|
// src/components/content-variants/content-variants.tsx
|
|
4536
|
-
import { Show as
|
|
4536
|
+
import { Show as Show12, For as For5, onMount as onMount3, createSignal as createSignal13 } from "solid-js";
|
|
4537
4537
|
|
|
4538
4538
|
// src/helpers/url.ts
|
|
4539
4539
|
var getTopLevelDomain = (host) => {
|
|
@@ -4727,7 +4727,7 @@ var handleABTesting = async ({
|
|
|
4727
4727
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
4728
4728
|
|
|
4729
4729
|
// src/components/content/content.tsx
|
|
4730
|
-
import { Show as
|
|
4730
|
+
import { Show as Show11, createSignal as createSignal12 } from "solid-js";
|
|
4731
4731
|
|
|
4732
4732
|
// src/blocks/button/component-info.ts
|
|
4733
4733
|
var componentInfo = {
|
|
@@ -5502,6 +5502,7 @@ var componentInfo11 = {
|
|
|
5502
5502
|
};
|
|
5503
5503
|
|
|
5504
5504
|
// src/blocks/video/video.tsx
|
|
5505
|
+
import { Show as Show9 } from "solid-js";
|
|
5505
5506
|
function Video(props) {
|
|
5506
5507
|
function videoProps() {
|
|
5507
5508
|
return {
|
|
@@ -5524,26 +5525,66 @@ function Video(props) {
|
|
|
5524
5525
|
}
|
|
5525
5526
|
function spreadProps() {
|
|
5526
5527
|
return {
|
|
5527
|
-
...props.attributes,
|
|
5528
5528
|
...videoProps()
|
|
5529
5529
|
};
|
|
5530
5530
|
}
|
|
5531
|
-
return <
|
|
5532
|
-
{...spreadProps()}
|
|
5533
|
-
preload={props.preload || "metadata"}
|
|
5531
|
+
return <div
|
|
5534
5532
|
style={{
|
|
5535
|
-
|
|
5536
|
-
height: "100%",
|
|
5537
|
-
...props.attributes?.style,
|
|
5538
|
-
"object-fit": props.fit,
|
|
5539
|
-
"object-position": props.position,
|
|
5540
|
-
// Hack to get object fit to work as expected and
|
|
5541
|
-
// not have the video overflow
|
|
5542
|
-
"border-radius": 1
|
|
5533
|
+
position: "relative"
|
|
5543
5534
|
}}
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5535
|
+
>
|
|
5536
|
+
<video
|
|
5537
|
+
class="builder-video"
|
|
5538
|
+
{...spreadProps()}
|
|
5539
|
+
preload={props.preload || "metadata"}
|
|
5540
|
+
style={{
|
|
5541
|
+
width: "100%",
|
|
5542
|
+
height: "100%",
|
|
5543
|
+
...props.attributes?.style,
|
|
5544
|
+
"object-fit": props.fit,
|
|
5545
|
+
"object-position": props.position,
|
|
5546
|
+
// Hack to get object fit to work as expected and
|
|
5547
|
+
// not have the video overflow
|
|
5548
|
+
"z-index": 2,
|
|
5549
|
+
"border-radius": "1px",
|
|
5550
|
+
...props.aspectRatio ? {
|
|
5551
|
+
position: "absolute"
|
|
5552
|
+
} : null
|
|
5553
|
+
}}
|
|
5554
|
+
src={props.video || "no-src"}
|
|
5555
|
+
poster={props.posterImage}
|
|
5556
|
+
><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
|
|
5557
|
+
<Show9
|
|
5558
|
+
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
5559
|
+
><div
|
|
5560
|
+
style={{
|
|
5561
|
+
width: "100%",
|
|
5562
|
+
"padding-top": props.aspectRatio * 100 + "%",
|
|
5563
|
+
"pointer-events": "none",
|
|
5564
|
+
"font-size": "0px"
|
|
5565
|
+
}}
|
|
5566
|
+
/></Show9>
|
|
5567
|
+
<Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
5568
|
+
style={{
|
|
5569
|
+
display: "flex",
|
|
5570
|
+
"flex-direction": "column",
|
|
5571
|
+
"align-items": "stretch"
|
|
5572
|
+
}}
|
|
5573
|
+
>{props.children}</div></Show9>
|
|
5574
|
+
<Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
5575
|
+
style={{
|
|
5576
|
+
"pointer-events": "none",
|
|
5577
|
+
display: "flex",
|
|
5578
|
+
"flex-direction": "column",
|
|
5579
|
+
"align-items": "stretch",
|
|
5580
|
+
position: "absolute",
|
|
5581
|
+
top: "0",
|
|
5582
|
+
left: "0",
|
|
5583
|
+
width: "100%",
|
|
5584
|
+
height: "100%"
|
|
5585
|
+
}}
|
|
5586
|
+
>{props.children}</div></Show9>
|
|
5587
|
+
</div>;
|
|
5547
5588
|
}
|
|
5548
5589
|
var video_default = Video;
|
|
5549
5590
|
|
|
@@ -5606,13 +5647,19 @@ var serializeComponentInfo = ({
|
|
|
5606
5647
|
}), {}))
|
|
5607
5648
|
});
|
|
5608
5649
|
|
|
5650
|
+
// src/components/content-variants/inlined-fns.ts
|
|
5651
|
+
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}";
|
|
5652
|
+
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}";
|
|
5653
|
+
|
|
5609
5654
|
// src/components/content-variants/helpers.ts
|
|
5655
|
+
var UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
5656
|
+
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
5610
5657
|
var getVariants = (content) => Object.values(content?.variations || {}).map((variant) => ({
|
|
5611
5658
|
...variant,
|
|
5612
5659
|
testVariationId: variant.id,
|
|
5613
5660
|
id: content?.id
|
|
5614
5661
|
}));
|
|
5615
|
-
var
|
|
5662
|
+
var checkShouldRenderVariants = ({
|
|
5616
5663
|
canTrack,
|
|
5617
5664
|
content
|
|
5618
5665
|
}) => {
|
|
@@ -5623,142 +5670,37 @@ var checkShouldRunVariants = ({
|
|
|
5623
5670
|
return false;
|
|
5624
5671
|
if (!canTrack)
|
|
5625
5672
|
return false;
|
|
5626
|
-
if (TARGET === "vue2" || TARGET === "vue3")
|
|
5673
|
+
if (TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte")
|
|
5627
5674
|
return true;
|
|
5628
5675
|
if (isBrowser())
|
|
5629
5676
|
return false;
|
|
5630
5677
|
return true;
|
|
5631
5678
|
};
|
|
5632
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
5633
|
-
function getAndSetVariantId2() {
|
|
5634
|
-
function setCookie2(name, value, days) {
|
|
5635
|
-
let expires = "";
|
|
5636
|
-
if (days) {
|
|
5637
|
-
const date = /* @__PURE__ */ new Date();
|
|
5638
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
|
|
5639
|
-
expires = "; expires=" + date.toUTCString();
|
|
5640
|
-
}
|
|
5641
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
5642
|
-
}
|
|
5643
|
-
function getCookie2(name) {
|
|
5644
|
-
const nameEQ = name + "=";
|
|
5645
|
-
const ca2 = document.cookie.split(";");
|
|
5646
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
5647
|
-
let c = ca2[i];
|
|
5648
|
-
while (c.charAt(0) === " ")
|
|
5649
|
-
c = c.substring(1, c.length);
|
|
5650
|
-
if (c.indexOf(nameEQ) === 0)
|
|
5651
|
-
return c.substring(nameEQ.length, c.length);
|
|
5652
|
-
}
|
|
5653
|
-
return null;
|
|
5654
|
-
}
|
|
5655
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
5656
|
-
const variantInCookie = getCookie2(cookieName);
|
|
5657
|
-
const availableIDs = variants.map((vr) => vr.id).concat(contentId);
|
|
5658
|
-
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
5659
|
-
return variantInCookie;
|
|
5660
|
-
}
|
|
5661
|
-
let n = 0;
|
|
5662
|
-
const random = Math.random();
|
|
5663
|
-
for (let i = 0; i < variants.length; i++) {
|
|
5664
|
-
const variant = variants[i];
|
|
5665
|
-
const testRatio = variant.testRatio;
|
|
5666
|
-
n += testRatio;
|
|
5667
|
-
if (random < n) {
|
|
5668
|
-
setCookie2(cookieName, variant.id);
|
|
5669
|
-
return variant.id;
|
|
5670
|
-
}
|
|
5671
|
-
}
|
|
5672
|
-
setCookie2(cookieName, contentId);
|
|
5673
|
-
return contentId;
|
|
5674
|
-
}
|
|
5675
|
-
const winningVariantId = getAndSetVariantId2();
|
|
5676
|
-
const styleEl = document.currentScript?.previousElementSibling;
|
|
5677
|
-
if (isHydrationTarget2) {
|
|
5678
|
-
styleEl.remove();
|
|
5679
|
-
const thisScriptEl = document.currentScript;
|
|
5680
|
-
thisScriptEl?.remove();
|
|
5681
|
-
} else {
|
|
5682
|
-
const newStyleStr = variants.concat({
|
|
5683
|
-
id: contentId
|
|
5684
|
-
}).filter((variant) => variant.id !== winningVariantId).map((value) => {
|
|
5685
|
-
return `.variant-${value.id} { display: none; }
|
|
5686
|
-
`;
|
|
5687
|
-
}).join("");
|
|
5688
|
-
styleEl.innerHTML = newStyleStr;
|
|
5689
|
-
}
|
|
5690
|
-
}
|
|
5691
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
5692
|
-
if (!navigator.cookieEnabled) {
|
|
5693
|
-
return;
|
|
5694
|
-
}
|
|
5695
|
-
function getCookie2(name) {
|
|
5696
|
-
const nameEQ = name + "=";
|
|
5697
|
-
const ca2 = document.cookie.split(";");
|
|
5698
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
5699
|
-
let c = ca2[i];
|
|
5700
|
-
while (c.charAt(0) === " ")
|
|
5701
|
-
c = c.substring(1, c.length);
|
|
5702
|
-
if (c.indexOf(nameEQ) === 0)
|
|
5703
|
-
return c.substring(nameEQ.length, c.length);
|
|
5704
|
-
}
|
|
5705
|
-
return null;
|
|
5706
|
-
}
|
|
5707
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
5708
|
-
const variantId = getCookie2(cookieName);
|
|
5709
|
-
const parentDiv = document.currentScript?.parentElement;
|
|
5710
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
5711
|
-
if (variantId === variantContentId) {
|
|
5712
|
-
if (variantIsDefaultContent) {
|
|
5713
|
-
return;
|
|
5714
|
-
}
|
|
5715
|
-
parentDiv?.removeAttribute("hidden");
|
|
5716
|
-
parentDiv?.removeAttribute("aria-hidden");
|
|
5717
|
-
} else {
|
|
5718
|
-
if (variantIsDefaultContent) {
|
|
5719
|
-
if (isHydrationTarget2) {
|
|
5720
|
-
parentDiv?.remove();
|
|
5721
|
-
} else {
|
|
5722
|
-
parentDiv?.setAttribute("hidden", "true");
|
|
5723
|
-
parentDiv?.setAttribute("aria-hidden", "true");
|
|
5724
|
-
}
|
|
5725
|
-
}
|
|
5726
|
-
return;
|
|
5727
|
-
}
|
|
5728
|
-
return;
|
|
5729
|
-
}
|
|
5730
5679
|
var getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
5731
5680
|
var isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
5732
|
-
var
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
5736
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
5737
|
-
return `
|
|
5738
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
5739
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
5681
|
+
var getScriptString = () => `
|
|
5682
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
5683
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
5740
5684
|
`;
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
var getRenderContentScriptString = ({
|
|
5685
|
+
var getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
5686
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
5687
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
5688
|
+
)`;
|
|
5689
|
+
var getUpdateVariantVisibilityScript = ({
|
|
5747
5690
|
contentId,
|
|
5748
5691
|
variationId
|
|
5749
|
-
}) => {
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
};
|
|
5692
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
5693
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
5694
|
+
)`;
|
|
5753
5695
|
|
|
5754
5696
|
// src/components/inlined-script.tsx
|
|
5755
5697
|
function InlinedScript(props) {
|
|
5756
|
-
return <script innerHTML={props.scriptStr} id={props.id} />;
|
|
5698
|
+
return <script innerHTML={props.scriptStr} id={props.id || ""} />;
|
|
5757
5699
|
}
|
|
5758
5700
|
var Inlined_script_default = InlinedScript;
|
|
5759
5701
|
|
|
5760
5702
|
// src/components/content/components/enable-editor.tsx
|
|
5761
|
-
import { Show as
|
|
5703
|
+
import { Show as Show10, onMount as onMount2, on as on2, createEffect as createEffect2, createSignal as createSignal10 } from "solid-js";
|
|
5762
5704
|
|
|
5763
5705
|
// src/helpers/preview-lru-cache/get.ts
|
|
5764
5706
|
function getPreviewContent(_searchParams) {
|
|
@@ -6245,7 +6187,7 @@ var getInteractionPropertiesForEvent = (event) => {
|
|
|
6245
6187
|
};
|
|
6246
6188
|
|
|
6247
6189
|
// src/constants/sdk-version.ts
|
|
6248
|
-
var SDK_VERSION = "0.7.
|
|
6190
|
+
var SDK_VERSION = "0.7.4";
|
|
6249
6191
|
|
|
6250
6192
|
// src/functions/register.ts
|
|
6251
6193
|
var registry = {};
|
|
@@ -6380,11 +6322,11 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
6380
6322
|
|
|
6381
6323
|
// src/components/content/components/enable-editor.tsx
|
|
6382
6324
|
function EnableEditor(props) {
|
|
6383
|
-
const [forceReRenderCount, setForceReRenderCount] =
|
|
6384
|
-
const [lastUpdated, setLastUpdated] =
|
|
6385
|
-
const [shouldSendResetCookie, setShouldSendResetCookie] =
|
|
6386
|
-
const [httpReqsData, setHttpReqsData] =
|
|
6387
|
-
const [clicked, setClicked] =
|
|
6325
|
+
const [forceReRenderCount, setForceReRenderCount] = createSignal10(0);
|
|
6326
|
+
const [lastUpdated, setLastUpdated] = createSignal10(0);
|
|
6327
|
+
const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal10(false);
|
|
6328
|
+
const [httpReqsData, setHttpReqsData] = createSignal10({});
|
|
6329
|
+
const [clicked, setClicked] = createSignal10(false);
|
|
6388
6330
|
function mergeNewContent(newContent) {
|
|
6389
6331
|
const newContentValue = {
|
|
6390
6332
|
...props.builderContextSignal.content,
|
|
@@ -6627,8 +6569,8 @@ function EnableEditor(props) {
|
|
|
6627
6569
|
emitStateUpdate();
|
|
6628
6570
|
}
|
|
6629
6571
|
createEffect2(on2(() => [props.builderContextSignal.rootState], onUpdateFn_4));
|
|
6630
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
6631
|
-
class={props.
|
|
6572
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><div
|
|
6573
|
+
class={`variant-${props.content?.testVariationId || props.content?.id}`}
|
|
6632
6574
|
{...{}}
|
|
6633
6575
|
key={forceReRenderCount()}
|
|
6634
6576
|
ref={elementRef}
|
|
@@ -6640,12 +6582,12 @@ function EnableEditor(props) {
|
|
|
6640
6582
|
hidden: true,
|
|
6641
6583
|
"aria-hidden": true
|
|
6642
6584
|
}}
|
|
6643
|
-
>{props.children}</div></
|
|
6585
|
+
>{props.children}</div></Show10></builder_context_default.Provider>;
|
|
6644
6586
|
}
|
|
6645
6587
|
var Enable_editor_default = EnableEditor;
|
|
6646
6588
|
|
|
6647
6589
|
// src/components/content/components/styles.tsx
|
|
6648
|
-
import { createSignal as
|
|
6590
|
+
import { createSignal as createSignal11 } from "solid-js";
|
|
6649
6591
|
|
|
6650
6592
|
// src/components/content/components/styles.helpers.ts
|
|
6651
6593
|
var getCssFromFont = (font) => {
|
|
@@ -6704,7 +6646,7 @@ var getCss = ({
|
|
|
6704
6646
|
|
|
6705
6647
|
// src/components/content/components/styles.tsx
|
|
6706
6648
|
function ContentStyles(props) {
|
|
6707
|
-
const [injectedStyles, setInjectedStyles] =
|
|
6649
|
+
const [injectedStyles, setInjectedStyles] = createSignal11(
|
|
6708
6650
|
`
|
|
6709
6651
|
${getCss({
|
|
6710
6652
|
cssCode: props.cssCode,
|
|
@@ -6772,15 +6714,15 @@ var getContentInitialValue = ({
|
|
|
6772
6714
|
|
|
6773
6715
|
// src/components/content/content.tsx
|
|
6774
6716
|
function ContentComponent(props) {
|
|
6775
|
-
const [scriptStr, setScriptStr] =
|
|
6776
|
-
|
|
6717
|
+
const [scriptStr, setScriptStr] = createSignal12(
|
|
6718
|
+
getUpdateVariantVisibilityScript({
|
|
6777
6719
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
6778
6720
|
variationId: props.content?.testVariationId,
|
|
6779
6721
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
6780
6722
|
contentId: props.content?.id
|
|
6781
6723
|
})
|
|
6782
6724
|
);
|
|
6783
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
6725
|
+
const [registeredComponents, setRegisteredComponents] = createSignal12(
|
|
6784
6726
|
[
|
|
6785
6727
|
...getDefaultRegisteredComponents(),
|
|
6786
6728
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -6801,7 +6743,7 @@ function ContentComponent(props) {
|
|
|
6801
6743
|
{}
|
|
6802
6744
|
)
|
|
6803
6745
|
);
|
|
6804
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
6746
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal12({
|
|
6805
6747
|
content: getContentInitialValue({
|
|
6806
6748
|
content: props.content,
|
|
6807
6749
|
data: props.data
|
|
@@ -6853,19 +6795,18 @@ function ContentComponent(props) {
|
|
|
6853
6795
|
locale={props.locale}
|
|
6854
6796
|
includeRefs={props.includeRefs}
|
|
6855
6797
|
enrich={props.enrich}
|
|
6856
|
-
classNameProp={props.classNameProp}
|
|
6857
6798
|
showContent={props.showContent}
|
|
6858
6799
|
builderContextSignal={builderContextSignal()}
|
|
6859
6800
|
{...{
|
|
6860
6801
|
setBuilderContextSignal
|
|
6861
6802
|
}}
|
|
6862
6803
|
>
|
|
6863
|
-
<
|
|
6864
|
-
<
|
|
6804
|
+
<Show11 when={props.isSsrAbTest}><Inlined_script_default scriptStr={scriptStr()} /></Show11>
|
|
6805
|
+
<Show11 when={TARGET !== "reactNative"}><Styles_default
|
|
6865
6806
|
contentId={builderContextSignal().content?.id}
|
|
6866
6807
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
6867
6808
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
6868
|
-
/></
|
|
6809
|
+
/></Show11>
|
|
6869
6810
|
<Blocks_default
|
|
6870
6811
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
6871
6812
|
context={builderContextSignal()}
|
|
@@ -6877,14 +6818,14 @@ var Content_default = ContentComponent;
|
|
|
6877
6818
|
|
|
6878
6819
|
// src/components/content-variants/content-variants.tsx
|
|
6879
6820
|
function ContentVariants(props) {
|
|
6880
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
6881
|
-
|
|
6821
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal13(
|
|
6822
|
+
checkShouldRenderVariants({
|
|
6882
6823
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6883
6824
|
content: props.content
|
|
6884
6825
|
})
|
|
6885
6826
|
);
|
|
6886
|
-
function
|
|
6887
|
-
return
|
|
6827
|
+
function updateCookieAndStylesScriptStr() {
|
|
6828
|
+
return getUpdateCookieAndStylesScript(
|
|
6888
6829
|
getVariants(props.content).map((value) => ({
|
|
6889
6830
|
id: value.testVariationId,
|
|
6890
6831
|
testRatio: value.testRatio
|
|
@@ -6908,20 +6849,21 @@ function ContentVariants(props) {
|
|
|
6908
6849
|
setShouldRenderVariants(false);
|
|
6909
6850
|
});
|
|
6910
6851
|
return <>
|
|
6911
|
-
<
|
|
6912
|
-
<
|
|
6852
|
+
<Show12 when={!props.__isNestedRender && TARGET !== "reactNative"}><Inlined_script_default scriptStr={getScriptString()} /></Show12>
|
|
6853
|
+
<Show12 when={shouldRenderVariants()}>
|
|
6913
6854
|
<Inlined_styles_default
|
|
6914
6855
|
id={`variants-styles-${props.content?.id}`}
|
|
6915
6856
|
styles={hideVariantsStyleString()}
|
|
6916
6857
|
/>
|
|
6917
|
-
<Inlined_script_default
|
|
6858
|
+
<Inlined_script_default
|
|
6859
|
+
scriptStr={updateCookieAndStylesScriptStr()}
|
|
6860
|
+
/>
|
|
6918
6861
|
<For5 each={getVariants(props.content)}>{(variant, _index) => {
|
|
6919
6862
|
const index = _index();
|
|
6920
6863
|
return <Content_default
|
|
6921
6864
|
key={variant.testVariationId}
|
|
6922
6865
|
content={variant}
|
|
6923
6866
|
showContent={false}
|
|
6924
|
-
classNameProp={void 0}
|
|
6925
6867
|
model={props.model}
|
|
6926
6868
|
data={props.data}
|
|
6927
6869
|
context={props.context}
|
|
@@ -6935,11 +6877,10 @@ function ContentVariants(props) {
|
|
|
6935
6877
|
isSsrAbTest={shouldRenderVariants()}
|
|
6936
6878
|
/>;
|
|
6937
6879
|
}}</For5>
|
|
6938
|
-
</
|
|
6880
|
+
</Show12>
|
|
6939
6881
|
<Content_default
|
|
6940
6882
|
{...{}}
|
|
6941
6883
|
content={defaultContent()}
|
|
6942
|
-
classNameProp={`variant-${props.content?.id}`}
|
|
6943
6884
|
showContent={true}
|
|
6944
6885
|
model={props.model}
|
|
6945
6886
|
data={props.data}
|
|
@@ -6983,7 +6924,7 @@ var fetchSymbolContent = async ({
|
|
|
6983
6924
|
|
|
6984
6925
|
// src/blocks/symbol/symbol.tsx
|
|
6985
6926
|
function Symbol2(props) {
|
|
6986
|
-
const [contentToUse, setContentToUse] =
|
|
6927
|
+
const [contentToUse, setContentToUse] = createSignal14(props.symbol?.content);
|
|
6987
6928
|
function className() {
|
|
6988
6929
|
return [
|
|
6989
6930
|
...[props.attributes.class],
|