@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/edge/index.jsx
CHANGED
|
@@ -4111,8 +4111,13 @@ import { Show as Show2, createMemo } from "solid-js";
|
|
|
4111
4111
|
|
|
4112
4112
|
// src/constants/device-sizes.ts
|
|
4113
4113
|
var SIZES = {
|
|
4114
|
+
xsmall: {
|
|
4115
|
+
min: 0,
|
|
4116
|
+
default: 160,
|
|
4117
|
+
max: 320
|
|
4118
|
+
},
|
|
4114
4119
|
small: {
|
|
4115
|
-
min:
|
|
4120
|
+
min: 321,
|
|
4116
4121
|
default: 321,
|
|
4117
4122
|
max: 640
|
|
4118
4123
|
},
|
|
@@ -4128,15 +4133,28 @@ var SIZES = {
|
|
|
4128
4133
|
}
|
|
4129
4134
|
};
|
|
4130
4135
|
var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
4131
|
-
var getSizesForBreakpoints = ({
|
|
4132
|
-
small,
|
|
4133
|
-
medium
|
|
4134
|
-
}) => {
|
|
4136
|
+
var getSizesForBreakpoints = (breakpoints) => {
|
|
4135
4137
|
const newSizes = fastClone(SIZES);
|
|
4138
|
+
if (!breakpoints) {
|
|
4139
|
+
return newSizes;
|
|
4140
|
+
}
|
|
4141
|
+
const {
|
|
4142
|
+
xsmall,
|
|
4143
|
+
small,
|
|
4144
|
+
medium
|
|
4145
|
+
} = breakpoints;
|
|
4146
|
+
if (xsmall) {
|
|
4147
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
4148
|
+
newSizes.xsmall = {
|
|
4149
|
+
max: xsmall,
|
|
4150
|
+
min: xsmallMin,
|
|
4151
|
+
default: xsmallMin + 1
|
|
4152
|
+
};
|
|
4153
|
+
}
|
|
4136
4154
|
if (!small || !medium) {
|
|
4137
4155
|
return newSizes;
|
|
4138
4156
|
}
|
|
4139
|
-
const smallMin = Math.floor(small / 2);
|
|
4157
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
4140
4158
|
newSizes.small = {
|
|
4141
4159
|
max: small,
|
|
4142
4160
|
min: smallMin,
|
|
@@ -4187,9 +4205,13 @@ function BlockStyles(props) {
|
|
|
4187
4205
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
4188
4206
|
content?.meta?.breakpoints || {}
|
|
4189
4207
|
);
|
|
4208
|
+
const contentHasXSmallBreakpoint = Boolean(
|
|
4209
|
+
content?.meta?.breakpoints?.xsmall
|
|
4210
|
+
);
|
|
4190
4211
|
const largeStyles = styles?.large;
|
|
4191
4212
|
const mediumStyles = styles?.medium;
|
|
4192
4213
|
const smallStyles = styles?.small;
|
|
4214
|
+
const xsmallStyles = styles?.xsmall;
|
|
4193
4215
|
const className = processedBlock.id;
|
|
4194
4216
|
if (!className) {
|
|
4195
4217
|
return "";
|
|
@@ -4214,6 +4236,14 @@ function BlockStyles(props) {
|
|
|
4214
4236
|
sizesWithUpdatedBreakpoints
|
|
4215
4237
|
)
|
|
4216
4238
|
}) : "";
|
|
4239
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
4240
|
+
className,
|
|
4241
|
+
styles: xsmallStyles,
|
|
4242
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
4243
|
+
"xsmall",
|
|
4244
|
+
sizesWithUpdatedBreakpoints
|
|
4245
|
+
)
|
|
4246
|
+
}) : "";
|
|
4217
4247
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
4218
4248
|
let hoverStylesClass = "";
|
|
4219
4249
|
if (hoverAnimation) {
|
|
@@ -4233,6 +4263,7 @@ function BlockStyles(props) {
|
|
|
4233
4263
|
largeStylesClass,
|
|
4234
4264
|
mediumStylesClass,
|
|
4235
4265
|
smallStylesClass,
|
|
4266
|
+
xsmallStylesClass,
|
|
4236
4267
|
hoverStylesClass
|
|
4237
4268
|
].join(" ");
|
|
4238
4269
|
});
|
|
@@ -4639,8 +4670,9 @@ function BlocksWrapper(props) {
|
|
|
4639
4670
|
if (!props.path) {
|
|
4640
4671
|
return void 0;
|
|
4641
4672
|
}
|
|
4673
|
+
const thisPrefix = "this.";
|
|
4642
4674
|
const pathPrefix = "component.options.";
|
|
4643
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4675
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4644
4676
|
});
|
|
4645
4677
|
function onClick() {
|
|
4646
4678
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -4675,7 +4707,7 @@ function BlocksWrapper(props) {
|
|
|
4675
4707
|
});
|
|
4676
4708
|
return <>
|
|
4677
4709
|
<Dynamic4
|
|
4678
|
-
class={className() + " dynamic-
|
|
4710
|
+
class={className() + " dynamic-3d7ff108"}
|
|
4679
4711
|
ref={blocksWrapperRef}
|
|
4680
4712
|
builder-path={dataPath()}
|
|
4681
4713
|
builder-parent-id={props.parent}
|
|
@@ -4687,7 +4719,7 @@ function BlocksWrapper(props) {
|
|
|
4687
4719
|
{...props.BlocksWrapperProps}
|
|
4688
4720
|
component={props.BlocksWrapper}
|
|
4689
4721
|
>{props.children}</Dynamic4>
|
|
4690
|
-
<style>{`.dynamic-
|
|
4722
|
+
<style>{`.dynamic-3d7ff108 {
|
|
4691
4723
|
display: flex;
|
|
4692
4724
|
flex-direction: column;
|
|
4693
4725
|
align-items: stretch;
|
|
@@ -5059,10 +5091,10 @@ function SectionComponent(props) {
|
|
|
5059
5091
|
var section_default = SectionComponent;
|
|
5060
5092
|
|
|
5061
5093
|
// src/blocks/symbol/symbol.tsx
|
|
5062
|
-
import { onMount as
|
|
5094
|
+
import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
5063
5095
|
|
|
5064
5096
|
// src/components/content-variants/content-variants.tsx
|
|
5065
|
-
import { Show as
|
|
5097
|
+
import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
5066
5098
|
|
|
5067
5099
|
// src/helpers/url.ts
|
|
5068
5100
|
var getTopLevelDomain = (host) => {
|
|
@@ -5252,11 +5284,61 @@ var handleABTesting = async ({
|
|
|
5252
5284
|
};
|
|
5253
5285
|
};
|
|
5254
5286
|
|
|
5287
|
+
// src/helpers/user-attributes.ts
|
|
5288
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5289
|
+
function createUserAttributesService() {
|
|
5290
|
+
let canTrack = true;
|
|
5291
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
5292
|
+
return {
|
|
5293
|
+
setUserAttributes(newAttrs) {
|
|
5294
|
+
if (!isBrowser()) {
|
|
5295
|
+
return;
|
|
5296
|
+
}
|
|
5297
|
+
const userAttributes = {
|
|
5298
|
+
...this.getUserAttributes(),
|
|
5299
|
+
...newAttrs
|
|
5300
|
+
};
|
|
5301
|
+
setCookie({
|
|
5302
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5303
|
+
value: JSON.stringify(userAttributes),
|
|
5304
|
+
canTrack
|
|
5305
|
+
});
|
|
5306
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
5307
|
+
},
|
|
5308
|
+
getUserAttributes() {
|
|
5309
|
+
if (!isBrowser()) {
|
|
5310
|
+
return {};
|
|
5311
|
+
}
|
|
5312
|
+
return JSON.parse(getCookieSync({
|
|
5313
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5314
|
+
canTrack
|
|
5315
|
+
}) || "{}");
|
|
5316
|
+
},
|
|
5317
|
+
subscribeOnUserAttributesChange(callback) {
|
|
5318
|
+
subscribers.add(callback);
|
|
5319
|
+
return () => {
|
|
5320
|
+
subscribers.delete(callback);
|
|
5321
|
+
};
|
|
5322
|
+
},
|
|
5323
|
+
setCanTrack(value) {
|
|
5324
|
+
canTrack = value;
|
|
5325
|
+
}
|
|
5326
|
+
};
|
|
5327
|
+
}
|
|
5328
|
+
var userAttributesService = createUserAttributesService();
|
|
5329
|
+
var setClientUserAttributes = (attributes) => {
|
|
5330
|
+
userAttributesService.setUserAttributes(attributes);
|
|
5331
|
+
};
|
|
5332
|
+
|
|
5255
5333
|
// src/helpers/canTrack.ts
|
|
5256
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
5334
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
5335
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
5336
|
+
userAttributesService.setCanTrack(result);
|
|
5337
|
+
return result;
|
|
5338
|
+
};
|
|
5257
5339
|
|
|
5258
5340
|
// src/components/content/content.tsx
|
|
5259
|
-
import { Show as
|
|
5341
|
+
import { Show as Show15, createSignal as createSignal18 } from "solid-js";
|
|
5260
5342
|
|
|
5261
5343
|
// src/blocks/accordion/component-info.ts
|
|
5262
5344
|
var defaultTitle = {
|
|
@@ -5950,8 +6032,388 @@ var componentInfo5 = {
|
|
|
5950
6032
|
}
|
|
5951
6033
|
};
|
|
5952
6034
|
|
|
5953
|
-
// src/blocks/
|
|
6035
|
+
// src/blocks/personalization-container/component-info.ts
|
|
5954
6036
|
var componentInfo6 = {
|
|
6037
|
+
name: "PersonalizationContainer",
|
|
6038
|
+
shouldReceiveBuilderProps: {
|
|
6039
|
+
builderBlock: true,
|
|
6040
|
+
builderContext: true
|
|
6041
|
+
},
|
|
6042
|
+
noWrap: true,
|
|
6043
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
6044
|
+
canHaveChildren: true,
|
|
6045
|
+
inputs: [{
|
|
6046
|
+
name: "variants",
|
|
6047
|
+
defaultValue: [],
|
|
6048
|
+
behavior: "personalizationVariantList",
|
|
6049
|
+
type: "list",
|
|
6050
|
+
subFields: [{
|
|
6051
|
+
name: "name",
|
|
6052
|
+
type: "text"
|
|
6053
|
+
}, {
|
|
6054
|
+
name: "query",
|
|
6055
|
+
friendlyName: "Targeting rules",
|
|
6056
|
+
type: "BuilderQuery",
|
|
6057
|
+
defaultValue: []
|
|
6058
|
+
}, {
|
|
6059
|
+
name: "startDate",
|
|
6060
|
+
type: "date"
|
|
6061
|
+
}, {
|
|
6062
|
+
name: "endDate",
|
|
6063
|
+
type: "date"
|
|
6064
|
+
}, {
|
|
6065
|
+
name: "blocks",
|
|
6066
|
+
type: "uiBlocks",
|
|
6067
|
+
hideFromUI: true,
|
|
6068
|
+
defaultValue: []
|
|
6069
|
+
}]
|
|
6070
|
+
}]
|
|
6071
|
+
};
|
|
6072
|
+
|
|
6073
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6074
|
+
import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
6075
|
+
|
|
6076
|
+
// src/components/inlined-script.tsx
|
|
6077
|
+
function InlinedScript(props) {
|
|
6078
|
+
return <><script
|
|
6079
|
+
innerHTML={props.scriptStr}
|
|
6080
|
+
data-id={props.id}
|
|
6081
|
+
nonce={props.nonce || ""}
|
|
6082
|
+
/></>;
|
|
6083
|
+
}
|
|
6084
|
+
var Inlined_script_default = InlinedScript;
|
|
6085
|
+
|
|
6086
|
+
// src/functions/is-previewing.ts
|
|
6087
|
+
function isPreviewing(_search) {
|
|
6088
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
6089
|
+
if (!search) {
|
|
6090
|
+
return false;
|
|
6091
|
+
}
|
|
6092
|
+
const normalizedSearch = getSearchString(search);
|
|
6093
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6096
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
6097
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
6098
|
+
function isString(val) {
|
|
6099
|
+
return typeof val === "string";
|
|
6100
|
+
}
|
|
6101
|
+
function isNumber(val) {
|
|
6102
|
+
return typeof val === "number";
|
|
6103
|
+
}
|
|
6104
|
+
function objectMatchesQuery(userattr, query2) {
|
|
6105
|
+
const result = (() => {
|
|
6106
|
+
const property = query2.property;
|
|
6107
|
+
const operator = query2.operator;
|
|
6108
|
+
let testValue = query2.value;
|
|
6109
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
6110
|
+
testValue = query2.value.slice(0, -1);
|
|
6111
|
+
}
|
|
6112
|
+
if (!(property && operator)) {
|
|
6113
|
+
return true;
|
|
6114
|
+
}
|
|
6115
|
+
if (Array.isArray(testValue)) {
|
|
6116
|
+
if (operator === "isNot") {
|
|
6117
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
6118
|
+
property,
|
|
6119
|
+
operator,
|
|
6120
|
+
value: val
|
|
6121
|
+
}));
|
|
6122
|
+
}
|
|
6123
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
6124
|
+
property,
|
|
6125
|
+
operator,
|
|
6126
|
+
value: val
|
|
6127
|
+
}));
|
|
6128
|
+
}
|
|
6129
|
+
const value = userattr[property];
|
|
6130
|
+
if (Array.isArray(value)) {
|
|
6131
|
+
return value.includes(testValue);
|
|
6132
|
+
}
|
|
6133
|
+
switch (operator) {
|
|
6134
|
+
case "is":
|
|
6135
|
+
return value === testValue;
|
|
6136
|
+
case "isNot":
|
|
6137
|
+
return value !== testValue;
|
|
6138
|
+
case "contains":
|
|
6139
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
6140
|
+
case "startsWith":
|
|
6141
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
6142
|
+
case "endsWith":
|
|
6143
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
6144
|
+
case "greaterThan":
|
|
6145
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
6146
|
+
case "lessThan":
|
|
6147
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
6148
|
+
case "greaterThanOrEqualTo":
|
|
6149
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
6150
|
+
case "lessThanOrEqualTo":
|
|
6151
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
6152
|
+
default:
|
|
6153
|
+
return false;
|
|
6154
|
+
}
|
|
6155
|
+
})();
|
|
6156
|
+
return result;
|
|
6157
|
+
}
|
|
6158
|
+
const item = {
|
|
6159
|
+
query,
|
|
6160
|
+
startDate,
|
|
6161
|
+
endDate
|
|
6162
|
+
};
|
|
6163
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
6164
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
6165
|
+
return false;
|
|
6166
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
6167
|
+
return false;
|
|
6168
|
+
}
|
|
6169
|
+
if (!item.query || !item.query.length) {
|
|
6170
|
+
return true;
|
|
6171
|
+
}
|
|
6172
|
+
return item.query.every((filter) => {
|
|
6173
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
6174
|
+
});
|
|
6175
|
+
}
|
|
6176
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
6177
|
+
if (!navigator.cookieEnabled) {
|
|
6178
|
+
return;
|
|
6179
|
+
}
|
|
6180
|
+
function getCookie(name) {
|
|
6181
|
+
const nameEQ = name + '=';
|
|
6182
|
+
const ca = document.cookie.split(';');
|
|
6183
|
+
for (let i = 0; i < ca.length; i++) {
|
|
6184
|
+
let c = ca[i];
|
|
6185
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
6186
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
6187
|
+
}
|
|
6188
|
+
return null;
|
|
6189
|
+
}
|
|
6190
|
+
function removeVariants() {
|
|
6191
|
+
variants?.forEach(function (_, index) {
|
|
6192
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
6193
|
+
});
|
|
6194
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
6195
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
6196
|
+
}
|
|
6197
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
6198
|
+
if (locale) {
|
|
6199
|
+
attributes.locale = locale;
|
|
6200
|
+
}
|
|
6201
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
6202
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
6203
|
+
});
|
|
6204
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
6205
|
+
if (isDebug) {
|
|
6206
|
+
console.debug('PersonalizationContainer', {
|
|
6207
|
+
attributes,
|
|
6208
|
+
variants,
|
|
6209
|
+
winningVariantIndex
|
|
6210
|
+
});
|
|
6211
|
+
}
|
|
6212
|
+
if (winningVariantIndex !== -1) {
|
|
6213
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
6214
|
+
if (winningVariant) {
|
|
6215
|
+
const parentNode = winningVariant.parentNode;
|
|
6216
|
+
if (parentNode) {
|
|
6217
|
+
const newParent = parentNode.cloneNode(false);
|
|
6218
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
6219
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
6220
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
6221
|
+
}
|
|
6222
|
+
if (isDebug) {
|
|
6223
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
} else if (variants && variants.length > 0) {
|
|
6227
|
+
removeVariants();
|
|
6228
|
+
}
|
|
6229
|
+
}`;
|
|
6230
|
+
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}";
|
|
6231
|
+
|
|
6232
|
+
// src/blocks/personalization-container/helpers.ts
|
|
6233
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
6234
|
+
const hasVariants = variants && variants.length > 0;
|
|
6235
|
+
if (TARGET === "reactNative")
|
|
6236
|
+
return false;
|
|
6237
|
+
if (!hasVariants)
|
|
6238
|
+
return false;
|
|
6239
|
+
if (!canTrack)
|
|
6240
|
+
return false;
|
|
6241
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
6242
|
+
return true;
|
|
6243
|
+
if (isBrowser())
|
|
6244
|
+
return false;
|
|
6245
|
+
return true;
|
|
6246
|
+
}
|
|
6247
|
+
function getBlocksToRender({
|
|
6248
|
+
variants,
|
|
6249
|
+
previewingIndex,
|
|
6250
|
+
isHydrated,
|
|
6251
|
+
filteredVariants,
|
|
6252
|
+
fallbackBlocks
|
|
6253
|
+
}) {
|
|
6254
|
+
const fallback = {
|
|
6255
|
+
blocks: fallbackBlocks ?? [],
|
|
6256
|
+
path: "this.children"
|
|
6257
|
+
};
|
|
6258
|
+
if (isHydrated && isEditing()) {
|
|
6259
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
6260
|
+
const variant = variants[previewingIndex];
|
|
6261
|
+
return {
|
|
6262
|
+
blocks: variant.blocks,
|
|
6263
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
6264
|
+
};
|
|
6265
|
+
}
|
|
6266
|
+
return fallback;
|
|
6267
|
+
}
|
|
6268
|
+
if (isBrowser()) {
|
|
6269
|
+
const winningVariant = filteredVariants?.[0];
|
|
6270
|
+
if (winningVariant) {
|
|
6271
|
+
return {
|
|
6272
|
+
blocks: winningVariant.blocks,
|
|
6273
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
6274
|
+
};
|
|
6275
|
+
}
|
|
6276
|
+
}
|
|
6277
|
+
return fallback;
|
|
6278
|
+
}
|
|
6279
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
6280
|
+
return `
|
|
6281
|
+
(function() {
|
|
6282
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
6283
|
+
${PERSONALIZATION_SCRIPT}
|
|
6284
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
6285
|
+
})();
|
|
6286
|
+
`;
|
|
6287
|
+
};
|
|
6288
|
+
|
|
6289
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6290
|
+
function PersonalizationContainer(props) {
|
|
6291
|
+
const [userAttributes, setUserAttributes] = createSignal10(
|
|
6292
|
+
userAttributesService.getUserAttributes()
|
|
6293
|
+
);
|
|
6294
|
+
const [scriptStr, setScriptStr] = createSignal10(
|
|
6295
|
+
getPersonalizationScript(
|
|
6296
|
+
props.variants,
|
|
6297
|
+
props.builderBlock?.id || "none",
|
|
6298
|
+
props.builderContext?.rootState?.locale
|
|
6299
|
+
)
|
|
6300
|
+
);
|
|
6301
|
+
const [unsubscribers, setUnsubscribers] = createSignal10([]);
|
|
6302
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
|
|
6303
|
+
checkShouldRenderVariants(
|
|
6304
|
+
props.variants,
|
|
6305
|
+
getDefaultCanTrack(props.builderContext?.canTrack)
|
|
6306
|
+
)
|
|
6307
|
+
);
|
|
6308
|
+
const [isHydrated, setIsHydrated] = createSignal10(false);
|
|
6309
|
+
const filteredVariants = createMemo10(() => {
|
|
6310
|
+
return (props.variants || []).filter((variant) => {
|
|
6311
|
+
return filterWithCustomTargeting(
|
|
6312
|
+
{
|
|
6313
|
+
...props.builderContext?.rootState?.locale ? {
|
|
6314
|
+
locale: props.builderContext?.rootState?.locale
|
|
6315
|
+
} : {},
|
|
6316
|
+
...userAttributes()
|
|
6317
|
+
},
|
|
6318
|
+
variant.query,
|
|
6319
|
+
variant.startDate,
|
|
6320
|
+
variant.endDate
|
|
6321
|
+
);
|
|
6322
|
+
});
|
|
6323
|
+
});
|
|
6324
|
+
const blocksToRender = createMemo10(() => {
|
|
6325
|
+
return getBlocksToRender({
|
|
6326
|
+
variants: props.variants,
|
|
6327
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
6328
|
+
isHydrated: isHydrated(),
|
|
6329
|
+
filteredVariants: filteredVariants(),
|
|
6330
|
+
previewingIndex: props.previewingIndex
|
|
6331
|
+
});
|
|
6332
|
+
});
|
|
6333
|
+
const hideVariantsStyleString = createMemo10(() => {
|
|
6334
|
+
return (props.variants || []).map(
|
|
6335
|
+
(_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
|
|
6336
|
+
).join("");
|
|
6337
|
+
});
|
|
6338
|
+
let rootRef;
|
|
6339
|
+
onMount4(() => {
|
|
6340
|
+
setIsHydrated(true);
|
|
6341
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
6342
|
+
(attrs) => {
|
|
6343
|
+
setUserAttributes(attrs);
|
|
6344
|
+
}
|
|
6345
|
+
);
|
|
6346
|
+
if (!(isEditing() || isPreviewing())) {
|
|
6347
|
+
const variant = filteredVariants()[0];
|
|
6348
|
+
if (rootRef) {
|
|
6349
|
+
rootRef.dispatchEvent(
|
|
6350
|
+
new CustomEvent("builder.variantLoaded", {
|
|
6351
|
+
detail: {
|
|
6352
|
+
variant: variant || "default",
|
|
6353
|
+
content: props.builderContext?.content
|
|
6354
|
+
},
|
|
6355
|
+
bubbles: true
|
|
6356
|
+
})
|
|
6357
|
+
);
|
|
6358
|
+
const observer = new IntersectionObserver((entries) => {
|
|
6359
|
+
entries.forEach((entry) => {
|
|
6360
|
+
if (entry.isIntersecting && rootRef) {
|
|
6361
|
+
rootRef.dispatchEvent(
|
|
6362
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
6363
|
+
detail: {
|
|
6364
|
+
variant: variant || "default",
|
|
6365
|
+
content: props.builderContext?.content
|
|
6366
|
+
},
|
|
6367
|
+
bubbles: true
|
|
6368
|
+
})
|
|
6369
|
+
);
|
|
6370
|
+
}
|
|
6371
|
+
});
|
|
6372
|
+
});
|
|
6373
|
+
observer.observe(rootRef);
|
|
6374
|
+
}
|
|
6375
|
+
}
|
|
6376
|
+
unsubscribers().push(unsub);
|
|
6377
|
+
});
|
|
6378
|
+
return <><div
|
|
6379
|
+
class={`builder-personalization-container ${props.attributes?.className || ""}`}
|
|
6380
|
+
ref={rootRef}
|
|
6381
|
+
{...props.attributes}
|
|
6382
|
+
>
|
|
6383
|
+
<Show10 when={shouldRenderVariants()}>
|
|
6384
|
+
<For6 each={props.variants}>{(variant, _index) => {
|
|
6385
|
+
const index = _index();
|
|
6386
|
+
return <template
|
|
6387
|
+
key={index}
|
|
6388
|
+
data-variant-id={`${props.builderBlock?.id}-${index}`}
|
|
6389
|
+
><Blocks_default
|
|
6390
|
+
blocks={variant.blocks}
|
|
6391
|
+
parent={props.builderBlock?.id}
|
|
6392
|
+
path={`component.options.variants.${index}.blocks`}
|
|
6393
|
+
/></template>;
|
|
6394
|
+
}}</For6>
|
|
6395
|
+
<Inlined_styles_default
|
|
6396
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6397
|
+
styles={hideVariantsStyleString()}
|
|
6398
|
+
id={`variants-styles-${props.builderBlock?.id}`}
|
|
6399
|
+
/>
|
|
6400
|
+
<Inlined_script_default
|
|
6401
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6402
|
+
scriptStr={scriptStr()}
|
|
6403
|
+
id={`variants-script-${props.builderBlock?.id}`}
|
|
6404
|
+
/>
|
|
6405
|
+
</Show10>
|
|
6406
|
+
<Blocks_default
|
|
6407
|
+
blocks={blocksToRender().blocks}
|
|
6408
|
+
parent={props.builderBlock?.id}
|
|
6409
|
+
path={blocksToRender().path}
|
|
6410
|
+
/>
|
|
6411
|
+
</div></>;
|
|
6412
|
+
}
|
|
6413
|
+
var personalization_container_default = PersonalizationContainer;
|
|
6414
|
+
|
|
6415
|
+
// src/blocks/section/component-info.ts
|
|
6416
|
+
var componentInfo7 = {
|
|
5955
6417
|
name: "Core:Section",
|
|
5956
6418
|
static: true,
|
|
5957
6419
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -5993,7 +6455,7 @@ var componentInfo6 = {
|
|
|
5993
6455
|
};
|
|
5994
6456
|
|
|
5995
6457
|
// src/blocks/slot/component-info.ts
|
|
5996
|
-
var
|
|
6458
|
+
var componentInfo8 = {
|
|
5997
6459
|
name: "Slot",
|
|
5998
6460
|
isRSC: true,
|
|
5999
6461
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -6032,7 +6494,7 @@ function Slot(props) {
|
|
|
6032
6494
|
var slot_default = Slot;
|
|
6033
6495
|
|
|
6034
6496
|
// src/blocks/symbol/component-info.ts
|
|
6035
|
-
var
|
|
6497
|
+
var componentInfo9 = {
|
|
6036
6498
|
name: "Symbol",
|
|
6037
6499
|
noWrap: true,
|
|
6038
6500
|
static: true,
|
|
@@ -6114,7 +6576,7 @@ var defaultElement = {
|
|
|
6114
6576
|
}
|
|
6115
6577
|
}
|
|
6116
6578
|
};
|
|
6117
|
-
var
|
|
6579
|
+
var componentInfo10 = {
|
|
6118
6580
|
name: "Builder: Tabs",
|
|
6119
6581
|
inputs: [{
|
|
6120
6582
|
name: "tabs",
|
|
@@ -6220,9 +6682,9 @@ var componentInfo9 = {
|
|
|
6220
6682
|
};
|
|
6221
6683
|
|
|
6222
6684
|
// src/blocks/tabs/tabs.tsx
|
|
6223
|
-
import { Show as
|
|
6685
|
+
import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
|
|
6224
6686
|
function Tabs(props) {
|
|
6225
|
-
const [activeTab, setActiveTab] =
|
|
6687
|
+
const [activeTab, setActiveTab] = createSignal11(
|
|
6226
6688
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
6227
6689
|
);
|
|
6228
6690
|
function activeTabContent(active) {
|
|
@@ -6244,7 +6706,7 @@ function Tabs(props) {
|
|
|
6244
6706
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
6245
6707
|
overflow: "auto"
|
|
6246
6708
|
}}
|
|
6247
|
-
><
|
|
6709
|
+
><For7 each={props.tabs}>{(tab, _index) => {
|
|
6248
6710
|
const index = _index();
|
|
6249
6711
|
return <span
|
|
6250
6712
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
@@ -6261,21 +6723,21 @@ function Tabs(props) {
|
|
|
6261
6723
|
registeredComponents={props.builderComponents}
|
|
6262
6724
|
linkComponent={props.builderLinkComponent}
|
|
6263
6725
|
/></span>;
|
|
6264
|
-
}}</
|
|
6265
|
-
<
|
|
6726
|
+
}}</For7></div>
|
|
6727
|
+
<Show11 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
6266
6728
|
parent={props.builderBlock.id}
|
|
6267
6729
|
path={`tabs.${activeTab()}.content`}
|
|
6268
6730
|
blocks={activeTabContent(activeTab())}
|
|
6269
6731
|
context={props.builderContext}
|
|
6270
6732
|
registeredComponents={props.builderComponents}
|
|
6271
6733
|
linkComponent={props.builderLinkComponent}
|
|
6272
|
-
/></div></
|
|
6734
|
+
/></div></Show11>
|
|
6273
6735
|
</div></>;
|
|
6274
6736
|
}
|
|
6275
6737
|
var tabs_default = Tabs;
|
|
6276
6738
|
|
|
6277
6739
|
// src/blocks/text/component-info.ts
|
|
6278
|
-
var
|
|
6740
|
+
var componentInfo11 = {
|
|
6279
6741
|
shouldReceiveBuilderProps: {
|
|
6280
6742
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
6281
6743
|
builderContext: true
|
|
@@ -6312,7 +6774,7 @@ function Text(props) {
|
|
|
6312
6774
|
var text_default = Text;
|
|
6313
6775
|
|
|
6314
6776
|
// src/blocks/custom-code/component-info.ts
|
|
6315
|
-
var
|
|
6777
|
+
var componentInfo12 = {
|
|
6316
6778
|
name: "Custom Code",
|
|
6317
6779
|
static: true,
|
|
6318
6780
|
requiredPermissions: ["editCode"],
|
|
@@ -6337,12 +6799,12 @@ var componentInfo11 = {
|
|
|
6337
6799
|
};
|
|
6338
6800
|
|
|
6339
6801
|
// src/blocks/custom-code/custom-code.tsx
|
|
6340
|
-
import { onMount as
|
|
6802
|
+
import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
|
|
6341
6803
|
function CustomCode(props) {
|
|
6342
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6343
|
-
const [scriptsRun, setScriptsRun] =
|
|
6804
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6805
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6344
6806
|
let elementRef;
|
|
6345
|
-
|
|
6807
|
+
onMount5(() => {
|
|
6346
6808
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
6347
6809
|
return;
|
|
6348
6810
|
}
|
|
@@ -6383,7 +6845,7 @@ function CustomCode(props) {
|
|
|
6383
6845
|
var custom_code_default = CustomCode;
|
|
6384
6846
|
|
|
6385
6847
|
// src/blocks/embed/component-info.ts
|
|
6386
|
-
var
|
|
6848
|
+
var componentInfo13 = {
|
|
6387
6849
|
name: "Embed",
|
|
6388
6850
|
static: true,
|
|
6389
6851
|
inputs: [{
|
|
@@ -6401,7 +6863,7 @@ var componentInfo12 = {
|
|
|
6401
6863
|
};
|
|
6402
6864
|
|
|
6403
6865
|
// src/blocks/embed/embed.tsx
|
|
6404
|
-
import { on as on2, createEffect as createEffect2, createMemo as
|
|
6866
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6405
6867
|
|
|
6406
6868
|
// src/blocks/embed/helpers.ts
|
|
6407
6869
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -6409,9 +6871,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
6409
6871
|
|
|
6410
6872
|
// src/blocks/embed/embed.tsx
|
|
6411
6873
|
function Embed(props) {
|
|
6412
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6413
|
-
const [scriptsRun, setScriptsRun] =
|
|
6414
|
-
const [ranInitFn, setRanInitFn] =
|
|
6874
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
6875
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
6876
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
6415
6877
|
function findAndRunScripts() {
|
|
6416
6878
|
if (!elem || !elem.getElementsByTagName)
|
|
6417
6879
|
return;
|
|
@@ -6434,8 +6896,8 @@ function Embed(props) {
|
|
|
6434
6896
|
}
|
|
6435
6897
|
}
|
|
6436
6898
|
let elem;
|
|
6437
|
-
const onUpdateFn_0_elem =
|
|
6438
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
6899
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
6900
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
6439
6901
|
function onUpdateFn_0() {
|
|
6440
6902
|
if (elem && !ranInitFn()) {
|
|
6441
6903
|
setRanInitFn(true);
|
|
@@ -6450,7 +6912,7 @@ function Embed(props) {
|
|
|
6450
6912
|
var embed_default = Embed;
|
|
6451
6913
|
|
|
6452
6914
|
// src/blocks/form/form/component-info.ts
|
|
6453
|
-
var
|
|
6915
|
+
var componentInfo14 = {
|
|
6454
6916
|
name: "Form:Form",
|
|
6455
6917
|
// editableTags: ['builder-form-error']
|
|
6456
6918
|
defaults: {
|
|
@@ -6690,7 +7152,7 @@ var componentInfo13 = {
|
|
|
6690
7152
|
};
|
|
6691
7153
|
|
|
6692
7154
|
// src/blocks/form/form/form.tsx
|
|
6693
|
-
import { Show as
|
|
7155
|
+
import { Show as Show12, createSignal as createSignal14 } from "solid-js";
|
|
6694
7156
|
|
|
6695
7157
|
// src/functions/get-env.ts
|
|
6696
7158
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -6710,9 +7172,9 @@ function logFetch(url) {
|
|
|
6710
7172
|
|
|
6711
7173
|
// src/blocks/form/form/form.tsx
|
|
6712
7174
|
function FormComponent(props) {
|
|
6713
|
-
const [formState, setFormState] =
|
|
6714
|
-
const [responseData, setResponseData] =
|
|
6715
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
7175
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
7176
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
7177
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
6716
7178
|
function mergeNewRootState(newData) {
|
|
6717
7179
|
const combinedState = {
|
|
6718
7180
|
...props.builderContext.rootState,
|
|
@@ -6908,22 +7370,22 @@ function FormComponent(props) {
|
|
|
6908
7370
|
{...props.attributes}
|
|
6909
7371
|
>
|
|
6910
7372
|
{props.children}
|
|
6911
|
-
<
|
|
7373
|
+
<Show12 when={submissionState() === "error"}><Blocks_default
|
|
6912
7374
|
path="errorMessage"
|
|
6913
7375
|
blocks={props.errorMessage}
|
|
6914
7376
|
context={props.builderContext}
|
|
6915
|
-
/></
|
|
6916
|
-
<
|
|
7377
|
+
/></Show12>
|
|
7378
|
+
<Show12 when={submissionState() === "sending"}><Blocks_default
|
|
6917
7379
|
path="sendingMessage"
|
|
6918
7380
|
blocks={props.sendingMessage}
|
|
6919
7381
|
context={props.builderContext}
|
|
6920
|
-
/></
|
|
6921
|
-
<
|
|
6922
|
-
<
|
|
7382
|
+
/></Show12>
|
|
7383
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
7384
|
+
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
6923
7385
|
path="successMessage"
|
|
6924
7386
|
blocks={props.successMessage}
|
|
6925
7387
|
context={props.builderContext}
|
|
6926
|
-
/></
|
|
7388
|
+
/></Show12>
|
|
6927
7389
|
</form>
|
|
6928
7390
|
<style>{`.pre-04a43b72 {
|
|
6929
7391
|
padding: 10px;
|
|
@@ -6935,7 +7397,7 @@ function FormComponent(props) {
|
|
|
6935
7397
|
var form_default = FormComponent;
|
|
6936
7398
|
|
|
6937
7399
|
// src/blocks/form/input/component-info.ts
|
|
6938
|
-
var
|
|
7400
|
+
var componentInfo15 = {
|
|
6939
7401
|
name: "Form:Input",
|
|
6940
7402
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6941
7403
|
inputs: [
|
|
@@ -7005,7 +7467,7 @@ function FormInputComponent(props) {
|
|
|
7005
7467
|
var input_default = FormInputComponent;
|
|
7006
7468
|
|
|
7007
7469
|
// src/blocks/form/select/component-info.ts
|
|
7008
|
-
var
|
|
7470
|
+
var componentInfo16 = {
|
|
7009
7471
|
name: "Form:Select",
|
|
7010
7472
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
7011
7473
|
defaultStyles: {
|
|
@@ -7050,7 +7512,7 @@ var componentInfo15 = {
|
|
|
7050
7512
|
};
|
|
7051
7513
|
|
|
7052
7514
|
// src/blocks/form/select/select.tsx
|
|
7053
|
-
import { For as
|
|
7515
|
+
import { For as For8 } from "solid-js";
|
|
7054
7516
|
function SelectComponent(props) {
|
|
7055
7517
|
return <><select
|
|
7056
7518
|
{...{}}
|
|
@@ -7060,15 +7522,15 @@ function SelectComponent(props) {
|
|
|
7060
7522
|
defaultValue={props.defaultValue}
|
|
7061
7523
|
name={props.name}
|
|
7062
7524
|
required={props.required}
|
|
7063
|
-
><
|
|
7525
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
7064
7526
|
const index = _index();
|
|
7065
7527
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
7066
|
-
}}</
|
|
7528
|
+
}}</For8></select></>;
|
|
7067
7529
|
}
|
|
7068
7530
|
var select_default = SelectComponent;
|
|
7069
7531
|
|
|
7070
7532
|
// src/blocks/form/submit-button/component-info.ts
|
|
7071
|
-
var
|
|
7533
|
+
var componentInfo17 = {
|
|
7072
7534
|
name: "Form:SubmitButton",
|
|
7073
7535
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
7074
7536
|
defaultStyles: {
|
|
@@ -7102,7 +7564,7 @@ function SubmitButton(props) {
|
|
|
7102
7564
|
var submit_button_default = SubmitButton;
|
|
7103
7565
|
|
|
7104
7566
|
// src/blocks/form/textarea/component-info.ts
|
|
7105
|
-
var
|
|
7567
|
+
var componentInfo18 = {
|
|
7106
7568
|
name: "Form:TextArea",
|
|
7107
7569
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
7108
7570
|
inputs: [{
|
|
@@ -7155,7 +7617,7 @@ function Textarea(props) {
|
|
|
7155
7617
|
var textarea_default = Textarea;
|
|
7156
7618
|
|
|
7157
7619
|
// src/blocks/img/component-info.ts
|
|
7158
|
-
var
|
|
7620
|
+
var componentInfo19 = {
|
|
7159
7621
|
// friendlyName?
|
|
7160
7622
|
name: "Raw:Img",
|
|
7161
7623
|
hideFromInsertMenu: true,
|
|
@@ -7188,7 +7650,7 @@ function ImgComponent(props) {
|
|
|
7188
7650
|
var img_default = ImgComponent;
|
|
7189
7651
|
|
|
7190
7652
|
// src/blocks/video/component-info.ts
|
|
7191
|
-
var
|
|
7653
|
+
var componentInfo20 = {
|
|
7192
7654
|
name: "Video",
|
|
7193
7655
|
canHaveChildren: true,
|
|
7194
7656
|
defaultStyles: {
|
|
@@ -7275,9 +7737,9 @@ var componentInfo19 = {
|
|
|
7275
7737
|
};
|
|
7276
7738
|
|
|
7277
7739
|
// src/blocks/video/video.tsx
|
|
7278
|
-
import { Show as
|
|
7740
|
+
import { Show as Show13, createMemo as createMemo15 } from "solid-js";
|
|
7279
7741
|
function Video(props) {
|
|
7280
|
-
const videoProps =
|
|
7742
|
+
const videoProps = createMemo15(() => {
|
|
7281
7743
|
return {
|
|
7282
7744
|
...props.autoPlay === true ? {
|
|
7283
7745
|
autoPlay: true
|
|
@@ -7296,7 +7758,7 @@ function Video(props) {
|
|
|
7296
7758
|
} : {}
|
|
7297
7759
|
};
|
|
7298
7760
|
});
|
|
7299
|
-
const spreadProps =
|
|
7761
|
+
const spreadProps = createMemo15(() => {
|
|
7300
7762
|
return {
|
|
7301
7763
|
...videoProps()
|
|
7302
7764
|
};
|
|
@@ -7325,8 +7787,8 @@ function Video(props) {
|
|
|
7325
7787
|
}}
|
|
7326
7788
|
src={props.video || "no-src"}
|
|
7327
7789
|
poster={props.posterImage}
|
|
7328
|
-
><
|
|
7329
|
-
<
|
|
7790
|
+
><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
|
|
7791
|
+
<Show13
|
|
7330
7792
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
7331
7793
|
><div
|
|
7332
7794
|
style={{
|
|
@@ -7335,15 +7797,15 @@ function Video(props) {
|
|
|
7335
7797
|
"pointer-events": "none",
|
|
7336
7798
|
"font-size": "0px"
|
|
7337
7799
|
}}
|
|
7338
|
-
/></
|
|
7339
|
-
<
|
|
7800
|
+
/></Show13>
|
|
7801
|
+
<Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
7340
7802
|
style={{
|
|
7341
7803
|
display: "flex",
|
|
7342
7804
|
"flex-direction": "column",
|
|
7343
7805
|
"align-items": "stretch"
|
|
7344
7806
|
}}
|
|
7345
|
-
>{props.children}</div></
|
|
7346
|
-
<
|
|
7807
|
+
>{props.children}</div></Show13>
|
|
7808
|
+
<Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
7347
7809
|
style={{
|
|
7348
7810
|
"pointer-events": "none",
|
|
7349
7811
|
display: "flex",
|
|
@@ -7355,7 +7817,7 @@ function Video(props) {
|
|
|
7355
7817
|
width: "100%",
|
|
7356
7818
|
height: "100%"
|
|
7357
7819
|
}}
|
|
7358
|
-
>{props.children}</div></
|
|
7820
|
+
>{props.children}</div></Show13>
|
|
7359
7821
|
</div></>;
|
|
7360
7822
|
}
|
|
7361
7823
|
var video_default = Video;
|
|
@@ -7363,31 +7825,31 @@ var video_default = Video;
|
|
|
7363
7825
|
// src/constants/extra-components.ts
|
|
7364
7826
|
var getExtraComponents = () => [{
|
|
7365
7827
|
component: custom_code_default,
|
|
7366
|
-
...
|
|
7828
|
+
...componentInfo12
|
|
7367
7829
|
}, {
|
|
7368
7830
|
component: embed_default,
|
|
7369
|
-
...
|
|
7831
|
+
...componentInfo13
|
|
7370
7832
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7371
7833
|
component: form_default,
|
|
7372
|
-
...
|
|
7834
|
+
...componentInfo14
|
|
7373
7835
|
}, {
|
|
7374
7836
|
component: input_default,
|
|
7375
|
-
...
|
|
7837
|
+
...componentInfo15
|
|
7376
7838
|
}, {
|
|
7377
7839
|
component: submit_button_default,
|
|
7378
|
-
...
|
|
7840
|
+
...componentInfo17
|
|
7379
7841
|
}, {
|
|
7380
7842
|
component: select_default,
|
|
7381
|
-
...
|
|
7843
|
+
...componentInfo16
|
|
7382
7844
|
}, {
|
|
7383
7845
|
component: textarea_default,
|
|
7384
|
-
...
|
|
7846
|
+
...componentInfo18
|
|
7385
7847
|
}], {
|
|
7386
7848
|
component: img_default,
|
|
7387
|
-
...
|
|
7849
|
+
...componentInfo19
|
|
7388
7850
|
}, {
|
|
7389
7851
|
component: video_default,
|
|
7390
|
-
...
|
|
7852
|
+
...componentInfo20
|
|
7391
7853
|
}];
|
|
7392
7854
|
|
|
7393
7855
|
// src/constants/builder-registered-components.ts
|
|
@@ -7405,19 +7867,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7405
7867
|
...componentInfo5
|
|
7406
7868
|
}, {
|
|
7407
7869
|
component: section_default,
|
|
7408
|
-
...
|
|
7870
|
+
...componentInfo7
|
|
7409
7871
|
}, {
|
|
7410
7872
|
component: slot_default,
|
|
7411
|
-
...
|
|
7873
|
+
...componentInfo8
|
|
7412
7874
|
}, {
|
|
7413
7875
|
component: symbol_default,
|
|
7414
|
-
...
|
|
7876
|
+
...componentInfo9
|
|
7415
7877
|
}, {
|
|
7416
7878
|
component: text_default,
|
|
7417
|
-
...
|
|
7418
|
-
}, ...TARGET === "
|
|
7879
|
+
...componentInfo11
|
|
7880
|
+
}, ...TARGET === "react" ? [{
|
|
7881
|
+
component: personalization_container_default,
|
|
7882
|
+
...componentInfo6
|
|
7883
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
7419
7884
|
component: tabs_default,
|
|
7420
|
-
...
|
|
7885
|
+
...componentInfo10
|
|
7421
7886
|
}, {
|
|
7422
7887
|
component: accordion_default,
|
|
7423
7888
|
...componentInfo
|
|
@@ -7455,7 +7920,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
7455
7920
|
testVariationId: variant.id,
|
|
7456
7921
|
id: content?.id
|
|
7457
7922
|
}));
|
|
7458
|
-
var
|
|
7923
|
+
var checkShouldRenderVariants2 = ({
|
|
7459
7924
|
canTrack,
|
|
7460
7925
|
content
|
|
7461
7926
|
}) => {
|
|
@@ -7489,24 +7954,14 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7489
7954
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7490
7955
|
)`;
|
|
7491
7956
|
|
|
7492
|
-
// src/components/inlined-script.tsx
|
|
7493
|
-
function InlinedScript(props) {
|
|
7494
|
-
return <><script
|
|
7495
|
-
innerHTML={props.scriptStr}
|
|
7496
|
-
data-id={props.id}
|
|
7497
|
-
nonce={props.nonce || ""}
|
|
7498
|
-
/></>;
|
|
7499
|
-
}
|
|
7500
|
-
var Inlined_script_default = InlinedScript;
|
|
7501
|
-
|
|
7502
7957
|
// src/components/content/components/enable-editor.tsx
|
|
7503
7958
|
import {
|
|
7504
|
-
Show as
|
|
7505
|
-
onMount as
|
|
7959
|
+
Show as Show14,
|
|
7960
|
+
onMount as onMount6,
|
|
7506
7961
|
on as on3,
|
|
7507
7962
|
createEffect as createEffect3,
|
|
7508
|
-
createMemo as
|
|
7509
|
-
createSignal as
|
|
7963
|
+
createMemo as createMemo16,
|
|
7964
|
+
createSignal as createSignal16
|
|
7510
7965
|
} from "solid-js";
|
|
7511
7966
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
7512
7967
|
|
|
@@ -7516,7 +7971,7 @@ function getPreviewContent(_searchParams) {
|
|
|
7516
7971
|
}
|
|
7517
7972
|
|
|
7518
7973
|
// src/constants/sdk-version.ts
|
|
7519
|
-
var SDK_VERSION = "3.0.
|
|
7974
|
+
var SDK_VERSION = "3.0.7";
|
|
7520
7975
|
|
|
7521
7976
|
// src/helpers/sdk-headers.ts
|
|
7522
7977
|
var getSdkHeaders = () => ({
|
|
@@ -7811,16 +8266,6 @@ async function fetchEntries(options) {
|
|
|
7811
8266
|
return _processContentResult(options, content);
|
|
7812
8267
|
}
|
|
7813
8268
|
|
|
7814
|
-
// src/functions/is-previewing.ts
|
|
7815
|
-
function isPreviewing(_search) {
|
|
7816
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
7817
|
-
if (!search) {
|
|
7818
|
-
return false;
|
|
7819
|
-
}
|
|
7820
|
-
const normalizedSearch = getSearchString(search);
|
|
7821
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
7822
|
-
}
|
|
7823
|
-
|
|
7824
8269
|
// src/helpers/uuid.ts
|
|
7825
8270
|
function uuidv4() {
|
|
7826
8271
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -8143,7 +8588,9 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
8143
8588
|
// Supports builder-model="..." attribute which is needed to
|
|
8144
8589
|
// scope our '+ add block' button styling
|
|
8145
8590
|
supportsAddBlockScoping: true,
|
|
8146
|
-
supportsCustomBreakpoints: true
|
|
8591
|
+
supportsCustomBreakpoints: true,
|
|
8592
|
+
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
8593
|
+
blockLevelPersonalization: true
|
|
8147
8594
|
}
|
|
8148
8595
|
}, "*");
|
|
8149
8596
|
window.parent?.postMessage({
|
|
@@ -8358,12 +8805,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
8358
8805
|
|
|
8359
8806
|
// src/components/content/components/enable-editor.tsx
|
|
8360
8807
|
function EnableEditor(props) {
|
|
8361
|
-
const [ContentWrapper, setContentWrapper] =
|
|
8808
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
8362
8809
|
props.contentWrapper || "div"
|
|
8363
8810
|
);
|
|
8364
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8365
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8366
|
-
const [clicked, setClicked] =
|
|
8811
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
8812
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
8813
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
8367
8814
|
function mergeNewRootState(newData) {
|
|
8368
8815
|
const combinedState = {
|
|
8369
8816
|
...props.builderContextSignal.rootState,
|
|
@@ -8397,7 +8844,7 @@ function EnableEditor(props) {
|
|
|
8397
8844
|
content: newContentValue
|
|
8398
8845
|
}));
|
|
8399
8846
|
}
|
|
8400
|
-
const showContentProps =
|
|
8847
|
+
const showContentProps = createMemo16(() => {
|
|
8401
8848
|
return props.showContent ? {} : {
|
|
8402
8849
|
hidden: true,
|
|
8403
8850
|
"aria-hidden": true
|
|
@@ -8503,7 +8950,7 @@ function EnableEditor(props) {
|
|
|
8503
8950
|
let elementRef;
|
|
8504
8951
|
runHttpRequests();
|
|
8505
8952
|
emitStateUpdate();
|
|
8506
|
-
|
|
8953
|
+
onMount6(() => {
|
|
8507
8954
|
if (isBrowser()) {
|
|
8508
8955
|
if (isEditing() && !props.isNestedRender) {
|
|
8509
8956
|
window.addEventListener("message", processMessage);
|
|
@@ -8572,14 +9019,14 @@ function EnableEditor(props) {
|
|
|
8572
9019
|
}
|
|
8573
9020
|
}
|
|
8574
9021
|
});
|
|
8575
|
-
const onUpdateFn_0_props_content =
|
|
9022
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
8576
9023
|
function onUpdateFn_0() {
|
|
8577
9024
|
if (props.content) {
|
|
8578
9025
|
mergeNewContent(props.content);
|
|
8579
9026
|
}
|
|
8580
9027
|
}
|
|
8581
9028
|
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8582
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9029
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
|
|
8583
9030
|
() => props.builderContextSignal.rootState
|
|
8584
9031
|
);
|
|
8585
9032
|
function onUpdateFn_1() {
|
|
@@ -8591,14 +9038,14 @@ function EnableEditor(props) {
|
|
|
8591
9038
|
onUpdateFn_1
|
|
8592
9039
|
)
|
|
8593
9040
|
);
|
|
8594
|
-
const onUpdateFn_2_props_data =
|
|
9041
|
+
const onUpdateFn_2_props_data = createMemo16(() => props.data);
|
|
8595
9042
|
function onUpdateFn_2() {
|
|
8596
9043
|
if (props.data) {
|
|
8597
9044
|
mergeNewRootState(props.data);
|
|
8598
9045
|
}
|
|
8599
9046
|
}
|
|
8600
9047
|
createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
8601
|
-
const onUpdateFn_3_props_locale =
|
|
9048
|
+
const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
|
|
8602
9049
|
function onUpdateFn_3() {
|
|
8603
9050
|
if (props.locale) {
|
|
8604
9051
|
mergeNewRootState({
|
|
@@ -8607,7 +9054,7 @@ function EnableEditor(props) {
|
|
|
8607
9054
|
}
|
|
8608
9055
|
}
|
|
8609
9056
|
createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
8610
|
-
return <><builder_context_default.Provider value={props.builderContextSignal}><
|
|
9057
|
+
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
8611
9058
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
8612
9059
|
><Dynamic5
|
|
8613
9060
|
class={getWrapperClassName(
|
|
@@ -8625,14 +9072,14 @@ function EnableEditor(props) {
|
|
|
8625
9072
|
{...showContentProps()}
|
|
8626
9073
|
{...props.contentWrapperProps}
|
|
8627
9074
|
component={ContentWrapper()}
|
|
8628
|
-
>{props.children}</Dynamic5></
|
|
9075
|
+
>{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
|
|
8629
9076
|
}
|
|
8630
9077
|
var Enable_editor_default = EnableEditor;
|
|
8631
9078
|
|
|
8632
9079
|
// src/components/content/components/styles.tsx
|
|
8633
|
-
import { createSignal as
|
|
9080
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
8634
9081
|
function ContentStyles(props) {
|
|
8635
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9082
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
8636
9083
|
`
|
|
8637
9084
|
${getCss({
|
|
8638
9085
|
cssCode: props.cssCode,
|
|
@@ -8690,7 +9137,7 @@ var getContentInitialValue = ({
|
|
|
8690
9137
|
|
|
8691
9138
|
// src/components/content/content.tsx
|
|
8692
9139
|
function ContentComponent(props) {
|
|
8693
|
-
const [scriptStr, setScriptStr] =
|
|
9140
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
8694
9141
|
getUpdateVariantVisibilityScript({
|
|
8695
9142
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8696
9143
|
variationId: props.content?.testVariationId,
|
|
@@ -8698,7 +9145,7 @@ function ContentComponent(props) {
|
|
|
8698
9145
|
contentId: props.content?.id
|
|
8699
9146
|
})
|
|
8700
9147
|
);
|
|
8701
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9148
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
8702
9149
|
[
|
|
8703
9150
|
...getDefaultRegisteredComponents(),
|
|
8704
9151
|
...props.customComponents || []
|
|
@@ -8713,7 +9160,7 @@ function ContentComponent(props) {
|
|
|
8713
9160
|
{}
|
|
8714
9161
|
)
|
|
8715
9162
|
);
|
|
8716
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9163
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
8717
9164
|
content: getContentInitialValue({
|
|
8718
9165
|
content: props.content,
|
|
8719
9166
|
data: props.data
|
|
@@ -8797,18 +9244,18 @@ function ContentComponent(props) {
|
|
|
8797
9244
|
setBuilderContextSignal
|
|
8798
9245
|
}}
|
|
8799
9246
|
>
|
|
8800
|
-
<
|
|
9247
|
+
<Show15 when={props.isSsrAbTest}><Inlined_script_default
|
|
8801
9248
|
id="builderio-variant-visibility"
|
|
8802
9249
|
scriptStr={scriptStr()}
|
|
8803
9250
|
nonce={props.nonce || ""}
|
|
8804
|
-
/></
|
|
8805
|
-
<
|
|
9251
|
+
/></Show15>
|
|
9252
|
+
<Show15 when={TARGET !== "reactNative"}><Styles_default
|
|
8806
9253
|
nonce={props.nonce || ""}
|
|
8807
9254
|
isNestedRender={props.isNestedRender}
|
|
8808
9255
|
contentId={builderContextSignal().content?.id}
|
|
8809
9256
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
8810
9257
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
8811
|
-
/></
|
|
9258
|
+
/></Show15>
|
|
8812
9259
|
<Blocks_default
|
|
8813
9260
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
8814
9261
|
context={builderContextSignal()}
|
|
@@ -8821,13 +9268,13 @@ var Content_default = ContentComponent;
|
|
|
8821
9268
|
|
|
8822
9269
|
// src/components/content-variants/content-variants.tsx
|
|
8823
9270
|
function ContentVariants(props) {
|
|
8824
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
8825
|
-
|
|
9271
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
9272
|
+
checkShouldRenderVariants2({
|
|
8826
9273
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
8827
9274
|
content: props.content
|
|
8828
9275
|
})
|
|
8829
9276
|
);
|
|
8830
|
-
const updateCookieAndStylesScriptStr =
|
|
9277
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
8831
9278
|
return getUpdateCookieAndStylesScript(
|
|
8832
9279
|
getVariants(props.content).map((value) => ({
|
|
8833
9280
|
id: value.testVariationId,
|
|
@@ -8836,10 +9283,10 @@ function ContentVariants(props) {
|
|
|
8836
9283
|
props.content?.id || ""
|
|
8837
9284
|
);
|
|
8838
9285
|
});
|
|
8839
|
-
const hideVariantsStyleString =
|
|
9286
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
8840
9287
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
8841
9288
|
});
|
|
8842
|
-
const defaultContent =
|
|
9289
|
+
const defaultContent = createMemo19(() => {
|
|
8843
9290
|
return shouldRenderVariants() ? {
|
|
8844
9291
|
...props.content,
|
|
8845
9292
|
testVariationId: props.content?.id
|
|
@@ -8848,16 +9295,16 @@ function ContentVariants(props) {
|
|
|
8848
9295
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
8849
9296
|
});
|
|
8850
9297
|
});
|
|
8851
|
-
|
|
9298
|
+
onMount7(() => {
|
|
8852
9299
|
setShouldRenderVariants(false);
|
|
8853
9300
|
});
|
|
8854
9301
|
return <><>
|
|
8855
|
-
<
|
|
9302
|
+
<Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8856
9303
|
id="builderio-init-variants-fns"
|
|
8857
9304
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8858
9305
|
nonce={props.nonce || ""}
|
|
8859
|
-
/></
|
|
8860
|
-
<
|
|
9306
|
+
/></Show16>
|
|
9307
|
+
<Show16 when={shouldRenderVariants()}>
|
|
8861
9308
|
<Inlined_styles_default
|
|
8862
9309
|
id="builderio-variants"
|
|
8863
9310
|
styles={hideVariantsStyleString()}
|
|
@@ -8868,7 +9315,7 @@ function ContentVariants(props) {
|
|
|
8868
9315
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8869
9316
|
nonce={props.nonce || ""}
|
|
8870
9317
|
/>
|
|
8871
|
-
<
|
|
9318
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8872
9319
|
const index = _index();
|
|
8873
9320
|
return <Content_default
|
|
8874
9321
|
apiHost={props.apiHost}
|
|
@@ -8895,8 +9342,8 @@ function ContentVariants(props) {
|
|
|
8895
9342
|
trustedHosts={props.trustedHosts}
|
|
8896
9343
|
{...{}}
|
|
8897
9344
|
/>;
|
|
8898
|
-
}}</
|
|
8899
|
-
</
|
|
9345
|
+
}}</For9>
|
|
9346
|
+
</Show16>
|
|
8900
9347
|
<Content_default
|
|
8901
9348
|
apiHost={props.apiHost}
|
|
8902
9349
|
nonce={props.nonce}
|
|
@@ -8951,14 +9398,14 @@ var fetchSymbolContent = async ({
|
|
|
8951
9398
|
|
|
8952
9399
|
// src/blocks/symbol/symbol.tsx
|
|
8953
9400
|
function Symbol2(props) {
|
|
8954
|
-
const [contentToUse, setContentToUse] =
|
|
8955
|
-
const blocksWrapper =
|
|
9401
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
9402
|
+
const blocksWrapper = createMemo20(() => {
|
|
8956
9403
|
return "div";
|
|
8957
9404
|
});
|
|
8958
|
-
const contentWrapper =
|
|
9405
|
+
const contentWrapper = createMemo20(() => {
|
|
8959
9406
|
return "div";
|
|
8960
9407
|
});
|
|
8961
|
-
const className =
|
|
9408
|
+
const className = createMemo20(() => {
|
|
8962
9409
|
return [
|
|
8963
9410
|
...[props.attributes[getClassPropName()]],
|
|
8964
9411
|
"builder-symbol",
|
|
@@ -8978,9 +9425,9 @@ function Symbol2(props) {
|
|
|
8978
9425
|
}
|
|
8979
9426
|
});
|
|
8980
9427
|
}
|
|
8981
|
-
|
|
9428
|
+
onMount8(() => {
|
|
8982
9429
|
});
|
|
8983
|
-
const onUpdateFn_0_props_symbol =
|
|
9430
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
8984
9431
|
function onUpdateFn_0() {
|
|
8985
9432
|
setContent();
|
|
8986
9433
|
}
|
|
@@ -9065,6 +9512,7 @@ export {
|
|
|
9065
9512
|
isEditing,
|
|
9066
9513
|
isPreviewing,
|
|
9067
9514
|
register,
|
|
9515
|
+
setClientUserAttributes,
|
|
9068
9516
|
setEditorSettings,
|
|
9069
9517
|
subscribeToEditor,
|
|
9070
9518
|
track
|