@blocknote/shadcn 0.30.0 → 0.30.1

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.
Files changed (45) hide show
  1. package/dist/blocknote-shadcn.cjs +1 -1
  2. package/dist/blocknote-shadcn.cjs.map +1 -1
  3. package/dist/blocknote-shadcn.js +2 -2
  4. package/dist/blocknote-shadcn.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +5 -4
  8. package/src/BlockNoteView.tsx +2 -2
  9. package/src/badge/Badge.tsx +8 -7
  10. package/src/comments/Card.tsx +9 -6
  11. package/src/comments/Comment.tsx +10 -5
  12. package/src/comments/Editor.tsx +3 -2
  13. package/src/components/ui/avatar.tsx +3 -3
  14. package/src/components/ui/badge.tsx +1 -1
  15. package/src/components/ui/button.tsx +2 -2
  16. package/src/components/ui/card.tsx +2 -2
  17. package/src/components/ui/dropdown-menu.tsx +14 -11
  18. package/src/components/ui/form.tsx +6 -5
  19. package/src/components/ui/input.tsx +2 -2
  20. package/src/components/ui/label.tsx +1 -1
  21. package/src/components/ui/popover.tsx +1 -1
  22. package/src/components/ui/select.tsx +19 -13
  23. package/src/components/ui/skeleton.tsx +1 -1
  24. package/src/components/ui/tabs.tsx +3 -3
  25. package/src/components/ui/toggle.tsx +1 -1
  26. package/src/components/ui/tooltip.tsx +1 -1
  27. package/src/menu/Button.tsx +2 -1
  28. package/src/menu/Menu.tsx +18 -11
  29. package/src/panel/Panel.tsx +2 -1
  30. package/src/panel/PanelButton.tsx +2 -1
  31. package/src/panel/PanelTab.tsx +3 -2
  32. package/src/popover/popover.tsx +5 -4
  33. package/src/sideMenu/SideMenuButton.tsx +2 -1
  34. package/src/suggestionMenu/SuggestionMenu.tsx +3 -2
  35. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +3 -2
  36. package/src/suggestionMenu/SuggestionMenuItem.tsx +4 -3
  37. package/src/suggestionMenu/SuggestionMenuLabel.tsx +2 -1
  38. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.tsx +2 -1
  39. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuEmptyItem.tsx +2 -1
  40. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +3 -2
  41. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuLoader.tsx +2 -1
  42. package/src/tableHandle/ExtendButton.tsx +3 -2
  43. package/src/tableHandle/TableHandle.tsx +2 -1
  44. package/src/tailwindStyles.css +25 -25
  45. package/src/toolbar/Toolbar.tsx +17 -11
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("@blocknote/core"),y=require("@blocknote/react"),b=require("react"),F=require("react-hook-form"),fe=require("@radix-ui/react-avatar"),ge=require("clsx"),xe=require("tailwind-merge"),M=require("class-variance-authority"),z=require("@radix-ui/react-slot"),he=require("@radix-ui/react-dropdown-menu"),j=require("lucide-react"),ve=require("@radix-ui/react-label"),we=require("@radix-ui/react-popover"),Ne=require("@radix-ui/react-select"),ye=require("@radix-ui/react-tabs"),Ce=require("@radix-ui/react-toggle"),je=require("@radix-ui/react-tooltip");function C(n){if(n&&typeof n=="object"&&"default"in n)return n;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const m=C(b),T=C(fe),h=C(he),V=C(ve),I=C(we),v=C(Ne),S=C(ye),q=C(Ce),R=C(je),Se=xe.extendTailwindMerge({prefix:"bn-"});function d(...n){return Se(ge.clsx(n))}const _=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Root,{ref:e,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...t}));_.displayName=T.Root.displayName;const A=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Image,{ref:e,className:d("aspect-square h-full w-full",n),...t}));A.displayName=T.Image.displayName;const $=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Fallback,{ref:e,className:d("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...t}));$.displayName=T.Fallback.displayName;const Te=M.cva("bn-inline-flex bn-items-center bn-rounded-full bn-border bn-px-2.5 bn-py-0.5 bn-text-xs bn-font-semibold bn-transition-colors focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2",{variants:{variant:{default:"bn-border-transparent bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/80",secondary:"bn-border-transparent bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",destructive:"bn-border-transparent bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/80",outline:"bn-text-foreground"}},defaultVariants:{variant:"default"}});function Re({className:n,variant:t,...e}){return o.jsx("div",{className:d(Te({variant:t}),n),...e})}const Me=M.cva("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50",{variants:{variant:{default:"bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/90",destructive:"bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/90",outline:"bn-border bn-border-input bn-bg-background hover:bn-bg-accent hover:bn-text-accent-foreground",secondary:"bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",ghost:"hover:bn-bg-accent hover:bn-text-accent-foreground",link:"bn-text-primary bn-underline-offset-4 hover:bn-underline"},size:{default:"bn-h-10 bn-px-4 bn-py-2",sm:"bn-h-9 bn-rounded-md bn-px-3",lg:"bn-h-11 bn-rounded-md bn-px-8",icon:"bn-h-10 bn-w-10"}},defaultVariants:{variant:"default",size:"default"}}),O=m.forwardRef(({className:n,variant:t,size:e,asChild:s=!1,...r},a)=>{const i=s?z.Slot:"button";return o.jsx(i,{className:d(Me({variant:t,size:e,className:n})),ref:a,type:"button",...r})});O.displayName="Button";const G=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...t}));G.displayName="Card";const Ie=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...t}));Ie.displayName="CardHeader";const De=m.forwardRef(({className:n,...t},e)=>o.jsx("h3",{ref:e,className:d("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...t}));De.displayName="CardTitle";const Ee=m.forwardRef(({className:n,...t},e)=>o.jsx("p",{ref:e,className:d("bn-text-sm bn-text-muted-foreground",n),...t}));Ee.displayName="CardDescription";const H=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-p-6 bn-pt-0",n),...t}));H.displayName="CardContent";const Pe=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...t}));Pe.displayName="CardFooter";const ke=h.Root,Be=h.Trigger,Fe=h.Sub,U=m.forwardRef(({className:n,inset:t,children:e,...s},r)=>o.jsxs(h.SubTrigger,{ref:r,className:d("bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none focus:bn-bg-accent data-[state=open]:bn-bg-accent",t&&"bn-pl-8",n),...s,children:[e,o.jsx(j.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));U.displayName=h.SubTrigger.displayName;const K=m.forwardRef(({className:n,...t},e)=>o.jsx(h.SubContent,{ref:e,className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-lg data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));K.displayName=h.SubContent.displayName;const W=m.forwardRef(({className:n,sideOffset:t=4,...e},s)=>o.jsx(h.Content,{ref:s,sideOffset:t,className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...e}));W.displayName=h.Content.displayName;const J=m.forwardRef(({className:n,inset:t,...e},s)=>o.jsx(h.Item,{ref:s,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",t&&"bn-pl-8",n),...e}));J.displayName=h.Item.displayName;const Q=m.forwardRef(({className:n,children:t,checked:e,...s},r)=>o.jsxs(h.CheckboxItem,{ref:r,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),checked:e,...s,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(h.ItemIndicator,{children:o.jsx(j.Check,{className:"bn-h-4 bn-w-4"})})}),t]}));Q.displayName=h.CheckboxItem.displayName;const Le=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(h.RadioItem,{ref:s,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...e,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(h.ItemIndicator,{children:o.jsx(j.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),t]}));Le.displayName=h.RadioItem.displayName;const X=m.forwardRef(({className:n,inset:t,...e},s)=>o.jsx(h.Label,{ref:s,className:d("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t&&"bn-pl-8",n),...e}));X.displayName=h.Label.displayName;const Y=m.forwardRef(({className:n,...t},e)=>o.jsx(h.Separator,{ref:e,className:d("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));Y.displayName=h.Separator.displayName;const ze=M.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),L=m.forwardRef(({className:n,...t},e)=>o.jsx(V.Root,{ref:e,className:d(ze(),n),...t}));L.displayName=V.Root.displayName;const Ve=F.FormProvider,qe=m.createContext({}),D=()=>{const n=m.useContext(qe),t=m.useContext(Z),{getFieldState:e,formState:s}=F.useFormContext(),r=e(n.name,s);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:n.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},Z=m.createContext({}),_e=m.forwardRef(({className:n,...t},e)=>{const s=m.useId();return o.jsx(Z.Provider,{value:{id:s},children:o.jsx("div",{ref:e,className:d("bn-space-y-2",n),...t})})});_e.displayName="FormItem";const Ae=m.forwardRef(({className:n,...t},e)=>{const{error:s,formItemId:r}=D();return o.jsx(L,{ref:e,className:d(s&&"bn-text-destructive",n),htmlFor:r,...t})});Ae.displayName="FormLabel";const $e=m.forwardRef(({...n},t)=>{const{error:e,formItemId:s,formDescriptionId:r,formMessageId:a}=D();return o.jsx(z.Slot,{ref:t,id:s,"aria-describedby":e?`${r} ${a}`:`${r}`,"aria-invalid":!!e,...n})});$e.displayName="FormControl";const Oe=m.forwardRef(({className:n,...t},e)=>{const{formDescriptionId:s}=D();return o.jsx("p",{ref:e,id:s,className:d("bn-text-sm bn-text-muted-foreground",n),...t})});Oe.displayName="FormDescription";const Ge=m.forwardRef(({className:n,children:t,...e},s)=>{const{error:r,formMessageId:a}=D(),i=r?String(r==null?void 0:r.message):t;return i?o.jsx("p",{ref:s,id:a,className:d("bn-text-sm bn-font-medium bn-text-destructive",n),...e,children:i}):null});Ge.displayName="FormMessage";const ee=m.forwardRef(({className:n,type:t,...e},s)=>o.jsx("input",{type:t,className:d("bn-flex bn-h-10 bn-w-full bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background file:bn-border-0 file:bn-bg-transparent file:bn-text-sm file:bn-font-medium placeholder:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50",n),ref:s,...e}));ee.displayName="Input";const He=I.Root,Ue=I.Trigger,ne=m.forwardRef(({className:n,align:t="center",sideOffset:e=4,...s},r)=>o.jsx(I.Content,{ref:r,align:t,sideOffset:e,className:d("bn-z-50 bn-w-72 bn-rounded-md bn-border bn-bg-popover bn-p-4 bn-text-popover-foreground bn-shadow-md bn-outline-none data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...s}));ne.displayName=I.Content.displayName;const Ke=v.Root,We=v.Value,te=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(v.Trigger,{ref:s,className:d("bn-flex bn-h-10 bn-w-full bn-items-center bn-justify-between bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background placeholder:bn-text-muted-foreground focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50 [&>span]:bn-line-clamp-1",n),...e,children:[t,o.jsx(v.Icon,{asChild:!0,children:o.jsx(j.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));te.displayName=v.Trigger.displayName;const oe=m.forwardRef(({className:n,...t},e)=>o.jsx(v.ScrollUpButton,{ref:e,className:d("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(j.ChevronUp,{className:"bn-h-4 bn-w-4"})}));oe.displayName=v.ScrollUpButton.displayName;const se=m.forwardRef(({className:n,...t},e)=>o.jsx(v.ScrollDownButton,{ref:e,className:d("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(j.ChevronDown,{className:"bn-h-4 bn-w-4"})}));se.displayName=v.ScrollDownButton.displayName;const re=m.forwardRef(({className:n,children:t,position:e="popper",...s},r)=>o.jsxs(v.Content,{ref:r,className:d("bn-relative bn-z-50 bn-max-h-96 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",e==="popper"&&"data-[side=bottom]:bn-translate-y-1 data-[side=left]:bn--translate-x-1 data-[side=right]:bn-translate-x-1 data-[side=top]:bn--translate-y-1",n),position:e,...s,children:[o.jsx(oe,{}),o.jsx(v.Viewport,{className:d("bn-p-1",e==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(se,{})]}));re.displayName=v.Content.displayName;const Je=m.forwardRef(({className:n,...t},e)=>o.jsx(v.Label,{ref:e,className:d("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...t}));Je.displayName=v.Label.displayName;const ae=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(v.Item,{ref:s,className:d("bn-relative bn-flex bn-w-full bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...e,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(v.ItemIndicator,{children:o.jsx(j.Check,{className:"bn-h-4 bn-w-4"})})}),o.jsx(v.ItemText,{children:t})]}));ae.displayName=v.Item.displayName;const Qe=m.forwardRef(({className:n,...t},e)=>o.jsx(v.Separator,{ref:e,className:d("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));Qe.displayName=v.Separator.displayName;function Xe({className:n,...t}){return o.jsx("div",{className:d("animate-pulse rounded-md bg-primary/10",n),...t})}const Ye=S.Root,ie=m.forwardRef(({className:n,...t},e)=>o.jsx(S.List,{ref:e,className:d("bn-inline-flex bn-h-10 bn-items-center bn-justify-center bn-rounded-md bn-bg-muted bn-p-1 bn-text-muted-foreground",n),...t}));ie.displayName=S.List.displayName;const de=m.forwardRef(({className:n,...t},e)=>o.jsx(S.Trigger,{ref:e,className:d("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-sm bn-px-3 bn-py-1.5 bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-all focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=active]:bn-bg-background data-[state=active]:bn-text-foreground data-[state=active]:bn-shadow-sm",n),...t}));de.displayName=S.Trigger.displayName;const le=m.forwardRef(({className:n,...t},e)=>o.jsx(S.Content,{ref:e,className:d("bn-mt-2 bn-ring-offset-background focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2",n),...t}));le.displayName=S.Content.displayName;const Ze=M.cva("bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",{variants:{variant:{default:"bn-bg-transparent",outline:"bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground"},size:{default:"bn-h-10 bn-px-3",sm:"bn-h-9 bn-px-2.5",lg:"bn-h-11 bn-px-5"}},defaultVariants:{variant:"default",size:"default"}}),be=m.forwardRef(({className:n,variant:t,size:e,...s},r)=>o.jsx(q.Root,{ref:r,className:d(Ze({variant:t,size:e,className:n})),...s}));be.displayName=q.Root.displayName;const en=R.Provider,nn=R.Root,tn=R.Trigger,ce=m.forwardRef(({className:n,sideOffset:t=4,...e},s)=>o.jsx(R.Content,{ref:s,sideOffset:t,className:d("bn-z-50 bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-px-3 bn-py-1.5 bn-text-sm bn-text-popover-foreground bn-shadow-md bn-animate-in bn-fade-in-0 bn-zoom-in-95 data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=closed]:bn-zoom-out-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...e}));ce.displayName=R.Content.displayName;const on={Avatar:{Avatar:_,AvatarFallback:$,AvatarImage:A},Badge:{Badge:Re},Button:{Button:O},Card:{Card:G,CardContent:H},DropdownMenu:{DropdownMenu:ke,DropdownMenuCheckboxItem:Q,DropdownMenuContent:W,DropdownMenuItem:J,DropdownMenuLabel:X,DropdownMenuSeparator:Y,DropdownMenuSub:Fe,DropdownMenuSubContent:K,DropdownMenuSubTrigger:U,DropdownMenuTrigger:Be},Form:{Form:Ve},Input:{Input:ee},Label:{Label:L},Popover:{Popover:He,PopoverContent:ne,PopoverTrigger:Ue},Select:{Select:Ke,SelectContent:re,SelectItem:ae,SelectTrigger:te,SelectValue:We},Skeleton:{Skeleton:Xe},Tabs:{Tabs:Ye,TabsContent:le,TabsList:ie,TabsTrigger:de},Toggle:{Toggle:be},Tooltip:{Tooltip:nn,TooltipContent:ce,TooltipProvider:en,TooltipTrigger:tn}},me=b.createContext(void 0);function g(){return b.useContext(me)}const sn=n=>{const{children:t,...e}=n;u.assertEmpty(e);const s=g(),r=F.useForm();return o.jsx(s.Form.Form,{...r,children:t})},rn=b.forwardRef((n,t)=>{const{className:e,name:s,label:r,icon:a,value:i,autoFocus:p,placeholder:c,onKeyDown:l,onChange:f,onSubmit:x,...w}=n;u.assertEmpty(w);const N=g();return r?o.jsxs("div",{children:[o.jsx(N.Label.Label,{htmlFor:r,children:r}),o.jsx(N.Input.Input,{className:e,id:r,name:s,autoFocus:p,placeholder:c,value:i,onKeyDown:l,onChange:f,onSubmit:x})]}):o.jsx(N.Input.Input,{"aria-label":s,name:s,autoFocus:p,placeholder:c,value:i,onKeyDown:l,onChange:f,onSubmit:x,ref:t})}),an=n=>b.forwardRef((t,e)=>o.jsx(n,{onPointerDown:s=>{s.nativeEvent.fakeEvent||(s.ctrlKey=!0)},onPointerUp:s=>{const r=new PointerEvent("pointerdown",s.nativeEvent);r.fakeEvent=!0,s.target.dispatchEvent(r)},...t,ref:e})),dn=n=>{const{children:t,onOpenChange:e,position:s,sub:r,...a}=n;u.assertEmpty(a);const i=g();return r?o.jsx(i.DropdownMenu.DropdownMenuSub,{onOpenChange:e,children:t}):o.jsx(i.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:e,children:t})},ln=n=>{const{children:t,sub:e,...s}=n;u.assertEmpty(s);const r=g(),a=b.useMemo(()=>an(r.DropdownMenu.DropdownMenuTrigger),[r.DropdownMenu.DropdownMenuTrigger]);return e?o.jsx(r.DropdownMenu.DropdownMenuSubTrigger,{children:t}):o.jsx(a,{asChild:!0,...s,children:t})},bn=b.forwardRef((n,t)=>{const{className:e,children:s,sub:r,...a}=n;u.assertEmpty(a);const i=g();return r?o.jsx(i.DropdownMenu.DropdownMenuSubContent,{className:e,ref:t,children:s}):o.jsx(i.DropdownMenu.DropdownMenuContent,{className:e,ref:t,children:s})}),cn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,checked:a,subTrigger:i,onClick:p,...c}=n;u.assertEmpty(c);const l=g();return i?o.jsxs(o.Fragment,{children:[r,s]}):a!==void 0?o.jsxs(l.DropdownMenu.DropdownMenuCheckboxItem,{className:d(e,"bn-gap-1",a?"":"bn-px-2"),ref:t,checked:a,onClick:p,...c,children:[r,s]}):o.jsxs(l.DropdownMenu.DropdownMenuItem,{className:e,ref:t,onClick:p,...c,children:[r,s,i&&o.jsx(j.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),mn=b.forwardRef((n,t)=>{const{className:e,...s}=n;u.assertEmpty(s);const r=g();return o.jsx(r.DropdownMenu.DropdownMenuSeparator,{className:e,ref:t})}),un=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.DropdownMenu.DropdownMenuLabel,{className:e,ref:t,children:s})}),pn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,onClick:a,onDragEnd:i,onDragStart:p,draggable:c,label:l,...f}=n;u.assertEmpty(f,!1);const x=g();return o.jsxs(x.Button.Button,{variant:"ghost",className:d(e,"bn-text-gray-400"),ref:t,"aria-label":l,onClick:a,onDragStart:p,onDragEnd:i,draggable:c,...f,children:[r,s]})}),fn=b.forwardRef((n,t)=>{const{className:e,tabs:s,defaultOpenTab:r,openTab:a,setOpenTab:i,loading:p,...c}=n;u.assertEmpty(c);const l=g();return o.jsxs(l.Tabs.Tabs,{className:d(e,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:t,value:a,defaultValue:r,onValueChange:i,children:[o.jsx(l.Tabs.TabsList,{children:s.map(f=>o.jsx(l.Tabs.TabsTrigger,{value:f.name,children:f.name},f.name))}),s.map(f=>o.jsx(l.Tabs.TabsContent,{value:f.name,children:o.jsx(l.Card.Card,{children:o.jsx(l.Card.CardContent,{className:"bn-p-4",children:f.tabPanel})})},f.name))]})}),gn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d(e,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:t,children:s})}),xn=b.forwardRef((n,t)=>{const{className:e,value:s,placeholder:r,onKeyDown:a,onChange:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Input.Input,{"data-test":"embed-input",className:d(e,"bn-w-80"),ref:t,value:s,placeholder:r,onKeyDown:a,onChange:i})}),hn=n=>{const{children:t,opened:e,position:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.Popover.Popover,{open:e,children:t})},vn=b.forwardRef((n,t)=>{const{children:e,...s}=n;u.assertEmpty(s);const r=g();return o.jsx(r.Popover.PopoverTrigger,{ref:t,asChild:!0,children:e})}),wn=b.forwardRef((n,t)=>{const{className:e,variant:s,children:r,...a}=n;u.assertEmpty(a);const i=g();return o.jsx(i.Popover.PopoverContent,{sideOffset:8,className:d(e,"bn-flex bn-flex-col bn-gap-2",s==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:t,children:r})}),Nn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r,!1),o.jsx("div",{className:e,ref:t,...r,children:s})}),yn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,onClick:a,onDragEnd:i,onDragStart:p,draggable:c,label:l,...f}=n;u.assertEmpty(f,!1);const x=g();return o.jsxs(x.Button.Button,{variant:"ghost",className:d(e,"bn-text-gray-400"),ref:t,"aria-label":l,onClick:a,onDragStart:p,onDragEnd:i,draggable:c,...f,children:[r,s]})}),Cn=b.forwardRef((n,t)=>{const{className:e,children:s,id:r,columns:a,...i}=n;return u.assertEmpty(i),o.jsx("div",{className:e,style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:r,role:"grid",children:s})}),jn=b.forwardRef((n,t)=>{const{className:e,children:s,columns:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{className:e,style:{gridColumn:`1 / ${r+1}`},ref:t,children:s})}),Sn=b.forwardRef((n,t)=>{const{className:e,children:s,id:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{id:r,role:"listbox",className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-auto bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",e),ref:t,children:s})}),Tn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",e),ref:t,children:o.jsx("div",{children:s})})}),Rn=b.forwardRef((n,t)=>{const e=g(),{className:s,item:r,isSelected:a,onClick:i,id:p,...c}=n;u.assertEmpty(c);const l=b.useRef(null);return b.useEffect(()=>{if(!l.current||!a)return;const f=y.elementOverflow(l.current,document.querySelector(".bn-suggestion-menu"));f==="top"?l.current.scrollIntoView(!0):f==="bottom"&&l.current.scrollIntoView(!1)},[a]),o.jsxs("div",{className:d("bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",s),ref:y.mergeRefs([t,l]),id:p,onClick:i,role:"option","aria-selected":a||void 0,children:[r.icon&&o.jsx("div",{className:"bn-p-3","data-position":"left",children:r.icon}),o.jsxs("div",{className:"bn-flex-1",children:[o.jsx("div",{className:"bn-text-base",children:r.title}),o.jsx("div",{className:"bn-text-xs",children:r.subtext})]}),r.badge&&o.jsx("div",{"data-position":"right",className:"bn-text-xs",children:o.jsx(e.Badge.Badge,{variant:"secondary",children:r.badge})})]})}),Mn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",e),ref:t,children:s})}),In=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:e,ref:t,children:s})}),Dn=b.forwardRef((n,t)=>{const{className:e,children:s,onMouseDown:r,onClick:a,...i}=n;u.assertEmpty(i,!1);const p=g();return o.jsx(p.Button.Button,{variant:"ghost",className:d(e,"bn-p-0 bn-h-full bn-w-full bn-text-gray-400",e!=null&&e.includes("bn-extend-button-add-remove-columns")?"bn-ml-1":"bn-mt-1",e!=null&&e.includes("bn-extend-button-editing")?"bn-bg-accent bn-text-accent-foreground":""),ref:t,onClick:a,onMouseDown:r,...i,children:s})}),En=b.forwardRef((n,t)=>{const{className:e,children:s,draggable:r,onDragStart:a,onDragEnd:i,style:p,label:c,...l}=n;u.assertEmpty(l,!1);const f=g();return o.jsx(f.Button.Button,{variant:"ghost",className:d(e,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:t,"aria-label":c,draggable:r,onDragStart:a,onDragEnd:i,style:p,...l,children:s})}),P=b.forwardRef((n,t)=>{const{className:e,children:s,onMouseEnter:r,onMouseLeave:a,variant:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:d(e,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md bn-h-fit",i==="action-toolbar"?"bn-w-fit":""),ref:t,onMouseEnter:r,onMouseLeave:a,children:s})})}),k=b.forwardRef((n,t)=>{const{className:e,children:s,mainTooltip:r,secondaryTooltip:a,icon:i,isSelected:p,isDisabled:c,onClick:l,label:f,variant:x,...w}=n;u.assertEmpty(w,!1);const N=g(),E=p===void 0?o.jsxs(N.Button.Button,{className:d(e,x==="compact"?"bn-h-6 bn-min-w-6 bn-p-0":""),variant:"ghost",size:x==="compact"?"sm":"default",disabled:c,onClick:l,ref:t,"aria-label":f,...w,children:[i,s]}):o.jsxs(N.Toggle.Toggle,{className:d(e,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground",x==="compact"?"bn-h-6 bn-min-w-6 bn-p-0":""),size:x==="compact"?"sm":"default","aria-label":f,onClick:l,pressed:p,disabled:c,"data-state":p?"on":"off","data-disabled":c,ref:t,...w,children:[i,s]});return o.jsxs(N.Tooltip.Tooltip,{children:[o.jsx(N.Tooltip.TooltipTrigger,{asChild:!0,children:E}),o.jsxs(N.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center bn-whitespace-pre-wrap",children:[o.jsx("span",{children:r}),a&&o.jsx("span",{children:a})]})]})}),B=b.forwardRef((n,t)=>{const{className:e,items:s,isDisabled:r,...a}=n;u.assertEmpty(a);const i=g(),p=l=>o.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[l.icon,l.text]}),c=s.filter(l=>l.isSelected)[0];return c?o.jsxs(i.Select.Select,{value:c.text,onValueChange:l=>{var f,x;return(x=(f=s.find(w=>w.text===l)).onClick)==null?void 0:x.call(f)},disabled:r,children:[o.jsx(i.Select.SelectTrigger,{className:"bn-border-none",children:o.jsx(i.Select.SelectValue,{})}),o.jsx(i.Select.SelectContent,{className:e,ref:t,children:s.map(l=>o.jsx(i.Select.SelectItem,{disabled:l.isDisabled,value:l.text,children:o.jsx(p,{...l})},l.text))})]}):null}),Pn=b.forwardRef((n,t)=>{const{className:e,children:s,selected:r,headerText:a,onFocus:i,onBlur:p,tabIndex:c,...l}=n;u.assertEmpty(l);const f=g();return o.jsxs(f.Card.Card,{className:d(e,"bn-w-[300px]",r?"bn-bg-accent bn-text-accent-foreground":""),onFocus:i,onBlur:p,tabIndex:c,ref:t,children:[a&&o.jsx("div",{className:"bn-px-4 bn-pt-4 bn-italic bn-text-sm",children:a}),s]})}),kn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d(e,"bn-p-4",e!=null&&e.includes("bn-thread-comments")?"bn-flex bn-flex-col bn-gap-6 bn-border-b":""),ref:t,children:s})}),Bn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r,!1);const a=g();return o.jsx(a.Button.Button,{className:d(e,"bn-p-0 bn-w-fit bn-text-foreground bn-bg-transparent hover:bn-bg-transparent"),ref:t,children:s})}),Fn=b.forwardRef((n,t)=>{const{authorInfo:e,timeString:s,edited:r,...a}=n;u.assertEmpty(a,!1);const i=g();return e==="loading"?o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-4",children:[o.jsx(i.Skeleton.Skeleton,{className:"bn-size-7 bn-rounded-full bn-bg-neutral-400 bn-animate-pulse"}),o.jsx(i.Skeleton.Skeleton,{className:"bn-h-3 bn-w-32 bn-rounded-full bn-bg-neutral-400 bn-animate-pulse"})]}):o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-4",children:[o.jsxs(i.Avatar.Avatar,{children:[o.jsx(i.Avatar.AvatarImage,{src:e.avatarUrl,alt:e.username,className:"bn-h-7 bn-rounded-full"}),o.jsx(i.Avatar.AvatarFallback,{children:e.username[0]})]}),o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-2",children:[o.jsx("span",{className:"bn-text-sm bn-font-bold",children:e.username}),o.jsxs("span",{className:"bn-text-xs",children:[s," ",r&&"(edited)"]})]})]})}),Ln=b.forwardRef((n,t)=>{const{className:e,showActions:s,authorInfo:r,timeString:a,actions:i,edited:p,children:c,...l}=n;u.assertEmpty(l);const[f,x]=b.useState(!1),{focused:w,ref:N}=y.useFocusWithin(),E=i&&(s===!0||s===void 0||s==="hover"&&f||w);return o.jsxs("div",{ref:t,className:d(e,"bn-relative bn-flex bn-flex-col bn-gap-2"),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[E?o.jsx("div",{className:"bn-absolute bn-right-0 bn-top-0 bn-z-10",ref:N,children:i}):null,o.jsx(Fn,{...n}),c]})}),zn=b.forwardRef((n,t)=>{const{className:e,onFocus:s,onBlur:r,autoFocus:a,editor:i,editable:p,...c}=n;return u.assertEmpty(c),o.jsx(pe,{autoFocus:a,className:d(e,""),editor:n.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:p,ref:t,onFocus:s,onBlur:r,children:o.jsx(y.FormattingToolbarController,{formattingToolbar:Vn})})}),Vn=()=>{const n=y.getFormattingToolbarItems([]).filter(t=>t.key!=="nestBlockButton"&&t.key!=="unnestBlockButton");return o.jsx(y.FormattingToolbar,{blockTypeSelectItems:[],children:n})},qn=b.forwardRef((n,t)=>{const{className:e,text:s,icon:r,isSelected:a,mainTooltip:i,secondaryTooltip:p,onClick:c,onMouseEnter:l,...f}=n;u.assertEmpty(f,!1);const x=g(),w=o.jsxs(x.Button.Button,{variant:a?"secondary":"outline",className:d(e,"bn-flex bn-items-center bn-gap-1 bn-rounded-full bn-h-7 bn-px-2.5"),onClick:c,onMouseEnter:l,ref:t,children:[o.jsx("span",{children:r}),o.jsx("span",{children:s})]});return i?o.jsxs(x.Tooltip.Tooltip,{children:[o.jsx(x.Tooltip.TooltipTrigger,{asChild:!0,children:w}),o.jsxs(x.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center bn-whitespace-pre-wrap",children:[o.jsx("span",{children:i}),p&&o.jsx("span",{children:p})]})]}):w}),_n=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:d(e,"bn-flex bn-flex-row bn-flex-wrap bn-gap-1 bn-w-full"),ref:t,children:s})})}),An=b.forwardRef((n,t)=>{const{className:e,children:s,onClick:r,label:a,...i}=n;u.assertEmpty(i);const p=g();return o.jsx(p.Button.Button,{type:"submit",className:e,"aria-label":a,ref:t,onClick:r,children:s})}),$n=b.forwardRef((n,t)=>{const{className:e,accept:s,value:r,placeholder:a,onChange:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Input.Input,{type:"file",className:e,ref:t,accept:s,value:r?r.name:void 0,onChange:async l=>i==null?void 0:i(l.target.files[0]),placeholder:a})}),On=b.forwardRef((n,t)=>{const{className:e,isSelected:s,onClick:r,item:a,id:i,...p}=n;u.assertEmpty(p);const c=b.useRef(null);return b.useEffect(()=>{if(!c.current||!s)return;const l=y.elementOverflow(c.current,document.querySelector(".bn-grid-suggestion-menu"));l==="top"?c.current.scrollIntoView(!0):l==="bottom"&&c.current.scrollIntoView(!1)},[s]),o.jsx("div",{className:e,ref:y.mergeRefs([t,c]),id:i,role:"option",onClick:r,"aria-selected":s||void 0,children:a.icon})}),Gn=b.forwardRef((n,t)=>{const{className:e,children:s,columns:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{className:e,style:{gridColumn:`1 / ${r+1}`},ref:t,children:s})}),ue={FormattingToolbar:{Root:P,Button:k,Select:B},FilePanel:{Root:fn,Button:An,FileInput:$n,TabPanel:gn,TextInput:xn},LinkToolbar:{Root:P,Button:k,Select:B},SideMenu:{Root:Nn,Button:yn},SuggestionMenu:{Root:Sn,Item:Rn,EmptyItem:Tn,Label:Mn,Loader:In},GridSuggestionMenu:{Root:Cn,Item:On,EmptyItem:jn,Loader:Gn},TableHandle:{Root:En,ExtendButton:Dn},Comments:{Comment:Ln,Editor:zn,Card:Pn,CardSection:kn,ExpandSectionsPrompt:Bn},Generic:{Badge:{Root:qn,Group:_n},Toolbar:{Root:P,Button:k,Select:B},Form:{Root:sn,TextInput:rn},Menu:{Root:dn,Trigger:ln,Dropdown:bn,Divider:mn,Label:un,Item:cn,Button:pn},Popover:{Root:hn,Trigger:vn,Content:wn}}},pe=n=>{const{className:t,shadCNComponents:e,...s}=n,r=b.useMemo(()=>({...on,...e}),[e]);return o.jsx(me.Provider,{value:r,children:o.jsx(y.ComponentsContext.Provider,{value:ue,children:o.jsx(y.BlockNoteViewRaw,{className:u.mergeCSSClasses("bn-shadcn",t||""),...s})})})};exports.BlockNoteView=pe;exports.components=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("@blocknote/core"),y=require("@blocknote/react"),b=require("react"),F=require("react-hook-form"),fe=require("@radix-ui/react-avatar"),ge=require("clsx"),xe=require("tailwind-merge"),M=require("class-variance-authority"),z=require("@radix-ui/react-slot"),he=require("@radix-ui/react-dropdown-menu"),j=require("lucide-react"),ve=require("@radix-ui/react-label"),we=require("@radix-ui/react-popover"),Ne=require("@radix-ui/react-select"),ye=require("@radix-ui/react-tabs"),Ce=require("@radix-ui/react-toggle"),je=require("@radix-ui/react-tooltip");function C(n){if(n&&typeof n=="object"&&"default"in n)return n;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const m=C(b),T=C(fe),h=C(he),V=C(ve),I=C(we),v=C(Ne),S=C(ye),q=C(Ce),R=C(je),Se=xe.extendTailwindMerge({prefix:"bn-"});function d(...n){return Se(ge.clsx(n))}const _=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Root,{ref:e,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...t}));_.displayName=T.Root.displayName;const A=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Image,{ref:e,className:d("aspect-square h-full w-full",n),...t}));A.displayName=T.Image.displayName;const $=m.forwardRef(({className:n,...t},e)=>o.jsx(T.Fallback,{ref:e,className:d("bg-muted flex h-full w-full items-center justify-center rounded-full",n),...t}));$.displayName=T.Fallback.displayName;const Te=M.cva("bn-inline-flex bn-items-center bn-rounded-full bn-border bn-px-2.5 bn-py-0.5 bn-text-xs bn-font-semibold bn-transition-colors focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2",{variants:{variant:{default:"bn-border-transparent bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/80",secondary:"bn-border-transparent bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",destructive:"bn-border-transparent bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/80",outline:"bn-text-foreground"}},defaultVariants:{variant:"default"}});function Re({className:n,variant:t,...e}){return o.jsx("div",{className:d(Te({variant:t}),n),...e})}const Me=M.cva("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50",{variants:{variant:{default:"bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/90",destructive:"bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/90",outline:"bn-border bn-border-input bn-bg-background hover:bn-bg-accent hover:bn-text-accent-foreground",secondary:"bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",ghost:"hover:bn-bg-accent hover:bn-text-accent-foreground",link:"bn-text-primary bn-underline-offset-4 hover:bn-underline"},size:{default:"bn-h-10 bn-px-4 bn-py-2",sm:"bn-h-9 bn-rounded-md bn-px-3",lg:"bn-h-11 bn-rounded-md bn-px-8",icon:"bn-h-10 bn-w-10"}},defaultVariants:{variant:"default",size:"default"}}),O=m.forwardRef(({className:n,variant:t,size:e,asChild:s=!1,...r},a)=>{const i=s?z.Slot:"button";return o.jsx(i,{className:d(Me({variant:t,size:e,className:n})),ref:a,type:"button",...r})});O.displayName="Button";const G=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...t}));G.displayName="Card";const Ie=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...t}));Ie.displayName="CardHeader";const De=m.forwardRef(({className:n,...t},e)=>o.jsx("h3",{ref:e,className:d("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...t}));De.displayName="CardTitle";const Ee=m.forwardRef(({className:n,...t},e)=>o.jsx("p",{ref:e,className:d("bn-text-sm bn-text-muted-foreground",n),...t}));Ee.displayName="CardDescription";const H=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-p-6 bn-pt-0",n),...t}));H.displayName="CardContent";const Pe=m.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:d("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...t}));Pe.displayName="CardFooter";const ke=h.Root,Be=h.Trigger,Fe=h.Sub,U=m.forwardRef(({className:n,inset:t,children:e,...s},r)=>o.jsxs(h.SubTrigger,{ref:r,className:d("bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none focus:bn-bg-accent data-[state=open]:bn-bg-accent",t&&"bn-pl-8",n),...s,children:[e,o.jsx(j.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));U.displayName=h.SubTrigger.displayName;const K=m.forwardRef(({className:n,...t},e)=>o.jsx(h.SubContent,{ref:e,className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-lg data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));K.displayName=h.SubContent.displayName;const W=m.forwardRef(({className:n,sideOffset:t=4,...e},s)=>o.jsx(h.Content,{ref:s,sideOffset:t,className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...e}));W.displayName=h.Content.displayName;const J=m.forwardRef(({className:n,inset:t,...e},s)=>o.jsx(h.Item,{ref:s,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",t&&"bn-pl-8",n),...e}));J.displayName=h.Item.displayName;const Q=m.forwardRef(({className:n,children:t,checked:e,...s},r)=>o.jsxs(h.CheckboxItem,{ref:r,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),checked:e,...s,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(h.ItemIndicator,{children:o.jsx(j.Check,{className:"bn-h-4 bn-w-4"})})}),t]}));Q.displayName=h.CheckboxItem.displayName;const Le=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(h.RadioItem,{ref:s,className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...e,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(h.ItemIndicator,{children:o.jsx(j.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),t]}));Le.displayName=h.RadioItem.displayName;const X=m.forwardRef(({className:n,inset:t,...e},s)=>o.jsx(h.Label,{ref:s,className:d("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t&&"bn-pl-8",n),...e}));X.displayName=h.Label.displayName;const Y=m.forwardRef(({className:n,...t},e)=>o.jsx(h.Separator,{ref:e,className:d("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));Y.displayName=h.Separator.displayName;const ze=M.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),L=m.forwardRef(({className:n,...t},e)=>o.jsx(V.Root,{ref:e,className:d(ze(),n),...t}));L.displayName=V.Root.displayName;const Ve=F.FormProvider,qe=m.createContext({}),D=()=>{const n=m.useContext(qe),t=m.useContext(Z),{getFieldState:e,formState:s}=F.useFormContext(),r=e(n.name,s);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:n.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},Z=m.createContext({}),_e=m.forwardRef(({className:n,...t},e)=>{const s=m.useId();return o.jsx(Z.Provider,{value:{id:s},children:o.jsx("div",{ref:e,className:d("bn-space-y-2",n),...t})})});_e.displayName="FormItem";const Ae=m.forwardRef(({className:n,...t},e)=>{const{error:s,formItemId:r}=D();return o.jsx(L,{ref:e,className:d(s&&"bn-text-destructive",n),htmlFor:r,...t})});Ae.displayName="FormLabel";const $e=m.forwardRef(({...n},t)=>{const{error:e,formItemId:s,formDescriptionId:r,formMessageId:a}=D();return o.jsx(z.Slot,{ref:t,id:s,"aria-describedby":e?`${r} ${a}`:`${r}`,"aria-invalid":!!e,...n})});$e.displayName="FormControl";const Oe=m.forwardRef(({className:n,...t},e)=>{const{formDescriptionId:s}=D();return o.jsx("p",{ref:e,id:s,className:d("bn-text-sm bn-text-muted-foreground",n),...t})});Oe.displayName="FormDescription";const Ge=m.forwardRef(({className:n,children:t,...e},s)=>{const{error:r,formMessageId:a}=D(),i=r?String(r==null?void 0:r.message):t;return i?o.jsx("p",{ref:s,id:a,className:d("bn-text-sm bn-font-medium bn-text-destructive",n),...e,children:i}):null});Ge.displayName="FormMessage";const ee=m.forwardRef(({className:n,type:t,...e},s)=>o.jsx("input",{type:t,className:d("bn-flex bn-h-10 bn-w-full bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background file:bn-border-0 file:bn-bg-transparent file:bn-text-sm file:bn-font-medium placeholder:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50",n),ref:s,...e}));ee.displayName="Input";const He=I.Root,Ue=I.Trigger,ne=m.forwardRef(({className:n,align:t="center",sideOffset:e=4,...s},r)=>o.jsx(I.Content,{ref:r,align:t,sideOffset:e,className:d("bn-z-50 bn-w-72 bn-rounded-md bn-border bn-bg-popover bn-p-4 bn-text-popover-foreground bn-shadow-md bn-outline-none data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...s}));ne.displayName=I.Content.displayName;const Ke=v.Root,We=v.Value,te=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(v.Trigger,{ref:s,className:d("bn-flex bn-h-10 bn-w-full bn-items-center bn-justify-between bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background placeholder:bn-text-muted-foreground focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50 [&>span]:bn-line-clamp-1",n),...e,children:[t,o.jsx(v.Icon,{asChild:!0,children:o.jsx(j.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));te.displayName=v.Trigger.displayName;const oe=m.forwardRef(({className:n,...t},e)=>o.jsx(v.ScrollUpButton,{ref:e,className:d("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(j.ChevronUp,{className:"bn-h-4 bn-w-4"})}));oe.displayName=v.ScrollUpButton.displayName;const se=m.forwardRef(({className:n,...t},e)=>o.jsx(v.ScrollDownButton,{ref:e,className:d("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(j.ChevronDown,{className:"bn-h-4 bn-w-4"})}));se.displayName=v.ScrollDownButton.displayName;const re=m.forwardRef(({className:n,children:t,position:e="popper",...s},r)=>o.jsxs(v.Content,{ref:r,className:d("bn-relative bn-z-50 bn-max-h-96 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",e==="popper"&&"data-[side=bottom]:bn-translate-y-1 data-[side=left]:bn--translate-x-1 data-[side=right]:bn-translate-x-1 data-[side=top]:bn--translate-y-1",n),position:e,...s,children:[o.jsx(oe,{}),o.jsx(v.Viewport,{className:d("bn-p-1",e==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(se,{})]}));re.displayName=v.Content.displayName;const Je=m.forwardRef(({className:n,...t},e)=>o.jsx(v.Label,{ref:e,className:d("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...t}));Je.displayName=v.Label.displayName;const ae=m.forwardRef(({className:n,children:t,...e},s)=>o.jsxs(v.Item,{ref:s,className:d("bn-relative bn-flex bn-w-full bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...e,children:[o.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:o.jsx(v.ItemIndicator,{children:o.jsx(j.Check,{className:"bn-h-4 bn-w-4"})})}),o.jsx(v.ItemText,{children:t})]}));ae.displayName=v.Item.displayName;const Qe=m.forwardRef(({className:n,...t},e)=>o.jsx(v.Separator,{ref:e,className:d("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));Qe.displayName=v.Separator.displayName;function Xe({className:n,...t}){return o.jsx("div",{className:d("bg-primary/10 animate-pulse rounded-md",n),...t})}const Ye=S.Root,ie=m.forwardRef(({className:n,...t},e)=>o.jsx(S.List,{ref:e,className:d("bn-inline-flex bn-h-10 bn-items-center bn-justify-center bn-rounded-md bn-bg-muted bn-p-1 bn-text-muted-foreground",n),...t}));ie.displayName=S.List.displayName;const de=m.forwardRef(({className:n,...t},e)=>o.jsx(S.Trigger,{ref:e,className:d("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-sm bn-px-3 bn-py-1.5 bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-all focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=active]:bn-bg-background data-[state=active]:bn-text-foreground data-[state=active]:bn-shadow-sm",n),...t}));de.displayName=S.Trigger.displayName;const le=m.forwardRef(({className:n,...t},e)=>o.jsx(S.Content,{ref:e,className:d("bn-mt-2 bn-ring-offset-background focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2",n),...t}));le.displayName=S.Content.displayName;const Ze=M.cva("bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",{variants:{variant:{default:"bn-bg-transparent",outline:"bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground"},size:{default:"bn-h-10 bn-px-3",sm:"bn-h-9 bn-px-2.5",lg:"bn-h-11 bn-px-5"}},defaultVariants:{variant:"default",size:"default"}}),be=m.forwardRef(({className:n,variant:t,size:e,...s},r)=>o.jsx(q.Root,{ref:r,className:d(Ze({variant:t,size:e,className:n})),...s}));be.displayName=q.Root.displayName;const en=R.Provider,nn=R.Root,tn=R.Trigger,ce=m.forwardRef(({className:n,sideOffset:t=4,...e},s)=>o.jsx(R.Content,{ref:s,sideOffset:t,className:d("bn-z-50 bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-px-3 bn-py-1.5 bn-text-sm bn-text-popover-foreground bn-shadow-md bn-animate-in bn-fade-in-0 bn-zoom-in-95 data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=closed]:bn-zoom-out-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...e}));ce.displayName=R.Content.displayName;const on={Avatar:{Avatar:_,AvatarFallback:$,AvatarImage:A},Badge:{Badge:Re},Button:{Button:O},Card:{Card:G,CardContent:H},DropdownMenu:{DropdownMenu:ke,DropdownMenuCheckboxItem:Q,DropdownMenuContent:W,DropdownMenuItem:J,DropdownMenuLabel:X,DropdownMenuSeparator:Y,DropdownMenuSub:Fe,DropdownMenuSubContent:K,DropdownMenuSubTrigger:U,DropdownMenuTrigger:Be},Form:{Form:Ve},Input:{Input:ee},Label:{Label:L},Popover:{Popover:He,PopoverContent:ne,PopoverTrigger:Ue},Select:{Select:Ke,SelectContent:re,SelectItem:ae,SelectTrigger:te,SelectValue:We},Skeleton:{Skeleton:Xe},Tabs:{Tabs:Ye,TabsContent:le,TabsList:ie,TabsTrigger:de},Toggle:{Toggle:be},Tooltip:{Tooltip:nn,TooltipContent:ce,TooltipProvider:en,TooltipTrigger:tn}},me=b.createContext(void 0);function g(){return b.useContext(me)}const sn=n=>{const{children:t,...e}=n;u.assertEmpty(e);const s=g(),r=F.useForm();return o.jsx(s.Form.Form,{...r,children:t})},rn=b.forwardRef((n,t)=>{const{className:e,name:s,label:r,icon:a,value:i,autoFocus:p,placeholder:c,onKeyDown:l,onChange:f,onSubmit:x,...w}=n;u.assertEmpty(w);const N=g();return r?o.jsxs("div",{children:[o.jsx(N.Label.Label,{htmlFor:r,children:r}),o.jsx(N.Input.Input,{className:e,id:r,name:s,autoFocus:p,placeholder:c,value:i,onKeyDown:l,onChange:f,onSubmit:x})]}):o.jsx(N.Input.Input,{"aria-label":s,name:s,autoFocus:p,placeholder:c,value:i,onKeyDown:l,onChange:f,onSubmit:x,ref:t})}),an=n=>b.forwardRef((t,e)=>o.jsx(n,{onPointerDown:s=>{s.nativeEvent.fakeEvent||(s.ctrlKey=!0)},onPointerUp:s=>{const r=new PointerEvent("pointerdown",s.nativeEvent);r.fakeEvent=!0,s.target.dispatchEvent(r)},...t,ref:e})),dn=n=>{const{children:t,onOpenChange:e,position:s,sub:r,...a}=n;u.assertEmpty(a);const i=g();return r?o.jsx(i.DropdownMenu.DropdownMenuSub,{onOpenChange:e,children:t}):o.jsx(i.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:e,children:t})},ln=n=>{const{children:t,sub:e,...s}=n;u.assertEmpty(s);const r=g(),a=b.useMemo(()=>an(r.DropdownMenu.DropdownMenuTrigger),[r.DropdownMenu.DropdownMenuTrigger]);return e?o.jsx(r.DropdownMenu.DropdownMenuSubTrigger,{children:t}):o.jsx(a,{asChild:!0,...s,children:t})},bn=b.forwardRef((n,t)=>{const{className:e,children:s,sub:r,...a}=n;u.assertEmpty(a);const i=g();return r?o.jsx(i.DropdownMenu.DropdownMenuSubContent,{className:e,ref:t,children:s}):o.jsx(i.DropdownMenu.DropdownMenuContent,{className:e,ref:t,children:s})}),cn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,checked:a,subTrigger:i,onClick:p,...c}=n;u.assertEmpty(c);const l=g();return i?o.jsxs(o.Fragment,{children:[r,s]}):a!==void 0?o.jsxs(l.DropdownMenu.DropdownMenuCheckboxItem,{className:d(e,"bn-gap-1",a?"":"bn-px-2"),ref:t,checked:a,onClick:p,...c,children:[r,s]}):o.jsxs(l.DropdownMenu.DropdownMenuItem,{className:e,ref:t,onClick:p,...c,children:[r,s,i&&o.jsx(j.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),mn=b.forwardRef((n,t)=>{const{className:e,...s}=n;u.assertEmpty(s);const r=g();return o.jsx(r.DropdownMenu.DropdownMenuSeparator,{className:e,ref:t})}),un=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.DropdownMenu.DropdownMenuLabel,{className:e,ref:t,children:s})}),pn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,onClick:a,onDragEnd:i,onDragStart:p,draggable:c,label:l,...f}=n;u.assertEmpty(f,!1);const x=g();return o.jsxs(x.Button.Button,{variant:"ghost",className:d(e,"bn-text-gray-400"),ref:t,"aria-label":l,onClick:a,onDragStart:p,onDragEnd:i,draggable:c,...f,children:[r,s]})}),fn=b.forwardRef((n,t)=>{const{className:e,tabs:s,defaultOpenTab:r,openTab:a,setOpenTab:i,loading:p,...c}=n;u.assertEmpty(c);const l=g();return o.jsxs(l.Tabs.Tabs,{className:d(e,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:t,value:a,defaultValue:r,onValueChange:i,children:[o.jsx(l.Tabs.TabsList,{children:s.map(f=>o.jsx(l.Tabs.TabsTrigger,{value:f.name,children:f.name},f.name))}),s.map(f=>o.jsx(l.Tabs.TabsContent,{value:f.name,children:o.jsx(l.Card.Card,{children:o.jsx(l.Card.CardContent,{className:"bn-p-4",children:f.tabPanel})})},f.name))]})}),gn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d(e,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:t,children:s})}),xn=b.forwardRef((n,t)=>{const{className:e,value:s,placeholder:r,onKeyDown:a,onChange:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Input.Input,{"data-test":"embed-input",className:d(e,"bn-w-80"),ref:t,value:s,placeholder:r,onKeyDown:a,onChange:i})}),hn=n=>{const{children:t,opened:e,position:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.Popover.Popover,{open:e,children:t})},vn=b.forwardRef((n,t)=>{const{children:e,...s}=n;u.assertEmpty(s);const r=g();return o.jsx(r.Popover.PopoverTrigger,{ref:t,asChild:!0,children:e})}),wn=b.forwardRef((n,t)=>{const{className:e,variant:s,children:r,...a}=n;u.assertEmpty(a);const i=g();return o.jsx(i.Popover.PopoverContent,{sideOffset:8,className:d(e,"bn-flex bn-flex-col bn-gap-2",s==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:t,children:r})}),Nn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r,!1),o.jsx("div",{className:e,ref:t,...r,children:s})}),yn=b.forwardRef((n,t)=>{const{className:e,children:s,icon:r,onClick:a,onDragEnd:i,onDragStart:p,draggable:c,label:l,...f}=n;u.assertEmpty(f,!1);const x=g();return o.jsxs(x.Button.Button,{variant:"ghost",className:d(e,"bn-text-gray-400"),ref:t,"aria-label":l,onClick:a,onDragStart:p,onDragEnd:i,draggable:c,...f,children:[r,s]})}),Cn=b.forwardRef((n,t)=>{const{className:e,children:s,id:r,columns:a,...i}=n;return u.assertEmpty(i),o.jsx("div",{className:e,style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:r,role:"grid",children:s})}),jn=b.forwardRef((n,t)=>{const{className:e,children:s,columns:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{className:e,style:{gridColumn:`1 / ${r+1}`},ref:t,children:s})}),Sn=b.forwardRef((n,t)=>{const{className:e,children:s,id:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{id:r,role:"listbox",className:d("bn-z-50 bn-min-w-[8rem] bn-overflow-auto bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",e),ref:t,children:s})}),Tn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",e),ref:t,children:o.jsx("div",{children:s})})}),Rn=b.forwardRef((n,t)=>{const e=g(),{className:s,item:r,isSelected:a,onClick:i,id:p,...c}=n;u.assertEmpty(c);const l=b.useRef(null);return b.useEffect(()=>{if(!l.current||!a)return;const f=y.elementOverflow(l.current,document.querySelector(".bn-suggestion-menu"));f==="top"?l.current.scrollIntoView(!0):f==="bottom"&&l.current.scrollIntoView(!1)},[a]),o.jsxs("div",{className:d("bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",s),ref:y.mergeRefs([t,l]),id:p,onClick:i,role:"option","aria-selected":a||void 0,children:[r.icon&&o.jsx("div",{className:"bn-p-3","data-position":"left",children:r.icon}),o.jsxs("div",{className:"bn-flex-1",children:[o.jsx("div",{className:"bn-text-base",children:r.title}),o.jsx("div",{className:"bn-text-xs",children:r.subtext})]}),r.badge&&o.jsx("div",{"data-position":"right",className:"bn-text-xs",children:o.jsx(e.Badge.Badge,{variant:"secondary",children:r.badge})})]})}),Mn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",e),ref:t,children:s})}),In=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:e,ref:t,children:s})}),Dn=b.forwardRef((n,t)=>{const{className:e,children:s,onMouseDown:r,onClick:a,...i}=n;u.assertEmpty(i,!1);const p=g();return o.jsx(p.Button.Button,{variant:"ghost",className:d(e,"bn-p-0 bn-h-full bn-w-full bn-text-gray-400",e!=null&&e.includes("bn-extend-button-add-remove-columns")?"bn-ml-1":"bn-mt-1",e!=null&&e.includes("bn-extend-button-editing")?"bn-bg-accent bn-text-accent-foreground":""),ref:t,onClick:a,onMouseDown:r,...i,children:s})}),En=b.forwardRef((n,t)=>{const{className:e,children:s,draggable:r,onDragStart:a,onDragEnd:i,style:p,label:c,...l}=n;u.assertEmpty(l,!1);const f=g();return o.jsx(f.Button.Button,{variant:"ghost",className:d(e,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:t,"aria-label":c,draggable:r,onDragStart:a,onDragEnd:i,style:p,...l,children:s})}),P=b.forwardRef((n,t)=>{const{className:e,children:s,onMouseEnter:r,onMouseLeave:a,variant:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:d(e,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md bn-h-fit",i==="action-toolbar"?"bn-w-fit":""),ref:t,onMouseEnter:r,onMouseLeave:a,children:s})})}),k=b.forwardRef((n,t)=>{const{className:e,children:s,mainTooltip:r,secondaryTooltip:a,icon:i,isSelected:p,isDisabled:c,onClick:l,label:f,variant:x,...w}=n;u.assertEmpty(w,!1);const N=g(),E=p===void 0?o.jsxs(N.Button.Button,{className:d(e,x==="compact"?"bn-h-6 bn-min-w-6 bn-p-0":""),variant:"ghost",size:x==="compact"?"sm":"default",disabled:c,onClick:l,ref:t,"aria-label":f,...w,children:[i,s]}):o.jsxs(N.Toggle.Toggle,{className:d(e,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground",x==="compact"?"bn-h-6 bn-min-w-6 bn-p-0":""),size:x==="compact"?"sm":"default","aria-label":f,onClick:l,pressed:p,disabled:c,"data-state":p?"on":"off","data-disabled":c,ref:t,...w,children:[i,s]});return o.jsxs(N.Tooltip.Tooltip,{children:[o.jsx(N.Tooltip.TooltipTrigger,{asChild:!0,children:E}),o.jsxs(N.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center bn-whitespace-pre-wrap",children:[o.jsx("span",{children:r}),a&&o.jsx("span",{children:a})]})]})}),B=b.forwardRef((n,t)=>{const{className:e,items:s,isDisabled:r,...a}=n;u.assertEmpty(a);const i=g(),p=l=>o.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[l.icon,l.text]}),c=s.filter(l=>l.isSelected)[0];return c?o.jsxs(i.Select.Select,{value:c.text,onValueChange:l=>{var f,x;return(x=(f=s.find(w=>w.text===l)).onClick)==null?void 0:x.call(f)},disabled:r,children:[o.jsx(i.Select.SelectTrigger,{className:"bn-border-none",children:o.jsx(i.Select.SelectValue,{})}),o.jsx(i.Select.SelectContent,{className:e,ref:t,children:s.map(l=>o.jsx(i.Select.SelectItem,{disabled:l.isDisabled,value:l.text,children:o.jsx(p,{...l})},l.text))})]}):null}),Pn=b.forwardRef((n,t)=>{const{className:e,children:s,selected:r,headerText:a,onFocus:i,onBlur:p,tabIndex:c,...l}=n;u.assertEmpty(l);const f=g();return o.jsxs(f.Card.Card,{className:d(e,"bn-w-[300px]",r?"bn-bg-accent bn-text-accent-foreground":""),onFocus:i,onBlur:p,tabIndex:c,ref:t,children:[a&&o.jsx("div",{className:"bn-px-4 bn-pt-4 bn-italic bn-text-sm",children:a}),s]})}),kn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;return u.assertEmpty(r),o.jsx("div",{className:d(e,"bn-p-4",e!=null&&e.includes("bn-thread-comments")?"bn-flex bn-flex-col bn-gap-6 bn-border-b":""),ref:t,children:s})}),Bn=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r,!1);const a=g();return o.jsx(a.Button.Button,{className:d(e,"bn-p-0 bn-w-fit bn-text-foreground bn-bg-transparent hover:bn-bg-transparent"),ref:t,children:s})}),Fn=b.forwardRef((n,t)=>{const{authorInfo:e,timeString:s,edited:r,...a}=n;u.assertEmpty(a,!1);const i=g();return e==="loading"?o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-4",children:[o.jsx(i.Skeleton.Skeleton,{className:"bn-size-7 bn-rounded-full bn-bg-neutral-400 bn-animate-pulse"}),o.jsx(i.Skeleton.Skeleton,{className:"bn-h-3 bn-w-32 bn-rounded-full bn-bg-neutral-400 bn-animate-pulse"})]}):o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-4",children:[o.jsxs(i.Avatar.Avatar,{children:[o.jsx(i.Avatar.AvatarImage,{src:e.avatarUrl,alt:e.username,className:"bn-h-7 bn-rounded-full"}),o.jsx(i.Avatar.AvatarFallback,{children:e.username[0]})]}),o.jsxs("div",{className:"bn-flex bn-flex-row bn-flex-nowrap bn-items-center bn-gap-2",children:[o.jsx("span",{className:"bn-text-sm bn-font-bold",children:e.username}),o.jsxs("span",{className:"bn-text-xs",children:[s," ",r&&"(edited)"]})]})]})}),Ln=b.forwardRef((n,t)=>{const{className:e,showActions:s,authorInfo:r,timeString:a,actions:i,edited:p,children:c,...l}=n;u.assertEmpty(l);const[f,x]=b.useState(!1),{focused:w,ref:N}=y.useFocusWithin(),E=i&&(s===!0||s===void 0||s==="hover"&&f||w);return o.jsxs("div",{ref:t,className:d(e,"bn-relative bn-flex bn-flex-col bn-gap-2"),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[E?o.jsx("div",{className:"bn-absolute bn-right-0 bn-top-0 bn-z-10",ref:N,children:i}):null,o.jsx(Fn,{...n}),c]})}),zn=b.forwardRef((n,t)=>{const{className:e,onFocus:s,onBlur:r,autoFocus:a,editor:i,editable:p,...c}=n;return u.assertEmpty(c),o.jsx(pe,{autoFocus:a,className:d(e,""),editor:n.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:p,ref:t,onFocus:s,onBlur:r,children:o.jsx(y.FormattingToolbarController,{formattingToolbar:Vn})})}),Vn=()=>{const n=y.getFormattingToolbarItems([]).filter(t=>t.key!=="nestBlockButton"&&t.key!=="unnestBlockButton");return o.jsx(y.FormattingToolbar,{blockTypeSelectItems:[],children:n})},qn=b.forwardRef((n,t)=>{const{className:e,text:s,icon:r,isSelected:a,mainTooltip:i,secondaryTooltip:p,onClick:c,onMouseEnter:l,...f}=n;u.assertEmpty(f,!1);const x=g(),w=o.jsxs(x.Button.Button,{variant:a?"secondary":"outline",className:d(e,"bn-flex bn-items-center bn-gap-1 bn-rounded-full bn-h-7 bn-px-2.5"),onClick:c,onMouseEnter:l,ref:t,children:[o.jsx("span",{children:r}),o.jsx("span",{children:s})]});return i?o.jsxs(x.Tooltip.Tooltip,{children:[o.jsx(x.Tooltip.TooltipTrigger,{asChild:!0,children:w}),o.jsxs(x.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center bn-whitespace-pre-wrap",children:[o.jsx("span",{children:i}),p&&o.jsx("span",{children:p})]})]}):w}),_n=b.forwardRef((n,t)=>{const{className:e,children:s,...r}=n;u.assertEmpty(r);const a=g();return o.jsx(a.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:d(e,"bn-flex bn-flex-row bn-flex-wrap bn-gap-1 bn-w-full"),ref:t,children:s})})}),An=b.forwardRef((n,t)=>{const{className:e,children:s,onClick:r,label:a,...i}=n;u.assertEmpty(i);const p=g();return o.jsx(p.Button.Button,{type:"submit",className:e,"aria-label":a,ref:t,onClick:r,children:s})}),$n=b.forwardRef((n,t)=>{const{className:e,accept:s,value:r,placeholder:a,onChange:i,...p}=n;u.assertEmpty(p);const c=g();return o.jsx(c.Input.Input,{type:"file",className:e,ref:t,accept:s,value:r?r.name:void 0,onChange:async l=>i==null?void 0:i(l.target.files[0]),placeholder:a})}),On=b.forwardRef((n,t)=>{const{className:e,isSelected:s,onClick:r,item:a,id:i,...p}=n;u.assertEmpty(p);const c=b.useRef(null);return b.useEffect(()=>{if(!c.current||!s)return;const l=y.elementOverflow(c.current,document.querySelector(".bn-grid-suggestion-menu"));l==="top"?c.current.scrollIntoView(!0):l==="bottom"&&c.current.scrollIntoView(!1)},[s]),o.jsx("div",{className:e,ref:y.mergeRefs([t,c]),id:i,role:"option",onClick:r,"aria-selected":s||void 0,children:a.icon})}),Gn=b.forwardRef((n,t)=>{const{className:e,children:s,columns:r,...a}=n;return u.assertEmpty(a),o.jsx("div",{className:e,style:{gridColumn:`1 / ${r+1}`},ref:t,children:s})}),ue={FormattingToolbar:{Root:P,Button:k,Select:B},FilePanel:{Root:fn,Button:An,FileInput:$n,TabPanel:gn,TextInput:xn},LinkToolbar:{Root:P,Button:k,Select:B},SideMenu:{Root:Nn,Button:yn},SuggestionMenu:{Root:Sn,Item:Rn,EmptyItem:Tn,Label:Mn,Loader:In},GridSuggestionMenu:{Root:Cn,Item:On,EmptyItem:jn,Loader:Gn},TableHandle:{Root:En,ExtendButton:Dn},Comments:{Comment:Ln,Editor:zn,Card:Pn,CardSection:kn,ExpandSectionsPrompt:Bn},Generic:{Badge:{Root:qn,Group:_n},Toolbar:{Root:P,Button:k,Select:B},Form:{Root:sn,TextInput:rn},Menu:{Root:dn,Trigger:ln,Dropdown:bn,Divider:mn,Label:un,Item:cn,Button:pn},Popover:{Root:hn,Trigger:vn,Content:wn}}},pe=n=>{const{className:t,shadCNComponents:e,...s}=n,r=b.useMemo(()=>({...on,...e}),[e]);return o.jsx(me.Provider,{value:r,children:o.jsx(y.ComponentsContext.Provider,{value:ue,children:o.jsx(y.BlockNoteViewRaw,{className:u.mergeCSSClasses("bn-shadcn",t||""),...s})})})};exports.BlockNoteView=pe;exports.components=ue;
2
2
  //# sourceMappingURL=blocknote-shadcn.cjs.map