agora-appbuilder-core 4.1.9 → 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.
- package/package.json +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +1 -3
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +1 -2
- package/template/agora-rn-uikit/src/Reducer/index.ts +0 -2
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +11 -25
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +1 -14
- package/template/agora-rn-uikit/src/Utils/isBotUser.ts +1 -1
- package/template/android/app/build.gradle +0 -7
- package/template/bridge/rtm/web/Types.ts +0 -183
- package/template/bridge/rtm/web/index.ts +491 -423
- package/template/defaultConfig.js +3 -3
- package/template/ios/Podfile +0 -41
- package/template/package.json +5 -5
- package/template/src/assets/font-styles.css +4 -0
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/ActionMenu.tsx +93 -13
- package/template/src/atoms/CustomIcon.tsx +1 -0
- package/template/src/atoms/DropDownMulti.tsx +80 -29
- package/template/src/atoms/Input.tsx +2 -1
- package/template/src/components/Controls.tsx +148 -143
- package/template/src/components/EventsConfigure.tsx +152 -97
- package/template/src/components/RTMConfigure.tsx +426 -644
- package/template/src/components/precall/joinCallBtn.native.tsx +7 -2
- package/template/src/components/precall/joinCallBtn.tsx +7 -2
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +8 -3
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +22 -4
- package/template/src/components/precall/textInput.tsx +45 -22
- package/template/src/components/precall/usePreCall.tsx +7 -0
- package/template/src/components/room-info/useRoomInfo.tsx +5 -0
- package/template/src/language/default-labels/videoCallScreenLabels.ts +27 -4
- package/template/src/pages/video-call/ActionSheetContent.tsx +77 -77
- package/template/src/pages/video-call/SidePanelHeader.tsx +81 -36
- package/template/src/rtm/RTMEngine.ts +33 -130
- package/template/src/rtm-events/constants.ts +6 -0
- package/template/src/rtm-events-api/Events.ts +30 -106
- package/template/src/subComponents/caption/Caption.tsx +48 -7
- package/template/src/subComponents/caption/CaptionContainer.tsx +324 -51
- package/template/src/subComponents/caption/CaptionIcon.tsx +35 -34
- package/template/src/subComponents/caption/CaptionText.tsx +103 -2
- package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +179 -69
- package/template/src/subComponents/caption/Transcript.tsx +46 -11
- package/template/src/subComponents/caption/TranscriptIcon.tsx +27 -35
- package/template/src/subComponents/caption/TranscriptText.tsx +78 -3
- package/template/src/subComponents/caption/proto/ptoto.js +38 -4
- package/template/src/subComponents/caption/proto/test.proto +34 -19
- package/template/src/subComponents/caption/useCaption.tsx +753 -10
- package/template/src/subComponents/caption/useSTTAPI.tsx +118 -205
- package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +152 -33
- package/template/src/subComponents/caption/useStreamMessageUtils.ts +165 -34
- package/template/src/subComponents/caption/utils.ts +171 -3
- package/template/src/utils/SdkEvents.ts +3 -0
- package/template/src/utils/useEndCall.ts +3 -5
- package/template/src/utils/useSpeechToText.ts +31 -20
- package/template/agora-rn-uikit/src/Reducer/Spotlight.ts +0 -11
- package/template/agora-rn-uikit/src/Reducer/UserBanned.ts +0 -11
- package/template/bridge/rtm/web/index-legacy.ts +0 -540
- package/template/src/components/RTMConfigure-legacy.tsx +0 -848
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agora-appbuilder-core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.11-beta.2",
|
|
4
4
|
"description": "React Native template for RTE app builder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"vercel-build": "npm run dev-setup && cd template && npm run web:build && cd .. && npm run copy-vercel",
|
|
12
|
-
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/appbuilder-ui-kit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout appbuilder-uikit-3.1.
|
|
12
|
+
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/appbuilder-ui-kit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout appbuilder-uikit-3.1.11",
|
|
13
13
|
"deps": "cd template && npm i --force",
|
|
14
14
|
"dev-setup": "npm run uikit && npm run deps && node devSetup.js",
|
|
15
15
|
"web-build": "cd template && npm run web:build && cd .. && npm run copy-vercel",
|
|
@@ -142,7 +142,7 @@ export interface RtcPropsInterface {
|
|
|
142
142
|
callActive?: boolean;
|
|
143
143
|
encryption?: {
|
|
144
144
|
key: string;
|
|
145
|
-
mode: EncryptionMode.
|
|
145
|
+
mode: EncryptionMode.Aes128Gcm2 | EncryptionMode.Aes256Gcm2;
|
|
146
146
|
salt: number[];
|
|
147
147
|
};
|
|
148
148
|
// commented for v1 release
|
|
@@ -185,10 +185,8 @@ export interface CallbacksInterface {
|
|
|
185
185
|
AddCustomContent(uid: UidType, data: any): void;
|
|
186
186
|
RemoveCustomContent(uid: UidType): void;
|
|
187
187
|
UserPin(Uid: UidType): void;
|
|
188
|
-
Spotlight(Uid: UidType): void;
|
|
189
188
|
UserSecondaryPin(Uid: UidType): void;
|
|
190
189
|
ActiveSpeaker(Uid: UidType): void;
|
|
191
|
-
UserBanned(isBanned: boolean): void;
|
|
192
190
|
}
|
|
193
191
|
|
|
194
192
|
export type CustomCallbacksInterface = CallbacksInterface;
|
|
@@ -33,8 +33,6 @@ export interface ContentStateInterface {
|
|
|
33
33
|
pinnedUid?: UidType;
|
|
34
34
|
secondaryPinnedUid?: UidType;
|
|
35
35
|
lastJoinedUid?: UidType;
|
|
36
|
-
spotlightUid?: UidType;
|
|
37
|
-
isUserBaned?: boolean;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
export interface ActionInterface<T extends keyof CallbacksInterface> {
|
|
@@ -47,6 +45,7 @@ export type ActionType<T extends keyof CallbacksInterface> = ActionInterface<T>;
|
|
|
47
45
|
export interface RtcContextInterface {
|
|
48
46
|
RtcEngineUnsafe: IRtcEngine;
|
|
49
47
|
setDualStreamMode: React.Dispatch<React.SetStateAction<DualStreamMode>>;
|
|
48
|
+
rtcTracksReady: boolean;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
const RtcContext = React.createContext<RtcContextInterface>(
|
|
@@ -11,5 +11,3 @@ export {default as RemoteVideoStateChanged} from './RemoteVideoStateChanged';
|
|
|
11
11
|
export {default as UserPin} from './UserPin';
|
|
12
12
|
export {default as UserSecondaryPin} from './UserSecondaryPin';
|
|
13
13
|
export {default as ActiveSpeaker} from './ActiveSpeaker';
|
|
14
|
-
export {default as Spotlight} from './Spotlight';
|
|
15
|
-
export {default as UserBanned} from './UserBanned';
|
|
@@ -51,27 +51,18 @@ const Join: React.FC<{
|
|
|
51
51
|
const videoState = defaultContent[maxUid]?.video;
|
|
52
52
|
async function join() {
|
|
53
53
|
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
rtcProps
|
|
57
|
-
|
|
54
|
+
rtcProps?.encryption &&
|
|
55
|
+
rtcProps?.encryption.key &&
|
|
56
|
+
rtcProps.encryption.mode &&
|
|
57
|
+
rtcProps.encryption.salt
|
|
58
58
|
) {
|
|
59
59
|
try {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
rtcProps?.encryption
|
|
63
|
-
|
|
64
|
-
const encryptionConfig = {
|
|
65
|
-
encryptionKey: rtcProps?.encryption?.key,
|
|
66
|
-
encryptionMode: rtcProps?.encryption?.mode,
|
|
60
|
+
await engine.enableEncryption(true, {
|
|
61
|
+
encryptionKey: rtcProps?.encryption.key,
|
|
62
|
+
encryptionMode: rtcProps?.encryption.mode,
|
|
63
|
+
encryptionKdfSalt: rtcProps?.encryption.salt,
|
|
67
64
|
datastreamEncryptionEnabled: true,
|
|
68
|
-
|
|
69
|
-
? {}
|
|
70
|
-
: {
|
|
71
|
-
encryptionKdfSalt: rtcProps?.encryption?.salt,
|
|
72
|
-
}),
|
|
73
|
-
};
|
|
74
|
-
await engine.enableEncryption(true, encryptionConfig);
|
|
65
|
+
});
|
|
75
66
|
} catch (error) {
|
|
76
67
|
console.warn('encryption error', error);
|
|
77
68
|
}
|
|
@@ -106,13 +97,8 @@ const Join: React.FC<{
|
|
|
106
97
|
rtcProps?.uid || 0,
|
|
107
98
|
{},
|
|
108
99
|
);
|
|
109
|
-
} catch (error
|
|
110
|
-
console.error('RTC joinChannel error
|
|
111
|
-
if (
|
|
112
|
-
error?.code === 'UID_BANNED' ||
|
|
113
|
-
error?.message?.includes('UID_BANNED')
|
|
114
|
-
)
|
|
115
|
-
dispatch({type: 'UserBanned', value: [true]});
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error('RTC joinChannel error', error);
|
|
116
102
|
}
|
|
117
103
|
if (
|
|
118
104
|
!audioRoom &&
|
|
@@ -32,8 +32,6 @@ import {
|
|
|
32
32
|
UserPin,
|
|
33
33
|
UserSecondaryPin,
|
|
34
34
|
ActiveSpeaker,
|
|
35
|
-
Spotlight,
|
|
36
|
-
UserBanned,
|
|
37
35
|
} from './Reducer';
|
|
38
36
|
import Create from './Rtc/Create';
|
|
39
37
|
import Join from './Rtc/Join';
|
|
@@ -262,16 +260,6 @@ const RtcConfigure = (outerProps: {children: React.ReactNode}) => {
|
|
|
262
260
|
stateUpdate = ActiveSpeaker(state, action);
|
|
263
261
|
}
|
|
264
262
|
break;
|
|
265
|
-
case 'Spotlight':
|
|
266
|
-
if (actionTypeGuard(action, action.type)) {
|
|
267
|
-
stateUpdate = Spotlight(state, action);
|
|
268
|
-
}
|
|
269
|
-
break;
|
|
270
|
-
case 'UserBanned':
|
|
271
|
-
if (actionTypeGuard(action, action.type)) {
|
|
272
|
-
stateUpdate = UserBanned(state, action);
|
|
273
|
-
}
|
|
274
|
-
break;
|
|
275
263
|
}
|
|
276
264
|
|
|
277
265
|
// TODO: remove Handle event listeners
|
|
@@ -437,6 +425,7 @@ const RtcConfigure = (outerProps: {children: React.ReactNode}) => {
|
|
|
437
425
|
value={{
|
|
438
426
|
RtcEngineUnsafe: engineRef.current,
|
|
439
427
|
setDualStreamMode,
|
|
428
|
+
rtcTracksReady: tracksReady,
|
|
440
429
|
}}>
|
|
441
430
|
<ContentProvider
|
|
442
431
|
value={{
|
|
@@ -471,8 +460,6 @@ const RtcConfigure = (outerProps: {children: React.ReactNode}) => {
|
|
|
471
460
|
? uidState.secondaryPinnedUid
|
|
472
461
|
: undefined,
|
|
473
462
|
lastJoinedUid: uidState.lastJoinedUid,
|
|
474
|
-
spotlightUid: uidState.spotlightUid,
|
|
475
|
-
isUserBaned: uidState.isUserBaned,
|
|
476
463
|
}}>
|
|
477
464
|
{outerProps.children}
|
|
478
465
|
</ContentProvider>
|
|
@@ -101,13 +101,6 @@ android {
|
|
|
101
101
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
packagingOptions {
|
|
106
|
-
pickFirst '**/lib/arm64-v8a/libaosl.so'
|
|
107
|
-
pickFirst '**/lib/armeabi-v7a/libaosl.so'
|
|
108
|
-
pickFirst '**/lib/x86/libaosl.so'
|
|
109
|
-
pickFirst '**/lib/x86_64/libaosl.so'
|
|
110
|
-
}
|
|
111
104
|
}
|
|
112
105
|
|
|
113
106
|
dependencies {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {ChannelType as WebChannelType} from 'agora-rtm-sdk';
|
|
2
|
-
|
|
3
1
|
export interface AttributesMap {
|
|
4
2
|
[key: string]: string;
|
|
5
3
|
}
|
|
@@ -13,184 +11,3 @@ export interface ChannelAttributeOptions {
|
|
|
13
11
|
*/
|
|
14
12
|
enableNotificationToChannelMembers?: undefined | false | true;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
// LINK STATE
|
|
18
|
-
export const nativeLinkStateMapping = {
|
|
19
|
-
IDLE: 0,
|
|
20
|
-
CONNECTING: 1,
|
|
21
|
-
CONNECTED: 2,
|
|
22
|
-
DISCONNECTED: 3,
|
|
23
|
-
SUSPENDED: 4,
|
|
24
|
-
FAILED: 5,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Create reverse mapping: number -> string
|
|
28
|
-
export const webLinkStateMapping = Object.fromEntries(
|
|
29
|
-
Object.entries(nativeLinkStateMapping).map(([key, value]) => [value, key]),
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export const linkStatusReasonCodeMapping: {[key: string]: number} = {
|
|
33
|
-
UNKNOWN: 0,
|
|
34
|
-
LOGIN: 1,
|
|
35
|
-
LOGIN_SUCCESS: 2,
|
|
36
|
-
LOGIN_TIMEOUT: 3,
|
|
37
|
-
LOGIN_NOT_AUTHORIZED: 4,
|
|
38
|
-
LOGIN_REJECTED: 5,
|
|
39
|
-
RELOGIN: 6,
|
|
40
|
-
LOGOUT: 7,
|
|
41
|
-
AUTO_RECONNECT: 8,
|
|
42
|
-
RECONNECT_TIMEOUT: 9,
|
|
43
|
-
RECONNECT_SUCCESS: 10,
|
|
44
|
-
JOIN: 11,
|
|
45
|
-
JOIN_SUCCESS: 12,
|
|
46
|
-
JOIN_FAILED: 13,
|
|
47
|
-
REJOIN: 14,
|
|
48
|
-
LEAVE: 15,
|
|
49
|
-
INVALID_TOKEN: 16,
|
|
50
|
-
TOKEN_EXPIRED: 17,
|
|
51
|
-
INCONSISTENT_APP_ID: 18,
|
|
52
|
-
INVALID_CHANNEL_NAME: 19,
|
|
53
|
-
INVALID_USER_ID: 20,
|
|
54
|
-
NOT_INITIALIZED: 21,
|
|
55
|
-
RTM_SERVICE_NOT_CONNECTED: 22,
|
|
56
|
-
CHANNEL_INSTANCE_EXCEED_LIMITATION: 23,
|
|
57
|
-
OPERATION_RATE_EXCEED_LIMITATION: 24,
|
|
58
|
-
CHANNEL_IN_ERROR_STATE: 25,
|
|
59
|
-
PRESENCE_NOT_CONNECTED: 26,
|
|
60
|
-
SAME_UID_LOGIN: 27,
|
|
61
|
-
KICKED_OUT_BY_SERVER: 28,
|
|
62
|
-
KEEP_ALIVE_TIMEOUT: 29,
|
|
63
|
-
CONNECTION_ERROR: 30,
|
|
64
|
-
PRESENCE_NOT_READY: 31,
|
|
65
|
-
NETWORK_CHANGE: 32,
|
|
66
|
-
SERVICE_NOT_SUPPORTED: 33,
|
|
67
|
-
STREAM_CHANNEL_NOT_AVAILABLE: 34,
|
|
68
|
-
STORAGE_NOT_AVAILABLE: 35,
|
|
69
|
-
LOCK_NOT_AVAILABLE: 36,
|
|
70
|
-
LOGIN_TOO_FREQUENT: 37,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// CHANNEL TYPE
|
|
74
|
-
// string -> number
|
|
75
|
-
export const nativeChannelTypeMapping = {
|
|
76
|
-
NONE: 0,
|
|
77
|
-
MESSAGE: 1,
|
|
78
|
-
STREAM: 2,
|
|
79
|
-
USER: 3,
|
|
80
|
-
};
|
|
81
|
-
// number -> string
|
|
82
|
-
export const webChannelTypeMapping = Object.fromEntries(
|
|
83
|
-
Object.entries(nativeChannelTypeMapping).map(([key, value]) => [value, key]),
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
// STORAGE TYPE
|
|
87
|
-
// string -> number
|
|
88
|
-
export const nativeStorageTypeMapping = {
|
|
89
|
-
NONE: 0,
|
|
90
|
-
/**
|
|
91
|
-
* 1: The user storage event.
|
|
92
|
-
*/
|
|
93
|
-
USER: 1,
|
|
94
|
-
/**
|
|
95
|
-
* 2: The channel storage event.
|
|
96
|
-
*/
|
|
97
|
-
CHANNEL: 2,
|
|
98
|
-
};
|
|
99
|
-
// number -> string
|
|
100
|
-
export const webStorageTypeMapping = Object.fromEntries(
|
|
101
|
-
Object.entries(nativeStorageTypeMapping).map(([key, value]) => [value, key]),
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
// STORAGE EVENT TYPE
|
|
105
|
-
export const nativeStorageEventTypeMapping = {
|
|
106
|
-
/**
|
|
107
|
-
* 0: Unknown event type.
|
|
108
|
-
*/
|
|
109
|
-
NONE: 0,
|
|
110
|
-
/**
|
|
111
|
-
* 1: Triggered when user subscribe user metadata state or join channel with options.withMetadata = true
|
|
112
|
-
*/
|
|
113
|
-
SNAPSHOT: 1,
|
|
114
|
-
/**
|
|
115
|
-
* 2: Triggered when a remote user set metadata
|
|
116
|
-
*/
|
|
117
|
-
SET: 2,
|
|
118
|
-
/**
|
|
119
|
-
* 3: Triggered when a remote user update metadata
|
|
120
|
-
*/
|
|
121
|
-
UPDATE: 3,
|
|
122
|
-
/**
|
|
123
|
-
* 4: Triggered when a remote user remove metadata
|
|
124
|
-
*/
|
|
125
|
-
REMOVE: 4,
|
|
126
|
-
};
|
|
127
|
-
// number -> string
|
|
128
|
-
export const webStorageEventTypeMapping = Object.fromEntries(
|
|
129
|
-
Object.entries(nativeStorageEventTypeMapping).map(([key, value]) => [
|
|
130
|
-
value,
|
|
131
|
-
key,
|
|
132
|
-
]),
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
// PRESENCE EVENT TYPE
|
|
136
|
-
export const nativePresenceEventTypeMapping = {
|
|
137
|
-
/**
|
|
138
|
-
* 0: Unknown event type
|
|
139
|
-
*/
|
|
140
|
-
NONE: 0,
|
|
141
|
-
/**
|
|
142
|
-
* 1: The presence snapshot of this channel
|
|
143
|
-
*/
|
|
144
|
-
SNAPSHOT: 1,
|
|
145
|
-
/**
|
|
146
|
-
* 2: The presence event triggered in interval mode
|
|
147
|
-
*/
|
|
148
|
-
INTERVAL: 2,
|
|
149
|
-
/**
|
|
150
|
-
* 3: Triggered when remote user join channel
|
|
151
|
-
*/
|
|
152
|
-
REMOTE_JOIN: 3,
|
|
153
|
-
/**
|
|
154
|
-
* 4: Triggered when remote user leave channel
|
|
155
|
-
*/
|
|
156
|
-
REMOTE_LEAVE: 4,
|
|
157
|
-
/**
|
|
158
|
-
* 5: Triggered when remote user's connection timeout
|
|
159
|
-
*/
|
|
160
|
-
REMOTE_TIMEOUT: 5,
|
|
161
|
-
/**
|
|
162
|
-
* 6: Triggered when user changed state
|
|
163
|
-
*/
|
|
164
|
-
REMOTE_STATE_CHANGED: 6,
|
|
165
|
-
/**
|
|
166
|
-
* 7: Triggered when user joined channel without presence service
|
|
167
|
-
*/
|
|
168
|
-
ERROR_OUT_OF_SERVICE: 7,
|
|
169
|
-
};
|
|
170
|
-
// number -> string
|
|
171
|
-
export const webPresenceEventTypeMapping = Object.fromEntries(
|
|
172
|
-
Object.entries(nativePresenceEventTypeMapping).map(([key, value]) => [
|
|
173
|
-
value,
|
|
174
|
-
key,
|
|
175
|
-
]),
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
// MESSAGE EVENT TYPE
|
|
179
|
-
// string -> number
|
|
180
|
-
export const nativeMessageEventTypeMapping = {
|
|
181
|
-
/**
|
|
182
|
-
* 0: The binary message.
|
|
183
|
-
*/
|
|
184
|
-
BINARY: 0,
|
|
185
|
-
/**
|
|
186
|
-
* 1: The ascii message.
|
|
187
|
-
*/
|
|
188
|
-
STRING: 1,
|
|
189
|
-
};
|
|
190
|
-
// number -> string
|
|
191
|
-
export const webMessageEventTypeMapping = Object.fromEntries(
|
|
192
|
-
Object.entries(nativePresenceEventTypeMapping).map(([key, value]) => [
|
|
193
|
-
value,
|
|
194
|
-
key,
|
|
195
|
-
]),
|
|
196
|
-
);
|