@builder.io/sdk-solid 3.0.5 → 3.0.7

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.
@@ -935,8 +935,13 @@ import { Show as Show2, createMemo } from "solid-js";
935
935
 
936
936
  // src/constants/device-sizes.ts
937
937
  var SIZES = {
938
+ xsmall: {
939
+ min: 0,
940
+ default: 160,
941
+ max: 320
942
+ },
938
943
  small: {
939
- min: 320,
944
+ min: 321,
940
945
  default: 321,
941
946
  max: 640
942
947
  },
@@ -952,15 +957,28 @@ var SIZES = {
952
957
  }
953
958
  };
954
959
  var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
955
- var getSizesForBreakpoints = ({
956
- small,
957
- medium
958
- }) => {
960
+ var getSizesForBreakpoints = (breakpoints) => {
959
961
  const newSizes = fastClone(SIZES);
962
+ if (!breakpoints) {
963
+ return newSizes;
964
+ }
965
+ const {
966
+ xsmall,
967
+ small,
968
+ medium
969
+ } = breakpoints;
970
+ if (xsmall) {
971
+ const xsmallMin = Math.floor(xsmall / 2);
972
+ newSizes.xsmall = {
973
+ max: xsmall,
974
+ min: xsmallMin,
975
+ default: xsmallMin + 1
976
+ };
977
+ }
960
978
  if (!small || !medium) {
961
979
  return newSizes;
962
980
  }
963
- const smallMin = Math.floor(small / 2);
981
+ const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
964
982
  newSizes.small = {
965
983
  max: small,
966
984
  min: smallMin,
@@ -1011,9 +1029,13 @@ function BlockStyles(props) {
1011
1029
  const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
1012
1030
  content?.meta?.breakpoints || {}
1013
1031
  );
1032
+ const contentHasXSmallBreakpoint = Boolean(
1033
+ content?.meta?.breakpoints?.xsmall
1034
+ );
1014
1035
  const largeStyles = styles?.large;
1015
1036
  const mediumStyles = styles?.medium;
1016
1037
  const smallStyles = styles?.small;
1038
+ const xsmallStyles = styles?.xsmall;
1017
1039
  const className = processedBlock.id;
1018
1040
  if (!className) {
1019
1041
  return "";
@@ -1038,6 +1060,14 @@ function BlockStyles(props) {
1038
1060
  sizesWithUpdatedBreakpoints
1039
1061
  )
1040
1062
  }) : "";
1063
+ const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
1064
+ className,
1065
+ styles: xsmallStyles,
1066
+ mediaQuery: getMaxWidthQueryForSize(
1067
+ "xsmall",
1068
+ sizesWithUpdatedBreakpoints
1069
+ )
1070
+ }) : "";
1041
1071
  const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
1042
1072
  let hoverStylesClass = "";
1043
1073
  if (hoverAnimation) {
@@ -1057,6 +1087,7 @@ function BlockStyles(props) {
1057
1087
  largeStylesClass,
1058
1088
  mediumStylesClass,
1059
1089
  smallStylesClass,
1090
+ xsmallStylesClass,
1060
1091
  hoverStylesClass
1061
1092
  ].join(" ");
1062
1093
  });
@@ -1463,8 +1494,9 @@ function BlocksWrapper(props) {
1463
1494
  if (!props.path) {
1464
1495
  return void 0;
1465
1496
  }
1497
+ const thisPrefix = "this.";
1466
1498
  const pathPrefix = "component.options.";
1467
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1499
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1468
1500
  });
