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.
Files changed (388) hide show
  1. package/lib/commonjs/components/ChannelDetails/ChannelDetails.js +8 -3
  2. package/lib/commonjs/components/ChannelDetails/ChannelDetails.js.map +1 -1
  3. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
  4. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
  5. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
  6. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
  7. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
  8. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
  9. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
  10. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
  11. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
  12. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
  13. package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
  14. package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
  15. package/lib/commonjs/components/ChannelDetails/components/index.js +22 -0
  16. package/lib/commonjs/components/ChannelDetails/components/index.js.map +1 -1
  17. package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
  18. package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
  19. package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js +22 -23
  20. package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js.map +1 -1
  21. package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
  22. package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
  23. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
  24. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
  25. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
  26. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
  27. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
  28. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
  29. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
  30. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
  31. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
  32. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
  33. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
  34. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
  35. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
  36. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
  37. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
  38. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
  39. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
  40. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
  41. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
  42. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
  43. package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js +114 -0
  44. package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
  45. package/lib/commonjs/components/ChannelDetails/hooks/index.js +33 -0
  46. package/lib/commonjs/components/ChannelDetails/hooks/index.js.map +1 -1
  47. package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
  48. package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
  49. package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
  50. package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
  51. package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js +30 -0
  52. package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
  53. package/lib/commonjs/components/ImageGallery/ImageGallery.js +21 -76
  54. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  55. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +6 -10
  56. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  57. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +16 -14
  58. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  59. package/lib/commonjs/components/ImageGallery/components/ImageGalleryA11yProbe.js +67 -0
  60. package/lib/commonjs/components/ImageGallery/components/ImageGalleryA11yProbe.js.map +1 -0
  61. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
  62. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  63. package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +4 -3
  64. package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
  65. package/lib/commonjs/components/ImageGallery/hooks/useCurrentImageHeight.js +53 -0
  66. package/lib/commonjs/components/ImageGallery/hooks/useCurrentImageHeight.js.map +1 -0
  67. package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js +25 -31
  68. package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
  69. package/lib/commonjs/components/UIComponents/EmptyList.js +78 -0
  70. package/lib/commonjs/components/UIComponents/EmptyList.js.map +1 -0
  71. package/lib/commonjs/components/UIComponents/index.js +11 -0
  72. package/lib/commonjs/components/UIComponents/index.js.map +1 -1
  73. package/lib/commonjs/components/ui/Avatar/AvatarGroup.js +3 -3
  74. package/lib/commonjs/components/ui/Avatar/constants.js +2 -2
  75. package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
  76. package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
  77. package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
  78. package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
  79. package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
  80. package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
  81. package/lib/commonjs/contexts/componentsContext/defaultComponents.js +8 -0
  82. package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
  83. package/lib/commonjs/contexts/index.js +33 -0
  84. package/lib/commonjs/contexts/index.js.map +1 -1
  85. package/lib/commonjs/contexts/themeContext/utils/theme.js +57 -2
  86. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  87. package/lib/commonjs/i18n/ar.json +11 -0
  88. package/lib/commonjs/i18n/en.json +11 -0
  89. package/lib/commonjs/i18n/es.json +11 -0
  90. package/lib/commonjs/i18n/fr.json +11 -0
  91. package/lib/commonjs/i18n/he.json +11 -0
  92. package/lib/commonjs/i18n/hi.json +11 -0
  93. package/lib/commonjs/i18n/it.json +11 -0
  94. package/lib/commonjs/i18n/ja.json +11 -0
  95. package/lib/commonjs/i18n/ko.json +11 -0
  96. package/lib/commonjs/i18n/nl.json +11 -0
  97. package/lib/commonjs/i18n/pt-br.json +11 -0
  98. package/lib/commonjs/i18n/ru.json +11 -0
  99. package/lib/commonjs/i18n/tr.json +11 -0
  100. package/lib/commonjs/icons/folder.js +37 -0
  101. package/lib/commonjs/icons/folder.js.map +1 -0
  102. package/lib/commonjs/icons/index.js +12 -0
  103. package/lib/commonjs/icons/index.js.map +1 -1
  104. package/lib/commonjs/state-store/image-gallery-state-store.js +12 -3
  105. package/lib/commonjs/state-store/image-gallery-state-store.js.map +1 -1
  106. package/lib/commonjs/version.json +1 -1
  107. package/lib/module/components/ChannelDetails/ChannelDetails.js +8 -3
  108. package/lib/module/components/ChannelDetails/ChannelDetails.js.map +1 -1
  109. package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
  110. package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
  111. package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
  112. package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
  113. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
  114. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
  115. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
  116. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
  117. package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
  118. package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
  119. package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
  120. package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
  121. package/lib/module/components/ChannelDetails/components/index.js +22 -0
  122. package/lib/module/components/ChannelDetails/components/index.js.map +1 -1
  123. package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
  124. package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
  125. package/lib/module/components/ChannelDetails/components/modal/Modal.js +22 -23
  126. package/lib/module/components/ChannelDetails/components/modal/Modal.js.map +1 -1
  127. package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
  128. package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
  129. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
  130. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
  131. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
  132. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
  133. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
  134. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
  135. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
  136. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
  137. package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
  138. package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
  139. package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
  140. package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
  141. package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
  142. package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
  143. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
  144. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
  145. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
  146. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
  147. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
  148. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
  149. package/lib/module/components/ChannelDetails/components/navigation-section/index.js +114 -0
  150. package/lib/module/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
  151. package/lib/module/components/ChannelDetails/hooks/index.js +33 -0
  152. package/lib/module/components/ChannelDetails/hooks/index.js.map +1 -1
  153. package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
  154. package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
  155. package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
  156. package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
  157. package/lib/module/components/ChannelDetails/hooks/useMediaList.js +30 -0
  158. package/lib/module/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
  159. package/lib/module/components/ImageGallery/ImageGallery.js +21 -76
  160. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  161. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +6 -10
  162. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  163. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +16 -14
  164. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  165. package/lib/module/components/ImageGallery/components/ImageGalleryA11yProbe.js +67 -0
  166. package/lib/module/components/ImageGallery/components/ImageGalleryA11yProbe.js.map +1 -0
  167. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
  168. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  169. package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +4 -3
  170. package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
  171. package/lib/module/components/ImageGallery/hooks/useCurrentImageHeight.js +53 -0
  172. package/lib/module/components/ImageGallery/hooks/useCurrentImageHeight.js.map +1 -0
  173. package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js +25 -31
  174. package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
  175. package/lib/module/components/UIComponents/EmptyList.js +78 -0
  176. package/lib/module/components/UIComponents/EmptyList.js.map +1 -0
  177. package/lib/module/components/UIComponents/index.js +11 -0
  178. package/lib/module/components/UIComponents/index.js.map +1 -1
  179. package/lib/module/components/ui/Avatar/AvatarGroup.js +3 -3
  180. package/lib/module/components/ui/Avatar/constants.js +2 -2
  181. package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
  182. package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
  183. package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
  184. package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
  185. package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
  186. package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
  187. package/lib/module/contexts/componentsContext/defaultComponents.js +8 -0
  188. package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
  189. package/lib/module/contexts/index.js +33 -0
  190. package/lib/module/contexts/index.js.map +1 -1
  191. package/lib/module/contexts/themeContext/utils/theme.js +57 -2
  192. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  193. package/lib/module/i18n/ar.json +11 -0
  194. package/lib/module/i18n/en.json +11 -0
  195. package/lib/module/i18n/es.json +11 -0
  196. package/lib/module/i18n/fr.json +11 -0
  197. package/lib/module/i18n/he.json +11 -0
  198. package/lib/module/i18n/hi.json +11 -0
  199. package/lib/module/i18n/it.json +11 -0
  200. package/lib/module/i18n/ja.json +11 -0
  201. package/lib/module/i18n/ko.json +11 -0
  202. package/lib/module/i18n/nl.json +11 -0
  203. package/lib/module/i18n/pt-br.json +11 -0
  204. package/lib/module/i18n/ru.json +11 -0
  205. package/lib/module/i18n/tr.json +11 -0
  206. package/lib/module/icons/folder.js +37 -0
  207. package/lib/module/icons/folder.js.map +1 -0
  208. package/lib/module/icons/index.js +12 -0
  209. package/lib/module/icons/index.js.map +1 -1
  210. package/lib/module/state-store/image-gallery-state-store.js +12 -3
  211. package/lib/module/state-store/image-gallery-state-store.js.map +1 -1
  212. package/lib/module/version.json +1 -1
  213. package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts +11 -1
  214. package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts.map +1 -1
  215. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsActionItem.d.ts.map +1 -1
  216. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts +6 -0
  217. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts.map +1 -0
  218. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts +3 -1
  219. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts.map +1 -1
  220. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavigationSection.d.ts.map +1 -1
  221. package/lib/typescript/components/ChannelDetails/components/index.d.ts +3 -0
  222. package/lib/typescript/components/ChannelDetails/components/index.d.ts.map +1 -1
  223. package/lib/typescript/components/ChannelDetails/components/members/ChannelMemberItem.d.ts.map +1 -1
  224. package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts +2 -1
  225. package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts.map +1 -1
  226. package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts +3 -1
  227. package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts.map +1 -1
  228. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts +31 -0
  229. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts.map +1 -0
  230. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts +17 -0
  231. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts.map +1 -0
  232. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts +9 -0
  233. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts.map +1 -0
  234. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts +13 -0
  235. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts.map +1 -0
  236. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts +35 -0
  237. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts.map +1 -0
  238. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts +17 -0
  239. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts.map +1 -0
  240. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts +11 -0
  241. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts.map +1 -0
  242. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts +19 -0
  243. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts.map +1 -0
  244. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts +19 -0
  245. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts.map +1 -0
  246. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts +9 -0
  247. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts.map +1 -0
  248. package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts +11 -0
  249. package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts.map +1 -0
  250. package/lib/typescript/components/ChannelDetails/hooks/index.d.ts +3 -0
  251. package/lib/typescript/components/ChannelDetails/hooks/index.d.ts.map +1 -1
  252. package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts +56 -0
  253. package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts.map +1 -0
  254. package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts +28 -0
  255. package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts.map +1 -0
  256. package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts +20 -0
  257. package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts.map +1 -0
  258. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
  259. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts.map +1 -1
  260. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +1 -4
  261. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts.map +1 -1
  262. package/lib/typescript/components/ImageGallery/components/ImageGalleryA11yProbe.d.ts +20 -0
  263. package/lib/typescript/components/ImageGallery/components/ImageGalleryA11yProbe.d.ts.map +1 -0
  264. package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
  265. package/lib/typescript/components/ImageGallery/hooks/useAnimatedGalleryStyle.d.ts +2 -3
  266. package/lib/typescript/components/ImageGallery/hooks/useAnimatedGalleryStyle.d.ts.map +1 -1
  267. package/lib/typescript/components/ImageGallery/hooks/useCurrentImageHeight.d.ts +24 -0
  268. package/lib/typescript/components/ImageGallery/hooks/useCurrentImageHeight.d.ts.map +1 -0
  269. package/lib/typescript/components/ImageGallery/hooks/useImageGalleryGestures.d.ts +1 -1
  270. package/lib/typescript/components/ImageGallery/hooks/useImageGalleryGestures.d.ts.map +1 -1
  271. package/lib/typescript/components/UIComponents/EmptyList.d.ts +24 -0
  272. package/lib/typescript/components/UIComponents/EmptyList.d.ts.map +1 -0
  273. package/lib/typescript/components/UIComponents/index.d.ts +1 -0
  274. package/lib/typescript/components/UIComponents/index.d.ts.map +1 -1
  275. package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts +21 -0
  276. package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts.map +1 -0
  277. package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts +21 -0
  278. package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts.map +1 -0
  279. package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts +21 -0
  280. package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts.map +1 -0
  281. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +18 -2
  282. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
  283. package/lib/typescript/contexts/index.d.ts +3 -0
  284. package/lib/typescript/contexts/index.d.ts.map +1 -1
  285. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +56 -1
  286. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
  287. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +56 -1
  288. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  289. package/lib/typescript/i18n/ar.json +11 -0
  290. package/lib/typescript/i18n/en.json +11 -0
  291. package/lib/typescript/i18n/es.json +11 -0
  292. package/lib/typescript/i18n/fr.json +11 -0
  293. package/lib/typescript/i18n/he.json +11 -0
  294. package/lib/typescript/i18n/hi.json +11 -0
  295. package/lib/typescript/i18n/it.json +11 -0
  296. package/lib/typescript/i18n/ja.json +11 -0
  297. package/lib/typescript/i18n/ko.json +11 -0
  298. package/lib/typescript/i18n/nl.json +11 -0
  299. package/lib/typescript/i18n/pt-br.json +11 -0
  300. package/lib/typescript/i18n/ru.json +11 -0
  301. package/lib/typescript/i18n/tr.json +11 -0
  302. package/lib/typescript/icons/folder.d.ts +4 -0
  303. package/lib/typescript/icons/folder.d.ts.map +1 -0
  304. package/lib/typescript/icons/index.d.ts +1 -0
  305. package/lib/typescript/icons/index.d.ts.map +1 -1
  306. package/lib/typescript/state-store/image-gallery-state-store.d.ts +8 -0
  307. package/lib/typescript/state-store/image-gallery-state-store.d.ts.map +1 -1
  308. package/lib/typescript/utils/i18n/Streami18n.d.ts +11 -0
  309. package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
  310. package/package.json +1 -1
  311. package/src/components/ChannelDetails/ChannelDetails.tsx +17 -2
  312. package/src/components/ChannelDetails/__tests__/ChannelDetails.test.tsx +29 -0
  313. package/src/components/ChannelDetails/__tests__/ChannelDetailsEditButton.test.tsx +127 -0
  314. package/src/components/ChannelDetails/__tests__/ChannelDetailsNavHeader.test.tsx +21 -56
  315. package/src/components/ChannelDetails/__tests__/ChannelDetailsNavigationSection.test.tsx +225 -6
  316. package/src/components/ChannelDetails/__tests__/useFileAttachmentListSections.test.tsx +159 -0
  317. package/src/components/ChannelDetails/__tests__/useMediaList.test.tsx +53 -0
  318. package/src/components/ChannelDetails/components/ChannelDetailsActionItem.tsx +6 -1
  319. package/src/components/ChannelDetails/components/ChannelDetailsEditButton.tsx +50 -0
  320. package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx +6 -33
  321. package/src/components/ChannelDetails/components/ChannelDetailsNavigationSection.tsx +80 -32
  322. package/src/components/ChannelDetails/components/ChannelDetailsProfile.tsx +2 -1
  323. package/src/components/ChannelDetails/components/ChannelEditImageSheet.tsx +2 -2
  324. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentItem.test.tsx +80 -0
  325. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentList.test.tsx +334 -0
  326. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentListSectionHeader.test.tsx +19 -0
  327. package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaItem.test.tsx +97 -0
  328. package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaList.test.tsx +351 -0
  329. package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageItem.test.tsx +112 -0
  330. package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageList.test.tsx +324 -0
  331. package/src/components/ChannelDetails/components/index.ts +3 -0
  332. package/src/components/ChannelDetails/components/members/ChannelMemberItem.tsx +6 -1
  333. package/src/components/ChannelDetails/components/modal/Modal.tsx +37 -24
  334. package/src/components/ChannelDetails/components/modal/ModalHeader.tsx +11 -4
  335. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentItem.tsx +92 -0
  336. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentList.tsx +204 -0
  337. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.tsx +23 -0
  338. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.tsx +56 -0
  339. package/src/components/ChannelDetails/components/navigation-section/MediaItem.tsx +160 -0
  340. package/src/components/ChannelDetails/components/navigation-section/MediaList.tsx +244 -0
  341. package/src/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.tsx +66 -0
  342. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageItem.tsx +94 -0
  343. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageList.tsx +198 -0
  344. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.tsx +23 -0
  345. package/src/components/ChannelDetails/components/navigation-section/index.ts +10 -0
  346. package/src/components/ChannelDetails/hooks/index.ts +3 -0
  347. package/src/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.ts +108 -0
  348. package/src/components/ChannelDetails/hooks/useFileAttachmentListSections.ts +79 -0
  349. package/src/components/ChannelDetails/hooks/useMediaList.ts +51 -0
  350. package/src/components/ImageGallery/ImageGallery.tsx +41 -120
  351. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +4 -1
  352. package/src/components/ImageGallery/__tests__/ImageGalleryAdjustable.test.tsx +5 -4
  353. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +9 -11
  354. package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +28 -15
  355. package/src/components/ImageGallery/components/ImageGalleryA11yProbe.tsx +82 -0
  356. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +21 -18
  357. package/src/components/ImageGallery/hooks/useAnimatedGalleryStyle.tsx +5 -5
  358. package/src/components/ImageGallery/hooks/useCurrentImageHeight.ts +86 -0
  359. package/src/components/ImageGallery/hooks/useImageGalleryGestures.tsx +42 -51
  360. package/src/components/UIComponents/EmptyList.tsx +80 -0
  361. package/src/components/UIComponents/__tests__/EmptyList.test.tsx +90 -0
  362. package/src/components/UIComponents/index.ts +1 -0
  363. package/src/components/ui/Avatar/AvatarGroup.tsx +3 -3
  364. package/src/components/ui/Avatar/constants.ts +2 -2
  365. package/src/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.tsx +67 -0
  366. package/src/contexts/channelMediaListContext/ChannelMediaListContext.tsx +68 -0
  367. package/src/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.tsx +72 -0
  368. package/src/contexts/componentsContext/defaultComponents.ts +16 -1
  369. package/src/contexts/index.ts +3 -0
  370. package/src/contexts/themeContext/utils/theme.ts +112 -2
  371. package/src/i18n/ar.json +11 -0
  372. package/src/i18n/en.json +11 -0
  373. package/src/i18n/es.json +11 -0
  374. package/src/i18n/fr.json +11 -0
  375. package/src/i18n/he.json +11 -0
  376. package/src/i18n/hi.json +11 -0
  377. package/src/i18n/it.json +11 -0
  378. package/src/i18n/ja.json +11 -0
  379. package/src/i18n/ko.json +11 -0
  380. package/src/i18n/nl.json +11 -0
  381. package/src/i18n/pt-br.json +11 -0
  382. package/src/i18n/ru.json +11 -0
  383. package/src/i18n/tr.json +11 -0
  384. package/src/icons/folder.tsx +28 -0
  385. package/src/icons/index.ts +1 -0
  386. package/src/state-store/__tests__/image-gallery-state-store.test.ts +81 -0
  387. package/src/state-store/image-gallery-state-store.ts +27 -1
  388. 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, useState } from 'react';
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 { currentIndex } = useStateStore(imageGalleryStateStore.state, imageGallerySelector);
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(setIndex)(index + 1);
167
- imageGalleryStateStore.currentIndex = index + 1;
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
- runOnJS(setIndex)(index - 1);
172
- imageGalleryStateStore.currentIndex = index - 1;
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 = isAndroid ? 1 : 0.25;
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
- currentImageHeight * offsetScale.value < screenHeight && translateY.value > 0
251
+ imageHeight * offsetScale.value < screenHeight && translateY.value > 0
266
252
  ? offsetScale.value * (1 - (1 / 3) * (translateY.value / screenHeight))
