@builder.io/sdk-solid 3.0.5 → 3.0.6
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 +7 -1
- package/lib/browser/dev.js +529 -103
- package/lib/browser/dev.jsx +558 -142
- package/lib/browser/index.js +529 -103
- package/lib/browser/index.jsx +558 -142
- package/lib/edge/dev.js +529 -103
- package/lib/edge/dev.jsx +558 -142
- package/lib/edge/index.js +529 -103
- package/lib/edge/index.jsx +558 -142
- package/lib/node/dev.js +529 -103
- package/lib/node/dev.jsx +558 -142
- package/lib/node/index.js +529 -103
- package/lib/node/index.jsx +558 -142
- package/package.json +1 -1
package/lib/edge/index.jsx
CHANGED
|
@@ -4639,8 +4639,9 @@ function BlocksWrapper(props) {
|
|
|
4639
4639
|
if (!props.path) {
|
|
4640
4640
|
return void 0;
|
|
4641
4641
|
}
|
|
4642
|
+
const thisPrefix = "this.";
|
|
4642
4643
|
const pathPrefix = "component.options.";
|
|
4643
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4644
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4644
4645
|
});
|
|
4645
4646
|
function onClick() {
|
|
4646
4647
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -4675,7 +4676,7 @@ function BlocksWrapper(props) {
|
|
|
4675
4676
|
});
|
|
4676
4677
|
return <>
|
|
4677
4678
|
<Dynamic4
|
|
4678
|
-
class={className() + " dynamic-
|
|
4679
|
+
class={className() + " dynamic-3d7ff108"}
|
|
4679
4680
|
ref={blocksWrapperRef}
|
|
4680
4681
|
builder-path={dataPath()}
|
|
4681
4682
|
builder-parent-id={props.parent}
|
|
@@ -4687,7 +4688,7 @@ function BlocksWrapper(props) {
|
|
|
4687
4688
|
{...props.BlocksWrapperProps}
|
|
4688
4689
|
component={props.BlocksWrapper}
|
|
4689
4690
|
>{props.children}</Dynamic4>
|
|
4690
|
-
<style>{`.dynamic-
|
|
4691
|
+
<style>{`.dynamic-3d7ff108 {
|
|
4691
4692
|
display: flex;
|
|
4692
4693
|
flex-direction: column;
|
|
4693
4694
|
align-items: stretch;
|
|
@@ -5059,10 +5060,10 @@ function SectionComponent(props) {
|
|
|
5059
5060
|
var section_default = SectionComponent;
|
|
5060
5061
|
|
|
5061
5062
|
// src/blocks/symbol/symbol.tsx
|
|
5062
|
-
import { onMount as
|
|
5063
|
+
import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
5063
5064
|
|
|
5064
5065
|
// src/components/content-variants/content-variants.tsx
|
|
5065
|
-
import { Show as
|
|
5066
|
+
import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
5066
5067
|
|
|
5067
5068
|
// src/helpers/url.ts
|
|
5068
5069
|
var getTopLevelDomain = (host) => {
|
|
@@ -5252,11 +5253,61 @@ var handleABTesting = async ({
|
|
|
5252
5253
|
};
|
|
5253
5254
|
};
|
|
5254
5255
|
|
|
5256
|
+
// src/helpers/user-attributes.ts
|
|
5257
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5258
|
+
function createUserAttributesService() {
|
|
5259
|
+
let canTrack = true;
|
|
5260
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
5261
|
+
return {
|
|
5262
|
+
setUserAttributes(newAttrs) {
|
|
5263
|
+
if (!isBrowser()) {
|
|
5264
|
+
return;
|
|
5265
|
+
}
|
|
5266
|
+
const userAttributes = {
|
|
5267
|
+
...this.getUserAttributes(),
|
|
5268
|
+
...newAttrs
|
|
5269
|
+
};
|
|
5270
|
+
setCookie({
|
|
5271
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5272
|
+
value: JSON.stringify(userAttributes),
|
|
5273
|
+
canTrack
|
|
5274
|
+
});
|
|
5275
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
5276
|
+
},
|
|
5277
|
+
getUserAttributes() {
|
|
5278
|
+
if (!isBrowser()) {
|
|
5279
|
+
return {};
|
|
5280
|
+
}
|
|
5281
|
+
return JSON.parse(getCookieSync({
|
|
5282
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5283
|
+
canTrack
|
|
5284
|
+
}) || "{}");
|
|
5285
|
+
},
|
|
5286
|
+
subscribeOnUserAttributesChange(callback) {
|
|
5287
|
+
subscribers.add(callback);
|
|
5288
|
+
return () => {
|
|
5289
|
+
subscribers.delete(callback);
|
|
5290
|
+
};
|
|
5291
|
+
},
|
|
5292
|
+
setCanTrack(value) {
|
|
5293
|
+
canTrack = value;
|
|
5294
|
+
}
|
|
5295
|
+
};
|
|
5296
|
+
}
|
|
5297
|
+
var userAttributesService = createUserAttributesService();
|
|
5298
|
+
var setClientUserAttributes = (attributes) => {
|
|
5299
|
+
userAttributesService.setUserAttributes(attributes);
|
|
5300
|
+
};
|
|
5301
|
+
|
|
5255
5302
|
// src/helpers/canTrack.ts
|
|
5256
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
5303
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
5304
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
5305
|
+
userAttributesService.setCanTrack(result);
|
|
5306
|
+
return result;
|
|
5307
|
+
};
|
|
5257
5308
|
|
|
5258
5309
|
// src/components/content/content.tsx
|
|
5259
|
-
import { Show as
|
|
5310
|
+
import { Show as Show15, createSignal as createSignal18 } from "solid-js";
|
|
5260
5311
|
|
|
5261
5312
|
// src/blocks/accordion/component-info.ts
|
|
5262
5313
|
var defaultTitle = {
|
|
@@ -5950,8 +6001,388 @@ var componentInfo5 = {
|
|
|
5950
6001
|
}
|
|
5951
6002
|
};
|
|
5952
6003
|
|
|
5953
|
-
// src/blocks/
|
|
6004
|
+
// src/blocks/personalization-container/component-info.ts
|
|
5954
6005
|
var componentInfo6 = {
|
|
6006
|
+
name: "PersonalizationContainer",
|
|
6007
|
+
shouldReceiveBuilderProps: {
|
|
6008
|
+
builderBlock: true,
|
|
6009
|
+
builderContext: true
|
|
6010
|
+
},
|
|
6011
|
+
noWrap: true,
|
|
6012
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
6013
|
+
canHaveChildren: true,
|
|
6014
|
+
inputs: [{
|
|
6015
|
+
name: "variants",
|
|
6016
|
+
defaultValue: [],
|
|
6017
|
+
behavior: "personalizationVariantList",
|
|
6018
|
+
type: "list",
|
|
6019
|
+
subFields: [{
|
|
6020
|
+
name: "name",
|
|
6021
|
+
type: "text"
|
|
6022
|
+
}, {
|
|
6023
|
+
name: "query",
|
|
6024
|
+
friendlyName: "Targeting rules",
|
|
6025
|
+
type: "BuilderQuery",
|
|
6026
|
+
defaultValue: []
|
|
6027
|
+
}, {
|
|
6028
|
+
name: "startDate",
|
|
6029
|
+
type: "date"
|
|
6030
|
+
}, {
|
|
6031
|
+
name: "endDate",
|
|
6032
|
+
type: "date"
|
|
6033
|
+
}, {
|
|
6034
|
+
name: "blocks",
|
|
6035
|
+
type: "uiBlocks",
|
|
6036
|
+
hideFromUI: true,
|
|
6037
|
+
defaultValue: []
|
|
6038
|
+
}]
|
|
6039
|
+
}]
|
|
6040
|
+
};
|
|
6041
|
+
|
|
6042
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6043
|
+
import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
6044
|
+
|
|
6045
|
+
// src/components/inlined-script.tsx
|
|
6046
|
+
function InlinedScript(props) {
|
|
6047
|
+
return <><script
|
|
6048
|
+
innerHTML={props.scriptStr}
|
|
6049
|
+
data-id={props.id}
|
|
6050
|
+
nonce={props.nonce || ""}
|
|
6051
|
+
/></>;
|
|
6052
|
+
}
|
|
6053
|
+
var Inlined_script_default = InlinedScript;
|
|
6054
|
+
|
|
6055
|
+
// src/functions/is-previewing.ts
|
|
6056
|
+
function isPreviewing(_search) {
|
|
6057
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
6058
|
+
if (!search) {
|
|
6059
|
+
return false;
|
|
6060
|
+
}
|
|
6061
|
+
const normalizedSearch = getSearchString(search);
|
|
6062
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
6063
|
+
}
|
|
6064
|
+
|
|
6065
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
6066
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
6067
|
+
function isString(val) {
|
|
6068
|
+
return typeof val === "string";
|
|
6069
|
+
}
|
|
6070
|
+
function isNumber(val) {
|
|
6071
|
+
return typeof val === "number";
|
|
6072
|
+
}
|
|
6073
|
+
function objectMatchesQuery(userattr, query2) {
|
|
6074
|
+
const result = (() => {
|
|
6075
|
+
const property = query2.property;
|
|
6076
|
+
const operator = query2.operator;
|
|
6077
|
+
let testValue = query2.value;
|
|
6078
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
6079
|
+
testValue = query2.value.slice(0, -1);
|
|
6080
|
+
}
|
|
6081
|
+
if (!(property && operator)) {
|
|
6082
|
+
return true;
|
|
6083
|
+
}
|
|
6084
|
+
if (Array.isArray(testValue)) {
|
|
6085
|
+
if (operator === "isNot") {
|
|
6086
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
6087
|
+
property,
|
|
6088
|
+
operator,
|
|
6089
|
+
value: val
|
|
6090
|
+
}));
|
|
6091
|
+
}
|
|
6092
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
6093
|
+
property,
|
|
6094
|
+
operator,
|
|
6095
|
+
value: val
|
|
6096
|
+
}));
|
|
6097
|
+
}
|
|
6098
|
+
const value = userattr[property];
|
|
6099
|
+
if (Array.isArray(value)) {
|
|
6100
|
+
return value.includes(testValue);
|
|
6101
|
+
}
|
|
6102
|
+
switch (operator) {
|
|
6103
|
+
case "is":
|
|
6104
|
+
return value === testValue;
|
|
6105
|
+
case "isNot":
|
|
6106
|
+
return value !== testValue;
|
|
6107
|
+
case "contains":
|
|
6108
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
6109
|
+
case "startsWith":
|
|
6110
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
6111
|
+
case "endsWith":
|
|
6112
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
6113
|
+
case "greaterThan":
|
|
6114
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
6115
|
+
case "lessThan":
|
|
6116
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
6117
|
+
case "greaterThanOrEqualTo":
|
|
6118
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
6119
|
+
case "lessThanOrEqualTo":
|
|
6120
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
6121
|
+
default:
|
|
6122
|
+
return false;
|
|
6123
|
+
}
|
|
6124
|
+
})();
|
|
6125
|
+
return result;
|
|
6126
|
+
}
|
|
6127
|
+
const item = {
|
|
6128
|
+
query,
|
|
6129
|
+
startDate,
|
|
6130
|
+
endDate
|
|
6131
|
+
};
|
|
6132
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
6133
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
6134
|
+
return false;
|
|
6135
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
6136
|
+
return false;
|
|
6137
|
+
}
|
|
6138
|
+
if (!item.query || !item.query.length) {
|
|
6139
|
+
return true;
|
|
6140
|
+
}
|
|
6141
|
+
return item.query.every((filter) => {
|
|
6142
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
6143
|
+
});
|
|
6144
|
+
}
|
|
6145
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
6146
|
+
if (!navigator.cookieEnabled) {
|
|
6147
|
+
return;
|
|
6148
|
+
}
|
|
6149
|
+
function getCookie(name) {
|
|
6150
|
+
const nameEQ = name + '=';
|
|
6151
|
+
const ca = document.cookie.split(';');
|
|
6152
|
+
for (let i = 0; i < ca.length; i++) {
|
|
6153
|
+
let c = ca[i];
|
|
6154
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
6155
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
6156
|
+
}
|
|
6157
|
+
return null;
|
|
6158
|
+
}
|
|
6159
|
+
function removeVariants() {
|
|
6160
|
+
variants?.forEach(function (_, index) {
|
|
6161
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
6162
|
+
});
|
|
6163
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
6164
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
6165
|
+
}
|
|
6166
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
6167
|
+
if (locale) {
|
|
6168
|
+
attributes.locale = locale;
|
|
6169
|
+
}
|
|
6170
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
6171
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
6172
|
+
});
|
|
6173
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
6174
|
+
if (isDebug) {
|
|
6175
|
+
console.debug('PersonalizationContainer', {
|
|
6176
|
+
attributes,
|
|
6177
|
+
variants,
|
|
6178
|
+
winningVariantIndex
|
|
6179
|
+
});
|
|
6180
|
+
}
|
|
6181
|
+
if (winningVariantIndex !== -1) {
|
|
6182
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
6183
|
+
if (winningVariant) {
|
|
6184
|
+
const parentNode = winningVariant.parentNode;
|
|
6185
|
+
if (parentNode) {
|
|
6186
|
+
const newParent = parentNode.cloneNode(false);
|
|
6187
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
6188
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
6189
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
6190
|
+
}
|
|
6191
|
+
if (isDebug) {
|
|
6192
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
6193
|
+
}
|
|
6194
|
+
}
|
|
6195
|
+
} else if (variants && variants.length > 0) {
|
|
6196
|
+
removeVariants();
|
|
6197
|
+
}
|
|
6198
|
+
}`;
|
|
6199
|
+
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}";
|
|
6200
|
+
|
|
6201
|
+
// src/blocks/personalization-container/helpers.ts
|
|
6202
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
6203
|
+
const hasVariants = variants && variants.length > 0;
|
|
6204
|
+
if (TARGET === "reactNative")
|
|
6205
|
+
return false;
|
|
6206
|
+
if (!hasVariants)
|
|
6207
|
+
return false;
|
|
6208
|
+
if (!canTrack)
|
|
6209
|
+
return false;
|
|
6210
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
6211
|
+
return true;
|
|
6212
|
+
if (isBrowser())
|
|
6213
|
+
return false;
|
|
6214
|
+
return true;
|
|
6215
|
+
}
|
|
6216
|
+
function getBlocksToRender({
|
|
6217
|
+
variants,
|
|
6218
|
+
previewingIndex,
|
|
6219
|
+
isHydrated,
|
|
6220
|
+
filteredVariants,
|
|
6221
|
+
fallbackBlocks
|
|
6222
|
+
}) {
|
|
6223
|
+
const fallback = {
|
|
6224
|
+
blocks: fallbackBlocks ?? [],
|
|
6225
|
+
path: "this.children"
|
|
6226
|
+
};
|
|
6227
|
+
if (isHydrated && isEditing()) {
|
|
6228
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
6229
|
+
const variant = variants[previewingIndex];
|
|
6230
|
+
return {
|
|
6231
|
+
blocks: variant.blocks,
|
|
6232
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
6233
|
+
};
|
|
6234
|
+
}
|
|
6235
|
+
return fallback;
|
|
6236
|
+
}
|
|
6237
|
+
if (isBrowser()) {
|
|
6238
|
+
const winningVariant = filteredVariants?.[0];
|
|
6239
|
+
if (winningVariant) {
|
|
6240
|
+
return {
|
|
6241
|
+
blocks: winningVariant.blocks,
|
|
6242
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
6243
|
+
};
|
|
6244
|
+
}
|
|
6245
|
+
}
|
|
6246
|
+
return fallback;
|
|
6247
|
+
}
|
|
6248
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
6249
|
+
return `
|
|
6250
|
+
(function() {
|
|
6251
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
6252
|
+
${PERSONALIZATION_SCRIPT}
|
|
6253
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
6254
|
+
})();
|
|
6255
|
+
`;
|
|
6256
|
+
};
|
|
6257
|
+
|
|
6258
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6259
|
+
function PersonalizationContainer(props) {
|
|
6260
|
+
const [userAttributes, setUserAttributes] = createSignal10(
|
|
6261
|
+
userAttributesService.getUserAttributes()
|
|
6262
|
+
);
|
|
6263
|
+
const [scriptStr, setScriptStr] = createSignal10(
|
|
6264
|
+
getPersonalizationScript(
|
|
6265
|
+
props.variants,
|
|
6266
|
+
props.builderBlock?.id || "none",
|
|
6267
|
+
props.builderContext?.rootState?.locale
|
|
6268
|
+
)
|
|
6269
|
+
);
|
|
6270
|
+
const [unsubscribers, setUnsubscribers] = createSignal10([]);
|
|
6271
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
|
|
6272
|
+
checkShouldRenderVariants(
|
|
6273
|
+
props.variants,
|
|
6274
|
+
getDefaultCanTrack(props.builderContext?.canTrack)
|
|
6275
|
+
)
|
|
6276
|
+
);
|
|
6277
|
+
const [isHydrated, setIsHydrated] = createSignal10(false);
|
|
6278
|
+
const filteredVariants = createMemo10(() => {
|
|
6279
|
+
return (props.variants || []).filter((variant) => {
|
|
6280
|
+
return filterWithCustomTargeting(
|
|
6281
|
+
{
|
|
6282
|
+
...props.builderContext?.rootState?.locale ? {
|
|
6283
|
+
locale: props.builderContext?.rootState?.locale
|
|
6284
|
+
} : {},
|
|
6285
|
+
...userAttributes()
|
|
6286
|
+
},
|
|
6287
|
+
variant.query,
|
|
6288
|
+
variant.startDate,
|
|
6289
|
+
variant.endDate
|
|
6290
|
+
);
|
|
6291
|
+
});
|
|
6292
|
+
});
|
|
6293
|
+
const blocksToRender = createMemo10(() => {
|
|
6294
|
+
return getBlocksToRender({
|
|
6295
|
+
variants: props.variants,
|
|
6296
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
6297
|
+
isHydrated: isHydrated(),
|
|
6298
|
+
filteredVariants: filteredVariants(),
|
|
6299
|
+
previewingIndex: props.previewingIndex
|
|
6300
|
+
});
|
|
6301
|
+
});
|
|
6302
|
+
const hideVariantsStyleString = createMemo10(() => {
|
|
6303
|
+
return (props.variants || []).map(
|
|
6304
|
+
(_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
|
|
6305
|
+
).join("");
|
|
6306
|
+
});
|
|
6307
|
+
let rootRef;
|
|
6308
|
+
onMount4(() => {
|
|
6309
|
+
setIsHydrated(true);
|
|
6310
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
6311
|
+
(attrs) => {
|
|
6312
|
+
setUserAttributes(attrs);
|
|
6313
|
+
}
|
|
6314
|
+
);
|
|
6315
|
+
if (!(isEditing() || isPreviewing())) {
|
|
6316
|
+
const variant = filteredVariants()[0];
|
|
6317
|
+
if (rootRef) {
|
|
6318
|
+
rootRef.dispatchEvent(
|
|
6319
|
+
new CustomEvent("builder.variantLoaded", {
|
|
6320
|
+
detail: {
|
|
6321
|
+
variant: variant || "default",
|
|
6322
|
+
content: props.builderContext?.content
|
|
6323
|
+
},
|
|
6324
|
+
bubbles: true
|
|
6325
|
+
})
|
|
6326
|
+
);
|
|
6327
|
+
const observer = new IntersectionObserver((entries) => {
|
|
6328
|
+
entries.forEach((entry) => {
|
|
6329
|
+
if (entry.isIntersecting && rootRef) {
|
|
6330
|
+
rootRef.dispatchEvent(
|
|
6331
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
6332
|
+
detail: {
|
|
6333
|
+
variant: variant || "default",
|
|
6334
|
+
content: props.builderContext?.content
|
|
6335
|
+
},
|
|
6336
|
+
bubbles: true
|
|
6337
|
+
})
|
|
6338
|
+
);
|
|
6339
|
+
}
|
|
6340
|
+
});
|
|
6341
|
+
});
|
|
6342
|
+
observer.observe(rootRef);
|
|
6343
|
+
}
|
|
6344
|
+
}
|
|
6345
|
+
unsubscribers().push(unsub);
|
|
6346
|
+
});
|
|
6347
|
+
return <><div
|
|
6348
|
+
class={`builder-personalization-container ${props.attributes?.className || ""}`}
|
|
6349
|
+
ref={rootRef}
|
|
6350
|
+
{...props.attributes}
|
|
6351
|
+
>
|
|
6352
|
+
<Show10 when={shouldRenderVariants()}>
|
|
6353
|
+
<For6 each={props.variants}>{(variant, _index) => {
|
|
6354
|
+
const index = _index();
|
|
6355
|
+
return <template
|
|
6356
|
+
key={index}
|
|
6357
|
+
data-variant-id={`${props.builderBlock?.id}-${index}`}
|
|
6358
|
+
><Blocks_default
|
|
6359
|
+
blocks={variant.blocks}
|
|
6360
|
+
parent={props.builderBlock?.id}
|
|
6361
|
+
path={`component.options.variants.${index}.blocks`}
|
|
6362
|
+
/></template>;
|
|
6363
|
+
}}</For6>
|
|
6364
|
+
<Inlined_styles_default
|
|
6365
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6366
|
+
styles={hideVariantsStyleString()}
|
|
6367
|
+
id={`variants-styles-${props.builderBlock?.id}`}
|
|
6368
|
+
/>
|
|
6369
|
+
<Inlined_script_default
|
|
6370
|
+
nonce={props.builderContext?.nonce || ""}
|
|
6371
|
+
scriptStr={scriptStr()}
|
|
6372
|
+
id={`variants-script-${props.builderBlock?.id}`}
|
|
6373
|
+
/>
|
|
6374
|
+
</Show10>
|
|
6375
|
+
<Blocks_default
|
|
6376
|
+
blocks={blocksToRender().blocks}
|
|
6377
|
+
parent={props.builderBlock?.id}
|
|
6378
|
+
path={blocksToRender().path}
|
|
6379
|
+
/>
|
|
6380
|
+
</div></>;
|
|
6381
|
+
}
|
|
6382
|
+
var personalization_container_default = PersonalizationContainer;
|
|
6383
|
+
|
|
6384
|
+
// src/blocks/section/component-info.ts
|
|
6385
|
+
var componentInfo7 = {
|
|
5955
6386
|
name: "Core:Section",
|
|
5956
6387
|
static: true,
|
|
5957
6388
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -5993,7 +6424,7 @@ var componentInfo6 = {
|
|
|
5993
6424
|
};
|
|
5994
6425
|
|
|
5995
6426
|
// src/blocks/slot/component-info.ts
|
|
5996
|
-
var
|
|
6427
|
+
var componentInfo8 = {
|
|
5997
6428
|
name: "Slot",
|
|
5998
6429
|
isRSC: true,
|
|
5999
6430
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -6032,7 +6463,7 @@ function Slot(props) {
|
|
|
6032
6463
|
var slot_default = Slot;
|
|
6033
6464
|
|
|
6034
6465
|
// src/blocks/symbol/component-info.ts
|
|
6035
|
-
var
|
|
6466
|
+
var componentInfo9 = {
|
|
6036
6467
|
name: "Symbol",
|
|
6037
6468
|
noWrap: true,
|
|
6038
6469
|
static: true,
|
|
@@ -6114,7 +6545,7 @@ var defaultElement = {
|
|
|
6114
6545
|
}
|
|
6115
6546
|
}
|
|
6116
6547
|
};
|
|
6117
|
-
var
|
|
6548
|
+
var componentInfo10 = {
|
|
6118
6549
|
name: "Builder: Tabs",
|
|
6119
6550
|
inputs: [{
|
|
6120
6551
|
name: "tabs",
|
|
@@ -6220,9 +6651,9 @@ var componentInfo9 = {
|
|
|
6220
6651
|
};
|
|
6221
6652
|
|
|
6222
6653
|
// src/blocks/tabs/tabs.tsx
|
|
6223
|
-
import { Show as
|
|
6654
|
+
import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
|
|
6224
6655
|
function Tabs(props) {
|
|
6225
|
-
const [activeTab, setActiveTab] =
|
|
6656
|
+
const [activeTab, setActiveTab] = createSignal11(
|
|
6226
6657
|
props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
6227
6658
|
);
|
|
6228
6659
|
function activeTabContent(active) {
|
|
@@ -6244,7 +6675,7 @@ function Tabs(props) {
|
|
|
6244
6675
|
"justify-content": props.tabHeaderLayout || "flex-start",
|
|
6245
6676
|
overflow: "auto"
|
|
6246
6677
|
}}
|
|
6247
|
-
><
|
|
6678
|
+
><For7 each={props.tabs}>{(tab, _index) => {
|
|
6248
6679
|
const index = _index();
|
|
6249
6680
|
return <span
|
|
6250
6681
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
@@ -6261,21 +6692,21 @@ function Tabs(props) {
|
|
|
6261
6692
|
registeredComponents={props.builderComponents}
|
|
6262
6693
|
linkComponent={props.builderLinkComponent}
|
|
6263
6694
|
/></span>;
|
|
6264
|
-
}}</
|
|
6265
|
-
<
|
|
6695
|
+
}}</For7></div>
|
|
6696
|
+
<Show11 when={activeTabContent(activeTab())}><div><Blocks_default
|
|
6266
6697
|
parent={props.builderBlock.id}
|
|
6267
6698
|
path={`tabs.${activeTab()}.content`}
|
|
6268
6699
|
blocks={activeTabContent(activeTab())}
|
|
6269
6700
|
context={props.builderContext}
|
|
6270
6701
|
registeredComponents={props.builderComponents}
|
|
6271
6702
|
linkComponent={props.builderLinkComponent}
|
|
6272
|
-
/></div></
|
|
6703
|
+
/></div></Show11>
|
|
6273
6704
|
</div></>;
|
|
6274
6705
|
}
|
|
6275
6706
|
var tabs_default = Tabs;
|
|
6276
6707
|
|
|
6277
6708
|
// src/blocks/text/component-info.ts
|
|
6278
|
-
var
|
|
6709
|
+
var componentInfo11 = {
|
|
6279
6710
|
shouldReceiveBuilderProps: {
|
|
6280
6711
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
6281
6712
|
builderContext: true
|
|
@@ -6312,7 +6743,7 @@ function Text(props) {
|
|
|
6312
6743
|
var text_default = Text;
|
|
6313
6744
|
|
|
6314
6745
|
// src/blocks/custom-code/component-info.ts
|
|
6315
|
-
var
|
|
6746
|
+
var componentInfo12 = {
|
|
6316
6747
|
name: "Custom Code",
|
|
6317
6748
|
static: true,
|
|
6318
6749
|
requiredPermissions: ["editCode"],
|
|
@@ -6337,12 +6768,12 @@ var componentInfo11 = {
|
|
|
6337
6768
|
};
|
|
6338
6769
|
|
|
6339
6770
|
// src/blocks/custom-code/custom-code.tsx
|
|
6340
|
-
import { onMount as
|
|
6771
|
+
import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
|
|
6341
6772
|
function CustomCode(props) {
|
|
6342
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6343
|
-
const [scriptsRun, setScriptsRun] =
|
|
6773
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6774
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6344
6775
|
let elementRef;
|
|
6345
|
-
|
|
6776
|
+
onMount5(() => {
|
|
6346
6777
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
6347
6778
|
return;
|
|
6348
6779
|
}
|
|
@@ -6383,7 +6814,7 @@ function CustomCode(props) {
|
|
|
6383
6814
|
var custom_code_default = CustomCode;
|
|
6384
6815
|
|
|
6385
6816
|
// src/blocks/embed/component-info.ts
|
|
6386
|
-
var
|
|
6817
|
+
var componentInfo13 = {
|
|
6387
6818
|
name: "Embed",
|
|
6388
6819
|
static: true,
|
|
6389
6820
|
inputs: [{
|
|
@@ -6401,7 +6832,7 @@ var componentInfo12 = {
|
|
|
6401
6832
|
};
|
|
6402
6833
|
|
|
6403
6834
|
// src/blocks/embed/embed.tsx
|
|
6404
|
-
import { on as on2, createEffect as createEffect2, createMemo as
|
|
6835
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6405
6836
|
|
|
6406
6837
|
// src/blocks/embed/helpers.ts
|
|
6407
6838
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -6409,9 +6840,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
6409
6840
|
|
|
6410
6841
|
// src/blocks/embed/embed.tsx
|
|
6411
6842
|
function Embed(props) {
|
|
6412
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
6413
|
-
const [scriptsRun, setScriptsRun] =
|
|
6414
|
-
const [ranInitFn, setRanInitFn] =
|
|
6843
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
6844
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
6845
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
6415
6846
|
function findAndRunScripts() {
|
|
6416
6847
|
if (!elem || !elem.getElementsByTagName)
|
|
6417
6848
|
return;
|
|
@@ -6434,8 +6865,8 @@ function Embed(props) {
|
|
|
6434
6865
|
}
|
|
6435
6866
|
}
|
|
6436
6867
|
let elem;
|
|
6437
|
-
const onUpdateFn_0_elem =
|
|
6438
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
6868
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
6869
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
6439
6870
|
function onUpdateFn_0() {
|
|
6440
6871
|
if (elem && !ranInitFn()) {
|
|
6441
6872
|
setRanInitFn(true);
|
|
@@ -6450,7 +6881,7 @@ function Embed(props) {
|
|
|
6450
6881
|
var embed_default = Embed;
|
|
6451
6882
|
|
|
6452
6883
|
// src/blocks/form/form/component-info.ts
|
|
6453
|
-
var
|
|
6884
|
+
var componentInfo14 = {
|
|
6454
6885
|
name: "Form:Form",
|
|
6455
6886
|
// editableTags: ['builder-form-error']
|
|
6456
6887
|
defaults: {
|
|
@@ -6690,7 +7121,7 @@ var componentInfo13 = {
|
|
|
6690
7121
|
};
|
|
6691
7122
|
|
|
6692
7123
|
// src/blocks/form/form/form.tsx
|
|
6693
|
-
import { Show as
|
|
7124
|
+
import { Show as Show12, createSignal as createSignal14 } from "solid-js";
|
|
6694
7125
|
|
|
6695
7126
|
// src/functions/get-env.ts
|
|
6696
7127
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -6710,9 +7141,9 @@ function logFetch(url) {
|
|
|
6710
7141
|
|
|
6711
7142
|
// src/blocks/form/form/form.tsx
|
|
6712
7143
|
function FormComponent(props) {
|
|
6713
|
-
const [formState, setFormState] =
|
|
6714
|
-
const [responseData, setResponseData] =
|
|
6715
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
7144
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
7145
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
7146
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
6716
7147
|
function mergeNewRootState(newData) {
|
|
6717
7148
|
const combinedState = {
|
|
6718
7149
|
...props.builderContext.rootState,
|
|
@@ -6908,22 +7339,22 @@ function FormComponent(props) {
|
|
|
6908
7339
|
{...props.attributes}
|
|
6909
7340
|
>
|
|
6910
7341
|
{props.children}
|
|
6911
|
-
<
|
|
7342
|
+
<Show12 when={submissionState() === "error"}><Blocks_default
|
|
6912
7343
|
path="errorMessage"
|
|
6913
7344
|
blocks={props.errorMessage}
|
|
6914
7345
|
context={props.builderContext}
|
|
6915
|
-
/></
|
|
6916
|
-
<
|
|
7346
|
+
/></Show12>
|
|
7347
|
+
<Show12 when={submissionState() === "sending"}><Blocks_default
|
|
6917
7348
|
path="sendingMessage"
|
|
6918
7349
|
blocks={props.sendingMessage}
|
|
6919
7350
|
context={props.builderContext}
|
|
6920
|
-
/></
|
|
6921
|
-
<
|
|
6922
|
-
<
|
|
7351
|
+
/></Show12>
|
|
7352
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
7353
|
+
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
6923
7354
|
path="successMessage"
|
|
6924
7355
|
blocks={props.successMessage}
|
|
6925
7356
|
context={props.builderContext}
|
|
6926
|
-
/></
|
|
7357
|
+
/></Show12>
|
|
6927
7358
|
</form>
|
|
6928
7359
|
<style>{`.pre-04a43b72 {
|
|
6929
7360
|
padding: 10px;
|
|
@@ -6935,7 +7366,7 @@ function FormComponent(props) {
|
|
|
6935
7366
|
var form_default = FormComponent;
|
|
6936
7367
|
|
|
6937
7368
|
// src/blocks/form/input/component-info.ts
|
|
6938
|
-
var
|
|
7369
|
+
var componentInfo15 = {
|
|
6939
7370
|
name: "Form:Input",
|
|
6940
7371
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6941
7372
|
inputs: [
|
|
@@ -7005,7 +7436,7 @@ function FormInputComponent(props) {
|
|
|
7005
7436
|
var input_default = FormInputComponent;
|
|
7006
7437
|
|
|
7007
7438
|
// src/blocks/form/select/component-info.ts
|
|
7008
|
-
var
|
|
7439
|
+
var componentInfo16 = {
|
|
7009
7440
|
name: "Form:Select",
|
|
7010
7441
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
7011
7442
|
defaultStyles: {
|
|
@@ -7050,7 +7481,7 @@ var componentInfo15 = {
|
|
|
7050
7481
|
};
|
|
7051
7482
|
|
|
7052
7483
|
// src/blocks/form/select/select.tsx
|
|
7053
|
-
import { For as
|
|
7484
|
+
import { For as For8 } from "solid-js";
|
|
7054
7485
|
function SelectComponent(props) {
|
|
7055
7486
|
return <><select
|
|
7056
7487
|
{...{}}
|
|
@@ -7060,15 +7491,15 @@ function SelectComponent(props) {
|
|
|
7060
7491
|
defaultValue={props.defaultValue}
|
|
7061
7492
|
name={props.name}
|
|
7062
7493
|
required={props.required}
|
|
7063
|
-
><
|
|
7494
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
7064
7495
|
const index = _index();
|
|
7065
7496
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
7066
|
-
}}</
|
|
7497
|
+
}}</For8></select></>;
|
|
7067
7498
|
}
|
|
7068
7499
|
var select_default = SelectComponent;
|
|
7069
7500
|
|
|
7070
7501
|
// src/blocks/form/submit-button/component-info.ts
|
|
7071
|
-
var
|
|
7502
|
+
var componentInfo17 = {
|
|
7072
7503
|
name: "Form:SubmitButton",
|
|
7073
7504
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
7074
7505
|
defaultStyles: {
|
|
@@ -7102,7 +7533,7 @@ function SubmitButton(props) {
|
|
|
7102
7533
|
var submit_button_default = SubmitButton;
|
|
7103
7534
|
|
|
7104
7535
|
// src/blocks/form/textarea/component-info.ts
|
|
7105
|
-
var
|
|
7536
|
+
var componentInfo18 = {
|
|
7106
7537
|
name: "Form:TextArea",
|
|
7107
7538
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
7108
7539
|
inputs: [{
|
|
@@ -7155,7 +7586,7 @@ function Textarea(props) {
|
|
|
7155
7586
|
var textarea_default = Textarea;
|
|
7156
7587
|
|
|
7157
7588
|
// src/blocks/img/component-info.ts
|
|
7158
|
-
var
|
|
7589
|
+
var componentInfo19 = {
|
|
7159
7590
|
// friendlyName?
|
|
7160
7591
|
name: "Raw:Img",
|
|
7161
7592
|
hideFromInsertMenu: true,
|
|
@@ -7188,7 +7619,7 @@ function ImgComponent(props) {
|
|
|
7188
7619
|
var img_default = ImgComponent;
|
|
7189
7620
|
|
|
7190
7621
|
// src/blocks/video/component-info.ts
|
|
7191
|
-
var
|
|
7622
|
+
var componentInfo20 = {
|
|
7192
7623
|
name: "Video",
|
|
7193
7624
|
canHaveChildren: true,
|
|
7194
7625
|
defaultStyles: {
|
|
@@ -7275,9 +7706,9 @@ var componentInfo19 = {
|
|
|
7275
7706
|
};
|
|
7276
7707
|
|
|
7277
7708
|
// src/blocks/video/video.tsx
|
|
7278
|
-
import { Show as
|
|
7709
|
+
import { Show as Show13, createMemo as createMemo15 } from "solid-js";
|
|
7279
7710
|
function Video(props) {
|
|
7280
|
-
const videoProps =
|
|
7711
|
+
const videoProps = createMemo15(() => {
|
|
7281
7712
|
return {
|
|
7282
7713
|
...props.autoPlay === true ? {
|
|
7283
7714
|
autoPlay: true
|
|
@@ -7296,7 +7727,7 @@ function Video(props) {
|
|
|
7296
7727
|
} : {}
|
|
7297
7728
|
};
|
|
7298
7729
|
});
|
|
7299
|
-
const spreadProps =
|
|
7730
|
+
const spreadProps = createMemo15(() => {
|
|
7300
7731
|
return {
|
|
7301
7732
|
...videoProps()
|
|
7302
7733
|
};
|
|
@@ -7325,8 +7756,8 @@ function Video(props) {
|
|
|
7325
7756
|
}}
|
|
7326
7757
|
src={props.video || "no-src"}
|
|
7327
7758
|
poster={props.posterImage}
|
|
7328
|
-
><
|
|
7329
|
-
<
|
|
7759
|
+
><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
|
|
7760
|
+
<Show13
|
|
7330
7761
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
7331
7762
|
><div
|
|
7332
7763
|
style={{
|
|
@@ -7335,15 +7766,15 @@ function Video(props) {
|
|
|
7335
7766
|
"pointer-events": "none",
|
|
7336
7767
|
"font-size": "0px"
|
|
7337
7768
|
}}
|
|
7338
|
-
/></
|
|
7339
|
-
<
|
|
7769
|
+
/></Show13>
|
|
7770
|
+
<Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
7340
7771
|
style={{
|
|
7341
7772
|
display: "flex",
|
|
7342
7773
|
"flex-direction": "column",
|
|
7343
7774
|
"align-items": "stretch"
|
|
7344
7775
|
}}
|
|
7345
|
-
>{props.children}</div></
|
|
7346
|
-
<
|
|
7776
|
+
>{props.children}</div></Show13>
|
|
7777
|
+
<Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
7347
7778
|
style={{
|
|
7348
7779
|
"pointer-events": "none",
|
|
7349
7780
|
display: "flex",
|
|
@@ -7355,7 +7786,7 @@ function Video(props) {
|
|
|
7355
7786
|
width: "100%",
|
|
7356
7787
|
height: "100%"
|
|
7357
7788
|
}}
|
|
7358
|
-
>{props.children}</div></
|
|
7789
|
+
>{props.children}</div></Show13>
|
|
7359
7790
|
</div></>;
|
|
7360
7791
|
}
|
|
7361
7792
|
var video_default = Video;
|
|
@@ -7363,31 +7794,31 @@ var video_default = Video;
|
|
|
7363
7794
|
// src/constants/extra-components.ts
|
|
7364
7795
|
var getExtraComponents = () => [{
|
|
7365
7796
|
component: custom_code_default,
|
|
7366
|
-
...
|
|
7797
|
+
...componentInfo12
|
|
7367
7798
|
}, {
|
|
7368
7799
|
component: embed_default,
|
|
7369
|
-
...
|
|
7800
|
+
...componentInfo13
|
|
7370
7801
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7371
7802
|
component: form_default,
|
|
7372
|
-
...
|
|
7803
|
+
...componentInfo14
|
|
7373
7804
|
}, {
|
|
7374
7805
|
component: input_default,
|
|
7375
|
-
...
|
|
7806
|
+
...componentInfo15
|
|
7376
7807
|
}, {
|
|
7377
7808
|
component: submit_button_default,
|
|
7378
|
-
...
|
|
7809
|
+
...componentInfo17
|
|
7379
7810
|
}, {
|
|
7380
7811
|
component: select_default,
|
|
7381
|
-
...
|
|
7812
|
+
...componentInfo16
|
|
7382
7813
|
}, {
|
|
7383
7814
|
component: textarea_default,
|
|
7384
|
-
...
|
|
7815
|
+
...componentInfo18
|
|
7385
7816
|
}], {
|
|
7386
7817
|
component: img_default,
|
|
7387
|
-
...
|
|
7818
|
+
...componentInfo19
|
|
7388
7819
|
}, {
|
|
7389
7820
|
component: video_default,
|
|
7390
|
-
...
|
|
7821
|
+
...componentInfo20
|
|
7391
7822
|
}];
|
|
7392
7823
|
|
|
7393
7824
|
// src/constants/builder-registered-components.ts
|
|
@@ -7405,19 +7836,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7405
7836
|
...componentInfo5
|
|
7406
7837
|
}, {
|
|
7407
7838
|
component: section_default,
|
|
7408
|
-
...
|
|
7839
|
+
...componentInfo7
|
|
7409
7840
|
}, {
|
|
7410
7841
|
component: slot_default,
|
|
7411
|
-
...
|
|
7842
|
+
...componentInfo8
|
|
7412
7843
|
}, {
|
|
7413
7844
|
component: symbol_default,
|
|
7414
|
-
...
|
|
7845
|
+
...componentInfo9
|
|
7415
7846
|
}, {
|
|
7416
7847
|
component: text_default,
|
|
7417
|
-
...
|
|
7418
|
-
}, ...TARGET === "
|
|
7848
|
+
...componentInfo11
|
|
7849
|
+
}, ...TARGET === "react" ? [{
|
|
7850
|
+
component: personalization_container_default,
|
|
7851
|
+
...componentInfo6
|
|
7852
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
7419
7853
|
component: tabs_default,
|
|
7420
|
-
...
|
|
7854
|
+
...componentInfo10
|
|
7421
7855
|
}, {
|
|
7422
7856
|
component: accordion_default,
|
|
7423
7857
|
...componentInfo
|
|
@@ -7455,7 +7889,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
7455
7889
|
testVariationId: variant.id,
|
|
7456
7890
|
id: content?.id
|
|
7457
7891
|
}));
|
|
7458
|
-
var
|
|
7892
|
+
var checkShouldRenderVariants2 = ({
|
|
7459
7893
|
canTrack,
|
|
7460
7894
|
content
|
|
7461
7895
|
}) => {
|
|
@@ -7489,24 +7923,14 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7489
7923
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7490
7924
|
)`;
|
|
7491
7925
|
|
|
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
7926
|
// src/components/content/components/enable-editor.tsx
|
|
7503
7927
|
import {
|
|
7504
|
-
Show as
|
|
7505
|
-
onMount as
|
|
7928
|
+
Show as Show14,
|
|
7929
|
+
onMount as onMount6,
|
|
7506
7930
|
on as on3,
|
|
7507
7931
|
createEffect as createEffect3,
|
|
7508
|
-
createMemo as
|
|
7509
|
-
createSignal as
|
|
7932
|
+
createMemo as createMemo16,
|
|
7933
|
+
createSignal as createSignal16
|
|
7510
7934
|
} from "solid-js";
|
|
7511
7935
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
7512
7936
|
|
|
@@ -7516,7 +7940,7 @@ function getPreviewContent(_searchParams) {
|
|
|
7516
7940
|
}
|
|
7517
7941
|
|
|
7518
7942
|
// src/constants/sdk-version.ts
|
|
7519
|
-
var SDK_VERSION = "3.0.
|
|
7943
|
+
var SDK_VERSION = "3.0.6";
|
|
7520
7944
|
|
|
7521
7945
|
// src/helpers/sdk-headers.ts
|
|
7522
7946
|
var getSdkHeaders = () => ({
|
|
@@ -7811,16 +8235,6 @@ async function fetchEntries(options) {
|
|
|
7811
8235
|
return _processContentResult(options, content);
|
|
7812
8236
|
}
|
|
7813
8237
|
|
|
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
8238
|
// src/helpers/uuid.ts
|
|
7825
8239
|
function uuidv4() {
|
|
7826
8240
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -8143,7 +8557,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
8143
8557
|
// Supports builder-model="..." attribute which is needed to
|
|
8144
8558
|
// scope our '+ add block' button styling
|
|
8145
8559
|
supportsAddBlockScoping: true,
|
|
8146
|
-
supportsCustomBreakpoints: true
|
|
8560
|
+
supportsCustomBreakpoints: true,
|
|
8561
|
+
blockLevelPersonalization: true
|
|
8147
8562
|
}
|
|
8148
8563
|
}, "*");
|
|
8149
8564
|
window.parent?.postMessage({
|
|
@@ -8358,12 +8773,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
8358
8773
|
|
|
8359
8774
|
// src/components/content/components/enable-editor.tsx
|
|
8360
8775
|
function EnableEditor(props) {
|
|
8361
|
-
const [ContentWrapper, setContentWrapper] =
|
|
8776
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
8362
8777
|
props.contentWrapper || "div"
|
|
8363
8778
|
);
|
|
8364
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8365
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8366
|
-
const [clicked, setClicked] =
|
|
8779
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
8780
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
8781
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
8367
8782
|
function mergeNewRootState(newData) {
|
|
8368
8783
|
const combinedState = {
|
|
8369
8784
|
...props.builderContextSignal.rootState,
|
|
@@ -8397,7 +8812,7 @@ function EnableEditor(props) {
|
|
|
8397
8812
|
content: newContentValue
|
|
8398
8813
|
}));
|
|
8399
8814
|
}
|
|
8400
|
-
const showContentProps =
|
|
8815
|
+
const showContentProps = createMemo16(() => {
|
|
8401
8816
|
return props.showContent ? {} : {
|
|
8402
8817
|
hidden: true,
|
|
8403
8818
|
"aria-hidden": true
|
|
@@ -8503,7 +8918,7 @@ function EnableEditor(props) {
|
|
|
8503
8918
|
let elementRef;
|
|
8504
8919
|
runHttpRequests();
|
|
8505
8920
|
emitStateUpdate();
|
|
8506
|
-
|
|
8921
|
+
onMount6(() => {
|
|
8507
8922
|
if (isBrowser()) {
|
|
8508
8923
|
if (isEditing() && !props.isNestedRender) {
|
|
8509
8924
|
window.addEventListener("message", processMessage);
|
|
@@ -8572,14 +8987,14 @@ function EnableEditor(props) {
|
|
|
8572
8987
|
}
|
|
8573
8988
|
}
|
|
8574
8989
|
});
|
|
8575
|
-
const onUpdateFn_0_props_content =
|
|
8990
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
8576
8991
|
function onUpdateFn_0() {
|
|
8577
8992
|
if (props.content) {
|
|
8578
8993
|
mergeNewContent(props.content);
|
|
8579
8994
|
}
|
|
8580
8995
|
}
|
|
8581
8996
|
createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
8582
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
8997
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
|
|
8583
8998
|
() => props.builderContextSignal.rootState
|
|
8584
8999
|
);
|
|
8585
9000
|
function onUpdateFn_1() {
|
|
@@ -8591,14 +9006,14 @@ function EnableEditor(props) {
|
|
|
8591
9006
|
onUpdateFn_1
|
|
8592
9007
|
)
|
|
8593
9008
|
);
|
|
8594
|
-
const onUpdateFn_2_props_data =
|
|
9009
|
+
const onUpdateFn_2_props_data = createMemo16(() => props.data);
|
|
8595
9010
|
function onUpdateFn_2() {
|
|
8596
9011
|
if (props.data) {
|
|
8597
9012
|
mergeNewRootState(props.data);
|
|
8598
9013
|
}
|
|
8599
9014
|
}
|
|
8600
9015
|
createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
8601
|
-
const onUpdateFn_3_props_locale =
|
|
9016
|
+
const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
|
|
8602
9017
|
function onUpdateFn_3() {
|
|
8603
9018
|
if (props.locale) {
|
|
8604
9019
|
mergeNewRootState({
|
|
@@ -8607,7 +9022,7 @@ function EnableEditor(props) {
|
|
|
8607
9022
|
}
|
|
8608
9023
|
}
|
|
8609
9024
|
createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
8610
|
-
return <><builder_context_default.Provider value={props.builderContextSignal}><
|
|
9025
|
+
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
8611
9026
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
8612
9027
|
><Dynamic5
|
|
8613
9028
|
class={getWrapperClassName(
|
|
@@ -8625,14 +9040,14 @@ function EnableEditor(props) {
|
|
|
8625
9040
|
{...showContentProps()}
|
|
8626
9041
|
{...props.contentWrapperProps}
|
|
8627
9042
|
component={ContentWrapper()}
|
|
8628
|
-
>{props.children}</Dynamic5></
|
|
9043
|
+
>{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
|
|
8629
9044
|
}
|
|
8630
9045
|
var Enable_editor_default = EnableEditor;
|
|
8631
9046
|
|
|
8632
9047
|
// src/components/content/components/styles.tsx
|
|
8633
|
-
import { createSignal as
|
|
9048
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
8634
9049
|
function ContentStyles(props) {
|
|
8635
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9050
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
8636
9051
|
`
|
|
8637
9052
|
${getCss({
|
|
8638
9053
|
cssCode: props.cssCode,
|
|
@@ -8690,7 +9105,7 @@ var getContentInitialValue = ({
|
|
|
8690
9105
|
|
|
8691
9106
|
// src/components/content/content.tsx
|
|
8692
9107
|
function ContentComponent(props) {
|
|
8693
|
-
const [scriptStr, setScriptStr] =
|
|
9108
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
8694
9109
|
getUpdateVariantVisibilityScript({
|
|
8695
9110
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8696
9111
|
variationId: props.content?.testVariationId,
|
|
@@ -8698,7 +9113,7 @@ function ContentComponent(props) {
|
|
|
8698
9113
|
contentId: props.content?.id
|
|
8699
9114
|
})
|
|
8700
9115
|
);
|
|
8701
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9116
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
8702
9117
|
[
|
|
8703
9118
|
...getDefaultRegisteredComponents(),
|
|
8704
9119
|
...props.customComponents || []
|
|
@@ -8713,7 +9128,7 @@ function ContentComponent(props) {
|
|
|
8713
9128
|
{}
|
|
8714
9129
|
)
|
|
8715
9130
|
);
|
|
8716
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9131
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
8717
9132
|
content: getContentInitialValue({
|
|
8718
9133
|
content: props.content,
|
|
8719
9134
|
data: props.data
|
|
@@ -8797,18 +9212,18 @@ function ContentComponent(props) {
|
|
|
8797
9212
|
setBuilderContextSignal
|
|
8798
9213
|
}}
|
|
8799
9214
|
>
|
|
8800
|
-
<
|
|
9215
|
+
<Show15 when={props.isSsrAbTest}><Inlined_script_default
|
|
8801
9216
|
id="builderio-variant-visibility"
|
|
8802
9217
|
scriptStr={scriptStr()}
|
|
8803
9218
|
nonce={props.nonce || ""}
|
|
8804
|
-
/></
|
|
8805
|
-
<
|
|
9219
|
+
/></Show15>
|
|
9220
|
+
<Show15 when={TARGET !== "reactNative"}><Styles_default
|
|
8806
9221
|
nonce={props.nonce || ""}
|
|
8807
9222
|
isNestedRender={props.isNestedRender}
|
|
8808
9223
|
contentId={builderContextSignal().content?.id}
|
|
8809
9224
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
8810
9225
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
8811
|
-
/></
|
|
9226
|
+
/></Show15>
|
|
8812
9227
|
<Blocks_default
|
|
8813
9228
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
8814
9229
|
context={builderContextSignal()}
|
|
@@ -8821,13 +9236,13 @@ var Content_default = ContentComponent;
|
|
|
8821
9236
|
|
|
8822
9237
|
// src/components/content-variants/content-variants.tsx
|
|
8823
9238
|
function ContentVariants(props) {
|
|
8824
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
8825
|
-
|
|
9239
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
9240
|
+
checkShouldRenderVariants2({
|
|
8826
9241
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
8827
9242
|
content: props.content
|
|
8828
9243
|
})
|
|
8829
9244
|
);
|
|
8830
|
-
const updateCookieAndStylesScriptStr =
|
|
9245
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
8831
9246
|
return getUpdateCookieAndStylesScript(
|
|
8832
9247
|
getVariants(props.content).map((value) => ({
|
|
8833
9248
|
id: value.testVariationId,
|
|
@@ -8836,10 +9251,10 @@ function ContentVariants(props) {
|
|
|
8836
9251
|
props.content?.id || ""
|
|
8837
9252
|
);
|
|
8838
9253
|
});
|
|
8839
|
-
const hideVariantsStyleString =
|
|
9254
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
8840
9255
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
8841
9256
|
});
|
|
8842
|
-
const defaultContent =
|
|
9257
|
+
const defaultContent = createMemo19(() => {
|
|
8843
9258
|
return shouldRenderVariants() ? {
|
|
8844
9259
|
...props.content,
|
|
8845
9260
|
testVariationId: props.content?.id
|
|
@@ -8848,16 +9263,16 @@ function ContentVariants(props) {
|
|
|
8848
9263
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
8849
9264
|
});
|
|
8850
9265
|
});
|
|
8851
|
-
|
|
9266
|
+
onMount7(() => {
|
|
8852
9267
|
setShouldRenderVariants(false);
|
|
8853
9268
|
});
|
|
8854
9269
|
return <><>
|
|
8855
|
-
<
|
|
9270
|
+
<Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8856
9271
|
id="builderio-init-variants-fns"
|
|
8857
9272
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8858
9273
|
nonce={props.nonce || ""}
|
|
8859
|
-
/></
|
|
8860
|
-
<
|
|
9274
|
+
/></Show16>
|
|
9275
|
+
<Show16 when={shouldRenderVariants()}>
|
|
8861
9276
|
<Inlined_styles_default
|
|
8862
9277
|
id="builderio-variants"
|
|
8863
9278
|
styles={hideVariantsStyleString()}
|
|
@@ -8868,7 +9283,7 @@ function ContentVariants(props) {
|
|
|
8868
9283
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8869
9284
|
nonce={props.nonce || ""}
|
|
8870
9285
|
/>
|
|
8871
|
-
<
|
|
9286
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8872
9287
|
const index = _index();
|
|
8873
9288
|
return <Content_default
|
|
8874
9289
|
apiHost={props.apiHost}
|
|
@@ -8895,8 +9310,8 @@ function ContentVariants(props) {
|
|
|
8895
9310
|
trustedHosts={props.trustedHosts}
|
|
8896
9311
|
{...{}}
|
|
8897
9312
|
/>;
|
|
8898
|
-
}}</
|
|
8899
|
-
</
|
|
9313
|
+
}}</For9>
|
|
9314
|
+
</Show16>
|
|
8900
9315
|
<Content_default
|
|
8901
9316
|
apiHost={props.apiHost}
|
|
8902
9317
|
nonce={props.nonce}
|
|
@@ -8951,14 +9366,14 @@ var fetchSymbolContent = async ({
|
|
|
8951
9366
|
|
|
8952
9367
|
// src/blocks/symbol/symbol.tsx
|
|
8953
9368
|
function Symbol2(props) {
|
|
8954
|
-
const [contentToUse, setContentToUse] =
|
|
8955
|
-
const blocksWrapper =
|
|
9369
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
9370
|
+
const blocksWrapper = createMemo20(() => {
|
|
8956
9371
|
return "div";
|
|
8957
9372
|
});
|
|
8958
|
-
const contentWrapper =
|
|
9373
|
+
const contentWrapper = createMemo20(() => {
|
|
8959
9374
|
return "div";
|
|
8960
9375
|
});
|
|
8961
|
-
const className =
|
|
9376
|
+
const className = createMemo20(() => {
|
|
8962
9377
|
return [
|
|
8963
9378
|
...[props.attributes[getClassPropName()]],
|
|
8964
9379
|
"builder-symbol",
|
|
@@ -8978,9 +9393,9 @@ function Symbol2(props) {
|
|
|
8978
9393
|
}
|
|
8979
9394
|
});
|
|
8980
9395
|
}
|
|
8981
|
-
|
|
9396
|
+
onMount8(() => {
|
|
8982
9397
|
});
|
|
8983
|
-
const onUpdateFn_0_props_symbol =
|
|
9398
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
8984
9399
|
function onUpdateFn_0() {
|
|
8985
9400
|
setContent();
|
|
8986
9401
|
}
|
|
@@ -9065,6 +9480,7 @@ export {
|
|
|
9065
9480
|
isEditing,
|
|
9066
9481
|
isPreviewing,
|
|
9067
9482
|
register,
|
|
9483
|
+
setClientUserAttributes,
|
|
9068
9484
|
setEditorSettings,
|
|
9069
9485
|
subscribeToEditor,
|
|
9070
9486
|
track
|