stream-chat-react-native-core 5.2.0 → 5.3.0-beta.3

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 (130) hide show
  1. package/lib/commonjs/components/Attachment/Card.js +29 -18
  2. package/lib/commonjs/components/Attachment/Card.js.map +1 -1
  3. package/lib/commonjs/components/Attachment/Gallery.js +16 -20
  4. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/GalleryImage.js +34 -6
  6. package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/Giphy.js +37 -29
  8. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  9. package/lib/commonjs/components/Avatar/Avatar.js +10 -8
  10. package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
  11. package/lib/commonjs/components/Avatar/GroupAvatar.js +3 -1
  12. package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
  13. package/lib/commonjs/components/ChannelList/ChannelList.js +4 -4
  14. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  15. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +4 -4
  16. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
  17. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
  18. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  19. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
  20. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  21. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +30 -6
  22. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  23. package/lib/commonjs/components/Chat/Chat.js +8 -5
  24. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  25. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
  26. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  27. package/lib/commonjs/components/ImageBackground.js +64 -0
  28. package/lib/commonjs/components/ImageBackground.js.map +1 -0
  29. package/lib/commonjs/components/Message/Message.js +15 -16
  30. package/lib/commonjs/components/Message/Message.js.map +1 -1
  31. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +12 -4
  32. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  33. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
  34. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  35. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +58 -47
  36. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  37. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
  38. package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
  39. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  40. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
  41. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  42. package/lib/commonjs/native.js.map +1 -1
  43. package/lib/commonjs/version.json +1 -1
  44. package/lib/module/components/Attachment/Card.js +29 -18
  45. package/lib/module/components/Attachment/Card.js.map +1 -1
  46. package/lib/module/components/Attachment/Gallery.js +16 -20
  47. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  48. package/lib/module/components/Attachment/GalleryImage.js +34 -6
  49. package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
  50. package/lib/module/components/Attachment/Giphy.js +37 -29
  51. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  52. package/lib/module/components/Avatar/Avatar.js +10 -8
  53. package/lib/module/components/Avatar/Avatar.js.map +1 -1
  54. package/lib/module/components/Avatar/GroupAvatar.js +3 -1
  55. package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
  56. package/lib/module/components/ChannelList/ChannelList.js +4 -4
  57. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  58. package/lib/module/components/ChannelList/ChannelListMessenger.js +4 -4
  59. package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
  60. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
  61. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  62. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
  63. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  64. package/lib/module/components/ChannelPreview/ChannelAvatar.js +30 -6
  65. package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  66. package/lib/module/components/Chat/Chat.js +8 -5
  67. package/lib/module/components/Chat/Chat.js.map +1 -1
  68. package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
  69. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  70. package/lib/module/components/ImageBackground.js +64 -0
  71. package/lib/module/components/ImageBackground.js.map +1 -0
  72. package/lib/module/components/Message/Message.js +15 -16
  73. package/lib/module/components/Message/Message.js.map +1 -1
  74. package/lib/module/components/Message/MessageSimple/MessageAvatar.js +12 -4
  75. package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  76. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
  77. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  78. package/lib/module/components/MessageOverlay/MessageOverlay.js +58 -47
  79. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  80. package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
  81. package/lib/module/contexts/chatContext/ChatContext.js +2 -2
  82. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  83. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
  84. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  85. package/lib/module/native.js.map +1 -1
  86. package/lib/module/version.json +1 -1
  87. package/lib/typescript/components/Attachment/Card.d.ts +3 -2
  88. package/lib/typescript/components/Attachment/GalleryImage.d.ts +8 -2
  89. package/lib/typescript/components/Attachment/Giphy.d.ts +2 -1
  90. package/lib/typescript/components/Avatar/Avatar.d.ts +2 -1
  91. package/lib/typescript/components/Avatar/GroupAvatar.d.ts +2 -1
  92. package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +1 -1
  93. package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +2 -0
  94. package/lib/typescript/components/Chat/Chat.d.ts +1 -1
  95. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  96. package/lib/typescript/components/ImageBackground.d.ts +33 -0
  97. package/lib/typescript/components/Message/Message.d.ts +2 -1
  98. package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +2 -1
  99. package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +2 -0
  100. package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +1 -1
  101. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +3 -1
  102. package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +4 -0
  103. package/lib/typescript/native.d.ts +2 -2
  104. package/package.json +1 -1
  105. package/src/__tests__/offline-feature.test.js +3 -1
  106. package/src/components/Attachment/Card.tsx +11 -2
  107. package/src/components/Attachment/Gallery.tsx +1 -7
  108. package/src/components/Attachment/GalleryImage.tsx +31 -9
  109. package/src/components/Attachment/Giphy.tsx +8 -2
  110. package/src/components/Avatar/Avatar.tsx +12 -2
  111. package/src/components/Avatar/GroupAvatar.tsx +4 -4
  112. package/src/components/ChannelList/ChannelList.tsx +3 -2
  113. package/src/components/ChannelList/ChannelListMessenger.tsx +3 -3
  114. package/src/components/ChannelList/__tests__/ChannelList.test.js +1 -1
  115. package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +2 -1
  116. package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +1 -1
  117. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +12 -11
  118. package/src/components/ChannelPreview/ChannelAvatar.tsx +23 -4
  119. package/src/components/Chat/Chat.tsx +98 -95
  120. package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
  121. package/src/components/ImageBackground.tsx +77 -0
  122. package/src/components/Message/Message.tsx +8 -8
  123. package/src/components/Message/MessageSimple/MessageAvatar.tsx +6 -2
  124. package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +15 -3
  125. package/src/components/MessageOverlay/MessageOverlay.tsx +210 -205
  126. package/src/contexts/channelsContext/ChannelsContext.tsx +1 -1
  127. package/src/contexts/chatContext/ChatContext.tsx +3 -1
  128. package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +8 -1
  129. package/src/native.ts +2 -2
  130. package/src/version.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import React, { PropsWithChildren, useContext } from 'react';
