@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/node/index.js
CHANGED
|
@@ -1776,7 +1776,7 @@ function Block(props) {
|
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
var block_default = Block;
|
|
1779
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1779
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
|
|
1780
1780
|
display: flex;
|
|
1781
1781
|
flex-direction: column;
|
|
1782
1782
|
align-items: stretch;
|
|
@@ -1789,8 +1789,9 @@ function BlocksWrapper(props) {
|
|
|
1789
1789
|
if (!props.path) {
|
|
1790
1790
|
return void 0;
|
|
1791
1791
|
}
|
|
1792
|
+
const thisPrefix = "this.";
|
|
1792
1793
|
const pathPrefix = "component.options.";
|
|
1793
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1794
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1794
1795
|
});
|
|
1795
1796
|
function onClick() {
|
|
1796
1797
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -1819,7 +1820,7 @@ function BlocksWrapper(props) {
|
|
|
1819
1820
|
});
|
|
1820
1821
|
return [createComponent(Dynamic, mergeProps({
|
|
1821
1822
|
get ["class"]() {
|
|
1822
|
-
return className() + " dynamic-
|
|
1823
|
+
return className() + " dynamic-3d7ff108";
|
|
1823
1824
|
},
|
|
1824
1825
|
ref(r$) {
|
|
1825
1826
|
const _ref$ = blocksWrapperRef;
|
|
@@ -2512,8 +2513,58 @@ var handleABTesting = async ({
|
|
|
2512
2513
|
};
|
|
2513
2514
|
};
|
|
2514
2515
|
|
|
2516
|
+
// src/helpers/user-attributes.ts
|
|
2517
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2518
|
+
function createUserAttributesService() {
|
|
2519
|
+
let canTrack = true;
|
|
2520
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
2521
|
+
return {
|
|
2522
|
+
setUserAttributes(newAttrs) {
|
|
2523
|
+
if (!isBrowser()) {
|
|
2524
|
+
return;
|
|
2525
|
+
}
|
|
2526
|
+
const userAttributes = {
|
|
2527
|
+
...this.getUserAttributes(),
|
|
2528
|
+
...newAttrs
|
|
2529
|
+
};
|
|
2530
|
+
setCookie({
|
|
2531
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2532
|
+
value: JSON.stringify(userAttributes),
|
|
2533
|
+
canTrack
|
|
2534
|
+
});
|
|
2535
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
2536
|
+
},
|
|
2537
|
+
getUserAttributes() {
|
|
2538
|
+
if (!isBrowser()) {
|
|
2539
|
+
return {};
|
|
2540
|
+
}
|
|
2541
|
+
return JSON.parse(getCookieSync({
|
|
2542
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2543
|
+
canTrack
|
|
2544
|
+
}) || "{}");
|
|
2545
|
+
},
|
|
2546
|
+
subscribeOnUserAttributesChange(callback) {
|
|
2547
|
+
subscribers.add(callback);
|
|
2548
|
+
return () => {
|
|
2549
|
+
subscribers.delete(callback);
|
|
2550
|
+
};
|
|
2551
|
+
},
|
|
2552
|
+
setCanTrack(value) {
|
|
2553
|
+
canTrack = value;
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
var userAttributesService = createUserAttributesService();
|
|
2558
|
+
var setClientUserAttributes = (attributes) => {
|
|
2559
|
+
userAttributesService.setUserAttributes(attributes);
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2515
2562
|
// src/helpers/canTrack.ts
|
|
2516
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
2563
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
2564
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
2565
|
+
userAttributesService.setCanTrack(result);
|
|
2566
|
+
return result;
|
|
2567
|
+
};
|
|
2517
2568
|
|
|
2518
2569
|
// src/blocks/accordion/component-info.ts
|
|
2519
2570
|
var defaultTitle = {
|
|
@@ -3243,8 +3294,408 @@ var componentInfo5 = {
|
|
|
3243
3294
|
}
|
|
3244
3295
|
};
|
|
3245
3296
|
|
|
3246
|
-
// src/blocks/
|
|
3297
|
+
// src/blocks/personalization-container/component-info.ts
|
|
3247
3298
|
var componentInfo6 = {
|
|
3299
|
+
name: "PersonalizationContainer",
|
|
3300
|
+
shouldReceiveBuilderProps: {
|
|
3301
|
+
builderBlock: true,
|
|
3302
|
+
builderContext: true
|
|
3303
|
+
},
|
|
3304
|
+
noWrap: true,
|
|
3305
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
3306
|
+
canHaveChildren: true,
|
|
3307
|
+
inputs: [{
|
|
3308
|
+
name: "variants",
|
|
3309
|
+
defaultValue: [],
|
|
3310
|
+
behavior: "personalizationVariantList",
|
|
3311
|
+
type: "list",
|
|
3312
|
+
subFields: [{
|
|
3313
|
+
name: "name",
|
|
3314
|
+
type: "text"
|
|
3315
|
+
}, {
|
|
3316
|
+
name: "query",
|
|
3317
|
+
friendlyName: "Targeting rules",
|
|
3318
|
+
type: "BuilderQuery",
|
|
3319
|
+
defaultValue: []
|
|
3320
|
+
}, {
|
|
3321
|
+
name: "startDate",
|
|
3322
|
+
type: "date"
|
|
3323
|
+
}, {
|
|
3324
|
+
name: "endDate",
|
|
3325
|
+
type: "date"
|
|
3326
|
+
}, {
|
|
3327
|
+
name: "blocks",
|
|
3328
|
+
type: "uiBlocks",
|
|
3329
|
+
hideFromUI: true,
|
|
3330
|
+
defaultValue: []
|
|
3331
|
+
}]
|
|
3332
|
+
}]
|
|
3333
|
+
};
|
|
3334
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
|
|
3335
|
+
function InlinedScript(props) {
|
|
3336
|
+
return (() => {
|
|
3337
|
+
const _el$ = _tmpl$8();
|
|
3338
|
+
effect((_p$) => {
|
|
3339
|
+
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
3340
|
+
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
3341
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
3342
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
3343
|
+
return _p$;
|
|
3344
|
+
}, {
|
|
3345
|
+
_v$: void 0,
|
|
3346
|
+
_v$2: void 0,
|
|
3347
|
+
_v$3: void 0
|
|
3348
|
+
});
|
|
3349
|
+
return _el$;
|
|
3350
|
+
})();
|
|
3351
|
+
}
|
|
3352
|
+
var inlined_script_default = InlinedScript;
|
|
3353
|
+
|
|
3354
|
+
// src/functions/is-previewing.ts
|
|
3355
|
+
function isPreviewing(_search) {
|
|
3356
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
3357
|
+
if (!search) {
|
|
3358
|
+
return false;
|
|
3359
|
+
}
|
|
3360
|
+
const normalizedSearch = getSearchString(search);
|
|
3361
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
3362
|
+
}
|
|
3363
|
+
|
|
3364
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
3365
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
3366
|
+
function isString(val) {
|
|
3367
|
+
return typeof val === "string";
|
|
3368
|
+
}
|
|
3369
|
+
function isNumber(val) {
|
|
3370
|
+
return typeof val === "number";
|
|
3371
|
+
}
|
|
3372
|
+
function objectMatchesQuery(userattr, query2) {
|
|
3373
|
+
const result = (() => {
|
|
3374
|
+
const property = query2.property;
|
|
3375
|
+
const operator = query2.operator;
|
|
3376
|
+
let testValue = query2.value;
|
|
3377
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
3378
|
+
testValue = query2.value.slice(0, -1);
|
|
3379
|
+
}
|
|
3380
|
+
if (!(property && operator)) {
|
|
3381
|
+
return true;
|
|
3382
|
+
}
|
|
3383
|
+
if (Array.isArray(testValue)) {
|
|
3384
|
+
if (operator === "isNot") {
|
|
3385
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
3386
|
+
property,
|
|
3387
|
+
operator,
|
|
3388
|
+
value: val
|
|
3389
|
+
}));
|
|
3390
|
+
}
|
|
3391
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
3392
|
+
property,
|
|
3393
|
+
operator,
|
|
3394
|
+
value: val
|
|
3395
|
+
}));
|
|
3396
|
+
}
|
|
3397
|
+
const value = userattr[property];
|
|
3398
|
+
if (Array.isArray(value)) {
|
|
3399
|
+
return value.includes(testValue);
|
|
3400
|
+
}
|
|
3401
|
+
switch (operator) {
|
|
3402
|
+
case "is":
|
|
3403
|
+
return value === testValue;
|
|
3404
|
+
case "isNot":
|
|
3405
|
+
return value !== testValue;
|
|
3406
|
+
case "contains":
|
|
3407
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
3408
|
+
case "startsWith":
|
|
3409
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
3410
|
+
case "endsWith":
|
|
3411
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
3412
|
+
case "greaterThan":
|
|
3413
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
3414
|
+
case "lessThan":
|
|
3415
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
3416
|
+
case "greaterThanOrEqualTo":
|
|
3417
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
3418
|
+
case "lessThanOrEqualTo":
|
|
3419
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
3420
|
+
default:
|
|
3421
|
+
return false;
|
|
3422
|
+
}
|
|
3423
|
+
})();
|
|
3424
|
+
return result;
|
|
3425
|
+
}
|
|
3426
|
+
const item = {
|
|
3427
|
+
query,
|
|
3428
|
+
startDate,
|
|
3429
|
+
endDate
|
|
3430
|
+
};
|
|
3431
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
3432
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
3433
|
+
return false;
|
|
3434
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
3435
|
+
return false;
|
|
3436
|
+
}
|
|
3437
|
+
if (!item.query || !item.query.length) {
|
|
3438
|
+
return true;
|
|
3439
|
+
}
|
|
3440
|
+
return item.query.every((filter) => {
|
|
3441
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
3442
|
+
});
|
|
3443
|
+
}
|
|
3444
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
3445
|
+
if (!navigator.cookieEnabled) {
|
|
3446
|
+
return;
|
|
3447
|
+
}
|
|
3448
|
+
function getCookie(name) {
|
|
3449
|
+
const nameEQ = name + '=';
|
|
3450
|
+
const ca = document.cookie.split(';');
|
|
3451
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3452
|
+
let c = ca[i];
|
|
3453
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
3454
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
3455
|
+
}
|
|
3456
|
+
return null;
|
|
3457
|
+
}
|
|
3458
|
+
function removeVariants() {
|
|
3459
|
+
variants?.forEach(function (_, index) {
|
|
3460
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
3461
|
+
});
|
|
3462
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
3463
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
3464
|
+
}
|
|
3465
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
3466
|
+
if (locale) {
|
|
3467
|
+
attributes.locale = locale;
|
|
3468
|
+
}
|
|
3469
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
3470
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
3471
|
+
});
|
|
3472
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
3473
|
+
if (isDebug) {
|
|
3474
|
+
console.debug('PersonalizationContainer', {
|
|
3475
|
+
attributes,
|
|
3476
|
+
variants,
|
|
3477
|
+
winningVariantIndex
|
|
3478
|
+
});
|
|
3479
|
+
}
|
|
3480
|
+
if (winningVariantIndex !== -1) {
|
|
3481
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
3482
|
+
if (winningVariant) {
|
|
3483
|
+
const parentNode = winningVariant.parentNode;
|
|
3484
|
+
if (parentNode) {
|
|
3485
|
+
const newParent = parentNode.cloneNode(false);
|
|
3486
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
3487
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
3488
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
3489
|
+
}
|
|
3490
|
+
if (isDebug) {
|
|
3491
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
} else if (variants && variants.length > 0) {
|
|
3495
|
+
removeVariants();
|
|
3496
|
+
}
|
|
3497
|
+
}`;
|
|
3498
|
+
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}";
|
|
3499
|
+
|
|
3500
|
+
// src/blocks/personalization-container/helpers.ts
|
|
3501
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
3502
|
+
const hasVariants = variants && variants.length > 0;
|
|
3503
|
+
if (TARGET === "reactNative")
|
|
3504
|
+
return false;
|
|
3505
|
+
if (!hasVariants)
|
|
3506
|
+
return false;
|
|
3507
|
+
if (!canTrack)
|
|
3508
|
+
return false;
|
|
3509
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
3510
|
+
return true;
|
|
3511
|
+
if (isBrowser())
|
|
3512
|
+
return false;
|
|
3513
|
+
return true;
|
|
3514
|
+
}
|
|
3515
|
+
function getBlocksToRender({
|
|
3516
|
+
variants,
|
|
3517
|
+
previewingIndex,
|
|
3518
|
+
isHydrated,
|
|
3519
|
+
filteredVariants,
|
|
3520
|
+
fallbackBlocks
|
|
3521
|
+
}) {
|
|
3522
|
+
const fallback = {
|
|
3523
|
+
blocks: fallbackBlocks ?? [],
|
|
3524
|
+
path: "this.children"
|
|
3525
|
+
};
|
|
3526
|
+
if (isHydrated && isEditing()) {
|
|
3527
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
3528
|
+
const variant = variants[previewingIndex];
|
|
3529
|
+
return {
|
|
3530
|
+
blocks: variant.blocks,
|
|
3531
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
3532
|
+
};
|
|
3533
|
+
}
|
|
3534
|
+
return fallback;
|
|
3535
|
+
}
|
|
3536
|
+
if (isBrowser()) {
|
|
3537
|
+
const winningVariant = filteredVariants?.[0];
|
|
3538
|
+
if (winningVariant) {
|
|
3539
|
+
return {
|
|
3540
|
+
blocks: winningVariant.blocks,
|
|
3541
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
3542
|
+
};
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
return fallback;
|
|
3546
|
+
}
|
|
3547
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
3548
|
+
return `
|
|
3549
|
+
(function() {
|
|
3550
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
3551
|
+
${PERSONALIZATION_SCRIPT}
|
|
3552
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
3553
|
+
})();
|
|
3554
|
+
`;
|
|
3555
|
+
};
|
|
3556
|
+
|
|
3557
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
3558
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
3559
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
|
|
3560
|
+
function PersonalizationContainer(props) {
|
|
3561
|
+
const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
|
|
3562
|
+
const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
|
|
3563
|
+
const [unsubscribers, setUnsubscribers] = createSignal([]);
|
|
3564
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
|
|
3565
|
+
const [isHydrated, setIsHydrated] = createSignal(false);
|
|
3566
|
+
const filteredVariants = createMemo(() => {
|
|
3567
|
+
return (props.variants || []).filter((variant) => {
|
|
3568
|
+
return filterWithCustomTargeting({
|
|
3569
|
+
...props.builderContext?.rootState?.locale ? {
|
|
3570
|
+
locale: props.builderContext?.rootState?.locale
|
|
3571
|
+
} : {},
|
|
3572
|
+
...userAttributes()
|
|
3573
|
+
}, variant.query, variant.startDate, variant.endDate);
|
|
3574
|
+
});
|
|
3575
|
+
});
|
|
3576
|
+
const blocksToRender = createMemo(() => {
|
|
3577
|
+
return getBlocksToRender({
|
|
3578
|
+
variants: props.variants,
|
|
3579
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
3580
|
+
isHydrated: isHydrated(),
|
|
3581
|
+
filteredVariants: filteredVariants(),
|
|
3582
|
+
previewingIndex: props.previewingIndex
|
|
3583
|
+
});
|
|
3584
|
+
});
|
|
3585
|
+
const hideVariantsStyleString = createMemo(() => {
|
|
3586
|
+
return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
|
|
3587
|
+
});
|
|
3588
|
+
let rootRef;
|
|
3589
|
+
onMount(() => {
|
|
3590
|
+
setIsHydrated(true);
|
|
3591
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
|
|
3592
|
+
setUserAttributes(attrs);
|
|
3593
|
+
});
|
|
3594
|
+
if (!(isEditing() || isPreviewing())) {
|
|
3595
|
+
const variant = filteredVariants()[0];
|
|
3596
|
+
if (rootRef) {
|
|
3597
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
|
|
3598
|
+
detail: {
|
|
3599
|
+
variant: variant || "default",
|
|
3600
|
+
content: props.builderContext?.content
|
|
3601
|
+
},
|
|
3602
|
+
bubbles: true
|
|
3603
|
+
}));
|
|
3604
|
+
const observer = new IntersectionObserver((entries) => {
|
|
3605
|
+
entries.forEach((entry) => {
|
|
3606
|
+
if (entry.isIntersecting && rootRef) {
|
|
3607
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
|
|
3608
|
+
detail: {
|
|
3609
|
+
variant: variant || "default",
|
|
3610
|
+
content: props.builderContext?.content
|
|
3611
|
+
},
|
|
3612
|
+
bubbles: true
|
|
3613
|
+
}));
|
|
3614
|
+
}
|
|
3615
|
+
});
|
|
3616
|
+
});
|
|
3617
|
+
observer.observe(rootRef);
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
unsubscribers().push(unsub);
|
|
3621
|
+
});
|
|
3622
|
+
return (() => {
|
|
3623
|
+
const _el$ = _tmpl$9();
|
|
3624
|
+
const _ref$ = rootRef;
|
|
3625
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
|
|
3626
|
+
spread(_el$, mergeProps({
|
|
3627
|
+
get ["class"]() {
|
|
3628
|
+
return `builder-personalization-container ${props.attributes?.className || ""}`;
|
|
3629
|
+
}
|
|
3630
|
+
}, () => props.attributes), false, true);
|
|
3631
|
+
insert(_el$, createComponent(Show, {
|
|
3632
|
+
get when() {
|
|
3633
|
+
return shouldRenderVariants();
|
|
3634
|
+
},
|
|
3635
|
+
get children() {
|
|
3636
|
+
return [createComponent(For, {
|
|
3637
|
+
get each() {
|
|
3638
|
+
return props.variants;
|
|
3639
|
+
},
|
|
3640
|
+
children: (variant, _index) => {
|
|
3641
|
+
const index = _index();
|
|
3642
|
+
return (() => {
|
|
3643
|
+
const _el$2 = _tmpl$25();
|
|
3644
|
+
setAttribute(_el$2, "key", index);
|
|
3645
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
3646
|
+
get blocks() {
|
|
3647
|
+
return variant.blocks;
|
|
3648
|
+
},
|
|
3649
|
+
get parent() {
|
|
3650
|
+
return props.builderBlock?.id;
|
|
3651
|
+
},
|
|
3652
|
+
path: `component.options.variants.${index}.blocks`
|
|
3653
|
+
}));
|
|
3654
|
+
effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
|
|
3655
|
+
return _el$2;
|
|
3656
|
+
})();
|
|
3657
|
+
}
|
|
3658
|
+
}), createComponent(inlined_styles_default, {
|
|
3659
|
+
get nonce() {
|
|
3660
|
+
return props.builderContext?.nonce || "";
|
|
3661
|
+
},
|
|
3662
|
+
get styles() {
|
|
3663
|
+
return hideVariantsStyleString();
|
|
3664
|
+
},
|
|
3665
|
+
get id() {
|
|
3666
|
+
return `variants-styles-${props.builderBlock?.id}`;
|
|
3667
|
+
}
|
|
3668
|
+
}), createComponent(inlined_script_default, {
|
|
3669
|
+
get nonce() {
|
|
3670
|
+
return props.builderContext?.nonce || "";
|
|
3671
|
+
},
|
|
3672
|
+
get scriptStr() {
|
|
3673
|
+
return scriptStr();
|
|
3674
|
+
},
|
|
3675
|
+
get id() {
|
|
3676
|
+
return `variants-script-${props.builderBlock?.id}`;
|
|
3677
|
+
}
|
|
3678
|
+
})];
|
|
3679
|
+
}
|
|
3680
|
+
}), null);
|
|
3681
|
+
insert(_el$, createComponent(blocks_default, {
|
|
3682
|
+
get blocks() {
|
|
3683
|
+
return blocksToRender().blocks;
|
|
3684
|
+
},
|
|
3685
|
+
get parent() {
|
|
3686
|
+
return props.builderBlock?.id;
|
|
3687
|
+
},
|
|
3688
|
+
get path() {
|
|
3689
|
+
return blocksToRender().path;
|
|
3690
|
+
}
|
|
3691
|
+
}), null);
|
|
3692
|
+
return _el$;
|
|
3693
|
+
})();
|
|
3694
|
+
}
|
|
3695
|
+
var personalization_container_default = PersonalizationContainer;
|
|
3696
|
+
|
|
3697
|
+
// src/blocks/section/component-info.ts
|
|
3698
|
+
var componentInfo7 = {
|
|
3248
3699
|
name: "Core:Section",
|
|
3249
3700
|
static: true,
|
|
3250
3701
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -3286,7 +3737,7 @@ var componentInfo6 = {
|
|
|
3286
3737
|
};
|
|
3287
3738
|
|
|
3288
3739
|
// src/blocks/slot/component-info.ts
|
|
3289
|
-
var
|
|
3740
|
+
var componentInfo8 = {
|
|
3290
3741
|
name: "Slot",
|
|
3291
3742
|
isRSC: true,
|
|
3292
3743
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -3304,10 +3755,10 @@ var componentInfo7 = {
|
|
|
3304
3755
|
builderComponents: true
|
|
3305
3756
|
}
|
|
3306
3757
|
};
|
|
3307
|
-
var _tmpl$
|
|
3758
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
3308
3759
|
function Slot(props) {
|
|
3309
3760
|
return (() => {
|
|
3310
|
-
const _el$ = _tmpl$
|
|
3761
|
+
const _el$ = _tmpl$10();
|
|
3311
3762
|
_el$.style.setProperty("pointer-events", "auto");
|
|
3312
3763
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
3313
3764
|
"builder-slot": props.name
|
|
@@ -3335,7 +3786,7 @@ function Slot(props) {
|
|
|
3335
3786
|
var slot_default = Slot;
|
|
3336
3787
|
|
|
3337
3788
|
// src/blocks/symbol/component-info.ts
|
|
3338
|
-
var
|
|
3789
|
+
var componentInfo9 = {
|
|
3339
3790
|
name: "Symbol",
|
|
3340
3791
|
noWrap: true,
|
|
3341
3792
|
static: true,
|
|
@@ -3417,7 +3868,7 @@ var defaultElement = {
|
|
|
3417
3868
|
}
|
|
3418
3869
|
}
|
|
3419
3870
|
};
|
|
3420
|
-
var
|
|
3871
|
+
var componentInfo10 = {
|
|
3421
3872
|
name: "Builder: Tabs",
|
|
3422
3873
|
inputs: [{
|
|
3423
3874
|
name: "tabs",
|
|
@@ -3521,8 +3972,8 @@ var componentInfo9 = {
|
|
|
3521
3972
|
builderLinkComponent: true
|
|
3522
3973
|
}
|
|
3523
3974
|
};
|
|
3524
|
-
var _tmpl$
|
|
3525
|
-
var _tmpl$
|
|
3975
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
|
|
3976
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
3526
3977
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
3527
3978
|
function Tabs(props) {
|
|
3528
3979
|
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
@@ -3537,7 +3988,7 @@ function Tabs(props) {
|
|
|
3537
3988
|
}
|
|
3538
3989
|
}
|
|
3539
3990
|
return (() => {
|
|
3540
|
-
const _el$ = _tmpl$
|
|
3991
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
|
|
3541
3992
|
_el$2.style.setProperty("display", "flex");
|
|
3542
3993
|
_el$2.style.setProperty("flex-direction", "row");
|
|
3543
3994
|
_el$2.style.setProperty("overflow", "auto");
|
|
@@ -3589,7 +4040,7 @@ function Tabs(props) {
|
|
|
3589
4040
|
return activeTabContent(activeTab());
|
|
3590
4041
|
},
|
|
3591
4042
|
get children() {
|
|
3592
|
-
const _el$3 = _tmpl$
|
|
4043
|
+
const _el$3 = _tmpl$11();
|
|
3593
4044
|
insert(_el$3, createComponent(blocks_default, {
|
|
3594
4045
|
get parent() {
|
|
3595
4046
|
return props.builderBlock.id;
|
|
@@ -3621,7 +4072,7 @@ var tabs_default = Tabs;
|
|
|
3621
4072
|
delegateEvents(["click"]);
|
|
3622
4073
|
|
|
3623
4074
|
// src/blocks/text/component-info.ts
|
|
3624
|
-
var
|
|
4075
|
+
var componentInfo11 = {
|
|
3625
4076
|
shouldReceiveBuilderProps: {
|
|
3626
4077
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3627
4078
|
builderContext: true
|
|
@@ -3644,10 +4095,10 @@ var componentInfo10 = {
|
|
|
3644
4095
|
textAlign: "center"
|
|
3645
4096
|
}
|
|
3646
4097
|
};
|
|
3647
|
-
var _tmpl$
|
|
4098
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3648
4099
|
function Text(props) {
|
|
3649
4100
|
return (() => {
|
|
3650
|
-
const _el$ = _tmpl$
|
|
4101
|
+
const _el$ = _tmpl$12();
|
|
3651
4102
|
_el$.style.setProperty("outline", "none");
|
|
3652
4103
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
3653
4104
|
return _el$;
|
|
@@ -3656,7 +4107,7 @@ function Text(props) {
|
|
|
3656
4107
|
var text_default = Text;
|
|
3657
4108
|
|
|
3658
4109
|
// src/blocks/custom-code/component-info.ts
|
|
3659
|
-
var
|
|
4110
|
+
var componentInfo12 = {
|
|
3660
4111
|
name: "Custom Code",
|
|
3661
4112
|
static: true,
|
|
3662
4113
|
requiredPermissions: ["editCode"],
|
|
@@ -3679,7 +4130,7 @@ var componentInfo11 = {
|
|
|
3679
4130
|
advanced: true
|
|
3680
4131
|
}]
|
|
3681
4132
|
};
|
|
3682
|
-
var _tmpl$
|
|
4133
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
3683
4134
|
function CustomCode(props) {
|
|
3684
4135
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3685
4136
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3713,7 +4164,7 @@ function CustomCode(props) {
|
|
|
3713
4164
|
}
|
|
3714
4165
|
});
|
|
3715
4166
|
return (() => {
|
|
3716
|
-
const _el$ = _tmpl$
|
|
4167
|
+
const _el$ = _tmpl$13();
|
|
3717
4168
|
const _ref$ = elementRef;
|
|
3718
4169
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3719
4170
|
effect((_p$) => {
|
|
@@ -3731,7 +4182,7 @@ function CustomCode(props) {
|
|
|
3731
4182
|
var custom_code_default = CustomCode;
|
|
3732
4183
|
|
|
3733
4184
|
// src/blocks/embed/component-info.ts
|
|
3734
|
-
var
|
|
4185
|
+
var componentInfo13 = {
|
|
3735
4186
|
name: "Embed",
|
|
3736
4187
|
static: true,
|
|
3737
4188
|
inputs: [{
|
|
@@ -3753,7 +4204,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
3753
4204
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
3754
4205
|
|
|
3755
4206
|
// src/blocks/embed/embed.tsx
|
|
3756
|
-
var _tmpl$
|
|
4207
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
3757
4208
|
function Embed(props) {
|
|
3758
4209
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3759
4210
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3790,7 +4241,7 @@ function Embed(props) {
|
|
|
3790
4241
|
}
|
|
3791
4242
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
3792
4243
|
return (() => {
|
|
3793
|
-
const _el$ = _tmpl$
|
|
4244
|
+
const _el$ = _tmpl$14();
|
|
3794
4245
|
const _ref$ = elem;
|
|
3795
4246
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
3796
4247
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -3800,7 +4251,7 @@ function Embed(props) {
|
|
|
3800
4251
|
var embed_default = Embed;
|
|
3801
4252
|
|
|
3802
4253
|
// src/blocks/form/form/component-info.ts
|
|
3803
|
-
var
|
|
4254
|
+
var componentInfo14 = {
|
|
3804
4255
|
name: "Form:Form",
|
|
3805
4256
|
// editableTags: ['builder-form-error']
|
|
3806
4257
|
defaults: {
|
|
@@ -4056,8 +4507,8 @@ function logFetch(url) {
|
|
|
4056
4507
|
}
|
|
4057
4508
|
|
|
4058
4509
|
// src/blocks/form/form/form.tsx
|
|
4059
|
-
var _tmpl$
|
|
4060
|
-
var _tmpl$
|
|
4510
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
|
|
4511
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
|
|
4061
4512
|
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
|
|
4062
4513
|
padding: 10px;
|
|
4063
4514
|
color: red;
|
|
@@ -4250,7 +4701,7 @@ function FormComponent(props) {
|
|
|
4250
4701
|
}
|
|
4251
4702
|
let formRef;
|
|
4252
4703
|
return [(() => {
|
|
4253
|
-
const _el$ = _tmpl$
|
|
4704
|
+
const _el$ = _tmpl$27();
|
|
4254
4705
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
4255
4706
|
const _ref$ = formRef;
|
|
4256
4707
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -4306,7 +4757,7 @@ function FormComponent(props) {
|
|
|
4306
4757
|
return memo(() => submissionState() === "error")() && responseData();
|
|
4307
4758
|
},
|
|
4308
4759
|
get children() {
|
|
4309
|
-
const _el$2 = _tmpl$
|
|
4760
|
+
const _el$2 = _tmpl$15();
|
|
4310
4761
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
4311
4762
|
return _el$2;
|
|
4312
4763
|
}
|
|
@@ -4333,7 +4784,7 @@ function FormComponent(props) {
|
|
|
4333
4784
|
var form_default = FormComponent;
|
|
4334
4785
|
|
|
4335
4786
|
// src/blocks/form/input/component-info.ts
|
|
4336
|
-
var
|
|
4787
|
+
var componentInfo15 = {
|
|
4337
4788
|
name: "Form:Input",
|
|
4338
4789
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
4339
4790
|
inputs: [
|
|
@@ -4385,10 +4836,10 @@ var componentInfo14 = {
|
|
|
4385
4836
|
borderColor: "#ccc"
|
|
4386
4837
|
}
|
|
4387
4838
|
};
|
|
4388
|
-
var _tmpl$
|
|
4839
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
|
|
4389
4840
|
function FormInputComponent(props) {
|
|
4390
4841
|
return (() => {
|
|
4391
|
-
const _el$ = _tmpl$
|
|
4842
|
+
const _el$ = _tmpl$16();
|
|
4392
4843
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4393
4844
|
get key() {
|
|
4394
4845
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -4418,7 +4869,7 @@ function FormInputComponent(props) {
|
|
|
4418
4869
|
var input_default = FormInputComponent;
|
|
4419
4870
|
|
|
4420
4871
|
// src/blocks/form/select/component-info.ts
|
|
4421
|
-
var
|
|
4872
|
+
var componentInfo16 = {
|
|
4422
4873
|
name: "Form:Select",
|
|
4423
4874
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
4424
4875
|
defaultStyles: {
|
|
@@ -4461,11 +4912,11 @@ var componentInfo15 = {
|
|
|
4461
4912
|
static: true,
|
|
4462
4913
|
noWrap: true
|
|
4463
4914
|
};
|
|
4464
|
-
var _tmpl$
|
|
4465
|
-
var _tmpl$
|
|
4915
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
|
|
4916
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
|
|
4466
4917
|
function SelectComponent(props) {
|
|
4467
4918
|
return (() => {
|
|
4468
|
-
const _el$ = _tmpl$
|
|
4919
|
+
const _el$ = _tmpl$17();
|
|
4469
4920
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4470
4921
|
get value() {
|
|
4471
4922
|
return props.value;
|
|
@@ -4490,7 +4941,7 @@ function SelectComponent(props) {
|
|
|
4490
4941
|
children: (option, _index) => {
|
|
4491
4942
|
const index = _index();
|
|
4492
4943
|
return (() => {
|
|
4493
|
-
const _el$2 = _tmpl$
|
|
4944
|
+
const _el$2 = _tmpl$28();
|
|
4494
4945
|
insert(_el$2, () => option.name || option.value);
|
|
4495
4946
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
4496
4947
|
effect(() => _el$2.value = option.value);
|
|
@@ -4504,7 +4955,7 @@ function SelectComponent(props) {
|
|
|
4504
4955
|
var select_default = SelectComponent;
|
|
4505
4956
|
|
|
4506
4957
|
// src/blocks/form/submit-button/component-info.ts
|
|
4507
|
-
var
|
|
4958
|
+
var componentInfo17 = {
|
|
4508
4959
|
name: "Form:SubmitButton",
|
|
4509
4960
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
4510
4961
|
defaultStyles: {
|
|
@@ -4530,10 +4981,10 @@ var componentInfo16 = {
|
|
|
4530
4981
|
// TODO: defaultChildren
|
|
4531
4982
|
// canHaveChildren: true,
|
|
4532
4983
|
};
|
|
4533
|
-
var _tmpl$
|
|
4984
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
4534
4985
|
function SubmitButton(props) {
|
|
4535
4986
|
return (() => {
|
|
4536
|
-
const _el$ = _tmpl$
|
|
4987
|
+
const _el$ = _tmpl$18();
|
|
4537
4988
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
4538
4989
|
insert(_el$, () => props.text);
|
|
4539
4990
|
return _el$;
|
|
@@ -4542,7 +4993,7 @@ function SubmitButton(props) {
|
|
|
4542
4993
|
var submit_button_default = SubmitButton;
|
|
4543
4994
|
|
|
4544
4995
|
// src/blocks/form/textarea/component-info.ts
|
|
4545
|
-
var
|
|
4996
|
+
var componentInfo18 = {
|
|
4546
4997
|
name: "Form:TextArea",
|
|
4547
4998
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
4548
4999
|
inputs: [{
|
|
@@ -4579,10 +5030,10 @@ var componentInfo17 = {
|
|
|
4579
5030
|
static: true,
|
|
4580
5031
|
noWrap: true
|
|
4581
5032
|
};
|
|
4582
|
-
var _tmpl$
|
|
5033
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
|
|
4583
5034
|
function Textarea(props) {
|
|
4584
5035
|
return (() => {
|
|
4585
|
-
const _el$ = _tmpl$
|
|
5036
|
+
const _el$ = _tmpl$19();
|
|
4586
5037
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4587
5038
|
get placeholder() {
|
|
4588
5039
|
return props.placeholder;
|
|
@@ -4606,7 +5057,7 @@ function Textarea(props) {
|
|
|
4606
5057
|
var textarea_default = Textarea;
|
|
4607
5058
|
|
|
4608
5059
|
// src/blocks/img/component-info.ts
|
|
4609
|
-
var
|
|
5060
|
+
var componentInfo19 = {
|
|
4610
5061
|
// friendlyName?
|
|
4611
5062
|
name: "Raw:Img",
|
|
4612
5063
|
hideFromInsertMenu: true,
|
|
@@ -4621,10 +5072,10 @@ var componentInfo18 = {
|
|
|
4621
5072
|
noWrap: true,
|
|
4622
5073
|
static: true
|
|
4623
5074
|
};
|
|
4624
|
-
var _tmpl$
|
|
5075
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
4625
5076
|
function ImgComponent(props) {
|
|
4626
5077
|
return (() => {
|
|
4627
|
-
const _el$ = _tmpl$
|
|
5078
|
+
const _el$ = _tmpl$20();
|
|
4628
5079
|
spread(_el$, mergeProps({
|
|
4629
5080
|
get style() {
|
|
4630
5081
|
return {
|
|
@@ -4648,7 +5099,7 @@ function ImgComponent(props) {
|
|
|
4648
5099
|
var img_default = ImgComponent;
|
|
4649
5100
|
|
|
4650
5101
|
// src/blocks/video/component-info.ts
|
|
4651
|
-
var
|
|
5102
|
+
var componentInfo20 = {
|
|
4652
5103
|
name: "Video",
|
|
4653
5104
|
canHaveChildren: true,
|
|
4654
5105
|
defaultStyles: {
|
|
@@ -4733,8 +5184,8 @@ var componentInfo19 = {
|
|
|
4733
5184
|
builderBlock: true
|
|
4734
5185
|
}
|
|
4735
5186
|
};
|
|
4736
|
-
var _tmpl$
|
|
4737
|
-
var _tmpl$
|
|
5187
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
5188
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
4738
5189
|
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
4739
5190
|
function Video(props) {
|
|
4740
5191
|
const videoProps = createMemo(() => {
|
|
@@ -4795,7 +5246,7 @@ function Video(props) {
|
|
|
4795
5246
|
return !props.lazyLoad;
|
|
4796
5247
|
},
|
|
4797
5248
|
get children() {
|
|
4798
|
-
const _el$3 = _tmpl$
|
|
5249
|
+
const _el$3 = _tmpl$21();
|
|
4799
5250
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
4800
5251
|
return _el$3;
|
|
4801
5252
|
}
|
|
@@ -4805,7 +5256,7 @@ function Video(props) {
|
|
|
4805
5256
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
4806
5257
|
},
|
|
4807
5258
|
get children() {
|
|
4808
|
-
const _el$4 = _tmpl$
|
|
5259
|
+
const _el$4 = _tmpl$29();
|
|
4809
5260
|
_el$4.style.setProperty("width", "100%");
|
|
4810
5261
|
_el$4.style.setProperty("pointer-events", "none");
|
|
4811
5262
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -4818,7 +5269,7 @@ function Video(props) {
|
|
|
4818
5269
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
4819
5270
|
},
|
|
4820
5271
|
get children() {
|
|
4821
|
-
const _el$5 = _tmpl$
|
|
5272
|
+
const _el$5 = _tmpl$29();
|
|
4822
5273
|
_el$5.style.setProperty("display", "flex");
|
|
4823
5274
|
_el$5.style.setProperty("flex-direction", "column");
|
|
4824
5275
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -4831,7 +5282,7 @@ function Video(props) {
|
|
|
4831
5282
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
4832
5283
|
},
|
|
4833
5284
|
get children() {
|
|
4834
|
-
const _el$6 = _tmpl$
|
|
5285
|
+
const _el$6 = _tmpl$29();
|
|
4835
5286
|
_el$6.style.setProperty("pointer-events", "none");
|
|
4836
5287
|
_el$6.style.setProperty("display", "flex");
|
|
4837
5288
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -4853,31 +5304,31 @@ var video_default = Video;
|
|
|
4853
5304
|
// src/constants/extra-components.ts
|
|
4854
5305
|
var getExtraComponents = () => [{
|
|
4855
5306
|
component: custom_code_default,
|
|
4856
|
-
...
|
|
5307
|
+
...componentInfo12
|
|
4857
5308
|
}, {
|
|
4858
5309
|
component: embed_default,
|
|
4859
|
-
...
|
|
5310
|
+
...componentInfo13
|
|
4860
5311
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4861
5312
|
component: form_default,
|
|
4862
|
-
...
|
|
5313
|
+
...componentInfo14
|
|
4863
5314
|
}, {
|
|
4864
5315
|
component: input_default,
|
|
4865
|
-
...
|
|
5316
|
+
...componentInfo15
|
|
4866
5317
|
}, {
|
|
4867
5318
|
component: submit_button_default,
|
|
4868
|
-
...
|
|
5319
|
+
...componentInfo17
|
|
4869
5320
|
}, {
|
|
4870
5321
|
component: select_default,
|
|
4871
|
-
...
|
|
5322
|
+
...componentInfo16
|
|
4872
5323
|
}, {
|
|
4873
5324
|
component: textarea_default,
|
|
4874
|
-
...
|
|
5325
|
+
...componentInfo18
|
|
4875
5326
|
}], {
|
|
4876
5327
|
component: img_default,
|
|
4877
|
-
...
|
|
5328
|
+
...componentInfo19
|
|
4878
5329
|
}, {
|
|
4879
5330
|
component: video_default,
|
|
4880
|
-
...
|
|
5331
|
+
...componentInfo20
|
|
4881
5332
|
}];
|
|
4882
5333
|
|
|
4883
5334
|
// src/constants/builder-registered-components.ts
|
|
@@ -4895,19 +5346,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4895
5346
|
...componentInfo5
|
|
4896
5347
|
}, {
|
|
4897
5348
|
component: section_default,
|
|
4898
|
-
...
|
|
5349
|
+
...componentInfo7
|
|
4899
5350
|
}, {
|
|
4900
5351
|
component: slot_default,
|
|
4901
|
-
...
|
|
5352
|
+
...componentInfo8
|
|
4902
5353
|
}, {
|
|
4903
5354
|
component: symbol_default,
|
|
4904
|
-
...
|
|
5355
|
+
...componentInfo9
|
|
4905
5356
|
}, {
|
|
4906
5357
|
component: text_default,
|
|
4907
|
-
...
|
|
4908
|
-
}, ...TARGET === "
|
|
5358
|
+
...componentInfo11
|
|
5359
|
+
}, ...TARGET === "react" ? [{
|
|
5360
|
+
component: personalization_container_default,
|
|
5361
|
+
...componentInfo6
|
|
5362
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
4909
5363
|
component: tabs_default,
|
|
4910
|
-
...
|
|
5364
|
+
...componentInfo10
|
|
4911
5365
|
}, {
|
|
4912
5366
|
component: accordion_default,
|
|
4913
5367
|
...componentInfo
|
|
@@ -4945,7 +5399,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
4945
5399
|
testVariationId: variant.id,
|
|
4946
5400
|
id: content?.id
|
|
4947
5401
|
}));
|
|
4948
|
-
var
|
|
5402
|
+
var checkShouldRenderVariants2 = ({
|
|
4949
5403
|
canTrack,
|
|
4950
5404
|
content
|
|
4951
5405
|
}) => {
|
|
@@ -4978,25 +5432,6 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4978
5432
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4979
5433
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4980
5434
|
)`;
|
|
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
5435
|
|
|
5001
5436
|
// src/helpers/preview-lru-cache/get.ts
|
|
5002
5437
|
function getPreviewContent(_searchParams) {
|
|
@@ -5004,7 +5439,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5004
5439
|
}
|
|
5005
5440
|
|
|
5006
5441
|
// src/constants/sdk-version.ts
|
|
5007
|
-
var SDK_VERSION = "3.0.
|
|
5442
|
+
var SDK_VERSION = "3.0.6";
|
|
5008
5443
|
|
|
5009
5444
|
// src/helpers/sdk-headers.ts
|
|
5010
5445
|
var getSdkHeaders = () => ({
|
|
@@ -5299,16 +5734,6 @@ async function fetchEntries(options) {
|
|
|
5299
5734
|
return _processContentResult(options, content);
|
|
5300
5735
|
}
|
|
5301
5736
|
|
|
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
5737
|
// src/helpers/uuid.ts
|
|
5313
5738
|
function uuidv4() {
|
|
5314
5739
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -5631,7 +6056,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
5631
6056
|
// Supports builder-model="..." attribute which is needed to
|
|
5632
6057
|
// scope our '+ add block' button styling
|
|
5633
6058
|
supportsAddBlockScoping: true,
|
|
5634
|
-
supportsCustomBreakpoints: true
|
|
6059
|
+
supportsCustomBreakpoints: true,
|
|
6060
|
+
blockLevelPersonalization: true
|
|
5635
6061
|
}
|
|
5636
6062
|
}, "*");
|
|
5637
6063
|
window.parent?.postMessage({
|
|
@@ -6367,7 +6793,7 @@ var content_default = ContentComponent;
|
|
|
6367
6793
|
|
|
6368
6794
|
// src/components/content-variants/content-variants.tsx
|
|
6369
6795
|
function ContentVariants(props) {
|
|
6370
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
6796
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
|
|
6371
6797
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6372
6798
|
content: props.content
|
|
6373
6799
|
}));
|
|
@@ -6593,7 +7019,7 @@ var fetchSymbolContent = async ({
|
|
|
6593
7019
|
};
|
|
6594
7020
|
|
|
6595
7021
|
// src/blocks/symbol/symbol.tsx
|
|
6596
|
-
var _tmpl$
|
|
7022
|
+
var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
|
|
6597
7023
|
function Symbol(props) {
|
|
6598
7024
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
6599
7025
|
const blocksWrapper = createMemo(() => {
|
|
@@ -6625,7 +7051,7 @@ function Symbol(props) {
|
|
|
6625
7051
|
}
|
|
6626
7052
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6627
7053
|
return (() => {
|
|
6628
|
-
const _el$ = _tmpl$
|
|
7054
|
+
const _el$ = _tmpl$30();
|
|
6629
7055
|
spread(_el$, mergeProps({
|
|
6630
7056
|
get ["class"]() {
|
|
6631
7057
|
return className();
|
|
@@ -6717,4 +7143,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
6717
7143
|
};
|
|
6718
7144
|
};
|
|
6719
7145
|
|
|
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 };
|
|
7146
|
+
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 };
|