@copilotkit/react-ui 0.15.0-alpha.1 → 0.15.0-alpha.2

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 (315) hide show
  1. package/.turbo/turbo-build.log +192 -288
  2. package/CHANGELOG.md +16 -1
  3. package/dist/{chunk-ZVAH2Z2W.mjs → chunk-3M4HWSE7.mjs} +3 -3
  4. package/dist/chunk-3M4HWSE7.mjs.map +1 -0
  5. package/dist/{chunk-Y2RUG4B3.mjs → chunk-5O2MCJZ2.mjs} +2 -2
  6. package/dist/chunk-5O2MCJZ2.mjs.map +1 -0
  7. package/dist/{chunk-X3Z2EVFV.mjs → chunk-CKJXXQ2W.mjs} +5 -5
  8. package/dist/chunk-CKJXXQ2W.mjs.map +1 -0
  9. package/dist/{chunk-NXWVWC33.mjs → chunk-DPRH4HX3.mjs} +11 -24
  10. package/dist/chunk-DPRH4HX3.mjs.map +1 -0
  11. package/dist/{chunk-UIRFLYXI.mjs → chunk-GWGHQNRI.mjs} +14 -13
  12. package/dist/chunk-GWGHQNRI.mjs.map +1 -0
  13. package/dist/chunk-JD7BAH7U.mjs +3 -0
  14. package/dist/{chunk-X4T6ZUVM.mjs → chunk-KBGIPFXA.mjs} +5 -5
  15. package/dist/chunk-KBGIPFXA.mjs.map +1 -0
  16. package/dist/{chunk-DN3OI5WF.mjs → chunk-NNVWLSYK.mjs} +9 -9
  17. package/dist/chunk-NNVWLSYK.mjs.map +1 -0
  18. package/dist/{chunk-QFASQEFJ.mjs → chunk-NYLOXKYT.mjs} +2 -2
  19. package/dist/chunk-NYLOXKYT.mjs.map +1 -0
  20. package/dist/{chunk-6H3Y2XEI.mjs → chunk-OF66AL5Z.mjs} +1 -1
  21. package/dist/chunk-OF66AL5Z.mjs.map +1 -0
  22. package/dist/{chunk-DPUPEOGG.mjs → chunk-UWPFPWAW.mjs} +2 -2
  23. package/dist/chunk-UWPFPWAW.mjs.map +1 -0
  24. package/dist/{chunk-GPEJCUWA.mjs → chunk-Z34F3WLK.mjs} +2 -2
  25. package/dist/chunk-Z34F3WLK.mjs.map +1 -0
  26. package/dist/components/chat/Button.d.ts +2 -3
  27. package/dist/components/chat/Button.js +38 -0
  28. package/dist/components/chat/Button.js.map +1 -0
  29. package/dist/components/chat/Button.mjs +2 -2
  30. package/dist/components/chat/Chat.d.ts +15 -14
  31. package/dist/components/chat/Chat.js +800 -0
  32. package/dist/components/chat/Chat.js.map +1 -0
  33. package/dist/components/chat/Chat.mjs +9 -9
  34. package/dist/components/chat/ChatContext.d.ts +21 -21
  35. package/dist/components/chat/ChatContext.js +220 -0
  36. package/dist/components/chat/ChatContext.js.map +1 -0
  37. package/dist/components/chat/ChatContext.mjs +1 -1
  38. package/dist/components/chat/CodeBlock.js +221 -0
  39. package/dist/components/chat/CodeBlock.js.map +1 -0
  40. package/dist/components/chat/CodeBlock.mjs +1 -1
  41. package/dist/components/chat/Header.d.ts +2 -3
  42. package/dist/components/chat/Header.js +31 -0
  43. package/dist/components/chat/Header.js.map +1 -0
  44. package/dist/components/chat/Header.mjs +2 -2
  45. package/dist/components/chat/Icons.d.ts +4 -4
  46. package/dist/components/chat/Icons.js +233 -0
  47. package/dist/components/chat/Icons.js.map +1 -0
  48. package/dist/components/chat/Input.d.ts +2 -3
  49. package/dist/components/chat/Input.js +111 -0
  50. package/dist/components/chat/Input.js.map +1 -0
  51. package/dist/components/chat/Input.mjs +2 -2
  52. package/dist/components/chat/Markdown.d.ts +1 -3
  53. package/dist/components/chat/Markdown.js +269 -0
  54. package/dist/components/chat/Markdown.js.map +1 -0
  55. package/dist/components/chat/Markdown.mjs +2 -2
  56. package/dist/components/chat/Messages.d.ts +2 -3
  57. package/dist/components/chat/Messages.js +331 -0
  58. package/dist/components/chat/Messages.js.map +1 -0
  59. package/dist/components/chat/Messages.mjs +4 -4
  60. package/dist/components/chat/Popup.d.ts +5 -4
  61. package/dist/components/chat/Popup.js +806 -0
  62. package/dist/components/chat/Popup.js.map +1 -0
  63. package/dist/components/chat/Popup.mjs +10 -10
  64. package/dist/components/chat/Response.d.ts +2 -3
  65. package/dist/components/chat/Response.js +31 -0
  66. package/dist/components/chat/Response.js.map +1 -0
  67. package/dist/components/chat/Response.mjs +2 -2
  68. package/dist/components/chat/Sidebar.d.ts +7 -6
  69. package/dist/components/chat/Sidebar.js +817 -0
  70. package/dist/components/chat/Sidebar.js.map +1 -0
  71. package/dist/components/chat/Sidebar.mjs +10 -10
  72. package/dist/components/chat/Textarea.d.ts +4 -4
  73. package/dist/components/chat/Textarea.js +55 -0
  74. package/dist/components/chat/Textarea.js.map +1 -0
  75. package/dist/components/chat/Window.d.ts +1 -1
  76. package/dist/components/chat/Window.js +116 -0
  77. package/dist/components/chat/Window.js.map +1 -0
  78. package/dist/components/chat/index.d.ts +5 -4
  79. package/dist/components/chat/index.js +824 -0
  80. package/dist/components/chat/index.js.map +1 -0
  81. package/dist/components/chat/index.mjs +11 -11
  82. package/dist/components/chat/props.d.ts +1 -1
  83. package/dist/components/chat/props.js +4 -0
  84. package/dist/components/index.d.ts +5 -11
  85. package/dist/components/index.js +824 -0
  86. package/dist/components/index.js.map +1 -0
  87. package/dist/components/index.mjs +12 -33
  88. package/dist/context/index.js +4 -0
  89. package/dist/hooks/index.js +4 -0
  90. package/dist/hooks/use-copy-to-clipboard.js +47 -0
  91. package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
  92. package/dist/index.css +112 -916
  93. package/dist/index.css.map +1 -1
  94. package/dist/index.d.ts +5 -11
  95. package/dist/index.js +824 -0
  96. package/dist/index.js.map +1 -0
  97. package/dist/index.mjs +13 -34
  98. package/dist/lib/utils.js +64 -0
  99. package/dist/lib/utils.js.map +1 -0
  100. package/dist/lib/utils.mjs +38 -2
  101. package/dist/lib/utils.mjs.map +1 -1
  102. package/dist/lib/utils.test.js +10 -0
  103. package/dist/lib/utils.test.js.map +1 -0
  104. package/dist/types/index.js +4 -0
  105. package/dist/types/types.d.ts +1 -1
  106. package/dist/types/types.js +4 -0
  107. package/package.json +8 -7
  108. package/src/components/chat/Button.tsx +1 -2
  109. package/src/components/chat/Chat.tsx +7 -7
  110. package/src/components/chat/ChatContext.tsx +10 -10
  111. package/src/components/chat/CodeBlock.tsx +12 -36
  112. package/src/components/chat/Header.tsx +1 -2
  113. package/src/components/chat/Input.tsx +1 -1
  114. package/src/components/chat/Markdown.tsx +17 -11
  115. package/src/components/chat/Messages.tsx +2 -2
  116. package/src/components/chat/Popup.tsx +3 -4
  117. package/src/components/chat/Response.tsx +1 -2
  118. package/src/components/chat/Sidebar.tsx +4 -4
  119. package/src/components/chat/index.tsx +2 -2
  120. package/src/components/chat/props.ts +1 -1
  121. package/src/components/index.ts +0 -8
  122. package/src/css/animations.css +6 -0
  123. package/src/css/markdown.css +123 -0
  124. package/src/styles.css +1 -0
  125. package/src/types/types.ts +1 -1
  126. package/tsup.config.ts +1 -2
  127. package/dist/chunk-2KAF7NKC.mjs +0 -484
  128. package/dist/chunk-2KAF7NKC.mjs.map +0 -1
  129. package/dist/chunk-5KEDV5VC.mjs +0 -27
  130. package/dist/chunk-5KEDV5VC.mjs.map +0 -1
  131. package/dist/chunk-6H3Y2XEI.mjs.map +0 -1
  132. package/dist/chunk-6LAZQHEB.mjs +0 -129
  133. package/dist/chunk-6LAZQHEB.mjs.map +0 -1
  134. package/dist/chunk-C34L4AWW.mjs +0 -39
  135. package/dist/chunk-C34L4AWW.mjs.map +0 -1
  136. package/dist/chunk-CF3BK4OX.mjs +0 -53
  137. package/dist/chunk-CF3BK4OX.mjs.map +0 -1
  138. package/dist/chunk-CNQX2VY3.mjs +0 -66
  139. package/dist/chunk-CNQX2VY3.mjs.map +0 -1
  140. package/dist/chunk-DN3OI5WF.mjs.map +0 -1
  141. package/dist/chunk-DPUPEOGG.mjs.map +0 -1
  142. package/dist/chunk-FZRTAML3.mjs +0 -3
  143. package/dist/chunk-GCOPYGHH.mjs +0 -27
  144. package/dist/chunk-GCOPYGHH.mjs.map +0 -1
  145. package/dist/chunk-GPEJCUWA.mjs.map +0 -1
  146. package/dist/chunk-IJLMKBSZ.mjs +0 -25
  147. package/dist/chunk-IJLMKBSZ.mjs.map +0 -1
  148. package/dist/chunk-INCNMGJ7.mjs +0 -72
  149. package/dist/chunk-INCNMGJ7.mjs.map +0 -1
  150. package/dist/chunk-M3CZWJI3.mjs +0 -44
  151. package/dist/chunk-M3CZWJI3.mjs.map +0 -1
  152. package/dist/chunk-MC6KTH4X.mjs +0 -12
  153. package/dist/chunk-MC6KTH4X.mjs.map +0 -1
  154. package/dist/chunk-NXWVWC33.mjs.map +0 -1
  155. package/dist/chunk-OHWEJUCS.mjs +0 -18
  156. package/dist/chunk-OHWEJUCS.mjs.map +0 -1
  157. package/dist/chunk-OOBQC5H6.mjs +0 -34
  158. package/dist/chunk-OOBQC5H6.mjs.map +0 -1
  159. package/dist/chunk-Q6YO7LDK.mjs +0 -40
  160. package/dist/chunk-Q6YO7LDK.mjs.map +0 -1
  161. package/dist/chunk-QFASQEFJ.mjs.map +0 -1
  162. package/dist/chunk-RPTRCFSO.mjs +0 -42
  163. package/dist/chunk-RPTRCFSO.mjs.map +0 -1
  164. package/dist/chunk-SEH5PQVW.mjs +0 -52
  165. package/dist/chunk-SEH5PQVW.mjs.map +0 -1
  166. package/dist/chunk-SHOTWRKC.mjs +0 -18
  167. package/dist/chunk-SHOTWRKC.mjs.map +0 -1
  168. package/dist/chunk-SRBUGQTM.mjs +0 -109
  169. package/dist/chunk-SRBUGQTM.mjs.map +0 -1
  170. package/dist/chunk-TEYIQHMK.mjs +0 -12
  171. package/dist/chunk-TEYIQHMK.mjs.map +0 -1
  172. package/dist/chunk-UIRFLYXI.mjs.map +0 -1
  173. package/dist/chunk-VGX2W5ZB.mjs +0 -28
  174. package/dist/chunk-VGX2W5ZB.mjs.map +0 -1
  175. package/dist/chunk-X3Z2EVFV.mjs.map +0 -1
  176. package/dist/chunk-X4T6ZUVM.mjs.map +0 -1
  177. package/dist/chunk-XGUBRIUV.mjs +0 -72
  178. package/dist/chunk-XGUBRIUV.mjs.map +0 -1
  179. package/dist/chunk-Y2RUG4B3.mjs.map +0 -1
  180. package/dist/chunk-ZVAH2Z2W.mjs.map +0 -1
  181. package/dist/chunk-ZYC5YVDO.mjs +0 -21
  182. package/dist/chunk-ZYC5YVDO.mjs.map +0 -1
  183. package/dist/components/chat-components/chat-list.d.ts +0 -8
  184. package/dist/components/chat-components/chat-list.mjs +0 -13
  185. package/dist/components/chat-components/chat-message-actions.d.ts +0 -8
  186. package/dist/components/chat-components/chat-message-actions.mjs +0 -8
  187. package/dist/components/chat-components/chat-message.d.ts +0 -8
  188. package/dist/components/chat-components/chat-message.mjs +0 -11
  189. package/dist/components/chat-components/chat-panel.d.ts +0 -8
  190. package/dist/components/chat-components/chat-panel.mjs +0 -10
  191. package/dist/components/chat-components/chat-scroll-anchor.d.ts +0 -6
  192. package/dist/components/chat-components/chat-scroll-anchor.mjs +0 -5
  193. package/dist/components/chat-components/clear-history.d.ts +0 -9
  194. package/dist/components/chat-components/clear-history.mjs +0 -56
  195. package/dist/components/chat-components/clear-history.mjs.map +0 -1
  196. package/dist/components/chat-components/copilot-chat.d.ts +0 -12
  197. package/dist/components/chat-components/copilot-chat.mjs +0 -22
  198. package/dist/components/chat-components/copilot-chat.mjs.map +0 -1
  199. package/dist/components/chat-components/default-empty-screen.d.ts +0 -8
  200. package/dist/components/chat-components/default-empty-screen.mjs +0 -8
  201. package/dist/components/chat-components/default-empty-screen.mjs.map +0 -1
  202. package/dist/components/chat-components/external-link.d.ts +0 -6
  203. package/dist/components/chat-components/external-link.mjs +0 -4
  204. package/dist/components/chat-components/external-link.mjs.map +0 -1
  205. package/dist/components/chat-components/markdown.d.ts +0 -6
  206. package/dist/components/chat-components/markdown.mjs +0 -4
  207. package/dist/components/chat-components/markdown.mjs.map +0 -1
  208. package/dist/components/chat-components/prompt-form.d.ts +0 -9
  209. package/dist/components/chat-components/prompt-form.mjs +0 -9
  210. package/dist/components/chat-components/prompt-form.mjs.map +0 -1
  211. package/dist/components/chat-components/theme-toggle.d.ts +0 -3
  212. package/dist/components/chat-components/theme-toggle.mjs +0 -32
  213. package/dist/components/chat-components/theme-toggle.mjs.map +0 -1
  214. package/dist/components/chat-components/toaster.d.ts +0 -1
  215. package/dist/components/chat-components/toaster.mjs +0 -4
  216. package/dist/components/chat-components/toaster.mjs.map +0 -1
  217. package/dist/components/chat-components/ui/alert-dialog.d.ts +0 -20
  218. package/dist/components/chat-components/ui/alert-dialog.mjs +0 -6
  219. package/dist/components/chat-components/ui/alert-dialog.mjs.map +0 -1
  220. package/dist/components/chat-components/ui/badge.d.ts +0 -12
  221. package/dist/components/chat-components/ui/badge.mjs +0 -29
  222. package/dist/components/chat-components/ui/badge.mjs.map +0 -1
  223. package/dist/components/chat-components/ui/button.d.ts +0 -14
  224. package/dist/components/chat-components/ui/button.mjs +0 -5
  225. package/dist/components/chat-components/ui/button.mjs.map +0 -1
  226. package/dist/components/chat-components/ui/codeblock.d.ts +0 -14
  227. package/dist/components/chat-components/ui/codeblock.mjs +0 -8
  228. package/dist/components/chat-components/ui/codeblock.mjs.map +0 -1
  229. package/dist/components/chat-components/ui/dialog.d.ts +0 -18
  230. package/dist/components/chat-components/ui/dialog.mjs +0 -94
  231. package/dist/components/chat-components/ui/dialog.mjs.map +0 -1
  232. package/dist/components/chat-components/ui/dropdown-menu.d.ts +0 -24
  233. package/dist/components/chat-components/ui/dropdown-menu.mjs +0 -87
  234. package/dist/components/chat-components/ui/dropdown-menu.mjs.map +0 -1
  235. package/dist/components/chat-components/ui/icons.d.ts +0 -33
  236. package/dist/components/chat-components/ui/icons.mjs +0 -5
  237. package/dist/components/chat-components/ui/icons.mjs.map +0 -1
  238. package/dist/components/chat-components/ui/input.d.ts +0 -7
  239. package/dist/components/chat-components/ui/input.mjs +0 -26
  240. package/dist/components/chat-components/ui/input.mjs.map +0 -1
  241. package/dist/components/chat-components/ui/label.d.ts +0 -8
  242. package/dist/components/chat-components/ui/label.mjs +0 -19
  243. package/dist/components/chat-components/ui/label.mjs.map +0 -1
  244. package/dist/components/chat-components/ui/select.d.ts +0 -13
  245. package/dist/components/chat-components/ui/select.mjs +0 -101
  246. package/dist/components/chat-components/ui/select.mjs.map +0 -1
  247. package/dist/components/chat-components/ui/separator.d.ts +0 -6
  248. package/dist/components/chat-components/ui/separator.mjs +0 -5
  249. package/dist/components/chat-components/ui/separator.mjs.map +0 -1
  250. package/dist/components/chat-components/ui/sheet.d.ts +0 -19
  251. package/dist/components/chat-components/ui/sheet.mjs +0 -93
  252. package/dist/components/chat-components/ui/sheet.mjs.map +0 -1
  253. package/dist/components/chat-components/ui/switch.d.ts +0 -6
  254. package/dist/components/chat-components/ui/switch.mjs +0 -33
  255. package/dist/components/chat-components/ui/switch.mjs.map +0 -1
  256. package/dist/components/chat-components/ui/textarea.d.ts +0 -7
  257. package/dist/components/chat-components/ui/textarea.mjs +0 -25
  258. package/dist/components/chat-components/ui/textarea.mjs.map +0 -1
  259. package/dist/components/chat-components/ui/tooltip.d.ts +0 -9
  260. package/dist/components/chat-components/ui/tooltip.mjs +0 -5
  261. package/dist/components/chat-components/ui/tooltip.mjs.map +0 -1
  262. package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +0 -8
  263. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +0 -25
  264. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs.map +0 -1
  265. package/dist/components/sidebar/copilot-sidebar.d.ts +0 -6
  266. package/dist/components/sidebar/copilot-sidebar.mjs +0 -23
  267. package/dist/components/sidebar/copilot-sidebar.mjs.map +0 -1
  268. package/dist/components/sidebar/sidebar-context.d.ts +0 -9
  269. package/dist/components/sidebar/sidebar-context.mjs +0 -4
  270. package/dist/components/sidebar/sidebar-context.mjs.map +0 -1
  271. package/dist/hooks/use-at-bottom.d.ts +0 -3
  272. package/dist/hooks/use-at-bottom.mjs +0 -4
  273. package/dist/hooks/use-at-bottom.mjs.map +0 -1
  274. package/dist/hooks/use-enter-submit.d.ts +0 -8
  275. package/dist/hooks/use-enter-submit.mjs +0 -4
  276. package/dist/hooks/use-enter-submit.mjs.map +0 -1
  277. package/src/components/chat-components/chat-list.tsx +0 -28
  278. package/src/components/chat-components/chat-message-actions.tsx +0 -36
  279. package/src/components/chat-components/chat-message.tsx +0 -70
  280. package/src/components/chat-components/chat-panel.tsx +0 -64
  281. package/src/components/chat-components/chat-scroll-anchor.tsx +0 -29
  282. package/src/components/chat-components/clear-history.tsx +0 -72
  283. package/src/components/chat-components/copilot-chat.tsx +0 -57
  284. package/src/components/chat-components/default-empty-screen.tsx +0 -57
  285. package/src/components/chat-components/external-link.tsx +0 -17
  286. package/src/components/chat-components/markdown.tsx +0 -8
  287. package/src/components/chat-components/prompt-form.tsx +0 -85
  288. package/src/components/chat-components/theme-toggle.tsx +0 -31
  289. package/src/components/chat-components/toaster.tsx +0 -3
  290. package/src/components/chat-components/ui/alert-dialog.tsx +0 -126
  291. package/src/components/chat-components/ui/badge.tsx +0 -33
  292. package/src/components/chat-components/ui/button.tsx +0 -49
  293. package/src/components/chat-components/ui/codeblock.tsx +0 -137
  294. package/src/components/chat-components/ui/dialog.tsx +0 -106
  295. package/src/components/chat-components/ui/dropdown-menu.tsx +0 -117
  296. package/src/components/chat-components/ui/icons.tsx +0 -484
  297. package/src/components/chat-components/ui/input.tsx +0 -24
  298. package/src/components/chat-components/ui/label.tsx +0 -21
  299. package/src/components/chat-components/ui/select.tsx +0 -119
  300. package/src/components/chat-components/ui/separator.tsx +0 -26
  301. package/src/components/chat-components/ui/sheet.tsx +0 -106
  302. package/src/components/chat-components/ui/switch.tsx +0 -29
  303. package/src/components/chat-components/ui/textarea.tsx +0 -23
  304. package/src/components/chat-components/ui/tooltip.tsx +0 -30
  305. package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +0 -73
  306. package/src/components/sidebar/copilot-sidebar.tsx +0 -38
  307. package/src/components/sidebar/sidebar-context.tsx +0 -11
  308. package/src/hooks/use-at-bottom.tsx +0 -20
  309. package/src/hooks/use-enter-submit.tsx +0 -17
  310. /package/dist/{chunk-FZRTAML3.mjs.map → chunk-JD7BAH7U.mjs.map} +0 -0
  311. /package/dist/components/{chat-components/chat-list.mjs.map → chat/props.js.map} +0 -0
  312. /package/dist/{components/chat-components/chat-message-actions.mjs.map → context/index.js.map} +0 -0
  313. /package/dist/{components/chat-components/chat-message.mjs.map → hooks/index.js.map} +0 -0
  314. /package/dist/{components/chat-components/chat-panel.mjs.map → types/index.js.map} +0 -0
  315. /package/dist/{components/chat-components/chat-scroll-anchor.mjs.map → types/types.js.map} +0 -0
