@chaibuilder/sdk 1.2.25 → 1.2.27

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 (183) hide show
  1. package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
  2. package/dist/AddBlocks-ksZjjn0k.js +205 -0
  3. package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
  4. package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
  5. package/dist/CanvasArea-SDzbubar.cjs +55 -0
  6. package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
  7. package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
  8. package/dist/Class-MmCxz2Ay.cjs +1 -0
  9. package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
  10. package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
  11. package/dist/Functions-7jnEwJyw.js +15 -0
  12. package/dist/Functions-N3yhPYKY.cjs +1 -0
  13. package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
  14. package/dist/ListTree-SWsqdfcG.cjs +1 -0
  15. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  16. package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
  17. package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
  18. package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
  19. package/dist/ProjectPanel-ivFOhdcz.js +84 -0
  20. package/dist/ProjectPanel-pBePMOta.cjs +1 -0
  21. package/dist/Settings-JRyJayf5.cjs +1 -0
  22. package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
  23. package/dist/SidePanels-BtUeo6M9.cjs +1 -0
  24. package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
  25. package/dist/Topbar-QMeD3hvq.cjs +1 -0
  26. package/dist/Topbar-Yunooh00.js +131 -0
  27. package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
  28. package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
  29. package/dist/UploadImages-OgSN1HVt.cjs +1 -0
  30. package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/add-page-modal-9pTKItY-.cjs +1 -0
  34. package/dist/add-page-modal-U7AUUrI1.js +103 -0
  35. package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
  36. package/dist/confirm-alert-kV5-c70T.js +59 -0
  37. package/dist/controls-KK2oLIa8.cjs +1 -0
  38. package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.js +74 -150
  41. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  42. package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
  43. package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
  44. package/dist/delete-page-modal-UCBpdjLe.js +82 -0
  45. package/dist/email-blocks.cjs +1 -1
  46. package/dist/email-blocks.js +292 -3
  47. package/dist/email.cjs +1 -1
  48. package/dist/email.js +36 -18
  49. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  50. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  51. package/dist/form-Ap63cNec.cjs +1 -0
  52. package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
  53. package/dist/html-to-json-C_Eobs_d.cjs +1 -0
  54. package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
  55. package/dist/index-CFUoB97-.js +3079 -0
  56. package/dist/index-F4AQQ6qq.cjs +1 -0
  57. package/dist/index-Qk028f-N.cjs +1 -0
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-e0c8PmRQ.js +205 -0
  60. package/dist/index-ecnGWzh9.cjs +1 -0
  61. package/dist/index-f0AbmoYY.js +2201 -0
  62. package/dist/index-gi1LIOCw.cjs +1 -0
  63. package/dist/index-l19JVVXI.cjs +206 -0
  64. package/dist/index-lOJfSheQ.js +39503 -0
  65. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
  66. package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
  67. package/dist/lib.cjs +3 -3
  68. package/dist/lib.js +59 -56
  69. package/dist/page-viewer-YFrIG3L7.cjs +1 -0
  70. package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
  71. package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
  72. package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
  73. package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
  74. package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
  75. package/dist/render.cjs +1 -1
  76. package/dist/render.js +16 -16
  77. package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
  78. package/dist/single-page-detail-9abF2g2R.cjs +1 -0
  79. package/dist/studio.cjs +1 -1
  80. package/dist/studio.js +39 -24
  81. package/dist/ui.cjs +1 -1
  82. package/dist/ui.js +158 -364
  83. package/dist/web-blocks.cjs +1 -1
  84. package/dist/web-blocks.js +1052 -3
  85. package/package.json +1 -1
  86. package/dist/AddBlocks-Ol3iIVKa.js +0 -207
  87. package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
  88. package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
  89. package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
  90. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
  91. package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
  92. package/dist/Class-eieto7e-.cjs +0 -1
  93. package/dist/Controls-3Cc1XYXg.js +0 -105
  94. package/dist/Controls-ky25Ebo3.cjs +0 -1
  95. package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
  96. package/dist/Functions-Hvon6AMZ.cjs +0 -1
  97. package/dist/Functions-NzT2Six_.js +0 -15
  98. package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
  99. package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
  100. package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
  101. package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
  102. package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
  103. package/dist/ProjectPanel-EydGZmMW.js +0 -71
  104. package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
  105. package/dist/STRINGS-b432aBJJ.js +0 -7
  106. package/dist/STRINGS-gPz7CUOk.cjs +0 -1
  107. package/dist/Settings-8ilCSH8b.cjs +0 -1
  108. package/dist/SidePanels-T36C6Lhc.cjs +0 -1
  109. package/dist/Topbar-CvWQuspR.cjs +0 -1
  110. package/dist/Topbar-pbIDUE_B.js +0 -122
  111. package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
  112. package/dist/UploadImages-GkkJVAgG.cjs +0 -1
  113. package/dist/accordion-oPUeqPCZ.js +0 -42
  114. package/dist/accordion-ynvFtV_p.cjs +0 -1
  115. package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
  116. package/dist/add-page-modal-JCDXZIPW.js +0 -95
  117. package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
  118. package/dist/alert-dialog-rypfO5ly.js +0 -64
  119. package/dist/badge-E-S7CqUt.cjs +0 -1
  120. package/dist/badge-tEwO7C51.js +0 -23
  121. package/dist/block-helpers-OKHmRRol.cjs +0 -1
  122. package/dist/block-helpers-oSFpSsGz.js +0 -23
  123. package/dist/command-BxR6jaCI.cjs +0 -1
  124. package/dist/command-Pn3HKDuV.js +0 -97
  125. package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
  126. package/dist/confirm-alert-wR5_VJ1l.js +0 -36
  127. package/dist/context-menu-8dC9uGXj.js +0 -122
  128. package/dist/context-menu-IgLbIuth.cjs +0 -1
  129. package/dist/controls-L7DPvB0m.cjs +0 -1
  130. package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
  131. package/dist/delete-page-modal-7KmP1elv.js +0 -67
  132. package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
  133. package/dist/dropdown-menu-El86_9Uo.js +0 -124
  134. package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
  135. package/dist/form-W58AVUdf.cjs +0 -1
  136. package/dist/hover-card-KUwpDkW8.cjs +0 -1
  137. package/dist/hover-card-q138xxXR.js +0 -45
  138. package/dist/html-to-json-uSnxl72F.cjs +0 -1
  139. package/dist/iconBase-gbUAAO2L.cjs +0 -1
  140. package/dist/iconBase-h4DuR_XT.js +0 -63
  141. package/dist/index-9MmykVSc.cjs +0 -1
  142. package/dist/index-hElOGcFr.js +0 -2200
  143. package/dist/index-lDTsQp7h.js +0 -188
  144. package/dist/index-rq5Y9ZDy.cjs +0 -1
  145. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  146. package/dist/label-KaP7MRrs.js +0 -10
  147. package/dist/label-tFm8HZdb.cjs +0 -1
  148. package/dist/link-WbcKdQ9k.cjs +0 -1
  149. package/dist/link-xuhP-4dN.js +0 -196
  150. package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
  151. package/dist/popover-a84pbVhQ.js +0 -23
  152. package/dist/popover-fKjgcRUx.cjs +0 -1
  153. package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
  154. package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
  155. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  156. package/dist/scroll-area-ewXbxc3n.js +0 -30
  157. package/dist/select-7bjg-rr9.cjs +0 -1
  158. package/dist/select-POGdEDHT.js +0 -75
  159. package/dist/separator-3Civ-6hb.cjs +0 -1
  160. package/dist/separator-SctTn0Qi.js +0 -18
  161. package/dist/single-page-detail-beY0MT1b.cjs +0 -1
  162. package/dist/skeleton-STeL9VrJ.cjs +0 -1
  163. package/dist/skeleton-lu8e7q2y.js +0 -239
  164. package/dist/tabs-_4WbA1cc.cjs +0 -1
  165. package/dist/tabs-yQ3oGziM.js +0 -106
  166. package/dist/textarea-1kZEh7ki.cjs +0 -1
  167. package/dist/textarea-b2QvVhrK.js +0 -73
  168. package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
  169. package/dist/useAddBlock-FEKFJNwQ.js +0 -69
  170. package/dist/useChaiExternalData-fkFgoS80.js +0 -6
  171. package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
  172. package/dist/useDarkMode-7i57segK.cjs +0 -1
  173. package/dist/useDarkMode-8VHJlYyE.js +0 -23
  174. package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
  175. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
  176. package/dist/useStylingState-Iuj84yvc.js +0 -186
  177. package/dist/useStylingState-OIvJMV6p.cjs +0 -1
  178. package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
  179. package/dist/useUiLibraries-psyWFbNc.js +0 -12
  180. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
  181. package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
  182. package/dist/utils-dze1SGvB.js +0 -6
  183. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash-es"),l=o.noop;exports.loadEmailBlocks=l;
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-KK2oLIa8.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.s({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.s({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.s({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,y=({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:y,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const E=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:r}),f=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});s.registerChaiBlock(E,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:f,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:"Email/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.s({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,5 +1,294 @@
1
- import { noop as o } from "lodash-es";
2
- const m = o;
1
+ import { noop as k } from "lodash-es";
2
+ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
3
+ import { Container as f, 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
+ import { E as m } from "./empty-slot-ZBlsQi6m.js";
6
+ import { s as d, S as a, u as s, g as u, q as g, o as _, r as A } from "./controls-OfJWSEqC.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
+ import "./_commonjsHelpers-UyOWmZb0.js";
9
+ import "react";
10
+ import "./Functions-7jnEwJyw.js";
11
+ import "clsx";
12
+ import "tailwind-merge";
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(f, { ...e, ...t, children: n });
16
+ };
17
+ r(M, {
18
+ type: "Email/Container",
19
+ label: "Container",
20
+ group: "basic",
21
+ category: "core",
22
+ canAcceptBlock: () => !0,
23
+ canMove: () => !0,
24
+ canDelete: () => !1,
25
+ canDuplicate: () => !1,
26
+ canBeNested: (e) => !e
27
+ });
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
+ label: "Section",
32
+ group: "basic",
33
+ category: "core",
34
+ icon: p,
35
+ props: {
36
+ align: d({
37
+ title: "Align",
38
+ default: "",
39
+ options: [
40
+ { value: "", title: "None" },
41
+ { value: "left", title: "left" },
42
+ { value: "center", title: "center" },
43
+ { value: "right", title: "right" }
44
+ ]
45
+ })
46
+ },
47
+ canAcceptBlock: () => !0
48
+ });
49
+ const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
50
+ r($, {
51
+ type: "Email/Row",
52
+ label: "Row",
53
+ group: "basic",
54
+ category: "core",
55
+ icon: p,
56
+ blocks: [
57
+ { _type: "Email/Row", _id: "a" },
58
+ { _type: "Email/Column", _id: "b", _parent: "a" }
59
+ ],
60
+ props: {
61
+ styles: a({ default: "" })
62
+ },
63
+ canAcceptBlock: (e) => e === "Email/Column"
64
+ });
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
+ };
69
+ r(q, {
70
+ type: "Email/Column",
71
+ label: "Column",
72
+ group: "basic",
73
+ category: "core",
74
+ icon: p,
75
+ props: {
76
+ styles: a({ default: "" }),
77
+ align: d({
78
+ title: "Align",
79
+ default: "",
80
+ options: [
81
+ { value: "", title: "None" },
82
+ { value: "left", title: "left" },
83
+ { value: "center", title: "center" },
84
+ { value: "right", title: "right" }
85
+ ]
86
+ })
87
+ },
88
+ canAcceptBlock: () => !0,
89
+ canBeNested: (e) => e === "Email/Row"
90
+ });
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
+ label: "Heading",
95
+ group: "basic",
96
+ category: "core",
97
+ icon: S,
98
+ builderComponent: J,
99
+ props: {
100
+ content: s({ title: "Content", default: "Enter your heading here..." }),
101
+ styles: a({ default: "text-xl" }),
102
+ level: d({
103
+ title: "Level",
104
+ default: "h1",
105
+ binding: !1,
106
+ options: [
107
+ { value: "h1", title: "h1" },
108
+ { value: "h2", title: "h2" },
109
+ { value: "h3", title: "h3" },
110
+ { value: "h4", title: "h4" },
111
+ { value: "h5", title: "h5" },
112
+ { value: "h6", title: "h6" }
113
+ ]
114
+ })
115
+ },
116
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
117
+ });
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
+ label: "Text",
122
+ group: "basic",
123
+ category: "core",
124
+ icon: h,
125
+ builderComponent: V,
126
+ props: {
127
+ content: u({
128
+ title: "Content",
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
+ }),
131
+ styles: a({ default: "" })
132
+ },
133
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
134
+ });
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
+ label: "Raw Text",
139
+ group: "basic",
140
+ category: "core",
141
+ icon: h,
142
+ hidden: !0,
143
+ builderComponent: F,
144
+ props: {
145
+ content: u({
146
+ title: "Content",
147
+ default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
148
+ })
149
+ }
150
+ });
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
+ label: "Button",
155
+ group: "basic",
156
+ category: "core",
157
+ builderComponent: K,
158
+ props: {
159
+ content: s({ title: "Content", default: "Click me" }),
160
+ link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
+ styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
+ }
163
+ });
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
+ };
168
+ r(O, {
169
+ type: "Email/Link",
170
+ label: "Link",
171
+ group: "basic",
172
+ category: "core",
173
+ icon: P,
174
+ blocks: [
175
+ {
176
+ _id: "a",
177
+ _type: "Link"
178
+ },
179
+ {
180
+ _id: "b",
181
+ _parent: "a",
182
+ _type: "RawText",
183
+ content: "I am a link."
184
+ }
185
+ ],
186
+ builderComponent: Q,
187
+ props: {
188
+ content: s({ title: "Content", default: "I am a link." }),
189
+ link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
+ styles: a({ default: "font-bold text-blue-500" })
191
+ },
192
+ canAcceptBlock: () => !0
193
+ });
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
+ label: "Preview",
198
+ group: "basic",
199
+ category: "core",
200
+ builderComponent: Y,
201
+ canAcceptBlock: () => !0,
202
+ canDuplicate: () => !1,
203
+ props: {
204
+ content: u({ default: "Preview content", title: "Content" })
205
+ }
206
+ });
207
+ const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
208
+ r(Z, {
209
+ type: "Email/Markdown",
210
+ label: "Markdown",
211
+ group: "basic",
212
+ category: "core",
213
+ props: {
214
+ content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
+ }
216
+ });
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
+ label: "Image",
221
+ group: "basic",
222
+ category: "core",
223
+ icon: p,
224
+ builderComponent: te,
225
+ props: {
226
+ styles: a({ default: "w-full" }),
227
+ image: _({
228
+ title: "Image",
229
+ default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
+ }),
231
+ alt: s({ title: "Alt", default: "" }),
232
+ width: s({ title: "Width", default: "" }),
233
+ height: s({ title: "Height", default: "" })
234
+ }
235
+ });
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
+ label: "Divider",
240
+ group: "basic",
241
+ category: "core",
242
+ icon: D,
243
+ builderComponent: oe,
244
+ props: {
245
+ styles: a({ default: "w-full h-2" })
246
+ }
247
+ });
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
+ label: "Code Block",
252
+ group: "basic",
253
+ category: "core",
254
+ hidden: !0,
255
+ icon: b,
256
+ builderComponent: ne,
257
+ props: {
258
+ styles: a({ default: "" }),
259
+ code: u({ title: "Code", default: "console.log('Hello, world!');" }),
260
+ theme: s({ title: "Theme", default: "dracula" }),
261
+ lineNumbers: A({
262
+ title: "Line number",
263
+ default: !1
264
+ }),
265
+ language: d({
266
+ title: "Language",
267
+ default: "javascript",
268
+ binding: !1,
269
+ options: [
270
+ { value: "javascript", title: "JavaScript" },
271
+ { value: "html", title: "HTML" },
272
+ { value: "css", title: "CSS" }
273
+ //add more options
274
+ ]
275
+ })
276
+ }
277
+ });
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
+ label: "Code Inline",
282
+ group: "basic",
283
+ category: "core",
284
+ icon: b,
285
+ builderComponent: ae,
286
+ props: {
287
+ styles: a({ default: "" }),
288
+ code: u({ title: "Code", default: "console.log('Hello, world!');" })
289
+ }
290
+ });
291
+ const xe = k;
3
292
  export {
4
- m as loadEmailBlocks
293
+ xe as loadEmailBlocks
5
294
  };
