cortex-react-components 2.17.6 → 2.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.
Files changed (201) hide show
  1. package/dist/{chunk-KAB4C5T2.mjs → chunk-275W7H4O.mjs} +1 -1
  2. package/dist/{chunk-5GV4XVLP.mjs → chunk-2GM2LPLB.mjs} +1 -1
  3. package/dist/{chunk-DAAAZF3S.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
  4. package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
  5. package/dist/{chunk-DOPDVMNN.mjs → chunk-3ANJOET7.mjs} +1 -1
  6. package/dist/{chunk-UZYTSIUY.mjs → chunk-3DZFESHK.mjs} +1 -1
  7. package/dist/{chunk-3PUOPWAI.mjs → chunk-4DR4ILAP.mjs} +1 -1
  8. package/dist/{chunk-WC7IAORY.mjs → chunk-4SRUEQTP.mjs} +1 -1
  9. package/dist/{chunk-TNPSOYKM.mjs → chunk-5KO67YNF.mjs} +1 -1
  10. package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
  11. package/dist/{chunk-UECG3SCG.mjs → chunk-5PJLI46T.mjs} +1 -1
  12. package/dist/chunk-7JDMW5R3.mjs +4 -0
  13. package/dist/{chunk-DNMPFZJH.mjs → chunk-7JX3L2MA.mjs} +1 -1
  14. package/dist/{chunk-2WP44BWJ.mjs → chunk-7OMPPFGG.mjs} +1 -1
  15. package/dist/chunk-7TSR2LQB.mjs +1 -0
  16. package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  17. package/dist/{chunk-PTGTIV55.mjs → chunk-BAB3ATRB.mjs} +1 -1
  18. package/dist/{chunk-QUOSFCS5.mjs → chunk-BQQ4V4PX.mjs} +1 -1
  19. package/dist/chunk-DEVPAZSJ.mjs +1 -0
  20. package/dist/{chunk-3BG2SCNC.mjs → chunk-EH3PJU6C.mjs} +1 -1
  21. package/dist/{chunk-7CY3QPBJ.mjs → chunk-F64CA5CH.mjs} +1 -1
  22. package/dist/{chunk-GYLFNLRD.mjs → chunk-FEWOSBUJ.mjs} +1 -1
  23. package/dist/{chunk-NFD36674.mjs → chunk-FMV74RKL.mjs} +1 -1
  24. package/dist/{chunk-PC2PZNJ6.mjs → chunk-FYQBRCQM.mjs} +1 -1
  25. package/dist/{chunk-YTCTK24K.mjs → chunk-GAZHKHGB.mjs} +1 -1
  26. package/dist/{chunk-4OROP5TC.mjs → chunk-GETYSIZV.mjs} +1 -1
  27. package/dist/{chunk-4BKAUTKL.mjs → chunk-HDKHF3EA.mjs} +1 -1
  28. package/dist/{chunk-F2MJXGRT.mjs → chunk-HGL6JHJQ.mjs} +1 -1
  29. package/dist/{chunk-AX66HDQV.mjs → chunk-HHPTGV4F.mjs} +1 -1
  30. package/dist/{chunk-SJON62H2.mjs → chunk-HKMNAXLM.mjs} +1 -1
  31. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  32. package/dist/{chunk-YS3PFB7C.mjs → chunk-IG36QUEI.mjs} +1 -1
  33. package/dist/{chunk-2W4GQ3FI.mjs → chunk-JYPPWTB3.mjs} +1 -1
  34. package/dist/{chunk-O2RJFVGE.mjs → chunk-KVLUT4U2.mjs} +1 -1
  35. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  36. package/dist/{chunk-L5NPH5RX.mjs → chunk-LLP4EFT4.mjs} +1 -1
  37. package/dist/{chunk-ZKOJRF5P.mjs → chunk-MO4HRQEL.mjs} +1 -1
  38. package/dist/{chunk-FXO5SPBG.mjs → chunk-N7M6FTIO.mjs} +1 -1
  39. package/dist/{chunk-ONZ32NDG.mjs → chunk-O24GFE6Q.mjs} +1 -1
  40. package/dist/{chunk-N6J2WFC4.mjs → chunk-P6OSMPUQ.mjs} +1 -1
  41. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  42. package/dist/{chunk-ZIZENXBP.mjs → chunk-PNUBVBSR.mjs} +1 -1
  43. package/dist/{chunk-EUMMM454.mjs → chunk-PTJVI53B.mjs} +1 -1
  44. package/dist/{chunk-RZM6JZBZ.mjs → chunk-PTZT4QJW.mjs} +1 -1
  45. package/dist/chunk-QADUAIFH.mjs +1 -0
  46. package/dist/{chunk-RBJOTC2X.mjs → chunk-QAJBJFRP.mjs} +1 -1
  47. package/dist/{chunk-64ODZI5O.mjs → chunk-R6AYIVIR.mjs} +1 -1
  48. package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
  49. package/dist/{chunk-DEO6EQJR.mjs → chunk-U3FYDDE2.mjs} +1 -1
  50. package/dist/chunk-UA2E23AS.mjs +4 -0
  51. package/dist/{chunk-SIL7AP7H.mjs → chunk-V5VE3EIY.mjs} +1 -1
  52. package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
  53. package/dist/{chunk-OT4MGAKH.mjs → chunk-WYLCN44C.mjs} +1 -1
  54. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  55. package/dist/components/Blocks/Banner.mjs +1 -1
  56. package/dist/components/Blocks/CallToAction.mjs +1 -1
  57. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  58. package/dist/components/Blocks/Content.mjs +1 -1
  59. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  60. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  61. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  62. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  63. package/dist/components/Blocks/index.mjs +1 -1
  64. package/dist/components/Cards/ContentCard.mjs +1 -1
  65. package/dist/components/Cards/FeatureCard.mjs +1 -1
  66. package/dist/components/Cards/index.mjs +1 -1
  67. package/dist/components/Chat/ChatInterface.d.ts +2 -1
  68. package/dist/components/Chat/ChatInterface.js +10 -10
  69. package/dist/components/Chat/ChatInterface.mjs +1 -1
  70. package/dist/components/Chat/ChatInterfaceMessages.mjs +1 -1
  71. package/dist/components/Chat/ChatMessage.mjs +1 -1
  72. package/dist/components/Chat/Components/ChatCardArtefact.mjs +1 -0
  73. package/dist/components/Chat/Components/ChatCardTask.mjs +1 -0
  74. package/dist/components/Chat/Components/Conversation.css +1 -0
  75. package/dist/components/Chat/Components/Conversation.d.ts +15 -0
  76. package/dist/components/Chat/Components/Conversation.js +4 -0
  77. package/dist/components/Chat/Components/Conversation.mjs +4 -0
  78. package/dist/components/Chat/Components/Message.css +1 -0
  79. package/dist/components/Chat/Components/Message.d.ts +19 -0
  80. package/dist/components/Chat/Components/Message.js +4 -0
  81. package/dist/components/Chat/Components/Message.mjs +1 -0
  82. package/dist/components/Chat/CopilotInterface.js +10 -10
  83. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  84. package/dist/components/Chat/PartTypes/CodeBlock.js +1 -1
  85. package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
  86. package/dist/components/Chat/PartTypes/MessageHandler.css +1 -0
  87. package/dist/components/Chat/PartTypes/MessageHandler.d.ts +9 -0
  88. package/dist/components/Chat/PartTypes/MessageHandler.js +20 -0
  89. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -0
  90. package/dist/components/Chat/PartTypes/PartApprovalTool.d.ts +1 -1
  91. package/dist/components/Chat/PartTypes/PartApprovalTool.mjs +1 -1
  92. package/dist/components/Chat/PartTypes/PartAuthenticateTool.d.ts +1 -1
  93. package/dist/components/Chat/PartTypes/PartAuthenticateTool.mjs +1 -1
  94. package/dist/components/Chat/PartTypes/Tool.js +1 -1
  95. package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
  96. package/dist/components/Chat/PartTypes/index.js +6 -6
  97. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  98. package/dist/components/Chat/demo-long-messages.js +15 -15
  99. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  100. package/dist/components/Chat/demo-tests.js +32 -32
  101. package/dist/components/Chat/demo-tests.mjs +1 -1
  102. package/dist/components/Chat/demo.js +10 -10
  103. package/dist/components/Chat/demo.mjs +1 -1
  104. package/dist/components/Chat/example-usage.js +10 -10
  105. package/dist/components/Chat/example-usage.mjs +1 -1
  106. package/dist/components/Chat/example-with-vercel-ai.js +10 -10
  107. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  108. package/dist/components/Chat/index.d.ts +2 -2
  109. package/dist/components/Chat/index.js +10 -10
  110. package/dist/components/Chat/index.mjs +1 -1
  111. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  112. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  113. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  114. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  115. package/dist/components/DigitalColleagues/index.mjs +1 -1
  116. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  117. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  118. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  119. package/dist/components/Foundary/MainPage.mjs +1 -1
  120. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  121. package/dist/components/Foundary/RichText/index.mjs +1 -1
  122. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  123. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  124. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  125. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  126. package/dist/components/Foundary/Views/index.mjs +1 -1
  127. package/dist/components/Foundary/document-edit.mjs +1 -1
  128. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  129. package/dist/components/Foundary/document-preview.mjs +1 -1
  130. package/dist/components/Foundary/index.mjs +1 -1
  131. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  132. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  133. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  134. package/dist/components/HeaderFooter/index.mjs +1 -1
  135. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  136. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  137. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  138. package/dist/components/Heros/PostHero/index.mjs +1 -1
  139. package/dist/components/Heros/RenderHero.mjs +1 -1
  140. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  141. package/dist/components/Heros/index.mjs +1 -1
  142. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  143. package/dist/components/Layouts/Print.mjs +1 -1
  144. package/dist/components/Layouts/SlideShow.mjs +1 -1
  145. package/dist/components/Layouts/index.mjs +1 -1
  146. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  147. package/dist/components/Menus/SidebarRight.mjs +1 -1
  148. package/dist/components/Menus/index.mjs +1 -1
  149. package/dist/components/Other/index.mjs +1 -1
  150. package/dist/components/Payload/RichText/index.mjs +1 -1
  151. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  152. package/dist/components/Payload/index.mjs +1 -1
  153. package/dist/components/Projects/EpicsView.mjs +1 -1
  154. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  155. package/dist/components/Projects/ProjectPage.mjs +1 -1
  156. package/dist/components/Projects/ProjectView.mjs +1 -1
  157. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  158. package/dist/components/Projects/index.mjs +1 -1
  159. package/dist/components/index.js +19 -19
  160. package/dist/components/index.mjs +1 -1
  161. package/dist/components/ui/index.mjs +1 -1
  162. package/dist/components/ui/sidebar.mjs +1 -1
  163. package/dist/globals.css +1 -1
  164. package/dist/index.js +23 -23
  165. package/dist/index.mjs +1 -1
  166. package/dist/metafile-cjs.json +1 -1
  167. package/dist/metafile-esm.json +1 -1
  168. package/dist/pages/Blog.mjs +1 -1
  169. package/dist/pages/Documentation.mjs +1 -1
  170. package/dist/pages/IndexPage.mjs +1 -1
  171. package/dist/pages/Intranet.mjs +1 -1
  172. package/dist/pages/LandingPage.mjs +1 -1
  173. package/dist/pages/Page.mjs +1 -1
  174. package/dist/pages/Publish.mjs +1 -1
  175. package/dist/pages/Website.mjs +1 -1
  176. package/dist/sections/AboutSection.mjs +1 -1
  177. package/dist/sections/BlogDetail.mjs +1 -1
  178. package/dist/sections/BlogList.mjs +1 -1
  179. package/dist/sections/BlogListSection.mjs +1 -1
  180. package/dist/sections/ContactSection.mjs +1 -1
  181. package/dist/sections/PageSections.mjs +1 -1
  182. package/dist/sections/PricingSection.mjs +1 -1
  183. package/dist/sections/ServiceDetail.mjs +1 -1
  184. package/dist/sections/ServiceDetailSection.mjs +1 -1
  185. package/dist/sections/ServiceSection.mjs +1 -1
  186. package/dist/sections/form/index.mjs +1 -1
  187. package/dist/sections/index.mjs +1 -1
  188. package/package.json +5 -4
  189. package/dist/chunk-SMDC36XJ.mjs +0 -1
  190. package/dist/chunk-UGBDJDPW.mjs +0 -4
  191. package/dist/chunk-ZN7NNMB7.mjs +0 -4
  192. package/dist/components/Chat/ChatCardArtefact.mjs +0 -1
  193. package/dist/components/Chat/ChatCardTask.mjs +0 -1
  194. /package/dist/{chunk-I2PVJQQR.mjs → chunk-RL6365DN.mjs} +0 -0
  195. /package/dist/{chunk-DBY4SXQI.mjs → chunk-YPZAYXNQ.mjs} +0 -0
  196. /package/dist/components/Chat/{ChatCardArtefact.css → Components/ChatCardArtefact.css} +0 -0
  197. /package/dist/components/Chat/{ChatCardArtefact.d.ts → Components/ChatCardArtefact.d.ts} +0 -0
  198. /package/dist/components/Chat/{ChatCardArtefact.js → Components/ChatCardArtefact.js} +0 -0
  199. /package/dist/components/Chat/{ChatCardTask.css → Components/ChatCardTask.css} +0 -0
  200. /package/dist/components/Chat/{ChatCardTask.d.ts → Components/ChatCardTask.d.ts} +0 -0
  201. /package/dist/components/Chat/{ChatCardTask.js → Components/ChatCardTask.js} +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "cortex-react-components",
3
3
  "author": "Cortex Reply",
4
4
  "private": false,
5
- "version": "2.17.6",
5
+ "version": "2.18.1",
6
6
  "description": "A library of React components with styles. Designed to seamlessly integrate with React and Next.js.",
7
7
  "license": "MPL-2.0",
8
8
  "main": "./dist/index.js",
@@ -94,8 +94,8 @@
94
94
  "vitest": "^2.1.8"
95
95
  },
