agora-appbuilder-core 4.1.10-beta.1 → 4.1.11-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/package.json +2 -2
  2. package/template/agora-rn-uikit/src/Utils/isBotUser.ts +1 -1
  3. package/template/android/app/build.gradle +0 -7
  4. package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
  5. package/template/bridge/rtm/web/Types.ts +0 -183
  6. package/template/bridge/rtm/web/index.ts +488 -450
  7. package/template/customization-api/typeDefinition.ts +0 -1
  8. package/template/defaultConfig.js +3 -4
  9. package/template/global.d.ts +0 -1
  10. package/template/ios/Podfile +0 -41
  11. package/template/package.json +5 -5
  12. package/template/src/AppRoutes.tsx +3 -3
  13. package/template/src/ai-agent/components/ControlButtons.tsx +1 -1
  14. package/template/src/assets/font-styles.css +1 -33
  15. package/template/src/assets/fonts/icomoon.ttf +0 -0
  16. package/template/src/assets/selection.json +1 -1
  17. package/template/src/atoms/ActionMenu.tsx +93 -13
  18. package/template/src/atoms/CustomIcon.tsx +1 -8
  19. package/template/src/atoms/DropDownMulti.tsx +80 -29
  20. package/template/src/atoms/Dropdown.tsx +0 -5
  21. package/template/src/atoms/Input.tsx +2 -1
  22. package/template/src/atoms/TertiaryButton.tsx +1 -1
  23. package/template/src/atoms/UserAvatar.tsx +1 -1
  24. package/template/src/components/ChatContext.ts +3 -5
  25. package/template/src/components/Controls.tsx +167 -208
  26. package/template/src/components/DeviceConfigure.tsx +1 -1
  27. package/template/src/components/EventsConfigure.tsx +168 -118
  28. package/template/src/components/Navbar.tsx +11 -14
  29. package/template/src/components/RTMConfigure.tsx +819 -32
  30. package/template/src/components/beauty-effect/useBeautyEffects.tsx +13 -50
  31. package/template/src/components/chat/chatConfigure.tsx +1 -7
  32. package/template/src/components/chat-messages/useChatMessages.tsx +11 -43
  33. package/template/src/components/controls/useControlPermissionMatrix.tsx +4 -32
  34. package/template/src/components/participants/AllHostParticipants.tsx +2 -10
  35. package/template/src/components/participants/Participant.tsx +1 -7
  36. package/template/src/components/participants/UserActionMenuOptions.tsx +2 -12
  37. package/template/src/components/precall/joinCallBtn.native.tsx +7 -2
  38. package/template/src/components/precall/joinCallBtn.tsx +7 -2
  39. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +16 -15
  40. package/template/src/components/precall/joinWaitingRoomBtn.tsx +31 -17
  41. package/template/src/components/precall/textInput.tsx +45 -22
  42. package/template/src/components/precall/usePreCall.tsx +7 -0
  43. package/template/src/components/recordings/RecordingsDateTable.tsx +2 -3
  44. package/template/src/components/room-info/useRoomInfo.tsx +5 -0
  45. package/template/src/components/useUserPreference.tsx +12 -39
  46. package/template/src/components/virtual-background/useVB.tsx +0 -18
  47. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +0 -27
  48. package/template/src/language/default-labels/videoCallScreenLabels.ts +27 -11
  49. package/template/src/logger/AppBuilderLogger.tsx +3 -11
  50. package/template/src/pages/VideoCall.tsx +518 -171
  51. package/template/src/pages/video-call/ActionSheetContent.tsx +77 -77
  52. package/template/src/pages/video-call/SidePanelHeader.tsx +81 -53
  53. package/template/src/pages/video-call/VideoCallScreen.tsx +0 -18
  54. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +1 -0
  55. package/template/src/rtm/RTMEngine.ts +37 -262
  56. package/template/src/rtm/utils.ts +1 -68
  57. package/template/src/rtm-events/constants.ts +7 -40
  58. package/template/src/rtm-events-api/Events.ts +39 -158
  59. package/template/src/subComponents/ChatBubble.tsx +3 -3
  60. package/template/src/subComponents/ChatContainer.tsx +9 -19
  61. package/template/src/subComponents/LocalAudioMute.tsx +2 -2
  62. package/template/src/subComponents/LocalVideoMute.tsx +2 -2
  63. package/template/src/subComponents/SidePanelEnum.tsx +0 -1
  64. package/template/src/subComponents/caption/Caption.tsx +48 -7
  65. package/template/src/subComponents/caption/CaptionContainer.tsx +324 -51
  66. package/template/src/subComponents/caption/CaptionIcon.tsx +35 -34
  67. package/template/src/subComponents/caption/CaptionText.tsx +103 -2
  68. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +179 -69
  69. package/template/src/subComponents/caption/Transcript.tsx +46 -11
  70. package/template/src/subComponents/caption/TranscriptIcon.tsx +27 -35
  71. package/template/src/subComponents/caption/TranscriptText.tsx +78 -3
  72. package/template/src/subComponents/caption/proto/ptoto.js +38 -4
  73. package/template/src/subComponents/caption/proto/test.proto +34 -19
  74. package/template/src/subComponents/caption/useCaption.tsx +754 -11
  75. package/template/src/subComponents/caption/useSTTAPI.tsx +118 -205
  76. package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +152 -33
  77. package/template/src/subComponents/caption/useStreamMessageUtils.ts +165 -34
  78. package/template/src/subComponents/caption/utils.ts +171 -3
  79. package/template/src/subComponents/chat/ChatSendButton.tsx +0 -1
  80. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +0 -16
  81. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
  82. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +4 -7
  83. package/template/src/utils/SdkEvents.ts +3 -0
  84. package/template/src/utils/useEndCall.ts +4 -4
  85. package/template/src/utils/useMuteToggleLocal.ts +10 -14
  86. package/template/src/utils/useSpeechToText.ts +31 -20
  87. package/template/bridge/rtm/web/index-legacy.ts +0 -540
  88. package/template/src/components/RTMConfigure-legacy.tsx +0 -848
  89. package/template/src/components/UserGlobalPreferenceProvider.tsx +0 -227
  90. package/template/src/components/breakout-room/BreakoutRoomPanel.tsx +0 -58
  91. package/template/src/components/breakout-room/context/BreakoutRoomContext.tsx +0 -2508
  92. package/template/src/components/breakout-room/events/BreakoutRoomEventsConfigure.tsx +0 -272
  93. package/template/src/components/breakout-room/events/constants.ts +0 -17
  94. package/template/src/components/breakout-room/hoc/BreakoutRoomNameRenderer.tsx +0 -68
  95. package/template/src/components/breakout-room/hooks/useBreakoutRoomExit.ts +0 -49
  96. package/template/src/components/breakout-room/state/reducer.ts +0 -522
  97. package/template/src/components/breakout-room/state/types.ts +0 -54
  98. package/template/src/components/breakout-room/ui/BreakoutMeetingTitle.tsx +0 -60
  99. package/template/src/components/breakout-room/ui/BreakoutRoomActionMenu.tsx +0 -136
  100. package/template/src/components/breakout-room/ui/BreakoutRoomAnnouncementModal.tsx +0 -135
  101. package/template/src/components/breakout-room/ui/BreakoutRoomGroupSettings.tsx +0 -588
  102. package/template/src/components/breakout-room/ui/BreakoutRoomMainRoomUsers.tsx +0 -142
  103. package/template/src/components/breakout-room/ui/BreakoutRoomMemberActionMenu.tsx +0 -122
  104. package/template/src/components/breakout-room/ui/BreakoutRoomParticipants.tsx +0 -124
  105. package/template/src/components/breakout-room/ui/BreakoutRoomRaiseHand.tsx +0 -65
  106. package/template/src/components/breakout-room/ui/BreakoutRoomRenameModal.tsx +0 -227
  107. package/template/src/components/breakout-room/ui/BreakoutRoomSettings.tsx +0 -140
  108. package/template/src/components/breakout-room/ui/BreakoutRoomTransition.tsx +0 -52
  109. package/template/src/components/breakout-room/ui/BreakoutRoomView.tsx +0 -193
  110. package/template/src/components/breakout-room/ui/ExitBreakoutRoomIconButton.tsx +0 -79
  111. package/template/src/components/breakout-room/ui/ParticipantManualAssignmentModal.tsx +0 -638
  112. package/template/src/components/breakout-room/ui/SelectParticipantAssignmentStrategy.tsx +0 -57
  113. package/template/src/components/common/Dividers.tsx +0 -53
  114. package/template/src/components/controls/toolbar-items/ExitBreakoutRoomToolbarItem.tsx +0 -13
  115. package/template/src/components/raise-hand/RaiseHandButton.tsx +0 -50
  116. package/template/src/components/raise-hand/RaiseHandProvider.tsx +0 -308
  117. package/template/src/components/raise-hand/index.ts +0 -14
  118. package/template/src/components/room-info/useCurrentRoomInfo.tsx +0 -42
  119. package/template/src/components/room-info/useSetBreakoutRoomInfo.tsx +0 -64
  120. package/template/src/pages/video-call/BreakoutVideoCall.tsx +0 -213
  121. package/template/src/pages/video-call/VideoCallContent.tsx +0 -211
  122. package/template/src/pages/video-call/VideoCallStateWrapper.tsx +0 -495
  123. package/template/src/rtm/RTMConfigureBreakoutRoomProvider.tsx +0 -882
  124. package/template/src/rtm/RTMConfigureMainRoomProvider.tsx +0 -757
  125. package/template/src/rtm/RTMCoreProvider.tsx +0 -419
  126. package/template/src/rtm/RTMGlobalStateProvider.tsx +0 -706
  127. package/template/src/rtm/RTMStatusBanner.tsx +0 -99
  128. package/template/src/rtm/constants.ts +0 -12
  129. package/template/src/rtm/hooks/useMainRoomUserDisplayName.ts +0 -45
  130. package/template/src/rtm/rtm-presence-utils.ts +0 -344
  131. package/template/src/subComponents/chat/ChatAnnouncementView.tsx +0 -65
  132. package/template/src/utils/useDebouncedCallback.tsx +0 -20
