@builder.io/sdk-react-nextjs 0.16.19 → 0.16.20
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/columns/columns.cjs +3 -3
- package/lib/browser/blocks/columns/columns.mjs +41 -33
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
- package/lib/edge/blocks/columns/columns.cjs +3 -3
- package/lib/edge/blocks/columns/columns.mjs +41 -33
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
- package/lib/node/blocks/columns/columns.cjs +3 -3
- package/lib/node/blocks/columns/columns.mjs +41 -33
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/functions/evaluate/node-runtime/node-runtime.cjs +6 -6
- package/lib/node/functions/evaluate/node-runtime/node-runtime.mjs +20 -18
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),z=require("../../functions/get-class-prop-name.cjs"),B=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return q.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
2
2
|
@media (max-width: ${b("medium")}px) {
|
|
3
3
|
.${e.builderBlock.id}-breakpoints {
|
|
4
4
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
`},$=function(t,
|
|
25
|
+
`},$=function(t,i){return{...t.link?{href:t.link}:{},[z.getClassPropName()]:"builder-column",style:B.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-0e218b6c",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(W,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-0e218b6c {
|
|
26
26
|
display: flex;
|
|
27
27
|
line-height: normal;
|
|
28
|
-
}`})]})}module.exports=
|
|
28
|
+
}`})]})}module.exports=N;
|
|
@@ -8,63 +8,71 @@ import { mapStyleObjToStrIfNeeded as T } from "../../functions/get-style.mjs";
|
|
|
8
8
|
import { getColumnsClass as D } from "./helpers.mjs";
|
|
9
9
|
function q(e) {
|
|
10
10
|
var f, g;
|
|
11
|
-
const a =
|
|
11
|
+
const a = function() {
|
|
12
|
+
return typeof e.space == "number" ? e.space || 0 : 20;
|
|
13
|
+
}, s = function() {
|
|
14
|
+
return e.columns || [];
|
|
15
|
+
}, m = function() {
|
|
16
|
+
return e.stackColumnsAt || "tablet";
|
|
17
|
+
}, S = function(t) {
|
|
12
18
|
return t.link ? e.builderLinkComponent || "a" : "div";
|
|
13
|
-
}, C = function(t) {
|
|
14
|
-
var n;
|
|
15
|
-
return ((n = s[t]) == null ? void 0 : n.width) || 100 / s.length;
|
|
16
19
|
}, x = function(t) {
|
|
17
|
-
|
|
18
|
-
return
|
|
20
|
+
var i;
|
|
21
|
+
return ((i = s()[t]) == null ? void 0 : i.width) || 100 / s().length;
|
|
22
|
+
}, C = function(t) {
|
|
23
|
+
const i = x(t), o = a() * (s().length - 1) * (i / 100);
|
|
24
|
+
return `calc(${i}% - ${o}px)`;
|
|
19
25
|
}, c = function({
|
|
20
26
|
stackedStyle: t,
|
|
21
|
-
desktopStyle:
|
|
27
|
+
desktopStyle: i
|
|
22
28
|
}) {
|
|
23
|
-
return m === "tablet" ? t :
|
|
24
|
-
},
|
|
29
|
+
return m() === "tablet" ? t : i;
|
|
30
|
+
}, u = function({
|
|
25
31
|
stackedStyle: t,
|
|
26
|
-
desktopStyle:
|
|
32
|
+
desktopStyle: i
|
|
27
33
|
}) {
|
|
28
|
-
return m === "never" ?
|
|
29
|
-
},
|
|
34
|
+
return m() === "never" ? i : t;
|
|
35
|
+
}, d = function() {
|
|
36
|
+
return e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
37
|
+
}, p = function() {
|
|
30
38
|
return {
|
|
31
|
-
"--flex-dir":
|
|
39
|
+
"--flex-dir": d(),
|
|
32
40
|
"--flex-dir-tablet": c({
|
|
33
|
-
stackedStyle:
|
|
41
|
+
stackedStyle: d(),
|
|
34
42
|
desktopStyle: "row"
|
|
35
43
|
})
|
|
36
44
|
};
|
|
37
45
|
}, v = function(t) {
|
|
38
|
-
const
|
|
46
|
+
const i = t === 0 ? 0 : a(), o = C(t), l = `${i}px`, k = "100%", h = 0;
|
|
39
47
|
return {
|
|
40
48
|
...{
|
|
41
49
|
display: "flex",
|
|
42
50
|
flexDirection: "column",
|
|
43
51
|
alignItems: "stretch"
|
|
44
52
|
},
|
|
45
|
-
width:
|
|
46
|
-
["marginLeft"]:
|
|
47
|
-
"--column-width-mobile":
|
|
53
|
+
width: o,
|
|
54
|
+
["marginLeft"]: l,
|
|
55
|
+
"--column-width-mobile": u({
|
|
48
56
|
stackedStyle: k,
|
|
49
|
-
desktopStyle:
|
|
57
|
+
desktopStyle: o
|
|
50
58
|
}),
|
|
51
|
-
"--column-margin-left-mobile":
|
|
59
|
+
"--column-margin-left-mobile": u({
|
|
52
60
|
stackedStyle: h,
|
|
53
|
-
desktopStyle:
|
|
61
|
+
desktopStyle: l
|
|
54
62
|
}),
|
|
55
63
|
"--column-width-tablet": c({
|
|
56
64
|
stackedStyle: k,
|
|
57
|
-
desktopStyle:
|
|
65
|
+
desktopStyle: o
|
|
58
66
|
}),
|
|
59
67
|
"--column-margin-left-tablet": c({
|
|
60
68
|
stackedStyle: h,
|
|
61
|
-
desktopStyle:
|
|
69
|
+
desktopStyle: l
|
|
62
70
|
})
|
|
63
71
|
};
|
|
64
72
|
}, b = function(t) {
|
|
65
|
-
var
|
|
73
|
+
var o, l;
|
|
66
74
|
return L(
|
|
67
|
-
((
|
|
75
|
+
((l = (o = e.builderContext.content) == null ? void 0 : o.meta) == null ? void 0 : l.breakpoints) || {}
|
|
68
76
|
)[t].max;
|
|
69
77
|
}, w = function() {
|
|
70
78
|
const t = `.${e.builderBlock.id}-breakpoints > .builder-column`;
|
|
@@ -93,20 +101,20 @@ function q(e) {
|
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
`;
|
|
96
|
-
}, $ = function(t,
|
|
104
|
+
}, $ = function(t, i) {
|
|
97
105
|
return {
|
|
98
106
|
...t.link ? {
|
|
99
107
|
href: t.link
|
|
100
108
|
} : {},
|
|
101
109
|
[N()]: "builder-column",
|
|
102
|
-
style: T(v(
|
|
110
|
+
style: T(v(i))
|
|
103
111
|
};
|
|
104
112
|
};
|
|
105
113
|
return /* @__PURE__ */ y(B, { children: [
|
|
106
114
|
/* @__PURE__ */ y(
|
|
107
115
|
"div",
|
|
108
116
|
{
|
|
109
|
-
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-
|
|
117
|
+
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-0e218b6c",
|
|
110
118
|
style: p(),
|
|
111
119
|
children: [
|
|
112
120
|
/* @__PURE__ */ r(
|
|
@@ -117,12 +125,12 @@ function q(e) {
|
|
|
117
125
|
nonce: e.builderContext.nonce
|
|
118
126
|
}
|
|
119
127
|
),
|
|
120
|
-
(g = e.columns) == null ? void 0 : g.map((
|
|
128
|
+
(g = e.columns) == null ? void 0 : g.map((n, t) => /* @__PURE__ */ r(
|
|
121
129
|
z,
|
|
122
130
|
{
|
|
123
|
-
TagName: S(
|
|
131
|
+
TagName: S(n),
|
|
124
132
|
actionAttributes: {},
|
|
125
|
-
attributes: $(
|
|
133
|
+
attributes: $(n, t),
|
|
126
134
|
children: /* @__PURE__ */ r(
|
|
127
135
|
W,
|
|
128
136
|
{
|
|
@@ -134,7 +142,7 @@ function q(e) {
|
|
|
134
142
|
context: e.builderContext,
|
|
135
143
|
registeredComponents: e.builderComponents,
|
|
136
144
|
linkComponent: e.builderLinkComponent,
|
|
137
|
-
blocks:
|
|
145
|
+
blocks: n.blocks
|
|
138
146
|
}
|
|
139
147
|
)
|
|
140
148
|
},
|
|
@@ -143,7 +151,7 @@ function q(e) {
|
|
|
143
151
|
]
|
|
144
152
|
}
|
|
145
153
|
),
|
|
146
|
-
/* @__PURE__ */ r("style", { children: `.div-
|
|
154
|
+
/* @__PURE__ */ r("style", { children: `.div-0e218b6c {
|
|
147
155
|
display: flex;
|
|
148
156
|
line-height: normal;
|
|
149
157
|
}` })
|
|
@@ -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.20";exports.SDK_VERSION=e;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../constants/sdk-name.cjs"),l=require("../../../helpers/logger.cjs"),c=require("./safeDynamicRequire.cjs"),d="BUILDER_IVM";let n=null,s=null;const u=(t,e={})=>{n||(n=t,S(e))},m=o.SDK_NAME==="@builder.io/sdk-react-nextjs"||o.SDK_NAME==="@builder.io/sdk-react"||o.SDK_NAME==="@builder.io/sdk-qwik"||o.SDK_NAME==="@builder.io/sdk-vue",I=()=>{try{if(n)return n;const e=c.safeDynamicRequire("isolated-vm");if(e)return e}catch(e){l.logger.error("isolated-vm import error.",e)}const t=`${l.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
2
2
|
|
|
3
3
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
4
4
|
|
|
5
|
-
${m?`- import and call \`initializeNodeRuntime()\` from "${
|
|
5
|
+
${m?`- import and call \`initializeNodeRuntime()\` from "${o.SDK_NAME}/node/init".`:""}
|
|
6
6
|
- add the following import: \`await import('isolated-vm')\`.
|
|
7
7
|
|
|
8
|
-
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(
|
|
8
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function S(t={memoryLimit:128}){if(s)return s;const e=I(),r=new e.Isolate(t).createContextSync(),i=r.global;return i.setSync("global",i.derefInto()),i.setSync("log",function(...a){console.log(...a)}),i.setSync(d,e),s=r,r}exports.setIvm=u;
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { SDK_NAME as e } from "../../../constants/sdk-name.mjs";
|
|
2
|
-
import { logger as
|
|
3
|
-
import { safeDynamicRequire as
|
|
4
|
-
const
|
|
5
|
-
let n = null;
|
|
6
|
-
const
|
|
7
|
-
n = t,
|
|
8
|
-
},
|
|
2
|
+
import { logger as a, MSG_PREFIX as c } from "../../../helpers/logger.mjs";
|
|
3
|
+
import { safeDynamicRequire as d } from "./safeDynamicRequire.mjs";
|
|
4
|
+
const m = "BUILDER_IVM";
|
|
5
|
+
let n = null, l = null;
|
|
6
|
+
const S = (t, o = {}) => {
|
|
7
|
+
n || (n = t, f(o));
|
|
8
|
+
}, u = e === "@builder.io/sdk-react-nextjs" || e === "@builder.io/sdk-react" || e === "@builder.io/sdk-qwik" || e === "@builder.io/sdk-vue", I = () => {
|
|
9
9
|
try {
|
|
10
10
|
if (n)
|
|
11
11
|
return n;
|
|
12
|
-
const o =
|
|
12
|
+
const o = d("isolated-vm");
|
|
13
13
|
if (o)
|
|
14
14
|
return o;
|
|
15
15
|
} catch (o) {
|
|
16
|
-
|
|
16
|
+
a.error("isolated-vm import error.", o);
|
|
17
17
|
}
|
|
18
|
-
const t = `${
|
|
18
|
+
const t = `${c}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
19
19
|
|
|
20
20
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${u ? `- import and call \`initializeNodeRuntime()\` from "${e}/node/init".` : ""}
|
|
23
23
|
- add the following import: \`await import('isolated-vm')\`.
|
|
24
24
|
|
|
25
25
|
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
|
|
26
26
|
throw new Error(t);
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function f(t = {
|
|
29
29
|
memoryLimit: 128
|
|
30
30
|
}) {
|
|
31
|
+
if (l)
|
|
32
|
+
return l;
|
|
31
33
|
const o = I(), r = new o.Isolate(t).createContextSync(), i = r.global;
|
|
32
34
|
return i.setSync("global", i.derefInto()), i.setSync("log", function(...s) {
|
|
33
35
|
console.log(...s);
|
|
34
|
-
}), i.setSync(
|
|
36
|
+
}), i.setSync(m, o), l = r, r;
|
|
35
37
|
}
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
S as setIvm
|
|
38
40
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),z=require("../../functions/get-class-prop-name.cjs"),B=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return q.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
2
2
|
@media (max-width: ${b("medium")}px) {
|
|
3
3
|
.${e.builderBlock.id}-breakpoints {
|
|
4
4
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
`},$=function(t,
|
|
25
|
+
`},$=function(t,i){return{...t.link?{href:t.link}:{},[z.getClassPropName()]:"builder-column",style:B.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-0e218b6c",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(W,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-0e218b6c {
|
|
26
26
|
display: flex;
|
|
27
27
|
line-height: normal;
|
|
28
|
-
}`})]})}module.exports=
|
|
28
|
+
}`})]})}module.exports=N;
|
|
@@ -8,63 +8,71 @@ import { mapStyleObjToStrIfNeeded as T } from "../../functions/get-style.mjs";
|
|
|
8
8
|
import { getColumnsClass as D } from "./helpers.mjs";
|
|
9
9
|
function q(e) {
|
|
10
10
|
var f, g;
|
|
11
|
-
const a =
|
|
11
|
+
const a = function() {
|
|
12
|
+
return typeof e.space == "number" ? e.space || 0 : 20;
|
|
13
|
+
}, s = function() {
|
|
14
|
+
return e.columns || [];
|
|
15
|
+
}, m = function() {
|
|
16
|
+
return e.stackColumnsAt || "tablet";
|
|
17
|
+
}, S = function(t) {
|
|
12
18
|
return t.link ? e.builderLinkComponent || "a" : "div";
|
|
13
|
-
}, C = function(t) {
|
|
14
|
-
var n;
|
|
15
|
-
return ((n = s[t]) == null ? void 0 : n.width) || 100 / s.length;
|
|
16
19
|
}, x = function(t) {
|
|
17
|
-
|
|
18
|
-
return
|
|
20
|
+
var i;
|
|
21
|
+
return ((i = s()[t]) == null ? void 0 : i.width) || 100 / s().length;
|
|
22
|
+
}, C = function(t) {
|
|
23
|
+
const i = x(t), o = a() * (s().length - 1) * (i / 100);
|
|
24
|
+
return `calc(${i}% - ${o}px)`;
|
|
19
25
|
}, c = function({
|
|
20
26
|
stackedStyle: t,
|
|
21
|
-
desktopStyle:
|
|
27
|
+
desktopStyle: i
|
|
22
28
|
}) {
|
|
23
|
-
return m === "tablet" ? t :
|
|
24
|
-
},
|
|
29
|
+
return m() === "tablet" ? t : i;
|
|
30
|
+
}, u = function({
|
|
25
31
|
stackedStyle: t,
|
|
26
|
-
desktopStyle:
|
|
32
|
+
desktopStyle: i
|
|
27
33
|
}) {
|
|
28
|
-
return m === "never" ?
|
|
29
|
-
},
|
|
34
|
+
return m() === "never" ? i : t;
|
|
35
|
+
}, d = function() {
|
|
36
|
+
return e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
37
|
+
}, p = function() {
|
|
30
38
|
return {
|
|
31
|
-
"--flex-dir":
|
|
39
|
+
"--flex-dir": d(),
|
|
32
40
|
"--flex-dir-tablet": c({
|
|
33
|
-
stackedStyle:
|
|
41
|
+
stackedStyle: d(),
|
|
34
42
|
desktopStyle: "row"
|
|
35
43
|
})
|
|
36
44
|
};
|
|
37
45
|
}, v = function(t) {
|
|
38
|
-
const
|
|
46
|
+
const i = t === 0 ? 0 : a(), o = C(t), l = `${i}px`, k = "100%", h = 0;
|
|
39
47
|
return {
|
|
40
48
|
...{
|
|
41
49
|
display: "flex",
|
|
42
50
|
flexDirection: "column",
|
|
43
51
|
alignItems: "stretch"
|
|
44
52
|
},
|
|
45
|
-
width:
|
|
46
|
-
["marginLeft"]:
|
|
47
|
-
"--column-width-mobile":
|
|
53
|
+
width: o,
|
|
54
|
+
["marginLeft"]: l,
|
|
55
|
+
"--column-width-mobile": u({
|
|
48
56
|
stackedStyle: k,
|
|
49
|
-
desktopStyle:
|
|
57
|
+
desktopStyle: o
|
|
50
58
|
}),
|
|
51
|
-
"--column-margin-left-mobile":
|
|
59
|
+
"--column-margin-left-mobile": u({
|
|
52
60
|
stackedStyle: h,
|
|
53
|
-
desktopStyle:
|
|
61
|
+
desktopStyle: l
|
|
54
62
|
}),
|
|
55
63
|
"--column-width-tablet": c({
|
|
56
64
|
stackedStyle: k,
|
|
57
|
-
desktopStyle:
|
|
65
|
+
desktopStyle: o
|
|
58
66
|
}),
|
|
59
67
|
"--column-margin-left-tablet": c({
|
|
60
68
|
stackedStyle: h,
|
|
61
|
-
desktopStyle:
|
|
69
|
+
desktopStyle: l
|
|
62
70
|
})
|
|
63
71
|
};
|
|
64
72
|
}, b = function(t) {
|
|
65
|
-
var
|
|
73
|
+
var o, l;
|
|
66
74
|
return L(
|
|
67
|
-
((
|
|
75
|
+
((l = (o = e.builderContext.content) == null ? void 0 : o.meta) == null ? void 0 : l.breakpoints) || {}
|
|
68
76
|
)[t].max;
|
|
69
77
|
}, w = function() {
|
|
70
78
|
const t = `.${e.builderBlock.id}-breakpoints > .builder-column`;
|
|
@@ -93,20 +101,20 @@ function q(e) {
|
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
`;
|
|
96
|
-
}, $ = function(t,
|
|
104
|
+
}, $ = function(t, i) {
|
|
97
105
|
return {
|
|
98
106
|
...t.link ? {
|
|
99
107
|
href: t.link
|
|
100
108
|
} : {},
|
|
101
109
|
[N()]: "builder-column",
|
|
102
|
-
style: T(v(
|
|
110
|
+
style: T(v(i))
|
|
103
111
|
};
|
|
104
112
|
};
|
|
105
113
|
return /* @__PURE__ */ y(B, { children: [
|
|
106
114
|
/* @__PURE__ */ y(
|
|
107
115
|
"div",
|
|
108
116
|
{
|
|
109
|
-
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-
|
|
117
|
+
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-0e218b6c",
|
|
110
118
|
style: p(),
|
|
111
119
|
children: [
|
|
112
120
|
/* @__PURE__ */ r(
|
|
@@ -117,12 +125,12 @@ function q(e) {
|
|
|
117
125
|
nonce: e.builderContext.nonce
|
|
118
126
|
}
|
|
119
127
|
),
|
|
120
|
-
(g = e.columns) == null ? void 0 : g.map((
|
|
128
|
+
(g = e.columns) == null ? void 0 : g.map((n, t) => /* @__PURE__ */ r(
|
|
121
129
|
z,
|
|
122
130
|
{
|
|
123
|
-
TagName: S(
|
|
131
|
+
TagName: S(n),
|
|
124
132
|
actionAttributes: {},
|
|
125
|
-
attributes: $(
|
|
133
|
+
attributes: $(n, t),
|
|
126
134
|
children: /* @__PURE__ */ r(
|
|
127
135
|
W,
|
|
128
136
|
{
|
|
@@ -134,7 +142,7 @@ function q(e) {
|
|
|
134
142
|
context: e.builderContext,
|
|
135
143
|
registeredComponents: e.builderComponents,
|
|
136
144
|
linkComponent: e.builderLinkComponent,
|
|
137
|
-
blocks:
|
|
145
|
+
blocks: n.blocks
|
|
138
146
|
}
|
|
139
147
|
)
|
|
140
148
|
},
|
|
@@ -143,7 +151,7 @@ function q(e) {
|
|
|
143
151
|
]
|
|
144
152
|
}
|
|
145
153
|
),
|
|
146
|
-
/* @__PURE__ */ r("style", { children: `.div-
|
|
154
|
+
/* @__PURE__ */ r("style", { children: `.div-0e218b6c {
|
|
147
155
|
display: flex;
|
|
148
156
|
line-height: normal;
|
|
149
157
|
}` })
|
|
@@ -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.20";exports.SDK_VERSION=e;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../constants/sdk-name.cjs"),l=require("../../../helpers/logger.cjs"),c=require("./safeDynamicRequire.cjs"),d="BUILDER_IVM";let n=null,s=null;const u=(t,e={})=>{n||(n=t,S(e))},m=o.SDK_NAME==="@builder.io/sdk-react-nextjs"||o.SDK_NAME==="@builder.io/sdk-react"||o.SDK_NAME==="@builder.io/sdk-qwik"||o.SDK_NAME==="@builder.io/sdk-vue",I=()=>{try{if(n)return n;const e=c.safeDynamicRequire("isolated-vm");if(e)return e}catch(e){l.logger.error("isolated-vm import error.",e)}const t=`${l.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
2
2
|
|
|
3
3
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
4
4
|
|
|
5
|
-
${m?`- import and call \`initializeNodeRuntime()\` from "${
|
|
5
|
+
${m?`- import and call \`initializeNodeRuntime()\` from "${o.SDK_NAME}/node/init".`:""}
|
|
6
6
|
- add the following import: \`await import('isolated-vm')\`.
|
|
7
7
|
|
|
8
|
-
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(
|
|
8
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function S(t={memoryLimit:128}){if(s)return s;const e=I(),r=new e.Isolate(t).createContextSync(),i=r.global;return i.setSync("global",i.derefInto()),i.setSync("log",function(...a){console.log(...a)}),i.setSync(d,e),s=r,r}exports.setIvm=u;
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { SDK_NAME as e } from "../../../constants/sdk-name.mjs";
|
|
2
|
-
import { logger as
|
|
3
|
-
import { safeDynamicRequire as
|
|
4
|
-
const
|
|
5
|
-
let n = null;
|
|
6
|
-
const
|
|
7
|
-
n = t,
|
|
8
|
-
},
|
|
2
|
+
import { logger as a, MSG_PREFIX as c } from "../../../helpers/logger.mjs";
|
|
3
|
+
import { safeDynamicRequire as d } from "./safeDynamicRequire.mjs";
|
|
4
|
+
const m = "BUILDER_IVM";
|
|
5
|
+
let n = null, l = null;
|
|
6
|
+
const S = (t, o = {}) => {
|
|
7
|
+
n || (n = t, f(o));
|
|
8
|
+
}, u = e === "@builder.io/sdk-react-nextjs" || e === "@builder.io/sdk-react" || e === "@builder.io/sdk-qwik" || e === "@builder.io/sdk-vue", I = () => {
|
|
9
9
|
try {
|
|
10
10
|
if (n)
|
|
11
11
|
return n;
|
|
12
|
-
const o =
|
|
12
|
+
const o = d("isolated-vm");
|
|
13
13
|
if (o)
|
|
14
14
|
return o;
|
|
15
15
|
} catch (o) {
|
|
16
|
-
|
|
16
|
+
a.error("isolated-vm import error.", o);
|
|
17
17
|
}
|
|
18
|
-
const t = `${
|
|
18
|
+
const t = `${c}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
19
19
|
|
|
20
20
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${u ? `- import and call \`initializeNodeRuntime()\` from "${e}/node/init".` : ""}
|
|
23
23
|
- add the following import: \`await import('isolated-vm')\`.
|
|
24
24
|
|
|
25
25
|
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
|
|
26
26
|
throw new Error(t);
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function f(t = {
|
|
29
29
|
memoryLimit: 128
|
|
30
30
|
}) {
|
|
31
|
+
if (l)
|
|
32
|
+
return l;
|
|
31
33
|
const o = I(), r = new o.Isolate(t).createContextSync(), i = r.global;
|
|
32
34
|
return i.setSync("global", i.derefInto()), i.setSync("log", function(...s) {
|
|
33
35
|
console.log(...s);
|
|
34
|
-
}), i.setSync(
|
|
36
|
+
}), i.setSync(m, o), l = r, r;
|
|
35
37
|
}
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
S as setIvm
|
|
38
40
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),z=require("../../functions/get-class-prop-name.cjs"),B=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return q.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
2
2
|
@media (max-width: ${b("medium")}px) {
|
|
3
3
|
.${e.builderBlock.id}-breakpoints {
|
|
4
4
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
`},$=function(t,
|
|
25
|
+
`},$=function(t,i){return{...t.link?{href:t.link}:{},[z.getClassPropName()]:"builder-column",style:B.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-0e218b6c",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(W,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-0e218b6c {
|
|
26
26
|
display: flex;
|
|
27
27
|
line-height: normal;
|
|
28
|
-
}`})]})}module.exports=
|
|
28
|
+
}`})]})}module.exports=N;
|
|
@@ -8,63 +8,71 @@ import { mapStyleObjToStrIfNeeded as T } from "../../functions/get-style.mjs";
|
|
|
8
8
|
import { getColumnsClass as D } from "./helpers.mjs";
|
|
9
9
|
function q(e) {
|
|
10
10
|
var f, g;
|
|
11
|
-
const a =
|
|
11
|
+
const a = function() {
|
|
12
|
+
return typeof e.space == "number" ? e.space || 0 : 20;
|
|
13
|
+
}, s = function() {
|
|
14
|
+
return e.columns || [];
|
|
15
|
+
}, m = function() {
|
|
16
|
+
return e.stackColumnsAt || "tablet";
|
|
17
|
+
}, S = function(t) {
|
|
12
18
|
return t.link ? e.builderLinkComponent || "a" : "div";
|
|
13
|
-
}, C = function(t) {
|
|
14
|
-
var n;
|
|
15
|
-
return ((n = s[t]) == null ? void 0 : n.width) || 100 / s.length;
|
|
16
19
|
}, x = function(t) {
|
|
17
|
-
|
|
18
|
-
return
|
|
20
|
+
var i;
|
|
21
|
+
return ((i = s()[t]) == null ? void 0 : i.width) || 100 / s().length;
|
|
22
|
+
}, C = function(t) {
|
|
23
|
+
const i = x(t), o = a() * (s().length - 1) * (i / 100);
|
|
24
|
+
return `calc(${i}% - ${o}px)`;
|
|
19
25
|
}, c = function({
|
|
20
26
|
stackedStyle: t,
|
|
21
|
-
desktopStyle:
|
|
27
|
+
desktopStyle: i
|
|
22
28
|
}) {
|
|
23
|
-
return m === "tablet" ? t :
|
|
24
|
-
},
|
|
29
|
+
return m() === "tablet" ? t : i;
|
|
30
|
+
}, u = function({
|
|
25
31
|
stackedStyle: t,
|
|
26
|
-
desktopStyle:
|
|
32
|
+
desktopStyle: i
|
|
27
33
|
}) {
|
|
28
|
-
return m === "never" ?
|
|
29
|
-
},
|
|
34
|
+
return m() === "never" ? i : t;
|
|
35
|
+
}, d = function() {
|
|
36
|
+
return e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column";
|
|
37
|
+
}, p = function() {
|
|
30
38
|
return {
|
|
31
|
-
"--flex-dir":
|
|
39
|
+
"--flex-dir": d(),
|
|
32
40
|
"--flex-dir-tablet": c({
|
|
33
|
-
stackedStyle:
|
|
41
|
+
stackedStyle: d(),
|
|
34
42
|
desktopStyle: "row"
|
|
35
43
|
})
|
|
36
44
|
};
|
|
37
45
|
}, v = function(t) {
|
|
38
|
-
const
|
|
46
|
+
const i = t === 0 ? 0 : a(), o = C(t), l = `${i}px`, k = "100%", h = 0;
|
|
39
47
|
return {
|
|
40
48
|
...{
|
|
41
49
|
display: "flex",
|
|
42
50
|
flexDirection: "column",
|
|
43
51
|
alignItems: "stretch"
|
|
44
52
|
},
|
|
45
|
-
width:
|
|
46
|
-
["marginLeft"]:
|
|
47
|
-
"--column-width-mobile":
|
|
53
|
+
width: o,
|
|
54
|
+
["marginLeft"]: l,
|
|
55
|
+
"--column-width-mobile": u({
|
|
48
56
|
stackedStyle: k,
|
|
49
|
-
desktopStyle:
|
|
57
|
+
desktopStyle: o
|
|
50
58
|
}),
|
|
51
|
-
"--column-margin-left-mobile":
|
|
59
|
+
"--column-margin-left-mobile": u({
|
|
52
60
|
stackedStyle: h,
|
|
53
|
-
desktopStyle:
|
|
61
|
+
desktopStyle: l
|
|
54
62
|
}),
|
|
55
63
|
"--column-width-tablet": c({
|
|
56
64
|
stackedStyle: k,
|
|
57
|
-
desktopStyle:
|
|
65
|
+
desktopStyle: o
|
|
58
66
|
}),
|
|
59
67
|
"--column-margin-left-tablet": c({
|
|
60
68
|
stackedStyle: h,
|
|
61
|
-
desktopStyle:
|
|
69
|
+
desktopStyle: l
|
|
62
70
|
})
|
|
63
71
|
};
|
|
64
72
|
}, b = function(t) {
|
|
65
|
-
var
|
|
73
|
+
var o, l;
|
|
66
74
|
return L(
|
|
67
|
-
((
|
|
75
|
+
((l = (o = e.builderContext.content) == null ? void 0 : o.meta) == null ? void 0 : l.breakpoints) || {}
|
|
68
76
|
)[t].max;
|
|
69
77
|
}, w = function() {
|
|
70
78
|
const t = `.${e.builderBlock.id}-breakpoints > .builder-column`;
|
|
@@ -93,20 +101,20 @@ function q(e) {
|
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
`;
|
|
96
|
-
}, $ = function(t,
|
|
104
|
+
}, $ = function(t, i) {
|
|
97
105
|
return {
|
|
98
106
|
...t.link ? {
|
|
99
107
|
href: t.link
|
|
100
108
|
} : {},
|
|
101
109
|
[N()]: "builder-column",
|
|
102
|
-
style: T(v(
|
|
110
|
+
style: T(v(i))
|
|
103
111
|
};
|
|
104
112
|
};
|
|
105
113
|
return /* @__PURE__ */ y(B, { children: [
|
|
106
114
|
/* @__PURE__ */ y(
|
|
107
115
|
"div",
|
|
108
116
|
{
|
|
109
|
-
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-
|
|
117
|
+
className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-0e218b6c",
|
|
110
118
|
style: p(),
|
|
111
119
|
children: [
|
|
112
120
|
/* @__PURE__ */ r(
|
|
@@ -117,12 +125,12 @@ function q(e) {
|
|
|
117
125
|
nonce: e.builderContext.nonce
|
|
118
126
|
}
|
|
119
127
|
),
|
|
120
|
-
(g = e.columns) == null ? void 0 : g.map((
|
|
128
|
+
(g = e.columns) == null ? void 0 : g.map((n, t) => /* @__PURE__ */ r(
|
|
121
129
|
z,
|
|
122
130
|
{
|
|
123
|
-
TagName: S(
|
|
131
|
+
TagName: S(n),
|
|
124
132
|
actionAttributes: {},
|
|
125
|
-
attributes: $(
|
|
133
|
+
attributes: $(n, t),
|
|
126
134
|
children: /* @__PURE__ */ r(
|
|
127
135
|
W,
|
|
128
136
|
{
|
|
@@ -134,7 +142,7 @@ function q(e) {
|
|
|
134
142
|
context: e.builderContext,
|
|
135
143
|
registeredComponents: e.builderComponents,
|
|
136
144
|
linkComponent: e.builderLinkComponent,
|
|
137
|
-
blocks:
|
|
145
|
+
blocks: n.blocks
|
|
138
146
|
}
|
|
139
147
|
)
|
|
140
148
|
},
|
|
@@ -143,7 +151,7 @@ function q(e) {
|
|
|
143
151
|
]
|
|
144
152
|
}
|
|
145
153
|
),
|
|
146
|
-
/* @__PURE__ */ r("style", { children: `.div-
|
|
154
|
+
/* @__PURE__ */ r("style", { children: `.div-0e218b6c {
|
|
147
155
|
display: flex;
|
|
148
156
|
line-height: normal;
|
|
149
157
|
}` })
|
|
@@ -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.20";exports.SDK_VERSION=e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../constants/sdk-name.cjs"),m=require("../../../helpers/logger.cjs"),A=require("../../fast-clone.cjs"),R=require("../../set.cjs"),M=require("../helpers.cjs"),k=require("./safeDynamicRequire.cjs"),g=t=>`bldr_${t}_sync`,b="BUILDER_SET_STATE",I="BUILDER_IVM",h=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -24,8 +24,8 @@ var refToProxy = (obj) => {
|
|
|
24
24
|
}
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
28
|
-
${
|
|
27
|
+
`,x=({code:t,args:e})=>{const u=e.map(([o])=>`var ${o} = refToProxy(${g(o)}); `).join("");return`
|
|
28
|
+
${h}
|
|
29
29
|
${u}
|
|
30
30
|
function theFunction() {
|
|
31
31
|
${t}
|
|
@@ -38,11 +38,11 @@ if (typeof output === 'object' && output !== null) {
|
|
|
38
38
|
} else {
|
|
39
39
|
return output;
|
|
40
40
|
}
|
|
41
|
-
`};let
|
|
41
|
+
`};let l=null,y=null;const C=(t,e={})=>{l||(l=t,E(e))},D=c.SDK_NAME==="@builder.io/sdk-react-nextjs"||c.SDK_NAME==="@builder.io/sdk-react"||c.SDK_NAME==="@builder.io/sdk-qwik"||c.SDK_NAME==="@builder.io/sdk-vue",S=()=>{try{if(l)return l;const e=k.safeDynamicRequire("isolated-vm");if(e)return e}catch(e){m.logger.error("isolated-vm import error.",e)}const t=`${m.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
42
42
|
|
|
43
43
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
44
44
|
|
|
45
|
-
${D?`- import and call \`initializeNodeRuntime()\` from "${
|
|
45
|
+
${D?`- import and call \`initializeNodeRuntime()\` from "${c.SDK_NAME}/node/init".`:""}
|
|
46
46
|
- add the following import: \`await import('isolated-vm')\`.
|
|
47
47
|
|
|
48
|
-
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function E(t={memoryLimit:128}){const e=S(),o=new e.Isolate(t).createContextSync(),n=o.global;return n.setSync("global",n.derefInto()),n.setSync("log",function(...
|
|
48
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function E(t={memoryLimit:128}){if(y)return y;const e=S(),o=new e.Isolate(t).createContextSync(),n=o.global;return n.setSync("global",n.derefInto()),n.setSync("log",function(...i){console.log(...i)}),n.setSync(I,e),y=o,o}const O=()=>E(),w=({code:t,builder:e,context:u,event:o,localState:n,rootSetState:i,rootState:a})=>{const _=S(),N=A.fastClone({...a,...n}),d=M.getFunctionArguments({builder:e,context:u,event:o,state:N}),f=O(),p=f.global;p.setSync(b,function(r,s){R.set(a,r,s),i==null||i(a)}),d.forEach(([r,s])=>{const j=typeof s=="object"?new _.Reference(r==="builder"?{...s,getUserAttributes:()=>s.getUserAttributes()}:s):null;p.setSync(g(r),j)});const T=x({code:t,args:d}),v=f.evalClosureSync(T);try{return JSON.parse(v)}catch{return v}};exports.runInNode=w;exports.setIvm=C;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SDK_NAME as
|
|
2
|
-
import { logger as j, MSG_PREFIX as
|
|
3
|
-
import { fastClone as
|
|
1
|
+
import { SDK_NAME as c } from "../../../constants/sdk-name.mjs";
|
|
2
|
+
import { logger as j, MSG_PREFIX as R } from "../../../helpers/logger.mjs";
|
|
3
|
+
import { fastClone as x } from "../../fast-clone.mjs";
|
|
4
4
|
import { set as k } from "../../set.mjs";
|
|
5
5
|
import { getFunctionArguments as A } from "../helpers.mjs";
|
|
6
6
|
import { safeDynamicRequire as h } from "./safeDynamicRequire.mjs";
|
|
@@ -51,24 +51,24 @@ if (typeof output === 'object' && output !== null) {
|
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
53
|
};
|
|
54
|
-
let
|
|
54
|
+
let u = null, y = null;
|
|
55
55
|
const V = (e, t = {}) => {
|
|
56
|
-
|
|
57
|
-
}, O =
|
|
56
|
+
u || (u = e, E(t));
|
|
57
|
+
}, O = c === "@builder.io/sdk-react-nextjs" || c === "@builder.io/sdk-react" || c === "@builder.io/sdk-qwik" || c === "@builder.io/sdk-vue", g = () => {
|
|
58
58
|
try {
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
59
|
+
if (u)
|
|
60
|
+
return u;
|
|
61
61
|
const t = h("isolated-vm");
|
|
62
62
|
if (t)
|
|
63
63
|
return t;
|
|
64
64
|
} catch (t) {
|
|
65
65
|
j.error("isolated-vm import error.", t);
|
|
66
66
|
}
|
|
67
|
-
const e = `${
|
|
67
|
+
const e = `${R}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
68
68
|
|
|
69
69
|
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
70
70
|
|
|
71
|
-
${O ? `- import and call \`initializeNodeRuntime()\` from "${
|
|
71
|
+
${O ? `- import and call \`initializeNodeRuntime()\` from "${c}/node/init".` : ""}
|
|
72
72
|
- add the following import: \`await import('isolated-vm')\`.
|
|
73
73
|
|
|
74
74
|
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
|
|
@@ -77,22 +77,24 @@ const V = (e, t = {}) => {
|
|
|
77
77
|
function E(e = {
|
|
78
78
|
memoryLimit: 128
|
|
79
79
|
}) {
|
|
80
|
+
if (y)
|
|
81
|
+
return y;
|
|
80
82
|
const t = g(), o = new t.Isolate(e).createContextSync(), n = o.global;
|
|
81
|
-
return n.setSync("global", n.derefInto()), n.setSync("log", function(...
|
|
82
|
-
console.log(...
|
|
83
|
+
return n.setSync("global", n.derefInto()), n.setSync("log", function(...s) {
|
|
84
|
+
console.log(...s);
|
|
83
85
|
}), n.setSync(I, t), y = o, o;
|
|
84
86
|
}
|
|
85
|
-
const $ = () =>
|
|
87
|
+
const $ = () => E(), B = ({
|
|
86
88
|
code: e,
|
|
87
89
|
builder: t,
|
|
88
90
|
context: l,
|
|
89
91
|
event: o,
|
|
90
92
|
localState: n,
|
|
91
|
-
rootSetState:
|
|
92
|
-
rootState:
|
|
93
|
+
rootSetState: s,
|
|
94
|
+
rootState: a
|
|
93
95
|
}) => {
|
|
94
|
-
const S = g(), _ =
|
|
95
|
-
...
|
|
96
|
+
const S = g(), _ = x({
|
|
97
|
+
...a,
|
|
96
98
|
...n
|
|
97
99
|
}), f = A({
|
|
98
100
|
builder: t,
|
|
@@ -101,7 +103,7 @@ const $ = () => y || E(), B = ({
|
|
|
101
103
|
state: _
|
|
102
104
|
}), m = $(), p = m.global;
|
|
103
105
|
p.setSync(b, function(r, i) {
|
|
104
|
-
k(
|
|
106
|
+
k(a, r, i), s == null || s(a);
|
|
105
107
|
}), f.forEach(([r, i]) => {
|
|
106
108
|
const N = typeof i == "object" ? new S.Reference(
|
|
107
109
|
// workaround: methods with default values for arguments is not being cloned over
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.20",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.16.
|
|
1
|
+
export declare const SDK_VERSION = "0.16.20";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setIvm } from './node-runtime.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.16.
|
|
1
|
+
export declare const SDK_VERSION = "0.16.20";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setIvm } from './node-runtime.js';
|