@builder.io/sdk-react-nextjs 0.12.6 → 0.12.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/lib/browser/{USE_CLIENT_BUNDLE-4d4e23b4.js → USE_CLIENT_BUNDLE-164b0828.js} +193 -195
- package/lib/browser/USE_CLIENT_BUNDLE-a350a268.cjs +21 -0
- package/lib/{edge/USE_SERVER_BUNDLE-fda604b6.js → browser/USE_SERVER_BUNDLE-5219d3fc.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-19879780.cjs → browser/USE_SERVER_BUNDLE-b1e8364e.cjs} +1 -1
- package/lib/browser/{bundle-6e21e129.cjs → bundle-f375f07b.cjs} +21 -21
- package/lib/browser/{bundle-b3104268.js → bundle-f83a1ca5.js} +537 -447
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +23 -22
- package/lib/{node/USE_CLIENT_BUNDLE-aa8ab44a.js → edge/USE_CLIENT_BUNDLE-b8d07605.js} +193 -195
- package/lib/edge/USE_CLIENT_BUNDLE-f1ccd54b.cjs +21 -0
- package/lib/{node/USE_SERVER_BUNDLE-cbcb1baf.cjs → edge/USE_SERVER_BUNDLE-2e4c0a0a.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-2fdc522e.js → edge/USE_SERVER_BUNDLE-cd7a6238.js} +1 -1
- package/lib/edge/{bundle-ee1ebe27.js → bundle-3da03df6.js} +574 -484
- package/lib/edge/{bundle-f2d4a6db.cjs → bundle-5b207761.cjs} +29 -29
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +23 -22
- package/lib/{edge/USE_CLIENT_BUNDLE-41ee32e4.js → node/USE_CLIENT_BUNDLE-e0108fb4.js} +193 -195
- package/lib/node/USE_CLIENT_BUNDLE-e31c74cc.cjs +21 -0
- package/lib/{browser/USE_SERVER_BUNDLE-ccca985e.cjs → node/USE_SERVER_BUNDLE-29398256.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-2bf0dc28.js → node/USE_SERVER_BUNDLE-3e951ab1.js} +1 -1
- package/lib/node/{bundle-99e5b33f.js → bundle-6c5cef2d.js} +268 -178
- package/lib/node/{bundle-c799b7fc.cjs → bundle-83186530.cjs} +9 -9
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +23 -22
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +5 -0
- package/types/cjs/components/content-variants/helpers.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/cjs/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/cjs/server-index.d.ts +18 -3
- package/types/cjs/types/builder-block.d.ts +18 -1
- package/types/esm/components/block/animator.d.ts +5 -0
- package/types/esm/components/content-variants/helpers.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/esm/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/esm/server-index.d.ts +18 -3
- package/types/esm/types/builder-block.d.ts +18 -1
- package/lib/browser/USE_CLIENT_BUNDLE-e5d64246.cjs +0 -21
- package/lib/edge/USE_CLIENT_BUNDLE-cc55e91d.cjs +0 -21
- package/lib/node/USE_CLIENT_BUNDLE-343cb348.cjs +0 -21
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
-
import { i as p, g as
|
|
4
|
-
import { useRef as T, useState as x, useEffect as
|
|
5
|
-
import { p 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-3da03df6.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as b, createContext as me, createElement as ge } from "react";
|
|
5
|
+
import { p as he } from "./USE_SERVER_BUNDLE-cd7a6238.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function we(e) {
|
|
11
11
|
return /* @__PURE__ */ i(
|
|
12
12
|
J,
|
|
13
13
|
{
|
|
14
14
|
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
15
15
|
attributes: {
|
|
16
16
|
...e.attributes,
|
|
17
|
-
[
|
|
17
|
+
[H()]: `${e.link ? "" : "builder-button"} ${e.attributes[H()] || ""}`,
|
|
18
18
|
...e.link ? {
|
|
19
19
|
href: e.link,
|
|
20
20
|
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
@@ -28,7 +28,7 @@ function Ce(e) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ee(e) {
|
|
32
32
|
return /* @__PURE__ */ i(
|
|
33
33
|
J,
|
|
34
34
|
{
|
|
@@ -49,7 +49,7 @@ function we(e) {
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Ie(e) {
|
|
53
53
|
return /* @__PURE__ */ i(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
@@ -71,14 +71,14 @@ function Ee(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Re(e) {
|
|
75
75
|
function c() {
|
|
76
|
-
var
|
|
77
|
-
return "builder-blocks" + ((
|
|
76
|
+
var r;
|
|
77
|
+
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
78
78
|
}
|
|
79
79
|
function s() {
|
|
80
|
-
var
|
|
81
|
-
w() && !((
|
|
80
|
+
var r, u;
|
|
81
|
+
w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
|
|
82
82
|
{
|
|
83
83
|
type: "builder.clickEmptyBlocks",
|
|
84
84
|
data: {
|
|
@@ -89,9 +89,9 @@ function Ie(e) {
|
|
|
89
89
|
"*"
|
|
90
90
|
));
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
var
|
|
94
|
-
w() && !((
|
|
92
|
+
function S() {
|
|
93
|
+
var r, u;
|
|
94
|
+
w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
|
|
95
95
|
{
|
|
96
96
|
type: "builder.hoverEmptyBlocks",
|
|
97
97
|
data: {
|
|
@@ -110,9 +110,9 @@ function Ie(e) {
|
|
|
110
110
|
"builder-path": e.path,
|
|
111
111
|
"builder-parent-id": e.parent,
|
|
112
112
|
style: e.styleProp,
|
|
113
|
-
onClick: (
|
|
114
|
-
onMouseEnter: (
|
|
115
|
-
onKeyPress: (
|
|
113
|
+
onClick: (r) => s(),
|
|
114
|
+
onMouseEnter: (r) => S(),
|
|
115
|
+
onKeyPress: (r) => s(),
|
|
116
116
|
...e.BlocksWrapperProps,
|
|
117
117
|
children: e.children
|
|
118
118
|
}
|
|
@@ -124,38 +124,38 @@ function Ie(e) {
|
|
|
124
124
|
}` })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Pe(e) {
|
|
128
128
|
return /* @__PURE__ */ i("span", { children: e.children });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
var
|
|
130
|
+
function Te(e) {
|
|
131
|
+
var r, u, f, y;
|
|
132
132
|
function c() {
|
|
133
133
|
var m;
|
|
134
|
-
const
|
|
135
|
-
if (!
|
|
134
|
+
const l = e.image || e.src;
|
|
135
|
+
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
136
136
|
// images, otherwise you can supply this prop manually
|
|
137
|
-
!(
|
|
137
|
+
!(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
|
|
138
138
|
return e.srcset;
|
|
139
139
|
if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
|
|
140
140
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
141
|
-
return console.debug("Removed given srcset"), R(
|
|
141
|
+
return console.debug("Removed given srcset"), R(l);
|
|
142
142
|
} else if (e.image && !e.srcset)
|
|
143
|
-
return R(
|
|
144
|
-
return R(
|
|
143
|
+
return R(l);
|
|
144
|
+
return R(l);
|
|
145
145
|
}
|
|
146
146
|
function s() {
|
|
147
|
-
var
|
|
148
|
-
return (
|
|
147
|
+
var g;
|
|
148
|
+
return (g = c == null ? void 0 : c()) != null && g.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
150
|
+
function S() {
|
|
151
|
+
const g = {
|
|
152
152
|
position: "absolute",
|
|
153
153
|
height: "100%",
|
|
154
154
|
width: "100%",
|
|
155
155
|
left: "0px",
|
|
156
156
|
top: "0px"
|
|
157
157
|
};
|
|
158
|
-
return e.aspectRatio ?
|
|
158
|
+
return e.aspectRatio ? g : void 0;
|
|
159
159
|
}
|
|
160
160
|
return /* @__PURE__ */ E(h, { children: [
|
|
161
161
|
/* @__PURE__ */ E(h, { children: [
|
|
@@ -170,7 +170,7 @@ function Pe(e) {
|
|
|
170
170
|
style: {
|
|
171
171
|
objectPosition: e.backgroundPosition || "center",
|
|
172
172
|
objectFit: e.backgroundSize || "cover",
|
|
173
|
-
...
|
|
173
|
+
...S()
|
|
174
174
|
},
|
|
175
175
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
|
|
176
176
|
src: e.image,
|
|
@@ -179,7 +179,7 @@ function Pe(e) {
|
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
e.aspectRatio && !((u = (
|
|
182
|
+
e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
185
|
className: "builder-image-sizer div-40c70c9b",
|
|
@@ -188,7 +188,7 @@ function Pe(e) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
) }) : null,
|
|
191
|
-
(y = (
|
|
191
|
+
(y = (f = e.builderBlock) == null ? void 0 : f.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
|
|
192
192
|
!e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
193
193
|
] }),
|
|
194
194
|
/* @__PURE__ */ i("style", { children: `.img-40c70c9b {
|
|
@@ -210,7 +210,7 @@ function Pe(e) {
|
|
|
210
210
|
}` })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Ne(e) {
|
|
214
214
|
return /* @__PURE__ */ i(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
@@ -231,30 +231,30 @@ function Te(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const c = T(null), [s,
|
|
236
|
-
return
|
|
234
|
+
function Be(e) {
|
|
235
|
+
const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []);
|
|
236
|
+
return b(() => {
|
|
237
237
|
var y;
|
|
238
238
|
if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
|
|
239
239
|
return;
|
|
240
|
-
const
|
|
241
|
-
for (let
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
if (s.includes(
|
|
240
|
+
const f = c.current.getElementsByTagName("script");
|
|
241
|
+
for (let g = 0; g < f.length; g++) {
|
|
242
|
+
const l = f[g];
|
|
243
|
+
if (l.src) {
|
|
244
|
+
if (s.includes(l.src))
|
|
245
245
|
continue;
|
|
246
|
-
s.push(
|
|
246
|
+
s.push(l.src);
|
|
247
247
|
const m = document.createElement("script");
|
|
248
|
-
m.async = !0, m.src =
|
|
249
|
-
} else if (!
|
|
248
|
+
m.async = !0, m.src = l.src, document.head.appendChild(m);
|
|
249
|
+
} else if (!l.type || [
|
|
250
250
|
"text/javascript",
|
|
251
251
|
"application/javascript",
|
|
252
252
|
"application/ecmascript"
|
|
253
|
-
].includes(
|
|
254
|
-
if (
|
|
253
|
+
].includes(l.type)) {
|
|
254
|
+
if (r.includes(l.innerText))
|
|
255
255
|
continue;
|
|
256
256
|
try {
|
|
257
|
-
|
|
257
|
+
r.push(l.innerText), new Function(l.innerText)();
|
|
258
258
|
} catch (m) {
|
|
259
259
|
console.warn("`CustomCode`: Error running script:", m);
|
|
260
260
|
}
|
|
@@ -269,29 +269,29 @@ function Ne(e) {
|
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
const c = T(null), [s,
|
|
274
|
-
function
|
|
272
|
+
function Le(e) {
|
|
273
|
+
const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []), [f, y] = x(() => !1);
|
|
274
|
+
function g() {
|
|
275
275
|
if (!c.current || !c.current.getElementsByTagName)
|
|
276
276
|
return;
|
|
277
|
-
const
|
|
278
|
-
for (let m = 0; m <
|
|
279
|
-
const k =
|
|
277
|
+
const l = c.current.getElementsByTagName("script");
|
|
278
|
+
for (let m = 0; m < l.length; m++) {
|
|
279
|
+
const k = l[m];
|
|
280
280
|
if (k.src && !s.includes(k.src)) {
|
|
281
281
|
s.push(k.src);
|
|
282
282
|
const C = document.createElement("script");
|
|
283
283
|
C.async = !0, C.src = k.src, document.head.appendChild(C);
|
|
284
|
-
} else if (ee(k) && !
|
|
284
|
+
} else if (ee(k) && !r.includes(k.innerText))
|
|
285
285
|
try {
|
|
286
|
-
|
|
286
|
+
r.push(k.innerText), new Function(k.innerText)();
|
|
287
287
|
} catch (C) {
|
|
288
288
|
console.warn("`Embed`: Error running script:", C);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
return
|
|
293
|
-
c.current && !
|
|
294
|
-
}, [c.current,
|
|
292
|
+
return b(() => {
|
|
293
|
+
c.current && !f && (y(!0), g());
|
|
294
|
+
}, [c.current, f]), /* @__PURE__ */ i(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: "builder-embed",
|
|
@@ -300,7 +300,7 @@ function Be(e) {
|
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function je(e) {
|
|
304
304
|
return /* @__PURE__ */ i(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
@@ -315,8 +315,8 @@ function Le(e) {
|
|
|
315
315
|
w() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
var
|
|
318
|
+
function We(e) {
|
|
319
|
+
var S, r, u, f, y, g, l;
|
|
320
320
|
function c() {
|
|
321
321
|
return {
|
|
322
322
|
...e.autoPlay === !0 ? {
|
|
@@ -357,7 +357,7 @@ function je(e) {
|
|
|
357
357
|
style: {
|
|
358
358
|
width: "100%",
|
|
359
359
|
height: "100%",
|
|
360
|
-
...(
|
|
360
|
+
...(S = e.attributes) == null ? void 0 : S.style,
|
|
361
361
|
objectFit: e.fit,
|
|
362
362
|
objectPosition: e.position,
|
|
363
363
|
// Hack to get object fit to work as expected and
|
|
@@ -373,7 +373,7 @@ function je(e) {
|
|
|
373
373
|
children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
e.aspectRatio && !(e.fitContent && ((u = (
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -384,7 +384,7 @@ function je(e) {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
) }) : null,
|
|
387
|
-
(y = (
|
|
387
|
+
(y = (f = e.builderBlock) == null ? void 0 : f.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
390
|
style: {
|
|
@@ -395,7 +395,7 @@ function je(e) {
|
|
|
395
395
|
children: e.children
|
|
396
396
|
}
|
|
397
397
|
) }) : null,
|
|
398
|
-
(
|
|
398
|
+
(l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
401
401
|
style: {
|
|
@@ -416,7 +416,7 @@ function je(e) {
|
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const fe = me({
|
|
420
420
|
content: null,
|
|
421
421
|
context: {},
|
|
422
422
|
localState: void 0,
|
|
@@ -430,103 +430,101 @@ const he = ue({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var W,
|
|
435
|
-
const c = T(null), [s,
|
|
433
|
+
function Ke(e) {
|
|
434
|
+
var W, K, A, F, z, M, _;
|
|
435
|
+
const c = T(null), [s, S] = x(() => 0);
|
|
436
436
|
x(() => !0);
|
|
437
|
-
function
|
|
438
|
-
var a,
|
|
439
|
-
const
|
|
437
|
+
function r(n) {
|
|
438
|
+
var a, o;
|
|
439
|
+
const t = {
|
|
440
440
|
...e.builderContextSignal.rootState,
|
|
441
|
-
...
|
|
441
|
+
...n
|
|
442
442
|
};
|
|
443
|
-
e.builderContextSignal.rootSetState ? (
|
|
443
|
+
e.builderContextSignal.rootSetState ? (o = (a = e.builderContextSignal).rootSetState) == null || o.call(a, t) : e.builderContextSignal.rootState = t;
|
|
444
444
|
}
|
|
445
|
-
function u(
|
|
446
|
-
var a,
|
|
447
|
-
const
|
|
445
|
+
function u(n) {
|
|
446
|
+
var a, o, d, v, q;
|
|
447
|
+
const t = {
|
|
448
448
|
...e.builderContextSignal.content,
|
|
449
|
-
...
|
|
449
|
+
...n,
|
|
450
450
|
data: {
|
|
451
451
|
...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
|
|
452
|
-
...
|
|
452
|
+
...n == null ? void 0 : n.data
|
|
453
453
|
},
|
|
454
454
|
meta: {
|
|
455
|
-
...(
|
|
456
|
-
...
|
|
457
|
-
breakpoints: ((d =
|
|
455
|
+
...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
|
|
456
|
+
...n == null ? void 0 : n.meta,
|
|
457
|
+
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (v = e.builderContextSignal.content) == null ? void 0 : v.meta) == null ? void 0 : q.breakpoints)
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
|
-
|
|
461
|
-
value:
|
|
462
|
-
key:
|
|
460
|
+
he({
|
|
461
|
+
value: t,
|
|
462
|
+
key: t.id
|
|
463
463
|
}).then(() => {
|
|
464
464
|
Z.refresh();
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
x(() => 0);
|
|
468
|
-
const [
|
|
468
|
+
const [f, y] = x(
|
|
469
469
|
() => !1
|
|
470
|
-
), [
|
|
470
|
+
), [g, l] = x(
|
|
471
471
|
() => e.contentWrapper || "div"
|
|
472
472
|
);
|
|
473
|
-
function m(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
|
|
483
|
-
return;
|
|
484
|
-
d && u({
|
|
473
|
+
function m(n) {
|
|
474
|
+
return ie({
|
|
475
|
+
model: e.model,
|
|
476
|
+
trustedHosts: e.trustedHosts,
|
|
477
|
+
callbacks: {
|
|
478
|
+
configureSdk: (t) => {
|
|
479
|
+
var d;
|
|
480
|
+
const { breakpoints: a, contentId: o } = t;
|
|
481
|
+
!o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || a && (u({
|
|
485
482
|
meta: {
|
|
486
|
-
breakpoints:
|
|
483
|
+
breakpoints: a
|
|
487
484
|
}
|
|
488
|
-
}),
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
485
|
+
}), S(s + 1));
|
|
486
|
+
},
|
|
487
|
+
animation: (t) => {
|
|
488
|
+
ae(t);
|
|
489
|
+
},
|
|
490
|
+
contentUpdate: (t) => {
|
|
491
|
+
u(t), S(s + 1);
|
|
495
492
|
}
|
|
496
493
|
}
|
|
494
|
+
})(n);
|
|
497
495
|
}
|
|
498
496
|
function k() {
|
|
499
|
-
var
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
code:
|
|
497
|
+
var t, a;
|
|
498
|
+
const n = (a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.jsCode;
|
|
499
|
+
n && U({
|
|
500
|
+
code: n,
|
|
503
501
|
context: e.context || {},
|
|
504
502
|
localState: void 0,
|
|
505
503
|
rootState: e.builderContextSignal.rootState,
|
|
506
504
|
rootSetState: e.builderContextSignal.rootSetState
|
|
507
505
|
});
|
|
508
506
|
}
|
|
509
|
-
const [C,
|
|
510
|
-
function Q(
|
|
511
|
-
var
|
|
507
|
+
const [C, Se] = x(() => ({})), [N, G] = x(() => !1);
|
|
508
|
+
function Q(n) {
|
|
509
|
+
var t, a;
|
|
512
510
|
if (e.builderContextSignal.content) {
|
|
513
|
-
const
|
|
514
|
-
|
|
511
|
+
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
|
|
512
|
+
D({
|
|
515
513
|
type: "click",
|
|
516
|
-
canTrack:
|
|
514
|
+
canTrack: V(e.canTrack),
|
|
517
515
|
contentId: d,
|
|
518
516
|
apiKey: e.apiKey,
|
|
519
|
-
variationId:
|
|
520
|
-
...
|
|
517
|
+
variationId: o !== d ? o : void 0,
|
|
518
|
+
...ce(n),
|
|
521
519
|
unique: !N
|
|
522
520
|
});
|
|
523
521
|
}
|
|
524
522
|
N || G(!0);
|
|
525
523
|
}
|
|
526
|
-
function X(
|
|
527
|
-
return
|
|
524
|
+
function X(n) {
|
|
525
|
+
return n.replace(
|
|
528
526
|
/{{([^}]+)}}/g,
|
|
529
|
-
(
|
|
527
|
+
(t, a) => U({
|
|
530
528
|
code: a,
|
|
531
529
|
context: e.context || {},
|
|
532
530
|
localState: void 0,
|
|
@@ -535,27 +533,27 @@ function We(e) {
|
|
|
535
533
|
})
|
|
536
534
|
);
|
|
537
535
|
}
|
|
538
|
-
function Y({ url:
|
|
539
|
-
|
|
540
|
-
var d,
|
|
541
|
-
const
|
|
536
|
+
function Y({ url: n, key: t }) {
|
|
537
|
+
ue(n).then((a) => a.json()).then((a) => {
|
|
538
|
+
var d, v;
|
|
539
|
+
const o = {
|
|
542
540
|
...e.builderContextSignal.rootState,
|
|
543
|
-
[
|
|
541
|
+
[t]: a
|
|
544
542
|
};
|
|
545
|
-
(
|
|
543
|
+
(v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), C[t] = !0;
|
|
546
544
|
}).catch((a) => {
|
|
547
|
-
console.error("error fetching dynamic data",
|
|
545
|
+
console.error("error fetching dynamic data", n, a);
|
|
548
546
|
});
|
|
549
547
|
}
|
|
550
548
|
function B() {
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
Object.entries(
|
|
554
|
-
if (d && (!C[
|
|
555
|
-
const
|
|
549
|
+
var t, a;
|
|
550
|
+
const n = ((a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.httpRequests) ?? {};
|
|
551
|
+
Object.entries(n).forEach(([o, d]) => {
|
|
552
|
+
if (d && (!C[o] || w())) {
|
|
553
|
+
const v = X(d);
|
|
556
554
|
Y({
|
|
557
|
-
url:
|
|
558
|
-
key:
|
|
555
|
+
url: v,
|
|
556
|
+
key: o
|
|
559
557
|
});
|
|
560
558
|
}
|
|
561
559
|
});
|
|
@@ -566,7 +564,7 @@ function We(e) {
|
|
|
566
564
|
"builder:component:stateChange",
|
|
567
565
|
{
|
|
568
566
|
detail: {
|
|
569
|
-
state:
|
|
567
|
+
state: re(e.builderContextSignal.rootState),
|
|
570
568
|
ref: {
|
|
571
569
|
name: e.model
|
|
572
570
|
}
|
|
@@ -575,8 +573,8 @@ function We(e) {
|
|
|
575
573
|
)
|
|
576
574
|
);
|
|
577
575
|
}
|
|
578
|
-
function L(
|
|
579
|
-
|
|
576
|
+
function L(n) {
|
|
577
|
+
S(s + 1), window.addEventListener("message", m), le(), oe({
|
|
580
578
|
...e.locale ? {
|
|
581
579
|
locale: e.locale
|
|
582
580
|
} : {},
|
|
@@ -591,97 +589,97 @@ function We(e) {
|
|
|
591
589
|
} : {}
|
|
592
590
|
}), Object.values(
|
|
593
591
|
e.builderContextSignal.componentInfos
|
|
594
|
-
).forEach((
|
|
595
|
-
var
|
|
596
|
-
const a =
|
|
597
|
-
(
|
|
592
|
+
).forEach((t) => {
|
|
593
|
+
var o;
|
|
594
|
+
const a = de(t);
|
|
595
|
+
(o = window.parent) == null || o.postMessage(a, "*");
|
|
598
596
|
}), window.addEventListener(
|
|
599
597
|
"builder:component:stateChangeListenerActivated",
|
|
600
598
|
I
|
|
601
599
|
);
|
|
602
600
|
}
|
|
603
|
-
function j(
|
|
604
|
-
const
|
|
601
|
+
function j(n) {
|
|
602
|
+
const t = new URL(location.href).searchParams, a = t.get("builder.preview"), o = t.get(
|
|
605
603
|
`builder.preview.${a}`
|
|
606
|
-
), d =
|
|
607
|
-
a === e.model && d === e.apiKey && (!e.content ||
|
|
604
|
+
), d = t.get("apiKey") || t.get("builder.space");
|
|
605
|
+
a === e.model && d === e.apiKey && (!e.content || o === e.content.id) && se({
|
|
608
606
|
model: e.model,
|
|
609
607
|
apiKey: e.apiKey,
|
|
610
608
|
apiVersion: e.builderContextSignal.apiVersion
|
|
611
|
-
}).then((
|
|
612
|
-
|
|
609
|
+
}).then((v) => {
|
|
610
|
+
v && u(v);
|
|
613
611
|
});
|
|
614
612
|
}
|
|
615
613
|
const Z = be();
|
|
616
|
-
return
|
|
617
|
-
var
|
|
618
|
-
return (
|
|
614
|
+
return b(() => {
|
|
615
|
+
var n;
|
|
616
|
+
return (n = c.current) == null || n.addEventListener(
|
|
619
617
|
"initeditingbldr",
|
|
620
618
|
L
|
|
621
619
|
), () => {
|
|
622
|
-
var
|
|
623
|
-
return (
|
|
620
|
+
var t;
|
|
621
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
624
622
|
"initeditingbldr",
|
|
625
623
|
L
|
|
626
624
|
);
|
|
627
625
|
};
|
|
628
|
-
}, []),
|
|
629
|
-
var
|
|
630
|
-
return (
|
|
626
|
+
}, []), b(() => {
|
|
627
|
+
var n;
|
|
628
|
+
return (n = c.current) == null || n.addEventListener(
|
|
631
629
|
"initpreviewingbldr",
|
|
632
630
|
j
|
|
633
631
|
), () => {
|
|
634
|
-
var
|
|
635
|
-
return (
|
|
632
|
+
var t;
|
|
633
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
636
634
|
"initpreviewingbldr",
|
|
637
635
|
j
|
|
638
636
|
);
|
|
639
637
|
};
|
|
640
|
-
}, []),
|
|
641
|
-
var
|
|
638
|
+
}, []), b(() => {
|
|
639
|
+
var n, t;
|
|
642
640
|
if (P()) {
|
|
643
|
-
if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content &&
|
|
644
|
-
const
|
|
645
|
-
|
|
641
|
+
if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
|
|
642
|
+
const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, v = e.apiKey;
|
|
643
|
+
D({
|
|
646
644
|
type: "impression",
|
|
647
645
|
canTrack: !0,
|
|
648
646
|
contentId: d,
|
|
649
|
-
apiKey:
|
|
650
|
-
variationId:
|
|
647
|
+
apiKey: v,
|
|
648
|
+
variationId: o !== d ? o : void 0
|
|
651
649
|
});
|
|
652
650
|
}
|
|
653
651
|
te() && c.current;
|
|
654
652
|
}
|
|
655
|
-
}, []),
|
|
653
|
+
}, []), b(() => {
|
|
656
654
|
e.apiKey || ne.error(
|
|
657
655
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
658
656
|
), k(), B(), I();
|
|
659
|
-
}, []),
|
|
660
|
-
}, [e.content]),
|
|
657
|
+
}, []), b(() => {
|
|
658
|
+
}, [e.content]), b(() => {
|
|
661
659
|
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
662
|
-
}, [
|
|
660
|
+
}, [f]), b(() => {
|
|
663
661
|
k();
|
|
664
|
-
}, [(
|
|
662
|
+
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), b(() => {
|
|
665
663
|
B();
|
|
666
|
-
}, [(
|
|
664
|
+
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
|
|
667
665
|
I();
|
|
668
|
-
}, [e.builderContextSignal.rootState]),
|
|
669
|
-
e.data &&
|
|
670
|
-
}, [e.data]),
|
|
671
|
-
e.locale &&
|
|
666
|
+
}, [e.builderContextSignal.rootState]), b(() => {
|
|
667
|
+
e.data && r(e.data);
|
|
668
|
+
}, [e.data]), b(() => {
|
|
669
|
+
e.locale && r({
|
|
672
670
|
locale: e.locale
|
|
673
671
|
});
|
|
674
|
-
}, [e.locale]),
|
|
672
|
+
}, [e.locale]), b(() => () => {
|
|
675
673
|
P() && (window.removeEventListener("message", m), window.removeEventListener(
|
|
676
674
|
"builder:component:stateChangeListenerActivated",
|
|
677
675
|
I
|
|
678
676
|
));
|
|
679
|
-
}, []), /* @__PURE__ */ i(
|
|
680
|
-
|
|
677
|
+
}, []), /* @__PURE__ */ i(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ ge(
|
|
678
|
+
g,
|
|
681
679
|
{
|
|
682
680
|
key: s,
|
|
683
681
|
ref: c,
|
|
684
|
-
onClick: (
|
|
682
|
+
onClick: (n) => Q(n),
|
|
685
683
|
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
686
684
|
"builder-model": e.model,
|
|
687
685
|
...e.showContent ? {} : {
|
|
@@ -695,17 +693,17 @@ function We(e) {
|
|
|
695
693
|
) }) : null });
|
|
696
694
|
}
|
|
697
695
|
export {
|
|
698
|
-
|
|
699
|
-
|
|
696
|
+
Ee as B,
|
|
697
|
+
Be as C,
|
|
700
698
|
J as D,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
699
|
+
Le as E,
|
|
700
|
+
Pe as F,
|
|
701
|
+
Ie as I,
|
|
702
|
+
Ne as S,
|
|
703
|
+
We as V,
|
|
704
|
+
Re as a,
|
|
705
|
+
we as b,
|
|
706
|
+
Te as c,
|
|
707
|
+
je as d,
|
|
708
|
+
Ke as e
|
|
711
709
|
};
|