@copilotkit/react-ui 0.22.0-multi-release-alpha.0 → 0.22.0-multi-feature-usecopilotreadable.4

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 (45) hide show
  1. package/.turbo/turbo-build.log +89 -93
  2. package/CHANGELOG.md +52 -4
  3. package/dist/components/chat/Button.mjs +6 -30
  4. package/dist/components/chat/Button.mjs.map +1 -1
  5. package/dist/components/chat/Chat.mjs +16 -1198
  6. package/dist/components/chat/Chat.mjs.map +1 -1
  7. package/dist/components/chat/ChatContext.mjs +7 -217
  8. package/dist/components/chat/ChatContext.mjs.map +1 -1
  9. package/dist/components/chat/CodeBlock.mjs +8 -483
  10. package/dist/components/chat/CodeBlock.mjs.map +1 -1
  11. package/dist/components/chat/Header.mjs +6 -23
  12. package/dist/components/chat/Header.mjs.map +1 -1
  13. package/dist/components/chat/Icons.mjs +14 -218
  14. package/dist/components/chat/Icons.mjs.map +1 -1
  15. package/dist/components/chat/Input.mjs +7 -116
  16. package/dist/components/chat/Input.mjs.map +1 -1
  17. package/dist/components/chat/Markdown.mjs +7 -547
  18. package/dist/components/chat/Markdown.mjs.map +1 -1
  19. package/dist/components/chat/Messages.mjs +9 -678
  20. package/dist/components/chat/Messages.mjs.map +1 -1
  21. package/dist/components/chat/Popup.mjs +17 -1207
  22. package/dist/components/chat/Popup.mjs.map +1 -1
  23. package/dist/components/chat/Response.mjs +6 -23
  24. package/dist/components/chat/Response.mjs.map +1 -1
  25. package/dist/components/chat/Sidebar.mjs +17 -1218
  26. package/dist/components/chat/Sidebar.mjs.map +1 -1
  27. package/dist/components/chat/Textarea.mjs +4 -48
  28. package/dist/components/chat/Textarea.mjs.map +1 -1
  29. package/dist/components/chat/Window.mjs +4 -105
  30. package/dist/components/chat/Window.mjs.map +1 -1
  31. package/dist/components/chat/index.mjs +24 -1225
  32. package/dist/components/chat/index.mjs.map +1 -1
  33. package/dist/components/chat/props.mjs +1 -0
  34. package/dist/components/index.mjs +25 -1225
  35. package/dist/components/index.mjs.map +1 -1
  36. package/dist/context/index.mjs +1 -0
  37. package/dist/hooks/index.mjs +1 -0
  38. package/dist/hooks/use-copy-to-clipboard.mjs +4 -21
  39. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
  40. package/dist/index.mjs +28 -1225
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/lib/utils.mjs +3 -20
  43. package/dist/lib/utils.mjs.map +1 -1
  44. package/dist/types/index.mjs +1 -0
  45. package/package.json +6 -6
