@kesha-antonov/react-native-chat 4.1.0

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 (263) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1087 -0
  3. package/lib/Actions.d.ts +16 -0
  4. package/lib/Actions.d.ts.map +1 -0
  5. package/lib/Actions.js +64 -0
  6. package/lib/Actions.js.map +1 -0
  7. package/lib/Avatar.d.ts +19 -0
  8. package/lib/Avatar.d.ts.map +1 -0
  9. package/lib/Avatar.js +93 -0
  10. package/lib/Avatar.js.map +1 -0
  11. package/lib/Bubble/index.d.ts +6 -0
  12. package/lib/Bubble/index.d.ts.map +1 -0
  13. package/lib/Bubble/index.js +391 -0
  14. package/lib/Bubble/index.js.map +1 -0
  15. package/lib/Bubble/styles.d.ts +57 -0
  16. package/lib/Bubble/styles.d.ts.map +1 -0
  17. package/lib/Bubble/styles.js +59 -0
  18. package/lib/Bubble/styles.js.map +1 -0
  19. package/lib/Bubble/types.d.ts +62 -0
  20. package/lib/Bubble/types.d.ts.map +1 -0
  21. package/lib/Bubble/types.js +2 -0
  22. package/lib/Bubble/types.js.map +1 -0
  23. package/lib/Chat/index.d.ts +10 -0
  24. package/lib/Chat/index.d.ts.map +1 -0
  25. package/lib/Chat/index.js +243 -0
  26. package/lib/Chat/index.js.map +1 -0
  27. package/lib/Chat/styles.d.ts +13 -0
  28. package/lib/Chat/styles.d.ts.map +1 -0
  29. package/lib/Chat/styles.js +13 -0
  30. package/lib/Chat/styles.js.map +1 -0
  31. package/lib/Chat/types.d.ts +102 -0
  32. package/lib/Chat/types.d.ts.map +1 -0
  33. package/lib/Chat/types.js +2 -0
  34. package/lib/Chat/types.js.map +1 -0
  35. package/lib/ChatAvatar.d.ts +12 -0
  36. package/lib/ChatAvatar.d.ts.map +1 -0
  37. package/lib/ChatAvatar.js +100 -0
  38. package/lib/ChatAvatar.js.map +1 -0
  39. package/lib/ChatContext.d.ts +12 -0
  40. package/lib/ChatContext.d.ts.map +1 -0
  41. package/lib/ChatContext.js +10 -0
  42. package/lib/ChatContext.js.map +1 -0
  43. package/lib/Color.d.ts +18 -0
  44. package/lib/Color.d.ts.map +1 -0
  45. package/lib/Color.js +18 -0
  46. package/lib/Color.js.map +1 -0
  47. package/lib/Composer.d.ts +9 -0
  48. package/lib/Composer.d.ts.map +1 -0
  49. package/lib/Composer.js +63 -0
  50. package/lib/Composer.js.map +1 -0
  51. package/lib/Constant.d.ts +8 -0
  52. package/lib/Constant.d.ts.map +1 -0
  53. package/lib/Constant.js +8 -0
  54. package/lib/Constant.js.map +1 -0
  55. package/lib/Day/index.d.ts +5 -0
  56. package/lib/Day/index.d.ts.map +1 -0
  57. package/lib/Day/index.js +39 -0
  58. package/lib/Day/index.js.map +1 -0
  59. package/lib/Day/styles.d.ts +21 -0
  60. package/lib/Day/styles.d.ts.map +1 -0
  61. package/lib/Day/styles.js +22 -0
  62. package/lib/Day/styles.js.map +1 -0
  63. package/lib/Day/types.d.ts +17 -0
  64. package/lib/Day/types.d.ts.map +1 -0
  65. package/lib/Day/types.js +2 -0
  66. package/lib/Day/types.js.map +1 -0
  67. package/lib/InputToolbar.d.ts +36 -0
  68. package/lib/InputToolbar.d.ts.map +1 -0
  69. package/lib/InputToolbar.js +108 -0
  70. package/lib/InputToolbar.js.map +1 -0
  71. package/lib/LoadEarlierMessages.d.ts +17 -0
  72. package/lib/LoadEarlierMessages.d.ts.map +1 -0
  73. package/lib/LoadEarlierMessages.js +44 -0
  74. package/lib/LoadEarlierMessages.js.map +1 -0
  75. package/lib/Message/index.d.ts +6 -0
  76. package/lib/Message/index.d.ts.map +1 -0
  77. package/lib/Message/index.js +180 -0
  78. package/lib/Message/index.js.map +1 -0
  79. package/lib/Message/styles.d.ts +18 -0
  80. package/lib/Message/styles.d.ts.map +1 -0
  81. package/lib/Message/styles.js +18 -0
  82. package/lib/Message/styles.js.map +1 -0
  83. package/lib/Message/types.d.ts +28 -0
  84. package/lib/Message/types.d.ts.map +1 -0
  85. package/lib/Message/types.js +2 -0
  86. package/lib/Message/types.js.map +1 -0
  87. package/lib/MessageAudio.d.ts +3 -0
  88. package/lib/MessageAudio.d.ts.map +1 -0
  89. package/lib/MessageAudio.js +24 -0
  90. package/lib/MessageAudio.js.map +1 -0
  91. package/lib/MessageImage.d.ts +12 -0
  92. package/lib/MessageImage.d.ts.map +1 -0
  93. package/lib/MessageImage.js +164 -0
  94. package/lib/MessageImage.js.map +1 -0
  95. package/lib/MessageReply.d.ts +15 -0
  96. package/lib/MessageReply.d.ts.map +1 -0
  97. package/lib/MessageReply.js +102 -0
  98. package/lib/MessageReply.js.map +1 -0
  99. package/lib/MessageText.d.ts +24 -0
  100. package/lib/MessageText.d.ts.map +1 -0
  101. package/lib/MessageText.js +51 -0
  102. package/lib/MessageText.js.map +1 -0
  103. package/lib/MessageVideo.d.ts +3 -0
  104. package/lib/MessageVideo.d.ts.map +1 -0
  105. package/lib/MessageVideo.js +24 -0
  106. package/lib/MessageVideo.js.map +1 -0
  107. package/lib/MessagesContainer/components/DayAnimated/debug.d.ts +8 -0
  108. package/lib/MessagesContainer/components/DayAnimated/debug.d.ts.map +1 -0
  109. package/lib/MessagesContainer/components/DayAnimated/debug.js +38 -0
  110. package/lib/MessagesContainer/components/DayAnimated/debug.js.map +1 -0
  111. package/lib/MessagesContainer/components/DayAnimated/index.d.ts +5 -0
  112. package/lib/MessagesContainer/components/DayAnimated/index.d.ts.map +1 -0
  113. package/lib/MessagesContainer/components/DayAnimated/index.js +123 -0
  114. package/lib/MessagesContainer/components/DayAnimated/index.js.map +1 -0
  115. package/lib/MessagesContainer/components/DayAnimated/styles.d.ts +12 -0
  116. package/lib/MessagesContainer/components/DayAnimated/styles.d.ts.map +1 -0
  117. package/lib/MessagesContainer/components/DayAnimated/styles.js +12 -0
  118. package/lib/MessagesContainer/components/DayAnimated/styles.js.map +1 -0
  119. package/lib/MessagesContainer/components/DayAnimated/types.d.ts +22 -0
  120. package/lib/MessagesContainer/components/DayAnimated/types.d.ts.map +1 -0
  121. package/lib/MessagesContainer/components/DayAnimated/types.js +2 -0
  122. package/lib/MessagesContainer/components/DayAnimated/types.js.map +1 -0
  123. package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.d.ts +4 -0
  124. package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.d.ts.map +1 -0
  125. package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.js +37 -0
  126. package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.js.map +1 -0
  127. package/lib/MessagesContainer/components/Item/index.d.ts +6 -0
  128. package/lib/MessagesContainer/components/Item/index.d.ts.map +1 -0
  129. package/lib/MessagesContainer/components/Item/index.js +86 -0
  130. package/lib/MessagesContainer/components/Item/index.js.map +1 -0
  131. package/lib/MessagesContainer/components/Item/types.d.ts +22 -0
  132. package/lib/MessagesContainer/components/Item/types.d.ts.map +1 -0
  133. package/lib/MessagesContainer/components/Item/types.js +2 -0
  134. package/lib/MessagesContainer/components/Item/types.js.map +1 -0
  135. package/lib/MessagesContainer/components/dayLayout.d.ts +10 -0
  136. package/lib/MessagesContainer/components/dayLayout.d.ts.map +1 -0
  137. package/lib/MessagesContainer/components/dayLayout.js +37 -0
  138. package/lib/MessagesContainer/components/dayLayout.js.map +1 -0
  139. package/lib/MessagesContainer/index.d.ts +6 -0
  140. package/lib/MessagesContainer/index.d.ts.map +1 -0
  141. package/lib/MessagesContainer/index.js +308 -0
  142. package/lib/MessagesContainer/index.js.map +1 -0
  143. package/lib/MessagesContainer/styles.d.ts +55 -0
  144. package/lib/MessagesContainer/styles.d.ts.map +1 -0
  145. package/lib/MessagesContainer/styles.js +42 -0
  146. package/lib/MessagesContainer/styles.js.map +1 -0
  147. package/lib/MessagesContainer/types.d.ts +91 -0
  148. package/lib/MessagesContainer/types.d.ts.map +1 -0
  149. package/lib/MessagesContainer/types.js +10 -0
  150. package/lib/MessagesContainer/types.js.map +1 -0
  151. package/lib/Models.d.ts +67 -0
  152. package/lib/Models.d.ts.map +1 -0
  153. package/lib/Models.js +2 -0
  154. package/lib/Models.js.map +1 -0
  155. package/lib/QuickReplies.d.ts +16 -0
  156. package/lib/QuickReplies.d.ts.map +1 -0
  157. package/lib/QuickReplies.js +107 -0
  158. package/lib/QuickReplies.js.map +1 -0
  159. package/lib/Reactions/MessageReactions.d.ts +5 -0
  160. package/lib/Reactions/MessageReactions.d.ts.map +1 -0
  161. package/lib/Reactions/MessageReactions.js +83 -0
  162. package/lib/Reactions/MessageReactions.js.map +1 -0
  163. package/lib/Reactions/ReactionPicker.d.ts +10 -0
  164. package/lib/Reactions/ReactionPicker.d.ts.map +1 -0
  165. package/lib/Reactions/ReactionPicker.js +84 -0
  166. package/lib/Reactions/ReactionPicker.js.map +1 -0
  167. package/lib/Reactions/index.d.ts +6 -0
  168. package/lib/Reactions/index.d.ts.map +1 -0
  169. package/lib/Reactions/index.js +6 -0
  170. package/lib/Reactions/index.js.map +1 -0
  171. package/lib/Reactions/types.d.ts +79 -0
  172. package/lib/Reactions/types.d.ts.map +1 -0
  173. package/lib/Reactions/types.js +2 -0
  174. package/lib/Reactions/types.js.map +1 -0
  175. package/lib/Reply/index.d.ts +2 -0
  176. package/lib/Reply/index.d.ts.map +1 -0
  177. package/lib/Reply/index.js +2 -0
  178. package/lib/Reply/index.js.map +1 -0
  179. package/lib/Reply/types.d.ts +72 -0
  180. package/lib/Reply/types.d.ts.map +1 -0
  181. package/lib/Reply/types.js +2 -0
  182. package/lib/Reply/types.js.map +1 -0
  183. package/lib/ReplyPreview.d.ts +14 -0
  184. package/lib/ReplyPreview.d.ts.map +1 -0
  185. package/lib/ReplyPreview.js +94 -0
  186. package/lib/ReplyPreview.js.map +1 -0
  187. package/lib/Send.d.ts +19 -0
  188. package/lib/Send.d.ts.map +1 -0
  189. package/lib/Send.js +56 -0
  190. package/lib/Send.js.map +1 -0
  191. package/lib/SystemMessage.d.ts +14 -0
  192. package/lib/SystemMessage.d.ts.map +1 -0
  193. package/lib/SystemMessage.js +42 -0
  194. package/lib/SystemMessage.js.map +1 -0
  195. package/lib/Time.d.ts +12 -0
  196. package/lib/Time.d.ts.map +1 -0
  197. package/lib/Time.js +38 -0
  198. package/lib/Time.js.map +1 -0
  199. package/lib/TypingIndicator/index.d.ts +5 -0
  200. package/lib/TypingIndicator/index.d.ts.map +1 -0
  201. package/lib/TypingIndicator/index.js +94 -0
  202. package/lib/TypingIndicator/index.js.map +1 -0
  203. package/lib/TypingIndicator/styles.d.ts +21 -0
  204. package/lib/TypingIndicator/styles.d.ts.map +1 -0
  205. package/lib/TypingIndicator/styles.js +22 -0
  206. package/lib/TypingIndicator/styles.js.map +1 -0
  207. package/lib/TypingIndicator/types.d.ts +6 -0
  208. package/lib/TypingIndicator/types.d.ts.map +1 -0
  209. package/lib/TypingIndicator/types.js +2 -0
  210. package/lib/TypingIndicator/types.js.map +1 -0
  211. package/lib/components/MessageReply.d.ts +29 -0
  212. package/lib/components/MessageReply.d.ts.map +1 -0
  213. package/lib/components/MessageReply.js +87 -0
  214. package/lib/components/MessageReply.js.map +1 -0
  215. package/lib/components/ReplyPreview.d.ts +17 -0
  216. package/lib/components/ReplyPreview.d.ts.map +1 -0
  217. package/lib/components/ReplyPreview.js +148 -0
  218. package/lib/components/ReplyPreview.js.map +1 -0
  219. package/lib/components/StreamingCursor.d.ts +15 -0
  220. package/lib/components/StreamingCursor.d.ts.map +1 -0
  221. package/lib/components/StreamingCursor.js +16 -0
  222. package/lib/components/StreamingCursor.js.map +1 -0
  223. package/lib/components/TouchableOpacity.d.ts +9 -0
  224. package/lib/components/TouchableOpacity.d.ts.map +1 -0
  225. package/lib/components/TouchableOpacity.js +47 -0
  226. package/lib/components/TouchableOpacity.js.map +1 -0
  227. package/lib/hooks/useColorScheme.d.ts +8 -0
  228. package/lib/hooks/useColorScheme.d.ts.map +1 -0
  229. package/lib/hooks/useColorScheme.js +17 -0
  230. package/lib/hooks/useColorScheme.js.map +1 -0
  231. package/lib/hooks/useStreamingMessages.d.ts +42 -0
  232. package/lib/hooks/useStreamingMessages.d.ts.map +1 -0
  233. package/lib/hooks/useStreamingMessages.js +96 -0
  234. package/lib/hooks/useStreamingMessages.js.map +1 -0
  235. package/lib/hooks/useUpdateLayoutEffect.d.ts +9 -0
  236. package/lib/hooks/useUpdateLayoutEffect.d.ts.map +1 -0
  237. package/lib/hooks/useUpdateLayoutEffect.js +17 -0
  238. package/lib/hooks/useUpdateLayoutEffect.js.map +1 -0
  239. package/lib/index.d.ts +35 -0
  240. package/lib/index.d.ts.map +1 -0
  241. package/lib/index.js +34 -0
  242. package/lib/index.js.map +1 -0
  243. package/lib/linkParser.d.ts +39 -0
  244. package/lib/linkParser.d.ts.map +1 -0
  245. package/lib/linkParser.js +154 -0
  246. package/lib/linkParser.js.map +1 -0
  247. package/lib/logging.d.ts +3 -0
  248. package/lib/logging.d.ts.map +1 -0
  249. package/lib/logging.js +5 -0
  250. package/lib/logging.js.map +1 -0
  251. package/lib/styles.d.ts +14 -0
  252. package/lib/styles.d.ts.map +1 -0
  253. package/lib/styles.js +23 -0
  254. package/lib/styles.js.map +1 -0
  255. package/lib/types.d.ts +19 -0
  256. package/lib/types.d.ts.map +1 -0
  257. package/lib/types.js +2 -0
  258. package/lib/types.js.map +1 -0
  259. package/lib/utils.d.ts +8 -0
  260. package/lib/utils.d.ts.map +1 -0
  261. package/lib/utils.js +105 -0
  262. package/lib/utils.js.map +1 -0
  263. package/package.json +119 -0
