@chaibuilder/sdk 2.0.0-beta.17 → 2.0.0-beta.18
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/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +210 -290
- package/package.json +1 -1
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@chaibuilder/runtime"),i=require("./jsx-runtime-JYMCiFoE.cjs"),v=require("react"),f=require("./iconBase-aZzpqff_.cjs"),g=require("@radix-ui/react-icons"),y=require("lodash-es"),w=require("lucide-react");require("clsx");require("tailwind-merge");function E(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const d=E(v),P=({className:e="",inBuilder:r})=>r?i.jsxRuntimeExports.jsx("div",{className:f.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=P,I=e=>{const{blockProps:r,inBuilder:t,backgroundImage:s,children:l,tag:n="div",styles:a}=e;let c=l;l||(c=i.jsxRuntimeExports.jsx(k,{inBuilder:t}));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",...o.registerChaiBlockSchema({properties:{styles:o.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},_=e=>{const{blockProps:r,iconSize:t,icon:s,content:l,styles:n,children:a,iconPos:c}=e,p=s,u=a||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:l}),p&&i.jsxRuntimeExports.jsx("div",{style:{width:t+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return d.createElement("button",{...r,...n,type:"button"},u)},R={type:"Button",label:"Button",category:"core",icon:g.ButtonIcon,group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.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"]}}}),i18nProps:["content"],aiProps:["content"]},M=e=>{const{blockProps:r,styles:t,htmlCode:s,inBuilder:l}=e;return l?i.jsxRuntimeExports.jsxs("div",{className:"relative",children:[l?i.jsxRuntimeExports.jsx("div",{...r,...t,className:"absolute z-20 h-full w-full"}):null,d.createElement("div",{...t,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):d.createElement("div",{...r,...t,dangerouslySetInnerHTML:{__html:s}})},T={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:g.CodeIcon,group:"advanced",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}})},$=e=>{const{blockProps:r,styles:t,backgroundImage:s}=e;let l={};return s&&(l={backgroundImage:`url(${s})`}),d.createElement("div",{...r,...t,style:l})},N={type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},z=e=>{const{blockProps:r,styles:t,content:s,level:l="h1",children:n=null}=e;return n?d.createElement(l,{...t,...r},n):d.createElement(l,{...t,...r,dangerouslySetInnerHTML:{__html:s}})},H={type:"Heading",label:"web_blocks.heading",category:"core",icon:g.HeadingIcon,group:"typography",...o.registerChaiBlockSchema({properties:{level:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:o.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"},D=e=>{const{blockProps:r,styles:t,content:s}=e;return y.isNull(e.children)?d.createElement("p",{...t,...r,dangerouslySetInnerHTML:{__html:s}}):d.createElement("p",{...t,...r},e.children)},q={type:"Paragraph",label:"Paragraph",category:"core",icon:g.TextIcon,group:"typography",...o.registerChaiBlockSchema({properties:{styles:o.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}})})},W={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)},V={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"},S=(e,...r)=>({...e,className:f.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:b}=e,m=S(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 x={};return x["data-vbtype"]=c,p&&(x["data-autoplay"]="true"),u&&(x["data-maxwidth"]=u+"px"),h&&(x["data-overlay"]=h),b&&(x["data-gall"]=b),o?i.jsxRuntimeExports.jsx("a",{...x,href:a||"#/",...r,...m,children:o}):d.createElement("a",{...r,...m,...x,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=f.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=S(s,f.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,styles:s,alt:l,height:n,width:a,lazyLoading:c}=e;return y.isEmpty(o)?i.jsxRuntimeExports.jsx(k,{className:"h-36"}):d.createElement("img",{...r,...s,src:o,alt:l,loading:c?"lazy":"eager",height:n,width: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"}},mobileWidth:{type:"number",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"number",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}}}}),aiProps:["alt"],i18nProps:["alt"]},w=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,B=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=e=>{if(w.test(e)){const r=e.match(w);return r?`https://www.youtube.com/embed/${r[4]}`:e}if(B.test(e)){const r=e.match(B);return r?`https://player.vimeo.com/video/${r[3]}`:e}if(j.test(e)){const r=e.match(j);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),b=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("&")}`}b=d.createElement("iframe",{...r,className:"absolute inset-0 w-full h-full",src:h,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=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,b]})})}),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 f.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:f.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:C.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"]},be=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)},xe={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:C.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=f.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=f.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=f.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,b=f.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:b,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:b,...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=f.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=f.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:""}}})},v={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false"}},He=e=>{const{blockProps:r,title:o,icon:s,iconWidth:l,iconHeight:n,styles:a}=e;return i.jsxRuntimeExports.jsxs("button",{...r,...v.button,...a,children:[o,i.jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:s},style:{width:l,height:n}})]})};t.registerChaiBlock(He,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{title:{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 ze=e=>{const{blockProps:r,children:o,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{...r,...v.wrapper,className:"relative",children:i.jsxRuntimeExports.jsx("div",{...s,children:o})})};t.registerChaiBlock(ze,{type:"DropdownMenuContent",label:"Dropdown Content",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("absolute left-0 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const qe=e=>{const{children:r}=e;return r},Ae={type:"DropdownMenu",label:"Dropdown Menu",group:"advanced",blocks:()=>[{_type:"DropdownMenu",_id:"menu"},{_type:"DropdownButton",_id:"button",_parent:"menu",title:"Menu Item",icon:"",styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownMenuContent",_id:"content",_parent:"menu",styles:"#styles:,absolute left-0 w-80 mt-2 bg-white rounded-lg shadow-lg z-50"}],category:"core",...t.registerChaiBlockSchema({properties:{showDropdown:{type:"boolean",title:"Show Dropdown",default:!1}}})},Ue=()=>{t.registerChaiBlock(_,L),t.registerChaiBlock(D,N),t.registerChaiBlock(R,M),t.registerChaiBlock(H,z),t.registerChaiBlock(q,A),t.registerChaiBlock(U,O),t.registerChaiBlock(F,W),t.registerChaiBlock(G,V),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(be,xe),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"},A=e=>{const{blockProps:r,styles:t,content:s,children:l=null,tag:n}=e;return l?d.createElement("span",{...t,...r},l):d.createElement(n||"span",{...t,...r,dangerouslySetInnerHTML:{__html:s||""}})},U={type:"Span",label:"Span",category:"core",group:"typography",...o.registerChaiBlockSchema({properties:{styles:o.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},O=e=>{const{blockProps:r,content:t,styles:s}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...r,...s,dangerouslySetInnerHTML:{__html:t}})})},F={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",...o.registerChaiBlockSchema({properties:{styles:o.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:t,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:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...r,...l,children:s}):d.createElement("a",{...r,...l,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self"},a)},V={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.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"},C=(e,...r)=>({...e,className:f.cn(e.className,...r)}),W=e=>{const{blockProps:r,children:t,styles:s,inBuilder:l,content:n,href:a}=e,{hrefType:c,autoplay:p,maxWidth:u,backdropColor:h,galleryName:b}=e,m=C(s,"cb-lightbox");if(!t&&y.isEmpty(s==null?void 0:s.className)&&y.isEmpty(n))return i.jsxRuntimeExports.jsx(k,{inBuilder:l});if(l)return t?i.jsxRuntimeExports.jsx("span",{...r,...m,children:t}):d.createElement("span",{...r,...m,dangerouslySetInnerHTML:{__html:n}});const x={};return x["data-vbtype"]=c,p&&(x["data-autoplay"]="true"),u&&(x["data-maxwidth"]=u+"px"),h&&(x["data-overlay"]=h),b&&(x["data-gall"]=b),t?i.jsxRuntimeExports.jsx("a",{...x,href:a||"#/",...r,...m,children:t}):d.createElement("a",{...r,...m,...x,href:a||"#",dangerouslySetInnerHTML:{__html:n}})},X={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.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"},Y=e=>{const{blockProps:r,children:t,listType:s,styles:l,tag:n,inBuilder:a}=e,c=f.cn(y.get(l,"className",""),s);return!t&&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},t)},Z={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.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"}]},J=e=>{const{blockProps:r,content:t,styles:s,children:l,tag:n}=e;return l?d.createElement(n||"li",{...s,...r},l):d.createElement(n||"li",{...s,...r,dangerouslySetInnerHTML:{__html:t}})},K={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.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"},Q=e=>{const{blockProps:r,icon:t,styles:s,width:l,inBuilder:n,height:a}=e,c=C(s,f.cn(l?`w-[${l}px]`:"",a?`h-[${a}px]`:""));if(y.isEmpty(t))return i.jsxRuntimeExports.jsx(k,{inBuilder:n,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return d.createElement("span",{...r,...c,dangerouslySetInnerHTML:{__html:p}})},ee={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",...o.registerChaiBlockSchema({properties:{styles:o.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"}}})},te=e=>{const{blockProps:r,image:t,styles:s,alt:l,height:n,width:a,lazyLoading:c}=e;return y.isEmpty(t)?i.jsxRuntimeExports.jsx(k,{className:"h-36"}):d.createElement("img",{...r,...s,src:t,alt:l,loading:c?"lazy":"eager",height:n,width:a})},oe={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",...o.registerChaiBlockSchema({properties:{styles:o.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"}},mobileWidth:{type:"number",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"number",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}}}}),aiProps:["alt"],i18nProps:["alt"]},B=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,S=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,re=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(S.test(e)){const r=e.match(S);return r?`https://www.dailymotion.com/embed/video/${r[4]}`:e}return null},se=d.memo(e=>{const{blockProps:r,inBuilder:t,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:t,className:"h-36"});let h=re(l),b=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("&")}`}b=d.createElement("iframe",{...r,className:"absolute inset-0 w-full h-full",src:h,allow:t?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=d.createElement("video",{...r,className:"absolute inset-0 w-full h-full",src:l,controls:c,muted:p,autoPlay:t?!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:[t?i.jsxRuntimeExports.jsx("div",{...r,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),le={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",...o.registerChaiBlockSchema({properties:{styles:o.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"]},ie=e=>{const{blockProps:r,styles:t}=e;return d.createElement("hr",{...t,...r})},ne={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})};function ae(e){return f.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 ce=e=>{const{scripts:r,inBuilder:t,blockProps:s}=e;return t?i.jsxRuntimeExports.jsx("div",{...s,children:i.jsxRuntimeExports.jsx("div",{className:f.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}})},pe={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ae,group:"advanced",...o.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},ue=e=>null,de={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",...o.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>"}]},ge=e=>{const{blockProps:r,inBuilder:t,children:s,globalBlock:l}=e;return t&&!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)},me={type:"GlobalBlock",label:"Global Block",icon:w.GlobeIcon,category:"core",group:"advanced",...o.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},ye=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,he={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},fe=e=>{const{blockProps:r,backgroundImage:t,children:s,styles:l,tag:n}=e;let a={};return t&&(a={backgroundImage:`url(${t})`}),d.createElement(n||"div",{...r,...l,style:a},s)},be={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...o.registerChaiBlockSchema({properties:{styles:o.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},xe=e=>{const{blockProps:r,styles:t}=e;return d.createElement("br",{...r,...t})},ke={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Be=e=>{const{children:r,blockProps:t,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,...t,...a,children:[i.jsxRuntimeExports.jsx("div",{...u}),c]})},je={type:"Form",label:"Form",category:"core",icon:w.GroupIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.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},Se=e=>{const{blockProps:r,inBuilder:t,label:s,styles:l,inputStyles:n,icon:a,iconSize:c,iconPos:p}=e,u=f.generateUUID(),h={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:u,...h,...n,...l,...r||{},type:t?"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}})]})},we={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:o.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"]},Ce=e=>{const{blockProps:r,fieldName:t,label:s,placeholder:l,styles:n,inputStyles:a,showLabel:c,required:p,inputType:u}=e,h=f.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:s}),i.jsxRuntimeExports.jsx("input",{name:t,...a,id:h,type:u,placeholder:l,required:p})]}):i.jsxRuntimeExports.jsx("input",{id:h,name:t,...r,...a,...n,type:u,placeholder:l,required:p})},ve={type:"Input",label:"web_blocks.input",category:"core",icon:g.InputIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(""),inputStyles:o.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"]},Ee=e=>{const{blockProps:r,fieldName:t,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=f.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:t,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:t})},Pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("flex items-center gap-x-2"),inputStyles:o.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"]},Ie=e=>{const{blockProps:r,fieldName:t,label:s,placeholder:l,styles:n,inputStyles:a,required:c,showLabel:p,_multiple:u,options:h}=e,b=f.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),i.jsxRuntimeExports.jsxs("select",{...a,id:b,required:c,multiple:u,name:t,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:b,...n,...r,required:c,multiple:u,name:t,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",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(""),inputStyles:o.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"]},_e=e=>{const{blockProps:r,fieldName:t,label:s,placeholder:l,styles:n,inputStyles:a,_rows:c,showLabel:p}=e,u=f.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...n,...r,children:[p&&i.jsxRuntimeExports.jsx("label",{htmlFor:u,children:s}),i.jsxRuntimeExports.jsx("textarea",{name:t,...a,id:u,placeholder:l,rows:c})]}):i.jsxRuntimeExports.jsx("textarea",{id:u,name:t,...r,...a,...n,placeholder:l,rows:c})},Re={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(""),inputStyles:o.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"]},Me=e=>{const{blockProps:r,fieldName:t,label:s,styles:l,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,u=f.generateUUID();return p?i.jsxRuntimeExports.jsxs("div",{...l,...r,children:[i.jsxRuntimeExports.jsx("input",{...n,name:t,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:t})},Te={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp("flex items-center gap-x-2"),inputStyles:o.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,content:t,styles:s,children:l}=e,n={...s,...r};return l?d.createElement("label",n,l):d.createElement("label",{...n,dangerouslySetInnerHTML:{__html:t}})},Ne={type:"Label",label:"Label",category:"core",icon:g.LetterCaseToggleIcon,group:"form",...o.registerChaiBlockSchema({properties:{styles:o.StylesProp(),content:{type:"string",title:"Content",default:""}}})},ze=()=>{o.registerChaiBlock(I,L),o.registerChaiBlock($,N),o.registerChaiBlock(_,R),o.registerChaiBlock(z,H),o.registerChaiBlock(D,q),o.registerChaiBlock(A,U),o.registerChaiBlock(O,F),o.registerChaiBlock(G,V),o.registerChaiBlock(W,X),o.registerChaiBlock(Y,Z),o.registerChaiBlock(J,K),o.registerChaiBlock(Q,ee),o.registerChaiBlock(te,oe),o.registerChaiBlock(se,le),o.registerChaiBlock(M,T),o.registerChaiBlock(ce,pe),o.registerChaiBlock(ye,he),o.registerChaiBlock(Be,je),o.registerChaiBlock(Se,we),o.registerChaiBlock(Ce,ve),o.registerChaiBlock(Me,Te),o.registerChaiBlock(Ee,Pe),o.registerChaiBlock(Ie,Le),o.registerChaiBlock(_e,Re),o.registerChaiBlock($e,Ne),o.registerChaiBlock(xe,ke),o.registerChaiBlock(fe,be),o.registerChaiBlock(ie,ne),o.registerChaiBlock(ue,de),o.registerChaiBlock(ge,me)};exports.loadWebBlocks=ze;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { registerChaiBlockSchema as p, StylesProp as c, registerChaiBlock as
|
|
1
|
+
import { registerChaiBlockSchema as p, StylesProp as c, registerChaiBlock as u } 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 I, G as
|
|
5
|
-
import { ButtonIcon as
|
|
6
|
-
import { isNull as
|
|
7
|
-
import { GlobeIcon as
|
|
4
|
+
import { c as I, G as E, g as w } from "./iconBase-Ief2hJUZ.js";
|
|
5
|
+
import { ButtonIcon as C, CodeIcon as T, HeadingIcon as $, TextIcon as N, CursorTextIcon as H, Link1Icon as z, ImageIcon as j, RowsIcon as R, ColumnsIcon as A, SketchLogoIcon as D, VideoIcon as q, DividerHorizontalIcon as F, MoonIcon as G, SpaceBetweenVerticallyIcon as V, InputIcon as S, RadiobuttonIcon as O, DropdownMenuIcon as U, CheckboxIcon as W, LetterCaseToggleIcon as X } from "@radix-ui/react-icons";
|
|
6
|
+
import { isNull as Y, isEmpty as b, get as v, pick as Z, omit as J, map as L } from "lodash-es";
|
|
7
|
+
import { GlobeIcon as K, GroupIcon as Q } from "lucide-react";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
|
-
const
|
|
11
|
-
const { blockProps:
|
|
10
|
+
const ee = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("div", { className: I("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ r.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ r.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, x = ee, te = (e) => {
|
|
11
|
+
const { blockProps: o, inBuilder: t, backgroundImage: n, children: l, tag: i = "div", styles: s } = e;
|
|
12
12
|
let a = l;
|
|
13
|
-
l || (a = /* @__PURE__ */ r.jsx(x, { inBuilder:
|
|
14
|
-
let
|
|
15
|
-
return n && (
|
|
16
|
-
},
|
|
13
|
+
l || (a = /* @__PURE__ */ r.jsx(x, { inBuilder: t }));
|
|
14
|
+
let d = {};
|
|
15
|
+
return n && (d = { backgroundImage: `url(${n})` }), y.createElement(i, { ...o, ...s, style: d }, a);
|
|
16
|
+
}, oe = {
|
|
17
17
|
type: "Box",
|
|
18
18
|
label: "Box",
|
|
19
19
|
category: "core",
|
|
@@ -54,32 +54,32 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
54
54
|
}
|
|
55
55
|
}),
|
|
56
56
|
canAcceptBlock: () => !0
|
|
57
|
-
},
|
|
58
|
-
const { blockProps:
|
|
57
|
+
}, le = (e) => {
|
|
58
|
+
const { blockProps: o, iconSize: t, icon: n, content: l, styles: i, children: s, iconPos: a } = e, d = n, g = s || /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
59
59
|
/* @__PURE__ */ r.jsx("span", { "data-ai-key": "content", children: l }),
|
|
60
|
-
|
|
60
|
+
d && /* @__PURE__ */ r.jsx(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
style: { width:
|
|
63
|
+
style: { width: t + "px" },
|
|
64
64
|
className: a + " " + (a === "order-first" ? "mr-2" : "ml-2") || "",
|
|
65
|
-
dangerouslySetInnerHTML: { __html:
|
|
65
|
+
dangerouslySetInnerHTML: { __html: d }
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
] });
|
|
69
69
|
return y.createElement(
|
|
70
70
|
"button",
|
|
71
71
|
{
|
|
72
|
-
...
|
|
72
|
+
...o,
|
|
73
73
|
...i,
|
|
74
74
|
type: "button"
|
|
75
75
|
},
|
|
76
76
|
g
|
|
77
77
|
);
|
|
78
|
-
},
|
|
78
|
+
}, ne = {
|
|
79
79
|
type: "Button",
|
|
80
80
|
label: "Button",
|
|
81
81
|
category: "core",
|
|
82
|
-
icon:
|
|
82
|
+
icon: C,
|
|
83
83
|
group: "basic",
|
|
84
84
|
...p({
|
|
85
85
|
properties: {
|
|
@@ -110,24 +110,24 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
110
110
|
}),
|
|
111
111
|
i18nProps: ["content"],
|
|
112
112
|
aiProps: ["content"]
|
|
113
|
-
},
|
|
114
|
-
const { blockProps:
|
|
113
|
+
}, re = (e) => {
|
|
114
|
+
const { blockProps: o, styles: t, htmlCode: n, inBuilder: l } = e;
|
|
115
115
|
return l ? /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
|
|
116
|
-
l ? /* @__PURE__ */ r.jsx("div", { ...
|
|
116
|
+
l ? /* @__PURE__ */ r.jsx("div", { ...o, ...t, className: "absolute z-20 h-full w-full" }) : null,
|
|
117
117
|
y.createElement("div", {
|
|
118
|
-
...
|
|
118
|
+
...t,
|
|
119
119
|
dangerouslySetInnerHTML: { __html: n.replace(/<script.*?>.*?<\/script>/g, "") }
|
|
120
120
|
})
|
|
121
121
|
] }) : y.createElement("div", {
|
|
122
|
-
...t,
|
|
123
122
|
...o,
|
|
123
|
+
...t,
|
|
124
124
|
dangerouslySetInnerHTML: { __html: n }
|
|
125
125
|
});
|
|
126
|
-
},
|
|
126
|
+
}, ie = {
|
|
127
127
|
type: "CustomHTML",
|
|
128
128
|
label: "web_blocks.custom_html",
|
|
129
129
|
category: "core",
|
|
130
|
-
icon:
|
|
130
|
+
icon: T,
|
|
131
131
|
group: "advanced",
|
|
132
132
|
...p({
|
|
133
133
|
properties: {
|
|
@@ -139,11 +139,11 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
})
|
|
142
|
-
},
|
|
143
|
-
const { blockProps:
|
|
142
|
+
}, se = (e) => {
|
|
143
|
+
const { blockProps: o, styles: t, backgroundImage: n } = e;
|
|
144
144
|
let l = {};
|
|
145
|
-
return n && (l = { backgroundImage: `url(${n})` }), y.createElement("div", { ...
|
|
146
|
-
},
|
|
145
|
+
return n && (l = { backgroundImage: `url(${n})` }), y.createElement("div", { ...o, ...t, style: l });
|
|
146
|
+
}, ae = {
|
|
147
147
|
type: "EmptyBox",
|
|
148
148
|
label: "Empty Box",
|
|
149
149
|
category: "core",
|
|
@@ -159,18 +159,18 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
})
|
|
162
|
-
},
|
|
163
|
-
const { blockProps:
|
|
164
|
-
return i ? y.createElement(l, { ...
|
|
165
|
-
...o,
|
|
162
|
+
}, ce = (e) => {
|
|
163
|
+
const { blockProps: o, styles: t, content: n, level: l = "h1", children: i = null } = e;
|
|
164
|
+
return i ? y.createElement(l, { ...t, ...o }, i) : y.createElement(l, {
|
|
166
165
|
...t,
|
|
166
|
+
...o,
|
|
167
167
|
dangerouslySetInnerHTML: { __html: n }
|
|
168
168
|
});
|
|
169
|
-
},
|
|
169
|
+
}, de = {
|
|
170
170
|
type: "Heading",
|
|
171
171
|
label: "web_blocks.heading",
|
|
172
172
|
category: "core",
|
|
173
|
-
icon:
|
|
173
|
+
icon: $,
|
|
174
174
|
group: "typography",
|
|
175
175
|
...p({
|
|
176
176
|
properties: {
|
|
@@ -193,17 +193,17 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
193
193
|
i18nProps: ["content"],
|
|
194
194
|
canAcceptBlock: (e) => e === "Span" || e === "Text"
|
|
195
195
|
}, ue = (e) => {
|
|
196
|
-
const { blockProps:
|
|
197
|
-
return
|
|
198
|
-
...o,
|
|
196
|
+
const { blockProps: o, styles: t, content: n } = e;
|
|
197
|
+
return Y(e.children) ? y.createElement("p", {
|
|
199
198
|
...t,
|
|
199
|
+
...o,
|
|
200
200
|
dangerouslySetInnerHTML: { __html: n }
|
|
201
|
-
}) : y.createElement("p", { ...
|
|
202
|
-
},
|
|
201
|
+
}) : y.createElement("p", { ...t, ...o }, e.children);
|
|
202
|
+
}, pe = {
|
|
203
203
|
type: "Paragraph",
|
|
204
204
|
label: "Paragraph",
|
|
205
205
|
category: "core",
|
|
206
|
-
icon:
|
|
206
|
+
icon: N,
|
|
207
207
|
group: "typography",
|
|
208
208
|
...p({
|
|
209
209
|
properties: {
|
|
@@ -221,14 +221,14 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
221
221
|
i18nProps: ["content"],
|
|
222
222
|
aiProps: ["content"],
|
|
223
223
|
canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
|
|
224
|
-
},
|
|
225
|
-
const { blockProps:
|
|
226
|
-
return l ? y.createElement("span", { ...
|
|
227
|
-
...o,
|
|
224
|
+
}, ge = (e) => {
|
|
225
|
+
const { blockProps: o, styles: t, content: n, children: l = null, tag: i } = e;
|
|
226
|
+
return l ? y.createElement("span", { ...t, ...o }, l) : y.createElement(i || "span", {
|
|
228
227
|
...t,
|
|
228
|
+
...o,
|
|
229
229
|
dangerouslySetInnerHTML: { __html: n || "" }
|
|
230
230
|
});
|
|
231
|
-
},
|
|
231
|
+
}, ye = {
|
|
232
232
|
type: "Span",
|
|
233
233
|
label: "Span",
|
|
234
234
|
category: "core",
|
|
@@ -247,10 +247,10 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
247
247
|
aiProps: ["content"],
|
|
248
248
|
i18nProps: ["content"],
|
|
249
249
|
canAcceptBlock: () => !0
|
|
250
|
-
},
|
|
251
|
-
const { blockProps:
|
|
252
|
-
return /* @__PURE__ */ r.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ r.jsx("div", { ...
|
|
253
|
-
},
|
|
250
|
+
}, me = (e) => {
|
|
251
|
+
const { blockProps: o, content: t, styles: n } = e;
|
|
252
|
+
return /* @__PURE__ */ r.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ r.jsx("div", { ...o, ...n, dangerouslySetInnerHTML: { __html: t } }) });
|
|
253
|
+
}, he = {
|
|
254
254
|
type: "RichText",
|
|
255
255
|
label: "Rich Text",
|
|
256
256
|
category: "core",
|
|
@@ -269,28 +269,28 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
269
269
|
}),
|
|
270
270
|
aiProps: ["content"],
|
|
271
271
|
i18nProps: ["content"]
|
|
272
|
-
},
|
|
273
|
-
const { blockProps:
|
|
272
|
+
}, fe = (e) => {
|
|
273
|
+
const { blockProps: o, link: t, children: n, styles: l, inBuilder: i, content: s } = e;
|
|
274
274
|
let a = {};
|
|
275
|
-
return !n && b(s) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), i ? n ? /* @__PURE__ */ r.jsx("span", { ...
|
|
275
|
+
return !n && b(s) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), i ? n ? /* @__PURE__ */ r.jsx("span", { ...o, style: a, ...l, children: n }) : y.createElement(
|
|
276
276
|
"span",
|
|
277
277
|
{
|
|
278
|
-
...
|
|
278
|
+
...o,
|
|
279
279
|
...l,
|
|
280
280
|
style: a
|
|
281
281
|
},
|
|
282
282
|
s
|
|
283
|
-
) : n ? /* @__PURE__ */ r.jsx("a", { href: (
|
|
283
|
+
) : n ? /* @__PURE__ */ r.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...o, ...l, children: n }) : y.createElement(
|
|
284
284
|
"a",
|
|
285
285
|
{
|
|
286
|
-
...
|
|
286
|
+
...o,
|
|
287
287
|
...l,
|
|
288
|
-
href: (
|
|
289
|
-
target: (
|
|
288
|
+
href: (t == null ? void 0 : t.href) || "#",
|
|
289
|
+
target: (t == null ? void 0 : t.target) || "_self"
|
|
290
290
|
},
|
|
291
291
|
s
|
|
292
292
|
);
|
|
293
|
-
},
|
|
293
|
+
}, be = {
|
|
294
294
|
type: "Link",
|
|
295
295
|
label: "Link",
|
|
296
296
|
category: "core",
|
|
@@ -325,28 +325,28 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
325
325
|
aiProps: ["content"],
|
|
326
326
|
i18nProps: ["content"],
|
|
327
327
|
canAcceptBlock: (e) => e !== "Link"
|
|
328
|
-
}, M = (e, ...
|
|
328
|
+
}, M = (e, ...o) => ({
|
|
329
329
|
...e,
|
|
330
|
-
className: I(e.className, ...
|
|
331
|
-
}),
|
|
332
|
-
const { blockProps:
|
|
333
|
-
if (!
|
|
330
|
+
className: I(e.className, ...o)
|
|
331
|
+
}), ke = (e) => {
|
|
332
|
+
const { blockProps: o, children: t, styles: n, inBuilder: l, content: i, href: s } = e, { hrefType: a, autoplay: d, maxWidth: g, backdropColor: h, galleryName: f } = e, m = M(n, "cb-lightbox");
|
|
333
|
+
if (!t && b(n == null ? void 0 : n.className) && b(i))
|
|
334
334
|
return /* @__PURE__ */ r.jsx(x, { inBuilder: l });
|
|
335
335
|
if (l)
|
|
336
|
-
return
|
|
337
|
-
...
|
|
336
|
+
return t ? /* @__PURE__ */ r.jsx("span", { ...o, ...m, children: t }) : y.createElement("span", {
|
|
337
|
+
...o,
|
|
338
338
|
...m,
|
|
339
339
|
dangerouslySetInnerHTML: { __html: i }
|
|
340
340
|
});
|
|
341
341
|
const k = {};
|
|
342
|
-
return k["data-vbtype"] = a,
|
|
343
|
-
...
|
|
342
|
+
return k["data-vbtype"] = a, d && (k["data-autoplay"] = "true"), g && (k["data-maxwidth"] = g + "px"), h && (k["data-overlay"] = h), f && (k["data-gall"] = f), t ? /* @__PURE__ */ r.jsx("a", { ...k, href: s || "#/", ...o, ...m, children: t }) : y.createElement("a", {
|
|
343
|
+
...o,
|
|
344
344
|
...m,
|
|
345
345
|
...k,
|
|
346
346
|
href: s || "#",
|
|
347
347
|
dangerouslySetInnerHTML: { __html: i }
|
|
348
348
|
});
|
|
349
|
-
},
|
|
349
|
+
}, xe = {
|
|
350
350
|
type: "LightBoxLink",
|
|
351
351
|
label: "Lightbox Link",
|
|
352
352
|
category: "core",
|
|
@@ -420,17 +420,17 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
420
420
|
i18nProps: ["content"],
|
|
421
421
|
aiProps: ["content"],
|
|
422
422
|
canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
|
|
423
|
-
},
|
|
424
|
-
const { blockProps:
|
|
425
|
-
return !
|
|
423
|
+
}, we = (e) => {
|
|
424
|
+
const { blockProps: o, children: t, listType: n, styles: l, tag: i, inBuilder: s } = e, a = I(v(l, "className", ""), n);
|
|
425
|
+
return !t && b(l == null ? void 0 : l.className) ? /* @__PURE__ */ r.jsx(x, { inBuilder: s }) : y.createElement(
|
|
426
426
|
i || (n === "list-decimal" ? "ol" : "ul"),
|
|
427
|
-
{ ...
|
|
428
|
-
|
|
427
|
+
{ ...o, ...l, className: a },
|
|
428
|
+
t
|
|
429
429
|
);
|
|
430
|
-
},
|
|
430
|
+
}, ve = {
|
|
431
431
|
type: "List",
|
|
432
432
|
label: "web_blocks.list",
|
|
433
|
-
icon:
|
|
433
|
+
icon: R,
|
|
434
434
|
category: "core",
|
|
435
435
|
group: "basic",
|
|
436
436
|
...p({
|
|
@@ -473,17 +473,17 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
473
473
|
content: "Item 3"
|
|
474
474
|
}
|
|
475
475
|
]
|
|
476
|
-
},
|
|
477
|
-
const { blockProps:
|
|
478
|
-
return l ? y.createElement(i || "li", { ...n, ...
|
|
476
|
+
}, Ie = (e) => {
|
|
477
|
+
const { blockProps: o, content: t, styles: n, children: l, tag: i } = e;
|
|
478
|
+
return l ? y.createElement(i || "li", { ...n, ...o }, l) : y.createElement(i || "li", {
|
|
479
479
|
...n,
|
|
480
|
-
...
|
|
481
|
-
dangerouslySetInnerHTML: { __html:
|
|
480
|
+
...o,
|
|
481
|
+
dangerouslySetInnerHTML: { __html: t }
|
|
482
482
|
});
|
|
483
483
|
}, Le = {
|
|
484
484
|
type: "ListItem",
|
|
485
485
|
label: "List Item",
|
|
486
|
-
icon:
|
|
486
|
+
icon: A,
|
|
487
487
|
category: "core",
|
|
488
488
|
group: "basic",
|
|
489
489
|
...p({
|
|
@@ -503,21 +503,21 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
503
503
|
aiProps: ["content"],
|
|
504
504
|
canAcceptBlock: (e) => e !== "ListItem",
|
|
505
505
|
canBeNested: (e) => e === "List"
|
|
506
|
-
},
|
|
507
|
-
const { blockProps:
|
|
508
|
-
if (b(
|
|
506
|
+
}, _e = (e) => {
|
|
507
|
+
const { blockProps: o, icon: t, styles: n, width: l, inBuilder: i, height: s } = e, a = M(n, I(l ? `w-[${l}px]` : "", s ? `h-[${s}px]` : ""));
|
|
508
|
+
if (b(t))
|
|
509
509
|
return /* @__PURE__ */ r.jsx(x, { inBuilder: i, className: "h-8 w-14" });
|
|
510
|
-
const
|
|
510
|
+
const d = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
511
511
|
return y.createElement("span", {
|
|
512
|
-
...
|
|
512
|
+
...o,
|
|
513
513
|
...a,
|
|
514
|
-
dangerouslySetInnerHTML: { __html:
|
|
514
|
+
dangerouslySetInnerHTML: { __html: d }
|
|
515
515
|
});
|
|
516
|
-
},
|
|
516
|
+
}, Be = {
|
|
517
517
|
type: "Icon",
|
|
518
518
|
label: "web_blocks.icon",
|
|
519
519
|
category: "core",
|
|
520
|
-
icon:
|
|
520
|
+
icon: D,
|
|
521
521
|
group: "media",
|
|
522
522
|
...p({
|
|
523
523
|
properties: {
|
|
@@ -541,17 +541,17 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
541
541
|
}
|
|
542
542
|
})
|
|
543
543
|
}, Pe = (e) => {
|
|
544
|
-
const { blockProps:
|
|
545
|
-
return b(
|
|
546
|
-
...
|
|
544
|
+
const { blockProps: o, image: t, styles: n, alt: l, height: i, width: s, lazyLoading: a } = e;
|
|
545
|
+
return b(t) ? /* @__PURE__ */ r.jsx(x, { className: "h-36" }) : y.createElement("img", {
|
|
546
|
+
...o,
|
|
547
547
|
...n,
|
|
548
|
-
src:
|
|
548
|
+
src: t,
|
|
549
549
|
alt: l,
|
|
550
550
|
loading: a ? "lazy" : "eager",
|
|
551
551
|
height: i,
|
|
552
552
|
width: s
|
|
553
553
|
});
|
|
554
|
-
},
|
|
554
|
+
}, Ce = {
|
|
555
555
|
type: "Image",
|
|
556
556
|
label: "Image",
|
|
557
557
|
category: "core",
|
|
@@ -611,57 +611,57 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
611
611
|
}),
|
|
612
612
|
aiProps: ["alt"],
|
|
613
613
|
i18nProps: ["alt"]
|
|
614
|
-
},
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
return
|
|
614
|
+
}, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, B = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, je = (e) => {
|
|
615
|
+
if (_.test(e)) {
|
|
616
|
+
const o = e.match(_);
|
|
617
|
+
return o ? `https://www.youtube.com/embed/${o[4]}` : e;
|
|
618
618
|
}
|
|
619
619
|
if (B.test(e)) {
|
|
620
|
-
const
|
|
621
|
-
return
|
|
620
|
+
const o = e.match(B);
|
|
621
|
+
return o ? `https://player.vimeo.com/video/${o[3]}` : e;
|
|
622
622
|
}
|
|
623
|
-
if (
|
|
624
|
-
const
|
|
625
|
-
return
|
|
623
|
+
if (P.test(e)) {
|
|
624
|
+
const o = e.match(P);
|
|
625
|
+
return o ? `https://www.dailymotion.com/embed/video/${o[4]}` : e;
|
|
626
626
|
}
|
|
627
627
|
return null;
|
|
628
|
-
},
|
|
629
|
-
const { blockProps:
|
|
628
|
+
}, Se = y.memo((e) => {
|
|
629
|
+
const { blockProps: o, inBuilder: t, styles: n, url: l, controls: i } = e, s = v(i, "autoPlay", !1), a = v(i, "controls", !1), d = s || v(i, "muted", !0), g = v(i, "loop", !1);
|
|
630
630
|
if (b(l))
|
|
631
|
-
return /* @__PURE__ */ r.jsx(x, { inBuilder:
|
|
632
|
-
let h =
|
|
631
|
+
return /* @__PURE__ */ r.jsx(x, { inBuilder: t, className: "h-36" });
|
|
632
|
+
let h = je(l), f = null;
|
|
633
633
|
if (h) {
|
|
634
634
|
if (!b(h)) {
|
|
635
635
|
const m = [];
|
|
636
|
-
m.push(`autoplay=${s ? 1 : 0}`), m.push(`controls=${i ? 1 : 0}`), m.push(`mute=${
|
|
636
|
+
m.push(`autoplay=${s ? 1 : 0}`), m.push(`controls=${i ? 1 : 0}`), m.push(`mute=${d ? 1 : 0}&muted=${d ? 1 : 0}`), m.push(`loop=${g ? 1 : 0}`), h = `${h}?${m.join("&")}`;
|
|
637
637
|
}
|
|
638
638
|
f = y.createElement("iframe", {
|
|
639
|
-
...
|
|
639
|
+
...o,
|
|
640
640
|
className: "absolute inset-0 w-full h-full",
|
|
641
641
|
src: h,
|
|
642
|
-
allow:
|
|
642
|
+
allow: t ? "" : "autoplay *; fullscreen *",
|
|
643
643
|
allowFullScreen: !0,
|
|
644
644
|
frameBorder: 0
|
|
645
645
|
});
|
|
646
646
|
} else
|
|
647
647
|
f = y.createElement("video", {
|
|
648
|
-
...
|
|
648
|
+
...o,
|
|
649
649
|
className: "absolute inset-0 w-full h-full",
|
|
650
650
|
src: l,
|
|
651
651
|
controls: a,
|
|
652
|
-
muted:
|
|
653
|
-
autoPlay:
|
|
652
|
+
muted: d,
|
|
653
|
+
autoPlay: t ? !1 : s,
|
|
654
654
|
loop: g
|
|
655
655
|
});
|
|
656
|
-
return /* @__PURE__ */ r.jsx("div", { ...
|
|
657
|
-
|
|
656
|
+
return /* @__PURE__ */ r.jsx("div", { ...Z(n, ["className"]), children: /* @__PURE__ */ r.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
657
|
+
t ? /* @__PURE__ */ r.jsx("div", { ...o, ...J(n, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
|
|
658
658
|
f
|
|
659
659
|
] }) });
|
|
660
|
-
}),
|
|
660
|
+
}), Me = {
|
|
661
661
|
type: "Video",
|
|
662
662
|
label: "Video",
|
|
663
663
|
category: "core",
|
|
664
|
-
icon:
|
|
664
|
+
icon: q,
|
|
665
665
|
group: "media",
|
|
666
666
|
...p({
|
|
667
667
|
properties: {
|
|
@@ -706,14 +706,14 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
706
706
|
}
|
|
707
707
|
}),
|
|
708
708
|
i18nProps: ["url"]
|
|
709
|
-
},
|
|
710
|
-
const { blockProps:
|
|
711
|
-
return y.createElement("hr", { ...
|
|
712
|
-
},
|
|
709
|
+
}, Ee = (e) => {
|
|
710
|
+
const { blockProps: o, styles: t } = e;
|
|
711
|
+
return y.createElement("hr", { ...t, ...o });
|
|
712
|
+
}, Te = {
|
|
713
713
|
type: "Divider",
|
|
714
714
|
label: "web_blocks.divider",
|
|
715
715
|
category: "core",
|
|
716
|
-
icon:
|
|
716
|
+
icon: F,
|
|
717
717
|
group: "basic",
|
|
718
718
|
...p({
|
|
719
719
|
properties: {
|
|
@@ -721,17 +721,17 @@ const te = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ r.jsx("d
|
|
|
721
721
|
}
|
|
722
722
|
})
|
|
723
723
|
};
|
|
724
|
-
function
|
|
725
|
-
return
|
|
724
|
+
function $e(e) {
|
|
725
|
+
return E({ 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);
|
|
726
726
|
}
|
|
727
|
-
const
|
|
728
|
-
const { scripts:
|
|
729
|
-
return
|
|
727
|
+
const Ne = (e) => {
|
|
728
|
+
const { scripts: o, inBuilder: t, blockProps: n } = e;
|
|
729
|
+
return t ? /* @__PURE__ */ r.jsx("div", { ...n, children: /* @__PURE__ */ r.jsx("div", { className: I("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ r.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ r.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" }) }) }) }) : /* @__PURE__ */ r.jsx("div", { dangerouslySetInnerHTML: { __html: o } });
|
|
730
730
|
}, He = {
|
|
731
731
|
type: "CustomScript",
|
|
732
732
|
label: "web_blocks.custom_script",
|
|
733
733
|
category: "core",
|
|
734
|
-
icon:
|
|
734
|
+
icon: $e,
|
|
735
735
|
group: "advanced",
|
|
736
736
|
...p({
|
|
737
737
|
properties: {
|
|
@@ -744,11 +744,11 @@ const De = (e) => {
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
})
|
|
747
|
-
}, ze = (e) => null,
|
|
747
|
+
}, ze = (e) => null, Re = {
|
|
748
748
|
type: "Dark Mode",
|
|
749
749
|
label: "web_blocks.dark_mode",
|
|
750
750
|
category: "core",
|
|
751
|
-
icon:
|
|
751
|
+
icon: G,
|
|
752
752
|
group: "advanced",
|
|
753
753
|
...p({
|
|
754
754
|
properties: {}
|
|
@@ -802,13 +802,13 @@ const De = (e) => {
|
|
|
802
802
|
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>"
|
|
803
803
|
}
|
|
804
804
|
]
|
|
805
|
-
},
|
|
806
|
-
const { blockProps:
|
|
807
|
-
return
|
|
805
|
+
}, Ae = (e) => {
|
|
806
|
+
const { blockProps: o, inBuilder: t, children: n, globalBlock: l } = e;
|
|
807
|
+
return t && !l ? /* @__PURE__ */ r.jsxs(
|
|
808
808
|
"div",
|
|
809
809
|
{
|
|
810
810
|
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
811
|
-
...
|
|
811
|
+
...o,
|
|
812
812
|
children: [
|
|
813
813
|
/* @__PURE__ */ r.jsxs("h1", { children: [
|
|
814
814
|
"Global Block - ",
|
|
@@ -817,11 +817,11 @@ const De = (e) => {
|
|
|
817
817
|
/* @__PURE__ */ r.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
|
|
818
818
|
]
|
|
819
819
|
}
|
|
820
|
-
) : y.createElement("div", { ...
|
|
821
|
-
},
|
|
820
|
+
) : y.createElement("div", { ...o }, n);
|
|
821
|
+
}, De = {
|
|
822
822
|
type: "GlobalBlock",
|
|
823
823
|
label: "Global Block",
|
|
824
|
-
icon:
|
|
824
|
+
icon: K,
|
|
825
825
|
category: "core",
|
|
826
826
|
group: "advanced",
|
|
827
827
|
...p({
|
|
@@ -836,7 +836,7 @@ const De = (e) => {
|
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
})
|
|
839
|
-
},
|
|
839
|
+
}, qe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`, Fe = {
|
|
840
840
|
type: "Text",
|
|
841
841
|
label: "Text",
|
|
842
842
|
hidden: !0,
|
|
@@ -854,10 +854,10 @@ const De = (e) => {
|
|
|
854
854
|
}),
|
|
855
855
|
aiProps: ["content"],
|
|
856
856
|
i18nProps: ["content"]
|
|
857
|
-
},
|
|
858
|
-
const { blockProps:
|
|
857
|
+
}, Ge = (e) => {
|
|
858
|
+
const { blockProps: o, backgroundImage: t, children: n, styles: l, tag: i } = e;
|
|
859
859
|
let s = {};
|
|
860
|
-
return
|
|
860
|
+
return t && (s = { backgroundImage: `url(${t})` }), y.createElement(i || "div", { ...o, ...l, style: s }, n);
|
|
861
861
|
}, Ve = {
|
|
862
862
|
type: "Body",
|
|
863
863
|
label: "Body",
|
|
@@ -904,8 +904,8 @@ const De = (e) => {
|
|
|
904
904
|
canMove: () => !1,
|
|
905
905
|
canDuplicate: () => !1
|
|
906
906
|
}, Oe = (e) => {
|
|
907
|
-
const { blockProps:
|
|
908
|
-
return y.createElement("br", { ...
|
|
907
|
+
const { blockProps: o, styles: t } = e;
|
|
908
|
+
return y.createElement("br", { ...o, ...t });
|
|
909
909
|
}, Ue = {
|
|
910
910
|
type: "LineBreak",
|
|
911
911
|
label: "Line Break",
|
|
@@ -921,11 +921,11 @@ const De = (e) => {
|
|
|
921
921
|
canDelete: () => !1,
|
|
922
922
|
canMove: () => !1,
|
|
923
923
|
canDuplicate: () => !1
|
|
924
|
-
},
|
|
925
|
-
const { children:
|
|
926
|
-
let a =
|
|
927
|
-
|
|
928
|
-
const
|
|
924
|
+
}, We = (e) => {
|
|
925
|
+
const { children: o, blockProps: t, errorMessage: n, successMessage: l, action: i, styles: s } = e;
|
|
926
|
+
let a = o;
|
|
927
|
+
o || (a = /* @__PURE__ */ r.jsx(x, {}));
|
|
928
|
+
const d = {
|
|
929
929
|
"x-data": "{}",
|
|
930
930
|
"x-on:submit.prevent": "post"
|
|
931
931
|
}, g = {
|
|
@@ -935,12 +935,12 @@ const De = (e) => {
|
|
|
935
935
|
return /* @__PURE__ */ r.jsxs(
|
|
936
936
|
"form",
|
|
937
937
|
{
|
|
938
|
-
...
|
|
938
|
+
...d,
|
|
939
939
|
"data-error": n,
|
|
940
940
|
"data-success": l,
|
|
941
941
|
method: "post",
|
|
942
942
|
action: i,
|
|
943
|
-
...
|
|
943
|
+
...t,
|
|
944
944
|
...s,
|
|
945
945
|
children: [
|
|
946
946
|
/* @__PURE__ */ r.jsx("div", { ...g }),
|
|
@@ -948,11 +948,11 @@ const De = (e) => {
|
|
|
948
948
|
]
|
|
949
949
|
}
|
|
950
950
|
);
|
|
951
|
-
},
|
|
951
|
+
}, Xe = {
|
|
952
952
|
type: "Form",
|
|
953
953
|
label: "Form",
|
|
954
954
|
category: "core",
|
|
955
|
-
icon:
|
|
955
|
+
icon: Q,
|
|
956
956
|
group: "form",
|
|
957
957
|
...p({
|
|
958
958
|
properties: {
|
|
@@ -979,8 +979,8 @@ const De = (e) => {
|
|
|
979
979
|
i18nProps: ["errorMessage", "successMessage"],
|
|
980
980
|
aiProps: ["errorMessage", "successMessage"],
|
|
981
981
|
canAcceptBlock: () => !0
|
|
982
|
-
},
|
|
983
|
-
const { blockProps:
|
|
982
|
+
}, Ye = (e) => {
|
|
983
|
+
const { blockProps: o, inBuilder: t, label: n, styles: l, inputStyles: i, icon: s, iconSize: a, iconPos: d } = e, g = w(), h = {
|
|
984
984
|
"x-bind:disabled": "formLoading"
|
|
985
985
|
};
|
|
986
986
|
return /* @__PURE__ */ r.jsxs(
|
|
@@ -990,26 +990,26 @@ const De = (e) => {
|
|
|
990
990
|
...h,
|
|
991
991
|
...i,
|
|
992
992
|
...l,
|
|
993
|
-
...
|
|
994
|
-
type:
|
|
993
|
+
...o || {},
|
|
994
|
+
type: t ? "button" : "submit",
|
|
995
995
|
children: [
|
|
996
996
|
n,
|
|
997
997
|
s && /* @__PURE__ */ r.jsx(
|
|
998
998
|
"div",
|
|
999
999
|
{
|
|
1000
1000
|
style: { width: a + "px" },
|
|
1001
|
-
className:
|
|
1001
|
+
className: d + " " + (d === "order-first" ? "mr-2" : "ml-2") || "",
|
|
1002
1002
|
dangerouslySetInnerHTML: { __html: s }
|
|
1003
1003
|
}
|
|
1004
1004
|
)
|
|
1005
1005
|
]
|
|
1006
1006
|
}
|
|
1007
1007
|
);
|
|
1008
|
-
},
|
|
1008
|
+
}, Ze = {
|
|
1009
1009
|
type: "FormButton",
|
|
1010
1010
|
label: "Submit Button",
|
|
1011
1011
|
category: "core",
|
|
1012
|
-
icon:
|
|
1012
|
+
icon: C,
|
|
1013
1013
|
group: "form",
|
|
1014
1014
|
...p({
|
|
1015
1015
|
properties: {
|
|
@@ -1045,35 +1045,35 @@ const De = (e) => {
|
|
|
1045
1045
|
}),
|
|
1046
1046
|
i18nProps: ["label"],
|
|
1047
1047
|
aiProps: ["label"]
|
|
1048
|
-
},
|
|
1049
|
-
const { blockProps:
|
|
1050
|
-
return a ? /* @__PURE__ */ r.jsxs("div", { ...i, ...
|
|
1048
|
+
}, Je = (e) => {
|
|
1049
|
+
const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, showLabel: a, required: d, inputType: g } = e, h = w();
|
|
1050
|
+
return a ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
|
|
1051
1051
|
a && /* @__PURE__ */ r.jsx("label", { htmlFor: h, children: n }),
|
|
1052
1052
|
/* @__PURE__ */ r.jsx(
|
|
1053
1053
|
"input",
|
|
1054
1054
|
{
|
|
1055
|
-
name:
|
|
1055
|
+
name: t,
|
|
1056
1056
|
...s,
|
|
1057
1057
|
id: h,
|
|
1058
1058
|
type: g,
|
|
1059
1059
|
placeholder: l,
|
|
1060
|
-
required:
|
|
1060
|
+
required: d
|
|
1061
1061
|
}
|
|
1062
1062
|
)
|
|
1063
1063
|
] }) : /* @__PURE__ */ r.jsx(
|
|
1064
1064
|
"input",
|
|
1065
1065
|
{
|
|
1066
1066
|
id: h,
|
|
1067
|
-
name:
|
|
1068
|
-
...
|
|
1067
|
+
name: t,
|
|
1068
|
+
...o,
|
|
1069
1069
|
...s,
|
|
1070
1070
|
...i,
|
|
1071
1071
|
type: g,
|
|
1072
1072
|
placeholder: l,
|
|
1073
|
-
required:
|
|
1073
|
+
required: d
|
|
1074
1074
|
}
|
|
1075
1075
|
);
|
|
1076
|
-
},
|
|
1076
|
+
}, Ke = {
|
|
1077
1077
|
type: "Input",
|
|
1078
1078
|
label: "web_blocks.input",
|
|
1079
1079
|
category: "core",
|
|
@@ -1128,25 +1128,25 @@ const De = (e) => {
|
|
|
1128
1128
|
}),
|
|
1129
1129
|
aiProps: ["label", "placeholder"],
|
|
1130
1130
|
i18nProps: ["label", "placeholder"]
|
|
1131
|
-
},
|
|
1132
|
-
const { blockProps:
|
|
1133
|
-
return
|
|
1134
|
-
/* @__PURE__ */ r.jsx("input", { ...i, name:
|
|
1131
|
+
}, Qe = (e) => {
|
|
1132
|
+
const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
|
|
1133
|
+
return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
|
|
1134
|
+
/* @__PURE__ */ r.jsx("input", { ...i, name: t, id: g, type: "radio", required: s, defaultChecked: a }),
|
|
1135
1135
|
n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
|
|
1136
1136
|
] }) : /* @__PURE__ */ r.jsx(
|
|
1137
1137
|
"input",
|
|
1138
1138
|
{
|
|
1139
1139
|
id: g,
|
|
1140
|
-
...
|
|
1140
|
+
...o,
|
|
1141
1141
|
...i,
|
|
1142
1142
|
...l,
|
|
1143
1143
|
type: "radio",
|
|
1144
1144
|
required: s,
|
|
1145
1145
|
checked: a,
|
|
1146
|
-
name:
|
|
1146
|
+
name: t
|
|
1147
1147
|
}
|
|
1148
1148
|
);
|
|
1149
|
-
},
|
|
1149
|
+
}, et = {
|
|
1150
1150
|
type: "Radio",
|
|
1151
1151
|
label: "web_blocks.radio",
|
|
1152
1152
|
category: "core",
|
|
@@ -1180,19 +1180,19 @@ const De = (e) => {
|
|
|
1180
1180
|
}),
|
|
1181
1181
|
aiProps: ["label"],
|
|
1182
1182
|
i18nProps: ["label"]
|
|
1183
|
-
},
|
|
1184
|
-
const { blockProps:
|
|
1185
|
-
return
|
|
1186
|
-
|
|
1187
|
-
/* @__PURE__ */ r.jsxs("select", { ...s, id: f, required: a, multiple: g, name:
|
|
1183
|
+
}, tt = (e) => {
|
|
1184
|
+
const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, required: a, showLabel: d, _multiple: g, options: h } = e, f = w();
|
|
1185
|
+
return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
|
|
1186
|
+
d && /* @__PURE__ */ r.jsx("label", { htmlFor: f, children: n }),
|
|
1187
|
+
/* @__PURE__ */ r.jsxs("select", { ...s, id: f, required: a, multiple: g, name: t, children: [
|
|
1188
1188
|
/* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
|
|
1189
|
-
|
|
1189
|
+
L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
|
|
1190
1190
|
] })
|
|
1191
|
-
] }) : /* @__PURE__ */ r.jsxs("select", { id: f, ...i, ...
|
|
1191
|
+
] }) : /* @__PURE__ */ r.jsxs("select", { id: f, ...i, ...o, required: a, multiple: g, name: t, children: [
|
|
1192
1192
|
/* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
|
|
1193
|
-
|
|
1193
|
+
L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
|
|
1194
1194
|
] });
|
|
1195
|
-
},
|
|
1195
|
+
}, ot = {
|
|
1196
1196
|
type: "Select",
|
|
1197
1197
|
label: "web_blocks.select",
|
|
1198
1198
|
category: "core",
|
|
@@ -1251,24 +1251,24 @@ const De = (e) => {
|
|
|
1251
1251
|
}),
|
|
1252
1252
|
aiProps: ["label", "placeholder"],
|
|
1253
1253
|
i18nProps: ["label", "placeholder"]
|
|
1254
|
-
},
|
|
1255
|
-
const { blockProps:
|
|
1256
|
-
return
|
|
1257
|
-
|
|
1258
|
-
/* @__PURE__ */ r.jsx("textarea", { name:
|
|
1254
|
+
}, lt = (e) => {
|
|
1255
|
+
const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, _rows: a, showLabel: d } = e, g = w();
|
|
1256
|
+
return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
|
|
1257
|
+
d && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n }),
|
|
1258
|
+
/* @__PURE__ */ r.jsx("textarea", { name: t, ...s, id: g, placeholder: l, rows: a })
|
|
1259
1259
|
] }) : /* @__PURE__ */ r.jsx(
|
|
1260
1260
|
"textarea",
|
|
1261
1261
|
{
|
|
1262
1262
|
id: g,
|
|
1263
|
-
name:
|
|
1264
|
-
...
|
|
1263
|
+
name: t,
|
|
1264
|
+
...o,
|
|
1265
1265
|
...s,
|
|
1266
1266
|
...i,
|
|
1267
1267
|
placeholder: l,
|
|
1268
1268
|
rows: a
|
|
1269
1269
|
}
|
|
1270
1270
|
);
|
|
1271
|
-
},
|
|
1271
|
+
}, nt = {
|
|
1272
1272
|
type: "TextArea",
|
|
1273
1273
|
label: "web_blocks.textarea",
|
|
1274
1274
|
category: "core",
|
|
@@ -1303,14 +1303,14 @@ const De = (e) => {
|
|
|
1303
1303
|
}),
|
|
1304
1304
|
aiProps: ["label", "placeholder"],
|
|
1305
1305
|
i18nProps: ["label", "placeholder"]
|
|
1306
|
-
},
|
|
1307
|
-
const { blockProps:
|
|
1308
|
-
return
|
|
1306
|
+
}, rt = (e) => {
|
|
1307
|
+
const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
|
|
1308
|
+
return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
|
|
1309
1309
|
/* @__PURE__ */ r.jsx(
|
|
1310
1310
|
"input",
|
|
1311
1311
|
{
|
|
1312
1312
|
...i,
|
|
1313
|
-
name:
|
|
1313
|
+
name: t,
|
|
1314
1314
|
id: g,
|
|
1315
1315
|
type: "checkbox",
|
|
1316
1316
|
required: s,
|
|
@@ -1322,19 +1322,19 @@ const De = (e) => {
|
|
|
1322
1322
|
"input",
|
|
1323
1323
|
{
|
|
1324
1324
|
id: g,
|
|
1325
|
-
...
|
|
1325
|
+
...o,
|
|
1326
1326
|
...i,
|
|
1327
1327
|
...l,
|
|
1328
1328
|
type: "checkbox",
|
|
1329
1329
|
required: s,
|
|
1330
|
-
name:
|
|
1330
|
+
name: t
|
|
1331
1331
|
}
|
|
1332
1332
|
);
|
|
1333
|
-
},
|
|
1333
|
+
}, it = {
|
|
1334
1334
|
type: "Checkbox",
|
|
1335
1335
|
label: "web_blocks.checkbox",
|
|
1336
1336
|
category: "core",
|
|
1337
|
-
icon:
|
|
1337
|
+
icon: W,
|
|
1338
1338
|
group: "form",
|
|
1339
1339
|
...p({
|
|
1340
1340
|
properties: {
|
|
@@ -1364,17 +1364,17 @@ const De = (e) => {
|
|
|
1364
1364
|
}),
|
|
1365
1365
|
aiProps: ["label"],
|
|
1366
1366
|
i18nProps: ["label"]
|
|
1367
|
-
},
|
|
1368
|
-
const { blockProps:
|
|
1367
|
+
}, st = (e) => {
|
|
1368
|
+
const { blockProps: o, content: t, styles: n, children: l } = e, i = { ...n, ...o };
|
|
1369
1369
|
return l ? y.createElement("label", i, l) : y.createElement("label", {
|
|
1370
1370
|
...i,
|
|
1371
|
-
dangerouslySetInnerHTML: { __html:
|
|
1371
|
+
dangerouslySetInnerHTML: { __html: t }
|
|
1372
1372
|
});
|
|
1373
|
-
},
|
|
1373
|
+
}, at = {
|
|
1374
1374
|
type: "Label",
|
|
1375
1375
|
label: "Label",
|
|
1376
1376
|
category: "core",
|
|
1377
|
-
icon:
|
|
1377
|
+
icon: X,
|
|
1378
1378
|
group: "form",
|
|
1379
1379
|
...p({
|
|
1380
1380
|
properties: {
|
|
@@ -1386,89 +1386,9 @@ const De = (e) => {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
1388
|
})
|
|
1389
|
-
},
|
|
1390
|
-
|
|
1391
|
-
button: { "x-on:click": "open = !open" },
|
|
1392
|
-
menu: { "x-show": "open", "x-on:click.away": "open = false" }
|
|
1393
|
-
}, dt = (e) => {
|
|
1394
|
-
const { blockProps: t, title: o, icon: n, iconWidth: l, iconHeight: i, styles: s } = e;
|
|
1395
|
-
return /* @__PURE__ */ r.jsxs("button", { ...t, ...E.button, ...s, children: [
|
|
1396
|
-
o,
|
|
1397
|
-
/* @__PURE__ */ r.jsx("span", { dangerouslySetInnerHTML: { __html: n }, style: { width: l, height: i } })
|
|
1398
|
-
] });
|
|
1399
|
-
};
|
|
1400
|
-
d(dt, {
|
|
1401
|
-
type: "DropdownButton",
|
|
1402
|
-
label: "Dropdown Button",
|
|
1403
|
-
group: "advanced",
|
|
1404
|
-
category: "core",
|
|
1405
|
-
hidden: !0,
|
|
1406
|
-
canMove: () => !1,
|
|
1407
|
-
canDelete: () => !1,
|
|
1408
|
-
...p({
|
|
1409
|
-
properties: {
|
|
1410
|
-
title: { type: "string", title: "Title", default: "Menu Item" },
|
|
1411
|
-
icon: { type: "string", title: "Icon", default: "", ui: { "ui:widget": "icon" } },
|
|
1412
|
-
iconWidth: { type: "string", title: "Icon Width", default: "16px" },
|
|
1413
|
-
iconHeight: { type: "string", title: "Icon Height", default: "16px" },
|
|
1414
|
-
styles: c("flex items-center gap-2 px-4 py-1")
|
|
1415
|
-
}
|
|
1416
|
-
})
|
|
1417
|
-
});
|
|
1418
|
-
const pt = (e) => {
|
|
1419
|
-
const { blockProps: t, children: o, styles: n } = e;
|
|
1420
|
-
return /* @__PURE__ */ r.jsx("div", { ...t, ...E.wrapper, className: "relative", children: /* @__PURE__ */ r.jsx("div", { ...n, children: o }) });
|
|
1421
|
-
};
|
|
1422
|
-
d(pt, {
|
|
1423
|
-
type: "DropdownMenuContent",
|
|
1424
|
-
label: "Dropdown Content",
|
|
1425
|
-
hidden: !0,
|
|
1426
|
-
canMove: () => !1,
|
|
1427
|
-
canDelete: () => !1,
|
|
1428
|
-
canAcceptBlock: () => !0,
|
|
1429
|
-
...p({
|
|
1430
|
-
properties: {
|
|
1431
|
-
styles: c("absolute left-0 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")
|
|
1432
|
-
}
|
|
1433
|
-
})
|
|
1434
|
-
});
|
|
1435
|
-
const ut = (e) => {
|
|
1436
|
-
const { children: t } = e;
|
|
1437
|
-
return t;
|
|
1438
|
-
}, gt = {
|
|
1439
|
-
type: "DropdownMenu",
|
|
1440
|
-
label: "Dropdown Menu",
|
|
1441
|
-
group: "advanced",
|
|
1442
|
-
blocks: () => [
|
|
1443
|
-
{ _type: "DropdownMenu", _id: "menu" },
|
|
1444
|
-
{
|
|
1445
|
-
_type: "DropdownButton",
|
|
1446
|
-
_id: "button",
|
|
1447
|
-
_parent: "menu",
|
|
1448
|
-
title: "Menu Item",
|
|
1449
|
-
icon: "",
|
|
1450
|
-
styles: "#styles:,flex items-center gap-2 px-4 py-1"
|
|
1451
|
-
},
|
|
1452
|
-
{
|
|
1453
|
-
_type: "DropdownMenuContent",
|
|
1454
|
-
_id: "content",
|
|
1455
|
-
_parent: "menu",
|
|
1456
|
-
styles: "#styles:,absolute left-0 w-80 mt-2 bg-white rounded-lg shadow-lg z-50"
|
|
1457
|
-
}
|
|
1458
|
-
],
|
|
1459
|
-
category: "core",
|
|
1460
|
-
...p({
|
|
1461
|
-
properties: {
|
|
1462
|
-
showDropdown: {
|
|
1463
|
-
type: "boolean",
|
|
1464
|
-
title: "Show Dropdown",
|
|
1465
|
-
default: !1
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
})
|
|
1469
|
-
}, vt = () => {
|
|
1470
|
-
d(oe, le), d(ae, ce), d(ne, re), d(de, pe), d(ue, ge), d(ye, me), d(he, fe), d(be, ke), d(xe, we), d(ve, Ie), d(_e, Le), d(Be, Ce), d(Pe, je), d(Me, Ee), d(ie, se), d(De, He), d(Fe, Ge), d(Xe, Ye), d(Ze, Je), d(Ke, Qe), d(it, st), d(et, tt), d(ot, lt), d(nt, rt), d(at, ct), d(Oe, Ue), d(We, Ve), d(Te, $e), d(ze, Ae), d(Re, qe), d(ut, gt);
|
|
1389
|
+
}, ft = () => {
|
|
1390
|
+
u(te, oe), u(se, ae), u(le, ne), u(ce, de), u(ue, pe), u(ge, ye), u(me, he), u(fe, be), u(ke, xe), u(we, ve), u(Ie, Le), u(_e, Be), u(Pe, Ce), u(Se, Me), u(re, ie), u(Ne, He), u(qe, Fe), u(We, Xe), u(Ye, Ze), u(Je, Ke), u(rt, it), u(Qe, et), u(tt, ot), u(lt, nt), u(st, at), u(Oe, Ue), u(Ge, Ve), u(Ee, Te), u(ze, Re), u(Ae, De);
|
|
1471
1391
|
};
|
|
1472
1392
|
export {
|
|
1473
|
-
|
|
1393
|
+
ft as loadWebBlocks
|
|
1474
1394
|
};
|