@chaibuilder/sdk 1.2.17 → 1.2.19

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 (91) hide show
  1. package/dist/AddBlocks-KeHVFaIr.cjs +1 -0
  2. package/dist/{AddBlocks--SllKzEG.js → AddBlocks-gcTaEIKO.js} +5 -4
  3. package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
  4. package/dist/{BrandingOptions-IqtZrxqX.js → BrandingOptions-bfiFY0VR.js} +11 -10
  5. package/dist/{CanvasArea-iLUw-tom.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
  6. package/dist/{CanvasArea-T1XNnB7d.js → CanvasArea-xvMCbQDL.js} +8 -7
  7. package/dist/{CurrentPage-TCduhO-X.js → CurrentPage-0Ap2N0uc.js} +13 -12
  8. package/dist/CurrentPage-vj52UxMA.cjs +1 -0
  9. package/dist/ListTree-Vq0_s1wC.cjs +1 -0
  10. package/dist/ListTree-k-QMO740.js +96 -0
  11. package/dist/{Outline-3IPrK7F-.js → Outline-HI6-c9nf.js} +96 -92
  12. package/dist/Outline-fAflJ_lN.cjs +1 -0
  13. package/dist/{PagesPanel-7goyNL8t.js → PagesPanel-Pk-C1956.js} +7 -6
  14. package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
  15. package/dist/{ProjectPanel-CdPFwsXg.js → ProjectPanel-_KQBhuPO.js} +8 -7
  16. package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
  17. package/dist/Settings-Cc9eV4VG.cjs +1 -0
  18. package/dist/{Settings-pva9XRUC.js → Settings-XtAatoiu.js} +5 -4
  19. package/dist/{SidePanels-u5QXQrWL.js → SidePanels-O52zKXbH.js} +134 -133
  20. package/dist/SidePanels-ugRobm34.cjs +1 -0
  21. package/dist/Topbar-e5MGWX9n.cjs +1 -0
  22. package/dist/{Topbar-S3zgo3N8.js → Topbar-oTx7a12r.js} +5 -4
  23. package/dist/{UnsplashImages-132gZ842.js → UnsplashImages-5A21uzMK.js} +5 -4
  24. package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
  25. package/dist/UploadImages-V42YSRVO.cjs +1 -0
  26. package/dist/{UploadImages-tr54Ik1I.js → UploadImages-V_54lCAO.js} +5 -4
  27. package/dist/{add-page-modal-AsP5g0Fp.js → add-page-modal-dKQLw7RQ.js} +17 -16
  28. package/dist/add-page-modal-xMedOdsp.cjs +1 -0
  29. package/dist/{confirm-alert-dYoU1ln_.js → confirm-alert-8GP3bKH_.js} +5 -4
  30. package/dist/{confirm-alert-bw0VBgoG.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.ts +3 -2
  33. package/dist/core.js +47 -46
  34. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  35. package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
  36. package/dist/{delete-page-modal-_Hy6ls6b.js → delete-page-modal-Zb5ld6O-.js} +7 -6
  37. package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
  38. package/dist/email-blocks.cjs +1 -1
  39. package/dist/email-blocks.js +79 -79
  40. package/dist/email.cjs +1 -1
  41. package/dist/email.d.ts +3 -2
  42. package/dist/email.js +6 -5
  43. package/dist/{form-jzX2YXUO.cjs → form-o6_55v8F.cjs} +1 -1
  44. package/dist/{form-f13cs-An.js → form-yyU2x7So.js} +1 -1
  45. package/dist/{index-4xyhDki2.cjs → index-BMZLAJUV.cjs} +1 -1
  46. package/dist/{index-0JU8vPT_.cjs → index-JdnF6lYP.cjs} +42 -42
  47. package/dist/{index-MaXiXghQ.js → index-WP7IRkij.js} +915 -915
  48. package/dist/{index-ugsWasKp.js → index-lFcrvDFC.js} +3 -3
  49. package/dist/index-thKfFhmr.cjs +1 -0
  50. package/dist/{index-eyVVbA05.js → index-yILWlilS.js} +3142 -3132
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +1 -1
  53. package/dist/{page-viewer-P5Im9RfR.js → page-viewer-3QXwPGpg.js} +11 -10
  54. package/dist/page-viewer-DTIblLiz.cjs +1 -0
  55. package/dist/{project-general-setting-R3pVVXmY.js → project-general-setting-UalRmyHm.js} +8 -7
  56. package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
  57. package/dist/{project-seo-setting-pGpm3-6U.js → project-seo-setting-8FsvPSPl.js} +6 -5
  58. package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
  59. package/dist/render.cjs +1 -1
  60. package/dist/render.d.ts +10 -0
  61. package/dist/render.js +164 -78
  62. package/dist/{single-page-detail-m-THVQnz.js → single-page-detail-GaB85dNv.js} +9 -8
  63. package/dist/single-page-detail-XdBysrE_.cjs +1 -0
  64. package/dist/studio.cjs +1 -1
  65. package/dist/studio.d.ts +3 -2
  66. package/dist/studio.js +6 -5
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +1 -1
  69. package/dist/ui.js +140 -139
  70. package/dist/{useAddBlockByDrop-6qaL4Ufz.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-vGme3brY.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
  72. package/package.json +2 -1
  73. package/dist/AddBlocks-7TF41ISQ.cjs +0 -1
  74. package/dist/BrandingOptions-uKE1vuWd.cjs +0 -1
  75. package/dist/CurrentPage-N5hSL1xB.cjs +0 -1
  76. package/dist/Outline-g4TXJ-hK.cjs +0 -1
  77. package/dist/PagesPanel-qI3sijis.cjs +0 -1
  78. package/dist/ProjectPanel-bMllQ4_a.cjs +0 -1
  79. package/dist/Settings-8f4ivm4-.cjs +0 -1
  80. package/dist/SidePanels-7HqZM4-j.cjs +0 -1
  81. package/dist/Topbar-poeqjjZb.cjs +0 -1
  82. package/dist/UnsplashImages-BOypn-e5.cjs +0 -1
  83. package/dist/UploadImages-giiNNHKq.cjs +0 -1
  84. package/dist/add-page-modal-ajpd-Gmw.cjs +0 -1
  85. package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
  86. package/dist/delete-page-modal-H4JOWYZe.cjs +0 -1
  87. package/dist/index-MQH3blB-.cjs +0 -1
  88. package/dist/page-viewer-Xj9v8mji.cjs +0 -1
  89. package/dist/project-general-setting--5DT1RoW.cjs +0 -1
  90. package/dist/project-seo-setting-3DzzF83_.cjs +0 -1
  91. package/dist/single-page-detail-nJzGUDym.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),l=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),s=require("@chaibuilder/runtime"),d=require("./empty-slot-nzYOgZuS.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const x=({blockProps:e,styles:t,children:o,inBuilder:n})=>{let i=o;return o||(i=l.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{},inBuilder:n})),l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:i})};s.registerChaiBlock(x,{type:"Container",label:"Container",group:"basic",category:"core",canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1,canBeNested:e=>!e});const g=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});s.registerChaiBlock(g,{type:"Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const m=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});s.registerChaiBlock(m,{type:"Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Row",_id:"a"},{_type:"Column",_id:"b",_parent:"a"}],props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const h=({blockProps:e,styles:t,children:o,align:n})=>{let i=o;return o||(i=l.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:i})};s.registerChaiBlock(h,{type:"Column",label:"Column",group:"basic",category:"core",icon:a.ImageIcon,props:{styles:r.S({default:""}),align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0,canBeNested:e=>e==="Row"});const k=({level:e,blockProps:t,styles:o,content:n})=>l.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:n}),b=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});s.registerChaiBlock(k,{type:"Heading",label:"Heading",group:"basic",category:"core",icon:a.HeadingIcon,builderComponent:b,props:{content:r.u({title:"Content",default:"Enter your heading here..."}),styles:r.S({default:"text-xl"}),level:r.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),C=({content:e,blockProps:t,styles:o})=>l.jsxRuntimeExports.jsx("p",{...t,...o,children:e});s.registerChaiBlock(B,{type:"Text",label:"Text",group:"basic",category:"core",icon:a.TextIcon,builderComponent:C,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."}),styles:r.S({default:""})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const j=({content:e})=>e,f=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(j,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:f,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const y=({blockProps:e,styles:t,link:o,content:n})=>l.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:n}),R=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});s.registerChaiBlock(y,{type:"Button",label:"Button",group:"basic",category:"core",builderComponent:R,props:{content:r.u({title:"Content",default:"Click me"}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const v=({blockProps:e,styles:t,href:o,content:n,target:i,children:u})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:i,children:u||n}),E=({blockProps:e,styles:t,content:o,children:n})=>{let i=n;return n||(i=l.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx("span",{...e,...t,children:i||o})};s.registerChaiBlock(v,{type:"Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:E,props:{content:r.u({title:"Content",default:"I am a link."}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const w=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:o});s.registerChaiBlock(w,{type:"Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:r.g({default:"Preview content",title:"Content"})}});const S=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});s.registerChaiBlock(S,{type:"Markdown",label:"Markdown",group:"basic",category:"core",props:{content:r.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const L=({blockProps:e,styles:t,alt:o,image:n,width:i,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:i,height:u}),T=({blockProps:e,styles:t,alt:o,image:n,width:i,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:i,height:u});s.registerChaiBlock(L,{type:"Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:T,props:{styles:r.S({default:"w-full"}),image:r.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:r.u({title:"Alt",default:""}),width:r.u({title:"Width",default:""}),height:r.u({title:"Height",default:""})}});const q=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});s.registerChaiBlock(q,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:H,props:{styles:r.S({default:"w-full h-2"})}});const _=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:i,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:i,language:u}),A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});s.registerChaiBlock(_,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:A,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"}),theme:r.u({title:"Theme",default:"dracula"}),lineNumbers:r.r({title:"Line number",default:!1}),language:r.f({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const P=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),D=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});s.registerChaiBlock(P,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:D,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const M=p.noop;exports.loadEmailBlocks=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),i=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),s=require("@chaibuilder/runtime"),d=require("./empty-slot-nzYOgZuS.cjs"),l=require("./controls-Dy1qa8Dc.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const m=({blockProps:e,styles:t,children:o,inBuilder:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{},inBuilder:r})),i.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:n})};s.registerChaiBlock(m,{type:"Email/Container",label:"Container",group:"basic",category:"core",canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1,canBeNested:e=>!e});const x=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});s.registerChaiBlock(x,{type:"Email/Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{align:l.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const g=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});s.registerChaiBlock(g,{type:"Email/Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Email/Row",_id:"a"},{_type:"Email/Column",_id:"b",_parent:"a"}],props:{styles:l.S({default:""})},canAcceptBlock:e=>e==="Email/Column"});const h=({blockProps:e,styles:t,children:o,align:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),i.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:r,children:n})};s.registerChaiBlock(h,{type:"Email/Column",label:"Column",group:"basic",category:"core",icon:a.ImageIcon,props:{styles:l.S({default:""}),align:l.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0,canBeNested:e=>e==="Email/Row"});const k=({level:e,blockProps:t,styles:o,content:r})=>i.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:r}),b=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});s.registerChaiBlock(k,{type:"Email/Heading",label:"Heading",group:"basic",category:"core",icon:a.HeadingIcon,builderComponent:b,props:{content:l.u({title:"Content",default:"Enter your heading here..."}),styles:l.S({default:"text-xl"}),level:l.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),C=({content:e,blockProps:t,styles:o})=>i.jsxRuntimeExports.jsx("p",{...t,...o,children:e});s.registerChaiBlock(B,{type:"Email/Text",label:"Text",group:"basic",category:"core",icon:a.TextIcon,builderComponent:C,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."}),styles:l.S({default:""})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const j=({content:e})=>e,f=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(j,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:f,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const y=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:r}),E=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});s.registerChaiBlock(y,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:E,props:{content:l.u({title:"Content",default:"Click me"}),link:l.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const R=({blockProps:e,styles:t,href:o,content:r,target:n,children:u})=>i.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:n,children:u||r}),v=({blockProps:e,styles:t,content:o,children:r})=>{let n=r;return r||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),i.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o})};s.registerChaiBlock(R,{type:"Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:v,props:{content:l.u({title:"Content",default:"I am a link."}),link:l.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const w=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:o});s.registerChaiBlock(w,{type:"Email/Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:l.g({default:"Preview content",title:"Content"})}});const S=({blockProps:e,content:t})=>i.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});s.registerChaiBlock(S,{type:"Email/Markdown",label:"Markdown",group:"basic",category:"core",props:{content:l.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const L=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:r,alt:o,width:n,height:u}),T=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx("img",{...e,...t,src:r,alt:o,width:n,height:u});s.registerChaiBlock(L,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:T,props:{styles:l.S({default:"w-full"}),image:l.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.u({title:"Alt",default:""}),width:l.u({title:"Width",default:""}),height:l.u({title:"Height",default:""})}});const q=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx("hr",{...e,...t});s.registerChaiBlock(q,{type:"Email/Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:H,props:{styles:l.S({default:"w-full h-2"})}});const _=({blockProps:e,styles:t,code:o,lineNumbers:r,theme:n,language:u})=>i.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:r,theme:n,language:u}),A=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:i.jsxRuntimeExports.jsx("code",{children:o})});s.registerChaiBlock(_,{type:"Email/CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:A,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"}),theme:l.u({title:"Theme",default:"dracula"}),lineNumbers:l.r({title:"Line number",default:!1}),language:l.f({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const P=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),D=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("code",{...e,...t,children:o});s.registerChaiBlock(P,{type:"Email/CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:D,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"})}});const M=p.noop;exports.loadEmailBlocks=M;
@@ -1,21 +1,21 @@
1
1
  import { noop as f } from "lodash-es";
2
- import { j as l } from "./jsx-runtime-WbnYoNE9.js";
3
- import { Container as k, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as I, Markdown as L, Img as T, Hr as H, CodeBlock as R, CodeInline as _ } from "@react-email/components";
4
- import { registerChaiBlock as i } from "@chaibuilder/runtime";
2
+ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
3
+ import { Container as k, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
4
+ import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
5
  import { E as m } from "./empty-slot-ZBlsQi6m.js";
6
- import { f as d, S as c, u as s, g as u, q as g, o as A, r as S } from "./controls-XPXGHKht.js";
7
- import { ImageIcon as p, HeadingIcon as P, TextIcon as h, Link1Icon as D, DividerHorizontalIcon as M, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
6
+ import { f as d, S as a, u as s, g as u, q as g, o as _, r as A } from "./controls-XPXGHKht.js";
7
+ import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as P, DividerHorizontalIcon as D, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "react";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
- const N = ({ blockProps: e, styles: t, children: o, inBuilder: n }) => {
14
- let r = o;
15
- return o || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {}, inBuilder: n })), /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: r });
13
+ const M = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
14
+ let n = l;
15
+ return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {}, inBuilder: i })), /* @__PURE__ */ o.jsx(k, { ...e, ...t, children: n });
16
16
  };
