@chaibuilder/sdk 1.0.9 → 1.0.10
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/LICENSE +28 -0
- package/README.md +123 -21
- package/dist/AddBlocks-tdvDe7xL.cjs +3 -0
- package/dist/{AddBlocks-d10b7b87.js → AddBlocks-xR2s2BVa.js} +47 -44
- package/dist/BrandingOptions-DpJ-oNnf.cjs +1 -0
- package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-cHK2bVZy.js} +14 -18
- package/dist/{CanvasArea-10356200.js → CanvasArea-2zqT1lSE.js} +492 -503
- package/dist/CanvasArea-Br8bBSeT.cjs +46 -0
- package/dist/ChaiBuilderEditor-SacH75l4.cjs +163 -0
- package/dist/{index-aa42febc.js → ChaiBuilderEditor-h9bXC4l-.js} +11215 -15404
- package/dist/Class-_uCzl5v1.cjs +1 -0
- package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
- package/dist/{CurrentPage-35e14043.js → CurrentPage-4lTETR2f.js} +26 -23
- package/dist/CurrentPage-nlUWJiUA.cjs +1 -0
- package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
- package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
- package/dist/Layers-Vw4XE6YB.cjs +1 -0
- package/dist/{Layers-c3dd4fc8.js → Layers-wOfijZnb.js} +42 -41
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-xRyn29gC.js} +17 -20
- package/dist/{PagesPanel-bafc506f.js → PagesPanel-82gCVzHS.js} +16 -13
- package/dist/PagesPanel-ZKRdK-mI.cjs +1 -0
- package/dist/ProjectPanel-kYg4KkJu.cjs +1 -0
- package/dist/{ProjectPanel-6113f394.js → ProjectPanel-vz5WOyqZ.js} +22 -19
- package/dist/Settings-1E3Y_5r6.cjs +1 -0
- package/dist/{Settings-1c41c514.js → Settings-IuAF359L.js} +297 -296
- package/dist/SidePanels-WL1UioF2.cjs +1 -0
- package/dist/{SidePanels-c13f87dc.js → SidePanels-xssTWt4M.js} +34 -42
- package/dist/Topbar-3ozdWfSy.cjs +1 -0
- package/dist/{Topbar-b38d5d50.js → Topbar-H0f0EL6-.js} +33 -35
- package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
- package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
- package/dist/UploadImages-T6kW0s3G.cjs +1 -0
- package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
- package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
- package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
- package/dist/{add-page-modal-08a19915.js → add-page-modal-J1E7rh1U.js} +25 -22
- package/dist/add-page-modal-eiiUZCJX.cjs +1 -0
- package/dist/alert-dialog-GNfnpqFB.js +64 -0
- package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
- package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
- package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
- package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
- package/dist/confirm-alert-b0e_BLhF.js +36 -0
- package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
- package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
- package/dist/controls-Ni5kEzLz.js +103 -0
- package/dist/controls-xUKa23ic.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -10
- package/dist/core.js +116 -69
- package/dist/delete-page-modal-TGTmRjyn.cjs +1 -0
- package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-ysj4O0bM.js} +25 -22
- package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
- package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
- package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
- package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
- package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
- package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
- package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
- package/dist/functions-pcUZhFJM.js +12 -0
- package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
- package/dist/functions-uw7QP2kT.cjs +1 -0
- package/dist/html-to-json-P6GpbcQX.cjs +1 -0
- package/dist/html-to-json-pdHQfRkN.js +178 -0
- package/dist/index-8L3zCc6V.cjs +1 -0
- package/dist/index-cZ4uo6aT.js +2256 -0
- package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
- package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +20 -13
- package/dist/lib.js +24 -23
- package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
- package/dist/link-ece8dZGH.cjs +1 -0
- package/dist/{page-viewer-5c733179.js → page-viewer-84Giu0Rs.js} +29 -26
- package/dist/page-viewer-OdVEG83P.cjs +1 -0
- package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
- package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
- package/dist/{project-general-setting-d9736056.js → project-general-setting-8OEVVxzn.js} +20 -17
- package/dist/project-general-setting-laHNQPW5.cjs +1 -0
- package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-9kD_stdI.js} +11 -12
- package/dist/project-seo-setting-F3Opt9Uj.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +7 -7
- package/dist/render.js +3 -3
- package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
- package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
- package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
- package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
- package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
- package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
- package/dist/server.d.ts +7 -10
- package/dist/server.js +0 -3
- package/dist/single-page-detail-X0TGlsT4.cjs +1 -0
- package/dist/{single-page-detail-04410e64.js → single-page-detail-iXpavDy8.js} +32 -29
- package/dist/skeleton-CU_FIbg3.js +239 -0
- package/dist/skeleton-JHP9zwL2.cjs +1 -0
- package/dist/studio.cjs +1 -0
- package/dist/studio.d.ts +13 -0
- package/dist/studio.js +39 -0
- package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
- package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
- package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
- package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
- package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
- package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +69 -4
- package/dist/ui.js +272 -212
- package/dist/useAddBlock-1cMXaOVk.cjs +1 -0
- package/dist/useAddBlock-BOjrGBEO.js +86 -0
- package/dist/useAllBlocks-RU_Xw8j9.cjs +1 -0
- package/dist/useAllBlocks-lX6uVO39.js +20 -0
- package/dist/useChaiExternalData-4K9WxANa.js +6 -0
- package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
- package/dist/useDarkMode-JWkrNFpH.js +23 -0
- package/dist/useDarkMode-zeTW_UUR.cjs +1 -0
- package/dist/useFeatureSupport-jWSuY7wk.js +16 -0
- package/dist/useFeatureSupport-tZ0QfBxp.cjs +1 -0
- package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
- package/dist/useLanguage-O1uu2Bzu.js +216 -0
- package/dist/useLanguage-Y3qgAbgG.cjs +1 -0
- package/dist/useMarkAsGlobalBlock-DB5B1UP6.js +25 -0
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +1 -0
- package/dist/useUiLibraries-4hPOi8DI.js +12 -0
- package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
- package/package.json +19 -5
- package/dist/AddBlocks-76275943.cjs +0 -3
- package/dist/BrandingOptions-d3b3309a.cjs +0 -1
- package/dist/CanvasArea-9f94cd28.cjs +0 -46
- package/dist/CurrentPage-edb509db.cjs +0 -1
- package/dist/Layers-ecba52c1.cjs +0 -1
- package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
- package/dist/PagesPanel-f4329082.cjs +0 -1
- package/dist/ProjectPanel-ce3116d3.cjs +0 -1
- package/dist/Settings-b6a2bef6.cjs +0 -1
- package/dist/SidePanels-2cc72c0b.cjs +0 -1
- package/dist/Topbar-3b9db9f3.cjs +0 -1
- package/dist/UnsplashImages-98c085c2.cjs +0 -1
- package/dist/UploadImages-61ef83ad.cjs +0 -1
- package/dist/add-page-modal-7f9ff733.cjs +0 -1
- package/dist/confirm-alert-c1fdf1e4.js +0 -35
- package/dist/confirm-alert-e1ea5110.cjs +0 -1
- package/dist/delete-page-modal-7066b01f.cjs +0 -1
- package/dist/html-to-json-aadcbf66.cjs +0 -1
- package/dist/index-c535cc95.cjs +0 -164
- package/dist/link-24679521.cjs +0 -1
- package/dist/page-viewer-da99c71e.cjs +0 -1
- package/dist/project-general-setting-90f8416d.cjs +0 -1
- package/dist/project-seo-setting-6eef8387.cjs +0 -1
- package/dist/single-page-detail-90f49d7a.cjs +0 -1
- package/dist/useBuilderProp-21feb2da.js +0 -296
- package/dist/useBuilderProp-adacf42f.cjs +0 -1
- package/dist/useChaiExternalData-192c7896.js +0 -5
- package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
- /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
- /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
- /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
- /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
- /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
- /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";var Le=Object.defineProperty;var Fe=(n,t,s)=>t in n?Le(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var z=(n,t,s)=>(Fe(n,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),h=require("react"),d=require("lodash"),_=require("@radix-ui/react-icons"),P=require("./useBuilderProp-adacf42f.cjs"),u=require("./index-c535cc95.cjs"),Re=require("react-i18next"),Z=require("./separator-a597dba7.cjs"),F=require("./dropdown-menu-84b2439e.cjs"),We=require("./label-167415e5.cjs"),G=require("jotai"),$e=require("@floating-ui/dom"),fe=require("@floating-ui/react-dom"),Ue=require("react-dnd"),He=require("@react-hookz/web"),ze=require("@bobthered/tailwindcss-palette-generator"),Ke=require("react-wrap-balancer"),Ye=require("tailwind-merge"),V=require("./MODIFIERS-4716c669.cjs"),ke=require("@chaibuilder/blocks"),we=require("./useChaiExternalData-a90e8aac.cjs"),xe=require("react-dom");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-scroll-area");require("i18next");require("flagged");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("sonner");require("lucide-react");require("@radix-ui/react-separator");require("@radix-ui/react-switch");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-label");const Ge=()=>h.useMemo(()=>ke.getChaiDataProviders(),[]),Ve=({children:n})=>{const[,t]=we.useChaiExternalData(),[s]=u.usePageDataProviders(),i=Ge();return h.useEffect(()=>(t({}),d.each(s,c=>{const r=d.find(i,{providerKey:c.providerKey});if(r){const a=(r==null?void 0:r.mockFn)||(r==null?void 0:r.dataFn);a&&a(c.args).then(p=>t(v=>({...v,[c.providerKey]:p})))}}),()=>{d.each(s,c=>{t(r=>(delete r[c.providerKey],r))})}),[i,s,t]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n})},Xe=()=>{const{undoCount:n,redoCount:t,undo:s,redo:i}=u.useCanvasHistory();return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(P.Button,{disabled:!n,size:"sm",onClick:s,className:"rounded-full",variant:"ghost",children:e.jsxRuntimeExports.jsx(_.ResetIcon,{})}),e.jsxRuntimeExports.jsx(P.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:e.jsxRuntimeExports.jsx(_.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function Ze(){const[n,t]=u.useDarkMode(),{t:s}=Re.useTranslation();return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(We.Label,{htmlFor:"dark-mode-switch",children:s("dark_mode")}),e.jsxRuntimeExports.jsxs(F.Switch,{id:"dark-mode-switch",checked:n,onCheckedChange:()=>{t(!n)},className:`${n?"bg-violet-600":"bg-violet-300"}
|
|
2
|
-
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Use setting"}),e.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${n?"translate-x-5":"translate-x-0"}
|
|
3
|
-
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const he=({landscape:n=!1})=>e.jsxRuntimeExports.jsxs("svg",{className:n?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[e.jsxRuntimeExports.jsx("g",{strokeWidth:0}),e.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),e.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),me=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(_.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(_.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:e.jsxRuntimeExports.jsx(he,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:e.jsxRuntimeExports.jsx(he,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:e.jsxRuntimeExports.jsx(_.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:e.jsxRuntimeExports.jsx(_.DesktopIcon,{}),width:1920}],Je=({title:n,content:t,currentBreakpoint:s,breakpoint:i,width:c,icon:r,onClick:a})=>e.jsxRuntimeExports.jsxs(F.HoverCard,{children:[e.jsxRuntimeExports.jsx(F.HoverCardTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(P.Button,{onClick:()=>a(c),size:"sm",variant:i===s?"secondary":"ghost",children:r})}),e.jsxRuntimeExports.jsx(F.HoverCardContent,{className:"w-52 border-border",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:n}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:t})]})})})]}),Qe=()=>{const[,n,t]=u.useCanvasWidth(),[s,i]=u.useSelectedBreakpoints(),c=r=>{s.includes(r)?s.length>2&&i(s.filter(a=>a!==r)):i(a=>[...a,r])};return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[d.map(me.filter(r=>d.includes(s,d.toUpper(r.breakpoint))),r=>h.createElement(Je,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:n})),e.jsxRuntimeExports.jsxs(F.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(F.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:e.jsxRuntimeExports.jsx(_.DotsVerticalIcon,{className:"scale-90 transform"})})}),e.jsxRuntimeExports.jsxs(F.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[e.jsxRuntimeExports.jsx(F.DropdownMenuLabel,{children:"Breakpoints"}),e.jsxRuntimeExports.jsx(F.DropdownMenuSeparator,{}),d.map(me,r=>e.jsxRuntimeExports.jsx(F.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>c(d.toUpper(r.breakpoint)),checked:d.includes(s,d.toUpper(r.breakpoint)),children:r.title},r.breakpoint))]})]})]})},et=()=>{const[n]=u.useSetAllBlocks(),{createSnapshot:t}=u.useCanvasHistory(),[,s]=u.useSelectedBlockIds(),[,i]=u.useSelectedStylingBlocks(),c=h.useCallback(()=>{n([]),s([]),i([]),t()},[n,t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(P.AlertDialog,{children:[e.jsxRuntimeExports.jsx(P.AlertDialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(P.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[e.jsxRuntimeExports.jsx(_.EraserIcon,{})," Clear"]})}),e.jsxRuntimeExports.jsxs(P.AlertDialogContent,{className:"border-border",children:[e.jsxRuntimeExports.jsxs(P.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(P.AlertDialogTitle,{children:"Clear whole canvas?"}),e.jsxRuntimeExports.jsx(P.AlertDialogDescription,{children:"Are you sure you want to clear the whole canvas?"})]}),e.jsxRuntimeExports.jsxs(P.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(P.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(P.AlertDialogAction,{onClick:c,children:"Yes"})]})]})]})})},tt=()=>{const n=u.useFeatureSupport("darkMode",!1),[t]=u.useCanvasZoom();return e.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Ze,{}),e.jsxRuntimeExports.jsx(Z.Separator,{orientation:"vertical"})]}):null,e.jsxRuntimeExports.jsx(Qe,{}),e.jsxRuntimeExports.jsx(Z.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[e.jsxRuntimeExports.jsx(_.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",e.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[d.round(t,0),"%"]})]}),e.jsxRuntimeExports.jsx(Z.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(Xe,{})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[e.jsxRuntimeExports.jsx(Z.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(et,{})]})]})},ee={FRAMEWORK:"FRAMEWORK",STATIC:"STATIC",EMAIL:"EMAIL",PRESENTATION:"PRESENTATION",GRAPHIC:"GRAPHIC"},nt=`<!doctype html>
|
|
4
|
-
<html class="scroll-smooth h-full overflow-y-auto">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
|
|
9
|
-
<style>
|
|
10
|
-
html { height: 100%; overflow:auto; }
|
|
11
|
-
body { height: 100%; }
|
|
12
|
-
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
13
|
-
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
14
|
-
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
15
|
-
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
16
|
-
html{
|
|
17
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
18
|
-
scrollbar-width: none; /* Firefox */
|
|
19
|
-
}
|
|
20
|
-
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
21
|
-
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
22
|
-
|
|
23
|
-
html::-webkit-scrollbar { width: 0 !important }
|
|
24
|
-
.aspect-auto{aspect-ratio: auto;}
|
|
25
|
-
.aspect-square{aspect-ratio: 1/1;}
|
|
26
|
-
.aspect-video{aspect-ratio: 16/9;}
|
|
27
|
-
a{ pointer-events: none !important; }
|
|
28
|
-
</style>
|
|
29
|
-
<style id="hidden-blocks"></style>
|
|
30
|
-
<style id="selected-block"></style>
|
|
31
|
-
<style id="selected-styling-block"></style>
|
|
32
|
-
<style id="highlighted-block"></style>
|
|
33
|
-
</head>
|
|
34
|
-
<body class="font-body antialiased h-full">
|
|
35
|
-
<div class="frame-root"></div>
|
|
36
|
-
</body>
|
|
37
|
-
</html>`,st=n=>{const[t]=u.useCanvasWidth(),[,s]=u.useCanvasZoom(),[i,c]=h.useState({}),r=h.useCallback(()=>{const{width:a,height:p}=n;if(a<t){const v=parseFloat((a/t).toString());let R={};p&&(R={height:p+2*p*(1-v)}),c({transform:`scale(${v})`,transformOrigin:"top left",...R,maxWidth:"none"}),s(v*100)}else c({}),s(100)},[t,n,s]);return h.useEffect(()=>{r()},[t,n,s,r]),i};var ae={exports:{}};/*
|
|
38
|
-
object-assign
|
|
39
|
-
(c) Sindre Sorhus
|
|
40
|
-
@license MIT
|
|
41
|
-
*/var te,ye;function rt(){if(ye)return te;ye=1;var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function i(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function c(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var a={},p=0;p<10;p++)a["_"+String.fromCharCode(p)]=p;var v=Object.getOwnPropertyNames(a).map(function(x){return a[x]});if(v.join("")!=="0123456789")return!1;var R={};return"abcdefghijklmnopqrst".split("").forEach(function(x){R[x]=x}),Object.keys(Object.assign({},R)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return te=c()?Object.assign:function(r,a){for(var p,v=i(r),R,x=1;x<arguments.length;x++){p=Object(arguments[x]);for(var f in p)t.call(p,f)&&(v[f]=p[f]);if(n){R=n(p);for(var g=0;g<R.length;g++)s.call(p,R[g])&&(v[R[g]]=p[R[g]])}}return v},te}var ne,ge;function ue(){if(ge)return ne;ge=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ne=n,ne}var se,ve;function Se(){return ve||(ve=1,se=Function.call.bind(Object.prototype.hasOwnProperty)),se}var re,je;function ot(){if(je)return re;je=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var t=ue(),s={},i=Se();n=function(r){var a="Warning: "+r;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function c(r,a,p,v,R){if(process.env.NODE_ENV!=="production"){for(var x in r)if(i(r,x)){var f;try{if(typeof r[x]!="function"){var g=Error((v||"React class")+": "+p+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=r[x](a,x,v,p,null,t)}catch(B){f=B}if(f&&!(f instanceof Error)&&n((v||"React class")+": type specification of "+p+" `"+x+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in s)){s[f.message]=!0;var S=R?R():"";n("Failed "+p+" type: "+f.message+(S??""))}}}}return c.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(s={})},re=c,re}var oe,Ee;function it(){if(Ee)return oe;Ee=1;var n=u.reactIsExports,t=rt(),s=ue(),i=Se(),c=ot(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(p){var v="Warning: "+p;typeof console<"u"&&console.error(v);try{throw new Error(v)}catch{}});function a(){return null}return oe=function(p,v){var R=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function f(o){var l=o&&(R&&o[R]||o[x]);if(typeof l=="function")return l}var g="<<anonymous>>",S={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:U(),arrayOf:L,element:J(),elementType:Q(),instanceOf:O,node:Oe(),objectOf:$,oneOf:W,oneOfType:Be,shape:Pe,exact:Me};function B(o,l){return o===l?o!==0||1/o===1/l:o!==o&&l!==l}function w(o,l){this.message=o,this.data=l&&typeof l=="object"?l:{},this.stack=""}w.prototype=Error.prototype;function D(o){if(process.env.NODE_ENV!=="production")var l={},k=0;function E(C,j,b,T,A,I,N){if(T=T||g,I=I||b,N!==s){if(v){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var K=T+":"+b;!l[K]&&k<3&&(r("You are manually calling a React.PropTypes validation function for the `"+I+"` prop on `"+T+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),l[K]=!0,k++)}}return j[b]==null?C?j[b]===null?new w("The "+A+" `"+I+"` is marked as required "+("in `"+T+"`, but its value is `null`.")):new w("The "+A+" `"+I+"` is marked as required in "+("`"+T+"`, but its value is `undefined`.")):null:o(j,b,T,A,I)}var y=E.bind(null,!1);return y.isRequired=E.bind(null,!0),y}function m(o){function l(k,E,y,C,j,b){var T=k[E],A=H(T);if(A!==o){var I=Y(T);return new w("Invalid "+C+" `"+j+"` of type "+("`"+I+"` supplied to `"+y+"`, expected ")+("`"+o+"`."),{expectedType:o})}return null}return D(l)}function U(){return D(a)}function L(o){function l(k,E,y,C,j){if(typeof o!="function")return new w("Property `"+j+"` of component `"+y+"` has invalid PropType notation inside arrayOf.");var b=k[E];if(!Array.isArray(b)){var T=H(b);return new w("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected an array."))}for(var A=0;A<b.length;A++){var I=o(b,A,y,C,j+"["+A+"]",s);if(I instanceof Error)return I}return null}return D(l)}function J(){function o(l,k,E,y,C){var j=l[k];if(!p(j)){var b=H(j);return new w("Invalid "+y+" `"+C+"` of type "+("`"+b+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return D(o)}function Q(){function o(l,k,E,y,C){var j=l[k];if(!n.isValidElementType(j)){var b=H(j);return new w("Invalid "+y+" `"+C+"` of type "+("`"+b+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return D(o)}function O(o){function l(k,E,y,C,j){if(!(k[E]instanceof o)){var b=o.name||g,T=Ne(k[E]);return new w("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected ")+("instance of `"+b+"`."))}return null}return D(l)}function W(o){if(!Array.isArray(o))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),a;function l(k,E,y,C,j){for(var b=k[E],T=0;T<o.length;T++)if(B(b,o[T]))return null;var A=JSON.stringify(o,function(N,M){var K=Y(M);return K==="symbol"?String(M):M});return new w("Invalid "+C+" `"+j+"` of value `"+String(b)+"` "+("supplied to `"+y+"`, expected one of "+A+"."))}return D(l)}function $(o){function l(k,E,y,C,j){if(typeof o!="function")return new w("Property `"+j+"` of component `"+y+"` has invalid PropType notation inside objectOf.");var b=k[E],T=H(b);if(T!=="object")return new w("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected an object."));for(var A in b)if(i(b,A)){var I=o(b,A,y,C,j+"."+A,s);if(I instanceof Error)return I}return null}return D(l)}function Be(o){if(!Array.isArray(o))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var l=0;l<o.length;l++){var k=o[l];if(typeof k!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_e(k)+" at index "+l+"."),a}function E(y,C,j,b,T){for(var A=[],I=0;I<o.length;I++){var N=o[I],M=N(y,C,j,b,T,s);if(M==null)return null;M.data&&i(M.data,"expectedType")&&A.push(M.data.expectedType)}var K=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new w("Invalid "+b+" `"+T+"` supplied to "+("`"+j+"`"+K+"."))}return D(E)}function Oe(){function o(l,k,E,y,C){return X(l[k])?null:new w("Invalid "+y+" `"+C+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return D(o)}function pe(o,l,k,E,y){return new w((o||"React class")+": "+l+" type `"+k+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+y+"`.")}function Pe(o){function l(k,E,y,C,j){var b=k[E],T=H(b);if(T!=="object")return new w("Invalid "+C+" `"+j+"` of type `"+T+"` "+("supplied to `"+y+"`, expected `object`."));for(var A in o){var I=o[A];if(typeof I!="function")return pe(y,C,j,A,Y(I));var N=I(b,A,y,C,j+"."+A,s);if(N)return N}return null}return D(l)}function Me(o){function l(k,E,y,C,j){var b=k[E],T=H(b);if(T!=="object")return new w("Invalid "+C+" `"+j+"` of type `"+T+"` "+("supplied to `"+y+"`, expected `object`."));var A=t({},k[E],o);for(var I in A){var N=o[I];if(i(o,I)&&typeof N!="function")return pe(y,C,j,I,Y(N));if(!N)return new w("Invalid "+C+" `"+j+"` key `"+I+"` supplied to `"+y+"`.\nBad object: "+JSON.stringify(k[E],null," ")+`
|
|
42
|
-
Valid keys: `+JSON.stringify(Object.keys(o),null," "));var M=N(b,I,y,C,j+"."+I,s);if(M)return M}return null}return D(l)}function X(o){switch(typeof o){case"number":case"string":case"undefined":return!0;case"boolean":return!o;case"object":if(Array.isArray(o))return o.every(X);if(o===null||p(o))return!0;var l=f(o);if(l){var k=l.call(o),E;if(l!==o.entries){for(;!(E=k.next()).done;)if(!X(E.value))return!1}else for(;!(E=k.next()).done;){var y=E.value;if(y&&!X(y[1]))return!1}}else return!1;return!0;default:return!1}}function qe(o,l){return o==="symbol"?!0:l?l["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&l instanceof Symbol:!1}function H(o){var l=typeof o;return Array.isArray(o)?"array":o instanceof RegExp?"object":qe(l,o)?"symbol":l}function Y(o){if(typeof o>"u"||o===null)return""+o;var l=H(o);if(l==="object"){if(o instanceof Date)return"date";if(o instanceof RegExp)return"regexp"}return l}function _e(o){var l=Y(o);switch(l){case"array":case"object":return"an "+l;case"boolean":case"date":case"regexp":return"a "+l;default:return l}}function Ne(o){return!o.constructor||!o.constructor.name?g:o.constructor.name}return S.checkPropTypes=c,S.resetWarningCache=c.resetWarningCache,S.PropTypes=S,S},oe}var ie,be;function at(){if(be)return ie;be=1;var n=ue();function t(){}function s(){}return s.resetWarningCache=t,ie=function(){function i(a,p,v,R,x,f){if(f!==n){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}i.isRequired=i;function c(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:c,element:i,elementType:i,instanceOf:c,node:i,objectOf:c,oneOf:c,oneOfType:c,shape:c,exact:c,checkPropTypes:s,resetWarningCache:t};return r.PropTypes=r,r},ie}if(process.env.NODE_ENV!=="production"){var ct=u.reactIsExports,lt=!0;ae.exports=it()(ct.isElement,lt)}else ae.exports=at()();var ut=ae.exports;const q=V.getDefaultExportFromCjs(ut);let Ce,Te;typeof document<"u"&&(Ce=document);typeof window<"u"&&(Te=window);const Ie=h.createContext({document:Ce,window:Te}),de=()=>h.useContext(Ie),{Provider:dt,Consumer:Dt}=Ie;class De extends h.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return h.Children.only(this.props.children)}}z(De,"propTypes",{children:q.element.isRequired,contentDidMount:q.func.isRequired,contentDidUpdate:q.func.isRequired});class ce extends h.Component{constructor(s,i){super(s,i);z(this,"setRef",s=>{this.nodeRef.current=s;const{forwardedRef:i}=this.props;typeof i=="function"?i(s):i&&(i.current=s)});z(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});z(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=h.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const s=this.getDoc();return this.props.mountTarget?s.querySelector(this.props.mountTarget):s.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const s=this.getDoc();if(!s)return null;const i=this.props.contentDidMount,c=this.props.contentDidUpdate,r=s.defaultView||s.parentView,a=e.jsxRuntimeExports.jsx(De,{contentDidMount:i,contentDidUpdate:c,children:e.jsxRuntimeExports.jsx(dt,{value:{document:s,window:r},children:e.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),p=this.getMountTarget();return[xe.createPortal(this.props.head,this.getDoc().head),xe.createPortal(a,p)]}render(){const s={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete s.head,delete s.initialContent,delete s.mountTarget,delete s.contentDidMount,delete s.contentDidUpdate,delete s.forwardedRef,e.jsxRuntimeExports.jsx("iframe",{...s,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}z(ce,"propTypes",{style:q.object,head:q.node,initialContent:q.string,mountTarget:q.string,contentDidMount:q.func,contentDidUpdate:q.func,children:q.oneOfType([q.element,q.arrayOf(q.element)])}),z(ce,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const pt=h.forwardRef((n,t)=>e.jsxRuntimeExports.jsx(ce,{...n,forwardedRef:t})),ft=({children:n})=>{const{document:t}=de(),[s]=u.useSelectedBlockIds(),[i,c]=u.useSelectedStylingBlocks();return h.useEffect(()=>{setTimeout(()=>{if(!d.isEmpty(i))return;const r=Ae(t,d.first(s));if(r){const a=r.getAttribute("data-style-prop");if(a){const p=r.getAttribute("data-style-id"),v=r.getAttribute("data-block-parent");c([{id:p,prop:a,blockId:v}])}}},100)},[t,s,c,i]),e.jsxRuntimeExports.jsx("div",{id:"canvas",className:"relative h-screen max-w-full outline-2",children:n})},Ae=(n,t)=>n.querySelector(`[data-block-id="${t}"]`),xt=()=>{const{window:n}=de(),[t,s]=u.useSelectedBlockIds(),[,i]=u.useSelectedStylingBlocks(),{undo:c,redo:r}=u.useCanvasHistory(),a=u.useDuplicateBlocks(),[,p]=u.useCutBlockIds(),[,v]=u.useCopyBlockIds(),{pasteBlocks:R}=u.usePasteBlocks(),[,x]=u.usePreviewMode(),f=u.useRemoveBlocks(),{savePage:g}=u.useSavePage(),[S]=G.useAtom(u.inlineEditingActiveAtom),[,B]=G.useAtom(u.editLayerNameAtom),w=D=>{D.key==="Enter"&&(D.preventDefault(),t.length===1&&B(d.first(t)))};return h.useEffect(()=>{const D=m=>{if(m.key==="Escape"){s([]),i([]);return}if(w(m),!S&&(m.key==="Delete"||m.key==="Backspace")&&(m.preventDefault(),f(t)),m.ctrlKey||m.metaKey){if(["z","y","d","x","c","p","s","v"].includes(m.key)){if(S&&["x","z","v"].includes(m.key))return!0;m.preventDefault()}m.key==="s"&&(m.stopPropagation(),m.preventDefault(),g()),m.key==="z"&&c(),m.key==="y"&&r(),m.key==="d"&&a(t),m.key==="x"&&p(t),m.key==="c"&&v(t),m.key==="v"&&t.length>0&&R(t[0])}};return n.removeEventListener("keydown",D),n.addEventListener("keydown",D),()=>{n.removeEventListener("keydown",D)}},[t,s,c,f,x,r,a,p,v,R,S,g,n]),null},ht=({block:n,label:t})=>{const[,s]=Ue.useDrag(()=>({type:"CANVAS_BLOCK",item:n}));return e.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",ref:s,onDragStart:()=>{console.log("drag start")},children:[e.jsxRuntimeExports.jsx(_.DragHandleDots2Icon,{}),t]})},mt=({selectedBlockElement:n,block:t})=>{const s=u.useRemoveBlocks(),i=u.useDuplicateBlocks(),[,c]=u.useSelectedBlockIds(),[,r]=u.useSelectedStylingBlocks(),{floatingStyles:a,refs:p,update:v}=fe.useFloating({placement:"top-start",middleware:[fe.shift(),$e.flip()],elements:{reference:n}});He.useResizeObserver(n,()=>v(),n!==null);const R=d.get(t,"_parent",null),x=d.isEmpty(d.get(t,"_name",""))?d.get(t,"_type",""):d.get(t,"_name","");return!n||!t?null:e.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:p.setFloating,style:a,onClick:f=>{f.stopPropagation(),f.preventDefault()},onKeyDown:f=>f.stopPropagation(),className:"z-50 flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[e.jsxRuntimeExports.jsx(ht,{label:x,block:t}),e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1 ",children:[R&&e.jsxRuntimeExports.jsx(_.ArrowUpIcon,{className:"hover:scale-105 ",onClick:()=>{r([]),c([R])}}),u.canDuplicateBlock(d.get(t,"_type",""))?e.jsxRuntimeExports.jsx(_.CopyIcon,{className:"hover:scale-105 ",onClick:()=>i([t==null?void 0:t._id])}):null,u.canDeleteBlock(d.get(t,"_type",""))?e.jsxRuntimeExports.jsx(_.TrashIcon,{className:"hover:scale-105 ",onClick:()=>s([t==null?void 0:t._id])}):null]})]})},yt=({model:n})=>{const[t]=u.useBrandingOptions(),[s]=u.useSelectedBlockIds(),[i]=u.useDarkMode(),[c]=u.useHighlightBlockId(),[r]=u.useSelectedStylingBlocks(),{document:a,window:p}=de(),[v]=h.useState(a==null?void 0:a.getElementById("highlighted-block")),[R]=h.useState(a==null?void 0:a.getElementById("selected-block")),[x]=h.useState(a==null?void 0:a.getElementById("selected-styling-block"));h.useEffect(()=>{i?a==null||a.documentElement.classList.add("dark"):a==null||a.documentElement.classList.remove("dark")},[i,a]);const f=d.get(t,"headingFont","DM Sans"),g=d.get(t,"bodyFont","DM Sans");return h.useEffect(()=>{const S=d.get(t,"primaryColor","#000"),B=d.get(t,"secondaryColor","#FFF"),w=ze.tailwindcssPaletteGenerator({colors:[S,B],names:["primary","secondary"]});w.primary.DEFAULT=S,w.secondary.DEFAULT=B;const D=d.get(t,"roundedCorners","0");!p||!p.tailwind||(p.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[f],body:[g]},extend:{borderRadius:{global:`${D||"0"}px`},colors:w}},plugins:[p.tailwind.plugin.withOptions(({prefix:m="ui"}={})=>({addVariant:U})=>{for(const L of["open","checked","selected","active","disabled"])U(`${m}-${L}`,[`&[data-headlessui-state~="${L}"]`,`:where([data-headlessui-state~="${L}"]) &`]),U(`${m}-not-${L}`,[`&[data-headlessui-state]:not([data-headlessui-state~="${L}"])`,`:where([data-headlessui-state]:not([data-headlessui-state~="${L}"])) &:not([data-headlessui-state])`])})]})},[t,p,f,g]),h.useEffect(()=>{R&&(R.textContent=`${d.map(s,S=>`[data-block-id="${S}"]`).join(",")}{
|
|
43
|
-
outline: 1px solid ${s.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
44
|
-
}`)},[s,R]),h.useEffect(()=>{v&&(v.textContent=c?`[data-style-id="${c}"]{ outline: 1px solid orange !important; outline-offset: -1px;}`:"")},[c,s,v]),h.useEffect(()=>{x&&(x.textContent=`${d.map(r,({id:S})=>`[data-style-id="${S}"]`).join(",")}{
|
|
45
|
-
outline: 1px solid orange !important; outline-offset: -1px;
|
|
46
|
-
}`)},[r,x]),h.useEffect(()=>{if(n==="section")return;const S=d.get(t,"bodyTextLightColor","#64748b"),B=d.get(t,"bodyTextDarkColor","#94a3b8"),w=d.get(t,"bodyBgLightColor","#FFFFFF"),D=d.get(t,"bodyBgDarkColor","#0f172a");a.body.className=`font-body antialiased text-[${S}] bg-[${w}] dark:text-[${B}] dark:bg-[${D}]`},[t,a,n]),n==="page"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[f&&e.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${f.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),g&&f!==g&&e.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${g.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),f&&e.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${f}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},gt=()=>{const{t:n}=Re.useTranslation();return e.jsxRuntimeExports.jsx("div",{className:"my-auto py-24 text-center text-gray-600 dark:text-white",children:e.jsxRuntimeExports.jsx("h1",{className:"mb-10 text-4xl ",children:n("canvas_empty")})})},vt=n=>{const t={};return Object.keys(n).forEach(s=>{d.isString(n[s])&&n[s].startsWith(V.SLOT_KEY)&&(t[s]=n[s].replace(V.SLOT_KEY,"").split(","))}),t},jt=d.memoize(n=>{const t=n.replace(V.STYLES_KEY,"").split(",");return Ye.twMerge(t[0],t[1])});function Et(n,t){return d.get(n,`${t}_attrs`,{})}function bt(n,t,s,i){const c={};return Object.keys(n).forEach(r=>{if(d.isString(n[r])&&n[r].startsWith(V.STYLES_KEY)){const a=jt(n[r]);c[r]={className:a,"data-style-prop":r,"data-block-parent":n._id,"data-style-id":`${r}-${n._id}`,onMouseEnter:t,onMouseLeave:s,onClick:i,...Et(n,r)}}}),c}function Rt(n,t){const s=d.get(n,"_bindings",{});return d.isEmpty(s)?{...n}:(d.each(s,(i,c)=>{d.isString(i)&&d.get(t,i,null)&&(n[c]=d.get(t,i,null))}),n)}function le({blocks:n}){const t=u.useAllBlocks(),[,s]=u.useHighlightBlockId(),[,i]=u.useSelectedStylingBlocks(),[,c]=u.useSelectedBlockIds(),r=h.useCallback(x=>{var g;const f=(g=x.currentTarget)==null?void 0:g.getAttribute("data-style-id");s(f||""),x.stopPropagation()},[s]),a=h.useCallback(x=>{s(""),x.stopPropagation()},[s]),p=h.useCallback(x=>{x.stopPropagation();const f=x.currentTarget;if(f.getAttribute("data-block-parent")){const g=f.getAttribute("data-style-prop"),S=f.getAttribute("data-style-id"),B=f.getAttribute("data-block-parent");i([{id:S,prop:g,blockId:B}]),c([B])}else if(f.getAttribute("data-block-id")&&(c([f.getAttribute("data-block-id")]),f.getAttribute("data-block-parent"))){const g=f.getAttribute("data-style-prop"),S=f.getAttribute("data-style-id"),B=f.getAttribute("data-block-parent");i([{id:S,prop:g,blockId:B}])}},[i,c]),v=h.useCallback(x=>bt(x,r,a,p),[p,r,a]),[R]=we.useChaiExternalData();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:h.Children.toArray(n.map((x,f)=>{const g=vt(x),S={};d.isEmpty(g)||Object.keys(g).forEach(m=>{S[m]=h.Children.toArray(g[m].map(U=>e.jsxRuntimeExports.jsx(le,{blocks:[d.find(t,{_id:U})]})))});const B=d.filter(t,{_parent:x._id});S.children=B.length?e.jsxRuntimeExports.jsx(le,{blocks:B}):null;const w=ke.getBlockComponent(x._type),D=d.get(w,"component",null);return d.isNull(D)?e.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${x==null?void 0:x._type} not registered -->`}):e.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(D,{blockProps:{onClick:p,"data-block-id":x._id,"data-block-type":x._type},inBuilder:!0,index:f,...Rt(x,R),...v(x),...S})})}))})}const kt=()=>{const n=u.useAllBlocks();return e.jsxRuntimeExports.jsx(Ke.Provider,{children:d.isEmpty(n)?e.jsxRuntimeExports.jsx(gt,{}):e.jsxRuntimeExports.jsx(Ve,{children:e.jsxRuntimeExports.jsx(le,{blocks:d.filter(n,t=>d.isEmpty(t._parent))})})})},wt=(n,t)=>n.querySelector(`[data-style-id="${t}"]`),St=()=>{const[n]=G.useAtom(u.networkModeAtom),[t]=u.usePreviewMode(),[s]=u.useCanvasWidth(),[,i]=u.useSelectedBlockIds(),c=u.useSelectedBlock(),[,r]=u.useHighlightBlockId(),a=h.useRef(null),p=h.useRef(null),[v,R]=h.useState({width:0,height:0}),x=st(v),[f,g]=h.useState(0),[S,B]=h.useState([]),[,w]=h.useState([]),[,D]=G.useAtom(u.canvasIframeAtom),[m,U]=u.useSelectedStylingBlocks(),L=P.useBuilderProp("loadingCanvas",!1);h.useEffect(()=>{const{clientWidth:O,clientHeight:W}=p.current;R({width:O,height:W}),f===0&&g(O)},[p,s,f]);const J=(O,W=0)=>{const{top:$}=O.getBoundingClientRect();return $+W>=0&&$-W<=window.innerHeight};h.useEffect(()=>{var O,W;if(c&&c.type!=="Multiple"&&a.current){const $=Ae(a.current.contentDocument,c._id);$&&(J($)||(W=(O=a.current)==null?void 0:O.contentWindow)==null||W.scrollTo({top:$.offsetTop,behavior:"smooth"}),B([$]))}},[c]),h.useEffect(()=>{if(!d.isEmpty(m)&&a.current){const O=wt(a.current.contentDocument,d.first(m).id);w(O?[O]:[null])}else w([null])},[m]);const Q=h.useMemo(()=>{let O=nt;return n==="offline"&&(O=O.replace("https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio","/offline/tailwind.cdn.js"),O=O.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),O=O.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),O},[n]);return e.jsxRuntimeExports.jsx("div",{onClick:()=>{i([]),U([])},onMouseLeave:()=>setTimeout(()=>r(""),300),className:"relative mx-auto h-full w-full bg-black/80",style:f>0&&!d.isEmpty(x)?{width:t?"100%":f}:{},ref:p,children:e.jsxRuntimeExports.jsxs(pt,{contentDidMount:()=>D(a.current),ref:a,id:"canvas-iframe",style:{width:`${s}px`,...x},className:"relative mx-auto box-content h-full max-w-full shadow-md transition-all duration-300 ease-linear",initialContent:Q,children:[e.jsxRuntimeExports.jsx(xt,{}),e.jsxRuntimeExports.jsx(mt,{block:c,selectedBlockElement:d.first(S)}),e.jsxRuntimeExports.jsx(yt,{model:"page"}),e.jsxRuntimeExports.jsxs(ft,{children:[L?e.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:e.jsxRuntimeExports.jsx(P.Skeleton,{className:"h-full"})}):e.jsxRuntimeExports.jsx(kt,{}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})})},Ct=h.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-76275943.cjs"))),Tt=()=>{const n=P.useBuilderProp("mode",ee.STATIC),[t,s]=G.useAtom(u.addBlocksModalAtom),i={[ee.STATIC]:e.jsxRuntimeExports.jsx(St,{}),[ee.FRAMEWORK]:null}[n];return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsxRuntimeExports.jsx(tt,{}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex-1 overflow-hidden bg-slate-800/20 bg-[linear-gradient(to_right,#EEE_0.5px,transparent_0.5px),linear-gradient(to_bottom,#EEE_0.5px,transparent_0.5px)] bg-[size:12px_12px]",children:[e.jsxRuntimeExports.jsx(h.Suspense,{fallback:e.jsxRuntimeExports.jsx(P.Skeleton,{className:"h-full"}),children:e.jsxRuntimeExports.jsx(u.ErrorBoundary,{children:i})}),t?e.jsxRuntimeExports.jsx("div",{onClick:()=>s(!1),className:"absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",children:e.jsxRuntimeExports.jsx("div",{onClick:c=>c.stopPropagation(),className:"mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",children:e.jsxRuntimeExports.jsx(Ct,{})})}):null]})]})};exports.default=Tt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("./select-0e32300c.cjs"),t=require("lodash"),h=require("sonner"),l=require("react"),n=require("./index-c535cc95.cjs");require("react-i18next");const j=require("lucide-react");require("@radix-ui/react-icons");require("@radix-ui/react-select");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./useBuilderProp-adacf42f.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");const p=()=>{const{data:s}=n.useProject(),{data:u,isLoading:x}=n.usePages(),{syncState:d}=n.useSavePage(),m=n.useChangePage(),[a,o]=n.useCurrentPage(),c=t.sortBy(t.filter(u,{type:"STATIC"}),r=>t.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!t.isEmpty(u)&&s.homepage&&!t.find(u,{uuid:a})&&o(s.homepage)},[a,u,s,o]),l.useEffect(()=>()=>o(null),[o]);const g=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const q=t.find(c,{uuid:r});m(q)}};return x||t.isEmpty(a)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),t.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(i.Select,{value:a||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(i.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(i.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(i.SelectContent,{className:"z-[999]",children:t.map(c,r=>e.jsxRuntimeExports.jsx(i.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
package/dist/Layers-ecba52c1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),a=require("lodash"),s=require("@radix-ui/react-icons"),f=require("react-dnd"),y=require("@minoru/react-dnd-treeview"),P=require("react-i18next"),x=require("./index-c535cc95.cjs"),_=require("lucide-react"),v=require("./utils-3c452dd0.cjs"),m=require("react"),H=require("./MODIFIERS-4716c669.cjs"),C=require("./dialog-170eaad9.cjs"),u=require("./context-menu-fec580f2.cjs"),q=require("./useBuilderProp-adacf42f.cjs"),L=require("./scroll-area-bb343b86.cjs"),F=require("jotai");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const S=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(_.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function V(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const i=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(i);if(a.nth(l,1))return`Visible >=${n[a.nth(l,1)]}`}return""}const z=t=>{let n="";return Object.keys(t).forEach(r=>{a.startsWith(t[r],H.STYLES_KEY)&&(n=t[r])}),n},G=t=>{var R;const[,n]=x.useHighlightBlockId(),[r]=x.useHiddenBlockIds(),{isSelected:c}=t,{id:i,data:l}=t.node,d=t.depth*10,j=p=>{p.stopPropagation(),t.onToggle(t.node.id)},I=y.useDragOver(i,t.isOpen,t.onToggle),g=m.useMemo(()=>{const p=z(t.node.data);return V(p)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(i),className:v.cn("group flex w-full items-center justify-between space-x-px py-px ",c?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:p=>{p.stopPropagation(),!r.includes(i)&&t.onSelect(i)},onContextMenu:()=>t.onSelect(i),style:{paddingInlineStart:d},...I,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:j,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(S,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),g?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",g,")"]}):null]})]})})},$=t=>{var r;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(S,{type:(r=n==null?void 0:n.data)==null?void 0:r._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},K=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},Q=m.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-3a06a159.cjs"))),U=()=>{const[t]=x.useSelectedBlockIds(),[,n]=x.useCutBlockIds();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},Y=()=>{const[t]=x.useSelectedBlockIds(),[,n]=x.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},W=()=>{const[t]=x.useSelectedBlockIds(),n=x.useRemoveBlocks(),r=x.useSelectedBlock();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{disabled:(r==null?void 0:r._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},J=({id:t=null,openMarkAsGlobalModal:n})=>{const[r]=x.useSelectedBlockIds(),c=x.useDuplicateBlocks(),{pasteBlocks:i,canPaste:l}=x.usePasteBlocks(),d=q.useBuilderProp("globalBlocksSupport",!1),j=m.useCallback(()=>{c(r)},[r,c]);return e.jsxRuntimeExports.jsxs(u.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(u.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:j,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(U,{}),e.jsxRuntimeExports.jsx(Y,{}),e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(W,{})]})},X=({children:t,id:n=null})=>{const[r,c]=m.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(C.Dialog,{open:r,onOpenChange:c,children:r&&e.jsxRuntimeExports.jsx(C.DialogContent,{children:e.jsxRuntimeExports.jsx(m.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(Q,{closeModal:()=>c(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(u.ContextMenu,{children:[e.jsxRuntimeExports.jsx(u.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(J,{id:n,openMarkAsGlobalModal:()=>c(!0)})]})]})},Z=()=>{const{addCoreBlock:t}=x.useAddBlock(),n=q.useBuilderProp("getExternalPredefinedBlock");return m.useCallback(async r=>{const{block:c,dropTargetId:i,relativeIndex:l}=r;if(a.has(c,"format")){const d=await n(c);return t({blocks:d},i===0?null:i,l)}return t(c,i===0?null:i,l)},[t])};function ee(t){return a.map(t,n=>{const{data:r}=n;return{...r,_parent:n.parent===0?null:n.parent}})}const te=()=>{const t=x.useAllBlocks(),[n]=x.useSetAllBlocks(),[r,c,i]=x.useSelectedBlockIds(),[,l]=x.useSelectedStylingBlocks(),{t:d}=P.useTranslation(),{createSnapshot:j}=x.useCanvasHistory(),I=x.useExpandedIds(),g=Z(),[,R]=F.useAtom(x.addBlocksModalAtom),p=async(o,E)=>{const{dragSource:b,destinationIndex:k,relativeIndex:B,dropTargetId:N,monitor:O}=E,A=ee(o);n(A),b?j():(await g({block:O.getItem(),dropTargetId:N,destinationIndex:k,relativeIndex:B}),R(!1))},w=a.map(t,o=>({id:o._id,text:o._type,parent:o._parent||0,droppable:!a.isUndefined(a.find(t,{_parent:o._id})),data:o})),T=()=>{c([]),l([])},[{isOver:h},M]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:o=>({canDrop:o.canDrop(),isOver:o.isOver()}),drop:o=>{(async()=>(await g({block:o,dropTargetId:"",destinationIndex:0,relativeIndex:0}),R(!1)))()}})),{isDragging:D}=f.useDragLayer(o=>({isDragging:o.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>T(),className:v.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:a.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:M,className:`mx-1 mt-4 h-full p-6 text-center text-sm text-gray-400 ${h?"bg-blue-200":""}`,children:[h?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(h?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(L.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(y.Tree,{initialOpen:I,extraAcceptTypes:["CHAI_BLOCK"],tree:w,rootId:0,render:(o,{depth:E,isOpen:b,onToggle:k})=>e.jsxRuntimeExports.jsx(X,{id:o.id,children:e.jsxRuntimeExports.jsx(G,{onSelect:B=>{l([]),c([B])},isSelected:a.includes(r,o.id),node:o,depth:E,isOpen:b,onToggle:k,toggleIds:i})}),dragPreviewRender:o=>e.jsxRuntimeExports.jsx($,{monitorProps:o}),onDrop:p,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:x.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(o,{depth:E})=>e.jsxRuntimeExports.jsx(K,{node:o,depth:E})})})})})};exports.default=te;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),u=require("@radix-ui/react-icons"),o=require("react"),i=require("./useBuilderProp-adacf42f.cjs"),c=require("./index-c535cc95.cjs");require("react-i18next");const x=require("lodash");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const m=({id:t=null,closeModal:s})=>{const l=c.useMarkAsGlobalBlock(),[r,a]=o.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:"Mark as Global"}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:["Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:["Global blocks are indicated with ",e.jsxRuntimeExports.jsx(u.GlobeIcon,{className:"inline"})," icon in left sidebar"]}),e.jsxRuntimeExports.jsx("li",{children:'Global blocks are available under "Global" category'})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:"Enter global block name"}),e.jsxRuntimeExports.jsx("input",{placeholder:"Eg: Header, Footer ",className:"mt-2 w-full",value:r,onChange:n=>a(n.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(t,x.capitalize(r)),s()},disabled:r.length<=2,variant:"default",children:"Mark as Global"}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:s,children:"Cancel"})]})]})};exports.default=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),s=require("lodash"),u=require("./index-c535cc95.cjs");require("./MODIFIERS-4716c669.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./useBuilderProp-adacf42f.cjs");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const x=i.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-7f9ff733.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-da99c71e.cjs"))),c=()=>{const{data:t=[],isLoading:n}=u.usePages(),{data:r}=u.useProject(),o=s.sortBy(s.filter(t,{type:"STATIC"}),a=>s.get(a,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(x,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(q,{isLoading:n,pages:o})})]})};exports.default=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("react"),x=require("lodash"),s=require("./accordion-0afd8143.cjs"),a=require("./index-c535cc95.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./useBuilderProp-adacf42f.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-90f8416d.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-6eef8387.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function j(){const t=a.useUpdateProject(),{data:u}=a.useProject(),[i,o]=r.useState(l(u||{})),n=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(u,n.current)||t.mutate(n.current,{onSuccess:()=>o(n.current)})},[n]),r.useEffect(()=>{n.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=j;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var he=Object.create;var se=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var Re=(s,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of be(o))!fe.call(s,i)&&i!==r&&se(s,i,{get:()=>o[i],enumerable:!(n=ye(o,i))||n.enumerable});return s};var ve=(s,o,r)=>(r=s!=null?he(je(s)):{},Re(o||!s||!s.__esModule?se(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),x=require("react"),G=require("@react-hookz/web"),t=require("lodash"),ae=require("react-i18next"),u=require("@radix-ui/react-icons"),M=require("./tabs-860e37aa.cjs"),Ee=require("@rjsf/core"),we=require("@rjsf/validator-ajv8"),f=require("./index-c535cc95.cjs"),z=require("@chaibuilder/blocks"),K=require("lucide-react"),pe=require("./useChaiExternalData-a90e8aac.cjs"),E=require("./useBuilderProp-adacf42f.cjs"),$=require("./dialog-170eaad9.cjs"),Z=require("./popover-7cb9079b.cjs"),P=require("./command-b1103666.cjs"),T=require("./accordion-0afd8143.cjs"),Y=require("./link-24679521.cjs"),Ce=require("jotai"),ke=require("react-autosuggest"),Ne=require("fuse.js"),O=require("./html-to-json-aadcbf66.cjs"),ee=require("./label-167415e5.cjs"),Se=require("./MODIFIERS-4716c669.cjs"),Te=require("./scroll-area-bb343b86.cjs"),C=require("./select-0e32300c.cjs");require("@radix-ui/react-tabs");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("redux-undo");require("sonner");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-dialog");require("@radix-ui/react-popover");require("cmdk");require("@radix-ui/react-accordion");require("react-icons-picker");require("./ImagesPanel-8b7a989d.cjs");require("react-quill");require("himalaya");require("@radix-ui/react-label");require("@radix-ui/react-select");function Ie(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}return o.default=s,Object.freeze(o)}const X=Ie(x),Be=x.lazy(()=>import("react-json-view"));function Ae(s){const o=[],r={};function n(i,a){t.forEach(a,(d,p)=>{const l=i?`${i}.${p}`:p,m=t.isArray(d)?"list":typeof d;o.push(l),r[l]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(d)&&n(l,d)})}return n("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:o,pathsType:r}}const J=({data:s,fullView:o})=>{if(!s)return null;const r=typeof s;return o?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(f.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(Be,{style:{maxHeight:"40vh",overflowY:"auto"},name:"Content",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:s,collapsed:!0})})]}):e.jsxRuntimeExports.jsxs("div",{className:"text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},re=({type:s,value:o="",setValue:r,data:n,onChange:i,dataType:a,appliedBindings:d})=>{const{paths:p,pathsType:l}=Ae(n),m=s==="PROP"?z.getBlockComponent(n==null?void 0:n._type):{},g=s==="PROP",[c,b]=x.useState(!1),y=x.useMemo(()=>s==="PROP"?p.filter(h=>!t.includes(d,h)&&t.get(m,`props.${t.first(t.split(h,"."))}.binding`)):p.filter(h=>a===t.get(l,h,"")),[s,p,d,a,m]);return x.useEffect(()=>{o&&i(o)},[o,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(Z.Popover,{open:c,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(Z.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(E.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(o)?"bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center":"min-w-[350px] justify-between items-center"}`,children:o?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[g&&e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full",children:t.startCase(a)}),o]}),e.jsxRuntimeExports.jsx("span",{className:"text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(Z.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(P.Command,{children:[e.jsxRuntimeExports.jsx(P.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(P.CommandList,{children:[e.jsxRuntimeExports.jsx(P.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(P.CommandGroup,{children:t.map(y,h=>e.jsxRuntimeExports.jsxs(P.CommandItem,{value:h,className:`cursor-pointer ${g?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:R=>{r(t.find(y,N=>N===R)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(K.Check,{className:`w-4 h-4 text-green-500 ${o===h?"":"opacity-0"}`}),h]}),g?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full",children:t.startCase(t.get(l,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(J,{data:t.get(n,h)})})]},h))})]})]})})]})]}),!g&&!t.isEmpty(o)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(J,{data:t.get(n,o,""),fullView:!0})})]})},He=({appliedBindings:s=[],onAddBinding:o,editMode:r,item:n})=>{const[i,a]=x.useState(r?n.key:""),[d,p]=x.useState(r?n.value:""),l=f.useSelectedBlock(),[m]=pe.useChaiExternalData(),g=x.useCallback((y,h)=>{if(t.isEmpty(y))return"";{const R=t.get(h==="PROP"?l:m,y,"");if(t.isArray(R))return"list";const N=typeof R;return N==="string"?"text":N==="object"?"model":N}},[l,m]),[c,b]=x.useState(r?g(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs($.DialogHeader,{children:[e.jsxRuntimeExports.jsx($.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx($.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(re,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:a,onChange:y=>{const h=g(y,"PROP");a(y),c!==h&&p(""),b(h)},data:l,dataType:c,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(re,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:d,setValue:p,onChange:y=>{const h=g(y,"PATH");p(c===h?y:"")},data:m,dataType:c,appliedBindings:s})]}),e.jsxRuntimeExports.jsx($.DialogFooter,{children:e.jsxRuntimeExports.jsx(E.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(d),onClick:()=>o({key:i,value:d}),children:"Save"})})]})},ue=({children:s,onAddBinding:o,appliedBindings:r,editMode:n=!0,item:i={}})=>{const[a,d]=x.useState(!1);return e.jsxRuntimeExports.jsxs($.Dialog,{children:[e.jsxRuntimeExports.jsx($.DialogTrigger,{asChild:!0,onClick:()=>d(!0),children:s}),a&&e.jsxRuntimeExports.jsx($.DialogContent,{children:e.jsxRuntimeExports.jsx(He,{item:i,editMode:n,appliedBindings:r,onAddBinding:p=>{o(p),d(!1)}})})]})},Ve=({item:s,onAddBinding:o,onRemove:r,selectedBlock:n,dataProvider:i,appliedBindings:a})=>{const[d,p]=x.useState("string"),l=(m,g)=>{if(t.isEmpty(m))return"";{const c=t.get(g==="PROP"?n:i,m,"");if(t.isArray(c))return"list";const b=typeof c;return b==="string"?"text":b==="object"?"model":b}};return x.useEffect(()=>p(()=>l(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col border border-gray-200 relative rounded-md p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-gray-500 font-normal text-sm",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(J,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(ue,{editMode:!0,onAddBinding:o,appliedBindings:a,item:s,children:e.jsxRuntimeExports.jsx(K.EditIcon,{className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200"})}),e.jsxRuntimeExports.jsx(K.TrashIcon,{onClick:()=>r(),className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]}),!t.isEmpty(d)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(d)})]})},De=({bindingData:s,onChange:o})=>{const r=f.useSelectedBlock(),[n]=pe.useChaiExternalData(),i=z.getChaiDataProviders(),[a,d]=x.useState(t.map(s,(c,b)=>({key:b,value:c})));x.useEffect(()=>{d(t.map(s,(c,b)=>({key:b,value:c})))},[r==null?void 0:r._id]);const p=x.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(a))return!1;const c=t.last(a);return t.isEmpty(c==null?void 0:c.key)||t.isEmpty(c==null?void 0:c.value)},[n,a]),l=c=>{const b=t.filter(a,y=>y.key!==c.key);d([...b,c]),g([...b,c])},m=c=>{const b=t.filter(a,(y,h)=>c!==h);g([...b])},g=x.useCallback((c=[])=>{if(d(c),t.isEmpty(c)){o({});return}const b={};t.forEach(c,y=>{!t.isEmpty(y==null?void 0:y.key)&&!t.isEmpty(y==null?void 0:y.value)&&t.set(b,y.key,y.value)}),o(b)},[r]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(a,(c,b)=>e.jsxRuntimeExports.jsx(Ve,{item:c,onAddBinding:l,onRemove:()=>m(b),selectedBlock:r,dataProvider:n,appliedBindings:t.map(a,"key")},c.key)),e.jsxRuntimeExports.jsxs(E.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(ue,{appliedBindings:t.map(a,"key"),onAddBinding:l,children:e.jsxRuntimeExports.jsx("button",{disabled:p,className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${p?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-gray-500 text-[9.5px]",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),p&&e.jsxRuntimeExports.jsx(E.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Le=De,Pe=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),oe=({createHistorySnapshot:s,properties:o,formData:r,onChange:n})=>{const[i]=f.useActiveLanguage(),a={type:"object",properties:{}},d={};return Object.keys(o).forEach(p=>{const l=o[p];if(t.includes(["slot","styles"],l.type))return;const m=t.get(l,"i18n",!1)?`${p}-${i}`:p;a.properties[m]=f.getBlockJSONFromSchemas(l,i),d[m]=f.getBlockJSONFromUISchemas(l,i)}),e.jsxRuntimeExports.jsx(Ee,{widgets:{binding:Pe,richtext:Y.RichTextEditorField,icon:Y.IconPickerField,image:Y.ImagePickerField},fields:{link:Y.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:we,uiSchema:d,onBlur:s,schema:a,formData:r,onChange:n})};function $e(){const s=f.useSelectedBlock(),{createSnapshot:o}=f.useCanvasHistory(),r=f.useUpdateBlocksPropsRealtime(),n=z.getBlockComponent(s._type),i={...s},a=()=>o(),d=({formData:g},c)=>{if(c){const b=c.replace("root.","");r([s._id],{[b]:t.get(g,b)})}},p={_name:z.SingleLineText({title:"Name",default:t.get(s,"_name",s._type)})},l=t.keys(t.get(i,"_bindings",{})),m=x.useMemo(()=>{const g=t.cloneDeep(t.get(n,"props",{}));return t.each(l,c=>{delete g[c]}),g},[n,l]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(oe,{onChange:d,createHistorySnapshot:a,formData:i,properties:p}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Le,{bindingData:t.get(i,"_bindings",{}),onChange:g=>{d({formData:{...i,_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(T.AccordionContent,{className:"pt-4",children:[t.isEmpty(l)?"":e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(l,t.capitalize).join(", ")})," ",l.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(oe,{onChange:d,createHistorySnapshot:a,formData:i,properties:m})]})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const ne=new Ne(O.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Me(){var B;const[s]=f.useSelectedStylingBlocks(),o=f.useSelectedBlock(),r=f.useAddClassesToBlocks(),n=f.useRemoveClassesFromBlocks(),[i]=f.useSelectedBlockIds(),[a,d]=x.useState(""),p=(B=t.first(s))==null?void 0:B.prop,l=t.reject((t.get(o,p,"").replace(Se.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const w=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,w,!0),d("")},[g,c]=x.useState([]),b=({value:w})=>{const V=w.trim().toLowerCase(),A=V.match(/.+:/g);let k=[];if(A&&A.length>0){const[H]=A,L=V.replace(H,"");k=ne.search(L).map(j=>({...j,item:{...j.item,name:H+j.item.name}}))}else k=ne.search(V);c(t.map(k,"item"))},y=()=>{c([])},h=w=>w.name,R=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),N={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:w=>{w.key==="Enter"&&a.trim()!==""&&m()},onChange:(w,{newValue:V})=>d(V),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${g.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(ee.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(ke,{suggestions:g,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:y,getSuggestionValue:h,renderSuggestion:R,inputProps:N,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(E.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),X.Children.toArray(l.map(w=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[w,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>n(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const I=["px","%","em","rem","ch","vh","vw"],Oe={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:I,property:"flexBasis"},{type:"range",label:"Order",property:"order"},{type:"dropdown",label:"Flex",property:"flexGrowShrink"},{type:"dropdown",label:"Grow",property:"flexGrow"},{type:"dropdown",label:"Shrink",property:"flexShrink"}]},qe={heading:"Grid Child",items:[{type:"range",label:"Col Span",property:"gridColSpan"},{type:"range",label:"Col Start",property:"gridColStart"},{type:"range",label:"Col End",property:"gridColEnd"},{type:"range",label:"Row Span",property:"gridRowSpan"},{type:"range",label:"Row Start",property:"gridRowStart"},{type:"range",label:"Row End",property:"gridRowEnd"},{type:"range",label:"Order",property:"order"}]},_e=[{heading:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:I},{styleType:"accordion",heading:"Flex options",items:[{type:"dropdown",label:"Direction",property:"flexDirection"},{type:"dropdown",label:"Wrap",property:"flexWrap"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"Grid options",items:[{type:"range",label:"Columns",property:"gridColumns"},{type:"range",label:"Rows",property:"gridRows"},{type:"dropdown",label:"Auto Flow",property:"gridAutoFlow"},{type:"dropdown",label:"Auto Cols",property:"gridAutoColumns"},{type:"dropdown",label:"Auto Rows",property:"gridAutoRows"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",units:["px","rem"],options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"Visibility & Opacity",items:[{type:"dropdown",label:"Visibility",property:"visibility",units:I},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{heading:"Spacing",items:[{styleType:"multiple",label:"Margin",negative:!0,units:[...I,"auto"],options:[{key:"margin",label:"All"},{key:"marginX",label:"Left-Right"},{key:"marginY",label:"Top-Bottom"},{key:"marginTop",label:"Top"},{key:"marginRight",label:"Right"},{key:"marginBottom",label:"Bottom"},{key:"marginLeft",label:"Left"}]},{styleType:"multiple",label:"Padding",options:[{key:"padding",label:"All"},{key:"paddingX",label:"Left-Right"},{key:"paddingY",label:"Top-Bottom"},{key:"paddingTop",label:"Top"},{key:"paddingRight",label:"Right"},{key:"paddingBottom",label:"Bottom"},{key:"paddingLeft",label:"Left"}]},{styleType:"multiple",label:"Space Between",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{type:"arbitrary",label:"Width",units:I.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:I.concat("auto"),property:"height"},{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:I.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:I.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:I.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:I.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"Object options & aspect ratio",items:[{type:"dropdown",label:"Aspect",property:"aspectRatio"},{type:"dropdown",label:"Fit",property:"objectFit"},{type:"dropdown",label:"Position",property:"objectPosition"}]}]},{heading:"Position",items:[{type:"icons",label:"Position",property:"position"},{styleType:"accordion",heading:"Position options",items:[{styleType:"multiple",label:"Direction",options:[{key:"top",label:"Top"},{key:"right",label:"Right"},{key:"bottom",label:"Bottom"},{key:"left",label:"Left"}]},{styleType:"multiple",label:"Inset",options:[{key:"inset",label:"All"},{key:"insetX",label:"Left Right"},{key:"insetY",label:"Top Bottom"}]},{type:"arbitrary",label:"Z-Chai",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"Float & Clear",items:[{type:"icons",label:"Float",property:"float"},{type:"dropdown",label:"Clear",property:"clear"}]},{styleType:"accordion",heading:"Overflow & Overscroll",items:[{styleType:"multiple",type:"dropdown",label:"Overflow",options:[{key:"overflow",label:"All"},{key:"overflowX",label:"Left-Right"},{key:"overflowY",label:"Top-Bottom"}]},{styleType:"multiple",type:"dropdown",label:"Overscroll",options:[{key:"overscroll",label:"All"},{key:"overscrollX",label:"Left-Right"},{key:"overscrollY",label:"Top-Bottom"}]}]}]},{heading:"Typography",items:[{type:"dropdown",property:"fontFamily",label:"Font"},{type:"arbitrary",property:"fontSize",label:"Size",units:I},{type:"arbitrary",property:"lineHeight",label:"Height",units:I.concat("-")},{type:"range",property:"fontWeight",label:"Weight"},{type:"color",property:"textColor",label:"Color"},{styleType:"accordion",heading:"Alignments",items:[{type:"dropdown",property:"textAlign",label:"Align"},{type:"dropdown",property:"verticalAlign",label:"V. Align"}]},{styleType:"accordion",heading:"Spacing, decoration & more",items:[{type:"dropdown",property:"letterSpacing",label:"Spacing"},{type:"dropdown",property:"textDecoration",label:"Decoration"},{type:"range",property:"textDecorationThickness",label:"Thickness"},{type:"dropdown",property:"textTransform",label:"Transform"}]},{styleType:"accordion",heading:"White space & breaks",items:[{type:"dropdown",property:"whitespace",label:"Whitespace"},{type:"dropdown",property:"wordBreak",label:"Wordbreak"}]}]},{heading:"Background",items:[{type:"color",label:"Bg. Color",property:"backgroundColor"},{styleType:"accordion",heading:"Position, Size & more",items:[{type:"dropdown",label:"Attachment",property:"backgroundAttachment"},{type:"dropdown",label:"Clipping",property:"backgroundClip"},{type:"dropdown",label:"Origin",property:"backgroundOrigin"},{type:"dropdown",label:"Position",property:"backgroundPosition"},{type:"dropdown",label:"Repeat",property:"backgroundRepeat"},{type:"dropdown",label:"Size",property:"backgroundSize"}]},{type:"dropdown",label:"Gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"Gradient colors",items:[{type:"color",label:"From",property:"fromColor"},{type:"color",label:"Via",property:"viaColor"},{type:"color",label:"To",property:"toColor"}]}]},{heading:"Border & Outline",items:[{styleType:"multiple",type:"dropdown",label:"Width",options:[{key:"border",label:"All"},{key:"borderX",label:"Left Right"},{key:"borderY",label:"Top bottom"},{key:"borderTop",label:"Top"},{key:"borderRight",label:"Right"},{key:"borderBottom",label:"Bottom"},{key:"borderLeft",label:"Left"}]},{styleType:"multiple",type:"dropdown",label:"Corners",options:[{key:"borderRadius",label:"All"},{key:"borderRadiusTop",label:"Top"},{key:"borderRadiusRight",label:"Right"},{key:"borderRadiusBottom",label:"Bottom"},{key:"borderRadiusLeft",label:"Left"},{key:"borderRadiusTopLeft",label:"Top Left"},{key:"borderRadiusTopRight",label:"Top right"},{key:"borderRadiusBottomRight",label:"Bottom right"},{key:"borderRadiusBottomLeft",label:"Bottom left"}]},{type:"color",label:"Color",property:"borderColor"},{type:"dropdown",label:"Style",property:"borderStyle"},{styleType:"accordion",heading:"Divide options",items:[{styleType:"multiple",type:"range",label:"Width",options:[{key:"divideXWidth",label:"Left Right"},{key:"divideYWidth",label:"Top Bottom"}]},{type:"color",label:"Color",property:"divideColor"},{type:"dropdown",label:"Style",property:"divideStyle"}]},{styleType:"accordion",heading:"Outline styling",items:[{type:"range",label:"Width",property:"outlineWidth"},{type:"range",label:"Offset",property:"outlineOffset"},{type:"dropdown",label:"Style",property:"outlineStyle"}]},{styleType:"accordion",heading:"Ring options",items:[{type:"range",label:"Width",property:"ringWidth"},{type:"color",label:"Color",property:"ringColor"},{type:"range",label:"Offset",property:"ringOffsetWidth"},{type:"color",label:"Off. color",property:"ringOffsetColor"}]}]},{heading:"Effect & Animation",items:[{type:"range",label:"Shadow",property:"boxShadow"},{type:"color",label:"Color",property:"boxShadowColor"},{type:"dropdown",label:"Cursor",property:"cursor"},{styleType:"accordion",heading:"Blend & Cursor",items:[{type:"dropdown",label:"Mix Blend",property:"mixBlendMode"},{type:"dropdown",label:"Bg. Blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"Transform",items:[{type:"dropdown",label:"Origin",property:"transformOrigin"},{styleType:"multiple",label:"Scale",units:["-"],options:[{key:"scale",label:"All"},{key:"scaleX",label:"Left-Right"},{key:"scaleY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Skew",units:["deg"],options:[{key:"skewX",label:"Left-Right"},{key:"skewY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Translate",negative:!0,options:[{key:"translateX",label:"Left-Right"},{key:"translateY",label:"Top-Bottom"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"Rotate",property:"rotate"}]},{styleType:"accordion",heading:"Animation",items:[{type:"dropdown",label:"Animation",property:"animation"},{type:"dropdown",label:"Transition",property:"transition"},{type:"dropdown",label:"Easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"Duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"Delay",property:"delay"}]}]},{heading:"Classes",items:[{component:Me}]}],de={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},_=x.createContext({canReset:!1,canChange:!0}),We=({children:s,canReset:o=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(_.Provider,{value:{canReset:o,canChange:r},children:s}),ce=({label:s,property:o,onChange:r})=>{const n=x.useMemo(()=>t.get(O.CLASSES_LIST,`${o}.classes`,[""]),[o]),i=W(o),a=x.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:d}=x.useContext(_),p=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:p?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(P.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(E.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(E.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(Q,{rounded:s,onChange:l=>r(l,o),selected:a,options:n,disabled:!d})})};function Q({selected:s,onChange:o,rounded:r=!1,options:n,disabled:i=!1}){const a=s.replace(/.*:/g,"").trim(),{undo:d,redo:p}=f.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${r?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:l=>o(l.target.value),onKeyDown:l=>{l.ctrlKey&&(l.key==="z"&&d(),l.key==="y"&&p())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),x.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:l,children:l})))]})}const Fe=({property:s,onChange:o})=>{const{canReset:r,canChange:n}=x.useContext(_),i=W(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]),d=x.useMemo(()=>t.get(O.CLASSES_LIST,`${s}.classes`,[""]),[s]),p=d.indexOf(a)>-1?d.indexOf(a):0,l=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:l?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:a}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||p-1<0),onClick:()=>o(t.nth(d,p-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!n&&(!r||p-1<0)?"text-gray-500":"text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(ce,{label:!1,property:s,onChange:o})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||p+1>=d.length),onClick:()=>o(t.nth(d,p+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!n&&(!r||p+1>=d.length)?"text-gray-500":"text-white/60"})})})]})})},Ye=({property:s,onChange:o})=>{const r=x.useMemo(()=>t.get(O.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:n}=x.useContext(_),i=W(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,d=>e.jsxRuntimeExports.jsxs(E.Tooltip,{children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>o(d,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===d?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:x.createElement(t.get(de,d,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(E.TooltipContent,{children:t.startCase(t.toLower(d))})]}))})},Xe={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},ze=({property:s,onChange:o})=>{const r=W(s),n=x.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=x.useContext(_),[a,d]=x.useState([]),[p,l]=x.useState({color:"",shade:""}),m=n.split("-"),g=t.get(m,"1",""),c=t.get(m,"2",""),b=x.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(d([]),l({color:h})):(d(["50","100","200","300","400","500","600","700","800","900"]),l(R=>({...R,color:h,shade:R.shade?R.shade:"500"})))},[d,l]);x.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(g))return d([]);d(["50","100","200","300","400","500","600","700","800","900"])},[g]);const y=x.useCallback(h=>{l({color:g,shade:h})},[g]);return x.useEffect(()=>{l({color:"",shade:""})},[r]),x.useEffect(()=>{const R=`${t.get(Xe,s,"")}-${p.color}${p.shade?`-${p.shade}`:""}`;R.match(new RegExp(t.get(O.CLASSES_LIST,`${s}.regExp`,"")))&&o(R,s)},[p,o,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(Q,{disabled:!i,rounded:!0,selected:g,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(Q,{rounded:!0,selected:c,disabled:!g||!i,onChange:y,options:a})})]})},ie=(s,o)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&o.includes(r))return{value:"",unit:r};const n=o.length?new RegExp(o.join("|"),"g"):/XXXXXX/g;r=r.replace(n,"");const i=s.match(n),a=i&&i.length>1,d=!t.isEmpty(r)&&Number.isNaN(Number(r));return a||d?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}},Ze=s=>{const o=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${o}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${o}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const n=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[n,i]=t.map(r.split("/"),a=>parseInt(a,10));return{value:o+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${o+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}},Ue=s=>{if(t.isEmpty(s))return{value:"",unit:""};const o=s.match(/\[.*\]/g);if(o===null)return Ge(s);const r=t.get(o,"0","").replace(/\[|\]/g,""),n=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:r.replace(i,"")}},Ge=s=>t.isEmpty(s)?{value:"",unit:""}:Ze(s),xe=x.createContext({setDragData:()=>{}}),Ke=({unit:s,currentValue:o,onDrag:r,onDragEnd:n,onDragStart:i,negative:a,cssProperty:d})=>{const{setDragData:p}=x.useContext(xe);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:l=>{const m={onDrag:r,onDragEnd:n,dragging:!0,dragStartY:l.pageY,dragStartValue:`${o}`,dragUnit:s,negative:a,cssProperty:d};i(m),p(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Je=({onSelect:s,current:o,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(n=>e.jsxRuntimeExports.jsx(E.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:o===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(n)},children:n},n))}),Qe=s=>{const[o,r]=x.useState(!1),[n,i]=x.useState(""),{currentClass:a,onChange:d,classPrefix:p,cssProperty:l,units:m,negative:g}=s,[c,b]=x.useState(l!=null&&l.toLowerCase().includes("width")?"%":m[0]),[y,h]=x.useState(!1),[R,N]=x.useState(""),[B,w]=x.useState(!1),[V,A]=x.useState(!1);x.useEffect(()=>{const{value:j,unit:v}=Ue(a);if(v===""){i(j),b(l!=null&&l.toLowerCase().includes("width")?"%":m[0]);return}b(v),i(v==="class"||t.isEmpty(j)?"":j)},[a,l,m]);const k=G.useThrottledCallback(j=>{d(j)},[d],200),H=G.useThrottledCallback(j=>{d(j,!1)},[d],200),L=x.useCallback((j=!1)=>{const v=ie(`${n}`,m);if(t.get(v,"error",!1)){h(!0);return}const S=t.get(v,"unit")!==""?t.get(v,"unit"):c;if(S==="auto"||S==="none"){k(`${p}${S}`);return}if(t.get(v,"value")==="")return;const q=`${t.get(v,"value","").startsWith("-")?"-":""}${p}[${t.get(v,"value","").replace("-","")}${S==="-"?"":S}]`;j?H(q):k(q)},[k,H,n,c,p,m]),F=x.useCallback(j=>{const v=ie(`${n}`,m);if(t.get(v,"error",!1)){h(!0);return}if(j==="auto"||j==="none"){k(`${p}${j}`);return}if(t.get(v,"value")==="")return;const S=t.get(v,"unit")!==""?t.get(v,"unit"):j,q=`${t.get(v,"value","").startsWith("-")?"-":""}${p}[${t.get(v,"value","").replace("-","")}${S==="-"?"":S}]`;k(q)},[k,n,p,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:c==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(E.Tooltip,{children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(E.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${B?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(c)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:c==="class",onKeyPress:j=>{j.key==="Enter"&&L()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),A(!0);const v=t.parseInt(j.target.value);let S=t.isNaN(v)?0:v;j.keyCode===38&&(S+=1),j.keyCode===40&&(S-=1);const D=`${S}`,ge=`${D.startsWith("-")?"-":""}${p}[${D.replace("-","")}${c==="-"?"":c}]`;H(ge)},onKeyUp:j=>{V&&(j.preventDefault(),A(!1))},onBlur:()=>L(),onChange:j=>{h(!1),i(j.target.value)},onClick:j=>{var v;(v=j==null?void 0:j.target)==null||v.select(),r(!1)},value:B?R:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",y?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(E.Tooltip,{open:o,delayDuration:100,children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:c}),m.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(E.TooltipPortal,{children:e.jsxRuntimeExports.jsx(E.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Je,{units:m,current:c,onSelect:j=>{r(!1),b(j),F(j)}})})})]})]}),["none","auto"].indexOf(c)!==-1||B?null:e.jsxRuntimeExports.jsx(Ke,{onDragStart:()=>w(!0),onDragEnd:j=>{if(N(()=>""),w(!1),t.isEmpty(j))return;const v=`${j}`,D=`${v.startsWith("-")?"-":""}${p}[${v.replace("-","")}${c==="-"?"":c}]`;k(D)},onDrag:j=>{if(t.isEmpty(j))return;N(j);const v=`${j}`,D=`${v.startsWith("-")?"-":""}${p}[${v.replace("-","")}${c==="-"?"":c}]`;H(D)},currentValue:n,unit:c,negative:g,cssProperty:l})]})})})},W=s=>{const o=f.useSelectedBlockCurrentClasses();return t.findLast(o,{property:s})},et=(s,o)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[o]},tt={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},le={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},st=s=>`${s.toUpperCase()} ${le[s]?`(${le[s]} & up)`:""}`,te=s=>{const{type:o="icons",label:r,property:n,onEmitChange:i=()=>{},units:a,negative:d=!1}=s,[p]=f.useDarkMode(),[l]=f.useStylingState(),[,m]=f.useCanvasWidth(),g=W(n),c=f.useAddClassesToBlocks(),b=f.useRemoveClassesFromBlocks(),[y]=f.useSelectedBlockIds(),h=x.useMemo(()=>t.get(g,"fullCls",""),[g]),R=x.useCallback((k,H=!0)=>{const L={dark:p,mq:m,mod:l,cls:k,property:n,fullCls:""};(p||l!=="")&&(L.mq="xs");const F=O.generateFullClsName(L);c(y,[F],H)},[y,p,m,l,n,c]),N=x.useCallback(()=>{b(y,[h])},[y,h,b]),B=x.useMemo(()=>et(g,m),[g,m]);x.useEffect(()=>{i(B,g)},[B,i,g]);const[,,w]=f.useCanvasWidth(),V=x.useCallback(k=>{w({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[k])},[w]),A=t.get(g,"dark",null)===p&&t.get(g,"mod",null)===l&&t.get(g,"mq",null)===m;return e.jsxRuntimeExports.jsx(We,{canChange:B,canReset:g&&A,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${g&&!A?"text-foreground":""}`,children:r})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[o==="arbitrary"?e.jsxRuntimeExports.jsx(Qe,{currentClass:t.get(g,"cls",""),classPrefix:t.get(tt,n,""),units:a||[],onChange:R,negative:d,cssProperty:n}):null,o==="icons"&&e.jsxRuntimeExports.jsx(Ye,{property:n,onChange:R}),o==="range"&&e.jsxRuntimeExports.jsx(Fe,{property:n,onChange:R}),o==="color"&&e.jsxRuntimeExports.jsx(ze,{property:n,onChange:R}),o==="dropdown"&&e.jsxRuntimeExports.jsx(ce,{label:r,property:n,onChange:R})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${h?"visible":"invisible"}`,children:A?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>N(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.TrashIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):B&&g?e.jsxRuntimeExports.jsxs(E.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(E.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[st(t.get(g,"mq")),p&&!g.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>V(t.get(g,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(g,"mq").toUpperCase()]})]})})})]}):null})]})]})})},rt=["px","%","em","rem","ch","vh","vw"],me=({label:s,options:o,borderB:r=!1,borderT:n=!1,type:i="arbitrary",units:a=rt,negative:d=!1})=>{const[p,l]=x.useState(o[0].key),m=f.useSelectedBlockCurrentClasses(),g=x.useCallback(c=>t.map(m,"property").includes(c),[m]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:s}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:x.Children.toArray(o.map(({label:c,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(E.Tooltip,{children:[e.jsxRuntimeExports.jsx(E.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[x.createElement("div",{className:g(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),x.createElement(t.get(de,b,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(E.TooltipContent,{children:t.startCase(t.toLower(c))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(te,{type:i,units:[...a],label:"",property:p,negative:d})})]})},ot=({heading:s,items:o})=>{const r=f.useSelectedBlockCurrentClasses(),n=x.useMemo(()=>{const i=p=>t.flatten(p.map(l=>l.styleType==="multiple"?t.map(l.options,"key"):l.property)),a=t.flatten(o.map(p=>p.styleType==="accordion"?i(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),d=t.map(r,"property");return t.intersection(a,d).length>0},[r,o]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[s,n?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:o.map(i=>i.styleType==="multiple"?e.jsxRuntimeExports.jsx(me,{...i},i.label):e.jsxRuntimeExports.jsx(te,{...i},i.label))})]})},nt=x.createContext({}),U=({section:s})=>{const o=f.useSelectedBlockCurrentClasses(),r=x.useCallback((a=[])=>{const d={};for(let l=0;l<o.length;l++)d[o[l].property]=o[l].cls;let p=!0;for(const l in a)if(!t.has(d,l)||d[l]!==a[l]){p=!1;break}return p},[o]),n=x.useMemo(()=>{if(o.length>0&&s.heading==="Classes")return!0;const a=l=>t.flatten(l.map(m=>m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),d=t.flatten(s.items.map(l=>l.styleType==="accordion"?a(l.items):l.styleType==="multiple"?t.flatten(t.map(l.options,"key")):l.property)),p=t.map(o,"property");return t.intersection(d,p).length>0},[o,s.heading,s.items]),i=x.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(nt.Provider,{value:i,children:e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}),s.heading]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:x.Children.toArray(s.items.map(a=>t.has(a,"component")?x.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(me,{...a},a.label):a.styleType==="accordion"&&r(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(ot,{...a},a.label):null:e.jsxRuntimeExports.jsx(te,{...a},a.label)))})]})})},it=({item:s,index:o,canDelete:r,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:a=>n(a,o),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:a=>t.isEmpty(s.key)?{}:n(a,o),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),lt=({section:s})=>{var b;const{setSyncState:o}=f.useSavePage(),r=f.useSelectedBlock(),[n,i]=x.useState([]),[a]=f.useSelectedStylingBlocks(),d=f.useUpdateBlocksPropsRealtime(),p=`${t.get(a,"0.prop")}_attrs`;X.useEffect(()=>{const y=t.map(t.get(r,p),(h,R)=>({key:R,value:h}));t.isEmpty(y)?i([]):i(y)},[t.get(r,p)]);const l=()=>i([...n,{key:"",value:""}]),m=y=>{const h=t.filter(n,(R,N)=>y!==N);c(h)},g=(y,h)=>{const R=[...n];R[h][y.target.name]=y.target.value,c(R)},c=X.useCallback((y=[])=>{const h={};t.forEach(y,R=>{t.isEmpty(R.key)||t.set(h,R.key,R.value)}),d([t.get(r,"_id")],{[p]:h}),o("UNSAVED")},[r,o,d,p]);return e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,p))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(ee.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((b=t.last(n))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var y;!t.isEmpty(n)&&t.isEmpty((y=t.last(n))==null?void 0:y.key)||l()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),X.Children.toArray(t.map(n,(y,h)=>{const R=n.length>0&&h<n.length-1;return e.jsxRuntimeExports.jsx(it,{item:y,index:h,canDelete:R,onChange:g,onRemove:()=>m(h)})}))]})]})})]})};function at(){const[s,o]=f.useStylingState(),{flexChild:r,gridChild:n}=f.useSelectedBlocksDisplayChild(),[,i]=Ce.useAtom(f.advanceStylingOpenAtom),{t:a}=ae.useTranslation(),[d]=f.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:a("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(ee.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(C.Select,{defaultValue:s,onValueChange:p=>o(p),children:[e.jsxRuntimeExports.jsx(C.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(C.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(C.SelectContent,{children:[e.jsxRuntimeExports.jsx(C.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(Te.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",className:"h-full w-full",children:[r&&e.jsxRuntimeExports.jsx(U,{section:Oe}),n?e.jsxRuntimeExports.jsx(U,{section:qe}):null,_e.map(p=>e.jsxRuntimeExports.jsx(U,{section:p},p.heading)),e.jsxRuntimeExports.jsx(lt,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const pt={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},ut=()=>{const s=f.useSelectedBlock(),{t:o}=ae.useTranslation(),[r,n]=x.useState(""),[i,a]=x.useState({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),d=G.useThrottledCallback(l=>{const m=!t.get(i,"negative",!1),g=t.get(i,"cssProperty","");let c=parseFloat(i.dragStartValue);c=t.isNaN(c)?0:c;let b=pt[i.dragUnit];(t.startsWith(g,"scale")||g==="opacity")&&(b=10);let h=(i.dragStartY-l.pageY)/b+c;m&&h<0&&(h=0),g==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),n(`${h}`)},[i],50),p=x.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),a({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,a]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:o("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsxs(xe.Provider,{value:{setDragData:a},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:d,onMouseUp:()=>p(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs(M.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(M.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(M.TabsTrigger,{value:"settings",children:"Settings"}),e.jsxRuntimeExports.jsx(M.TabsTrigger,{value:"styling",children:"Styling"})]}),e.jsxRuntimeExports.jsx(M.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx($e,{})}),e.jsxRuntimeExports.jsx(M.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(at,{})})]})]})};exports.default=ut;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var P=Object.create;var q=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var K=(s,o,r,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of T(o))!B.call(s,l)&&l!==r&&q(s,l,{get:()=>o[l],enumerable:!(u=A(o,l))||u.enumerable});return s};var V=(s,o,r)=>(r=s!=null?P(z(s)):{},K(o||!s||!s.__esModule?q(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),k=require("@radix-ui/react-icons"),i=require("react"),N=require("jotai"),x=require("lodash"),n=require("./useBuilderProp-adacf42f.cjs"),h=require("./tabs-860e37aa.cjs"),E=require("./index-c535cc95.cjs");require("react-i18next");const I=require("./utils-3c452dd0.cjs"),w=require("lucide-react"),L=require("@chaibuilder/blocks"),g=require("./dialog-170eaad9.cjs"),v=require("./select-0e32300c.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./MODIFIERS-4716c669.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const M=i.lazy(()=>import("react-json-view")),H=({provider:s,onClose:o})=>{const[r,u]=i.useState(null);return i.useEffect(()=>{s&&(s.mockFn?s.mockFn:s.dataFn)().then(d=>u(d))},[s]),s?e.jsxRuntimeExports.jsx(g.Dialog,{onOpenChange:l=>l?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(g.DialogContent,{children:[e.jsxRuntimeExports.jsxs(g.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(g.DialogTitle,{children:["Data Provider: ",s.name]}),e.jsxRuntimeExports.jsx(g.DialogDescription,{children:s.description})]}),e.jsxRuntimeExports.jsx(E.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(M,{style:{maxHeight:"80vh",overflowY:"auto"},name:s.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:r})})]})}):null};function O({children:s,name:o,onRemove:r}){return e.jsxRuntimeExports.jsxs(n.AlertDialog,{children:[e.jsxRuntimeExports.jsx(n.AlertDialogTrigger,{asChild:!0,children:s}),e.jsxRuntimeExports.jsxs(n.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(n.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(n.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:o})," provider?"]}),e.jsxRuntimeExports.jsx(n.AlertDialogDescription,{children:"Your data provider will be removed from this page and all added data binding will be not visible on blocks."})]}),e.jsxRuntimeExports.jsxs(n.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(n.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(n.AlertDialogAction,{onClick:r,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const F=()=>{const s=i.useMemo(()=>L.getChaiDataProviders(),[]),[o,r]=E.usePageDataProviders(),[,u]=N.useAtom(E.pageSyncStateAtom),[l,d]=i.useState(x.filter(s,t=>x.map(o,"providerKey").includes(t.providerKey))),[j,y]=i.useState(""),[R,c]=i.useState(null),b=x.filter(s.map(t=>x.map(l,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!x.isNull(t)),a=t=>{const p=x.find(s,{providerKey:t});d(m=>[...m,p]),r(m=>[...m,{providerKey:p.providerKey,args:{}}]),y(""),u("UNSAVED")},f=t=>{d(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),r(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),u("UNSAVED")},D=t=>c(t);return x.isEmpty(s)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(v.Select,{value:j,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(v.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(v.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(v.SelectContent,{children:[e.jsxRuntimeExports.jsx(v.SelectItem,{value:"",children:"Choose"}),b.map(t=>e.jsxRuntimeExports.jsx(v.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${l.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:"Page data providers:"}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>D(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"View Data"]}),e.jsxRuntimeExports.jsx(O,{onRemove:()=>f(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Remove"]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(H,{onClose:()=>c(null),provider:R})]})]})},C=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-ecba52c1.cjs"))),Y=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-d3b3309a.cjs"))),_=i.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-8b7a989d.cjs")));let S=null;const U=()=>{const s=n.useBuilderProp("sideBarComponents.top",[]),o=n.useBuilderProp("sideBarComponents.bottom",[]),[r,u]=N.useAtom(E.activePanelAtom),[l,d]=i.useState(r),[j,y]=i.useState(null),R={layers:C,"branding-options":Y,images:_};x.each(s,({name:a,panel:f})=>{R[a]=f});const c=a=>{clearTimeout(S),b(!1),r!=="layers"&&a==="layers"?S=setTimeout(()=>d("layers"),500):d(a),u(a)},[,b]=N.useAtom(E.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>{b(!0),u("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(s.map(({name:a,icon:f})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(n.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c(a),size:"sm",className:"w-10",variant:r===a?"default":"outline",children:e.jsxRuntimeExports.jsx(f,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(n.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{c("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(r==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:I.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{j&&clearTimeout(j)},onMouseLeave:()=>{const a=setTimeout(()=>{j&&(c("layers"),clearTimeout(j))},1e3);y(a)},children:i.createElement(x.get(R,l,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(h.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(h.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(h.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(w.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(h.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(w.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(h.TabsContent,{value:"layers",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(C)}),e.jsxRuntimeExports.jsx(h.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(F,{})})]})})})]})};exports.default=U;
|
package/dist/Topbar-3b9db9f3.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),n=require("react"),o=require("@radix-ui/react-icons"),r=require("./select-0e32300c.cjs"),s=require("./useBuilderProp-adacf42f.cjs"),a=require("./separator-a597dba7.cjs"),c=require("./toggle-b90fed97.cjs"),p=require("./index-c535cc95.cjs"),m=require("react-i18next");require("@radix-ui/react-select");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const j=()=>s.useBuilderProp("languages",["en"]),d=()=>j().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),h=()=>{const{savePage:x,syncState:t}=p.useSavePage(),{t:u}=m.useTranslation(),l=n.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(c.Toggle,{onClick:()=>x(),className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${l}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),t==="SAVING"?"Saving...":t==="SAVED"?u("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},g=()=>{const x=s.useBuilderProp("topBarComponents.left",[]),t=s.useBuilderProp("topBarComponents.center",[]),u=s.useBuilderProp("topBarComponents.right",[]),l=s.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(x.map(i=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(t.map(i=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(a.Separator,{orientation:"vertical"}),l?e.jsxRuntimeExports.jsx(h,{}):null,n.Children.toArray(u.map(i=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i,{})})))]})]})};exports.default=g;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),o=require("lodash"),k=require("@radix-ui/react-icons"),T=require("unsplash-js"),b=require("./useBuilderProp-adacf42f.cjs"),z=require("./command-b1103666.cjs"),_=require("./scroll-area-bb343b86.cjs"),g=require("./popover-7cb9079b.cjs"),t=require("./select-0e32300c.cjs");require("react-i18next");const D=require("@react-hookz/web"),L=require("lucide-react");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("cmdk");require("./dialog-170eaad9.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-scroll-area");require("@radix-ui/react-popover");require("@radix-ui/react-select");const R=async(d,E)=>new Promise((l,a)=>{T.createApi({accessKey:E}).search.getPhotos(d).then(c=>{l(c)}).catch(c=>a(c))}),V=({isModalView:d,onSelect:E})=>{const l=b.useBuilderProp("unsplashAccessKey"),[a,f]=i.useState([]),[c,y]=i.useState(0),[x,I]=i.useState(),[u,w]=i.useState(),[P,v]=i.useState(0),[j,C]=D.useDebouncedState("",1e3),[h,m]=i.useState(!1),A=async s=>{if(o.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),y(n);const p={query:j,page:n};x&&(p.orientation=x),u&&(p.color=u),R(p,l).then(r=>{var q,N,S;f(n===1?((q=r==null?void 0:r.response)==null?void 0:q.results)||[]:[...a,...((N=r==null?void 0:r.response)==null?void 0:N.results)||[]]),v((S=r==null?void 0:r.response)==null?void 0:S.total_pages),m(!1)}).catch(()=>{m(!1)})};return i.useEffect(()=>{if(!o.isEmpty(j)){m(!0);const s={query:j,page:1};x&&(s.orientation=x),u&&(s.color=u),y(1),R(s,l).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),v((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[x,u,j,l]),o.isEmpty(l)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(z.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>C(s.target.value)}),e.jsxRuntimeExports.jsxs(g.Popover,{children:[e.jsxRuntimeExports.jsx(g.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(k.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(g.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>I(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>w(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:o.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(_.ScrollArea,{className:`h-full ${d&&!o.isEmpty(a)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[o.isEmpty(a)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:a.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):a.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(L.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!o.isEmpty(a)&&c<P&&!h&&e.jsxRuntimeExports.jsx(b.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>A(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=V;exports.fetchImage=R;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),t=require("react"),a=require("lodash"),m=require("@radix-ui/react-icons"),E=require("jotai"),q=require("./scroll-area-bb343b86.cjs");require("react-i18next");const b=require("./useBuilderProp-adacf42f.cjs");require("@radix-ui/react-scroll-area");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const I=E.atom([]),w=({isModalView:r,onSelect:u})=>{const R=b.useBuilderProp("uploadMediaCallback",()=>""),c=b.useBuilderProp("fetchMediaCallback",()=>[]),[n,o]=E.useAtom(I),[l,p]=t.useState(!1),[j,h]=t.useState(!1),[x,d]=t.useState(),[f,v]=t.useState("");t.useEffect(()=>{(async()=>{h(!0);const s=await c();o(s||[]),h(!1)})()},[c,o]);const y=s=>{var i,g;s&&((g=(i=s==null?void 0:s.target)==null?void 0:i.files)==null?void 0:g.length)>0&&d(s.target.files[0])},N=async()=>{p(!0);try{const{url:s}=await R(x);u(s),d(void 0);const i=await c();o(i)}catch(s){o([]),v((s==null?void 0:s.message)||"Something went wrong.")}p(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(x),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),f&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:f}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:N,disabled:l,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[l?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",l?"Uploading...":"Upload"]}),!l&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:r?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:r?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:y})]}),e.jsxRuntimeExports.jsxs(q.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${r?"px-2":""} pt-2`,children:[a.isEmpty(n)&&j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),a.isEmpty(n)&&!j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),r?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:a.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>u(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):a.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>u(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=w;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-adacf42f.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-ea21db6c.cjs"),f=require("./index-c535cc95.cjs");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-24679521.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-8b7a989d.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("lucide-react");const E=({closeModal:i})=>{var l,o;const s=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{s.mutate(r,{onSuccess:()=>i()})},j=({formData:u},t)=>{m(h=>{var d,c;const n={[t]:u[t]};return t==="name"?n.slug=R.kebabCase((d=u[t])==null?void 0:d.replace(/\d/g,"")):t==="slug"&&(n.slug=(c=u[t])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...h,...n}})},P={name:q.SingleLineText({title:"Page Name",default:r.name}),slug:q.SingleLineText({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:P,onChange:j,disabled:s.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||s.isPending,onClick:p,children:"Add Page"})})]})},S=()=>{const[i,s]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:i,onOpenChange:()=>s(!i),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>s(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>s(!i)})]})};exports.default=S;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import { A as n, d as p, f as c, g as x, i as d, B as j } from "./useBuilderProp-21feb2da.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "@radix-ui/react-alert-dialog";
|
|
5
|
-
import "./utils-ac68b2c8.js";
|
|
6
|
-
import "clsx";
|
|
7
|
-
import "tailwind-merge";
|
|
8
|
-
import "@radix-ui/react-slot";
|
|
9
|
-
import "class-variance-authority";
|
|
10
|
-
import "@radix-ui/react-tooltip";
|
|
11
|
-
import "@radix-ui/react-icons";
|
|
12
|
-
import "@radix-ui/react-toast";
|
|
13
|
-
import "jotai";
|
|
14
|
-
import "lodash";
|
|
15
|
-
const S = ({
|
|
16
|
-
open: o,
|
|
17
|
-
onCancel: e = () => {
|
|
18
|
-
},
|
|
19
|
-
onConfirm: l,
|
|
20
|
-
title: s,
|
|
21
|
-
description: r,
|
|
22
|
-
disabled: t,
|
|
23
|
-
cancelText: a = "Discard",
|
|
24
|
-
confirmText: m = "Save"
|
|
25
|
-
}) => /* @__PURE__ */ i.jsx(n, { open: o, children: /* @__PURE__ */ i.jsxs(p, { children: [
|
|
26
|
-
/* @__PURE__ */ i.jsx(c, { children: s }),
|
|
27
|
-
r && /* @__PURE__ */ i.jsx(x, { children: r }),
|
|
28
|
-
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
29
|
-
/* @__PURE__ */ i.jsx(d, { disabled: t, onClick: e, children: a }),
|
|
30
|
-
/* @__PURE__ */ i.jsx(j, { variant: "default", onClick: l, disabled: t, children: m })
|
|
31
|
-
] })
|
|
32
|
-
] }) });
|
|
33
|
-
export {
|
|
34
|
-
S as default
|
|
35
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("./useBuilderProp-adacf42f.cjs");require("react");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("lodash");const c=({open:s,onCancel:u=()=>{},onConfirm:n,title:l,description:i,disabled:t,cancelText:o="Discard",confirmText:x="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:s,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:l}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t,onClick:u,children:o}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:n,disabled:t,children:x})]})]})});exports.default=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("./useBuilderProp-adacf42f.cjs"),l=require("./index-c535cc95.cjs"),d=require("@radix-ui/react-icons");require("react");require("@radix-ui/react-alert-dialog");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const x=({pageData:i,projectData:s})=>{const n={},t=l.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(d.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|