@builder.io/sdk-react-nextjs 0.16.15 → 0.16.16
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/text/text.cjs +1 -1
- package/lib/browser/blocks/text/text.mjs +7 -8
- package/lib/browser/components/block/block.helpers.cjs +1 -1
- package/lib/browser/components/block/block.helpers.mjs +11 -12
- package/lib/browser/components/content/components/enable-editor.cjs +1 -1
- package/lib/browser/components/content/components/enable-editor.mjs +9 -10
- package/lib/browser/components/content/content.cjs +1 -1
- package/lib/browser/components/content/content.mjs +9 -13
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/functions/evaluate/evaluate.cjs +1 -1
- package/lib/browser/functions/evaluate/evaluate.mjs +37 -59
- package/lib/browser/functions/get-block-actions-handler.cjs +1 -1
- package/lib/browser/functions/get-block-actions-handler.mjs +3 -4
- package/lib/browser/functions/get-processed-block.cjs +1 -1
- package/lib/browser/functions/get-processed-block.mjs +6 -7
- package/lib/browser/functions/get.cjs +1 -0
- package/lib/browser/functions/get.mjs +7 -0
- package/lib/edge/blocks/text/text.cjs +1 -1
- package/lib/edge/blocks/text/text.mjs +7 -8
- package/lib/edge/components/block/block.helpers.cjs +1 -1
- package/lib/edge/components/block/block.helpers.mjs +11 -12
- package/lib/edge/components/content/components/enable-editor.cjs +1 -1
- package/lib/edge/components/content/components/enable-editor.mjs +9 -10
- package/lib/edge/components/content/content.cjs +1 -1
- package/lib/edge/components/content/content.mjs +9 -13
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/functions/evaluate/evaluate.cjs +1 -1
- package/lib/edge/functions/evaluate/evaluate.mjs +37 -59
- package/lib/edge/functions/get-block-actions-handler.cjs +1 -1
- package/lib/edge/functions/get-block-actions-handler.mjs +3 -4
- package/lib/edge/functions/get-processed-block.cjs +1 -1
- package/lib/edge/functions/get-processed-block.mjs +6 -7
- package/lib/edge/functions/get.cjs +1 -0
- package/lib/edge/functions/get.mjs +7 -0
- package/lib/node/blocks/text/text.cjs +1 -1
- package/lib/node/blocks/text/text.mjs +7 -8
- package/lib/node/components/block/block.helpers.cjs +1 -1
- package/lib/node/components/block/block.helpers.mjs +11 -12
- package/lib/node/components/content/components/enable-editor.cjs +1 -1
- package/lib/node/components/content/components/enable-editor.mjs +9 -10
- package/lib/node/components/content/content.cjs +1 -1
- package/lib/node/components/content/content.mjs +9 -13
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/functions/evaluate/evaluate.cjs +1 -1
- package/lib/node/functions/evaluate/evaluate.mjs +37 -59
- package/lib/node/functions/get-block-actions-handler.cjs +1 -1
- package/lib/node/functions/get-block-actions-handler.mjs +3 -4
- package/lib/node/functions/get-processed-block.cjs +1 -1
- package/lib/node/functions/get-processed-block.mjs +6 -7
- package/lib/node/functions/get.cjs +1 -0
- package/lib/node/functions/get.mjs +7 -0
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/evaluate/evaluate.d.ts +2 -1
- package/types/cjs/functions/evaluate/helpers.d.ts +0 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/evaluate.d.ts +2 -1
- package/types/esm/functions/evaluate/helpers.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),i=require("../../functions/evaluate/evaluate.cjs");function l(t){const n=function(){var e;const o=t.builderContext,{context:r,localState:c,rootState:s,rootSetState:u}=o;return String(((e=t.text)==null?void 0:e.toString())||"").replace(/{{([^}]+)}}/g,(S,x)=>i.evaluate({code:x,context:r,localState:c,rootState:s,rootSetState:u}))};return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}module.exports=l;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { evaluate as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { evaluate as l } from "../../functions/evaluate/evaluate.mjs";
|
|
3
3
|
function f(t) {
|
|
4
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ a(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
className: "builder-text",
|
|
@@ -11,17 +11,16 @@ function f(t) {
|
|
|
11
11
|
context: n,
|
|
12
12
|
localState: r,
|
|
13
13
|
rootState: c,
|
|
14
|
-
rootSetState:
|
|
14
|
+
rootSetState: s
|
|
15
15
|
} = o;
|
|
16
16
|
return String(((e = t.text) == null ? void 0 : e.toString()) || "").replace(
|
|
17
17
|
/{{([^}]+)}}/g,
|
|
18
|
-
(d,
|
|
19
|
-
code:
|
|
18
|
+
(d, x) => l({
|
|
19
|
+
code: x,
|
|
20
20
|
context: n,
|
|
21
21
|
localState: r,
|
|
22
22
|
rootState: c,
|
|
23
|
-
rootSetState:
|
|
24
|
-
enableCache: !1
|
|
23
|
+
rootSetState: s
|
|
25
24
|
})
|
|
26
25
|
);
|
|
27
26
|
}() },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../functions/evaluate/evaluate.cjs"),l=({block:t,registeredComponents:r})=>{var o;const e=(o=t.component)==null?void 0:o.name;if(!e)return null;const n=r[e];if(n)return n;console.warn(`
|
|
2
2
|
Could not find a registered component named "${e}".
|
|
3
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},p=({block:t,context:r})=>{const{repeat:e,...n}=t;if(!(e!=null&&e.collection))return;const o=s.evaluate({code:e.collection,localState:r.localState,rootState:r.rootState,rootSetState:r.rootSetState,context:r.context
|
|
3
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},p=({block:t,context:r})=>{const{repeat:e,...n}=t;if(!(e!=null&&e.collection))return;const o=s.evaluate({code:e.collection,localState:r.localState,rootState:r.rootState,rootSetState:r.rootSetState,context:r.context});if(!Array.isArray(o))return;const i=e.collection.split(".").pop(),d=e.itemName||(i?i+"Item":"item");return o.map((u,a)=>({context:{...r,localState:{...r.localState,$index:a,$item:u,[d]:u,[`$${d}Index`]:a}},block:n}))},m=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderLinkComponent?{builderLinkComponent:r}:{}},c=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderComponents?{builderComponents:r}:{}},v=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderBlock?{builderBlock:r}:{}},C=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderContext?{builderContext:r}:{}};exports.getComponent=l;exports.getRepeatItemData=p;exports.provideBuilderBlock=v;exports.provideBuilderContext=C;exports.provideLinkComponent=m;exports.provideRegisteredComponents=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { evaluate as
|
|
1
|
+
import { evaluate as a } from "../../functions/evaluate/evaluate.mjs";
|
|
2
2
|
const m = ({
|
|
3
3
|
block: t,
|
|
4
4
|
registeredComponents: r
|
|
@@ -23,26 +23,25 @@ const m = ({
|
|
|
23
23
|
} = t;
|
|
24
24
|
if (!(e != null && e.collection))
|
|
25
25
|
return;
|
|
26
|
-
const o =
|
|
26
|
+
const o = a({
|
|
27
27
|
code: e.collection,
|
|
28
28
|
localState: r.localState,
|
|
29
29
|
rootState: r.rootState,
|
|
30
30
|
rootSetState: r.rootSetState,
|
|
31
|
-
context: r.context
|
|
32
|
-
enableCache: !0
|
|
31
|
+
context: r.context
|
|
33
32
|
});
|
|
34
33
|
if (!Array.isArray(o))
|
|
35
34
|
return;
|
|
36
|
-
const i = e.collection.split(".").pop(),
|
|
37
|
-
return o.map((
|
|
35
|
+
const i = e.collection.split(".").pop(), d = e.itemName || (i ? i + "Item" : "item");
|
|
36
|
+
return o.map((s, u) => ({
|
|
38
37
|
context: {
|
|
39
38
|
...r,
|
|
40
39
|
localState: {
|
|
41
40
|
...r.localState,
|
|
42
|
-
$index:
|
|
43
|
-
$item:
|
|
44
|
-
[
|
|
45
|
-
[`$${
|
|
41
|
+
$index: u,
|
|
42
|
+
$item: s,
|
|
43
|
+
[d]: s,
|
|
44
|
+
[`$${d}Index`]: u
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
47
|
block: n
|
|
@@ -62,7 +61,7 @@ const m = ({
|
|
|
62
61
|
return (e = t == null ? void 0 : t.shouldReceiveBuilderProps) != null && e.builderBlock ? {
|
|
63
62
|
builderBlock: r
|
|
64
63
|
} : {};
|
|
65
|
-
},
|
|
64
|
+
}, S = (t, r) => {
|
|
66
65
|
var e;
|
|
67
66
|
return (e = t == null ? void 0 : t.shouldReceiveBuilderProps) != null && e.builderContext ? {
|
|
68
67
|
builderContext: r
|
|
@@ -72,7 +71,7 @@ export {
|
|
|
72
71
|
m as getComponent,
|
|
73
72
|
c as getRepeatItemData,
|
|
74
73
|
C as provideBuilderBlock,
|
|
75
|
-
|
|
74
|
+
S as provideBuilderContext,
|
|
76
75
|
f as provideLinkComponent,
|
|
77
76
|
v as provideRegisteredComponents
|
|
78
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),W=require("../../../context/builder.context.cjs"),A=require("../../../functions/evaluate/evaluate.cjs"),B=require("../../../functions/fast-clone.cjs"),D=require("../../../functions/get-content/index.cjs"),P=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),N=require("../../../functions/is-previewing.cjs"),U=require("../../../functions/register-component.cjs"),R=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),F=require("../../../helpers/preview-lru-cache/set.cjs"),$=require("../../../helpers/subscribe-to-editor.cjs"),L=require("../../../scripts/init-editing.cjs"),z=require("../../block/animator.cjs"),G=require("./styles.helpers.cjs"),J=require("next/navigation");function Q(e){var q,w,I;const d=o.useRef(null);function f(n){var r,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(r=e.builderContextSignal).rootSetState)==null||i.call(r,t):e.builderContextSignal.rootState=t}function b(n){var r,i,a,c,u;const t={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((a=n==null?void 0:n.meta)==null?void 0:a.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};F.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function K(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[T,X]=o.useState(()=>e.contentWrapper||"div");function S(n){return $.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:r,contentId:i}=t;!i||i!==((a=e.builderContextSignal.content)==null?void 0:a.id)||r&&b({meta:{breakpoints:r}})},animation:t=>{z.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Y]=o.useState(()=>({})),[m,Z]=o.useState(()=>({})),[h,H]=o.useState(()=>!1);function _(n){var t,r;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(r=e.builderContextSignal.content)==null?void 0:r.id;R._track({type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:i!==a?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||H(!0)}function j(){var t,r,i;const n=(i=(r=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:r.httpRequests)!=null?i:{};Object.entries(n).forEach(([a,c])=>{if(!c||m[a]||v[a]&&!g.isEditing())return;m[a]=!0;const u=c.replace(/{{([^}]+)}}/g,(s,M)=>String(A.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState
|
|
1
|
+
"use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),W=require("../../../context/builder.context.cjs"),A=require("../../../functions/evaluate/evaluate.cjs"),B=require("../../../functions/fast-clone.cjs"),D=require("../../../functions/get-content/index.cjs"),P=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),N=require("../../../functions/is-previewing.cjs"),U=require("../../../functions/register-component.cjs"),R=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),F=require("../../../helpers/preview-lru-cache/set.cjs"),$=require("../../../helpers/subscribe-to-editor.cjs"),L=require("../../../scripts/init-editing.cjs"),z=require("../../block/animator.cjs"),G=require("./styles.helpers.cjs"),J=require("next/navigation");function Q(e){var q,w,I;const d=o.useRef(null);function f(n){var r,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(r=e.builderContextSignal).rootSetState)==null||i.call(r,t):e.builderContextSignal.rootState=t}function b(n){var r,i,a,c,u;const t={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((a=n==null?void 0:n.meta)==null?void 0:a.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};F.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function K(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[T,X]=o.useState(()=>e.contentWrapper||"div");function S(n){return $.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:r,contentId:i}=t;!i||i!==((a=e.builderContextSignal.content)==null?void 0:a.id)||r&&b({meta:{breakpoints:r}})},animation:t=>{z.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Y]=o.useState(()=>({})),[m,Z]=o.useState(()=>({})),[h,H]=o.useState(()=>!1);function _(n){var t,r;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(r=e.builderContextSignal.content)==null?void 0:r.id;R._track({type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:i!==a?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||H(!0)}function j(){var t,r,i;const n=(i=(r=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:r.httpRequests)!=null?i:{};Object.entries(n).forEach(([a,c])=>{if(!c||m[a]||v[a]&&!g.isEditing())return;m[a]=!0;const u=c.replace(/{{([^}]+)}}/g,(s,M)=>String(A.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));fetch(u).then(s=>s.json()).then(s=>{f({[a]:s}),v[a]=!0}).catch(s=>{console.error("error fetching dynamic data",c,s)}).finally(()=>{m[a]=!1})})}function l(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:B.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),L.registerInsertMenu(),L.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const r=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",l)}function x(n){const t=new URL(location.href).searchParams,r=t.get("builder.preview"),i=t.get(`builder.overrides.${r}`),a=t.get("apiKey")||t.get("builder.space");r===e.model&&a===e.apiKey&&(!e.content||i===e.content.id)&&D.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=J.useRouter(),C=o.useRef(!1);return C.current||(j(),l(),C.current=!0),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(P.isBrowser()){if(g.isEditing()&&d.current&&d.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,a=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;R._track({type:"impression",canTrack:!0,contentId:a,apiKey:c,variationId:i!==a?i:void 0})}N.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{l()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{P.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",l))},[]),k.jsx(W.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(T,{ref:d,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:G.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...K(),...e.contentWrapperProps,children:e.children}):null})}module.exports=Q;
|
|
@@ -18,7 +18,7 @@ import { registerInsertMenu as G, setupBrowserForEditing as J } from "../../../s
|
|
|
18
18
|
import { triggerAnimation as Q } from "../../block/animator.mjs";
|
|
19
19
|
import { getWrapperClassName as X } from "./styles.helpers.mjs";
|
|
20
20
|
import { useRouter as Y } from "next/navigation";
|
|
21
|
-
function
|
|
21
|
+
function Ce(e) {
|
|
22
22
|
var w, k, P;
|
|
23
23
|
const d = L(null);
|
|
24
24
|
function g(n) {
|
|
@@ -83,7 +83,7 @@ function xe(e) {
|
|
|
83
83
|
}
|
|
84
84
|
})(n);
|
|
85
85
|
}
|
|
86
|
-
const [h, p] = m(() => ({})), [S, ee] = m(() => ({})), [
|
|
86
|
+
const [h, p] = m(() => ({})), [S, ee] = m(() => ({})), [x, V] = m(() => !1);
|
|
87
87
|
function M(n) {
|
|
88
88
|
var t, r;
|
|
89
89
|
if (e.builderContextSignal.content) {
|
|
@@ -95,10 +95,10 @@ function xe(e) {
|
|
|
95
95
|
apiKey: e.apiKey,
|
|
96
96
|
variationId: i !== a ? i : void 0,
|
|
97
97
|
...F(n),
|
|
98
|
-
unique: !
|
|
98
|
+
unique: !x
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
x || V(!0);
|
|
102
102
|
}
|
|
103
103
|
function W() {
|
|
104
104
|
var t, r, i;
|
|
@@ -115,8 +115,7 @@ function xe(e) {
|
|
|
115
115
|
context: e.context || {},
|
|
116
116
|
localState: void 0,
|
|
117
117
|
rootState: e.builderContextSignal.rootState,
|
|
118
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
119
|
-
enableCache: !0
|
|
118
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
120
119
|
})
|
|
121
120
|
)
|
|
122
121
|
);
|
|
@@ -146,7 +145,7 @@ function xe(e) {
|
|
|
146
145
|
)
|
|
147
146
|
);
|
|
148
147
|
}
|
|
149
|
-
function
|
|
148
|
+
function C(n) {
|
|
150
149
|
window.addEventListener("message", v), G(), J({
|
|
151
150
|
...e.locale ? {
|
|
152
151
|
locale: e.locale
|
|
@@ -185,12 +184,12 @@ function xe(e) {
|
|
|
185
184
|
var n;
|
|
186
185
|
return (n = d.current) == null || n.addEventListener(
|
|
187
186
|
"initeditingbldr",
|
|
188
|
-
|
|
187
|
+
C
|
|
189
188
|
), () => {
|
|
190
189
|
var t;
|
|
191
190
|
return (t = d.current) == null ? void 0 : t.removeEventListener(
|
|
192
191
|
"initeditingbldr",
|
|
193
|
-
|
|
192
|
+
C
|
|
194
193
|
);
|
|
195
194
|
};
|
|
196
195
|
}, []), c(() => {
|
|
@@ -251,5 +250,5 @@ function xe(e) {
|
|
|
251
250
|
) : null });
|
|
252
251
|
}
|
|
253
252
|
export {
|
|
254
|
-
|
|
253
|
+
Ce as default
|
|
255
254
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),y=require("../../constants/builder-registered-components.cjs"),W=require("../../functions/evaluate/evaluate.cjs"),f=require("../../functions/register-component.cjs"),j=require("../../helpers/logger.cjs"),P=require("../blocks/blocks.cjs"),R=require("../content-variants/helpers.cjs"),V=require("../inlined-script.cjs"),K=require("./components/enable-editor.cjs"),T=require("./components/styles.cjs"),q=require("./content.helpers.cjs");function F(e){var a,r,l,s,u,d,g,C,S,m,k,x,b;const v=R.getUpdateVariantVisibilityScript({variationId:(a=e.content)==null?void 0:a.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),I=[...y.getDefaultRegisteredComponents(),...((l=e.customComponents)==null?void 0:l.filter(({models:t})=>!(t!=null&&t.length)||!e.model?!0:t.includes(e.model)))||[]].reduce((t,{component:h,...o})=>({...t,[o.name]:{component:h,...f.serializeIncludingFunctions(o)}}),{}),n={content:q.getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:q.getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...y.getDefaultRegisteredComponents(),...((s=e.customComponents)==null?void 0:s.filter(({models:t})=>!(t!=null&&t.length)||!e.model?!0:t.includes(e.model)))||[]].reduce((t,{component:h,...o})=>({...t,[o.name]:f.serializeIncludingFunctions(o)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""};e.apiKey||j.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const i=(d=(u=n.content)==null?void 0:u.data)==null?void 0:d.jsCode;return i&&W.evaluate({code:i,context:e.context||{},localState:void 0,rootState:n.rootState,rootSetState:t=>{n.rootState=t},isExpression:!1}),c.jsxs(K,{nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:n,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(V,{id:"builderio-variant-visibility",scriptStr:v,nonce:e.nonce||""}):null,c.jsx(T,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(g=n.content)==null?void 0:g.id,cssCode:(S=(C=n.content)==null?void 0:C.data)==null?void 0:S.cssCode,customFonts:(k=(m=n.content)==null?void 0:m.data)==null?void 0:k.customFonts}),c.jsx(P,{blocks:(b=(x=n.content)==null?void 0:x.data)==null?void 0:b.blocks,context:n,registeredComponents:I,linkComponent:e.linkComponent})]})}module.exports=F;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as W, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { getDefaultRegisteredComponents as
|
|
2
|
+
import { getDefaultRegisteredComponents as I } from "../../constants/builder-registered-components.mjs";
|
|
3
3
|
import { evaluate as P } from "../../functions/evaluate/evaluate.mjs";
|
|
4
|
-
import { serializeIncludingFunctions as
|
|
4
|
+
import { serializeIncludingFunctions as b } from "../../functions/register-component.mjs";
|
|
5
5
|
import { logger as V } from "../../helpers/logger.mjs";
|
|
6
6
|
import K from "../blocks/blocks.mjs";
|
|
7
7
|
import { getUpdateVariantVisibilityScript as T } from "../content-variants/helpers.mjs";
|
|
@@ -11,20 +11,20 @@ import A from "./components/styles.mjs";
|
|
|
11
11
|
import { getContentInitialValue as B, getRootStateInitialValue as E } from "./content.helpers.mjs";
|
|
12
12
|
function L(t) {
|
|
13
13
|
var c, r, l, d, u, m, s, f, C, S, k, g, x;
|
|
14
|
-
const
|
|
14
|
+
const h = T({
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
16
16
|
variationId: (c = t.content) == null ? void 0 : c.testVariationId,
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
18
18
|
contentId: (r = t.content) == null ? void 0 : r.id
|
|
19
19
|
}), v = [
|
|
20
|
-
...
|
|
20
|
+
...I(),
|
|
21
21
|
...((l = t.customComponents) == null ? void 0 : l.filter(({ models: e }) => !(e != null && e.length) || !t.model ? !0 : e.includes(t.model))) || []
|
|
22
22
|
].reduce(
|
|
23
23
|
(e, { component: y, ...o }) => ({
|
|
24
24
|
...e,
|
|
25
25
|
[o.name]: {
|
|
26
26
|
component: y,
|
|
27
|
-
...
|
|
27
|
+
...b(o)
|
|
28
28
|
}
|
|
29
29
|
}),
|
|
30
30
|
{}
|
|
@@ -45,12 +45,12 @@ function L(t) {
|
|
|
45
45
|
apiKey: t.apiKey,
|
|
46
46
|
apiVersion: t.apiVersion,
|
|
47
47
|
componentInfos: [
|
|
48
|
-
...
|
|
48
|
+
...I(),
|
|
49
49
|
...((d = t.customComponents) == null ? void 0 : d.filter(({ models: e }) => !(e != null && e.length) || !t.model ? !0 : e.includes(t.model))) || []
|
|
50
50
|
].reduce(
|
|
51
51
|
(e, { component: y, ...o }) => ({
|
|
52
52
|
...e,
|
|
53
|
-
[o.name]:
|
|
53
|
+
[o.name]: b(o)
|
|
54
54
|
}),
|
|
55
55
|
{}
|
|
56
56
|
),
|
|
@@ -71,11 +71,7 @@ function L(t) {
|
|
|
71
71
|
rootSetState: (e) => {
|
|
72
72
|
n.rootState = e;
|
|
73
73
|
},
|
|
74
|
-
isExpression: !1
|
|
75
|
-
/**
|
|
76
|
-
* We don't want to cache the result of the JS code, since it's arbitrary side effect code.
|
|
77
|
-
*/
|
|
78
|
-
enableCache: !1
|
|
74
|
+
isExpression: !1
|
|
79
75
|
}), /* @__PURE__ */ W(
|
|
80
76
|
R,
|
|
81
77
|
{
|
|
@@ -98,7 +94,7 @@ function L(t) {
|
|
|
98
94
|
j,
|
|
99
95
|
{
|
|
100
96
|
id: "builderio-variant-visibility",
|
|
101
|
-
scriptStr:
|
|
97
|
+
scriptStr: h,
|
|
102
98
|
nonce: t.nonce || ""
|
|
103
99
|
}
|
|
104
100
|
) : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.16";exports.SDK_VERSION=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../../helpers/logger.cjs"),E=require("../get.cjs"),h=require("./choose-eval.cjs"),l=require("./helpers.cjs"),p=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,d=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,g=e=>{var s,t,r,i,n,a;return((r=(t=(s=p.exec(e.trim()))==null?void 0:s.groups)==null?void 0:t.getPath)==null?void 0:r.slice(1))||((a=(n=(i=d.exec(e.trim()))==null?void 0:i.groups)==null?void 0:n.getPath)==null?void 0:a.slice(1))};function m({code:e,context:s,localState:t,rootState:r,rootSetState:i,event:n,isExpression:a=!0}){if(e.trim()==="")return;const o=g(e.trim());if(o)return E.get({...r,...t},o);const c={code:l.parseCode(e,{isExpression:a}),builder:l.getBuilderGlobals(),context:s,event:n,rootSetState:i,rootState:r,localState:t};try{return h.chooseBrowserOrServerEval(c)}catch(u){v.logger.error("Failed code evaluation: "+u.message,{code:e});return}}exports.evaluate=m;exports.getSimpleExpressionGetPath=g;
|
|
@@ -1,71 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
static getCacheKey(e) {
|
|
9
|
-
return JSON.stringify({
|
|
10
|
-
...e,
|
|
11
|
-
// replace the event with a random number to break cache
|
|
12
|
-
// thats because we can't serialize the event object due to circular refs in DOM node refs.
|
|
13
|
-
event: e.event ? Math.random() : void 0
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
static getCachedValue(e) {
|
|
17
|
-
return a.cache.get(e);
|
|
18
|
-
}
|
|
19
|
-
static setCachedValue(e, t) {
|
|
20
|
-
a.cache.size > 20 && a.cache.delete(a.cache.keys().next().value), a.cache.set(e, {
|
|
21
|
-
value: t
|
|
22
|
-
});
|
|
23
|
-
}
|
|
1
|
+
import { logger as l } from "../../helpers/logger.mjs";
|
|
2
|
+
import { get as m } from "../get.mjs";
|
|
3
|
+
import { chooseBrowserOrServerEval as E } from "./choose-eval.mjs";
|
|
4
|
+
import { parseCode as c, getBuilderGlobals as v } from "./helpers.mjs";
|
|
5
|
+
const p = /^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/, h = /(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/, _ = (r) => {
|
|
6
|
+
var s, e, t, i, o, a;
|
|
7
|
+
return ((t = (e = (s = p.exec(r.trim())) == null ? void 0 : s.groups) == null ? void 0 : e.getPath) == null ? void 0 : t.slice(1)) || ((a = (o = (i = h.exec(r.trim())) == null ? void 0 : i.groups) == null ? void 0 : o.getPath) == null ? void 0 : a.slice(1));
|
|
24
8
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
event: d,
|
|
34
|
-
isExpression: g = !0,
|
|
35
|
-
enableCache: u
|
|
9
|
+
function w({
|
|
10
|
+
code: r,
|
|
11
|
+
context: s,
|
|
12
|
+
localState: e,
|
|
13
|
+
rootState: t,
|
|
14
|
+
rootSetState: i,
|
|
15
|
+
event: o,
|
|
16
|
+
isExpression: a = !0
|
|
36
17
|
}) {
|
|
37
|
-
if (
|
|
18
|
+
if (r.trim() === "")
|
|
38
19
|
return;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
const n = _(r.trim());
|
|
21
|
+
if (n)
|
|
22
|
+
return m({
|
|
23
|
+
...t,
|
|
24
|
+
...e
|
|
25
|
+
}, n);
|
|
26
|
+
const g = {
|
|
27
|
+
code: c(r, {
|
|
28
|
+
isExpression: a
|
|
42
29
|
}),
|
|
43
|
-
builder:
|
|
44
|
-
context:
|
|
45
|
-
event:
|
|
46
|
-
rootSetState:
|
|
47
|
-
rootState:
|
|
48
|
-
localState:
|
|
30
|
+
builder: v(),
|
|
31
|
+
context: s,
|
|
32
|
+
event: o,
|
|
33
|
+
rootSetState: i,
|
|
34
|
+
rootState: t,
|
|
35
|
+
localState: e
|
|
49
36
|
};
|
|
50
|
-
if (u && !C) {
|
|
51
|
-
const r = o.getCacheKey(s), i = o.getCachedValue(r);
|
|
52
|
-
if (i)
|
|
53
|
-
return i.value;
|
|
54
|
-
}
|
|
55
37
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return r;
|
|
62
|
-
} catch (r) {
|
|
63
|
-
v.error("Failed code evaluation: " + r.message, {
|
|
64
|
-
code: c
|
|
38
|
+
return E(g);
|
|
39
|
+
} catch (u) {
|
|
40
|
+
l.error("Failed code evaluation: " + u.message, {
|
|
41
|
+
code: r
|
|
65
42
|
});
|
|
66
43
|
return;
|
|
67
44
|
}
|
|
68
45
|
}
|
|
69
46
|
export {
|
|
70
|
-
|
|
47
|
+
w as evaluate,
|
|
48
|
+
_ as getSimpleExpressionGetPath
|
|
71
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./evaluate/evaluate.cjs"),o=(t,e)=>a=>r.evaluate({code:t,context:e.context,localState:e.localState,rootState:e.rootState,rootSetState:e.rootSetState,event:a,isExpression:!1
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./evaluate/evaluate.cjs"),o=(t,e)=>a=>r.evaluate({code:t,context:e.context,localState:e.localState,rootState:e.rootState,rootSetState:e.rootSetState,event:a,isExpression:!1});exports.createEventHandler=o;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { evaluate as o } from "./evaluate/evaluate.mjs";
|
|
2
|
-
const
|
|
2
|
+
const S = (e, t) => (a) => o({
|
|
3
3
|
code: e,
|
|
4
4
|
context: t.context,
|
|
5
5
|
localState: t.localState,
|
|
6
6
|
rootState: t.rootState,
|
|
7
7
|
rootSetState: t.rootSetState,
|
|
8
8
|
event: a,
|
|
9
|
-
isExpression: !1
|
|
10
|
-
enableCache: !0
|
|
9
|
+
isExpression: !1
|
|
11
10
|
});
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
S as createEventHandler
|
|
14
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../constants/target.cjs"),l=require("../helpers/omit.cjs"),p=require("./evaluate/evaluate.cjs"),f=require("./fast-clone.cjs"),g=require("./set.cjs"),m=require("./transform-block.cjs");function o(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>o(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}const y=["svelte","vue","angular","qwik","solid"].includes(d.TARGET),C=e=>{if(y){const t=f.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=o(l.omit(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},q=({block:e,context:t,localState:n,rootState:s,rootSetState:c})=>{if(!e.bindings)return e;const i=C(e);for(const r in e.bindings){const a=e.bindings[r],u=p.evaluate({code:a,localState:n,rootState:s,rootSetState:c,context:t});g.set(i,r,u)}return i};function v({block:e,context:t,shouldEvaluateBindings:n,localState:s,rootState:c,rootSetState:i}){const r=m.transformBlock(e);return n?q({block:r,localState:s,rootState:c,rootSetState:i,context:t}):r}exports.deepCloneWithConditions=o;exports.getProcessedBlock=v;
|
|
@@ -16,8 +16,8 @@ function c(e) {
|
|
|
16
16
|
r !== "meta" && Object.prototype.hasOwnProperty.call(e, r) && (t[r] = c(e[r]));
|
|
17
17
|
return t;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
19
|
+
const g = ["svelte", "vue", "angular", "qwik", "solid"].includes(d), C = (e) => {
|
|
20
|
+
if (g) {
|
|
21
21
|
const t = u(e);
|
|
22
22
|
return {
|
|
23
23
|
...t,
|
|
@@ -42,7 +42,7 @@ const C = ["svelte", "vue", "angular", "qwik", "solid"].includes(d), g = (e) =>
|
|
|
42
42
|
meta: e.meta
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, O = ({
|
|
46
46
|
block: e,
|
|
47
47
|
context: t,
|
|
48
48
|
localState: r,
|
|
@@ -51,15 +51,14 @@ const C = ["svelte", "vue", "angular", "qwik", "solid"].includes(d), g = (e) =>
|
|
|
51
51
|
}) => {
|
|
52
52
|
if (!e.bindings)
|
|
53
53
|
return e;
|
|
54
|
-
const i =
|
|
54
|
+
const i = C(e);
|
|
55
55
|
for (const n in e.bindings) {
|
|
56
56
|
const p = e.bindings[n], a = m({
|
|
57
57
|
code: p,
|
|
58
58
|
localState: r,
|
|
59
59
|
rootState: o,
|
|
60
60
|
rootSetState: s,
|
|
61
|
-
context: t
|
|
62
|
-
enableCache: !0
|
|
61
|
+
context: t
|
|
63
62
|
});
|
|
64
63
|
l(i, n, a);
|
|
65
64
|
}
|
|
@@ -74,7 +73,7 @@ function S({
|
|
|
74
73
|
rootSetState: i
|
|
75
74
|
}) {
|
|
76
75
|
const n = y(e);
|
|
77
|
-
return r ?
|
|
76
|
+
return r ? O({
|
|
78
77
|
block: n,
|
|
79
78
|
localState: o,
|
|
80
79
|
rootState: s,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(l,o,i)=>{const e=String.prototype.split.call(o,/[,[\].]+?/).filter(Boolean).reduce((t,n)=>t!=null?t[n]:t,l);return e===void 0||e===l?i:e};exports.get=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),i=require("../../functions/evaluate/evaluate.cjs");function l(t){const n=function(){var e;const o=t.builderContext,{context:r,localState:c,rootState:s,rootSetState:u}=o;return String(((e=t.text)==null?void 0:e.toString())||"").replace(/{{([^}]+)}}/g,(S,x)=>i.evaluate({code:x,context:r,localState:c,rootState:s,rootSetState:u}))};return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}module.exports=l;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { evaluate as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { evaluate as l } from "../../functions/evaluate/evaluate.mjs";
|
|
3
3
|
function f(t) {
|
|
4
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ a(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
className: "builder-text",
|
|
@@ -11,17 +11,16 @@ function f(t) {
|
|
|
11
11
|
context: n,
|
|
12
12
|
localState: r,
|
|
13
13
|
rootState: c,
|
|
14
|
-
rootSetState:
|
|
14
|
+
rootSetState: s
|
|
15
15
|
} = o;
|
|
16
16
|
return String(((e = t.text) == null ? void 0 : e.toString()) || "").replace(
|
|
17
17
|
/{{([^}]+)}}/g,
|
|
18
|
-
(d,
|
|
19
|
-
code:
|
|
18
|
+
(d, x) => l({
|
|
19
|
+
code: x,
|
|
20
20
|
context: n,
|
|
21
21
|
localState: r,
|
|
22
22
|
rootState: c,
|
|
23
|
-
rootSetState:
|
|
24
|
-
enableCache: !1
|
|
23
|
+
rootSetState: s
|
|
25
24
|
})
|
|
26
25
|
);
|
|
27
26
|
}() },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../functions/evaluate/evaluate.cjs"),l=({block:t,registeredComponents:r})=>{var o;const e=(o=t.component)==null?void 0:o.name;if(!e)return null;const n=r[e];if(n)return n;console.warn(`
|
|
2
2
|
Could not find a registered component named "${e}".
|
|
3
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},p=({block:t,context:r})=>{const{repeat:e,...n}=t;if(!(e!=null&&e.collection))return;const o=s.evaluate({code:e.collection,localState:r.localState,rootState:r.rootState,rootSetState:r.rootSetState,context:r.context
|
|
3
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},p=({block:t,context:r})=>{const{repeat:e,...n}=t;if(!(e!=null&&e.collection))return;const o=s.evaluate({code:e.collection,localState:r.localState,rootState:r.rootState,rootSetState:r.rootSetState,context:r.context});if(!Array.isArray(o))return;const i=e.collection.split(".").pop(),d=e.itemName||(i?i+"Item":"item");return o.map((u,a)=>({context:{...r,localState:{...r.localState,$index:a,$item:u,[d]:u,[`$${d}Index`]:a}},block:n}))},m=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderLinkComponent?{builderLinkComponent:r}:{}},c=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderComponents?{builderComponents:r}:{}},v=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderBlock?{builderBlock:r}:{}},C=(t,r)=>{var e;return(e=t==null?void 0:t.shouldReceiveBuilderProps)!=null&&e.builderContext?{builderContext:r}:{}};exports.getComponent=l;exports.getRepeatItemData=p;exports.provideBuilderBlock=v;exports.provideBuilderContext=C;exports.provideLinkComponent=m;exports.provideRegisteredComponents=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { evaluate as
|
|
1
|
+
import { evaluate as a } from "../../functions/evaluate/evaluate.mjs";
|
|
2
2
|
const m = ({
|
|
3
3
|
block: t,
|
|
4
4
|
registeredComponents: r
|
|
@@ -23,26 +23,25 @@ const m = ({
|
|
|
23
23
|
} = t;
|
|
24
24
|
if (!(e != null && e.collection))
|
|
25
25
|
return;
|
|
26
|
-
const o =
|
|
26
|
+
const o = a({
|
|
27
27
|
code: e.collection,
|
|
28
28
|
localState: r.localState,
|
|
29
29
|
rootState: r.rootState,
|
|
30
30
|
rootSetState: r.rootSetState,
|
|
31
|
-
context: r.context
|
|
32
|
-
enableCache: !0
|
|
31
|
+
context: r.context
|
|
33
32
|
});
|
|
34
33
|
if (!Array.isArray(o))
|
|
35
34
|
return;
|
|
36
|
-
const i = e.collection.split(".").pop(),
|
|
37
|
-
return o.map((
|
|
35
|
+
const i = e.collection.split(".").pop(), d = e.itemName || (i ? i + "Item" : "item");
|
|
36
|
+
return o.map((s, u) => ({
|
|
38
37
|
context: {
|
|
39
38
|
...r,
|
|
40
39
|
localState: {
|
|
41
40
|
...r.localState,
|
|
42
|
-
$index:
|
|
43
|
-
$item:
|
|
44
|
-
[
|
|
45
|
-
[`$${
|
|
41
|
+
$index: u,
|
|
42
|
+
$item: s,
|
|
43
|
+
[d]: s,
|
|
44
|
+
[`$${d}Index`]: u
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
47
|
block: n
|
|
@@ -62,7 +61,7 @@ const m = ({
|
|
|
62
61
|
return (e = t == null ? void 0 : t.shouldReceiveBuilderProps) != null && e.builderBlock ? {
|
|
63
62
|
builderBlock: r
|
|
64
63
|
} : {};
|
|
65
|
-
},
|
|
64
|
+
}, S = (t, r) => {
|
|
66
65
|
var e;
|
|
67
66
|
return (e = t == null ? void 0 : t.shouldReceiveBuilderProps) != null && e.builderContext ? {
|
|
68
67
|
builderContext: r
|
|
@@ -72,7 +71,7 @@ export {
|
|
|
72
71
|
m as getComponent,
|
|
73
72
|
c as getRepeatItemData,
|
|
74
73
|
C as provideBuilderBlock,
|
|
75
|
-
|
|
74
|
+
S as provideBuilderContext,
|
|
76
75
|
f as provideLinkComponent,
|
|
77
76
|
v as provideRegisteredComponents
|
|
78
77
|
};
|