@builder.io/sdk-react 1.0.11 → 1.0.13

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 (67) hide show
  1. package/lib/browser/blocks-exports.cjs +32 -31
  2. package/lib/browser/blocks-exports.mjs +914 -877
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/{server-entry-acc5a9c8.js → server-entry-1a840bf8.js} +1 -1
  6. package/lib/browser/{server-entry-4829e1ce.cjs → server-entry-20402a85.cjs} +1 -1
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/blocks-ca61b343.cjs +32 -0
  10. package/lib/edge/blocks-exports.cjs +1 -1
  11. package/lib/edge/blocks-exports.mjs +2 -2
  12. package/lib/edge/{blocks-244199ab.js → blocks-fd4ab30c.js} +1003 -967
  13. package/lib/edge/{button-73916377.js → button-45681a80.js} +3 -3
  14. package/lib/edge/{button-8cd5d71a.cjs → button-6d8b002c.cjs} +1 -1
  15. package/lib/edge/{columns-c7d9b9f1.js → columns-61e1043d.js} +33 -33
  16. package/lib/edge/{columns-88c9df52.cjs → columns-77e4f17d.cjs} +2 -2
  17. package/lib/edge/{content-variants-d5455178.js → content-variants-c085fa7f.js} +135 -124
  18. package/lib/edge/{content-variants-1a65d814.cjs → content-variants-c86fdb5a.cjs} +13 -12
  19. package/lib/edge/dynamic-renderer-8b343325.js +8 -0
  20. package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
  21. package/lib/edge/{form-ad532981.js → form-4fae6192.js} +56 -66
  22. package/lib/edge/form-b996f9f9.cjs +1 -0
  23. package/lib/edge/{get-class-prop-name-1178de8b.js → get-class-prop-name-0e4b7b88.js} +1 -1
  24. package/lib/edge/{get-class-prop-name-c082f4f3.cjs → get-class-prop-name-14e14eea.cjs} +1 -1
  25. package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
  26. package/lib/edge/image-ee3dd857.cjs +17 -0
  27. package/lib/edge/{img-749d10ed.js → img-1259941e.js} +1 -1
  28. package/lib/edge/{img-f61f7931.cjs → img-c623011b.cjs} +1 -1
  29. package/lib/edge/index.cjs +1 -1
  30. package/lib/edge/index.mjs +1 -1
  31. package/lib/edge/{input-ccec5aae.js → input-02a1cd9f.js} +1 -1
  32. package/lib/edge/{input-184da708.cjs → input-2c618b06.cjs} +1 -1
  33. package/lib/edge/{select-a5fc0333.cjs → select-3acbf5f6.cjs} +1 -1
  34. package/lib/edge/{select-50a6db92.js → select-b1b6d0bf.js} +1 -1
  35. package/lib/edge/{server-entry-1cbf5bef.js → server-entry-3f0061ea.js} +1 -1
  36. package/lib/edge/{server-entry-178f215d.cjs → server-entry-d8f950e0.cjs} +1 -1
  37. package/lib/edge/server-entry.cjs +1 -1
  38. package/lib/edge/server-entry.mjs +1 -1
  39. package/lib/edge/{slot-dad01f2d.js → slot-3cefe326.js} +4 -4
  40. package/lib/edge/{slot-d3ff8e4d.cjs → slot-92eac261.cjs} +1 -1
  41. package/lib/edge/{symbol-31283b30.cjs → symbol-741f0aee.cjs} +1 -1
  42. package/lib/edge/{symbol-b6db0014.js → symbol-e2a47b92.js} +3 -3
  43. package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
  44. package/lib/edge/video-e20dcbbc.cjs +1 -0
  45. package/lib/node/blocks-exports.cjs +22 -21
  46. package/lib/node/blocks-exports.mjs +492 -455
  47. package/lib/node/index.cjs +1 -1
  48. package/lib/node/index.mjs +1 -1
  49. package/lib/node/{server-entry-09a75819.js → server-entry-383e8da6.js} +1 -1
  50. package/lib/node/{server-entry-856d379b.cjs → server-entry-6d61d1cf.cjs} +1 -1
  51. package/lib/node/server-entry.cjs +1 -1
  52. package/lib/node/server-entry.mjs +1 -1
  53. package/package.json +1 -1
  54. package/types/components/block/block.helpers.d.ts +4 -0
  55. package/types/components/content/components/enable-editor.d.ts +1 -1
  56. package/types/components/content/components/styles.d.ts +1 -0
  57. package/types/components/content/components/styles.helpers.d.ts +1 -0
  58. package/types/components/content/contentProps.types.d.ts +6 -1
  59. package/types/components/content-variants/content-variants.d.ts +1 -1
  60. package/types/constants/sdk-version.d.ts +1 -1
  61. package/types/functions/evaluate/evaluate.d.ts +3 -1
  62. package/types/functions/evaluate/helpers.d.ts +1 -0
  63. package/lib/edge/blocks-a05f6af2.cjs +0 -32
  64. package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
  65. package/lib/edge/form-713c6da6.cjs +0 -1
  66. package/lib/edge/image-7e1361ce.cjs +0 -17
  67. package/lib/edge/video-64014cc4.cjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { DynamicRenderer as i } from "./dynamic-renderer-96ba4e48.js";
