@chaibuilder/sdk 1.2.26 → 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.
- package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
- package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-ksZjjn0k.js} +6 -7
- package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
- package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions-T_kbQFQv.js} +5 -6
- package/dist/{CanvasArea-zme1r3Zi.cjs → CanvasArea-SDzbubar.cjs} +2 -2
- package/dist/{CanvasArea-h0W-Tyha.js → CanvasArea-rhOeubmu.js} +7 -8
- package/dist/{Class-lGzsNBOK.js → Class-3k8xjeiM.js} +1 -1
- package/dist/{Class-PoYusiA5.cjs → Class-MmCxz2Ay.cjs} +1 -1
- package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-0eeU1V_c.js} +8 -9
- package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
- package/dist/{ListTree-cZ-Ihlt3.js → ListTree-Muu4rAtp.js} +8 -9
- package/dist/ListTree-SWsqdfcG.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-WQdaNvb8.js} +8 -4
- package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
- package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-rYN28QpN.js} +8 -9
- package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-ivFOhdcz.js} +13 -14
- package/dist/ProjectPanel-pBePMOta.cjs +1 -0
- package/dist/Settings-JRyJayf5.cjs +1 -0
- package/dist/{Settings-4s2LUVmC.js → Settings-XWmKzRl9.js} +6 -7
- package/dist/SidePanels-BtUeo6M9.cjs +1 -0
- package/dist/{SidePanels-bugFfInz.js → SidePanels-ODktnGbC.js} +16 -17
- package/dist/Topbar-QMeD3hvq.cjs +1 -0
- package/dist/{Topbar-pWzBEOed.js → Topbar-Yunooh00.js} +5 -6
- package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
- package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-QMl0bxix.js} +15 -16
- package/dist/UploadImages-OgSN1HVt.cjs +1 -0
- package/dist/{UploadImages-9NapgXBq.js → UploadImages-Si-A26bc.js} +10 -11
- package/dist/add-page-modal-9pTKItY-.cjs +1 -0
- package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-U7AUUrI1.js} +24 -25
- package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
- package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-kV5-c70T.js} +5 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +46 -47
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-gunU_Fe5.js} +1 -1
- package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
- package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal-UCBpdjLe.js} +8 -9
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +6 -7
- package/dist/{form-lBQ_76Uw.cjs → form-Ap63cNec.cjs} +1 -1
- package/dist/{form-STUz-6nE.js → form-zmlTjM9j.js} +1 -1
- package/dist/html-to-json-C_Eobs_d.cjs +1 -0
- package/dist/{html-to-json-ngX9ef2u.js → html-to-json-p__Fgqdg.js} +75 -50
- package/dist/{index-Gk6sASBd.js → index-CFUoB97-.js} +128 -129
- package/dist/index-F4AQQ6qq.cjs +1 -0
- package/dist/{index-mbyqq81O.cjs → index-Qk028f-N.cjs} +1 -1
- package/dist/{index-llTXLDGE.js → index-f0AbmoYY.js} +4 -4
- package/dist/{index-OB199Izc.cjs → index-l19JVVXI.cjs} +2 -2
- package/dist/{index-SkyM3d6Q.js → index-lOJfSheQ.js} +2 -2
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +16 -17
- package/dist/page-viewer-YFrIG3L7.cjs +1 -0
- package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-jOwy--9A.js} +9 -10
- package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-3N8HZ2fe.js} +9 -10
- package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
- package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-bSiNgO_1.js} +6 -7
- package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +13 -14
- package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail--AZlZ-pC.js} +10 -11
- package/dist/single-page-detail-9abF2g2R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +7 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +137 -138
- package/dist/web-blocks.cjs +1 -6
- package/dist/web-blocks.js +385 -486
- package/package.json +1 -1
- package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
- package/dist/BrandingOptions-DkpqGARR.cjs +0 -1
- package/dist/CurrentPage-Hl52iub_.cjs +0 -1
- package/dist/ListTree-WvTjY5rr.cjs +0 -1
- package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
- package/dist/PagesPanel-WzCocl6u.cjs +0 -1
- package/dist/ProjectPanel-o7gdcwPn.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-AqoKwR92.cjs +0 -1
- package/dist/SidePanels-3o6Okmvu.cjs +0 -1
- package/dist/Topbar-CqW7G360.cjs +0 -1
- package/dist/UnsplashImages-NGskB93R.cjs +0 -1
- package/dist/UploadImages-Oh7Glr9A.cjs +0 -1
- package/dist/add-page-modal--6TTBRYa.cjs +0 -1
- package/dist/confirm-alert-C4M9eF-o.cjs +0 -1
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
- package/dist/delete-page-modal-cFoL-wdo.cjs +0 -1
- package/dist/html-to-json-efmv1pCj.cjs +0 -1
- package/dist/index-h-hd6EvN.cjs +0 -1
- package/dist/page-viewer-2kwnKM6v.cjs +0 -1
- package/dist/project-general-setting-CnNL98NM.cjs +0 -1
- package/dist/project-seo-setting-mlxL_e2_.cjs +0 -1
- package/dist/single-page-detail-XfzrGlzA.cjs +0 -1
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),l=require("./controls-KK2oLIa8.cjs"),u=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),S=require("./STRINGS-gPz7CUOk.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const d=R(w),T=d.memo(e=>{const{blockProps:t,inBuilder:o,backgroundImage:r,children:s,tag:n="div",styles:i}=e;let c=s;s||(c=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:o}));let p={};return r&&(p={backgroundImage:`url(${r})`}),d.createElement(n,{...t,...i,style:p},c)});u.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:l.S({default:""}),tag:l.s({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0});const _=e=>{const{blockProps:t,styles:o,content:r,level:s="h1",children:n=null}=e;return n?d.createElement(s,{...o,...t},n):d.createElement(s,{...o,...t,dangerouslySetInnerHTML:{__html:r}})};u.registerChaiBlock(_,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{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"}]}),styles:l.S({default:"text-3xl"}),content:l.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const L=e=>{const{blockProps:t,styles:o,content:r}=e;return y.isNull(e.children)?d.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}}):d.createElement("p",{...o,...t},e.children)};u.registerChaiBlock(L,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const C=e=>{const{blockProps:t,styles:o,content:r,children:s=null,tag:n}=e;return s?d.createElement("span",{...o,...t},s):d.createElement(n||"span",{...o,...t,dangerouslySetInnerHTML:{__html:r}})};u.registerChaiBlock(C,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const P=e=>{const{blockProps:t,content:o,styles:r}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...r,dangerouslySetInnerHTML:{__html:o}})})};u.registerChaiBlock(P,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:o,icon:r,content:s,iconPos:n,styles:i,children:c}=e,p=r,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:s}),p&&a.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return d.createElement("button",{...t,...i,type:"button"},m)};u.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:l.u({title:"Label",default:"Button",multiLingual:!0}),styles:l.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:l.T({title:"Icon",default:""}),iconSize:l.c({title:"Icon Size",default:24}),iconPos:l.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:o,children:r,styles:s,inBuilder:n,content:i}=e;return!r&&y.isEmpty(s==null?void 0:s.className)&&y.isEmpty(i)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:n}):n?r?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...s,children:r}):d.createElement("span",{...t,...s,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):r?a.jsxRuntimeExports.jsx("a",{href:o.href||"#/",target:o.target,...t,...s,children:r}):d.createElement("a",{...t,...s,href:o.href||"#",target:o.target||"_self",dangerouslySetInnerHTML:{__html:i}})};u.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:l.S({default:""}),content:l.u({title:"Content",default:""}),link:l.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,children:o,listType:r,styles:s,tag:n,inBuilder:i}=e,c=f.cn(y.get(s,"className",""),r);return!o&&y.isEmpty(s==null?void 0:s.className)?a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):d.createElement(n||(r==="list-decimal"?"ol":"ul"),{...t,...s,className:c},o)};u.registerChaiBlock(A,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),listType:l.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const H=e=>{const{blockProps:t,content:o,styles:r,children:s,tag:n}=e;return s?d.createElement(n||"li",{...r,...t},s):d.createElement(n||"li",{...r,...t,dangerouslySetInnerHTML:{__html:o}})};u.registerChaiBlock(H,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const v=(e,t)=>({...e,className:`${e.className} ${t}`}),D=e=>{const{blockProps:t,icon:o,styles:r,width:s,inBuilder:n,height:i}=e,c=v(r,f.cn("inline-block",s?`w-[${s}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(o))return a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:n,className:"h-8 w-14"});const p=o.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return d.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};u.registerChaiBlock(D,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:l.S({default:"text-black"}),icon:l.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:l.c({title:"Width",default:""}),height:l.c({title:"Height",default:""})}});const U=e=>{const{blockProps:t,image:o,styles:r,alt:s,height:n,width:i}=e;return y.isEmpty(o)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):d.createElement("img",{...t,...r,src:o,alt:s,height:n,width:i})};u.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:l.S({default:""}),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=e=>{var i;const{blockProps:t,inBuilder:o,styles:r,children:s}=e;let n=null;return!s&&o&&(n=a.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),d.createElement("div",{...r,...t,droppable:"yes"},s||n)};u.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:l.S({default:""}),emptyStyles:l.S({default:""})},canAcceptBlock:()=>!0});const B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,F=e=>{if(B.test(e)){const t=e.match(B);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(j.test(e)){const t=e.match(j);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},$=d.memo(e=>{const{blockProps:t,inBuilder:o,styles:r,url:s,controls:n}=e,i=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),p=i||y.get(n,"muted",!0),m=y.get(n,"loop",!1);if(y.isEmpty(s))return a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:o,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=F(s),g=null;if(x){if(!y.isEmpty(x)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${n?1:0}`),k.push(`mute=${p?1:0}&muted=${p?1:0}`),k.push(`loop=${m?1:0}`),x=`${x}?${k.join("&")}`}g=d.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=d.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:s,controls:c,muted:p,autoPlay:o?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...y.pick(r,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?a.jsxRuntimeExports.jsx("div",{...t,...y.omit(r,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});u.registerChaiBlock($,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:l.S({default:""}),url:l.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:l.b({title:"Controls",properties:{autoPlay:l.r({title:"Autoplay",default:!0}),controls:l.r({title:"Show controls",default:!1}),loop:l.r({title:"Loop",default:!1}),muted:l.r({title:"Muted",default:!0})}})}});const z=d.memo(e=>{const{blockProps:t,styles:o,content:r,inBuilder:s}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s?a.jsxRuntimeExports.jsx("div",{...t,...o,className:"absolute z-20 h-full w-full"}):null,d.createElement("div",{...o,dangerouslySetInnerHTML:{__html:r}})]})});u.registerChaiBlock(z,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:l.S({default:""}),content:l.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const O=e=>{const{blockProps:t,styles:o}=e;return d.createElement("hr",{...o,...t})};u.registerChaiBlock(O,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:l.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const V=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"flex",...e.blockProps,children:e.content}):`${e.content}`;u.registerChaiBlock(V,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:l.g({title:"Content",defaultValue:""})}});const Y=({children:e,blockProps:t,styles:o})=>{const r=v(o,"hs-accordion");return a.jsxRuntimeExports.jsx("div",{...t,...r,children:e})};u.registerChaiBlock(Y,{type:"Accordion",label:"Accordion",category:"core",group:"advanced",hidden:!0,props:{styles:l.S({default:""})},blocks:()=>{const e="accordion"+f.generateUUID();return[{_id:"a",_type:"Accordion",_name:"Accordion"},{_id:"b",_type:"AccordionTrigger",_parent:"a",_name:"Accordion Trigger",styles_attrs:{"aria-controls":e}},{_id:"b1",_type:"Icon",_parent:"b",styles:`${S.STYLES_KEY},hs-accordion-active:hidden hs-accordion-active:text-blue-600 hs-accordion-active:group-hover:text-blue-600 block size-4 text-gray-600 group-hover:text-gray-500 dark:text-neutral-400`,icon:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
-
<path d="M5 12h14"></path>
|
|
3
|
-
<path d="M12 5v14"></path>
|
|
4
|
-
</svg>`},{_id:"b2",_type:"Icon",_parent:"b",styles:`${S.STYLES_KEY},hs-accordion-active:block hs-accordion-active:text-blue-600 hs-accordion-active:group-hover:text-blue-600 hidden size-4 text-gray-600 group-hover:text-gray-500 dark:text-neutral-400`,icon:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
-
<path d="M5 12h14"></path>
|
|
6
|
-
</svg>`},{_id:"b1",_type:"Text",_parent:"b",content:"Accordion Title"},{_id:"c",_type:"AccordionContent",_parent:"a",_name:"Accordion Content",styles:`${S.STYLES_KEY},w-full overflow-hidden transition-[height] duration-300 px-6 py-3`,styles_attrs:{"aria-labelledby":e}},{_id:"c1",_type:"Text",_parent:"c",content:"It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element."}]}});const G=({children:e,blockProps:t,styles:o})=>{const r=v(o,"hs-accordion-toggle");return a.jsxRuntimeExports.jsx("button",{...r,...t,children:e})};u.registerChaiBlock(G,{type:"AccordionTrigger",label:"Accordion Trigger",category:"core",group:"advanced",hidden:!0,props:{styles:l.S({default:"hs-accordion-active:text-blue-600 dark:hs-accordion-active:text-blue-500 inline-flex w-full items-center gap-x-3 rounded-lg px-6 py-3 text-start text-sm font-semibold text-gray-800 hover:text-gray-500 disabled:pointer-events-none disabled:opacity-50 dark:text-neutral-200 dark:hover:text-neutral-400"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const W=({children:e,blockProps:t,styles:o})=>{const r=v(o,"hs-accordion-content");return a.jsxRuntimeExports.jsx("div",{...r,...t,children:e})};u.registerChaiBlock(W,{type:"AccordionContent",label:"Accordion Content",category:"core",group:"advanced",hidden:!0,props:{styles:l.S({default:"w-full overflow-hidden transition-[height] duration-300"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const K=e=>{const{blockProps:t,backgroundImage:o,children:r,styles:s}=e;let n={};return o&&(n={backgroundImage:`url(${o})`}),d.createElement("div",{...t,...s,style:n},r)};u.registerChaiBlock(K,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:l.S({default:"font-body antialiased"}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const X=e=>{const{blockProps:t,styles:o}=e;return d.createElement("br",{...t,...o})};u.registerChaiBlock(X,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:l.S({default:""})}});const E=e=>{const t=(n,i)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),o=n=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,t(i,"1"),t(i,"2"),t(i,"3")]},r=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...o(i)]},s=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...o(i),...o(i)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(n),...s(n)]}return e==="TableRow"?o():e==="TableHead"?r():e==="TableBody"?s():[]},Z=e=>{const{blockProps:t,children:o,styles:r}=e;return o?d.createElement("table",{...t,...r},o):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};u.registerChaiBlock(Z,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:l.S({default:""})},blocks:E("Table")});const J=e=>{const{blockProps:t,children:o,styles:r}=e;return o?d.createElement("thead",{...t,...r},o):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};u.registerChaiBlock(J,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:l.S({default:""})},blocks:E("TableHead")});const Q=e=>{const{blockProps:t,children:o,styles:r}=e;return o?d.createElement("tbody",{...t,...r},o):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};u.registerChaiBlock(Q,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:l.S({default:""})},blocks:E("TableBody")});const ee=e=>{const{blockProps:t,children:o,styles:r}=e;return o?d.createElement("tr",{...t,...r},o):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};u.registerChaiBlock(ee,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:l.S({default:"w-full"})},blocks:E("TableRow")});const te=e=>{const{blockProps:t,children:o,content:r,styles:s}=e;return!o&&y.isEmpty(r)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):o?d.createElement("td",{...t,...s},o):d.createElement("td",{...t,...s,dangerouslySetInnerHTML:{__html:r}})};u.registerChaiBlock(te,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"Table cell item"})}});const le=e=>{const{blockProps:t,errorMessage:o,name:r,_type:s,successMessage:n,action:i,styles:c,children:p}=e;let m=p;p||(m=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...x,"data-error":o,"data-success":n,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...g}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:r||s}),m]})};u.registerChaiBlock(le,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),action:l.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:l.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:l.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const oe=e=>{const{blockProps:t,content:o,styles:r,children:s}=e,n={...r,...t};return s?d.createElement("label",n,s):d.createElement("label",{...n,dangerouslySetInnerHTML:{__html:o}})};u.registerChaiBlock(oe,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),content:l.u({title:"Content",default:"Label"})}});const re=e=>{const{blockProps:t,inBuilder:o,label:r,placeholder:s,styles:n,inputStyles:i,icon:c,iconPos:p}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...n,...t||{},type:o?"button":"submit",placeholder:s,children:[r,c&&a.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};u.registerChaiBlock(re,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:l.u({title:"Label",default:"Submit"}),styles:l.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:l.T({title:"Icon",default:""}),iconPos:l.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const se=e=>{const{blockProps:t,fieldName:o,label:r,styles:s,inputStyles:n,required:i,checked:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...s,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"checkbox",required:i,defaultChecked:c}),r&&r!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...s,type:"checkbox",required:i,name:o})};u.registerChaiBlock(se,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"checkbox"}),styles:l.S({default:"flex items-center gap-x-2"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const ne=e=>{const{blockProps:t,label:o,placeholder:r,styles:s,inputStyles:n,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||p==="submit"?(p==="submit"&&(t.value=o),a.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...n,...s,type:p,placeholder:r,required:c})):a.jsxRuntimeExports.jsxs("div",{...s,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:g,children:o}),a.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...n,id:g,type:p,placeholder:r,required:c})]})};u.registerChaiBlock(ne,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"input"}),inputType:l.s({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:l.u({title:"Value",default:""}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1})}});const ae=e=>{const{blockProps:t,fieldName:o,label:r,styles:s,inputStyles:n,checked:i,required:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...s,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:o,id:m,type:"radio",required:c,defaultChecked:i}),r&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...s,type:"radio",required:c,checked:i,name:o})};u.registerChaiBlock(ae,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:l.S({default:"flex items-center w-max gap-x-2"}),fieldName:l.u({title:"Field Name",default:"radio"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const ie=e=>{const{blockProps:t,fieldName:o,label:r,placeholder:s,styles:n,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,x=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:x,children:r}),a.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:s,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:x,...n,...t,placeholder:s,required:c,multiple:m,name:o,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};u.registerChaiBlock(ie,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"select"}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1}),_multiple:l.r({title:"Multiple Choice",default:!1}),options:l.h({title:"Options",itemProperties:{label:l.u({title:"Label",default:""}),value:l.u({title:"Value",default:""})}})}});const ce=e=>{const{blockProps:t,fieldName:o,label:r,placeholder:s,styles:n,inputStyles:i,_rows:c,showLabel:p}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:r}),a.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:m,placeholder:s,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:o,...t,...i,...n,placeholder:s,rows:c})};u.registerChaiBlock(ce,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"textarea"}),showLabel:l.r({title:"Show label",default:!0}),styles:l.S({default:""}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),_rows:l.c({title:"Rows",default:3})}});const ue=y.noop;exports.loadWebBlocks=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),I=require("react"),l=require("./controls-KK2oLIa8.cjs"),p=require("@chaibuilder/runtime"),g=require("./empty-slot-nzYOgZuS.cjs"),y=require("@radix-ui/react-icons"),x=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const u=v(I),R=u.memo(e=>{const{blockProps:t,inBuilder:o,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:{},styles:{},inBuilder:o}));let d={};return s&&(d={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...i,style:d},c)});p.registerChaiBlock(R,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:l.S({default:""}),tag:l.s({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0});const L=e=>{const{blockProps:t,styles:o,content:s,level:r="h1",children:a=null}=e;return a?u.createElement(r,{...o,...t},a):u.createElement(r,{...o,...t,dangerouslySetInnerHTML:{__html:s}})};p.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:y.HeadingIcon,group:"typography",props:{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"}]}),styles:l.S({default:"text-3xl"}),content:l.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const T=e=>{const{blockProps:t,styles:o,content:s}=e;return h.isNull(e.children)?u.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...o,...t},e.children)};p.registerChaiBlock(T,{type:"Paragraph",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const w=e=>{const{blockProps:t,styles:o,content:s,children:r=null,tag:a}=e;return r?u.createElement("span",{...o,...t},r):u.createElement(a||"span",{...o,...t,dangerouslySetInnerHTML:{__html:s}})};p.registerChaiBlock(w,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const C=e=>{const{blockProps:t,content:o,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{...t,...s,dangerouslySetInnerHTML:{__html:o}})})};p.registerChaiBlock(C,{type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const _=e=>{const{blockProps:t,iconSize:o,icon:s,content:r,iconPos:a,styles:i,children:c}=e,d=s,m=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{children:r}),d&&n.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:d}})]});return u.createElement("button",{...t,...i,type:"button"},m)};p.registerChaiBlock(_,{type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",props:{content:l.u({title:"Label",default:"Button",multiLingual:!0}),styles:l.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:l.T({title:"Icon",default:""}),iconSize:l.c({title:"Icon Size",default:24}),iconPos:l.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const P=e=>{const{blockProps:t,link:o,children:s,styles:r,inBuilder:a,content:i}=e;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i)?n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:o.href||"#/",target:o.target,...t,...r,children:s}):u.createElement("a",{...t,...r,href:o.href||"#",target:o.target||"_self",dangerouslySetInnerHTML:{__html:i}})};p.registerChaiBlock(P,{type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",props:{styles:l.S({default:""}),content:l.u({title:"Content",default:""}),link:l.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:t,children:o,listType:s,styles:r,tag:a,inBuilder:i}=e,c=x.cn(h.get(r,"className",""),s);return!o&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},o)};p.registerChaiBlock(N,{type:"List",label:"List",icon:y.RowsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),listType:l.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const M=e=>{const{blockProps:t,content:o,styles:s,children:r,tag:a}=e;return r?u.createElement(a||"li",{...s,...t},r):u.createElement(a||"li",{...s,...t,dangerouslySetInnerHTML:{__html:o}})};p.registerChaiBlock(M,{type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const H=(e,t)=>({...e,className:`${e.className} ${t}`}),U=e=>{const{blockProps:t,icon:o,styles:s,width:r,inBuilder:a,height:i}=e,c=H(s,x.cn("inline-block",r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(o))return n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"",inBuilder:a,className:"h-8 w-14"});const d=o.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:d}})};p.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:y.SketchLogoIcon,group:"media",props:{styles:l.S({default:"text-black"}),icon:l.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:l.c({title:"Width",default:""}),height:l.c({title:"Height",default:""})}});const D=e=>{const{blockProps:t,image:o,styles:s,alt:r,height:a,width:i}=e;return h.isEmpty(o)?n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:o,alt:r,height:a,width:i})};p.registerChaiBlock(D,{type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",props:{styles:l.S({default:""}),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=e=>{var i;const{blockProps:t,inBuilder:o,styles:s,children:r}=e;let a=null;return!r&&o&&(a=n.jsxRuntimeExports.jsx("div",{className:x.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||a)};p.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:l.S({default:""}),emptyStyles:l.S({default:""})},canAcceptBlock:()=>!0});const B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,S=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,A=e=>{if(B.test(e)){const t=e.match(B);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(j.test(e)){const t=e.match(j);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},F=u.memo(e=>{const{blockProps:t,inBuilder:o,styles:s,url:r,controls:a}=e,i=h.get(a,"autoPlay",!1),c=h.get(a,"controls",!1),d=i||h.get(a,"muted",!0),m=h.get(a,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(g.EmptySlot,{inBuilder:o,blockProps:t,text:"VIDEO URL",className:"h-36"});let b=A(r),f=null;if(b){if(!h.isEmpty(b)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${a?1:0}`),k.push(`mute=${d?1:0}&muted=${d?1:0}`),k.push(`loop=${m?1:0}`),b=`${b}?${k.join("&")}`}f=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:b,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:d,autoPlay:o?!1:i,loop:m});return n.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?n.jsxRuntimeExports.jsx("div",{...t,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})});p.registerChaiBlock(F,{type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",props:{styles:l.S({default:""}),url:l.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:l.b({title:"Controls",properties:{autoPlay:l.r({title:"Autoplay",default:!0}),controls:l.r({title:"Show controls",default:!1}),loop:l.r({title:"Loop",default:!1}),muted:l.r({title:"Muted",default:!0})}})}});const O=u.memo(e=>{const{blockProps:t,styles:o,content:s,inBuilder:r}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...t,...o,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...o,dangerouslySetInnerHTML:{__html:s}})]})});p.registerChaiBlock(O,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:y.CodeIcon,group:"advanced",props:{styles:l.S({default:""}),content:l.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const $=e=>{const{blockProps:t,styles:o}=e;return u.createElement("hr",{...o,...t})};p.registerChaiBlock($,{type:"Divider",label:"Divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",props:{styles:l.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const z=e=>e.inBuilder?n.jsxRuntimeExports.jsx("span",{className:"flex",...e.blockProps,children:e.content}):`${e.content}`;p.registerChaiBlock(z,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,props:{content:l.g({title:"Content",defaultValue:""})}});const V=e=>{const{blockProps:t,backgroundImage:o,children:s,styles:r}=e;let a={};return o&&(a={backgroundImage:`url(${o})`}),u.createElement("div",{...t,...r,style:a},s)};p.registerChaiBlock(V,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:l.S({default:"font-body antialiased"}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const W=e=>{const{blockProps:t,styles:o}=e;return u.createElement("br",{...t,...o})};p.registerChaiBlock(W,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:y.SpaceBetweenVerticallyIcon,props:{styles:l.S({default:""})}});const E=e=>{const t=(a,i)=>({_id:x.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),o=a=>{const i=x.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...o(i)]},r=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...o(i),...o(i)]};if(e==="Table"){const a=x.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(a),...r(a)]}return e==="TableRow"?o():e==="TableHead"?s():e==="TableBody"?r():[]},G=e=>{const{blockProps:t,children:o,styles:s}=e;return o?u.createElement("table",{...t,...s},o):n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};p.registerChaiBlock(G,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:y.TableIcon,props:{styles:l.S({default:""})},blocks:E("Table")});const Y=e=>{const{blockProps:t,children:o,styles:s}=e;return o?u.createElement("thead",{...t,...s},o):n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"TABLE ROW"})};p.registerChaiBlock(Y,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:y.BorderTopIcon,props:{styles:l.S({default:""})},blocks:E("TableHead")});const X=e=>{const{blockProps:t,children:o,styles:s}=e;return o?u.createElement("tbody",{...t,...s},o):n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"TABLE ROW"})};p.registerChaiBlock(X,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:y.BorderAllIcon,props:{styles:l.S({default:""})},blocks:E("TableBody")});const Z=e=>{const{blockProps:t,children:o,styles:s}=e;return o?u.createElement("tr",{...t,...s},o):n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t,text:"TABLE CELL"})};p.registerChaiBlock(Z,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:y.ViewHorizontalIcon,props:{styles:l.S({default:"w-full"})},blocks:E("TableRow")});const J=e=>{const{blockProps:t,children:o,content:s,styles:r}=e;return!o&&h.isEmpty(s)?n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:t}):o?u.createElement("td",{...t,...r},o):u.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};p.registerChaiBlock(J,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:y.DragHandleHorizontalIcon,props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"Table cell item"})}});const K=e=>{const{blockProps:t,errorMessage:o,name:s,_type:r,successMessage:a,action:i,styles:c,children:d}=e;let m=d;d||(m=n.jsxRuntimeExports.jsx(g.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const b={"x-data":"useForm","x-on:submit.prevent":"post"},f={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...b,"data-error":o,"data-success":a,method:"post",action:i,...t,...c,children:[n.jsxRuntimeExports.jsx("div",{...f}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};p.registerChaiBlock(K,{type:"Form",label:"Form",category:"core",icon:y.GroupIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),action:l.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:l.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:l.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const Q=e=>{const{blockProps:t,content:o,styles:s,children:r}=e,a={...s,...t};return r?u.createElement("label",a,r):u.createElement("label",{...a,dangerouslySetInnerHTML:{__html:o}})};p.registerChaiBlock(Q,{type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),content:l.u({title:"Content",default:"Label"})}});const ee=e=>{const{blockProps:t,inBuilder:o,label:s,placeholder:r,styles:a,inputStyles:i,icon:c,iconPos:d}=e,m=x.generateUUID(),b={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:m,...b,...i,...a,...t||{},type:o?"button":"submit",placeholder:r,children:[s,c&&n.jsxRuntimeExports.jsx("span",{className:d,dangerouslySetInnerHTML:{__html:c}})]})};p.registerChaiBlock(ee,{type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",hidden:!0,props:{label:l.u({title:"Label",default:"Submit"}),styles:l.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:l.T({title:"Icon",default:""}),iconPos:l.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const te=e=>{const{blockProps:t,fieldName:o,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:d=!0}=e,m=x.generateUUID();return d?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"checkbox",required:i,name:o})};p.registerChaiBlock(te,{type:"Checkbox",label:"Checkbox",category:"core",icon:y.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"checkbox"}),styles:l.S({default:"flex items-center gap-x-2"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const le=e=>{const{blockProps:t,label:o,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:d="text",inBuilder:m,fieldName:b}=e,f=x.generateUUID();return!i||d==="submit"?(d==="submit"&&(t.value=o),n.jsxRuntimeExports.jsx("input",{id:f,name:b,readOnly:m,...t,...a,...r,type:d,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:o}),n.jsxRuntimeExports.jsx("input",{name:b,readOnly:m,...a,id:f,type:d,placeholder:s,required:c})]})};p.registerChaiBlock(le,{type:"Input",label:"Input",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"input"}),inputType:l.s({title:"Type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:l.u({title:"Value",default:""}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1})}});const oe=e=>{const{blockProps:t,fieldName:o,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:d=!0}=e,m=x.generateUUID();return d?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:m,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"radio",required:c,checked:i,name:o})};p.registerChaiBlock(oe,{type:"Radio",label:"Radio",category:"core",icon:y.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:l.S({default:"flex items-center w-max gap-x-2"}),fieldName:l.u({title:"Field Name",default:"radio"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const se=e=>{const{blockProps:t,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:d,_multiple:m=!1}=e,b=x.generateUUID();return d?n.jsxRuntimeExports.jsxs("div",{...a,children:[d&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:r,required:c,multiple:m,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>n.jsxRuntimeExports.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:b,...a,...t,placeholder:r,required:c,multiple:m,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>n.jsxRuntimeExports.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})};p.registerChaiBlock(se,{type:"Select",label:"Select",category:"core",icon:y.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"select"}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1}),_multiple:l.r({title:"Multiple Choice",default:!1}),options:l.h({title:"Options",itemProperties:{label:l.u({title:"Label",default:""}),value:l.u({title:"Value",default:""})}})}});const re=e=>{const{blockProps:t,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:d}=e,m=x.generateUUID();return d?n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[d&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:m,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:m,name:o,...t,...i,...a,placeholder:r,rows:c})};p.registerChaiBlock(re,{type:"TextArea",label:"TextArea",category:"core",icon:y.InputIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"textarea"}),showLabel:l.r({title:"Show label",default:!0}),styles:l.S({default:""}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),_rows:l.c({title:"Rows",default:3})}});const ae=h.noop;exports.loadWebBlocks=ae;
|