@@ -0,0 +1,16 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, TextStyle } from 'react-native';
3
+ export interface ActionsProps {
4
+ actions?: Array<{
5
+ title: string;
6
+ action: () => void;
7
+ }>;
8
+ actionSheetOptionTintColor?: string;
9
+ icon?: () => ReactNode;
10
+ wrapperStyle?: StyleProp<ViewStyle>;
11
+ iconTextStyle?: StyleProp<TextStyle>;
12
+ buttonStyle?: StyleProp<ViewStyle>;
13
+ onPressActionButton?(): void;
14
+ }
15
+ export declare function Actions({ actions, actionSheetOptionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, buttonStyle, }: ActionsProps): React.JSX.Element;
16
+ //# sourceMappingURL=Actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AACrD,OAAO,EAGL,SAAS,EACT,SAAS,EACT,SAAS,EACH,MAAM,cAAc,CAAA;AAM5B,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;IACtD,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,SAAS,CAAA;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACnC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACpC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAClC,mBAAmB,CAAC,IAAI,IAAI,CAAA;CAC7B;AAED,wBAAgB,OAAO,CAAE,EACvB,OAAO,EACP,0BAAkD,EAClD,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,WAAW,GACZ,EAAE,YAAY,qBAmDd"}
package/lib/Actions.js ADDED
@@ -0,0 +1,64 @@
1
+ import React, { useCallback } from 'react';
2
+ import { StyleSheet, View, Text } from 'react-native';
3
+ import { useChatContext } from './ChatContext';
4
+ import { Color } from './Color';
5
+ import { TouchableOpacity } from './components/TouchableOpacity';
6
+ import stylesCommon from './styles';
7
+ export function Actions({ actions, actionSheetOptionTintColor = Color.optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, buttonStyle, }) {
8
+ const { actionSheet } = useChatContext();
9
+ const handlePress = useCallback(() => {
10
+ if (onPressActionButton) {
11
+ onPressActionButton();
12
+ return;
13
+ }
14
+ if (!actions?.length)
15
+ return;
16
+ const titles = actions.map(item => item.title);
17
+ actionSheet().showActionSheetWithOptions({
18
+ options: titles,
19
+ cancelButtonIndex: titles.length - 1,
20
+ tintColor: actionSheetOptionTintColor,
21
+ }, (buttonIndex) => {
22
+ if (buttonIndex === undefined)
23
+ return;
24
+ const item = actions[buttonIndex];
25
+ item.action?.();
26
+ });
27
+ }, [actionSheet, actions, actionSheetOptionTintColor, onPressActionButton]);
28
+ const renderIcon = useCallback(() => {
29
+ if (icon)
30
+ return icon();
31
+ return (<View style={[stylesCommon.centerItems, styles.wrapper, wrapperStyle]}>
32
+ <Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
33
+ </View>);
34
+ }, [icon, iconTextStyle, wrapperStyle]);
35
+ return (<View style={styles.container}>
36
+ <TouchableOpacity onPress={handlePress} style={[styles.button, buttonStyle]}>
37
+ {renderIcon()}
38
+ </TouchableOpacity>
39
+ </View>);
40
+ }
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ alignItems: 'flex-end',
44
+ },
45
+ button: {
46
+ paddingLeft: 10,
47
+ paddingRight: 4,
48
+ paddingVertical: 7,
49
+ },
50
+ wrapper: {
51
+ borderColor: Color.defaultColor,
52
+ borderWidth: 2,
53
+ width: 26,
54
+ height: 26,
55
+ borderRadius: 13,
56
+ },
57
+ iconText: {
58
+ color: Color.defaultColor,
59
+ fontWeight: 'bold',
60
+ fontSize: 16,
61
+ lineHeight: 16,
62
+ },
63
+ });
64
+ //# sourceMappingURL=Actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EACL,UAAU,EACV,IAAI,EAIJ,IAAI,EAAE,MAAM,cAAc,CAAA;A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, LeftRightStyle, User } from './Models';
4
+ export interface AvatarProps<TMessage extends IMessage> {
5
+ currentMessage: TMessage;
6
+ previousMessage?: TMessage;
7
+ nextMessage?: TMessage;
8
+ position: 'left' | 'right';
9
+ isAvatarOnTop?: boolean;
10
+ isAvatarVisibleForEveryMessage?: boolean;
11
+ imageStyle?: LeftRightStyle<ImageStyle>;
12
+ containerStyle?: LeftRightStyle<ViewStyle>;
13
+ textStyle?: TextStyle;
14
+ renderAvatar?(props: Omit<AvatarProps<TMessage>, 'renderAvatar'>): ReactNode;
15
+ onPressAvatar?: (user: User) => void;
16
+ onLongPressAvatar?: (user: User) => void;
17
+ }
18
+ export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): React.JSX.Element | null;
19
+ //# sourceMappingURL=Avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AACrD,OAAO,EACL,UAAU,EAEV,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AA6CzD,MAAM,WAAW,WAAW,CAAC,QAAQ,SAAS,QAAQ;IACpD,cAAc,EAAE,QAAQ,CAAA;IACxB,eAAe,CAAC,EAAE,QAAQ,CAAA;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAA;IACtB,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC,UAAU,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,YAAY,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,GAAG,SAAS,CAAA;IAC5E,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACpC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CACzC;AAED,wBAAgB,MAAM,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACzD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,4BAkG7B"}
package/lib/Avatar.js ADDED
@@ -0,0 +1,93 @@
1
+ import React, { useCallback } from 'react';
2
+ import { StyleSheet, View, } from 'react-native';
3
+ import { ChatAvatar } from './ChatAvatar';
4
+ import { isSameUser, isSameDay } from './utils';
5
+ const styles = {
6
+ left: StyleSheet.create({
7
+ container: {
8
+ marginRight: 8,
9
+ },
10
+ onTop: {
11
+ alignSelf: 'flex-start',
12
+ },
13
+ image: {
14
+ height: 36,
15
+ width: 36,
16
+ borderRadius: 18,
17
+ },
18
+ }),
19
+ right: StyleSheet.create({
20
+ container: {
21
+ marginLeft: 8,
22
+ },
23
+ onTop: {
24
+ alignSelf: 'flex-start',
25
+ },
26
+ image: {
27
+ height: 36,
28
+ width: 36,
29
+ borderRadius: 18,
30
+ },
31
+ }),
32
+ };
33
+ export function Avatar(props) {
34
+ const { isAvatarOnTop, isAvatarVisibleForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, onPressAvatar, onLongPressAvatar, } = props;
35
+ const messageToCompare = isAvatarOnTop ? previousMessage : nextMessage;
36
+ const renderAvatarComponent = useCallback(() => {
37
+ if (renderAvatar)
38
+ return renderAvatar({
39
+ isAvatarOnTop,
40
+ isAvatarVisibleForEveryMessage,
41
+ containerStyle,
42
+ position,
43
+ currentMessage,
44
+ previousMessage,
45
+ nextMessage,
46
+ imageStyle,
47
+ onPressAvatar,
48
+ onLongPressAvatar,
49
+ });
50
+ if (currentMessage)
51
+ return (<ChatAvatar avatarStyle={[
52
+ styles[position].image,
53
+ imageStyle?.[position],
54
+ ]} user={currentMessage.user} onPress={() => onPressAvatar?.(currentMessage.user)} onLongPress={() => onLongPressAvatar?.(currentMessage.user)}/>);
55
+ return null;
56
+ }, [
57
+ renderAvatar,
58
+ isAvatarOnTop,
59
+ isAvatarVisibleForEveryMessage,
60
+ containerStyle,
61
+ position,
62
+ currentMessage,
63
+ previousMessage,
64
+ nextMessage,
65
+ imageStyle,
66
+ onPressAvatar,
67
+ onLongPressAvatar,
68
+ ]);
69
+ if (renderAvatar === null)
70
+ return null;
71
+ if (!isAvatarVisibleForEveryMessage &&
72
+ currentMessage &&
73
+ messageToCompare &&
74
+ isSameUser(currentMessage, messageToCompare) &&
75
+ isSameDay(currentMessage, messageToCompare))
76
+ return (<View style={[
77
+ styles[position].container,
78
+ containerStyle?.[position],
79
+ ]}>
80
+ <ChatAvatar avatarStyle={[
81
+ styles[position].image,
82
+ imageStyle?.[position],
83
+ ]}/>
84
+ </View>);
85
+ return (<View style={[
86
+ styles[position].container,
87
+ isAvatarOnTop && styles[position].onTop,
88
+ containerStyle?.[position],
89
+ ]}>
90
+ {renderAvatarComponent()}
91
+ </View>);
92
+ }
93
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAEL,UAAU,EAEV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAe/C,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE;YACT,WAAW,EAAE,CA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,CAAC,CACpD,WAAW,CAAC,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAC5D,CACH,CAAA;QAEH,OAAO,IAAI,CAAA;IACb,CAAC,EAAE;QACD,YAAY;QACZ,aAAa;QACb,8BAA8B;QAC9B,cAAc;QACd,QAAQ;QACR,cAAc;QACd,eAAe;QACf,WAAW;QACX,UAAU;QACV,aAAa;QACb,iBAAiB;KAClB,CAAC,CAAA;IAEF,IAAI,YAAY,KAAK,IAAI;QACvB,OAAO,IAAI,CAAA;IAEb,IACE,CAAC,8BAA8B;QAC/B,cAAc;QACd,gBAAgB;QAChB,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAC5C,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAE3C,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;gBACL,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS;gBAC1B,cAAc,EAAE,CAAC,QAAQ,CAAC;aAC3B,CAAC,CAEF;QAAA,CAAC,UAAU,CACT,WAAW,CAAC,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;gBACtB,UAAU,EAAE,CAAC,QAAQ,CAAC;aACvB,CAAC,EAEN;MAAA,EAAE,IAAI,CAAC,CACR,CAAA;IAEH,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS;YAC1B,aAAa,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;YACvC,cAAc,EAAE,CAAC,QAAQ,CAAC;SAC3B,CAAC,CAEF;MAAA,CAAC,qBAAqB,EAAE,CAC1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { IMessage } from '../Models';
3
+ import { BubbleProps } from './types';
4
+ export * from './types';
5
+ export declare const Bubble: <TMessage extends IMessage = IMessage>(props: BubbleProps<TMessage>) => React.ReactElement;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Bubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAqBrE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAOpC,OAAO,EAAE,WAAW,EAA0B,MAAM,SAAS,CAAA;AAE7D,cAAc,SAAS,CAAA;AAcvB,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAG,KAAK,CAAC,YAohBjG,CAAA"}
@@ -0,0 +1,391 @@
1
+ import React, { useCallback, useMemo, useRef, useState } from 'react';
2
+ import { View, Pressable, Text } from 'react-native';
3
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
4
+ import Animated, { Easing, ReduceMotion, runOnJS, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
5
+ import { useChatContext } from '../ChatContext';
6
+ import { MessageReply } from '../components/MessageReply';
7
+ import { MessageAudio } from '../MessageAudio';
8
+ import { MessageImage } from '../MessageImage';
9
+ import { MessageText } from '../MessageText';
10
+ import { MessageVideo } from '../MessageVideo';
11
+ import { QuickReplies } from '../QuickReplies';
12
+ import { DEFAULT_REACTION_EMOJIS, MessageReactions, ReactionPicker } from '../Reactions';
13
+ import { getStyleWithPosition } from '../styles';
14
+ import { Time } from '../Time';
15
+ import { isSameUser, isSameDay, renderComponentOrElement } from '../utils';
16
+ import styles from './styles';
17
+ export * from './types';
18
+ const SCALE_PRESSED = 0.85;
19
+ const SCALE_DURATION_IN = 400;
20
+ const SCALE_DURATION_OUT = 200;
21
+ const SCALE_EASING = Easing.inOut(Easing.quad);
22
+ export const Bubble = (props) => {
23
+ const { currentMessage, nextMessage, position, containerToNextStyle, previousMessage, containerToPreviousStyle, onQuickReply, renderQuickReplySend, quickReplyStyle, quickReplyTextStyle, quickReplyContainerStyle, containerStyle, wrapperStyle, bottomContainerStyle, onPressMessage: onPressMessageProp, onLongPressMessage: onLongPressMessageProp, reactions, } = props;
24
+ const context = useChatContext();
25
+ const bubbleContainerRef = useRef(null);
26
+ const [isPickerVisible, setIsPickerVisible] = useState(false);
27
+ const [pickerAnchor, setPickerAnchor] = useState({
28
+ pageX: 0,
29
+ pageY: 0,
30
+ bubbleWidth: 0,
31
+ bubbleHeight: 0,
32
+ });
33
+ // Scale shared value is declared unconditionally so hooks order stays stable
34
+ // whether or not reactions are enabled.
35
+ const messageScale = useSharedValue(1);
36
+ const bubbleScaleStyle = useAnimatedStyle(() => ({
37
+ transform: [{ scale: messageScale.value }],
38
+ }));
39
+ const onPress = useCallback(() => {
40
+ onPressMessageProp?.(context, currentMessage);
41
+ }, [onPressMessageProp, context, currentMessage]);
42
+ const onLongPress = useCallback(() => {
43
+ onLongPressMessageProp?.(context, currentMessage);
44
+ }, [
45
+ currentMessage,
46
+ context,
47
+ onLongPressMessageProp,
48
+ ]);
49
+ const measureBubble = useCallback(() => {
50
+ bubbleContainerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
51
+ setPickerAnchor({ pageX, pageY, bubbleWidth: width, bubbleHeight: height });
52
+ });
53
+ }, []);
54
+ const tapGesture = useMemo(() => Gesture.Tap()
55
+ .runOnJS(true)
56
+ .onEnd((_e, success) => {
57
+ if (success)
58
+ onPressMessageProp?.(context, currentMessage);
59
+ }), [onPressMessageProp, context, currentMessage]);
60
+ const longPressGesture = useMemo(() => Gesture.LongPress()
61
+ .onBegin(() => {
62
+ messageScale.value = withTiming(SCALE_PRESSED, {
63
+ duration: SCALE_DURATION_IN,
64
+ easing: SCALE_EASING,
65
+ reduceMotion: ReduceMotion.System,
66
+ });
67
+ runOnJS(measureBubble)();
68
+ })
69
+ .onStart(() => {
70
+ runOnJS(setIsPickerVisible)(true);
71
+ })
72
+ .onFinalize(() => {
73
+ messageScale.value = withTiming(1, {
74
+ duration: SCALE_DURATION_OUT,
75
+ easing: SCALE_EASING,
76
+ reduceMotion: ReduceMotion.System,
77
+ });
78
+ }), [messageScale, measureBubble]);
79
+ // Exclusive composition: a long-press wins over the tap when held long
80
+ // enough; a quick lift lets the tap through. Both share the onBegin/onFinalize
81
+ // scale animation because onBegin always fires before either gesture wins.
82
+ const reactionsGesture = useMemo(() => Gesture.Exclusive(longPressGesture, tapGesture), [longPressGesture, tapGesture]);
83
+ const styledBubbleToNext = useMemo(() => {
84
+ if (currentMessage &&
85
+ nextMessage &&
86
+ position &&
87
+ isSameUser(currentMessage, nextMessage) &&
88
+ isSameDay(currentMessage, nextMessage))
89
+ return [
90
+ getStyleWithPosition(styles, 'containerToNext', position),
91
+ containerToNextStyle?.[position],
92
+ ];
93
+ return null;
94
+ }, [
95
+ currentMessage,
96
+ nextMessage,
97
+ position,
98
+ containerToNextStyle,
99
+ ]);
100
+ const styledBubbleToPrevious = useMemo(() => {
101
+ if (currentMessage &&
102
+ previousMessage &&
103
+ position &&
104
+ isSameUser(currentMessage, previousMessage) &&
105
+ isSameDay(currentMessage, previousMessage))
106
+ return [
107
+ getStyleWithPosition(styles, 'containerToPrevious', position),
108
+ containerToPreviousStyle?.[position],
109
+ ];
110
+ return null;
111
+ }, [
112
+ currentMessage,
113
+ previousMessage,
114
+ position,
115
+ containerToPreviousStyle,
116
+ ]);
117
+ const renderQuickReplies = useCallback(() => {
118
+ if (currentMessage?.quickReplies) {
119
+ const {
120
+ /* eslint-disable @typescript-eslint/no-unused-vars */
121
+ containerStyle, wrapperStyle,
122
+ /* eslint-enable @typescript-eslint/no-unused-vars */
123
+ ...quickReplyProps } = props;
124
+ if (props.renderQuickReplies)
125
+ return renderComponentOrElement(props.renderQuickReplies, quickReplyProps);
126
+ return (<QuickReplies currentMessage={currentMessage} onQuickReply={onQuickReply} renderQuickReplySend={renderQuickReplySend} quickReplyStyle={quickReplyStyle} quickReplyTextStyle={quickReplyTextStyle} quickReplyContainerStyle={quickReplyContainerStyle} nextMessage={nextMessage}/>);
127
+ }
128
+ return null;
129
+ }, [
130
+ currentMessage,
131
+ onQuickReply,
132
+ renderQuickReplySend,
133
+ quickReplyStyle,
134
+ quickReplyTextStyle,
135
+ quickReplyContainerStyle,
136
+ nextMessage,
137
+ props,
138
+ ]);
139
+ const renderMessageText = useCallback(() => {
140
+ if (currentMessage?.text) {
141
+ const {
142
+ /* eslint-disable @typescript-eslint/no-unused-vars */
143
+ containerStyle, wrapperStyle, messageTextProps,
144
+ /* eslint-enable @typescript-eslint/no-unused-vars */
145
+ ...messageTextPropsRest } = props;
146
+ const combinedProps = {
147
+ ...messageTextPropsRest,
148
+ ...messageTextProps,
149
+ };
150
+ if (props.renderMessageText)
151
+ return renderComponentOrElement(props.renderMessageText, combinedProps);
152
+ return <MessageText {...combinedProps}/>;
153
+ }
154
+ return null;
155
+ }, [props, currentMessage]);
156
+ const renderMessageImage = useCallback(() => {
157
+ if (currentMessage?.image) {
158
+ const {
159
+ /* eslint-disable @typescript-eslint/no-unused-vars */
160
+ containerStyle, wrapperStyle,
161
+ /* eslint-enable @typescript-eslint/no-unused-vars */
162
+ ...messageImageProps } = props;
163
+ if (props.renderMessageImage)
164
+ return renderComponentOrElement(props.renderMessageImage, messageImageProps);
165
+ return <MessageImage {...messageImageProps}/>;
166
+ }
167
+ return null;
168
+ }, [props, currentMessage]);
169
+ const renderMessageVideo = useCallback(() => {
170
+ if (!currentMessage?.video)
171
+ return null;
172
+ const {
173
+ /* eslint-disable @typescript-eslint/no-unused-vars */
174
+ containerStyle, wrapperStyle,
175
+ /* eslint-enable @typescript-eslint/no-unused-vars */
176
+ ...messageVideoProps } = props;
177
+ if (props.renderMessageVideo)
178
+ return renderComponentOrElement(props.renderMessageVideo, messageVideoProps);
179
+ return <MessageVideo />;
180
+ }, [props, currentMessage]);
181
+ const renderMessageAudio = useCallback(() => {
182
+ if (!currentMessage?.audio)
183
+ return null;
184
+ const {
185
+ /* eslint-disable @typescript-eslint/no-unused-vars */
186
+ containerStyle, wrapperStyle,
187
+ /* eslint-enable @typescript-eslint/no-unused-vars */
188
+ ...messageAudioProps } = props;
189
+ if (props.renderMessageAudio)
190
+ return renderComponentOrElement(props.renderMessageAudio, messageAudioProps);
191
+ return <MessageAudio />;
192
+ }, [props, currentMessage]);
193
+ const renderTicks = useCallback(() => {
194
+ const { renderTicks, user, } = props;
195
+ if (renderTicks && currentMessage)
196
+ return renderComponentOrElement(renderTicks, currentMessage);
197
+ if (user &&
198
+ currentMessage?.user &&
199
+ currentMessage.user._id !== user._id)
200
+ return null;
201
+ if (currentMessage &&
202
+ (currentMessage.sent || currentMessage.received || currentMessage.pending))
203
+ return (<View style={styles.messageStatusContainer}>
204
+ {!!currentMessage.sent && (<Text style={[styles.messageStatus, props.tickStyle]}>
205
+ {'✓'}
206
+ </Text>)}
207
+ {!!currentMessage.received && (<Text style={[styles.messageStatus, props.tickStyle]}>
208
+ {'✓'}
209
+ </Text>)}
210
+ {!!currentMessage.pending && (<Text style={[styles.messageStatus, props.tickStyle]}>
211
+ {'🕓'}
212
+ </Text>)}
213
+ </View>);
214
+ return null;
215
+ }, [
216
+ props,
217
+ currentMessage,
218
+ ]);
219
+ const renderTime = useCallback(() => {
220
+ if (currentMessage?.createdAt) {
221
+ const {
222
+ /* eslint-disable @typescript-eslint/no-unused-vars */
223
+ containerStyle, wrapperStyle, textStyle,
224
+ /* eslint-enable @typescript-eslint/no-unused-vars */
225
+ ...timeProps } = props;
226
+ if (props.renderTime)
227
+ return renderComponentOrElement(props.renderTime, timeProps);
228
+ return <Time {...timeProps}/>;
229
+ }
230
+ return null;
231
+ }, [props, currentMessage]);
232
+ const renderUsername = useCallback(() => {
233
+ const { user, renderUsername, } = props;
234
+ if (props.isUsernameVisible && currentMessage) {
235
+ if (user && currentMessage.user._id === user._id)
236
+ return null;
237
+ if (renderUsername)
238
+ return renderComponentOrElement(renderUsername, currentMessage.user);
239
+ return (<View style={styles.usernameContainer}>
240
+ <Text style={[styles.username, props.usernameStyle]}>
241
+ {currentMessage.user.name}
242
+ </Text>
243
+ </View>);
244
+ }
245
+ return null;
246
+ }, [
247
+ currentMessage,
248
+ props,
249
+ ]);
250
+ const renderCustomView = useCallback(() => {
251
+ if (props.renderCustomView)
252
+ return renderComponentOrElement(props.renderCustomView, props);
253
+ return null;
254
+ }, [props]);
255
+ const renderMessageReply = useCallback(() => {
256
+ if (!currentMessage?.replyMessage)
257
+ return null;
258
+ const { messageReply } = props;
259
+ const messageReplyProps = {
260
+ replyMessage: currentMessage.replyMessage,
261
+ currentMessage,
262
+ position,
263
+ onPress: messageReply?.onPress,
264
+ containerStyle: position === 'left'
265
+ ? messageReply?.containerStyleLeft ?? messageReply?.containerStyle
266
+ : messageReply?.containerStyleRight ?? messageReply?.containerStyle,
267
+ textStyle: position === 'left'
268
+ ? messageReply?.textStyleLeft ?? messageReply?.textStyle
269
+ : messageReply?.textStyleRight ?? messageReply?.textStyle,
270
+ imageStyle: messageReply?.imageStyle,
271
+ };
272
+ if (messageReply?.renderMessageReply)
273
+ return renderComponentOrElement(messageReply.renderMessageReply, messageReplyProps);
274
+ return <MessageReply {...messageReplyProps}/>;
275
+ }, [
276
+ props,
277
+ currentMessage,
278
+ position,
279
+ ]);
280
+ const renderBubbleContent = useCallback(() => {
281
+ return (<>
282
+ {!props.isCustomViewBottom && renderCustomView()}
283
+ {renderMessageReply()}
284
+ {renderMessageImage()}
285
+ {renderMessageVideo()}
286
+ {renderMessageAudio()}
287
+ {renderMessageText()}
288
+ {props.isCustomViewBottom && renderCustomView()}
289
+ </>);
290
+ }, [
291
+ renderMessageReply,
292
+ renderCustomView,
293
+ renderMessageImage,
294
+ renderMessageVideo,
295
+ renderMessageAudio,
296
+ renderMessageText,
297
+ props.isCustomViewBottom,
298
+ ]);
299
+ const renderBubbleBody = useCallback(() => (<>
300
+ {renderBubbleContent()}
301
+ <View style={[
302
+ styles.bottom,
303
+ bottomContainerStyle?.[position],
304
+ ]}>
305
+ {renderUsername()}
306
+ <View style={styles.messageTimeAndStatusContainer}>
307
+ {renderTime()}
308
+ {renderTicks()}
309
+ </View>
310
+ </View>
311
+ </>), [
312
+ position,
313
+ bottomContainerStyle,
314
+ renderBubbleContent,
315
+ renderUsername,
316
+ renderTime,
317
+ renderTicks,
318
+ ]);
319
+ const wrapperStyleList = useMemo(() => [
320
+ getStyleWithPosition(styles, 'wrapper', position),
321
+ styledBubbleToNext,
322
+ styledBubbleToPrevious,
323
+ wrapperStyle?.[position],
324
+ ], [position, styledBubbleToNext, styledBubbleToPrevious, wrapperStyle]);
325
+ const renderReactionsDisplay = useCallback(() => {
326
+ const currentReactions = currentMessage?.reactions;
327
+ if (!currentReactions || currentReactions.length === 0)
328
+ return null;
329
+ const displayProps = {
330
+ message: currentMessage,
331
+ reactions: currentReactions,
332
+ currentUserId: props.user?._id,
333
+ position,
334
+ onReactionPress: (emoji) => reactions?.onReactionPress?.(currentMessage, emoji),
335
+ containerStyle: reactions?.containerStyle,
336
+ reactionStyle: reactions?.reactionStyle,
337
+ reactionActiveStyle: reactions?.reactionActiveStyle,
338
+ reactionTextStyle: reactions?.reactionTextStyle,
339
+ reactionCountStyle: reactions?.reactionCountStyle,
340
+ };
341
+ if (reactions?.renderReactions)
342
+ return renderComponentOrElement(reactions.renderReactions, displayProps);
343
+ return <MessageReactions {...displayProps}/>;
344
+ }, [currentMessage, position, props.user, reactions]);
345
+ const renderReactionPickerModal = useCallback(() => {
346
+ if (!reactions?.isEnabled)
347
+ return null;
348
+ const emojis = reactions.emojis ?? DEFAULT_REACTION_EMOJIS;
349
+ const pickerProps = {
350
+ visible: isPickerVisible,
351
+ message: currentMessage,
352
+ emojis,
353
+ onSelect: (emoji) => reactions?.onReactionPress?.(currentMessage, emoji),
354
+ onDismiss: () => setIsPickerVisible(false),
355
+ position,
356
+ ...pickerAnchor,
357
+ pickerContainerStyle: reactions.pickerContainerStyle,
358
+ pickerEmojiStyle: reactions.pickerEmojiStyle,
359
+ };
360
+ if (reactions.renderReactionPicker)
361
+ return renderComponentOrElement(reactions.renderReactionPicker, pickerProps);
362
+ return <ReactionPicker {...pickerProps}/>;
363
+ }, [reactions, isPickerVisible, currentMessage, position, pickerAnchor]);
364
+ if (reactions?.isEnabled)
365
+ // Reactions path: the Animated.View carries only the scale transform,
366
+ // keeping the animation isolated from the static bubble styles on the
367
+ // inner View. Tap/long-press are handled by the composed gesture.
368
+ return (<Animated.View style={containerStyle?.[position]} ref={bubbleContainerRef}>
369
+ <GestureDetector gesture={reactionsGesture}>
370
+ <Animated.View style={bubbleScaleStyle}>
371
+ <View style={wrapperStyleList}>
372
+ {renderBubbleBody()}
373
+ </View>
374
+ </Animated.View>
375
+ </GestureDetector>
376
+ {renderQuickReplies()}
377
+ {renderReactionsDisplay()}
378
+ {renderReactionPickerModal()}
379
+ </Animated.View>);
380
+ // Default path: unchanged behaviour for existing users, preserving
381
+ // touchableProps, native press feedback, and the onLongPressMessage callback.
382
+ return (<View style={containerStyle?.[position]}>
383
+ <View style={wrapperStyleList}>
384
+ <Pressable onPress={onPress} onLongPress={onLongPress} {...props.touchableProps}>
385
+ {renderBubbleBody()}
386
+ </Pressable>
387
+ </View>
388
+ {renderQuickReplies()}
389
+ </View>);
390
+ };
391
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Bubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,QAAQ,EAAE,EACf,MAAM,EACN,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,y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