17
- i(N, {
18
- type: "Container",
17
+ r(M, {
18
+ type: "Email/Container",
19
19
  label: "Container",
20
20
  group: "basic",
21
21
  category: "core",
@@ -25,9 +25,9 @@ i(N, {
25
25
  canDuplicate: () => !1,
26
26
  canBeNested: (e) => !e
27
27
  });
28
- const E = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
29
- i(E, {
30
- type: "Section",
28
+ const N = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
29
+ r(N, {
30
+ type: "Email/Section",
31
31
  label: "Section",
32
32
  group: "basic",
33
33
  category: "core",
@@ -46,34 +46,34 @@ i(E, {
46
46
  },
47
47
  canAcceptBlock: () => !0
48
48
  });
49
- const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, children: o });
50
- i($, {
51
- type: "Row",
49
+ const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
50
+ r($, {
51
+ type: "Email/Row",
52
52
  label: "Row",
53
53
  group: "basic",
54
54
  category: "core",
55
55
  icon: p,
56
56
  blocks: [
57
- { _type: "Row", _id: "a" },
58
- { _type: "Column", _id: "b", _parent: "a" }
57
+ { _type: "Email/Row", _id: "a" },
58
+ { _type: "Email/Column", _id: "b", _parent: "a" }
59
59
  ],
60
60
  props: {
61
- styles: c({ default: "" })
61
+ styles: a({ default: "" })
62
62
  },
63
- canAcceptBlock: (e) => e === "Column"
63
+ canAcceptBlock: (e) => e === "Email/Column"
64
64
  });
65
- const q = ({ blockProps: e, styles: t, children: o, align: n }) => {
66
- let r = o;
67
- return o || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx(B, { ...e, ...t, align: n, children: r });
65
+ const q = ({ blockProps: e, styles: t, children: l, align: i }) => {
66
+ let n = l;
67
+ return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
68
68
  };
69
- i(q, {
70
- type: "Column",
69
+ r(q, {
70
+ type: "Email/Column",
71
71
  label: "Column",
72
72
  group: "basic",
73
73
  category: "core",
74
74
  icon: p,
75
75
  props: {
76
- styles: c({ default: "" }),
76
+ styles: a({ default: "" }),
77
77
  align: d({
78
78
  title: "Align",
79
79
  default: "",
@@ -86,19 +86,19 @@ i(q, {
86
86
  })
87
87
  },
88
88
  canAcceptBlock: () => !0,
89
- canBeNested: (e) => e === "Row"
89
+ canBeNested: (e) => e === "Email/Row"
90
90
  });
91
- const z = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(C, { as: e, ...t, ...o, children: n }), J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
92
- i(z, {
93
- type: "Heading",
91
+ const z = ({ level: e, blockProps: t, styles: l, content: i }) => /* @__PURE__ */ o.jsx(C, { as: e, ...t, ...l, children: i }), J = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("h1", { ...e, ...t, children: l });
92
+ r(z, {
93
+ type: "Email/Heading",
94
94
  label: "Heading",
95
95
  group: "basic",
96
96
  category: "core",
97
- icon: P,
97
+ icon: S,
98
98
  builderComponent: J,
99
99
  props: {
100
100
  content: s({ title: "Content", default: "Enter your heading here..." }),
101
- styles: c({ default: "text-xl" }),
101
+ styles: a({ default: "text-xl" }),
102
102
  level: d({
103
103
  title: "Level",
104
104
  default: "h1",
@@ -113,11 +113,11 @@ i(z, {
113
113
  ]
114
114
  })
115
115
  },
116
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
116
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
117
117
  });
118
- const U = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, children: o }), V = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
119
- i(U, {
120
- type: "Text",
118
+ const U = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx(v, { ...e, ...t, children: l }), V = ({ content: e, blockProps: t, styles: l }) => /* @__PURE__ */ o.jsx("p", { ...t, ...l, children: e });
119
+ r(U, {
120
+ type: "Email/Text",
121
121
  label: "Text",
122
122
  group: "basic",
123
123
  category: "core",
@@ -128,13 +128,13 @@ i(U, {
128
128
  title: "Content",
129
129
  default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."
130
130
  }),
131
- styles: c({ default: "" })
131
+ styles: a({ default: "" })
132
132
  },
133
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
133
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
134
134
  });
135
- const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
136
- i(W, {
137
- type: "RawText",
135
+ const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ o.jsx("span", { ...t, children: e });
136
+ r(W, {
137
+ type: "Email/RawText",
138
138
  label: "Raw Text",
139
139
  group: "basic",
140
140
  category: "core",
@@ -148,9 +148,9 @@ i(W, {
148
148
  })
149
149
  }
150
150
  });
151
- const G = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o.href, children: n }), K = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
152
- i(G, {
153
- type: "Button",
151
+ const G = ({ blockProps: e, styles: t, link: l, content: i }) => /* @__PURE__ */ o.jsx(j, { ...e, ...t, href: l.href, children: i }), K = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("button", { type: "button", ...e, ...t, children: l });
152
+ r(G, {
153
+ type: "Email/Button",
154
154
  label: "Button",
155
155
  group: "basic",
156
156
  category: "core",
@@ -158,19 +158,19 @@ i(G, {
158
158
  props: {
159
159
  content: s({ title: "Content", default: "Click me" }),
160
160
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
- styles: c({ default: "bg-primary text-white px-4 py-2 rounded-md" })
161
+ styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
162
  }
163
163
  });
164
- const O = ({ blockProps: e, styles: t, href: o, content: n, target: r, children: a }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, href: o, target: r, children: a || n }), Q = ({ blockProps: e, styles: t, content: o, children: n }) => {
165
- let r = n;
166
- return n || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: r || o });
164
+ const O = ({ blockProps: e, styles: t, href: l, content: i, target: n, children: c }) => /* @__PURE__ */ o.jsx(w, { ...e, ...t, href: l, target: n, children: c || i }), Q = ({ blockProps: e, styles: t, content: l, children: i }) => {
165
+ let n = i;
166
+ return i || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
167
167
  };
168
- i(O, {
168
+ r(O, {
169
169
  type: "Link",
170
170
  label: "Link",
171
171
  group: "basic",
172
172
  category: "core",
173
- icon: D,
173
+ icon: P,
174
174
  blocks: [
175
175
  {
176
176
  _id: "a",
@@ -187,13 +187,13 @@ i(O, {
187
187
  props: {
188
188
  content: s({ title: "Content", default: "I am a link." }),
189
189
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
- styles: c({ default: "font-bold text-blue-500" })
190
+ styles: a({ default: "font-bold text-blue-500" })
191
191
  },
192
192
  canAcceptBlock: () => !0
193
193
  });
194
- const X = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(I, { ...e, ...t, children: o }), Y = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
195
- i(X, {
196
- type: "Preview",
194
+ const X = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(E, { ...e, ...t, children: l }), Y = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: l });
195
+ r(X, {
196
+ type: "Email/Preview",
197
197
  label: "Preview",
198
198
  group: "basic",
199
199
  category: "core",
@@ -204,9 +204,9 @@ i(X, {
204
204
  content: u({ default: "Preview content", title: "Content" })
205
205
  }
206
206
  });
207
- const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(L, { children: t, ...e });
208
- i(Z, {
209
- type: "Markdown",
207
+ const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
208
+ r(Z, {
209
+ type: "Email/Markdown",
210
210
  label: "Markdown",
211
211
  group: "basic",
212
212
  category: "core",
@@ -214,17 +214,17 @@ i(Z, {
214
214
  content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
215
  }
216
216
  });
217
- const ee = ({ blockProps: e, styles: t, alt: o, image: n, width: r, height: a }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t, src: n, alt: o, width: r, height: a }), te = ({ blockProps: e, styles: t, alt: o, image: n, width: r, height: a }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: r, height: a });
218
- i(ee, {
219
- type: "Image",
217
+ const ee = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx(L, { ...e, ...t, src: i, alt: l, width: n, height: c }), te = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx("img", { ...e, ...t, src: i, alt: l, width: n, height: c });
218
+ r(ee, {
219
+ type: "Email/Image",
220
220
  label: "Image",
221
221
  group: "basic",
222
222
  category: "core",
223
223
  icon: p,
224
224
  builderComponent: te,
225
225
  props: {
226
- styles: c({ default: "w-full" }),
227
- image: A({
226
+ styles: a({ default: "w-full" }),
227
+ image: _({
228
228
  title: "Image",
229
229
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
230
  }),
@@ -233,32 +233,32 @@ i(ee, {
233
233
  height: s({ title: "Height", default: "" })
234
234
  }
235
235
  });
236
- const oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t }), le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
237
- i(oe, {
238
- type: "Divider",
236
+ const le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx("hr", { ...e, ...t });
237
+ r(le, {
238
+ type: "Email/Divider",
239
239
  label: "Divider",
240
240
  group: "basic",
241
241
  category: "core",
242
- icon: M,
243
- builderComponent: le,
242
+ icon: D,
243
+ builderComponent: oe,
244
244
  props: {
245
- styles: c({ default: "w-full h-2" })
245
+ styles: a({ default: "w-full h-2" })
246
246
  }
247
247
  });
248
- const ne = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: r, language: a }) => /* @__PURE__ */ l.jsx(R, { ...e, ...t, code: o, linenumbers: n, theme: r, language: a }), re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
249
- i(ne, {
250
- type: "CodeBlock",
248
+ const ie = ({ blockProps: e, styles: t, code: l, lineNumbers: i, theme: n, language: c }) => /* @__PURE__ */ o.jsx(H, { ...e, ...t, code: l, linenumbers: i, theme: n, language: c }), ne = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: /* @__PURE__ */ o.jsx("code", { children: l }) });
249
+ r(ie, {
250
+ type: "Email/CodeBlock",
251
251
  label: "Code Block",
252
252
  group: "basic",
253
253
  category: "core",
254
254
  hidden: !0,
255
255
  icon: b,
256
- builderComponent: re,
256
+ builderComponent: ne,
257
257
  props: {
258
- styles: c({ default: "" }),
258
+ styles: a({ default: "" }),
259
259
  code: u({ title: "Code", default: "console.log('Hello, world!');" }),
260
260
  theme: s({ title: "Theme", default: "dracula" }),
261
- lineNumbers: S({
261
+ lineNumbers: A({
262
262
  title: "Line number",
263
263
  default: !1
264
264
  }),
@@ -275,16 +275,16 @@ i(ne, {
275
275
  })
276
276
  }
277
277
  });
278
- const ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(_, { ...e, ...t, children: o }), ce = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
279
- i(ie, {
280
- type: "CodeInline",
278
+ const re = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx(R, { ...e, ...t, children: l }), ae = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("code", { ...e, ...t, children: l });
279
+ r(re, {
280
+ type: "Email/CodeInline",
281
281
  label: "Code Inline",
282
282
  group: "basic",
283
283
  category: "core",
284
284
  icon: b,
285
- builderComponent: ce,
285
+ builderComponent: ae,
286
286
  props: {
287
- styles: c({ default: "" }),
287
+ styles: a({ default: "" }),
288
288
  code: u({ title: "Code", default: "console.log('Hello, world!');" })
289
289
  }
290
290
  });
package/dist/email.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-0JU8vPT_.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-MQH3blB-.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const t=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:t};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-JdnF6lYP.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-thKfFhmr.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const t=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:t};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
package/dist/email.d.ts CHANGED
@@ -24,6 +24,7 @@ declare type ChaiBlock = {
24
24
  } & Record<string, any>;
25
25
 
26
26
  declare interface ChaiBuilderEditorProps {
27
+ showDebugLogs?: boolean;
27
28
  autoSaveSupport?: boolean;
28
29
  autoSaveInterval?: TimeInSeconds;
29
30
  breakpoints?: Breakpoint[];
@@ -56,10 +57,9 @@ declare interface ChaiBuilderEditorProps {
56
57
  blocks?: ChaiBlock[];
57
58
  onSaveBlocks?: ({ blocks, providers }: any) => Promise<any>;
58
59
  onSavePage?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
60
+ onSave?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
59
61
  brandingOptions?: Record<string, string>;
60
62
  onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
61
- container?: ChaiBlock | "Body" | "Container";
62
- onSaveContainer?: (container: ChaiBlock) => Promise<boolean | Error>;
63
63
  onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
64
64
  previewComponent?: ReactComponentType;
65
65
  sideBarComponents?: {
@@ -117,6 +117,7 @@ declare type ReactComponentType = React_2.ComponentType<any>;
117
117
  declare type SavePageData = {
118
118
  blocks: ChaiBlock[];
119
119
  providers?: DataProvider[];
120
+ brandingOptions?: Record<string, any>;
120
121
  };
121
122
 
122
123
  declare type TimeInSeconds = number;
package/dist/email.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
- import { C as m } from "./index-eyVVbA05.js";
2
+ import { C as m } from "./index-yILWlilS.js";
3
3
  import { MobileIcon as i } from "@radix-ui/react-icons";
4
4
  import "./_commonjsHelpers-UyOWmZb0.js";
5
5
  import "react";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-MaXiXghQ.js";
8
+ import "./index-WP7IRkij.js";
9
9
  import "lodash-es";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
13
  import "@chaibuilder/runtime";
14
14
  import "jotai";
15
- import "flat-to-nested";
16
15
  import "./MODIFIERS-WQdaNvb8.js";
17
16
  import "@react-hookz/web";
17
+ import "flat-to-nested";
18
18
  import "@radix-ui/react-toggle";
19
19
  import "class-variance-authority";
20
20
  import "./Class-3k8xjeiM.js";
@@ -39,6 +39,7 @@ import "@radix-ui/react-context-menu";
39
39
  import "react-icons-picker";
40
40
  import "react-dom";
41
41
  import "react-quill";
42
+ import "lodash";
42
43
  import "@floating-ui/react-dom";
43
44
  import "react-textarea-autosize";
44
45
  import "flagged";
@@ -60,7 +61,7 @@ const p = [
60
61
  icon: /* @__PURE__ */ t.jsx(i, { className: "rotate-90" }),
61
62
  width: 700
62
63
  }
63
- ], $ = (o) => {
64
+ ], tt = (o) => {
64
65
  const r = {
65
66
  ...o,
66
67
  importHTMLSupport: !1,
@@ -70,5 +71,5 @@ const p = [
70
71
  return /* @__PURE__ */ t.jsx(m, { ...r });
71
72
  };
72
73
  export {
73
- $ as ChaiBuilderEmail
74
+ tt as ChaiBuilderEmail
74
75
  };
@@ -1 +1 @@
1
- "use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-MQH3blB-.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
1
+ "use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-thKfFhmr.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import b from "@rjsf/core";
3
3
  import x from "@rjsf/validator-ajv8";
4
4
  import { includes as h, get as a, set as $, first as F } from "lodash-es";
5
- import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-MaXiXghQ.js";
5
+ import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-WP7IRkij.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":