@@ -1,486 +1,11 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
-
33
- // src/components/chat/CodeBlock.tsx
34
- import { memo } from "react";
35
- import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
36
-
37
- // src/hooks/use-copy-to-clipboard.tsx
38
- import * as React from "react";
39
- function useCopyToClipboard({ timeout = 2e3 }) {
40
- const [isCopied, setIsCopied] = React.useState(false);
41
- const copyToClipboard = (value) => {
42
- var _a;
43
- if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
44
- return;
45
- }
46
- if (!value) {
47
- return;
48
- }
49
- navigator.clipboard.writeText(value).then(() => {
50
- setIsCopied(true);
51
- setTimeout(() => {
52
- setIsCopied(false);
53
- }, timeout);
54
- });
55
- };
56
- return { isCopied, copyToClipboard };
57
- }
58
-
59
- // src/components/chat/Icons.tsx
60
- import { jsx, jsxs } from "react/jsx-runtime";
61
- function CheckIcon(_a) {
62
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
63
- return /* @__PURE__ */ jsx(
64
- "svg",
65
- __spreadProps(__spreadValues({
66
- xmlns: "http://www.w3.org/2000/svg",
67
- viewBox: "0 0 256 256",
68
- fill: "currentColor",
69
- style: { height: "1rem", width: "1rem" },
70
- className
71
- }, props), {
72
- children: /* @__PURE__ */ 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" })
73
- })
74
- );
75
- }
76
- function DownloadIcon(_a) {
77
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
78
- return /* @__PURE__ */ jsx(
79
- "svg",
80
- __spreadProps(__spreadValues({
81
- xmlns: "http://www.w3.org/2000/svg",
82
- viewBox: "0 0 256 256",
83
- fill: "currentColor",
84
- style: { height: "1rem", width: "1rem" },
85
- className
86
- }, props), {
87
- children: /* @__PURE__ */ 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" })
88
- })
89
- );
90
- }
91
- function CopyIcon(_a) {
92
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
93
- return /* @__PURE__ */ jsx(
94
- "svg",
95
- __spreadProps(__spreadValues({
96
- xmlns: "http://www.w3.org/2000/svg",
97
- viewBox: "0 0 256 256",
98
- fill: "currentColor",
99
- style: { height: "1rem", width: "1rem" },
100
- className
101
- }, props), {
102
- children: /* @__PURE__ */ 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" })
103
- })
104
- );
105
- }
106
-
107
- // src/components/chat/CodeBlock.tsx
108
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
109
- var programmingLanguages = {
110
- javascript: ".js",
111
- python: ".py",
112
- java: ".java",
113
- c: ".c",
114
- cpp: ".cpp",
115
- "c++": ".cpp",
116
- "c#": ".cs",
117
- ruby: ".rb",
118
- php: ".php",
119
- swift: ".swift",
120
- "objective-c": ".m",
121
- kotlin: ".kt",
122
- typescript: ".ts",
123
- go: ".go",
124
- perl: ".pl",
125
- rust: ".rs",
126
- scala: ".scala",
127
- haskell: ".hs",
128
- lua: ".lua",
129
- shell: ".sh",
130
- sql: ".sql",
131
- html: ".html",
132
- css: ".css"
133
- // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
134
- };
135
- var generateRandomString = (length, lowercase = false) => {
136
- const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789";
137
- let result = "";
138
- for (let i = 0; i < length; i++) {
139
- result += chars.charAt(Math.floor(Math.random() * chars.length));
140
- }
141
- return lowercase ? result.toLowerCase() : result;
142
- };
143
- var CodeBlock = memo(({ language, value }) => {
144
- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2e3 });
145
- const downloadAsFile = () => {
146
- if (typeof window === "undefined") {
147
- return;
148
- }
149
- const fileExtension = programmingLanguages[language] || ".file";
150
- const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;
151
- const fileName = window.prompt("Enter file name", suggestedFileName);
152
- if (!fileName) {
153
- return;
154
- }
155
- const blob = new Blob([value], { type: "text/plain" });
156
- const url = URL.createObjectURL(blob);
157
- const link = document.createElement("a");
158
- link.download = fileName;
159
- link.href = url;
160
- link.style.display = "none";
161
- document.body.appendChild(link);
162
- link.click();
163
- document.body.removeChild(link);
164
- URL.revokeObjectURL(url);
165
- };
166
- const onCopy = () => {
167
- if (isCopied)
168
- return;
169
- copyToClipboard(value);
170
- };
171
- return /* @__PURE__ */ jsxs2("div", { className: "copilotKitCodeBlock", children: [
172
- /* @__PURE__ */ jsxs2("div", { className: "copilotKitCodeBlockToolbar", children: [
173
- /* @__PURE__ */ jsx2("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
174
- /* @__PURE__ */ jsxs2("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
175
- /* @__PURE__ */ jsxs2("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
176
- /* @__PURE__ */ jsx2(DownloadIcon, {}),
177
- /* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Download" })
178
- ] }),
179
- /* @__PURE__ */ jsxs2("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
180
- isCopied ? /* @__PURE__ */ jsx2(CheckIcon, {}) : /* @__PURE__ */ jsx2(CopyIcon, {}),
181
- /* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Copy code" })
182
- ] })
183
- ] })
184
- ] }),
185
- /* @__PURE__ */ jsx2(
186
- SyntaxHighlighter,
187
- {
188
- language,
189
- style: highlightStyle,
190
- PreTag: "div",
191
- customStyle: {
192
- margin: 0,
193
- borderBottomLeftRadius: "0.375rem",
194
- borderBottomRightRadius: "0.375rem"
195
- },
196
- children: value
197
- }
198
- )
199
- ] });
200
- });
201
- CodeBlock.displayName = "CodeBlock";
202
- var highlightStyle = {
203
- 'pre[class*="language-"]': {
204
- color: "#d4d4d4",
205
- fontSize: "13px",
206
- textShadow: "none",
207
- fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
208
- direction: "ltr",
209
- textAlign: "left",
210
- whiteSpace: "pre",
211
- wordSpacing: "normal",
212
- wordBreak: "normal",
213
- lineHeight: "1.5",
214
- MozTabSize: "4",
215
- OTabSize: "4",
216
- tabSize: "4",
217
- WebkitHyphens: "none",
218
- MozHyphens: "none",
219
- msHyphens: "none",
220
- hyphens: "none",
221
- padding: "1em",
222
- margin: ".5em 0",
223
- overflow: "auto",
224
- background: "#1e1e1e"
225
- },
226
- 'code[class*="language-"]': {
227
- color: "#d4d4d4",
228
- fontSize: "13px",
229
- textShadow: "none",
230
- fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
231
- direction: "ltr",
232
- textAlign: "left",
233
- whiteSpace: "pre",
234
- wordSpacing: "normal",
235
- wordBreak: "normal",
236
- lineHeight: "1.5",
237
- MozTabSize: "4",
238
- OTabSize: "4",
239
- tabSize: "4",
240
- WebkitHyphens: "none",
241
- MozHyphens: "none",
242
- msHyphens: "none",
243
- hyphens: "none"
244
- },
245
- 'pre[class*="language-"]::selection': {
246
- textShadow: "none",
247
- background: "#264F78"
248
- },
249
- 'code[class*="language-"]::selection': {
250
- textShadow: "none",
251
- background: "#264F78"
252
- },
253
- 'pre[class*="language-"] *::selection': {
254
- textShadow: "none",
255
- background: "#264F78"
256
- },
257
- 'code[class*="language-"] *::selection': {
258
- textShadow: "none",
259
- background: "#264F78"
260
- },
261
- ':not(pre) > code[class*="language-"]': {
262
- padding: ".1em .3em",
263
- borderRadius: ".3em",
264
- color: "#db4c69",
265
- background: "#1e1e1e"
266
- },
267
- ".namespace": {
268
- Opacity: ".7"
269
- },
270
- "doctype.doctype-tag": {
271
- color: "#569CD6"
272
- },
273
- "doctype.name": {
274
- color: "#9cdcfe"
275
- },
276
- comment: {
277
- color: "#6a9955"
278
- },
279
- prolog: {
280
- color: "#6a9955"
281
- },
282
- punctuation: {
283
- color: "#d4d4d4"
284
- },
285
- ".language-html .language-css .token.punctuation": {
286
- color: "#d4d4d4"
287
- },
288
- ".language-html .language-javascript .token.punctuation": {
289
- color: "#d4d4d4"
290
- },
291
- property: {
292
- color: "#9cdcfe"
293
- },
294
- tag: {
295
- color: "#569cd6"
296
- },
297
- boolean: {
298
- color: "#569cd6"
299
- },
300
- number: {
301
- color: "#b5cea8"
302
- },
303
- constant: {
304
- color: "#9cdcfe"
305
- },
306
- symbol: {
307
- color: "#b5cea8"
308
- },
309
- inserted: {
310
- color: "#b5cea8"
311
- },
312
- unit: {
313
- color: "#b5cea8"
314
- },
315
- selector: {
316
- color: "#d7ba7d"
317
- },
318
- "attr-name": {
319
- color: "#9cdcfe"
320
- },
321
- string: {
322
- color: "#ce9178"
323
- },
324
- char: {
325
- color: "#ce9178"
326
- },
327
- builtin: {
328
- color: "#ce9178"
329
- },
330
- deleted: {
331
- color: "#ce9178"
332
- },
333
- ".language-css .token.string.url": {
334
- textDecoration: "underline"
335
- },
336
- operator: {
337
- color: "#d4d4d4"
338
- },
339
- entity: {
340
- color: "#569cd6"
341
- },
342
- "operator.arrow": {
343
- color: "#569CD6"
344
- },
345
- atrule: {
346
- color: "#ce9178"
347
- },
348
- "atrule.rule": {
349
- color: "#c586c0"
350
- },
351
- "atrule.url": {
352
- color: "#9cdcfe"
353
- },
354
- "atrule.url.function": {
355
- color: "#dcdcaa"
356
- },
357
- "atrule.url.punctuation": {
358
- color: "#d4d4d4"
359
- },
360
- keyword: {
361
- color: "#569CD6"
362
- },
363
- "keyword.module": {
364
- color: "#c586c0"
365
- },
366
- "keyword.control-flow": {
367
- color: "#c586c0"
368
- },
369
- function: {
370
- color: "#dcdcaa"
371
- },
372
- "function.maybe-class-name": {
373
- color: "#dcdcaa"
374
- },
375
- regex: {
376
- color: "#d16969"
377
- },
378
- important: {
379
- color: "#569cd6"
380
- },
381
- italic: {
382
- fontStyle: "italic"
383
- },
384
- "class-name": {
385
- color: "#4ec9b0"
386
- },
387
- "maybe-class-name": {
388
- color: "#4ec9b0"
389
- },
390
- console: {
391
- color: "#9cdcfe"
392
- },
393
- parameter: {
394
- color: "#9cdcfe"
395
- },
396
- interpolation: {
397
- color: "#9cdcfe"
398
- },
399
- "punctuation.interpolation-punctuation": {
400
- color: "#569cd6"
401
- },
402
- variable: {
403
- color: "#9cdcfe"
404
- },
405
- "imports.maybe-class-name": {
406
- color: "#9cdcfe"
407
- },
408
- "exports.maybe-class-name": {
409
- color: "#9cdcfe"
410
- },
411
- escape: {
412
- color: "#d7ba7d"
413
- },
414
- "tag.punctuation": {
415
- color: "#808080"
416
- },
417
- cdata: {
418
- color: "#808080"
419
- },
420
- "attr-value": {
421
- color: "#ce9178"
422
- },
423
- "attr-value.punctuation": {
424
- color: "#ce9178"
425
- },
426
- "attr-value.punctuation.attr-equals": {
427
- color: "#d4d4d4"
428
- },
429
- namespace: {
430
- color: "#4ec9b0"
431
- },
432
- 'pre[class*="language-javascript"]': {
433
- color: "#9cdcfe"
434
- },
435
- 'code[class*="language-javascript"]': {
436
- color: "#9cdcfe"
437
- },
438
- 'pre[class*="language-jsx"]': {
439
- color: "#9cdcfe"
440
- },
441
- 'code[class*="language-jsx"]': {
442
- color: "#9cdcfe"
443
- },
444
- 'pre[class*="language-typescript"]': {
445
- color: "#9cdcfe"
446
- },
447
- 'code[class*="language-typescript"]': {
448
- color: "#9cdcfe"
449
- },
450
- 'pre[class*="language-tsx"]': {
451
- color: "#9cdcfe"
452
- },
453
- 'code[class*="language-tsx"]': {
454
- color: "#9cdcfe"
455
- },
456
- 'pre[class*="language-css"]': {
457
- color: "#ce9178"
458
- },
459
- 'code[class*="language-css"]': {
460
- color: "#ce9178"
461
- },
462
- 'pre[class*="language-html"]': {
463
- color: "#d4d4d4"
464
- },
465
- 'code[class*="language-html"]': {
466
- color: "#d4d4d4"
467
- },
468
- ".language-regex .token.anchor": {
469
- color: "#dcdcaa"
470
- },
471
- ".language-html .token.punctuation": {
472
- color: "#808080"
473
- },
474
- 'pre[class*="language-"] > code[class*="language-"]': {
475
- position: "relative",
476
- zIndex: "1"
477
- },
478
- ".line-highlight.line-highlight": {
479
- background: "#f7ebc6",
480
- boxShadow: "inset 5px 0 0 #f7d87c",
481
- zIndex: "0"
482
- }
483
- };
1
+ import {
2
+ CodeBlock,
3
+ generateRandomString,
4
+ programmingLanguages
5
+ } from "../../chunk-MBYUBR3F.mjs";
6
+ import "../../chunk-7YXG7D47.mjs";
7
+ import "../../chunk-54JAUBUJ.mjs";
8
+ import "../../chunk-MRXNTQOX.mjs";
484
9
  export {
485
10
  CodeBlock,
486
11
  generateRandomString,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/chat/CodeBlock.tsx","../../../src/hooks/use-copy-to-clipboard.tsx","../../../src/components/chat/Icons.tsx"],"sourcesContent":["import { FC, memo } from \"react\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { useCopyToClipboard } from \"../../hooks/use-copy-to-clipboard\";\nimport { CheckIcon, CopyIcon, DownloadIcon } from \"./Icons\";\n\ninterface CodeActionButtonProps {\n onClick: () => void;\n children: React.ReactNode;\n}\n\ninterface Props {\n language: string;\n value: string;\n}\n\ninterface languageMap {\n [key: string]: string | undefined;\n}\n\nexport const programmingLanguages: languageMap = {\n javascript: \".js\",\n python: \".py\",\n java: \".java\",\n c: \".c\",\n cpp: \".cpp\",\n \"c++\": \".cpp\",\n \"c#\": \".cs\",\n ruby: \".rb\",\n php: \".php\",\n swift: \".swift\",\n \"objective-c\": \".m\",\n kotlin: \".kt\",\n typescript: \".ts\",\n go: \".go\",\n perl: \".pl\",\n rust: \".rs\",\n scala: \".scala\",\n haskell: \".hs\",\n lua: \".lua\",\n shell: \".sh\",\n sql: \".sql\",\n html: \".html\",\n css: \".css\",\n // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component\n};\n\nexport const generateRandomString = (length: number, lowercase = false) => {\n const chars = \"ABCDEFGHJKLMNPQRSTUVWXY3456789\"; // excluding similar looking characters like Z, 2, I, 1, O, 0\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return lowercase ? result.toLowerCase() : result;\n};\n\nconst CodeBlock: FC<Props> = memo(({ language, value }) => {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n\n const downloadAsFile = () => {\n if (typeof window === \"undefined\") {\n return;\n }\n const fileExtension = programmingLanguages[language] || \".file\";\n const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;\n const fileName = window.prompt(\"Enter file name\" || \"\", suggestedFileName);\n\n if (!fileName) {\n // User pressed cancel on prompt.\n return;\n }\n\n const blob = new Blob([value], { type: \"text/plain\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.style.display = \"none\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n };\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(value);\n };\n\n return (\n <div className=\"copilotKitCodeBlock\">\n <div className=\"copilotKitCodeBlockToolbar\">\n <span className=\"copilotKitCodeBlockToolbarLanguage\">{language}</span>\n <div className=\"copilotKitCodeBlockToolbarButtons\">\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={downloadAsFile}>\n <DownloadIcon />\n <span className=\"sr-only\">Download</span>\n </button>\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={onCopy}>\n {isCopied ? <CheckIcon /> : <CopyIcon />}\n <span className=\"sr-only\">Copy code</span>\n </button>\n </div>\n </div>\n <SyntaxHighlighter\n language={language}\n style={highlightStyle}\n PreTag=\"div\"\n customStyle={{\n margin: 0,\n borderBottomLeftRadius: \"0.375rem\",\n borderBottomRightRadius: \"0.375rem\",\n }}\n >\n {value}\n </SyntaxHighlighter>\n </div>\n );\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nexport { CodeBlock };\n\n// import { vscDarkPlus as highlightStyle } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n// As a workaround, we inline the vscDarkPlus from react-syntax-highlighter.\n// Importing it as recommended in the documentation leads to build errors in the non app router\n// (Next.js classic) setup.\nconst highlightStyle: any = {\n 'pre[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily: 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n padding: \"1em\",\n margin: \".5em 0\",\n overflow: \"auto\",\n background: \"#1e1e1e\",\n },\n 'code[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily: 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n },\n 'pre[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'pre[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n ':not(pre) > code[class*=\"language-\"]': {\n padding: \".1em .3em\",\n borderRadius: \".3em\",\n color: \"#db4c69\",\n background: \"#1e1e1e\",\n },\n \".namespace\": {\n Opacity: \".7\",\n },\n \"doctype.doctype-tag\": {\n color: \"#569CD6\",\n },\n \"doctype.name\": {\n color: \"#9cdcfe\",\n },\n comment: {\n color: \"#6a9955\",\n },\n prolog: {\n color: \"#6a9955\",\n },\n punctuation: {\n color: \"#d4d4d4\",\n },\n \".language-html .language-css .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n \".language-html .language-javascript .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n property: {\n color: \"#9cdcfe\",\n },\n tag: {\n color: \"#569cd6\",\n },\n boolean: {\n color: \"#569cd6\",\n },\n number: {\n color: \"#b5cea8\",\n },\n constant: {\n color: \"#9cdcfe\",\n },\n symbol: {\n color: \"#b5cea8\",\n },\n inserted: {\n color: \"#b5cea8\",\n },\n unit: {\n color: \"#b5cea8\",\n },\n selector: {\n color: \"#d7ba7d\",\n },\n \"attr-name\": {\n color: \"#9cdcfe\",\n },\n string: {\n color: \"#ce9178\",\n },\n char: {\n color: \"#ce9178\",\n },\n builtin: {\n color: \"#ce9178\",\n },\n deleted: {\n color: \"#ce9178\",\n },\n \".language-css .token.string.url\": {\n textDecoration: \"underline\",\n },\n operator: {\n color: \"#d4d4d4\",\n },\n entity: {\n color: \"#569cd6\",\n },\n \"operator.arrow\": {\n color: \"#569CD6\",\n },\n atrule: {\n color: \"#ce9178\",\n },\n \"atrule.rule\": {\n color: \"#c586c0\",\n },\n \"atrule.url\": {\n color: \"#9cdcfe\",\n },\n \"atrule.url.function\": {\n color: \"#dcdcaa\",\n },\n \"atrule.url.punctuation\": {\n color: \"#d4d4d4\",\n },\n keyword: {\n color: \"#569CD6\",\n },\n \"keyword.module\": {\n color: \"#c586c0\",\n },\n \"keyword.control-flow\": {\n color: \"#c586c0\",\n },\n function: {\n color: \"#dcdcaa\",\n },\n \"function.maybe-class-name\": {\n color: \"#dcdcaa\",\n },\n regex: {\n color: \"#d16969\",\n },\n important: {\n color: \"#569cd6\",\n },\n italic: {\n fontStyle: \"italic\",\n },\n \"class-name\": {\n color: \"#4ec9b0\",\n },\n \"maybe-class-name\": {\n color: \"#4ec9b0\",\n },\n console: {\n color: \"#9cdcfe\",\n },\n parameter: {\n color: \"#9cdcfe\",\n },\n interpolation: {\n color: \"#9cdcfe\",\n },\n \"punctuation.interpolation-punctuation\": {\n color: \"#569cd6\",\n },\n variable: {\n color: \"#9cdcfe\",\n },\n \"imports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n \"exports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n escape: {\n color: \"#d7ba7d\",\n },\n \"tag.punctuation\": {\n color: \"#808080\",\n },\n cdata: {\n color: \"#808080\",\n },\n \"attr-value\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation.attr-equals\": {\n color: \"#d4d4d4\",\n },\n namespace: {\n color: \"#4ec9b0\",\n },\n 'pre[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'code[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'pre[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n 'code[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n \".language-regex .token.anchor\": {\n color: \"#dcdcaa\",\n },\n \".language-html .token.punctuation\": {\n color: \"#808080\",\n },\n 'pre[class*=\"language-\"] > code[class*=\"language-\"]': {\n position: \"relative\",\n zIndex: \"1\",\n },\n \".line-highlight.line-highlight\": {\n background: \"#f7ebc6\",\n boxShadow: \"inset 5px 0 0 #f7d87c\",\n zIndex: \"0\",\n },\n};\n","import * as React from \"react\";\n\nexport interface useCopyToClipboardProps {\n timeout?: number;\n}\n\nexport function useCopyToClipboard({ timeout = 2000 }: useCopyToClipboardProps) {\n const [isCopied, setIsCopied] = React.useState<Boolean>(false);\n\n const copyToClipboard = (value: string) => {\n if (typeof window === \"undefined\" || !navigator.clipboard?.writeText) {\n return;\n }\n\n if (!value) {\n return;\n }\n\n navigator.clipboard.writeText(value).then(() => {\n setIsCopied(true);\n\n setTimeout(() => {\n setIsCopied(false);\n }, timeout);\n });\n };\n\n return { isCopied, copyToClipboard };\n}\n","import React from \"react\";\n\nexport const OpenIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <g transform=\"translate(24, 0) scale(-1, 1)\">\n <path\n fillRule=\"evenodd\"\n d=\"M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z\"\n clipRule=\"evenodd\"\n />\n </g>\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\" />\n </svg>\n);\n\nexport const HeaderCloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const SendIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5\"\n />\n </svg>\n);\n\nexport const SpinnerIcon = (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color: \"rgb(107 114 128)\",\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n\nexport const ActivityIcon = (\n <svg\n style={{\n display: \"inline-block\",\n marginLeft: \"0.25rem\",\n marginRight: \"0.25rem\",\n }}\n height=\"24\"\n width=\"24\"\n viewBox=\"0 0 27 27\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n >\n <circle className=\"copilotKitActivityDot1\" cx=\"4\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot2\" cx=\"12\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot3\" cx=\"20\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nexport function CheckIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <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\" />\n </svg>\n );\n}\n\nexport function DownloadIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <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\" />\n </svg>\n );\n}\n\nexport function CopyIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <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\" />\n </svg>\n );\n}\n\nexport const StopIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n);\n\nexport const RegenerateIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAa,YAAY;AACzB,SAAS,SAAS,yBAAyB;;;ACD3C,YAAY,WAAW;AAMhB,SAAS,mBAAmB,EAAE,UAAU,IAAK,GAA4B;AAC9E,QAAM,CAA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;AAAA,EACT;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,EACT;AAAA,EACA,qCAAqC;AAAA,IACnC,OAAO;AAAA,EACT;AAAA,EACA,sCAAsC;AAAA,IACpC,OAAO;AAAA,EACT;AAAA,EACA,8BAA8B;AAAA,IAC5B,OAAO;AAAA,EACT;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,EACT;AAAA,EACA,8BAA8B;AAAA,IAC5B,OAAO;AAAA,EACT;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,EACT;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,EACT;AAAA,EACA,gCAAgC;AAAA,IAC9B,OAAO;AAAA,EACT;AAAA,EACA,iCAAiC;AAAA,IAC/B,OAAO;AAAA,EACT;AAAA,EACA,qCAAqC;AAAA,IACnC,OAAO;AAAA,EACT;AAAA,EACA,sDAAsD;AAAA,IACpD,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,kCAAkC;AAAA,IAChC,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AACF;","names":["jsx","jsxs"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,26 +1,9 @@
1
- // src/components/chat/ChatContext.tsx
2
- import React, { useMemo } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- var ChatContext = React.createContext(void 0);
5
- function useChatContext() {
6
- const context = React.useContext(ChatContext);
7
- if (context === void 0) {
8
- throw new Error(
9
- "Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?"
10
- );
11
- }
12
- return context;
13
- }
14
-
15
- // src/components/chat/Header.tsx
16
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
17
- var Header = ({ setOpen }) => {
18
- const context = useChatContext();
19
- return /* @__PURE__ */ jsxs("div", { className: "copilotKitHeader", children: [
20
- /* @__PURE__ */ jsx2("div", { children: context.labels.title }),
21
- /* @__PURE__ */ jsx2("button", { onClick: () => setOpen(false), "aria-label": "Close", children: context.icons.headerCloseIcon })
22
- ] });
23
- };
1
+ import {
2
+ Header
3
+ } from "../../chunk-7JYUCW7H.mjs";
4
+ import "../../chunk-7LMXXGJT.mjs";
5
+ import "../../chunk-7YXG7D47.mjs";
6
+ import "../../chunk-MRXNTQOX.mjs";
24
7
  export {
25
8
  Header
26
9
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/chat/ChatContext.tsx","../../../src/components/chat/Header.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport * as DefaultIcons from \"./Icons\";\n\n/**\n * Icons for CopilotChat component.\n */\nexport interface CopilotChatIcons {\n /**\n * The icon to use for the open chat button.\n * @default <OpenIcon />\n */\n openIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button.\n * @default <CloseIcon />\n */\n closeIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button in the header.\n * @default <HeaderCloseIcon />\n */\n headerCloseIcon?: React.ReactNode;\n\n /**\n * The icon to use for the send button.\n * @default <SendIcon />\n */\n sendIcon?: React.ReactNode;\n\n /**\n * The icon to use for the activity indicator.\n * @default <ActivityIcon />\n */\n activityIcon?: React.ReactNode;\n\n /**\n * The icon to use for the spinner.\n * @default <SpinnerIcon />\n */\n spinnerIcon?: React.ReactNode;\n\n /**\n * The icon to use for the stop button.\n * @default <StopIcon />\n */\n stopIcon?: React.ReactNode;\n\n /**\n * The icon to use for the regenerate button.\n * @default <RegenerateIcon />\n */\n regenerateIcon?: React.ReactNode;\n}\n\n/**\n * Labels for CopilotChat component.\n */\nexport interface CopilotChatLabels {\n /**\n * The initial message(s) to display in the chat window.\n */\n initial?: string | string[];\n\n /**\n * The title to display in the header.\n * @default \"CopilotKit\"\n */\n title?: string;\n\n /**\n * The placeholder to display in the input.\n * @default \"Type a message...\"\n */\n placeholder?: string;\n\n /**\n * The message to display while the chat GPT is \"thinking\".\n * @default \"Thinking...\"\n */\n thinking?: string;\n\n /**\n * The message to display when an error occurs.\n * @default \"❌ An error occurred. Please try again.\"\n */\n error?: string;\n\n /**\n * The label to display on the stop button.\n * @default \"Stop generating\"\n */\n stopGenerating?: string;\n\n /**\n * The label to display on the regenerate button.\n * @default \"Regenerate response\"\n */\n regenerateResponse?: string;\n}\n\ninterface ChatContext {\n labels: Required<CopilotChatLabels>;\n icons: Required<CopilotChatIcons>;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContext = React.createContext<ChatContext | undefined>(undefined);\n\nexport function useChatContext(): ChatContext {\n const context = React.useContext(ChatContext);\n if (context === undefined) {\n throw new Error(\n \"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?\",\n );\n }\n return context;\n}\n\ninterface ChatContextProps {\n // temperature?: number;\n // instructions?: string;\n // maxFeedback?: number;\n labels?: CopilotChatLabels;\n icons?: CopilotChatIcons;\n children?: React.ReactNode;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContextProvider = ({\n // temperature,\n // instructions,\n // maxFeedback,\n labels,\n icons,\n children,\n open,\n setOpen,\n}: ChatContextProps) => {\n const context = useMemo(\n () => ({\n labels: {\n ...{\n initial: \"\",\n title: \"CopilotKit\",\n placeholder: \"Type a message...\",\n thinking: \"Thinking...\",\n error: \"❌ An error occurred. Please try again.\",\n stopGenerating: \"Stop generating\",\n regenerateResponse: \"Regenerate response\",\n },\n ...labels,\n },\n\n icons: {\n ...{\n openIcon: DefaultIcons.OpenIcon,\n closeIcon: DefaultIcons.CloseIcon,\n headerCloseIcon: DefaultIcons.HeaderCloseIcon,\n sendIcon: DefaultIcons.SendIcon,\n activityIcon: DefaultIcons.ActivityIcon,\n spinnerIcon: DefaultIcons.SpinnerIcon,\n stopIcon: DefaultIcons.StopIcon,\n regenerateIcon: DefaultIcons.RegenerateIcon,\n },\n icons,\n },\n open,\n setOpen,\n }),\n [labels, icons, open, setOpen],\n );\n return <ChatContext.Provider value={context}>{children}</ChatContext.Provider>;\n};\n","import { HeaderProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Header = ({ setOpen }: HeaderProps) => {\n const context = useChatContext();\n\n return (\n <div className=\"copilotKitHeader\">\n <div>{context.labels.title}</div>\n <button onClick={() => setOpen(false)} aria-label=\"Close\">\n {context.icons.headerCloseIcon}\n </button>\n </div>\n );\n};\n"],"mappings":";AAAA,OAAO,SAAS,eAAe;AA+KtB;AAlEF,IAAM,cAAc,MAAM,cAAuC,MAAS;AAE1E,SAAS,iBAA8B;AAC5C,QAAM,UAAU,MAAM,WAAW,WAAW;AAC5C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;;;AChHI,SACE,OAAAA,MADF;AAJG,IAAM,SAAS,CAAC,EAAE,QAAQ,MAAmB;AAClD,QAAM,UAAU,eAAe;AAE/B,SACE,qBAAC,SAAI,WAAU,oBACb;AAAA,oBAAAA,KAAC,SAAK,kBAAQ,OAAO,OAAM;AAAA,IAC3B,gBAAAA,KAAC,YAAO,SAAS,MAAM,QAAQ,KAAK,GAAG,cAAW,SAC/C,kBAAQ,MAAM,iBACjB;AAAA,KACF;AAEJ;","names":["jsx"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}