@chaibuilder/sdk 1.3.0 → 1.3.2
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-4DqYRbd_.js +75 -0
- package/dist/CodeEditor-De5iMQ29.cjs +1 -0
- package/dist/Topbar-CF2ruRG5.js +113 -0
- package/dist/Topbar-DAqH30Vp.cjs +1 -0
- package/dist/UnsplashImages-4CFuSaLJ.js +189 -0
- package/dist/UnsplashImages-8B8DhERl.cjs +1 -0
- package/dist/UploadImages-BxZW3OIT.cjs +1 -0
- package/dist/UploadImages-C6ta5Prd.js +101 -0
- package/dist/{context-menu-BbqLeYFX.js → context-menu-BtcwqA6V.js} +295 -298
- package/dist/context-menu-CYk-Ms8j.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-CcLk7_o6.js → index-Coh4Y4tF.js} +2861 -2915
- package/dist/index-MwShWj1c.cjs +63 -0
- package/dist/render.cjs +2 -2
- package/dist/render.js +70 -70
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +196 -196
- package/dist/web-blocks.cjs +3 -3
- package/dist/web-blocks.js +236 -238
- package/package.json +1 -1
- package/dist/CodeEditor-C94XQmvL.cjs +0 -1
- package/dist/CodeEditor-D5t7A9Po.js +0 -77
- package/dist/Topbar-Bnxt9C5B.js +0 -113
- package/dist/Topbar-DFm3YQZi.cjs +0 -1
- package/dist/UnsplashImages-BWT3eyq3.cjs +0 -1
- package/dist/UnsplashImages-D-9aNQGK.js +0 -189
- package/dist/UploadImages-CntfFAoV.cjs +0 -1
- package/dist/UploadImages-CrAaKlC1.js +0 -101
- package/dist/context-menu-DfAXjmc8.cjs +0 -1
- package/dist/index-C9LOYt3W.cjs +0 -63
- package/dist/jsx-runtime-BYECrxsp.cjs +0 -30
- package/dist/jsx-runtime-DGlMoOmv.js +0 -630
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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"),s=require("react/jsx-runtime"),I=require("react"),t=require("./controls-C4n5ycp4.cjs"),y=require("./iconBase-Cn2BsTrq.cjs"),b=require("@radix-ui/react-icons"),h=require("lodash-es"),L=require("lucide-react");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const a=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(o,l,a.get?a:{enumerable:!0,get:()=>e[l]})}}return o.default=e,Object.freeze(o)}const g=j(I),w=({className:e="",inBuilder:o})=>o?s.jsx("div",{className:y.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:s.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,S=e=>{const{blockProps:o,inBuilder:l,backgroundImage:a,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=s.jsx(w,{inBuilder:l}));let d={};return a&&(d={backgroundImage:`url(${a})`}),g.createElement(n,{...o,...i,style:d},c)},T={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},M=e=>{const{blockProps:o,iconSize:l,icon:a,content:r,iconPos:n,styles:i,children:c}=e,d=a,u=c||s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-ai-key":"content",children:r}),d&&s.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:d}})]});return g.createElement("button",{...o,...i,type:"button"},u)},E={type:"Button",label:"web_blocks.button",category:"core",icon:b.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"}]})}},$=e=>{const{blockProps:o,styles:l,htmlCode:a,inBuilder:r}=e;return r?s.jsxs("div",{className:"relative",children:[r?s.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,g.createElement("div",{...l,dangerouslySetInnerHTML:{__html:a.replace(/<script.*?>.*?<\/script>/g,"")}})]}):g.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:a}})},P={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:b.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"})}},N=g.memo(e=>{const{blockProps:o,styles:l,backgroundImage:a}=e;let r={};return a&&(r={backgroundImage:`url(${a})`}),g.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:a,level:r="h1",children:n=null}=e;return n?g.createElement(r,{...l,...o},n):g.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:a}})},R={type:"Heading",label:"web_blocks.heading",category:"core",icon:b.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:a}=e;return h.isNull(e.children)?g.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:a}}):g.createElement("p",{...l,...o},e.children)},z={type:"Paragraph",label:"Paragraph",category:"core",icon:b.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"},A=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||""}})},U={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},F=e=>{const{blockProps:o,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},O={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>"})}},V=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:n,content:i}=e;let c={};return!s&&f.isEmpty(i)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?a.jsxRuntimeExports.jsx("span",{...o,style:c,...r,children:s}):m.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},i):s?a.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"},i)},G={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)}),W=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:n,href:i}=e,{hrefType:c,autoplay:u,maxWidth:d,backdropColor:h,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&f.isEmpty(s==null?void 0:s.className)&&f.isEmpty(n))return a.jsxRuntimeExports.jsx(w,{inBuilder:r});if(r)return l?a.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"),h&&(k["data-overlay"]=h),b&&(k["data-gall"]=b),l?a.jsxRuntimeExports.jsx("a",{...k,href:i||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...k,href:i||"#",dangerouslySetInnerHTML:{__html:n}})},X={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"},Y=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=y.cn(f.get(r,"className",""),s);return!l&&f.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(w,{inBuilder:i}):m.createElement(n||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},Z={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"}]},J=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}})},K={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"},Q=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=B(s,y.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(f.isEmpty(l))return a.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}})},ee={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:""})}},te=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:n,width:i,lazyLoading:c}=e;return f.isEmpty(l)?a.jsxRuntimeExports.jsx(w,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:c?"lazy":"eager",height:n,width:i})},le={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_-]+)/,oe=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},se=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:n}=e,i=f.get(n,"autoPlay",!1),c=f.get(n,"controls",!1),u=i||f.get(n,"muted",!0),d=f.get(n,"loop",!1);if(f.isEmpty(r))return a.jsxRuntimeExports.jsx(w,{inBuilder:l,className:"h-36"});let h=oe(r),b=null;if(h){if(!f.isEmpty(h)){const x=[];x.push(`autoplay=${i?1:0}`),x.push(`controls=${n?1:0}`),x.push(`mute=${u?1:0}&muted=${u?1:0}`),x.push(`loop=${d?1:0}`),h=`${h}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:h,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:i,loop:d});return a.jsxRuntimeExports.jsx("div",{...f.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...o,...f.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),re={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 ae(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 ne=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?a.jsxRuntimeExports.jsx("div",{...s,children:a.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:a.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"})})})}):a.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ie={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ae,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ce=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},ue={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"})}},de=()=>null,pe={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>"}]},me=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?a.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:[a.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),a.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},ge={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},be=e=>e.inBuilder||e.forceWrapper?a.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})}},he=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)},ye={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},xe=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},ke={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},we=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:u}=e;let d=u;u||(d=a.jsxRuntimeExports.jsx(w,{}));const h={"x-data":`{
|
|
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"},A=e=>{const{blockProps:o,styles:l,content:a,children:r=null,tag:n}=e;return r?g.createElement("span",{...l,...o},r):g.createElement(n||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:a||""}})},U={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},F=e=>{const{blockProps:o,content:l,styles:a}=e;return s.jsx("div",{className:"max-w-full",children:s.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...a,dangerouslySetInnerHTML:{__html:l}})})},O={type:"RichText",label:"Rich Text",category:"core",icon:b.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>"})}},V=e=>{const{blockProps:o,link:l,children:a,styles:r,inBuilder:n,content:i}=e;let c={};return!a&&h.isEmpty(i)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?a?s.jsx("span",{...o,style:c,...r,children:a}):g.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},i):a?s.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:a}):g.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self"},i)},G={type:"Link",label:"Link",category:"core",icon:b.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"},C=(e,...o)=>({...e,className:y.cn(e.className,...o)}),W=e=>{const{blockProps:o,children:l,styles:a,inBuilder:r,content:n,href:i}=e,{hrefType:c,autoplay:d,maxWidth:u,backdropColor:m,galleryName:f}=e,k=C(a,"cb-lightbox");if(!l&&h.isEmpty(a==null?void 0:a.className)&&h.isEmpty(n))return s.jsx(w,{inBuilder:r});if(r)return l?s.jsx("span",{...o,...k,children:l}):g.createElement("span",{...o,...k,dangerouslySetInnerHTML:{__html:n}});const x={};return x["data-vbtype"]=c,d&&(x["data-autoplay"]="true"),u&&(x["data-maxwidth"]=u+"px"),m&&(x["data-overlay"]=m),f&&(x["data-gall"]=f),l?s.jsx("a",{...x,href:i||"#/",...o,...k,children:l}):g.createElement("a",{...o,...k,...x,href:i||"#",dangerouslySetInnerHTML:{__html:n}})},X={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:b.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"},Y=e=>{const{blockProps:o,children:l,listType:a,styles:r,tag:n,inBuilder:i}=e,c=y.cn(h.get(r,"className",""),a);return!l&&h.isEmpty(r==null?void 0:r.className)?s.jsx(w,{inBuilder:i}):g.createElement(n||(a==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},Z={type:"List",label:"web_blocks.list",icon:b.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"}]},J=e=>{const{blockProps:o,content:l,styles:a,children:r,tag:n}=e;return r?g.createElement(n||"li",{...a,...o},r):g.createElement(n||"li",{...a,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},K={type:"ListItem",label:"List Item",icon:b.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"},Q=e=>{const{blockProps:o,icon:l,styles:a,width:r,inBuilder:n,height:i}=e,c=C(a,y.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(l))return s.jsx(w,{inBuilder:n,className:"h-8 w-14"});const d=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return g.createElement("span",{...o,...c,dangerouslySetInnerHTML:{__html:d}})},ee={type:"Icon",label:"web_blocks.icon",category:"core",icon:b.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:""})}},te=e=>{const{blockProps:o,image:l,styles:a,alt:r,height:n,width:i,lazyLoading:c}=e;return h.isEmpty(l)?s.jsx(w,{className:"h-36"}):g.createElement("img",{...o,...a,src:l,alt:r,loading:c?"lazy":"eager",height:n,width:i})},le={type:"Image",label:"Image",category:"core",icon:b.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/,B=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,oe=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(B.test(e)){const o=e.match(B);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},ae=g.memo(e=>{const{blockProps:o,inBuilder:l,styles:a,url:r,controls:n}=e,i=h.get(n,"autoPlay",!1),c=h.get(n,"controls",!1),d=i||h.get(n,"muted",!0),u=h.get(n,"loop",!1);if(h.isEmpty(r))return s.jsx(w,{inBuilder:l,className:"h-36"});let m=oe(r),f=null;if(m){if(!h.isEmpty(m)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${n?1:0}`),k.push(`mute=${d?1:0}&muted=${d?1:0}`),k.push(`loop=${u?1:0}`),m=`${m}?${k.join("&")}`}f=g.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:m,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=g.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:d,autoPlay:l?!1:i,loop:u});return s.jsx("div",{...h.pick(a,["className"]),children:s.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?s.jsx("div",{...o,...h.omit(a,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})}),re={type:"Video",label:"Video",category:"core",icon:b.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 se(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 ne=e=>{const{scripts:o,inBuilder:l,blockProps:a}=e;return l?s.jsx("div",{...a,children:s.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:s.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"})})})}):s.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ie={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:se,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ce=e=>{const{blockProps:o,styles:l}=e;return g.createElement("hr",{...l,...o})},de={type:"Divider",label:"web_blocks.divider",category:"core",icon:b.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},ue=()=>null,pe={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:b.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:a,globalBlock:r}=e;return l&&!r?s.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:[s.jsxs("h1",{children:["Global Block - ",r]}),s.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):g.createElement("div",{...o},a)},be={type:"GlobalBlock",label:"Global Block",icon:L.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},fe=e=>e.inBuilder||e.forceWrapper?s.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,he={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:b.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},me=e=>{const{blockProps:o,backgroundImage:l,children:a,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),g.createElement("div",{...o,...r,style:n},a)},ye={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 g.createElement("br",{...o,...l})},xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:b.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},we=e=>{const{blockProps:o,errorMessage:l,name:a,_type:r,successMessage:n,action:i,styles:c,children:d}=e;let u=d;d||(u=s.jsx(w,{}));const m={"x-data":`{
|
|
4
4
|
formStatus: '',
|
|
5
5
|
formLoading: false,
|
|
6
6
|
async submit() {
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
this.formLoading = false;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
}`,"x-on:submit.prevent":"submit"},
|
|
24
|
+
}`,"x-on:submit.prevent":"submit"},f={"data-response":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return s.jsxs("form",{...m,"data-error":l,"data-success":n,method:"post",action:i,...o,...c,children:[s.jsx("div",{...f}),s.jsx("input",{name:"formname",type:"hidden",value:a||r}),u]})},ve={type:"Form",label:"Form",category:"core",icon:b.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},_e=e=>{const{blockProps:o,inBuilder:l,label:a,styles:r,inputStyles:n,icon:i,iconPos:c}=e,d=y.generateUUID(),u={"x-bind:disabled":"formLoading"};return s.jsxs("button",{id:d,...u,...n,...r,...o||{},type:l?"button":"submit",children:[a,i&&s.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:i}})]})},Be={type:"FormButton",label:"Submit Button",category:"core",icon:b.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"}]})}},Ce=e=>{const{blockProps:o,label:l,placeholder:a,styles:r,inputStyles:n,showLabel:i,required:c,inputType:d="text",inBuilder:u,fieldName:m}=e,f=y.generateUUID();return!i||d==="submit"?(d==="submit"&&(o.value=l),s.jsx("input",{id:f,name:m,readOnly:u,...o,...n,...r,type:d,placeholder:a,required:c})):s.jsxs("div",{...r,...o,children:[i&&s.jsx("label",{htmlFor:f,children:l}),s.jsx("input",{name:m,readOnly:u,...n,id:f,type:d,placeholder:a,required:c})]})},Ie={type:"Input",label:"Input",category:"core",icon:b.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})}},Le=e=>{const{blockProps:o,fieldName:l,label:a,styles:r,inputStyles:n,checked:i,required:c,showLabel:d=!0}=e,u=y.generateUUID();return d?s.jsxs("div",{...r,...o,children:[s.jsx("input",{...n,name:l,id:u,type:"radio",required:c,defaultChecked:i}),a&&s.jsx("label",{htmlFor:u,children:a})]}):s.jsx("input",{id:u,...o,...n,...r,type:"radio",required:c,checked:i,name:l})},je={type:"Radio",label:"web_blocks.radio",category:"core",icon:b.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})}},Se=e=>{const{blockProps:o,fieldName:l,label:a,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:d,_multiple:u=!1}=e,m=y.generateUUID();return d?s.jsxs("div",{...n,children:[d&&s.jsx("label",{htmlFor:m,children:a}),s.jsxs("select",{...i,id:m,required:c,multiple:u,name:l,children:[s.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>s.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})]}):s.jsxs("select",{id:m,...n,...o,required:c,multiple:u,name:l,children:[s.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(e.options,f=>s.jsx("option",{selected:h.get(f,"selected",!1),value:f.value,dangerouslySetInnerHTML:{__html:f.label}},f.value))]})},Te={type:"Select",label:"web_blocks.select",category:"core",icon:b.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:""})}})}},Me=e=>{const{blockProps:o,fieldName:l,label:a,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:d}=e,u=y.generateUUID();return d?s.jsxs("div",{...n,...o,children:[d&&s.jsx("label",{htmlFor:u,children:a}),s.jsx("textarea",{name:l,...i,id:u,placeholder:r,rows:c})]}):s.jsx("textarea",{id:u,name:l,...o,...i,...n,placeholder:r,rows:c})},Ee={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:b.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})}},$e=e=>{const{blockProps:o,fieldName:l,label:a,styles:r,inputStyles:n,required:i,checked:c,showLabel:d=!0}=e,u=y.generateUUID();return d?s.jsxs("div",{...r,...o,children:[s.jsx("input",{...n,name:l,id:u,type:"checkbox",required:i,defaultChecked:c}),a&&a!=="Label"&&s.jsx("label",{htmlFor:u,children:a})]}):s.jsx("input",{id:u,...o,...n,...r,type:"checkbox",required:i,name:l})},Pe={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:b.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})}},Ne=()=>{p.registerChaiBlock(S,T),p.registerChaiBlock(N,q),p.registerChaiBlock(M,E),p.registerChaiBlock(H,R),p.registerChaiBlock(D,z),p.registerChaiBlock(A,U),p.registerChaiBlock(F,O),p.registerChaiBlock(V,G),p.registerChaiBlock(W,X),p.registerChaiBlock(Y,Z),p.registerChaiBlock(J,K),p.registerChaiBlock(Q,ee),p.registerChaiBlock(te,le),p.registerChaiBlock(ae,re),p.registerChaiBlock($,P),p.registerChaiBlock(fe,he),p.registerChaiBlock(we,ve),p.registerChaiBlock(_e,Be),p.registerChaiBlock(Ce,Ie),p.registerChaiBlock($e,Pe),p.registerChaiBlock(Le,je),p.registerChaiBlock(Se,Te),p.registerChaiBlock(Me,Ee),p.registerChaiBlock(ke,xe),p.registerChaiBlock(me,ye),p.registerChaiBlock(ne,ie),p.registerChaiBlock(ce,de),p.registerChaiBlock(ue,pe),p.registerChaiBlock(ge,be)};exports.loadWebBlocks=Ne;
|