@chaibuilder/sdk 2.0.0-beta.54 → 2.0.0-beta.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeEditor-DvFaAnJ4.js → CodeEditor-BLTQpTTM.js} +2 -2
- package/dist/{CodeEditor-CzoZfMYd.cjs → CodeEditor-CJhjQonw.cjs} +1 -1
- package/dist/{Topbar-XpkgGUK2.js → Topbar-CEyGOl06.js} +2 -2
- package/dist/{Topbar-Zby0BmoN.cjs → Topbar-pFV2NO8v.cjs} +1 -1
- package/dist/{context-menu-dsqhw1Ub.cjs → context-menu-C_ITMOD1.cjs} +1 -1
- package/dist/{context-menu-BsI3Hqio.js → context-menu-FCyNTUkl.js} +1 -1
- package/dist/core.cjs +5 -246
- package/dist/core.d.ts +15 -15
- package/dist/core.js +3509 -28338
- package/dist/jsx-runtime-Drh4NO5G.js +633 -0
- package/dist/jsx-runtime-qcKc-DpB.cjs +30 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +2 -2
- package/dist/render.js +92 -83
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +14 -14
- package/dist/ui.js +3 -3
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +7 -6
- package/dist/jsx-runtime-DGh1k5sI.cjs +0 -31
- package/dist/jsx-runtime-Dx-03ztt.js +0 -445
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),n=require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),n=require("./jsx-runtime-qcKc-DpB.cjs"),k=require("react"),x=require("./iconBase-Cn2BsTrq.cjs"),m=require("@radix-ui/react-icons"),g=require("lodash-es"),B=require("lucide-react");function I(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(s,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return s.default=e,Object.freeze(s)}const h=I(k),w=({className:e="",inBuilder:s})=>s?n.jsxRuntimeExports.jsx("div",{className:x.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,_=e=>{const{blockProps:s,inBuilder:o,backgroundImage:r,children:l,tag:i="div",styles:a}=e;let c=l;l||(c=n.jsxRuntimeExports.jsx(w,{inBuilder:o}));let p={};return r&&(p={backgroundImage:`url(${r})`}),h.createElement(i,{...s,...a,style:p},c)},L={type:"Box",label:"Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}},tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]}}}),canAcceptBlock:()=>!0},R=e=>{const{blockProps:s,iconSize:o,icon:r,content:l,styles:i,children:a,iconPos:c,link:p,inBuilder:d}=e,y=r,f=a||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:l}),y&&n.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:y}})]}),u=k.createElement("button",{...s,...i,type:"button"},f);return g.isEmpty(g.get(p,"href"))?u:d?n.jsxRuntimeExports.jsx("span",{children:u}):n.jsxRuntimeExports.jsx("a",{href:g.get(p,"href")||"/",target:g.get(p,"target","_self"),children:u})},M={type:"Button",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}}}}),i18nProps:["content"],aiProps:["content"]},D=e=>{const{blockProps:s,styles:o,htmlCode:r,inBuilder:l}=e;return l?n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[l?n.jsxRuntimeExports.jsx("div",{...s,...o,className:"absolute z-20 h-full w-full"}):null,h.createElement("div",{...o,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):h.createElement("div",{...s,...o,dangerouslySetInnerHTML:{__html:r}})},N={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:m.CodeIcon,group:"advanced",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}})},T=e=>{const{blockProps:s,styles:o,backgroundImage:r}=e;let l={};return r&&(l={backgroundImage:`url(${r})`}),h.createElement("div",{...s,...o,style:l})},$={type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},A=e=>{const{blockProps:s,styles:o,content:r,tag:l="h1",children:i=null}=e;return i?h.createElement(l,{...o,...s},i):h.createElement(l,{...o,...s,dangerouslySetInnerHTML:{__html:r}})},z={type:"Heading",label:"web_blocks.heading",category:"core",icon:m.HeadingIcon,group:"typography",...t.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:t.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},H=e=>{const{blockProps:s,styles:o,content:r}=e;return g.isNull(e.children)?h.createElement("p",{...o,...s,dangerouslySetInnerHTML:{__html:r}}):h.createElement("p",{...o,...s},e.children)},q={type:"Paragraph",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
2
2
|
Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
|
|
3
3
|
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},U=e=>{const{blockProps:s,content:o,styles:r}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{...s,...r,dangerouslySetInnerHTML:{__html:o}})})},O={type:"RichText",label:"Rich Text",category:"core",icon:m.CursorTextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},F=e=>{const{blockProps:s,styles:o,content:r,children:l=null,tag:i}=e;return l?h.createElement("span",{...o,...s},l):h.createElement(i||"span",{...o,...s,dangerouslySetInnerHTML:{__html:r||""}})},G={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};function V(e){return x.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const W=e=>{const{scripts:s,inBuilder:o,blockProps:r}=e;return o?n.jsxRuntimeExports.jsx("div",{...r,children:n.jsxRuntimeExports.jsx("div",{className:x.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s}})},X={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:V,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},Y=e=>n.jsxRuntimeExports.jsxs("div",{...e.blockProps,...e.styles,children:[e.mode,e.children]}),Z=e=>e.mode==="dark"?null:n.jsxRuntimeExports.jsx("button",{...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(Z,{type:"DarkModeButton",label:"Dark Mode Button",category:"core",icon:m.MoonIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp("")}})});const J=e=>e.mode==="light"?null:n.jsxRuntimeExports.jsx("button",{...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(J,{type:"LightModeButton",label:"Light Mode Button",category:"core",icon:m.SunIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp(""),fake:{type:"string",default:""}}})});const K={type:"DarkModeSwitcher",label:"web_blocks.dark_mode",category:"core",icon:m.MoonIcon,group:"advanced",wrapper:!0,...t.registerChaiBlockSchema({properties:{mode:{title:"Mode",type:"string",enum:["dark","light"],default:"light"},styles:t.stylesProp("")}}),blocks:()=>[{_id:"ultqCh",_type:"DarkModeSwitcher",mode:"light",styles:"#styles:,",_name:"Dark Mode Theme"},{_id:"vroabi",_parent:"ultqCh",_type:"LightModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"nltBrv",_parent:"vroabi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"DarkModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white hidden dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"AdDwBC",_parent:"gesydi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},Q=e=>{const{blockProps:s,styles:o}=e;return k.createElement("hr",{...o,...s})},ee={type:"Divider",label:"web_blocks.divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},te=e=>{const{blockProps:s,inBuilder:o,children:r,globalBlock:l}=e;return o&&!l?n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-4 bg-gray-100 rounded-lg gap-y-1 dark:bg-gray-800",...s,children:[n.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",l]}),n.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):h.createElement("span",{...s},r)},oe={type:"GlobalBlock",label:"Global Block",icon:B.GlobeIcon,category:"core",group:"advanced",...t.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},E=(e,...s)=>({...e,className:x.cn(e.className,...s)}),se=e=>{const{blockProps:s,icon:o,styles:r,width:l,inBuilder:i,height:a}=e,c=E(r,"");if(g.isEmpty(o))return n.jsxRuntimeExports.jsx(w,{inBuilder:i,className:"h-8 w-14"});const p=o.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return h.createElement("span",{...s,...c,style:{width:l?`${l}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},re={type:"Icon",label:"web_blocks.icon",category:"core",icon:m.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),icon:{type:"string",title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},le=e=>{const{blockProps:s,image:o,mobileImage:r,styles:l,alt:i,height:a,width:c,lazyLoading:p}=e;return g.isEmpty(o)?n.jsxRuntimeExports.jsx(w,{className:"h-36"}):n.jsxRuntimeExports.jsxs("picture",{children:[r&&n.jsxRuntimeExports.jsx("source",{srcSet:r,media:"(max-width: 480px)"}),n.jsxRuntimeExports.jsx("img",{...s,...l,src:o,alt:i,loading:p?"lazy":"eager",width:c,height:a})]})},ne={type:"Image",label:"Image",category:"core",icon:m.ImageIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),image:{type:"string",title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas",ui:{"ui:widget":"image"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0},width:{type:"number",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"number",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}}}}),aiProps:["alt"],i18nProps:["alt"]},ie=e=>{const{blockProps:s,children:o,styles:r,inBuilder:l,content:i,href:a}=e,{hrefType:c,autoplay:p,maxWidth:d,backdropColor:y,galleryName:f}=e,u=E(r,"cb-lightbox");if(!o&&g.isEmpty(r==null?void 0:r.className)&&g.isEmpty(i))return n.jsxRuntimeExports.jsx(w,{inBuilder:l});if(l)return o?n.jsxRuntimeExports.jsx("span",{...s,...u,children:o}):h.createElement("span",{...s,...u,dangerouslySetInnerHTML:{__html:i}});const b={};return c!=="image"&&(b["data-vbtype"]=c),p&&(b["data-autoplay"]="true"),d&&(b["data-maxwidth"]=d+"px"),y&&(b["data-overlay"]=y),f&&(b["data-gall"]=f),o?n.jsxRuntimeExports.jsx("a",{...b,href:a||"#/",...s,...u,children:o}):h.createElement("a",{...s,...u,...b,href:a||"#",dangerouslySetInnerHTML:{__html:i}})},ae={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:m.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},hrefType:{type:"string",title:"Type",default:"image",enum:["image","video","iframe","inline","ajax"],enumNames:["Image","Video","Iframe","Inline","Ajax"]},href:{type:"string",title:"Href",default:""},autoplay:{type:"boolean",title:"Autoplay (Video only)",default:!1},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}},dependencies:{autoplay:["hrefType","video"]}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},ce=e=>{const{blockProps:s,link:o,children:r,styles:l,inBuilder:i,content:a}=e;let c={};return!r&&g.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?r?n.jsxRuntimeExports.jsx("span",{...s,style:c,...l,children:r}):k.createElement("span",{...s,...l,style:c},a):r?n.jsxRuntimeExports.jsx("a",{href:(o==null?void 0:o.href)||"#/",target:o==null?void 0:o.target,...s,...l,children:r}):k.createElement("a",{...s,...l,href:(o==null?void 0:o.href)||"#",target:(o==null?void 0:o.target)||"_self"},a)},pe={type:"Link",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},ue=e=>{const{blockProps:s,children:o,listType:r,styles:l,tag:i,inBuilder:a}=e,c=x.cn(g.get(l,"className",""),r);return!o&&g.isEmpty(l==null?void 0:l.className)?n.jsxRuntimeExports.jsx(w,{inBuilder:a}):h.createElement(i||(r==="list-decimal"?"ol":"ul"),{...s,...l,className:c},o)},de={type:"List",label:"web_blocks.list",icon:m.RowsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),listType:{type:"string",title:"List Type",default:"list-none",oneOf:[{enum:["list-none"],title:"List None"},{enum:["list-disc"],title:"Disc"},{enum:["list-decimal"],title:"Decimal"}]}}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},ge=e=>{const{blockProps:s,content:o,styles:r,children:l,tag:i}=e;return l?h.createElement(i||"li",{...r,...s},l):h.createElement(i||"li",{...r,...s,dangerouslySetInnerHTML:{__html:o}})},me={type:"ListItem",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},ye=e=>e.inBuilder||e.forceWrapper?n.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,he={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},S=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,P=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,v=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,fe=e=>{if(S.test(e)){const s=e.match(S);return s?`https://www.youtube.com/embed/${s[4]}`:e}if(P.test(e)){const s=e.match(P);return s?`https://player.vimeo.com/video/${s[3]}`:e}if(v.test(e)){const s=e.match(v);return s?`https://www.dailymotion.com/embed/video/${s[4]}`:e}return null},xe=h.memo(e=>{const{blockProps:s,inBuilder:o,styles:r,url:l,controls:i}=e,a=g.get(i,"autoPlay",!1),c=g.get(i,"controls",!1),p=a||g.get(i,"muted",!0),d=g.get(i,"loop",!1);if(g.isEmpty(l))return n.jsxRuntimeExports.jsx(w,{inBuilder:o,className:"h-36"});let y=fe(l),f=null;if(y){if(!g.isEmpty(y)){const u=[];u.push(`autoplay=${a?1:0}`),u.push(`controls=${i?1:0}`),u.push(`mute=${p?1:0}&muted=${p?1:0}`),u.push(`loop=${d?1:0}`),y=`${y}?${u.join("&")}`}f=h.createElement("iframe",{...s,className:"absolute inset-0 w-full h-full",src:y,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else f=h.createElement("video",{...s,className:"absolute inset-0 w-full h-full",src:l,controls:c,muted:p,autoPlay:o?!1:a,loop:d});return n.jsxRuntimeExports.jsx("div",{...g.pick(r,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?n.jsxRuntimeExports.jsx("div",{...s,...g.omit(r,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,f]})})}),be={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),url:{type:"string",title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"},controls:{type:"object",title:"Controls",default:{autoplay:!1,controls:!0,loop:!1,muted:!1},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}}}}),i18nProps:["url"]},j={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false","x-cloak":"","x-transition":""}},ke=e=>{const{blockProps:s,content:o,icon:r,iconWidth:l,iconHeight:i,styles:a,show:c}=e;return n.jsxRuntimeExports.jsxs("button",{...s,...a,...j.button,children:[o,n.jsxRuntimeExports.jsx("span",{className:c?"rotate-180":"",dangerouslySetInnerHTML:{__html:r},style:{width:l,height:i}})]})};t.registerChaiBlock(ke,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),content:{type:"string",title:"Title",default:"Menu Item"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconWidth:{type:"string",title:"Icon Width",default:"16px"},iconHeight:{type:"string",title:"Icon Height",default:"16px"},styles:t.StylesProp("flex items-center gap-2 px-4 py-1")}})});const we=e=>{const{blockProps:s,children:o,styles:r,show:l,inBuilder:i}=e;return i&&!l?null:n.jsxRuntimeExports.jsx("div",{...s,...j.menu,...r,children:o})};t.registerChaiBlock(we,{type:"DropdownContent",label:"Dropdown Content",group:"basic",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),styles:t.StylesProp("absolute left-0 p-2 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const Be=e=>{const{blockProps:s,children:o,styles:r}=e;return n.jsxRuntimeExports.jsx("div",{...s,...r,...j.wrapper,children:o})},Ce={type:"Dropdown",label:"Dropdown",group:"basic",icon:m.DropdownMenuIcon,blocks:()=>[{_type:"Dropdown",_id:"dropdown"},{_type:"DropdownButton",_id:"button",_parent:"dropdown",title:"Menu Item",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24"> <path d="M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"/> </svg>',styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownContent",_id:"content",_parent:"dropdown",styles:"#styles:,absolute left-0 w-80 mt-0.5 bg-white rounded-lg shadow-lg z-50"},{_type:"Link",_id:"link",_parent:"content",content:"Link",styles:"#styles:,flex items-center gap-2 px-4 py-1",link:{href:"https://www.google.com",type:"url",target:"_self"}}],category:"core",wrapper:!0,...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},je=e=>{const{blockProps:s,fieldName:o,label:r,styles:l,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e,d=x.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...l,...s,children:[n.jsxRuntimeExports.jsx("input",{...i,name:o,id:d,type:"checkbox",required:a,defaultChecked:c}),r&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r})]}):n.jsxRuntimeExports.jsx("input",{id:d,...s,...i,...l,type:"checkbox",required:a,name:o})},Se={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},Pe=e=>{const{children:s,blockProps:o,errorMessage:r,successMessage:l,action:i,styles:a,inBuilder:c}=e;let p=s;s||(p=n.jsxRuntimeExports.jsx(w,{inBuilder:c}));const d={"x-data":"{}","x-on:submit.prevent":"post"},y={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...d,"data-error":r,"data-success":l,method:"post",action:i,...o,...a,children:[n.jsxRuntimeExports.jsx("div",{...y}),p]})},ve={type:"Form",label:"Form",category:"core",icon:B.GroupIcon,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,"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form/submit"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},Ee=e=>{const{blockProps:s,inBuilder:o,label:r,styles:l,inputStyles:i,icon:a,iconSize:c,iconPos:p}=e,d=x.generateUUID(),y={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:d,...y,...i,...l,...s||{},type:o?"button":"submit",children:[r,a&&n.jsxRuntimeExports.jsx("div",{style:{width:c+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Ie={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},_e=e=>{const{blockProps:s,fieldName:o,label:r,placeholder:l,styles:i,inputStyles:a,showLabel:c,required:p,inputType:d}=e,y=x.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...i,...s,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:y,children:r}),n.jsxRuntimeExports.jsx("input",{name:o,...a,id:y,type:d,placeholder:l,required:p})]}):n.jsxRuntimeExports.jsx("input",{id:y,name:o,...s,...a,...i,type:d,placeholder:l,required:p})},Le={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},inputType:{type:"string",title:"Input Type",default:"text",enum:["text","email","password","number","tel","file","hidden","range","submit","color","date","time"]}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Re=e=>{const{blockProps:s,content:o,styles:r,children:l}=e,i={...r,...s};return l?h.createElement("label",i,l):h.createElement("label",{...i,dangerouslySetInnerHTML:{__html:o}})},Me={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},De=e=>{const{blockProps:s,fieldName:o,label:r,styles:l,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e,d=x.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...l,...s,children:[n.jsxRuntimeExports.jsx("input",{...i,name:o,id:d,type:"radio",required:a,defaultChecked:c}),r&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r})]}):n.jsxRuntimeExports.jsx("input",{id:d,...s,...i,...l,type:"radio",required:a,checked:c,name:o})},Ne={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},Te=e=>{const{blockProps:s,fieldName:o,label:r,placeholder:l,styles:i,inputStyles:a,required:c,showLabel:p,_multiple:d,options:y}=e,f=x.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...i,...s,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:r}),n.jsxRuntimeExports.jsxs("select",{...a,id:f,required:c,multiple:d,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),g.map(y,u=>n.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...i,...s,required:c,multiple:d,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:l}),g.map(y,u=>n.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},$e={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Ae=e=>{const{blockProps:s,fieldName:o,label:r,placeholder:l,styles:i,inputStyles:a,_rows:c,showLabel:p}=e,d=x.generateUUID();return p?n.jsxRuntimeExports.jsxs("div",{...i,...s,children:[p&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r}),n.jsxRuntimeExports.jsx("textarea",{name:o,...a,id:d,placeholder:l,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:o,...s,...a,...i,placeholder:l,rows:c})},ze={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},_rows:{type:"number",title:"Rows",default:3}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},He=e=>{const{blockProps:s,backgroundImage:o,children:r,styles:l,tag:i}=e;let a={};return o&&(a={backgroundImage:`url(${o})`}),k.createElement(i||"div",{...s,...l,style:a},r)},qe={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("font-body antialiased"),backgroundImage:{type:"string",title:"Image",default:"",ui:{"ui:widget":"image"}},tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]}}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ue=e=>{const{blockProps:s,styles:o}=e;return k.createElement("br",{...s,...o})},Oe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},C={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"}},Fe=e=>{const{blockProps:s,children:o,styles:r,colSpan:l,tabletColSpan:i,desktopColSpan:a}=e,p={className:[g.get(r,"className",""),g.get(C,["SMALL",isNaN(l)||!l?6:l],""),i?g.get(C,["MEDIUM",i||l],""):"",a?g.get(C,["LARGE",i||l],""):""].join(" ")};return n.jsxRuntimeExports.jsx("div",{...s,...r,...p,children:o||n.jsxRuntimeExports.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Ge={type:"Column",label:"Column",group:"basic",category:"core",icon:B.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...t.registerChaiBlockSchema({properties:{styles:t.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]}}})},Ve=e=>{const{blockProps:s,children:o,styles:r,gutter:l}=e,a={className:[g.get(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"?r.style.gap=`${l}px`:a.style={gap:`${l}px`},n.jsxRuntimeExports.jsx("div",{...s,...r,...a,children:o})},We={type:"Row",label:"Row",group:"basic",icon:B.Rows,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",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},Xe=()=>{t.registerChaiBlock(_,L),t.registerChaiBlock(T,$),t.registerChaiBlock(R,M),t.registerChaiBlock(A,z),t.registerChaiBlock(H,q),t.registerChaiBlock(F,G),t.registerChaiBlock(U,O),t.registerChaiBlock(ce,pe),t.registerChaiBlock(ie,ae),t.registerChaiBlock(ue,de),t.registerChaiBlock(ge,me),t.registerChaiBlock(se,re),t.registerChaiBlock(le,ne),t.registerChaiBlock(xe,be),t.registerChaiBlock(D,N),t.registerChaiBlock(W,X),t.registerChaiBlock(ye,he),t.registerChaiBlock(Pe,ve),t.registerChaiBlock(Ee,Ie),t.registerChaiBlock(_e,Le),t.registerChaiBlock(je,Se),t.registerChaiBlock(De,Ne),t.registerChaiBlock(Te,$e),t.registerChaiBlock(Ae,ze),t.registerChaiBlock(Re,Me),t.registerChaiBlock(Ue,Oe),t.registerChaiBlock(He,qe),t.registerChaiBlock(Q,ee),t.registerChaiBlock(Y,K),t.registerChaiBlock(te,oe),t.registerChaiBlock(Be,Ce),t.registerChaiBlock(Ve,We),t.registerChaiBlock(Fe,Ge)};exports.loadWebBlocks=Xe;
|
package/dist/web-blocks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { registerChaiBlockSchema as u, StylesProp as c, registerChaiBlock as p, closestBlockProp as _, stylesProp as C, runtimeProp as z } from "@chaibuilder/runtime";
|
|
2
|
-
import { j as s } from "./jsx-runtime-
|
|
2
|
+
import { j as s } from "./jsx-runtime-Drh4NO5G.js";
|
|
3
3
|
import * as h from "react";
|
|
4
4
|
import { createElement as v } from "react";
|
|
5
5
|
import { c as L, G as H, g as B } from "./iconBase-DHfFLkem.js";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "2.0.0-beta.
|
|
8
|
+
"version": "2.0.0-beta.56",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
+
"@chaibuilder/runtime": "2.0.0-beta.21",
|
|
69
70
|
"@types/react": "*",
|
|
70
71
|
"@types/react-dom": "*",
|
|
71
72
|
"react": "^18.0 || ^19.0",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
"dependencies": {
|
|
83
|
-
"@chaibuilder/runtime": "2.0.0-beta.
|
|
84
|
+
"@chaibuilder/runtime": "2.0.0-beta.21",
|
|
84
85
|
"@floating-ui/dom": "1.6.13",
|
|
85
86
|
"@floating-ui/react-dom": "2.1.2",
|
|
86
87
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.2",
|
|
@@ -151,15 +152,15 @@
|
|
|
151
152
|
"@testing-library/react": "^16.2.0",
|
|
152
153
|
"@types/lodash": "^4.17.14",
|
|
153
154
|
"@types/node": "^20.8.10",
|
|
154
|
-
"@types/react": "^
|
|
155
|
-
"@types/react-dom": "^
|
|
155
|
+
"@types/react": "^18.3.1",
|
|
156
|
+
"@types/react-dom": "^18.3.1",
|
|
156
157
|
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
157
158
|
"@typescript-eslint/parser": "^8.21.0",
|
|
158
159
|
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
159
160
|
"autoprefixer": "^10.4.20",
|
|
160
161
|
"axios": "^1.7.9",
|
|
161
|
-
"react": "^
|
|
162
|
-
"react-dom": "^
|
|
162
|
+
"react": "^18.3.1",
|
|
163
|
+
"react-dom": "^18.3.1",
|
|
163
164
|
"cheerio": "1.0.0-rc.12",
|
|
164
165
|
"dotenv": "^16.4.7",
|
|
165
166
|
"eslint": "^9.18.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";const je=require("react");var k={exports:{}},y={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ce;function pe(){if(ce)return y;ce=1;var i=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function R(C,s,c){var v=null;if(c!==void 0&&(v=""+c),s.key!==void 0&&(v=""+s.key),"key"in s){c={};for(var _ in s)_!=="key"&&(c[_]=s[_])}else c=s;return s=c.ref,{$$typeof:i,type:C,key:v,ref:s!==void 0?s:null,props:c}}return y.Fragment=p,y.jsx=R,y.jsxs=R,y}var j={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var fe;function Ce(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case Te:return"Portal";case F:return"Profiler";case B:return"StrictMode";case M:return"Suspense";case $:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Z:return(e.displayName||"Context")+".Provider";case L:return(e._context.displayName||"Context")+".Consumer";case Y:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return r=e.displayName||null,r!==null?r:i(e.type)||"Memo";case U:r=e._payload,e=e._init;try{return i(e(r))}catch{}}return null}function p(e){return""+e}function R(e){try{p(e);var r=!1}catch{r=!0}if(r){r=console;var o=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),p(e)}}function C(){}function s(){if(x===0){K=console.log,D=console.info,ee=console.warn,re=console.error,oe=console.group,te=console.groupCollapsed,ne=console.groupEnd;var e={configurable:!0,enumerable:!0,value:C,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}x++}function c(){if(x--,x===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:g({},e,{value:K}),info:g({},e,{value:D}),warn:g({},e,{value:ee}),error:g({},e,{value:re}),group:g({},e,{value:oe}),groupCollapsed:g({},e,{value:te}),groupEnd:g({},e,{value:ne})})}0>x&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function v(e){if(J===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);J=r&&r[1]||"",ae=-1<o.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+J+e+ae}function _(e,r){if(!e||z)return"";var o=V.get(e);if(o!==void 0)return o;z=!0,o=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var n=null;n=b.H,b.H=null,s();try{var u={DetermineComponentFrameRoot:function(){try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(E){var h=E}Reflect.construct(e,[],d)}else{try{d.call()}catch(E){h=E}e.call(d.prototype)}}else{try{throw Error()}catch(E){h=E}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(E){if(E&&h&&typeof E.stack=="string")return[E.stack,h.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var t=u.DetermineComponentFrameRoot(),f=t[0],T=t[1];if(f&&T){var l=f.split(`
|
|
20
|
-
`),m=T.split(`
|
|
21
|
-
`);for(t=a=0;a<l.length&&!l[a].includes("DetermineComponentFrameRoot");)a++;for(;t<m.length&&!m[t].includes("DetermineComponentFrameRoot");)t++;if(a===l.length||t===m.length)for(a=l.length-1,t=m.length-1;1<=a&&0<=t&&l[a]!==m[t];)t--;for(;1<=a&&0<=t;a--,t--)if(l[a]!==m[t]){if(a!==1||t!==1)do if(a--,t--,0>t||l[a]!==m[t]){var w=`
|
|
22
|
-
`+l[a].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,w),w}while(1<=a&&0<=t);break}}}finally{z=!1,b.H=n,c(),Error.prepareStackTrace=o}return l=(l=e?e.displayName||e.name:"")?v(l):"",typeof e=="function"&&V.set(e,l),l}function O(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return _(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return v(e);switch(e){case M:return v("Suspense");case $:return v("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case Y:return e=_(e.render,!1),e;case W:return O(e.type);case U:r=e._payload,e=e._init;try{return O(e(r))}catch{}}return""}function S(){var e=b.A;return e===null?null:e.getOwner()}function ve(e){if(Q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function de(e,r){function o(){ue||(ue=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function be(){var e=i(this.type);return le[e]||(le[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function ge(e,r,o,n,u,a){return o=a.ref,e={$$typeof:N,type:e,key:r,props:a,_owner:u},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:be}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function G(e,r,o,n,u,a){if(typeof e=="string"||typeof e=="function"||e===P||e===F||e===B||e===M||e===$||e===Re||typeof e=="object"&&e!==null&&(e.$$typeof===U||e.$$typeof===W||e.$$typeof===Z||e.$$typeof===L||e.$$typeof===Y||e.$$typeof===we||e.getModuleId!==void 0)){var t=r.children;if(t!==void 0)if(n)if(q(t)){for(n=0;n<t.length;n++)H(t[n],e);Object.freeze&&Object.freeze(t)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else H(t,e)}else t="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?n="null":q(e)?n="array":e!==void 0&&e.$$typeof===N?(n="<"+(i(e.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,t);if(Q.call(r,"key")){t=i(e);var f=Object.keys(r).filter(function(l){return l!=="key"});n=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",se[t+n]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
-
let props = %s;
|
|
24
|
-
<%s {...props} />
|
|
25
|
-
React keys must be passed directly to JSX without using spread:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,n,t,f,t),se[t+n]=!0)}if(t=null,o!==void 0&&(R(o),t=""+o),ve(r)&&(R(r.key),t=""+r.key),"key"in r){o={};for(var T in r)T!=="key"&&(o[T]=r[T])}else o=r;return t&&de(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),ge(e,t,a,u,S(),o)}function H(e,r){if(typeof e=="object"&&e&&e.$$typeof!==ye){if(q(e))for(var o=0;o<e.length;o++){var n=e[o];A(n)&&X(n,r)}else if(A(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?o=null:(o=I&&e[I]||e["@@iterator"],o=typeof o=="function"?o:null),typeof o=="function"&&o!==e.entries&&(o=o.call(e),o!==e))for(;!(e=o.next()).done;)A(e.value)&&X(e.value,r)}}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===N}function X(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=me(r),!ie[r])){ie[r]=!0;var o="";e&&e._owner!=null&&e._owner!==S()&&(o=null,typeof e._owner.tag=="number"?o=i(e._owner.type):typeof e._owner.name=="string"&&(o=e._owner.name),o=" It was passed a child from "+o+".");var n=b.getCurrentStack;b.getCurrentStack=function(){var u=O(e.type);return n&&(u+=n()||""),u},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,o),b.getCurrentStack=n}}function me(e){var r="",o=S();return o&&(o=i(o.type))&&(r=`
|
|
28
|
-
|
|
29
|
-
Check the render method of \``+o+"`."),r||(e=i(e))&&(r=`
|
|
30
|
-
|
|
31
|
-
Check the top-level render call using <`+e+">."),r}var _e=je,N=Symbol.for("react.transitional.element"),Te=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),I=Symbol.iterator,xe=Symbol.for("react.client.reference"),b=_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,g=Object.assign,we=Symbol.for("react.client.reference"),q=Array.isArray,x=0,K,D,ee,re,oe,te,ne;C.__reactDisabledLog=!0;var J,ae,z=!1,V=new(typeof WeakMap=="function"?WeakMap:Map),ye=Symbol.for("react.client.reference"),ue,le={},se={},ie={};j.Fragment=P,j.jsx=function(e,r,o,n,u){return G(e,r,o,!1,n,u)},j.jsxs=function(e,r,o,n,u){return G(e,r,o,!0,n,u)}}()),j}var Ee;function he(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?k.exports=pe():k.exports=Ce()),k.exports}var ke=he();exports.jsxRuntimeExports=ke;
|