@chaibuilder/sdk 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
- package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
- package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
- package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
- package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
- package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
- package/dist/Class-RZuPYbUS.cjs +1 -0
- package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
- package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
- package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
- package/dist/Layers-gEA0qWYP.cjs +1 -0
- package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
- package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
- package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
- package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
- package/dist/PagesPanel-tH6c9Mnv.js +70 -0
- package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
- package/dist/ProjectPanel-Q2-15-In.js +91 -0
- package/dist/Settings-DBiwm1hY.cjs +1 -0
- package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
- package/dist/SidePanels-8JWYXGqN.cjs +1 -0
- package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
- package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
- package/dist/Topbar-qi5ab8rR.cjs +1 -0
- package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
- package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
- package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
- package/dist/UploadImages-jLQgLujd.cjs +1 -0
- package/dist/add-page-modal-U5ramelz.js +110 -0
- package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
- package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
- package/dist/confirm-alert-z74-fGOT.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +99 -124
- package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
- package/dist/delete-page-modal-_E87bVUZ.js +89 -0
- package/dist/form-Osm1AmO5.cjs +1 -0
- package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
- package/dist/index-2EHcmZqL.js +2947 -0
- package/dist/index-RVm8Txnj.js +1149 -0
- package/dist/index-_jFEo7h5.cjs +206 -0
- package/dist/index-c8zW_D2V.cjs +1 -0
- package/dist/index-cU5eyVRU.js +40872 -0
- package/dist/index-fwo4wa7u.cjs +1 -0
- package/dist/index-gmZcUXyn.js +25 -0
- package/dist/index-m2muA80V.cjs +9 -0
- package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
- package/dist/lib.cjs +2 -1
- package/dist/lib.js +1333 -71
- package/dist/page-viewer-BSc-5M4B.cjs +1 -0
- package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
- package/dist/project-general-setting-14MA_cX5.cjs +1 -0
- package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
- package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
- package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +23 -19
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
- package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +45 -25
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +156 -357
- package/package.json +1 -1
- package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
- package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
- package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
- package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
- package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
- package/dist/Class-_uCzl5v1.cjs +0 -1
- package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
- package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
- package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
- package/dist/Layers-EzOZdWvd.cjs +0 -1
- package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
- package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
- package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
- package/dist/PagesPanel-6JuwBLFQ.js +0 -50
- package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
- package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
- package/dist/ProjectPanel-cu2QSDW9.js +0 -73
- package/dist/Settings-lc9PfnmG.cjs +0 -1
- package/dist/SidePanels-VH72zFE2.cjs +0 -1
- package/dist/Topbar-vQPo9xSY.cjs +0 -1
- package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
- package/dist/UploadImages-T6kW0s3G.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal--qZSwJuB.cjs +0 -1
- package/dist/add-page-modal-bj7qbZuK.js +0 -99
- package/dist/alert-dialog-GNfnpqFB.js +0 -64
- package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
- package/dist/command-ThdTuUxt.cjs +0 -1
- package/dist/command-VHca6CcN.js +0 -97
- package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
- package/dist/confirm-alert-b0e_BLhF.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-Ni5kEzLz.js +0 -103
- package/dist/controls-W97-POR_.cjs +0 -1
- package/dist/controls-enQY7NI8.js +0 -118
- package/dist/controls-xUKa23ic.cjs +0 -1
- package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
- package/dist/delete-page-modal-cnrR8tWH.js +0 -69
- package/dist/dialog-S_QbL1iq.cjs +0 -1
- package/dist/dialog-jrw9DF1f.js +0 -65
- package/dist/dropdown-menu-S03K_fNs.js +0 -164
- package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
- package/dist/form-nRAvKPQj.cjs +0 -1
- package/dist/functions-nNTuSTsR.js +0 -1106
- package/dist/functions-pcUZhFJM.js +0 -12
- package/dist/functions-sCuB7nvZ.cjs +0 -2
- package/dist/functions-uw7QP2kT.cjs +0 -1
- package/dist/html-to-json-P6GpbcQX.cjs +0 -1
- package/dist/html-to-json-pdHQfRkN.js +0 -178
- package/dist/index-HAue58ea.cjs +0 -1
- package/dist/index-T4_wfKl5.js +0 -2256
- package/dist/index-X9ZgD09V.cjs +0 -1
- package/dist/index-ehKdBRUK.js +0 -18
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-6o6n2Tnd.js +0 -204
- package/dist/link-ece8dZGH.cjs +0 -1
- package/dist/page-viewer-IARz6OSp.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
- package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
- package/dist/project-seo-setting-rankm1z3.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
- package/dist/skeleton-CU_FIbg3.js +0 -239
- package/dist/skeleton-JHP9zwL2.cjs +0 -1
- package/dist/tabs-Gb9v5dVb.js +0 -46
- package/dist/tabs-iWeaaVrg.cjs +0 -1
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/toggle-ASJRAaGP.js +0 -30
- package/dist/toggle-ehNIPmme.cjs +0 -1
- package/dist/useAddBlock-WJc3OgG8.js +0 -86
- package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
- package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
- package/dist/useAllBlocks-PQKYvs-e.js +0 -20
- package/dist/useChaiExternalData-4K9WxANa.js +0 -6
- package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
- package/dist/useDarkMode-ZKCO_gkt.js +0 -23
- package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
- package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
- package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
- package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
- package/dist/useLanguage-NKKKaxVM.cjs +0 -1
- package/dist/useLanguage-gVC5rxO5.js +0 -216
- package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
- package/dist/useUiLibraries-4hPOi8DI.js +0 -12
- package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.create;var b=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var P=(r,o,i,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of S(o))!A.call(r,l)&&l!==i&&b(r,l,{get:()=>o[l],enumerable:!(u=C(o,l))||u.enumerable});return r};var T=(r,o,i)=>(i=r!=null?k(D(r)):{},P(o||!r||!r.__esModule?b(i,"default",{value:r,enumerable:!0}):i,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),y=require("@radix-ui/react-icons"),n=require("react"),R=require("jotai"),x=require("lodash"),s=require("./index-c8zW_D2V.cjs");require("./lib.cjs");const E=require("lucide-react"),z=require("./index-fwo4wa7u.cjs"),B=require("./index-_jFEo7h5.cjs"),K=require("./Class-RZuPYbUS.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("clsx");require("tailwind-merge");require("i18next");require("./index-m2muA80V.cjs");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");const V=n.lazy(()=>import("react-json-view")),I=({provider:r,onClose:o})=>{const[i,u]=n.useState(null);return n.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(d=>u(d))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:l=>l?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:["Data Provider: ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(B.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(V,{style:{maxHeight:"80vh",overflowY:"auto"},name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:i})})]})}):null};function L({children:r,name:o,onRemove:i}){return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:o})," provider?"]}),e.jsxRuntimeExports.jsx(s.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(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:i,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const M=()=>{const r=n.useMemo(()=>z.A(),[]),[o,i]=s.usePageDataProviders(),[,u]=R.useAtom(s.pageSyncStateAtom),[l,d]=n.useState(x.filter(r,t=>x.map(o,"providerKey").includes(t.providerKey))),[j,g]=n.useState(""),[v,c]=n.useState(null),f=x.filter(r.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(r,{providerKey:t});d(m=>[...m,p]),i(m=>[...m,{providerKey:p.providerKey,args:{}}]),g(""),u("UNSAVED")},h=t=>{d(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),i(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),u("UNSAVED")},N=t=>c(t);return x.isEmpty(r)?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(s.Select,{value:j,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),f.map(t=>e.jsxRuntimeExports.jsx(s.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:()=>N(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(L,{onRemove:()=>h(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(I,{onClose:()=>c(null),provider:v})]})]})},q=n.lazy(()=>Promise.resolve().then(()=>require("./Layers-gEA0qWYP.cjs"))),H=n.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-WSCFnWAf.cjs"))),O=n.lazy(()=>Promise.resolve().then(()=>require("./index-c8zW_D2V.cjs")).then(r=>r.ImagesPanel));let w=null;const F=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),o=s.useBuilderProp("sideBarComponents.bottom",[]),[i,u]=R.useAtom(s.activePanelAtom),[l,d]=n.useState(i),[j,g]=n.useState(null),v={layers:q,"branding-options":H,images:O};x.each(r,({name:a,panel:h})=>{v[a]=h});const c=a=>{clearTimeout(w),f(!1),i!=="layers"&&a==="layers"?w=setTimeout(()=>d("layers"),500):d(a),u(a)},[,f]=R.useAtom(s.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(s.Button,{onClick:()=>{f(!0),u("layers")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(y.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(y.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),n.Children.toArray(r.map(({name:a,icon:h})=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c(a),size:"sm",className:"w-10",variant:i===a?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:n.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.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"+(i==="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 ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(n.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:K.cn("relative h-full max-h-[93%] bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{j&&clearTimeout(j)},onMouseLeave:()=>{const a=setTimeout(()=>{j&&(c("layers"),clearTimeout(j))},1e3);g(a)},children:n.createElement(x.get(v,l,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(n.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(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(q)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(M,{})})]})})})]})};exports.default=F;
|
|
@@ -1,54 +1,72 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import h, {
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { PlusIcon as E, Half2Icon as V } from "@radix-ui/react-icons";
|
|
3
|
+
import h, { useState as p, useEffect as L, useMemo as M, lazy as N, Suspense as j } from "react";
|
|
4
4
|
import { useAtom as w } from "jotai";
|
|
5
|
-
import { filter as g, map as k, isNull as H,
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
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
|
-
import "@radix-ui/react-slot";
|
|
5
|
+
import { filter as g, map as k, isNull as H, find as I, isEmpty as R, each as F, get as _ } from "lodash";
|
|
6
|
+
import { ao as O, ap as Y, aq as J, ar as U, as as $, D as q, E as G, F as Z, G as Q, H as W, I as X, J as ee, K as se, at as re, s as ae, t as ie, au as le, av as te, aw as oe, ax as ne, ay as C, i as D, az as ce, aA as de, B as b, S as A, aB as me, aC as xe, aD as P, aE as S } from "./index-2EHcmZqL.js";
|
|
7
|
+
import "./lib.js";
|
|
8
|
+
import { ListTreeIcon as T, DatabaseIcon as pe } from "lucide-react";
|
|
9
|
+
import { A as ue } from "./index-gmZcUXyn.js";
|
|
10
|
+
import { E as he } from "./index-cU5eyVRU.js";
|
|
11
|
+
import { b as fe } from "./Class-nQk08vqd.js";
|
|
12
|
+
import "@radix-ui/react-toggle";
|
|
17
13
|
import "class-variance-authority";
|
|
14
|
+
import "@radix-ui/react-switch";
|
|
15
|
+
import "@radix-ui/react-slot";
|
|
16
|
+
import "@radix-ui/react-accordion";
|
|
17
|
+
import "@radix-ui/react-alert-dialog";
|
|
18
|
+
import "@radix-ui/react-dialog";
|
|
19
|
+
import "@radix-ui/react-label";
|
|
20
|
+
import "@radix-ui/react-scroll-area";
|
|
21
|
+
import "@radix-ui/react-tabs";
|
|
18
22
|
import "@radix-ui/react-tooltip";
|
|
23
|
+
import "@radix-ui/react-popover";
|
|
24
|
+
import "@radix-ui/react-menubar";
|
|
25
|
+
import "@radix-ui/react-hover-card";
|
|
26
|
+
import "@radix-ui/react-select";
|
|
27
|
+
import "@radix-ui/react-dropdown-menu";
|
|
28
|
+
import "@radix-ui/react-separator";
|
|
19
29
|
import "@radix-ui/react-toast";
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
23
|
-
import "@radix-ui/react-scroll-area";
|
|
30
|
+
import "cmdk";
|
|
31
|
+
import "@radix-ui/react-context-menu";
|
|
32
|
+
import "react-icons-picker";
|
|
24
33
|
import "react-dom";
|
|
25
|
-
import "
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "flat-to-nested";
|
|
36
|
+
import "redux-undo";
|
|
37
|
+
import "@react-hookz/web";
|
|
38
|
+
import "react-i18next";
|
|
39
|
+
import "himalaya";
|
|
40
|
+
import "@mhsdesign/jit-browser-tailwindcss";
|
|
41
|
+
import "@bobthered/tailwindcss-palette-generator";
|
|
42
|
+
import "@tailwindcss/forms";
|
|
43
|
+
import "@tailwindcss/typography";
|
|
44
|
+
import "@tailwindcss/aspect-ratio";
|
|
45
|
+
import "@tailwindcss/line-clamp";
|
|
46
|
+
import "clsx";
|
|
47
|
+
import "tailwind-merge";
|
|
26
48
|
import "i18next";
|
|
49
|
+
import "./index-RVm8Txnj.js";
|
|
50
|
+
import "@floating-ui/react-dom";
|
|
51
|
+
import "react-textarea-autosize";
|
|
27
52
|
import "flagged";
|
|
28
53
|
import "react-dnd";
|
|
29
54
|
import "@minoru/react-dnd-treeview";
|
|
30
55
|
import "react-hotkeys-hook";
|
|
31
|
-
import "
|
|
32
|
-
import "./functions-pcUZhFJM.js";
|
|
33
|
-
import "redux-undo";
|
|
34
|
-
import "@react-hookz/web";
|
|
35
|
-
import "tailwind-merge";
|
|
36
|
-
import "@radix-ui/react-alert-dialog";
|
|
37
|
-
import "@radix-ui/react-dialog";
|
|
38
|
-
import "@radix-ui/react-select";
|
|
56
|
+
import "sonner";
|
|
39
57
|
const ve = h.lazy(() => import("react-json-view")), je = ({ provider: r, onClose: o }) => {
|
|
40
|
-
const [a, n] =
|
|
41
|
-
return
|
|
58
|
+
const [a, n] = p(null);
|
|
59
|
+
return L(() => {
|
|
42
60
|
r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => n(c));
|
|
43
|
-
}, [r]), r ? /* @__PURE__ */ e.jsx(
|
|
44
|
-
/* @__PURE__ */ e.jsxs(
|
|
45
|
-
/* @__PURE__ */ e.jsxs(
|
|
61
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx(O, { onOpenChange: (l) => l ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
62
|
+
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
63
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
46
64
|
"Data Provider: ",
|
|
47
65
|
r.name
|
|
48
66
|
] }),
|
|
49
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
+
/* @__PURE__ */ e.jsx($, { children: r.description })
|
|
50
68
|
] }),
|
|
51
|
-
/* @__PURE__ */ e.jsx(
|
|
69
|
+
/* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsx(
|
|
52
70
|
ve,
|
|
53
71
|
{
|
|
54
72
|
style: { maxHeight: "80vh", overflowY: "auto" },
|
|
@@ -66,54 +84,54 @@ function ge({
|
|
|
66
84
|
name: o,
|
|
67
85
|
onRemove: a
|
|
68
86
|
}) {
|
|
69
|
-
return /* @__PURE__ */ e.jsxs(
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
/* @__PURE__ */ e.jsxs(
|
|
72
|
-
/* @__PURE__ */ e.jsxs(
|
|
73
|
-
/* @__PURE__ */ e.jsxs(
|
|
87
|
+
return /* @__PURE__ */ e.jsxs(q, { children: [
|
|
88
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: r }),
|
|
89
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
90
|
+
/* @__PURE__ */ e.jsxs(Q, { children: [
|
|
91
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
74
92
|
"Are you sure, you want to remove ",
|
|
75
93
|
/* @__PURE__ */ e.jsx("span", { className: "text-blue-500", children: o }),
|
|
76
94
|
" provider?"
|
|
77
95
|
] }),
|
|
78
|
-
/* @__PURE__ */ e.jsx(
|
|
96
|
+
/* @__PURE__ */ e.jsx(X, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
|
|
79
97
|
] }),
|
|
80
|
-
/* @__PURE__ */ e.jsxs(
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
-
/* @__PURE__ */ e.jsx(
|
|
98
|
+
/* @__PURE__ */ e.jsxs(ee, { children: [
|
|
99
|
+
/* @__PURE__ */ e.jsx(se, { children: "Cancel" }),
|
|
100
|
+
/* @__PURE__ */ e.jsx(re, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
|
|
83
101
|
] })
|
|
84
102
|
] })
|
|
85
103
|
] });
|
|
86
104
|
}
|
|
87
105
|
const be = () => {
|
|
88
|
-
const r =
|
|
106
|
+
const r = M(() => ue(), []), [o, a] = ae(), [, n] = w(ie), [l, c] = p(
|
|
89
107
|
g(r, (s) => k(o, "providerKey").includes(s.providerKey))
|
|
90
|
-
), [m, y] =
|
|
91
|
-
r.map((s) => k(
|
|
108
|
+
), [m, y] = p(""), [f, t] = p(null), v = g(
|
|
109
|
+
r.map((s) => k(l, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
92
110
|
(s) => !H(s)
|
|
93
|
-
),
|
|
94
|
-
const x =
|
|
111
|
+
), i = (s) => {
|
|
112
|
+
const x = I(r, { providerKey: s });
|
|
95
113
|
c((d) => [...d, x]), a((d) => [...d, { providerKey: x.providerKey, args: {} }]), y(""), n("UNSAVED");
|
|
96
|
-
},
|
|
114
|
+
}, u = (s) => {
|
|
97
115
|
c((x) => g(x, (d) => d.providerKey !== s.providerKey)), a((x) => g(x, (d) => d.providerKey !== s.providerKey)), n("UNSAVED");
|
|
98
116
|
}, B = (s) => t(s);
|
|
99
|
-
return
|
|
117
|
+
return R(r) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
|
|
100
118
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
101
119
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
102
120
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
103
121
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
104
122
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
105
123
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: "Add data providers:" }) }),
|
|
106
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
107
|
-
/* @__PURE__ */ e.jsx(
|
|
108
|
-
/* @__PURE__ */ e.jsxs(
|
|
109
|
-
/* @__PURE__ */ e.jsx(
|
|
110
|
-
v.map((s) => /* @__PURE__ */ e.jsx(
|
|
124
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(le, { value: m, onValueChange: (s) => i(s), children: [
|
|
125
|
+
/* @__PURE__ */ e.jsx(te, { className: "w-full", children: /* @__PURE__ */ e.jsx(oe, { placeholder: "Select a provider" }) }),
|
|
126
|
+
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
127
|
+
/* @__PURE__ */ e.jsx(C, { value: "", children: "Choose" }),
|
|
128
|
+
v.map((s) => /* @__PURE__ */ e.jsx(C, { value: s.value, children: s.label }, s.value))
|
|
111
129
|
] })
|
|
112
130
|
] }) }),
|
|
113
131
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
114
|
-
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${
|
|
132
|
+
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${l.length ? "block" : "hidden"}`, children: [
|
|
115
133
|
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium", children: "Page data providers:" }),
|
|
116
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children:
|
|
134
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: l.map((s) => /* @__PURE__ */ e.jsxs(
|
|
117
135
|
"div",
|
|
118
136
|
{
|
|
119
137
|
className: "rounded-lg border bg-card text-card-foreground shadow-sm w-full",
|
|
@@ -153,7 +171,7 @@ const be = () => {
|
|
|
153
171
|
]
|
|
154
172
|
}
|
|
155
173
|
),
|
|
156
|
-
/* @__PURE__ */ e.jsx(ge, { onRemove: () =>
|
|
174
|
+
/* @__PURE__ */ e.jsx(ge, { onRemove: () => u(s), name: s.name, children: /* @__PURE__ */ e.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: [
|
|
157
175
|
/* @__PURE__ */ e.jsxs(
|
|
158
176
|
"svg",
|
|
159
177
|
{
|
|
@@ -184,20 +202,20 @@ const be = () => {
|
|
|
184
202
|
/* @__PURE__ */ e.jsx(je, { onClose: () => t(null), provider: f })
|
|
185
203
|
] })
|
|
186
204
|
] });
|
|
187
|
-
}, z = N(() => import("./Layers-
|
|
205
|
+
}, z = N(() => import("./Layers-uzA3QA-4.js")), ye = N(() => import("./BrandingOptions-_Og7VUHA.js")), we = N(() => import("./index-2EHcmZqL.js").then((r) => r.cz));
|
|
188
206
|
let K = null;
|
|
189
|
-
const
|
|
190
|
-
const r =
|
|
207
|
+
const Cs = () => {
|
|
208
|
+
const r = D("sideBarComponents.top", []), o = D("sideBarComponents.bottom", []), [a, n] = w(ce), [l, c] = p(a), [m, y] = p(null), f = {
|
|
191
209
|
layers: z,
|
|
192
210
|
"branding-options": ye,
|
|
193
211
|
images: we
|
|
194
212
|
};
|
|
195
|
-
|
|
196
|
-
f[
|
|
213
|
+
F(r, ({ name: i, panel: u }) => {
|
|
214
|
+
f[i] = u;
|
|
197
215
|
});
|
|
198
|
-
const t = (
|
|
199
|
-
clearTimeout(K), v(!1), a !== "layers" &&
|
|
200
|
-
}, [, v] = w(
|
|
216
|
+
const t = (i) => {
|
|
217
|
+
clearTimeout(K), v(!1), a !== "layers" && i === "layers" ? K = setTimeout(() => c("layers"), 500) : c(i), n(i);
|
|
218
|
+
}, [, v] = w(de);
|
|
201
219
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
202
220
|
/* @__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: [
|
|
203
221
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
@@ -209,7 +227,7 @@ const os = () => {
|
|
|
209
227
|
},
|
|
210
228
|
size: "sm",
|
|
211
229
|
variant: a === "add-blocks" ? "default" : "outline",
|
|
212
|
-
children: /* @__PURE__ */ e.jsx(
|
|
230
|
+
children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
|
|
213
231
|
}
|
|
214
232
|
),
|
|
215
233
|
/* @__PURE__ */ e.jsx(
|
|
@@ -218,7 +236,7 @@ const os = () => {
|
|
|
218
236
|
onClick: () => t("layers"),
|
|
219
237
|
size: "sm",
|
|
220
238
|
variant: a === "layers" ? "default" : "outline",
|
|
221
|
-
children: /* @__PURE__ */ e.jsx(
|
|
239
|
+
children: /* @__PURE__ */ e.jsx(T, { className: "w-4" })
|
|
222
240
|
}
|
|
223
241
|
),
|
|
224
242
|
/* @__PURE__ */ e.jsx(
|
|
@@ -227,24 +245,24 @@ const os = () => {
|
|
|
227
245
|
onClick: () => t("branding-options"),
|
|
228
246
|
size: "sm",
|
|
229
247
|
variant: a === "branding-options" ? "default" : "outline",
|
|
230
|
-
children: /* @__PURE__ */ e.jsx(
|
|
248
|
+
children: /* @__PURE__ */ e.jsx(V, { className: "w-4 max-w-[40px] text-xs" })
|
|
231
249
|
}
|
|
232
250
|
),
|
|
233
251
|
h.Children.toArray(
|
|
234
|
-
r.map(({ name:
|
|
252
|
+
r.map(({ name: i, icon: u }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(A, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
235
253
|
b,
|
|
236
254
|
{
|
|
237
|
-
onClick: () => t(
|
|
255
|
+
onClick: () => t(i),
|
|
238
256
|
size: "sm",
|
|
239
257
|
className: "w-10",
|
|
240
|
-
variant: a ===
|
|
241
|
-
children: /* @__PURE__ */ e.jsx(
|
|
258
|
+
variant: a === i ? "default" : "outline",
|
|
259
|
+
children: /* @__PURE__ */ e.jsx(u, {})
|
|
242
260
|
}
|
|
243
261
|
) }))
|
|
244
262
|
)
|
|
245
263
|
] }),
|
|
246
264
|
/* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: h.Children.toArray(
|
|
247
|
-
o.map((
|
|
265
|
+
o.map((i) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(A, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
|
|
248
266
|
) })
|
|
249
267
|
] }),
|
|
250
268
|
/* @__PURE__ */ e.jsx(
|
|
@@ -271,17 +289,17 @@ const os = () => {
|
|
|
271
289
|
children: /* @__PURE__ */ e.jsx(
|
|
272
290
|
"div",
|
|
273
291
|
{
|
|
274
|
-
className:
|
|
292
|
+
className: fe("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
|
|
275
293
|
onMouseEnter: () => {
|
|
276
294
|
m && clearTimeout(m);
|
|
277
295
|
},
|
|
278
296
|
onMouseLeave: () => {
|
|
279
|
-
const
|
|
297
|
+
const i = setTimeout(() => {
|
|
280
298
|
m && (t("layers"), clearTimeout(m));
|
|
281
299
|
}, 1e3);
|
|
282
|
-
y(
|
|
300
|
+
y(i);
|
|
283
301
|
},
|
|
284
|
-
children: h.createElement(
|
|
302
|
+
children: h.createElement(_(f, l, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
285
303
|
}
|
|
286
304
|
)
|
|
287
305
|
}
|
|
@@ -296,24 +314,24 @@ const os = () => {
|
|
|
296
314
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
297
315
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
298
316
|
] }),
|
|
299
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
300
|
-
/* @__PURE__ */ e.jsxs(
|
|
301
|
-
/* @__PURE__ */ e.jsxs(
|
|
302
|
-
/* @__PURE__ */ e.jsx(
|
|
317
|
+
children: /* @__PURE__ */ e.jsxs(me, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
|
|
318
|
+
/* @__PURE__ */ e.jsxs(xe, { className: "mx-1 h-10 grid grid-cols-2", children: [
|
|
319
|
+
/* @__PURE__ */ e.jsxs(P, { value: "layers", children: [
|
|
320
|
+
/* @__PURE__ */ e.jsx(T, { className: "h-3 mr-2" }),
|
|
303
321
|
" Layers"
|
|
304
322
|
] }),
|
|
305
|
-
/* @__PURE__ */ e.jsxs(
|
|
306
|
-
/* @__PURE__ */ e.jsx(
|
|
323
|
+
/* @__PURE__ */ e.jsxs(P, { value: "data-provider", children: [
|
|
324
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-3 mr-2" }),
|
|
307
325
|
"Data"
|
|
308
326
|
] })
|
|
309
327
|
] }),
|
|
310
|
-
/* @__PURE__ */ e.jsx(
|
|
311
|
-
/* @__PURE__ */ e.jsx(
|
|
328
|
+
/* @__PURE__ */ e.jsx(S, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(z) }),
|
|
329
|
+
/* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
|
|
312
330
|
] })
|
|
313
331
|
}
|
|
314
332
|
) })
|
|
315
333
|
] });
|
|
316
334
|
};
|
|
317
335
|
export {
|
|
318
|
-
|
|
336
|
+
Cs as default
|
|
319
337
|
};
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
2
|
import o, { useMemo as m, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { T as C } from "./toggle-ASJRAaGP.js";
|
|
8
|
-
import { p as w } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
9
|
-
import { useTranslation as y } from "react-i18next";
|
|
10
|
-
import "@radix-ui/react-select";
|
|
11
|
-
import "./utils-dze1SGvB.js";
|
|
4
|
+
import { i as r, au as d, av as h, aw as u, ax as g, aF as j, aG as v, ay as a, ag as f, aH as S, aI as b, aJ as N, aK as w, S as p, aL as y } from "./index-2EHcmZqL.js";
|
|
5
|
+
import { useTranslation as C } from "react-i18next";
|
|
6
|
+
import "./Class-nQk08vqd.js";
|
|
12
7
|
import "clsx";
|
|
13
8
|
import "tailwind-merge";
|
|
14
|
-
import "jotai";
|
|
15
9
|
import "lodash";
|
|
16
|
-
import "@radix-ui/react-
|
|
10
|
+
import "@radix-ui/react-toggle";
|
|
17
11
|
import "class-variance-authority";
|
|
12
|
+
import "@radix-ui/react-switch";
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
import "@radix-ui/react-dialog";
|
|
17
|
+
import "@radix-ui/react-label";
|
|
18
|
+
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "@radix-ui/react-tabs";
|
|
18
20
|
import "@radix-ui/react-tooltip";
|
|
19
|
-
import "@radix-ui/react-
|
|
21
|
+
import "@radix-ui/react-popover";
|
|
22
|
+
import "@radix-ui/react-menubar";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-select";
|
|
25
|
+
import "@radix-ui/react-dropdown-menu";
|
|
20
26
|
import "@radix-ui/react-separator";
|
|
21
|
-
import "@radix-ui/react-
|
|
22
|
-
import "
|
|
23
|
-
import "@radix-ui/react-
|
|
27
|
+
import "@radix-ui/react-toast";
|
|
28
|
+
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-context-menu";
|
|
30
|
+
import "react-icons-picker";
|
|
24
31
|
import "react-dom";
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
import "flagged";
|
|
28
|
-
import "react-dnd";
|
|
29
|
-
import "@minoru/react-dnd-treeview";
|
|
30
|
-
import "react-hotkeys-hook";
|
|
32
|
+
import "react-quill";
|
|
33
|
+
import "jotai";
|
|
31
34
|
import "flat-to-nested";
|
|
32
|
-
import "./functions-pcUZhFJM.js";
|
|
33
35
|
import "redux-undo";
|
|
36
|
+
import "./index-gmZcUXyn.js";
|
|
34
37
|
import "@react-hookz/web";
|
|
35
|
-
|
|
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: [
|
|
38
|
+
const A = () => r("languages", ["en"]), B = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
|
|
37
39
|
/* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
38
40
|
u,
|
|
39
41
|
{
|
|
@@ -44,15 +46,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
44
46
|
}
|
|
45
47
|
) }),
|
|
46
48
|
/* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsxs(j, { children: [
|
|
47
|
-
/* @__PURE__ */ e.jsx(
|
|
48
|
-
/* @__PURE__ */ e.jsx(
|
|
49
|
-
/* @__PURE__ */ e.jsx(
|
|
50
|
-
/* @__PURE__ */ e.jsx(
|
|
51
|
-
/* @__PURE__ */ e.jsx(
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
49
|
+
/* @__PURE__ */ e.jsx(v, { children: "Fruits" }),
|
|
50
|
+
/* @__PURE__ */ e.jsx(a, { value: "apple", children: "Apple" }),
|
|
51
|
+
/* @__PURE__ */ e.jsx(a, { value: "banana", children: "Banana" }),
|
|
52
|
+
/* @__PURE__ */ e.jsx(a, { value: "blueberry", children: "Blueberry" }),
|
|
53
|
+
/* @__PURE__ */ e.jsx(a, { value: "grapes", children: "Grapes" }),
|
|
54
|
+
/* @__PURE__ */ e.jsx(a, { value: "pineapple", children: "Pineapple" })
|
|
53
55
|
] }) })
|
|
54
|
-
] }) }),
|
|
55
|
-
const { savePage: l, syncState: s } =
|
|
56
|
+
] }) }), T = () => {
|
|
57
|
+
const { savePage: l, syncState: s } = f(), { t: i } = C(), n = m(() => {
|
|
56
58
|
switch (s) {
|
|
57
59
|
case "SAVING":
|
|
58
60
|
return "animate-pulse bg-gray-500 text-gray-900";
|
|
@@ -62,14 +64,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
62
64
|
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
63
65
|
}
|
|
64
66
|
}, [s]);
|
|
65
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(
|
|
66
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
-
|
|
67
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(S, { children: [
|
|
68
|
+
/* @__PURE__ */ e.jsx(b, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
69
|
+
N,
|
|
68
70
|
{
|
|
69
71
|
onClick: (t) => {
|
|
70
72
|
t.preventDefault(), l();
|
|
71
73
|
},
|
|
72
|
-
className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${
|
|
74
|
+
className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,
|
|
73
75
|
size: "sm",
|
|
74
76
|
variant: "outline",
|
|
75
77
|
children: [
|
|
@@ -80,14 +82,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
80
82
|
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"
|
|
81
83
|
}
|
|
82
84
|
) }),
|
|
83
|
-
s === "SAVING" ? "Saving..." : s === "SAVED" ?
|
|
85
|
+
s === "SAVING" ? "Saving..." : s === "SAVED" ? i("Saved") : "Save"
|
|
84
86
|
]
|
|
85
87
|
}
|
|
86
88
|
) }),
|
|
87
|
-
/* @__PURE__ */ e.jsx(
|
|
89
|
+
/* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
|
|
88
90
|
] }) });
|
|
89
|
-
},
|
|
90
|
-
const l =
|
|
91
|
+
}, xe = () => {
|
|
92
|
+
const l = r("topBarComponents.left", []), s = r("topBarComponents.center", []), i = r("topBarComponents.right", []), n = r("editable", !0);
|
|
91
93
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
92
94
|
/* @__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(
|
|
93
95
|
l.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
@@ -96,15 +98,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
96
98
|
s.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
97
99
|
) }),
|
|
98
100
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
100
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
-
|
|
101
|
+
/* @__PURE__ */ e.jsx(B, {}),
|
|
102
|
+
/* @__PURE__ */ e.jsx(y, { orientation: "vertical" }),
|
|
103
|
+
n ? /* @__PURE__ */ e.jsx(T, {}) : null,
|
|
102
104
|
o.Children.toArray(
|
|
103
|
-
|
|
105
|
+
i.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
104
106
|
)
|
|
105
107
|
] })
|
|
106
108
|
] });
|
|
107
109
|
};
|
|
108
110
|
export {
|
|
109
|
-
|
|
111
|
+
xe as default
|
|
110
112
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-c8zW_D2V.cjs"),a=require("react-i18next");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().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(l.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"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){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"}},[s]);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(r.Toggle,{onClick:t=>{t.preventDefault(),i()},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"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=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:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),a=require("react"),o=require("lodash"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-c8zW_D2V.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("react-i18next");const g=async(d,E)=>new Promise((l,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{l(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const l=t.useBuilderProp("unsplashAccessKey"),[i,f]=a.useState([]),[c,q]=a.useState(0),[u,S]=a.useState(),[x,b]=a.useState(),[I,R]=a.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=a.useState(!1),P=async s=>{if(o.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,l).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return a.useEffect(()=>{if(!o.isEmpty(j)){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,l).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,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(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.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:u,onValueChange:s=>S(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:x,onValueChange:s=>b(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(t.ScrollArea,{className:`h-full ${d&&!o.isEmpty(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[o.isEmpty(i)&&!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:i.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))}):i.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(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!o.isEmpty(i)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
|