3
- import { getClassPropName as e } from "./get-class-prop-name-1178de8b.js";
4
- import "./server-entry-1cbf5bef.js";
2
+ import { DynamicRenderer as i } from "./dynamic-renderer-8b343325.js";
3
+ import { getClassPropName as e } from "./get-class-prop-name-0e4b7b88.js";
4
+ import "./server-entry-3f0061ea.js";
5
5
  function u(t) {
6
6
  return /* @__PURE__ */ n(
7
7
  i,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./dynamic-renderer-1c9f24c0.cjs"),t=require("./get-class-prop-name-c082f4f3.cjs");require("./server-entry-178f215d.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
+ "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-14e14eea.cjs");require("./server-entry-d8f950e0.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,25 +1,25 @@
1
- import { jsxs as g, Fragment as y, jsx as o } from "react/jsx-runtime";
2
- import { useState as s } from "react";
3
- import { InlinedStyles as w, mapStyleObjToStrIfNeeded as $, Blocks as B, getSizesForBreakpoints as z } from "./blocks-244199ab.js";
4
- import { DynamicRenderer as L } from "./dynamic-renderer-96ba4e48.js";
5
- import { getClassPropName as W } from "./get-class-prop-name-1178de8b.js";
6
- import "./server-entry-1cbf5bef.js";
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-fd4ab30c.js";
4
+ import { DynamicRenderer as L } from "./dynamic-renderer-8b343325.js";
5
+ import { getClassPropName as W } from "./get-class-prop-name-0e4b7b88.js";
6
+ import "./server-entry-3f0061ea.js";
7
7
  function O(t) {
8
- var f;
9
- const [c, A] = s(
8
+ var k;
9
+ const [c, A] = a(
10
10
  () => typeof t.space == "number" ? t.space || 0 : 20
11
- ), [r, D] = s(() => t.columns || []), [m, F] = s(
11
+ ), [o, D] = a(() => t.columns || []), [m, F] = a(
12
12
  () => t.stackColumnsAt || "tablet"
13
13
  );
14
- function S(e) {
14
+ function y(e) {
15
15
  var n;
16
- return ((n = r[e]) == null ? void 0 : n.width) || 100 / r.length;
16
+ return ((n = o[e]) == null ? void 0 : n.width) || 100 / o.length;
17
17
  }
18
- function x(e) {
19
- const n = c * (r.length - 1) / r.length;
20
- return `calc(${S(e)}% - ${n}px)`;
18
+ function S(e) {
19
+ const n = c * (o.length - 1) / o.length;
20
+ return `calc(${y(e)}% - ${n}px)`;
21
21
  }
22
- function a({
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] = s(
34
+ const [u, N] = a(
35
35
  () => t.stackColumnsAt === "never" ? "row" : t.reverseColumnsWhenStacked ? "column-reverse" : "column"
36
36
  );
37
- function C() {
37
+ function x() {
38
38
  return {
39
39
  "--flex-dir": u,
40
- "--flex-dir-tablet": a({
40
+ "--flex-dir-tablet": s({
41
41
  stackedStyle: u,
42
42
  desktopStyle: "row"
43
43
  })
44
44
  };
45
45
  }
46
- function p(e) {
47
- const n = e === 0 ? 0 : c, l = x(e), i = `${n}px`, k = "100%", h = 0;
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: k,
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": a({
65
- stackedStyle: k,
64
+ "--column-width-tablet": s({
65
+ stackedStyle: f,
66
66
  desktopStyle: l
67
67
  }),
68
- "--column-margin-left-tablet": a({
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 v() {
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(y, { children: [
107
+ return /* @__PURE__ */ g(v, { children: [
108
108
  /* @__PURE__ */ g(
109
109
  "div",
110
110
  {
111
- className: `builder-columns ${t.builderBlock.id}-breakpoints div-f5024694`,
112
- style: C(),
111
+ className: `builder-columns ${t.builderBlock.id}-breakpoints div-5e636bea`,
112
+ style: x(),
113
113
  children: [
114
- /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(w, { styles: v() }) }),
115
- (f = t.columns) == null ? void 0 : f.map((e, n) => /* @__PURE__ */ o(
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: $(p(n))
125
+ style: $(C(n))
126
126
  },
127
- children: /* @__PURE__ */ o(
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__ */ o("style", { children: `.div-f5024694 {
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-a05f6af2.cjs"),w=require("./dynamic-renderer-1c9f24c0.cjs"),$=require("./get-class-prop-name-c082f4f3.cjs");require("./server-entry-178f215d.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`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),a=require("./blocks-ca61b343.cjs"),w=require("./dynamic-renderer-b29b45ca.cjs"),$=require("./get-class-prop-name-14e14eea.cjs");require("./server-entry-d8f950e0.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-f5024694`,style:x(),children:[l.jsx(l.Fragment,{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-f5024694 {
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;