UNPKG

@searchwithaura/react-mention-textarea

Version:

A powerful React component for @ mentions with multi-layer navigation, search functionality, and custom action cards

32 lines (31 loc) 20.2 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");var Q={exports:{}},Y={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var re;function fe(){if(re)return Y;re=1;var a=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(t,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var i in l)i!=="key"&&(c[i]=l[i])}else c=l;return l=c.ref,{$$typeof:a,type:t,key:u,ref:l!==void 0?l:null,props:c}}return Y.Fragment=r,Y.jsx=n,Y.jsxs=n,Y}var F={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var te;function be(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case h:return"Suspense";case v:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case E:return"Portal";case L:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case d:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return o=e.displayName||null,o!==null?o:a(e.type)||"Memo";case A:o=e._payload,e=e._init;try{return a(e(o))}catch{}}return null}function r(e){return""+e}function n(e){try{r(e);var o=!1}catch{o=!0}if(o){o=console;var m=o.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return m.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),r(e)}}function t(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===A)return"<...>";try{var o=a(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function l(){var e=$.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function u(e){if(D.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function i(e,o){function m(){W||(W=!0,console.error("%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://react.dev/link/special-props)",o))}m.isReactWarning=!0,Object.defineProperty(e,"key",{get:m,configurable:!0})}function f(){var e=a(this.type);return U[e]||(U[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function k(e,o,m,S,_,R,G,B){return m=R.ref,e={$$typeof:b,type:e,key:o,props:R,_owner:_},(m!==void 0?m:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:f}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,o,m,S,_,R,G,B){var T=o.children;if(T!==void 0)if(S)if(J(T)){for(S=0;S<T.length;S++)g(T[S]);Object.freeze&&Object.freeze(T)}else console.error("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 g(T);if(D.call(o,"key")){T=a(e);var O=Object.keys(o).filter(function(ge){return ge!=="key"});S=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",w[T+S]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,S,T,O,T),w[T+S]=!0)}if(T=null,m!==void 0&&(n(m),T=""+m),u(o)&&(n(o.key),T=""+o.key),"key"in o){m={};for(var X in o)X!=="key"&&(m[X]=o[X])}else m=o;return T&&i(m,typeof e=="function"?e.displayName||e.name||"Unknown":e),k(e,T,R,_,l(),m,G,B)}function g(e){typeof e=="object"&&e!==null&&e.$$typeof===b&&e._store&&(e._store.validated=1)}var x=y,b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),L=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),$=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,J=Array.isArray,M=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(e){return e()}};var W,U={},q=x["react-stack-bottom-frame"].bind(x,c)(),H=M(t(c)),w={};F.Fragment=p,F.jsx=function(e,o,m,S,_){var R=1e4>$.recentlyCreatedOwnerStacks++;return P(e,o,m,!1,S,_,R?Error("react-stack-top-frame"):q,R?M(t(e)):H)},F.jsxs=function(e,o,m,S,_){var R=1e4>$.recentlyCreatedOwnerStacks++;return P(e,o,m,!0,S,_,R?Error("react-stack-top-frame"):q,R?M(t(e)):H)}}()),F}var ae;function he(){return ae||(ae=1,process.env.NODE_ENV==="production"?Q.exports=fe():Q.exports=be()),Q.exports}var s=he();const ne=(a,r)=>{const n=document.createElement("div"),t=getComputedStyle(a);["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach(f=>{n.style[f]=t[f]}),n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.whiteSpace="pre-wrap",n.style.wordWrap="break-word";const c=a.value.substring(0,r);n.textContent=c;const u=document.createElement("span");u.textContent=a.value.substring(r)||".",n.appendChild(u),document.body.appendChild(n);const i={top:u.offsetTop+parseInt(t.borderTopWidth),left:u.offsetLeft+parseInt(t.borderLeftWidth),height:parseInt(t.lineHeight)};return document.body.removeChild(n),i},oe=(a,r,n)=>{const t=a.substring(0,r);for(const l of n){const c=t.lastIndexOf(l);if(c!==-1){const u=t.substring(c+1);if(!u.includes(" ")&&!u.includes(` `))return{trigger:l,position:c,query:u}}}return null},Z=(a,r,n=10)=>{if(!r.trim())return a.slice(0,n);const t=r.toLowerCase(),l=a.filter(c=>c.label.toLowerCase().includes(t)||c.description?.toLowerCase().includes(t));return l.sort((c,u)=>{const i=c.label.toLowerCase(),f=u.label.toLowerCase();return i===t?-1:f===t?1:i.startsWith(t)&&!f.startsWith(t)?-1:f.startsWith(t)&&!i.startsWith(t)?1:0}),l.slice(0,n)},K=(a,r,n,t)=>{const l=a.substring(0,n),c=a.substring(t),u=l+r+" "+c,i=n+r.length+1;return{newText:u,newCursorPosition:i}},me=(a,r)=>{let n;return(...t)=>{clearTimeout(n),n=setTimeout(()=>a(...t),r)}},se=(a,r,n,t={})=>{const{showSource:l=!0,sourceFormat:c="label",sourceSeparator:u=":",pathSeparator:i=":"}=t;return!l||r.length===0?a.label:`${(c==="id"?n:r).join(i)}${u}${a.label}`},ce=(a,r,n,t,l)=>({displayText:l,sourcePath:[...r],sourceIds:[...n],item:a,trigger:t,fullPath:[...r],fullIds:[...n]}),le=(a="auto")=>{const r={menu:"border rounded-lg shadow-lg backdrop-blur-sm",menuLight:"bg-white border-gray-200 text-gray-900",menuDark:"bg-gray-800 border-gray-700 text-gray-100",item:"px-3 py-2 cursor-pointer transition-colors duration-150",search:"w-full px-3 py-2 border-b outline-none",searchLight:"border-gray-200 bg-white text-gray-900 placeholder-gray-500",searchDark:"border-gray-700 bg-gray-800 text-gray-100 placeholder-gray-400"};return a==="light"?{menu:`${r.menu} ${r.menuLight}`,item:r.item,itemHover:"hover:bg-gray-100",itemSelected:"bg-blue-100",search:`${r.search} ${r.searchLight}`}:a==="dark"?{menu:`${r.menu} ${r.menuDark}`,item:r.item,itemHover:"hover:bg-gray-700",itemSelected:"bg-blue-900",search:`${r.search} ${r.searchDark}`}:{menu:`${r.menu} bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-900 dark:text-gray-100`,item:r.item,itemHover:"hover:bg-gray-100 dark:hover:bg-gray-700",itemSelected:"bg-blue-100 dark:bg-blue-900",search:`${r.search} border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400`}},ee=({isMenuOpen:a,items:r,selectedIndex:n,onSelect:t,onClose:l,onNavigateBack:c,canNavigateBack:u,setSelectedIndex:i})=>{const f=y.useCallback(k=>{if(a)switch(k.key){case"ArrowDown":k.preventDefault(),i(n<r.length-1?n+1:0);break;case"ArrowUp":k.preventDefault(),i(n>0?n-1:r.length-1);break;case"Enter":k.preventDefault(),r[n]&&t(r[n]);break;case"Escape":k.preventDefault(),l();break;case"ArrowLeft":u&&c&&(k.preventDefault(),c());break;case"Tab":k.preventDefault(),l();break}},[a,r,n,t,l,c,u,i]);return y.useEffect(()=>{if(a)return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[a,f]),{handleKeyDown:f}},ie=({isOpen:a,position:r,items:n,selectedIndex:t,searchQuery:l,onSelect:c,onClose:u,onSearch:i,onNavigateBack:f,canNavigateBack:k=!1,maxHeight:P=300,theme:g="auto"})=>{const x=y.useRef(null),b=y.useRef(null),[E,p]=y.useState(l),j=Z(n,E),C=le(g);ee({isMenuOpen:a,items:j,selectedIndex:t,onSelect:c,onClose:u,onNavigateBack:f,canNavigateBack:k,setSelectedIndex:h=>{}}),y.useEffect(()=>{p(l)},[l]),y.useEffect(()=>{a&&b.current&&b.current.focus()},[a]),y.useEffect(()=>{const h=v=>{x.current&&!x.current.contains(v.target)&&u()};if(a)return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[a,u]);const N=h=>{const v=h.target.value;p(v),i(v)},L=h=>{c(h)},d=(h,v)=>{const I=v===t,A=`${C.item} ${I?C.itemSelected:C.itemHover}`;return s.jsx("div",{className:A,onClick:()=>L(h),onMouseEnter:()=>{},children:s.jsxs("div",{className:"flex items-center gap-3",children:[h.icon&&s.jsx("span",{className:"text-lg flex-shrink-0",children:h.icon}),h.avatar&&s.jsx("img",{src:h.avatar,alt:h.label,className:"w-6 h-6 rounded-full flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:h.label}),h.description&&s.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 truncate",children:h.description})]}),h.children&&s.jsx("span",{className:"text-gray-400 dark:text-gray-500 flex-shrink-0",children:"→"})]})},h.id)};return a?s.jsxs("div",{ref:x,className:`fixed z-50 min-w-64 max-w-80 ${C.menu}`,style:{left:r.x,top:r.y,maxHeight:`${P}px`},children:[s.jsxs("div",{className:"flex items-center",children:[k&&s.jsx("button",{onClick:f,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Go back",children:s.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"←"})}),s.jsx("input",{ref:b,type:"text",value:E,onChange:N,placeholder:"Search...",className:`${C.search} ${k?"pl-2":""}`})]}),s.jsx("div",{className:"max-h-64 overflow-y-auto",children:j.length>0?j.map((h,v)=>d(h,v)):s.jsx("div",{className:"px-3 py-4 text-center text-gray-500 dark:text-gray-400",children:"No items found"})})]}):null},ue=({item:a,onSubmit:r,onCancel:n})=>{const[t,l]=y.useState({title:"",content:"",tags:"",database:"default"}),c=i=>{if(i.preventDefault(),!t.title.trim())return;const f=`[Notion Page: ${t.title}${t.tags?` #${t.tags.replace(/,\s*/g," #")}`:""}]`;r(f)},u=(i,f)=>{l(k=>({...k,[i]:f}))};return s.jsxs("div",{className:"p-4 min-w-80",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"font-semibold text-lg",children:"Create Notion Page"}),s.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"✕"})]}),s.jsxs("form",{onSubmit:c,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium mb-1",children:"Page Title *"}),s.jsx("input",{type:"text",value:t.title,onChange:i=>u("title",i.target.value),placeholder:"Enter page title...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500",autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium mb-1",children:"Database"}),s.jsxs("select",{value:t.database,onChange:i=>u("database",i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[s.jsx("option",{value:"default",children:"Default Database"}),s.jsx("option",{value:"projects",children:"Projects"}),s.jsx("option",{value:"notes",children:"Notes"}),s.jsx("option",{value:"tasks",children:"Tasks"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium mb-1",children:"Initial Content"}),s.jsx("textarea",{value:t.content,onChange:i=>u("content",i.target.value),placeholder:"Optional initial content...",rows:3,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium mb-1",children:"Tags"}),s.jsx("input",{type:"text",value:t.tags,onChange:i=>u("tags",i.target.value),placeholder:"tag1, tag2, tag3...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500"}),s.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Separate tags with commas"})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{type:"submit",disabled:!t.title.trim(),className:"flex-1 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed text-white px-4 py-2 rounded-md font-medium transition-colors",children:"Create Page"}),s.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:"Cancel"})]})]})]})},de=(a,r)=>{const[n,t]=y.useState({isOpen:!1,position:{x:0,y:0},currentLayer:0,layerStack:[],searchQuery:"",selectedIndex:0,triggerChar:"",triggerPosition:0,sourcePath:[],sourceIds:[]}),l=r.map(g=>g.trigger),c=y.useCallback((g,x)=>{if(!a.current)return;const b=oe(g,x,l);if(b){const E=r.find(C=>C.trigger===b.trigger);if(!E)return;const p=ne(a.current,b.position),j=a.current.getBoundingClientRect();t(C=>({...C,isOpen:!0,position:{x:j.left+p.left,y:j.top+p.top+p.height+4},currentLayer:0,layerStack:[E.data],searchQuery:b.query,selectedIndex:0,triggerChar:b.trigger,triggerPosition:b.position,sourcePath:[],sourceIds:[]}))}else t(E=>({...E,isOpen:!1}))},[a,r,l]),u=y.useCallback(()=>{t(g=>({...g,isOpen:!1,sourcePath:[],sourceIds:[],currentLayer:0,layerStack:[]}))},[]),i=y.useCallback(g=>{t(x=>({...x,searchQuery:g,selectedIndex:0}))},[]),f=y.useCallback((g,x)=>{t(b=>({...b,currentLayer:b.currentLayer+1,layerStack:[...b.layerStack,g],searchQuery:"",selectedIndex:0,sourcePath:x?[...b.sourcePath,x.label]:b.sourcePath,sourceIds:x?[...b.sourceIds,x.id]:b.sourceIds}))},[]),k=y.useCallback(()=>{t(g=>{if(g.currentLayer>0){const x=g.layerStack.slice(0,-1),b=g.sourcePath.slice(0,-1),E=g.sourceIds.slice(0,-1);return{...g,currentLayer:g.currentLayer-1,layerStack:x,searchQuery:"",selectedIndex:0,sourcePath:b,sourceIds:E}}return g})},[]),P=y.useCallback(g=>{t(x=>({...x,selectedIndex:g}))},[]);return{menuState:n,detectMention:c,closeMenu:u,updateSearch:i,navigateToLayer:f,navigateBack:k,setSelectedIndex:P}},ye=({value:a,onChange:r,mentions:n,placeholder:t="Type @ to mention...",className:l="",onMentionSelect:c,theme:u="auto",maxMenuHeight:i=300,disabled:f=!1,rows:k=4,autoFocus:P=!1,showSource:g=!0,sourceFormat:x="label",sourceSeparator:b=":",pathSeparator:E=":"})=>{const p=y.useRef(null),[j,C]=y.useState(null),[N,L]=y.useState(0),{menuState:d,detectMention:h,closeMenu:v,updateSearch:I,navigateToLayer:A,navigateBack:z,setSelectedIndex:V}=de(p,n),$=d.layerStack[d.currentLayer]||[],D=Z($,d.searchQuery),J=y.useCallback(w=>{const e=w.target.value,o=w.target.selectionStart;r(e),L(o),h(e,o)},[r,h]),M=y.useCallback(w=>{L(w.currentTarget.selectionStart)},[]),W=y.useCallback(w=>{if(w.children&&w.children.length>0){A(w.children,w);return}if(w.component==="NotionPageCard"){C(w);return}const e=se(w,d.sourcePath,d.sourceIds,{showSource:g,sourceFormat:x,sourceSeparator:b,pathSeparator:E}),{newText:o,newCursorPosition:m}=K(a,e,d.triggerPosition,N);if(r(o),v(),setTimeout(()=>{p.current&&(p.current.setSelectionRange(m,m),p.current.focus())},0),c){const S=ce(w,d.sourcePath,d.sourceIds,d.triggerChar,e);c(S)}},[a,N,d.triggerPosition,d.sourcePath,d.sourceIds,d.triggerChar,r,v,c,A,g,x,b,E]),U=y.useCallback(w=>{const{newText:e,newCursorPosition:o}=K(a,w,d.triggerPosition,N);r(e),C(null),v(),setTimeout(()=>{p.current&&(p.current.setSelectionRange(o,o),p.current.focus())},0)},[a,N,d.triggerPosition,r,v]),q=y.useCallback(()=>{C(null),v(),setTimeout(()=>{p.current&&p.current.focus()},0)},[v]);ee({isMenuOpen:d.isOpen&&!j,items:D,selectedIndex:d.selectedIndex,onSelect:W,onClose:v,onNavigateBack:d.currentLayer>0?z:void 0,canNavigateBack:d.currentLayer>0,setSelectedIndex:V});const H=` w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none transition-colors ${f?"opacity-50 cursor-not-allowed":""} `.trim();return s.jsxs("div",{className:"relative",children:[s.jsx("textarea",{ref:p,value:a,onChange:J,onKeyDown:M,placeholder:t,className:`${H} ${l}`,disabled:f,rows:k,autoFocus:P}),s.jsx(ie,{isOpen:d.isOpen&&!j,position:d.position,items:D,selectedIndex:d.selectedIndex,searchQuery:d.searchQuery,onSelect:W,onClose:v,onSearch:I,onNavigateBack:d.currentLayer>0?z:void 0,canNavigateBack:d.currentLayer>0,maxHeight:i,theme:u}),j&&s.jsx("div",{className:"fixed z-50 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",style:{left:d.position.x,top:d.position.y},children:j.component==="NotionPageCard"&&s.jsx(ue,{item:j,onSubmit:U,onCancel:q})})]})};exports.ContextMenu=ie;exports.MentionTextarea=ye;exports.NotionPageCard=ue;exports.createMentionSelectData=ce;exports.debounce=me;exports.filterItems=Z;exports.findMentionTrigger=oe;exports.formatMentionWithSource=se;exports.getCaretCoordinates=ne;exports.getThemeClasses=le;exports.insertMention=K;exports.useKeyboardNavigation=ee;exports.useMentionDetection=de; //# sourceMappingURL=index.js.map