@copilotkit/react-ui 1.5.1-test-custom-tag-prerelease-1.0 → 1.5.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 (288) hide show
  1. package/CHANGELOG.md +61 -6
  2. package/package.json +4 -4
  3. package/dist/chunk-375NVWZM.mjs +0 -21
  4. package/dist/chunk-375NVWZM.mjs.map +0 -1
  5. package/dist/chunk-3E7HY2UN.mjs +0 -85
  6. package/dist/chunk-3E7HY2UN.mjs.map +0 -1
  7. package/dist/chunk-3XAXY2Z3.mjs +0 -18
  8. package/dist/chunk-3XAXY2Z3.mjs.map +0 -1
  9. package/dist/chunk-54JAUBUJ.mjs +0 -26
  10. package/dist/chunk-54JAUBUJ.mjs.map +0 -1
  11. package/dist/chunk-6INMITFA.mjs +0 -18
  12. package/dist/chunk-6INMITFA.mjs.map +0 -1
  13. package/dist/chunk-7II4YL7R.mjs +0 -170
  14. package/dist/chunk-7II4YL7R.mjs.map +0 -1
  15. package/dist/chunk-BH6PCAAL.mjs +0 -81
  16. package/dist/chunk-BH6PCAAL.mjs.map +0 -1
  17. package/dist/chunk-CBBFRI3Q.mjs +0 -81
  18. package/dist/chunk-CBBFRI3Q.mjs.map +0 -1
  19. package/dist/chunk-DCNCY2PL.mjs +0 -304
  20. package/dist/chunk-DCNCY2PL.mjs.map +0 -1
  21. package/dist/chunk-EFZPSZWO.mjs +0 -1
  22. package/dist/chunk-EFZPSZWO.mjs.map +0 -1
  23. package/dist/chunk-EMQEEXUB.mjs +0 -97
  24. package/dist/chunk-EMQEEXUB.mjs.map +0 -1
  25. package/dist/chunk-F2W5FD7L.mjs +0 -232
  26. package/dist/chunk-F2W5FD7L.mjs.map +0 -1
  27. package/dist/chunk-FZC7X5PK.mjs +0 -262
  28. package/dist/chunk-FZC7X5PK.mjs.map +0 -1
  29. package/dist/chunk-IU3WTXLQ.mjs +0 -1
  30. package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
  31. package/dist/chunk-KXE2JCUH.mjs +0 -1
  32. package/dist/chunk-KXE2JCUH.mjs.map +0 -1
  33. package/dist/chunk-MMVDU6DF.mjs +0 -1
  34. package/dist/chunk-MMVDU6DF.mjs.map +0 -1
  35. package/dist/chunk-MRFF7GSQ.mjs +0 -1
  36. package/dist/chunk-MRFF7GSQ.mjs.map +0 -1
  37. package/dist/chunk-MRXNTQOX.mjs +0 -59
  38. package/dist/chunk-MRXNTQOX.mjs.map +0 -1
  39. package/dist/chunk-OTPAZXVR.mjs +0 -92
  40. package/dist/chunk-OTPAZXVR.mjs.map +0 -1
  41. package/dist/chunk-PNQVKBPN.mjs +0 -146
  42. package/dist/chunk-PNQVKBPN.mjs.map +0 -1
  43. package/dist/chunk-RJCZRKTV.mjs +0 -106
  44. package/dist/chunk-RJCZRKTV.mjs.map +0 -1
  45. package/dist/chunk-RQNJNK2W.mjs +0 -25
  46. package/dist/chunk-RQNJNK2W.mjs.map +0 -1
  47. package/dist/chunk-RU73BEZM.mjs +0 -41
  48. package/dist/chunk-RU73BEZM.mjs.map +0 -1
  49. package/dist/chunk-S5MBUNGN.mjs +0 -140
  50. package/dist/chunk-S5MBUNGN.mjs.map +0 -1
  51. package/dist/chunk-T26KLXLH.mjs +0 -1
  52. package/dist/chunk-T26KLXLH.mjs.map +0 -1
  53. package/dist/chunk-TI7SY2RI.mjs +0 -164
  54. package/dist/chunk-TI7SY2RI.mjs.map +0 -1
  55. package/dist/chunk-UPTB2MVO.mjs +0 -395
  56. package/dist/chunk-UPTB2MVO.mjs.map +0 -1
  57. package/dist/chunk-UWVGLGFQ.mjs +0 -95
  58. package/dist/chunk-UWVGLGFQ.mjs.map +0 -1
  59. package/dist/chunk-V7W6IM2V.mjs +0 -1
  60. package/dist/chunk-V7W6IM2V.mjs.map +0 -1
  61. package/dist/chunk-VEC45H6Q.mjs +0 -18
  62. package/dist/chunk-VEC45H6Q.mjs.map +0 -1
  63. package/dist/chunk-WB3YULQ4.mjs +0 -1
  64. package/dist/chunk-WB3YULQ4.mjs.map +0 -1
  65. package/dist/chunk-WSMMTZCM.mjs +0 -30
  66. package/dist/chunk-WSMMTZCM.mjs.map +0 -1
  67. package/dist/chunk-YAGE7RCE.mjs +0 -118
  68. package/dist/chunk-YAGE7RCE.mjs.map +0 -1
  69. package/dist/chunk-YQ3D5IQV.mjs +0 -75
  70. package/dist/chunk-YQ3D5IQV.mjs.map +0 -1
  71. package/dist/chunk-YQFVRDNC.mjs +0 -53
  72. package/dist/chunk-YQFVRDNC.mjs.map +0 -1
  73. package/dist/chunk-Z2UZSN3K.mjs +0 -29
  74. package/dist/chunk-Z2UZSN3K.mjs.map +0 -1
  75. package/dist/chunk-ZABXREBH.mjs +0 -65
  76. package/dist/chunk-ZABXREBH.mjs.map +0 -1
  77. package/dist/components/chat/Button.d.ts +0 -7
  78. package/dist/components/chat/Button.js +0 -71
  79. package/dist/components/chat/Button.js.map +0 -1
  80. package/dist/components/chat/Button.mjs +0 -10
  81. package/dist/components/chat/Button.mjs.map +0 -1
  82. package/dist/components/chat/Chat.d.ts +0 -148
  83. package/dist/components/chat/Chat.js +0 -2427
  84. package/dist/components/chat/Chat.js.map +0 -1
  85. package/dist/components/chat/Chat.mjs +0 -34
  86. package/dist/components/chat/Chat.mjs.map +0 -1
  87. package/dist/components/chat/ChatContext.d.ts +0 -105
  88. package/dist/components/chat/ChatContext.js +0 -279
  89. package/dist/components/chat/ChatContext.js.map +0 -1
  90. package/dist/components/chat/ChatContext.mjs +0 -13
  91. package/dist/components/chat/ChatContext.mjs.map +0 -1
  92. package/dist/components/chat/CodeBlock.d.ts +0 -14
  93. package/dist/components/chat/CodeBlock.js +0 -523
  94. package/dist/components/chat/CodeBlock.js.map +0 -1
  95. package/dist/components/chat/CodeBlock.mjs +0 -14
  96. package/dist/components/chat/CodeBlock.mjs.map +0 -1
  97. package/dist/components/chat/Header.d.ts +0 -7
  98. package/dist/components/chat/Header.js +0 -64
  99. package/dist/components/chat/Header.js.map +0 -1
  100. package/dist/components/chat/Header.mjs +0 -10
  101. package/dist/components/chat/Header.mjs.map +0 -1
  102. package/dist/components/chat/Icons.d.ts +0 -18
  103. package/dist/components/chat/Icons.js +0 -321
  104. package/dist/components/chat/Icons.js.map +0 -1
  105. package/dist/components/chat/Icons.mjs +0 -32
  106. package/dist/components/chat/Icons.mjs.map +0 -1
  107. package/dist/components/chat/Input.d.ts +0 -7
  108. package/dist/components/chat/Input.js +0 -324
  109. package/dist/components/chat/Input.js.map +0 -1
  110. package/dist/components/chat/Input.mjs +0 -12
  111. package/dist/components/chat/Input.mjs.map +0 -1
  112. package/dist/components/chat/Markdown.d.ts +0 -8
  113. package/dist/components/chat/Markdown.js +0 -583
  114. package/dist/components/chat/Markdown.js.map +0 -1
  115. package/dist/components/chat/Markdown.mjs +0 -11
  116. package/dist/components/chat/Markdown.mjs.map +0 -1
  117. package/dist/components/chat/Messages.d.ts +0 -12
  118. package/dist/components/chat/Messages.js +0 -217
  119. package/dist/components/chat/Messages.js.map +0 -1
  120. package/dist/components/chat/Messages.mjs +0 -12
  121. package/dist/components/chat/Messages.mjs.map +0 -1
  122. package/dist/components/chat/Modal.d.ts +0 -51
  123. package/dist/components/chat/Modal.js +0 -2626
  124. package/dist/components/chat/Modal.js.map +0 -1
  125. package/dist/components/chat/Modal.mjs +0 -34
  126. package/dist/components/chat/Modal.mjs.map +0 -1
  127. package/dist/components/chat/Popup.d.ts +0 -13
  128. package/dist/components/chat/Popup.js +0 -2637
  129. package/dist/components/chat/Popup.js.map +0 -1
  130. package/dist/components/chat/Popup.mjs +0 -35
  131. package/dist/components/chat/Popup.mjs.map +0 -1
  132. package/dist/components/chat/Response.d.ts +0 -7
  133. package/dist/components/chat/Response.js +0 -64
  134. package/dist/components/chat/Response.js.map +0 -1
  135. package/dist/components/chat/Response.mjs +0 -10
  136. package/dist/components/chat/Response.mjs.map +0 -1
  137. package/dist/components/chat/Sidebar.d.ts +0 -13
  138. package/dist/components/chat/Sidebar.js +0 -2646
  139. package/dist/components/chat/Sidebar.js.map +0 -1
  140. package/dist/components/chat/Sidebar.mjs +0 -35
  141. package/dist/components/chat/Sidebar.mjs.map +0 -1
  142. package/dist/components/chat/Suggestion.d.ts +0 -14
  143. package/dist/components/chat/Suggestion.js +0 -181
  144. package/dist/components/chat/Suggestion.js.map +0 -1
  145. package/dist/components/chat/Suggestion.mjs +0 -11
  146. package/dist/components/chat/Suggestion.mjs.map +0 -1
  147. package/dist/components/chat/Textarea.d.ts +0 -13
  148. package/dist/components/chat/Textarea.js +0 -73
  149. package/dist/components/chat/Textarea.js.map +0 -1
  150. package/dist/components/chat/Textarea.mjs +0 -8
  151. package/dist/components/chat/Textarea.mjs.map +0 -1
  152. package/dist/components/chat/Window.d.ts +0 -7
  153. package/dist/components/chat/Window.js +0 -164
  154. package/dist/components/chat/Window.js.map +0 -1
  155. package/dist/components/chat/Window.mjs +0 -10
  156. package/dist/components/chat/Window.mjs.map +0 -1
  157. package/dist/components/chat/index.d.ts +0 -11
  158. package/dist/components/chat/index.js +0 -2661
  159. package/dist/components/chat/index.js.map +0 -1
  160. package/dist/components/chat/index.mjs +0 -47
  161. package/dist/components/chat/index.mjs.map +0 -1
  162. package/dist/components/chat/messages/RenderActionExecutionMessage.d.ts +0 -7
  163. package/dist/components/chat/messages/RenderActionExecutionMessage.js +0 -131
  164. package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +0 -1
  165. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +0 -10
  166. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs.map +0 -1
  167. package/dist/components/chat/messages/RenderAgentStateMessage.d.ts +0 -7
  168. package/dist/components/chat/messages/RenderAgentStateMessage.js +0 -111
  169. package/dist/components/chat/messages/RenderAgentStateMessage.js.map +0 -1
  170. package/dist/components/chat/messages/RenderAgentStateMessage.mjs +0 -10
  171. package/dist/components/chat/messages/RenderAgentStateMessage.mjs.map +0 -1
  172. package/dist/components/chat/messages/RenderResultMessage.d.ts +0 -7
  173. package/dist/components/chat/messages/RenderResultMessage.js +0 -64
  174. package/dist/components/chat/messages/RenderResultMessage.js.map +0 -1
  175. package/dist/components/chat/messages/RenderResultMessage.mjs +0 -10
  176. package/dist/components/chat/messages/RenderResultMessage.mjs.map +0 -1
  177. package/dist/components/chat/messages/RenderTextMessage.d.ts +0 -7
  178. package/dist/components/chat/messages/RenderTextMessage.js +0 -629
  179. package/dist/components/chat/messages/RenderTextMessage.js.map +0 -1
  180. package/dist/components/chat/messages/RenderTextMessage.mjs +0 -13
  181. package/dist/components/chat/messages/RenderTextMessage.mjs.map +0 -1
  182. package/dist/components/chat/props.d.ts +0 -46
  183. package/dist/components/chat/props.js +0 -19
  184. package/dist/components/chat/props.js.map +0 -1
  185. package/dist/components/chat/props.mjs +0 -2
  186. package/dist/components/chat/props.mjs.map +0 -1
  187. package/dist/components/dev-console/console.d.ts +0 -10
  188. package/dist/components/dev-console/console.js +0 -720
  189. package/dist/components/dev-console/console.js.map +0 -1
  190. package/dist/components/dev-console/console.mjs +0 -17
  191. package/dist/components/dev-console/console.mjs.map +0 -1
  192. package/dist/components/dev-console/icons.d.ts +0 -9
  193. package/dist/components/dev-console/icons.js +0 -120
  194. package/dist/components/dev-console/icons.js.map +0 -1
  195. package/dist/components/dev-console/icons.mjs +0 -16
  196. package/dist/components/dev-console/icons.mjs.map +0 -1
  197. package/dist/components/dev-console/index.d.ts +0 -5
  198. package/dist/components/dev-console/index.js +0 -720
  199. package/dist/components/dev-console/index.js.map +0 -1
  200. package/dist/components/dev-console/index.mjs +0 -18
  201. package/dist/components/dev-console/index.mjs.map +0 -1
  202. package/dist/components/dev-console/types.d.ts +0 -9
  203. package/dist/components/dev-console/types.js +0 -19
  204. package/dist/components/dev-console/types.js.map +0 -1
  205. package/dist/components/dev-console/types.mjs +0 -1
  206. package/dist/components/dev-console/types.mjs.map +0 -1
  207. package/dist/components/dev-console/utils.d.ts +0 -10
  208. package/dist/components/dev-console/utils.js +0 -188
  209. package/dist/components/dev-console/utils.js.map +0 -1
  210. package/dist/components/dev-console/utils.mjs +0 -16
  211. package/dist/components/dev-console/utils.mjs.map +0 -1
  212. package/dist/components/help-modal/icons.d.ts +0 -9
  213. package/dist/components/help-modal/icons.js +0 -107
  214. package/dist/components/help-modal/icons.js.map +0 -1
  215. package/dist/components/help-modal/icons.mjs +0 -12
  216. package/dist/components/help-modal/icons.mjs.map +0 -1
  217. package/dist/components/help-modal/index.d.ts +0 -2
  218. package/dist/components/help-modal/index.js +0 -255
  219. package/dist/components/help-modal/index.js.map +0 -1
  220. package/dist/components/help-modal/index.mjs +0 -10
  221. package/dist/components/help-modal/index.mjs.map +0 -1
  222. package/dist/components/help-modal/modal.d.ts +0 -5
  223. package/dist/components/help-modal/modal.js +0 -253
  224. package/dist/components/help-modal/modal.js.map +0 -1
  225. package/dist/components/help-modal/modal.mjs +0 -9
  226. package/dist/components/help-modal/modal.mjs.map +0 -1
  227. package/dist/components/index.d.ts +0 -14
  228. package/dist/components/index.js +0 -2665
  229. package/dist/components/index.js.map +0 -1
  230. package/dist/components/index.mjs +0 -54
  231. package/dist/components/index.mjs.map +0 -1
  232. package/dist/context/index.d.ts +0 -2
  233. package/dist/context/index.js +0 -19
  234. package/dist/context/index.js.map +0 -1
  235. package/dist/context/index.mjs +0 -2
  236. package/dist/context/index.mjs.map +0 -1
  237. package/dist/hooks/index.d.ts +0 -1
  238. package/dist/hooks/index.js +0 -55
  239. package/dist/hooks/index.js.map +0 -1
  240. package/dist/hooks/index.mjs +0 -9
  241. package/dist/hooks/index.mjs.map +0 -1
  242. package/dist/hooks/use-copilot-chat-suggestions.d.ts +0 -83
  243. package/dist/hooks/use-copilot-chat-suggestions.js +0 -53
  244. package/dist/hooks/use-copilot-chat-suggestions.js.map +0 -1
  245. package/dist/hooks/use-copilot-chat-suggestions.mjs +0 -8
  246. package/dist/hooks/use-copilot-chat-suggestions.mjs.map +0 -1
  247. package/dist/hooks/use-copy-to-clipboard.d.ts +0 -9
  248. package/dist/hooks/use-copy-to-clipboard.js +0 -60
  249. package/dist/hooks/use-copy-to-clipboard.js.map +0 -1
  250. package/dist/hooks/use-copy-to-clipboard.mjs +0 -8
  251. package/dist/hooks/use-copy-to-clipboard.mjs.map +0 -1
  252. package/dist/hooks/use-push-to-talk.d.ts +0 -19
  253. package/dist/hooks/use-push-to-talk.js +0 -195
  254. package/dist/hooks/use-push-to-talk.js.map +0 -1
  255. package/dist/hooks/use-push-to-talk.mjs +0 -12
  256. package/dist/hooks/use-push-to-talk.mjs.map +0 -1
  257. package/dist/index.css +0 -751
  258. package/dist/index.css.map +0 -1
  259. package/dist/index.d.ts +0 -16
  260. package/dist/index.js +0 -2693
  261. package/dist/index.js.map +0 -1
  262. package/dist/index.mjs +0 -62
  263. package/dist/index.mjs.map +0 -1
  264. package/dist/lib/utils.d.ts +0 -4
  265. package/dist/lib/utils.js +0 -76
  266. package/dist/lib/utils.js.map +0 -1
  267. package/dist/lib/utils.mjs +0 -34
  268. package/dist/lib/utils.mjs.map +0 -1
  269. package/dist/lib/utils.test.d.ts +0 -2
  270. package/dist/lib/utils.test.js +0 -9
  271. package/dist/lib/utils.test.js.map +0 -1
  272. package/dist/lib/utils.test.mjs +0 -7
  273. package/dist/lib/utils.test.mjs.map +0 -1
  274. package/dist/types/css.d.ts +0 -16
  275. package/dist/types/css.js +0 -19
  276. package/dist/types/css.js.map +0 -1
  277. package/dist/types/css.mjs +0 -1
  278. package/dist/types/css.mjs.map +0 -1
  279. package/dist/types/index.d.ts +0 -2
  280. package/dist/types/index.js +0 -19
  281. package/dist/types/index.js.map +0 -1
  282. package/dist/types/index.mjs +0 -2
  283. package/dist/types/index.mjs.map +0 -1
  284. package/dist/types/suggestions.d.ts +0 -8
  285. package/dist/types/suggestions.js +0 -19
  286. package/dist/types/suggestions.js.map +0 -1
  287. package/dist/types/suggestions.mjs +0 -1
  288. package/dist/types/suggestions.mjs.map +0 -1
