@builder.io/sdk-react 1.0.17 → 1.0.19-dev-0

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 (86) hide show
  1. package/lib/browser/blocks-exports.cjs +14 -14
  2. package/lib/browser/blocks-exports.mjs +350 -339
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +22 -21
  5. package/lib/browser/{server-entry-a7b75909.cjs → server-entry-1a86f409.cjs} +1 -1
  6. package/lib/browser/{server-entry-064a8b7f.js → server-entry-cfff49d1.js} +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-fe027bf7.js → blocks-03aafa4f.js} +196 -209
  10. package/lib/edge/{blocks-1f59d1c0.cjs → blocks-87a3568e.cjs} +9 -9
  11. package/lib/edge/blocks-exports.cjs +1 -1
  12. package/lib/edge/blocks-exports.mjs +27 -13
  13. package/lib/edge/{button-8fdd068a.js → button-14d13356.js} +3 -3
  14. package/lib/edge/{button-36ac5d97.cjs → button-58695538.cjs} +1 -1
  15. package/lib/edge/{columns-4f789807.js → columns-d2f7e212.js} +48 -47
  16. package/lib/edge/columns-f98bd830.cjs +28 -0
  17. package/lib/edge/{content-variants-87f99284.cjs → content-variants-7e661199.cjs} +5 -5
  18. package/lib/edge/{content-variants-a26825d5.js → content-variants-ad9f707f.js} +75 -75
  19. package/lib/edge/dynamic-blocks-exports.cjs +2 -0
  20. package/lib/edge/dynamic-blocks-exports.mjs +4 -1
  21. package/lib/edge/{dynamic-renderer-b29b45ca.cjs → dynamic-renderer-1c9f24c0.cjs} +1 -1
  22. package/lib/edge/dynamic-renderer-96ba4e48.js +8 -0
  23. package/lib/edge/{form-004ab04e.js → form-04cf10db.js} +69 -58
  24. package/lib/edge/form-e83f7b7a.cjs +1 -0
  25. package/lib/edge/{get-class-prop-name-ee5eac9d.js → get-class-prop-name-859a7f60.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-522545c4.cjs → get-class-prop-name-f1301669.cjs} +1 -1
  27. package/lib/edge/{image-0008c792.js → image-2cc909d9.js} +25 -25
  28. package/lib/edge/image-7e1361ce.cjs +17 -0
  29. package/lib/edge/{img-d311451e.cjs → img-0c1e53c0.cjs} +1 -1
  30. package/lib/edge/{img-5d36c59d.js → img-b4ff1bef.js} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +22 -21
  33. package/lib/edge/{input-34a4e538.cjs → input-2103da14.cjs} +1 -1
  34. package/lib/edge/{input-211240f4.js → input-c6fee09c.js} +1 -1
  35. package/lib/edge/{select-a425b313.cjs → select-b8ad0a4c.cjs} +1 -1
  36. package/lib/edge/{select-e592f42a.js → select-f260d051.js} +1 -1
  37. package/lib/edge/{server-entry-04a076eb.cjs → server-entry-00891f33.cjs} +1 -1
  38. package/lib/edge/{server-entry-633c4fab.js → server-entry-d46a218d.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-20e9bd0c.js → slot-8fa7f242.js} +7 -6
  42. package/lib/edge/slot-bb84f342.cjs +1 -0
  43. package/lib/edge/{symbol-8aa6a69b.js → symbol-324dadc8.js} +2 -2
  44. package/lib/edge/{symbol-441a42f8.cjs → symbol-636383eb.cjs} +1 -1
  45. package/lib/edge/video-64014cc4.cjs +1 -0
  46. package/lib/edge/{video-58c2cc8d.js → video-d02ff89b.js} +15 -15
  47. package/lib/node/blocks-exports.cjs +32 -72
  48. package/lib/node/blocks-exports.mjs +902 -1017
  49. package/lib/node/index.cjs +1 -1
  50. package/lib/node/index.mjs +24 -22
  51. package/lib/node/init.cjs +1 -0
  52. package/lib/node/init.mjs +8 -0
  53. package/lib/node/node-runtime-1ca09d03.js +137 -0
  54. package/lib/node/node-runtime-56212f7c.cjs +41 -0
  55. package/lib/node/{server-entry-a2617044.js → server-entry-8c84ddbd.js} +1 -1
  56. package/lib/node/{server-entry-e66a06c7.cjs → server-entry-ff6fc2b4.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 +6 -1
  60. package/types/blocks/form/component-info.d.ts +2 -0
  61. package/types/blocks/form/form.d.ts +3 -0
  62. package/types/blocks/input/component-info.d.ts +2 -0
  63. package/types/blocks/input/input.d.ts +15 -0
  64. package/types/blocks/select/component-info.d.ts +2 -0
  65. package/types/blocks/select/select.d.ts +16 -0
  66. package/types/blocks/submit-button/component-info.d.ts +2 -0
  67. package/types/blocks/submit-button/submit-button.d.ts +10 -0
  68. package/types/components/content/components/context-updater.d.ts +5 -0
  69. package/types/components/dynamic-renderer.d.ts +3 -0
  70. package/types/constants/sdk-version.d.ts +1 -1
  71. package/types/context/index.d.ts +1 -0
  72. package/types/functions/evaluate/node-runtime/init.d.ts +2 -0
  73. package/types/functions/evaluate/node-runtime/node-runtime.d.ts +1 -0
  74. package/types/functions/get-react-native-block-styles.d.ts +15 -0
  75. package/types/functions/sanitize-react-native-block-styles.d.ts +3 -0
  76. package/types/functions/sanitize-rn-allowed-css.d.ts +8 -0
  77. package/types/index-helpers/blocks-exports.d.ts +4 -0
  78. package/types/node-runtime/index.d.ts +1 -0
  79. package/types/node-runtime/node-runtime.d.ts +9 -0
  80. package/types/node-runtime.d.ts +1 -0
  81. package/lib/edge/columns-36bdc015.cjs +0 -28
  82. package/lib/edge/dynamic-renderer-8b343325.js +0 -8
  83. package/lib/edge/form-6b599bb9.cjs +0 -1
  84. package/lib/edge/image-ee3dd857.cjs +0 -17
  85. package/lib/edge/slot-1547b467.cjs +0 -1
  86. package/lib/edge/video-e20dcbbc.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("react"),b=require("./blocks-exports.cjs"),f=require("./get-class-prop-name-522545c4.cjs"),s=require("./server-entry-04a076eb.cjs"),v=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return s.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(i=>{s.logger.error("Could not fetch symbol content: ",i)})};function C(e){var r,c,a,d;function t(){var n,l;return[e.attributes[f.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,m]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function y(){i||v({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&m(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{y()},[e.symbol]),u.jsx("div",{...e.attributes,className:t(),children:u.jsx(b.Content,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(a=i==null?void 0:i.data)==null?void 0:a.state},model:(d=e.symbol)==null?void 0:d.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}exports.default=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("react"),b=require("./blocks-exports.cjs"),f=require("./get-class-prop-name-f1301669.cjs"),s=require("./server-entry-00891f33.cjs"),v=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return s.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(i=>{s.logger.error("Could not fetch symbol content: ",i)})};function C(e){var r,c,a,d;function t(){var n,l;return[e.attributes[f.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,m]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function y(){i||v({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&m(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{y()},[e.symbol]),u.jsx("div",{...e.attributes,className:t(),children:u.jsx(b.Content,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(a=i==null?void 0:i.data)==null?void 0:a.state},model:(d=e.symbol)==null?void 0:d.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}exports.default=C;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");function s(e){var i,n,l,d,o,u,r;function a(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function c(){return{...a()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...c(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((l=(n=e.builderBlock)==null?void 0:n.children)!=null&&l.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(o=(d=e.builderBlock)==null?void 0:d.children)!=null&&o.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(r=(u=e.builderBlock)==null?void 0:u.children)!=null&&r.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}exports.default=s;
@@ -1,7 +1,7 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- function f(e) {
3
- var i, l, n, o, d, u, a;
4
- function c() {
1
+ import { jsxs as s, jsx as t, Fragment as i } from "react/jsx-runtime";
2
+ function y(e) {
3
+ var l, n, d, o, u, a, c;
4
+ function r() {
5
5
  return {
6
6
  ...e.autoPlay === !0 ? {
7
7
  autoPlay: !0
@@ -20,9 +20,9 @@ function f(e) {
20
20
  } : {}
21
21
  };
22
22
  }
23
- function r() {
23
+ function h() {
24
24
  return {
25
- ...c()
25
+ ...r()
26
26
  };
27
27
  }
28
28
  return /* @__PURE__ */ s(
@@ -36,12 +36,12 @@ function f(e) {
36
36
  "video",
37
37
  {
38
38
  className: "builder-video",
39
- ...r(),
39
+ ...h(),
40
40
  preload: e.preload || "metadata",
41
41
  style: {
42
42
  width: "100%",
43
43
  height: "100%",
44
- ...(i = e.attributes) == null ? void 0 : i.style,
44
+ ...(l = e.attributes) == null ? void 0 : l.style,
45
45
  objectFit: e.fit,
46
46
  objectPosition: e.position,
47
47
  // Hack to get object fit to work as expected and
@@ -57,7 +57,7 @@ function f(e) {
57
57
  children: e.lazyLoad ? null : /* @__PURE__ */ t("source", { type: "video/mp4", src: e.video })
58
58
  }
59
59
  ),
60
- e.aspectRatio && !(e.fitContent && ((n = (l = e.builderBlock) == null ? void 0 : l.children) != null && n.length)) ? /* @__PURE__ */ t(
60
+ e.aspectRatio && !(e.fitContent && ((d = (n = e.builderBlock) == null ? void 0 : n.children) != null && d.length)) ? /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
61
61
  "div",
62
62
  {
63
63
  style: {
@@ -67,8 +67,8 @@ function f(e) {
67
67
  fontSize: "0px"
68
68
  }
69
69
  }
70
- ) : null,
71
- (d = (o = e.builderBlock) == null ? void 0 : o.children) != null && d.length && e.fitContent ? /* @__PURE__ */ t(
70
+ ) }) : null,
71
+ (u = (o = e.builderBlock) == null ? void 0 : o.children) != null && u.length && e.fitContent ? /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
72
72
  "div",
73
73
  {
74
74
  style: {
@@ -78,8 +78,8 @@ function f(e) {
78
78
  },
79
79
  children: e.children
80
80
  }
81
- ) : null,
82
- (a = (u = e.builderBlock) == null ? void 0 : u.children) != null && a.length && !e.fitContent ? /* @__PURE__ */ t(
81
+ ) }) : null,
82
+ (c = (a = e.builderBlock) == null ? void 0 : a.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
83
83
  "div",
84
84
  {
85
85
  style: {
@@ -95,11 +95,11 @@ function f(e) {
95
95
  },
96
96
  children: e.children
97
97
  }
98
- ) : null
98
+ ) }) : null
99
99
  ]
100
100
  }
101
101
  );
102
102
  }
103
103
  export {
104
- f as default
104
+ y as default
105
105
  };