@builder.io/sdk-react-nextjs 0.12.3 → 0.12.5
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-64b6ec10.cjs → USE_CLIENT_BUNDLE-70be4cc5.cjs} +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-98a4fbf4.js → browser/USE_CLIENT_BUNDLE-7492ecd8.js} +188 -187
- package/lib/{edge/USE_SERVER_BUNDLE-e79e6b55.cjs → browser/USE_SERVER_BUNDLE-875d4629.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-4e9af8f5.js → browser/USE_SERVER_BUNDLE-fe386ed3.js} +1 -1
- package/lib/browser/bundle-bd9886c9.cjs +168 -0
- package/lib/browser/{bundle-f3e8cd29.js → bundle-f9f52242.js} +594 -526
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +14 -14
- package/lib/{node/USE_CLIENT_BUNDLE-990b655a.cjs → edge/USE_CLIENT_BUNDLE-1148158d.cjs} +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-e89d3175.js → edge/USE_CLIENT_BUNDLE-cb840c0f.js} +188 -187
- package/lib/{node/USE_SERVER_BUNDLE-b231d861.js → edge/USE_SERVER_BUNDLE-36de460d.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-c86a1fb8.cjs → edge/USE_SERVER_BUNDLE-50c2f18b.cjs} +1 -1
- package/lib/edge/{bundle-d4f509a3.cjs → bundle-71cfdd3e.cjs} +33 -37
- package/lib/edge/{bundle-cb191300.js → bundle-765860e3.js} +1051 -983
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +14 -14
- package/lib/{edge/USE_CLIENT_BUNDLE-2aed408a.cjs → node/USE_CLIENT_BUNDLE-2f43c320.cjs} +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-a3258a60.js → node/USE_CLIENT_BUNDLE-4ba4594d.js} +188 -187
- package/lib/{browser/USE_SERVER_BUNDLE-d6bec4ec.js → node/USE_SERVER_BUNDLE-2534ef71.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-f34c0814.cjs → node/USE_SERVER_BUNDLE-473d50ad.cjs} +1 -1
- package/lib/node/{bundle-b2d68b60.cjs → bundle-1c54df65.cjs} +7 -11
- package/lib/node/{bundle-11daeaca.js → bundle-305bb463.js} +361 -293
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +14 -14
- package/package.json +1 -1
- package/types/cjs/blocks/button/button.types.d.ts +2 -1
- package/types/cjs/blocks/columns/columns.types.d.ts +3 -3
- package/types/cjs/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/cjs/components/block/block.d.ts +1 -0
- package/types/cjs/components/block/components/block-wrapper.d.ts +1 -0
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/cjs/components/block/components/repeated-block.d.ts +3 -5
- package/types/cjs/components/blocks/blocks.types.d.ts +1 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/evaluate/should-force-browser-runtime-in-node.d.ts +1 -0
- package/types/cjs/functions/get-block-properties.d.ts +5 -1
- package/types/cjs/functions/get-class-prop-name.d.ts +1 -0
- package/types/cjs/functions/get-style.d.ts +12 -0
- package/types/cjs/functions/is-node-runtime.d.ts +4 -0
- package/types/cjs/functions/transform-block-properties.d.ts +7 -5
- package/types/cjs/functions/transform-style-property.d.ts +7 -0
- package/types/cjs/types/builder-block.d.ts +1 -0
- package/types/cjs/types/builder-props.d.ts +3 -0
- package/types/esm/blocks/button/button.types.d.ts +2 -1
- package/types/esm/blocks/columns/columns.types.d.ts +3 -3
- package/types/esm/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/esm/components/block/block.d.ts +1 -0
- package/types/esm/components/block/components/block-wrapper.d.ts +1 -0
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/esm/components/block/components/repeated-block.d.ts +3 -5
- package/types/esm/components/blocks/blocks.types.d.ts +1 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.ts +1 -0
- package/types/esm/functions/get-block-properties.d.ts +5 -1
- package/types/esm/functions/get-class-prop-name.d.ts +1 -0
- package/types/esm/functions/get-style.d.ts +12 -0
- package/types/esm/functions/is-node-runtime.d.ts +4 -0
- package/types/esm/functions/transform-block-properties.d.ts +7 -5
- package/types/esm/functions/transform-style-property.d.ts +7 -0
- package/types/esm/types/builder-block.d.ts +1 -0
- package/types/esm/types/builder-props.d.ts +3 -0
- package/lib/browser/bundle-50ff23eb.cjs +0 -172
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { i as
|
|
4
|
-
import { useRef as T, useState as x, useEffect as f, createContext as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
14
|
-
role: "button",
|
|
15
|
-
children: e.text
|
|
16
|
-
}
|
|
17
|
-
) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
18
|
-
"button",
|
|
2
|
+
import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
+
import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, m as U, n as ae, o as ce, r as re, s as le, p as oe, q as de, t as se } from "./bundle-f9f52242.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as f, createContext as ue, createElement as me } from "react";
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-fe386ed3.js";
|
|
6
|
+
import { useRouter as be } from "next/navigation";
|
|
7
|
+
function J(e) {
|
|
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
|
+
}
|
|
10
|
+
function Ce(e) {
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
J,
|
|
19
13
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
15
|
+
attributes: {
|
|
16
|
+
...e.attributes,
|
|
17
|
+
[D()]: `${e.link ? "" : "builder-button"} ${e.attributes[D()] || ""}`,
|
|
18
|
+
...e.link ? {
|
|
19
|
+
href: e.link,
|
|
20
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
21
|
+
role: "link"
|
|
22
|
+
} : {
|
|
23
|
+
role: "button"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
actionAttributes: {},
|
|
24
27
|
children: e.text
|
|
25
28
|
}
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
function ge(e) {
|
|
29
|
-
return /* @__PURE__ */ t(s, { children: Y(e.TagName) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(s, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
29
|
+
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
31
|
+
function we(e) {
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
|
+
J,
|
|
34
34
|
{
|
|
35
35
|
TagName: e.Wrapper,
|
|
36
|
-
attributes:
|
|
36
|
+
attributes: $({
|
|
37
37
|
block: e.block,
|
|
38
38
|
context: e.context
|
|
39
39
|
}),
|
|
@@ -49,13 +49,13 @@ function Ce(e) {
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
function Ee(e) {
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
56
56
|
...e.wrapperProps,
|
|
57
57
|
attributes: e.includeBlockProps ? {
|
|
58
|
-
|
|
58
|
+
...$({
|
|
59
59
|
block: e.block,
|
|
60
60
|
context: e.context
|
|
61
61
|
}),
|
|
@@ -71,14 +71,14 @@ function we(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Ie(e) {
|
|
75
75
|
function c() {
|
|
76
76
|
var l;
|
|
77
77
|
return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var l,
|
|
81
|
-
w() && !((l = e.blocks) != null && l.length) && ((
|
|
79
|
+
function s() {
|
|
80
|
+
var l, u;
|
|
81
|
+
w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
|
|
82
82
|
{
|
|
83
83
|
type: "builder.clickEmptyBlocks",
|
|
84
84
|
data: {
|
|
@@ -90,8 +90,8 @@ function Ee(e) {
|
|
|
90
90
|
));
|
|
91
91
|
}
|
|
92
92
|
function v() {
|
|
93
|
-
var l,
|
|
94
|
-
w() && !((l = e.blocks) != null && l.length) && ((
|
|
93
|
+
var l, u;
|
|
94
|
+
w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
|
|
95
95
|
{
|
|
96
96
|
type: "builder.hoverEmptyBlocks",
|
|
97
97
|
data: {
|
|
@@ -102,48 +102,48 @@ function Ee(e) {
|
|
|
102
102
|
"*"
|
|
103
103
|
));
|
|
104
104
|
}
|
|
105
|
-
return /* @__PURE__ */ E(
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ E(h, { children: [
|
|
106
|
+
/* @__PURE__ */ i(
|
|
107
107
|
e.BlocksWrapper,
|
|
108
108
|
{
|
|
109
109
|
className: c() + " props-blocks-wrapper-4f2c12d8",
|
|
110
110
|
"builder-path": e.path,
|
|
111
111
|
"builder-parent-id": e.parent,
|
|
112
112
|
style: e.styleProp,
|
|
113
|
-
onClick: (l) =>
|
|
113
|
+
onClick: (l) => s(),
|
|
114
114
|
onMouseEnter: (l) => v(),
|
|
115
|
-
onKeyPress: (l) =>
|
|
115
|
+
onKeyPress: (l) => s(),
|
|
116
116
|
...e.BlocksWrapperProps,
|
|
117
117
|
children: e.children
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: column;
|
|
123
123
|
align-items: stretch;
|
|
124
124
|
}` })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function Ie(e) {
|
|
128
|
-
return /* @__PURE__ */ t("span", { children: e.children });
|
|
129
|
-
}
|
|
130
127
|
function Re(e) {
|
|
131
|
-
|
|
128
|
+
return /* @__PURE__ */ i("span", { children: e.children });
|
|
129
|
+
}
|
|
130
|
+
function Pe(e) {
|
|
131
|
+
var l, u, S, y;
|
|
132
132
|
function c() {
|
|
133
|
-
var
|
|
133
|
+
var m;
|
|
134
134
|
const o = e.image || e.src;
|
|
135
135
|
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
136
136
|
// images, otherwise you can supply this prop manually
|
|
137
137
|
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
138
138
|
return e.srcset;
|
|
139
|
-
if (e.srcset && ((
|
|
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
141
|
return console.debug("Removed given srcset"), R(o);
|
|
142
142
|
} else if (e.image && !e.srcset)
|
|
143
143
|
return R(o);
|
|
144
144
|
return R(o);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function s() {
|
|
147
147
|
var b;
|
|
148
148
|
return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
149
149
|
}
|
|
@@ -157,11 +157,11 @@ function Re(e) {
|
|
|
157
157
|
};
|
|
158
158
|
return e.aspectRatio ? b : void 0;
|
|
159
159
|
}
|
|
160
|
-
return /* @__PURE__ */ E(
|
|
161
|
-
/* @__PURE__ */ E(
|
|
160
|
+
return /* @__PURE__ */ E(h, { children: [
|
|
161
|
+
/* @__PURE__ */ E(h, { children: [
|
|
162
162
|
/* @__PURE__ */ E("picture", { children: [
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
164
|
+
/* @__PURE__ */ i(
|
|
165
165
|
"img",
|
|
166
166
|
{
|
|
167
167
|
loading: "lazy",
|
|
@@ -179,7 +179,7 @@ function Re(e) {
|
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
e.aspectRatio && !((
|
|
182
|
+
e.aspectRatio && !((u = (l = e.builderBlock) == null ? void 0 : l.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,10 +188,10 @@ function Re(e) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
) }) : null,
|
|
191
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
192
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
191
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
|
|
192
|
+
!e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i("style", { children: `.img-40c70c9b {
|
|
195
195
|
opacity: 1;
|
|
196
196
|
transition: opacity 0.2s ease-in-out;
|
|
197
197
|
}.div-40c70c9b {
|
|
@@ -210,8 +210,8 @@ function Re(e) {
|
|
|
210
210
|
}` })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return /* @__PURE__ */
|
|
213
|
+
function Te(e) {
|
|
214
|
+
return /* @__PURE__ */ i(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
217
217
|
...e.attributes,
|
|
@@ -231,8 +231,8 @@ function Pe(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const c = T(null), [
|
|
234
|
+
function Ne(e) {
|
|
235
|
+
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
|
|
236
236
|
return f(() => {
|
|
237
237
|
var y;
|
|
238
238
|
if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
|
|
@@ -241,11 +241,11 @@ function Te(e) {
|
|
|
241
241
|
for (let b = 0; b < S.length; b++) {
|
|
242
242
|
const o = S[b];
|
|
243
243
|
if (o.src) {
|
|
244
|
-
if (
|
|
244
|
+
if (s.includes(o.src))
|
|
245
245
|
continue;
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
|
|
246
|
+
s.push(o.src);
|
|
247
|
+
const m = document.createElement("script");
|
|
248
|
+
m.async = !0, m.src = o.src, document.head.appendChild(m);
|
|
249
249
|
} else if (!o.type || [
|
|
250
250
|
"text/javascript",
|
|
251
251
|
"application/javascript",
|
|
@@ -255,12 +255,12 @@ function Te(e) {
|
|
|
255
255
|
continue;
|
|
256
256
|
try {
|
|
257
257
|
l.push(o.innerText), new Function(o.innerText)();
|
|
258
|
-
} catch (
|
|
259
|
-
console.warn("`CustomCode`: Error running script:",
|
|
258
|
+
} catch (m) {
|
|
259
|
+
console.warn("`CustomCode`: Error running script:", m);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
}, []), /* @__PURE__ */
|
|
263
|
+
}, []), /* @__PURE__ */ i(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
266
|
ref: c,
|
|
@@ -269,19 +269,19 @@ function Te(e) {
|
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
const c = T(null), [
|
|
272
|
+
function Be(e) {
|
|
273
|
+
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
|
|
274
274
|
function b() {
|
|
275
275
|
if (!c.current || !c.current.getElementsByTagName)
|
|
276
276
|
return;
|
|
277
277
|
const o = c.current.getElementsByTagName("script");
|
|
278
|
-
for (let
|
|
279
|
-
const k = o[
|
|
280
|
-
if (k.src && !
|
|
281
|
-
|
|
278
|
+
for (let m = 0; m < o.length; m++) {
|
|
279
|
+
const k = o[m];
|
|
280
|
+
if (k.src && !s.includes(k.src)) {
|
|
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 (
|
|
284
|
+
} else if (ee(k) && !l.includes(k.innerText))
|
|
285
285
|
try {
|
|
286
286
|
l.push(k.innerText), new Function(k.innerText)();
|
|
287
287
|
} catch (C) {
|
|
@@ -291,7 +291,7 @@ function Ne(e) {
|
|
|
291
291
|
}
|
|
292
292
|
return f(() => {
|
|
293
293
|
c.current && !S && (y(!0), b());
|
|
294
|
-
}, [c.current, S]), /* @__PURE__ */
|
|
294
|
+
}, [c.current, S]), /* @__PURE__ */ i(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: "builder-embed",
|
|
@@ -300,8 +300,8 @@ function Ne(e) {
|
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */
|
|
303
|
+
function Le(e) {
|
|
304
|
+
return /* @__PURE__ */ i(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
307
307
|
style: {
|
|
@@ -315,8 +315,8 @@ function Be(e) {
|
|
|
315
315
|
w() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
var v, l,
|
|
318
|
+
function je(e) {
|
|
319
|
+
var v, l, u, S, y, b, o;
|
|
320
320
|
function c() {
|
|
321
321
|
return {
|
|
322
322
|
...e.autoPlay === !0 ? {
|
|
@@ -336,7 +336,7 @@ function Le(e) {
|
|
|
336
336
|
} : {}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function s() {
|
|
340
340
|
return {
|
|
341
341
|
...c()
|
|
342
342
|
};
|
|
@@ -348,11 +348,11 @@ function Le(e) {
|
|
|
348
348
|
position: "relative"
|
|
349
349
|
},
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ i(
|
|
352
352
|
"video",
|
|
353
353
|
{
|
|
354
354
|
className: "builder-video",
|
|
355
|
-
...
|
|
355
|
+
...s(),
|
|
356
356
|
preload: e.preload || "metadata",
|
|
357
357
|
style: {
|
|
358
358
|
width: "100%",
|
|
@@ -370,10 +370,10 @@ function Le(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__ */ i("source", { type: "video/mp4", src: e.video })
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -384,7 +384,7 @@ function Le(e) {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
) }) : null,
|
|
387
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
387
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.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 Le(e) {
|
|
|
395
395
|
children: e.children
|
|
396
396
|
}
|
|
397
397
|
) }) : null,
|
|
398
|
-
(o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */
|
|
398
|
+
(o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
401
401
|
style: {
|
|
@@ -416,7 +416,7 @@ function Le(e) {
|
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
const he =
|
|
419
|
+
const he = ue({
|
|
420
420
|
content: null,
|
|
421
421
|
context: {},
|
|
422
422
|
localState: void 0,
|
|
@@ -430,38 +430,38 @@ const he = de({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var W, F, K,
|
|
435
|
-
const c = T(null), [
|
|
433
|
+
function We(e) {
|
|
434
|
+
var W, F, K, A, z, M, _;
|
|
435
|
+
const c = T(null), [s, v] = x(() => 0);
|
|
436
436
|
x(() => !0);
|
|
437
|
-
function l(
|
|
437
|
+
function l(t) {
|
|
438
438
|
var a, r;
|
|
439
|
-
const
|
|
439
|
+
const n = {
|
|
440
440
|
...e.builderContextSignal.rootState,
|
|
441
|
-
...
|
|
441
|
+
...t
|
|
442
442
|
};
|
|
443
|
-
e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a,
|
|
443
|
+
e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, n) : e.builderContextSignal.rootState = n;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
var a, r, d,
|
|
447
|
-
const
|
|
445
|
+
function u(t) {
|
|
446
|
+
var a, r, d, g, q;
|
|
447
|
+
const n = {
|
|
448
448
|
...e.builderContextSignal.content,
|
|
449
|
-
...
|
|
449
|
+
...t,
|
|
450
450
|
data: {
|
|
451
451
|
...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
|
|
452
|
-
...
|
|
452
|
+
...t == null ? void 0 : t.data
|
|
453
453
|
},
|
|
454
454
|
meta: {
|
|
455
455
|
...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
|
|
456
|
-
...
|
|
457
|
-
breakpoints: ((d =
|
|
456
|
+
...t == null ? void 0 : t.meta,
|
|
457
|
+
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((q = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : q.breakpoints)
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
|
-
|
|
461
|
-
value:
|
|
462
|
-
key:
|
|
460
|
+
ge({
|
|
461
|
+
value: n,
|
|
462
|
+
key: n.id
|
|
463
463
|
}).then(() => {
|
|
464
|
-
|
|
464
|
+
Z.refresh();
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
x(() => 0);
|
|
@@ -470,63 +470,63 @@ function je(e) {
|
|
|
470
470
|
), [b, o] = x(
|
|
471
471
|
() => e.contentWrapper || "div"
|
|
472
472
|
);
|
|
473
|
-
function
|
|
473
|
+
function m(t) {
|
|
474
474
|
var a;
|
|
475
|
-
if (!
|
|
475
|
+
if (!ie(e.trustedHosts, t))
|
|
476
476
|
return;
|
|
477
|
-
const { data:
|
|
478
|
-
if (
|
|
479
|
-
switch (
|
|
477
|
+
const { data: n } = t;
|
|
478
|
+
if (n)
|
|
479
|
+
switch (n.type) {
|
|
480
480
|
case "builder.configureSdk": {
|
|
481
|
-
const r =
|
|
482
|
-
if (!
|
|
481
|
+
const r = n.data, { breakpoints: d, contentId: g } = r;
|
|
482
|
+
if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
|
|
483
483
|
return;
|
|
484
|
-
d &&
|
|
484
|
+
d && u({
|
|
485
485
|
meta: {
|
|
486
486
|
breakpoints: d
|
|
487
487
|
}
|
|
488
|
-
}), v(
|
|
488
|
+
}), v(s + 1);
|
|
489
489
|
break;
|
|
490
490
|
}
|
|
491
491
|
case "builder.contentUpdate": {
|
|
492
|
-
const r =
|
|
493
|
-
d === e.model && (
|
|
492
|
+
const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
|
|
493
|
+
d === e.model && (u(g), v(s + 1));
|
|
494
494
|
break;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
function k() {
|
|
499
|
-
var
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
code:
|
|
499
|
+
var n, a;
|
|
500
|
+
const t = (a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.jsCode;
|
|
501
|
+
t && U({
|
|
502
|
+
code: t,
|
|
503
503
|
context: e.context || {},
|
|
504
504
|
localState: void 0,
|
|
505
505
|
rootState: e.builderContextSignal.rootState,
|
|
506
506
|
rootSetState: e.builderContextSignal.rootSetState
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
|
-
const [C,
|
|
510
|
-
function
|
|
511
|
-
var
|
|
509
|
+
const [C, fe] = x(() => ({})), [N, G] = x(() => !1);
|
|
510
|
+
function Q(t) {
|
|
511
|
+
var n, a;
|
|
512
512
|
if (e.builderContextSignal.content) {
|
|
513
|
-
const r = (
|
|
513
|
+
const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
|
|
514
514
|
V({
|
|
515
515
|
type: "click",
|
|
516
516
|
canTrack: H(e.canTrack),
|
|
517
517
|
contentId: d,
|
|
518
518
|
apiKey: e.apiKey,
|
|
519
519
|
variationId: r !== d ? r : void 0,
|
|
520
|
-
...
|
|
520
|
+
...ae(t),
|
|
521
521
|
unique: !N
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
|
-
N ||
|
|
524
|
+
N || G(!0);
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
return
|
|
526
|
+
function X(t) {
|
|
527
|
+
return t.replace(
|
|
528
528
|
/{{([^}]+)}}/g,
|
|
529
|
-
(
|
|
529
|
+
(n, a) => U({
|
|
530
530
|
code: a,
|
|
531
531
|
context: e.context || {},
|
|
532
532
|
localState: void 0,
|
|
@@ -535,26 +535,26 @@ function je(e) {
|
|
|
535
535
|
})
|
|
536
536
|
);
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
|
|
540
|
-
var d,
|
|
538
|
+
function Y({ url: t, key: n }) {
|
|
539
|
+
se(t).then((a) => a.json()).then((a) => {
|
|
540
|
+
var d, g;
|
|
541
541
|
const r = {
|
|
542
542
|
...e.builderContextSignal.rootState,
|
|
543
|
-
[
|
|
543
|
+
[n]: a
|
|
544
544
|
};
|
|
545
|
-
(
|
|
545
|
+
(g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), C[n] = !0;
|
|
546
546
|
}).catch((a) => {
|
|
547
|
-
console.error("error fetching dynamic data",
|
|
547
|
+
console.error("error fetching dynamic data", t, a);
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function B() {
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
Object.entries(
|
|
551
|
+
var n, a;
|
|
552
|
+
const t = ((a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.httpRequests) ?? {};
|
|
553
|
+
Object.entries(t).forEach(([r, d]) => {
|
|
554
554
|
if (d && (!C[r] || w())) {
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
url:
|
|
555
|
+
const g = X(d);
|
|
556
|
+
Y({
|
|
557
|
+
url: g,
|
|
558
558
|
key: r
|
|
559
559
|
});
|
|
560
560
|
}
|
|
@@ -566,7 +566,7 @@ function je(e) {
|
|
|
566
566
|
"builder:component:stateChange",
|
|
567
567
|
{
|
|
568
568
|
detail: {
|
|
569
|
-
state:
|
|
569
|
+
state: ce(e.builderContextSignal.rootState),
|
|
570
570
|
ref: {
|
|
571
571
|
name: e.model
|
|
572
572
|
}
|
|
@@ -575,8 +575,8 @@ function je(e) {
|
|
|
575
575
|
)
|
|
576
576
|
);
|
|
577
577
|
}
|
|
578
|
-
function L(
|
|
579
|
-
v(
|
|
578
|
+
function L(t) {
|
|
579
|
+
v(s + 1), window.addEventListener("message", m), re(), le({
|
|
580
580
|
...e.locale ? {
|
|
581
581
|
locale: e.locale
|
|
582
582
|
} : {},
|
|
@@ -591,74 +591,74 @@ function je(e) {
|
|
|
591
591
|
} : {}
|
|
592
592
|
}), Object.values(
|
|
593
593
|
e.builderContextSignal.componentInfos
|
|
594
|
-
).forEach((
|
|
594
|
+
).forEach((n) => {
|
|
595
595
|
var r;
|
|
596
|
-
const a =
|
|
596
|
+
const a = oe(n);
|
|
597
597
|
(r = window.parent) == null || r.postMessage(a, "*");
|
|
598
598
|
}), window.addEventListener(
|
|
599
599
|
"builder:component:stateChangeListenerActivated",
|
|
600
600
|
I
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
|
-
function j(
|
|
604
|
-
const
|
|
603
|
+
function j(t) {
|
|
604
|
+
const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
|
|
605
605
|
`builder.preview.${a}`
|
|
606
|
-
), d =
|
|
607
|
-
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) &&
|
|
606
|
+
), d = n.get("apiKey") || n.get("builder.space");
|
|
607
|
+
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && de({
|
|
608
608
|
model: e.model,
|
|
609
609
|
apiKey: e.apiKey,
|
|
610
610
|
apiVersion: e.builderContextSignal.apiVersion
|
|
611
|
-
}).then((
|
|
612
|
-
|
|
611
|
+
}).then((g) => {
|
|
612
|
+
g && u(g);
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
|
-
const
|
|
615
|
+
const Z = be();
|
|
616
616
|
return f(() => {
|
|
617
|
-
var
|
|
618
|
-
return (
|
|
617
|
+
var t;
|
|
618
|
+
return (t = c.current) == null || t.addEventListener(
|
|
619
619
|
"initeditingbldr",
|
|
620
620
|
L
|
|
621
621
|
), () => {
|
|
622
|
-
var
|
|
623
|
-
return (
|
|
622
|
+
var n;
|
|
623
|
+
return (n = c.current) == null ? void 0 : n.removeEventListener(
|
|
624
624
|
"initeditingbldr",
|
|
625
625
|
L
|
|
626
626
|
);
|
|
627
627
|
};
|
|
628
628
|
}, []), f(() => {
|
|
629
|
-
var
|
|
630
|
-
return (
|
|
629
|
+
var t;
|
|
630
|
+
return (t = c.current) == null || t.addEventListener(
|
|
631
631
|
"initpreviewingbldr",
|
|
632
632
|
j
|
|
633
633
|
), () => {
|
|
634
|
-
var
|
|
635
|
-
return (
|
|
634
|
+
var n;
|
|
635
|
+
return (n = c.current) == null ? void 0 : n.removeEventListener(
|
|
636
636
|
"initpreviewingbldr",
|
|
637
637
|
j
|
|
638
638
|
);
|
|
639
639
|
};
|
|
640
640
|
}, []), f(() => {
|
|
641
|
-
var
|
|
641
|
+
var t, n;
|
|
642
642
|
if (P()) {
|
|
643
643
|
if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
|
|
644
|
-
const r = (
|
|
644
|
+
const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, g = e.apiKey;
|
|
645
645
|
V({
|
|
646
646
|
type: "impression",
|
|
647
647
|
canTrack: !0,
|
|
648
648
|
contentId: d,
|
|
649
|
-
apiKey:
|
|
649
|
+
apiKey: g,
|
|
650
650
|
variationId: r !== d ? r : void 0
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
te() && c.current;
|
|
654
654
|
}
|
|
655
655
|
}, []), f(() => {
|
|
656
|
-
e.apiKey ||
|
|
656
|
+
e.apiKey || ne.error(
|
|
657
657
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
658
658
|
), k(), B(), I();
|
|
659
659
|
}, []), f(() => {
|
|
660
660
|
}, [e.content]), f(() => {
|
|
661
|
-
P() && (window.removeEventListener("message",
|
|
661
|
+
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
662
662
|
}, [S]), f(() => {
|
|
663
663
|
k();
|
|
664
664
|
}, [
|
|
@@ -666,7 +666,7 @@ function je(e) {
|
|
|
666
666
|
e.builderContextSignal.rootState
|
|
667
667
|
]), f(() => {
|
|
668
668
|
B();
|
|
669
|
-
}, [(
|
|
669
|
+
}, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
|
|
670
670
|
I();
|
|
671
671
|
}, [e.builderContextSignal.rootState]), f(() => {
|
|
672
672
|
e.data && l(e.data);
|
|
@@ -675,17 +675,17 @@ function je(e) {
|
|
|
675
675
|
locale: e.locale
|
|
676
676
|
});
|
|
677
677
|
}, [e.locale]), f(() => () => {
|
|
678
|
-
P() && (window.removeEventListener("message",
|
|
678
|
+
P() && (window.removeEventListener("message", m), window.removeEventListener(
|
|
679
679
|
"builder:component:stateChangeListenerActivated",
|
|
680
680
|
I
|
|
681
681
|
));
|
|
682
|
-
}, []), /* @__PURE__ */
|
|
682
|
+
}, []), /* @__PURE__ */ i(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ me(
|
|
683
683
|
b,
|
|
684
684
|
{
|
|
685
|
-
key:
|
|
685
|
+
key: s,
|
|
686
686
|
ref: c,
|
|
687
|
-
onClick: (
|
|
688
|
-
"builder-content-id": (
|
|
687
|
+
onClick: (t) => Q(t),
|
|
688
|
+
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
689
689
|
"builder-model": e.model,
|
|
690
690
|
...e.showContent ? {} : {
|
|
691
691
|
hidden: !0,
|
|
@@ -698,16 +698,17 @@ function je(e) {
|
|
|
698
698
|
) }) : null });
|
|
699
699
|
}
|
|
700
700
|
export {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
701
|
+
we as B,
|
|
702
|
+
Ne as C,
|
|
703
|
+
J as D,
|
|
704
|
+
Be as E,
|
|
705
|
+
Re as F,
|
|
706
|
+
Ee as I,
|
|
707
|
+
Te as S,
|
|
708
|
+
je as V,
|
|
709
|
+
Ie as a,
|
|
710
|
+
Ce as b,
|
|
711
|
+
Pe as c,
|
|
712
|
+
Le as d,
|
|
713
|
+
We as e
|
|
713
714
|
};
|