@chaibuilder/sdk 2.0.0-beta.61 → 2.0.0-beta.63
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/core.cjs +1 -1
- package/dist/core.js +15 -8
- package/dist/web-blocks.cjs +6 -6
- package/dist/web-blocks.js +3 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -4490,7 +4490,7 @@ const ImagePickerField = ({ value: o, onChange: n, id: r, onBlur: a }) => {
|
|
|
4490
4490
|
),
|
|
4491
4491
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-2 right-2 top-3 flex items-center gap-1.5", children: g && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: w, className: "text-gray-400 hover:text-gray-600", title: a("Clear search"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-4 w-4" }) }) })
|
|
4492
4492
|
] }),
|
|
4493
|
-
(i || !isEmpty(f) || d && isEmpty(f)) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute z-40 mt-2 max-h-40 w-full overflow-y-auto rounded-md border border-border bg-background shadow-lg", children: i ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1 p-2", children: [
|
|
4493
|
+
(i || !isEmpty(f) || d && isEmpty(f)) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute z-40 mt-2 max-h-40 w-full max-w-[250px] overflow-y-auto rounded-md border border-border bg-background shadow-lg", children: i ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1 p-2", children: [
|
|
4494
4494
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" }),
|
|
4495
4495
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" })
|
|
4496
4496
|
] }) : d && isEmpty(f) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center p-4 text-sm text-gray-500", children: [
|
|
@@ -8592,6 +8592,7 @@ function useSidebarMenuItems() {
|
|
|
8592
8592
|
{
|
|
8593
8593
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }),
|
|
8594
8594
|
label: "Outline",
|
|
8595
|
+
isInternal: !0,
|
|
8595
8596
|
component: () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ListTree, {}) })
|
|
8596
8597
|
}
|
|
8597
8598
|
]), []);
|
|
@@ -8639,13 +8640,19 @@ const RootLayout = () => {
|
|
|
8639
8640
|
initial: { width: 280 },
|
|
8640
8641
|
animate: { width: o !== null ? 280 : 0 },
|
|
8641
8642
|
transition: { duration: 0.3, ease: "easeInOut" },
|
|
8642
|
-
children: o !== null && /* @__PURE__ */ jsxRuntimeExports.
|
|
8643
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8643
|
+
children: o !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "no-scrollbar flex h-full flex-col overflow-hidden px-3 py-2", children: [
|
|
8644
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8645
|
+
"div",
|
|
8646
|
+
{
|
|
8647
|
+
className: `absolute top-2 z-50 flex h-10 items-center space-x-1 bg-white py-2 text-base font-bold ${get(m, `${o}.isInternal`, !1) ? "" : "w-64"}`,
|
|
8648
|
+
children: [
|
|
8649
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rtl:ml-2 rtl:inline-block", children: get(m, `${o}.icon`, null) }),
|
|
8650
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: g(m[o].label) })
|
|
8651
|
+
]
|
|
8652
|
+
}
|
|
8653
|
+
),
|
|
8654
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar max-h-full overflow-y-auto pt-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: React__default.createElement(get(m, `${o}.component`, null), {}) }) })
|
|
8655
|
+
] })
|
|
8649
8656
|
}
|
|
8650
8657
|
),
|
|
8651
8658
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full flex-1 flex-col bg-slate-800/20", children: [
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),i=require("./jsx-runtime-qcKc-DpB.cjs"),w=require("react"),k=require("./iconBase-Cn2BsTrq.cjs"),y=require("@radix-ui/react-icons"),m=require("lodash-es"),S=require("lucide-react");function M(e){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),i=require("./jsx-runtime-qcKc-DpB.cjs"),w=require("react"),k=require("./iconBase-Cn2BsTrq.cjs"),y=require("@radix-ui/react-icons"),m=require("lodash-es"),S=require("lucide-react");function M(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(r,l,o.get?o:{enumerable:!0,get:()=>e[l]})}}return r.default=e,Object.freeze(r)}const b=M(w),j=({className:e="",inBuilder:r})=>r?i.jsxRuntimeExports.jsx("div",{className:k.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,D=e=>{const{blockProps:r,inBuilder:l,backgroundImage:o,children:s,tag:n="div",styles:a}=e;let d=s;s||(d=i.jsxRuntimeExports.jsx(j,{inBuilder:l}));let c={};return o&&(c={backgroundImage:`url(${o})`}),b.createElement(n,{...r,...a,style:c},d)},$={type:"Box",label:"Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}},tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:r,iconSize:l,icon:o,content:s,styles:n,children:a,iconPos:d,link:c,inBuilder:p}=e,g=o,h=a||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:s}),g&&i.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:d+" "+(d==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:g}})]}),u=w.createElement("button",{...r,...n,type:"button","aria-label":s},h);return m.isEmpty(m.get(c,"href"))?u:p?i.jsxRuntimeExports.jsx("span",{children:u}):i.jsxRuntimeExports.jsx("a",{"aria-label":s,href:m.get(c,"href")||"/",target:m.get(c,"target","_self"),children:u})},A={type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}}}}),i18nProps:["content"],aiProps:["content"]},z=e=>{const{blockProps:r,styles:l,htmlCode:o,inBuilder:s}=e;return s?i.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s?i.jsxRuntimeExports.jsx("div",{...r,...l,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...l,dangerouslySetInnerHTML:{__html:o.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...r,...l,dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:y.CodeIcon,group:"advanced",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}})},q=e=>{const{blockProps:r,styles:l,backgroundImage:o}=e;let s={};return o&&(s={backgroundImage:`url(${o})`}),b.createElement("div",{...r,...l,style:s})},U={type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},O=e=>{const{blockProps:r,styles:l,content:o,tag:s="h1",children:n=null}=e;return n?b.createElement(s,{...l,...r},n):b.createElement(s,{...l,...r,dangerouslySetInnerHTML:{__html:o}})},F={type:"Heading",label:"web_blocks.heading",category:"core",icon:y.HeadingIcon,group:"typography",...t.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:t.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},G=e=>{const{blockProps:r,styles:l,content:o}=e;return m.isNull(e.children)?b.createElement("p",{...l,...r,dangerouslySetInnerHTML:{__html:o}}):b.createElement("p",{...l,...r},e.children)},V={type:"Paragraph",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",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.`,ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},W=e=>{const{blockProps:l,content:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...l,...o,dangerouslySetInnerHTML:{__html:r}})})},X={type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Y=e=>{const{blockProps:l,styles:r,content:o,children:s=null,tag:n}=e;return s?b.createElement("span",{...r,...l},s):b.createElement(n||"span",{...r,...l,dangerouslySetInnerHTML:{__html:o||""}})},Z={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};function J(e){return k.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 K=e=>{const{scripts:l,inBuilder:r,blockProps:o}=e;return r?i.jsxRuntimeExports.jsx("div",{...o,children:i.jsxRuntimeExports.jsx("div",{className:k.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:l}})},Q={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:J,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},ee=e=>i.jsxRuntimeExports.jsxs("div",{...e.blockProps,...e.styles,children:[e.mode,e.children]}),te=e=>e.mode==="dark"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"dark mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(te,{type:"DarkModeButton",label:"Dark Mode Button",category:"core",icon:y.MoonIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp("")}})});const le=e=>e.mode==="light"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"light mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(le,{type:"LightModeButton",label:"Light Mode Button",category:"core",icon:y.SunIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp(""),fake:{type:"string",default:""}}})});const re={type:"DarkModeSwitcher",label:"web_blocks.dark_mode",category:"core",icon:y.MoonIcon,group:"advanced",wrapper:!0,...t.registerChaiBlockSchema({properties:{mode:{title:"Mode",type:"string",enum:["dark","light"],default:"light"},styles:t.stylesProp("")}}),blocks:()=>[{_id:"ultqCh",_type:"DarkModeSwitcher",mode:"light",styles:"#styles:,",_name:"Dark Mode Theme"},{_id:"vroabi",_parent:"ultqCh",_type:"LightModeButton",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:"nltBrv",_parent:"vroabi",_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:"DarkModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white hidden 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:"AdDwBC",_parent:"gesydi",_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>"}]},se=e=>{const{blockProps:l,styles:r}=e;return w.createElement("hr",{...r,...l})},oe={type:"Divider",label:"web_blocks.divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},ie=e=>{const{blockProps:l,inBuilder:r,children:o,globalBlock:s}=e;return r&&!s?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-4 bg-gray-100 rounded-lg gap-y-1 dark:bg-gray-800",...l,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",s]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...l},o)},ne={type:"GlobalBlock",label:"Global Block",icon:S.GlobeIcon,category:"core",group:"advanced",...t.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},N=(e,...l)=>({...e,className:k.cn(e.className,...l)}),ae=e=>{const{blockProps:l,icon:r,styles:o,width:s,inBuilder:n,height:a}=e,d=N(o,"");if(m.isEmpty(r))return i.jsxRuntimeExports.jsx(j,{inBuilder:n,className:"h-8 w-14"});const c=r.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...l,...d,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:c}})},ce={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),icon:{type:"string",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>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},de=e=>{const{blockProps:l,image:r,mobileImage:o,styles:s,alt:n,height:a,width:d,lazyLoading:c}=e;return m.isEmpty(r)?i.jsxRuntimeExports.jsx(j,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[o&&i.jsxRuntimeExports.jsx("source",{srcSet:o,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...l,...s,src:r,alt:n,loading:c?"lazy":"eager",width:d,height:a})]})},ue={type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),image:{type:"string",title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas",ui:{"ui:widget":"image"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0},width:{type:"number",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"number",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}}}}),aiProps:["alt"],i18nProps:["alt"]},pe=e=>{const{blockProps:l,children:r,styles:o,inBuilder:s,content:n,href:a}=e,{hrefType:d,autoplay:c,maxWidth:p,backdropColor:g,galleryName:h}=e,u=N(o,"cb-lightbox");if(!r&&m.isEmpty(o==null?void 0:o.className)&&m.isEmpty(n))return i.jsxRuntimeExports.jsx(j,{inBuilder:s});if(s)return r?i.jsxRuntimeExports.jsx("span",{...l,...u,children:r}):b.createElement("span",{...l,...u,dangerouslySetInnerHTML:{__html:n}});const x={};return d!=="image"&&(x["data-vbtype"]=d),c&&(x["data-autoplay"]="true"),p&&(x["data-maxwidth"]=p+"px"),g&&(x["data-overlay"]=g),h&&(x["data-gall"]=h),r?i.jsxRuntimeExports.jsx("a",{"aria-label":n,...x,href:a||"#/",...l,...u,children:r}):b.createElement("a",{...l,...u,...x,href:a||"#",dangerouslySetInnerHTML:{__html:n},"aria-label":n})},ge={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:y.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},hrefType:{type:"string",title:"Type",default:"image",enum:["image","video","iframe","inline","ajax"],enumNames:["Image","Video","Iframe","Inline","Ajax"]},href:{type:"string",title:"Href",default:""},autoplay:{type:"boolean",title:"Autoplay (Video only)",default:!1},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}},dependencies:{autoplay:["hrefType","video"]}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},me=e=>{const{blockProps:l,link:r,children:o,styles:s,inBuilder:n,content:a}=e;let d={};return!o&&m.isEmpty(a)&&(d={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?o?i.jsxRuntimeExports.jsx("span",{...l,style:d,...s,children:o}):w.createElement("span",{...l,...s,style:d},a):o?i.jsxRuntimeExports.jsx("a",{"aria-label":a,href:(r==null?void 0:r.href)||"#/",target:r==null?void 0:r.target,...l,...s,children:o}):w.createElement("a",{...l,...s,href:(r==null?void 0:r.href)||"#",target:(r==null?void 0:r.target)||"_self","aria-label":a},a)},he={type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},ye=e=>{const{blockProps:l,children:r,listType:o,styles:s,tag:n,inBuilder:a}=e,d=k.cn(m.get(s,"className",""),o);return!r&&m.isEmpty(s==null?void 0:s.className)?i.jsxRuntimeExports.jsx(j,{inBuilder:a}):b.createElement(n||(o==="list-decimal"?"ol":"ul"),{...l,...s,className:d},r)},xe={type:"List",label:"web_blocks.list",icon:y.RowsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),listType:{type:"string",title:"List Type",default:"list-none",oneOf:[{enum:["list-none"],title:"List None"},{enum:["list-disc"],title:"Disc"},{enum:["list-decimal"],title:"Decimal"}]}}}),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"}]},fe=e=>{const{blockProps:l,content:r,styles:o,children:s,tag:n}=e;return s?b.createElement(n||"li",{...o,...l},s):b.createElement(n||"li",{...o,...l,dangerouslySetInnerHTML:{__html:r}})},be={type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ke=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Se={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,R=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,L=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,Be=e=>{if(I.test(e)){const l=e.match(I);return l?`https://www.youtube.com/embed/${l[4]}`:e}if(R.test(e)){const l=e.match(R);return l?`https://player.vimeo.com/video/${l[3]}`:e}if(L.test(e)){const l=e.match(L);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:e}return null},we=b.memo(e=>{const{blockProps:l,inBuilder:r,styles:o,url:s,controls:n}=e,a=m.get(n,"autoPlay",!1),d=m.get(n,"controls",!1),c=a||m.get(n,"muted",!0),p=m.get(n,"loop",!1);if(m.isEmpty(s))return i.jsxRuntimeExports.jsx(j,{inBuilder:r,className:"h-36"});let g=Be(s),h=null;if(g){if(!m.isEmpty(g)){const u=[];u.push(`autoplay=${a?1:0}`),u.push(`controls=${n?1:0}`),u.push(`mute=${c?1:0}&muted=${c?1:0}`),u.push(`loop=${p?1:0}`),g=`${g}?${u.join("&")}`}h=b.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:g,allow:r?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=b.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:s,controls:d,muted:c,autoPlay:r?!1:a,loop:p});return i.jsxRuntimeExports.jsx("div",{...m.pick(o,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[r?i.jsxRuntimeExports.jsx("div",{...l,...m.omit(o,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})}),je={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),url:{type:"string",title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"},controls:{type:"object",title:"Controls",default:{autoplay:!1,controls:!0,loop:!1,muted:!1},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}}}}),i18nProps:["url"]},_={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false","x-cloak":"","x-transition":""}},Ce=e=>{const{blockProps:l,content:r,icon:o,iconWidth:s,iconHeight:n,styles:a,show:d}=e;return i.jsxRuntimeExports.jsxs("button",{"aria-label":r,...l,...a,..._.button,children:[r,i.jsxRuntimeExports.jsx("span",{className:d?"rotate-180":"",dangerouslySetInnerHTML:{__html:o},style:{width:s,height:n}})]})};t.registerChaiBlock(Ce,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),content:{type:"string",title:"Title",default:"Menu Item"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconWidth:{type:"string",title:"Icon Width",default:"16px"},iconHeight:{type:"string",title:"Icon Height",default:"16px"},styles:t.StylesProp("flex items-center gap-2 px-4 py-1")}}),i18nProps:["content"],aiProps:["content"]});const ve=e=>{const{blockProps:l,children:r,styles:o,show:s,inBuilder:n}=e;return n&&!s?null:i.jsxRuntimeExports.jsx("div",{...l,..._.menu,...o,children:r})};t.registerChaiBlock(ve,{type:"DropdownContent",label:"Dropdown Content",group:"basic",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),styles:t.StylesProp("absolute left-0 p-2 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const Pe=e=>{const{blockProps:l,children:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{...l,...o,..._.wrapper,children:r})},_e={type:"Dropdown",label:"Dropdown",group:"basic",icon:y.DropdownMenuIcon,blocks:()=>[{_type:"Dropdown",_id:"dropdown"},{_type:"DropdownButton",_id:"button",_parent:"dropdown",title:"Menu Item",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24"> <path d="M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"/> </svg>',styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownContent",_id:"content",_parent:"dropdown",styles:"#styles:,absolute left-0 w-80 mt-0.5 bg-white rounded-lg shadow-lg z-50"},{_type:"Link",_id:"link",_parent:"content",content:"Link",styles:"#styles:,flex items-center gap-2 px-4 py-1",link:{href:"https://www.google.com",type:"url",target:"_self"}}],category:"core",wrapper:!0,...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ee=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"checkbox",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"checkbox",required:a,name:r})},Ie={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},Re=e=>{const{children:l,blockProps:r,errorMessage:o,successMessage:s,action:n,styles:a,inBuilder:d}=e;let c=l;l||(c=i.jsxRuntimeExports.jsx(j,{inBuilder:d}));const p={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":o,"data-success":s,method:"post",action:n,...r,...a,children:[i.jsxRuntimeExports.jsx("div",{...g}),c]})},Le={type:"Form",label:"Form",category:"core",icon:S.GroupIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form/submit"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},Ne=e=>{const{blockProps:l,inBuilder:r,label:o,styles:s,inputStyles:n,icon:a,iconSize:d,iconPos:c}=e,p=k.generateUUID(),g={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:p,...g,...n,...s,...l||{},type:r?"button":"submit","aria-label":o,children:[o,a&&i.jsxRuntimeExports.jsx("div",{style:{width:d+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Me={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},De=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,showLabel:d,required:c,inputType:p}=e,g=k.generateUUID();return d?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[d&&i.jsxRuntimeExports.jsx("label",{htmlFor:g,children:o}),i.jsxRuntimeExports.jsx("input",{name:r,...a,id:g,type:p,placeholder:s,required:c})]}):i.jsxRuntimeExports.jsx("input",{id:g,name:r,...l,...a,...n,type:p,placeholder:s,required:c})},$e={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},inputType:{type:"string",title:"Input Type",default:"text",enum:["text","email","password","number","tel","file","hidden","range","submit","color","date","time"]}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Te=e=>{const{blockProps:l,content:r,styles:o,children:s}=e,n={...o,...l};return s?b.createElement("label",n,s):b.createElement("label",{...n,dangerouslySetInnerHTML:{__html:r}})},Ae={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},ze=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"radio",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"radio",required:a,checked:d,name:r})},He={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},qe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,required:d,showLabel:c,_multiple:p,options:g}=e,h=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),i.jsxRuntimeExports.jsxs("select",{...a,id:h,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:h,...n,...l,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},Ue={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Oe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,_rows:d,showLabel:c}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o}),i.jsxRuntimeExports.jsx("textarea",{name:r,...a,id:p,placeholder:s,rows:d})]}):i.jsxRuntimeExports.jsx("textarea",{id:p,name:r,...l,...a,...n,placeholder:s,rows:d})},Fe={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},_rows:{type:"number",title:"Rows",default:3}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Ge=e=>{const{blockProps:l,backgroundImage:r,children:o,styles:s,tag:n}=e;let a={};return r&&(a={backgroundImage:`url(${r})`}),w.createElement(n||"div",{...l,...s,style:a},o)},Ve={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("font-body antialiased"),backgroundImage:{type:"string",title:"Image",default:"",ui:{"ui:widget":"image"}},tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]}}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},We=e=>{const{blockProps:l,styles:r}=e;return w.createElement("br",{...l,...r})},Xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},P={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},Ye=e=>{const{blockProps:l,children:r,styles:o,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,c={className:[m.get(o,"className",""),m.get(P,["SMALL",isNaN(s)||!s?6:s],""),n?m.get(P,["MEDIUM",n||s],""):"",a?m.get(P,["LARGE",n||s],""):""].join(" ")};return i.jsxRuntimeExports.jsx("div",{...l,...o,...c,children:r||i.jsxRuntimeExports.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Ze={type:"Column",label:"Column",group:"basic",category:"core",icon:S.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Je=e=>{const{blockProps:l,children:r,styles:o,gutter:s}=e,a={className:[m.get(o,"className","")," grid grid-cols-12"].join()};return typeof(o==null?void 0:o.style)=="object"?o.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsxRuntimeExports.jsx("div",{...l,...o,...a,children:r})},Ke={type:"Row",label:"Row",group:"basic",icon:S.Rows,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},C=(e,l)=>({slider:{"x-data":`{
|
|
3
|
+
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},W=e=>{const{blockProps:r,content:l,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...r,...o,dangerouslySetInnerHTML:{__html:l}})})},X={type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Y=e=>{const{blockProps:r,styles:l,content:o,children:s=null,tag:n}=e;return s?b.createElement("span",{...l,...r},s):b.createElement(n||"span",{...l,...r,dangerouslySetInnerHTML:{__html:o||""}})},Z={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};function J(e){return k.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 K=e=>{const{scripts:r,inBuilder:l,blockProps:o}=e;return l?i.jsxRuntimeExports.jsx("div",{...o,children:i.jsxRuntimeExports.jsx("div",{className:k.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:r}})},Q={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:J,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},ee=e=>i.jsxRuntimeExports.jsxs("div",{...e.blockProps,...e.styles,children:[e.mode,e.children]}),te=e=>e.mode==="dark"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"dark mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(te,{type:"DarkModeButton",label:"Dark Mode Button",category:"core",icon:y.MoonIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp("")}})});const re=e=>e.mode==="light"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"light mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(re,{type:"LightModeButton",label:"Light Mode Button",category:"core",icon:y.SunIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp(""),fake:{type:"string",default:""}}})});const le={type:"DarkModeSwitcher",label:"web_blocks.dark_mode",category:"core",icon:y.MoonIcon,group:"advanced",wrapper:!0,...t.registerChaiBlockSchema({properties:{mode:{title:"Mode",type:"string",enum:["dark","light"],default:"light"},styles:t.stylesProp("")}}),blocks:()=>[{_id:"ultqCh",_type:"DarkModeSwitcher",mode:"light",styles:"#styles:,",_name:"Dark Mode Theme"},{_id:"vroabi",_parent:"ultqCh",_type:"LightModeButton",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:"nltBrv",_parent:"vroabi",_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:"DarkModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white hidden 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:"AdDwBC",_parent:"gesydi",_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>"}]},se=e=>{const{blockProps:r,styles:l}=e;return w.createElement("hr",{...l,...r})},oe={type:"Divider",label:"web_blocks.divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},ie=e=>{const{blockProps:r,inBuilder:l,children:o,globalBlock:s}=e;return l&&!s?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-4 bg-gray-100 rounded-lg gap-y-1 dark:bg-gray-800",...r,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",s]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...r},o)},ne={type:"GlobalBlock",label:"Global Block",icon:S.GlobeIcon,category:"core",group:"advanced",...t.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},N=(e,...r)=>({...e,className:k.cn(e.className,...r)}),ae=e=>{const{blockProps:r,icon:l,styles:o,width:s,inBuilder:n,height:a}=e,d=N(o,"");if(m.isEmpty(l))return i.jsxRuntimeExports.jsx(j,{inBuilder:n,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...r,...d,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:c}})},ce={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),icon:{type:"string",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>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},de=e=>{const{blockProps:r,image:l,mobileImage:o,styles:s,alt:n,height:a,width:d,lazyLoading:c}=e;return m.isEmpty(l)?i.jsxRuntimeExports.jsx(j,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[o&&i.jsxRuntimeExports.jsx("source",{srcSet:o,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...r,...s,src:l,alt:n,loading:c?"lazy":"eager",width:d,height:a})]})},ue={type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),image:{type:"string",title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas",ui:{"ui:widget":"image"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0},width:{type:"number",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"number",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}}}}),aiProps:["alt"],i18nProps:["alt"]},pe=e=>{const{blockProps:r,children:l,styles:o,inBuilder:s,content:n,href:a}=e,{hrefType:d,autoplay:c,maxWidth:p,backdropColor:g,galleryName:h}=e,u=N(o,"cb-lightbox");if(!l&&m.isEmpty(o==null?void 0:o.className)&&m.isEmpty(n))return i.jsxRuntimeExports.jsx(j,{inBuilder:s});if(s)return l?i.jsxRuntimeExports.jsx("span",{...r,...u,children:l}):b.createElement("span",{...r,...u,dangerouslySetInnerHTML:{__html:n}});const x={};return d!=="image"&&(x["data-vbtype"]=d),c&&(x["data-autoplay"]="true"),p&&(x["data-maxwidth"]=p+"px"),g&&(x["data-overlay"]=g),h&&(x["data-gall"]=h),l?i.jsxRuntimeExports.jsx("a",{"aria-label":n,...x,href:a||"#/",...r,...u,children:l}):b.createElement("a",{...r,...u,...x,href:a||"#",dangerouslySetInnerHTML:{__html:n},"aria-label":n})},ge={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:y.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},hrefType:{type:"string",title:"Type",default:"image",enum:["image","video","iframe","inline","ajax"],enumNames:["Image","Video","Iframe","Inline","Ajax"]},href:{type:"string",title:"Href",default:""},autoplay:{type:"boolean",title:"Autoplay (Video only)",default:!1},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}},dependencies:{autoplay:["hrefType","video"]}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},me=e=>{const{blockProps:r,link:l,children:o,styles:s,inBuilder:n,content:a}=e;let d={};return!o&&m.isEmpty(a)&&(d={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?o?i.jsxRuntimeExports.jsx("span",{...r,style:d,...s,children:o}):w.createElement("span",{...r,...s,style:d},a):o?i.jsxRuntimeExports.jsx("a",{"aria-label":a,href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...r,...s,children:o}):w.createElement("a",{...r,...s,href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self","aria-label":a},a)},he={type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},ye=e=>{const{blockProps:r,children:l,listType:o,styles:s,tag:n,inBuilder:a}=e,d=k.cn(m.get(s,"className",""),o);return!l&&m.isEmpty(s==null?void 0:s.className)?i.jsxRuntimeExports.jsx(j,{inBuilder:a}):b.createElement(n||(o==="list-decimal"?"ol":"ul"),{...r,...s,className:d},l)},xe={type:"List",label:"web_blocks.list",icon:y.RowsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),listType:{type:"string",title:"List Type",default:"list-none",oneOf:[{enum:["list-none"],title:"List None"},{enum:["list-disc"],title:"Disc"},{enum:["list-decimal"],title:"Decimal"}]}}}),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"}]},fe=e=>{const{blockProps:r,content:l,styles:o,children:s,tag:n}=e;return s?b.createElement(n||"li",{...o,...r},s):b.createElement(n||"li",{...o,...r,dangerouslySetInnerHTML:{__html:l}})},be={type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ke=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Se={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,R=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,L=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,Be=e=>{if(I.test(e)){const r=e.match(I);return r?`https://www.youtube.com/embed/${r[4]}`:e}if(R.test(e)){const r=e.match(R);return r?`https://player.vimeo.com/video/${r[3]}`:e}if(L.test(e)){const r=e.match(L);return r?`https://www.dailymotion.com/embed/video/${r[4]}`:e}return null},we=b.memo(e=>{const{blockProps:r,inBuilder:l,styles:o,url:s,controls:n}=e,a=m.get(n,"autoPlay",!1),d=m.get(n,"controls",!1),c=a||m.get(n,"muted",!0),p=m.get(n,"loop",!1);if(m.isEmpty(s))return i.jsxRuntimeExports.jsx(j,{inBuilder:l,className:"h-36"});let g=Be(s),h=null;if(g){if(!m.isEmpty(g)){const u=[];u.push(`autoplay=${a?1:0}`),u.push(`controls=${n?1:0}`),u.push(`mute=${c?1:0}&muted=${c?1:0}`),u.push(`loop=${p?1:0}`),g=`${g}?${u.join("&")}`}h=b.createElement("iframe",{...r,className:"absolute inset-0 w-full h-full",src:g,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=b.createElement("video",{...r,className:"absolute inset-0 w-full h-full",src:s,controls:d,muted:c,autoPlay:l?!1:a,loop:p});return i.jsxRuntimeExports.jsx("div",{...m.pick(o,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?i.jsxRuntimeExports.jsx("div",{...r,...m.omit(o,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})}),je={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),url:{type:"string",title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"},controls:{type:"object",title:"Controls",default:{autoplay:!1,controls:!0,loop:!1,muted:!1},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}}}}),i18nProps:["url"]},_={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false","x-cloak":"","x-transition":""}},Ce=e=>{const{blockProps:r,content:l,icon:o,iconWidth:s,iconHeight:n,styles:a,show:d}=e;return i.jsxRuntimeExports.jsxs("button",{"aria-label":l,...r,...a,..._.button,children:[l,i.jsxRuntimeExports.jsx("span",{className:d?"rotate-180":"",dangerouslySetInnerHTML:{__html:o},style:{width:s,height:n}})]})};t.registerChaiBlock(Ce,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),content:{type:"string",title:"Title",default:"Menu Item"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconWidth:{type:"string",title:"Icon Width",default:"16px"},iconHeight:{type:"string",title:"Icon Height",default:"16px"},styles:t.StylesProp("flex items-center gap-2 px-4 py-1")}}),i18nProps:["content"],aiProps:["content"]});const ve=e=>{const{blockProps:r,children:l,styles:o,show:s,inBuilder:n}=e;return n&&!s?null:i.jsxRuntimeExports.jsx("div",{...r,..._.menu,...o,children:l})};t.registerChaiBlock(ve,{type:"DropdownContent",label:"Dropdown Content",group:"basic",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),styles:t.StylesProp("absolute left-0 p-2 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const Pe=e=>{const{blockProps:r,children:l,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{...r,...o,..._.wrapper,children:l})},_e={type:"Dropdown",label:"Dropdown",group:"basic",icon:y.DropdownMenuIcon,blocks:()=>[{_type:"Dropdown",_id:"dropdown"},{_type:"DropdownButton",_id:"button",_parent:"dropdown",title:"Menu Item",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24"> <path d="M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"/> </svg>',styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownContent",_id:"content",_parent:"dropdown",styles:"#styles:,absolute left-0 w-80 mt-0.5 bg-white rounded-lg shadow-lg z-50"},{_type:"Link",_id:"link",_parent:"content",content:"Link",styles:"#styles:,flex items-center gap-2 px-4 py-1",link:{href:"https://www.google.com",type:"url",target:"_self"}}],category:"core",wrapper:!0,...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ee=e=>{const{blockProps:r,fieldName:l,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:p,type:"checkbox",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...r,...n,...s,type:"checkbox",required:a,name:l})},Ie={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},Re=e=>{const{children:r,blockProps:l,errorMessage:o,successMessage:s,action:n,styles:a,inBuilder:d}=e;let c=r;r||(c=i.jsxRuntimeExports.jsx(j,{inBuilder:d}));const p={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":o,"data-success":s,method:"post",action:n,...l,...a,children:[i.jsxRuntimeExports.jsx("div",{...g}),c]})},Le={type:"Form",label:"Form",category:"core",icon:S.GroupIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form/submit"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},Ne=e=>{const{blockProps:r,inBuilder:l,label:o,styles:s,inputStyles:n,icon:a,iconSize:d,iconPos:c}=e,p=k.generateUUID(),g={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:p,...g,...n,...s,...r||{},type:l?"button":"submit","aria-label":o,children:[o,a&&i.jsxRuntimeExports.jsx("div",{style:{width:d+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Me={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},De=e=>{const{blockProps:r,fieldName:l,label:o,placeholder:s,styles:n,inputStyles:a,showLabel:d,required:c,inputType:p}=e,g=k.generateUUID();return d?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[d&&i.jsxRuntimeExports.jsx("label",{htmlFor:g,children:o}),i.jsxRuntimeExports.jsx("input",{name:l,...a,id:g,type:p,placeholder:s,required:c})]}):i.jsxRuntimeExports.jsx("input",{id:g,name:l,...r,...a,...n,type:p,placeholder:s,required:c})},$e={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},inputType:{type:"string",title:"Input Type",default:"text",enum:["text","email","password","number","tel","file","hidden","range","submit","color","date","time"]}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Te=e=>{const{blockProps:r,content:l,styles:o,children:s}=e,n={...o,...r};return s?b.createElement("label",n,s):b.createElement("label",{...n,dangerouslySetInnerHTML:{__html:l}})},Ae={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ze=e=>{const{blockProps:r,fieldName:l,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:l,id:p,type:"radio",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...r,...n,...s,type:"radio",required:a,checked:d,name:l})},He={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},qe=e=>{const{blockProps:r,fieldName:l,label:o,placeholder:s,styles:n,inputStyles:a,required:d,showLabel:c,_multiple:p,options:g}=e,h=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),i.jsxRuntimeExports.jsxs("select",{...a,id:h,required:d,multiple:p,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:h,...n,...r,required:d,multiple:p,name:l,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},Ue={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Oe=e=>{const{blockProps:r,fieldName:l,label:o,placeholder:s,styles:n,inputStyles:a,_rows:d,showLabel:c}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o}),i.jsxRuntimeExports.jsx("textarea",{name:l,...a,id:p,placeholder:s,rows:d})]}):i.jsxRuntimeExports.jsx("textarea",{id:p,name:l,...r,...a,...n,placeholder:s,rows:d})},Fe={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},_rows:{type:"number",title:"Rows",default:3}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Ge=e=>{const{blockProps:r,backgroundImage:l,children:o,styles:s,tag:n}=e;let a={};return l&&(a={backgroundImage:`url(${l})`}),w.createElement(n||"div",{...r,...s,style:a},o)},Ve={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("font-body antialiased"),backgroundImage:{type:"string",title:"Image",default:"",ui:{"ui:widget":"image"}},tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]}}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},We=e=>{const{blockProps:r,styles:l}=e;return w.createElement("br",{...r,...l})},Xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},P={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},Ye=e=>{const{blockProps:r,children:l,styles:o,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,c={className:[m.get(o,"className",""),m.get(P,["SMALL",isNaN(s)||!s?6:s],""),n?m.get(P,["MEDIUM",n||s],""):"",a?m.get(P,["LARGE",n||s],""):""].join(" ")};return i.jsxRuntimeExports.jsx("div",{...r,...o,...c,children:l||i.jsxRuntimeExports.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Ze={type:"Column",label:"Column",group:"basic",category:"core",icon:S.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Je=e=>{const{blockProps:r,children:l,styles:o,gutter:s}=e,a={className:[m.get(o,"className","")," grid grid-cols-12"].join()};return typeof(o==null?void 0:o.style)=="object"?o.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsxRuntimeExports.jsx("div",{...r,...o,...a,children:l})},Ke={type:"Row",label:"Row",group:"basic",icon:S.Rows,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},C=(e,r)=>({slider:{"x-data":`{
|
|
4
4
|
currentSlide: 0,
|
|
5
|
-
totalSlides: ${(
|
|
6
|
-
autoplay: ${!!(
|
|
5
|
+
totalSlides: ${(r==null?void 0:r.totalSlides)||0},
|
|
6
|
+
autoplay: ${!!(r!=null&&r.autoplay)},
|
|
7
7
|
autoplayInterval: null,
|
|
8
8
|
init() {
|
|
9
9
|
if (this.autoplay) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
startAutoplay() {
|
|
14
14
|
this.autoplayInterval = setInterval(() => {
|
|
15
15
|
this.nextSlide();
|
|
16
|
-
}, ${isNaN(
|
|
16
|
+
}, ${isNaN(r==null?void 0:r.autoplayInterval)?3e3:(r==null?void 0:r.autoplayInterval)*1e3});
|
|
17
17
|
},
|
|
18
18
|
stopAutoplay() {
|
|
19
19
|
clearInterval(this.autoplayInterval);
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
updateCurrentSlide(slide) {
|
|
28
28
|
this.currentSlide = slide;
|
|
29
29
|
},
|
|
30
|
-
}`},slides:{":style":"'transform: translateX(-' + currentSlide * 100 + '%)'"},prevButton:{"x-on:click":"stopAutoplay(); prevSlide();"},nextButton:{"x-on:click":"stopAutoplay(); nextSlide();"},sliderNav:{":class":`currentSlide === ${
|
|
30
|
+
}`},slides:{":style":"'transform: translateX(-' + currentSlide * 100 + '%)'"},prevButton:{"x-on:click":"stopAutoplay(); prevSlide();"},nextButton:{"x-on:click":"stopAutoplay(); nextSlide();"},sliderNav:{":class":`currentSlide === ${r==null?void 0:r.slide} ? '${r==null?void 0:r.activeDotClassName}' : '${r==null?void 0:r.className}'`,"x-on:click":`stopAutoplay(); updateCurrentSlide(${r==null?void 0:r.slide});`}})[e]||{},Qe=e=>{const{blockProps:r,styles:l,children:o,slider:s}=e;return!(s!=null&&s.showSlideButton)&&typeof(s==null?void 0:s.showSlideButton)=="boolean"?null:i.jsxRuntimeExports.jsx("div",{...r,...l,...C("prevButton"),children:o})};t.registerChaiBlock(Qe,{type:"SlidePreviousButton",label:"Slide Previous",group:"basic",category:"core",icon:S.PanelRightOpen,canDelete:()=>!1,canAcceptBlock:()=>!0,canBeNested:e=>e==="Slider",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("h-max w-max absolute left-0 top-1/2 -translate-y-1/2 flex items-center justify-center p-2 cursor-pointer"),slider:t.closestBlockProp("Slider","slider")}})});const et=e=>{const{blockProps:r,styles:l,children:o,slider:s}=e;return!(s!=null&&s.showSlideButton)&&typeof(s==null?void 0:s.showSlideButton)=="boolean"?null:i.jsxRuntimeExports.jsx("div",{...r,...l,...C("nextButton"),children:o})};t.registerChaiBlock(et,{type:"SlideNextButton",label:"Slide Next",group:"basic",category:"core",icon:S.PanelRightClose,canDelete:()=>!1,canAcceptBlock:()=>!0,canBeNested:e=>e==="Slider",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("h-max w-max absolute right-0 top-1/2 -translate-y-1/2 flex items-center justify-center p-2 cursor-pointer"),slider:t.closestBlockProp("Slider","slider")}})});const tt=e=>{var a,d,c,p,g;const{blockProps:r,styles:l,children:o=null,inBuilder:s,slider:n}=e;if(s){const h=((d=(a=e==null?void 0:e.children)==null?void 0:a.props)==null?void 0:d.allBlocks)||((p=(c=e==null?void 0:e.children)==null?void 0:c.props)==null?void 0:p.blocks)||[],u=n==null?void 0:n.currentSlide,x=(g=h==null?void 0:h.filter(B=>(B==null?void 0:B._parent)===(e==null?void 0:e._id)))==null?void 0:g.findIndex(B=>(B==null?void 0:B._id)===u);return i.jsxRuntimeExports.jsx("div",{...r,...l,style:{transform:`translateX(-${Math.max(0,x)*100}%)`},children:o||i.jsxRuntimeExports.jsx("div",{className:"h-full p-2",children:i.jsxRuntimeExports.jsx("div",{className:"h-full border-2 border-dashed"})})})}return i.jsxRuntimeExports.jsx("div",{...r,...l,...C("slides"),children:o||i.jsxRuntimeExports.jsx("div",{className:"h-full p-2",children:i.jsxRuntimeExports.jsx("div",{className:"h-full border-2 border-dashed"})})})};t.registerChaiBlock(tt,{type:"Slides",label:"Slides",group:"basic",category:"core",icon:S.AlignHorizontalJustifyStart,canDelete:()=>!1,canAcceptBlock:e=>e==="Slide",canBeNested:e=>e==="Slider",...t.registerChaiBlockSchema({properties:{slider:t.closestBlockProp("Slider","slider"),styles:t.StylesProp("h-full flex transition-transform duration-500 ease-in-out")}})});const rt=e=>{const{blockProps:r,styles:l,children:o=null}=e;return i.jsxRuntimeExports.jsx("div",{...r,...l,children:o||i.jsxRuntimeExports.jsxs("div",{className:"flex h-full min-w-full items-center justify-center",children:["Slide ",(e==null?void 0:e.index)+1]})})};t.registerChaiBlock(rt,{type:"Slide",label:"Slide",group:"basic",category:"core",icon:S.AppWindowIcon,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Slides",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("min-w-full h-full")}})});const lt=e=>{var u,x,B,E;const{blockProps:r,styles:l,dotStyles:o,activeDotStyles:s,slider:n,inBuilder:a,children:d}=e;if(!(n!=null&&n.showSlideNavbar)&&typeof(n==null?void 0:n.showSlideNavbar)=="boolean")return null;const c=((x=(u=e==null?void 0:e.children)==null?void 0:u.props)==null?void 0:x.allBlocks)||((E=(B=e==null?void 0:e.children)==null?void 0:B.props)==null?void 0:E.blocks)||[],p=c==null?void 0:c.find(f=>(f==null?void 0:f._id)===(e==null?void 0:e._id)),g=c==null?void 0:c.find(f=>(f==null?void 0:f._parent)===(p==null?void 0:p._parent)&&(f==null?void 0:f._type)==="Slides"),h=c==null?void 0:c.filter(f=>(f==null?void 0:f._parent)===(g==null?void 0:g._id));return a?i.jsxRuntimeExports.jsx("div",{...r,...l,children:h==null?void 0:h.map((f,v)=>i.jsxRuntimeExports.jsx("div",{...o,...n!=null&&n.currentSlide?(f==null?void 0:f._id)===(n==null?void 0:n.currentSlide)?s:{}:v===0?s:{},children:d}))}):i.jsxRuntimeExports.jsx("div",{...r,...l,children:h==null?void 0:h.map((f,v)=>i.jsxRuntimeExports.jsx("div",{...C("sliderNav",{slide:v,className:o==null?void 0:o.className,activeDotClassName:(s==null?void 0:s.className)??""})},f==null?void 0:f._id))})};t.registerChaiBlock(lt,{type:"SliderNav",label:"Slider Navigation",group:"basic",category:"core",icon:S.PanelRightOpen,canDelete:()=>!1,canAcceptBlock:()=>!1,canBeNested:e=>e==="Slider",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("w-full absolute left-0 bottom-0 flex items-center justify-center gap-x-2 p-2"),dotStyles:t.StylesProp("w-4 h-4 border border-gray-500 rounded-full cursor-pointer"),activeDotStyles:t.StylesProp("w-4 h-4 rounded-full bg-blue-500"),slider:t.closestBlockProp("Slider","slider")}})});const st=()=>null;t.registerChaiBlock(st,{type:"SliderNavItem",label:"Slider Nav Item",group:"basic",category:"core",hidden:!0,icon:S.PanelRightOpen,canDelete:()=>!1,canDuplicate:()=>!1,canAcceptBlock:()=>!1,canBeNested:e=>e==="SliderNav",...t.registerChaiBlockSchema({properties:{}})});const ot=e=>{var c,p,g,h,u;const{blockProps:r,styles:l,children:o=null}=e,s=((p=(c=e==null?void 0:e.children)==null?void 0:c.props)==null?void 0:p.allBlocks)||((h=(g=e==null?void 0:e.children)==null?void 0:g.props)==null?void 0:h.blocks)||[],n=s==null?void 0:s.find(x=>(x==null?void 0:x._parent)===(e==null?void 0:e._id)&&(x==null?void 0:x._type)==="Slides"),d={totalSlides:((u=s==null?void 0:s.filter(x=>(x==null?void 0:x._parent)===(n==null?void 0:n._id)))==null?void 0:u.length)||0,...typeof e.slider=="object"?e.slider:{}};return i.jsxRuntimeExports.jsx("div",{...r,...l,...C("slider",d),children:o||i.jsxRuntimeExports.jsx("div",{className:"h-[60vh] p-2",children:i.jsxRuntimeExports.jsx("div",{className:"h-full border-2 border-dashed"})})})},it={type:"Slider",label:"Slider",category:"core",icon:S.UnfoldHorizontal,group:"basic",wrapper:!0,blocks:()=>[{_type:"Slider",_id:"slider"},{_type:"Slides",_id:"slider-slides",_parent:"slider"},{_type:"Slide",_id:"slider-slides-slide-1",_parent:"slider-slides"},{_type:"Slide",_id:"slider-slides-slide-2",_parent:"slider-slides"},{_type:"Slide",_id:"slider-slides-slide-3",_parent:"slider-slides"},{_type:"SlidePreviousButton",_parent:"slider",_id:"slider-left-arrow"},{_type:"Icon",_id:"slider-left-arrow-content",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 320 512"><path d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"/></svg>',_parent:"slider-left-arrow"},{_type:"SlideNextButton",_parent:"slider",_id:"slider-right-arrow"},{_type:"Icon",_id:"slider-right-arrow-content",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 320 512"><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg>',_parent:"slider-right-arrow"},{_type:"SliderNav",_parent:"slider",_id:"slider-nav"},{_type:"SliderNavItem",_parent:"slider-nav",_id:"slider-nav-item"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("w-full h-[60vh] relative overflow-x-hidden"),slider:t.runtimeProp({type:"object",properties:{},default:{currentSlide:null,autoplay:!1,autoplayInterval:2,showSlideButton:!0,showSlideNavbar:!0},ui:{"ui:field":"slider"}})}})},nt=()=>{t.registerChaiBlock(D,$),t.registerChaiBlock(q,U),t.registerChaiBlock(T,A),t.registerChaiBlock(O,F),t.registerChaiBlock(G,V),t.registerChaiBlock(Y,Z),t.registerChaiBlock(W,X),t.registerChaiBlock(me,he),t.registerChaiBlock(pe,ge),t.registerChaiBlock(ye,xe),t.registerChaiBlock(fe,be),t.registerChaiBlock(ae,ce),t.registerChaiBlock(de,ue),t.registerChaiBlock(we,je),t.registerChaiBlock(z,H),t.registerChaiBlock(K,Q),t.registerChaiBlock(ke,Se),t.registerChaiBlock(Re,Le),t.registerChaiBlock(Ne,Me),t.registerChaiBlock(De,$e),t.registerChaiBlock(Ee,Ie),t.registerChaiBlock(ze,He),t.registerChaiBlock(qe,Ue),t.registerChaiBlock(Oe,Fe),t.registerChaiBlock(Te,Ae),t.registerChaiBlock(We,Xe),t.registerChaiBlock(Ge,Ve),t.registerChaiBlock(se,oe),t.registerChaiBlock(ee,le),t.registerChaiBlock(ie,ne),t.registerChaiBlock(Pe,_e),t.registerChaiBlock(Je,Ke),t.registerChaiBlock(Ye,Ze),t.registerChaiBlock(ot,it)};exports.loadWebBlocks=nt;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1284,7 +1284,9 @@ const ut = (e) => {
|
|
|
1284
1284
|
default: ""
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
})
|
|
1287
|
+
}),
|
|
1288
|
+
aiProps: ["content"],
|
|
1289
|
+
i18nProps: ["content"]
|
|
1288
1290
|
}, St = (e) => {
|
|
1289
1291
|
const { blockProps: t, fieldName: l, label: n, styles: r, inputStyles: s, required: i, checked: c, showLabel: a = !0 } = e, g = I();
|
|
1290
1292
|
return a ? /* @__PURE__ */ o.jsxs("div", { ...r, ...t, children: [
|