@builder.io/sdk-react 1.1.2 → 2.0.1
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 +24 -24
- package/lib/browser/blocks-exports.mjs +524 -555
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-754040fc.cjs → server-entry-29c5c31c.cjs} +1 -1
- package/lib/browser/{server-entry-ed2ca723.js → server-entry-f9067095.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-3e3c0eb7.js → accordion-4a70912d.js} +1 -1
- package/lib/edge/{accordion-dfb7894d.cjs → accordion-6ad2cec7.cjs} +1 -1
- package/lib/edge/{blocks-e68d1b90.cjs → blocks-0bd38a83.cjs} +13 -13
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +4 -3
- package/lib/edge/{blocks-b47dedc1.js → blocks-fedde8d2.js} +697 -685
- package/lib/edge/{button-03e45213.js → button-af35e8de.js} +2 -2
- package/lib/edge/{button-eacbdcad.cjs → button-f6426eff.cjs} +1 -1
- package/lib/edge/{columns-858746ca.js → columns-1065c0ae.js} +59 -52
- package/lib/edge/columns-f607250b.cjs +28 -0
- package/lib/edge/{content-variants-c4559dfb.js → content-variants-3d57a82f.js} +183 -235
- package/lib/edge/content-variants-773afb9f.cjs +134 -0
- package/lib/edge/{form-6f2d1077.js → form-0a58d0e4.js} +3 -3
- package/lib/edge/{form-241a699e.cjs → form-5762c22a.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-87b96bca.js → get-class-prop-name-268b0f61.js} +1 -1
- package/lib/edge/{get-class-prop-name-d471c28c.cjs → get-class-prop-name-3061c329.cjs} +1 -1
- package/lib/edge/{img-be88cdbc.js → img-252c9967.js} +1 -1
- package/lib/edge/{img-a7bbfda3.cjs → img-59bb70c7.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-f1fbe38b.cjs → input-2163d4dc.cjs} +1 -1
- package/lib/edge/{input-22d61335.js → input-7ae243e2.js} +1 -1
- package/lib/edge/{select-c58f67e3.cjs → select-39231177.cjs} +1 -1
- package/lib/edge/{select-6371cc39.js → select-cfa0eb8e.js} +1 -1
- package/lib/edge/{server-entry-048c3043.cjs → server-entry-4750de9c.cjs} +1 -1
- package/lib/edge/{server-entry-97c99c4d.js → server-entry-681e8e79.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-7666ffaf.cjs → slot-69da8c56.cjs} +1 -1
- package/lib/edge/{slot-e6c31d6c.js → slot-7c61542f.js} +3 -3
- package/lib/edge/symbol-4a8a6cda.js +85 -0
- package/lib/edge/symbol-bd999a19.cjs +1 -0
- package/lib/edge/{tabs-02f569d1.cjs → tabs-3d0e242e.cjs} +1 -1
- package/lib/edge/{tabs-20114ebb.js → tabs-c3ff0c70.js} +3 -3
- package/lib/node/blocks-exports.cjs +25 -25
- package/lib/node/blocks-exports.mjs +518 -549
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-819e5520.cjs → node-runtime-3bfd8465.cjs} +1 -1
- package/lib/node/{node-runtime-36670c0e.js → node-runtime-78262e65.js} +1 -1
- package/lib/node/{server-entry-2910f126.js → server-entry-5f9f100f.js} +1 -1
- package/lib/node/{server-entry-cc7910d7.cjs → server-entry-63058f3f.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +15 -15
- package/types/components/block/block.helpers.d.ts +8 -8
- package/types/components/content/components/styles.d.ts +2 -1
- package/types/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/components/inlined-script.d.ts +2 -1
- package/types/components/inlined-styles.d.ts +2 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/types.d.ts +1 -0
- package/types/types/builder-props.d.ts +3 -0
- package/lib/edge/columns-26be75b9.cjs +0 -28
- package/lib/edge/content-variants-0c5ae6d6.cjs +0 -134
- package/lib/edge/symbol-8e3447aa.js +0 -84
- package/lib/edge/symbol-a0838c62.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { DynamicRenderer as r } from "./dynamic-renderer-8b343325.js";
|
|
3
|
-
import { getClassPropName as n } from "./get-class-prop-name-
|
|
4
|
-
import "./server-entry-
|
|
3
|
+
import { getClassPropName as n } from "./get-class-prop-name-268b0f61.js";
|
|
4
|
+
import "./server-entry-681e8e79.js";
|
|
5
5
|
function b(t) {
|
|
6
6
|
function e() {
|
|
7
7
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("./dynamic-renderer-b29b45ca.cjs"),t=require("./get-class-prop-name-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("./dynamic-renderer-b29b45ca.cjs"),t=require("./get-class-prop-name-3061c329.cjs");require("./server-entry-4750de9c.cjs");function u(e){function n(){return{...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"}}}return i.jsx(r.DynamicRenderer,{attributes:n(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}exports.default=u;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsxs as y, Fragment as B, jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { InlinedStyles as z, Blocks as A, mapStyleObjToStrIfNeeded as L, getSizesForBreakpoints as W } from "./blocks-
|
|
1
|
+
import { jsxs as y, Fragment as B, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r } from "react";
|
|
3
|
+
import { InlinedStyles as z, Blocks as A, mapStyleObjToStrIfNeeded as L, getSizesForBreakpoints as W } from "./blocks-fedde8d2.js";
|
|
4
4
|
import { DynamicRenderer as N } from "./dynamic-renderer-8b343325.js";
|
|
5
|
-
import { getClassPropName as D } from "./get-class-prop-name-
|
|
5
|
+
import { getClassPropName as D } from "./get-class-prop-name-268b0f61.js";
|
|
6
6
|
import "./blocks-exports.mjs";
|
|
7
|
-
import "./server-entry-
|
|
8
|
-
const F = (
|
|
9
|
-
function J(
|
|
7
|
+
import "./server-entry-681e8e79.js";
|
|
8
|
+
const F = (t) => `builder-columns ${t}-breakpoints`;
|
|
9
|
+
function J(t) {
|
|
10
10
|
var f, k;
|
|
11
|
-
const [c, T] =
|
|
12
|
-
() => typeof
|
|
13
|
-
), [
|
|
14
|
-
() =>
|
|
11
|
+
const [c, T] = r(
|
|
12
|
+
() => typeof t.space == "number" ? t.space || 0 : 20
|
|
13
|
+
), [s, j] = r(() => t.columns || []), [m, I] = r(
|
|
14
|
+
() => t.stackColumnsAt || "tablet"
|
|
15
15
|
);
|
|
16
|
-
function S(
|
|
17
|
-
return
|
|
16
|
+
function S(e) {
|
|
17
|
+
return e.link ? t.builderLinkComponent || "a" : "div";
|
|
18
18
|
}
|
|
19
|
-
function x(
|
|
19
|
+
function x(e) {
|
|
20
20
|
var n;
|
|
21
|
-
return ((n =
|
|
21
|
+
return ((n = s[e]) == null ? void 0 : n.width) || 100 / s.length;
|
|
22
22
|
}
|
|
23
|
-
function C(
|
|
24
|
-
const n = c * (
|
|
25
|
-
return `calc(${
|
|
23
|
+
function C(e) {
|
|
24
|
+
const n = x(e), i = c * (s.length - 1) * (n / 100);
|
|
25
|
+
return `calc(${n}% - ${i}px)`;
|
|
26
26
|
}
|
|
27
27
|
function a({
|
|
28
|
-
stackedStyle:
|
|
28
|
+
stackedStyle: e,
|
|
29
29
|
desktopStyle: n
|
|
30
30
|
}) {
|
|
31
|
-
return m === "tablet" ?
|
|
31
|
+
return m === "tablet" ? e : n;
|
|
32
32
|
}
|
|
33
33
|
function u({
|
|
34
|
-
stackedStyle:
|
|
34
|
+
stackedStyle: e,
|
|
35
35
|
desktopStyle: n
|
|
36
36
|
}) {
|
|
37
|
-
return m === "never" ? n :
|
|
37
|
+
return m === "never" ? n : e;
|
|
38
38
|
}
|
|
39
|
-
const [d, P] =
|
|
40
|
-
() =>
|
|
39
|
+
const [d, P] = r(
|
|
40
|
+
() => t.stackColumnsAt === "never" ? "row" : t.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
41
41
|
);
|
|
42
|
-
function
|
|
42
|
+
function v() {
|
|
43
43
|
return {
|
|
44
44
|
"--flex-dir": d,
|
|
45
45
|
"--flex-dir-tablet": a({
|
|
@@ -48,8 +48,8 @@ function J(e) {
|
|
|
48
48
|
})
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const n =
|
|
51
|
+
function w(e) {
|
|
52
|
+
const n = e === 0 ? 0 : c, i = C(e), l = `${n}px`, g = "100%", h = 0;
|
|
53
53
|
return {
|
|
54
54
|
...{
|
|
55
55
|
display: "flex",
|
|
@@ -76,74 +76,81 @@ function J(e) {
|
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function b(
|
|
79
|
+
function b(e) {
|
|
80
80
|
var i, l;
|
|
81
81
|
return W(
|
|
82
|
-
((l = (i =
|
|
83
|
-
)[
|
|
82
|
+
((l = (i = t.builderContext.content) == null ? void 0 : i.meta) == null ? void 0 : l.breakpoints) || {}
|
|
83
|
+
)[e].max;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function p() {
|
|
86
86
|
return `
|
|
87
87
|
@media (max-width: ${b("medium")}px) {
|
|
88
|
-
.${
|
|
88
|
+
.${t.builderBlock.id}-breakpoints {
|
|
89
89
|
flex-direction: var(--flex-dir-tablet);
|
|
90
90
|
align-items: stretch;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
.${
|
|
93
|
+
.${t.builderBlock.id}-breakpoints > .builder-column {
|
|
94
94
|
width: var(--column-width-tablet) !important;
|
|
95
95
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
@media (max-width: ${b("small")}px) {
|
|
100
|
-
.${
|
|
100
|
+
.${t.builderBlock.id}-breakpoints {
|
|
101
101
|
flex-direction: var(--flex-dir);
|
|
102
102
|
align-items: stretch;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.${
|
|
105
|
+
.${t.builderBlock.id}-breakpoints > .builder-column {
|
|
106
106
|
width: var(--column-width-mobile) !important;
|
|
107
107
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
`;
|
|
111
111
|
}
|
|
112
|
-
function $(
|
|
112
|
+
function $(e, n) {
|
|
113
113
|
return {
|
|
114
|
-
...
|
|
115
|
-
href:
|
|
114
|
+
...e.link ? {
|
|
115
|
+
href: e.link
|
|
116
116
|
} : {},
|
|
117
117
|
[D()]: "builder-column",
|
|
118
|
-
style: L(
|
|
118
|
+
style: L(w(n))
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
return /* @__PURE__ */ y(B, { children: [
|
|
122
122
|
/* @__PURE__ */ y(
|
|
123
123
|
"div",
|
|
124
124
|
{
|
|
125
|
-
className: F((f =
|
|
126
|
-
style:
|
|
125
|
+
className: F((f = t.builderBlock) == null ? void 0 : f.id) + " div-fe220f58",
|
|
126
|
+
style: v(),
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
128
|
+
/* @__PURE__ */ o(
|
|
129
|
+
z,
|
|
130
|
+
{
|
|
131
|
+
id: "builderio-columns",
|
|
132
|
+
styles: p(),
|
|
133
|
+
nonce: t.builderContext.nonce
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
(k = t.columns) == null ? void 0 : k.map((e, n) => /* @__PURE__ */ o(
|
|
130
137
|
N,
|
|
131
138
|
{
|
|
132
|
-
TagName: S(
|
|
139
|
+
TagName: S(e),
|
|
133
140
|
actionAttributes: {},
|
|
134
|
-
attributes: $(
|
|
135
|
-
children: /* @__PURE__ */
|
|
141
|
+
attributes: $(e, n),
|
|
142
|
+
children: /* @__PURE__ */ o(
|
|
136
143
|
A,
|
|
137
144
|
{
|
|
138
145
|
path: `component.options.columns.${n}.blocks`,
|
|
139
|
-
parent:
|
|
146
|
+
parent: t.builderBlock.id,
|
|
140
147
|
styleProp: {
|
|
141
148
|
flexGrow: "1"
|
|
142
149
|
},
|
|
143
|
-
context:
|
|
144
|
-
registeredComponents:
|
|
145
|
-
linkComponent:
|
|
146
|
-
blocks:
|
|
150
|
+
context: t.builderContext,
|
|
151
|
+
registeredComponents: t.builderComponents,
|
|
152
|
+
linkComponent: t.builderLinkComponent,
|
|
153
|
+
blocks: e.blocks
|
|
147
154
|
}
|
|
148
155
|
)
|
|
149
156
|
},
|
|
@@ -152,7 +159,7 @@ function J(e) {
|
|
|
152
159
|
]
|
|
153
160
|
}
|
|
154
161
|
),
|
|
155
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ o("style", { children: `.div-fe220f58 {
|
|
156
163
|
display: flex;
|
|
157
164
|
line-height: normal;
|
|
158
165
|
}` })
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),s=require("./blocks-0bd38a83.cjs"),B=require("./dynamic-renderer-b29b45ca.cjs"),p=require("./get-class-prop-name-3061c329.cjs");require("./blocks-exports.cjs");require("./server-entry-4750de9c.cjs");const q=e=>`builder-columns ${e}-breakpoints`;function z(e){var f,g;const[u,A]=o.useState(()=>typeof e.space=="number"?e.space||0:20),[a,L]=o.useState(()=>e.columns||[]),[d,N]=o.useState(()=>e.stackColumnsAt||"tablet");function y(t){return t.link?e.builderLinkComponent||"a":"div"}function x(t){var n;return((n=a[t])==null?void 0:n.width)||100/a.length}function C(t){const n=x(t),i=u*(a.length-1)*(n/100);return`calc(${n}% - ${i}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,W]=o.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function v(){return{"--flex-dir":b,"--flex-dir-tablet":c({stackedStyle:b,desktopStyle:"row"})}}function w(t){const n=t===0?0:u,i=C(t),r=`${n}px`,h="100%",S=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:i,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:h,desktopStyle:i}),"--column-margin-left-mobile":m({stackedStyle:S,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:h,desktopStyle:i}),"--column-margin-left-tablet":c({stackedStyle:S,desktopStyle:r})}}function k(t){var i,r;return s.getSizesForBreakpoints(((r=(i=e.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[t].max}function $(){return`
|
|
2
|
+
@media (max-width: ${k("medium")}px) {
|
|
3
|
+
.${e.builderBlock.id}-breakpoints {
|
|
4
|
+
flex-direction: var(--flex-dir-tablet);
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
9
|
+
width: var(--column-width-tablet) !important;
|
|
10
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (max-width: ${k("small")}px) {
|
|
15
|
+
.${e.builderBlock.id}-breakpoints {
|
|
16
|
+
flex-direction: var(--flex-dir);
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
21
|
+
width: var(--column-width-mobile) !important;
|
|
22
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
`}function j(t,n){return{...t.link?{href:t.link}:{},[p.getClassPropName()]:"builder-column",style:s.mapStyleObjToStrIfNeeded(w(n))}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:q((f=e.builderBlock)==null?void 0:f.id)+" div-fe220f58",style:v(),children:[l.jsx(s.InlinedStyles,{id:"builderio-columns",styles:$(),nonce:e.builderContext.nonce}),(g=e.columns)==null?void 0:g.map((t,n)=>l.jsx(B.DynamicRenderer,{TagName:y(t),actionAttributes:{},attributes:j(t,n),children:l.jsx(s.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-fe220f58 {
|
|
26
|
+
display: flex;
|
|
27
|
+
line-height: normal;
|
|
28
|
+
}`})]})}exports.default=z;
|