stream-chat-react-native-core 9.4.0-beta.11 → 9.4.0-beta.13
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/commonjs/components/ChannelDetails/ChannelDetails.js +8 -3
- package/lib/commonjs/components/ChannelDetails/ChannelDetails.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
- package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
- package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/index.js +22 -0
- package/lib/commonjs/components/ChannelDetails/components/index.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
- package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js +22 -23
- package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
- package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js +114 -0
- package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/hooks/index.js +33 -0
- package/lib/commonjs/components/ChannelDetails/hooks/index.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
- package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
- package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
- package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js +30 -0
- package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +21 -76
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +6 -10
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +16 -14
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryA11yProbe.js +67 -0
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryA11yProbe.js.map +1 -0
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +4 -3
- package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/hooks/useCurrentImageHeight.js +53 -0
- package/lib/commonjs/components/ImageGallery/hooks/useCurrentImageHeight.js.map +1 -0
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js +25 -31
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
- package/lib/commonjs/components/UIComponents/EmptyList.js +78 -0
- package/lib/commonjs/components/UIComponents/EmptyList.js.map +1 -0
- package/lib/commonjs/components/UIComponents/index.js +11 -0
- package/lib/commonjs/components/UIComponents/index.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/AvatarGroup.js +3 -3
- package/lib/commonjs/components/ui/Avatar/constants.js +2 -2
- package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
- package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
- package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
- package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
- package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
- package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js +8 -0
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/commonjs/contexts/index.js +33 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +57 -2
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/i18n/ar.json +11 -0
- package/lib/commonjs/i18n/en.json +11 -0
- package/lib/commonjs/i18n/es.json +11 -0
- package/lib/commonjs/i18n/fr.json +11 -0
- package/lib/commonjs/i18n/he.json +11 -0
- package/lib/commonjs/i18n/hi.json +11 -0
- package/lib/commonjs/i18n/it.json +11 -0
- package/lib/commonjs/i18n/ja.json +11 -0
- package/lib/commonjs/i18n/ko.json +11 -0
- package/lib/commonjs/i18n/nl.json +11 -0
- package/lib/commonjs/i18n/pt-br.json +11 -0
- package/lib/commonjs/i18n/ru.json +11 -0
- package/lib/commonjs/i18n/tr.json +11 -0
- package/lib/commonjs/icons/folder.js +37 -0
- package/lib/commonjs/icons/folder.js.map +1 -0
- package/lib/commonjs/icons/index.js +12 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/state-store/image-gallery-state-store.js +12 -3
- package/lib/commonjs/state-store/image-gallery-state-store.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ChannelDetails/ChannelDetails.js +8 -3
- package/lib/module/components/ChannelDetails/ChannelDetails.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
- package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
- package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
- package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
- package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
- package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
- package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/index.js +22 -0
- package/lib/module/components/ChannelDetails/components/index.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
- package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/modal/Modal.js +22 -23
- package/lib/module/components/ChannelDetails/components/modal/Modal.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
- package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/index.js +114 -0
- package/lib/module/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
- package/lib/module/components/ChannelDetails/hooks/index.js +33 -0
- package/lib/module/components/ChannelDetails/hooks/index.js.map +1 -1
- package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
- package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
- package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
- package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
- package/lib/module/components/ChannelDetails/hooks/useMediaList.js +30 -0
- package/lib/module/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
- package/lib/module/components/ImageGallery/ImageGallery.js +21 -76
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +6 -10
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +16 -14
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryA11yProbe.js +67 -0
- package/lib/module/components/ImageGallery/components/ImageGalleryA11yProbe.js.map +1 -0
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +4 -3
- package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
- package/lib/module/components/ImageGallery/hooks/useCurrentImageHeight.js +53 -0
- package/lib/module/components/ImageGallery/hooks/useCurrentImageHeight.js.map +1 -0
- package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js +25 -31
- package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
- package/lib/module/components/UIComponents/EmptyList.js +78 -0
- package/lib/module/components/UIComponents/EmptyList.js.map +1 -0
- package/lib/module/components/UIComponents/index.js +11 -0
- package/lib/module/components/UIComponents/index.js.map +1 -1
- package/lib/module/components/ui/Avatar/AvatarGroup.js +3 -3
- package/lib/module/components/ui/Avatar/constants.js +2 -2
- package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
- package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
- package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
- package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
- package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
- package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
- package/lib/module/contexts/componentsContext/defaultComponents.js +8 -0
- package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/module/contexts/index.js +33 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +57 -2
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/i18n/ar.json +11 -0
- package/lib/module/i18n/en.json +11 -0
- package/lib/module/i18n/es.json +11 -0
- package/lib/module/i18n/fr.json +11 -0
- package/lib/module/i18n/he.json +11 -0
- package/lib/module/i18n/hi.json +11 -0
- package/lib/module/i18n/it.json +11 -0
- package/lib/module/i18n/ja.json +11 -0
- package/lib/module/i18n/ko.json +11 -0
- package/lib/module/i18n/nl.json +11 -0
- package/lib/module/i18n/pt-br.json +11 -0
- package/lib/module/i18n/ru.json +11 -0
- package/lib/module/i18n/tr.json +11 -0
- package/lib/module/icons/folder.js +37 -0
- package/lib/module/icons/folder.js.map +1 -0
- package/lib/module/icons/index.js +12 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/state-store/image-gallery-state-store.js +12 -3
- package/lib/module/state-store/image-gallery-state-store.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts +11 -1
- package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsActionItem.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts +6 -0
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts +3 -1
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavigationSection.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/index.d.ts +3 -0
- package/lib/typescript/components/ChannelDetails/components/index.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/members/ChannelMemberItem.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts +2 -1
- package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts +3 -1
- package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts +31 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts +17 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts +9 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts +13 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts +35 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts +17 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts +11 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts +19 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts +19 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts +9 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts +11 -0
- package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/hooks/index.d.ts +3 -0
- package/lib/typescript/components/ChannelDetails/hooks/index.d.ts.map +1 -1
- package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts +56 -0
- package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts +28 -0
- package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts.map +1 -0
- package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts +20 -0
- package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts.map +1 -0
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +1 -4
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryA11yProbe.d.ts +20 -0
- package/lib/typescript/components/ImageGallery/components/ImageGalleryA11yProbe.d.ts.map +1 -0
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/hooks/useAnimatedGalleryStyle.d.ts +2 -3
- package/lib/typescript/components/ImageGallery/hooks/useAnimatedGalleryStyle.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/hooks/useCurrentImageHeight.d.ts +24 -0
- package/lib/typescript/components/ImageGallery/hooks/useCurrentImageHeight.d.ts.map +1 -0
- package/lib/typescript/components/ImageGallery/hooks/useImageGalleryGestures.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/hooks/useImageGalleryGestures.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/EmptyList.d.ts +24 -0
- package/lib/typescript/components/UIComponents/EmptyList.d.ts.map +1 -0
- package/lib/typescript/components/UIComponents/index.d.ts +1 -0
- package/lib/typescript/components/UIComponents/index.d.ts.map +1 -1
- package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts +21 -0
- package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts.map +1 -0
- package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts +21 -0
- package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts.map +1 -0
- package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts +21 -0
- package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts.map +1 -0
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +18 -2
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
- package/lib/typescript/contexts/index.d.ts +3 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +56 -1
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +56 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/i18n/ar.json +11 -0
- package/lib/typescript/i18n/en.json +11 -0
- package/lib/typescript/i18n/es.json +11 -0
- package/lib/typescript/i18n/fr.json +11 -0
- package/lib/typescript/i18n/he.json +11 -0
- package/lib/typescript/i18n/hi.json +11 -0
- package/lib/typescript/i18n/it.json +11 -0
- package/lib/typescript/i18n/ja.json +11 -0
- package/lib/typescript/i18n/ko.json +11 -0
- package/lib/typescript/i18n/nl.json +11 -0
- package/lib/typescript/i18n/pt-br.json +11 -0
- package/lib/typescript/i18n/ru.json +11 -0
- package/lib/typescript/i18n/tr.json +11 -0
- package/lib/typescript/icons/folder.d.ts +4 -0
- package/lib/typescript/icons/folder.d.ts.map +1 -0
- package/lib/typescript/icons/index.d.ts +1 -0
- package/lib/typescript/icons/index.d.ts.map +1 -1
- package/lib/typescript/state-store/image-gallery-state-store.d.ts +8 -0
- package/lib/typescript/state-store/image-gallery-state-store.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +11 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelDetails/ChannelDetails.tsx +17 -2
- package/src/components/ChannelDetails/__tests__/ChannelDetails.test.tsx +29 -0
- package/src/components/ChannelDetails/__tests__/ChannelDetailsEditButton.test.tsx +127 -0
- package/src/components/ChannelDetails/__tests__/ChannelDetailsNavHeader.test.tsx +21 -56
- package/src/components/ChannelDetails/__tests__/ChannelDetailsNavigationSection.test.tsx +225 -6
- package/src/components/ChannelDetails/__tests__/useFileAttachmentListSections.test.tsx +159 -0
- package/src/components/ChannelDetails/__tests__/useMediaList.test.tsx +53 -0
- package/src/components/ChannelDetails/components/ChannelDetailsActionItem.tsx +6 -1
- package/src/components/ChannelDetails/components/ChannelDetailsEditButton.tsx +50 -0
- package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx +6 -33
- package/src/components/ChannelDetails/components/ChannelDetailsNavigationSection.tsx +80 -32
- package/src/components/ChannelDetails/components/ChannelDetailsProfile.tsx +2 -1
- package/src/components/ChannelDetails/components/ChannelEditImageSheet.tsx +2 -2
- package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentItem.test.tsx +80 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentList.test.tsx +334 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentListSectionHeader.test.tsx +19 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaItem.test.tsx +97 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaList.test.tsx +351 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageItem.test.tsx +112 -0
- package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageList.test.tsx +324 -0
- package/src/components/ChannelDetails/components/index.ts +3 -0
- package/src/components/ChannelDetails/components/members/ChannelMemberItem.tsx +6 -1
- package/src/components/ChannelDetails/components/modal/Modal.tsx +37 -24
- package/src/components/ChannelDetails/components/modal/ModalHeader.tsx +11 -4
- package/src/components/ChannelDetails/components/navigation-section/FileAttachmentItem.tsx +92 -0
- package/src/components/ChannelDetails/components/navigation-section/FileAttachmentList.tsx +204 -0
- package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.tsx +23 -0
- package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.tsx +56 -0
- package/src/components/ChannelDetails/components/navigation-section/MediaItem.tsx +160 -0
- package/src/components/ChannelDetails/components/navigation-section/MediaList.tsx +244 -0
- package/src/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.tsx +66 -0
- package/src/components/ChannelDetails/components/navigation-section/PinnedMessageItem.tsx +94 -0
- package/src/components/ChannelDetails/components/navigation-section/PinnedMessageList.tsx +198 -0
- package/src/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.tsx +23 -0
- package/src/components/ChannelDetails/components/navigation-section/index.ts +10 -0
- package/src/components/ChannelDetails/hooks/index.ts +3 -0
- package/src/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.ts +108 -0
- package/src/components/ChannelDetails/hooks/useFileAttachmentListSections.ts +79 -0
- package/src/components/ChannelDetails/hooks/useMediaList.ts +51 -0
- package/src/components/ImageGallery/ImageGallery.tsx +41 -120
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +4 -1
- package/src/components/ImageGallery/__tests__/ImageGalleryAdjustable.test.tsx +5 -4
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +9 -11
- package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +28 -15
- package/src/components/ImageGallery/components/ImageGalleryA11yProbe.tsx +82 -0
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +21 -18
- package/src/components/ImageGallery/hooks/useAnimatedGalleryStyle.tsx +5 -5
- package/src/components/ImageGallery/hooks/useCurrentImageHeight.ts +86 -0
- package/src/components/ImageGallery/hooks/useImageGalleryGestures.tsx +42 -51
- package/src/components/UIComponents/EmptyList.tsx +80 -0
- package/src/components/UIComponents/__tests__/EmptyList.test.tsx +90 -0
- package/src/components/UIComponents/index.ts +1 -0
- package/src/components/ui/Avatar/AvatarGroup.tsx +3 -3
- package/src/components/ui/Avatar/constants.ts +2 -2
- package/src/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.tsx +67 -0
- package/src/contexts/channelMediaListContext/ChannelMediaListContext.tsx +68 -0
- package/src/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.tsx +72 -0
- package/src/contexts/componentsContext/defaultComponents.ts +16 -1
- package/src/contexts/index.ts +3 -0
- package/src/contexts/themeContext/utils/theme.ts +112 -2
- package/src/i18n/ar.json +11 -0
- package/src/i18n/en.json +11 -0
- package/src/i18n/es.json +11 -0
- package/src/i18n/fr.json +11 -0
- package/src/i18n/he.json +11 -0
- package/src/i18n/hi.json +11 -0
- package/src/i18n/it.json +11 -0
- package/src/i18n/ja.json +11 -0
- package/src/i18n/ko.json +11 -0
- package/src/i18n/nl.json +11 -0
- package/src/i18n/pt-br.json +11 -0
- package/src/i18n/ru.json +11 -0
- package/src/i18n/tr.json +11 -0
- package/src/icons/folder.tsx +28 -0
- package/src/icons/index.ts +1 -0
- package/src/state-store/__tests__/image-gallery-state-store.test.ts +81 -0
- package/src/state-store/image-gallery-state-store.ts +27 -1
- package/src/version.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
import { SharedValue, useSharedValue } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ImageGalleryAsset,
|
|
7
|
+
ImageGalleryStateStore,
|
|
8
|
+
} from '../../../state-store/image-gallery-state-store';
|
|
9
|
+
import { FileTypes } from '../../../types/types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Owns a SharedValue tracking the visible height of the currently selected
|
|
13
|
+
* gallery asset and keeps it in lockstep with the gallery store's
|
|
14
|
+
* currentIndex. Worklet consumers read `.value` on the UI thread.
|
|
15
|
+
*
|
|
16
|
+
* The store is subscribed via `subscribeWithSelector` (not `useStateStore`),
|
|
17
|
+
* so currentIndex changes never go through React state so no rerender is
|
|
18
|
+
* triggered in the calling component. The callback writes directly into the
|
|
19
|
+
* SharedValue.
|
|
20
|
+
*
|
|
21
|
+
* Sync path uses the attachment's intrinsic `original_height`/`original_width`
|
|
22
|
+
* when present. Async fallback via `Image.getSize` handles assets that don't
|
|
23
|
+
* carry dimensions; a token guards against the closure-race where the user
|
|
24
|
+
* swipes past a slide before its dimensions resolve.
|
|
25
|
+
*/
|
|
26
|
+
export const useCurrentImageHeight = ({
|
|
27
|
+
assets,
|
|
28
|
+
fullWindowHeight,
|
|
29
|
+
fullWindowWidth,
|
|
30
|
+
imageGalleryStateStore,
|
|
31
|
+
}: {
|
|
32
|
+
assets: ImageGalleryAsset[];
|
|
33
|
+
fullWindowHeight: number;
|
|
34
|
+
fullWindowWidth: number;
|
|
35
|
+
imageGalleryStateStore: ImageGalleryStateStore;
|
|
36
|
+
}): SharedValue<number> => {
|
|
37
|
+
const currentImageHeight = useSharedValue(fullWindowHeight);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
let latestToken = 0;
|
|
41
|
+
|
|
42
|
+
const compute = (index: number) => {
|
|
43
|
+
const currentToken = ++latestToken;
|
|
44
|
+
const photo = assets[index];
|
|
45
|
+
|
|
46
|
+
if (photo?.original_height && photo?.original_width) {
|
|
47
|
+
const h = Math.floor(photo.original_height * (fullWindowWidth / photo.original_width));
|
|
48
|
+
currentImageHeight.value = h > fullWindowHeight ? fullWindowHeight : h;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (photo?.uri && photo.type === FileTypes.Image) {
|
|
53
|
+
Image.getSize(
|
|
54
|
+
photo.uri,
|
|
55
|
+
(width, height) => {
|
|
56
|
+
// Stale result, currentIndex moved on before getSize resolved.
|
|
57
|
+
if (currentToken !== latestToken) return;
|
|
58
|
+
if (!width || !height) {
|
|
59
|
+
currentImageHeight.value = fullWindowHeight;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const imageHeight = Math.floor(height * (fullWindowWidth / width));
|
|
63
|
+
currentImageHeight.value =
|
|
64
|
+
imageHeight > fullWindowHeight ? fullWindowHeight : imageHeight;
|
|
65
|
+
},
|
|
66
|
+
() => {
|
|
67
|
+
if (currentToken !== latestToken) return;
|
|
68
|
+
currentImageHeight.value = fullWindowHeight;
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
currentImageHeight.value = fullWindowHeight;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
compute(imageGalleryStateStore.state.getLatestValue().currentIndex);
|
|
78
|
+
|
|
79
|
+
return imageGalleryStateStore.state.subscribeWithSelector(
|
|
80
|
+
(state) => ({ currentIndex: state.currentIndex }),
|
|
81
|
+
({ currentIndex }) => compute(currentIndex),
|
|
82
|
+
);
|
|
83
|
+
}, [assets, fullWindowHeight, fullWindowWidth, currentImageHeight, imageGalleryStateStore]);
|
|
84
|
+
|
|
85
|
+
return currentImageHeight;
|
|
86
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef
|
|
1
|
+
import { useRef } from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import { Gesture, GestureType } from 'react-native-gesture-handler';
|
|
4
4
|
import {
|
|
@@ -14,9 +14,7 @@ import {
|
|
|
14
14
|
|
|
15
15
|
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/ImageGalleryContext';
|
|
16
16
|
import { useOverlayContext } from '../../../contexts/overlayContext/OverlayContext';
|
|
17
|
-
import { useStateStore } from '../../../hooks';
|
|
18
17
|
import { NativeHandlers } from '../../../native';
|
|
19
|
-
import { ImageGalleryState } from '../../../state-store/image-gallery-state-store';
|
|
20
18
|
|
|
21
19
|
export enum HasPinched {
|
|
22
20
|
FALSE = 0,
|
|
@@ -31,10 +29,6 @@ export enum IsSwiping {
|
|
|
31
29
|
|
|
32
30
|
const MARGIN = 32;
|
|
33
31
|
|
|
34
|
-
const imageGallerySelector = (state: ImageGalleryState) => ({
|
|
35
|
-
currentIndex: state.currentIndex,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
32
|
export const useImageGalleryGestures = ({
|
|
39
33
|
currentImageHeight,
|
|
40
34
|
halfScreenHeight,
|
|
@@ -49,7 +43,7 @@ export const useImageGalleryGestures = ({
|
|
|
49
43
|
translateY,
|
|
50
44
|
translationX,
|
|
51
45
|
}: {
|
|
52
|
-
currentImageHeight: number
|
|
46
|
+
currentImageHeight: SharedValue<number>;
|
|
53
47
|
halfScreenHeight: number;
|
|
54
48
|
halfScreenWidth: number;
|
|
55
49
|
headerFooterVisible: SharedValue<number>;
|
|
@@ -62,20 +56,8 @@ export const useImageGalleryGestures = ({
|
|
|
62
56
|
translateY: SharedValue<number>;
|
|
63
57
|
translationX: SharedValue<number>;
|
|
64
58
|
}) => {
|
|
65
|
-
/**
|
|
66
|
-
* if a specific image index > 0 has been passed in
|
|
67
|
-
* while creating the hook, set the value of the index
|
|
68
|
-
* reference to its value.
|
|
69
|
-
*
|
|
70
|
-
* This makes it possible to seelct an image in the list,
|
|
71
|
-
* and scroll/pan as normal. Prior to this,
|
|
72
|
-
* it was always assumed that one started at index 0 in the
|
|
73
|
-
* gallery.
|
|
74
|
-
* */
|
|
75
59
|
const { imageGalleryStateStore } = useImageGalleryContext();
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const [index, setIndex] = useState(currentIndex);
|
|
60
|
+
const currentIndexShared = imageGalleryStateStore.currentIndexShared;
|
|
79
61
|
|
|
80
62
|
/**
|
|
81
63
|
* Gesture handler refs
|
|
@@ -163,13 +145,16 @@ export const useImageGalleryGestures = ({
|
|
|
163
145
|
};
|
|
164
146
|
|
|
165
147
|
const moveToNextImage = () => {
|
|
166
|
-
runOnJS
|
|
167
|
-
|
|
148
|
+
// Read fresh — both moveToNext/Previous are invoked via runOnJS from a
|
|
149
|
+
// worklet, so we'd otherwise be using a value captured at hook-creation
|
|
150
|
+
// time. The setter mirrors into currentIndexShared.
|
|
151
|
+
const currentIndex = imageGalleryStateStore.state.getLatestValue().currentIndex;
|
|
152
|
+
imageGalleryStateStore.currentIndex = currentIndex + 1;
|
|
168
153
|
};
|
|
169
154
|
|
|
170
155
|
const moveToPreviousImage = () => {
|
|
171
|
-
|
|
172
|
-
imageGalleryStateStore.currentIndex =
|
|
156
|
+
const currentIndex = imageGalleryStateStore.state.getLatestValue().currentIndex;
|
|
157
|
+
imageGalleryStateStore.currentIndex = currentIndex - 1;
|
|
173
158
|
};
|
|
174
159
|
|
|
175
160
|
/**
|
|
@@ -221,7 +206,7 @@ export const useImageGalleryGestures = ({
|
|
|
221
206
|
* true, or false and is reset on releasing the touch
|
|
222
207
|
*/
|
|
223
208
|
if (isSwiping.value === IsSwiping.UNDETERMINED) {
|
|
224
|
-
const maxXYRatio =
|
|
209
|
+
const maxXYRatio = 0.25;
|
|
225
210
|
if (
|
|
226
211
|
Math.abs(event.translationX / event.translationY) > maxXYRatio &&
|
|
227
212
|
(Math.abs(-halfScreenWidth * (scale.value - 1) - offsetX.value) < 3 ||
|
|
@@ -261,16 +246,17 @@ export const useImageGalleryGestures = ({
|
|
|
261
246
|
* If swiping down start scaling down the image for swipe
|
|
262
247
|
* away effect
|
|
263
248
|
*/
|
|
249
|
+
const imageHeight = currentImageHeight.value;
|
|
264
250
|
scale.value =
|
|
265
|
-
|
|
251
|
+
imageHeight * offsetScale.value < screenHeight && translateY.value > 0
|
|
266
252
|
? offsetScale.value * (1 - (1 / 3) * (translateY.value / screenHeight))
|
|
267
|
-
:
|
|
268
|
-
translateY.value > (
|
|
253
|
+
: imageHeight * offsetScale.value > screenHeight &&
|
|
254
|
+
translateY.value > (imageHeight / 2) * offsetScale.value - halfScreenHeight
|
|
269
255
|
? offsetScale.value *
|
|
270
256
|
(1 -
|
|
271
257
|
(1 / 3) *
|
|
272
258
|
((translateY.value -
|
|
273
|
-
((
|
|
259
|
+
((imageHeight / 2) * offsetScale.value - halfScreenHeight)) /
|
|
274
260
|
screenHeight))
|
|
275
261
|
: scale.value;
|
|
276
262
|
|
|
@@ -287,6 +273,8 @@ export const useImageGalleryGestures = ({
|
|
|
287
273
|
const finalXPosition = event.translationX - event.velocityX * 0.3;
|
|
288
274
|
const finalYPosition = event.translationY + event.velocityY * 0.1;
|
|
289
275
|
|
|
276
|
+
const currentIndex = currentIndexShared.value;
|
|
277
|
+
|
|
290
278
|
/**
|
|
291
279
|
* If there is a next photo, the image is lined up to the right
|
|
292
280
|
* edge, the swipe is to the left, and the final position is more
|
|
@@ -295,7 +283,7 @@ export const useImageGalleryGestures = ({
|
|
|
295
283
|
* As we move towards the left to move to next image, the translationX value will be negative on X axis.
|
|
296
284
|
*/
|
|
297
285
|
if (
|
|
298
|
-
|
|
286
|
+
currentIndex < assetsLength - 1 &&
|
|
299
287
|
Math.abs(halfScreenWidth * (scale.value - 1) + offsetX.value) < 3 &&
|
|
300
288
|
translateX.value < 0 &&
|
|
301
289
|
finalXPosition > halfScreenWidth &&
|
|
@@ -303,7 +291,7 @@ export const useImageGalleryGestures = ({
|
|
|
303
291
|
) {
|
|
304
292
|
cancelAnimation(translationX);
|
|
305
293
|
translationX.value = withTiming(
|
|
306
|
-
-(screenWidth + MARGIN) * (
|
|
294
|
+
-(screenWidth + MARGIN) * (currentIndex + 1),
|
|
307
295
|
{
|
|
308
296
|
duration: 200,
|
|
309
297
|
easing: Easing.out(Easing.ease),
|
|
@@ -322,7 +310,7 @@ export const useImageGalleryGestures = ({
|
|
|
322
310
|
* As we move towards the right to move to previous image, the translationX value will be positive on X axis.
|
|
323
311
|
*/
|
|
324
312
|
} else if (
|
|
325
|
-
|
|
313
|
+
currentIndex > 0 &&
|
|
326
314
|
Math.abs(-halfScreenWidth * (scale.value - 1) + offsetX.value) < 3 &&
|
|
327
315
|
translateX.value > 0 &&
|
|
328
316
|
finalXPosition < -halfScreenWidth &&
|
|
@@ -330,7 +318,7 @@ export const useImageGalleryGestures = ({
|
|
|
330
318
|
) {
|
|
331
319
|
cancelAnimation(translationX);
|
|
332
320
|
translationX.value = withTiming(
|
|
333
|
-
-(screenWidth + MARGIN) * (
|
|
321
|
+
-(screenWidth + MARGIN) * (currentIndex - 1),
|
|
334
322
|
{
|
|
335
323
|
duration: 200,
|
|
336
324
|
easing: Easing.out(Easing.ease),
|
|
@@ -376,19 +364,20 @@ export const useImageGalleryGestures = ({
|
|
|
376
364
|
* otherwise use decay with a clamping at the edges to give the effect
|
|
377
365
|
* the image is sliding along using velocity and friction
|
|
378
366
|
*/
|
|
367
|
+
const imageHeight = currentImageHeight.value;
|
|
379
368
|
translateY.value =
|
|
380
|
-
|
|
369
|
+
imageHeight * scale.value < screenHeight
|
|
381
370
|
? withTiming(0, { reduceMotion: ReduceMotion.Never })
|
|
382
|
-
: translateY.value > (
|
|
383
|
-
? withTiming((
|
|
371
|
+
: translateY.value > (imageHeight / 2) * scale.value - halfScreenHeight
|
|
372
|
+
? withTiming((imageHeight / 2) * scale.value - halfScreenHeight, {
|
|
384
373
|
reduceMotion: ReduceMotion.Never,
|
|
385
374
|
})
|
|
386
|
-
: translateY.value < (-
|
|
387
|
-
? withTiming((-
|
|
375
|
+
: translateY.value < (-imageHeight / 2) * scale.value + halfScreenHeight
|
|
376
|
+
? withTiming((-imageHeight / 2) * scale.value + halfScreenHeight)
|
|
388
377
|
: withDecay({
|
|
389
378
|
clamp: [
|
|
390
|
-
(-
|
|
391
|
-
(
|
|
379
|
+
(-imageHeight / 2) * scale.value + halfScreenHeight,
|
|
380
|
+
(imageHeight / 2) * scale.value - halfScreenHeight,
|
|
392
381
|
],
|
|
393
382
|
deceleration: 0.99,
|
|
394
383
|
velocity: event.velocityY,
|
|
@@ -411,7 +400,7 @@ export const useImageGalleryGestures = ({
|
|
|
411
400
|
*/
|
|
412
401
|
if (
|
|
413
402
|
finalYPosition > halfScreenHeight &&
|
|
414
|
-
offsetY.value + 8 >= (
|
|
403
|
+
offsetY.value + 8 >= (imageHeight / 2) * scale.value - halfScreenHeight &&
|
|
415
404
|
isSwiping.value !== IsSwiping.TRUE &&
|
|
416
405
|
translateY.value !== 0 &&
|
|
417
406
|
!(
|
|
@@ -448,7 +437,7 @@ export const useImageGalleryGestures = ({
|
|
|
448
437
|
? withDecay({
|
|
449
438
|
velocity: event.velocityY,
|
|
450
439
|
})
|
|
451
|
-
: withTiming(halfScreenHeight + (
|
|
440
|
+
: withTiming(halfScreenHeight + (imageHeight / 2) * scale.value, {
|
|
452
441
|
duration: 200,
|
|
453
442
|
easing: Easing.out(Easing.ease),
|
|
454
443
|
});
|
|
@@ -662,13 +651,14 @@ export const useImageGalleryGestures = ({
|
|
|
662
651
|
* edges of the screen return the photo to line up with the edges,
|
|
663
652
|
* otherwise leave the photo in its current position
|
|
664
653
|
*/
|
|
654
|
+
const imageHeight = currentImageHeight.value;
|
|
665
655
|
translateY.value =
|
|
666
|
-
|
|
656
|
+
imageHeight * scale.value < screenHeight
|
|
667
657
|
? withTiming(0)
|
|
668
|
-
: translateY.value > (
|
|
669
|
-
? withTiming((
|
|
670
|
-
: translateY.value < (-
|
|
671
|
-
? withTiming((-
|
|
658
|
+
: translateY.value > (imageHeight / 2) * scale.value - screenHeight / 2
|
|
659
|
+
? withTiming((imageHeight / 2) * scale.value - screenHeight / 2)
|
|
660
|
+
: translateY.value < (-imageHeight / 2) * scale.value + screenHeight / 2
|
|
661
|
+
? withTiming((-imageHeight / 2) * scale.value + screenHeight / 2)
|
|
672
662
|
: translateY.value;
|
|
673
663
|
|
|
674
664
|
/**
|
|
@@ -724,11 +714,12 @@ export const useImageGalleryGestures = ({
|
|
|
724
714
|
duration: 200,
|
|
725
715
|
easing: Easing.out(Easing.ease),
|
|
726
716
|
});
|
|
727
|
-
|
|
717
|
+
const imageHeight = currentImageHeight.value;
|
|
718
|
+
if (imageHeight * 2 > screenHeight) {
|
|
728
719
|
const translateYTopBottom =
|
|
729
720
|
event.absoluteY > halfScreenHeight
|
|
730
|
-
? -(
|
|
731
|
-
: (
|
|
721
|
+
? -(imageHeight * 2 - screenHeight) / 2
|
|
722
|
+
: (imageHeight * 2 - screenHeight) / 2;
|
|
732
723
|
translateY.value = withTiming(translateYTopBottom, {
|
|
733
724
|
duration: 200,
|
|
734
725
|
easing: Easing.out(Easing.ease),
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { I18nManager, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
|
+
import { IconProps } from '../../icons/utils/base';
|
|
6
|
+
import { primitives } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export type EmptyListProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Icon component to render. Its size and color are set by `EmptyList`.
|
|
11
|
+
*/
|
|
12
|
+
icon: React.ComponentType<IconProps>;
|
|
13
|
+
/**
|
|
14
|
+
* Title text shown below the icon.
|
|
15
|
+
*/
|
|
16
|
+
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional supporting text shown below the title.
|
|
19
|
+
*/
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @experimental This component is experimental and is subject to change.
|
|
25
|
+
*/
|
|
26
|
+
export const EmptyList = ({ icon: Icon, subtitle, title }: EmptyListProps) => {
|
|
27
|
+
const {
|
|
28
|
+
theme: {
|
|
29
|
+
emptyList: { container, subtitle: subtitleStyle, title: titleStyle },
|
|
30
|
+
semantics,
|
|
31
|
+
},
|
|
32
|
+
} = useTheme();
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View style={[styles.container, container]} testID='empty-list'>
|
|
36
|
+
<Icon stroke={semantics.textTertiary} size={32} />
|
|
37
|
+
<View style={styles.content}>
|
|
38
|
+
<Text style={[styles.title, { color: semantics.textPrimary }, titleStyle]}>{title}</Text>
|
|
39
|
+
{subtitle ? (
|
|
40
|
+
<Text style={[styles.subtitle, { color: semantics.textSecondary }, subtitleStyle]}>
|
|
41
|
+
{subtitle}
|
|
42
|
+
</Text>
|
|
43
|
+
) : null}
|
|
44
|
+
</View>
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
EmptyList.displayName = 'EmptyList{emptyList}';
|
|
50
|
+
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
container: {
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
gap: primitives.spacingSm,
|
|
55
|
+
height: '100%',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
paddingHorizontal: primitives.spacingMd,
|
|
58
|
+
paddingVertical: primitives.spacing3xl,
|
|
59
|
+
width: '100%',
|
|
60
|
+
},
|
|
61
|
+
content: {
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
gap: primitives.spacingXs,
|
|
64
|
+
width: '100%',
|
|
65
|
+
},
|
|
66
|
+
subtitle: {
|
|
67
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
68
|
+
fontWeight: primitives.typographyFontWeightRegular,
|
|
69
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
70
|
+
textAlign: 'center',
|
|
71
|
+
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
72
|
+
},
|
|
73
|
+
title: {
|
|
74
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
75
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
76
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext';
|
|
6
|
+
import { defaultTheme } from '../../../contexts/themeContext/utils/theme';
|
|
7
|
+
import { Pin } from '../../../icons/pin';
|
|
8
|
+
import { EmptyList } from '../EmptyList';
|
|
9
|
+
|
|
10
|
+
type EmptyListProps = React.ComponentProps<typeof EmptyList>;
|
|
11
|
+
|
|
12
|
+
const renderComponent = (props: Partial<EmptyListProps> = {}) =>
|
|
13
|
+
render(
|
|
14
|
+
<ThemeProvider theme={defaultTheme}>
|
|
15
|
+
<EmptyList icon={Pin} title='No pinned messages' {...props} />
|
|
16
|
+
</ThemeProvider>,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
describe('EmptyList', () => {
|
|
20
|
+
it('renders the empty-list testID', () => {
|
|
21
|
+
renderComponent();
|
|
22
|
+
expect(screen.getByTestId('empty-list')).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('renders the title text', () => {
|
|
26
|
+
renderComponent({ title: 'Nothing here' });
|
|
27
|
+
expect(screen.getByText('Nothing here')).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders the subtitle when provided', () => {
|
|
31
|
+
renderComponent({ subtitle: 'Long-press a message to pin it to the chat' });
|
|
32
|
+
expect(screen.getByText('Long-press a message to pin it to the chat')).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('does not render a subtitle when omitted', () => {
|
|
36
|
+
renderComponent({ subtitle: undefined });
|
|
37
|
+
expect(screen.queryByText('Long-press a message to pin it to the chat')).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('honors a custom container style override from the theme', () => {
|
|
41
|
+
const customTheme = {
|
|
42
|
+
...defaultTheme,
|
|
43
|
+
emptyList: {
|
|
44
|
+
container: { backgroundColor: 'rgb(255, 0, 0)' },
|
|
45
|
+
subtitle: {},
|
|
46
|
+
title: {},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
render(
|
|
51
|
+
<ThemeProvider theme={customTheme}>
|
|
52
|
+
<EmptyList icon={Pin} title='Empty' />
|
|
53
|
+
</ThemeProvider>,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const container = screen.getByTestId('empty-list');
|
|
57
|
+
const flattened = Array.isArray(container.props.style)
|
|
58
|
+
? Object.assign({}, ...container.props.style.flat(Infinity).filter(Boolean))
|
|
59
|
+
: container.props.style;
|
|
60
|
+
expect(flattened.backgroundColor).toBe('rgb(255, 0, 0)');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('honors custom title and subtitle style overrides from the theme', () => {
|
|
64
|
+
const customTheme = {
|
|
65
|
+
...defaultTheme,
|
|
66
|
+
emptyList: {
|
|
67
|
+
container: {},
|
|
68
|
+
subtitle: { color: 'rgb(0, 0, 255)' },
|
|
69
|
+
title: { color: 'rgb(0, 255, 0)' },
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
render(
|
|
74
|
+
<ThemeProvider theme={customTheme}>
|
|
75
|
+
<EmptyList icon={Pin} subtitle='Subtitle' title='Title' />
|
|
76
|
+
</ThemeProvider>,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const flatten = (node: { props: { style: unknown } }) =>
|
|
80
|
+
Array.isArray(node.props.style)
|
|
81
|
+
? Object.assign({}, ...(node.props.style as unknown[]).flat(Infinity).filter(Boolean))
|
|
82
|
+
: node.props.style;
|
|
83
|
+
|
|
84
|
+
const title = screen.getByText('Title') as unknown as { props: { style: unknown } };
|
|
85
|
+
const subtitle = screen.getByText('Subtitle') as unknown as { props: { style: unknown } };
|
|
86
|
+
|
|
87
|
+
expect((flatten(title) as { color?: string }).color).toBe('rgb(0, 255, 0)');
|
|
88
|
+
expect((flatten(subtitle) as { color?: string }).color).toBe('rgb(0, 0, 255)');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -28,8 +28,8 @@ export type AvatarGroupProps = {
|
|
|
28
28
|
// Sizes accounts for the border width as well
|
|
29
29
|
const sizes = {
|
|
30
30
|
'2xl': {
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
31
|
+
width: 80,
|
|
32
|
+
height: 80,
|
|
33
33
|
},
|
|
34
34
|
xl: {
|
|
35
35
|
width: 48,
|
|
@@ -165,7 +165,7 @@ export type UserAvatarGroupProps = Pick<AvatarGroupProps, 'size'> & {
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
const userAvatarSize: Record<UserAvatarGroupProps['size'], UserAvatarProps['size']> = {
|
|
168
|
-
'2xl': '
|
|
168
|
+
'2xl': 'xl',
|
|
169
169
|
xl: 'md',
|
|
170
170
|
lg: 'sm',
|
|
171
171
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useContext, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Channel, MessageSearchSource } from 'stream-chat';
|
|
4
|
+
|
|
5
|
+
import { useChatContext } from '..';
|
|
6
|
+
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
7
|
+
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @experimental This API is experimental and is subject to change.
|
|
11
|
+
*/
|
|
12
|
+
export type ChannelFileAttachmentListContextValue = {
|
|
13
|
+
channel: Channel;
|
|
14
|
+
searchSource: MessageSearchSource;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ChannelFileAttachmentListContext = React.createContext(
|
|
18
|
+
DEFAULT_BASE_CONTEXT_VALUE as ChannelFileAttachmentListContextValue,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @experimental This API is experimental and is subject to change.
|
|
23
|
+
*/
|
|
24
|
+
export const ChannelFileAttachmentListProvider = ({
|
|
25
|
+
channel,
|
|
26
|
+
children,
|
|
27
|
+
}: PropsWithChildren<{ channel: Channel }>) => {
|
|
28
|
+
const { client } = useChatContext();
|
|
29
|
+
const [searchSource] = useState(() => {
|
|
30
|
+
const source = new MessageSearchSource(client, {
|
|
31
|
+
allowEmptySearchString: true,
|
|
32
|
+
pageSize: 25,
|
|
33
|
+
resetOnNewSearchQuery: false,
|
|
34
|
+
});
|
|
35
|
+
source.messageSearchChannelFilters = { cid: channel.cid, members: undefined };
|
|
36
|
+
source.messageSearchFilters = {
|
|
37
|
+
$or: [{ 'attachments.type': 'file' }, { 'attachments.type': 'audio' }],
|
|
38
|
+
};
|
|
39
|
+
// Newest first so the list groups cleanly under month section headers.
|
|
40
|
+
source.messageSearchSort = { created_at: -1 };
|
|
41
|
+
source.activate();
|
|
42
|
+
return source;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<ChannelFileAttachmentListContext.Provider value={{ channel, searchSource }}>
|
|
47
|
+
{children}
|
|
48
|
+
</ChannelFileAttachmentListContext.Provider>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @experimental This API is experimental and is subject to change.
|
|
54
|
+
*/
|
|
55
|
+
export const useChannelFileAttachmentListContext = () => {
|
|
56
|
+
const contextValue = useContext(
|
|
57
|
+
ChannelFileAttachmentListContext,
|
|
58
|
+
) as unknown as ChannelFileAttachmentListContextValue;
|
|
59
|
+
|
|
60
|
+
if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
'The useChannelFileAttachmentListContext hook was called outside of the ChannelFileAttachmentListContext provider. Render the file attachment list UI inside a ChannelFileAttachmentListProvider.',
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return contextValue;
|
|
67
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useContext, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Channel, MessageSearchSource } from 'stream-chat';
|
|
4
|
+
|
|
5
|
+
import { useChatContext } from '..';
|
|
6
|
+
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
7
|
+
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @experimental This API is experimental and is subject to change.
|
|
11
|
+
*/
|
|
12
|
+
export type ChannelMediaListContextValue = {
|
|
13
|
+
channel: Channel;
|
|
14
|
+
searchSource: MessageSearchSource;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ChannelMediaListContext = React.createContext(
|
|
18
|
+
DEFAULT_BASE_CONTEXT_VALUE as ChannelMediaListContextValue,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @experimental This API is experimental and is subject to change.
|
|
23
|
+
*/
|
|
24
|
+
export const ChannelMediaListProvider = ({
|
|
25
|
+
channel,
|
|
26
|
+
children,
|
|
27
|
+
}: PropsWithChildren<{ channel: Channel }>) => {
|
|
28
|
+
const { client } = useChatContext();
|
|
29
|
+
const [searchSource] = useState(() => {
|
|
30
|
+
const source = new MessageSearchSource(client, {
|
|
31
|
+
allowEmptySearchString: true,
|
|
32
|
+
pageSize: 25,
|
|
33
|
+
resetOnNewSearchQuery: false,
|
|
34
|
+
});
|
|
35
|
+
source.messageSearchChannelFilters = { cid: channel.cid, members: undefined };
|
|
36
|
+
source.messageSearchFilters = {
|
|
37
|
+
'attachments.type': { $in: ['image', 'video'] },
|
|
38
|
+
type: undefined,
|
|
39
|
+
};
|
|
40
|
+
// Newest media first so the grid reads top-to-bottom from most recent.
|
|
41
|
+
source.messageSearchSort = { created_at: -1 };
|
|
42
|
+
source.activate();
|
|
43
|
+
return source;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<ChannelMediaListContext.Provider value={{ channel, searchSource }}>
|
|
48
|
+
{children}
|
|
49
|
+
</ChannelMediaListContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @experimental This API is experimental and is subject to change.
|
|
55
|
+
*/
|
|
56
|
+
export const useChannelMediaListContext = () => {
|
|
57
|
+
const contextValue = useContext(
|
|
58
|
+
ChannelMediaListContext,
|
|
59
|
+
) as unknown as ChannelMediaListContextValue;
|
|
60
|
+
|
|
61
|
+
if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
'The useChannelMediaListContext hook was called outside of the ChannelMediaListContext provider. Render the media list UI inside a ChannelMediaListProvider.',
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return contextValue;
|
|
68
|
+
};
|