@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var A=Object.create;var k=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var V=(s,n,r,x)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of z(n))!K.call(s,o)&&o!==r&&k(s,o,{get:()=>n[o],enumerable:!(x=T(n,o))||x.enumerable});return s};var I=(s,n,r)=>(r=s!=null?A(B(s)):{},V(n||!s||!s.__esModule?k(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),C=require("@radix-ui/react-icons"),i=require("react"),q=require("jotai"),a=require("lodash"),d=require("./skeleton-JHP9zwL2.cjs"),v=require("./tabs-iWeaaVrg.cjs"),R=require("./ChaiBuilderEditor-SacH75l4.cjs");require("react-i18next");const L=require("./utils-qK_SjzzV.cjs"),N=require("lucide-react"),M=require("@chaibuilder/blocks"),u=require("./alert-dialog-Mv0-wAvS.cjs"),E=require("./dialog-S_QbL1iq.cjs"),f=require("./select-7bjg-rr9.cjs");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-Fx6WAZcw.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("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("tailwind-merge");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const H=i.lazy(()=>import("react-json-view")),O=({provider:s,onClose:n})=>{const[r,x]=i.useState(null);return i.useEffect(()=>{s&&(s.mockFn?s.mockFn:s.dataFn)().then(m=>x(m))},[s]),s?e.jsxRuntimeExports.jsx(E.Dialog,{onOpenChange:o=>o?"":n(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(E.DialogContent,{children:[e.jsxRuntimeExports.jsxs(E.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(E.DialogTitle,{children:["Data Provider: ",s.name]}),e.jsxRuntimeExports.jsx(E.DialogDescription,{children:s.description})]}),e.jsxRuntimeExports.jsx(R.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(H,{style:{maxHeight:"80vh",overflowY:"auto"},name:s.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:r})})]})}):null};function F({children:s,name:n,onRemove:r}){return e.jsxRuntimeExports.jsxs(u.AlertDialog,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogTrigger,{asChild:!0,children:s}),e.jsxRuntimeExports.jsxs(u.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:n})," provider?"]}),e.jsxRuntimeExports.jsx(u.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(u.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(u.AlertDialogAction,{onClick:r,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const Y=()=>{const s=i.useMemo(()=>M.getChaiDataProviders(),[]),[n,r]=R.usePageDataProviders(),[,x]=q.useAtom(R.pageSyncStateAtom),[o,m]=i.useState(a.filter(s,t=>a.map(n,"providerKey").includes(t.providerKey))),[p,w]=i.useState(""),[b,c]=i.useState(null),y=a.filter(s.map(t=>a.map(o,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!a.isNull(t)),l=t=>{const h=a.find(s,{providerKey:t});m(j=>[...j,h]),r(j=>[...j,{providerKey:h.providerKey,args:{}}]),w(""),x("UNSAVED")},g=t=>{m(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),r(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),x("UNSAVED")},P=t=>c(t);return a.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(f.Select,{value:p,onValueChange:t=>l(t),children:[e.jsxRuntimeExports.jsx(f.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(f.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(f.SelectContent,{children:[e.jsxRuntimeExports.jsx(f.SelectItem,{value:"",children:"Choose"}),y.map(t=>e.jsxRuntimeExports.jsx(f.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${o.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:o.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:()=>P(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(F,{onRemove:()=>g(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(O,{onClose:()=>c(null),provider:b})]})]})},D=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-Vw4XE6YB.cjs"))),_=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-DpJ-oNnf.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-6us7hiLN.cjs")));let S=null;const $=()=>{const s=d.useBuilderProp("sideBarComponents.top",[]),n=d.useBuilderProp("sideBarComponents.bottom",[]),[r,x]=q.useAtom(R.activePanelAtom),[o,m]=i.useState(r),[p,w]=i.useState(null),b={layers:D,"branding-options":_,images:U};a.each(s,({name:l,panel:g})=>{b[l]=g});const c=l=>{clearTimeout(S),y(!1),r!=="layers"&&l==="layers"?S=setTimeout(()=>m("layers"),500):m(l),x(l)},[,y]=q.useAtom(R.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(d.Button,{onClick:()=>{y(!0),x("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(s.map(({name:l,icon:g})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c(l),size:"sm",className:"w-10",variant:r===l?"default":"outline",children:e.jsxRuntimeExports.jsx(g,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(l,{})})))})]}),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:L.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{p&&clearTimeout(p)},onMouseLeave:()=>{const l=setTimeout(()=>{p&&(c("layers"),clearTimeout(p))},1e3);w(l)},children:i.createElement(a.get(b,o,()=>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(v.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(v.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(N.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(D)}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Y,{})})]})})})]})};exports.default=$;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { PlusIcon as V, Half2Icon as E } from "@radix-ui/react-icons";
|
|
3
3
|
import h, { useMemo as L, useState as u, useEffect as M, lazy as N, Suspense as j } from "react";
|
|
4
4
|
import { useAtom as w } from "jotai";
|
|
5
5
|
import { filter as g, map as k, isNull as H, isEmpty as I, find as R, each as _, get as F } from "lodash";
|
|
6
|
-
import {
|
|
7
|
-
import { T as
|
|
8
|
-
import {
|
|
6
|
+
import { u as C, B as b, S as D } from "./skeleton-CU_FIbg3.js";
|
|
7
|
+
import { T as O, a as Y, b as A, c as P } from "./tabs-Gb9v5dVb.js";
|
|
8
|
+
import { t as U, v as $, E as J, w as Z, x as q } from "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
9
9
|
import "react-i18next";
|
|
10
|
-
import { c as
|
|
11
|
-
import { ListTreeIcon as S, DatabaseIcon as
|
|
12
|
-
import { getChaiDataProviders as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "
|
|
10
|
+
import { c as G } from "./utils-dze1SGvB.js";
|
|
11
|
+
import { ListTreeIcon as S, DatabaseIcon as Q } from "lucide-react";
|
|
12
|
+
import { getChaiDataProviders as W } from "@chaibuilder/blocks";
|
|
13
|
+
import { A as X, a as ee, b as se, c as re, e as ae, f as le, d as ie, h as te, g as oe } from "./alert-dialog-GNfnpqFB.js";
|
|
14
|
+
import { D as ne, b as ce, c as de, e as me, f as xe } from "./dialog-jrw9DF1f.js";
|
|
15
|
+
import { S as ue, c as pe, b as he, d as fe, f as T } from "./select-POGdEDHT.js";
|
|
16
16
|
import "@radix-ui/react-slot";
|
|
17
17
|
import "class-variance-authority";
|
|
18
18
|
import "@radix-ui/react-tooltip";
|
|
19
19
|
import "@radix-ui/react-toast";
|
|
20
20
|
import "@radix-ui/react-tabs";
|
|
21
|
-
import "./MODIFIERS-
|
|
21
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
22
22
|
import "clsx";
|
|
23
23
|
import "@radix-ui/react-scroll-area";
|
|
24
24
|
import "react-dom";
|
|
@@ -29,12 +29,11 @@ import "react-dnd";
|
|
|
29
29
|
import "@minoru/react-dnd-treeview";
|
|
30
30
|
import "react-hotkeys-hook";
|
|
31
31
|
import "flat-to-nested";
|
|
32
|
-
import "./
|
|
33
|
-
import "himalaya";
|
|
32
|
+
import "./functions-pcUZhFJM.js";
|
|
34
33
|
import "redux-undo";
|
|
35
34
|
import "@react-hookz/web";
|
|
36
|
-
import "sonner";
|
|
37
35
|
import "tailwind-merge";
|
|
36
|
+
import "@radix-ui/react-alert-dialog";
|
|
38
37
|
import "@radix-ui/react-dialog";
|
|
39
38
|
import "@radix-ui/react-select";
|
|
40
39
|
const ve = h.lazy(() => import("react-json-view")), je = ({ provider: r, onClose: o }) => {
|
|
@@ -49,7 +48,7 @@ const ve = h.lazy(() => import("react-json-view")), je = ({ provider: r, onClose
|
|
|
49
48
|
] }),
|
|
50
49
|
/* @__PURE__ */ e.jsx(xe, { children: r.description })
|
|
51
50
|
] }),
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
51
|
+
/* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsx(
|
|
53
52
|
ve,
|
|
54
53
|
{
|
|
55
54
|
style: { maxHeight: "80vh", overflowY: "auto" },
|
|
@@ -67,26 +66,26 @@ function ge({
|
|
|
67
66
|
name: o,
|
|
68
67
|
onRemove: a
|
|
69
68
|
}) {
|
|
70
|
-
return /* @__PURE__ */ e.jsxs(
|
|
71
|
-
/* @__PURE__ */ e.jsx(
|
|
72
|
-
/* @__PURE__ */ e.jsxs(
|
|
73
|
-
/* @__PURE__ */ e.jsxs(
|
|
74
|
-
/* @__PURE__ */ e.jsxs(
|
|
69
|
+
return /* @__PURE__ */ e.jsxs(X, { children: [
|
|
70
|
+
/* @__PURE__ */ e.jsx(ee, { asChild: !0, children: r }),
|
|
71
|
+
/* @__PURE__ */ e.jsxs(se, { children: [
|
|
72
|
+
/* @__PURE__ */ e.jsxs(re, { children: [
|
|
73
|
+
/* @__PURE__ */ e.jsxs(ae, { children: [
|
|
75
74
|
"Are you sure, you want to remove ",
|
|
76
75
|
/* @__PURE__ */ e.jsx("span", { className: "text-blue-500", children: o }),
|
|
77
76
|
" provider?"
|
|
78
77
|
] }),
|
|
79
|
-
/* @__PURE__ */ e.jsx(
|
|
78
|
+
/* @__PURE__ */ e.jsx(le, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
|
|
80
79
|
] }),
|
|
81
|
-
/* @__PURE__ */ e.jsxs(
|
|
82
|
-
/* @__PURE__ */ e.jsx(
|
|
83
|
-
/* @__PURE__ */ e.jsx(
|
|
80
|
+
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
81
|
+
/* @__PURE__ */ e.jsx(te, { children: "Cancel" }),
|
|
82
|
+
/* @__PURE__ */ e.jsx(oe, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
|
|
84
83
|
] })
|
|
85
84
|
] })
|
|
86
85
|
] });
|
|
87
86
|
}
|
|
88
87
|
const be = () => {
|
|
89
|
-
const r = L(() =>
|
|
88
|
+
const r = L(() => W(), []), [o, a] = U(), [, n] = w($), [i, c] = u(
|
|
90
89
|
g(r, (s) => k(o, "providerKey").includes(s.providerKey))
|
|
91
90
|
), [m, y] = u(""), [f, t] = u(null), v = g(
|
|
92
91
|
r.map((s) => k(i, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
@@ -185,10 +184,10 @@ const be = () => {
|
|
|
185
184
|
/* @__PURE__ */ e.jsx(je, { onClose: () => t(null), provider: f })
|
|
186
185
|
] })
|
|
187
186
|
] });
|
|
188
|
-
}, z = N(() => import("./Layers-
|
|
187
|
+
}, z = N(() => import("./Layers-wOfijZnb.js")), ye = N(() => import("./BrandingOptions-cHK2bVZy.js")), we = N(() => import("./ImagesPanel-oaHOD-Ex.js"));
|
|
189
188
|
let K = null;
|
|
190
|
-
const
|
|
191
|
-
const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] = w(
|
|
189
|
+
const os = () => {
|
|
190
|
+
const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] = w(Z), [i, c] = u(a), [m, y] = u(null), f = {
|
|
192
191
|
layers: z,
|
|
193
192
|
"branding-options": ye,
|
|
194
193
|
images: we
|
|
@@ -198,7 +197,7 @@ const ns = () => {
|
|
|
198
197
|
});
|
|
199
198
|
const t = (l) => {
|
|
200
199
|
clearTimeout(K), v(!1), a !== "layers" && l === "layers" ? K = setTimeout(() => c("layers"), 500) : c(l), n(l);
|
|
201
|
-
}, [, v] = w(
|
|
200
|
+
}, [, v] = w(q);
|
|
202
201
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
203
202
|
/* @__PURE__ */ e.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: [
|
|
204
203
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
@@ -272,7 +271,7 @@ const ns = () => {
|
|
|
272
271
|
children: /* @__PURE__ */ e.jsx(
|
|
273
272
|
"div",
|
|
274
273
|
{
|
|
275
|
-
className:
|
|
274
|
+
className: G("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
|
|
276
275
|
onMouseEnter: () => {
|
|
277
276
|
m && clearTimeout(m);
|
|
278
277
|
},
|
|
@@ -297,25 +296,18 @@ const ns = () => {
|
|
|
297
296
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
298
297
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
299
298
|
] }),
|
|
300
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
301
|
-
/* @__PURE__ */ e.jsxs(
|
|
299
|
+
children: /* @__PURE__ */ e.jsxs(O, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
|
|
300
|
+
/* @__PURE__ */ e.jsxs(Y, { className: "mx-1 h-10 grid grid-cols-2", children: [
|
|
302
301
|
/* @__PURE__ */ e.jsxs(A, { value: "layers", children: [
|
|
303
302
|
/* @__PURE__ */ e.jsx(S, { className: "h-3 mr-2" }),
|
|
304
303
|
" Layers"
|
|
305
304
|
] }),
|
|
306
305
|
/* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
|
|
307
|
-
/* @__PURE__ */ e.jsx(
|
|
306
|
+
/* @__PURE__ */ e.jsx(Q, { className: "w-3 mr-2" }),
|
|
308
307
|
"Data"
|
|
309
308
|
] })
|
|
310
309
|
] }),
|
|
311
|
-
/* @__PURE__ */ e.jsx(
|
|
312
|
-
P,
|
|
313
|
-
{
|
|
314
|
-
value: "layers",
|
|
315
|
-
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
316
|
-
children: h.createElement(z)
|
|
317
|
-
}
|
|
318
|
-
),
|
|
310
|
+
/* @__PURE__ */ e.jsx(P, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(z) }),
|
|
319
311
|
/* @__PURE__ */ e.jsx(P, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
|
|
320
312
|
] })
|
|
321
313
|
}
|
|
@@ -323,5 +315,5 @@ const ns = () => {
|
|
|
323
315
|
] });
|
|
324
316
|
};
|
|
325
317
|
export {
|
|
326
|
-
|
|
318
|
+
os as default
|
|
327
319
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),a=require("@radix-ui/react-icons"),s=require("./select-7bjg-rr9.cjs"),r=require("./skeleton-JHP9zwL2.cjs"),o=require("./separator-3Civ-6hb.cjs"),c=require("./toggle-ehNIPmme.cjs"),p=require("./ChaiBuilderEditor-SacH75l4.cjs"),m=require("react-i18next");require("@radix-ui/react-select");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("jotai");require("lodash");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("./MODIFIERS-Fx6WAZcw.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("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");const j=()=>r.useBuilderProp("languages",["en"]),d=()=>j().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(s.SelectContent,{children:e.jsxRuntimeExports.jsxs(s.SelectGroup,{children:[e.jsxRuntimeExports.jsx(s.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),h=()=>{const{savePage:x,syncState:t}=p.useSavePage(),{t:l}=m.useTranslation(),u=i.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(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(c.Toggle,{onClick:n=>{n.preventDefault(),x()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,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"?l("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},g=()=>{const x=r.useBuilderProp("topBarComponents.left",[]),t=r.useBuilderProp("topBarComponents.center",[]),l=r.useBuilderProp("topBarComponents.right",[]),u=r.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:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(t.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(h,{}):null,i.Children.toArray(l.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=g;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import o, { useMemo as
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import o, { useMemo as m, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import { S as d, c as h, b as u, d as g, a as j, e as f, f as
|
|
5
|
-
import { u as a,
|
|
6
|
-
import { S as N } from "./separator-
|
|
7
|
-
import { T as C } from "./toggle-
|
|
8
|
-
import {
|
|
4
|
+
import { S as d, c as h, b as u, d as g, a as j, e as f, f as r } from "./select-POGdEDHT.js";
|
|
5
|
+
import { u as a, T as v, a as S, c as b, S as p } from "./skeleton-CU_FIbg3.js";
|
|
6
|
+
import { S as N } from "./separator-SctTn0Qi.js";
|
|
7
|
+
import { T as C } from "./toggle-ASJRAaGP.js";
|
|
8
|
+
import { p as w } from "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
9
9
|
import { useTranslation as y } from "react-i18next";
|
|
10
10
|
import "@radix-ui/react-select";
|
|
11
|
-
import "./utils-
|
|
11
|
+
import "./utils-dze1SGvB.js";
|
|
12
12
|
import "clsx";
|
|
13
13
|
import "tailwind-merge";
|
|
14
|
-
import "
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "lodash";
|
|
15
16
|
import "@radix-ui/react-slot";
|
|
16
17
|
import "class-variance-authority";
|
|
17
18
|
import "@radix-ui/react-tooltip";
|
|
18
19
|
import "@radix-ui/react-toast";
|
|
19
|
-
import "jotai";
|
|
20
|
-
import "lodash";
|
|
21
20
|
import "@radix-ui/react-separator";
|
|
22
21
|
import "@radix-ui/react-toggle";
|
|
23
|
-
import "./MODIFIERS-
|
|
22
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
24
23
|
import "@radix-ui/react-scroll-area";
|
|
25
24
|
import "react-dom";
|
|
26
25
|
import "@floating-ui/react-dom";
|
|
@@ -30,13 +29,10 @@ import "react-dnd";
|
|
|
30
29
|
import "@minoru/react-dnd-treeview";
|
|
31
30
|
import "react-hotkeys-hook";
|
|
32
31
|
import "flat-to-nested";
|
|
33
|
-
import "./
|
|
34
|
-
import "himalaya";
|
|
32
|
+
import "./functions-pcUZhFJM.js";
|
|
35
33
|
import "redux-undo";
|
|
36
34
|
import "@react-hookz/web";
|
|
37
35
|
import "@chaibuilder/blocks";
|
|
38
|
-
import "sonner";
|
|
39
|
-
import "lucide-react";
|
|
40
36
|
const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
|
|
41
37
|
/* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
42
38
|
u,
|
|
@@ -49,15 +45,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
49
45
|
) }),
|
|
50
46
|
/* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsxs(j, { children: [
|
|
51
47
|
/* @__PURE__ */ e.jsx(f, { children: "Fruits" }),
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
53
|
-
/* @__PURE__ */ e.jsx(
|
|
54
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
-
/* @__PURE__ */ e.jsx(
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
48
|
+
/* @__PURE__ */ e.jsx(r, { value: "apple", children: "Apple" }),
|
|
49
|
+
/* @__PURE__ */ e.jsx(r, { value: "banana", children: "Banana" }),
|
|
50
|
+
/* @__PURE__ */ e.jsx(r, { value: "blueberry", children: "Blueberry" }),
|
|
51
|
+
/* @__PURE__ */ e.jsx(r, { value: "grapes", children: "Grapes" }),
|
|
52
|
+
/* @__PURE__ */ e.jsx(r, { value: "pineapple", children: "Pineapple" })
|
|
57
53
|
] }) })
|
|
58
54
|
] }) }), B = () => {
|
|
59
|
-
const { savePage: l, syncState:
|
|
60
|
-
switch (
|
|
55
|
+
const { savePage: l, syncState: s } = w(), { t: n } = y(), i = m(() => {
|
|
56
|
+
switch (s) {
|
|
61
57
|
case "SAVING":
|
|
62
58
|
return "animate-pulse bg-gray-500 text-gray-900";
|
|
63
59
|
case "SAVED":
|
|
@@ -65,13 +61,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
65
61
|
default:
|
|
66
62
|
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
67
63
|
}
|
|
68
|
-
}, [
|
|
64
|
+
}, [s]);
|
|
69
65
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(v, { children: [
|
|
70
66
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
71
67
|
C,
|
|
72
68
|
{
|
|
73
|
-
onClick: () =>
|
|
74
|
-
|
|
69
|
+
onClick: (t) => {
|
|
70
|
+
t.preventDefault(), l();
|
|
71
|
+
},
|
|
72
|
+
className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${i}`,
|
|
75
73
|
size: "sm",
|
|
76
74
|
variant: "outline",
|
|
77
75
|
children: [
|
|
@@ -82,31 +80,31 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
82
80
|
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"
|
|
83
81
|
}
|
|
84
82
|
) }),
|
|
85
|
-
|
|
83
|
+
s === "SAVING" ? "Saving..." : s === "SAVED" ? n("Saved") : "Save"
|
|
86
84
|
]
|
|
87
85
|
}
|
|
88
86
|
) }),
|
|
89
|
-
/* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx("p", { children:
|
|
87
|
+
/* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
|
|
90
88
|
] }) });
|
|
91
|
-
},
|
|
92
|
-
const l = a("topBarComponents.left", []),
|
|
89
|
+
}, pe = () => {
|
|
90
|
+
const l = a("topBarComponents.left", []), s = a("topBarComponents.center", []), n = a("topBarComponents.right", []), i = a("editable", !0);
|
|
93
91
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
94
92
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
|
|
95
|
-
l.map((
|
|
93
|
+
l.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
96
94
|
) }) }),
|
|
97
95
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: o.Children.toArray(
|
|
98
|
-
|
|
96
|
+
s.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
99
97
|
) }),
|
|
100
98
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
101
99
|
/* @__PURE__ */ e.jsx(T, {}),
|
|
102
100
|
/* @__PURE__ */ e.jsx(N, { orientation: "vertical" }),
|
|
103
|
-
|
|
101
|
+
i ? /* @__PURE__ */ e.jsx(B, {}) : null,
|
|
104
102
|
o.Children.toArray(
|
|
105
|
-
|
|
103
|
+
n.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
106
104
|
)
|
|
107
105
|
] })
|
|
108
106
|
] });
|
|
109
107
|
};
|
|
110
108
|
export {
|
|
111
|
-
|
|
109
|
+
pe as default
|
|
112
110
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),o=require("lodash"),A=require("@radix-ui/react-icons"),T=require("unsplash-js"),b=require("./skeleton-JHP9zwL2.cjs"),z=require("./command-ThdTuUxt.cjs"),_=require("./scroll-area-FiHvy-TZ.cjs"),g=require("./popover-fKjgcRUx.cjs"),t=require("./select-7bjg-rr9.cjs");require("react-i18next");const D=require("@react-hookz/web"),L=require("lucide-react");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("cmdk");require("./dialog-S_QbL1iq.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),k=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(A.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:()=>k(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=V;exports.fetchImage=R;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { useState as d, useEffect as D } from "react";
|
|
3
3
|
import { isEmpty as p, startCase as E } from "lodash";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import { u as F, B as K } from "./
|
|
7
|
-
import { I as U } from "./command-
|
|
8
|
-
import { S as V } from "./scroll-area-
|
|
9
|
-
import { P as O, a as Q, b as H } from "./popover-
|
|
10
|
-
import { S as P, c as S, b as C, d as I, f as h } from "./select-
|
|
6
|
+
import { u as F, B as K } from "./skeleton-CU_FIbg3.js";
|
|
7
|
+
import { I as U } from "./command-VHca6CcN.js";
|
|
8
|
+
import { S as V } from "./scroll-area-ewXbxc3n.js";
|
|
9
|
+
import { P as O, a as Q, b as H } from "./popover-a84pbVhQ.js";
|
|
10
|
+
import { S as P, c as S, b as C, d as I, f as h } from "./select-POGdEDHT.js";
|
|
11
11
|
import "react-i18next";
|
|
12
12
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
13
13
|
import { Loader as $ } from "lucide-react";
|
|
14
|
-
import "
|
|
15
|
-
import "./utils-ac68b2c8.js";
|
|
16
|
-
import "clsx";
|
|
17
|
-
import "tailwind-merge";
|
|
14
|
+
import "jotai";
|
|
18
15
|
import "@radix-ui/react-slot";
|
|
19
16
|
import "class-variance-authority";
|
|
17
|
+
import "./utils-dze1SGvB.js";
|
|
18
|
+
import "clsx";
|
|
19
|
+
import "tailwind-merge";
|
|
20
20
|
import "@radix-ui/react-tooltip";
|
|
21
21
|
import "@radix-ui/react-toast";
|
|
22
|
-
import "jotai";
|
|
23
22
|
import "cmdk";
|
|
24
|
-
import "./dialog-
|
|
23
|
+
import "./dialog-jrw9DF1f.js";
|
|
25
24
|
import "@radix-ui/react-dialog";
|
|
26
25
|
import "@radix-ui/react-scroll-area";
|
|
27
26
|
import "@radix-ui/react-popover";
|
|
@@ -30,7 +29,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
30
29
|
B({ accessKey: g }).search.getPhotos(x).then((l) => {
|
|
31
30
|
o(l);
|
|
32
31
|
}).catch((l) => r(l));
|
|
33
|
-
}),
|
|
32
|
+
}), ye = ({ isModalView: x, onSelect: g }) => {
|
|
34
33
|
const o = F("unsplashAccessKey"), [r, j] = d([]), [l, v] = d(0), [n, A] = d(), [i, q] = d(), [z, y] = d(0), [u, T] = R("", 1e3), [f, c] = d(!1), _ = async (s) => {
|
|
35
34
|
if (p(u))
|
|
36
35
|
return;
|
|
@@ -180,6 +179,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
180
179
|
] });
|
|
181
180
|
};
|
|
182
181
|
export {
|
|
183
|
-
|
|
182
|
+
ye as default,
|
|
184
183
|
k as fetchImage
|
|
185
184
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),t=require("react"),a=require("lodash"),m=require("@radix-ui/react-icons"),E=require("jotai"),q=require("./scroll-area-FiHvy-TZ.cjs");require("react-i18next");const b=require("./skeleton-JHP9zwL2.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.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");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,27 +1,26 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { useState as i, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { S as A } from "./scroll-area-
|
|
6
|
+
import { S as A } from "./scroll-area-ewXbxc3n.js";
|
|
7
7
|
import "react-i18next";
|
|
8
|
-
import { u as j } from "./
|
|
8
|
+
import { u as j } from "./skeleton-CU_FIbg3.js";
|
|
9
9
|
import "@radix-ui/react-scroll-area";
|
|
10
|
-
import "./utils-
|
|
10
|
+
import "./utils-dze1SGvB.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
13
|
-
import "@radix-ui/react-alert-dialog";
|
|
14
13
|
import "@radix-ui/react-slot";
|
|
15
14
|
import "class-variance-authority";
|
|
16
15
|
import "@radix-ui/react-tooltip";
|
|
17
16
|
import "@radix-ui/react-toast";
|
|
18
|
-
const R = F([]),
|
|
19
|
-
const v = j("uploadMediaCallback", () => ""), d = j("fetchMediaCallback", () => []), [l, a] = E(R), [r, u] = i(!1), [
|
|
17
|
+
const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
18
|
+
const v = j("uploadMediaCallback", () => ""), d = j("fetchMediaCallback", () => []), [l, a] = E(R), [r, u] = i(!1), [x, p] = i(!1), [c, m] = i(), [f, y] = i("");
|
|
20
19
|
w(() => {
|
|
21
20
|
(async () => {
|
|
22
|
-
|
|
21
|
+
p(!0);
|
|
23
22
|
const t = await d();
|
|
24
|
-
a(t || []),
|
|
23
|
+
a(t || []), p(!1);
|
|
25
24
|
})();
|
|
26
25
|
}, [d, a]);
|
|
27
26
|
const N = (t) => {
|
|
@@ -86,8 +85,8 @@ const R = F([]), X = ({ isModalView: s, onSelect: n }) => {
|
|
|
86
85
|
/* @__PURE__ */ e.jsx("input", { type: "file", id: s ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
87
86
|
] }),
|
|
88
87
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
|
|
89
|
-
g(l) &&
|
|
90
|
-
g(l) && !
|
|
88
|
+
g(l) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
|
|
89
|
+
g(l) && !x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
91
90
|
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(l, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => n(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
92
91
|
"img",
|
|
93
92
|
{
|
|
@@ -110,5 +109,5 @@ const R = F([]), X = ({ isModalView: s, onSelect: n }) => {
|
|
|
110
109
|
] });
|
|
111
110
|
};
|
|
112
111
|
export {
|
|
113
|
-
|
|
112
|
+
W as default
|
|
114
113
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as a } from "./jsx-runtime-
|
|
1
|
+
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-accordion";
|
|
4
4
|
import { ChevronDownIcon as c } from "@radix-ui/react-icons";
|
|
5
|
-
import { c as i } from "./utils-
|
|
5
|
+
import { c as i } from "./utils-dze1SGvB.js";
|
|
6
6
|
const N = e.Root, m = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a.jsx(e.Item, { ref: r, className: i("border-b", o), ...t }));
|
|
7
7
|
m.displayName = "AccordionItem";
|
|
8
8
|
const d = n.forwardRef(({ className: o, children: t, ...r }, s) => /* @__PURE__ */ a.jsx(e.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-
|
|
1
|
+
"use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),u=require("react"),x=require("@radix-ui/react-accordion"),p=require("@radix-ui/react-icons"),c=require("./utils-qK_SjzzV.cjs");function a(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=a(u),o=a(x),f=o.Root,d=i.forwardRef(({className:e,...n},t)=>s.jsxRuntimeExports.jsx(o.Item,{ref:t,className:c.cn("border-b",e),...n}));d.displayName="AccordionItem";const m=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Header,{className:"flex",children:s.jsxRuntimeExports.jsxs(o.Trigger,{ref:r,className:c.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...t,children:[n,s.jsxRuntimeExports.jsx(p.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));m.displayName=o.Trigger.displayName;const l=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Content,{ref:r,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...t,children:s.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:n})}));l.displayName=o.Content.displayName;exports.Accordion=f;exports.AccordionContent=l;exports.AccordionItem=d;exports.AccordionTrigger=m;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { useState as g } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash";
|
|
4
|
-
import { B as c } from "./
|
|
5
|
-
import { D as b, a as C, b as A } from "./dialog-
|
|
4
|
+
import { B as c } from "./skeleton-CU_FIbg3.js";
|
|
5
|
+
import { D as b, a as C, b as A } from "./dialog-jrw9DF1f.js";
|
|
6
6
|
import { SingleLineText as d } from "@chaibuilder/blocks";
|
|
7
|
-
import { F as D } from "./form-
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import "./utils-ac68b2c8.js";
|
|
11
|
-
import "clsx";
|
|
12
|
-
import "tailwind-merge";
|
|
7
|
+
import { F as D } from "./form-dVpOAyRl.js";
|
|
8
|
+
import { e as N } from "./index-cZ4uo6aT.js";
|
|
9
|
+
import "jotai";
|
|
13
10
|
import "@radix-ui/react-slot";
|
|
14
11
|
import "class-variance-authority";
|
|
12
|
+
import "./utils-dze1SGvB.js";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "tailwind-merge";
|
|
15
15
|
import "@radix-ui/react-tooltip";
|
|
16
16
|
import "@radix-ui/react-icons";
|
|
17
17
|
import "@radix-ui/react-toast";
|
|
18
|
-
import "jotai";
|
|
19
18
|
import "@radix-ui/react-dialog";
|
|
20
19
|
import "@rjsf/core";
|
|
21
20
|
import "@rjsf/validator-ajv8";
|
|
22
|
-
import "./link-
|
|
21
|
+
import "./link-6o6n2Tnd.js";
|
|
23
22
|
import "react-icons-picker";
|
|
24
23
|
import "react-dom";
|
|
25
|
-
import "./ImagesPanel-
|
|
26
|
-
import "./tabs-
|
|
24
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
25
|
+
import "./tabs-Gb9v5dVb.js";
|
|
27
26
|
import "@radix-ui/react-tabs";
|
|
28
27
|
import "react-quill";
|
|
29
28
|
import "react-i18next";
|
|
30
|
-
import "./
|
|
29
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
30
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
31
31
|
import "@radix-ui/react-scroll-area";
|
|
32
32
|
import "@floating-ui/react-dom";
|
|
33
33
|
import "i18next";
|
|
@@ -36,12 +36,15 @@ import "react-dnd";
|
|
|
36
36
|
import "@minoru/react-dnd-treeview";
|
|
37
37
|
import "react-hotkeys-hook";
|
|
38
38
|
import "flat-to-nested";
|
|
39
|
-
import "./
|
|
40
|
-
import "himalaya";
|
|
39
|
+
import "./functions-pcUZhFJM.js";
|
|
41
40
|
import "redux-undo";
|
|
42
41
|
import "@react-hookz/web";
|
|
43
42
|
import "sonner";
|
|
43
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
44
|
+
import "himalaya";
|
|
44
45
|
import "lucide-react";
|
|
46
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
47
|
+
import "@radix-ui/react-alert-dialog";
|
|
45
48
|
const S = ({ closeModal: o }) => {
|
|
46
49
|
var s, p;
|
|
47
50
|
const i = N(), [e, u] = g({
|
|
@@ -54,13 +57,13 @@ const S = ({ closeModal: o }) => {
|
|
|
54
57
|
i.mutate(e, {
|
|
55
58
|
onSuccess: () => o()
|
|
56
59
|
});
|
|
57
|
-
}, x = ({ formData:
|
|
60
|
+
}, x = ({ formData: m }, r) => {
|
|
58
61
|
u((h) => {
|
|
59
62
|
var n, l;
|
|
60
|
-
const
|
|
61
|
-
return r === "name" ?
|
|
63
|
+
const a = { [r]: m[r] };
|
|
64
|
+
return r === "name" ? a.slug = j((n = m[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (a.slug = (l = m[r]) == null ? void 0 : l.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
62
65
|
...h,
|
|
63
|
-
...
|
|
66
|
+
...a
|
|
64
67
|
};
|
|
65
68
|
});
|
|
66
69
|
}, P = {
|
|
@@ -83,7 +86,7 @@ const S = ({ closeModal: o }) => {
|
|
|
83
86
|
}
|
|
84
87
|
) })
|
|
85
88
|
] });
|
|
86
|
-
},
|
|
89
|
+
}, jt = () => {
|
|
87
90
|
const [o, i] = g(!1);
|
|
88
91
|
return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
|
|
89
92
|
/* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(c, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
|
|
@@ -91,5 +94,5 @@ const S = ({ closeModal: o }) => {
|
|
|
91
94
|
] });
|
|
92
95
|
};
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
jt as default
|
|
95
98
|
};
|