@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.
- package/dist/index.d.ts +8 -2
- package/lib/browser/dev.js +562 -110
- package/lib/browser/dev.jsx +596 -148
- package/lib/browser/index.js +562 -110
- package/lib/browser/index.jsx +596 -148
- package/lib/edge/dev.js +562 -110
- package/lib/edge/dev.jsx +596 -148
- package/lib/edge/index.js +562 -110
- package/lib/edge/index.jsx +596 -148
- package/lib/node/dev.js +562 -110
- package/lib/node/dev.jsx +596 -148
- package/lib/node/index.js +562 -110
- package/lib/node/index.jsx +596 -148
- package/package.json +1 -1
package/lib/browser/index.jsx
CHANGED
|
@@ -928,8 +928,13 @@ import { Show as Show2, createMemo } from "solid-js";
|
|
|
928
928
|
|
|
929
929
|
// src/constants/device-sizes.ts
|
|
930
930
|
var SIZES = {
|
|
931
|
+
xsmall: {
|
|
932
|
+
min: 0,
|
|
933
|
+
default: 160,
|
|
934
|
+
max: 320
|
|
935
|
+
},
|
|
931
936
|
small: {
|
|
932
|
-
min:
|
|
937
|
+
min: 321,
|
|
933
938
|
default: 321,
|
|
934
939
|
max: 640
|
|
935
940
|
},
|
|
@@ -945,15 +950,28 @@ var SIZES = {
|
|
|
945
950
|
}
|
|
946
951
|
};
|
|
947
952
|
var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
948
|
-
var getSizesForBreakpoints = ({
|
|
949
|
-
small,
|
|
950
|
-
medium
|
|
951
|
-
}) => {
|
|
953
|
+
var getSizesForBreakpoints = (breakpoints) => {
|
|
952
954
|
const newSizes = fastClone(SIZES);
|
|
955
|
+
if (!breakpoints) {
|
|
956
|
+
return newSizes;
|
|
957
|
+
}
|
|
958
|
+
const {
|
|
959
|
+
xsmall,
|
|
960
|
+
small,
|
|
961
|
+
medium
|
|
962
|
+
} = breakpoints;
|
|
963
|
+
if (xsmall) {
|
|
964
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
965
|
+
newSizes.xsmall = {
|
|
966
|
+
max: xsmall,
|
|
967
|
+
min: xsmallMin,
|
|
968
|
+
default: xsmallMin + 1
|
|
969
|
+
};
|
|
970
|
+
}
|
|
953
971
|
if (!small || !medium) {
|
|
954
972
|
return newSizes;
|
|
955
973
|
}
|
|
956
|
-
const smallMin = Math.floor(small / 2);
|
|
974
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
957
975
|
newSizes.small = {
|
|
958
976
|
max: small,
|
|
959
977
|
min: smallMin,
|
|
@@ -1004,9 +1022,13 @@ function BlockStyles(props) {
|
|
|
1004
1022
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
1005
1023
|
content?.meta?.breakpoints || {}
|
|
1006
1024
|
);
|
|
1025
|
+
const contentHasXSmallBreakpoint = Boolean(
|
|
1026
|
+
content?.meta?.breakpoints?.xsmall
|
|
1027
|
+
);
|
|
1007
1028
|
const largeStyles = styles?.large;
|
|
1008
1029
|
const mediumStyles = styles?.medium;
|
|
1009
1030
|
const smallStyles = styles?.small;
|
|
1031
|
+
const xsmallStyles = styles?.xsmall;
|
|
1010
1032
|
const className = processedBlock.id;
|
|
1011
1033
|
if (!className) {
|
|
1012
1034
|
return "";
|
|
@@ -1031,6 +1053,14 @@ function BlockStyles(props) {
|
|
|
1031
1053
|
sizesWithUpdatedBreakpoints
|
|
1032
1054
|
)
|
|
1033
1055
|
}) : "";
|
|
1056
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
1057
|
+
className,
|
|
1058
|
+
styles: xsmallStyles,
|
|
1059
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
1060
|
+
"xsmall",
|
|
1061
|
+
sizesWithUpdatedBreakpoints
|
|
1062
|
+
)
|
|
1063
|
+
}) : "";
|
|
1034
1064
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
1035
1065
|
let hoverStylesClass = "";
|
|
1036
1066
|
if (hoverAnimation) {
|
|
@@ -1050,6 +1080,7 @@ function BlockStyles(props) {
|
|
|
1050
1080
|
largeStylesClass,
|
|
1051
1081
|
mediumStylesClass,
|
|
1052
1082
|
smallStylesClass,
|
|
1083
|
+
xsmallStylesClass,
|
|
1053
1084
|
hoverStylesClass
|
|
1054
1085
|
].join(" ");
|
|
1055
1086
|
});
|
|
@@ -1456,8 +1487,9 @@ function BlocksWrapper(props) {
|
|
|
1456
1487
|
if (!props.path) {
|
|
1457
1488
|
return void 0;
|
|
1458
1489
|
}
|
|
1490
|
+
const thisPrefix = "this.";
|
|
1459
1491
|
const pathPrefix = "component.options.";
|
|
1460
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1492
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1461
1493
|
});
|
|
1462
1494
|
function onClick() {
|
|
1463
1495
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -1492,7 +1524,7 @@ function BlocksWrapper(props) {
|
|
|
1492
1524
|
});
|
|
1493
1525
|
return <>
|
|
1494
1526
|
<Dynamic4
|
|
1495
|
-
class={className() + " dynamic-
|
|
1527
|
+
class={className() + " dynamic-3d7ff108"}
|
|
1496
1528
|
ref={blocksWrapperRef}
|
|
1497
1529
|
builder-path={dataPath()}
|
|
1498
1530
|
builder-parent-id={props.parent}
|
|
@@ -1504,7 +1536,7 @@ function BlocksWrapper(props) {
|
|
|
1504
1536
|
{...props.BlocksWrapperProps}
|
|
1505
1537
|
component={props.BlocksWrapper}
|
|
1506
1538
|
>{props.children}</Dynamic4>
|
|
1507
|
-
<style>{`.dynamic-
|
|
1539
|
+
<style>{`.dynamic-3d7ff108 {
|
|
1508
1540
|
display: flex;
|
|
1509
1541
|
flex-direction: column;
|
|
1510
1542
|
align-items: stretch;
|
|
@@ -1876,10 +1908,10 @@ function SectionComponent(props) {
|
|
|
1876
1908
|
var section_default = SectionComponent;
|
|
1877
1909
|
|
|
1878
1910
|
// src/blocks/symbol/symbol.tsx
|
|
1879
|
-
import { onMount as
|
|
1911
|
+
import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
1880
1912
|
|
|
1881
1913
|
// src/components/content-variants/content-variants.tsx
|
|
1882
|
-
import { Show as
|
|
1914
|
+
import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
1883
1915
|
|
|
1884
1916
|
// src/helpers/url.ts
|
|
1885
1917
|
var getTopLevelDomain = (host) => {
|
|
@@ -2069,11 +2101,61 @@ var handleABTesting = async ({
|
|
|
2069
2101
|
};
|
|
2070
2102
|
};
|
|
2071
2103
|
|
|
2104
|
+
// src/helpers/user-attributes.ts
|
|
2105
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2106
|
+
function createUserAttributesService() {
|
|
2107
|
+
let canTrack = true;
|
|
2108
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
2109
|
+
return {
|
|
2110
|
+
setUserAttributes(newAttrs) {
|
|
2111
|
+
if (!isBrowser()) {
|
|
2112
|
+
return;
|
|
2113
|
+
}
|
|
2114
|
+
const userAttributes = {
|
|
2115
|
+
...this.getUserAttributes(),
|
|
2116
|
+
...newAttrs
|
|
2117
|
+
};
|
|
2118
|
+
setCookie({
|
|
2119
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2120
|
+
value: JSON.stringify(userAttributes),
|
|
2121
|
+
canTrack
|
|
2122
|
+
});
|
|
2123
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
2124
|
+
},
|
|
2125
|
+
getUserAttributes() {
|
|
2126
|
+
if (!isBrowser()) {
|
|
2127
|
+
return {};
|
|
2128
|
+
}
|
|
2129
|
+
return JSON.parse(getCookieSync({
|
|
2130
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2131
|
+
canTrack
|
|
2132
|
+
}) || "{}");
|
|
2133
|
+
},
|
|
2134
|
+
subscribeOnUserAttributesChange(callback) {
|
|
2135
|
+
subscribers.add(callback);
|
|
2136
|
+
return () => {
|
|
2137
|
+
subscribers.delete(callback);
|
|
2138
|
+
};
|
|
2139
|
+
},
|
|
2140
|
+
setCanTrack(value) {
|
|
2141
|
+
canTrack = value;
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
var userAttributesService = createUserAttributesService();
|
|
2146
|
+
var setClientUserAttributes = (attributes) => {
|
|
2147
|
+
userAttributesService.setUserAttributes(attributes);
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2072
2150
|
// src/helpers/canTrack.ts
|
|
2073
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
2151
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
2152
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
2153
|
+
userAttributesService.setCanTrack(result);
|
|
2154
|
+
return result;
|
|
2155
|
+
};
|
|
2074
2156
|
|
|
2075
2157
|
// src/components/content/content.tsx
|
|
2076
|
-
import { Show as
|
|
2158
|
+
import { Show as Show15, createSignal as createSignal18 } from "solid-js";
|
|
2077
2159
|
|
|
2078
2160
|
// src/blocks/accordion/component-info.ts
|
|
2079
2161
|
var defaultTitle = {
|
|
@@ -2767,8 +2849,388 @@ var componentInfo5 = {
|
|
|
2767
2849
|
}
|
|
2768
2850
|
};
|
|
2769
2851
|
|
|
2770
|
-
// src/blocks/
|
|
2852
|
+
// src/blocks/personalization-container/component-info.ts
|
|
2771
2853
|
var componentInfo6 = {
|
|
2854
|
+
name: "PersonalizationContainer",
|
|
2855
|
+
shouldReceiveBuilderProps: {
|
|
2856
|
+
builderBlock: true,
|
|
2857
|
+
builderContext: true
|
|
2858
|
+
},
|
|
2859
|
+
noWrap: true,
|
|
2860
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
2861
|
+
canHaveChildren: true,
|
|
2862
|
+
inputs: [{
|
|
2863
|
+
name: "variants",
|
|
2864
|
+
defaultValue: [],
|
|
2865
|
+
behavior: "personalizationVariantList",
|
|
2866
|
+
type: "list",
|
|
2867
|
+
subFields: [{
|
|
2868
|
+
name: "name",
|
|
2869
|
+
type: "text"
|
|
2870
|
+
}, {
|
|
2871
|
+
name: "query",
|
|
2872
|
+
friendlyName: "Targeting rules",
|
|
2873
|
+
type: "BuilderQuery",
|
|
2874
|
+
defaultValue: []
|
|
2875
|
+
}, {
|
|
2876
|
+
name: "startDate",
|
|
2877
|
+
type: "date"
|
|
2878
|
+
}, {
|
|
2879
|
+
name: "endDate",
|
|
2880
|
+
type: "date"
|
|
2881
|
+
}, {
|
|
2882
|
+
name: "blocks",
|
|
2883
|
+
type: "uiBlocks",
|
|
2884
|
+
hideFromUI: true,
|
|
2885
|
+
defaultValue: []
|
|
2886
|
+
}]
|
|
2887
|
+
}]
|
|
2888
|
+
};
|
|
2889
|
+
|
|
2890
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
2891
|
+
import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
2892
|
+
|
|
2893
|
+
// src/components/inlined-script.tsx
|
|
2894
|
+
function InlinedScript(props) {
|
|
2895
|
+
return <><script
|
|
2896
|
+
innerHTML={props.scriptStr}
|
|
2897
|
+
data-id={props.id}
|
|
2898
|
+
nonce={props.nonce || ""}
|
|
2899
|
+
/></>;
|
|
2900
|
+
}
|
|
2901
|
+
var Inlined_script_default = InlinedScript;
|
|
2902
|
+
|
|
2903
|
+
// src/functions/is-previewing.ts
|
|
2904
|
+
function isPreviewing(_search) {
|
|
2905
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
2906
|
+
if (!search) {
|
|
2907
|
+
return false;
|
|
2908
|
+
}
|
|
2909
|
+
const normalizedSearch = getSearchString(search);
|
|
2910
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
2914
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
2915
|
+
function isString(val) {
|
|
2916
|
+
return typeof val === "string";
|
|
2917
|
+
}
|
|
2918
|
+
function isNumber(val) {
|
|
2919
|
+
return typeof val === "number";
|
|
2920
|
+
}
|
|
2921
|
+
function objectMatchesQuery(userattr, query2) {
|
|
2922
|
+
const result = (() => {
|
|
2923
|
+
const property = query2.property;
|
|
2924
|
+
const operator = query2.operator;
|
|
2925
|
+
let testValue = query2.value;
|
|
2926
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
2927
|
+
testValue = query2.value.slice(0, -1);
|
|
2928
|
+
}
|
|
2929
|
+
if (!(property && operator)) {
|
|
2930
|
+
return true;
|
|
2931
|
+
}
|
|
2932
|
+
if (Array.isArray(testValue)) {
|
|
2933
|
+
if (operator === "isNot") {
|
|
2934
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
2935
|
+
property,
|
|
2936
|
+
operator,
|
|
2937
|
+
value: val
|
|
2938
|
+
}));
|
|
2939
|
+
}
|
|
2940
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
2941
|
+
property,
|
|
2942
|
+
operator,
|
|
2943
|
+
value: val
|
|
2944
|
+
}));
|
|
2945
|
+
}
|
|
2946
|
+
const value = userattr[property];
|
|
2947
|
+
if (Array.isArray(value)) {
|
|
2948
|
+
return value.includes(testValue);
|
|
2949
|
+
}
|
|
2950
|
+
switch (operator) {
|
|
2951
|
+
case "is":
|
|
2952
|
+
return value === testValue;
|
|
2953
|
+
case "isNot":
|
|
2954
|
+
return value !== testValue;
|
|
2955
|
+
case "contains":
|
|
2956
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
2957
|
+
case "startsWith":
|
|
2958
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
2959
|
+
case "endsWith":
|
|
2960
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
2961
|
+
case "greaterThan":
|
|
2962
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
2963
|
+
case "lessThan":
|
|
2964
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
2965
|
+
case "greaterThanOrEqualTo":
|
|
2966
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
2967
|
+
case "lessThanOrEqualTo":
|
|
2968
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
2969
|
+
default:
|
|
2970
|
+
return false;
|
|
2971
|
+
}
|
|
2972
|
+
})();
|
|
2973
|
+
return result;
|
|
2974
|
+
}
|
|
2975
|
+
const item = {
|
|
2976
|
+
query,
|
|
2977
|
+
startDate,
|
|
2978
|
+
endDate
|
|
2979
|
+
};
|
|
2980
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
2981
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
2982
|
+
return false;
|
|
2983
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
2984
|
+
return false;
|
|
2985
|
+
}
|
|
2986
|
+
if (!item.query || !item.query.length) {
|
|
2987
|
+
return true;
|
|
2988
|
+
}
|
|
2989
|
+
return item.query.every((filter) => {
|
|
2990
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
2994
|
+
if (!navigator.cookieEnabled) {
|
|
2995
|
+
return;
|
|
2996
|
+
}
|
|
2997
|
+
function getCookie(name) {
|
|
2998
|
+
const nameEQ = name + '=';
|
|
2999
|
+
const ca = document.cookie.split(';');
|
|
3000
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3001
|
+
let c = ca[i];
|
|
3002
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
3003
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
3004
|
+
}
|
|
3005
|
+
return null;
|
|
3006
|
+
}
|
|
3007
|
+
function removeVariants() {
|
|
3008
|
+
variants?.forEach(function (_, index) {
|
|
3009
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
3010
|
+
});
|
|
3011
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
3012
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
3013
|
+
}
|
|
3014
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
3015
|
+
if (locale) {
|
|
3016
|
+
attributes.locale = locale;
|
|
3017
|
+
}
|
|
3018
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
3019
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
3020
|
+
});
|
|
3021
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
3022
|
+
if (isDebug) {
|
|
3023
|
+
console.debug('PersonalizationContainer', {
|
|
3024
|
+
attributes,
|
|
3025
|
+
variants,
|
|
3026
|
+
winningVariantIndex
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
if (winningVariantIndex !== -1) {
|
|
3030
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
3031
|
+
if (winningVariant) {
|
|
3032
|
+
const parentNode = winningVariant.parentNode;
|
|
3033
|
+
if (parentNode) {
|
|
3034
|
+
const newParent = parentNode.cloneNode(false);
|
|
3035
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
3036
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
3037
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
3038
|
+
}
|
|
3039
|
+
if (isDebug) {
|
|
3040
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
} else if (variants && variants.length > 0) {
|
|
3044
|
+
removeVariants();
|
|
3045
|
+
}
|
|
3046
|
+
}`;
|
|
3047
|
+
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}";
|
|
3048
|
+
|
|
3049
|
+
// src/blocks/personalization-container/helpers.ts
|
|
3050
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
3051
|
+
const hasVariants = variants && variants.length > 0;
|
|
3052
|
+
if (TARGET === "reactNative")
|
|
3053
|
+
return false;
|
|
3054
|
+
if (!hasVariants)
|
|
3055
|
+
return false;
|
|
3056
|
+
if (!canTrack)
|
|
3057
|
+
return false;
|
|
3058
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
3059
|
+
return true;
|
|
3060
|
+
if (isBrowser())
|
|
3061
|
+
return false;
|
|
3062
|
+
return true;
|
|
3063
|
+
}
|
|
3064
|
+
function getBlocksToRender({
|
|
3065
|
+
variants,
|
|
3066
|
+
previewingIndex,
|
|
3067
|
+
isHydrated,
|
|
3068
|
+
filteredVariants,
|
|
3069
|
+
fallbackBlocks
|
|
3070
|
+
}) {
|
|
3071
|
+
const fallback = {
|
|
3072
|
+
blocks: fallbackBlocks ?? [],
|
|
3073
|
+
path: "this.children"
|
|
3074
|
+
};
|
|
3075
|
+
if (isHydrated && isEditing()) {
|
|
3076
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
3077
|
+
const variant = variants[previewingIndex];
|
|
3078
|
+
return {
|
|
3079
|
+
blocks: variant.blocks,
|
|
3080
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
3081
|
+
};
|
|
3082
|
+
}
|
|
3083
|
+
return fallback;
|
|
3084
|
+
}
|
|
3085
|
+
if (isBrowser()) {
|
|
3086
|
+
const winningVariant = filteredVariants?.[0];
|
|
3087
|
+
if (winningVariant) {
|
|
3088
|
+
return {
|
|
3089
|
+
blocks: winningVariant.blocks,
|
|
3090
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
3091
|
+
};
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
return fallback;
|
|
3095
|
+
}
|
|
3096
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
3097
|
+
return `
|
|
3098
|
+
(function() {
|
|
3099
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
3100
|
+
${PERSONALIZATION_SCRIPT}
|
|
3101
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
3102
|
+
})();
|
|
3103
|
+
`;
|
|
3104
|
+
};
|
|
3105
|
+
|
|
3106
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
3107
|
+
function PersonalizationContainer(props) {
|
|
3108
|
+
const [userAttributes, setUserAttributes] = createSignal10(
|
|
3109
|
+
userAttributesService.getUserAttributes()
|
|
3110
|
+
);
|
|
3111
|
+
const [scriptStr, setScriptStr] = createSignal10(
|
|
3112
|
+
getPersonalizationScript(
|
|
3113
|
+
props.variants,
|
|
3114
|
+
props.builderBlock?.id || "none",
|
|
3115
|
+
props.builderContext?.rootState?.locale
|
|
3116
|
+
)
|
|
3117
|
+
);
|
|
3118
|
+
const [unsubscribers, setUnsubscribers] = createSignal10([]);
|
|
3119
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
|
|
3120
|
+
checkShouldRenderVariants(
|
|
3121
|
+
props.variants,
|
|
3122
|
+
getDefaultCanTrack(props.builderContext?.canTrack)
|
|
3123
|
+
)
|
|
3124
|
+
);
|
|
3125
|
+
const [isHydrated, setIsHydrated] = createSignal10(false);
|
|
3126
|
+
const filteredVariants = createMemo10(() => {
|
|
3127
|
+
return (props.variants || []).filter((variant) => {
|
|
3128
|
+
return filterWithCustomTargeting(
|
|
3129
|
+
{
|
|
3130
|
+
...props.builderContext?.rootState?.locale ? {
|
|
3131
|
+
locale: props.builderContext?.rootState?.locale
|
|
3132
|
+
} : {},
|
|
3133
|
+
...userAttributes()
|
|
3134
|
+
},
|
|
3135
|
+
variant.query,
|
|
3136
|
+
variant.startDate,
|
|
3137
|
+
variant.endDate
|
|
3138
|
+
);
|
|
3139
|
+
});
|
|
3140
|
+
});
|
|
3141
|
+
const blocksToRender = createMemo10(() => {
|
|
3142
|
+
return getBlocksToRender({
|
|
3143
|
+
variants: props.variants,
|
|
3144
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
3145
|
+
isHydrated: isHydrated(),
|
|
3146
|
+
filteredVariants: filteredVariants(),
|
|
3147
|
+
previewingIndex: props.previewingIndex
|
|
3148
|
+
});
|
|
3149
|
+
});
|
|
3150
|
+
const hideVariantsStyleString = createMemo10(() => {
|
|
3151
|
+
return (props.variants || []).map(
|
|
3152
|
+
(_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
|
|
3153
|
+
).join("");
|
|
3154
|
+
});
|
|
3155
|
+
let rootRef;
|
|
3156
|
+
onMount4(() => {
|
|
3157
|
+
setIsHydrated(true);
|
|
3158
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
3159
|
+
(attrs) => {
|
|
3160
|
+
setUserAttributes(attrs);
|
|
3161
|
+
}
|
|
3162
|
+
);
|
|
3163
|
+
if (!(isEditing() || isPreviewing())) {
|
|
3164
|
+
const variant = filteredVariants()[0];
|
|
3165
|
+
if (rootRef) {
|
|
3166
|
+
rootRef.dispatchEvent(
|
|
3167
|
+
new CustomEvent("builder.variantLoaded", {
|
|
3168
|
+
detail: {
|
|
3169
|
+
variant: variant || "default",
|
|
3170
|
+
content: props.builderContext?.content
|
|
3171
|
+
},
|
|
3172
|
+
bubbles: true
|
|
3173
|
+
})
|
|
3174
|
+
);
|
|
3175
|
+
const observer = new IntersectionObserver((entries) => {
|
|
3176
|
+
entries.forEach((entry) => {
|
|
3177
|
+
if (entry.isIntersecting && rootRef) {
|
|
3178
|
+
rootRef.dispatchEvent(
|
|
3179
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
3180
|
+
detail: {
|
|
3181
|
+
variant: variant || "default",
|
|
3182
|
+
content: props.builderContext?.content
|
|
3183
|
+
},
|
|
3184
|
+
bubbles: true
|
|
3185
|
+
})
|
|
3186
|
+
);
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
});
|
|
3190
|
+
observer.observe(rootRef);
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
unsubscribers().push(unsub);
|
|
3194
|
+
});
|
|
3195
|
+
return <><div
|
|
3196
|
+
class={`builder-personalization-container ${props.attributes?.className || ""}`}
|
|
3197
|
+
ref={rootRef}
|
|
3198
|
+
{...props.attributes}
|
|
3199
|
+
>
|
|
3200
|
+
<Show10 when={shouldRenderVariants()}>
|
|
3201
|
+
<For6 each={props.variants}>{(variant, _index) => {
|
|
3202
|
+
const index = _index();
|
|
3203
|
+
return <template
|
|
3204
|
+
key={index}
|
|
3205
|
+
data-variant-id={`${props.builderBlock?.id}-${index}`}
|
|
3206
|
+
><Blocks_default
|
|
3207
|
+
blocks={variant.blocks}
|
|
3208
|
+
parent={props.builderBlock?.id}
|
|
3209
|
+
path={`component.options.variants.${index}.blocks`}
|
|
3210
|
+
/></template>;
|
|
3211
|
+
}}</For6>
|
|
3212
|
+
<Inlined_styles_default
|
|
3213
|
+
nonce={props.builderContext?.nonce || ""}
|
|
3214
|
+
styles={hideVariantsStyleString()}
|
|
3215
|
+
id={`variants-styles-${props.builderBlock?.id}`}
|
|
3216
|
+
/>
|
|
3217
|
+
<Inlined_script_default
|
|
3218
|
+
nonce={props.builderContext?.nonce || ""}
|
|
3219
|
+
scriptStr={scriptStr()}
|
|
3220
|
+
id={`variants-script-${props.builderBlock?.id}`}
|
|
3221
|
+
/>
|
|
3222
|
+
</Show10>
|
|
3223
|
+
<Blocks_default
|
|
3224
|
+
blocks={blocksToRender().blocks}
|
|
3225
|
+
parent={props.builderBlock?.id}
|
|
3226
|
+
path={blocksToRender().path}
|
|
3227
|
+
/>
|
|
3228
|
+
</div></>;
|
|
3229
|
+
}
|
|
3230
|
+
var personalization_container_default = PersonalizationContainer;
|
|
3231
|
+
|
|
3232
|
+
// src/blocks/section/component-info.ts
|
|
3233
|
+
var componentInfo7 = {
|
|
2772
3234
|
name: "Core:Section",
|
|
2773
3235
|
static: true,
|
|
2774
3236
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2810,7 +3272,7 @@ var componentInfo6 = {
|
|
|
2810
3272
|
};
|
|
2811
3273
|
|
|
2812
3274
|
// src/blocks/slot/component-info.ts
|
|
2813
|
-
var
|
|
3275
|
+
var componentInfo8 = {
|
|
2814
3276
|
name: "Slot",
|
|
2815
3277
|
isRSC: true,
|
|
2816
3278
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2849,7 +3311,7 @@ function Slot(props) {
|
|
|
2849
3311
|
var slot_default = Slot;
|
|
2850
3312
|
|
|
2851
3313
|
// src/blocks/symbol/component-info.ts
|
|
2852
|
-
var
|
|
3314
|
+
var componentInfo9 = {
|
|
2853
3315
|
name: "Symbol",
|
|
2854
3316
|
noWrap: true,
|
|
2855
3317
|
static: true,
|
|
@@ -2931,7 +3393,7 @@ var defaultElement = {
|
|
|
2931
3393
|
}
|
|
2932
3394
|
}
|
|
2933
3395
|
};
|
|
2934
|
-
var
|
|
3396
|
+
var componentInfo10 = {
|
|
2935
3397
|
name: "Builder: Tabs",
|
|
2936
3398
|
inputs: [{
|
|
2937
3399
|
name: "tabs",
|
|
@@ -3037,9 +3499,9 @@ var componentInfo9 = {
|
|
|
3037
3499
|
};
|
|
3038
3500
|
|
|
3039
3501
|
// src/blocks/tabs/tabs.tsx
|
|
3040
|
-
import { Show as
|
|
3502
|
+
import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
|
|
3041
3503
|
function Tabs(props) {
|
|
3042
|
-
const [activeTab, setActiveTab] =
|
|
3504
|
+
const [activeTab, setActiveTab] = createSignal11(
|
|
3043
3505
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
3044
3506
|
);
|
|
3045
3507
|
function activeTabContent(active) {
|
|
@@ -3061,7 +3523,7 @@ function Tabs(props) {
|
|
|
3061
3523
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
3062
3524
|
overflow: "auto"
|
|
3063
3525
|
}}
|
|
3064
|
-
><
|
|
3526
|
+
><For7 each={props.tabs}>{(tab, _index) => {
|
|
3065
3527
|
const index = _index();
|
|
3066
3528
|
return <span
|
|
3067
3529
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
@@ -3078,21 +3540,21 @@ function Tabs(props) {
|
|
|
3078
3540
|
registeredComponents={props.builderComponents}
|
|
3079
3541
|
linkComponent={props.builderLinkComponent}
|
|
3080
3542
|
/></span>;
|
|
3081
|
-
}}</
|
|
3082
|
-
<
|
|
3543
|
+
}}</For7></div>
|
|
3544
|
+
<Show11 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
3083
3545
|
parent={props.builderBlock.id}
|
|
3084
3546
|
path={`tabs.${activeTab()}.content`}
|
|
3085
3547
|
blocks={activeTabContent(activeTab())}
|
|
3086
3548
|
context={props.builderContext}
|
|
3087
3549
|
registeredComponents={props.builderComponents}
|
|
3088
3550
|
linkComponent={props.builderLinkComponent}
|
|
3089
|
-
/></div></
|
|
3551
|
+
/></div></Show11>
|
|
3090
3552
|
</div></>;
|
|
3091
3553
|
}
|
|
3092
3554
|
var tabs_default = Tabs;
|
|
3093
3555
|
|
|
3094
3556
|
// src/blocks/text/component-info.ts
|
|
3095
|
-
var
|
|
3557
|
+
var componentInfo11 = {
|
|
3096
3558
|
shouldReceiveBuilderProps: {
|
|
3097
3559
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3098
3560
|
builderContext: true
|
|
@@ -3129,7 +3591,7 @@ function Text(props) {
|
|
|
3129
3591
|
var text_default = Text;
|
|
3130
3592
|
|
|
3131
3593
|
// src/blocks/custom-code/component-info.ts
|
|
3132
|
-
var
|
|
3594
|
+
var componentInfo12 = {
|
|
3133
3595
|
name: "Custom Code",
|
|
3134
3596
|
static: true,
|
|
3135
3597
|
requiredPermissions: ["editCode"],
|
|
@@ -3154,12 +3616,12 @@ var componentInfo11 = {
|
|
|
3154
3616
|
};
|
|
3155
3617
|
|
|
3156
3618
|
// src/blocks/custom-code/custom-code.tsx
|
|
3157
|
-
import { onMount as
|
|
3619
|
+
import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
|
|
3158
3620
|
function CustomCode(props) {
|
|
3159
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
3160
|
-
const [scriptsRun, setScriptsRun] =
|
|
3621
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3622
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3161
3623
|
let elementRef;
|
|
3162
|
-
|
|
3624
|
+
onMount5(() => {
|
|
3163
3625
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
3164
3626
|
return;
|
|
3165
3627
|
}
|
|
@@ -3200,7 +3662,7 @@ function CustomCode(props) {
|
|
|
3200
3662
|
var custom_code_default = CustomCode;
|
|
3201
3663
|
|
|
3202
3664
|
// src/blocks/embed/component-info.ts
|
|
3203
|
-
var
|
|
3665
|
+
var componentInfo13 = {
|
|
3204
3666
|
name: "Embed",
|
|
3205
3667
|
static: true,
|
|
3206
3668
|
inputs: [{
|
|
@@ -3218,7 +3680,7 @@ var componentInfo12 = {
|
|
|
3218
3680
|
};
|
|
3219
3681
|
|
|
3220
3682
|
// src/blocks/embed/embed.tsx
|
|
3221
|
-
import { on as on2, createEffect as createEffect2, createMemo as
|
|
3683
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3222
3684
|
|
|
3223
3685
|
// src/blocks/embed/helpers.ts
|
|
3224
3686
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3226,9 +3688,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
3226
3688
|
|
|
3227
3689
|
// src/blocks/embed/embed.tsx
|
|
3228
3690
|
function Embed(props) {
|
|
3229
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
3230
|
-
const [scriptsRun, setScriptsRun] =
|
|
3231
|
-
const [ranInitFn, setRanInitFn] =
|
|
3691
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
3692
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
3693
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
3232
3694
|
function findAndRunScripts() {
|
|
3233
3695
|
if (!elem || !elem.getElementsByTagName)
|
|
3234
3696
|
return;
|
|
@@ -3251,8 +3713,8 @@ function Embed(props) {
|
|
|
3251
3713
|
}
|
|
3252
3714
|
}
|
|
3253
3715
|
let elem;
|
|
3254
|
-
const onUpdateFn_0_elem =
|
|
3255
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3716
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
3717
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
3256
3718
|
function onUpdateFn_0() {
|
|
3257
3719
|
if (elem && !ranInitFn()) {
|
|
3258
3720
|
setRanInitFn(true);
|
|
@@ -3267,7 +3729,7 @@ function Embed(props) {
|
|
|
3267
3729
|
var embed_default = Embed;
|
|
3268
3730
|
|
|
3269
3731
|
// src/blocks/form/form/component-info.ts
|
|
3270
|
-
var
|
|
3732
|
+
var componentInfo14 = {
|
|
3271
3733
|
name: "Form:Form",
|
|
3272
3734
|
// editableTags: ['builder-form-error']
|
|
3273
3735
|
defaults: {
|
|
@@ -3507,7 +3969,7 @@ var componentInfo13 = {
|
|
|
3507
3969
|
};
|
|
3508
3970
|
|
|
3509
3971
|
// src/blocks/form/form/form.tsx
|
|
3510
|
-
import { Show as
|
|
3972
|
+
import { Show as Show12, createSignal as createSignal14 } from "solid-js";
|
|
3511
3973
|
|
|
3512
3974
|
// src/functions/get-env.ts
|
|
3513
3975
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -3527,9 +3989,9 @@ function logFetch(url) {
|
|
|
3527
3989
|
|
|
3528
3990
|
// src/blocks/form/form/form.tsx
|
|
3529
3991
|
function FormComponent(props) {
|
|
3530
|
-
const [formState, setFormState] =
|
|
3531
|
-
const [responseData, setResponseData] =
|
|
3532
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3992
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
3993
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
3994
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
3533
3995
|
function mergeNewRootState(newData) {
|
|
3534
3996
|
const combinedState = {
|
|
3535
3997
|
...props.builderContext.rootState,
|
|
@@ -3725,22 +4187,22 @@ function FormComponent(props) {
|
|
|
3725
4187
|
{...props.attributes}
|
|
3726
4188
|
>
|
|
3727
4189
|
{props.children}
|
|
3728
|
-
<
|
|
4190
|
+
<Show12 when={submissionState() === "error"}><Blocks_default
|
|
3729
4191
|
path="errorMessage"
|
|
3730
4192
|
blocks={props.errorMessage}
|
|
3731
4193
|
context={props.builderContext}
|
|
3732
|
-
/></
|
|
3733
|
-
<
|
|
4194
|
+
/></Show12>
|
|
4195
|
+
<Show12 when={submissionState() === "sending"}><Blocks_default
|
|
3734
4196
|
path="sendingMessage"
|
|
3735
4197
|
blocks={props.sendingMessage}
|
|
3736
4198
|
context={props.builderContext}
|
|
3737
|
-
/></
|
|
3738
|
-
<
|
|
3739
|
-
<
|
|
4199
|
+
/></Show12>
|
|
4200
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
4201
|
+
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
3740
4202
|
path="successMessage"
|
|
3741
4203
|
blocks={props.successMessage}
|
|
3742
4204
|
context={props.builderContext}
|
|
3743
|
-
/></
|
|
4205
|
+
/></Show12>
|
|
3744
4206
|
</form>
|
|
3745
4207
|
<style>{`.pre-04a43b72 {
|
|
3746
4208
|
padding: 10px;
|
|
@@ -3752,7 +4214,7 @@ function FormComponent(props) {
|
|
|
3752
4214
|
var form_default = FormComponent;
|
|
3753
4215
|
|
|
3754
4216
|
// src/blocks/form/input/component-info.ts
|
|
3755
|
-
var
|
|
4217
|
+
var componentInfo15 = {
|
|
3756
4218
|
name: "Form:Input",
|
|
3757
4219
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3758
4220
|
inputs: [
|
|
@@ -3822,7 +4284,7 @@ function FormInputComponent(props) {
|
|
|
3822
4284
|
var input_default = FormInputComponent;
|
|
3823
4285
|
|
|
3824
4286
|
// src/blocks/form/select/component-info.ts
|
|
3825
|
-
var
|
|
4287
|
+
var componentInfo16 = {
|
|
3826
4288
|
name: "Form:Select",
|
|
3827
4289
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3828
4290
|
defaultStyles: {
|
|
@@ -3867,7 +4329,7 @@ var componentInfo15 = {
|
|
|
3867
4329
|
};
|
|
3868
4330
|
|
|
3869
4331
|
// src/blocks/form/select/select.tsx
|
|
3870
|
-
import { For as
|
|
4332
|
+
import { For as For8 } from "solid-js";
|
|
3871
4333
|
function SelectComponent(props) {
|
|
3872
4334
|
return <><select
|
|
3873
4335
|
{...{}}
|
|
@@ -3877,15 +4339,15 @@ function SelectComponent(props) {
|
|
|
3877
4339
|
defaultValue={props.defaultValue}
|
|
3878
4340
|
name={props.name}
|
|
3879
4341
|
required={props.required}
|
|
3880
|
-
><
|
|
4342
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
3881
4343
|
const index = _index();
|
|
3882
4344
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
3883
|
-
}}</
|
|
4345
|
+
}}</For8></select></>;
|
|
3884
4346
|
}
|
|
3885
4347
|
var select_default = SelectComponent;
|
|
3886
4348
|
|
|
3887
4349
|
// src/blocks/form/submit-button/component-info.ts
|
|
3888
|
-
var
|
|
4350
|
+
var componentInfo17 = {
|
|
3889
4351
|
name: "Form:SubmitButton",
|
|
3890
4352
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3891
4353
|
defaultStyles: {
|
|
@@ -3919,7 +4381,7 @@ function SubmitButton(props) {
|
|
|
3919
4381
|
var submit_button_default = SubmitButton;
|
|
3920
4382
|
|
|
3921
4383
|
// src/blocks/form/textarea/component-info.ts
|
|
3922
|
-
var
|
|
4384
|
+
var componentInfo18 = {
|
|
3923
4385
|
name: "Form:TextArea",
|
|
3924
4386
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
3925
4387
|
inputs: [{
|
|
@@ -3972,7 +4434,7 @@ function Textarea(props) {
|
|
|
3972
4434
|
var textarea_default = Textarea;
|
|
3973
4435
|
|
|
3974
4436
|
// src/blocks/img/component-info.ts
|
|
3975
|
-
var
|
|
4437
|
+
var componentInfo19 = {
|
|
3976
4438
|
// friendlyName?
|
|
3977
4439
|
name: "Raw:Img",
|
|
3978
4440
|
hideFromInsertMenu: true,
|
|
@@ -4005,7 +4467,7 @@ function ImgComponent(props) {
|
|
|
4005
4467
|
var img_default = ImgComponent;
|
|
4006
4468
|
|
|
4007
4469
|
// src/blocks/video/component-info.ts
|
|
4008
|
-
var
|
|
4470
|
+
var componentInfo20 = {
|
|
4009
4471
|
name: "Video",
|
|
4010
4472
|
canHaveChildren: true,
|
|
4011
4473
|
defaultStyles: {
|
|
@@ -4092,9 +4554,9 @@ var componentInfo19 = {
|
|
|
4092
4554
|
};
|
|
4093
4555
|
|
|
4094
4556
|
// src/blocks/video/video.tsx
|
|
4095
|
-
import { Show as
|
|
4557
|
+
import { Show as Show13, createMemo as createMemo15 } from "solid-js";
|
|
4096
4558
|
function Video(props) {
|
|
4097
|
-
const videoProps =
|
|
4559
|
+
const videoProps = createMemo15(() => {
|
|
4098
4560
|
return {
|
|
4099
4561
|
...props.autoPlay === true ? {
|
|
4100
4562
|
autoPlay: true
|
|
@@ -4113,7 +4575,7 @@ function Video(props) {
|
|
|
4113
4575
|
} : {}
|
|
4114
4576
|
};
|
|
4115
4577
|
});
|
|
4116
|
-
const spreadProps =
|
|
4578
|
+
const spreadProps = createMemo15(() => {
|
|
4117
4579
|
return {
|
|
4118
4580
|
...videoProps()
|
|
4119
4581
|
};
|
|
@@ -4142,8 +4604,8 @@ function Video(props) {
|
|
|
4142
4604
|
}}
|
|
4143
4605
|
src={props.video || "no-src"}
|
|
4144
4606
|
poster={props.posterImage}
|
|
4145
|
-
><
|
|
4146
|
-
<
|
|
4607
|
+
><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
|
|
4608
|
+
<Show13
|
|
4147
4609
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
4148
4610
|
><div
|
|
4149
4611
|
style={{
|
|
@@ -4152,15 +4614,15 @@ function Video(props) {
|
|
|
4152
4614
|
"pointer-events": "none",
|
|
4153
4615
|
"font-size": "0px"
|
|
4154
4616
|
}}
|
|
4155
|
-
/></
|
|
4156
|
-
<
|
|
4617
|
+
/></Show13>
|
|
4618
|
+
<Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
4157
4619
|
style={{
|
|
4158
4620
|
display: "flex",
|
|
4159
4621
|
"flex-direction": "column",
|
|
4160
4622
|
"align-items": "stretch"
|
|
4161
4623
|
}}
|
|
4162
|
-
>{props.children}</div></
|
|
4163
|
-
<
|
|
4624
|
+
>{props.children}</div></Show13>
|
|
4625
|
+
<Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
4164
4626
|
style={{
|
|
4165
4627
|
"pointer-events": "none",
|
|
4166
4628
|
display: "flex",
|
|
@@ -4172,7 +4634,7 @@ function Video(props) {
|
|
|
4172
4634
|
width: "100%",
|
|
4173
4635
|
height: "100%"
|
|
4174
4636
|
}}
|
|
4175
|
-
>{props.children}</div></
|
|
4637
|
+
>{props.children}</div></Show13>
|
|
4176
4638
|
</div></>;
|
|
4177
4639
|
}
|
|
4178
4640
|
var video_default = Video;
|
|
@@ -4180,31 +4642,31 @@ var video_default = Video;
|
|
|
4180
4642
|
// src/constants/extra-components.ts
|
|
4181
4643
|
var getExtraComponents = () => [{
|
|
4182
4644
|
component: custom_code_default,
|
|
4183
|
-
...
|
|
4645
|
+
...componentInfo12
|
|
4184
4646
|
}, {
|
|
4185
4647
|
component: embed_default,
|
|
4186
|
-
...
|
|
4648
|
+
...componentInfo13
|
|
4187
4649
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4188
4650
|
component: form_default,
|
|
4189
|
-
...
|
|
4651
|
+
...componentInfo14
|
|
4190
4652
|
}, {
|
|
4191
4653
|
component: input_default,
|
|
4192
|
-
...
|
|
4654
|
+
...componentInfo15
|
|
4193
4655
|
}, {
|
|
4194
4656
|
component: submit_button_default,
|
|
4195
|
-
...
|
|
4657
|
+
...componentInfo17
|
|
4196
4658
|
}, {
|
|
4197
4659
|
component: select_default,
|
|
4198
|
-
...
|
|
4660
|
+
...componentInfo16
|
|
4199
4661
|
}, {
|
|
4200
4662
|
component: textarea_default,
|
|
4201
|
-
...
|
|
4663
|
+
...componentInfo18
|
|
4202
4664
|
}], {
|
|
4203
4665
|
component: img_default,
|
|
4204
|
-
...
|
|
4666
|
+
...componentInfo19
|
|
4205
4667
|
}, {
|
|
4206
4668
|
component: video_default,
|
|
4207
|
-
...
|
|
4669
|
+
...componentInfo20
|
|
4208
4670
|
}];
|
|
4209
4671
|
|
|
4210
4672
|
// src/constants/builder-registered-components.ts
|
|
@@ -4222,19 +4684,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4222
4684
|
...componentInfo5
|
|
4223
4685
|
}, {
|
|
4224
4686
|
component: section_default,
|
|
4225
|
-
...
|
|
4687
|
+
...componentInfo7
|
|
4226
4688
|
}, {
|
|
4227
4689
|
component: slot_default,
|
|
4228
|
-
...
|
|
4690
|
+
...componentInfo8
|
|
4229
4691
|
}, {
|
|
4230
4692
|
component: symbol_default,
|
|
4231
|
-
...
|
|
4693
|
+
...componentInfo9
|
|
4232
4694
|
}, {
|
|
4233
4695
|
component: text_default,
|
|
4234
|
-
...
|
|
4235
|
-
}, ...TARGET === "
|
|
4696
|
+
...componentInfo11
|
|
4697
|
+
}, ...TARGET === "react" ? [{
|
|
4698
|
+
component: personalization_container_default,
|
|
4699
|
+
...componentInfo6
|
|
4700
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
4236
4701
|
component: tabs_default,
|
|
4237
|
-
...
|
|
4702
|
+
...componentInfo10
|
|
4238
4703
|
}, {
|
|
4239
4704
|
component: accordion_default,
|
|
4240
4705
|
...componentInfo
|
|
@@ -4272,7 +4737,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
4272
4737
|
testVariationId: variant.id,
|
|
4273
4738
|
id: content?.id
|
|
4274
4739
|
}));
|
|
4275
|
-
var
|
|
4740
|
+
var checkShouldRenderVariants2 = ({
|
|
4276
4741
|
canTrack,
|
|
4277
4742
|
content
|
|
4278
4743
|
}) => {
|
|
@@ -4306,24 +4771,14 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4306
4771
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4307
4772
|
)`;
|
|
4308
4773
|
|
|
4309
|
-
// src/components/inlined-script.tsx
|
|
4310
|
-
function InlinedScript(props) {
|
|
4311
|
-
return <><script
|
|
4312
|
-
innerHTML={props.scriptStr}
|
|
4313
|
-
data-id={props.id}
|
|
4314
|
-
nonce={props.nonce || ""}
|
|
4315
|
-
/></>;
|
|
4316
|
-
}
|
|
4317
|
-
var Inlined_script_default = InlinedScript;
|
|
4318
|
-
|
|
4319
4774
|
// src/components/content/components/enable-editor.tsx
|
|
4320
4775
|
import {
|
|
4321
|
-
Show as
|
|
4322
|
-
onMount as
|
|
4776
|
+
Show as Show14,
|
|
4777
|
+
onMount as onMount6,
|
|
4323
4778
|
on as on3,
|
|
4324
4779
|
createEffect as createEffect3,
|
|
4325
|
-
createMemo as
|
|
4326
|
-
createSignal as
|
|
4780
|
+
createMemo as createMemo16,
|
|
4781
|
+
createSignal as createSignal16
|
|
4327
4782
|
} from "solid-js";
|
|
4328
4783
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
4329
4784
|
|
|
@@ -4333,7 +4788,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4333
4788
|
}
|
|
4334
4789
|
|
|
4335
4790
|
// src/constants/sdk-version.ts
|
|
4336
|
-
var SDK_VERSION = "3.0.
|
|
4791
|
+
var SDK_VERSION = "3.0.7";
|
|
4337
4792
|
|
|
4338
4793
|
// src/helpers/sdk-headers.ts
|
|
4339
4794
|
var getSdkHeaders = () => ({
|
|
@@ -4628,16 +5083,6 @@ async function fetchEntries(options) {
|
|
|
4628
5083
|
return _processContentResult(options, content);
|
|
4629
5084
|
}
|
|
4630
5085
|
|
|
4631
|
-
// src/functions/is-previewing.ts
|
|
4632
|
-
function isPreviewing(_search) {
|
|
4633
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
4634
|
-
if (!search) {
|
|
4635
|
-
return false;
|
|
4636
|
-
}
|
|
4637
|
-
const normalizedSearch = getSearchString(search);
|
|
4638
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
4639
|
-
}
|
|
4640
|
-
|
|
4641
5086
|
// src/helpers/uuid.ts
|
|
4642
5087
|
function uuidv4() {
|
|
4643
5088
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -4960,7 +5405,9 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
4960
5405
|
// Supports builder-model="..." attribute which is needed to
|
|
4961
5406
|
// scope our '+ add block' button styling
|
|
4962
5407
|
supportsAddBlockScoping: true,
|
|
4963
|
-
supportsCustomBreakpoints: true
|
|
5408
|
+
supportsCustomBreakpoints: true,
|
|
5409
|
+
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
5410
|
+
blockLevelPersonalization: true
|
|
4964
5411
|
}
|
|
4965
5412
|
}, "*");
|
|
4966
5413
|
window.parent?.postMessage({
|
|
@@ -5175,12 +5622,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
5175
5622
|
|
|
5176
5623
|
// src/components/content/components/enable-editor.tsx
|
|
5177
5624
|
function EnableEditor(props) {
|
|
5178
|
-
const [ContentWrapper, setContentWrapper] =
|
|
5625
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
5179
5626
|
props.contentWrapper || "div"
|
|
5180
5627
|
);
|
|
5181
|
-
const [httpReqsData, setHttpReqsData] =
|
|
5182
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
5183
|
-
const [clicked, setClicked] =
|
|
5628
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
5629
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
5630
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
5184
5631
|
function mergeNewRootState(newData) {
|
|
5185
5632
|
const combinedState = {
|
|
5186
5633
|
...props.builderContextSignal.rootState,
|
|
@@ -5214,7 +5661,7 @@ function EnableEditor(props) {
|
|
|
5214
5661
|
content: newContentValue
|
|
5215
5662
|
}));
|
|
5216
5663
|
}
|
|
5217
|
-
const showContentProps =
|
|
5664
|
+
const showContentProps = createMemo16(() => {
|
|
5218
5665
|
return props.showContent ? {} : {
|
|
5219
5666
|
hidden: true,
|
|
5220
5667
|
"aria-hidden": true
|
|
@@ -5320,7 +5767,7 @@ function EnableEditor(props) {
|
|
|
5320
5767
|
let elementRef;
|
|
5321
5768
|
runHttpRequests();
|
|
5322
5769
|
emitStateUpdate();
|
|
5323
|
-
|
|
5770
|
+
onMount6(() => {
|
|
5324
5771
|
if (isBrowser()) {
|
|
5325
5772
|
if (isEditing() && !props.isNestedRender) {
|
|
5326
5773
|
window.addEventListener("message", processMessage);
|
|
@@ -5389,14 +5836,14 @@ function EnableEditor(props) {
|
|
|
5389
5836
|
}
|
|
5390
5837
|
}
|
|
5391
5838
|
});
|
|
5392
|
-
const onUpdateFn_0_props_content =
|
|
5839
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
5393
5840
|
function onUpdateFn_0() {
|
|
5394
5841
|
if (props.content) {
|
|
5395
5842
|
mergeNewContent(props.content);
|
|
5396
5843
|
}
|
|
5397
5844
|
}
|
|
5398
5845
|
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
5399
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
5846
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
|
|
5400
5847
|
() => props.builderContextSignal.rootState
|
|
5401
5848
|
);
|
|
5402
5849
|
function onUpdateFn_1() {
|
|
@@ -5408,14 +5855,14 @@ function EnableEditor(props) {
|
|
|
5408
5855
|
onUpdateFn_1
|
|
5409
5856
|
)
|
|
5410
5857
|
);
|
|
5411
|
-
const onUpdateFn_2_props_data =
|
|
5858
|
+
const onUpdateFn_2_props_data = createMemo16(() => props.data);
|
|
5412
5859
|
function onUpdateFn_2() {
|
|
5413
5860
|
if (props.data) {
|
|
5414
5861
|
mergeNewRootState(props.data);
|
|
5415
5862
|
}
|
|
5416
5863
|
}
|
|
5417
5864
|
createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
5418
|
-
const onUpdateFn_3_props_locale =
|
|
5865
|
+
const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
|
|
5419
5866
|
function onUpdateFn_3() {
|
|
5420
5867
|
if (props.locale) {
|
|
5421
5868
|
mergeNewRootState({
|
|
@@ -5424,7 +5871,7 @@ function EnableEditor(props) {
|
|
|
5424
5871
|
}
|
|
5425
5872
|
}
|
|
5426
5873
|
createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
5427
|
-
return <><builder_context_default.Provider value={props.builderContextSignal}><
|
|
5874
|
+
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
5428
5875
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
5429
5876
|
><Dynamic5
|
|
5430
5877
|
class={getWrapperClassName(
|
|
@@ -5442,14 +5889,14 @@ function EnableEditor(props) {
|
|
|
5442
5889
|
{...showContentProps()}
|
|
5443
5890
|
{...props.contentWrapperProps}
|
|
5444
5891
|
component={ContentWrapper()}
|
|
5445
|
-
>{props.children}</Dynamic5></
|
|
5892
|
+
>{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
|
|
5446
5893
|
}
|
|
5447
5894
|
var Enable_editor_default = EnableEditor;
|
|
5448
5895
|
|
|
5449
5896
|
// src/components/content/components/styles.tsx
|
|
5450
|
-
import { createSignal as
|
|
5897
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
5451
5898
|
function ContentStyles(props) {
|
|
5452
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5899
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
5453
5900
|
`
|
|
5454
5901
|
${getCss({
|
|
5455
5902
|
cssCode: props.cssCode,
|
|
@@ -5507,7 +5954,7 @@ var getContentInitialValue = ({
|
|
|
5507
5954
|
|
|
5508
5955
|
// src/components/content/content.tsx
|
|
5509
5956
|
function ContentComponent(props) {
|
|
5510
|
-
const [scriptStr, setScriptStr] =
|
|
5957
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
5511
5958
|
getUpdateVariantVisibilityScript({
|
|
5512
5959
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5513
5960
|
variationId: props.content?.testVariationId,
|
|
@@ -5515,7 +5962,7 @@ function ContentComponent(props) {
|
|
|
5515
5962
|
contentId: props.content?.id
|
|
5516
5963
|
})
|
|
5517
5964
|
);
|
|
5518
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5965
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
5519
5966
|
[
|
|
5520
5967
|
...getDefaultRegisteredComponents(),
|
|
5521
5968
|
...props.customComponents || []
|
|
@@ -5530,7 +5977,7 @@ function ContentComponent(props) {
|
|
|
5530
5977
|
{}
|
|
5531
5978
|
)
|
|
5532
5979
|
);
|
|
5533
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5980
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
5534
5981
|
content: getContentInitialValue({
|
|
5535
5982
|
content: props.content,
|
|
5536
5983
|
data: props.data
|
|
@@ -5614,18 +6061,18 @@ function ContentComponent(props) {
|
|
|
5614
6061
|
setBuilderContextSignal
|
|
5615
6062
|
}}
|
|
5616
6063
|
>
|
|
5617
|
-
<
|
|
6064
|
+
<Show15 when={props.isSsrAbTest}><Inlined_script_default
|
|
5618
6065
|
id="builderio-variant-visibility"
|
|
5619
6066
|
scriptStr={scriptStr()}
|
|
5620
6067
|
nonce={props.nonce || ""}
|
|
5621
|
-
/></
|
|
5622
|
-
<
|
|
6068
|
+
/></Show15>
|
|
6069
|
+
<Show15 when={TARGET !== "reactNative"}><Styles_default
|
|
5623
6070
|
nonce={props.nonce || ""}
|
|
5624
6071
|
isNestedRender={props.isNestedRender}
|
|
5625
6072
|
contentId={builderContextSignal().content?.id}
|
|
5626
6073
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
5627
6074
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
5628
|
-
/></
|
|
6075
|
+
/></Show15>
|
|
5629
6076
|
<Blocks_default
|
|
5630
6077
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
5631
6078
|
context={builderContextSignal()}
|
|
@@ -5638,13 +6085,13 @@ var Content_default = ContentComponent;
|
|
|
5638
6085
|
|
|
5639
6086
|
// src/components/content-variants/content-variants.tsx
|
|
5640
6087
|
function ContentVariants(props) {
|
|
5641
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5642
|
-
|
|
6088
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
6089
|
+
checkShouldRenderVariants2({
|
|
5643
6090
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5644
6091
|
content: props.content
|
|
5645
6092
|
})
|
|
5646
6093
|
);
|
|
5647
|
-
const updateCookieAndStylesScriptStr =
|
|
6094
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
5648
6095
|
return getUpdateCookieAndStylesScript(
|
|
5649
6096
|
getVariants(props.content).map((value) => ({
|
|
5650
6097
|
id: value.testVariationId,
|
|
@@ -5653,10 +6100,10 @@ function ContentVariants(props) {
|
|
|
5653
6100
|
props.content?.id || ""
|
|
5654
6101
|
);
|
|
5655
6102
|
});
|
|
5656
|
-
const hideVariantsStyleString =
|
|
6103
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
5657
6104
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5658
6105
|
});
|
|
5659
|
-
const defaultContent =
|
|
6106
|
+
const defaultContent = createMemo19(() => {
|
|
5660
6107
|
return shouldRenderVariants() ? {
|
|
5661
6108
|
...props.content,
|
|
5662
6109
|
testVariationId: props.content?.id
|
|
@@ -5665,16 +6112,16 @@ function ContentVariants(props) {
|
|
|
5665
6112
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
5666
6113
|
});
|
|
5667
6114
|
});
|
|
5668
|
-
|
|
6115
|
+
onMount7(() => {
|
|
5669
6116
|
setShouldRenderVariants(false);
|
|
5670
6117
|
});
|
|
5671
6118
|
return <><>
|
|
5672
|
-
<
|
|
6119
|
+
<Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5673
6120
|
id="builderio-init-variants-fns"
|
|
5674
6121
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5675
6122
|
nonce={props.nonce || ""}
|
|
5676
|
-
/></
|
|
5677
|
-
<
|
|
6123
|
+
/></Show16>
|
|
6124
|
+
<Show16 when={shouldRenderVariants()}>
|
|
5678
6125
|
<Inlined_styles_default
|
|
5679
6126
|
id="builderio-variants"
|
|
5680
6127
|
styles={hideVariantsStyleString()}
|
|
@@ -5685,7 +6132,7 @@ function ContentVariants(props) {
|
|
|
5685
6132
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5686
6133
|
nonce={props.nonce || ""}
|
|
5687
6134
|
/>
|
|
5688
|
-
<
|
|
6135
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5689
6136
|
const index = _index();
|
|
5690
6137
|
return <Content_default
|
|
5691
6138
|
apiHost={props.apiHost}
|
|
@@ -5712,8 +6159,8 @@ function ContentVariants(props) {
|
|
|
5712
6159
|
trustedHosts={props.trustedHosts}
|
|
5713
6160
|
{...{}}
|
|
5714
6161
|
/>;
|
|
5715
|
-
}}</
|
|
5716
|
-
</
|
|
6162
|
+
}}</For9>
|
|
6163
|
+
</Show16>
|
|
5717
6164
|
<Content_default
|
|
5718
6165
|
apiHost={props.apiHost}
|
|
5719
6166
|
nonce={props.nonce}
|
|
@@ -5768,14 +6215,14 @@ var fetchSymbolContent = async ({
|
|
|
5768
6215
|
|
|
5769
6216
|
// src/blocks/symbol/symbol.tsx
|
|
5770
6217
|
function Symbol(props) {
|
|
5771
|
-
const [contentToUse, setContentToUse] =
|
|
5772
|
-
const blocksWrapper =
|
|
6218
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
6219
|
+
const blocksWrapper = createMemo20(() => {
|
|
5773
6220
|
return "div";
|
|
5774
6221
|
});
|
|
5775
|
-
const contentWrapper =
|
|
6222
|
+
const contentWrapper = createMemo20(() => {
|
|
5776
6223
|
return "div";
|
|
5777
6224
|
});
|
|
5778
|
-
const className =
|
|
6225
|
+
const className = createMemo20(() => {
|
|
5779
6226
|
return [
|
|
5780
6227
|
...[props.attributes[getClassPropName()]],
|
|
5781
6228
|
"builder-symbol",
|
|
@@ -5795,9 +6242,9 @@ function Symbol(props) {
|
|
|
5795
6242
|
}
|
|
5796
6243
|
});
|
|
5797
6244
|
}
|
|
5798
|
-
|
|
6245
|
+
onMount8(() => {
|
|
5799
6246
|
});
|
|
5800
|
-
const onUpdateFn_0_props_symbol =
|
|
6247
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
5801
6248
|
function onUpdateFn_0() {
|
|
5802
6249
|
setContent();
|
|
5803
6250
|
}
|
|
@@ -5882,6 +6329,7 @@ export {
|
|
|
5882
6329
|
isEditing,
|
|
5883
6330
|
isPreviewing,
|
|
5884
6331
|
register,
|
|
6332
|
+
setClientUserAttributes,
|
|
5885
6333
|
setEditorSettings,
|
|
5886
6334
|
subscribeToEditor,
|
|
5887
6335
|
track
|