@chaibuilder/sdk 1.2.37 → 1.2.39
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-2_dpKDpp.js +144 -0
- package/dist/AddBlocks-p4Hrxjdf.cjs +1 -0
- package/dist/{CanvasArea-h3Nu-SWT.js → CanvasArea-iN0LxF74.js} +183 -184
- package/dist/{CanvasArea-7l8qSx52.cjs → CanvasArea-sbec3R-f.cjs} +5 -5
- package/dist/{ChaiBuilderEditor-VOCsboQ9.js → ChaiBuilderEditor-JnZFji5_.js} +8191 -8073
- package/dist/{ChaiBuilderEditor-6o0IOkBV.cjs → ChaiBuilderEditor-qxbkVVLu.cjs} +49 -49
- package/dist/{CurrentPage-p6Y9JO9p.js → CurrentPage-Lr3ztuMx.js} +9 -10
- package/dist/CurrentPage-m7_GkZ8a.cjs +1 -0
- package/dist/ListTree-piETqoz9.cjs +1 -0
- package/dist/{ListTree-tog0B3PA.js → ListTree-uJFhqUk9.js} +36 -33
- package/dist/{PagesPanel-NPSwC_QB.js → PagesPanel-R8FWg5Xg.js} +4 -5
- package/dist/PagesPanel-lShO3SmJ.cjs +1 -0
- package/dist/{ProjectPanel-cTPurlHf.js → ProjectPanel-2dX4bM5q.js} +5 -6
- package/dist/ProjectPanel-_4546hym.cjs +1 -0
- package/dist/{Settings-P8Bbl06y.js → Settings-J785mqWv.js} +4 -5
- package/dist/Settings-e2AZkjqY.cjs +1 -0
- package/dist/SidePanels-Vfw9Ir6p.cjs +1 -0
- package/dist/{SidePanels-iqAbcqUv.js → SidePanels-cN9er64h.js} +161 -142
- package/dist/{BrandingOptions-d0DbWp_N.js → ThemeConfiguration-m_jkR2zi.js} +42 -41
- package/dist/ThemeConfiguration-nler1cz3.cjs +1 -0
- package/dist/Topbar-DmIPkF8D.cjs +1 -0
- package/dist/{Topbar-8tMcFyw5.js → Topbar-gaBycI3a.js} +3 -4
- package/dist/UILibrariesPanel-Igx0R4zc.js +138 -0
- package/dist/UILibrariesPanel-N144UO0E.cjs +1 -0
- package/dist/{UnsplashImages-qTNzA02V.js → UnsplashImages-6HmGnetM.js} +3 -4
- package/dist/UnsplashImages-mC2ewX9D.cjs +1 -0
- package/dist/UploadImages-fo9ufcCE.cjs +1 -0
- package/dist/{UploadImages-PJyejbcA.js → UploadImages-qRW8zhKj.js} +3 -4
- package/dist/{add-page-modal-9SkVr8qi.js → add-page-modal-0OuVNgx3.js} +16 -17
- package/dist/add-page-modal-mP9aTfG9.cjs +1 -0
- package/dist/{confirm-alert-NECBDLLG.cjs → confirm-alert-3cDnni4v.cjs} +1 -1
- package/dist/{confirm-alert-mPe-H0Yj.js → confirm-alert-Mv-Iofef.js} +3 -4
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +44 -45
- package/dist/{delete-page-modal-kHnMpsjv.js → delete-page-modal-BVz9nreM.js} +4 -5
- package/dist/delete-page-modal-PTwcrTET.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +3 -0
- package/dist/email.js +3 -4
- package/dist/{form-prkciikc.js → form-e8l4xtI9.js} +1 -1
- package/dist/{form-5-WyQ9J_.cjs → form-o7e6NNTk.cjs} +1 -1
- package/dist/{index-wnXwbbRk.cjs → index--XTVdy1h.cjs} +1 -1
- package/dist/{index-X3veo7pJ.js → index-CdnwVCXv.js} +2 -2
- package/dist/{page-viewer-jsyCYHKL.js → page-viewer-OopsJHBE.js} +5 -6
- package/dist/page-viewer-cjvx3lg7.cjs +1 -0
- package/dist/{project-general-setting-2yhhHbME.cjs → project-general-setting-3sdmeYrS.cjs} +1 -1
- package/dist/{project-general-setting-sVRpF1o-.js → project-general-setting-n8KKf8qD.js} +5 -6
- package/dist/{project-seo-setting-FMpb2qiM.cjs → project-seo-setting-E554FQ3V.cjs} +1 -1
- package/dist/{project-seo-setting-YTVfe0Hq.js → project-seo-setting-pu3qUSE0.js} +4 -5
- package/dist/single-page-detail-KdxEu4WS.cjs +1 -0
- package/dist/{single-page-detail-o129SZnS.js → single-page-detail-hcTkta3X.js} +6 -7
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +3 -0
- package/dist/studio.js +3 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -139
- package/dist/{useCanvasSettings-J3l6fcbV.js → useCanvasSettings-6lwRwexD.js} +1 -1
- package/dist/{useCanvasSettings-DVIzrXND.cjs → useCanvasSettings-oERGzYXb.cjs} +1 -1
- package/package.json +2 -2
- package/dist/AddBlocks-D6H1c91w.cjs +0 -1
- package/dist/AddBlocks-ah7ZuAiO.js +0 -210
- package/dist/BrandingOptions-4D94jluh.cjs +0 -1
- package/dist/CurrentPage-NTowK7yE.cjs +0 -1
- package/dist/ListTree-4wBD1QKc.cjs +0 -1
- package/dist/PagesPanel-3pC0vx2q.cjs +0 -1
- package/dist/ProjectPanel-tvtrXbyb.cjs +0 -1
- package/dist/Settings-s19XidRS.cjs +0 -1
- package/dist/SidePanels-8NwJG0mo.cjs +0 -1
- package/dist/Topbar-SaVYT87H.cjs +0 -1
- package/dist/UnsplashImages-UJthlQqt.cjs +0 -1
- package/dist/UploadImages-zPJBckqp.cjs +0 -1
- package/dist/add-page-modal-jzDXOPVp.cjs +0 -1
- package/dist/delete-page-modal-pRepvBUK.cjs +0 -1
- package/dist/page-viewer-HGX57lyj.cjs +0 -1
- package/dist/single-page-detail-Y4OBAZAL.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("@radix-ui/react-icons"),i=require("react"),S=require("jotai"),a=require("lodash-es"),s=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),E=require("lucide-react"),_=require("@chaibuilder/runtime"),f=require("react-i18next"),q=require("./index-gi1LIOCw.cjs"),l=require("./STRINGS-gPz7CUOk.cjs"),K=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("tailwind-merge");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-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-quill");require("react-hotkeys-hook");const P=({provider:t,onClose:c})=>{const{t:n}=f.useTranslation(),[o,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(d=>p(d))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:j=>j?"":c(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(s.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(q.JsonView,{data:o,shouldExpandNode:q.allExpanded,style:{...q.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function L({children:t,name:c,onRemove:n}){const{t:o}=f.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:o("remove_provider_confirmation").replace("{name}",c)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:o("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:o("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:o("remove")})]})]})]})}const B=()=>{const{t}=f.useTranslation(),c=i.useMemo(()=>_.getChaiDataProviders(),[]),[n,o]=s.usePageDataProviders(),[,p]=S.useAtom(s.builderSaveStateAtom),[j,d]=i.useState(a.filter(c,r=>a.map(n,"providerKey").includes(r.providerKey))),[R,h]=i.useState(""),[b,v]=i.useState(null),N=a.filter(c.map(r=>a.map(j,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),y=r=>{const x=a.find(c,{providerKey:r});d(m=>[...m,x]),o(m=>[...m,{providerKey:x.providerKey,args:{}}]),h(""),p("UNSAVED")},w=r=>{d(x=>a.filter(x,m=>m.providerKey!==r.providerKey)),o(x=>a.filter(x,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},T=r=>v(r);return a.isEmpty(c)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:R,onValueChange:r=>y(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),N.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${j.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:j.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","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 items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>T(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",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",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",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"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(L,{onRemove:()=>w(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",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",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",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"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(P,{onClose:()=>v(null),provider:b})]})]})},O=i.memo(()=>{const{t}=f.useTranslation(),c={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},n={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(g.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(c).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(c[o])})]},o))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(n).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(n[o])})]},o))})]})})]})]})}),A=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-p4Hrxjdf.cjs"))),C=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-piETqoz9.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./ThemeConfiguration-nler1cz3.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./ChaiBuilderEditor-qxbkVVLu.cjs")).then(t=>t.ImagesPanel)),Y=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-N144UO0E.cjs")));let I=null;const V=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),c=s.useBuilderProp("sideBarComponents.bottom",[]),[n,o]=S.useAtom(s.activePanelAtom),[p,j]=i.useState(n),[d,R]=i.useState(null),{t:h}=f.useTranslation(),b=_.useChaiBlocks(),v=s.useBuilderProp("filterChaiBlock",()=>!0),N=a.filter(b,v),{data:y,isLoading:w}=s.useUILibraryBlocks(),T=!w&&!a.isEmpty(y)||a.find(a.values(N),{category:"custom"})!==void 0,r={"add-blocks":A,[l.OUTLINE_KEY]:C,"theme-configuration":U,images:z,"ui-libraries":Y};a.each(t,({name:u,panel:k})=>{r[u]=k});const x=u=>{clearTimeout(I),n!==l.OUTLINE_KEY&&u===l.OUTLINE_KEY?I=setTimeout(()=>o(l.OUTLINE_KEY),500):j(u),o(u)},m=s.useBuilderProp("dataBindingSupport",!1);function D(){const u=setTimeout(()=>{d&&(x(l.OUTLINE_KEY),clearTimeout(d))},500);R(u)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:D,onClick:()=>x(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,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:[T?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 rounded-md bg-gray-200 p-1",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x("ui-libraries"),size:"sm",variant:n==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x(l.OUTLINE_KEY),size:"sm",variant:n===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x("theme-configuration"),size:"sm",variant:n==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:u,icon:k})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>x(u),size:"sm",className:"w-10",variant:n===u?"default":"outline",children:e.jsxRuntimeExports.jsx(k,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(O,{}),i.Children.toArray(c.map(u=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(u,{})})))]})]}),n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",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:K.cn("relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"),onMouseEnter:()=>{d&&clearTimeout(d)},children:i.createElement(a.get(r,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,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:m?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"mr-2 w-3"}),h("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(C)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(B,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(C)})]})})})})]})};exports.default=V;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { KeyboardIcon as
|
|
3
|
-
import
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as
|
|
6
|
-
import { Z as
|
|
7
|
-
import { ListTreeIcon as
|
|
8
|
-
import { getChaiDataProviders as
|
|
2
|
+
import { KeyboardIcon as q, PlusIcon as E, Component2Icon as G } from "@radix-ui/react-icons";
|
|
3
|
+
import f, { useState as h, useEffect as Q, useMemo as X, memo as ee, lazy as v, Suspense as N } from "react";
|
|
4
|
+
import { useAtom as H } from "jotai";
|
|
5
|
+
import { filter as j, map as z, isNull as se, find as F, isEmpty as R, values as re, each as ae, get as le } from "lodash-es";
|
|
6
|
+
import { Z as J, _ as Z, $ as W, a0 as Y, a1 as ie, a2 as te, A as oe, a as ne, b as ce, c as de, d as me, e as xe, f as he, g as ue, a3 as pe, a4 as fe, a5 as je, a6 as ve, a7 as ge, a8 as be, a9 as Ne, aa as I, ab as ye, ac as we, ad as ke, ae as Ce, af as L, h as y, ag as De, O as Te, B as x, ah as V, ai as O, aj as M, ak as P, al as S } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
7
|
+
import { ListTreeIcon as B, PaletteIcon as _e, DatabaseIcon as Ae } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as Pe, useChaiBlocks as Se } from "@chaibuilder/runtime";
|
|
9
9
|
import { useTranslation as g } from "react-i18next";
|
|
10
|
-
import { J as
|
|
10
|
+
import { J as Be, a as Ke, d as Ee } from "./index-e0c8PmRQ.js";
|
|
11
11
|
import { O as i } from "./STRINGS--j49GZJP.js";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as ze } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
14
|
import "clsx";
|
|
15
15
|
import "react-dom";
|
|
@@ -43,27 +43,26 @@ import "@radix-ui/react-context-menu";
|
|
|
43
43
|
import "react-icons-picker";
|
|
44
44
|
import "react-quill";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
l("data_provider"),
|
|
46
|
+
const Ie = ({ provider: s, onClose: o }) => {
|
|
47
|
+
const { t: a } = g(), [l, u] = h(null);
|
|
48
|
+
return Q(() => {
|
|
49
|
+
s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => u(c));
|
|
50
|
+
}, [s]), s ? /* @__PURE__ */ e.jsx(J, { onOpenChange: (m) => m ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
51
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
52
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
53
|
+
a("data_provider"),
|
|
55
54
|
": ",
|
|
56
55
|
s.name
|
|
57
56
|
] }),
|
|
58
|
-
/* @__PURE__ */ e.jsx(
|
|
57
|
+
/* @__PURE__ */ e.jsx(ie, { children: s.description })
|
|
59
58
|
] }),
|
|
60
|
-
/* @__PURE__ */ e.jsx(
|
|
61
|
-
|
|
59
|
+
/* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(
|
|
60
|
+
Be,
|
|
62
61
|
{
|
|
63
|
-
data:
|
|
64
|
-
shouldExpandNode:
|
|
62
|
+
data: l,
|
|
63
|
+
shouldExpandNode: Ke,
|
|
65
64
|
style: {
|
|
66
|
-
...
|
|
65
|
+
...Ee,
|
|
67
66
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
68
67
|
stringValue: "text-orange-600",
|
|
69
68
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -72,64 +71,64 @@ const Ae = ({ provider: s, onClose: o }) => {
|
|
|
72
71
|
) })
|
|
73
72
|
] }) }) : null;
|
|
74
73
|
};
|
|
75
|
-
function
|
|
74
|
+
function Le({
|
|
76
75
|
children: s,
|
|
77
76
|
name: o,
|
|
78
|
-
onRemove:
|
|
77
|
+
onRemove: a
|
|
79
78
|
}) {
|
|
80
|
-
const { t:
|
|
81
|
-
return /* @__PURE__ */ e.jsxs(
|
|
82
|
-
/* @__PURE__ */ e.jsx(
|
|
83
|
-
/* @__PURE__ */ e.jsxs(
|
|
84
|
-
/* @__PURE__ */ e.jsxs(
|
|
79
|
+
const { t: l } = g();
|
|
80
|
+
return /* @__PURE__ */ e.jsxs(oe, { children: [
|
|
81
|
+
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children: s }),
|
|
82
|
+
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
83
|
+
/* @__PURE__ */ e.jsxs(de, { children: [
|
|
85
84
|
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
85
|
+
me,
|
|
87
86
|
{
|
|
88
|
-
dangerouslySetInnerHTML: { __html:
|
|
87
|
+
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", o) }
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsx(xe, { children: l("remove_provider_warning") })
|
|
92
91
|
] }),
|
|
93
|
-
/* @__PURE__ */ e.jsxs(
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
-
/* @__PURE__ */ e.jsx(
|
|
92
|
+
/* @__PURE__ */ e.jsxs(he, { children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx(ue, { children: l("cancel") }),
|
|
94
|
+
/* @__PURE__ */ e.jsx(pe, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
96
95
|
] })
|
|
97
96
|
] })
|
|
98
97
|
] });
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
const { t: s } = g(), o =
|
|
102
|
-
|
|
103
|
-
), [
|
|
104
|
-
o.map((r) =>
|
|
105
|
-
(r) => !
|
|
106
|
-
),
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
return
|
|
99
|
+
const Ve = () => {
|
|
100
|
+
const { t: s } = g(), o = X(() => Pe(), []), [a, l] = fe(), [, u] = H(je), [m, c] = h(
|
|
101
|
+
j(o, (r) => z(a, "providerKey").includes(r.providerKey))
|
|
102
|
+
), [w, p] = h(""), [k, b] = h(null), C = j(
|
|
103
|
+
o.map((r) => z(m, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
104
|
+
(r) => !se(r)
|
|
105
|
+
), D = (r) => {
|
|
106
|
+
const t = F(o, { providerKey: r });
|
|
107
|
+
c((d) => [...d, t]), l((d) => [...d, { providerKey: t.providerKey, args: {} }]), p(""), u("UNSAVED");
|
|
108
|
+
}, T = (r) => {
|
|
109
|
+
c((t) => j(t, (d) => d.providerKey !== r.providerKey)), l((t) => j(t, (d) => d.providerKey !== r.providerKey)), u("UNSAVED");
|
|
110
|
+
}, _ = (r) => b(r);
|
|
111
|
+
return R(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
113
112
|
s("no_data_providers"),
|
|
114
113
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
115
114
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
|
|
116
115
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
117
116
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
118
117
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
119
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
120
|
-
/* @__PURE__ */ e.jsx(
|
|
121
|
-
/* @__PURE__ */ e.jsxs(
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
-
|
|
118
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ve, { value: w, onValueChange: (r) => D(r), children: [
|
|
119
|
+
/* @__PURE__ */ e.jsx(ge, { className: "w-full", children: /* @__PURE__ */ e.jsx(be, { placeholder: s("select_provider") }) }),
|
|
120
|
+
/* @__PURE__ */ e.jsxs(Ne, { children: [
|
|
121
|
+
/* @__PURE__ */ e.jsx(I, { value: "", children: s("choose") }),
|
|
122
|
+
C.map((r) => /* @__PURE__ */ e.jsx(I, { value: r.value, children: r.label }, r.value))
|
|
124
123
|
] })
|
|
125
124
|
] }) }),
|
|
126
125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
127
|
-
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${
|
|
126
|
+
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${m.length ? "block" : "hidden"}`, children: [
|
|
128
127
|
/* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
|
|
129
128
|
s("page_data_providers"),
|
|
130
129
|
":"
|
|
131
130
|
] }),
|
|
132
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children:
|
|
131
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: m.map((r) => /* @__PURE__ */ e.jsxs(
|
|
133
132
|
"div",
|
|
134
133
|
{
|
|
135
134
|
className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
@@ -143,7 +142,7 @@ const Pe = () => {
|
|
|
143
142
|
/* @__PURE__ */ e.jsxs(
|
|
144
143
|
"button",
|
|
145
144
|
{
|
|
146
|
-
onClick: () =>
|
|
145
|
+
onClick: () => _(r),
|
|
147
146
|
className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
148
147
|
children: [
|
|
149
148
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -169,7 +168,7 @@ const Pe = () => {
|
|
|
169
168
|
]
|
|
170
169
|
}
|
|
171
170
|
),
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
171
|
+
/* @__PURE__ */ e.jsx(Le, { onRemove: () => T(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
173
172
|
/* @__PURE__ */ e.jsxs(
|
|
174
173
|
"svg",
|
|
175
174
|
{
|
|
@@ -197,124 +196,142 @@ const Pe = () => {
|
|
|
197
196
|
},
|
|
198
197
|
r.providerKey
|
|
199
198
|
)) }),
|
|
200
|
-
/* @__PURE__ */ e.jsx(
|
|
199
|
+
/* @__PURE__ */ e.jsx(Ie, { onClose: () => b(null), provider: k })
|
|
201
200
|
] })
|
|
202
201
|
] });
|
|
203
|
-
},
|
|
202
|
+
}, Oe = ee(() => {
|
|
204
203
|
const { t: s } = g(), o = {
|
|
205
204
|
"ctrl + Z": "Undo",
|
|
206
205
|
"ctrl + Y": "Redo",
|
|
207
206
|
"ctrl + D": "Duplicate"
|
|
208
|
-
},
|
|
207
|
+
}, a = {
|
|
209
208
|
// "ctrl + /": "Rename block",
|
|
210
209
|
"ctrl + S": "Save page",
|
|
211
210
|
esc: "Deselect blocks",
|
|
212
211
|
del: "Delete block"
|
|
213
212
|
};
|
|
214
|
-
return /* @__PURE__ */ e.jsxs(
|
|
215
|
-
/* @__PURE__ */ e.jsx(
|
|
216
|
-
/* @__PURE__ */ e.jsx(
|
|
217
|
-
/* @__PURE__ */ e.jsx(
|
|
213
|
+
return /* @__PURE__ */ e.jsxs(J, { children: [
|
|
214
|
+
/* @__PURE__ */ e.jsx(ye, { children: /* @__PURE__ */ e.jsxs(we, { children: [
|
|
215
|
+
/* @__PURE__ */ e.jsx(ke, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(q, {}) }) }),
|
|
216
|
+
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
|
|
218
217
|
] }) }),
|
|
219
|
-
/* @__PURE__ */ e.jsxs(
|
|
220
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
+
/* @__PURE__ */ e.jsxs(Z, { className: "sm:max-w-[525px]", children: [
|
|
219
|
+
/* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx(Y, { children: s("Keyboard shortcuts") }) }),
|
|
221
220
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
222
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((
|
|
223
|
-
/* @__PURE__ */ e.jsx(
|
|
224
|
-
/* @__PURE__ */ e.jsx("div", { children: s(o[
|
|
225
|
-
] },
|
|
226
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
227
|
-
/* @__PURE__ */ e.jsx(
|
|
228
|
-
/* @__PURE__ */ e.jsx("div", { children: s(l
|
|
229
|
-
] },
|
|
221
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
222
|
+
/* @__PURE__ */ e.jsx(L, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
223
|
+
/* @__PURE__ */ e.jsx("div", { children: s(o[l]) })
|
|
224
|
+
] }, l)) }),
|
|
225
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
226
|
+
/* @__PURE__ */ e.jsx(L, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
227
|
+
/* @__PURE__ */ e.jsx("div", { children: s(a[l]) })
|
|
228
|
+
] }, l)) })
|
|
230
229
|
] }) })
|
|
231
230
|
] })
|
|
232
231
|
] });
|
|
233
|
-
}),
|
|
234
|
-
let
|
|
235
|
-
const
|
|
236
|
-
const s =
|
|
237
|
-
"add-blocks":
|
|
238
|
-
[i]:
|
|
239
|
-
"
|
|
240
|
-
images:
|
|
232
|
+
}), Me = v(() => import("./AddBlocks-2_dpKDpp.js")), K = v(() => import("./ListTree-uJFhqUk9.js")), Ue = v(() => import("./ThemeConfiguration-m_jkR2zi.js")), He = v(() => import("./ChaiBuilderEditor-JnZFji5_.js").then((s) => s.co)), Fe = v(() => import("./UILibrariesPanel-Igx0R4zc.js"));
|
|
233
|
+
let U = null;
|
|
234
|
+
const zs = () => {
|
|
235
|
+
const s = y("sideBarComponents.top", []), o = y("sideBarComponents.bottom", []), [a, l] = H(De), [u, m] = h(a), [c, w] = h(null), { t: p } = g(), k = Se(), b = y("filterChaiBlock", () => !0), C = j(k, b), { data: D, isLoading: T } = Te(), _ = !T && !R(D) || F(re(C), { category: "custom" }) !== void 0, r = {
|
|
236
|
+
"add-blocks": Me,
|
|
237
|
+
[i]: K,
|
|
238
|
+
"theme-configuration": Ue,
|
|
239
|
+
images: He,
|
|
240
|
+
"ui-libraries": Fe
|
|
241
241
|
};
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
ae(s, ({ name: n, panel: A }) => {
|
|
243
|
+
r[n] = A;
|
|
244
244
|
});
|
|
245
|
-
const
|
|
246
|
-
clearTimeout(
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
const
|
|
250
|
-
|
|
245
|
+
const t = (n) => {
|
|
246
|
+
clearTimeout(U), a !== i && n === i ? U = setTimeout(() => l(i), 500) : m(n), l(n);
|
|
247
|
+
}, d = y("dataBindingSupport", !1);
|
|
248
|
+
function $() {
|
|
249
|
+
const n = setTimeout(() => {
|
|
250
|
+
c && (t(i), clearTimeout(c));
|
|
251
251
|
}, 500);
|
|
252
|
-
|
|
252
|
+
w(n);
|
|
253
253
|
}
|
|
254
254
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
255
|
-
|
|
255
|
+
a !== i ? /* @__PURE__ */ e.jsx(
|
|
256
256
|
"div",
|
|
257
257
|
{
|
|
258
|
-
onMouseEnter:
|
|
259
|
-
onClick: () =>
|
|
258
|
+
onMouseEnter: $,
|
|
259
|
+
onClick: () => t(i),
|
|
260
260
|
className: "fixed inset-0 z-[50] bg-black/20"
|
|
261
261
|
}
|
|
262
262
|
) : null,
|
|
263
263
|
/* @__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: [
|
|
264
264
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
265
|
-
/* @__PURE__ */ e.
|
|
266
|
-
|
|
265
|
+
_ ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 rounded-md bg-gray-200 p-1", children: [
|
|
266
|
+
/* @__PURE__ */ e.jsx(
|
|
267
|
+
x,
|
|
268
|
+
{
|
|
269
|
+
onClick: () => t("add-blocks"),
|
|
270
|
+
size: "sm",
|
|
271
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
272
|
+
children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ e.jsx(
|
|
276
|
+
x,
|
|
277
|
+
{
|
|
278
|
+
onClick: () => t("ui-libraries"),
|
|
279
|
+
size: "sm",
|
|
280
|
+
variant: a === "ui-libraries" ? "default" : "outline",
|
|
281
|
+
children: /* @__PURE__ */ e.jsx(G, { className: "text-xl" })
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
] }) : /* @__PURE__ */ e.jsx(
|
|
285
|
+
x,
|
|
267
286
|
{
|
|
268
|
-
onClick: () =>
|
|
269
|
-
c("add-blocks");
|
|
270
|
-
},
|
|
287
|
+
onClick: () => t("add-blocks"),
|
|
271
288
|
size: "sm",
|
|
272
|
-
variant:
|
|
273
|
-
children: /* @__PURE__ */ e.jsx(
|
|
289
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
290
|
+
children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
|
|
274
291
|
}
|
|
275
292
|
),
|
|
276
293
|
/* @__PURE__ */ e.jsx(
|
|
277
|
-
|
|
294
|
+
x,
|
|
278
295
|
{
|
|
279
|
-
onClick: () =>
|
|
296
|
+
onClick: () => t(i),
|
|
280
297
|
size: "sm",
|
|
281
|
-
variant:
|
|
282
|
-
children: /* @__PURE__ */ e.jsx(
|
|
298
|
+
variant: a === i ? "default" : "outline",
|
|
299
|
+
children: /* @__PURE__ */ e.jsx(B, { className: "w-4" })
|
|
283
300
|
}
|
|
284
301
|
),
|
|
285
302
|
/* @__PURE__ */ e.jsx(
|
|
286
|
-
|
|
303
|
+
x,
|
|
287
304
|
{
|
|
288
|
-
onClick: () =>
|
|
305
|
+
onClick: () => t("theme-configuration"),
|
|
289
306
|
size: "sm",
|
|
290
|
-
variant:
|
|
291
|
-
children: /* @__PURE__ */ e.jsx(
|
|
307
|
+
variant: a === "theme-configuration" ? "default" : "outline",
|
|
308
|
+
children: /* @__PURE__ */ e.jsx(_e, { className: "w-4 max-w-[40px] text-xs" })
|
|
292
309
|
}
|
|
293
310
|
),
|
|
294
|
-
|
|
295
|
-
s.map(({ name:
|
|
296
|
-
|
|
311
|
+
f.Children.toArray(
|
|
312
|
+
s.map(({ name: n, icon: A }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
313
|
+
x,
|
|
297
314
|
{
|
|
298
|
-
onClick: () =>
|
|
315
|
+
onClick: () => t(n),
|
|
299
316
|
size: "sm",
|
|
300
317
|
className: "w-10",
|
|
301
|
-
variant:
|
|
302
|
-
children: /* @__PURE__ */ e.jsx(
|
|
318
|
+
variant: a === n ? "default" : "outline",
|
|
319
|
+
children: /* @__PURE__ */ e.jsx(A, {})
|
|
303
320
|
}
|
|
304
321
|
) }))
|
|
305
322
|
)
|
|
306
323
|
] }),
|
|
307
324
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
308
|
-
/* @__PURE__ */ e.jsx(
|
|
309
|
-
|
|
310
|
-
o.map((
|
|
325
|
+
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
326
|
+
f.Children.toArray(
|
|
327
|
+
o.map((n) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(n, {}) }))
|
|
311
328
|
)
|
|
312
329
|
] })
|
|
313
330
|
] }),
|
|
314
|
-
|
|
331
|
+
a !== i ? /* @__PURE__ */ e.jsx(
|
|
315
332
|
"div",
|
|
316
333
|
{
|
|
317
|
-
className: "absolute left-14 z-[50] h-
|
|
334
|
+
className: "absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
|
|
318
335
|
children: /* @__PURE__ */ e.jsx(
|
|
319
336
|
N,
|
|
320
337
|
{
|
|
@@ -326,11 +343,13 @@ const _s = () => {
|
|
|
326
343
|
children: /* @__PURE__ */ e.jsx(
|
|
327
344
|
"div",
|
|
328
345
|
{
|
|
329
|
-
className:
|
|
346
|
+
className: ze(
|
|
347
|
+
"relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
|
|
348
|
+
),
|
|
330
349
|
onMouseEnter: () => {
|
|
331
|
-
|
|
350
|
+
c && clearTimeout(c);
|
|
332
351
|
},
|
|
333
|
-
children:
|
|
352
|
+
children: f.createElement(le(r, a, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
334
353
|
}
|
|
335
354
|
)
|
|
336
355
|
}
|
|
@@ -345,32 +364,32 @@ const _s = () => {
|
|
|
345
364
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
346
365
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
347
366
|
] }),
|
|
348
|
-
children:
|
|
349
|
-
/* @__PURE__ */ e.jsxs(
|
|
350
|
-
/* @__PURE__ */ e.jsxs(
|
|
351
|
-
/* @__PURE__ */ e.jsx(
|
|
367
|
+
children: d ? /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
368
|
+
/* @__PURE__ */ e.jsxs(M, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
369
|
+
/* @__PURE__ */ e.jsxs(P, { value: i, children: [
|
|
370
|
+
/* @__PURE__ */ e.jsx(B, { className: "mr-2 h-3" }),
|
|
352
371
|
" ",
|
|
353
|
-
|
|
372
|
+
p("Outline")
|
|
354
373
|
] }),
|
|
355
|
-
/* @__PURE__ */ e.jsxs(
|
|
356
|
-
/* @__PURE__ */ e.jsx(
|
|
357
|
-
|
|
374
|
+
/* @__PURE__ */ e.jsxs(P, { value: "data-provider", children: [
|
|
375
|
+
/* @__PURE__ */ e.jsx(Ae, { className: "mr-2 w-3" }),
|
|
376
|
+
p("Data")
|
|
358
377
|
] })
|
|
359
378
|
] }),
|
|
360
|
-
/* @__PURE__ */ e.jsx(
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
362
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
363
|
-
/* @__PURE__ */ e.jsx(
|
|
364
|
-
/* @__PURE__ */ e.jsx(
|
|
379
|
+
/* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(K) }),
|
|
380
|
+
/* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ve, {}) })
|
|
381
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
382
|
+
/* @__PURE__ */ e.jsx(M, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(P, { value: i, children: [
|
|
383
|
+
/* @__PURE__ */ e.jsx(B, { className: "mr-2 h-3" }),
|
|
365
384
|
" ",
|
|
366
|
-
|
|
385
|
+
p("Outline")
|
|
367
386
|
] }) }),
|
|
368
387
|
/* @__PURE__ */ e.jsx(
|
|
369
|
-
|
|
388
|
+
S,
|
|
370
389
|
{
|
|
371
390
|
value: i,
|
|
372
391
|
className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
373
|
-
children:
|
|
392
|
+
children: f.createElement(K)
|
|
374
393
|
}
|
|
375
394
|
)
|
|
376
395
|
] }) })
|
|
@@ -379,5 +398,5 @@ const _s = () => {
|
|
|
379
398
|
] });
|
|
380
399
|
};
|
|
381
400
|
export {
|
|
382
|
-
|
|
401
|
+
zs as default
|
|
383
402
|
};
|