@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/edge/index.qwik.mjs
CHANGED
|
@@ -5804,6 +5804,8 @@ const componentInfo = {
|
|
|
5804
5804
|
]
|
|
5805
5805
|
};
|
|
5806
5806
|
const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
5807
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5808
|
+
_jsxBranch();
|
|
5807
5809
|
const videoProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
5808
5810
|
const [props2] = useLexicalScope();
|
|
5809
5811
|
return {
|
|
@@ -5827,43 +5829,83 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
5827
5829
|
props
|
|
5828
5830
|
]));
|
|
5829
5831
|
const spreadProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
5830
|
-
const [
|
|
5832
|
+
const [videoProps2] = useLexicalScope();
|
|
5831
5833
|
return {
|
|
5832
|
-
...props2.attributes,
|
|
5833
5834
|
...videoProps2.value
|
|
5834
5835
|
};
|
|
5835
5836
|
}, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
|
|
5836
|
-
props,
|
|
5837
5837
|
videoProps
|
|
5838
5838
|
]));
|
|
5839
|
-
return /* @__PURE__ */
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
props
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
return {
|
|
5839
|
+
return /* @__PURE__ */ _jsxQ("div", null, {
|
|
5840
|
+
style: {
|
|
5841
|
+
position: "relative"
|
|
5842
|
+
}
|
|
5843
|
+
}, [
|
|
5844
|
+
/* @__PURE__ */ _jsxS("video", {
|
|
5845
|
+
...spreadProps.value,
|
|
5846
|
+
children: !props.lazyLoad ? /* @__PURE__ */ _jsxQ("source", null, {
|
|
5847
|
+
src: _fnSignal((p0) => p0.video, [
|
|
5848
|
+
props
|
|
5849
|
+
], "p0.video"),
|
|
5850
|
+
type: "video/mp4"
|
|
5851
|
+
}, null, 3, "j7_0") : null,
|
|
5852
|
+
style: {
|
|
5854
5853
|
width: "100%",
|
|
5855
5854
|
height: "100%",
|
|
5856
|
-
...(_a =
|
|
5857
|
-
objectFit:
|
|
5858
|
-
objectPosition:
|
|
5855
|
+
...(_a = props.attributes) == null ? void 0 : _a.style,
|
|
5856
|
+
objectFit: props.fit,
|
|
5857
|
+
objectPosition: props.position,
|
|
5859
5858
|
// Hack to get object fit to work as expected and
|
|
5860
5859
|
// not have the video overflow
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5860
|
+
zIndex: 2,
|
|
5861
|
+
borderRadius: "1px",
|
|
5862
|
+
...props.aspectRatio ? {
|
|
5863
|
+
position: "absolute"
|
|
5864
|
+
} : null
|
|
5865
|
+
}
|
|
5866
|
+
}, {
|
|
5867
|
+
class: "builder-video",
|
|
5868
|
+
poster: _fnSignal((p0) => p0.posterImage, [
|
|
5869
|
+
props
|
|
5870
|
+
], "p0.posterImage"),
|
|
5871
|
+
preload: _fnSignal((p0) => p0.preload || "metadata", [
|
|
5872
|
+
props
|
|
5873
|
+
], 'p0.preload||"metadata"'),
|
|
5874
|
+
src: _fnSignal((p0) => p0.video || "no-src", [
|
|
5875
|
+
props
|
|
5876
|
+
], 'p0.video||"no-src"')
|
|
5877
|
+
}, 0, null),
|
|
5878
|
+
props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
5879
|
+
style: _fnSignal((p0) => ({
|
|
5880
|
+
width: "100%",
|
|
5881
|
+
paddingTop: p0.aspectRatio * 100 + "%",
|
|
5882
|
+
pointerEvents: "none",
|
|
5883
|
+
fontSize: "0px"
|
|
5884
|
+
}), [
|
|
5885
|
+
props
|
|
5886
|
+
], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
|
|
5887
|
+
}, null, 3, "j7_1") : null,
|
|
5888
|
+
((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
5889
|
+
style: {
|
|
5890
|
+
display: "flex",
|
|
5891
|
+
flexDirection: "column",
|
|
5892
|
+
alignItems: "stretch"
|
|
5893
|
+
}
|
|
5894
|
+
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_2"), 1, "j7_3") : null,
|
|
5895
|
+
((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
|
|
5896
|
+
style: {
|
|
5897
|
+
pointerEvents: "none",
|
|
5898
|
+
display: "flex",
|
|
5899
|
+
flexDirection: "column",
|
|
5900
|
+
alignItems: "stretch",
|
|
5901
|
+
position: "absolute",
|
|
5902
|
+
top: "0",
|
|
5903
|
+
left: "0",
|
|
5904
|
+
width: "100%",
|
|
5905
|
+
height: "100%"
|
|
5906
|
+
}
|
|
5907
|
+
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
5908
|
+
], 1, "j7_6");
|
|
5867
5909
|
}, "Video_component_qdcTZflYyoQ"));
|
|
5868
5910
|
const getDefaultRegisteredComponents = () => [
|
|
5869
5911
|
{
|
|
@@ -5929,12 +5971,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
|
|
|
5929
5971
|
[key]: serializeValue(value)
|
|
5930
5972
|
}), {}))
|
|
5931
5973
|
});
|
|
5974
|
+
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}";
|
|
5975
|
+
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}";
|
|
5976
|
+
const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
|
|
5977
|
+
const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
|
|
5932
5978
|
const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
|
|
5933
5979
|
...variant,
|
|
5934
5980
|
testVariationId: variant.id,
|
|
5935
5981
|
id: content == null ? void 0 : content.id
|
|
5936
5982
|
}));
|
|
5937
|
-
const
|
|
5983
|
+
const checkShouldRenderVariants = ({ canTrack, content }) => {
|
|
5938
5984
|
const hasVariants = getVariants(content).length > 0;
|
|
5939
5985
|
if (!hasVariants)
|
|
5940
5986
|
return false;
|
|
@@ -5944,131 +5990,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
|
|
|
5944
5990
|
return false;
|
|
5945
5991
|
return true;
|
|
5946
5992
|
};
|
|
5947
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
5948
|
-
var _a;
|
|
5949
|
-
function getAndSetVariantId2() {
|
|
5950
|
-
function setCookie2(name, value, days) {
|
|
5951
|
-
let expires = "";
|
|
5952
|
-
if (days) {
|
|
5953
|
-
const date = /* @__PURE__ */ new Date();
|
|
5954
|
-
date.setTime(date.getTime() + days * 864e5);
|
|
5955
|
-
expires = "; expires=" + date.toUTCString();
|
|
5956
|
-
}
|
|
5957
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
5958
|
-
}
|
|
5959
|
-
function getCookie2(name) {
|
|
5960
|
-
const nameEQ = name + "=";
|
|
5961
|
-
const ca2 = document.cookie.split(";");
|
|
5962
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
5963
|
-
let c = ca2[i];
|
|
5964
|
-
while (c.charAt(0) === " ")
|
|
5965
|
-
c = c.substring(1, c.length);
|
|
5966
|
-
if (c.indexOf(nameEQ) === 0)
|
|
5967
|
-
return c.substring(nameEQ.length, c.length);
|
|
5968
|
-
}
|
|
5969
|
-
return null;
|
|
5970
|
-
}
|
|
5971
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
5972
|
-
const variantInCookie = getCookie2(cookieName);
|
|
5973
|
-
const availableIDs = variants.map((vr) => vr.id).concat(contentId);
|
|
5974
|
-
if (variantInCookie && availableIDs.includes(variantInCookie))
|
|
5975
|
-
return variantInCookie;
|
|
5976
|
-
let n = 0;
|
|
5977
|
-
const random = Math.random();
|
|
5978
|
-
for (let i = 0; i < variants.length; i++) {
|
|
5979
|
-
const variant = variants[i];
|
|
5980
|
-
const testRatio = variant.testRatio;
|
|
5981
|
-
n += testRatio;
|
|
5982
|
-
if (random < n) {
|
|
5983
|
-
setCookie2(cookieName, variant.id);
|
|
5984
|
-
return variant.id;
|
|
5985
|
-
}
|
|
5986
|
-
}
|
|
5987
|
-
setCookie2(cookieName, contentId);
|
|
5988
|
-
return contentId;
|
|
5989
|
-
}
|
|
5990
|
-
const winningVariantId = getAndSetVariantId2();
|
|
5991
|
-
const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
|
|
5992
|
-
if (isHydrationTarget2) {
|
|
5993
|
-
styleEl.remove();
|
|
5994
|
-
const thisScriptEl = document.currentScript;
|
|
5995
|
-
thisScriptEl == null ? void 0 : thisScriptEl.remove();
|
|
5996
|
-
} else {
|
|
5997
|
-
const newStyleStr = variants.concat({
|
|
5998
|
-
id: contentId
|
|
5999
|
-
}).filter((variant) => variant.id !== winningVariantId).map((value) => {
|
|
6000
|
-
return `.variant-${value.id} { display: none; }
|
|
6001
|
-
`;
|
|
6002
|
-
}).join("");
|
|
6003
|
-
styleEl.innerHTML = newStyleStr;
|
|
6004
|
-
}
|
|
6005
|
-
}
|
|
6006
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
6007
|
-
var _a;
|
|
6008
|
-
if (!navigator.cookieEnabled)
|
|
6009
|
-
return;
|
|
6010
|
-
function getCookie2(name) {
|
|
6011
|
-
const nameEQ = name + "=";
|
|
6012
|
-
const ca2 = document.cookie.split(";");
|
|
6013
|
-
for (let i = 0; i < ca2.length; i++) {
|
|
6014
|
-
let c = ca2[i];
|
|
6015
|
-
while (c.charAt(0) === " ")
|
|
6016
|
-
c = c.substring(1, c.length);
|
|
6017
|
-
if (c.indexOf(nameEQ) === 0)
|
|
6018
|
-
return c.substring(nameEQ.length, c.length);
|
|
6019
|
-
}
|
|
6020
|
-
return null;
|
|
6021
|
-
}
|
|
6022
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
6023
|
-
const variantId = getCookie2(cookieName);
|
|
6024
|
-
const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
|
|
6025
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
6026
|
-
if (variantId === variantContentId) {
|
|
6027
|
-
if (variantIsDefaultContent)
|
|
6028
|
-
return;
|
|
6029
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
|
|
6030
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
|
|
6031
|
-
} else {
|
|
6032
|
-
if (variantIsDefaultContent) {
|
|
6033
|
-
if (isHydrationTarget2)
|
|
6034
|
-
parentDiv == null ? void 0 : parentDiv.remove();
|
|
6035
|
-
else {
|
|
6036
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
|
|
6037
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
|
|
6038
|
-
}
|
|
6039
|
-
}
|
|
6040
|
-
return;
|
|
6041
|
-
}
|
|
6042
|
-
return;
|
|
6043
|
-
}
|
|
6044
5993
|
const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
|
|
6045
5994
|
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
6046
|
-
const
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
6050
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
6051
|
-
return `
|
|
6052
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
6053
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
5995
|
+
const getScriptString = () => `
|
|
5996
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
5997
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
6054
5998
|
`;
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
}
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
6063
|
-
};
|
|
5999
|
+
const getUpdateCookieAndStylesScript = (variants, contentId) => `
|
|
6000
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
6001
|
+
"${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
|
|
6002
|
+
)`;
|
|
6003
|
+
const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
6004
|
+
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
6005
|
+
)`;
|
|
6064
6006
|
const InlinedScript = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
6065
6007
|
return /* @__PURE__ */ _jsxQ("script", null, {
|
|
6066
6008
|
dangerouslySetInnerHTML: _fnSignal((p0) => p0.scriptStr, [
|
|
6067
6009
|
props
|
|
6068
6010
|
], "p0.scriptStr"),
|
|
6069
|
-
id: _fnSignal((p0) => p0.id, [
|
|
6011
|
+
id: _fnSignal((p0) => p0.id || "", [
|
|
6070
6012
|
props
|
|
6071
|
-
],
|
|
6013
|
+
], 'p0.id||""')
|
|
6072
6014
|
}, null, 3, "WO_0");
|
|
6073
6015
|
}, "InlinedScript_component_hwThBdhA8rw"));
|
|
6074
6016
|
function getGlobalThis() {
|
|
@@ -6448,7 +6390,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
6448
6390
|
}
|
|
6449
6391
|
};
|
|
6450
6392
|
};
|
|
6451
|
-
const SDK_VERSION = "0.7.
|
|
6393
|
+
const SDK_VERSION = "0.7.4";
|
|
6452
6394
|
const registry = {};
|
|
6453
6395
|
function register(type, info) {
|
|
6454
6396
|
let typeList = registry[type];
|
|
@@ -6706,7 +6648,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
6706
6648
|
}));
|
|
6707
6649
|
};
|
|
6708
6650
|
const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
6709
|
-
var _a, _b, _c;
|
|
6651
|
+
var _a, _b, _c, _d, _e;
|
|
6710
6652
|
_jsxBranch();
|
|
6711
6653
|
const elementRef = useSignal();
|
|
6712
6654
|
const state = useStore({
|
|
@@ -6766,7 +6708,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
6766
6708
|
state
|
|
6767
6709
|
]));
|
|
6768
6710
|
useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
6769
|
-
var _a2, _b2, _c2,
|
|
6711
|
+
var _a2, _b2, _c2, _d2;
|
|
6770
6712
|
if (isBrowser()) {
|
|
6771
6713
|
if (isEditing() && element)
|
|
6772
6714
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
@@ -6774,7 +6716,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
6774
6716
|
if (shouldTrackImpression) {
|
|
6775
6717
|
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
6776
6718
|
const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
|
|
6777
|
-
const apiKeyProp = (
|
|
6719
|
+
const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
|
|
6778
6720
|
_track({
|
|
6779
6721
|
type: "impression",
|
|
6780
6722
|
canTrack: true,
|
|
@@ -6872,7 +6814,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
6872
6814
|
hidden: true,
|
|
6873
6815
|
"aria-hidden": true
|
|
6874
6816
|
},
|
|
6875
|
-
class: props.
|
|
6817
|
+
class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
|
|
6876
6818
|
}, /* @__PURE__ */ _jsxC(Slot, null, 3, "06_0")) : null
|
|
6877
6819
|
}, 1, "06_1");
|
|
6878
6820
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
@@ -7036,7 +6978,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7036
6978
|
...serializeComponentInfo(info)
|
|
7037
6979
|
}
|
|
7038
6980
|
}), {}),
|
|
7039
|
-
scriptStr:
|
|
6981
|
+
scriptStr: getUpdateVariantVisibilityScript({
|
|
7040
6982
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
7041
6983
|
variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
|
|
7042
6984
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -7073,9 +7015,6 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7073
7015
|
get enrich() {
|
|
7074
7016
|
return props.enrich;
|
|
7075
7017
|
},
|
|
7076
|
-
get classNameProp() {
|
|
7077
|
-
return props.classNameProp;
|
|
7078
|
-
},
|
|
7079
7018
|
get showContent() {
|
|
7080
7019
|
return props.showContent;
|
|
7081
7020
|
},
|
|
@@ -7164,9 +7103,6 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7164
7103
|
canTrack: _fnSignal((p0) => p0.canTrack, [
|
|
7165
7104
|
props
|
|
7166
7105
|
], "p0.canTrack"),
|
|
7167
|
-
classNameProp: _fnSignal((p0) => p0.classNameProp, [
|
|
7168
|
-
props
|
|
7169
|
-
], "p0.classNameProp"),
|
|
7170
7106
|
content: _fnSignal((p0) => p0.content, [
|
|
7171
7107
|
props
|
|
7172
7108
|
], "p0.content"),
|
|
@@ -7194,19 +7130,19 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
|
|
|
7194
7130
|
const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
7195
7131
|
_jsxBranch();
|
|
7196
7132
|
const state = useStore({
|
|
7197
|
-
shouldRenderVariants:
|
|
7133
|
+
shouldRenderVariants: checkShouldRenderVariants({
|
|
7198
7134
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
7199
7135
|
content: props.content
|
|
7200
7136
|
})
|
|
7201
7137
|
});
|
|
7202
|
-
const
|
|
7138
|
+
const updateCookieAndStylesScriptStr = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
7203
7139
|
var _a;
|
|
7204
7140
|
const [props2] = useLexicalScope();
|
|
7205
|
-
return
|
|
7141
|
+
return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
|
|
7206
7142
|
id: value.testVariationId,
|
|
7207
7143
|
testRatio: value.testRatio
|
|
7208
7144
|
})), ((_a = props2.content) == null ? void 0 : _a.id) || "");
|
|
7209
|
-
}, "
|
|
7145
|
+
}, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
|
|
7210
7146
|
props
|
|
7211
7147
|
]));
|
|
7212
7148
|
const hideVariantsStyleString = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
@@ -7263,11 +7199,11 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7263
7199
|
}, 3, "XM_1"),
|
|
7264
7200
|
/* @__PURE__ */ _jsxC(InlinedScript, {
|
|
7265
7201
|
get scriptStr() {
|
|
7266
|
-
return
|
|
7202
|
+
return updateCookieAndStylesScriptStr.value;
|
|
7267
7203
|
},
|
|
7268
7204
|
[_IMMUTABLE]: {
|
|
7269
7205
|
scriptStr: _fnSignal((p0) => p0.value, [
|
|
7270
|
-
|
|
7206
|
+
updateCookieAndStylesScriptStr
|
|
7271
7207
|
], "p0.value")
|
|
7272
7208
|
}
|
|
7273
7209
|
}, 3, "XM_2"),
|
|
@@ -7275,9 +7211,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7275
7211
|
return /* @__PURE__ */ _jsxC(ContentComponent, {
|
|
7276
7212
|
content: variant,
|
|
7277
7213
|
showContent: false,
|
|
7278
|
-
get classNameProp() {
|
|
7279
|
-
return void 0;
|
|
7280
|
-
},
|
|
7281
7214
|
get model() {
|
|
7282
7215
|
return props.model;
|
|
7283
7216
|
},
|
|
@@ -7321,7 +7254,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7321
7254
|
canTrack: _fnSignal((p0) => p0.canTrack, [
|
|
7322
7255
|
props
|
|
7323
7256
|
], "p0.canTrack"),
|
|
7324
|
-
classNameProp: _IMMUTABLE,
|
|
7325
7257
|
context: _fnSignal((p0) => p0.context, [
|
|
7326
7258
|
props
|
|
7327
7259
|
], "p0.context"),
|
|
@@ -7356,10 +7288,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7356
7288
|
get content() {
|
|
7357
7289
|
return defaultContent.value;
|
|
7358
7290
|
},
|
|
7359
|
-
get classNameProp() {
|
|
7360
|
-
var _a;
|
|
7361
|
-
return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
|
|
7362
|
-
},
|
|
7363
7291
|
showContent: true,
|
|
7364
7292
|
get model() {
|
|
7365
7293
|
return props.model;
|
|
@@ -7404,12 +7332,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
7404
7332
|
canTrack: _fnSignal((p0) => p0.canTrack, [
|
|
7405
7333
|
props
|
|
7406
7334
|
], "p0.canTrack"),
|
|
7407
|
-
classNameProp: _fnSignal((p0) => {
|
|
7408
|
-
var _a;
|
|
7409
|
-
return `variant-${(_a = p0.content) == null ? void 0 : _a.id}`;
|
|
7410
|
-
}, [
|
|
7411
|
-
props
|
|
7412
|
-
], "`variant-${p0.content?.id}`"),
|
|
7413
7335
|
content: _fnSignal((p0) => p0.value, [
|
|
7414
7336
|
defaultContent
|
|
7415
7337
|
], "p0.value"),
|