@builder.io/sdk-react 2.0.2 → 2.0.3

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 (68) hide show
  1. package/lib/browser/blocks-exports.cjs +25 -25
  2. package/lib/browser/blocks-exports.mjs +120 -119
  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-02cecfb7.cjs +2 -0
  8. package/lib/browser/server-entry-0687830a.js +688 -0
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{accordion-ca081054.js → accordion-0eca9b08.js} +1 -1
  12. package/lib/edge/{accordion-4f96554c.cjs → accordion-368a2cf8.cjs} +1 -1
  13. package/lib/edge/{blocks-f55c7d3e.js → blocks-db3cfcac.js} +130 -129
  14. package/lib/edge/blocks-exports.cjs +1 -1
  15. package/lib/edge/blocks-exports.mjs +2 -2
  16. package/lib/edge/{blocks-078044bc.cjs → blocks-f524a758.cjs} +13 -13
  17. package/lib/edge/{button-5d140f8e.cjs → button-3ed29654.cjs} +1 -1
  18. package/lib/edge/{button-41169061.js → button-e852700f.js} +2 -2
  19. package/lib/edge/columns-1f84e26e.cjs +28 -0
  20. package/lib/edge/{columns-f8916a18.js → columns-ee464f6c.js} +49 -48
  21. package/lib/edge/{content-variants-89a9389a.cjs → content-variants-42f2495b.cjs} +4 -4
  22. package/lib/edge/{content-variants-71ee0c76.js → content-variants-c0257a99.js} +23 -23
  23. package/lib/edge/{form-f2d2c2bf.cjs → form-4444faf2.cjs} +1 -1
  24. package/lib/edge/{form-ac2f2a0e.js → form-8191004e.js} +3 -3
  25. package/lib/edge/{get-class-prop-name-a9b4959e.cjs → get-class-prop-name-5fc98fcc.cjs} +1 -1
  26. package/lib/edge/{get-class-prop-name-a677d7a5.js → get-class-prop-name-d18337d2.js} +1 -1
  27. package/lib/edge/{img-b91cb4fd.cjs → img-10ef20a5.cjs} +1 -1
  28. package/lib/edge/{img-8fc26395.js → img-a24ed75f.js} +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-549f090e.js → input-3876429d.js} +1 -1
  34. package/lib/edge/{input-ec7c695a.cjs → input-6325bfc0.cjs} +1 -1
  35. package/lib/edge/{select-3ffa9294.cjs → select-3f0f00f3.cjs} +1 -1
  36. package/lib/edge/{select-6a5a28ac.js → select-5dc1c7d1.js} +1 -1
  37. package/lib/edge/server-entry-805b9266.cjs +2 -0
  38. package/lib/edge/server-entry-ff728468.js +689 -0
  39. package/lib/edge/server-entry.cjs +1 -1
  40. package/lib/edge/server-entry.mjs +1 -1
  41. package/lib/edge/{slot-40de071b.js → slot-20fe5e4f.js} +3 -3
  42. package/lib/edge/{slot-8b27e15e.cjs → slot-a64b535f.cjs} +1 -1
  43. package/lib/edge/{symbol-76e76298.cjs → symbol-5012ed02.cjs} +1 -1
  44. package/lib/edge/{symbol-e6515a5f.js → symbol-e95082e1.js} +2 -2
  45. package/lib/edge/{tabs-b75be82d.js → tabs-261e8cd4.js} +3 -3
  46. package/lib/edge/{tabs-9c5af0ec.cjs → tabs-d672f816.cjs} +1 -1
  47. package/lib/node/blocks-exports.cjs +11 -11
  48. package/lib/node/blocks-exports.mjs +74 -73
  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-0e37d6f7.cjs → node-runtime-160b6846.cjs} +2 -2
  54. package/lib/node/{node-runtime-0f3a5df1.js → node-runtime-405effc5.js} +3 -2
  55. package/lib/node/server-entry-02cecfb7.cjs +2 -0
  56. package/lib/node/server-entry-0687830a.js +688 -0
  57. package/lib/node/server-entry.cjs +1 -1
  58. package/lib/node/server-entry.mjs +1 -1
  59. package/package.json +1 -1
  60. package/types/constants/sdk-version.d.ts +1 -1
  61. package/types/functions/register-component.d.ts +2 -2
  62. package/lib/browser/server-entry-419c051e.cjs +0 -2
  63. package/lib/browser/server-entry-825b4408.js +0 -695
  64. package/lib/edge/columns-354bf349.cjs +0 -28
  65. package/lib/edge/server-entry-966ac144.cjs +0 -2
  66. package/lib/edge/server-entry-d2020acf.js +0 -695
  67. package/lib/node/server-entry-5ebd1c9b.js +0 -695
  68. package/lib/node/server-entry-8002325b.cjs +0 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-966ac144.cjs");const y=t=>t.toString();function v(t){var u;const[o,s]=O.useState(()=>[]);function d(){return!!(t.grid||t.oneAtATime)}function C(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...t.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function h(){const n={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(n).filter(([l,a])=>a!==void 0))}function j(e){return`builder-accordion-title builder-accordion-title-${o.includes(e)?"open":"closed"}`}function k(e){return`builder-accordion-detail builder-accordion-detail-${o.includes(e)?"open":"closed"}`}function c(){let e=null;if(t.grid&&o.length&&document){const l=o[0];let i=document.querySelector(`.builder-accordion-title[data-index="${l}"]`);if(e=l,i){let m=i.getBoundingClientRect();for(;i=i&&i.nextElementSibling;)if(i){if(i.classList.contains("builder-accordion-detail"))continue;const f=i.getBoundingClientRect();if(f.left>m.left){const b=parseInt(i.getAttribute("data-index")||"",10);isNaN(b)||(m=f,e=b)}else break}}}return typeof e=="number"&&(e=e+1),e}function x(){const e={order:typeof c()=="number"?c():void 0,...t.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(e).filter(([n,l])=>l!==void 0))}function I(e){o.includes(e)?s(d()?[]:o.filter(n=>n!==e)):s(d()?[e]:o.concat(e))}return r.jsx("div",{className:"builder-accordion",style:C(),children:(u=t.items)==null?void 0:u.map((e,n)=>r.jsxs(r.Fragment,{children:[r.jsx("div",{className:j(n),style:{...h(),width:t.grid?t.gridRowWidth:void 0,order:c()!==null?y(n):y(n+1)},"data-index":n,onClick:l=>I(n),children:r.jsx(g.Blocks,{blocks:e.title,path:`items.${n}.title`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}),o.includes(n)?r.jsx("div",{className:k(n),style:x(),children:r.jsx(g.Blocks,{blocks:e.detail,path:`items.${n}.detail`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}):null]}))})}exports.default=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-805b9266.cjs");const y=t=>t.toString();function v(t){var u;const[o,s]=O.useState(()=>[]);function d(){return!!(t.grid||t.oneAtATime)}function C(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...t.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function h(){const n={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(n).filter(([l,a])=>a!==void 0))}function j(e){return`builder-accordion-title builder-accordion-title-${o.includes(e)?"open":"closed"}`}function k(e){return`builder-accordion-detail builder-accordion-detail-${o.includes(e)?"open":"closed"}`}function c(){let e=null;if(t.grid&&o.length&&document){const l=o[0];let i=document.querySelector(`.builder-accordion-title[data-index="${l}"]`);if(e=l,i){let m=i.getBoundingClientRect();for(;i=i&&i.nextElementSibling;)if(i){if(i.classList.contains("builder-accordion-detail"))continue;const f=i.getBoundingClientRect();if(f.left>m.left){const b=parseInt(i.getAttribute("data-index")||"",10);isNaN(b)||(m=f,e=b)}else break}}}return typeof e=="number"&&(e=e+1),e}function x(){const e={order:typeof c()=="number"?c():void 0,...t.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(e).filter(([n,l])=>l!==void 0))}function I(e){o.includes(e)?s(d()?[]:o.filter(n=>n!==e)):s(d()?[e]:o.concat(e))}return r.jsx("div",{className:"builder-accordion",style:C(),children:(u=t.items)==null?void 0:u.map((e,n)=>r.jsxs(r.Fragment,{children:[r.jsx("div",{className:j(n),style:{...h(),width:t.grid?t.gridRowWidth:void 0,order:c()!==null?y(n):y(n+1)},"data-index":n,onClick:l=>I(n),children:r.jsx(g.Blocks,{blocks:e.title,path:`items.${n}.title`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}),o.includes(n)?r.jsx("div",{className:k(n),style:x(),children:r.jsx(g.Blocks,{blocks:e.detail,path:`items.${n}.detail`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}):null]}))})}exports.default=v;