@builder.io/sdk-react 3.0.3 → 3.0.6

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 (87) hide show
  1. package/lib/browser/blocks-exports.cjs +169 -32
  2. package/lib/browser/blocks-exports.mjs +1286 -884
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +17 -16
  5. package/lib/browser/server-entry-a1c64831.cjs +2 -0
  6. package/lib/browser/{server-entry-c904f136.js → server-entry-df5e89e5.js} +279 -237
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-c786f197.js → accordion-289f3464.js} +1 -1
  10. package/lib/edge/{accordion-032726a7.cjs → accordion-fbfb71f4.cjs} +1 -1
  11. package/lib/edge/{blocks-827b0a87.cjs → blocks-459a090b.cjs} +11 -11
  12. package/lib/edge/{blocks-105e50e5.js → blocks-582a7fd7.js} +87 -88
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +13 -12
  15. package/lib/edge/{button-f0e0ea72.js → button-9b112da6.js} +2 -2
  16. package/lib/edge/{button-5cbfe22c.cjs → button-da357144.cjs} +1 -1
  17. package/lib/edge/{columns-d07da61d.cjs → columns-a211113f.cjs} +2 -2
  18. package/lib/edge/{columns-9e187314.js → columns-aba58dda.js} +18 -18
  19. package/lib/edge/{content-variants-59dc0824.js → content-variants-08f4371c.js} +165 -124
  20. package/lib/edge/content-variants-4b5899b5.cjs +134 -0
  21. package/lib/edge/dynamic-blocks-exports.cjs +3 -1
  22. package/lib/edge/dynamic-blocks-exports.mjs +5 -2
  23. package/lib/edge/form-4d4553c2.js +166 -0
  24. package/lib/edge/form-e3a3afd4.cjs +1 -0
  25. package/lib/edge/{get-class-prop-name-6b143ec7.js → get-class-prop-name-38c2baca.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-8fb0e5ad.cjs → get-class-prop-name-fbe244e3.cjs} +1 -1
  27. package/lib/edge/{image-2a2b26d2.js → image-38917f45.js} +22 -24
  28. package/lib/edge/image-590e36ae.cjs +17 -0
  29. package/lib/edge/{img-72bf9d21.cjs → img-8d549af8.cjs} +1 -1
  30. package/lib/edge/{img-2c4c6b78.js → img-c49066fa.js} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +18 -17
  33. package/lib/edge/{input-6eca8427.cjs → input-1ae3842f.cjs} +1 -1
  34. package/lib/edge/{input-752f3ce9.js → input-e7301f4e.js} +1 -1
  35. package/lib/edge/personalization-container-035be6ba.js +384 -0
  36. package/lib/edge/personalization-container-25cd8b5e.cjs +138 -0
  37. package/lib/edge/{select-a1d6e80e.js → select-4187b229.js} +1 -1
  38. package/lib/edge/{select-49a73a0b.cjs → select-64fdaa79.cjs} +1 -1
  39. package/lib/edge/server-entry-2ef4e66a.cjs +2 -0
  40. package/lib/edge/{server-entry-35f12729.js → server-entry-61fca4f7.js} +322 -280
  41. package/lib/edge/server-entry.cjs +1 -1
  42. package/lib/edge/server-entry.mjs +1 -1
  43. package/lib/edge/{slot-2327e009.cjs → slot-995f63c2.cjs} +1 -1
  44. package/lib/edge/{slot-b9bcbd41.js → slot-d6c46a42.js} +3 -3
  45. package/lib/edge/{symbol-3527699b.cjs → symbol-498daa97.cjs} +1 -1
  46. package/lib/edge/{symbol-33e7736f.js → symbol-623dc717.js} +2 -2
  47. package/lib/edge/{tabs-bc422e4c.js → tabs-12ba41b1.js} +3 -3
  48. package/lib/edge/{tabs-2df0eaa2.cjs → tabs-d39499cd.cjs} +1 -1
  49. package/lib/edge/video-4ecfd08b.cjs +1 -0
  50. package/lib/edge/{video-58c2cc8d.js → video-a3f10439.js} +0 -1
  51. package/lib/node/blocks-exports.cjs +170 -33
  52. package/lib/node/blocks-exports.mjs +1372 -970
  53. package/lib/node/index.cjs +1 -1
  54. package/lib/node/index.mjs +17 -16
  55. package/lib/node/init.cjs +1 -1
  56. package/lib/node/init.mjs +3 -3
  57. package/lib/node/{server-entry-d1ed35c5.js → server-entry-27d9d31e.js} +279 -237
  58. package/lib/node/server-entry-98ebff74.cjs +2 -0
  59. package/lib/node/server-entry.cjs +1 -1
  60. package/lib/node/server-entry.mjs +1 -1
  61. package/lib/node/{setIvm-6675714a.js → setIvm-2dde9074.js} +1 -1
  62. package/lib/node/{setIvm-e4deba11.cjs → setIvm-784fe19f.cjs} +1 -1
  63. package/lib/node/setIvm.cjs +1 -1
  64. package/lib/node/setIvm.mjs +2 -2
  65. package/lib/node/{should-force-browser-runtime-in-node-75b2b3a0.js → should-force-browser-runtime-in-node-80f081c8.js} +1 -1
  66. package/lib/node/{should-force-browser-runtime-in-node-03adae17.cjs → should-force-browser-runtime-in-node-cd6baa94.cjs} +1 -1
  67. package/package.json +2 -2
  68. package/types/blocks/form/form/form.d.ts +1 -0
  69. package/types/blocks/personalization-container/component-info.d.ts +2 -0
  70. package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
  71. package/types/blocks/personalization-container/helpers.d.ts +27 -0
  72. package/types/blocks/personalization-container/index.d.ts +1 -0
  73. package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
  74. package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
  75. package/types/constants/sdk-version.d.ts +1 -1
  76. package/types/helpers/user-attributes.d.ts +17 -0
  77. package/types/index-helpers/blocks-exports.d.ts +1 -0
  78. package/types/types/components.d.ts +2 -2
  79. package/types/types/input.d.ts +1 -0
  80. package/lib/browser/server-entry-5eafc5bd.cjs +0 -2
  81. package/lib/edge/content-variants-0db90715.cjs +0 -134
  82. package/lib/edge/form-79639135.cjs +0 -1
  83. package/lib/edge/form-7a7b98cf.js +0 -176
  84. package/lib/edge/image-4db81d72.cjs +0 -17
  85. package/lib/edge/server-entry-6b2058e2.cjs +0 -2
  86. package/lib/edge/video-e20dcbbc.cjs +0 -1
  87. package/lib/node/server-entry-606ce65a.cjs +0 -2
