call-live-sdk 1.0.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/dist/api/index.d.ts +438 -0
- package/dist/api/request.d.ts +39 -0
- package/dist/assets/style.css +1 -0
- package/dist/call-live-sdk.es.js +263460 -0
- package/dist/call-live-sdk.umd.js +1 -0
- package/dist/chunks/Empty-BDMct_Gn.js +4 -0
- package/dist/chunks/queen-MdxXL6oM.js +4172 -0
- package/dist/chunks/queen-full-CQOoyRsi.js +4288 -0
- package/dist/chunks/queen-lite-B9oBZ9sm.js +4226 -0
- package/dist/chunks/queen-pro-RFAnqVlR.js +4139 -0
- package/dist/chunks/queen-simd-full-ra8nUvBN.js +4288 -0
- package/dist/chunks/queen-simd-lite-CXQWc1UV.js +4224 -0
- package/dist/chunks/queen-simd-pro-DVcT-lDD.js +4137 -0
- package/dist/chunks/queen-simd-uc5TO6ZA.js +4170 -0
- package/dist/com_feiyao_official.auth +0 -0
- package/dist/components/AudienceList.d.ts +5 -0
- package/dist/components/BrowserNotSupported.d.ts +12 -0
- package/dist/components/Call/index.d.ts +3 -0
- package/dist/components/CallGridLayout.d.ts +29 -0
- package/dist/components/CallSingleColumnLayout.d.ts +21 -0
- package/dist/components/CallUserList.d.ts +13 -0
- package/dist/components/CallUserVideo.d.ts +33 -0
- package/dist/components/CanvasCamera.d.ts +5 -0
- package/dist/components/CanvasUploadAudio.d.ts +2 -0
- package/dist/components/CanvasUploadVideo.d.ts +3 -0
- package/dist/components/CanvasVideoSlot.d.ts +14 -0
- package/dist/components/ConfigsInfo.d.ts +2 -0
- package/dist/components/ControlBottom.d.ts +2 -0
- package/dist/components/CountDown.d.ts +4 -0
- package/dist/components/Counter/index.d.ts +6 -0
- package/dist/components/DocumentControler.d.ts +3 -0
- package/dist/components/DrawingTools/ColorPicker.d.ts +9 -0
- package/dist/components/DrawingTools/DrawingToolbar.d.ts +27 -0
- package/dist/components/DrawingTools/LayoutSwitcher.d.ts +9 -0
- package/dist/components/DrawingTools/PreviewModal.d.ts +7 -0
- package/dist/components/DrawingTools/ShapeTypePicker.d.ts +9 -0
- package/dist/components/DrawingTools/SizePicker.d.ts +9 -0
- package/dist/components/DrawingTools/TextSizePicker.d.ts +9 -0
- package/dist/components/DrawingTools/ToolOption.d.ts +11 -0
- package/dist/components/DrawingTools/index.d.ts +8 -0
- package/dist/components/ElementList.d.ts +11 -0
- package/dist/components/Emoji.d.ts +2 -0
- package/dist/components/EnvExample.d.ts +7 -0
- package/dist/components/ErrorPage/ErrorPage.d.ts +8 -0
- package/dist/components/GlobalErrorBoundary.d.ts +60 -0
- package/dist/components/Guest/Guest.d.ts +3 -0
- package/dist/components/Guest/index.d.ts +2 -0
- package/dist/components/Head.d.ts +12 -0
- package/dist/components/LeaveRoom.d.ts +18 -0
- package/dist/components/LeftSidebar.d.ts +14 -0
- package/dist/components/LiveDetection.d.ts +3 -0
- package/dist/components/LivePlayer/LivePlayer.d.ts +2 -0
- package/dist/components/LivePlayer/index.d.ts +2 -0
- package/dist/components/LivePushStats.d.ts +2 -0
- package/dist/components/LiveWaitingRoom/LiveWaitingRoom.d.ts +10 -0
- package/dist/components/LiveWaitingRoom/index.d.ts +2 -0
- package/dist/components/MediaSettings/AudioVisualizer.d.ts +16 -0
- package/dist/components/MediaSettings/MediaSettings.d.ts +3 -0
- package/dist/components/MediaSettings/index.d.ts +2 -0
- package/dist/components/MetaItem.d.ts +3 -0
- package/dist/components/PaginatedList/index.d.ts +2 -0
- package/dist/components/RightSidebar/RightSidebar.d.ts +4 -0
- package/dist/components/RightSidebar/components/CallComponent/CallComponent.d.ts +7 -0
- package/dist/components/RightSidebar/components/CallComponent/features/invite/components/InviteGuestModal.d.ts +22 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/components/CallBottomActions.d.ts +15 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/components/CallControls.d.ts +15 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/components/MeetingUserList.d.ts +14 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/hooks/useCallConfig.d.ts +18 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/hooks/useOnlineUsers.d.ts +9 -0
- package/dist/components/RightSidebar/components/CallComponent/features/meeting/hooks/useUserActions.d.ts +6 -0
- package/dist/components/RightSidebar/components/CallComponent/features/waiting/components/WaitingUserList.d.ts +11 -0
- package/dist/components/RightSidebar/components/CallComponent/index.d.ts +3 -0
- package/dist/components/RightSidebar/components/CallComponent/shared/ui/CallUser.d.ts +14 -0
- package/dist/components/RightSidebar/components/CallComponent/shared/ui/ErrorBoundary.d.ts +22 -0
- package/dist/components/RightSidebar/components/CallComponent/shared/ui/LoadingSpinner.d.ts +19 -0
- package/dist/components/RightSidebar/components/CallComponent/types/index.d.ts +55 -0
- package/dist/components/RightSidebar/components/ChatComponent.d.ts +2 -0
- package/dist/components/RightSidebar/components/Prohibition.d.ts +2 -0
- package/dist/components/RightSidebar/components/TeamComponent.d.ts +2 -0
- package/dist/components/RightSidebar/index.d.ts +2 -0
- package/dist/components/RtcJoomRoom/RtcJoomRoom.d.ts +4 -0
- package/dist/components/RtcJoomRoom/components/InviteConfirmModal.d.ts +28 -0
- package/dist/components/RtcJoomRoom/hooks/useInviteConfirm.d.ts +40 -0
- package/dist/components/RtcJoomRoom/index.d.ts +12 -0
- package/dist/components/RtcJoomRoom/types.d.ts +333 -0
- package/dist/components/RtcJoomRoom/useMessageReceiver.d.ts +38 -0
- package/dist/components/RtcJoomRoom/useMessageSender.d.ts +28 -0
- package/dist/components/RtcJoomRoom/useRoomMessageHandler.d.ts +205 -0
- package/dist/components/ScenePanel.d.ts +14 -0
- package/dist/components/SourcePanel.d.ts +12 -0
- package/dist/components/UploadDocumentFrom/EasyCrop.d.ts +7 -0
- package/dist/components/UploadDocumentFrom/constants.d.ts +7 -0
- package/dist/components/UploadDocumentFrom/exports.d.ts +5 -0
- package/dist/components/UploadDocumentFrom/hooks/useLibrary.d.ts +41 -0
- package/dist/components/UploadDocumentFrom/index.d.ts +8 -0
- package/dist/components/UploadImageFrom/EasyCrop.d.ts +7 -0
- package/dist/components/UploadImageFrom/constants.d.ts +7 -0
- package/dist/components/UploadImageFrom/hooks/useImageLibrary.d.ts +39 -0
- package/dist/components/UploadImageFrom/index.d.ts +41 -0
- package/dist/components/UploadImageFrom/types.d.ts +39 -0
- package/dist/components/UploadImageFromV1/EasyCrop.d.ts +7 -0
- package/dist/components/UploadImageFromV1/constants.d.ts +7 -0
- package/dist/components/UploadImageFromV1/index.d.ts +3 -0
- package/dist/components/UploadImageFromV1/types.d.ts +39 -0
- package/dist/components/UserInfo.d.ts +7 -0
- package/dist/components/autoPlayModal/index.d.ts +12 -0
- package/dist/hooks/useCallUserPagination.d.ts +58 -0
- package/dist/hooks/useJoinRoomCanvas.d.ts +20 -0
- package/dist/hooks/useVideoElementDetector.d.ts +37 -0
- package/dist/index.d.ts +6 -0
- package/dist/main.d.ts +1 -0
- package/dist/noProcess.png +0 -0
- package/dist/pages/CallHome/CallHome.d.ts +4 -0
- package/dist/pages/CallHome/index.d.ts +2 -0
- package/dist/pages/Login/Login.d.ts +13 -0
- package/dist/pages/Login/index.d.ts +2 -0
- package/dist/pages/MobileLive/MobileLive.d.ts +13 -0
- package/dist/pages/MobileLive/components/DeviceSelectionModal.d.ts +31 -0
- package/dist/pages/MobileLive/components/DeviceSettingsModal.d.ts +42 -0
- package/dist/pages/MobileLive/components/MeetingListModal.d.ts +16 -0
- package/dist/pages/MobileLive/components/MobileControlBar.d.ts +29 -0
- package/dist/pages/MobileLive/components/MobileHeader.d.ts +34 -0
- package/dist/pages/MobileLive/components/PageIndicator.d.ts +29 -0
- package/dist/pages/MobileLive/components/UserVideoContainer.d.ts +31 -0
- package/dist/pages/MobileLive/components/VideoSwipeContainer.d.ts +33 -0
- package/dist/pages/MobileLive/hooks/useWakeLock.d.ts +52 -0
- package/dist/pages/MobileLive/index.d.ts +2 -0
- package/dist/pages/MobileLive/unocssUtils.d.ts +1 -0
- package/dist/pages/VoiceChatLive/VoiceChat.d.ts +4 -0
- package/dist/pages/VoiceChatLive/index.d.ts +2 -0
- package/dist/sdk/index.d.ts +40 -0
- package/dist/stores/activitytype.d.ts +48 -0
- package/dist/stores/call.d.ts +6 -0
- package/dist/stores/callStore.d.ts +225 -0
- package/dist/stores/commentChatUrl.d.ts +6 -0
- package/dist/stores/commentRtmpStats.d.ts +6 -0
- package/dist/stores/commentSocket.d.ts +26 -0
- package/dist/stores/counterStore.d.ts +9 -0
- package/dist/stores/currentUser.d.ts +6 -0
- package/dist/stores/drawingToolsStore.d.ts +62 -0
- package/dist/stores/guest.d.ts +8 -0
- package/dist/stores/liveInfo.d.ts +21 -0
- package/dist/stores/livepushcode.d.ts +37 -0
- package/dist/stores/sdkStore.d.ts +44 -0
- package/dist/types/sdk.d.ts +42 -0
- package/dist/utils/common.d.ts +10 -0
- package/dist/utils/env.d.ts +35 -0
- package/dist/utils/eventbus.d.ts +2 -0
- package/dist/utils/resource.d.ts +9 -0
- package/dist/utils/utiles.d.ts +19 -0
- package/dist/utils/variable.d.ts +25 -0
- package/package.json +81 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { CallUser, WaitingModeState } from '@/stores/callStore';
|
|
2
|
+
/**
|
|
3
|
+
* 房间消息类型枚举
|
|
4
|
+
*
|
|
5
|
+
* 定义了所有支持的房间消息类型,便于类型检查和扩展
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RoomMessageType {
|
|
8
|
+
/** 静音控制消息 - 主持人控制全体静音/取消静音 */
|
|
9
|
+
MUTE = "mute",
|
|
10
|
+
/** 离开房间消息 - 主持人解散房间 */
|
|
11
|
+
LEAVE = "leave",
|
|
12
|
+
/** 等候模式消息 - 用户准入或移至等候状态 */
|
|
13
|
+
WAITING_MODE = "waiting_mode",
|
|
14
|
+
/** 等待消息 - 通用等待状态消息 */
|
|
15
|
+
WAIT = "wait",
|
|
16
|
+
/** 用户变更消息 - 用户信息变更通知 */
|
|
17
|
+
CHANGE_USER = "change_user",
|
|
18
|
+
/** 媒体消息 - 音频/视频状态变更 */
|
|
19
|
+
MEDIA = "media",
|
|
20
|
+
/** 配置变更消息 - 主持人变更房间配置 */
|
|
21
|
+
CHANGE_CONFIG = "change_config",
|
|
22
|
+
/** 用户列表消息 - 主持人下发所有用户列表 */
|
|
23
|
+
USERS = "users",
|
|
24
|
+
/** 邀请操作消息 - 主持人邀请嘉宾开启设备 */
|
|
25
|
+
INVITE_ACTION = "invite_action",
|
|
26
|
+
/** 邀请反馈消息 - 嘉宾对邀请的响应反馈 */
|
|
27
|
+
INVITE_FEEDBACK = "invite_feedback",
|
|
28
|
+
/** 主持人定期同步用户列表消息 */
|
|
29
|
+
SYNC_USERS = "sync_users"
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 静音消息数据接口
|
|
33
|
+
*
|
|
34
|
+
* 定义静音操作相关的数据结构
|
|
35
|
+
*/
|
|
36
|
+
interface MuteMessageData {
|
|
37
|
+
/** 是否静音 - true: 静音, false: 取消静音 */
|
|
38
|
+
is_muted?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 媒体消息数据接口
|
|
42
|
+
*
|
|
43
|
+
* 定义媒体状态变更相关的数据结构
|
|
44
|
+
*/
|
|
45
|
+
interface MediaMessageData {
|
|
46
|
+
/** 媒体类型 - 音频或视频 */
|
|
47
|
+
media_type?: 'audio' | 'video';
|
|
48
|
+
/** 媒体状态 - 0: 关闭, 1: 开启 */
|
|
49
|
+
media_state?: 0 | 1;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 邀请操作消息数据接口
|
|
53
|
+
*
|
|
54
|
+
* 定义主持人邀请嘉宾开启设备相关的数据结构
|
|
55
|
+
*/
|
|
56
|
+
interface InviteActionMessageData {
|
|
57
|
+
/** 邀请操作类型 - 'enable_microphone' | 'enable_camera' */
|
|
58
|
+
action: 'enable_microphone' | 'enable_camera';
|
|
59
|
+
/** 目标用户ID - 被邀请的用户标识 */
|
|
60
|
+
target_user_id: string;
|
|
61
|
+
/** 发起用户ID - 发起邀请的主持人标识 */
|
|
62
|
+
from_user_id: string;
|
|
63
|
+
/** 时间戳 - 邀请发送时间 */
|
|
64
|
+
timestamp: number;
|
|
65
|
+
/** 邀请消息内容 */
|
|
66
|
+
message: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 邀请反馈消息数据接口
|
|
70
|
+
*
|
|
71
|
+
* 定义嘉宾对邀请响应的数据结构
|
|
72
|
+
*/
|
|
73
|
+
interface InviteFeedbackMessageData {
|
|
74
|
+
/** 邀请操作类型 - 对应原始邀请的操作类型 */
|
|
75
|
+
action: 'enable_microphone' | 'enable_camera';
|
|
76
|
+
/** 反馈用户ID - 响应邀请的嘉宾标识 */
|
|
77
|
+
from_user_id: string;
|
|
78
|
+
/** 目标用户ID - 接收反馈的主持人标识 */
|
|
79
|
+
target_user_id: string;
|
|
80
|
+
/** 响应状态 - 'accepted' | 'failed' */
|
|
81
|
+
status: 'accepted' | 'failed';
|
|
82
|
+
/** 时间戳 - 反馈发送时间 */
|
|
83
|
+
timestamp: number;
|
|
84
|
+
/** 反馈消息内容 */
|
|
85
|
+
message: string;
|
|
86
|
+
/** 错误信息 - 当status为failed时的错误描述 */
|
|
87
|
+
error?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 用户列表消息数据接口
|
|
91
|
+
*
|
|
92
|
+
* 定义主持人下发所有用户列表相关的数据结构
|
|
93
|
+
*/
|
|
94
|
+
interface UsersMessageData {
|
|
95
|
+
users: CallUser[];
|
|
96
|
+
rtc_userid: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 等候模式消息数据接口
|
|
100
|
+
*
|
|
101
|
+
* 定义用户等候状态变更相关的数据结构
|
|
102
|
+
*/
|
|
103
|
+
interface WaitingModeMessageData {
|
|
104
|
+
/** RTC 用户 ID - 目标用户的唯一标识 */
|
|
105
|
+
rtc_userid?: string;
|
|
106
|
+
/** 等候模式状态 - 用户的当前等候状态 */
|
|
107
|
+
waiting_mode_state?: WaitingModeState;
|
|
108
|
+
users: CallUser[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 用户变更消息数据接口
|
|
112
|
+
*
|
|
113
|
+
* 定义用户信息变更相关的数据结构
|
|
114
|
+
*/
|
|
115
|
+
interface ChangeUserMessageData {
|
|
116
|
+
/** 用户信息 - CallUser 的部分字段,具体包含哪些字段取决于消息类型 */
|
|
117
|
+
user?: Partial<CallUser>;
|
|
118
|
+
users?: Partial<CallUser>[];
|
|
119
|
+
/** 变更类型 - 指示具体的变更操作类型 */
|
|
120
|
+
change_type?: RoomMessageType;
|
|
121
|
+
/** 操作类型 - 具体的用户操作动作(如 name_change) */
|
|
122
|
+
action?: string;
|
|
123
|
+
/** 用户ID - 发生变更的用户标识 */
|
|
124
|
+
user_id?: string;
|
|
125
|
+
/** 旧名称 - 用户变更前的昵称 */
|
|
126
|
+
old_name?: string;
|
|
127
|
+
/** 新名称 - 用户变更后的昵称 */
|
|
128
|
+
new_name?: string;
|
|
129
|
+
/** 时间戳 - 消息发送时间 */
|
|
130
|
+
timestamp?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 房间消息数据类型定义
|
|
134
|
+
*
|
|
135
|
+
* 统一的消息数据结构,包含消息类型和对应的数据载荷
|
|
136
|
+
*/
|
|
137
|
+
interface RoomMessageData {
|
|
138
|
+
/** 消息类型 - 决定如何处理该消息 */
|
|
139
|
+
type: RoomMessageType;
|
|
140
|
+
/** 消息数据 - 根据消息类型包含不同的数据结构 */
|
|
141
|
+
data?: MuteMessageData | MediaMessageData | WaitingModeMessageData | ChangeUserMessageData | UsersMessageData | InviteActionMessageData | InviteFeedbackMessageData | Record<string, unknown>;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 房间消息事件类型定义
|
|
145
|
+
*
|
|
146
|
+
* 从 RTC 系统接收到的原始消息事件结构
|
|
147
|
+
*/
|
|
148
|
+
interface RoomMessageEvent {
|
|
149
|
+
/** 发送消息的用户 ID */
|
|
150
|
+
userId: string;
|
|
151
|
+
/** 消息内容 - JSON 字符串格式 */
|
|
152
|
+
message: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 邀请确认回调函数类型
|
|
156
|
+
*/
|
|
157
|
+
export type InviteConfirmCallback = (inviteData: InviteActionMessageData) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Hook 参数接口
|
|
160
|
+
*/
|
|
161
|
+
export interface UseRoomMessageHandlerParams {
|
|
162
|
+
/** 邀请确认回调 - 当收到邀请消息时触发,用于显示确认弹窗 */
|
|
163
|
+
onInviteConfirm?: InviteConfirmCallback;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Hook 返回值接口
|
|
167
|
+
*
|
|
168
|
+
* 定义 useRoomMessageHandler Hook 的返回值结构
|
|
169
|
+
*/
|
|
170
|
+
export interface UseRoomMessageHandlerReturn {
|
|
171
|
+
/** 主要的消息处理函数 - 用于处理所有类型的房间消息 */
|
|
172
|
+
handleRoomMessageReceived: (event: RoomMessageEvent) => void;
|
|
173
|
+
/** 处理用户确认邀请的函数 */
|
|
174
|
+
handleInviteConfirm: (inviteData: InviteActionMessageData, accepted: boolean) => Promise<void>;
|
|
175
|
+
/** 独立的处理函数集合 - 便于单元测试和调试 */
|
|
176
|
+
handlers: {
|
|
177
|
+
/** 静音消息处理函数 */
|
|
178
|
+
handleMuteMessage: (data: RoomMessageData, userId: string) => void;
|
|
179
|
+
/** 离开房间消息处理函数 */
|
|
180
|
+
handleLeaveMessage: (data: RoomMessageData, userId: string) => void;
|
|
181
|
+
/** 等候模式消息处理函数 */
|
|
182
|
+
handleWaitingModeMessage: (data: RoomMessageData, userId: string) => void;
|
|
183
|
+
/** 用户变更消息处理函数 */
|
|
184
|
+
handleChangeUserMessage: (data: RoomMessageData, userId: string) => void;
|
|
185
|
+
/** 邀请操作消息处理函数 */
|
|
186
|
+
handleInviteActionMessage: (data: RoomMessageData, userId: string) => void;
|
|
187
|
+
/** 邀请反馈消息处理函数 */
|
|
188
|
+
handleInviteFeedbackMessage: (data: RoomMessageData, userId: string) => void;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 房间消息处理 Hook
|
|
193
|
+
*
|
|
194
|
+
* 用于处理 RTC 房间内接收到的各种消息类型:
|
|
195
|
+
* - mute: 主持人全体静音操作
|
|
196
|
+
* - leave: 主持人解散房间
|
|
197
|
+
* - waiting_mode: 用户准入/移至等候状态
|
|
198
|
+
* - invite_action: 主持人邀请嘉宾开启设备
|
|
199
|
+
* - invite_feedback: 嘉宾回馈邀请处理结果
|
|
200
|
+
*
|
|
201
|
+
* @param params - Hook 参数配置
|
|
202
|
+
* @returns 房间消息处理函数和相关工具函数
|
|
203
|
+
*/
|
|
204
|
+
export declare const useRoomMessageHandler: (params?: UseRoomMessageHandlerParams) => UseRoomMessageHandlerReturn;
|
|
205
|
+
export default useRoomMessageHandler;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface ScenePanelProps {
|
|
3
|
+
sceneNames: Record<string, string>;
|
|
4
|
+
currentScene: string;
|
|
5
|
+
onSceneClick: (scene: string) => void;
|
|
6
|
+
onSceneNameChange: (sceneKey: string, newName: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 场景管理面板组件
|
|
10
|
+
* 负责显示和管理直播场景列表
|
|
11
|
+
* AI-TODO [STATE] 内部管理编辑状态,减少父组件复杂度
|
|
12
|
+
*/
|
|
13
|
+
declare const ScenePanel: FC<ScenePanelProps>;
|
|
14
|
+
export default ScenePanel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface SourcePanelProps {
|
|
3
|
+
currentScene: string;
|
|
4
|
+
sceneNames: Record<string, string>;
|
|
5
|
+
menuItems: any[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 来源显示面板组件
|
|
9
|
+
* 负责显示当前场景的来源信息和提供添加元素的功能
|
|
10
|
+
*/
|
|
11
|
+
declare const SourcePanel: FC<SourcePanelProps>;
|
|
12
|
+
export default SourcePanel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Cropper from 'react-easy-crop';
|
|
2
|
+
import type { EasyCropRef } from './type';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Required<Pick<import("./type").ImgCropProps, "grid" | "rotate" | "shape" | "zoom" | "aspect" | "minZoom" | "maxZoom" | "cropperProps">> & {
|
|
4
|
+
cropperRef?: import("react").ForwardedRef<Cropper>;
|
|
5
|
+
image: string;
|
|
6
|
+
} & import("react").RefAttributes<EasyCropRef>>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PREFIX = "img-crop";
|
|
2
|
+
export declare const INIT_ZOOM = 1;
|
|
3
|
+
export declare const ZOOM_STEP = 0.1;
|
|
4
|
+
export declare const INIT_ROTATE = 0;
|
|
5
|
+
export declare const ROTATE_STEP = 1;
|
|
6
|
+
export declare const MIN_ROTATE = -180;
|
|
7
|
+
export declare const MAX_ROTATE = 180;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图片库数据类型
|
|
3
|
+
*/
|
|
4
|
+
interface Item {
|
|
5
|
+
id: string | number;
|
|
6
|
+
url: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
thumbnail: string;
|
|
9
|
+
file_size: number;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface UseLibraryParams {
|
|
13
|
+
defaultPageSize?: number;
|
|
14
|
+
initialCurrent?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 图片库数据管理Hook
|
|
18
|
+
* 用于缓存和管理图片库数据,避免重复请求
|
|
19
|
+
*/
|
|
20
|
+
declare const useLibrary: ({ defaultPageSize, initialCurrent, }?: UseLibraryParams) => {
|
|
21
|
+
data: Item[];
|
|
22
|
+
loading: boolean;
|
|
23
|
+
total: number;
|
|
24
|
+
currentPage: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
selectedRows: Item[];
|
|
27
|
+
selectedRowKeys: (string | number)[];
|
|
28
|
+
loadLibrary: (params?: Record<string, any>) => Promise<{
|
|
29
|
+
data: Item[];
|
|
30
|
+
total: number;
|
|
31
|
+
success: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
findByUrl: (url: string) => Promise<any>;
|
|
34
|
+
resetSelection: () => void;
|
|
35
|
+
updateSelection: (keys: (string | number)[], rows: Item[]) => void;
|
|
36
|
+
setCurrentPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
37
|
+
setPageSize: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
38
|
+
};
|
|
39
|
+
export type { Item };
|
|
40
|
+
export { useLibrary };
|
|
41
|
+
export default useLibrary;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Cropper from 'react-easy-crop';
|
|
2
|
+
import type { EasyCropRef } from './types';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Required<Pick<import("./types").ImgCropProps, "grid" | "rotate" | "shape" | "zoom" | "aspect" | "minZoom" | "maxZoom" | "cropperProps">> & {
|
|
4
|
+
cropperRef?: import("react").ForwardedRef<Cropper>;
|
|
5
|
+
image: string;
|
|
6
|
+
} & import("react").RefAttributes<EasyCropRef>>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PREFIX = "img-crop";
|
|
2
|
+
export declare const INIT_ZOOM = 1;
|
|
3
|
+
export declare const ZOOM_STEP = 0.1;
|
|
4
|
+
export declare const INIT_ROTATE = 0;
|
|
5
|
+
export declare const ROTATE_STEP = 1;
|
|
6
|
+
export declare const MIN_ROTATE = -180;
|
|
7
|
+
export declare const MAX_ROTATE = 180;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图片库数据类型
|
|
3
|
+
*/
|
|
4
|
+
interface ImageItem {
|
|
5
|
+
id: string | number;
|
|
6
|
+
url: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
thumbnail: string;
|
|
9
|
+
file_size: number;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface UseImageLibraryParams {
|
|
13
|
+
defaultPageSize?: number;
|
|
14
|
+
initialCurrent?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 图片库数据管理Hook
|
|
18
|
+
* 用于缓存和管理图片库数据,避免重复请求
|
|
19
|
+
*/
|
|
20
|
+
declare const useImageLibrary: ({ defaultPageSize, initialCurrent, }?: UseImageLibraryParams) => {
|
|
21
|
+
imageData: ImageItem[];
|
|
22
|
+
loading: boolean;
|
|
23
|
+
total: number;
|
|
24
|
+
currentPage: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
selectedRows: ImageItem[];
|
|
27
|
+
selectedRowKeys: (string | number)[];
|
|
28
|
+
loadImageLibrary: (params?: Record<string, any>) => Promise<{
|
|
29
|
+
data: ImageItem[];
|
|
30
|
+
total: number;
|
|
31
|
+
success: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
findImageByUrl: (url: string) => Promise<any>;
|
|
34
|
+
resetSelection: () => void;
|
|
35
|
+
updateSelection: (keys: (string | number)[], rows: ImageItem[]) => void;
|
|
36
|
+
setCurrentPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
37
|
+
setPageSize: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
38
|
+
};
|
|
39
|
+
export default useImageLibrary;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { RcFile } from 'antd/es/upload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
/**
|
|
5
|
+
* 图片上传组件
|
|
6
|
+
* 支持裁剪、旋转、缩放等功能
|
|
7
|
+
*/
|
|
8
|
+
interface UploadImageFromProps {
|
|
9
|
+
aspect?: number;
|
|
10
|
+
shape?: 'rect' | 'round';
|
|
11
|
+
grid?: boolean;
|
|
12
|
+
quality?: number;
|
|
13
|
+
fillColor?: string;
|
|
14
|
+
zoom?: boolean;
|
|
15
|
+
rotate?: boolean;
|
|
16
|
+
minZoom?: number;
|
|
17
|
+
maxZoom?: number;
|
|
18
|
+
modalWidth?: number | string;
|
|
19
|
+
modalOk?: string;
|
|
20
|
+
modalCancel?: string;
|
|
21
|
+
modalMaskTransitionName?: string;
|
|
22
|
+
modalTransitionName?: string;
|
|
23
|
+
modalClassName?: string;
|
|
24
|
+
onModalOk?: (file: void | boolean | string | Blob | File) => void;
|
|
25
|
+
onModalCancel?: () => void;
|
|
26
|
+
beforeCrop?: (file: RcFile, fileList: RcFile[]) => boolean | Promise<boolean>;
|
|
27
|
+
onUploadFail?: (err: Error) => void;
|
|
28
|
+
cropperProps?: any;
|
|
29
|
+
titleOfModal?: string;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
onChange?: (url: string, filename?: string) => void;
|
|
33
|
+
value?: string;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
accept?: string;
|
|
36
|
+
nocrop?: boolean;
|
|
37
|
+
maxSizeMB?: number;
|
|
38
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
39
|
+
}
|
|
40
|
+
declare const UploadImageFrom: React.FC<UploadImageFromProps>;
|
|
41
|
+
export default UploadImageFrom;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RcFile } from 'antd/es/upload/interface';
|
|
2
|
+
import type { Dispatch, ForwardedRef, MutableRefObject, SetStateAction } from 'react';
|
|
3
|
+
import type { CropperProps, default as Cropper } from 'react-easy-crop';
|
|
4
|
+
import type { Area } from 'react-easy-crop';
|
|
5
|
+
export type ImgCropProps = {
|
|
6
|
+
aspect?: number;
|
|
7
|
+
shape?: 'rect' | 'round';
|
|
8
|
+
grid?: boolean;
|
|
9
|
+
quality?: number;
|
|
10
|
+
fillColor?: string;
|
|
11
|
+
zoom?: boolean;
|
|
12
|
+
rotate?: boolean;
|
|
13
|
+
minZoom?: number;
|
|
14
|
+
maxZoom?: number;
|
|
15
|
+
modalTitle?: string;
|
|
16
|
+
modalWidth?: number | string;
|
|
17
|
+
modalOk?: string;
|
|
18
|
+
modalCancel?: string;
|
|
19
|
+
modalMaskTransitionName?: string;
|
|
20
|
+
modalClassName?: string;
|
|
21
|
+
modalTransitionName?: string;
|
|
22
|
+
onModalOk?: (file: void | boolean | string | Blob | File) => void;
|
|
23
|
+
onModalCancel?: () => void;
|
|
24
|
+
beforeCrop?: (file: RcFile, fileList: RcFile[]) => boolean | Promise<boolean>;
|
|
25
|
+
onUploadFail?: (err: Error) => void;
|
|
26
|
+
cropperProps?: Partial<CropperProps>;
|
|
27
|
+
titleOfModal?: string;
|
|
28
|
+
};
|
|
29
|
+
export type EasyCropRef = {
|
|
30
|
+
rotateVal: number;
|
|
31
|
+
setZoomVal: Dispatch<SetStateAction<number>>;
|
|
32
|
+
setRotateVal: Dispatch<SetStateAction<number>>;
|
|
33
|
+
cropPixelsRef: MutableRefObject<Area>;
|
|
34
|
+
};
|
|
35
|
+
export type EasyCropProps = Required<Pick<ImgCropProps, 'aspect' | 'shape' | 'grid' | 'zoom' | 'rotate' | 'minZoom' | 'maxZoom' | 'cropperProps'>> & {
|
|
36
|
+
cropperRef?: ForwardedRef<Cropper>;
|
|
37
|
+
image: string;
|
|
38
|
+
};
|
|
39
|
+
export type OnModalOk = NonNullable<ImgCropProps['onModalOk']>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Cropper from 'react-easy-crop';
|
|
2
|
+
import type { EasyCropRef } from './types';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Required<Pick<import("./types").ImgCropProps, "grid" | "rotate" | "shape" | "zoom" | "aspect" | "minZoom" | "maxZoom" | "cropperProps">> & {
|
|
4
|
+
cropperRef?: import("react").ForwardedRef<Cropper>;
|
|
5
|
+
image: string;
|
|
6
|
+
} & import("react").RefAttributes<EasyCropRef>>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PREFIX = "img-crop";
|
|
2
|
+
export declare const INIT_ZOOM = 1;
|
|
3
|
+
export declare const ZOOM_STEP = 0.1;
|
|
4
|
+
export declare const INIT_ROTATE = 0;
|
|
5
|
+
export declare const ROTATE_STEP = 1;
|
|
6
|
+
export declare const MIN_ROTATE = -180;
|
|
7
|
+
export declare const MAX_ROTATE = 180;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RcFile } from 'antd/es/upload/interface';
|
|
2
|
+
import type { Dispatch, ForwardedRef, MutableRefObject, SetStateAction } from 'react';
|
|
3
|
+
import type { CropperProps, default as Cropper } from 'react-easy-crop';
|
|
4
|
+
import type { Area } from 'react-easy-crop';
|
|
5
|
+
export type ImgCropProps = {
|
|
6
|
+
aspect?: number;
|
|
7
|
+
shape?: 'rect' | 'round';
|
|
8
|
+
grid?: boolean;
|
|
9
|
+
quality?: number;
|
|
10
|
+
fillColor?: string;
|
|
11
|
+
zoom?: boolean;
|
|
12
|
+
rotate?: boolean;
|
|
13
|
+
minZoom?: number;
|
|
14
|
+
maxZoom?: number;
|
|
15
|
+
modalTitle?: string;
|
|
16
|
+
modalWidth?: number | string;
|
|
17
|
+
modalOk?: string;
|
|
18
|
+
modalCancel?: string;
|
|
19
|
+
modalMaskTransitionName?: string;
|
|
20
|
+
modalClassName?: string;
|
|
21
|
+
modalTransitionName?: string;
|
|
22
|
+
onModalOk?: (file: void | boolean | string | Blob | File) => void;
|
|
23
|
+
onModalCancel?: () => void;
|
|
24
|
+
beforeCrop?: (file: RcFile, fileList: RcFile[]) => boolean | Promise<boolean>;
|
|
25
|
+
onUploadFail?: (err: Error) => void;
|
|
26
|
+
cropperProps?: Partial<CropperProps>;
|
|
27
|
+
titleOfModal?: string;
|
|
28
|
+
};
|
|
29
|
+
export type EasyCropRef = {
|
|
30
|
+
rotateVal: number;
|
|
31
|
+
setZoomVal: Dispatch<SetStateAction<number>>;
|
|
32
|
+
setRotateVal: Dispatch<SetStateAction<number>>;
|
|
33
|
+
cropPixelsRef: MutableRefObject<Area>;
|
|
34
|
+
};
|
|
35
|
+
export type EasyCropProps = Required<Pick<ImgCropProps, 'aspect' | 'shape' | 'grid' | 'zoom' | 'rotate' | 'minZoom' | 'maxZoom' | 'cropperProps'>> & {
|
|
36
|
+
cropperRef?: ForwardedRef<Cropper>;
|
|
37
|
+
image: string;
|
|
38
|
+
};
|
|
39
|
+
export type OnModalOk = NonNullable<ImgCropProps['onModalOk']>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
|
|
3
|
+
* SPDX-license-identifier: BSD-3-Clause
|
|
4
|
+
*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import './index.less';
|
|
7
|
+
type AutoPlayModalProps = {
|
|
8
|
+
handleAutoPlay: () => void;
|
|
9
|
+
autoPlayFailUser: string[];
|
|
10
|
+
};
|
|
11
|
+
declare const AutoPlayModal: React.FC<AutoPlayModalProps>;
|
|
12
|
+
export default AutoPlayModal;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 连麦用户接口(简化版)
|
|
3
|
+
*/
|
|
4
|
+
export interface CallUserForPagination {
|
|
5
|
+
rtc_userid?: string | undefined;
|
|
6
|
+
isScreenEnabled?: boolean;
|
|
7
|
+
videoList?: any[];
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 连麦用户翻页配置接口
|
|
12
|
+
*/
|
|
13
|
+
export interface CallUserPaginationConfig {
|
|
14
|
+
/** 网格列数,用于判断布局模式 */
|
|
15
|
+
gridCols: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 翻页状态和操作接口
|
|
19
|
+
*/
|
|
20
|
+
export interface CallUserPaginationResult {
|
|
21
|
+
/** 当前页码 */
|
|
22
|
+
currentPage: number;
|
|
23
|
+
/** 每页显示用户数 */
|
|
24
|
+
usersPerPage: number;
|
|
25
|
+
/** 总页数 */
|
|
26
|
+
totalPages: number;
|
|
27
|
+
/** 总视频数量 */
|
|
28
|
+
totalVideoCount: number;
|
|
29
|
+
/** 上一页操作 */
|
|
30
|
+
handlePrevPage: () => void;
|
|
31
|
+
/** 下一页操作 */
|
|
32
|
+
handleNextPage: () => void;
|
|
33
|
+
/** 跳转到指定页 */
|
|
34
|
+
goToPage: (pageNumber: number) => void;
|
|
35
|
+
/** 计算最佳网格列数 */
|
|
36
|
+
calculateOptimalGridCols: (userCount: number, defaultGridCols: number) => number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 连麦用户翻页逻辑自定义Hook
|
|
40
|
+
*
|
|
41
|
+
* @description 提取CallUserList组件中的翻页相关逻辑,支持主持人布局和宫格布局两种模式
|
|
42
|
+
*
|
|
43
|
+
* @param config 翻页配置参数
|
|
44
|
+
* @returns 翻页状态和操作方法
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const paginationResult = useCallUserPagination({
|
|
49
|
+
* gridCols: 1,
|
|
50
|
+
* callUsers: users,
|
|
51
|
+
* userId: currentUserId
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* const { currentPage, totalPages, handleNextPage, handlePrevPage } = paginationResult;
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare const useCallUserPagination: (config: CallUserPaginationConfig) => CallUserPaginationResult;
|
|
58
|
+
export default useCallUserPagination;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* canvas加入连麦房间
|
|
3
|
+
* props
|
|
4
|
+
* roomId 房间id
|
|
5
|
+
* userId 用户id
|
|
6
|
+
*
|
|
7
|
+
* isInit 初始化状态
|
|
8
|
+
*
|
|
9
|
+
* return { initCanvasJoin }
|
|
10
|
+
* initCanvasJoin(true) 开始进入房间
|
|
11
|
+
* */
|
|
12
|
+
declare const _default: ({ livePlayerRef, audioDestinationWithoutCallRef, }: {
|
|
13
|
+
livePlayerRef: any;
|
|
14
|
+
audioDestinationWithoutCallRef: React.MutableRefObject<MediaStreamAudioDestinationNode | null>;
|
|
15
|
+
}) => {
|
|
16
|
+
canvasRtc: any;
|
|
17
|
+
initCanvasJoin: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
18
|
+
getAggregatedAudioTrack: () => Promise<MediaStreamTrack | undefined>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CallUser } from '@/stores/callStore';
|
|
2
|
+
/**
|
|
3
|
+
* 视频元素检测Hook的配置选项
|
|
4
|
+
*/
|
|
5
|
+
interface UseVideoElementDetectorOptions {
|
|
6
|
+
/** 检测间隔时间(毫秒),默认3000ms */
|
|
7
|
+
interval?: number;
|
|
8
|
+
/** 是否启用检测,默认true */
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/** 最大轮询次数,默认8次 */
|
|
11
|
+
maxPollingCount?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 视频元素检测Hook
|
|
15
|
+
*
|
|
16
|
+
* 功能特性:
|
|
17
|
+
* - 定时检测指定DOM元素内是否包含video元素
|
|
18
|
+
* - 支持自定义检测间隔和启用状态
|
|
19
|
+
* - 提供回调函数处理检测结果
|
|
20
|
+
* - 自动清理定时器,避免内存泄漏
|
|
21
|
+
* - 性能优化,避免不必要的重复检测
|
|
22
|
+
*
|
|
23
|
+
* @param videoId - 要检测的DOM元素ID
|
|
24
|
+
* @param options - 配置选项
|
|
25
|
+
* @returns 检测状态和手动触发检测的方法
|
|
26
|
+
*/
|
|
27
|
+
export declare const useVideoElementDetector: (videoId: string, user: CallUser, options?: UseVideoElementDetectorOptions) => {
|
|
28
|
+
/** 手动触发一次检测 */
|
|
29
|
+
triggerDetection: () => boolean;
|
|
30
|
+
/** 启动定时检测 */
|
|
31
|
+
startDetection: () => void;
|
|
32
|
+
/** 停止定时检测 */
|
|
33
|
+
stopDetection: () => void;
|
|
34
|
+
/** 当前是否正在检测 */
|
|
35
|
+
isDetecting: boolean;
|
|
36
|
+
};
|
|
37
|
+
export default useVideoElementDetector;
|
package/dist/index.d.ts
ADDED
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index';
|
|
Binary file
|