react-native-gifted-chat 2.6.5 → 2.7.1

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 (228) hide show
  1. package/README.md +8 -17
  2. package/lib/Actions.d.ts +0 -11
  3. package/lib/Actions.js +2 -14
  4. package/lib/Actions.js.map +1 -1
  5. package/lib/Avatar.d.ts +1 -23
  6. package/lib/Avatar.js +32 -40
  7. package/lib/Avatar.js.map +1 -1
  8. package/lib/Bubble/index.d.ts +30 -0
  9. package/lib/{Bubble.js → Bubble/index.js} +31 -181
  10. package/lib/Bubble/index.js.map +1 -0
  11. package/lib/Bubble/styles.d.ts +69 -0
  12. package/lib/Bubble/styles.js +72 -0
  13. package/lib/Bubble/styles.js.map +1 -0
  14. package/lib/Bubble/types.d.ts +47 -0
  15. package/lib/Bubble/types.js +2 -0
  16. package/lib/Bubble/types.js.map +1 -0
  17. package/lib/Composer.d.ts +0 -17
  18. package/lib/Composer.js +3 -18
  19. package/lib/Composer.js.map +1 -1
  20. package/lib/Constant.d.ts +1 -1
  21. package/lib/Constant.js +1 -1
  22. package/lib/Constant.js.map +1 -1
  23. package/lib/Day/index.d.ts +4 -0
  24. package/lib/Day/index.js +39 -0
  25. package/lib/Day/index.js.map +1 -0
  26. package/lib/Day/styles.d.ts +20 -0
  27. package/lib/Day/styles.js +22 -0
  28. package/lib/Day/styles.js.map +1 -0
  29. package/lib/Day/types.d.ts +9 -0
  30. package/lib/Day/types.js +2 -0
  31. package/lib/Day/types.js.map +1 -0
  32. package/lib/GiftedAvatar.d.ts +1 -11
  33. package/lib/GiftedAvatar.js +26 -33
  34. package/lib/GiftedAvatar.js.map +1 -1
  35. package/lib/GiftedChat/index.d.ts +26 -0
  36. package/lib/{GiftedChat.js → GiftedChat/index.js} +46 -52
  37. package/lib/GiftedChat/index.js.map +1 -0
  38. package/lib/GiftedChat/styles.d.ts +6 -0
  39. package/lib/GiftedChat/styles.js +7 -0
  40. package/lib/GiftedChat/styles.js.map +1 -0
  41. package/lib/{GiftedChat.d.ts → GiftedChat/types.d.ts} +28 -38
  42. package/lib/GiftedChat/types.js +2 -0
  43. package/lib/GiftedChat/types.js.map +1 -0
  44. package/lib/InputToolbar.d.ts +1 -14
  45. package/lib/InputToolbar.js +0 -12
  46. package/lib/InputToolbar.js.map +1 -1
  47. package/lib/LoadEarlier.d.ts +0 -14
  48. package/lib/LoadEarlier.js +2 -16
  49. package/lib/LoadEarlier.js.map +1 -1
  50. package/lib/Message/index.d.ts +6 -0
  51. package/lib/Message/index.js +85 -0
  52. package/lib/Message/index.js.map +1 -0
  53. package/lib/Message/styles.d.ts +21 -0
  54. package/lib/Message/styles.js +22 -0
  55. package/lib/Message/styles.js.map +1 -0
  56. package/lib/Message/types.d.ts +22 -0
  57. package/lib/Message/types.js +2 -0
  58. package/lib/Message/types.js.map +1 -0
  59. package/lib/MessageAudio.js +1 -2
  60. package/lib/MessageAudio.js.map +1 -1
  61. package/lib/MessageContainer/components/DayAnimated/index.d.ts +5 -0
  62. package/lib/MessageContainer/components/DayAnimated/index.js +85 -0
  63. package/lib/MessageContainer/components/DayAnimated/index.js.map +1 -0
  64. package/lib/MessageContainer/components/DayAnimated/styles.d.ts +11 -0
  65. package/lib/MessageContainer/components/DayAnimated/styles.js +12 -0
  66. package/lib/MessageContainer/components/DayAnimated/styles.js.map +1 -0
  67. package/lib/MessageContainer/components/DayAnimated/types.d.ts +17 -0
  68. package/lib/MessageContainer/components/DayAnimated/types.js +2 -0
  69. package/lib/MessageContainer/components/DayAnimated/types.js.map +1 -0
  70. package/lib/MessageContainer/components/Item/index.d.ts +22 -0
  71. package/lib/MessageContainer/components/Item/index.js +69 -0
  72. package/lib/MessageContainer/components/Item/index.js.map +1 -0
  73. package/lib/MessageContainer/components/Item/types.d.ts +18 -0
  74. package/lib/MessageContainer/components/Item/types.js +2 -0
  75. package/lib/MessageContainer/components/Item/types.js.map +1 -0
  76. package/lib/MessageContainer/index.d.ts +6 -0
  77. package/lib/MessageContainer/index.js +200 -0
  78. package/lib/MessageContainer/index.js.map +1 -0
  79. package/lib/MessageContainer/styles.d.ts +34 -0
  80. package/lib/MessageContainer/styles.js +31 -0
  81. package/lib/MessageContainer/styles.js.map +1 -0
  82. package/lib/MessageContainer/types.d.ts +54 -0
  83. package/lib/MessageContainer/types.js +2 -0
  84. package/lib/MessageContainer/types.js.map +1 -0
  85. package/lib/MessageImage.d.ts +1 -12
  86. package/lib/MessageImage.js +2 -12
  87. package/lib/MessageImage.js.map +1 -1
  88. package/lib/MessageText.d.ts +1 -24
  89. package/lib/MessageText.js +0 -22
  90. package/lib/MessageText.js.map +1 -1
  91. package/lib/MessageVideo.js +1 -2
  92. package/lib/MessageVideo.js.map +1 -1
  93. package/lib/QuickReplies.d.ts +1 -12
  94. package/lib/QuickReplies.js +10 -20
  95. package/lib/QuickReplies.js.map +1 -1
  96. package/lib/Send.d.ts +2 -16
  97. package/lib/Send.js +0 -13
  98. package/lib/Send.js.map +1 -1
  99. package/lib/SystemMessage.d.ts +1 -10
  100. package/lib/SystemMessage.js +2 -12
  101. package/lib/SystemMessage.js.map +1 -1
  102. package/lib/Time.d.ts +1 -17
  103. package/lib/Time.js +0 -15
  104. package/lib/Time.js.map +1 -1
  105. package/lib/TypingIndicator/index.d.ts +5 -0
  106. package/lib/{TypingIndicator.js → TypingIndicator/index.js} +9 -30
  107. package/lib/TypingIndicator/index.js.map +1 -0
  108. package/lib/TypingIndicator/styles.d.ts +20 -0
  109. package/lib/TypingIndicator/styles.js +22 -0
  110. package/lib/TypingIndicator/styles.js.map +1 -0
  111. package/lib/TypingIndicator/types.d.ts +3 -0
  112. package/lib/TypingIndicator/types.js +2 -0
  113. package/lib/TypingIndicator/types.js.map +1 -0
  114. package/lib/index.d.ts +0 -1
  115. package/lib/index.js +0 -1
  116. package/lib/index.js.map +1 -1
  117. package/lib/styles.d.ts +10 -0
  118. package/lib/styles.js +11 -0
  119. package/lib/styles.js.map +1 -0
  120. package/lib/{Models.d.ts → types.d.ts} +1 -1
  121. package/lib/types.js +2 -0
  122. package/lib/types.js.map +1 -0
  123. package/lib/utils.d.ts +1 -3
  124. package/lib/utils.js +0 -7
  125. package/lib/utils.js.map +1 -1
  126. package/package.json +21 -29
  127. package/src/Actions.tsx +3 -15
  128. package/src/Avatar.tsx +43 -52
  129. package/src/{Bubble.tsx → Bubble/index.tsx} +52 -269
  130. package/src/Bubble/styles.ts +73 -0
  131. package/src/Bubble/types.ts +90 -0
  132. package/src/Composer.tsx +3 -19
  133. package/src/Constant.ts +1 -1
  134. package/src/Day/index.tsx +63 -0
  135. package/src/Day/styles.ts +22 -0
  136. package/src/Day/types.ts +14 -0
  137. package/src/GiftedAvatar.tsx +31 -38
  138. package/src/GiftedChat/index.tsx +501 -0
  139. package/src/GiftedChat/styles.ts +7 -0
  140. package/src/GiftedChat/types.ts +206 -0
  141. package/src/InputToolbar.tsx +1 -14
  142. package/src/LoadEarlier.tsx +2 -17
  143. package/src/Message/index.tsx +135 -0
  144. package/src/Message/styles.ts +22 -0
  145. package/src/Message/types.ts +26 -0
  146. package/src/MessageAudio.tsx +1 -4
  147. package/src/MessageContainer/components/DayAnimated/index.tsx +143 -0
  148. package/src/MessageContainer/components/DayAnimated/styles.ts +12 -0
  149. package/src/MessageContainer/components/DayAnimated/types.ts +12 -0
  150. package/src/MessageContainer/components/Item/index.tsx +136 -0
  151. package/src/MessageContainer/components/Item/types.ts +13 -0
  152. package/src/MessageContainer/index.tsx +343 -0
  153. package/src/MessageContainer/styles.ts +31 -0
  154. package/src/MessageContainer/types.ts +60 -0
  155. package/src/MessageImage.tsx +3 -14
  156. package/src/MessageText.tsx +1 -24
  157. package/src/MessageVideo.tsx +1 -4
  158. package/src/QuickReplies.tsx +14 -25
  159. package/src/Send.tsx +1 -15
  160. package/src/SystemMessage.tsx +3 -14
  161. package/src/Time.tsx +1 -17
  162. package/src/{TypingIndicator.tsx → TypingIndicator/index.tsx} +12 -35
  163. package/src/TypingIndicator/styles.ts +22 -0
  164. package/src/TypingIndicator/types.ts +3 -0
  165. package/src/__tests__/Bubble.test.tsx +7 -4
  166. package/src/__tests__/GiftedAvatar.test.tsx +6 -2
  167. package/src/__tests__/GiftedChat.test.tsx +20 -14
  168. package/src/__tests__/Message.test.tsx +4 -1
  169. package/src/__tests__/__snapshots__/Actions.test.tsx.snap +6 -2
  170. package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +3 -1
  171. package/src/__tests__/__snapshots__/Composer.test.tsx.snap +2 -0
  172. package/src/__tests__/__snapshots__/Constant.test.tsx.snap +1 -1
  173. package/src/__tests__/__snapshots__/Day.test.tsx.snap +1 -33
  174. package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +4 -2
  175. package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +22 -9
  176. package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +2 -0
  177. package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +3 -1
  178. package/src/__tests__/__snapshots__/Message.test.tsx.snap +21 -100
  179. package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +282 -82
  180. package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +8 -4
  181. package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +5 -1
  182. package/src/__tests__/data.ts +1 -1
  183. package/src/index.ts +0 -2
  184. package/src/styles.ts +11 -0
  185. package/src/{Models.ts → types.ts} +1 -1
  186. package/src/utils.ts +1 -9
  187. package/lib/Actions.js.flow +0 -21
  188. package/lib/Avatar.js.flow +0 -27
  189. package/lib/Bubble.d.ts +0 -148
  190. package/lib/Bubble.js.flow +0 -69
  191. package/lib/Bubble.js.map +0 -1
  192. package/lib/Composer.js.flow +0 -24
  193. package/lib/Day.d.ts +0 -15
  194. package/lib/Day.js +0 -36
  195. package/lib/Day.js.flow +0 -23
  196. package/lib/Day.js.map +0 -1
  197. package/lib/GiftedAvatar.js.flow +0 -17
  198. package/lib/GiftedChat.js.flow +0 -163
  199. package/lib/GiftedChat.js.map +0 -1
  200. package/lib/InputToolbar.js.flow +0 -31
  201. package/lib/LoadEarlier.js.flow +0 -20
  202. package/lib/Message.d.ts +0 -67
  203. package/lib/Message.js +0 -157
  204. package/lib/Message.js.flow +0 -32
  205. package/lib/Message.js.map +0 -1
  206. package/lib/MessageAudio.js.flow +0 -15
  207. package/lib/MessageContainer.d.ts +0 -105
  208. package/lib/MessageContainer.js +0 -224
  209. package/lib/MessageContainer.js.flow +0 -39
  210. package/lib/MessageContainer.js.map +0 -1
  211. package/lib/MessageImage.js.flow +0 -20
  212. package/lib/MessageText.js.flow +0 -23
  213. package/lib/MessageVideo.js.flow +0 -16
  214. package/lib/Models.js +0 -2
  215. package/lib/Models.js.map +0 -1
  216. package/lib/QuickReplies.js.flow +0 -25
  217. package/lib/Send.js.flow +0 -19
  218. package/lib/SystemMessage.js.flow +0 -18
  219. package/lib/Time.js.flow +0 -19
  220. package/lib/TypingIndicator.d.ts +0 -6
  221. package/lib/TypingIndicator.js.map +0 -1
  222. package/lib/index.js.flow +0 -2
  223. package/lib/types.js.flow +0 -43
  224. package/lib/utils.js.flow +0 -16
  225. package/src/Day.tsx +0 -71
  226. package/src/GiftedChat.tsx +0 -689
  227. package/src/Message.tsx +0 -229
  228. package/src/MessageContainer.tsx +0 -361
