@copilotkit/react-ui 0.16.0-alpha.1 → 0.17.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +121 -121
- package/CHANGELOG.md +52 -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-FA66IWQ6.mjs} +2 -2
- package/dist/{chunk-KBGIPFXA.mjs → chunk-KDHWN43O.mjs} +2 -2
- package/dist/{chunk-NNVWLSYK.mjs → chunk-Q7SIB42Y.mjs} +6 -4
- package/dist/chunk-Q7SIB42Y.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +8 -4
- package/dist/components/chat/Chat.js +7 -5
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +2 -2
- package/dist/components/chat/Popup.js +7 -5
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +3 -3
- package/dist/components/chat/Sidebar.js +7 -5
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +3 -3
- 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 +1 -1
- package/dist/components/chat/index.js +7 -5
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +4 -4
- package/dist/components/chat/props.d.ts +1 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/index.js +7 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/index.css +9 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- 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 +0 -6
- package/dist/lib/utils.mjs.map +1 -1
- package/package.json +6 -24
- package/src/components/chat/Chat.tsx +12 -5
- package/src/components/chat/Window.tsx +3 -3
- package/src/components/chat/props.ts +1 -1
- package/src/css/markdown.css +10 -2
- 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-FA66IWQ6.mjs.map} +0 -0
- /package/dist/{chunk-KBGIPFXA.mjs.map → chunk-KDHWN43O.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
5
|
CLI Building entry: src/index.tsx, src/components/index.ts, src/context/index.ts, src/hooks/index.ts, src/hooks/use-copy-to-clipboard.tsx, src/lib/utils.test.ts, src/lib/utils.ts, src/types/index.ts, src/types/types.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
|
|
@@ -14,169 +14,169 @@ 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/lib/utils.test.js 182.00 B
|
|
18
|
-
CJS dist/index.js 32.92 KB
|
|
19
|
-
CJS dist/types/types.js 797.00 B
|
|
20
|
-
CJS dist/index.css 19.37 KB
|
|
21
|
-
CJS dist/types/index.js 797.00 B
|
|
22
|
-
CJS dist/lib/utils.js 2.61 KB
|
|
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/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
|
-
CJS dist/components/chat/Header.js 2.63 KB
|
|
29
|
-
CJS dist/components/chat/Icons.js 9.51 KB
|
|
30
|
-
CJS dist/components/chat/Response.js 2.67 KB
|
|
31
|
-
CJS dist/components/chat/Popup.js 31.99 KB
|
|
32
|
-
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
|
-
CJS dist/components/chat/Window.js 5.46 KB
|
|
36
|
-
CJS dist/components/chat/index.js 32.94 KB
|
|
37
|
-
CJS dist/components/chat/props.js 807.00 B
|
|
38
|
-
CJS dist/hooks/index.js 797.00 B
|
|
39
|
-
CJS dist/components/chat/ChatContext.js 9.01 KB
|
|
40
|
-
CJS dist/components/chat/Input.js 5.26 KB
|
|
41
|
-
CJS dist/components/chat/Messages.js 13.97 KB
|
|
42
|
-
CJS dist/context/index.js 803.00 B
|
|
43
|
-
CJS dist/index.js.map 51.19 KB
|
|
44
|
-
CJS dist/types/types.js.map 478.00 B
|
|
45
|
-
CJS dist/lib/utils.test.js.map 352.00 B
|
|
46
|
-
CJS dist/index.css.map 30.37 KB
|
|
47
|
-
CJS dist/types/index.js.map 137.00 B
|
|
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
|
|
51
|
-
CJS dist/components/chat/Button.js.map 5.70 KB
|
|
52
|
-
CJS dist/components/chat/Response.js.map 5.27 KB
|
|
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
|
|
57
|
-
CJS dist/components/chat/Markdown.js.map 16.13 KB
|
|
58
|
-
CJS dist/components/chat/props.js.map 882.00 B
|
|
59
|
-
CJS dist/components/chat/Window.js.map 6.75 KB
|
|
60
|
-
CJS dist/components/chat/CodeBlock.js.map 13.35 KB
|
|
61
|
-
CJS dist/hooks/index.js.map 137.00 B
|
|
62
|
-
CJS dist/components/chat/Input.js.map 9.75 KB
|
|
63
|
-
CJS dist/components/index.js.map 51.12 KB
|
|
64
|
-
CJS dist/components/chat/ChatContext.js.map 12.69 KB
|
|
65
|
-
CJS dist/components/chat/Messages.js.map 25.57 KB
|
|
66
|
-
CJS dist/components/chat/Popup.js.map 49.78 KB
|
|
67
|
-
CJS dist/components/chat/index.js.map 51.26 KB
|
|
68
|
-
CJS dist/context/index.js.map 139.00 B
|
|
69
|
-
CJS ⚡️ Build success in 367ms
|
|
70
17
|
ESM dist/components/index.mjs 737.00 B
|
|
71
|
-
ESM dist/
|
|
72
|
-
ESM dist/
|
|
18
|
+
ESM dist/hooks/index.mjs 66.00 B
|
|
19
|
+
ESM dist/types/index.mjs 66.00 B
|
|
20
|
+
ESM dist/lib/utils.test.mjs 168.00 B
|
|
21
|
+
ESM dist/index.mjs 811.00 B
|
|
73
22
|
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
74
|
-
ESM dist/
|
|
75
|
-
ESM dist/chunk-
|
|
76
|
-
ESM dist/chunk-
|
|
77
|
-
ESM dist/chunk-GWGHQNRI.mjs 1.84 KB
|
|
23
|
+
ESM dist/chunk-KDHWN43O.mjs 528.00 B
|
|
24
|
+
ESM dist/chunk-FA66IWQ6.mjs 1.01 KB
|
|
25
|
+
ESM dist/chunk-Q7SIB42Y.mjs 2.49 KB
|
|
78
26
|
ESM dist/chunk-3M4HWSE7.mjs 2.31 KB
|
|
79
|
-
ESM dist/chunk-NNVWLSYK.mjs 2.40 KB
|
|
80
27
|
ESM dist/chunk-Z34F3WLK.mjs 613.00 B
|
|
28
|
+
ESM dist/chunk-B7DNOYVQ.mjs 3.80 KB
|
|
81
29
|
ESM dist/chunk-5O2MCJZ2.mjs 825.00 B
|
|
82
|
-
ESM dist/chunk-
|
|
30
|
+
ESM dist/chunk-UWPFPWAW.mjs 566.00 B
|
|
83
31
|
ESM dist/chunk-NYLOXKYT.mjs 1.63 KB
|
|
84
|
-
ESM dist/chunk-47SYBLI2.mjs 3.79 KB
|
|
85
|
-
ESM dist/chunk-WM6BS77F.mjs 1.54 KB
|
|
86
32
|
ESM dist/chunk-OF66AL5Z.mjs 1.73 KB
|
|
33
|
+
ESM dist/chunk-GWGHQNRI.mjs 1.84 KB
|
|
34
|
+
ESM dist/chunk-IU3WTXLQ.mjs 43.00 B
|
|
35
|
+
ESM dist/chunk-WM6BS77F.mjs 1.54 KB
|
|
87
36
|
ESM dist/chunk-7YXG7D47.mjs 6.52 KB
|
|
88
|
-
ESM dist/
|
|
89
|
-
ESM dist/chunk-H4VKQGVU.mjs 43.00 B
|
|
90
|
-
ESM dist/chunk-UWPFPWAW.mjs 566.00 B
|
|
91
|
-
ESM dist/hooks/index.mjs 66.00 B
|
|
37
|
+
ESM dist/hooks/use-copy-to-clipboard.mjs 191.00 B
|
|
92
38
|
ESM dist/chunk-POVINPXX.mjs 675.00 B
|
|
93
|
-
ESM dist/chunk-P4GBO6MW.mjs 43.00 B
|
|
94
|
-
ESM dist/lib/utils.mjs 1021.00 B
|
|
95
|
-
ESM dist/lib/utils.test.mjs 168.00 B
|
|
96
|
-
ESM dist/chunk-7NSRDJ5C.mjs 43.00 B
|
|
97
|
-
ESM dist/types/types.mjs 34.00 B
|
|
98
|
-
ESM dist/index.css 19.37 KB
|
|
99
|
-
ESM dist/chunk-IU3WTXLQ.mjs 43.00 B
|
|
100
39
|
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
101
|
-
ESM dist/
|
|
102
|
-
ESM dist/
|
|
103
|
-
ESM dist/
|
|
40
|
+
ESM dist/chunk-H4VKQGVU.mjs 43.00 B
|
|
41
|
+
ESM dist/chunk-7NSRDJ5C.mjs 43.00 B
|
|
42
|
+
ESM dist/index.css 19.65 KB
|
|
43
|
+
ESM dist/context/index.mjs 66.00 B
|
|
44
|
+
ESM dist/chunk-DPRH4HX3.mjs 3.55 KB
|
|
45
|
+
ESM dist/lib/utils.mjs 885.00 B
|
|
46
|
+
ESM dist/chunk-P4GBO6MW.mjs 43.00 B
|
|
47
|
+
ESM dist/chunk-WB3YULQ4.mjs 43.00 B
|
|
104
48
|
ESM dist/components/chat/props.mjs 69.00 B
|
|
105
|
-
ESM dist/components/chat/
|
|
106
|
-
ESM dist/components/chat/
|
|
49
|
+
ESM dist/components/chat/Messages.mjs 325.00 B
|
|
50
|
+
ESM dist/components/chat/Response.mjs 232.00 B
|
|
107
51
|
ESM dist/components/chat/Markdown.mjs 255.00 B
|
|
108
52
|
ESM dist/components/chat/Button.mjs 214.00 B
|
|
53
|
+
ESM dist/components/chat/Chat.mjs 572.00 B
|
|
54
|
+
ESM dist/components/chat/Header.mjs 214.00 B
|
|
55
|
+
ESM dist/types/types.mjs 34.00 B
|
|
56
|
+
ESM dist/components/chat/ChatContext.mjs 276.00 B
|
|
109
57
|
ESM dist/components/chat/index.mjs 759.00 B
|
|
110
|
-
ESM dist/components/chat/Messages.mjs 325.00 B
|
|
111
58
|
ESM dist/components/chat/CodeBlock.mjs 333.00 B
|
|
112
|
-
ESM dist/components/chat/Header.mjs 214.00 B
|
|
113
59
|
ESM dist/components/chat/Icons.mjs 439.00 B
|
|
60
|
+
ESM dist/components/chat/Window.mjs 144.00 B
|
|
114
61
|
ESM dist/components/chat/Input.mjs 246.00 B
|
|
115
|
-
ESM dist/components/chat/Sidebar.mjs 616.00 B
|
|
116
|
-
ESM dist/components/chat/Chat.mjs 572.00 B
|
|
117
|
-
ESM dist/components/chat/ChatContext.mjs 276.00 B
|
|
118
62
|
ESM dist/components/index.mjs.map 71.00 B
|
|
119
|
-
ESM dist/
|
|
63
|
+
ESM dist/hooks/index.mjs.map 71.00 B
|
|
64
|
+
ESM dist/types/index.mjs.map 71.00 B
|
|
65
|
+
ESM dist/components/chat/Sidebar.mjs 616.00 B
|
|
66
|
+
ESM dist/index.mjs.map 71.00 B
|
|
120
67
|
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
68
|
+
ESM dist/chunk-KDHWN43O.mjs.map 549.00 B
|
|
69
|
+
ESM dist/chunk-FA66IWQ6.mjs.map 1.36 KB
|
|
70
|
+
ESM dist/chunk-Q7SIB42Y.mjs.map 6.73 KB
|
|
121
71
|
ESM dist/chunk-3M4HWSE7.mjs.map 5.04 KB
|
|
122
|
-
ESM dist/chunk-NNVWLSYK.mjs.map 6.51 KB
|
|
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
|
|
126
72
|
ESM dist/chunk-Z34F3WLK.mjs.map 854.00 B
|
|
127
|
-
ESM dist/chunk-
|
|
128
|
-
ESM dist/chunk-WM6BS77F.mjs.map 2.80 KB
|
|
129
|
-
ESM dist/chunk-GWGHQNRI.mjs.map 2.76 KB
|
|
130
|
-
ESM dist/chunk-OF66AL5Z.mjs.map 4.97 KB
|
|
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
|
|
134
|
-
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
|
|
73
|
+
ESM dist/chunk-B7DNOYVQ.mjs.map 6.70 KB
|
|
137
74
|
ESM dist/chunk-5O2MCJZ2.mjs.map 1.26 KB
|
|
138
|
-
ESM dist/chunk-
|
|
75
|
+
ESM dist/chunk-NYLOXKYT.mjs.map 2.53 KB
|
|
76
|
+
ESM dist/chunk-OF66AL5Z.mjs.map 4.97 KB
|
|
77
|
+
ESM dist/chunk-GWGHQNRI.mjs.map 2.76 KB
|
|
139
78
|
ESM dist/chunk-UWPFPWAW.mjs.map 773.00 B
|
|
140
|
-
ESM dist/
|
|
141
|
-
ESM dist/
|
|
142
|
-
ESM dist/chunk-H4VKQGVU.mjs.map 71.00 B
|
|
79
|
+
ESM dist/lib/utils.test.mjs.map 350.00 B
|
|
80
|
+
ESM dist/hooks/use-copy-to-clipboard.mjs.map 71.00 B
|
|
143
81
|
ESM dist/chunk-IU3WTXLQ.mjs.map 71.00 B
|
|
144
|
-
ESM dist/
|
|
82
|
+
ESM dist/chunk-7YXG7D47.mjs.map 8.44 KB
|
|
83
|
+
ESM dist/chunk-POVINPXX.mjs.map 1.18 KB
|
|
84
|
+
ESM dist/chunk-WM6BS77F.mjs.map 2.80 KB
|
|
145
85
|
ESM dist/chunk-7NSRDJ5C.mjs.map 71.00 B
|
|
86
|
+
ESM dist/chunk-H4VKQGVU.mjs.map 71.00 B
|
|
87
|
+
ESM dist/index.css.map 30.69 KB
|
|
146
88
|
ESM dist/chunk-MRXNTQOX.mjs.map 71.00 B
|
|
147
|
-
ESM dist/
|
|
148
|
-
ESM dist/
|
|
149
|
-
ESM dist/
|
|
89
|
+
ESM dist/components/chat/Textarea.mjs 177.00 B
|
|
90
|
+
ESM dist/lib/utils.mjs.map 1.49 KB
|
|
91
|
+
ESM dist/chunk-P4GBO6MW.mjs.map 71.00 B
|
|
92
|
+
ESM dist/context/index.mjs.map 71.00 B
|
|
93
|
+
ESM dist/chunk-WB3YULQ4.mjs.map 71.00 B
|
|
150
94
|
ESM dist/components/chat/props.mjs.map 71.00 B
|
|
95
|
+
ESM dist/chunk-DPRH4HX3.mjs.map 5.67 KB
|
|
96
|
+
ESM dist/components/chat/Popup.mjs 610.00 B
|
|
97
|
+
ESM dist/components/chat/Messages.mjs.map 71.00 B
|
|
151
98
|
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
99
|
ESM dist/components/chat/Markdown.mjs.map 71.00 B
|
|
100
|
+
ESM dist/components/chat/Chat.mjs.map 71.00 B
|
|
155
101
|
ESM dist/components/chat/Header.mjs.map 71.00 B
|
|
156
|
-
ESM dist/components/chat/
|
|
102
|
+
ESM dist/components/chat/index.mjs.map 71.00 B
|
|
157
103
|
ESM dist/components/chat/Icons.mjs.map 71.00 B
|
|
104
|
+
ESM dist/types/types.mjs.map 71.00 B
|
|
105
|
+
ESM dist/components/chat/Window.mjs.map 71.00 B
|
|
106
|
+
ESM dist/components/chat/ChatContext.mjs.map 71.00 B
|
|
107
|
+
ESM dist/components/chat/CodeBlock.mjs.map 71.00 B
|
|
158
108
|
ESM dist/components/chat/Input.mjs.map 71.00 B
|
|
109
|
+
ESM dist/components/chat/Button.mjs.map 71.00 B
|
|
159
110
|
ESM dist/components/chat/Textarea.mjs.map 71.00 B
|
|
160
|
-
ESM dist/components/chat/index.mjs.map 71.00 B
|
|
161
111
|
ESM dist/components/chat/Sidebar.mjs.map 71.00 B
|
|
162
|
-
ESM dist/components/chat/ChatContext.mjs.map 71.00 B
|
|
163
|
-
ESM dist/components/chat/Chat.mjs.map 71.00 B
|
|
164
|
-
ESM dist/components/chat/Messages.mjs.map 71.00 B
|
|
165
112
|
ESM dist/components/chat/Popup.mjs.map 71.00 B
|
|
166
|
-
ESM ⚡️ Build success in
|
|
167
|
-
|
|
113
|
+
ESM ⚡️ Build success in 489ms
|
|
114
|
+
CJS dist/context/index.js 803.00 B
|
|
115
|
+
CJS dist/index.js 33.02 KB
|
|
116
|
+
CJS dist/lib/utils.js 2.40 KB
|
|
117
|
+
CJS dist/lib/utils.test.js 182.00 B
|
|
118
|
+
CJS dist/types/index.js 797.00 B
|
|
119
|
+
CJS dist/components/chat/Button.js 2.91 KB
|
|
120
|
+
CJS dist/components/chat/Chat.js 31.68 KB
|
|
121
|
+
CJS dist/components/chat/ChatContext.js 9.01 KB
|
|
122
|
+
CJS dist/index.css 19.65 KB
|
|
123
|
+
CJS dist/components/chat/Input.js 5.26 KB
|
|
124
|
+
CJS dist/hooks/index.js 797.00 B
|
|
125
|
+
CJS dist/components/chat/Messages.js 13.97 KB
|
|
126
|
+
CJS dist/components/chat/Response.js 2.67 KB
|
|
127
|
+
CJS dist/hooks/use-copy-to-clipboard.js 2.32 KB
|
|
128
|
+
CJS dist/components/chat/Window.js 5.46 KB
|
|
129
|
+
CJS dist/components/chat/Header.js 2.63 KB
|
|
130
|
+
CJS dist/components/chat/Sidebar.js 32.63 KB
|
|
131
|
+
CJS dist/components/chat/index.js 33.03 KB
|
|
132
|
+
CJS dist/components/chat/props.js 807.00 B
|
|
133
|
+
CJS dist/components/chat/Popup.js 32.08 KB
|
|
134
|
+
CJS dist/components/index.js 33.05 KB
|
|
135
|
+
CJS dist/components/chat/Textarea.js 2.51 KB
|
|
136
|
+
CJS dist/components/chat/CodeBlock.js 9.21 KB
|
|
137
|
+
CJS dist/components/chat/Markdown.js 11.00 KB
|
|
138
|
+
CJS dist/components/chat/Icons.js 9.51 KB
|
|
139
|
+
CJS dist/types/types.js 797.00 B
|
|
140
|
+
CJS dist/context/index.js.map 139.00 B
|
|
141
|
+
CJS dist/lib/utils.js.map 1.55 KB
|
|
142
|
+
CJS dist/types/index.js.map 137.00 B
|
|
143
|
+
CJS dist/components/chat/Button.js.map 5.70 KB
|
|
144
|
+
CJS dist/components/chat/Input.js.map 9.75 KB
|
|
145
|
+
CJS dist/components/chat/ChatContext.js.map 12.69 KB
|
|
146
|
+
CJS dist/hooks/index.js.map 137.00 B
|
|
147
|
+
CJS dist/components/chat/Chat.js.map 49.50 KB
|
|
148
|
+
CJS dist/components/chat/Messages.js.map 25.57 KB
|
|
149
|
+
CJS dist/components/chat/Response.js.map 5.27 KB
|
|
150
|
+
CJS dist/hooks/use-copy-to-clipboard.js.map 1.23 KB
|
|
151
|
+
CJS dist/lib/utils.test.js.map 352.00 B
|
|
152
|
+
CJS dist/components/chat/Header.js.map 5.19 KB
|
|
153
|
+
CJS dist/components/chat/Sidebar.js.map 50.83 KB
|
|
154
|
+
CJS dist/components/chat/index.js.map 51.49 KB
|
|
155
|
+
CJS dist/components/chat/Window.js.map 6.76 KB
|
|
156
|
+
CJS dist/index.js.map 51.42 KB
|
|
157
|
+
CJS dist/index.css.map 30.69 KB
|
|
158
|
+
CJS dist/components/chat/props.js.map 884.00 B
|
|
159
|
+
CJS dist/components/chat/Textarea.js.map 2.83 KB
|
|
160
|
+
CJS dist/components/index.js.map 51.35 KB
|
|
161
|
+
CJS dist/components/chat/CodeBlock.js.map 13.35 KB
|
|
162
|
+
CJS dist/components/chat/Popup.js.map 50.00 KB
|
|
163
|
+
CJS dist/components/chat/Markdown.js.map 16.13 KB
|
|
164
|
+
CJS dist/types/types.js.map 478.00 B
|
|
165
|
+
CJS dist/components/chat/Icons.js.map 8.55 KB
|
|
166
|
+
CJS ⚡️ Build success in 520ms
|
|
167
|
+
DTS ⚡️ Build success in 2819ms
|
|
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.51 KB
|
|
173
173
|
DTS dist/components/chat/ChatContext.d.ts 2.73 KB
|
|
174
174
|
DTS dist/components/index.d.ts 356.00 B
|
|
175
175
|
DTS dist/context/index.d.ts 12.00 B
|
|
176
176
|
DTS dist/hooks/index.d.ts 12.00 B
|
|
177
177
|
DTS dist/hooks/use-copy-to-clipboard.d.ts 266.00 B
|
|
178
178
|
DTS dist/lib/utils.test.d.ts 12.00 B
|
|
179
|
-
DTS dist/lib/utils.d.ts
|
|
179
|
+
DTS dist/lib/utils.d.ts 263.00 B
|
|
180
180
|
DTS dist/types/index.d.ts 12.00 B
|
|
181
181
|
DTS dist/types/types.d.ts 351.00 B
|
|
182
182
|
DTS dist/components/chat/Button.d.ts 163.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,57 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 0.17.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- function return values support
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @copilotkit/react-core@0.20.0-alpha.2
|
|
13
|
+
- @copilotkit/shared@0.4.0-alpha.2
|
|
14
|
+
|
|
15
|
+
## 0.17.0-tools.1
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- function return
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @copilotkit/react-core@0.20.0-tools.1
|
|
25
|
+
- @copilotkit/shared@0.4.0-tools.1
|
|
26
|
+
|
|
27
|
+
## 0.17.0-tools.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- Test the tools API
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
- @copilotkit/react-core@0.20.0-tools.0
|
|
37
|
+
- @copilotkit/shared@0.4.0-tools.0
|
|
38
|
+
|
|
39
|
+
## 0.16.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- node CopilotBackend support
|
|
44
|
+
- 58a8524: clean node example impl
|
|
45
|
+
- a34a226: node-native backend support
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies
|
|
50
|
+
- Updated dependencies [58a8524]
|
|
51
|
+
- Updated dependencies [a34a226]
|
|
52
|
+
- @copilotkit/react-core@0.19.0
|
|
53
|
+
- @copilotkit/shared@0.3.0
|
|
54
|
+
|
|
3
55
|
## 0.16.0-alpha.1
|
|
4
56
|
|
|
5
57
|
### Minor Changes
|
|
@@ -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":";AAAA,OAAO,SAAS,aAAa,iBAAiB;AAgH1C;AA7GG,IAAM,SAAS,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAmB;AACjB,QAAM,YAAY,MAAM,OAAuB,IAAI;AAEnD,QAAM,qBAAqB;AAAA,IACzB,CAAC,UAAsB;AAd3B;AAeM,UAAI,CAAC,qBAAqB;AACxB;AAAA,MACF;AAEA,YAAM,iBAAgB,eAAU,YAAV,mBAAmB;AAEzC,UAAI,QAAQ,iBAAiB,CAAC,cAAc,SAAS,MAAM,MAAa,GAAG;AACzE,gBAAQ,KAAK;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,qBAAqB,MAAM,OAAO;AAAA,EACrC;AAEA,QAAM,gBAAgB;AAAA,IACpB,CAAC,UAAyB;AA7B9B;AA8BM,YAAM,SAAS,MAAM;AACrB,YAAM,UACJ,OAAO,YAAY,WACnB,OAAO,YAAY,YACnB,OAAO,YAAY,cACnB,OAAO;AAET,YAAM,yBAAwB,eAAU,YAAV,mBAAmB,SAAS;AAE1D,UACE,QACA,MAAM,QAAQ,aACb,CAAC,WAAW,0BACb,kBACA;AACA,gBAAQ,KAAK;AAAA,MACf,WACE,MAAM,QAAQ,aACZ,QAAQ,KAAK,MAAM,WAAa,CAAC,QAAQ,KAAK,MAAM,aACrD,CAAC,WAAW,wBACb;AACA,gBAAQ,CAAC,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,UAAU,MAAM,OAAO;AAAA,EAC5C;AAEA,QAAM,kBAAkB,YAAY,MAAM;AACxC,UAAM,mBAAmB,UAAU;AACnC,UAAM,KAAK,OAAO;AAClB,QAAI,CAAC,oBAAoB,CAAC,IAAI;AAC5B;AAAA,IACF;AAEA,QAAI,OAAO,aAAa,OAAO,MAAM;AACnC,uBAAiB,MAAM,SAAS,GAAG,GAAG;AACtC,uBAAiB,MAAM,OAAO,GAAG,GAAG;AACpC,uBAAiB,MAAM,MAAM,GAAG,GAAG;AAEnC,eAAS,KAAK,MAAM,WAAW;AAC/B,eAAS,KAAK,MAAM,QAAQ;AAC5B,eAAS,KAAK,MAAM,SAAS,GAAG,OAAO;AACvC,eAAS,KAAK,MAAM,WAAW;AAC/B,eAAS,KAAK,MAAM,cAAc;AAGlC,eAAS,KAAK,iBAAiB,aAAa,eAAe;AAAA,QACzD,SAAS;AAAA,MACX,CAAC;AAAA,IACH,OAAO;AACL,uBAAiB,MAAM,SAAS;AAChC,uBAAiB,MAAM,OAAO;AAC9B,uBAAiB,MAAM,MAAM;AAC7B,eAAS,KAAK,MAAM,WAAW;AAC/B,eAAS,KAAK,MAAM,SAAS;AAC7B,eAAS,KAAK,MAAM,QAAQ;AAC5B,eAAS,KAAK,MAAM,WAAW;AAC/B,eAAS,KAAK,MAAM,MAAM;AAC1B,eAAS,KAAK,MAAM,cAAc;AAElC,eAAS,KAAK,oBAAoB,aAAa,aAAa;AAAA,IAC9D;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,YAAU,MAAM;AACd,aAAS,iBAAiB,aAAa,kBAAkB;AACzD,aAAS,iBAAiB,WAAW,aAAa;AAClD,QAAI,OAAO,gBAAgB;AACzB,aAAO,eAAe,iBAAiB,UAAU,eAAe;AAChE,sBAAgB;AAAA,IAClB;AAEA,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,kBAAkB;AAC5D,eAAS,oBAAoB,WAAW,aAAa;AACrD,UAAI,OAAO,gBAAgB;AACzB,eAAO,eAAe,oBAAoB,UAAU,eAAe;AAAA,MACrE;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,oBAAoB,aAAa,CAAC;AAEvD,SACE,oBAAC,SAAI,WAAW,mBAAmB,OAAO,UAAU,MAAM,KAAK,WAC5D,UACH;AAEJ;AAEA,IAAM,gBAAgB,CAAC,UAA4B;AACjD,MAAI,gBAAgB,MAAM;AAG1B,QAAM,qBAAqB,CAAC,SAAkB,cAA+B;AAC3E,WAAO,WAAW,YAAY,SAAS,MAAM;AAC3C,UAAI,QAAQ,UAAU,SAAS,SAAS,GAAG;AACzC,eAAO;AAAA,MACT;AACA,gBAAU,QAAQ;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,mBAAmB,eAAe,oBAAoB,GAAG;AAC5D,UAAM,eAAe;AAAA,EACvB;AACF;AAEA,SAAS,UAAU;AACjB,SAAO,sBAAsB,KAAK,UAAU,SAAS;AACvD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q7SIB42Y.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-FA66IWQ6.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q7SIB42Y.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-KDHWN43O.mjs.map
|
|
@@ -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,8 @@ var CopilotChat = ({
|
|
|
34
34
|
clickOutsideToClose = true,
|
|
35
35
|
hitEscapeToClose = true,
|
|
36
36
|
onSetOpen,
|
|
37
|
-
|
|
37
|
+
onSubmitMessage,
|
|
38
|
+
shortcut = "e",
|
|
38
39
|
icons,
|
|
39
40
|
labels,
|
|
40
41
|
makeSystemMessage,
|
|
@@ -58,6 +59,7 @@ var CopilotChat = ({
|
|
|
58
59
|
setOpenState(open);
|
|
59
60
|
};
|
|
60
61
|
const sendMessage = (message) => __async(void 0, null, function* () {
|
|
62
|
+
onSubmitMessage == null ? void 0 : onSubmitMessage(message);
|
|
61
63
|
append({
|
|
62
64
|
id: nanoid(),
|
|
63
65
|
content: message,
|
|
@@ -72,7 +74,7 @@ var CopilotChat = ({
|
|
|
72
74
|
open: openState,
|
|
73
75
|
setOpen,
|
|
74
76
|
clickOutsideToClose,
|
|
75
|
-
|
|
77
|
+
shortcut,
|
|
76
78
|
hitEscapeToClose,
|
|
77
79
|
children: [
|
|
78
80
|
/* @__PURE__ */ jsx(Header2, { open: openState, setOpen }),
|
|
@@ -87,4 +89,4 @@ var CopilotChat = ({
|
|
|
87
89
|
export {
|
|
88
90
|
CopilotChat
|
|
89
91
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-Q7SIB42Y.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 * A callback that gets called when a new message it submitted.\n */\n onSubmitMessage?: (message: string) => 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 onSubmitMessage,\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 onSubmitMessage?.(message);\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;AA6Jf,cACA,YADA;AA7CD,IAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB;AAAA,EACA;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,uDAAkB;AAClB,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"]}
|
|
@@ -37,11 +37,15 @@ interface CopilotChatProps {
|
|
|
37
37
|
*/
|
|
38
38
|
onSetOpen?: (open: boolean) => void;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
|
|
40
|
+
* A callback that gets called when a new message it submitted.
|
|
41
|
+
*/
|
|
42
|
+
onSubmitMessage?: (message: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The shortcut key to open the chat window.
|
|
45
|
+
* Uses Command-<shortcut> on a Mac and Ctrl-<shortcut> on Windows.
|
|
42
46
|
* @default "e"
|
|
43
47
|
*/
|
|
44
|
-
|
|
48
|
+
shortcut?: string;
|
|
45
49
|
/**
|
|
46
50
|
* Icons can be used to set custom icons for the chat window.
|
|
47
51
|
*/
|
|
@@ -91,6 +95,6 @@ interface CopilotChatProps {
|
|
|
91
95
|
*/
|
|
92
96
|
className?: string;
|
|
93
97
|
}
|
|
94
|
-
declare const CopilotChat: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen,
|
|
98
|
+
declare const CopilotChat: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen, onSubmitMessage, shortcut, icons, labels, makeSystemMessage, showResponseButton, Window, Button, Header, Messages, Input, ResponseButton, className, }: CopilotChatProps) => JSX.Element;
|
|
95
99
|
|
|
96
100
|
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,8 @@ var CopilotChat = ({
|
|
|
810
810
|
clickOutsideToClose = true,
|
|
811
811
|
hitEscapeToClose = true,
|
|
812
812
|
onSetOpen,
|
|
813
|
-
|
|
813
|
+
onSubmitMessage,
|
|
814
|
+
shortcut = "e",
|
|
814
815
|
icons,
|
|
815
816
|
labels,
|
|
816
817
|
makeSystemMessage,
|
|
@@ -834,6 +835,7 @@ var CopilotChat = ({
|
|
|
834
835
|
setOpenState(open);
|
|
835
836
|
};
|
|
836
837
|
const sendMessage = (message) => __async(void 0, null, function* () {
|
|
838
|
+
onSubmitMessage == null ? void 0 : onSubmitMessage(message);
|
|
837
839
|
append({
|
|
838
840
|
id: (0, import_nanoid2.nanoid)(),
|
|
839
841
|
content: message,
|
|
@@ -848,7 +850,7 @@ var CopilotChat = ({
|
|
|
848
850
|
open: openState,
|
|
849
851
|
setOpen,
|
|
850
852
|
clickOutsideToClose,
|
|
851
|
-
|
|
853
|
+
shortcut,
|
|
852
854
|
hitEscapeToClose,
|
|
853
855
|
children: [
|
|
854
856
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Header2, { open: openState, setOpen }),
|