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