@chaibuilder/sdk 2.0.0-beta.23 → 2.0.0-beta.24
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 +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +25 -45
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -3660,8 +3660,8 @@ const pubsub = new PubSub(), BlockActionLabel = ({ block: o, label: r }) => {
|
|
|
3660
3660
|
return i[a];
|
|
3661
3661
|
};
|
|
3662
3662
|
function AsyncPropsBlock(o) {
|
|
3663
|
-
const r = useMemo(() =>
|
|
3664
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(o.component, { ...o.props, ...
|
|
3663
|
+
const { dataProvider: r, block: n } = o, a = useMemo(() => r ? r({ block: n }) : {}, [n, r]);
|
|
3664
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(o.component, { ...o.props, ...a }) });
|
|
3665
3665
|
}
|
|
3666
3666
|
function RuntimePropsBlock(o) {
|
|
3667
3667
|
const r = useSelectedBlockHierarchy(), n = Object.entries(o.runtimeProps).reduce((a, [l, i]) => {
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),i=require("./jsx-runtime-JYMCiFoE.cjs"),E=require("react"),x=require("./iconBase-aZzpqff_.cjs"),g=require("@radix-ui/react-icons"),y=require("lodash-es"),S=require("lucide-react");require("clsx");require("tailwind-merge");function P(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const d=P(E),I=({className:e="",inBuilder:r})=>r?i.jsxRuntimeExports.jsx("div",{className:x.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,k=I,_=e=>{const{blockProps:r,inBuilder:o,backgroundImage:s,children:l,tag:n="div",styles:a}=e;let c=l;l||(c=i.jsxRuntimeExports.jsx(k,{inBuilder:o}));let p={};return s&&(p={backgroundImage:`url(${s})`}),d.createElement(n,{...r,...a,style:p},c)},L={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},R=e=>{const{blockProps:r,iconSize:o,icon:s,content:l,styles:n,children:a,iconPos:c,link:p,inBuilder:u}=e,h=s,f=a||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:l}),h&&i.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:h}})]}),m=d.createElement("button",{...r,...n,type:"button"},f);return y.isEmpty(y.get(p,"href"))?m:u?i.jsxRuntimeExports.jsx("span",{children:m}):i.jsxRuntimeExports.jsx("a",{href:y.get(p,"href")||"/",target:y.get(p,"target","_self"),children:m})},M={type:"Button",label:"Button",category:"core",icon:g.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:24},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"]},T=e=>{const{blockProps:r,styles:o,htmlCode:s,inBuilder:l}=e;return l?i.jsxRuntimeExports.jsxs("div",{className:"relative",children:[l?i.jsxRuntimeExports.jsx("div",{...r,...o,className:"absolute z-20 h-full w-full"}):null,d.createElement("div",{...o,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):d.createElement("div",{...r,...o,dangerouslySetInnerHTML:{__html:s}})},$={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:g.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"}}}})},D=e=>{const{blockProps:r,styles:o,backgroundImage:s}=e;let l={};return s&&(l={backgroundImage:`url(${s})`}),d.createElement("div",{...r,...o,style:l})},N={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"}}}})},z=e=>{const{blockProps:r,styles:o,content:s,tag:l="h1",children:n=null}=e;return n?d.createElement(l,{...o,...r},n):d.createElement(l,{...o,...r,dangerouslySetInnerHTML:{__html:s}})},H={type:"Heading",label:"web_blocks.heading",category:"core",icon:g.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"},q=e=>{const{blockProps:r,styles:o,content:s}=e;return y.isNull(e.children)?d.createElement("p",{...o,...r,dangerouslySetInnerHTML:{__html:s}}):d.createElement("p",{...o,...r},e.children)},A={type:"Paragraph",label:"Paragraph",category:"core",icon:g.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"},U=e=>{const{blockProps:r,styles:o,content:s,children:l=null,tag:n}=e;return l?d.createElement("span",{...o,...r},l):d.createElement(n||"span",{...o,...r,dangerouslySetInnerHTML:{__html:s||""}})},O={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},F=e=>{const{blockProps:r,content:o,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...r,...s,dangerouslySetInnerHTML:{__html:o}})})},G={type:"RichText",label:"Rich Text",category:"core",icon:g.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"]},V=e=>{const{blockProps:r,link:o,children:s,styles:l,inBuilder:n,content:a}=e;let c={};return!s&&y.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?i.jsxRuntimeExports.jsx("span",{...r,style:c,...l,children:s}):d.createElement("span",{...r,...l,style:c},a):s?i.jsxRuntimeExports.jsx("a",{href:(o==null?void 0:o.href)||"#/",target:o==null?void 0:o.target,...r,...l,children:s}):d.createElement("a",{...r,...l,href:(o==null?void 0:o.href)||"#",target:(o==null?void 0:o.target)||"_self"},a)},W={type:"Link",label:"Link",category:"core",icon:g.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"},v=(e,...r)=>({...e,className:x.cn(e.className,...r)}),X=e=>{const{blockProps:r,children:o,styles:s,inBuilder:l,content:n,href:a}=e,{hrefType:c,autoplay:p,maxWidth:u,backdropColor:h,galleryName:f}=e,m=v(s,"cb-lightbox");if(!o&&y.isEmpty(s==null?void 0:s.className)&&y.isEmpty(n))return i.jsxRuntimeExports.jsx(k,{inBuilder:l});if(l)return o?i.jsxRuntimeExports.jsx("span",{...r,...m,children:o}):d.createElement("span",{...r,...m,dangerouslySetInnerHTML:{__html:n}});const b={};return b["data-vbtype"]=c,p&&(b["data-autoplay"]="true"),u&&(b["data-maxwidth"]=u+"px"),h&&(b["data-overlay"]=h),f&&(b["data-gall"]=f),o?i.jsxRuntimeExports.jsx("a",{...b,href:a||"#/",...r,...m,children:o}):d.createElement("a",{...r,...m,...b,href:a||"#",dangerouslySetInnerHTML:{__html:n}})},Y={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},href:{type:"string",title:"Href",default:""},hrefType:{type:"string",title:"Type",default:"video",oneOf:[{type:"string",title:"Video",enum:["video"]},{type:"string",title:"Iframe",enum:["iframe"]},{type:"string",title:"Inline",enum:["inline"]},{type:"string",title:"Ajax",enum:["ajax"]}]},autoplay:{type:"boolean",title:"Autoplay",default:!1,dependencies:{hrefType:["video"]}},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Z=e=>{const{blockProps:r,children:o,listType:s,styles:l,tag:n,inBuilder:a}=e,c=x.cn(y.get(l,"className",""),s);return!o&&y.isEmpty(l==null?void 0:l.className)?i.jsxRuntimeExports.jsx(k,{inBuilder:a}):d.createElement(n||(s==="list-decimal"?"ol":"ul"),{...r,...l,className:c},o)},J={type:"List",label:"web_blocks.list",icon:g.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"}]},K=e=>{const{blockProps:r,content:o,styles:s,children:l,tag:n}=e;return l?d.createElement(n||"li",{...s,...r},l):d.createElement(n||"li",{...s,...r,dangerouslySetInnerHTML:{__html:o}})},Q={type:"ListItem",label:"List Item",icon:g.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"},ee=e=>{const{blockProps:r,icon:o,styles:s,width:l,inBuilder:n,height:a}=e,c=v(s,x.cn(l?`w-[${l}px]`:"",a?`h-[${a}px]`:""));if(y.isEmpty(o))return i.jsxRuntimeExports.jsx(k,{inBuilder:n,className:"h-8 w-14"});const p=o.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return d.createElement("span",{...r,...c,dangerouslySetInnerHTML:{__html:p}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),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"}}})},oe=e=>{const{blockProps:r,image:o,mobileImage:s,styles:l,alt:n,height:a,width:c,lazyLoading:p}=e;return y.isEmpty(o)?i.jsxRuntimeExports.jsx(k,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[s&&i.jsxRuntimeExports.jsx("source",{srcSet:s,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...r,...l,src:o,alt:n,loading:p?"lazy":"eager",width:c,height:a})]})},re={type:"Image",label:"Image",category:"core",icon:g.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"]},B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,C=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(B.test(e)){const r=e.match(B);return r?`https://www.youtube.com/embed/${r[4]}`:e}if(j.test(e)){const r=e.match(j);return r?`https://player.vimeo.com/video/${r[3]}`:e}if(C.test(e)){const r=e.match(C);return r?`https://www.dailymotion.com/embed/video/${r[4]}`:e}return null},le=d.memo(e=>{const{blockProps:r,inBuilder:o,styles:s,url:l,controls:n}=e,a=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),p=a||y.get(n,"muted",!0),u=y.get(n,"loop",!1);if(y.isEmpty(l))return i.jsxRuntimeExports.jsx(k,{inBuilder:o,className:"h-36"});let h=se(l),f=null;if(h){if(!y.isEmpty(h)){const m=[];m.push(`autoplay=${a?1:0}`),m.push(`controls=${n?1:0}`),m.push(`mute=${p?1:0}&muted=${p?1:0}`),m.push(`loop=${u?1:0}`),h=`${h}?${m.join("&")}`}f=d.createElement("iframe",{...r,className:"absolute inset-0 w-full h-full",src:h,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=d.createElement("video",{...r,className:"absolute inset-0 w-full h-full",src:l,controls:c,muted:p,autoPlay:o?!1:a,loop:u});return i.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?i.jsxRuntimeExports.jsx("div",{...r,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})}),ie={type:"Video",label:"Video",category:"core",icon:g.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"]},ne=e=>{const{blockProps:r,styles:o}=e;return d.createElement("hr",{...o,...r})},ae={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})};function ce(e){return x.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 pe=e=>{const{scripts:r,inBuilder:o,blockProps:s}=e;return o?i.jsxRuntimeExports.jsx("div",{...s,children:i.jsxRuntimeExports.jsx("div",{className:x.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}})},ue={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ce,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},de=e=>null,ge={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",...t.registerChaiBlockSchema({properties:{}}),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:r,inBuilder:o,children:s,globalBlock:l}=e;return o&&!l?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...r,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",l]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):d.createElement("div",{...r},s)},ye={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"}}}})},he=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},xe=e=>{const{blockProps:r,backgroundImage:o,children:s,styles:l,tag:n}=e;let a={};return o&&(a={backgroundImage:`url(${o})`}),d.createElement(n||"div",{...r,...l,style:a},s)},be={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},ke=e=>{const{blockProps:r,styles:o}=e;return d.createElement("br",{...r,...o})},we={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},Be=e=>{const{children:r,blockProps:o,errorMessage:s,successMessage:l,action:n,styles:a}=e;let c=r;r||(c=i.jsxRuntimeExports.jsx(k,{}));const p={"x-data":"{}","x-on:submit.prevent":"post"},u={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":s,"data-success":l,method:"post",action:n,...o,...a,children:[i.jsxRuntimeExports.jsx("div",{...u}),c]})},je={type:"Form",label:"Form",category:"core",icon:S.GroupIcon,group:"form",...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},Ce=e=>{const{blockProps:r,inBuilder:o,label:s,styles:l,inputStyles:n,icon:a,iconSize:c,iconPos:p}=e,u=x.generateUUID(),h={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:u,...h,...n,...l,...r||{},type:o?"button":"submit",children:[s,a&&i.jsxRuntimeExports.jsx("div",{style:{width:c+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Se={type:"FormButton",label:"Submit Button",category:"core",icon:g.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"]},ve=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,showLabel:c,required:p,inputType:u}=e,h=x.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:s}),i.jsxRuntimeExports.jsx("input",{name:o,...a,id:h,type:u,placeholder:l,required:p})]}):i.jsxRuntimeExports.jsx("input",{id:h,name:o,...r,...a,...n,type:u,placeholder:l,required:p})},Ee={type:"Input",label:"web_blocks.input",category:"core",icon:g.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"]},Pe=e=>{const{blockProps:r,fieldName:o,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:o,id:u,type:"radio",required:a,defaultChecked:c}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:u,...r,...n,...l,type:"radio",required:a,checked:c,name:o})},Ie={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.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"]},_e=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,required:c,showLabel:p,_multiple:u,options:h}=e,f=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:f,required:c,multiple:u,name:o,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),y.map(h,m=>i.jsxRuntimeExports.jsx("option",{value:m.value,dangerouslySetInnerHTML:{__html:m.label}},m.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:f,...n,...r,required:c,multiple:u,name:o,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),y.map(h,m=>i.jsxRuntimeExports.jsx("option",{value:m.value,dangerouslySetInnerHTML:{__html:m.label}},m.value))]})},Le={type:"Select",label:"web_blocks.select",category:"core",icon:g.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"]},Re=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,_rows:c,showLabel:p}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s}),i.jsxRuntimeExports.jsx("textarea",{name:o,...a,id:u,placeholder:l,rows:c})]}):i.jsxRuntimeExports.jsx("textarea",{id:u,name:o,...r,...a,...n,placeholder:l,rows:c})},Me={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.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"]},Te=e=>{const{blockProps:r,fieldName:o,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:o,id:u,type:"checkbox",required:a,defaultChecked:c}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:u,...r,...n,...l,type:"checkbox",required:a,name:o})},$e={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.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"]},De=e=>{const{blockProps:r,content:o,styles:s,children:l}=e,n={...s,...r};return l?d.createElement("label",n,l):d.createElement("label",{...n,dangerouslySetInnerHTML:{__html:o}})},Ne={type:"Label",label:"Label",category:"core",icon:g.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},w={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false"}},ze=e=>{const{blockProps:r,content:o,icon:s,iconWidth:l,iconHeight:n,styles:a,show:c}=e;return i.jsxRuntimeExports.jsxs("button",{...r,...w.button,...a,children:[o,i.jsxRuntimeExports.jsx("span",{className:c?"rotate-180":"",dangerouslySetInnerHTML:{__html:s},style:{width:l,height:n}})]})};t.registerChaiBlock(ze,{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")}})});const He=e=>{const{blockProps:r,children:o,styles:s,show:l,inBuilder:n}=e;return n&&!l?null:i.jsxRuntimeExports.jsx("div",{...r,...w.menu,...s,children:o})};t.registerChaiBlock(He,{type:"DropdownContent",label:"Dropdown Content",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 qe=e=>{const{blockProps:r,children:o,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{...r,...s,...w.wrapper,children:o})},Ae={type:"Dropdown",label:"Dropdown",group:"basic",icon:g.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",...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ue=()=>{t.registerChaiBlock(_,L),t.registerChaiBlock(D,N),t.registerChaiBlock(R,M),t.registerChaiBlock(z,H),t.registerChaiBlock(q,A),t.registerChaiBlock(U,O),t.registerChaiBlock(F,G),t.registerChaiBlock(V,W),t.registerChaiBlock(X,Y),t.registerChaiBlock(Z,J),t.registerChaiBlock(K,Q),t.registerChaiBlock(ee,te),t.registerChaiBlock(oe,re),t.registerChaiBlock(le,ie),t.registerChaiBlock(T,$),t.registerChaiBlock(pe,ue),t.registerChaiBlock(he,fe),t.registerChaiBlock(Be,je),t.registerChaiBlock(Ce,Se),t.registerChaiBlock(ve,Ee),t.registerChaiBlock(Te,$e),t.registerChaiBlock(Pe,Ie),t.registerChaiBlock(_e,Le),t.registerChaiBlock(Re,Me),t.registerChaiBlock(De,Ne),t.registerChaiBlock(ke,we),t.registerChaiBlock(xe,be),t.registerChaiBlock(ne,ae),t.registerChaiBlock(de,ge),t.registerChaiBlock(me,ye),t.registerChaiBlock(qe,Ae)};exports.loadWebBlocks=Ue;
|
|
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"},U=e=>{const{blockProps:r,styles:o,content:s,children:l=null,tag:n}=e;return l?d.createElement("span",{...o,...r},l):d.createElement(n||"span",{...o,...r,dangerouslySetInnerHTML:{__html:s||""}})},O={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},F=e=>{const{blockProps:r,content:o,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...r,...s,dangerouslySetInnerHTML:{__html:o}})})},V={type:"RichText",label:"Rich Text",category:"core",icon:g.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"]},G=e=>{const{blockProps:r,link:o,children:s,styles:l,inBuilder:n,content:a}=e;let c={};return!s&&y.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?i.jsxRuntimeExports.jsx("span",{...r,style:c,...l,children:s}):d.createElement("span",{...r,...l,style:c},a):s?i.jsxRuntimeExports.jsx("a",{href:(o==null?void 0:o.href)||"#/",target:o==null?void 0:o.target,...r,...l,children:s}):d.createElement("a",{...r,...l,href:(o==null?void 0:o.href)||"#",target:(o==null?void 0:o.target)||"_self"},a)},W={type:"Link",label:"Link",category:"core",icon:g.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"},v=(e,...r)=>({...e,className:x.cn(e.className,...r)}),X=e=>{const{blockProps:r,children:o,styles:s,inBuilder:l,content:n,href:a}=e,{hrefType:c,autoplay:p,maxWidth:u,backdropColor:h,galleryName:f}=e,m=v(s,"cb-lightbox");if(!o&&y.isEmpty(s==null?void 0:s.className)&&y.isEmpty(n))return i.jsxRuntimeExports.jsx(k,{inBuilder:l});if(l)return o?i.jsxRuntimeExports.jsx("span",{...r,...m,children:o}):d.createElement("span",{...r,...m,dangerouslySetInnerHTML:{__html:n}});const b={};return c!=="image"&&(b["data-vbtype"]=c),p&&(b["data-autoplay"]="true"),u&&(b["data-maxwidth"]=u+"px"),h&&(b["data-overlay"]=h),f&&(b["data-gall"]=f),o?i.jsxRuntimeExports.jsx("a",{...b,href:a||"#/",...r,...m,children:o}):d.createElement("a",{...r,...m,...b,href:a||"#",dangerouslySetInnerHTML:{__html:n}})},Y={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.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"},Z=e=>{const{blockProps:r,children:o,listType:s,styles:l,tag:n,inBuilder:a}=e,c=x.cn(y.get(l,"className",""),s);return!o&&y.isEmpty(l==null?void 0:l.className)?i.jsxRuntimeExports.jsx(k,{inBuilder:a}):d.createElement(n||(s==="list-decimal"?"ol":"ul"),{...r,...l,className:c},o)},J={type:"List",label:"web_blocks.list",icon:g.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"}]},K=e=>{const{blockProps:r,content:o,styles:s,children:l,tag:n}=e;return l?d.createElement(n||"li",{...s,...r},l):d.createElement(n||"li",{...s,...r,dangerouslySetInnerHTML:{__html:o}})},Q={type:"ListItem",label:"List Item",icon:g.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"},ee=e=>{const{blockProps:r,icon:o,styles:s,width:l,inBuilder:n,height:a}=e,c=v(s,x.cn(l?`w-[${l}px]`:"",a?`h-[${a}px]`:""));if(y.isEmpty(o))return i.jsxRuntimeExports.jsx(k,{inBuilder:n,className:"h-8 w-14"});const p=o.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return d.createElement("span",{...r,...c,dangerouslySetInnerHTML:{__html:p}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),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"}}})},oe=e=>{const{blockProps:r,image:o,mobileImage:s,styles:l,alt:n,height:a,width:c,lazyLoading:p}=e;return y.isEmpty(o)?i.jsxRuntimeExports.jsx(k,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[s&&i.jsxRuntimeExports.jsx("source",{srcSet:s,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...r,...l,src:o,alt:n,loading:p?"lazy":"eager",width:c,height:a})]})},re={type:"Image",label:"Image",category:"core",icon:g.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"]},B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,C=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(B.test(e)){const r=e.match(B);return r?`https://www.youtube.com/embed/${r[4]}`:e}if(j.test(e)){const r=e.match(j);return r?`https://player.vimeo.com/video/${r[3]}`:e}if(C.test(e)){const r=e.match(C);return r?`https://www.dailymotion.com/embed/video/${r[4]}`:e}return null},le=d.memo(e=>{const{blockProps:r,inBuilder:o,styles:s,url:l,controls:n}=e,a=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),p=a||y.get(n,"muted",!0),u=y.get(n,"loop",!1);if(y.isEmpty(l))return i.jsxRuntimeExports.jsx(k,{inBuilder:o,className:"h-36"});let h=se(l),f=null;if(h){if(!y.isEmpty(h)){const m=[];m.push(`autoplay=${a?1:0}`),m.push(`controls=${n?1:0}`),m.push(`mute=${p?1:0}&muted=${p?1:0}`),m.push(`loop=${u?1:0}`),h=`${h}?${m.join("&")}`}f=d.createElement("iframe",{...r,className:"absolute inset-0 w-full h-full",src:h,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=d.createElement("video",{...r,className:"absolute inset-0 w-full h-full",src:l,controls:c,muted:p,autoPlay:o?!1:a,loop:u});return i.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?i.jsxRuntimeExports.jsx("div",{...r,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})}),ie={type:"Video",label:"Video",category:"core",icon:g.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"]},ne=e=>{const{blockProps:r,styles:o}=e;return d.createElement("hr",{...o,...r})},ae={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})};function ce(e){return x.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 pe=e=>{const{scripts:r,inBuilder:o,blockProps:s}=e;return o?i.jsxRuntimeExports.jsx("div",{...s,children:i.jsxRuntimeExports.jsx("div",{className:x.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}})},ue={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ce,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},de=e=>null,ge={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",...t.registerChaiBlockSchema({properties:{}}),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:r,inBuilder:o,children:s,globalBlock:l}=e;return o&&!l?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...r,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",l]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):d.createElement("div",{...r},s)},ye={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"}}}})},he=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},xe=e=>{const{blockProps:r,backgroundImage:o,children:s,styles:l,tag:n}=e;let a={};return o&&(a={backgroundImage:`url(${o})`}),d.createElement(n||"div",{...r,...l,style:a},s)},be={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},ke=e=>{const{blockProps:r,styles:o}=e;return d.createElement("br",{...r,...o})},we={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},Be=e=>{const{children:r,blockProps:o,errorMessage:s,successMessage:l,action:n,styles:a}=e;let c=r;r||(c=i.jsxRuntimeExports.jsx(k,{}));const p={"x-data":"{}","x-on:submit.prevent":"post"},u={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":s,"data-success":l,method:"post",action:n,...o,...a,children:[i.jsxRuntimeExports.jsx("div",{...u}),c]})},je={type:"Form",label:"Form",category:"core",icon:S.GroupIcon,group:"form",...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},Ce=e=>{const{blockProps:r,inBuilder:o,label:s,styles:l,inputStyles:n,icon:a,iconSize:c,iconPos:p}=e,u=x.generateUUID(),h={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:u,...h,...n,...l,...r||{},type:o?"button":"submit",children:[s,a&&i.jsxRuntimeExports.jsx("div",{style:{width:c+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Se={type:"FormButton",label:"Submit Button",category:"core",icon:g.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"]},ve=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,showLabel:c,required:p,inputType:u}=e,h=x.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:s}),i.jsxRuntimeExports.jsx("input",{name:o,...a,id:h,type:u,placeholder:l,required:p})]}):i.jsxRuntimeExports.jsx("input",{id:h,name:o,...r,...a,...n,type:u,placeholder:l,required:p})},Ee={type:"Input",label:"web_blocks.input",category:"core",icon:g.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"]},Pe=e=>{const{blockProps:r,fieldName:o,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:o,id:u,type:"radio",required:a,defaultChecked:c}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:u,...r,...n,...l,type:"radio",required:a,checked:c,name:o})},Ie={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.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"]},_e=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,required:c,showLabel:p,_multiple:u,options:h}=e,f=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:f,required:c,multiple:u,name:o,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),y.map(h,m=>i.jsxRuntimeExports.jsx("option",{value:m.value,dangerouslySetInnerHTML:{__html:m.label}},m.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:f,...n,...r,required:c,multiple:u,name:o,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),y.map(h,m=>i.jsxRuntimeExports.jsx("option",{value:m.value,dangerouslySetInnerHTML:{__html:m.label}},m.value))]})},Le={type:"Select",label:"web_blocks.select",category:"core",icon:g.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"]},Re=e=>{const{blockProps:r,fieldName:o,label:s,placeholder:l,styles:n,inputStyles:a,_rows:c,showLabel:p}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s}),i.jsxRuntimeExports.jsx("textarea",{name:o,...a,id:u,placeholder:l,rows:c})]}):i.jsxRuntimeExports.jsx("textarea",{id:u,name:o,...r,...a,...n,placeholder:l,rows:c})},Me={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.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"]},Te=e=>{const{blockProps:r,fieldName:o,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=x.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:o,id:u,type:"checkbox",required:a,defaultChecked:c}),s&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s})]}):i.jsxRuntimeExports.jsx("input",{id:u,...r,...n,...l,type:"checkbox",required:a,name:o})},$e={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.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"]},De=e=>{const{blockProps:r,content:o,styles:s,children:l}=e,n={...s,...r};return l?d.createElement("label",n,l):d.createElement("label",{...n,dangerouslySetInnerHTML:{__html:o}})},Ne={type:"Label",label:"Label",category:"core",icon:g.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},w={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false"}},ze=e=>{const{blockProps:r,content:o,icon:s,iconWidth:l,iconHeight:n,styles:a,show:c}=e;return i.jsxRuntimeExports.jsxs("button",{...r,...w.button,...a,children:[o,i.jsxRuntimeExports.jsx("span",{className:c?"rotate-180":"",dangerouslySetInnerHTML:{__html:s},style:{width:l,height:n}})]})};t.registerChaiBlock(ze,{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")}})});const He=e=>{const{blockProps:r,children:o,styles:s,show:l,inBuilder:n}=e;return n&&!l?null:i.jsxRuntimeExports.jsx("div",{...r,...w.menu,...s,children:o})};t.registerChaiBlock(He,{type:"DropdownContent",label:"Dropdown Content",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 qe=e=>{const{blockProps:r,children:o,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{...r,...s,...w.wrapper,children:o})},Ae={type:"Dropdown",label:"Dropdown",group:"basic",icon:g.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",...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ue=()=>{t.registerChaiBlock(_,L),t.registerChaiBlock(D,N),t.registerChaiBlock(R,M),t.registerChaiBlock(z,H),t.registerChaiBlock(q,A),t.registerChaiBlock(U,O),t.registerChaiBlock(F,V),t.registerChaiBlock(G,W),t.registerChaiBlock(X,Y),t.registerChaiBlock(Z,J),t.registerChaiBlock(K,Q),t.registerChaiBlock(ee,te),t.registerChaiBlock(oe,re),t.registerChaiBlock(le,ie),t.registerChaiBlock(T,$),t.registerChaiBlock(pe,ue),t.registerChaiBlock(he,fe),t.registerChaiBlock(Be,je),t.registerChaiBlock(Ce,Se),t.registerChaiBlock(ve,Ee),t.registerChaiBlock(Te,$e),t.registerChaiBlock(Pe,Ie),t.registerChaiBlock(_e,Le),t.registerChaiBlock(Re,Me),t.registerChaiBlock(De,Ne),t.registerChaiBlock(ke,we),t.registerChaiBlock(xe,be),t.registerChaiBlock(ne,ae),t.registerChaiBlock(de,ge),t.registerChaiBlock(me,ye),t.registerChaiBlock(qe,Ae)};exports.loadWebBlocks=Ue;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { registerChaiBlockSchema as u, StylesProp as c, registerChaiBlock as d, closestBlockProp as P, runtimeProp as
|
|
1
|
+
import { registerChaiBlockSchema as u, StylesProp as c, registerChaiBlock as d, closestBlockProp as P, runtimeProp as N } from "@chaibuilder/runtime";
|
|
2
2
|
import { j as r } from "./jsx-runtime-Sp0orL4X.js";
|
|
3
3
|
import * as y from "react";
|
|
4
|
-
import { c as _, G as
|
|
5
|
-
import { ButtonIcon as S, CodeIcon as z, HeadingIcon as H, TextIcon as A, CursorTextIcon as R, Link1Icon as q, ImageIcon as M, RowsIcon as F, ColumnsIcon as G, SketchLogoIcon as V, VideoIcon as
|
|
4
|
+
import { c as _, G as D, g as v } from "./iconBase-Ief2hJUZ.js";
|
|
5
|
+
import { ButtonIcon as S, CodeIcon as z, HeadingIcon as H, TextIcon as A, CursorTextIcon as R, Link1Icon as q, ImageIcon as M, RowsIcon as F, ColumnsIcon as G, SketchLogoIcon as V, VideoIcon as W, DividerHorizontalIcon as O, MoonIcon as U, SpaceBetweenVerticallyIcon as X, InputIcon as E, RadiobuttonIcon as Y, DropdownMenuIcon as T, CheckboxIcon as Z, LetterCaseToggleIcon as J } from "@radix-ui/react-icons";
|
|
6
6
|
import { isEmpty as b, get as k, isNull as K, pick as Q, omit as ee, map as B } from "lodash-es";
|
|
7
7
|
import { GlobeIcon as te, GroupIcon as oe } from "lucide-react";
|
|
8
8
|
import "clsx";
|
|
@@ -355,7 +355,7 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
355
355
|
dangerouslySetInnerHTML: { __html: s }
|
|
356
356
|
});
|
|
357
357
|
const x = {};
|
|
358
|
-
return x["data-vbtype"] = a, p && (x["data-autoplay"] = "true"), g && (x["data-maxwidth"] = g + "px"), h && (x["data-overlay"] = h), f && (x["data-gall"] = f), t ? /* @__PURE__ */ r.jsx("a", { ...x, href: i || "#/", ...o, ...m, children: t }) : y.createElement("a", {
|
|
358
|
+
return a !== "image" && (x["data-vbtype"] = a), p && (x["data-autoplay"] = "true"), g && (x["data-maxwidth"] = g + "px"), h && (x["data-overlay"] = h), f && (x["data-gall"] = f), t ? /* @__PURE__ */ r.jsx("a", { ...x, href: i || "#/", ...o, ...m, children: t }) : y.createElement("a", {
|
|
359
359
|
...o,
|
|
360
360
|
...m,
|
|
361
361
|
...x,
|
|
@@ -376,45 +376,22 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
376
376
|
title: "Content",
|
|
377
377
|
default: "Link text or drop blocks inside"
|
|
378
378
|
},
|
|
379
|
+
hrefType: {
|
|
380
|
+
type: "string",
|
|
381
|
+
title: "Type",
|
|
382
|
+
default: "image",
|
|
383
|
+
enum: ["image", "video", "iframe", "inline", "ajax"],
|
|
384
|
+
enumNames: ["Image", "Video", "Iframe", "Inline", "Ajax"]
|
|
385
|
+
},
|
|
379
386
|
href: {
|
|
380
387
|
type: "string",
|
|
381
388
|
title: "Href",
|
|
382
389
|
default: ""
|
|
383
390
|
},
|
|
384
|
-
hrefType: {
|
|
385
|
-
type: "string",
|
|
386
|
-
title: "Type",
|
|
387
|
-
default: "video",
|
|
388
|
-
oneOf: [
|
|
389
|
-
{
|
|
390
|
-
type: "string",
|
|
391
|
-
title: "Video",
|
|
392
|
-
enum: ["video"]
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
type: "string",
|
|
396
|
-
title: "Iframe",
|
|
397
|
-
enum: ["iframe"]
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
type: "string",
|
|
401
|
-
title: "Inline",
|
|
402
|
-
enum: ["inline"]
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
type: "string",
|
|
406
|
-
title: "Ajax",
|
|
407
|
-
enum: ["ajax"]
|
|
408
|
-
}
|
|
409
|
-
]
|
|
410
|
-
},
|
|
411
391
|
autoplay: {
|
|
412
392
|
type: "boolean",
|
|
413
|
-
title: "Autoplay",
|
|
414
|
-
default: !1
|
|
415
|
-
dependencies: {
|
|
416
|
-
hrefType: ["video"]
|
|
417
|
-
}
|
|
393
|
+
title: "Autoplay (Video only)",
|
|
394
|
+
default: !1
|
|
418
395
|
},
|
|
419
396
|
maxWidth: {
|
|
420
397
|
type: "number",
|
|
@@ -431,6 +408,9 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
431
408
|
title: "Gallery Name",
|
|
432
409
|
default: ""
|
|
433
410
|
}
|
|
411
|
+
},
|
|
412
|
+
dependencies: {
|
|
413
|
+
autoplay: ["hrefType", "video"]
|
|
434
414
|
}
|
|
435
415
|
}),
|
|
436
416
|
i18nProps: ["content"],
|
|
@@ -671,7 +651,7 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
671
651
|
type: "Video",
|
|
672
652
|
label: "Video",
|
|
673
653
|
category: "core",
|
|
674
|
-
icon:
|
|
654
|
+
icon: W,
|
|
675
655
|
group: "media",
|
|
676
656
|
...u({
|
|
677
657
|
properties: {
|
|
@@ -716,14 +696,14 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
716
696
|
}
|
|
717
697
|
}),
|
|
718
698
|
i18nProps: ["url"]
|
|
719
|
-
},
|
|
699
|
+
}, Ne = (e) => {
|
|
720
700
|
const { blockProps: o, styles: t } = e;
|
|
721
701
|
return y.createElement("hr", { ...t, ...o });
|
|
722
|
-
},
|
|
702
|
+
}, De = {
|
|
723
703
|
type: "Divider",
|
|
724
704
|
label: "web_blocks.divider",
|
|
725
705
|
category: "core",
|
|
726
|
-
icon:
|
|
706
|
+
icon: O,
|
|
727
707
|
group: "basic",
|
|
728
708
|
...u({
|
|
729
709
|
properties: {
|
|
@@ -732,7 +712,7 @@ const le = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("d
|
|
|
732
712
|
})
|
|
733
713
|
};
|
|
734
714
|
function ze(e) {
|
|
735
|
-
return
|
|
715
|
+
return D({ 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);
|
|
736
716
|
}
|
|
737
717
|
const He = (e) => {
|
|
738
718
|
const { scripts: o, inBuilder: t, blockProps: l } = e;
|
|
@@ -846,7 +826,7 @@ const He = (e) => {
|
|
|
846
826
|
}
|
|
847
827
|
}
|
|
848
828
|
})
|
|
849
|
-
}, Ve = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`,
|
|
829
|
+
}, Ve = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`, We = {
|
|
850
830
|
type: "Text",
|
|
851
831
|
label: "Text",
|
|
852
832
|
hidden: !0,
|
|
@@ -864,7 +844,7 @@ const He = (e) => {
|
|
|
864
844
|
}),
|
|
865
845
|
aiProps: ["content"],
|
|
866
846
|
i18nProps: ["content"]
|
|
867
|
-
},
|
|
847
|
+
}, Oe = (e) => {
|
|
868
848
|
const { blockProps: o, backgroundImage: t, children: l, styles: n, tag: s } = e;
|
|
869
849
|
let i = {};
|
|
870
850
|
return t && (i = { backgroundImage: `url(${t})` }), y.createElement(s || "div", { ...o, ...n, style: i }, l);
|
|
@@ -1487,7 +1467,7 @@ const yt = (e) => {
|
|
|
1487
1467
|
category: "core",
|
|
1488
1468
|
...u({
|
|
1489
1469
|
properties: {
|
|
1490
|
-
showDropdown:
|
|
1470
|
+
showDropdown: N({
|
|
1491
1471
|
type: "boolean",
|
|
1492
1472
|
title: "Show Dropdown",
|
|
1493
1473
|
default: !1
|
|
@@ -1496,7 +1476,7 @@ const yt = (e) => {
|
|
|
1496
1476
|
}
|
|
1497
1477
|
})
|
|
1498
1478
|
}, It = () => {
|
|
1499
|
-
d(ne, re), d(pe, de), d(se, ie), d(ue, ge), d(ye, me), d(he, fe), d(be, ke), d(xe, we), d(ve, _e), d(Ie, Be), d(Le, je), d(Ce, Pe), d(Se, Me), d(Te, $e), d(ae, ce), d(He, Ae), d(Ve,
|
|
1479
|
+
d(ne, re), d(pe, de), d(se, ie), d(ue, ge), d(ye, me), d(he, fe), d(be, ke), d(xe, we), d(ve, _e), d(Ie, Be), d(Le, je), d(Ce, Pe), d(Se, Me), d(Te, $e), d(ae, ce), d(He, Ae), d(Ve, We), d(Ze, Je), d(Ke, Qe), d(et, tt), d(at, ct), d(ot, lt), d(nt, rt), d(st, it), d(pt, dt), d(Xe, Ye), d(Oe, Ue), d(Ne, De), d(Re, qe), d(Fe, Ge), d(yt, mt);
|
|
1500
1480
|
};
|
|
1501
1481
|
export {
|
|
1502
1482
|
It as loadWebBlocks
|