2
+ import type { ImageProps } from 'react-native';
2
3
 
3
4
  import type { AppSettingsAPIResponse, Channel, EventHandler, Mute, StreamChat } from 'stream-chat';
4
5
 
@@ -34,6 +35,7 @@ export type ChatContextValue<
34
35
  client: StreamChat<StreamChatGenerics>;
35
36
  connectionRecovering: boolean;
36
37
  enableOfflineSupport: boolean;
38
+ ImageComponent: React.ComponentType<ImageProps>;
37
39
  isOnline: boolean;
38
40
  mutedUsers: Mute<StreamChatGenerics>[];
39
41
  /**
@@ -71,7 +73,7 @@ export const ChatProvider = <
71
73
  children,
72
74
  value,
73
75
  }: PropsWithChildren<{
74
- value: ChatContextValue<StreamChatGenerics>;
76
+ value?: ChatContextValue<StreamChatGenerics>;
75
77
  }>) => (
76
78
  <ChatContext.Provider value={value as unknown as ChatContextValue}>
77
79
  {children}
@@ -1,5 +1,7 @@
1
1
  import React, { PropsWithChildren, useContext } from 'react';
2
2
 
3
+ import type { ImageProps } from 'react-native';
4
+
3
5
  import type { Attachment, TranslationLanguages } from 'stream-chat';
4
6
 
5
7
  import { useResettableState } from './hooks/useResettableState';
@@ -15,6 +17,7 @@ import type { OverlayReactionsProps } from '../../components/MessageOverlay/Over
15
17
  import type { OverlayReactionsAvatarProps } from '../../components/MessageOverlay/OverlayReactionsAvatar';
16
18
  import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
17
19
  import type { ReactionData } from '../../utils/utils';
20
+ import type { ChatContextValue } from '../chatContext/ChatContext';
18
21
  import type { Alignment, MessageContextValue } from '../messageContext/MessageContext';
19
22
  import type { MessagesContextValue } from '../messagesContext/MessagesContext';
20
23
  import type { OwnCapabilitiesContextValue } from '../ownCapabilitiesContext/OwnCapabilitiesContext';
@@ -27,10 +30,12 @@ export type MessageOverlayData<
27
30
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
28
31
  > = {
29
32
  alignment?: Alignment;
33
+ chatContext?: ChatContextValue<StreamChatGenerics>;
30
34
  clientId?: string;
31
35
  files?: Attachment<StreamChatGenerics>[];
32
36
  groupStyles?: GroupType[];
33
37
  handleReaction?: (reactionType: string) => Promise<void>;
38
+ ImageComponent?: React.ComponentType<ImageProps>;
34
39
  images?: Attachment<StreamChatGenerics>[];
35
40
  message?: MessageType<StreamChatGenerics>;
36
41
  messageActions?: MessageActionType[];
@@ -89,7 +94,9 @@ export const MessageOverlayProvider = <
89
94
  }>) => {
90
95
  const messageOverlayContext = useResettableState(value);
91
96
  return (
92
- <MessageOverlayContext.Provider value={messageOverlayContext as MessageOverlayContextValue}>
97
+ <MessageOverlayContext.Provider
98
+ value={messageOverlayContext as unknown as MessageOverlayContextValue}
99
+ >
93
100
  {children}
94
101
  </MessageOverlayContext.Provider>
95
102
  );
package/src/native.ts CHANGED
@@ -27,7 +27,7 @@ export let compressImage: CompressImage = fail;
27
27
  type DeleteFile = ({ uri }: { uri: string }) => Promise<boolean> | never;
28
28
  export let deleteFile: DeleteFile = fail;
29
29
 
30
- type GetLocalAssetUri = (uriOrAssetId: string) => never;
30
+ type GetLocalAssetUri = (uriOrAssetId: string) => Promise<string> | never;
31
31
  export let getLocalAssetUri: GetLocalAssetUri = fail;
32
32
 
33
33
  type GetPhotos = ({ after, first }: { first: number; after?: string }) =>
@@ -157,7 +157,7 @@ export type SoundType = {
157
157
  source?: { uri: string },
158
158
  initialStatus?: Partial<AVPlaybackStatusToSet>,
159
159
  onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void,
160
- ) => SoundReturnType | null;
160
+ ) => Promise<SoundReturnType | null>;
161
161
  Player: React.ComponentType<SoundReturnType> | null;
162
162
  };
163
163
 
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.2.0"
2
+ "version": "5.3.0-beta.3"
3
3
  }