package/README.md CHANGED
@@ -105,18 +105,18 @@
105
105
 
106
106
  Yarn:
107
107
  ```bash
108
- yarn add react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
108
+ yarn add react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
109
109
  ```
110
110
 
111
111
  Npm:
112
112
 
113
113
  ```bash
114
- npm install --save react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
114
+ npm install --save react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
115
115
  ```
116
116
 
117
117
  Expo
118
118
  ```bash
119
- npx expo install react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
119
+ npx expo install react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
120
120
  ```
121
121
 
122
122
  ### Non-expo users
@@ -125,19 +125,10 @@ npx expo install react-native-gifted-chat react-native-reanimated react-native-s
125
125
  npx pod-install
126
126
  ```
127
127
 
128
- ### Setup react-native-safe-area-context
129
-
130
- Follow guide: [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context?tab=readme-ov-file#api)
131
-
132
128
  ### Setup react-native-reanimated
133
129
 
134
130
  Follow guide: [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#step-2-add-reanimateds-babel-plugin)
135
131
 
136
- ### react-native-video and expo-av
137
-
138
- - Both dependencies are removed since `0.11.0`.
139
- - You still be able to provide a `video` but you need to provide `renderMessageVideo` prop.
140
-
141
132
  ## Testing
142
133
  `TEST_ID` is exported as constants that can be used in your testing library of choice
143
134
 
@@ -347,7 +338,7 @@ interface QuickReplies {
347
338
 
348
339
  ## Props
349
340
 
350
- - **`messageContainerRef`** _(FlatList ref)_ - Ref to the flatlist
341
+ - **`messageContainerRef`** _(FlashList ref)_ - Ref to the flashlist
351
342
  - **`textInputRef`** _(TextInput ref)_ - Ref to the text input
352
343
  - **`messages`** _(Array)_ - Messages to display
353
344
  - **`isTyping`** _(Bool)_ - Typing Indicator state; default `false`. If you use`renderFooter` it will override this.
@@ -360,7 +351,8 @@ interface QuickReplies {
360
351
  - **`alwaysShowSend`** _(Bool)_ - Always show send button in input text composer; default `false`, show only when text input is not empty
361
352
  - **`locale`** _(String)_ - Locale to localize the dates. You need first to import the locale you need (ie. `require('dayjs/locale/de')` or `import 'dayjs/locale/fr'`)
362
353
  - **`timeFormat`** _(String)_ - Format to use for rendering times; default is `'LT'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
