@builder.io/sdk-qwik 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/lib/browser/index.qwik.cjs +98 -176
- package/lib/browser/index.qwik.mjs +98 -176
- package/lib/edge/index.qwik.cjs +98 -176
- package/lib/edge/index.qwik.mjs +98 -176
- package/lib/node/index.qwik.cjs +98 -176
- package/lib/node/index.qwik.mjs +98 -176
- package/package.json +8 -1
- package/types/src/blocks/video/video.d.ts +4 -0
- 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
|
@@ -2575,6 +2575,8 @@ const componentInfo = {
|
|
|
2575
2575
|
]
|
|
2576
2576
|
};
|
|
2577
2577
|
const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2578
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2579
|
+
qwik._jsxBranch();
|
|
2578
2580
|
const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2579
2581
|
const [props2] = qwik.useLexicalScope();
|
|
2580
2582
|
return {
|
|
@@ -2598,43 +2600,83 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2598
2600
|
props
|
|
2599
2601
|
]));
|
|
2600
2602
|
const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2601
|
-
const [
|
|
2603
|
+
const [videoProps2] = qwik.useLexicalScope();
|
|
2602
2604
|
return {
|
|
2603
|
-
...props2.attributes,
|
|
2604
2605
|
...videoProps2.value
|
|
2605
2606
|
};
|
|
2606
2607
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
2607
|
-
props,
|
|
2608
2608
|
videoProps
|
|
2609
2609
|
]));
|
|
2610
|
-
return /* @__PURE__ */ qwik.
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
props
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
return {
|
|
2610
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2611
|
+
style: {
|
|
2612
|
+
position: "relative"
|
|
2613
|
+
}
|
|
2614
|
+
}, [
|
|
2615
|
+
/* @__PURE__ */ qwik._jsxS("video", {
|
|
2616
|
+
...spreadProps.value,
|
|
2617
|
+
children: !props.lazyLoad ? /* @__PURE__ */ qwik._jsxQ("source", null, {
|
|
2618
|
+
src: qwik._fnSignal((p0) => p0.video, [
|
|
2619
|
+
props
|
|
2620
|
+
], "p0.video"),
|
|
2621
|
+
type: "video/mp4"
|
|
2622
|
+
}, null, 3, "j7_0") : null,
|
|
2623
|
+
style: {
|
|
2625
2624
|
width: "100%",
|
|
2626
2625
|
height: "100%",
|
|
2627
|
-
...(_a =
|
|
2628
|
-
objectFit:
|
|
2629
|
-
objectPosition:
|
|
2626
|
+
...(_a = props.attributes) == null ? void 0 : _a.style,
|
|
2627
|
+
objectFit: props.fit,
|
|
2628
|
+
objectPosition: props.position,
|
|
2630
2629
|
// Hack to get object fit to work as expected and
|
|
2631
2630
|
// not have the video overflow
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2631
|
+
zIndex: 2,
|
|
2632
|
+
borderRadius: "1px",
|
|
2633
|
+
...props.aspectRatio ? {
|
|
2634
|
+
position: "absolute"
|
|
2635
|
+
} : null
|
|
2636
|
+
}
|
|
2637
|
+
}, {
|
|
2638
|
+
class: "builder-video",
|
|
2639
|
+
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
2640
|
+
props
|
|
2641
|
+
], "p0.posterImage"),
|
|
2642
|
+
preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
|
|
2643
|
+
props
|
|
2644
|
+
], 'p0.preload||"metadata"'),
|
|
2645
|
+
src: qwik._fnSignal((p0) => p0.video || "no-src", [
|
|
2646
|
+
props
|
|
2647
|
+
], 'p0.video||"no-src"')
|
|
2648
|
+
}, 0, null),
|
|
2649
|
+
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2650
|
+
style: qwik._fnSignal((p0) => ({
|
|
2651
|
+
width: "100%",
|
|
2652
|
+
paddingTop: p0.aspectRatio * 100 + "%",
|
|
2653
|
+
pointerEvents: "none",
|
|
2654
|
+
fontSize: "0px"
|
|
2655
|
+
}), [
|
|
2656
|
+
props
|
|
2657
|
+
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
2658
|
+
}, null, 3, "j7_1") : null,
|
|
2659
|
+
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2660
|
+
style: {
|
|
2661
|
+
display: "flex",
|
|
2662
|
+
flexDirection: "column",
|
|
2663
|
+
alignItems: "stretch"
|
|
2664
|
+
}
|
|
2665
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_2"), 1, "j7_3") : null,
|
|
2666
|
+
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2667
|
+
style: {
|
|
2668
|
+
pointerEvents: "none",
|
|
2669
|
+
display: "flex",
|
|
2670
|
+
flexDirection: "column",
|
|
2671
|
+
alignItems: "stretch",
|
|
2672
|
+
position: "absolute",
|
|
2673
|
+
top: "0",
|
|
2674
|
+
left: "0",
|
|
2675
|
+
width: "100%",
|
|
2676
|
+
height: "100%"
|
|
2677
|
+
}
|
|
2678
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
2679
|
+
], 1, "j7_6");
|
|
2638
2680
|
}, "Video_component_qdcTZflYyoQ"));
|
|
2639
2681
|
const getDefaultRegisteredComponents = () => [
|
|
2640
2682
|
{
|
|
@@ -2700,12 +2742,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
|
|
|
2700
2742
|
[key]: serializeValue(value)
|
|
2701
2743
|
}), {}))
|
|
2702
2744
|
});
|
|
2745
|
+
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}";
|
|
2746
|
+
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}";
|
|
2747
|
+
const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
2748
|
+
const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
2703
2749
|
const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
|
|
2704
2750
|
...variant,
|
|
2705
2751
|
testVariationId: variant.id,
|
|
2706
2752
|
id: content == null ? void 0 : content.id
|
|
2707
2753
|
}));
|
|
2708
|
-
const
|
|
2754
|
+
const checkShouldRenderVariants = ({ canTrack, content }) => {
|
|
2709
2755
|
const hasVariants = getVariants(content).length > 0;
|
|
2710
2756
|
if (!hasVariants)
|
|
2711
2757
|
return false;
|
|
@@ -2715,131 +2761,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
|
|
|
2715
2761
|
return false;
|
|
2716
2762
|
return true;
|
|
2717
2763
|
};
|
|
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
2764
|
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
2816
2765
|
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}
|
|
2766
|
+
const getScriptString = () => `
|
|
2767
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2768
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2825
2769
|
`;
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
2834
|
-
};
|
|
2770
|
+
const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
2771
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2772
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
2773
|
+
)`;
|
|
2774
|
+
const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2775
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2776
|
+
)`;
|
|
2835
2777
|
const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2836
2778
|
return /* @__PURE__ */ qwik._jsxQ("script", null, {
|
|
2837
2779
|
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
|
|
2838
2780
|
props
|
|
2839
2781
|
], "p0.scriptStr"),
|
|
2840
|
-
id: qwik._fnSignal((p0) => p0.id, [
|
|
2782
|
+
id: qwik._fnSignal((p0) => p0.id || "", [
|
|
2841
2783
|
props
|
|
2842
|
-
],
|
|
2784
|
+
], 'p0.id||""')
|
|
2843
2785
|
}, null, 3, "WO_0");
|
|
2844
2786
|
}, "InlinedScript_component_hwThBdhA8rw"));
|
|
2845
2787
|
function getGlobalThis() {
|
|
@@ -3219,7 +3161,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3219
3161
|
}
|
|
3220
3162
|
};
|
|
3221
3163
|
};
|
|
3222
|
-
const SDK_VERSION = "0.7.
|
|
3164
|
+
const SDK_VERSION = "0.7.4";
|
|
3223
3165
|
const registry = {};
|
|
3224
3166
|
function register(type, info) {
|
|
3225
3167
|
let typeList = registry[type];
|
|
@@ -3477,7 +3419,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3477
3419
|
}));
|
|
3478
3420
|
};
|
|
3479
3421
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3480
|
-
var _a, _b, _c;
|
|
3422
|
+
var _a, _b, _c, _d, _e;
|
|
3481
3423
|
qwik._jsxBranch();
|
|
3482
3424
|
const elementRef = qwik.useSignal();
|
|
3483
3425
|
const state = qwik.useStore({
|
|
@@ -3537,7 +3479,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3537
3479
|
state
|
|
3538
3480
|
]));
|
|
3539
3481
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
3540
|
-
var _a2, _b2, _c2,
|
|
3482
|
+
var _a2, _b2, _c2, _d2;
|
|
3541
3483
|
if (isBrowser()) {
|
|
3542
3484
|
if (isEditing() && element)
|
|
3543
3485
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
@@ -3545,7 +3487,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3545
3487
|
if (shouldTrackImpression) {
|
|
3546
3488
|
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
3547
3489
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
3548
|
-
const apiKeyProp = (
|
|
3490
|
+
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
3549
3491
|
_track({
|
|
3550
3492
|
type: "impression",
|
|
3551
3493
|
canTrack: true,
|
|
@@ -3643,7 +3585,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3643
3585
|
hidden: true,
|
|
3644
3586
|
"aria-hidden": true
|
|
3645
3587
|
},
|
|
3646
|
-
class: props.
|
|
3588
|
+
class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
|
|
3647
3589
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
|
|
3648
3590
|
}, 1, "06_1");
|
|
3649
3591
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
@@ -3807,7 +3749,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3807
3749
|
...serializeComponentInfo(info)
|
|
3808
3750
|
}
|
|
3809
3751
|
}), {}),
|
|
3810
|
-
scriptStr:
|
|
3752
|
+
scriptStr: getUpdateVariantVisibilityScript({
|
|
3811
3753
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3812
3754
|
variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
|
|
3813
3755
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -3844,9 +3786,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3844
3786
|
get enrich() {
|
|
3845
3787
|
return props.enrich;
|
|
3846
3788
|
},
|
|
3847
|
-
get classNameProp() {
|
|
3848
|
-
return props.classNameProp;
|
|
3849
|
-
},
|
|
3850
3789
|
get showContent() {
|
|
3851
3790
|
return props.showContent;
|
|
3852
3791
|
},
|
|
@@ -3935,9 +3874,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3935
3874
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
3936
3875
|
props
|
|
3937
3876
|
], "p0.canTrack"),
|
|
3938
|
-
classNameProp: qwik._fnSignal((p0) => p0.classNameProp, [
|
|
3939
|
-
props
|
|
3940
|
-
], "p0.classNameProp"),
|
|
3941
3877
|
content: qwik._fnSignal((p0) => p0.content, [
|
|
3942
3878
|
props
|
|
3943
3879
|
], "p0.content"),
|
|
@@ -3965,19 +3901,19 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3965
3901
|
const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3966
3902
|
qwik._jsxBranch();
|
|
3967
3903
|
const state = qwik.useStore({
|
|
3968
|
-
shouldRenderVariants:
|
|
3904
|
+
shouldRenderVariants: checkShouldRenderVariants({
|
|
3969
3905
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
3970
3906
|
content: props.content
|
|
3971
3907
|
})
|
|
3972
3908
|
});
|
|
3973
|
-
const
|
|
3909
|
+
const updateCookieAndStylesScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3974
3910
|
var _a;
|
|
3975
3911
|
const [props2] = qwik.useLexicalScope();
|
|
3976
|
-
return
|
|
3912
|
+
return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
|
|
3977
3913
|
id: value.testVariationId,
|
|
3978
3914
|
testRatio: value.testRatio
|
|
3979
3915
|
})), ((_a = props2.content) == null ? void 0 : _a.id) || "");
|
|
3980
|
-
}, "
|
|
3916
|
+
}, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
|
|
3981
3917
|
props
|
|
3982
3918
|
]));
|
|
3983
3919
|
const hideVariantsStyleString = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -4034,11 +3970,11 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4034
3970
|
}, 3, "XM_1"),
|
|
4035
3971
|
/* @__PURE__ */ qwik._jsxC(InlinedScript, {
|
|
4036
3972
|
get scriptStr() {
|
|
4037
|
-
return
|
|
3973
|
+
return updateCookieAndStylesScriptStr.value;
|
|
4038
3974
|
},
|
|
4039
3975
|
[qwik._IMMUTABLE]: {
|
|
4040
3976
|
scriptStr: qwik._fnSignal((p0) => p0.value, [
|
|
4041
|
-
|
|
3977
|
+
updateCookieAndStylesScriptStr
|
|
4042
3978
|
], "p0.value")
|
|
4043
3979
|
}
|
|
4044
3980
|
}, 3, "XM_2"),
|
|
@@ -4046,9 +3982,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4046
3982
|
return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
|
|
4047
3983
|
content: variant,
|
|
4048
3984
|
showContent: false,
|
|
4049
|
-
get classNameProp() {
|
|
4050
|
-
return void 0;
|
|
4051
|
-
},
|
|
4052
3985
|
get model() {
|
|
4053
3986
|
return props.model;
|
|
4054
3987
|
},
|
|
@@ -4092,7 +4025,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4092
4025
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4093
4026
|
props
|
|
4094
4027
|
], "p0.canTrack"),
|
|
4095
|
-
classNameProp: qwik._IMMUTABLE,
|
|
4096
4028
|
context: qwik._fnSignal((p0) => p0.context, [
|
|
4097
4029
|
props
|
|
4098
4030
|
], "p0.context"),
|
|
@@ -4127,10 +4059,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4127
4059
|
get content() {
|
|
4128
4060
|
return defaultContent.value;
|
|
4129
4061
|
},
|
|
4130
|
-
get classNameProp() {
|
|
4131
|
-
var _a;
|
|
4132
|
-
return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
|
|
4133
|
-
},
|
|
4134
4062
|
showContent: true,
|
|
4135
4063
|
get model() {
|
|
4136
4064
|
return props.model;
|
|
@@ -4175,12 +4103,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4175
4103
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4176
4104
|
props
|
|
4177
4105
|
], "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
4106
|
content: qwik._fnSignal((p0) => p0.value, [
|
|
4185
4107
|
defaultContent
|
|
4186
4108
|
], "p0.value"),
|