@builder.io/sdk-react 0.11.1 → 0.11.3
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 +25 -25
- package/lib/browser/index.mjs +526 -551
- package/lib/edge/index.cjs +29 -29
- package/lib/edge/index.mjs +782 -807
- package/lib/node/index.cjs +18 -18
- package/lib/node/index.mjs +394 -419
- package/package.json +61 -4
- package/types/blocks/button/button.d.ts +1 -9
- package/types/blocks/button/button.types.d.ts +6 -0
- package/types/blocks/columns/columns.d.ts +2 -14
- package/types/blocks/columns/columns.types.d.ts +15 -0
- package/types/blocks/fragment/fragment.d.ts +1 -5
- package/types/blocks/fragment/fragment.types.d.ts +5 -0
- package/types/blocks/image/image.d.ts +1 -19
- package/types/blocks/image/image.types.d.ts +19 -0
- package/types/blocks/section/section.d.ts +1 -9
- package/types/blocks/section/section.types.d.ts +6 -0
- package/types/blocks/symbol/symbol.d.ts +2 -23
- package/types/blocks/symbol/symbol.types.d.ts +18 -0
- package/types/blocks/text/text.d.ts +1 -3
- package/types/blocks/text/text.types.d.ts +3 -0
- package/types/blocks/video/video.d.ts +1 -21
- package/types/blocks/video/video.types.d.ts +21 -0
- package/types/components/blocks/blocks.d.ts +1 -6
- package/types/components/blocks/blocks.types.d.ts +6 -0
- package/types/components/content-variants/content-variants.types.d.ts +30 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +1 -1
- package/types/functions/get-content/types.d.ts +2 -2
- package/types/server-index.d.ts +10 -1
package/lib/node/index.mjs
CHANGED
|
@@ -20,11 +20,11 @@ function Button(e) {
|
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
22
22
|
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-
|
|
23
|
+
className: e.attributes.className + " button-fdf49de0",
|
|
24
24
|
children: e.text
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */ jsx("style", { children: `.button-
|
|
27
|
+
/* @__PURE__ */ jsx("style", { children: `.button-fdf49de0 {
|
|
28
28
|
all: unset;
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
@@ -79,26 +79,26 @@ const getFunctionArguments = ({
|
|
|
79
79
|
context: n,
|
|
80
80
|
event: i,
|
|
81
81
|
localState: o,
|
|
82
|
-
rootSetState:
|
|
83
|
-
rootState:
|
|
82
|
+
rootSetState: r,
|
|
83
|
+
rootState: a
|
|
84
84
|
}) => {
|
|
85
|
-
const
|
|
85
|
+
const l = getFunctionArguments({
|
|
86
86
|
builder: t,
|
|
87
87
|
context: n,
|
|
88
88
|
event: i,
|
|
89
|
-
state: flattenState(
|
|
89
|
+
state: flattenState(a, o, r)
|
|
90
90
|
});
|
|
91
|
-
return new Function(...
|
|
91
|
+
return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
|
|
92
92
|
};
|
|
93
93
|
function flattenState(e, t, n) {
|
|
94
94
|
if (e === t)
|
|
95
95
|
throw new Error("rootState === localState");
|
|
96
96
|
return new Proxy(e, {
|
|
97
97
|
get: (i, o) => t && o in t ? t[o] : e[o],
|
|
98
|
-
set: (i, o,
|
|
98
|
+
set: (i, o, r) => {
|
|
99
99
|
if (t && o in t)
|
|
100
100
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
101
|
-
return e[o] =
|
|
101
|
+
return e[o] = r, n == null || n(e), !0;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -106,7 +106,7 @@ const set = (e, t, n) => {
|
|
|
106
106
|
if (Object(e) !== e)
|
|
107
107
|
return e;
|
|
108
108
|
const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
109
|
-
return i.slice(0, -1).reduce((o,
|
|
109
|
+
return i.slice(0, -1).reduce((o, r, a) => Object(o[r]) === o[r] ? o[r] : o[r] = Math.abs(Number(i[a + 1])) >> 0 === +i[a + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
|
|
110
110
|
}, noop = () => {
|
|
111
111
|
};
|
|
112
112
|
let safeDynamicRequire = noop;
|
|
@@ -172,35 +172,35 @@ output;
|
|
|
172
172
|
context: n,
|
|
173
173
|
event: i,
|
|
174
174
|
localState: o,
|
|
175
|
-
rootSetState:
|
|
176
|
-
rootState:
|
|
175
|
+
rootSetState: r,
|
|
176
|
+
rootState: a
|
|
177
177
|
}) => {
|
|
178
|
-
const
|
|
179
|
-
...
|
|
178
|
+
const l = fastClone({
|
|
179
|
+
...a,
|
|
180
180
|
...o
|
|
181
|
-
}),
|
|
181
|
+
}), c = getFunctionArguments({
|
|
182
182
|
builder: t,
|
|
183
183
|
context: n,
|
|
184
184
|
event: i,
|
|
185
|
-
state:
|
|
185
|
+
state: l
|
|
186
186
|
}), s = getIsolateContext(), d = s.global;
|
|
187
|
-
d.setSync("global", d.derefInto()), d.setSync("log", function(...
|
|
188
|
-
console.log(...
|
|
189
|
-
}), d.setSync(BUILDER_SET_STATE_NAME, function(
|
|
190
|
-
set(
|
|
191
|
-
}),
|
|
192
|
-
const p = typeof
|
|
187
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...m) {
|
|
188
|
+
console.log(...m);
|
|
189
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(m, S) {
|
|
190
|
+
set(a, m, S), r == null || r(a);
|
|
191
|
+
}), c.forEach(([m, S]) => {
|
|
192
|
+
const p = typeof S == "object" ? new ivm.Reference(
|
|
193
193
|
// workaround: methods with default values for arguments is not being cloned over
|
|
194
|
-
|
|
195
|
-
...
|
|
196
|
-
getUserAttributes: () =>
|
|
197
|
-
} :
|
|
194
|
+
m === "builder" ? {
|
|
195
|
+
...S,
|
|
196
|
+
getUserAttributes: () => S.getUserAttributes()
|
|
197
|
+
} : S
|
|
198
198
|
) : null;
|
|
199
|
-
d.setSync(getSyncValName(
|
|
199
|
+
d.setSync(getSyncValName(m), p);
|
|
200
200
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
201
201
|
const g = processCode({
|
|
202
202
|
code: e,
|
|
203
|
-
args:
|
|
203
|
+
args: c
|
|
204
204
|
}), x = s.evalSync(g);
|
|
205
205
|
try {
|
|
206
206
|
return JSON.parse(x);
|
|
@@ -214,28 +214,28 @@ function evaluate({
|
|
|
214
214
|
localState: n,
|
|
215
215
|
rootState: i,
|
|
216
216
|
rootSetState: o,
|
|
217
|
-
event:
|
|
218
|
-
isExpression:
|
|
217
|
+
event: r,
|
|
218
|
+
isExpression: a = !0
|
|
219
219
|
}) {
|
|
220
220
|
if (e === "") {
|
|
221
221
|
logger.warn("Skipping evaluation of empty code block.");
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
const
|
|
224
|
+
const l = {
|
|
225
225
|
code: parseCode(e, {
|
|
226
|
-
isExpression:
|
|
226
|
+
isExpression: a
|
|
227
227
|
}),
|
|
228
228
|
builder: getBuilderGlobals(),
|
|
229
229
|
context: t,
|
|
230
|
-
event:
|
|
230
|
+
event: r,
|
|
231
231
|
rootSetState: o,
|
|
232
232
|
rootState: i,
|
|
233
233
|
localState: n
|
|
234
234
|
};
|
|
235
235
|
try {
|
|
236
|
-
return chooseBrowserOrServerEval(
|
|
237
|
-
} catch (
|
|
238
|
-
logger.error("Failed code evaluation: " +
|
|
236
|
+
return chooseBrowserOrServerEval(l);
|
|
237
|
+
} catch (c) {
|
|
238
|
+
logger.error("Failed code evaluation: " + c.message, {
|
|
239
239
|
code: e
|
|
240
240
|
});
|
|
241
241
|
return;
|
|
@@ -253,26 +253,26 @@ const evaluateBindings = ({
|
|
|
253
253
|
}) => {
|
|
254
254
|
if (!e.bindings)
|
|
255
255
|
return e;
|
|
256
|
-
const
|
|
257
|
-
...
|
|
256
|
+
const r = fastClone(e), a = {
|
|
257
|
+
...r,
|
|
258
258
|
properties: {
|
|
259
|
-
...
|
|
259
|
+
...r.properties
|
|
260
260
|
},
|
|
261
261
|
actions: {
|
|
262
|
-
...
|
|
262
|
+
...r.actions
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
for (const
|
|
266
|
-
const
|
|
267
|
-
code:
|
|
265
|
+
for (const l in e.bindings) {
|
|
266
|
+
const c = e.bindings[l], s = evaluate({
|
|
267
|
+
code: c,
|
|
268
268
|
localState: n,
|
|
269
269
|
rootState: i,
|
|
270
270
|
rootSetState: o,
|
|
271
271
|
context: t
|
|
272
272
|
});
|
|
273
|
-
set(
|
|
273
|
+
set(a, l, s);
|
|
274
274
|
}
|
|
275
|
-
return
|
|
275
|
+
return a;
|
|
276
276
|
};
|
|
277
277
|
function getProcessedBlock({
|
|
278
278
|
block: e,
|
|
@@ -280,31 +280,31 @@ function getProcessedBlock({
|
|
|
280
280
|
shouldEvaluateBindings: n,
|
|
281
281
|
localState: i,
|
|
282
282
|
rootState: o,
|
|
283
|
-
rootSetState:
|
|
283
|
+
rootSetState: r
|
|
284
284
|
}) {
|
|
285
|
-
const
|
|
285
|
+
const a = e;
|
|
286
286
|
return n ? evaluateBindings({
|
|
287
|
-
block:
|
|
287
|
+
block: a,
|
|
288
288
|
localState: i,
|
|
289
289
|
rootState: o,
|
|
290
|
-
rootSetState:
|
|
290
|
+
rootSetState: r,
|
|
291
291
|
context: t
|
|
292
|
-
}) :
|
|
292
|
+
}) : a;
|
|
293
293
|
}
|
|
294
294
|
const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
|
|
295
295
|
block: e,
|
|
296
296
|
context: t,
|
|
297
297
|
registeredComponents: n
|
|
298
298
|
}) => {
|
|
299
|
-
var
|
|
300
|
-
const i = (
|
|
299
|
+
var r;
|
|
300
|
+
const i = (r = getProcessedBlock({
|
|
301
301
|
block: e,
|
|
302
302
|
localState: t.localState,
|
|
303
303
|
rootState: t.rootState,
|
|
304
304
|
rootSetState: t.rootSetState,
|
|
305
305
|
context: t.context,
|
|
306
306
|
shouldEvaluateBindings: !1
|
|
307
|
-
}).component) == null ? void 0 :
|
|
307
|
+
}).component) == null ? void 0 : r.name;
|
|
308
308
|
if (!i)
|
|
309
309
|
return null;
|
|
310
310
|
const o = n[i];
|
|
@@ -332,16 +332,16 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
332
332
|
});
|
|
333
333
|
if (!Array.isArray(o))
|
|
334
334
|
return;
|
|
335
|
-
const
|
|
336
|
-
return o.map((
|
|
335
|
+
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
336
|
+
return o.map((c, s) => ({
|
|
337
337
|
context: {
|
|
338
338
|
...t,
|
|
339
339
|
localState: {
|
|
340
340
|
...t.localState,
|
|
341
341
|
$index: s,
|
|
342
|
-
$item:
|
|
343
|
-
[
|
|
344
|
-
[`$${
|
|
342
|
+
$item: c,
|
|
343
|
+
[a]: c,
|
|
344
|
+
[`$${a}Index`]: s
|
|
345
345
|
}
|
|
346
346
|
},
|
|
347
347
|
block: i
|
|
@@ -381,12 +381,12 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
381
381
|
min: o,
|
|
382
382
|
default: o + 1
|
|
383
383
|
};
|
|
384
|
-
const
|
|
384
|
+
const r = n.medium.max + 1;
|
|
385
385
|
return n.large = {
|
|
386
386
|
max: 2e3,
|
|
387
387
|
// TODO: decide upper limit
|
|
388
|
-
min:
|
|
389
|
-
default:
|
|
388
|
+
min: r,
|
|
389
|
+
default: r + 1
|
|
390
390
|
}, n;
|
|
391
391
|
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
|
|
392
392
|
if (typeof i == "string")
|
|
@@ -420,7 +420,7 @@ function BlockStyles(e) {
|
|
|
420
420
|
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
421
421
|
}
|
|
422
422
|
function n() {
|
|
423
|
-
var
|
|
423
|
+
var S;
|
|
424
424
|
const i = getProcessedBlock({
|
|
425
425
|
block: e.block,
|
|
426
426
|
localState: e.context.localState,
|
|
@@ -428,30 +428,30 @@ function BlockStyles(e) {
|
|
|
428
428
|
rootSetState: e.context.rootSetState,
|
|
429
429
|
context: e.context.context,
|
|
430
430
|
shouldEvaluateBindings: !0
|
|
431
|
-
}), o = i.responsiveStyles,
|
|
432
|
-
((
|
|
433
|
-
),
|
|
431
|
+
}), o = i.responsiveStyles, r = e.context.content, a = getSizesForBreakpoints(
|
|
432
|
+
((S = r == null ? void 0 : r.meta) == null ? void 0 : S.breakpoints) || {}
|
|
433
|
+
), l = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
|
|
434
434
|
if (!d)
|
|
435
435
|
return "";
|
|
436
|
-
const g =
|
|
436
|
+
const g = l ? createCssClass({
|
|
437
437
|
className: d,
|
|
438
|
-
styles:
|
|
439
|
-
}) : "", x =
|
|
438
|
+
styles: l
|
|
439
|
+
}) : "", x = c ? createCssClass({
|
|
440
440
|
className: d,
|
|
441
|
-
styles:
|
|
441
|
+
styles: c,
|
|
442
442
|
mediaQuery: getMaxWidthQueryForSize(
|
|
443
443
|
"medium",
|
|
444
|
-
|
|
444
|
+
a
|
|
445
445
|
)
|
|
446
|
-
}) : "",
|
|
446
|
+
}) : "", m = s ? createCssClass({
|
|
447
447
|
className: d,
|
|
448
448
|
styles: s,
|
|
449
449
|
mediaQuery: getMaxWidthQueryForSize(
|
|
450
450
|
"small",
|
|
451
|
-
|
|
451
|
+
a
|
|
452
452
|
)
|
|
453
453
|
}) : "";
|
|
454
|
-
return [g, x,
|
|
454
|
+
return [g, x, m].join(" ");
|
|
455
455
|
}
|
|
456
456
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
457
457
|
}
|
|
@@ -473,18 +473,18 @@ function getBlockActions(e) {
|
|
|
473
473
|
for (const o in n) {
|
|
474
474
|
if (!n.hasOwnProperty(o))
|
|
475
475
|
continue;
|
|
476
|
-
const
|
|
477
|
-
let
|
|
476
|
+
const r = n[o];
|
|
477
|
+
let a = getEventHandlerName(o);
|
|
478
478
|
if (e.stripPrefix)
|
|
479
479
|
switch (TARGET) {
|
|
480
480
|
case "vue":
|
|
481
|
-
|
|
481
|
+
a = a.replace("v-on:", "");
|
|
482
482
|
break;
|
|
483
483
|
case "svelte":
|
|
484
|
-
|
|
484
|
+
a = a.replace("on:", "");
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
|
-
t[
|
|
487
|
+
t[a] = createEventHandler(r, e);
|
|
488
488
|
}
|
|
489
489
|
return t;
|
|
490
490
|
}
|
|
@@ -599,10 +599,10 @@ const getWrapperProps = ({
|
|
|
599
599
|
context: n,
|
|
600
600
|
componentRef: i,
|
|
601
601
|
includeBlockProps: o,
|
|
602
|
-
isInteractive:
|
|
603
|
-
contextValue:
|
|
602
|
+
isInteractive: r,
|
|
603
|
+
contextValue: a
|
|
604
604
|
}) => {
|
|
605
|
-
const
|
|
605
|
+
const l = {
|
|
606
606
|
...e,
|
|
607
607
|
/**
|
|
608
608
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -611,24 +611,24 @@ const getWrapperProps = ({
|
|
|
611
611
|
...o ? {
|
|
612
612
|
attributes: getBlockProperties({
|
|
613
613
|
block: t,
|
|
614
|
-
context:
|
|
614
|
+
context: a
|
|
615
615
|
})
|
|
616
616
|
} : {}
|
|
617
617
|
};
|
|
618
|
-
return
|
|
618
|
+
return r ? {
|
|
619
619
|
Wrapper: i,
|
|
620
620
|
block: t,
|
|
621
621
|
context: n,
|
|
622
622
|
wrapperProps: e,
|
|
623
623
|
includeBlockProps: o
|
|
624
|
-
} :
|
|
624
|
+
} : l;
|
|
625
625
|
};
|
|
626
626
|
function ComponentRef(e) {
|
|
627
|
-
var i
|
|
627
|
+
var i;
|
|
628
628
|
const [t, n] = useState(
|
|
629
629
|
() => e.isInteractive ? InteractiveElement : e.componentRef
|
|
630
630
|
);
|
|
631
|
-
return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
632
632
|
t,
|
|
633
633
|
{
|
|
634
634
|
...getWrapperProps({
|
|
@@ -640,25 +640,15 @@ function ComponentRef(e) {
|
|
|
640
640
|
isInteractive: e.isInteractive,
|
|
641
641
|
contextValue: e.context
|
|
642
642
|
}),
|
|
643
|
-
children:
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
)),
|
|
653
|
-
(o = e.blockChildren) == null ? void 0 : o.map((a) => /* @__PURE__ */ jsx(
|
|
654
|
-
BlockStyles,
|
|
655
|
-
{
|
|
656
|
-
block: a,
|
|
657
|
-
context: e.context
|
|
658
|
-
},
|
|
659
|
-
"block-style-" + a.id
|
|
660
|
-
))
|
|
661
|
-
]
|
|
643
|
+
children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
|
|
644
|
+
Block,
|
|
645
|
+
{
|
|
646
|
+
block: o,
|
|
647
|
+
context: e.context,
|
|
648
|
+
registeredComponents: e.registeredComponents
|
|
649
|
+
},
|
|
650
|
+
o.id
|
|
651
|
+
))
|
|
662
652
|
}
|
|
663
653
|
) }) : null });
|
|
664
654
|
}
|
|
@@ -674,7 +664,7 @@ function RepeatedBlock(e) {
|
|
|
674
664
|
) });
|
|
675
665
|
}
|
|
676
666
|
function Block(e) {
|
|
677
|
-
var d, g, x
|
|
667
|
+
var d, g, x;
|
|
678
668
|
function t() {
|
|
679
669
|
return getComponent({
|
|
680
670
|
block: e.block,
|
|
@@ -689,8 +679,8 @@ function Block(e) {
|
|
|
689
679
|
});
|
|
690
680
|
}
|
|
691
681
|
function i() {
|
|
692
|
-
var
|
|
693
|
-
return (
|
|
682
|
+
var m;
|
|
683
|
+
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
694
684
|
block: e.block,
|
|
695
685
|
localState: e.context.localState,
|
|
696
686
|
rootState: e.context.rootState,
|
|
@@ -702,110 +692,105 @@ function Block(e) {
|
|
|
702
692
|
function o() {
|
|
703
693
|
return e.block.tagName || "div";
|
|
704
694
|
}
|
|
705
|
-
function a() {
|
|
706
|
-
var k, E;
|
|
707
|
-
if ((k = e.block.repeat) != null && k.collection)
|
|
708
|
-
return !!((E = n == null ? void 0 : n()) != null && E.length);
|
|
709
|
-
const f = "hide" in i() ? i().hide : !1;
|
|
710
|
-
return ("show" in i() ? i().show : !0) && !f;
|
|
711
|
-
}
|
|
712
695
|
function r() {
|
|
713
|
-
var p,
|
|
714
|
-
|
|
696
|
+
var p, I;
|
|
697
|
+
if ((p = e.block.repeat) != null && p.collection)
|
|
698
|
+
return !!((I = n == null ? void 0 : n()) != null && I.length);
|
|
699
|
+
const m = "hide" in i() ? i().hide : !1;
|
|
700
|
+
return ("show" in i() ? i().show : !0) && !m;
|
|
715
701
|
}
|
|
716
|
-
function
|
|
717
|
-
var
|
|
702
|
+
function a() {
|
|
703
|
+
var S, p;
|
|
704
|
+
return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? (p = i().children) != null ? p : [] : [];
|
|
705
|
+
}
|
|
706
|
+
function l() {
|
|
707
|
+
var m, S, p, I, E, v;
|
|
718
708
|
return {
|
|
719
|
-
blockChildren: (
|
|
720
|
-
componentRef: (
|
|
709
|
+
blockChildren: (m = i().children) != null ? m : [],
|
|
710
|
+
componentRef: (S = t == null ? void 0 : t()) == null ? void 0 : S.component,
|
|
721
711
|
componentOptions: {
|
|
722
712
|
...getBlockComponentOptions(i()),
|
|
723
713
|
builderContext: e.context,
|
|
724
|
-
...((
|
|
714
|
+
...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Columns" ? {
|
|
725
715
|
builderComponents: e.registeredComponents
|
|
726
716
|
} : {}
|
|
727
717
|
},
|
|
728
|
-
context:
|
|
718
|
+
context: c,
|
|
729
719
|
registeredComponents: e.registeredComponents,
|
|
730
720
|
builderBlock: i(),
|
|
731
|
-
includeBlockProps: ((
|
|
732
|
-
isInteractive: !((
|
|
721
|
+
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
722
|
+
isInteractive: !((v = t == null ? void 0 : t()) != null && v.isRSC)
|
|
733
723
|
};
|
|
734
724
|
}
|
|
735
|
-
const [
|
|
736
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
737
|
-
|
|
738
|
-
{
|
|
739
|
-
|
|
740
|
-
componentOptions: c().componentOptions,
|
|
741
|
-
blockChildren: c().blockChildren,
|
|
742
|
-
context: c().context,
|
|
743
|
-
registeredComponents: c().registeredComponents,
|
|
744
|
-
builderBlock: c().builderBlock,
|
|
745
|
-
includeBlockProps: c().includeBlockProps,
|
|
746
|
-
isInteractive: c().isInteractive
|
|
747
|
-
}
|
|
748
|
-
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
749
|
-
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
750
|
-
BlockWrapper,
|
|
725
|
+
const [c, s] = useState(() => e.context);
|
|
726
|
+
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
727
|
+
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
728
|
+
(d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
729
|
+
ComponentRef,
|
|
751
730
|
{
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
731
|
+
componentRef: l().componentRef,
|
|
732
|
+
componentOptions: l().componentOptions,
|
|
733
|
+
blockChildren: l().blockChildren,
|
|
734
|
+
context: l().context,
|
|
735
|
+
registeredComponents: l().registeredComponents,
|
|
736
|
+
builderBlock: l().builderBlock,
|
|
737
|
+
includeBlockProps: l().includeBlockProps,
|
|
738
|
+
isInteractive: l().isInteractive
|
|
756
739
|
}
|
|
757
|
-
) }) :
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
740
|
+
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
741
|
+
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
742
|
+
BlockWrapper,
|
|
743
|
+
{
|
|
744
|
+
Wrapper: o(),
|
|
745
|
+
block: i(),
|
|
746
|
+
context: e.context,
|
|
747
|
+
hasChildren: !1
|
|
748
|
+
}
|
|
749
|
+
) }) : null,
|
|
750
|
+
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((m, S) => /* @__PURE__ */ jsx(
|
|
751
|
+
RepeatedBlock,
|
|
752
|
+
{
|
|
753
|
+
repeatContext: m.context,
|
|
754
|
+
block: m.block,
|
|
755
|
+
registeredComponents: e.registeredComponents
|
|
756
|
+
},
|
|
757
|
+
S
|
|
758
|
+
)) }) : null,
|
|
759
|
+
!isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
760
|
+
BlockWrapper,
|
|
761
|
+
{
|
|
762
|
+
Wrapper: o(),
|
|
763
|
+
block: i(),
|
|
764
|
+
context: e.context,
|
|
765
|
+
hasChildren: !0,
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsx(
|
|
768
|
+
ComponentRef,
|
|
769
|
+
{
|
|
770
|
+
componentRef: l().componentRef,
|
|
771
|
+
componentOptions: l().componentOptions,
|
|
772
|
+
blockChildren: l().blockChildren,
|
|
773
|
+
context: l().context,
|
|
774
|
+
registeredComponents: l().registeredComponents,
|
|
775
|
+
builderBlock: l().builderBlock,
|
|
776
|
+
includeBlockProps: l().includeBlockProps,
|
|
777
|
+
isInteractive: l().isInteractive
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
(x = a()) == null ? void 0 : x.map((m) => /* @__PURE__ */ jsx(
|
|
781
|
+
Block,
|
|
782
|
+
{
|
|
783
|
+
block: m,
|
|
784
|
+
context: c,
|
|
785
|
+
registeredComponents: e.registeredComponents
|
|
786
|
+
},
|
|
787
|
+
m.id
|
|
788
|
+
))
|
|
789
|
+
]
|
|
790
|
+
}
|
|
791
|
+
) }) : null
|
|
792
|
+
] })
|
|
793
|
+
] }) : null });
|
|
809
794
|
}
|
|
810
795
|
function BlocksWrapper(e) {
|
|
811
796
|
function t() {
|
|
@@ -813,8 +798,8 @@ function BlocksWrapper(e) {
|
|
|
813
798
|
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
814
799
|
}
|
|
815
800
|
function n() {
|
|
816
|
-
var o,
|
|
817
|
-
isEditing() && !((o = e.blocks) != null && o.length) && ((
|
|
801
|
+
var o, r;
|
|
802
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
|
|
818
803
|
{
|
|
819
804
|
type: "builder.clickEmptyBlocks",
|
|
820
805
|
data: {
|
|
@@ -826,8 +811,8 @@ function BlocksWrapper(e) {
|
|
|
826
811
|
));
|
|
827
812
|
}
|
|
828
813
|
function i() {
|
|
829
|
-
var o,
|
|
830
|
-
isEditing() && !((o = e.blocks) != null && o.length) && ((
|
|
814
|
+
var o, r;
|
|
815
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
|
|
831
816
|
{
|
|
832
817
|
type: "builder.hoverEmptyBlocks",
|
|
833
818
|
data: {
|
|
@@ -861,9 +846,9 @@ function BlocksWrapper(e) {
|
|
|
861
846
|
] });
|
|
862
847
|
}
|
|
863
848
|
function Blocks(e) {
|
|
864
|
-
var i, o,
|
|
849
|
+
var i, o, r;
|
|
865
850
|
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
866
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ jsx(
|
|
867
852
|
BlocksWrapper,
|
|
868
853
|
{
|
|
869
854
|
blocks: e.blocks,
|
|
@@ -872,25 +857,15 @@ function Blocks(e) {
|
|
|
872
857
|
styleProp: e.styleProp,
|
|
873
858
|
BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
|
|
874
859
|
BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
|
|
875
|
-
children:
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
)) }) : null,
|
|
885
|
-
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((c) => /* @__PURE__ */ jsx(
|
|
886
|
-
BlockStyles,
|
|
887
|
-
{
|
|
888
|
-
block: c,
|
|
889
|
-
context: e.context || t
|
|
890
|
-
},
|
|
891
|
-
"block-style-" + c.id
|
|
892
|
-
)) }) : null
|
|
893
|
-
]
|
|
860
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((a) => /* @__PURE__ */ jsx(
|
|
861
|
+
Block,
|
|
862
|
+
{
|
|
863
|
+
block: a,
|
|
864
|
+
context: e.context || t,
|
|
865
|
+
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
866
|
+
},
|
|
867
|
+
a.id
|
|
868
|
+
)) }) : null
|
|
894
869
|
}
|
|
895
870
|
);
|
|
896
871
|
}
|
|
@@ -898,33 +873,33 @@ function Columns(e) {
|
|
|
898
873
|
var E;
|
|
899
874
|
const [t, n] = useState(
|
|
900
875
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
901
|
-
), [i, o] = useState(() => e.columns || []), [
|
|
876
|
+
), [i, o] = useState(() => e.columns || []), [r, a] = useState(
|
|
902
877
|
() => e.stackColumnsAt || "tablet"
|
|
903
878
|
);
|
|
904
|
-
function
|
|
905
|
-
var
|
|
906
|
-
return ((
|
|
879
|
+
function l(v) {
|
|
880
|
+
var C;
|
|
881
|
+
return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
|
|
907
882
|
}
|
|
908
|
-
function
|
|
909
|
-
const
|
|
910
|
-
return `calc(${
|
|
883
|
+
function c(v) {
|
|
884
|
+
const C = t * (i.length - 1) / i.length;
|
|
885
|
+
return `calc(${l(v)}% - ${C}px)`;
|
|
911
886
|
}
|
|
912
887
|
function s({
|
|
913
|
-
stackedStyle:
|
|
914
|
-
desktopStyle:
|
|
888
|
+
stackedStyle: v,
|
|
889
|
+
desktopStyle: C
|
|
915
890
|
}) {
|
|
916
|
-
return
|
|
891
|
+
return r === "tablet" ? v : C;
|
|
917
892
|
}
|
|
918
893
|
function d({
|
|
919
|
-
stackedStyle:
|
|
920
|
-
desktopStyle:
|
|
894
|
+
stackedStyle: v,
|
|
895
|
+
desktopStyle: C
|
|
921
896
|
}) {
|
|
922
|
-
return
|
|
897
|
+
return r === "never" ? C : v;
|
|
923
898
|
}
|
|
924
899
|
const [g, x] = useState(
|
|
925
900
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
926
901
|
);
|
|
927
|
-
function
|
|
902
|
+
function m() {
|
|
928
903
|
return {
|
|
929
904
|
"--flex-dir": g,
|
|
930
905
|
"--flex-dir-tablet": s({
|
|
@@ -933,8 +908,8 @@ function Columns(e) {
|
|
|
933
908
|
})
|
|
934
909
|
};
|
|
935
910
|
}
|
|
936
|
-
function
|
|
937
|
-
const
|
|
911
|
+
function S(v) {
|
|
912
|
+
const C = v === 0 ? 0 : t, T = c(v), w = `${C}px`, R = "100%", j = 0;
|
|
938
913
|
return {
|
|
939
914
|
width: T,
|
|
940
915
|
["marginLeft"]: w,
|
|
@@ -956,13 +931,13 @@ function Columns(e) {
|
|
|
956
931
|
})
|
|
957
932
|
};
|
|
958
933
|
}
|
|
959
|
-
function p(
|
|
934
|
+
function p(v) {
|
|
960
935
|
var T, w;
|
|
961
936
|
return getSizesForBreakpoints(
|
|
962
937
|
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
963
|
-
)[
|
|
938
|
+
)[v].max;
|
|
964
939
|
}
|
|
965
|
-
function
|
|
940
|
+
function I() {
|
|
966
941
|
return `
|
|
967
942
|
@media (max-width: ${p("medium")}px) {
|
|
968
943
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -993,38 +968,38 @@ function Columns(e) {
|
|
|
993
968
|
/* @__PURE__ */ jsxs(
|
|
994
969
|
"div",
|
|
995
970
|
{
|
|
996
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
997
|
-
style:
|
|
971
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-3c01d6ec`,
|
|
972
|
+
style: m(),
|
|
998
973
|
children: [
|
|
999
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
1000
|
-
(E = e.columns) == null ? void 0 : E.map((
|
|
974
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
|
|
975
|
+
(E = e.columns) == null ? void 0 : E.map((v, C) => /* @__PURE__ */ createElement(
|
|
1001
976
|
"div",
|
|
1002
977
|
{
|
|
1003
|
-
className: "builder-column div-
|
|
1004
|
-
style:
|
|
1005
|
-
key:
|
|
978
|
+
className: "builder-column div-3c01d6ec-2",
|
|
979
|
+
style: S(C),
|
|
980
|
+
key: C
|
|
1006
981
|
},
|
|
1007
982
|
/* @__PURE__ */ jsx(
|
|
1008
983
|
Blocks,
|
|
1009
984
|
{
|
|
1010
|
-
path: `component.options.columns.${
|
|
985
|
+
path: `component.options.columns.${C}.blocks`,
|
|
1011
986
|
parent: e.builderBlock.id,
|
|
1012
987
|
styleProp: {
|
|
1013
988
|
flexGrow: "1"
|
|
1014
989
|
},
|
|
1015
990
|
context: e.builderContext,
|
|
1016
991
|
registeredComponents: e.builderComponents,
|
|
1017
|
-
blocks:
|
|
992
|
+
blocks: v.blocks
|
|
1018
993
|
}
|
|
1019
994
|
)
|
|
1020
995
|
))
|
|
1021
996
|
]
|
|
1022
997
|
}
|
|
1023
998
|
),
|
|
1024
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
999
|
+
/* @__PURE__ */ jsx("style", { children: `.div-3c01d6ec {
|
|
1025
1000
|
display: flex;
|
|
1026
1001
|
line-height: normal;
|
|
1027
|
-
}.div-
|
|
1002
|
+
}.div-3c01d6ec-2 {
|
|
1028
1003
|
display: flex;
|
|
1029
1004
|
flex-direction: column;
|
|
1030
1005
|
align-items: stretch;
|
|
@@ -1048,8 +1023,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
1048
1023
|
return removeProtocol(e);
|
|
1049
1024
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1050
1025
|
if (n) {
|
|
1051
|
-
const i = e.split(n[0]), o = n[3],
|
|
1052
|
-
return removeProtocol(`${i[0]}_${
|
|
1026
|
+
const i = e.split(n[0]), o = n[3], r = t.match("x") ? t : `${t}x`;
|
|
1027
|
+
return removeProtocol(`${i[0]}_${r}${o}`);
|
|
1053
1028
|
}
|
|
1054
1029
|
return null;
|
|
1055
1030
|
}
|
|
@@ -1065,7 +1040,7 @@ function getSrcSet(e) {
|
|
|
1065
1040
|
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;
|
|
1066
1041
|
}
|
|
1067
1042
|
function Image(e) {
|
|
1068
|
-
var o,
|
|
1043
|
+
var o, r, a, l;
|
|
1069
1044
|
function t() {
|
|
1070
1045
|
var d;
|
|
1071
1046
|
const s = e.image || e.src;
|
|
@@ -1081,18 +1056,18 @@ function Image(e) {
|
|
|
1081
1056
|
return getSrcSet(s);
|
|
1082
1057
|
}
|
|
1083
1058
|
function n() {
|
|
1084
|
-
var
|
|
1085
|
-
return (
|
|
1059
|
+
var c;
|
|
1060
|
+
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1086
1061
|
}
|
|
1087
1062
|
function i() {
|
|
1088
|
-
const
|
|
1063
|
+
const c = {
|
|
1089
1064
|
position: "absolute",
|
|
1090
1065
|
height: "100%",
|
|
1091
1066
|
width: "100%",
|
|
1092
1067
|
left: "0px",
|
|
1093
1068
|
top: "0px"
|
|
1094
1069
|
};
|
|
1095
|
-
return e.aspectRatio ?
|
|
1070
|
+
return e.aspectRatio ? c : void 0;
|
|
1096
1071
|
}
|
|
1097
1072
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1098
1073
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1109,33 +1084,33 @@ function Image(e) {
|
|
|
1109
1084
|
objectFit: e.backgroundSize || "cover",
|
|
1110
1085
|
...i()
|
|
1111
1086
|
},
|
|
1112
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
1087
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
|
|
1113
1088
|
src: e.image,
|
|
1114
1089
|
srcSet: t(),
|
|
1115
1090
|
sizes: e.sizes
|
|
1116
1091
|
}
|
|
1117
1092
|
)
|
|
1118
1093
|
] }),
|
|
1119
|
-
e.aspectRatio && !((
|
|
1094
|
+
e.aspectRatio && !((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1120
1095
|
"div",
|
|
1121
1096
|
{
|
|
1122
|
-
className: "builder-image-sizer div-
|
|
1097
|
+
className: "builder-image-sizer div-40c70c9b",
|
|
1123
1098
|
style: {
|
|
1124
1099
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
1125
1100
|
}
|
|
1126
1101
|
}
|
|
1127
1102
|
) }) : null,
|
|
1128
|
-
(
|
|
1129
|
-
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-
|
|
1103
|
+
(l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1104
|
+
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
1130
1105
|
] }),
|
|
1131
|
-
/* @__PURE__ */ jsx("style", { children: `.img-
|
|
1106
|
+
/* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
|
|
1132
1107
|
opacity: 1;
|
|
1133
1108
|
transition: opacity 0.2s ease-in-out;
|
|
1134
|
-
}.div-
|
|
1109
|
+
}.div-40c70c9b {
|
|
1135
1110
|
width: 100%;
|
|
1136
1111
|
pointer-events: none;
|
|
1137
1112
|
font-size: 0;
|
|
1138
|
-
}.div-
|
|
1113
|
+
}.div-40c70c9b-2 {
|
|
1139
1114
|
display: flex;
|
|
1140
1115
|
flex-direction: column;
|
|
1141
1116
|
align-items: stretch;
|
|
@@ -1380,7 +1355,7 @@ const componentInfo$a = {
|
|
|
1380
1355
|
});
|
|
1381
1356
|
}
|
|
1382
1357
|
const n = e.get("columns");
|
|
1383
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((
|
|
1358
|
+
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();
|
|
1384
1359
|
}
|
|
1385
1360
|
}, {
|
|
1386
1361
|
name: "space",
|
|
@@ -1426,14 +1401,14 @@ const componentInfo$a = {
|
|
|
1426
1401
|
}]
|
|
1427
1402
|
};
|
|
1428
1403
|
function CustomCode(e) {
|
|
1429
|
-
const t = useRef(null), [n, i] = useState(() => []), [o,
|
|
1404
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []);
|
|
1430
1405
|
return useEffect(() => {
|
|
1431
|
-
var
|
|
1432
|
-
if (!((
|
|
1406
|
+
var l;
|
|
1407
|
+
if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
|
|
1433
1408
|
return;
|
|
1434
|
-
const
|
|
1435
|
-
for (let
|
|
1436
|
-
const s =
|
|
1409
|
+
const a = t.current.getElementsByTagName("script");
|
|
1410
|
+
for (let c = 0; c < a.length; c++) {
|
|
1411
|
+
const s = a[c];
|
|
1437
1412
|
if (s.src) {
|
|
1438
1413
|
if (n.includes(s.src))
|
|
1439
1414
|
continue;
|
|
@@ -1490,8 +1465,8 @@ const componentInfo$7 = {
|
|
|
1490
1465
|
}]
|
|
1491
1466
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1492
1467
|
function Embed(e) {
|
|
1493
|
-
const t = useRef(null), [n, i] = useState(() => []), [o,
|
|
1494
|
-
function
|
|
1468
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a, l] = useState(() => !1);
|
|
1469
|
+
function c() {
|
|
1495
1470
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1496
1471
|
return;
|
|
1497
1472
|
const s = t.current.getElementsByTagName("script");
|
|
@@ -1510,8 +1485,8 @@ function Embed(e) {
|
|
|
1510
1485
|
}
|
|
1511
1486
|
}
|
|
1512
1487
|
return useEffect(() => {
|
|
1513
|
-
t.current && !
|
|
1514
|
-
}, [t.current,
|
|
1488
|
+
t.current && !a && (l(!0), c());
|
|
1489
|
+
}, [t.current, a]), /* @__PURE__ */ jsx(
|
|
1515
1490
|
"div",
|
|
1516
1491
|
{
|
|
1517
1492
|
className: "builder-embed",
|
|
@@ -1546,29 +1521,29 @@ const componentInfo$6 = {
|
|
|
1546
1521
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1547
1522
|
onChange: (e) => {
|
|
1548
1523
|
e.delete("srcset"), e.delete("noWebp");
|
|
1549
|
-
function n(
|
|
1550
|
-
return new Promise((
|
|
1524
|
+
function n(a, l = 6e4) {
|
|
1525
|
+
return new Promise((c, s) => {
|
|
1551
1526
|
const d = document.createElement("img");
|
|
1552
1527
|
let g = !1;
|
|
1553
1528
|
d.onload = () => {
|
|
1554
|
-
g = !0,
|
|
1529
|
+
g = !0, c(d);
|
|
1555
1530
|
}, d.addEventListener("error", (x) => {
|
|
1556
1531
|
console.warn("Image load failed", x.error), s(x.error);
|
|
1557
|
-
}), d.src =
|
|
1532
|
+
}), d.src = a, setTimeout(() => {
|
|
1558
1533
|
g || s(new Error("Image load timed out"));
|
|
1559
|
-
},
|
|
1534
|
+
}, l);
|
|
1560
1535
|
});
|
|
1561
1536
|
}
|
|
1562
|
-
function i(
|
|
1563
|
-
return Math.round(
|
|
1537
|
+
function i(a) {
|
|
1538
|
+
return Math.round(a * 1e3) / 1e3;
|
|
1564
1539
|
}
|
|
1565
|
-
const o = e.get("image"),
|
|
1566
|
-
if (fetch(o).then((
|
|
1567
|
-
|
|
1568
|
-
}), o && (!
|
|
1569
|
-
return n(o).then((
|
|
1570
|
-
const
|
|
1571
|
-
e.get("image") === o && (!
|
|
1540
|
+
const o = e.get("image"), r = e.get("aspectRatio");
|
|
1541
|
+
if (fetch(o).then((a) => a.blob()).then((a) => {
|
|
1542
|
+
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1543
|
+
}), o && (!r || r === 0.7041))
|
|
1544
|
+
return n(o).then((a) => {
|
|
1545
|
+
const l = e.get("aspectRatio");
|
|
1546
|
+
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));
|
|
1572
1547
|
});
|
|
1573
1548
|
}
|
|
1574
1549
|
}, {
|
|
@@ -1843,7 +1818,7 @@ const componentInfo = {
|
|
|
1843
1818
|
}]
|
|
1844
1819
|
};
|
|
1845
1820
|
function Video(e) {
|
|
1846
|
-
var i, o, a,
|
|
1821
|
+
var i, o, r, a, l, c, s;
|
|
1847
1822
|
function t() {
|
|
1848
1823
|
return {
|
|
1849
1824
|
...e.autoPlay === !0 ? {
|
|
@@ -1900,7 +1875,7 @@ function Video(e) {
|
|
|
1900
1875
|
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
1901
1876
|
}
|
|
1902
1877
|
),
|
|
1903
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
1878
|
+
e.aspectRatio && !(e.fitContent && ((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1904
1879
|
"div",
|
|
1905
1880
|
{
|
|
1906
1881
|
style: {
|
|
@@ -1911,7 +1886,7 @@ function Video(e) {
|
|
|
1911
1886
|
}
|
|
1912
1887
|
}
|
|
1913
1888
|
) }) : null,
|
|
1914
|
-
(
|
|
1889
|
+
(l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1915
1890
|
"div",
|
|
1916
1891
|
{
|
|
1917
1892
|
style: {
|
|
@@ -1922,7 +1897,7 @@ function Video(e) {
|
|
|
1922
1897
|
children: e.children
|
|
1923
1898
|
}
|
|
1924
1899
|
) }) : null,
|
|
1925
|
-
(s = (
|
|
1900
|
+
(s = (c = e.builderBlock) == null ? void 0 : c.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1926
1901
|
"div",
|
|
1927
1902
|
{
|
|
1928
1903
|
style: {
|
|
@@ -2115,10 +2090,10 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2115
2090
|
event: e,
|
|
2116
2091
|
target: t
|
|
2117
2092
|
}) => {
|
|
2118
|
-
const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top,
|
|
2093
|
+
const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, r = round(i / n.width), a = round(o / n.height);
|
|
2119
2094
|
return {
|
|
2120
|
-
x:
|
|
2121
|
-
y:
|
|
2095
|
+
x: r,
|
|
2096
|
+
y: a
|
|
2122
2097
|
};
|
|
2123
2098
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
2124
2099
|
const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
@@ -2136,7 +2111,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2136
2111
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2137
2112
|
}
|
|
2138
2113
|
};
|
|
2139
|
-
}, SDK_VERSION = "0.11.
|
|
2114
|
+
}, SDK_VERSION = "0.11.3", registerInsertMenu = () => {
|
|
2140
2115
|
register("insertMenu", {
|
|
2141
2116
|
name: "_default",
|
|
2142
2117
|
default: !0,
|
|
@@ -2181,37 +2156,37 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2181
2156
|
}, "*"), window.addEventListener("message", ({
|
|
2182
2157
|
data: i
|
|
2183
2158
|
}) => {
|
|
2184
|
-
var o,
|
|
2159
|
+
var o, r;
|
|
2185
2160
|
if (i != null && i.type)
|
|
2186
2161
|
switch (i.type) {
|
|
2187
2162
|
case "builder.evaluate": {
|
|
2188
|
-
const
|
|
2163
|
+
const a = i.data.text, l = i.data.arguments || [], c = i.data.id, s = new Function(a);
|
|
2189
2164
|
let d, g = null;
|
|
2190
2165
|
try {
|
|
2191
|
-
d = s.apply(null,
|
|
2166
|
+
d = s.apply(null, l);
|
|
2192
2167
|
} catch (x) {
|
|
2193
2168
|
g = x;
|
|
2194
2169
|
}
|
|
2195
2170
|
g ? (o = window.parent) == null || o.postMessage({
|
|
2196
2171
|
type: "builder.evaluateError",
|
|
2197
2172
|
data: {
|
|
2198
|
-
id:
|
|
2173
|
+
id: c,
|
|
2199
2174
|
error: g.message
|
|
2200
2175
|
}
|
|
2201
2176
|
}, "*") : d && typeof d.then == "function" ? d.then((x) => {
|
|
2202
|
-
var
|
|
2203
|
-
(
|
|
2177
|
+
var m;
|
|
2178
|
+
(m = window.parent) == null || m.postMessage({
|
|
2204
2179
|
type: "builder.evaluateResult",
|
|
2205
2180
|
data: {
|
|
2206
|
-
id:
|
|
2181
|
+
id: c,
|
|
2207
2182
|
result: x
|
|
2208
2183
|
}
|
|
2209
2184
|
}, "*");
|
|
2210
|
-
}).catch(console.error) : (
|
|
2185
|
+
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
2211
2186
|
type: "builder.evaluateResult",
|
|
2212
2187
|
data: {
|
|
2213
2188
|
result: d,
|
|
2214
|
-
id:
|
|
2189
|
+
id: c
|
|
2215
2190
|
}
|
|
2216
2191
|
}, "*");
|
|
2217
2192
|
break;
|
|
@@ -2223,8 +2198,8 @@ function EnableEditor(e) {
|
|
|
2223
2198
|
var R, j, P, A, F, _, V;
|
|
2224
2199
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2225
2200
|
function o(u) {
|
|
2226
|
-
var h, b,
|
|
2227
|
-
const
|
|
2201
|
+
var h, b, y, k, B;
|
|
2202
|
+
const f = {
|
|
2228
2203
|
...e.builderContextSignal.content,
|
|
2229
2204
|
...u,
|
|
2230
2205
|
data: {
|
|
@@ -2234,46 +2209,46 @@ function EnableEditor(e) {
|
|
|
2234
2209
|
meta: {
|
|
2235
2210
|
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2236
2211
|
...u == null ? void 0 : u.meta,
|
|
2237
|
-
breakpoints: ((
|
|
2212
|
+
breakpoints: ((y = u == null ? void 0 : u.meta) == null ? void 0 : y.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
|
|
2238
2213
|
}
|
|
2239
2214
|
};
|
|
2240
2215
|
e.setBuilderContextSignal((W) => ({
|
|
2241
2216
|
...W,
|
|
2242
|
-
content:
|
|
2217
|
+
content: f
|
|
2243
2218
|
}));
|
|
2244
2219
|
}
|
|
2245
2220
|
useState(() => 0);
|
|
2246
|
-
const [
|
|
2221
|
+
const [r, a] = useState(
|
|
2247
2222
|
() => !1
|
|
2248
|
-
), [
|
|
2223
|
+
), [l, c] = useState(
|
|
2249
2224
|
() => e.contentWrapper || "div"
|
|
2250
2225
|
);
|
|
2251
2226
|
function s(u) {
|
|
2252
2227
|
var h;
|
|
2253
|
-
const { data:
|
|
2254
|
-
if (
|
|
2255
|
-
switch (
|
|
2228
|
+
const { data: f } = u;
|
|
2229
|
+
if (f)
|
|
2230
|
+
switch (f.type) {
|
|
2256
2231
|
case "builder.configureSdk": {
|
|
2257
|
-
const b =
|
|
2258
|
-
if (!
|
|
2232
|
+
const b = f.data, { breakpoints: y, contentId: k } = b;
|
|
2233
|
+
if (!k || k !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
|
|
2259
2234
|
return;
|
|
2260
|
-
|
|
2235
|
+
y && o({
|
|
2261
2236
|
meta: {
|
|
2262
|
-
breakpoints:
|
|
2237
|
+
breakpoints: y
|
|
2263
2238
|
}
|
|
2264
2239
|
}), i(n + 1);
|
|
2265
2240
|
break;
|
|
2266
2241
|
}
|
|
2267
2242
|
case "builder.contentUpdate": {
|
|
2268
|
-
const b =
|
|
2269
|
-
|
|
2243
|
+
const b = f.data, y = b.key || b.alias || b.entry || b.modelName, k = b.data;
|
|
2244
|
+
y === e.model && (o(k), i(n + 1));
|
|
2270
2245
|
break;
|
|
2271
2246
|
}
|
|
2272
2247
|
}
|
|
2273
2248
|
}
|
|
2274
2249
|
function d() {
|
|
2275
|
-
var
|
|
2276
|
-
const u = (h = (
|
|
2250
|
+
var f, h;
|
|
2251
|
+
const u = (h = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : h.jsCode;
|
|
2277
2252
|
u && evaluate({
|
|
2278
2253
|
code: u,
|
|
2279
2254
|
context: e.context || {},
|
|
@@ -2282,27 +2257,27 @@ function EnableEditor(e) {
|
|
|
2282
2257
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2283
2258
|
});
|
|
2284
2259
|
}
|
|
2285
|
-
const [g, x] = useState(() => ({})), [
|
|
2260
|
+
const [g, x] = useState(() => ({})), [m, S] = useState(() => !1);
|
|
2286
2261
|
function p(u) {
|
|
2287
|
-
var
|
|
2262
|
+
var f, h;
|
|
2288
2263
|
if (e.builderContextSignal.content) {
|
|
2289
|
-
const b = (
|
|
2264
|
+
const b = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, y = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2290
2265
|
_track({
|
|
2291
2266
|
type: "click",
|
|
2292
2267
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2293
|
-
contentId:
|
|
2268
|
+
contentId: y,
|
|
2294
2269
|
apiKey: e.apiKey,
|
|
2295
|
-
variationId: b !==
|
|
2270
|
+
variationId: b !== y ? b : void 0,
|
|
2296
2271
|
...getInteractionPropertiesForEvent(u),
|
|
2297
|
-
unique: !
|
|
2272
|
+
unique: !m
|
|
2298
2273
|
});
|
|
2299
2274
|
}
|
|
2300
|
-
|
|
2275
|
+
m || S(!0);
|
|
2301
2276
|
}
|
|
2302
|
-
function
|
|
2277
|
+
function I(u) {
|
|
2303
2278
|
return u.replace(
|
|
2304
2279
|
/{{([^}]+)}}/g,
|
|
2305
|
-
(
|
|
2280
|
+
(f, h) => evaluate({
|
|
2306
2281
|
code: h,
|
|
2307
2282
|
context: e.context || {},
|
|
2308
2283
|
localState: void 0,
|
|
@@ -2311,32 +2286,32 @@ function EnableEditor(e) {
|
|
|
2311
2286
|
})
|
|
2312
2287
|
);
|
|
2313
2288
|
}
|
|
2314
|
-
function E({ url: u, key:
|
|
2289
|
+
function E({ url: u, key: f }) {
|
|
2315
2290
|
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2316
|
-
var
|
|
2291
|
+
var y, k;
|
|
2317
2292
|
const b = {
|
|
2318
2293
|
...e.builderContextSignal.rootState,
|
|
2319
|
-
[
|
|
2294
|
+
[f]: h
|
|
2320
2295
|
};
|
|
2321
|
-
(
|
|
2296
|
+
(k = (y = e.builderContextSignal).rootSetState) == null || k.call(y, b), g[f] = !0;
|
|
2322
2297
|
}).catch((h) => {
|
|
2323
2298
|
console.error("error fetching dynamic data", u, h);
|
|
2324
2299
|
});
|
|
2325
2300
|
}
|
|
2326
|
-
function
|
|
2327
|
-
var
|
|
2328
|
-
const u = (b = (h = (
|
|
2329
|
-
Object.entries(u).forEach(([
|
|
2330
|
-
if (
|
|
2331
|
-
const B = k
|
|
2301
|
+
function v() {
|
|
2302
|
+
var f, h, b;
|
|
2303
|
+
const u = (b = (h = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : h.httpRequests) != null ? b : {};
|
|
2304
|
+
Object.entries(u).forEach(([y, k]) => {
|
|
2305
|
+
if (k && (!g[y] || isEditing())) {
|
|
2306
|
+
const B = I(k);
|
|
2332
2307
|
E({
|
|
2333
2308
|
url: B,
|
|
2334
|
-
key:
|
|
2309
|
+
key: y
|
|
2335
2310
|
});
|
|
2336
2311
|
}
|
|
2337
2312
|
});
|
|
2338
2313
|
}
|
|
2339
|
-
function
|
|
2314
|
+
function C() {
|
|
2340
2315
|
isEditing() && window.dispatchEvent(
|
|
2341
2316
|
new CustomEvent(
|
|
2342
2317
|
"builder:component:stateChange",
|
|
@@ -2364,25 +2339,25 @@ function EnableEditor(e) {
|
|
|
2364
2339
|
} : {}
|
|
2365
2340
|
}), Object.values(
|
|
2366
2341
|
e.builderContextSignal.componentInfos
|
|
2367
|
-
).forEach((
|
|
2342
|
+
).forEach((f) => {
|
|
2368
2343
|
var b;
|
|
2369
|
-
const h = createRegisterComponentMessage(
|
|
2344
|
+
const h = createRegisterComponentMessage(f);
|
|
2370
2345
|
(b = window.parent) == null || b.postMessage(h, "*");
|
|
2371
2346
|
}), window.addEventListener(
|
|
2372
2347
|
"builder:component:stateChangeListenerActivated",
|
|
2373
|
-
|
|
2348
|
+
C
|
|
2374
2349
|
);
|
|
2375
2350
|
}
|
|
2376
2351
|
function w(u) {
|
|
2377
|
-
const
|
|
2352
|
+
const f = new URL(location.href).searchParams, h = f.get("builder.preview"), b = f.get(
|
|
2378
2353
|
`builder.preview.${h}`
|
|
2379
|
-
),
|
|
2380
|
-
h === e.model &&
|
|
2354
|
+
), y = f.get("apiKey") || f.get("builder.space");
|
|
2355
|
+
h === e.model && y === e.apiKey && (!e.content || b === e.content.id) && fetchOneEntry({
|
|
2381
2356
|
model: e.model,
|
|
2382
2357
|
apiKey: e.apiKey,
|
|
2383
2358
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2384
|
-
}).then((
|
|
2385
|
-
|
|
2359
|
+
}).then((k) => {
|
|
2360
|
+
k && o(k);
|
|
2386
2361
|
});
|
|
2387
2362
|
}
|
|
2388
2363
|
return useEffect(() => {
|
|
@@ -2391,8 +2366,8 @@ function EnableEditor(e) {
|
|
|
2391
2366
|
"initeditingbldr",
|
|
2392
2367
|
T
|
|
2393
2368
|
), () => {
|
|
2394
|
-
var
|
|
2395
|
-
return (
|
|
2369
|
+
var f;
|
|
2370
|
+
return (f = t.current) == null ? void 0 : f.removeEventListener(
|
|
2396
2371
|
"initeditingbldr",
|
|
2397
2372
|
T
|
|
2398
2373
|
);
|
|
@@ -2403,23 +2378,23 @@ function EnableEditor(e) {
|
|
|
2403
2378
|
"initpreviewingbldr",
|
|
2404
2379
|
w
|
|
2405
2380
|
), () => {
|
|
2406
|
-
var
|
|
2407
|
-
return (
|
|
2381
|
+
var f;
|
|
2382
|
+
return (f = t.current) == null ? void 0 : f.removeEventListener(
|
|
2408
2383
|
"initpreviewingbldr",
|
|
2409
2384
|
w
|
|
2410
2385
|
);
|
|
2411
2386
|
};
|
|
2412
2387
|
}, []), useEffect(() => {
|
|
2413
|
-
var u,
|
|
2388
|
+
var u, f;
|
|
2414
2389
|
if (isBrowser()) {
|
|
2415
2390
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2416
|
-
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId,
|
|
2391
|
+
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, y = (f = e.builderContextSignal.content) == null ? void 0 : f.id, k = e.apiKey;
|
|
2417
2392
|
_track({
|
|
2418
2393
|
type: "impression",
|
|
2419
2394
|
canTrack: !0,
|
|
2420
|
-
contentId:
|
|
2421
|
-
apiKey:
|
|
2422
|
-
variationId: b !==
|
|
2395
|
+
contentId: y,
|
|
2396
|
+
apiKey: k,
|
|
2397
|
+
variationId: b !== y ? b : void 0
|
|
2423
2398
|
});
|
|
2424
2399
|
}
|
|
2425
2400
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2427,26 +2402,26 @@ function EnableEditor(e) {
|
|
|
2427
2402
|
}, []), useEffect(() => {
|
|
2428
2403
|
e.apiKey || logger.error(
|
|
2429
2404
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2430
|
-
), d(),
|
|
2405
|
+
), d(), v(), C();
|
|
2431
2406
|
}, []), useEffect(() => {
|
|
2432
2407
|
e.content && o(e.content);
|
|
2433
2408
|
}, [e.content]), useEffect(() => {
|
|
2434
|
-
}, [
|
|
2409
|
+
}, [r]), useEffect(() => {
|
|
2435
2410
|
d();
|
|
2436
2411
|
}, [
|
|
2437
2412
|
(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.jsCode,
|
|
2438
2413
|
e.builderContextSignal.rootState
|
|
2439
2414
|
]), useEffect(() => {
|
|
2440
|
-
|
|
2415
|
+
v();
|
|
2441
2416
|
}, [(A = (P = e.builderContextSignal.content) == null ? void 0 : P.data) == null ? void 0 : A.httpRequests]), useEffect(() => {
|
|
2442
|
-
|
|
2417
|
+
C();
|
|
2443
2418
|
}, [e.builderContextSignal.rootState]), useEffect(() => () => {
|
|
2444
2419
|
isBrowser() && (window.removeEventListener("message", s), window.removeEventListener(
|
|
2445
2420
|
"builder:component:stateChangeListenerActivated",
|
|
2446
|
-
|
|
2421
|
+
C
|
|
2447
2422
|
));
|
|
2448
2423
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2449
|
-
|
|
2424
|
+
l,
|
|
2450
2425
|
{
|
|
2451
2426
|
key: n,
|
|
2452
2427
|
ref: t,
|
|
@@ -2464,8 +2439,8 @@ function EnableEditor(e) {
|
|
|
2464
2439
|
) }) : null });
|
|
2465
2440
|
}
|
|
2466
2441
|
const getCssFromFont = (e) => {
|
|
2467
|
-
var
|
|
2468
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (
|
|
2442
|
+
var r, a;
|
|
2443
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (r = e == null ? void 0 : e.files) == null ? void 0 : r.regular;
|
|
2469
2444
|
let o = "";
|
|
2470
2445
|
if (i && t && n && (o += `
|
|
2471
2446
|
@font-face {
|
|
@@ -2475,16 +2450,16 @@ font-display: fallback;
|
|
|
2475
2450
|
font-weight: 400;
|
|
2476
2451
|
}
|
|
2477
2452
|
`.trim()), e.files)
|
|
2478
|
-
for (const
|
|
2479
|
-
if (!(String(Number(
|
|
2453
|
+
for (const l in e.files) {
|
|
2454
|
+
if (!(String(Number(l)) === l))
|
|
2480
2455
|
continue;
|
|
2481
|
-
const s = e.files[
|
|
2456
|
+
const s = e.files[l];
|
|
2482
2457
|
s && s !== i && (o += `
|
|
2483
2458
|
@font-face {
|
|
2484
2459
|
font-family: "${t}";
|
|
2485
2460
|
src: url('${s}') format('woff2');
|
|
2486
2461
|
font-display: fallback;
|
|
2487
|
-
font-weight: ${
|
|
2462
|
+
font-weight: ${l};
|
|
2488
2463
|
}
|
|
2489
2464
|
`.trim());
|
|
2490
2465
|
}
|
|
@@ -2530,10 +2505,10 @@ const getContextStateInitialValue = ({
|
|
|
2530
2505
|
data: t,
|
|
2531
2506
|
locale: n
|
|
2532
2507
|
}) => {
|
|
2533
|
-
var
|
|
2534
|
-
const i = {}, o = ((
|
|
2535
|
-
return (
|
|
2536
|
-
|
|
2508
|
+
var r, a, l;
|
|
2509
|
+
const i = {}, o = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2510
|
+
return (l = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || l.forEach((c) => {
|
|
2511
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
2537
2512
|
}), {
|
|
2538
2513
|
...i,
|
|
2539
2514
|
...o,
|
|
@@ -2554,25 +2529,25 @@ const getContextStateInitialValue = ({
|
|
|
2554
2529
|
meta: e == null ? void 0 : e.meta
|
|
2555
2530
|
} : void 0;
|
|
2556
2531
|
function ContentComponent(e) {
|
|
2557
|
-
var
|
|
2532
|
+
var c, s, d, g, x, m, S;
|
|
2558
2533
|
const [t, n] = useState(
|
|
2559
2534
|
() => {
|
|
2560
|
-
var p,
|
|
2535
|
+
var p, I;
|
|
2561
2536
|
return getUpdateVariantVisibilityScript({
|
|
2562
2537
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2563
2538
|
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
2564
2539
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2565
|
-
contentId: (
|
|
2540
|
+
contentId: (I = e.content) == null ? void 0 : I.id
|
|
2566
2541
|
});
|
|
2567
2542
|
}
|
|
2568
2543
|
);
|
|
2569
2544
|
function i(p) {
|
|
2570
|
-
|
|
2571
|
-
...
|
|
2545
|
+
l((I) => ({
|
|
2546
|
+
...I,
|
|
2572
2547
|
rootState: p
|
|
2573
2548
|
}));
|
|
2574
2549
|
}
|
|
2575
|
-
const [o,
|
|
2550
|
+
const [o, r] = useState(
|
|
2576
2551
|
() => [
|
|
2577
2552
|
...getDefaultRegisteredComponents(),
|
|
2578
2553
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2583,16 +2558,16 @@ function ContentComponent(e) {
|
|
|
2583
2558
|
...components,
|
|
2584
2559
|
...e.customComponents || []
|
|
2585
2560
|
].reduce(
|
|
2586
|
-
(p, { component:
|
|
2561
|
+
(p, { component: I, ...E }) => ({
|
|
2587
2562
|
...p,
|
|
2588
2563
|
[E.name]: {
|
|
2589
|
-
component:
|
|
2564
|
+
component: I,
|
|
2590
2565
|
...serializeComponentInfo(E)
|
|
2591
2566
|
}
|
|
2592
2567
|
}),
|
|
2593
2568
|
{}
|
|
2594
2569
|
)
|
|
2595
|
-
), [
|
|
2570
|
+
), [a, l] = useState(() => ({
|
|
2596
2571
|
content: getContentInitialValue({
|
|
2597
2572
|
content: e.content,
|
|
2598
2573
|
data: e.data
|
|
@@ -2617,7 +2592,7 @@ function ContentComponent(e) {
|
|
|
2617
2592
|
...components,
|
|
2618
2593
|
...e.customComponents || []
|
|
2619
2594
|
].reduce(
|
|
2620
|
-
(p, { component:
|
|
2595
|
+
(p, { component: I, ...E }) => ({
|
|
2621
2596
|
...p,
|
|
2622
2597
|
[E.name]: serializeComponentInfo(E)
|
|
2623
2598
|
}),
|
|
@@ -2645,25 +2620,25 @@ function ContentComponent(e) {
|
|
|
2645
2620
|
includeRefs: e.includeRefs,
|
|
2646
2621
|
enrich: e.enrich,
|
|
2647
2622
|
showContent: e.showContent,
|
|
2648
|
-
builderContextSignal:
|
|
2623
|
+
builderContextSignal: a,
|
|
2649
2624
|
contentWrapper: e.contentWrapper,
|
|
2650
2625
|
contentWrapperProps: e.contentWrapperProps,
|
|
2651
|
-
setBuilderContextSignal:
|
|
2626
|
+
setBuilderContextSignal: l,
|
|
2652
2627
|
children: [
|
|
2653
2628
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2654
2629
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2655
2630
|
ContentStyles,
|
|
2656
2631
|
{
|
|
2657
|
-
contentId: (
|
|
2658
|
-
cssCode: (d = (s =
|
|
2659
|
-
customFonts: (x = (g =
|
|
2632
|
+
contentId: (c = a.content) == null ? void 0 : c.id,
|
|
2633
|
+
cssCode: (d = (s = a.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2634
|
+
customFonts: (x = (g = a.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2660
2635
|
}
|
|
2661
2636
|
) }),
|
|
2662
2637
|
/* @__PURE__ */ jsx(
|
|
2663
2638
|
Blocks,
|
|
2664
2639
|
{
|
|
2665
|
-
blocks: (
|
|
2666
|
-
context:
|
|
2640
|
+
blocks: (S = (m = a.content) == null ? void 0 : m.data) == null ? void 0 : S.blocks,
|
|
2641
|
+
context: a,
|
|
2667
2642
|
registeredComponents: o
|
|
2668
2643
|
}
|
|
2669
2644
|
)
|
|
@@ -2674,7 +2649,7 @@ function ContentComponent(e) {
|
|
|
2674
2649
|
);
|
|
2675
2650
|
}
|
|
2676
2651
|
function ContentVariants(e) {
|
|
2677
|
-
var
|
|
2652
|
+
var a, l;
|
|
2678
2653
|
const [t, n] = useState(
|
|
2679
2654
|
() => checkShouldRenderVariants({
|
|
2680
2655
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2682,23 +2657,23 @@ function ContentVariants(e) {
|
|
|
2682
2657
|
})
|
|
2683
2658
|
);
|
|
2684
2659
|
function i() {
|
|
2685
|
-
var
|
|
2660
|
+
var c;
|
|
2686
2661
|
return getUpdateCookieAndStylesScript(
|
|
2687
2662
|
getVariants(e.content).map((s) => ({
|
|
2688
2663
|
id: s.testVariationId,
|
|
2689
2664
|
testRatio: s.testRatio
|
|
2690
2665
|
})),
|
|
2691
|
-
((
|
|
2666
|
+
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2692
2667
|
);
|
|
2693
2668
|
}
|
|
2694
2669
|
function o() {
|
|
2695
|
-
return getVariants(e.content).map((
|
|
2670
|
+
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2696
2671
|
}
|
|
2697
|
-
function
|
|
2698
|
-
var
|
|
2672
|
+
function r() {
|
|
2673
|
+
var c;
|
|
2699
2674
|
return t ? {
|
|
2700
2675
|
...e.content,
|
|
2701
|
-
testVariationId: (
|
|
2676
|
+
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2702
2677
|
} : handleABTestingSync({
|
|
2703
2678
|
item: e.content,
|
|
2704
2679
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2711,15 +2686,15 @@ function ContentVariants(e) {
|
|
|
2711
2686
|
/* @__PURE__ */ jsx(
|
|
2712
2687
|
InlinedStyles,
|
|
2713
2688
|
{
|
|
2714
|
-
id: `variants-styles-${(
|
|
2689
|
+
id: `variants-styles-${(a = e.content) == null ? void 0 : a.id}`,
|
|
2715
2690
|
styles: o()
|
|
2716
2691
|
}
|
|
2717
2692
|
),
|
|
2718
2693
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2719
|
-
(
|
|
2694
|
+
(l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
|
|
2720
2695
|
ContentComponent,
|
|
2721
2696
|
{
|
|
2722
|
-
content:
|
|
2697
|
+
content: c,
|
|
2723
2698
|
showContent: !1,
|
|
2724
2699
|
model: e.model,
|
|
2725
2700
|
data: e.data,
|
|
@@ -2737,13 +2712,13 @@ function ContentVariants(e) {
|
|
|
2737
2712
|
contentWrapper: e.contentWrapper,
|
|
2738
2713
|
contentWrapperProps: e.contentWrapperProps
|
|
2739
2714
|
},
|
|
2740
|
-
|
|
2715
|
+
c.testVariationId
|
|
2741
2716
|
))
|
|
2742
2717
|
] }) : null,
|
|
2743
2718
|
/* @__PURE__ */ jsx(
|
|
2744
2719
|
ContentComponent,
|
|
2745
2720
|
{
|
|
2746
|
-
content:
|
|
2721
|
+
content: r(),
|
|
2747
2722
|
showContent: !0,
|
|
2748
2723
|
model: e.model,
|
|
2749
2724
|
data: e.data,
|
|
@@ -2784,26 +2759,26 @@ const fetchSymbolContent = async ({
|
|
|
2784
2759
|
});
|
|
2785
2760
|
};
|
|
2786
2761
|
function Symbol$1(e) {
|
|
2787
|
-
var
|
|
2762
|
+
var r, a, l;
|
|
2788
2763
|
function t() {
|
|
2789
|
-
var
|
|
2764
|
+
var c, s;
|
|
2790
2765
|
return [
|
|
2791
2766
|
e.attributes.className,
|
|
2792
2767
|
"builder-symbol",
|
|
2793
|
-
(
|
|
2768
|
+
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2794
2769
|
(s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2795
2770
|
].filter(Boolean).join(" ");
|
|
2796
2771
|
}
|
|
2797
2772
|
const [n, i] = useState(() => {
|
|
2798
|
-
var
|
|
2799
|
-
return (
|
|
2773
|
+
var c;
|
|
2774
|
+
return (c = e.symbol) == null ? void 0 : c.content;
|
|
2800
2775
|
});
|
|
2801
2776
|
function o() {
|
|
2802
2777
|
n || fetchSymbolContent({
|
|
2803
2778
|
symbol: e.symbol,
|
|
2804
2779
|
builderContextValue: e.builderContext
|
|
2805
|
-
}).then((
|
|
2806
|
-
|
|
2780
|
+
}).then((c) => {
|
|
2781
|
+
c && i(c);
|
|
2807
2782
|
});
|
|
2808
2783
|
}
|
|
2809
2784
|
return useEffect(() => {
|
|
@@ -2818,11 +2793,11 @@ function Symbol$1(e) {
|
|
|
2818
2793
|
context: e.builderContext.context,
|
|
2819
2794
|
customComponents: Object.values(e.builderComponents),
|
|
2820
2795
|
data: {
|
|
2821
|
-
...(
|
|
2796
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
2822
2797
|
...e.builderContext.localState,
|
|
2823
|
-
...(
|
|
2798
|
+
...(a = n == null ? void 0 : n.data) == null ? void 0 : a.state
|
|
2824
2799
|
},
|
|
2825
|
-
model: (
|
|
2800
|
+
model: (l = e.symbol) == null ? void 0 : l.model,
|
|
2826
2801
|
content: n
|
|
2827
2802
|
}
|
|
2828
2803
|
) });
|