easemob-chat-uikit 2.3.2-beta.2 → 2.4.0
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/ChatUI.esm.js +21908 -21509
- package/ChatUI.js +72 -72
- package/ChatUI.umd.js +73 -73
- package/package.json +2 -2
- package/types/component/icon/const.d.ts +2 -1
- package/types/module/callkit/components/CallControls.d.ts +1 -0
- package/types/module/callkit/hooks/useCameraDevices.d.ts +27 -0
- package/types/module/callkit/services/CallService.d.ts +2 -0
- package/types/module/callkit/types/index.d.ts +2 -0
- package/types/module/callkit/types/layout.d.ts +1 -0
- package/types/module/store/Provider.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easemob-chat-uikit",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "2.4.0",
|
|
4
|
+
"description": "Easemob UIKit for React - A comprehensive React UI component library for building instant messaging applications with chat, voice/video calling, and group management features",
|
|
5
5
|
"main": "ChatUI.umd.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "ChatUI.esm.js",
|
|
@@ -113,6 +113,7 @@ declare enum ICON_TYPES {
|
|
|
113
113
|
BAR_SQUARE_FILL = "BAR_SQUARE_FILL",
|
|
114
114
|
DOC_LOCK = "DOC_LOCK",
|
|
115
115
|
BOX_UP_ARROW = "BOX_UP_ARROW",
|
|
116
|
-
SHIELD_STAR = "SHIELD_STAR"
|
|
116
|
+
SHIELD_STAR = "SHIELD_STAR",
|
|
117
|
+
CAMERA_FILL_ARROWS = "CAMERA_FILL_ARROWS"
|
|
117
118
|
}
|
|
118
119
|
export { ICON_TYPES };
|
|
@@ -18,6 +18,7 @@ export interface CallControlsProps {
|
|
|
18
18
|
onCameraToggle?: (enabled: boolean) => void;
|
|
19
19
|
onSpeakerToggle?: (enabled: boolean) => void;
|
|
20
20
|
onScreenShareToggle?: (sharing: boolean) => void;
|
|
21
|
+
onCameraFlip?: (deviceId: string) => void;
|
|
21
22
|
onHangup?: () => void;
|
|
22
23
|
onPreviewAccept?: () => void;
|
|
23
24
|
onPreviewReject?: () => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface CameraDevice {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
label: string;
|
|
4
|
+
facingMode?: 'user' | 'environment';
|
|
5
|
+
}
|
|
6
|
+
export interface UseCameraDevicesResult {
|
|
7
|
+
/** 摄像头设备列表(只包含前后主摄像头) */
|
|
8
|
+
cameras: CameraDevice[];
|
|
9
|
+
/** 当前选中的摄像头索引 */
|
|
10
|
+
currentCameraIndex: number;
|
|
11
|
+
/** 是否有多个摄像头(>=2)*/
|
|
12
|
+
hasMultipleCameras: boolean;
|
|
13
|
+
/** 是否已获得摄像头权限(deviceId 不为空)*/
|
|
14
|
+
hasPermission: boolean;
|
|
15
|
+
/** 是否正在加载设备列表 */
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
/** 切换到下一个摄像头,返回新的 deviceId */
|
|
18
|
+
flipCamera: () => string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 获取摄像头设备列表的 hook
|
|
22
|
+
* - 只返回前后两个主摄像头(过滤掉广角、超广角等)
|
|
23
|
+
* - 使用 enumerateDevices + label 分析,不调用 getUserMedia,避免与 RTC SDK 冲突
|
|
24
|
+
* - 使用 localStorage 缓存
|
|
25
|
+
* - 提供翻转摄像头功能
|
|
26
|
+
*/
|
|
27
|
+
export declare const useCameraDevices: () => UseCameraDevicesResult;
|
|
@@ -106,6 +106,7 @@ export declare class CallService {
|
|
|
106
106
|
private invitedMembers;
|
|
107
107
|
private userInfos;
|
|
108
108
|
private localVideoStream;
|
|
109
|
+
private currentCameraDeviceId;
|
|
109
110
|
private hasEnteredPreview;
|
|
110
111
|
private isAnswering;
|
|
111
112
|
private remoteVideoTracks;
|
|
@@ -202,6 +203,7 @@ export declare class CallService {
|
|
|
202
203
|
setSpeakerVolume(volume: number): void;
|
|
203
204
|
isMuted(): boolean;
|
|
204
205
|
isCameraEnabled(): boolean;
|
|
206
|
+
flipCamera(deviceId: string): Promise<boolean>;
|
|
205
207
|
getJoinedMembers(): any[];
|
|
206
208
|
refreshLocalVideoStatus(): void;
|
|
207
209
|
playLocalVideoManually(): void;
|
|
@@ -210,6 +210,7 @@ export interface CallKitProps {
|
|
|
210
210
|
onMuteToggle?: (muted: boolean) => void;
|
|
211
211
|
onCameraToggle?: (enabled: boolean) => void;
|
|
212
212
|
onSpeakerToggle?: (enabled: boolean) => void;
|
|
213
|
+
onCameraFlip?: (deviceId: string, success: boolean) => void;
|
|
213
214
|
onScreenShareToggle?: (sharing: boolean) => void;
|
|
214
215
|
onHangup?: () => void;
|
|
215
216
|
onAddParticipant?: (event: React.MouseEvent) => void;
|
|
@@ -248,6 +249,7 @@ export interface CallControlsIconMap {
|
|
|
248
249
|
micOff?: CustomIconComponent;
|
|
249
250
|
cameraOn?: CustomIconComponent;
|
|
250
251
|
cameraOff?: CustomIconComponent;
|
|
252
|
+
cameraFlip?: CustomIconComponent;
|
|
251
253
|
speakerOn?: CustomIconComponent;
|
|
252
254
|
speakerOff?: CustomIconComponent;
|
|
253
255
|
hangup?: CustomIconComponent;
|
|
@@ -40,6 +40,7 @@ export interface FullLayoutProps extends BaseLayoutProps {
|
|
|
40
40
|
onMuteToggle?: (muted: boolean) => void;
|
|
41
41
|
onCameraToggle?: (enabled: boolean) => void;
|
|
42
42
|
onSpeakerToggle?: (enabled: boolean) => void;
|
|
43
|
+
onCameraFlip?: (deviceId: string) => void;
|
|
43
44
|
onScreenShareToggle?: (sharing: boolean) => void;
|
|
44
45
|
onHangup?: () => void;
|
|
45
46
|
onAddParticipant?: (event: React.MouseEvent) => void;
|