@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/node/index.js
CHANGED
|
@@ -1099,8 +1099,13 @@ var provideBuilderContext = (block, context) => {
|
|
|
1099
1099
|
|
|
1100
1100
|
// src/constants/device-sizes.ts
|
|
1101
1101
|
var SIZES = {
|
|
1102
|
+
xsmall: {
|
|
1103
|
+
min: 0,
|
|
1104
|
+
default: 160,
|
|
1105
|
+
max: 320
|
|
1106
|
+
},
|
|
1102
1107
|
small: {
|
|
1103
|
-
min:
|
|
1108
|
+
min: 321,
|
|
1104
1109
|
default: 321,
|
|
1105
1110
|
max: 640
|
|
1106
1111
|
},
|
|
@@ -1116,15 +1121,28 @@ var SIZES = {
|
|
|
1116
1121
|
}
|
|
1117
1122
|
};
|
|
1118
1123
|
var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
1119
|
-
var getSizesForBreakpoints = ({
|
|
1120
|
-
small,
|
|
1121
|
-
medium
|
|
1122
|
-
}) => {
|
|
1124
|
+
var getSizesForBreakpoints = (breakpoints) => {
|
|
1123
1125
|
const newSizes = fastClone(SIZES);
|
|
1126
|
+
if (!breakpoints) {
|
|
1127
|
+
return newSizes;
|
|
1128
|
+
}
|
|
1129
|
+
const {
|
|
1130
|
+
xsmall,
|
|
1131
|
+
small,
|
|
1132
|
+
medium
|
|
1133
|
+
} = breakpoints;
|
|
1134
|
+
if (xsmall) {
|
|
1135
|
+
const xsmallMin = Math.floor(xsmall / 2);
|
|
1136
|
+
newSizes.xsmall = {
|
|
1137
|
+
max: xsmall,
|
|
1138
|
+
min: xsmallMin,
|
|
1139
|
+
default: xsmallMin + 1
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1124
1142
|
if (!small || !medium) {
|
|
1125
1143
|
return newSizes;
|
|
1126
1144
|
}
|
|
1127
|
-
const smallMin = Math.floor(small / 2);
|
|
1145
|
+
const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
|
|
1128
1146
|
newSizes.small = {
|
|
1129
1147
|
max: small,
|
|
1130
1148
|
min: smallMin,
|
|
@@ -1182,9 +1200,11 @@ function BlockStyles(props) {
|
|
|
1182
1200
|
const styles = processedBlock.responsiveStyles;
|
|
1183
1201
|
const content = props.context.content;
|
|
1184
1202
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(content?.meta?.breakpoints || {});
|
|
1203
|
+
const contentHasXSmallBreakpoint = Boolean(content?.meta?.breakpoints?.xsmall);
|
|
1185
1204
|
const largeStyles = styles?.large;
|
|
1186
1205
|
const mediumStyles = styles?.medium;
|
|
1187
1206
|
const smallStyles = styles?.small;
|
|
1207
|
+
const xsmallStyles = styles?.xsmall;
|
|
1188
1208
|
const className = processedBlock.id;
|
|
1189
1209
|
if (!className) {
|
|
1190
1210
|
return "";
|
|
@@ -1203,6 +1223,11 @@ function BlockStyles(props) {
|
|
|
1203
1223
|
styles: smallStyles,
|
|
1204
1224
|
mediaQuery: getMaxWidthQueryForSize("small", sizesWithUpdatedBreakpoints)
|
|
1205
1225
|
}) : "";
|
|
1226
|
+
const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
|
|
1227
|
+
className,
|
|
1228
|
+
styles: xsmallStyles,
|
|
1229
|
+
mediaQuery: getMaxWidthQueryForSize("xsmall", sizesWithUpdatedBreakpoints)
|
|
1230
|
+
}) : "";
|
|
1206
1231
|
const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
|
|
1207
1232
|
let hoverStylesClass = "";
|
|
1208
1233
|
if (hoverAnimation) {
|
|
@@ -1216,7 +1241,7 @@ function BlockStyles(props) {
|
|
|
1216
1241
|
}
|
|
1217
1242
|
}) || "";
|
|
1218
1243
|
}
|
|
1219
|
-
return [largeStylesClass, mediumStylesClass, smallStylesClass, hoverStylesClass].join(" ");
|
|
1244
|
+
return [largeStylesClass, mediumStylesClass, smallStylesClass, xsmallStylesClass, hoverStylesClass].join(" ");
|
|
1220
1245
|
});
|
|
1221
1246
|
return createComponent(Show, {
|
|
1222
1247
|
get when() {
|
|
@@ -1776,7 +1801,7 @@ function Block(props) {
|
|
|
1776
1801
|
});
|
|
1777
1802
|
}
|
|
1778
1803
|
var block_default = Block;
|
|
1779
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1804
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
|
|
1780
1805
|
display: flex;
|
|
1781
1806
|
flex-direction: column;
|
|
1782
1807
|
align-items: stretch;
|
|
@@ -1789,8 +1814,9 @@ function BlocksWrapper(props) {
|
|
|
1789
1814
|
if (!props.path) {
|
|
1790
1815
|
return void 0;
|
|
1791
1816
|
}
|
|
1817
|
+
const thisPrefix = "this.";
|
|
1792
1818
|
const pathPrefix = "component.options.";
|
|
1793
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1819
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1794
1820
|
});
|
|
1795
1821
|
function onClick() {
|
|
1796
1822
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -1819,7 +1845,7 @@ function BlocksWrapper(props) {
|
|
|
1819
1845
|
});
|
|
1820
1846
|
return [createComponent(Dynamic, mergeProps({
|
|
1821
1847
|
get ["class"]() {
|
|
1822
|
-
return className() + " dynamic-
|
|
1848
|
+
return className() + " dynamic-3d7ff108";
|
|
1823
1849
|
},
|
|
1824
1850
|
ref(r$) {
|
|
1825
1851
|
const _ref$ = blocksWrapperRef;
|
|
@@ -2512,8 +2538,58 @@ var handleABTesting = async ({
|
|
|
2512
2538
|
};
|
|
2513
2539
|
};
|
|
2514
2540
|
|
|
2541
|
+
// src/helpers/user-attributes.ts
|
|
2542
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2543
|
+
function createUserAttributesService() {
|
|
2544
|
+
let canTrack = true;
|
|
2545
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
2546
|
+
return {
|
|
2547
|
+
setUserAttributes(newAttrs) {
|
|
2548
|
+
if (!isBrowser()) {
|
|
2549
|
+
return;
|
|
2550
|
+
}
|
|
2551
|
+
const userAttributes = {
|
|
2552
|
+
...this.getUserAttributes(),
|
|
2553
|
+
...newAttrs
|
|
2554
|
+
};
|
|
2555
|
+
setCookie({
|
|
2556
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2557
|
+
value: JSON.stringify(userAttributes),
|
|
2558
|
+
canTrack
|
|
2559
|
+
});
|
|
2560
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
2561
|
+
},
|
|
2562
|
+
getUserAttributes() {
|
|
2563
|
+
if (!isBrowser()) {
|
|
2564
|
+
return {};
|
|
2565
|
+
}
|
|
2566
|
+
return JSON.parse(getCookieSync({
|
|
2567
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2568
|
+
canTrack
|
|
2569
|
+
}) || "{}");
|
|
2570
|
+
},
|
|
2571
|
+
subscribeOnUserAttributesChange(callback) {
|
|
2572
|
+
subscribers.add(callback);
|
|
2573
|
+
return () => {
|
|
2574
|
+
subscribers.delete(callback);
|
|
2575
|
+
};
|
|
2576
|
+
},
|
|
2577
|
+
setCanTrack(value) {
|
|
2578
|
+
canTrack = value;
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
var userAttributesService = createUserAttributesService();
|
|
2583
|
+
var setClientUserAttributes = (attributes) => {
|
|
2584
|
+
userAttributesService.setUserAttributes(attributes);
|
|
2585
|
+
};
|
|
2586
|
+
|
|
2515
2587
|
// src/helpers/canTrack.ts
|
|
2516
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
2588
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
2589
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
2590
|
+
userAttributesService.setCanTrack(result);
|
|
2591
|
+
return result;
|
|
2592
|
+
};
|
|
2517
2593
|
|
|
2518
2594
|
// src/blocks/accordion/component-info.ts
|
|
2519
2595
|
var defaultTitle = {
|
|
@@ -3243,8 +3319,408 @@ var componentInfo5 = {
|
|
|
3243
3319
|
}
|
|
3244
3320
|
};
|
|
3245
3321
|
|
|
3246
|
-
// src/blocks/
|
|
3322
|
+
// src/blocks/personalization-container/component-info.ts
|
|
3247
3323
|
var componentInfo6 = {
|
|
3324
|
+
name: "PersonalizationContainer",
|
|
3325
|
+
shouldReceiveBuilderProps: {
|
|
3326
|
+
builderBlock: true,
|
|
3327
|
+
builderContext: true
|
|
3328
|
+
},
|
|
3329
|
+
noWrap: true,
|
|
3330
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
3331
|
+
canHaveChildren: true,
|
|
3332
|
+
inputs: [{
|
|
3333
|
+
name: "variants",
|
|
3334
|
+
defaultValue: [],
|
|
3335
|
+
behavior: "personalizationVariantList",
|
|
3336
|
+
type: "list",
|
|
3337
|
+
subFields: [{
|
|
3338
|
+
name: "name",
|
|
3339
|
+
type: "text"
|
|
3340
|
+
}, {
|
|
3341
|
+
name: "query",
|
|
3342
|
+
friendlyName: "Targeting rules",
|
|
3343
|
+
type: "BuilderQuery",
|
|
3344
|
+
defaultValue: []
|
|
3345
|
+
}, {
|
|
3346
|
+
name: "startDate",
|
|
3347
|
+
type: "date"
|
|
3348
|
+
}, {
|
|
3349
|
+
name: "endDate",
|
|
3350
|
+
type: "date"
|
|
3351
|
+
}, {
|
|
3352
|
+
name: "blocks",
|
|
3353
|
+
type: "uiBlocks",
|
|
3354
|
+
hideFromUI: true,
|
|
3355
|
+
defaultValue: []
|
|
3356
|
+
}]
|
|
3357
|
+
}]
|
|
3358
|
+
};
|
|
3359
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
|
|
3360
|
+
function InlinedScript(props) {
|
|
3361
|
+
return (() => {
|
|
3362
|
+
const _el$ = _tmpl$8();
|
|
3363
|
+
effect((_p$) => {
|
|
3364
|
+
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
3365
|
+
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
3366
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
3367
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
3368
|
+
return _p$;
|
|
3369
|
+
}, {
|
|
3370
|
+
_v$: void 0,
|
|
3371
|
+
_v$2: void 0,
|
|
3372
|
+
_v$3: void 0
|
|
3373
|
+
});
|
|
3374
|
+
return _el$;
|
|
3375
|
+
})();
|
|
3376
|
+
}
|
|
3377
|
+
var inlined_script_default = InlinedScript;
|
|
3378
|
+
|
|
3379
|
+
// src/functions/is-previewing.ts
|
|
3380
|
+
function isPreviewing(_search) {
|
|
3381
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
3382
|
+
if (!search) {
|
|
3383
|
+
return false;
|
|
3384
|
+
}
|
|
3385
|
+
const normalizedSearch = getSearchString(search);
|
|
3386
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
3390
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
3391
|
+
function isString(val) {
|
|
3392
|
+
return typeof val === "string";
|
|
3393
|
+
}
|
|
3394
|
+
function isNumber(val) {
|
|
3395
|
+
return typeof val === "number";
|
|
3396
|
+
}
|
|
3397
|
+
function objectMatchesQuery(userattr, query2) {
|
|
3398
|
+
const result = (() => {
|
|
3399
|
+
const property = query2.property;
|
|
3400
|
+
const operator = query2.operator;
|
|
3401
|
+
let testValue = query2.value;
|
|
3402
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
3403
|
+
testValue = query2.value.slice(0, -1);
|
|
3404
|
+
}
|
|
3405
|
+
if (!(property && operator)) {
|
|
3406
|
+
return true;
|
|
3407
|
+
}
|
|
3408
|
+
if (Array.isArray(testValue)) {
|
|
3409
|
+
if (operator === "isNot") {
|
|
3410
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
3411
|
+
property,
|
|
3412
|
+
operator,
|
|
3413
|
+
value: val
|
|
3414
|
+
}));
|
|
3415
|
+
}
|
|
3416
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
3417
|
+
property,
|
|
3418
|
+
operator,
|
|
3419
|
+
value: val
|
|
3420
|
+
}));
|
|
3421
|
+
}
|
|
3422
|
+
const value = userattr[property];
|
|
3423
|
+
if (Array.isArray(value)) {
|
|
3424
|
+
return value.includes(testValue);
|
|
3425
|
+
}
|
|
3426
|
+
switch (operator) {
|
|
3427
|
+
case "is":
|
|
3428
|
+
return value === testValue;
|
|
3429
|
+
case "isNot":
|
|
3430
|
+
return value !== testValue;
|
|
3431
|
+
case "contains":
|
|
3432
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
3433
|
+
case "startsWith":
|
|
3434
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
3435
|
+
case "endsWith":
|
|
3436
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
3437
|
+
case "greaterThan":
|
|
3438
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
3439
|
+
case "lessThan":
|
|
3440
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
3441
|
+
case "greaterThanOrEqualTo":
|
|
3442
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
3443
|
+
case "lessThanOrEqualTo":
|
|
3444
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
3445
|
+
default:
|
|
3446
|
+
return false;
|
|
3447
|
+
}
|
|
3448
|
+
})();
|
|
3449
|
+
return result;
|
|
3450
|
+
}
|
|
3451
|
+
const item = {
|
|
3452
|
+
query,
|
|
3453
|
+
startDate,
|
|
3454
|
+
endDate
|
|
3455
|
+
};
|
|
3456
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
3457
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
3458
|
+
return false;
|
|
3459
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
3460
|
+
return false;
|
|
3461
|
+
}
|
|
3462
|
+
if (!item.query || !item.query.length) {
|
|
3463
|
+
return true;
|
|
3464
|
+
}
|
|
3465
|
+
return item.query.every((filter) => {
|
|
3466
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
3470
|
+
if (!navigator.cookieEnabled) {
|
|
3471
|
+
return;
|
|
3472
|
+
}
|
|
3473
|
+
function getCookie(name) {
|
|
3474
|
+
const nameEQ = name + '=';
|
|
3475
|
+
const ca = document.cookie.split(';');
|
|
3476
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3477
|
+
let c = ca[i];
|
|
3478
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
3479
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
3480
|
+
}
|
|
3481
|
+
return null;
|
|
3482
|
+
}
|
|
3483
|
+
function removeVariants() {
|
|
3484
|
+
variants?.forEach(function (_, index) {
|
|
3485
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
3486
|
+
});
|
|
3487
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
3488
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
3489
|
+
}
|
|
3490
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
3491
|
+
if (locale) {
|
|
3492
|
+
attributes.locale = locale;
|
|
3493
|
+
}
|
|
3494
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
3495
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
3496
|
+
});
|
|
3497
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
3498
|
+
if (isDebug) {
|
|
3499
|
+
console.debug('PersonalizationContainer', {
|
|
3500
|
+
attributes,
|
|
3501
|
+
variants,
|
|
3502
|
+
winningVariantIndex
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
if (winningVariantIndex !== -1) {
|
|
3506
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
3507
|
+
if (winningVariant) {
|
|
3508
|
+
const parentNode = winningVariant.parentNode;
|
|
3509
|
+
if (parentNode) {
|
|
3510
|
+
const newParent = parentNode.cloneNode(false);
|
|
3511
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
3512
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
3513
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
3514
|
+
}
|
|
3515
|
+
if (isDebug) {
|
|
3516
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
} else if (variants && variants.length > 0) {
|
|
3520
|
+
removeVariants();
|
|
3521
|
+
}
|
|
3522
|
+
}`;
|
|
3523
|
+
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}";
|
|
3524
|
+
|
|
3525
|
+
// src/blocks/personalization-container/helpers.ts
|
|
3526
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
3527
|
+
const hasVariants = variants && variants.length > 0;
|
|
3528
|
+
if (TARGET === "reactNative")
|
|
3529
|
+
return false;
|
|
3530
|
+
if (!hasVariants)
|
|
3531
|
+
return false;
|
|
3532
|
+
if (!canTrack)
|
|
3533
|
+
return false;
|
|
3534
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
3535
|
+
return true;
|
|
3536
|
+
if (isBrowser())
|
|
3537
|
+
return false;
|
|
3538
|
+
return true;
|
|
3539
|
+
}
|
|
3540
|
+
function getBlocksToRender({
|
|
3541
|
+
variants,
|
|
3542
|
+
previewingIndex,
|
|
3543
|
+
isHydrated,
|
|
3544
|
+
filteredVariants,
|
|
3545
|
+
fallbackBlocks
|
|
3546
|
+
}) {
|
|
3547
|
+
const fallback = {
|
|
3548
|
+
blocks: fallbackBlocks ?? [],
|
|
3549
|
+
path: "this.children"
|
|
3550
|
+
};
|
|
3551
|
+
if (isHydrated && isEditing()) {
|
|
3552
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
3553
|
+
const variant = variants[previewingIndex];
|
|
3554
|
+
return {
|
|
3555
|
+
blocks: variant.blocks,
|
|
3556
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
3557
|
+
};
|
|
3558
|
+
}
|
|
3559
|
+
return fallback;
|
|
3560
|
+
}
|
|
3561
|
+
if (isBrowser()) {
|
|
3562
|
+
const winningVariant = filteredVariants?.[0];
|
|
3563
|
+
if (winningVariant) {
|
|
3564
|
+
return {
|
|
3565
|
+
blocks: winningVariant.blocks,
|
|
3566
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
3567
|
+
};
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
return fallback;
|
|
3571
|
+
}
|
|
3572
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
3573
|
+
return `
|
|
3574
|
+
(function() {
|
|
3575
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
3576
|
+
${PERSONALIZATION_SCRIPT}
|
|
3577
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
3578
|
+
})();
|
|
3579
|
+
`;
|
|
3580
|
+
};
|
|
3581
|
+
|
|
3582
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
3583
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
3584
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
|
|
3585
|
+
function PersonalizationContainer(props) {
|
|
3586
|
+
const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
|
|
3587
|
+
const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
|
|
3588
|
+
const [unsubscribers, setUnsubscribers] = createSignal([]);
|
|
3589
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
|
|
3590
|
+
const [isHydrated, setIsHydrated] = createSignal(false);
|
|
3591
|
+
const filteredVariants = createMemo(() => {
|
|
3592
|
+
return (props.variants || []).filter((variant) => {
|
|
3593
|
+
return filterWithCustomTargeting({
|
|
3594
|
+
...props.builderContext?.rootState?.locale ? {
|
|
3595
|
+
locale: props.builderContext?.rootState?.locale
|
|
3596
|
+
} : {},
|
|
3597
|
+
...userAttributes()
|
|
3598
|
+
}, variant.query, variant.startDate, variant.endDate);
|
|
3599
|
+
});
|
|
3600
|
+
});
|
|
3601
|
+
const blocksToRender = createMemo(() => {
|
|
3602
|
+
return getBlocksToRender({
|
|
3603
|
+
variants: props.variants,
|
|
3604
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
3605
|
+
isHydrated: isHydrated(),
|
|
3606
|
+
filteredVariants: filteredVariants(),
|
|
3607
|
+
previewingIndex: props.previewingIndex
|
|
3608
|
+
});
|
|
3609
|
+
});
|
|
3610
|
+
const hideVariantsStyleString = createMemo(() => {
|
|
3611
|
+
return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
|
|
3612
|
+
});
|
|
3613
|
+
let rootRef;
|
|
3614
|
+
onMount(() => {
|
|
3615
|
+
setIsHydrated(true);
|
|
3616
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
|
|
3617
|
+
setUserAttributes(attrs);
|
|
3618
|
+
});
|
|
3619
|
+
if (!(isEditing() || isPreviewing())) {
|
|
3620
|
+
const variant = filteredVariants()[0];
|
|
3621
|
+
if (rootRef) {
|
|
3622
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
|
|
3623
|
+
detail: {
|
|
3624
|
+
variant: variant || "default",
|
|
3625
|
+
content: props.builderContext?.content
|
|
3626
|
+
},
|
|
3627
|
+
bubbles: true
|
|
3628
|
+
}));
|
|
3629
|
+
const observer = new IntersectionObserver((entries) => {
|
|
3630
|
+
entries.forEach((entry) => {
|
|
3631
|
+
if (entry.isIntersecting && rootRef) {
|
|
3632
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
|
|
3633
|
+
detail: {
|
|
3634
|
+
variant: variant || "default",
|
|
3635
|
+
content: props.builderContext?.content
|
|
3636
|
+
},
|
|
3637
|
+
bubbles: true
|
|
3638
|
+
}));
|
|
3639
|
+
}
|
|
3640
|
+
});
|
|
3641
|
+
});
|
|
3642
|
+
observer.observe(rootRef);
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
unsubscribers().push(unsub);
|
|
3646
|
+
});
|
|
3647
|
+
return (() => {
|
|
3648
|
+
const _el$ = _tmpl$9();
|
|
3649
|
+
const _ref$ = rootRef;
|
|
3650
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
|
|
3651
|
+
spread(_el$, mergeProps({
|
|
3652
|
+
get ["class"]() {
|
|
3653
|
+
return `builder-personalization-container ${props.attributes?.className || ""}`;
|
|
3654
|
+
}
|
|
3655
|
+
}, () => props.attributes), false, true);
|
|
3656
|
+
insert(_el$, createComponent(Show, {
|
|
3657
|
+
get when() {
|
|
3658
|
+
return shouldRenderVariants();
|
|
3659
|
+
},
|
|
3660
|
+
get children() {
|
|
3661
|
+
return [createComponent(For, {
|
|
3662
|
+
get each() {
|
|
3663
|
+
return props.variants;
|
|
3664
|
+
},
|
|
3665
|
+
children: (variant, _index) => {
|
|
3666
|
+
const index = _index();
|
|
3667
|
+
return (() => {
|
|
3668
|
+
const _el$2 = _tmpl$25();
|
|
3669
|
+
setAttribute(_el$2, "key", index);
|
|
3670
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
3671
|
+
get blocks() {
|
|
3672
|
+
return variant.blocks;
|
|
3673
|
+
},
|
|
3674
|
+
get parent() {
|
|
3675
|
+
return props.builderBlock?.id;
|
|
3676
|
+
},
|
|
3677
|
+
path: `component.options.variants.${index}.blocks`
|
|
3678
|
+
}));
|
|
3679
|
+
effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
|
|
3680
|
+
return _el$2;
|
|
3681
|
+
})();
|
|
3682
|
+
}
|
|
3683
|
+
}), createComponent(inlined_styles_default, {
|
|
3684
|
+
get nonce() {
|
|
3685
|
+
return props.builderContext?.nonce || "";
|
|
3686
|
+
},
|
|
3687
|
+
get styles() {
|
|
3688
|
+
return hideVariantsStyleString();
|
|
3689
|
+
},
|
|
3690
|
+
get id() {
|
|
3691
|
+
return `variants-styles-${props.builderBlock?.id}`;
|
|
3692
|
+
}
|
|
3693
|
+
}), createComponent(inlined_script_default, {
|
|
3694
|
+
get nonce() {
|
|
3695
|
+
return props.builderContext?.nonce || "";
|
|
3696
|
+
},
|
|
3697
|
+
get scriptStr() {
|
|
3698
|
+
return scriptStr();
|
|
3699
|
+
},
|
|
3700
|
+
get id() {
|
|
3701
|
+
return `variants-script-${props.builderBlock?.id}`;
|
|
3702
|
+
}
|
|
3703
|
+
})];
|
|
3704
|
+
}
|
|
3705
|
+
}), null);
|
|
3706
|
+
insert(_el$, createComponent(blocks_default, {
|
|
3707
|
+
get blocks() {
|
|
3708
|
+
return blocksToRender().blocks;
|
|
3709
|
+
},
|
|
3710
|
+
get parent() {
|
|
3711
|
+
return props.builderBlock?.id;
|
|
3712
|
+
},
|
|
3713
|
+
get path() {
|
|
3714
|
+
return blocksToRender().path;
|
|
3715
|
+
}
|
|
3716
|
+
}), null);
|
|
3717
|
+
return _el$;
|
|
3718
|
+
})();
|
|
3719
|
+
}
|
|
3720
|
+
var personalization_container_default = PersonalizationContainer;
|
|
3721
|
+
|
|
3722
|
+
// src/blocks/section/component-info.ts
|
|
3723
|
+
var componentInfo7 = {
|
|
3248
3724
|
name: "Core:Section",
|
|
3249
3725
|
static: true,
|
|
3250
3726
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -3286,7 +3762,7 @@ var componentInfo6 = {
|
|
|
3286
3762
|
};
|
|
3287
3763
|
|
|
3288
3764
|
// src/blocks/slot/component-info.ts
|
|
3289
|
-
var
|
|
3765
|
+
var componentInfo8 = {
|
|
3290
3766
|
name: "Slot",
|
|
3291
3767
|
isRSC: true,
|
|
3292
3768
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -3304,10 +3780,10 @@ var componentInfo7 = {
|
|
|
3304
3780
|
builderComponents: true
|
|
3305
3781
|
}
|
|
3306
3782
|
};
|
|
3307
|
-
var _tmpl$
|
|
3783
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
3308
3784
|
function Slot(props) {
|
|
3309
3785
|
return (() => {
|
|
3310
|
-
const _el$ = _tmpl$
|
|
3786
|
+
const _el$ = _tmpl$10();
|
|
3311
3787
|
_el$.style.setProperty("pointer-events", "auto");
|
|
3312
3788
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
3313
3789
|
"builder-slot": props.name
|
|
@@ -3335,7 +3811,7 @@ function Slot(props) {
|
|
|
3335
3811
|
var slot_default = Slot;
|
|
3336
3812
|
|
|
3337
3813
|
// src/blocks/symbol/component-info.ts
|
|
3338
|
-
var
|
|
3814
|
+
var componentInfo9 = {
|
|
3339
3815
|
name: "Symbol",
|
|
3340
3816
|
noWrap: true,
|
|
3341
3817
|
static: true,
|
|
@@ -3417,7 +3893,7 @@ var defaultElement = {
|
|
|
3417
3893
|
}
|
|
3418
3894
|
}
|
|
3419
3895
|
};
|
|
3420
|
-
var
|
|
3896
|
+
var componentInfo10 = {
|
|
3421
3897
|
name: "Builder: Tabs",
|
|
3422
3898
|
inputs: [{
|
|
3423
3899
|
name: "tabs",
|
|
@@ -3521,8 +3997,8 @@ var componentInfo9 = {
|
|
|
3521
3997
|
builderLinkComponent: true
|
|
3522
3998
|
}
|
|
3523
3999
|
};
|
|
3524
|
-
var _tmpl$
|
|
3525
|
-
var _tmpl$
|
|
4000
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
|
|
4001
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
3526
4002
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
3527
4003
|
function Tabs(props) {
|
|
3528
4004
|
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
@@ -3537,7 +4013,7 @@ function Tabs(props) {
|
|
|
3537
4013
|
}
|
|
3538
4014
|
}
|
|
3539
4015
|
return (() => {
|
|
3540
|
-
const _el$ = _tmpl$
|
|
4016
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
|
|
3541
4017
|
_el$2.style.setProperty("display", "flex");
|
|
3542
4018
|
_el$2.style.setProperty("flex-direction", "row");
|
|
3543
4019
|
_el$2.style.setProperty("overflow", "auto");
|
|
@@ -3589,7 +4065,7 @@ function Tabs(props) {
|
|
|
3589
4065
|
return activeTabContent(activeTab());
|
|
3590
4066
|
},
|
|
3591
4067
|
get children() {
|
|
3592
|
-
const _el$3 = _tmpl$
|
|
4068
|
+
const _el$3 = _tmpl$11();
|
|
3593
4069
|
insert(_el$3, createComponent(blocks_default, {
|
|
3594
4070
|
get parent() {
|
|
3595
4071
|
return props.builderBlock.id;
|
|
@@ -3621,7 +4097,7 @@ var tabs_default = Tabs;
|
|
|
3621
4097
|
delegateEvents(["click"]);
|
|
3622
4098
|
|
|
3623
4099
|
// src/blocks/text/component-info.ts
|
|
3624
|
-
var
|
|
4100
|
+
var componentInfo11 = {
|
|
3625
4101
|
shouldReceiveBuilderProps: {
|
|
3626
4102
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3627
4103
|
builderContext: true
|
|
@@ -3644,10 +4120,10 @@ var componentInfo10 = {
|
|
|
3644
4120
|
textAlign: "center"
|
|
3645
4121
|
}
|
|
3646
4122
|
};
|
|
3647
|
-
var _tmpl$
|
|
4123
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3648
4124
|
function Text(props) {
|
|
3649
4125
|
return (() => {
|
|
3650
|
-
const _el$ = _tmpl$
|
|
4126
|
+
const _el$ = _tmpl$12();
|
|
3651
4127
|
_el$.style.setProperty("outline", "none");
|
|
3652
4128
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
3653
4129
|
return _el$;
|
|
@@ -3656,7 +4132,7 @@ function Text(props) {
|
|
|
3656
4132
|
var text_default = Text;
|
|
3657
4133
|
|
|
3658
4134
|
// src/blocks/custom-code/component-info.ts
|
|
3659
|
-
var
|
|
4135
|
+
var componentInfo12 = {
|
|
3660
4136
|
name: "Custom Code",
|
|
3661
4137
|
static: true,
|
|
3662
4138
|
requiredPermissions: ["editCode"],
|
|
@@ -3679,7 +4155,7 @@ var componentInfo11 = {
|
|
|
3679
4155
|
advanced: true
|
|
3680
4156
|
}]
|
|
3681
4157
|
};
|
|
3682
|
-
var _tmpl$
|
|
4158
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
3683
4159
|
function CustomCode(props) {
|
|
3684
4160
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3685
4161
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3713,7 +4189,7 @@ function CustomCode(props) {
|
|
|
3713
4189
|
}
|
|
3714
4190
|
});
|
|
3715
4191
|
return (() => {
|
|
3716
|
-
const _el$ = _tmpl$
|
|
4192
|
+
const _el$ = _tmpl$13();
|
|
3717
4193
|
const _ref$ = elementRef;
|
|
3718
4194
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3719
4195
|
effect((_p$) => {
|
|
@@ -3731,7 +4207,7 @@ function CustomCode(props) {
|
|
|
3731
4207
|
var custom_code_default = CustomCode;
|
|
3732
4208
|
|
|
3733
4209
|
// src/blocks/embed/component-info.ts
|
|
3734
|
-
var
|
|
4210
|
+
var componentInfo13 = {
|
|
3735
4211
|
name: "Embed",
|
|
3736
4212
|
static: true,
|
|
3737
4213
|
inputs: [{
|
|
@@ -3753,7 +4229,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
3753
4229
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
3754
4230
|
|
|
3755
4231
|
// src/blocks/embed/embed.tsx
|
|
3756
|
-
var _tmpl$
|
|
4232
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
3757
4233
|
function Embed(props) {
|
|
3758
4234
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3759
4235
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3790,7 +4266,7 @@ function Embed(props) {
|
|
|
3790
4266
|
}
|
|
3791
4267
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
3792
4268
|
return (() => {
|
|
3793
|
-
const _el$ = _tmpl$
|
|
4269
|
+
const _el$ = _tmpl$14();
|
|
3794
4270
|
const _ref$ = elem;
|
|
3795
4271
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
3796
4272
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -3800,7 +4276,7 @@ function Embed(props) {
|
|
|
3800
4276
|
var embed_default = Embed;
|
|
3801
4277
|
|
|
3802
4278
|
// src/blocks/form/form/component-info.ts
|
|
3803
|
-
var
|
|
4279
|
+
var componentInfo14 = {
|
|
3804
4280
|
name: "Form:Form",
|
|
3805
4281
|
// editableTags: ['builder-form-error']
|
|
3806
4282
|
defaults: {
|
|
@@ -4056,8 +4532,8 @@ function logFetch(url) {
|
|
|
4056
4532
|
}
|
|
4057
4533
|
|
|
4058
4534
|
// src/blocks/form/form/form.tsx
|
|
4059
|
-
var _tmpl$
|
|
4060
|
-
var _tmpl$
|
|
4535
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
|
|
4536
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
|
|
4061
4537
|
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
|
|
4062
4538
|
padding: 10px;
|
|
4063
4539
|
color: red;
|
|
@@ -4250,7 +4726,7 @@ function FormComponent(props) {
|
|
|
4250
4726
|
}
|
|
4251
4727
|
let formRef;
|
|
4252
4728
|
return [(() => {
|
|
4253
|
-
const _el$ = _tmpl$
|
|
4729
|
+
const _el$ = _tmpl$27();
|
|
4254
4730
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
4255
4731
|
const _ref$ = formRef;
|
|
4256
4732
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -4306,7 +4782,7 @@ function FormComponent(props) {
|
|
|
4306
4782
|
return memo(() => submissionState() === "error")() && responseData();
|
|
4307
4783
|
},
|
|
4308
4784
|
get children() {
|
|
4309
|
-
const _el$2 = _tmpl$
|
|
4785
|
+
const _el$2 = _tmpl$15();
|
|
4310
4786
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
4311
4787
|
return _el$2;
|
|
4312
4788
|
}
|
|
@@ -4333,7 +4809,7 @@ function FormComponent(props) {
|
|
|
4333
4809
|
var form_default = FormComponent;
|
|
4334
4810
|
|
|
4335
4811
|
// src/blocks/form/input/component-info.ts
|
|
4336
|
-
var
|
|
4812
|
+
var componentInfo15 = {
|
|
4337
4813
|
name: "Form:Input",
|
|
4338
4814
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
4339
4815
|
inputs: [
|
|
@@ -4385,10 +4861,10 @@ var componentInfo14 = {
|
|
|
4385
4861
|
borderColor: "#ccc"
|
|
4386
4862
|
}
|
|
4387
4863
|
};
|
|
4388
|
-
var _tmpl$
|
|
4864
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
|
|
4389
4865
|
function FormInputComponent(props) {
|
|
4390
4866
|
return (() => {
|
|
4391
|
-
const _el$ = _tmpl$
|
|
4867
|
+
const _el$ = _tmpl$16();
|
|
4392
4868
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4393
4869
|
get key() {
|
|
4394
4870
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -4418,7 +4894,7 @@ function FormInputComponent(props) {
|
|
|
4418
4894
|
var input_default = FormInputComponent;
|
|
4419
4895
|
|
|
4420
4896
|
// src/blocks/form/select/component-info.ts
|
|
4421
|
-
var
|
|
4897
|
+
var componentInfo16 = {
|
|
4422
4898
|
name: "Form:Select",
|
|
4423
4899
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
4424
4900
|
defaultStyles: {
|
|
@@ -4461,11 +4937,11 @@ var componentInfo15 = {
|
|
|
4461
4937
|
static: true,
|
|
4462
4938
|
noWrap: true
|
|
4463
4939
|
};
|
|
4464
|
-
var _tmpl$
|
|
4465
|
-
var _tmpl$
|
|
4940
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
|
|
4941
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
|
|
4466
4942
|
function SelectComponent(props) {
|
|
4467
4943
|
return (() => {
|
|
4468
|
-
const _el$ = _tmpl$
|
|
4944
|
+
const _el$ = _tmpl$17();
|
|
4469
4945
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4470
4946
|
get value() {
|
|
4471
4947
|
return props.value;
|
|
@@ -4490,7 +4966,7 @@ function SelectComponent(props) {
|
|
|
4490
4966
|
children: (option, _index) => {
|
|
4491
4967
|
const index = _index();
|
|
4492
4968
|
return (() => {
|
|
4493
|
-
const _el$2 = _tmpl$
|
|
4969
|
+
const _el$2 = _tmpl$28();
|
|
4494
4970
|
insert(_el$2, () => option.name || option.value);
|
|
4495
4971
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
4496
4972
|
effect(() => _el$2.value = option.value);
|
|
@@ -4504,7 +4980,7 @@ function SelectComponent(props) {
|
|
|
4504
4980
|
var select_default = SelectComponent;
|
|
4505
4981
|
|
|
4506
4982
|
// src/blocks/form/submit-button/component-info.ts
|
|
4507
|
-
var
|
|
4983
|
+
var componentInfo17 = {
|
|
4508
4984
|
name: "Form:SubmitButton",
|
|
4509
4985
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
4510
4986
|
defaultStyles: {
|
|
@@ -4530,10 +5006,10 @@ var componentInfo16 = {
|
|
|
4530
5006
|
// TODO: defaultChildren
|
|
4531
5007
|
// canHaveChildren: true,
|
|
4532
5008
|
};
|
|
4533
|
-
var _tmpl$
|
|
5009
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
4534
5010
|
function SubmitButton(props) {
|
|
4535
5011
|
return (() => {
|
|
4536
|
-
const _el$ = _tmpl$
|
|
5012
|
+
const _el$ = _tmpl$18();
|
|
4537
5013
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
4538
5014
|
insert(_el$, () => props.text);
|
|
4539
5015
|
return _el$;
|
|
@@ -4542,7 +5018,7 @@ function SubmitButton(props) {
|
|
|
4542
5018
|
var submit_button_default = SubmitButton;
|
|
4543
5019
|
|
|
4544
5020
|
// src/blocks/form/textarea/component-info.ts
|
|
4545
|
-
var
|
|
5021
|
+
var componentInfo18 = {
|
|
4546
5022
|
name: "Form:TextArea",
|
|
4547
5023
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
4548
5024
|
inputs: [{
|
|
@@ -4579,10 +5055,10 @@ var componentInfo17 = {
|
|
|
4579
5055
|
static: true,
|
|
4580
5056
|
noWrap: true
|
|
4581
5057
|
};
|
|
4582
|
-
var _tmpl$
|
|
5058
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
|
|
4583
5059
|
function Textarea(props) {
|
|
4584
5060
|
return (() => {
|
|
4585
|
-
const _el$ = _tmpl$
|
|
5061
|
+
const _el$ = _tmpl$19();
|
|
4586
5062
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4587
5063
|
get placeholder() {
|
|
4588
5064
|
return props.placeholder;
|
|
@@ -4606,7 +5082,7 @@ function Textarea(props) {
|
|
|
4606
5082
|
var textarea_default = Textarea;
|
|
4607
5083
|
|
|
4608
5084
|
// src/blocks/img/component-info.ts
|
|
4609
|
-
var
|
|
5085
|
+
var componentInfo19 = {
|
|
4610
5086
|
// friendlyName?
|
|
4611
5087
|
name: "Raw:Img",
|
|
4612
5088
|
hideFromInsertMenu: true,
|
|
@@ -4621,10 +5097,10 @@ var componentInfo18 = {
|
|
|
4621
5097
|
noWrap: true,
|
|
4622
5098
|
static: true
|
|
4623
5099
|
};
|
|
4624
|
-
var _tmpl$
|
|
5100
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
4625
5101
|
function ImgComponent(props) {
|
|
4626
5102
|
return (() => {
|
|
4627
|
-
const _el$ = _tmpl$
|
|
5103
|
+
const _el$ = _tmpl$20();
|
|
4628
5104
|
spread(_el$, mergeProps({
|
|
4629
5105
|
get style() {
|
|
4630
5106
|
return {
|
|
@@ -4648,7 +5124,7 @@ function ImgComponent(props) {
|
|
|
4648
5124
|
var img_default = ImgComponent;
|
|
4649
5125
|
|
|
4650
5126
|
// src/blocks/video/component-info.ts
|
|
4651
|
-
var
|
|
5127
|
+
var componentInfo20 = {
|
|
4652
5128
|
name: "Video",
|
|
4653
5129
|
canHaveChildren: true,
|
|
4654
5130
|
defaultStyles: {
|
|
@@ -4733,8 +5209,8 @@ var componentInfo19 = {
|
|
|
4733
5209
|
builderBlock: true
|
|
4734
5210
|
}
|
|
4735
5211
|
};
|
|
4736
|
-
var _tmpl$
|
|
4737
|
-
var _tmpl$
|
|
5212
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
5213
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
4738
5214
|
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
4739
5215
|
function Video(props) {
|
|
4740
5216
|
const videoProps = createMemo(() => {
|
|
@@ -4795,7 +5271,7 @@ function Video(props) {
|
|
|
4795
5271
|
return !props.lazyLoad;
|
|
4796
5272
|
},
|
|
4797
5273
|
get children() {
|
|
4798
|
-
const _el$3 = _tmpl$
|
|
5274
|
+
const _el$3 = _tmpl$21();
|
|
4799
5275
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
4800
5276
|
return _el$3;
|
|
4801
5277
|
}
|
|
@@ -4805,7 +5281,7 @@ function Video(props) {
|
|
|
4805
5281
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
4806
5282
|
},
|
|
4807
5283
|
get children() {
|
|
4808
|
-
const _el$4 = _tmpl$
|
|
5284
|
+
const _el$4 = _tmpl$29();
|
|
4809
5285
|
_el$4.style.setProperty("width", "100%");
|
|
4810
5286
|
_el$4.style.setProperty("pointer-events", "none");
|
|
4811
5287
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -4818,7 +5294,7 @@ function Video(props) {
|
|
|
4818
5294
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
4819
5295
|
},
|
|
4820
5296
|
get children() {
|
|
4821
|
-
const _el$5 = _tmpl$
|
|
5297
|
+
const _el$5 = _tmpl$29();
|
|
4822
5298
|
_el$5.style.setProperty("display", "flex");
|
|
4823
5299
|
_el$5.style.setProperty("flex-direction", "column");
|
|
4824
5300
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -4831,7 +5307,7 @@ function Video(props) {
|
|
|
4831
5307
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
4832
5308
|
},
|
|
4833
5309
|
get children() {
|
|
4834
|
-
const _el$6 = _tmpl$
|
|
5310
|
+
const _el$6 = _tmpl$29();
|
|
4835
5311
|
_el$6.style.setProperty("pointer-events", "none");
|
|
4836
5312
|
_el$6.style.setProperty("display", "flex");
|
|
4837
5313
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -4853,31 +5329,31 @@ var video_default = Video;
|
|
|
4853
5329
|
// src/constants/extra-components.ts
|
|
4854
5330
|
var getExtraComponents = () => [{
|
|
4855
5331
|
component: custom_code_default,
|
|
4856
|
-
...
|
|
5332
|
+
...componentInfo12
|
|
4857
5333
|
}, {
|
|
4858
5334
|
component: embed_default,
|
|
4859
|
-
...
|
|
5335
|
+
...componentInfo13
|
|
4860
5336
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4861
5337
|
component: form_default,
|
|
4862
|
-
...
|
|
5338
|
+
...componentInfo14
|
|
4863
5339
|
}, {
|
|
4864
5340
|
component: input_default,
|
|
4865
|
-
...
|
|
5341
|
+
...componentInfo15
|
|
4866
5342
|
}, {
|
|
4867
5343
|
component: submit_button_default,
|
|
4868
|
-
...
|
|
5344
|
+
...componentInfo17
|
|
4869
5345
|
}, {
|
|
4870
5346
|
component: select_default,
|
|
4871
|
-
...
|
|
5347
|
+
...componentInfo16
|
|
4872
5348
|
}, {
|
|
4873
5349
|
component: textarea_default,
|
|
4874
|
-
...
|
|
5350
|
+
...componentInfo18
|
|
4875
5351
|
}], {
|
|
4876
5352
|
component: img_default,
|
|
4877
|
-
...
|
|
5353
|
+
...componentInfo19
|
|
4878
5354
|
}, {
|
|
4879
5355
|
component: video_default,
|
|
4880
|
-
...
|
|
5356
|
+
...componentInfo20
|
|
4881
5357
|
}];
|
|
4882
5358
|
|
|
4883
5359
|
// src/constants/builder-registered-components.ts
|
|
@@ -4895,19 +5371,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4895
5371
|
...componentInfo5
|
|
4896
5372
|
}, {
|
|
4897
5373
|
component: section_default,
|
|
4898
|
-
...
|
|
5374
|
+
...componentInfo7
|
|
4899
5375
|
}, {
|
|
4900
5376
|
component: slot_default,
|
|
4901
|
-
...
|
|
5377
|
+
...componentInfo8
|
|
4902
5378
|
}, {
|
|
4903
5379
|
component: symbol_default,
|
|
4904
|
-
...
|
|
5380
|
+
...componentInfo9
|
|
4905
5381
|
}, {
|
|
4906
5382
|
component: text_default,
|
|
4907
|
-
...
|
|
4908
|
-
}, ...TARGET === "
|
|
5383
|
+
...componentInfo11
|
|
5384
|
+
}, ...TARGET === "react" ? [{
|
|
5385
|
+
component: personalization_container_default,
|
|
5386
|
+
...componentInfo6
|
|
5387
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
4909
5388
|
component: tabs_default,
|
|
4910
|
-
...
|
|
5389
|
+
...componentInfo10
|
|
4911
5390
|
}, {
|
|
4912
5391
|
component: accordion_default,
|
|
4913
5392
|
...componentInfo
|
|
@@ -4945,7 +5424,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
4945
5424
|
testVariationId: variant.id,
|
|
4946
5425
|
id: content?.id
|
|
4947
5426
|
}));
|
|
4948
|
-
var
|
|
5427
|
+
var checkShouldRenderVariants2 = ({
|
|
4949
5428
|
canTrack,
|
|
4950
5429
|
content
|
|
4951
5430
|
}) => {
|
|
@@ -4978,25 +5457,6 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4978
5457
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4979
5458
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4980
5459
|
)`;
|
|
4981
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
|
|
4982
|
-
function InlinedScript(props) {
|
|
4983
|
-
return (() => {
|
|
4984
|
-
const _el$ = _tmpl$20();
|
|
4985
|
-
effect((_p$) => {
|
|
4986
|
-
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
4987
|
-
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
4988
|
-
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
4989
|
-
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
4990
|
-
return _p$;
|
|
4991
|
-
}, {
|
|
4992
|
-
_v$: void 0,
|
|
4993
|
-
_v$2: void 0,
|
|
4994
|
-
_v$3: void 0
|
|
4995
|
-
});
|
|
4996
|
-
return _el$;
|
|
4997
|
-
})();
|
|
4998
|
-
}
|
|
4999
|
-
var inlined_script_default = InlinedScript;
|
|
5000
5460
|
|
|
5001
5461
|
// src/helpers/preview-lru-cache/get.ts
|
|
5002
5462
|
function getPreviewContent(_searchParams) {
|
|
@@ -5004,7 +5464,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5004
5464
|
}
|
|
5005
5465
|
|
|
5006
5466
|
// src/constants/sdk-version.ts
|
|
5007
|
-
var SDK_VERSION = "3.0.
|
|
5467
|
+
var SDK_VERSION = "3.0.7";
|
|
5008
5468
|
|
|
5009
5469
|
// src/helpers/sdk-headers.ts
|
|
5010
5470
|
var getSdkHeaders = () => ({
|
|
@@ -5299,16 +5759,6 @@ async function fetchEntries(options) {
|
|
|
5299
5759
|
return _processContentResult(options, content);
|
|
5300
5760
|
}
|
|
5301
5761
|
|
|
5302
|
-
// src/functions/is-previewing.ts
|
|
5303
|
-
function isPreviewing(_search) {
|
|
5304
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
5305
|
-
if (!search) {
|
|
5306
|
-
return false;
|
|
5307
|
-
}
|
|
5308
|
-
const normalizedSearch = getSearchString(search);
|
|
5309
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
5310
|
-
}
|
|
5311
|
-
|
|
5312
5762
|
// src/helpers/uuid.ts
|
|
5313
5763
|
function uuidv4() {
|
|
5314
5764
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -5631,7 +6081,9 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
5631
6081
|
// Supports builder-model="..." attribute which is needed to
|
|
5632
6082
|
// scope our '+ add block' button styling
|
|
5633
6083
|
supportsAddBlockScoping: true,
|
|
5634
|
-
supportsCustomBreakpoints: true
|
|
6084
|
+
supportsCustomBreakpoints: true,
|
|
6085
|
+
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
6086
|
+
blockLevelPersonalization: true
|
|
5635
6087
|
}
|
|
5636
6088
|
}, "*");
|
|
5637
6089
|
window.parent?.postMessage({
|
|
@@ -6367,7 +6819,7 @@ var content_default = ContentComponent;
|
|
|
6367
6819
|
|
|
6368
6820
|
// src/components/content-variants/content-variants.tsx
|
|
6369
6821
|
function ContentVariants(props) {
|
|
6370
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
6822
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
|
|
6371
6823
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6372
6824
|
content: props.content
|
|
6373
6825
|
}));
|
|
@@ -6593,7 +7045,7 @@ var fetchSymbolContent = async ({
|
|
|
6593
7045
|
};
|
|
6594
7046
|
|
|
6595
7047
|
// src/blocks/symbol/symbol.tsx
|
|
6596
|
-
var _tmpl$
|
|
7048
|
+
var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
|
|
6597
7049
|
function Symbol(props) {
|
|
6598
7050
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
6599
7051
|
const blocksWrapper = createMemo(() => {
|
|
@@ -6625,7 +7077,7 @@ function Symbol(props) {
|
|
|
6625
7077
|
}
|
|
6626
7078
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6627
7079
|
return (() => {
|
|
6628
|
-
const _el$ = _tmpl$
|
|
7080
|
+
const _el$ = _tmpl$30();
|
|
6629
7081
|
spread(_el$, mergeProps({
|
|
6630
7082
|
get ["class"]() {
|
|
6631
7083
|
return className();
|
|
@@ -6717,4 +7169,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
6717
7169
|
};
|
|
6718
7170
|
};
|
|
6719
7171
|
|
|
6720
|
-
export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
|
|
7172
|
+
export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };
|