@chaibuilder/sdk 1.2.29 → 1.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-YJPdSqcY.cjs → AddBlocks-UxJOFB9M.cjs} +1 -1
- package/dist/{AddBlocks-0sW6gkCO.js → AddBlocks-u1FkSHNj.js} +19 -19
- package/dist/{BrandingOptions--vgnQvD1.js → BrandingOptions-A3_c_sd7.js} +1 -1
- package/dist/{CanvasArea-aii0PyU-.js → CanvasArea-3D9rpjpk.js} +3 -3
- package/dist/{CanvasArea-41QoxuLf.cjs → CanvasArea-e829y1ts.cjs} +1 -1
- package/dist/{CurrentPage-2W1pdAOG.cjs → CurrentPage-5xKDQqvg.cjs} +1 -1
- package/dist/{CurrentPage-06Iacwyp.js → CurrentPage-VbdmddMv.js} +4 -4
- package/dist/{ListTree-DnA8gj-7.js → ListTree-c9Z0kWbN.js} +1 -1
- package/dist/{PagesPanel-_1CDTUdE.js → PagesPanel-_VzJ1__k.js} +5 -5
- package/dist/{PagesPanel-PBFzPSNY.cjs → PagesPanel-wex1zGzm.cjs} +1 -1
- package/dist/{ProjectPanel-755bbzEQ.cjs → ProjectPanel-N6iWd_4Z.cjs} +1 -1
- package/dist/{ProjectPanel-pUMeIiUW.js → ProjectPanel-rPNO2QsE.js} +5 -5
- package/dist/{Settings-dnO-s6x0.js → Settings-jTl7IOPc.js} +560 -532
- package/dist/Settings-mlh0i_1M.cjs +1 -0
- package/dist/{SidePanels-VxSXXkt_.js → SidePanels-jYJEFpxC.js} +3 -3
- package/dist/{SidePanels-Gq2LdVuY.cjs → SidePanels-mx5TyZBn.cjs} +1 -1
- package/dist/{Topbar-5zbOSGF6.js → Topbar-VCFW9uNI.js} +1 -1
- package/dist/{UnsplashImages-4WAWgA4s.js → UnsplashImages-N9h0avWO.js} +1 -1
- package/dist/{UploadImages-PONIHtn6.js → UploadImages-e70AeNGX.js} +1 -1
- package/dist/{add-page-modal-4VrFvgEm.js → add-page-modal-o1euqbsp.js} +5 -5
- package/dist/{add-page-modal-jWcp0w-S.cjs → add-page-modal-v5smARyL.cjs} +1 -1
- package/dist/{confirm-alert-j7b88hsW.js → confirm-alert-EDOFRmH8.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-p6b0upz4.cjs → delete-page-modal-DNjqQuop.cjs} +1 -1
- package/dist/{delete-page-modal--xHHdRAq.js → delete-page-modal-QzRkBAct.js} +4 -4
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-_GJb9YcB.js → form-yw3Uuk6v.js} +1 -1
- package/dist/html-to-json-Xhu27KFD.cjs +1 -0
- package/dist/{html-to-json-LJyJsnmZ.js → html-to-json-ZV4QjSww.js} +53 -52
- package/dist/{index-KArv7pNz.cjs → index-5c_rU-9B.cjs} +1 -1
- package/dist/{index-mlMvwv2b.cjs → index-DHwvjZ5z.cjs} +1 -1
- package/dist/{index-Eb5zyh2F.js → index-DtBYhldP.js} +4 -4
- package/dist/{index-UHaqEdws.js → index-HiiWSXkE.js} +9 -9
- package/dist/{index-0QJwevON.js → index-SEJRE2ab.js} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-00Xx4u8e.js → page-viewer-1vswRGpL.js} +5 -5
- package/dist/{page-viewer-SZNm7b1n.cjs → page-viewer-87wtE0pN.cjs} +1 -1
- package/dist/{project-general-setting-C_pHNuZE.cjs → project-general-setting-RSG7ZQSx.cjs} +1 -1
- package/dist/{project-general-setting-asDxlmhZ.js → project-general-setting-SE9QJ6mF.js} +5 -5
- package/dist/{project-seo-setting-DuAaDfDR.js → project-seo-setting-x3peNgla.js} +2 -2
- package/dist/{single-page-detail-oqj6zsLU.cjs → single-page-detail-8Arndzmw.cjs} +1 -1
- package/dist/{single-page-detail-UNxXvhl4.js → single-page-detail-bels-Cjo.js} +12 -12
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/ui.js +7 -7
- package/dist/{useCanvasSettings-R6br4J9i.js → useCanvasSettings-unTQUdlP.js} +1 -1
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +232 -216
- package/package.json +1 -1
- package/dist/Settings-G9Xtqr7n.cjs +0 -1
- package/dist/html-to-json-vP1ESB_e.cjs +0 -1
package/dist/lib.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Class-Zc8hpE7f.cjs"),w=require("./Functions-N3yhPYKY.cjs"),b=require("./html-to-json-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Class-Zc8hpE7f.cjs"),w=require("./Functions-N3yhPYKY.cjs"),b=require("./html-to-json-Xhu27KFD.cjs"),t=require("lodash-es"),p=require("./defaultTheme-7VqqhOcp.cjs"),k=require("@bobthered/tailwindcss-palette-generator"),_=require("@mhsdesign/jit-browser-tailwindcss"),C=require("@tailwindcss/forms"),F=require("@tailwindcss/typography"),$=require("@tailwindcss/aspect-ratio"),O=require("./STRINGS-gPz7CUOk.cjs");require("clsx");require("tailwind-merge");require("./MODIFIERS-YPHRtwrM.cjs");require("himalaya");require("./_commonjsHelpers-wDK0ZLPo.cjs");const h={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},P={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"};const I=16,B=4;function q(s){return s.indexOf("rem")!==-1&&(s=`${parseFloat(s.replace("rem",""))*I}px`),s}const E=s=>{const c=s.match(/\[.*\]/);if(c===null)return s;const n=y.constructClassObject(s);if(n===null)return s;const{property:r}=n;let e=t.first(c).replace(/\]/i,"").replace(/\[/i,"");const i=s.replace(/\[.*\]/i,"");e=q(e);let a=s;switch(r){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const o=t.map(t.keys(P),l=>`${l}px`);if(t.includes(o,e)){const l=t.parseInt(e.replace("px",""),10);l===1?a=`${i}px`:a=i+l/B}}if(e.indexOf("%")!==-1){const o=t.map(t.keys(h),l=>`${l}%`);if(t.includes(o,e)){const l=parseFloat(e.replace("%",""));a=i+t.get(h,l)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${i}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${i}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${i}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};t.includes(t.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${i}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const u={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};t.includes(t.keys(u),e)&&(a=i+u[e]);break;case"lineHeight":const d={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};t.includes(t.keys(d),e)&&(a=i+d[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${i}${e}`:s;break;case"opacity":const T=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],g=parseFloat(e)*100;t.includes(T,g.toString())&&(a=`opacity-${g}`);break;default:break}return a};async function S(s,c,n=[],r="c-",e=!1){const i=t.get(s,"primaryColor","#000"),a=t.get(s,"secondaryColor","#ccc"),x=t.get(s,"headingFont","Inter"),u=t.get(s,"bodyFont","Inter"),d=t.get(s,"roundedCorners","0"),m=k.tailwindcssPaletteGenerator({colors:[i,a],names:["primary","secondary"]});return t.set(m,"primary.DEFAULT",i),t.set(m,"secondary.DEFAULT",a),`${await _.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{fontFamily:{heading:[x,...p.defaultTheme.fontFamily.sans],body:[u,...p.defaultTheme.fontFamily.sans]},extend:{borderRadius:{global:`${d||"0"}px`},colors:m}},plugins:[C,F,$],corePlugins:{preflight:e},...r?{prefix:`${r}`}:{}}}).generateStylesFromContent(` ${e?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,c)}
|
|
4
4
|
.${r}bg-clip-text{background-clip: text;-webkit-background-clip: text;} h1,h2,h3,h4,h5,h6{font-family: "${x}",${p.defaultTheme.fontFamily.sans.join(", ")};}`}const V=(s,c)=>s.map(n=>{const r={};return Object.keys(n).forEach(e=>{t.startsWith(n[e],O.STYLES_KEY)&&(r[e]=p.addPrefixToClasses(n[e],c))}),r}),f=(s,c,n="c-",r=!1)=>{const e=p.getBrandingClasses(c,n);return S(c,[t.replace(JSON.stringify(V(s,n)),/#styles:/g,"")],e.split(" ").concat(`${n}inline-block`,`${n}w-full`,`${n}h-full`),n,r)},A=async(s,c="c-",n=!1)=>{const r=s.page.blocks;return await f(r,s.project.brandingOptions,c,n)},L=async(s,c,n="c-",r=!1)=>await f(s,c,n,r);exports.cn=y.cn;exports.generateUUID=w.generateUUID;exports.getBreakpointValue=w.getBreakpointValue;exports.getBlocksFromHTML=b.getBlocksFromHTML;exports.addPrefixToClasses=p.addPrefixToClasses;exports.getBrandingClasses=p.getBrandingClasses;exports.convertArbitraryToTailwindClass=E;exports.getBlocksTailwindCSS=f;exports.getStylesForBlocks=L;exports.getStylesForPageData=A;exports.getTailwindCSS=S;
|
package/dist/lib.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as _ } from "./Class-6Hz2KzYb.js";
|
|
2
2
|
import { a as ie } from "./Class-6Hz2KzYb.js";
|
|
3
3
|
import { g as le, a as pe } from "./Functions-7jnEwJyw.js";
|
|
4
|
-
import { g as me } from "./html-to-json-
|
|
4
|
+
import { g as me } from "./html-to-json-ZV4QjSww.js";
|
|
5
5
|
import { first as F, includes as l, keys as d, map as T, parseInt as $, get as p, set as b, startsWith as k, replace as O } from "lodash-es";
|
|
6
6
|
import { d as h, a as C, g as I } from "./defaultTheme-D8B4-wHO.js";
|
|
7
7
|
import { tailwindcssPaletteGenerator as E } from "@bobthered/tailwindcss-palette-generator";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import s, { useState as p, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import { aW as g, aX as h, aY as f } from "./index-
|
|
5
|
-
import { d as j, a as N, c as b } from "./index-
|
|
4
|
+
import { aW as g, aX as h, aY as f } from "./index-HiiWSXkE.js";
|
|
5
|
+
import { d as j, a as N, c as b } from "./index-DtBYhldP.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -38,17 +38,17 @@ import "@radix-ui/react-context-menu";
|
|
|
38
38
|
import "react-icons-picker";
|
|
39
39
|
import "react-dom";
|
|
40
40
|
import "react-quill";
|
|
41
|
-
import "./index-
|
|
41
|
+
import "./index-SEJRE2ab.js";
|
|
42
42
|
import "i18next";
|
|
43
43
|
import "@floating-ui/react-dom";
|
|
44
44
|
import "flagged";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
46
|
import "sonner";
|
|
47
|
-
import "./html-to-json-
|
|
47
|
+
import "./html-to-json-ZV4QjSww.js";
|
|
48
48
|
import "himalaya";
|
|
49
49
|
import "lucide-react";
|
|
50
50
|
import "./index-YpnaudSM.js";
|
|
51
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
51
|
+
const v = s.lazy(() => import("./single-page-detail-bels-Cjo.js")), P = ({ pageData: r }) => {
|
|
52
52
|
const [t, i] = p("CLOSE");
|
|
53
53
|
return /* @__PURE__ */ e.jsxs(
|
|
54
54
|
g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-12HbDLon.cjs"),x=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-12HbDLon.cjs"),x=require("./index-5c_rU-9B.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./index-DHwvjZ5z.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-8Arndzmw.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-12HbDLon.cjs"),o=require("./controls-KK2oLIa8.cjs"),d=require("./form-jQj7E-hS.cjs"),m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-12HbDLon.cjs"),o=require("./controls-KK2oLIa8.cjs"),d=require("./form-jQj7E-hS.cjs"),m=require("./index-5c_rU-9B.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-DHwvjZ5z.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { bi as n } from "./index-HiiWSXkE.js";
|
|
4
4
|
import { u as c, o as u } from "./controls-OfJWSEqC.js";
|
|
5
|
-
import { F as d } from "./form-
|
|
6
|
-
import { a as x } from "./index-
|
|
5
|
+
import { F as d } from "./form-yw3Uuk6v.js";
|
|
6
|
+
import { a as x } from "./index-DtBYhldP.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -42,13 +42,13 @@ import "react-dom";
|
|
|
42
42
|
import "react-quill";
|
|
43
43
|
import "@rjsf/core";
|
|
44
44
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index-
|
|
45
|
+
import "./index-SEJRE2ab.js";
|
|
46
46
|
import "i18next";
|
|
47
47
|
import "@floating-ui/react-dom";
|
|
48
48
|
import "flagged";
|
|
49
49
|
import "react-hotkeys-hook";
|
|
50
50
|
import "sonner";
|
|
51
|
-
import "./html-to-json-
|
|
51
|
+
import "./html-to-json-ZV4QjSww.js";
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "lucide-react";
|
|
54
54
|
import "./index-YpnaudSM.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { b as D, u as c, g, o as x } from "./controls-OfJWSEqC.js";
|
|
3
|
-
import { F as v } from "./form-
|
|
3
|
+
import { F as v } from "./form-yw3Uuk6v.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "@rjsf/core";
|
|
8
8
|
import "@rjsf/validator-ajv8";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-HiiWSXkE.js";
|
|
10
10
|
import "./Functions-7jnEwJyw.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-12HbDLon.cjs"),d=require("./controls-KK2oLIa8.cjs"),w=require("sonner"),p=require("./form-jQj7E-hS.cjs"),P=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-12HbDLon.cjs"),d=require("./controls-KK2oLIa8.cjs"),w=require("sonner"),p=require("./form-jQj7E-hS.cjs"),P=require("./index-5c_rU-9B.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-DHwvjZ5z.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-DNjqQuop.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-4OQlXZTJ.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return n.split("/").forEach(u=>{e&&(u.includes("[[")&&u.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(u):u.includes("[")&&u.includes("]")?e=s.test(u):e=q.test(u))}),e},h=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,G=(n,o)=>{const s=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(n).seoData);return s||q},Y=({open:n,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),u=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){n==="ALERT"&&o("PENDING");return}u.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{b(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||u.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:R,disabled:u.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:u.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:u.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||u.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|
|
@@ -2,11 +2,11 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import I, { useState as j, useEffect as z } from "react";
|
|
3
3
|
import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as B } from "lodash-es";
|
|
4
4
|
import { HomeIcon as G } from "@radix-ui/react-icons";
|
|
5
|
-
import {
|
|
5
|
+
import { bi as Y, B as q } from "./index-HiiWSXkE.js";
|
|
6
6
|
import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-OfJWSEqC.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
|
-
import { F as
|
|
9
|
-
import { f as V, a as X, g as _, b as K } from "./index-
|
|
8
|
+
import { F as P } from "./form-yw3Uuk6v.js";
|
|
9
|
+
import { f as V, a as X, g as _, b as K } from "./index-DtBYhldP.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "./Functions-7jnEwJyw.js";
|
|
12
12
|
import "clsx";
|
|
@@ -43,16 +43,16 @@ import "react-dom";
|
|
|
43
43
|
import "react-quill";
|
|
44
44
|
import "@rjsf/core";
|
|
45
45
|
import "@rjsf/validator-ajv8";
|
|
46
|
-
import "./index-
|
|
46
|
+
import "./index-SEJRE2ab.js";
|
|
47
47
|
import "i18next";
|
|
48
48
|
import "@floating-ui/react-dom";
|
|
49
49
|
import "flagged";
|
|
50
50
|
import "react-hotkeys-hook";
|
|
51
|
-
import "./html-to-json-
|
|
51
|
+
import "./html-to-json-ZV4QjSww.js";
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "lucide-react";
|
|
54
54
|
import "./index-YpnaudSM.js";
|
|
55
|
-
const O = I.lazy(() => import("./delete-page-modal
|
|
55
|
+
const O = I.lazy(() => import("./delete-page-modal-QzRkBAct.js")), J = I.lazy(() => import("./confirm-alert-EDOFRmH8.js")), h = (r) => {
|
|
56
56
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
57
57
|
return !1;
|
|
58
58
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -76,7 +76,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
76
76
|
}, [e, s, i, d, m]);
|
|
77
77
|
const S = () => {
|
|
78
78
|
if (N) {
|
|
79
|
-
if (s.type === "DYNAMIC" && !
|
|
79
|
+
if (s.type === "DYNAMIC" && !h((i == null ? void 0 : i.slug) || "")) {
|
|
80
80
|
r === "ALERT" && m("PENDING");
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -160,7 +160,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
160
160
|
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 px-2.5 py-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Page Details" }) }),
|
|
161
161
|
/* @__PURE__ */ t.jsx("div", { className: "px-2.5 pt-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
162
162
|
/* @__PURE__ */ t.jsx(
|
|
163
|
-
|
|
163
|
+
P,
|
|
164
164
|
{
|
|
165
165
|
title: "Basic Details",
|
|
166
166
|
formData: i,
|
|
@@ -171,7 +171,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
171
171
|
),
|
|
172
172
|
/* @__PURE__ */ t.jsx("div", { className: "h-2 w-full" }),
|
|
173
173
|
/* @__PURE__ */ t.jsx(
|
|
174
|
-
|
|
174
|
+
P,
|
|
175
175
|
{
|
|
176
176
|
title: "SEO Details",
|
|
177
177
|
formData: i,
|
|
@@ -181,7 +181,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
183
|
(e == null ? void 0 : e.homepage) !== s.uuid && s.type === "STATIC" ? /* @__PURE__ */ t.jsx(
|
|
184
|
-
|
|
184
|
+
P,
|
|
185
185
|
{
|
|
186
186
|
formData: d,
|
|
187
187
|
properties: R,
|
|
@@ -193,7 +193,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
193
193
|
" This is homepage",
|
|
194
194
|
" "
|
|
195
195
|
] }),
|
|
196
|
-
i.type === "DYNAMIC" && !
|
|
196
|
+
i.type === "DYNAMIC" && !h((i == null ? void 0 : i.slug) || "") && /* @__PURE__ */ t.jsxs("small", { className: "px-1 text-red-400", children: [
|
|
197
197
|
"Add dynamic ID in page slug Eg: ",
|
|
198
198
|
/* @__PURE__ */ t.jsx("i", { className: "underline", children: "some-url/[some-id]" })
|
|
199
199
|
] }),
|
|
@@ -204,7 +204,7 @@ const O = I.lazy(() => import("./delete-page-modal--xHHdRAq.js")), J = I.lazy(()
|
|
|
204
204
|
className: "w-full",
|
|
205
205
|
type: "submit",
|
|
206
206
|
onClick: S,
|
|
207
|
-
disabled: (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage ? !1 : x(i.name) || x(i.slug) || !N || n.isPending || c.isPending || i.type === "DYNAMIC" && !
|
|
207
|
+
disabled: (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage ? !1 : x(i.name) || x(i.slug) || !N || n.isPending || c.isPending || i.type === "DYNAMIC" && !h((i == null ? void 0 : i.slug) || ""),
|
|
208
208
|
children: "Save"
|
|
209
209
|
}
|
|
210
210
|
),
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-5c_rU-9B.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-DHwvjZ5z.cjs");require("i18next");require("react-i18next");require("./index-12HbDLon.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as Z } from "./index-
|
|
2
|
+
import { C as Z } from "./index-DtBYhldP.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-SEJRE2ab.js";
|
|
7
7
|
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-HiiWSXkE.js";
|
|
10
10
|
import "lodash-es";
|
|
11
11
|
import "./Functions-7jnEwJyw.js";
|
|
12
12
|
import "clsx";
|
|
@@ -44,7 +44,7 @@ import "react-quill";
|
|
|
44
44
|
import "@floating-ui/react-dom";
|
|
45
45
|
import "flagged";
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
|
-
import "./html-to-json-
|
|
47
|
+
import "./html-to-json-ZV4QjSww.js";
|
|
48
48
|
import "himalaya";
|
|
49
49
|
import "lucide-react";
|
|
50
50
|
import "./index-YpnaudSM.js";
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bb as y, be as z, bc as J, bd as K, bu as W, bH as X, A as Y, ai as Z, g as _, b as $, e as N, f as O, c as Q, d as U, a as aa, bv as ea, as as oa, B as ta, bo as ra, br as sa, bq as na, bt as ia, bp as ba, bJ as pa, aZ as ua, cg as
|
|
1
|
+
import { bb as y, be as z, bc as J, bd as K, bu as W, bH as X, A as Y, ai as Z, g as _, b as $, e as N, f as O, c as Q, d as U, a as aa, bv as ea, as as oa, B as ta, bo as ra, br as sa, bq as na, bt as ia, bp as ba, bJ as pa, aZ as ua, cg as la, b0 as ma, b1 as ca, a_ as da, b2 as ga, a$ as Ca, ci as Ma, ch as Sa, bz as Da, cj as Ta, by as xa, co as Aa, bx as ha, cl as Ia, cp as wa, ct as Pa, ck as ka, cm as Fa, cn as Ga, cq as La, cr as va, cs as Ha, bA as Ra, ad as fa, ae as Ba, ah as Va, b3 as Ea, af as ja, ag as qa, ao as ya, aG as za, aL as Ja, aI as Ka, bj as Wa, bk as Xa, aJ as Ya, c9 as Za, cd as _a, c8 as $a, aK as Na, bl as Oa, ca as Qa, cb as Ua, cc as ae, aH as ee, aD as oe, aF as te, aE as re, b7 as se, b8 as ne, bg as ie, aB as be, b9 as pe, bL as ue, bS as le, bO as me, bY as ce, bP as de, bR as ge, bM as Ce, bV as Me, bT as Se, bU as De, bQ as Te, b_ as xe, bZ as Ae, bW as he, bX as Ie, bN as we, aW as Pe, aY as ke, aX as Fe, b6 as Ge, bi as Le, bK as ve, aj as He, am as Re, ay as fe, an as Be, az as Ve, b$ as Ee, ak as je, al as qe, aA as ye, c0 as ze, c2 as Je, c3 as Ke, c7 as We, c5 as Xe, c4 as Ye, c6 as Ze, c1 as _e, S as $e, aC as Ne, au as Oe, ax as Qe, av as Ue, aw as ao, bs as eo, I as oo, bE as to, ap as ro, ar as so, bh as no, T as io, aq as bo, bI as po, bG as uo, ce as lo, cf as mo, bF as co, bf as go } from "./index-HiiWSXkE.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "lodash-es";
|
|
4
4
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -63,8 +63,8 @@ export {
|
|
|
63
63
|
ba as CardHeader,
|
|
64
64
|
pa as CardTitle,
|
|
65
65
|
ua as Command,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
la as CommandDialog,
|
|
67
|
+
ma as CommandEmpty,
|
|
68
68
|
ca as CommandGroup,
|
|
69
69
|
da as CommandInput,
|
|
70
70
|
ga as CommandItem,
|
|
@@ -117,8 +117,8 @@ export {
|
|
|
117
117
|
be as Label,
|
|
118
118
|
pe as LinkField,
|
|
119
119
|
ue as Menubar,
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
le as MenubarCheckboxItem,
|
|
121
|
+
me as MenubarContent,
|
|
122
122
|
ce as MenubarGroup,
|
|
123
123
|
de as MenubarItem,
|
|
124
124
|
ge as MenubarLabel,
|
|
@@ -171,8 +171,8 @@ export {
|
|
|
171
171
|
bo as TooltipTrigger,
|
|
172
172
|
po as badgeVariants,
|
|
173
173
|
uo as buttonVariants,
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
lo as reducer,
|
|
175
|
+
mo as toast,
|
|
176
176
|
co as toggleVariants,
|
|
177
177
|
go as useToast
|
|
178
178
|
};
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-KK2oLIa8.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-vP1ESB_e.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const p=R(w),T=p.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let u={};return s&&(u={backgroundImage:`url(${s})`}),p.createElement(n,{...t,...i,style:u},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.s({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0});const C=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:n=null}=e;return n?p.createElement(r,{...l,...t},n):p.createElement(r,{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(C,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.s({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const L=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?p.createElement("p",{...l,...t,dangerouslySetInnerHTML:{__html:s}}):p.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(L,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const _=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:n}=e;return r?p.createElement("span",{...l,...t},r):p.createElement(n||"span",{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(_,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const P=e=>{const{blockProps:t,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(P,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const A=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:n,styles:i,children:c}=e,u=s,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:r}),u&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:u}})]});return p.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(A,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.u({title:"Label",default:"Button",multiLingual:!0}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.T({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const M=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:n,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:n}):n?s?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):p.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?a.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):p.createElement("a",{...t,...r,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(M,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.u({title:"Content",default:""}),link:o.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):p.createElement(n||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(N,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const H=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:n}=e;return r?p.createElement(n||"li",{...s,...t},r):p.createElement(n||"li",{...s,...t,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(H,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),D=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:n,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return p.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:u}})};d.registerChaiBlock(D,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const U=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:n,width:i}=e;return y.isEmpty(l)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):p.createElement("img",{...t,...s,src:l,alt:r,height:n,width:i})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.u({title:"Alt",default:""}),width:o.u({title:"Width",default:""}),height:o.u({title:"Height",default:""})}});const q=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let n=null;return!r&&l&&(n=a.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),p.createElement("div",{...s,...t,droppable:"yes"},r||n)};d.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,F=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},O=p.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:n}=e,i=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),u=i||y.get(n,"muted",!0),m=y.get(n,"loop",!1);if(y.isEmpty(r))return a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=F(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${n?1:0}`),v.push(`mute=${u?1:0}&muted=${u?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=p.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=p.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(O,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const z=p.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,p.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock(z,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const $=e=>{const{blockProps:t,styles:l}=e;return p.createElement("hr",{...l,...t})};d.registerChaiBlock($,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const V=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"inline-block",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(V,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const G=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return a.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(G,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-KK2oLIa8.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-Xhu27KFD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(n,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.s({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:n=null}=e;return n?u.createElement(r,{...l,...t},n):u.createElement(r,{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.s({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:n}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(n||"span",{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:n,styles:i,children:c}=e,p=s,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:r}),p&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.u({title:"Label",default:"Button",multiLingual:!0}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.T({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:n,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:n}):n?s?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?a.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.u({title:"Content",default:""}),link:o.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(n||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:n}=e;return r?u.createElement(n||"li",{...s,...t},r):u.createElement(n||"li",{...s,...t,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:n,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:n,width:i}=e;return y.isEmpty(l)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,height:n,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.u({title:"Alt",default:""}),width:o.u({title:"Width",default:""}),height:o.u({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let n=null;return!r&&l&&(n=a.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||n)};d.registerChaiBlock(F,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:n}=e,i=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),p=i||y.get(n,"muted",!0),m=y.get(n,"loop",!1);if(y.isEmpty(r))return a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${n?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return a.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
|
|
2
2
|
<div class="hs-accordion active" id="hs-unstyled-heading-one">
|
|
3
3
|
<button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
|
|
4
4
|
Accordion #1
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element.
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
|
-
</div>`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))},canAcceptBlock:e=>e==="Accordion"});const
|
|
19
|
+
</div>`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))},canAcceptBlock:e=>e==="Accordion"});const Y=({children:e,blockProps:t,styles:l,blockState:s})=>{const r=k(l,"hs-accordion "+(s&&s!=null&&s.active?"active":""));return a.jsxRuntimeExports.jsx("div",{...t,...r,children:e})};d.registerChaiBlock(Y,{type:"Accordion",label:"Accordion",category:"core",group:"advanced",props:{styles:o.S({default:""})},customStylingStates:{"hs-accordion-active":"Accordion Active"},blockState:{active:o.r({default:!1,title:"Show content in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`
|
|
20
20
|
<div class="hs-accordion active" id="hs-unstyled-heading-one">
|
|
21
21
|
<button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
|
|
22
22
|
Accordion #1
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element.
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
|
-
`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))}});const
|
|
28
|
+
`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))}});const X=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-toggle");return a.jsxRuntimeExports.jsx("button",{...s,...t,children:e})};d.registerChaiBlock(X,{type:"AccordionToggle",label:"Accordion Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"hs-accordion-active:text-blue-600 dark:hs-accordion-active:text-blue-500 inline-flex w-full items-center gap-x-3 rounded-lg px-6 py-3 text-start text-sm font-semibold text-gray-800 hover:text-gray-500 disabled:pointer-events-none disabled:opacity-50 dark:text-neutral-200 dark:hover:text-neutral-400"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Z=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=k(l,"hs-accordion-content",r&&s?s!=null&&s.active?"!block !opacity-100":"!hidden !opacity-0":"");return a.jsxRuntimeExports.jsx("div",{...n,...t,children:e})};d.registerChaiBlock(Z,{type:"AccordionContent",label:"Accordion Content",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"w-full overflow-hidden transition-height hidden duration-300"})},getBlockStateFrom:e=>[e._parent],canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const J=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r&&(s!=null&&s.active)?" open":"",i=k(l,"hs-collapse-toggle",n);return a.jsxRuntimeExports.jsx("button",{type:"button",...i,...t,children:e})};d.registerChaiBlock(J,{type:"CollapseToggle",label:"Collapse Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:""})},canAcceptBlock:()=>!0,customStylingStates:{"hs-collapse-open":"Collapse Open"},getBlockStateFrom:(e,t)=>{const l=y.get(e,"styles_attrs.data-hs-collapse","").replace("#","");if(!l)return[];const s=y.find(t,r=>y.get(r,"styles_attrs.id")===l);return s?[s==null?void 0:s._id]:[]}});const K=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r?{"!block !opacity-100 open":s==null?void 0:s.active,"":!(s!=null&&s.active)}:{},i=Object.keys(n).filter(p=>n[p]).join(" "),c=k(l,"hs-collapse",i);return a.jsxRuntimeExports.jsx("div",{...c,...t,children:e})};d.registerChaiBlock(K,{type:"Collapse",label:"Collapse",category:"core",group:"advanced",props:{styles:o.S({default:"transition-opacity transition-margin duration hs-collapse-open:opacity-100 opacity-0 w-56 hidden z-10 mt-2 min-w-60 bg-white"})},canAcceptBlock:()=>!0,blockState:{active:o.r({default:!1,title:"Show collapse in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>E.getBlocksFromHTML(`<button type="button" class="hs-collapse-toggle" id="hs-unstyled-collapse" data-hs-collapse="#hs-unstyled-collapse-content">
|
|
29
29
|
Collapse
|
|
30
30
|
</button>
|
|
31
31
|
<div id="hs-unstyled-collapse-content" class="hs-collapse hidden w-full overflow-hidden transition-[height] duration-300" aria-labelledby="hs-unstyled-collapse">
|
|
32
32
|
This is a collapse body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions.
|
|
33
|
-
</div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const K=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),p.createElement("div",{...t,...r,style:n},s)};d.registerChaiBlock(K,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Q=e=>{const{blockProps:t,styles:l}=e;return p.createElement("br",{...t,...l})};d.registerChaiBlock(Q,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(n,i)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=n=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...l(i)]},r=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...l(i),...l(i)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(n),...r(n)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},ee=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("table",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(ee,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("thead",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(te,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("tbody",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("tr",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(oe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const se=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?p.createElement("td",{...t,...r},l):p.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(se,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item"})}});const re=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:u}=e;let m=u;u||(m=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...x,"data-error":l,"data-success":n,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...g}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(re,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ne=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,n={...s,...t};return r?p.createElement("label",n,r):p.createElement("label",{...n,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ne,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.u({title:"Content",default:"Label"})}});const ae=e=>{const{blockProps:t,inBuilder:l,label:s,placeholder:r,styles:n,inputStyles:i,icon:c,iconPos:u}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...n,...t||{},type:l?"button":"submit",placeholder:r,children:[s,c&&a.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(ae,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.u({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.T({title:"Icon",default:""}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ie=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:u=!0}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ie,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const ce=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:u="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||u==="submit"?(u==="submit"&&(t.value=l),a.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...n,...r,type:u,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),a.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...n,id:g,type:u,placeholder:s,required:c})]})};d.registerChaiBlock(ce,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"input"}),inputType:o.s({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.u({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:u=!0}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(de,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.u({title:"Field Name",default:"radio"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:u,_multiple:m=!1}=e,x=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:x,...n,...t,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(ue,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.u({title:"Label",default:""}),value:o.u({title:"Value",default:""})}})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:u}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...n,placeholder:r,rows:c})};d.registerChaiBlock(pe,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const me=y.noop;exports.loadWebBlocks=me;
|
|
33
|
+
</div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const Q=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),u.createElement("div",{...t,...r,style:n},s)};d.registerChaiBlock(Q,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const ee=e=>{const{blockProps:t,styles:l}=e;return u.createElement("br",{...t,...l})};d.registerChaiBlock(ee,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(n,i)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=n=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...l(i)]},r=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...l(i),...l(i)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(n),...r(n)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("table",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(te,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("thead",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tbody",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(oe,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const se=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tr",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(se,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const re=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?u.createElement("td",{...t,...r},l):u.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(re,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item"})}});const ne=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:p}=e;let m=p;p||(m=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...x,"data-error":l,"data-success":n,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...g}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(ne,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ae=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,n={...s,...t};return r?u.createElement("label",n,r):u.createElement("label",{...n,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ae,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.u({title:"Content",default:"Label"})}});const ie=e=>{const{blockProps:t,inBuilder:l,label:s,placeholder:r,styles:n,inputStyles:i,icon:c,iconPos:p}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...n,...t||{},type:l?"button":"submit",placeholder:r,children:[s,c&&a.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(ie,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.u({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.T({title:"Icon",default:""}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ce=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ce,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||p==="submit"?(p==="submit"&&(t.value=l),a.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...n,...r,type:p,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),a.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...n,id:g,type:p,placeholder:s,required:c})]})};d.registerChaiBlock(de,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"input"}),inputType:o.s({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.u({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(ue,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.u({title:"Field Name",default:"radio"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,x=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:x,...n,...t,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(pe,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.u({title:"Label",default:""}),value:o.u({title:"Value",default:""})}})}});const me=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:p}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...n,placeholder:r,rows:c})};d.registerChaiBlock(me,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const he=y.noop;exports.loadWebBlocks=he;
|