1469
1501
  function onClick() {
1470
1502
  if (isEditing() && !props.blocks?.length) {
@@ -1499,7 +1531,7 @@ function BlocksWrapper(props) {
1499
1531
  });
1500
1532
  return <>
1501
1533
  <Dynamic4
1502
- class={className() + " dynamic-3c4beb0c"}
1534
+ class={className() + " dynamic-3d7ff108"}
1503
1535
  ref={blocksWrapperRef}
1504
1536
  builder-path={dataPath()}
1505
1537
  builder-parent-id={props.parent}
@@ -1511,7 +1543,7 @@ function BlocksWrapper(props) {
1511
1543
  {...props.BlocksWrapperProps}
1512
1544
  component={props.BlocksWrapper}
1513
1545
  >{props.children}</Dynamic4>
1514
- <style>{`.dynamic-3c4beb0c {
1546
+ <style>{`.dynamic-3d7ff108 {
1515
1547
  display: flex;
1516
1548
  flex-direction: column;
1517
1549
  align-items: stretch;
@@ -1884,10 +1916,10 @@ function SectionComponent(props) {
1884
1916
  var section_default = SectionComponent;
1885
1917
 
1886
1918
  // src/blocks/symbol/symbol.tsx
1887
- import { onMount as onMount7, on as on4, createEffect as createEffect4, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
1919
+ import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
1888
1920
 
1889
1921
  // src/components/content-variants/content-variants.tsx
1890
- import { Show as Show15, For as For8, onMount as onMount6, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
1922
+ import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
1891
1923
 
1892
1924
  // src/helpers/url.ts
1893
1925
  var getTopLevelDomain = (host) => {
@@ -2077,11 +2109,61 @@ var handleABTesting = async ({
2077
2109
  };
2078
2110
  };
2079
2111
 
2112
+ // src/helpers/user-attributes.ts
2113
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2114
+ function createUserAttributesService() {
2115
+ let canTrack = true;
2116
+ const subscribers = /* @__PURE__ */ new Set();
2117
+ return {
2118
+ setUserAttributes(newAttrs) {
2119
+ if (!isBrowser()) {
2120
+ return;
2121
+ }
2122
+ const userAttributes = {
2123
+ ...this.getUserAttributes(),
2124
+ ...newAttrs
2125
+ };
2126
+ setCookie({
2127
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2128
+ value: JSON.stringify(userAttributes),
2129
+ canTrack
2130
+ });
2131
+ subscribers.forEach((callback) => callback(userAttributes));
2132
+ },
2133
+ getUserAttributes() {
2134
+ if (!isBrowser()) {
2135
+ return {};
2136
+ }
2137
+ return JSON.parse(getCookieSync({
2138
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2139
+ canTrack
2140
+ }) || "{}");
2141
+ },
2142
+ subscribeOnUserAttributesChange(callback) {
2143
+ subscribers.add(callback);
2144
+ return () => {
2145
+ subscribers.delete(callback);
2146
+ };
2147
+ },
2148
+ setCanTrack(value) {
2149
+ canTrack = value;
2150
+ }
2151
+ };
2152
+ }
2153
+ var userAttributesService = createUserAttributesService();
2154
+ var setClientUserAttributes = (attributes) => {
2155
+ userAttributesService.setUserAttributes(attributes);
2156
+ };
2157
+
2080
2158
  // src/helpers/canTrack.ts
2081
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2159
+ var getDefaultCanTrack = (canTrack) => {
2160
+ const result = checkIsDefined(canTrack) ? canTrack : true;
2161
+ userAttributesService.setCanTrack(result);
2162
+ return result;
2163
+ };
2082
2164
 
2083
2165
  // src/components/content/content.tsx
2084
- import { Show as Show14, createSignal as createSignal17 } from "solid-js";
2166
+ import { Show as Show15, createSignal as createSignal18 } from "solid-js";
2085
2167
 
2086
2168
  // src/blocks/accordion/component-info.ts
2087
2169
  var defaultTitle = {
@@ -2776,8 +2858,388 @@ var componentInfo5 = {
2776
2858
  }
2777
2859
  };
2778
2860
 
2779
- // src/blocks/section/component-info.ts
2861
+ // src/blocks/personalization-container/component-info.ts
2780
2862
  var componentInfo6 = {
2863
+ name: "PersonalizationContainer",
2864
+ shouldReceiveBuilderProps: {
2865
+ builderBlock: true,
2866
+ builderContext: true
2867
+ },
2868
+ noWrap: true,
2869
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
2870
+ canHaveChildren: true,
2871
+ inputs: [{
2872
+ name: "variants",
2873
+ defaultValue: [],
2874
+ behavior: "personalizationVariantList",
2875
+ type: "list",
2876
+ subFields: [{
2877
+ name: "name",
2878
+ type: "text"
2879
+ }, {
2880
+ name: "query",
2881
+ friendlyName: "Targeting rules",
2882
+ type: "BuilderQuery",
2883
+ defaultValue: []
2884
+ }, {
2885
+ name: "startDate",
2886
+ type: "date"
2887
+ }, {
2888
+ name: "endDate",
2889
+ type: "date"
2890
+ }, {
2891
+ name: "blocks",
2892
+ type: "uiBlocks",
2893
+ hideFromUI: true,
2894
+ defaultValue: []
2895
+ }]
2896
+ }]
2897
+ };
2898
+
2899
+ // src/blocks/personalization-container/personalization-container.tsx
2900
+ import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
2901
+
2902
+ // src/components/inlined-script.tsx
2903
+ function InlinedScript(props) {
2904
+ return <><script
2905
+ innerHTML={props.scriptStr}
2906
+ data-id={props.id}
2907
+ nonce={props.nonce || ""}
2908
+ /></>;
2909
+ }
2910
+ var Inlined_script_default = InlinedScript;
2911
+
2912
+ // src/functions/is-previewing.ts
2913
+ function isPreviewing(_search) {
2914
+ const search = _search || (isBrowser() ? window.location.search : void 0);
2915
+ if (!search) {
2916
+ return false;
2917
+ }
2918
+ const normalizedSearch = getSearchString(search);
2919
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
2920
+ }
2921
+
2922
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
2923
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
2924
+ function isString(val) {
2925
+ return typeof val === "string";
2926
+ }
2927
+ function isNumber(val) {
2928
+ return typeof val === "number";
2929
+ }
2930
+ function objectMatchesQuery(userattr, query2) {
2931
+ const result = (() => {
2932
+ const property = query2.property;
2933
+ const operator = query2.operator;
2934
+ let testValue = query2.value;
2935
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
2936
+ testValue = query2.value.slice(0, -1);
2937
+ }
2938
+ if (!(property && operator)) {
2939
+ return true;
2940
+ }
2941
+ if (Array.isArray(testValue)) {
2942
+ if (operator === "isNot") {
2943
+ return testValue.every((val) => objectMatchesQuery(userattr, {
2944
+ property,
2945
+ operator,
2946
+ value: val
2947
+ }));
2948
+ }
2949
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
2950
+ property,
2951
+ operator,
2952
+ value: val
2953
+ }));
2954
+ }
2955
+ const value = userattr[property];
2956
+ if (Array.isArray(value)) {
2957
+ return value.includes(testValue);
2958
+ }
2959
+ switch (operator) {
2960
+ case "is":
2961
+ return value === testValue;
2962
+ case "isNot":
2963
+ return value !== testValue;
2964
+ case "contains":
2965
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
2966
+ case "startsWith":
2967
+ return isString(value) && value.startsWith(String(testValue));
2968
+ case "endsWith":
2969
+ return isString(value) && value.endsWith(String(testValue));
2970
+ case "greaterThan":
2971
+ return isNumber(value) && isNumber(testValue) && value > testValue;
2972
+ case "lessThan":
2973
+ return isNumber(value) && isNumber(testValue) && value < testValue;
2974
+ case "greaterThanOrEqualTo":
2975
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
2976
+ case "lessThanOrEqualTo":
2977
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
2978
+ default:
2979
+ return false;
2980
+ }
2981
+ })();
2982
+ return result;
2983
+ }
2984
+ const item = {
2985
+ query,
2986
+ startDate,
2987
+ endDate
2988
+ };
2989
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
2990
+ if (item.startDate && new Date(item.startDate) > now) {
2991
+ return false;
2992
+ } else if (item.endDate && new Date(item.endDate) < now) {
2993
+ return false;
2994
+ }
2995
+ if (!item.query || !item.query.length) {
2996
+ return true;
2997
+ }
2998
+ return item.query.every((filter) => {
2999
+ return objectMatchesQuery(userAttributes, filter);
3000
+ });
3001
+ }
3002
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
3003
+ if (!navigator.cookieEnabled) {
3004
+ return;
3005
+ }
3006
+ function getCookie(name) {
3007
+ const nameEQ = name + '=';
3008
+ const ca = document.cookie.split(';');
3009
+ for (let i = 0; i < ca.length; i++) {
3010
+ let c = ca[i];
3011
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
3012
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
3013
+ }
3014
+ return null;
3015
+ }
3016
+ function removeVariants() {
3017
+ variants?.forEach(function (_, index) {
3018
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
3019
+ });
3020
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
3021
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
3022
+ }
3023
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
3024
+ if (locale) {
3025
+ attributes.locale = locale;
3026
+ }
3027
+ const winningVariantIndex = variants?.findIndex(function (variant) {
3028
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
3029
+ });
3030
+ const isDebug = location.href.includes('builder.debug=true');
3031
+ if (isDebug) {
3032
+ console.debug('PersonalizationContainer', {
3033
+ attributes,
3034
+ variants,
3035
+ winningVariantIndex
3036
+ });
3037
+ }
3038
+ if (winningVariantIndex !== -1) {
3039
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
3040
+ if (winningVariant) {
3041
+ const parentNode = winningVariant.parentNode;
3042
+ if (parentNode) {
3043
+ const newParent = parentNode.cloneNode(false);
3044
+ newParent.appendChild(winningVariant.content.firstChild);
3045
+ newParent.appendChild(winningVariant.content.lastChild);
3046
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
3047
+ }
3048
+ if (isDebug) {
3049
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
3050
+ }
3051
+ }
3052
+ } else if (variants && variants.length > 0) {
3053
+ removeVariants();
3054
+ }
3055
+ }`;
3056
+ var FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
3057
+
3058
+ // src/blocks/personalization-container/helpers.ts
3059
+ function checkShouldRenderVariants(variants, canTrack) {
3060
+ const hasVariants = variants && variants.length > 0;
3061
+ if (TARGET === "reactNative")
3062
+ return false;
3063
+ if (!hasVariants)
3064
+ return false;
3065
+ if (!canTrack)
3066
+ return false;
3067
+ if (TARGET === "vue" || TARGET === "svelte")
3068
+ return true;
3069
+ if (isBrowser())
3070
+ return false;
3071
+ return true;
3072
+ }
3073
+ function getBlocksToRender({
3074
+ variants,
3075
+ previewingIndex,
3076
+ isHydrated,
3077
+ filteredVariants,
3078
+ fallbackBlocks
3079
+ }) {
3080
+ const fallback = {
3081
+ blocks: fallbackBlocks ?? [],
3082
+ path: "this.children"
3083
+ };
3084
+ if (isHydrated && isEditing()) {
3085
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
3086
+ const variant = variants[previewingIndex];
3087
+ return {
3088
+ blocks: variant.blocks,
3089
+ path: `component.options.variants.${previewingIndex}.blocks`
3090
+ };
3091
+ }
3092
+ return fallback;
3093
+ }
3094
+ if (isBrowser()) {
3095
+ const winningVariant = filteredVariants?.[0];
3096
+ if (winningVariant) {
3097
+ return {
3098
+ blocks: winningVariant.blocks,
3099
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
3100
+ };
3101
+ }
3102
+ }
3103
+ return fallback;
3104
+ }
3105
+ var getPersonalizationScript = (variants, blockId, locale) => {
3106
+ return `
3107
+ (function() {
3108
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
3109
+ ${PERSONALIZATION_SCRIPT}
3110
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
3111
+ })();
3112
+ `;
3113
+ };
3114
+
3115
+ // src/blocks/personalization-container/personalization-container.tsx
3116
+ function PersonalizationContainer(props) {
3117
+ const [userAttributes, setUserAttributes] = createSignal10(
3118
+ userAttributesService.getUserAttributes()
3119
+ );
3120
+ const [scriptStr, setScriptStr] = createSignal10(
3121
+ getPersonalizationScript(
3122
+ props.variants,
3123
+ props.builderBlock?.id || "none",
3124
+ props.builderContext?.rootState?.locale
3125
+ )
3126
+ );
3127
+ const [unsubscribers, setUnsubscribers] = createSignal10([]);
3128
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
3129
+ checkShouldRenderVariants(
3130
+ props.variants,
3131
+ getDefaultCanTrack(props.builderContext?.canTrack)
3132
+ )
3133
+ );
3134
+ const [isHydrated, setIsHydrated] = createSignal10(false);
3135
+ const filteredVariants = createMemo10(() => {
3136
+ return (props.variants || []).filter((variant) => {
3137
+ return filterWithCustomTargeting(
3138
+ {
3139
+ ...props.builderContext?.rootState?.locale ? {
3140
+ locale: props.builderContext?.rootState?.locale
3141
+ } : {},
3142
+ ...userAttributes()
3143
+ },
3144
+ variant.query,
3145
+ variant.startDate,
3146
+ variant.endDate
3147
+ );
3148
+ });
3149
+ });
3150
+ const blocksToRender = createMemo10(() => {
3151
+ return getBlocksToRender({
3152
+ variants: props.variants,
3153
+ fallbackBlocks: props.builderBlock?.children,
3154
+ isHydrated: isHydrated(),
3155
+ filteredVariants: filteredVariants(),
3156
+ previewingIndex: props.previewingIndex
3157
+ });
3158
+ });
3159
+ const hideVariantsStyleString = createMemo10(() => {
3160
+ return (props.variants || []).map(
3161
+ (_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
3162
+ ).join("");
3163
+ });
3164
+ let rootRef;
3165
+ onMount4(() => {
3166
+ setIsHydrated(true);
3167
+ const unsub = userAttributesService.subscribeOnUserAttributesChange(
3168
+ (attrs) => {
3169
+ setUserAttributes(attrs);
3170
+ }
3171
+ );
3172
+ if (!(isEditing() || isPreviewing())) {
3173
+ const variant = filteredVariants()[0];
3174
+ if (rootRef) {
3175
+ rootRef.dispatchEvent(
3176
+ new CustomEvent("builder.variantLoaded", {
3177
+ detail: {
3178
+ variant: variant || "default",
3179
+ content: props.builderContext?.content
3180
+ },
3181
+ bubbles: true
3182
+ })
3183
+ );
3184
+ const observer = new IntersectionObserver((entries) => {
3185
+ entries.forEach((entry) => {
3186
+ if (entry.isIntersecting && rootRef) {
3187
+ rootRef.dispatchEvent(
3188
+ new CustomEvent("builder.variantDisplayed", {
3189
+ detail: {
3190
+ variant: variant || "default",
3191
+ content: props.builderContext?.content
3192
+ },
3193
+ bubbles: true
3194
+ })
3195
+ );
3196
+ }
3197
+ });
3198
+ });
3199
+ observer.observe(rootRef);
3200
+ }
3201
+ }
3202
+ unsubscribers().push(unsub);
3203
+ });
3204
+ return <><div
3205
+ class={`builder-personalization-container ${props.attributes?.className || ""}`}
3206
+ ref={rootRef}
3207
+ {...props.attributes}
3208
+ >
3209
+ <Show10 when={shouldRenderVariants()}>
3210
+ <For6 each={props.variants}>{(variant, _index) => {
3211
+ const index = _index();
3212
+ return <template
3213
+ key={index}
3214
+ data-variant-id={`${props.builderBlock?.id}-${index}`}
3215
+ ><Blocks_default
3216
+ blocks={variant.blocks}
3217
+ parent={props.builderBlock?.id}
3218
+ path={`component.options.variants.${index}.blocks`}
3219
+ /></template>;
3220
+ }}</For6>
3221
+ <Inlined_styles_default
3222
+ nonce={props.builderContext?.nonce || ""}
3223
+ styles={hideVariantsStyleString()}
3224
+ id={`variants-styles-${props.builderBlock?.id}`}
3225
+ />
3226
+ <Inlined_script_default
3227
+ nonce={props.builderContext?.nonce || ""}
3228
+ scriptStr={scriptStr()}
3229
+ id={`variants-script-${props.builderBlock?.id}`}
3230
+ />
3231
+ </Show10>
3232
+ <Blocks_default
3233
+ blocks={blocksToRender().blocks}
3234
+ parent={props.builderBlock?.id}
3235
+ path={blocksToRender().path}
3236
+ />
3237
+ </div></>;
3238
+ }
3239
+ var personalization_container_default = PersonalizationContainer;
3240
+
3241
+ // src/blocks/section/component-info.ts
3242
+ var componentInfo7 = {
2781
3243
  name: "Core:Section",
2782
3244
  static: true,
2783
3245
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2819,7 +3281,7 @@ var componentInfo6 = {
2819
3281
  };
2820
3282
 
2821
3283
  // src/blocks/slot/component-info.ts
2822
- var componentInfo7 = {
3284
+ var componentInfo8 = {
2823
3285
  name: "Slot",
2824
3286
  isRSC: true,
2825
3287
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -2858,7 +3320,7 @@ function Slot(props) {
2858
3320
  var slot_default = Slot;
2859
3321
 
2860
3322
  // src/blocks/symbol/component-info.ts
2861
- var componentInfo8 = {
3323
+ var componentInfo9 = {
2862
3324
  name: "Symbol",
2863
3325
  noWrap: true,
2864
3326
  static: true,
@@ -2940,7 +3402,7 @@ var defaultElement = {
2940
3402
  }
2941
3403
  }
2942
3404
  };
2943
- var componentInfo9 = {
3405
+ var componentInfo10 = {
2944
3406
  name: "Builder: Tabs",
2945
3407
  inputs: [{
2946
3408
  name: "tabs",
@@ -3046,9 +3508,9 @@ var componentInfo9 = {
3046
3508
  };
3047
3509
 
3048
3510
  // src/blocks/tabs/tabs.tsx
3049
- import { Show as Show10, For as For6, createSignal as createSignal10 } from "solid-js";
3511
+ import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
3050
3512
  function Tabs(props) {
3051
- const [activeTab, setActiveTab] = createSignal10(
3513
+ const [activeTab, setActiveTab] = createSignal11(
3052
3514
  props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
3053
3515
  );
3054
3516
  function activeTabContent(active) {
@@ -3070,7 +3532,7 @@ function Tabs(props) {
3070
3532
  "justify-content": props.tabHeaderLayout || "flex-start",
3071
3533
  overflow: "auto"
3072
3534
  }}
3073
- ><For6 each={props.tabs}>{(tab, _index) => {
3535
+ ><For7 each={props.tabs}>{(tab, _index) => {
3074
3536
  const index = _index();
3075
3537
  return <span
3076
3538
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
@@ -3087,21 +3549,21 @@ function Tabs(props) {
3087
3549
  registeredComponents={props.builderComponents}
3088
3550
  linkComponent={props.builderLinkComponent}
3089
3551
  /></span>;
3090
- }}</For6></div>
3091
- <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
3552
+ }}</For7></div>
3553
+ <Show11 when={activeTabContent(activeTab())}><div><Blocks_default
3092
3554
  parent={props.builderBlock.id}
3093
3555
  path={`tabs.${activeTab()}.content`}
3094
3556
  blocks={activeTabContent(activeTab())}
3095
3557
  context={props.builderContext}
3096
3558
  registeredComponents={props.builderComponents}
3097
3559
  linkComponent={props.builderLinkComponent}
3098
- /></div></Show10>
3560
+ /></div></Show11>
3099
3561
  </div></>;
3100
3562
  }
3101
3563
  var tabs_default = Tabs;
3102
3564
 
3103
3565
  // src/blocks/text/component-info.ts
3104
- var componentInfo10 = {
3566
+ var componentInfo11 = {
3105
3567
  shouldReceiveBuilderProps: {
3106
3568
  builderBlock: TARGET === "reactNative" ? true : false,
3107
3569
  builderContext: true
@@ -3138,7 +3600,7 @@ function Text(props) {
3138
3600
  var text_default = Text;
3139
3601
 
3140
3602
  // src/blocks/custom-code/component-info.ts
3141
- var componentInfo11 = {
3603
+ var componentInfo12 = {
3142
3604
  name: "Custom Code",
3143
3605
  static: true,
3144
3606
  requiredPermissions: ["editCode"],
@@ -3163,12 +3625,12 @@ var componentInfo11 = {
3163
3625
  };
3164
3626
 
3165
3627
  // src/blocks/custom-code/custom-code.tsx
3166
- import { onMount as onMount4, createSignal as createSignal11 } from "solid-js";
3628
+ import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
3167
3629
  function CustomCode(props) {
3168
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
3169
- const [scriptsRun, setScriptsRun] = createSignal11([]);
3630
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3631
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
3170
3632
  let elementRef;
3171
- onMount4(() => {
3633
+ onMount5(() => {
3172
3634
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
3173
3635
  return;
3174
3636
  }
@@ -3210,7 +3672,7 @@ function CustomCode(props) {
3210
3672
  var custom_code_default = CustomCode;
3211
3673
 
3212
3674
  // src/blocks/embed/component-info.ts
3213
- var componentInfo12 = {
3675
+ var componentInfo13 = {
3214
3676
  name: "Embed",
3215
3677
  static: true,
3216
3678
  inputs: [{
@@ -3228,7 +3690,7 @@ var componentInfo12 = {
3228
3690
  };
3229
3691
 
3230
3692
  // src/blocks/embed/embed.tsx
3231
- import { on as on2, createEffect as createEffect2, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
3693
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
3232
3694
 
3233
3695
  // src/blocks/embed/helpers.ts
3234
3696
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -3236,9 +3698,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3236
3698
 
3237
3699
  // src/blocks/embed/embed.tsx
3238
3700
  function Embed(props) {
3239
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3240
- const [scriptsRun, setScriptsRun] = createSignal12([]);
3241
- const [ranInitFn, setRanInitFn] = createSignal12(false);
3701
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
3702
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
3703
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
3242
3704
  function findAndRunScripts() {
3243
3705
  if (!elem || !elem.getElementsByTagName)
3244
3706
  return;
@@ -3262,8 +3724,8 @@ function Embed(props) {
3262
3724
  }
3263
3725
  }
3264
3726
  let elem;
3265
- const onUpdateFn_0_elem = createMemo12(() => elem);
3266
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
3727
+ const onUpdateFn_0_elem = createMemo13(() => elem);
3728
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
3267
3729
  function onUpdateFn_0() {
3268
3730
  if (elem && !ranInitFn()) {
3269
3731
  setRanInitFn(true);
@@ -3278,7 +3740,7 @@ function Embed(props) {
3278
3740
  var embed_default = Embed;
3279
3741
 
3280
3742
  // src/blocks/form/form/component-info.ts
3281
- var componentInfo13 = {
3743
+ var componentInfo14 = {
3282
3744
  name: "Form:Form",
3283
3745
  // editableTags: ['builder-form-error']
3284
3746
  defaults: {
@@ -3518,7 +3980,7 @@ var componentInfo13 = {
3518
3980
  };
3519
3981
 
3520
3982
  // src/blocks/form/form/form.tsx
3521
- import { Show as Show11, createSignal as createSignal13 } from "solid-js";
3983
+ import { Show as Show12, createSignal as createSignal14 } from "solid-js";
3522
3984
 
3523
3985
  // src/functions/get-env.ts
3524
3986
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -3538,9 +4000,9 @@ function logFetch(url) {
3538
4000
 
3539
4001
  // src/blocks/form/form/form.tsx
3540
4002
  function FormComponent(props) {
3541
- const [formState, setFormState] = createSignal13("unsubmitted");
3542
- const [responseData, setResponseData] = createSignal13(null);
3543
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
4003
+ const [formState, setFormState] = createSignal14("unsubmitted");
4004
+ const [responseData, setResponseData] = createSignal14(null);
4005
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
3544
4006
  function mergeNewRootState(newData) {
3545
4007
  const combinedState = {
3546
4008
  ...props.builderContext.rootState,
@@ -3736,22 +4198,22 @@ function FormComponent(props) {
3736
4198
  {...props.attributes}
3737
4199
  >
3738
4200
  {props.children}
3739
- <Show11 when={submissionState() === "error"}><Blocks_default
4201
+ <Show12 when={submissionState() === "error"}><Blocks_default
3740
4202
  path="errorMessage"
3741
4203
  blocks={props.errorMessage}
3742
4204
  context={props.builderContext}
3743
- /></Show11>
3744
- <Show11 when={submissionState() === "sending"}><Blocks_default
4205
+ /></Show12>
4206
+ <Show12 when={submissionState() === "sending"}><Blocks_default
3745
4207
  path="sendingMessage"
3746
4208
  blocks={props.sendingMessage}
3747
4209
  context={props.builderContext}
3748
- /></Show11>
3749
- <Show11 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show11>
3750
- <Show11 when={submissionState() === "success"}><Blocks_default
4210
+ /></Show12>
4211
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
4212
+ <Show12 when={submissionState() === "success"}><Blocks_default
3751
4213
  path="successMessage"
3752
4214
  blocks={props.successMessage}
3753
4215
  context={props.builderContext}
3754
- /></Show11>
4216
+ /></Show12>
3755
4217
  </form>
3756
4218
  <style>{`.pre-04a43b72 {
3757
4219
  padding: 10px;
@@ -3763,7 +4225,7 @@ function FormComponent(props) {
3763
4225
  var form_default = FormComponent;
3764
4226
 
3765
4227
  // src/blocks/form/input/component-info.ts
3766
- var componentInfo14 = {
4228
+ var componentInfo15 = {
3767
4229
  name: "Form:Input",
3768
4230
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3769
4231
  inputs: [
@@ -3833,7 +4295,7 @@ function FormInputComponent(props) {
3833
4295
  var input_default = FormInputComponent;
3834
4296
 
3835
4297
  // src/blocks/form/select/component-info.ts
3836
- var componentInfo15 = {
4298
+ var componentInfo16 = {
3837
4299
  name: "Form:Select",
3838
4300
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3839
4301
  defaultStyles: {
@@ -3878,7 +4340,7 @@ var componentInfo15 = {
3878
4340
  };
3879
4341
 
3880
4342
  // src/blocks/form/select/select.tsx
3881
- import { For as For7 } from "solid-js";
4343
+ import { For as For8 } from "solid-js";
3882
4344
  function SelectComponent(props) {
3883
4345
  return <><select
3884
4346
  {...{}}
@@ -3888,15 +4350,15 @@ function SelectComponent(props) {
3888
4350
  defaultValue={props.defaultValue}
3889
4351
  name={props.name}
3890
4352
  required={props.required}
3891
- ><For7 each={props.options}>{(option, _index) => {
4353
+ ><For8 each={props.options}>{(option, _index) => {
3892
4354
  const index = _index();
3893
4355
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3894
- }}</For7></select></>;
4356
+ }}</For8></select></>;
3895
4357
  }
3896
4358
  var select_default = SelectComponent;
3897
4359
 
3898
4360
  // src/blocks/form/submit-button/component-info.ts
3899
- var componentInfo16 = {
4361
+ var componentInfo17 = {
3900
4362
  name: "Form:SubmitButton",
3901
4363
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3902
4364
  defaultStyles: {
@@ -3930,7 +4392,7 @@ function SubmitButton(props) {
3930
4392
  var submit_button_default = SubmitButton;
3931
4393
 
3932
4394
  // src/blocks/form/textarea/component-info.ts
3933
- var componentInfo17 = {
4395
+ var componentInfo18 = {
3934
4396
  name: "Form:TextArea",
3935
4397
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
3936
4398
  inputs: [{
@@ -3983,7 +4445,7 @@ function Textarea(props) {
3983
4445
  var textarea_default = Textarea;
3984
4446
 
3985
4447
  // src/blocks/img/component-info.ts
3986
- var componentInfo18 = {
4448
+ var componentInfo19 = {
3987
4449
  // friendlyName?
3988
4450
  name: "Raw:Img",
3989
4451
  hideFromInsertMenu: true,
@@ -4016,7 +4478,7 @@ function ImgComponent(props) {
4016
4478
  var img_default = ImgComponent;
4017
4479
 
4018
4480
  // src/blocks/video/component-info.ts
4019
- var componentInfo19 = {
4481
+ var componentInfo20 = {
4020
4482
  name: "Video",
4021
4483
  canHaveChildren: true,
4022
4484
  defaultStyles: {
@@ -4103,9 +4565,9 @@ var componentInfo19 = {
4103
4565
  };
4104
4566
 
4105
4567
  // src/blocks/video/video.tsx
4106
- import { Show as Show12, createMemo as createMemo14 } from "solid-js";
4568
+ import { Show as Show13, createMemo as createMemo15 } from "solid-js";
4107
4569
  function Video(props) {
4108
- const videoProps = createMemo14(() => {
4570
+ const videoProps = createMemo15(() => {
4109
4571
  return {
4110
4572
  ...props.autoPlay === true ? {
4111
4573
  autoPlay: true
@@ -4124,7 +4586,7 @@ function Video(props) {
4124
4586
  } : {}
4125
4587
  };
4126
4588
  });
4127
- const spreadProps = createMemo14(() => {
4589
+ const spreadProps = createMemo15(() => {
4128
4590
  return {
4129
4591
  ...videoProps()
4130
4592
  };
@@ -4153,8 +4615,8 @@ function Video(props) {
4153
4615
  }}
4154
4616
  src={props.video || "no-src"}
4155
4617
  poster={props.posterImage}
4156
- ><Show12 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show12></video>
4157
- <Show12
4618
+ ><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
4619
+ <Show13
4158
4620
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
4159
4621
  ><div
4160
4622
  style={{
@@ -4163,15 +4625,15 @@ function Video(props) {
4163
4625
  "pointer-events": "none",
4164
4626
  "font-size": "0px"
4165
4627
  }}
4166
- /></Show12>
4167
- <Show12 when={props.builderBlock?.children?.length && props.fitContent}><div
4628
+ /></Show13>
4629
+ <Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
4168
4630
  style={{
4169
4631
  display: "flex",
4170
4632
  "flex-direction": "column",
4171
4633
  "align-items": "stretch"
4172
4634
  }}
4173
- >{props.children}</div></Show12>
4174
- <Show12 when={props.builderBlock?.children?.length && !props.fitContent}><div
4635
+ >{props.children}</div></Show13>
4636
+ <Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
4175
4637
  style={{
4176
4638
  "pointer-events": "none",
4177
4639
  display: "flex",
@@ -4183,7 +4645,7 @@ function Video(props) {
4183
4645
  width: "100%",
4184
4646
  height: "100%"
4185
4647
  }}
4186
- >{props.children}</div></Show12>
4648
+ >{props.children}</div></Show13>
4187
4649
  </div></>;
4188
4650
  }
4189
4651
  var video_default = Video;
@@ -4191,31 +4653,31 @@ var video_default = Video;
4191
4653
  // src/constants/extra-components.ts
4192
4654
  var getExtraComponents = () => [{
4193
4655
  component: custom_code_default,
4194
- ...componentInfo11
4656
+ ...componentInfo12
4195
4657
  }, {
4196
4658
  component: embed_default,
4197
- ...componentInfo12
4659
+ ...componentInfo13
4198
4660
  }, ...TARGET === "rsc" ? [] : [{
4199
4661
  component: form_default,
4200
- ...componentInfo13
4662
+ ...componentInfo14
4201
4663
  }, {
4202
4664
  component: input_default,
4203
- ...componentInfo14
4665
+ ...componentInfo15
4204
4666
  }, {
4205
4667
  component: submit_button_default,
4206
- ...componentInfo16
4668
+ ...componentInfo17
4207
4669
  }, {
4208
4670
  component: select_default,
4209
- ...componentInfo15
4671
+ ...componentInfo16
4210
4672
  }, {
4211
4673
  component: textarea_default,
4212
- ...componentInfo17
4674
+ ...componentInfo18
4213
4675
  }], {
4214
4676
  component: img_default,
4215
- ...componentInfo18
4677
+ ...componentInfo19
4216
4678
  }, {
4217
4679
  component: video_default,
4218
- ...componentInfo19
4680
+ ...componentInfo20
4219
4681
  }];
4220
4682
 
4221
4683
  // src/constants/builder-registered-components.ts
@@ -4233,19 +4695,22 @@ var getDefaultRegisteredComponents = () => [{
4233
4695
  ...componentInfo5
4234
4696
  }, {
4235
4697
  component: section_default,
4236
- ...componentInfo6
4698
+ ...componentInfo7
4237
4699
  }, {
4238
4700
  component: slot_default,
4239
- ...componentInfo7
4701
+ ...componentInfo8
4240
4702
  }, {
4241
4703
  component: symbol_default,
4242
- ...componentInfo8
4704
+ ...componentInfo9
4243
4705
  }, {
4244
4706
  component: text_default,
4245
- ...componentInfo10
4246
- }, ...TARGET === "rsc" ? [] : [{
4707
+ ...componentInfo11
4708
+ }, ...TARGET === "react" ? [{
4709
+ component: personalization_container_default,
4710
+ ...componentInfo6
4711
+ }] : [], ...TARGET === "rsc" ? [] : [{
4247
4712
  component: tabs_default,
4248
- ...componentInfo9
4713
+ ...componentInfo10
4249
4714
  }, {
4250
4715
  component: accordion_default,
4251
4716
  ...componentInfo
@@ -4283,7 +4748,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
4283
4748
  testVariationId: variant.id,
4284
4749
  id: content?.id
4285
4750
  }));
4286
- var checkShouldRenderVariants = ({
4751
+ var checkShouldRenderVariants2 = ({
4287
4752
  canTrack,
4288
4753
  content
4289
4754
  }) => {
@@ -4317,24 +4782,14 @@ var getUpdateVariantVisibilityScript = ({
4317
4782
  "${variationId}", "${contentId}", ${isHydrationTarget}
4318
4783
  )`;
4319
4784
 
4320
- // src/components/inlined-script.tsx
4321
- function InlinedScript(props) {
4322
- return <><script
4323
- innerHTML={props.scriptStr}
4324
- data-id={props.id}
4325
- nonce={props.nonce || ""}
4326
- /></>;
4327
- }
4328
- var Inlined_script_default = InlinedScript;
4329
-
4330
4785
  // src/components/content/components/enable-editor.tsx
4331
4786
  import {
4332
- Show as Show13,
4333
- onMount as onMount5,
4787
+ Show as Show14,
4788
+ onMount as onMount6,
4334
4789
  on as on3,
4335
4790
  createEffect as createEffect3,
4336
- createMemo as createMemo15,
4337
- createSignal as createSignal15
4791
+ createMemo as createMemo16,
4792
+ createSignal as createSignal16
4338
4793
  } from "solid-js";
4339
4794
  import { Dynamic as Dynamic5 } from "solid-js/web";
4340
4795
 
@@ -4344,7 +4799,7 @@ function getPreviewContent(_searchParams) {
4344
4799
  }
4345
4800
 
4346
4801
  // src/constants/sdk-version.ts
4347
- var SDK_VERSION = "3.0.5";
4802
+ var SDK_VERSION = "3.0.7";
4348
4803
 
4349
4804
  // src/helpers/sdk-headers.ts
4350
4805
  var getSdkHeaders = () => ({
@@ -4641,16 +5096,6 @@ async function fetchEntries(options) {
4641
5096
  return _processContentResult(options, content);
4642
5097
  }
4643
5098
 
4644
- // src/functions/is-previewing.ts
4645
- function isPreviewing(_search) {
4646
- const search = _search || (isBrowser() ? window.location.search : void 0);
4647
- if (!search) {
4648
- return false;
4649
- }
4650
- const normalizedSearch = getSearchString(search);
4651
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
4652
- }
4653
-
4654
5099
  // src/helpers/uuid.ts
4655
5100
  function uuidv4() {
4656
5101
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -4977,7 +5422,9 @@ var setupBrowserForEditing = (options = {}) => {
4977
5422
  // Supports builder-model="..." attribute which is needed to
4978
5423
  // scope our '+ add block' button styling
4979
5424
  supportsAddBlockScoping: true,
4980
- supportsCustomBreakpoints: true
5425
+ supportsCustomBreakpoints: true,
5426
+ supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
5427
+ blockLevelPersonalization: true
4981
5428
  }
4982
5429
  }, "*");
4983
5430
  window.parent?.postMessage({
@@ -5192,12 +5639,12 @@ var getWrapperClassName = (variationId) => {
5192
5639
 
5193
5640
  // src/components/content/components/enable-editor.tsx
5194
5641
  function EnableEditor(props) {
5195
- const [ContentWrapper, setContentWrapper] = createSignal15(
5642
+ const [ContentWrapper, setContentWrapper] = createSignal16(
5196
5643
  props.contentWrapper || "div"
5197
5644
  );
5198
- const [httpReqsData, setHttpReqsData] = createSignal15({});
5199
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
5200
- const [clicked, setClicked] = createSignal15(false);
5645
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
5646
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
5647
+ const [clicked, setClicked] = createSignal16(false);
5201
5648
  function mergeNewRootState(newData) {
5202
5649
  const combinedState = {
5203
5650
  ...props.builderContextSignal.rootState,
@@ -5231,7 +5678,7 @@ function EnableEditor(props) {
5231
5678
  content: newContentValue
5232
5679
  }));
5233
5680
  }
5234
- const showContentProps = createMemo15(() => {
5681
+ const showContentProps = createMemo16(() => {
5235
5682
  return props.showContent ? {} : {
5236
5683
  hidden: true,
5237
5684
  "aria-hidden": true
@@ -5338,7 +5785,7 @@ function EnableEditor(props) {
5338
5785
  let elementRef;
5339
5786
  runHttpRequests();
5340
5787
  emitStateUpdate();
5341
- onMount5(() => {
5788
+ onMount6(() => {
5342
5789
  if (isBrowser()) {
5343
5790
  if (isEditing() && !props.isNestedRender) {
5344
5791
  window.addEventListener("message", processMessage);
@@ -5407,14 +5854,14 @@ function EnableEditor(props) {
5407
5854
  }
5408
5855
  }
5409
5856
  });
5410
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
5857
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
5411
5858
  function onUpdateFn_0() {
5412
5859
  if (props.content) {
5413
5860
  mergeNewContent(props.content);
5414
5861
  }
5415
5862
  }
5416
5863
  createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
5417
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo15(
5864
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
5418
5865
  () => props.builderContextSignal.rootState
5419
5866
  );
5420
5867
  function onUpdateFn_1() {
@@ -5426,14 +5873,14 @@ function EnableEditor(props) {
5426
5873
  onUpdateFn_1
5427
5874
  )
5428
5875
  );
5429
- const onUpdateFn_2_props_data = createMemo15(() => props.data);
5876
+ const onUpdateFn_2_props_data = createMemo16(() => props.data);
5430
5877
  function onUpdateFn_2() {
5431
5878
  if (props.data) {
5432
5879
  mergeNewRootState(props.data);
5433
5880
  }
5434
5881
  }
5435
5882
  createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
5436
- const onUpdateFn_3_props_locale = createMemo15(() => props.locale);
5883
+ const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
5437
5884
  function onUpdateFn_3() {
5438
5885
  if (props.locale) {
5439
5886
  mergeNewRootState({
@@ -5442,7 +5889,7 @@ function EnableEditor(props) {
5442
5889
  }
5443
5890
  }
5444
5891
  createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
5445
- return <><builder_context_default.Provider value={props.builderContextSignal}><Show13
5892
+ return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
5446
5893
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
5447
5894
  ><Dynamic5
5448
5895
  class={getWrapperClassName(
@@ -5460,14 +5907,14 @@ function EnableEditor(props) {
5460
5907
  {...showContentProps()}
5461
5908
  {...props.contentWrapperProps}
5462
5909
  component={ContentWrapper()}
5463
- >{props.children}</Dynamic5></Show13></builder_context_default.Provider></>;
5910
+ >{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
5464
5911
  }
5465
5912
  var Enable_editor_default = EnableEditor;
5466
5913
 
5467
5914
  // src/components/content/components/styles.tsx
5468
- import { createSignal as createSignal16 } from "solid-js";
5915
+ import { createSignal as createSignal17 } from "solid-js";
5469
5916
  function ContentStyles(props) {
5470
- const [injectedStyles, setInjectedStyles] = createSignal16(
5917
+ const [injectedStyles, setInjectedStyles] = createSignal17(
5471
5918
  `
5472
5919
  ${getCss({
5473
5920
  cssCode: props.cssCode,
@@ -5525,7 +5972,7 @@ var getContentInitialValue = ({
5525
5972
 
5526
5973
  // src/components/content/content.tsx
5527
5974
  function ContentComponent(props) {
5528
- const [scriptStr, setScriptStr] = createSignal17(
5975
+ const [scriptStr, setScriptStr] = createSignal18(
5529
5976
  getUpdateVariantVisibilityScript({
5530
5977
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5531
5978
  variationId: props.content?.testVariationId,
@@ -5533,7 +5980,7 @@ function ContentComponent(props) {
5533
5980
  contentId: props.content?.id
5534
5981
  })
5535
5982
  );
5536
- const [registeredComponents, setRegisteredComponents] = createSignal17(
5983
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
5537
5984
  [
5538
5985
  ...getDefaultRegisteredComponents(),
5539
5986
  ...props.customComponents || []
@@ -5548,7 +5995,7 @@ function ContentComponent(props) {
5548
5995
  {}
5549
5996
  )
5550
5997
  );
5551
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
5998
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
5552
5999
  content: getContentInitialValue({
5553
6000
  content: props.content,
5554
6001
  data: props.data
@@ -5632,18 +6079,18 @@ function ContentComponent(props) {
5632
6079
  setBuilderContextSignal
5633
6080
  }}
5634
6081
  >
5635
- <Show14 when={props.isSsrAbTest}><Inlined_script_default
6082
+ <Show15 when={props.isSsrAbTest}><Inlined_script_default
5636
6083
  id="builderio-variant-visibility"
5637
6084
  scriptStr={scriptStr()}
5638
6085
  nonce={props.nonce || ""}
5639
- /></Show14>
5640
- <Show14 when={TARGET !== "reactNative"}><Styles_default
6086
+ /></Show15>
6087
+ <Show15 when={TARGET !== "reactNative"}><Styles_default
5641
6088
  nonce={props.nonce || ""}
5642
6089
  isNestedRender={props.isNestedRender}
5643
6090
  contentId={builderContextSignal().content?.id}
5644
6091
  cssCode={builderContextSignal().content?.data?.cssCode}
5645
6092
  customFonts={builderContextSignal().content?.data?.customFonts}
5646
- /></Show14>
6093
+ /></Show15>
5647
6094
  <Blocks_default
5648
6095
  blocks={builderContextSignal().content?.data?.blocks}
5649
6096
  context={builderContextSignal()}
@@ -5656,13 +6103,13 @@ var Content_default = ContentComponent;
5656
6103
 
5657
6104
  // src/components/content-variants/content-variants.tsx
5658
6105
  function ContentVariants(props) {
5659
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
5660
- checkShouldRenderVariants({
6106
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
6107
+ checkShouldRenderVariants2({
5661
6108
  canTrack: getDefaultCanTrack(props.canTrack),
5662
6109
  content: props.content
5663
6110
  })
5664
6111
  );
5665
- const updateCookieAndStylesScriptStr = createMemo18(() => {
6112
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
5666
6113
  return getUpdateCookieAndStylesScript(
5667
6114
  getVariants(props.content).map((value) => ({
5668
6115
  id: value.testVariationId,
@@ -5671,10 +6118,10 @@ function ContentVariants(props) {
5671
6118
  props.content?.id || ""
5672
6119
  );
5673
6120
  });
5674
- const hideVariantsStyleString = createMemo18(() => {
6121
+ const hideVariantsStyleString = createMemo19(() => {
5675
6122
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5676
6123
  });
5677
- const defaultContent = createMemo18(() => {
6124
+ const defaultContent = createMemo19(() => {
5678
6125
  return shouldRenderVariants() ? {
5679
6126
  ...props.content,
5680
6127
  testVariationId: props.content?.id
@@ -5683,16 +6130,16 @@ function ContentVariants(props) {
5683
6130
  canTrack: getDefaultCanTrack(props.canTrack)
5684
6131
  });
5685
6132
  });
5686
- onMount6(() => {
6133
+ onMount7(() => {
5687
6134
  setShouldRenderVariants(false);
5688
6135
  });
5689
6136
  return <><>
5690
- <Show15 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
6137
+ <Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5691
6138
  id="builderio-init-variants-fns"
5692
6139
  scriptStr={getInitVariantsFnsScriptString()}
5693
6140
  nonce={props.nonce || ""}
5694
- /></Show15>
5695
- <Show15 when={shouldRenderVariants()}>
6141
+ /></Show16>
6142
+ <Show16 when={shouldRenderVariants()}>
5696
6143
  <Inlined_styles_default
5697
6144
  id="builderio-variants"
5698
6145
  styles={hideVariantsStyleString()}
@@ -5703,7 +6150,7 @@ function ContentVariants(props) {
5703
6150
  scriptStr={updateCookieAndStylesScriptStr()}
5704
6151
  nonce={props.nonce || ""}
5705
6152
  />
5706
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
6153
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
5707
6154
  const index = _index();
5708
6155
  return <Content_default
5709
6156
  apiHost={props.apiHost}
@@ -5730,8 +6177,8 @@ function ContentVariants(props) {
5730
6177
  trustedHosts={props.trustedHosts}
5731
6178
  {...{}}
5732
6179
  />;
5733
- }}</For8>
5734
- </Show15>
6180
+ }}</For9>
6181
+ </Show16>
5735
6182
  <Content_default
5736
6183
  apiHost={props.apiHost}
5737
6184
  nonce={props.nonce}
@@ -5786,14 +6233,14 @@ var fetchSymbolContent = async ({
5786
6233
 
5787
6234
  // src/blocks/symbol/symbol.tsx
5788
6235
  function Symbol(props) {
5789
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5790
- const blocksWrapper = createMemo19(() => {
6236
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
6237
+ const blocksWrapper = createMemo20(() => {
5791
6238
  return "div";
5792
6239
  });
5793
- const contentWrapper = createMemo19(() => {
6240
+ const contentWrapper = createMemo20(() => {
5794
6241
  return "div";
5795
6242
  });
5796
- const className = createMemo19(() => {
6243
+ const className = createMemo20(() => {
5797
6244
  return [
5798
6245
  ...[props.attributes[getClassPropName()]],
5799
6246
  "builder-symbol",
@@ -5813,9 +6260,9 @@ function Symbol(props) {
5813
6260
  }
5814
6261
  });
5815
6262
  }
5816
- onMount7(() => {
6263
+ onMount8(() => {
5817
6264
  });
5818
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
6265
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
5819
6266
  function onUpdateFn_0() {
5820
6267
  setContent();
5821
6268
  }
@@ -5900,6 +6347,7 @@ export {
5900
6347
  isEditing,
5901
6348
  isPreviewing,
5902
6349
  register,
6350
+ setClientUserAttributes,
5903
6351
  setEditorSettings,
5904
6352
  subscribeToEditor,
5905
6353
  track