@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/browser/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
|
|
|
4
4
|
// src/blocks/button/button.tsx
|
|
5
5
|
|
|
@@ -1607,7 +1607,7 @@ function Block(props) {
|
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
var block_default = Block;
|
|
1610
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1610
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
|
|
1611
1611
|
display: flex;
|
|
1612
1612
|
flex-direction: column;
|
|
1613
1613
|
align-items: stretch;
|
|
@@ -1620,8 +1620,9 @@ function BlocksWrapper(props) {
|
|
|
1620
1620
|
if (!props.path) {
|
|
1621
1621
|
return void 0;
|
|
1622
1622
|
}
|
|
1623
|
+
const thisPrefix = "this.";
|
|
1623
1624
|
const pathPrefix = "component.options.";
|
|
1624
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1625
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
1625
1626
|
});
|
|
1626
1627
|
function onClick() {
|
|
1627
1628
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -1650,7 +1651,7 @@ function BlocksWrapper(props) {
|
|
|
1650
1651
|
});
|
|
1651
1652
|
return [createComponent(Dynamic, mergeProps({
|
|
1652
1653
|
get ["class"]() {
|
|
1653
|
-
return className() + " dynamic-
|
|
1654
|
+
return className() + " dynamic-3d7ff108";
|
|
1654
1655
|
},
|
|
1655
1656
|
ref(r$) {
|
|
1656
1657
|
const _ref$ = blocksWrapperRef;
|
|
@@ -1749,7 +1750,7 @@ var getColumnsClass = (id) => {
|
|
|
1749
1750
|
|
|
1750
1751
|
// src/blocks/columns/columns.tsx
|
|
1751
1752
|
var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
|
|
1752
|
-
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-
|
|
1753
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
|
|
1753
1754
|
display: flex;
|
|
1754
1755
|
line-height: normal;
|
|
1755
1756
|
}`);
|
|
@@ -1878,7 +1879,7 @@ function Columns(props) {
|
|
|
1878
1879
|
const _el$ = _tmpl$3();
|
|
1879
1880
|
spread(_el$, mergeProps({
|
|
1880
1881
|
get ["class"]() {
|
|
1881
|
-
return getColumnsClass(props.builderBlock?.id) + " div-
|
|
1882
|
+
return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
|
|
1882
1883
|
},
|
|
1883
1884
|
get style() {
|
|
1884
1885
|
return columnsCssVars();
|
|
@@ -1919,9 +1920,6 @@ function Columns(props) {
|
|
|
1919
1920
|
get parent() {
|
|
1920
1921
|
return props.builderBlock.id;
|
|
1921
1922
|
},
|
|
1922
|
-
styleProp: {
|
|
1923
|
-
flexGrow: "1"
|
|
1924
|
-
},
|
|
1925
1923
|
get context() {
|
|
1926
1924
|
return props.builderContext;
|
|
1927
1925
|
},
|
|
@@ -1933,6 +1931,9 @@ function Columns(props) {
|
|
|
1933
1931
|
},
|
|
1934
1932
|
get blocks() {
|
|
1935
1933
|
return column.blocks;
|
|
1934
|
+
},
|
|
1935
|
+
styleProp: {
|
|
1936
|
+
"flex-grow": "1"
|
|
1936
1937
|
}
|
|
1937
1938
|
});
|
|
1938
1939
|
}
|
|
@@ -2003,16 +2004,16 @@ function getSrcSet(url) {
|
|
|
2003
2004
|
// src/blocks/image/image.tsx
|
|
2004
2005
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
2005
2006
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
2006
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
2007
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
2008
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
2007
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
|
|
2008
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
|
|
2009
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
|
|
2009
2010
|
opacity: 1;
|
|
2010
2011
|
transition: opacity 0.2s ease-in-out;
|
|
2011
|
-
}.div-
|
|
2012
|
+
}.div-dc6700b4 {
|
|
2012
2013
|
width: 100%;
|
|
2013
2014
|
pointer-events: none;
|
|
2014
2015
|
font-size: 0;
|
|
2015
|
-
}.div-
|
|
2016
|
+
}.div-dc6700b4-2 {
|
|
2016
2017
|
display: flex;
|
|
2017
2018
|
flex-direction: column;
|
|
2018
2019
|
align-items: stretch;
|
|
@@ -2061,8 +2062,6 @@ function Image(props) {
|
|
|
2061
2062
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
2062
2063
|
return out;
|
|
2063
2064
|
});
|
|
2064
|
-
onMount(() => {
|
|
2065
|
-
});
|
|
2066
2065
|
return [[(() => {
|
|
2067
2066
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
2068
2067
|
insert(_el$, createComponent(Show, {
|
|
@@ -2076,7 +2075,7 @@ function Image(props) {
|
|
|
2076
2075
|
}
|
|
2077
2076
|
}), _el$3);
|
|
2078
2077
|
effect((_p$) => {
|
|
2079
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
2078
|
+
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 = {
|
|
2080
2079
|
"object-position": props.backgroundPosition || "center",
|
|
2081
2080
|
"object-fit": props.backgroundSize || "cover",
|
|
2082
2081
|
...aspectRatioCss()
|
|
@@ -2345,8 +2344,58 @@ var handleABTesting = async ({
|
|
|
2345
2344
|
};
|
|
2346
2345
|
};
|
|
2347
2346
|
|
|
2347
|
+
// src/helpers/user-attributes.ts
|
|
2348
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2349
|
+
function createUserAttributesService() {
|
|
2350
|
+
let canTrack = true;
|
|
2351
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
2352
|
+
return {
|
|
2353
|
+
setUserAttributes(newAttrs) {
|
|
2354
|
+
if (!isBrowser()) {
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2357
|
+
const userAttributes = {
|
|
2358
|
+
...this.getUserAttributes(),
|
|
2359
|
+
...newAttrs
|
|
2360
|
+
};
|
|
2361
|
+
setCookie({
|
|
2362
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2363
|
+
value: JSON.stringify(userAttributes),
|
|
2364
|
+
canTrack
|
|
2365
|
+
});
|
|
2366
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
2367
|
+
},
|
|
2368
|
+
getUserAttributes() {
|
|
2369
|
+
if (!isBrowser()) {
|
|
2370
|
+
return {};
|
|
2371
|
+
}
|
|
2372
|
+
return JSON.parse(getCookieSync({
|
|
2373
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
2374
|
+
canTrack
|
|
2375
|
+
}) || "{}");
|
|
2376
|
+
},
|
|
2377
|
+
subscribeOnUserAttributesChange(callback) {
|
|
2378
|
+
subscribers.add(callback);
|
|
2379
|
+
return () => {
|
|
2380
|
+
subscribers.delete(callback);
|
|
2381
|
+
};
|
|
2382
|
+
},
|
|
2383
|
+
setCanTrack(value) {
|
|
2384
|
+
canTrack = value;
|
|
2385
|
+
}
|
|
2386
|
+
};
|
|
2387
|
+
}
|
|
2388
|
+
var userAttributesService = createUserAttributesService();
|
|
2389
|
+
var setClientUserAttributes = (attributes) => {
|
|
2390
|
+
userAttributesService.setUserAttributes(attributes);
|
|
2391
|
+
};
|
|
2392
|
+
|
|
2348
2393
|
// src/helpers/canTrack.ts
|
|
2349
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
2394
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
2395
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
2396
|
+
userAttributesService.setCanTrack(result);
|
|
2397
|
+
return result;
|
|
2398
|
+
};
|
|
2350
2399
|
|
|
2351
2400
|
// src/blocks/accordion/component-info.ts
|
|
2352
2401
|
var defaultTitle = {
|
|
@@ -3076,8 +3125,408 @@ var componentInfo5 = {
|
|
|
3076
3125
|
}
|
|
3077
3126
|
};
|
|
3078
3127
|
|
|
3079
|
-
// src/blocks/
|
|
3128
|
+
// src/blocks/personalization-container/component-info.ts
|
|
3080
3129
|
var componentInfo6 = {
|
|
3130
|
+
name: "PersonalizationContainer",
|
|
3131
|
+
shouldReceiveBuilderProps: {
|
|
3132
|
+
builderBlock: true,
|
|
3133
|
+
builderContext: true
|
|
3134
|
+
},
|
|
3135
|
+
noWrap: true,
|
|
3136
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
3137
|
+
canHaveChildren: true,
|
|
3138
|
+
inputs: [{
|
|
3139
|
+
name: "variants",
|
|
3140
|
+
defaultValue: [],
|
|
3141
|
+
behavior: "personalizationVariantList",
|
|
3142
|
+
type: "list",
|
|
3143
|
+
subFields: [{
|
|
3144
|
+
name: "name",
|
|
3145
|
+
type: "text"
|
|
3146
|
+
}, {
|
|
3147
|
+
name: "query",
|
|
3148
|
+
friendlyName: "Targeting rules",
|
|
3149
|
+
type: "BuilderQuery",
|
|
3150
|
+
defaultValue: []
|
|
3151
|
+
}, {
|
|
3152
|
+
name: "startDate",
|
|
3153
|
+
type: "date"
|
|
3154
|
+
}, {
|
|
3155
|
+
name: "endDate",
|
|
3156
|
+
type: "date"
|
|
3157
|
+
}, {
|
|
3158
|
+
name: "blocks",
|
|
3159
|
+
type: "uiBlocks",
|
|
3160
|
+
hideFromUI: true,
|
|
3161
|
+
defaultValue: []
|
|
3162
|
+
}]
|
|
3163
|
+
}]
|
|
3164
|
+
};
|
|
3165
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
|
|
3166
|
+
function InlinedScript(props) {
|
|
3167
|
+
return (() => {
|
|
3168
|
+
const _el$ = _tmpl$8();
|
|
3169
|
+
effect((_p$) => {
|
|
3170
|
+
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
3171
|
+
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
3172
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
3173
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
3174
|
+
return _p$;
|
|
3175
|
+
}, {
|
|
3176
|
+
_v$: void 0,
|
|
3177
|
+
_v$2: void 0,
|
|
3178
|
+
_v$3: void 0
|
|
3179
|
+
});
|
|
3180
|
+
return _el$;
|
|
3181
|
+
})();
|
|
3182
|
+
}
|
|
3183
|
+
var inlined_script_default = InlinedScript;
|
|
3184
|
+
|
|
3185
|
+
// src/functions/is-previewing.ts
|
|
3186
|
+
function isPreviewing(_search) {
|
|
3187
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
3188
|
+
if (!search) {
|
|
3189
|
+
return false;
|
|
3190
|
+
}
|
|
3191
|
+
const normalizedSearch = getSearchString(search);
|
|
3192
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
3196
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
3197
|
+
function isString(val) {
|
|
3198
|
+
return typeof val === "string";
|
|
3199
|
+
}
|
|
3200
|
+
function isNumber(val) {
|
|
3201
|
+
return typeof val === "number";
|
|
3202
|
+
}
|
|
3203
|
+
function objectMatchesQuery(userattr, query2) {
|
|
3204
|
+
const result = (() => {
|
|
3205
|
+
const property = query2.property;
|
|
3206
|
+
const operator = query2.operator;
|
|
3207
|
+
let testValue = query2.value;
|
|
3208
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
3209
|
+
testValue = query2.value.slice(0, -1);
|
|
3210
|
+
}
|
|
3211
|
+
if (!(property && operator)) {
|
|
3212
|
+
return true;
|
|
3213
|
+
}
|
|
3214
|
+
if (Array.isArray(testValue)) {
|
|
3215
|
+
if (operator === "isNot") {
|
|
3216
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
3217
|
+
property,
|
|
3218
|
+
operator,
|
|
3219
|
+
value: val
|
|
3220
|
+
}));
|
|
3221
|
+
}
|
|
3222
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
3223
|
+
property,
|
|
3224
|
+
operator,
|
|
3225
|
+
value: val
|
|
3226
|
+
}));
|
|
3227
|
+
}
|
|
3228
|
+
const value = userattr[property];
|
|
3229
|
+
if (Array.isArray(value)) {
|
|
3230
|
+
return value.includes(testValue);
|
|
3231
|
+
}
|
|
3232
|
+
switch (operator) {
|
|
3233
|
+
case "is":
|
|
3234
|
+
return value === testValue;
|
|
3235
|
+
case "isNot":
|
|
3236
|
+
return value !== testValue;
|
|
3237
|
+
case "contains":
|
|
3238
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
3239
|
+
case "startsWith":
|
|
3240
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
3241
|
+
case "endsWith":
|
|
3242
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
3243
|
+
case "greaterThan":
|
|
3244
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
3245
|
+
case "lessThan":
|
|
3246
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
3247
|
+
case "greaterThanOrEqualTo":
|
|
3248
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
3249
|
+
case "lessThanOrEqualTo":
|
|
3250
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
3251
|
+
default:
|
|
3252
|
+
return false;
|
|
3253
|
+
}
|
|
3254
|
+
})();
|
|
3255
|
+
return result;
|
|
3256
|
+
}
|
|
3257
|
+
const item = {
|
|
3258
|
+
query,
|
|
3259
|
+
startDate,
|
|
3260
|
+
endDate
|
|
3261
|
+
};
|
|
3262
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
3263
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
3264
|
+
return false;
|
|
3265
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
3266
|
+
return false;
|
|
3267
|
+
}
|
|
3268
|
+
if (!item.query || !item.query.length) {
|
|
3269
|
+
return true;
|
|
3270
|
+
}
|
|
3271
|
+
return item.query.every((filter) => {
|
|
3272
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
3273
|
+
});
|
|
3274
|
+
}
|
|
3275
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
3276
|
+
if (!navigator.cookieEnabled) {
|
|
3277
|
+
return;
|
|
3278
|
+
}
|
|
3279
|
+
function getCookie(name) {
|
|
3280
|
+
const nameEQ = name + '=';
|
|
3281
|
+
const ca = document.cookie.split(';');
|
|
3282
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3283
|
+
let c = ca[i];
|
|
3284
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
3285
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
3286
|
+
}
|
|
3287
|
+
return null;
|
|
3288
|
+
}
|
|
3289
|
+
function removeVariants() {
|
|
3290
|
+
variants?.forEach(function (_, index) {
|
|
3291
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
3292
|
+
});
|
|
3293
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
3294
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
3295
|
+
}
|
|
3296
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
3297
|
+
if (locale) {
|
|
3298
|
+
attributes.locale = locale;
|
|
3299
|
+
}
|
|
3300
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
3301
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
3302
|
+
});
|
|
3303
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
3304
|
+
if (isDebug) {
|
|
3305
|
+
console.debug('PersonalizationContainer', {
|
|
3306
|
+
attributes,
|
|
3307
|
+
variants,
|
|
3308
|
+
winningVariantIndex
|
|
3309
|
+
});
|
|
3310
|
+
}
|
|
3311
|
+
if (winningVariantIndex !== -1) {
|
|
3312
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
3313
|
+
if (winningVariant) {
|
|
3314
|
+
const parentNode = winningVariant.parentNode;
|
|
3315
|
+
if (parentNode) {
|
|
3316
|
+
const newParent = parentNode.cloneNode(false);
|
|
3317
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
3318
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
3319
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
3320
|
+
}
|
|
3321
|
+
if (isDebug) {
|
|
3322
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
} else if (variants && variants.length > 0) {
|
|
3326
|
+
removeVariants();
|
|
3327
|
+
}
|
|
3328
|
+
}`;
|
|
3329
|
+
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}";
|
|
3330
|
+
|
|
3331
|
+
// src/blocks/personalization-container/helpers.ts
|
|
3332
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
3333
|
+
const hasVariants = variants && variants.length > 0;
|
|
3334
|
+
if (TARGET === "reactNative")
|
|
3335
|
+
return false;
|
|
3336
|
+
if (!hasVariants)
|
|
3337
|
+
return false;
|
|
3338
|
+
if (!canTrack)
|
|
3339
|
+
return false;
|
|
3340
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
3341
|
+
return true;
|
|
3342
|
+
if (isBrowser())
|
|
3343
|
+
return false;
|
|
3344
|
+
return true;
|
|
3345
|
+
}
|
|
3346
|
+
function getBlocksToRender({
|
|
3347
|
+
variants,
|
|
3348
|
+
previewingIndex,
|
|
3349
|
+
isHydrated,
|
|
3350
|
+
filteredVariants,
|
|
3351
|
+
fallbackBlocks
|
|
3352
|
+
}) {
|
|
3353
|
+
const fallback = {
|
|
3354
|
+
blocks: fallbackBlocks ?? [],
|
|
3355
|
+
path: "this.children"
|
|
3356
|
+
};
|
|
3357
|
+
if (isHydrated && isEditing()) {
|
|
3358
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
3359
|
+
const variant = variants[previewingIndex];
|
|
3360
|
+
return {
|
|
3361
|
+
blocks: variant.blocks,
|
|
3362
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
3363
|
+
};
|
|
3364
|
+
}
|
|
3365
|
+
return fallback;
|
|
3366
|
+
}
|
|
3367
|
+
if (isBrowser()) {
|
|
3368
|
+
const winningVariant = filteredVariants?.[0];
|
|
3369
|
+
if (winningVariant) {
|
|
3370
|
+
return {
|
|
3371
|
+
blocks: winningVariant.blocks,
|
|
3372
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
3373
|
+
};
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
return fallback;
|
|
3377
|
+
}
|
|
3378
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
3379
|
+
return `
|
|
3380
|
+
(function() {
|
|
3381
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
3382
|
+
${PERSONALIZATION_SCRIPT}
|
|
3383
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
3384
|
+
})();
|
|
3385
|
+
`;
|
|
3386
|
+
};
|
|
3387
|
+
|
|
3388
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
3389
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
3390
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
|
|
3391
|
+
function PersonalizationContainer(props) {
|
|
3392
|
+
const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
|
|
3393
|
+
const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
|
|
3394
|
+
const [unsubscribers, setUnsubscribers] = createSignal([]);
|
|
3395
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
|
|
3396
|
+
const [isHydrated, setIsHydrated] = createSignal(false);
|
|
3397
|
+
const filteredVariants = createMemo(() => {
|
|
3398
|
+
return (props.variants || []).filter((variant) => {
|
|
3399
|
+
return filterWithCustomTargeting({
|
|
3400
|
+
...props.builderContext?.rootState?.locale ? {
|
|
3401
|
+
locale: props.builderContext?.rootState?.locale
|
|
3402
|
+
} : {},
|
|
3403
|
+
...userAttributes()
|
|
3404
|
+
}, variant.query, variant.startDate, variant.endDate);
|
|
3405
|
+
});
|
|
3406
|
+
});
|
|
3407
|
+
const blocksToRender = createMemo(() => {
|
|
3408
|
+
return getBlocksToRender({
|
|
3409
|
+
variants: props.variants,
|
|
3410
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
3411
|
+
isHydrated: isHydrated(),
|
|
3412
|
+
filteredVariants: filteredVariants(),
|
|
3413
|
+
previewingIndex: props.previewingIndex
|
|
3414
|
+
});
|
|
3415
|
+
});
|
|
3416
|
+
const hideVariantsStyleString = createMemo(() => {
|
|
3417
|
+
return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
|
|
3418
|
+
});
|
|
3419
|
+
let rootRef;
|
|
3420
|
+
onMount(() => {
|
|
3421
|
+
setIsHydrated(true);
|
|
3422
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
|
|
3423
|
+
setUserAttributes(attrs);
|
|
3424
|
+
});
|
|
3425
|
+
if (!(isEditing() || isPreviewing())) {
|
|
3426
|
+
const variant = filteredVariants()[0];
|
|
3427
|
+
if (rootRef) {
|
|
3428
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
|
|
3429
|
+
detail: {
|
|
3430
|
+
variant: variant || "default",
|
|
3431
|
+
content: props.builderContext?.content
|
|
3432
|
+
},
|
|
3433
|
+
bubbles: true
|
|
3434
|
+
}));
|
|
3435
|
+
const observer = new IntersectionObserver((entries) => {
|
|
3436
|
+
entries.forEach((entry) => {
|
|
3437
|
+
if (entry.isIntersecting && rootRef) {
|
|
3438
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
|
|
3439
|
+
detail: {
|
|
3440
|
+
variant: variant || "default",
|
|
3441
|
+
content: props.builderContext?.content
|
|
3442
|
+
},
|
|
3443
|
+
bubbles: true
|
|
3444
|
+
}));
|
|
3445
|
+
}
|
|
3446
|
+
});
|
|
3447
|
+
});
|
|
3448
|
+
observer.observe(rootRef);
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
unsubscribers().push(unsub);
|
|
3452
|
+
});
|
|
3453
|
+
return (() => {
|
|
3454
|
+
const _el$ = _tmpl$9();
|
|
3455
|
+
const _ref$ = rootRef;
|
|
3456
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
|
|
3457
|
+
spread(_el$, mergeProps({
|
|
3458
|
+
get ["class"]() {
|
|
3459
|
+
return `builder-personalization-container ${props.attributes?.className || ""}`;
|
|
3460
|
+
}
|
|
3461
|
+
}, () => props.attributes), false, true);
|
|
3462
|
+
insert(_el$, createComponent(Show, {
|
|
3463
|
+
get when() {
|
|
3464
|
+
return shouldRenderVariants();
|
|
3465
|
+
},
|
|
3466
|
+
get children() {
|
|
3467
|
+
return [createComponent(For, {
|
|
3468
|
+
get each() {
|
|
3469
|
+
return props.variants;
|
|
3470
|
+
},
|
|
3471
|
+
children: (variant, _index) => {
|
|
3472
|
+
const index = _index();
|
|
3473
|
+
return (() => {
|
|
3474
|
+
const _el$2 = _tmpl$25();
|
|
3475
|
+
setAttribute(_el$2, "key", index);
|
|
3476
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
3477
|
+
get blocks() {
|
|
3478
|
+
return variant.blocks;
|
|
3479
|
+
},
|
|
3480
|
+
get parent() {
|
|
3481
|
+
return props.builderBlock?.id;
|
|
3482
|
+
},
|
|
3483
|
+
path: `component.options.variants.${index}.blocks`
|
|
3484
|
+
}));
|
|
3485
|
+
effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
|
|
3486
|
+
return _el$2;
|
|
3487
|
+
})();
|
|
3488
|
+
}
|
|
3489
|
+
}), createComponent(inlined_styles_default, {
|
|
3490
|
+
get nonce() {
|
|
3491
|
+
return props.builderContext?.nonce || "";
|
|
3492
|
+
},
|
|
3493
|
+
get styles() {
|
|
3494
|
+
return hideVariantsStyleString();
|
|
3495
|
+
},
|
|
3496
|
+
get id() {
|
|
3497
|
+
return `variants-styles-${props.builderBlock?.id}`;
|
|
3498
|
+
}
|
|
3499
|
+
}), createComponent(inlined_script_default, {
|
|
3500
|
+
get nonce() {
|
|
3501
|
+
return props.builderContext?.nonce || "";
|
|
3502
|
+
},
|
|
3503
|
+
get scriptStr() {
|
|
3504
|
+
return scriptStr();
|
|
3505
|
+
},
|
|
3506
|
+
get id() {
|
|
3507
|
+
return `variants-script-${props.builderBlock?.id}`;
|
|
3508
|
+
}
|
|
3509
|
+
})];
|
|
3510
|
+
}
|
|
3511
|
+
}), null);
|
|
3512
|
+
insert(_el$, createComponent(blocks_default, {
|
|
3513
|
+
get blocks() {
|
|
3514
|
+
return blocksToRender().blocks;
|
|
3515
|
+
},
|
|
3516
|
+
get parent() {
|
|
3517
|
+
return props.builderBlock?.id;
|
|
3518
|
+
},
|
|
3519
|
+
get path() {
|
|
3520
|
+
return blocksToRender().path;
|
|
3521
|
+
}
|
|
3522
|
+
}), null);
|
|
3523
|
+
return _el$;
|
|
3524
|
+
})();
|
|
3525
|
+
}
|
|
3526
|
+
var personalization_container_default = PersonalizationContainer;
|
|
3527
|
+
|
|
3528
|
+
// src/blocks/section/component-info.ts
|
|
3529
|
+
var componentInfo7 = {
|
|
3081
3530
|
name: "Core:Section",
|
|
3082
3531
|
static: true,
|
|
3083
3532
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -3119,7 +3568,7 @@ var componentInfo6 = {
|
|
|
3119
3568
|
};
|
|
3120
3569
|
|
|
3121
3570
|
// src/blocks/slot/component-info.ts
|
|
3122
|
-
var
|
|
3571
|
+
var componentInfo8 = {
|
|
3123
3572
|
name: "Slot",
|
|
3124
3573
|
isRSC: true,
|
|
3125
3574
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -3137,10 +3586,10 @@ var componentInfo7 = {
|
|
|
3137
3586
|
builderComponents: true
|
|
3138
3587
|
}
|
|
3139
3588
|
};
|
|
3140
|
-
var _tmpl$
|
|
3589
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
3141
3590
|
function Slot(props) {
|
|
3142
3591
|
return (() => {
|
|
3143
|
-
const _el$ = _tmpl$
|
|
3592
|
+
const _el$ = _tmpl$10();
|
|
3144
3593
|
_el$.style.setProperty("pointer-events", "auto");
|
|
3145
3594
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
3146
3595
|
"builder-slot": props.name
|
|
@@ -3168,7 +3617,7 @@ function Slot(props) {
|
|
|
3168
3617
|
var slot_default = Slot;
|
|
3169
3618
|
|
|
3170
3619
|
// src/blocks/symbol/component-info.ts
|
|
3171
|
-
var
|
|
3620
|
+
var componentInfo9 = {
|
|
3172
3621
|
name: "Symbol",
|
|
3173
3622
|
noWrap: true,
|
|
3174
3623
|
static: true,
|
|
@@ -3250,7 +3699,7 @@ var defaultElement = {
|
|
|
3250
3699
|
}
|
|
3251
3700
|
}
|
|
3252
3701
|
};
|
|
3253
|
-
var
|
|
3702
|
+
var componentInfo10 = {
|
|
3254
3703
|
name: "Builder: Tabs",
|
|
3255
3704
|
inputs: [{
|
|
3256
3705
|
name: "tabs",
|
|
@@ -3354,8 +3803,8 @@ var componentInfo9 = {
|
|
|
3354
3803
|
builderLinkComponent: true
|
|
3355
3804
|
}
|
|
3356
3805
|
};
|
|
3357
|
-
var _tmpl$
|
|
3358
|
-
var _tmpl$
|
|
3806
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
|
|
3807
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
3359
3808
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
3360
3809
|
function Tabs(props) {
|
|
3361
3810
|
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
@@ -3370,7 +3819,7 @@ function Tabs(props) {
|
|
|
3370
3819
|
}
|
|
3371
3820
|
}
|
|
3372
3821
|
return (() => {
|
|
3373
|
-
const _el$ = _tmpl$
|
|
3822
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
|
|
3374
3823
|
_el$2.style.setProperty("display", "flex");
|
|
3375
3824
|
_el$2.style.setProperty("flex-direction", "row");
|
|
3376
3825
|
_el$2.style.setProperty("overflow", "auto");
|
|
@@ -3422,7 +3871,7 @@ function Tabs(props) {
|
|
|
3422
3871
|
return activeTabContent(activeTab());
|
|
3423
3872
|
},
|
|
3424
3873
|
get children() {
|
|
3425
|
-
const _el$3 = _tmpl$
|
|
3874
|
+
const _el$3 = _tmpl$11();
|
|
3426
3875
|
insert(_el$3, createComponent(blocks_default, {
|
|
3427
3876
|
get parent() {
|
|
3428
3877
|
return props.builderBlock.id;
|
|
@@ -3454,7 +3903,7 @@ var tabs_default = Tabs;
|
|
|
3454
3903
|
delegateEvents(["click"]);
|
|
3455
3904
|
|
|
3456
3905
|
// src/blocks/text/component-info.ts
|
|
3457
|
-
var
|
|
3906
|
+
var componentInfo11 = {
|
|
3458
3907
|
shouldReceiveBuilderProps: {
|
|
3459
3908
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3460
3909
|
builderContext: true
|
|
@@ -3477,10 +3926,10 @@ var componentInfo10 = {
|
|
|
3477
3926
|
textAlign: "center"
|
|
3478
3927
|
}
|
|
3479
3928
|
};
|
|
3480
|
-
var _tmpl$
|
|
3929
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3481
3930
|
function Text(props) {
|
|
3482
3931
|
return (() => {
|
|
3483
|
-
const _el$ = _tmpl$
|
|
3932
|
+
const _el$ = _tmpl$12();
|
|
3484
3933
|
_el$.style.setProperty("outline", "none");
|
|
3485
3934
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
3486
3935
|
return _el$;
|
|
@@ -3489,7 +3938,7 @@ function Text(props) {
|
|
|
3489
3938
|
var text_default = Text;
|
|
3490
3939
|
|
|
3491
3940
|
// src/blocks/custom-code/component-info.ts
|
|
3492
|
-
var
|
|
3941
|
+
var componentInfo12 = {
|
|
3493
3942
|
name: "Custom Code",
|
|
3494
3943
|
static: true,
|
|
3495
3944
|
requiredPermissions: ["editCode"],
|
|
@@ -3512,7 +3961,7 @@ var componentInfo11 = {
|
|
|
3512
3961
|
advanced: true
|
|
3513
3962
|
}]
|
|
3514
3963
|
};
|
|
3515
|
-
var _tmpl$
|
|
3964
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
3516
3965
|
function CustomCode(props) {
|
|
3517
3966
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3518
3967
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3546,7 +3995,7 @@ function CustomCode(props) {
|
|
|
3546
3995
|
}
|
|
3547
3996
|
});
|
|
3548
3997
|
return (() => {
|
|
3549
|
-
const _el$ = _tmpl$
|
|
3998
|
+
const _el$ = _tmpl$13();
|
|
3550
3999
|
const _ref$ = elementRef;
|
|
3551
4000
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3552
4001
|
effect((_p$) => {
|
|
@@ -3564,7 +4013,7 @@ function CustomCode(props) {
|
|
|
3564
4013
|
var custom_code_default = CustomCode;
|
|
3565
4014
|
|
|
3566
4015
|
// src/blocks/embed/component-info.ts
|
|
3567
|
-
var
|
|
4016
|
+
var componentInfo13 = {
|
|
3568
4017
|
name: "Embed",
|
|
3569
4018
|
static: true,
|
|
3570
4019
|
inputs: [{
|
|
@@ -3586,7 +4035,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
3586
4035
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
3587
4036
|
|
|
3588
4037
|
// src/blocks/embed/embed.tsx
|
|
3589
|
-
var _tmpl$
|
|
4038
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
3590
4039
|
function Embed(props) {
|
|
3591
4040
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3592
4041
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3623,7 +4072,7 @@ function Embed(props) {
|
|
|
3623
4072
|
}
|
|
3624
4073
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
3625
4074
|
return (() => {
|
|
3626
|
-
const _el$ = _tmpl$
|
|
4075
|
+
const _el$ = _tmpl$14();
|
|
3627
4076
|
const _ref$ = elem;
|
|
3628
4077
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
3629
4078
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -3633,7 +4082,7 @@ function Embed(props) {
|
|
|
3633
4082
|
var embed_default = Embed;
|
|
3634
4083
|
|
|
3635
4084
|
// src/blocks/form/form/component-info.ts
|
|
3636
|
-
var
|
|
4085
|
+
var componentInfo14 = {
|
|
3637
4086
|
name: "Form:Form",
|
|
3638
4087
|
// editableTags: ['builder-form-error']
|
|
3639
4088
|
defaults: {
|
|
@@ -3889,9 +4338,9 @@ function logFetch(url) {
|
|
|
3889
4338
|
}
|
|
3890
4339
|
|
|
3891
4340
|
// src/blocks/form/form/form.tsx
|
|
3892
|
-
var _tmpl$
|
|
3893
|
-
var _tmpl$
|
|
3894
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4341
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
|
|
4342
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
|
|
4343
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
|
|
3895
4344
|
padding: 10px;
|
|
3896
4345
|
color: red;
|
|
3897
4346
|
text-align: center;
|
|
@@ -4083,7 +4532,7 @@ function FormComponent(props) {
|
|
|
4083
4532
|
}
|
|
4084
4533
|
let formRef;
|
|
4085
4534
|
return [(() => {
|
|
4086
|
-
const _el$ = _tmpl$
|
|
4535
|
+
const _el$ = _tmpl$27();
|
|
4087
4536
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
4088
4537
|
const _ref$ = formRef;
|
|
4089
4538
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -4101,34 +4550,7 @@ function FormComponent(props) {
|
|
|
4101
4550
|
return props.name;
|
|
4102
4551
|
}
|
|
4103
4552
|
}, {}, {}, () => props.attributes), false, true);
|
|
4104
|
-
insert(_el$,
|
|
4105
|
-
get when() {
|
|
4106
|
-
return props.builderBlock && props.builderBlock.children;
|
|
4107
|
-
},
|
|
4108
|
-
get children() {
|
|
4109
|
-
return createComponent(For, {
|
|
4110
|
-
get each() {
|
|
4111
|
-
return props.builderBlock?.children;
|
|
4112
|
-
},
|
|
4113
|
-
children: (block, _index) => {
|
|
4114
|
-
const idx = _index();
|
|
4115
|
-
return createComponent(block_default, {
|
|
4116
|
-
key: `form-block-${idx}`,
|
|
4117
|
-
block,
|
|
4118
|
-
get context() {
|
|
4119
|
-
return props.builderContext;
|
|
4120
|
-
},
|
|
4121
|
-
get registeredComponents() {
|
|
4122
|
-
return props.builderComponents;
|
|
4123
|
-
},
|
|
4124
|
-
get linkComponent() {
|
|
4125
|
-
return props.builderLinkComponent;
|
|
4126
|
-
}
|
|
4127
|
-
});
|
|
4128
|
-
}
|
|
4129
|
-
});
|
|
4130
|
-
}
|
|
4131
|
-
}), null);
|
|
4553
|
+
insert(_el$, () => props.children, null);
|
|
4132
4554
|
insert(_el$, createComponent(Show, {
|
|
4133
4555
|
get when() {
|
|
4134
4556
|
return submissionState() === "error";
|
|
@@ -4166,7 +4588,7 @@ function FormComponent(props) {
|
|
|
4166
4588
|
return memo(() => submissionState() === "error")() && responseData();
|
|
4167
4589
|
},
|
|
4168
4590
|
get children() {
|
|
4169
|
-
const _el$2 = _tmpl$
|
|
4591
|
+
const _el$2 = _tmpl$15();
|
|
4170
4592
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
4171
4593
|
return _el$2;
|
|
4172
4594
|
}
|
|
@@ -4193,7 +4615,7 @@ function FormComponent(props) {
|
|
|
4193
4615
|
var form_default = FormComponent;
|
|
4194
4616
|
|
|
4195
4617
|
// src/blocks/form/input/component-info.ts
|
|
4196
|
-
var
|
|
4618
|
+
var componentInfo15 = {
|
|
4197
4619
|
name: "Form:Input",
|
|
4198
4620
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
4199
4621
|
inputs: [
|
|
@@ -4245,10 +4667,10 @@ var componentInfo14 = {
|
|
|
4245
4667
|
borderColor: "#ccc"
|
|
4246
4668
|
}
|
|
4247
4669
|
};
|
|
4248
|
-
var _tmpl$
|
|
4670
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
|
|
4249
4671
|
function FormInputComponent(props) {
|
|
4250
4672
|
return (() => {
|
|
4251
|
-
const _el$ = _tmpl$
|
|
4673
|
+
const _el$ = _tmpl$16();
|
|
4252
4674
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4253
4675
|
get key() {
|
|
4254
4676
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -4278,7 +4700,7 @@ function FormInputComponent(props) {
|
|
|
4278
4700
|
var input_default = FormInputComponent;
|
|
4279
4701
|
|
|
4280
4702
|
// src/blocks/form/select/component-info.ts
|
|
4281
|
-
var
|
|
4703
|
+
var componentInfo16 = {
|
|
4282
4704
|
name: "Form:Select",
|
|
4283
4705
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
4284
4706
|
defaultStyles: {
|
|
@@ -4321,11 +4743,11 @@ var componentInfo15 = {
|
|
|
4321
4743
|
static: true,
|
|
4322
4744
|
noWrap: true
|
|
4323
4745
|
};
|
|
4324
|
-
var _tmpl$
|
|
4325
|
-
var _tmpl$
|
|
4746
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
|
|
4747
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
|
|
4326
4748
|
function SelectComponent(props) {
|
|
4327
4749
|
return (() => {
|
|
4328
|
-
const _el$ = _tmpl$
|
|
4750
|
+
const _el$ = _tmpl$17();
|
|
4329
4751
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4330
4752
|
get value() {
|
|
4331
4753
|
return props.value;
|
|
@@ -4350,7 +4772,7 @@ function SelectComponent(props) {
|
|
|
4350
4772
|
children: (option, _index) => {
|
|
4351
4773
|
const index = _index();
|
|
4352
4774
|
return (() => {
|
|
4353
|
-
const _el$2 = _tmpl$
|
|
4775
|
+
const _el$2 = _tmpl$28();
|
|
4354
4776
|
insert(_el$2, () => option.name || option.value);
|
|
4355
4777
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
4356
4778
|
effect(() => _el$2.value = option.value);
|
|
@@ -4364,7 +4786,7 @@ function SelectComponent(props) {
|
|
|
4364
4786
|
var select_default = SelectComponent;
|
|
4365
4787
|
|
|
4366
4788
|
// src/blocks/form/submit-button/component-info.ts
|
|
4367
|
-
var
|
|
4789
|
+
var componentInfo17 = {
|
|
4368
4790
|
name: "Form:SubmitButton",
|
|
4369
4791
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
4370
4792
|
defaultStyles: {
|
|
@@ -4390,10 +4812,10 @@ var componentInfo16 = {
|
|
|
4390
4812
|
// TODO: defaultChildren
|
|
4391
4813
|
// canHaveChildren: true,
|
|
4392
4814
|
};
|
|
4393
|
-
var _tmpl$
|
|
4815
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
4394
4816
|
function SubmitButton(props) {
|
|
4395
4817
|
return (() => {
|
|
4396
|
-
const _el$ = _tmpl$
|
|
4818
|
+
const _el$ = _tmpl$18();
|
|
4397
4819
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
4398
4820
|
insert(_el$, () => props.text);
|
|
4399
4821
|
return _el$;
|
|
@@ -4402,7 +4824,7 @@ function SubmitButton(props) {
|
|
|
4402
4824
|
var submit_button_default = SubmitButton;
|
|
4403
4825
|
|
|
4404
4826
|
// src/blocks/form/textarea/component-info.ts
|
|
4405
|
-
var
|
|
4827
|
+
var componentInfo18 = {
|
|
4406
4828
|
name: "Form:TextArea",
|
|
4407
4829
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
4408
4830
|
inputs: [{
|
|
@@ -4439,10 +4861,10 @@ var componentInfo17 = {
|
|
|
4439
4861
|
static: true,
|
|
4440
4862
|
noWrap: true
|
|
4441
4863
|
};
|
|
4442
|
-
var _tmpl$
|
|
4864
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
|
|
4443
4865
|
function Textarea(props) {
|
|
4444
4866
|
return (() => {
|
|
4445
|
-
const _el$ = _tmpl$
|
|
4867
|
+
const _el$ = _tmpl$19();
|
|
4446
4868
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
4447
4869
|
get placeholder() {
|
|
4448
4870
|
return props.placeholder;
|
|
@@ -4466,7 +4888,7 @@ function Textarea(props) {
|
|
|
4466
4888
|
var textarea_default = Textarea;
|
|
4467
4889
|
|
|
4468
4890
|
// src/blocks/img/component-info.ts
|
|
4469
|
-
var
|
|
4891
|
+
var componentInfo19 = {
|
|
4470
4892
|
// friendlyName?
|
|
4471
4893
|
name: "Raw:Img",
|
|
4472
4894
|
hideFromInsertMenu: true,
|
|
@@ -4481,10 +4903,10 @@ var componentInfo18 = {
|
|
|
4481
4903
|
noWrap: true,
|
|
4482
4904
|
static: true
|
|
4483
4905
|
};
|
|
4484
|
-
var _tmpl$
|
|
4906
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
4485
4907
|
function ImgComponent(props) {
|
|
4486
4908
|
return (() => {
|
|
4487
|
-
const _el$ = _tmpl$
|
|
4909
|
+
const _el$ = _tmpl$20();
|
|
4488
4910
|
spread(_el$, mergeProps({
|
|
4489
4911
|
get style() {
|
|
4490
4912
|
return {
|
|
@@ -4508,7 +4930,7 @@ function ImgComponent(props) {
|
|
|
4508
4930
|
var img_default = ImgComponent;
|
|
4509
4931
|
|
|
4510
4932
|
// src/blocks/video/component-info.ts
|
|
4511
|
-
var
|
|
4933
|
+
var componentInfo20 = {
|
|
4512
4934
|
name: "Video",
|
|
4513
4935
|
canHaveChildren: true,
|
|
4514
4936
|
defaultStyles: {
|
|
@@ -4593,8 +5015,8 @@ var componentInfo19 = {
|
|
|
4593
5015
|
builderBlock: true
|
|
4594
5016
|
}
|
|
4595
5017
|
};
|
|
4596
|
-
var _tmpl$
|
|
4597
|
-
var _tmpl$
|
|
5018
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
5019
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
4598
5020
|
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
4599
5021
|
function Video(props) {
|
|
4600
5022
|
const videoProps = createMemo(() => {
|
|
@@ -4637,7 +5059,6 @@ function Video(props) {
|
|
|
4637
5059
|
"object-position": props.position,
|
|
4638
5060
|
// Hack to get object fit to work as expected and
|
|
4639
5061
|
// not have the video overflow
|
|
4640
|
-
"z-index": 2,
|
|
4641
5062
|
"border-radius": "1px",
|
|
4642
5063
|
...props.aspectRatio ? {
|
|
4643
5064
|
position: "absolute"
|
|
@@ -4656,7 +5077,7 @@ function Video(props) {
|
|
|
4656
5077
|
return !props.lazyLoad;
|
|
4657
5078
|
},
|
|
4658
5079
|
get children() {
|
|
4659
|
-
const _el$3 = _tmpl$
|
|
5080
|
+
const _el$3 = _tmpl$21();
|
|
4660
5081
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
4661
5082
|
return _el$3;
|
|
4662
5083
|
}
|
|
@@ -4666,7 +5087,7 @@ function Video(props) {
|
|
|
4666
5087
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
4667
5088
|
},
|
|
4668
5089
|
get children() {
|
|
4669
|
-
const _el$4 = _tmpl$
|
|
5090
|
+
const _el$4 = _tmpl$29();
|
|
4670
5091
|
_el$4.style.setProperty("width", "100%");
|
|
4671
5092
|
_el$4.style.setProperty("pointer-events", "none");
|
|
4672
5093
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -4679,7 +5100,7 @@ function Video(props) {
|
|
|
4679
5100
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
4680
5101
|
},
|
|
4681
5102
|
get children() {
|
|
4682
|
-
const _el$5 = _tmpl$
|
|
5103
|
+
const _el$5 = _tmpl$29();
|
|
4683
5104
|
_el$5.style.setProperty("display", "flex");
|
|
4684
5105
|
_el$5.style.setProperty("flex-direction", "column");
|
|
4685
5106
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -4692,7 +5113,7 @@ function Video(props) {
|
|
|
4692
5113
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
4693
5114
|
},
|
|
4694
5115
|
get children() {
|
|
4695
|
-
const _el$6 = _tmpl$
|
|
5116
|
+
const _el$6 = _tmpl$29();
|
|
4696
5117
|
_el$6.style.setProperty("pointer-events", "none");
|
|
4697
5118
|
_el$6.style.setProperty("display", "flex");
|
|
4698
5119
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -4714,31 +5135,31 @@ var video_default = Video;
|
|
|
4714
5135
|
// src/constants/extra-components.ts
|
|
4715
5136
|
var getExtraComponents = () => [{
|
|
4716
5137
|
component: custom_code_default,
|
|
4717
|
-
...
|
|
5138
|
+
...componentInfo12
|
|
4718
5139
|
}, {
|
|
4719
5140
|
component: embed_default,
|
|
4720
|
-
...
|
|
5141
|
+
...componentInfo13
|
|
4721
5142
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4722
5143
|
component: form_default,
|
|
4723
|
-
...
|
|
5144
|
+
...componentInfo14
|
|
4724
5145
|
}, {
|
|
4725
5146
|
component: input_default,
|
|
4726
|
-
...
|
|
5147
|
+
...componentInfo15
|
|
4727
5148
|
}, {
|
|
4728
5149
|
component: submit_button_default,
|
|
4729
|
-
...
|
|
5150
|
+
...componentInfo17
|
|
4730
5151
|
}, {
|
|
4731
5152
|
component: select_default,
|
|
4732
|
-
...
|
|
5153
|
+
...componentInfo16
|
|
4733
5154
|
}, {
|
|
4734
5155
|
component: textarea_default,
|
|
4735
|
-
...
|
|
5156
|
+
...componentInfo18
|
|
4736
5157
|
}], {
|
|
4737
5158
|
component: img_default,
|
|
4738
|
-
...
|
|
5159
|
+
...componentInfo19
|
|
4739
5160
|
}, {
|
|
4740
5161
|
component: video_default,
|
|
4741
|
-
...
|
|
5162
|
+
...componentInfo20
|
|
4742
5163
|
}];
|
|
4743
5164
|
|
|
4744
5165
|
// src/constants/builder-registered-components.ts
|
|
@@ -4756,19 +5177,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4756
5177
|
...componentInfo5
|
|
4757
5178
|
}, {
|
|
4758
5179
|
component: section_default,
|
|
4759
|
-
...
|
|
5180
|
+
...componentInfo7
|
|
4760
5181
|
}, {
|
|
4761
5182
|
component: slot_default,
|
|
4762
|
-
...
|
|
5183
|
+
...componentInfo8
|
|
4763
5184
|
}, {
|
|
4764
5185
|
component: symbol_default,
|
|
4765
|
-
...
|
|
5186
|
+
...componentInfo9
|
|
4766
5187
|
}, {
|
|
4767
5188
|
component: text_default,
|
|
4768
|
-
...
|
|
4769
|
-
}, ...TARGET === "
|
|
5189
|
+
...componentInfo11
|
|
5190
|
+
}, ...TARGET === "react" ? [{
|
|
5191
|
+
component: personalization_container_default,
|
|
5192
|
+
...componentInfo6
|
|
5193
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
4770
5194
|
component: tabs_default,
|
|
4771
|
-
...
|
|
5195
|
+
...componentInfo10
|
|
4772
5196
|
}, {
|
|
4773
5197
|
component: accordion_default,
|
|
4774
5198
|
...componentInfo
|
|
@@ -4806,7 +5230,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
4806
5230
|
testVariationId: variant.id,
|
|
4807
5231
|
id: content?.id
|
|
4808
5232
|
}));
|
|
4809
|
-
var
|
|
5233
|
+
var checkShouldRenderVariants2 = ({
|
|
4810
5234
|
canTrack,
|
|
4811
5235
|
content
|
|
4812
5236
|
}) => {
|
|
@@ -4839,25 +5263,6 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4839
5263
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4840
5264
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4841
5265
|
)`;
|
|
4842
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
|
|
4843
|
-
function InlinedScript(props) {
|
|
4844
|
-
return (() => {
|
|
4845
|
-
const _el$ = _tmpl$20();
|
|
4846
|
-
effect((_p$) => {
|
|
4847
|
-
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
4848
|
-
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
4849
|
-
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
4850
|
-
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
4851
|
-
return _p$;
|
|
4852
|
-
}, {
|
|
4853
|
-
_v$: void 0,
|
|
4854
|
-
_v$2: void 0,
|
|
4855
|
-
_v$3: void 0
|
|
4856
|
-
});
|
|
4857
|
-
return _el$;
|
|
4858
|
-
})();
|
|
4859
|
-
}
|
|
4860
|
-
var inlined_script_default = InlinedScript;
|
|
4861
5266
|
|
|
4862
5267
|
// src/helpers/preview-lru-cache/get.ts
|
|
4863
5268
|
function getPreviewContent(_searchParams) {
|
|
@@ -4865,7 +5270,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4865
5270
|
}
|
|
4866
5271
|
|
|
4867
5272
|
// src/constants/sdk-version.ts
|
|
4868
|
-
var SDK_VERSION = "3.0.
|
|
5273
|
+
var SDK_VERSION = "3.0.6";
|
|
4869
5274
|
|
|
4870
5275
|
// src/helpers/sdk-headers.ts
|
|
4871
5276
|
var getSdkHeaders = () => ({
|
|
@@ -5160,16 +5565,6 @@ async function fetchEntries(options) {
|
|
|
5160
5565
|
return _processContentResult(options, content);
|
|
5161
5566
|
}
|
|
5162
5567
|
|
|
5163
|
-
// src/functions/is-previewing.ts
|
|
5164
|
-
function isPreviewing(_search) {
|
|
5165
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
5166
|
-
if (!search) {
|
|
5167
|
-
return false;
|
|
5168
|
-
}
|
|
5169
|
-
const normalizedSearch = getSearchString(search);
|
|
5170
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
5171
|
-
}
|
|
5172
|
-
|
|
5173
5568
|
// src/helpers/uuid.ts
|
|
5174
5569
|
function uuidv4() {
|
|
5175
5570
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -5492,7 +5887,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
5492
5887
|
// Supports builder-model="..." attribute which is needed to
|
|
5493
5888
|
// scope our '+ add block' button styling
|
|
5494
5889
|
supportsAddBlockScoping: true,
|
|
5495
|
-
supportsCustomBreakpoints: true
|
|
5890
|
+
supportsCustomBreakpoints: true,
|
|
5891
|
+
blockLevelPersonalization: true
|
|
5496
5892
|
}
|
|
5497
5893
|
}, "*");
|
|
5498
5894
|
window.parent?.postMessage({
|
|
@@ -6228,7 +6624,7 @@ var content_default = ContentComponent;
|
|
|
6228
6624
|
|
|
6229
6625
|
// src/components/content-variants/content-variants.tsx
|
|
6230
6626
|
function ContentVariants(props) {
|
|
6231
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
6627
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
|
|
6232
6628
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6233
6629
|
content: props.content
|
|
6234
6630
|
}));
|
|
@@ -6454,7 +6850,7 @@ var fetchSymbolContent = async ({
|
|
|
6454
6850
|
};
|
|
6455
6851
|
|
|
6456
6852
|
// src/blocks/symbol/symbol.tsx
|
|
6457
|
-
var _tmpl$
|
|
6853
|
+
var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
|
|
6458
6854
|
function Symbol(props) {
|
|
6459
6855
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
6460
6856
|
const blocksWrapper = createMemo(() => {
|
|
@@ -6486,7 +6882,7 @@ function Symbol(props) {
|
|
|
6486
6882
|
}
|
|
6487
6883
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6488
6884
|
return (() => {
|
|
6489
|
-
const _el$ = _tmpl$
|
|
6885
|
+
const _el$ = _tmpl$30();
|
|
6490
6886
|
spread(_el$, mergeProps({
|
|
6491
6887
|
get ["class"]() {
|
|
6492
6888
|
return className();
|
|
@@ -6578,4 +6974,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
6578
6974
|
};
|
|
6579
6975
|
};
|
|
6580
6976
|
|
|
6581
|
-
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 };
|
|
6977
|
+
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 };
|