File tree Expand file tree Collapse file tree 4 files changed +66
-0
lines changed
client/packages/lowcoder/src Expand file tree Collapse file tree 4 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { StringControl } from "comps/controls/codeControl" ;
2
+ import { UICompBuilder , withDefault } from "comps/generators" ;
3
+ import { NameConfig , withExposingConfigs } from "comps/generators/withExposing" ;
4
+ import { Section , sectionNames } from "lowcoder-design" ;
5
+ import { trans } from "i18n" ;
6
+ import React from "react" ;
7
+
8
+ // Simple children map with just basic properties
9
+ const childrenMap = {
10
+ text : withDefault ( StringControl , "Chat Component Placeholder" ) ,
11
+ } ;
12
+
13
+ // Basic view - just a simple div for now
14
+ const ChatView = React . memo ( ( props : any ) => {
15
+ return (
16
+ < div
17
+ style = { {
18
+ height : "100%" ,
19
+ border : "1px solid #ccc" ,
20
+ padding : "16px" ,
21
+ borderRadius : "4px" ,
22
+ } }
23
+ >
24
+ { props . text }
25
+ </ div >
26
+ ) ;
27
+ } ) ;
28
+
29
+ // Basic property view
30
+ const ChatPropertyView = React . memo ( ( props : any ) => {
31
+ return (
32
+ < Section name = { sectionNames . basic } >
33
+ { props . children . text . propertyView ( {
34
+ label : "Text" ,
35
+ } ) }
36
+ </ Section >
37
+ ) ;
38
+ } ) ;
39
+
40
+ // Build the component
41
+ const ChatTmpComp = new UICompBuilder ( childrenMap , ( props ) => (
42
+ < ChatView { ...props } />
43
+ ) )
44
+ . setPropertyViewFn ( ( children ) => < ChatPropertyView children = { children } /> )
45
+ . build ( ) ;
46
+
47
+ // Export the component
48
+ export const ChatComp = withExposingConfigs ( ChatTmpComp , [
49
+ new NameConfig ( "text" , "Chat component text" ) ,
50
+ ] ) ;
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ import { DrawerComp } from "./hooks/drawerComp";
193
193
import { ModalComp } from "./hooks/modalComp" ;
194
194
import { defaultCollapsibleContainerData } from "./comps/containerComp/collapsibleContainerComp" ;
195
195
import { ContainerComp as FloatTextContainerComp } from "./comps/containerComp/textContainerComp" ;
196
+ import { ChatComp } from "./comps/chatComp" ;
196
197
197
198
type Registry = {
198
199
[ key in UICompType ] ?: UICompManifest ;
@@ -1669,6 +1670,19 @@ export var uiCompMap: Registry = {
1669
1670
h : 20 ,
1670
1671
} ,
1671
1672
} ,
1673
+ chat : {
1674
+ name : "Chat" ,
1675
+ enName : "Chat" ,
1676
+ description : "Chat Component" ,
1677
+ categories : [ "collaboration" ] ,
1678
+ icon : CommentCompIcon , // Use existing icon for now
1679
+ keywords : "chat,conversation" ,
1680
+ comp : ChatComp ,
1681
+ layoutInfo : {
1682
+ w : 12 ,
1683
+ h : 20 ,
1684
+ } ,
1685
+ } ,
1672
1686
1673
1687
// Integration
1674
1688
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ export type UICompType =
169
169
| "columnLayout"
170
170
| "ganttChart"
171
171
| "kanban"
172
+ | "chat" // Added by Faran
172
173
;
173
174
174
175
Original file line number Diff line number Diff line change @@ -306,4 +306,5 @@ export const CompStateIcon: {
306
306
sunburstChart : < MemoizedIcon Icon = { SunburstChartCompIconSmall } /> ,
307
307
themeriverChart : < MemoizedIcon Icon = { ThemeriverChartCompIconSmall } /> ,
308
308
basicChart : < MemoizedIcon Icon = { ChartCompIconSmall } /> ,
309
+ chat : < MemoizedIcon Icon = { CommentCompIconSmall } /> ,
309
310
} as const ;
You can’t perform that action at this time.
0 commit comments