@@ -1,522 +0,0 @@
1
- import {ContentInterface, UidType} from '../../../../agora-rn-uikit/src';
2
- import {randomNameGenerator} from '../../../utils';
3
-
4
- export enum RoomAssignmentStrategy {
5
- AUTO_ASSIGN = 'AUTO_ASSIGN',
6
- MANUAL_ASSIGN = 'MANUAL_ASSIGN',
7
- NO_ASSIGN = 'NO_ASSIGN',
8
- }
9
- export interface ManualParticipantAssignment {
10
- uid: UidType;
11
- roomId: string | null; // null means stay in main room
12
- isHost: boolean;
13
- isSelected: boolean;
14
- }
15
-
16
- export interface BreakoutRoomUser {
17
- name: string;
18
- isHost: boolean;
19
- }
20
-
21
- export interface BreakoutGroup {
22
- id: string;
23
- name: string;
24
- participants: {
25
- hosts: UidType[];
26
- attendees: UidType[];
27
- };
28
- }
29
- export interface BreakoutRoomState {
30
- breakoutSessionId: string;
31
- breakoutGroups: BreakoutGroup[];
32
- unassignedParticipants: {uid: UidType; user: BreakoutRoomUser}[];
33
- manualAssignments: ManualParticipantAssignment[];
34
- assignmentStrategy: RoomAssignmentStrategy;
35
- canUserSwitchRoom: boolean;
36
- }
37
-
38
- export const initialBreakoutGroups = [
39
- {
40
- name: 'Room 1',
41
- id: `temp_${randomNameGenerator(6)}`,
42
- participants: {hosts: [], attendees: []},
43
- },
44
- {
45
- name: 'Room 2',
46
- id: `temp_${randomNameGenerator(6)}`,
47
- participants: {hosts: [], attendees: []},
48
- },
49
- ];
50
-
51
- export const initialBreakoutRoomState: BreakoutRoomState = {
52
- breakoutSessionId: '',
53
- assignmentStrategy: RoomAssignmentStrategy.NO_ASSIGN,
54
- canUserSwitchRoom: true,
55
- unassignedParticipants: [],
56
- manualAssignments: [],
57
- breakoutGroups: [],
58
- };
59
-
60
- export const BreakoutGroupActionTypes = {
61
- // Initial state
62
- SYNC_STATE: 'BREAKOUT_ROOM/SYNC_STATE',
63
- // session
64
- SET_SESSION_ID: 'BREAKOUT_ROOM/SET_SESSION_ID',
65
- // Manual assignment strategy
66
- SET_MANUAL_ASSIGNMENTS: 'BREAKOUT_ROOM/SET_MANUAL_ASSIGNMENTS',
67
- CLEAR_MANUAL_ASSIGNMENTS: 'BREAKOUT_ROOM/CLEAR_MANUAL_ASSIGNMENTS',
68
- // switch room
69
- SET_ALLOW_PEOPLE_TO_SWITCH_ROOM:
70
- 'BREAKOUT_ROOM/SET_ALLOW_PEOPLE_TO_SWITCH_ROOM',
71
- // Group management
72
- SET_GROUPS: 'BREAKOUT_ROOM/SET_GROUPS',
73
- UPDATE_GROUPS_IDS: 'BREAKOUT_ROOM/UPDATE_GROUPS_IDS',
74
- CREATE_GROUP: 'BREAKOUT_ROOM/CREATE_GROUP',
75
- RENAME_GROUP: 'BREAKOUT_ROOM/RENAME_GROUP',
76
- EXIT_GROUP: 'BREAKOUT_ROOM/EXIT_GROUP',
77
- CLOSE_GROUP: 'BREAKOUT_ROOM/CLOSE_GROUP',
78
- CLOSE_ALL_GROUPS: 'BREAKOUT_ROOM/CLOSE_ALL_GROUPS',
79
- // Participants Assignment
80
- UPDATE_UNASSIGNED_PARTICIPANTS:
81
- 'BREAKOUT_ROOM/UPDATE_UNASSIGNED_PARTICIPANTS',
82
- AUTO_ASSIGN_PARTICPANTS: 'BREAKOUT_ROOM/AUTO_ASSIGN_PARTICPANTS',
83
- MANUAL_ASSIGN_PARTICPANTS: 'BREAKOUT_ROOM/MANUAL_ASSIGN_PARTICPANTS',
84
- NO_ASSIGN_PARTICIPANTS: 'BREAKOUT_ROOM/NO_ASSIGN_PARTICIPANTS',
85
- MOVE_PARTICIPANT_TO_MAIN: 'BREAKOUT_ROOM/MOVE_PARTICIPANT_TO_MAIN',
86
- MOVE_PARTICIPANT_TO_GROUP: 'BREAKOUT_ROOM/MOVE_PARTICIPANT_TO_GROUP',
87
- } as const;
88
-
89
- export type BreakoutRoomAction =
90
- | {
91
- type: typeof BreakoutGroupActionTypes.SYNC_STATE;
92
- payload: {
93
- sessionId: BreakoutRoomState['breakoutSessionId'];
94
- switchRoom: BreakoutRoomState['canUserSwitchRoom'];
95
- rooms: BreakoutRoomState['breakoutGroups'];
96
- assignmentStrategy: BreakoutRoomState['assignmentStrategy'];
97
- };
98
- }
99
- | {
100
- type: typeof BreakoutGroupActionTypes.SET_SESSION_ID;
101
- payload: {sessionId: string};
102
- }
103
- | {
104
- type: typeof BreakoutGroupActionTypes.SET_MANUAL_ASSIGNMENTS;
105
- payload: {
106
- assignments: ManualParticipantAssignment[];
107
- };
108
- }
109
- | {
110
- type: typeof BreakoutGroupActionTypes.CLEAR_MANUAL_ASSIGNMENTS;
111
- }
112
- | {
113
- type: typeof BreakoutGroupActionTypes.SET_ALLOW_PEOPLE_TO_SWITCH_ROOM;
114
- payload: {
115
- canUserSwitchRoom: boolean;
116
- };
117
- }
118
- | {
119
- type: typeof BreakoutGroupActionTypes.SET_GROUPS;
120
- payload: BreakoutGroup[];
121
- }
122
- | {
123
- type: typeof BreakoutGroupActionTypes.UPDATE_GROUPS_IDS;
124
- payload: BreakoutGroup[];
125
- }
126
- | {type: typeof BreakoutGroupActionTypes.CREATE_GROUP}
127
- | {
128
- type: typeof BreakoutGroupActionTypes.CLOSE_GROUP;
129
- payload: {
130
- groupId: string;
131
- };
132
- }
133
- | {type: typeof BreakoutGroupActionTypes.CLOSE_ALL_GROUPS}
134
- | {
135
- type: typeof BreakoutGroupActionTypes.RENAME_GROUP;
136
- payload: {
137
- newName: string;
138
- groupId: string;
139
- };
140
- }
141
- | {
142
- type: typeof BreakoutGroupActionTypes.EXIT_GROUP;
143
- payload: {
144
- user: ContentInterface;
145
- fromGroupId: string;
146
- };
147
- }
148
- | {
149
- type: typeof BreakoutGroupActionTypes.UPDATE_UNASSIGNED_PARTICIPANTS;
150
- payload: {
151
- unassignedParticipants: {uid: UidType; user: BreakoutRoomUser}[];
152
- };
153
- }
154
- | {
155
- type: typeof BreakoutGroupActionTypes.AUTO_ASSIGN_PARTICPANTS;
156
- payload: {
157
- localUid: UidType;
158
- };
159
- }
160
- | {
161
- type: typeof BreakoutGroupActionTypes.NO_ASSIGN_PARTICIPANTS;
162
- }
163
- | {
164
- type: typeof BreakoutGroupActionTypes.MANUAL_ASSIGN_PARTICPANTS;
165
- }
166
- | {
167
- type: typeof BreakoutGroupActionTypes.MOVE_PARTICIPANT_TO_MAIN;
168
- payload: {
169
- uid: UidType;
170
- fromGroupId: string;
171
- };
172
- }
173
- | {
174
- type: typeof BreakoutGroupActionTypes.MOVE_PARTICIPANT_TO_GROUP;
175
- payload: {
176
- uid: UidType;
177
- fromGroupId: string;
178
- toGroupId: string;
179
- isHost?: boolean;
180
- };
181
- };
182
-
183
- export const breakoutRoomReducer = (
184
- state: BreakoutRoomState,
185
- action: BreakoutRoomAction,
186
- ): BreakoutRoomState => {
187
- switch (action.type) {
188
- case BreakoutGroupActionTypes.SYNC_STATE: {
189
- return {
190
- ...state,
191
- breakoutSessionId: action.payload.sessionId,
192
- canUserSwitchRoom: action.payload.switchRoom,
193
- assignmentStrategy: action.payload.assignmentStrategy,
194
- breakoutGroups: action.payload.rooms.map(group => ({
195
- id: group.id,
196
- name: group.name,
197
- participants: {
198
- hosts: [...new Set(group?.participants?.hosts ?? [])],
199
- attendees: [...new Set(group?.participants?.attendees ?? [])],
200
- },
201
- })),
202
- };
203
- }
204
- // group management cases
205
- case BreakoutGroupActionTypes.SET_SESSION_ID: {
206
- return {...state, breakoutSessionId: action.payload.sessionId};
207
- }
208
-
209
- case BreakoutGroupActionTypes.SET_GROUPS: {
210
- return {
211
- ...state,
212
- breakoutGroups: action.payload.map(group => ({
213
- ...group,
214
- participants: {
215
- hosts: group.participants?.hosts ?? [],
216
- attendees: group.participants?.attendees ?? [],
217
- },
218
- })),
219
- };
220
- }
221
-
222
- case BreakoutGroupActionTypes.UPDATE_GROUPS_IDS: {
223
- return {
224
- ...state,
225
- breakoutGroups: action.payload.map(group => ({
226
- ...group,
227
- participants: {
228
- hosts: group.participants?.hosts ?? [],
229
- attendees: group.participants?.attendees ?? [],
230
- },
231
- })),
232
- };
233
- }
234
-
235
- case BreakoutGroupActionTypes.UPDATE_UNASSIGNED_PARTICIPANTS: {
236
- return {
237
- ...state,
238
- unassignedParticipants: action.payload.unassignedParticipants || [],
239
- };
240
- }
241
-
242
- case BreakoutGroupActionTypes.SET_MANUAL_ASSIGNMENTS:
243
- return {
244
- ...state,
245
- manualAssignments: action.payload.assignments,
246
- };
247
-
248
- case BreakoutGroupActionTypes.CLEAR_MANUAL_ASSIGNMENTS:
249
- return {
250
- ...state,
251
- manualAssignments: [],
252
- };
253
-
254
- case BreakoutGroupActionTypes.MANUAL_ASSIGN_PARTICPANTS:
255
- // Only applies when strategy is MANUAL
256
- const updatedGroups = state.breakoutGroups.map(group => {
257
- const roomAssignments = state.manualAssignments.filter(
258
- assignment => assignment.roomId === group.id,
259
- );
260
-
261
- const hostsToAdd = roomAssignments
262
- .filter(assignment => assignment.isHost)
263
- .map(assignment => assignment.uid);
264
-
265
- const attendeesToAdd = roomAssignments
266
- .filter(assignment => !assignment.isHost)
267
- .map(assignment => assignment.uid);
268
-
269
- return {
270
- ...group,
271
- participants: {
272
- hosts: [...group.participants.hosts, ...hostsToAdd],
273
- attendees: [...group.participants.attendees, ...attendeesToAdd],
274
- },
275
- };
276
- });
277
-
278
- return {
279
- ...state,
280
- assignmentStrategy: RoomAssignmentStrategy.MANUAL_ASSIGN, // Update strategy
281
- breakoutGroups: updatedGroups,
282
- manualAssignments: [], // Clear after applying
283
- };
284
-
285
- case BreakoutGroupActionTypes.SET_ALLOW_PEOPLE_TO_SWITCH_ROOM: {
286
- return {
287
- ...state,
288
- canUserSwitchRoom: action.payload.canUserSwitchRoom,
289
- };
290
- }
291
-
292
- case BreakoutGroupActionTypes.NO_ASSIGN_PARTICIPANTS: {
293
- return {
294
- ...state,
295
- assignmentStrategy: RoomAssignmentStrategy.NO_ASSIGN, // Update strategy
296
- canUserSwitchRoom: true,
297
- };
298
- }
299
-
300
- case BreakoutGroupActionTypes.AUTO_ASSIGN_PARTICPANTS: {
301
- const roomAssignments = new Map<
302
- string,
303
- {hosts: UidType[]; attendees: UidType[]}
304
- >();
305
-
306
- // Initialize with existing participants for each room
307
- state.breakoutGroups.forEach(room => {
308
- roomAssignments.set(room.id, {
309
- hosts: [...room.participants.hosts],
310
- attendees: [...room.participants.attendees],
311
- });
312
- });
313
-
314
- let assignedParticipantUids: UidType[] = [];
315
- // AUTO ASSIGN Simple round-robin assignment (no capacity limits)
316
- // Exclude local user from auto assignment
317
- const participantsToAssign = state.unassignedParticipants.filter(
318
- participant => participant.uid !== action.payload.localUid,
319
- );
320
-
321
- let roomIndex = 0;
322
- const roomIds = state.breakoutGroups.map(room => room.id);
323
- participantsToAssign.forEach(participant => {
324
- const currentRoomId = roomIds[roomIndex];
325
- const roomAssignment = roomAssignments.get(currentRoomId)!;
326
- // Assign participant based on their isHost status (string "true"/"false")
327
- if (participant.user?.isHost) {
328
- roomAssignment.hosts.push(participant.uid);
329
- } else {
330
- roomAssignment.attendees.push(participant.uid);
331
- }
332
- // Move it to assigned list
333
- assignedParticipantUids.push(participant.uid);
334
- // Move to next room for round-robin
335
- roomIndex = (roomIndex + 1) % roomIds.length;
336
- });
337
-
338
- // Update breakoutGroups with new assignments
339
- const updatedBreakoutGroups = state.breakoutGroups.map(group => {
340
- const roomParticipants = roomAssignments.get(group.id) || {
341
- hosts: [],
342
- attendees: [],
343
- };
344
- return {
345
- ...group,
346
- participants: {
347
- hosts: roomParticipants.hosts,
348
- attendees: roomParticipants.attendees,
349
- },
350
- };
351
- });
352
-
353
- // Remove assigned participants from unassignedParticipants
354
- const updatedUnassignedParticipants = state.unassignedParticipants.filter(
355
- participant => !assignedParticipantUids.includes(participant.uid),
356
- );
357
-
358
- return {
359
- ...state,
360
- unassignedParticipants: updatedUnassignedParticipants,
361
- assignmentStrategy: RoomAssignmentStrategy.AUTO_ASSIGN,
362
- breakoutGroups: updatedBreakoutGroups,
363
- };
364
- }
365
-
366
- case BreakoutGroupActionTypes.CREATE_GROUP: {
367
- // Find the next available room number
368
- const existingRoomNumbers = state.breakoutGroups
369
- .map(room => {
370
- const match = room.name.match(/^Room (\d+)$/);
371
- return match ? parseInt(match[1], 10) : 0;
372
- })
373
- .filter(num => num > 0);
374
-
375
- const nextRoomNumber =
376
- existingRoomNumbers.length === 0
377
- ? 1
378
- : Math.max(...existingRoomNumbers) + 1;
379
-
380
- return {
381
- ...state,
382
- breakoutGroups: [
383
- ...state.breakoutGroups,
384
- {
385
- name: `Room ${nextRoomNumber}`,
386
- id: `temp_${randomNameGenerator(6)}`,
387
- participants: {hosts: [], attendees: []},
388
- },
389
- ],
390
- };
391
- }
392
-
393
- case BreakoutGroupActionTypes.EXIT_GROUP: {
394
- // Same logic as MOVE_PARTICIPANT_TO_MAIN but more explicit
395
- const {user, fromGroupId} = action.payload;
396
- return {
397
- ...state,
398
- breakoutGroups: state.breakoutGroups.map(group => {
399
- if (group.id === fromGroupId) {
400
- return {
401
- ...group,
402
- participants: {
403
- hosts: group.participants.hosts.filter(uid => uid !== user.uid),
404
- attendees: group.participants.attendees.filter(
405
- uid => uid !== user.uid,
406
- ),
407
- },
408
- };
409
- }
410
- return group;
411
- }),
412
- };
413
- }
414
-
415
- case BreakoutGroupActionTypes.CLOSE_GROUP: {
416
- const {groupId} = action.payload;
417
- return {
418
- ...state,
419
- breakoutGroups: state.breakoutGroups.filter(
420
- room => room.id !== groupId,
421
- ),
422
- };
423
- }
424
-
425
- case BreakoutGroupActionTypes.CLOSE_ALL_GROUPS: {
426
- return {
427
- ...state,
428
- breakoutGroups: [],
429
- };
430
- }
431
-
432
- case BreakoutGroupActionTypes.RENAME_GROUP: {
433
- const {groupId, newName} = action.payload;
434
- return {
435
- ...state,
436
- breakoutGroups: state.breakoutGroups.map(group =>
437
- group.id === groupId ? {...group, name: newName} : group,
438
- ),
439
- };
440
- }
441
-
442
- case BreakoutGroupActionTypes.MOVE_PARTICIPANT_TO_MAIN: {
443
- const {uid, fromGroupId} = action.payload;
444
- return {
445
- ...state,
446
- breakoutGroups: state.breakoutGroups.map(group => {
447
- // Remove participant from their current breakout group
448
- if (fromGroupId && group.id === fromGroupId) {
449
- return {
450
- ...group,
451
- participants: {
452
- ...group.participants,
453
- hosts: group.participants.hosts.filter(id => id !== uid),
454
- attendees: group.participants.attendees.filter(
455
- id => id !== uid,
456
- ),
457
- },
458
- };
459
- }
460
- return group;
461
- }),
462
- };
463
- }
464
-
465
- case BreakoutGroupActionTypes.MOVE_PARTICIPANT_TO_GROUP: {
466
- const {uid, fromGroupId, toGroupId, isHost} = action.payload;
467
-
468
- // Determine if user should be added as host or attendee
469
- let shouldBeHost = false;
470
-
471
- if (isHost !== undefined) {
472
- // Use explicit isHost flag if provided (from mainRoomRTMUsers for main room users)
473
- shouldBeHost = isHost;
474
- } else if (fromGroupId) {
475
- // Fallback: check their role in the previous breakout group
476
- const sourceGroup = state.breakoutGroups.find(
477
- group => group.id === fromGroupId,
478
- );
479
- shouldBeHost = sourceGroup?.participants.hosts.includes(uid) || false;
480
- }
481
- // If isHost is undefined and no fromGroupId, default to attendee
482
-
483
- return {
484
- ...state,
485
- breakoutGroups: state.breakoutGroups.map(group => {
486
- // Remove from source group (if fromGroupId exists)
487
- if (fromGroupId && group.id === fromGroupId) {
488
- return {
489
- ...group,
490
- participants: {
491
- ...group.participants,
492
- hosts: group.participants.hosts.filter(id => id !== uid),
493
- attendees: group.participants.attendees.filter(
494
- id => id !== uid,
495
- ),
496
- },
497
- };
498
- }
499
- // Add to target group with determined role
500
- if (group.id === toGroupId) {
501
- return {
502
- ...group,
503
- participants: {
504
- ...group.participants,
505
- hosts: shouldBeHost
506
- ? [...group.participants.hosts, uid]
507
- : group.participants.hosts,
508
- attendees: !shouldBeHost
509
- ? [...group.participants.attendees, uid]
510
- : group.participants.attendees,
511
- },
512
- };
513
- }
514
- return group;
515
- }),
516
- };
517
- }
518
-
519
- default:
520
- return state;
521
- }
522
- };
@@ -1,54 +0,0 @@
1
- import {BreakoutGroup, RoomAssignmentStrategy} from './reducer';
2
-
3
- export type BreakoutGroupAssignStrategy = 'auto' | 'manual' | 'self-select';
4
-
5
- export interface AssignOption {
6
- label: string;
7
- value: BreakoutGroupAssignStrategy;
8
- description: string;
9
- }
10
-
11
- export interface BreakoutChannelJoinEventPayload {
12
- data: {
13
- data: {
14
- room_id: number;
15
- room_name: string;
16
- channel_name: string;
17
- mainUser: {
18
- rtc: string;
19
- uid: number;
20
- rtm: string;
21
- };
22
- screenShare: {
23
- rtc: string;
24
- uid: number;
25
- };
26
- chat: {
27
- isGroupOwner: boolean;
28
- groupId: string;
29
- userToken: string;
30
- };
31
- };
32
- act: 'CHAN_JOIN'; // e.g., "CHAN_JOIN"
33
- srcuid: number;
34
- };
35
- }
36
-
37
- export interface BreakoutRoomSyncStateEventPayload {
38
- data: {
39
- data: {
40
- switch_room: boolean;
41
- session_id: string;
42
- assignment_type: RoomAssignmentStrategy;
43
- breakout_room: BreakoutGroup[];
44
- sts: number;
45
- };
46
- act: 'SYNC_STATE';
47
- srcuid: number;
48
- };
49
- }
50
- export interface BreakoutRoomAnnouncementEventPayload {
51
- uid: string;
52
- timestamp: string;
53
- announcement: string;
54
- }
@@ -1,60 +0,0 @@
1
- /*
2
- ********************************************
3
- Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the "Materials") are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.'s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
10
- *********************************************
11
- */
12
-
13
- import React from 'react';
14
- import {View, Text, StyleSheet} from 'react-native';
15
- import BreakoutRoomNameRenderer from '../hoc/BreakoutRoomNameRenderer';
16
- import ImageIcon from '../../../atoms/ImageIcon';
17
- import ThemeConfig from '../../../theme';
18
- import {trimText} from '../../../utils/common';
19
-
20
- const BreakoutMeetingTitle: React.FC = () => {
21
- return (
22
- <BreakoutRoomNameRenderer>
23
- {({breakoutRoomName}) =>
24
- trimText(breakoutRoomName) ? (
25
- <View style={styles.breakoutRoomNameView}>
26
- <ImageIcon
27
- iconType="plain"
28
- name={'open-room'}
29
- iconSize={12}
30
- tintColor={$config.SECONDARY_ACTION_COLOR}
31
- />
32
- <Text
33
- style={styles.breakoutRoomNameText}
34
- numberOfLines={1}
35
- ellipsizeMode="tail">
36
- {trimText(breakoutRoomName)}
37
- </Text>
38
- </View>
39
- ) : null
40
- }
41
- </BreakoutRoomNameRenderer>
42
- );
43
- };
44
-
45
- const styles = StyleSheet.create({
46
- breakoutRoomNameView: {
47
- display: 'flex',
48
- flexDirection: 'row',
49
- alignItems: 'center',
50
- fontFamily: ThemeConfig.FontFamily.sansPro,
51
- },
52
- breakoutRoomNameText: {
53
- fontSize: ThemeConfig.FontSize.tiny,
54
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.medium,
55
- fontWeight: '600',
56
- fontFamily: ThemeConfig.FontFamily.sansPro,
57
- },
58
- });
59
-
60
- export default BreakoutMeetingTitle;