@builder.io/sdk-react 0.11.3 → 0.11.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 +24 -24
- package/lib/browser/index.mjs +539 -520
- package/lib/edge/index.cjs +20 -20
- package/lib/edge/index.mjs +1036 -1017
- package/lib/node/index.cjs +12 -12
- package/lib/node/index.mjs +265 -246
- package/package.json +1 -1
- package/types/components/content/components/enable-editor.d.ts +1 -1
- package/types/components/content/content.helpers.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/node/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
|
|
4
4
|
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, 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-46908b1b.js";
|
|
5
|
-
import { _ as
|
|
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-46908b1b.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
function Button(e) {
|
|
8
8
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -79,14 +79,14 @@ const getFunctionArguments = ({
|
|
|
79
79
|
context: n,
|
|
80
80
|
event: i,
|
|
81
81
|
localState: o,
|
|
82
|
-
rootSetState:
|
|
83
|
-
rootState:
|
|
82
|
+
rootSetState: a,
|
|
83
|
+
rootState: r
|
|
84
84
|
}) => {
|
|
85
85
|
const l = getFunctionArguments({
|
|
86
86
|
builder: t,
|
|
87
87
|
context: n,
|
|
88
88
|
event: i,
|
|
89
|
-
state: flattenState(
|
|
89
|
+
state: flattenState(r, o, a)
|
|
90
90
|
});
|
|
91
91
|
return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
|
|
92
92
|
};
|
|
@@ -95,10 +95,10 @@ function flattenState(e, t, n) {
|
|
|
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, a) => {
|
|
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] = a, 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, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
|
|
110
110
|
}, noop = () => {
|
|
111
111
|
};
|
|
112
112
|
let safeDynamicRequire = noop;
|
|
@@ -172,11 +172,11 @@ output;
|
|
|
172
172
|
context: n,
|
|
173
173
|
event: i,
|
|
174
174
|
localState: o,
|
|
175
|
-
rootSetState:
|
|
176
|
-
rootState:
|
|
175
|
+
rootSetState: a,
|
|
176
|
+
rootState: r
|
|
177
177
|
}) => {
|
|
178
178
|
const l = fastClone({
|
|
179
|
-
...
|
|
179
|
+
...r,
|
|
180
180
|
...o
|
|
181
181
|
}), c = getFunctionArguments({
|
|
182
182
|
builder: t,
|
|
@@ -184,19 +184,19 @@ output;
|
|
|
184
184
|
event: i,
|
|
185
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
|
-
}), c.forEach(([
|
|
192
|
-
const
|
|
187
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
|
|
188
|
+
console.log(...f);
|
|
189
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(f, S) {
|
|
190
|
+
set(r, f, S), a == null || a(r);
|
|
191
|
+
}), c.forEach(([f, S]) => {
|
|
192
|
+
const y = typeof S == "object" ? new ivm.Reference(
|
|
193
193
|
// workaround: methods with default values for arguments is not being cloned over
|
|
194
|
-
|
|
194
|
+
f === "builder" ? {
|
|
195
195
|
...S,
|
|
196
196
|
getUserAttributes: () => S.getUserAttributes()
|
|
197
197
|
} : S
|
|
198
198
|
) : null;
|
|
199
|
-
d.setSync(getSyncValName(
|
|
199
|
+
d.setSync(getSyncValName(f), y);
|
|
200
200
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
201
201
|
const g = processCode({
|
|
202
202
|
code: e,
|
|
@@ -214,8 +214,8 @@ function evaluate({
|
|
|
214
214
|
localState: n,
|
|
215
215
|
rootState: i,
|
|
216
216
|
rootSetState: o,
|
|
217
|
-
event:
|
|
218
|
-
isExpression:
|
|
217
|
+
event: a,
|
|
218
|
+
isExpression: r = !0
|
|
219
219
|
}) {
|
|
220
220
|
if (e === "") {
|
|
221
221
|
logger.warn("Skipping evaluation of empty code block.");
|
|
@@ -223,11 +223,11 @@ function evaluate({
|
|
|
223
223
|
}
|
|
224
224
|
const l = {
|
|
225
225
|
code: parseCode(e, {
|
|
226
|
-
isExpression:
|
|
226
|
+
isExpression: r
|
|
227
227
|
}),
|
|
228
228
|
builder: getBuilderGlobals(),
|
|
229
229
|
context: t,
|
|
230
|
-
event:
|
|
230
|
+
event: a,
|
|
231
231
|
rootSetState: o,
|
|
232
232
|
rootState: i,
|
|
233
233
|
localState: n
|
|
@@ -253,13 +253,13 @@ const evaluateBindings = ({
|
|
|
253
253
|
}) => {
|
|
254
254
|
if (!e.bindings)
|
|
255
255
|
return e;
|
|
256
|
-
const
|
|
257
|
-
...
|
|
256
|
+
const a = fastClone(e), r = {
|
|
257
|
+
...a,
|
|
258
258
|
properties: {
|
|
259
|
-
...
|
|
259
|
+
...a.properties
|
|
260
260
|
},
|
|
261
261
|
actions: {
|
|
262
|
-
...
|
|
262
|
+
...a.actions
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
for (const l in e.bindings) {
|
|
@@ -270,9 +270,9 @@ const evaluateBindings = ({
|
|
|
270
270
|
rootSetState: o,
|
|
271
271
|
context: t
|
|
272
272
|
});
|
|
273
|
-
set(
|
|
273
|
+
set(r, l, s);
|
|
274
274
|
}
|
|
275
|
-
return
|
|
275
|
+
return r;
|
|
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: a
|
|
284
284
|
}) {
|
|
285
|
-
const
|
|
285
|
+
const r = e;
|
|
286
286
|
return n ? evaluateBindings({
|
|
287
|
-
block:
|
|
287
|
+
block: r,
|
|
288
288
|
localState: i,
|
|
289
289
|
rootState: o,
|
|
290
|
-
rootSetState:
|
|
290
|
+
rootSetState: a,
|
|
291
291
|
context: t
|
|
292
|
-
}) :
|
|
292
|
+
}) : r;
|
|
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 a;
|
|
300
|
+
const i = (a = 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 : a.name;
|
|
308
308
|
if (!i)
|
|
309
309
|
return null;
|
|
310
310
|
const o = n[i];
|
|
@@ -332,7 +332,7 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
332
332
|
});
|
|
333
333
|
if (!Array.isArray(o))
|
|
334
334
|
return;
|
|
335
|
-
const
|
|
335
|
+
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
336
336
|
return o.map((c, s) => ({
|
|
337
337
|
context: {
|
|
338
338
|
...t,
|
|
@@ -340,8 +340,8 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
340
340
|
...t.localState,
|
|
341
341
|
$index: s,
|
|
342
342
|
$item: c,
|
|
343
|
-
[
|
|
344
|
-
[`$${
|
|
343
|
+
[r]: c,
|
|
344
|
+
[`$${r}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 a = 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: a,
|
|
389
|
+
default: a + 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")
|
|
@@ -428,8 +428,8 @@ function BlockStyles(e) {
|
|
|
428
428
|
rootSetState: e.context.rootSetState,
|
|
429
429
|
context: e.context.context,
|
|
430
430
|
shouldEvaluateBindings: !0
|
|
431
|
-
}), o = i.responsiveStyles,
|
|
432
|
-
((S =
|
|
431
|
+
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
432
|
+
((S = a == null ? void 0 : a.meta) == null ? void 0 : S.breakpoints) || {}
|
|
433
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 "";
|
|
@@ -441,17 +441,17 @@ function BlockStyles(e) {
|
|
|
441
441
|
styles: c,
|
|
442
442
|
mediaQuery: getMaxWidthQueryForSize(
|
|
443
443
|
"medium",
|
|
444
|
-
|
|
444
|
+
r
|
|
445
445
|
)
|
|
446
|
-
}) : "",
|
|
446
|
+
}) : "", f = s ? createCssClass({
|
|
447
447
|
className: d,
|
|
448
448
|
styles: s,
|
|
449
449
|
mediaQuery: getMaxWidthQueryForSize(
|
|
450
450
|
"small",
|
|
451
|
-
|
|
451
|
+
r
|
|
452
452
|
)
|
|
453
453
|
}) : "";
|
|
454
|
-
return [g, x,
|
|
454
|
+
return [g, x, f].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 a = n[o];
|
|
477
|
+
let r = getEventHandlerName(o);
|
|
478
478
|
if (e.stripPrefix)
|
|
479
479
|
switch (TARGET) {
|
|
480
480
|
case "vue":
|
|
481
|
-
|
|
481
|
+
r = r.replace("v-on:", "");
|
|
482
482
|
break;
|
|
483
483
|
case "svelte":
|
|
484
|
-
|
|
484
|
+
r = r.replace("on:", "");
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
|
-
t[
|
|
487
|
+
t[r] = createEventHandler(a, e);
|
|
488
488
|
}
|
|
489
489
|
return t;
|
|
490
490
|
}
|
|
@@ -599,8 +599,8 @@ const getWrapperProps = ({
|
|
|
599
599
|
context: n,
|
|
600
600
|
componentRef: i,
|
|
601
601
|
includeBlockProps: o,
|
|
602
|
-
isInteractive:
|
|
603
|
-
contextValue:
|
|
602
|
+
isInteractive: a,
|
|
603
|
+
contextValue: r
|
|
604
604
|
}) => {
|
|
605
605
|
const l = {
|
|
606
606
|
...e,
|
|
@@ -611,11 +611,11 @@ const getWrapperProps = ({
|
|
|
611
611
|
...o ? {
|
|
612
612
|
attributes: getBlockProperties({
|
|
613
613
|
block: t,
|
|
614
|
-
context:
|
|
614
|
+
context: r
|
|
615
615
|
})
|
|
616
616
|
} : {}
|
|
617
617
|
};
|
|
618
|
-
return
|
|
618
|
+
return a ? {
|
|
619
619
|
Wrapper: i,
|
|
620
620
|
block: t,
|
|
621
621
|
context: n,
|
|
@@ -679,8 +679,8 @@ function Block(e) {
|
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
function i() {
|
|
682
|
-
var
|
|
683
|
-
return (
|
|
682
|
+
var f;
|
|
683
|
+
return (f = e.block.repeat) != null && f.collection ? e.block : getProcessedBlock({
|
|
684
684
|
block: e.block,
|
|
685
685
|
localState: e.context.localState,
|
|
686
686
|
rootState: e.context.rootState,
|
|
@@ -692,26 +692,26 @@ function Block(e) {
|
|
|
692
692
|
function o() {
|
|
693
693
|
return e.block.tagName || "div";
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
var
|
|
697
|
-
if ((
|
|
695
|
+
function a() {
|
|
696
|
+
var y, I;
|
|
697
|
+
if ((y = e.block.repeat) != null && y.collection)
|
|
698
698
|
return !!((I = n == null ? void 0 : n()) != null && I.length);
|
|
699
|
-
const
|
|
700
|
-
return ("show" in i() ? i().show : !0) && !
|
|
699
|
+
const f = "hide" in i() ? i().hide : !1;
|
|
700
|
+
return ("show" in i() ? i().show : !0) && !f;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
var S,
|
|
704
|
-
return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? (
|
|
702
|
+
function r() {
|
|
703
|
+
var S, y;
|
|
704
|
+
return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? (y = i().children) != null ? y : [] : [];
|
|
705
705
|
}
|
|
706
706
|
function l() {
|
|
707
|
-
var
|
|
707
|
+
var f, S, y, I, E, v;
|
|
708
708
|
return {
|
|
709
|
-
blockChildren: (
|
|
709
|
+
blockChildren: (f = i().children) != null ? f : [],
|
|
710
710
|
componentRef: (S = t == null ? void 0 : t()) == null ? void 0 : S.component,
|
|
711
711
|
componentOptions: {
|
|
712
712
|
...getBlockComponentOptions(i()),
|
|
713
713
|
builderContext: e.context,
|
|
714
|
-
...((
|
|
714
|
+
...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Columns" ? {
|
|
715
715
|
builderComponents: e.registeredComponents
|
|
716
716
|
} : {}
|
|
717
717
|
},
|
|
@@ -723,7 +723,7 @@ function Block(e) {
|
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
725
|
const [c, s] = useState(() => e.context);
|
|
726
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
726
|
+
return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
727
727
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
728
728
|
(d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
729
729
|
ComponentRef,
|
|
@@ -747,11 +747,11 @@ function Block(e) {
|
|
|
747
747
|
hasChildren: !1
|
|
748
748
|
}
|
|
749
749
|
) }) : null,
|
|
750
|
-
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((
|
|
750
|
+
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((f, S) => /* @__PURE__ */ jsx(
|
|
751
751
|
RepeatedBlock,
|
|
752
752
|
{
|
|
753
|
-
repeatContext:
|
|
754
|
-
block:
|
|
753
|
+
repeatContext: f.context,
|
|
754
|
+
block: f.block,
|
|
755
755
|
registeredComponents: e.registeredComponents
|
|
756
756
|
},
|
|
757
757
|
S
|
|
@@ -777,14 +777,14 @@ function Block(e) {
|
|
|
777
777
|
isInteractive: l().isInteractive
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
|
-
(x =
|
|
780
|
+
(x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ jsx(
|
|
781
781
|
Block,
|
|
782
782
|
{
|
|
783
|
-
block:
|
|
783
|
+
block: f,
|
|
784
784
|
context: c,
|
|
785
785
|
registeredComponents: e.registeredComponents
|
|
786
786
|
},
|
|
787
|
-
|
|
787
|
+
f.id
|
|
788
788
|
))
|
|
789
789
|
]
|
|
790
790
|
}
|
|
@@ -798,8 +798,8 @@ function BlocksWrapper(e) {
|
|
|
798
798
|
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
799
799
|
}
|
|
800
800
|
function n() {
|
|
801
|
-
var o,
|
|
802
|
-
isEditing() && !((o = e.blocks) != null && o.length) && ((
|
|
801
|
+
var o, a;
|
|
802
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
803
803
|
{
|
|
804
804
|
type: "builder.clickEmptyBlocks",
|
|
805
805
|
data: {
|
|
@@ -811,8 +811,8 @@ function BlocksWrapper(e) {
|
|
|
811
811
|
));
|
|
812
812
|
}
|
|
813
813
|
function i() {
|
|
814
|
-
var o,
|
|
815
|
-
isEditing() && !((o = e.blocks) != null && o.length) && ((
|
|
814
|
+
var o, a;
|
|
815
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
816
816
|
{
|
|
817
817
|
type: "builder.hoverEmptyBlocks",
|
|
818
818
|
data: {
|
|
@@ -846,7 +846,7 @@ function BlocksWrapper(e) {
|
|
|
846
846
|
] });
|
|
847
847
|
}
|
|
848
848
|
function Blocks(e) {
|
|
849
|
-
var i, o,
|
|
849
|
+
var i, o, a;
|
|
850
850
|
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
851
851
|
return /* @__PURE__ */ jsx(
|
|
852
852
|
BlocksWrapper,
|
|
@@ -857,14 +857,14 @@ function Blocks(e) {
|
|
|
857
857
|
styleProp: e.styleProp,
|
|
858
858
|
BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
|
|
859
859
|
BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
|
|
860
|
-
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
860
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
|
|
861
861
|
Block,
|
|
862
862
|
{
|
|
863
|
-
block:
|
|
863
|
+
block: r,
|
|
864
864
|
context: e.context || t,
|
|
865
865
|
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
866
866
|
},
|
|
867
|
-
|
|
867
|
+
r.id
|
|
868
868
|
)) }) : null
|
|
869
869
|
}
|
|
870
870
|
);
|
|
@@ -873,7 +873,7 @@ function Columns(e) {
|
|
|
873
873
|
var E;
|
|
874
874
|
const [t, n] = useState(
|
|
875
875
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
876
|
-
), [i, o] = useState(() => e.columns || []), [
|
|
876
|
+
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
877
877
|
() => e.stackColumnsAt || "tablet"
|
|
878
878
|
);
|
|
879
879
|
function l(v) {
|
|
@@ -888,18 +888,18 @@ function Columns(e) {
|
|
|
888
888
|
stackedStyle: v,
|
|
889
889
|
desktopStyle: C
|
|
890
890
|
}) {
|
|
891
|
-
return
|
|
891
|
+
return a === "tablet" ? v : C;
|
|
892
892
|
}
|
|
893
893
|
function d({
|
|
894
894
|
stackedStyle: v,
|
|
895
895
|
desktopStyle: C
|
|
896
896
|
}) {
|
|
897
|
-
return
|
|
897
|
+
return a === "never" ? C : v;
|
|
898
898
|
}
|
|
899
899
|
const [g, x] = useState(
|
|
900
900
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
901
901
|
);
|
|
902
|
-
function
|
|
902
|
+
function f() {
|
|
903
903
|
return {
|
|
904
904
|
"--flex-dir": g,
|
|
905
905
|
"--flex-dir-tablet": s({
|
|
@@ -931,7 +931,7 @@ function Columns(e) {
|
|
|
931
931
|
})
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function y(v) {
|
|
935
935
|
var T, w;
|
|
936
936
|
return getSizesForBreakpoints(
|
|
937
937
|
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
@@ -939,7 +939,7 @@ function Columns(e) {
|
|
|
939
939
|
}
|
|
940
940
|
function I() {
|
|
941
941
|
return `
|
|
942
|
-
@media (max-width: ${
|
|
942
|
+
@media (max-width: ${y("medium")}px) {
|
|
943
943
|
.${e.builderBlock.id}-breakpoints {
|
|
944
944
|
flex-direction: var(--flex-dir-tablet);
|
|
945
945
|
align-items: stretch;
|
|
@@ -951,7 +951,7 @@ function Columns(e) {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
@media (max-width: ${
|
|
954
|
+
@media (max-width: ${y("small")}px) {
|
|
955
955
|
.${e.builderBlock.id}-breakpoints {
|
|
956
956
|
flex-direction: var(--flex-dir);
|
|
957
957
|
align-items: stretch;
|
|
@@ -969,7 +969,7 @@ function Columns(e) {
|
|
|
969
969
|
"div",
|
|
970
970
|
{
|
|
971
971
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-3c01d6ec`,
|
|
972
|
-
style:
|
|
972
|
+
style: f(),
|
|
973
973
|
children: [
|
|
974
974
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
|
|
975
975
|
(E = e.columns) == null ? void 0 : E.map((v, C) => /* @__PURE__ */ createElement(
|
|
@@ -1023,8 +1023,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
1023
1023
|
return removeProtocol(e);
|
|
1024
1024
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1025
1025
|
if (n) {
|
|
1026
|
-
const i = e.split(n[0]), o = n[3],
|
|
1027
|
-
return removeProtocol(`${i[0]}_${
|
|
1026
|
+
const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
|
|
1027
|
+
return removeProtocol(`${i[0]}_${a}${o}`);
|
|
1028
1028
|
}
|
|
1029
1029
|
return null;
|
|
1030
1030
|
}
|
|
@@ -1040,7 +1040,7 @@ function getSrcSet(e) {
|
|
|
1040
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;
|
|
1041
1041
|
}
|
|
1042
1042
|
function Image(e) {
|
|
1043
|
-
var o,
|
|
1043
|
+
var o, a, r, l;
|
|
1044
1044
|
function t() {
|
|
1045
1045
|
var d;
|
|
1046
1046
|
const s = e.image || e.src;
|
|
@@ -1091,7 +1091,7 @@ function Image(e) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
)
|
|
1093
1093
|
] }),
|
|
1094
|
-
e.aspectRatio && !((
|
|
1094
|
+
e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1095
1095
|
"div",
|
|
1096
1096
|
{
|
|
1097
1097
|
className: "builder-image-sizer div-40c70c9b",
|
|
@@ -1100,7 +1100,7 @@ function Image(e) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
) }) : null,
|
|
1103
|
-
(l = (
|
|
1103
|
+
(l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1104
1104
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
1105
1105
|
] }),
|
|
1106
1106
|
/* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
|
|
@@ -1355,7 +1355,7 @@ const componentInfo$a = {
|
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
const n = e.get("columns");
|
|
1358
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((
|
|
1358
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, c) => l + c.get("width"), 0) !== 100) && t();
|
|
1359
1359
|
}
|
|
1360
1360
|
}, {
|
|
1361
1361
|
name: "space",
|
|
@@ -1401,14 +1401,14 @@ const componentInfo$a = {
|
|
|
1401
1401
|
}]
|
|
1402
1402
|
};
|
|
1403
1403
|
function CustomCode(e) {
|
|
1404
|
-
const t = useRef(null), [n, i] = useState(() => []), [o,
|
|
1404
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1405
1405
|
return useEffect(() => {
|
|
1406
1406
|
var l;
|
|
1407
1407
|
if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
|
|
1408
1408
|
return;
|
|
1409
|
-
const
|
|
1410
|
-
for (let c = 0; c <
|
|
1411
|
-
const s =
|
|
1409
|
+
const r = t.current.getElementsByTagName("script");
|
|
1410
|
+
for (let c = 0; c < r.length; c++) {
|
|
1411
|
+
const s = r[c];
|
|
1412
1412
|
if (s.src) {
|
|
1413
1413
|
if (n.includes(s.src))
|
|
1414
1414
|
continue;
|
|
@@ -1465,7 +1465,7 @@ const componentInfo$7 = {
|
|
|
1465
1465
|
}]
|
|
1466
1466
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1467
1467
|
function Embed(e) {
|
|
1468
|
-
const t = useRef(null), [n, i] = useState(() => []), [o,
|
|
1468
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
|
|
1469
1469
|
function c() {
|
|
1470
1470
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1471
1471
|
return;
|
|
@@ -1485,8 +1485,8 @@ function Embed(e) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
return useEffect(() => {
|
|
1488
|
-
t.current && !
|
|
1489
|
-
}, [t.current,
|
|
1488
|
+
t.current && !r && (l(!0), c());
|
|
1489
|
+
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1490
1490
|
"div",
|
|
1491
1491
|
{
|
|
1492
1492
|
className: "builder-embed",
|
|
@@ -1521,7 +1521,7 @@ const componentInfo$6 = {
|
|
|
1521
1521
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1522
1522
|
onChange: (e) => {
|
|
1523
1523
|
e.delete("srcset"), e.delete("noWebp");
|
|
1524
|
-
function n(
|
|
1524
|
+
function n(r, l = 6e4) {
|
|
1525
1525
|
return new Promise((c, s) => {
|
|
1526
1526
|
const d = document.createElement("img");
|
|
1527
1527
|
let g = !1;
|
|
@@ -1529,21 +1529,21 @@ const componentInfo$6 = {
|
|
|
1529
1529
|
g = !0, c(d);
|
|
1530
1530
|
}, d.addEventListener("error", (x) => {
|
|
1531
1531
|
console.warn("Image load failed", x.error), s(x.error);
|
|
1532
|
-
}), d.src =
|
|
1532
|
+
}), d.src = r, setTimeout(() => {
|
|
1533
1533
|
g || s(new Error("Image load timed out"));
|
|
1534
1534
|
}, l);
|
|
1535
1535
|
});
|
|
1536
1536
|
}
|
|
1537
|
-
function i(
|
|
1538
|
-
return Math.round(
|
|
1537
|
+
function i(r) {
|
|
1538
|
+
return Math.round(r * 1e3) / 1e3;
|
|
1539
1539
|
}
|
|
1540
|
-
const o = e.get("image"),
|
|
1541
|
-
if (fetch(o).then((
|
|
1542
|
-
|
|
1543
|
-
}), o && (!
|
|
1544
|
-
return n(o).then((
|
|
1540
|
+
const o = e.get("image"), a = e.get("aspectRatio");
|
|
1541
|
+
if (fetch(o).then((r) => r.blob()).then((r) => {
|
|
1542
|
+
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1543
|
+
}), o && (!a || a === 0.7041))
|
|
1544
|
+
return n(o).then((r) => {
|
|
1545
1545
|
const l = e.get("aspectRatio");
|
|
1546
|
-
e.get("image") === o && (!l || l === 0.7041) &&
|
|
1546
|
+
e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
}, {
|
|
@@ -1818,7 +1818,7 @@ const componentInfo = {
|
|
|
1818
1818
|
}]
|
|
1819
1819
|
};
|
|
1820
1820
|
function Video(e) {
|
|
1821
|
-
var i, o,
|
|
1821
|
+
var i, o, a, r, l, c, s;
|
|
1822
1822
|
function t() {
|
|
1823
1823
|
return {
|
|
1824
1824
|
...e.autoPlay === !0 ? {
|
|
@@ -1875,7 +1875,7 @@ function Video(e) {
|
|
|
1875
1875
|
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
1876
1876
|
}
|
|
1877
1877
|
),
|
|
1878
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
1878
|
+
e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1879
1879
|
"div",
|
|
1880
1880
|
{
|
|
1881
1881
|
style: {
|
|
@@ -1886,7 +1886,7 @@ function Video(e) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
1888
|
) }) : null,
|
|
1889
|
-
(l = (
|
|
1889
|
+
(l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1890
1890
|
"div",
|
|
1891
1891
|
{
|
|
1892
1892
|
style: {
|
|
@@ -2090,10 +2090,10 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2090
2090
|
event: e,
|
|
2091
2091
|
target: t
|
|
2092
2092
|
}) => {
|
|
2093
|
-
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, a = round(i / n.width), r = round(o / n.height);
|
|
2094
2094
|
return {
|
|
2095
|
-
x:
|
|
2096
|
-
y:
|
|
2095
|
+
x: a,
|
|
2096
|
+
y: r
|
|
2097
2097
|
};
|
|
2098
2098
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
2099
2099
|
const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
@@ -2111,7 +2111,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2111
2111
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
|
-
}, SDK_VERSION = "0.11.
|
|
2114
|
+
}, SDK_VERSION = "0.11.4", registerInsertMenu = () => {
|
|
2115
2115
|
register("insertMenu", {
|
|
2116
2116
|
name: "_default",
|
|
2117
2117
|
default: !0,
|
|
@@ -2156,11 +2156,11 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2156
2156
|
}, "*"), window.addEventListener("message", ({
|
|
2157
2157
|
data: i
|
|
2158
2158
|
}) => {
|
|
2159
|
-
var o,
|
|
2159
|
+
var o, a;
|
|
2160
2160
|
if (i != null && i.type)
|
|
2161
2161
|
switch (i.type) {
|
|
2162
2162
|
case "builder.evaluate": {
|
|
2163
|
-
const
|
|
2163
|
+
const r = i.data.text, l = i.data.arguments || [], c = i.data.id, s = new Function(r);
|
|
2164
2164
|
let d, g = null;
|
|
2165
2165
|
try {
|
|
2166
2166
|
d = s.apply(null, l);
|
|
@@ -2174,15 +2174,15 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2174
2174
|
error: g.message
|
|
2175
2175
|
}
|
|
2176
2176
|
}, "*") : d && typeof d.then == "function" ? d.then((x) => {
|
|
2177
|
-
var
|
|
2178
|
-
(
|
|
2177
|
+
var f;
|
|
2178
|
+
(f = window.parent) == null || f.postMessage({
|
|
2179
2179
|
type: "builder.evaluateResult",
|
|
2180
2180
|
data: {
|
|
2181
2181
|
id: c,
|
|
2182
2182
|
result: x
|
|
2183
2183
|
}
|
|
2184
2184
|
}, "*");
|
|
2185
|
-
}).catch(console.error) : (
|
|
2185
|
+
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2186
2186
|
type: "builder.evaluateResult",
|
|
2187
2187
|
data: {
|
|
2188
2188
|
result: d,
|
|
@@ -2195,11 +2195,23 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2195
2195
|
})));
|
|
2196
2196
|
};
|
|
2197
2197
|
function EnableEditor(e) {
|
|
2198
|
-
var
|
|
2198
|
+
var j, P, A, F, _, V, W;
|
|
2199
2199
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2200
|
+
useState(() => !0);
|
|
2200
2201
|
function o(u) {
|
|
2201
|
-
var h, b
|
|
2202
|
-
const
|
|
2202
|
+
var h, b;
|
|
2203
|
+
const m = {
|
|
2204
|
+
...e.builderContextSignal.rootState,
|
|
2205
|
+
...u
|
|
2206
|
+
};
|
|
2207
|
+
e.builderContextSignal.rootSetState ? (b = (h = e.builderContextSignal).rootSetState) == null || b.call(h, m) : e.setBuilderContextSignal((p) => ({
|
|
2208
|
+
...p,
|
|
2209
|
+
rootState: m
|
|
2210
|
+
}));
|
|
2211
|
+
}
|
|
2212
|
+
function a(u) {
|
|
2213
|
+
var h, b, p, k, B;
|
|
2214
|
+
const m = {
|
|
2203
2215
|
...e.builderContextSignal.content,
|
|
2204
2216
|
...u,
|
|
2205
2217
|
data: {
|
|
@@ -2209,46 +2221,46 @@ function EnableEditor(e) {
|
|
|
2209
2221
|
meta: {
|
|
2210
2222
|
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2211
2223
|
...u == null ? void 0 : u.meta,
|
|
2212
|
-
breakpoints: ((
|
|
2224
|
+
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)
|
|
2213
2225
|
}
|
|
2214
2226
|
};
|
|
2215
|
-
e.setBuilderContextSignal((
|
|
2216
|
-
|
|
2217
|
-
content:
|
|
2227
|
+
e.setBuilderContextSignal(($) => ({
|
|
2228
|
+
...$,
|
|
2229
|
+
content: m
|
|
2218
2230
|
}));
|
|
2219
2231
|
}
|
|
2220
2232
|
useState(() => 0);
|
|
2221
|
-
const [r,
|
|
2233
|
+
const [r, l] = useState(
|
|
2222
2234
|
() => !1
|
|
2223
|
-
), [
|
|
2235
|
+
), [c, s] = useState(
|
|
2224
2236
|
() => e.contentWrapper || "div"
|
|
2225
2237
|
);
|
|
2226
|
-
function
|
|
2238
|
+
function d(u) {
|
|
2227
2239
|
var h;
|
|
2228
|
-
const { data:
|
|
2229
|
-
if (
|
|
2230
|
-
switch (
|
|
2240
|
+
const { data: m } = u;
|
|
2241
|
+
if (m)
|
|
2242
|
+
switch (m.type) {
|
|
2231
2243
|
case "builder.configureSdk": {
|
|
2232
|
-
const b =
|
|
2244
|
+
const b = m.data, { breakpoints: p, contentId: k } = b;
|
|
2233
2245
|
if (!k || k !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
|
|
2234
2246
|
return;
|
|
2235
|
-
|
|
2247
|
+
p && a({
|
|
2236
2248
|
meta: {
|
|
2237
|
-
breakpoints:
|
|
2249
|
+
breakpoints: p
|
|
2238
2250
|
}
|
|
2239
2251
|
}), i(n + 1);
|
|
2240
2252
|
break;
|
|
2241
2253
|
}
|
|
2242
2254
|
case "builder.contentUpdate": {
|
|
2243
|
-
const b =
|
|
2244
|
-
|
|
2255
|
+
const b = m.data, p = b.key || b.alias || b.entry || b.modelName, k = b.data;
|
|
2256
|
+
p === e.model && (a(k), i(n + 1));
|
|
2245
2257
|
break;
|
|
2246
2258
|
}
|
|
2247
2259
|
}
|
|
2248
2260
|
}
|
|
2249
|
-
function
|
|
2250
|
-
var
|
|
2251
|
-
const u = (h = (
|
|
2261
|
+
function g() {
|
|
2262
|
+
var m, h;
|
|
2263
|
+
const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
|
|
2252
2264
|
u && evaluate({
|
|
2253
2265
|
code: u,
|
|
2254
2266
|
context: e.context || {},
|
|
@@ -2257,27 +2269,27 @@ function EnableEditor(e) {
|
|
|
2257
2269
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2258
2270
|
});
|
|
2259
2271
|
}
|
|
2260
|
-
const [
|
|
2261
|
-
function
|
|
2262
|
-
var
|
|
2272
|
+
const [x, f] = useState(() => ({})), [S, y] = useState(() => !1);
|
|
2273
|
+
function I(u) {
|
|
2274
|
+
var m, h;
|
|
2263
2275
|
if (e.builderContextSignal.content) {
|
|
2264
|
-
const b = (
|
|
2276
|
+
const b = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2265
2277
|
_track({
|
|
2266
2278
|
type: "click",
|
|
2267
2279
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2268
|
-
contentId:
|
|
2280
|
+
contentId: p,
|
|
2269
2281
|
apiKey: e.apiKey,
|
|
2270
|
-
variationId: b !==
|
|
2282
|
+
variationId: b !== p ? b : void 0,
|
|
2271
2283
|
...getInteractionPropertiesForEvent(u),
|
|
2272
|
-
unique: !
|
|
2284
|
+
unique: !S
|
|
2273
2285
|
});
|
|
2274
2286
|
}
|
|
2275
|
-
|
|
2287
|
+
S || y(!0);
|
|
2276
2288
|
}
|
|
2277
|
-
function
|
|
2289
|
+
function E(u) {
|
|
2278
2290
|
return u.replace(
|
|
2279
2291
|
/{{([^}]+)}}/g,
|
|
2280
|
-
(
|
|
2292
|
+
(m, h) => evaluate({
|
|
2281
2293
|
code: h,
|
|
2282
2294
|
context: e.context || {},
|
|
2283
2295
|
localState: void 0,
|
|
@@ -2286,32 +2298,32 @@ function EnableEditor(e) {
|
|
|
2286
2298
|
})
|
|
2287
2299
|
);
|
|
2288
2300
|
}
|
|
2289
|
-
function
|
|
2301
|
+
function v({ url: u, key: m }) {
|
|
2290
2302
|
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2291
|
-
var
|
|
2303
|
+
var p, k;
|
|
2292
2304
|
const b = {
|
|
2293
2305
|
...e.builderContextSignal.rootState,
|
|
2294
|
-
[
|
|
2306
|
+
[m]: h
|
|
2295
2307
|
};
|
|
2296
|
-
(k = (
|
|
2308
|
+
(k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, b), x[m] = !0;
|
|
2297
2309
|
}).catch((h) => {
|
|
2298
2310
|
console.error("error fetching dynamic data", u, h);
|
|
2299
2311
|
});
|
|
2300
2312
|
}
|
|
2301
|
-
function
|
|
2302
|
-
var
|
|
2303
|
-
const u = (b = (h = (
|
|
2304
|
-
Object.entries(u).forEach(([
|
|
2305
|
-
if (k && (!
|
|
2306
|
-
const B =
|
|
2307
|
-
|
|
2313
|
+
function C() {
|
|
2314
|
+
var m, h, b;
|
|
2315
|
+
const u = (b = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? b : {};
|
|
2316
|
+
Object.entries(u).forEach(([p, k]) => {
|
|
2317
|
+
if (k && (!x[p] || isEditing())) {
|
|
2318
|
+
const B = E(k);
|
|
2319
|
+
v({
|
|
2308
2320
|
url: B,
|
|
2309
|
-
key:
|
|
2321
|
+
key: p
|
|
2310
2322
|
});
|
|
2311
2323
|
}
|
|
2312
2324
|
});
|
|
2313
2325
|
}
|
|
2314
|
-
function
|
|
2326
|
+
function T() {
|
|
2315
2327
|
isEditing() && window.dispatchEvent(
|
|
2316
2328
|
new CustomEvent(
|
|
2317
2329
|
"builder:component:stateChange",
|
|
@@ -2326,8 +2338,8 @@ function EnableEditor(e) {
|
|
|
2326
2338
|
)
|
|
2327
2339
|
);
|
|
2328
2340
|
}
|
|
2329
|
-
function
|
|
2330
|
-
i(n + 1), window.addEventListener("message",
|
|
2341
|
+
function w(u) {
|
|
2342
|
+
i(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
|
|
2331
2343
|
...e.locale ? {
|
|
2332
2344
|
locale: e.locale
|
|
2333
2345
|
} : {},
|
|
@@ -2339,62 +2351,62 @@ function EnableEditor(e) {
|
|
|
2339
2351
|
} : {}
|
|
2340
2352
|
}), Object.values(
|
|
2341
2353
|
e.builderContextSignal.componentInfos
|
|
2342
|
-
).forEach((
|
|
2354
|
+
).forEach((m) => {
|
|
2343
2355
|
var b;
|
|
2344
|
-
const h = createRegisterComponentMessage(
|
|
2356
|
+
const h = createRegisterComponentMessage(m);
|
|
2345
2357
|
(b = window.parent) == null || b.postMessage(h, "*");
|
|
2346
2358
|
}), window.addEventListener(
|
|
2347
2359
|
"builder:component:stateChangeListenerActivated",
|
|
2348
|
-
|
|
2360
|
+
T
|
|
2349
2361
|
);
|
|
2350
2362
|
}
|
|
2351
|
-
function
|
|
2352
|
-
const
|
|
2363
|
+
function R(u) {
|
|
2364
|
+
const m = new URL(location.href).searchParams, h = m.get("builder.preview"), b = m.get(
|
|
2353
2365
|
`builder.preview.${h}`
|
|
2354
|
-
),
|
|
2355
|
-
h === e.model &&
|
|
2366
|
+
), p = m.get("apiKey") || m.get("builder.space");
|
|
2367
|
+
h === e.model && p === e.apiKey && (!e.content || b === e.content.id) && fetchOneEntry({
|
|
2356
2368
|
model: e.model,
|
|
2357
2369
|
apiKey: e.apiKey,
|
|
2358
2370
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2359
2371
|
}).then((k) => {
|
|
2360
|
-
k &&
|
|
2372
|
+
k && a(k);
|
|
2361
2373
|
});
|
|
2362
2374
|
}
|
|
2363
2375
|
return useEffect(() => {
|
|
2364
2376
|
var u;
|
|
2365
2377
|
return (u = t.current) == null || u.addEventListener(
|
|
2366
2378
|
"initeditingbldr",
|
|
2367
|
-
|
|
2379
|
+
w
|
|
2368
2380
|
), () => {
|
|
2369
|
-
var
|
|
2370
|
-
return (
|
|
2381
|
+
var m;
|
|
2382
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2371
2383
|
"initeditingbldr",
|
|
2372
|
-
|
|
2384
|
+
w
|
|
2373
2385
|
);
|
|
2374
2386
|
};
|
|
2375
2387
|
}, []), useEffect(() => {
|
|
2376
2388
|
var u;
|
|
2377
2389
|
return (u = t.current) == null || u.addEventListener(
|
|
2378
2390
|
"initpreviewingbldr",
|
|
2379
|
-
|
|
2391
|
+
R
|
|
2380
2392
|
), () => {
|
|
2381
|
-
var
|
|
2382
|
-
return (
|
|
2393
|
+
var m;
|
|
2394
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2383
2395
|
"initpreviewingbldr",
|
|
2384
|
-
|
|
2396
|
+
R
|
|
2385
2397
|
);
|
|
2386
2398
|
};
|
|
2387
2399
|
}, []), useEffect(() => {
|
|
2388
|
-
var u,
|
|
2400
|
+
var u, m;
|
|
2389
2401
|
if (isBrowser()) {
|
|
2390
2402
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2391
|
-
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId,
|
|
2403
|
+
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
|
|
2392
2404
|
_track({
|
|
2393
2405
|
type: "impression",
|
|
2394
2406
|
canTrack: !0,
|
|
2395
|
-
contentId:
|
|
2407
|
+
contentId: p,
|
|
2396
2408
|
apiKey: k,
|
|
2397
|
-
variationId: b !==
|
|
2409
|
+
variationId: b !== p ? b : void 0
|
|
2398
2410
|
});
|
|
2399
2411
|
}
|
|
2400
2412
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2402,45 +2414,51 @@ function EnableEditor(e) {
|
|
|
2402
2414
|
}, []), useEffect(() => {
|
|
2403
2415
|
e.apiKey || logger.error(
|
|
2404
2416
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2405
|
-
),
|
|
2417
|
+
), g(), C(), T();
|
|
2406
2418
|
}, []), useEffect(() => {
|
|
2407
|
-
e.content &&
|
|
2419
|
+
e.content && a(e.content);
|
|
2408
2420
|
}, [e.content]), useEffect(() => {
|
|
2409
2421
|
}, [r]), useEffect(() => {
|
|
2410
|
-
|
|
2422
|
+
g();
|
|
2411
2423
|
}, [
|
|
2412
|
-
(
|
|
2424
|
+
(P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode,
|
|
2413
2425
|
e.builderContextSignal.rootState
|
|
2414
2426
|
]), useEffect(() => {
|
|
2415
|
-
v();
|
|
2416
|
-
}, [(A = (P = e.builderContextSignal.content) == null ? void 0 : P.data) == null ? void 0 : A.httpRequests]), useEffect(() => {
|
|
2417
2427
|
C();
|
|
2418
|
-
}, [e.builderContextSignal.
|
|
2419
|
-
|
|
2428
|
+
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
|
|
2429
|
+
T();
|
|
2430
|
+
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
2431
|
+
e.data && o(e.data);
|
|
2432
|
+
}, [e.data]), useEffect(() => {
|
|
2433
|
+
e.locale && o({
|
|
2434
|
+
locale: e.locale
|
|
2435
|
+
});
|
|
2436
|
+
}, [e.locale]), useEffect(() => () => {
|
|
2437
|
+
isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
|
|
2420
2438
|
"builder:component:stateChangeListenerActivated",
|
|
2421
|
-
|
|
2439
|
+
T
|
|
2422
2440
|
));
|
|
2423
2441
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2424
|
-
|
|
2442
|
+
c,
|
|
2425
2443
|
{
|
|
2426
2444
|
key: n,
|
|
2427
2445
|
ref: t,
|
|
2428
|
-
onClick: (u) =>
|
|
2429
|
-
"builder-content-id": (
|
|
2446
|
+
onClick: (u) => I(u),
|
|
2447
|
+
"builder-content-id": (_ = e.builderContextSignal.content) == null ? void 0 : _.id,
|
|
2430
2448
|
"builder-model": e.model,
|
|
2431
2449
|
...e.showContent ? {} : {
|
|
2432
2450
|
hidden: !0,
|
|
2433
2451
|
"aria-hidden": !0
|
|
2434
2452
|
},
|
|
2435
2453
|
...e.contentWrapperProps,
|
|
2436
|
-
className: `variant-${((
|
|
2454
|
+
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((W = e.content) == null ? void 0 : W.id)}`
|
|
2437
2455
|
},
|
|
2438
2456
|
e.children
|
|
2439
2457
|
) }) : null });
|
|
2440
2458
|
}
|
|
2441
2459
|
const getCssFromFont = (e) => {
|
|
2442
|
-
var
|
|
2443
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (
|
|
2460
|
+
var a, r;
|
|
2461
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
|
|
2444
2462
|
let o = "";
|
|
2445
2463
|
if (i && t && n && (o += `
|
|
2446
2464
|
@font-face {
|
|
@@ -2500,14 +2518,14 @@ ${getFontCss({
|
|
|
2500
2518
|
);
|
|
2501
2519
|
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
2502
2520
|
}
|
|
2503
|
-
const
|
|
2521
|
+
const getRootStateInitialValue = ({
|
|
2504
2522
|
content: e,
|
|
2505
2523
|
data: t,
|
|
2506
2524
|
locale: n
|
|
2507
2525
|
}) => {
|
|
2508
|
-
var
|
|
2509
|
-
const i = {}, o = ((
|
|
2510
|
-
return (l = (
|
|
2526
|
+
var a, r, l;
|
|
2527
|
+
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
2528
|
+
return (l = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || l.forEach((c) => {
|
|
2511
2529
|
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
2512
2530
|
}), {
|
|
2513
2531
|
...i,
|
|
@@ -2529,25 +2547,25 @@ const getContextStateInitialValue = ({
|
|
|
2529
2547
|
meta: e == null ? void 0 : e.meta
|
|
2530
2548
|
} : void 0;
|
|
2531
2549
|
function ContentComponent(e) {
|
|
2532
|
-
var c, s, d, g, x,
|
|
2550
|
+
var c, s, d, g, x, f, S;
|
|
2533
2551
|
const [t, n] = useState(
|
|
2534
2552
|
() => {
|
|
2535
|
-
var
|
|
2553
|
+
var y, I;
|
|
2536
2554
|
return getUpdateVariantVisibilityScript({
|
|
2537
2555
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2538
|
-
variationId: (
|
|
2556
|
+
variationId: (y = e.content) == null ? void 0 : y.testVariationId,
|
|
2539
2557
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2540
2558
|
contentId: (I = e.content) == null ? void 0 : I.id
|
|
2541
2559
|
});
|
|
2542
2560
|
}
|
|
2543
2561
|
);
|
|
2544
|
-
function i(
|
|
2562
|
+
function i(y) {
|
|
2545
2563
|
l((I) => ({
|
|
2546
2564
|
...I,
|
|
2547
|
-
rootState:
|
|
2565
|
+
rootState: y
|
|
2548
2566
|
}));
|
|
2549
2567
|
}
|
|
2550
|
-
const [o,
|
|
2568
|
+
const [o, a] = useState(
|
|
2551
2569
|
() => [
|
|
2552
2570
|
...getDefaultRegisteredComponents(),
|
|
2553
2571
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2558,8 +2576,8 @@ function ContentComponent(e) {
|
|
|
2558
2576
|
...components,
|
|
2559
2577
|
...e.customComponents || []
|
|
2560
2578
|
].reduce(
|
|
2561
|
-
(
|
|
2562
|
-
...
|
|
2579
|
+
(y, { component: I, ...E }) => ({
|
|
2580
|
+
...y,
|
|
2563
2581
|
[E.name]: {
|
|
2564
2582
|
component: I,
|
|
2565
2583
|
...serializeComponentInfo(E)
|
|
@@ -2567,13 +2585,13 @@ function ContentComponent(e) {
|
|
|
2567
2585
|
}),
|
|
2568
2586
|
{}
|
|
2569
2587
|
)
|
|
2570
|
-
), [
|
|
2588
|
+
), [r, l] = useState(() => ({
|
|
2571
2589
|
content: getContentInitialValue({
|
|
2572
2590
|
content: e.content,
|
|
2573
2591
|
data: e.data
|
|
2574
2592
|
}),
|
|
2575
2593
|
localState: void 0,
|
|
2576
|
-
rootState:
|
|
2594
|
+
rootState: getRootStateInitialValue({
|
|
2577
2595
|
content: e.content,
|
|
2578
2596
|
data: e.data,
|
|
2579
2597
|
locale: e.locale
|
|
@@ -2592,8 +2610,8 @@ function ContentComponent(e) {
|
|
|
2592
2610
|
...components,
|
|
2593
2611
|
...e.customComponents || []
|
|
2594
2612
|
].reduce(
|
|
2595
|
-
(
|
|
2596
|
-
...
|
|
2613
|
+
(y, { component: I, ...E }) => ({
|
|
2614
|
+
...y,
|
|
2597
2615
|
[E.name]: serializeComponentInfo(E)
|
|
2598
2616
|
}),
|
|
2599
2617
|
{}
|
|
@@ -2612,6 +2630,7 @@ function ContentComponent(e) {
|
|
|
2612
2630
|
EnableEditor,
|
|
2613
2631
|
{
|
|
2614
2632
|
content: e.content,
|
|
2633
|
+
data: e.data,
|
|
2615
2634
|
model: e.model,
|
|
2616
2635
|
context: e.context,
|
|
2617
2636
|
apiKey: e.apiKey,
|
|
@@ -2620,7 +2639,7 @@ function ContentComponent(e) {
|
|
|
2620
2639
|
includeRefs: e.includeRefs,
|
|
2621
2640
|
enrich: e.enrich,
|
|
2622
2641
|
showContent: e.showContent,
|
|
2623
|
-
builderContextSignal:
|
|
2642
|
+
builderContextSignal: r,
|
|
2624
2643
|
contentWrapper: e.contentWrapper,
|
|
2625
2644
|
contentWrapperProps: e.contentWrapperProps,
|
|
2626
2645
|
setBuilderContextSignal: l,
|
|
@@ -2629,16 +2648,16 @@ function ContentComponent(e) {
|
|
|
2629
2648
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2630
2649
|
ContentStyles,
|
|
2631
2650
|
{
|
|
2632
|
-
contentId: (c =
|
|
2633
|
-
cssCode: (d = (s =
|
|
2634
|
-
customFonts: (x = (g =
|
|
2651
|
+
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
2652
|
+
cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2653
|
+
customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2635
2654
|
}
|
|
2636
2655
|
) }),
|
|
2637
2656
|
/* @__PURE__ */ jsx(
|
|
2638
2657
|
Blocks,
|
|
2639
2658
|
{
|
|
2640
|
-
blocks: (S = (
|
|
2641
|
-
context:
|
|
2659
|
+
blocks: (S = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : S.blocks,
|
|
2660
|
+
context: r,
|
|
2642
2661
|
registeredComponents: o
|
|
2643
2662
|
}
|
|
2644
2663
|
)
|
|
@@ -2649,7 +2668,7 @@ function ContentComponent(e) {
|
|
|
2649
2668
|
);
|
|
2650
2669
|
}
|
|
2651
2670
|
function ContentVariants(e) {
|
|
2652
|
-
var
|
|
2671
|
+
var r, l;
|
|
2653
2672
|
const [t, n] = useState(
|
|
2654
2673
|
() => checkShouldRenderVariants({
|
|
2655
2674
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2669,7 +2688,7 @@ function ContentVariants(e) {
|
|
|
2669
2688
|
function o() {
|
|
2670
2689
|
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2671
2690
|
}
|
|
2672
|
-
function
|
|
2691
|
+
function a() {
|
|
2673
2692
|
var c;
|
|
2674
2693
|
return t ? {
|
|
2675
2694
|
...e.content,
|
|
@@ -2686,7 +2705,7 @@ function ContentVariants(e) {
|
|
|
2686
2705
|
/* @__PURE__ */ jsx(
|
|
2687
2706
|
InlinedStyles,
|
|
2688
2707
|
{
|
|
2689
|
-
id: `variants-styles-${(
|
|
2708
|
+
id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
|
|
2690
2709
|
styles: o()
|
|
2691
2710
|
}
|
|
2692
2711
|
),
|
|
@@ -2718,7 +2737,7 @@ function ContentVariants(e) {
|
|
|
2718
2737
|
/* @__PURE__ */ jsx(
|
|
2719
2738
|
ContentComponent,
|
|
2720
2739
|
{
|
|
2721
|
-
content:
|
|
2740
|
+
content: a(),
|
|
2722
2741
|
showContent: !0,
|
|
2723
2742
|
model: e.model,
|
|
2724
2743
|
data: e.data,
|
|
@@ -2759,7 +2778,7 @@ const fetchSymbolContent = async ({
|
|
|
2759
2778
|
});
|
|
2760
2779
|
};
|
|
2761
2780
|
function Symbol$1(e) {
|
|
2762
|
-
var
|
|
2781
|
+
var a, r, l;
|
|
2763
2782
|
function t() {
|
|
2764
2783
|
var c, s;
|
|
2765
2784
|
return [
|
|
@@ -2793,9 +2812,9 @@ function Symbol$1(e) {
|
|
|
2793
2812
|
context: e.builderContext.context,
|
|
2794
2813
|
customComponents: Object.values(e.builderComponents),
|
|
2795
2814
|
data: {
|
|
2796
|
-
...(
|
|
2815
|
+
...(a = e.symbol) == null ? void 0 : a.data,
|
|
2797
2816
|
...e.builderContext.localState,
|
|
2798
|
-
...(
|
|
2817
|
+
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2799
2818
|
},
|
|
2800
2819
|
model: (l = e.symbol) == null ? void 0 : l.model,
|
|
2801
2820
|
content: n
|
|
@@ -2816,17 +2835,17 @@ export {
|
|
|
2816
2835
|
Symbol$1 as Symbol,
|
|
2817
2836
|
Text,
|
|
2818
2837
|
Video,
|
|
2819
|
-
|
|
2838
|
+
H as _processContentResult,
|
|
2820
2839
|
createRegisterComponentMessage,
|
|
2821
|
-
|
|
2822
|
-
|
|
2840
|
+
K as fetchBuilderProps,
|
|
2841
|
+
z as fetchEntries,
|
|
2823
2842
|
fetchOneEntry,
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2843
|
+
q as getAllContent,
|
|
2844
|
+
Y as getBuilderSearchParams,
|
|
2845
|
+
G as getContent,
|
|
2827
2846
|
isEditing,
|
|
2828
2847
|
isPreviewing,
|
|
2829
2848
|
register,
|
|
2830
|
-
|
|
2831
|
-
|
|
2849
|
+
J as setEditorSettings,
|
|
2850
|
+
Q as track
|
|
2832
2851
|
};
|