agora-appbuilder-core 4.1.8-1 → 4.1.8-3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.1.8-1",
3
+ "version": "4.1.8-3",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -77,8 +77,8 @@ const DefaultConfig = {
77
77
  CHAT_ORG_NAME: '',
78
78
  CHAT_APP_NAME: '',
79
79
  CHAT_URL: '',
80
- CLI_VERSION: '3.1.8-1',
81
- CORE_VERSION: '4.1.8-1',
80
+ CLI_VERSION: '3.1.8-3',
81
+ CORE_VERSION: '4.1.8-3',
82
82
  DISABLE_LANDSCAPE_MODE: false,
83
83
  STT_AUTO_START: false,
84
84
  CLOUD_RECORDING_AUTO_START: false,
@@ -17,6 +17,9 @@ import hexadecimalTransparency from '../utils/hexadecimalTransparency';
17
17
 
18
18
  interface TextInputCustomProps extends TextInputProps {
19
19
  setRef?: (ref: any) => void;
20
+ onCompositionStart?: () => void;
21
+ onCompositionEnd?: () => void;
22
+ onInput?: (event: any) => void;
20
23
  }
21
24
 
22
25
  const TextInputCustom = (props: TextInputCustomProps) => {
@@ -97,6 +97,10 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
97
97
  replyToMsgId,
98
98
  setReplyToMsgId,
99
99
  } = useChatUIControls();
100
+
101
+ // Track IME composition state
102
+ const [isComposing, setIsComposing] = React.useState(false);
103
+
100
104
  const {defaultContent} = useContent();
101
105
  const {sendChatSDKMessage, uploadAttachment} = useChatConfigure();
102
106
  const {addMessageToPrivateStore, addMessageToStore} = useChatMessages();
@@ -115,6 +119,41 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
115
119
  });
116
120
  }, []);
117
121
 
122
+ // Set up direct DOM event listeners for IME composition
123
+ useEffect(() => {
124
+ if (!isWeb()) return;
125
+
126
+ const inputElement = chatInputRef?.current;
127
+ if (!inputElement) return;
128
+
129
+ // Get the actual DOM element (React Native Web creates a textarea/input)
130
+ const domElement = inputElement._nativeTag
131
+ ? document.querySelector(`[data-tag="${inputElement._nativeTag}"]`)
132
+ : inputElement;
133
+
134
+ if (!domElement) return;
135
+
136
+ const handleCompositionStart = () => {
137
+ setIsComposing(true);
138
+ };
139
+
140
+ const handleCompositionEnd = () => {
141
+ setIsComposing(false);
142
+ };
143
+
144
+ // Add event listeners directly to DOM element
145
+ domElement.addEventListener('compositionstart', handleCompositionStart);
146
+ domElement.addEventListener('compositionend', handleCompositionEnd);
147
+
148
+ return () => {
149
+ domElement.removeEventListener(
150
+ 'compositionstart',
151
+ handleCompositionStart,
152
+ );
153
+ domElement.removeEventListener('compositionend', handleCompositionEnd);
154
+ };
155
+ }, [chatInputRef?.current]);
156
+
118
157
  const {data} = useRoomInfo();
119
158
  const [name] = useUserName();
120
159
  const toastHeadingSize = useString(chatSendErrorTextSizeToastHeading)();
@@ -166,9 +205,37 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
166
205
  });
167
206
  };
168
207
 
208
+ // IME composition handlers
209
+ const handleCompositionStart = () => {
210
+ setIsComposing(true);
211
+ };
212
+
213
+ const handleCompositionEnd = () => {
214
+ setIsComposing(false);
215
+ };
216
+
217
+ const handleInput = event => {
218
+ // Reset composition state if input event occurs without active composition
219
+ if (isWeb() && !event.nativeEvent.isComposing && isComposing) {
220
+ setIsComposing(false);
221
+ }
222
+ };
223
+
169
224
  // with multiline textinput enter prints /n
