@chaibuilder/sdk 1.2.77 → 1.2.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeEditor-J-XqPeSx.js → CodeEditor-GsTOzMVg.js} +2 -2
- package/dist/{CodeEditor-qSebvlcW.cjs → CodeEditor-jefVJM0J.cjs} +1 -1
- package/dist/STRINGS-TDN5UhWi.js +7 -0
- package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
- package/dist/{Topbar-uwCF26N5.js → Topbar-Nc6eEWWP.js} +2 -2
- package/dist/{Topbar-tfoXdBnv.cjs → Topbar-XyIs0-bw.cjs} +1 -1
- package/dist/{UnsplashImages-wKvqSePy.cjs → UnsplashImages-CXv1GzLl.cjs} +1 -1
- package/dist/{UnsplashImages-ycaFnevC.js → UnsplashImages-SUnc-2ZG.js} +2 -2
- package/dist/{UploadImages-_y_ACWKk.cjs → UploadImages-h-IZsdZq.cjs} +1 -1
- package/dist/{UploadImages-SBOaVL2H.js → UploadImages-iewW_N13.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +25 -3
- package/dist/core.js +56 -53
- package/dist/{index-wgzGsKsU.js → index-5TMff_bN.js} +1107 -1070
- package/dist/{index-AnW6pixe.cjs → index-QtgjVIUR.cjs} +14 -14
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +38 -37
- package/package.json +1 -1
- package/dist/STRINGS-hZpwIZMT.cjs +0 -1
- package/dist/STRINGS-rPGH65PW.js +0 -8
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lodash-es"),a=require("./STRINGS-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lodash-es"),a=require("./STRINGS-Yl7cSWDc.cjs"),p=require("./jsx-runtime-JYMCiFoE.cjs"),h=require("react"),w=require("tailwind-merge"),x=require("@chaibuilder/runtime"),B=require("@mhsdesign/jit-browser-tailwindcss"),C=require("@tailwindcss/forms"),Y=require("@tailwindcss/typography"),q=require("@tailwindcss/aspect-ratio"),E=require("./plugin-P0tpo_XZ.cjs");require("tailwindcss-palette-generator");require("./plugin-_F-KZp1i.cjs");const _=(e,n="")=>{const s=e.replace(a.STYLES_KEY,"").split(",").map(i=>i.split(" ").map(l=>{if(l==="")return"";if(l.includes(":")){const o=l.split(":");return o[o.length-1]=n+r.last(o),o.join(":")}return`${n}${l}`}).join(" "));return r.flattenDeep(s).join(" ")},O=e=>{if(!e)return[];try{return JSON.parse(R(e)).filter(t=>!t._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function R(e){const n=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(n,t=>{const s=decodeURIComponent(t),i=s.indexOf("public");return i!==-1?s.substring(i+6):s})}const K=e=>{const n={};return Object.keys(e).forEach(t=>{r.isString(e[t])&&e[t].startsWith(a.SLOT_KEY)&&(n[t]=e[t].replace(a.SLOT_KEY,"").split(","))}),n},A=r.memoize((e,n)=>{const t=e.replace(a.STYLES_KEY,"").split(","),s=w.twMerge(t[0],t[1]);return n===""?s.replace(a.STYLES_KEY,"").trim():_(s,n).replace(a.STYLES_KEY,"").trim()});function L(e,n){const t=r.get(e,`${n}_attrs`,{});r.has(t,"data-ai-key")&&delete t["data-ai-key"];const s=r.keys(t).join(" ");return r.includes(s,"x-show")&&!r.includes(s,"x-transition")&&(t["x-transition"]=""),t}function N(e,n){const t={};return Object.keys(e).forEach(s=>{if(r.isString(e[s])&&e[s].startsWith(a.STYLES_KEY)){const i=A(e[s],n);t[s]={className:i,...L(e,s)}}}),t}function P(e,n){const t=r.get(e,"_bindings",{});return r.isEmpty(t)?{...e}:(r.each(t,(s,i)=>{r.isString(s)&&r.get(n,s,null)&&(e[i]=r.get(n,s,null))}),e)}function m({blocks:e,parent:n,classPrefix:t="",externalData:s={},blockModifierCallback:i}){const u=e,y=o=>N(o,t),l=n?r.filter(e,{_parent:n}):r.filter(e,o=>r.isEmpty(o._parent));return p.jsxRuntimeExports.jsx(p.jsxRuntimeExports.Fragment,{children:h.Children.toArray(l.map((o,j)=>{const d=K(o),g={};r.isEmpty(d)||Object.keys(d).forEach(c=>{g[c]=h.Children.toArray(d[c].map(S=>p.jsxRuntimeExports.jsx(m,{externalData:s,classPrefix:t,blocks:u,parent:S})))});const T=r.filter(u,{_parent:o._id});g.children=T.length>0?p.jsxRuntimeExports.jsx(m,{externalData:s,classPrefix:t,parent:o._id,blocks:u}):null;const f=x.getBlockComponent(o._type);if(f!==null){let c=o;const S=f.component;return c={...f.defaults,...o},i&&(c=i(c)),h.createElement(S,r.omit({blockProps:{},inBuilder:!1,...c,index:j,...P(o,s),...y(c),...g},["_parent"]))}return p.jsxRuntimeExports.jsxs("noscript",{children:[o._type," not found"]})}))})}async function $(e,n,t=[],s="",i=!1){return await B.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:t,theme:E.getChaiBuilderTheme(e),plugins:[C,Y,q,E.chaiBuilderPlugin],corePlugins:{preflight:i},...s?{prefix:`${s}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,n)}const v=(e,n)=>e.map(t=>{const s={};return Object.keys(t).forEach(i=>{r.startsWith(t[i],a.STYLES_KEY)&&(s[i]=_(t[i],n))}),s}),I=(e,n,t="",s=!1)=>$(n,[r.replace(JSON.stringify(v(e,t)),/#styles:/g,"")],[],t,s),J=async(e,n={},t="",s=!0)=>await I(e,n,t,s);exports.RenderChaiBlocks=m;exports.convertToBlocks=O;exports.getStylesForBlocks=J;
|
package/dist/render.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { last as T, flattenDeep as A, memoize as N, filter as h, isEmpty as S, omit as P, isString as _, get as u, each as R, has as $, keys as J, includes as j, replace as W, startsWith as I } from "lodash-es";
|
|
2
|
-
import { a as c, S as C } from "./STRINGS-
|
|
2
|
+
import { a as c, S as C } from "./STRINGS-TDN5UhWi.js";
|
|
3
3
|
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
4
4
|
import y from "react";
|
|
5
5
|
import { twMerge as K } from "tailwind-merge";
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),n=require("./jsx-runtime-JYMCiFoE.cjs"),E=require("react"),e=require("./iconBase-vJD0OXxU.cjs");require("i18next");const m=require("@radix-ui/react-icons"),h=require("lodash-es");require("clsx");require("tailwind-merge");function B(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return o.default=t,Object.freeze(o)}const b=B(E),I=({className:t="",inBuilder:o})=>o?n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",t),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:n.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,y=I,C=t=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=t;let u=r;r||(u=n.jsxRuntimeExports.jsx(y,{inBuilder:l}));let c={};return s&&(c={backgroundImage:`url(${s})`}),b.createElement(a,{...o,...i,style:c},u)},R={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:e.o({default:""}),tag:e.f({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:e.v({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},L=t=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:u}=t,c=s,d=u||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),c&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:c}})]});return b.createElement("button",{...o,...i,type:"button"},d)},S={type:"Button",label:"web_blocks.button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.g({title:"web_blocks.label",default:"Button"}),styles:e.o({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.T({title:"web_blocks.icon",default:""}),iconSize:e.y({title:"web_blocks.icon_size",default:24}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},M=t=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=t;return r?n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},N={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.o({default:""}),htmlCode:e.u({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},T=b.memo(t=>{const{blockProps:o,styles:l}=t;return b.createElement("div",{...o,...l})}),P={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:e.o({default:""})}},$=t=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:a=null}=t;return a?b.createElement(r,{...l,...o},a):b.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},q={type:"Heading",label:"web_blocks.heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:e.o({default:"text-3xl"}),content:e.r({title:"web_blocks.content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"},H=t=>{const{blockProps:o,styles:l,content:s}=t;return h.isNull(t.children)?b.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):b.createElement("p",{...l,...o},t.children)},D={type:"Paragraph",label:"web_blocks.paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"||t==="Text"},z=t=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:a}=t;return r?b.createElement("span",{...l,...o},r):b.createElement(a||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})},A={type:"Span",label:"web_blocks.span",category:"core",group:"typography",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:""})},canAcceptBlock:()=>!0},U=t=>{const{blockProps:o,content:l,styles:s}=t;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},F={type:"RichText",label:"web_blocks.richtext",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.o({default:""}),content:e.b({title:"web_blocks.content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},O=t=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:a,content:i}=t;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i)?n.jsxRuntimeExports.jsx(y,{inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{...o,...r,children:s}):b.createElement("span",{...o,...r,dangerouslySetInnerHTML:{__html:i}}):s?n.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):b.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self",dangerouslySetInnerHTML:{__html:i}})},V={type:"Link",label:"web_blocks.link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.o({default:""}),content:e.g({title:"web_blocks.content",default:""}),link:e.q({title:"web_blocks.link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:t=>t!=="Link"},j=(t,...o)=>({...t,className:e.cn(t.className,...o)}),G=t=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:a,href:i}=t,{hrefType:u,autoplay:c,maxWidth:d,backdropColor:f,galleryName:g}=t,k=j(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(a))return n.jsxRuntimeExports.jsx(y,{inBuilder:r});if(r)return l?n.jsxRuntimeExports.jsx("span",{...o,...k,children:l}):b.createElement("span",{...o,...k,dangerouslySetInnerHTML:{__html:a}});const x={};return x["data-vbtype"]=u,c&&(x["data-autoplay"]="true"),d&&(x["data-maxwidth"]=d+"px"),f&&(x["data-overlay"]=f),g&&(x["data-gall"]=g),l?n.jsxRuntimeExports.jsx("a",{...x,href:i||"#/",...o,...k,children:l}):b.createElement("a",{...o,...k,...x,href:i||"#",dangerouslySetInnerHTML:{__html:a}})},W={type:"LightBoxLink",label:"web_blocks.lightbox_link",category:"core",icon:m.ImageIcon,group:"basic",props:{styles:e.o({default:""}),content:e.g({title:"web_blocks.content",default:"Link text or drop blocks inside"}),href:e.g({title:"web_blocks.href",default:""}),hrefType:e.f({title:"web_blocks.type",default:"video",options:[{value:"video",title:"web_blocks.video"},{value:"iframe",title:"web_blocks.iframe"},{value:"inline",title:"web_blocks.inline"},{value:"ajax",title:"web_blocks.ajax"}]}),autoplay:e.c({title:"web_blocks.autoplay",default:!1}),maxWidth:e.y({title:"web_blocks.max_width",default:""}),backdropColor:e.g({title:"backdrop_color",default:""}),galleryName:e.g({title:"web_blocks.gallery_name",default:""})},canAcceptBlock:t=>t!=="Link"&&t!=="LightBoxLink"},X=t=>{const{blockProps:o,children:l,listType:s,styles:r,tag:a,inBuilder:i}=t,u=e.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(y,{inBuilder:i}):b.createElement(a||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:u},l)},Y={type:"List",label:"web_blocks.list",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.o({default:""}),listType:e.f({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:t=>t==="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"}]},Z=t=>{const{blockProps:o,content:l,styles:s,children:r,tag:a}=t;return r?b.createElement(a||"li",{...s,...o},r):b.createElement(a||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},J={type:"ListItem",label:"web_blocks.listitem",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:"List item"})},canAcceptBlock:t=>t!=="ListItem",canBeNested:t=>t==="List"},K=t=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:a,height:i}=t,u=j(s,e.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(l))return n.jsxRuntimeExports.jsx(y,{inBuilder:a,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...u,dangerouslySetInnerHTML:{__html:c}})},Q={type:"Icon",label:"web_blocks.icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.o({default:"text-black"}),icon:e.T({title:"web_blocks.icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:e.y({title:"web_blocks.width",default:""}),height:e.y({title:"web_blocks.height",default:""})}},ee=t=>{const{blockProps:o,image:l,styles:s,alt:r,height:a,width:i}=t;return h.isEmpty(l)?n.jsxRuntimeExports.jsx(y,{className:"h-36"}):b.createElement("img",{...o,...s,src:l,alt:r,loading:"lazy",height:a,width:i})},te={type:"Image",label:"web_blocks.image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.o({default:""}),image:e.v({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.g({title:"web_blocks.alt",default:""}),width:e.g({title:"web_blocks.width",default:""}),height:e.g({title:"web_blocks.height",default:""})}},_=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,w=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,v=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,le=t=>{if(_.test(t)){const o=t.match(_);return o?`https://www.youtube.com/embed/${o[4]}`:t}if(w.test(t)){const o=t.match(w);return o?`https://player.vimeo.com/video/${o[3]}`:t}if(v.test(t)){const o=t.match(v);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:t}return null},oe=b.memo(t=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:a}=t,i=h.get(a,"autoPlay",!1),u=h.get(a,"controls",!1),c=i||h.get(a,"muted",!0),d=h.get(a,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(y,{inBuilder:l,className:"h-36"});let f=le(r),g=null;if(f){if(!h.isEmpty(f)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${a?1:0}`),k.push(`mute=${c?1:0}&muted=${c?1:0}`),k.push(`loop=${d?1:0}`),f=`${f}?${k.join("&")}`}g=b.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=b.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:u,muted:c,autoPlay:l?!1:i,loop:d});return n.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})}),se={type:"Video",label:"web_blocks.video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.o({default:""}),url:e.g({title:"web_blocks.video_url",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.h({title:"web_blocks.controls",properties:{autoPlay:e.c({title:"web_blocks.autoplay",default:!0}),controls:e.c({title:"web_blocks.controls",default:!1}),loop:e.c({title:"web_blocks.loop",default:!1}),muted:e.c({title:"web_blocks.muted",default:!0})}})}};function re(t){return e.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:[]}]})(t)}const ne=t=>{const{scripts:o,inBuilder:l,blockProps:s}=t;return l?n.jsxRuntimeExports.jsx("div",{...s,children:n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ae={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:re,group:"advanced",props:{scripts:e.u({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ie=t=>{const{blockProps:o,styles:l}=t;return b.createElement("hr",{...l,...o})},ce={type:"Divider",label:"web_blocks.divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.o({default:"bg-gray-900 h-0.5 py-2 my-1"})}},ue=()=>null,de={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:m.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},pe=t=>t.inBuilder||t.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...t.blockProps,children:t.content}):`${t.content}`,be={type:"Text",label:"web_blocks.text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.r({title:"web_blocks.content",defaultValue:""})}},me=t=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=t;let a={};return l&&(a={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...r,style:a},s)},ge={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.o({default:"font-body antialiased"}),backgroundImage:e.v({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},he=t=>{const{blockProps:o,styles:l}=t;return b.createElement("br",{...o,...l})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.o({default:""})}},ke=t=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:u,children:c}=t;let d=c;c||(d=n.jsxRuntimeExports.jsx(y,{}));const f={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":a,method:"post",action:i,...o,...u,children:[n.jsxRuntimeExports.jsx("div",{...g}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},ye={type:"Form",label:"web_blocks.form",category:"core",icon:m.GroupIcon,group:"form",props:{styles:e.o({default:""}),action:e.g({title:"web_blocks.submit_url",default:"/api/form/submit"}),errorMessage:e.b({title:"web_blocks.error_message",default:"Something went wrong. Please try again"}),successMessage:e.b({title:"web_blocks.success_message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},xe=t=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:a,icon:i,iconPos:u}=t,c=e.generateUUID(),d={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:c,...d,...a,...r,...o||{},type:l?"button":"submit",children:[s,i&&n.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:i}})]})},_e={type:"FormButton",label:"web_blocks.submit_button",category:"core",icon:m.ButtonIcon,group:"form",props:{label:e.g({title:"web_blocks.label",default:"Submit"}),styles:e.o({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.T({title:"Icon",default:""}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},we=t=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:u,inputType:c="text",inBuilder:d,fieldName:f}=t,g=e.generateUUID();return!i||c==="submit"?(c==="submit"&&(o.value=l),n.jsxRuntimeExports.jsx("input",{id:g,name:f,readOnly:d,...o,...a,...r,type:c,placeholder:s,required:u})):n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),n.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...a,id:g,type:c,placeholder:s,required:u})]})},ve={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:{styles:e.o({default:""}),fieldName:e.g({title:"Field Name",default:"input"}),inputType:e.f({title:"web_blocks.type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.g({title:"web_blocks.value",default:""}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.c({title:"web_blocks.required",default:!1})}},je=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"radio",required:u,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"radio",required:u,checked:i,name:l})},Ee={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:{styles:e.o({default:"flex items-center w-max gap-x-2"}),fieldName:e.g({title:"web_blocks.field_name",default:"radio"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.c({title:"web_blocks.checked",default:!1}),required:e.c({title:"web_blocks.required",default:!1})}},Be=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:u,showLabel:c,_multiple:d=!1}=t,f=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:f,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...a,...o,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})},Ie={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:{styles:e.o({default:""}),fieldName:e.g({title:"web_blocks.field_name",default:"select"}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.c({title:"web_blocks.required",default:!1}),_multiple:e.c({title:"web_blocks.multiple",default:!1}),options:e.S({title:"web_blocks.options",itemProperties:{label:e.g({title:"web_blocks.label",default:""}),value:e.g({title:"web_blocks.value",default:""})}})}},Ce=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:u,showLabel:c}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,...o,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:d,placeholder:r,rows:u})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...i,...a,placeholder:r,rows:u})},Re={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:{fieldName:e.g({title:"web_blocks.field_name",default:"textarea"}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),styles:e.o({default:""}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),_rows:e.y({title:"web_blocks.rows",default:3})}},Le=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"checkbox",required:i,defaultChecked:u}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"checkbox",required:i,name:l})},Se={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:{fieldName:e.g({title:"Field Name",default:"checkbox"}),styles:e.o({default:"flex items-center gap-x-2"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.c({title:"web_blocks.checked",default:!1}),required:e.c({title:"web_blocks.required",default:!1})}},Me=()=>{p.registerChaiBlock(C,R),p.registerChaiBlock(T,P),p.registerChaiBlock(L,S),p.registerChaiBlock($,q),p.registerChaiBlock(H,D),p.registerChaiBlock(z,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,V),p.registerChaiBlock(G,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(oe,se),p.registerChaiBlock(M,N),p.registerChaiBlock(pe,be),p.registerChaiBlock(ke,ye),p.registerChaiBlock(xe,_e),p.registerChaiBlock(we,ve),p.registerChaiBlock(Le,Se),p.registerChaiBlock(je,Ee),p.registerChaiBlock(Be,Ie),p.registerChaiBlock(Ce,Re),p.registerChaiBlock(he,fe),p.registerChaiBlock(me,ge),p.registerChaiBlock(ne,ae),p.registerChaiBlock(ie,ce),p.registerChaiBlock(ue,de)};exports.loadWebBlocks=Me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),n=require("./jsx-runtime-JYMCiFoE.cjs"),E=require("react"),e=require("./iconBase-vJD0OXxU.cjs");require("i18next");const m=require("@radix-ui/react-icons"),h=require("lodash-es");require("clsx");require("tailwind-merge");function B(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return o.default=t,Object.freeze(o)}const b=B(E),I=({className:t="",inBuilder:o})=>o?n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",t),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:n.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,y=I,C=t=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=t;let u=r;r||(u=n.jsxRuntimeExports.jsx(y,{inBuilder:l}));let c={};return s&&(c={backgroundImage:`url(${s})`}),b.createElement(a,{...o,...i,style:c},u)},R={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:e.o({default:""}),tag:e.f({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:e.v({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},L=t=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:u}=t,c=s,d=u||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),c&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:c}})]});return b.createElement("button",{...o,...i,type:"button"},d)},S={type:"Button",label:"web_blocks.button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.g({title:"web_blocks.label",default:"Button"}),styles:e.o({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.T({title:"web_blocks.icon",default:""}),iconSize:e.y({title:"web_blocks.icon_size",default:24}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},M=t=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=t;return r?n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},N={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.o({default:""}),htmlCode:e.u({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},T=b.memo(t=>{const{blockProps:o,styles:l}=t;return b.createElement("div",{...o,...l})}),P={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:e.o({default:""}),backgroundImage:e.v({title:"web_blocks.background_image"})}},$=t=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:a=null}=t;return a?b.createElement(r,{...l,...o},a):b.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},q={type:"Heading",label:"web_blocks.heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:e.o({default:"text-3xl"}),content:e.r({title:"web_blocks.content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"},H=t=>{const{blockProps:o,styles:l,content:s}=t;return h.isNull(t.children)?b.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):b.createElement("p",{...l,...o},t.children)},D={type:"Paragraph",label:"web_blocks.paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"||t==="Text"},z=t=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:a}=t;return r?b.createElement("span",{...l,...o},r):b.createElement(a||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})},A={type:"Span",label:"web_blocks.span",category:"core",group:"typography",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:""})},canAcceptBlock:()=>!0},U=t=>{const{blockProps:o,content:l,styles:s}=t;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},F={type:"RichText",label:"web_blocks.richtext",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.o({default:""}),content:e.b({title:"web_blocks.content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},O=t=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:a,content:i}=t;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i)?n.jsxRuntimeExports.jsx(y,{inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{...o,...r,children:s}):b.createElement("span",{...o,...r,dangerouslySetInnerHTML:{__html:i}}):s?n.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):b.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self",dangerouslySetInnerHTML:{__html:i}})},V={type:"Link",label:"web_blocks.link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.o({default:""}),content:e.g({title:"web_blocks.content",default:""}),link:e.q({title:"web_blocks.link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:t=>t!=="Link"},j=(t,...o)=>({...t,className:e.cn(t.className,...o)}),G=t=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:a,href:i}=t,{hrefType:u,autoplay:c,maxWidth:d,backdropColor:f,galleryName:g}=t,k=j(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(a))return n.jsxRuntimeExports.jsx(y,{inBuilder:r});if(r)return l?n.jsxRuntimeExports.jsx("span",{...o,...k,children:l}):b.createElement("span",{...o,...k,dangerouslySetInnerHTML:{__html:a}});const x={};return x["data-vbtype"]=u,c&&(x["data-autoplay"]="true"),d&&(x["data-maxwidth"]=d+"px"),f&&(x["data-overlay"]=f),g&&(x["data-gall"]=g),l?n.jsxRuntimeExports.jsx("a",{...x,href:i||"#/",...o,...k,children:l}):b.createElement("a",{...o,...k,...x,href:i||"#",dangerouslySetInnerHTML:{__html:a}})},W={type:"LightBoxLink",label:"web_blocks.lightbox_link",category:"core",icon:m.ImageIcon,group:"basic",props:{styles:e.o({default:""}),content:e.g({title:"web_blocks.content",default:"Link text or drop blocks inside"}),href:e.g({title:"web_blocks.href",default:""}),hrefType:e.f({title:"web_blocks.type",default:"video",options:[{value:"video",title:"web_blocks.video"},{value:"iframe",title:"web_blocks.iframe"},{value:"inline",title:"web_blocks.inline"},{value:"ajax",title:"web_blocks.ajax"}]}),autoplay:e.c({title:"web_blocks.autoplay",default:!1}),maxWidth:e.y({title:"web_blocks.max_width",default:""}),backdropColor:e.g({title:"backdrop_color",default:""}),galleryName:e.g({title:"web_blocks.gallery_name",default:""})},canAcceptBlock:t=>t!=="Link"&&t!=="LightBoxLink"},X=t=>{const{blockProps:o,children:l,listType:s,styles:r,tag:a,inBuilder:i}=t,u=e.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(y,{inBuilder:i}):b.createElement(a||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:u},l)},Y={type:"List",label:"web_blocks.list",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.o({default:""}),listType:e.f({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:t=>t==="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"}]},Z=t=>{const{blockProps:o,content:l,styles:s,children:r,tag:a}=t;return r?b.createElement(a||"li",{...s,...o},r):b.createElement(a||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},J={type:"ListItem",label:"web_blocks.listitem",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.o({default:""}),content:e.r({title:"web_blocks.content",default:"List item"})},canAcceptBlock:t=>t!=="ListItem",canBeNested:t=>t==="List"},K=t=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:a,height:i}=t,u=j(s,e.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(l))return n.jsxRuntimeExports.jsx(y,{inBuilder:a,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...u,dangerouslySetInnerHTML:{__html:c}})},Q={type:"Icon",label:"web_blocks.icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.o({default:"text-black"}),icon:e.T({title:"web_blocks.icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:e.y({title:"web_blocks.width",default:""}),height:e.y({title:"web_blocks.height",default:""})}},ee=t=>{const{blockProps:o,image:l,styles:s,alt:r,height:a,width:i}=t;return h.isEmpty(l)?n.jsxRuntimeExports.jsx(y,{className:"h-36"}):b.createElement("img",{...o,...s,src:l,alt:r,loading:"lazy",height:a,width:i})},te={type:"Image",label:"web_blocks.image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.o({default:""}),image:e.v({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.g({title:"web_blocks.alt",default:""}),width:e.g({title:"web_blocks.width",default:""}),height:e.g({title:"web_blocks.height",default:""})}},_=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,w=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,v=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,le=t=>{if(_.test(t)){const o=t.match(_);return o?`https://www.youtube.com/embed/${o[4]}`:t}if(w.test(t)){const o=t.match(w);return o?`https://player.vimeo.com/video/${o[3]}`:t}if(v.test(t)){const o=t.match(v);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:t}return null},oe=b.memo(t=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:a}=t,i=h.get(a,"autoPlay",!1),u=h.get(a,"controls",!1),c=i||h.get(a,"muted",!0),d=h.get(a,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(y,{inBuilder:l,className:"h-36"});let f=le(r),g=null;if(f){if(!h.isEmpty(f)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${a?1:0}`),k.push(`mute=${c?1:0}&muted=${c?1:0}`),k.push(`loop=${d?1:0}`),f=`${f}?${k.join("&")}`}g=b.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=b.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:u,muted:c,autoPlay:l?!1:i,loop:d});return n.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})}),se={type:"Video",label:"web_blocks.video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.o({default:""}),url:e.g({title:"web_blocks.video_url",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.h({title:"web_blocks.controls",properties:{autoPlay:e.c({title:"web_blocks.autoplay",default:!0}),controls:e.c({title:"web_blocks.controls",default:!1}),loop:e.c({title:"web_blocks.loop",default:!1}),muted:e.c({title:"web_blocks.muted",default:!0})}})}};function re(t){return e.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:[]}]})(t)}const ne=t=>{const{scripts:o,inBuilder:l,blockProps:s}=t;return l?n.jsxRuntimeExports.jsx("div",{...s,children:n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ae={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:re,group:"advanced",props:{scripts:e.u({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ie=t=>{const{blockProps:o,styles:l}=t;return b.createElement("hr",{...l,...o})},ce={type:"Divider",label:"web_blocks.divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.o({default:"bg-gray-900 h-0.5 py-2 my-1"})}},ue=()=>null,de={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:m.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},pe=t=>t.inBuilder||t.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...t.blockProps,children:t.content}):`${t.content}`,be={type:"Text",label:"web_blocks.text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.r({title:"web_blocks.content",defaultValue:""})}},me=t=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=t;let a={};return l&&(a={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...r,style:a},s)},ge={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.o({default:"font-body antialiased"}),backgroundImage:e.v({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},he=t=>{const{blockProps:o,styles:l}=t;return b.createElement("br",{...o,...l})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.o({default:""})}},ke=t=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:u,children:c}=t;let d=c;c||(d=n.jsxRuntimeExports.jsx(y,{}));const f={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":a,method:"post",action:i,...o,...u,children:[n.jsxRuntimeExports.jsx("div",{...g}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},ye={type:"Form",label:"web_blocks.form",category:"core",icon:m.GroupIcon,group:"form",props:{styles:e.o({default:""}),action:e.g({title:"web_blocks.submit_url",default:"/api/form/submit"}),errorMessage:e.b({title:"web_blocks.error_message",default:"Something went wrong. Please try again"}),successMessage:e.b({title:"web_blocks.success_message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},xe=t=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:a,icon:i,iconPos:u}=t,c=e.generateUUID(),d={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:c,...d,...a,...r,...o||{},type:l?"button":"submit",children:[s,i&&n.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:i}})]})},_e={type:"FormButton",label:"web_blocks.submit_button",category:"core",icon:m.ButtonIcon,group:"form",props:{label:e.g({title:"web_blocks.label",default:"Submit"}),styles:e.o({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.T({title:"Icon",default:""}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},we=t=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:u,inputType:c="text",inBuilder:d,fieldName:f}=t,g=e.generateUUID();return!i||c==="submit"?(c==="submit"&&(o.value=l),n.jsxRuntimeExports.jsx("input",{id:g,name:f,readOnly:d,...o,...a,...r,type:c,placeholder:s,required:u})):n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),n.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...a,id:g,type:c,placeholder:s,required:u})]})},ve={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:{styles:e.o({default:""}),fieldName:e.g({title:"Field Name",default:"input"}),inputType:e.f({title:"web_blocks.type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.g({title:"web_blocks.value",default:""}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.c({title:"web_blocks.required",default:!1})}},je=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"radio",required:u,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"radio",required:u,checked:i,name:l})},Ee={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:{styles:e.o({default:"flex items-center w-max gap-x-2"}),fieldName:e.g({title:"web_blocks.field_name",default:"radio"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.c({title:"web_blocks.checked",default:!1}),required:e.c({title:"web_blocks.required",default:!1})}},Be=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:u,showLabel:c,_multiple:d=!1}=t,f=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:f,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...a,...o,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})},Ie={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:{styles:e.o({default:""}),fieldName:e.g({title:"web_blocks.field_name",default:"select"}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.c({title:"web_blocks.required",default:!1}),_multiple:e.c({title:"web_blocks.multiple",default:!1}),options:e.S({title:"web_blocks.options",itemProperties:{label:e.g({title:"web_blocks.label",default:""}),value:e.g({title:"web_blocks.value",default:""})}})}},Ce=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:u,showLabel:c}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,...o,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:d,placeholder:r,rows:u})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...i,...a,placeholder:r,rows:u})},Re={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:{fieldName:e.g({title:"web_blocks.field_name",default:"textarea"}),showLabel:e.c({title:"web_blocks.show_label",default:!0}),styles:e.o({default:""}),inputStyles:e.o({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),_rows:e.y({title:"web_blocks.rows",default:3})}},Le=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"checkbox",required:i,defaultChecked:u}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"checkbox",required:i,name:l})},Se={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:{fieldName:e.g({title:"Field Name",default:"checkbox"}),styles:e.o({default:"flex items-center gap-x-2"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.c({title:"web_blocks.checked",default:!1}),required:e.c({title:"web_blocks.required",default:!1})}},Me=()=>{p.registerChaiBlock(C,R),p.registerChaiBlock(T,P),p.registerChaiBlock(L,S),p.registerChaiBlock($,q),p.registerChaiBlock(H,D),p.registerChaiBlock(z,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,V),p.registerChaiBlock(G,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(oe,se),p.registerChaiBlock(M,N),p.registerChaiBlock(pe,be),p.registerChaiBlock(ke,ye),p.registerChaiBlock(xe,_e),p.registerChaiBlock(we,ve),p.registerChaiBlock(Le,Se),p.registerChaiBlock(je,Ee),p.registerChaiBlock(Be,Ie),p.registerChaiBlock(Ce,Re),p.registerChaiBlock(he,fe),p.registerChaiBlock(me,ge),p.registerChaiBlock(ne,ae),p.registerChaiBlock(ie,ce),p.registerChaiBlock(ue,de)};exports.loadWebBlocks=Me;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { registerChaiBlock as u } from "@chaibuilder/runtime";
|
|
2
2
|
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import { c as j, o as p, f as v, v as
|
|
4
|
+
import { c as j, o as p, f as v, v as C, b, T as N, y as B, u as T, r as L, d as S, q as D, e as k, h as F, G as O, g as I, S as U } from "./iconBase-zweRWSz0.js";
|
|
5
5
|
import "i18next";
|
|
6
6
|
import { ButtonIcon as H, CodeIcon as V, HeadingIcon as G, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as z, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as q, GroupIcon as le, InputIcon as A, RadiobuttonIcon as oe, DropdownMenuIcon as se, CheckboxIcon as ae } from "@radix-ui/react-icons";
|
|
7
|
-
import { isNull as ne, isEmpty as g, get as x, pick as re, omit as ce, map as
|
|
7
|
+
import { isNull as ne, isEmpty as g, get as x, pick as re, omit as ce, map as M } from "lodash-es";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
10
|
const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ a.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, _ = ie, de = (e) => {
|
|
@@ -43,7 +43,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
43
43
|
{ value: "mark", title: "web_blocks.mark" }
|
|
44
44
|
]
|
|
45
45
|
}),
|
|
46
|
-
backgroundImage:
|
|
46
|
+
backgroundImage: C({ title: "web_blocks.background_image" })
|
|
47
47
|
},
|
|
48
48
|
canAcceptBlock: () => !0
|
|
49
49
|
}, be = (e) => {
|
|
@@ -119,15 +119,16 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
119
119
|
const { blockProps: l, styles: t } = e;
|
|
120
120
|
return m.createElement("div", { ...l, ...t });
|
|
121
121
|
}
|
|
122
|
-
),
|
|
122
|
+
), ke = {
|
|
123
123
|
type: "EmptyBox",
|
|
124
124
|
label: "web_blocks.empty_box",
|
|
125
125
|
category: "core",
|
|
126
126
|
group: "basic",
|
|
127
127
|
props: {
|
|
128
|
-
styles: p({ default: "" })
|
|
128
|
+
styles: p({ default: "" }),
|
|
129
|
+
backgroundImage: C({ title: "web_blocks.background_image" })
|
|
129
130
|
}
|
|
130
|
-
},
|
|
131
|
+
}, ye = (e) => {
|
|
131
132
|
const { blockProps: l, styles: t, content: s, level: o = "h1", children: n = null } = e;
|
|
132
133
|
return n ? m.createElement(o, { ...t, ...l }, n) : m.createElement(o, {
|
|
133
134
|
...t,
|
|
@@ -221,7 +222,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
221
222
|
group: "typography",
|
|
222
223
|
props: {
|
|
223
224
|
styles: p({ default: "" }),
|
|
224
|
-
content:
|
|
225
|
+
content: S({
|
|
225
226
|
title: "web_blocks.content",
|
|
226
227
|
default: "<p>This is a rich text block. You can add text, and other content here.</p>"
|
|
227
228
|
})
|
|
@@ -259,19 +260,19 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
259
260
|
...e,
|
|
260
261
|
className: j(e.className, ...l)
|
|
261
262
|
}), Ce = (e) => {
|
|
262
|
-
const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href: r } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e,
|
|
263
|
+
const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href: r } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, y = R(s, "cb-lightbox");
|
|
263
264
|
if (!t && g(s == null ? void 0 : s.className) && g(n))
|
|
264
265
|
return /* @__PURE__ */ a.jsx(_, { inBuilder: o });
|
|
265
266
|
if (o)
|
|
266
|
-
return t ? /* @__PURE__ */ a.jsx("span", { ...l, ...
|
|
267
|
+
return t ? /* @__PURE__ */ a.jsx("span", { ...l, ...y, children: t }) : m.createElement("span", {
|
|
267
268
|
...l,
|
|
268
|
-
...
|
|
269
|
+
...y,
|
|
269
270
|
dangerouslySetInnerHTML: { __html: n }
|
|
270
271
|
});
|
|
271
272
|
const w = {};
|
|
272
|
-
return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ a.jsx("a", { ...w, href: r || "#/", ...l, ...
|
|
273
|
+
return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ a.jsx("a", { ...w, href: r || "#/", ...l, ...y, children: t }) : m.createElement("a", {
|
|
273
274
|
...l,
|
|
274
|
-
...
|
|
275
|
+
...y,
|
|
275
276
|
...w,
|
|
276
277
|
href: r || "#",
|
|
277
278
|
dangerouslySetInnerHTML: { __html: n }
|
|
@@ -296,7 +297,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
296
297
|
{ value: "ajax", title: "web_blocks.ajax" }
|
|
297
298
|
]
|
|
298
299
|
}),
|
|
299
|
-
autoplay:
|
|
300
|
+
autoplay: k({ title: "web_blocks.autoplay", default: !1 }),
|
|
300
301
|
maxWidth: B({ title: "web_blocks.max_width", default: "" }),
|
|
301
302
|
backdropColor: b({ title: "backdrop_color", default: "" }),
|
|
302
303
|
galleryName: b({ title: "web_blocks.gallery_name", default: "" })
|
|
@@ -416,7 +417,7 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
416
417
|
group: "media",
|
|
417
418
|
props: {
|
|
418
419
|
styles: p({ default: "" }),
|
|
419
|
-
image:
|
|
420
|
+
image: C({
|
|
420
421
|
title: "Image",
|
|
421
422
|
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
422
423
|
}),
|
|
@@ -446,8 +447,8 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
446
447
|
let h = qe(o), f = null;
|
|
447
448
|
if (h) {
|
|
448
449
|
if (!g(h)) {
|
|
449
|
-
const
|
|
450
|
-
|
|
450
|
+
const y = [];
|
|
451
|
+
y.push(`autoplay=${r ? 1 : 0}`), y.push(`controls=${n ? 1 : 0}`), y.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), y.push(`loop=${d ? 1 : 0}`), h = `${h}?${y.join("&")}`;
|
|
451
452
|
}
|
|
452
453
|
f = m.createElement("iframe", {
|
|
453
454
|
...l,
|
|
@@ -487,10 +488,10 @@ const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("d
|
|
|
487
488
|
controls: F({
|
|
488
489
|
title: "web_blocks.controls",
|
|
489
490
|
properties: {
|
|
490
|
-
autoPlay:
|
|
491
|
-
controls:
|
|
492
|
-
loop:
|
|
493
|
-
muted:
|
|
491
|
+
autoPlay: k({ title: "web_blocks.autoplay", default: !0 }),
|
|
492
|
+
controls: k({ title: "web_blocks.controls", default: !1 }),
|
|
493
|
+
loop: k({ title: "web_blocks.loop", default: !1 }),
|
|
494
|
+
muted: k({ title: "web_blocks.muted", default: !0 })
|
|
494
495
|
}
|
|
495
496
|
})
|
|
496
497
|
}
|
|
@@ -604,7 +605,7 @@ const Fe = (e) => {
|
|
|
604
605
|
hidden: !0,
|
|
605
606
|
props: {
|
|
606
607
|
styles: p({ default: "font-body antialiased" }),
|
|
607
|
-
backgroundImage:
|
|
608
|
+
backgroundImage: C({ title: "Background Image" })
|
|
608
609
|
},
|
|
609
610
|
canAcceptBlock: () => !0,
|
|
610
611
|
canDelete: () => !1,
|
|
@@ -663,11 +664,11 @@ const Fe = (e) => {
|
|
|
663
664
|
title: "web_blocks.submit_url",
|
|
664
665
|
default: "/api/form/submit"
|
|
665
666
|
}),
|
|
666
|
-
errorMessage:
|
|
667
|
+
errorMessage: S({
|
|
667
668
|
title: "web_blocks.error_message",
|
|
668
669
|
default: "Something went wrong. Please try again"
|
|
669
670
|
}),
|
|
670
|
-
successMessage:
|
|
671
|
+
successMessage: S({
|
|
671
672
|
title: "web_blocks.success_message",
|
|
672
673
|
default: "Thank you for your submission."
|
|
673
674
|
})
|
|
@@ -765,7 +766,7 @@ const Fe = (e) => {
|
|
|
765
766
|
fieldName: b({ title: "Field Name", default: "input" }),
|
|
766
767
|
inputType: v({
|
|
767
768
|
title: "web_blocks.type",
|
|
768
|
-
options:
|
|
769
|
+
options: M(
|
|
769
770
|
["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
|
|
770
771
|
(e) => ({
|
|
771
772
|
value: e,
|
|
@@ -775,14 +776,14 @@ const Fe = (e) => {
|
|
|
775
776
|
default: "text"
|
|
776
777
|
}),
|
|
777
778
|
value: b({ title: "web_blocks.value", default: "" }),
|
|
778
|
-
showLabel:
|
|
779
|
+
showLabel: k({ title: "web_blocks.show_label", default: !0 }),
|
|
779
780
|
inputStyles: p({ default: "w-full p-1" }),
|
|
780
781
|
label: b({ title: "web_blocks.label", default: "Label" }),
|
|
781
782
|
placeholder: b({
|
|
782
783
|
title: "web_blocks.placeholder",
|
|
783
784
|
default: "Placeholder"
|
|
784
785
|
}),
|
|
785
|
-
required:
|
|
786
|
+
required: k({ title: "web_blocks.required", default: !1 })
|
|
786
787
|
}
|
|
787
788
|
}, nt = (e) => {
|
|
788
789
|
const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, checked: r, required: i, showLabel: c = !0 } = e, d = I();
|
|
@@ -812,8 +813,8 @@ const Fe = (e) => {
|
|
|
812
813
|
styles: p({ default: "flex items-center w-max gap-x-2" }),
|
|
813
814
|
fieldName: b({ title: "web_blocks.field_name", default: "radio" }),
|
|
814
815
|
label: b({ title: "web_blocks.label", default: "Label" }),
|
|
815
|
-
checked:
|
|
816
|
-
required:
|
|
816
|
+
checked: k({ title: "web_blocks.checked", default: !1 }),
|
|
817
|
+
required: k({ title: "web_blocks.required", default: !1 })
|
|
817
818
|
}
|
|
818
819
|
}, ct = (e) => {
|
|
819
820
|
const {
|
|
@@ -831,7 +832,7 @@ const Fe = (e) => {
|
|
|
831
832
|
c && /* @__PURE__ */ a.jsx("label", { htmlFor: h, children: s }),
|
|
832
833
|
/* @__PURE__ */ a.jsxs("select", { ...r, id: h, required: i, multiple: d, name: t, children: [
|
|
833
834
|
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
834
|
-
|
|
835
|
+
M(e.options, (f) => /* @__PURE__ */ a.jsx(
|
|
835
836
|
"option",
|
|
836
837
|
{
|
|
837
838
|
selected: x(f, "selected", !1),
|
|
@@ -852,7 +853,7 @@ const Fe = (e) => {
|
|
|
852
853
|
name: t,
|
|
853
854
|
children: [
|
|
854
855
|
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
|
|
855
|
-
|
|
856
|
+
M(e.options, (f) => /* @__PURE__ */ a.jsx(
|
|
856
857
|
"option",
|
|
857
858
|
{
|
|
858
859
|
selected: x(f, "selected", !1),
|
|
@@ -873,15 +874,15 @@ const Fe = (e) => {
|
|
|
873
874
|
props: {
|
|
874
875
|
styles: p({ default: "" }),
|
|
875
876
|
fieldName: b({ title: "web_blocks.field_name", default: "select" }),
|
|
876
|
-
showLabel:
|
|
877
|
+
showLabel: k({ title: "web_blocks.show_label", default: !0 }),
|
|
877
878
|
inputStyles: p({ default: "w-full p-1" }),
|
|
878
879
|
label: b({ title: "web_blocks.label", default: "Label" }),
|
|
879
880
|
placeholder: b({
|
|
880
881
|
title: "web_blocks.placeholder",
|
|
881
882
|
default: "Placeholder"
|
|
882
883
|
}),
|
|
883
|
-
required:
|
|
884
|
-
_multiple:
|
|
884
|
+
required: k({ title: "web_blocks.required", default: !1 }),
|
|
885
|
+
_multiple: k({ title: "web_blocks.multiple", default: !1 }),
|
|
885
886
|
options: U({
|
|
886
887
|
title: "web_blocks.options",
|
|
887
888
|
itemProperties: {
|
|
@@ -915,7 +916,7 @@ const Fe = (e) => {
|
|
|
915
916
|
group: "form",
|
|
916
917
|
props: {
|
|
917
918
|
fieldName: b({ title: "web_blocks.field_name", default: "textarea" }),
|
|
918
|
-
showLabel:
|
|
919
|
+
showLabel: k({ title: "web_blocks.show_label", default: !0 }),
|
|
919
920
|
styles: p({ default: "" }),
|
|
920
921
|
inputStyles: p({ default: "w-full p-1" }),
|
|
921
922
|
label: b({ title: "web_blocks.label", default: "Label" }),
|
|
@@ -962,11 +963,11 @@ const Fe = (e) => {
|
|
|
962
963
|
fieldName: b({ title: "Field Name", default: "checkbox" }),
|
|
963
964
|
styles: p({ default: "flex items-center gap-x-2" }),
|
|
964
965
|
label: b({ title: "web_blocks.label", default: "Label" }),
|
|
965
|
-
checked:
|
|
966
|
-
required:
|
|
966
|
+
checked: k({ title: "web_blocks.checked", default: !1 }),
|
|
967
|
+
required: k({ title: "web_blocks.required", default: !1 })
|
|
967
968
|
}
|
|
968
969
|
}, xt = () => {
|
|
969
|
-
u(de, ue), u(he,
|
|
970
|
+
u(de, ue), u(he, ke), u(be, pe), u(ye, ge), u(_e, we), u(xe, ve), u(Ie, Be), u(je, Le), u(Ce, Se), u(Me, Ne), u(Ee, $e), u(Pe, Te), u(He, ze), u(Ae, Re), u(me, fe), u(Xe, Ye), u(et, tt), u(lt, ot), u(st, at), u(bt, pt), u(nt, rt), u(ct, it), u(dt, ut), u(Ke, Qe), u(Ze, Je), u(Fe, Oe), u(Ue, Ve), u(Ge, We);
|
|
970
971
|
};
|
|
971
972
|
export {
|
|
972
973
|
xt as loadWebBlocks
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const E="#styles:",_="#slots:",T="#i18n",Y="outline",s="__ADD_BLOCK_INTERNAL_ROOT";exports.I18N_KEY=T;exports.OUTLINE_KEY=Y;exports.ROOT_TEMP_KEY=s;exports.SLOT_KEY=_;exports.STYLES_KEY=E;
|