@builder.io/sdk-qwik 0.7.3 → 0.7.5
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/index.qwik.cjs +115 -191
- package/lib/browser/index.qwik.mjs +115 -191
- package/lib/edge/index.qwik.cjs +115 -191
- package/lib/edge/index.qwik.mjs +115 -191
- package/lib/node/index.qwik.cjs +115 -191
- package/lib/node/index.qwik.mjs +115 -191
- package/package.json +8 -1
- package/types/src/blocks/video/video.d.ts +4 -0
- package/types/src/components/content/content.helpers.d.ts +1 -1
- package/types/src/components/content/content.types.d.ts +0 -4
- package/types/src/components/content-variants/helpers.d.ts +3 -3
- package/types/src/components/content-variants/inlined-fns.d.ts +14 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
|
@@ -719,8 +719,9 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
719
719
|
props
|
|
720
720
|
]));
|
|
721
721
|
const processedBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
722
|
-
|
|
723
|
-
|
|
722
|
+
var _a2;
|
|
723
|
+
const [props2] = qwik.useLexicalScope();
|
|
724
|
+
return ((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) ? props2.block : getProcessedBlock({
|
|
724
725
|
block: props2.block,
|
|
725
726
|
localState: props2.context.localState,
|
|
726
727
|
rootState: props2.context.rootState,
|
|
@@ -729,8 +730,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
729
730
|
shouldEvaluateBindings: true
|
|
730
731
|
});
|
|
731
732
|
}, "Block_component_processedBlock_useComputed_ESKw0l5FcBc", [
|
|
732
|
-
props
|
|
733
|
-
repeatItem
|
|
733
|
+
props
|
|
734
734
|
]));
|
|
735
735
|
const Tag = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
736
736
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -739,14 +739,19 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
739
739
|
props
|
|
740
740
|
]));
|
|
741
741
|
const canShowBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
742
|
-
|
|
742
|
+
var _a2, _b;
|
|
743
|
+
const [processedBlock2, props2, repeatItem2] = qwik.useLexicalScope();
|
|
743
744
|
if ("hide" in processedBlock2.value)
|
|
744
745
|
return !processedBlock2.value.hide;
|
|
745
746
|
if ("show" in processedBlock2.value)
|
|
746
747
|
return processedBlock2.value.show;
|
|
748
|
+
if (((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) && !((_b = repeatItem2.value) == null ? void 0 : _b.length))
|
|
749
|
+
return false;
|
|
747
750
|
return true;
|
|
748
751
|
}, "Block_component_canShowBlock_useComputed_NJEFz8ICF08", [
|
|
749
|
-
processedBlock
|
|
752
|
+
processedBlock,
|
|
753
|
+
props,
|
|
754
|
+
repeatItem
|
|
750
755
|
]));
|
|
751
756
|
const childrenWithoutParentComponent = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
752
757
|
var _a2;
|
|
@@ -2575,6 +2580,8 @@ const componentInfo = {
|
|
|
2575
2580
|
]
|
|
2576
2581
|
};
|
|
2577
2582
|
const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2583
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2584
|
+
qwik._jsxBranch();
|
|
2578
2585
|
const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2579
2586
|
const [props2] = qwik.useLexicalScope();
|
|
2580
2587
|
return {
|
|
@@ -2598,43 +2605,83 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2598
2605
|
props
|
|
2599
2606
|
]));
|
|
2600
2607
|
const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2601
|
-
const [
|
|
2608
|
+
const [videoProps2] = qwik.useLexicalScope();
|
|
2602
2609
|
return {
|
|
2603
|
-
...props2.attributes,
|
|
2604
2610
|
...videoProps2.value
|
|
2605
2611
|
};
|
|
2606
2612
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
2607
|
-
props,
|
|
2608
2613
|
videoProps
|
|
2609
2614
|
]));
|
|
2610
|
-
return /* @__PURE__ */ qwik.
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
props
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
return {
|
|
2615
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2616
|
+
style: {
|
|
2617
|
+
position: "relative"
|
|
2618
|
+
}
|
|
2619
|
+
}, [
|
|
2620
|
+
/* @__PURE__ */ qwik._jsxS("video", {
|
|
2621
|
+
...spreadProps.value,
|
|
2622
|
+
children: !props.lazyLoad ? /* @__PURE__ */ qwik._jsxQ("source", null, {
|
|
2623
|
+
src: qwik._fnSignal((p0) => p0.video, [
|
|
2624
|
+
props
|
|
2625
|
+
], "p0.video"),
|
|
2626
|
+
type: "video/mp4"
|
|
2627
|
+
}, null, 3, "j7_0") : null,
|
|
2628
|
+
style: {
|
|
2625
2629
|
width: "100%",
|
|
2626
2630
|
height: "100%",
|
|
2627
|
-
...(_a =
|
|
2628
|
-
objectFit:
|
|
2629
|
-
objectPosition:
|
|
2631
|
+
...(_a = props.attributes) == null ? void 0 : _a.style,
|
|
2632
|
+
objectFit: props.fit,
|
|
2633
|
+
objectPosition: props.position,
|
|
2630
2634
|
// Hack to get object fit to work as expected and
|
|
2631
2635
|
// not have the video overflow
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2636
|
+
zIndex: 2,
|
|
2637
|
+
borderRadius: "1px",
|
|
2638
|
+
...props.aspectRatio ? {
|
|
2639
|
+
position: "absolute"
|
|
2640
|
+
} : null
|
|
2641
|
+
}
|
|
2642
|
+
}, {
|
|
2643
|
+
class: "builder-video",
|
|
2644
|
+
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
2645
|
+
props
|
|
2646
|
+
], "p0.posterImage"),
|
|
2647
|
+
preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
|
|
2648
|
+
props
|
|
2649
|
+
], 'p0.preload||"metadata"'),
|
|
2650
|
+
src: qwik._fnSignal((p0) => p0.video || "no-src", [
|
|
2651
|
+
props
|
|
2652
|
+
], 'p0.video||"no-src"')
|
|
2653
|
+
}, 0, null),
|
|
2654
|
+
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2655
|
+
style: qwik._fnSignal((p0) => ({
|
|
2656
|
+
width: "100%",
|
|
2657
|
+
paddingTop: p0.aspectRatio * 100 + "%",
|
|
2658
|
+
pointerEvents: "none",
|
|
2659
|
+
fontSize: "0px"
|
|
2660
|
+
}), [
|
|
2661
|
+
props
|
|
2662
|
+
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
2663
|
+
}, null, 3, "j7_1") : null,
|
|
2664
|
+
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2665
|
+
style: {
|
|
2666
|
+
display: "flex",
|
|
2667
|
+
flexDirection: "column",
|
|
2668
|
+
alignItems: "stretch"
|
|
2669
|
+
}
|
|
2670
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_2"), 1, "j7_3") : null,
|
|
2671
|
+
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2672
|
+
style: {
|
|
2673
|
+
pointerEvents: "none",
|
|
2674
|
+
display: "flex",
|
|
2675
|
+
flexDirection: "column",
|
|
2676
|
+
alignItems: "stretch",
|
|
2677
|
+
position: "absolute",
|
|
2678
|
+
top: "0",
|
|
2679
|
+
left: "0",
|
|
2680
|
+
width: "100%",
|
|
2681
|
+
height: "100%"
|
|
2682
|
+
}
|
|
2683
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
2684
|
+
], 1, "j7_6");
|
|
2638
2685
|
}, "Video_component_qdcTZflYyoQ"));
|
|
2639
2686
|
const getDefaultRegisteredComponents = () => [
|
|
2640
2687
|
{
|
|
@@ -2700,12 +2747,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
|
|
|
2700
2747
|
[key]: serializeValue(value)
|
|
2701
2748
|
}), {}))
|
|
2702
2749
|
});
|
|
2750
|
+
const 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}";
|
|
2751
|
+
const 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}";
|
|
2752
|
+
const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
2753
|
+
const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
2703
2754
|
const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
|
|
2704
2755
|
...variant,
|
|
2705
2756
|
testVariationId: variant.id,
|
|
2706
2757
|
id: content == null ? void 0 : content.id
|
|
2707
2758
|
}));
|
|
2708
|
-
const
|
|
2759
|
+
const checkShouldRenderVariants = ({ canTrack, content }) => {
|
|
2709
2760
|
const hasVariants = getVariants(content).length > 0;
|
|
2710
2761
|
if (!hasVariants)
|
|
2711
2762
|
return false;
|
|
@@ -2715,131 +2766,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
|
|
|
2715
2766
|
return false;
|
|
2716
2767
|
return true;
|
|
2717
2768
|
};
|
|
2718
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
2719
|
-
var _a;
|
|
2720
|
-
function getAndSetVariantId2() {
|
|
2721
|
-
function setCookie2(name, value, days) {
|
|
2722
|
-
let expires = "";
|
|
2723
|
-
if (days) {
|
|
2724
|
-
const date = /* @__PURE__ */ new Date();
|
|
2725
|
-
date.setTime(date.getTime() + days * 864e5);
|
|
2726
|
-
expires = "; expires=" + date.toUTCString();
|
|
2727
|
-
}
|
|
2728
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
2729
|
-
}
|
|
2730
|
-
function getCookie2(name) {
|
|
2731
|
-
const nameEQ = name + "=";
|
|
2732
|
-
const ca = document.cookie.split(";");
|
|
2733
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2734
|
-
let c = ca[i];
|
|
2735
|
-
while (c.charAt(0) === " ")
|
|
2736
|
-
c = c.substring(1, c.length);
|
|
2737
|
-
if (c.indexOf(nameEQ) === 0)
|
|
2738
|
-
return c.substring(nameEQ.length, c.length);
|
|
2739
|
-
}
|
|
2740
|
-
return null;
|
|
2741
|
-
}
|
|
2742
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
2743
|
-
const variantInCookie = getCookie2(cookieName);
|
|
2744
|
-
const availableIDs = variants.map((vr) => vr.id).concat(contentId);
|
|
2745
|
-
if (variantInCookie && availableIDs.includes(variantInCookie))
|
|
2746
|
-
return variantInCookie;
|
|
2747
|
-
let n = 0;
|
|
2748
|
-
const random = Math.random();
|
|
2749
|
-
for (let i = 0; i < variants.length; i++) {
|
|
2750
|
-
const variant = variants[i];
|
|
2751
|
-
const testRatio = variant.testRatio;
|
|
2752
|
-
n += testRatio;
|
|
2753
|
-
if (random < n) {
|
|
2754
|
-
setCookie2(cookieName, variant.id);
|
|
2755
|
-
return variant.id;
|
|
2756
|
-
}
|
|
2757
|
-
}
|
|
2758
|
-
setCookie2(cookieName, contentId);
|
|
2759
|
-
return contentId;
|
|
2760
|
-
}
|
|
2761
|
-
const winningVariantId = getAndSetVariantId2();
|
|
2762
|
-
const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
|
|
2763
|
-
if (isHydrationTarget2) {
|
|
2764
|
-
styleEl.remove();
|
|
2765
|
-
const thisScriptEl = document.currentScript;
|
|
2766
|
-
thisScriptEl == null ? void 0 : thisScriptEl.remove();
|
|
2767
|
-
} else {
|
|
2768
|
-
const newStyleStr = variants.concat({
|
|
2769
|
-
id: contentId
|
|
2770
|
-
}).filter((variant) => variant.id !== winningVariantId).map((value) => {
|
|
2771
|
-
return `.variant-${value.id} { display: none; }
|
|
2772
|
-
`;
|
|
2773
|
-
}).join("");
|
|
2774
|
-
styleEl.innerHTML = newStyleStr;
|
|
2775
|
-
}
|
|
2776
|
-
}
|
|
2777
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
2778
|
-
var _a;
|
|
2779
|
-
if (!navigator.cookieEnabled)
|
|
2780
|
-
return;
|
|
2781
|
-
function getCookie2(name) {
|
|
2782
|
-
const nameEQ = name + "=";
|
|
2783
|
-
const ca = document.cookie.split(";");
|
|
2784
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2785
|
-
let c = ca[i];
|
|
2786
|
-
while (c.charAt(0) === " ")
|
|
2787
|
-
c = c.substring(1, c.length);
|
|
2788
|
-
if (c.indexOf(nameEQ) === 0)
|
|
2789
|
-
return c.substring(nameEQ.length, c.length);
|
|
2790
|
-
}
|
|
2791
|
-
return null;
|
|
2792
|
-
}
|
|
2793
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
2794
|
-
const variantId = getCookie2(cookieName);
|
|
2795
|
-
const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
|
|
2796
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
2797
|
-
if (variantId === variantContentId) {
|
|
2798
|
-
if (variantIsDefaultContent)
|
|
2799
|
-
return;
|
|
2800
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
|
|
2801
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
|
|
2802
|
-
} else {
|
|
2803
|
-
if (variantIsDefaultContent) {
|
|
2804
|
-
if (isHydrationTarget2)
|
|
2805
|
-
parentDiv == null ? void 0 : parentDiv.remove();
|
|
2806
|
-
else {
|
|
2807
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
|
|
2808
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
|
|
2809
|
-
}
|
|
2810
|
-
}
|
|
2811
|
-
return;
|
|
2812
|
-
}
|
|
2813
|
-
return;
|
|
2814
|
-
}
|
|
2815
2769
|
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
2816
2770
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
2821
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
2822
|
-
return `
|
|
2823
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
2824
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
2771
|
+
const getScriptString = () => `
|
|
2772
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2773
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2825
2774
|
`;
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
2834
|
-
};
|
|
2775
|
+
const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
2776
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2777
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
2778
|
+
)`;
|
|
2779
|
+
const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2780
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2781
|
+
)`;
|
|
2835
2782
|
const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2836
2783
|
return /* @__PURE__ */ qwik._jsxQ("script", null, {
|
|
2837
2784
|
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
|
|
2838
2785
|
props
|
|
2839
2786
|
], "p0.scriptStr"),
|
|
2840
|
-
id: qwik._fnSignal((p0) => p0.id, [
|
|
2787
|
+
id: qwik._fnSignal((p0) => p0.id || "", [
|
|
2841
2788
|
props
|
|
2842
|
-
],
|
|
2789
|
+
], 'p0.id||""')
|
|
2843
2790
|
}, null, 3, "WO_0");
|
|
2844
2791
|
}, "InlinedScript_component_hwThBdhA8rw"));
|
|
2845
2792
|
function getGlobalThis() {
|
|
@@ -3219,7 +3166,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3219
3166
|
}
|
|
3220
3167
|
};
|
|
3221
3168
|
};
|
|
3222
|
-
const SDK_VERSION = "0.7.
|
|
3169
|
+
const SDK_VERSION = "0.7.5";
|
|
3223
3170
|
const registry = {};
|
|
3224
3171
|
function register(type, info) {
|
|
3225
3172
|
let typeList = registry[type];
|
|
@@ -3477,7 +3424,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3477
3424
|
}));
|
|
3478
3425
|
};
|
|
3479
3426
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3480
|
-
var _a, _b, _c;
|
|
3427
|
+
var _a, _b, _c, _d, _e;
|
|
3481
3428
|
qwik._jsxBranch();
|
|
3482
3429
|
const elementRef = qwik.useSignal();
|
|
3483
3430
|
const state = qwik.useStore({
|
|
@@ -3537,7 +3484,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3537
3484
|
state
|
|
3538
3485
|
]));
|
|
3539
3486
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
3540
|
-
var _a2, _b2, _c2,
|
|
3487
|
+
var _a2, _b2, _c2, _d2;
|
|
3541
3488
|
if (isBrowser()) {
|
|
3542
3489
|
if (isEditing() && element)
|
|
3543
3490
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
@@ -3545,7 +3492,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3545
3492
|
if (shouldTrackImpression) {
|
|
3546
3493
|
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
3547
3494
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
3548
|
-
const apiKeyProp = (
|
|
3495
|
+
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
3549
3496
|
_track({
|
|
3550
3497
|
type: "impression",
|
|
3551
3498
|
canTrack: true,
|
|
@@ -3643,7 +3590,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3643
3590
|
hidden: true,
|
|
3644
3591
|
"aria-hidden": true
|
|
3645
3592
|
},
|
|
3646
|
-
class: props.
|
|
3593
|
+
class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
|
|
3647
3594
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
|
|
3648
3595
|
}, 1, "06_1");
|
|
3649
3596
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
@@ -3730,22 +3677,19 @@ ${getFontCss({
|
|
|
3730
3677
|
const getContextStateInitialValue = ({ content, data, locale }) => {
|
|
3731
3678
|
var _a, _b, _c;
|
|
3732
3679
|
const defaultValues = {};
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
if (input.name && input.defaultValue !== void 0
|
|
3680
|
+
const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
|
|
3681
|
+
(_c = (_b = content == null ? void 0 : content.data) == null ? void 0 : _b.inputs) == null ? void 0 : _c.forEach((input) => {
|
|
3682
|
+
if (input.name && input.defaultValue !== void 0)
|
|
3736
3683
|
defaultValues[input.name] = input.defaultValue;
|
|
3737
3684
|
});
|
|
3738
|
-
|
|
3739
|
-
...
|
|
3685
|
+
return {
|
|
3686
|
+
...defaultValues,
|
|
3687
|
+
...initialState,
|
|
3740
3688
|
...data,
|
|
3741
3689
|
...locale ? {
|
|
3742
3690
|
locale
|
|
3743
3691
|
} : {}
|
|
3744
3692
|
};
|
|
3745
|
-
return {
|
|
3746
|
-
...defaultValues,
|
|
3747
|
-
...stateToUse
|
|
3748
|
-
};
|
|
3749
3693
|
};
|
|
3750
3694
|
const getContentInitialValue = ({ content, data }) => {
|
|
3751
3695
|
return !content ? void 0 : {
|
|
@@ -3807,7 +3751,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3807
3751
|
...serializeComponentInfo(info)
|
|
3808
3752
|
}
|
|
3809
3753
|
}), {}),
|
|
3810
|
-
scriptStr:
|
|
3754
|
+
scriptStr: getUpdateVariantVisibilityScript({
|
|
3811
3755
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3812
3756
|
variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
|
|
3813
3757
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -3844,9 +3788,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3844
3788
|
get enrich() {
|
|
3845
3789
|
return props.enrich;
|
|
3846
3790
|
},
|
|
3847
|
-
get classNameProp() {
|
|
3848
|
-
return props.classNameProp;
|
|
3849
|
-
},
|
|
3850
3791
|
get showContent() {
|
|
3851
3792
|
return props.showContent;
|
|
3852
3793
|
},
|
|
@@ -3935,9 +3876,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3935
3876
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
3936
3877
|
props
|
|
3937
3878
|
], "p0.canTrack"),
|
|
3938
|
-
classNameProp: qwik._fnSignal((p0) => p0.classNameProp, [
|
|
3939
|
-
props
|
|
3940
|
-
], "p0.classNameProp"),
|
|
3941
3879
|
content: qwik._fnSignal((p0) => p0.content, [
|
|
3942
3880
|
props
|
|
3943
3881
|
], "p0.content"),
|
|
@@ -3965,19 +3903,19 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3965
3903
|
const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3966
3904
|
qwik._jsxBranch();
|
|
3967
3905
|
const state = qwik.useStore({
|
|
3968
|
-
shouldRenderVariants:
|
|
3906
|
+
shouldRenderVariants: checkShouldRenderVariants({
|
|
3969
3907
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
3970
3908
|
content: props.content
|
|
3971
3909
|
})
|
|
3972
3910
|
});
|
|
3973
|
-
const
|
|
3911
|
+
const updateCookieAndStylesScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3974
3912
|
var _a;
|
|
3975
3913
|
const [props2] = qwik.useLexicalScope();
|
|
3976
|
-
return
|
|
3914
|
+
return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
|
|
3977
3915
|
id: value.testVariationId,
|
|
3978
3916
|
testRatio: value.testRatio
|
|
3979
3917
|
})), ((_a = props2.content) == null ? void 0 : _a.id) || "");
|
|
3980
|
-
}, "
|
|
3918
|
+
}, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
|
|
3981
3919
|
props
|
|
3982
3920
|
]));
|
|
3983
3921
|
const hideVariantsStyleString = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -4034,11 +3972,11 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4034
3972
|
}, 3, "XM_1"),
|
|
4035
3973
|
/* @__PURE__ */ qwik._jsxC(InlinedScript, {
|
|
4036
3974
|
get scriptStr() {
|
|
4037
|
-
return
|
|
3975
|
+
return updateCookieAndStylesScriptStr.value;
|
|
4038
3976
|
},
|
|
4039
3977
|
[qwik._IMMUTABLE]: {
|
|
4040
3978
|
scriptStr: qwik._fnSignal((p0) => p0.value, [
|
|
4041
|
-
|
|
3979
|
+
updateCookieAndStylesScriptStr
|
|
4042
3980
|
], "p0.value")
|
|
4043
3981
|
}
|
|
4044
3982
|
}, 3, "XM_2"),
|
|
@@ -4046,9 +3984,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4046
3984
|
return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
|
|
4047
3985
|
content: variant,
|
|
4048
3986
|
showContent: false,
|
|
4049
|
-
get classNameProp() {
|
|
4050
|
-
return void 0;
|
|
4051
|
-
},
|
|
4052
3987
|
get model() {
|
|
4053
3988
|
return props.model;
|
|
4054
3989
|
},
|
|
@@ -4092,7 +4027,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4092
4027
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4093
4028
|
props
|
|
4094
4029
|
], "p0.canTrack"),
|
|
4095
|
-
classNameProp: qwik._IMMUTABLE,
|
|
4096
4030
|
context: qwik._fnSignal((p0) => p0.context, [
|
|
4097
4031
|
props
|
|
4098
4032
|
], "p0.context"),
|
|
@@ -4127,10 +4061,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4127
4061
|
get content() {
|
|
4128
4062
|
return defaultContent.value;
|
|
4129
4063
|
},
|
|
4130
|
-
get classNameProp() {
|
|
4131
|
-
var _a;
|
|
4132
|
-
return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
|
|
4133
|
-
},
|
|
4134
4064
|
showContent: true,
|
|
4135
4065
|
get model() {
|
|
4136
4066
|
return props.model;
|
|
@@ -4175,12 +4105,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4175
4105
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4176
4106
|
props
|
|
4177
4107
|
], "p0.canTrack"),
|
|
4178
|
-
classNameProp: qwik._fnSignal((p0) => {
|
|
4179
|
-
var _a;
|
|
4180
|
-
return `variant-${(_a = p0.content) == null ? void 0 : _a.id}`;
|
|
4181
|
-
}, [
|
|
4182
|
-
props
|
|
4183
|
-
], "`variant-${p0.content?.id}`"),
|
|
4184
4108
|
content: qwik._fnSignal((p0) => p0.value, [
|
|
4185
4109
|
defaultContent
|
|
4186
4110
|
], "p0.value"),
|