@chaibuilder/sdk 4.0.0-beta.4 → 4.0.0-beta.7
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/README.md +75 -50
- package/dist/{2SSKDMRQ-CopJgtZb.cjs → 2SSKDMRQ-DDOgISWg.cjs} +1 -1
- package/dist/{2SSKDMRQ-Difo_1pg.js → 2SSKDMRQ-hL7THuKW.js} +2 -2
- package/dist/{AP7HFJJL-BPuPBqj4.js → AP7HFJJL-BsLQ13V_.js} +1 -1
- package/dist/{AP7HFJJL-DYxDgaOs.cjs → AP7HFJJL-tcAhVllC.cjs} +1 -1
- package/dist/{IconPicker-B2-oriq2.js → IconPicker-FLSVAZxx.js} +1 -1
- package/dist/{IconPicker-C0oycHbs.cjs → IconPicker-J1KLNrSB.cjs} +1 -1
- package/dist/{WDYDFRGG-DbejaRPK.cjs → WDYDFRGG-BTj8AXV6.cjs} +1 -1
- package/dist/{WDYDFRGG-KK8pkcW1.js → WDYDFRGG-Yi0eNS2V.js} +2 -2
- package/dist/{actions-registery-JdxhXhT6.cjs → actions-registery-CtQSSexG.cjs} +31 -31
- package/dist/{actions-registery-y_ENc8zj.js → actions-registery-DqrFhSMp.js} +2414 -2418
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.ts +0 -34
- package/dist/actions.js +3 -3
- package/dist/{active-in-another-tab-Cu_ASKtx.cjs → active-in-another-tab-BtAiatqq.cjs} +1 -1
- package/dist/{active-in-another-tab-DkR2HWI4.js → active-in-another-tab-Dozn833d.js} +2 -2
- package/dist/{add-new-language-page-BXuwluuU.cjs → add-new-language-page-9AMizlES.cjs} +1 -1
- package/dist/{add-new-language-page-CBY0RR6q.js → add-new-language-page-DD-CAoAQ.js} +3 -3
- package/dist/{add-new-page-C_PzKby8.cjs → add-new-page-BS9vPnFG.cjs} +1 -1
- package/dist/{add-new-page-DJLJFLAd.js → add-new-page-uZKCk9eB.js} +2 -2
- package/dist/{ai-panel-content--YM01Aly.js → ai-panel-content-CK4XOkEh.js} +3 -3
- package/dist/{ai-panel-content-rRmJdH7L.cjs → ai-panel-content-PovaKJaj.cjs} +1 -1
- package/dist/{ai-panel-default-lang-D2zhXvKP.cjs → ai-panel-default-lang-B37k5ADH.cjs} +2 -2
- package/dist/{ai-panel-default-lang-BZl0tPYo.js → ai-panel-default-lang-BtLjUl9d.js} +3 -3
- package/dist/{ai-panel-other-lang-Y4bEKHoG.cjs → ai-panel-other-lang-CdQmASqv.cjs} +1 -1
- package/dist/{ai-panel-other-lang-Bfjk2CYZ.js → ai-panel-other-lang-Dp1MNaLi.js} +3 -3
- package/dist/{ai-prompt-input-DueQYNf-.js → ai-prompt-input-BT-mEdTX.js} +1 -1
- package/dist/{ai-prompt-input-N9PcYCFa.cjs → ai-prompt-input-Dtym4w8J.cjs} +1 -1
- package/dist/{ai-translation-prompt-IAdWMNZb.cjs → ai-translation-prompt-B-lH7emI.cjs} +1 -1
- package/dist/{ai-translation-prompt-B36F3d7K.js → ai-translation-prompt-B17GK1QR.js} +1 -1
- package/dist/{code-editor-DQB8lAOk.cjs → code-editor-CUeNiMzA.cjs} +1 -1
- package/dist/{code-editor-Bb7JumZy.js → code-editor-EZT2pMsU.js} +1 -1
- package/dist/{continue-editing-in-this-client-Dm9cCj7K.js → continue-editing-in-this-client-CS7C6h9Q.js} +2 -2
- package/dist/{continue-editing-in-this-client-DmGFLHXw.cjs → continue-editing-in-this-client-DMZOc36k.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +41 -42
- package/dist/css-import-modal-kHB0ramf.cjs +13 -0
- package/dist/{css-import-modal-9P_0uNa4.js → css-import-modal-s7t5gZQo.js} +3 -4
- package/dist/{delete-design-token-COvR4G1S.js → delete-design-token-C1smbx4E.js} +1 -1
- package/dist/{delete-design-token-BG8yHcS5.cjs → delete-design-token-Mbw_6sYI.cjs} +1 -1
- package/dist/{delete-page-CNucxe4P.js → delete-page-2GfBi8Iv.js} +2 -2
- package/dist/{delete-page-DAvEjHwF.cjs → delete-page-B7J3t0FN.cjs} +1 -1
- package/dist/{design-token-usage-CXglXgcJ.cjs → design-token-usage-BoGOULG8.cjs} +1 -1
- package/dist/{design-token-usage-MNYsFlPG.js → design-token-usage-DyO3xM-F.js} +1 -1
- package/dist/{digital-asset-manager-CqCWBO0s.js → digital-asset-manager-Cz3Nlrzl.js} +3 -3
- package/dist/{digital-asset-manager-CB5MRBcW.cjs → digital-asset-manager-DDk2ucTE.cjs} +1 -1
- package/dist/{duplicate-page-BknLfqr0.js → duplicate-page-BwAY4Ssm.js} +3 -3
- package/dist/{duplicate-page-DzZByALW.cjs → duplicate-page-Dw3U4wTT.cjs} +1 -1
- package/dist/{dynamic-page-selector-WA007Sni.cjs → dynamic-page-selector-CvBFyX2F.cjs} +1 -1
- package/dist/{dynamic-page-selector-DoW7OyUB.js → dynamic-page-selector-sViJuQlU.js} +2 -2
- package/dist/{get-chai-builder-tailwind-config-BFePCEIS.cjs → get-chai-builder-tailwind-config-DNp8Vhme.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BXf_xLHk.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +2 -2
- package/dist/{image-editor-CqwaVxO2.cjs → image-editor-AIsccrqC.cjs} +1 -1
- package/dist/{image-editor-CQnNtak2.js → image-editor-BgGQuESa.js} +1 -1
- package/dist/{index-Dno42B0a.js → index-B7eWP_hB.js} +539 -528
- package/dist/index-BwH1mRm_.cjs +5 -0
- package/dist/{index-rAcNbjk_.js → index-RYr8kQdI.js} +2132 -2130
- package/dist/{index-C99FhuF1.cjs → index-xYnNKovy.cjs} +15 -15
- package/dist/{json-diff-viewer-CLuUHiPU.cjs → json-diff-viewer-B2A78udz.cjs} +1 -1
- package/dist/{json-diff-viewer-CMvGUvJ2.js → json-diff-viewer-Svw-kbhe.js} +2 -2
- package/dist/{lang-panel-fDCYm5Jm.cjs → lang-panel-AmEkoWid.cjs} +1 -1
- package/dist/{lang-panel-CnwTb05j.js → lang-panel-Bnc-9wkM.js} +3 -3
- package/dist/{manage-design-tokens-BvH5KTJX.cjs → manage-design-tokens-B2fG80bi.cjs} +1 -1
- package/dist/{manage-design-tokens-BsSZE9Vs.js → manage-design-tokens-BBkh1t4w.js} +2 -2
- package/dist/{mark-as-template-DBLshWb5.js → mark-as-template-0CPzZnk-.js} +2 -2
- package/dist/{mark-as-template-CpWEBJGd.cjs → mark-as-template-CE6tRoQy.cjs} +1 -1
- package/dist/{nested-path-selector-content-C2sD9dkq.cjs → nested-path-selector-content-SmfjElr-.cjs} +1 -1
- package/dist/{nested-path-selector-content-6OBJ8LG8.js → nested-path-selector-content-kGznHufl.js} +1 -1
- package/dist/{no-language-page-content-BvPDdccK.cjs → no-language-page-content-B4bQLc4K.cjs} +1 -1
- package/dist/{no-language-page-content-CzENgtnu.js → no-language-page-content-DXsAPDZd.js} +2 -2
- package/dist/{no-language-page-dialog-CgW4yJBC.cjs → no-language-page-dialog-BC8NHzK2.cjs} +1 -1
- package/dist/{no-language-page-dialog-CbYI2cVg.js → no-language-page-dialog-BpPqmw9a.js} +2 -2
- package/dist/{page-creator-g8GqgcKH.cjs → page-creator-82qTbBj4.cjs} +1 -1
- package/dist/{page-creator-Cc83uQqw.js → page-creator-Bazn6yH4.js} +14 -14
- package/dist/{page-lock-BJUkyxdh.js → page-lock-CRFyqKZE.js} +2 -2
- package/dist/{page-lock-CT7SmQqp.cjs → page-lock-D2iFZDUK.cjs} +1 -1
- package/dist/{page-locked-dialog-DsEbWRed.js → page-locked-dialog-GKfQEOmk.js} +2 -2
- package/dist/{page-locked-dialog-Co5b9XIZ.cjs → page-locked-dialog-xLqvKzax.cjs} +1 -1
- package/dist/{page-manager-new-BOkJImo2.cjs → page-manager-new-Bn2QKjbf.cjs} +1 -1
- package/dist/{page-manager-new-5rFP5DyQ.js → page-manager-new-DItY2hjd.js} +3 -3
- package/dist/{page-manager-search-and-filter-zq-LfhQ1.js → page-manager-search-and-filter-CPa8IXdd.js} +2 -2
- package/dist/{page-manager-search-and-filter-Bfm0j1gg.cjs → page-manager-search-and-filter-Dc4ky-qV.cjs} +1 -1
- package/dist/{page-revisions-content-D38G2tJM.js → page-revisions-content-CH-PZK0O.js} +3 -3
- package/dist/{page-revisions-content-ag-MHBGr.cjs → page-revisions-content-CcLFI4YK.cjs} +1 -1
- package/dist/pages.cjs +1 -1
- package/dist/pages.js +1 -1
- package/dist/{publish-pages-content-BiX-GMLw.cjs → publish-pages-content-BzJDObqr.cjs} +1 -1
- package/dist/{publish-pages-content-CS7f41Ac.js → publish-pages-content-CSJCFElu.js} +3 -3
- package/dist/{rte-widget-modal-D6Zik0Ta.js → rte-widget-modal-5T81P_hg.js} +1 -1
- package/dist/{rte-widget-modal-BKNx2wln.cjs → rte-widget-modal-BfXcA7OP.cjs} +1 -1
- package/dist/{save-to-lib-ffjCZYJ5.cjs → save-to-lib-DGAdSa-0.cjs} +1 -1
- package/dist/{save-to-lib-WwOzbgiF.js → save-to-lib-MtWKSVeN.js} +2 -2
- package/dist/{selected-block-display-B1SG_UXw.js → selected-block-display-CB1-hVR5.js} +2 -2
- package/dist/{selected-block-display-BOgnQRLF.cjs → selected-block-display-DLt_nMn9.cjs} +1 -1
- package/dist/{seo-panel-BkOgRoWd.js → seo-panel-CRzzw4FW.js} +2 -2
- package/dist/{seo-panel-FjS1UF_y.cjs → seo-panel-_kGXE9MC.cjs} +1 -1
- package/dist/{shared-json-ld-uka9TOgA.js → shared-json-ld-CXukkDeS.js} +2 -2
- package/dist/{shared-json-ld-yJkXjENy.cjs → shared-json-ld-DoRgzDPC.cjs} +1 -1
- package/dist/{slug-input-DHLmUNrH.js → slug-input-CeEQ0zyv.js} +1 -1
- package/dist/{slug-input-Cyd6NR6J.cjs → slug-input-Dp187Tiy.cjs} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +5 -0
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-Ca0X-qyf.js → take-over-request-C9J3_rev.js} +2 -2
- package/dist/{take-over-request-CmpJVe9T.cjs → take-over-request-CXuakFBm.cjs} +1 -1
- package/dist/{theme-panel-footer-CKO9YYwZ.cjs → theme-panel-footer-CWZ0qs13.cjs} +1 -1
- package/dist/{theme-panel-footer-BUXIu252.js → theme-panel-footer-DvwsyHNQ.js} +2 -2
- package/dist/{translation-warning-modal-pSZVKcNW.cjs → translation-warning-modal-DEt_ExQp.cjs} +1 -1
- package/dist/{translation-warning-modal-DrpFeI83.js → translation-warning-modal-_aBp5ZZQ.js} +1 -1
- package/dist/{unmark-as-template-DF1Ms4VN.cjs → unmark-as-template-BYL5naYx.cjs} +1 -1
- package/dist/{unmark-as-template-BMqgelv-.js → unmark-as-template-JN-cDUV_.js} +2 -2
- package/dist/{unpublish-page-Bsq2yEqQ.cjs → unpublish-page-B06iZEIO.cjs} +1 -1
- package/dist/{unpublish-page-BJ0Bsvt2.js → unpublish-page-DqwBY2yI.js} +2 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +42 -42
- package/dist/{web-preview-D6h1L2nV.js → web-preview-h39D3TUh.js} +1 -1
- package/dist/{web-preview-kres0aG7.cjs → web-preview-wRgRY3Tv.cjs} +1 -1
- package/package.json +22 -24
- package/dist/css-import-modal-Rh1QAVxo.cjs +0 -13
- package/dist/index-C0-pgg_p.cjs +0 -5
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("react/jsx-runtime"),a=require("./index-B-rSiAp_.cjs"),B=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),d=require("./core-Y0lXLwkq.cjs");function L(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=L(x),C=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:B.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:i,tag:s="div",styles:n}=e;let c=i;i||(c=r.jsx(C,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(s,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:i,styles:s,children:n,iconPos:c,link:p,inBuilder:g}=e,h=l,k=n||r.jsxs(r.Fragment,{children:[i&&r.jsx("span",{children:i}),h&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(i?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:h}})]}),f=x.createElement("button",{...o,...s,type:"button","aria-label":i},k);return u.isEmpty(u.get(p,"href"))?f:g?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":i,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"],enumNames:["Left","Right"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:i}=e;return i?r.jsxs("div",{className:"relative",...o,children:[i?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:B.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",...a.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:i}=e;return t&&!i?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Global Block - ",i]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},v=(e,...o)=>({...e,className:B.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:i,inBuilder:s,height:n}=e,c=v(l,"");if(u.isEmpty(t))return r.jsx(C,{inBuilder:s,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:i?`${i}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},U=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:i}=e;return t&&!i?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Partial Block - ",i]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},F={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},w={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:i,tabletColSpan:s,desktopColSpan:n}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(i)||!i?6:i],""),s?u.get(w,["MEDIUM",s||i],""):"",n?u.get(w,["LARGE",s||i],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:i}=e,n={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?n.style={...l.style,gap:`${i}px`}:n.style={gap:`${i}px`},r.jsx("div",{...o,...l,...n,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let i={};return l&&(i={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:i})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:i,inputStyles:s,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...i,...o,children:[r.jsx("input",{...s,name:t,type:"checkbox",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...s,...i,type:"checkbox",required:n,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("flex items-center gap-x-2"),inputStyles:a.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{children:o,blockProps:t,errorMessage:l,successMessage:i,action:s,styles:n,inBuilder:c}=e;let p=o;o||(p=r.jsx(C,{inBuilder:c}));const g={"x-data":"{}","x-on:submit.prevent":"post"},h={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...g,"data-error":l,"data-success":i,method:"post",action:s,...t,...n,children:[r.jsx("div",{...h}),p]})},te={type:"Form",label:"Form",category:"core",icon:m.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:i,icon:s,iconSize:n,iconPos:c}=e;return r.jsxs("button",{...i,...o||{},type:t?"button":"submit","aria-label":l,children:[l,s&&r.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:s}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},re=e=>{const o={type:"text",autocomplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autocomplete:"on"}:e==="email"?{type:"email",autocomplete:"email"}:e==="tel"?{type:"tel",autocomplete:"tel"}:e==="url"?{type:"url",autocomplete:"url"}:{off:{type:"text",autocomplete:"off"},on:{type:"text",autocomplete:"on"},name:{type:"text",autocomplete:"name"},"honorific-prefix":{type:"text",autocomplete:"honorific-prefix"},"given-name":{type:"text",autocomplete:"given-name"},"additional-name":{type:"text",autocomplete:"additional-name"},"family-name":{type:"text",autocomplete:"family-name"},"honorific-suffix":{type:"text",autocomplete:"honorific-suffix"},nickname:{type:"text",autocomplete:"nickname"},firstName:{type:"text",autocomplete:"given-name"},lastName:{type:"text",autocomplete:"family-name"},email:{type:"email",autocomplete:"email"},tel:{type:"tel",autocomplete:"tel"},"tel-country-code":{type:"tel",autocomplete:"tel-country-code"},"tel-national":{type:"tel",autocomplete:"tel-national"},"tel-area-code":{type:"tel",autocomplete:"tel-area-code"},"tel-local":{type:"tel",autocomplete:"tel-local"},"tel-extension":{type:"tel",autocomplete:"tel-extension"},"street-address":{type:"text",autocomplete:"street-address"},"address-line1":{type:"text",autocomplete:"address-line1"},"address-line2":{type:"text",autocomplete:"address-line2"},"address-line3":{type:"text",autocomplete:"address-line3"},"address-level1":{type:"text",autocomplete:"address-level1"},"address-level2":{type:"text",autocomplete:"address-level2"},"address-level3":{type:"text",autocomplete:"address-level3"},"address-level4":{type:"text",autocomplete:"address-level4"},country:{type:"text",autocomplete:"country"},"country-name":{type:"text",autocomplete:"country-name"},"postal-code":{type:"text",autocomplete:"postal-code"},"cc-name":{type:"text",autocomplete:"cc-name"},"cc-given-name":{type:"text",autocomplete:"cc-given-name"},"cc-additional-name":{type:"text",autocomplete:"cc-additional-name"},"cc-family-name":{type:"text",autocomplete:"cc-family-name"},"cc-number":{type:"text",autocomplete:"cc-number"},"cc-exp":{type:"text",autocomplete:"cc-exp"},"cc-exp-month":{type:"number",autocomplete:"cc-exp-month"},"cc-exp-year":{type:"number",autocomplete:"cc-exp-year"},"cc-csc":{type:"text",autocomplete:"cc-csc"},"cc-type":{type:"text",autocomplete:"cc-type"},bday:{type:"date",autocomplete:"bday"},"bday-day":{type:"number",autocomplete:"bday-day"},"bday-month":{type:"number",autocomplete:"bday-month"},"bday-year":{type:"number",autocomplete:"bday-year"},username:{type:"text",autocomplete:"username"},"new-password":{type:"password",autocomplete:"new-password"},"current-password":{type:"password",autocomplete:"current-password"},"one-time-code":{type:"text",autocomplete:"one-time-code"},"transaction-currency":{type:"text",autocomplete:"transaction-currency"},"transaction-amount":{type:"number",autocomplete:"transaction-amount"},url:{type:"url",autocomplete:"url"},photo:{type:"url",autocomplete:"photo"},sex:{type:"text",autocomplete:"sex"},"organization-title":{type:"text",autocomplete:"organization-title"},organization:{type:"text",autocomplete:"organization"},language:{type:"text",autocomplete:"language"}}[e]||o:o},ie=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,showLabel:c,required:p,inputType:g,defaultValue:h}=e,{type:k,autocomplete:f}=re(g);return c?r.jsxs("div",{...s,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:h,...n,type:k,placeholder:i,required:p,autoComplete:f})]}):r.jsx("input",{name:t,...o,...n,...s,type:k,placeholder:i,required:p,autoComplete:f,defaultValue:h})},se={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ae=e=>{const{blockProps:o,content:t,styles:l,children:i}=e,s={...l,...o};return i?b.createElement("label",s,i):b.createElement("label",{...s,dangerouslySetInnerHTML:{__html:t}})},ne={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:i,inputStyles:s,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...i,...o,children:[r.jsx("input",{...s,name:t,type:"radio",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...s,...i,type:"radio",required:n,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("flex items-center gap-x-2"),inputStyles:a.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,required:c,showLabel:p,_multiple:g,options:h,defaultValue:k}=e,f=g&&k?k.split(",").map(y=>y.trim()):k||"";return p?r.jsxs("div",{...s,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...n,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),u.map(h,y=>r.jsx("option",{value:y==null?void 0:y.value,children:y==null?void 0:y.label},y==null?void 0:y.value))]})]}):r.jsxs("select",{...s,...o,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),u.map(h,y=>r.jsx("option",{value:y==null?void 0:y.value,children:y==null?void 0:y.label},y==null?void 0:y.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,rows:c,showLabel:p,required:g,defaultValue:h}=e;return p?r.jsxs("div",{...s,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...n,placeholder:i,rows:c,required:g,defaultValue:h})]}):r.jsx("textarea",{name:t,...o,...n,...s,placeholder:i,rows:c,required:g,defaultValue:h})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",...a.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:i="h1",children:s=null}=e;return s?b.createElement(i,{...t,...o},s):b.createElement(i,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",...a.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:a.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(C,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(C,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(C,{})},Be=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(C,{})},Se=e=>{const{blockProps:o,children:t,content:l,styles:i}=e;return!t&&u.isEmpty(l)?r.jsx(C,{}):t?x.createElement("td",{...o,...i},t):x.createElement("td",{...o,...i,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("Table")});d.registerChaiBlock(ke,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableHead")});d.registerChaiBlock(Ce,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableBody")});d.registerChaiBlock(Be,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableRow")});d.registerChaiBlock(Se,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:S("TableCell"),i18nProps:["content"],aiProps:["content"]});function S(e){const o=(s,n)=>({_id:B.generateUUID(),_parent:s,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=s=>{const n=B.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return s&&(c._parent=s),[c,o(n,"1"),o(n,"2"),o(n,"3")]},l=s=>{const n=B.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return s&&(c._parent=s),[c,...t(n)]},i=s=>{const n=B.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return s&&(c._parent=s),[c,...t(n),...t(n)]};if(e==="Table"){const s=B.generateUUID();return[{_id:s,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(s),...i(s)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?i():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",Pe=e=>{const{blockProps:o,image:t,mobileImage:l,styles:i,alt:s,height:n,width:c,lazyLoading:p,mobileWidth:g,mobileHeight:h}=e;return u.isEmpty(t)?r.jsx(C,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:g,height:h}),r.jsx("img",{...o,...i,src:t,alt:s,loading:p?"lazy":"eager",width:c,height:n})]})},ve={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},Ie=e=>{const{blockProps:o,link:t,children:l,styles:i,inBuilder:s,content:n}=e;let c={};return!l&&u.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),s?l?r.jsx("span",{role:"link",...o,style:c,...i,children:l}):x.createElement("span",{...o,...i,style:c,role:"link"},n):l?r.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...i,children:l}):x.createElement("a",{...o,...i,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},je={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("block"),content:{type:"string",default:"Link text goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Le=e=>{const{blockProps:o,children:t,styles:l,tag:i,inBuilder:s}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(C,{inBuilder:s}):b.createElement(i||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:i,tag:s}=e;return i?b.createElement(s||"li",{...l,...o},i):b.createElement(s||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const i=v(t,"rte");return b.createElement("div",{...i,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",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.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,i=v(l,"rte");return r.jsx("div",{...o,...i,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},He=e=>{const{blockProps:o,styles:t,content:l,children:i=null,tag:s}=e;return i?b.createElement("span",{...t,...o},i):b.createElement(s||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},P={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),i=u.get(o,"loop",!1),s=t||u.get(o,"muted",!0);if(I.test(e)){const n=e.match(I);if(n){const c=n[4];let p=`https://www.youtube.com/embed/${c}`,g=t?"autoplay=1":"";return g+=i?`&loop=1&playlist=${c}`:"",g+=s?"&mute=1&muted=1":"",g+=l?"&controls=1":"&controls=0",`${p}?${g}`}}if(j.test(e)){const n=e.match(j);if(n){const c=n[1];let p="";return p+=t?"autoplay=1":"",p+=l?"&controls=1":"&controls=0",p+=s?"&muted=1":"",p+=i?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},Ue=e=>{const{url:o,blockProps:t,styles:l,controls:i,videoSource:s,inBuilder:n,title:c}=e,p=ze(o,i);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&n?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${s} video link in settings Video URL.`:`Provided ${s} video link is invalid.`}):r.jsx("iframe",{width:"100%",src:p??"",title:c||"Video player",...u.pick(l,"className")}),n&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Fe=e=>{const{url:o,styles:t,controls:l,sources:i,poster:s,blockProps:n,title:c}=e;let p=s;const g=[...u.get(i,"srcsets",[])||[]];o&&typeof o=="string"&&g.push({url:o,width:9999});const h=g.sort((f,y)=>f.width-y.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));h.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const k=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(h))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,title:c||"Video player",key:JSON.stringify(h),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...k?{muted:!0}:{}},h.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const y=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:y,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Fe,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Ue,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...P}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...P}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...P}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:i,$loading:s}=e,{pagination:n,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?s&&c?Array.from({length:2}).map((g,h)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},h)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...i,...l},s&&c?Array.from({length:2}).map((g,h)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},h)):p),n&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...a.registerChaiBlockSchema({properties:{styles:a.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:a.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"],enumNames:["Query(/items?page=1)","Segment(/items/1)"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:i})=>{let s="li";switch(l){case"ul":s="li";break;case"ol":s="li";break;default:s="div"}return!e&&i?b.createElement(s,{...o,...t},r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):b.createElement(s,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(Ie,je),d.registerChaiBlock(Le,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(Pe,ve),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(ie,se),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ae,ne),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(U,F),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("./index-B-rSiAp_.cjs"),B=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),u=require("lodash-es"),d=require("./core-Y0lXLwkq.cjs");function L(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=L(x),C=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:B.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:i,tag:s="div",styles:n}=e;let c=i;i||(c=r.jsx(C,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(s,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:i,styles:s,children:n,iconPos:c,link:p,inBuilder:g}=e,h=l,k=n||r.jsxs(r.Fragment,{children:[i&&r.jsx("span",{children:i}),h&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(i?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:h}})]}),f=x.createElement("button",{...o,...s,type:"button","aria-label":i},k);return u.isEmpty(u.get(p,"href"))?f:g?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":i,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"],enumNames:["Left","Right"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:i}=e;return i?r.jsxs("div",{className:"relative",...o,children:[i?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:B.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",...a.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:i}=e;return t&&!i?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Global Block - ",i]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},v=(e,...o)=>({...e,className:B.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:i,inBuilder:s,height:n}=e,c=v(l,"");if(u.isEmpty(t))return r.jsx(C,{inBuilder:s,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:i?`${i}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},U=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:i}=e;return t&&!i?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Partial Block - ",i]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},F={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},w={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:i,tabletColSpan:s,desktopColSpan:n}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(i)||!i?6:i],""),s?u.get(w,["MEDIUM",s||i],""):"",n?u.get(w,["LARGE",s||i],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:i}=e,n={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?n.style={...l.style,gap:`${i}px`}:n.style={gap:`${i}px`},r.jsx("div",{...o,...l,...n,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let i={};return l&&(i={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:i})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:i,inputStyles:s,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...i,...o,children:[r.jsx("input",{...s,name:t,type:"checkbox",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...s,...i,type:"checkbox",required:n,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("flex items-center gap-x-2"),inputStyles:a.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{children:o,blockProps:t,errorMessage:l,successMessage:i,action:s,styles:n,inBuilder:c}=e;let p=o;o||(p=r.jsx(C,{inBuilder:c}));const g={"x-data":"{}","x-on:submit.prevent":"post"},h={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...g,"data-error":l,"data-success":i,method:"post",action:s,...t,...n,children:[r.jsx("div",{...h}),p]})},te={type:"Form",label:"Form",category:"core",icon:m.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:i,icon:s,iconSize:n,iconPos:c}=e;return r.jsxs("button",{...i,...o||{},type:t?"button":"submit","aria-label":l,children:[l,s&&r.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:s}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},re=e=>{const o={type:"text",autocomplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autocomplete:"on"}:e==="email"?{type:"email",autocomplete:"email"}:e==="tel"?{type:"tel",autocomplete:"tel"}:e==="url"?{type:"url",autocomplete:"url"}:{off:{type:"text",autocomplete:"off"},on:{type:"text",autocomplete:"on"},name:{type:"text",autocomplete:"name"},"honorific-prefix":{type:"text",autocomplete:"honorific-prefix"},"given-name":{type:"text",autocomplete:"given-name"},"additional-name":{type:"text",autocomplete:"additional-name"},"family-name":{type:"text",autocomplete:"family-name"},"honorific-suffix":{type:"text",autocomplete:"honorific-suffix"},nickname:{type:"text",autocomplete:"nickname"},firstName:{type:"text",autocomplete:"given-name"},lastName:{type:"text",autocomplete:"family-name"},email:{type:"email",autocomplete:"email"},tel:{type:"tel",autocomplete:"tel"},"tel-country-code":{type:"tel",autocomplete:"tel-country-code"},"tel-national":{type:"tel",autocomplete:"tel-national"},"tel-area-code":{type:"tel",autocomplete:"tel-area-code"},"tel-local":{type:"tel",autocomplete:"tel-local"},"tel-extension":{type:"tel",autocomplete:"tel-extension"},"street-address":{type:"text",autocomplete:"street-address"},"address-line1":{type:"text",autocomplete:"address-line1"},"address-line2":{type:"text",autocomplete:"address-line2"},"address-line3":{type:"text",autocomplete:"address-line3"},"address-level1":{type:"text",autocomplete:"address-level1"},"address-level2":{type:"text",autocomplete:"address-level2"},"address-level3":{type:"text",autocomplete:"address-level3"},"address-level4":{type:"text",autocomplete:"address-level4"},country:{type:"text",autocomplete:"country"},"country-name":{type:"text",autocomplete:"country-name"},"postal-code":{type:"text",autocomplete:"postal-code"},"cc-name":{type:"text",autocomplete:"cc-name"},"cc-given-name":{type:"text",autocomplete:"cc-given-name"},"cc-additional-name":{type:"text",autocomplete:"cc-additional-name"},"cc-family-name":{type:"text",autocomplete:"cc-family-name"},"cc-number":{type:"text",autocomplete:"cc-number"},"cc-exp":{type:"text",autocomplete:"cc-exp"},"cc-exp-month":{type:"number",autocomplete:"cc-exp-month"},"cc-exp-year":{type:"number",autocomplete:"cc-exp-year"},"cc-csc":{type:"text",autocomplete:"cc-csc"},"cc-type":{type:"text",autocomplete:"cc-type"},bday:{type:"date",autocomplete:"bday"},"bday-day":{type:"number",autocomplete:"bday-day"},"bday-month":{type:"number",autocomplete:"bday-month"},"bday-year":{type:"number",autocomplete:"bday-year"},username:{type:"text",autocomplete:"username"},"new-password":{type:"password",autocomplete:"new-password"},"current-password":{type:"password",autocomplete:"current-password"},"one-time-code":{type:"text",autocomplete:"one-time-code"},"transaction-currency":{type:"text",autocomplete:"transaction-currency"},"transaction-amount":{type:"number",autocomplete:"transaction-amount"},url:{type:"url",autocomplete:"url"},photo:{type:"url",autocomplete:"photo"},sex:{type:"text",autocomplete:"sex"},"organization-title":{type:"text",autocomplete:"organization-title"},organization:{type:"text",autocomplete:"organization"},language:{type:"text",autocomplete:"language"}}[e]||o:o},ie=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,showLabel:c,required:p,inputType:g,defaultValue:h}=e,{type:k,autocomplete:f}=re(g);return c?r.jsxs("div",{...s,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:h,...n,type:k,placeholder:i,required:p,autoComplete:f})]}):r.jsx("input",{name:t,...o,...n,...s,type:k,placeholder:i,required:p,autoComplete:f,defaultValue:h})},se={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ae=e=>{const{blockProps:o,content:t,styles:l,children:i}=e,s={...l,...o};return i?b.createElement("label",s,i):b.createElement("label",{...s,dangerouslySetInnerHTML:{__html:t}})},ne={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:i,inputStyles:s,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...i,...o,children:[r.jsx("input",{...s,name:t,type:"radio",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...s,...i,type:"radio",required:n,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("flex items-center gap-x-2"),inputStyles:a.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,required:c,showLabel:p,_multiple:g,options:h,defaultValue:k}=e,f=g&&k?k.split(",").map(y=>y.trim()):k||"";return p?r.jsxs("div",{...s,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...n,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),u.map(h,y=>r.jsx("option",{value:y==null?void 0:y.value,children:y==null?void 0:y.label},y==null?void 0:y.value))]})]}):r.jsxs("select",{...s,...o,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),u.map(h,y=>r.jsx("option",{value:y==null?void 0:y.value,children:y==null?void 0:y.label},y==null?void 0:y.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:i,styles:s,inputStyles:n,rows:c,showLabel:p,required:g,defaultValue:h}=e;return p?r.jsxs("div",{...s,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...n,placeholder:i,rows:c,required:g,defaultValue:h})]}):r.jsx("textarea",{name:t,...o,...n,...s,placeholder:i,rows:c,required:g,defaultValue:h})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",...a.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:a.StylesProp(""),inputStyles:a.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:i="h1",children:s=null}=e;return s?b.createElement(i,{...t,...o},s):b.createElement(i,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",...a.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:a.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(C,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(C,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(C,{})},Be=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(C,{})},Se=e=>{const{blockProps:o,children:t,content:l,styles:i}=e;return!t&&u.isEmpty(l)?r.jsx(C,{}):t?x.createElement("td",{...o,...i},t):x.createElement("td",{...o,...i,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("Table")});d.registerChaiBlock(ke,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableHead")});d.registerChaiBlock(Ce,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableBody")});d.registerChaiBlock(Be,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),blocks:S("TableRow")});d.registerChaiBlock(Se,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:S("TableCell"),i18nProps:["content"],aiProps:["content"]});function S(e){const o=(s,n)=>({_id:B.generateUUID(),_parent:s,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=s=>{const n=B.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return s&&(c._parent=s),[c,o(n,"1"),o(n,"2"),o(n,"3")]},l=s=>{const n=B.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return s&&(c._parent=s),[c,...t(n)]},i=s=>{const n=B.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return s&&(c._parent=s),[c,...t(n),...t(n)]};if(e==="Table"){const s=B.generateUUID();return[{_id:s,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(s),...i(s)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?i():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",Pe=e=>{const{blockProps:o,image:t,mobileImage:l,styles:i,alt:s,height:n,width:c,lazyLoading:p,mobileWidth:g,mobileHeight:h}=e;return u.isEmpty(t)?r.jsx(C,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:g,height:h}),r.jsx("img",{...o,...i,src:t,alt:s,loading:p?"lazy":"eager",width:c,height:n})]})},ve={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},Ie=e=>{const{blockProps:o,link:t,children:l,styles:i,inBuilder:s,content:n}=e;let c={};return!l&&u.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),s?l?r.jsx("span",{role:"link",...o,style:c,...i,children:l}):x.createElement("span",{...o,...i,style:c,role:"link"},n):l?r.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...i,children:l}):x.createElement("a",{...o,...i,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},je={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("block"),content:{type:"string",default:"Link text goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Le=e=>{const{blockProps:o,children:t,styles:l,tag:i,inBuilder:s}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(C,{inBuilder:s}):b.createElement(i||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:i,tag:s}=e;return i?b.createElement(s||"li",{...l,...o},i):b.createElement(s||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const i=v(t,"rte");return b.createElement("div",{...i,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",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.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,i=v(l,"rte");return r.jsx("div",{...o,...i,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},He=e=>{const{blockProps:o,styles:t,content:l,children:i=null,tag:s}=e;return i?b.createElement("span",{...t,...o},i):b.createElement(s||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},P={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),i=u.get(o,"loop",!1),s=t||u.get(o,"muted",!0);if(I.test(e)){const n=e.match(I);if(n){const c=n[4];let p=`https://www.youtube.com/embed/${c}`,g=t?"autoplay=1":"";return g+=i?`&loop=1&playlist=${c}`:"",g+=s?"&mute=1&muted=1":"",g+=l?"&controls=1":"&controls=0",`${p}?${g}`}}if(j.test(e)){const n=e.match(j);if(n){const c=n[1];let p="";return p+=t?"autoplay=1":"",p+=l?"&controls=1":"&controls=0",p+=s?"&muted=1":"",p+=i?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},Ue=e=>{const{url:o,blockProps:t,styles:l,controls:i,videoSource:s,inBuilder:n,title:c}=e,p=ze(o,i);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&n?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${s} video link in settings Video URL.`:`Provided ${s} video link is invalid.`}):r.jsx("iframe",{width:"100%",src:p??"",title:c||"Video player",...u.pick(l,"className")}),n&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Fe=e=>{const{url:o,styles:t,controls:l,sources:i,poster:s,blockProps:n,title:c}=e;let p=s;const g=[...u.get(i,"srcsets",[])||[]];o&&typeof o=="string"&&g.push({url:o,width:9999});const h=g.sort((f,y)=>f.width-y.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));h.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const k=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(h))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,title:c||"Video player",key:JSON.stringify(h),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...k?{muted:!0}:{}},h.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const y=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:y,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Fe,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Ue,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",...a.registerChaiBlockSchema({properties:{styles:a.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...P}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...P}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...P}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:i,$loading:s}=e,{pagination:n,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?s&&c?Array.from({length:2}).map((g,h)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},h)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...i,...l},s&&c?Array.from({length:2}).map((g,h)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},h)):p),n&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...a.registerChaiBlockSchema({properties:{styles:a.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:a.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"],enumNames:["Query(/items?page=1)","Segment(/items/1)"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:i})=>{let s="li";switch(l){case"ul":s="li";break;case"ol":s="li";break;default:s="div"}return!e&&i?b.createElement(s,{...o,...t},r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):b.createElement(s,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...a.registerChaiBlockSchema({properties:{styles:a.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(Ie,je),d.registerChaiBlock(Le,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(Pe,ve),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(ie,se),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ae,ne),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(U,F),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isEmpty as w, get as k, map as R, isNull as U, omit as M, pick as H } from "lodash-es";
|
|
2
1
|
import { jsx as i, jsxs as h, Fragment as N } from "react/jsx-runtime";
|
|
3
2
|
import { r as p, S as u, s as L } from "./index-Dxfyt4d4.js";
|
|
4
3
|
import { c as _, g as I } from "./common-functions-D2lMFR6K.js";
|
|
5
4
|
import * as b from "react";
|
|
6
5
|
import { createElement as x } from "react";
|
|
7
|
-
import { ButtonIcon as
|
|
6
|
+
import { ButtonIcon as M, CodeIcon as H, FrameIcon as $, SketchLogoIcon as U, RowsIcon as j, LayoutIcon as Z, DividerHorizontalIcon as q, CheckboxIcon as G, FileTextIcon as W, InputIcon as D, LetterCaseToggleIcon as O, RadiobuttonIcon as Y, DropdownMenuIcon as Q, HeadingIcon as J, TableIcon as X, BorderTopIcon as K, BorderAllIcon as ee, ViewHorizontalIcon as te, DragHandleHorizontalIcon as oe, ImageIcon as le, Link1Icon as re, ColumnsIcon as ne, TextIcon as ie, CursorTextIcon as ae, SpaceBetweenVerticallyIcon as se, VideoIcon as ce, ChevronLeftIcon as de, ChevronRightIcon as pe, LoopIcon as V } from "@radix-ui/react-icons";
|
|
7
|
+
import { isEmpty as w, get as k, map as R, isNull as ue, omit as z, pick as F } from "lodash-es";
|
|
8
8
|
import { r as d, e as me, c as ye } from "./core-Dr7QYemB.js";
|
|
9
9
|
const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: _("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("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, ge = (e) => {
|
|
10
10
|
const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: a } = e;
|
|
@@ -81,7 +81,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
81
81
|
description: "similar to a button element in HTML",
|
|
82
82
|
label: "Button",
|
|
83
83
|
category: "core",
|
|
84
|
-
icon:
|
|
84
|
+
icon: M,
|
|
85
85
|
group: "basic",
|
|
86
86
|
...p({
|
|
87
87
|
properties: {
|
|
@@ -150,7 +150,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
150
150
|
description: "similar to a div or section elements in HTML",
|
|
151
151
|
label: "Custom HTML",
|
|
152
152
|
category: "core",
|
|
153
|
-
icon:
|
|
153
|
+
icon: H,
|
|
154
154
|
group: "advanced",
|
|
155
155
|
...p({
|
|
156
156
|
properties: {
|
|
@@ -171,7 +171,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
171
171
|
description: "similar to a script element in HTML",
|
|
172
172
|
label: "Custom Script",
|
|
173
173
|
category: "core",
|
|
174
|
-
icon:
|
|
174
|
+
icon: H,
|
|
175
175
|
hidden: !0,
|
|
176
176
|
group: "advanced",
|
|
177
177
|
...p({
|
|
@@ -205,7 +205,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
205
205
|
type: "GlobalBlock",
|
|
206
206
|
description: "A global block component",
|
|
207
207
|
label: "Global Block",
|
|
208
|
-
icon:
|
|
208
|
+
icon: $,
|
|
209
209
|
category: "core",
|
|
210
210
|
group: "basic",
|
|
211
211
|
hidden: !0,
|
|
@@ -241,7 +241,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
241
241
|
label: "web_blocks.icon",
|
|
242
242
|
category: "core",
|
|
243
243
|
description: "Icon block is used to display an icon/svg.",
|
|
244
|
-
icon:
|
|
244
|
+
icon: U,
|
|
245
245
|
group: "media",
|
|
246
246
|
...p({
|
|
247
247
|
properties: {
|
|
@@ -284,7 +284,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
284
284
|
type: "PartialBlock",
|
|
285
285
|
description: "A partial block component. Partial blocks are global blocks that can be used in multiple pages.",
|
|
286
286
|
label: "Partial Block",
|
|
287
|
-
icon:
|
|
287
|
+
icon: $,
|
|
288
288
|
category: "core",
|
|
289
289
|
group: "basic",
|
|
290
290
|
hidden: !0,
|
|
@@ -355,7 +355,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
355
355
|
label: "Column",
|
|
356
356
|
group: "basic",
|
|
357
357
|
category: "core",
|
|
358
|
-
icon:
|
|
358
|
+
icon: Z,
|
|
359
359
|
wrapper: !0,
|
|
360
360
|
hidden: !0,
|
|
361
361
|
canDelete: () => !0,
|
|
@@ -394,7 +394,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
394
394
|
description: "A row component",
|
|
395
395
|
label: "Row",
|
|
396
396
|
group: "basic",
|
|
397
|
-
icon:
|
|
397
|
+
icon: j,
|
|
398
398
|
hidden: !0,
|
|
399
399
|
blocks: () => [
|
|
400
400
|
{ _type: "Row", _id: "row", styles: "#styles:,p-1" },
|
|
@@ -429,7 +429,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
429
429
|
description: "A horizontal line component",
|
|
430
430
|
label: "Divider",
|
|
431
431
|
category: "core",
|
|
432
|
-
icon:
|
|
432
|
+
icon: q,
|
|
433
433
|
group: "basic",
|
|
434
434
|
...p({
|
|
435
435
|
properties: {
|
|
@@ -478,7 +478,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
478
478
|
type: "Checkbox",
|
|
479
479
|
label: "web_blocks.checkbox",
|
|
480
480
|
category: "core",
|
|
481
|
-
icon:
|
|
481
|
+
icon: G,
|
|
482
482
|
group: "form",
|
|
483
483
|
...p({
|
|
484
484
|
properties: {
|
|
@@ -542,7 +542,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
542
542
|
type: "Form",
|
|
543
543
|
label: "Form",
|
|
544
544
|
category: "core",
|
|
545
|
-
icon:
|
|
545
|
+
icon: W,
|
|
546
546
|
group: "form",
|
|
547
547
|
blocks: () => [
|
|
548
548
|
{ _type: "Form", _id: "form", styles: "#styles:p-1 space-y-2," },
|
|
@@ -596,7 +596,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
596
596
|
type: "FormButton",
|
|
597
597
|
label: "Submit Button",
|
|
598
598
|
category: "core",
|
|
599
|
-
icon:
|
|
599
|
+
icon: M,
|
|
600
600
|
group: "form",
|
|
601
601
|
...p({
|
|
602
602
|
properties: {
|
|
@@ -744,7 +744,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
744
744
|
type: "Input",
|
|
745
745
|
label: "web_blocks.input",
|
|
746
746
|
category: "core",
|
|
747
|
-
icon:
|
|
747
|
+
icon: D,
|
|
748
748
|
group: "form",
|
|
749
749
|
...p({
|
|
750
750
|
properties: {
|
|
@@ -865,7 +865,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
865
865
|
type: "Label",
|
|
866
866
|
label: "Label",
|
|
867
867
|
category: "core",
|
|
868
|
-
icon:
|
|
868
|
+
icon: O,
|
|
869
869
|
group: "form",
|
|
870
870
|
...p({
|
|
871
871
|
properties: {
|
|
@@ -900,7 +900,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
900
900
|
type: "Radio",
|
|
901
901
|
label: "web_blocks.radio",
|
|
902
902
|
category: "core",
|
|
903
|
-
icon:
|
|
903
|
+
icon: Y,
|
|
904
904
|
group: "form",
|
|
905
905
|
...p({
|
|
906
906
|
properties: {
|
|
@@ -984,7 +984,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
984
984
|
type: "Select",
|
|
985
985
|
label: "web_blocks.select",
|
|
986
986
|
category: "core",
|
|
987
|
-
icon:
|
|
987
|
+
icon: Q,
|
|
988
988
|
group: "form",
|
|
989
989
|
...p({
|
|
990
990
|
properties: {
|
|
@@ -1081,7 +1081,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
1081
1081
|
type: "TextArea",
|
|
1082
1082
|
label: "web_blocks.textarea",
|
|
1083
1083
|
category: "core",
|
|
1084
|
-
icon:
|
|
1084
|
+
icon: D,
|
|
1085
1085
|
group: "form",
|
|
1086
1086
|
...p({
|
|
1087
1087
|
properties: {
|
|
@@ -1140,7 +1140,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
|
|
|
1140
1140
|
description: "A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",
|
|
1141
1141
|
label: "Heading",
|
|
1142
1142
|
category: "core",
|
|
1143
|
-
icon:
|
|
1143
|
+
icon: J,
|
|
1144
1144
|
group: "typography",
|
|
1145
1145
|
...p({
|
|
1146
1146
|
properties: {
|
|
@@ -1206,7 +1206,7 @@ d(rt, {
|
|
|
1206
1206
|
category: "core",
|
|
1207
1207
|
group: "table",
|
|
1208
1208
|
hidden: !0,
|
|
1209
|
-
icon:
|
|
1209
|
+
icon: X,
|
|
1210
1210
|
...p({
|
|
1211
1211
|
properties: {
|
|
1212
1212
|
styles: u("")
|
|
@@ -1220,7 +1220,7 @@ d(nt, {
|
|
|
1220
1220
|
category: "core",
|
|
1221
1221
|
group: "table",
|
|
1222
1222
|
hidden: !0,
|
|
1223
|
-
icon:
|
|
1223
|
+
icon: K,
|
|
1224
1224
|
...p({
|
|
1225
1225
|
properties: {
|
|
1226
1226
|
styles: u("")
|
|
@@ -1234,7 +1234,7 @@ d(it, {
|
|
|
1234
1234
|
category: "core",
|
|
1235
1235
|
group: "table",
|
|
1236
1236
|
hidden: !0,
|
|
1237
|
-
icon:
|
|
1237
|
+
icon: ee,
|
|
1238
1238
|
...p({
|
|
1239
1239
|
properties: {
|
|
1240
1240
|
styles: u("")
|
|
@@ -1248,7 +1248,7 @@ d(at, {
|
|
|
1248
1248
|
category: "core",
|
|
1249
1249
|
group: "table",
|
|
1250
1250
|
hidden: !0,
|
|
1251
|
-
icon:
|
|
1251
|
+
icon: te,
|
|
1252
1252
|
...p({
|
|
1253
1253
|
properties: {
|
|
1254
1254
|
styles: u("")
|
|
@@ -1262,7 +1262,7 @@ d(st, {
|
|
|
1262
1262
|
category: "core",
|
|
1263
1263
|
group: "table",
|
|
1264
1264
|
hidden: !0,
|
|
1265
|
-
icon:
|
|
1265
|
+
icon: oe,
|
|
1266
1266
|
...p({
|
|
1267
1267
|
properties: {
|
|
1268
1268
|
styles: u(""),
|
|
@@ -1343,7 +1343,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1343
1343
|
description: "A image component",
|
|
1344
1344
|
label: "Image",
|
|
1345
1345
|
category: "core",
|
|
1346
|
-
icon:
|
|
1346
|
+
icon: le,
|
|
1347
1347
|
group: "media",
|
|
1348
1348
|
...p({
|
|
1349
1349
|
properties: {
|
|
@@ -1427,7 +1427,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1427
1427
|
description: "A link component",
|
|
1428
1428
|
label: "Link",
|
|
1429
1429
|
category: "core",
|
|
1430
|
-
icon:
|
|
1430
|
+
icon: re,
|
|
1431
1431
|
group: "basic",
|
|
1432
1432
|
...p({
|
|
1433
1433
|
properties: {
|
|
@@ -1470,7 +1470,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1470
1470
|
type: "List",
|
|
1471
1471
|
description: "A list component",
|
|
1472
1472
|
label: "List",
|
|
1473
|
-
icon:
|
|
1473
|
+
icon: j,
|
|
1474
1474
|
category: "core",
|
|
1475
1475
|
group: "basic",
|
|
1476
1476
|
...p({
|
|
@@ -1514,7 +1514,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1514
1514
|
type: "ListItem",
|
|
1515
1515
|
description: "A list item component",
|
|
1516
1516
|
label: "List Item",
|
|
1517
|
-
icon:
|
|
1517
|
+
icon: ne,
|
|
1518
1518
|
category: "core",
|
|
1519
1519
|
group: "basic",
|
|
1520
1520
|
...p({
|
|
@@ -1536,7 +1536,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1536
1536
|
canBeNested: (e) => e === "List" || e === "Repeater"
|
|
1537
1537
|
}, ht = (e) => {
|
|
1538
1538
|
const { blockProps: o, styles: t, content: l } = e;
|
|
1539
|
-
if (!
|
|
1539
|
+
if (!ue(e.children)) return b.createElement("p", { ...t, ...o }, e.children);
|
|
1540
1540
|
const r = T(t, "rte");
|
|
1541
1541
|
return b.createElement("div", {
|
|
1542
1542
|
...r,
|
|
@@ -1548,7 +1548,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1548
1548
|
description: "A paragraph component",
|
|
1549
1549
|
label: "Paragraph",
|
|
1550
1550
|
category: "core",
|
|
1551
|
-
icon:
|
|
1551
|
+
icon: ie,
|
|
1552
1552
|
group: "typography",
|
|
1553
1553
|
...p({
|
|
1554
1554
|
properties: {
|
|
@@ -1573,7 +1573,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1573
1573
|
label: "Rich Text",
|
|
1574
1574
|
hidden: !0,
|
|
1575
1575
|
category: "core",
|
|
1576
|
-
icon:
|
|
1576
|
+
icon: ae,
|
|
1577
1577
|
group: "typography",
|
|
1578
1578
|
...p({
|
|
1579
1579
|
properties: {
|
|
@@ -1622,7 +1622,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1622
1622
|
category: "core",
|
|
1623
1623
|
group: "typography",
|
|
1624
1624
|
blocks: () => [{ _id: "a", _type: "Text", _name: "Text", content: "" }],
|
|
1625
|
-
icon:
|
|
1625
|
+
icon: se,
|
|
1626
1626
|
...p({
|
|
1627
1627
|
properties: {
|
|
1628
1628
|
styles: u("text-black"),
|
|
@@ -1687,8 +1687,8 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1687
1687
|
return null;
|
|
1688
1688
|
}, Bt = (e) => {
|
|
1689
1689
|
const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: a, title: s } = e, c = Lt(o, r);
|
|
1690
|
-
return /* @__PURE__ */ h("div", { ...
|
|
1691
|
-
!c && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: w(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: c ?? "", title: s || "Video player", ...
|
|
1690
|
+
return /* @__PURE__ */ h("div", { ...z(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
1691
|
+
!c && a ? /* @__PURE__ */ i("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: w(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ i("iframe", { width: "100%", src: c ?? "", title: s || "Video player", ...F(l, "className") }),
|
|
1692
1692
|
a && /* @__PURE__ */ i("div", { ...t, className: "absolute top-0 h-full w-full" })
|
|
1693
1693
|
] });
|
|
1694
1694
|
}, St = (e) => {
|
|
@@ -1729,7 +1729,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1729
1729
|
type: "Video",
|
|
1730
1730
|
label: "Video",
|
|
1731
1731
|
category: "core",
|
|
1732
|
-
icon:
|
|
1732
|
+
icon: ce,
|
|
1733
1733
|
group: "media",
|
|
1734
1734
|
...p({
|
|
1735
1735
|
properties: {
|
|
@@ -1817,13 +1817,13 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1817
1817
|
i18nProps: ["url", "title"]
|
|
1818
1818
|
}, Tt = (e) => {
|
|
1819
1819
|
const { paginationStyles: o } = e, t = me("Pagination");
|
|
1820
|
-
return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...
|
|
1820
|
+
return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...z(e, ["paginationStyles"]), blockProps: {} }) : /* @__PURE__ */ h(N, { children: [
|
|
1821
1821
|
/* @__PURE__ */ i(
|
|
1822
1822
|
"button",
|
|
1823
1823
|
{
|
|
1824
1824
|
className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1825
1825
|
disabled: !0,
|
|
1826
|
-
children: /* @__PURE__ */ i(
|
|
1826
|
+
children: /* @__PURE__ */ i(de, { className: "h-4 w-4" })
|
|
1827
1827
|
}
|
|
1828
1828
|
),
|
|
1829
1829
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white", children: "1" }),
|
|
@@ -1831,7 +1831,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1831
1831
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "3" }),
|
|
1832
1832
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "4" }),
|
|
1833
1833
|
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50", children: "5" }),
|
|
1834
|
-
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50", children: /* @__PURE__ */ i(
|
|
1834
|
+
/* @__PURE__ */ i("button", { className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50", children: /* @__PURE__ */ i(pe, { className: "h-4 w-4" }) })
|
|
1835
1835
|
] }) });
|
|
1836
1836
|
}, Rt = (e) => {
|
|
1837
1837
|
const { children: o, tag: t, styles: l, blockProps: r, $loading: n } = e, { pagination: a, inBuilder: s } = e;
|
|
@@ -1851,7 +1851,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1851
1851
|
a && /* @__PURE__ */ i(
|
|
1852
1852
|
Tt,
|
|
1853
1853
|
{
|
|
1854
|
-
...
|
|
1854
|
+
...F(e, [
|
|
1855
1855
|
"limit",
|
|
1856
1856
|
"totalItems",
|
|
1857
1857
|
"paginationStrategy",
|
|
@@ -1866,7 +1866,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1866
1866
|
}, At = {
|
|
1867
1867
|
type: "Repeater",
|
|
1868
1868
|
label: "Repeater",
|
|
1869
|
-
icon:
|
|
1869
|
+
icon: V,
|
|
1870
1870
|
group: "basic",
|
|
1871
1871
|
description: "Repeater block is used to display a list of items based on data binding in repeaterItems",
|
|
1872
1872
|
dataProviderMode: "live",
|
|
@@ -1984,7 +1984,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
|
|
|
1984
1984
|
}, Mt = {
|
|
1985
1985
|
type: "RepeaterItem",
|
|
1986
1986
|
label: "Repeater Item",
|
|
1987
|
-
icon:
|
|
1987
|
+
icon: V,
|
|
1988
1988
|
hidden: !0,
|
|
1989
1989
|
group: "basic",
|
|
1990
1990
|
...p({
|