@tencentcloud/sdk-mcp 1.3.4 → 1.3.6

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 (126) hide show
  1. package/index.js +4 -4
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/resource/doc/chatuikit/android/features/theme.md +363 -0
  5. package/resource/doc/chatuikit/{android/client_api_android.md → faq/android_sdk/client-api.md} +0 -1
  6. package/resource/doc/chatuikit/faq/{native_sdk/faq.md → common/product.md} +8 -0
  7. package/resource/doc/chatuikit/faq/flutter_sdk/faq.md +54 -0
  8. package/resource/doc/chatuikit/faq/web_sdk/faq.md +1 -1
  9. package/resource/doc/chatuikit/flutter/features/theme.md +379 -0
  10. package/resource/doc/chatuikit/flutter/workflow.md +816 -0
  11. package/resource/doc/chatuikit/iOS/features/theme.md +416 -0
  12. package/resource/doc/chatuikit/iOS/workflow.md +0 -0
  13. package/resource/doc/chatuikit/react/components/chat-setting.md +124 -0
  14. package/resource/doc/chatuikit/react/components/contact-list.md +1331 -0
  15. package/resource/doc/chatuikit/react/components/search.md +885 -0
  16. package/resource/doc/chatuikit/vue/components/chat-setting.md +88 -0
  17. package/resource/doc/chatuikit/vue/components/contact-list.md +679 -0
  18. package/resource/doc/chatuikit/vue/components/search.md +1384 -0
  19. package/resource/doc/livekit/live/android/workflow.md +137 -4
  20. package/resource/doc/livekit/live/flutter/live-audience-list.md +337 -0
  21. package/resource/doc/livekit/live/flutter/live-audio-effect.md +739 -0
  22. package/resource/doc/livekit/live/flutter/live-barrage.md +578 -0
  23. package/resource/doc/livekit/live/flutter/live-base-beauty.md +484 -0
  24. package/resource/doc/livekit/live/flutter/live-co-guest-interaction.md +606 -0
  25. package/resource/doc/livekit/live/flutter/live-gift.md +812 -0
  26. package/resource/doc/livekit/live/flutter/live-host-interaction.md +1113 -0
  27. package/resource/doc/livekit/live/flutter/live-integration.md +1029 -0
  28. package/resource/doc/livekit/live/flutter/live-live-list.md +861 -0
  29. package/resource/doc/livekit/live/ios/live-audience-list.md +335 -0
  30. package/resource/doc/livekit/live/ios/live-audio-effect.md +373 -0
  31. package/resource/doc/livekit/live/ios/live-barrage.md +529 -0
  32. package/resource/doc/livekit/live/ios/live-base-beauty.md +237 -0
  33. package/resource/doc/livekit/live/ios/live-co-guest-interaction.md +483 -0
  34. package/resource/doc/livekit/live/ios/live-gift.md +785 -0
  35. package/resource/doc/livekit/live/ios/live-host-interaction.md +743 -0
  36. package/resource/doc/livekit/live/ios/live-integration.md +822 -0
  37. package/resource/doc/livekit/live/ios/live-live-list.md +535 -0
  38. package/resource/doc/livekit/live/ios/workflow.md +352 -0
  39. package/resource/doc/rtcengine/faq/web/web.md +2 -2
  40. package/resource/doc/rtcengine/web/how_to_integrated_web_sdk.md +2 -2
  41. package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +84 -0
  42. package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +86 -0
  43. package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +220 -0
  44. package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +217 -0
  45. package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +137 -0
  46. package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +97 -0
  47. package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +453 -0
  48. package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +180 -0
  49. package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +349 -0
  50. package/resource/doc/rtcengine/web/plugin/29-advanced-water-mark.md +149 -0
  51. package/resource/doc/rtcengine/web/plugin/30-advanced-cross-room-link.md +96 -0
  52. package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +405 -0
  53. package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +244 -0
  54. package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +84 -0
  55. package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +202 -0
  56. package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +98 -0
  57. package/resource/doc/rtcengine/web/plugin/38-advanced-basic-beauty.md +95 -0
  58. package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +33 -0
  59. package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +380 -0
  60. package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +91 -0
  61. package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +314 -0
  62. package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +180 -0
  63. package/resource/doc/tuicallkit/android/workflow.md +0 -0
  64. package/resource/doc/tuicallkit/flutter/integration.md +510 -0
  65. package/resource/doc/tuicallkit/flutter/workflow.md +331 -0
  66. package/tools/call/get-native-call-integration.js +27 -11
  67. package/tools/call/get-native-call-integration.js.map +1 -1
  68. package/tools/chat/get-native-chat-feature-detail.js +30 -0
  69. package/tools/chat/get-native-chat-feature-detail.js.map +1 -0
  70. package/tools/chat/get-native-chat-integration.js +30 -12
  71. package/tools/chat/get-native-chat-integration.js.map +1 -1
  72. package/tools/common/get-faq.js +2 -4
  73. package/tools/common/get-faq.js.map +1 -1
  74. package/tools/definitions/get_native_call_uikit_integration_def.js +16 -6
  75. package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
  76. package/tools/definitions/get_native_chat_feature_detail_def.js +32 -0
  77. package/tools/definitions/get_native_chat_feature_detail_def.js.map +1 -0
  78. package/tools/definitions/get_native_chat_uikit_integration_def.js +18 -6
  79. package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
  80. package/tools/definitions/{get_native_live_extra_features_def.js → get_native_live_uikit_extra_features_def.js} +3 -3
  81. package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +1 -0
  82. package/tools/definitions/{get_native_live_interaction_def.js → get_native_live_uikit_interaction_def.js} +3 -3
  83. package/tools/definitions/get_native_live_uikit_interaction_def.js.map +1 -0
  84. package/tools/definitions/get_web_chat_uikit_component_detail_def.js +46 -7
  85. package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
  86. package/tools/index.js +6 -4
  87. package/tools/index.js.map +1 -1
  88. package/tools/live/{get_native_live_extra_features.js → get_native_live_uikit_extra_features.js} +4 -4
  89. package/tools/live/get_native_live_uikit_extra_features.js.map +1 -0
  90. package/tools/live/{get_native_live_interaction.js → get_native_live_uikit_interaction.js} +4 -4
  91. package/tools/live/get_native_live_uikit_interaction.js.map +1 -0
  92. package/tools/rtcengine/get-trtc-web-sdk-faq.js +1 -1
  93. package/tools/rtcengine/get-trtc-web-sdk-plugin.js +45 -0
  94. package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +1 -0
  95. package/utils/handle-component-name.js +0 -16
  96. package/utils/handle-component-name.js.map +1 -1
  97. package/utils/report-cls-client.js +1 -1
  98. package/utils/report-es-client.js +1 -1
  99. package/resource/doc/chatuikit/android/integrate_tuichat_only_android.md +0 -382
  100. package/resource/doc/chatuikit/android/ui_api_android.md +0 -418
  101. package/resource/doc/chatuikit/iOS/integrate_tuichat_only_iOS.md +0 -993
  102. package/resource/doc/chatuikit/iOS/ui_api_iOS.md +0 -526
  103. package/resource/doc/tuicallkit/flutter/how_to_integrated_flutter_callkit.md +0 -226
  104. package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +0 -101
  105. package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +0 -98
  106. package/tools/definitions/get_native_live_extra_features_def.js.map +0 -1
  107. package/tools/definitions/get_native_live_interaction_def.js.map +0 -1
  108. package/tools/live/get_native_live_extra_features.js.map +0 -1
  109. package/tools/live/get_native_live_interaction.js.map +0 -1
  110. /package/resource/doc/chatuikit/android/{integrate_tuikit_android.md → integration.md} +0 -0
  111. /package/resource/doc/{tuicallkit/android/.gitkeep → chatuikit/android/workflow.md} +0 -0
  112. /package/resource/doc/chatuikit/{flutter/client_api_Flutter.md → faq/flutter_sdk/client-api.md} +0 -0
  113. /package/resource/doc/chatuikit/{iOS/client_api_iOS.md → faq/ios_sdk/client-api.md} +0 -0
  114. /package/resource/doc/chatuikit/flutter/{integrate_tuikit_Flutter.md → integration.md} +0 -0
  115. /package/resource/doc/chatuikit/iOS/{integrate_tuikit_iOS.md → integration.md} +0 -0
  116. /package/resource/doc/chatuikit/react/components/{chatheader.md → chat-header.md} +0 -0
  117. /package/resource/doc/chatuikit/vue/components/{chatheader.md → chat-header.md} +0 -0
  118. /package/resource/doc/tuicallkit/android/{how_to_integrated_android_callkit.md → integration.md} +0 -0
  119. /package/resource/doc/tuicallkit/{android/api_TUICallObserver.md → faq/android_sdk/call-observer-api.md} +0 -0
  120. /package/resource/doc/tuicallkit/{android/api_TUICallKit.md → faq/android_sdk/callkit-api.md} +0 -0
  121. /package/resource/doc/tuicallkit/{flutter/api_TUICallDefine.md → faq/flutter_sdk/call-define-api.md} +0 -0
  122. /package/resource/doc/tuicallkit/{flutter/api_TUICallObserver.md → faq/flutter_sdk/call-observer-api.md} +0 -0
  123. /package/resource/doc/tuicallkit/{flutter/api_TUICallKit.md → faq/flutter_sdk/callkit-api.md} +0 -0
  124. /package/resource/doc/tuicallkit/{iOS/api_TUICallObserver.md → faq/ios_sdk/call-observer-api.md} +0 -0
  125. /package/resource/doc/tuicallkit/{iOS/api_TUICallKit.md → faq/ios_sdk/callkit-api.md} +0 -0
  126. /package/resource/doc/tuicallkit/iOS/{how_to_integrated_iOS_callkit.md → integration.md} +0 -0