96
96
  "dependencies": {
97
- "@ai-sdk/openai": "^2.0.29",
98
- "@ai-sdk/react": "^2.0.42",
97
+ "@ai-sdk/openai": "^2.0.38",
98
+ "@ai-sdk/react": "^2.0.56",
99
99
  "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
100
100
  "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration": "^1.3.1",
101
101
  "@headlessui/react": "^2.2.0",
@@ -124,7 +124,7 @@
124
124
  "@radix-ui/react-tooltip": "^1.1.6",
125
125
  "@radix-ui/react-use-controllable-state": "^1.2.2",
126
126
  "@tailwindcss/typography": "^0.5.15",
127
- "ai": "^5.0.42",
127
+ "ai": "^5.0.56",
128
128
  "bson-objectid": "^2.0.4",
129
129
  "class-variance-authority": "^0.7.1",
130
130
  "clsx": "^2.1.1",
@@ -149,6 +149,7 @@
149
149
  "tailwindcss-animate": "^1.0.7",
150
150
  "tailwindcss-animated": "^2.0.0",
151
151
  "tailwindcss-intersect": "^2.1.0",
152
+ "use-stick-to-bottom": "^1.1.1",
152
153
  "yup": "^1.6.1",
153
154
  "zod": "^4.0.17"
154
155
  },
