@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
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -820,8 +820,9 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
820
820
|
props
|
|
821
821
|
]));
|
|
822
822
|
const processedBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
823
|
-
|
|
824
|
-
|
|
823
|
+
var _a2;
|
|
824
|
+
const [props2] = qwik.useLexicalScope();
|
|
825
|
+
return ((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) ? props2.block : getProcessedBlock({
|
|
825
826
|
block: props2.block,
|
|
826
827
|
localState: props2.context.localState,
|
|
827
828
|
rootState: props2.context.rootState,
|
|
@@ -830,8 +831,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
830
831
|
shouldEvaluateBindings: true
|
|
831
832
|
});
|
|
832
833
|
}, "Block_component_processedBlock_useComputed_ESKw0l5FcBc", [
|
|
833
|
-
props
|
|
834
|
-
repeatItem
|
|
834
|
+
props
|
|
835
835
|
]));
|
|
836
836
|
const Tag = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
837
837
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -840,14 +840,19 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
840
840
|
props
|
|
841
841
|
]));
|
|
842
842
|
const canShowBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
843
|
-
|
|
843
|
+
var _a2, _b;
|
|
844
|
+
const [processedBlock2, props2, repeatItem2] = qwik.useLexicalScope();
|
|
844
845
|
if ("hide" in processedBlock2.value)
|
|
845
846
|
return !processedBlock2.value.hide;
|
|
846
847
|
if ("show" in processedBlock2.value)
|
|
847
848
|
return processedBlock2.value.show;
|
|
849
|
+
if (((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) && !((_b = repeatItem2.value) == null ? void 0 : _b.length))
|
|
850
|
+
return false;
|
|
848
851
|
return true;
|
|
849
852
|
}, "Block_component_canShowBlock_useComputed_NJEFz8ICF08", [
|
|
850
|
-
processedBlock
|
|
853
|
+
processedBlock,
|
|
854
|
+
props,
|
|
855
|
+
repeatItem
|
|
851
856
|
]));
|
|
852
857
|
const childrenWithoutParentComponent = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
853
858
|
var _a2;
|
|
@@ -2676,6 +2681,8 @@ const componentInfo = {
|
|
|
2676
2681
|
]
|
|
2677
2682
|
};
|
|
2678
2683
|
const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2684
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2685
|
+
qwik._jsxBranch();
|
|
2679
2686
|
const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2680
2687
|
const [props2] = qwik.useLexicalScope();
|
|
2681
2688
|
return {
|
|
@@ -2699,43 +2706,83 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
2699
2706
|
props
|
|
2700
2707
|
]));
|
|
2701
2708
|
const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2702
|
-
const [
|
|
2709
|
+
const [videoProps2] = qwik.useLexicalScope();
|
|
2703
2710
|
return {
|
|
2704
|
-
...props2.attributes,
|
|
2705
2711
|
...videoProps2.value
|
|
2706
2712
|
};
|
|
2707
2713
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
2708
|
-
props,
|
|
2709
2714
|
videoProps
|
|
2710
2715
|
]));
|
|
2711
|
-
return /* @__PURE__ */ qwik.
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
props
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
return {
|
|
2716
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2717
|
+
style: {
|
|
2718
|
+
position: "relative"
|
|
2719
|
+
}
|
|
2720
|
+
}, [
|
|
2721
|
+
/* @__PURE__ */ qwik._jsxS("video", {
|
|
2722
|
+
...spreadProps.value,
|
|
2723
|
+
children: !props.lazyLoad ? /* @__PURE__ */ qwik._jsxQ("source", null, {
|
|
2724
|
+
src: qwik._fnSignal((p0) => p0.video, [
|
|
2725
|
+
props
|
|
2726
|
+
], "p0.video"),
|
|
2727
|
+
type: "video/mp4"
|
|
2728
|
+
}, null, 3, "j7_0") : null,
|
|
2729
|
+
style: {
|
|
2726
2730
|
width: "100%",
|
|
2727
2731
|
height: "100%",
|
|
2728
|
-
...(_a =
|
|
2729
|
-
objectFit:
|
|
2730
|
-
objectPosition:
|
|
2732
|
+
...(_a = props.attributes) == null ? void 0 : _a.style,
|
|
2733
|
+
objectFit: props.fit,
|
|
2734
|
+
objectPosition: props.position,
|
|
2731
2735
|
// Hack to get object fit to work as expected and
|
|
2732
2736
|
// not have the video overflow
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2737
|
+
zIndex: 2,
|
|
2738
|
+
borderRadius: "1px",
|
|
2739
|
+
...props.aspectRatio ? {
|
|
2740
|
+
position: "absolute"
|
|
2741
|
+
} : null
|
|
2742
|
+
}
|
|
2743
|
+
}, {
|
|
2744
|
+
class: "builder-video",
|
|
2745
|
+
poster: qwik._fnSignal((p0) => p0.posterImage, [
|
|
2746
|
+
props
|
|
2747
|
+
], "p0.posterImage"),
|
|
2748
|
+
preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
|
|
2749
|
+
props
|
|
2750
|
+
], 'p0.preload||"metadata"'),
|
|
2751
|
+
src: qwik._fnSignal((p0) => p0.video || "no-src", [
|
|
2752
|
+
props
|
|
2753
|
+
], 'p0.video||"no-src"')
|
|
2754
|
+
}, 0, null),
|
|
2755
|
+
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2756
|
+
style: qwik._fnSignal((p0) => ({
|
|
2757
|
+
width: "100%",
|
|
2758
|
+
paddingTop: p0.aspectRatio * 100 + "%",
|
|
2759
|
+
pointerEvents: "none",
|
|
2760
|
+
fontSize: "0px"
|
|
2761
|
+
}), [
|
|
2762
|
+
props
|
|
2763
|
+
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
2764
|
+
}, null, 3, "j7_1") : null,
|
|
2765
|
+
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2766
|
+
style: {
|
|
2767
|
+
display: "flex",
|
|
2768
|
+
flexDirection: "column",
|
|
2769
|
+
alignItems: "stretch"
|
|
2770
|
+
}
|
|
2771
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_2"), 1, "j7_3") : null,
|
|
2772
|
+
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2773
|
+
style: {
|
|
2774
|
+
pointerEvents: "none",
|
|
2775
|
+
display: "flex",
|
|
2776
|
+
flexDirection: "column",
|
|
2777
|
+
alignItems: "stretch",
|
|
2778
|
+
position: "absolute",
|
|
2779
|
+
top: "0",
|
|
2780
|
+
left: "0",
|
|
2781
|
+
width: "100%",
|
|
2782
|
+
height: "100%"
|
|
2783
|
+
}
|
|
2784
|
+
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
2785
|
+
], 1, "j7_6");
|
|
2739
2786
|
}, "Video_component_qdcTZflYyoQ"));
|
|
2740
2787
|
const getDefaultRegisteredComponents = () => [
|
|
2741
2788
|
{
|
|
@@ -2801,12 +2848,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
|
|
|
2801
2848
|
[key]: serializeValue(value)
|
|
2802
2849
|
}), {}))
|
|
2803
2850
|
});
|
|
2851
|
+
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}";
|
|
2852
|
+
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}";
|
|
2853
|
+
const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
2854
|
+
const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
2804
2855
|
const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
|
|
2805
2856
|
...variant,
|
|
2806
2857
|
testVariationId: variant.id,
|
|
2807
2858
|
id: content == null ? void 0 : content.id
|
|
2808
2859
|
}));
|
|
2809
|
-
const
|
|
2860
|
+
const checkShouldRenderVariants = ({ canTrack, content }) => {
|
|
2810
2861
|
const hasVariants = getVariants(content).length > 0;
|
|
2811
2862
|
if (!hasVariants)
|
|
2812
2863
|
return false;
|
|
@@ -2816,131 +2867,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
|
|
|
2816
2867
|
return false;
|
|
2817
2868
|
return true;
|
|
2818
2869
|
};
|
|
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
2870
|
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
2917
2871
|
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}
|
|
2872
|
+
const getScriptString = () => `
|
|
2873
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2874
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2926
2875
|
`;
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
}
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
2935
|
-
};
|
|
2876
|
+
const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
2877
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2878
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
2879
|
+
)`;
|
|
2880
|
+
const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2881
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
2882
|
+
)`;
|
|
2936
2883
|
const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2937
2884
|
return /* @__PURE__ */ qwik._jsxQ("script", null, {
|
|
2938
2885
|
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
|
|
2939
2886
|
props
|
|
2940
2887
|
], "p0.scriptStr"),
|
|
2941
|
-
id: qwik._fnSignal((p0) => p0.id, [
|
|
2888
|
+
id: qwik._fnSignal((p0) => p0.id || "", [
|
|
2942
2889
|
props
|
|
2943
|
-
],
|
|
2890
|
+
], 'p0.id||""')
|
|
2944
2891
|
}, null, 3, "WO_0");
|
|
2945
2892
|
}, "InlinedScript_component_hwThBdhA8rw"));
|
|
2946
2893
|
function getGlobalThis() {
|
|
@@ -3320,7 +3267,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3320
3267
|
}
|
|
3321
3268
|
};
|
|
3322
3269
|
};
|
|
3323
|
-
const SDK_VERSION = "0.7.
|
|
3270
|
+
const SDK_VERSION = "0.7.5";
|
|
3324
3271
|
const registry = {};
|
|
3325
3272
|
function register(type, info) {
|
|
3326
3273
|
let typeList = registry[type];
|
|
@@ -3578,7 +3525,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3578
3525
|
}));
|
|
3579
3526
|
};
|
|
3580
3527
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3581
|
-
var _a, _b, _c;
|
|
3528
|
+
var _a, _b, _c, _d, _e;
|
|
3582
3529
|
qwik._jsxBranch();
|
|
3583
3530
|
const elementRef = qwik.useSignal();
|
|
3584
3531
|
const state = qwik.useStore({
|
|
@@ -3638,7 +3585,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3638
3585
|
state
|
|
3639
3586
|
]));
|
|
3640
3587
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
3641
|
-
var _a2, _b2, _c2,
|
|
3588
|
+
var _a2, _b2, _c2, _d2;
|
|
3642
3589
|
if (isBrowser()) {
|
|
3643
3590
|
if (isEditing() && element)
|
|
3644
3591
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
@@ -3646,7 +3593,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3646
3593
|
if (shouldTrackImpression) {
|
|
3647
3594
|
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
3648
3595
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
3649
|
-
const apiKeyProp = (
|
|
3596
|
+
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
3650
3597
|
_track({
|
|
3651
3598
|
type: "impression",
|
|
3652
3599
|
canTrack: true,
|
|
@@ -3744,7 +3691,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3744
3691
|
hidden: true,
|
|
3745
3692
|
"aria-hidden": true
|
|
3746
3693
|
},
|
|
3747
|
-
class: props.
|
|
3694
|
+
class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
|
|
3748
3695
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
|
|
3749
3696
|
}, 1, "06_1");
|
|
3750
3697
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
@@ -3831,22 +3778,19 @@ ${getFontCss({
|
|
|
3831
3778
|
const getContextStateInitialValue = ({ content, data, locale }) => {
|
|
3832
3779
|
var _a, _b, _c;
|
|
3833
3780
|
const defaultValues = {};
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
if (input.name && input.defaultValue !== void 0
|
|
3781
|
+
const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
|
|
3782
|
+
(_c = (_b = content == null ? void 0 : content.data) == null ? void 0 : _b.inputs) == null ? void 0 : _c.forEach((input) => {
|
|
3783
|
+
if (input.name && input.defaultValue !== void 0)
|
|
3837
3784
|
defaultValues[input.name] = input.defaultValue;
|
|
3838
3785
|
});
|
|
3839
|
-
|
|
3840
|
-
...
|
|
3786
|
+
return {
|
|
3787
|
+
...defaultValues,
|
|
3788
|
+
...initialState,
|
|
3841
3789
|
...data,
|
|
3842
3790
|
...locale ? {
|
|
3843
3791
|
locale
|
|
3844
3792
|
} : {}
|
|
3845
3793
|
};
|
|
3846
|
-
return {
|
|
3847
|
-
...defaultValues,
|
|
3848
|
-
...stateToUse
|
|
3849
|
-
};
|
|
3850
3794
|
};
|
|
3851
3795
|
const getContentInitialValue = ({ content, data }) => {
|
|
3852
3796
|
return !content ? void 0 : {
|
|
@@ -3908,7 +3852,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3908
3852
|
...serializeComponentInfo(info)
|
|
3909
3853
|
}
|
|
3910
3854
|
}), {}),
|
|
3911
|
-
scriptStr:
|
|
3855
|
+
scriptStr: getUpdateVariantVisibilityScript({
|
|
3912
3856
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3913
3857
|
variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
|
|
3914
3858
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -3945,9 +3889,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
3945
3889
|
get enrich() {
|
|
3946
3890
|
return props.enrich;
|
|
3947
3891
|
},
|
|
3948
|
-
get classNameProp() {
|
|
3949
|
-
return props.classNameProp;
|
|
3950
|
-
},
|
|
3951
3892
|
get showContent() {
|
|
3952
3893
|
return props.showContent;
|
|
3953
3894
|
},
|
|
@@ -4036,9 +3977,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
4036
3977
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4037
3978
|
props
|
|
4038
3979
|
], "p0.canTrack"),
|
|
4039
|
-
classNameProp: qwik._fnSignal((p0) => p0.classNameProp, [
|
|
4040
|
-
props
|
|
4041
|
-
], "p0.classNameProp"),
|
|
4042
3980
|
content: qwik._fnSignal((p0) => p0.content, [
|
|
4043
3981
|
props
|
|
4044
3982
|
], "p0.content"),
|
|
@@ -4066,19 +4004,19 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
|
|
|
4066
4004
|
const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
4067
4005
|
qwik._jsxBranch();
|
|
4068
4006
|
const state = qwik.useStore({
|
|
4069
|
-
shouldRenderVariants:
|
|
4007
|
+
shouldRenderVariants: checkShouldRenderVariants({
|
|
4070
4008
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
4071
4009
|
content: props.content
|
|
4072
4010
|
})
|
|
4073
4011
|
});
|
|
4074
|
-
const
|
|
4012
|
+
const updateCookieAndStylesScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
4075
4013
|
var _a;
|
|
4076
4014
|
const [props2] = qwik.useLexicalScope();
|
|
4077
|
-
return
|
|
4015
|
+
return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
|
|
4078
4016
|
id: value.testVariationId,
|
|
4079
4017
|
testRatio: value.testRatio
|
|
4080
4018
|
})), ((_a = props2.content) == null ? void 0 : _a.id) || "");
|
|
4081
|
-
}, "
|
|
4019
|
+
}, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
|
|
4082
4020
|
props
|
|
4083
4021
|
]));
|
|
4084
4022
|
const hideVariantsStyleString = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -4135,11 +4073,11 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4135
4073
|
}, 3, "XM_1"),
|
|
4136
4074
|
/* @__PURE__ */ qwik._jsxC(InlinedScript, {
|
|
4137
4075
|
get scriptStr() {
|
|
4138
|
-
return
|
|
4076
|
+
return updateCookieAndStylesScriptStr.value;
|
|
4139
4077
|
},
|
|
4140
4078
|
[qwik._IMMUTABLE]: {
|
|
4141
4079
|
scriptStr: qwik._fnSignal((p0) => p0.value, [
|
|
4142
|
-
|
|
4080
|
+
updateCookieAndStylesScriptStr
|
|
4143
4081
|
], "p0.value")
|
|
4144
4082
|
}
|
|
4145
4083
|
}, 3, "XM_2"),
|
|
@@ -4147,9 +4085,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4147
4085
|
return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
|
|
4148
4086
|
content: variant,
|
|
4149
4087
|
showContent: false,
|
|
4150
|
-
get classNameProp() {
|
|
4151
|
-
return void 0;
|
|
4152
|
-
},
|
|
4153
4088
|
get model() {
|
|
4154
4089
|
return props.model;
|
|
4155
4090
|
},
|
|
@@ -4193,7 +4128,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4193
4128
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4194
4129
|
props
|
|
4195
4130
|
], "p0.canTrack"),
|
|
4196
|
-
classNameProp: qwik._IMMUTABLE,
|
|
4197
4131
|
context: qwik._fnSignal((p0) => p0.context, [
|
|
4198
4132
|
props
|
|
4199
4133
|
], "p0.context"),
|
|
@@ -4228,10 +4162,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4228
4162
|
get content() {
|
|
4229
4163
|
return defaultContent.value;
|
|
4230
4164
|
},
|
|
4231
|
-
get classNameProp() {
|
|
4232
|
-
var _a;
|
|
4233
|
-
return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
|
|
4234
|
-
},
|
|
4235
4165
|
showContent: true,
|
|
4236
4166
|
get model() {
|
|
4237
4167
|
return props.model;
|
|
@@ -4276,12 +4206,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
4276
4206
|
canTrack: qwik._fnSignal((p0) => p0.canTrack, [
|
|
4277
4207
|
props
|
|
4278
4208
|
], "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
4209
|
content: qwik._fnSignal((p0) => p0.value, [
|
|
4286
4210
|
defaultContent
|
|
4287
4211
|
], "p0.value"),
|