@@ -0,0 +1,1331 @@
1
+ ## 概述
2
+
3
+ ContactList 是一个高度可配置的联系人列表组件。该组件支持好友列表、群组列表、黑名单和申请管理,提供分组折叠、搜索过滤、自定义渲染等核心功能,适用于即时通讯、社交应用等场景的联系人管理界面。
4
+
5
+
6
+
7
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/1301c6bb66dd11f09a9d52540044a08e.png)
8
+
9
+
10
+ ## ContactList Props
11
+ <table>
12
+ <tr>
13
+ <td rowspan="1" colSpan="1" >字段</td>
14
+
15
+ <td rowspan="1" colSpan="1" >类型</td>
16
+
17
+ <td rowspan="1" colSpan="1" >默认值</td>
18
+
19
+ <td rowspan="1" colSpan="1" >描述</td>
20
+ </tr>
21
+
22
+ <tr>
23
+ <td rowspan="1" colSpan="1" >activeContactItem</td>
24
+
25
+ <td rowspan="1" colSpan="1" >ContactGroupItem \| undefined</td>
26
+
27
+ <td rowspan="1" colSpan="1" >`undefined`</td>
28
+
29
+ <td rowspan="1" colSpan="1" >当前激活的联系人项</td>
30
+ </tr>
31
+
32
+ <tr>
33
+ <td rowspan="1" colSpan="1" >enableSearch</td>
34
+
35
+ <td rowspan="1" colSpan="1" >boolean</td>
36
+
37
+ <td rowspan="1" colSpan="1" >`true`</td>
38
+
39
+ <td rowspan="1" colSpan="1" >是否启用搜索功能</td>
40
+ </tr>
41
+
42
+ <tr>
43
+ <td rowspan="1" colSpan="1" >groupConfig</td>
44
+
45
+ <td rowspan="1" colSpan="1" >Partial<Record<ContactItemType, CustomGroupConfig>></td>
46
+
47
+ <td rowspan="1" colSpan="1" >`{}`</td>
48
+
49
+ <td rowspan="1" colSpan="1" >自定义分组配置</td>
50
+ </tr>
51
+
52
+ <tr>
53
+ <td rowspan="1" colSpan="1" >className</td>
54
+
55
+ <td rowspan="1" colSpan="1" >string</td>
56
+
57
+ <td rowspan="1" colSpan="1" >`undefined`</td>
58
+
59
+ <td rowspan="1" colSpan="1" >自定义 CSS 类名</td>
60
+ </tr>
61
+
62
+ <tr>
63
+ <td rowspan="1" colSpan="1" >style</td>
64
+
65
+ <td rowspan="1" colSpan="1" >React.CSSProperties</td>
66
+
67
+ <td rowspan="1" colSpan="1" >`undefined`</td>
68
+
69
+ <td rowspan="1" colSpan="1" >自定义内联样式</td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <td rowspan="1" colSpan="1" >searchPlaceholder</td>
74
+
75
+ <td rowspan="1" colSpan="1" >string</td>
76
+
77
+ <td rowspan="1" colSpan="1" >`'Search contacts'`</td>
78
+
79
+ <td rowspan="1" colSpan="1" >搜索框占位符文本</td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td rowspan="1" colSpan="1" >emptyText</td>
84
+
85
+ <td rowspan="1" colSpan="1" >string</td>
86
+
87
+ <td rowspan="1" colSpan="1" >`'No contacts'`</td>
88
+
89
+ <td rowspan="1" colSpan="1" >空状态提示文本</td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td rowspan="1" colSpan="1" >ContactItem</td>
94
+
95
+ <td rowspan="1" colSpan="1" >React.ComponentType<ContactListItemProps> \| undefined</td>
96
+
97
+ <td rowspan="1" colSpan="1" >`ContactListItem`</td>
98
+
99
+ <td rowspan="1" colSpan="1" >自定义联系人项组件</td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td rowspan="1" colSpan="1" >ContactSearchComponent</td>
104
+
105
+ <td rowspan="1" colSpan="1" >React.ComponentType<ContactSearchProps> \| undefined</td>
106
+
107
+ <td rowspan="1" colSpan="1" >`ContactSearch`</td>
108
+
109
+ <td rowspan="1" colSpan="1" >自定义搜索组件</td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td rowspan="1" colSpan="1" >GroupHeader</td>
114
+
115
+ <td rowspan="1" colSpan="1" >React.ComponentType<{ data: ContactGroup }> \| undefined</td>
116
+
117
+ <td rowspan="1" colSpan="1" >默认分组头</td>
118
+
119
+ <td rowspan="1" colSpan="1" >自定义分组头部组件</td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td rowspan="1" colSpan="1" >PlaceholderEmptyList</td>
124
+
125
+ <td rowspan="1" colSpan="1" >React.ReactNode \| undefined</td>
126
+
127
+ <td rowspan="1" colSpan="1" >默认空状态</td>
128
+
129
+ <td rowspan="1" colSpan="1" >自定义空状态组件</td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <td rowspan="1" colSpan="1" >onContactItemClick</td>
134
+
135
+ <td rowspan="1" colSpan="1" >(item: ContactGroupItem) => void</td>
136
+
137
+ <td rowspan="1" colSpan="1" >`undefined`</td>
138
+
139
+ <td rowspan="1" colSpan="1" >联系人项点击事件</td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td rowspan="1" colSpan="1" >onFriendApplicationAction</td>
144
+
145
+ <td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: FriendApplication) => void</td>
146
+
147
+ <td rowspan="1" colSpan="1" >`undefined`</td>
148
+
149
+ <td rowspan="1" colSpan="1" >好友申请操作事件</td>
150
+ </tr>
151
+
152
+ <tr>
153
+ <td rowspan="1" colSpan="1" >onGroupApplicationAction</td>
154
+
155
+ <td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: GroupApplication) => void</td>
156
+
157
+ <td rowspan="1" colSpan="1" >`undefined`</td>
158
+
159
+ <td rowspan="1" colSpan="1" >群组申请操作事件</td>
160
+ </tr>
161
+ </table>
162
+
163
+
164
+ ## ContactInfo props
165
+ <table>
166
+ <tr>
167
+ <td rowspan="1" colSpan="1" >字段</td>
168
+
169
+ <td rowspan="1" colSpan="1" >类型</td>
170
+
171
+ <td rowspan="1" colSpan="1" >默认值</td>
172
+
173
+ <td rowspan="1" colSpan="1" >描述</td>
174
+ </tr>
175
+
176
+ <tr>
177
+ <td rowspan="1" colSpan="1" >contactItem</td>
178
+
179
+ <td rowspan="1" colSpan="1" >ContactGroupItem \| undefined</td>
180
+
181
+ <td rowspan="1" colSpan="1" >`undefined`</td>
182
+
183
+ <td rowspan="1" colSpan="1" >当前显示的联系人项</td>
184
+ </tr>
185
+
186
+ <tr>
187
+ <td rowspan="1" colSpan="1" >showActions</td>
188
+
189
+ <td rowspan="1" colSpan="1" >boolean</td>
190
+
191
+ <td rowspan="1" colSpan="1" >`true`</td>
192
+
193
+ <td rowspan="1" colSpan="1" >是否显示操作按钮</td>
194
+ </tr>
195
+
196
+ <tr>
197
+ <td rowspan="1" colSpan="1" >PlaceholderEmpty</td>
198
+
199
+ <td rowspan="1" colSpan="1" >React.ReactNode \| undefined</td>
200
+
201
+ <td rowspan="1" colSpan="1" >`undefined`</td>
202
+
203
+ <td rowspan="1" colSpan="1" >空状态占位组件</td>
204
+ </tr>
205
+
206
+ <tr>
207
+ <td rowspan="1" colSpan="1" >FriendInfoComponent</td>
208
+
209
+ <td rowspan="1" colSpan="1" >React.ComponentType<FriendInfoProps></td>
210
+
211
+ <td rowspan="1" colSpan="1" >`FriendInfo`</td>
212
+
213
+ <td rowspan="1" colSpan="1" >好友信息组件</td>
214
+ </tr>
215
+
216
+ <tr>
217
+ <td rowspan="1" colSpan="1" >GroupInfoComponent</td>
218
+
219
+ <td rowspan="1" colSpan="1" >React.ComponentType<GroupInfoProps></td>
220
+
221
+ <td rowspan="1" colSpan="1" >`GroupInfo`</td>
222
+
223
+ <td rowspan="1" colSpan="1" >群组信息组件</td>
224
+ </tr>
225
+
226
+ <tr>
227
+ <td rowspan="1" colSpan="1" >BlacklistInfoComponent</td>
228
+
229
+ <td rowspan="1" colSpan="1" >React.ComponentType<BlacklistInfoProps></td>
230
+
231
+ <td rowspan="1" colSpan="1" >`BlacklistInfo`</td>
232
+
233
+ <td rowspan="1" colSpan="1" >黑名单信息组件</td>
234
+ </tr>
235
+
236
+ <tr>
237
+ <td rowspan="1" colSpan="1" >FriendApplicationInfoComponent</td>
238
+
239
+ <td rowspan="1" colSpan="1" >React.ComponentType<FriendApplicationInfoProps></td>
240
+
241
+ <td rowspan="1" colSpan="1" >`FriendApplicationInfo`</td>
242
+
243
+ <td rowspan="1" colSpan="1" >好友申请信息组件</td>
244
+ </tr>
245
+
246
+ <tr>
247
+ <td rowspan="1" colSpan="1" >GroupApplicationInfoComponent</td>
248
+
249
+ <td rowspan="1" colSpan="1" >React.ComponentType<GroupApplicationInfoProps></td>
250
+
251
+ <td rowspan="1" colSpan="1" >`GroupApplicationInfo`</td>
252
+
253
+ <td rowspan="1" colSpan="1" >群组申请信息组件</td>
254
+ </tr>
255
+
256
+ <tr>
257
+ <td rowspan="1" colSpan="1" >SearchGroupInfoComponent</td>
258
+
259
+ <td rowspan="1" colSpan="1" >React.ComponentType<SearchGroupInfoProps></td>
260
+
261
+ <td rowspan="1" colSpan="1" >`SearchGroupInfo`</td>
262
+
263
+ <td rowspan="1" colSpan="1" >搜索群组信息组件</td>
264
+ </tr>
265
+
266
+ <tr>
267
+ <td rowspan="1" colSpan="1" >SearchUserInfoComponent</td>
268
+
269
+ <td rowspan="1" colSpan="1" >React.ComponentType<SearchUserInfoProps></td>
270
+
271
+ <td rowspan="1" colSpan="1" >`SearchUserInfo`</td>
272
+
273
+ <td rowspan="1" colSpan="1" >搜索用户信息组件</td>
274
+ </tr>
275
+
276
+ <tr>
277
+ <td rowspan="1" colSpan="1" >onClose</td>
278
+
279
+ <td rowspan="1" colSpan="1" >() => void</td>
280
+
281
+ <td rowspan="1" colSpan="1" >`undefined`</td>
282
+
283
+ <td rowspan="1" colSpan="1" >关闭信息面板回调</td>
284
+ </tr>
285
+
286
+ <tr>
287
+ <td rowspan="1" colSpan="1" >onSendMessage</td>
288
+
289
+ <td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
290
+
291
+ <td rowspan="1" colSpan="1" >`undefined`</td>
292
+
293
+ <td rowspan="1" colSpan="1" >发送消息回调</td>
294
+ </tr>
295
+
296
+ <tr>
297
+ <td rowspan="1" colSpan="1" >onDeleteFriend</td>
298
+
299
+ <td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
300
+
301
+ <td rowspan="1" colSpan="1" >`undefined`</td>
302
+
303
+ <td rowspan="1" colSpan="1" >删除好友回调</td>
304
+ </tr>
305
+
306
+ <tr>
307
+ <td rowspan="1" colSpan="1" >onUpdateFriendRemark</td>
308
+
309
+ <td rowspan="1" colSpan="1" >(friend: Friend, remark: string) => void</td>
310
+
311
+ <td rowspan="1" colSpan="1" >`undefined`</td>
312
+
313
+ <td rowspan="1" colSpan="1" >更新好友备注回调</td>
314
+ </tr>
315
+
316
+ <tr>
317
+ <td rowspan="1" colSpan="1" >onAddToBlacklist</td>
318
+
319
+ <td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
320
+
321
+ <td rowspan="1" colSpan="1" >`undefined`</td>
322
+
323
+ <td rowspan="1" colSpan="1" >添加到黑名单回调</td>
324
+ </tr>
325
+
326
+ <tr>
327
+ <td rowspan="1" colSpan="1" >onRemoveFromBlacklist</td>
328
+
329
+ <td rowspan="1" colSpan="1" >(profile: UserProfile) => void</td>
330
+
331
+ <td rowspan="1" colSpan="1" >`undefined`</td>
332
+
333
+ <td rowspan="1" colSpan="1" >从黑名单移除回调</td>
334
+ </tr>
335
+
336
+ <tr>
337
+ <td rowspan="1" colSpan="1" >onEnterGroup</td>
338
+
339
+ <td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
340
+
341
+ <td rowspan="1" colSpan="1" >`undefined`</td>
342
+
343
+ <td rowspan="1" colSpan="1" >进入群组回调</td>
344
+ </tr>
345
+
346
+ <tr>
347
+ <td rowspan="1" colSpan="1" >onLeaveGroup</td>
348
+
349
+ <td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
350
+
351
+ <td rowspan="1" colSpan="1" >`undefined`</td>
352
+
353
+ <td rowspan="1" colSpan="1" >退出群组回调</td>
354
+ </tr>
355
+
356
+ <tr>
357
+ <td rowspan="1" colSpan="1" >onDismissGroup</td>
358
+
359
+ <td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
360
+
361
+ <td rowspan="1" colSpan="1" >`undefined`</td>
362
+
363
+ <td rowspan="1" colSpan="1" >解散群组回调</td>
364
+ </tr>
365
+
366
+ <tr>
367
+ <td rowspan="1" colSpan="1" >onFriendApplicationAction</td>
368
+
369
+ <td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: FriendApplication) => void</td>
370
+
371
+ <td rowspan="1" colSpan="1" >`undefined`</td>
372
+
373
+ <td rowspan="1" colSpan="1" >好友申请操作回调</td>
374
+ </tr>
375
+
376
+ <tr>
377
+ <td rowspan="1" colSpan="1" >onGroupApplicationAction</td>
378
+
379
+ <td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: GroupApplication) => void</td>
380
+
381
+ <td rowspan="1" colSpan="1" >`undefined`</td>
382
+
383
+ <td rowspan="1" colSpan="1" >群组申请操作回调</td>
384
+ </tr>
385
+
386
+ <tr>
387
+ <td rowspan="1" colSpan="1" >onAddFriend</td>
388
+
389
+ <td rowspan="1" colSpan="1" >(user: UserProfile, wording: string) => void</td>
390
+
391
+ <td rowspan="1" colSpan="1" >`undefined`</td>
392
+
393
+ <td rowspan="1" colSpan="1" >添加好友回调</td>
394
+ </tr>
395
+
396
+ <tr>
397
+ <td rowspan="1" colSpan="1" >onJoinGroup</td>
398
+
399
+ <td rowspan="1" colSpan="1" >(group: GroupModel, note: string) => void</td>
400
+
401
+ <td rowspan="1" colSpan="1" >`undefined`</td>
402
+
403
+ <td rowspan="1" colSpan="1" >加入群组回调</td>
404
+ </tr>
405
+ </table>
406
+
407
+
408
+ ## 基础使用
409
+ ``` tsx
410
+ import { ContactList, ContactInfo } from '@tencentcloud/chat-uikit-react';
411
+
412
+ function App() {
413
+ return (
414
+ <div>
415
+ <ContactList />
416
+ <ContactInfo />
417
+ </div>
418
+ );
419
+ }
420
+ ```
421
+
422
+ ## 自定义能力
423
+
424
+ ### 自定义联系列表搜索功能开关
425
+
426
+ 通过设置 `enableSearch` 参数,您可以灵活地控制 ContactList 中的搜索好友群组功能的显示。
427
+ ``` typescript
428
+ <ContactList enableSearch={false} />
429
+ ```
430
+
431
+ 效果如下图所示:
432
+
433
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/2147e4f366de11f09b85525400bf7822.png)
434
+
435
+ ### 自定义联系列表联系人分组配置
436
+
437
+ `groupConfig` 用于自定义分组配置,包括标题、显示顺序、隐藏状态等,默认值为 `{}`。
438
+
439
+
440
+
441
+ 【自定义分组标题】
442
+ ``` typescript
443
+ import React from 'react';
444
+ import { ContactList } from '@tencentcloud/chat-uikit-react';
445
+ import { ContactItemType } from '@tencentcloud/chat-uikit-react';
446
+
447
+ function CustomGroupTitlesContactList() {
448
+ const groupConfig = {
449
+ [ContactItemType.FRIEND]: {
450
+ title: '我的好友',
451
+ order: 1
452
+ },
453
+ [ContactItemType.GROUP]: {
454
+ title: '我的群组',
455
+ order: 2
456
+ },
457
+ [ContactItemType.FRIEND_REQUEST]: {
458
+ title: '好友申请',
459
+ order: 0
460
+ }
461
+ };
462
+
463
+ return (
464
+ <ContactList
465
+ groupConfig={groupConfig}
466
+ onContactItemClick={(item) => {
467
+ console.log('联系人点击:', item);
468
+ }}
469
+ />
470
+ );
471
+ }
472
+ ```
473
+
474
+ 效果如下图所示:
475
+
476
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/1c780045676711f09b85525400bf7822.png)
477
+
478
+ 【隐藏特定分组】
479
+ ``` tsx
480
+ import React from 'react';
481
+ import { ContactList } from '@tencentcloud/chat-uikit-react';
482
+ import { ContactItemType } from '@tencentcloud/chat-uikit-react';
483
+
484
+ function HiddenGroupsContactList() {
485
+ const groupConfig = {
486
+ [ContactItemType.BLACK]: {
487
+ title: '黑名单',
488
+ hidden: true // 隐藏黑名单分组
489
+ },
490
+ [ContactItemType.GROUP_REQUEST]: {
491
+ title: '群组申请',
492
+ hidden: true // 隐藏群组申请分组
493
+ }
494
+ };
495
+
496
+ return (
497
+ <ContactList
498
+ groupConfig={groupConfig}
499
+ onContactItemClick={(item) => {
500
+ console.log('联系人点击:', item);
501
+ }}
502
+ />
503
+ );
504
+ }
505
+ ```
506
+
507
+ 效果如下图所示:
508
+
509
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/0b5061fa676711f0bd33525400e889b2.png)
510
+
511
+ ### 自定义联系列表子项
512
+
513
+ ContactItem 用于自定义联系人项的渲染组件,默认值为内置的 `ContactListItem` 组件。
514
+ ``` typescript
515
+ import React from 'react';
516
+ import { ContactList, Avatar } from '@tencentcloud/chat-uikit-react';
517
+ import type { ContactListItemProps } from '@tencentcloud/chat-uikit-react';
518
+
519
+ const SimpleContactItem: React.FC<ContactListItemProps> = ({
520
+ contactItem,
521
+ onClick,
522
+ activeContactItem
523
+ }) => {
524
+ const isActive = activeContactItem?.data.userID === contactItem.data.userID;
525
+
526
+ return (
527
+ <div
528
+ className={`simple-contact-item ${isActive ? 'active' : ''}`}
529
+ onClick={() => onClick?.(contactItem.type, contactItem.data)}
530
+ style={{
531
+ padding: '8px 12px',
532
+ borderBottom: '1px solid #f0f0f0',
533
+ cursor: 'pointer',
534
+ backgroundColor: isActive ? '#e6f7ff' : 'transparent'
535
+ }}
536
+ >
537
+ <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
538
+ <Avatar src={contactItem.data.avatar} alt="avatar" />
539
+ <span>{contactItem.data.nick || contactItem.data.name}</span>
540
+ </div>
541
+ </div>
542
+ );
543
+ };
544
+
545
+ function ContactListWithSimpleItems() {
546
+ return (
547
+ <ContactList
548
+ ContactItem={SimpleContactItem}
549
+ onContactItemClick={(item) => {
550
+ console.log('联系人点击:', item);
551
+ }}
552
+ />
553
+ );
554
+ }
555
+ ```
556
+
557
+ 效果如下图所示:
558
+
559
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/849d4e5e66e111f0bd33525400e889b2.png)
560
+
561
+ ### 自定义联系人详情操作按钮开关
562
+
563
+ `showActions` 用于控制是否显示操作按钮,默认值为 `true`。
564
+ ``` typescript
565
+ import React from 'react';
566
+ import { ContactInfo } from '@tencentcloud/chat-uikit-react';
567
+
568
+ function ReadOnlyContactInfo() {
569
+ const friendData = {
570
+ type: ContactItemType.FRIEND,
571
+ data: {
572
+ userID: 'user123',
573
+ nick: '张三',
574
+ avatar: 'https://example.com/avatar.jpg',
575
+ remark: '同事',
576
+ // ... 其他好友属性
577
+ },
578
+ };
579
+
580
+ return (
581
+ <ContactInfo
582
+ contactItem={friendData}
583
+ showActions={false} // 隐藏所有操作按钮,只显示信息
584
+ />
585
+ );
586
+ }
587
+ ```
588
+
589
+ 效果如下图所示:
590
+
591
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/0a5c7141676911f0b5365254001c06ec.png)
592
+
593
+
594
+ ### 自定义联系人详情空状态
595
+
596
+ `PlaceholderEmpty` 用于自定义空状态显示内容,默认值为 `undefined`。
597
+ ``` typescript
598
+ import React from 'react';
599
+ import { ContactInfo } from '@tencentcloud/chat-uikit-react';
600
+
601
+ function CustomEmptyState() {
602
+ const EmptyPlaceholder = () => (
603
+ <div style={{
604
+ width: '100%',
605
+ textAlign: 'center',
606
+ padding: '40px 20px',
607
+ color: '#999',
608
+ fontSize: '14px',
609
+ background: '#fff',
610
+ }}>
611
+ <div style={{ fontSize: '48px', marginBottom: '16px' }}>👤</div>
612
+ <div>请选择一个联系人查看详细信息</div>
613
+ <div style={{ marginTop: '8px', fontSize: '12px' }}>
614
+ 点击左侧联系人列表中的任意项目
615
+ </div>
616
+ </div>
617
+ );
618
+
619
+ return (
620
+ <ContactInfo
621
+ contactItem={undefined}
622
+ PlaceholderEmpty={<EmptyPlaceholder />}
623
+ />
624
+ );
625
+ }
626
+ ```
627
+
628
+ 效果如下图所示:
629
+
630
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/4a270500676911f0924f5254005ef0f7.png)
631
+
632
+
633
+ ### 自定义联系人详情组件
634
+
635
+ > **说明:**
636
+ >
637
+ > - `FriendInfoComponent` 用于自定义好友信息组件,默认值为内置的 `FriendInfo` 组件。
638
+ > - `GroupInfoComponent` 用于自定义群组信息组件,默认值为内置的 `GroupInfo` 组件。
639
+ > - `BlacklistInfoComponent` 用于自定义黑名单信息组件,默认值为内置的 `BlacklistInfo` 组件。
640
+ > - `FriendApplicationInfoComponent` 用于自定义好友申请信息组件,默认值为内置的 `FriendApplicationInfo` 组件。
641
+ > - `GroupApplicationInfoComponent` 用于自定义群组申请信息组件,默认值为内置的 `GroupApplicationInfo` 组件。
642
+
643
+
644
+
645
+
646
+ 【自定义好友信息组件】
647
+ ``` typescript
648
+ import React from 'react';
649
+ import { ContactInfo } from '@tencentcloud/chat-uikit-react';
650
+ import type { FriendInfoProps, Friend } from '@tencentcloud/chat-uikit-react';
651
+ import { Button } from '@tencentcloud/uikit-base-component-react';
652
+
653
+ // 自定义好友信息组件
654
+ const CustomFriendInfo: React.FC<FriendInfoProps> = ({
655
+ friend,
656
+ showActions,
657
+ onClose,
658
+ onSendMessage,
659
+ onDeleteFriend
660
+ }) => {
661
+ return (
662
+ <div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
663
+ <div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
664
+ <img
665
+ src={friend.avatar}
666
+ alt="avatar"
667
+ style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
668
+ />
669
+ <div>
670
+ <h3 style={{ margin: '0 0 4px 0' }}>{friend.nick}</h3>
671
+ <p style={{ margin: '0', color: '#666' }}>备注: {friend.remark}</p>
672
+ </div>
673
+ </div>
674
+
675
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
676
+ <p><strong>用户ID:</strong> {friend.userID}</p>
677
+ <p><strong>个性签名:</strong> {friend.selfSignature}</p>
678
+ <p><strong>位置:</strong> {friend.location}</p>
679
+ </div>
680
+
681
+
682
+ {showActions && (
683
+ <div style={{ display: 'flex', gap: '8px' }}>
684
+ <Button onClick={() => onSendMessage?.(friend)}>发送消息</Button>
685
+ <Button onClick={() => onDeleteFriend?.(friend)}>删除好友</Button>
686
+ <Button onClick={onClose}>关闭</Button>
687
+ </div>
688
+ )}
689
+ </div>
690
+ );
691
+ };
692
+
693
+ function CustomFriendInfoDemo() {
694
+ const friendData = {
695
+ type: ContactItemType.FRIEND,
696
+ data: {
697
+ userID: 'user123',
698
+ nick: '张三',
699
+ avatar: 'https://example.com/avatar.jpg',
700
+ remark: '同事',
701
+ selfSignature: '热爱技术,热爱生活',
702
+ location: '北京',
703
+ // ... 其他属性
704
+ },
705
+ };
706
+
707
+ return (
708
+ <ContactInfo
709
+ contactItem={friendData}
710
+ FriendInfoComponent={CustomFriendInfo}
711
+ onSendMessage={(friend) => console.log('发送消息给:', friend.nick)}
712
+ onDeleteFriend={(friend) => console.log('删除好友:', friend.nick)}
713
+ />
714
+ );
715
+ }
716
+ ```
717
+
718
+ 效果如下图所示:
719
+
720
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/56337044676a11f0b5365254001c06ec.png)
721
+
722
+ 【自定义群组信息组件】
723
+ ``` typescript
724
+ import React from 'react';
725
+ import { ContactInfo, GroupMemberRole } from '@tencentcloud/uikit-component-react';
726
+ import type { GroupInfoProps, GroupModel } from '@tencentcloud/uikit-component-react';
727
+ import { Button } from '@tencentcloud/uikit-base-component-react';
728
+
729
+ // 自定义群组信息组件
730
+ const CustomGroupInfo: React.FC<GroupInfoProps> = ({
731
+ group,
732
+ showActions,
733
+ onClose,
734
+ onEnterGroup,
735
+ onLeaveGroup,
736
+ onDismissGroup
737
+ }) => {
738
+ const isOwner = group.selfInfo?.role === GroupMemberRole.OWNER; // 群主
739
+ const isAdmin = group.selfInfo?.role === GroupMemberRole.ADMIN; // 管理员
740
+
741
+ return (
742
+ <div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
743
+ <div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
744
+ <img
745
+ src={group.avatar}
746
+ alt="group avatar"
747
+ style={{ width: '60px', height: '60px', borderRadius: '8px', marginRight: '16px' }}
748
+ />
749
+ <div>
750
+ <h3 style={{ margin: '0 0 4px 0' }}>{group.name}</h3>
751
+ <p style={{ margin: '0', color: '#666' }}>
752
+ 群组ID: {group.groupID}
753
+ </p>
754
+ </div>
755
+ </div>
756
+
757
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
758
+ <p><strong>群组介绍:</strong> {group.introduction}</p>
759
+ <p><strong>群组公告:</strong> {group.notification}</p>
760
+ <p><strong>成员数量:</strong> {group.memberCount}/{group.maxMemberCount}</p>
761
+ <p><strong>我的角色:</strong> {
762
+ isOwner ? '群主' : isAdmin ? '管理员' : '普通成员'
763
+ }</p>
764
+ </div>
765
+
766
+ {showActions && (
767
+ <div style={{ display: 'flex', gap: '8px' }}>
768
+ <Button onClick={() => onEnterGroup?.(group)}>进入群组</Button>
769
+ <Button onClick={() => onLeaveGroup?.(group)}>退出群组</Button>
770
+ {isOwner && (
771
+ <Button onClick={() => onDismissGroup?.(group)}>解散群组</Button>
772
+ )}
773
+ <Button onClick={onClose}>关闭</Button>
774
+ </div>
775
+ )}
776
+ </div>
777
+ );
778
+ };
779
+
780
+ function CustomGroupInfoDemo() {
781
+ const groupData = {
782
+ type: ContactItemType.GROUP,
783
+ data: {
784
+ groupID: 'group123',
785
+ name: '技术交流群',
786
+ avatar: 'https://example.com/group-avatar.jpg',
787
+ type: 'Public',
788
+ introduction: '技术交流与分享',
789
+ notification: '欢迎加入技术交流群',
790
+ ownerID: 'owner123',
791
+ memberCount: 100,
792
+ maxMemberCount: 200,
793
+ selfInfo: {
794
+ userID: 'currentUser',
795
+ role: GroupMemberRole.OWNER, // 群主
796
+ nameCard: '群主',
797
+ joinTime: Date.now(),
798
+ },
799
+ },
800
+ };
801
+
802
+ return (
803
+ <ContactInfo
804
+ contactItem={groupData}
805
+ GroupInfoComponent={CustomGroupInfo}
806
+ onEnterGroup={(group) => console.log('进入群组:', group.name)}
807
+ onLeaveGroup={(group) => console.log('退出群组:', group.name)}
808
+ onDismissGroup={(group) => console.log('解散群组:', group.name)}
809
+ />
810
+ );
811
+ }
812
+ ```
813
+
814
+ 效果如下图所示:
815
+
816
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/c93c8710676b11f0bd33525400e889b2.png)
817
+
818
+ 【自定义黑名单信息组件】
819
+ ``` typescript
820
+ import React from 'react';
821
+ import { ContactInfo } from '@tencentcloud/uikit-component-react';
822
+ import type { BlacklistInfoProps, UserProfile } from '@tencentcloud/uikit-component-react';
823
+ import { Button } from '@tencentcloud/uikit-base-component-react';
824
+
825
+ // 自定义黑名单信息组件
826
+ const CustomBlacklistInfo: React.FC<BlacklistInfoProps> = ({
827
+ profile,
828
+ showActions,
829
+ onClose,
830
+ onRemoveFromBlacklist
831
+ }) => {
832
+ return (
833
+ <div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
834
+ <div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
835
+ <img
836
+ src={profile.src}
837
+ alt="avatar"
838
+ style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
839
+ />
840
+ <div>
841
+ <h3 style={{ margin: '0 0 4px 0', color: '#ff4d4f' }}>{profile.nick}</h3>
842
+ <p style={{ margin: '0', color: '#666' }}>用户ID: {profile.userID}</p>
843
+ </div>
844
+ </div>
845
+
846
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
847
+ <p><strong>个性签名:</strong> {profile.selfSignature}</p>
848
+ <p><strong>位置:</strong> {profile.location}</p>
849
+ <p style={{ color: '#ff4d4f', fontWeight: 'bold' }}>
850
+ ⚠️ 此用户已被加入黑名单
851
+ </p>
852
+ </div>
853
+
854
+ {showActions && (
855
+ <div style={{ display: 'flex', gap: '8px' }}>
856
+ <Button
857
+ onClick={() => onRemoveFromBlacklist?.(profile)}
858
+ style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
859
+ >
860
+ 移出黑名单
861
+ </Button>
862
+ <Button onClick={onClose}>关闭</Button>
863
+ </div>
864
+ )}
865
+ </div>
866
+ );
867
+ };
868
+
869
+ function CustomBlacklistInfoDemo() {
870
+ const blacklistData = {
871
+ type: ContactItemType.BLACK,
872
+ data: {
873
+ userID: 'user456',
874
+ nick: '李四',
875
+ src: 'https://example.com/avatar2.jpg',
876
+ gender: 1,
877
+ birthday: 19920101,
878
+ location: '深圳',
879
+ selfSignature: '被拉黑用户',
880
+ allowType: 1,
881
+ adminForbidType: 0,
882
+ },
883
+ };
884
+
885
+ return (
886
+ <ContactInfo
887
+ contactItem={blacklistData}
888
+ BlacklistInfoComponent={CustomBlacklistInfo}
889
+ onRemoveFromBlacklist={(profile) => console.log('移出黑名单:', profile.nick)}
890
+ />
891
+ );
892
+ }
893
+ ```
894
+
895
+ 效果如下图所示:
896
+
897
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/e8aea7e0676c11f09b85525400bf7822.png)
898
+
899
+ 【自定义好友申请信息组件】
900
+ ``` typescript
901
+ import React from 'react';
902
+ import { ContactInfo } from '@tencentcloud/uikit-component-react';
903
+ import type { FriendApplicationInfoProps, FriendApplication } from '@tencentcloud/uikit-component-react';
904
+ import { Button } from '@tencentcloud/uikit-base-component-react';
905
+
906
+ // 自定义好友申请信息组件
907
+ const CustomFriendApplicationInfo: React.FC<FriendApplicationInfoProps> = ({
908
+ application,
909
+ showActions,
910
+ onClose,
911
+ onAccept,
912
+ onRefuse
913
+ }) => {
914
+ const formatTime = (timestamp: number) => {
915
+ return new Date(timestamp).toLocaleString();
916
+ };
917
+
918
+ return (
919
+ <div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
920
+ <div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
921
+ <img
922
+ src={application.src}
923
+ alt="avatar"
924
+ style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
925
+ />
926
+ <div>
927
+ <h3 style={{ margin: '0 0 4px 0' }}>{application.nick}</h3>
928
+ <p style={{ margin: '0', color: '#666' }}>申请时间: {formatTime(application.time)}</p>
929
+ </div>
930
+ </div>
931
+
932
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
933
+ <p><strong>申请来源:</strong> {application.source}</p>
934
+ <p><strong>申请附言:</strong> {application.wording}</p>
935
+ <p style={{ color: '#1890ff', fontWeight: 'bold' }}>
936
+ 📝 新的好友申请
937
+ </p>
938
+ </div>
939
+
940
+ {showActions && (
941
+ <div style={{ display: 'flex', gap: '8px' }}>
942
+ <Button
943
+ onClick={() => onAccept?.(application)}
944
+ style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
945
+ >
946
+ 接受申请
947
+ </Button>
948
+ <Button
949
+ onClick={() => onRefuse?.(application)}
950
+ style={{ backgroundColor: '#ff4d4f', color: 'white', border: 'none' }}
951
+ >
952
+ 拒绝申请
953
+ </Button>
954
+ <Button onClick={onClose}>关闭</Button>
955
+ </div>
956
+ )}
957
+ </div>
958
+ );
959
+ };
960
+
961
+ function CustomFriendApplicationInfoDemo() {
962
+ const applicationData = {
963
+ type: ContactItemType.FRIEND_REQUEST,
964
+ data: {
965
+ userID: 'user789',
966
+ nick: '王五',
967
+ src: 'https://example.com/avatar3.jpg',
968
+ time: Date.now(),
969
+ source: '搜索添加',
970
+ wording: '你好,我想加你为好友,一起交流技术',
971
+ type: 1,
972
+ },
973
+ };
974
+
975
+ return (
976
+ <ContactInfo
977
+ contactItem={applicationData}
978
+ FriendApplicationInfoComponent={CustomFriendApplicationInfo}
979
+ onFriendApplicationAction={(action, application) => {
980
+ if (action === 'accept') {
981
+ console.log('接受好友申请:', application.nick);
982
+ } else {
983
+ console.log('拒绝好友申请:', application.nick);
984
+ }
985
+ }}
986
+ />
987
+ );
988
+ }
989
+ ```
990
+
991
+ 效果如下图所示:
992
+
993
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/42ea5e27676e11f0924f5254005ef0f7.png)
994
+
995
+ 【自定义群组申请信息组件】
996
+ ``` typescript
997
+ import React from 'react';
998
+ import { ContactInfo } from '@tencentcloud/uikit-component-react';
999
+ import type { GroupApplicationInfoProps, GroupApplication } from '@tencentcloud/uikit-component-react';
1000
+ import { Button } from '@tencentcloud/uikit-base-component-react';
1001
+
1002
+ // 自定义群组申请信息组件
1003
+ const CustomGroupApplicationInfo: React.FC<GroupApplicationInfoProps> = ({
1004
+ application,
1005
+ showActions,
1006
+ onClose,
1007
+ onAccept,
1008
+ onRefuse
1009
+ }) => {
1010
+ const getApplicationTypeText = (type: number) => {
1011
+ return type === 0 ? '用户申请加入' : '邀请用户加入';
1012
+ };
1013
+
1014
+ return (
1015
+ <div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
1016
+ <div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
1017
+ <div style={{ width: '60px', height: '60px', borderRadius: '8px', marginRight: '16px', backgroundColor: '#f0f0f0', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
1018
+ 👥
1019
+ </div>
1020
+ <div>
1021
+ <h3 style={{ margin: '0 0 4px 0' }}>{application.groupName}</h3>
1022
+ <p style={{ margin: '0', color: '#666' }}>
1023
+ {getApplicationTypeText(application.applicationType)}
1024
+ </p>
1025
+ </div>
1026
+ </div>
1027
+
1028
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
1029
+ <p><strong>申请人:</strong> {application.applicantNick}</p>
1030
+ <p><strong>群组ID:</strong> {application.groupID}</p>
1031
+ <p><strong>申请备注:</strong> {application.note}</p>
1032
+ <p style={{ color: '#1890ff', fontWeight: 'bold' }}>
1033
+ 📋 群组申请待处理
1034
+ </p>
1035
+ </div>
1036
+
1037
+ {showActions && (
1038
+ <div style={{ display: 'flex', gap: '8px' }}>
1039
+ <Button
1040
+ onClick={() => onAccept?.(application)}
1041
+ style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
1042
+ >
1043
+ 同意申请
1044
+ </Button>
1045
+ <Button
1046
+ onClick={() => onRefuse?.(application)}
1047
+ style={{ backgroundColor: '#ff4d4f', color: 'white', border: 'none' }}
1048
+ >
1049
+ 拒绝申请
1050
+ </Button>
1051
+ <Button onClick={onClose}>关闭</Button>
1052
+ </div>
1053
+ )}
1054
+ </div>
1055
+ );
1056
+ };
1057
+
1058
+ function CustomGroupApplicationInfoDemo() {
1059
+ const applicationData = {
1060
+ type: ContactItemType.GROUP_REQUEST,
1061
+ data: {
1062
+ applicant: 'user999',
1063
+ applicantNick: '赵六',
1064
+ groupID: 'group456',
1065
+ groupName: '产品经理交流群',
1066
+ applicationType: 0,
1067
+ userID: 'user999',
1068
+ note: '我想加入产品经理交流群,学习产品设计经验',
1069
+ },
1070
+ };
1071
+
1072
+ return (
1073
+ <ContactInfo
1074
+ contactItem={applicationData}
1075
+ GroupApplicationInfoComponent={CustomGroupApplicationInfo}
1076
+ onGroupApplicationAction={(action, application) => {
1077
+ if (action === 'accept') {
1078
+ console.log('同意群组申请:', application.groupName);
1079
+ } else {
1080
+ console.log('拒绝群组申请:', application.groupName);
1081
+ }
1082
+ }}
1083
+ />
1084
+ );
1085
+ }
1086
+ ```
1087
+
1088
+ 效果如下图所示:
1089
+
1090
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/44424b79676f11f09a9d52540044a08e.png)
1091
+
1092
+ ## useContactListState
1093
+
1094
+ ContactListState 是基于 Zustand 的关系链管理钩子,为 ContactLis 组件提供完整的数据管理能力。它支持好友列表、群组列表、黑名单和申请管理等功能关了。如果自定义组件能力不能支持您的业务,可以使用 ContactListState 实现您的需求。
1095
+
1096
+ ### 数据
1097
+ <table>
1098
+ <tr>
1099
+ <td rowspan="1" colSpan="1" >属性名</td>
1100
+
1101
+ <td rowspan="1" colSpan="1" >类型</td>
1102
+
1103
+ <td rowspan="1" colSpan="1" >说明</td>
1104
+ </tr>
1105
+
1106
+ <tr>
1107
+ <td rowspan="1" colSpan="1" >friendList</td>
1108
+
1109
+ <td rowspan="1" colSpan="1" >Friend[]</td>
1110
+
1111
+ <td rowspan="1" colSpan="1" >好友列表</td>
1112
+ </tr>
1113
+
1114
+ <tr>
1115
+ <td rowspan="1" colSpan="1" >groupList</td>
1116
+
1117
+ <td rowspan="1" colSpan="1" >Group[]</td>
1118
+
1119
+ <td rowspan="1" colSpan="1" >群组列表</td>
1120
+ </tr>
1121
+
1122
+ <tr>
1123
+ <td rowspan="1" colSpan="1" >blackList</td>
1124
+
1125
+ <td rowspan="1" colSpan="1" >UserProfile[]</td>
1126
+
1127
+ <td rowspan="1" colSpan="1" >黑名单列表</td>
1128
+ </tr>
1129
+
1130
+ <tr>
1131
+ <td rowspan="1" colSpan="1" >friendApplicationUnreadCount</td>
1132
+
1133
+ <td rowspan="1" colSpan="1" >number</td>
1134
+
1135
+ <td rowspan="1" colSpan="1" >未读好友申请数量</td>
1136
+ </tr>
1137
+
1138
+ <tr>
1139
+ <td rowspan="1" colSpan="1" >friendGroupList</td>
1140
+
1141
+ <td rowspan="1" colSpan="1" >FriendGroup[]</td>
1142
+
1143
+ <td rowspan="1" colSpan="1" >好友分组列表</td>
1144
+ </tr>
1145
+
1146
+ <tr>
1147
+ <td rowspan="1" colSpan="1" >friendApplicationList</td>
1148
+
1149
+ <td rowspan="1" colSpan="1" >FriendApplication[]</td>
1150
+
1151
+ <td rowspan="1" colSpan="1" >好友申请列表</td>
1152
+ </tr>
1153
+
1154
+ <tr>
1155
+ <td rowspan="1" colSpan="1" >groupApplicationList</td>
1156
+
1157
+ <td rowspan="1" colSpan="1" >GroupApplication[]</td>
1158
+
1159
+ <td rowspan="1" colSpan="1" >群组申请列表</td>
1160
+ </tr>
1161
+ </table>
1162
+
1163
+
1164
+ ### 操作方法
1165
+ <table>
1166
+ <tr>
1167
+ <td rowspan="1" colSpan="1" >属性名</td>
1168
+
1169
+ <td rowspan="1" colSpan="1" >类型</td>
1170
+
1171
+ <td rowspan="1" colSpan="1" >说明</td>
1172
+ </tr>
1173
+
1174
+ <tr>
1175
+ <td rowspan="1" colSpan="1" >addFriend</td>
1176
+
1177
+ <td rowspan="1" colSpan="1" >(options: AddFriendParams) => Promise</td>
1178
+
1179
+ <td rowspan="1" colSpan="1" >添加好友</td>
1180
+ </tr>
1181
+
1182
+ <tr>
1183
+ <td rowspan="1" colSpan="1" >deleteFriend</td>
1184
+
1185
+ <td rowspan="1" colSpan="1" >(options: DeleteFriendParams) => Promise</td>
1186
+
1187
+ <td rowspan="1" colSpan="1" >删除好友</td>
1188
+ </tr>
1189
+
1190
+ <tr>
1191
+ <td rowspan="1" colSpan="1" >setFriendRemark</td>
1192
+
1193
+ <td rowspan="1" colSpan="1" >(options: FriendRemarkParams) => Promise</td>
1194
+
1195
+ <td rowspan="1" colSpan="1" >设置好友备注</td>
1196
+ </tr>
1197
+
1198
+ <tr>
1199
+ <td rowspan="1" colSpan="1" >markFriendApplicationAsRead</td>
1200
+
1201
+ <td rowspan="1" colSpan="1" >() => Promise</td>
1202
+
1203
+ <td rowspan="1" colSpan="1" >标记好友申请为已读</td>
1204
+ </tr>
1205
+
1206
+ <tr>
1207
+ <td rowspan="1" colSpan="1" >acceptFriendApplication</td>
1208
+
1209
+ <td rowspan="1" colSpan="1" >(options: FriendApplicationParams) => Promise</td>
1210
+
1211
+ <td rowspan="1" colSpan="1" >接受好友申请</td>
1212
+ </tr>
1213
+
1214
+ <tr>
1215
+ <td rowspan="1" colSpan="1" >refuseFriendApplication</td>
1216
+
1217
+ <td rowspan="1" colSpan="1" >(userID: string) => Promise</td>
1218
+
1219
+ <td rowspan="1" colSpan="1" >拒绝好友申请</td>
1220
+ </tr>
1221
+
1222
+ <tr>
1223
+ <td rowspan="1" colSpan="1" >addToBlacklist</td>
1224
+
1225
+ <td rowspan="1" colSpan="1" >(userIDList: string[]) => Promise</td>
1226
+
1227
+ <td rowspan="1" colSpan="1" >添加到黑名单</td>
1228
+ </tr>
1229
+
1230
+ <tr>
1231
+ <td rowspan="1" colSpan="1" >removeFromBlacklist</td>
1232
+
1233
+ <td rowspan="1" colSpan="1" >(userIDList: string[]) => Promise</td>
1234
+
1235
+ <td rowspan="1" colSpan="1" >从黑名单移除</td>
1236
+ </tr>
1237
+
1238
+ <tr>
1239
+ <td rowspan="1" colSpan="1" >createFriendGroup</td>
1240
+
1241
+ <td rowspan="1" colSpan="1" >(options: FriendGroupParams) => Promise</td>
1242
+
1243
+ <td rowspan="1" colSpan="1" >创建好友分组</td>
1244
+ </tr>
1245
+
1246
+ <tr>
1247
+ <td rowspan="1" colSpan="1" >deleteFriendGroup</td>
1248
+
1249
+ <td rowspan="1" colSpan="1" >(name: string) => Promise</td>
1250
+
1251
+ <td rowspan="1" colSpan="1" >删除好友分组</td>
1252
+ </tr>
1253
+
1254
+ <tr>
1255
+ <td rowspan="1" colSpan="1" >addToFriendGroup</td>
1256
+
1257
+ <td rowspan="1" colSpan="1" >(options: FriendGroupParams) => Promise</td>
1258
+
1259
+ <td rowspan="1" colSpan="1" >添加好友到分组</td>
1260
+ </tr>
1261
+
1262
+ <tr>
1263
+ <td rowspan="1" colSpan="1" >removeFromFriendGroup</td>
1264
+
1265
+ <td rowspan="1" colSpan="1" >(options: FriendGroupParams) => Promise</td>
1266
+
1267
+ <td rowspan="1" colSpan="1" >从分组移除好友</td>
1268
+ </tr>
1269
+
1270
+ <tr>
1271
+ <td rowspan="1" colSpan="1" >renameFriendGroup</td>
1272
+
1273
+ <td rowspan="1" colSpan="1" >(options: RenameFriendGroupParams) => Promise</td>
1274
+
1275
+ <td rowspan="1" colSpan="1" >重命名好友分组</td>
1276
+ </tr>
1277
+
1278
+ <tr>
1279
+ <td rowspan="1" colSpan="1" >joinGroup</td>
1280
+
1281
+ <td rowspan="1" colSpan="1" >(options: JoinGroupParams) => Promise</td>
1282
+
1283
+ <td rowspan="1" colSpan="1" >申请加入群组</td>
1284
+ </tr>
1285
+
1286
+ <tr>
1287
+ <td rowspan="1" colSpan="1" >acceptGroupApplication</td>
1288
+
1289
+ <td rowspan="1" colSpan="1" >(options: GroupApplicationParams) => Promise</td>
1290
+
1291
+ <td rowspan="1" colSpan="1" >接受群组申请</td>
1292
+ </tr>
1293
+
1294
+ <tr>
1295
+ <td rowspan="1" colSpan="1" >refuseGroupApplication</td>
1296
+
1297
+ <td rowspan="1" colSpan="1" >(options: GroupApplicationParams) => Promise</td>
1298
+
1299
+ <td rowspan="1" colSpan="1" >拒绝群组申请</td>
1300
+ </tr>
1301
+ </table>
1302
+
1303
+
1304
+ ## 使用示例
1305
+ ``` typescript
1306
+ import { useContactListState } from '@tencentcloud/chat-uikit-react';
1307
+ const {
1308
+ friendList,
1309
+ groupList,
1310
+ blackList,
1311
+ friendApplicationUnreadCount,
1312
+ friendGroupList,
1313
+ friendApplicationList,
1314
+ groupApplicationList,
1315
+ addFriend,
1316
+ deleteFriend,
1317
+ setFriendRemark,
1318
+ markFriendApplicationAsRead,
1319
+ acceptFriendApplication,
1320
+ refuseFriendApplication,
1321
+ addToBlacklist,
1322
+ removeFromBlacklist,
1323
+ createFriendGroup,
1324
+ deleteFriendGroup,
1325
+ addToFriendGroup,
1326
+ removeFromFriendGroup,
1327
+ joinGroup,
1328
+ acceptGroupApplication,
1329
+ refuseGroupApplication,
1330
+ } = useContactListState();
1331
+ ```