@@ -1,629 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
- var __export = (target, all) => {
38
- for (var name in all)
39
- __defProp(target, name, { get: all[name], enumerable: true });
40
- };
41
- var __copyProps = (to, from, except, desc) => {
42
- if (from && typeof from === "object" || typeof from === "function") {
43
- for (let key of __getOwnPropNames(from))
44
- if (!__hasOwnProp.call(to, key) && key !== except)
45
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
- }
47
- return to;
48
- };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
- // If the importer is in node compatibility mode or this is not an ESM
51
- // file that has been converted to a CommonJS file using a Babel-
52
- // compatible transform (i.e. "__esModule" has not been set), then set
53
- // "default" to the CommonJS "module.exports" for node compatibility.
54
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
- mod
56
- ));
57
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
-
59
- // src/components/chat/messages/RenderTextMessage.tsx
60
- var RenderTextMessage_exports = {};
61
- __export(RenderTextMessage_exports, {
62
- RenderTextMessage: () => RenderTextMessage
63
- });
64
- module.exports = __toCommonJS(RenderTextMessage_exports);
65
-
66
- // src/components/chat/Markdown.tsx
67
- var import_react2 = require("react");
68
- var import_react_markdown = __toESM(require("react-markdown"));
69
-
70
- // src/components/chat/CodeBlock.tsx
71
- var import_react = require("react");
72
- var import_react_syntax_highlighter = require("react-syntax-highlighter");
73
-
74
- // src/hooks/use-copy-to-clipboard.tsx
75
- var React = __toESM(require("react"));
76
- function useCopyToClipboard({ timeout = 2e3 }) {
77
- const [isCopied, setIsCopied] = React.useState(false);
78
- const copyToClipboard = (value) => {
79
- var _a;
80
- if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
81
- return;
82
- }
83
- if (!value) {
84
- return;
85
- }
86
- navigator.clipboard.writeText(value).then(() => {
87
- setIsCopied(true);
88
- setTimeout(() => {
89
- setIsCopied(false);
90
- }, timeout);
91
- });
92
- };
93
- return { isCopied, copyToClipboard };
94
- }
95
-
96
- // src/components/chat/Icons.tsx
97
- var import_jsx_runtime = require("react/jsx-runtime");
98
- function CheckIcon(_a) {
99
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
100
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
- "svg",
102
- __spreadProps(__spreadValues({
103
- xmlns: "http://www.w3.org/2000/svg",
104
- viewBox: "0 0 256 256",
105
- fill: "currentColor",
106
- style: { height: "1rem", width: "1rem" },
107
- className
108
- }, props), {
109
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" })
110
- })
111
- );
112
- }
113
- function DownloadIcon(_a) {
114
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
115
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
- "svg",
117
- __spreadProps(__spreadValues({
118
- xmlns: "http://www.w3.org/2000/svg",
119
- viewBox: "0 0 256 256",
120
- fill: "currentColor",
121
- style: { height: "1rem", width: "1rem" },
122
- className
123
- }, props), {
124
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" })
125
- })
126
- );
127
- }
128
- function CopyIcon(_a) {
129
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
130
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
- "svg",
132
- __spreadProps(__spreadValues({
133
- xmlns: "http://www.w3.org/2000/svg",
134
- viewBox: "0 0 256 256",
135
- fill: "currentColor",
136
- style: { height: "1rem", width: "1rem" },
137
- className
138
- }, props), {
139
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" })
140
- })
141
- );
142
- }
143
-
144
- // src/components/chat/CodeBlock.tsx
145
- var import_jsx_runtime2 = require("react/jsx-runtime");
146
- var programmingLanguages = {
147
- javascript: ".js",
148
- python: ".py",
149
- java: ".java",
150
- c: ".c",
151
- cpp: ".cpp",
152
- "c++": ".cpp",
153
- "c#": ".cs",
154
- ruby: ".rb",
155
- php: ".php",
156
- swift: ".swift",
157
- "objective-c": ".m",
158
- kotlin: ".kt",
159
- typescript: ".ts",
160
- go: ".go",
161
- perl: ".pl",
162
- rust: ".rs",
163
- scala: ".scala",
164
- haskell: ".hs",
165
- lua: ".lua",
166
- shell: ".sh",
167
- sql: ".sql",
168
- html: ".html",
169
- css: ".css"
170
- // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
171
- };
172
- var generateRandomString = (length, lowercase = false) => {
173
- const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789";
174
- let result = "";
175
- for (let i = 0; i < length; i++) {
176
- result += chars.charAt(Math.floor(Math.random() * chars.length));
177
- }
178
- return lowercase ? result.toLowerCase() : result;
179
- };
180
- var CodeBlock = (0, import_react.memo)(({ language, value }) => {
181
- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2e3 });
182
- const downloadAsFile = () => {
183
- if (typeof window === "undefined") {
184
- return;
185
- }
186
- const fileExtension = programmingLanguages[language] || ".file";
187
- const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;
188
- const fileName = window.prompt("Enter file name", suggestedFileName);
189
- if (!fileName) {
190
- return;
191
- }
192
- const blob = new Blob([value], { type: "text/plain" });
193
- const url = URL.createObjectURL(blob);
194
- const link = document.createElement("a");
195
- link.download = fileName;
196
- link.href = url;
197
- link.style.display = "none";
198
- document.body.appendChild(link);
199
- link.click();
200
- document.body.removeChild(link);
201
- URL.revokeObjectURL(url);
202
- };
203
- const onCopy = () => {
204
- if (isCopied)
205
- return;
206
- copyToClipboard(value);
207
- };
208
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "copilotKitCodeBlock", children: [
209
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
210
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
211
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
212
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
213
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DownloadIcon, {}),
214
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Download" })
215
- ] }),
216
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
217
- isCopied ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyIcon, {}),
218
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Copy code" })
219
- ] })
220
- ] })
221
- ] }),
222
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
223
- import_react_syntax_highlighter.Prism,
224
- {
225
- language,
226
- style: highlightStyle,
227
- PreTag: "div",
228
- customStyle: {
229
- margin: 0,
230
- borderBottomLeftRadius: "0.375rem",
231
- borderBottomRightRadius: "0.375rem"
232
- },
233
- children: value
234
- }
235
- )
236
- ] });
237
- });
238
- CodeBlock.displayName = "CodeBlock";
239
- var highlightStyle = {
240
- 'pre[class*="language-"]': {
241
- color: "#d4d4d4",
242
- fontSize: "13px",
243
- textShadow: "none",
244
- fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
245
- direction: "ltr",
246
- textAlign: "left",
247
- whiteSpace: "pre",
248
- wordSpacing: "normal",
249
- wordBreak: "normal",
250
- lineHeight: "1.5",
251
- MozTabSize: "4",
252
- OTabSize: "4",
253
- tabSize: "4",
254
- WebkitHyphens: "none",
255
- MozHyphens: "none",
256
- msHyphens: "none",
257
- hyphens: "none",
258
- padding: "1em",
259
- margin: ".5em 0",
260
- overflow: "auto",
261
- background: "#1e1e1e"
262
- },
263
- 'code[class*="language-"]': {
264
- color: "#d4d4d4",
265
- fontSize: "13px",
266
- textShadow: "none",
267
- fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
268
- direction: "ltr",
269
- textAlign: "left",
270
- whiteSpace: "pre",
271
- wordSpacing: "normal",
272
- wordBreak: "normal",
273
- lineHeight: "1.5",
274
- MozTabSize: "4",
275
- OTabSize: "4",
276
- tabSize: "4",
277
- WebkitHyphens: "none",
278
- MozHyphens: "none",
279
- msHyphens: "none",
280
- hyphens: "none"
281
- },
282
- 'pre[class*="language-"]::selection': {
283
- textShadow: "none",
284
- background: "#264F78"
285
- },
286
- 'code[class*="language-"]::selection': {
287
- textShadow: "none",
288
- background: "#264F78"
289
- },
290
- 'pre[class*="language-"] *::selection': {
291
- textShadow: "none",
292
- background: "#264F78"
293
- },
294
- 'code[class*="language-"] *::selection': {
295
- textShadow: "none",
296
- background: "#264F78"
297
- },
298
- ':not(pre) > code[class*="language-"]': {
299
- padding: ".1em .3em",
300
- borderRadius: ".3em",
301
- color: "#db4c69",
302
- background: "#1e1e1e"
303
- },
304
- ".namespace": {
305
- Opacity: ".7"
306
- },
307
- "doctype.doctype-tag": {
308
- color: "#569CD6"
309
- },
310
- "doctype.name": {
311
- color: "#9cdcfe"
312
- },
313
- comment: {
314
- color: "#6a9955"
315
- },
316
- prolog: {
317
- color: "#6a9955"
318
- },
319
- punctuation: {
320
- color: "#d4d4d4"
321
- },
322
- ".language-html .language-css .token.punctuation": {
323
- color: "#d4d4d4"
324
- },
325
- ".language-html .language-javascript .token.punctuation": {
326
- color: "#d4d4d4"
327
- },
328
- property: {
329
- color: "#9cdcfe"
330
- },
331
- tag: {
332
- color: "#569cd6"
333
- },
334
- boolean: {
335
- color: "#569cd6"
336
- },
337
- number: {
338
- color: "#b5cea8"
339
- },
340
- constant: {
341
- color: "#9cdcfe"
342
- },
343
- symbol: {
344
- color: "#b5cea8"
345
- },
346
- inserted: {
347
- color: "#b5cea8"
348
- },
349
- unit: {
350
- color: "#b5cea8"
351
- },
352
- selector: {
353
- color: "#d7ba7d"
354
- },
355
- "attr-name": {
356
- color: "#9cdcfe"
357
- },
358
- string: {
359
- color: "#ce9178"
360
- },
361
- char: {
362
- color: "#ce9178"
363
- },
364
- builtin: {
365
- color: "#ce9178"
366
- },
367
- deleted: {
368
- color: "#ce9178"
369
- },
370
- ".language-css .token.string.url": {
371
- textDecoration: "underline"
372
- },
373
- operator: {
374
- color: "#d4d4d4"
375
- },
376
- entity: {
377
- color: "#569cd6"
378
- },
379
- "operator.arrow": {
380
- color: "#569CD6"
381
- },
382
- atrule: {
383
- color: "#ce9178"
384
- },
385
- "atrule.rule": {
386
- color: "#c586c0"
387
- },
388
- "atrule.url": {
389
- color: "#9cdcfe"
390
- },
391
- "atrule.url.function": {
392
- color: "#dcdcaa"
393
- },
394
- "atrule.url.punctuation": {
395
- color: "#d4d4d4"
396
- },
397
- keyword: {
398
- color: "#569CD6"
399
- },
400
- "keyword.module": {
401
- color: "#c586c0"
402
- },
403
- "keyword.control-flow": {
404
- color: "#c586c0"
405
- },
406
- function: {
407
- color: "#dcdcaa"
408
- },
409
- "function.maybe-class-name": {
410
- color: "#dcdcaa"
411
- },
412
- regex: {
413
- color: "#d16969"
414
- },
415
- important: {
416
- color: "#569cd6"
417
- },
418
- italic: {
419
- fontStyle: "italic"
420
- },
421
- "class-name": {
422
- color: "#4ec9b0"
423
- },
424
- "maybe-class-name": {
425
- color: "#4ec9b0"
426
- },
427
- console: {
428
- color: "#9cdcfe"
429
- },
430
- parameter: {
431
- color: "#9cdcfe"
432
- },
433
- interpolation: {
434
- color: "#9cdcfe"
435
- },
436
- "punctuation.interpolation-punctuation": {
437
- color: "#569cd6"
438
- },
439
- variable: {
440
- color: "#9cdcfe"
441
- },
442
- "imports.maybe-class-name": {
443
- color: "#9cdcfe"
444
- },
445
- "exports.maybe-class-name": {
446
- color: "#9cdcfe"
447
- },
448
- escape: {
449
- color: "#d7ba7d"
450
- },
451
- "tag.punctuation": {
452
- color: "#808080"
453
- },
454
- cdata: {
455
- color: "#808080"
456
- },
457
- "attr-value": {
458
- color: "#ce9178"
459
- },
460
- "attr-value.punctuation": {
461
- color: "#ce9178"
462
- },
463
- "attr-value.punctuation.attr-equals": {
464
- color: "#d4d4d4"
465
- },
466
- namespace: {
467
- color: "#4ec9b0"
468
- },
469
- 'pre[class*="language-javascript"]': {
470
- color: "#9cdcfe"
471
- },
472
- 'code[class*="language-javascript"]': {
473
- color: "#9cdcfe"
474
- },
475
- 'pre[class*="language-jsx"]': {
476
- color: "#9cdcfe"
477
- },
478
- 'code[class*="language-jsx"]': {
479
- color: "#9cdcfe"
480
- },
481
- 'pre[class*="language-typescript"]': {
482
- color: "#9cdcfe"
483
- },
484
- 'code[class*="language-typescript"]': {
485
- color: "#9cdcfe"
486
- },
487
- 'pre[class*="language-tsx"]': {
488
- color: "#9cdcfe"
489
- },
490
- 'code[class*="language-tsx"]': {
491
- color: "#9cdcfe"
492
- },
493
- 'pre[class*="language-css"]': {
494
- color: "#ce9178"
495
- },
496
- 'code[class*="language-css"]': {
497
- color: "#ce9178"
498
- },
499
- 'pre[class*="language-html"]': {
500
- color: "#d4d4d4"
501
- },
502
- 'code[class*="language-html"]': {
503
- color: "#d4d4d4"
504
- },
505
- ".language-regex .token.anchor": {
506
- color: "#dcdcaa"
507
- },
508
- ".language-html .token.punctuation": {
509
- color: "#808080"
510
- },
511
- 'pre[class*="language-"] > code[class*="language-"]': {
512
- position: "relative",
513
- zIndex: "1"
514
- },
515
- ".line-highlight.line-highlight": {
516
- background: "#f7ebc6",
517
- boxShadow: "inset 5px 0 0 #f7d87c",
518
- zIndex: "0"
519
- }
520
- };
521
-
522
- // src/components/chat/Markdown.tsx
523
- var import_remark_gfm = __toESM(require("remark-gfm"));
524
- var import_remark_math = __toESM(require("remark-math"));
525
- var import_jsx_runtime3 = require("react/jsx-runtime");
526
- var MemoizedReactMarkdown = (0, import_react2.memo)(
527
- import_react_markdown.default,
528
- (prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
529
- );
530
- var Markdown = ({ content }) => {
531
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "copilotKitMarkdown", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MemoizedReactMarkdown, { components, remarkPlugins: [import_remark_gfm.default, import_remark_math.default], children: content }) });
532
- };
533
- var components = {
534
- p({ children }) {
535
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children });
536
- },
537
- a(_a) {
538
- var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
539
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
540
- "a",
541
- __spreadProps(__spreadValues({
542
- style: { color: "blue", textDecoration: "underline" }
543
- }, props), {
544
- target: "_blank",
545
- rel: "noopener noreferrer",
546
- children
547
- })
548
- );
549
- },
550
- code(_c) {
551
- var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
552
- if (children.length) {
553
- if (children[0] == "\u258D") {
554
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
555
- "span",
556
- {
557
- style: {
558
- animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
559
- marginTop: "0.25rem"
560
- },
561
- children: "\u258D"
562
- }
563
- );
564
- }
565
- children[0] = children[0].replace("`\u258D`", "\u258D");
566
- }
567
- const match = /language-(\w+)/.exec(className || "");
568
- if (inline) {
569
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
570
- }
571
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
572
- CodeBlock,
573
- __spreadValues({
574
- language: match && match[1] || "",
575
- value: String(children).replace(/\n$/, "")
576
- }, props),
577
- Math.random()
578
- );
579
- }
580
- };
581
-
582
- // src/components/chat/ChatContext.tsx
583
- var import_react3 = __toESM(require("react"));
584
- var import_jsx_runtime4 = require("react/jsx-runtime");
585
- var ChatContext = import_react3.default.createContext(void 0);
586
- function useChatContext() {
587
- const context = import_react3.default.useContext(ChatContext);
588
- if (context === void 0) {
589
- throw new Error(
590
- "Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?"
591
- );
592
- }
593
- return context;
594
- }
595
-
596
- // src/components/chat/messages/RenderTextMessage.tsx
597
- var import_jsx_runtime5 = require("react/jsx-runtime");
598
- function RenderTextMessage(props) {
599
- const { message, inProgress, index, isCurrentMessage } = props;
600
- const { icons } = useChatContext();
601
- if (message.isTextMessage()) {
602
- if (message.role === "user") {
603
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
604
- "div",
605
- {
606
- "data-message-role": "user",
607
- className: "copilotKitMessage copilotKitUserMessage",
608
- children: message.content
609
- },
610
- index
611
- );
612
- } else if (message.role == "assistant") {
613
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
614
- "div",
615
- {
616
- "data-message-role": "assistant",
617
- className: `copilotKitMessage copilotKitAssistantMessage`,
618
- children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Markdown, { content: message.content })
619
- },
620
- index
621
- );
622
- }
623
- }
624
- }
625
- // Annotate the CommonJS export names for ESM import in node:
626
- 0 && (module.exports = {
627
- RenderTextMessage
628
- });
629
- //# sourceMappingURL=RenderTextMessage.js.map