363
- - **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'ll'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
354
+ - **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'D MMMM'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
355
+ - **`dateFormatCalendar`** _(String)_ - Format to use for rendering relative times; Today - for now (see [Day.js Calendar](https://day.js.org/docs/en/plugin/calendar))
364
356
  - **`loadEarlier`** _(Bool)_ - Enables the "load earlier messages" button, required for `infiniteScroll`
365
357
  - **`onLoadEarlier`** _(Function)_ - Callback when loading earlier messages
366
358
  - **`isLoadingEarlier`** _(Bool)_ - Display an `ActivityIndicator` when loading earlier messages
@@ -421,11 +413,11 @@ interface QuickReplies {
421
413
  />
422
414
  ```
423
415
 
424
- - **`extraData`** _(Object)_ - Extra props for re-rendering FlatList on demand. This will be useful for rendering footer etc.
416
+ - **`extraData`** _(Object)_ - Extra props for re-rendering FlashList on demand. This will be useful for rendering footer etc.
425
417
  - **`minComposerHeight`** _(Object)_ - Custom min-height of the composer.
426
418
  - **`maxComposerHeight`** _(Object)_ - Custom max height of the composer.
427
419
 
428
- * **`scrollToBottom`** _(Bool)_ - Enables the scroll to bottom Component (Default is false)
420
+ * **`isScrollToBottomEnabled`** _(Bool)_ - Enables the scroll to bottom Component (Default is false)
429
421
  * **`scrollToBottomComponent`** _(Function)_ - Custom Scroll To Bottom Component container
430
422
  * **`scrollToBottomOffset`** _(Integer)_ - Custom Height Offset upon which to begin showing Scroll To Bottom Component (Default is 200)
431
423
  * **`scrollToBottomStyle`** _(Object)_ - Custom style for Bottom Component container
@@ -436,7 +428,6 @@ interface QuickReplies {
436
428
  * **`renderQuickReplySend`** _(Function)_ - Custom quick reply **send** view
437
429
  * **`shouldUpdateMessage`** _(Function)_ - Lets the message component know when to update outside of normal cases.
438
430
  * **`infiniteScroll`** _(Bool)_ - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet supported for the web). You need to add `loadEarlier` prop too.
439
- * **`isStatusBarTranslucentAndroid`** _(Bool)_ - If you use translucent status bar on Android, set this option to true. Ignored on iOS.
440
431
 
441
432
  ## Notes for [Redux](https://github.com/reactjs/redux)
442
433
 
package/lib/Actions.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import PropTypes from 'prop-types';
2
1
  import React, { ReactNode } from 'react';
3
2
  import { StyleProp, ViewStyle, TextStyle } from 'react-native';
4
3
  export interface ActionsProps {
@@ -13,13 +12,3 @@ export interface ActionsProps {
13
12
  onPressActionButton?(): void;
14
13
  }
15
14
  export declare function Actions({ options, optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }: ActionsProps): React.JSX.Element;
16
- export declare namespace Actions {
17
- var propTypes: {
18
- options: PropTypes.Requireable<object>;
19
- optionTintColor: PropTypes.Requireable<string>;
20
- icon: PropTypes.Requireable<(...args: any[]) => any>;
21
- onPressActionButton: PropTypes.Requireable<(...args: any[]) => any>;
22
- wrapperStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
23
- containerStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
24
- };
25
- }
package/lib/Actions.js CHANGED
@@ -1,9 +1,8 @@
1
- import PropTypes from 'prop-types';
2
1
  import React, { useCallback } from 'react';
3
2
  import { StyleSheet, Text, TouchableOpacity, View, } from 'react-native';
4
3
  import Color from './Color';
5
- import { StylePropType } from './utils';
6
4
  import { useChatContext } from './GiftedChatContext';
5
+ import stylesCommon from './styles';
7
6
  export function Actions({ options, optionTintColor = Color.optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }) {
8
7
  const { actionSheet } = useChatContext();
9
8
  const onActionsPress = useCallback(() => {
@@ -26,7 +25,7 @@ export function Actions({ options, optionTintColor = Color.optionTintColor, icon
26
25
  const renderIcon = useCallback(() => {
27
26
  if (icon)
28
27
  return icon();
29
- return (<View style={[styles.wrapper, wrapperStyle]}>
28
+ return (<View style={[stylesCommon.fill, stylesCommon.centerItems, styles.wrapper, wrapperStyle]}>
30
29
  <Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
31
30
  </View>);
32
31
  }, [icon, iconTextStyle, wrapperStyle]);
@@ -34,14 +33,6 @@ export function Actions({ options, optionTintColor = Color.optionTintColor, icon
34
33
  {renderIcon()}
35
34
  </TouchableOpacity>);
36
35
  }
37
- Actions.propTypes = {
38
- options: PropTypes.object,
39
- optionTintColor: PropTypes.string,
40
- icon: PropTypes.func,
41
- onPressActionButton: PropTypes.func,
42
- wrapperStyle: StylePropType,
43
- containerStyle: StylePropType,
44
- };
45
36
  const styles = StyleSheet.create({
46
37
  container: {
47
38
  width: 26,
@@ -53,9 +44,6 @@ const styles = StyleSheet.create({
53
44
  borderRadius: 13,
54
45
  borderColor: Color.defaultColor,
55
46
  borderWidth: 2,
56
- flex: 1,
57
- alignItems: 'center',
58
- justifyContent: 'center',
59
47
  },
60
48
  iconText: {
61
49
  color: Color.defaultColor,
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EACL,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,IAAI,GAIL,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAYpD,MAAM,UAAU,OAAO,CAAE,EACvB,OAAO,EACP,eAAe,GAAG,KAAK,CAAC,eAAe,EACvC,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,GACD;IACb,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,CAAA;IAExC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,IAAI,CAAC,OAAO;YACV,OAAM;QAER,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;Q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,CAAC,mBAAmB,IAAI,cAAc,CAAC,CAE/C;MAAA,CAAC,UAAU,EAAE,CACf;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,EAAE;KACjB;IACD,OAAO,EAAE;QACP,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,KAAK,CAAC,YAAY;QACzB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,KAAK,CAAC,qBAAqB;QAC5C,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA"}
package/lib/Avatar.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import PropTypes from 'prop-types';
2
1
  import React, { ReactNode } from 'react';
3
2
  import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
4
- import { IMessage, LeftRightStyle, User } from './Models';
3
+ import { IMessage, LeftRightStyle, User } from './types';
5
4
  export interface AvatarProps<TMessage extends IMessage> {
6
5
  currentMessage: TMessage;
7
6
  previousMessage?: TMessage;
@@ -17,24 +16,3 @@ export interface AvatarProps<TMessage extends IMessage> {
17
16
  onLongPressAvatar?: (user: User) => void;
18
17
  }
19
18
  export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): React.JSX.Element | null;
20
- export declare namespace Avatar {
21
- var propTypes: {
22
- renderAvatarOnTop: PropTypes.Requireable<boolean>;
23
- showAvatarForEveryMessage: PropTypes.Requireable<boolean>;
24
- position: PropTypes.Requireable<string>;
25
- currentMessage: PropTypes.Requireable<object>;
26
- previousMessage: PropTypes.Requireable<object>;
27
- nextMessage: PropTypes.Requireable<object>;
28
- onPressAvatar: PropTypes.Requireable<(...args: any[]) => any>;
29
- onLongPressAvatar: PropTypes.Requireable<(...args: any[]) => any>;
30
- renderAvatar: PropTypes.Requireable<(...args: any[]) => any>;
31
- containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
32
- left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
33
- right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
34
- }>>;
35
- imageStyle: PropTypes.Requireable<PropTypes.InferProps<{
36
- left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
37
- right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
38
- }>>;
39
- };
40
- }
package/lib/Avatar.js CHANGED
@@ -1,8 +1,7 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
1
+ import React, { useCallback } from 'react';
3
2
  import { StyleSheet, View, } from 'react-native';
4
3
  import { GiftedAvatar } from './GiftedAvatar';
5
- import { StylePropType, isSameUser, isSameDay } from './utils';
4
+ import { isSameUser, isSameDay } from './utils';
6
5
  const styles = {
7
6
  left: StyleSheet.create({
8
7
  container: {
@@ -34,23 +33,7 @@ const styles = {
34
33
  export function Avatar(props) {
35
34
  const { renderAvatarOnTop, showAvatarForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, onPressAvatar, onLongPressAvatar, } = props;
36
35
  const messageToCompare = renderAvatarOnTop ? previousMessage : nextMessage;
37
- if (renderAvatar === null)
38
- return null;
39
- if (!showAvatarForEveryMessage &&
40
- currentMessage &&
41
- messageToCompare &&
42
- isSameUser(currentMessage, messageToCompare) &&
43
- isSameDay(currentMessage, messageToCompare))
44
- return (<View style={[
45
- styles[position].container,
46
- containerStyle?.[position],
47
- ]}>
48
- <GiftedAvatar avatarStyle={[
49
- styles[position].image,
50
- imageStyle?.[position],
51
- ]}/>
52
- </View>);
53
- const renderAvatarComponent = () => {
36
+ const renderAvatarComponent = useCallback(() => {
54
37
  if (renderAvatar)
55
38
  return renderAvatar({
56
39
  renderAvatarOnTop,
@@ -70,7 +53,35 @@ export function Avatar(props) {
70
53
  imageStyle?.[position],
71
54
  ]} user={currentMessage.user} onPress={() => onPressAvatar?.(currentMessage.user)} onLongPress={() => onLongPressAvatar?.(currentMessage.user)}/>);
72
55
  return null;
73
- };
56
+ }, [
57
+ renderAvatar,
58
+ renderAvatarOnTop,
59
+ showAvatarForEveryMessage,
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 (!showAvatarForEveryMessage &&
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
+ <GiftedAvatar avatarStyle={[
81
+ styles[position].image,
82
+ imageStyle?.[position],
83
+ ]}/>
84
+ </View>);
74
85
  return (<View style={[
75
86
  styles[position].container,
76
87
  renderAvatarOnTop && styles[position].onTop,
@@ -79,23 +90,4 @@ export function Avatar(props) {
79
90
  {renderAvatarComponent()}
80
91
  </View>);
81
92
  }
82
- Avatar.propTypes = {
83
- renderAvatarOnTop: PropTypes.bool,
84
- showAvatarForEveryMessage: PropTypes.bool,
85
- position: PropTypes.oneOf(['left', 'right']),
86
- currentMessage: PropTypes.object,
87
- previousMessage: PropTypes.object,
88
- nextMessage: PropTypes.object,
89
- onPressAvatar: PropTypes.func,
90
- onLongPressAvatar: PropTypes.func,
91
- renderAvatar: PropTypes.func,
92
- containerStyle: PropTypes.shape({
93
- left: StylePropType,
94
- right: StylePropType,
95
- }),
96
- imageStyle: PropTypes.shape({
97
- left: StylePropType,
98
- right: StylePropType,
99
- }),
100
- };
101
93
  //# sourceMappingURL=Avatar.js.map
package/lib/Av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AI,CAAC,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,iBAAiB;QACjB,yBAAyB;QACzB,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,yBAAyB;QAC1B,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,YAAY,CACX,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,iBAAiB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;YAC3C,cAAc,EAAE,CAAC,QAAQ,CAAC;SAC3B,CAAC,CAEF;MAAA,CAAC,qBAAqB,EAAE,CAC1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { IMessage } from '../types';
3
+ import { BubbleProps } from './types';
4
+ export * from './types';
5
+ export default class Bubble<TMessage extends IMessage = IMessage> extends React.Component<BubbleProps<TMessage>> {
6
+ static contextType: React.Context<import("..").IGiftedChatContext>;
7
+ onPress: () => void;
8
+ onLongPress: () => void;
9
+ styledBubbleToNext(): (import("react-native").StyleProp<import("react-native").ViewStyle> | {
10
+ borderBottomLeftRadius: number;
11
+ } | {
12
+ borderBottomRightRadius: number;
13
+ })[] | null;
14
+ styledBubbleToPrevious(): (import("react-native").StyleProp<import("react-native").ViewStyle> | {
15
+ borderTopLeftRadius: number;
16
+ } | {
17
+ borderTopRightRadius: number;
18
+ })[] | null;
19
+ renderQuickReplies(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
20
+ renderMessageText(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
21
+ renderMessageImage(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
22
+ renderMessageVideo(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
23
+ renderMessageAudio(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
24
+ renderTicks(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
25
+ renderTime(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
26
+ renderUsername(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
27
+ renderCustomView(): React.ReactNode;
28
+ renderBubbleContent(): React.JSX.Element;
29
+ render(): React.JSX.Element;
30
+ }
@@ -1,85 +1,16 @@
1
- import PropTypes from 'prop-types';
2
1
  import React from 'react';
3
- import { Text, StyleSheet, TouchableWithoutFeedback, View, } from 'react-native';
4
- import { GiftedChatContext } from './GiftedChatContext';
5
- import { QuickReplies } from './QuickReplies';
6
- import { MessageText } from './MessageText';
7
- import { MessageImage } from './MessageImage';
8
- import { MessageVideo } from './MessageVideo';
9
- import { MessageAudio } from './MessageAudio';
10
- import { Time } from './Time';
11
- import Color from './Color';
12
- import { StylePropType, isSameUser, isSameDay } from './utils';
13
- const styles = {
14
- left: StyleSheet.create({
15
- container: {
16
- flex: 1,
17
- alignItems: 'flex-start',
18
- },
19
- wrapper: {
20
- borderRadius: 15,
21
- backgroundColor: Color.leftBubbleBackground,
22
- marginRight: 60,
23
- minHeight: 20,
24
- justifyContent: 'flex-end',
25
- },
26
- containerToNext: {
27
- borderBottomLeftRadius: 3,
28
- },
29
- containerToPrevious: {
30
- borderTopLeftRadius: 3,
31
- },
32
- bottom: {
33
- flexDirection: 'row',
34
- justifyContent: 'flex-start',
35
- },
36
- }),
37
- right: StyleSheet.create({
38
- container: {
39
- flex: 1,
40
- alignItems: 'flex-end',
41
- },
42
- wrapper: {
43
- borderRadius: 15,
44
- backgroundColor: Color.defaultBlue,
45
- marginLeft: 60,
46
- minHeight: 20,
47
- justifyContent: 'flex-end',
48
- },
49
- containerToNext: {
50
- borderBottomRightRadius: 3,
51
- },
52
- containerToPrevious: {
53
- borderTopRightRadius: 3,
54
- },
55
- bottom: {
56
- flexDirection: 'row',
57
- justifyContent: 'flex-end',
58
- },
59
- }),
60
- content: StyleSheet.create({
61
- tick: {
62
- fontSize: 10,
63
- backgroundColor: Color.backgroundTransparent,
64
- color: Color.white,
65
- },
66
- tickView: {
67
- flexDirection: 'row',
68
- marginRight: 10,
69
- },
70
- username: {
71
- top: -3,
72
- left: 0,
73
- fontSize: 12,
74
- backgroundColor: 'transparent',
75
- color: '#aaa',
76
- },
77
- usernameView: {
78
- flexDirection: 'row',
79
- marginHorizontal: 10,
80
- },
81
- }),
82
- };
2
+ import { Text, TouchableWithoutFeedback, View, } from 'react-native';
3
+ import { GiftedChatContext } from '../GiftedChatContext';
4
+ import { QuickReplies } from '../QuickReplies';
5
+ import { MessageText } from '../MessageText';
6
+ import { MessageImage } from '../MessageImage';
7
+ import { MessageVideo } from '../MessageVideo';
8
+ import { MessageAudio } from '../MessageAudio';
9
+ import { Time } from '../Time';
10
+ import { isSameUser, isSameDay } from '../utils';
11
+ import stylesCommon from '../styles';
12
+ import styles from './styles';
13
+ export * from './types';
83
14
  class Bubble extends React.Component {
84
15
  constructor() {
85
16
  super(...arguments);
@@ -133,7 +64,7 @@ class Bubble extends React.Component {
133
64
  }
134
65
  renderQuickReplies() {
135
66
  const { currentMessage, onQuickReply, nextMessage, renderQuickReplySend, quickReplyStyle, quickReplyTextStyle, quickReplyContainerStyle, } = this.props;
136
- if (currentMessage && currentMessage.quickReplies) {
67
+ if (currentMessage?.quickReplies) {
137
68
  const {
138
69
  /* eslint-disable @typescript-eslint/no-unused-vars */
139
70
  containerStyle, wrapperStyle,
@@ -146,7 +77,7 @@ class Bubble extends React.Component {
146
77
  return null;
147
78
  }
148
79
  renderMessageText() {
149
- if (this.props.currentMessage && this.props.currentMessage.text) {
80
+ if (this.props.currentMessage?.text) {
150
81
  const {
151
82
  /* eslint-disable @typescript-eslint/no-unused-vars */
152
83
  containerStyle, wrapperStyle, optionTitles,
@@ -159,7 +90,7 @@ class Bubble extends React.Component {
159
90
  return null;
160
91
  }
161
92
  renderMessageImage() {
162
- if (this.props.currentMessage && this.props.currentMessage.image) {
93
+ if (this.props.currentMessage?.image) {
163
94
  const {
164
95
  /* eslint-disable @typescript-eslint/no-unused-vars */
165
96
  containerStyle, wrapperStyle,
@@ -196,12 +127,11 @@ class Bubble extends React.Component {
196
127
  return <MessageAudio />;
197
128
  }
198
129
  renderTicks() {
199
- const { currentMessage, renderTicks, user } = this.props;
130
+ const { currentMessage, renderTicks, user, } = this.props;
200
131
  if (renderTicks && currentMessage)
201
132
  return renderTicks(currentMessage);
202
- if (currentMessage &&
203
- user &&
204
- currentMessage.user &&
133
+ if (user &&
134
+ currentMessage?.user &&
205
135
  currentMessage.user._id !== user._id)
206
136
  return null;
207
137
  if (currentMessage &&
@@ -220,7 +150,7 @@ class Bubble extends React.Component {
220
150
  return null;
221
151
  }
222
152
  renderTime() {
223
- if (this.props.currentMessage && this.props.currentMessage.createdAt) {
153
+ if (this.props.currentMessage?.createdAt) {
224
154
  const {
225
155
  /* eslint-disable @typescript-eslint/no-unused-vars */
226
156
  containerStyle, wrapperStyle, textStyle,
@@ -233,7 +163,7 @@ class Bubble extends React.Component {
233
163
  return null;
234
164
  }
235
165
  renderUsername() {
236
- const { currentMessage, user, renderUsername } = this.props;
166
+ const { currentMessage, user, renderUsername, } = this.props;
237
167
  if (this.props.renderUsernameOnMessage && currentMessage) {
238
168
  if (user && currentMessage.user._id === user._id)
239
169
  return null;
@@ -254,25 +184,19 @@ class Bubble extends React.Component {
254
184
  return null;
255
185
  }
256
186
  renderBubbleContent() {
257
- return this.props.isCustomViewBottom
258
- ? (<View>
259
- {this.renderMessageImage()}
260
- {this.renderMessageVideo()}
261
- {this.renderMessageAudio()}
262
- {this.renderMessageText()}
263
- {this.renderCustomView()}
264
- </View>)
265
- : (<View>
266
- {this.renderCustomView()}
267
- {this.renderMessageImage()}
268
- {this.renderMessageVideo()}
269
- {this.renderMessageAudio()}
270
- {this.renderMessageText()}
271
- </View>);
187
+ return (<View>
188
+ {!this.props.isCustomViewBottom && this.renderCustomView()}
189
+ {this.renderMessageImage()}
190
+ {this.renderMessageVideo()}
191
+ {this.renderMessageAudio()}
192
+ {this.renderMessageText()}
193
+ {this.props.isCustomViewBottom && this.renderCustomView()}
194
+ </View>);
272
195
  }
273
196
  render() {
274
- const { position, containerStyle, wrapperStyle, bottomContainerStyle } = this.props;
197
+ const { position, containerStyle, wrapperStyle, bottomContainerStyle, } = this.props;
275
198
  return (<View style={[
199
+ stylesCommon.fill,
276
200
  styles[position].container,
277
201
  containerStyle && containerStyle[position],
278
202
  ]}>
@@ -301,79 +225,5 @@ class Bubble extends React.Component {
301
225
  }
302
226
  }
303
227
  Bubble.contextType = GiftedChatContext;
304
- Bubble.defaultProps = {
305
- touchableProps: {},
306
- onPress: null,
307
- onLongPress: null,
308
- renderMessageImage: null,
309
- renderMessageVideo: null,
310
- renderMessageAudio: null,
311
- renderMessageText: null,
312
- renderCustomView: null,
313
- renderUsername: null,
314
- renderTicks: null,
315
- renderTime: null,
316
- renderQuickReplies: null,
317
- onQuickReply: null,
318
- position: 'left',
319
- currentMessage: {
320
- text: null,
321
- createdAt: null,
322
- image: null,
323
- },
324
- nextMessage: {},
325
- previousMessage: {},
326
- containerStyle: {},
327
- wrapperStyle: {},
328
- bottomContainerStyle: {},
329
- tickStyle: {},
330
- usernameStyle: {},
331
- containerToNextStyle: {},
332
- containerToPreviousStyle: {},
333
- };
334
- Bubble.propTypes = {
335
- user: PropTypes.object.isRequired,
336
- touchableProps: PropTypes.object,
337
- onLongPress: PropTypes.func,
338
- renderMessageImage: PropTypes.func,
339
- renderMessageVideo: PropTypes.func,
340
- renderMessageAudio: PropTypes.func,
341
- renderMessageText: PropTypes.func,
342
- renderCustomView: PropTypes.func,
343
- isCustomViewBottom: PropTypes.bool,
344
- renderUsernameOnMessage: PropTypes.bool,
345
- renderUsername: PropTypes.func,
346
- renderTime: PropTypes.func,
347
- renderTicks: PropTypes.func,
348
- renderQuickReplies: PropTypes.func,
349
- onQuickReply: PropTypes.func,
350
- position: PropTypes.oneOf(['left', 'right']),
351
- optionTitles: PropTypes.arrayOf(PropTypes.string),
352
- currentMessage: PropTypes.object,
353
- nextMessage: PropTypes.object,
354
- previousMessage: PropTypes.object,
355
- containerStyle: PropTypes.shape({
356
- left: StylePropType,
357
- right: StylePropType,
358
- }),
359
- wrapperStyle: PropTypes.shape({
360
- left: StylePropType,
361
- right: StylePropType,
362
- }),
363
- bottomContainerStyle: PropTypes.shape({
364
- left: StylePropType,
365
- right: StylePropType,
366
- }),
367
- tickStyle: StylePropType,
368
- usernameStyle: StylePropType,
369
- containerToNextStyle: PropTypes.shape({
370
- left: StylePropType,
371
- right: StylePropType,
372
- }),
373
- containerToPreviousStyle: PropTypes.shape({
374
- left: StylePropType,
375
- right: StylePropType,
376
- }),
377
- };
378
228
  export default Bubble;
379
- //# sourceMappingURL=Bubble.js.map
229
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Bubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,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