@builder.io/sdk-react-nextjs 0.14.6 → 0.14.8
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/README.md +8 -2
- package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +21 -0
- package/lib/browser/{USE_CLIENT_BUNDLE-dbef551d.js → USE_CLIENT_BUNDLE-78517750.js} +143 -136
- package/lib/{edge/USE_SERVER_BUNDLE-abb6c4ae.js → browser/USE_SERVER_BUNDLE-29f23050.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-2000e927.cjs → browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs} +1 -1
- package/lib/browser/{bundle-b2b7ab8b.js → bundle-d78727c9.js} +630 -591
- package/lib/browser/bundle-eca4b0ba.cjs +169 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-22e26b2f.js → edge/USE_CLIENT_BUNDLE-01cf3cc1.js} +143 -136
- package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +21 -0
- package/lib/{node/USE_SERVER_BUNDLE-90b6e155.js → edge/USE_SERVER_BUNDLE-2cb317bc.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-5a67cb67.cjs → edge/USE_SERVER_BUNDLE-7cb08770.cjs} +1 -1
- package/lib/edge/{bundle-f4b34118.cjs → bundle-07c68bbe.cjs} +39 -38
- package/lib/edge/{bundle-9950e3ec.js → bundle-7da386a2.js} +1316 -1277
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-471a7309.js → node/USE_CLIENT_BUNDLE-690f58c3.js} +143 -136
- package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +21 -0
- package/lib/{browser/USE_SERVER_BUNDLE-a6a333bd.js → node/USE_SERVER_BUNDLE-649f2942.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-545db2f7.cjs → node/USE_SERVER_BUNDLE-e8d80664.cjs} +1 -1
- package/lib/node/{bundle-a8519a3b.js → bundle-001f0cdc.js} +272 -233
- package/lib/node/{bundle-9f34ab83.cjs → bundle-77f045ce.cjs} +16 -15
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/block/block.helpers.d.ts +4 -0
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/components/content/components/styles.d.ts +1 -0
- package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
- package/types/cjs/components/content/contentProps.types.d.ts +6 -1
- package/types/cjs/components/content-variants/content-variants.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/evaluate/evaluate.d.ts +3 -1
- package/types/cjs/functions/evaluate/helpers.d.ts +1 -0
- package/types/esm/components/block/block.helpers.d.ts +4 -0
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/components/content/components/styles.d.ts +1 -0
- package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
- package/types/esm/components/content/contentProps.types.d.ts +6 -1
- package/types/esm/components/content-variants/content-variants.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/evaluate.d.ts +3 -1
- package/types/esm/functions/evaluate/helpers.d.ts +1 -0
- package/lib/browser/USE_CLIENT_BUNDLE-e0428aec.cjs +0 -21
- package/lib/browser/bundle-0de8b96d.cjs +0 -168
- package/lib/edge/USE_CLIENT_BUNDLE-1ce5de06.cjs +0 -21
- package/lib/node/USE_CLIENT_BUNDLE-07b10dcb.cjs +0 -21
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-
|
|
4
|
-
import { useRef as T, useState as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
2
|
+
import { jsx as c, Fragment as C, jsxs as E } from "react/jsx-runtime";
|
|
3
|
+
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-d78727c9.js";
|
|
4
|
+
import { useRef as T, useState as v, useEffect as b, createContext as me, createElement as ge } from "react";
|
|
5
|
+
import { p as be } from "./USE_SERVER_BUNDLE-29f23050.js";
|
|
6
|
+
import { useRouter as he } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ c(C, { children: p(e.TagName) ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ c(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
9
9
|
}
|
|
10
10
|
function we(e) {
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
12
|
J,
|
|
13
13
|
{
|
|
14
14
|
attributes: {
|
|
@@ -29,7 +29,7 @@ function we(e) {
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
function Ee(e) {
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ c(
|
|
33
33
|
J,
|
|
34
34
|
{
|
|
35
35
|
TagName: e.Wrapper,
|
|
@@ -50,7 +50,7 @@ function Ee(e) {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
function Ie(e) {
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ c(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
56
56
|
...e.wrapperProps,
|
|
@@ -72,7 +72,7 @@ function Ie(e) {
|
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
function Re(e) {
|
|
75
|
-
function
|
|
75
|
+
function a() {
|
|
76
76
|
var r;
|
|
77
77
|
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
78
78
|
}
|
|
@@ -89,7 +89,7 @@ function Re(e) {
|
|
|
89
89
|
"*"
|
|
90
90
|
));
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function f() {
|
|
93
93
|
var r, u;
|
|
94
94
|
w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
|
|
95
95
|
{
|
|
@@ -102,22 +102,22 @@ function Re(e) {
|
|
|
102
102
|
"*"
|
|
103
103
|
));
|
|
104
104
|
}
|
|
105
|
-
return /* @__PURE__ */ E(
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ E(C, { children: [
|
|
106
|
+
/* @__PURE__ */ c(
|
|
107
107
|
e.BlocksWrapper,
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: a() + " props-blocks-wrapper-7cd1560e",
|
|
110
110
|
"builder-path": e.path,
|
|
111
111
|
"builder-parent-id": e.parent,
|
|
112
112
|
style: e.styleProp,
|
|
113
113
|
onClick: (r) => s(),
|
|
114
|
-
onMouseEnter: (r) =>
|
|
114
|
+
onMouseEnter: (r) => f(),
|
|
115
115
|
onKeyPress: (r) => s(),
|
|
116
116
|
...e.BlocksWrapperProps,
|
|
117
117
|
children: e.children
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ c("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: column;
|
|
123
123
|
align-items: stretch;
|
|
@@ -125,11 +125,11 @@ function Re(e) {
|
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
127
|
function Pe(e) {
|
|
128
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ c("span", { children: e.children });
|
|
129
129
|
}
|
|
130
130
|
function Te(e) {
|
|
131
|
-
var r, u,
|
|
132
|
-
function
|
|
131
|
+
var r, u, h, x;
|
|
132
|
+
function a() {
|
|
133
133
|
var m;
|
|
134
134
|
const l = e.image || e.src;
|
|
135
135
|
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
@@ -145,9 +145,9 @@ function Te(e) {
|
|
|
145
145
|
}
|
|
146
146
|
function s() {
|
|
147
147
|
var g;
|
|
148
|
-
return (g =
|
|
148
|
+
return (g = a == null ? void 0 : a()) != null && g.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function f() {
|
|
151
151
|
const g = {
|
|
152
152
|
position: "absolute",
|
|
153
153
|
height: "100%",
|
|
@@ -157,11 +157,11 @@ function Te(e) {
|
|
|
157
157
|
};
|
|
158
158
|
return e.aspectRatio ? g : void 0;
|
|
159
159
|
}
|
|
160
|
-
return /* @__PURE__ */ E(
|
|
161
|
-
/* @__PURE__ */ E(
|
|
160
|
+
return /* @__PURE__ */ E(C, { children: [
|
|
161
|
+
/* @__PURE__ */ E(C, { children: [
|
|
162
162
|
/* @__PURE__ */ E("picture", { children: [
|
|
163
|
-
s() ? /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
s() ? /* @__PURE__ */ c("source", { type: "image/webp", srcSet: s() }) : null,
|
|
164
|
+
/* @__PURE__ */ c(
|
|
165
165
|
"img",
|
|
166
166
|
{
|
|
167
167
|
loading: "lazy",
|
|
@@ -170,35 +170,35 @@ function Te(e) {
|
|
|
170
170
|
style: {
|
|
171
171
|
objectPosition: e.backgroundPosition || "center",
|
|
172
172
|
objectFit: e.backgroundSize || "cover",
|
|
173
|
-
...
|
|
173
|
+
...f()
|
|
174
174
|
},
|
|
175
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
175
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
176
176
|
src: e.image,
|
|
177
|
-
srcSet:
|
|
177
|
+
srcSet: a(),
|
|
178
178
|
sizes: e.sizes
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */
|
|
182
|
+
e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ c(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
|
-
className: "builder-image-sizer div-
|
|
185
|
+
className: "builder-image-sizer div-a0c95e8c",
|
|
186
186
|
style: {
|
|
187
187
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
)
|
|
191
|
-
(
|
|
192
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
190
|
+
) : null,
|
|
191
|
+
(x = (h = e.builderBlock) == null ? void 0 : h.children) != null && x.length && e.fitContent ? /* @__PURE__ */ c(C, { children: e.children }) : null,
|
|
192
|
+
!e.fitContent && e.children ? /* @__PURE__ */ c("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ c("style", { children: `.img-a0c95e8c {
|
|
195
195
|
opacity: 1;
|
|
196
196
|
transition: opacity 0.2s ease-in-out;
|
|
197
|
-
}.div-
|
|
197
|
+
}.div-a0c95e8c {
|
|
198
198
|
width: 100%;
|
|
199
199
|
pointer-events: none;
|
|
200
200
|
font-size: 0;
|
|
201
|
-
}.div-
|
|
201
|
+
}.div-a0c95e8c-2 {
|
|
202
202
|
display: flex;
|
|
203
203
|
flex-direction: column;
|
|
204
204
|
align-items: stretch;
|
|
@@ -211,7 +211,7 @@ function Te(e) {
|
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
213
|
function Ne(e) {
|
|
214
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ c(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
217
217
|
...e.attributes,
|
|
@@ -232,14 +232,14 @@ function Ne(e) {
|
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
234
|
function Be(e) {
|
|
235
|
-
const
|
|
235
|
+
const a = T(null), [s, f] = v(() => []), [r, u] = v(() => []);
|
|
236
236
|
return b(() => {
|
|
237
|
-
var
|
|
238
|
-
if (!((
|
|
237
|
+
var x;
|
|
238
|
+
if (!((x = a.current) != null && x.getElementsByTagName) || typeof window > "u")
|
|
239
239
|
return;
|
|
240
|
-
const
|
|
241
|
-
for (let g = 0; g <
|
|
242
|
-
const l =
|
|
240
|
+
const h = a.current.getElementsByTagName("script");
|
|
241
|
+
for (let g = 0; g < h.length; g++) {
|
|
242
|
+
const l = h[g];
|
|
243
243
|
if (l.src) {
|
|
244
244
|
if (s.includes(l.src))
|
|
245
245
|
continue;
|
|
@@ -260,48 +260,48 @@ function Be(e) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
}, []), /* @__PURE__ */
|
|
263
|
+
}, []), /* @__PURE__ */ c(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
|
-
ref:
|
|
266
|
+
ref: a,
|
|
267
267
|
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
268
268
|
dangerouslySetInnerHTML: { __html: e.code }
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
272
|
function Le(e) {
|
|
273
|
-
const
|
|
273
|
+
const a = T(null), [s, f] = v(() => []), [r, u] = v(() => []), [h, x] = v(() => !1);
|
|
274
274
|
function g() {
|
|
275
|
-
if (!
|
|
275
|
+
if (!a.current || !a.current.getElementsByTagName)
|
|
276
276
|
return;
|
|
277
|
-
const l =
|
|
277
|
+
const l = a.current.getElementsByTagName("script");
|
|
278
278
|
for (let m = 0; m < l.length; m++) {
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
s.push(
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} else if (ee(
|
|
279
|
+
const y = l[m];
|
|
280
|
+
if (y.src && !s.includes(y.src)) {
|
|
281
|
+
s.push(y.src);
|
|
282
|
+
const k = document.createElement("script");
|
|
283
|
+
k.async = !0, k.src = y.src, document.head.appendChild(k);
|
|
284
|
+
} else if (ee(y) && !r.includes(y.innerText))
|
|
285
285
|
try {
|
|
286
|
-
r.push(
|
|
287
|
-
} catch (
|
|
288
|
-
console.warn("`Embed`: Error running script:",
|
|
286
|
+
r.push(y.innerText), new Function(y.innerText)();
|
|
287
|
+
} catch (k) {
|
|
288
|
+
console.warn("`Embed`: Error running script:", k);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
return b(() => {
|
|
293
|
-
|
|
294
|
-
}, [
|
|
293
|
+
a.current && !h && (x(!0), g());
|
|
294
|
+
}, [a.current, h]), /* @__PURE__ */ c(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: "builder-embed",
|
|
298
|
-
ref:
|
|
298
|
+
ref: a,
|
|
299
299
|
dangerouslySetInnerHTML: { __html: e.content }
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
303
|
function je(e) {
|
|
304
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ c(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
307
307
|
style: {
|
|
@@ -316,8 +316,8 @@ function je(e) {
|
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
318
|
function We(e) {
|
|
319
|
-
var
|
|
320
|
-
function
|
|
319
|
+
var f, r, u, h, x, g, l;
|
|
320
|
+
function a() {
|
|
321
321
|
return {
|
|
322
322
|
...e.autoPlay === !0 ? {
|
|
323
323
|
autoPlay: !0
|
|
@@ -338,7 +338,7 @@ function We(e) {
|
|
|
338
338
|
}
|
|
339
339
|
function s() {
|
|
340
340
|
return {
|
|
341
|
-
...
|
|
341
|
+
...a()
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
344
|
return /* @__PURE__ */ E(
|
|
@@ -348,7 +348,7 @@ function We(e) {
|
|
|
348
348
|
position: "relative"
|
|
349
349
|
},
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ c(
|
|
352
352
|
"video",
|
|
353
353
|
{
|
|
354
354
|
className: "builder-video",
|
|
@@ -357,7 +357,7 @@ function We(e) {
|
|
|
357
357
|
style: {
|
|
358
358
|
width: "100%",
|
|
359
359
|
height: "100%",
|
|
360
|
-
...(
|
|
360
|
+
...(f = e.attributes) == null ? void 0 : f.style,
|
|
361
361
|
objectFit: e.fit,
|
|
362
362
|
objectPosition: e.position,
|
|
363
363
|
// Hack to get object fit to work as expected and
|
|
@@ -370,10 +370,10 @@ function We(e) {
|
|
|
370
370
|
},
|
|
371
371
|
src: e.video || "no-src",
|
|
372
372
|
poster: e.posterImage,
|
|
373
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
373
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ c("source", { type: "video/mp4", src: e.video })
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
e.aspectRatio && !(e.fitContent && ((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length)) ? /* @__PURE__ */
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length)) ? /* @__PURE__ */ c(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -383,8 +383,8 @@ function We(e) {
|
|
|
383
383
|
fontSize: "0px"
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
)
|
|
387
|
-
(
|
|
386
|
+
) : null,
|
|
387
|
+
(x = (h = e.builderBlock) == null ? void 0 : h.children) != null && x.length && e.fitContent ? /* @__PURE__ */ c(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
390
|
style: {
|
|
@@ -394,8 +394,8 @@ function We(e) {
|
|
|
394
394
|
},
|
|
395
395
|
children: e.children
|
|
396
396
|
}
|
|
397
|
-
)
|
|
398
|
-
(l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */
|
|
397
|
+
) : null,
|
|
398
|
+
(l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ c(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
401
401
|
style: {
|
|
@@ -411,7 +411,7 @@ function We(e) {
|
|
|
411
411
|
},
|
|
412
412
|
children: e.children
|
|
413
413
|
}
|
|
414
|
-
)
|
|
414
|
+
) : null
|
|
415
415
|
]
|
|
416
416
|
}
|
|
417
417
|
);
|
|
@@ -432,42 +432,42 @@ const fe = me({
|
|
|
432
432
|
});
|
|
433
433
|
function Ke(e) {
|
|
434
434
|
var W, K, A, F, z, M, _;
|
|
435
|
-
const
|
|
436
|
-
|
|
435
|
+
const a = T(null), [s, f] = v(() => 0);
|
|
436
|
+
v(() => !0);
|
|
437
437
|
function r(n) {
|
|
438
|
-
var
|
|
438
|
+
var i, o;
|
|
439
439
|
const t = {
|
|
440
440
|
...e.builderContextSignal.rootState,
|
|
441
441
|
...n
|
|
442
442
|
};
|
|
443
|
-
e.builderContextSignal.rootSetState ? (o = (
|
|
443
|
+
e.builderContextSignal.rootSetState ? (o = (i = e.builderContextSignal).rootSetState) == null || o.call(i, t) : e.builderContextSignal.rootState = t;
|
|
444
444
|
}
|
|
445
445
|
function u(n) {
|
|
446
|
-
var
|
|
446
|
+
var i, o, d, S, q;
|
|
447
447
|
const t = {
|
|
448
448
|
...e.builderContextSignal.content,
|
|
449
449
|
...n,
|
|
450
450
|
data: {
|
|
451
|
-
...(
|
|
451
|
+
...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
|
|
452
452
|
...n == null ? void 0 : n.data
|
|
453
453
|
},
|
|
454
454
|
meta: {
|
|
455
455
|
...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
|
|
456
456
|
...n == null ? void 0 : n.meta,
|
|
457
|
-
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (
|
|
457
|
+
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (S = e.builderContextSignal.content) == null ? void 0 : S.meta) == null ? void 0 : q.breakpoints)
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
|
-
|
|
460
|
+
be({
|
|
461
461
|
value: t,
|
|
462
462
|
key: t.id
|
|
463
463
|
}).then(() => {
|
|
464
464
|
Z.refresh();
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
|
-
|
|
468
|
-
const [
|
|
467
|
+
v(() => 0);
|
|
468
|
+
const [h, x] = v(
|
|
469
469
|
() => !1
|
|
470
|
-
), [g, l] =
|
|
470
|
+
), [g, l] = v(
|
|
471
471
|
() => e.contentWrapper || "div"
|
|
472
472
|
);
|
|
473
473
|
function m(n) {
|
|
@@ -477,38 +477,42 @@ function Ke(e) {
|
|
|
477
477
|
callbacks: {
|
|
478
478
|
configureSdk: (t) => {
|
|
479
479
|
var d;
|
|
480
|
-
const { breakpoints:
|
|
481
|
-
!o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) ||
|
|
480
|
+
const { breakpoints: i, contentId: o } = t;
|
|
481
|
+
!o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || i && (u({
|
|
482
482
|
meta: {
|
|
483
|
-
breakpoints:
|
|
483
|
+
breakpoints: i
|
|
484
484
|
}
|
|
485
|
-
}),
|
|
485
|
+
}), f(s + 1));
|
|
486
486
|
},
|
|
487
487
|
animation: (t) => {
|
|
488
488
|
ae(t);
|
|
489
489
|
},
|
|
490
490
|
contentUpdate: (t) => {
|
|
491
|
-
u(t),
|
|
491
|
+
u(t), f(s + 1);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
})(n);
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
var t,
|
|
498
|
-
const n = (
|
|
496
|
+
function y() {
|
|
497
|
+
var t, i;
|
|
498
|
+
const n = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.jsCode;
|
|
499
499
|
n && U({
|
|
500
500
|
code: n,
|
|
501
501
|
context: e.context || {},
|
|
502
502
|
localState: void 0,
|
|
503
503
|
rootState: e.builderContextSignal.rootState,
|
|
504
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
504
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
505
|
+
/**
|
|
506
|
+
* We don't want to cache the result of the JS code, since it's arbitrary side effect code.
|
|
507
|
+
*/
|
|
508
|
+
enableCache: !1
|
|
505
509
|
});
|
|
506
510
|
}
|
|
507
|
-
const [
|
|
511
|
+
const [k, Se] = v(() => ({})), [N, G] = v(() => !1);
|
|
508
512
|
function Q(n) {
|
|
509
|
-
var t,
|
|
513
|
+
var t, i;
|
|
510
514
|
if (e.builderContextSignal.content) {
|
|
511
|
-
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (
|
|
515
|
+
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
512
516
|
D({
|
|
513
517
|
type: "click",
|
|
514
518
|
canTrack: V(e.canTrack),
|
|
@@ -524,35 +528,38 @@ function Ke(e) {
|
|
|
524
528
|
function X(n) {
|
|
525
529
|
return n.replace(
|
|
526
530
|
/{{([^}]+)}}/g,
|
|
527
|
-
(t,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
531
|
+
(t, i) => String(
|
|
532
|
+
U({
|
|
533
|
+
code: i,
|
|
534
|
+
context: e.context || {},
|
|
535
|
+
localState: void 0,
|
|
536
|
+
rootState: e.builderContextSignal.rootState,
|
|
537
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
538
|
+
enableCache: !0
|
|
539
|
+
})
|
|
540
|
+
)
|
|
534
541
|
);
|
|
535
542
|
}
|
|
536
543
|
function Y({ url: n, key: t }) {
|
|
537
|
-
ue(n).then((
|
|
538
|
-
var d,
|
|
544
|
+
ue(n).then((i) => i.json()).then((i) => {
|
|
545
|
+
var d, S;
|
|
539
546
|
const o = {
|
|
540
547
|
...e.builderContextSignal.rootState,
|
|
541
|
-
[t]:
|
|
548
|
+
[t]: i
|
|
542
549
|
};
|
|
543
|
-
(
|
|
544
|
-
}).catch((
|
|
545
|
-
console.error("error fetching dynamic data", n,
|
|
550
|
+
(S = (d = e.builderContextSignal).rootSetState) == null || S.call(d, o), k[t] = !0;
|
|
551
|
+
}).catch((i) => {
|
|
552
|
+
console.error("error fetching dynamic data", n, i);
|
|
546
553
|
});
|
|
547
554
|
}
|
|
548
555
|
function B() {
|
|
549
|
-
var t,
|
|
550
|
-
const n = ((
|
|
556
|
+
var t, i;
|
|
557
|
+
const n = ((i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) ?? {};
|
|
551
558
|
Object.entries(n).forEach(([o, d]) => {
|
|
552
|
-
if (d && (!
|
|
553
|
-
const
|
|
559
|
+
if (d && (!k[o] || w())) {
|
|
560
|
+
const S = X(d);
|
|
554
561
|
Y({
|
|
555
|
-
url:
|
|
562
|
+
url: S,
|
|
556
563
|
key: o
|
|
557
564
|
});
|
|
558
565
|
}
|
|
@@ -574,7 +581,7 @@ function Ke(e) {
|
|
|
574
581
|
);
|
|
575
582
|
}
|
|
576
583
|
function L(n) {
|
|
577
|
-
|
|
584
|
+
f(s + 1), window.addEventListener("message", m), le(), oe({
|
|
578
585
|
...e.locale ? {
|
|
579
586
|
locale: e.locale
|
|
580
587
|
} : {},
|
|
@@ -588,46 +595,46 @@ function Ke(e) {
|
|
|
588
595
|
e.builderContextSignal.componentInfos
|
|
589
596
|
).forEach((t) => {
|
|
590
597
|
var o;
|
|
591
|
-
const
|
|
592
|
-
(o = window.parent) == null || o.postMessage(
|
|
598
|
+
const i = de(t);
|
|
599
|
+
(o = window.parent) == null || o.postMessage(i, "*");
|
|
593
600
|
}), window.addEventListener(
|
|
594
601
|
"builder:component:stateChangeListenerActivated",
|
|
595
602
|
I
|
|
596
603
|
);
|
|
597
604
|
}
|
|
598
605
|
function j(n) {
|
|
599
|
-
const t = new URL(location.href).searchParams,
|
|
600
|
-
`builder.preview.${
|
|
606
|
+
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
607
|
+
`builder.preview.${i}`
|
|
601
608
|
), d = t.get("apiKey") || t.get("builder.space");
|
|
602
|
-
|
|
609
|
+
i === e.model && d === e.apiKey && (!e.content || o === e.content.id) && se({
|
|
603
610
|
model: e.model,
|
|
604
611
|
apiKey: e.apiKey,
|
|
605
612
|
apiVersion: e.builderContextSignal.apiVersion
|
|
606
|
-
}).then((
|
|
607
|
-
|
|
613
|
+
}).then((S) => {
|
|
614
|
+
S && u(S);
|
|
608
615
|
});
|
|
609
616
|
}
|
|
610
|
-
const Z =
|
|
617
|
+
const Z = he();
|
|
611
618
|
return b(() => {
|
|
612
619
|
var n;
|
|
613
|
-
return (n =
|
|
620
|
+
return (n = a.current) == null || n.addEventListener(
|
|
614
621
|
"initeditingbldr",
|
|
615
622
|
L
|
|
616
623
|
), () => {
|
|
617
624
|
var t;
|
|
618
|
-
return (t =
|
|
625
|
+
return (t = a.current) == null ? void 0 : t.removeEventListener(
|
|
619
626
|
"initeditingbldr",
|
|
620
627
|
L
|
|
621
628
|
);
|
|
622
629
|
};
|
|
623
630
|
}, []), b(() => {
|
|
624
631
|
var n;
|
|
625
|
-
return (n =
|
|
632
|
+
return (n = a.current) == null || n.addEventListener(
|
|
626
633
|
"initpreviewingbldr",
|
|
627
634
|
j
|
|
628
635
|
), () => {
|
|
629
636
|
var t;
|
|
630
|
-
return (t =
|
|
637
|
+
return (t = a.current) == null ? void 0 : t.removeEventListener(
|
|
631
638
|
"initpreviewingbldr",
|
|
632
639
|
j
|
|
633
640
|
);
|
|
@@ -635,13 +642,13 @@ function Ke(e) {
|
|
|
635
642
|
}, []), b(() => {
|
|
636
643
|
var n, t;
|
|
637
644
|
if (P()) {
|
|
638
|
-
if (w() &&
|
|
639
|
-
const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id,
|
|
645
|
+
if (w() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
|
|
646
|
+
const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, S = e.apiKey;
|
|
640
647
|
D({
|
|
641
648
|
type: "impression",
|
|
642
649
|
canTrack: !0,
|
|
643
650
|
contentId: d,
|
|
644
|
-
apiKey:
|
|
651
|
+
apiKey: S,
|
|
645
652
|
variationId: o !== d ? o : void 0
|
|
646
653
|
});
|
|
647
654
|
}
|
|
@@ -650,12 +657,12 @@ function Ke(e) {
|
|
|
650
657
|
}, []), b(() => {
|
|
651
658
|
e.apiKey || ne.error(
|
|
652
659
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
653
|
-
),
|
|
660
|
+
), y(), B(), I();
|
|
654
661
|
}, []), b(() => {
|
|
655
662
|
}, [e.content]), b(() => {
|
|
656
663
|
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
657
|
-
}, [
|
|
658
|
-
|
|
664
|
+
}, [h]), b(() => {
|
|
665
|
+
y();
|
|
659
666
|
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), b(() => {
|
|
660
667
|
B();
|
|
661
668
|
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
|
|
@@ -671,11 +678,11 @@ function Ke(e) {
|
|
|
671
678
|
"builder:component:stateChangeListenerActivated",
|
|
672
679
|
I
|
|
673
680
|
));
|
|
674
|
-
}, []), /* @__PURE__ */
|
|
681
|
+
}, []), /* @__PURE__ */ c(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ ge(
|
|
675
682
|
g,
|
|
676
683
|
{
|
|
677
684
|
key: s,
|
|
678
|
-
ref:
|
|
685
|
+
ref: a,
|
|
679
686
|
onClick: (n) => Q(n),
|
|
680
687
|
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
681
688
|
"builder-model": e.model,
|
|
@@ -687,7 +694,7 @@ function Ke(e) {
|
|
|
687
694
|
className: `variant-${((M = e.content) == null ? void 0 : M.testVariationId) || ((_ = e.content) == null ? void 0 : _.id)}`
|
|
688
695
|
},
|
|
689
696
|
e.children
|
|
690
|
-
)
|
|
697
|
+
) : null });
|
|
691
698
|
}
|
|
692
699
|
export {
|
|
693
700
|
Ee as B,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-eca4b0ba.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|