agora-appbuilder-core 4.0.27 → 4.0.28-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/_package-lock.json +10 -7
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +9 -0
- package/template/bridge/rtm/web/index.ts +44 -26
- package/template/customization-api/app-state.ts +1 -0
- package/template/customization-api/atoms.ts +8 -0
- package/template/customization-api/index.ts +1 -0
- package/template/customization-api/sub-components.ts +4 -1
- package/template/customization-api/temp.ts +1 -2
- package/template/customization-api/typeDefinition.ts +8 -0
- package/template/customization-api/types.ts +3 -0
- package/template/customization-api/utils.ts +10 -1
- package/template/defaultConfig.js +2 -2
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +102 -50
- package/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/ScreenSharing.xcscheme +95 -0
- package/template/ios/Podfile +1 -1
- package/template/ios/Podfile.lock +200 -44
- package/template/ios/ScreenSharing/SampleHandler.h +2 -6
- package/template/ios/ScreenSharing/SampleHandler.m +17 -48
- package/template/package-lock.json +10 -7
- package/template/package.json +1 -1
- package/template/src/AppWrapper.tsx +2 -2
- package/template/src/assets/selection.json +3491 -1
- package/template/src/atoms/ActionMenu.tsx +96 -113
- package/template/src/atoms/LinkButton.tsx +4 -3
- package/template/src/atoms/ToolbarItem.tsx +36 -22
- package/template/src/atoms/ToolbarPreset.tsx +18 -3
- package/template/src/components/Controls.tsx +72 -49
- package/template/src/components/CustomSidePanel.tsx +82 -0
- package/template/src/components/EventsConfigure.tsx +11 -27
- package/template/src/components/Navbar.tsx +51 -86
- package/template/src/components/NavbarMobile.tsx +27 -3
- package/template/src/components/PinnedVideo.tsx +9 -0
- package/template/src/components/RTMConfigure.tsx +69 -1
- package/template/src/components/Settings.tsx +6 -29
- package/template/src/components/chat/chatConfigure.native.tsx +123 -119
- package/template/src/components/chat/chatConfigure.tsx +59 -46
- package/template/src/components/chat-messages/useChatMessages.tsx +5 -4
- package/template/src/components/chat-ui/useChatUIControls.tsx +4 -1
- package/template/src/components/livestream/views/LiveStreamControls.tsx +2 -1
- package/template/src/components/participants/UserActionMenuOptions.tsx +10 -10
- package/template/src/components/virtual-background/VBButton.tsx +5 -7
- package/template/src/language/default-labels/videoCallScreenLabels.ts +9 -2
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/pages/video-call/ActionSheet.native.tsx +110 -34
- package/template/src/pages/video-call/ActionSheet.tsx +109 -27
- package/template/src/pages/video-call/ActionSheetContent.tsx +67 -49
- package/template/src/pages/video-call/ActionSheetHandle.tsx +12 -2
- package/template/src/pages/video-call/SidePanelHeader.tsx +28 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +70 -16
- package/template/src/pages/video-call/VideoRenderer.tsx +1 -0
- package/template/src/rtm-events-api/Events.ts +37 -3
- package/template/src/rtm-events-api/LocalEvents.ts +1 -0
- package/template/src/rtm-events-api/types.ts +5 -0
- package/template/src/subComponents/ChatBubble.tsx +15 -1
- package/template/src/subComponents/ChatInput.tsx +18 -7
- package/template/src/subComponents/CopyJoinInfo.tsx +5 -13
- package/template/src/subComponents/LayoutIconButton.tsx +6 -14
- package/template/src/subComponents/LocalAudioMute.tsx +7 -11
- package/template/src/subComponents/LocalEndCall.tsx +6 -4
- package/template/src/subComponents/LocalSwitchCamera.tsx +5 -4
- package/template/src/subComponents/LocalVideoMute.tsx +10 -36
- package/template/src/subComponents/Recording.tsx +4 -10
- package/template/src/subComponents/ScreenShareNotice.tsx +3 -0
- package/template/src/subComponents/SidePanelEnum.tsx +6 -6
- package/template/src/subComponents/caption/CaptionContainer.tsx +2 -2
- package/template/src/subComponents/caption/CaptionIcon.tsx +21 -17
- package/template/src/subComponents/caption/TranscriptIcon.tsx +6 -3
- package/template/src/subComponents/chat/ChatActionMenu.tsx +3 -3
- package/template/src/subComponents/chat/ChatAttachment.tsx +107 -51
- package/template/src/subComponents/chat/ChatEmoji.tsx +8 -4
- package/template/src/subComponents/chat/ChatSendButton.tsx +52 -30
- package/template/src/subComponents/chat/ChatUploadStatus.tsx +22 -3
- package/template/src/subComponents/chat/ImagePopup.tsx +4 -4
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +14 -25
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +8 -7
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +333 -163
- package/template/src/utils/common.tsx +22 -9
- package/template/src/utils/useEndCall.ts +6 -4
- package/template/src/utils/useFullScreen.native.ts +12 -0
- package/template/src/utils/useOrientation.tsx +46 -46
- package/template/src/utils/useSidePanel.tsx +2 -2
- package/template/src/utils/useString.ts +6 -4
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import {useState, useEffect} from 'react';
|
|
2
|
+
import {Keyboard, Platform} from 'react-native';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
if (
|
|
6
|
-
window?.screen?.orientation?.type === 'portrait-primary' ||
|
|
7
|
-
window?.screen?.orientation?.type === 'portrait-secondary'
|
|
8
|
-
) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
} catch (error) {
|
|
13
|
-
console.log('screen orientation window api not supported error: ', error);
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* A React Hook which updates when the orientation changes
|
|
20
|
-
* @returns whether the user is in 'PORTRAIT' or 'LANDSCAPE'
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export function useOrientation(): 'PORTRAIT' | 'LANDSCAPE' {
|
|
4
|
+
export function useOrientation() {
|
|
24
5
|
const [orientation, setOrientation] = useState<'PORTRAIT' | 'LANDSCAPE'>(
|
|
25
|
-
|
|
6
|
+
window.matchMedia('(orientation: portrait)').matches
|
|
7
|
+
? 'PORTRAIT'
|
|
8
|
+
: 'LANDSCAPE',
|
|
26
9
|
);
|
|
10
|
+
const [keyboardVisible, setKeyboardVisible] = useState(false);
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
event?.target?.type === 'portrait-primary' ||
|
|
33
|
-
event?.target?.type === 'portrait-secondary'
|
|
34
|
-
) {
|
|
35
|
-
setOrientation('PORTRAIT');
|
|
36
|
-
} else {
|
|
37
|
-
setOrientation('LANDSCAPE');
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.log('screen orientation window api not supported error: ', error);
|
|
41
|
-
setOrientation('PORTRAIT');
|
|
42
|
-
}
|
|
43
|
-
};
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
console.log('screen orientation changed', orientation);
|
|
14
|
+
}, [orientation]);
|
|
44
15
|
|
|
45
16
|
useEffect(() => {
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
|
|
17
|
+
const handleOrientationChange = () => {
|
|
18
|
+
if (keyboardVisible && Platform.OS === 'ios') {
|
|
19
|
+
return; // Avoid changing orientation if the keyboard is visible on iOS
|
|
20
|
+
}
|
|
21
|
+
setOrientation(
|
|
22
|
+
window.matchMedia('(orientation: portrait)').matches
|
|
23
|
+
? 'PORTRAIT'
|
|
24
|
+
: 'LANDSCAPE',
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const handleResize = () => {
|
|
29
|
+
if (!keyboardVisible) {
|
|
30
|
+
handleOrientationChange();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const keyboardDidShowListener = Keyboard.addListener(
|
|
35
|
+
'keyboardDidShow',
|
|
36
|
+
() => {
|
|
37
|
+
setKeyboardVisible(true);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const keyboardDidHideListener = Keyboard.addListener(
|
|
42
|
+
'keyboardDidHide',
|
|
43
|
+
() => {
|
|
44
|
+
setKeyboardVisible(false);
|
|
45
|
+
handleOrientationChange(); // Recheck orientation after the keyboard is hidden
|
|
46
|
+
},
|
|
49
47
|
);
|
|
48
|
+
|
|
49
|
+
window.addEventListener('resize', handleResize);
|
|
50
|
+
|
|
50
51
|
return () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
52
|
+
keyboardDidShowListener.remove();
|
|
53
|
+
keyboardDidHideListener.remove();
|
|
54
|
+
window.removeEventListener('resize', handleResize);
|
|
55
55
|
};
|
|
56
|
-
}, []);
|
|
56
|
+
}, [keyboardVisible]);
|
|
57
57
|
|
|
58
58
|
return orientation;
|
|
59
59
|
}
|
|
@@ -16,8 +16,8 @@ import {createHook} from 'customization-implementation';
|
|
|
16
16
|
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
17
17
|
|
|
18
18
|
export interface SidePanelContextInterface {
|
|
19
|
-
sidePanel: SidePanelType;
|
|
20
|
-
setSidePanel: React.Dispatch<SetStateAction<SidePanelType>>;
|
|
19
|
+
sidePanel: SidePanelType | string;
|
|
20
|
+
setSidePanel: React.Dispatch<SetStateAction<SidePanelType | string>>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const SidePanelContext = React.createContext<SidePanelContextInterface>({
|
|
@@ -41,23 +41,25 @@ export function usei18nData(
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function useString<T =
|
|
44
|
+
export function useString<T = any>(
|
|
45
45
|
keyName: keyof TextDataInterface,
|
|
46
|
-
): (
|
|
46
|
+
): (...args: T[]) => string {
|
|
47
47
|
const lanCode = useLanguage(data => data.languageCode);
|
|
48
48
|
const textData = usei18nData(lanCode);
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
const getString = (...args: T[]) => {
|
|
50
51
|
let keyValue = textData ? textData[keyName] : undefined;
|
|
51
52
|
if (!keyValue) {
|
|
52
53
|
return '';
|
|
53
54
|
} else if (typeof keyValue === 'function') {
|
|
54
|
-
return keyValue(
|
|
55
|
+
return keyValue(...args);
|
|
55
56
|
} else if (typeof keyValue === 'string') {
|
|
56
57
|
return keyValue;
|
|
57
58
|
} else {
|
|
58
59
|
return '';
|
|
59
60
|
}
|
|
60
61
|
};
|
|
62
|
+
|
|
61
63
|
return getString;
|
|
62
64
|
}
|
|
63
65
|
|