@builder.io/sdk-react-nextjs 0.8.1 → 0.10.0
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/{USE_CLIENT_BUNDLE-0479ddc8.js → USE_CLIENT_BUNDLE-8a469a88.js} +195 -189
- package/lib/browser/USE_CLIENT_BUNDLE-bd42f34e.cjs +23 -0
- package/lib/{edge/USE_SERVER_BUNDLE-70f5e4b2.cjs → browser/USE_SERVER_BUNDLE-608eb1c6.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-de23a873.js → browser/USE_SERVER_BUNDLE-b0fcc116.js} +1 -1
- package/lib/browser/{bundle-e4200429.cjs → bundle-6593f46a.cjs} +10 -10
- package/lib/browser/{bundle-179c65a2.js → bundle-f23172a5.js} +288 -268
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-2ee2538b.cjs +23 -0
- package/lib/{node/USE_CLIENT_BUNDLE-ac10325c.js → edge/USE_CLIENT_BUNDLE-474e3242.js} +195 -189
- package/lib/{node/USE_SERVER_BUNDLE-de4b4ff0.cjs → edge/USE_SERVER_BUNDLE-b5ccb43b.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-2b7a9305.js → edge/USE_SERVER_BUNDLE-da7c49b1.js} +1 -1
- package/lib/edge/{bundle-a1501121.cjs → bundle-7c571d18.cjs} +30 -30
- package/lib/edge/{bundle-a958c31b.js → bundle-bd18331d.js} +1037 -1017
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-8c3da5c9.js → node/USE_CLIENT_BUNDLE-39759ac3.js} +195 -189
- package/lib/node/USE_CLIENT_BUNDLE-fcb61de5.cjs +23 -0
- package/lib/{browser/USE_SERVER_BUNDLE-71c86494.cjs → node/USE_SERVER_BUNDLE-9a538e9b.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-88940a10.js → node/USE_SERVER_BUNDLE-9cade0d5.js} +1 -1
- package/lib/node/{bundle-59bd1206.js → bundle-49222e30.js} +188 -168
- package/lib/node/{bundle-ef482315.cjs → bundle-ad89090d.cjs} +9 -9
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/blocks/blocks-wrapper.d.ts +8 -0
- package/types/cjs/components/blocks/blocks.d.ts +1 -1
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/components/content-variants/content-variants.types.d.ts +16 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/context/types.d.ts +2 -1
- package/types/cjs/functions/get-content/index.d.ts +2 -2
- package/types/cjs/functions/transform-block-properties.d.ts +5 -1
- package/types/cjs/types/enforced-partials.d.ts +7 -2
- package/types/esm/components/blocks/blocks-wrapper.d.ts +8 -0
- package/types/esm/components/blocks/blocks.d.ts +1 -1
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/components/content-variants/content-variants.types.d.ts +16 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/context/types.d.ts +2 -1
- package/types/esm/functions/get-content/index.d.ts +2 -2
- package/types/esm/functions/transform-block-properties.d.ts +5 -1
- package/types/esm/types/enforced-partials.d.ts +7 -2
- package/lib/browser/USE_CLIENT_BUNDLE-38635250.cjs +0 -23
- package/lib/edge/USE_CLIENT_BUNDLE-7d1db7a7.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-1fd9261f.cjs +0 -23
- package/types/cjs/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/esm/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/esm/functions/sanitize-react-native-block-styles.d.ts +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as C, Fragment as
|
|
3
|
-
import { g as T, a as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */ C(
|
|
9
|
-
e.link ? /* @__PURE__ */ i(
|
|
2
|
+
import { jsxs as C, Fragment as m, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-49222e30.js";
|
|
4
|
+
import { useRef as N, useState as k, useEffect as v, createContext as oe, createElement as le } from "react";
|
|
5
|
+
import { p as de } from "./USE_SERVER_BUNDLE-9cade0d5.js";
|
|
6
|
+
import { useRouter as se } from "next/navigation";
|
|
7
|
+
function Se(e) {
|
|
8
|
+
return /* @__PURE__ */ C(m, { children: [
|
|
9
|
+
e.link ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
10
10
|
"a",
|
|
11
11
|
{
|
|
12
12
|
...e.attributes,
|
|
@@ -15,7 +15,7 @@ function ge(e) {
|
|
|
15
15
|
role: "button",
|
|
16
16
|
children: e.text
|
|
17
17
|
}
|
|
18
|
-
) }) : /* @__PURE__ */ i(
|
|
18
|
+
) }) : /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
@@ -29,17 +29,17 @@ function ge(e) {
|
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */ C(
|
|
32
|
+
function xe(e) {
|
|
33
|
+
return /* @__PURE__ */ C(m, { children: [
|
|
34
34
|
" ",
|
|
35
|
-
e.hasChildren ? /* @__PURE__ */ i(
|
|
35
|
+
e.hasChildren ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ C(
|
|
36
36
|
e.Wrapper,
|
|
37
37
|
{
|
|
38
38
|
...T({
|
|
39
39
|
block: e.block,
|
|
40
40
|
context: e.context
|
|
41
41
|
}),
|
|
42
|
-
...
|
|
42
|
+
...B({
|
|
43
43
|
block: e.block,
|
|
44
44
|
rootState: e.context.rootState,
|
|
45
45
|
rootSetState: e.context.rootSetState,
|
|
@@ -53,14 +53,14 @@ function fe(e) {
|
|
|
53
53
|
" "
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
|
-
) }) : /* @__PURE__ */ i(
|
|
56
|
+
) }) : /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
57
57
|
e.Wrapper,
|
|
58
58
|
{
|
|
59
59
|
...T({
|
|
60
60
|
block: e.block,
|
|
61
61
|
context: e.context
|
|
62
62
|
}),
|
|
63
|
-
...
|
|
63
|
+
...B({
|
|
64
64
|
block: e.block,
|
|
65
65
|
rootState: e.context.rootState,
|
|
66
66
|
rootSetState: e.context.rootSetState,
|
|
@@ -73,7 +73,7 @@ function fe(e) {
|
|
|
73
73
|
" "
|
|
74
74
|
] });
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ve(e) {
|
|
77
77
|
return /* @__PURE__ */ i(
|
|
78
78
|
e.Wrapper,
|
|
79
79
|
{
|
|
@@ -83,7 +83,7 @@ function Se(e) {
|
|
|
83
83
|
block: e.block,
|
|
84
84
|
context: e.context
|
|
85
85
|
}),
|
|
86
|
-
...
|
|
86
|
+
...B({
|
|
87
87
|
block: e.block,
|
|
88
88
|
rootState: e.context.rootState,
|
|
89
89
|
rootSetState: e.context.rootSetState,
|
|
@@ -95,14 +95,14 @@ function Se(e) {
|
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function ye(e) {
|
|
99
99
|
function a() {
|
|
100
|
-
var
|
|
101
|
-
return "builder-blocks" + ((
|
|
100
|
+
var o;
|
|
101
|
+
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
102
102
|
}
|
|
103
103
|
function s() {
|
|
104
|
-
var
|
|
105
|
-
E() && !((
|
|
104
|
+
var o, h;
|
|
105
|
+
E() && !((o = e.blocks) != null && o.length) && ((h = window.parent) == null || h.postMessage(
|
|
106
106
|
{
|
|
107
107
|
type: "builder.clickEmptyBlocks",
|
|
108
108
|
data: {
|
|
@@ -113,9 +113,9 @@ function xe(e) {
|
|
|
113
113
|
"*"
|
|
114
114
|
));
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
118
|
-
E() && !((
|
|
116
|
+
function f() {
|
|
117
|
+
var o, h;
|
|
118
|
+
E() && !((o = e.blocks) != null && o.length) && ((h = window.parent) == null || h.postMessage(
|
|
119
119
|
{
|
|
120
120
|
type: "builder.hoverEmptyBlocks",
|
|
121
121
|
data: {
|
|
@@ -126,64 +126,65 @@ function xe(e) {
|
|
|
126
126
|
"*"
|
|
127
127
|
));
|
|
128
128
|
}
|
|
129
|
-
return /* @__PURE__ */ C(
|
|
129
|
+
return /* @__PURE__ */ C(m, { children: [
|
|
130
130
|
/* @__PURE__ */ i(
|
|
131
|
-
|
|
131
|
+
e.BlocksWrapper,
|
|
132
132
|
{
|
|
133
|
-
className: a() + "
|
|
133
|
+
className: a() + " props-blocks-wrapper-4f2c12d8",
|
|
134
134
|
"builder-path": e.path,
|
|
135
135
|
"builder-parent-id": e.parent,
|
|
136
136
|
style: e.styleProp,
|
|
137
|
-
onClick: (
|
|
138
|
-
onMouseEnter: (
|
|
139
|
-
onKeyPress: (
|
|
137
|
+
onClick: (o) => s(),
|
|
138
|
+
onMouseEnter: (o) => f(),
|
|
139
|
+
onKeyPress: (o) => s(),
|
|
140
|
+
...e.BlocksWrapperProps,
|
|
140
141
|
children: e.children
|
|
141
142
|
}
|
|
142
143
|
),
|
|
143
|
-
/* @__PURE__ */ i("style", { children: `.
|
|
144
|
+
/* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
|
|
144
145
|
display: flex;
|
|
145
146
|
flex-direction: column;
|
|
146
147
|
align-items: stretch;
|
|
147
148
|
}` })
|
|
148
149
|
] });
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function ke(e) {
|
|
151
152
|
return /* @__PURE__ */ i("span", { children: e.children });
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
154
|
+
function Ce(e) {
|
|
155
|
+
var o, h, S, x;
|
|
155
156
|
function a() {
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
157
|
+
var g;
|
|
158
|
+
const c = e.image || e.src;
|
|
159
|
+
if (!c || // We can auto add srcset for cdn.builder.io and shopify
|
|
159
160
|
// images, otherwise you can supply this prop manually
|
|
160
|
-
!(
|
|
161
|
+
!(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
|
|
161
162
|
return e.srcset;
|
|
162
|
-
if (e.srcset && ((
|
|
163
|
+
if (e.srcset && ((g = e.image) != null && g.includes("builder.io/api/v1/image"))) {
|
|
163
164
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
164
|
-
return console.debug("Removed given srcset"), R(
|
|
165
|
+
return console.debug("Removed given srcset"), R(c);
|
|
165
166
|
} else if (e.image && !e.srcset)
|
|
166
|
-
return R(
|
|
167
|
-
return R(
|
|
167
|
+
return R(c);
|
|
168
|
+
return R(c);
|
|
168
169
|
}
|
|
169
170
|
function s() {
|
|
170
|
-
var
|
|
171
|
-
return (
|
|
171
|
+
var b;
|
|
172
|
+
return (b = a == null ? void 0 : a()) != null && b.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
174
|
+
function f() {
|
|
175
|
+
const b = {
|
|
175
176
|
position: "absolute",
|
|
176
177
|
height: "100%",
|
|
177
178
|
width: "100%",
|
|
178
179
|
left: "0px",
|
|
179
180
|
top: "0px"
|
|
180
181
|
};
|
|
181
|
-
return e.aspectRatio ?
|
|
182
|
+
return e.aspectRatio ? b : void 0;
|
|
182
183
|
}
|
|
183
|
-
return /* @__PURE__ */ C(
|
|
184
|
-
/* @__PURE__ */ C(
|
|
184
|
+
return /* @__PURE__ */ C(m, { children: [
|
|
185
|
+
/* @__PURE__ */ C(m, { children: [
|
|
185
186
|
/* @__PURE__ */ C("picture", { children: [
|
|
186
|
-
s() ? /* @__PURE__ */ i(
|
|
187
|
+
s() ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
187
188
|
/* @__PURE__ */ i(
|
|
188
189
|
"img",
|
|
189
190
|
{
|
|
@@ -193,7 +194,7 @@ function ye(e) {
|
|
|
193
194
|
style: {
|
|
194
195
|
objectPosition: e.backgroundPosition || "center",
|
|
195
196
|
objectFit: e.backgroundSize || "cover",
|
|
196
|
-
...
|
|
197
|
+
...f()
|
|
197
198
|
},
|
|
198
199
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-dbab4030",
|
|
199
200
|
src: e.image,
|
|
@@ -202,7 +203,7 @@ function ye(e) {
|
|
|
202
203
|
}
|
|
203
204
|
)
|
|
204
205
|
] }),
|
|
205
|
-
e.aspectRatio && !((
|
|
206
|
+
e.aspectRatio && !((h = (o = e.builderBlock) == null ? void 0 : o.children) != null && h.length && e.fitContent) ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
206
207
|
"div",
|
|
207
208
|
{
|
|
208
209
|
className: "builder-image-sizer div-dbab4030",
|
|
@@ -211,8 +212,8 @@ function ye(e) {
|
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
) }) : null,
|
|
214
|
-
(
|
|
215
|
-
!e.fitContent && e.children ? /* @__PURE__ */ i(
|
|
215
|
+
(x = (S = e.builderBlock) == null ? void 0 : S.children) != null && x.length && e.fitContent ? /* @__PURE__ */ i(m, { children: e.children }) : null,
|
|
216
|
+
!e.fitContent && e.children ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("div", { className: "div-dbab4030-2", children: e.children }) }) : null
|
|
216
217
|
] }),
|
|
217
218
|
/* @__PURE__ */ i("style", { children: `.img-dbab4030 {
|
|
218
219
|
opacity: 1;
|
|
@@ -233,7 +234,7 @@ function ye(e) {
|
|
|
233
234
|
}` })
|
|
234
235
|
] });
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function we(e) {
|
|
237
238
|
return /* @__PURE__ */ i(
|
|
238
239
|
"section",
|
|
239
240
|
{
|
|
@@ -254,32 +255,32 @@ function ke(e) {
|
|
|
254
255
|
}
|
|
255
256
|
);
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
-
const a =
|
|
258
|
+
function Ee(e) {
|
|
259
|
+
const a = N(null), [s, f] = k(() => []), [o, h] = k(() => []);
|
|
259
260
|
return v(() => {
|
|
260
|
-
var
|
|
261
|
-
if (!((
|
|
261
|
+
var x;
|
|
262
|
+
if (!((x = a.current) != null && x.getElementsByTagName) || typeof window > "u")
|
|
262
263
|
return;
|
|
263
|
-
const
|
|
264
|
-
for (let
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
267
|
-
if (s.includes(
|
|
264
|
+
const S = a.current.getElementsByTagName("script");
|
|
265
|
+
for (let b = 0; b < S.length; b++) {
|
|
266
|
+
const c = S[b];
|
|
267
|
+
if (c.src) {
|
|
268
|
+
if (s.includes(c.src))
|
|
268
269
|
continue;
|
|
269
|
-
s.push(
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
} else if (!
|
|
270
|
+
s.push(c.src);
|
|
271
|
+
const g = document.createElement("script");
|
|
272
|
+
g.async = !0, g.src = c.src, document.head.appendChild(g);
|
|
273
|
+
} else if (!c.type || [
|
|
273
274
|
"text/javascript",
|
|
274
275
|
"application/javascript",
|
|
275
276
|
"application/ecmascript"
|
|
276
|
-
].includes(
|
|
277
|
-
if (
|
|
277
|
+
].includes(c.type)) {
|
|
278
|
+
if (o.includes(c.innerText))
|
|
278
279
|
continue;
|
|
279
280
|
try {
|
|
280
|
-
|
|
281
|
-
} catch (
|
|
282
|
-
console.warn("`CustomCode`: Error running script:",
|
|
281
|
+
o.push(c.innerText), new Function(c.innerText)();
|
|
282
|
+
} catch (g) {
|
|
283
|
+
console.warn("`CustomCode`: Error running script:", g);
|
|
283
284
|
}
|
|
284
285
|
}
|
|
285
286
|
}
|
|
@@ -292,29 +293,29 @@ function Ce(e) {
|
|
|
292
293
|
}
|
|
293
294
|
);
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
-
const a =
|
|
297
|
-
function
|
|
296
|
+
function Ie(e) {
|
|
297
|
+
const a = N(null), [s, f] = k(() => []), [o, h] = k(() => []), [S, x] = k(() => !1);
|
|
298
|
+
function b() {
|
|
298
299
|
if (!a.current || !a.current.getElementsByTagName)
|
|
299
300
|
return;
|
|
300
|
-
const
|
|
301
|
-
for (let
|
|
302
|
-
const y =
|
|
301
|
+
const c = a.current.getElementsByTagName("script");
|
|
302
|
+
for (let g = 0; g < c.length; g++) {
|
|
303
|
+
const y = c[g];
|
|
303
304
|
if (y.src && !s.includes(y.src)) {
|
|
304
305
|
s.push(y.src);
|
|
305
306
|
const w = document.createElement("script");
|
|
306
307
|
w.async = !0, w.src = y.src, document.head.appendChild(w);
|
|
307
|
-
} else if (
|
|
308
|
+
} else if (Y(y) && !o.includes(y.innerText))
|
|
308
309
|
try {
|
|
309
|
-
|
|
310
|
+
o.push(y.innerText), new Function(y.innerText)();
|
|
310
311
|
} catch (w) {
|
|
311
312
|
console.warn("`Embed`: Error running script:", w);
|
|
312
313
|
}
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
return v(() => {
|
|
316
|
-
a.current && !
|
|
317
|
-
}, [a.current,
|
|
317
|
+
a.current && !S && (x(!0), b());
|
|
318
|
+
}, [a.current, S]), /* @__PURE__ */ i(
|
|
318
319
|
"div",
|
|
319
320
|
{
|
|
320
321
|
className: "builder-embed",
|
|
@@ -323,7 +324,7 @@ function we(e) {
|
|
|
323
324
|
}
|
|
324
325
|
);
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function Re(e) {
|
|
327
328
|
return /* @__PURE__ */ i(
|
|
328
329
|
"img",
|
|
329
330
|
{
|
|
@@ -338,8 +339,8 @@ function Ee(e) {
|
|
|
338
339
|
E() && e.imgSrc || "default-key"
|
|
339
340
|
);
|
|
340
341
|
}
|
|
341
|
-
function
|
|
342
|
-
var
|
|
342
|
+
function Pe(e) {
|
|
343
|
+
var f, o, h, S, x, b, c;
|
|
343
344
|
function a() {
|
|
344
345
|
return {
|
|
345
346
|
...e.autoPlay === !0 ? {
|
|
@@ -380,7 +381,7 @@ function Ie(e) {
|
|
|
380
381
|
style: {
|
|
381
382
|
width: "100%",
|
|
382
383
|
height: "100%",
|
|
383
|
-
...(
|
|
384
|
+
...(f = e.attributes) == null ? void 0 : f.style,
|
|
384
385
|
objectFit: e.fit,
|
|
385
386
|
objectPosition: e.position,
|
|
386
387
|
// Hack to get object fit to work as expected and
|
|
@@ -396,7 +397,7 @@ function Ie(e) {
|
|
|
396
397
|
children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
|
|
397
398
|
}
|
|
398
399
|
),
|
|
399
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
400
|
+
e.aspectRatio && !(e.fitContent && ((h = (o = e.builderBlock) == null ? void 0 : o.children) != null && h.length)) ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
400
401
|
"div",
|
|
401
402
|
{
|
|
402
403
|
style: {
|
|
@@ -407,7 +408,7 @@ function Ie(e) {
|
|
|
407
408
|
}
|
|
408
409
|
}
|
|
409
410
|
) }) : null,
|
|
410
|
-
(
|
|
411
|
+
(x = (S = e.builderBlock) == null ? void 0 : S.children) != null && x.length && e.fitContent ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
411
412
|
"div",
|
|
412
413
|
{
|
|
413
414
|
style: {
|
|
@@ -418,7 +419,7 @@ function Ie(e) {
|
|
|
418
419
|
children: e.children
|
|
419
420
|
}
|
|
420
421
|
) }) : null,
|
|
421
|
-
(
|
|
422
|
+
(c = (b = e.builderBlock) == null ? void 0 : b.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
|
|
422
423
|
"div",
|
|
423
424
|
{
|
|
424
425
|
style: {
|
|
@@ -439,7 +440,7 @@ function Ie(e) {
|
|
|
439
440
|
}
|
|
440
441
|
);
|
|
441
442
|
}
|
|
442
|
-
const
|
|
443
|
+
const ue = oe({
|
|
443
444
|
content: null,
|
|
444
445
|
context: {},
|
|
445
446
|
localState: void 0,
|
|
@@ -449,64 +450,68 @@ const de = ce({
|
|
|
449
450
|
apiKey: null,
|
|
450
451
|
apiVersion: void 0,
|
|
451
452
|
componentInfos: {},
|
|
452
|
-
inheritedStyles: {}
|
|
453
|
+
inheritedStyles: {},
|
|
454
|
+
BlocksWrapper: "div",
|
|
455
|
+
BlocksWrapperProps: {}
|
|
453
456
|
});
|
|
454
|
-
function
|
|
455
|
-
var F, z, M, _, V, q,
|
|
456
|
-
const a =
|
|
457
|
-
function
|
|
458
|
-
var
|
|
457
|
+
function Te(e) {
|
|
458
|
+
var F, z, M, _, V, q, A;
|
|
459
|
+
const a = N(null), [s, f] = k(() => 0);
|
|
460
|
+
function o(t) {
|
|
461
|
+
var r, l, d, u, D;
|
|
459
462
|
const n = {
|
|
460
463
|
...e.builderContextSignal.content,
|
|
461
464
|
...t,
|
|
462
465
|
data: {
|
|
463
|
-
...(
|
|
466
|
+
...(r = e.builderContextSignal.content) == null ? void 0 : r.data,
|
|
464
467
|
...t == null ? void 0 : t.data
|
|
465
468
|
},
|
|
466
469
|
meta: {
|
|
467
|
-
...(
|
|
470
|
+
...(l = e.builderContextSignal.content) == null ? void 0 : l.meta,
|
|
468
471
|
...t == null ? void 0 : t.meta,
|
|
469
|
-
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((
|
|
472
|
+
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((D = (u = e.builderContextSignal.content) == null ? void 0 : u.meta) == null ? void 0 : D.breakpoints)
|
|
470
473
|
}
|
|
471
474
|
};
|
|
472
|
-
|
|
475
|
+
de({
|
|
473
476
|
value: n,
|
|
474
477
|
key: n.id
|
|
475
478
|
}).then(() => {
|
|
476
|
-
|
|
479
|
+
X.refresh();
|
|
477
480
|
});
|
|
478
481
|
}
|
|
479
482
|
k(() => 0);
|
|
480
|
-
const [
|
|
483
|
+
const [h, S] = k(
|
|
481
484
|
() => !1
|
|
485
|
+
), [x, b] = k(
|
|
486
|
+
() => e.contentWrapper || "div"
|
|
482
487
|
);
|
|
483
|
-
function
|
|
484
|
-
var
|
|
488
|
+
function c(t) {
|
|
489
|
+
var r;
|
|
485
490
|
const { data: n } = t;
|
|
486
491
|
if (n)
|
|
487
492
|
switch (n.type) {
|
|
488
493
|
case "builder.configureSdk": {
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
494
|
+
const l = n.data, { breakpoints: d, contentId: u } = l;
|
|
495
|
+
if (!u || u !== ((r = e.builderContextSignal.content) == null ? void 0 : r.id))
|
|
491
496
|
return;
|
|
492
|
-
d &&
|
|
497
|
+
d && o({
|
|
493
498
|
meta: {
|
|
494
499
|
breakpoints: d
|
|
495
500
|
}
|
|
496
|
-
}),
|
|
501
|
+
}), f(s + 1);
|
|
497
502
|
break;
|
|
498
503
|
}
|
|
499
504
|
case "builder.contentUpdate": {
|
|
500
|
-
const
|
|
501
|
-
d === e.model && (
|
|
505
|
+
const l = n.data, d = l.key || l.alias || l.entry || l.modelName, u = l.data;
|
|
506
|
+
d === e.model && (o(u), f(s + 1));
|
|
502
507
|
break;
|
|
503
508
|
}
|
|
504
509
|
}
|
|
505
510
|
}
|
|
506
|
-
function
|
|
507
|
-
var n,
|
|
508
|
-
const t = (
|
|
509
|
-
t &&
|
|
511
|
+
function g() {
|
|
512
|
+
var n, r;
|
|
513
|
+
const t = (r = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : r.jsCode;
|
|
514
|
+
t && O({
|
|
510
515
|
code: t,
|
|
511
516
|
context: e.context || {},
|
|
512
517
|
localState: void 0,
|
|
@@ -514,28 +519,28 @@ function Re(e) {
|
|
|
514
519
|
rootSetState: e.builderContextSignal.rootSetState
|
|
515
520
|
});
|
|
516
521
|
}
|
|
517
|
-
const [
|
|
518
|
-
function
|
|
519
|
-
var n,
|
|
522
|
+
const [y, w] = k(() => ({})), [L, J] = k(() => !1);
|
|
523
|
+
function $(t) {
|
|
524
|
+
var n, r;
|
|
520
525
|
if (e.builderContextSignal.content) {
|
|
521
|
-
const
|
|
522
|
-
|
|
526
|
+
const l = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (r = e.builderContextSignal.content) == null ? void 0 : r.id;
|
|
527
|
+
H({
|
|
523
528
|
type: "click",
|
|
524
|
-
canTrack:
|
|
529
|
+
canTrack: U(e.canTrack),
|
|
525
530
|
contentId: d,
|
|
526
531
|
apiKey: e.apiKey,
|
|
527
|
-
variationId:
|
|
528
|
-
...
|
|
529
|
-
unique: !
|
|
532
|
+
variationId: l !== d ? l : void 0,
|
|
533
|
+
...ee(t),
|
|
534
|
+
unique: !L
|
|
530
535
|
});
|
|
531
536
|
}
|
|
532
|
-
|
|
537
|
+
L || J(!0);
|
|
533
538
|
}
|
|
534
|
-
function
|
|
539
|
+
function G(t) {
|
|
535
540
|
return t.replace(
|
|
536
541
|
/{{([^}]+)}}/g,
|
|
537
|
-
(n,
|
|
538
|
-
code:
|
|
542
|
+
(n, r) => O({
|
|
543
|
+
code: r,
|
|
539
544
|
context: e.context || {},
|
|
540
545
|
localState: void 0,
|
|
541
546
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -543,27 +548,27 @@ function Re(e) {
|
|
|
543
548
|
})
|
|
544
549
|
);
|
|
545
550
|
}
|
|
546
|
-
function
|
|
547
|
-
|
|
548
|
-
var d,
|
|
549
|
-
const
|
|
551
|
+
function Q({ url: t, key: n }) {
|
|
552
|
+
re(t).then((r) => r.json()).then((r) => {
|
|
553
|
+
var d, u;
|
|
554
|
+
const l = {
|
|
550
555
|
...e.builderContextSignal.rootState,
|
|
551
|
-
[n]:
|
|
556
|
+
[n]: r
|
|
552
557
|
};
|
|
553
|
-
(
|
|
554
|
-
}).catch((
|
|
555
|
-
console.error("error fetching dynamic data", t,
|
|
558
|
+
(u = (d = e.builderContextSignal).rootSetState) == null || u.call(d, l), y[n] = !0;
|
|
559
|
+
}).catch((r) => {
|
|
560
|
+
console.error("error fetching dynamic data", t, r);
|
|
556
561
|
});
|
|
557
562
|
}
|
|
558
|
-
function
|
|
559
|
-
var n,
|
|
560
|
-
const t = ((
|
|
561
|
-
Object.entries(t).forEach(([
|
|
562
|
-
if (d && (!
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
url:
|
|
566
|
-
key:
|
|
563
|
+
function j() {
|
|
564
|
+
var n, r;
|
|
565
|
+
const t = ((r = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : r.httpRequests) ?? {};
|
|
566
|
+
Object.entries(t).forEach(([l, d]) => {
|
|
567
|
+
if (d && (!y[l] || E())) {
|
|
568
|
+
const u = G(d);
|
|
569
|
+
Q({
|
|
570
|
+
url: u,
|
|
571
|
+
key: l
|
|
567
572
|
});
|
|
568
573
|
}
|
|
569
574
|
});
|
|
@@ -574,7 +579,7 @@ function Re(e) {
|
|
|
574
579
|
"builder:component:stateChange",
|
|
575
580
|
{
|
|
576
581
|
detail: {
|
|
577
|
-
state:
|
|
582
|
+
state: te(e.builderContextSignal.rootState),
|
|
578
583
|
ref: {
|
|
579
584
|
name: e.model
|
|
580
585
|
}
|
|
@@ -583,8 +588,8 @@ function Re(e) {
|
|
|
583
588
|
)
|
|
584
589
|
);
|
|
585
590
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
591
|
+
function W(t) {
|
|
592
|
+
f(s + 1), window.addEventListener("message", c), ne(), ie({
|
|
588
593
|
...e.locale ? {
|
|
589
594
|
locale: e.locale
|
|
590
595
|
} : {},
|
|
@@ -597,37 +602,37 @@ function Re(e) {
|
|
|
597
602
|
}), Object.values(
|
|
598
603
|
e.builderContextSignal.componentInfos
|
|
599
604
|
).forEach((n) => {
|
|
600
|
-
var
|
|
601
|
-
const
|
|
602
|
-
(
|
|
605
|
+
var l;
|
|
606
|
+
const r = ae(n);
|
|
607
|
+
(l = window.parent) == null || l.postMessage(r, "*");
|
|
603
608
|
}), window.addEventListener(
|
|
604
609
|
"builder:component:stateChangeListenerActivated",
|
|
605
610
|
I
|
|
606
611
|
);
|
|
607
612
|
}
|
|
608
613
|
function K(t) {
|
|
609
|
-
const n = new URL(location.href).searchParams,
|
|
610
|
-
`builder.preview.${
|
|
614
|
+
const n = new URL(location.href).searchParams, r = n.get("builder.preview"), l = n.get(
|
|
615
|
+
`builder.preview.${r}`
|
|
611
616
|
), d = n.get("apiKey") || n.get("builder.space");
|
|
612
|
-
|
|
617
|
+
r === e.model && d === e.apiKey && (!e.content || l === e.content.id) && ce({
|
|
613
618
|
model: e.model,
|
|
614
619
|
apiKey: e.apiKey,
|
|
615
620
|
apiVersion: e.builderContextSignal.apiVersion
|
|
616
|
-
}).then((
|
|
617
|
-
|
|
621
|
+
}).then((u) => {
|
|
622
|
+
u && o(u);
|
|
618
623
|
});
|
|
619
624
|
}
|
|
620
|
-
const
|
|
625
|
+
const X = se();
|
|
621
626
|
return v(() => {
|
|
622
627
|
var t;
|
|
623
628
|
return (t = a.current) == null || t.addEventListener(
|
|
624
629
|
"initeditingbldr",
|
|
625
|
-
|
|
630
|
+
W
|
|
626
631
|
), () => {
|
|
627
632
|
var n;
|
|
628
633
|
return (n = a.current) == null ? void 0 : n.removeEventListener(
|
|
629
634
|
"initeditingbldr",
|
|
630
|
-
|
|
635
|
+
W
|
|
631
636
|
);
|
|
632
637
|
};
|
|
633
638
|
}, []), v(() => {
|
|
@@ -645,67 +650,68 @@ function Re(e) {
|
|
|
645
650
|
}, []), v(() => {
|
|
646
651
|
var t, n;
|
|
647
652
|
if (P()) {
|
|
648
|
-
if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content &&
|
|
649
|
-
const
|
|
650
|
-
|
|
653
|
+
if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && U(e.canTrack)) {
|
|
654
|
+
const l = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, u = e.apiKey;
|
|
655
|
+
H({
|
|
651
656
|
type: "impression",
|
|
652
657
|
canTrack: !0,
|
|
653
658
|
contentId: d,
|
|
654
|
-
apiKey:
|
|
655
|
-
variationId:
|
|
659
|
+
apiKey: u,
|
|
660
|
+
variationId: l !== d ? l : void 0
|
|
656
661
|
});
|
|
657
662
|
}
|
|
658
|
-
|
|
663
|
+
Z() && a.current;
|
|
659
664
|
}
|
|
660
665
|
}, []), v(() => {
|
|
661
|
-
e.apiKey ||
|
|
666
|
+
e.apiKey || p.error(
|
|
662
667
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
663
|
-
),
|
|
668
|
+
), g(), j(), I();
|
|
664
669
|
}, []), v(() => {
|
|
665
670
|
}, [e.content]), v(() => {
|
|
666
|
-
P() && (window.removeEventListener("message",
|
|
667
|
-
}, [
|
|
668
|
-
|
|
671
|
+
P() && (window.removeEventListener("message", c), window.addEventListener("message", c));
|
|
672
|
+
}, [h]), v(() => {
|
|
673
|
+
g();
|
|
669
674
|
}, [
|
|
670
675
|
(z = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : z.jsCode,
|
|
671
676
|
e.builderContextSignal.rootState
|
|
672
677
|
]), v(() => {
|
|
673
|
-
|
|
678
|
+
j();
|
|
674
679
|
}, [(_ = (M = e.builderContextSignal.content) == null ? void 0 : M.data) == null ? void 0 : _.httpRequests]), v(() => {
|
|
675
680
|
I();
|
|
676
681
|
}, [e.builderContextSignal.rootState]), v(() => () => {
|
|
677
|
-
P() && (window.removeEventListener("message",
|
|
682
|
+
P() && (window.removeEventListener("message", c), window.removeEventListener(
|
|
678
683
|
"builder:component:stateChangeListenerActivated",
|
|
679
684
|
I
|
|
680
685
|
));
|
|
681
|
-
}, []), /* @__PURE__ */ i(
|
|
682
|
-
|
|
686
|
+
}, []), /* @__PURE__ */ i(ue.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ le(
|
|
687
|
+
x,
|
|
683
688
|
{
|
|
684
689
|
key: s,
|
|
685
690
|
ref: a,
|
|
686
|
-
onClick: (t) =>
|
|
691
|
+
onClick: (t) => $(t),
|
|
687
692
|
"builder-content-id": (V = e.builderContextSignal.content) == null ? void 0 : V.id,
|
|
688
693
|
"builder-model": e.model,
|
|
689
694
|
...e.showContent ? {} : {
|
|
690
695
|
hidden: !0,
|
|
691
696
|
"aria-hidden": !0
|
|
692
697
|
},
|
|
693
|
-
|
|
698
|
+
...e.contentWrapperProps,
|
|
699
|
+
className: `variant-${((q = e.content) == null ? void 0 : q.testVariationId) || ((A = e.content) == null ? void 0 : A.id)}`
|
|
694
700
|
},
|
|
695
701
|
e.children
|
|
696
702
|
) }) : null });
|
|
697
703
|
}
|
|
698
704
|
export {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
705
|
+
xe as B,
|
|
706
|
+
Ee as C,
|
|
707
|
+
Ie as E,
|
|
708
|
+
ke as F,
|
|
709
|
+
ve as I,
|
|
710
|
+
we as S,
|
|
711
|
+
Pe as V,
|
|
712
|
+
ye as a,
|
|
713
|
+
Se as b,
|
|
714
|
+
Ce as c,
|
|
715
|
+
Re as d,
|
|
716
|
+
Te as e
|
|
711
717
|
};
|