@@ -1,25 +0,0 @@
1
- export { CopilotSidebarUIProvider } from '../../chunk-XGUBRIUV.mjs';
2
- import '../../chunk-C34L4AWW.mjs';
3
- import '../../chunk-MC6KTH4X.mjs';
4
- import '../../chunk-RPTRCFSO.mjs';
5
- import '../../chunk-SEH5PQVW.mjs';
6
- import '../../chunk-5KEDV5VC.mjs';
7
- import '../../chunk-SHOTWRKC.mjs';
8
- import '../../chunk-GCOPYGHH.mjs';
9
- import '../../chunk-CNQX2VY3.mjs';
10
- import '../../chunk-6LAZQHEB.mjs';
11
- import '../../chunk-TEYIQHMK.mjs';
12
- import '../../chunk-OOBQC5H6.mjs';
13
- import '../../chunk-CF3BK4OX.mjs';
14
- import '../../chunk-INCNMGJ7.mjs';
15
- import '../../chunk-VGX2W5ZB.mjs';
16
- import '../../chunk-M3CZWJI3.mjs';
17
- import '../../chunk-2KAF7NKC.mjs';
18
- import '../../chunk-IJLMKBSZ.mjs';
19
- import '../../chunk-Q6YO7LDK.mjs';
20
- import '../../chunk-ZYC5YVDO.mjs';
21
- import '../../chunk-POVINPXX.mjs';
22
- import '../../chunk-OHWEJUCS.mjs';
23
- import '../../chunk-MRXNTQOX.mjs';
24
- //# sourceMappingURL=out.js.map
25
- //# sourceMappingURL=copilot-sidebar-ui-provider.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- interface SidebarProps {
2
- setSidebarOpen: (open: boolean) => void;
3
- }
4
- declare function CopilotSidebar(props: SidebarProps): JSX.Element;
5
-
6
- export { CopilotSidebar, SidebarProps };
@@ -1,23 +0,0 @@
1
- export { CopilotSidebar } from '../../chunk-C34L4AWW.mjs';
2
- import '../../chunk-RPTRCFSO.mjs';
3
- import '../../chunk-SEH5PQVW.mjs';
4
- import '../../chunk-5KEDV5VC.mjs';
5
- import '../../chunk-SHOTWRKC.mjs';
6
- import '../../chunk-GCOPYGHH.mjs';
7
- import '../../chunk-CNQX2VY3.mjs';
8
- import '../../chunk-6LAZQHEB.mjs';
9
- import '../../chunk-TEYIQHMK.mjs';
10
- import '../../chunk-OOBQC5H6.mjs';
11
- import '../../chunk-CF3BK4OX.mjs';
12
- import '../../chunk-INCNMGJ7.mjs';
13
- import '../../chunk-VGX2W5ZB.mjs';
14
- import '../../chunk-M3CZWJI3.mjs';
15
- import '../../chunk-2KAF7NKC.mjs';
16
- import '../../chunk-IJLMKBSZ.mjs';
17
- import '../../chunk-Q6YO7LDK.mjs';
18
- import '../../chunk-ZYC5YVDO.mjs';
19
- import '../../chunk-POVINPXX.mjs';
20
- import '../../chunk-OHWEJUCS.mjs';
21
- import '../../chunk-MRXNTQOX.mjs';
22
- //# sourceMappingURL=out.js.map
23
- //# sourceMappingURL=copilot-sidebar.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface CopilotSidebarContextType {
4
- isSidebarOpen: boolean;
5
- toggleSidebar: () => void;
6
- }
7
- declare const CopilotSidebarContext: React.Context<CopilotSidebarContextType>;
8
-
9
- export { CopilotSidebarContext, CopilotSidebarContextType };
@@ -1,4 +0,0 @@
1
- export { CopilotSidebarContext } from '../../chunk-MC6KTH4X.mjs';
2
- import '../../chunk-MRXNTQOX.mjs';
3
- //# sourceMappingURL=out.js.map
4
- //# sourceMappingURL=sidebar-context.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- declare function useAtBottom(offset?: number): boolean;
2
-
3
- export { useAtBottom };
@@ -1,4 +0,0 @@
1
- export { useAtBottom } from '../chunk-ZYC5YVDO.mjs';
2
- import '../chunk-MRXNTQOX.mjs';
3
- //# sourceMappingURL=out.js.map
4
- //# sourceMappingURL=use-at-bottom.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { RefObject } from 'react';
2
-
3
- declare function useEnterSubmit(): {
4
- formRef: RefObject<HTMLFormElement>;
5
- onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
6
- };
7
-
8
- export { useEnterSubmit };
@@ -1,4 +0,0 @@
1
- export { useEnterSubmit } from '../chunk-OHWEJUCS.mjs';
2
- import '../chunk-MRXNTQOX.mjs';
3
- //# sourceMappingURL=out.js.map
4
- //# sourceMappingURL=use-enter-submit.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- import { type Message } from "@copilotkit/react-core";
2
-
3
- import { Separator } from "./ui/separator";
4
- import { ChatMessage } from "./chat-message";
5
-
6
- export interface ChatList {
7
- messages: Message[];
8
- }
9
-
10
- export function ChatList({ messages }: ChatList) {
11
- // we don't want to display system messages
12
- const displayedMessages = messages.filter((message) => message.role !== "system");
13
-
14
- if (!displayedMessages.length) {
15
- return null;
16
- }
17
-
18
- return (
19
- <div className="relative mx-auto max-w-2xl px-0">
20
- {displayedMessages.map((message, index) => (
21
- <div key={index}>
22
- <ChatMessage message={message} />
23
- {index < displayedMessages.length - 1 && <Separator className="my-4 md:my-4" />}
24
- </div>
25
- ))}
26
- </div>
27
- );
28
- }
@@ -1,36 +0,0 @@
1
- "use client";
2
-
3
- import { type Message } from "@copilotkit/react-core";
4
-
5
- import { Button } from "./ui/button";
6
- import { IconCheck, IconCopy } from "./ui/icons";
7
- import { useCopyToClipboard } from "../../hooks/use-copy-to-clipboard";
8
- import { cn } from "../../lib/utils";
9
-
10
- interface ChatMessageActionsProps extends React.ComponentProps<"div"> {
11
- message: Message;
12
- }
13
-
14
- export function ChatMessageActions({ message, className, ...props }: ChatMessageActionsProps) {
15
- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
16
-
17
- const onCopy = () => {
18
- if (isCopied) return;
19
- copyToClipboard(message.content);
20
- };
21
-
22
- return (
23
- <div
24
- className={cn(
25
- "flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0",
26
- className,
27
- )}
28
- {...props}
29
- >
30
- <Button variant="ghost" size="icon" onClick={onCopy}>
31
- {isCopied ? <IconCheck /> : <IconCopy />}
32
- <span className="sr-only">Copy message</span>
33
- </Button>
34
- </div>
35
- );
36
- }
@@ -1,70 +0,0 @@
1
- import { Message } from "@copilotkit/react-core";
2
- import remarkGfm from "remark-gfm";
3
- import remarkMath from "remark-math";
4
-
5
- import { cn } from "../../lib/utils";
6
- import { CodeBlock } from "./ui/codeblock";
7
- import { MemoizedReactMarkdown } from "./markdown";
8
- import { IconOpenAI, IconUser } from "./ui/icons";
9
- import { ChatMessageActions } from "./chat-message-actions";
10
-
11
- export interface ChatMessageProps {
12
- message: Message;
13
- }
14
-
15
- export function ChatMessage({ message, ...props }: ChatMessageProps) {
16
- return (
17
- <div className={cn("group relative mb-4 flex items-start")} {...props}>
18
- <div
19
- className={cn(
20
- "flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border shadow",
21
- message.role === "user" ? "bg-background" : "bg-primary text-primary-foreground",
22
- )}
23
- >
24
- {message.role === "user" ? <IconUser /> : <IconOpenAI />}
25
- </div>
26
- <div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">
27
- <MemoizedReactMarkdown
28
- className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 text-sm"
29
- remarkPlugins={[remarkGfm, remarkMath]}
30
- components={{
31
- p({ children }) {
32
- return <p className="mb-2 last:mb-0">{children}</p>;
33
- },
34
- code({ children, className, inline, ...props }) {
35
- if (children.length) {
36
- if (children[0] == "▍") {
37
- return <span className="mt-1 animate-pulse cursor-default">▍</span>;
38
- }
39
-
40
- children[0] = (children[0] as string).replace("`▍`", "▍");
41
- }
42
-
43
- const match = /language-(\w+)/.exec(className || "");
44
-
45
- if (inline) {
46
- return (
47
- <code className={className} {...props}>
48
- {children}
49
- </code>
50
- );
51
- }
52
-
53
- return (
54
- <CodeBlock
55
- key={Math.random()}
56
- language={(match && match[1]) || ""}
57
- value={String(children).replace(/\n$/, "")}
58
- {...props}
59
- />
60
- );
61
- },
62
- }}
63
- >
64
- {message.content}
65
- </MemoizedReactMarkdown>
66
- <ChatMessageActions message={message} />
67
- </div>
68
- </div>
69
- );
70
- }
@@ -1,64 +0,0 @@
1
- import { type UseChatHelpers } from "@copilotkit/react-core";
2
-
3
- import { Button } from "./ui/button";
4
- import { PromptForm } from "./prompt-form";
5
- import { IconRefresh, IconStop } from "./ui/icons";
6
- import { nanoid } from "nanoid";
7
-
8
- export interface ChatPanelProps
9
- extends Pick<
10
- UseChatHelpers,
11
- "append" | "isLoading" | "reload" | "messages" | "stop" | "input" | "setInput"
12
- > {
13
- id?: string;
14
- }
15
-
16
- export function ChatPanel({
17
- id,
18
- isLoading,
19
- stop,
20
- append,
21
- reload,
22
- input,
23
- setInput,
24
- messages,
25
- }: ChatPanelProps) {
26
- return (
27
- <div
28
- className="inset-x-0 bottom-0 bg-gradient-to-b from-muted/10 from-10% to-muted/30 to-50% mt-4 mb-8"
29
- style={{ width: "100%", overflow: "hidden", boxSizing: "border-box" }}
30
- >
31
- <div className="mx-auto sm:max-w-2xl sm:px-4">
32
- <div className="flex h-10 items-center justify-center mb-4">
33
- {isLoading ? (
34
- <Button variant="outline" onClick={() => stop()} className="bg-background">
35
- <IconStop className="mr-2" />
36
- Stop generating
37
- </Button>
38
- ) : (
39
- messages?.length > 0 && (
40
- <Button variant="outline" onClick={() => reload()} className="bg-background">
41
- <IconRefresh className="mr-2" />
42
- Regenerate response
43
- </Button>
44
- )
45
- )}
46
- </div>
47
- <div className="space-y-4 border-2 bg-background px-4 py-2 shadow-lg sm:rounded-xl md:py-4">
48
- <PromptForm
49
- onSubmit={async (value) => {
50
- await append({
51
- id: id || nanoid(),
52
- content: value,
53
- role: "user",
54
- });
55
- }}
56
- input={input}
57
- setInput={setInput}
58
- isLoading={isLoading}
59
- />
60
- </div>
61
- </div>
62
- </div>
63
- );
64
- }
@@ -1,29 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { useInView } from "react-intersection-observer";
5
-
6
- import { useAtBottom } from "../../hooks/use-at-bottom";
7
-
8
- interface ChatScrollAnchorProps {
9
- trackVisibility?: boolean;
10
- }
11
-
12
- export function ChatScrollAnchor({ trackVisibility }: ChatScrollAnchorProps) {
13
- const isAtBottom = useAtBottom();
14
- const { ref, entry, inView } = useInView({
15
- trackVisibility,
16
- delay: 100,
17
- rootMargin: "0px 0px -150px 0px",
18
- });
19
-
20
- React.useEffect(() => {
21
- if (isAtBottom && trackVisibility && !inView) {
22
- entry?.target.scrollIntoView({
23
- block: "start",
24
- });
25
- }
26
- }, [inView, entry, isAtBottom, trackVisibility]);
27
-
28
- return <div ref={ref} className="h-px w-full" />;
29
- }
@@ -1,72 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { useRouter } from "next/navigation";
5
- import { toast } from "react-hot-toast";
6
-
7
- import { ServerActionResult } from "../../types/types";
8
- import { Button } from "./ui/button";
9
- import {
10
- AlertDialog,
11
- AlertDialogAction,
12
- AlertDialogCancel,
13
- AlertDialogContent,
14
- AlertDialogDescription,
15
- AlertDialogFooter,
16
- AlertDialogHeader,
17
- AlertDialogTitle,
18
- AlertDialogTrigger,
19
- } from "./ui/alert-dialog";
20
- import { IconSpinner } from "./ui/icons";
21
-
22
- interface ClearHistoryProps {
23
- clearChats: () => ServerActionResult<void>;
24
- }
25
-
26
- export function ClearHistory({ clearChats }: ClearHistoryProps) {
27
- const [open, setOpen] = React.useState(false);
28
- const [isPending, startTransition] = React.useTransition();
29
- const router = useRouter();
30
-
31
- return (
32
- <AlertDialog open={open} onOpenChange={setOpen}>
33
- <AlertDialogTrigger asChild>
34
- <Button variant="ghost" disabled={isPending}>
35
- {isPending && <IconSpinner className="mr-2" />}
36
- Clear history
37
- </Button>
38
- </AlertDialogTrigger>
39
- <AlertDialogContent>
40
- <AlertDialogHeader>
41
- <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
42
- <AlertDialogDescription>
43
- This will permanently delete your chat history and remove your data from our servers.
44
- </AlertDialogDescription>
45
- </AlertDialogHeader>
46
- <AlertDialogFooter>
47
- <AlertDialogCancel disabled={isPending}>Cancel</AlertDialogCancel>
48
- <AlertDialogAction
49
- disabled={isPending}
50
- onClick={(event: any) => {
51
- event.preventDefault();
52
- startTransition(async () => {
53
- const result = await clearChats();
54
-
55
- if (result && "error" in result) {
56
- toast.error(result.error);
57
- return;
58
- }
59
-
60
- setOpen(false);
61
- router.push("/");
62
- });
63
- }}
64
- >
65
- {isPending && <IconSpinner className="mr-2 animate-spin" />}
66
- Delete
67
- </AlertDialogAction>
68
- </AlertDialogFooter>
69
- </AlertDialogContent>
70
- </AlertDialog>
71
- );
72
- }
@@ -1,57 +0,0 @@
1
- "use client";
2
-
3
- import React from "react";
4
-
5
- import { ChatList } from "./chat-list";
6
- import { ChatPanel } from "./chat-panel";
7
- import { DefaultEmptyScreen, EmptyScreenProps } from "./default-empty-screen";
8
- import { ChatScrollAnchor } from "./chat-scroll-anchor";
9
- import { UseCopilotChatOptions } from "@copilotkit/react-core";
10
- import { useCopilotChat } from "@copilotkit/react-core";
11
-
12
- interface ChatComponentInjectionsProps {
13
- EmptyScreen?: React.FC<EmptyScreenProps>;
14
- }
15
-
16
- interface CopilotChatProps extends UseCopilotChatOptions, ChatComponentInjectionsProps {}
17
-
18
- export function CopilotChat({
19
- id,
20
- initialMessages,
21
- makeSystemMessage,
22
- EmptyScreen = DefaultEmptyScreen,
23
- }: CopilotChatProps) {
24
- const { visibleMessages, append, reload, stop, isLoading, input, setInput } = useCopilotChat({
25
- id,
26
- initialMessages,
27
- makeSystemMessage,
28
- });
29
-
30
- return (
31
- <div className="w-full h-full flex flex-col overflow-hidden box-border items-start">
32
- <div className="pt-5 px-5 overflow-y-auto overflow-x-hidden w-full flex-grow">
33
- {visibleMessages.length ? (
34
- <div className="pl-0 pr-6">
35
- <ChatList messages={visibleMessages} />
36
- <ChatScrollAnchor trackVisibility={isLoading} />
37
- </div>
38
- ) : (
39
- <EmptyScreen setInput={setInput} />
40
- )}
41
- </div>
42
-
43
- <div className="flex-shrink-0 w-full">
44
- <ChatPanel
45
- id={id}
46
- isLoading={isLoading}
47
- stop={stop}
48
- append={append}
49
- reload={reload}
50
- messages={visibleMessages}
51
- input={input}
52
- setInput={setInput}
53
- />
54
- </div>
55
- </div>
56
- );
57
- }
@@ -1,57 +0,0 @@
1
- "use client";
2
- import React from "react";
3
-
4
- import { Button } from "./ui/button";
5
- import { ExternalLink } from "./external-link";
6
- import { IconArrowRight } from "./ui/icons";
7
-
8
- const exampleMessages = [
9
- {
10
- heading: "Explain technical concepts",
11
- message: `What is a "serverless function"?`,
12
- },
13
- {
14
- heading: "Summarize an article",
15
- message: "Summarize the following article for a 2nd grader: \n",
16
- },
17
- {
18
- heading: "Draft an email",
19
- message: `Draft an email to my boss about the following: \n`,
20
- },
21
- ];
22
-
23
- export interface EmptyScreenProps {
24
- setInput: React.Dispatch<React.SetStateAction<string>>;
25
- }
26
-
27
- export const DefaultEmptyScreen: React.FC<EmptyScreenProps> = (props) => {
28
- return (
29
- <div className="mx-auto max-w-2xl px-4">
30
- <div className="rounded-lg border bg-background p-8">
31
- <h1 className="mb-2 text-lg font-semibold">Welcome to CopilotKit! 👋</h1>
32
- <p className="mb-2 leading-normal text-muted-foreground">
33
- This is a Copilot built with{" "}
34
- <ExternalLink href="https://recursively.ai">recursively.ai's</ExternalLink>{" "}
35
- <ExternalLink href="https://github.com/RecursivelyAI/CopilotKit">CopilotKit</ExternalLink>{" "}
36
- .
37
- </p>
38
- <p className="leading-normal text-muted-foreground">
39
- You can start a conversation here or try the following examples:
40
- </p>
41
- <div className="mt-4 flex flex-col items-start space-y-2">
42
- {exampleMessages.map((message, index) => (
43
- <Button
44
- key={index}
45
- variant="link"
46
- className="h-auto p-0 text-base"
47
- onClick={() => props.setInput(message.message)}
48
- >
49
- <IconArrowRight className="mr-2 text-muted-foreground" />
50
- {message.heading}
51
- </Button>
52
- ))}
53
- </div>
54
- </div>
55
- </div>
56
- );
57
- };
@@ -1,17 +0,0 @@
1
- export function ExternalLink({ href, children }: { href: string; children: React.ReactNode }) {
2
- return (
3
- <a
4
- href={href}
5
- target="_blank"
6
- className="inline-flex flex-1 justify-center gap-1 leading-4 hover:underline"
7
- >
8
- <span>{children}</span>
9
- <svg aria-hidden="true" height="7" viewBox="0 0 6 6" width="7" className="opacity-70">
10
- <path
11
- d="M1.25215 5.54731L0.622742 4.9179L3.78169 1.75597H1.3834L1.38936 0.890915H5.27615V4.78069H4.40513L4.41109 2.38538L1.25215 5.54731Z"
12
- fill="currentColor"
13
- ></path>
14
- </svg>
15
- </a>
16
- );
17
- }
@@ -1,8 +0,0 @@
1
- import { FC, memo } from "react";
2
- import ReactMarkdown, { Options } from "react-markdown";
3
-
4
- export const MemoizedReactMarkdown: FC<Options> = memo(
5
- ReactMarkdown,
6
- (prevProps, nextProps) =>
7
- prevProps.children === nextProps.children && prevProps.className === nextProps.className,
8
- );
@@ -1,85 +0,0 @@
1
- import * as React from "react";
2
- import TextareaAutosize from "react-textarea-autosize";
3
- import { UseChatHelpers } from "@copilotkit/react-core";
4
-
5
- import { useEnterSubmit } from "../../hooks/use-enter-submit";
6
- import { cn } from "../../lib/utils";
7
- import { Button, buttonVariants } from "./ui/button";
8
- import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
9
- import { IconArrowElbow, IconPlus } from "./ui/icons";
10
- // import Link from "next/link";
11
-
12
- export interface PromptProps extends Pick<UseChatHelpers, "input" | "setInput"> {
13
- onSubmit: (value: string) => Promise<void>;
14
- isLoading: boolean;
15
- }
16
-
17
- export function PromptForm({ onSubmit, input, setInput, isLoading }: PromptProps) {
18
- const { formRef, onKeyDown } = useEnterSubmit();
19
- const inputRef = React.useRef<HTMLTextAreaElement>(null);
20
-
21
- React.useEffect(() => {
22
- if (inputRef.current) {
23
- inputRef.current.focus();
24
- }
25
- }, []);
26
-
27
- return (
28
- <form
29
- onSubmit={async (e) => {
30
- e.preventDefault();
31
- if (!input?.trim()) {
32
- return;
33
- }
34
- setInput("");
35
- await onSubmit(input);
36
- }}
37
- ref={formRef}
38
- >
39
- <div className="relative flex max-h-60 w-full grow flex-col overflow-hidden bg-background px-8 sm:rounded-md border sm:px-12">
40
- <Tooltip>
41
- <TooltipTrigger asChild>
42
- {/* <Link
43
- href="/"
44
- className={cn(
45
- buttonVariants({ size: "sm", variant: "outline" }),
46
- "absolute left-0 top-4 h-8 w-8 rounded-full bg-background p-0 sm:left-4"
47
- )}
48
- >
49
- <IconPlus />
50
- <span className="sr-only">New Chat</span>
51
- </Link> */}
52
- </TooltipTrigger>
53
- <TooltipContent>New Chat</TooltipContent>
54
- </Tooltip>
55
- <TextareaAutosize
56
- ref={inputRef}
57
- tabIndex={0}
58
- onKeyDown={onKeyDown}
59
- rows={1}
60
- value={input}
61
- onChange={(e) => setInput(e.target.value)}
62
- placeholder="Send a message."
63
- spellCheck={false}
64
- className="min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm"
65
- />
66
- <div className="absolute right-0 top-4 sm:right-4">
67
- <Tooltip>
68
- <TooltipTrigger asChild>
69
- <Button
70
- type="submit"
71
- size="icon"
72
- disabled={isLoading || input === ""}
73
- className=" bg-slate-300"
74
- >
75
- <IconArrowElbow />
76
- <span className="sr-only">Send message</span>
77
- </Button>
78
- </TooltipTrigger>
79
- <TooltipContent>Send message</TooltipContent>
80
- </Tooltip>
81
- </div>
82
- </div>
83
- </form>
84
- );
85
- }