File tree Expand file tree Collapse file tree 7 files changed +159
-52
lines changed
components/ChatComponents Expand file tree Collapse file tree 7 files changed +159
-52
lines changed Original file line number Diff line number Diff line change 1
1
node_modules
2
+ .yalc
3
+ yalc.lock
2
4
3
5
/.cache
4
6
/build
Original file line number Diff line number Diff line change
1
+ import { GWChatWidget , GWChatWidgetProps } from "gooey-web-widget" ;
2
+
3
+ export default function GooeyChatWidget ( {
4
+ state,
5
+ onChange,
6
+ ...rest
7
+ } : GWChatWidgetProps & {
8
+ state : Record < string , any > ;
9
+ onChange : ( value : string ) => void ;
10
+ } ) {
11
+
12
+ const handleSend = ( message : string ) => {
13
+ // Handle the send event here
14
+ console . log ( "Message sent:" , message ) ;
15
+ // You can also call onChange if needed
16
+ onChange ( message ) ;
17
+ } ;
18
+
19
+ const handleClear = ( ) => {
20
+ // Handle the clear event here
21
+ console . log ( "Chat cleared" ) ;
22
+ // You can also call onChange if needed
23
+ // onChange("");
24
+ } ;
25
+
26
+ return (
27
+ < div className = "h-100" >
28
+ < GWChatWidget
29
+ { ...rest }
30
+ onSend = { handleSend }
31
+ onNewConversation = { handleClear }
32
+ />
33
+ </ div >
34
+ ) ;
35
+ }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import GooeySelect from "./components/GooeySelect";
22
22
import GooeySwitch from "./components/GooeySwitch" ;
23
23
import { GooeyTooltip } from "./components/GooeyTooltip" ;
24
24
import { lazyImport } from "./lazyImports" ;
25
+ import GooeyChatWidget from "./components/ChatComponents/GooeyChatWidget" ;
25
26
26
27
const { DataTable, DataTableRaw } = lazyImport ( ( ) => import ( "~/dataTable" ) ) ;
27
28
@@ -338,6 +339,9 @@ function RenderedTreeNode({
338
339
case "code-editor" : {
339
340
return < CodeEditor props = { props } state = { state } onChange = { onChange } /> ;
340
341
}
342
+ case "gw-chat-widget" : {
343
+ return < GooeyChatWidget { ...props } state = { state } onChange = { onChange } /> ;
344
+ }
341
345
case "switch" :
342
346
return < GooeySwitch props = { props } state = { state } /> ;
343
347
case "input" : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " gooey-gui" ,
3
- "version" : " 0.5.3 " ,
3
+ "version" : " 0.5.4 " ,
4
4
"sideEffects" : false ,
5
5
"scripts" : {
6
6
"build" : " remix build" ,
44
44
"@uppy/webcam" : " ^3.3.1" ,
45
45
"@uppy/xhr-upload" : " ^3.2.0" ,
46
46
"firebase-admin" : " ^11.9.0" ,
47
+ "gooey-web-widget" : " file:.yalc/gooey-web-widget" ,
47
48
"html-react-parser" : " ^4.0.0" ,
48
49
"isbot" : " ^3.6.8" ,
49
50
"jshint" : " ^2.13.6" ,
53
54
"nprogress" : " ^0.2.0" ,
54
55
"plotly.js" : " ^2.27.1" ,
55
56
"puppeteer" : " ^22.14.0" ,
56
- "react" : " ^17.0.2 " ,
57
- "react-dom" : " ^17.0.2 " ,
57
+ "react" : " ^18.2.0 " ,
58
+ "react-dom" : " ^18.2.0 " ,
58
59
"react-plotly.js" : " ^2.6.0" ,
59
60
"react-select" : " ^5.7.3" ,
60
61
"react-syntax-highlighter" : " ^15.5.0" ,
Original file line number Diff line number Diff line change @@ -922,3 +922,17 @@ def tooltip(
922
922
)
923
923
tooltip .mount ()
924
924
return core .NestingCtx (tooltip )
925
+
926
+ def gooey_chat_widget (
927
+ messages ,
928
+ config ,
929
+ ** props ,
930
+ ):
931
+ return core .RenderTreeNode (
932
+ name = "gw-chat-widget" ,
933
+ props = dict (
934
+ messages = messages ,
935
+ config = config ,
936
+ ** props ,
937
+ ),
938
+ ).mount ()
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ module.exports = {
30
30
/ p - q u e u e / ,
31
31
/ p - t i m e o u t / ,
32
32
/ i s - n e t w o r k - e r r o r / ,
33
+ / g o o e y - w e b - w i d g e t /
33
34
] ,
34
35
routes ( defineRoutes ) {
35
36
return defineRoutes ( ( route ) => {
You can’t perform that action at this time.
0 commit comments