@tencent-rtc/mcp 1.4.6 → 1.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cursor-setting.png +0 -0
- package/knowledge/bm25-cache.js +74 -0
- package/knowledge/bm25-cache.js.map +1 -0
- package/knowledge/bm25.js +148 -0
- package/knowledge/bm25.js.map +1 -0
- package/knowledge/build-index.js +70 -0
- package/knowledge/build-index.js.map +1 -0
- package/knowledge/chunker.js +168 -0
- package/knowledge/chunker.js.map +1 -0
- package/knowledge/content-loader.js +40 -0
- package/knowledge/content-loader.js.map +1 -0
- package/knowledge/doc-url-resolver.js +143 -0
- package/knowledge/doc-url-resolver.js.map +1 -0
- package/knowledge/extractors.js +26 -0
- package/knowledge/extractors.js.map +1 -0
- package/knowledge/path-meta.js +185 -0
- package/knowledge/path-meta.js.map +1 -0
- package/knowledge/search/exact-lookup.js +498 -0
- package/knowledge/search/exact-lookup.js.map +1 -0
- package/knowledge/search/filter-pool.js +105 -0
- package/knowledge/search/filter-pool.js.map +1 -0
- package/knowledge/search/product-scope-intent.js +41 -0
- package/knowledge/search/product-scope-intent.js.map +1 -0
- package/knowledge/search/requires-framework.js +82 -0
- package/knowledge/search/requires-framework.js.map +1 -0
- package/knowledge/search/search-knowledge.js +230 -0
- package/knowledge/search/search-knowledge.js.map +1 -0
- package/mcp-server-prompt.png +0 -0
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +10 -0
- package/resource/_schema/goal-tags.yaml +72 -0
- package/resource/_schema/products.yaml +19 -0
- package/resource/_schema/trtc-intents.yaml +27 -0
- package/resource/_schema/types.yaml +43 -0
- package/resource/index/component-slugs.json +1 -0
- package/resource/index/doc-source-urls.json +1 -0
- package/resource/index/manifest.json +1 -0
- package/resource/{doc → integration}/callkit/preset/android/integration.md +34 -28
- package/resource/integration/callkit/preset/flutter/integration.md +346 -0
- package/resource/integration/callkit/preset/ios/integration.md +408 -0
- package/resource/integration/callkit/preset/react/integration.md +362 -0
- package/resource/integration/callkit/preset/vue/integration.md +356 -0
- package/resource/integration/chat/preset/android/integration.md +500 -0
- package/resource/integration/chat/preset/flutter/integration.md +370 -0
- package/resource/integration/chat/preset/ios/integration.md +566 -0
- package/resource/integration/chat/preset/react/integration.md +490 -0
- package/resource/integration/chat/preset/vue/integration.md +504 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-list-integration.md +26 -22
- package/resource/{doc → integration}/livekit/preset/live/vue/live-player-desk-integration.md +22 -18
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +309 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-pusher-integration.md +47 -39
- package/resource/integration/roomkit/preset/vue/integration.md +562 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +828 -0
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +897 -0
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +363 -0
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1111 -0
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1132 -0
- package/resource/{doc → knowledge}/callkit/core-sdk/flutter/offline-push.md +174 -151
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1084 -0
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1252 -0
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +534 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +953 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1061 -0
- package/resource/knowledge/callkit/faq/android.md +92 -0
- package/resource/{doc/callkit/faq/android-faq.md → knowledge/callkit/faq/common.md} +11 -12
- package/resource/knowledge/callkit/faq/error-code.md +67 -0
- package/resource/knowledge/callkit/faq/flutter.md +52 -0
- package/resource/knowledge/callkit/faq/ios.md +104 -0
- package/resource/knowledge/callkit/faq/web.md +74 -0
- package/resource/knowledge/callkit/preset/android/api.md +412 -0
- package/resource/knowledge/callkit/preset/flutter/api.md +22 -0
- package/resource/knowledge/callkit/preset/ios/api.md +234 -0
- package/resource/knowledge/callkit/preset/web/api.md +83 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +74 -0
- package/resource/knowledge/chat/preset/android/features/contact-list.md +43 -0
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +117 -0
- package/resource/knowledge/chat/preset/android/features/language.md +136 -0
- package/resource/knowledge/chat/preset/android/features/message-input.md +57 -0
- package/resource/knowledge/chat/preset/android/features/message-list.md +142 -0
- package/resource/knowledge/chat/preset/android/features/search.md +64 -0
- package/resource/knowledge/chat/preset/android/features/theme.md +222 -0
- package/resource/knowledge/chat/preset/android-view/integration.md +300 -0
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +64 -0
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +40 -0
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +129 -0
- package/resource/knowledge/chat/preset/flutter/features/language.md +104 -0
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +54 -0
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +158 -0
- package/resource/knowledge/chat/preset/flutter/features/search.md +59 -0
- package/resource/knowledge/chat/preset/flutter/features/theme.md +261 -0
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +94 -0
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +119 -0
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +134 -0
- package/resource/knowledge/chat/preset/ios/features/language.md +125 -0
- package/resource/knowledge/chat/preset/ios/features/message-input.md +69 -0
- package/resource/knowledge/chat/preset/ios/features/message-list.md +162 -0
- package/resource/knowledge/chat/preset/ios/features/search.md +93 -0
- package/resource/knowledge/chat/preset/ios/features/theme.md +270 -0
- package/resource/{doc/chatkit/ios → knowledge/chat/preset/ios-uikit}/integration.md +160 -158
- package/resource/knowledge/chat/preset/react/features/chat-setting.md +101 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/contact-list.md +43 -41
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +215 -0
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +339 -0
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +101 -0
- package/resource/knowledge/chat/preset/react/features/conversation-search.md +61 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-input.md +117 -156
- package/resource/knowledge/chat/preset/react/features/message-list.md +297 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/search.md +65 -59
- package/resource/knowledge/chat/preset/react/features/theme.md +93 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/chat-setting.md +79 -0
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +277 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +234 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +216 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-search.md +13 -13
- package/resource/knowledge/chat/preset/vue/features/message-input.md +551 -0
- package/resource/knowledge/chat/preset/vue/features/message-list.md +350 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/search.md +79 -73
- package/resource/knowledge/chat/preset/vue/features/theme.md +136 -0
- package/resource/knowledge/chat/urls/error-code.md +17 -0
- package/resource/knowledge/chat/urls/product.md +43 -0
- package/resource/knowledge/chat/urls/restapi.md +204 -0
- package/resource/knowledge/chat/urls/sdk/android.md +80 -0
- package/resource/knowledge/chat/urls/sdk/flutter.md +71 -0
- package/resource/knowledge/chat/urls/sdk/ios.md +80 -0
- package/resource/knowledge/chat/urls/sdk/web.md +80 -0
- package/resource/knowledge/chat/urls/webhook.md +68 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +286 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +174 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +329 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +55 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +434 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +362 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +466 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +173 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +488 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +219 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +282 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +212 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +153 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +312 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +404 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +334 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +426 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +166 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +52 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +281 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +150 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +438 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +190 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +192 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +146 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +309 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +370 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +339 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +503 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +188 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +289 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +487 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +183 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/web/index.md +736 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-base-beauty.md +17 -15
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-gift.md +102 -89
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-integration.md +45 -43
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-live-list.md +23 -20
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audience-list.md +41 -41
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audio-effect.md +70 -69
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-barrage.md +68 -71
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-base-beauty.md +43 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-co-guest-interaction.md +59 -56
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-gift.md +103 -105
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-host-interaction.md +869 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-integration.md +84 -87
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-live-list.md +43 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-base-beauty.md +15 -14
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-integration.md +40 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-live-list.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-gift.md +94 -81
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-integration.md +45 -42
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-room-list.md +23 -20
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +260 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +598 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-barrage.md +490 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +65 -59
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +424 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-integration.md +69 -76
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-room-list.md +726 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-integration.md +49 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-room-list.md +19 -18
- package/resource/knowledge/livekit/faq/error-code.md +193 -0
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/barrage.md +56 -53
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-audience-list.md +22 -21
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-view.md +34 -32
- package/resource/knowledge/push/config/android.md +92 -0
- package/resource/knowledge/push/config/harmonyos.md +83 -0
- package/resource/knowledge/push/config/ios.md +254 -0
- package/resource/knowledge/push/config/react-native.md +254 -0
- package/resource/knowledge/push/config/unity.md +209 -0
- package/resource/knowledge/push/config/unreal-engine.md +194 -0
- package/resource/knowledge/push/integration/android.md +404 -0
- package/resource/knowledge/push/integration/flutter.md +465 -0
- package/resource/knowledge/push/integration/harmonyos.md +63 -0
- package/resource/knowledge/push/integration/ios.md +246 -0
- package/resource/knowledge/push/integration/react-native.md +366 -0
- package/resource/knowledge/push/integration/uni-app.md +208 -0
- package/resource/knowledge/push/integration/unity.md +389 -0
- package/resource/knowledge/push/integration/unreal-engine.md +390 -0
- package/resource/knowledge/push/overview/prepare.md +60 -0
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +241 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +588 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +364 -0
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +340 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +230 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +797 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +233 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +569 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +322 -0
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +221 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/device-detection.md +49 -48
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +461 -0
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +216 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +370 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-participant-state.md +61 -60
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +280 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-view.md +57 -56
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +319 -0
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +267 -0
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +261 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +396 -0
- package/resource/knowledge/roomkit/preset/flutter/integration.md +404 -0
- package/resource/knowledge/roomkit/preset/ios/integration.md +369 -0
- package/resource/knowledge/roomkit/preset/react/integration.md +576 -0
- package/resource/knowledge/rtcengine/web/how_to_run_web_sdk_demo.md +44 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/21-advanced-auto-play-policy.md +8 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/22-advanced-audio-mixer.md +19 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/23-advanced-support-detection.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/24-advanced-network-quality.md +8 -8
- package/resource/{doc → knowledge}/rtcengine/web/plugin/25-advanced-device-change.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +6 -6
- package/resource/{doc → knowledge}/rtcengine/web/plugin/27-advanced-small-stream.md +3 -3
- package/resource/{doc → knowledge}/rtcengine/web/plugin/29-advanced-water-mark.md +18 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/34-advanced-proxy.md +2 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/35-advanced-ai-denoiser.md +1 -1
- package/resource/knowledge/trtc/android/TRTCCloud.md +1915 -0
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +1029 -0
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +1095 -0
- package/resource/knowledge/trtc/android/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/android/TXBeautyManager.md +415 -0
- package/resource/knowledge/trtc/android/TXDeviceManager.md +169 -0
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +125 -0
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +2069 -0
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +73 -0
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +391 -0
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1191 -0
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +931 -0
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +127 -0
- package/resource/knowledge/trtc/ios/TRTCCloud.md +2118 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +975 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1131 -0
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +423 -0
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +416 -0
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +387 -0
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +127 -0
- package/server.js +35 -10
- package/server.js.map +1 -1
- package/tools/call/get_native_call_uikit_integration.js +2 -3
- package/tools/call/get_native_call_uikit_integration.js.map +1 -1
- package/tools/call/get_native_callkit_core_integration.js +2 -5
- package/tools/call/get_native_callkit_core_integration.js.map +1 -1
- package/tools/call/get_web_call_uikit_integration.js +2 -3
- package/tools/call/get_web_call_uikit_integration.js.map +1 -1
- package/tools/chat/get_native_chat_uikit_integration.js +2 -3
- package/tools/chat/get_native_chat_uikit_integration.js.map +1 -1
- package/tools/chat/get_web_chat_uikit_integration.js +2 -3
- package/tools/chat/get_web_chat_uikit_integration.js.map +1 -1
- package/tools/common/present_framework_choice.js +19 -13
- package/tools/common/present_framework_choice.js.map +1 -1
- package/tools/common/record_answer.js +19 -25
- package/tools/common/record_answer.js.map +1 -1
- package/tools/common/record_feedback.js +17 -30
- package/tools/common/record_feedback.js.map +1 -1
- package/tools/common/search_trtc_knowledge.js +45 -0
- package/tools/common/search_trtc_knowledge.js.map +1 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +3 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js +5 -3
- package/tools/definitions/get_native_callkit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js +5 -2
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_livekit_core_integration_def.js +6 -5
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +4 -2
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -0
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +5 -5
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_room_core_integration_def.js +50 -0
- package/tools/definitions/get_web_room_core_integration_def.js.map +1 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +5 -4
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -1
- package/tools/definitions/integration-boundary.js +6 -0
- package/tools/definitions/integration-boundary.js.map +1 -0
- package/tools/definitions/present_framework_choice_def.js +12 -10
- package/tools/definitions/present_framework_choice_def.js.map +1 -1
- package/tools/definitions/record_answer_def.js +19 -17
- package/tools/definitions/record_answer_def.js.map +1 -1
- package/tools/definitions/record_feedback_def.js +14 -13
- package/tools/definitions/record_feedback_def.js.map +1 -1
- package/tools/definitions/search_trtc_knowledge_def.js +40 -0
- package/tools/definitions/search_trtc_knowledge_def.js.map +1 -0
- package/tools/index.js +5 -36
- package/tools/index.js.map +1 -1
- package/tools/live/get_native_livekit_core_integration.js +1 -3
- package/tools/live/get_native_livekit_core_integration.js.map +1 -1
- package/tools/live/get_web_live_uikit_integration.js +2 -4
- package/tools/live/get_web_live_uikit_integration.js.map +1 -1
- package/tools/room/get_web_room_core_integration.js +48 -0
- package/tools/room/get_web_room_core_integration.js.map +1 -0
- package/tools/room/get_web_room_uikit_integration.js +2 -3
- package/tools/room/get_web_room_uikit_integration.js.map +1 -1
- package/utils/generate-structured-result.js +24 -30
- package/utils/generate-structured-result.js.map +1 -1
- package/utils/get-doc-content.js +14 -8
- package/utils/get-doc-content.js.map +1 -1
- package/utils/report-cls-client.js +18 -20
- package/utils/report-cls-client.js.map +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/callkit/core-sdk/.gitkeep +0 -0
- package/resource/doc/callkit/core-sdk/android/answer-call.md +0 -852
- package/resource/doc/callkit/core-sdk/android/make-call.md +0 -954
- package/resource/doc/callkit/core-sdk/android/offline-push.md +0 -361
- package/resource/doc/callkit/core-sdk/flutter/answer-call.md +0 -1160
- package/resource/doc/callkit/core-sdk/flutter/make-call.md +0 -1205
- package/resource/doc/callkit/core-sdk/ios/answer-call.md +0 -1090
- package/resource/doc/callkit/core-sdk/ios/make-call.md +0 -1248
- package/resource/doc/callkit/core-sdk/ios/offline-push.md +0 -485
- package/resource/doc/callkit/core-sdk/uni-app/answer-call.md +0 -950
- package/resource/doc/callkit/core-sdk/uni-app/make-call.md +0 -1052
- package/resource/doc/callkit/faq/common/error-code.md +0 -47
- package/resource/doc/callkit/faq/flutter-faq.md +0 -115
- package/resource/doc/callkit/faq/ios-faq.md +0 -115
- package/resource/doc/callkit/faq/web-faq.md +0 -36
- package/resource/doc/callkit/preset/android/api.md +0 -296
- package/resource/doc/callkit/preset/flutter/api.md +0 -410
- package/resource/doc/callkit/preset/flutter/integration.md +0 -164
- package/resource/doc/callkit/preset/ios/api.md +0 -80
- package/resource/doc/callkit/preset/ios/integration.md +0 -187
- package/resource/doc/callkit/preset/react/api.md +0 -501
- package/resource/doc/callkit/preset/react/integration.md +0 -86
- package/resource/doc/callkit/preset/vue/api.md +0 -501
- package/resource/doc/callkit/preset/vue/integration.md +0 -83
- package/resource/doc/chatkit/android/faq.md +0 -111
- package/resource/doc/chatkit/android/features/theme.md +0 -219
- package/resource/doc/chatkit/android/integration.md +0 -490
- package/resource/doc/chatkit/faq/android_sdk/client-api.md +0 -281
- package/resource/doc/chatkit/faq/common/product.md +0 -7
- package/resource/doc/chatkit/faq/common/server.md +0 -44
- package/resource/doc/chatkit/faq/common/server_error_code.md +0 -74
- package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +0 -199
- package/resource/doc/chatkit/faq/flutter_sdk/faq.md +0 -53
- package/resource/doc/chatkit/faq/ios_sdk/client-api.md +0 -235
- package/resource/doc/chatkit/faq/web_sdk/error_code.md +0 -47
- package/resource/doc/chatkit/faq/web_sdk/faq.md +0 -287
- package/resource/doc/chatkit/flutter/faq.md +0 -23
- package/resource/doc/chatkit/flutter/features/theme.md +0 -235
- package/resource/doc/chatkit/flutter/integration.md +0 -344
- package/resource/doc/chatkit/ios/faq.md +0 -111
- package/resource/doc/chatkit/ios/features/theme.md +0 -267
- package/resource/doc/chatkit/react/components/avatar.md +0 -104
- package/resource/doc/chatkit/react/components/chat-header.md +0 -148
- package/resource/doc/chatkit/react/components/chat-setting.md +0 -57
- package/resource/doc/chatkit/react/components/chat.md +0 -38
- package/resource/doc/chatkit/react/components/component-list.md +0 -37
- package/resource/doc/chatkit/react/components/conversation-actions.md +0 -174
- package/resource/doc/chatkit/react/components/conversation-list.md +0 -333
- package/resource/doc/chatkit/react/components/conversation-preview.md +0 -118
- package/resource/doc/chatkit/react/components/conversation-search.md +0 -60
- package/resource/doc/chatkit/react/components/message-list.md +0 -293
- package/resource/doc/chatkit/react/components/tuikit.md +0 -34
- package/resource/doc/chatkit/react/faq.md +0 -26
- package/resource/doc/chatkit/react/integration.md +0 -416
- package/resource/doc/chatkit/vue/components/avatar.md +0 -104
- package/resource/doc/chatkit/vue/components/chat-header.md +0 -148
- package/resource/doc/chatkit/vue/components/chat-setting.md +0 -62
- package/resource/doc/chatkit/vue/components/chat.md +0 -45
- package/resource/doc/chatkit/vue/components/component-list.md +0 -87
- package/resource/doc/chatkit/vue/components/contact-list.md +0 -271
- package/resource/doc/chatkit/vue/components/conversation-actions.md +0 -228
- package/resource/doc/chatkit/vue/components/conversation-list.md +0 -320
- package/resource/doc/chatkit/vue/components/conversation-preview.md +0 -213
- package/resource/doc/chatkit/vue/components/message-input.md +0 -1054
- package/resource/doc/chatkit/vue/components/message-list.md +0 -433
- package/resource/doc/chatkit/vue/components/tuikit.md +0 -31
- package/resource/doc/chatkit/vue/components/userpicker.md +0 -256
- package/resource/doc/chatkit/vue/faq.md +0 -36
- package/resource/doc/chatkit/vue/integration.md +0 -428
- package/resource/doc/livekit/core-sdk/live/flutter/live-host-interaction.md +0 -866
- package/resource/doc/livekit/faq/common/error-code.md +0 -88
- package/resource/doc/livekit/preset/live/vue/api-reference/index.md +0 -780
- package/resource/doc/livekit/preset/live/vue/components/co-guest-panel.md +0 -91
- package/resource/doc/livekit/preset/live/vue/components/live-scene-panel.md +0 -112
- package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +0 -215
- package/resource/doc/livekit/preset/live/vue/live-player-h5-integration.md +0 -300
- package/resource/doc/roomkit/faq/common/error-code.md +0 -67
- package/resource/doc/roomkit/vue/features/call-user-to-room.md +0 -220
- package/resource/doc/roomkit/vue/features/device-state.md +0 -460
- package/resource/doc/roomkit/vue/features/free-beauty-panel.md +0 -215
- package/resource/doc/roomkit/vue/features/room-chat.md +0 -369
- package/resource/doc/roomkit/vue/features/room-state.md +0 -282
- package/resource/doc/roomkit/vue/features/schedule-room.md +0 -318
- package/resource/doc/roomkit/vue/features/screen-share.md +0 -265
- package/resource/doc/roomkit/vue/features/virtual-background.md +0 -271
- package/resource/doc/roomkit/vue/integration.md +0 -315
- package/resource/doc/rtcengine/faq/common/error_code.md +0 -1
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/how_to_run_web_sdk_demo.md +0 -59
- package/resource/doc/trtc/C++/ITRTCCloud.md +0 -1970
- package/resource/doc/trtc/C++/ITRTCStatistics.md +0 -70
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/C++/ITXDeviceManager.md +0 -387
- package/resource/doc/trtc/C++/TRTCCloudCallback.md +0 -1082
- package/resource/doc/trtc/C++/TRTCTypeDef.md +0 -925
- package/resource/doc/trtc/C++/TXLiteAVCode.md +0 -129
- package/resource/doc/trtc/android/TRTCCloud.md +0 -1815
- package/resource/doc/trtc/android/TRTCCloudDef.md +0 -992
- package/resource/doc/trtc/android/TRTCCloudListener.md +0 -1004
- package/resource/doc/trtc/android/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/android/TXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/android/TXBeautyManager.md +0 -402
- package/resource/doc/trtc/android/TXDeviceManager.md +0 -173
- package/resource/doc/trtc/android/TXLiteAVCode.md +0 -127
- package/resource/doc/trtc/iOS/TRTCCloud.md +0 -2028
- package/resource/doc/trtc/iOS/TRTCCloudDef.md +0 -958
- package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +0 -1046
- package/resource/doc/trtc/iOS/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/iOS/TXAudioEffectManager.md +0 -397
- package/resource/doc/trtc/iOS/TXBeautyManager.md +0 -403
- package/resource/doc/trtc/iOS/TXDeviceManager.md +0 -381
- package/resource/doc/trtc/iOS/TXLiteAVCode.md +0 -130
- package/tools/call/get_callkit_api.js +0 -33
- package/tools/call/get_callkit_api.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_feature_detail.js +0 -35
- package/tools/chat/get_native_chat_uikit_feature_detail.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_component_detail.js +0 -35
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
- package/tools/common/get_faq.js +0 -266
- package/tools/common/get_faq.js.map +0 -1
- package/tools/common/record_skill_session.js +0 -69
- package/tools/common/record_skill_session.js.map +0 -1
- package/tools/definitions/get_callkit_api_def.js +0 -29
- package/tools/definitions/get_callkit_api_def.js.map +0 -1
- package/tools/definitions/get_faq_def.js +0 -49
- package/tools/definitions/get_faq_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +0 -31
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_features_def.js +0 -34
- package/tools/definitions/get_native_livekit_core_features_def.js.map +0 -1
- package/tools/definitions/get_native_trtc_sdk_docs_def.js +0 -32
- package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +0 -31
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_api_def.js +0 -30
- package/tools/definitions/get_web_livekit_api_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_component_detail_def.js +0 -32
- package/tools/definitions/get_web_livekit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_roomkit_feature_detail_def.js +0 -31
- package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_api_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_api_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_integration_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +0 -1
- package/tools/definitions/record_skill_session_def.js +0 -31
- package/tools/definitions/record_skill_session_def.js.map +0 -1
- package/tools/live/get_native_livekit_core_features.js +0 -68
- package/tools/live/get_native_livekit_core_features.js.map +0 -1
- package/tools/live/get_web_livekit_api.js +0 -33
- package/tools/live/get_web_livekit_api.js.map +0 -1
- package/tools/live/get_web_livekit_component_detail.js +0 -35
- package/tools/live/get_web_livekit_component_detail.js.map +0 -1
- package/tools/room/get_web_roomkit_feature_detail.js +0 -69
- package/tools/room/get_web_roomkit_feature_detail.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_api.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_api.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_integration.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +0 -1
- package/tools/trtc/get_native_trtc_sdk_docs.js +0 -74
- package/tools/trtc/get_native_trtc_sdk_docs.js.map +0 -1
- package/utils/build-session-directives.js +0 -120
- package/utils/build-session-directives.js.map +0 -1
- package/utils/handle-framework.js +0 -9
- package/utils/handle-framework.js.map +0 -1
- package/utils/handle-state-name.js +0 -29
- package/utils/handle-state-name.js.map +0 -1
- package/utils/report-runtime-error-cls-client.js +0 -91
- package/utils/report-runtime-error-cls-client.js.map +0 -1
- /package/resource/{doc/livekit/preset/live/vue/faq.md → knowledge/push/config/donut.md} +0 -0
- /package/resource/{doc/roomkit/vue/faq.md → knowledge/push/integration/donut.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/api.md +0 -0
- /package/resource/{doc/rtcengine/faq/web/web.md → knowledge/rtcengine/web/faq.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/how_to_integrated_web_sdk.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/28-advanced-beauty.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/30-advanced-cross-room-link.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/37-advanced-voice-changer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/40-advanced-video-mixer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/43-advanced-face-detection.md +0 -0
|
@@ -3,49 +3,51 @@
|
|
|
3
3
|
ContactList is a highly configurable contact list component. It supports friend list, group list, blocklist, and application management, offering core features such as group collapsing, search filtering, and custom rendering. It is suitable for contact management interfaces in instant messaging and social applications.
|
|
4
4
|
|
|
5
5
|
## ContactList Props
|
|
6
|
-
|
|
7
|
-
|
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
6
|
+
|
|
7
|
+
|Field|Type|Default Value|Description|
|
|
8
|
+
|---------|---------|---------|---------|
|
|
9
|
+
|activeContactItem|ContactGroupItem \| undefined|`undefined`|Currently active contact item|
|
|
10
|
+
|enableSearch|boolean|`true`|Whether to enable the search feature|
|
|
11
|
+
|groupConfig|Partial<Record<ContactItemType, CustomGroupConfig>>|`{}`|Custom group configuration|
|
|
12
|
+
|className|string|`undefined`|Custom CSS class name|
|
|
13
|
+
|style|React.CSSProperties|`undefined`|Custom inline style|
|
|
14
|
+
|searchPlaceholder|string|`'Search contacts'`|search box placeholder text|
|
|
15
|
+
|emptyText|string|`'No contacts'`|Empty status prompt text|
|
|
16
|
+
|ContactItem|React.ComponentType<ContactListItemProps> \| undefined|`ContactListItem`|Custom contact person component|
|
|
17
|
+
|ContactSearchComponent|React.ComponentType<ContactSearchProps> \| undefined|`ContactSearch`|Custom search component|
|
|
18
|
+
|GroupHeader|React.ComponentType<{ data: ContactGroup }> \| undefined|Default group header|Custom group header component|
|
|
19
|
+
|PlaceholderEmptyList|React.ReactNode \| undefined|Default empty status|Custom empty status component|
|
|
20
|
+
|onContactItemClick|(item: ContactGroupItem) => void|`undefined`|Contact person item click event|
|
|
21
|
+
|onFriendApplicationAction|(action: 'accept' \| 'refuse', application: FriendApplication) => void|`undefined`|Friend request operation event|
|
|
22
|
+
|onGroupApplicationAction|(action: 'accept' \| 'refuse', application: GroupApplication) => void|`undefined`|Group request operation event|
|
|
22
23
|
|
|
23
24
|
## ContactInfo props
|
|
24
|
-
|
|
25
|
-
|
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
25
|
+
|
|
26
|
+
|Field|Type|Default Value|Description|
|
|
27
|
+
|---------|---------|---------|---------|
|
|
28
|
+
|contactItem|ContactGroupItem \| undefined|`undefined`|Currently showing contact item|
|
|
29
|
+
|showActions|boolean|`true`|whether to display the action button|
|
|
30
|
+
|PlaceholderEmpty|React.ReactNode \| undefined|`undefined`|Empty status placeholder component|
|
|
31
|
+
|FriendInfoComponent|React.ComponentType<FriendInfoProps>|`FriendInfo`|Friend information component|
|
|
32
|
+
|GroupInfoComponent|React.ComponentType<GroupInfoProps>|`GroupInfo`|Group information component|
|
|
33
|
+
|BlacklistInfoComponent|React.ComponentType<BlacklistInfoProps>|`BlacklistInfo`|Blocklist information component|
|
|
34
|
+
|FriendApplicationInfoComponent|React.ComponentType<FriendApplicationInfoProps>|`FriendApplicationInfo`|Friend request information component|
|
|
35
|
+
|GroupApplicationInfoComponent|React.ComponentType<GroupApplicationInfoProps>|`GroupApplicationInfo`|Group application information component|
|
|
36
|
+
|SearchGroupInfoComponent|React.ComponentType<SearchGroupInfoProps>|`SearchGroupInfo`|Group information search component|
|
|
37
|
+
|SearchUserInfoComponent|React.ComponentType<SearchUserInfoProps>|`SearchUserInfo`|User information search component|
|
|
38
|
+
|onClose|() => void|`undefined`|Close message panel callback|
|
|
39
|
+
|onSendMessage|(friend: Friend) => void|`undefined`|Message send callback|
|
|
40
|
+
|onDeleteFriend|(friend: Friend) => void|`undefined`|Remove friend callback|
|
|
41
|
+
|onUpdateFriendRemark|(friend: Friend, remark: string) => void|`undefined`|Update friend remark callback|
|
|
42
|
+
|onAddToBlacklist|(friend: Friend) => void|`undefined`|Add to blocklist callback|
|
|
43
|
+
|onRemoveFromBlacklist|(profile: UserProfile) => void|`undefined`|Remove from blocklist callback|
|
|
44
|
+
|onEnterGroup|(group: GroupModel) => void|`undefined`|Group entry callback|
|
|
45
|
+
|onLeaveGroup|(group: GroupModel) => void|`undefined`|Group exit callback|
|
|
46
|
+
|onDismissGroup|(group: GroupModel) => void|`undefined`|Group dismissed callback|
|
|
47
|
+
|onFriendApplicationAction|(action: 'accept' \| 'refuse', application: FriendApplication) => void|`undefined`|Friend request operation callback|
|
|
48
|
+
|onGroupApplicationAction|(action: 'accept' \| 'refuse', application: GroupApplication) => void|`undefined`|Group application operation callback|
|
|
49
|
+
|onAddFriend|(user: UserProfile, wording: string) => void|`undefined`|Friend request callback|
|
|
50
|
+
|onJoinGroup|(group: GroupModel, note: string) => void|`undefined`|Group join callback|
|
|
49
51
|
|
|
50
52
|
## Basic Usage
|
|
51
53
|
``` tsx
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
The `ConversationActions` component manages actions for individual conversations. By default, it provides options to delete conversations, pin or unpin conversations, and enable or disable Do Not Disturb mode for conversations.
|
|
2
|
+
|
|
3
|
+
## Basic Usage
|
|
4
|
+
|
|
5
|
+
When you use `ConversationActions` within a `ConversationList`, you can configure it directly using the top-level `actionsConfig` prop on `ConversationList`. The `actionsConfig` prop lets you enable or disable default conversation actions, handle action events, add custom action items, and perform basic UI customization.
|
|
6
|
+
|
|
7
|
+
For advanced customization, you can create your own component based on `ConversationActions`.
|
|
8
|
+
|
|
9
|
+
### Basic Customization with actionsConfig
|
|
10
|
+
``` typescript
|
|
11
|
+
import { UIKitProvider, ConversationList } from "@tencentcloud/chat-uikit-react";
|
|
12
|
+
|
|
13
|
+
const App = () => {
|
|
14
|
+
return (
|
|
15
|
+
<UIKitProvider>
|
|
16
|
+
<ConversationList
|
|
17
|
+
actionsConfig={{
|
|
18
|
+
enablePin: false,
|
|
19
|
+
onConversationDelete: (conversation) => { console.log('Delete conversation success'); },
|
|
20
|
+
customConversationActions: {
|
|
21
|
+
'custom-actions-1': {
|
|
22
|
+
label: 'custom-actions',
|
|
23
|
+
onClick: (conversation) => { console.log(conversation); },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}}/>
|
|
27
|
+
</UIKitProvider>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Customizing the ConversationActions Component
|
|
33
|
+
``` typescript
|
|
34
|
+
import { UIKitProvider, ConversationList, ConversationActions } from "@tencentcloud/chat-uikit-react";
|
|
35
|
+
|
|
36
|
+
type ConversationActionsProps = Parameters<typeof ConversationActions>[0];
|
|
37
|
+
|
|
38
|
+
function CustomConversationActions(props: ConversationActionsProps) {
|
|
39
|
+
return <ConversationActions {...props} enableDelete={false} />;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const App = () => {
|
|
43
|
+
return (
|
|
44
|
+
<UIKitProvider>
|
|
45
|
+
<ConversationList
|
|
46
|
+
style={{ maxWidth: '300px', height: '600px' }}
|
|
47
|
+
ConversationActions={CustomConversationActions}
|
|
48
|
+
/>
|
|
49
|
+
</UIKitProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Props
|
|
55
|
+
|
|
56
|
+
The `ConversationActionsProps` interface extends `ConversationActionsConfig`, and defines the props for the `ConversationActions` component.
|
|
57
|
+
|
|
58
|
+
|Parameter|Type|Default|Description|
|
|
59
|
+
|---------|---------|---------|---------|
|
|
60
|
+
|**conversation** (Required)|ConversationInfo|-|Specifies the conversation for which actions are rendered.|
|
|
61
|
+
|className|String|-|Custom class name for the root element.|
|
|
62
|
+
|style|React.CSSProperties|-|Custom style for the root element.|
|
|
63
|
+
|
|
64
|
+
#### ConversationActionsConfig
|
|
65
|
+
|
|
66
|
+
|Parameter|Type|Default|Description|
|
|
67
|
+
|---------|---------|---------|---------|
|
|
68
|
+
|enablePin|Boolean|true|Whether to display the Pin Conversation button.|
|
|
69
|
+
|enableMute|Boolean|true|Whether to display the Do Not Disturb button.|
|
|
70
|
+
|enableDelete|Boolean|true|Whether to display the Delete Conversation button.|
|
|
71
|
+
|onConversationPin|(conversation: ConversationInfo, e?: React.MouseEvent) => void|-|Custom handler for pinning or unpinning a conversation.|
|
|
72
|
+
|onConversationMute|(conversation: ConversationInfo, e?: React.MouseEvent) => void|-|Custom handler for enabling or disabling Do Not Disturb for a conversation.|
|
|
73
|
+
|onConversationDelete|(conversation: ConversationInfo, e?: React.MouseEvent) => void|-|Custom handler for deleting a conversation.|
|
|
74
|
+
|customConversationActions|Record|-|Custom action items for conversations.|
|
|
75
|
+
|onClick|(e: React.MouseEvent, key?: string, conversation?: ConversationInfo) => void|-|Callback triggered when an action item is clicked.|
|
|
76
|
+
|
|
77
|
+
## Custom Components
|
|
78
|
+
|
|
79
|
+
### Basic Feature Toggles
|
|
80
|
+
|
|
81
|
+
Use the `enablePin`, `enableDelete`, and `enableMute` props to control the visibility of Pin Conversation, Do Not Disturb, and Delete Conversation actions in `ConversationActions`.
|
|
82
|
+
``` typescript
|
|
83
|
+
<ConversationActions enablePin={false} />
|
|
84
|
+
```
|
|
85
|
+
``` typescript
|
|
86
|
+
<ConversationActions enableDelete={false} />
|
|
87
|
+
```
|
|
88
|
+
``` typescript
|
|
89
|
+
<ConversationActions enableMute={false} />
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
|`enablePin={false}`|`enableDelete={false}`|`enableMute={false}`|
|
|
93
|
+
|---------|---------|---------|
|
|
94
|
+
||||
|
|
95
|
+
|
|
96
|
+
### Event Handling
|
|
97
|
+
|
|
98
|
+
`ConversationActions` provides built-in support for deleting conversations, pinning or unpinning conversations, and enabling or disabling Do Not Disturb. If you need to override the default event handlers, provide your own handler functions. You can also use the `onClick` prop to handle generic click events.
|
|
99
|
+
``` typescript
|
|
100
|
+
import { ConversationList, ConversationActions, useChatContext } from '@tencentcloud/chat-uikit-react';
|
|
101
|
+
import { Toast } from 'third-party-lib';
|
|
102
|
+
type ConversationActionsProps = Parameters<typeof ConversationActions>[0];
|
|
103
|
+
|
|
104
|
+
const CustomConversationActions = (props: ConversationActionsProps) => {
|
|
105
|
+
|
|
106
|
+
const {
|
|
107
|
+
deleteConversation
|
|
108
|
+
} = useChatContext();
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<ConversationActions
|
|
112
|
+
{...props}
|
|
113
|
+
onConversationDelete={(conversation) => {
|
|
114
|
+
deleteConversation(conversation.conversationID).then(() => {
|
|
115
|
+
Toast({ text: 'delete conversation successfully!', type: 'info' });
|
|
116
|
+
}).catch(() => {
|
|
117
|
+
Toast({ text: 'delete conversation failed!', type: 'error' });
|
|
118
|
+
});
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
<ConversationList ConversationActions={CustomConversationActions} />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### customConversationActions
|
|
128
|
+
|
|
129
|
+
The `customConversationActions` prop lets you add custom action items to `ConversationActions`.
|
|
130
|
+
|
|
131
|
+
|Parameter|Type|Default|Description|
|
|
132
|
+
|---------|---------|---------|---------|
|
|
133
|
+
|enable|Boolean|true|Whether the custom action item is enabled.|
|
|
134
|
+
|label|String|-|Display label for the custom action item.|
|
|
135
|
+
|onClick|(conversation: ConversationInfo, e?: React.MouseEvent) => void|-|Callback triggered when the custom action item is clicked.|
|
|
136
|
+
|
|
137
|
+
Below is an example showing how to add custom action items with `customConversationActions`:
|
|
138
|
+
``` typescript
|
|
139
|
+
import { ConversationList, ConversationActions } from '@tencentcloud/chat-uikit-react';
|
|
140
|
+
import type { ConversationInfo } from '@tencentcloud/chat-uikit-react';
|
|
141
|
+
type ConversationActionsProps = Parameters<typeof ConversationActions>[0];
|
|
142
|
+
|
|
143
|
+
const CustomConversationActions = (props: ConversationActionsProps) => {
|
|
144
|
+
return (
|
|
145
|
+
<ConversationActions
|
|
146
|
+
{...props}
|
|
147
|
+
customConversationActions={{
|
|
148
|
+
'custom-actions-1': {
|
|
149
|
+
label: 'custom-actions',
|
|
150
|
+
onClick: (conversation: ConversationInfo) => { console.log(conversation); },
|
|
151
|
+
},
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
<ConversationList ConversationActions={CustomConversationActions} />
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
|Before|After|
|
|
161
|
+
|---------|---------|
|
|
162
|
+
|||
|
|
163
|
+
|
|
164
|
+
### UI Customization
|
|
165
|
+
|
|
166
|
+
You can fully customize the conversation action menu using third-party UI elements.
|
|
167
|
+
``` typescript
|
|
168
|
+
import { ConversationList, ConversationActions } from '@tencentcloud/chat-uikit-react';
|
|
169
|
+
type ConversationActionsProps = Parameters<typeof ConversationActions>[0];
|
|
170
|
+
|
|
171
|
+
function CustomConversationActions(props: ConversationActionsProps) {
|
|
172
|
+
const [menuPosition, setMenuPosition] = useState<MenuPosition | null>(null);
|
|
173
|
+
|
|
174
|
+
const handleContextMenu = (event: MouseEvent<HTMLDivElement>) => {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
setMenuPosition({
|
|
177
|
+
x: event.clientX,
|
|
178
|
+
y: event.clientY,
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const handleActionClick = () => {
|
|
183
|
+
console.log('Custom conversation action:', props.conversation);
|
|
184
|
+
setMenuPosition(null);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<div
|
|
189
|
+
className="conversation-actions-basic-demo__trigger"
|
|
190
|
+
onContextMenu={handleContextMenu}
|
|
191
|
+
>
|
|
192
|
+
{props.children}
|
|
193
|
+
{menuPosition && (
|
|
194
|
+
<div
|
|
195
|
+
className="conversation-actions-basic-demo__menu"
|
|
196
|
+
style={{ left: menuPosition.x, top: menuPosition.y }}
|
|
197
|
+
>
|
|
198
|
+
<button onClick={handleActionClick} type="button">
|
|
199
|
+
Custom action
|
|
200
|
+
</button>
|
|
201
|
+
<button onClick={() => setMenuPosition(null)} type="button">
|
|
202
|
+
Close
|
|
203
|
+
</button>
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
<ConversationList ConversationActions={CustomConversationActions} />
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
|Before|After|
|
|
214
|
+
|---------|---------|
|
|
215
|
+
|||
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
## Component Overview
|
|
2
|
+
|
|
3
|
+
The `ConversationList` component provides the main conversation list functionality. It includes a Header section and a List section, and supports features such as conversation search, conversation creation, pinning conversations, and deleting conversations.
|
|
4
|
+
|
|
5
|
+
This guide covers basic usage, component customization, flexible composition, and a complete list of component props.
|
|
6
|
+
|
|
7
|
+
|**Conversation List**|**Conversation Actions**|**Conversation Search**|**Create Conversation**|
|
|
8
|
+
|---------|---------|---------|---------|
|
|
9
|
+
|||||
|
|
10
|
+
|
|
11
|
+
## Component Structure
|
|
12
|
+
|
|
13
|
+
The `ConversationList` component includes the following:
|
|
14
|
+
- `ConversationSearch` - Conversation search
|
|
15
|
+
|
|
16
|
+
- `ConversationList UI` - Conversation list container
|
|
17
|
+
|
|
18
|
+
- `ConversationPreview` - Displays information for a single conversation
|
|
19
|
+
|
|
20
|
+
- `ConversationActions` - Actions for an individual conversation
|
|
21
|
+
|
|
22
|
+
## Basic Usage
|
|
23
|
+
|
|
24
|
+
The `ConversationList` component does not require any mandatory props. To use `ConversationList`, add the following code:
|
|
25
|
+
``` typescript
|
|
26
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-react';
|
|
27
|
+
|
|
28
|
+
const App = () => {
|
|
29
|
+
return (
|
|
30
|
+
<UIKitProvider>
|
|
31
|
+
<ConversationList />
|
|
32
|
+
</UIKitProvider>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Customizing the Component
|
|
38
|
+
|
|
39
|
+
`ConversationList` offers a comprehensive props interface for customizing functionality, UI, modules, and more.
|
|
40
|
+
|
|
41
|
+
You can replace multiple subcomponents within `ConversationList`, including `Header`, `List`, `ConversationPreview`, `ConversationCreate`, `ConversationSearch`, `ConversationActions`, `Avatar`, and `Placeholder`. You can also extend and customize these default subcomponents as needed.
|
|
42
|
+
|
|
43
|
+
### Basic Feature Toggles
|
|
44
|
+
|
|
45
|
+
Control the display of conversation search, conversation creation, and conversation actions in `ConversationList` by setting the `enableSearch`, `enableCreate`, and `enableActions` parameters.
|
|
46
|
+
``` typescript
|
|
47
|
+
<ConversationList enableSearch={false} />
|
|
48
|
+
```
|
|
49
|
+
``` typescript
|
|
50
|
+
<ConversationList enableCreate={false} />
|
|
51
|
+
```
|
|
52
|
+
``` typescript
|
|
53
|
+
<ConversationList enableActions={false} />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|`enableSearch={false}`|`enableCreate={false}`|`enableActions={false}`|
|
|
57
|
+
|---------|---------|---------|
|
|
58
|
+
||||
|
|
59
|
+
|
|
60
|
+
### Data Filtering and Sorting
|
|
61
|
+
|
|
62
|
+
The `ConversationList` component provides `filterConversation` and `sortConversation` properties to filter and sort conversation list data.
|
|
63
|
+
|
|
64
|
+
#### Filter Conversations
|
|
65
|
+
|
|
66
|
+
To filter conversation list data, pass a filter function to the `filterConversation` property. This function receives the conversation list as a parameter and returns a new list containing only conversations that meet your criteria.
|
|
67
|
+
|
|
68
|
+
The following example uses the `filterConversation` property to display only conversations with unread messages:
|
|
69
|
+
``` typescript
|
|
70
|
+
import { ConversationList } from '@tencentcloud/chat-uikit-react';
|
|
71
|
+
import type { ConversationInfo } from '@tencentcloud/chat-uikit-react';
|
|
72
|
+
|
|
73
|
+
<ConversationList
|
|
74
|
+
filter={(conversationList: ConversationInfo[]) =>
|
|
75
|
+
conversationList.filter(conversation => conversation.unreadCount > 0)}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Sort Conversations
|
|
80
|
+
|
|
81
|
+
To sort conversation list data, pass a sorting function to the `sortConversation` property. This function receives the conversation list as a parameter and returns a new list sorted according to your requirements.
|
|
82
|
+
|
|
83
|
+
The following example uses the `sortConversation` property to sort conversations by latest message time in descending order:
|
|
84
|
+
``` typescript
|
|
85
|
+
import { ConversationList } from '@tencentcloud/chat-uikit-react';
|
|
86
|
+
import type { ConversationInfo } from '@tencentcloud/chat-uikit-react';
|
|
87
|
+
|
|
88
|
+
<ConversationList
|
|
89
|
+
sort={(conversationList: ConversationInfo[]) =>
|
|
90
|
+
conversationList.sort(
|
|
91
|
+
(a, b) => {
|
|
92
|
+
const timeA = a.lastMessage?.timestamp?.getTime() || 0;
|
|
93
|
+
const timeB = b.lastMessage?.timestamp?.getTime() || 0;
|
|
94
|
+
return timeB - timeA;
|
|
95
|
+
},
|
|
96
|
+
)}
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
By using the `filter` and `sort` properties, you can efficiently filter and sort conversation list data to suit your needs.
|
|
101
|
+
|
|
102
|
+
### Custom actionsConfig
|
|
103
|
+
|
|
104
|
+
Use actionsConfig to control the basic functionality of `ConversationActions`.
|
|
105
|
+
|
|
106
|
+
For additional customization, refer to the ConversationActions section.
|
|
107
|
+
``` typescript
|
|
108
|
+
import { ConversationList } from '@tencentcloud/chat-uikit-react';
|
|
109
|
+
import type { ConversationInfo } from '@tencentcloud/chat-uikit-react';
|
|
110
|
+
|
|
111
|
+
<ConversationList
|
|
112
|
+
actionsConfig={{
|
|
113
|
+
enablePin: false,
|
|
114
|
+
onConversationDelete: (conversation: ConversationInfo) => { console.log('Delete conversation success'); },
|
|
115
|
+
customConversationActions: {
|
|
116
|
+
'custom-actions-1': {
|
|
117
|
+
label: 'custom-actions',
|
|
118
|
+
onClick: (conversation: ConversationInfo) => { console.log(conversation); },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
|`enablePin: false`|`enableDelete: false`|`enableMute: false`|`customConversationActions`|
|
|
126
|
+
|---------|---------|---------|---------|
|
|
127
|
+
|||||
|
|
128
|
+
|
|
129
|
+
### Custom Placeholder
|
|
130
|
+
|
|
131
|
+
Customize the list display for different states by passing `PlaceholderEmptyList`, `PlaceholderLoading`, and `PlaceholderLoadError`.
|
|
132
|
+
|
|
133
|
+
The following example customizes the `PlaceholderLoading` element:
|
|
134
|
+
``` typescript
|
|
135
|
+
import { ConversationList } from '@tencentcloud/chat-uikit-react';
|
|
136
|
+
|
|
137
|
+
<ConversationList
|
|
138
|
+
PlaceholderEmptyList={<div>Empty List!!!</div>}
|
|
139
|
+
/>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Custom Header
|
|
143
|
+
|
|
144
|
+
`ConversationListHeader` renders the Header section of the ConversationList. By default, it wraps and displays `ConversationSearch` and `ConversationCreate`. You can customize it by passing left, right, and other properties, or by replacing the entire component.
|
|
145
|
+
|
|
146
|
+
#### Props
|
|
147
|
+
|
|
148
|
+
|**Prop Name**|**Type**|**Default**|**Description**|
|
|
149
|
+
|---------|---------|---------|---------|
|
|
150
|
+
|children|`ReactNode`|-|Custom center component for the conversation list header. When used in ``, and `` are passed in by default.|
|
|
151
|
+
|left|`ReactElement`|-|Custom component for the left side of the conversation list header.|
|
|
152
|
+
|right|`ReactElement`|-|Custom component for the right side of the conversation list header.|
|
|
153
|
+
|className|`String`|-|Custom CSS class name for the root element.|
|
|
154
|
+
|style|`React.CSSProperties`|-|Custom style for the root element.|
|
|
155
|
+
|
|
156
|
+
#### Basic Customization
|
|
157
|
+
|
|
158
|
+
The following example adds a new feature button to the right side of the Header component.
|
|
159
|
+
``` typescript
|
|
160
|
+
import {
|
|
161
|
+
ConversationList,
|
|
162
|
+
ConversationListHeader,
|
|
163
|
+
} from '@tencentcloud/chat-uikit-react';
|
|
164
|
+
|
|
165
|
+
const CustomConversationListHeader = (props) => {
|
|
166
|
+
const CustomIcon = <div>Custom Icon</div>;
|
|
167
|
+
return (
|
|
168
|
+
<ConversationListHeader {...props} right={CustomIcon} />
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
<ConversationList Header={CustomConversationListHeader} />
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### Advanced Customization
|
|
176
|
+
|
|
177
|
+
The following example implements conversation grouping, categorizing by All, Unread, C2C, and Group. Clicking each group button applies a different filter.
|
|
178
|
+
|
|
179
|
+
|**Before**|**After**|
|
|
180
|
+
|---------|---------|
|
|
181
|
+
|||
|
|
182
|
+
|
|
183
|
+
``` typescript
|
|
184
|
+
import { useState } from 'react';
|
|
185
|
+
import { ConversationList, UIKitProvider, ConversationInfo } from '@tencentcloud/chat-uikit-react';
|
|
186
|
+
|
|
187
|
+
const conversationGroupFilter: Record<string, (conversationList: ConversationInfo[]) => ConversationInfo[]> = {
|
|
188
|
+
all: (conversationList: ConversationInfo[]) => conversationList,
|
|
189
|
+
unread: (conversationList: ConversationInfo[]) => conversationList?.filter((item: ConversationInfo) => item.unreadCount > 0),
|
|
190
|
+
c2c: (conversationList: ConversationInfo[]) => conversationList?.filter((item: ConversationInfo) => item.type === ConversationType.C2C),
|
|
191
|
+
group: (conversationList: ConversationInfo[]) => conversationList?.filter((item: ConversationInfo) => item.type === ConversationType.Group),
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const App = () => {
|
|
195
|
+
const [currentFilter, setCurrentFilter] = useState<string>('all');
|
|
196
|
+
|
|
197
|
+
const CustomConversationListHeader = (props: IConversationListHeaderProps) => {
|
|
198
|
+
return (
|
|
199
|
+
<div className="conversation-group-wrapper">
|
|
200
|
+
<button className={currentFilter === 'all' ? 'btn-active' : 'btn-default'} onClick={() => setCurrentFilter('all')}>All</button>
|
|
201
|
+
<button className={currentFilter === 'unread' ? 'btn-active' : 'btn-default'} onClick={() => setCurrentFilter('unread')}>Unread</button>
|
|
202
|
+
<button className={currentFilter === 'c2c' ? 'btn-active' : 'btn-default'} onClick={() => setCurrentFilter('c2c')}>C2C</button>
|
|
203
|
+
<button className={currentFilter === 'group' ? 'btn-active' : 'btn-default'} onClick={() => setCurrentFilter('group')}>Group</button>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<UIKitProvider>
|
|
210
|
+
<ConversationList
|
|
211
|
+
style={{ maxWidth: '300px', height: '600px' }}
|
|
212
|
+
Header={CustomConversationListHeader}
|
|
213
|
+
filter={conversationGroupFilter[currentFilter]}
|
|
214
|
+
/>
|
|
215
|
+
</UIKitProvider>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
```
|
|
219
|
+
``` scss
|
|
220
|
+
.conversation-group-wrapper {
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: space-around;
|
|
223
|
+
align-items: center;
|
|
224
|
+
margin: 10px;
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
.btn-default{
|
|
227
|
+
display: flex;
|
|
228
|
+
padding: 5px 10px;
|
|
229
|
+
border: 1px solid #b3b3b4;
|
|
230
|
+
color: #3b3d43;
|
|
231
|
+
background-color: transparent;
|
|
232
|
+
border-radius: 2px;
|
|
233
|
+
}
|
|
234
|
+
.btn-active{
|
|
235
|
+
display: flex;
|
|
236
|
+
padding: 5px 10px;
|
|
237
|
+
border: 1px solid #1c66e5;
|
|
238
|
+
color: #1c66e5;
|
|
239
|
+
background-color: transparent;
|
|
240
|
+
border-radius: 2px;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Custom List
|
|
246
|
+
|
|
247
|
+
`ConversationListContent` renders the main list section of the ConversationList.
|
|
248
|
+
|
|
249
|
+
By default, it displays the current conversation list data (`filteredAndSortedConversationList`) calculated in Context.
|
|
250
|
+
|
|
251
|
+
#### Props
|
|
252
|
+
|
|
253
|
+
|**Prop Name**|**Type**|**Default**|**Description**|
|
|
254
|
+
|---------|---------|---------|---------|
|
|
255
|
+
|children|`ReactNode`|-|Custom component for the conversation list content area. When used in , the `filteredAndSortedConversationList` is passed in and iterated as a list of `` components.|
|
|
256
|
+
|empty|`Boolean`|`false`|Flag for empty conversation list. When used in ``, it checks if `filteredAndSortedConversationList.length === 0` and passes this in.|
|
|
257
|
+
|loading|`Boolean`|`false`|Flag for conversation list loading state. When used in ``, it uses `useConversationList()` to get `isLoading` and passes it in.|
|
|
258
|
+
|error|`Boolean`|`false`|Flag for conversation list load error. When used in ``, it uses `useConversationList()` to get `isLoadError` and passes it in.|
|
|
259
|
+
|PlaceholderEmptyList|`ReactNode`|``|Custom placeholder element when the conversation list is empty.|
|
|
260
|
+
|PlaceholderLoading|`ReactNode`|``|Custom placeholder element when the conversation list is loading.|
|
|
261
|
+
|PlaceholderLoadError|`ReactNode`|``|Custom placeholder element when the conversation list fails to load.|
|
|
262
|
+
|className|`String`|-|Custom CSS class name for the root element.|
|
|
263
|
+
|style|`React.CSSProperties`|-|Custom style for the root element.|
|
|
264
|
+
|
|
265
|
+
#### Basic Customization
|
|
266
|
+
|
|
267
|
+
The `List` component manages different UI states as shown below. State transitions are handled internally within `ConversationList`.
|
|
268
|
+
|
|
269
|
+
You can also control the component state by passing custom `empty`, `loading`, or `error` props.
|
|
270
|
+
``` typescript
|
|
271
|
+
import { ConversationList, ConversationListContent } from '@tencentcloud/chat-uikit-react';
|
|
272
|
+
|
|
273
|
+
const CustomConversationListContent = (props) => {
|
|
274
|
+
return <ConversationListContent {...props} loading={true} />;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
<ConversationList List={CustomConversationListContent} />
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
|`default`|`empty={true}`|`loading={true}`|`error={true}`|
|
|
281
|
+
|---------|---------|---------|---------|
|
|
282
|
+
|||||
|
|
283
|
+
|
|
284
|
+
### Custom ConversationPreview
|
|
285
|
+
|
|
286
|
+
For details, see the ConversationPreview section.
|
|
287
|
+
``` typescript
|
|
288
|
+
<ConversationList ConversationPreview={CustomConversationPreview} />
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Custom ConversationActions
|
|
292
|
+
|
|
293
|
+
For details, see the ConversationActions section.
|
|
294
|
+
``` typescript
|
|
295
|
+
<ConversationList ConversationActions={CustomConversationActions} />
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Custom ConversationSearch
|
|
299
|
+
|
|
300
|
+
For details, see the ConversationSearch section.
|
|
301
|
+
``` typescript
|
|
302
|
+
<ConversationList ConversationSearch={CustomConversationSearch} />
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Custom ConversationCreate
|
|
306
|
+
``` typescript
|
|
307
|
+
<ConversationList ConversationCreate={CustomConversationCreate} />
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Custom Avatar
|
|
311
|
+
``` typescript
|
|
312
|
+
<ConversationList Avatar={CustomAvatar} />
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## APIs/Props
|
|
316
|
+
|
|
317
|
+
|**Prop Name**|**Type**|**Default**|**Description**|
|
|
318
|
+
|---------|---------|---------|---------|
|
|
319
|
+
|enableSearch|Boolean|true|Controls whether the conversation search feature is displayed.|
|
|
320
|
+
|enableCreate|Boolean|true|Controls whether the conversation creation feature is displayed.|
|
|
321
|
+
|enableActions|Boolean|true|Controls whether conversation actions are displayed.|
|
|
322
|
+
|actionsConfig|ConversationActionsConfig|-|Used to customize conversation action configurations.|
|
|
323
|
+
|Header|ReactElement|Header|Custom Header component.|
|
|
324
|
+
|List|ReactElement|List|Custom conversation list component.|
|
|
325
|
+
|Preview|ReactElement|ConversationPreview|Custom conversation preview component.|
|
|
326
|
+
|ConversationCreate|ReactElement|ConversationCreate|Custom conversation creation component.|
|
|
327
|
+
|ConversationSearch|ReactElement|ConversationSearch|Custom conversation search component.|
|
|
328
|
+
|ConversationActions|ReactElement|ConversationActions|Custom conversation actions component.|
|
|
329
|
+
|Avatar|ReactElement|Avatar|Custom avatar component.|
|
|
330
|
+
|PlaceholderEmptyList|ReactNode|-|Custom placeholder element when the conversation list is empty.|
|
|
331
|
+
|PlaceholderLoading|ReactNode|-|Custom placeholder element when the conversation list is loading.|
|
|
332
|
+
|PlaceholderLoadError|ReactNode|-|Custom placeholder element when the conversation list fails to load.|
|
|
333
|
+
|filter|(conversationList: ConversationInfo[]) => ConversationInfo[]|-|Function used to filter the conversation list.|
|
|
334
|
+
|sort|(conversationList: ConversationInfo[]) => ConversationInfo[]|-|Function used to sort the conversation list.|
|
|
335
|
+
|onConversationSelect|(conversation: ConversationInfo) => void;|-|Callback function triggered when a conversation is clicked. The parameter is the clicked conversation object.|
|
|
336
|
+
|onBeforeCreateConversation|(params: CreateParams) => CreateParams;|-|Custom operation executed before creating a conversation. The parameter is the required parameters for creating a conversation.|
|
|
337
|
+
|onConversationCreate|(conversation: ConversationInfo) => void;|-|Callback function after conversation creation. The parameter is the created conversation object.|
|
|
338
|
+
|className|String|-|Custom CSS class name for the root element.|
|
|
339
|
+
|style|`React.CSSProperties`|-|Custom style for the root element.|
|