@blocknote/shadcn
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
2 lines • 39.4 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@blocknote/core`),l=require(`@blocknote/react`),u=require(`react`);u=s(u,1);let d=require(`react-hook-form`),f=require(`@radix-ui/react-avatar`);f=s(f,1);let p=require(`clsx`),m=require(`tailwind-merge`),h=require(`react/jsx-runtime`),g=require(`@radix-ui/react-slot`),_=require(`class-variance-authority`),v=require(`@radix-ui/react-dropdown-menu`);v=s(v,1);let y=require(`lucide-react`),b=require(`@radix-ui/react-label`);b=s(b,1);let x=require(`@radix-ui/react-popover`);x=s(x,1);let S=require(`@radix-ui/react-select`);S=s(S,1);let C=require(`@radix-ui/react-tabs`);C=s(C,1);let w=require(`@radix-ui/react-toggle`);w=s(w,1);let T=require(`@radix-ui/react-tooltip`);T=s(T,1);let ee=require(`react-dom`);function E(...e){return(0,m.twMerge)((0,p.clsx)(e))}function te({className:e,...t}){return(0,h.jsx)(f.Root,{"data-slot":`avatar`,className:E(`relative flex size-8 shrink-0 overflow-hidden rounded-full`,e),...t})}function ne({className:e,...t}){return(0,h.jsx)(f.Image,{"data-slot":`avatar-image`,className:E(`aspect-square size-full`,e),...t})}function re({className:e,...t}){return(0,h.jsx)(f.Fallback,{"data-slot":`avatar-fallback`,className:E(`bg-muted flex size-full items-center justify-center rounded-full`,e),...t})}var ie=(0,_.cva)(`inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function ae({className:e,variant:t,asChild:n=!1,...r}){return(0,h.jsx)(n?g.Slot:`span`,{"data-slot":`badge`,className:E(ie({variant:t}),e),...r})}var oe=(0,_.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-xs hover:bg-primary/90`,destructive:`bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function se({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,h.jsx)(r?g.Slot:`button`,{"data-slot":`button`,className:E(oe({variant:t,size:n,className:e})),...i})}function ce({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card`,className:E(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function le({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-content`,className:E(`px-6`,e),...t})}function ue({...e}){return(0,h.jsx)(v.Root,{"data-slot":`dropdown-menu`,...e})}function de({...e}){return(0,h.jsx)(v.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function D({className:e,sideOffset:t=4,...n}){return(0,h.jsx)(v.Content,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md`,e),...n})}function O({className:e,inset:t,variant:n=`default`,...r}){return(0,h.jsx)(v.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r})}function k({className:e,children:t,checked:n,...r}){return(0,h.jsxs)(v.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:E(`focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:n,...r,children:[(0,h.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,h.jsx)(v.ItemIndicator,{children:(0,h.jsx)(y.CheckIcon,{className:`size-4`})})}),t]})}function A({className:e,inset:t,...n}){return(0,h.jsx)(v.Label,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:E(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function j({className:e,...t}){return(0,h.jsx)(v.Separator,{"data-slot":`dropdown-menu-separator`,className:E(`bg-border -mx-1 my-1 h-px`,e),...t})}function M({...e}){return(0,h.jsx)(v.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function N({className:e,inset:t,children:n,...r}){return(0,h.jsxs)(v.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:E(`focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm data-[inset]:pl-8`,e),...r,children:[n,(0,h.jsx)(y.ChevronRightIcon,{className:`ml-auto size-4`})]})}function P({className:e,...t}){return(0,h.jsx)(v.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg`,e),...t})}function F({className:e,...t}){return(0,h.jsx)(b.Root,{"data-slot":`label`,className:E(`flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50`,e),...t})}var I=d.FormProvider;u.createContext({}),u.createContext({});function L({className:e,type:t,...n}){return(0,h.jsx)(`input`,{type:t,"data-slot":`input`,className:E(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,e),...n})}function R({...e}){return(0,h.jsx)(x.Root,{"data-slot":`popover`,...e})}function z({...e}){return(0,h.jsx)(x.Trigger,{"data-slot":`popover-trigger`,...e})}function B({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,h.jsx)(x.Content,{"data-slot":`popover-content`,align:t,sideOffset:n,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin) outline-hidden z-50 w-72 rounded-md border p-4 shadow-md`,e),...r})}function V({...e}){return(0,h.jsx)(S.Root,{"data-slot":`select`,...e})}function H({...e}){return(0,h.jsx)(S.Value,{"data-slot":`select-value`,...e})}function fe({className:e,size:t=`default`,children:n,...r}){return(0,h.jsxs)(S.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:E(`border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=text-])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 shadow-xs flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[n,(0,h.jsx)(S.Icon,{asChild:!0,children:(0,h.jsx)(y.ChevronDownIcon,{className:`size-4 opacity-50`})})]})}function pe({className:e,children:t,position:n=`popper`,...r}){return(0,h.jsxs)(S.Content,{"data-slot":`select-content`,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) relative z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border shadow-md`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,h.jsx)(he,{}),(0,h.jsx)(S.Viewport,{className:E(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,h.jsx)(ge,{})]})}function me({className:e,children:t,...n}){return(0,h.jsxs)(S.Item,{"data-slot":`select-item`,className:E(`focus:bg-accent focus:text-accent-foreground [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-2 pr-8 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[(0,h.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,h.jsx)(S.ItemIndicator,{children:(0,h.jsx)(y.CheckIcon,{className:`size-4`})})}),(0,h.jsx)(S.ItemText,{children:t})]})}function he({className:e,...t}){return(0,h.jsx)(S.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:E(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,h.jsx)(y.ChevronUpIcon,{className:`size-4`})})}function ge({className:e,...t}){return(0,h.jsx)(S.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:E(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,h.jsx)(y.ChevronDownIcon,{className:`size-4`})})}function _e({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`skeleton`,className:E(`bg-accent animate-pulse rounded-md`,e),...t})}function ve({className:e,...t}){return(0,h.jsx)(C.Root,{"data-slot":`tabs`,className:E(`flex flex-col gap-2`,e),...t})}function ye({className:e,...t}){return(0,h.jsx)(C.List,{"data-slot":`tabs-list`,className:E(`bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]`,e),...t})}function be({className:e,...t}){return(0,h.jsx)(C.Trigger,{"data-slot":`tabs-trigger`,className:E(`data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-1 text-sm font-medium transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...t})}function xe({className:e,...t}){return(0,h.jsx)(C.Content,{"data-slot":`tabs-content`,className:E(`flex-1 outline-none`,e),...t})}var Se=(0,_.cva)(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-2 min-w-9`,sm:`h-8 px-1.5 min-w-8`,lg:`h-10 px-2.5 min-w-10`}},defaultVariants:{variant:`default`,size:`default`}});function Ce({className:e,variant:t,size:n,...r}){return(0,h.jsx)(w.Root,{"data-slot":`toggle`,className:E(Se({variant:t,size:n,className:e})),...r})}function U({delayDuration:e=0,...t}){return(0,h.jsx)(T.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function we({...e}){return(0,h.jsx)(U,{children:(0,h.jsx)(T.Root,{"data-slot":`tooltip`,...e})})}function Te({...e}){return(0,h.jsx)(T.Trigger,{"data-slot":`tooltip-trigger`,...e})}function Ee({className:e,sideOffset:t=0,children:n,...r}){return(0,h.jsxs)(T.Content,{"data-slot":`tooltip-content`,sideOffset:t,className:E(`bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-tooltip-content-transform-origin) z-50 w-fit text-balance rounded-md px-3 py-1.5 text-xs`,e),...r,children:[n,(0,h.jsx)(T.Arrow,{className:`bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})}var W={Avatar:{Avatar:te,AvatarFallback:re,AvatarImage:ne},Badge:{Badge:ae},Button:{Button:se},Card:{Card:ce,CardContent:le},DropdownMenu:{DropdownMenu:ue,DropdownMenuCheckboxItem:k,DropdownMenuContent:D,DropdownMenuItem:O,DropdownMenuLabel:A,DropdownMenuSeparator:j,DropdownMenuSub:M,DropdownMenuSubContent:P,DropdownMenuSubTrigger:N,DropdownMenuTrigger:de},Form:{Form:I},Input:{Input:L},Label:{Label:F},Popover:{Popover:R,PopoverContent:B,PopoverTrigger:z},Select:{Select:V,SelectContent:pe,SelectItem:me,SelectTrigger:fe,SelectValue:H},Skeleton:{Skeleton:_e},Tabs:{Tabs:ve,TabsContent:xe,TabsList:ye,TabsTrigger:be},Toggle:{Toggle:Ce},Tooltip:{Tooltip:we,TooltipContent:Ee,TooltipProvider:U,TooltipTrigger:Te}},G=(0,u.createContext)(void 0);function K(){return(0,u.useContext)(G)}var De=e=>{let{children:t,...n}=e;(0,c.assertEmpty)(n);let r=K(),i=(0,d.useForm)();return(0,h.jsx)(r.Form.Form,{...i,children:t})},Oe=(0,u.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:l,placeholder:u,disabled:d,onKeyDown:f,onChange:p,onSubmit:m,autoComplete:g,"aria-activedescendant":_,rightSection:v,...y}=e;(0,c.assertEmpty)(y);let b=K();return(0,h.jsxs)(`div`,{className:E(n,`border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,`text-foreground items-center gap-2`),children:[o,(0,h.jsxs)(`div`,{className:`flex-1`,children:[i&&(0,h.jsx)(b.Label.Label,{htmlFor:i,children:i}),(0,h.jsx)(b.Input.Input,{className:E(n,`h-auto border-none p-0`),id:i,name:r,autoFocus:l,placeholder:u,disabled:d,value:s,onKeyDown:f,onChange:p,onSubmit:m,ref:t,"aria-activedescendant":_})]}),v]})}),ke=e=>(0,u.forwardRef)((t,n)=>(0,h.jsx)(e,{onPointerDown:e=>{e.nativeEvent.fakeEvent||(e.ctrlKey=!0)},onPointerUp:e=>{let t=new PointerEvent(`pointerdown`,e.nativeEvent);t.fakeEvent=!0,e.target.dispatchEvent(t)},...t,ref:n})),Ae=e=>{let{children:t,onOpenChange:n,position:r,sub:i,...a}=e;(0,c.assertEmpty)(a);let o=K();return i?(0,h.jsx)(o.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:t}):(0,h.jsx)(o.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:n,children:t})},je=e=>{let{children:t,sub:n,...r}=e;(0,c.assertEmpty)(r);let i=K(),a=(0,u.useMemo)(()=>ke(i.DropdownMenu.DropdownMenuTrigger),[i.DropdownMenu.DropdownMenuTrigger]);return n?(0,h.jsx)(i.DropdownMenu.DropdownMenuSubTrigger,{children:t}):(0,h.jsx)(a,{asChild:!0,...r,children:t})},Me=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;(0,c.assertEmpty)(a);let o=K();return i?(0,h.jsx)(o.DropdownMenu.DropdownMenuSubContent,{className:n,ref:t,children:r}):(0,h.jsx)(o.DropdownMenu.DropdownMenuContent,{className:n,ref:t,children:r})}),Ne=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,subTrigger:o,onClick:s,...l}=e;(0,c.assertEmpty)(l);let u=K();return o?(0,h.jsxs)(h.Fragment,{children:[i,r]}):a===void 0?(0,h.jsxs)(u.DropdownMenu.DropdownMenuItem,{className:n,ref:t,onClick:s,...l,children:[i,r,o&&(0,h.jsx)(y.ChevronRight,{className:`ml-auto h-4 w-4`})]}):(0,h.jsxs)(u.DropdownMenu.DropdownMenuCheckboxItem,{className:E(n,`gap-1`,a?``:`px-2`),ref:t,checked:a,onClick:s,...l,children:[i,r]})}),Pe=(0,u.forwardRef)((e,t)=>{let{className:n,...r}=e;return(0,c.assertEmpty)(r),(0,h.jsx)(K().DropdownMenu.DropdownMenuSeparator,{className:n,ref:t})}),Fe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(K().DropdownMenu.DropdownMenuLabel,{className:n,ref:t,children:r})}),Ie=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:l,label:u,...d}=e;return(0,c.assertEmpty)(d,!1),(0,h.jsxs)(K().Button.Button,{variant:`ghost`,className:E(n,`text-gray-400`),ref:t,"aria-label":u,onClick:a,onDragStart:s,onDragEnd:o,draggable:l,...d,children:[i,r]})}),Le=(0,u.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...l}=e;(0,c.assertEmpty)(l);let u=K();return(0,h.jsxs)(u.Tabs.Tabs,{className:E(n,`bg-popover max-w-screen rounded-lg p-2`),ref:t,value:a,defaultValue:i,onValueChange:o,children:[(0,h.jsx)(u.Tabs.TabsList,{children:r.map(e=>(0,h.jsx)(u.Tabs.TabsTrigger,{value:e.name,children:e.name},e.name))}),r.map(e=>(0,h.jsx)(u.Tabs.TabsContent,{value:e.name,children:(0,h.jsx)(u.Card.Card,{children:(0,h.jsx)(u.Card.CardContent,{className:`p-4`,children:e.tabPanel})})},e.name))]})}),Re=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(`div`,{className:E(n,`flex flex-col items-start justify-center gap-2`),ref:t,children:r})}),ze=(0,u.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;return(0,c.assertEmpty)(s),(0,h.jsx)(K().Input.Input,{"data-test":`embed-input`,className:E(n,`w-80 max-w-full`),ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),q=(0,u.createContext)(void 0),Be=e=>{let{children:t,open:n,onOpenChange:r,position:i,portalRoot:a,...o}=e;return(0,c.assertEmpty)(o),(0,h.jsx)(K().Popover.Popover,{open:n,onOpenChange:r,children:(0,h.jsx)(q.Provider,{value:a,children:t})})},Ve=(0,u.forwardRef)((e,t)=>{let{children:n,...r}=e;return(0,c.assertEmpty)(r),(0,h.jsx)(K().Popover.PopoverTrigger,{ref:t,asChild:!0,children:n})}),He=(0,u.forwardRef)((e,t)=>{let{className:n,variant:r,children:i,...a}=e;(0,c.assertEmpty)(a);let o=K(),s=(0,u.useContext)(q),l=(0,h.jsx)(o.Popover.PopoverContent,{sideOffset:8,className:E(n,`flex flex-col gap-2`,r===`panel-popover`?`w-fit max-w-none border-none p-0 shadow-none`:``),ref:t,children:i});return s?(0,ee.createPortal)(l,s):l}),Ue=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i,!1),(0,h.jsx)(`div`,{className:n,ref:t,...i,children:r})}),We=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:l,label:u,...d}=e;return(0,c.assertEmpty)(d,!1),(0,h.jsxs)(K().Button.Button,{variant:`ghost`,className:E(n,`text-gray-400`),ref:t,"aria-label":u,onClick:a,onDragStart:s,onDragEnd:o,draggable:l,...d,children:[i,r]})}),Ge=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return(0,c.assertEmpty)(o),(0,h.jsx)(`div`,{className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md`,`grid`,n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),Ke=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return(0,c.assertEmpty)(a),(0,h.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),qe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return(0,c.assertEmpty)(a),(0,h.jsx)(`div`,{id:i,role:`listbox`,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md`,n),ref:t,children:r})}),Je=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,n),ref:t,children:(0,h.jsx)(`div`,{children:r})})}),Ye=(0,u.forwardRef)((e,t)=>{let n=K(),{className:r,item:i,isSelected:a,onClick:o,id:s,...d}=e;(0,c.assertEmpty)(d);let f=(0,u.useRef)(null);return(0,u.useEffect)(()=>{!f.current||!a||(0,l.elementOverflow)(f.current,f.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&f.current.scrollIntoView({block:`nearest`})},[a]),(0,h.jsxs)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,e.item.size===`small`?`gap-3 py-1`:``,r),"data-highlighted":!0,ref:(0,l.mergeRefs)([t,f]),id:s,onMouseDown:e=>e.preventDefault(),onClick:o,role:`option`,"aria-selected":a||void 0,children:[i.icon&&(0,h.jsx)(`div`,{className:E(`p-3`,e.item.size===`small`?`p-0`:``,r),"data-position":`left`,children:i.icon}),(0,h.jsxs)(`div`,{className:`flex-1`,children:[(0,h.jsx)(`div`,{className:E(`text-base`,e.item.size===`small`?`text-sm`:``,r),children:i.title}),(0,h.jsx)(`div`,{className:E(`text-xs`,e.item.size===`small`?`hidden`:``,r),children:i.subtext})]}),i.badge&&(0,h.jsx)(`div`,{"data-position":`right`,className:`text-xs`,children:(0,h.jsx)(n.Badge.Badge,{variant:`secondary`,children:i.badge})})]})}),Xe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(`div`,{className:E(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),ref:t,children:r})}),Ze=(0,u.forwardRef)((e,t)=>{let{className:n,...r}=e;return(0,c.assertEmpty)(r),(0,h.jsx)(`div`,{className:E(n,`animate-spin`),ref:t,children:(0,h.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1em`,viewBox:`0 -960 960 960`,width:`1em`,fill:`#e8eaed`,children:(0,h.jsx)(`path`,{d:`M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z`})})})}),Qe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,onMouseDown:i,onClick:a,...o}=e;return(0,c.assertEmpty)(o,!1),(0,h.jsx)(K().Button.Button,{variant:`ghost`,className:E(n,`h-full w-full p-0 text-gray-400`,n?.includes(`extend-button-add-remove-columns`)?`ml-1`:`mt-1`,n?.includes(`extend-button-editing`)?`bg-accent text-accent-foreground`:``),ref:t,onClick:a,onMouseDown:i,...o,children:r})}),$e=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:l,...u}=e;return(0,c.assertEmpty)(u,!1),(0,h.jsx)(K().Button.Button,{variant:`ghost`,className:E(n,`h-fit w-fit p-0 text-gray-400`),ref:t,"aria-label":l,draggable:i,onDragStart:a,onDragEnd:o,style:s,...u,children:r})}),J=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,onMouseEnter:i,onMouseLeave:a,variant:o,...s}=e;return(0,c.assertEmpty)(s),(0,h.jsx)(K().Tooltip.TooltipProvider,{delayDuration:0,children:(0,h.jsx)(`div`,{className:E(n,`bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md`,o===`action-toolbar`?`w-fit`:``),ref:t,onMouseEnter:i,onMouseLeave:a,children:r})})}),Y=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:l,onClick:u,label:d,variant:f,...p}=e;(0,c.assertEmpty)(p,!1);let m=K(),g=s===void 0?(0,h.jsxs)(m.Button.Button,{className:E(n,f===`compact`?`h-6 min-w-6 p-0`:``),variant:`ghost`,size:f===`compact`?`sm`:`default`,disabled:l,onClick:u,ref:t,"aria-label":d,...p,children:[o,r]}):(0,h.jsxs)(m.Toggle.Toggle,{className:E(n,`data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground`,f===`compact`?`h-6 min-w-6 p-0`:``),size:f===`compact`?`sm`:`default`,"aria-label":d,onClick:u,pressed:s,disabled:l,"data-state":s?`on`:`off`,"data-disabled":l,ref:t,...p,children:[o,r]});return(0,h.jsxs)(m.Tooltip.Tooltip,{children:[(0,h.jsx)(m.Tooltip.TooltipTrigger,{asChild:!0,children:g}),(0,h.jsxs)(m.Tooltip.TooltipContent,{className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,h.jsx)(`span`,{children:i}),a&&(0,h.jsx)(`span`,{children:a})]})]})}),X=(0,u.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,...a}=e;(0,c.assertEmpty)(a);let o=K(),s=e=>(0,h.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.icon,e.text]}),l=r.filter(e=>e.isSelected)[0];return l?(0,h.jsxs)(o.Select.Select,{value:l.text,onValueChange:e=>r.find(t=>t.text===e).onClick?.(),disabled:i,children:[(0,h.jsx)(o.Select.SelectTrigger,{className:`border-none`,children:(0,h.jsx)(o.Select.SelectValue,{})}),(0,h.jsx)(o.Select.SelectContent,{className:n,ref:t,children:r.map(e=>(0,h.jsx)(o.Select.SelectItem,{disabled:e.isDisabled,value:e.text,children:(0,h.jsx)(s,{...e})},e.text))})]}):null}),et=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,selected:i,headerText:a,onFocus:o,onBlur:s,tabIndex:l,...u}=e;return(0,c.assertEmpty)(u),(0,h.jsxs)(K().Card.Card,{className:E(n,`w-[300px]`,i?`bg-accent text-accent-foreground`:``),onFocus:o,onBlur:s,tabIndex:l,ref:t,children:[a&&(0,h.jsx)(`div`,{className:`px-4 pt-4 text-sm italic`,children:a}),r]})}),tt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(`div`,{className:E(n,`p-4`,n?.includes(`thread-comments`)?`flex flex-col gap-6 border-b`:``),ref:t,children:r})}),nt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i,!1),(0,h.jsx)(K().Button.Button,{className:E(n,`text-foreground w-fit bg-transparent p-0 hover:bg-transparent`),ref:t,children:r})}),rt=(0,u.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=(0,l.useDictionary)();(0,c.assertEmpty)(a,!1);let s=K();return n===`loading`?(0,h.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,h.jsx)(s.Skeleton.Skeleton,{className:`size-7 animate-pulse rounded-full bg-neutral-400`}),(0,h.jsx)(s.Skeleton.Skeleton,{className:`h-3 w-32 animate-pulse rounded-full bg-neutral-400`})]}):(0,h.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,h.jsxs)(s.Avatar.Avatar,{children:[(0,h.jsx)(s.Avatar.AvatarImage,{src:n.avatarUrl,alt:n.username,className:`h-7 rounded-full`}),(0,h.jsx)(s.Avatar.AvatarFallback,{children:n.username[0]})]}),(0,h.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-bold`,children:n.username}),(0,h.jsxs)(`span`,{className:`text-xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),Z=(0,u.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,actions:o,edited:s,emojiPickerOpen:d,children:f,...p}=e;(0,c.assertEmpty)(p);let[m,g]=(0,u.useState)(!1),{focused:_,ref:v}=(0,l.useFocusWithin)(),y=o&&(r===!0||r===void 0||r===`hover`&&m||_||d);return(0,h.jsxs)(`div`,{ref:t,className:E(n,`relative flex flex-col gap-2`),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[y?(0,h.jsx)(`div`,{className:`absolute right-0 top-0 z-10`,ref:v,children:o}):null,(0,h.jsx)(rt,{...e}),f]})}),it=(0,u.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:i,autoFocus:a,editor:o,editable:s,...u}=e;(0,c.assertEmpty)(u);let d=(0,l.useBlockNoteContext)();return(0,h.jsx)($,{autoFocus:a,className:E(n,``),theme:d?.colorSchemePreference,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,ref:t,onFocus:r,onBlur:i,children:(0,h.jsx)(l.FormattingToolbarController,{formattingToolbar:at})})}),at=()=>(0,h.jsx)(l.FormattingToolbar,{blockTypeSelectItems:[],children:(0,l.getFormattingToolbarItems)([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`)}),ot=(0,u.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:l,onMouseEnter:u,...d}=e;(0,c.assertEmpty)(d,!1);let f=K(),p=(0,h.jsxs)(f.Button.Button,{variant:a?`secondary`:`outline`,className:E(n,`flex h-7 items-center gap-1 rounded-full px-2.5`),onClick:l,onMouseEnter:u,ref:t,children:[(0,h.jsx)(`span`,{children:i}),(0,h.jsx)(`span`,{children:r})]});return o?(0,h.jsxs)(f.Tooltip.Tooltip,{children:[(0,h.jsx)(f.Tooltip.TooltipTrigger,{asChild:!0,children:p}),(0,h.jsxs)(f.Tooltip.TooltipContent,{className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,h.jsx)(`span`,{children:o}),s&&(0,h.jsx)(`span`,{children:s})]})]}):p}),st=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,h.jsx)(K().Tooltip.TooltipProvider,{delayDuration:0,children:(0,h.jsx)(`div`,{className:E(n,`flex w-full flex-row flex-wrap gap-1`),ref:t,children:r})})}),ct=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,onClick:i,label:a,...o}=e;return(0,c.assertEmpty)(o),(0,h.jsx)(K().Button.Button,{type:`submit`,className:n,"aria-label":a,ref:t,onClick:i,children:r})}),lt=(0,u.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;return(0,c.assertEmpty)(s),(0,h.jsx)(K().Input.Input,{type:`file`,className:n,ref:t,accept:r,value:i?i.name:void 0,onChange:async e=>o?.(e.target.files[0]),placeholder:a})}),ut=(0,u.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;(0,c.assertEmpty)(s);let d=(0,u.useRef)(null);return(0,u.useEffect)(()=>{!d.current||!r||(0,l.elementOverflow)(d.current,d.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&d.current.scrollIntoView({block:`nearest`})},[r]),(0,h.jsx)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,`text-lg!`,n),ref:(0,l.mergeRefs)([t,d]),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),dt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return(0,c.assertEmpty)(a),(0,h.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),Q={FormattingToolbar:{Root:J,Button:Y,Select:X},FilePanel:{Root:Le,Button:ct,FileInput:lt,TabPanel:Re,TextInput:ze},LinkToolbar:{Root:J,Button:Y,Select:X},SideMenu:{Root:Ue,Button:We},SuggestionMenu:{Root:qe,Item:Ye,EmptyItem:Je,Label:Xe,Loader:Ze},GridSuggestionMenu:{Root:Ge,Item:ut,EmptyItem:Ke,Loader:dt},TableHandle:{Root:$e,ExtendButton:Qe},Comments:{Comment:Z,Editor:it,Card:et,CardSection:tt,ExpandSectionsPrompt:nt},Generic:{Badge:{Root:ot,Group:st},Toolbar:{Root:J,Button:Y,Select:X},Form:{Root:De,TextInput:Oe},Menu:{Root:Ae,Trigger:je,Dropdown:Me,Divider:Pe,Label:Fe,Item:Ne,Button:Ie},Popover:{Root:Be,Trigger:Ve,Content:He}}},$=e=>{let{className:t,shadCNComponents:n,...r}=e,i=(0,u.useMemo)(()=>({...W,...n}),[n]);return(0,h.jsx)(G.Provider,{value:i,children:(0,h.jsx)(l.ComponentsContext.Provider,{value:Q,children:(0,h.jsx)(l.BlockNoteViewRaw,{className:(0,c.mergeCSSClasses)(`bn-shadcn`,t||``),...r})})})};exports.BlockNoteView=$,exports.ShadCNComponentsContext=G,exports.ShadCNDefaultComponents=W,exports.components=Q,exports.useShadCNComponentsContext=K;
//# sourceMappingURL=blocknote-shadcn.cjs.map