@builder.io/sdk-react-nextjs 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks/symbol/symbol.cjs +1 -1
- package/lib/browser/blocks/symbol/symbol.mjs +27 -25
- package/lib/browser/blocks/text/component-info.cjs +1 -1
- package/lib/browser/blocks/text/component-info.mjs +0 -1
- package/lib/browser/blocks/text/text.cjs +1 -1
- package/lib/browser/blocks/text/text.mjs +3 -2
- package/lib/browser/components/block/block.cjs +1 -1
- package/lib/browser/components/block/block.mjs +27 -20
- package/lib/browser/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/browser/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/browser/components/block/components/interactive-element.cjs +1 -1
- package/lib/browser/components/block/components/interactive-element.mjs +27 -15
- package/lib/browser/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/browser/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/browser/components/block/components/style-wrapper.cjs +1 -0
- package/lib/browser/components/block/components/style-wrapper.mjs +24 -0
- package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/browser/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/browser/components/content/components/enable-editor.cjs +1 -1
- package/lib/browser/components/content/components/enable-editor.mjs +195 -166
- package/lib/browser/components/live-edit.cjs +1 -0
- package/lib/browser/components/live-edit.mjs +19 -0
- package/lib/browser/constants/builder-registered-components.cjs +1 -1
- package/lib/browser/constants/builder-registered-components.mjs +3 -2
- package/lib/browser/constants/extra-components.cjs +1 -1
- package/lib/browser/constants/extra-components.mjs +3 -2
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/helpers/find-block.cjs +1 -0
- package/lib/browser/helpers/find-block.mjs +30 -0
- package/lib/browser/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/browser/helpers/subscribe-to-editor.mjs +15 -15
- package/lib/edge/blocks/symbol/symbol.cjs +1 -1
- package/lib/edge/blocks/symbol/symbol.mjs +27 -25
- package/lib/edge/blocks/text/component-info.cjs +1 -1
- package/lib/edge/blocks/text/component-info.mjs +0 -1
- package/lib/edge/blocks/text/text.cjs +1 -1
- package/lib/edge/blocks/text/text.mjs +3 -2
- package/lib/edge/components/block/block.cjs +1 -1
- package/lib/edge/components/block/block.mjs +27 -20
- package/lib/edge/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/edge/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/edge/components/block/components/interactive-element.cjs +1 -1
- package/lib/edge/components/block/components/interactive-element.mjs +27 -15
- package/lib/edge/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/edge/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/edge/components/block/components/style-wrapper.cjs +1 -0
- package/lib/edge/components/block/components/style-wrapper.mjs +24 -0
- package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/edge/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/edge/components/content/components/enable-editor.cjs +1 -1
- package/lib/edge/components/content/components/enable-editor.mjs +195 -166
- package/lib/edge/components/live-edit.cjs +1 -0
- package/lib/edge/components/live-edit.mjs +19 -0
- package/lib/edge/constants/builder-registered-components.cjs +1 -1
- package/lib/edge/constants/builder-registered-components.mjs +3 -2
- package/lib/edge/constants/extra-components.cjs +1 -1
- package/lib/edge/constants/extra-components.mjs +3 -2
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/helpers/find-block.cjs +1 -0
- package/lib/edge/helpers/find-block.mjs +30 -0
- package/lib/edge/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/edge/helpers/subscribe-to-editor.mjs +15 -15
- package/lib/node/blocks/symbol/symbol.cjs +1 -1
- package/lib/node/blocks/symbol/symbol.mjs +27 -25
- package/lib/node/blocks/text/component-info.cjs +1 -1
- package/lib/node/blocks/text/component-info.mjs +0 -1
- package/lib/node/blocks/text/text.cjs +1 -1
- package/lib/node/blocks/text/text.mjs +3 -2
- package/lib/node/components/block/block.cjs +1 -1
- package/lib/node/components/block/block.mjs +27 -20
- package/lib/node/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/node/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/node/components/block/components/interactive-element.cjs +1 -1
- package/lib/node/components/block/components/interactive-element.mjs +27 -15
- package/lib/node/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/node/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/node/components/block/components/style-wrapper.cjs +1 -0
- package/lib/node/components/block/components/style-wrapper.mjs +24 -0
- package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/node/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/node/components/content/components/enable-editor.cjs +1 -1
- package/lib/node/components/content/components/enable-editor.mjs +195 -166
- package/lib/node/components/live-edit.cjs +1 -0
- package/lib/node/components/live-edit.mjs +19 -0
- package/lib/node/constants/builder-registered-components.cjs +1 -1
- package/lib/node/constants/builder-registered-components.mjs +3 -2
- package/lib/node/constants/extra-components.cjs +1 -1
- package/lib/node/constants/extra-components.mjs +3 -2
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/helpers/find-block.cjs +1 -0
- package/lib/node/helpers/find-block.mjs +30 -0
- package/lib/node/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/node/helpers/subscribe-to-editor.mjs +15 -15
- package/package.json +1 -1
- package/types/cjs/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/cjs/components/awaiter.d.ts +1 -11
- package/types/cjs/components/awaiter.types.d.ts +7 -0
- package/types/cjs/components/block/components/live-edit-block-styles.d.ts +8 -0
- package/types/cjs/components/block/components/style-wrapper.d.ts +9 -0
- package/types/cjs/components/live-edit.d.ts +9 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/helpers/find-block.d.ts +18 -0
- package/types/cjs/helpers/subscribe-to-editor.d.ts +3 -2
- package/types/esm/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/esm/components/awaiter.d.ts +1 -11
- package/types/esm/components/awaiter.types.d.ts +7 -0
- package/types/esm/components/block/components/live-edit-block-styles.d.ts +8 -0
- package/types/esm/components/block/components/style-wrapper.d.ts +9 -0
- package/types/esm/components/live-edit.d.ts +9 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/helpers/find-block.d.ts +18 -0
- package/types/esm/helpers/subscribe-to-editor.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const m=require("react/jsx-runtime"),k=require("../../components/content-variants/content-variants.cjs"),f=require("../../functions/get-class-prop-name.cjs"),v=require("./symbol.helpers.cjs");async function N(e){var o,i,l,a,c,r,s;const d=function(){return"div"},y=function(){return"div"},C=function(){return Object.values(e.builderComponents)},x=function(){var u,b;return[e.attributes[f.getClassPropName()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},t=((o=e.symbol)==null?void 0:o.content)||await v.fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return(i=e.symbol)==null||i.entry,m.jsx("div",{...e.attributes,className:x(),children:m.jsx(k,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:C(),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(c=t==null?void 0:t.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(s=(r=e.symbol)==null?void 0:r.model)!=null?s:"",content:t,linkComponent:e.builderLinkComponent,blocksWrapper:d(),contentWrapper:y()})})}module.exports=N;
|
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import x from "../../components/content-variants/content-variants.mjs";
|
|
3
|
-
import { getClassPropName as
|
|
4
|
-
import { fetchSymbolContent as
|
|
5
|
-
async function
|
|
6
|
-
var
|
|
3
|
+
import { getClassPropName as k } from "../../functions/get-class-prop-name.mjs";
|
|
4
|
+
import { fetchSymbolContent as v } from "./symbol.helpers.mjs";
|
|
5
|
+
async function S(t) {
|
|
6
|
+
var o, i, l, a, c, m, r;
|
|
7
7
|
const s = function() {
|
|
8
8
|
return "div";
|
|
9
9
|
}, y = function() {
|
|
10
10
|
return "div";
|
|
11
11
|
}, C = function() {
|
|
12
|
+
return Object.values(t.builderComponents);
|
|
13
|
+
}, f = function() {
|
|
12
14
|
var b, d;
|
|
13
15
|
return [
|
|
14
|
-
|
|
16
|
+
t.attributes[k()],
|
|
15
17
|
"builder-symbol",
|
|
16
|
-
(b =
|
|
17
|
-
(d =
|
|
18
|
+
(b = t.symbol) != null && b.inline ? "builder-inline-symbol" : void 0,
|
|
19
|
+
(d = t.symbol) != null && d.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
18
20
|
].filter(Boolean).join(" ");
|
|
19
|
-
},
|
|
20
|
-
symbol:
|
|
21
|
-
builderContextValue:
|
|
21
|
+
}, e = ((o = t.symbol) == null ? void 0 : o.content) || await v({
|
|
22
|
+
symbol: t.symbol,
|
|
23
|
+
builderContextValue: t.builderContext
|
|
22
24
|
});
|
|
23
|
-
return (
|
|
25
|
+
return (i = t.symbol) == null || i.entry, /* @__PURE__ */ u("div", { ...t.attributes, className: f(), children: /* @__PURE__ */ u(
|
|
24
26
|
x,
|
|
25
27
|
{
|
|
26
|
-
nonce:
|
|
28
|
+
nonce: t.builderContext.nonce,
|
|
27
29
|
isNestedRender: !0,
|
|
28
|
-
apiVersion:
|
|
29
|
-
apiKey:
|
|
30
|
+
apiVersion: t.builderContext.apiVersion,
|
|
31
|
+
apiKey: t.builderContext.apiKey,
|
|
30
32
|
context: {
|
|
31
|
-
...
|
|
32
|
-
symbolId: (
|
|
33
|
+
...t.builderContext.context,
|
|
34
|
+
symbolId: (l = t.builderBlock) == null ? void 0 : l.id
|
|
33
35
|
},
|
|
34
|
-
customComponents:
|
|
36
|
+
customComponents: C(),
|
|
35
37
|
data: {
|
|
36
|
-
...(
|
|
37
|
-
...
|
|
38
|
-
...(
|
|
38
|
+
...(a = t.symbol) == null ? void 0 : a.data,
|
|
39
|
+
...t.builderContext.localState,
|
|
40
|
+
...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state
|
|
39
41
|
},
|
|
40
|
-
canTrack:
|
|
41
|
-
model: (
|
|
42
|
-
content:
|
|
43
|
-
linkComponent:
|
|
42
|
+
canTrack: t.builderContext.canTrack,
|
|
43
|
+
model: (r = (m = t.symbol) == null ? void 0 : m.model) != null ? r : "",
|
|
44
|
+
content: e,
|
|
45
|
+
linkComponent: t.builderLinkComponent,
|
|
44
46
|
blocksWrapper: s(),
|
|
45
47
|
contentWrapper: y()
|
|
46
48
|
}
|
|
47
49
|
) });
|
|
48
50
|
}
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
S as default
|
|
51
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{},name:"Text",static:!0,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={shouldReceiveBuilderProps:{},name:"Text",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};exports.componentInfo=e;
|
|
@@ -2,7 +2,6 @@ const e = {
|
|
|
2
2
|
shouldReceiveBuilderProps: {},
|
|
3
3
|
name: "Text",
|
|
4
4
|
static: !0,
|
|
5
|
-
isRSC: !0,
|
|
6
5
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
7
6
|
inputs: [{
|
|
8
7
|
name: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime");function
|
|
1
|
+
"use client";"use strict";const n=require("react/jsx-runtime");function s(t){var e;return n.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((e=t.text)==null?void 0:e.toString())||""},style:{outline:"none"}})}module.exports=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),v=require("../../constants/target.cjs"),j=require("../../functions/get-block-component-options.cjs"),P=require("../../functions/get-processed-block.cjs"),S=require("../../functions/is-previewing.cjs");require("../../helpers/user-attributes.cjs");require("../../functions/get-fetch.cjs");const d=require("./block.helpers.cjs"),q=require("./components/block-wrapper.cjs"),h=require("./components/component-ref/component-ref.cjs"),p=require("./components/repeated-block.cjs"),O=require("./components/style-wrapper.cjs");function b(e){var a,C,x,g;const m=function(){return d.getRepeatItemData({block:e.block,context:e.context})},u={value:null,update:!1},c=function(){var i;if(u.value&&!u.update&&!S.isPreviewing())return u.value;const r=(i=e.block.repeat)!=null&&i.collection?e.block:P.getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return u.value=r,u.update=!1,r},l=function(){return d.getComponent({block:c(),registeredComponents:e.registeredComponents,model:e.context.model})},f=function(){var i;return e.block.tagName==="a"||((i=c().properties)==null?void 0:i.href)||c().href?e.linkComponent||"a":e.block.tagName||"div"},B=function(){var s,k;if((s=e.block.repeat)!=null&&s.collection)return!!((k=m())!=null&&k.length);const r="hide"in c()?c().hide:!1;return("show"in c()?c().show:!0)&&!r},R=function(){var i,s;return!((i=l())!=null&&i.component)&&!m()?(s=c().children)!=null?s:[]:[]},n=function(){var r,i,s,k;return{blockChildren:(r=c().children)!=null?r:[],componentRef:(i=l())==null?void 0:i.component,componentOptions:{...j.getBlockComponentOptions(c(),e.context),...d.provideBuilderBlock(l(),c()),...d.provideBuilderContext(l(),e.context),...d.provideLinkComponent(l(),e.linkComponent),...d.provideRegisteredComponents(l(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:c(),includeBlockProps:((s=l())==null?void 0:s.noWrap)===!0,isInteractive:!((k=l())!=null&&k.isRSC&&v.TARGET==="rsc")}};return t.jsx(t.Fragment,{children:B()?t.jsxs(t.Fragment,{children:[t.jsx(O,{block:c(),context:e.context,id:e.block.id}),(a=l())!=null&&a.noWrap?m()?t.jsx(t.Fragment,{children:(g=m())==null?void 0:g.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}):t.jsx(t.Fragment,{children:m()?t.jsx(t.Fragment,{children:(x=m())==null?void 0:x.map((o,r)=>t.jsx(p,{repeatContext:o.context,block:o.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d.generateKey(r)))}):t.jsxs(q,{Wrapper:f(),block:c(),context:e.context,children:[t.jsx(h,{componentRef:n().componentRef,componentOptions:n().componentOptions,blockChildren:n().blockChildren,context:n().context,registeredComponents:n().registeredComponents,linkComponent:n().linkComponent,builderBlock:n().builderBlock,includeBlockProps:n().includeBlockProps,isInteractive:n().isInteractive}),(C=R())==null?void 0:C.map(o=>t.jsx(b,{block:o,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},o.id))]})})]}):null})}module.exports=b;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, Fragment as u, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { TARGET as S } from "../../constants/target.mjs";
|
|
3
3
|
import { getBlockComponentOptions as P } from "../../functions/get-block-component-options.mjs";
|
|
4
4
|
import { getProcessedBlock as I } from "../../functions/get-processed-block.mjs";
|
|
@@ -6,10 +6,10 @@ import { isPreviewing as O } from "../../functions/is-previewing.mjs";
|
|
|
6
6
|
import "../../helpers/user-attributes.mjs";
|
|
7
7
|
import "../../functions/get-fetch.mjs";
|
|
8
8
|
import { generateKey as x, getRepeatItemData as w, getComponent as W, provideBuilderBlock as T, provideBuilderContext as L, provideLinkComponent as U, provideRegisteredComponents as j } from "./block.helpers.mjs";
|
|
9
|
-
import y from "./components/block-
|
|
10
|
-
import N from "./components/block-wrapper.mjs";
|
|
9
|
+
import y from "./components/block-wrapper.mjs";
|
|
11
10
|
import b from "./components/component-ref/component-ref.mjs";
|
|
12
11
|
import g from "./components/repeated-block.mjs";
|
|
12
|
+
import N from "./components/style-wrapper.mjs";
|
|
13
13
|
function A(e) {
|
|
14
14
|
var a, C, p, f;
|
|
15
15
|
const d = function() {
|
|
@@ -32,7 +32,7 @@ function A(e) {
|
|
|
32
32
|
context: e.context.context
|
|
33
33
|
});
|
|
34
34
|
return s.value = c, s.update = !1, c;
|
|
35
|
-
},
|
|
35
|
+
}, l = function() {
|
|
36
36
|
return W({
|
|
37
37
|
block: n(),
|
|
38
38
|
registeredComponents: e.registeredComponents,
|
|
@@ -49,19 +49,19 @@ function A(e) {
|
|
|
49
49
|
return ("show" in n() ? n().show : !0) && !c;
|
|
50
50
|
}, v = function() {
|
|
51
51
|
var i, m;
|
|
52
|
-
return !((i =
|
|
52
|
+
return !((i = l()) != null && i.component) && !d() ? (m = n().children) != null ? m : [] : [];
|
|
53
53
|
}, o = function() {
|
|
54
54
|
var c, i, m, k;
|
|
55
55
|
return {
|
|
56
56
|
blockChildren: (c = n().children) != null ? c : [],
|
|
57
|
-
componentRef: (i =
|
|
57
|
+
componentRef: (i = l()) == null ? void 0 : i.component,
|
|
58
58
|
componentOptions: {
|
|
59
59
|
...P(n(), e.context),
|
|
60
|
-
...T(
|
|
61
|
-
...L(
|
|
62
|
-
...U(
|
|
60
|
+
...T(l(), n()),
|
|
61
|
+
...L(l(), e.context),
|
|
62
|
+
...U(l(), e.linkComponent),
|
|
63
63
|
...j(
|
|
64
|
-
|
|
64
|
+
l(),
|
|
65
65
|
e.registeredComponents,
|
|
66
66
|
e.context.model
|
|
67
67
|
)
|
|
@@ -70,13 +70,20 @@ function A(e) {
|
|
|
70
70
|
linkComponent: e.linkComponent,
|
|
71
71
|
registeredComponents: e.registeredComponents,
|
|
72
72
|
builderBlock: n(),
|
|
73
|
-
includeBlockProps: ((m =
|
|
74
|
-
isInteractive: !((k =
|
|
73
|
+
includeBlockProps: ((m = l()) == null ? void 0 : m.noWrap) === !0,
|
|
74
|
+
isInteractive: !((k = l()) != null && k.isRSC && S === "rsc")
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
77
|
+
return /* @__PURE__ */ r(u, { children: R() ? /* @__PURE__ */ h(u, { children: [
|
|
78
|
+
/* @__PURE__ */ r(
|
|
79
|
+
N,
|
|
80
|
+
{
|
|
81
|
+
block: n(),
|
|
82
|
+
context: e.context,
|
|
83
|
+
id: e.block.id
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
(a = l()) != null && a.noWrap ? d() ? /* @__PURE__ */ r(u, { children: (f = d()) == null ? void 0 : f.map((t, c) => /* @__PURE__ */ r(
|
|
80
87
|
g,
|
|
81
88
|
{
|
|
82
89
|
repeatContext: t.context,
|
|
@@ -85,7 +92,7 @@ function A(e) {
|
|
|
85
92
|
linkComponent: e.linkComponent
|
|
86
93
|
},
|
|
87
94
|
x(c)
|
|
88
|
-
)) }) : /* @__PURE__ */
|
|
95
|
+
)) }) : /* @__PURE__ */ r(
|
|
89
96
|
b,
|
|
90
97
|
{
|
|
91
98
|
componentRef: o().componentRef,
|
|
@@ -98,7 +105,7 @@ function A(e) {
|
|
|
98
105
|
includeBlockProps: o().includeBlockProps,
|
|
99
106
|
isInteractive: o().isInteractive
|
|
100
107
|
}
|
|
101
|
-
) : /* @__PURE__ */
|
|
108
|
+
) : /* @__PURE__ */ r(u, { children: d() ? /* @__PURE__ */ r(u, { children: (p = d()) == null ? void 0 : p.map((t, c) => /* @__PURE__ */ r(
|
|
102
109
|
g,
|
|
103
110
|
{
|
|
104
111
|
repeatContext: t.context,
|
|
@@ -108,13 +115,13 @@ function A(e) {
|
|
|
108
115
|
},
|
|
109
116
|
x(c)
|
|
110
117
|
)) }) : /* @__PURE__ */ h(
|
|
111
|
-
|
|
118
|
+
y,
|
|
112
119
|
{
|
|
113
120
|
Wrapper: B(),
|
|
114
121
|
block: n(),
|
|
115
122
|
context: e.context,
|
|
116
123
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ r(
|
|
118
125
|
b,
|
|
119
126
|
{
|
|
120
127
|
componentRef: o().componentRef,
|
|
@@ -128,7 +135,7 @@ function A(e) {
|
|
|
128
135
|
isInteractive: o().isInteractive
|
|
129
136
|
}
|
|
130
137
|
),
|
|
131
|
-
(C = v()) == null ? void 0 : C.map((t) => /* @__PURE__ */
|
|
138
|
+
(C = v()) == null ? void 0 : C.map((t) => /* @__PURE__ */ r(
|
|
132
139
|
A,
|
|
133
140
|
{
|
|
134
141
|
block: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),i=require("../../block.cjs"),l=require("../interactive-element.cjs"),r=require("./component-ref.helpers.cjs");function m(e){var t;const c=e.isInteractive?l:e.componentRef;return n.jsx(n.Fragment,{children:e.componentRef?n.jsx(n.Fragment,{children:n.jsx(c,{...r.getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(t=e.blockChildren)==null?void 0:t.map(o=>n.jsx(i,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}module.exports=m;
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),i=require("../../block.cjs"),l=require("../interactive-element.cjs"),r=require("./component-ref.helpers.cjs");function m(e){var t;const c=e.isInteractive?l:e.componentRef;return n.jsx(n.Fragment,{children:e.componentRef?n.jsx(n.Fragment,{children:n.jsx(c,{...r.getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:e.componentRef?n.jsx(n.Fragment,{children:(t=e.blockChildren)==null?void 0:t.map(o=>n.jsx(i,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))}):null})}):null})}module.exports=m;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as n, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as n, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../block.mjs";
|
|
3
|
+
import m from "../interactive-element.mjs";
|
|
4
4
|
import { getWrapperProps as r } from "./component-ref.helpers.mjs";
|
|
5
5
|
function u(e) {
|
|
6
|
-
var
|
|
7
|
-
const i = e.isInteractive ?
|
|
8
|
-
return /* @__PURE__ */ n(
|
|
6
|
+
var o;
|
|
7
|
+
const i = e.isInteractive ? m : e.componentRef;
|
|
8
|
+
return /* @__PURE__ */ n(t, { children: e.componentRef ? /* @__PURE__ */ n(t, { children: /* @__PURE__ */ n(
|
|
9
9
|
i,
|
|
10
10
|
{
|
|
11
11
|
...r({
|
|
@@ -18,16 +18,16 @@ function u(e) {
|
|
|
18
18
|
isInteractive: e.isInteractive,
|
|
19
19
|
contextValue: e.context
|
|
20
20
|
}),
|
|
21
|
-
children: (t = e.blockChildren) == null ? void 0 :
|
|
22
|
-
|
|
21
|
+
children: e.componentRef ? /* @__PURE__ */ n(t, { children: (o = e.blockChildren) == null ? void 0 : o.map((c) => /* @__PURE__ */ n(
|
|
22
|
+
l,
|
|
23
23
|
{
|
|
24
|
-
block:
|
|
24
|
+
block: c,
|
|
25
25
|
context: e.context,
|
|
26
26
|
registeredComponents: e.registeredComponents,
|
|
27
27
|
linkComponent: e.linkComponent
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
))
|
|
29
|
+
c.id
|
|
30
|
+
)) }) : null
|
|
31
31
|
}
|
|
32
32
|
) }) : null });
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const e=require("react/jsx-runtime"),i=require("react"),o=require("../../../functions/get-block-actions.cjs"),l=require("../../../functions/get-block-properties.cjs"),u=require("../../../functions/is-editing.cjs");require("../../../helpers/user-attributes.cjs");require("../../../functions/get-fetch.cjs");const d=require("../../awaiter.cjs"),s=require("../../live-edit.cjs");function x(t){var c,n;i.useState(()=>0);function r(){return t.includeBlockProps?{...l.getBlockProperties({block:t.block,context:t.context}),...o.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}function a(){return t.wrapperProps}return i.useEffect(()=>{},[t.wrapperProps,(n=(c=t.block)==null?void 0:c.component)==null?void 0:n.options]),e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(d,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:r(),children:t.children})}):u.isEditing()?e.jsx(s,{Wrapper:t.Wrapper,id:t.block.id||"",attributes:r(),children:t.children}):e.jsx(t.Wrapper,{...a(),attributes:r(),children:t.children})})}module.exports=x;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { getBlockActions as
|
|
5
|
-
import { getBlockProperties as
|
|
6
|
-
import
|
|
7
|
-
|
|
2
|
+
import { jsx as e, Fragment as i } from "react/jsx-runtime";
|
|
3
|
+
import { useState as n, useEffect as l } from "react";
|
|
4
|
+
import { getBlockActions as m } from "../../../functions/get-block-actions.mjs";
|
|
5
|
+
import { getBlockProperties as d } from "../../../functions/get-block-properties.mjs";
|
|
6
|
+
import { isEditing as f } from "../../../functions/is-editing.mjs";
|
|
7
|
+
import "../../../helpers/user-attributes.mjs";
|
|
8
|
+
import "../../../functions/get-fetch.mjs";
|
|
9
|
+
import u from "../../awaiter.mjs";
|
|
10
|
+
import b from "../../live-edit.mjs";
|
|
11
|
+
function B(t) {
|
|
8
12
|
var o, c;
|
|
9
|
-
|
|
13
|
+
n(() => 0);
|
|
10
14
|
function r() {
|
|
11
15
|
return t.includeBlockProps ? {
|
|
12
|
-
...
|
|
16
|
+
...d({
|
|
13
17
|
block: t.block,
|
|
14
18
|
context: t.context
|
|
15
19
|
}),
|
|
16
|
-
...
|
|
20
|
+
...m({
|
|
17
21
|
block: t.block,
|
|
18
22
|
rootState: t.context.rootState,
|
|
19
23
|
rootSetState: t.context.rootSetState,
|
|
@@ -22,12 +26,12 @@ function h(t) {
|
|
|
22
26
|
})
|
|
23
27
|
} : {};
|
|
24
28
|
}
|
|
25
|
-
function
|
|
29
|
+
function a() {
|
|
26
30
|
return t.wrapperProps;
|
|
27
31
|
}
|
|
28
|
-
return
|
|
29
|
-
}, [t.wrapperProps, (c = (o = t.block) == null ? void 0 : o.component) == null ? void 0 : c.options]), /* @__PURE__ */ e(
|
|
30
|
-
|
|
32
|
+
return l(() => {
|
|
33
|
+
}, [t.wrapperProps, (c = (o = t.block) == null ? void 0 : o.component) == null ? void 0 : c.options]), /* @__PURE__ */ e(i, { children: t.Wrapper.load ? /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(
|
|
34
|
+
u,
|
|
31
35
|
{
|
|
32
36
|
load: t.Wrapper.load,
|
|
33
37
|
fallback: t.Wrapper.fallback,
|
|
@@ -35,8 +39,16 @@ function h(t) {
|
|
|
35
39
|
attributes: r(),
|
|
36
40
|
children: t.children
|
|
37
41
|
}
|
|
38
|
-
) }) : /* @__PURE__ */ e(
|
|
42
|
+
) }) : f() ? /* @__PURE__ */ e(
|
|
43
|
+
b,
|
|
44
|
+
{
|
|
45
|
+
Wrapper: t.Wrapper,
|
|
46
|
+
id: t.block.id || "",
|
|
47
|
+
attributes: r(),
|
|
48
|
+
children: t.children
|
|
49
|
+
}
|
|
50
|
+
) : /* @__PURE__ */ e(t.Wrapper, { ...a(), attributes: r(), children: t.children }) });
|
|
39
51
|
}
|
|
40
52
|
export {
|
|
41
|
-
|
|
53
|
+
B as default
|
|
42
54
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const r=require("react/jsx-runtime"),u=require("../../../constants/device-sizes.cjs"),w=require("../../../functions/camel-to-kebab-case.cjs"),D=require("../../../functions/get-processed-block.cjs"),l=require("../../../helpers/css.cjs"),I=require("../../../helpers/find-block.cjs"),z=require("../../../helpers/nullable.cjs"),M=require("../../inlined-styles.cjs");function U(i){function F(){return I.findBlockById(i.contextProvider.content,i.id)}function e(){var n;const t=F();return t?(n=t.repeat)!=null&&n.collection?t:D.getProcessedBlock({block:t,localState:i.contextProvider.localState,rootState:i.contextProvider.rootState,rootSetState:i.contextProvider.rootSetState,context:i.contextProvider.context}):null}function Q(){var t,s,n,c;return z.checkIsDefined((t=e==null?void 0:e())==null?void 0:t.hide)?!((s=e==null?void 0:e())!=null&&s.hide):z.checkIsDefined((n=e==null?void 0:e())==null?void 0:n.show)?(c=e==null?void 0:e())==null?void 0:c.show:!0}function d(){var f,v,g,b,P,k,q;const t=(f=e==null?void 0:e())==null?void 0:f.responsiveStyles,s=i.contextProvider.content,n=u.getSizesForBreakpoints(((v=s==null?void 0:s.meta)==null?void 0:v.breakpoints)||{}),c=!!((b=(g=s==null?void 0:s.meta)==null?void 0:g.breakpoints)!=null&&b.xsmall),S=t==null?void 0:t.large,y=t==null?void 0:t.medium,x=t==null?void 0:t.small,h=t==null?void 0:t.xsmall,a=(P=e==null?void 0:e())==null?void 0:P.id;if(!a)return"";const j=S?l.createCssClass({className:a,styles:S}):"",$=y?l.createCssClass({className:a,styles:y,mediaQuery:u.getMaxWidthQueryForSize("medium",n)}):"",T=x?l.createCssClass({className:a,styles:x,mediaQuery:u.getMaxWidthQueryForSize("small",n)}):"",W=h&&c?l.createCssClass({className:a,styles:h,mediaQuery:u.getMaxWidthQueryForSize("xsmall",n)}):"",o=e().animations&&e().animations.find(m=>m.trigger==="hover");let C="";if(o){const m=((q=(k=o.steps)==null?void 0:k[1])==null?void 0:q.styles)||{};C=l.createCssClass({className:`${a}:hover`,styles:{...m,transition:`all ${o.duration}s ${w.camelToKebabCase(o.easing)}`,transitionDelay:o.delay?`${o.delay}s`:"0s"}})||""}return[j,$,T,W,C].join(" ")}return r.jsx(r.Fragment,{children:d()&&Q()?r.jsx(r.Fragment,{children:r.jsx(M,{id:"builderio-block",styles:d(),nonce:i.contextProvider.nonce})}):null})}module.exports=U;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c, Fragment as $ } from "react/jsx-runtime";
|
|
3
|
+
import { getSizesForBreakpoints as D, getMaxWidthQueryForSize as u } from "../../../constants/device-sizes.mjs";
|
|
4
|
+
import { camelToKebabCase as N } from "../../../functions/camel-to-kebab-case.mjs";
|
|
5
|
+
import { getProcessedBlock as W } from "../../../functions/get-processed-block.mjs";
|
|
6
|
+
import { createCssClass as l } from "../../../helpers/css.mjs";
|
|
7
|
+
import { findBlockById as A } from "../../../helpers/find-block.mjs";
|
|
8
|
+
import { checkIsDefined as w } from "../../../helpers/nullable.mjs";
|
|
9
|
+
import E from "../../inlined-styles.mjs";
|
|
10
|
+
function O(i) {
|
|
11
|
+
function z() {
|
|
12
|
+
return A(i.contextProvider.content, i.id);
|
|
13
|
+
}
|
|
14
|
+
function t() {
|
|
15
|
+
var o;
|
|
16
|
+
const e = z();
|
|
17
|
+
return e ? (o = e.repeat) != null && o.collection ? e : W({
|
|
18
|
+
block: e,
|
|
19
|
+
localState: i.contextProvider.localState,
|
|
20
|
+
rootState: i.contextProvider.rootState,
|
|
21
|
+
rootSetState: i.contextProvider.rootSetState,
|
|
22
|
+
context: i.contextProvider.context
|
|
23
|
+
}) : null;
|
|
24
|
+
}
|
|
25
|
+
function F() {
|
|
26
|
+
var e, n, o, s;
|
|
27
|
+
return w((e = t == null ? void 0 : t()) == null ? void 0 : e.hide) ? !((n = t == null ? void 0 : t()) != null && n.hide) : w((o = t == null ? void 0 : t()) == null ? void 0 : o.show) ? (s = t == null ? void 0 : t()) == null ? void 0 : s.show : !0;
|
|
28
|
+
}
|
|
29
|
+
function d() {
|
|
30
|
+
var v, b, g, C, P, k, Q;
|
|
31
|
+
const e = (v = t == null ? void 0 : t()) == null ? void 0 : v.responsiveStyles, n = i.contextProvider.content, o = D(
|
|
32
|
+
((b = n == null ? void 0 : n.meta) == null ? void 0 : b.breakpoints) || {}
|
|
33
|
+
), s = !!((C = (g = n == null ? void 0 : n.meta) == null ? void 0 : g.breakpoints) != null && C.xsmall), S = e == null ? void 0 : e.large, f = e == null ? void 0 : e.medium, y = e == null ? void 0 : e.small, x = e == null ? void 0 : e.xsmall, r = (P = t == null ? void 0 : t()) == null ? void 0 : P.id;
|
|
34
|
+
if (!r)
|
|
35
|
+
return "";
|
|
36
|
+
const I = S ? l({
|
|
37
|
+
className: r,
|
|
38
|
+
styles: S
|
|
39
|
+
}) : "", T = f ? l({
|
|
40
|
+
className: r,
|
|
41
|
+
styles: f,
|
|
42
|
+
mediaQuery: u(
|
|
43
|
+
"medium",
|
|
44
|
+
o
|
|
45
|
+
)
|
|
46
|
+
}) : "", U = y ? l({
|
|
47
|
+
className: r,
|
|
48
|
+
styles: y,
|
|
49
|
+
mediaQuery: u(
|
|
50
|
+
"small",
|
|
51
|
+
o
|
|
52
|
+
)
|
|
53
|
+
}) : "", j = x && s ? l({
|
|
54
|
+
className: r,
|
|
55
|
+
styles: x,
|
|
56
|
+
mediaQuery: u(
|
|
57
|
+
"xsmall",
|
|
58
|
+
o
|
|
59
|
+
)
|
|
60
|
+
}) : "", a = t().animations && t().animations.find((m) => m.trigger === "hover");
|
|
61
|
+
let h = "";
|
|
62
|
+
if (a) {
|
|
63
|
+
const m = ((Q = (k = a.steps) == null ? void 0 : k[1]) == null ? void 0 : Q.styles) || {};
|
|
64
|
+
h = l({
|
|
65
|
+
className: `${r}:hover`,
|
|
66
|
+
styles: {
|
|
67
|
+
...m,
|
|
68
|
+
transition: `all ${a.duration}s ${N(
|
|
69
|
+
a.easing
|
|
70
|
+
)}`,
|
|
71
|
+
transitionDelay: a.delay ? `${a.delay}s` : "0s"
|
|
72
|
+
}
|
|
73
|
+
}) || "";
|
|
74
|
+
}
|
|
75
|
+
return [
|
|
76
|
+
I,
|
|
77
|
+
T,
|
|
78
|
+
U,
|
|
79
|
+
j,
|
|
80
|
+
h
|
|
81
|
+
].join(" ");
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ c($, { children: d() && F() ? /* @__PURE__ */ c($, { children: /* @__PURE__ */ c(
|
|
84
|
+
E,
|
|
85
|
+
{
|
|
86
|
+
id: "builderio-block",
|
|
87
|
+
styles: d(),
|
|
88
|
+
nonce: i.contextProvider.nonce
|
|
89
|
+
}
|
|
90
|
+
) }) : null });
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
O as default
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const e=require("react/jsx-runtime"),i=require("react"),u=require("../../../context/builder.context.cjs"),d=require("../../../functions/is-editing.cjs");require("../../../helpers/user-attributes.cjs");require("../../../functions/get-fetch.cjs");const n=require("./block-styles.cjs"),x=require("./live-edit-block-styles.cjs");function a(t){const[s,r]=i.useState(()=>!1),[c,o]=i.useState(()=>!1),l=i.useContext(u);return i.useEffect(()=>{r(d.isEditing()),o(!0)},[]),e.jsx(e.Fragment,{children:c?e.jsx(e.Fragment,{children:s?e.jsx(x,{id:t.block.id,contextProvider:l}):e.jsx(e.Fragment,{children:e.jsx(n,{block:t.block,context:t.context})})}):e.jsx(e.Fragment,{children:e.jsx(n,{block:t.block,context:t.context})})})}module.exports=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, Fragment as i } from "react/jsx-runtime";
|
|
3
|
+
import { useState as o, useContext as m, useEffect as f } from "react";
|
|
4
|
+
import a from "../../../context/builder.context.mjs";
|
|
5
|
+
import { isEditing as u } from "../../../functions/is-editing.mjs";
|
|
6
|
+
import "../../../helpers/user-attributes.mjs";
|
|
7
|
+
import "../../../functions/get-fetch.mjs";
|
|
8
|
+
import r from "./block-styles.mjs";
|
|
9
|
+
import x from "./live-edit-block-styles.mjs";
|
|
10
|
+
function p(e) {
|
|
11
|
+
const [n, c] = o(() => !1), [l, d] = o(() => !1), s = m(a);
|
|
12
|
+
return f(() => {
|
|
13
|
+
c(u()), d(!0);
|
|
14
|
+
}, []), /* @__PURE__ */ t(i, { children: l ? /* @__PURE__ */ t(i, { children: n ? /* @__PURE__ */ t(
|
|
15
|
+
x,
|
|
16
|
+
{
|
|
17
|
+
id: e.block.id,
|
|
18
|
+
contextProvider: s
|
|
19
|
+
}
|
|
20
|
+
) : /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(r, { block: e.block, context: e.context }) }) }) : /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(r, { block: e.block, context: e.context }) }) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
p as default
|
|
24
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("../../functions/is-editing.cjs");function d(e){const c=i.useRef(null);i.useState(()=>!1);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function s(){if(!e.path)return;const t="this.",n="component.options.";return e.path.startsWith(t)?e.path.replace(t,""):e.path.startsWith(n)?e.path:`${n}${e.path||""}`}function l(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}function u(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}return i.useEffect(()=>{},[]),i.useEffect(()=>{},[e.blocks]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-
|
|
1
|
+
"use client";"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("../../functions/is-editing.cjs");function d(e){const c=i.useRef(null);i.useState(()=>!1);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function s(){if(!e.path)return;const t="this.",n="component.options.";return e.path.startsWith(t)?e.path.replace(t,""):e.path.startsWith(n)?e.path:`${n}${e.path||""}`}function l(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}function u(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}return i.useEffect(()=>{},[]),i.useEffect(()=>{},[e.blocks]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-49da6528","builder-path":s(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>l(),onMouseEnter:t=>u(),onKeyPress:t=>l(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-49da6528 {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
@@ -52,7 +52,7 @@ function y(e) {
|
|
|
52
52
|
e.BlocksWrapper,
|
|
53
53
|
{
|
|
54
54
|
ref: c,
|
|
55
|
-
className: o() + " props-blocks-wrapper-
|
|
55
|
+
className: o() + " props-blocks-wrapper-49da6528",
|
|
56
56
|
"builder-path": a(),
|
|
57
57
|
"builder-parent-id": e.parent,
|
|
58
58
|
style: e.styleProp,
|
|
@@ -63,7 +63,7 @@ function y(e) {
|
|
|
63
63
|
children: e.children
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
|
-
/* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-
|
|
66
|
+
/* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-49da6528 {
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
69
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const D=require("react/jsx-runtime"),c=require("react"),$=require("../../../context/builder.context.cjs"),G=require("../../../functions/evaluate/evaluate.cjs"),z=require("../../../functions/fast-clone.cjs"),Q=require("../../../functions/get-content/index.cjs"),H=require("../../../functions/is-browser.cjs"),m=require("../../../functions/is-editing.cjs"),X=require("../../../functions/is-previewing.cjs"),Y=require("../../../functions/log-fetch.cjs"),Z=require("../../../functions/register-component.cjs"),K=require("../../../functions/track/index.cjs"),p=require("../../../functions/track/interaction.cjs"),O=require("../../../helpers/canTrack.cjs"),ee=require("../../../helpers/cookie.cjs"),te=require("../../../helpers/preview-lru-cache/set.cjs"),ne=require("../../../helpers/subscribe-to-editor.cjs"),ie=require("../../../scripts/init-editing.cjs"),ae=require("../../block/animator.cjs"),N=require("./enable-editor.helpers.cjs"),re=require("./styles.helpers.cjs"),oe=require("next/navigation");function ce(e){var P,R,L;const u=c.useRef(null);c.useState(()=>!1);const[h,E]=c.useState(()=>e.builderContextSignal),[V,_]=c.useState(()=>null),[U,j]=c.useState(()=>"");function g(i,t){var o,a,r,d;const n={...e.builderContextSignal.rootState,...i};if(e.builderContextSignal.rootSetState?(a=(o=e.builderContextSignal).rootSetState)==null||a.call(o,n):e.builderContextSignal.rootState=n,t==="server")e.builderContextSignal.rootSetState?(d=(r=e.builderContextSignal).rootSetState)==null||d.call(r,n):e.builderContextSignal.rootState=n;else{const l={...e.builderContextSignal,rootState:n};E(l)}}function v(i,t){var o,a,r,d,l;const n={...e.builderContextSignal.content,...i,data:{...(o=e.builderContextSignal.content)==null?void 0:o.data,...i==null?void 0:i.data},meta:{...(a=e.builderContextSignal.content)==null?void 0:a.meta,...i==null?void 0:i.meta,breakpoints:((r=i==null?void 0:i.meta)==null?void 0:r.breakpoints)||((l=(d=e.builderContextSignal.content)==null?void 0:d.meta)==null?void 0:l.breakpoints)}};if(t==="server")te.postPreviewContent({value:n,key:n.id,url:window.location.pathname});else{const b=JSON.parse(JSON.stringify(n)),s={...h,content:b};E(s)}}function B(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[F,de]=c.useState(()=>e.contentWrapper||"div");function C(i){return ne.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:n,contentId:o}=t;!o||o!==((a=e.builderContextSignal.content)==null?void 0:a.id)||n&&v({meta:{breakpoints:n}})},animation:t=>{ae.triggerAnimation(t)},contentUpdate:(t,n)=>{v(t,n)},stateUpdate:(t,n)=>{g(t,n)}}})(i)}const[q,le]=c.useState(()=>({})),[x,se]=c.useState(()=>({})),[y,W]=c.useState(()=>!1);function A(i){var t,n;if(e.builderContextSignal.content){const o=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(n=e.builderContextSignal.content)==null?void 0:n.id;K._track({apiHost:e.apiHost,type:"click",canTrack:O.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:o!==a?o:void 0,...p.getInteractionPropertiesForEvent(i),unique:!y})}y||W(!0)}function J(){var t,n,o;const i=(o=(n=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:n.httpRequests)!=null?o:{};Object.entries(i).forEach(([a,r])=>{if(!r)return;const d=typeof r=="object"&&r["@type"]==="@builder.io/core:Request";if(x[a]||q[a]&&!m.isEditing())return;const l=d?r.request.url:r;x[a]=!0;const b=l.replace(/{{([^}]+)}}/g,(f,M)=>String(G.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))),s=d?{url:b,method:r.request.method,headers:r.request.headers,body:r.request.body}:{url:b,method:"GET"};Y.logFetch(JSON.stringify(s));const T={method:s.method,headers:s.headers,body:s.body};s.method==="GET"&&delete T.body,fetch(s.url,T).then(f=>f.json()).then(f=>{g({[a]:f}),q[a]=!0}).catch(f=>{console.error("error fetching dynamic data",JSON.stringify(r),f)}).finally(()=>{x[a]=!1})})}function S(){m.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:z.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function I(i){var t;window.addEventListener("message",C),ie.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{},modelName:(t=e.model)!=null?t:"",apiKey:e.apiKey}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var o,a;if(!((o=n.models)!=null&&o.length)||n.models.includes(e.model)){const r=Z.createRegisterComponentMessage(n);(a=window.parent)==null||a.postMessage(r,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",S)}function w(i){var r;const t=new URL(location.href).searchParams,n=t.get("builder.preview"),o=t.get(`builder.overrides.${n}`),a=t.get("apiKey")||t.get("builder.space");(n==="BUILDER_STUDIO"||n===e.model&&a===e.apiKey&&(!e.content||o===e.content.id))&&Q.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...n==="BUILDER_STUDIO"&&((r=e.context)!=null&&r.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(d=>{d&&v(d)})}oe.useRouter();const k=c.useRef(!1);return k.current||(J(),S(),k.current=!0),c.useEffect(()=>{var i;return(i=u.current)==null||i.addEventListener("initeditingbldr",I),()=>{var t;return(t=u.current)==null?void 0:t.removeEventListener("initeditingbldr",I)}},[]),c.useEffect(()=>{var i;return(i=u.current)==null||i.addEventListener("initpreviewingbldr",w),()=>{var t;return(t=u.current)==null?void 0:t.removeEventListener("initpreviewingbldr",w)}},[]),c.useEffect(()=>{var i,t,n;if(H.isBrowser()){m.isEditing()&&!e.isNestedRender&&u.current&&u.current.dispatchEvent(new CustomEvent("initeditingbldr"));const o=e.builderContextSignal.content&&O.getDefaultCanTrack(e.canTrack),a=ee.getCookieSync({name:`builder.tests.${(i=e.builderContextSignal.content)==null?void 0:i.id}`,canTrack:!0}),r=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId;if(o&&r===a){const d=(n=e.builderContextSignal.content)==null?void 0:n.id,l=e.apiKey;K._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:d,apiKey:l,variationId:a!==d?a:void 0})}X.isPreviewing()&&m.isEditing()}},[]),c.useEffect(()=>{},[e.content]),c.useEffect(()=>{S()},[e.builderContextSignal.rootState]),c.useEffect(()=>{if(e.data){if(V===e.data)return;g(e.data),_(e.data)}},[e.data]),c.useEffect(()=>{if(e.locale){if(U===e.locale)return;g({locale:e.locale}),j(e.locale)}},[e.locale]),c.useEffect(()=>()=>{H.isBrowser()&&(window.removeEventListener("message",C),window.removeEventListener("builder:component:stateChangeListenerActivated",S))},[]),D.jsx($.Provider,{value:h,children:e.builderContextSignal.content||N.needsElementRefDivForEditing()?D.jsx(F,{ref:u,onClick:i=>A(i),"builder-content-id":(P=e.builderContextSignal.content)==null?void 0:P.id,"builder-model":e.model,className:re.getWrapperClassName(((R=e.content)==null?void 0:R.testVariationId)||((L=e.content)==null?void 0:L.id)),style:{display:!e.builderContextSignal.content&&N.needsElementRefDivForEditing()?"none":void 0},...B(),...e.contentWrapperProps,children:e.children}):null})}module.exports=ce;
|