cortex-react-components 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/{chunk-GETYSIZV.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  3. package/dist/{chunk-P6OSMPUQ.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/{chunk-LW4QFIFR.mjs → chunk-3PHJWI4Q.mjs} +1 -1
  5. package/dist/{chunk-QTILVWJA.mjs → chunk-4RYG24IZ.mjs} +1 -1
  6. package/dist/{chunk-WB2Y7HTT.mjs → chunk-55MVSCX4.mjs} +1 -1
  7. package/dist/{chunk-ABGNIQRP.mjs → chunk-5RDLHKTK.mjs} +1 -1
  8. package/dist/{chunk-BQQ4V4PX.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  9. package/dist/{chunk-GAZHKHGB.mjs → chunk-67QPOSVV.mjs} +1 -1
  10. package/dist/{chunk-CLGBBNRB.mjs → chunk-75WE6ZXB.mjs} +1 -1
  11. package/dist/{chunk-7OMPPFGG.mjs → chunk-7GMAMIHM.mjs} +1 -1
  12. package/dist/chunk-CSDKRMII.mjs +4 -0
  13. package/dist/{chunk-TK4JC5PG.mjs → chunk-E64KWNOT.mjs} +1 -1
  14. package/dist/{chunk-2GM2LPLB.mjs → chunk-ERJXTG6X.mjs} +1 -1
  15. package/dist/{chunk-HDKHF3EA.mjs → chunk-FKU4VQR6.mjs} +1 -1
  16. package/dist/{chunk-MO2B5CDW.mjs → chunk-FQMEHUDP.mjs} +1 -1
  17. package/dist/{chunk-77PCUNUC.mjs → chunk-FTZRG54P.mjs} +1 -1
  18. package/dist/chunk-FUEUJPNZ.mjs +1 -0
  19. package/dist/{chunk-F64CA5CH.mjs → chunk-H3CJOE6S.mjs} +1 -1
  20. package/dist/{chunk-U3FYDDE2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  21. package/dist/{chunk-PNUBVBSR.mjs → chunk-IF3425JX.mjs} +1 -1
  22. package/dist/{chunk-IDG2O4B7.mjs → chunk-ISBVFNWD.mjs} +1 -1
  23. package/dist/{chunk-KZAYLEFB.mjs → chunk-LJOWXPWW.mjs} +1 -1
  24. package/dist/{chunk-PTZT4QJW.mjs → chunk-LJQPLE4S.mjs} +1 -1
  25. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-M7NV6EFH.mjs} +1 -1
  26. package/dist/{chunk-S4A4VHOI.mjs → chunk-MQA37YMO.mjs} +1 -1
  27. package/dist/{chunk-4SRUEQTP.mjs → chunk-MXCW6SOT.mjs} +1 -1
  28. package/dist/{chunk-FYQBRCQM.mjs → chunk-N3B3XNV3.mjs} +1 -1
  29. package/dist/{chunk-MPTT6GRI.mjs → chunk-NTS4U2OE.mjs} +1 -1
  30. package/dist/{chunk-ATIEKI6M.mjs → chunk-O4GULNQE.mjs} +1 -1
  31. package/dist/{chunk-MO4HRQEL.mjs → chunk-PK3OBSCB.mjs} +1 -1
  32. package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
  33. package/dist/chunk-QM5FOQHG.mjs +10 -0
  34. package/dist/{chunk-W7MEHF4G.mjs → chunk-RNMPX2AU.mjs} +1 -1
  35. package/dist/{chunk-6VHK4OL7.mjs → chunk-RRLXKDET.mjs} +1 -1
  36. package/dist/{chunk-VR5WOPRD.mjs → chunk-SEXSYCWD.mjs} +1 -1
  37. package/dist/chunk-SIL7AP7H.mjs +1 -0
  38. package/dist/{chunk-JHYWAL24.mjs → chunk-SW7RYGO6.mjs} +1 -1
  39. package/dist/{chunk-5N32XPU2.mjs → chunk-U3F45KVI.mjs} +1 -1
  40. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  41. package/dist/{chunk-GTK2SGS5.mjs → chunk-XBCYPOFD.mjs} +1 -1
  42. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  43. package/dist/{chunk-DYCG7KUN.mjs → chunk-XHR2HXMP.mjs} +1 -1
  44. package/dist/{chunk-RAGDUV7M.mjs → chunk-XIGBDWYI.mjs} +1 -1
  45. package/dist/chunk-XKM35QQD.mjs +4 -0
  46. package/dist/{chunk-HKMNAXLM.mjs → chunk-YKG4FNS4.mjs} +1 -1
  47. package/dist/{chunk-RRME4EHD.mjs → chunk-ZEPEWKBV.mjs} +1 -1
  48. package/dist/components/Blocks/Banner.mjs +1 -1
  49. package/dist/components/Blocks/CallToAction.mjs +1 -1
  50. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  51. package/dist/components/Blocks/Content.mjs +1 -1
  52. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  53. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  54. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  55. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  56. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  57. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  58. package/dist/components/Blocks/index.mjs +1 -1
  59. package/dist/components/Cards/ContentCard.mjs +1 -1
  60. package/dist/components/Cards/FeatureCard.mjs +1 -1
  61. package/dist/components/Cards/index.mjs +1 -1
  62. package/dist/components/Chat/ChatInterface.d.ts +2 -1
  63. package/dist/components/Chat/ChatInterface.js +7 -1
  64. package/dist/components/Chat/ChatInterface.mjs +1 -1
  65. package/dist/components/Chat/Components/Oauth.d.ts +11 -0
  66. package/dist/components/Chat/Components/Oauth.js +10 -0
  67. package/dist/components/Chat/Components/Oauth.mjs +2 -0
  68. package/dist/components/Chat/CopilotInterface.js +7 -1
  69. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  70. package/dist/components/Chat/PartTypes/PartAuthenticateTool.d.ts +15 -0
  71. package/dist/components/Chat/PartTypes/PartAuthenticateTool.js +10 -0
  72. package/dist/components/Chat/PartTypes/PartAuthenticateTool.mjs +1 -0
  73. package/dist/components/Chat/PartTypes/index.d.ts +1 -0
  74. package/dist/components/Chat/PartTypes/index.js +10 -0
  75. package/dist/components/Chat/PartTypes/index.mjs +1 -0
  76. package/dist/components/Chat/demo-long-messages.js +12 -6
  77. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  78. package/dist/components/Chat/demo-tests.css +1 -0
  79. package/dist/components/Chat/demo-tests.d.ts +10 -0
  80. package/dist/components/Chat/demo-tests.js +645 -0
  81. package/dist/components/Chat/demo-tests.mjs +635 -0
  82. package/dist/components/Chat/demo.js +7 -1
  83. package/dist/components/Chat/demo.mjs +1 -1
  84. package/dist/components/Chat/example-usage.js +7 -1
  85. package/dist/components/Chat/example-usage.mjs +1 -1
  86. package/dist/components/Chat/example-with-vercel-ai.js +7 -1
  87. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  88. package/dist/components/Chat/index.js +8 -2
  89. package/dist/components/Chat/index.mjs +1 -1
  90. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  91. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  92. package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
  93. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
  94. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  95. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  96. package/dist/components/DigitalColleagues/Views/KnowledgeView.js +1 -1
  97. package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
  98. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  99. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  100. package/dist/components/DigitalColleagues/document-edit.js +1 -1
  101. package/dist/components/DigitalColleagues/document-edit.mjs +1 -1
  102. package/dist/components/DigitalColleagues/document-preview-examples.js +5 -5
  103. package/dist/components/DigitalColleagues/document-preview-examples.mjs +1 -1
  104. package/dist/components/DigitalColleagues/document-preview.js +1 -1
  105. package/dist/components/DigitalColleagues/document-preview.mjs +1 -1
  106. package/dist/components/DigitalColleagues/index.js +1 -1
  107. package/dist/components/DigitalColleagues/index.mjs +1 -1
  108. package/dist/components/DigitalColleagues/knowledge-browser.js +1 -1
  109. package/dist/components/DigitalColleagues/knowledge-browser.mjs +1 -1
  110. package/dist/components/HeaderFooter/Header.mjs +1 -1
  111. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  112. package/dist/components/HeaderFooter/index.mjs +1 -1
  113. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  114. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  115. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  116. package/dist/components/Heros/PostHero/index.mjs +1 -1
  117. package/dist/components/Heros/RenderHero.mjs +1 -1
  118. package/dist/components/Heros/index.mjs +1 -1
  119. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  120. package/dist/components/Layouts/Print.mjs +1 -1
  121. package/dist/components/Layouts/SlideShow.mjs +1 -1
  122. package/dist/components/Layouts/index.mjs +1 -1
  123. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  124. package/dist/components/Menus/SidebarRight.mjs +1 -1
  125. package/dist/components/Menus/index.mjs +1 -1
  126. package/dist/components/Payload/Card/index.mjs +1 -1
  127. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  128. package/dist/components/Payload/Media/index.mjs +1 -1
  129. package/dist/components/Payload/RichText/index.mjs +1 -1
  130. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  131. package/dist/components/Payload/index.mjs +1 -1
  132. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  133. package/dist/components/Projects/ProjectPage.mjs +1 -1
  134. package/dist/components/Projects/ProjectView.mjs +1 -1
  135. package/dist/components/dc-temp/index.js +1 -1
  136. package/dist/components/dc-temp/index.mjs +1 -1
  137. package/dist/components/index.js +17 -11
  138. package/dist/components/index.mjs +1 -1
  139. package/dist/components/ui/index.mjs +1 -1
  140. package/dist/components/ui/sidebar.mjs +1 -1
  141. package/dist/globals.css +1 -1
  142. package/dist/index.js +21 -15
  143. package/dist/index.mjs +1 -1
  144. package/dist/metafile-cjs.json +1 -1
  145. package/dist/metafile-esm.json +1 -1
  146. package/dist/pages/Blog.mjs +1 -1
  147. package/dist/pages/Documentation.mjs +1 -1
  148. package/dist/pages/IndexPage.mjs +1 -1
  149. package/dist/pages/Intranet.mjs +1 -1
  150. package/dist/pages/LandingPage.mjs +1 -1
  151. package/dist/pages/Page.mjs +1 -1
  152. package/dist/pages/Publish.mjs +1 -1
  153. package/dist/pages/Website.mjs +1 -1
  154. package/dist/sections/AboutSection.mjs +1 -1
  155. package/dist/sections/BlogDetail.mjs +1 -1
  156. package/dist/sections/BlogList.mjs +1 -1
  157. package/dist/sections/BlogListSection.mjs +1 -1
  158. package/dist/sections/ContactSection.mjs +1 -1
  159. package/dist/sections/PageSections.mjs +1 -1
  160. package/dist/sections/PricingSection.mjs +1 -1
  161. package/dist/sections/ServiceDetail.mjs +1 -1
  162. package/dist/sections/ServiceDetailSection.mjs +1 -1
  163. package/dist/sections/ServiceSection.mjs +1 -1
  164. package/dist/sections/index.mjs +1 -1
  165. package/package.json +5 -5
  166. package/dist/chunk-553B5H2H.mjs +0 -4
  167. package/dist/chunk-FI57DC3P.mjs +0 -1
  168. package/dist/chunk-H7PR7Q2X.mjs +0 -4
@@ -1 +0,0 @@
1
- import{a as _}from"./chunk-LUPNE23E.mjs";import{a as V}from"./chunk-A2AEX4YB.mjs";import{a as J}from"./chunk-DBY4SXQI.mjs";import{a as W}from"./chunk-I3E2TYYZ.mjs";import{d as T}from"./chunk-Q2DPE66H.mjs";import{a as $}from"./chunk-FT3AE7L2.mjs";import{a as U}from"./chunk-L5JPAKPM.mjs";import{b as o}from"./chunk-ZUA4KNIR.mjs";import{a as N,c as x}from"./chunk-SOLZ4VQH.mjs";import{b as K}from"./chunk-CSBGSBEU.mjs";import{a as f,b as h,c as b,e as v}from"./chunk-YO3GQYRJ.mjs";import{a as p}from"./chunk-MDJREBVI.mjs";import{useRef as A,useEffect as G,useState as Q}from"react";import{motion as E,AnimatePresence as me}from"framer-motion";import{Send as ce,Bot as M,User as de,Menu as ue,Paperclip as pe,X as fe,FileText as ve,Image as ge,File as Ne,Download as xe,ExternalLink as he}from"lucide-react";import{jsx as e,jsxs as s}from"react/jsx-runtime";function Ge({messages:B,input:F,isTyping:y=!1,currentSessionTitle:be,capabilities:P,fileUploads:C,isDragOver:X,enableFileUpload:S,onInputChange:j,onSendMessage:q,onKeyPress:Y,onFileUpload:z,onRemoveFile:Z,onDragOver:w,className:ee}){let k=A(null),ae=A(null),L=A(null),[d,g]=Q(!1),[R,ye]=Q({path:[],selectedItems:[],filters:{}});G(()=>{k.current?.scrollIntoView({behavior:"smooth"})},[B]),G(()=>{d&&setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth"})},100)},[d]);let H=()=>T(R),te=()=>{let a=[];return P.forEach(i=>{i.actions&&i.actions.forEach(r=>{a.push({label:r.label,action:()=>D(r.id,{path:[i],selectedItems:[],filters:{}})})}),i.children&&i.children.forEach(r=>{r.type==="list"&&r.data&&a.push({label:`View ${r.name}`,action:()=>g(!0)})})}),a.slice(0,5)},D=(a,i)=>{console.log("Capability action:",a,i);let r=`Executing ${a} with context: ${JSON.stringify(i.path.map(u=>u.name))}`;g(!1)},Ce=T({path:[],selectedItems:[],filters:{}}),se=a=>{z(a.target.files),a.target.files&&(a.target.value="")},ie=a=>{a.preventDefault(),w(!0)},re=a=>{a.preventDefault(),w(!1)},le=a=>{a.preventDefault(),w(!1),z(a.dataTransfer.files)},ne=a=>{if(a===0)return"0 Bytes";let i=1024,r=["Bytes","KB","MB","GB"],u=Math.floor(Math.log(a)/Math.log(i));return parseFloat((a/Math.pow(i,u)).toFixed(2))+" "+r[u]},O=a=>a.startsWith("image/")?e(ge,{className:"h-4 w-4"}):a.startsWith("text/")?e(ve,{className:"h-4 w-4"}):e(Ne,{className:"h-4 w-4"}),oe=a=>{let i=a.role==="assistant",r=a.role==="user",u=_(a);return s("div",{className:p("flex items-start gap-3",r?"flex-row-reverse":""),children:[e(N,{className:"h-8 w-8 shrink-0",children:e(x,{className:p(r?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:r?e(de,{className:"h-4 w-4"}):e(M,{className:"h-4 w-4"})})}),s("div",{className:p("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",r?"bg-primary text-primary-foreground":"bg-muted"),children:[u&&e("div",{className:"mb-2 last:mb-0",children:e("p",{className:"text-sm",children:u})}),a.parts.map((m,l)=>{if(m.type==="text")return null;if(m.type==="file"){let t=m;return e("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:s("div",{className:"flex items-center gap-2",children:[O(t.mediaType||"application/octet-stream"),e("div",{className:"flex-1 min-w-0",children:e("p",{className:"text-sm font-medium truncate",children:t.filename||t.url?.split("/").pop()||"File"})}),t.url&&e(o,{variant:"ghost",size:"sm",onClick:()=>window.open(t.url,"_blank"),className:"h-8 w-8 p-0",children:e(xe,{className:"h-4 w-4"})})]})},l)}if(m.type.startsWith("tool-")){let t=m,c=m.type.replace("tool-","");if(c==="task")switch(t.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading task..."},l);case"output-available":return e("div",{className:"mb-2",children:e(W,{data:{id:t.output?.id||t.input?.id,fetchLatest:!1,taskData:t.output||t.input}})},l);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",t.errorText]},l);default:return null}if(c==="artefact")switch(t.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading artefact..."},l);case"output-available":return e("div",{className:"mb-2",children:e(J,{artefact:t.output?.description||"",taskId:t.output?.id||t.input?.id,taskData:t.output||t.input})},l);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",t.errorText]},l);default:return null}return e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(h,{children:e(b,{className:"text-lg",children:c})}),s(v,{children:[t.state==="input-available"&&s("p",{className:"text-sm",children:["Processing ",c,"..."]}),t.state==="output-available"&&e("pre",{className:"text-sm",children:JSON.stringify(t.output,null,2)}),t.state==="output-error"&&s("p",{className:"text-sm text-red-500",children:["Error: ",t.errorText]})]})]})},l)}if(m.type.startsWith("data-")){let t=m,c=m.type.replace("data-","");return c==="reference"?e("div",{className:"mb-2",children:e(f,{className:"w-full",children:e(v,{className:"p-4",children:e("div",{className:"space-y-2",children:t.data?.references?.map((n,I)=>s("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[e(K,{variant:"outline",children:n.type||"link"}),s("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-medium truncate",children:n.title}),n.description&&e("p",{className:"text-xs text-muted-foreground truncate",children:n.description})]}),n.url&&e(o,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:e(he,{className:"h-4 w-4"})})]},I))})})})},l):c==="menu"?e("div",{className:"mb-2",children:s(f,{className:"w-full",children:[e(h,{children:e(b,{className:"text-lg",children:t.data?.title})}),e(v,{children:e("div",{className:"space-y-2",children:t.data?.items?.map((n,I)=>e(o,{variant:"outline",className:"w-full justify-start",onClick:n.action,children:s("div",{className:"text-left",children:[e("p",{className:"font-medium",children:n.label}),n.description&&e("p",{className:"text-xs text-muted-foreground",children:n.description})]})},I))})})]})},l):e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(h,{children:e(b,{className:"text-lg",children:c})}),e(v,{children:e("pre",{className:"text-sm",children:JSON.stringify(t.data,null,2)})})]})},l)}return null})]})]})};return s("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${ee||""}`,children:[s($,{ref:ae,className:"flex-1 p-4 bg-background border-0",onDragOver:ie,onDragLeave:re,onDrop:le,children:[s("div",{className:p("space-y-4",X&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[e(me,{children:B.map(a=>e(E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:p("flex gap-3",a.role==="user"?"flex-row-reverse":"flex-row"),children:oe(a)},a.id))}),d&&s(E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[e(N,{className:"h-8 w-8",children:e(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:e(M,{className:"h-4 w-4"})})}),e("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:e(V,{capabilities:P,isOpen:d,onToggle:()=>g(!d),onActionSelect:D,className:"w-full"})})]}),y&&s(E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[e(N,{className:"h-8 w-8",children:e(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:e(M,{className:"h-4 w-4"})})}),e("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:s("div",{className:"flex space-x-1",children:[e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),e("div",{ref:k})]}),C.length>0&&e("div",{className:"p-4 border-t bg-muted/10",children:e("div",{className:"flex flex-wrap gap-2",children:C.map(a=>s("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[O(a.file.type),e("span",{className:"text-sm font-medium",children:a.file.name}),e("span",{className:"text-xs text-muted-foreground",children:ne(a.file.size)}),e(o,{variant:"ghost",size:"sm",onClick:()=>Z(a.id),className:"h-6 w-6 p-0",children:e(fe,{className:"h-4 w-4"})})]},a.id))})}),s("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[s("div",{className:"flex gap-3",children:[e(U,{value:F,onChange:a=>j(a.target.value),onKeyPress:Y,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:y}),S&&e(o,{variant:"outline",size:"icon",onClick:()=>L.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:e(pe,{className:"h-4 w-4"})}),e(o,{onClick:q,disabled:!F.trim()&&C.length===0||y,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:e(ce,{className:"h-4 w-4"})})]}),s("div",{className:"flex items-center gap-3 mt-3",children:[s(o,{onClick:()=>g(!d),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[e(ue,{className:"h-3 w-3 mr-1"}),d?"Hide":"Show"," Capabilities"]}),s("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[H().map((a,i)=>e(o,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>D(a.id,R),children:a.label},`context-${a.id}`)),H().length===0&&te().map((a,i)=>e(o,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:a.action,children:a.label},`suggestion-${i}`))]})]}),S&&e("input",{ref:L,type:"file",multiple:!0,onChange:se,className:"hidden"})]})]})}export{Ge as a};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as b}from"./chunk-2GNX22CR.mjs";import{a as I}from"./chunk-5BK3HTPN.mjs";import{a as S}from"./chunk-FI57DC3P.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as a}from"react";import{motion as ue,AnimatePresence as ge}from"framer-motion";import{Users as fe}from"lucide-react";import{jsx as i,jsxs as he}from"react/jsx-runtime";function Ae({aiConfig:F,useCustomChat:w,enableAI:B=!0,messages:D=[],businessUnits:T=[],capabilities:N=[],sidebarItems:x=[],notifications:R=[],sessions:A=[],onNewChat:M,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=d=>console.log("Search query:",d),initialTeam:z="design",currentSession:g=null,showCapabilities:ye=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=i(fe,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let d=me(F||{}),r=B?w||d:null,[Y,m]=a(""),[Z,C]=a(!1),_=r?.messages||D,l=Y,j=r?.status==="submitted"||Z,n=T||[],ee={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[te,se]=a(()=>n.length===0?ee:n.find(e=>e.id===z)||n[0]),[o,c]=a([]),[ie,ne]=a(!1),oe=e=>{if(!e||!f)return;let s=[];Array.from(e).forEach(t=>{if(t.size>h*1024*1024){alert(`File ${t.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(p=>t.type.match(p))){alert(`File type ${t.type} is not allowed.`);return}let v={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:t,status:"pending",progress:0};if(t.type.startsWith("image/")){let p=new FileReader;p.onload=pe=>{c(de=>de.map(u=>u.id===v.id?{...u,preview:pe.target?.result}:u))},p.readAsDataURL(t)}s.push(v)}),c(t=>[...t,...s])},ae=e=>{c(s=>s.filter(t=>t.id!==e))},U=()=>{if(!(!l.trim()&&o.length===0)){if(r){let e=o.length>0?re(o.map(s=>s.file)):void 0;r.sendMessage({text:l,files:e},{body:{timestamp:Date.now()}}),m("")}else console.log("Message to send:",l),console.log("Files to upload:",o),m(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},re=e=>{let s=new DataTransfer;return e.forEach(t=>s.items.add(t)),s.files},le=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),U())},ce=e=>{m(e)};return i(b,{sidebarItems:x||[],title:W,notifications:R||[],businessUnits:n,currentBusinessUnit:te,onBusinessUnitChange:e=>{e&&(se(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:i(ge,{mode:"wait",children:i(ue.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:he("div",{className:"h-full flex",children:[i("div",{className:"w-80 flex-shrink-0 h-full p-2",children:i(I,{sessions:A||[],currentSession:g,teams:n,onNewChat:M,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),i("div",{className:"flex-1 h-full p-2",children:i(S,{messages:_||[],input:l,isTyping:j,currentSessionTitle:g?.title,capabilities:N||[],onInputChange:ce,onSendMessage:U,onKeyPress:le,fileUploads:o,isDragOver:ie,enableFileUpload:f,onFileUpload:oe,onRemoveFile:ae,onDragOver:ne})})]})},"chat-interface")})})}export{Ae as a};