@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.
Files changed (71) hide show
  1. package/lib/browser/blocks-exports.cjs +24 -24
  2. package/lib/browser/blocks-exports.mjs +524 -555
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +1 -1
  6. package/lib/browser/init.mjs +1 -1
  7. package/lib/browser/{server-entry-754040fc.cjs → server-entry-29c5c31c.cjs} +1 -1
  8. package/lib/browser/{server-entry-ed2ca723.js → server-entry-f9067095.js} +1 -1
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{accordion-3e3c0eb7.js → accordion-4a70912d.js} +1 -1
  12. package/lib/edge/{accordion-dfb7894d.cjs → accordion-6ad2cec7.cjs} +1 -1
  13. package/lib/edge/{blocks-e68d1b90.cjs → blocks-0bd38a83.cjs} +13 -13
  14. package/lib/edge/blocks-exports.cjs +1 -1
  15. package/lib/edge/blocks-exports.mjs +4 -3
  16. package/lib/edge/{blocks-b47dedc1.js → blocks-fedde8d2.js} +697 -685
  17. package/lib/edge/{button-03e45213.js → button-af35e8de.js} +2 -2
  18. package/lib/edge/{button-eacbdcad.cjs → button-f6426eff.cjs} +1 -1
  19. package/lib/edge/{columns-858746ca.js → columns-1065c0ae.js} +59 -52
  20. package/lib/edge/columns-f607250b.cjs +28 -0
  21. package/lib/edge/{content-variants-c4559dfb.js → content-variants-3d57a82f.js} +183 -235
  22. package/lib/edge/content-variants-773afb9f.cjs +134 -0
  23. package/lib/edge/{form-6f2d1077.js → form-0a58d0e4.js} +3 -3
  24. package/lib/edge/{form-241a699e.cjs → form-5762c22a.cjs} +1 -1
  25. package/lib/edge/{get-class-prop-name-87b96bca.js → get-class-prop-name-268b0f61.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-d471c28c.cjs → get-class-prop-name-3061c329.cjs} +1 -1
  27. package/lib/edge/{img-be88cdbc.js → img-252c9967.js} +1 -1
  28. package/lib/edge/{img-a7bbfda3.cjs → img-59bb70c7.cjs} +1 -1
  29. package/lib/edge/index.cjs +1 -1
  30. package/lib/edge/index.mjs +1 -1
  31. package/lib/edge/init.cjs +1 -1
  32. package/lib/edge/init.mjs +1 -1
  33. package/lib/edge/{input-f1fbe38b.cjs → input-2163d4dc.cjs} +1 -1
  34. package/lib/edge/{input-22d61335.js → input-7ae243e2.js} +1 -1
  35. package/lib/edge/{select-c58f67e3.cjs → select-39231177.cjs} +1 -1
  36. package/lib/edge/{select-6371cc39.js → select-cfa0eb8e.js} +1 -1
  37. package/lib/edge/{server-entry-048c3043.cjs → server-entry-4750de9c.cjs} +1 -1
  38. package/lib/edge/{server-entry-97c99c4d.js → server-entry-681e8e79.js} +1 -1
  39. package/lib/edge/server-entry.cjs +1 -1
  40. package/lib/edge/server-entry.mjs +1 -1
  41. package/lib/edge/{slot-7666ffaf.cjs → slot-69da8c56.cjs} +1 -1
  42. package/lib/edge/{slot-e6c31d6c.js → slot-7c61542f.js} +3 -3
  43. package/lib/edge/symbol-4a8a6cda.js +85 -0
  44. package/lib/edge/symbol-bd999a19.cjs +1 -0
  45. package/lib/edge/{tabs-02f569d1.cjs → tabs-3d0e242e.cjs} +1 -1
  46. package/lib/edge/{tabs-20114ebb.js → tabs-c3ff0c70.js} +3 -3
  47. package/lib/node/blocks-exports.cjs +25 -25
  48. package/lib/node/blocks-exports.mjs +518 -549
  49. package/lib/node/index.cjs +1 -1
  50. package/lib/node/index.mjs +2 -2
  51. package/lib/node/init.cjs +1 -1
  52. package/lib/node/init.mjs +2 -2
  53. package/lib/node/{node-runtime-819e5520.cjs → node-runtime-3bfd8465.cjs} +1 -1
  54. package/lib/node/{node-runtime-36670c0e.js → node-runtime-78262e65.js} +1 -1
  55. package/lib/node/{server-entry-2910f126.js → server-entry-5f9f100f.js} +1 -1
  56. package/lib/node/{server-entry-cc7910d7.cjs → server-entry-63058f3f.cjs} +1 -1
  57. package/lib/node/server-entry.cjs +1 -1
  58. package/lib/node/server-entry.mjs +1 -1
  59. package/package.json +15 -15
  60. package/types/components/block/block.helpers.d.ts +8 -8
  61. package/types/components/content/components/styles.d.ts +2 -1
  62. package/types/components/content-variants/content-variants.types.d.ts +4 -0
  63. package/types/components/inlined-script.d.ts +2 -1
  64. package/types/components/inlined-styles.d.ts +2 -1
  65. package/types/constants/sdk-version.d.ts +1 -1
  66. package/types/context/types.d.ts +1 -0
  67. package/types/types/builder-props.d.ts +3 -0
  68. package/lib/edge/columns-26be75b9.cjs +0 -28
  69. package/lib/edge/content-variants-0c5ae6d6.cjs +0 -134
  70. package/lib/edge/symbol-8e3447aa.js +0 -84
  71. 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-87b96bca.js";
