@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
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -2676,6 +2676,8 @@ const componentInfo = {
|
|
|
2676
2676
|
]
|
|
2677
2677
|
};
|
|
2678
2678
|
const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2679
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2680
|
+
qwik._jsxBranch();
|
|
2679
2681
|
const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2680
2682
|
const [props2] = qwik.useLexicalScope();
|
|
2681
2683
|
return {
|
|
@@ -2699,43 +2701,83 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2699
2701
|
props
|
|
2700
2702
|
]));
|
|
2701
2703
|
const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2702
|
-
const [
|
|
2704
|
+
const [videoProps2] = qwik.useLexicalScope();
|
|
2703
2705
|
return {
|
|
2704
|
-
...props2.attributes,
|
|
2705
2706
|
...videoProps2.value
|
|
2706
2707
|
};
|
|
2707
2708
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
2708
|
-
props,
|
|
2709
2709
|
videoProps
|
|
2710
2710
|
]));
|
|
2711
|
-
return /* @__PURE__ */ qwik.
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
props
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
return {
|
|
2711
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2712
|
+
style: {
|
|
2713
|
+
position: "relative"
|
|
2714
|
+
}
|
|
2715
|
+
}, [
|
|
2716
|
+
/* @__PURE__ */ qwik._jsxS("video", {
|
|
2717
|
+
...spreadProps.value,
|
|
2718
|
+
children: !props.lazyLoad ? /* @__PURE__ */ qwik._jsxQ("source", null, {
|
|
2719
|
+
src: qwik._fnSignal((p0) => p0.video, [
|
|
2720
|
+
props
|
|
2721
|
+
], "p0.video"),
|
|
2722
|
+
type: "video/mp4"
|
|
2723
|
+
}, null, 3, "j7_0") : null,
|
|
2724
|
+
style: {
|
|
2726
2725
|
width: "100%",
|
|
2727
2726
|
height: "100%",
|
|
2728
|
-
...(_a =
|
|
2729
|
-
objectFit:
|
|
2730
|
-
objectPosition:
|
|
2727
|
+
...(_a = props.attributes) == null ? void 0 : _a.style,
|
|
2728
|
+
objectFit: props.fit,
|
|
2729
|
+
objectPosition: props.position,
|
|
2731
2730
|
// Hack to get object fit to work as expected and
|
|
2732
2731
|
// not have the video overflow
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2732
|
+
zIndex: 2,
|
|
2733
|
+
borderRadius: "1px",
|
|
2734
|
+
...props.aspectRatio ? {
|
|
2735
|
+
position: "absolute"
|
|
2736
|
+
} : null
|
|
2737
|
+
}
|
|
2738
|
+
}, {
|
|
2739
|
+
class: "builder-video",
|
|
2740
|
+
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
2741
|
+
props
|
|
2742
|
+
], "p0.posterImage"),
|
|
2743
|
+
preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
|
|
2744
|
+
props
|
|
2745
|
+
], 'p0.preload||"metadata"'),
|
|
2746
|
+
src: qwik._fnSignal((p0) => p0.video || "no-src", [
|
|
2747
|
+
props
|
|
2748
|
+
], 'p0.video||"no-src"')
|
|
2749
|
+
}, 0, null),
|
|
2750
|
+
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2751
|
+
style: qwik._fnSignal((p0) => ({
|
|
2752
|
+
width: "100%",
|
|
2753
|
+
paddingTop: p0.aspectRatio * 100 + "%",
|
|
2754
|
+
pointerEvents: "none",
|
|
2755
|
+
fontSize: "0px"
|
|
2756
|
+
}), [
|
|
2757
|
+
props
|
|
2758
|
+
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
2759
|
+
}, null, 3, "j7_1") : null,
|
|
2760
|
+
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2761
|
+
style: {
|
|
2762
|
+
display: "flex",
|
|
2763
|
+
flexDirection: "column",
|
|
2764
|
+
alignItems: "stretch"
|
|
2765
|
+
}
|
|
2766
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_2"), 1, "j7_3") : null,
|
|
2767
|
+
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2768
|
+
style: {
|
|
2769
|
+
pointerEvents: "none",
|
|
2770
|
+
display: "flex",
|
|
2771
|
+
flexDirection: "column",
|
|
2772
|
+
alignItems: "stretch",
|
|
2773
|
+
position: "absolute",
|
|
2774
|
+
top: "0",
|
|
2775
|
+
left: "0",
|
|
2776
|
+
width: "100%",
|
|
2777
|
+
height: "100%"
|
|
2778
|
+
}
|
|
2779
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
2780
|
+
], 1, "j7_6");
|
|
2739
2781
|
}, "Video_component_qdcTZflYyoQ"));
|
|
2740
2782
|
const getDefaultRegisteredComponents = () => [
|
|
2741
2783
|
{
|
|
@@ -2801,12 +2843,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
|
|
|
2801
2843
|
[key]: serializeValue(value)
|
|
2802
2844
|
}), {}))
|
|
2803
2845
|
});
|
|
2846
|
+
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}";
|
|
2847
|
+
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}";
|
|
2848
|
+
const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
2849
|
+
const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
2804
2850
|
const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
|
|
2805
2851
|
...variant,
|
|
2806
2852
|
testVariationId: variant.id,
|
|
2807
2853
|
id: content == null ? void 0 : content.id
|
|
2808
2854
|
}));
|
|
2809
|
-
const
|
|
2855
|
+
const checkShouldRenderVariants = ({ canTrack, content }) => {
|
|
2810
2856
|
const hasVariants = getVariants(content).length > 0;
|
|
2811
2857
|
if (!hasVariants)
|
|
2812
2858
|
return false;
|
|
@@ -2816,131 +2862,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
|
|
|
2816
2862
|
return false;
|
|
2817
2863
|
return true;
|
|
2818
2864
|
};
|
|
2819
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
2820
|
-
var _a;
|
|
2821
|
-
function getAndSetVariantId2() {
|
|
2822
|
-
function setCookie2(name, value, days) {
|
|
2823
|
-
let expires = "";
|
|
2824
|
-
if (days) {
|
|
2825
|
-
const date = /* @__PURE__ */ new Date();
|
|
2826
|
-
date.setTime(date.getTime() + days * 864e5);
|
|
2827
|
-
expires = "; expires=" + date.toUTCString();
|
|
2828
|
-
}
|
|
2829
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
2830
|
-
}
|
|
2831
|
-
function getCookie2(name) {
|
|
2832
|
-
const nameEQ = name + "=";
|
|
2833
|
-
const ca = document.cookie.split(";");
|
|
2834
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2835
|
-
let c = ca[i];
|
|
2836
|
-
while (c.charAt(0) === " ")
|
|
2837
|
-
c = c.substring(1, c.length);
|
|
2838
|
-
if (c.indexOf(nameEQ) === 0)
|
|
2839
|
-
return c.substring(nameEQ.length, c.length);
|
|
2840
|
-
}
|
|
2841
|
-
return null;
|
|
2842
|
-
}
|
|
2843
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
2844
|
-
const variantInCookie = getCookie2(cookieName);
|
|
2845
|
-
const availableIDs = variants.map((vr) => vr.id).concat(contentId);
|
|
2846
|
-
if (variantInCookie && availableIDs.includes(variantInCookie))
|
|
2847
|
-
return variantInCookie;
|
|
2848
|
-
let n = 0;
|
|
2849
|
-
const random = Math.random();
|
|
2850
|
-
for (let i = 0; i < variants.length; i++) {
|
|
2851
|
-
const variant = variants[i];
|
|
2852
|
-
const testRatio = variant.testRatio;
|
|
2853
|
-
n += testRatio;
|
|
2854
|
-
if (random < n) {
|
|
2855
|
-
setCookie2(cookieName, variant.id);
|
|
2856
|
-
return variant.id;
|
|
2857
|
-
}
|
|
2858
|
-
}
|
|
2859
|
-
setCookie2(cookieName, contentId);
|
|
2860
|
-
return contentId;
|
|
2861
|
-
}
|
|
2862
|
-
const winningVariantId = getAndSetVariantId2();
|
|
2863
|
-
const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
|
|
2864
|
-
if (isHydrationTarget2) {
|
|
2865
|
-
styleEl.remove();
|
|
2866
|
-
const thisScriptEl = document.currentScript;
|
|
2867
|
-
thisScriptEl == null ? void 0 : thisScriptEl.remove();
|
|
2868
|
-
} else {
|
|
2869
|
-
const newStyleStr = variants.concat({
|
|
2870
|
-
id: contentId
|
|
2871
|
-
}).filter((variant) => variant.id !== winningVariantId).map((value) => {
|
|
2872
|
-
return `.variant-${value.id} { display: none; }
|
|
2873
|
-
`;
|
|
2874
|
-
}).join("");
|
|
2875
|
-
styleEl.innerHTML = newStyleStr;
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
2879
|
-
var _a;
|
|
2880
|
-
if (!navigator.cookieEnabled)
|
|
2881
|
-
return;
|
|
2882
|
-
function getCookie2(name) {
|
|
2883
|
-
const nameEQ = name + "=";
|
|
2884
|
-
const ca = document.cookie.split(";");
|
|
2885
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2886
|
-
let c = ca[i];
|
|
2887
|
-
while (c.charAt(0) === " ")
|
|
2888
|
-
c = c.substring(1, c.length);
|
|
2889
|
-
if (c.indexOf(nameEQ) === 0)
|
|
2890
|
-
return c.substring(nameEQ.length, c.length);
|
|
2891
|
-
}
|
|
2892
|
-
return null;
|
|
2893
|
-
}
|
|
2894
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
2895
|
-
const variantId = getCookie2(cookieName);
|
|
2896
|
-
const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
|
|
2897
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
2898
|
-
if (variantId === variantContentId) {
|
|
2899
|
-
if (variantIsDefaultContent)
|
|
2900
|
-
return;
|
|
2901
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
|
|
2902
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
|
|
2903
|
-
} else {
|
|
2904
|
-
if (variantIsDefaultContent) {
|
|
2905
|
-
if (isHydrationTarget2)
|
|
2906
|
-
parentDiv == null ? void 0 : parentDiv.remove();
|
|
2907
|
-
else {
|
|
2908
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
|
|
2909
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
return;
|
|
2913
|
-
}
|
|
2914
|
-
return;
|
|
2915
|
-
}
|
|
2916
2865
|
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
2917
2866
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
2918
|
-
const
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
2922
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
2923
|
-
return `
|
|
2924
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
2925
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
2867
|
+
const getScriptString = () => `
|
|
2868
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2869
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2926
2870
|
`;
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
}
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
2935
|
-
};
|
|
2871
|
+
const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
2872
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2873
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
2874
|
+
)`;
|
|
2875
|
+
const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2876
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2877
|
+
)`;
|
|
2936
2878
|
const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2937
2879
|
return /* @__PURE__ */ qwik._jsxQ("script", null, {
|
|
2938
2880
|
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
|
|
2939
2881
|
props
|
|
2940
2882
|
], "p0.scriptStr"),
|
|
2941
|
-
id: qwik._fnSignal((p0) => p0.id, [
|
|
2883
|
+
id: qwik._fnSignal((p0) => p0.id || "", [
|
|
2942
2884
|
props
|
|
2943
|
-
],
|
|
2885
|
+
], 'p0.id||""')
|
|
2944
2886
|
}, null, 3, "WO_0");
|
|
2945
2887
|
}, "InlinedScript_component_hwThBdhA8rw"));
|
|
2946
2888
|
function getGlobalThis() {
|
|
@@ -3320,7 +3262,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3320
3262
|
}
|
|
3321
3263
|
};
|
|
3322
3264
|
};
|
|
3323
|
-
const SDK_VERSION = "0.7.
|
|
3265
|
+
const SDK_VERSION = "0.7.4";
|
|
3324
3266
|
const registry = {};
|
|
3325
3267
|
function register(type, info) {
|
|
3326
3268
|
let typeList = registry[type];
|
|
@@ -3578,7 +3520,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3578
3520
|
}));
|
|
3579
3521
|
};
|
|
3580
3522
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3581
|
-
var _a, _b, _c;
|
|
3523
|
+
var _a, _b, _c, _d, _e;
|
|
3582
3524
|
qwik._jsxBranch();
|
|
3583
3525
|
const elementRef = qwik.useSignal();
|
|
3584
3526
|
const state = qwik.useStore({
|
|
@@ -3638,7 +3580,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3638
3580
|
state
|
|
3639
3581
|
]));
|
|
3640
3582
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
3641
|
-
var _a2, _b2, _c2,
|
|
3583
|
+
var _a2, _b2, _c2, _d2;
|
|
3642
3584
|
if (isBrowser()) {
|
|
3643
3585
|
if (isEditing() && element)
|
|
3644
3586
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
@@ -3646,7 +3588,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3646
3588
|
if (shouldTrackImpression) {
|
|
3647
3589
|
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
3648
3590
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
3649
|
-
const apiKeyProp = (
|
|
3591
|
+
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
3650
3592
|
_track({
|
|
3651
3593
|
type: "impression",
|
|
3652
3594
|
canTrack: true,
|
|
@@ -3744,7 +3686,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3744
3686
|
hidden: true,
|
|
3745
3687
|
"aria-hidden": true
|
|
3746
3688
|
},
|
|
3747
|
-
class: props.
|
|
3689
|
+
class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
|
|
3748
3690
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
|
|
3749
3691
|
}, 1, "06_1");
|
|
3750
3692
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
@@ -3908,7 +3850,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3908
3850
|
...serializeComponentInfo(info)
|
|
3909
3851
|
}
|
|
3910
3852
|
}), {}),
|
|
3911
|
-
scriptStr:
|
|
3853
|
+
scriptStr: getUpdateVariantVisibilityScript({
|
|
3912
3854
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3913
3855
|
variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
|
|
3914
3856
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -3945,9 +3887,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3945
3887
|
get enrich() {
|
|
3946
3888
|
return props.enrich;
|
|
3947
3889
|
},
|
|
3948
|
-
get classNameProp() {
|
|
3949
|
-
return props.classNameProp;
|
|
3950
|
-
},
|
|
3951
3890
|
get showContent() {
|
|
3952
3891
|
return props.showContent;
|
|
3953
3892
|
},
|
|
@@ -4036,9 +3975,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
4036
3975
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4037
3976
|
props
|
|
4038
3977
|
], "p0.canTrack"),
|
|
4039
|
-
classNameProp: qwik._fnSignal((p0) => p0.classNameProp, [
|
|
4040
|
-
props
|
|
4041
|
-
], "p0.classNameProp"),
|
|
4042
3978
|
content: qwik._fnSignal((p0) => p0.content, [
|
|
4043
3979
|
props
|
|
4044
3980
|
], "p0.content"),
|
|
@@ -4066,19 +4002,19 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
4066
4002
|
const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
4067
4003
|
qwik._jsxBranch();
|
|
4068
4004
|
const state = qwik.useStore({
|
|
4069
|
-
shouldRenderVariants:
|
|
4005
|
+
shouldRenderVariants: checkShouldRenderVariants({
|
|
4070
4006
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
4071
4007
|
content: props.content
|
|
4072
4008
|
})
|
|
4073
4009
|
});
|
|
4074
|
-
const
|
|
4010
|
+
const updateCookieAndStylesScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
4075
4011
|
var _a;
|
|
4076
4012
|
const [props2] = qwik.useLexicalScope();
|
|
4077
|
-
return
|
|
4013
|
+
return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
|
|
4078
4014
|
id: value.testVariationId,
|
|
4079
4015
|
testRatio: value.testRatio
|
|
4080
4016
|
})), ((_a = props2.content) == null ? void 0 : _a.id) || "");
|
|
4081
|
-
}, "
|
|
4017
|
+
}, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
|
|
4082
4018
|
props
|
|
4083
4019
|
]));
|
|
4084
4020
|
const hideVariantsStyleString = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -4135,11 +4071,11 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4135
4071
|
}, 3, "XM_1"),
|
|
4136
4072
|
/* @__PURE__ */ qwik._jsxC(InlinedScript, {
|
|
4137
4073
|
get scriptStr() {
|
|
4138
|
-
return
|
|
4074
|
+
return updateCookieAndStylesScriptStr.value;
|
|
4139
4075
|
},
|
|
4140
4076
|
[qwik._IMMUTABLE]: {
|
|
4141
4077
|
scriptStr: qwik._fnSignal((p0) => p0.value, [
|
|
4142
|
-
|
|
4078
|
+
updateCookieAndStylesScriptStr
|
|
4143
4079
|
], "p0.value")
|
|
4144
4080
|
}
|
|
4145
4081
|
}, 3, "XM_2"),
|
|
@@ -4147,9 +4083,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4147
4083
|
return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
|
|
4148
4084
|
content: variant,
|
|
4149
4085
|
showContent: false,
|
|
4150
|
-
get classNameProp() {
|
|
4151
|
-
return void 0;
|
|
4152
|
-
},
|
|
4153
4086
|
get model() {
|
|
4154
4087
|
return props.model;
|
|
4155
4088
|
},
|
|
@@ -4193,7 +4126,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4193
4126
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4194
4127
|
props
|
|
4195
4128
|
], "p0.canTrack"),
|
|
4196
|
-
classNameProp: qwik._IMMUTABLE,
|
|
4197
4129
|
context: qwik._fnSignal((p0) => p0.context, [
|
|
4198
4130
|
props
|
|
4199
4131
|
], "p0.context"),
|
|
@@ -4228,10 +4160,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4228
4160
|
get content() {
|
|
4229
4161
|
return defaultContent.value;
|
|
4230
4162
|
},
|
|
4231
|
-
get classNameProp() {
|
|
4232
|
-
var _a;
|
|
4233
|
-
return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
|
|
4234
|
-
},
|
|
4235
4163
|
showContent: true,
|
|
4236
4164
|
get model() {
|
|
4237
4165
|
return props.model;
|
|
@@ -4276,12 +4204,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4276
4204
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4277
4205
|
props
|
|
4278
4206
|
], "p0.canTrack"),
|
|
4279
|
-
classNameProp: qwik._fnSignal((p0) => {
|
|
4280
|
-
var _a;
|
|
4281
|
-
return `variant-${(_a = p0.content) == null ? void 0 : _a.id}`;
|
|
4282
|
-
}, [
|
|
4283
|
-
props
|
|
4284
|
-
], "`variant-${p0.content?.id}`"),
|
|
4285
4207
|
content: qwik._fnSignal((p0) => p0.value, [
|
|
4286
4208
|
defaultContent
|
|
4287
4209
|
], "p0.value"),
|