170
225
  const handleKeyPress = ({nativeEvent}) => {
171
- if (nativeEvent.key === 'Enter' && !nativeEvent.shiftKey) {
226
+ const currentlyComposing = nativeEvent.isComposing || isComposing;
227
+
228
+ // Check if this is an Enter key during composition
229
+ if (nativeEvent.key === 'Enter' && currentlyComposing) {
230
+ return;
231
+ }
232
+
233
+ // Only submit on Enter if not composing with IME and no Shift key
234
+ if (
235
+ nativeEvent.key === 'Enter' &&
236
+ !nativeEvent.shiftKey &&
237
+ !currentlyComposing
238
+ ) {
172
239
  nativeEvent.preventDefault();
173
240
  onSubmitEditing();
174
241
  setShowEmojiPicker(false); // This will close emoji picker on enter
@@ -225,6 +292,10 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
225
292
  autoCorrect={false}
226
293
  onKeyPress={handleKeyPress}
227
294
  onChange={_handleHeightChange}
295
+ // IME composition event handlers for React Native Web
296
+ onCompositionStart={isWeb() ? handleCompositionStart : undefined}
297
+ onCompositionEnd={isWeb() ? handleCompositionEnd : undefined}
298
+ onInput={isWeb() ? handleInput : undefined}
228
299
  />
229
300
  );
230
301
 
@@ -121,7 +121,7 @@ const useSTTAPI = (): IuseSTTAPI => {
121
121
  const start = async (lang: LanguageType[]) => {
122
122
  try {
123
123
  setIsLangChangeInProgress(true);
124
- const res = await apiCall('start', lang);
124
+ const res = await apiCall('startv7', lang);
125
125
  // null means stt startred successfully
126
126
  const isSTTAlreadyActive =
127
127
  res?.error?.message
@@ -209,7 +209,7 @@ const useSTTAPI = (): IuseSTTAPI => {
209
209
 
210
210
  const stop = async () => {
211
211
  try {
212
- const res = await apiCall('stop');
212
+ const res = await apiCall('stopv7');
213
213
  // once STT is non-active in the channel , notify others so that they dont' trigger start again
214
214
  // events.send(
215
215
  // EventNames.STT_ACTIVE,
@@ -12,20 +12,38 @@ export function formatTime(timestamp: number): string {
12
12
  }
13
13
 
14
14
  export type LanguageType =
15
- | 'en-US'
16
- | 'hi-IN'
15
+ | 'ar-EG'
16
+ | 'ar-JO'
17
+ | 'ar-SA'
18
+ | 'ar-AE'
19
+ | 'bn-IN'
17
20
  | 'zh-CN'
18
21
  | 'zh-HK'
22
+ | 'zh-TW'
23
+ | 'nl-NL'
24
+ | 'en-IN'
25
+ | 'en-US'
26
+ | 'fil-PH'
19
27
  | 'fr-FR'
20
28
  | 'de-DE'
21
- | 'ko-KR'
22
- | 'en-IN'
23
- | 'ar'
29
+ | 'gu-IN'
30
+ | 'he-IL'
31
+ | 'hi-IN'
32
+ | 'id-ID'
33
+ | 'it-IT'
24
34
  | 'ja-JP'
35
+ | 'kn-IN'
36
+ | 'ko-KR'
37
+ | 'ms-MY'
38
+ | 'fa-IR'
25
39
  | 'pt-PT'
40
+ | 'ru-RU'
26
41
  | 'es-ES'
27
- | 'it-IT'
28
- | 'id-ID'
42
+ | 'ta-IN'
43
+ | 'te-IN'
44
+ | 'th-TH'
45
+ | 'tr-TR'
46
+ | 'vi-VN'
29
47
  | '';
30
48
 
31
49
  interface LanguageData {
@@ -34,20 +52,38 @@ interface LanguageData {
34
52
  }
35
53
 
36
54
  export const langData: LanguageData[] = [
55
+ {label: 'Arabic (EG)', value: 'ar-EG'},
56
+ {label: 'Arabic (JO)', value: 'ar-JO'},
57
+ {label: 'Arabic (SA)', value: 'ar-SA'},
58
+ {label: 'Arabic (UAE)', value: 'ar-AE'},
59
+ {label: 'Bengali (IN)', value: 'bn-IN'},
60
+ {label: 'Chinese', value: 'zh-CN'},
61
+ {label: 'Chinese (HK)', value: 'zh-HK'},
62
+ {label: 'Chinese (TW)', value: 'zh-TW'},
63
+ {label: 'Dutch', value: 'nl-NL'},
64
+ {label: 'English (IN)', value: 'en-IN'},
37
65
  {label: 'English (US)', value: 'en-US'},
38
- {label: 'English (India)', value: 'en-IN'},
39
- {label: 'Hindi', value: 'hi-IN'},
40
- {label: 'Chinese (Simplified)', value: 'zh-CN'},
41
- {label: 'Chinese (Traditional)', value: 'zh-HK'},
42
- {label: 'Arabic', value: 'ar'},
66
+ {label: 'Filipino', value: 'fil-PH'},
43
67
  {label: 'French', value: 'fr-FR'},
44
68
  {label: 'German', value: 'de-DE'},
69
+ {label: 'Gujarati', value: 'gu-IN'},
70
+ {label: 'Hebrew', value: 'he-IL'},
71
+ {label: 'Hindi', value: 'hi-IN'},
72
+ {label: 'Indonesian', value: 'id-ID'},
73
+ {label: 'Italian', value: 'it-IT'},
45
74
  {label: 'Japanese', value: 'ja-JP'},
75
+ {label: 'Kannada', value: 'kn-IN'},
46
76
  {label: 'Korean', value: 'ko-KR'},
77
+ {label: 'Malay', value: 'ms-MY'},
78
+ {label: 'Persian', value: 'fa-IR'},
47
79
  {label: 'Portuguese', value: 'pt-PT'},
80
+ {label: 'Russian', value: 'ru-RU'},
48
81
  {label: 'Spanish', value: 'es-ES'},
49
- {label: 'Italian', value: 'it-IT'},
50
- {label: 'Indonesian', value: 'id-ID'},
82
+ {label: 'Tamil', value: 'ta-IN'},
83
+ {label: 'Telugu', value: 'te-IN'},
84
+ {label: 'Thai', value: 'th-TH'},
85
+ {label: 'Turkish', value: 'tr-TR'},
86
+ {label: 'Vietnamese', value: 'vi-VN'},
51
87
  ];
52
88
 
53
89
  export function getLanguageLabel(