@chaibuilder/sdk 1.2.41 → 1.2.43
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/{AddBlocks-axw0eS0q.js → AddBlocks-9UM7zj57.js} +31 -31
- package/dist/{AddBlocks-M0Ai5QRA.cjs → AddBlocks-_6X3bnJZ.cjs} +1 -1
- package/dist/{CanvasArea-iPwNNbdH.cjs → CanvasArea-HmbcRpgP.cjs} +1 -1
- package/dist/{CanvasArea-CWXelVxd.js → CanvasArea-a3WMBMi3.js} +2 -2
- package/dist/{ChaiBuilderEditor-syigvGWW.cjs → ChaiBuilderEditor--NV-B5az.cjs} +10 -10
- package/dist/{ChaiBuilderEditor-3Wj_t3jA.js → ChaiBuilderEditor-yf2LRjL1.js} +447 -443
- package/dist/{CurrentPage-nER7hH4h.js → CurrentPage-hKtVFDxU.js} +2 -2
- package/dist/{CurrentPage-iniQPv9U.cjs → CurrentPage-rgu6shCq.cjs} +1 -1
- package/dist/{ListTree-biNayajJ.cjs → ListTree-fwN6Y_EA.cjs} +1 -1
- package/dist/{ListTree-hYx4RLqK.js → ListTree-ulr_sjdn.js} +1 -1
- package/dist/{PagesPanel-LtuJLoQJ.js → PagesPanel-EHLY-cfj.js} +3 -3
- package/dist/{PagesPanel-mFjGqRwI.cjs → PagesPanel-v6Nl5KWy.cjs} +1 -1
- package/dist/{ProjectPanel-s87fBlvB.cjs → ProjectPanel-ck-mOBEg.cjs} +1 -1
- package/dist/{ProjectPanel-g2wBPuXq.js → ProjectPanel-qiqyRbwH.js} +3 -3
- package/dist/Settings-Rtk4HDKy.cjs +1 -0
- package/dist/{Settings-sL6SfNst.js → Settings-a7j3ihRx.js} +110 -110
- package/dist/{SidePanels-gJa61XBn.js → SidePanels-9XdRZ7rz.js} +149 -149
- package/dist/SidePanels-biCoYtzR.cjs +1 -0
- package/dist/{ThemeConfiguration-5lCjeQNl.js → ThemeConfiguration-MaGPPza1.js} +4 -4
- package/dist/{ThemeConfiguration-bOyg0yqs.cjs → ThemeConfiguration-f6AxqpmO.cjs} +1 -1
- package/dist/{Topbar-22iB6xT8.js → Topbar-OpgHjdWn.js} +1 -1
- package/dist/{Topbar-YyBsZjuO.cjs → Topbar-cDxKWgN6.cjs} +1 -1
- package/dist/{UILibrariesPanel-p5kL4hPY.js → UILibrariesPanel-HVpapacm.js} +53 -54
- package/dist/UILibrariesPanel-d08F5Ri0.cjs +1 -0
- package/dist/{UnsplashImages-3-5Y4PKF.js → UnsplashImages-Gx7dy6mp.js} +1 -1
- package/dist/{UnsplashImages-IxQo6rWq.cjs → UnsplashImages-uyokFuF-.cjs} +1 -1
- package/dist/{UploadImages-sAW1x_IX.js → UploadImages-aClrfKqQ.js} +6 -6
- package/dist/{UploadImages-p0g4eMUM.cjs → UploadImages-kLPXfW7W.cjs} +1 -1
- package/dist/{add-page-modal-f5mO9mWn.cjs → add-page-modal-H5MTzKBT.cjs} +1 -1
- package/dist/{add-page-modal-UIhX5RaH.js → add-page-modal-kP7x8GYO.js} +3 -3
- package/dist/{confirm-alert-yjv50jW-.js → confirm-alert-gemzBTIt.js} +1 -1
- package/dist/{confirm-alert-6_2P1iPG.cjs → confirm-alert-zZAmXzx0.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-eXCSYimZ.cjs → delete-page-modal-E8MFNVWF.cjs} +1 -1
- package/dist/{delete-page-modal-4RNg8OWW.js → delete-page-modal-ER-TAzRL.js} +2 -2
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-Zy8G3TfH.js → form-UruaB3s_.js} +1 -1
- package/dist/{form-gTqkjR1L.cjs → form-l4PB76nt.cjs} +1 -1
- package/dist/{index-m6gyJ5Ma.cjs → index-PXyps6Qc.cjs} +1 -1
- package/dist/{index-aYfwM1sV.js → index-rKrjj7Vz.js} +2 -2
- package/dist/{page-viewer-wTIqXVBZ.js → page-viewer-bCH5PPSH.js} +3 -3
- package/dist/{page-viewer-sRHeV-5x.cjs → page-viewer-wQq2qD96.cjs} +1 -1
- package/dist/{project-general-setting-rrNhfejo.cjs → project-general-setting-A5OelyCo.cjs} +1 -1
- package/dist/{project-general-setting-Zirq3OGL.js → project-general-setting-rdCQBkQZ.js} +3 -3
- package/dist/{project-seo-setting-x_PDTJdV.cjs → project-seo-setting-Y_q0WJSy.cjs} +1 -1
- package/dist/{project-seo-setting-fqUbfFgl.js → project-seo-setting-_SGBKl0c.js} +2 -2
- package/dist/{single-page-detail-FqZ4Sp-y.js → single-page-detail-H3Rb5gkJ.js} +4 -4
- package/dist/{single-page-detail-dGVJrIFh.cjs → single-page-detail-xAO7x8a1.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-WJiLFik5.cjs → useCanvasSettings-IalZcnSd.cjs} +1 -1
- package/dist/{useCanvasSettings-8RCa8BYU.js → useCanvasSettings-tkzd9Qrw.js} +1 -1
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +44 -46
- package/package.json +1 -1
- package/dist/Settings-YEIKf61W.cjs +0 -1
- package/dist/SidePanels-f7N3ZWmB.cjs +0 -1
- package/dist/UILibrariesPanel-50360foB.cjs +0 -1
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-jWJDao88.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-VPWiWWGH.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.y({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:o.q({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:a=null}=e;return a?u.createElement(r,{...l,...t},a):u.createElement(r,{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.y({title:"Level",default:"h1",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:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"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:e=>e==="Span"||e==="Link"});const P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:a}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(a||"span",{...l,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:c}=e,p=s,m=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),p&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.l({title:"Label",default:"Button"}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.o({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:a,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,"data-ai-key":"content",href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.l({title:"Content",default:""}),link:o.T({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:a,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.y({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:a}=e;return r?u.createElement(a||"li",{...s,...t},r):u.createElement(a||"li",{...s,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:a,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:a,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.o({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>'}),width:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:a,width:i}=e;return y.isEmpty(l)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,height:a,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.l({title:"Alt",default:""}),width:o.l({title:"Width",default:""}),height:o.l({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let a=null;return!r&&l&&(a=n.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||a)};d.registerChaiBlock(F,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:a}=e,i=y.get(a,"autoPlay",!1),c=y.get(a,"controls",!1),p=i||y.get(a,"muted",!0),m=y.get(a,"loop",!1);if(y.isEmpty(r))return n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${a?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return n.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.l({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return n.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-jWJDao88.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-VPWiWWGH.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=e;let c=r;r||(c=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.y({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:o.q({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:a=null}=e;return a?u.createElement(r,{...l,...t},a):u.createElement(r,{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.y({title:"Level",default:"h1",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:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"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:e=>e==="Span"||e==="Link"});const P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:a}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(a||"span",{...l,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:c}=e,p=s,m=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),p&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.l({title:"Label",default:"Button"}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.o({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:a,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,"data-ai-key":"content",href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.l({title:"Content",default:""}),link:o.T({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:a,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.y({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:a}=e;return r?u.createElement(a||"li",{...s,...t},r):u.createElement(a||"li",{...s,...t,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:a,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:a,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.o({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>'}),width:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:a,width:i}=e;return y.isEmpty(l)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,loading:"lazy",height:a,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.l({title:"Alt",default:""}),width:o.l({title:"Width",default:""}),height:o.l({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let a=null;return!r&&l&&(a=n.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||a)};d.registerChaiBlock(F,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:a}=e,i=y.get(a,"autoPlay",!1),c=y.get(a,"controls",!1),p=i||y.get(a,"muted",!0),m=y.get(a,"loop",!1);if(y.isEmpty(r))return n.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${a?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return n.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.l({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return n.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
2
2
|
<div class="hs-accordion active" id="hs-unstyled-heading-one">
|
|
3
3
|
<button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
|
|
4
4
|
Accordion #1
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
</button>
|
|
31
31
|
<div id="hs-unstyled-collapse-content" class="hs-collapse hidden w-full overflow-hidden transition-[height] duration-300" aria-labelledby="hs-unstyled-collapse">
|
|
32
32
|
This is a collapse body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions.
|
|
33
|
-
</div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const Q=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let a={};return l&&(a={backgroundImage:`url(${l})`}),u.createElement("div",{...t,...r,style:a},s)};d.registerChaiBlock(Q,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.q({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const ee=e=>{const{blockProps:t,styles:l}=e;return u.createElement("br",{...t,...l})};d.registerChaiBlock(ee,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(a,i)=>({_id:f.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=a=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=a=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...l(i)]},r=a=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...l(i),...l(i)]};if(e==="Table"){const a=f.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(a),...r(a)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("table",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(te,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("thead",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tbody",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(oe,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const se=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tr",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(se,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const re=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?u.createElement("td",{...t,...r},l):u.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(re,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item",ai:{html:!0}})}});const ae=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:c,children:p}=e;let m=p;p||(m=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"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",{...x,"data-error":l,"data-success":a,method:"post",action:i,...t,...c,children:[n.jsxRuntimeExports.jsx("div",{...g}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(ae,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.l({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ne=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,a={...s,...t};return r?u.createElement("label",a,r):u.createElement("label",{...a,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ne,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.l({title:"Content",default:"Label",ai:{html:!1}})}});const ie=e=>{const{blockProps:t,inBuilder:l,label:s,placeholder:r,styles:a,inputStyles:i,icon:c,iconPos:p}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...a,...t||{},type:l?"button":"submit",placeholder:r,children:[s,c&&n.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(ie,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.l({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.o({title:"Icon",default:""}),iconPos:o.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ce=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:p=!0}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ce,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.l({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.l({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||p==="submit"?(p==="submit"&&(t.value=l),n.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...a,...r,type:p,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),n.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...a,id:g,type:p,placeholder:s,required:c})]})};d.registerChaiBlock(de,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.l({title:"Field Name",default:"input"}),inputType:o.y({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.l({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:p=!0}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(ue,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.l({title:"Field Name",default:"radio"}),label:o.l({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,x=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...a,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:r,required:c,multiple:m,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>n.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:x,...a,...t,placeholder:r,required:c,multiple:m,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>n.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(pe,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.l({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.l({title:"Label",default:""}),value:o.l({title:"Value",default:""})}})}});const me=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:p}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...a,placeholder:r,rows:c})};d.registerChaiBlock(me,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.l({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const he=y.noop;exports.loadWebBlocks=he;
|
|
33
|
+
</div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const Q=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let a={};return l&&(a={backgroundImage:`url(${l})`}),u.createElement("div",{...t,...r,style:a},s)};d.registerChaiBlock(Q,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.q({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const ee=e=>{const{blockProps:t,styles:l}=e;return u.createElement("br",{...t,...l})};d.registerChaiBlock(ee,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(a,i)=>({_id:f.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=a=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=a=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...l(i)]},r=a=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...l(i),...l(i)]};if(e==="Table"){const a=f.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(a),...r(a)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("table",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(te,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("thead",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tbody",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(oe,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const se=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tr",{...t,...s},l):n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(se,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const re=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?u.createElement("td",{...t,...r},l):u.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(re,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item",ai:{html:!0}})}});const ae=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:c,children:p}=e;let m=p;p||(m=n.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"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",{...x,"data-error":l,"data-success":a,method:"post",action:i,...t,...c,children:[n.jsxRuntimeExports.jsx("div",{...g}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(ae,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.l({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ne=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,a={...s,...t};return r?u.createElement("label",a,r):u.createElement("label",{...a,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ne,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.l({title:"Content",default:"Label",ai:{html:!1}})}});const ie=e=>{const{blockProps:t,inBuilder:l,label:s,styles:r,inputStyles:a,icon:i,iconPos:c}=e,p=f.generateUUID(),m={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:p,...m,...a,...r,...t||{},type:l?"button":"submit",children:[s,i&&n.jsxRuntimeExports.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:i}})]})};d.registerChaiBlock(ie,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.l({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.o({title:"Icon",default:""}),iconPos:o.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ce=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:p=!0}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ce,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.l({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.l({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||p==="submit"?(p==="submit"&&(t.value=l),n.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...a,...r,type:p,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),n.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...a,id:g,type:p,placeholder:s,required:c})]})};d.registerChaiBlock(de,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.l({title:"Field Name",default:"input"}),inputType:o.y({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.l({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:p=!0}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:m,...t,...a,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(ue,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.l({title:"Field Name",default:"radio"}),label:o.l({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,x=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...a,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:x,required:c,multiple:m,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>n.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:x,...a,...t,required:c,multiple:m,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>n.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(pe,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.l({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.l({title:"Label",default:""}),value:o.l({title:"Value",default:""})}})}});const me=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:p}=e,m=f.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...a,placeholder:r,rows:c})};d.registerChaiBlock(me,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.l({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.l({title:"Label",default:"Label"}),placeholder:o.l({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const he=y.noop;exports.loadWebBlocks=he;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isNull as
|
|
1
|
+
import { isNull as z, isEmpty as k, get as x, pick as $, omit as q, find as O, map as E, noop as V } from "lodash-es";
|
|
2
2
|
import { j as n } from "./jsx-runtime-WbnYoNE9.js";
|
|
3
3
|
import * as u from "react";
|
|
4
|
-
import { S as c, y as w, q as C, g as I, m as L, l as y, o as P, c as _, T as U, b as G, r as
|
|
4
|
+
import { S as c, y as w, q as C, g as I, m as L, l as y, o as P, c as _, T as U, b as G, r as f, h as W } from "./controls-VTdJhdSz.js";
|
|
5
5
|
import { registerChaiBlock as d } from "@chaibuilder/runtime";
|
|
6
6
|
import { E as v } from "./empty-slot-ZBlsQi6m.js";
|
|
7
7
|
import { HeadingIcon as Y, TextIcon as X, CursorTextIcon as Z, ButtonIcon as R, Link1Icon as J, RowsIcon as K, ColumnsIcon as Q, SketchLogoIcon as ee, ImageIcon as te, VideoIcon as le, CodeIcon as oe, DividerHorizontalIcon as ae, SpaceBetweenVerticallyIcon as F, TableIcon as se, BorderTopIcon as ne, BorderAllIcon as re, ViewHorizontalIcon as ce, DragHandleHorizontalIcon as ie, GroupIcon as de, LetterCaseToggleIcon as ue, CheckboxIcon as pe, InputIcon as D, RadiobuttonIcon as he, DropdownMenuIcon as ye } from "@radix-ui/react-icons";
|
|
@@ -108,7 +108,7 @@ d(be, {
|
|
|
108
108
|
});
|
|
109
109
|
const ge = (e) => {
|
|
110
110
|
const { blockProps: t, styles: l, content: o } = e;
|
|
111
|
-
return
|
|
111
|
+
return z(e.children) ? u.createElement("p", {
|
|
112
112
|
...l,
|
|
113
113
|
...t,
|
|
114
114
|
"data-ai-key": "content",
|
|
@@ -364,6 +364,7 @@ const Le = (e) => {
|
|
|
364
364
|
...o,
|
|
365
365
|
src: l,
|
|
366
366
|
alt: a,
|
|
367
|
+
loading: "lazy",
|
|
367
368
|
height: s,
|
|
368
369
|
width: r
|
|
369
370
|
});
|
|
@@ -426,16 +427,16 @@ const M = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-
|
|
|
426
427
|
const { blockProps: t, inBuilder: l, styles: o, url: a, controls: s } = e, r = x(s, "autoPlay", !1), i = x(s, "controls", !1), p = r || x(s, "muted", !0), h = x(s, "loop", !1);
|
|
427
428
|
if (k(a))
|
|
428
429
|
return /* @__PURE__ */ n.jsx(v, { inBuilder: l, blockProps: t, text: "VIDEO URL", className: "h-36" });
|
|
429
|
-
let
|
|
430
|
-
if (
|
|
431
|
-
if (!k(
|
|
430
|
+
let b = Se(a), m = null;
|
|
431
|
+
if (b) {
|
|
432
|
+
if (!k(b)) {
|
|
432
433
|
const T = [];
|
|
433
|
-
T.push(`autoplay=${r ? 1 : 0}`), T.push(`controls=${s ? 1 : 0}`), T.push(`mute=${p ? 1 : 0}&muted=${p ? 1 : 0}`), T.push(`loop=${h ? 1 : 0}`),
|
|
434
|
+
T.push(`autoplay=${r ? 1 : 0}`), T.push(`controls=${s ? 1 : 0}`), T.push(`mute=${p ? 1 : 0}&muted=${p ? 1 : 0}`), T.push(`loop=${h ? 1 : 0}`), b = `${b}?${T.join("&")}`;
|
|
434
435
|
}
|
|
435
436
|
m = u.createElement("iframe", {
|
|
436
437
|
...t,
|
|
437
438
|
className: "absolute inset-0 w-full h-full",
|
|
438
|
-
src:
|
|
439
|
+
src: b,
|
|
439
440
|
allow: l ? "" : "autoplay *; fullscreen *",
|
|
440
441
|
allowFullScreen: !0,
|
|
441
442
|
frameBorder: 0
|
|
@@ -450,7 +451,7 @@ const M = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-
|
|
|
450
451
|
autoPlay: l ? !1 : r,
|
|
451
452
|
loop: h
|
|
452
453
|
});
|
|
453
|
-
return /* @__PURE__ */ n.jsx("div", {
|
|
454
|
+
return /* @__PURE__ */ n.jsx("div", { ...$(o, ["className"]), children: /* @__PURE__ */ n.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
454
455
|
l ? /* @__PURE__ */ n.jsx("div", { ...t, ...q(o, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
|
|
455
456
|
m
|
|
456
457
|
] }) });
|
|
@@ -471,10 +472,10 @@ d(je, {
|
|
|
471
472
|
controls: G({
|
|
472
473
|
title: "Controls",
|
|
473
474
|
properties: {
|
|
474
|
-
autoPlay:
|
|
475
|
-
controls:
|
|
476
|
-
loop:
|
|
477
|
-
muted:
|
|
475
|
+
autoPlay: f({ title: "Autoplay", default: !0 }),
|
|
476
|
+
controls: f({ title: "Show controls", default: !1 }),
|
|
477
|
+
loop: f({ title: "Loop", default: !1 }),
|
|
478
|
+
muted: f({ title: "Muted", default: !0 })
|
|
478
479
|
}
|
|
479
480
|
})
|
|
480
481
|
}
|
|
@@ -588,7 +589,7 @@ d(Me, {
|
|
|
588
589
|
},
|
|
589
590
|
//@ts-ignore
|
|
590
591
|
blockState: {
|
|
591
|
-
active:
|
|
592
|
+
active: f({ default: !1, title: "Show content in canvas" })
|
|
592
593
|
},
|
|
593
594
|
getBlockStateFrom: (e) => [e._id],
|
|
594
595
|
// @ts-ignore
|
|
@@ -692,7 +693,7 @@ d(Fe, {
|
|
|
692
693
|
canAcceptBlock: () => !0,
|
|
693
694
|
//@ts-ignore
|
|
694
695
|
blockState: {
|
|
695
|
-
active:
|
|
696
|
+
active: f({ default: !1, title: "Show collapse in canvas" })
|
|
696
697
|
},
|
|
697
698
|
getBlockStateFrom: (e) => [e._id],
|
|
698
699
|
// @ts-ignore
|
|
@@ -723,11 +724,11 @@ d(De, {
|
|
|
723
724
|
canMove: () => !1,
|
|
724
725
|
canDuplicate: () => !1
|
|
725
726
|
});
|
|
726
|
-
const
|
|
727
|
+
const ze = (e) => {
|
|
727
728
|
const { blockProps: t, styles: l } = e;
|
|
728
729
|
return u.createElement("br", { ...t, ...l });
|
|
729
730
|
};
|
|
730
|
-
d(
|
|
731
|
+
d(ze, {
|
|
731
732
|
type: "LineBreak",
|
|
732
733
|
label: "Line Break",
|
|
733
734
|
category: "core",
|
|
@@ -780,11 +781,11 @@ const j = (e) => {
|
|
|
780
781
|
];
|
|
781
782
|
}
|
|
782
783
|
return e === "TableRow" ? l() : e === "TableHead" ? o() : e === "TableBody" ? a() : [];
|
|
783
|
-
},
|
|
784
|
+
}, $e = (e) => {
|
|
784
785
|
const { blockProps: t, children: l, styles: o } = e;
|
|
785
786
|
return l ? u.createElement("table", { ...t, ...o }, l) : /* @__PURE__ */ n.jsx(v, { blockProps: t, text: "TABLE HEAD / BODY" });
|
|
786
787
|
};
|
|
787
|
-
d(
|
|
788
|
+
d($e, {
|
|
788
789
|
type: "Table",
|
|
789
790
|
label: "Table",
|
|
790
791
|
category: "core",
|
|
@@ -868,7 +869,7 @@ const Ge = (e) => {
|
|
|
868
869
|
const { blockProps: t, errorMessage: l, name: o, _type: a, successMessage: s, action: r, styles: i, children: p } = e;
|
|
869
870
|
let h = p;
|
|
870
871
|
p || (h = /* @__PURE__ */ n.jsx(v, { blockProps: {}, text: "FORM FIELDS" }));
|
|
871
|
-
const
|
|
872
|
+
const b = {
|
|
872
873
|
"x-data": "useForm",
|
|
873
874
|
"x-on:submit.prevent": "post"
|
|
874
875
|
}, m = {
|
|
@@ -878,7 +879,7 @@ const Ge = (e) => {
|
|
|
878
879
|
return /* @__PURE__ */ n.jsxs(
|
|
879
880
|
"form",
|
|
880
881
|
{
|
|
881
|
-
...
|
|
882
|
+
...b,
|
|
882
883
|
"data-error": l,
|
|
883
884
|
"data-success": s,
|
|
884
885
|
method: "post",
|
|
@@ -937,22 +938,21 @@ d(We, {
|
|
|
937
938
|
}
|
|
938
939
|
});
|
|
939
940
|
const Ye = (e) => {
|
|
940
|
-
const { blockProps: t, inBuilder: l, label: o,
|
|
941
|
+
const { blockProps: t, inBuilder: l, label: o, styles: a, inputStyles: s, icon: r, iconPos: i } = e, p = g(), h = {
|
|
941
942
|
"x-bind:disabled": "formLoading"
|
|
942
943
|
};
|
|
943
944
|
return /* @__PURE__ */ n.jsxs(
|
|
944
945
|
"button",
|
|
945
946
|
{
|
|
946
|
-
id:
|
|
947
|
-
...
|
|
948
|
-
...r,
|
|
947
|
+
id: p,
|
|
948
|
+
...h,
|
|
949
949
|
...s,
|
|
950
|
+
...a,
|
|
950
951
|
...t || {},
|
|
951
952
|
type: l ? "button" : "submit",
|
|
952
|
-
placeholder: a,
|
|
953
953
|
children: [
|
|
954
954
|
o,
|
|
955
|
-
|
|
955
|
+
r && /* @__PURE__ */ n.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: r } })
|
|
956
956
|
]
|
|
957
957
|
}
|
|
958
958
|
);
|
|
@@ -1019,8 +1019,8 @@ d(Xe, {
|
|
|
1019
1019
|
fieldName: y({ title: "Field Name", default: "checkbox" }),
|
|
1020
1020
|
styles: c({ default: "flex items-center gap-x-2" }),
|
|
1021
1021
|
label: y({ title: "Label", default: "Label" }),
|
|
1022
|
-
checked:
|
|
1023
|
-
required:
|
|
1022
|
+
checked: f({ title: "Checked", default: !1 }),
|
|
1023
|
+
required: f({ title: "Required", default: !1 })
|
|
1024
1024
|
}
|
|
1025
1025
|
});
|
|
1026
1026
|
const Ze = (e) => {
|
|
@@ -1034,13 +1034,13 @@ const Ze = (e) => {
|
|
|
1034
1034
|
required: i,
|
|
1035
1035
|
inputType: p = "text",
|
|
1036
1036
|
inBuilder: h,
|
|
1037
|
-
fieldName:
|
|
1037
|
+
fieldName: b
|
|
1038
1038
|
} = e, m = g();
|
|
1039
1039
|
return !r || p === "submit" ? (p === "submit" && (t.value = l), /* @__PURE__ */ n.jsx(
|
|
1040
1040
|
"input",
|
|
1041
1041
|
{
|
|
1042
1042
|
id: m,
|
|
1043
|
-
name:
|
|
1043
|
+
name: b,
|
|
1044
1044
|
readOnly: h,
|
|
1045
1045
|
...t,
|
|
1046
1046
|
...s,
|
|
@@ -1054,7 +1054,7 @@ const Ze = (e) => {
|
|
|
1054
1054
|
/* @__PURE__ */ n.jsx(
|
|
1055
1055
|
"input",
|
|
1056
1056
|
{
|
|
1057
|
-
name:
|
|
1057
|
+
name: b,
|
|
1058
1058
|
readOnly: h,
|
|
1059
1059
|
...s,
|
|
1060
1060
|
id: m,
|
|
@@ -1087,14 +1087,14 @@ d(Ze, {
|
|
|
1087
1087
|
default: "text"
|
|
1088
1088
|
}),
|
|
1089
1089
|
value: y({ title: "Value", default: "" }),
|
|
1090
|
-
showLabel:
|
|
1090
|
+
showLabel: f({ title: "Show label", default: !0 }),
|
|
1091
1091
|
inputStyles: c({ default: "w-full p-1" }),
|
|
1092
1092
|
label: y({ title: "Label", default: "Label" }),
|
|
1093
1093
|
placeholder: y({
|
|
1094
1094
|
title: "Placeholder",
|
|
1095
1095
|
default: "Placeholder"
|
|
1096
1096
|
}),
|
|
1097
|
-
required:
|
|
1097
|
+
required: f({ title: "Required", default: !1 })
|
|
1098
1098
|
}
|
|
1099
1099
|
});
|
|
1100
1100
|
const Je = (e) => {
|
|
@@ -1127,8 +1127,8 @@ d(Je, {
|
|
|
1127
1127
|
styles: c({ default: "flex items-center w-max gap-x-2" }),
|
|
1128
1128
|
fieldName: y({ title: "Field Name", default: "radio" }),
|
|
1129
1129
|
label: y({ title: "Label", default: "Label" }),
|
|
1130
|
-
checked:
|
|
1131
|
-
required:
|
|
1130
|
+
checked: f({ title: "Checked", default: !1 }),
|
|
1131
|
+
required: f({ title: "Required", default: !1 })
|
|
1132
1132
|
}
|
|
1133
1133
|
});
|
|
1134
1134
|
const Ke = (e) => {
|
|
@@ -1142,15 +1142,14 @@ const Ke = (e) => {
|
|
|
1142
1142
|
required: i,
|
|
1143
1143
|
showLabel: p,
|
|
1144
1144
|
_multiple: h = !1
|
|
1145
|
-
} = e,
|
|
1145
|
+
} = e, b = g();
|
|
1146
1146
|
return p ? /* @__PURE__ */ n.jsxs("div", { ...s, children: [
|
|
1147
|
-
p && /* @__PURE__ */ n.jsx("label", { htmlFor:
|
|
1147
|
+
p && /* @__PURE__ */ n.jsx("label", { htmlFor: b, children: o }),
|
|
1148
1148
|
/* @__PURE__ */ n.jsxs(
|
|
1149
1149
|
"select",
|
|
1150
1150
|
{
|
|
1151
1151
|
...r,
|
|
1152
|
-
id:
|
|
1153
|
-
placeholder: a,
|
|
1152
|
+
id: b,
|
|
1154
1153
|
required: i,
|
|
1155
1154
|
multiple: h,
|
|
1156
1155
|
name: l,
|
|
@@ -1171,10 +1170,9 @@ const Ke = (e) => {
|
|
|
1171
1170
|
] }) : /* @__PURE__ */ n.jsxs(
|
|
1172
1171
|
"select",
|
|
1173
1172
|
{
|
|
1174
|
-
id:
|
|
1173
|
+
id: b,
|
|
1175
1174
|
...s,
|
|
1176
1175
|
...t,
|
|
1177
|
-
placeholder: a,
|
|
1178
1176
|
required: i,
|
|
1179
1177
|
multiple: h,
|
|
1180
1178
|
name: l,
|
|
@@ -1203,15 +1201,15 @@ d(Ke, {
|
|
|
1203
1201
|
props: {
|
|
1204
1202
|
styles: c({ default: "" }),
|
|
1205
1203
|
fieldName: y({ title: "Field Name", default: "select" }),
|
|
1206
|
-
showLabel:
|
|
1204
|
+
showLabel: f({ title: "Show label", default: !0 }),
|
|
1207
1205
|
inputStyles: c({ default: "w-full p-1" }),
|
|
1208
1206
|
label: y({ title: "Label", default: "Label" }),
|
|
1209
1207
|
placeholder: y({
|
|
1210
1208
|
title: "Placeholder",
|
|
1211
1209
|
default: "Placeholder"
|
|
1212
1210
|
}),
|
|
1213
|
-
required:
|
|
1214
|
-
_multiple:
|
|
1211
|
+
required: f({ title: "Required", default: !1 }),
|
|
1212
|
+
_multiple: f({ title: "Multiple Choice", default: !1 }),
|
|
1215
1213
|
options: W({
|
|
1216
1214
|
title: "Options",
|
|
1217
1215
|
itemProperties: {
|
|
@@ -1248,7 +1246,7 @@ d(Qe, {
|
|
|
1248
1246
|
hidden: !0,
|
|
1249
1247
|
props: {
|
|
1250
1248
|
fieldName: y({ title: "Field Name", default: "textarea" }),
|
|
1251
|
-
showLabel:
|
|
1249
|
+
showLabel: f({ title: "Show label", default: !0 }),
|
|
1252
1250
|
styles: c({ default: "" }),
|
|
1253
1251
|
inputStyles: c({ default: "w-full p-1" }),
|
|
1254
1252
|
label: y({ title: "Label", default: "Label" }),
|