@chaibuilder/sdk 1.2.67 → 1.2.68
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-mbuhydG3.js → AddBlocks-ZpUetK5a.js} +1 -1
- package/dist/{AddBlocks-TVOOPK2w.cjs → AddBlocks-yiQ5OTLv.cjs} +1 -1
- package/dist/{CanvasArea-KJMcis97.cjs → CanvasArea-2cBQ9dE5.cjs} +1 -1
- package/dist/{CanvasArea-kg3Rgg9t.js → CanvasArea-jo84KvNu.js} +2 -2
- package/dist/{CodeEditor-q5unEaUI.js → CodeEditor-Jw5dt0Xj.js} +4 -4
- package/dist/{CodeEditor-QP6l0mv4.cjs → CodeEditor-KGtD1Of3.cjs} +1 -1
- package/dist/{SettingsPanel-MWeQjDWs.cjs → SettingsPanel-J5bAM-ug.cjs} +1 -1
- package/dist/{SettingsPanel-pomLrOxB.js → SettingsPanel-ukU3Ay9U.js} +6 -6
- package/dist/SidePanels-VyoLHl0W.cjs +1 -0
- package/dist/{SidePanels-YpRrvfiH.js → SidePanels-miYmxJN0.js} +41 -34
- package/dist/{Topbar-kVBx7pp4.js → Topbar-J3_SbpA_.js} +1 -1
- package/dist/{Topbar-veJ2_blW.cjs → Topbar-gVd8cET_.cjs} +1 -1
- package/dist/{UnsplashImages-sotLcz6r.js → UnsplashImages-7vkIHXUl.js} +1 -1
- package/dist/{UnsplashImages--MXx-DYM.cjs → UnsplashImages-hYgO0rjn.cjs} +1 -1
- package/dist/{UploadImages-xhxeYKkl.cjs → UploadImages-_t2yeuXp.cjs} +1 -1
- package/dist/{UploadImages-I0QQ6vj1.js → UploadImages-dHtEwNpW.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +8 -0
- package/dist/core.js +64 -61
- package/dist/{index-5hfuDpYs.cjs → index-CatHvcI6.cjs} +18 -18
- package/dist/{index-Zu-K_BX7.js → index-ElwrrnPk.js} +831 -661
- package/package.json +1 -1
- package/dist/SidePanels-9sbERNEv.cjs +0 -1
- package/dist/UILibrariesPanel-ES8YzN9C.js +0 -226
- package/dist/UILibrariesPanel-H8t36R6M.cjs +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),N=require("@radix-ui/react-icons"),i=require("react"),P=require("jotai"),u=require("lodash-es"),s=require("./context-menu-_8TFbFEJ.cjs"),c=require("./index-5hfuDpYs.cjs"),g=require("react-i18next"),f=require("lucide-react"),_=require("@chaibuilder/runtime"),h=require("./select-fXj5tdMX.cjs"),a=require("./STRINGS-gPz7CUOk.cjs"),S=require("./badge-7BVT3zxN.cjs"),I=require("./iconBase-vJD0OXxU.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("@radix-ui/react-select");const K=({provider:t,onClose:x})=>{const{t:o}=g.useTranslation(),[l,E]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(m=>E(m))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:j=>j?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(c.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(c.JsonView,{data:l,shouldExpandNode:c.allExpanded,style:{...c.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:x,onRemove:o}){const{t:l}=g.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:l("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const B=()=>{const{t}=g.useTranslation(),x=i.useMemo(()=>_.getChaiDataProviders(),[]),[o,l]=c.usePageDataProviders(),[,E]=P.useAtom(c.builderSaveStateAtom),[j,m]=i.useState(u.filter(x,r=>u.map(o,"providerKey").includes(r.providerKey))),[y,v]=i.useState(""),[q,R]=i.useState(null),w=u.filter(x.map(r=>u.map(j,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),T=r=>{const p=u.find(x,{providerKey:r});m(n=>[...n,p]),l(n=>[...n,{providerKey:p.providerKey,args:{}}]),v(""),E("UNSAVED")},b=r=>{m(p=>u.filter(p,n=>n.providerKey!==r.providerKey)),l(p=>u.filter(p,n=>n.providerKey!==r.providerKey)),E("UNSAVED")},d=r=>R(r);return u.isEmpty(x)?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(h.Select,{value:y,onValueChange:r=>T(r),children:[e.jsxRuntimeExports.jsx(h.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(h.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(h.SelectContent,{children:[e.jsxRuntimeExports.jsx(h.SelectItem,{value:"",children:t("choose")}),w.map(r=>e.jsxRuntimeExports.jsx(h.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:()=>d(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:()=>b(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(K,{onClose:()=>R(null),provider:q})]})]})},A=i.memo(()=>{const{t}=g.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"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,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(N.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(x).map(l=>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(l)}),e.jsxRuntimeExports.jsx("div",{children:t(x[l])})]},l))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(l=>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(l)}),e.jsxRuntimeExports.jsx("div",{children:t(o[l])})]},l))})]})})]})]})}),O=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-TVOOPK2w.cjs"))),C=i.lazy(()=>Promise.resolve().then(()=>require("./index-5hfuDpYs.cjs")).then(t=>t.ListTree$1)),U=i.lazy(()=>Promise.resolve().then(()=>require("./index-5hfuDpYs.cjs")).then(t=>t.ThemeConfigPanel$1)),z=i.lazy(()=>Promise.resolve().then(()=>require("./index-5hfuDpYs.cjs")).then(t=>t.ImagesPanel)),Y=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-H8t36R6M.cjs"))),V=()=>e.jsxRuntimeExports.jsx("div",{className:"w-72",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full animate-pulse rounded-md bg-gray-100"}),children:e.jsxRuntimeExports.jsx(O,{})})});let D=null;const M=()=>{const t=c.useBuilderProp("sideBarComponents.top",[]),x=c.useBuilderProp("sideBarComponents.bottom",[]),[o,l]=P.useAtom(c.activePanelAtom),[E,j]=i.useState(o),[m,y]=i.useState(null),{t:v}=g.useTranslation(),q=c.useBuilderProp("uiLibraries",[]),R=_.useChaiBlocks(),w=u.values(R).find(n=>n.category==="custom")!==void 0,T=q.length>0||w,b={"add-blocks":V,[a.OUTLINE_KEY]:C,"theme-configuration":U,images:z,"ui-libraries":Y};u.each(t,({name:n,panel:k})=>{b[n]=k});const d=n=>{clearTimeout(D),o!==a.OUTLINE_KEY&&n===a.OUTLINE_KEY?D=setTimeout(()=>l(a.OUTLINE_KEY),500):j(n),l(n)},r=c.useBuilderProp("dataBindingSupport",!1);function p(){const n=setTimeout(()=>{m&&(d(a.OUTLINE_KEY),clearTimeout(m))},500);y(n)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:p,onClick:()=>d(a.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:()=>d("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("ui-libraries"),size:"sm",variant:o==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(a.OUTLINE_KEY),size:"sm",variant:o===a.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("theme-configuration"),size:"sm",variant:o==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(f.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:n,icon:k})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(n),size:"sm",className:"w-10",variant:o===n?"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(A,{}),i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]}),o!==a.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:I.cn("relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"),onMouseEnter:()=>{m&&clearTimeout(m)},children:i.createElement(u.get(b,o,()=>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:r?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:a.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:a.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"mr-2 h-3"})," ",v("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(f.DatabaseIcon,{className:"mr-2 w-3"}),v("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:a.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.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm",children:[e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"mr-2 h-3"})," ",v("Outline")]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2",children:i.createElement(C)})]})})})]})};exports.default=M;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import { values as D, first as x, groupBy as U, get as g, map as _, capitalize as z, noop as T, has as I, isEmpty as L } from "lodash-es";
|
|
3
|
-
import * as R from "react";
|
|
4
|
-
import S, { useState as A, useRef as O, useCallback as G, useEffect as M } from "react";
|
|
5
|
-
import { w as H, c as C, e as F, s as W, i as $, t as J, r as K } from "./index-Zu-K_BX7.js";
|
|
6
|
-
import { useTranslation as P } from "react-i18next";
|
|
7
|
-
import { useChaiBlocks as X, syncBlocksWithDefaults as Y } from "@chaibuilder/runtime";
|
|
8
|
-
import { Loader as q } from "lucide-react";
|
|
9
|
-
import { atom as Q, useAtom as w } from "jotai";
|
|
10
|
-
import { c as E } from "./iconBase-zweRWSz0.js";
|
|
11
|
-
import { CaretSortIcon as V, CheckIcon as Z, CaretRightIcon as ee } from "@radix-ui/react-icons";
|
|
12
|
-
import { P as te, s as se, B as oe, t as re, u as ae, v as ie, w as ne, x as le, y as ce, z as de, S as me, X as ue, T as pe, d as xe, e as fe } from "./context-menu-sks9vdzC.js";
|
|
13
|
-
import { O as he } from "./STRINGS--j49GZJP.js";
|
|
14
|
-
import ge from "clsx";
|
|
15
|
-
import { useFeature as je } from "flagged";
|
|
16
|
-
import "./plugin-sJ3Hzvpv.js";
|
|
17
|
-
import "@react-hookz/web";
|
|
18
|
-
import "tree-model";
|
|
19
|
-
import "react-quill";
|
|
20
|
-
import "react-hotkeys-hook";
|
|
21
|
-
import "@floating-ui/dom";
|
|
22
|
-
import "@floating-ui/react-dom";
|
|
23
|
-
import "@tailwindcss/typography";
|
|
24
|
-
import "@tailwindcss/forms";
|
|
25
|
-
import "@tailwindcss/aspect-ratio";
|
|
26
|
-
import "tailwindcss-palette-generator";
|
|
27
|
-
import "tailwind-merge";
|
|
28
|
-
import "react-wrap-balancer";
|
|
29
|
-
import "react-dom";
|
|
30
|
-
import "prop-types";
|
|
31
|
-
import "@rjsf/validator-ajv8";
|
|
32
|
-
import "@rjsf/core";
|
|
33
|
-
import "react-arborist";
|
|
34
|
-
import "himalaya";
|
|
35
|
-
import "react-icons-picker";
|
|
36
|
-
import "react-autosuggest";
|
|
37
|
-
import "fuse.js";
|
|
38
|
-
import "i18next";
|
|
39
|
-
import "@radix-ui/react-scroll-area";
|
|
40
|
-
import "@radix-ui/react-switch";
|
|
41
|
-
import "@radix-ui/react-accordion";
|
|
42
|
-
import "class-variance-authority";
|
|
43
|
-
import "@radix-ui/react-alert-dialog";
|
|
44
|
-
import "@radix-ui/react-slot";
|
|
45
|
-
import "@radix-ui/react-label";
|
|
46
|
-
import "@radix-ui/react-tabs";
|
|
47
|
-
import "@radix-ui/react-tooltip";
|
|
48
|
-
import "@radix-ui/react-popover";
|
|
49
|
-
import "@radix-ui/react-hover-card";
|
|
50
|
-
import "@radix-ui/react-dropdown-menu";
|
|
51
|
-
import "@radix-ui/react-toast";
|
|
52
|
-
import "cmdk";
|
|
53
|
-
import "@radix-ui/react-dialog";
|
|
54
|
-
import "@radix-ui/react-context-menu";
|
|
55
|
-
function ke({
|
|
56
|
-
uiLibraries: t,
|
|
57
|
-
library: a,
|
|
58
|
-
setLibrary: i
|
|
59
|
-
}) {
|
|
60
|
-
var u;
|
|
61
|
-
const [d, l] = R.useState(!1), { t: s } = P();
|
|
62
|
-
return a ? /* @__PURE__ */ e.jsxs(te, { open: d, onOpenChange: l, children: [
|
|
63
|
-
/* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
64
|
-
/* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
|
|
65
|
-
/* @__PURE__ */ e.jsxs(
|
|
66
|
-
oe,
|
|
67
|
-
{
|
|
68
|
-
variant: "outline",
|
|
69
|
-
size: "sm",
|
|
70
|
-
role: "combobox",
|
|
71
|
-
"aria-expanded": d,
|
|
72
|
-
className: "w-[200px] justify-between",
|
|
73
|
-
children: [
|
|
74
|
-
a ? (u = t.find((o) => o.uuid === a)) == null ? void 0 : u.name : s("Select library"),
|
|
75
|
-
/* @__PURE__ */ e.jsx(V, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
] }) }),
|
|
80
|
-
/* @__PURE__ */ e.jsx(re, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ae, { children: [
|
|
81
|
-
/* @__PURE__ */ e.jsx(ie, { placeholder: "Search library...", className: "h-9" }),
|
|
82
|
-
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
83
|
-
/* @__PURE__ */ e.jsx(le, { children: "No library found." }),
|
|
84
|
-
/* @__PURE__ */ e.jsx(ce, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
|
|
85
|
-
de,
|
|
86
|
-
{
|
|
87
|
-
value: o.uuid,
|
|
88
|
-
onSelect: (p) => {
|
|
89
|
-
i(p), l(!1);
|
|
90
|
-
},
|
|
91
|
-
children: [
|
|
92
|
-
o.name,
|
|
93
|
-
/* @__PURE__ */ e.jsx(
|
|
94
|
-
Z,
|
|
95
|
-
{
|
|
96
|
-
className: E("ml-auto h-4 w-4", a === o.uuid ? "opacity-100" : "opacity-0")
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
o.uuid
|
|
102
|
-
)) })
|
|
103
|
-
] })
|
|
104
|
-
] }) })
|
|
105
|
-
] }) : null;
|
|
106
|
-
}
|
|
107
|
-
const we = ({
|
|
108
|
-
block: t,
|
|
109
|
-
closePopover: a,
|
|
110
|
-
library: i
|
|
111
|
-
}) => {
|
|
112
|
-
const [d, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: u, addPredefinedBlock: o } = W(), [p, j] = $(), [, k] = J(), f = g(t, "name", g(t, "label")), v = je("dnd"), [, B] = w(K), n = (r) => {
|
|
113
|
-
const m = I(r, "styles_attrs.data-page-section");
|
|
114
|
-
return r._type === "Box" && m;
|
|
115
|
-
}, b = G(
|
|
116
|
-
async (r) => {
|
|
117
|
-
if (r.stopPropagation(), I(t, "component")) {
|
|
118
|
-
u(t, x(p)), a();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
l(!0);
|
|
122
|
-
const m = await s(i, t);
|
|
123
|
-
let h = x(p);
|
|
124
|
-
n(x(m)) && (h = null), L(m) || o(Y(m), h), a();
|
|
125
|
-
},
|
|
126
|
-
[t]
|
|
127
|
-
), c = async (r) => {
|
|
128
|
-
const m = await s(i, t);
|
|
129
|
-
let h = x(p);
|
|
130
|
-
if (n(x(m)) && (h = null), !L(m)) {
|
|
131
|
-
const y = { blocks: m, uiLibrary: !0, parent: h };
|
|
132
|
-
if (r.dataTransfer.setData("text/plain", JSON.stringify(y)), t.preview) {
|
|
133
|
-
const N = new Image();
|
|
134
|
-
N.src = t.preview, N.onload = () => {
|
|
135
|
-
r.dataTransfer.setDragImage(N, 0, 0);
|
|
136
|
-
};
|
|
137
|
-
} else
|
|
138
|
-
r.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
139
|
-
B(y), setTimeout(() => {
|
|
140
|
-
j([]), k(null), a();
|
|
141
|
-
}, 200);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
return /* @__PURE__ */ e.jsxs(pe, { children: [
|
|
145
|
-
/* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
onClick: d ? () => {
|
|
149
|
-
} : b,
|
|
150
|
-
draggable: v ? "true" : "false",
|
|
151
|
-
onDragStart: c,
|
|
152
|
-
className: ge(
|
|
153
|
-
"relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"
|
|
154
|
-
),
|
|
155
|
-
children: [
|
|
156
|
-
d && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
|
|
157
|
-
/* @__PURE__ */ e.jsx(q, { className: "animate-spin", size: 15, color: "white" }),
|
|
158
|
-
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
159
|
-
] }),
|
|
160
|
-
t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: f }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: f }) })
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
) }),
|
|
164
|
-
/* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
|
|
165
|
-
] });
|
|
166
|
-
}, ve = Q({}), Be = (t) => {
|
|
167
|
-
const [a, i] = w(ve), d = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
|
|
168
|
-
return M(() => {
|
|
169
|
-
(async () => {
|
|
170
|
-
if (s || l.length > 0 || !t)
|
|
171
|
-
return;
|
|
172
|
-
i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
|
|
173
|
-
const u = await d(t);
|
|
174
|
-
i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: u || [] } }));
|
|
175
|
-
})();
|
|
176
|
-
}, [t, l, s]), { data: l, isLoading: s };
|
|
177
|
-
}, be = H("_selectedLibrary", null), Ne = () => {
|
|
178
|
-
const [t, a] = w(be), i = C("uiLibraries", []), d = X(), l = D(d).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: u, isLoading: o } = Be(s), p = U([...u, ...l], "group"), [j, k] = A("Hero"), [, f] = w(F), v = g(p, j, []), { t: B } = P(), n = O(null), b = (c) => {
|
|
179
|
-
n.current && (clearTimeout(n.current), n.current = null), n.current = setTimeout(() => {
|
|
180
|
-
n.current && k(c);
|
|
181
|
-
}, 300);
|
|
182
|
-
};
|
|
183
|
-
return o ? /* @__PURE__ */ e.jsx(me, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
|
|
184
|
-
s != null && s.uuid ? /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex h-fit flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ e.jsx("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: /* @__PURE__ */ e.jsx(ke, { library: s == null ? void 0 : s.uuid, setLibrary: a, uiLibraries: i }) }) }) }) : null,
|
|
185
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
|
|
186
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: S.Children.toArray(
|
|
187
|
-
_(p, (c, r) => /* @__PURE__ */ e.jsxs(
|
|
188
|
-
"div",
|
|
189
|
-
{
|
|
190
|
-
onMouseEnter: () => b(r),
|
|
191
|
-
onMouseLeave: () => clearTimeout(n.current),
|
|
192
|
-
onClick: () => k(r),
|
|
193
|
-
className: E(
|
|
194
|
-
"flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",
|
|
195
|
-
r === j ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
196
|
-
),
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */ e.jsx("span", { children: z(r) }),
|
|
199
|
-
/* @__PURE__ */ e.jsx(ee, { className: "ml-2 h-5 w-5" })
|
|
200
|
-
]
|
|
201
|
-
},
|
|
202
|
-
r
|
|
203
|
-
))
|
|
204
|
-
) }),
|
|
205
|
-
/* @__PURE__ */ e.jsxs(
|
|
206
|
-
ue,
|
|
207
|
-
{
|
|
208
|
-
onMouseEnter: () => n.current ? clearTimeout(n.current) : null,
|
|
209
|
-
className: "z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
|
|
210
|
-
children: [
|
|
211
|
-
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: B("Click on a block to add it to the page") }),
|
|
212
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: S.Children.toArray(
|
|
213
|
-
v.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(he) }))
|
|
214
|
-
) }),
|
|
215
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
216
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
217
|
-
/* @__PURE__ */ e.jsx("br", {})
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
)
|
|
221
|
-
] })
|
|
222
|
-
] }) });
|
|
223
|
-
}, Nt = () => /* @__PURE__ */ e.jsx(Ne, {});
|
|
224
|
-
export {
|
|
225
|
-
Nt as default
|
|
226
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),s=require("lodash-es"),g=require("react"),p=require("./index-5hfuDpYs.cjs"),S=require("react-i18next"),C=require("@chaibuilder/runtime"),T=require("lucide-react"),R=require("jotai"),I=require("./iconBase-vJD0OXxU.cjs"),N=require("@radix-ui/react-icons"),i=require("./context-menu-_8TFbFEJ.cjs"),L=require("./STRINGS-gPz7CUOk.cjs"),A=require("clsx"),P=require("flagged");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("tailwind-merge");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("@radix-ui/react-scroll-area");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const D=O(g);function _({uiLibraries:t,library:n,setLibrary:o}){var j;const[l,x]=D.useState(!1),{t:r}=S.useTranslation();return n?e.jsxRuntimeExports.jsxs(i.Popover,{open:l,onOpenChange:x,children:[e.jsxRuntimeExports.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("span",{children:r("Choose Library")}),e.jsxRuntimeExports.jsxs(i.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[n?(j=t.find(u=>u.uuid===n))==null?void 0:j.name:r("Select library"),e.jsxRuntimeExports.jsx(N.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(i.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(i.Command,{children:[e.jsxRuntimeExports.jsx(i.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(i.CommandList,{children:[e.jsxRuntimeExports.jsx(i.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(i.CommandGroup,{children:t.map(u=>e.jsxRuntimeExports.jsxs(i.CommandItem,{value:u.uuid,onSelect:f=>{o(f),x(!1)},children:[u.name,e.jsxRuntimeExports.jsx(N.CheckIcon,{className:I.cn("ml-auto h-4 w-4",n===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const M=({block:t,closePopover:n,library:o})=>{const[l,x]=g.useState(!1),r=p.useBuilderProp("getUILibraryBlock",s.noop),{addCoreBlock:j,addPredefinedBlock:u}=p.useAddBlock(),[f,q]=p.useSelectedBlockIds(),[,b]=p.useHighlightBlockId(),h=s.get(t,"name",s.get(t,"label")),k=P.useFeature("dnd"),[,v]=R.useAtom(p.draggedBlockAtom),a=c=>{const m=s.has(c,"styles_attrs.data-page-section");return c._type==="Box"&&m},w=g.useCallback(async c=>{if(c.stopPropagation(),s.has(t,"component")){j(t,s.first(f)),n();return}x(!0);const m=await r(o,t);let E=s.first(f);a(s.first(m))&&(E=null),s.isEmpty(m)||u(C.syncBlocksWithDefaults(m),E),n()},[t]),d=async c=>{const m=await r(o,t);let E=s.first(f);if(a(s.first(m))&&(E=null),!s.isEmpty(m)){const y={blocks:m,uiLibrary:!0,parent:E};if(c.dataTransfer.setData("text/plain",JSON.stringify(y)),t.preview){const B=new Image;B.src=t.preview,B.onload=()=>{c.dataTransfer.setDragImage(B,0,0)}}else c.dataTransfer.setDragImage(new Image,0,0);v(y),setTimeout(()=>{q([]),b(null),n()},200)}};return e.jsxRuntimeExports.jsxs(i.Tooltip,{children:[e.jsxRuntimeExports.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{onClick:l?()=>{}:w,draggable:k?"true":"false",onDragStart:d,className:A("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin",size:15,color:"white"}),e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[25px] w-full rounded-md",alt:h}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:h})})]})}),e.jsxRuntimeExports.jsx(i.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:h})})]})},U=R.atom({}),z=t=>{const[n,o]=R.useAtom(U),l=p.useBuilderProp("getUILibraryBlocks",s.noop),x=s.get(n,`${t==null?void 0:t.uuid}.blocks`,[]),r=s.get(n,`${t==null?void 0:t.uuid}.loading`,!1);return g.useEffect(()=>{(async()=>{if(r||x.length>0||!t)return;o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!0,blocks:[]}}));const j=await l(t);o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!1,blocks:j||[]}}))})()},[t,x,r]),{data:x,isLoading:r}},G=p.atomWithStorage("_selectedLibrary",null),H=()=>{const[t,n]=R.useAtom(G),o=p.useBuilderProp("uiLibraries",[]),l=C.useChaiBlocks(),x=s.values(l).filter(d=>d.category==="custom"),r=o.find(d=>d.uuid===t)||s.first(o),{data:j,isLoading:u}=z(r),f=s.groupBy([...j,...x],"group"),[q,b]=g.useState("Hero"),[,h]=R.useAtom(p.activePanelAtom),k=s.get(f,q,[]),{t:v}=S.useTranslation(),a=g.useRef(null),w=d=>{a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{a.current&&b(d)},300)};return u?e.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full w-full"}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background",children:[r!=null&&r.uuid?e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:e.jsxRuntimeExports.jsx(_,{library:r==null?void 0:r.uuid,setLibrary:n,uiLibraries:o})})})}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex h-[95%] border-t border-gray-300 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-40 flex-col gap-1 px-1",children:g.Children.toArray(s.map(f,(d,c)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>w(c),onMouseLeave:()=>clearTimeout(a.current),onClick:()=>b(c),className:I.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",c===q?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:s.capitalize(c)}),e.jsxRuntimeExports.jsx(N.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},c)))}),e.jsxRuntimeExports.jsxs(i.ScrollArea,{onMouseEnter:()=>a.current?clearTimeout(a.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500",children:v("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:g.Children.toArray(k.map(d=>e.jsxRuntimeExports.jsx(M,{block:d,library:r,closePopover:()=>h(L.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},F=()=>e.jsxRuntimeExports.jsx(H,{});exports.default=F;
|