package/dist/email.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("./ChaiBuilderEditor-m30yoOgJ.cjs"),r=require("@radix-ui/react-icons"),n=require("lodash-es");require("react");require("./MODIFIERS-o1p3VnpS.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./skeleton-STeL9VrJ.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./Functions-Hvon6AMZ.cjs");require("react-hotkeys-hook");require("@react-hookz/web");require("@chaibuilder/runtime");const s=[{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}],l=i=>{const t={...i,filterChaiBlock:u=>n.includes(u.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:s};return e.jsxRuntimeExports.jsx(o.ChaiBuilderEditor,{...t})};exports.ChaiBuilderEmail=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-l19JVVXI.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-F4AQQ6qq.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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("flagged");require("react-hotkeys-hook");const n=[{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}],s=i=>{const u={...i,filterChaiBlock:t=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
package/dist/email.js CHANGED
@@ -1,28 +1,46 @@
1
- import { j as i } from "./jsx-runtime-Sp0orL4X.js";
2
- import { C as p } from "./ChaiBuilderEditor-vP4at00I.js";
1
+ import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { C as p } from "./index-lOJfSheQ.js";
3
3
  import { MobileIcon as t } from "@radix-ui/react-icons";
4
4
  import { includes as e } from "lodash-es";
5
+ import "./_commonjsHelpers-UyOWmZb0.js";
5
6
  import "react";
6
- import "./MODIFIERS-CNqNUapY.js";
7
- import "clsx";
8
- import "@radix-ui/react-scroll-area";
9
- import "react-dom";
10
- import "@floating-ui/react-dom";
11
- import "jotai";
12
7
  import "i18next";
13
8
  import "react-i18next";
14
- import "flagged";
15
- import "./skeleton-lu8e7q2y.js";
16
- import "@radix-ui/react-slot";
17
- import "class-variance-authority";
18
- import "./utils-dze1SGvB.js";
9
+ import "./index-CFUoB97-.js";
10
+ import "./Functions-7jnEwJyw.js";
11
+ import "clsx";
19
12
  import "tailwind-merge";
13
+ import "@chaibuilder/runtime";
14
+ import "jotai";
15
+ import "./MODIFIERS-WQdaNvb8.js";
16
+ import "@react-hookz/web";
17
+ import "./Class-3k8xjeiM.js";
18
+ import "@radix-ui/react-toggle";
19
+ import "class-variance-authority";
20
+ import "@radix-ui/react-switch";
21
+ import "@radix-ui/react-slot";
22
+ import "@radix-ui/react-accordion";
23
+ import "@radix-ui/react-alert-dialog";
24
+ import "@radix-ui/react-dialog";
25
+ import "@radix-ui/react-label";
26
+ import "@radix-ui/react-scroll-area";
27
+ import "@radix-ui/react-tabs";
20
28
  import "@radix-ui/react-tooltip";
29
+ import "@radix-ui/react-popover";
30
+ import "@radix-ui/react-menubar";
31
+ import "@radix-ui/react-hover-card";
32
+ import "@radix-ui/react-select";
33
+ import "@radix-ui/react-dropdown-menu";
34
+ import "@radix-ui/react-separator";
21
35
  import "@radix-ui/react-toast";
22
- import "./Functions-NzT2Six_.js";
36
+ import "cmdk";
37
+ import "@radix-ui/react-context-menu";
38
+ import "react-icons-picker";
39
+ import "react-dom";
40
+ import "react-quill";
41
+ import "@floating-ui/react-dom";
42
+ import "flagged";
23
43
  import "react-hotkeys-hook";
24
- import "@react-hookz/web";
25
- import "@chaibuilder/runtime";
26
44
  const n = [
27
45
  {
28
46
  title: "Mobile",
@@ -38,7 +56,7 @@ const n = [
38
56
  icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
39
57
  width: 700
40
58
  }
41
- ], A = (o) => {
59
+ ], Z = (o) => {
42
60
  const r = {
43
61
  ...o,
44
62
  filterChaiBlock: (m) => e(m.type, "Email/"),
@@ -49,5 +67,5 @@ const n = [
49
67
  return /* @__PURE__ */ i.jsx(p, { ...r });
50
68
  };
51
69
  export {
52
- A as ChaiBuilderEmail
70
+ Z as ChaiBuilderEmail
53
71
  };
@@ -0,0 +1,15 @@
1
+ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { omit as r } from "lodash-es";
3
+ import { c as o } from "./Functions-7jnEwJyw.js";
4
+ const c = ({ blockProps: t, className: s = "", styles: l = {}, inBuilder: i }) => i ? /* @__PURE__ */ e.jsx(
5
+ "div",
6
+ {
7
+ ...t,
8
+ className: o("flex h-20 flex-col items-center justify-center", s),
9
+ ...r(l, ["className"]),
10
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300", children: /* @__PURE__ */ e.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
11
+ }
12
+ ) : null;
13
+ export {
14
+ c as E
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./jsx-runtime-Z_BpKhVy.cjs"),l=require("lodash-es"),r=require("./Functions-N3yhPYKY.cjs"),o=({blockProps:t,className:s="",styles:n={},inBuilder:i})=>i?e.jsxRuntimeExports.jsx("div",{...t,className:r.cn("flex h-20 flex-col items-center justify-center",s),...l.omit(n,["className"]),children:e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300",children:e.jsxRuntimeExports.jsx("span",{className:"opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400"})})}):null;exports.EmptySlot=o;
@@ -0,0 +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-F4AQQ6qq.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,8 +1,8 @@
1
- import { j as u } from "./jsx-runtime-Sp0orL4X.js";
2
- import x from "@rjsf/core";
3
- import $ from "@rjsf/validator-ajv8";
4
- import { includes as h, get as a, set as F, first as P } from "lodash-es";
5
- import { R as b, I as E, a as O, L as S } from "./link-xuhP-4dN.js";
1
+ import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
+ import b from "@rjsf/core";
3
+ import x from "@rjsf/validator-ajv8";
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-CFUoB97-.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -61,12 +61,12 @@ const d = (i, l = "") => {
61
61
  if (h(["slot", "styles"], t.type))
62
62
  return;
63
63
  const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
64
- e.items.properties[s] = y(t, l), F(e.items, "title", a(t, "itemTitle", `${r} item`));
64
+ e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
65
65
  }), e;
66
66
  default:
67
67
  return {};
68
68
  }
69
- }, g = ({
69
+ }, C = ({
70
70
  title: i,
71
71
  properties: l = {},
72
72
  formData: c,
@@ -89,16 +89,16 @@ const d = (i, l = "") => {
89
89
  const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
90
90
  if (!s || !f)
91
91
  return;
92
- const j = P(f.split("."));
92
+ const j = F(f.split("."));
93
93
  s && j && m({ ...t }, j);
94
94
  };
95
95
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
96
96
  i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
97
97
  /* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
98
- x,
98
+ b,
99
99
  {
100
100
  widgets: {
101
- richtext: b,
101
+ richtext: P,
102
102
  icon: E,
103
103
  image: O
104
104
  },
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
113
113
  uiSchema: e,
114
114
  schema: r,
115
115
  formData: c,
116
- validator: $,
116
+ validator: x,
117
117
  onChange: o,
118
118
  disabled: n
119
119
  }
@@ -121,5 +121,5 @@ const d = (i, l = "") => {
121
121
  ] });
122
122
  };
123
123
  export {
124
- g as F
124
+ C as F
125
125
  };
@@ -0,0 +1 @@
1
+ "use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),r=require("lodash-es"),l=require("./MODIFIERS-9EwxLM8V.cjs"),T=t=>{const e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,s=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return e.test(t)||s.test(t)},v=t=>{if(r.isEmpty(t))return t;const e=/<video[^>]+src=['"]([^'">]+)['"]/,s=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(e),o=t.match(s),i=a?a[1]:o?o[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(c.test(i)||n.test(i))?i:t},w={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},x=(t,e)=>t.children.length===1&&r.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],e._type),h=t=>t.map(e=>e.type==="text"?r.get(e,"content",""):r.isEmpty(e.children)?"":h(e.children)).join(""),g=t=>t===null?!0:t,y=t=>{if(t.tagName==="svg")return{};const e={},s=w[t.tagName]||{},a=t.attributes;return r.forEach(a,({key:o,value:i})=>{if(s[o]){if(t.tagName==="img"&&o==="src"&&!i.startsWith("http")){const c=r.find(t.attributes,{key:"width"}),n=r.find(t.attributes,{key:"height"});c&&n?i=`https://via.placeholder.com/${c==null?void 0:c.value}x${n==null?void 0:n.value}`:i="https://via.placeholder.com/150x150"}r.set(e,s[o],g(i))}else r.includes(["style","class","srcset"],o)||r.set(e,`styles_attrs.${o}`,g(i))}),delete e.class,e},S=(t,e="styles")=>{if(!t.attributes)return{[e]:`${l.STYLES_KEY},`};const s=r.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[e]:`${l.STYLES_KEY},${a}`}}return{[e]:`${l.STYLES_KEY},`}},N=t=>{const e={"hs-collapse-toggle":"CollapseToggle","hs-collapse":"Collapse","hs-accordion-group":"AccordionGroup","hs-accordion":"Accordion","hs-accordion-toggle":"AccordionToggle","hs-accordion-content":"AccordionContent","hs-dropdown":"Dropdown","hs-dropdown-toggle":"DropdownToggle","hs-dropdown-menu":"DropdownMenu","hs-overlay":"Overlay","hs-tooltip":"Tooltip","hs-tooltip-toggle":"TooltipToggle","hs-tooltip-content":"TooltipContent"},s=r.find(t.attributes,{key:"class"});if(s){const a=s.value.split(" ");for(const o of a)if(e[o])return e[o]}},L=t=>{const e=N(t);if(e)return{_type:e};switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,_name:t.tagName==="div"?"Box":r.capitalize(t.tagName)}}},d=(t,e=null)=>r.flatMapDeep(t,s=>{var i;if(s.type==="comment")return[];let a={_id:p.generateUUID()};if(e&&(a._parent=e.block._id),s.type==="text")return r.isEmpty(r.get(s,"content",""))?[]:e&&x(e.node,e.block)?(r.set(e,"block.content",r.get(s,"content","")),[]):{...a,_type:"Text",content:r.get(s,"content","")};if(a={...a,...L(s),...y(s),...S(s)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?r.set(a,"_type","Checkbox"):c==="radio"&&r.set(a,"_type","Radio")}else if(s.tagName==="video"||s.tagName==="iframe"){const c=u.stringify([s]);return T(c)&&(r.set(a,"_type","Video"),r.set(a,"url",v(c)),r.set(a,"styles",`${l.STYLES_KEY},absolute top-0 left-0 w-full h-full`),r.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(s.tagName==="svg"){const c=r.find(s.attributes,{key:"height"}),n=r.find(s.attributes,{key:"width"}),m=r.get(c,"value")?`[${r.get(c,"value")}px]`:"24px",f=r.get(n,"value")?`[${r.get(n,"value")}px]`:"24px",b=r.get(r.find(s.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${l.STYLES_KEY}, ${p.cn(`w-${f} h-${m}`,b)}`.trim(),s.attributes=r.filter(s.attributes,_=>!r.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([s]),[a]}else if(s.tagName=="option"&&e&&((i=e.block)==null?void 0:i._type)==="Select")return e.block.options.push({label:h(s.children),...y(s)}),[];const o=d(s.children,{block:a,node:s});return[a,...o]}),k=t=>{const e=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(e&&e.length>0?e[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},E=t=>{const e=u.parse(k(t));return r.isEmpty(t)?[]:r.flatten(d(e))};exports.getBlocksFromHTML=E;