@builder.io/sdk-react-nextjs 0.12.6 → 0.12.7
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-456ca2b5.js} +46 -42
- package/lib/{node/USE_CLIENT_BUNDLE-343cb348.cjs → browser/USE_CLIENT_BUNDLE-9d2b983d.cjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-fda604b6.js → browser/USE_SERVER_BUNDLE-e0f1c15b.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-19879780.cjs → browser/USE_SERVER_BUNDLE-ee4a5d19.cjs} +1 -1
- package/lib/browser/{bundle-b3104268.js → bundle-56e0b400.js} +477 -434
- package/lib/browser/{bundle-6e21e129.cjs → bundle-a408994f.cjs} +20 -20
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +6 -6
- package/lib/{node/USE_CLIENT_BUNDLE-aa8ab44a.js → edge/USE_CLIENT_BUNDLE-789e694f.js} +46 -42
- package/lib/{browser/USE_CLIENT_BUNDLE-e5d64246.cjs → edge/USE_CLIENT_BUNDLE-a6a0becc.cjs} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-cbcb1baf.cjs → edge/USE_SERVER_BUNDLE-dbf92938.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-2fdc522e.js → edge/USE_SERVER_BUNDLE-dffaa191.js} +1 -1
- package/lib/edge/{bundle-ee1ebe27.js → bundle-4bf88f38.js} +482 -439
- package/lib/edge/{bundle-f2d4a6db.cjs → bundle-97ad81d1.cjs} +28 -28
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +6 -6
- package/lib/{edge/USE_CLIENT_BUNDLE-41ee32e4.js → node/USE_CLIENT_BUNDLE-499aeaa2.js} +46 -42
- package/lib/{edge/USE_CLIENT_BUNDLE-cc55e91d.cjs → node/USE_CLIENT_BUNDLE-b2f9be29.cjs} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-ccca985e.cjs → node/USE_SERVER_BUNDLE-b3ad9a89.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-2bf0dc28.js → node/USE_SERVER_BUNDLE-e3da6caa.js} +1 -1
- package/lib/node/{bundle-c799b7fc.cjs → bundle-97b4832a.cjs} +4 -4
- package/lib/node/{bundle-99e5b33f.js → bundle-d3f89e99.js} +216 -173
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +6 -6
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +5 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/types/builder-block.d.ts +18 -1
- package/types/esm/components/block/animator.d.ts +5 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/types/builder-block.d.ts +18 -1
|
@@ -1,13 +1,13 @@
|
|
|
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 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
|
|
4
|
-
import { useRef as T, useState as x, useEffect as f, createContext as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
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, 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-56e0b400.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as f, createContext as me, createElement as ge } from "react";
|
|
5
|
+
import { p as be } from "./USE_SERVER_BUNDLE-e0f1c15b.js";
|
|
6
|
+
import { useRouter as he } 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
|
{
|
|
@@ -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,7 +71,7 @@ function Ee(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Re(e) {
|
|
75
75
|
function c() {
|
|
76
76
|
var l;
|
|
77
77
|
return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
|
|
@@ -124,10 +124,10 @@ 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
|
|
130
|
+
function Te(e) {
|
|
131
131
|
var l, u, S, y;
|
|
132
132
|
function c() {
|
|
133
133
|
var m;
|
|
@@ -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,7 +231,7 @@ function Te(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Be(e) {
|
|
235
235
|
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
|
|
236
236
|
return f(() => {
|
|
237
237
|
var y;
|
|
@@ -269,7 +269,7 @@ function Ne(e) {
|
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Le(e) {
|
|
273
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)
|
|
@@ -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,7 +315,7 @@ function Le(e) {
|
|
|
315
315
|
w() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function We(e) {
|
|
319
319
|
var v, l, u, S, y, b, o;
|
|
320
320
|
function c() {
|
|
321
321
|
return {
|
|
@@ -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,8 +430,8 @@ const he = ue({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var W, F, K,
|
|
433
|
+
function Ae(e) {
|
|
434
|
+
var W, A, F, K, z, M, _;
|
|
435
435
|
const c = T(null), [s, v] = x(() => 0);
|
|
436
436
|
x(() => !0);
|
|
437
437
|
function l(t) {
|
|
@@ -457,7 +457,7 @@ function We(e) {
|
|
|
457
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
|
-
|
|
460
|
+
be({
|
|
461
461
|
value: n,
|
|
462
462
|
key: n.id
|
|
463
463
|
}).then(() => {
|
|
@@ -488,6 +488,10 @@ function We(e) {
|
|
|
488
488
|
}), v(s + 1);
|
|
489
489
|
break;
|
|
490
490
|
}
|
|
491
|
+
case "builder.triggerAnimation": {
|
|
492
|
+
ae(n.data);
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
491
495
|
case "builder.contentUpdate": {
|
|
492
496
|
const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
|
|
493
497
|
d === e.model && (u(g), v(s + 1));
|
|
@@ -506,7 +510,7 @@ function We(e) {
|
|
|
506
510
|
rootSetState: e.builderContextSignal.rootSetState
|
|
507
511
|
});
|
|
508
512
|
}
|
|
509
|
-
const [C,
|
|
513
|
+
const [C, Se] = x(() => ({})), [N, G] = x(() => !1);
|
|
510
514
|
function Q(t) {
|
|
511
515
|
var n, a;
|
|
512
516
|
if (e.builderContextSignal.content) {
|
|
@@ -517,7 +521,7 @@ function We(e) {
|
|
|
517
521
|
contentId: d,
|
|
518
522
|
apiKey: e.apiKey,
|
|
519
523
|
variationId: r !== d ? r : void 0,
|
|
520
|
-
...
|
|
524
|
+
...ce(t),
|
|
521
525
|
unique: !N
|
|
522
526
|
});
|
|
523
527
|
}
|
|
@@ -536,7 +540,7 @@ function We(e) {
|
|
|
536
540
|
);
|
|
537
541
|
}
|
|
538
542
|
function Y({ url: t, key: n }) {
|
|
539
|
-
|
|
543
|
+
ue(t).then((a) => a.json()).then((a) => {
|
|
540
544
|
var d, g;
|
|
541
545
|
const r = {
|
|
542
546
|
...e.builderContextSignal.rootState,
|
|
@@ -566,7 +570,7 @@ function We(e) {
|
|
|
566
570
|
"builder:component:stateChange",
|
|
567
571
|
{
|
|
568
572
|
detail: {
|
|
569
|
-
state:
|
|
573
|
+
state: re(e.builderContextSignal.rootState),
|
|
570
574
|
ref: {
|
|
571
575
|
name: e.model
|
|
572
576
|
}
|
|
@@ -576,7 +580,7 @@ function We(e) {
|
|
|
576
580
|
);
|
|
577
581
|
}
|
|
578
582
|
function L(t) {
|
|
579
|
-
v(s + 1), window.addEventListener("message", m),
|
|
583
|
+
v(s + 1), window.addEventListener("message", m), le(), oe({
|
|
580
584
|
...e.locale ? {
|
|
581
585
|
locale: e.locale
|
|
582
586
|
} : {},
|
|
@@ -593,7 +597,7 @@ function We(e) {
|
|
|
593
597
|
e.builderContextSignal.componentInfos
|
|
594
598
|
).forEach((n) => {
|
|
595
599
|
var r;
|
|
596
|
-
const a =
|
|
600
|
+
const a = de(n);
|
|
597
601
|
(r = window.parent) == null || r.postMessage(a, "*");
|
|
598
602
|
}), window.addEventListener(
|
|
599
603
|
"builder:component:stateChangeListenerActivated",
|
|
@@ -604,7 +608,7 @@ function We(e) {
|
|
|
604
608
|
const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
|
|
605
609
|
`builder.preview.${a}`
|
|
606
610
|
), d = n.get("apiKey") || n.get("builder.space");
|
|
607
|
-
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) &&
|
|
611
|
+
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && se({
|
|
608
612
|
model: e.model,
|
|
609
613
|
apiKey: e.apiKey,
|
|
610
614
|
apiVersion: e.builderContextSignal.apiVersion
|
|
@@ -612,7 +616,7 @@ function We(e) {
|
|
|
612
616
|
g && u(g);
|
|
613
617
|
});
|
|
614
618
|
}
|
|
615
|
-
const Z =
|
|
619
|
+
const Z = he();
|
|
616
620
|
return f(() => {
|
|
617
621
|
var t;
|
|
618
622
|
return (t = c.current) == null || t.addEventListener(
|
|
@@ -661,9 +665,9 @@ function We(e) {
|
|
|
661
665
|
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
662
666
|
}, [S]), f(() => {
|
|
663
667
|
k();
|
|
664
|
-
}, [(
|
|
668
|
+
}, [(A = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : A.jsCode]), f(() => {
|
|
665
669
|
B();
|
|
666
|
-
}, [(
|
|
670
|
+
}, [(K = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : K.httpRequests]), f(() => {
|
|
667
671
|
I();
|
|
668
672
|
}, [e.builderContextSignal.rootState]), f(() => {
|
|
669
673
|
e.data && l(e.data);
|
|
@@ -676,7 +680,7 @@ function We(e) {
|
|
|
676
680
|
"builder:component:stateChangeListenerActivated",
|
|
677
681
|
I
|
|
678
682
|
));
|
|
679
|
-
}, []), /* @__PURE__ */ i(
|
|
683
|
+
}, []), /* @__PURE__ */ i(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ ge(
|
|
680
684
|
b,
|
|
681
685
|
{
|
|
682
686
|
key: s,
|
|
@@ -695,17 +699,17 @@ function We(e) {
|
|
|
695
699
|
) }) : null });
|
|
696
700
|
}
|
|
697
701
|
export {
|
|
698
|
-
|
|
699
|
-
|
|
702
|
+
Ee as B,
|
|
703
|
+
Be as C,
|
|
700
704
|
J as D,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
705
|
+
Le as E,
|
|
706
|
+
Pe as F,
|
|
707
|
+
Ie as I,
|
|
708
|
+
Ne as S,
|
|
709
|
+
We as V,
|
|
710
|
+
Re as a,
|
|
711
|
+
we as b,
|
|
712
|
+
Te as c,
|
|
713
|
+
je as d,
|
|
714
|
+
Ae as e
|
|
711
715
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-a408994f.cjs"),r=require("react"),M=require("./USE_SERVER_BUNDLE-ee4a5d19.cjs"),V=require("next/navigation");function E(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(E,{TagName:e.link?e.builderLinkComponent||"a":"button",attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},actionAttributes:{},children:e.text})}function U(e){return t.jsx(E,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function l(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,m;a.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var s,m;a.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:l()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>S(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
left: 0;
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
|
-
}`})]})}function Q(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const l=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const x=l.current.getElementsByTagName("script");for(let h=0;h<x.length;h++){const d=x[h];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]),[x,v]=r.useState(()=>!1);function h(){if(!l.current||!l.current.getElementsByTagName)return;const d=l.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!x&&(v(!0),h())},[l.current,x]),t.jsx("div",{className:"builder-embed",ref:l,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,s,m,x,v,h,d;function l(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(h=e.builderBlock)==null?void 0:h.children)!=null&&d.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function s(n){var c,o;const i={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(o=(c=e.builderContextSignal).rootSetState)==null||o.call(c,i):e.builderContextSignal.rootState=i}function m(n){var c,o,u,b,
|
|
21
|
+
}`})]})}function Q(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const l=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const x=l.current.getElementsByTagName("script");for(let h=0;h<x.length;h++){const d=x[h];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]),[x,v]=r.useState(()=>!1);function h(){if(!l.current||!l.current.getElementsByTagName)return;const d=l.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!x&&(v(!0),h())},[l.current,x]),t.jsx("div",{className:"builder-embed",ref:l,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,s,m,x,v,h,d;function l(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(h=e.builderBlock)==null?void 0:h.children)!=null&&d.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function s(n){var c,o;const i={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(o=(c=e.builderContextSignal).rootSetState)==null||o.call(c,i):e.builderContextSignal.rootState=i}function m(n){var c,o,u,b,A;const i={...e.builderContextSignal.content,...n,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...n==null?void 0:n.data},meta:{...(o=e.builderContextSignal.content)==null?void 0:o.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((A=(b=e.builderContextSignal.content)==null?void 0:b.meta)==null?void 0:A.breakpoints)}};M.postPreviewContent({value:i,key:i.id}).then(()=>{D.refresh()})}r.useState(()=>0);const[x,v]=r.useState(()=>!1),[h,d]=r.useState(()=>e.contentWrapper||"div");function f(n){var c;if(!a.isFromTrustedHost(e.trustedHosts,n))return;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const o=i.data,{breakpoints:u,contentId:b}=o;if(!b||b!==((c=e.builderContextSignal.content)==null?void 0:c.id))return;u&&m({meta:{breakpoints:u}}),S(g+1);break}case"builder.triggerAnimation":{a.triggerAnimation(i.data);break}case"builder.contentUpdate":{const o=i.data,u=o.key||o.alias||o.entry||o.modelName,b=o.data;u===e.model&&(m(b),S(g+1));break}}}function k(){var i,c;const n=(c=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:c.jsCode;n&&a.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(n){var i,c;if(e.builderContextSignal.content){const o=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:o!==u?o:void 0,...a.getInteractionPropertiesForEvent(n),unique:!j})}j||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){a.fetch(n).then(c=>c.json()).then(c=>{var u,b;const o={...e.builderContextSignal.rootState,[i]:c};(b=(u=e.builderContextSignal).rootSetState)==null||b.call(u,o),y[i]=!0}).catch(c=>{console.error("error fetching dynamic data",n,c)})}function w(){var i,c;const n=((c=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:c.httpRequests)??{};Object.entries(n).forEach(([o,u])=>{if(u&&(!y[o]||a.isEditing())){const b=_(u);z({url:b,key:o})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(n){S(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var o;const c=a.createRegisterComponentMessage(i);(o=window.parent)==null||o.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(n){const i=new URL(location.href).searchParams,c=i.get("builder.preview"),o=i.get(`builder.preview.${c}`),u=i.get("apiKey")||i.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||o===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(b=>{b&&m(b)})}const D=V.useRouter();return r.useEffect(()=>{var n;return(n=l.current)==null||n.addEventListener("initeditingbldr",R),()=>{var i;return(i=l.current)==null?void 0:i.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var n;return(n=l.current)==null||n.addEventListener("initpreviewingbldr",I),()=>{var i;return(i=l.current)==null?void 0:i.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var n,i;if(a.isBrowser()){if(a.isEditing()&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const o=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,b=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:b,variationId:o!==u?o:void 0})}a.isPreviewing()&&l.current}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),w(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[x]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{w()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&s(e.data)},[e.data]),r.useEffect(()=>{e.locale&&s({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(h,{key:g,ref:l,onClick:n=>q(n),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=E;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-a408994f.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|