@builder.io/sdk-react 1.0.11 → 1.0.12
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-exports.cjs +30 -30
- package/lib/browser/blocks-exports.mjs +875 -842
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-acc5a9c8.js → server-entry-34e4efb1.js} +1 -1
- package/lib/browser/{server-entry-4829e1ce.cjs → server-entry-60df1736.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-03ffaaf9.cjs +32 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-244199ab.js → blocks-f8d5d3a0.js} +1003 -967
- package/lib/edge/{button-8cd5d71a.cjs → button-5137d1bc.cjs} +1 -1
- package/lib/edge/{button-73916377.js → button-5543875e.js} +3 -3
- package/lib/edge/{columns-c7d9b9f1.js → columns-a05f9fd8.js} +33 -33
- package/lib/edge/{columns-88c9df52.cjs → columns-ad62a5ce.cjs} +2 -2
- package/lib/edge/{content-variants-d5455178.js → content-variants-74109911.js} +106 -99
- package/lib/edge/{content-variants-1a65d814.cjs → content-variants-e6ba9024.cjs} +6 -6
- package/lib/edge/dynamic-renderer-8b343325.js +8 -0
- package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
- package/lib/edge/{form-ad532981.js → form-67a4ec0b.js} +56 -66
- package/lib/edge/form-ee52f842.cjs +1 -0
- package/lib/edge/{get-class-prop-name-1178de8b.js → get-class-prop-name-25116ae3.js} +1 -1
- package/lib/edge/{get-class-prop-name-c082f4f3.cjs → get-class-prop-name-7ab1534a.cjs} +1 -1
- package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
- package/lib/edge/image-ee3dd857.cjs +17 -0
- package/lib/edge/{img-f61f7931.cjs → img-147fc69c.cjs} +1 -1
- package/lib/edge/{img-749d10ed.js → img-43af4666.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-ccec5aae.js → input-35088f50.js} +1 -1
- package/lib/edge/{input-184da708.cjs → input-90830684.cjs} +1 -1
- package/lib/edge/{select-a5fc0333.cjs → select-1e63f097.cjs} +1 -1
- package/lib/edge/{select-50a6db92.js → select-ee16e4ee.js} +1 -1
- package/lib/edge/{server-entry-178f215d.cjs → server-entry-39e6b4a6.cjs} +1 -1
- package/lib/edge/{server-entry-1cbf5bef.js → server-entry-f2d127da.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-d3ff8e4d.cjs → slot-3db582db.cjs} +1 -1
- package/lib/edge/{slot-dad01f2d.js → slot-45a2e0bf.js} +4 -4
- package/lib/edge/{symbol-b6db0014.js → symbol-75231166.js} +2 -2
- package/lib/edge/{symbol-31283b30.cjs → symbol-c533a54f.cjs} +1 -1
- package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
- package/lib/edge/video-e20dcbbc.cjs +1 -0
- package/lib/node/blocks-exports.cjs +17 -17
- package/lib/node/blocks-exports.mjs +473 -440
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-856d379b.cjs → server-entry-81eab45c.cjs} +1 -1
- package/lib/node/{server-entry-09a75819.js → server-entry-a0cd9606.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/block/block.helpers.d.ts +4 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +3 -1
- package/types/functions/evaluate/helpers.d.ts +1 -0
- package/lib/edge/blocks-a05f6af2.cjs +0 -32
- package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
- package/lib/edge/form-713c6da6.cjs +0 -1
- package/lib/edge/image-7e1361ce.cjs +0 -17
- package/lib/edge/video-64014cc4.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./dynamic-renderer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./dynamic-renderer-b29b45ca.cjs"),t=require("./get-class-prop-name-7ab1534a.cjs");require("./server-entry-39e6b4a6.cjs");function r(e){return n.jsx(i.DynamicRenderer,{attributes:{...e.attributes,[t.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[t.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}exports.default=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { DynamicRenderer as i } from "./dynamic-renderer-
|
|
3
|
-
import { getClassPropName as e } from "./get-class-prop-name-
|
|
4
|
-
import "./server-entry-
|
|
2
|
+
import { DynamicRenderer as i } from "./dynamic-renderer-8b343325.js";
|
|
3
|
+
import { getClassPropName as e } from "./get-class-prop-name-25116ae3.js";
|
|
4
|
+
import "./server-entry-f2d127da.js";
|
|
5
5
|
function u(t) {
|
|
6
6
|
return /* @__PURE__ */ n(
|
|
7
7
|
i,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as g, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { InlinedStyles as w, mapStyleObjToStrIfNeeded as $, Blocks as B, getSizesForBreakpoints as z } from "./blocks-
|
|
4
|
-
import { DynamicRenderer as L } from "./dynamic-renderer-
|
|
5
|
-
import { getClassPropName as W } from "./get-class-prop-name-
|
|
6
|
-
import "./server-entry-
|
|
1
|
+
import { jsxs as g, Fragment as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a } from "react";
|
|
3
|
+
import { InlinedStyles as w, mapStyleObjToStrIfNeeded as $, Blocks as B, getSizesForBreakpoints as z } from "./blocks-f8d5d3a0.js";
|
|
4
|
+
import { DynamicRenderer as L } from "./dynamic-renderer-8b343325.js";
|
|
5
|
+
import { getClassPropName as W } from "./get-class-prop-name-25116ae3.js";
|
|
6
|
+
import "./server-entry-f2d127da.js";
|
|
7
7
|
function O(t) {
|
|
8
|
-
var
|
|
9
|
-
const [c, A] =
|
|
8
|
+
var k;
|
|
9
|
+
const [c, A] = a(
|
|
10
10
|
() => typeof t.space == "number" ? t.space || 0 : 20
|
|
11
|
-
), [
|
|
11
|
+
), [o, D] = a(() => t.columns || []), [m, F] = a(
|
|
12
12
|
() => t.stackColumnsAt || "tablet"
|
|
13
13
|
);
|
|
14
|
-
function
|
|
14
|
+
function y(e) {
|
|
15
15
|
var n;
|
|
16
|
-
return ((n =
|
|
16
|
+
return ((n = o[e]) == null ? void 0 : n.width) || 100 / o.length;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const n = c * (
|
|
20
|
-
return `calc(${
|
|
18
|
+
function S(e) {
|
|
19
|
+
const n = c * (o.length - 1) / o.length;
|
|
20
|
+
return `calc(${y(e)}% - ${n}px)`;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function s({
|
|
23
23
|
stackedStyle: e,
|
|
24
24
|
desktopStyle: n
|
|
25
25
|
}) {
|
|
@@ -31,20 +31,20 @@ function O(t) {
|
|
|
31
31
|
}) {
|
|
32
32
|
return m === "never" ? n : e;
|
|
33
33
|
}
|
|
34
|
-
const [u, N] =
|
|
34
|
+
const [u, N] = a(
|
|
35
35
|
() => t.stackColumnsAt === "never" ? "row" : t.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
36
36
|
);
|
|
37
|
-
function
|
|
37
|
+
function x() {
|
|
38
38
|
return {
|
|
39
39
|
"--flex-dir": u,
|
|
40
|
-
"--flex-dir-tablet":
|
|
40
|
+
"--flex-dir-tablet": s({
|
|
41
41
|
stackedStyle: u,
|
|
42
42
|
desktopStyle: "row"
|
|
43
43
|
})
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const n = e === 0 ? 0 : c, l =
|
|
46
|
+
function C(e) {
|
|
47
|
+
const n = e === 0 ? 0 : c, l = S(e), i = `${n}px`, f = "100%", h = 0;
|
|
48
48
|
return {
|
|
49
49
|
...{
|
|
50
50
|
display: "flex",
|
|
@@ -54,18 +54,18 @@ function O(t) {
|
|
|
54
54
|
width: l,
|
|
55
55
|
["marginLeft"]: i,
|
|
56
56
|
"--column-width-mobile": d({
|
|
57
|
-
stackedStyle:
|
|
57
|
+
stackedStyle: f,
|
|
58
58
|
desktopStyle: l
|
|
59
59
|
}),
|
|
60
60
|
"--column-margin-left-mobile": d({
|
|
61
61
|
stackedStyle: h,
|
|
62
62
|
desktopStyle: i
|
|
63
63
|
}),
|
|
64
|
-
"--column-width-tablet":
|
|
65
|
-
stackedStyle:
|
|
64
|
+
"--column-width-tablet": s({
|
|
65
|
+
stackedStyle: f,
|
|
66
66
|
desktopStyle: l
|
|
67
67
|
}),
|
|
68
|
-
"--column-margin-left-tablet":
|
|
68
|
+
"--column-margin-left-tablet": s({
|
|
69
69
|
stackedStyle: h,
|
|
70
70
|
desktopStyle: i
|
|
71
71
|
})
|
|
@@ -77,7 +77,7 @@ function O(t) {
|
|
|
77
77
|
((i = (l = t.builderContext.content) == null ? void 0 : l.meta) == null ? void 0 : i.breakpoints) || {}
|
|
78
78
|
)[e].max;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function p() {
|
|
81
81
|
return `
|
|
82
82
|
@media (max-width: ${b("medium")}px) {
|
|
83
83
|
.${t.builderBlock.id}-breakpoints {
|
|
@@ -104,15 +104,15 @@ function O(t) {
|
|
|
104
104
|
},
|
|
105
105
|
`;
|
|
106
106
|
}
|
|
107
|
-
return /* @__PURE__ */ g(
|
|
107
|
+
return /* @__PURE__ */ g(v, { children: [
|
|
108
108
|
/* @__PURE__ */ g(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
className: `builder-columns ${t.builderBlock.id}-breakpoints div-
|
|
112
|
-
style:
|
|
111
|
+
className: `builder-columns ${t.builderBlock.id}-breakpoints div-5e636bea`,
|
|
112
|
+
style: x(),
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
(
|
|
114
|
+
/* @__PURE__ */ r(w, { styles: p() }),
|
|
115
|
+
(k = t.columns) == null ? void 0 : k.map((e, n) => /* @__PURE__ */ r(
|
|
116
116
|
L,
|
|
117
117
|
{
|
|
118
118
|
TagName: e.link ? t.builderLinkComponent || "a" : "div",
|
|
@@ -122,9 +122,9 @@ function O(t) {
|
|
|
122
122
|
href: e.link
|
|
123
123
|
} : {},
|
|
124
124
|
[W()]: "builder-column",
|
|
125
|
-
style: $(
|
|
125
|
+
style: $(C(n))
|
|
126
126
|
},
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ r(
|
|
128
128
|
B,
|
|
129
129
|
{
|
|
130
130
|
path: `component.options.columns.${n}.blocks`,
|
|
@@ -144,7 +144,7 @@ function O(t) {
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ r("style", { children: `.div-5e636bea {
|
|
148
148
|
display: flex;
|
|
149
149
|
line-height: normal;
|
|
150
150
|
}` })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),a=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),a=require("./blocks-03ffaaf9.cjs"),w=require("./dynamic-renderer-b29b45ca.cjs"),$=require("./get-class-prop-name-7ab1534a.cjs");require("./server-entry-39e6b4a6.cjs");function j(e){var f;const[u,p]=s.useState(()=>typeof e.space=="number"?e.space||0:20),[o,B]=s.useState(()=>e.columns||[]),[d,q]=s.useState(()=>e.stackColumnsAt||"tablet");function S(t){var n;return((n=o[t])==null?void 0:n.width)||100/o.length}function y(t){const n=u*(o.length-1)/o.length;return`calc(${S(t)}% - ${n}px)`}function c({stackedStyle:t,desktopStyle:n}){return d==="tablet"?t:n}function m({stackedStyle:t,desktopStyle:n}){return d==="never"?n:t}const[b,z]=s.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function x(){return{"--flex-dir":b,"--flex-dir-tablet":c({stackedStyle:b,desktopStyle:"row"})}}function C(t){const n=t===0?0:u,i=y(t),r=`${n}px`,g="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:i,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:g,desktopStyle:i}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:g,desktopStyle:i}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}}function k(t){var i,r;return a.getSizesForBreakpoints(((r=(i=e.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[t].max}function v(){return`
|
|
2
2
|
@media (max-width: ${k("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
|
-
`}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
25
|
+
`}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-5e636bea`,style:x(),children:[l.jsx(a.InlinedStyles,{styles:v()}),(f=e.columns)==null?void 0:f.map((t,n)=>l.jsx(w.DynamicRenderer,{TagName:t.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...t.link?{href:t.link}:{},[$.getClassPropName()]:"builder-column",style:a.mapStyleObjToStrIfNeeded(C(n))},children:l.jsx(a.Blocks,{path:`component.options.columns.${n}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:t.blocks})},n))]}),l.jsx("style",{children:`.div-5e636bea {
|
|
26
26
|
display: flex;
|
|
27
27
|
line-height: normal;
|
|
28
28
|
}`})]})}exports.default=j;
|