@chaibuilder/sdk 1.2.113 → 1.2.114
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/{CodeEditor-DDtmhfy3.cjs → CodeEditor-BWHGysUw.cjs} +1 -1
- package/dist/{CodeEditor-ouljm9CI.js → CodeEditor-q9he9IC8.js} +1 -1
- package/dist/{Topbar-Lvb5K8c2.js → Topbar-86JxE7Uw.js} +1 -1
- package/dist/{Topbar-6F-qYFQ1.cjs → Topbar-8LnyJF7S.cjs} +1 -1
- package/dist/{UnsplashImages-djUTOetI.cjs → UnsplashImages-MLEjengP.cjs} +1 -1
- package/dist/{UnsplashImages-nDgC7Fr9.js → UnsplashImages-chQ74Yzq.js} +1 -1
- package/dist/{UploadImages-vK-3HLTs.cjs → UploadImages--77rHMEx.cjs} +1 -1
- package/dist/{UploadImages-9KvJB0jW.js → UploadImages-Auy8ZPBl.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-V7Y_OFKT.js → index-IZpHf_8d.js} +823 -788
- package/dist/{index-NY4-KFVf.cjs → index-KsZZcMSu.cjs} +5 -5
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +190 -181
- package/package.json +1 -1
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),i=require("./jsx-runtime-JYMCiFoE.cjs"),E=require("react"),t=require("./controls-p9IwFnPx.cjs"),y=require("./iconBase-aZzpqff_.cjs"),g=require("@radix-ui/react-icons"),h=require("lodash-es"),C=require("lucide-react");require("clsx");require("tailwind-merge");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return o.default=e,Object.freeze(o)}const m=I(E),R=({className:e="",inBuilder:o})=>o?i.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:i.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 dark:outline-gray-700"})})}):null,w=R,L=e=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:a}=e;let c=r;r||(c=i.jsxRuntimeExports.jsx(w,{inBuilder:l}));let u={};return s&&(u={backgroundImage:`url(${s})`}),m.createElement(n,{...o,...a,style:u},c)},S={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:t.T({default:""}),tag:t.y({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:t.x({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:n,styles:a,children:c}=e,u=s,d=c||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),u&&i.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:u}})]});return m.createElement("button",{...o,...a,type:"button"},d)},M={type:"Button",label:"web_blocks.button",category:"core",icon:g.ButtonIcon,group:"basic",props:{content:t.g({title:"web_blocks.label",default:"Button",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:t.q({title:"web_blocks.icon",default:""}),iconSize:t.s({title:"web_blocks.icon_size",default:24}),iconPos:t.y({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},P=e=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=e;return r?i.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?i.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,m.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):m.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},N={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:g.CodeIcon,group:"advanced",props:{styles:t.T({default:""}),htmlCode:t.l({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},$=m.memo(e=>{const{blockProps:o,styles:l,backgroundImage:s}=e;let r={};return s&&(r={backgroundImage:`url(${s})`}),m.createElement("div",{...o,...l,style:r})}),q={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:t.T({default:""}),backgroundImage:t.x({title:"Background Image"})}},H=e=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:n=null}=e;return n?m.createElement(r,{...l,...o},n):m.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},z={type:"Heading",label:"web_blocks.heading",category:"core",icon:g.HeadingIcon,group:"typography",props:{level:t.y({title:"web_blocks.level",default:"h2",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:t.T({default:"text-3xl"}),content:t.f({title:"Content",default:"Heading goes here",ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Text"},D=e=>{const{blockProps:o,styles:l,content:s}=e;return h.isNull(e.children)?m.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):m.createElement("p",{...l,...o},e.children)},A={type:"Paragraph",label:"Paragraph",category:"core",icon:g.TextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
2
2
|
Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
|
|
3
|
-
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},U=e=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:i}=e;return r?m.createElement("span",{...l,...o},r):m.createElement(i||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s||""}})},F={type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"",ai:!0,i18n:!0})},canAcceptBlock:()=>!0},O=e=>{const{blockProps:o,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},V={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.m({title:"Content",ai:!0,i18n:!0,default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},G=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:i,content:a}=e;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(a)?n.jsxRuntimeExports.jsx(k,{inBuilder:i}):i?s?n.jsxRuntimeExports.jsx("span",{...o,...r,children:s}):m.createElement("span",{...o,...r,dangerouslySetInnerHTML:{__html:a}}):s?n.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):m.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self",dangerouslySetInnerHTML:{__html:a}})},W={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"",ai:!0,i18n:!0}),link:t.w({title:"Link",default:{type:"collection",target:"_self",href:""}})},canAcceptBlock:e=>e!=="Link"},B=(e,...o)=>({...e,className:y.cn(e.className,...o)}),X=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:i,href:a}=e,{hrefType:u,autoplay:c,maxWidth:d,backdropColor:f,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(i))return n.jsxRuntimeExports.jsx(k,{inBuilder:r});if(r)return l?n.jsxRuntimeExports.jsx("span",{...o,...x,children:l}):m.createElement("span",{...o,...x,dangerouslySetInnerHTML:{__html:i}});const w={};return w["data-vbtype"]=u,c&&(w["data-autoplay"]="true"),d&&(w["data-maxwidth"]=d+"px"),f&&(w["data-overlay"]=f),b&&(w["data-gall"]=b),l?n.jsxRuntimeExports.jsx("a",{...w,href:a||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...w,href:a||"#",dangerouslySetInnerHTML:{__html:i}})},Y={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"Link text or drop blocks inside",ai:!0,i18n:!0}),href:t.g({title:"Href",default:""}),hrefType:t.y({title:"Type",default:"video",options:[{value:"video",title:"Video"},{value:"iframe",title:"Iframe"},{value:"inline",title:"Inline"},{value:"ajax",title:"Ajax"}]}),autoplay:t.c({title:"Autoplay",default:!1}),maxWidth:t.s({title:"Max Width",default:""}),backdropColor:t.g({title:"Backdrop Color",default:""}),galleryName:t.g({title:"Gallery Name",default:""})},canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Z=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:i,inBuilder:a}=e,u=y.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(k,{inBuilder:a}):m.createElement(i||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:u},l)},J={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),listType:t.y({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.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"}]},K=e=>{const{blockProps:o,content:l,styles:s,children:r,tag:i}=e;return r?m.createElement(i||"li",{...s,...o},r):m.createElement(i||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},Q={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"List item",ai:!0,i18n:!0})},canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ee=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:i,height:a}=e,u=B(s,y.cn(r?`w-[${r}px]`:"",a?`h-[${a}px]`:""));if(h.isEmpty(l))return n.jsxRuntimeExports.jsx(k,{inBuilder:i,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return m.createElement("span",{...o,...u,dangerouslySetInnerHTML:{__html:c}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",props:{styles:t.T({default:"text-black"}),icon:t.q({title:"web_blocks.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:t.s({title:"web_blocks.width",default:""}),height:t.s({title:"web_blocks.height",default:""})}},le=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:i,width:a,lazyLoading:u}=e;return h.isEmpty(l)?n.jsxRuntimeExports.jsx(k,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:u?"lazy":"eager",height:i,width:a})},oe={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",props:{styles:t.T({default:""}),image:t.x({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.g({title:"Alt text",default:"",ai:!0,i18n:!0}),width:t.g({title:"Width",default:""}),height:t.g({title:"Height",default:""}),lazyLoading:t.c({title:"Lazy Load",default:!0})}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,_=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(v.test(e)){const o=e.match(v);return o?`https://www.youtube.com/embed/${o[4]}`:e}if(_.test(e)){const o=e.match(_);return o?`https://player.vimeo.com/video/${o[3]}`:e}if(j.test(e)){const o=e.match(j);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},re=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:i}=e,a=h.get(i,"autoPlay",!1),u=h.get(i,"controls",!1),c=a||h.get(i,"muted",!0),d=h.get(i,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(k,{inBuilder:l,className:"h-36"});let f=se(r),b=null;if(f){if(!h.isEmpty(f)){const x=[];x.push(`autoplay=${a?1:0}`),x.push(`controls=${i?1:0}`),x.push(`mute=${c?1:0}&muted=${c?1:0}`),x.push(`loop=${d?1:0}`),f=`${f}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=m.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:u,muted:c,autoPlay:l?!1:a,loop:d});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:[l?n.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),ne={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",props:{styles:t.T({default:""}),url:t.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",i18n:!0}),controls:t.b({title:"Controls",properties:{autoPlay:t.c({title:"Autoplay",default:!0}),controls:t.c({title:"Controls",default:!1}),loop:t.c({title:"Loop",default:!1}),muted:t.c({title:"Muted",default:!0})}})}};function ie(e){return y.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const ae=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?n.jsxRuntimeExports.jsx("div",{...s,children:n.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ce={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ie,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ue=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},de={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},pe=()=>null,me={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},ge=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[n.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),n.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},be={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},he=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},ye=e=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=e;let i={};return l&&(i={backgroundImage:`url(${l})`}),m.createElement("div",{...o,...r,style:i},s)},xe={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.T({default:"font-body antialiased"}),backgroundImage:t.x({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},ke=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},we={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},ve=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:i,action:a,styles:u,children:c}=e;let d=c;c||(d=n.jsxRuntimeExports.jsx(k,{}));const f={"x-data":"{}","x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":i,method:"post",action:a,...o,...u,children:[n.jsxRuntimeExports.jsx("div",{...b}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},_e={type:"Form",label:"Form",category:"core",icon:g.GroupIcon,group:"form",props:{styles:t.T({default:""}),action:t.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:t.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:t.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},je=e=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:i,icon:a,iconPos:u}=e,c=y.generateUUID(),d={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:c,...d,...i,...r,...o||{},type:l?"button":"submit",children:[s,a&&n.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:a}})]})},Be={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",props:{label:t.g({title:"Label",default:"Submit",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.q({title:"Icon",default:""}),iconPos:t.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}},Ee=e=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:i,showLabel:a,required:u,inputType:c="text",inBuilder:d,fieldName:f}=e,b=y.generateUUID();return!a||c==="submit"?(c==="submit"&&(o.value=l),n.jsxRuntimeExports.jsx("input",{id:b,name:f,readOnly:d,...o,...i,...r,type:c,placeholder:s,required:u})):n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[a&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),n.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...i,id:b,type:c,placeholder:s,required:u})]})},Ce={type:"Input",label:"Input",category:"core",icon:g.InputIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"input"}),inputType:t.y({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:t.g({title:"Value",default:"",ai:!0,i18n:!0}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1})}},Ie=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:i,checked:a,required:u,showLabel:c=!0}=e,d=y.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...i,name:l,id:d,type:"radio",required:u,defaultChecked:a}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...i,...r,type:"radio",required:u,checked:a,name:l})},Re={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",props:{styles:t.T({default:"flex items-center w-max gap-x-2"}),fieldName:t.g({title:"web_blocks.field_name",default:"radio"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Le=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:i,inputStyles:a,required:u,showLabel:c,_multiple:d=!1}=e,f=y.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...i,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),n.jsxRuntimeExports.jsxs("select",{...a,id:f,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>n.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...i,...o,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>n.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})},Se={type:"Select",label:"web_blocks.select",category:"core",icon:g.DropdownMenuIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"select"}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1}),_multiple:t.c({title:"Multiple",default:!1}),options:t.S({title:"Options",itemProperties:{label:t.g({title:"Label",default:"",ai:!0,i18n:!0}),value:t.g({title:"Value",default:""})}})}},Te=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:i,inputStyles:a,_rows:u,showLabel:c}=e,d=y.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...i,...o,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...a,id:d,placeholder:r,rows:u})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...a,...i,placeholder:r,rows:u})},Me={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"textarea"}),showLabel:t.c({title:"Show Label",default:!0}),styles:t.T({default:""}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),_rows:t.s({title:"Rows",default:3})}},Pe=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:i,required:a,checked:u,showLabel:c=!0}=e,d=y.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...i,name:l,id:d,type:"checkbox",required:a,defaultChecked:u}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...i,...r,type:"checkbox",required:a,name:l})},Ne={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"checkbox"}),styles:t.T({default:"flex items-center gap-x-2"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},$e=()=>{p.registerChaiBlock(L,S),p.registerChaiBlock($,q),p.registerChaiBlock(T,M),p.registerChaiBlock(H,z),p.registerChaiBlock(D,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,V),p.registerChaiBlock(G,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(le,oe),p.registerChaiBlock(re,ne),p.registerChaiBlock(P,N),p.registerChaiBlock(he,fe),p.registerChaiBlock(ve,_e),p.registerChaiBlock(je,Be),p.registerChaiBlock(Ee,Ce),p.registerChaiBlock(Pe,Ne),p.registerChaiBlock(Ie,Re),p.registerChaiBlock(Le,Se),p.registerChaiBlock(Te,Me),p.registerChaiBlock(ke,we),p.registerChaiBlock(ye,xe),p.registerChaiBlock(ae,ce),p.registerChaiBlock(ue,de),p.registerChaiBlock(pe,me),p.registerChaiBlock(ge,be)};exports.loadWebBlocks=$e;
|
|
3
|
+
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},U=e=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:n}=e;return r?m.createElement("span",{...l,...o},r):m.createElement(n||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s||""}})},F={type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"",ai:!0,i18n:!0})},canAcceptBlock:()=>!0},O=e=>{const{blockProps:o,content:l,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},V={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.m({title:"Content",ai:!0,i18n:!0,default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},G=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:n,content:a}=e;let c={};return!s&&h.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?i.jsxRuntimeExports.jsx("span",{...o,style:c,...r,children:s}):m.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},a):s?i.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):m.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self"},a)},W={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"",ai:!0,i18n:!0}),link:t.w({title:"Link",default:{type:"collection",target:"_self",href:""}})},canAcceptBlock:e=>e!=="Link"},B=(e,...o)=>({...e,className:y.cn(e.className,...o)}),X=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:n,href:a}=e,{hrefType:c,autoplay:u,maxWidth:d,backdropColor:f,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(n))return i.jsxRuntimeExports.jsx(w,{inBuilder:r});if(r)return l?i.jsxRuntimeExports.jsx("span",{...o,...x,children:l}):m.createElement("span",{...o,...x,dangerouslySetInnerHTML:{__html:n}});const k={};return k["data-vbtype"]=c,u&&(k["data-autoplay"]="true"),d&&(k["data-maxwidth"]=d+"px"),f&&(k["data-overlay"]=f),b&&(k["data-gall"]=b),l?i.jsxRuntimeExports.jsx("a",{...k,href:a||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...k,href:a||"#",dangerouslySetInnerHTML:{__html:n}})},Y={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"Link text or drop blocks inside",ai:!0,i18n:!0}),href:t.g({title:"Href",default:""}),hrefType:t.y({title:"Type",default:"video",options:[{value:"video",title:"Video"},{value:"iframe",title:"Iframe"},{value:"inline",title:"Inline"},{value:"ajax",title:"Ajax"}]}),autoplay:t.c({title:"Autoplay",default:!1}),maxWidth:t.s({title:"Max Width",default:""}),backdropColor:t.g({title:"Backdrop Color",default:""}),galleryName:t.g({title:"Gallery Name",default:""})},canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Z=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:n,inBuilder:a}=e,c=y.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?i.jsxRuntimeExports.jsx(w,{inBuilder:a}):m.createElement(n||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},J={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),listType:t.y({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.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"}]},K=e=>{const{blockProps:o,content:l,styles:s,children:r,tag:n}=e;return r?m.createElement(n||"li",{...s,...o},r):m.createElement(n||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},Q={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"List item",ai:!0,i18n:!0})},canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ee=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:n,height:a}=e,c=B(s,y.cn(r?`w-[${r}px]`:"",a?`h-[${a}px]`:""));if(h.isEmpty(l))return i.jsxRuntimeExports.jsx(w,{inBuilder:n,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return m.createElement("span",{...o,...c,dangerouslySetInnerHTML:{__html:u}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",props:{styles:t.T({default:"text-black"}),icon:t.q({title:"web_blocks.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:t.s({title:"web_blocks.width",default:""}),height:t.s({title:"web_blocks.height",default:""})}},le=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:n,width:a,lazyLoading:c}=e;return h.isEmpty(l)?i.jsxRuntimeExports.jsx(w,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:c?"lazy":"eager",height:n,width:a})},oe={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",props:{styles:t.T({default:""}),image:t.x({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.g({title:"Alt text",default:"",ai:!0,i18n:!0}),width:t.g({title:"Width",default:""}),height:t.g({title:"Height",default:""}),lazyLoading:t.c({title:"Lazy Load",default:!0})}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,_=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(v.test(e)){const o=e.match(v);return o?`https://www.youtube.com/embed/${o[4]}`:e}if(_.test(e)){const o=e.match(_);return o?`https://player.vimeo.com/video/${o[3]}`:e}if(j.test(e)){const o=e.match(j);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},re=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:n}=e,a=h.get(n,"autoPlay",!1),c=h.get(n,"controls",!1),u=a||h.get(n,"muted",!0),d=h.get(n,"loop",!1);if(h.isEmpty(r))return i.jsxRuntimeExports.jsx(w,{inBuilder:l,className:"h-36"});let f=se(r),b=null;if(f){if(!h.isEmpty(f)){const x=[];x.push(`autoplay=${a?1:0}`),x.push(`controls=${n?1:0}`),x.push(`mute=${u?1:0}&muted=${u?1:0}`),x.push(`loop=${d?1:0}`),f=`${f}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=m.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:a,loop:d});return i.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?i.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),ie={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",props:{styles:t.T({default:""}),url:t.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",i18n:!0}),controls:t.b({title:"Controls",properties:{autoPlay:t.c({title:"Autoplay",default:!0}),controls:t.c({title:"Controls",default:!1}),loop:t.c({title:"Loop",default:!1}),muted:t.c({title:"Muted",default:!0})}})}};function ne(e){return y.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const ae=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?i.jsxRuntimeExports.jsx("div",{...s,children:i.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):i.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ce={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ne,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ue=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},de={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},pe=()=>null,me={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},ge=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},be={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},he=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},ye=e=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),m.createElement("div",{...o,...r,style:n},s)},xe={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.T({default:"font-body antialiased"}),backgroundImage:t.x({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},ke=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},we={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},ve=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:n,action:a,styles:c,children:u}=e;let d=u;u||(d=i.jsxRuntimeExports.jsx(w,{}));const f={"x-data":"{}","x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":n,method:"post",action:a,...o,...c,children:[i.jsxRuntimeExports.jsx("div",{...b}),i.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},_e={type:"Form",label:"Form",category:"core",icon:g.GroupIcon,group:"form",props:{styles:t.T({default:""}),action:t.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:t.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:t.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},je=e=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:n,icon:a,iconPos:c}=e,u=y.generateUUID(),d={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:u,...d,...n,...r,...o||{},type:l?"button":"submit",children:[s,a&&i.jsxRuntimeExports.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:a}})]})},Be={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",props:{label:t.g({title:"Label",default:"Submit",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.q({title:"Icon",default:""}),iconPos:t.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}},Ee=e=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:a,required:c,inputType:u="text",inBuilder:d,fieldName:f}=e,b=y.generateUUID();return!a||u==="submit"?(u==="submit"&&(o.value=l),i.jsxRuntimeExports.jsx("input",{id:b,name:f,readOnly:d,...o,...n,...r,type:u,placeholder:s,required:c})):i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[a&&i.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),i.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...n,id:b,type:u,placeholder:s,required:c})]})},Ce={type:"Input",label:"Input",category:"core",icon:g.InputIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"input"}),inputType:t.y({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:t.g({title:"Value",default:"",ai:!0,i18n:!0}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1})}},Ie=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,checked:a,required:c,showLabel:u=!0}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"radio",required:c,defaultChecked:a}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"radio",required:c,checked:a,name:l})},Re={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",props:{styles:t.T({default:"flex items-center w-max gap-x-2"}),fieldName:t.g({title:"web_blocks.field_name",default:"radio"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Le=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:a,required:c,showLabel:u,_multiple:d=!1}=e,f=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...n,children:[u&&i.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:f,required:c,multiple:d,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>i.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:f,...n,...o,required:c,multiple:d,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,b=>i.jsxRuntimeExports.jsx("option",{selected:h.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})},Se={type:"Select",label:"web_blocks.select",category:"core",icon:g.DropdownMenuIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"select"}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1}),_multiple:t.c({title:"Multiple",default:!1}),options:t.S({title:"Options",itemProperties:{label:t.g({title:"Label",default:"",ai:!0,i18n:!0}),value:t.g({title:"Value",default:""})}})}},Te=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:a,_rows:c,showLabel:u}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...n,...o,children:[u&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),i.jsxRuntimeExports.jsx("textarea",{name:l,...a,id:d,placeholder:r,rows:c})]}):i.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...a,...n,placeholder:r,rows:c})},Me={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"textarea"}),showLabel:t.c({title:"Show Label",default:!0}),styles:t.T({default:""}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),_rows:t.s({title:"Rows",default:3})}},Pe=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,required:a,checked:c,showLabel:u=!0}=e,d=y.generateUUID();return u?i.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"checkbox",required:a,defaultChecked:c}),s&&s!=="Label"&&i.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"checkbox",required:a,name:l})},Ne={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"checkbox"}),styles:t.T({default:"flex items-center gap-x-2"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},$e=()=>{p.registerChaiBlock(L,S),p.registerChaiBlock($,q),p.registerChaiBlock(T,M),p.registerChaiBlock(H,z),p.registerChaiBlock(D,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,V),p.registerChaiBlock(G,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(le,oe),p.registerChaiBlock(re,ie),p.registerChaiBlock(P,N),p.registerChaiBlock(he,fe),p.registerChaiBlock(ve,_e),p.registerChaiBlock(je,Be),p.registerChaiBlock(Ee,Ce),p.registerChaiBlock(Pe,Ne),p.registerChaiBlock(Ie,Re),p.registerChaiBlock(Le,Se),p.registerChaiBlock(Te,Me),p.registerChaiBlock(ke,we),p.registerChaiBlock(ye,xe),p.registerChaiBlock(ae,ce),p.registerChaiBlock(ue,de),p.registerChaiBlock(pe,me),p.registerChaiBlock(ge,be)};exports.loadWebBlocks=$e;
|