@blocknote/shadcn
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
1,141 lines (1,140 loc) • 45.3 kB
JavaScript
import { assertEmpty as e, mergeCSSClasses as t } from "@blocknote/core";
import { BlockNoteViewRaw as n, ComponentsContext as r, FormattingToolbar as i, FormattingToolbarController as a, elementOverflow as o, getFormattingToolbarItems as s, mergeRefs as c, useBlockNoteContext as l, useDictionary as u, useFocusWithin as d } from "@blocknote/react";
import * as f from "react";
import { createContext as p, forwardRef as m, useContext as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
import { FormProvider as ee, useForm as te } from "react-hook-form";
import * as b from "@radix-ui/react-avatar";
import { clsx as ne } from "clsx";
import { twMerge as re } from "tailwind-merge";
import { Fragment as ie, jsx as x, jsxs as S } from "react/jsx-runtime";
import { Slot as C } from "@radix-ui/react-slot";
import { cva as w } from "class-variance-authority";
import * as T from "@radix-ui/react-dropdown-menu";
import { CheckIcon as E, ChevronDownIcon as D, ChevronRight as ae, ChevronRightIcon as oe, ChevronUpIcon as se } from "lucide-react";
import * as ce from "@radix-ui/react-label";
import * as O from "@radix-ui/react-popover";
import * as k from "@radix-ui/react-select";
import * as A from "@radix-ui/react-tabs";
import * as le from "@radix-ui/react-toggle";
import * as j from "@radix-ui/react-tooltip";
import { createPortal as ue } from "react-dom";
//#region src/lib/utils.ts
function M(...e) {
return re(ne(e));
}
//#endregion
//#region src/components/ui/avatar.tsx
function de({ className: e, ...t }) {
return /* @__PURE__ */ x(b.Root, {
"data-slot": "avatar",
className: M("relative flex size-8 shrink-0 overflow-hidden rounded-full", e),
...t
});
}
function N({ className: e, ...t }) {
return /* @__PURE__ */ x(b.Image, {
"data-slot": "avatar-image",
className: M("aspect-square size-full", e),
...t
});
}
function P({ className: e, ...t }) {
return /* @__PURE__ */ x(b.Fallback, {
"data-slot": "avatar-fallback",
className: M("bg-muted flex size-full items-center justify-center rounded-full", e),
...t
});
}
//#endregion
//#region src/components/ui/badge.tsx
var F = w("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 I({ className: e, variant: t, asChild: n = !1, ...r }) {
return /* @__PURE__ */ x(n ? C : "span", {
"data-slot": "badge",
className: M(F({ variant: t }), e),
...r
});
}
//#endregion
//#region src/components/ui/button.tsx
var L = w("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 R({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
return /* @__PURE__ */ x(r ? C : "button", {
"data-slot": "button",
className: M(L({
variant: t,
size: n,
className: e
})),
...i
});
}
//#endregion
//#region src/components/ui/card.tsx
function z({ className: e, ...t }) {
return /* @__PURE__ */ x("div", {
"data-slot": "card",
className: M("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", e),
...t
});
}
function B({ className: e, ...t }) {
return /* @__PURE__ */ x("div", {
"data-slot": "card-content",
className: M("px-6", e),
...t
});
}
//#endregion
//#region src/components/ui/dropdown-menu.tsx
function V({ ...e }) {
return /* @__PURE__ */ x(T.Root, {
"data-slot": "dropdown-menu",
...e
});
}
function H({ ...e }) {
return /* @__PURE__ */ x(T.Trigger, {
"data-slot": "dropdown-menu-trigger",
...e
});
}
function fe({ className: e, sideOffset: t = 4, ...n }) {
return /* @__PURE__ */ x(T.Content, {
"data-slot": "dropdown-menu-content",
sideOffset: t,
className: M("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 pe({ className: e, inset: t, variant: n = "default", ...r }) {
return /* @__PURE__ */ x(T.Item, {
"data-slot": "dropdown-menu-item",
"data-inset": t,
"data-variant": n,
className: M("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 me({ className: e, children: t, checked: n, ...r }) {
return /* @__PURE__ */ S(T.CheckboxItem, {
"data-slot": "dropdown-menu-checkbox-item",
className: M("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: [/* @__PURE__ */ x("span", {
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
children: /* @__PURE__ */ x(T.ItemIndicator, { children: /* @__PURE__ */ x(E, { className: "size-4" }) })
}), t]
});
}
function he({ className: e, inset: t, ...n }) {
return /* @__PURE__ */ x(T.Label, {
"data-slot": "dropdown-menu-label",
"data-inset": t,
className: M("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", e),
...n
});
}
function ge({ className: e, ...t }) {
return /* @__PURE__ */ x(T.Separator, {
"data-slot": "dropdown-menu-separator",
className: M("bg-border -mx-1 my-1 h-px", e),
...t
});
}
function _e({ ...e }) {
return /* @__PURE__ */ x(T.Sub, {
"data-slot": "dropdown-menu-sub",
...e
});
}
function ve({ className: e, inset: t, children: n, ...r }) {
return /* @__PURE__ */ S(T.SubTrigger, {
"data-slot": "dropdown-menu-sub-trigger",
"data-inset": t,
className: M("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, /* @__PURE__ */ x(oe, { className: "ml-auto size-4" })]
});
}
function ye({ className: e, ...t }) {
return /* @__PURE__ */ x(T.SubContent, {
"data-slot": "dropdown-menu-sub-content",
className: M("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
});
}
//#endregion
//#region src/components/ui/label.tsx
function be({ className: e, ...t }) {
return /* @__PURE__ */ x(ce.Root, {
"data-slot": "label",
className: M("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
});
}
//#endregion
//#region src/components/ui/form.tsx
var xe = ee;
f.createContext({}), f.createContext({});
//#endregion
//#region src/components/ui/input.tsx
function Se({ className: e, type: t, ...n }) {
return /* @__PURE__ */ x("input", {
type: t,
"data-slot": "input",
className: M("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
});
}
//#endregion
//#region src/components/ui/popover.tsx
function Ce({ ...e }) {
return /* @__PURE__ */ x(O.Root, {
"data-slot": "popover",
...e
});
}
function we({ ...e }) {
return /* @__PURE__ */ x(O.Trigger, {
"data-slot": "popover-trigger",
...e
});
}
function Te({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
return /* @__PURE__ */ x(O.Content, {
"data-slot": "popover-content",
align: t,
sideOffset: n,
className: M("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
});
}
//#endregion
//#region src/components/ui/select.tsx
function Ee({ ...e }) {
return /* @__PURE__ */ x(k.Root, {
"data-slot": "select",
...e
});
}
function De({ ...e }) {
return /* @__PURE__ */ x(k.Value, {
"data-slot": "select-value",
...e
});
}
function Oe({ className: e, size: t = "default", children: n, ...r }) {
return /* @__PURE__ */ S(k.Trigger, {
"data-slot": "select-trigger",
"data-size": t,
className: M("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, /* @__PURE__ */ x(k.Icon, {
asChild: !0,
children: /* @__PURE__ */ x(D, { className: "size-4 opacity-50" })
})]
});
}
function ke({ className: e, children: t, position: n = "popper", ...r }) {
return /* @__PURE__ */ S(k.Content, {
"data-slot": "select-content",
className: M("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: [
/* @__PURE__ */ x(je, {}),
/* @__PURE__ */ x(k.Viewport, {
className: M("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
children: t
}),
/* @__PURE__ */ x(Me, {})
]
});
}
function Ae({ className: e, children: t, ...n }) {
return /* @__PURE__ */ S(k.Item, {
"data-slot": "select-item",
className: M("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: [/* @__PURE__ */ x("span", {
className: "absolute right-2 flex size-3.5 items-center justify-center",
children: /* @__PURE__ */ x(k.ItemIndicator, { children: /* @__PURE__ */ x(E, { className: "size-4" }) })
}), /* @__PURE__ */ x(k.ItemText, { children: t })]
});
}
function je({ className: e, ...t }) {
return /* @__PURE__ */ x(k.ScrollUpButton, {
"data-slot": "select-scroll-up-button",
className: M("flex cursor-default items-center justify-center py-1", e),
...t,
children: /* @__PURE__ */ x(se, { className: "size-4" })
});
}
function Me({ className: e, ...t }) {
return /* @__PURE__ */ x(k.ScrollDownButton, {
"data-slot": "select-scroll-down-button",
className: M("flex cursor-default items-center justify-center py-1", e),
...t,
children: /* @__PURE__ */ x(D, { className: "size-4" })
});
}
//#endregion
//#region src/components/ui/skeleton.tsx
function Ne({ className: e, ...t }) {
return /* @__PURE__ */ x("div", {
"data-slot": "skeleton",
className: M("bg-accent animate-pulse rounded-md", e),
...t
});
}
//#endregion
//#region src/components/ui/tabs.tsx
function Pe({ className: e, ...t }) {
return /* @__PURE__ */ x(A.Root, {
"data-slot": "tabs",
className: M("flex flex-col gap-2", e),
...t
});
}
function Fe({ className: e, ...t }) {
return /* @__PURE__ */ x(A.List, {
"data-slot": "tabs-list",
className: M("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", e),
...t
});
}
function Ie({ className: e, ...t }) {
return /* @__PURE__ */ x(A.Trigger, {
"data-slot": "tabs-trigger",
className: M("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 Le({ className: e, ...t }) {
return /* @__PURE__ */ x(A.Content, {
"data-slot": "tabs-content",
className: M("flex-1 outline-none", e),
...t
});
}
//#endregion
//#region src/components/ui/toggle.tsx
var Re = w("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 ze({ className: e, variant: t, size: n, ...r }) {
return /* @__PURE__ */ x(le.Root, {
"data-slot": "toggle",
className: M(Re({
variant: t,
size: n,
className: e
})),
...r
});
}
//#endregion
//#region src/components/ui/tooltip.tsx
function U({ delayDuration: e = 0, ...t }) {
return /* @__PURE__ */ x(j.Provider, {
"data-slot": "tooltip-provider",
delayDuration: e,
...t
});
}
function Be({ ...e }) {
return /* @__PURE__ */ x(U, { children: /* @__PURE__ */ x(j.Root, {
"data-slot": "tooltip",
...e
}) });
}
function Ve({ ...e }) {
return /* @__PURE__ */ x(j.Trigger, {
"data-slot": "tooltip-trigger",
...e
});
}
function He({ className: e, sideOffset: t = 0, children: n, ...r }) {
return /* @__PURE__ */ S(j.Content, {
"data-slot": "tooltip-content",
sideOffset: t,
className: M("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, /* @__PURE__ */ x(j.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
});
}
//#endregion
//#region src/ShadCNComponentsContext.tsx
var W = {
Avatar: {
Avatar: de,
AvatarFallback: P,
AvatarImage: N
},
Badge: { Badge: I },
Button: { Button: R },
Card: {
Card: z,
CardContent: B
},
DropdownMenu: {
DropdownMenu: V,
DropdownMenuCheckboxItem: me,
DropdownMenuContent: fe,
DropdownMenuItem: pe,
DropdownMenuLabel: he,
DropdownMenuSeparator: ge,
DropdownMenuSub: _e,
DropdownMenuSubContent: ye,
DropdownMenuSubTrigger: ve,
DropdownMenuTrigger: H
},
Form: { Form: xe },
Input: { Input: Se },
Label: { Label: be },
Popover: {
Popover: Ce,
PopoverContent: Te,
PopoverTrigger: we
},
Select: {
Select: Ee,
SelectContent: ke,
SelectItem: Ae,
SelectTrigger: Oe,
SelectValue: De
},
Skeleton: { Skeleton: Ne },
Tabs: {
Tabs: Pe,
TabsContent: Le,
TabsList: Fe,
TabsTrigger: Ie
},
Toggle: { Toggle: ze },
Tooltip: {
Tooltip: Be,
TooltipContent: He,
TooltipProvider: U,
TooltipTrigger: Ve
}
}, G = p(void 0);
function K() {
return h(G);
}
//#endregion
//#region src/form/Form.tsx
var Ue = (t) => {
let { children: n, ...r } = t;
e(r);
let i = K(), a = te();
return /* @__PURE__ */ x(i.Form.Form, {
...a,
children: n
});
}, We = m((t, n) => {
let { className: r, name: i, label: a, variant: o, icon: s, value: c, autoFocus: l, placeholder: u, disabled: d, onKeyDown: f, onChange: p, onSubmit: m, autoComplete: h, "aria-activedescendant": g, rightSection: _, ...v } = t;
e(v);
let y = K();
return /* @__PURE__ */ S("div", {
className: M(r, "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: [
s,
/* @__PURE__ */ S("div", {
className: "flex-1",
children: [a && /* @__PURE__ */ x(y.Label.Label, {
htmlFor: a,
children: a
}), /* @__PURE__ */ x(y.Input.Input, {
className: M(r, "h-auto border-none p-0"),
id: a,
name: i,
autoFocus: l,
placeholder: u,
disabled: d,
value: c,
onKeyDown: f,
onChange: p,
onSubmit: m,
ref: n,
"aria-activedescendant": g
})]
}),
_
]
});
}), Ge = (e) => m((t, n) => /* @__PURE__ */ x(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
})), Ke = (t) => {
let { children: n, onOpenChange: r, position: i, sub: a, ...o } = t;
e(o);
let s = K();
return a ? /* @__PURE__ */ x(s.DropdownMenu.DropdownMenuSub, {
onOpenChange: r,
children: n
}) : /* @__PURE__ */ x(s.DropdownMenu.DropdownMenu, {
modal: !1,
onOpenChange: r,
children: n
});
}, qe = (t) => {
let { children: n, sub: r, ...i } = t;
e(i);
let a = K(), o = _(() => Ge(a.DropdownMenu.DropdownMenuTrigger), [a.DropdownMenu.DropdownMenuTrigger]);
return r ? /* @__PURE__ */ x(a.DropdownMenu.DropdownMenuSubTrigger, { children: n }) : /* @__PURE__ */ x(o, {
asChild: !0,
...i,
children: n
});
}, Je = m((t, n) => {
let { className: r, children: i, sub: a, ...o } = t;
e(o);
let s = K();
return x(a ? s.DropdownMenu.DropdownMenuSubContent : s.DropdownMenu.DropdownMenuContent, {
className: r,
ref: n,
children: i
});
}), Ye = m((t, n) => {
let { className: r, children: i, icon: a, checked: o, subTrigger: s, onClick: c, ...l } = t;
e(l);
let u = K();
return s ? /* @__PURE__ */ S(ie, { children: [a, i] }) : o === void 0 ? /* @__PURE__ */ S(u.DropdownMenu.DropdownMenuItem, {
className: r,
ref: n,
onClick: c,
...l,
children: [
a,
i,
s && /* @__PURE__ */ x(ae, { className: "ml-auto h-4 w-4" })
]
}) : /* @__PURE__ */ S(u.DropdownMenu.DropdownMenuCheckboxItem, {
className: M(r, "gap-1", o ? "" : "px-2"),
ref: n,
checked: o,
onClick: c,
...l,
children: [a, i]
});
}), Xe = m((t, n) => {
let { className: r, ...i } = t;
return e(i), /* @__PURE__ */ x(K().DropdownMenu.DropdownMenuSeparator, {
className: r,
ref: n
});
}), Ze = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x(K().DropdownMenu.DropdownMenuLabel, {
className: r,
ref: n,
children: i
});
}), Qe = m((t, n) => {
let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = t;
return e(d, !1), /* @__PURE__ */ S(K().Button.Button, {
variant: "ghost",
className: M(r, "text-gray-400"),
ref: n,
"aria-label": u,
onClick: o,
onDragStart: c,
onDragEnd: s,
draggable: l,
...d,
children: [a, i]
});
}), $e = m((t, n) => {
let { className: r, tabs: i, defaultOpenTab: a, openTab: o, setOpenTab: s, loading: c, ...l } = t;
e(l);
let u = K();
return /* @__PURE__ */ S(u.Tabs.Tabs, {
className: M(r, "bg-popover max-w-screen rounded-lg p-2"),
ref: n,
value: o,
defaultValue: a,
onValueChange: s,
children: [/* @__PURE__ */ x(u.Tabs.TabsList, { children: i.map((e) => /* @__PURE__ */ x(u.Tabs.TabsTrigger, {
value: e.name,
children: e.name
}, e.name)) }), i.map((e) => /* @__PURE__ */ x(u.Tabs.TabsContent, {
value: e.name,
children: /* @__PURE__ */ x(u.Card.Card, { children: /* @__PURE__ */ x(u.Card.CardContent, {
className: "p-4",
children: e.tabPanel
}) })
}, e.name))]
});
}), et = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x("div", {
className: M(r, "flex flex-col items-start justify-center gap-2"),
ref: n,
children: i
});
}), tt = m((t, n) => {
let { className: r, value: i, placeholder: a, onKeyDown: o, onChange: s, ...c } = t;
return e(c), /* @__PURE__ */ x(K().Input.Input, {
"data-test": "embed-input",
className: M(r, "w-80 max-w-full"),
ref: n,
value: i,
placeholder: a,
onKeyDown: o,
onChange: s
});
}), q = p(void 0), nt = (t) => {
let { children: n, open: r, onOpenChange: i, position: a, portalRoot: o, ...s } = t;
return e(s), /* @__PURE__ */ x(K().Popover.Popover, {
open: r,
onOpenChange: i,
children: /* @__PURE__ */ x(q.Provider, {
value: o,
children: n
})
});
}, rt = m((t, n) => {
let { children: r, ...i } = t;
return e(i), /* @__PURE__ */ x(K().Popover.PopoverTrigger, {
ref: n,
asChild: !0,
children: r
});
}), it = m((t, n) => {
let { className: r, variant: i, children: a, ...o } = t;
e(o);
let s = K(), c = h(q), l = /* @__PURE__ */ x(s.Popover.PopoverContent, {
sideOffset: 8,
className: M(r, "flex flex-col gap-2", i === "panel-popover" ? "w-fit max-w-none border-none p-0 shadow-none" : ""),
ref: n,
children: a
});
return c ? ue(l, c) : l;
}), at = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a, !1), /* @__PURE__ */ x("div", {
className: r,
ref: n,
...a,
children: i
});
}), ot = m((t, n) => {
let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = t;
return e(d, !1), /* @__PURE__ */ S(K().Button.Button, {
variant: "ghost",
className: M(r, "text-gray-400"),
ref: n,
"aria-label": u,
onClick: o,
onDragStart: c,
onDragEnd: s,
draggable: l,
...d,
children: [a, i]
});
}), st = m((t, n) => {
let { className: r, children: i, id: a, columns: o, ...s } = t;
return e(s), /* @__PURE__ */ x("div", {
className: M("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", r),
style: { gridTemplateColumns: `repeat(${o}, 1fr)` },
ref: n,
id: a,
role: "grid",
children: i
});
}), ct = m((t, n) => {
let { className: r, children: i, columns: a, ...o } = t;
return e(o), /* @__PURE__ */ x("div", {
className: r,
style: { gridColumn: `1 / ${a + 1}` },
ref: n,
children: i
});
}), lt = m((t, n) => {
let { className: r, children: i, id: a, ...o } = t;
return e(o), /* @__PURE__ */ x("div", {
id: a,
role: "listbox",
className: M("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", r),
ref: n,
children: i
});
}), ut = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x("div", {
className: M("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", r),
ref: n,
children: /* @__PURE__ */ x("div", { children: i })
});
}), dt = m((t, n) => {
let r = K(), { className: i, item: a, isSelected: s, onClick: l, id: u, ...d } = t;
e(d);
let f = v(null);
return g(() => {
!f.current || !s || o(f.current, f.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")) !== "none" && f.current.scrollIntoView({ block: "nearest" });
}, [s]), /* @__PURE__ */ S("div", {
className: M("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", t.item.size === "small" ? "gap-3 py-1" : "", i),
"data-highlighted": !0,
ref: c([n, f]),
id: u,
onMouseDown: (e) => e.preventDefault(),
onClick: l,
role: "option",
"aria-selected": s || void 0,
children: [
a.icon && /* @__PURE__ */ x("div", {
className: M("p-3", t.item.size === "small" ? "p-0" : "", i),
"data-position": "left",
children: a.icon
}),
/* @__PURE__ */ S("div", {
className: "flex-1",
children: [/* @__PURE__ */ x("div", {
className: M("text-base", t.item.size === "small" ? "text-sm" : "", i),
children: a.title
}), /* @__PURE__ */ x("div", {
className: M("text-xs", t.item.size === "small" ? "hidden" : "", i),
children: a.subtext
})]
}),
a.badge && /* @__PURE__ */ x("div", {
"data-position": "right",
className: "text-xs",
children: /* @__PURE__ */ x(r.Badge.Badge, {
variant: "secondary",
children: a.badge
})
})
]
});
}), ft = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x("div", {
className: M("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", r),
ref: n,
children: i
});
}), pt = m((t, n) => {
let { className: r, ...i } = t;
return e(i), /* @__PURE__ */ x("div", {
className: M(r, "animate-spin"),
ref: n,
children: /* @__PURE__ */ x("svg", {
xmlns: "http://www.w3.org/2000/svg",
height: "1em",
viewBox: "0 -960 960 960",
width: "1em",
fill: "#e8eaed",
children: /* @__PURE__ */ x("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" })
})
});
}), mt = m((t, n) => {
let { className: r, children: i, onMouseDown: a, onClick: o, ...s } = t;
return e(s, !1), /* @__PURE__ */ x(K().Button.Button, {
variant: "ghost",
className: M(r, "h-full w-full p-0 text-gray-400", r?.includes("extend-button-add-remove-columns") ? "ml-1" : "mt-1", r?.includes("extend-button-editing") ? "bg-accent text-accent-foreground" : ""),
ref: n,
onClick: o,
onMouseDown: a,
...s,
children: i
});
}), ht = m((t, n) => {
let { className: r, children: i, draggable: a, onDragStart: o, onDragEnd: s, style: c, label: l, ...u } = t;
return e(u, !1), /* @__PURE__ */ x(K().Button.Button, {
variant: "ghost",
className: M(r, "h-fit w-fit p-0 text-gray-400"),
ref: n,
"aria-label": l,
draggable: a,
onDragStart: o,
onDragEnd: s,
style: c,
...u,
children: i
});
}), J = m((t, n) => {
let { className: r, children: i, onMouseEnter: a, onMouseLeave: o, variant: s, ...c } = t;
return e(c), /* @__PURE__ */ x(K().Tooltip.TooltipProvider, {
delayDuration: 0,
children: /* @__PURE__ */ x("div", {
className: M(r, "bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md", s === "action-toolbar" ? "w-fit" : ""),
ref: n,
onMouseEnter: a,
onMouseLeave: o,
children: i
})
});
}), Y = m((t, n) => {
let { className: r, children: i, mainTooltip: a, secondaryTooltip: o, icon: s, isSelected: c, isDisabled: l, onClick: u, label: d, variant: f, ...p } = t;
e(p, !1);
let m = K(), h = c === void 0 ? /* @__PURE__ */ S(m.Button.Button, {
className: M(r, f === "compact" ? "h-6 min-w-6 p-0" : ""),
variant: "ghost",
size: f === "compact" ? "sm" : "default",
disabled: l,
onClick: u,
ref: n,
"aria-label": d,
...p,
children: [s, i]
}) : /* @__PURE__ */ S(m.Toggle.Toggle, {
className: M(r, "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: c,
disabled: l,
"data-state": c ? "on" : "off",
"data-disabled": l,
ref: n,
...p,
children: [s, i]
});
return /* @__PURE__ */ S(m.Tooltip.Tooltip, { children: [/* @__PURE__ */ x(m.Tooltip.TooltipTrigger, {
asChild: !0,
children: h
}), /* @__PURE__ */ S(m.Tooltip.TooltipContent, {
className: "flex flex-col items-center whitespace-pre-wrap",
children: [/* @__PURE__ */ x("span", { children: a }), o && /* @__PURE__ */ x("span", { children: o })]
})] });
}), X = m((t, n) => {
let { className: r, items: i, isDisabled: a, ...o } = t;
e(o);
let s = K(), c = (e) => /* @__PURE__ */ S("div", {
className: "flex items-center gap-1",
children: [e.icon, e.text]
}), l = i.filter((e) => e.isSelected)[0];
return l ? /* @__PURE__ */ S(s.Select.Select, {
value: l.text,
onValueChange: (e) => i.find((t) => t.text === e).onClick?.(),
disabled: a,
children: [/* @__PURE__ */ x(s.Select.SelectTrigger, {
className: "border-none",
children: /* @__PURE__ */ x(s.Select.SelectValue, {})
}), /* @__PURE__ */ x(s.Select.SelectContent, {
className: r,
ref: n,
children: i.map((e) => /* @__PURE__ */ x(s.Select.SelectItem, {
disabled: e.isDisabled,
value: e.text,
children: /* @__PURE__ */ x(c, { ...e })
}, e.text))
})]
}) : null;
}), gt = m((t, n) => {
let { className: r, children: i, selected: a, headerText: o, onFocus: s, onBlur: c, tabIndex: l, ...u } = t;
return e(u), /* @__PURE__ */ S(K().Card.Card, {
className: M(r, "w-[300px]", a ? "bg-accent text-accent-foreground" : ""),
onFocus: s,
onBlur: c,
tabIndex: l,
ref: n,
children: [o && /* @__PURE__ */ x("div", {
className: "px-4 pt-4 text-sm italic",
children: o
}), i]
});
}), _t = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x("div", {
className: M(r, "p-4", r?.includes("thread-comments") ? "flex flex-col gap-6 border-b" : ""),
ref: n,
children: i
});
}), vt = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a, !1), /* @__PURE__ */ x(K().Button.Button, {
className: M(r, "text-foreground w-fit bg-transparent p-0 hover:bg-transparent"),
ref: n,
children: i
});
}), yt = m((t, n) => {
let { authorInfo: r, timeString: i, edited: a, ...o } = t, s = u();
e(o, !1);
let c = K();
return r === "loading" ? /* @__PURE__ */ S("div", {
className: "flex flex-row flex-nowrap items-center gap-4",
children: [/* @__PURE__ */ x(c.Skeleton.Skeleton, { className: "size-7 animate-pulse rounded-full bg-neutral-400" }), /* @__PURE__ */ x(c.Skeleton.Skeleton, { className: "h-3 w-32 animate-pulse rounded-full bg-neutral-400" })]
}) : /* @__PURE__ */ S("div", {
className: "flex flex-row flex-nowrap items-center gap-4",
children: [/* @__PURE__ */ S(c.Avatar.Avatar, { children: [/* @__PURE__ */ x(c.Avatar.AvatarImage, {
src: r.avatarUrl,
alt: r.username,
className: "h-7 rounded-full"
}), /* @__PURE__ */ x(c.Avatar.AvatarFallback, { children: r.username[0] })] }), /* @__PURE__ */ S("div", {
className: "flex flex-row flex-nowrap items-center gap-2",
children: [/* @__PURE__ */ x("span", {
className: "text-sm font-bold",
children: r.username
}), /* @__PURE__ */ S("span", {
className: "text-xs",
children: [
i,
" ",
a && `(${s.comments.edited})`
]
})]
})]
});
}), bt = m((t, n) => {
let { className: r, showActions: i, authorInfo: a, timeString: o, actions: s, edited: c, emojiPickerOpen: l, children: u, ...f } = t;
e(f);
let [p, m] = y(!1), { focused: h, ref: g } = d(), _ = s && (i === !0 || i === void 0 || i === "hover" && p || h || l);
return /* @__PURE__ */ S("div", {
ref: n,
className: M(r, "relative flex flex-col gap-2"),
onMouseEnter: () => m(!0),
onMouseLeave: () => m(!1),
children: [
_ ? /* @__PURE__ */ x("div", {
className: "absolute right-0 top-0 z-10",
ref: g,
children: s
}) : null,
/* @__PURE__ */ x(yt, { ...t }),
u
]
});
}), xt = m((t, n) => {
let { className: r, onFocus: i, onBlur: o, autoFocus: s, editor: c, editable: u, ...d } = t;
e(d);
let f = l();
return /* @__PURE__ */ x($, {
autoFocus: s,
className: M(r, ""),
theme: f?.colorSchemePreference,
editor: t.editor,
sideMenu: !1,
slashMenu: !1,
tableHandles: !1,
filePanel: !1,
formattingToolbar: !1,
editable: u,
ref: n,
onFocus: i,
onBlur: o,
children: /* @__PURE__ */ x(a, { formattingToolbar: St })
});
}), St = () => /* @__PURE__ */ x(i, {
blockTypeSelectItems: [],
children: s([]).filter((e) => e.key !== "nestBlockButton" && e.key !== "unnestBlockButton")
}), Ct = m((t, n) => {
let { className: r, text: i, icon: a, isSelected: o, mainTooltip: s, secondaryTooltip: c, onClick: l, onMouseEnter: u, ...d } = t;
e(d, !1);
let f = K(), p = /* @__PURE__ */ S(f.Button.Button, {
variant: o ? "secondary" : "outline",
className: M(r, "flex h-7 items-center gap-1 rounded-full px-2.5"),
onClick: l,
onMouseEnter: u,
ref: n,
children: [/* @__PURE__ */ x("span", { children: a }), /* @__PURE__ */ x("span", { children: i })]
});
return s ? /* @__PURE__ */ S(f.Tooltip.Tooltip, { children: [/* @__PURE__ */ x(f.Tooltip.TooltipTrigger, {
asChild: !0,
children: p
}), /* @__PURE__ */ S(f.Tooltip.TooltipContent, {
className: "flex flex-col items-center whitespace-pre-wrap",
children: [/* @__PURE__ */ x("span", { children: s }), c && /* @__PURE__ */ x("span", { children: c })]
})] }) : p;
}), wt = m((t, n) => {
let { className: r, children: i, ...a } = t;
return e(a), /* @__PURE__ */ x(K().Tooltip.TooltipProvider, {
delayDuration: 0,
children: /* @__PURE__ */ x("div", {
className: M(r, "flex w-full flex-row flex-wrap gap-1"),
ref: n,
children: i
})
});
}), Tt = m((t, n) => {
let { className: r, children: i, onClick: a, label: o, ...s } = t;
return e(s), /* @__PURE__ */ x(K().Button.Button, {
type: "submit",
className: r,
"aria-label": o,
ref: n,
onClick: a,
children: i
});
}), Et = m((t, n) => {
let { className: r, accept: i, value: a, placeholder: o, onChange: s, ...c } = t;
return e(c), /* @__PURE__ */ x(K().Input.Input, {
type: "file",
className: r,
ref: n,
accept: i,
value: a ? a.name : void 0,
onChange: async (e) => s?.(e.target.files[0]),
placeholder: o
});
}), Dt = m((t, n) => {
let { className: r, isSelected: i, onClick: a, item: s, id: l, ...u } = t;
e(u);
let d = v(null);
return g(() => {
!d.current || !i || o(d.current, d.current.closest(".bn-grid-suggestion-menu")) !== "none" && d.current.scrollIntoView({ block: "nearest" });
}, [i]), /* @__PURE__ */ x("div", {
className: M("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!", r),
ref: c([n, d]),
id: l,
role: "option",
onClick: a,
"aria-selected": i || void 0,
children: s.icon
});
}), Z = m((t, n) => {
let { className: r, children: i, columns: a, ...o } = t;
return e(o), /* @__PURE__ */ x("div", {
className: r,
style: { gridColumn: `1 / ${a + 1}` },
ref: n,
children: i
});
}), Q = {
FormattingToolbar: {
Root: J,
Button: Y,
Select: X
},
FilePanel: {
Root: $e,
Button: Tt,
FileInput: Et,
TabPanel: et,
TextInput: tt
},
LinkToolbar: {
Root: J,
Button: Y,
Select: X
},
SideMenu: {
Root: at,
Button: ot
},
SuggestionMenu: {
Root: lt,
Item: dt,
EmptyItem: ut,
Label: ft,
Loader: pt
},
GridSuggestionMenu: {
Root: st,
Item: Dt,
EmptyItem: ct,
Loader: Z
},
TableHandle: {
Root: ht,
ExtendButton: mt
},
Comments: {
Comment: bt,
Editor: xt,
Card: gt,
CardSection: _t,
ExpandSectionsPrompt: vt
},
Generic: {
Badge: {
Root: Ct,
Group: wt
},
Toolbar: {
Root: J,
Button: Y,
Select: X
},
Form: {
Root: Ue,
TextInput: We
},
Menu: {
Root: Ke,
Trigger: qe,
Dropdown: Je,
Divider: Xe,
Label: Ze,
Item: Ye,
Button: Qe
},
Popover: {
Root: nt,
Trigger: rt,
Content: it
}
}
}, $ = (e) => {
let { className: i, shadCNComponents: a, ...o } = e, s = _(() => ({
...W,
...a
}), [a]);
return /* @__PURE__ */ x(G.Provider, {
value: s,
children: /* @__PURE__ */ x(r.Provider, {
value: Q,
children: /* @__PURE__ */ x(n, {
className: t("bn-shadcn", i || ""),
...o
})
})
});
};
//#endregion
export { $ as BlockNoteView, G as ShadCNComponentsContext, W as ShadCNDefaultComponents, Q as components, K as useShadCNComponentsContext };
//# sourceMappingURL=blocknote-shadcn.js.map