@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/dev.jsx
CHANGED
|
@@ -4118,8 +4118,13 @@ import { Show as Show2, createMemo } from "solid-js";
|
|
|
4118
4118
|
|
|
4119
4119
|
// src/constants/device-sizes.ts
|
|
4120
4120
|
var SIZES = {
|
|
4121
|
+
xsmall: {
|
|
4122
|
+
min: 0,
|
|
4123
|
+
default: 160,
|
|
4124
|
+
max: 320
|
|
4125
|
+
},
|
|
4121
4126
|
small: {
|
|
4122
|
-
min:
|
|
4127
|
+
min: 321,
|
|
4123
4128
|
default: 321,
|
|
4124
4129
|
max: 640
|
|
4125
4130
|
},
|
|
@@ -4135,15 +4140,28 @@ var SIZES = {
|
|
|
4135
4140
|
}
|
|
4136
4141
|
};
|
|
4137
4142
|
var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
4138
|
-
var getSizesForBreakpoints = ({
|
|
4139
|
-
small,
|
|
4140
|
-
medium
|
|
4141
|
-
}) => {
|
|
4143
|
+
var getSizesForBreakpoints = (breakpoints) => {
|
|
4142
4144
|
const newSizes = fastClone(SIZES);
|
|
4145
|
+
if (!breakpoints) {
|
|
4146
|
+
return newSizes;
|
|
4147
|
+
}
|
|
4148
|
+
const {
|
|
4149
|
+
xsmall,
|
|
4150
|
+
small,
|
|
4151
|
+
medium
|
|
4152
|
+
} = breakpoints;
|
|
4153
|
+
if (xsmall) {
|
|
4154
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
4155
|
+
newSizes.xsmall = {
|
|
4156
|
+
max: xsmall,
|
|
4157
|
+
min: xsmallMin,
|
|
4158
|
+
default: xsmallMin + 1
|
|
4159
|
+
};
|
|
4160
|
+
}
|
|
4143
4161
|
if (!small || !medium) {
|
|
4144
4162
|
return newSizes;
|
|
4145
4163
|
}
|
|
4146
|
-
const smallMin = Math.floor(small / 2);
|
|
4164
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
4147
4165
|
newSizes.small = {
|
|
4148
4166
|
max: small,
|
|
4149
4167
|
min: smallMin,
|
|
@@ -4194,9 +4212,13 @@ function BlockStyles(props) {
|
|
|
4194
4212
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
4195
4213
|
content?.meta?.breakpoints || {}
|
|
4196
4214
|
);
|
|
4215
|
+
const contentHasXSmallBreakpoint = Boolean(
|
|
4216
|
+
content?.meta?.breakpoints?.xsmall
|
|
4217
|
+
);
|
|
4197
4218
|
const largeStyles = styles?.large;
|
|
4198
4219
|
const mediumStyles = styles?.medium;
|
|
4199
4220
|
const smallStyles = styles?.small;
|
|
4221
|
+
const xsmallStyles = styles?.xsmall;
|
|
4200
4222
|
const className = processedBlock.id;
|
|
4201
4223
|
if (!className) {
|
|
4202
4224
|
return "";
|
|
@@ -4221,6 +4243,14 @@ function BlockStyles(props) {
|
|
|
4221
4243
|
sizesWithUpdatedBreakpoints
|
|
4222
4244
|
)
|
|
4223
4245
|
}) : "";
|
|
4246
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
4247
|
+
className,
|
|
4248
|
+
styles: xsmallStyles,
|
|
4249
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
4250
|
+
"xsmall",
|
|
4251
|
+
sizesWithUpdatedBreakpoints
|
|
4252
|
+
)
|
|
4253
|
+
}) : "";
|
|
4224
4254
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
4225
4255
|
let hoverStylesClass = "";
|
|
4226
4256
|
if (hoverAnimation) {
|
|
@@ -4240,6 +4270,7 @@ function BlockStyles(props) {
|
|
|
4240
4270
|
largeStylesClass,
|
|
4241
4271
|
mediumStylesClass,
|
|
4242
4272
|
smallStylesClass,
|
|
4273
|
+
xsmallStylesClass,
|
|
4243
4274
|
hoverStylesClass
|
|
4244
4275
|
].join(" ");
|
|
4245
4276
|
});
|
|
@@ -4646,8 +4677,9 @@ function BlocksWrapper(props) {
|
|
|
4646
4677
|
if (!props.path) {
|
|
4647
4678
|
return void 0;
|
|
4648
4679
|
}
|
|
4680
|
+
const thisPrefix = "this.";
|
|
4649
4681
|
const pathPrefix = "component.options.";
|
|
4650
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4682
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4651
4683
|
});
|
|
4652
4684
|
function onClick() {
|
|
4653
4685
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -4682,7 +4714,7 @@ function BlocksWrapper(props) {
|
|
|
4682
4714
|
});
|
|
4683
4715
|
return <>
|
|
4684
4716
|
<Dynamic4
|
|
4685
|
-
class={className() + " dynamic-
|
|
4717
|
+
class={className() + " dynamic-3d7ff108"}
|
|
4686
4718
|
ref={blocksWrapperRef}
|
|
4687
4719
|
builder-path={dataPath()}
|
|
4688
4720
|
builder-parent-id={props.parent}
|
|
@@ -4694,7 +4726,7 @@ function BlocksWrapper(props) {
|
|
|
4694
4726
|
{...props.BlocksWrapperProps}
|
|
4695
4727
|
component={props.BlocksWrapper}
|
|
4696
4728
|
>{props.children}</Dynamic4>
|
|
4697
|
-
<style>{`.dynamic-
|
|
4729
|
+
<style>{`.dynamic-3d7ff108 {
|
|
4698
4730
|
display: flex;
|
|
4699
4731
|
flex-direction: column;
|
|
4700
4732
|
align-items: stretch;
|
|
@@ -5067,10 +5099,10 @@ function SectionComponent(props) {
|
|
|
5067
5099
|
var section_default = SectionComponent;
|
|
5068
5100
|
|
|
5069
5101
|
// src/blocks/symbol/symbol.tsx
|
|
5070
|
-
import { onMount as
|
|
5102
|
+
import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
5071
5103
|
|
|
5072
5104
|
// src/components/content-variants/content-variants.tsx
|
|
5073
|
-
import { Show as
|
|
5105
|
+
import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
5074
5106
|
|
|
5075
5107
|
// src/helpers/url.ts
|
|
5076
5108
|
var getTopLevelDomain = (host) => {
|
|
@@ -5260,11 +5292,61 @@ var handleABTesting = async ({
|
|
|
5260
5292
|
};
|
|
5261
5293
|
};
|
|
5262
5294
|
|
|
5295
|
+
// src/helpers/user-attributes.ts
|
|
5296
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5297
|
+
function createUserAttributesService() {
|
|
5298
|
+
let canTrack = true;
|
|
5299
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
5300
|
+
return {
|
|
5301
|
+
setUserAttributes(newAttrs) {
|
|
5302
|
+
if (!isBrowser()) {
|
|
5303
|
+
return;
|
|
5304
|
+
}
|
|
5305
|
+
const userAttributes = {
|
|
5306
|
+
...this.getUserAttributes(),
|
|
5307
|
+
...newAttrs
|
|
5308
|
+
};
|
|
5309
|
+
setCookie({
|
|
5310
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5311
|
+
value: JSON.stringify(userAttributes),
|
|
5312
|
+
canTrack
|
|
5313
|
+
});
|
|
5314
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
5315
|
+
},
|
|
5316
|
+
getUserAttributes() {
|
|
5317
|
+
if (!isBrowser()) {
|
|
5318
|
+
return {};
|
|
5319
|
+
}
|
|
5320
|
+
return JSON.parse(getCookieSync({
|
|
5321
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5322
|
+
canTrack
|
|
5323
|
+
}) || "{}");
|
|
5324
|
+
},
|
|
5325
|
+
subscribeOnUserAttributesChange(callback) {
|
|
5326
|
+
subscribers.add(callback);
|
|
5327
|
+
return () => {
|
|
5328
|
+
subscribers.delete(callback);
|
|
5329
|
+
};
|
|
5330
|
+
},
|
|
5331
|
+
setCanTrack(value) {
|
|
5332
|
+
canTrack = value;
|
|
5333
|
+
}
|
|
5334
|
+
};
|
|
5335
|
+
}
|
|
5336
|
+
var userAttributesService = createUserAttributesService();
|
|
5337
|
+
var setClientUserAttributes = (attributes) => {
|
|
5338
|
+
userAttributesService.setUserAttributes(attributes);
|
|
5339
|
+
};
|
|
5340
|
+
|
|
5263
5341
|
// src/helpers/canTrack.ts
|
|
5264
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
5342
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
5343
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
5344
|
+
userAttributesService.setCanTrack(result);
|
|
5345
|
+
return result;
|
|
5346
|
+
};
|
|
5265
5347
|
|
|
5266
5348
|
// src/components/content/content.tsx
|
|
5267
|
-
import { Show as
|
|
5349
|
+
import { Show as Show15, createSignal as createSignal18 } from "solid-js";
|
|
5268
5350
|
|
|
5269
5351
|
// src/blocks/accordion/component-info.ts
|
|
5270
5352
|
var defaultTitle = {
|
|
@@ -5959,8 +6041,388 @@ var componentInfo5 = {
|
|
|
5959
6041
|
}
|
|
5960
6042
|
};
|
|
5961
6043
|
|
|
5962
|
-
// src/blocks/
|
|
6044
|
+
// src/blocks/personalization-container/component-info.ts
|
|
5963
6045
|
var componentInfo6 = {
|
|
6046
|
+
name: "PersonalizationContainer",
|
|
6047
|
+
shouldReceiveBuilderProps: {
|
|
6048
|
+
builderBlock: true,
|
|
6049
|
+
builderContext: true
|
|
6050
|
+
},
|
|
6051
|
+
noWrap: true,
|
|
6052
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
6053
|
+
canHaveChildren: true,
|
|
6054
|
+
inputs: [{
|
|
6055
|
+
name: "variants",
|
|
6056
|
+
defaultValue: [],
|
|
6057
|
+
behavior: "personalizationVariantList",
|
|
6058
|
+
type: "list",
|
|
6059
|
+
subFields: [{
|
|
6060
|
+
name: "name",
|
|
6061
|
+
type: "text"
|
|
6062
|
+
}, {
|
|
6063
|
+
name: "query",
|
|
6064
|
+
friendlyName: "Targeting rules",
|
|
6065
|
+
type: "BuilderQuery",
|
|
6066
|
+
defaultValue: []
|
|
6067
|
+
}, {
|
|
6068
|
+
name: "startDate",
|
|
6069
|
+
type: "date"
|
|
6070
|
+
}, {
|
|
6071
|
+
name: "endDate",
|
|
6072
|
+
type: "date"
|
|
6073
|
+
}, {
|
|
6074
|
+
name: "blocks",
|
|
6075
|
+
type: "uiBlocks",
|
|
6076
|
+
hideFromUI: true,
|
|
6077
|
+
defaultValue: []
|
|
6078
|
+
}]
|
|
6079
|
+
}]
|
|
6080
|
+
};
|
|
6081
|
+
|
|
6082
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6083
|
+
import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
6084
|
+
|
|
6085
|
+
// src/components/inlined-script.tsx
|
|
6086
|
+
function InlinedScript(props) {
|
|
6087
|
+
return <><script
|
|
6088
|
+
innerHTML={props.scriptStr}
|
|
6089
|
+
data-id={props.id}
|
|
6090
|
+
nonce={props.nonce || ""}
|
|
6091
|
+
/></>;
|
|
6092
|
+
}
|
|
6093
|
+
var Inlined_script_default = InlinedScript;
|
|
6094
|
+
|
|
6095
|
+
// src/functions/is-previewing.ts
|
|
6096
|
+
function isPreviewing(_search) {
|
|
6097
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
6098
|
+
if (!search) {
|
|
6099
|
+
return false;
|
|
6100
|
+
}
|
|
6101
|
+
const normalizedSearch = getSearchString(search);
|
|
6102
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
6103
|
+
}
|
|
6104
|
+
|
|
6105
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
6106
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
6107
|
+
function isString(val) {
|
|
6108
|
+
return typeof val === "string";
|
|
6109
|
+
}
|
|
6110
|
+
function isNumber(val) {
|
|
6111
|
+
return typeof val === "number";
|
|
6112
|
+
}
|
|
6113
|
+
function objectMatchesQuery(userattr, query2) {
|
|
6114
|
+
const result = (() => {
|
|
6115
|
+
const property = query2.property;
|
|
6116
|
+
const operator = query2.operator;
|
|
6117
|
+
let testValue = query2.value;
|
|
6118
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
6119
|
+
testValue = query2.value.slice(0, -1);
|
|
6120
|
+
}
|
|
6121
|
+
if (!(property && operator)) {
|
|
6122
|
+
return true;
|
|
6123
|
+
}
|
|
6124
|
+
if (Array.isArray(testValue)) {
|
|
6125
|
+
if (operator === "isNot") {
|
|
6126
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
6127
|
+
property,
|
|
6128
|
+
operator,
|
|
6129
|
+
value: val
|
|
6130
|
+
}));
|
|
6131
|
+
}
|
|
6132
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
6133
|
+
property,
|
|
6134
|
+
operator,
|
|
6135
|
+
value: val
|
|
6136
|
+
}));
|
|
6137
|
+
}
|
|
6138
|
+
const value = userattr[property];
|
|
6139
|
+
if (Array.isArray(value)) {
|
|
6140
|
+
return value.includes(testValue);
|
|
6141
|
+
}
|
|
6142
|
+
switch (operator) {
|
|
6143
|
+
case "is":
|
|
6144
|
+
return value === testValue;
|
|
6145
|
+
case "isNot":
|
|
6146
|
+
return value !== testValue;
|
|
6147
|
+
case "contains":
|
|
6148
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
6149
|
+
case "startsWith":
|
|
6150
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
6151
|
+
case "endsWith":
|
|
6152
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
6153
|
+
case "greaterThan":
|
|
6154
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
6155
|
+
case "lessThan":
|
|
6156
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
6157
|
+
case "greaterThanOrEqualTo":
|
|
6158
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
6159
|
+
case "lessThanOrEqualTo":
|
|
6160
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
6161
|
+
default:
|
|
6162
|
+
return false;
|
|
6163
|
+
}
|
|
6164
|
+
})();
|
|
6165
|
+
return result;
|
|
6166
|
+
}
|
|
6167
|
+
const item = {
|
|
6168
|
+
query,
|
|
6169
|
+
startDate,
|
|
6170
|
+
endDate
|
|
6171
|
+
};
|
|
6172
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
6173
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
6174
|
+
return false;
|
|
6175
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
6176
|
+
return false;
|
|
6177
|
+
}
|
|
6178
|
+
if (!item.query || !item.query.length) {
|
|
6179
|
+
return true;
|
|
6180
|
+
}
|
|
6181
|
+
return item.query.every((filter) => {
|
|
6182
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
6183
|
+
});
|
|
6184
|
+
}
|
|
6185
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
6186
|
+
if (!navigator.cookieEnabled) {
|
|
6187
|
+
return;
|
|
6188
|
+
}
|
|
6189
|
+
function getCookie(name) {
|
|
6190
|
+
const nameEQ = name + '=';
|
|
6191
|
+
const ca = document.cookie.split(';');
|
|
6192
|
+
for (let i = 0; i < ca.length; i++) {
|
|
6193
|
+
let c = ca[i];
|
|
6194
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
6195
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
6196
|
+
}
|
|
6197
|
+
return null;
|
|
6198
|
+
}
|
|
6199
|
+
function removeVariants() {
|
|
6200
|
+
variants?.forEach(function (_, index) {
|
|
6201
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
6202
|
+
});
|
|
6203
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
6204
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
6205
|
+
}
|
|
6206
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
6207
|
+
if (locale) {
|
|
6208
|
+
attributes.locale = locale;
|
|
6209
|
+
}
|
|
6210
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
6211
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
6212
|
+
});
|
|
6213
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
6214
|
+
if (isDebug) {
|
|
6215
|
+
console.debug('PersonalizationContainer', {
|
|
6216
|
+
attributes,
|
|
6217
|
+
variants,
|
|
6218
|
+
winningVariantIndex
|
|
6219
|
+
});
|
|
6220
|
+
}
|
|
6221
|
+
if (winningVariantIndex !== -1) {
|
|
6222
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
6223
|
+
if (winningVariant) {
|
|
6224
|
+
const parentNode = winningVariant.parentNode;
|
|
6225
|
+
if (parentNode) {
|
|
6226
|
+
const newParent = parentNode.cloneNode(false);
|
|
6227
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
6228
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
6229
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
6230
|
+
}
|
|
6231
|
+
if (isDebug) {
|
|
6232
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
6233
|
+
}
|
|
6234
|
+
}
|
|
6235
|
+
} else if (variants && variants.length > 0) {
|
|
6236
|
+
removeVariants();
|
|
6237
|
+
}
|
|
6238
|
+
}`;
|
|
6239
|
+
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}";
|
|
6240
|
+
|
|
6241
|
+
// src/blocks/personalization-container/helpers.ts
|
|
6242
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
6243
|
+
const hasVariants = variants && variants.length > 0;
|
|
6244
|
+
if (TARGET === "reactNative")
|
|
6245
|
+
return false;
|
|
6246
|
+
if (!hasVariants)
|
|
6247
|
+
return false;
|
|
6248
|
+
if (!canTrack)
|
|
6249
|
+
return false;
|
|
6250
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
6251
|
+
return true;
|
|
6252
|
+
if (isBrowser())
|
|
6253
|
+
return false;
|
|
6254
|
+
return true;
|
|
6255
|
+
}
|
|
6256
|
+
function getBlocksToRender({
|
|
6257
|
+
variants,
|
|
6258
|
+
previewingIndex,
|
|
6259
|
+
isHydrated,
|
|
6260
|
+
filteredVariants,
|
|
6261
|
+
fallbackBlocks
|
|
6262
|
+
}) {
|
|
6263
|
+
const fallback = {
|
|
6264
|
+
blocks: fallbackBlocks ?? [],
|
|
6265
|
+
path: "this.children"
|
|
6266
|
+
};
|
|
6267
|
+
if (isHydrated && isEditing()) {
|
|
6268
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
6269
|
+
const variant = variants[previewingIndex];
|
|
6270
|
+
return {
|
|
6271
|
+
blocks: variant.blocks,
|
|
6272
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
6273
|
+
};
|
|
6274
|
+
}
|
|
6275
|
+
return fallback;
|
|
6276
|
+
}
|
|
6277
|
+
if (isBrowser()) {
|
|
6278
|
+
const winningVariant = filteredVariants?.[0];
|
|
6279
|
+
if (winningVariant) {
|
|
6280
|
+
return {
|
|
6281
|
+
blocks: winningVariant.blocks,
|
|
6282
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
6283
|
+
};
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
return fallback;
|
|
6287
|
+
}
|
|
6288
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
6289
|
+
return `
|
|
6290
|
+
(function() {
|
|
6291
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
6292
|
+
${PERSONALIZATION_SCRIPT}
|
|
6293
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
6294
|
+
})();
|
|
6295
|
+
`;
|
|
6296
|
+
};
|
|
6297
|
+
|
|
6298
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6299
|
+
function PersonalizationContainer(props) {
|
|
6300
|
+
const [userAttributes, setUserAttributes] = createSignal10(
|
|
6301
|
+
userAttributesService.getUserAttributes()
|
|
6302
|
+
);
|
|
6303
|
+
const [scriptStr, setScriptStr] = createSignal10(
|
|
6304
|
+
getPersonalizationScript(
|
|
6305
|
+
props.variants,
|
|
6306
|
+
props.builderBlock?.id || "none",
|
|
6307
|
+
props.builderContext?.rootState?.locale
|
|
6308
|
+
)
|
|
6309
|
+
);
|
|
6310
|
+
const [unsubscribers, setUnsubscribers] = createSignal10([]);
|
|
6311
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
|
|
6312
|
+
checkShouldRenderVariants(
|
|
6313
|
+
props.variants,
|
|
6314
|
+
getDefaultCanTrack(props.builderContext?.canTrack)
|
|
6315
|
+
)
|
|
6316
|
+
);
|
|
6317
|
+
const [isHydrated, setIsHydrated] = createSignal10(false);
|
|
6318
|
+
const filteredVariants = createMemo10(() => {
|
|
6319
|
+
return (props.variants || []).filter((variant) => {
|
|
6320
|
+
return filterWithCustomTargeting(
|
|
6321
|
+
{
|
|
6322
|
+
...props.builderContext?.rootState?.locale ? {
|
|
6323
|
+
locale: props.builderContext?.rootState?.locale
|
|
6324
|
+
} : {},
|
|
6325
|
+
...userAttributes()
|
|
6326
|
+
},
|
|
6327
|
+
variant.query,
|
|
6328
|
+
variant.startDate,
|
|
6329
|
+
variant.endDate
|
|
6330
|
+
);
|
|
6331
|
+
});
|
|
6332
|
+
});
|
|
6333
|
+
const blocksToRender = createMemo10(() => {
|
|
6334
|
+
return getBlocksToRender({
|
|
6335
|
+
variants: props.variants,
|
|
6336
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
6337
|
+
isHydrated: isHydrated(),
|
|
6338
|
+
filteredVariants: filteredVariants(),
|
|
6339
|
+
previewingIndex: props.previewingIndex
|
|
6340
|
+
});
|
|
6341
|
+
});
|
|
6342
|
+
const hideVariantsStyleString = createMemo10(() => {
|
|
6343
|
+
return (props.variants || []).map(
|
|
6344
|
+
(_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
|
|
6345
|
+
).join("");
|
|
6346
|
+
});
|
|
6347
|
+
let rootRef;
|
|
6348
|
+
onMount4(() => {
|
|
6349
|
+
setIsHydrated(true);
|
|
6350
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
6351
|
+
(attrs) => {
|
|
6352
|
+
setUserAttributes(attrs);
|
|
6353
|
+
}
|
|
6354
|
+
);
|
|
6355
|
+
if (!(isEditing() || isPreviewing())) {
|
|
6356
|
+
const variant = filteredVariants()[0];
|
|
6357
|
+
if (rootRef) {
|
|
6358
|
+
rootRef.dispatchEvent(
|
|
6359
|
+
new CustomEvent("builder.variantLoaded", {
|
|
6360
|
+
detail: {
|
|
6361
|
+
variant: variant || "default",
|
|
6362
|
+
content: props.builderContext?.content
|
|
6363
|
+
},
|
|
6364
|
+
bubbles: true
|
|
6365
|
+
})
|
|
6366
|
+
);
|
|
6367
|
+
const observer = new IntersectionObserver((entries) => {
|
|
6368
|
+
entries.forEach((entry) => {
|
|
6369
|
+
if (entry.isIntersecting && rootRef) {
|
|
6370
|
+
rootRef.dispatchEvent(
|
|
6371
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
6372
|
+
detail: {
|
|
6373
|
+
variant: variant || "default",
|
|
6374
|
+
content: props.builderContext?.content
|
|
6375
|
+
},
|
|
6376
|
+
bubbles: true
|
|
6377
|
+
})
|
|
6378
|
+
);
|
|
6379
|
+
}
|
|
6380
|
+
});
|
|
6381
|
+
});
|
|
6382
|
+
observer.observe(rootRef);
|
|
6383
|
+
}
|
|
6384
|
+
}
|
|
6385
|
+
unsubscribers().push(unsub);
|
|
6386
|
+
});
|
|
6387
|
+
return <><div
|
|
6388
|
+
class={`builder-personalization-container ${props.attributes?.className || ""}`}
|
|
6389
|
+
ref={rootRef}
|
|
6390
|
+
{...props.attributes}
|
|
6391
|
+
>
|
|
6392
|
+
<Show10 when={shouldRenderVariants()}>
|
|
6393
|
+
<For6 each={props.variants}>{(variant, _index) => {
|
|
6394
|
+
const index = _index();
|
|
6395
|
+
return <template
|
|
6396
|
+
key={index}
|
|
6397
|
+
data-variant-id={`${props.builderBlock?.id}-${index}`}
|
|
6398
|
+
><Blocks_default
|
|
6399
|
+
blocks={variant.blocks}
|
|
6400
|
+
parent={props.builderBlock?.id}
|
|
6401
|
+
path={`component.options.variants.${index}.blocks`}
|
|
6402
|
+
/></template>;
|
|
6403
|
+
}}</For6>
|
|
6404
|
+
<Inlined_styles_default
|
|
6405
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6406
|
+
styles={hideVariantsStyleString()}
|
|
6407
|
+
id={`variants-styles-${props.builderBlock?.id}`}
|
|
6408
|
+
/>
|
|
6409
|
+
<Inlined_script_default
|
|
6410
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6411
|
+
scriptStr={scriptStr()}
|
|
6412
|
+
id={`variants-script-${props.builderBlock?.id}`}
|
|
6413
|
+
/>
|
|
6414
|
+
</Show10>
|
|
6415
|
+
<Blocks_default
|
|
6416
|
+
blocks={blocksToRender().blocks}
|
|
6417
|
+
parent={props.builderBlock?.id}
|
|
6418
|
+
path={blocksToRender().path}
|
|
6419
|
+
/>
|
|
6420
|
+
</div></>;
|
|
6421
|
+
}
|
|
6422
|
+
var personalization_container_default = PersonalizationContainer;
|
|
6423
|
+
|
|
6424
|
+
// src/blocks/section/component-info.ts
|
|
6425
|
+
var componentInfo7 = {
|
|
5964
6426
|
name: "Core:Section",
|
|
5965
6427
|
static: true,
|
|
5966
6428
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -6002,7 +6464,7 @@ var componentInfo6 = {
|
|
|
6002
6464
|
};
|
|
6003
6465
|
|
|
6004
6466
|
// src/blocks/slot/component-info.ts
|
|
6005
|
-
var
|
|
6467
|
+
var componentInfo8 = {
|
|
6006
6468
|
name: "Slot",
|
|
6007
6469
|
isRSC: true,
|
|
6008
6470
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -6041,7 +6503,7 @@ function Slot(props) {
|
|
|
6041
6503
|
var slot_default = Slot;
|
|
6042
6504
|
|
|
6043
6505
|
// src/blocks/symbol/component-info.ts
|
|
6044
|
-
var
|
|
6506
|
+
var componentInfo9 = {
|
|
6045
6507
|
name: "Symbol",
|
|
6046
6508
|
noWrap: true,
|
|
6047
6509
|
static: true,
|
|
@@ -6123,7 +6585,7 @@ var defaultElement = {
|
|
|
6123
6585
|
}
|
|
6124
6586
|
}
|
|
6125
6587
|
};
|
|
6126
|
-
var
|
|
6588
|
+
var componentInfo10 = {
|
|
6127
6589
|
name: "Builder: Tabs",
|
|
6128
6590
|
inputs: [{
|
|
6129
6591
|
name: "tabs",
|
|
@@ -6229,9 +6691,9 @@ var componentInfo9 = {
|
|
|
6229
6691
|
};
|
|
6230
6692
|
|
|
6231
6693
|
// src/blocks/tabs/tabs.tsx
|
|
6232
|
-
import { Show as
|
|
6694
|
+
import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
|
|
6233
6695
|
function Tabs(props) {
|
|
6234
|
-
const [activeTab, setActiveTab] =
|
|
6696
|
+
const [activeTab, setActiveTab] = createSignal11(
|
|
6235
6697
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
6236
6698
|
);
|
|
6237
6699
|
function activeTabContent(active) {
|
|
@@ -6253,7 +6715,7 @@ function Tabs(props) {
|
|
|
6253
6715
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
6254
6716
|
overflow: "auto"
|
|
6255
6717
|
}}
|
|
6256
|
-
><
|
|
6718
|
+
><For7 each={props.tabs}>{(tab, _index) => {
|
|
6257
6719
|
const index = _index();
|
|
6258
6720
|
return <span
|
|
6259
6721
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
@@ -6270,21 +6732,21 @@ function Tabs(props) {
|
|
|
6270
6732
|
registeredComponents={props.builderComponents}
|
|
6271
6733
|
linkComponent={props.builderLinkComponent}
|
|
6272
6734
|
/></span>;
|
|
6273
|
-
}}</
|
|
6274
|
-
<
|
|
6735
|
+
}}</For7></div>
|
|
6736
|
+
<Show11 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
6275
6737
|
parent={props.builderBlock.id}
|
|
6276
6738
|
path={`tabs.${activeTab()}.content`}
|
|
6277
6739
|
blocks={activeTabContent(activeTab())}
|
|
6278
6740
|
context={props.builderContext}
|
|
6279
6741
|
registeredComponents={props.builderComponents}
|
|
6280
6742
|
linkComponent={props.builderLinkComponent}
|
|
6281
|
-
/></div></
|
|
6743
|
+
/></div></Show11>
|
|
6282
6744
|
</div></>;
|
|
6283
6745
|
}
|
|
6284
6746
|
var tabs_default = Tabs;
|
|
6285
6747
|
|
|
6286
6748
|
// src/blocks/text/component-info.ts
|
|
6287
|
-
var
|
|
6749
|
+
var componentInfo11 = {
|
|
6288
6750
|
shouldReceiveBuilderProps: {
|
|
6289
6751
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
6290
6752
|
builderContext: true
|
|
@@ -6321,7 +6783,7 @@ function Text(props) {
|
|
|
6321
6783
|
var text_default = Text;
|
|
6322
6784
|
|
|
6323
6785
|
// src/blocks/custom-code/component-info.ts
|
|
6324
|
-
var
|
|
6786
|
+
var componentInfo12 = {
|
|
6325
6787
|
name: "Custom Code",
|
|
6326
6788
|
static: true,
|
|
6327
6789
|
requiredPermissions: ["editCode"],
|
|
@@ -6346,12 +6808,12 @@ var componentInfo11 = {
|
|
|
6346
6808
|
};
|
|
6347
6809
|
|
|
6348
6810
|
// src/blocks/custom-code/custom-code.tsx
|
|
6349
|
-
import { onMount as
|
|
6811
|
+
import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
|
|
6350
6812
|
function CustomCode(props) {
|
|
6351
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6352
|
-
const [scriptsRun, setScriptsRun] =
|
|
6813
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6814
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6353
6815
|
let elementRef;
|
|
6354
|
-
|
|
6816
|
+
onMount5(() => {
|
|
6355
6817
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
6356
6818
|
return;
|
|
6357
6819
|
}
|
|
@@ -6393,7 +6855,7 @@ function CustomCode(props) {
|
|
|
6393
6855
|
var custom_code_default = CustomCode;
|
|
6394
6856
|
|
|
6395
6857
|
// src/blocks/embed/component-info.ts
|
|
6396
|
-
var
|
|
6858
|
+
var componentInfo13 = {
|
|
6397
6859
|
name: "Embed",
|
|
6398
6860
|
static: true,
|
|
6399
6861
|
inputs: [{
|
|
@@ -6411,7 +6873,7 @@ var componentInfo12 = {
|
|
|
6411
6873
|
};
|
|
6412
6874
|
|
|
6413
6875
|
// src/blocks/embed/embed.tsx
|
|
6414
|
-
import { on as on2, createEffect as createEffect2, createMemo as
|
|
6876
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6415
6877
|
|
|
6416
6878
|
// src/blocks/embed/helpers.ts
|
|
6417
6879
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -6419,9 +6881,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
6419
6881
|
|
|
6420
6882
|
// src/blocks/embed/embed.tsx
|
|
6421
6883
|
function Embed(props) {
|
|
6422
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6423
|
-
const [scriptsRun, setScriptsRun] =
|
|
6424
|
-
const [ranInitFn, setRanInitFn] =
|
|
6884
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
6885
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
6886
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
6425
6887
|
function findAndRunScripts() {
|
|
6426
6888
|
if (!elem || !elem.getElementsByTagName)
|
|
6427
6889
|
return;
|
|
@@ -6445,8 +6907,8 @@ function Embed(props) {
|
|
|
6445
6907
|
}
|
|
6446
6908
|
}
|
|
6447
6909
|
let elem;
|
|
6448
|
-
const onUpdateFn_0_elem =
|
|
6449
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
6910
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
6911
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
6450
6912
|
function onUpdateFn_0() {
|
|
6451
6913
|
if (elem && !ranInitFn()) {
|
|
6452
6914
|
setRanInitFn(true);
|
|
@@ -6461,7 +6923,7 @@ function Embed(props) {
|
|
|
6461
6923
|
var embed_default = Embed;
|
|
6462
6924
|
|
|
6463
6925
|
// src/blocks/form/form/component-info.ts
|
|
6464
|
-
var
|
|
6926
|
+
var componentInfo14 = {
|
|
6465
6927
|
name: "Form:Form",
|
|
6466
6928
|
// editableTags: ['builder-form-error']
|
|
6467
6929
|
defaults: {
|
|
@@ -6701,7 +7163,7 @@ var componentInfo13 = {
|
|
|
6701
7163
|
};
|
|
6702
7164
|
|
|
6703
7165
|
// src/blocks/form/form/form.tsx
|
|
6704
|
-
import { Show as
|
|
7166
|
+
import { Show as Show12, createSignal as createSignal14 } from "solid-js";
|
|
6705
7167
|
|
|
6706
7168
|
// src/functions/get-env.ts
|
|
6707
7169
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -6721,9 +7183,9 @@ function logFetch(url) {
|
|
|
6721
7183
|
|
|
6722
7184
|
// src/blocks/form/form/form.tsx
|
|
6723
7185
|
function FormComponent(props) {
|
|
6724
|
-
const [formState, setFormState] =
|
|
6725
|
-
const [responseData, setResponseData] =
|
|
6726
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
7186
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
7187
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
7188
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
6727
7189
|
function mergeNewRootState(newData) {
|
|
6728
7190
|
const combinedState = {
|
|
6729
7191
|
...props.builderContext.rootState,
|
|
@@ -6919,22 +7381,22 @@ function FormComponent(props) {
|
|
|
6919
7381
|
{...props.attributes}
|
|
6920
7382
|
>
|
|
6921
7383
|
{props.children}
|
|
6922
|
-
<
|
|
7384
|
+
<Show12 when={submissionState() === "error"}><Blocks_default
|
|
6923
7385
|
path="errorMessage"
|
|
6924
7386
|
blocks={props.errorMessage}
|
|
6925
7387
|
context={props.builderContext}
|
|
6926
|
-
/></
|
|
6927
|
-
<
|
|
7388
|
+
/></Show12>
|
|
7389
|
+
<Show12 when={submissionState() === "sending"}><Blocks_default
|
|
6928
7390
|
path="sendingMessage"
|
|
6929
7391
|
blocks={props.sendingMessage}
|
|
6930
7392
|
context={props.builderContext}
|
|
6931
|
-
/></
|
|
6932
|
-
<
|
|
6933
|
-
<
|
|
7393
|
+
/></Show12>
|
|
7394
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
7395
|
+
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
6934
7396
|
path="successMessage"
|
|
6935
7397
|
blocks={props.successMessage}
|
|
6936
7398
|
context={props.builderContext}
|
|
6937
|
-
/></
|
|
7399
|
+
/></Show12>
|
|
6938
7400
|
</form>
|
|
6939
7401
|
<style>{`.pre-04a43b72 {
|
|
6940
7402
|
padding: 10px;
|
|
@@ -6946,7 +7408,7 @@ function FormComponent(props) {
|
|
|
6946
7408
|
var form_default = FormComponent;
|
|
6947
7409
|
|
|
6948
7410
|
// src/blocks/form/input/component-info.ts
|
|
6949
|
-
var
|
|
7411
|
+
var componentInfo15 = {
|
|
6950
7412
|
name: "Form:Input",
|
|
6951
7413
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6952
7414
|
inputs: [
|
|
@@ -7016,7 +7478,7 @@ function FormInputComponent(props) {
|
|
|
7016
7478
|
var input_default = FormInputComponent;
|
|
7017
7479
|
|
|
7018
7480
|
// src/blocks/form/select/component-info.ts
|
|
7019
|
-
var
|
|
7481
|
+
var componentInfo16 = {
|
|
7020
7482
|
name: "Form:Select",
|
|
7021
7483
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
7022
7484
|
defaultStyles: {
|
|
@@ -7061,7 +7523,7 @@ var componentInfo15 = {
|
|
|
7061
7523
|
};
|
|
7062
7524
|
|
|
7063
7525
|
// src/blocks/form/select/select.tsx
|
|
7064
|
-
import { For as
|
|
7526
|
+
import { For as For8 } from "solid-js";
|
|
7065
7527
|
function SelectComponent(props) {
|
|
7066
7528
|
return <><select
|
|
7067
7529
|
{...{}}
|
|
@@ -7071,15 +7533,15 @@ function SelectComponent(props) {
|
|
|
7071
7533
|
defaultValue={props.defaultValue}
|
|
7072
7534
|
name={props.name}
|
|
7073
7535
|
required={props.required}
|
|
7074
|
-
><
|
|
7536
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
7075
7537
|
const index = _index();
|
|
7076
7538
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
7077
|
-
}}</
|
|
7539
|
+
}}</For8></select></>;
|
|
7078
7540
|
}
|
|
7079
7541
|
var select_default = SelectComponent;
|
|
7080
7542
|
|
|
7081
7543
|
// src/blocks/form/submit-button/component-info.ts
|
|
7082
|
-
var
|
|
7544
|
+
var componentInfo17 = {
|
|
7083
7545
|
name: "Form:SubmitButton",
|
|
7084
7546
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
7085
7547
|
defaultStyles: {
|
|
@@ -7113,7 +7575,7 @@ function SubmitButton(props) {
|
|
|
7113
7575
|
var submit_button_default = SubmitButton;
|
|
7114
7576
|
|
|
7115
7577
|
// src/blocks/form/textarea/component-info.ts
|
|
7116
|
-
var
|
|
7578
|
+
var componentInfo18 = {
|
|
7117
7579
|
name: "Form:TextArea",
|
|
7118
7580
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
7119
7581
|
inputs: [{
|
|
@@ -7166,7 +7628,7 @@ function Textarea(props) {
|
|
|
7166
7628
|
var textarea_default = Textarea;
|
|
7167
7629
|
|
|
7168
7630
|
// src/blocks/img/component-info.ts
|
|
7169
|
-
var
|
|
7631
|
+
var componentInfo19 = {
|
|
7170
7632
|
// friendlyName?
|
|
7171
7633
|
name: "Raw:Img",
|
|
7172
7634
|
hideFromInsertMenu: true,
|
|
@@ -7199,7 +7661,7 @@ function ImgComponent(props) {
|
|
|
7199
7661
|
var img_default = ImgComponent;
|
|
7200
7662
|
|
|
7201
7663
|
// src/blocks/video/component-info.ts
|
|
7202
|
-
var
|
|
7664
|
+
var componentInfo20 = {
|
|
7203
7665
|
name: "Video",
|
|
7204
7666
|
canHaveChildren: true,
|
|
7205
7667
|
defaultStyles: {
|
|
@@ -7286,9 +7748,9 @@ var componentInfo19 = {
|
|
|
7286
7748
|
};
|
|
7287
7749
|
|
|
7288
7750
|
// src/blocks/video/video.tsx
|
|
7289
|
-
import { Show as
|
|
7751
|
+
import { Show as Show13, createMemo as createMemo15 } from "solid-js";
|
|
7290
7752
|
function Video(props) {
|
|
7291
|
-
const videoProps =
|
|
7753
|
+
const videoProps = createMemo15(() => {
|
|
7292
7754
|
return {
|
|
7293
7755
|
...props.autoPlay === true ? {
|
|
7294
7756
|
autoPlay: true
|
|
@@ -7307,7 +7769,7 @@ function Video(props) {
|
|
|
7307
7769
|
} : {}
|
|
7308
7770
|
};
|
|
7309
7771
|
});
|
|
7310
|
-
const spreadProps =
|
|
7772
|
+
const spreadProps = createMemo15(() => {
|
|
7311
7773
|
return {
|
|
7312
7774
|
...videoProps()
|
|
7313
7775
|
};
|
|
@@ -7336,8 +7798,8 @@ function Video(props) {
|
|
|
7336
7798
|
}}
|
|
7337
7799
|
src={props.video || "no-src"}
|
|
7338
7800
|
poster={props.posterImage}
|
|
7339
|
-
><
|
|
7340
|
-
<
|
|
7801
|
+
><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
|
|
7802
|
+
<Show13
|
|
7341
7803
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
7342
7804
|
><div
|
|
7343
7805
|
style={{
|
|
@@ -7346,15 +7808,15 @@ function Video(props) {
|
|
|
7346
7808
|
"pointer-events": "none",
|
|
7347
7809
|
"font-size": "0px"
|
|
7348
7810
|
}}
|
|
7349
|
-
/></
|
|
7350
|
-
<
|
|
7811
|
+
/></Show13>
|
|
7812
|
+
<Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
7351
7813
|
style={{
|
|
7352
7814
|
display: "flex",
|
|
7353
7815
|
"flex-direction": "column",
|
|
7354
7816
|
"align-items": "stretch"
|
|
7355
7817
|
}}
|
|
7356
|
-
>{props.children}</div></
|
|
7357
|
-
<
|
|
7818
|
+
>{props.children}</div></Show13>
|
|
7819
|
+
<Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
7358
7820
|
style={{
|
|
7359
7821
|
"pointer-events": "none",
|
|
7360
7822
|
display: "flex",
|
|
@@ -7366,7 +7828,7 @@ function Video(props) {
|
|
|
7366
7828
|
width: "100%",
|
|
7367
7829
|
height: "100%"
|
|
7368
7830
|
}}
|
|
7369
|
-
>{props.children}</div></
|
|
7831
|
+
>{props.children}</div></Show13>
|
|
7370
7832
|
</div></>;
|
|
7371
7833
|
}
|
|
7372
7834
|
var video_default = Video;
|
|
@@ -7374,31 +7836,31 @@ var video_default = Video;
|
|
|
7374
7836
|
// src/constants/extra-components.ts
|
|
7375
7837
|
var getExtraComponents = () => [{
|
|
7376
7838
|
component: custom_code_default,
|
|
7377
|
-
...
|
|
7839
|
+
...componentInfo12
|
|
7378
7840
|
}, {
|
|
7379
7841
|
component: embed_default,
|
|
7380
|
-
...
|
|
7842
|
+
...componentInfo13
|
|
7381
7843
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7382
7844
|
component: form_default,
|
|
7383
|
-
...
|
|
7845
|
+
...componentInfo14
|
|
7384
7846
|
}, {
|
|
7385
7847
|
component: input_default,
|
|
7386
|
-
...
|
|
7848
|
+
...componentInfo15
|
|
7387
7849
|
}, {
|
|
7388
7850
|
component: submit_button_default,
|
|
7389
|
-
...
|
|
7851
|
+
...componentInfo17
|
|
7390
7852
|
}, {
|
|
7391
7853
|
component: select_default,
|
|
7392
|
-
...
|
|
7854
|
+
...componentInfo16
|
|
7393
7855
|
}, {
|
|
7394
7856
|
component: textarea_default,
|
|
7395
|
-
...
|
|
7857
|
+
...componentInfo18
|
|
7396
7858
|
}], {
|
|
7397
7859
|
component: img_default,
|
|
7398
|
-
...
|
|
7860
|
+
...componentInfo19
|
|
7399
7861
|
}, {
|
|
7400
7862
|
component: video_default,
|
|
7401
|
-
...
|
|
7863
|
+
...componentInfo20
|
|
7402
7864
|
}];
|
|
7403
7865
|
|
|
7404
7866
|
// src/constants/builder-registered-components.ts
|
|
@@ -7416,19 +7878,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7416
7878
|
...componentInfo5
|
|
7417
7879
|
}, {
|
|
7418
7880
|
component: section_default,
|
|
7419
|
-
...
|
|
7881
|
+
...componentInfo7
|
|
7420
7882
|
}, {
|
|
7421
7883
|
component: slot_default,
|
|
7422
|
-
...
|
|
7884
|
+
...componentInfo8
|
|
7423
7885
|
}, {
|
|
7424
7886
|
component: symbol_default,
|
|
7425
|
-
...
|
|
7887
|
+
...componentInfo9
|
|
7426
7888
|
}, {
|
|
7427
7889
|
component: text_default,
|
|
7428
|
-
...
|
|
7429
|
-
}, ...TARGET === "
|
|
7890
|
+
...componentInfo11
|
|
7891
|
+
}, ...TARGET === "react" ? [{
|
|
7892
|
+
component: personalization_container_default,
|
|
7893
|
+
...componentInfo6
|
|
7894
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
7430
7895
|
component: tabs_default,
|
|
7431
|
-
...
|
|
7896
|
+
...componentInfo10
|
|
7432
7897
|
}, {
|
|
7433
7898
|
component: accordion_default,
|
|
7434
7899
|
...componentInfo
|
|
@@ -7466,7 +7931,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
7466
7931
|
testVariationId: variant.id,
|
|
7467
7932
|
id: content?.id
|
|
7468
7933
|
}));
|
|
7469
|
-
var
|
|
7934
|
+
var checkShouldRenderVariants2 = ({
|
|
7470
7935
|
canTrack,
|
|
7471
7936
|
content
|
|
7472
7937
|
}) => {
|
|
@@ -7500,24 +7965,14 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7500
7965
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7501
7966
|
)`;
|
|
7502
7967
|
|
|
7503
|
-
// src/components/inlined-script.tsx
|
|
7504
|
-
function InlinedScript(props) {
|
|
7505
|
-
return <><script
|
|
7506
|
-
innerHTML={props.scriptStr}
|
|
7507
|
-
data-id={props.id}
|
|
7508
|
-
nonce={props.nonce || ""}
|
|
7509
|
-
/></>;
|
|
7510
|
-
}
|
|
7511
|
-
var Inlined_script_default = InlinedScript;
|
|
7512
|
-
|
|
7513
7968
|
// src/components/content/components/enable-editor.tsx
|
|
7514
7969
|
import {
|
|
7515
|
-
Show as
|
|
7516
|
-
onMount as
|
|
7970
|
+
Show as Show14,
|
|
7971
|
+
onMount as onMount6,
|
|
7517
7972
|
on as on3,
|
|
7518
7973
|
createEffect as createEffect3,
|
|
7519
|
-
createMemo as
|
|
7520
|
-
createSignal as
|
|
7974
|
+
createMemo as createMemo16,
|
|
7975
|
+
createSignal as createSignal16
|
|
7521
7976
|
} from "solid-js";
|
|
7522
7977
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
7523
7978
|
|
|
@@ -7527,7 +7982,7 @@ function getPreviewContent(_searchParams) {
|
|
|
7527
7982
|
}
|
|
7528
7983
|
|
|
7529
7984
|
// src/constants/sdk-version.ts
|
|
7530
|
-
var SDK_VERSION = "3.0.
|
|
7985
|
+
var SDK_VERSION = "3.0.7";
|
|
7531
7986
|
|
|
7532
7987
|
// src/helpers/sdk-headers.ts
|
|
7533
7988
|
var getSdkHeaders = () => ({
|
|
@@ -7824,16 +8279,6 @@ async function fetchEntries(options) {
|
|
|
7824
8279
|
return _processContentResult(options, content);
|
|
7825
8280
|
}
|
|
7826
8281
|
|
|
7827
|
-
// src/functions/is-previewing.ts
|
|
7828
|
-
function isPreviewing(_search) {
|
|
7829
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
7830
|
-
if (!search) {
|
|
7831
|
-
return false;
|
|
7832
|
-
}
|
|
7833
|
-
const normalizedSearch = getSearchString(search);
|
|
7834
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
7835
|
-
}
|
|
7836
|
-
|
|
7837
8282
|
// src/helpers/uuid.ts
|
|
7838
8283
|
function uuidv4() {
|
|
7839
8284
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -8160,7 +8605,9 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
8160
8605
|
// Supports builder-model="..." attribute which is needed to
|
|
8161
8606
|
// scope our '+ add block' button styling
|
|
8162
8607
|
supportsAddBlockScoping: true,
|
|
8163
|
-
supportsCustomBreakpoints: true
|
|
8608
|
+
supportsCustomBreakpoints: true,
|
|
8609
|
+
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
8610
|
+
blockLevelPersonalization: true
|
|
8164
8611
|
}
|
|
8165
8612
|
}, "*");
|
|
8166
8613
|
window.parent?.postMessage({
|
|
@@ -8375,12 +8822,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
8375
8822
|
|
|
8376
8823
|
// src/components/content/components/enable-editor.tsx
|
|
8377
8824
|
function EnableEditor(props) {
|
|
8378
|
-
const [ContentWrapper, setContentWrapper] =
|
|
8825
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
8379
8826
|
props.contentWrapper || "div"
|
|
8380
8827
|
);
|
|
8381
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8382
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8383
|
-
const [clicked, setClicked] =
|
|
8828
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
8829
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
8830
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
8384
8831
|
function mergeNewRootState(newData) {
|
|
8385
8832
|
const combinedState = {
|
|
8386
8833
|
...props.builderContextSignal.rootState,
|
|
@@ -8414,7 +8861,7 @@ function EnableEditor(props) {
|
|
|
8414
8861
|
content: newContentValue
|
|
8415
8862
|
}));
|
|
8416
8863
|
}
|
|
8417
|
-
const showContentProps =
|
|
8864
|
+
const showContentProps = createMemo16(() => {
|
|
8418
8865
|
return props.showContent ? {} : {
|
|
8419
8866
|
hidden: true,
|
|
8420
8867
|
"aria-hidden": true
|
|
@@ -8521,7 +8968,7 @@ function EnableEditor(props) {
|
|
|
8521
8968
|
let elementRef;
|
|
8522
8969
|
runHttpRequests();
|
|
8523
8970
|
emitStateUpdate();
|
|
8524
|
-
|
|
8971
|
+
onMount6(() => {
|
|
8525
8972
|
if (isBrowser()) {
|
|
8526
8973
|
if (isEditing() && !props.isNestedRender) {
|
|
8527
8974
|
window.addEventListener("message", processMessage);
|
|
@@ -8590,14 +9037,14 @@ function EnableEditor(props) {
|
|
|
8590
9037
|
}
|
|
8591
9038
|
}
|
|
8592
9039
|
});
|
|
8593
|
-
const onUpdateFn_0_props_content =
|
|
9040
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
8594
9041
|
function onUpdateFn_0() {
|
|
8595
9042
|
if (props.content) {
|
|
8596
9043
|
mergeNewContent(props.content);
|
|
8597
9044
|
}
|
|
8598
9045
|
}
|
|
8599
9046
|
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8600
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9047
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
|
|
8601
9048
|
() => props.builderContextSignal.rootState
|
|
8602
9049
|
);
|
|
8603
9050
|
function onUpdateFn_1() {
|
|
@@ -8609,14 +9056,14 @@ function EnableEditor(props) {
|
|
|
8609
9056
|
onUpdateFn_1
|
|
8610
9057
|
)
|
|
8611
9058
|
);
|
|
8612
|
-
const onUpdateFn_2_props_data =
|
|
9059
|
+
const onUpdateFn_2_props_data = createMemo16(() => props.data);
|
|
8613
9060
|
function onUpdateFn_2() {
|
|
8614
9061
|
if (props.data) {
|
|
8615
9062
|
mergeNewRootState(props.data);
|
|
8616
9063
|
}
|
|
8617
9064
|
}
|
|
8618
9065
|
createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
8619
|
-
const onUpdateFn_3_props_locale =
|
|
9066
|
+
const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
|
|
8620
9067
|
function onUpdateFn_3() {
|
|
8621
9068
|
if (props.locale) {
|
|
8622
9069
|
mergeNewRootState({
|
|
@@ -8625,7 +9072,7 @@ function EnableEditor(props) {
|
|
|
8625
9072
|
}
|
|
8626
9073
|
}
|
|
8627
9074
|
createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
8628
|
-
return <><builder_context_default.Provider value={props.builderContextSignal}><
|
|
9075
|
+
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
8629
9076
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
8630
9077
|
><Dynamic5
|
|
8631
9078
|
class={getWrapperClassName(
|
|
@@ -8643,14 +9090,14 @@ function EnableEditor(props) {
|
|
|
8643
9090
|
{...showContentProps()}
|
|
8644
9091
|
{...props.contentWrapperProps}
|
|
8645
9092
|
component={ContentWrapper()}
|
|
8646
|
-
>{props.children}</Dynamic5></
|
|
9093
|
+
>{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
|
|
8647
9094
|
}
|
|
8648
9095
|
var Enable_editor_default = EnableEditor;
|
|
8649
9096
|
|
|
8650
9097
|
// src/components/content/components/styles.tsx
|
|
8651
|
-
import { createSignal as
|
|
9098
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
8652
9099
|
function ContentStyles(props) {
|
|
8653
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9100
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
8654
9101
|
`
|
|
8655
9102
|
${getCss({
|
|
8656
9103
|
cssCode: props.cssCode,
|
|
@@ -8708,7 +9155,7 @@ var getContentInitialValue = ({
|
|
|
8708
9155
|
|
|
8709
9156
|
// src/components/content/content.tsx
|
|
8710
9157
|
function ContentComponent(props) {
|
|
8711
|
-
const [scriptStr, setScriptStr] =
|
|
9158
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
8712
9159
|
getUpdateVariantVisibilityScript({
|
|
8713
9160
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8714
9161
|
variationId: props.content?.testVariationId,
|
|
@@ -8716,7 +9163,7 @@ function ContentComponent(props) {
|
|
|
8716
9163
|
contentId: props.content?.id
|
|
8717
9164
|
})
|
|
8718
9165
|
);
|
|
8719
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9166
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
8720
9167
|
[
|
|
8721
9168
|
...getDefaultRegisteredComponents(),
|
|
8722
9169
|
...props.customComponents || []
|
|
@@ -8731,7 +9178,7 @@ function ContentComponent(props) {
|
|
|
8731
9178
|
{}
|
|
8732
9179
|
)
|
|
8733
9180
|
);
|
|
8734
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9181
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
8735
9182
|
content: getContentInitialValue({
|
|
8736
9183
|
content: props.content,
|
|
8737
9184
|
data: props.data
|
|
@@ -8815,18 +9262,18 @@ function ContentComponent(props) {
|
|
|
8815
9262
|
setBuilderContextSignal
|
|
8816
9263
|
}}
|
|
8817
9264
|
>
|
|
8818
|
-
<
|
|
9265
|
+
<Show15 when={props.isSsrAbTest}><Inlined_script_default
|
|
8819
9266
|
id="builderio-variant-visibility"
|
|
8820
9267
|
scriptStr={scriptStr()}
|
|
8821
9268
|
nonce={props.nonce || ""}
|
|
8822
|
-
/></
|
|
8823
|
-
<
|
|
9269
|
+
/></Show15>
|
|
9270
|
+
<Show15 when={TARGET !== "reactNative"}><Styles_default
|
|
8824
9271
|
nonce={props.nonce || ""}
|
|
8825
9272
|
isNestedRender={props.isNestedRender}
|
|
8826
9273
|
contentId={builderContextSignal().content?.id}
|
|
8827
9274
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
8828
9275
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
8829
|
-
/></
|
|
9276
|
+
/></Show15>
|
|
8830
9277
|
<Blocks_default
|
|
8831
9278
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
8832
9279
|
context={builderContextSignal()}
|
|
@@ -8839,13 +9286,13 @@ var Content_default = ContentComponent;
|
|
|
8839
9286
|
|
|
8840
9287
|
// src/components/content-variants/content-variants.tsx
|
|
8841
9288
|
function ContentVariants(props) {
|
|
8842
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
8843
|
-
|
|
9289
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
9290
|
+
checkShouldRenderVariants2({
|
|
8844
9291
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
8845
9292
|
content: props.content
|
|
8846
9293
|
})
|
|
8847
9294
|
);
|
|
8848
|
-
const updateCookieAndStylesScriptStr =
|
|
9295
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
8849
9296
|
return getUpdateCookieAndStylesScript(
|
|
8850
9297
|
getVariants(props.content).map((value) => ({
|
|
8851
9298
|
id: value.testVariationId,
|
|
@@ -8854,10 +9301,10 @@ function ContentVariants(props) {
|
|
|
8854
9301
|
props.content?.id || ""
|
|
8855
9302
|
);
|
|
8856
9303
|
});
|
|
8857
|
-
const hideVariantsStyleString =
|
|
9304
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
8858
9305
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
8859
9306
|
});
|
|
8860
|
-
const defaultContent =
|
|
9307
|
+
const defaultContent = createMemo19(() => {
|
|
8861
9308
|
return shouldRenderVariants() ? {
|
|
8862
9309
|
...props.content,
|
|
8863
9310
|
testVariationId: props.content?.id
|
|
@@ -8866,16 +9313,16 @@ function ContentVariants(props) {
|
|
|
8866
9313
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
8867
9314
|
});
|
|
8868
9315
|
});
|
|
8869
|
-
|
|
9316
|
+
onMount7(() => {
|
|
8870
9317
|
setShouldRenderVariants(false);
|
|
8871
9318
|
});
|
|
8872
9319
|
return <><>
|
|
8873
|
-
<
|
|
9320
|
+
<Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8874
9321
|
id="builderio-init-variants-fns"
|
|
8875
9322
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8876
9323
|
nonce={props.nonce || ""}
|
|
8877
|
-
/></
|
|
8878
|
-
<
|
|
9324
|
+
/></Show16>
|
|
9325
|
+
<Show16 when={shouldRenderVariants()}>
|
|
8879
9326
|
<Inlined_styles_default
|
|
8880
9327
|
id="builderio-variants"
|
|
8881
9328
|
styles={hideVariantsStyleString()}
|
|
@@ -8886,7 +9333,7 @@ function ContentVariants(props) {
|
|
|
8886
9333
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8887
9334
|
nonce={props.nonce || ""}
|
|
8888
9335
|
/>
|
|
8889
|
-
<
|
|
9336
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8890
9337
|
const index = _index();
|
|
8891
9338
|
return <Content_default
|
|
8892
9339
|
apiHost={props.apiHost}
|
|
@@ -8913,8 +9360,8 @@ function ContentVariants(props) {
|
|
|
8913
9360
|
trustedHosts={props.trustedHosts}
|
|
8914
9361
|
{...{}}
|
|
8915
9362
|
/>;
|
|
8916
|
-
}}</
|
|
8917
|
-
</
|
|
9363
|
+
}}</For9>
|
|
9364
|
+
</Show16>
|
|
8918
9365
|
<Content_default
|
|
8919
9366
|
apiHost={props.apiHost}
|
|
8920
9367
|
nonce={props.nonce}
|
|
@@ -8969,14 +9416,14 @@ var fetchSymbolContent = async ({
|
|
|
8969
9416
|
|
|
8970
9417
|
// src/blocks/symbol/symbol.tsx
|
|
8971
9418
|
function Symbol2(props) {
|
|
8972
|
-
const [contentToUse, setContentToUse] =
|
|
8973
|
-
const blocksWrapper =
|
|
9419
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
9420
|
+
const blocksWrapper = createMemo20(() => {
|
|
8974
9421
|
return "div";
|
|
8975
9422
|
});
|
|
8976
|
-
const contentWrapper =
|
|
9423
|
+
const contentWrapper = createMemo20(() => {
|
|
8977
9424
|
return "div";
|
|
8978
9425
|
});
|
|
8979
|
-
const className =
|
|
9426
|
+
const className = createMemo20(() => {
|
|
8980
9427
|
return [
|
|
8981
9428
|
...[props.attributes[getClassPropName()]],
|
|
8982
9429
|
"builder-symbol",
|
|
@@ -8996,9 +9443,9 @@ function Symbol2(props) {
|
|
|
8996
9443
|
}
|
|
8997
9444
|
});
|
|
8998
9445
|
}
|
|
8999
|
-
|
|
9446
|
+
onMount8(() => {
|
|
9000
9447
|
});
|
|
9001
|
-
const onUpdateFn_0_props_symbol =
|
|
9448
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
9002
9449
|
function onUpdateFn_0() {
|
|
9003
9450
|
setContent();
|
|
9004
9451
|
}
|
|
@@ -9083,6 +9530,7 @@ export {
|
|
|
9083
9530
|
isEditing,
|
|
9084
9531
|
isPreviewing,
|
|
9085
9532
|
register,
|
|
9533
|
+
setClientUserAttributes,
|
|
9086
9534
|
setEditorSettings,
|
|
9087
9535
|
subscribeToEditor,
|
|
9088
9536
|
track
|