@copilotkit/react-ui 0.16.0-alpha.1 → 0.17.0-demofixes.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.
- package/.turbo/turbo-build.log +118 -118
- package/CHANGELOG.md +40 -0
- package/dist/{chunk-NNVWLSYK.mjs → chunk-73OGJ3WL.mjs} +4 -4
- package/dist/chunk-73OGJ3WL.mjs.map +1 -0
- package/dist/{chunk-47SYBLI2.mjs → chunk-B7DNOYVQ.mjs} +4 -4
- package/dist/chunk-B7DNOYVQ.mjs.map +1 -0
- package/dist/{chunk-CKJXXQ2W.mjs → chunk-HPFHUPN6.mjs} +2 -2
- package/dist/{chunk-KBGIPFXA.mjs → chunk-K5V5Q2AF.mjs} +2 -2
- package/dist/components/chat/Button.mjs +30 -6
- package/dist/components/chat/Button.mjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +4 -4
- package/dist/components/chat/Chat.js +5 -5
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +830 -16
- package/dist/components/chat/Chat.mjs.map +1 -1
- package/dist/components/chat/ChatContext.mjs +214 -7
- package/dist/components/chat/ChatContext.mjs.map +1 -1
- package/dist/components/chat/CodeBlock.mjs +202 -8
- package/dist/components/chat/CodeBlock.mjs.map +1 -1
- package/dist/components/chat/Header.mjs +23 -6
- package/dist/components/chat/Header.mjs.map +1 -1
- package/dist/components/chat/Icons.mjs +218 -14
- package/dist/components/chat/Icons.mjs.map +1 -1
- package/dist/components/chat/Input.mjs +110 -7
- package/dist/components/chat/Input.mjs.map +1 -1
- package/dist/components/chat/Markdown.mjs +253 -7
- package/dist/components/chat/Markdown.mjs.map +1 -1
- package/dist/components/chat/Messages.mjs +329 -9
- package/dist/components/chat/Messages.mjs.map +1 -1
- package/dist/components/chat/Popup.js +5 -5
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +839 -17
- package/dist/components/chat/Popup.mjs.map +1 -1
- package/dist/components/chat/Response.mjs +23 -6
- package/dist/components/chat/Response.mjs.map +1 -1
- package/dist/components/chat/Sidebar.js +5 -5
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +853 -17
- package/dist/components/chat/Sidebar.mjs.map +1 -1
- package/dist/components/chat/Textarea.mjs +48 -4
- package/dist/components/chat/Textarea.mjs.map +1 -1
- package/dist/components/chat/Window.d.ts +1 -1
- package/dist/components/chat/Window.js +3 -3
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +105 -4
- package/dist/components/chat/Window.mjs.map +1 -1
- package/dist/components/chat/index.js +5 -5
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +860 -22
- package/dist/components/chat/index.mjs.map +1 -1
- package/dist/components/chat/props.d.ts +1 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/chat/props.mjs +0 -1
- package/dist/components/index.js +5 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +860 -23
- package/dist/components/index.mjs.map +1 -1
- package/dist/context/index.mjs +0 -1
- package/dist/hooks/index.mjs +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +22 -4
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +860 -26
- package/dist/index.mjs.map +1 -1
- package/dist/lib/utils.d.ts +1 -4
- package/dist/lib/utils.js +0 -7
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/utils.mjs +20 -9
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/types/index.mjs +0 -1
- package/package.json +6 -24
- package/src/components/chat/Chat.tsx +5 -5
- package/src/components/chat/Window.tsx +3 -3
- package/src/components/chat/props.ts +1 -1
- package/src/lib/utils.ts +0 -6
- package/dist/chunk-47SYBLI2.mjs.map +0 -1
- package/dist/chunk-NNVWLSYK.mjs.map +0 -1
- /package/dist/{chunk-CKJXXQ2W.mjs.map → chunk-HPFHUPN6.mjs.map} +0 -0
- /package/dist/{chunk-KBGIPFXA.mjs.map → chunk-K5V5Q2AF.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @copilotkit/react-ui@0.
|
|
2
|
+
> @copilotkit/react-ui@0.17.0-tools.0 build /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-ui
|
|
3
3
|
> tsup --clean
|
|
4
4
|
|
|
5
|
-
CLI Building entry: src/index.tsx, src/
|
|
5
|
+
CLI Building entry: src/index.tsx, src/context/index.ts, src/lib/utils.test.ts, src/lib/utils.ts, src/hooks/index.ts, src/hooks/use-copy-to-clipboard.tsx, src/types/index.ts, src/types/types.ts, src/components/index.ts, src/components/chat/Button.tsx, src/components/chat/Chat.tsx, src/components/chat/ChatContext.tsx, src/components/chat/CodeBlock.tsx, src/components/chat/Header.tsx, src/components/chat/Icons.tsx, src/components/chat/Input.tsx, src/components/chat/Markdown.tsx, src/components/chat/Messages.tsx, src/components/chat/Popup.tsx, src/components/chat/Response.tsx, src/components/chat/Sidebar.tsx, src/components/chat/Textarea.tsx, src/components/chat/Window.tsx, src/components/chat/index.tsx, src/components/chat/props.ts
|
|
6
6
|
CLI Using tsconfig: tsconfig.json
|
|
7
7
|
CLI tsup v6.7.0
|
|
8
8
|
CLI Using tsup config: /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-ui/tsup.config.ts
|
|
@@ -14,171 +14,171 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
14
14
|
npx update-browserslist-db@latest
|
|
15
15
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
16
16
|
DTS Build start
|
|
17
|
+
CJS dist/index.js 32.93 KB
|
|
17
18
|
CJS dist/lib/utils.test.js 182.00 B
|
|
18
|
-
CJS dist/index.js
|
|
19
|
+
CJS dist/context/index.js 803.00 B
|
|
20
|
+
CJS dist/hooks/index.js 797.00 B
|
|
21
|
+
CJS dist/components/index.js 32.96 KB
|
|
22
|
+
CJS dist/components/chat/Button.js 2.91 KB
|
|
19
23
|
CJS dist/types/types.js 797.00 B
|
|
20
|
-
CJS dist/index.css 19.37 KB
|
|
21
24
|
CJS dist/types/index.js 797.00 B
|
|
22
|
-
CJS dist/
|
|
23
|
-
CJS dist/components/chat/Chat.js 31.59 KB
|
|
24
|
-
CJS dist/hooks/use-copy-to-clipboard.js 2.32 KB
|
|
25
|
+
CJS dist/components/chat/Chat.js 31.60 KB
|
|
25
26
|
CJS dist/components/chat/CodeBlock.js 9.21 KB
|
|
26
|
-
CJS dist/components/index.js 32.95 KB
|
|
27
|
-
CJS dist/components/chat/Button.js 2.91 KB
|
|
28
27
|
CJS dist/components/chat/Header.js 2.63 KB
|
|
29
28
|
CJS dist/components/chat/Icons.js 9.51 KB
|
|
29
|
+
CJS dist/components/chat/Markdown.js 11.00 KB
|
|
30
|
+
CJS dist/components/chat/Input.js 5.26 KB
|
|
31
|
+
CJS dist/components/chat/Messages.js 13.97 KB
|
|
32
|
+
CJS dist/components/chat/Popup.js 32.00 KB
|
|
30
33
|
CJS dist/components/chat/Response.js 2.67 KB
|
|
31
|
-
CJS dist/components/chat/Popup.js 31.99 KB
|
|
32
34
|
CJS dist/components/chat/Textarea.js 2.51 KB
|
|
33
|
-
CJS dist/components/chat/Markdown.js 11.00 KB
|
|
34
|
-
CJS dist/components/chat/Sidebar.js 32.54 KB
|
|
35
35
|
CJS dist/components/chat/Window.js 5.46 KB
|
|
36
|
-
CJS dist/components/chat/index.js 32.
|
|
36
|
+
CJS dist/components/chat/index.js 32.95 KB
|
|
37
|
+
CJS dist/components/chat/Sidebar.js 32.55 KB
|
|
38
|
+
CJS dist/hooks/use-copy-to-clipboard.js 2.32 KB
|
|
39
|
+
CJS dist/index.css 19.37 KB
|
|
37
40
|
CJS dist/components/chat/props.js 807.00 B
|
|
38
|
-
CJS dist/hooks/index.js 797.00 B
|
|
39
41
|
CJS dist/components/chat/ChatContext.js 9.01 KB
|
|
40
|
-
CJS dist/
|
|
41
|
-
CJS dist/
|
|
42
|
-
CJS dist/context/index.js
|
|
43
|
-
CJS dist/index.js.map 51.19 KB
|
|
44
|
-
CJS dist/types/types.js.map 478.00 B
|
|
42
|
+
CJS dist/lib/utils.js 2.40 KB
|
|
43
|
+
CJS dist/index.js.map 51.22 KB
|
|
44
|
+
CJS dist/context/index.js.map 139.00 B
|
|
45
45
|
CJS dist/lib/utils.test.js.map 352.00 B
|
|
46
|
-
CJS dist/index.
|
|
47
|
-
CJS dist/
|
|
48
|
-
CJS dist/lib/utils.js.map 1.81 KB
|
|
49
|
-
CJS dist/components/chat/Chat.js.map 49.27 KB
|
|
50
|
-
CJS dist/hooks/use-copy-to-clipboard.js.map 1.23 KB
|
|
46
|
+
CJS dist/hooks/index.js.map 137.00 B
|
|
47
|
+
CJS dist/components/index.js.map 51.15 KB
|
|
51
48
|
CJS dist/components/chat/Button.js.map 5.70 KB
|
|
52
|
-
CJS dist/components/chat/
|
|
53
|
-
CJS dist/components/chat/Icons.js.map 8.55 KB
|
|
54
|
-
CJS dist/components/chat/Textarea.js.map 2.83 KB
|
|
55
|
-
CJS dist/components/chat/Header.js.map 5.19 KB
|
|
56
|
-
CJS dist/components/chat/Sidebar.js.map 50.60 KB
|
|
49
|
+
CJS dist/components/chat/Chat.js.map 49.30 KB
|
|
57
50
|
CJS dist/components/chat/Markdown.js.map 16.13 KB
|
|
58
|
-
CJS dist/components/chat/
|
|
59
|
-
CJS dist/components/chat/
|
|
60
|
-
CJS dist/components/chat/
|
|
61
|
-
CJS dist/hooks/index.js.map 137.00 B
|
|
51
|
+
CJS dist/components/chat/Header.js.map 5.19 KB
|
|
52
|
+
CJS dist/components/chat/Icons.js.map 8.55 KB
|
|
53
|
+
CJS dist/components/chat/Messages.js.map 25.57 KB
|
|
62
54
|
CJS dist/components/chat/Input.js.map 9.75 KB
|
|
63
|
-
CJS dist/components/
|
|
55
|
+
CJS dist/components/chat/CodeBlock.js.map 13.35 KB
|
|
56
|
+
CJS dist/components/chat/Response.js.map 5.27 KB
|
|
57
|
+
CJS dist/components/chat/index.js.map 51.29 KB
|
|
58
|
+
CJS dist/components/chat/Sidebar.js.map 50.62 KB
|
|
59
|
+
CJS dist/hooks/use-copy-to-clipboard.js.map 1.23 KB
|
|
60
|
+
CJS dist/index.css.map 30.37 KB
|
|
61
|
+
CJS dist/components/chat/props.js.map 884.00 B
|
|
62
|
+
CJS dist/components/chat/Textarea.js.map 2.83 KB
|
|
63
|
+
CJS dist/components/chat/Popup.js.map 49.80 KB
|
|
64
|
+
CJS dist/components/chat/Window.js.map 6.76 KB
|
|
65
|
+
CJS dist/types/types.js.map 478.00 B
|
|
66
|
+
CJS dist/types/index.js.map 137.00 B
|
|
64
67
|
CJS dist/components/chat/ChatContext.js.map 12.69 KB
|
|
65
|
-
CJS dist/
|
|
66
|
-
CJS
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
CJS dist/lib/utils.js.map 1.55 KB
|
|
69
|
+
CJS ⚡️ Build success in 591ms
|
|
70
|
+
ESM dist/components/chat/props.mjs 69.00 B
|
|
71
|
+
ESM dist/components/chat/Response.mjs 232.00 B
|
|
72
|
+
ESM dist/components/chat/Textarea.mjs 177.00 B
|
|
73
|
+
ESM dist/components/chat/Messages.mjs 325.00 B
|
|
74
|
+
ESM dist/components/chat/Window.mjs 144.00 B
|
|
75
|
+
ESM dist/components/chat/index.mjs 759.00 B
|
|
76
|
+
ESM dist/components/chat/Popup.mjs 610.00 B
|
|
77
|
+
ESM dist/components/chat/Sidebar.mjs 616.00 B
|
|
78
|
+
ESM dist/components/chat/Button.mjs 214.00 B
|
|
79
|
+
ESM dist/components/chat/ChatContext.mjs 276.00 B
|
|
80
|
+
ESM dist/components/chat/Chat.mjs 572.00 B
|
|
81
|
+
ESM dist/components/chat/CodeBlock.mjs 333.00 B
|
|
82
|
+
ESM dist/components/chat/Input.mjs 246.00 B
|
|
70
83
|
ESM dist/components/index.mjs 737.00 B
|
|
71
|
-
ESM dist/
|
|
72
|
-
ESM dist/chunk-KBGIPFXA.mjs 528.00 B
|
|
84
|
+
ESM dist/components/chat/Header.mjs 214.00 B
|
|
73
85
|
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
74
|
-
ESM dist/
|
|
86
|
+
ESM dist/chunk-P4GBO6MW.mjs 43.00 B
|
|
87
|
+
ESM dist/chunk-K5V5Q2AF.mjs 528.00 B
|
|
75
88
|
ESM dist/chunk-WB3YULQ4.mjs 43.00 B
|
|
76
|
-
ESM dist/chunk-
|
|
77
|
-
ESM dist/chunk-
|
|
78
|
-
ESM dist/
|
|
79
|
-
ESM dist/chunk-NNVWLSYK.mjs 2.40 KB
|
|
89
|
+
ESM dist/chunk-73OGJ3WL.mjs 2.41 KB
|
|
90
|
+
ESM dist/chunk-HPFHUPN6.mjs 1.01 KB
|
|
91
|
+
ESM dist/components/chat/Icons.mjs 439.00 B
|
|
80
92
|
ESM dist/chunk-Z34F3WLK.mjs 613.00 B
|
|
81
|
-
ESM dist/chunk-
|
|
93
|
+
ESM dist/chunk-B7DNOYVQ.mjs 3.80 KB
|
|
94
|
+
ESM dist/chunk-GWGHQNRI.mjs 1.84 KB
|
|
95
|
+
ESM dist/index.mjs 811.00 B
|
|
82
96
|
ESM dist/chunk-DPRH4HX3.mjs 3.55 KB
|
|
97
|
+
ESM dist/chunk-5O2MCJZ2.mjs 825.00 B
|
|
83
98
|
ESM dist/chunk-NYLOXKYT.mjs 1.63 KB
|
|
84
|
-
ESM dist/chunk-47SYBLI2.mjs 3.79 KB
|
|
85
99
|
ESM dist/chunk-WM6BS77F.mjs 1.54 KB
|
|
86
|
-
ESM dist/
|
|
87
|
-
ESM dist/chunk-7YXG7D47.mjs 6.52 KB
|
|
88
|
-
ESM dist/index.mjs 811.00 B
|
|
89
|
-
ESM dist/chunk-H4VKQGVU.mjs 43.00 B
|
|
100
|
+
ESM dist/context/index.mjs 66.00 B
|
|
90
101
|
ESM dist/chunk-UWPFPWAW.mjs 566.00 B
|
|
91
|
-
ESM dist/
|
|
92
|
-
ESM dist/chunk-
|
|
93
|
-
ESM dist/chunk-P4GBO6MW.mjs 43.00 B
|
|
94
|
-
ESM dist/lib/utils.mjs 1021.00 B
|
|
102
|
+
ESM dist/chunk-7YXG7D47.mjs 6.52 KB
|
|
103
|
+
ESM dist/chunk-IU3WTXLQ.mjs 43.00 B
|
|
95
104
|
ESM dist/lib/utils.test.mjs 168.00 B
|
|
96
|
-
ESM dist/
|
|
105
|
+
ESM dist/lib/utils.mjs 885.00 B
|
|
106
|
+
ESM dist/hooks/index.mjs 66.00 B
|
|
107
|
+
ESM dist/hooks/use-copy-to-clipboard.mjs 191.00 B
|
|
108
|
+
ESM dist/chunk-H4VKQGVU.mjs 43.00 B
|
|
109
|
+
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
97
110
|
ESM dist/types/types.mjs 34.00 B
|
|
111
|
+
ESM dist/chunk-7NSRDJ5C.mjs 43.00 B
|
|
98
112
|
ESM dist/index.css 19.37 KB
|
|
99
|
-
ESM dist/chunk-IU3WTXLQ.mjs 43.00 B
|
|
100
|
-
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
101
113
|
ESM dist/types/index.mjs 66.00 B
|
|
102
|
-
ESM dist/
|
|
103
|
-
ESM dist/
|
|
104
|
-
ESM dist/
|
|
105
|
-
ESM dist/components/chat/Window.mjs 144.00 B
|
|
106
|
-
ESM dist/components/chat/Textarea.mjs 177.00 B
|
|
114
|
+
ESM dist/chunk-OF66AL5Z.mjs 1.73 KB
|
|
115
|
+
ESM dist/chunk-POVINPXX.mjs 675.00 B
|
|
116
|
+
ESM dist/chunk-3M4HWSE7.mjs 2.31 KB
|
|
107
117
|
ESM dist/components/chat/Markdown.mjs 255.00 B
|
|
108
|
-
ESM dist/components/chat/
|
|
109
|
-
ESM dist/components/chat/
|
|
110
|
-
ESM dist/components/chat/
|
|
111
|
-
ESM dist/components/chat/
|
|
112
|
-
ESM dist/components/chat/
|
|
113
|
-
ESM dist/components/chat/
|
|
114
|
-
ESM dist/components/chat/
|
|
115
|
-
ESM dist/components/chat/Sidebar.mjs
|
|
116
|
-
ESM dist/components/chat/
|
|
117
|
-
ESM dist/components/chat/
|
|
118
|
+
ESM dist/components/chat/Response.mjs.map 71.00 B
|
|
119
|
+
ESM dist/components/chat/Messages.mjs.map 71.00 B
|
|
120
|
+
ESM dist/components/chat/Textarea.mjs.map 71.00 B
|
|
121
|
+
ESM dist/components/chat/Window.mjs.map 71.00 B
|
|
122
|
+
ESM dist/components/chat/index.mjs.map 71.00 B
|
|
123
|
+
ESM dist/components/chat/Popup.mjs.map 71.00 B
|
|
124
|
+
ESM dist/components/chat/Button.mjs.map 71.00 B
|
|
125
|
+
ESM dist/components/chat/Sidebar.mjs.map 71.00 B
|
|
126
|
+
ESM dist/components/chat/Input.mjs.map 71.00 B
|
|
127
|
+
ESM dist/components/chat/Chat.mjs.map 71.00 B
|
|
118
128
|
ESM dist/components/index.mjs.map 71.00 B
|
|
119
|
-
ESM dist/
|
|
129
|
+
ESM dist/chunk-P4GBO6MW.mjs.map 71.00 B
|
|
120
130
|
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
121
|
-
ESM dist/chunk-
|
|
122
|
-
ESM dist/
|
|
123
|
-
ESM dist/hooks/use-copy-to-clipboard.mjs.map 71.00 B
|
|
124
|
-
ESM dist/chunk-WB3YULQ4.mjs.map 71.00 B
|
|
125
|
-
ESM dist/chunk-DPRH4HX3.mjs.map 5.67 KB
|
|
131
|
+
ESM dist/chunk-K5V5Q2AF.mjs.map 549.00 B
|
|
132
|
+
ESM dist/components/chat/Icons.mjs.map 71.00 B
|
|
126
133
|
ESM dist/chunk-Z34F3WLK.mjs.map 854.00 B
|
|
127
|
-
ESM dist/chunk-
|
|
128
|
-
ESM dist/chunk-WM6BS77F.mjs.map 2.80 KB
|
|
134
|
+
ESM dist/chunk-B7DNOYVQ.mjs.map 6.70 KB
|
|
129
135
|
ESM dist/chunk-GWGHQNRI.mjs.map 2.76 KB
|
|
130
|
-
ESM dist/chunk-
|
|
131
|
-
ESM dist/chunk-47SYBLI2.mjs.map 6.69 KB
|
|
132
|
-
ESM dist/chunk-KBGIPFXA.mjs.map 549.00 B
|
|
133
|
-
ESM dist/chunk-7YXG7D47.mjs.map 8.44 KB
|
|
136
|
+
ESM dist/chunk-73OGJ3WL.mjs.map 6.53 KB
|
|
134
137
|
ESM dist/index.mjs.map 71.00 B
|
|
135
|
-
ESM dist/chunk-NYLOXKYT.mjs.map 2.53 KB
|
|
136
|
-
ESM dist/index.css.map 30.37 KB
|
|
137
138
|
ESM dist/chunk-5O2MCJZ2.mjs.map 1.26 KB
|
|
138
|
-
ESM dist/chunk-
|
|
139
|
-
ESM dist/chunk-
|
|
140
|
-
ESM dist/
|
|
141
|
-
ESM dist/
|
|
142
|
-
ESM dist/
|
|
139
|
+
ESM dist/chunk-NYLOXKYT.mjs.map 2.53 KB
|
|
140
|
+
ESM dist/chunk-WM6BS77F.mjs.map 2.80 KB
|
|
141
|
+
ESM dist/chunk-DPRH4HX3.mjs.map 5.67 KB
|
|
142
|
+
ESM dist/context/index.mjs.map 71.00 B
|
|
143
|
+
ESM dist/components/chat/props.mjs.map 71.00 B
|
|
144
|
+
ESM dist/lib/utils.test.mjs.map 350.00 B
|
|
145
|
+
ESM dist/chunk-WB3YULQ4.mjs.map 71.00 B
|
|
146
|
+
ESM dist/chunk-HPFHUPN6.mjs.map 1.36 KB
|
|
143
147
|
ESM dist/chunk-IU3WTXLQ.mjs.map 71.00 B
|
|
144
|
-
ESM dist/
|
|
145
|
-
ESM dist/
|
|
148
|
+
ESM dist/hooks/index.mjs.map 71.00 B
|
|
149
|
+
ESM dist/lib/utils.mjs.map 1.49 KB
|
|
146
150
|
ESM dist/chunk-MRXNTQOX.mjs.map 71.00 B
|
|
151
|
+
ESM dist/types/types.mjs.map 71.00 B
|
|
152
|
+
ESM dist/chunk-UWPFPWAW.mjs.map 773.00 B
|
|
153
|
+
ESM dist/index.css.map 30.37 KB
|
|
154
|
+
ESM dist/hooks/use-copy-to-clipboard.mjs.map 71.00 B
|
|
147
155
|
ESM dist/chunk-POVINPXX.mjs.map 1.18 KB
|
|
156
|
+
ESM dist/chunk-H4VKQGVU.mjs.map 71.00 B
|
|
148
157
|
ESM dist/types/index.mjs.map 71.00 B
|
|
149
|
-
ESM dist/
|
|
150
|
-
ESM dist/
|
|
151
|
-
ESM dist/components/chat/Response.mjs.map 71.00 B
|
|
152
|
-
ESM dist/components/chat/Window.mjs.map 71.00 B
|
|
153
|
-
ESM dist/components/chat/Button.mjs.map 71.00 B
|
|
154
|
-
ESM dist/components/chat/Markdown.mjs.map 71.00 B
|
|
158
|
+
ESM dist/chunk-7YXG7D47.mjs.map 8.44 KB
|
|
159
|
+
ESM dist/chunk-7NSRDJ5C.mjs.map 71.00 B
|
|
155
160
|
ESM dist/components/chat/Header.mjs.map 71.00 B
|
|
156
|
-
ESM dist/
|
|
157
|
-
ESM dist/
|
|
158
|
-
ESM dist/components/chat/
|
|
159
|
-
ESM dist/components/chat/Textarea.mjs.map 71.00 B
|
|
160
|
-
ESM dist/components/chat/index.mjs.map 71.00 B
|
|
161
|
-
ESM dist/components/chat/Sidebar.mjs.map 71.00 B
|
|
161
|
+
ESM dist/chunk-OF66AL5Z.mjs.map 4.97 KB
|
|
162
|
+
ESM dist/chunk-3M4HWSE7.mjs.map 5.04 KB
|
|
163
|
+
ESM dist/components/chat/Markdown.mjs.map 71.00 B
|
|
162
164
|
ESM dist/components/chat/ChatContext.mjs.map 71.00 B
|
|
163
|
-
ESM dist/components/chat/
|
|
164
|
-
ESM
|
|
165
|
-
|
|
166
|
-
ESM ⚡️ Build success in 368ms
|
|
167
|
-
DTS ⚡️ Build success in 2668ms
|
|
165
|
+
ESM dist/components/chat/CodeBlock.mjs.map 71.00 B
|
|
166
|
+
ESM ⚡️ Build success in 593ms
|
|
167
|
+
DTS ⚡️ Build success in 2205ms
|
|
168
168
|
DTS dist/index.d.ts 411.00 B
|
|
169
|
-
DTS dist/components/chat/props.d.ts
|
|
169
|
+
DTS dist/components/chat/props.d.ts 794.00 B
|
|
170
170
|
DTS dist/components/chat/Popup.d.ts 269.00 B
|
|
171
171
|
DTS dist/components/chat/Sidebar.d.ts 378.00 B
|
|
172
|
-
DTS dist/components/chat/Chat.d.ts 3.
|
|
172
|
+
DTS dist/components/chat/Chat.d.ts 3.36 KB
|
|
173
173
|
DTS dist/components/chat/ChatContext.d.ts 2.73 KB
|
|
174
|
-
DTS dist/components/index.d.ts 356.00 B
|
|
175
174
|
DTS dist/context/index.d.ts 12.00 B
|
|
175
|
+
DTS dist/lib/utils.test.d.ts 12.00 B
|
|
176
|
+
DTS dist/lib/utils.d.ts 263.00 B
|
|
176
177
|
DTS dist/hooks/index.d.ts 12.00 B
|
|
177
178
|
DTS dist/hooks/use-copy-to-clipboard.d.ts 266.00 B
|
|
178
|
-
DTS dist/lib/utils.test.d.ts 12.00 B
|
|
179
|
-
DTS dist/lib/utils.d.ts 357.00 B
|
|
180
179
|
DTS dist/types/index.d.ts 12.00 B
|
|
181
180
|
DTS dist/types/types.d.ts 351.00 B
|
|
181
|
+
DTS dist/components/index.d.ts 356.00 B
|
|
182
182
|
DTS dist/components/chat/Button.d.ts 163.00 B
|
|
183
183
|
DTS dist/components/chat/CodeBlock.d.ts 392.00 B
|
|
184
184
|
DTS dist/components/chat/Header.d.ts 157.00 B
|
|
@@ -188,5 +188,5 @@ DTS dist/components/chat/Markdown.d.ts 138.00 B
|
|
|
188
188
|
DTS dist/components/chat/Messages.d.ts 178.00 B
|
|
189
189
|
DTS dist/components/chat/Response.d.ts 201.00 B
|
|
190
190
|
DTS dist/components/chat/Textarea.d.ts 490.00 B
|
|
191
|
-
DTS dist/components/chat/Window.d.ts
|
|
191
|
+
DTS dist/components/chat/Window.d.ts 223.00 B
|
|
192
192
|
DTS dist/components/chat/index.d.ts 331.00 B
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 0.17.0-demofixes.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- helloworld to presentation, refactor audio gen to util
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @copilotkit/react-core@0.20.0-demofixes.1
|
|
13
|
+
- @copilotkit/shared@0.4.0-demofixes.1
|
|
14
|
+
|
|
15
|
+
## 0.17.0-tools.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Test the tools API
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @copilotkit/react-core@0.20.0-tools.0
|
|
25
|
+
- @copilotkit/shared@0.4.0-tools.0
|
|
26
|
+
|
|
27
|
+
## 0.16.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- node CopilotBackend support
|
|
32
|
+
- 58a8524: clean node example impl
|
|
33
|
+
- a34a226: node-native backend support
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- Updated dependencies [58a8524]
|
|
39
|
+
- Updated dependencies [a34a226]
|
|
40
|
+
- @copilotkit/react-core@0.19.0
|
|
41
|
+
- @copilotkit/shared@0.3.0
|
|
42
|
+
|
|
3
43
|
## 0.16.0-alpha.1
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-Z34F3WLK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Window
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-B7DNOYVQ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Button
|
|
12
12
|
} from "./chunk-5O2MCJZ2.mjs";
|
|
@@ -34,7 +34,7 @@ var CopilotChat = ({
|
|
|
34
34
|
clickOutsideToClose = true,
|
|
35
35
|
hitEscapeToClose = true,
|
|
36
36
|
onSetOpen,
|
|
37
|
-
|
|
37
|
+
shortcut = "e",
|
|
38
38
|
icons,
|
|
39
39
|
labels,
|
|
40
40
|
makeSystemMessage,
|
|
@@ -72,7 +72,7 @@ var CopilotChat = ({
|
|
|
72
72
|
open: openState,
|
|
73
73
|
setOpen,
|
|
74
74
|
clickOutsideToClose,
|
|
75
|
-
|
|
75
|
+
shortcut,
|
|
76
76
|
hitEscapeToClose,
|
|
77
77
|
children: [
|
|
78
78
|
/* @__PURE__ */ jsx(Header2, { open: openState, setOpen }),
|
|
@@ -87,4 +87,4 @@ var CopilotChat = ({
|
|
|
87
87
|
export {
|
|
88
88
|
CopilotChat
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-73OGJ3WL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Chat.tsx"],"sourcesContent":["import React from \"react\";\nimport { CopilotChatIcons, ChatContextProvider, CopilotChatLabels } from \"./ChatContext\";\nimport { SystemMessageFunction, useCopilotChat } from \"@copilotkit/react-core\";\nimport {\n ButtonProps,\n HeaderProps,\n WindowProps,\n MessagesProps,\n InputProps,\n ResponseButtonProps,\n} from \"./props\";\nimport { Window as DefaultWindow } from \"./Window\";\nimport { Button as DefaultButton } from \"./Button\";\nimport { Header as DefaultHeader } from \"./Header\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { nanoid } from \"nanoid\";\nimport { ResponseButton as DefaultResponseButton } from \"./Response\";\n\n/**\n * Props for CopilotChat component.\n */\nexport interface CopilotChatProps {\n /**\n * Custom instructions to be added to the system message. Use this property to\n * provide additional context or guidance to the language model, influencing\n * its responses. These instructions can include specific directions,\n * preferences, or criteria that the model should consider when generating\n * its output, thereby tailoring the conversation more precisely to the\n * user's needs or the application's requirements.\n */\n instructions?: string;\n\n /**\n * Whether the chat window should be open by default.\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * If the chat window should close when the user clicks outside of it.\n * @default true\n */\n clickOutsideToClose?: boolean;\n\n /**\n * If the chat window should close when the user hits the Escape key.\n * @default true\n */\n hitEscapeToClose?: boolean;\n\n /**\n * A callback that gets called when the chat window opens or closes.\n */\n onSetOpen?: (open: boolean) => void;\n\n /**\n * The shortcut key to open the chat window.\n * Uses Command-<shortcut> on a Mac and Ctrl-<shortcut> on Windows.\n * @default \"e\"\n */\n shortcut?: string;\n\n /**\n * Icons can be used to set custom icons for the chat window.\n */\n icons?: CopilotChatIcons;\n\n /**\n * Labels can be used to set custom labels for the chat window.\n */\n labels?: CopilotChatLabels;\n\n /**\n * A function that takes in context string and instructions and returns\n * the system message to include in the chat request.\n * Use this to completely override the system message, when providing\n * instructions is not enough.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * Whether to show the response button.\n * @default true\n */\n showResponseButton?: boolean;\n\n /**\n * A custom Window component to use instead of the default.\n */\n Window?: React.ComponentType<WindowProps>;\n\n /**\n * A custom Button component to use instead of the default.\n */\n Button?: React.ComponentType<ButtonProps>;\n\n /**\n * A custom Header component to use instead of the default.\n */\n Header?: React.ComponentType<HeaderProps>;\n\n /**\n * A custom Messages component to use instead of the default.\n */\n Messages?: React.ComponentType<MessagesProps>;\n\n /**\n * A custom Input component to use instead of the default.\n */\n Input?: React.ComponentType<InputProps>;\n\n /**\n * A custom ResponseButton component to use instead of the default.\n */\n ResponseButton?: React.ComponentType<ResponseButtonProps>;\n\n /**\n * A class name to apply to the root element.\n */\n className?: string;\n}\n\nexport const CopilotChat = ({\n instructions,\n defaultOpen = false,\n clickOutsideToClose = true,\n hitEscapeToClose = true,\n onSetOpen,\n shortcut = \"e\",\n icons,\n labels,\n makeSystemMessage,\n showResponseButton = true,\n Window = DefaultWindow,\n Button = DefaultButton,\n Header = DefaultHeader,\n Messages = DefaultMessages,\n Input = DefaultInput,\n ResponseButton = DefaultResponseButton,\n className,\n}: CopilotChatProps) => {\n const { visibleMessages, append, reload, stop, isLoading, input, setInput } = useCopilotChat({\n id: nanoid(),\n makeSystemMessage,\n additionalInstructions: instructions,\n });\n\n const [openState, setOpenState] = React.useState(defaultOpen);\n\n const setOpen = (open: boolean) => {\n onSetOpen?.(open);\n setOpenState(open);\n };\n\n const sendMessage = async (message: string) => {\n append({\n id: nanoid(),\n content: message,\n role: \"user\",\n });\n };\n\n return (\n <ChatContextProvider icons={icons} labels={labels}>\n <div className={className}>\n <Button open={openState} setOpen={setOpen}></Button>\n <Window\n open={openState}\n setOpen={setOpen}\n clickOutsideToClose={clickOutsideToClose}\n shortcut={shortcut}\n hitEscapeToClose={hitEscapeToClose}\n >\n <Header open={openState} setOpen={setOpen} />\n <Messages messages={visibleMessages} inProgress={isLoading} />\n <Input inProgress={isLoading} onSend={sendMessage}>\n {showResponseButton && visibleMessages.length > 0 && (\n <ResponseButton onClick={isLoading ? stop : reload} inProgress={isLoading} />\n )}\n </Input>\n </Window>\n </div>\n </ChatContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAElB,SAAgC,sBAAsB;AActD,SAAS,cAAc;AAsJf,cACA,YADA;AA3CD,IAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,QAAAA,UAAS;AAAA,EACT,QAAAC,UAAS;AAAA,EACT,QAAAC,UAAS;AAAA,EACT,UAAAC,YAAW;AAAA,EACX,OAAAC,SAAQ;AAAA,EACR,gBAAAC,kBAAiB;AAAA,EACjB;AACF,MAAwB;AACtB,QAAM,EAAE,iBAAiB,QAAQ,QAAQ,MAAM,WAAW,OAAO,SAAS,IAAI,eAAe;AAAA,IAC3F,IAAI,OAAO;AAAA,IACX;AAAA,IACA,wBAAwB;AAAA,EAC1B,CAAC;AAED,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,WAAW;AAE5D,QAAM,UAAU,CAAC,SAAkB;AACjC,2CAAY;AACZ,iBAAa,IAAI;AAAA,EACnB;AAEA,QAAM,cAAc,CAAO,YAAoB;AAC7C,WAAO;AAAA,MACL,IAAI,OAAO;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAEA,SACE,oBAAC,uBAAoB,OAAc,QACjC,+BAAC,SAAI,WACH;AAAA,wBAACJ,SAAA,EAAO,MAAM,WAAW,SAAkB;AAAA,IAC3C;AAAA,MAACD;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEA;AAAA,8BAACE,SAAA,EAAO,MAAM,WAAW,SAAkB;AAAA,UAC3C,oBAACC,WAAA,EAAS,UAAU,iBAAiB,YAAY,WAAW;AAAA,UAC5D,oBAACC,QAAA,EAAM,YAAY,WAAW,QAAQ,aACnC,gCAAsB,gBAAgB,SAAS,KAC9C,oBAACC,iBAAA,EAAe,SAAS,YAAY,OAAO,QAAQ,YAAY,WAAW,GAE/E;AAAA;AAAA;AAAA,IACF;AAAA,KACF,GACF;AAEJ;","names":["Window","Button","Header","Messages","Input","ResponseButton"]}
|
|
@@ -6,7 +6,7 @@ var Window = ({
|
|
|
6
6
|
setOpen,
|
|
7
7
|
children,
|
|
8
8
|
clickOutsideToClose,
|
|
9
|
-
|
|
9
|
+
shortcut,
|
|
10
10
|
hitEscapeToClose
|
|
11
11
|
}) => {
|
|
12
12
|
const windowRef = React.useRef(null);
|
|
@@ -31,11 +31,11 @@ var Window = ({
|
|
|
31
31
|
const isDescendantOfWrapper = (_a = windowRef.current) == null ? void 0 : _a.contains(target);
|
|
32
32
|
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
33
33
|
setOpen(false);
|
|
34
|
-
} else if (event.key ===
|
|
34
|
+
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
35
35
|
setOpen(!open);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
[hitEscapeToClose,
|
|
38
|
+
[hitEscapeToClose, shortcut, open, setOpen]
|
|
39
39
|
);
|
|
40
40
|
const adjustForMobile = useCallback(() => {
|
|
41
41
|
const copilotKitWindow = windowRef.current;
|
|
@@ -107,4 +107,4 @@ function isMacOS() {
|
|
|
107
107
|
export {
|
|
108
108
|
Window
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-B7DNOYVQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Window.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from \"react\";\nimport { WindowProps } from \"./props\";\n\nexport const Window = ({\n open,\n setOpen,\n children,\n clickOutsideToClose,\n shortcut,\n hitEscapeToClose,\n}: WindowProps) => {\n const windowRef = React.useRef<HTMLDivElement>(null);\n\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!clickOutsideToClose) {\n return;\n }\n\n const parentElement = windowRef.current?.parentElement;\n\n if (open && parentElement && !parentElement.contains(event.target as any)) {\n setOpen(false);\n }\n },\n [clickOutsideToClose, open, setOpen],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isInput =\n target.tagName === \"INPUT\" ||\n target.tagName === \"SELECT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable;\n\n const isDescendantOfWrapper = windowRef.current?.contains(target);\n\n if (\n open &&\n event.key === \"Escape\" &&\n (!isInput || isDescendantOfWrapper) &&\n hitEscapeToClose\n ) {\n setOpen(false);\n } else if (\n event.key === shortcut &&\n ((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&\n (!isInput || isDescendantOfWrapper)\n ) {\n setOpen(!open);\n }\n },\n [hitEscapeToClose, shortcut, open, setOpen],\n );\n\n const adjustForMobile = useCallback(() => {\n const copilotKitWindow = windowRef.current;\n const vv = window.visualViewport;\n if (!copilotKitWindow || !vv) {\n return;\n }\n\n if (window.innerWidth < 640 && open) {\n copilotKitWindow.style.height = `${vv.height}px`;\n copilotKitWindow.style.left = `${vv.offsetLeft}px`;\n copilotKitWindow.style.top = `${vv.offsetTop}px`;\n\n document.body.style.position = \"fixed\";\n document.body.style.width = \"100%\";\n document.body.style.height = `${window.innerHeight}px`;\n document.body.style.overflow = \"hidden\";\n document.body.style.touchAction = \"none\";\n\n // Prevent scrolling on iOS\n document.body.addEventListener(\"touchmove\", preventScroll, {\n passive: false,\n });\n } else {\n copilotKitWindow.style.height = \"\";\n copilotKitWindow.style.left = \"\";\n copilotKitWindow.style.top = \"\";\n document.body.style.position = \"\";\n document.body.style.height = \"\";\n document.body.style.width = \"\";\n document.body.style.overflow = \"\";\n document.body.style.top = \"\";\n document.body.style.touchAction = \"\";\n\n document.body.removeEventListener(\"touchmove\", preventScroll);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.addEventListener(\"resize\", adjustForMobile);\n adjustForMobile();\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.removeEventListener(\"resize\", adjustForMobile);\n }\n };\n }, [adjustForMobile, handleClickOutside, handleKeyDown]);\n\n return (\n <div className={`copilotKitWindow${open ? \" open\" : \"\"}`} ref={windowRef}>\n {children}\n </div>\n );\n};\n\nconst preventScroll = (event: TouchEvent): void => {\n let targetElement = event.target as Element;\n\n // Function to check if the target has the parent with a given class\n const hasParentWithClass = (element: Element, className: string): boolean => {\n while (element && element !== document.body) {\n if (element.classList.contains(className)) {\n return true;\n }\n element = element.parentElement!;\n }\n return false;\n };\n\n // Check if the target of the touch event is inside an element with the 'copilotKitMessages' class\n if (!hasParentWithClass(targetElement, \"copilotKitMessages\")) {\n event.preventDefault();\n }\n};\n\nfunction isMacOS() {\n return /Mac|iMac|Macintosh/i.test(navigator.userAgent);\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-73OGJ3WL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -30,4 +30,4 @@ var CopilotSidebar = (props) => {
|
|
|
30
30
|
export {
|
|
31
31
|
CopilotSidebar
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-HPFHUPN6.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-73OGJ3WL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -18,4 +18,4 @@ var CopilotPopup = (props) => {
|
|
|
18
18
|
export {
|
|
19
19
|
CopilotPopup
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-K5V5Q2AF.mjs.map
|
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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/Button.tsx
|
|
16
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var Button = ({ open, setOpen }) => {
|
|
18
|
+
const context = useChatContext();
|
|
19
|
+
return /* @__PURE__ */ jsx2("div", { onClick: () => setOpen(!open), children: /* @__PURE__ */ jsxs(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
className: `copilotKitButton ${open ? "open" : ""}`,
|
|
23
|
+
"aria-label": open ? "Close Chat" : "Open Chat",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx2("div", { className: "copilotKitButtonIcon copilotKitButtonIconOpen", children: context.icons.openIcon }),
|
|
26
|
+
/* @__PURE__ */ jsx2("div", { className: "copilotKitButtonIcon copilotKitButtonIconClose", children: context.icons.closeIcon })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
};
|
|
7
31
|
export {
|
|
8
32
|
Button
|
|
9
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat/ChatContext.tsx","../../../src/components/chat/Button.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 the chat is done executing a function.\n * @default \"✅ Done\"\n */\n done?: 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}\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}\n\nexport const ChatContextProvider = ({\n // temperature,\n // instructions,\n // maxFeedback,\n labels,\n icons,\n children,\n}: ChatContextProps) => {\n const context = useMemo(\n () => ({\n labels: {\n ...{\n initial: \"\",\n title: \"CopilotKit\",\n placeholder: \"Type a message...\",\n thinking: \"Thinking...\",\n done: \"✅ Done\",\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 }),\n [labels, icons],\n );\n return <ChatContext.Provider value={context}>{children}</ChatContext.Provider>;\n};\n","import { ButtonProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Button = ({ open, setOpen }: ButtonProps) => {\n const context = useChatContext();\n // To ensure that the mouse handler fires even when the button is scaled down\n // we wrap the button in a div and attach the handler to the div\n return (\n <div onClick={() => setOpen(!open)}>\n <button\n className={`copilotKitButton ${open ? \"open\" : \"\"}`}\n aria-label={open ? \"Close Chat\" : \"Open Chat\"}\n >\n <div className=\"copilotKitButtonIcon copilotKitButtonIconOpen\">\n {context.icons.openIcon}\n </div>\n <div className=\"copilotKitButtonIcon copilotKitButtonIconClose\">\n {context.icons.closeIcon}\n </div>\n </button>\n </div>\n );\n};\n"],"mappings":";AAAA,OAAO,SAAS,eAAe;AA8KtB;AA7DF,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;;;AClHM,SAIE,OAAAA,MAJF;AANC,IAAM,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAmB;AACxD,QAAM,UAAU,eAAe;AAG/B,SACE,gBAAAA,KAAC,SAAI,SAAS,MAAM,QAAQ,CAAC,IAAI,GAC/B;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,oBAAoB,OAAO,SAAS;AAAA,MAC/C,cAAY,OAAO,eAAe;AAAA,MAElC;AAAA,wBAAAA,KAAC,SAAI,WAAU,iDACZ,kBAAQ,MAAM,UACjB;AAAA,QACA,gBAAAA,KAAC,SAAI,WAAU,kDACZ,kBAAQ,MAAM,WACjB;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":["jsx"]}
|
|
@@ -37,11 +37,11 @@ interface CopilotChatProps {
|
|
|
37
37
|
*/
|
|
38
38
|
onSetOpen?: (open: boolean) => void;
|
|
39
39
|
/**
|
|
40
|
-
* The
|
|
41
|
-
* Uses Command-<
|
|
40
|
+
* The shortcut key to open the chat window.
|
|
41
|
+
* Uses Command-<shortcut> on a Mac and Ctrl-<shortcut> on Windows.
|
|
42
42
|
* @default "e"
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
shortcut?: string;
|
|
45
45
|
/**
|
|
46
46
|
* Icons can be used to set custom icons for the chat window.
|
|
47
47
|
*/
|
|
@@ -91,6 +91,6 @@ interface CopilotChatProps {
|
|
|
91
91
|
*/
|
|
92
92
|
className?: string;
|
|
93
93
|
}
|
|
94
|
-
declare const CopilotChat: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen,
|
|
94
|
+
declare const CopilotChat: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen, shortcut, icons, labels, makeSystemMessage, showResponseButton, Window, Button, Header, Messages, Input, ResponseButton, className, }: CopilotChatProps) => JSX.Element;
|
|
95
95
|
|
|
96
96
|
export { CopilotChat, CopilotChatProps };
|
|
@@ -335,7 +335,7 @@ var Window = ({
|
|
|
335
335
|
setOpen,
|
|
336
336
|
children,
|
|
337
337
|
clickOutsideToClose,
|
|
338
|
-
|
|
338
|
+
shortcut,
|
|
339
339
|
hitEscapeToClose
|
|
340
340
|
}) => {
|
|
341
341
|
const windowRef = import_react2.default.useRef(null);
|
|
@@ -360,11 +360,11 @@ var Window = ({
|
|
|
360
360
|
const isDescendantOfWrapper = (_a = windowRef.current) == null ? void 0 : _a.contains(target);
|
|
361
361
|
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
362
362
|
setOpen(false);
|
|
363
|
-
} else if (event.key ===
|
|
363
|
+
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
364
364
|
setOpen(!open);
|
|
365
365
|
}
|
|
366
366
|
},
|
|
367
|
-
[hitEscapeToClose,
|
|
367
|
+
[hitEscapeToClose, shortcut, open, setOpen]
|
|
368
368
|
);
|
|
369
369
|
const adjustForMobile = (0, import_react2.useCallback)(() => {
|
|
370
370
|
const copilotKitWindow = windowRef.current;
|
|
@@ -810,7 +810,7 @@ var CopilotChat = ({
|
|
|
810
810
|
clickOutsideToClose = true,
|
|
811
811
|
hitEscapeToClose = true,
|
|
812
812
|
onSetOpen,
|
|
813
|
-
|
|
813
|
+
shortcut = "e",
|
|
814
814
|
icons,
|
|
815
815
|
labels,
|
|
816
816
|
makeSystemMessage,
|
|
@@ -848,7 +848,7 @@ var CopilotChat = ({
|
|
|
848
848
|
open: openState,
|
|
849
849
|
setOpen,
|
|
850
850
|
clickOutsideToClose,
|
|
851
|
-
|
|
851
|
+
shortcut,
|
|
852
852
|
hitEscapeToClose,
|
|
853
853
|
children: [
|
|
854
854
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Header2, { open: openState, setOpen }),
|