@aic-kits/react-native 0.0.3 → 0.0.4
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/lib/auth/components/SocialAuthButton/constants.d.ts +7 -0
- package/lib/auth/components/SocialAuthButton/constants.d.ts.map +1 -0
- package/lib/auth/components/SocialAuthButton/constants.js +14 -0
- package/lib/auth/components/SocialAuthButton/index.d.ts +22 -0
- package/lib/auth/components/SocialAuthButton/index.d.ts.map +1 -0
- package/lib/auth/components/SocialAuthButton/index.js +37 -0
- package/lib/auth/components/SocialSignIn/constants.d.ts +3 -0
- package/lib/auth/components/SocialSignIn/constants.d.ts.map +1 -0
- package/lib/auth/components/SocialSignIn/constants.js +1 -0
- package/lib/auth/components/SocialSignIn/index.d.ts +16 -0
- package/lib/auth/components/SocialSignIn/index.d.ts.map +1 -0
- package/lib/auth/components/SocialSignIn/index.js +11 -0
- package/lib/auth/components/index.d.ts +3 -0
- package/lib/auth/components/index.d.ts.map +1 -0
- package/lib/auth/components/index.js +2 -0
- package/lib/auth/hooks/index.d.ts +2 -0
- package/lib/auth/hooks/index.d.ts.map +1 -0
- package/lib/auth/hooks/index.js +1 -0
- package/lib/auth/hooks/useAuthListener.d.ts +6 -0
- package/lib/auth/hooks/useAuthListener.d.ts.map +1 -0
- package/lib/auth/hooks/useAuthListener.js +40 -0
- package/lib/auth/index.d.ts +7 -0
- package/lib/auth/index.d.ts.map +1 -0
- package/lib/auth/index.js +6 -0
- package/lib/auth/types.d.ts +26 -0
- package/lib/auth/types.d.ts.map +1 -0
- package/lib/auth/types.js +1 -0
- package/lib/auth/utils/apple.d.ts +4 -0
- package/lib/auth/utils/apple.d.ts.map +1 -0
- package/lib/auth/utils/apple.js +90 -0
- package/lib/auth/utils/email.d.ts +11 -0
- package/lib/auth/utils/email.d.ts.map +1 -0
- package/lib/auth/utils/email.js +33 -0
- package/lib/auth/utils/facebook.d.ts +4 -0
- package/lib/auth/utils/facebook.d.ts.map +1 -0
- package/lib/auth/utils/facebook.js +59 -0
- package/lib/auth/utils/google.d.ts +3 -0
- package/lib/auth/utils/google.d.ts.map +1 -0
- package/lib/auth/utils/google.js +33 -0
- package/lib/auth/utils/index.d.ts +8 -0
- package/lib/auth/utils/index.d.ts.map +1 -0
- package/lib/auth/utils/index.js +55 -0
- package/lib/components/Art/BrandArt.d.ts +3 -0
- package/lib/components/Art/BrandArt.d.ts.map +1 -0
- package/lib/components/Art/BrandArt.js +6 -0
- package/lib/components/Art/EmojiArt.d.ts +3 -0
- package/lib/components/Art/EmojiArt.d.ts.map +1 -0
- package/lib/components/Art/EmojiArt.js +25 -0
- package/lib/components/Art/IconArt.d.ts +3 -0
- package/lib/components/Art/IconArt.d.ts.map +1 -0
- package/lib/components/Art/IconArt.js +26 -0
- package/lib/components/Art/ImageArt.d.ts +3 -0
- package/lib/components/Art/ImageArt.d.ts.map +1 -0
- package/lib/components/Art/ImageArt.js +24 -0
- package/lib/components/Art/SvgArt.d.ts +3 -0
- package/lib/components/Art/SvgArt.d.ts.map +1 -0
- package/lib/components/Art/SvgArt.js +51 -0
- package/lib/components/Art/constants.d.ts +5 -0
- package/lib/components/Art/constants.d.ts.map +1 -0
- package/lib/components/Art/constants.js +6 -0
- package/lib/components/Art/hooks.d.ts +3 -0
- package/lib/components/Art/hooks.d.ts.map +1 -0
- package/lib/components/Art/hooks.js +8 -0
- package/lib/components/Art/index.d.ts +10 -0
- package/lib/components/Art/index.d.ts.map +1 -0
- package/lib/components/Art/index.js +29 -0
- package/lib/components/Art/types.d.ts +157 -0
- package/lib/components/Art/types.d.ts.map +1 -0
- package/lib/components/Art/types.js +1 -0
- package/lib/components/Art/utils.d.ts +40 -0
- package/lib/components/Art/utils.d.ts.map +1 -0
- package/lib/components/Art/utils.js +68 -0
- package/lib/components/Avatar/Wrapper.d.ts +11 -0
- package/lib/components/Avatar/Wrapper.d.ts.map +1 -0
- package/lib/components/Avatar/Wrapper.js +67 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.d.ts +14 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.d.ts.map +1 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.js +24 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/Avatar/index.d.ts.map +1 -0
- package/lib/components/Avatar/index.js +37 -0
- package/lib/components/Avatar/types.d.ts +51 -0
- package/lib/components/Avatar/types.d.ts.map +1 -0
- package/lib/components/Avatar/types.js +1 -0
- package/lib/components/Avatar/utils.d.ts +6 -0
- package/lib/components/Avatar/utils.d.ts.map +1 -0
- package/lib/components/Avatar/utils.js +9 -0
- package/lib/components/Base/BaseFooter.d.ts +8 -0
- package/lib/components/Base/BaseFooter.d.ts.map +1 -0
- package/lib/components/Base/BaseFooter.js +18 -0
- package/lib/components/Base/index.d.ts +4 -0
- package/lib/components/Base/index.d.ts.map +1 -0
- package/lib/components/Base/index.js +49 -0
- package/lib/components/Base/types.d.ts +83 -0
- package/lib/components/Base/types.d.ts.map +1 -0
- package/lib/components/Base/types.js +1 -0
- package/lib/components/Box/StyledBox.d.ts +254 -0
- package/lib/components/Box/StyledBox.d.ts.map +1 -0
- package/lib/components/Box/StyledBox.js +53 -0
- package/lib/components/Box/config.d.ts +359 -0
- package/lib/components/Box/config.d.ts.map +1 -0
- package/lib/components/Box/config.js +227 -0
- package/lib/components/Box/index.d.ts +11 -0
- package/lib/components/Box/index.d.ts.map +1 -0
- package/lib/components/Box/index.js +14 -0
- package/lib/components/Box/types.d.ts +53 -0
- package/lib/components/Box/types.d.ts.map +1 -0
- package/lib/components/Box/types.js +1 -0
- package/lib/components/Bubble/index.d.ts +8 -0
- package/lib/components/Bubble/index.d.ts.map +1 -0
- package/lib/components/Bubble/index.js +20 -0
- package/lib/components/Bubble/type.d.ts +18 -0
- package/lib/components/Bubble/type.d.ts.map +1 -0
- package/lib/components/Bubble/type.js +1 -0
- package/lib/components/Bubble/utils.d.ts +12 -0
- package/lib/components/Bubble/utils.d.ts.map +1 -0
- package/lib/components/Bubble/utils.js +33 -0
- package/lib/components/Button/StyledButton.d.ts +34 -0
- package/lib/components/Button/StyledButton.d.ts.map +1 -0
- package/lib/components/Button/StyledButton.js +49 -0
- package/lib/components/Button/index.d.ts +64 -0
- package/lib/components/Button/index.d.ts.map +1 -0
- package/lib/components/Button/index.js +20 -0
- package/lib/components/Button/utils.d.ts +4 -0
- package/lib/components/Button/utils.d.ts.map +1 -0
- package/lib/components/Button/utils.js +10 -0
- package/lib/components/Card/StyledCard.d.ts +226 -0
- package/lib/components/Card/StyledCard.d.ts.map +1 -0
- package/lib/components/Card/StyledCard.js +17 -0
- package/lib/components/Card/index.d.ts +27 -0
- package/lib/components/Card/index.d.ts.map +1 -0
- package/lib/components/Card/index.js +44 -0
- package/lib/components/Chart/LineChart.d.ts +3 -0
- package/lib/components/Chart/LineChart.d.ts.map +1 -0
- package/lib/components/Chart/LineChart.js +27 -0
- package/lib/components/Chart/constants.d.ts +2 -0
- package/lib/components/Chart/constants.d.ts.map +1 -0
- package/lib/components/Chart/constants.js +47 -0
- package/lib/components/Chart/index.d.ts +3 -0
- package/lib/components/Chart/index.d.ts.map +1 -0
- package/lib/components/Chart/index.js +10 -0
- package/lib/components/Chart/types.d.ts +32 -0
- package/lib/components/Chart/types.d.ts.map +1 -0
- package/lib/components/Chart/types.js +1 -0
- package/lib/components/Chart/utils.d.ts +6 -0
- package/lib/components/Chart/utils.d.ts.map +1 -0
- package/lib/components/Chart/utils.js +8 -0
- package/lib/components/Chat/ImageChat.d.ts +8 -0
- package/lib/components/Chat/ImageChat.d.ts.map +1 -0
- package/lib/components/Chat/ImageChat.js +24 -0
- package/lib/components/Chat/TextChat.d.ts +8 -0
- package/lib/components/Chat/TextChat.d.ts.map +1 -0
- package/lib/components/Chat/TextChat.js +37 -0
- package/lib/components/Chat/VideoChat.d.ts +6 -0
- package/lib/components/Chat/VideoChat.d.ts.map +1 -0
- package/lib/components/Chat/VideoChat.js +56 -0
- package/lib/components/Chat/index.d.ts +4 -0
- package/lib/components/Chat/index.d.ts.map +1 -0
- package/lib/components/Chat/index.js +26 -0
- package/lib/components/Chat/type.d.ts +95 -0
- package/lib/components/Chat/type.d.ts.map +1 -0
- package/lib/components/Chat/type.js +1 -0
- package/lib/components/ChatCluster/index.d.ts +4 -0
- package/lib/components/ChatCluster/index.d.ts.map +1 -0
- package/lib/components/ChatCluster/index.js +22 -0
- package/lib/components/ChatCluster/types.d.ts +11 -0
- package/lib/components/ChatCluster/types.d.ts.map +1 -0
- package/lib/components/ChatCluster/types.js +1 -0
- package/lib/components/ChatCluster/utils.d.ts +5 -0
- package/lib/components/ChatCluster/utils.d.ts.map +1 -0
- package/lib/components/ChatCluster/utils.js +15 -0
- package/lib/components/Chip/index.d.ts +3 -0
- package/lib/components/Chip/index.d.ts.map +1 -0
- package/lib/components/Chip/index.js +16 -0
- package/lib/components/Chip/types.d.ts +50 -0
- package/lib/components/Chip/types.d.ts.map +1 -0
- package/lib/components/Chip/types.js +1 -0
- package/lib/components/Divider/StyledDivider.d.ts +12 -0
- package/lib/components/Divider/StyledDivider.d.ts.map +1 -0
- package/lib/components/Divider/StyledDivider.js +17 -0
- package/lib/components/Divider/index.d.ts +15 -0
- package/lib/components/Divider/index.d.ts.map +1 -0
- package/lib/components/Divider/index.js +4 -0
- package/lib/components/FastList/index.d.ts +25 -0
- package/lib/components/FastList/index.d.ts.map +1 -0
- package/lib/components/FastList/index.js +13 -0
- package/lib/components/Filter/index.d.ts +40 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +23 -0
- package/lib/components/Gradient/index.d.ts +11 -0
- package/lib/components/Gradient/index.d.ts.map +1 -0
- package/lib/components/Gradient/index.js +10 -0
- package/lib/components/Header/BackButton.d.ts +5 -0
- package/lib/components/Header/BackButton.d.ts.map +1 -0
- package/lib/components/Header/BackButton.js +22 -0
- package/lib/components/Header/DefaultHeader.d.ts +8 -0
- package/lib/components/Header/DefaultHeader.d.ts.map +1 -0
- package/lib/components/Header/DefaultHeader.js +13 -0
- package/lib/components/Header/HeaderContent.d.ts +6 -0
- package/lib/components/Header/HeaderContent.d.ts.map +1 -0
- package/lib/components/Header/HeaderContent.js +18 -0
- package/lib/components/Header/IconButton.d.ts +13 -0
- package/lib/components/Header/IconButton.d.ts.map +1 -0
- package/lib/components/Header/IconButton.js +6 -0
- package/lib/components/Header/ProgressHeader.d.ts +7 -0
- package/lib/components/Header/ProgressHeader.d.ts.map +1 -0
- package/lib/components/Header/ProgressHeader.js +18 -0
- package/lib/components/Header/RightButton.d.ts +3 -0
- package/lib/components/Header/RightButton.d.ts.map +1 -0
- package/lib/components/Header/RightButton.js +15 -0
- package/lib/components/Header/index.d.ts +4 -0
- package/lib/components/Header/index.d.ts.map +1 -0
- package/lib/components/Header/index.js +12 -0
- package/lib/components/Header/types.d.ts +86 -0
- package/lib/components/Header/types.d.ts.map +1 -0
- package/lib/components/Header/types.js +1 -0
- package/lib/components/Header/utils.d.ts +10 -0
- package/lib/components/Header/utils.d.ts.map +1 -0
- package/lib/components/Header/utils.js +3 -0
- package/lib/components/Icon/AnimatedIcon.d.ts +6 -0
- package/lib/components/Icon/AnimatedIcon.d.ts.map +1 -0
- package/lib/components/Icon/AnimatedIcon.js +34 -0
- package/lib/components/Icon/PlainIcon.d.ts +16 -0
- package/lib/components/Icon/PlainIcon.d.ts.map +1 -0
- package/lib/components/Icon/PlainIcon.js +13 -0
- package/lib/components/Icon/constants.d.ts +703 -0
- package/lib/components/Icon/constants.d.ts.map +1 -0
- package/lib/components/Icon/constants.js +702 -0
- package/lib/components/Icon/index.d.ts +34 -0
- package/lib/components/Icon/index.d.ts.map +1 -0
- package/lib/components/Icon/index.js +24 -0
- package/lib/components/Icon/utils.d.ts +3 -0
- package/lib/components/Icon/utils.d.ts.map +1 -0
- package/lib/components/Icon/utils.js +2 -0
- package/lib/components/Image/ImageDetail.d.ts +11 -0
- package/lib/components/Image/ImageDetail.d.ts.map +1 -0
- package/lib/components/Image/ImageDetail.js +33 -0
- package/lib/components/Image/index.d.ts +11 -0
- package/lib/components/Image/index.d.ts.map +1 -0
- package/lib/components/Image/index.js +5 -0
- package/lib/components/Image/utils.d.ts +6 -0
- package/lib/components/Image/utils.d.ts.map +1 -0
- package/lib/components/Image/utils.js +12 -0
- package/lib/components/InfoCard/BasicInfoCard.d.ts +19 -0
- package/lib/components/InfoCard/BasicInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/BasicInfoCard.js +18 -0
- package/lib/components/InfoCard/NewsInfoCard.d.ts +22 -0
- package/lib/components/InfoCard/NewsInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/NewsInfoCard.js +15 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.d.ts +33 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.js +24 -0
- package/lib/components/InfoCard/index.d.ts +15 -0
- package/lib/components/InfoCard/index.d.ts.map +1 -0
- package/lib/components/InfoCard/index.js +16 -0
- package/lib/components/Input/StyledInput.d.ts +13 -0
- package/lib/components/Input/StyledInput.d.ts.map +1 -0
- package/lib/components/Input/StyledInput.js +14 -0
- package/lib/components/Input/index.d.ts +34 -0
- package/lib/components/Input/index.d.ts.map +1 -0
- package/lib/components/Input/index.js +15 -0
- package/lib/components/LevelStep/CircularProgress.d.ts +12 -0
- package/lib/components/LevelStep/CircularProgress.d.ts.map +1 -0
- package/lib/components/LevelStep/CircularProgress.js +27 -0
- package/lib/components/LevelStep/TransformedSvg.d.ts +13 -0
- package/lib/components/LevelStep/TransformedSvg.d.ts.map +1 -0
- package/lib/components/LevelStep/TransformedSvg.js +9 -0
- package/lib/components/LevelStep/constants.d.ts +8 -0
- package/lib/components/LevelStep/constants.d.ts.map +1 -0
- package/lib/components/LevelStep/constants.js +17 -0
- package/lib/components/LevelStep/index.d.ts +3 -0
- package/lib/components/LevelStep/index.d.ts.map +1 -0
- package/lib/components/LevelStep/index.js +78 -0
- package/lib/components/LevelStep/types.d.ts +7 -0
- package/lib/components/LevelStep/types.d.ts.map +1 -0
- package/lib/components/LevelStep/types.js +1 -0
- package/lib/components/List/index.d.ts +13 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +13 -0
- package/lib/components/Loading/Loading.d.ts +3 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +61 -0
- package/lib/components/Loading/StyledLoading.d.ts +14 -0
- package/lib/components/Loading/StyledLoading.d.ts.map +1 -0
- package/lib/components/Loading/StyledLoading.js +18 -0
- package/lib/components/Loading/index.d.ts +3 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +26 -0
- package/lib/components/Loading/types.d.ts +25 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Loading/types.js +1 -0
- package/lib/components/Notification/Notification.d.ts +6 -0
- package/lib/components/Notification/Notification.d.ts.map +1 -0
- package/lib/components/Notification/Notification.js +13 -0
- package/lib/components/Notification/NotificationProvider.d.ts +4 -0
- package/lib/components/Notification/NotificationProvider.d.ts.map +1 -0
- package/lib/components/Notification/NotificationProvider.js +13 -0
- package/lib/components/Notification/Toast.d.ts +8 -0
- package/lib/components/Notification/Toast.d.ts.map +1 -0
- package/lib/components/Notification/Toast.js +32 -0
- package/lib/components/Notification/context.d.ts +7 -0
- package/lib/components/Notification/context.d.ts.map +1 -0
- package/lib/components/Notification/context.js +9 -0
- package/lib/components/Notification/index.d.ts +3 -0
- package/lib/components/Notification/index.d.ts.map +1 -0
- package/lib/components/Notification/index.js +2 -0
- package/lib/components/PlaySwitch/index.d.ts +4 -0
- package/lib/components/PlaySwitch/index.d.ts.map +1 -0
- package/lib/components/PlaySwitch/index.js +62 -0
- package/lib/components/PlaySwitch/types.d.ts +23 -0
- package/lib/components/PlaySwitch/types.d.ts.map +1 -0
- package/lib/components/PlaySwitch/types.js +1 -0
- package/lib/components/Progress/StyledProgress.d.ts +225 -0
- package/lib/components/Progress/StyledProgress.d.ts.map +1 -0
- package/lib/components/Progress/StyledProgress.js +22 -0
- package/lib/components/Progress/index.d.ts +25 -0
- package/lib/components/Progress/index.d.ts.map +1 -0
- package/lib/components/Progress/index.js +33 -0
- package/lib/components/Scrollable/StyledScrollable.d.ts +33 -0
- package/lib/components/Scrollable/StyledScrollable.d.ts.map +1 -0
- package/lib/components/Scrollable/StyledScrollable.js +56 -0
- package/lib/components/Scrollable/index.d.ts +6 -0
- package/lib/components/Scrollable/index.d.ts.map +1 -0
- package/lib/components/Scrollable/index.js +15 -0
- package/lib/components/Scrollable/types.d.ts +5 -0
- package/lib/components/Scrollable/types.d.ts.map +1 -0
- package/lib/components/Scrollable/types.js +1 -0
- package/lib/components/Sectional/Item.d.ts +13 -0
- package/lib/components/Sectional/Item.d.ts.map +1 -0
- package/lib/components/Sectional/Item.js +21 -0
- package/lib/components/Sectional/index.d.ts +9 -0
- package/lib/components/Sectional/index.d.ts.map +1 -0
- package/lib/components/Sectional/index.js +25 -0
- package/lib/components/Sectional/types.d.ts +33 -0
- package/lib/components/Sectional/types.d.ts.map +1 -0
- package/lib/components/Sectional/types.js +1 -0
- package/lib/components/Sectional/utils.d.ts +11 -0
- package/lib/components/Sectional/utils.d.ts.map +1 -0
- package/lib/components/Sectional/utils.js +37 -0
- package/lib/components/Selection/index.d.ts +17 -0
- package/lib/components/Selection/index.d.ts.map +1 -0
- package/lib/components/Selection/index.js +24 -0
- package/lib/components/Skeleton/SkeletonBackground.d.ts +6 -0
- package/lib/components/Skeleton/SkeletonBackground.d.ts.map +1 -0
- package/lib/components/Skeleton/SkeletonBackground.js +23 -0
- package/lib/components/Skeleton/SkeletonWrapper.d.ts +8 -0
- package/lib/components/Skeleton/SkeletonWrapper.d.ts.map +1 -0
- package/lib/components/Skeleton/SkeletonWrapper.js +50 -0
- package/lib/components/Skeleton/index.d.ts +4 -0
- package/lib/components/Skeleton/index.d.ts.map +1 -0
- package/lib/components/Skeleton/index.js +16 -0
- package/lib/components/Skeleton/types.d.ts +16 -0
- package/lib/components/Skeleton/types.d.ts.map +1 -0
- package/lib/components/Skeleton/types.js +1 -0
- package/lib/components/Slides/index.d.ts +14 -0
- package/lib/components/Slides/index.d.ts.map +1 -0
- package/lib/components/Slides/index.js +46 -0
- package/lib/components/Squircle/index.d.ts +35 -0
- package/lib/components/Squircle/index.d.ts.map +1 -0
- package/lib/components/Squircle/index.js +21 -0
- package/lib/components/Squircle/types.d.ts +20 -0
- package/lib/components/Squircle/types.d.ts.map +1 -0
- package/lib/components/Squircle/types.js +1 -0
- package/lib/components/Squircle/utils.d.ts +4 -0
- package/lib/components/Squircle/utils.d.ts.map +1 -0
- package/lib/components/Squircle/utils.js +86 -0
- package/lib/components/Text/StyledText.d.ts +18 -0
- package/lib/components/Text/StyledText.d.ts.map +1 -0
- package/lib/components/Text/StyledText.js +19 -0
- package/lib/components/Text/constants.d.ts +3 -0
- package/lib/components/Text/constants.d.ts.map +1 -0
- package/lib/components/Text/constants.js +6 -0
- package/lib/components/Text/index.d.ts +6 -0
- package/lib/components/Text/index.d.ts.map +1 -0
- package/lib/components/Text/index.js +7 -0
- package/lib/components/Text/types.d.ts +55 -0
- package/lib/components/Text/types.d.ts.map +1 -0
- package/lib/components/Text/types.js +1 -0
- package/lib/components/Text/withRichText.d.ts +6 -0
- package/lib/components/Text/withRichText.d.ts.map +1 -0
- package/lib/components/Text/withRichText.js +38 -0
- package/lib/components/Touchable/index.d.ts +5 -0
- package/lib/components/Touchable/index.d.ts.map +1 -0
- package/lib/components/Touchable/index.js +56 -0
- package/lib/components/Touchable/types.d.ts +22 -0
- package/lib/components/Touchable/types.d.ts.map +1 -0
- package/lib/components/Touchable/types.js +1 -0
- package/lib/components/Video/StyledVideoControlManager.d.ts +49 -0
- package/lib/components/Video/StyledVideoControlManager.d.ts.map +1 -0
- package/lib/components/Video/StyledVideoControlManager.js +64 -0
- package/lib/components/Video/StyledVideoDetail.d.ts +16 -0
- package/lib/components/Video/StyledVideoDetail.d.ts.map +1 -0
- package/lib/components/Video/StyledVideoDetail.js +23 -0
- package/lib/components/Video/VideoControlManager.d.ts +10 -0
- package/lib/components/Video/VideoControlManager.d.ts.map +1 -0
- package/lib/components/Video/VideoControlManager.js +67 -0
- package/lib/components/Video/VideoDetail.d.ts +11 -0
- package/lib/components/Video/VideoDetail.d.ts.map +1 -0
- package/lib/components/Video/VideoDetail.js +102 -0
- package/lib/components/Video/index.d.ts +25 -0
- package/lib/components/Video/index.d.ts.map +1 -0
- package/lib/components/Video/index.js +49 -0
- package/lib/components/Vimeo/Player.d.ts +4 -0
- package/lib/components/Vimeo/Player.d.ts.map +1 -0
- package/lib/components/Vimeo/Player.js +30 -0
- package/lib/components/Vimeo/constants.d.ts +2 -0
- package/lib/components/Vimeo/constants.d.ts.map +1 -0
- package/lib/components/Vimeo/constants.js +23 -0
- package/lib/components/Vimeo/index.d.ts +10 -0
- package/lib/components/Vimeo/index.d.ts.map +1 -0
- package/lib/components/Vimeo/index.js +35 -0
- package/lib/components/Vimeo/types.d.ts +74 -0
- package/lib/components/Vimeo/types.d.ts.map +1 -0
- package/lib/components/Vimeo/types.js +1 -0
- package/lib/components/Vimeo/utils.d.ts +4 -0
- package/lib/components/Vimeo/utils.d.ts.map +1 -0
- package/lib/components/Vimeo/utils.js +126 -0
- package/lib/components/index.d.ts +33 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +32 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/useKeyboard.d.ts +10 -0
- package/lib/hooks/useKeyboard.d.ts.map +1 -0
- package/lib/hooks/useKeyboard.js +54 -0
- package/lib/hooks/usePrevious.d.ts +3 -0
- package/lib/hooks/usePrevious.d.ts.map +1 -0
- package/lib/hooks/usePrevious.js +9 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/services/base/BaseResponse.d.ts +12 -0
- package/lib/services/base/BaseResponse.d.ts.map +1 -0
- package/lib/services/base/BaseResponse.js +9 -0
- package/lib/services/base/BaseService.d.ts +8 -0
- package/lib/services/base/BaseService.d.ts.map +1 -0
- package/lib/services/base/BaseService.js +61 -0
- package/lib/services/base/index.d.ts +3 -0
- package/lib/services/base/index.d.ts.map +1 -0
- package/lib/services/base/index.js +2 -0
- package/lib/services/hooks/index.d.ts +2 -0
- package/lib/services/hooks/index.d.ts.map +1 -0
- package/lib/services/hooks/index.js +1 -0
- package/lib/services/hooks/useRequest.d.ts +14 -0
- package/lib/services/hooks/useRequest.d.ts.map +1 -0
- package/lib/services/hooks/useRequest.js +30 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +2 -0
- package/lib/theme/ThemeProvider.d.ts +13 -0
- package/lib/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/theme/ThemeProvider.js +5 -0
- package/lib/theme/ThemeSwitcher.d.ts +9 -0
- package/lib/theme/ThemeSwitcher.d.ts.map +1 -0
- package/lib/theme/ThemeSwitcher.js +19 -0
- package/lib/theme/common/borders.d.ts +9 -0
- package/lib/theme/common/borders.d.ts.map +1 -0
- package/lib/theme/common/borders.js +27 -0
- package/lib/theme/common/colors.d.ts +74 -0
- package/lib/theme/common/colors.d.ts.map +1 -0
- package/lib/theme/common/colors.js +73 -0
- package/lib/theme/common/gradient.d.ts +13 -0
- package/lib/theme/common/gradient.d.ts.map +1 -0
- package/lib/theme/common/gradient.js +12 -0
- package/lib/theme/common/index.d.ts +50 -0
- package/lib/theme/common/index.d.ts.map +1 -0
- package/lib/theme/common/index.js +37 -0
- package/lib/theme/common/scale.d.ts +12 -0
- package/lib/theme/common/scale.d.ts.map +1 -0
- package/lib/theme/common/scale.js +16 -0
- package/lib/theme/common/shadows.d.ts +17 -0
- package/lib/theme/common/shadows.d.ts.map +1 -0
- package/lib/theme/common/shadows.js +13 -0
- package/lib/theme/common/sizes.d.ts +6 -0
- package/lib/theme/common/sizes.d.ts.map +1 -0
- package/lib/theme/common/sizes.js +26 -0
- package/lib/theme/common/spaces.d.ts +5 -0
- package/lib/theme/common/spaces.d.ts.map +1 -0
- package/lib/theme/common/spaces.js +31 -0
- package/lib/theme/common/text.d.ts +14 -0
- package/lib/theme/common/text.d.ts.map +1 -0
- package/lib/theme/common/text.js +70 -0
- package/lib/theme/components/art.d.ts +17 -0
- package/lib/theme/components/art.d.ts.map +1 -0
- package/lib/theme/components/art.js +15 -0
- package/lib/theme/components/avatar.d.ts +11 -0
- package/lib/theme/components/avatar.d.ts.map +1 -0
- package/lib/theme/components/avatar.js +20 -0
- package/lib/theme/components/base.d.ts +14 -0
- package/lib/theme/components/base.d.ts.map +1 -0
- package/lib/theme/components/base.js +17 -0
- package/lib/theme/components/bubble.d.ts +6 -0
- package/lib/theme/components/bubble.d.ts.map +1 -0
- package/lib/theme/components/bubble.js +10 -0
- package/lib/theme/components/button.d.ts +12 -0
- package/lib/theme/components/button.d.ts.map +1 -0
- package/lib/theme/components/button.js +22 -0
- package/lib/theme/components/card.d.ts +8 -0
- package/lib/theme/components/card.d.ts.map +1 -0
- package/lib/theme/components/card.js +16 -0
- package/lib/theme/components/chart.d.ts +16 -0
- package/lib/theme/components/chart.d.ts.map +1 -0
- package/lib/theme/components/chart.js +22 -0
- package/lib/theme/components/chat.d.ts +11 -0
- package/lib/theme/components/chat.d.ts.map +1 -0
- package/lib/theme/components/chat.js +20 -0
- package/lib/theme/components/chip.d.ts +18 -0
- package/lib/theme/components/chip.d.ts.map +1 -0
- package/lib/theme/components/chip.js +43 -0
- package/lib/theme/components/divider.d.ts +12 -0
- package/lib/theme/components/divider.d.ts.map +1 -0
- package/lib/theme/components/divider.js +16 -0
- package/lib/theme/components/filter.d.ts +5 -0
- package/lib/theme/components/filter.d.ts.map +1 -0
- package/lib/theme/components/filter.js +8 -0
- package/lib/theme/components/header.d.ts +30 -0
- package/lib/theme/components/header.d.ts.map +1 -0
- package/lib/theme/components/header.js +36 -0
- package/lib/theme/components/image.d.ts +4 -0
- package/lib/theme/components/image.d.ts.map +1 -0
- package/lib/theme/components/image.js +6 -0
- package/lib/theme/components/index.d.ts +27 -0
- package/lib/theme/components/index.d.ts.map +1 -0
- package/lib/theme/components/index.js +26 -0
- package/lib/theme/components/infoCard.d.ts +25 -0
- package/lib/theme/components/infoCard.d.ts.map +1 -0
- package/lib/theme/components/infoCard.js +32 -0
- package/lib/theme/components/input.d.ts +21 -0
- package/lib/theme/components/input.d.ts.map +1 -0
- package/lib/theme/components/input.js +34 -0
- package/lib/theme/components/levelStep.d.ts +48 -0
- package/lib/theme/components/levelStep.d.ts.map +1 -0
- package/lib/theme/components/levelStep.js +56 -0
- package/lib/theme/components/loading.d.ts +16 -0
- package/lib/theme/components/loading.d.ts.map +1 -0
- package/lib/theme/components/loading.js +27 -0
- package/lib/theme/components/notification.d.ts +23 -0
- package/lib/theme/components/notification.d.ts.map +1 -0
- package/lib/theme/components/notification.js +38 -0
- package/lib/theme/components/playSwitch.d.ts +10 -0
- package/lib/theme/components/playSwitch.d.ts.map +1 -0
- package/lib/theme/components/playSwitch.js +14 -0
- package/lib/theme/components/progress.d.ts +10 -0
- package/lib/theme/components/progress.d.ts.map +1 -0
- package/lib/theme/components/progress.js +14 -0
- package/lib/theme/components/selection.d.ts +9 -0
- package/lib/theme/components/selection.d.ts.map +1 -0
- package/lib/theme/components/selection.js +21 -0
- package/lib/theme/components/skeleton.d.ts +11 -0
- package/lib/theme/components/skeleton.d.ts.map +1 -0
- package/lib/theme/components/skeleton.js +18 -0
- package/lib/theme/components/slides.d.ts +7 -0
- package/lib/theme/components/slides.d.ts.map +1 -0
- package/lib/theme/components/slides.js +10 -0
- package/lib/theme/components/text.d.ts +21 -0
- package/lib/theme/components/text.d.ts.map +1 -0
- package/lib/theme/components/text.js +22 -0
- package/lib/theme/components/touchable.d.ts +15 -0
- package/lib/theme/components/touchable.d.ts.map +1 -0
- package/lib/theme/components/touchable.js +41 -0
- package/lib/theme/components/video.d.ts +18 -0
- package/lib/theme/components/video.d.ts.map +1 -0
- package/lib/theme/components/video.js +47 -0
- package/lib/theme/getTheme.d.ts +34 -0
- package/lib/theme/getTheme.d.ts.map +1 -0
- package/lib/theme/getTheme.js +36 -0
- package/lib/theme/index.d.ts +10 -0
- package/lib/theme/index.d.ts.map +1 -0
- package/lib/theme/index.js +7 -0
- package/lib/utils/api/index.d.ts +3 -0
- package/lib/utils/api/index.d.ts.map +1 -0
- package/lib/utils/api/index.js +2 -0
- package/lib/utils/api/keys.d.ts +3 -0
- package/lib/utils/api/keys.d.ts.map +1 -0
- package/lib/utils/api/keys.js +11 -0
- package/lib/utils/api/urls.d.ts +3 -0
- package/lib/utils/api/urls.d.ts.map +1 -0
- package/lib/utils/api/urls.js +8 -0
- package/lib/utils/format/index.d.ts +3 -0
- package/lib/utils/format/index.d.ts.map +1 -0
- package/lib/utils/format/index.js +2 -0
- package/lib/utils/format/text.d.ts +4 -0
- package/lib/utils/format/text.d.ts.map +1 -0
- package/lib/utils/format/text.js +13 -0
- package/lib/utils/haptic/index.d.ts +4 -0
- package/lib/utils/haptic/index.d.ts.map +1 -0
- package/lib/utils/haptic/index.js +3 -0
- package/lib/utils/haptic/types.d.ts +25 -0
- package/lib/utils/haptic/types.d.ts.map +1 -0
- package/lib/utils/haptic/types.js +25 -0
- package/lib/utils/haptic/utils.d.ts +3 -0
- package/lib/utils/haptic/utils.d.ts.map +1 -0
- package/lib/utils/haptic/utils.js +8 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/intl/IntlProvider.d.ts +7 -0
- package/lib/utils/intl/IntlProvider.d.ts.map +1 -0
- package/lib/utils/intl/IntlProvider.js +16 -0
- package/lib/utils/intl/context.d.ts +15 -0
- package/lib/utils/intl/context.d.ts.map +1 -0
- package/lib/utils/intl/context.js +9 -0
- package/lib/utils/intl/global.d.ts +7 -0
- package/lib/utils/intl/global.d.ts.map +1 -0
- package/lib/utils/intl/global.js +1 -0
- package/lib/utils/intl/hooks.d.ts +7 -0
- package/lib/utils/intl/hooks.d.ts.map +1 -0
- package/lib/utils/intl/hooks.js +10 -0
- package/lib/utils/intl/index.d.ts +5 -0
- package/lib/utils/intl/index.d.ts.map +1 -0
- package/lib/utils/intl/index.js +4 -0
- package/lib/utils/intl/state.d.ts +12 -0
- package/lib/utils/intl/state.d.ts.map +1 -0
- package/lib/utils/intl/state.js +14 -0
- package/lib/utils/intl/utils.d.ts +6 -0
- package/lib/utils/intl/utils.d.ts.map +1 -0
- package/lib/utils/intl/utils.js +7 -0
- package/lib/utils/notification/index.d.ts +2 -0
- package/lib/utils/notification/index.d.ts.map +1 -0
- package/lib/utils/notification/index.js +1 -0
- package/lib/utils/notification/toast/constants.d.ts +4 -0
- package/lib/utils/notification/toast/constants.d.ts.map +1 -0
- package/lib/utils/notification/toast/constants.js +7 -0
- package/lib/utils/notification/toast/index.d.ts +3 -0
- package/lib/utils/notification/toast/index.d.ts.map +1 -0
- package/lib/utils/notification/toast/index.js +2 -0
- package/lib/utils/notification/toast/types.d.ts +2 -0
- package/lib/utils/notification/toast/types.d.ts.map +1 -0
- package/lib/utils/notification/toast/types.js +1 -0
- package/lib/utils/notification/toast/utils.d.ts +6 -0
- package/lib/utils/notification/toast/utils.d.ts.map +1 -0
- package/lib/utils/notification/toast/utils.js +23 -0
- package/lib/utils/routes/index.d.ts +4 -0
- package/lib/utils/routes/index.d.ts.map +1 -0
- package/lib/utils/routes/index.js +3 -0
- package/lib/utils/routes/types.d.ts +10 -0
- package/lib/utils/routes/types.d.ts.map +1 -0
- package/lib/utils/routes/types.js +1 -0
- package/lib/utils/routes/utils.d.ts +5 -0
- package/lib/utils/routes/utils.d.ts.map +1 -0
- package/lib/utils/routes/utils.js +3 -0
- package/lib/utils/scale.d.ts +4 -0
- package/lib/utils/scale.d.ts.map +1 -0
- package/lib/utils/scale.js +15 -0
- package/lib/utils/ui/color/index.d.ts +3 -0
- package/lib/utils/ui/color/index.d.ts.map +1 -0
- package/lib/utils/ui/color/index.js +2 -0
- package/lib/utils/ui/color/utils.d.ts +2 -0
- package/lib/utils/ui/color/utils.d.ts.map +1 -0
- package/lib/utils/ui/color/utils.js +9 -0
- package/lib/utils/ui/index.d.ts +2 -0
- package/lib/utils/ui/index.d.ts.map +1 -0
- package/lib/utils/ui/index.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TextProps as NativeTextProps, StyleProp, TextStyle } from 'react-native';
|
|
3
|
+
import type { Color, FontSize, FontWeight, Scale } from '../../theme';
|
|
4
|
+
export interface TextProps extends NativeTextProps {
|
|
5
|
+
/**
|
|
6
|
+
* Text content.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Size of the text.
|
|
11
|
+
*/
|
|
12
|
+
fontSize?: FontSize;
|
|
13
|
+
/**
|
|
14
|
+
* Font weight of the text.
|
|
15
|
+
*/
|
|
16
|
+
fontWeight?: FontWeight;
|
|
17
|
+
/**
|
|
18
|
+
* Visual color to apply to the text.
|
|
19
|
+
*/
|
|
20
|
+
color?: Color;
|
|
21
|
+
/**
|
|
22
|
+
* Additional style.
|
|
23
|
+
*/
|
|
24
|
+
style?: StyleProp<TextStyle>;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the alignment of the text.
|
|
27
|
+
*/
|
|
28
|
+
textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Transform the text.
|
|
31
|
+
*/
|
|
32
|
+
textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase' | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the decoration of the text.
|
|
35
|
+
*/
|
|
36
|
+
textDecorationLine?: 'none' | 'underline' | 'line-through' | 'underline line-through' | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Testing id of the component.
|
|
39
|
+
*/
|
|
40
|
+
testID?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The typeface to render the text in:
|
|
43
|
+
* - `neutral`: The default typeface for the platform.
|
|
44
|
+
*/
|
|
45
|
+
typeface?: keyof Scale['font'];
|
|
46
|
+
/**
|
|
47
|
+
* Whether to render the text with rich text formatting.
|
|
48
|
+
*/
|
|
49
|
+
useRichText?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface TagStyle {
|
|
52
|
+
pattern: RegExp;
|
|
53
|
+
props: Partial<TextProps>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,IAAI,eAAe,EAAG,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD;;OAEG;IACJ,QAAQ,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACJ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACJ,UAAU,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACJ,KAAK,CAAC,EAAE,KAAK,CAAC;IAEb;;OAEG;IACJ,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE5B;;OAEG;IACJ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAExE;;OAEG;IACJ,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;IAE9E;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,wBAAwB,GAAG,SAAS,CAAC;IAEjG;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACJ,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextProps } from './types';
|
|
3
|
+
export declare const withRichText: (BaseText: React.ComponentType<TextProps>) => (props: TextProps & {
|
|
4
|
+
useRichText?: boolean;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=withRichText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withRichText.d.ts","sourceRoot":"","sources":["../../../src/components/Text/withRichText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAwCzC,eAAO,MAAM,YAAY,aAAc,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,aACnC,SAAS,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,4CAatE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import isString from 'lodash/fp/isString';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { SUPPORTED_RICH_TEXT_TAGS } from './constants';
|
|
6
|
+
const processText = (text, BaseText, parentProps) => {
|
|
7
|
+
if (typeof text !== 'string') {
|
|
8
|
+
return text;
|
|
9
|
+
}
|
|
10
|
+
let lastIndex = 0;
|
|
11
|
+
const elements = [];
|
|
12
|
+
SUPPORTED_RICH_TEXT_TAGS.forEach(({ pattern, props }) => {
|
|
13
|
+
const matches = Array.from(text.matchAll(pattern));
|
|
14
|
+
matches.forEach(match => {
|
|
15
|
+
const [fullMatch, content] = match;
|
|
16
|
+
const startIndex = match.index;
|
|
17
|
+
if (startIndex > lastIndex) {
|
|
18
|
+
elements.push(text.slice(lastIndex, startIndex));
|
|
19
|
+
}
|
|
20
|
+
elements.push(_createElement(BaseText, { ...parentProps, ...props, key: startIndex }, content));
|
|
21
|
+
lastIndex = startIndex + fullMatch.length;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
if (lastIndex < text.length) {
|
|
25
|
+
elements.push(text.slice(lastIndex));
|
|
26
|
+
}
|
|
27
|
+
return elements;
|
|
28
|
+
};
|
|
29
|
+
export const withRichText = (BaseText) => {
|
|
30
|
+
return function RichText(props) {
|
|
31
|
+
const { useRichText = false, children, } = props;
|
|
32
|
+
if (!useRichText || !isString(children)) {
|
|
33
|
+
return _jsx(BaseText, { ...props, children: children });
|
|
34
|
+
}
|
|
35
|
+
const processedChildren = processText(children.toString(), BaseText, props);
|
|
36
|
+
return _jsx(BaseText, { ...props, children: processedChildren });
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Touchable/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAWpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwE9C,CAAC;AAEF,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNil } from 'lodash';
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import { Pressable } from 'react-native';
|
|
5
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring, } from 'react-native-reanimated';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { HapticFeedback } from '../../utils';
|
|
8
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
9
|
+
export const Touchable = ({ children, onPress, style, hapticFeedback = 'soft', ...props }) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const themeAnimation = useMemo(() => theme.__hd__.touchable.animation, [theme.__hd__.touchable.animation]);
|
|
12
|
+
const scale = useSharedValue(themeAnimation.maxScale);
|
|
13
|
+
const opacity = useSharedValue(themeAnimation.maxOpacity);
|
|
14
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
15
|
+
return {
|
|
16
|
+
transform: [{ scale: scale.value }],
|
|
17
|
+
opacity: opacity.value,
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const handlePressIn = useCallback(() => {
|
|
21
|
+
scale.value = withSpring(themeAnimation.minScale, {
|
|
22
|
+
mass: themeAnimation.springConfig.mass,
|
|
23
|
+
});
|
|
24
|
+
opacity.value = withSpring(themeAnimation.minOpacity, {
|
|
25
|
+
mass: themeAnimation.springConfig.mass,
|
|
26
|
+
});
|
|
27
|
+
const hapticFeedbackType = theme.__hd__.touchable.hapticFeedbackTypes[hapticFeedback];
|
|
28
|
+
if (!isNil(hapticFeedbackType)) {
|
|
29
|
+
HapticFeedback.trigger(hapticFeedbackType);
|
|
30
|
+
}
|
|
31
|
+
}, [
|
|
32
|
+
hapticFeedback,
|
|
33
|
+
opacity,
|
|
34
|
+
scale,
|
|
35
|
+
themeAnimation.minOpacity,
|
|
36
|
+
themeAnimation.minScale,
|
|
37
|
+
themeAnimation.springConfig.mass,
|
|
38
|
+
theme.__hd__.touchable.hapticFeedbackTypes,
|
|
39
|
+
]);
|
|
40
|
+
const handlePressOut = useCallback(() => {
|
|
41
|
+
scale.value = withSpring(themeAnimation.maxScale, {
|
|
42
|
+
mass: themeAnimation.springConfig.mass,
|
|
43
|
+
});
|
|
44
|
+
opacity.value = withSpring(themeAnimation.maxOpacity, {
|
|
45
|
+
mass: themeAnimation.springConfig.mass,
|
|
46
|
+
});
|
|
47
|
+
}, [
|
|
48
|
+
opacity,
|
|
49
|
+
scale,
|
|
50
|
+
themeAnimation.maxOpacity,
|
|
51
|
+
themeAnimation.maxScale,
|
|
52
|
+
themeAnimation.springConfig.mass,
|
|
53
|
+
]);
|
|
54
|
+
return (_jsx(AnimatedPressable, { onPress: onPress, onPressIn: handlePressIn, onPressOut: handlePressOut, style: [animatedStyle, style], ...props, children: children }));
|
|
55
|
+
};
|
|
56
|
+
export * from './types';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { TouchableHapticFeedbackType } from '../../theme';
|
|
3
|
+
import type { BoxProps } from '../Box';
|
|
4
|
+
export interface TouchableProps extends PressableProps, Omit<BoxProps, 'hitSlop'> {
|
|
5
|
+
/**
|
|
6
|
+
* Haptic feedback type.
|
|
7
|
+
*/
|
|
8
|
+
hapticFeedback?: TouchableHapticFeedbackType;
|
|
9
|
+
/**
|
|
10
|
+
* Touchable's content.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Additional styles.
|
|
15
|
+
*/
|
|
16
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Testing id of the component.
|
|
19
|
+
*/
|
|
20
|
+
testID?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Touchable/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,cACf,SAAQ,cAAc,EACpB,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
declare const StyledControlContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
} & {
|
|
6
|
+
mode: "fullscreen" | "standard";
|
|
7
|
+
}, {}, {
|
|
8
|
+
ref?: import("react").Ref<View> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
declare const StyledControlWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
} & {
|
|
14
|
+
mode: "fullscreen" | "standard";
|
|
15
|
+
}, {}, {
|
|
16
|
+
ref?: import("react").Ref<View> | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
declare const StyledActionButtons: import("@emotion/native").StyledComponent<import("..").BoxProps & {
|
|
19
|
+
ref?: import("react").ForwardedRef<View>;
|
|
20
|
+
} & {
|
|
21
|
+
theme?: import("@emotion/react").Theme;
|
|
22
|
+
as?: React.ElementType;
|
|
23
|
+
} & {
|
|
24
|
+
mode: "fullscreen" | "standard";
|
|
25
|
+
}, {}, {}>;
|
|
26
|
+
declare const StyledSeekBarWrapper: import("@emotion/native").StyledComponent<import("react-native").PressableProps & import("react").RefAttributes<View> & {
|
|
27
|
+
theme?: import("@emotion/react").Theme;
|
|
28
|
+
as?: React.ElementType;
|
|
29
|
+
} & {
|
|
30
|
+
mode: "fullscreen" | "standard";
|
|
31
|
+
}, {}, {}>;
|
|
32
|
+
declare const StyledSeekBar: import("@emotion/native").StyledComponent<import("..").BoxProps & {
|
|
33
|
+
ref?: import("react").ForwardedRef<View>;
|
|
34
|
+
} & {
|
|
35
|
+
theme?: import("@emotion/react").Theme;
|
|
36
|
+
as?: React.ElementType;
|
|
37
|
+
} & {
|
|
38
|
+
mode: "fullscreen" | "standard";
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
declare const StyledTextContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
41
|
+
theme?: import("@emotion/react").Theme;
|
|
42
|
+
as?: React.ElementType;
|
|
43
|
+
} & {
|
|
44
|
+
mode: "fullscreen" | "standard";
|
|
45
|
+
}, {}, {
|
|
46
|
+
ref?: import("react").Ref<View> | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export { StyledControlContainer, StyledControlWrapper, StyledActionButtons, StyledSeekBarWrapper, StyledSeekBar, StyledTextContainer, };
|
|
49
|
+
//# sourceMappingURL=StyledVideoControlManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledVideoControlManager.d.ts","sourceRoot":"","sources":["../../../src/components/Video/StyledVideoControlManager.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAI/C,QAAA,MAAM,sBAAsB;;SAuFojF,MAAO,WAAW;;UAtF1lF,YAAY,GAAG,UAAU;;;EAa/B,CAAC;AAEH,QAAA,MAAM,oBAAoB;;SAuEsjF,MAAO,WAAW;;UAtE1lF,YAAY,GAAG,UAAU;;;EAW/B,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;SAyDk3G,MAAO,WAAW;;UAxDr5G,YAAY,GAAG,UAAU;UAa/B,CAAC;AAEH,QAAA,MAAM,oBAAoB;;SAyCi3G,MAAO,WAAW;;UAxCr5G,YAAY,GAAG,UAAU;UAO/B,CAAC;AAEH,QAAA,MAAM,aAAa;;;;SA+Bw3G,MAAO,WAAW;;UA9Br5G,YAAY,GAAG,UAAU;UAO/B,CAAC;AAGH,QAAA,MAAM,mBAAmB;;SAoBujF,MAAO,WAAW;;UAnB1lF,YAAY,GAAG,UAAU;;;EAS/B,CAAC;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
const StyledControlContainer = styled(View)(({ theme, mode }) => {
|
|
5
|
+
return {
|
|
6
|
+
flex: 1,
|
|
7
|
+
paddingBottom: theme.__hd__.video.videoControlContainerPadding[mode],
|
|
8
|
+
paddingHorizontal: theme.__hd__.video.videoControlContainerPadding[mode],
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
right: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
justifyContent: 'flex-end',
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
const StyledControlWrapper = styled(View)(({ theme, mode }) => {
|
|
18
|
+
return {
|
|
19
|
+
height: mode === 'fullscreen' ? 'auto' : theme.__hd__.video.defaultHeight,
|
|
20
|
+
flex: mode === 'fullscreen' ? 1 : undefined,
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: mode === 'fullscreen' ? 'column' : 'row',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
justifyContent: 'flex-end',
|
|
25
|
+
marginBottom: theme.__hd__.video.defaultSpace,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const StyledActionButtons = styled(Box)(({ theme, mode }) => {
|
|
29
|
+
return {
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
position: mode === 'fullscreen' ? 'absolute' : 'relative',
|
|
34
|
+
top: mode === 'fullscreen' ? 0 : undefined,
|
|
35
|
+
left: mode === 'fullscreen' ? -theme.__hd__.video.defaultSpace : undefined,
|
|
36
|
+
right: mode === 'fullscreen' ? -theme.__hd__.video.defaultSpace : undefined,
|
|
37
|
+
bottom: mode === 'fullscreen' ? 0 : undefined,
|
|
38
|
+
justifyContent: 'space-evenly',
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
const StyledSeekBarWrapper = styled(Pressable)(({ theme, mode }) => {
|
|
42
|
+
return {
|
|
43
|
+
flex: mode === 'fullscreen' ? undefined : 1,
|
|
44
|
+
width: theme.__hd__.video.defaultWidth,
|
|
45
|
+
height: mode === 'fullscreen' ? theme.__hd__.video.defaultHeight : 'auto',
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const StyledSeekBar = styled(Box)(({ theme }) => {
|
|
49
|
+
return {
|
|
50
|
+
marginVertical: 12,
|
|
51
|
+
backgroundColor: theme.colors.grey400,
|
|
52
|
+
borderRadius: 999,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
const StyledTextContainer = styled(View)(({ theme, mode }) => {
|
|
56
|
+
return {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
marginHorizontal: 2,
|
|
60
|
+
marginBottom: mode === 'fullscreen' ? 40 : undefined,
|
|
61
|
+
width: mode === 'fullscreen' ? theme.__hd__.video.defaultWidth : undefined,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
export { StyledControlContainer, StyledControlWrapper, StyledActionButtons, StyledSeekBarWrapper, StyledSeekBar, StyledTextContainer, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const StyledVideoContainer: import("@emotion/native").StyledComponent<import("..").BoxProps & {
|
|
2
|
+
ref?: import("react").ForwardedRef<import("react-native").View>;
|
|
3
|
+
} & {
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
mode: "fullscreen" | "standard";
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
declare const StyledVideoOverlay: import("@emotion/native").StyledComponent<import("..").BoxProps & {
|
|
10
|
+
ref?: import("react").ForwardedRef<import("react-native").View>;
|
|
11
|
+
} & {
|
|
12
|
+
theme?: import("@emotion/react").Theme;
|
|
13
|
+
as?: React.ElementType;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export { StyledVideoContainer, StyledVideoOverlay };
|
|
16
|
+
//# sourceMappingURL=StyledVideoDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledVideoDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Video/StyledVideoDetail.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,oBAAoB;;;;SA2BguK,MAAO,WAAW;;UA1BpwK,YAAY,GAAG,UAAU;UAQ/B,CAAC;AAEH,QAAA,MAAM,kBAAkB;;;;SAgBkuK,MAAO,WAAW;UAJ1wK,CAAC;AAGH,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { Box } from '../Box';
|
|
3
|
+
const StyledVideoContainer = styled(Box)(({ theme, mode }) => {
|
|
4
|
+
return {
|
|
5
|
+
flex: 1,
|
|
6
|
+
backgroundColor: theme.__hd__.video.videoDetailBackgroundColor[mode],
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
const StyledVideoOverlay = styled(Box)(() => {
|
|
12
|
+
return {
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
top: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
right: 0,
|
|
17
|
+
bottom: 0,
|
|
18
|
+
backgroundColor: 'black',
|
|
19
|
+
opacity: 0.4,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
export { StyledVideoContainer, StyledVideoOverlay };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PlaySwitchProps } from '../PlaySwitch/types';
|
|
2
|
+
interface VideoControlManagerProps extends PlaySwitchProps {
|
|
3
|
+
onSeek: (position: number) => void;
|
|
4
|
+
currentPosition?: number;
|
|
5
|
+
duration?: number;
|
|
6
|
+
mode: 'fullscreen' | 'standard';
|
|
7
|
+
}
|
|
8
|
+
declare const VideoControlManager: ({ onSeek, currentPosition, duration, mode, status, onChange, }: VideoControlManagerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default VideoControlManager;
|
|
10
|
+
//# sourceMappingURL=VideoControlManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoControlManager.d.ts","sourceRoot":"","sources":["../../../src/components/Video/VideoControlManager.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D,UAAU,wBAAyB,SAAQ,eAAe;IACxD,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;CACjC;AAED,QAAA,MAAM,mBAAmB,mEAOtB,wBAAwB,4CAkJ1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@emotion/react';
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
|
+
import { Box } from '../Box';
|
|
7
|
+
import { Icon } from '../Icon';
|
|
8
|
+
import { PlaySwitch } from '../PlaySwitch';
|
|
9
|
+
import { Text } from '../Text';
|
|
10
|
+
import { Touchable } from '../Touchable';
|
|
11
|
+
import { StyledActionButtons, StyledControlContainer, StyledControlWrapper, StyledSeekBarWrapper, StyledTextContainer, } from './StyledVideoControlManager';
|
|
12
|
+
const VideoControlManager = ({ onSeek, currentPosition, duration, mode, status, onChange, }) => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const themeVideo = theme.__hd__.video;
|
|
15
|
+
const [position, setPosition] = useState(0);
|
|
16
|
+
const pressableRef = useRef(null);
|
|
17
|
+
const [width, setWidth] = useState(0);
|
|
18
|
+
const innerSeekWidth = useSharedValue(position);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (currentPosition !== undefined &&
|
|
21
|
+
duration !== undefined &&
|
|
22
|
+
duration > 0) {
|
|
23
|
+
const newPosition = width * currentPosition / duration;
|
|
24
|
+
setPosition(newPosition);
|
|
25
|
+
innerSeekWidth.value = withTiming(newPosition, {
|
|
26
|
+
duration: 200,
|
|
27
|
+
easing: Easing.out(Easing.poly(8)),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, [currentPosition, duration, innerSeekWidth, width]);
|
|
31
|
+
const onPressSeekBar = useCallback((event) => {
|
|
32
|
+
if (width === 0) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const touchX = event.nativeEvent.locationX;
|
|
36
|
+
if (duration !== undefined && duration > 0) {
|
|
37
|
+
onSeek(touchX / width * duration);
|
|
38
|
+
}
|
|
39
|
+
}, [width, duration, onSeek]);
|
|
40
|
+
const onForward = useCallback(() => {
|
|
41
|
+
if (duration !== undefined && duration > 0) {
|
|
42
|
+
onSeek(Math.min(currentPosition ? currentPosition + 5 : duration, duration));
|
|
43
|
+
}
|
|
44
|
+
}, [currentPosition, duration, onSeek]);
|
|
45
|
+
const onBackward = useCallback(() => {
|
|
46
|
+
if (duration !== undefined && duration > 0) {
|
|
47
|
+
onSeek(Math.max(currentPosition ? currentPosition - 5 : duration, 0));
|
|
48
|
+
}
|
|
49
|
+
}, [currentPosition, duration, onSeek]);
|
|
50
|
+
const onLayout = useCallback((event) => {
|
|
51
|
+
const { width: newWidth } = event.nativeEvent.layout;
|
|
52
|
+
setWidth(newWidth);
|
|
53
|
+
}, []);
|
|
54
|
+
const innerSeekAnimatedStyle = useAnimatedStyle(() => ({
|
|
55
|
+
width: innerSeekWidth.value,
|
|
56
|
+
}));
|
|
57
|
+
const parseTime = (time) => {
|
|
58
|
+
return time ?
|
|
59
|
+
`${Math.floor(time / 60)}:${('0' + Math.floor(time % 60)).slice(-2)}`
|
|
60
|
+
: '0:00';
|
|
61
|
+
};
|
|
62
|
+
return (_jsx(StyledControlContainer, { mode: mode, children: _jsxs(StyledControlWrapper, { mode: mode, children: [_jsxs(StyledActionButtons, { mode: mode, children: [mode === 'fullscreen' &&
|
|
63
|
+
_jsx(Touchable, { onPress: onBackward, children: _jsx(Icon, { icon: "arrow-left-bold", color: themeVideo.actionColor[mode], size: themeVideo.actionButtonsSize[mode] }) }), _jsx(PlaySwitch, { marginHorizontal: "xxsmall", size: themeVideo.actionButtonsSize[mode], color: themeVideo.actionColor[mode], onChange: onChange, status: status }), mode === 'fullscreen' &&
|
|
64
|
+
_jsx(Touchable, { onPress: onForward, children: _jsx(Icon, { icon: "arrow-right-bold", color: themeVideo.actionColor[mode], size: themeVideo.actionButtonsSize[mode] }) })] }), _jsx(StyledSeekBarWrapper, { ref: pressableRef, onPress: onPressSeekBar, onLayout: onLayout, mode: mode, children: _jsx(Box, { marginVertical: "smallMedium", backgroundColor: "grey400", borderRadius: "rounded", children: _jsx(Animated.View, { style: [innerSeekAnimatedStyle], children: _jsx(Box, { height: "100%", width: "100%", backgroundColor: themeVideo.actionColor[mode], borderRadius: "rounded" }) }) }) }), _jsxs(StyledTextContainer, { mode: mode, children: [_jsx(Text, { color: "grey700", fontSize: "xlarge", fontWeight: "medium", children: parseTime(currentPosition) }), mode !== 'fullscreen' ||
|
|
65
|
+
_jsxs(_Fragment, { children: [_jsx(Box, { flex: 1 }), _jsx(Text, { color: "grey700", fontSize: "xlarge", fontWeight: "medium", children: `-${parseTime((duration ?? 0) - (currentPosition ?? 0))}` })] })] })] }) }));
|
|
66
|
+
};
|
|
67
|
+
export default VideoControlManager;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VideoChatProps } from '../../components/Chat/type';
|
|
3
|
+
import type { VideoRef } from '../../components/Video';
|
|
4
|
+
type VideoDetailProps = VideoChatProps & {
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
initialPosition?: number;
|
|
7
|
+
videoRef: React.RefObject<VideoRef>;
|
|
8
|
+
};
|
|
9
|
+
declare const VideoDetail: React.FC<VideoDetailProps>;
|
|
10
|
+
export default VideoDetail;
|
|
11
|
+
//# sourceMappingURL=VideoDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Video/VideoDetail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOvD,KAAK,gBAAgB,GAAG,cAAc,GAAG;IACvC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;CACrC,CAAC;AAmBF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8K3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import { useTheme } from '@emotion/react';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { Pressable, useWindowDimensions } from 'react-native';
|
|
6
|
+
import Orientation from 'react-native-orientation-locker';
|
|
7
|
+
import { Base, Box, Icon, Touchable } from '../../components';
|
|
8
|
+
import { calculateCanvasSize } from '../../components/Image/utils';
|
|
9
|
+
import { Video } from '../../components/Video';
|
|
10
|
+
import { StyledVideoContainer, StyledVideoOverlay } from './StyledVideoDetail';
|
|
11
|
+
import VideoControlManager from './VideoControlManager';
|
|
12
|
+
const StyledVideo = styled(Video)(({ theme, mode, fullscreenSize, canvasBox }) => {
|
|
13
|
+
return {
|
|
14
|
+
width: mode === 'fullscreen' ? fullscreenSize.width : canvasBox.width,
|
|
15
|
+
height: mode === 'fullscreen' ? fullscreenSize.height : canvasBox.height ?? -theme.spaces.xxlarge,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
const VideoDetail = ({ source, width, height, videoRef, initialPosition, onBack, }) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const themeVideo = theme.__hd__.video;
|
|
21
|
+
const [boxWidth, setBoxWidth] = useState(0);
|
|
22
|
+
const [boxHeight, setBoxHeight] = useState(0);
|
|
23
|
+
const [mode, setMode] = useState('standard');
|
|
24
|
+
const [play, setPlay] = useState(true);
|
|
25
|
+
const [seeking, setSeeking] = useState(false);
|
|
26
|
+
const [currentPosition, setCurrentPosition] = useState(0);
|
|
27
|
+
const [duration, setDuration] = useState(0);
|
|
28
|
+
const [showControl, setShowControl] = useState(true);
|
|
29
|
+
const [canvasBox, setCanvasBox] = useState({
|
|
30
|
+
width: undefined,
|
|
31
|
+
height: undefined,
|
|
32
|
+
});
|
|
33
|
+
const windowDimension = useWindowDimensions();
|
|
34
|
+
if (!source) {
|
|
35
|
+
return _jsx(_Fragment, {});
|
|
36
|
+
}
|
|
37
|
+
const fullscreenSize = calculateCanvasSize(width, height, windowDimension.width, 1, windowDimension.width / windowDimension.height);
|
|
38
|
+
const onLayout = (event) => {
|
|
39
|
+
const { width: sWidth, height: sHeight } = event.nativeEvent.layout;
|
|
40
|
+
if (width !== boxWidth || height !== boxHeight) {
|
|
41
|
+
setBoxWidth(sWidth);
|
|
42
|
+
setBoxHeight(sHeight);
|
|
43
|
+
setCanvasBox(calculateCanvasSize(width, height, sWidth, 1, (sHeight > 0) ? sWidth / sHeight : undefined));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const handlePlaySwitchStatus = () => {
|
|
47
|
+
if (play) {
|
|
48
|
+
pauseAllStates();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
videoRef.current?.resume();
|
|
52
|
+
setPlay(true);
|
|
53
|
+
setTimeout(() => setShowControl(false), 2000);
|
|
54
|
+
};
|
|
55
|
+
const pauseAllStates = () => {
|
|
56
|
+
videoRef.current?.pause();
|
|
57
|
+
setPlay(false);
|
|
58
|
+
setShowControl(true);
|
|
59
|
+
};
|
|
60
|
+
const handleSeek = (position) => {
|
|
61
|
+
setSeeking(true);
|
|
62
|
+
setCurrentPosition(position);
|
|
63
|
+
videoRef.current?.seek(position);
|
|
64
|
+
};
|
|
65
|
+
const handleProgress = (position) => {
|
|
66
|
+
if (seeking) {
|
|
67
|
+
setSeeking(false);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
setCurrentPosition(position);
|
|
71
|
+
};
|
|
72
|
+
const handleControls = () => {
|
|
73
|
+
if (showControl) {
|
|
74
|
+
setShowControl(false);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
setShowControl(true);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const handleInit = (e) => {
|
|
81
|
+
setDuration(e.duration);
|
|
82
|
+
};
|
|
83
|
+
const changeToFullscreen = () => {
|
|
84
|
+
if (mode === 'standard') {
|
|
85
|
+
setMode('fullscreen');
|
|
86
|
+
setShowControl(true);
|
|
87
|
+
if (width && height && width > height) {
|
|
88
|
+
Orientation.lockToLandscape();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const exitFullscreen = () => {
|
|
93
|
+
if (mode === 'fullscreen') {
|
|
94
|
+
setMode('standard');
|
|
95
|
+
Orientation.lockToPortrait();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return (_jsxs(Base, { flex: 1, padding: themeVideo.videoDetailBasePadding[mode], children: [_jsxs(StyledVideoContainer, { mode: mode, onLayout: mode === 'fullscreen' ? undefined : onLayout, children: [_jsx(Pressable, { onPress: mode === 'fullscreen' ? handleControls : changeToFullscreen, children: _jsx(Box, { borderRadius: themeVideo.videoDetailBorderRadius[mode], width: mode === 'fullscreen' ? fullscreenSize.width : canvasBox.width, height: mode === 'fullscreen' ? fullscreenSize.height : canvasBox.height ?? -theme.spaces.xxlarge, overflow: "hidden", children: _jsx(StyledVideo, { ref: videoRef, source: source, initialPosition: initialPosition, initialPlay: true, mode: mode, fullscreenSize: fullscreenSize, canvasBox: canvasBox, theme: theme, tracking: handleProgress, onInit: handleInit }) }) }), (showControl && mode === 'fullscreen') &&
|
|
99
|
+
_jsx(StyledVideoOverlay, { children: _jsx(Touchable, { onPress: handleControls, flex: 1 }) })] }), (showControl || mode !== 'fullscreen') &&
|
|
100
|
+
_jsx(VideoControlManager, { status: play ? 'pause' : 'play', onChange: handlePlaySwitchStatus, onSeek: handleSeek, currentPosition: currentPosition, duration: duration, mode: mode }), _jsx(Box, { position: "absolute", top: 0, left: 0, padding: "large", children: _jsx(Touchable, { onPress: mode === 'fullscreen' ? exitFullscreen : onBack, children: _jsx(Icon, { art: "arrow-left-light", size: themeVideo.defaultActionIconSize, color: themeVideo.videoDetailActionButtonColor[mode] }) }) })] }));
|
|
101
|
+
};
|
|
102
|
+
export default VideoDetail;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ForwardedRef } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { OnLoadData, ReactVideoSourceProperties, VideoRef as RNVideoRef } from 'react-native-video';
|
|
4
|
+
export interface VideoProps {
|
|
5
|
+
source: Readonly<Omit<ReactVideoSourceProperties, 'uri'> & {
|
|
6
|
+
uri?: string | NodeRequire | undefined;
|
|
7
|
+
}> | undefined;
|
|
8
|
+
initialPosition?: number;
|
|
9
|
+
initialPlay?: boolean;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
afterEnd?: () => void;
|
|
12
|
+
tracking?: (currentTime: number) => void;
|
|
13
|
+
onInit?: (e: OnLoadData) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface VideoRef extends Pick<RNVideoRef, 'seek' | 'pause' | 'resume'> {
|
|
16
|
+
play: boolean;
|
|
17
|
+
currentTime: number;
|
|
18
|
+
duration: number;
|
|
19
|
+
}
|
|
20
|
+
declare const PlainVideo: ({ source, initialPosition, initialPlay, style, afterEnd, tracking, onInit, }: VideoProps, ref: React.Ref<VideoRef>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const Video: (props: VideoProps & {
|
|
22
|
+
ref?: ForwardedRef<VideoRef>;
|
|
23
|
+
}) => ReturnType<typeof PlainVideo>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Video/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,UAAU,EAEV,0BAA0B,EAC1B,QAAQ,IAAI,UAAU,EACvB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,GAAG;QACzD,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;KACxC,CAAC,GAAG,SAAS,CAAC;IAEf,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7E,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,iFAQb,UAAU,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,4CAiEtC,CAAC;AAEF,eAAO,MAAM,KAAK,EAA6B,CAC7C,KAAK,EAAE,UAAU,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAAE,KACjD,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|