@blocknote/shadcn 0.17.1 → 0.18.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.
- package/dist/blocknote-shadcn.js +795 -1405
- package/dist/blocknote-shadcn.js.map +1 -1
- package/dist/blocknote-shadcn.umd.cjs +1 -30
- package/dist/blocknote-shadcn.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +6 -8
- package/src/index.tsx +2 -0
- package/src/style.css +9 -1
- package/src/tableHandle/ExtendButton.tsx +40 -0
- package/types/src/tableHandle/ExtendButton.d.ts +7 -0
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
(function(N,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@blocknote/core"),require("@blocknote/react"),require("react-hook-form"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-slot"),require("@radix-ui/react-dropdown-menu"),require("lucide-react"),require("@radix-ui/react-label"),require("@radix-ui/react-popover"),require("@radix-ui/react-select"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tooltip")):typeof define=="function"&&define.amd?define(["exports","react","@blocknote/core","@blocknote/react","react-hook-form","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-slot","@radix-ui/react-dropdown-menu","lucide-react","@radix-ui/react-label","@radix-ui/react-popover","@radix-ui/react-select","@radix-ui/react-tabs","@radix-ui/react-toggle","@radix-ui/react-tooltip"],g):(N=typeof globalThis<"u"?globalThis:N||self,g(N["blocknote-shadcn"]={},N.React,N.core,N.react,N.reactHookForm,N.classVarianceAuthority,N.clsx,N.tailwindMerge,N.reactSlot,N.DropdownMenuPrimitive,N.lucideReact,N.LabelPrimitive,N.PopoverPrimitive,N.SelectPrimitive,N.TabsPrimitive,N.TogglePrimitive,N.TooltipPrimitive))})(this,function(N,g,w,W,se,Q,Cn,jn,xe,Nn,B,Sn,Tn,Rn,En,_n,Pn){"use strict";function V(n){if(n&&typeof n=="object"&&"default"in n)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const p=V(g),S=V(Nn),he=V(Sn),ee=V(Tn),_=V(Rn),$=V(En),ye=V(_n),G=V(Pn);var ie={exports:{}},K={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var we;function Dn(){if(we)return K;we=1;var n=p.default,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function c(x,f,u){var v,R={},D=null,F=null;u!==void 0&&(D=""+u),f.key!==void 0&&(D=""+f.key),f.ref!==void 0&&(F=f.ref);for(v in f)o.call(f,v)&&!d.hasOwnProperty(v)&&(R[v]=f[v]);if(x&&x.defaultProps)for(v in f=x.defaultProps,f)R[v]===void 0&&(R[v]=f[v]);return{$$typeof:r,type:x,key:D,ref:F,props:R,_owner:s.current}}return K.Fragment=t,K.jsx=c,K.jsxs=c,K}var J={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ce;function In(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var n=p.default,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),x=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),He=Symbol.iterator,zt="@@iterator";function Wt(e){if(e===null||typeof e!="object")return null;var i=He&&e[He]||e[zt];return typeof i=="function"?i:null}var q=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(e){{for(var i=arguments.length,l=new Array(i>1?i-1:0),m=1;m<i;m++)l[m-1]=arguments[m];qt("error",e,l)}}function qt(e,i,l){{var m=q.ReactDebugCurrentFrame,C=m.getStackAddendum();C!==""&&(i+="%s",l=l.concat([C]));var j=l.map(function(y){return String(y)});j.unshift("Warning: "+i),Function.prototype.apply.call(console[e],console,j)}}var Yt=!1,Ut=!1,Gt=!1,Kt=!1,Jt=!1,Xe;Xe=Symbol.for("react.module.reference");function Ht(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===d||Jt||e===s||e===u||e===v||Kt||e===F||Yt||Ut||Gt||typeof e=="object"&&e!==null&&(e.$$typeof===D||e.$$typeof===R||e.$$typeof===c||e.$$typeof===x||e.$$typeof===f||e.$$typeof===Xe||e.getModuleId!==void 0))}function Xt(e,i,l){var m=e.displayName;if(m)return m;var C=i.displayName||i.name||"";return C!==""?l+"("+C+")":l}function Ze(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case t:return"Portal";case d:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var i=e;return Ze(i)+".Consumer";case c:var l=e;return Ze(l._context)+".Provider";case f:return Xt(e,e.render,"ForwardRef");case R:var m=e.displayName||null;return m!==null?m:L(e.type)||"Memo";case D:{var C=e,j=C._payload,y=C._init;try{return L(y(j))}catch{return null}}}return null}var A=Object.assign,H=0,Qe,en,nn,tn,rn,on,an;function sn(){}sn.__reactDisabledLog=!0;function Zt(){{if(H===0){Qe=console.log,en=console.info,nn=console.warn,tn=console.error,rn=console.group,on=console.groupCollapsed,an=console.groupEnd;var e={configurable:!0,enumerable:!0,value:sn,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function Qt(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:Qe}),info:A({},e,{value:en}),warn:A({},e,{value:nn}),error:A({},e,{value:tn}),group:A({},e,{value:rn}),groupCollapsed:A({},e,{value:on}),groupEnd:A({},e,{value:an})})}H<0&&I("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=q.ReactCurrentDispatcher,ce;function te(e,i,l){{if(ce===void 0)try{throw Error()}catch(C){var m=C.stack.trim().match(/\n( *(at )?)/);ce=m&&m[1]||""}return`
|
|
18
|
-
`+ce+e}}var ue=!1,re;{var er=typeof WeakMap=="function"?WeakMap:Map;re=new er}function ln(e,i){if(!e||ue)return"";{var l=re.get(e);if(l!==void 0)return l}var m;ue=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=de.current,de.current=null,Zt();try{if(i){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(k){m=k}Reflect.construct(e,[],y)}else{try{y.call()}catch(k){m=k}e.call(y.prototype)}}else{try{throw Error()}catch(k){m=k}e()}}catch(k){if(k&&m&&typeof k.stack=="string"){for(var h=k.stack.split(`
|
|
19
|
-
`),M=m.stack.split(`
|
|
20
|
-
`),E=h.length-1,P=M.length-1;E>=1&&P>=0&&h[E]!==M[P];)P--;for(;E>=1&&P>=0;E--,P--)if(h[E]!==M[P]){if(E!==1||P!==1)do if(E--,P--,P<0||h[E]!==M[P]){var O=`
|
|
21
|
-
`+h[E].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&re.set(e,O),O}while(E>=1&&P>=0);break}}}finally{ue=!1,de.current=j,Qt(),Error.prepareStackTrace=C}var U=e?e.displayName||e.name:"",z=U?te(U):"";return typeof e=="function"&&re.set(e,z),z}function nr(e,i,l){return ln(e,!1)}function tr(e){var i=e.prototype;return!!(i&&i.isReactComponent)}function oe(e,i,l){if(e==null)return"";if(typeof e=="function")return ln(e,tr(e));if(typeof e=="string")return te(e);switch(e){case u:return te("Suspense");case v:return te("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return nr(e.render);case R:return oe(e.type,i,l);case D:{var m=e,C=m._payload,j=m._init;try{return oe(j(C),i,l)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,dn={},cn=q.ReactDebugCurrentFrame;function ae(e){if(e){var i=e._owner,l=oe(e.type,e._source,i?i.type:null);cn.setExtraStackFrame(l)}else cn.setExtraStackFrame(null)}function rr(e,i,l,m,C){{var j=Function.call.bind(X);for(var y in e)if(j(e,y)){var h=void 0;try{if(typeof e[y]!="function"){var M=Error((m||"React class")+": "+l+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}h=e[y](i,y,m,l,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){h=E}h&&!(h instanceof Error)&&(ae(C),I("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",m||"React class",l,y,typeof h),ae(null)),h instanceof Error&&!(h.message in dn)&&(dn[h.message]=!0,ae(C),I("Failed %s type: %s",l,h.message),ae(null))}}}var or=Array.isArray;function be(e){return or(e)}function ar(e){{var i=typeof Symbol=="function"&&Symbol.toStringTag,l=i&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l}}function sr(e){try{return un(e),!1}catch{return!0}}function un(e){return""+e}function bn(e){if(sr(e))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),un(e)}var Z=q.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},fn,mn,fe;fe={};function lr(e){if(X.call(e,"ref")){var i=Object.getOwnPropertyDescriptor(e,"ref").get;if(i&&i.isReactWarning)return!1}return e.ref!==void 0}function dr(e){if(X.call(e,"key")){var i=Object.getOwnPropertyDescriptor(e,"key").get;if(i&&i.isReactWarning)return!1}return e.key!==void 0}function cr(e,i){if(typeof e.ref=="string"&&Z.current&&i&&Z.current.stateNode!==i){var l=L(Z.current.type);fe[l]||(I('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(Z.current.type),e.ref),fe[l]=!0)}}function ur(e,i){{var l=function(){fn||(fn=!0,I("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}}function br(e,i){{var l=function(){mn||(mn=!0,I("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};l.isReactWarning=!0,Object.defineProperty(e,"ref",{get:l,configurable:!0})}}var fr=function(e,i,l,m,C,j,y){var h={$$typeof:r,type:e,key:i,ref:l,props:y,_owner:j};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function mr(e,i,l,m,C){{var j,y={},h=null,M=null;l!==void 0&&(bn(l),h=""+l),dr(i)&&(bn(i.key),h=""+i.key),lr(i)&&(M=i.ref,cr(i,C));for(j in i)X.call(i,j)&&!ir.hasOwnProperty(j)&&(y[j]=i[j]);if(e&&e.defaultProps){var E=e.defaultProps;for(j in E)y[j]===void 0&&(y[j]=E[j])}if(h||M){var P=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&ur(y,P),M&&br(y,P)}return fr(e,h,M,C,m,Z.current,y)}}var me=q.ReactCurrentOwner,pn=q.ReactDebugCurrentFrame;function Y(e){if(e){var i=e._owner,l=oe(e.type,e._source,i?i.type:null);pn.setExtraStackFrame(l)}else pn.setExtraStackFrame(null)}var pe;pe=!1;function ge(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function gn(){{if(me.current){var e=L(me.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function pr(e){return""}var vn={};function gr(e){{var i=gn();if(!i){var l=typeof e=="string"?e:e.displayName||e.name;l&&(i=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+l+">.")}return i}}function xn(e,i){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=gr(i);if(vn[l])return;vn[l]=!0;var m="";e&&e._owner&&e._owner!==me.current&&(m=" It was passed a child from "+L(e._owner.type)+"."),Y(e),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',l,m),Y(null)}}function hn(e,i){{if(typeof e!="object")return;if(be(e))for(var l=0;l<e.length;l++){var m=e[l];ge(m)&&xn(m,i)}else if(ge(e))e._store&&(e._store.validated=!0);else if(e){var C=Wt(e);if(typeof C=="function"&&C!==e.entries)for(var j=C.call(e),y;!(y=j.next()).done;)ge(y.value)&&xn(y.value,i)}}}function vr(e){{var i=e.type;if(i==null||typeof i=="string")return;var l;if(typeof i=="function")l=i.propTypes;else if(typeof i=="object"&&(i.$$typeof===f||i.$$typeof===R))l=i.propTypes;else return;if(l){var m=L(i);rr(l,e.props,"prop",m,e)}else if(i.PropTypes!==void 0&&!pe){pe=!0;var C=L(i);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"Unknown")}typeof i.getDefaultProps=="function"&&!i.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xr(e){{for(var i=Object.keys(e.props),l=0;l<i.length;l++){var m=i[l];if(m!=="children"&&m!=="key"){Y(e),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",m),Y(null);break}}e.ref!==null&&(Y(e),I("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}var yn={};function wn(e,i,l,m,C,j){{var y=Ht(e);if(!y){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M=pr();M?h+=M:h+=gn();var E;e===null?E="null":be(e)?E="array":e!==void 0&&e.$$typeof===r?(E="<"+(L(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,h)}var P=mr(e,i,l,C,j);if(P==null)return P;if(y){var O=i.children;if(O!==void 0)if(m)if(be(O)){for(var U=0;U<O.length;U++)hn(O[U],e);Object.freeze&&Object.freeze(O)}else I("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else hn(O,e)}if(X.call(i,"key")){var z=L(e),k=Object.keys(i).filter(function(Nr){return Nr!=="key"}),ve=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!yn[z+ve]){var jr=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";I(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,ve,z,jr,z),yn[z+ve]=!0}}return e===o?xr(P):vr(P),P}}function hr(e,i,l){return wn(e,i,l,!0)}function yr(e,i,l){return wn(e,i,l,!1)}var wr=yr,Cr=hr;J.Fragment=o,J.jsx=wr,J.jsxs=Cr}()),J}process.env.NODE_ENV==="production"?ie.exports=Dn():ie.exports=In();var a=ie.exports;const Mn=jn.extendTailwindMerge({prefix:"bn-"});function b(...n){return Mn(Cn.clsx(n))}const kn=Q.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 On({className:n,variant:r,...t}){return a.jsx("div",{className:b(kn({variant:r}),n),...t})}const Fn=Q.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"}}),je=p.forwardRef(({className:n,variant:r,size:t,asChild:o=!1,...s},d)=>{const c=o?xe.Slot:"button";return a.jsx(c,{className:b(Fn({variant:r,size:t,className:n})),ref:d,...s})});je.displayName="Button";const Ne=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...r}));Ne.displayName="Card";const Ln=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...r}));Ln.displayName="CardHeader";const Bn=p.forwardRef(({className:n,...r},t)=>a.jsx("h3",{ref:t,className:b("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...r}));Bn.displayName="CardTitle";const Vn=p.forwardRef(({className:n,...r},t)=>a.jsx("p",{ref:t,className:b("bn-text-sm bn-text-muted-foreground",n),...r}));Vn.displayName="CardDescription";const Se=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-p-6 bn-pt-0",n),...r}));Se.displayName="CardContent";const $n=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...r}));$n.displayName="CardFooter";const An=S.Root,zn=S.Trigger,Wn=S.Sub,Te=p.forwardRef(({className:n,inset:r,children:t,...o},s)=>a.jsxs(S.SubTrigger,{ref:s,className:b("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",r&&"bn-pl-8",n),...o,children:[t,a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));Te.displayName=S.SubTrigger.displayName;const Re=p.forwardRef(({className:n,...r},t)=>a.jsx(S.SubContent,{ref:t,className:b("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),...r}));Re.displayName=S.SubContent.displayName;const Ee=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(S.Content,{ref:o,sideOffset:r,className:b("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),...t}));Ee.displayName=S.Content.displayName;const _e=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Item,{ref:o,className:b("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",r&&"bn-pl-8",n),...t}));_e.displayName=S.Item.displayName;const Pe=p.forwardRef(({className:n,children:r,checked:t,...o},s)=>a.jsxs(S.CheckboxItem,{ref:s,className:b("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:t,...o,children:[a.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:a.jsx(S.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),r]}));Pe.displayName=S.CheckboxItem.displayName;const qn=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(S.RadioItem,{ref:o,className:b("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),...t,children:[a.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:a.jsx(S.ItemIndicator,{children:a.jsx(B.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),r]}));qn.displayName=S.RadioItem.displayName;const De=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Label,{ref:o,className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",r&&"bn-pl-8",n),...t}));De.displayName=S.Label.displayName;const Ie=p.forwardRef(({className:n,...r},t)=>a.jsx(S.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));Ie.displayName=S.Separator.displayName;const Yn=Q.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),le=p.forwardRef(({className:n,...r},t)=>a.jsx(he.Root,{ref:t,className:b(Yn(),n),...r}));le.displayName=he.Root.displayName;const Un=se.FormProvider,Gn=p.createContext({}),ne=()=>{const n=p.useContext(Gn),r=p.useContext(Me),{getFieldState:t,formState:o}=se.useFormContext(),s=t(n.name,o);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:d}=r;return{id:d,name:n.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...s}},Me=p.createContext({}),Kn=p.forwardRef(({className:n,...r},t)=>{const o=p.useId();return a.jsx(Me.Provider,{value:{id:o},children:a.jsx("div",{ref:t,className:b("bn-space-y-2",n),...r})})});Kn.displayName="FormItem";const Jn=p.forwardRef(({className:n,...r},t)=>{const{error:o,formItemId:s}=ne();return a.jsx(le,{ref:t,className:b(o&&"bn-text-destructive",n),htmlFor:s,...r})});Jn.displayName="FormLabel";const Hn=p.forwardRef(({...n},r)=>{const{error:t,formItemId:o,formDescriptionId:s,formMessageId:d}=ne();return a.jsx(xe.Slot,{ref:r,id:o,"aria-describedby":t?`${s} ${d}`:`${s}`,"aria-invalid":!!t,...n})});Hn.displayName="FormControl";const Xn=p.forwardRef(({className:n,...r},t)=>{const{formDescriptionId:o}=ne();return a.jsx("p",{ref:t,id:o,className:b("bn-text-sm bn-text-muted-foreground",n),...r})});Xn.displayName="FormDescription";const Zn=p.forwardRef(({className:n,children:r,...t},o)=>{const{error:s,formMessageId:d}=ne(),c=s?String(s==null?void 0:s.message):r;return c?a.jsx("p",{ref:o,id:d,className:b("bn-text-sm bn-font-medium bn-text-destructive",n),...t,children:c}):null});Zn.displayName="FormMessage";const ke=p.forwardRef(({className:n,type:r,...t},o)=>a.jsx("input",{type:r,className:b("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:o,...t}));ke.displayName="Input";const Qn=ee.Root,et=ee.Trigger,Oe=p.forwardRef(({className:n,align:r="center",sideOffset:t=4,...o},s)=>a.jsx(ee.Content,{ref:s,align:r,sideOffset:t,className:b("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),...o}));Oe.displayName=ee.Content.displayName;const nt=_.Root,tt=_.Value,Fe=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Trigger,{ref:o,className:b("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),...t,children:[r,a.jsx(_.Icon,{asChild:!0,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));Fe.displayName=_.Trigger.displayName;const Le=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollUpButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Le.displayName=_.ScrollUpButton.displayName;const Be=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollDownButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4"})}));Be.displayName=_.ScrollDownButton.displayName;const Ve=p.forwardRef(({className:n,children:r,position:t="popper",...o},s)=>a.jsxs(_.Content,{ref:s,className:b("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",t==="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:t,...o,children:[a.jsx(Le,{}),a.jsx(_.Viewport,{className:b("bn-p-1",t==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:r}),a.jsx(Be,{})]}));Ve.displayName=_.Content.displayName;const rt=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Label,{ref:t,className:b("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...r}));rt.displayName=_.Label.displayName;const $e=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Item,{ref:o,className:b("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),...t,children:[a.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:a.jsx(_.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),a.jsx(_.ItemText,{children:r})]}));$e.displayName=_.Item.displayName;const ot=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));ot.displayName=_.Separator.displayName;const at=$.Root,Ae=p.forwardRef(({className:n,...r},t)=>a.jsx($.List,{ref:t,className:b("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),...r}));Ae.displayName=$.List.displayName;const ze=p.forwardRef(({className:n,...r},t)=>a.jsx($.Trigger,{ref:t,className:b("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),...r}));ze.displayName=$.Trigger.displayName;const We=p.forwardRef(({className:n,...r},t)=>a.jsx($.Content,{ref:t,className:b("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),...r}));We.displayName=$.Content.displayName;const st=Q.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"}}),qe=p.forwardRef(({className:n,variant:r,size:t,...o},s)=>a.jsx(ye.Root,{ref:s,className:b(st({variant:r,size:t,className:n})),...o}));qe.displayName=ye.Root.displayName;const it=G.Provider,lt=G.Root,dt=G.Trigger,Ye=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(G.Content,{ref:o,sideOffset:r,className:b("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),...t}));Ye.displayName=G.Content.displayName;const ct={Badge:{Badge:On},Button:{Button:je},Card:{Card:Ne,CardContent:Se},DropdownMenu:{DropdownMenu:An,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:Wn,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Te,DropdownMenuTrigger:zn},Form:{Form:Un},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Qn,PopoverContent:Oe,PopoverTrigger:et},Select:{Select:nt,SelectContent:Ve,SelectItem:$e,SelectTrigger:Fe,SelectValue:tt},Tabs:{Tabs:at,TabsContent:We,TabsList:Ae,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:lt,TooltipContent:Ye,TooltipProvider:it,TooltipTrigger:dt}},Ue=g.createContext(void 0);function T(){return g.useContext(Ue)}const ut=n=>{const{children:r,...t}=n;w.assertEmpty(t);const o=T(),s=se.useForm();return a.jsx(o.Form.Form,{...s,children:r})},bt=g.forwardRef((n,r)=>{const{className:t,name:o,label:s,icon:d,value:c,autoFocus:x,placeholder:f,onKeyDown:u,onChange:v,onSubmit:R,...D}=n;w.assertEmpty(D);const F=T();return s?a.jsxs("div",{children:[a.jsx(F.Label.Label,{htmlFor:s,children:s}),a.jsx(F.Input.Input,{className:t,id:s,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R})]}):a.jsx(F.Input.Input,{"aria-label":o,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R,ref:r})}),ft=n=>g.forwardRef((r,t)=>a.jsx(n,{onPointerDown:o=>{o.nativeEvent.fakeEvent||(o.ctrlKey=!0)},onPointerUp:o=>{const s=new PointerEvent("pointerdown",o.nativeEvent);s.fakeEvent=!0,o.target.dispatchEvent(s)},...r,ref:t})),mt=n=>{const{children:r,onOpenChange:t,position:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:t,children:r}):a.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:t,children:r})},pt=n=>{const{children:r,sub:t,...o}=n;w.assertEmpty(o);const s=T(),d=g.useMemo(()=>ft(s.DropdownMenu.DropdownMenuTrigger),[s.DropdownMenu.DropdownMenuTrigger]);return t?a.jsx(s.DropdownMenu.DropdownMenuSubTrigger,{children:r}):a.jsx(d,{asChild:!0,...o,children:r})},gt=g.forwardRef((n,r)=>{const{className:t,children:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:t,ref:r,children:o}):a.jsx(c.DropdownMenu.DropdownMenuContent,{className:t,ref:r,children:o})}),vt=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,checked:d,subTrigger:c,onClick:x,...f}=n;w.assertEmpty(f);const u=T();return c?a.jsxs(a.Fragment,{children:[s,o]}):d!==void 0?a.jsxs(u.DropdownMenu.DropdownMenuCheckboxItem,{className:b(t,"bn-gap-1"),ref:r,checked:d,onClick:x,...f,children:[s,o]}):a.jsxs(u.DropdownMenu.DropdownMenuItem,{className:t,ref:r,onClick:x,...f,children:[s,o,c&&a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),xt=g.forwardRef((n,r)=>{const{className:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.DropdownMenu.DropdownMenuSeparator,{className:t,ref:r})}),ht=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.DropdownMenu.DropdownMenuLabel,{className:t,ref:r,children:o})}),yt=g.forwardRef((n,r)=>{const{className:t,tabs:o,defaultOpenTab:s,openTab:d,setOpenTab:c,loading:x,...f}=n;w.assertEmpty(f);const u=T();return a.jsxs(u.Tabs.Tabs,{className:b(t,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:r,value:d,defaultValue:s,onValueChange:c,children:[a.jsx(u.Tabs.TabsList,{children:o.map(v=>a.jsx(u.Tabs.TabsTrigger,{value:v.name,children:v.name},v.name))}),o.map(v=>a.jsx(u.Tabs.TabsContent,{value:v.name,children:a.jsx(u.Card.Card,{children:a.jsx(u.Card.CardContent,{className:"bn-p-4",children:v.tabPanel})})},v.name))]})}),wt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b(t,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:r,children:o})}),Ct=g.forwardRef((n,r)=>{const{className:t,value:o,placeholder:s,onKeyDown:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{"data-test":"embed-input",className:b(t,"bn-w-80"),ref:r,value:o,placeholder:s,onKeyDown:d,onChange:c})}),jt=n=>{const{children:r,opened:t,position:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.Popover.Popover,{open:t,children:r})},Nt=g.forwardRef((n,r)=>{const{children:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.Popover.PopoverTrigger,{ref:r,asChild:!0,children:t})}),St=g.forwardRef((n,r)=>{const{className:t,variant:o,children:s,...d}=n;w.assertEmpty(d);const c=T();return a.jsx(c.Popover.PopoverContent,{sideOffset:8,className:b(t,"bn-flex bn-flex-col bn-gap-2",o==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:r,children:s})}),Tt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s,!1),a.jsx("div",{className:t,ref:r,...s,children:o})}),Rt=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,onClick:d,onDragEnd:c,onDragStart:x,draggable:f,label:u,...v}=n;w.assertEmpty(v,!1);const R=T();return a.jsxs(R.Button.Button,{variant:"ghost",className:b(t,"bn-text-gray-400"),ref:r,"aria-label":u,onClick:d,onDragStart:x,onDragEnd:c,draggable:f,...v,children:[s,o]})}),Et=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,columns:d,...c}=n;return w.assertEmpty(c),a.jsx("div",{className:t,style:{gridTemplateColumns:`repeat(${d}, 1fr)`},ref:r,id:s,role:"grid",children:o})}),_t=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),Pt=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{id:s,role:"listbox",className:b("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",t),ref:r,children:o})}),Dt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("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),ref:r,children:a.jsx("div",{children:o})})}),It=g.forwardRef((n,r)=>{const t=T(),{className:o,item:s,isSelected:d,onClick:c,id:x,...f}=n;w.assertEmpty(f);const u=g.useRef(null);return g.useEffect(()=>{if(!u.current||!d)return;const v=W.elementOverflow(u.current,document.querySelector(".bn-suggestion-menu"));v==="top"?u.current.scrollIntoView(!0):v==="bottom"&&u.current.scrollIntoView(!1)},[d]),a.jsxs("div",{className:b("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",o),ref:W.mergeRefs([r,u]),id:x,onClick:c,role:"option","aria-selected":d||void 0,children:[s.icon&&a.jsx("div",{className:"bn-p-3","data-position":"left",children:s.icon}),a.jsxs("div",{className:"bn-flex-1",children:[a.jsx("div",{className:"bn-text-base",children:s.title}),a.jsx("div",{className:"bn-text-xs",children:s.subtext})]}),s.badge&&a.jsx("div",{"data-position":"right",className:"bn-text-xs",children:a.jsx(t.Badge.Badge,{variant:"secondary",children:s.badge})})]})}),Mt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t),ref:r,children:o})}),kt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:t,ref:r,children:o})}),Ot=g.forwardRef((n,r)=>{const{className:t,children:o,draggable:s,onDragStart:d,onDragEnd:c,style:x,label:f,...u}=n;w.assertEmpty(u,!1);const v=T();return a.jsx(v.Button.Button,{variant:"ghost",className:b(t,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:r,"aria-label":f,draggable:s,onDragStart:d,onDragEnd:c,style:x,...u,children:o})}),Ge=g.forwardRef((n,r)=>{const{className:t,children:o,onMouseEnter:s,onMouseLeave:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Tooltip.TooltipProvider,{delayDuration:0,children:a.jsx("div",{className:b(t,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md"),ref:r,onMouseEnter:s,onMouseLeave:d,children:o})})}),Ke=g.forwardRef((n,r)=>{const{className:t,children:o,mainTooltip:s,secondaryTooltip:d,icon:c,isSelected:x,isDisabled:f,onClick:u,label:v,...R}=n;w.assertEmpty(R,!1);const D=T(),F=x===void 0?a.jsxs(D.Button.Button,{className:t,variant:"ghost",disabled:f,onClick:u,ref:r,"aria-label":v,...R,children:[c,o]}):a.jsxs(D.Toggle.Toggle,{className:b(t,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":v,onClick:u,pressed:x,disabled:f,"data-state":x?"on":"off","data-disabled":f,ref:r,...R,children:[c,o]});return a.jsxs(D.Tooltip.Tooltip,{children:[a.jsx(D.Tooltip.TooltipTrigger,{asChild:!0,children:F}),a.jsxs(D.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[a.jsx("span",{children:s}),d&&a.jsx("span",{children:d})]})]})}),Ft=g.forwardRef((n,r)=>{const{className:t,items:o,isDisabled:s,...d}=n;w.assertEmpty(d);const c=T(),x=u=>a.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[u.icon,u.text]}),f=o.filter(u=>u.isSelected)[0];return f?a.jsxs(c.Select.Select,{value:f.text,onValueChange:u=>{var v,R;return(R=(v=o.find(D=>D.text===u)).onClick)==null?void 0:R.call(v)},disabled:s,children:[a.jsx(c.Select.SelectTrigger,{className:"bn-border-none",children:a.jsx(c.Select.SelectValue,{})}),a.jsx(c.Select.SelectContent,{className:t,ref:r,children:o.map(u=>a.jsx(c.Select.SelectItem,{disabled:u.isDisabled,value:u.text,children:a.jsx(x,{...u})},u.text))})]}):null}),Lt=g.forwardRef((n,r)=>{const{className:t,children:o,onClick:s,label:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Button.Button,{type:"submit",className:t,"aria-label":d,ref:r,onClick:s,children:o})}),Bt=g.forwardRef((n,r)=>{const{className:t,accept:o,value:s,placeholder:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{type:"file",className:t,ref:r,accept:o,value:s?s.name:void 0,onChange:async u=>c==null?void 0:c(u.target.files[0]),placeholder:d})}),Vt=g.forwardRef((n,r)=>{const{className:t,isSelected:o,onClick:s,item:d,id:c,...x}=n;w.assertEmpty(x);const f=g.useRef(null);return g.useEffect(()=>{if(!f.current||!o)return;const u=W.elementOverflow(f.current,document.querySelector(".bn-grid-suggestion-menu"));u==="top"?f.current.scrollIntoView(!0):u==="bottom"&&f.current.scrollIntoView(!1)},[o]),a.jsx("div",{className:t,ref:W.mergeRefs([r,f]),id:c,role:"option",onClick:s,"aria-selected":o||void 0,children:d.icon})}),$t=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),Je={FormattingToolbar:{Root:Ge,Button:Ke,Select:Ft},FilePanel:{Root:yt,Button:Lt,FileInput:Bt,TabPanel:wt,TextInput:Ct},LinkToolbar:{Root:Ge,Button:Ke},SideMenu:{Root:Tt,Button:Rt},SuggestionMenu:{Root:Pt,Item:It,EmptyItem:Dt,Label:Mt,Loader:kt},GridSuggestionMenu:{Root:Et,Item:Vt,EmptyItem:_t,Loader:$t},TableHandle:{Root:Ot},Generic:{Form:{Root:ut,TextInput:bt},Menu:{Root:mt,Trigger:pt,Dropdown:gt,Divider:xt,Label:ht,Item:vt},Popover:{Root:jt,Trigger:Nt,Content:St}}},At=n=>{const{className:r,shadCNComponents:t,...o}=n,s=g.useMemo(()=>({...ct,...t}),[t]);return a.jsx(Ue.Provider,{value:s,children:a.jsx(W.ComponentsContext.Provider,{value:Je,children:a.jsx(W.BlockNoteViewRaw,{className:w.mergeCSSClasses("bn-shadcn",r||""),...o})})})};N.BlockNoteView=At,N.components=Je,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("@blocknote/core"),require("@blocknote/react"),require("react"),require("react-hook-form"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-slot"),require("@radix-ui/react-dropdown-menu"),require("lucide-react"),require("@radix-ui/react-label"),require("@radix-ui/react-popover"),require("@radix-ui/react-select"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tooltip")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@blocknote/core","@blocknote/react","react","react-hook-form","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-slot","@radix-ui/react-dropdown-menu","lucide-react","@radix-ui/react-label","@radix-ui/react-popover","@radix-ui/react-select","@radix-ui/react-tabs","@radix-ui/react-toggle","@radix-ui/react-tooltip"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m["blocknote-shadcn"]={},m.jsxRuntime,m.core,m.react,m.React,m.reactHookForm,m.classVarianceAuthority,m.clsx,m.tailwindMerge,m.reactSlot,m.DropdownMenuPrimitive,m.lucideReact,m.LabelPrimitive,m.PopoverPrimitive,m.SelectPrimitive,m.TabsPrimitive,m.TogglePrimitive,m.TooltipPrimitive))})(this,function(m,o,p,T,c,k,I,be,le,B,ce,N,pe,fe,ue,me,ge,he){"use strict";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 r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const l=C(c),v=C(ce),L=C(pe),P=C(fe),w=C(ue),S=C(me),z=C(ge),M=C(he),ve=le.extendTailwindMerge({prefix:"bn-"});function i(...n){return ve(be.clsx(n))}const we=I.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 xe({className:n,variant:t,...e}){return o.jsx("div",{className:i(we({variant:t}),n),...e})}const ye=I.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"}}),j=l.forwardRef(({className:n,variant:t,size:e,asChild:r=!1,...a},s)=>{const d=r?B.Slot:"button";return o.jsx(d,{className:i(ye({variant:t,size:e,className:n})),ref:s,...a})});j.displayName="Button";const V=l.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:i("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...t}));V.displayName="Card";const Ne=l.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:i("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...t}));Ne.displayName="CardHeader";const Ce=l.forwardRef(({className:n,...t},e)=>o.jsx("h3",{ref:e,className:i("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...t}));Ce.displayName="CardTitle";const Se=l.forwardRef(({className:n,...t},e)=>o.jsx("p",{ref:e,className:i("bn-text-sm bn-text-muted-foreground",n),...t}));Se.displayName="CardDescription";const q=l.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:i("bn-p-6 bn-pt-0",n),...t}));q.displayName="CardContent";const Te=l.forwardRef(({className:n,...t},e)=>o.jsx("div",{ref:e,className:i("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...t}));Te.displayName="CardFooter";const Me=v.Root,De=v.Trigger,Ie=v.Sub,_=l.forwardRef(({className:n,inset:t,children:e,...r},a)=>o.jsxs(v.SubTrigger,{ref:a,className:i("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),...r,children:[e,o.jsx(N.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));_.displayName=v.SubTrigger.displayName;const $=l.forwardRef(({className:n,...t},e)=>o.jsx(v.SubContent,{ref:e,className:i("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}));$.displayName=v.SubContent.displayName;const O=l.forwardRef(({className:n,sideOffset:t=4,...e},r)=>o.jsx(v.Content,{ref:r,sideOffset:t,className:i("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}));O.displayName=v.Content.displayName;const G=l.forwardRef(({className:n,inset:t,...e},r)=>o.jsx(v.Item,{ref:r,className:i("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}));G.displayName=v.Item.displayName;const U=l.forwardRef(({className:n,children:t,checked:e,...r},a)=>o.jsxs(v.CheckboxItem,{ref:a,className:i("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,...r,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(N.Check,{className:"bn-h-4 bn-w-4"})})}),t]}));U.displayName=v.CheckboxItem.displayName;const Pe=l.forwardRef(({className:n,children:t,...e},r)=>o.jsxs(v.RadioItem,{ref:r,className:i("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(v.ItemIndicator,{children:o.jsx(N.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),t]}));Pe.displayName=v.RadioItem.displayName;const H=l.forwardRef(({className:n,inset:t,...e},r)=>o.jsx(v.Label,{ref:r,className:i("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t&&"bn-pl-8",n),...e}));H.displayName=v.Label.displayName;const K=l.forwardRef(({className:n,...t},e)=>o.jsx(v.Separator,{ref:e,className:i("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));K.displayName=v.Separator.displayName;const Ee=I.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),F=l.forwardRef(({className:n,...t},e)=>o.jsx(L.Root,{ref:e,className:i(Ee(),n),...t}));F.displayName=L.Root.displayName;const ke=k.FormProvider,Fe=l.createContext({}),E=()=>{const n=l.useContext(Fe),t=l.useContext(W),{getFieldState:e,formState:r}=k.useFormContext(),a=e(n.name,r);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:n.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...a}},W=l.createContext({}),Be=l.forwardRef(({className:n,...t},e)=>{const r=l.useId();return o.jsx(W.Provider,{value:{id:r},children:o.jsx("div",{ref:e,className:i("bn-space-y-2",n),...t})})});Be.displayName="FormItem";const Le=l.forwardRef(({className:n,...t},e)=>{const{error:r,formItemId:a}=E();return o.jsx(F,{ref:e,className:i(r&&"bn-text-destructive",n),htmlFor:a,...t})});Le.displayName="FormLabel";const ze=l.forwardRef(({...n},t)=>{const{error:e,formItemId:r,formDescriptionId:a,formMessageId:s}=E();return o.jsx(B.Slot,{ref:t,id:r,"aria-describedby":e?`${a} ${s}`:`${a}`,"aria-invalid":!!e,...n})});ze.displayName="FormControl";const je=l.forwardRef(({className:n,...t},e)=>{const{formDescriptionId:r}=E();return o.jsx("p",{ref:e,id:r,className:i("bn-text-sm bn-text-muted-foreground",n),...t})});je.displayName="FormDescription";const Ve=l.forwardRef(({className:n,children:t,...e},r)=>{const{error:a,formMessageId:s}=E(),d=a?String(a==null?void 0:a.message):t;return d?o.jsx("p",{ref:r,id:s,className:i("bn-text-sm bn-font-medium bn-text-destructive",n),...e,children:d}):null});Ve.displayName="FormMessage";const J=l.forwardRef(({className:n,type:t,...e},r)=>o.jsx("input",{type:t,className:i("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:r,...e}));J.displayName="Input";const qe=P.Root,_e=P.Trigger,Q=l.forwardRef(({className:n,align:t="center",sideOffset:e=4,...r},a)=>o.jsx(P.Content,{ref:a,align:t,sideOffset:e,className:i("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),...r}));Q.displayName=P.Content.displayName;const $e=w.Root,Oe=w.Value,X=l.forwardRef(({className:n,children:t,...e},r)=>o.jsxs(w.Trigger,{ref:r,className:i("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(w.Icon,{asChild:!0,children:o.jsx(N.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));X.displayName=w.Trigger.displayName;const Y=l.forwardRef(({className:n,...t},e)=>o.jsx(w.ScrollUpButton,{ref:e,className:i("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(N.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Y.displayName=w.ScrollUpButton.displayName;const Z=l.forwardRef(({className:n,...t},e)=>o.jsx(w.ScrollDownButton,{ref:e,className:i("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...t,children:o.jsx(N.ChevronDown,{className:"bn-h-4 bn-w-4"})}));Z.displayName=w.ScrollDownButton.displayName;const A=l.forwardRef(({className:n,children:t,position:e="popper",...r},a)=>o.jsxs(w.Content,{ref:a,className:i("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,...r,children:[o.jsx(Y,{}),o.jsx(w.Viewport,{className:i("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(Z,{})]}));A.displayName=w.Content.displayName;const Ge=l.forwardRef(({className:n,...t},e)=>o.jsx(w.Label,{ref:e,className:i("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...t}));Ge.displayName=w.Label.displayName;const R=l.forwardRef(({className:n,children:t,...e},r)=>o.jsxs(w.Item,{ref:r,className:i("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(w.ItemIndicator,{children:o.jsx(N.Check,{className:"bn-h-4 bn-w-4"})})}),o.jsx(w.ItemText,{children:t})]}));R.displayName=w.Item.displayName;const Ue=l.forwardRef(({className:n,...t},e)=>o.jsx(w.Separator,{ref:e,className:i("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...t}));Ue.displayName=w.Separator.displayName;const He=S.Root,ee=l.forwardRef(({className:n,...t},e)=>o.jsx(S.List,{ref:e,className:i("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}));ee.displayName=S.List.displayName;const ne=l.forwardRef(({className:n,...t},e)=>o.jsx(S.Trigger,{ref:e,className:i("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}));ne.displayName=S.Trigger.displayName;const te=l.forwardRef(({className:n,...t},e)=>o.jsx(S.Content,{ref:e,className:i("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}));te.displayName=S.Content.displayName;const Ke=I.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"}}),oe=l.forwardRef(({className:n,variant:t,size:e,...r},a)=>o.jsx(z.Root,{ref:a,className:i(Ke({variant:t,size:e,className:n})),...r}));oe.displayName=z.Root.displayName;const We=M.Provider,Je=M.Root,Qe=M.Trigger,re=l.forwardRef(({className:n,sideOffset:t=4,...e},r)=>o.jsx(M.Content,{ref:r,sideOffset:t,className:i("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}));re.displayName=M.Content.displayName;const Xe={Badge:{Badge:xe},Button:{Button:j},Card:{Card:V,CardContent:q},DropdownMenu:{DropdownMenu:Me,DropdownMenuCheckboxItem:U,DropdownMenuContent:O,DropdownMenuItem:G,DropdownMenuLabel:H,DropdownMenuSeparator:K,DropdownMenuSub:Ie,DropdownMenuSubContent:$,DropdownMenuSubTrigger:_,DropdownMenuTrigger:De},Form:{Form:ke},Input:{Input:J},Label:{Label:F},Popover:{Popover:qe,PopoverContent:Q,PopoverTrigger:_e},Select:{Select:$e,SelectContent:A,SelectItem:R,SelectTrigger:X,SelectValue:Oe},Tabs:{Tabs:He,TabsContent:te,TabsList:ee,TabsTrigger:ne},Toggle:{Toggle:oe},Tooltip:{Tooltip:Je,TooltipContent:re,TooltipProvider:We,TooltipTrigger:Qe}},ae=c.createContext(void 0);function h(){return c.useContext(ae)}const Ye=n=>{const{children:t,...e}=n;p.assertEmpty(e);const r=h(),a=k.useForm();return o.jsx(r.Form.Form,{...a,children:t})},Ze=c.forwardRef((n,t)=>{const{className:e,name:r,label:a,icon:s,value:d,autoFocus:u,placeholder:f,onKeyDown:b,onChange:g,onSubmit:x,...y}=n;p.assertEmpty(y);const D=h();return a?o.jsxs("div",{children:[o.jsx(D.Label.Label,{htmlFor:a,children:a}),o.jsx(D.Input.Input,{className:e,id:a,name:r,autoFocus:u,placeholder:f,value:d,onKeyDown:b,onChange:g,onSubmit:x})]}):o.jsx(D.Input.Input,{"aria-label":r,name:r,autoFocus:u,placeholder:f,value:d,onKeyDown:b,onChange:g,onSubmit:x,ref:t})}),Ae=n=>c.forwardRef((t,e)=>o.jsx(n,{onPointerDown:r=>{r.nativeEvent.fakeEvent||(r.ctrlKey=!0)},onPointerUp:r=>{const a=new PointerEvent("pointerdown",r.nativeEvent);a.fakeEvent=!0,r.target.dispatchEvent(a)},...t,ref:e})),Re=n=>{const{children:t,onOpenChange:e,position:r,sub:a,...s}=n;p.assertEmpty(s);const d=h();return a?o.jsx(d.DropdownMenu.DropdownMenuSub,{onOpenChange:e,children:t}):o.jsx(d.DropdownMenu.DropdownMenu,{onOpenChange:e,children:t})},en=n=>{const{children:t,sub:e,...r}=n;p.assertEmpty(r);const a=h(),s=c.useMemo(()=>Ae(a.DropdownMenu.DropdownMenuTrigger),[a.DropdownMenu.DropdownMenuTrigger]);return e?o.jsx(a.DropdownMenu.DropdownMenuSubTrigger,{children:t}):o.jsx(s,{asChild:!0,...r,children:t})},nn=c.forwardRef((n,t)=>{const{className:e,children:r,sub:a,...s}=n;p.assertEmpty(s);const d=h();return a?o.jsx(d.DropdownMenu.DropdownMenuSubContent,{className:e,ref:t,children:r}):o.jsx(d.DropdownMenu.DropdownMenuContent,{className:e,ref:t,children:r})}),tn=c.forwardRef((n,t)=>{const{className:e,children:r,icon:a,checked:s,subTrigger:d,onClick:u,...f}=n;p.assertEmpty(f);const b=h();return d?o.jsxs(o.Fragment,{children:[a,r]}):s!==void 0?o.jsxs(b.DropdownMenu.DropdownMenuCheckboxItem,{className:i(e,"bn-gap-1"),ref:t,checked:s,onClick:u,...f,children:[a,r]}):o.jsxs(b.DropdownMenu.DropdownMenuItem,{className:e,ref:t,onClick:u,...f,children:[a,r,d&&o.jsx(N.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),on=c.forwardRef((n,t)=>{const{className:e,...r}=n;p.assertEmpty(r);const a=h();return o.jsx(a.DropdownMenu.DropdownMenuSeparator,{className:e,ref:t})}),rn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;p.assertEmpty(a);const s=h();return o.jsx(s.DropdownMenu.DropdownMenuLabel,{className:e,ref:t,children:r})}),an=c.forwardRef((n,t)=>{const{className:e,tabs:r,defaultOpenTab:a,openTab:s,setOpenTab:d,loading:u,...f}=n;p.assertEmpty(f);const b=h();return o.jsxs(b.Tabs.Tabs,{className:i(e,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:t,value:s,defaultValue:a,onValueChange:d,children:[o.jsx(b.Tabs.TabsList,{children:r.map(g=>o.jsx(b.Tabs.TabsTrigger,{value:g.name,children:g.name},g.name))}),r.map(g=>o.jsx(b.Tabs.TabsContent,{value:g.name,children:o.jsx(b.Card.Card,{children:o.jsx(b.Card.CardContent,{className:"bn-p-4",children:g.tabPanel})})},g.name))]})}),sn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;return p.assertEmpty(a),o.jsx("div",{className:i(e,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:t,children:r})}),dn=c.forwardRef((n,t)=>{const{className:e,value:r,placeholder:a,onKeyDown:s,onChange:d,...u}=n;p.assertEmpty(u);const f=h();return o.jsx(f.Input.Input,{"data-test":"embed-input",className:i(e,"bn-w-80"),ref:t,value:r,placeholder:a,onKeyDown:s,onChange:d})}),bn=n=>{const{children:t,opened:e,position:r,...a}=n;p.assertEmpty(a);const s=h();return o.jsx(s.Popover.Popover,{open:e,children:t})},ln=c.forwardRef((n,t)=>{const{children:e,...r}=n;p.assertEmpty(r);const a=h();return o.jsx(a.Popover.PopoverTrigger,{ref:t,asChild:!0,children:e})}),cn=c.forwardRef((n,t)=>{const{className:e,variant:r,children:a,...s}=n;p.assertEmpty(s);const d=h();return o.jsx(d.Popover.PopoverContent,{sideOffset:8,className:i(e,"bn-flex bn-flex-col bn-gap-2",r==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:t,children:a})}),pn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;return p.assertEmpty(a,!1),o.jsx("div",{className:e,ref:t,...a,children:r})}),fn=c.forwardRef((n,t)=>{const{className:e,children:r,icon:a,onClick:s,onDragEnd:d,onDragStart:u,draggable:f,label:b,...g}=n;p.assertEmpty(g,!1);const x=h();return o.jsxs(x.Button.Button,{variant:"ghost",className:i(e,"bn-text-gray-400"),ref:t,"aria-label":b,onClick:s,onDragStart:u,onDragEnd:d,draggable:f,...g,children:[a,r]})}),un=c.forwardRef((n,t)=>{const{className:e,children:r,id:a,columns:s,...d}=n;return p.assertEmpty(d),o.jsx("div",{className:e,style:{gridTemplateColumns:`repeat(${s}, 1fr)`},ref:t,id:a,role:"grid",children:r})}),mn=c.forwardRef((n,t)=>{const{className:e,children:r,columns:a,...s}=n;return p.assertEmpty(s),o.jsx("div",{className:e,style:{gridColumn:`1 / ${a+1}`},ref:t,children:r})}),gn=c.forwardRef((n,t)=>{const{className:e,children:r,id:a,...s}=n;return p.assertEmpty(s),o.jsx("div",{id:a,role:"listbox",className:i("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:r})}),hn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;return p.assertEmpty(a),o.jsx("div",{className:i("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:r})})}),vn=c.forwardRef((n,t)=>{const e=h(),{className:r,item:a,isSelected:s,onClick:d,id:u,...f}=n;p.assertEmpty(f);const b=c.useRef(null);return c.useEffect(()=>{if(!b.current||!s)return;const g=T.elementOverflow(b.current,document.querySelector(".bn-suggestion-menu"));g==="top"?b.current.scrollIntoView(!0):g==="bottom"&&b.current.scrollIntoView(!1)},[s]),o.jsxs("div",{className:i("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",r),ref:T.mergeRefs([t,b]),id:u,onClick:d,role:"option","aria-selected":s||void 0,children:[a.icon&&o.jsx("div",{className:"bn-p-3","data-position":"left",children:a.icon}),o.jsxs("div",{className:"bn-flex-1",children:[o.jsx("div",{className:"bn-text-base",children:a.title}),o.jsx("div",{className:"bn-text-xs",children:a.subtext})]}),a.badge&&o.jsx("div",{"data-position":"right",className:"bn-text-xs",children:o.jsx(e.Badge.Badge,{variant:"secondary",children:a.badge})})]})}),wn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;return p.assertEmpty(a),o.jsx("div",{className:i("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",e),ref:t,children:r})}),xn=c.forwardRef((n,t)=>{const{className:e,children:r,...a}=n;return p.assertEmpty(a),o.jsx("div",{className:e,ref:t,children:r})}),yn=c.forwardRef((n,t)=>{const{className:e,children:r,draggable:a,onDragStart:s,onDragEnd:d,style:u,label:f,...b}=n;p.assertEmpty(b,!1);const g=h();return o.jsx(g.Button.Button,{variant:"ghost",className:i(e,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:t,"aria-label":f,draggable:a,onDragStart:s,onDragEnd:d,style:u,...b,children:r})}),Nn=c.forwardRef((n,t)=>{const{className:e,children:r,onMouseDown:a,onClick:s,...d}=n;p.assertEmpty(d,!1);const u=h();return o.jsx(u.Button.Button,{variant:"ghost",className:i(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:s,onMouseDown:a,...d,children:r})}),se=c.forwardRef((n,t)=>{const{className:e,children:r,onMouseEnter:a,onMouseLeave:s,...d}=n;p.assertEmpty(d);const u=h();return o.jsx(u.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:i(e,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md"),ref:t,onMouseEnter:a,onMouseLeave:s,children:r})})}),de=c.forwardRef((n,t)=>{const{className:e,children:r,mainTooltip:a,secondaryTooltip:s,icon:d,isSelected:u,isDisabled:f,onClick:b,label:g,...x}=n;p.assertEmpty(x,!1);const y=h(),D=u===void 0?o.jsxs(y.Button.Button,{className:e,variant:"ghost",disabled:f,onClick:b,ref:t,"aria-label":g,...x,children:[d,r]}):o.jsxs(y.Toggle.Toggle,{className:i(e,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":g,onClick:b,pressed:u,disabled:f,"data-state":u?"on":"off","data-disabled":f,ref:t,...x,children:[d,r]});return o.jsxs(y.Tooltip.Tooltip,{children:[o.jsx(y.Tooltip.TooltipTrigger,{asChild:!0,children:D}),o.jsxs(y.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[o.jsx("span",{children:a}),s&&o.jsx("span",{children:s})]})]})}),Cn=c.forwardRef((n,t)=>{const{className:e,items:r,isDisabled:a,...s}=n;p.assertEmpty(s);const d=h(),u=b=>o.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[b.icon,b.text]}),f=r.filter(b=>b.isSelected)[0];return f?o.jsxs(d.Select.Select,{value:f.text,onValueChange:b=>{var g,x;return(x=(g=r.find(y=>y.text===b)).onClick)==null?void 0:x.call(g)},disabled:a,children:[o.jsx(d.Select.SelectTrigger,{className:"bn-border-none",children:o.jsx(d.Select.SelectValue,{})}),o.jsx(d.Select.SelectContent,{className:e,ref:t,children:r.map(b=>o.jsx(d.Select.SelectItem,{disabled:b.isDisabled,value:b.text,children:o.jsx(u,{...b})},b.text))})]}):null}),Sn=c.forwardRef((n,t)=>{const{className:e,children:r,onClick:a,label:s,...d}=n;p.assertEmpty(d);const u=h();return o.jsx(u.Button.Button,{type:"submit",className:e,"aria-label":s,ref:t,onClick:a,children:r})}),Tn=c.forwardRef((n,t)=>{const{className:e,accept:r,value:a,placeholder:s,onChange:d,...u}=n;p.assertEmpty(u);const f=h();return o.jsx(f.Input.Input,{type:"file",className:e,ref:t,accept:r,value:a?a.name:void 0,onChange:async b=>d==null?void 0:d(b.target.files[0]),placeholder:s})}),Mn=c.forwardRef((n,t)=>{const{className:e,isSelected:r,onClick:a,item:s,id:d,...u}=n;p.assertEmpty(u);const f=c.useRef(null);return c.useEffect(()=>{if(!f.current||!r)return;const b=T.elementOverflow(f.current,document.querySelector(".bn-grid-suggestion-menu"));b==="top"?f.current.scrollIntoView(!0):b==="bottom"&&f.current.scrollIntoView(!1)},[r]),o.jsx("div",{className:e,ref:T.mergeRefs([t,f]),id:d,role:"option",onClick:a,"aria-selected":r||void 0,children:s.icon})}),Dn=c.forwardRef((n,t)=>{const{className:e,children:r,columns:a,...s}=n;return p.assertEmpty(s),o.jsx("div",{className:e,style:{gridColumn:`1 / ${a+1}`},ref:t,children:r})}),ie={FormattingToolbar:{Root:se,Button:de,Select:Cn},FilePanel:{Root:an,Button:Sn,FileInput:Tn,TabPanel:sn,TextInput:dn},LinkToolbar:{Root:se,Button:de},SideMenu:{Root:pn,Button:fn},SuggestionMenu:{Root:gn,Item:vn,EmptyItem:hn,Label:wn,Loader:xn},GridSuggestionMenu:{Root:un,Item:Mn,EmptyItem:mn,Loader:Dn},TableHandle:{Root:yn,ExtendButton:Nn},Generic:{Form:{Root:Ye,TextInput:Ze},Menu:{Root:Re,Trigger:en,Dropdown:nn,Divider:on,Label:rn,Item:tn},Popover:{Root:bn,Trigger:ln,Content:cn}}},In=n=>{const{className:t,shadCNComponents:e,...r}=n,a=c.useMemo(()=>({...Xe,...e}),[e]);return o.jsx(ae.Provider,{value:a,children:o.jsx(T.ComponentsContext.Provider,{value:ie,children:o.jsx(T.BlockNoteViewRaw,{className:p.mergeCSSClasses("bn-shadcn",t||""),...r})})})};m.BlockNoteView=In,m.components=ie,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
31
2
|
//# sourceMappingURL=blocknote-shadcn.umd.cjs.map
|