@builder.io/sdk-solid 3.0.3 → 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 +9 -3
- package/lib/browser/dev.js +543 -147
- package/lib/browser/dev.jsx +562 -158
- package/lib/browser/index.js +543 -147
- package/lib/browser/index.jsx +562 -158
- package/lib/edge/dev.js +543 -147
- package/lib/edge/dev.jsx +562 -158
- package/lib/edge/index.js +543 -147
- package/lib/edge/index.jsx +562 -158
- package/lib/node/dev.js +543 -147
- package/lib/node/dev.jsx +562 -158
- package/lib/node/index.js +543 -147
- package/lib/node/index.jsx +562 -158
- package/package.json +1 -1
package/lib/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
2
|
-
import { createContext, useContext, Show, For, createMemo,
|
|
2
|
+
import { createContext, useContext, Show, For, createMemo, createSignal, onMount, createEffect, on } from 'solid-js';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
|
|
5
5
|
// src/blocks/button/button.tsx
|
|
@@ -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;
|
|
@@ -1918,7 +1919,7 @@ var getColumnsClass = (id) => {
|
|
|
1918
1919
|
|
|
1919
1920
|
// src/blocks/columns/columns.tsx
|
|
1920
1921
|
var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
|
|
1921
|
-
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-
|
|
1922
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
|
|
1922
1923
|
display: flex;
|
|
1923
1924
|
line-height: normal;
|
|
1924
1925
|
}`);
|
|
@@ -2047,7 +2048,7 @@ function Columns(props) {
|
|
|
2047
2048
|
const _el$ = _tmpl$3();
|
|
2048
2049
|
spread(_el$, mergeProps({
|
|
2049
2050
|
get ["class"]() {
|
|
2050
|
-
return getColumnsClass(props.builderBlock?.id) + " div-
|
|
2051
|
+
return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
|
|
2051
2052
|
},
|
|
2052
2053
|
get style() {
|
|
2053
2054
|
return columnsCssVars();
|
|
@@ -2088,9 +2089,6 @@ function Columns(props) {
|
|
|
2088
2089
|
get parent() {
|
|
2089
2090
|
return props.builderBlock.id;
|
|
2090
2091
|
},
|
|
2091
|
-
styleProp: {
|
|
2092
|
-
flexGrow: "1"
|
|
2093
|
-
},
|
|
2094
2092
|
get context() {
|
|
2095
2093
|
return props.builderContext;
|
|
2096
2094
|
},
|
|
@@ -2102,6 +2100,9 @@ function Columns(props) {
|
|
|
2102
2100
|
},
|
|
2103
2101
|
get blocks() {
|
|
2104
2102
|
return column.blocks;
|
|
2103
|
+
},
|
|
2104
|
+
styleProp: {
|
|
2105
|
+
"flex-grow": "1"
|
|
2105
2106
|
}
|
|
2106
2107
|
});
|
|
2107
2108
|
}
|
|
@@ -2172,16 +2173,16 @@ function getSrcSet(url) {
|
|
|
2172
2173
|
// src/blocks/image/image.tsx
|
|
2173
2174
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
2174
2175
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
2175
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
2176
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
2177
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
2176
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
|
|
2177
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
|
|
2178
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
|
|
2178
2179
|
opacity: 1;
|
|
2179
2180
|
transition: opacity 0.2s ease-in-out;
|
|
2180
|
-
}.div-
|
|
2181
|
+
}.div-dc6700b4 {
|
|
2181
2182
|
width: 100%;
|
|
2182
2183
|
pointer-events: none;
|
|
2183
2184
|
font-size: 0;
|
|
2184
|
-
}.div-
|
|
2185
|
+
}.div-dc6700b4-2 {
|
|
2185
2186
|
display: flex;
|
|
2186
2187
|
flex-direction: column;
|
|
2187
2188
|
align-items: stretch;
|
|
@@ -2230,8 +2231,6 @@ function Image(props) {
|
|
|
2230
2231
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
2231
2232
|
return out;
|
|
2232
2233
|
});
|
|
2233
|
-
onMount(() => {
|
|
2234
|
-
});
|
|
2235
2234
|
return [[(() => {
|
|
2236
2235
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
2237
2236
|
insert(_el$, createComponent(Show, {
|
|
@@ -2245,7 +2244,7 @@ function Image(props) {
|
|
|
2245
2244
|
}
|
|
2246
2245
|
}), _el$3);
|
|
2247
2246
|
effect((_p$) => {
|
|
2248
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
2247
|
+
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
|
|
2249
2248
|
"object-position": props.backgroundPosition || "center",
|
|
2250
2249
|
"object-fit": props.backgroundSize || "cover",
|
|
2251
2250
|
...aspectRatioCss()
|
|
@@ -2514,8 +2513,58 @@ var handleABTesting = async ({
|
|
|
2514
2513
|
};
|
|
2515
2514
|
};
|
|
2516
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
|
+
|
|
2517
2562
|
// src/helpers/canTrack.ts
|
|
2518
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
2563
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
2564
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
2565
|
+
userAttributesService.setCanTrack(result);
|
|
2566
|
+
return result;
|
|
2567
|
+
};
|
|
2519
2568
|
|
|
2520
2569
|
// src/blocks/accordion/component-info.ts
|
|
2521
2570
|
var defaultTitle = {
|
|
@@ -3245,8 +3294,408 @@ var componentInfo5 = {
|
|
|
3245
3294
|
}
|
|
3246
3295
|
};
|
|
3247
3296
|
|
|
3248
|
-
// src/blocks/
|
|
3297
|
+
// src/blocks/personalization-container/component-info.ts
|
|
3249
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 = {
|
|
3250
3699
|
name: "Core:Section",
|
|
3251
3700
|
static: true,
|
|
3252
3701
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -3288,7 +3737,7 @@ var componentInfo6 = {
|
|
|
3288
3737
|
};
|
|
3289
3738
|
|
|
3290
3739
|
// src/blocks/slot/component-info.ts
|
|
3291
|
-
var
|
|
3740
|
+
var componentInfo8 = {
|
|
3292
3741
|
name: "Slot",
|
|
3293
3742
|
isRSC: true,
|
|
3294
3743
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -3306,10 +3755,10 @@ var componentInfo7 = {
|
|
|
3306
3755
|
builderComponents: true
|
|
3307
3756
|
}
|
|
3308
3757
|
};
|
|
3309
|
-
var _tmpl$
|
|
3758
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
3310
3759
|
function Slot(props) {
|
|
3311
3760
|
return (() => {
|
|
3312
|
-
const _el$ = _tmpl$
|
|
3761
|
+
const _el$ = _tmpl$10();
|
|
3313
3762
|
_el$.style.setProperty("pointer-events", "auto");
|
|
3314
3763
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
3315
3764
|
"builder-slot": props.name
|
|
@@ -3337,7 +3786,7 @@ function Slot(props) {
|
|
|
3337
3786
|
var slot_default = Slot;
|
|
3338
3787
|
|
|
3339
3788
|
// src/blocks/symbol/component-info.ts
|
|
3340
|
-
var
|
|
3789
|
+
var componentInfo9 = {
|
|
3341
3790
|
name: "Symbol",
|
|
3342
3791
|
noWrap: true,
|
|
3343
3792
|
static: true,
|
|
@@ -3419,7 +3868,7 @@ var defaultElement = {
|
|
|
3419
3868
|
}
|
|
3420
3869
|
}
|
|
3421
3870
|
};
|
|
3422
|
-
var
|
|
3871
|
+
var componentInfo10 = {
|
|
3423
3872
|
name: "Builder: Tabs",
|
|
3424
3873
|
inputs: [{
|
|
3425
3874
|
name: "tabs",
|
|
@@ -3523,8 +3972,8 @@ var componentInfo9 = {
|
|
|
3523
3972
|
builderLinkComponent: true
|
|
3524
3973
|
}
|
|
3525
3974
|
};
|
|
3526
|
-
var _tmpl$
|
|
3527
|
-
var _tmpl$
|
|
3975
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
|
|
3976
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
3528
3977
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
3529
3978
|
function Tabs(props) {
|
|
3530
3979
|
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
@@ -3539,7 +3988,7 @@ function Tabs(props) {
|
|
|
3539
3988
|
}
|
|
3540
3989
|
}
|
|
3541
3990
|
return (() => {
|
|
3542
|
-
const _el$ = _tmpl$
|
|
3991
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
|
|
3543
3992
|
_el$2.style.setProperty("display", "flex");
|
|
3544
3993
|
_el$2.style.setProperty("flex-direction", "row");
|
|
3545
3994
|
_el$2.style.setProperty("overflow", "auto");
|
|
@@ -3591,7 +4040,7 @@ function Tabs(props) {
|
|
|
3591
4040
|
return activeTabContent(activeTab());
|
|
3592
4041
|
},
|
|
3593
4042
|
get children() {
|
|
3594
|
-
const _el$3 = _tmpl$
|
|
4043
|
+
const _el$3 = _tmpl$11();
|
|
3595
4044
|
insert(_el$3, createComponent(blocks_default, {
|
|
3596
4045
|
get parent() {
|
|
3597
4046
|
return props.builderBlock.id;
|
|
@@ -3623,7 +4072,7 @@ var tabs_default = Tabs;
|
|
|
3623
4072
|
delegateEvents(["click"]);
|
|
3624
4073
|
|
|
3625
4074
|
// src/blocks/text/component-info.ts
|
|
3626
|
-
var
|
|
4075
|
+
var componentInfo11 = {
|
|
3627
4076
|
shouldReceiveBuilderProps: {
|
|
3628
4077
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3629
4078
|
builderContext: true
|
|
@@ -3646,10 +4095,10 @@ var componentInfo10 = {
|
|
|
3646
4095
|
textAlign: "center"
|
|
3647
4096
|
}
|
|
3648
4097
|
};
|
|
3649
|
-
var _tmpl$
|
|
4098
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3650
4099
|
function Text(props) {
|
|
3651
4100
|
return (() => {
|
|
3652
|
-
const _el$ = _tmpl$
|
|
4101
|
+
const _el$ = _tmpl$12();
|
|
3653
4102
|
_el$.style.setProperty("outline", "none");
|
|
3654
4103
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
3655
4104
|
return _el$;
|
|
@@ -3658,7 +4107,7 @@ function Text(props) {
|
|
|
3658
4107
|
var text_default = Text;
|
|
3659
4108
|
|
|
3660
4109
|
// src/blocks/custom-code/component-info.ts
|
|
3661
|
-
var
|
|
4110
|
+
var componentInfo12 = {
|
|
3662
4111
|
name: "Custom Code",
|
|
3663
4112
|
static: true,
|
|
3664
4113
|
requiredPermissions: ["editCode"],
|
|
@@ -3681,7 +4130,7 @@ var componentInfo11 = {
|
|
|
3681
4130
|
advanced: true
|
|
3682
4131
|
}]
|
|
3683
4132
|
};
|
|
3684
|
-
var _tmpl$
|
|
4133
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
3685
4134
|
function CustomCode(props) {
|
|
3686
4135
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3687
4136
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3715,7 +4164,7 @@ function CustomCode(props) {
|
|
|
3715
4164
|
}
|
|
3716
4165
|
});
|
|
3717
4166
|
return (() => {
|
|
3718
|
-
const _el$ = _tmpl$
|
|
4167
|
+
const _el$ = _tmpl$13();
|
|
3719
4168
|
const _ref$ = elementRef;
|
|
3720
4169
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3721
4170
|
effect((_p$) => {
|
|
@@ -3733,7 +4182,7 @@ function CustomCode(props) {
|
|
|
3733
4182
|
var custom_code_default = CustomCode;
|
|
3734
4183
|
|
|
3735
4184
|
// src/blocks/embed/component-info.ts
|
|
3736
|
-
var
|
|
4185
|
+
var componentInfo13 = {
|
|
3737
4186
|
name: "Embed",
|
|
3738
4187
|
static: true,
|
|
3739
4188
|
inputs: [{
|
|
@@ -3755,7 +4204,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
3755
4204
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
3756
4205
|
|
|
3757
4206
|
// src/blocks/embed/embed.tsx
|
|
3758
|
-
var _tmpl$
|
|
4207
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
3759
4208
|
function Embed(props) {
|
|
3760
4209
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3761
4210
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3792,7 +4241,7 @@ function Embed(props) {
|
|
|
3792
4241
|
}
|
|
3793
4242
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
3794
4243
|
return (() => {
|
|
3795
|
-
const _el$ = _tmpl$
|
|
4244
|
+
const _el$ = _tmpl$14();
|
|
3796
4245
|
const _ref$ = elem;
|
|
3797
4246
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
3798
4247
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -3802,7 +4251,7 @@ function Embed(props) {
|
|
|
3802
4251
|
var embed_default = Embed;
|
|
3803
4252
|
|
|
3804
4253
|
// src/blocks/form/form/component-info.ts
|
|
3805
|
-
var
|
|
4254
|
+
var componentInfo14 = {
|
|
3806
4255
|
name: "Form:Form",
|
|
3807
4256
|
// editableTags: ['builder-form-error']
|
|
3808
4257
|
defaults: {
|
|
@@ -4058,9 +4507,9 @@ function logFetch(url) {
|
|
|
4058
4507
|
}
|
|
4059
4508
|
|
|
4060
4509
|
// src/blocks/form/form/form.tsx
|
|
4061
|
-
var _tmpl$
|
|
4062
|
-
var _tmpl$
|
|
4063
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4510
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
|
|
4511
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
|
|
4512
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
|
|
4064
4513
|
padding: 10px;
|
|
4065
4514
|
color: red;
|
|
4066
4515
|
text-align: center;
|
|
@@ -4252,7 +4701,7 @@ function FormComponent(props) {
|
|
|
4252
4701
|
}
|
|
4253
4702
|
let formRef;
|
|
4254
4703
|
return [(() => {
|
|
4255
|
-
const _el$ = _tmpl$
|
|
4704
|
+
const _el$ = _tmpl$27();
|
|
4256
4705
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
4257
4706
|
const _ref$ = formRef;
|
|
4258
4707
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -4270,34 +4719,7 @@ function FormComponent(props) {
|
|
|
4270
4719
|
return props.name;
|
|
4271
4720
|
}
|
|
4272
4721
|
}, {}, {}, () => props.attributes), false, true);
|
|
4273
|
-
insert(_el$,
|
|
4274
|
-
get when() {
|
|
4275
|
-
return props.builderBlock && props.builderBlock.children;
|
|
4276
|
-
},
|
|
4277
|
-
get children() {
|
|
4278
|
-
return createComponent(For, {
|
|
4279
|
-
get each() {
|
|
4280
|
-
return props.builderBlock?.children;
|
|
4281
|
-
},
|
|
4282
|
-
children: (block, _index) => {
|
|
4283
|
-
const idx = _index();
|
|
4284
|
-
return createComponent(block_default, {
|
|
4285
|
-
key: `form-block-${idx}`,
|
|
4286
|
-
block,
|
|
4287
|
-
get context() {
|
|
4288
|
-
return props.builderContext;
|
|
4289
|
-
},
|
|
4290
|
-
get registeredComponents() {
|
|
4291
|
-
return props.builderComponents;
|
|
4292
|
-
},
|
|
4293
|
-
get linkComponent() {
|
|
4294
|
-
return props.builderLinkComponent;
|
|
4295
|
-
}
|
|
4296
|
-
});
|
|
4297
|
-
}
|
|
4298
|
-
});
|
|
4299
|
-
}
|
|
4300
|
-
}), null);
|
|
4722
|
+
insert(_el$, () => props.children, null);
|
|
4301
4723
|
insert(_el$, createComponent(Show, {
|
|
4302
4724
|
get when() {
|
|
4303
4725
|
return submissionState() === "error";
|
|
@@ -4335,7 +4757,7 @@ function FormComponent(props) {
|
|
|
4335
4757
|
return memo(() => submissionState() === "error")() && responseData();
|
|
4336
4758
|
},
|
|
4337
4759
|
get children() {
|
|
4338
|
-
const _el$2 = _tmpl$
|
|
4760
|
+
const _el$2 = _tmpl$15();
|
|
4339
4761
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
4340
4762
|
return _el$2;
|
|
4341
4763
|
}
|
|
@@ -4362,7 +4784,7 @@ function FormComponent(props) {
|
|
|
4362
4784
|
var form_default = FormComponent;
|
|
4363
4785
|
|
|
4364
4786
|
// src/blocks/form/input/component-info.ts
|
|
4365
|
-
var
|
|
4787
|
+
var componentInfo15 = {
|
|
4366
4788
|
name: "Form:Input",
|
|
4367
4789
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
4368
4790
|
inputs: [
|
|
@@ -4414,10 +4836,10 @@ var componentInfo14 = {
|
|
|
4414
4836
|
borderColor: "#ccc"
|
|
4415
4837
|
}
|
|
4416
4838
|
};
|
|
4417
|
-
var _tmpl$
|
|
4839
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
|
|
4418
4840
|
function FormInputComponent(props) {
|
|
4419
4841
|
return (() => {
|
|
4420
|
-
const _el$ = _tmpl$
|
|
4842
|
+
const _el$ = _tmpl$16();
|
|
4421
4843
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4422
4844
|
get key() {
|
|
4423
4845
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -4447,7 +4869,7 @@ function FormInputComponent(props) {
|
|
|
4447
4869
|
var input_default = FormInputComponent;
|
|
4448
4870
|
|
|
4449
4871
|
// src/blocks/form/select/component-info.ts
|
|
4450
|
-
var
|
|
4872
|
+
var componentInfo16 = {
|
|
4451
4873
|
name: "Form:Select",
|
|
4452
4874
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
4453
4875
|
defaultStyles: {
|
|
@@ -4490,11 +4912,11 @@ var componentInfo15 = {
|
|
|
4490
4912
|
static: true,
|
|
4491
4913
|
noWrap: true
|
|
4492
4914
|
};
|
|
4493
|
-
var _tmpl$
|
|
4494
|
-
var _tmpl$
|
|
4915
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
|
|
4916
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
|
|
4495
4917
|
function SelectComponent(props) {
|
|
4496
4918
|
return (() => {
|
|
4497
|
-
const _el$ = _tmpl$
|
|
4919
|
+
const _el$ = _tmpl$17();
|
|
4498
4920
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4499
4921
|
get value() {
|
|
4500
4922
|
return props.value;
|
|
@@ -4519,7 +4941,7 @@ function SelectComponent(props) {
|
|
|
4519
4941
|
children: (option, _index) => {
|
|
4520
4942
|
const index = _index();
|
|
4521
4943
|
return (() => {
|
|
4522
|
-
const _el$2 = _tmpl$
|
|
4944
|
+
const _el$2 = _tmpl$28();
|
|
4523
4945
|
insert(_el$2, () => option.name || option.value);
|
|
4524
4946
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
4525
4947
|
effect(() => _el$2.value = option.value);
|
|
@@ -4533,7 +4955,7 @@ function SelectComponent(props) {
|
|
|
4533
4955
|
var select_default = SelectComponent;
|
|
4534
4956
|
|
|
4535
4957
|
// src/blocks/form/submit-button/component-info.ts
|
|
4536
|
-
var
|
|
4958
|
+
var componentInfo17 = {
|
|
4537
4959
|
name: "Form:SubmitButton",
|
|
4538
4960
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
4539
4961
|
defaultStyles: {
|
|
@@ -4559,10 +4981,10 @@ var componentInfo16 = {
|
|
|
4559
4981
|
// TODO: defaultChildren
|
|
4560
4982
|
// canHaveChildren: true,
|
|
4561
4983
|
};
|
|
4562
|
-
var _tmpl$
|
|
4984
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
4563
4985
|
function SubmitButton(props) {
|
|
4564
4986
|
return (() => {
|
|
4565
|
-
const _el$ = _tmpl$
|
|
4987
|
+
const _el$ = _tmpl$18();
|
|
4566
4988
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
4567
4989
|
insert(_el$, () => props.text);
|
|
4568
4990
|
return _el$;
|
|
@@ -4571,7 +4993,7 @@ function SubmitButton(props) {
|
|
|
4571
4993
|
var submit_button_default = SubmitButton;
|
|
4572
4994
|
|
|
4573
4995
|
// src/blocks/form/textarea/component-info.ts
|
|
4574
|
-
var
|
|
4996
|
+
var componentInfo18 = {
|
|
4575
4997
|
name: "Form:TextArea",
|
|
4576
4998
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
4577
4999
|
inputs: [{
|
|
@@ -4608,10 +5030,10 @@ var componentInfo17 = {
|
|
|
4608
5030
|
static: true,
|
|
4609
5031
|
noWrap: true
|
|
4610
5032
|
};
|
|
4611
|
-
var _tmpl$
|
|
5033
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
|
|
4612
5034
|
function Textarea(props) {
|
|
4613
5035
|
return (() => {
|
|
4614
|
-
const _el$ = _tmpl$
|
|
5036
|
+
const _el$ = _tmpl$19();
|
|
4615
5037
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4616
5038
|
get placeholder() {
|
|
4617
5039
|
return props.placeholder;
|
|
@@ -4635,7 +5057,7 @@ function Textarea(props) {
|
|
|
4635
5057
|
var textarea_default = Textarea;
|
|
4636
5058
|
|
|
4637
5059
|
// src/blocks/img/component-info.ts
|
|
4638
|
-
var
|
|
5060
|
+
var componentInfo19 = {
|
|
4639
5061
|
// friendlyName?
|
|
4640
5062
|
name: "Raw:Img",
|
|
4641
5063
|
hideFromInsertMenu: true,
|
|
@@ -4650,10 +5072,10 @@ var componentInfo18 = {
|
|
|
4650
5072
|
noWrap: true,
|
|
4651
5073
|
static: true
|
|
4652
5074
|
};
|
|
4653
|
-
var _tmpl$
|
|
5075
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
4654
5076
|
function ImgComponent(props) {
|
|
4655
5077
|
return (() => {
|
|
4656
|
-
const _el$ = _tmpl$
|
|
5078
|
+
const _el$ = _tmpl$20();
|
|
4657
5079
|
spread(_el$, mergeProps({
|
|
4658
5080
|
get style() {
|
|
4659
5081
|
return {
|
|
@@ -4677,7 +5099,7 @@ function ImgComponent(props) {
|
|
|
4677
5099
|
var img_default = ImgComponent;
|
|
4678
5100
|
|
|
4679
5101
|
// src/blocks/video/component-info.ts
|
|
4680
|
-
var
|
|
5102
|
+
var componentInfo20 = {
|
|
4681
5103
|
name: "Video",
|
|
4682
5104
|
canHaveChildren: true,
|
|
4683
5105
|
defaultStyles: {
|
|
@@ -4762,8 +5184,8 @@ var componentInfo19 = {
|
|
|
4762
5184
|
builderBlock: true
|
|
4763
5185
|
}
|
|
4764
5186
|
};
|
|
4765
|
-
var _tmpl$
|
|
4766
|
-
var _tmpl$
|
|
5187
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
5188
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
4767
5189
|
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
4768
5190
|
function Video(props) {
|
|
4769
5191
|
const videoProps = createMemo(() => {
|
|
@@ -4806,7 +5228,6 @@ function Video(props) {
|
|
|
4806
5228
|
"object-position": props.position,
|
|
4807
5229
|
// Hack to get object fit to work as expected and
|
|
4808
5230
|
// not have the video overflow
|
|
4809
|
-
"z-index": 2,
|
|
4810
5231
|
"border-radius": "1px",
|
|
4811
5232
|
...props.aspectRatio ? {
|
|
4812
5233
|
position: "absolute"
|
|
@@ -4825,7 +5246,7 @@ function Video(props) {
|
|
|
4825
5246
|
return !props.lazyLoad;
|
|
4826
5247
|
},
|
|
4827
5248
|
get children() {
|
|
4828
|
-
const _el$3 = _tmpl$
|
|
5249
|
+
const _el$3 = _tmpl$21();
|
|
4829
5250
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
4830
5251
|
return _el$3;
|
|
4831
5252
|
}
|
|
@@ -4835,7 +5256,7 @@ function Video(props) {
|
|
|
4835
5256
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
4836
5257
|
},
|
|
4837
5258
|
get children() {
|
|
4838
|
-
const _el$4 = _tmpl$
|
|
5259
|
+
const _el$4 = _tmpl$29();
|
|
4839
5260
|
_el$4.style.setProperty("width", "100%");
|
|
4840
5261
|
_el$4.style.setProperty("pointer-events", "none");
|
|
4841
5262
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -4848,7 +5269,7 @@ function Video(props) {
|
|
|
4848
5269
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
4849
5270
|
},
|
|
4850
5271
|
get children() {
|
|
4851
|
-
const _el$5 = _tmpl$
|
|
5272
|
+
const _el$5 = _tmpl$29();
|
|
4852
5273
|
_el$5.style.setProperty("display", "flex");
|
|
4853
5274
|
_el$5.style.setProperty("flex-direction", "column");
|
|
4854
5275
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -4861,7 +5282,7 @@ function Video(props) {
|
|
|
4861
5282
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
4862
5283
|
},
|
|
4863
5284
|
get children() {
|
|
4864
|
-
const _el$6 = _tmpl$
|
|
5285
|
+
const _el$6 = _tmpl$29();
|
|
4865
5286
|
_el$6.style.setProperty("pointer-events", "none");
|
|
4866
5287
|
_el$6.style.setProperty("display", "flex");
|
|
4867
5288
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -4883,31 +5304,31 @@ var video_default = Video;
|
|
|
4883
5304
|
// src/constants/extra-components.ts
|
|
4884
5305
|
var getExtraComponents = () => [{
|
|
4885
5306
|
component: custom_code_default,
|
|
4886
|
-
...
|
|
5307
|
+
...componentInfo12
|
|
4887
5308
|
}, {
|
|
4888
5309
|
component: embed_default,
|
|
4889
|
-
...
|
|
5310
|
+
...componentInfo13
|
|
4890
5311
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4891
5312
|
component: form_default,
|
|
4892
|
-
...
|
|
5313
|
+
...componentInfo14
|
|
4893
5314
|
}, {
|
|
4894
5315
|
component: input_default,
|
|
4895
|
-
...
|
|
5316
|
+
...componentInfo15
|
|
4896
5317
|
}, {
|
|
4897
5318
|
component: submit_button_default,
|
|
4898
|
-
...
|
|
5319
|
+
...componentInfo17
|
|
4899
5320
|
}, {
|
|
4900
5321
|
component: select_default,
|
|
4901
|
-
...
|
|
5322
|
+
...componentInfo16
|
|
4902
5323
|
}, {
|
|
4903
5324
|
component: textarea_default,
|
|
4904
|
-
...
|
|
5325
|
+
...componentInfo18
|
|
4905
5326
|
}], {
|
|
4906
5327
|
component: img_default,
|
|
4907
|
-
...
|
|
5328
|
+
...componentInfo19
|
|
4908
5329
|
}, {
|
|
4909
5330
|
component: video_default,
|
|
4910
|
-
...
|
|
5331
|
+
...componentInfo20
|
|
4911
5332
|
}];
|
|
4912
5333
|
|
|
4913
5334
|
// src/constants/builder-registered-components.ts
|
|
@@ -4925,19 +5346,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4925
5346
|
...componentInfo5
|
|
4926
5347
|
}, {
|
|
4927
5348
|
component: section_default,
|
|
4928
|
-
...
|
|
5349
|
+
...componentInfo7
|
|
4929
5350
|
}, {
|
|
4930
5351
|
component: slot_default,
|
|
4931
|
-
...
|
|
5352
|
+
...componentInfo8
|
|
4932
5353
|
}, {
|
|
4933
5354
|
component: symbol_default,
|
|
4934
|
-
...
|
|
5355
|
+
...componentInfo9
|
|
4935
5356
|
}, {
|
|
4936
5357
|
component: text_default,
|
|
4937
|
-
...
|
|
4938
|
-
}, ...TARGET === "
|
|
5358
|
+
...componentInfo11
|
|
5359
|
+
}, ...TARGET === "react" ? [{
|
|
5360
|
+
component: personalization_container_default,
|
|
5361
|
+
...componentInfo6
|
|
5362
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
4939
5363
|
component: tabs_default,
|
|
4940
|
-
...
|
|
5364
|
+
...componentInfo10
|
|
4941
5365
|
}, {
|
|
4942
5366
|
component: accordion_default,
|
|
4943
5367
|
...componentInfo
|
|
@@ -4975,7 +5399,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
4975
5399
|
testVariationId: variant.id,
|
|
4976
5400
|
id: content?.id
|
|
4977
5401
|
}));
|
|
4978
|
-
var
|
|
5402
|
+
var checkShouldRenderVariants2 = ({
|
|
4979
5403
|
canTrack,
|
|
4980
5404
|
content
|
|
4981
5405
|
}) => {
|
|
@@ -5008,25 +5432,6 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
5008
5432
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
5009
5433
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
5010
5434
|
)`;
|
|
5011
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
|
|
5012
|
-
function InlinedScript(props) {
|
|
5013
|
-
return (() => {
|
|
5014
|
-
const _el$ = _tmpl$20();
|
|
5015
|
-
effect((_p$) => {
|
|
5016
|
-
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
5017
|
-
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
5018
|
-
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
5019
|
-
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
5020
|
-
return _p$;
|
|
5021
|
-
}, {
|
|
5022
|
-
_v$: void 0,
|
|
5023
|
-
_v$2: void 0,
|
|
5024
|
-
_v$3: void 0
|
|
5025
|
-
});
|
|
5026
|
-
return _el$;
|
|
5027
|
-
})();
|
|
5028
|
-
}
|
|
5029
|
-
var inlined_script_default = InlinedScript;
|
|
5030
5435
|
|
|
5031
5436
|
// src/helpers/preview-lru-cache/get.ts
|
|
5032
5437
|
function getPreviewContent(_searchParams) {
|
|
@@ -5034,7 +5439,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5034
5439
|
}
|
|
5035
5440
|
|
|
5036
5441
|
// src/constants/sdk-version.ts
|
|
5037
|
-
var SDK_VERSION = "3.0.
|
|
5442
|
+
var SDK_VERSION = "3.0.6";
|
|
5038
5443
|
|
|
5039
5444
|
// src/helpers/sdk-headers.ts
|
|
5040
5445
|
var getSdkHeaders = () => ({
|
|
@@ -5329,16 +5734,6 @@ async function fetchEntries(options) {
|
|
|
5329
5734
|
return _processContentResult(options, content);
|
|
5330
5735
|
}
|
|
5331
5736
|
|
|
5332
|
-
// src/functions/is-previewing.ts
|
|
5333
|
-
function isPreviewing(_search) {
|
|
5334
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
5335
|
-
if (!search) {
|
|
5336
|
-
return false;
|
|
5337
|
-
}
|
|
5338
|
-
const normalizedSearch = getSearchString(search);
|
|
5339
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
5340
|
-
}
|
|
5341
|
-
|
|
5342
5737
|
// src/helpers/uuid.ts
|
|
5343
5738
|
function uuidv4() {
|
|
5344
5739
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -5661,7 +6056,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
5661
6056
|
// Supports builder-model="..." attribute which is needed to
|
|
5662
6057
|
// scope our '+ add block' button styling
|
|
5663
6058
|
supportsAddBlockScoping: true,
|
|
5664
|
-
supportsCustomBreakpoints: true
|
|
6059
|
+
supportsCustomBreakpoints: true,
|
|
6060
|
+
blockLevelPersonalization: true
|
|
5665
6061
|
}
|
|
5666
6062
|
}, "*");
|
|
5667
6063
|
window.parent?.postMessage({
|
|
@@ -6397,7 +6793,7 @@ var content_default = ContentComponent;
|
|
|
6397
6793
|
|
|
6398
6794
|
// src/components/content-variants/content-variants.tsx
|
|
6399
6795
|
function ContentVariants(props) {
|
|
6400
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
6796
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
|
|
6401
6797
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6402
6798
|
content: props.content
|
|
6403
6799
|
}));
|
|
@@ -6623,7 +7019,7 @@ var fetchSymbolContent = async ({
|
|
|
6623
7019
|
};
|
|
6624
7020
|
|
|
6625
7021
|
// src/blocks/symbol/symbol.tsx
|
|
6626
|
-
var _tmpl$
|
|
7022
|
+
var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
|
|
6627
7023
|
function Symbol(props) {
|
|
6628
7024
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
6629
7025
|
const blocksWrapper = createMemo(() => {
|
|
@@ -6655,7 +7051,7 @@ function Symbol(props) {
|
|
|
6655
7051
|
}
|
|
6656
7052
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6657
7053
|
return (() => {
|
|
6658
|
-
const _el$ = _tmpl$
|
|
7054
|
+
const _el$ = _tmpl$30();
|
|
6659
7055
|
spread(_el$, mergeProps({
|
|
6660
7056
|
get ["class"]() {
|
|
6661
7057
|
return className();
|
|
@@ -6747,4 +7143,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
6747
7143
|
};
|
|
6748
7144
|
};
|
|
6749
7145
|
|
|
6750
|
-
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 };
|