4
- import "./server-entry-97c99c4d.js";
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-d471c28c.cjs");require("./server-entry-048c3043.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
+ "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 r } from "react/jsx-runtime";
2
- import { useState as s } from "react";
3
- import { InlinedStyles as z, Blocks as A, mapStyleObjToStrIfNeeded as L, getSizesForBreakpoints as W } from "./blocks-b47dedc1.js";
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-87b96bca.js";
5
+ import { getClassPropName as D } from "./get-class-prop-name-268b0f61.js";
6
6
  import "./blocks-exports.mjs";
7
- import "./server-entry-97c99c4d.js";
8
- const F = (e) => `builder-columns ${e}-breakpoints`;
9
- function J(e) {
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] = s(
12
- () => typeof e.space == "number" ? e.space || 0 : 20
13
- ), [o, j] = s(() => e.columns || []), [m, I] = s(
14
- () => e.stackColumnsAt || "tablet"
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(t) {
17
- return t.link ? e.builderLinkComponent || "a" : "div";
16
+ function S(e) {
17
+ return e.link ? t.builderLinkComponent || "a" : "div";
18
18
  }
19
- function x(t) {
19
+ function x(e) {
20
20
  var n;
21
- return ((n = o[t]) == null ? void 0 : n.width) || 100 / o.length;
21
+ return ((n = s[e]) == null ? void 0 : n.width) || 100 / s.length;
22
22
  }
23
- function C(t) {
24
- const n = c * (o.length - 1) / o.length;
25
- return `calc(${x(t)}% - ${n}px)`;
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: t,
28
+ stackedStyle: e,
29
29
  desktopStyle: n
30
30
  }) {
31
- return m === "tablet" ? t : n;
31
+ return m === "tablet" ? e : n;
32
32
  }
33
33
  function u({
34
- stackedStyle: t,
34
+ stackedStyle: e,
35
35
  desktopStyle: n
36
36
  }) {
37
- return m === "never" ? n : t;
37
+ return m === "never" ? n : e;
38
38
  }
39
- const [d, P] = s(
40
- () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
39
+ const [d, P] = r(
40
+ () => t.stackColumnsAt === "never" ? "row" : t.reverseColumnsWhenStacked ? "column-reverse" : "column"
41
41
  );
42
- function p() {
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 v(t) {
52
- const n = t === 0 ? 0 : c, i = C(t), l = `${n}px`, g = "100%", h = 0;
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(t) {
79
+ function b(e) {
80
80
  var i, l;
81
81
  return W(
82
- ((l = (i = e.builderContext.content) == null ? void 0 : i.meta) == null ? void 0 : l.breakpoints) || {}
83
- )[t].max;
82
+ ((l = (i = t.builderContext.content) == null ? void 0 : i.meta) == null ? void 0 : l.breakpoints) || {}
83
+ )[e].max;
84
84
  }
85
- function w() {
85
+ function p() {
86
86
  return `
87
87
  @media (max-width: ${b("medium")}px) {
88
- .${e.builderBlock.id}-breakpoints {
88
+ .${t.builderBlock.id}-breakpoints {
89
89
  flex-direction: var(--flex-dir-tablet);
90
90
  align-items: stretch;
91
91
  }
92
92
 
93
- .${e.builderBlock.id}-breakpoints > .builder-column {
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
- .${e.builderBlock.id}-breakpoints {
100
+ .${t.builderBlock.id}-breakpoints {
101
101
  flex-direction: var(--flex-dir);
102
102
  align-items: stretch;
103
103
  }
104
104
 
105
- .${e.builderBlock.id}-breakpoints > .builder-column {
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 $(t, n) {
112
+ function $(e, n) {
113
113
  return {
114
- ...t.link ? {
115
- href: t.link
114
+ ...e.link ? {
115
+ href: e.link
116
116
  } : {},
117
117
  [D()]: "builder-column",
118
- style: L(v(n))
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 = e.builderBlock) == null ? void 0 : f.id) + " div-bade6b34",
126
- style: p(),
125
+ className: F((f = t.builderBlock) == null ? void 0 : f.id) + " div-fe220f58",
126
+ style: v(),
127
127
  children: [
128
- /* @__PURE__ */ r(z, { id: "builderio-columns", styles: w() }),
129
- (k = e.columns) == null ? void 0 : k.map((t, n) => /* @__PURE__ */ r(
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(t),
139
+ TagName: S(e),
133
140
  actionAttributes: {},
134
- attributes: $(t, n),
135
- children: /* @__PURE__ */ r(
141
+ attributes: $(e, n),
142
+ children: /* @__PURE__ */ o(
136
143
  A,
137
144
  {
138
145
  path: `component.options.columns.${n}.blocks`,
139
- parent: e.builderBlock.id,
146
+ parent: t.builderBlock.id,
140
147
  styleProp: {
141
148
  flexGrow: "1"
142
149
  },
143
- context: e.builderContext,
144
- registeredComponents: e.builderComponents,
145
- linkComponent: e.builderLinkComponent,
146
- blocks: t.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__ */ r("style", { children: `.div-bade6b34 {
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;