@builder.io/sdk-react 0.12.3 → 0.12.4
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/lib/browser/index.cjs +27 -31
- package/lib/browser/index.mjs +663 -606
- package/lib/browser/{server-entry-f978b3a5.js → server-entry-0e4f0637.js} +1 -2
- package/lib/browser/{server-entry-df9eba5d.cjs → server-entry-bcb725be.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/index.cjs +37 -41
- package/lib/edge/index.mjs +1283 -1226
- package/lib/edge/{server-entry-f978b3a5.js → server-entry-0e4f0637.js} +1 -2
- package/lib/{node/server-entry-df9eba5d.cjs → edge/server-entry-bcb725be.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/index.cjs +6 -10
- package/lib/node/index.mjs +366 -309
- package/lib/node/{server-entry-46908b1b.js → server-entry-9aa733e8.js} +1 -2
- package/lib/{edge/server-entry-df9eba5d.cjs → node/server-entry-bcb725be.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/button/button.types.d.ts +2 -1
- package/types/blocks/columns/columns.types.d.ts +3 -3
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/components/block/block.d.ts +1 -0
- package/types/components/block/components/block-wrapper.d.ts +1 -0
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +4 -1
- package/types/components/block/components/repeated-block.d.ts +3 -5
- package/types/components/blocks/blocks.types.d.ts +1 -0
- package/types/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-block-properties.d.ts +5 -1
- package/types/functions/get-class-prop-name.d.ts +1 -0
- package/types/functions/get-style.d.ts +12 -0
- package/types/functions/transform-block-properties.d.ts +7 -5
- package/types/functions/transform-style-property.d.ts +7 -0
- package/types/helpers/omit.d.ts +1 -0
- package/types/types/builder-block.d.ts +1 -0
- package/types/types/builder-props.d.ts +3 -0
package/lib/node/index.mjs
CHANGED
|
@@ -1,29 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useState, useContext,
|
|
4
|
-
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined,
|
|
5
|
-
import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-
|
|
3
|
+
import { createContext, useState, useContext, useRef, useEffect, createElement } from "react";
|
|
4
|
+
import { T as TARGET, i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-9aa733e8.js";
|
|
5
|
+
import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-9aa733e8.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
|
+
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
8
|
+
function DynamicRenderer(e) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
10
|
+
}
|
|
11
|
+
const getClassPropName = () => {
|
|
12
|
+
switch (TARGET) {
|
|
13
|
+
case "react":
|
|
14
|
+
case "reactNative":
|
|
15
|
+
case "rsc":
|
|
16
|
+
return "className";
|
|
17
|
+
case "svelte":
|
|
18
|
+
case "vue":
|
|
19
|
+
case "solid":
|
|
20
|
+
case "qwik":
|
|
21
|
+
return "class";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
7
24
|
function Button(e) {
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
...e.attributes,
|
|
12
|
-
href: e.link,
|
|
13
|
-
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
14
|
-
role: "button",
|
|
15
|
-
children: e.text
|
|
16
|
-
}
|
|
17
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
18
|
-
"button",
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
DynamicRenderer,
|
|
19
27
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
29
|
+
attributes: {
|
|
30
|
+
...e.attributes,
|
|
31
|
+
[getClassPropName()]: `${e.link ? "" : "builder-button"} ${e.attributes[getClassPropName()] || ""}`,
|
|
32
|
+
...e.link ? {
|
|
33
|
+
href: e.link,
|
|
34
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
35
|
+
role: "link"
|
|
36
|
+
} : {
|
|
37
|
+
role: "button"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
actionAttributes: {},
|
|
24
41
|
children: e.text
|
|
25
42
|
}
|
|
26
|
-
)
|
|
43
|
+
);
|
|
27
44
|
}
|
|
28
45
|
const builderContext = createContext({
|
|
29
46
|
content: null,
|
|
@@ -78,13 +95,13 @@ const getFunctionArguments = ({
|
|
|
78
95
|
rootSetState: r,
|
|
79
96
|
rootState: a
|
|
80
97
|
}) => {
|
|
81
|
-
const
|
|
98
|
+
const l = getFunctionArguments({
|
|
82
99
|
builder: t,
|
|
83
100
|
context: n,
|
|
84
101
|
event: i,
|
|
85
102
|
state: flattenState(a, o, r)
|
|
86
103
|
});
|
|
87
|
-
return new Function(...
|
|
104
|
+
return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
|
|
88
105
|
};
|
|
89
106
|
function flattenState(e, t, n) {
|
|
90
107
|
if (e === t)
|
|
@@ -171,37 +188,37 @@ output;
|
|
|
171
188
|
rootSetState: r,
|
|
172
189
|
rootState: a
|
|
173
190
|
}) => {
|
|
174
|
-
const
|
|
191
|
+
const l = fastClone({
|
|
175
192
|
...a,
|
|
176
193
|
...o
|
|
177
|
-
}),
|
|
194
|
+
}), c = getFunctionArguments({
|
|
178
195
|
builder: t,
|
|
179
196
|
context: n,
|
|
180
197
|
event: i,
|
|
181
|
-
state:
|
|
182
|
-
}),
|
|
198
|
+
state: l
|
|
199
|
+
}), s = getIsolateContext(), d = s.global;
|
|
183
200
|
d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
|
|
184
201
|
console.log(...f);
|
|
185
|
-
}), d.setSync(BUILDER_SET_STATE_NAME, function(f,
|
|
186
|
-
set(a, f,
|
|
187
|
-
}),
|
|
188
|
-
const y = typeof
|
|
202
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(f, h) {
|
|
203
|
+
set(a, f, h), r == null || r(a);
|
|
204
|
+
}), c.forEach(([f, h]) => {
|
|
205
|
+
const y = typeof h == "object" ? new ivm.Reference(
|
|
189
206
|
// workaround: methods with default values for arguments is not being cloned over
|
|
190
207
|
f === "builder" ? {
|
|
191
|
-
...
|
|
192
|
-
getUserAttributes: () =>
|
|
193
|
-
} :
|
|
208
|
+
...h,
|
|
209
|
+
getUserAttributes: () => h.getUserAttributes()
|
|
210
|
+
} : h
|
|
194
211
|
) : null;
|
|
195
212
|
d.setSync(getSyncValName(f), y);
|
|
196
213
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
197
214
|
const g = processCode({
|
|
198
215
|
code: e,
|
|
199
|
-
args:
|
|
200
|
-
}),
|
|
216
|
+
args: c
|
|
217
|
+
}), x = s.evalSync(g);
|
|
201
218
|
try {
|
|
202
|
-
return JSON.parse(
|
|
219
|
+
return JSON.parse(x);
|
|
203
220
|
} catch {
|
|
204
|
-
return
|
|
221
|
+
return x;
|
|
205
222
|
}
|
|
206
223
|
}, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
|
|
207
224
|
function evaluate({
|
|
@@ -217,7 +234,7 @@ function evaluate({
|
|
|
217
234
|
logger.warn("Skipping evaluation of empty code block.");
|
|
218
235
|
return;
|
|
219
236
|
}
|
|
220
|
-
const
|
|
237
|
+
const l = {
|
|
221
238
|
code: parseCode(e, {
|
|
222
239
|
isExpression: a
|
|
223
240
|
}),
|
|
@@ -229,9 +246,9 @@ function evaluate({
|
|
|
229
246
|
localState: n
|
|
230
247
|
};
|
|
231
248
|
try {
|
|
232
|
-
return chooseBrowserOrServerEval(
|
|
233
|
-
} catch (
|
|
234
|
-
logger.error("Failed code evaluation: " +
|
|
249
|
+
return chooseBrowserOrServerEval(l);
|
|
250
|
+
} catch (c) {
|
|
251
|
+
logger.error("Failed code evaluation: " + c.message, {
|
|
235
252
|
code: e
|
|
236
253
|
});
|
|
237
254
|
return;
|
|
@@ -258,15 +275,15 @@ const evaluateBindings = ({
|
|
|
258
275
|
...r.actions
|
|
259
276
|
}
|
|
260
277
|
};
|
|
261
|
-
for (const
|
|
262
|
-
const
|
|
263
|
-
code:
|
|
278
|
+
for (const l in e.bindings) {
|
|
279
|
+
const c = e.bindings[l], s = evaluate({
|
|
280
|
+
code: c,
|
|
264
281
|
localState: n,
|
|
265
282
|
rootState: i,
|
|
266
283
|
rootSetState: o,
|
|
267
284
|
context: t
|
|
268
285
|
});
|
|
269
|
-
set(a,
|
|
286
|
+
set(a, l, s);
|
|
270
287
|
}
|
|
271
288
|
return a;
|
|
272
289
|
};
|
|
@@ -329,15 +346,15 @@ const getComponent = ({
|
|
|
329
346
|
if (!Array.isArray(o))
|
|
330
347
|
return;
|
|
331
348
|
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
332
|
-
return o.map((
|
|
349
|
+
return o.map((c, s) => ({
|
|
333
350
|
context: {
|
|
334
351
|
...t,
|
|
335
352
|
localState: {
|
|
336
353
|
...t.localState,
|
|
337
|
-
$index:
|
|
338
|
-
$item:
|
|
339
|
-
[a]:
|
|
340
|
-
[`$${a}Index`]:
|
|
354
|
+
$index: s,
|
|
355
|
+
$item: c,
|
|
356
|
+
[a]: c,
|
|
357
|
+
[`$${a}Index`]: s
|
|
341
358
|
}
|
|
342
359
|
},
|
|
343
360
|
block: i
|
|
@@ -416,7 +433,7 @@ function BlockStyles(e) {
|
|
|
416
433
|
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
417
434
|
}
|
|
418
435
|
function n() {
|
|
419
|
-
var
|
|
436
|
+
var h;
|
|
420
437
|
const i = getProcessedBlock({
|
|
421
438
|
block: e.block,
|
|
422
439
|
localState: e.context.localState,
|
|
@@ -425,29 +442,29 @@ function BlockStyles(e) {
|
|
|
425
442
|
context: e.context.context,
|
|
426
443
|
shouldEvaluateBindings: !0
|
|
427
444
|
}), o = i.responsiveStyles, r = e.context.content, a = getSizesForBreakpoints(
|
|
428
|
-
((
|
|
429
|
-
),
|
|
445
|
+
((h = r == null ? void 0 : r.meta) == null ? void 0 : h.breakpoints) || {}
|
|
446
|
+
), l = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
|
|
430
447
|
if (!d)
|
|
431
448
|
return "";
|
|
432
|
-
const g =
|
|
449
|
+
const g = l ? createCssClass({
|
|
433
450
|
className: d,
|
|
434
|
-
styles:
|
|
435
|
-
}) : "",
|
|
451
|
+
styles: l
|
|
452
|
+
}) : "", x = c ? createCssClass({
|
|
436
453
|
className: d,
|
|
437
|
-
styles:
|
|
454
|
+
styles: c,
|
|
438
455
|
mediaQuery: getMaxWidthQueryForSize(
|
|
439
456
|
"medium",
|
|
440
457
|
a
|
|
441
458
|
)
|
|
442
|
-
}) : "", f =
|
|
459
|
+
}) : "", f = s ? createCssClass({
|
|
443
460
|
className: d,
|
|
444
|
-
styles:
|
|
461
|
+
styles: s,
|
|
445
462
|
mediaQuery: getMaxWidthQueryForSize(
|
|
446
463
|
"small",
|
|
447
464
|
a
|
|
448
465
|
)
|
|
449
466
|
}) : "";
|
|
450
|
-
return [g,
|
|
467
|
+
return [g, x, f].join(" ");
|
|
451
468
|
}
|
|
452
469
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
453
470
|
}
|
|
@@ -484,10 +501,36 @@ function getBlockActions(e) {
|
|
|
484
501
|
}
|
|
485
502
|
return t;
|
|
486
503
|
}
|
|
504
|
+
function transformStyleProperty({
|
|
505
|
+
style: e
|
|
506
|
+
}) {
|
|
507
|
+
return e;
|
|
508
|
+
}
|
|
509
|
+
const getStyle = ({
|
|
510
|
+
block: e,
|
|
511
|
+
context: t
|
|
512
|
+
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
513
|
+
style: e.style || {},
|
|
514
|
+
context: t,
|
|
515
|
+
block: e
|
|
516
|
+
}));
|
|
517
|
+
function mapStyleObjToStrIfNeeded(e) {
|
|
518
|
+
switch (TARGET) {
|
|
519
|
+
case "svelte":
|
|
520
|
+
case "vue":
|
|
521
|
+
case "solid":
|
|
522
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
523
|
+
case "qwik":
|
|
524
|
+
case "reactNative":
|
|
525
|
+
case "react":
|
|
526
|
+
case "rsc":
|
|
527
|
+
return e;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
487
530
|
function transformBlockProperties({
|
|
488
531
|
properties: e
|
|
489
532
|
}) {
|
|
490
|
-
return e
|
|
533
|
+
return e;
|
|
491
534
|
}
|
|
492
535
|
const extractRelevantRootBlockProperties = (e) => ({
|
|
493
536
|
href: e.href
|
|
@@ -501,8 +544,11 @@ function getBlockProperties({
|
|
|
501
544
|
...extractRelevantRootBlockProperties(e),
|
|
502
545
|
...e.properties,
|
|
503
546
|
"builder-id": e.id,
|
|
504
|
-
style:
|
|
505
|
-
|
|
547
|
+
style: getStyle({
|
|
548
|
+
block: e,
|
|
549
|
+
context: t
|
|
550
|
+
}),
|
|
551
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
|
|
506
552
|
};
|
|
507
553
|
return transformBlockProperties({
|
|
508
554
|
properties: n,
|
|
@@ -510,23 +556,6 @@ function getBlockProperties({
|
|
|
510
556
|
block: e
|
|
511
557
|
});
|
|
512
558
|
}
|
|
513
|
-
function getStyleAttribute(e) {
|
|
514
|
-
switch (TARGET) {
|
|
515
|
-
case "svelte":
|
|
516
|
-
case "vue":
|
|
517
|
-
case "solid":
|
|
518
|
-
return convertStyleMapToCSSArray(e).join(" ");
|
|
519
|
-
case "qwik":
|
|
520
|
-
case "reactNative":
|
|
521
|
-
case "react":
|
|
522
|
-
case "rsc":
|
|
523
|
-
return e;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
527
|
-
function DynamicRenderer(e) {
|
|
528
|
-
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
529
|
-
}
|
|
530
559
|
function BlockWrapper(e) {
|
|
531
560
|
return /* @__PURE__ */ jsx(
|
|
532
561
|
DynamicRenderer,
|
|
@@ -579,7 +608,7 @@ const getWrapperProps = ({
|
|
|
579
608
|
isInteractive: r,
|
|
580
609
|
contextValue: a
|
|
581
610
|
}) => {
|
|
582
|
-
const
|
|
611
|
+
const l = {
|
|
583
612
|
...e,
|
|
584
613
|
/**
|
|
585
614
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -598,7 +627,7 @@ const getWrapperProps = ({
|
|
|
598
627
|
context: n,
|
|
599
628
|
wrapperProps: e,
|
|
600
629
|
includeBlockProps: o
|
|
601
|
-
} :
|
|
630
|
+
} : l;
|
|
602
631
|
};
|
|
603
632
|
function ComponentRef(e) {
|
|
604
633
|
var i;
|
|
@@ -613,6 +642,7 @@ function ComponentRef(e) {
|
|
|
613
642
|
builderBlock: e.builderBlock,
|
|
614
643
|
context: e.context,
|
|
615
644
|
componentRef: e.componentRef,
|
|
645
|
+
linkComponent: e.linkComponent,
|
|
616
646
|
includeBlockProps: e.includeBlockProps,
|
|
617
647
|
isInteractive: e.isInteractive,
|
|
618
648
|
contextValue: e.context
|
|
@@ -622,7 +652,8 @@ function ComponentRef(e) {
|
|
|
622
652
|
{
|
|
623
653
|
block: o,
|
|
624
654
|
context: e.context,
|
|
625
|
-
registeredComponents: e.registeredComponents
|
|
655
|
+
registeredComponents: e.registeredComponents,
|
|
656
|
+
linkComponent: e.linkComponent
|
|
626
657
|
},
|
|
627
658
|
o.id
|
|
628
659
|
))
|
|
@@ -636,12 +667,13 @@ function RepeatedBlock(e) {
|
|
|
636
667
|
{
|
|
637
668
|
block: e.block,
|
|
638
669
|
context: t,
|
|
639
|
-
registeredComponents: e.registeredComponents
|
|
670
|
+
registeredComponents: e.registeredComponents,
|
|
671
|
+
linkComponent: e.linkComponent
|
|
640
672
|
}
|
|
641
673
|
) });
|
|
642
674
|
}
|
|
643
675
|
function Block(e) {
|
|
644
|
-
var d, g,
|
|
676
|
+
var d, g, x;
|
|
645
677
|
function t() {
|
|
646
678
|
return getComponent({
|
|
647
679
|
block: e.block,
|
|
@@ -667,7 +699,8 @@ function Block(e) {
|
|
|
667
699
|
});
|
|
668
700
|
}
|
|
669
701
|
function o() {
|
|
670
|
-
|
|
702
|
+
var h;
|
|
703
|
+
return e.block.tagName === "a" || ((h = i().properties) == null ? void 0 : h.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
671
704
|
}
|
|
672
705
|
function r() {
|
|
673
706
|
var y, I;
|
|
@@ -677,77 +710,86 @@ function Block(e) {
|
|
|
677
710
|
return ("show" in i() ? i().show : !0) && !f;
|
|
678
711
|
}
|
|
679
712
|
function a() {
|
|
680
|
-
var
|
|
681
|
-
return !((
|
|
713
|
+
var h, y;
|
|
714
|
+
return !((h = t == null ? void 0 : t()) != null && h.component) && !n() ? (y = i().children) != null ? y : [] : [];
|
|
682
715
|
}
|
|
683
|
-
function
|
|
684
|
-
var f,
|
|
716
|
+
function l() {
|
|
717
|
+
var f, h, y, I, E, C, v, T, w;
|
|
685
718
|
return {
|
|
686
719
|
blockChildren: (f = i().children) != null ? f : [],
|
|
687
|
-
componentRef: (
|
|
720
|
+
componentRef: (h = t == null ? void 0 : t()) == null ? void 0 : h.component,
|
|
688
721
|
componentOptions: {
|
|
689
722
|
...getBlockComponentOptions(i()),
|
|
690
723
|
builderContext: e.context,
|
|
691
|
-
...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "
|
|
724
|
+
...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
|
|
725
|
+
builderLinkComponent: e.linkComponent
|
|
726
|
+
} : {},
|
|
727
|
+
...((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
|
|
692
728
|
builderComponents: e.registeredComponents
|
|
693
729
|
} : {}
|
|
694
730
|
},
|
|
695
|
-
context:
|
|
731
|
+
context: c,
|
|
732
|
+
linkComponent: e.linkComponent,
|
|
696
733
|
registeredComponents: e.registeredComponents,
|
|
697
734
|
builderBlock: i(),
|
|
698
|
-
includeBlockProps: ((
|
|
699
|
-
isInteractive: !((
|
|
735
|
+
includeBlockProps: ((T = t == null ? void 0 : t()) == null ? void 0 : T.noWrap) === !0,
|
|
736
|
+
isInteractive: !((w = t == null ? void 0 : t()) != null && w.isRSC)
|
|
700
737
|
};
|
|
701
738
|
}
|
|
702
|
-
const [
|
|
739
|
+
const [c, s] = useState(() => e.context);
|
|
703
740
|
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
704
741
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
705
742
|
(d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
706
743
|
ComponentRef,
|
|
707
744
|
{
|
|
708
|
-
componentRef:
|
|
709
|
-
componentOptions:
|
|
710
|
-
blockChildren:
|
|
711
|
-
context:
|
|
712
|
-
registeredComponents:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
745
|
+
componentRef: l().componentRef,
|
|
746
|
+
componentOptions: l().componentOptions,
|
|
747
|
+
blockChildren: l().blockChildren,
|
|
748
|
+
context: l().context,
|
|
749
|
+
registeredComponents: l().registeredComponents,
|
|
750
|
+
linkComponent: l().linkComponent,
|
|
751
|
+
builderBlock: l().builderBlock,
|
|
752
|
+
includeBlockProps: l().includeBlockProps,
|
|
753
|
+
isInteractive: l().isInteractive
|
|
716
754
|
}
|
|
717
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
755
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (x = n()) == null ? void 0 : x.map((f, h) => /* @__PURE__ */ jsx(
|
|
718
756
|
RepeatedBlock,
|
|
719
757
|
{
|
|
720
758
|
repeatContext: f.context,
|
|
721
759
|
block: f.block,
|
|
722
|
-
registeredComponents: e.registeredComponents
|
|
760
|
+
registeredComponents: e.registeredComponents,
|
|
761
|
+
linkComponent: e.linkComponent
|
|
723
762
|
},
|
|
724
|
-
|
|
763
|
+
h
|
|
725
764
|
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
726
765
|
BlockWrapper,
|
|
727
766
|
{
|
|
728
767
|
Wrapper: o(),
|
|
729
768
|
block: i(),
|
|
730
769
|
context: e.context,
|
|
770
|
+
linkComponent: e.linkComponent,
|
|
731
771
|
children: [
|
|
732
772
|
/* @__PURE__ */ jsx(
|
|
733
773
|
ComponentRef,
|
|
734
774
|
{
|
|
735
|
-
componentRef:
|
|
736
|
-
componentOptions:
|
|
737
|
-
blockChildren:
|
|
738
|
-
context:
|
|
739
|
-
registeredComponents:
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
775
|
+
componentRef: l().componentRef,
|
|
776
|
+
componentOptions: l().componentOptions,
|
|
777
|
+
blockChildren: l().blockChildren,
|
|
778
|
+
context: l().context,
|
|
779
|
+
registeredComponents: l().registeredComponents,
|
|
780
|
+
linkComponent: l().linkComponent,
|
|
781
|
+
builderBlock: l().builderBlock,
|
|
782
|
+
includeBlockProps: l().includeBlockProps,
|
|
783
|
+
isInteractive: l().isInteractive
|
|
743
784
|
}
|
|
744
785
|
),
|
|
745
786
|
(g = a()) == null ? void 0 : g.map((f) => /* @__PURE__ */ jsx(
|
|
746
787
|
Block,
|
|
747
788
|
{
|
|
748
789
|
block: f,
|
|
749
|
-
context:
|
|
750
|
-
registeredComponents: e.registeredComponents
|
|
790
|
+
context: c,
|
|
791
|
+
registeredComponents: e.registeredComponents,
|
|
792
|
+
linkComponent: e.linkComponent
|
|
751
793
|
},
|
|
752
794
|
f.id
|
|
753
795
|
))
|
|
@@ -825,6 +867,7 @@ function Blocks(e) {
|
|
|
825
867
|
Block,
|
|
826
868
|
{
|
|
827
869
|
block: a,
|
|
870
|
+
linkComponent: e.linkComponent,
|
|
828
871
|
context: e.context || t,
|
|
829
872
|
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
830
873
|
},
|
|
@@ -840,41 +883,46 @@ function Columns(e) {
|
|
|
840
883
|
), [i, o] = useState(() => e.columns || []), [r, a] = useState(
|
|
841
884
|
() => e.stackColumnsAt || "tablet"
|
|
842
885
|
);
|
|
843
|
-
function
|
|
844
|
-
var
|
|
845
|
-
return ((
|
|
886
|
+
function l(C) {
|
|
887
|
+
var v;
|
|
888
|
+
return ((v = i[C]) == null ? void 0 : v.width) || 100 / i.length;
|
|
846
889
|
}
|
|
847
|
-
function
|
|
848
|
-
const
|
|
849
|
-
return `calc(${
|
|
890
|
+
function c(C) {
|
|
891
|
+
const v = t * (i.length - 1) / i.length;
|
|
892
|
+
return `calc(${l(C)}% - ${v}px)`;
|
|
850
893
|
}
|
|
851
|
-
function
|
|
852
|
-
stackedStyle:
|
|
853
|
-
desktopStyle:
|
|
894
|
+
function s({
|
|
895
|
+
stackedStyle: C,
|
|
896
|
+
desktopStyle: v
|
|
854
897
|
}) {
|
|
855
|
-
return r === "tablet" ?
|
|
898
|
+
return r === "tablet" ? C : v;
|
|
856
899
|
}
|
|
857
900
|
function d({
|
|
858
|
-
stackedStyle:
|
|
859
|
-
desktopStyle:
|
|
901
|
+
stackedStyle: C,
|
|
902
|
+
desktopStyle: v
|
|
860
903
|
}) {
|
|
861
|
-
return r === "never" ?
|
|
904
|
+
return r === "never" ? v : C;
|
|
862
905
|
}
|
|
863
|
-
const [g,
|
|
906
|
+
const [g, x] = useState(
|
|
864
907
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
865
908
|
);
|
|
866
909
|
function f() {
|
|
867
910
|
return {
|
|
868
911
|
"--flex-dir": g,
|
|
869
|
-
"--flex-dir-tablet":
|
|
912
|
+
"--flex-dir-tablet": s({
|
|
870
913
|
stackedStyle: g,
|
|
871
914
|
desktopStyle: "row"
|
|
872
915
|
})
|
|
873
916
|
};
|
|
874
917
|
}
|
|
875
|
-
function
|
|
876
|
-
const
|
|
918
|
+
function h(C) {
|
|
919
|
+
const v = C === 0 ? 0 : t, T = c(C), w = `${v}px`, R = "100%", j = 0;
|
|
877
920
|
return {
|
|
921
|
+
...{
|
|
922
|
+
display: "flex",
|
|
923
|
+
flexDirection: "column",
|
|
924
|
+
alignItems: "stretch"
|
|
925
|
+
},
|
|
878
926
|
width: T,
|
|
879
927
|
["marginLeft"]: w,
|
|
880
928
|
"--column-width-mobile": d({
|
|
@@ -885,21 +933,21 @@ function Columns(e) {
|
|
|
885
933
|
stackedStyle: j,
|
|
886
934
|
desktopStyle: w
|
|
887
935
|
}),
|
|
888
|
-
"--column-width-tablet":
|
|
936
|
+
"--column-width-tablet": s({
|
|
889
937
|
stackedStyle: R,
|
|
890
938
|
desktopStyle: T
|
|
891
939
|
}),
|
|
892
|
-
"--column-margin-left-tablet":
|
|
940
|
+
"--column-margin-left-tablet": s({
|
|
893
941
|
stackedStyle: j,
|
|
894
942
|
desktopStyle: w
|
|
895
943
|
})
|
|
896
944
|
};
|
|
897
945
|
}
|
|
898
|
-
function y(
|
|
946
|
+
function y(C) {
|
|
899
947
|
var T, w;
|
|
900
948
|
return getSizesForBreakpoints(
|
|
901
949
|
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
902
|
-
)[
|
|
950
|
+
)[C].max;
|
|
903
951
|
}
|
|
904
952
|
function I() {
|
|
905
953
|
return `
|
|
@@ -932,41 +980,45 @@ function Columns(e) {
|
|
|
932
980
|
/* @__PURE__ */ jsxs(
|
|
933
981
|
"div",
|
|
934
982
|
{
|
|
935
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
983
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-6f826264`,
|
|
936
984
|
style: f(),
|
|
937
985
|
children: [
|
|
938
986
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
|
|
939
|
-
(E = e.columns) == null ? void 0 : E.map((
|
|
940
|
-
|
|
987
|
+
(E = e.columns) == null ? void 0 : E.map((C, v) => /* @__PURE__ */ jsx(
|
|
988
|
+
DynamicRenderer,
|
|
941
989
|
{
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
990
|
+
TagName: C.link ? e.builderLinkComponent || "a" : "div",
|
|
991
|
+
actionAttributes: {},
|
|
992
|
+
attributes: {
|
|
993
|
+
...C.link ? {
|
|
994
|
+
href: C.link
|
|
995
|
+
} : {},
|
|
996
|
+
[getClassPropName()]: "builder-column",
|
|
997
|
+
style: mapStyleObjToStrIfNeeded(h(v))
|
|
998
|
+
},
|
|
999
|
+
children: /* @__PURE__ */ jsx(
|
|
1000
|
+
Blocks,
|
|
1001
|
+
{
|
|
1002
|
+
path: `component.options.columns.${v}.blocks`,
|
|
1003
|
+
parent: e.builderBlock.id,
|
|
1004
|
+
styleProp: {
|
|
1005
|
+
flexGrow: "1"
|
|
1006
|
+
},
|
|
1007
|
+
context: e.builderContext,
|
|
1008
|
+
registeredComponents: e.builderComponents,
|
|
1009
|
+
linkComponent: e.builderLinkComponent,
|
|
1010
|
+
blocks: C.blocks
|
|
1011
|
+
}
|
|
1012
|
+
)
|
|
945
1013
|
},
|
|
946
|
-
|
|
947
|
-
Blocks,
|
|
948
|
-
{
|
|
949
|
-
path: `component.options.columns.${C}.blocks`,
|
|
950
|
-
parent: e.builderBlock.id,
|
|
951
|
-
styleProp: {
|
|
952
|
-
flexGrow: "1"
|
|
953
|
-
},
|
|
954
|
-
context: e.builderContext,
|
|
955
|
-
registeredComponents: e.builderComponents,
|
|
956
|
-
blocks: v.blocks
|
|
957
|
-
}
|
|
958
|
-
)
|
|
1014
|
+
v
|
|
959
1015
|
))
|
|
960
1016
|
]
|
|
961
1017
|
}
|
|
962
1018
|
),
|
|
963
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
1019
|
+
/* @__PURE__ */ jsx("style", { children: `.div-6f826264 {
|
|
964
1020
|
display: flex;
|
|
965
1021
|
line-height: normal;
|
|
966
|
-
}.div-3c01d6ec-2 {
|
|
967
|
-
display: flex;
|
|
968
|
-
flex-direction: column;
|
|
969
|
-
align-items: stretch;
|
|
970
1022
|
}` })
|
|
971
1023
|
] });
|
|
972
1024
|
}
|
|
@@ -1004,34 +1056,34 @@ function getSrcSet(e) {
|
|
|
1004
1056
|
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
|
|
1005
1057
|
}
|
|
1006
1058
|
function Image(e) {
|
|
1007
|
-
var o, r, a,
|
|
1059
|
+
var o, r, a, l;
|
|
1008
1060
|
function t() {
|
|
1009
1061
|
var d;
|
|
1010
|
-
const
|
|
1011
|
-
if (!
|
|
1062
|
+
const s = e.image || e.src;
|
|
1063
|
+
if (!s || // We can auto add srcset for cdn.builder.io and shopify
|
|
1012
1064
|
// images, otherwise you can supply this prop manually
|
|
1013
|
-
!(
|
|
1065
|
+
!(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
|
|
1014
1066
|
return e.srcset;
|
|
1015
1067
|
if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
|
|
1016
1068
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1017
|
-
return console.debug("Removed given srcset"), getSrcSet(
|
|
1069
|
+
return console.debug("Removed given srcset"), getSrcSet(s);
|
|
1018
1070
|
} else if (e.image && !e.srcset)
|
|
1019
|
-
return getSrcSet(
|
|
1020
|
-
return getSrcSet(
|
|
1071
|
+
return getSrcSet(s);
|
|
1072
|
+
return getSrcSet(s);
|
|
1021
1073
|
}
|
|
1022
1074
|
function n() {
|
|
1023
|
-
var
|
|
1024
|
-
return (
|
|
1075
|
+
var c;
|
|
1076
|
+
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1025
1077
|
}
|
|
1026
1078
|
function i() {
|
|
1027
|
-
const
|
|
1079
|
+
const c = {
|
|
1028
1080
|
position: "absolute",
|
|
1029
1081
|
height: "100%",
|
|
1030
1082
|
width: "100%",
|
|
1031
1083
|
left: "0px",
|
|
1032
1084
|
top: "0px"
|
|
1033
1085
|
};
|
|
1034
|
-
return e.aspectRatio ?
|
|
1086
|
+
return e.aspectRatio ? c : void 0;
|
|
1035
1087
|
}
|
|
1036
1088
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1037
1089
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1064,7 +1116,7 @@ function Image(e) {
|
|
|
1064
1116
|
}
|
|
1065
1117
|
}
|
|
1066
1118
|
) }) : null,
|
|
1067
|
-
(
|
|
1119
|
+
(l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1068
1120
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
1069
1121
|
] }),
|
|
1070
1122
|
/* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
|
|
@@ -1319,7 +1371,7 @@ const componentInfo$b = {
|
|
|
1319
1371
|
});
|
|
1320
1372
|
}
|
|
1321
1373
|
const n = e.get("columns");
|
|
1322
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((
|
|
1374
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((l, c) => l + c.get("width"), 0) !== 100) && t();
|
|
1323
1375
|
}
|
|
1324
1376
|
}, {
|
|
1325
1377
|
name: "space",
|
|
@@ -1367,27 +1419,27 @@ const componentInfo$b = {
|
|
|
1367
1419
|
function CustomCode(e) {
|
|
1368
1420
|
const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []);
|
|
1369
1421
|
return useEffect(() => {
|
|
1370
|
-
var
|
|
1371
|
-
if (!((
|
|
1422
|
+
var l;
|
|
1423
|
+
if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
|
|
1372
1424
|
return;
|
|
1373
1425
|
const a = t.current.getElementsByTagName("script");
|
|
1374
|
-
for (let
|
|
1375
|
-
const
|
|
1376
|
-
if (
|
|
1377
|
-
if (n.includes(
|
|
1426
|
+
for (let c = 0; c < a.length; c++) {
|
|
1427
|
+
const s = a[c];
|
|
1428
|
+
if (s.src) {
|
|
1429
|
+
if (n.includes(s.src))
|
|
1378
1430
|
continue;
|
|
1379
|
-
n.push(
|
|
1431
|
+
n.push(s.src);
|
|
1380
1432
|
const d = document.createElement("script");
|
|
1381
|
-
d.async = !0, d.src =
|
|
1382
|
-
} else if (!
|
|
1433
|
+
d.async = !0, d.src = s.src, document.head.appendChild(d);
|
|
1434
|
+
} else if (!s.type || [
|
|
1383
1435
|
"text/javascript",
|
|
1384
1436
|
"application/javascript",
|
|
1385
1437
|
"application/ecmascript"
|
|
1386
|
-
].includes(
|
|
1387
|
-
if (o.includes(
|
|
1438
|
+
].includes(s.type)) {
|
|
1439
|
+
if (o.includes(s.innerText))
|
|
1388
1440
|
continue;
|
|
1389
1441
|
try {
|
|
1390
|
-
o.push(
|
|
1442
|
+
o.push(s.innerText), new Function(s.innerText)();
|
|
1391
1443
|
} catch (d) {
|
|
1392
1444
|
console.warn("`CustomCode`: Error running script:", d);
|
|
1393
1445
|
}
|
|
@@ -1429,27 +1481,27 @@ const componentInfo$8 = {
|
|
|
1429
1481
|
}]
|
|
1430
1482
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1431
1483
|
function Embed(e) {
|
|
1432
|
-
const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a,
|
|
1433
|
-
function
|
|
1484
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a, l] = useState(() => !1);
|
|
1485
|
+
function c() {
|
|
1434
1486
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1435
1487
|
return;
|
|
1436
|
-
const
|
|
1437
|
-
for (let d = 0; d <
|
|
1438
|
-
const g =
|
|
1488
|
+
const s = t.current.getElementsByTagName("script");
|
|
1489
|
+
for (let d = 0; d < s.length; d++) {
|
|
1490
|
+
const g = s[d];
|
|
1439
1491
|
if (g.src && !n.includes(g.src)) {
|
|
1440
1492
|
n.push(g.src);
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1493
|
+
const x = document.createElement("script");
|
|
1494
|
+
x.async = !0, x.src = g.src, document.head.appendChild(x);
|
|
1443
1495
|
} else if (isJsScript(g) && !o.includes(g.innerText))
|
|
1444
1496
|
try {
|
|
1445
1497
|
o.push(g.innerText), new Function(g.innerText)();
|
|
1446
|
-
} catch (
|
|
1447
|
-
console.warn("`Embed`: Error running script:",
|
|
1498
|
+
} catch (x) {
|
|
1499
|
+
console.warn("`Embed`: Error running script:", x);
|
|
1448
1500
|
}
|
|
1449
1501
|
}
|
|
1450
1502
|
}
|
|
1451
1503
|
return useEffect(() => {
|
|
1452
|
-
t.current && !a && (
|
|
1504
|
+
t.current && !a && (l(!0), c());
|
|
1453
1505
|
}, [t.current, a]), /* @__PURE__ */ jsx(
|
|
1454
1506
|
"div",
|
|
1455
1507
|
{
|
|
@@ -1485,17 +1537,17 @@ const componentInfo$7 = {
|
|
|
1485
1537
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1486
1538
|
onChange: (e) => {
|
|
1487
1539
|
e.delete("srcset"), e.delete("noWebp");
|
|
1488
|
-
function n(a,
|
|
1489
|
-
return new Promise((
|
|
1540
|
+
function n(a, l = 6e4) {
|
|
1541
|
+
return new Promise((c, s) => {
|
|
1490
1542
|
const d = document.createElement("img");
|
|
1491
1543
|
let g = !1;
|
|
1492
1544
|
d.onload = () => {
|
|
1493
|
-
g = !0,
|
|
1494
|
-
}, d.addEventListener("error", (
|
|
1495
|
-
console.warn("Image load failed",
|
|
1545
|
+
g = !0, c(d);
|
|
1546
|
+
}, d.addEventListener("error", (x) => {
|
|
1547
|
+
console.warn("Image load failed", x.error), s(x.error);
|
|
1496
1548
|
}), d.src = a, setTimeout(() => {
|
|
1497
|
-
g ||
|
|
1498
|
-
},
|
|
1549
|
+
g || s(new Error("Image load timed out"));
|
|
1550
|
+
}, l);
|
|
1499
1551
|
});
|
|
1500
1552
|
}
|
|
1501
1553
|
function i(a) {
|
|
@@ -1506,8 +1558,8 @@ const componentInfo$7 = {
|
|
|
1506
1558
|
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1507
1559
|
}), o && (!r || r === 0.7041))
|
|
1508
1560
|
return n(o).then((a) => {
|
|
1509
|
-
const
|
|
1510
|
-
e.get("image") === o && (!
|
|
1561
|
+
const l = e.get("aspectRatio");
|
|
1562
|
+
e.get("image") === o && (!l || l === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
|
|
1511
1563
|
});
|
|
1512
1564
|
}
|
|
1513
1565
|
}, {
|
|
@@ -1819,7 +1871,7 @@ const componentInfo = {
|
|
|
1819
1871
|
}]
|
|
1820
1872
|
};
|
|
1821
1873
|
function Video(e) {
|
|
1822
|
-
var i, o, r, a, c, s
|
|
1874
|
+
var i, o, r, a, l, c, s;
|
|
1823
1875
|
function t() {
|
|
1824
1876
|
return {
|
|
1825
1877
|
...e.autoPlay === !0 ? {
|
|
@@ -1887,7 +1939,7 @@ function Video(e) {
|
|
|
1887
1939
|
}
|
|
1888
1940
|
}
|
|
1889
1941
|
) }) : null,
|
|
1890
|
-
(
|
|
1942
|
+
(l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1891
1943
|
"div",
|
|
1892
1944
|
{
|
|
1893
1945
|
style: {
|
|
@@ -1898,7 +1950,7 @@ function Video(e) {
|
|
|
1898
1950
|
children: e.children
|
|
1899
1951
|
}
|
|
1900
1952
|
) }) : null,
|
|
1901
|
-
(
|
|
1953
|
+
(s = (c = e.builderBlock) == null ? void 0 : c.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1902
1954
|
"div",
|
|
1903
1955
|
{
|
|
1904
1956
|
style: {
|
|
@@ -2120,7 +2172,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2120
2172
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2121
2173
|
}
|
|
2122
2174
|
};
|
|
2123
|
-
}, SDK_VERSION = "0.12.
|
|
2175
|
+
}, SDK_VERSION = "0.12.4", registerInsertMenu = () => {
|
|
2124
2176
|
register("insertMenu", {
|
|
2125
2177
|
name: "_default",
|
|
2126
2178
|
default: !0,
|
|
@@ -2172,25 +2224,25 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2172
2224
|
if (o != null && o.type)
|
|
2173
2225
|
switch (o.type) {
|
|
2174
2226
|
case "builder.evaluate": {
|
|
2175
|
-
const
|
|
2176
|
-
let g,
|
|
2227
|
+
const l = o.data.text, c = o.data.arguments || [], s = o.data.id, d = new Function(l);
|
|
2228
|
+
let g, x = null;
|
|
2177
2229
|
try {
|
|
2178
|
-
g = d.apply(null,
|
|
2230
|
+
g = d.apply(null, c);
|
|
2179
2231
|
} catch (f) {
|
|
2180
|
-
|
|
2232
|
+
x = f;
|
|
2181
2233
|
}
|
|
2182
|
-
|
|
2234
|
+
x ? (r = window.parent) == null || r.postMessage({
|
|
2183
2235
|
type: "builder.evaluateError",
|
|
2184
2236
|
data: {
|
|
2185
|
-
id:
|
|
2186
|
-
error:
|
|
2237
|
+
id: s,
|
|
2238
|
+
error: x.message
|
|
2187
2239
|
}
|
|
2188
2240
|
}, "*") : g && typeof g.then == "function" ? g.then((f) => {
|
|
2189
|
-
var
|
|
2190
|
-
(
|
|
2241
|
+
var h;
|
|
2242
|
+
(h = window.parent) == null || h.postMessage({
|
|
2191
2243
|
type: "builder.evaluateResult",
|
|
2192
2244
|
data: {
|
|
2193
|
-
id:
|
|
2245
|
+
id: s,
|
|
2194
2246
|
result: f
|
|
2195
2247
|
}
|
|
2196
2248
|
}, "*");
|
|
@@ -2198,7 +2250,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2198
2250
|
type: "builder.evaluateResult",
|
|
2199
2251
|
data: {
|
|
2200
2252
|
result: g,
|
|
2201
|
-
id:
|
|
2253
|
+
id: s
|
|
2202
2254
|
}
|
|
2203
2255
|
}, "*");
|
|
2204
2256
|
break;
|
|
@@ -2207,56 +2259,56 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2207
2259
|
})));
|
|
2208
2260
|
};
|
|
2209
2261
|
function EnableEditor(e) {
|
|
2210
|
-
var j, P, A, F, _, V,
|
|
2262
|
+
var j, P, A, F, _, V, N;
|
|
2211
2263
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2212
2264
|
useState(() => !0);
|
|
2213
2265
|
function o(u) {
|
|
2214
|
-
var
|
|
2266
|
+
var b, S;
|
|
2215
2267
|
const m = {
|
|
2216
2268
|
...e.builderContextSignal.rootState,
|
|
2217
2269
|
...u
|
|
2218
2270
|
};
|
|
2219
|
-
e.builderContextSignal.rootSetState ? (
|
|
2271
|
+
e.builderContextSignal.rootSetState ? (S = (b = e.builderContextSignal).rootSetState) == null || S.call(b, m) : e.setBuilderContextSignal((p) => ({
|
|
2220
2272
|
...p,
|
|
2221
2273
|
rootState: m
|
|
2222
2274
|
}));
|
|
2223
2275
|
}
|
|
2224
2276
|
function r(u) {
|
|
2225
|
-
var
|
|
2277
|
+
var b, S, p, k, B;
|
|
2226
2278
|
const m = {
|
|
2227
2279
|
...e.builderContextSignal.content,
|
|
2228
2280
|
...u,
|
|
2229
2281
|
data: {
|
|
2230
|
-
...(
|
|
2282
|
+
...(b = e.builderContextSignal.content) == null ? void 0 : b.data,
|
|
2231
2283
|
...u == null ? void 0 : u.data
|
|
2232
2284
|
},
|
|
2233
2285
|
meta: {
|
|
2234
|
-
...(
|
|
2286
|
+
...(S = e.builderContextSignal.content) == null ? void 0 : S.meta,
|
|
2235
2287
|
...u == null ? void 0 : u.meta,
|
|
2236
2288
|
breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
|
|
2237
2289
|
}
|
|
2238
2290
|
};
|
|
2239
|
-
e.setBuilderContextSignal((
|
|
2240
|
-
|
|
2291
|
+
e.setBuilderContextSignal(($) => ({
|
|
2292
|
+
...$,
|
|
2241
2293
|
content: m
|
|
2242
2294
|
}));
|
|
2243
2295
|
}
|
|
2244
2296
|
useState(() => 0);
|
|
2245
|
-
const [a,
|
|
2297
|
+
const [a, l] = useState(
|
|
2246
2298
|
() => !1
|
|
2247
|
-
), [
|
|
2299
|
+
), [c, s] = useState(
|
|
2248
2300
|
() => e.contentWrapper || "div"
|
|
2249
2301
|
);
|
|
2250
2302
|
function d(u) {
|
|
2251
|
-
var
|
|
2303
|
+
var b;
|
|
2252
2304
|
if (!isFromTrustedHost(e.trustedHosts, u))
|
|
2253
2305
|
return;
|
|
2254
2306
|
const { data: m } = u;
|
|
2255
2307
|
if (m)
|
|
2256
2308
|
switch (m.type) {
|
|
2257
2309
|
case "builder.configureSdk": {
|
|
2258
|
-
const
|
|
2259
|
-
if (!k || k !== ((
|
|
2310
|
+
const S = m.data, { breakpoints: p, contentId: k } = S;
|
|
2311
|
+
if (!k || k !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
|
|
2260
2312
|
return;
|
|
2261
2313
|
p && r({
|
|
2262
2314
|
meta: {
|
|
@@ -2266,15 +2318,15 @@ function EnableEditor(e) {
|
|
|
2266
2318
|
break;
|
|
2267
2319
|
}
|
|
2268
2320
|
case "builder.contentUpdate": {
|
|
2269
|
-
const
|
|
2321
|
+
const S = m.data, p = S.key || S.alias || S.entry || S.modelName, k = S.data;
|
|
2270
2322
|
p === e.model && (r(k), i(n + 1));
|
|
2271
2323
|
break;
|
|
2272
2324
|
}
|
|
2273
2325
|
}
|
|
2274
2326
|
}
|
|
2275
2327
|
function g() {
|
|
2276
|
-
var m,
|
|
2277
|
-
const u = (
|
|
2328
|
+
var m, b;
|
|
2329
|
+
const u = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.jsCode;
|
|
2278
2330
|
u && evaluate({
|
|
2279
2331
|
code: u,
|
|
2280
2332
|
context: e.context || {},
|
|
@@ -2283,28 +2335,28 @@ function EnableEditor(e) {
|
|
|
2283
2335
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2284
2336
|
});
|
|
2285
2337
|
}
|
|
2286
|
-
const [
|
|
2338
|
+
const [x, f] = useState(() => ({})), [h, y] = useState(() => !1);
|
|
2287
2339
|
function I(u) {
|
|
2288
|
-
var m,
|
|
2340
|
+
var m, b;
|
|
2289
2341
|
if (e.builderContextSignal.content) {
|
|
2290
|
-
const
|
|
2342
|
+
const S = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
|
|
2291
2343
|
_track({
|
|
2292
2344
|
type: "click",
|
|
2293
2345
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2294
2346
|
contentId: p,
|
|
2295
2347
|
apiKey: e.apiKey,
|
|
2296
|
-
variationId:
|
|
2348
|
+
variationId: S !== p ? S : void 0,
|
|
2297
2349
|
...getInteractionPropertiesForEvent(u),
|
|
2298
|
-
unique: !
|
|
2350
|
+
unique: !h
|
|
2299
2351
|
});
|
|
2300
2352
|
}
|
|
2301
|
-
|
|
2353
|
+
h || y(!0);
|
|
2302
2354
|
}
|
|
2303
2355
|
function E(u) {
|
|
2304
2356
|
return u.replace(
|
|
2305
2357
|
/{{([^}]+)}}/g,
|
|
2306
|
-
(m,
|
|
2307
|
-
code:
|
|
2358
|
+
(m, b) => evaluate({
|
|
2359
|
+
code: b,
|
|
2308
2360
|
context: e.context || {},
|
|
2309
2361
|
localState: void 0,
|
|
2310
2362
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2312,25 +2364,25 @@ function EnableEditor(e) {
|
|
|
2312
2364
|
})
|
|
2313
2365
|
);
|
|
2314
2366
|
}
|
|
2315
|
-
function
|
|
2316
|
-
fetch$1(u).then((
|
|
2367
|
+
function C({ url: u, key: m }) {
|
|
2368
|
+
fetch$1(u).then((b) => b.json()).then((b) => {
|
|
2317
2369
|
var p, k;
|
|
2318
|
-
const
|
|
2370
|
+
const S = {
|
|
2319
2371
|
...e.builderContextSignal.rootState,
|
|
2320
|
-
[m]:
|
|
2372
|
+
[m]: b
|
|
2321
2373
|
};
|
|
2322
|
-
(k = (p = e.builderContextSignal).rootSetState) == null || k.call(p,
|
|
2323
|
-
}).catch((
|
|
2324
|
-
console.error("error fetching dynamic data", u,
|
|
2374
|
+
(k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, S), x[m] = !0;
|
|
2375
|
+
}).catch((b) => {
|
|
2376
|
+
console.error("error fetching dynamic data", u, b);
|
|
2325
2377
|
});
|
|
2326
2378
|
}
|
|
2327
|
-
function
|
|
2328
|
-
var m,
|
|
2329
|
-
const u = (
|
|
2379
|
+
function v() {
|
|
2380
|
+
var m, b, S;
|
|
2381
|
+
const u = (S = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.httpRequests) != null ? S : {};
|
|
2330
2382
|
Object.entries(u).forEach(([p, k]) => {
|
|
2331
|
-
if (k && (!
|
|
2383
|
+
if (k && (!x[p] || isEditing())) {
|
|
2332
2384
|
const B = E(k);
|
|
2333
|
-
|
|
2385
|
+
C({
|
|
2334
2386
|
url: B,
|
|
2335
2387
|
key: p
|
|
2336
2388
|
});
|
|
@@ -2369,19 +2421,19 @@ function EnableEditor(e) {
|
|
|
2369
2421
|
}), Object.values(
|
|
2370
2422
|
e.builderContextSignal.componentInfos
|
|
2371
2423
|
).forEach((m) => {
|
|
2372
|
-
var
|
|
2373
|
-
const
|
|
2374
|
-
(
|
|
2424
|
+
var S;
|
|
2425
|
+
const b = createRegisterComponentMessage(m);
|
|
2426
|
+
(S = window.parent) == null || S.postMessage(b, "*");
|
|
2375
2427
|
}), window.addEventListener(
|
|
2376
2428
|
"builder:component:stateChangeListenerActivated",
|
|
2377
2429
|
T
|
|
2378
2430
|
);
|
|
2379
2431
|
}
|
|
2380
2432
|
function R(u) {
|
|
2381
|
-
const m = new URL(location.href).searchParams,
|
|
2382
|
-
`builder.preview.${
|
|
2433
|
+
const m = new URL(location.href).searchParams, b = m.get("builder.preview"), S = m.get(
|
|
2434
|
+
`builder.preview.${b}`
|
|
2383
2435
|
), p = m.get("apiKey") || m.get("builder.space");
|
|
2384
|
-
|
|
2436
|
+
b === e.model && p === e.apiKey && (!e.content || S === e.content.id) && fetchOneEntry({
|
|
2385
2437
|
model: e.model,
|
|
2386
2438
|
apiKey: e.apiKey,
|
|
2387
2439
|
apiVersion: e.builderContextSignal.apiVersion
|
|
@@ -2417,13 +2469,13 @@ function EnableEditor(e) {
|
|
|
2417
2469
|
var u, m;
|
|
2418
2470
|
if (isBrowser()) {
|
|
2419
2471
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2420
|
-
const
|
|
2472
|
+
const S = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
|
|
2421
2473
|
_track({
|
|
2422
2474
|
type: "impression",
|
|
2423
2475
|
canTrack: !0,
|
|
2424
2476
|
contentId: p,
|
|
2425
2477
|
apiKey: k,
|
|
2426
|
-
variationId:
|
|
2478
|
+
variationId: S !== p ? S : void 0
|
|
2427
2479
|
});
|
|
2428
2480
|
}
|
|
2429
2481
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2431,7 +2483,7 @@ function EnableEditor(e) {
|
|
|
2431
2483
|
}, []), useEffect(() => {
|
|
2432
2484
|
e.apiKey || logger.error(
|
|
2433
2485
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2434
|
-
), g(),
|
|
2486
|
+
), g(), v(), T();
|
|
2435
2487
|
}, []), useEffect(() => {
|
|
2436
2488
|
e.content && r(e.content);
|
|
2437
2489
|
}, [e.content]), useEffect(() => {
|
|
@@ -2441,7 +2493,7 @@ function EnableEditor(e) {
|
|
|
2441
2493
|
(P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode,
|
|
2442
2494
|
e.builderContextSignal.rootState
|
|
2443
2495
|
]), useEffect(() => {
|
|
2444
|
-
|
|
2496
|
+
v();
|
|
2445
2497
|
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
|
|
2446
2498
|
T();
|
|
2447
2499
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
@@ -2456,7 +2508,7 @@ function EnableEditor(e) {
|
|
|
2456
2508
|
T
|
|
2457
2509
|
));
|
|
2458
2510
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2459
|
-
|
|
2511
|
+
c,
|
|
2460
2512
|
{
|
|
2461
2513
|
key: n,
|
|
2462
2514
|
ref: t,
|
|
@@ -2468,7 +2520,7 @@ function EnableEditor(e) {
|
|
|
2468
2520
|
"aria-hidden": !0
|
|
2469
2521
|
},
|
|
2470
2522
|
...e.contentWrapperProps,
|
|
2471
|
-
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((
|
|
2523
|
+
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((N = e.content) == null ? void 0 : N.id)}`
|
|
2472
2524
|
},
|
|
2473
2525
|
e.children
|
|
2474
2526
|
) }) : null });
|
|
@@ -2485,16 +2537,16 @@ font-display: fallback;
|
|
|
2485
2537
|
font-weight: 400;
|
|
2486
2538
|
}
|
|
2487
2539
|
`.trim()), e.files)
|
|
2488
|
-
for (const
|
|
2489
|
-
if (!(String(Number(
|
|
2540
|
+
for (const l in e.files) {
|
|
2541
|
+
if (!(String(Number(l)) === l))
|
|
2490
2542
|
continue;
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2543
|
+
const s = e.files[l];
|
|
2544
|
+
s && s !== i && (o += `
|
|
2493
2545
|
@font-face {
|
|
2494
2546
|
font-family: "${t}";
|
|
2495
|
-
src: url('${
|
|
2547
|
+
src: url('${s}') format('woff2');
|
|
2496
2548
|
font-display: fallback;
|
|
2497
|
-
font-weight: ${
|
|
2549
|
+
font-weight: ${l};
|
|
2498
2550
|
}
|
|
2499
2551
|
`.trim());
|
|
2500
2552
|
}
|
|
@@ -2544,10 +2596,10 @@ const getRootStateInitialValue = ({
|
|
|
2544
2596
|
data: t,
|
|
2545
2597
|
locale: n
|
|
2546
2598
|
}) => {
|
|
2547
|
-
var r, a,
|
|
2599
|
+
var r, a, l;
|
|
2548
2600
|
const i = {}, o = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2549
|
-
return (
|
|
2550
|
-
|
|
2601
|
+
return (l = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || l.forEach((c) => {
|
|
2602
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
2551
2603
|
}), {
|
|
2552
2604
|
...i,
|
|
2553
2605
|
...o,
|
|
@@ -2568,7 +2620,7 @@ const getRootStateInitialValue = ({
|
|
|
2568
2620
|
meta: e == null ? void 0 : e.meta
|
|
2569
2621
|
} : void 0;
|
|
2570
2622
|
function ContentComponent(e) {
|
|
2571
|
-
var
|
|
2623
|
+
var c, s, d, g, x, f, h;
|
|
2572
2624
|
const [t, n] = useState(
|
|
2573
2625
|
() => {
|
|
2574
2626
|
var y, I;
|
|
@@ -2581,7 +2633,7 @@ function ContentComponent(e) {
|
|
|
2581
2633
|
}
|
|
2582
2634
|
);
|
|
2583
2635
|
function i(y) {
|
|
2584
|
-
|
|
2636
|
+
l((I) => ({
|
|
2585
2637
|
...I,
|
|
2586
2638
|
rootState: y
|
|
2587
2639
|
}));
|
|
@@ -2606,7 +2658,7 @@ function ContentComponent(e) {
|
|
|
2606
2658
|
}),
|
|
2607
2659
|
{}
|
|
2608
2660
|
)
|
|
2609
|
-
), [a,
|
|
2661
|
+
), [a, l] = useState(() => ({
|
|
2610
2662
|
content: getContentInitialValue({
|
|
2611
2663
|
content: e.content,
|
|
2612
2664
|
data: e.data
|
|
@@ -2663,24 +2715,26 @@ function ContentComponent(e) {
|
|
|
2663
2715
|
builderContextSignal: a,
|
|
2664
2716
|
contentWrapper: e.contentWrapper,
|
|
2665
2717
|
contentWrapperProps: e.contentWrapperProps,
|
|
2718
|
+
linkComponent: e.linkComponent,
|
|
2666
2719
|
trustedHosts: e.trustedHosts,
|
|
2667
|
-
setBuilderContextSignal:
|
|
2720
|
+
setBuilderContextSignal: l,
|
|
2668
2721
|
children: [
|
|
2669
2722
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2670
2723
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2671
2724
|
ContentStyles,
|
|
2672
2725
|
{
|
|
2673
|
-
contentId: (
|
|
2674
|
-
cssCode: (d = (
|
|
2675
|
-
customFonts: (
|
|
2726
|
+
contentId: (c = a.content) == null ? void 0 : c.id,
|
|
2727
|
+
cssCode: (d = (s = a.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2728
|
+
customFonts: (x = (g = a.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2676
2729
|
}
|
|
2677
2730
|
) }),
|
|
2678
2731
|
/* @__PURE__ */ jsx(
|
|
2679
2732
|
Blocks,
|
|
2680
2733
|
{
|
|
2681
|
-
blocks: (
|
|
2734
|
+
blocks: (h = (f = a.content) == null ? void 0 : f.data) == null ? void 0 : h.blocks,
|
|
2682
2735
|
context: a,
|
|
2683
|
-
registeredComponents: o
|
|
2736
|
+
registeredComponents: o,
|
|
2737
|
+
linkComponent: e.linkComponent
|
|
2684
2738
|
}
|
|
2685
2739
|
)
|
|
2686
2740
|
]
|
|
@@ -2690,7 +2744,7 @@ function ContentComponent(e) {
|
|
|
2690
2744
|
);
|
|
2691
2745
|
}
|
|
2692
2746
|
function ContentVariants(e) {
|
|
2693
|
-
var a,
|
|
2747
|
+
var a, l;
|
|
2694
2748
|
const [t, n] = useState(
|
|
2695
2749
|
() => checkShouldRenderVariants({
|
|
2696
2750
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2698,23 +2752,23 @@ function ContentVariants(e) {
|
|
|
2698
2752
|
})
|
|
2699
2753
|
);
|
|
2700
2754
|
function i() {
|
|
2701
|
-
var
|
|
2755
|
+
var c;
|
|
2702
2756
|
return getUpdateCookieAndStylesScript(
|
|
2703
|
-
getVariants(e.content).map((
|
|
2704
|
-
id:
|
|
2705
|
-
testRatio:
|
|
2757
|
+
getVariants(e.content).map((s) => ({
|
|
2758
|
+
id: s.testVariationId,
|
|
2759
|
+
testRatio: s.testRatio
|
|
2706
2760
|
})),
|
|
2707
|
-
((
|
|
2761
|
+
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2708
2762
|
);
|
|
2709
2763
|
}
|
|
2710
2764
|
function o() {
|
|
2711
|
-
return getVariants(e.content).map((
|
|
2765
|
+
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2712
2766
|
}
|
|
2713
2767
|
function r() {
|
|
2714
|
-
var
|
|
2768
|
+
var c;
|
|
2715
2769
|
return t ? {
|
|
2716
2770
|
...e.content,
|
|
2717
|
-
testVariationId: (
|
|
2771
|
+
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2718
2772
|
} : handleABTestingSync({
|
|
2719
2773
|
item: e.content,
|
|
2720
2774
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2732,10 +2786,10 @@ function ContentVariants(e) {
|
|
|
2732
2786
|
}
|
|
2733
2787
|
),
|
|
2734
2788
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2735
|
-
(
|
|
2789
|
+
(l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
|
|
2736
2790
|
ContentComponent,
|
|
2737
2791
|
{
|
|
2738
|
-
content:
|
|
2792
|
+
content: c,
|
|
2739
2793
|
showContent: !1,
|
|
2740
2794
|
model: e.model,
|
|
2741
2795
|
data: e.data,
|
|
@@ -2743,6 +2797,7 @@ function ContentVariants(e) {
|
|
|
2743
2797
|
apiKey: e.apiKey,
|
|
2744
2798
|
apiVersion: e.apiVersion,
|
|
2745
2799
|
customComponents: e.customComponents,
|
|
2800
|
+
linkComponent: e.linkComponent,
|
|
2746
2801
|
canTrack: e.canTrack,
|
|
2747
2802
|
locale: e.locale,
|
|
2748
2803
|
includeRefs: e.includeRefs,
|
|
@@ -2754,7 +2809,7 @@ function ContentVariants(e) {
|
|
|
2754
2809
|
contentWrapperProps: e.contentWrapperProps,
|
|
2755
2810
|
trustedHosts: e.trustedHosts
|
|
2756
2811
|
},
|
|
2757
|
-
|
|
2812
|
+
c.testVariationId
|
|
2758
2813
|
))
|
|
2759
2814
|
] }) : null,
|
|
2760
2815
|
/* @__PURE__ */ jsx(
|
|
@@ -2768,6 +2823,7 @@ function ContentVariants(e) {
|
|
|
2768
2823
|
apiKey: e.apiKey,
|
|
2769
2824
|
apiVersion: e.apiVersion,
|
|
2770
2825
|
customComponents: e.customComponents,
|
|
2826
|
+
linkComponent: e.linkComponent,
|
|
2771
2827
|
canTrack: e.canTrack,
|
|
2772
2828
|
locale: e.locale,
|
|
2773
2829
|
includeRefs: e.includeRefs,
|
|
@@ -2802,26 +2858,26 @@ const fetchSymbolContent = async ({
|
|
|
2802
2858
|
});
|
|
2803
2859
|
};
|
|
2804
2860
|
function Symbol$1(e) {
|
|
2805
|
-
var r, a,
|
|
2861
|
+
var r, a, l, c;
|
|
2806
2862
|
function t() {
|
|
2807
|
-
var
|
|
2863
|
+
var s, d;
|
|
2808
2864
|
return [
|
|
2809
|
-
e.attributes
|
|
2865
|
+
e.attributes[getClassPropName()],
|
|
2810
2866
|
"builder-symbol",
|
|
2811
|
-
(
|
|
2867
|
+
(s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
|
|
2812
2868
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2813
2869
|
].filter(Boolean).join(" ");
|
|
2814
2870
|
}
|
|
2815
2871
|
const [n, i] = useState(() => {
|
|
2816
|
-
var
|
|
2817
|
-
return (
|
|
2872
|
+
var s;
|
|
2873
|
+
return (s = e.symbol) == null ? void 0 : s.content;
|
|
2818
2874
|
});
|
|
2819
2875
|
function o() {
|
|
2820
2876
|
n || fetchSymbolContent({
|
|
2821
2877
|
symbol: e.symbol,
|
|
2822
2878
|
builderContextValue: e.builderContext
|
|
2823
|
-
}).then((
|
|
2824
|
-
|
|
2879
|
+
}).then((s) => {
|
|
2880
|
+
s && i(s);
|
|
2825
2881
|
});
|
|
2826
2882
|
}
|
|
2827
2883
|
return useEffect(() => {
|
|
@@ -2841,10 +2897,11 @@ function Symbol$1(e) {
|
|
|
2841
2897
|
data: {
|
|
2842
2898
|
...(a = e.symbol) == null ? void 0 : a.data,
|
|
2843
2899
|
...e.builderContext.localState,
|
|
2844
|
-
...(
|
|
2900
|
+
...(l = n == null ? void 0 : n.data) == null ? void 0 : l.state
|
|
2845
2901
|
},
|
|
2846
|
-
model: (
|
|
2847
|
-
content: n
|
|
2902
|
+
model: (c = e.symbol) == null ? void 0 : c.model,
|
|
2903
|
+
content: n,
|
|
2904
|
+
linkComponent: e.builderLinkComponent
|
|
2848
2905
|
}
|
|
2849
2906
|
) });
|
|
2850
2907
|
}
|