@@ -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-6b143ec7.js";
4
- import "./server-entry-35f12729.js";
3
+ import { getClassPropName as n } from "./get-class-prop-name-38c2baca.js";
4
+ import "./server-entry-61fca4f7.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-8fb0e5ad.cjs");require("./server-entry-6b2058e2.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-fbe244e3.cjs");require("./server-entry-2ef4e66a.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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("./blocks-827b0a87.cjs"),j=require("./dynamic-renderer-b29b45ca.cjs"),B=require("./get-class-prop-name-8fb0e5ad.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-6b2058e2.cjs");const q=t=>`builder-columns ${t}-breakpoints`;function p(t){var f,k;function a(){return typeof t.space=="number"?t.space||0:20}function s(){return t.columns||[]}function u(){return t.stackColumnsAt||"tablet"}function y(e){return e.link?t.builderLinkComponent||"a":"div"}function x(e){var n;return((n=s()[e])==null?void 0:n.width)||100/s().length}function S(e){const n=x(e),i=a()*(s().length-1)*(n/100);return`calc(${n}% - ${i}px)`}function c({stackedStyle:e,desktopStyle:n}){return u()==="tablet"?e:n}function d({stackedStyle:e,desktopStyle:n}){return u()==="never"?n:e}function m(){return t.stackColumnsAt==="never"?"row":t.reverseColumnsWhenStacked?"column-reverse":"column"}function C(){return{"--flex-dir":m(),"--flex-dir-tablet":c({stackedStyle:m(),desktopStyle:"row"})}}function v(e){const n=e===0?0:a(),i=S(e),r=`${n}px`,g="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:i,["marginLeft"]:r,"--column-width-mobile":d({stackedStyle:g,desktopStyle:i}),"--column-margin-left-mobile":d({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:g,desktopStyle:i}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}}function b(e){var i,r;return o.getSizesForBreakpoints(((r=(i=t.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[e].max}function w(){const e=`.${t.builderBlock.id}-breakpoints > .builder-column`;return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("./blocks-459a090b.cjs"),j=require("./dynamic-renderer-b29b45ca.cjs"),B=require("./get-class-prop-name-fbe244e3.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-2ef4e66a.cjs");const q=t=>`builder-columns ${t}-breakpoints`;function p(t){var f,k;function c(){return typeof t.space=="number"?t.space||0:20}function s(){return t.columns||[]}function u(){return t.stackColumnsAt||"tablet"}function y(e){return e.link?t.builderLinkComponent||"a":"div"}function x(e){var n;return((n=s()[e])==null?void 0:n.width)||100/s().length}function S(e){const n=x(e),i=c()*(s().length-1)*(n/100);return`calc(${n}% - ${i}px)`}function a({stackedStyle:e,desktopStyle:n}){return u()==="tablet"?e:n}function d({stackedStyle:e,desktopStyle:n}){return u()==="never"?n:e}function m(){return t.stackColumnsAt==="never"?"row":t.reverseColumnsWhenStacked?"column-reverse":"column"}function C(){return{"--flex-dir":m(),"--flex-dir-tablet":a({stackedStyle:m(),desktopStyle:"row"})}}function v(e){const n=e===0?0:c(),i=S(e),r=`${n}px`,g="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:i,["marginLeft"]:r,"--column-width-mobile":d({stackedStyle:g,desktopStyle:i}),"--column-margin-left-mobile":d({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":a({stackedStyle:g,desktopStyle:i}),"--column-margin-left-tablet":a({stackedStyle:h,desktopStyle:r})}}function b(e){var i,r;return o.getSizesForBreakpoints(((r=(i=t.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[e].max}function w(){const e=`.${t.builderBlock.id}-breakpoints > .builder-column`;return`
2
2
  @media (max-width: ${b("medium")}px) {
3
3
  .${t.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 $(e,n){return{...e.link?{href:e.link}:{},[B.getClassPropName()]:"builder-column",style:o.mapStyleObjToStrIfNeeded(v(n))}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:q((f=t.builderBlock)==null?void 0:f.id)+" div-d55bdf5c",style:C(),children:[l.jsx(o.InlinedStyles,{id:"builderio-columns",styles:w(),nonce:t.builderContext.nonce}),(k=t.columns)==null?void 0:k.map((e,n)=>l.jsx(j.DynamicRenderer,{TagName:y(e),actionAttributes:{},attributes:$(e,n),children:l.jsx(o.Blocks,{path:`columns.${n}.blocks`,parent:t.builderBlock.id,styleProp:{flexGrow:"1"},context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent,blocks:e.blocks})},n))]}),l.jsx("style",{children:`.div-d55bdf5c {
25
+ `}function $(e,n){return{...e.link?{href:e.link}:{},[B.getClassPropName()]:"builder-column",style:o.mapStyleObjToStrIfNeeded(v(n))}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:q((f=t.builderBlock)==null?void 0:f.id)+" div-a6f3faac",style:C(),children:[l.jsx(o.InlinedStyles,{id:"builderio-columns",styles:w(),nonce:t.builderContext.nonce}),(k=t.columns)==null?void 0:k.map((e,n)=>l.jsx(j.DynamicRenderer,{TagName:y(e),actionAttributes:{},attributes:$(e,n),children:l.jsx(o.Blocks,{path:`columns.${n}.blocks`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent,blocks:e.blocks,styleProp:{flexGrow:"1"}})},n))]}),l.jsx("style",{children:`.div-a6f3faac {
26
26
  display: flex;
27
27
  line-height: normal;
28
28
  }`})]})}exports.default=p;
@@ -1,14 +1,14 @@
1
1
  import { jsxs as h, Fragment as $, jsx as r } from "react/jsx-runtime";
2
- import { InlinedStyles as B, Blocks as L, mapStyleObjToStrIfNeeded as W, getSizesForBreakpoints as z } from "./blocks-105e50e5.js";
2
+ import { InlinedStyles as B, Blocks as L, mapStyleObjToStrIfNeeded as W, getSizesForBreakpoints as z } from "./blocks-582a7fd7.js";
3
3
  import { DynamicRenderer as A } from "./dynamic-renderer-8b343325.js";
4
- import { getClassPropName as N } from "./get-class-prop-name-6b143ec7.js";
4
+ import { getClassPropName as N } from "./get-class-prop-name-38c2baca.js";
5
5
  import "react";
6
6
  import "./blocks-exports.mjs";
7
- import "./server-entry-35f12729.js";
7
+ import "./server-entry-61fca4f7.js";
8
8
  const D = (e) => `builder-columns ${e}-breakpoints`;
9
9
  function O(e) {
10
- var b, f;
11
- function a() {
10
+ var f, b;
11
+ function c() {
12
12
  return typeof e.space == "number" ? e.space || 0 : 20;
13
13
  }
14
14
  function o() {
@@ -25,10 +25,10 @@ function O(e) {
25
25
  return ((n = o()[t]) == null ? void 0 : n.width) || 100 / o().length;
26
26
  }
27
27
  function x(t) {
28
- const n = S(t), i = a() * (o().length - 1) * (n / 100);
28
+ const n = S(t), i = c() * (o().length - 1) * (n / 100);
29
29
  return `calc(${n}% - ${i}px)`;
30
30
  }
31
- function c({
31
+ function a({
32
32
  stackedStyle: t,
33
33
  desktopStyle: n
34
34
  }) {
@@ -46,14 +46,14 @@ function O(e) {
46
46
  function C() {
47
47
  return {
48
48
  "--flex-dir": u(),
49
- "--flex-dir-tablet": c({
49
+ "--flex-dir-tablet": a({
50
50
  stackedStyle: u(),
51
51
  desktopStyle: "row"
52
52
  })
53
53
  };
54
54
  }
55
55
  function v(t) {
56
- const n = t === 0 ? 0 : a(), i = x(t), l = `${n}px`, k = "100%", g = 0;
56
+ const n = t === 0 ? 0 : c(), i = x(t), l = `${n}px`, k = "100%", g = 0;
57
57
  return {
58
58
  ...{
59
59
  display: "flex",
@@ -70,11 +70,11 @@ function O(e) {
70
70
  stackedStyle: g,
71
71
  desktopStyle: l
72
72
  }),
73
- "--column-width-tablet": c({
73
+ "--column-width-tablet": a({
74
74
  stackedStyle: k,
75
75
  desktopStyle: i
76
76
  }),
77
- "--column-margin-left-tablet": c({
77
+ "--column-margin-left-tablet": a({
78
78
  stackedStyle: g,
79
79
  desktopStyle: l
80
80
  })
@@ -127,7 +127,7 @@ function O(e) {
127
127
  /* @__PURE__ */ h(
128
128
  "div",
129
129
  {
130
- className: D((b = e.builderBlock) == null ? void 0 : b.id) + " div-d55bdf5c",
130
+ className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-a6f3faac",
131
131
  style: C(),
132
132
  children: [
133
133
  /* @__PURE__ */ r(
@@ -138,7 +138,7 @@ function O(e) {
138
138
  nonce: e.builderContext.nonce
139
139
  }
140
140
  ),
141
- (f = e.columns) == null ? void 0 : f.map((t, n) => /* @__PURE__ */ r(
141
+ (b = e.columns) == null ? void 0 : b.map((t, n) => /* @__PURE__ */ r(
142
142
  A,
143
143
  {
144
144
  TagName: y(t),
@@ -149,13 +149,13 @@ function O(e) {
149
149
  {
150
150
  path: `columns.${n}.blocks`,
151
151
  parent: e.builderBlock.id,
152
- styleProp: {
153
- flexGrow: "1"
154
- },
155
152
  context: e.builderContext,
156
153
  registeredComponents: e.builderComponents,
157
154
  linkComponent: e.builderLinkComponent,
158
- blocks: t.blocks
155
+ blocks: t.blocks,
156
+ styleProp: {
157
+ flexGrow: "1"
158
+ }
159
159
  }
160
160
  )
161
161
  },
@@ -164,7 +164,7 @@ function O(e) {
164
164
  ]
165
165
  }
166
166
  ),
167
- /* @__PURE__ */ r("style", { children: `.div-d55bdf5c {
167
+ /* @__PURE__ */ r("style", { children: `.div-a6f3faac {
168
168
  display: flex;
169
169
  line-height: normal;
170
170
  }` })