@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,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import { isNumber, isString } from 'lodash';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { Text, View } from 'react-native';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { Box } from '../Box';
|
|
8
|
+
import { getArtDimensionValue, isEmoji } from './utils';
|
|
9
|
+
const StyledEmoji = styled(Text)(({ theme, emojiSize }) => ({
|
|
10
|
+
fontFamily: theme.fonts.neutral.regular,
|
|
11
|
+
fontSize: emojiSize ? emojiSize / theme.__hd__.art.emoji.scale : undefined,
|
|
12
|
+
color: theme.colors.black,
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
textAlign: 'center',
|
|
16
|
+
lineHeight: emojiSize,
|
|
17
|
+
transform: [{ scale: theme.__hd__.art.emoji.scale }],
|
|
18
|
+
}));
|
|
19
|
+
export const EmojiArt = ({ art: emoji, width, height, size, ...otherProps }) => {
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
const widthValue = useMemo(() => getArtDimensionValue(theme, width, size), [theme, width, size]);
|
|
22
|
+
const heightValue = useMemo(() => getArtDimensionValue(theme, height, size), [height, size, theme]);
|
|
23
|
+
const loading = !isString(emoji) || !isEmoji(emoji);
|
|
24
|
+
return (_jsx(Box, { flexDirection: "column", justifyContent: "center", alignItems: "center", width: isNumber(widthValue) ? widthValue : undefined, height: isNumber(heightValue) ? heightValue : undefined, ...otherProps, children: _jsx(View, { children: _jsx(StyledEmoji, { emojiSize: isNumber(widthValue) ? widthValue : undefined, children: !loading && emoji }) }) }));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconArt.d.ts","sourceRoot":"","sources":["../../../src/components/Art/IconArt.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,OAAO,wCAKjB,YAAY,4CA2Cd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import MaskedView from '@react-native-masked-view/masked-view';
|
|
3
|
+
import { isNil, omit } from 'lodash';
|
|
4
|
+
import { useEffect, useMemo } from 'react';
|
|
5
|
+
import { isGradientColor, useTheme } from '../../theme';
|
|
6
|
+
import { Box } from '../Box';
|
|
7
|
+
import { Gradient } from '../Gradient';
|
|
8
|
+
import { Icon, isSimpledAIIcon } from '../Icon';
|
|
9
|
+
import { getArtDimensionValue } from './utils';
|
|
10
|
+
export const IconArt = ({ art, size, color = 'grey900', ...otherProps }) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const themeArtIcon = useMemo(() => theme.__hd__.art.icon, [theme]);
|
|
13
|
+
const sizeValue = useMemo(() => getArtDimensionValue(theme, size, size), [theme, size]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (isNil(size)) {
|
|
16
|
+
throw new Error('Size is required for IconArt');
|
|
17
|
+
}
|
|
18
|
+
if (!isSimpledAIIcon(art)) {
|
|
19
|
+
throw new Error('IconArt only supports simple AI icons');
|
|
20
|
+
}
|
|
21
|
+
}, [art, size]);
|
|
22
|
+
if (isGradientColor(color)) {
|
|
23
|
+
return (_jsx(Box, { ...omit(otherProps, ['width', 'height', 'fit']), children: _jsx(MaskedView, { maskElement: _jsx(Icon, { icon: art, size: sizeValue, color: "grey900" }), children: _jsx(Gradient, { gradient: color, start: themeArtIcon.gradientStart, end: themeArtIcon.gradientEnd, children: _jsx(Box, { opacity: 0, children: _jsx(Icon, { icon: art, size: sizeValue }) }) }) }) }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsx(Box, { ...omit(otherProps, ['width', 'height', 'fit']), children: _jsx(Icon, { icon: art, size: sizeValue, color: color }) }));
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageArt.d.ts","sourceRoot":"","sources":["../../../src/components/Art/ImageArt.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,eAAO,MAAM,QAAQ,4DAQlB,aAAa,4CA2Df,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import { Canvas, Image, Mask, rect, Rect, useImage, } from '@shopify/react-native-skia';
|
|
4
|
+
import { isNil } from 'lodash';
|
|
5
|
+
import isString from 'lodash/fp/isString';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { isColor, useTheme } from '../../theme';
|
|
8
|
+
import { Box } from '../Box';
|
|
9
|
+
import { Skeleton } from '../Skeleton';
|
|
10
|
+
import { getArtDimensionValue, isRemoteSource } from './utils';
|
|
11
|
+
const StyledCanvas = styled(Canvas) `
|
|
12
|
+
flex: 1;
|
|
13
|
+
`;
|
|
14
|
+
export const ImageArt = ({ art, width, height, size, fit, color, ...otherProps }) => {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const image = useImage(art);
|
|
17
|
+
const widthValue = useMemo(() => getArtDimensionValue(theme, width, size) || 0, [theme, width, size]);
|
|
18
|
+
const heightValue = useMemo(() => getArtDimensionValue(theme, height, size) || 0, [height, size, theme]);
|
|
19
|
+
const Container = isString(art) && isRemoteSource(art) ? Skeleton : Box;
|
|
20
|
+
if (!isNil(color) && isColor(color)) {
|
|
21
|
+
return (_jsx(Container, { loading: isNil(image), ...otherProps, children: _jsx(Box, { width: widthValue, height: heightValue, children: _jsx(StyledCanvas, { children: _jsx(Mask, { mask: _jsx(Image, { image: image, x: 0, y: 0, fit: fit, width: widthValue, height: heightValue }), children: _jsx(Rect, { color: theme.colors[color], rect: rect(0, 0, widthValue, heightValue) }) }) }) }) }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsx(Container, { loading: isNil(image), ...otherProps, children: _jsx(Box, { width: widthValue, height: heightValue, children: _jsx(StyledCanvas, { children: _jsx(Image, { image: image, x: 0, y: 0, fit: fit, width: widthValue, height: heightValue }) }) }) }));
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgArt.d.ts","sourceRoot":"","sources":["../../../src/components/Art/SvgArt.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAO3C,eAAO,MAAM,MAAM,iFAShB,WAAW,4CAyFb,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import { Canvas, fitbox, Group, ImageSVG, rect, Skia, useSVG, } from '@shopify/react-native-skia';
|
|
4
|
+
import { isNil, isString, omit } from 'lodash';
|
|
5
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
+
import { useDerivedValue } from 'react-native-reanimated';
|
|
7
|
+
import { useTheme } from '../../theme';
|
|
8
|
+
import { Box } from '../Box';
|
|
9
|
+
import { Skeleton } from '../Skeleton';
|
|
10
|
+
import { getArtDimensionValue, isRemoteSource } from './utils';
|
|
11
|
+
const StyledCanvas = styled(Canvas) `
|
|
12
|
+
flex: 1;
|
|
13
|
+
`;
|
|
14
|
+
export const SvgArt = ({ art, width, height, size, fit = 'fill', useAnimated, animatedStyle, ...otherProps }) => {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const [svgArt, setSvgArt] = useState();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isString(art) && isRemoteSource(art)) {
|
|
19
|
+
fetch(art)
|
|
20
|
+
.then(response => response.text())
|
|
21
|
+
.then(data => setSvgArt(data))
|
|
22
|
+
.catch(error => {
|
|
23
|
+
console.error('Failed to fetch SVG:', error);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
setSvgArt(undefined);
|
|
28
|
+
}
|
|
29
|
+
}, [art]);
|
|
30
|
+
const widthValue = useMemo(() => getArtDimensionValue(theme, width, size) || 0, [theme, width, size]);
|
|
31
|
+
const heightValue = useMemo(() => getArtDimensionValue(theme, height, size) || 0, [height, size, theme]);
|
|
32
|
+
const localSvg = useSVG(art);
|
|
33
|
+
const svg = useMemo(() => (isString(art) && isRemoteSource(art) && !isNil(svgArt)
|
|
34
|
+
? Skia.SVG.MakeFromString(svgArt)
|
|
35
|
+
: localSvg), [art, localSvg, svgArt]);
|
|
36
|
+
const svgWidth = useMemo(() => svg?.width(), [svg]);
|
|
37
|
+
const svgHeight = useMemo(() => svg?.height(), [svg]);
|
|
38
|
+
const src = useMemo(() => rect(0, 0, svgWidth || 0, svgHeight || 0), [svgWidth, svgHeight]);
|
|
39
|
+
const dst = useMemo(() => rect(0, 0, widthValue || 0, heightValue || 0), [heightValue, widthValue]);
|
|
40
|
+
const fitboxValue = useDerivedValue(() => useAnimated ? [
|
|
41
|
+
{
|
|
42
|
+
scaleX: svgWidth ? width.value / svgWidth : 0,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
scaleY: svgHeight ? height.value / svgHeight : 0,
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
: undefined, [height, width, useAnimated, svgWidth, svgHeight]);
|
|
49
|
+
const Container = isString(art) && isRemoteSource(art) ? Skeleton : Box;
|
|
50
|
+
return (_jsx(Container, { loading: isNil(svg), ...omit(otherProps, ['fit']), children: _jsx(Box, { width: !useAnimated ? widthValue : undefined, height: !useAnimated ? heightValue : undefined, useAnimated: useAnimated, animatedStyle: animatedStyle, children: _jsx(StyledCanvas, { children: !isNil(svg) && (_jsx(Group, { transform: useAnimated ? fitboxValue : fitbox(fit, src, dst), children: _jsx(ImageSVG, { svg: svg, x: 0, y: 0, width: useAnimated ? width : widthValue, height: useAnimated ? height : heightValue }) })) }) }) }));
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Art/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,WAAW,QAC+M,CAAC;AAExO,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAIpD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const EMOJI_REGEX = /[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F1E6}-\u{1F1FF}]/u;
|
|
2
|
+
export const BRAND_ARTS = {
|
|
3
|
+
facebook: require('../../assets/svg/brand-logo/facebook.svg'),
|
|
4
|
+
google: require('../../assets/svg/brand-logo/google.svg'),
|
|
5
|
+
apple: require('../../assets/svg/brand-logo/apple.svg'),
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/components/Art/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,4BAA4B,SACjC,MAAM,GAAG,IAAI,GAAG,SAAS,SACxB,MAAM,GAAG,IAAI,GAAG,SAAS,UACxB,MAAM,GAAG,IAAI,GAAG,SAAS,SAQlC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const useSizeWidthHeightValidation = (size, width, height) => {
|
|
2
|
+
if (size !== undefined && (width !== undefined || height !== undefined)) {
|
|
3
|
+
throw new Error('size cannot be used with width or height');
|
|
4
|
+
}
|
|
5
|
+
if (size === undefined && width === undefined && height === undefined) {
|
|
6
|
+
throw new Error('size or width and height must be provided');
|
|
7
|
+
}
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BrandArt as Brand } from './BrandArt';
|
|
2
|
+
import { EmojiArt as Emoji } from './EmojiArt';
|
|
3
|
+
import { IconArt as Icon } from './IconArt';
|
|
4
|
+
import { ImageArt as Image } from './ImageArt';
|
|
5
|
+
import { SvgArt as Svg } from './SvgArt';
|
|
6
|
+
import type { ArtProps } from './types';
|
|
7
|
+
export declare const Art: (props: ArtProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export * from './types';
|
|
9
|
+
export { Image, Svg, Emoji, Icon, Brand };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Art/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACV,QAAQ,EAMT,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,GAAG,UAAW,QAAQ,4CAkBlC,CAAC;AAEF,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isString } from 'lodash';
|
|
3
|
+
import { BrandArt as Brand } from './BrandArt';
|
|
4
|
+
import { EmojiArt as Emoji } from './EmojiArt';
|
|
5
|
+
import { IconArt as Icon } from './IconArt';
|
|
6
|
+
import { ImageArt as Image } from './ImageArt';
|
|
7
|
+
import { SvgArt as Svg } from './SvgArt';
|
|
8
|
+
import { isEmoji, isIcon, isImage, isSvg } from './utils';
|
|
9
|
+
export const Art = (props) => {
|
|
10
|
+
const { art, type } = props;
|
|
11
|
+
if (type === 'image' || (isString(art) && isImage(art))) {
|
|
12
|
+
return Image(props);
|
|
13
|
+
}
|
|
14
|
+
if (type === 'svg' || (isString(art) && isSvg(art))) {
|
|
15
|
+
return Svg(props);
|
|
16
|
+
}
|
|
17
|
+
if (type === 'emoji' || (isString(art) && isEmoji(art))) {
|
|
18
|
+
return Emoji(props);
|
|
19
|
+
}
|
|
20
|
+
if (type === 'icon' || (isString(art) && isIcon(art))) {
|
|
21
|
+
return Icon(props);
|
|
22
|
+
}
|
|
23
|
+
if (type === 'brand') {
|
|
24
|
+
return Brand(props);
|
|
25
|
+
}
|
|
26
|
+
return _jsx(_Fragment, {});
|
|
27
|
+
};
|
|
28
|
+
export * from './types';
|
|
29
|
+
export { Image, Svg, Emoji, Icon, Brand };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { DataSource, Fit } from '@shopify/react-native-skia';
|
|
2
|
+
import type { StyleProp } from 'react-native';
|
|
3
|
+
import type { AnimatedStyle, SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import type { Color, GradientColor, Size } from '../../theme';
|
|
5
|
+
import type { BorderWidthsPropsKeyType, BoxProps, CustomBoxPropsKeyType, RadiiPropsKeyType, SpacePropsKeyType } from '../Box';
|
|
6
|
+
import type { IconName } from '../Icon';
|
|
7
|
+
export type ArtType = 'image' | 'svg' | 'emoji' | 'icon' | 'brand';
|
|
8
|
+
export type CommonArtProps = Omit<Pick<BoxProps, SpacePropsKeyType | RadiiPropsKeyType | BorderWidthsPropsKeyType | CustomBoxPropsKeyType>, 'width' | 'height' | 'size' | 'animatedStyle' | 'useAnimated'>;
|
|
9
|
+
export type IconArtProps = CommonArtProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Art of the Icon Art.
|
|
12
|
+
*/
|
|
13
|
+
art: IconName;
|
|
14
|
+
/**
|
|
15
|
+
* Type of the Art.
|
|
16
|
+
*/
|
|
17
|
+
type?: 'icon';
|
|
18
|
+
/**
|
|
19
|
+
* Color of the Icon.
|
|
20
|
+
*/
|
|
21
|
+
color?: Color | GradientColor | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Size of the Icon, if width and height are the same.
|
|
24
|
+
*/
|
|
25
|
+
size?: Size | number | undefined;
|
|
26
|
+
};
|
|
27
|
+
export type AnimatedArtProps = {
|
|
28
|
+
/**
|
|
29
|
+
* If true, the Art will use the Animated API from react-native-reanimated.
|
|
30
|
+
*/
|
|
31
|
+
useAnimated: true;
|
|
32
|
+
/**
|
|
33
|
+
* Additional styles for the animated box. Only used if `useAnimated` is true.
|
|
34
|
+
*/
|
|
35
|
+
animatedStyle?: StyleProp<AnimatedStyle> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Width of the Art.
|
|
38
|
+
*/
|
|
39
|
+
width: SharedValue<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Height of the Art.
|
|
42
|
+
*/
|
|
43
|
+
height: SharedValue<number>;
|
|
44
|
+
/**
|
|
45
|
+
* Size of the Art, if width and height are the same.
|
|
46
|
+
*/
|
|
47
|
+
size?: undefined;
|
|
48
|
+
};
|
|
49
|
+
export type NonAnimatedArtProps = {
|
|
50
|
+
/**
|
|
51
|
+
* If true, the Art will use the Animated API from react-native-reanimated.
|
|
52
|
+
*/
|
|
53
|
+
useAnimated?: false | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Additional styles for the animated box. Only used if `useAnimated` is true.
|
|
56
|
+
*/
|
|
57
|
+
animatedStyle?: undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Size of the Art, if width and height are the same.
|
|
60
|
+
*/
|
|
61
|
+
size?: number | Size | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Width of the Art.
|
|
64
|
+
*/
|
|
65
|
+
width?: number | Size | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Height of the Art.
|
|
68
|
+
*/
|
|
69
|
+
height?: number | Size | undefined;
|
|
70
|
+
};
|
|
71
|
+
export type ImageArtProps = CommonArtProps & {
|
|
72
|
+
/**
|
|
73
|
+
* Art of the Image.
|
|
74
|
+
*/
|
|
75
|
+
art: DataSource;
|
|
76
|
+
/**
|
|
77
|
+
* Type of the Image.
|
|
78
|
+
*/
|
|
79
|
+
type?: 'image';
|
|
80
|
+
/**
|
|
81
|
+
* Width of the Image.
|
|
82
|
+
*/
|
|
83
|
+
width?: Size | number | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Height of the Image.
|
|
86
|
+
*/
|
|
87
|
+
height?: Size | number | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Size of the Image, if width and height are the same.
|
|
90
|
+
*/
|
|
91
|
+
size?: Size | number | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Fit of the Image.
|
|
94
|
+
*/
|
|
95
|
+
fit?: Fit;
|
|
96
|
+
/**
|
|
97
|
+
* Color of the Image.
|
|
98
|
+
*/
|
|
99
|
+
color?: Color | GradientColor | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Overflow of the Image.
|
|
102
|
+
*/
|
|
103
|
+
overflow?: 'hidden' | 'visible' | 'scroll' | undefined;
|
|
104
|
+
};
|
|
105
|
+
export type SvgArtProps = CommonArtProps & (AnimatedArtProps | NonAnimatedArtProps) & {
|
|
106
|
+
/**
|
|
107
|
+
* Art of the Svg.
|
|
108
|
+
*/
|
|
109
|
+
art: DataSource;
|
|
110
|
+
/**
|
|
111
|
+
* Type of the Svg.
|
|
112
|
+
*/
|
|
113
|
+
type?: 'svg';
|
|
114
|
+
/**
|
|
115
|
+
* Fit of the Svg.
|
|
116
|
+
*/
|
|
117
|
+
fit?: Fit;
|
|
118
|
+
};
|
|
119
|
+
export type EmojiArtProps = CommonArtProps & {
|
|
120
|
+
/**
|
|
121
|
+
* Art of the Emoji.
|
|
122
|
+
*/
|
|
123
|
+
art: string;
|
|
124
|
+
/**
|
|
125
|
+
* Type of the Emoji.
|
|
126
|
+
*/
|
|
127
|
+
type?: 'emoji';
|
|
128
|
+
/**
|
|
129
|
+
* Width of the Emoji.
|
|
130
|
+
*/
|
|
131
|
+
width?: Size | number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Height of the Emoji.
|
|
134
|
+
*/
|
|
135
|
+
height?: Size | number | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Size of the Emoji, if width and height are the same.
|
|
138
|
+
*/
|
|
139
|
+
size?: Size | number | undefined;
|
|
140
|
+
};
|
|
141
|
+
export type BrandType = 'facebook' | 'google' | 'apple';
|
|
142
|
+
export type BrandArtProps = CommonArtProps & {
|
|
143
|
+
/**
|
|
144
|
+
* Type of the Brand.
|
|
145
|
+
*/
|
|
146
|
+
type?: 'brand';
|
|
147
|
+
/**
|
|
148
|
+
* Art of the Brand.
|
|
149
|
+
*/
|
|
150
|
+
art: BrandType;
|
|
151
|
+
/**
|
|
152
|
+
* Size of the Brand, if width and height are the same.
|
|
153
|
+
*/
|
|
154
|
+
size?: Size | number | undefined;
|
|
155
|
+
};
|
|
156
|
+
export type ArtProps = IconArtProps | ImageArtProps | SvgArtProps | EmojiArtProps | BrandArtProps;
|
|
157
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Art/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { Size, Theme } from '../../theme';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if the image source is a remote URL.
|
|
5
|
+
* @param {string} src - The source string of the image.
|
|
6
|
+
* @return {boolean} - Returns true if the source is a remote URL, false if it is local.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isRemoteSource: (src: string) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the image source is a local asset.
|
|
11
|
+
* @param {string} src - The source string of the image.
|
|
12
|
+
* @return {boolean} - Returns true if the source is a local asset, false if it is a remote URL.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isLocalSource: (src: string) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the image source is an emoji.
|
|
17
|
+
* @param {string} art - The source string of the image.
|
|
18
|
+
* @return {boolean} - Returns true if the source is an emoji, false otherwise.
|
|
19
|
+
*/
|
|
20
|
+
export declare const isEmoji: (art: string) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the image source is an icon.
|
|
23
|
+
* @param {string} art - The source string of the image.
|
|
24
|
+
* @return {boolean} - Returns true if the source is an icon, false otherwise.
|
|
25
|
+
*/
|
|
26
|
+
export declare const isIcon: (art: string) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the image source is a SVG file.
|
|
29
|
+
* @param {string} art - The source string of the image.
|
|
30
|
+
* @return {boolean} - Returns true if the source is a SVG file, false otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export declare const isSvg: (art: string) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the image source is an image file.
|
|
35
|
+
* @param {string} art - The source string of the image.
|
|
36
|
+
* @return {boolean} - Returns true if the source is an image file, false otherwise.
|
|
37
|
+
*/
|
|
38
|
+
export declare const isImage: (art: string) => boolean;
|
|
39
|
+
export declare const getArtDimensionValue: (theme: Theme, dimensionValue: Size | SharedValue<number> | number | undefined, size: Size | SharedValue<number> | number | undefined) => number | undefined;
|
|
40
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Art/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAK/C;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,OAI5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,OAA+B,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,OAErC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,QAAS,MAAM,KAAG,OAEpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,QAAS,MAAM,KAAG,OAGnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,YAGlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,UACxB,KAAK,kBACI,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,QACzD,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,KACpD,MAAM,GAAG,SAcX,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { isNumber, isString } from 'lodash';
|
|
2
|
+
import { isSharedValue } from 'react-native-reanimated';
|
|
3
|
+
import { isSize } from '../../theme';
|
|
4
|
+
import { isSimpledAIIcon } from '../Icon';
|
|
5
|
+
import { EMOJI_REGEX } from './constants';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if the image source is a remote URL.
|
|
8
|
+
* @param {string} src - The source string of the image.
|
|
9
|
+
* @return {boolean} - Returns true if the source is a remote URL, false if it is local.
|
|
10
|
+
*/
|
|
11
|
+
export const isRemoteSource = (src) => {
|
|
12
|
+
// Regular expression to check if the source starts with 'http', 'https', or 'ftp'
|
|
13
|
+
const remoteUrlPattern = /^(http:|https:|ftp:)/i;
|
|
14
|
+
return remoteUrlPattern.test(src);
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the image source is a local asset.
|
|
18
|
+
* @param {string} src - The source string of the image.
|
|
19
|
+
* @return {boolean} - Returns true if the source is a local asset, false if it is a remote URL.
|
|
20
|
+
*/
|
|
21
|
+
export const isLocalSource = (src) => !isRemoteSource(src);
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the image source is an emoji.
|
|
24
|
+
* @param {string} art - The source string of the image.
|
|
25
|
+
* @return {boolean} - Returns true if the source is an emoji, false otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export const isEmoji = (art) => {
|
|
28
|
+
return EMOJI_REGEX.test(art);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Checks if the image source is an icon.
|
|
32
|
+
* @param {string} art - The source string of the image.
|
|
33
|
+
* @return {boolean} - Returns true if the source is an icon, false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
export const isIcon = (art) => {
|
|
36
|
+
return isSimpledAIIcon(art);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Checks if the image source is a SVG file.
|
|
40
|
+
* @param {string} art - The source string of the image.
|
|
41
|
+
* @return {boolean} - Returns true if the source is a SVG file, false otherwise.
|
|
42
|
+
*/
|
|
43
|
+
export const isSvg = (art) => {
|
|
44
|
+
const svgPattern = /\.svg$/i;
|
|
45
|
+
return svgPattern.test(art);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Checks if the image source is an image file.
|
|
49
|
+
* @param {string} art - The source string of the image.
|
|
50
|
+
* @return {boolean} - Returns true if the source is an image file, false otherwise.
|
|
51
|
+
*/
|
|
52
|
+
export const isImage = (art) => {
|
|
53
|
+
const imagePattern = /\.(jpeg|jpg|gif|png|bmp|tiff)$/i;
|
|
54
|
+
return imagePattern.test(art);
|
|
55
|
+
};
|
|
56
|
+
export const getArtDimensionValue = (theme, dimensionValue, size) => {
|
|
57
|
+
if (isSharedValue(dimensionValue) || isSharedValue(size)) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const value = dimensionValue || size;
|
|
61
|
+
if (isNumber(value)) {
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
if (isString(value) && isSize(value)) {
|
|
65
|
+
return theme.sizes[value];
|
|
66
|
+
}
|
|
67
|
+
return theme.sizes[theme.__hd__.art.defaultSize];
|
|
68
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface AvatarWrapperProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
editable?: boolean;
|
|
4
|
+
followable?: boolean;
|
|
5
|
+
followed?: boolean;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
onAvatarChange?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AvatarWrapper: ({ children, editable, followable, loading, onAvatarChange, }: AvatarWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=Wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Wrapper.tsx"],"names":[],"mappings":"AAaA,UAAU,kBAAkB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,iEAMvB,kBAAkB,4CAsEpB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { uuidv4 } from '@firebase/util';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { openCropper, openPicker } from 'react-native-image-crop-picker';
|
|
5
|
+
import { auth } from '../../auth';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { Toast } from '../../utils';
|
|
8
|
+
import { Box } from '../Box';
|
|
9
|
+
import { Loading } from '../Loading';
|
|
10
|
+
import { Touchable } from '../Touchable';
|
|
11
|
+
import { useUploadCloudinaryImageApi } from './apiCalls/useUploadCloudinaryImageApi';
|
|
12
|
+
export const AvatarWrapper = ({ children, editable, followable, loading = false, onAvatarChange, }) => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const [isSelectingAvatar, setIsSelectingAvatar] = useState(false);
|
|
15
|
+
const { uploadImage } = useUploadCloudinaryImageApi({
|
|
16
|
+
onError: () => {
|
|
17
|
+
setIsSelectingAvatar(false);
|
|
18
|
+
Toast.error('Failed to upload avatar');
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const handleOpenPicker = async () => {
|
|
22
|
+
const { path } = await openPicker({
|
|
23
|
+
multiple: false,
|
|
24
|
+
cropperCircleOverlay: true,
|
|
25
|
+
mediaType: 'photo',
|
|
26
|
+
includeExif: true,
|
|
27
|
+
});
|
|
28
|
+
return await openCropper({
|
|
29
|
+
path,
|
|
30
|
+
width: theme.__hd__.avatar.defaultRequiredSize,
|
|
31
|
+
height: theme.__hd__.avatar.defaultRequiredSize,
|
|
32
|
+
includeExif: true,
|
|
33
|
+
mediaType: 'photo',
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const handleSelectAvatar = async () => {
|
|
37
|
+
try {
|
|
38
|
+
setIsSelectingAvatar(true);
|
|
39
|
+
const croppedAvatar = await handleOpenPicker();
|
|
40
|
+
const avatarPublicId = uuidv4();
|
|
41
|
+
await uploadImage({
|
|
42
|
+
path: croppedAvatar.path,
|
|
43
|
+
publicId: avatarPublicId,
|
|
44
|
+
});
|
|
45
|
+
const imageUrl = `https://res.cloudinary.com/dqgkul2ur/image/upload/${avatarPublicId}`;
|
|
46
|
+
await auth.currentUser?.updateProfile({
|
|
47
|
+
photoURL: imageUrl,
|
|
48
|
+
});
|
|
49
|
+
onAvatarChange?.();
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
Toast.error('Failed to select avatar');
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setIsSelectingAvatar(false);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const handlePress = () => {
|
|
59
|
+
if (editable) {
|
|
60
|
+
handleSelectAvatar();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
if (editable || followable) {
|
|
64
|
+
return (_jsx(Touchable, { onPress: handlePress, children: _jsx(Loading, { loading: loading || isSelectingAvatar, size: "medium", children: children }) }));
|
|
65
|
+
}
|
|
66
|
+
return (_jsx(Box, { children: children }));
|
|
67
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Options } from 'use-http';
|
|
2
|
+
interface UseUploadCloudinaryImageApiParams {
|
|
3
|
+
onError?: Options['onError'];
|
|
4
|
+
}
|
|
5
|
+
export declare const useUploadCloudinaryImageApi: ({ onError, }: UseUploadCloudinaryImageApiParams) => {
|
|
6
|
+
uploadImage: ({ path, publicId, }: {
|
|
7
|
+
path: string;
|
|
8
|
+
publicId: string;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: Error | undefined;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useUploadCloudinaryImageApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploadCloudinaryImageApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/apiCalls/useUploadCloudinaryImageApi.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAElD,UAAU,iCAAiC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,2BAA2B,iBAErC,iCAAiC;uCAY/B;QACD,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB;;;CAmBF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import useFetch, {} from 'use-http';
|
|
2
|
+
export const useUploadCloudinaryImageApi = ({ onError, }) => {
|
|
3
|
+
const { post, loading, error, } = useFetch('https://api.cloudinary.com/v1_1/dqgkul2ur/image/upload', {
|
|
4
|
+
onError,
|
|
5
|
+
});
|
|
6
|
+
const uploadImage = async ({ path, publicId, }) => {
|
|
7
|
+
const formData = new FormData();
|
|
8
|
+
formData.append('file', {
|
|
9
|
+
uri: path,
|
|
10
|
+
type: 'image/jpeg',
|
|
11
|
+
name: `${publicId}.jpg`,
|
|
12
|
+
});
|
|
13
|
+
formData.append('public_id', publicId);
|
|
14
|
+
formData.append('upload_preset', 'jf6kaqxr');
|
|
15
|
+
formData.append('api_key', '856638577287277');
|
|
16
|
+
formData.append('timestamp', Date.now().toString());
|
|
17
|
+
await post(formData);
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
uploadImage,
|
|
21
|
+
loading,
|
|
22
|
+
error,
|
|
23
|
+
};
|
|
24
|
+
};
|