@@ -1 +0,0 @@
1
- import{a as _}from"./chunk-6OCLRAHU.mjs";import{a as Q,b as X,c as j}from"./chunk-5Y6FKL5W.mjs";import{a as Y,b as Z,c as ee,d as te,e as ae}from"./chunk-UGBDJDPW.mjs";import{a as G}from"./chunk-3BG2SCNC.mjs";import{a as R}from"./chunk-SIL7AP7H.mjs";import{a as q}from"./chunk-2LINLX4S.mjs";import{a as V}from"./chunk-DBY4SXQI.mjs";import{a as J}from"./chunk-I2PVJQQR.mjs";import{d as P}from"./chunk-Q2DPE66H.mjs";import{a as K}from"./chunk-FT3AE7L2.mjs";import{a as U}from"./chunk-L5JPAKPM.mjs";import{b as d}from"./chunk-ZUA4KNIR.mjs";import{a as h,c as x}from"./chunk-SOLZ4VQH.mjs";import{b as W}from"./chunk-CSBGSBEU.mjs";import{a as f,b as y,c as N,e as v}from"./chunk-YO3GQYRJ.mjs";import{a as p}from"./chunk-MDJREBVI.mjs";import{useRef as E,useEffect as se,useState as ie}from"react";import*as u from"motion/react-client";import{Send as he,Bot as M,User as xe,Menu as be,Paperclip as Ce,X as we,FileText as ke,Image as Te,File as Ie,Download as De,ExternalLink as Ae}from"lucide-react";import{jsx as e,jsxs as s}from"react/jsx-runtime";function Xe({messages:b,input:B,isTyping:C=!1,currentSessionTitle:Pe,capabilities:F,fileUploads:w,isDragOver:oe,enableFileUpload:S,onInputChange:re,addToolResult:k,onSendMessage:le,onKeyPress:ne,onFileUpload:L,onRemoveFile:de,onDragOver:T,className:me}){let I=E(null),ce=E(null),$=E(null),[c,g]=ie(!1),[z,Re]=ie({path:[],selectedItems:[],filters:{}});se(()=>{I.current?.scrollIntoView({behavior:"smooth"})},[b]),se(()=>{c&&setTimeout(()=>{I.current?.scrollIntoView({behavior:"smooth"})},100)},[c]);let H=()=>P(z),ue=()=>{let t=[];return F.forEach(r=>{r.actions&&r.actions.forEach(l=>{t.push({label:l.label,action:()=>D(l.id,{path:[r],selectedItems:[],filters:{}})})}),r.children&&r.children.forEach(l=>{l.type==="list"&&l.data&&t.push({label:`View ${l.name}`,action:()=>g(!0)})})}),t.slice(0,5)},D=(t,r)=>{console.log("Capability action:",t,r);let l=`Executing ${t} with context: ${JSON.stringify(r.path.map(i=>i.name))}`;g(!1)},Ee=P({path:[],selectedItems:[],filters:{}}),pe=t=>{L(t.target.files),t.target.files&&(t.target.value="")},fe=t=>{t.preventDefault(),T(!0)},ve=t=>{t.preventDefault(),T(!1)},ge=t=>{t.preventDefault(),T(!1),L(t.dataTransfer.files)},ye=t=>{if(t===0)return"0 Bytes";let r=1024,l=["Bytes","KB","MB","GB"],i=Math.floor(Math.log(t)/Math.log(r));return parseFloat((t/Math.pow(r,i)).toFixed(2))+" "+l[i]},O=t=>t.startsWith("image/")?e(Te,{className:"h-4 w-4"}):t.startsWith("text/")?e(ke,{className:"h-4 w-4"}):e(Ie,{className:"h-4 w-4"}),Ne=t=>{let r=t.role==="assistant",l=t.role==="user";return s("div",{className:p("flex my-2 items-start gap-3",l?"flex-row-reverse":""),children:[e(h,{className:"h-8 w-8 shrink-0",children:e(x,{className:p(l?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:l?e(xe,{className:"h-4 w-4"}):e(M,{className:"h-4 w-4"})})}),e("div",{className:p("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",l?"bg-primary text-primary-foreground":"bg-muted"),children:t.parts.map((i,o)=>{if(i.type==="text")return e(_,{id:t.id,content:i.text},`${t.id}-text`);if(i.type==="file"){let a=i;return e("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:s("div",{className:"flex items-center gap-2",children:[O(a.mediaType||"application/octet-stream"),e("div",{className:"flex-1 min-w-0",children:e("p",{className:"text-sm font-medium truncate",children:a.filename||a.url?.split("/").pop()||"File"})}),a.url&&e(d,{variant:"ghost",size:"sm",onClick:()=>window.open(a.url,"_blank"),className:"h-8 w-8 p-0",children:e(De,{className:"h-4 w-4"})})]})},o)}if(i.type.startsWith("tool-")){let a=i,m=i.type.replace("tool-","");if(m==="task")switch(a.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading task..."},o);case"output-available":return e("div",{className:"mb-2",children:e(J,{data:{id:a.output?.id||a.input?.id,fetchLatest:!1,taskData:a.output||a.input}})},o);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",a.errorText]},o);default:return null}if(i.type==="tool-requestEndpointLogin")return e("div",{className:"mb-2",children:e(R,{toolPart:a,index:o,addToolResult:k??(()=>{})})},o);if(i.type==="tool-authenticate")return e("div",{className:"mb-2",children:e(R,{toolPart:a,index:o,addToolResult:k??(()=>{})})},o);if(i.type==="tool-requestApproval")return e("div",{className:"mb-2",children:e(G,{toolPart:a,index:o,addToolResult:k??(()=>{})})},o);if(m==="artefact")switch(a.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading artefact..."},o);case"output-available":return e("div",{className:"mb-2",children:e(V,{artefact:a.output?.description||"",taskId:a.output?.id||a.input?.id,taskData:a.output||a.input})},o);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",a.errorText]},o);default:return null}return e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(y,{children:e(N,{className:"text-lg",children:m})}),s(v,{children:[a.state==="input-available"&&s("p",{className:"text-sm",children:["Processing ",m,"..."]}),a.state==="output-available"&&e("pre",{className:"text-sm",children:JSON.stringify(a.output,null,2)}),a.state==="output-error"&&s("p",{className:"text-sm text-red-500",children:["Error: ",a.errorText]})]})]})},o)}if(i.type.startsWith("data-")){let a=i,m=i.type.replace("data-","");return m==="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:a.data?.references?.map((n,A)=>s("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[e(W,{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(d,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:e(Ae,{className:"h-4 w-4"})})]},A))})})})},o):m==="menu"?e("div",{className:"mb-2",children:s(f,{className:"w-full",children:[e(y,{children:e(N,{className:"text-lg",children:a.data?.title})}),e(v,{children:e("div",{className:"space-y-2",children:a.data?.items?.map((n,A)=>e(d,{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})]})},A))})})]})},o):e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(y,{children:e(N,{className:"text-lg",children:m})}),e(v,{children:e("pre",{className:"text-sm",children:JSON.stringify(a.data,null,2)})})]})},o)}if(i.type==="reasoning")return s(Q,{className:"w-full",isStreaming:status==="streaming"&&o===t.parts.length-1&&t.id===b.at(-1)?.id,children:[e(X,{}),e(j,{children:i.text})]},`${t.id}-${o}`);if(i.type==="dynamic-tool")return s(Y,{defaultOpen:!0,children:[e(Z,{type:`tool-${i.toolName}`,state:i.state}),s(ee,{children:[e(te,{input:i.input}),e(ae,{output:i.output,errorText:i.errorText})]})]},`${t.id}-${o}`)})})]})};return s("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${me||""}`,children:[s(K,{ref:ce,className:"flex-1 p-4 bg-background border-0",onDragOver:fe,onDragLeave:ve,onDrop:ge,children:[s("div",{className:p("space-y-4",oe&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[e(u.animate,{children:b.map(t=>e(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:p("flex gap-3",t.role==="user"?"flex-row-reverse":"flex-row"),children:Ne(t)},t.id))}),c&&s(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[e(h,{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(q,{capabilities:F,isOpen:c,onToggle:()=>g(!c),onActionSelect:D,className:"w-full"})})]}),C&&s(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[e(h,{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:I})]}),w.length>0&&e("div",{className:"p-4 border-t bg-muted/10",children:e("div",{className:"flex flex-wrap gap-2",children:w.map(t=>s("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[O(t.file.type),e("span",{className:"text-sm font-medium",children:t.file.name}),e("span",{className:"text-xs text-muted-foreground",children:ye(t.file.size)}),e(d,{variant:"ghost",size:"sm",onClick:()=>de(t.id),className:"h-6 w-6 p-0",children:e(we,{className:"h-4 w-4"})})]},t.id))})}),s("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[s("div",{className:"flex gap-3",children:[e(U,{value:B,onChange:t=>re(t.target.value),onKeyPress:ne,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:C}),S&&e(d,{variant:"outline",size:"icon",onClick:()=>$.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:e(Ce,{className:"h-4 w-4"})}),e(d,{onClick:le,disabled:!B.trim()&&w.length===0||C,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:e(he,{className:"h-4 w-4"})})]}),s("div",{className:"flex items-center gap-3 mt-3",children:[s(d,{onClick:()=>g(!c),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[e(be,{className:"h-3 w-3 mr-1"}),c?"Hide":"Show"," Capabilities"]}),s("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[H().map((t,r)=>e(d,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>D(t.id,z),children:t.label},`context-${t.id}`)),H().length===0&&ue().map((t,r)=>e(d,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:t.action,children:t.label},`suggestion-${r}`))]})]}),S&&e("input",{ref:$,type:"file",multiple:!0,onChange:pe,className:"hidden"})]})]})}export{Xe as a};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{a as n}from"./chunk-ZN7NNMB7.mjs";import{a as i,b as d,c}from"./chunk-YNCJATT7.mjs";import{b as m}from"./chunk-CSBGSBEU.mjs";import{a as s}from"./chunk-MDJREBVI.mjs";import{CheckCircleIcon as u,ChevronDownIcon as g,CircleIcon as f,ClockIcon as x,WrenchIcon as v,XCircleIcon as C}from"lucide-react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var w=({className:t,...o})=>e(i,{className:s("not-prose mb-4 w-full rounded-md border",t),...o}),P=t=>{let o={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return r(m,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":e(f,{className:"size-4"}),"input-available":e(x,{className:"size-4 animate-pulse"}),"output-available":e(u,{className:"size-4 text-green-600"}),"output-error":e(C,{className:"size-4 text-red-600"})}[t],o[t]]})},h=({className:t,type:o,state:a,...l})=>r(d,{className:s("flex w-full items-center justify-between gap-4 p-3",t),...l,children:[r("div",{className:"flex items-center gap-2",children:[e(v,{className:"size-4 text-muted-foreground"}),e("span",{className:"font-medium text-sm",children:o}),P(a)]}),e(g,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),U=({className:t,...o})=>e(c,{className:s("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...o}),z=({className:t,input:o,...a})=>r("div",{className:s("space-y-2 overflow-hidden p-4",t),...a,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),e("div",{className:"rounded-md bg-muted/50",children:e(n,{code:JSON.stringify(o,null,2),language:"json"})})]}),O=({className:t,output:o,errorText:a,...l})=>{if(!(o||a))return null;let p=e("div",{children:o});return typeof o=="object"?p=e(n,{code:JSON.stringify(o,null,2),language:"json"}):typeof o=="string"&&(p=e(n,{code:o,language:"json"})),r("div",{className:s("space-y-2 p-4",t),...l,children:[e("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),r("div",{className:s("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&e("div",{children:a}),p]})]})};export{w as a,h as b,U as c,z as d,O as e};
@@ -1,4 +0,0 @@
1
- "use client";
2
- "use strict";
3
-
4
- import{b as l}from"./chunk-ZUA4KNIR.mjs";import{a as d}from"./chunk-MDJREBVI.mjs";import{CheckIcon as f,CopyIcon as v}from"lucide-react";import{createContext as y,useContext as b,useState as k}from"react";import{Prism as c}from"react-syntax-highlighter";import{oneDark as x,oneLight as B}from"react-syntax-highlighter/dist/esm/styles/prism";import{jsx as o,jsxs as N}from"react/jsx-runtime";var m=y({code:""}),I=({code:e,language:r,showLineNumbers:t=!1,className:i,children:n,...a})=>o(m.Provider,{value:{code:e},children:o("div",{className:d("relative w-full overflow-hidden rounded-md border bg-background text-foreground",i),...a,children:N("div",{className:"relative",children:[o(c,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:B,children:e}),o(c,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:x,children:e}),n&&o("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})}),z=({onCopy:e,onError:r,timeout:t=2e3,children:i,className:n,...a})=>{let[p,s]=k(!1),{code:u}=b(m),g=async()=>{if(typeof window>"u"||!navigator.clipboard.writeText){r?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(u),s(!0),e?.(),setTimeout(()=>s(!1),t)}catch(C){r?.(C)}},h=p?f:v;return o(l,{className:d("shrink-0",n),onClick:g,size:"icon",variant:"ghost",...a,children:i??o(h,{size:14})})};export{I as a,z as b};
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-DBY4SXQI.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as ChatCardArtefact};
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as ChatCardTask};
File without changes
File without changes