@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/edge/dev.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
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
5
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -4797,7 +4797,7 @@ function Block(props) {
|
|
|
4797
4797
|
});
|
|
4798
4798
|
}
|
|
4799
4799
|
var block_default = Block;
|
|
4800
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
4800
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
|
|
4801
4801
|
display: flex;
|
|
4802
4802
|
flex-direction: column;
|
|
4803
4803
|
align-items: stretch;
|
|
@@ -4810,8 +4810,9 @@ function BlocksWrapper(props) {
|
|
|
4810
4810
|
if (!props.path) {
|
|
4811
4811
|
return void 0;
|
|
4812
4812
|
}
|
|
4813
|
+
const thisPrefix = "this.";
|
|
4813
4814
|
const pathPrefix = "component.options.";
|
|
4814
|
-
return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4815
|
+
return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
|
|
4815
4816
|
});
|
|
4816
4817
|
function onClick() {
|
|
4817
4818
|
if (isEditing() && !props.blocks?.length) {
|
|
@@ -4840,7 +4841,7 @@ function BlocksWrapper(props) {
|
|
|
4840
4841
|
});
|
|
4841
4842
|
return [createComponent(Dynamic, mergeProps({
|
|
4842
4843
|
get ["class"]() {
|
|
4843
|
-
return className() + " dynamic-
|
|
4844
|
+
return className() + " dynamic-3d7ff108";
|
|
4844
4845
|
},
|
|
4845
4846
|
ref(r$) {
|
|
4846
4847
|
const _ref$ = blocksWrapperRef;
|
|
@@ -4939,7 +4940,7 @@ var getColumnsClass = (id2) => {
|
|
|
4939
4940
|
|
|
4940
4941
|
// src/blocks/columns/columns.tsx
|
|
4941
4942
|
var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
|
|
4942
|
-
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-
|
|
4943
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
|
|
4943
4944
|
display: flex;
|
|
4944
4945
|
line-height: normal;
|
|
4945
4946
|
}`);
|
|
@@ -5068,7 +5069,7 @@ function Columns(props) {
|
|
|
5068
5069
|
const _el$ = _tmpl$3();
|
|
5069
5070
|
spread(_el$, mergeProps({
|
|
5070
5071
|
get ["class"]() {
|
|
5071
|
-
return getColumnsClass(props.builderBlock?.id) + " div-
|
|
5072
|
+
return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
|
|
5072
5073
|
},
|
|
5073
5074
|
get style() {
|
|
5074
5075
|
return columnsCssVars();
|
|
@@ -5109,9 +5110,6 @@ function Columns(props) {
|
|
|
5109
5110
|
get parent() {
|
|
5110
5111
|
return props.builderBlock.id;
|
|
5111
5112
|
},
|
|
5112
|
-
styleProp: {
|
|
5113
|
-
flexGrow: "1"
|
|
5114
|
-
},
|
|
5115
5113
|
get context() {
|
|
5116
5114
|
return props.builderContext;
|
|
5117
5115
|
},
|
|
@@ -5123,6 +5121,9 @@ function Columns(props) {
|
|
|
5123
5121
|
},
|
|
5124
5122
|
get blocks() {
|
|
5125
5123
|
return column.blocks;
|
|
5124
|
+
},
|
|
5125
|
+
styleProp: {
|
|
5126
|
+
"flex-grow": "1"
|
|
5126
5127
|
}
|
|
5127
5128
|
});
|
|
5128
5129
|
}
|
|
@@ -5193,16 +5194,16 @@ function getSrcSet(url) {
|
|
|
5193
5194
|
// src/blocks/image/image.tsx
|
|
5194
5195
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
5195
5196
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
5196
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
5197
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
5198
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
5197
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
|
|
5198
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
|
|
5199
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
|
|
5199
5200
|
opacity: 1;
|
|
5200
5201
|
transition: opacity 0.2s ease-in-out;
|
|
5201
|
-
}.div-
|
|
5202
|
+
}.div-dc6700b4 {
|
|
5202
5203
|
width: 100%;
|
|
5203
5204
|
pointer-events: none;
|
|
5204
5205
|
font-size: 0;
|
|
5205
|
-
}.div-
|
|
5206
|
+
}.div-dc6700b4-2 {
|
|
5206
5207
|
display: flex;
|
|
5207
5208
|
flex-direction: column;
|
|
5208
5209
|
align-items: stretch;
|
|
@@ -5252,8 +5253,6 @@ function Image(props) {
|
|
|
5252
5253
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
5253
5254
|
return out;
|
|
5254
5255
|
});
|
|
5255
|
-
onMount(() => {
|
|
5256
|
-
});
|
|
5257
5256
|
return [[(() => {
|
|
5258
5257
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
5259
5258
|
insert(_el$, createComponent(Show, {
|
|
@@ -5267,7 +5266,7 @@ function Image(props) {
|
|
|
5267
5266
|
}
|
|
5268
5267
|
}), _el$3);
|
|
5269
5268
|
effect((_p$) => {
|
|
5270
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
5269
|
+
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 = {
|
|
5271
5270
|
"object-position": props.backgroundPosition || "center",
|
|
5272
5271
|
"object-fit": props.backgroundSize || "cover",
|
|
5273
5272
|
...aspectRatioCss()
|
|
@@ -5536,8 +5535,58 @@ var handleABTesting = async ({
|
|
|
5536
5535
|
};
|
|
5537
5536
|
};
|
|
5538
5537
|
|
|
5538
|
+
// src/helpers/user-attributes.ts
|
|
5539
|
+
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5540
|
+
function createUserAttributesService() {
|
|
5541
|
+
let canTrack = true;
|
|
5542
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
5543
|
+
return {
|
|
5544
|
+
setUserAttributes(newAttrs) {
|
|
5545
|
+
if (!isBrowser()) {
|
|
5546
|
+
return;
|
|
5547
|
+
}
|
|
5548
|
+
const userAttributes = {
|
|
5549
|
+
...this.getUserAttributes(),
|
|
5550
|
+
...newAttrs
|
|
5551
|
+
};
|
|
5552
|
+
setCookie({
|
|
5553
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5554
|
+
value: JSON.stringify(userAttributes),
|
|
5555
|
+
canTrack
|
|
5556
|
+
});
|
|
5557
|
+
subscribers.forEach((callback) => callback(userAttributes));
|
|
5558
|
+
},
|
|
5559
|
+
getUserAttributes() {
|
|
5560
|
+
if (!isBrowser()) {
|
|
5561
|
+
return {};
|
|
5562
|
+
}
|
|
5563
|
+
return JSON.parse(getCookieSync({
|
|
5564
|
+
name: USER_ATTRIBUTES_COOKIE_NAME,
|
|
5565
|
+
canTrack
|
|
5566
|
+
}) || "{}");
|
|
5567
|
+
},
|
|
5568
|
+
subscribeOnUserAttributesChange(callback) {
|
|
5569
|
+
subscribers.add(callback);
|
|
5570
|
+
return () => {
|
|
5571
|
+
subscribers.delete(callback);
|
|
5572
|
+
};
|
|
5573
|
+
},
|
|
5574
|
+
setCanTrack(value) {
|
|
5575
|
+
canTrack = value;
|
|
5576
|
+
}
|
|
5577
|
+
};
|
|
5578
|
+
}
|
|
5579
|
+
var userAttributesService = createUserAttributesService();
|
|
5580
|
+
var setClientUserAttributes = (attributes) => {
|
|
5581
|
+
userAttributesService.setUserAttributes(attributes);
|
|
5582
|
+
};
|
|
5583
|
+
|
|
5539
5584
|
// src/helpers/canTrack.ts
|
|
5540
|
-
var getDefaultCanTrack = (canTrack) =>
|
|
5585
|
+
var getDefaultCanTrack = (canTrack) => {
|
|
5586
|
+
const result = checkIsDefined(canTrack) ? canTrack : true;
|
|
5587
|
+
userAttributesService.setCanTrack(result);
|
|
5588
|
+
return result;
|
|
5589
|
+
};
|
|
5541
5590
|
|
|
5542
5591
|
// src/blocks/accordion/component-info.ts
|
|
5543
5592
|
var defaultTitle = {
|
|
@@ -6268,8 +6317,408 @@ var componentInfo5 = {
|
|
|
6268
6317
|
}
|
|
6269
6318
|
};
|
|
6270
6319
|
|
|
6271
|
-
// src/blocks/
|
|
6320
|
+
// src/blocks/personalization-container/component-info.ts
|
|
6272
6321
|
var componentInfo6 = {
|
|
6322
|
+
name: "PersonalizationContainer",
|
|
6323
|
+
shouldReceiveBuilderProps: {
|
|
6324
|
+
builderBlock: true,
|
|
6325
|
+
builderContext: true
|
|
6326
|
+
},
|
|
6327
|
+
noWrap: true,
|
|
6328
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
6329
|
+
canHaveChildren: true,
|
|
6330
|
+
inputs: [{
|
|
6331
|
+
name: "variants",
|
|
6332
|
+
defaultValue: [],
|
|
6333
|
+
behavior: "personalizationVariantList",
|
|
6334
|
+
type: "list",
|
|
6335
|
+
subFields: [{
|
|
6336
|
+
name: "name",
|
|
6337
|
+
type: "text"
|
|
6338
|
+
}, {
|
|
6339
|
+
name: "query",
|
|
6340
|
+
friendlyName: "Targeting rules",
|
|
6341
|
+
type: "BuilderQuery",
|
|
6342
|
+
defaultValue: []
|
|
6343
|
+
}, {
|
|
6344
|
+
name: "startDate",
|
|
6345
|
+
type: "date"
|
|
6346
|
+
}, {
|
|
6347
|
+
name: "endDate",
|
|
6348
|
+
type: "date"
|
|
6349
|
+
}, {
|
|
6350
|
+
name: "blocks",
|
|
6351
|
+
type: "uiBlocks",
|
|
6352
|
+
hideFromUI: true,
|
|
6353
|
+
defaultValue: []
|
|
6354
|
+
}]
|
|
6355
|
+
}]
|
|
6356
|
+
};
|
|
6357
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
|
|
6358
|
+
function InlinedScript(props) {
|
|
6359
|
+
return (() => {
|
|
6360
|
+
const _el$ = _tmpl$8();
|
|
6361
|
+
effect((_p$) => {
|
|
6362
|
+
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
6363
|
+
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
6364
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
6365
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
6366
|
+
return _p$;
|
|
6367
|
+
}, {
|
|
6368
|
+
_v$: void 0,
|
|
6369
|
+
_v$2: void 0,
|
|
6370
|
+
_v$3: void 0
|
|
6371
|
+
});
|
|
6372
|
+
return _el$;
|
|
6373
|
+
})();
|
|
6374
|
+
}
|
|
6375
|
+
var inlined_script_default = InlinedScript;
|
|
6376
|
+
|
|
6377
|
+
// src/functions/is-previewing.ts
|
|
6378
|
+
function isPreviewing(_search) {
|
|
6379
|
+
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
6380
|
+
if (!search) {
|
|
6381
|
+
return false;
|
|
6382
|
+
}
|
|
6383
|
+
const normalizedSearch = getSearchString(search);
|
|
6384
|
+
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
6385
|
+
}
|
|
6386
|
+
|
|
6387
|
+
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
6388
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
6389
|
+
function isString(val) {
|
|
6390
|
+
return typeof val === "string";
|
|
6391
|
+
}
|
|
6392
|
+
function isNumber(val) {
|
|
6393
|
+
return typeof val === "number";
|
|
6394
|
+
}
|
|
6395
|
+
function objectMatchesQuery(userattr, query2) {
|
|
6396
|
+
const result = (() => {
|
|
6397
|
+
const property = query2.property;
|
|
6398
|
+
const operator = query2.operator;
|
|
6399
|
+
let testValue = query2.value;
|
|
6400
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
|
|
6401
|
+
testValue = query2.value.slice(0, -1);
|
|
6402
|
+
}
|
|
6403
|
+
if (!(property && operator)) {
|
|
6404
|
+
return true;
|
|
6405
|
+
}
|
|
6406
|
+
if (Array.isArray(testValue)) {
|
|
6407
|
+
if (operator === "isNot") {
|
|
6408
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
6409
|
+
property,
|
|
6410
|
+
operator,
|
|
6411
|
+
value: val
|
|
6412
|
+
}));
|
|
6413
|
+
}
|
|
6414
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
6415
|
+
property,
|
|
6416
|
+
operator,
|
|
6417
|
+
value: val
|
|
6418
|
+
}));
|
|
6419
|
+
}
|
|
6420
|
+
const value = userattr[property];
|
|
6421
|
+
if (Array.isArray(value)) {
|
|
6422
|
+
return value.includes(testValue);
|
|
6423
|
+
}
|
|
6424
|
+
switch (operator) {
|
|
6425
|
+
case "is":
|
|
6426
|
+
return value === testValue;
|
|
6427
|
+
case "isNot":
|
|
6428
|
+
return value !== testValue;
|
|
6429
|
+
case "contains":
|
|
6430
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
6431
|
+
case "startsWith":
|
|
6432
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
6433
|
+
case "endsWith":
|
|
6434
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
6435
|
+
case "greaterThan":
|
|
6436
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
6437
|
+
case "lessThan":
|
|
6438
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
6439
|
+
case "greaterThanOrEqualTo":
|
|
6440
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
6441
|
+
case "lessThanOrEqualTo":
|
|
6442
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
6443
|
+
default:
|
|
6444
|
+
return false;
|
|
6445
|
+
}
|
|
6446
|
+
})();
|
|
6447
|
+
return result;
|
|
6448
|
+
}
|
|
6449
|
+
const item = {
|
|
6450
|
+
query,
|
|
6451
|
+
startDate,
|
|
6452
|
+
endDate
|
|
6453
|
+
};
|
|
6454
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
6455
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
6456
|
+
return false;
|
|
6457
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
6458
|
+
return false;
|
|
6459
|
+
}
|
|
6460
|
+
if (!item.query || !item.query.length) {
|
|
6461
|
+
return true;
|
|
6462
|
+
}
|
|
6463
|
+
return item.query.every((filter) => {
|
|
6464
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
6465
|
+
});
|
|
6466
|
+
}
|
|
6467
|
+
var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
|
|
6468
|
+
if (!navigator.cookieEnabled) {
|
|
6469
|
+
return;
|
|
6470
|
+
}
|
|
6471
|
+
function getCookie(name) {
|
|
6472
|
+
const nameEQ = name + '=';
|
|
6473
|
+
const ca = document.cookie.split(';');
|
|
6474
|
+
for (let i = 0; i < ca.length; i++) {
|
|
6475
|
+
let c = ca[i];
|
|
6476
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
6477
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
6478
|
+
}
|
|
6479
|
+
return null;
|
|
6480
|
+
}
|
|
6481
|
+
function removeVariants() {
|
|
6482
|
+
variants?.forEach(function (_, index) {
|
|
6483
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
6484
|
+
});
|
|
6485
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
6486
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
6487
|
+
}
|
|
6488
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
6489
|
+
if (locale) {
|
|
6490
|
+
attributes.locale = locale;
|
|
6491
|
+
}
|
|
6492
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
6493
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
6494
|
+
});
|
|
6495
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
6496
|
+
if (isDebug) {
|
|
6497
|
+
console.debug('PersonalizationContainer', {
|
|
6498
|
+
attributes,
|
|
6499
|
+
variants,
|
|
6500
|
+
winningVariantIndex
|
|
6501
|
+
});
|
|
6502
|
+
}
|
|
6503
|
+
if (winningVariantIndex !== -1) {
|
|
6504
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
6505
|
+
if (winningVariant) {
|
|
6506
|
+
const parentNode = winningVariant.parentNode;
|
|
6507
|
+
if (parentNode) {
|
|
6508
|
+
const newParent = parentNode.cloneNode(false);
|
|
6509
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
6510
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
6511
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
6512
|
+
}
|
|
6513
|
+
if (isDebug) {
|
|
6514
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
} else if (variants && variants.length > 0) {
|
|
6518
|
+
removeVariants();
|
|
6519
|
+
}
|
|
6520
|
+
}`;
|
|
6521
|
+
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}";
|
|
6522
|
+
|
|
6523
|
+
// src/blocks/personalization-container/helpers.ts
|
|
6524
|
+
function checkShouldRenderVariants(variants, canTrack) {
|
|
6525
|
+
const hasVariants = variants && variants.length > 0;
|
|
6526
|
+
if (TARGET === "reactNative")
|
|
6527
|
+
return false;
|
|
6528
|
+
if (!hasVariants)
|
|
6529
|
+
return false;
|
|
6530
|
+
if (!canTrack)
|
|
6531
|
+
return false;
|
|
6532
|
+
if (TARGET === "vue" || TARGET === "svelte")
|
|
6533
|
+
return true;
|
|
6534
|
+
if (isBrowser())
|
|
6535
|
+
return false;
|
|
6536
|
+
return true;
|
|
6537
|
+
}
|
|
6538
|
+
function getBlocksToRender({
|
|
6539
|
+
variants,
|
|
6540
|
+
previewingIndex,
|
|
6541
|
+
isHydrated,
|
|
6542
|
+
filteredVariants,
|
|
6543
|
+
fallbackBlocks
|
|
6544
|
+
}) {
|
|
6545
|
+
const fallback = {
|
|
6546
|
+
blocks: fallbackBlocks ?? [],
|
|
6547
|
+
path: "this.children"
|
|
6548
|
+
};
|
|
6549
|
+
if (isHydrated && isEditing()) {
|
|
6550
|
+
if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
|
|
6551
|
+
const variant = variants[previewingIndex];
|
|
6552
|
+
return {
|
|
6553
|
+
blocks: variant.blocks,
|
|
6554
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
6555
|
+
};
|
|
6556
|
+
}
|
|
6557
|
+
return fallback;
|
|
6558
|
+
}
|
|
6559
|
+
if (isBrowser()) {
|
|
6560
|
+
const winningVariant = filteredVariants?.[0];
|
|
6561
|
+
if (winningVariant) {
|
|
6562
|
+
return {
|
|
6563
|
+
blocks: winningVariant.blocks,
|
|
6564
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
6565
|
+
};
|
|
6566
|
+
}
|
|
6567
|
+
}
|
|
6568
|
+
return fallback;
|
|
6569
|
+
}
|
|
6570
|
+
var getPersonalizationScript = (variants, blockId, locale) => {
|
|
6571
|
+
return `
|
|
6572
|
+
(function() {
|
|
6573
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
6574
|
+
${PERSONALIZATION_SCRIPT}
|
|
6575
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
|
|
6576
|
+
})();
|
|
6577
|
+
`;
|
|
6578
|
+
};
|
|
6579
|
+
|
|
6580
|
+
// src/blocks/personalization-container/personalization-container.tsx
|
|
6581
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
6582
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
|
|
6583
|
+
function PersonalizationContainer(props) {
|
|
6584
|
+
const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
|
|
6585
|
+
const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
|
|
6586
|
+
const [unsubscribers, setUnsubscribers] = createSignal([]);
|
|
6587
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
|
|
6588
|
+
const [isHydrated, setIsHydrated] = createSignal(false);
|
|
6589
|
+
const filteredVariants = createMemo(() => {
|
|
6590
|
+
return (props.variants || []).filter((variant) => {
|
|
6591
|
+
return filterWithCustomTargeting({
|
|
6592
|
+
...props.builderContext?.rootState?.locale ? {
|
|
6593
|
+
locale: props.builderContext?.rootState?.locale
|
|
6594
|
+
} : {},
|
|
6595
|
+
...userAttributes()
|
|
6596
|
+
}, variant.query, variant.startDate, variant.endDate);
|
|
6597
|
+
});
|
|
6598
|
+
});
|
|
6599
|
+
const blocksToRender = createMemo(() => {
|
|
6600
|
+
return getBlocksToRender({
|
|
6601
|
+
variants: props.variants,
|
|
6602
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
6603
|
+
isHydrated: isHydrated(),
|
|
6604
|
+
filteredVariants: filteredVariants(),
|
|
6605
|
+
previewingIndex: props.previewingIndex
|
|
6606
|
+
});
|
|
6607
|
+
});
|
|
6608
|
+
const hideVariantsStyleString = createMemo(() => {
|
|
6609
|
+
return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
|
|
6610
|
+
});
|
|
6611
|
+
let rootRef;
|
|
6612
|
+
onMount(() => {
|
|
6613
|
+
setIsHydrated(true);
|
|
6614
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
|
|
6615
|
+
setUserAttributes(attrs);
|
|
6616
|
+
});
|
|
6617
|
+
if (!(isEditing() || isPreviewing())) {
|
|
6618
|
+
const variant = filteredVariants()[0];
|
|
6619
|
+
if (rootRef) {
|
|
6620
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
|
|
6621
|
+
detail: {
|
|
6622
|
+
variant: variant || "default",
|
|
6623
|
+
content: props.builderContext?.content
|
|
6624
|
+
},
|
|
6625
|
+
bubbles: true
|
|
6626
|
+
}));
|
|
6627
|
+
const observer = new IntersectionObserver((entries) => {
|
|
6628
|
+
entries.forEach((entry) => {
|
|
6629
|
+
if (entry.isIntersecting && rootRef) {
|
|
6630
|
+
rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
|
|
6631
|
+
detail: {
|
|
6632
|
+
variant: variant || "default",
|
|
6633
|
+
content: props.builderContext?.content
|
|
6634
|
+
},
|
|
6635
|
+
bubbles: true
|
|
6636
|
+
}));
|
|
6637
|
+
}
|
|
6638
|
+
});
|
|
6639
|
+
});
|
|
6640
|
+
observer.observe(rootRef);
|
|
6641
|
+
}
|
|
6642
|
+
}
|
|
6643
|
+
unsubscribers().push(unsub);
|
|
6644
|
+
});
|
|
6645
|
+
return (() => {
|
|
6646
|
+
const _el$ = _tmpl$9();
|
|
6647
|
+
const _ref$ = rootRef;
|
|
6648
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
|
|
6649
|
+
spread(_el$, mergeProps({
|
|
6650
|
+
get ["class"]() {
|
|
6651
|
+
return `builder-personalization-container ${props.attributes?.className || ""}`;
|
|
6652
|
+
}
|
|
6653
|
+
}, () => props.attributes), false, true);
|
|
6654
|
+
insert(_el$, createComponent(Show, {
|
|
6655
|
+
get when() {
|
|
6656
|
+
return shouldRenderVariants();
|
|
6657
|
+
},
|
|
6658
|
+
get children() {
|
|
6659
|
+
return [createComponent(For, {
|
|
6660
|
+
get each() {
|
|
6661
|
+
return props.variants;
|
|
6662
|
+
},
|
|
6663
|
+
children: (variant, _index) => {
|
|
6664
|
+
const index = _index();
|
|
6665
|
+
return (() => {
|
|
6666
|
+
const _el$2 = _tmpl$25();
|
|
6667
|
+
setAttribute(_el$2, "key", index);
|
|
6668
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
6669
|
+
get blocks() {
|
|
6670
|
+
return variant.blocks;
|
|
6671
|
+
},
|
|
6672
|
+
get parent() {
|
|
6673
|
+
return props.builderBlock?.id;
|
|
6674
|
+
},
|
|
6675
|
+
path: `component.options.variants.${index}.blocks`
|
|
6676
|
+
}));
|
|
6677
|
+
effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
|
|
6678
|
+
return _el$2;
|
|
6679
|
+
})();
|
|
6680
|
+
}
|
|
6681
|
+
}), createComponent(inlined_styles_default, {
|
|
6682
|
+
get nonce() {
|
|
6683
|
+
return props.builderContext?.nonce || "";
|
|
6684
|
+
},
|
|
6685
|
+
get styles() {
|
|
6686
|
+
return hideVariantsStyleString();
|
|
6687
|
+
},
|
|
6688
|
+
get id() {
|
|
6689
|
+
return `variants-styles-${props.builderBlock?.id}`;
|
|
6690
|
+
}
|
|
6691
|
+
}), createComponent(inlined_script_default, {
|
|
6692
|
+
get nonce() {
|
|
6693
|
+
return props.builderContext?.nonce || "";
|
|
6694
|
+
},
|
|
6695
|
+
get scriptStr() {
|
|
6696
|
+
return scriptStr();
|
|
6697
|
+
},
|
|
6698
|
+
get id() {
|
|
6699
|
+
return `variants-script-${props.builderBlock?.id}`;
|
|
6700
|
+
}
|
|
6701
|
+
})];
|
|
6702
|
+
}
|
|
6703
|
+
}), null);
|
|
6704
|
+
insert(_el$, createComponent(blocks_default, {
|
|
6705
|
+
get blocks() {
|
|
6706
|
+
return blocksToRender().blocks;
|
|
6707
|
+
},
|
|
6708
|
+
get parent() {
|
|
6709
|
+
return props.builderBlock?.id;
|
|
6710
|
+
},
|
|
6711
|
+
get path() {
|
|
6712
|
+
return blocksToRender().path;
|
|
6713
|
+
}
|
|
6714
|
+
}), null);
|
|
6715
|
+
return _el$;
|
|
6716
|
+
})();
|
|
6717
|
+
}
|
|
6718
|
+
var personalization_container_default = PersonalizationContainer;
|
|
6719
|
+
|
|
6720
|
+
// src/blocks/section/component-info.ts
|
|
6721
|
+
var componentInfo7 = {
|
|
6273
6722
|
name: "Core:Section",
|
|
6274
6723
|
static: true,
|
|
6275
6724
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -6311,7 +6760,7 @@ var componentInfo6 = {
|
|
|
6311
6760
|
};
|
|
6312
6761
|
|
|
6313
6762
|
// src/blocks/slot/component-info.ts
|
|
6314
|
-
var
|
|
6763
|
+
var componentInfo8 = {
|
|
6315
6764
|
name: "Slot",
|
|
6316
6765
|
isRSC: true,
|
|
6317
6766
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -6329,10 +6778,10 @@ var componentInfo7 = {
|
|
|
6329
6778
|
builderComponents: true
|
|
6330
6779
|
}
|
|
6331
6780
|
};
|
|
6332
|
-
var _tmpl$
|
|
6781
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
6333
6782
|
function Slot(props) {
|
|
6334
6783
|
return (() => {
|
|
6335
|
-
const _el$ = _tmpl$
|
|
6784
|
+
const _el$ = _tmpl$10();
|
|
6336
6785
|
_el$.style.setProperty("pointer-events", "auto");
|
|
6337
6786
|
spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
|
|
6338
6787
|
"builder-slot": props.name
|
|
@@ -6360,7 +6809,7 @@ function Slot(props) {
|
|
|
6360
6809
|
var slot_default = Slot;
|
|
6361
6810
|
|
|
6362
6811
|
// src/blocks/symbol/component-info.ts
|
|
6363
|
-
var
|
|
6812
|
+
var componentInfo9 = {
|
|
6364
6813
|
name: "Symbol",
|
|
6365
6814
|
noWrap: true,
|
|
6366
6815
|
static: true,
|
|
@@ -6442,7 +6891,7 @@ var defaultElement = {
|
|
|
6442
6891
|
}
|
|
6443
6892
|
}
|
|
6444
6893
|
};
|
|
6445
|
-
var
|
|
6894
|
+
var componentInfo10 = {
|
|
6446
6895
|
name: "Builder: Tabs",
|
|
6447
6896
|
inputs: [{
|
|
6448
6897
|
name: "tabs",
|
|
@@ -6546,8 +6995,8 @@ var componentInfo9 = {
|
|
|
6546
6995
|
builderLinkComponent: true
|
|
6547
6996
|
}
|
|
6548
6997
|
};
|
|
6549
|
-
var _tmpl$
|
|
6550
|
-
var _tmpl$
|
|
6998
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
|
|
6999
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
6551
7000
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
6552
7001
|
function Tabs(props) {
|
|
6553
7002
|
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
@@ -6562,7 +7011,7 @@ function Tabs(props) {
|
|
|
6562
7011
|
}
|
|
6563
7012
|
}
|
|
6564
7013
|
return (() => {
|
|
6565
|
-
const _el$ = _tmpl$
|
|
7014
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
|
|
6566
7015
|
_el$2.style.setProperty("display", "flex");
|
|
6567
7016
|
_el$2.style.setProperty("flex-direction", "row");
|
|
6568
7017
|
_el$2.style.setProperty("overflow", "auto");
|
|
@@ -6614,7 +7063,7 @@ function Tabs(props) {
|
|
|
6614
7063
|
return activeTabContent(activeTab());
|
|
6615
7064
|
},
|
|
6616
7065
|
get children() {
|
|
6617
|
-
const _el$3 = _tmpl$
|
|
7066
|
+
const _el$3 = _tmpl$11();
|
|
6618
7067
|
insert(_el$3, createComponent(blocks_default, {
|
|
6619
7068
|
get parent() {
|
|
6620
7069
|
return props.builderBlock.id;
|
|
@@ -6646,7 +7095,7 @@ var tabs_default = Tabs;
|
|
|
6646
7095
|
delegateEvents(["click"]);
|
|
6647
7096
|
|
|
6648
7097
|
// src/blocks/text/component-info.ts
|
|
6649
|
-
var
|
|
7098
|
+
var componentInfo11 = {
|
|
6650
7099
|
shouldReceiveBuilderProps: {
|
|
6651
7100
|
builderBlock: TARGET === "reactNative" ? true : false,
|
|
6652
7101
|
builderContext: true
|
|
@@ -6669,10 +7118,10 @@ var componentInfo10 = {
|
|
|
6669
7118
|
textAlign: "center"
|
|
6670
7119
|
}
|
|
6671
7120
|
};
|
|
6672
|
-
var _tmpl$
|
|
7121
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
6673
7122
|
function Text(props) {
|
|
6674
7123
|
return (() => {
|
|
6675
|
-
const _el$ = _tmpl$
|
|
7124
|
+
const _el$ = _tmpl$12();
|
|
6676
7125
|
_el$.style.setProperty("outline", "none");
|
|
6677
7126
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
6678
7127
|
return _el$;
|
|
@@ -6681,7 +7130,7 @@ function Text(props) {
|
|
|
6681
7130
|
var text_default = Text;
|
|
6682
7131
|
|
|
6683
7132
|
// src/blocks/custom-code/component-info.ts
|
|
6684
|
-
var
|
|
7133
|
+
var componentInfo12 = {
|
|
6685
7134
|
name: "Custom Code",
|
|
6686
7135
|
static: true,
|
|
6687
7136
|
requiredPermissions: ["editCode"],
|
|
@@ -6704,7 +7153,7 @@ var componentInfo11 = {
|
|
|
6704
7153
|
advanced: true
|
|
6705
7154
|
}]
|
|
6706
7155
|
};
|
|
6707
|
-
var _tmpl$
|
|
7156
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
|
|
6708
7157
|
function CustomCode(props) {
|
|
6709
7158
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6710
7159
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6739,7 +7188,7 @@ function CustomCode(props) {
|
|
|
6739
7188
|
}
|
|
6740
7189
|
});
|
|
6741
7190
|
return (() => {
|
|
6742
|
-
const _el$ = _tmpl$
|
|
7191
|
+
const _el$ = _tmpl$13();
|
|
6743
7192
|
const _ref$ = elementRef;
|
|
6744
7193
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
6745
7194
|
effect((_p$) => {
|
|
@@ -6757,7 +7206,7 @@ function CustomCode(props) {
|
|
|
6757
7206
|
var custom_code_default = CustomCode;
|
|
6758
7207
|
|
|
6759
7208
|
// src/blocks/embed/component-info.ts
|
|
6760
|
-
var
|
|
7209
|
+
var componentInfo13 = {
|
|
6761
7210
|
name: "Embed",
|
|
6762
7211
|
static: true,
|
|
6763
7212
|
inputs: [{
|
|
@@ -6779,7 +7228,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
6779
7228
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
6780
7229
|
|
|
6781
7230
|
// src/blocks/embed/embed.tsx
|
|
6782
|
-
var _tmpl$
|
|
7231
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
6783
7232
|
function Embed(props) {
|
|
6784
7233
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6785
7234
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6817,7 +7266,7 @@ function Embed(props) {
|
|
|
6817
7266
|
}
|
|
6818
7267
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
6819
7268
|
return (() => {
|
|
6820
|
-
const _el$ = _tmpl$
|
|
7269
|
+
const _el$ = _tmpl$14();
|
|
6821
7270
|
const _ref$ = elem;
|
|
6822
7271
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
6823
7272
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -6827,7 +7276,7 @@ function Embed(props) {
|
|
|
6827
7276
|
var embed_default = Embed;
|
|
6828
7277
|
|
|
6829
7278
|
// src/blocks/form/form/component-info.ts
|
|
6830
|
-
var
|
|
7279
|
+
var componentInfo14 = {
|
|
6831
7280
|
name: "Form:Form",
|
|
6832
7281
|
// editableTags: ['builder-form-error']
|
|
6833
7282
|
defaults: {
|
|
@@ -7083,9 +7532,9 @@ function logFetch(url) {
|
|
|
7083
7532
|
}
|
|
7084
7533
|
|
|
7085
7534
|
// src/blocks/form/form/form.tsx
|
|
7086
|
-
var _tmpl$
|
|
7087
|
-
var _tmpl$
|
|
7088
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
7535
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
|
|
7536
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
|
|
7537
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
|
|
7089
7538
|
padding: 10px;
|
|
7090
7539
|
color: red;
|
|
7091
7540
|
text-align: center;
|
|
@@ -7277,7 +7726,7 @@ function FormComponent(props) {
|
|
|
7277
7726
|
}
|
|
7278
7727
|
let formRef;
|
|
7279
7728
|
return [(() => {
|
|
7280
|
-
const _el$ = _tmpl$
|
|
7729
|
+
const _el$ = _tmpl$27();
|
|
7281
7730
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
7282
7731
|
const _ref$ = formRef;
|
|
7283
7732
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -7295,34 +7744,7 @@ function FormComponent(props) {
|
|
|
7295
7744
|
return props.name;
|
|
7296
7745
|
}
|
|
7297
7746
|
}, {}, {}, () => props.attributes), false, true);
|
|
7298
|
-
insert(_el$,
|
|
7299
|
-
get when() {
|
|
7300
|
-
return props.builderBlock && props.builderBlock.children;
|
|
7301
|
-
},
|
|
7302
|
-
get children() {
|
|
7303
|
-
return createComponent(For, {
|
|
7304
|
-
get each() {
|
|
7305
|
-
return props.builderBlock?.children;
|
|
7306
|
-
},
|
|
7307
|
-
children: (block, _index) => {
|
|
7308
|
-
const idx = _index();
|
|
7309
|
-
return createComponent(block_default, {
|
|
7310
|
-
key: `form-block-${idx}`,
|
|
7311
|
-
block,
|
|
7312
|
-
get context() {
|
|
7313
|
-
return props.builderContext;
|
|
7314
|
-
},
|
|
7315
|
-
get registeredComponents() {
|
|
7316
|
-
return props.builderComponents;
|
|
7317
|
-
},
|
|
7318
|
-
get linkComponent() {
|
|
7319
|
-
return props.builderLinkComponent;
|
|
7320
|
-
}
|
|
7321
|
-
});
|
|
7322
|
-
}
|
|
7323
|
-
});
|
|
7324
|
-
}
|
|
7325
|
-
}), null);
|
|
7747
|
+
insert(_el$, () => props.children, null);
|
|
7326
7748
|
insert(_el$, createComponent(Show, {
|
|
7327
7749
|
get when() {
|
|
7328
7750
|
return submissionState() === "error";
|
|
@@ -7360,7 +7782,7 @@ function FormComponent(props) {
|
|
|
7360
7782
|
return memo(() => submissionState() === "error")() && responseData();
|
|
7361
7783
|
},
|
|
7362
7784
|
get children() {
|
|
7363
|
-
const _el$2 = _tmpl$
|
|
7785
|
+
const _el$2 = _tmpl$15();
|
|
7364
7786
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
7365
7787
|
return _el$2;
|
|
7366
7788
|
}
|
|
@@ -7387,7 +7809,7 @@ function FormComponent(props) {
|
|
|
7387
7809
|
var form_default = FormComponent;
|
|
7388
7810
|
|
|
7389
7811
|
// src/blocks/form/input/component-info.ts
|
|
7390
|
-
var
|
|
7812
|
+
var componentInfo15 = {
|
|
7391
7813
|
name: "Form:Input",
|
|
7392
7814
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
7393
7815
|
inputs: [
|
|
@@ -7439,10 +7861,10 @@ var componentInfo14 = {
|
|
|
7439
7861
|
borderColor: "#ccc"
|
|
7440
7862
|
}
|
|
7441
7863
|
};
|
|
7442
|
-
var _tmpl$
|
|
7864
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
|
|
7443
7865
|
function FormInputComponent(props) {
|
|
7444
7866
|
return (() => {
|
|
7445
|
-
const _el$ = _tmpl$
|
|
7867
|
+
const _el$ = _tmpl$16();
|
|
7446
7868
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
7447
7869
|
get key() {
|
|
7448
7870
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -7472,7 +7894,7 @@ function FormInputComponent(props) {
|
|
|
7472
7894
|
var input_default = FormInputComponent;
|
|
7473
7895
|
|
|
7474
7896
|
// src/blocks/form/select/component-info.ts
|
|
7475
|
-
var
|
|
7897
|
+
var componentInfo16 = {
|
|
7476
7898
|
name: "Form:Select",
|
|
7477
7899
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
7478
7900
|
defaultStyles: {
|
|
@@ -7515,11 +7937,11 @@ var componentInfo15 = {
|
|
|
7515
7937
|
static: true,
|
|
7516
7938
|
noWrap: true
|
|
7517
7939
|
};
|
|
7518
|
-
var _tmpl$
|
|
7519
|
-
var _tmpl$
|
|
7940
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
|
|
7941
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
|
|
7520
7942
|
function SelectComponent(props) {
|
|
7521
7943
|
return (() => {
|
|
7522
|
-
const _el$ = _tmpl$
|
|
7944
|
+
const _el$ = _tmpl$17();
|
|
7523
7945
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
7524
7946
|
get value() {
|
|
7525
7947
|
return props.value;
|
|
@@ -7544,7 +7966,7 @@ function SelectComponent(props) {
|
|
|
7544
7966
|
children: (option, _index) => {
|
|
7545
7967
|
const index = _index();
|
|
7546
7968
|
return (() => {
|
|
7547
|
-
const _el$2 = _tmpl$
|
|
7969
|
+
const _el$2 = _tmpl$28();
|
|
7548
7970
|
insert(_el$2, () => option.name || option.value);
|
|
7549
7971
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
7550
7972
|
effect(() => _el$2.value = option.value);
|
|
@@ -7558,7 +7980,7 @@ function SelectComponent(props) {
|
|
|
7558
7980
|
var select_default = SelectComponent;
|
|
7559
7981
|
|
|
7560
7982
|
// src/blocks/form/submit-button/component-info.ts
|
|
7561
|
-
var
|
|
7983
|
+
var componentInfo17 = {
|
|
7562
7984
|
name: "Form:SubmitButton",
|
|
7563
7985
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
7564
7986
|
defaultStyles: {
|
|
@@ -7584,10 +8006,10 @@ var componentInfo16 = {
|
|
|
7584
8006
|
// TODO: defaultChildren
|
|
7585
8007
|
// canHaveChildren: true,
|
|
7586
8008
|
};
|
|
7587
|
-
var _tmpl$
|
|
8009
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
7588
8010
|
function SubmitButton(props) {
|
|
7589
8011
|
return (() => {
|
|
7590
|
-
const _el$ = _tmpl$
|
|
8012
|
+
const _el$ = _tmpl$18();
|
|
7591
8013
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
7592
8014
|
insert(_el$, () => props.text);
|
|
7593
8015
|
return _el$;
|
|
@@ -7596,7 +8018,7 @@ function SubmitButton(props) {
|
|
|
7596
8018
|
var submit_button_default = SubmitButton;
|
|
7597
8019
|
|
|
7598
8020
|
// src/blocks/form/textarea/component-info.ts
|
|
7599
|
-
var
|
|
8021
|
+
var componentInfo18 = {
|
|
7600
8022
|
name: "Form:TextArea",
|
|
7601
8023
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
7602
8024
|
inputs: [{
|
|
@@ -7633,10 +8055,10 @@ var componentInfo17 = {
|
|
|
7633
8055
|
static: true,
|
|
7634
8056
|
noWrap: true
|
|
7635
8057
|
};
|
|
7636
|
-
var _tmpl$
|
|
8058
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
|
|
7637
8059
|
function Textarea(props) {
|
|
7638
8060
|
return (() => {
|
|
7639
|
-
const _el$ = _tmpl$
|
|
8061
|
+
const _el$ = _tmpl$19();
|
|
7640
8062
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
7641
8063
|
get placeholder() {
|
|
7642
8064
|
return props.placeholder;
|
|
@@ -7660,7 +8082,7 @@ function Textarea(props) {
|
|
|
7660
8082
|
var textarea_default = Textarea;
|
|
7661
8083
|
|
|
7662
8084
|
// src/blocks/img/component-info.ts
|
|
7663
|
-
var
|
|
8085
|
+
var componentInfo19 = {
|
|
7664
8086
|
// friendlyName?
|
|
7665
8087
|
name: "Raw:Img",
|
|
7666
8088
|
hideFromInsertMenu: true,
|
|
@@ -7675,10 +8097,10 @@ var componentInfo18 = {
|
|
|
7675
8097
|
noWrap: true,
|
|
7676
8098
|
static: true
|
|
7677
8099
|
};
|
|
7678
|
-
var _tmpl$
|
|
8100
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
7679
8101
|
function ImgComponent(props) {
|
|
7680
8102
|
return (() => {
|
|
7681
|
-
const _el$ = _tmpl$
|
|
8103
|
+
const _el$ = _tmpl$20();
|
|
7682
8104
|
spread(_el$, mergeProps({
|
|
7683
8105
|
get style() {
|
|
7684
8106
|
return {
|
|
@@ -7702,7 +8124,7 @@ function ImgComponent(props) {
|
|
|
7702
8124
|
var img_default = ImgComponent;
|
|
7703
8125
|
|
|
7704
8126
|
// src/blocks/video/component-info.ts
|
|
7705
|
-
var
|
|
8127
|
+
var componentInfo20 = {
|
|
7706
8128
|
name: "Video",
|
|
7707
8129
|
canHaveChildren: true,
|
|
7708
8130
|
defaultStyles: {
|
|
@@ -7787,8 +8209,8 @@ var componentInfo19 = {
|
|
|
7787
8209
|
builderBlock: true
|
|
7788
8210
|
}
|
|
7789
8211
|
};
|
|
7790
|
-
var _tmpl$
|
|
7791
|
-
var _tmpl$
|
|
8212
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
8213
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
7792
8214
|
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
7793
8215
|
function Video(props) {
|
|
7794
8216
|
const videoProps = createMemo(() => {
|
|
@@ -7831,7 +8253,6 @@ function Video(props) {
|
|
|
7831
8253
|
"object-position": props.position,
|
|
7832
8254
|
// Hack to get object fit to work as expected and
|
|
7833
8255
|
// not have the video overflow
|
|
7834
|
-
"z-index": 2,
|
|
7835
8256
|
"border-radius": "1px",
|
|
7836
8257
|
...props.aspectRatio ? {
|
|
7837
8258
|
position: "absolute"
|
|
@@ -7850,7 +8271,7 @@ function Video(props) {
|
|
|
7850
8271
|
return !props.lazyLoad;
|
|
7851
8272
|
},
|
|
7852
8273
|
get children() {
|
|
7853
|
-
const _el$3 = _tmpl$
|
|
8274
|
+
const _el$3 = _tmpl$21();
|
|
7854
8275
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
7855
8276
|
return _el$3;
|
|
7856
8277
|
}
|
|
@@ -7860,7 +8281,7 @@ function Video(props) {
|
|
|
7860
8281
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
7861
8282
|
},
|
|
7862
8283
|
get children() {
|
|
7863
|
-
const _el$4 = _tmpl$
|
|
8284
|
+
const _el$4 = _tmpl$29();
|
|
7864
8285
|
_el$4.style.setProperty("width", "100%");
|
|
7865
8286
|
_el$4.style.setProperty("pointer-events", "none");
|
|
7866
8287
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -7873,7 +8294,7 @@ function Video(props) {
|
|
|
7873
8294
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
7874
8295
|
},
|
|
7875
8296
|
get children() {
|
|
7876
|
-
const _el$5 = _tmpl$
|
|
8297
|
+
const _el$5 = _tmpl$29();
|
|
7877
8298
|
_el$5.style.setProperty("display", "flex");
|
|
7878
8299
|
_el$5.style.setProperty("flex-direction", "column");
|
|
7879
8300
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -7886,7 +8307,7 @@ function Video(props) {
|
|
|
7886
8307
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
7887
8308
|
},
|
|
7888
8309
|
get children() {
|
|
7889
|
-
const _el$6 = _tmpl$
|
|
8310
|
+
const _el$6 = _tmpl$29();
|
|
7890
8311
|
_el$6.style.setProperty("pointer-events", "none");
|
|
7891
8312
|
_el$6.style.setProperty("display", "flex");
|
|
7892
8313
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -7908,31 +8329,31 @@ var video_default = Video;
|
|
|
7908
8329
|
// src/constants/extra-components.ts
|
|
7909
8330
|
var getExtraComponents = () => [{
|
|
7910
8331
|
component: custom_code_default,
|
|
7911
|
-
...
|
|
8332
|
+
...componentInfo12
|
|
7912
8333
|
}, {
|
|
7913
8334
|
component: embed_default,
|
|
7914
|
-
...
|
|
8335
|
+
...componentInfo13
|
|
7915
8336
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7916
8337
|
component: form_default,
|
|
7917
|
-
...
|
|
8338
|
+
...componentInfo14
|
|
7918
8339
|
}, {
|
|
7919
8340
|
component: input_default,
|
|
7920
|
-
...
|
|
8341
|
+
...componentInfo15
|
|
7921
8342
|
}, {
|
|
7922
8343
|
component: submit_button_default,
|
|
7923
|
-
...
|
|
8344
|
+
...componentInfo17
|
|
7924
8345
|
}, {
|
|
7925
8346
|
component: select_default,
|
|
7926
|
-
...
|
|
8347
|
+
...componentInfo16
|
|
7927
8348
|
}, {
|
|
7928
8349
|
component: textarea_default,
|
|
7929
|
-
...
|
|
8350
|
+
...componentInfo18
|
|
7930
8351
|
}], {
|
|
7931
8352
|
component: img_default,
|
|
7932
|
-
...
|
|
8353
|
+
...componentInfo19
|
|
7933
8354
|
}, {
|
|
7934
8355
|
component: video_default,
|
|
7935
|
-
...
|
|
8356
|
+
...componentInfo20
|
|
7936
8357
|
}];
|
|
7937
8358
|
|
|
7938
8359
|
// src/constants/builder-registered-components.ts
|
|
@@ -7950,19 +8371,22 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7950
8371
|
...componentInfo5
|
|
7951
8372
|
}, {
|
|
7952
8373
|
component: section_default,
|
|
7953
|
-
...
|
|
8374
|
+
...componentInfo7
|
|
7954
8375
|
}, {
|
|
7955
8376
|
component: slot_default,
|
|
7956
|
-
...
|
|
8377
|
+
...componentInfo8
|
|
7957
8378
|
}, {
|
|
7958
8379
|
component: symbol_default,
|
|
7959
|
-
...
|
|
8380
|
+
...componentInfo9
|
|
7960
8381
|
}, {
|
|
7961
8382
|
component: text_default,
|
|
7962
|
-
...
|
|
7963
|
-
}, ...TARGET === "
|
|
8383
|
+
...componentInfo11
|
|
8384
|
+
}, ...TARGET === "react" ? [{
|
|
8385
|
+
component: personalization_container_default,
|
|
8386
|
+
...componentInfo6
|
|
8387
|
+
}] : [], ...TARGET === "rsc" ? [] : [{
|
|
7964
8388
|
component: tabs_default,
|
|
7965
|
-
...
|
|
8389
|
+
...componentInfo10
|
|
7966
8390
|
}, {
|
|
7967
8391
|
component: accordion_default,
|
|
7968
8392
|
...componentInfo
|
|
@@ -8000,7 +8424,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
|
|
|
8000
8424
|
testVariationId: variant.id,
|
|
8001
8425
|
id: content?.id
|
|
8002
8426
|
}));
|
|
8003
|
-
var
|
|
8427
|
+
var checkShouldRenderVariants2 = ({
|
|
8004
8428
|
canTrack,
|
|
8005
8429
|
content
|
|
8006
8430
|
}) => {
|
|
@@ -8033,25 +8457,6 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
8033
8457
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
8034
8458
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
8035
8459
|
)`;
|
|
8036
|
-
var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
|
|
8037
|
-
function InlinedScript(props) {
|
|
8038
|
-
return (() => {
|
|
8039
|
-
const _el$ = _tmpl$20();
|
|
8040
|
-
effect((_p$) => {
|
|
8041
|
-
const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
|
|
8042
|
-
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
8043
|
-
_v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
|
|
8044
|
-
_v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
|
|
8045
|
-
return _p$;
|
|
8046
|
-
}, {
|
|
8047
|
-
_v$: void 0,
|
|
8048
|
-
_v$2: void 0,
|
|
8049
|
-
_v$3: void 0
|
|
8050
|
-
});
|
|
8051
|
-
return _el$;
|
|
8052
|
-
})();
|
|
8053
|
-
}
|
|
8054
|
-
var inlined_script_default = InlinedScript;
|
|
8055
8460
|
|
|
8056
8461
|
// src/helpers/preview-lru-cache/get.ts
|
|
8057
8462
|
function getPreviewContent(_searchParams) {
|
|
@@ -8059,7 +8464,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8059
8464
|
}
|
|
8060
8465
|
|
|
8061
8466
|
// src/constants/sdk-version.ts
|
|
8062
|
-
var SDK_VERSION = "3.0.
|
|
8467
|
+
var SDK_VERSION = "3.0.6";
|
|
8063
8468
|
|
|
8064
8469
|
// src/helpers/sdk-headers.ts
|
|
8065
8470
|
var getSdkHeaders = () => ({
|
|
@@ -8356,16 +8761,6 @@ async function fetchEntries(options) {
|
|
|
8356
8761
|
return _processContentResult(options, content);
|
|
8357
8762
|
}
|
|
8358
8763
|
|
|
8359
|
-
// src/functions/is-previewing.ts
|
|
8360
|
-
function isPreviewing(_search) {
|
|
8361
|
-
const search = _search || (isBrowser() ? window.location.search : void 0);
|
|
8362
|
-
if (!search) {
|
|
8363
|
-
return false;
|
|
8364
|
-
}
|
|
8365
|
-
const normalizedSearch = getSearchString(search);
|
|
8366
|
-
return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
|
|
8367
|
-
}
|
|
8368
|
-
|
|
8369
8764
|
// src/helpers/uuid.ts
|
|
8370
8765
|
function uuidv4() {
|
|
8371
8766
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
@@ -8692,7 +9087,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
8692
9087
|
// Supports builder-model="..." attribute which is needed to
|
|
8693
9088
|
// scope our '+ add block' button styling
|
|
8694
9089
|
supportsAddBlockScoping: true,
|
|
8695
|
-
supportsCustomBreakpoints: true
|
|
9090
|
+
supportsCustomBreakpoints: true,
|
|
9091
|
+
blockLevelPersonalization: true
|
|
8696
9092
|
}
|
|
8697
9093
|
}, "*");
|
|
8698
9094
|
window.parent?.postMessage({
|
|
@@ -9429,7 +9825,7 @@ var content_default = ContentComponent;
|
|
|
9429
9825
|
|
|
9430
9826
|
// src/components/content-variants/content-variants.tsx
|
|
9431
9827
|
function ContentVariants(props) {
|
|
9432
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
9828
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
|
|
9433
9829
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
9434
9830
|
content: props.content
|
|
9435
9831
|
}));
|
|
@@ -9655,7 +10051,7 @@ var fetchSymbolContent = async ({
|
|
|
9655
10051
|
};
|
|
9656
10052
|
|
|
9657
10053
|
// src/blocks/symbol/symbol.tsx
|
|
9658
|
-
var _tmpl$
|
|
10054
|
+
var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
|
|
9659
10055
|
function Symbol2(props) {
|
|
9660
10056
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
9661
10057
|
const blocksWrapper = createMemo(() => {
|
|
@@ -9687,7 +10083,7 @@ function Symbol2(props) {
|
|
|
9687
10083
|
}
|
|
9688
10084
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
9689
10085
|
return (() => {
|
|
9690
|
-
const _el$ = _tmpl$
|
|
10086
|
+
const _el$ = _tmpl$30();
|
|
9691
10087
|
spread(_el$, mergeProps({
|
|
9692
10088
|
get ["class"]() {
|
|
9693
10089
|
return className();
|
|
@@ -9779,4 +10175,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
9779
10175
|
};
|
|
9780
10176
|
};
|
|
9781
10177
|
|
|
9782
|
-
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 };
|
|
10178
|
+
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 };
|