267
- : currentImageHeight * offsetScale.value > screenHeight &&
268
- translateY.value > (currentImageHeight / 2) * offsetScale.value - halfScreenHeight
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
- ((currentImageHeight / 2) * offsetScale.value - halfScreenHeight)) /
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
- index < assetsLength - 1 &&
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) * (index + 1),
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
- index > 0 &&
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) * (index - 1),
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
- currentImageHeight * scale.value < screenHeight
369
+ imageHeight * scale.value < screenHeight
381
370
  ? withTiming(0, { reduceMotion: ReduceMotion.Never })
382
- : translateY.value > (currentImageHeight / 2) * scale.value - halfScreenHeight
383
- ? withTiming((currentImageHeight / 2) * scale.value - halfScreenHeight, {
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 < (-currentImageHeight / 2) * scale.value + halfScreenHeight
387
- ? withTiming((-currentImageHeight / 2) * scale.value + halfScreenHeight)
375
+ : translateY.value < (-imageHeight / 2) * scale.value + halfScreenHeight
376
+ ? withTiming((-imageHeight / 2) * scale.value + halfScreenHeight)
388
377
  : withDecay({
389
378
  clamp: [
390
- (-currentImageHeight / 2) * scale.value + halfScreenHeight,
391
- (currentImageHeight / 2) * scale.value - halfScreenHeight,
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 >= (currentImageHeight / 2) * scale.value - halfScreenHeight &&
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 + (currentImageHeight / 2) * scale.value, {
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
- currentImageHeight * scale.value < screenHeight
656
+ imageHeight * scale.value < screenHeight
667
657
  ? withTiming(0)
668
- : translateY.value > (currentImageHeight / 2) * scale.value - screenHeight / 2
669
- ? withTiming((currentImageHeight / 2) * scale.value - screenHeight / 2)
670
- : translateY.value < (-currentImageHeight / 2) * scale.value + screenHeight / 2
671
- ? withTiming((-currentImageHeight / 2) * scale.value + screenHeight / 2)
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
- if (currentImageHeight * 2 > screenHeight) {
717
+ const imageHeight = currentImageHeight.value;
718
+ if (imageHeight * 2 > screenHeight) {
728
719
  const translateYTopBottom =
729
720
  event.absoluteY > halfScreenHeight
730
- ? -(currentImageHeight * 2 - screenHeight) / 2
731
- : (currentImageHeight * 2 - screenHeight) / 2;
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
+ });
@@ -1,6 +1,7 @@
1
1
  export * from './BottomSheetModal';
2
2
  export * from './ClippingFadeBottom';
3
3
  export * from './StreamBottomSheetModalFlatList';
4
+ export * from './EmptyList';
4
5
  export * from './EmptySearchResult';
5
6
  export * from './ImageBackground';
6
7
  export * from './SearchInput';
@@ -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: 64,
32
- height: 64,
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': 'lg',
168
+ '2xl': 'xl',
169
169
  xl: 'md',
170
170
  lg: 'sm',
171
171
  };
@@ -7,8 +7,8 @@ import { OnlineIndicatorProps } from '../Badge';
7
7
 
8
8
  const avatarSizes = {
9
9
  '2xl': {
10
- height: 64,
11
- width: 64,
10
+ height: 80,
11
+ width: 80,
12
12
  },
13
13
  xl: {
14
14
  height: 48,
@@ -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
+ };