stream-chat-react-native-core 4.3.1 → 4.4.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 (186) hide show
  1. package/README.md +3 -3
  2. package/lib/commonjs/components/Attachment/Card.js +25 -28
  3. package/lib/commonjs/components/Attachment/Card.js.map +1 -1
  4. package/lib/commonjs/components/Attachment/FileAttachment.js +19 -24
  5. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  6. package/lib/commonjs/components/Attachment/Giphy.js +27 -25
  7. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  8. package/lib/commonjs/components/Attachment/hooks/useGoToURL.js +42 -0
  9. package/lib/commonjs/components/Attachment/hooks/useGoToURL.js.map +1 -0
  10. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +11 -7
  11. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  12. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  13. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +4 -12
  14. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  15. package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js +4 -12
  16. package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  17. package/lib/commonjs/components/Chat/Chat.js +8 -4
  18. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  19. package/lib/commonjs/components/Chat/hooks/useAppSettings.js +80 -0
  20. package/lib/commonjs/components/Chat/hooks/useAppSettings.js.map +1 -0
  21. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +3 -1
  22. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  23. package/lib/commonjs/components/Message/Message.js +27 -22
  24. package/lib/commonjs/components/Message/Message.js.map +1 -1
  25. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +28 -14
  26. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  27. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +108 -40
  28. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  29. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +117 -24
  30. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
  31. package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +52 -20
  32. package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js.map +1 -1
  33. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +8 -6
  34. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
  35. package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
  36. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  37. package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
  38. package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
  39. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +145 -119
  40. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  41. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  42. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  43. package/lib/commonjs/i18n/en.json +2 -0
  44. package/lib/commonjs/i18n/fr.json +2 -0
  45. package/lib/commonjs/i18n/hi.json +2 -0
  46. package/lib/commonjs/i18n/it.json +2 -0
  47. package/lib/commonjs/i18n/ja.json +3 -1
  48. package/lib/commonjs/i18n/ko.json +3 -1
  49. package/lib/commonjs/i18n/nl.json +2 -0
  50. package/lib/commonjs/i18n/ru.json +2 -0
  51. package/lib/commonjs/i18n/tr.json +2 -0
  52. package/lib/commonjs/icons/Warning.js +38 -0
  53. package/lib/commonjs/icons/Warning.js.map +1 -0
  54. package/lib/commonjs/icons/index.js +13 -0
  55. package/lib/commonjs/icons/index.js.map +1 -1
  56. package/lib/commonjs/utils/utils.js +33 -2
  57. package/lib/commonjs/utils/utils.js.map +1 -1
  58. package/lib/commonjs/version.json +1 -1
  59. package/lib/module/components/Attachment/Card.js +25 -28
  60. package/lib/module/components/Attachment/Card.js.map +1 -1
  61. package/lib/module/components/Attachment/FileAttachment.js +19 -24
  62. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  63. package/lib/module/components/Attachment/Giphy.js +27 -25
  64. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  65. package/lib/module/components/Attachment/hooks/useGoToURL.js +42 -0
  66. package/lib/module/components/Attachment/hooks/useGoToURL.js.map +1 -0
  67. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +11 -7
  68. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  69. package/lib/module/components/Channel/Channel.js.map +1 -1
  70. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +4 -12
  71. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  72. package/lib/module/components/Channel/hooks/useCreateThreadContext.js +4 -12
  73. package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  74. package/lib/module/components/Chat/Chat.js +8 -4
  75. package/lib/module/components/Chat/Chat.js.map +1 -1
  76. package/lib/module/components/Chat/hooks/useAppSettings.js +80 -0
  77. package/lib/module/components/Chat/hooks/useAppSettings.js.map +1 -0
  78. package/lib/module/components/Chat/hooks/useCreateChatContext.js +3 -1
  79. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  80. package/lib/module/components/Message/Message.js +27 -22
  81. package/lib/module/components/Message/Message.js.map +1 -1
  82. package/lib/module/components/Message/MessageSimple/utils/renderText.js +28 -14
  83. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  84. package/lib/module/components/MessageInput/FileUploadPreview.js +108 -40
  85. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  86. package/lib/module/components/MessageInput/ImageUploadPreview.js +117 -24
  87. package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
  88. package/lib/module/components/MessageInput/UploadProgressIndicator.js +52 -20
  89. package/lib/module/components/MessageInput/UploadProgressIndicator.js.map +1 -1
  90. package/lib/module/components/MessageList/ScrollToBottomButton.js +8 -6
  91. package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
  92. package/lib/module/contexts/chatContext/ChatContext.js +2 -2
  93. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  94. package/lib/module/contexts/messageContext/MessageContext.js +2 -2
  95. package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
  96. package/lib/module/contexts/messageInputContext/MessageInputContext.js +145 -119
  97. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  98. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  99. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  100. package/lib/module/i18n/en.json +2 -0
  101. package/lib/module/i18n/fr.json +2 -0
  102. package/lib/module/i18n/hi.json +2 -0
  103. package/lib/module/i18n/it.json +2 -0
  104. package/lib/module/i18n/ja.json +3 -1
  105. package/lib/module/i18n/ko.json +3 -1
  106. package/lib/module/i18n/nl.json +2 -0
  107. package/lib/module/i18n/ru.json +2 -0
  108. package/lib/module/i18n/tr.json +2 -0
  109. package/lib/module/icons/Warning.js +38 -0
  110. package/lib/module/icons/Warning.js.map +1 -0
  111. package/lib/module/icons/index.js +13 -0
  112. package/lib/module/icons/index.js.map +1 -1
  113. package/lib/module/utils/utils.js +33 -2
  114. package/lib/module/utils/utils.js.map +1 -1
  115. package/lib/module/version.json +1 -1
  116. package/lib/typescript/components/Attachment/FileAttachment.d.ts +0 -1
  117. package/lib/typescript/components/Attachment/hooks/useGoToURL.d.ts +2 -0
  118. package/lib/typescript/components/Chat/hooks/__tests__/useAppSettings.test.d.ts +1 -0
  119. package/lib/typescript/components/Chat/hooks/useAppSettings.d.ts +3 -0
  120. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  121. package/lib/typescript/components/Message/Message.d.ts +12 -2
  122. package/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts +1 -3
  123. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +5 -1
  124. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +4 -4
  125. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +3 -3
  126. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +1 -0
  127. package/lib/typescript/i18n/en.json +2 -0
  128. package/lib/typescript/i18n/fr.json +2 -0
  129. package/lib/typescript/i18n/hi.json +2 -0
  130. package/lib/typescript/i18n/it.json +2 -0
  131. package/lib/typescript/i18n/ja.json +3 -1
  132. package/lib/typescript/i18n/ko.json +3 -1
  133. package/lib/typescript/i18n/nl.json +2 -0
  134. package/lib/typescript/i18n/ru.json +2 -0
  135. package/lib/typescript/i18n/tr.json +2 -0
  136. package/lib/typescript/icons/Warning.d.ts +3 -0
  137. package/lib/typescript/icons/index.d.ts +1 -0
  138. package/lib/typescript/utils/Streami18n.d.ts +6 -0
  139. package/lib/typescript/utils/utils.d.ts +15 -2
  140. package/package.json +2 -2
  141. package/src/components/Attachment/Card.tsx +5 -13
  142. package/src/components/Attachment/FileAttachment.tsx +5 -13
  143. package/src/components/Attachment/Giphy.tsx +3 -1
  144. package/src/components/Attachment/__tests__/Attachment.test.js +39 -0
  145. package/src/components/Attachment/hooks/useGoToURL.ts +27 -0
  146. package/src/components/AttachmentPicker/AttachmentPicker.tsx +23 -13
  147. package/src/components/Channel/Channel.tsx +1 -1
  148. package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +3 -9
  149. package/src/components/Channel/hooks/useCreateThreadContext.ts +3 -9
  150. package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +1 -0
  151. package/src/components/Chat/Chat.tsx +4 -0
  152. package/src/components/Chat/hooks/__tests__/useAppSettings.test.tsx +34 -0
  153. package/src/components/Chat/hooks/useAppSettings.ts +39 -0
  154. package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
  155. package/src/components/Message/Message.tsx +56 -48
  156. package/src/components/Message/MessageSimple/utils/renderText.tsx +17 -2
  157. package/src/components/MessageInput/FileUploadPreview.tsx +60 -14
  158. package/src/components/MessageInput/ImageUploadPreview.tsx +95 -42
  159. package/src/components/MessageInput/UploadProgressIndicator.tsx +49 -22
  160. package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +50 -80
  161. package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +49 -74
  162. package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +36 -13
  163. package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +2 -2
  164. package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +122 -17
  165. package/src/components/MessageList/ScrollToBottomButton.tsx +2 -1
  166. package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.js.snap +1 -0
  167. package/src/contexts/chatContext/ChatContext.tsx +5 -1
  168. package/src/contexts/messageContext/MessageContext.tsx +7 -4
  169. package/src/contexts/messageInputContext/MessageInputContext.tsx +127 -96
  170. package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +2 -2
  171. package/src/contexts/themeContext/utils/theme.ts +1 -0
  172. package/src/i18n/en.json +2 -0
  173. package/src/i18n/fr.json +2 -0
  174. package/src/i18n/hi.json +2 -0
  175. package/src/i18n/it.json +2 -0
  176. package/src/i18n/ja.json +3 -1
  177. package/src/i18n/ko.json +3 -1
  178. package/src/i18n/nl.json +2 -0
  179. package/src/i18n/ru.json +2 -0
  180. package/src/i18n/tr.json +2 -0
  181. package/src/icons/Warning.tsx +12 -0
  182. package/src/icons/index.ts +1 -0
  183. package/src/utils/utils.ts +53 -1
  184. package/src/version.json +1 -1
  185. package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +0 -4413
  186. package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +0 -2373
@@ -18,6 +18,8 @@ var _utils = require("../../utils/utils");
18
18
  var _this = this,
19
19
  _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/MessageInput/UploadProgressIndicator.tsx";
20
20
 
21
+ var REFRESH_ICON_SIZE = 18;
22
+
21
23
  var styles = _reactNative.StyleSheet.create({
22
24
  activityIndicatorContainer: {
23
25
  alignItems: 'center',
@@ -59,21 +61,18 @@ var styles = _reactNative.StyleSheet.create({
59
61
 
60
62
  var UploadProgressIndicator = function UploadProgressIndicator(props) {
61
63
  var action = props.action,
62
- active = props.active,
63
64
  children = props.children,
64
65
  style = props.style,
65
66
  type = props.type;
66
67
 
67
68
  var _useTheme = (0, _ThemeContext.useTheme)(),
68
69
  _useTheme$theme = _useTheme.theme,
69
- _useTheme$theme$color = _useTheme$theme.colors,
70
- overlayColor = _useTheme$theme$color.overlay,
71
- white_smoke = _useTheme$theme$color.white_smoke,
70
+ overlayColor = _useTheme$theme.colors.overlay,
72
71
  _useTheme$theme$messa = _useTheme$theme.messageInput.uploadProgressIndicator,
73
72
  container = _useTheme$theme$messa.container,
74
73
  overlay = _useTheme$theme$messa.overlay;
75
74
 
76
- return !active ? _react["default"].createElement(_reactNative.View, {
75
+ return type === _utils.ProgressIndicatorTypes.INACTIVE ? _react["default"].createElement(_reactNative.View, {
77
76
  style: [styles.overflowHidden, style],
78
77
  testID: "inactive-upload-progress-indicator",
79
78
  __self: _this,
@@ -102,22 +101,47 @@ var UploadProgressIndicator = function UploadProgressIndicator(props) {
102
101
  columnNumber: 7
103
102
  }
104
103
  }), _react["default"].createElement(_reactNative.View, {
105
- style: [styles.container, {
104
+ style: [type === _utils.ProgressIndicatorTypes.NOT_SUPPORTED ? styles.overflowHidden : styles.container, {
106
105
  backgroundColor: overlayColor
107
106
  }, container],
107
+ testID: "not-supported-upload-progress-indicator",
108
108
  __self: _this,
109
109
  __source: {
110
110
  fileName: _jsxFileName,
111
111
  lineNumber: 86,
112
112
  columnNumber: 7
113
113
  }
114
- }, type === _utils.ProgressIndicatorTypes.IN_PROGRESS && _react["default"].createElement(_reactNative.View, {
114
+ }, type === _utils.ProgressIndicatorTypes.IN_PROGRESS && _react["default"].createElement(InProgressIndicator, {
115
+ __self: _this,
116
+ __source: {
117
+ fileName: _jsxFileName,
118
+ lineNumber: 94,
119
+ columnNumber: 57
120
+ }
121
+ }), type === _utils.ProgressIndicatorTypes.RETRY && _react["default"].createElement(RetryIndicator, {
122
+ action: action,
123
+ __self: _this,
124
+ __source: {
125
+ fileName: _jsxFileName,
126
+ lineNumber: 95,
127
+ columnNumber: 51
128
+ }
129
+ })));
130
+ };
131
+
132
+ exports.UploadProgressIndicator = UploadProgressIndicator;
133
+
134
+ var InProgressIndicator = function InProgressIndicator() {
135
+ var _useTheme2 = (0, _ThemeContext.useTheme)(),
136
+ white_smoke = _useTheme2.theme.colors.white_smoke;
137
+
138
+ return _react["default"].createElement(_reactNative.View, {
115
139
  style: styles.activityIndicatorContainer,
116
140
  __self: _this,
117
141
  __source: {
118
142
  fileName: _jsxFileName,
119
- lineNumber: 88,
120
- columnNumber: 11
143
+ lineNumber: 109,
144
+ columnNumber: 5
121
145
  }
122
146
  }, _react["default"].createElement(_reactNative.ActivityIndicator, {
123
147
  color: white_smoke,
@@ -125,32 +149,40 @@ var UploadProgressIndicator = function UploadProgressIndicator(props) {
125
149
  __self: _this,
126
150
  __source: {
127
151
  fileName: _jsxFileName,
128
- lineNumber: 89,
129
- columnNumber: 13
152
+ lineNumber: 110,
153
+ columnNumber: 7
130
154
  }
131
- })), type === _utils.ProgressIndicatorTypes.RETRY && _react["default"].createElement(_reactNative.TouchableOpacity, {
155
+ }));
156
+ };
157
+
158
+ var RetryIndicator = function RetryIndicator(_ref) {
159
+ var action = _ref.action;
160
+
161
+ var _useTheme3 = (0, _ThemeContext.useTheme)(),
162
+ white_smoke = _useTheme3.theme.colors.white_smoke;
163
+
164
+ return _react["default"].createElement(_reactNative.TouchableOpacity, {
132
165
  onPress: action,
133
166
  style: styles.retryButtonContainer,
134
167
  __self: _this,
135
168
  __source: {
136
169
  fileName: _jsxFileName,
137
- lineNumber: 93,
138
- columnNumber: 11
170
+ lineNumber: 123,
171
+ columnNumber: 5
139
172
  }
140
173
  }, _react["default"].createElement(_icons.Refresh, {
141
- height: 18,
174
+ height: REFRESH_ICON_SIZE,
142
175
  pathFill: white_smoke,
143
176
  testID: "retry-upload-progress-indicator",
144
- width: 18,
177
+ width: REFRESH_ICON_SIZE,
145
178
  __self: _this,
146
179
  __source: {
147
180
  fileName: _jsxFileName,
148
- lineNumber: 94,
149
- columnNumber: 13
181
+ lineNumber: 124,
182
+ columnNumber: 7
150
183
  }
151
- }))));
184
+ }));
152
185
  };
153
186
 
154
- exports.UploadProgressIndicator = UploadProgressIndicator;
155
187
  UploadProgressIndicator.displayName = 'UploadProgressIndicator{messageInput{uploadProgressIndicator}}';
156
188
  //# sourceMappingURL=UploadProgressIndicator.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["UploadProgressIndicator.tsx"],"names":["styles","StyleSheet","create","activityIndicatorContainer","alignItems","bottom","justifyContent","left","position","right","top","container","height","width","overflowHidden","overflow","overlay","opacity","retryButtonContainer","UploadProgressIndicator","props","action","active","children","style","type","theme","colors","overlayColor","white_smoke","messageInput","uploadProgressIndicator","backgroundColor","ProgressIndicatorTypes","IN_PROGRESS","RETRY","displayName"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;AACA;;AACA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,0BAA0B,EAAE;AAC1BC,IAAAA,UAAU,EAAE,QADc;AAE1BC,IAAAA,MAAM,EAAE,CAFkB;AAG1BC,IAAAA,cAAc,EAAE,QAHU;AAI1BC,IAAAA,IAAI,EAAE,CAJoB;AAK1BC,IAAAA,QAAQ,EAAE,UALgB;AAM1BC,IAAAA,KAAK,EAAE,CANmB;AAO1BC,IAAAA,GAAG,EAAE;AAPqB,GADG;AAU/BC,EAAAA,S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EAAEd,MAA3B;AAAmC,IAAA,KAAK,EAAErB,MAAM,CAACkB,oBAAjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACE,gCAAC,cAAD;AACE,IAAA,MAAM,EAAE,EADV;AAEE,IAAA,QAAQ,EAAEW,WAFZ;AAGE,IAAA,MAAM,EAAC,iCAHT;AAIE,IAAA,KAAK,EAAE,EAJT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF,CAPJ,CAHF,CALF;AA2BD,CAvCM;;;AAyCPV,uBAAuB,CAACiB,WAAxB,GACE,gEADF","sourcesContent":["import React from 'react';\nimport {\n ActivityIndicator,\n GestureResponderEvent,\n StyleProp,\n StyleSheet,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Refresh } from '../../icons';\nimport { ProgressIndicatorTypes } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n activityIndicatorContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n container: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n position: 'absolute',\n width: '100%',\n },\n overflowHidden: {\n overflow: 'hidden',\n },\n overlay: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n opacity: 0,\n position: 'absolute',\n width: '100%',\n },\n retryButtonContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n\nexport type UploadProgressIndicatorProps = {\n /** Action triggered when clicked indicator */\n action?: (event: GestureResponderEvent) => void;\n /** Boolean status of upload progress */\n active?: boolean;\n /** style */\n style?: StyleProp<ViewStyle>;\n /** Type of active indicator */\n type?: 'in_progress' | 'retry';\n};\n\nexport const UploadProgressIndicator: React.FC<UploadProgressIndicatorProps> = (props) => {\n const { action, active, children, style, type } = props;\n\n const {\n theme: {\n colors: { overlay: overlayColor, white_smoke },\n messageInput: {\n uploadProgressIndicator: { container, overlay },\n },\n },\n } = useTheme();\n\n return !active ? (\n <View style={[styles.overflowHidden, style]} testID='inactive-upload-progress-indicator'>\n {children}\n </View>\n ) : (\n <View style={[styles.overflowHidden, style]} testID='active-upload-progress-indicator'>\n {children}\n <View style={[styles.overlay, { backgroundColor: overlayColor }, overlay]} />\n <View style={[styles.container, { backgroundColor: overlayColor }, container]}>\n {type === ProgressIndicatorTypes.IN_PROGRESS && (\n <View style={styles.activityIndicatorContainer}>\n <ActivityIndicator color={white_smoke} testID='upload-progress-indicator' />\n </View>\n )}\n {type === ProgressIndicatorTypes.RETRY && (\n <TouchableOpacity onPress={action} style={styles.retryButtonContainer}>\n <Refresh\n height={18}\n pathFill={white_smoke}\n testID='retry-upload-progress-indicator'\n width={18}\n />\n </TouchableOpacity>\n )}\n </View>\n </View>\n );\n};\n\nUploadProgressIndicator.displayName =\n 'UploadProgressIndicator{messageInput{uploadProgressIndicator}}';\n"]}
1
+ {"version":3,"sources":["UploadProgressIndicator.tsx"],"names":["REFRESH_ICON_SIZE","styles","StyleSheet","create","activityIndicatorContainer","alignItems","bottom","justifyContent","left","position","right","top","container","height","width","overflowHidden","overflow","overlay","opacity","retryButtonContainer","UploadProgressIndicator","props","action","children","style","type","theme","overlayColor","colors","messageInput","uploadProgressIndicator","ProgressIndicatorTypes","INACTIVE","backgroundColor","NOT_SUPPORTED","IN_PROGRESS","RETRY","InProgressIndicator","white_smoke","RetryIndicator","displayName"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;AACA;;AACA;;;;;AAEA,IAAMA,iBAAiB,GAAG,EAA1B;;AAEA,IAAMC,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,0BAA0B,EAAE;AAC1BC,IAAAA,UAAU,EAAE,QADc;AAE1BC,IAAAA,MAAM,EAAE,CAFkB;AAG1BC,IAAAA,cAAc,EAAE,QAHU;AAI1BC,IAAAA,IAAI,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A;AAAA;AAAA;AAAA,IAT5C,CAHF,CALF;AAqBD,CAjCM;;;;AAmCP,IAAMe,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAM;AAChC,mBAII,6BAJJ;AAAA,MAEcC,WAFd,cACEZ,KADF,CAEIE,MAFJ,CAEcU,WAFd;;AAMA,SACE,gCAAC,iBAAD;AAAM,IAAA,KAAK,EAAErC,MAAM,CAACG,0BAApB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACE,gCAAC,8BAAD;AAAmB,IAAA,KAAK,EAAEkC,WAA1B;AAAuC,IAAA,MAAM,EAAC,2BAA9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF,CADF;AAKD,CAZD;;AAcA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,OAA8D;AAAA,MAA3DjB,MAA2D,QAA3DA,MAA2D;;AACnF,mBAII,6BAJJ;AAAA,MAEcgB,WAFd,cACEZ,KADF,CAEIE,MAFJ,CAEcU,WAFd;;AAMA,SACE,gCAAC,6BAAD;AAAkB,IAAA,OAAO,EAAEhB,MAA3B;AAAmC,IAAA,KAAK,EAAErB,MAAM,CAACkB,oBAAjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACE,gCAAC,cAAD;AACE,IAAA,MAAM,EAAEnB,iBADV;AAEE,IAAA,QAAQ,EAAEsC,WAFZ;AAGE,IAAA,MAAM,EAAC,iCAHT;AAIE,IAAA,KAAK,EAAEtC,iBAJT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF,CADF;AAUD,CAjBD;;AAmBAoB,uBAAuB,CAACoB,WAAxB,GACE,gEADF","sourcesContent":["import React from 'react';\nimport {\n ActivityIndicator,\n GestureResponderEvent,\n StyleProp,\n StyleSheet,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Refresh } from '../../icons';\nimport { ProgressIndicatorTypes } from '../../utils/utils';\n\nconst REFRESH_ICON_SIZE = 18;\n\nconst styles = StyleSheet.create({\n activityIndicatorContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n container: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n position: 'absolute',\n width: '100%',\n },\n overflowHidden: {\n overflow: 'hidden',\n },\n overlay: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n opacity: 0,\n position: 'absolute',\n width: '100%',\n },\n retryButtonContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n\nexport type UploadProgressIndicatorProps = {\n /** Action triggered when clicked indicator */\n action?: (event: GestureResponderEvent) => void;\n /** style */\n style?: StyleProp<ViewStyle>;\n /** Type of active indicator */\n type?: 'in_progress' | 'retry' | 'not_supported' | 'inactive' | null;\n};\n\nexport const UploadProgressIndicator: React.FC<UploadProgressIndicatorProps> = (props) => {\n const { action, children, style, type } = props;\n\n const {\n theme: {\n colors: { overlay: overlayColor },\n messageInput: {\n uploadProgressIndicator: { container, overlay },\n },\n },\n } = useTheme();\n\n return type === ProgressIndicatorTypes.INACTIVE ? (\n <View style={[styles.overflowHidden, style]} testID='inactive-upload-progress-indicator'>\n {children}\n </View>\n ) : (\n <View style={[styles.overflowHidden, style]} testID='active-upload-progress-indicator'>\n {children}\n <View style={[styles.overlay, { backgroundColor: overlayColor }, overlay]} />\n <View\n style={[\n type === ProgressIndicatorTypes.NOT_SUPPORTED ? styles.overflowHidden : styles.container,\n { backgroundColor: overlayColor },\n container,\n ]}\n testID='not-supported-upload-progress-indicator'\n >\n {type === ProgressIndicatorTypes.IN_PROGRESS && <InProgressIndicator />}\n {type === ProgressIndicatorTypes.RETRY && <RetryIndicator action={action} />}\n </View>\n </View>\n );\n};\n\nconst InProgressIndicator = () => {\n const {\n theme: {\n colors: { white_smoke },\n },\n } = useTheme();\n\n return (\n <View style={styles.activityIndicatorContainer}>\n <ActivityIndicator color={white_smoke} testID='upload-progress-indicator' />\n </View>\n );\n};\n\nconst RetryIndicator = ({ action }: Pick<UploadProgressIndicatorProps, 'action'>) => {\n const {\n theme: {\n colors: { white_smoke },\n },\n } = useTheme();\n\n return (\n <TouchableOpacity onPress={action} style={styles.retryButtonContainer}>\n <Refresh\n height={REFRESH_ICON_SIZE}\n pathFill={white_smoke}\n testID='retry-upload-progress-indicator'\n width={REFRESH_ICON_SIZE}\n />\n </TouchableOpacity>\n );\n};\n\nUploadProgressIndicator.displayName =\n 'UploadProgressIndicator{messageInput{uploadProgressIndicator}}';\n"]}
@@ -72,6 +72,7 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
72
72
  black = _useTheme$theme$color.black,
73
73
  white = _useTheme$theme$color.white,
74
74
  _useTheme$theme$messa = _useTheme$theme.messageList.scrollToBottomButton,
75
+ chevronColor = _useTheme$theme$messa.chevronColor,
75
76
  container = _useTheme$theme$messa.container,
76
77
  touchable = _useTheme$theme$messa.touchable,
77
78
  unreadCountNotificationContainer = _useTheme$theme$messa.unreadCountNotificationContainer,
@@ -86,7 +87,7 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
86
87
  __self: _this,
87
88
  __source: {
88
89
  fileName: _jsxFileName,
89
- lineNumber: 79,
90
+ lineNumber: 80,
90
91
  columnNumber: 5
91
92
  }
92
93
  }, _react["default"].createElement(_reactNative.View, {
@@ -94,7 +95,7 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
94
95
  __self: _this,
95
96
  __source: {
96
97
  fileName: _jsxFileName,
97
- lineNumber: 84,
98
+ lineNumber: 85,
98
99
  columnNumber: 7
99
100
  }
100
101
  }, _react["default"].createElement(_reactNative.View, {
@@ -105,14 +106,15 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
105
106
  __self: _this,
106
107
  __source: {
107
108
  fileName: _jsxFileName,
108
- lineNumber: 85,
109
+ lineNumber: 86,
109
110
  columnNumber: 9
110
111
  }
111
112
  }, _react["default"].createElement(_icons.Down, {
113
+ pathFill: chevronColor ? chevronColor : black,
112
114
  __self: _this,
113
115
  __source: {
114
116
  fileName: _jsxFileName,
115
- lineNumber: 86,
117
+ lineNumber: 87,
116
118
  columnNumber: 11
117
119
  }
118
120
  })), !!unreadCount && _react["default"].createElement(_reactNative.View, {
@@ -122,7 +124,7 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
122
124
  __self: _this,
123
125
  __source: {
124
126
  fileName: _jsxFileName,
125
- lineNumber: 89,
127
+ lineNumber: 90,
126
128
  columnNumber: 11
127
129
  }
128
130
  }, _react["default"].createElement(_reactNative.Text, {
@@ -133,7 +135,7 @@ var ScrollToBottomButton = function ScrollToBottomButton(props) {
133
135
  __self: _this,
134
136
  __source: {
135
137
  fileName: _jsxFileName,
136
- lineNumber: 96,
138
+ lineNumber: 97,
137
139
  columnNumber: 13
138
140
  }
139
141
  }, unreadCount))));
@@ -1 +1 @@
1
- {"version":3,"sources":["ScrollToBottomButton.tsx"],"names":["styles","StyleSheet","create","container","alignItems","borderRadius","elevation","height","justifyContent","shadowOffset","width","shadowOpacity","shadowRadius","touchable","bottom","position","right","unreadCountNotificationContainer","minWidth","paddingHorizontal","top","unreadCountNotificationText","fontSize","textAlign","textAlignVertical","wrapper","ScrollToBottomButton","props","onPress","showNotification","unreadCount","theme","colors","accent_blue","black","white","messageList","scrollToBottomButton","backgroundColor","shadowColor","color","displayName"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,YAAY,EAAE,EAFL;AAGTC,IAAAA,SAAS,EAAE,CAHF;AAITC,IAAAA,MAAM,EAAE,EAJC;AAKTC,IAAAA,cAAc,EAAE,QALP;AAMTC,IAAAA,YAAY,EAAE;AACZF,MAAA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CACLjB,MAAM,CAACqB,2BADF,EAEL;AAAEmB,MAAAA,KAAK,EAAEL;AAAT,KAFK,EAGLd,2BAHK,CADT;AAME,IAAA,MAAM,EAAC,cANT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQGS,WARH,CAPF,CALJ,CALF,CADF;AAiCD,CArDM;;;AAuDPJ,oBAAoB,CAACe,WAArB,GAAmC,yDAAnC","sourcesContent":["import React from 'react';\nimport { GestureResponderEvent, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Down } from '../../icons';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n borderRadius: 20,\n elevation: 5,\n height: 40,\n justifyContent: 'center',\n shadowOffset: {\n height: 2,\n width: 0,\n },\n shadowOpacity: 0.25,\n shadowRadius: 4,\n width: 40,\n },\n touchable: {\n bottom: 20,\n position: 'absolute',\n right: 20,\n },\n unreadCountNotificationContainer: {\n alignItems: 'center',\n borderRadius: 10,\n elevation: 6,\n height: 20,\n justifyContent: 'center',\n minWidth: 20,\n paddingHorizontal: 4,\n position: 'absolute',\n top: 0,\n },\n unreadCountNotificationText: {\n fontSize: 11,\n textAlign: 'center',\n textAlignVertical: 'center',\n },\n wrapper: {\n alignItems: 'center',\n height: 50,\n justifyContent: 'flex-end',\n },\n});\n\nexport type ScrollToBottomButtonProps = {\n /** onPress handler */\n onPress: (event: GestureResponderEvent) => void;\n /** If we should show the notification or not */\n showNotification?: boolean;\n unreadCount?: number;\n};\n\nexport const ScrollToBottomButton: React.FC<ScrollToBottomButtonProps> = (props) => {\n const { onPress, showNotification = true, unreadCount } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, white },\n messageList: {\n scrollToBottomButton: {\n container,\n touchable,\n unreadCountNotificationContainer,\n unreadCountNotificationText,\n wrapper,\n },\n },\n },\n } = useTheme();\n\n if (!showNotification) return null;\n\n return (\n <TouchableOpacity\n onPress={onPress}\n style={[styles.touchable, touchable]}\n testID='message-notification'\n >\n <View style={[styles.wrapper, wrapper]}>\n <View style={[styles.container, { backgroundColor: white, shadowColor: black }, container]}>\n <Down />\n </View>\n {!!unreadCount && (\n <View\n style={[\n styles.unreadCountNotificationContainer,\n { backgroundColor: accent_blue },\n unreadCountNotificationContainer,\n ]}\n >\n <Text\n style={[\n styles.unreadCountNotificationText,\n { color: white },\n unreadCountNotificationText,\n ]}\n testID='unread-count'\n >\n {unreadCount}\n </Text>\n </View>\n )}\n </View>\n </TouchableOpacity>\n );\n};\n\nScrollToBottomButton.displayName = 'ScrollToBottomButton{messageList{scrollToBottomButton}}';\n"]}
1
+ {"version":3,"sources":["ScrollToBottomButton.tsx"],"names":["styles","StyleSheet","create","container","alignItems","borderRadius","elevation","height","justifyContent","shadowOffset","width","shadowOpacity","shadowRadius","touchable","bottom","position","right","unreadCountNotificationContainer","minWidth","paddingHorizontal","top","unreadCountNotificationText","fontSize","textAlign","textAlignVertical","wrapper","ScrollToBottomButton","props","onPress","showNotification","unreadCount","theme","colors","accent_blue","black","white","messageList","scrollToBottomButton","chevronColor","backgroundColor","shadowColor","color","displayName"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,YAAY,EAAE,EAFL;AAGTC,IAAAA,SAAS,EAAE,CAHF;AAITC,IAAAA,MAAM,EAAE,EAJC;AAKTC,IAAAA,cAAc,EAAE,QALP;AAMTC,IAAAA,YAAY,EAAE;AACZF,MAAAA,MAAM,EAAE,CADI;AAEZG,MAAAA,KAAK,EAAE;AAFK,KANL;AAUTC,IAAAA,aAAa,EAAE,IAVN;AAWTC,IAAAA,YAAY,EAAE,CAXL;AAYTF,IAAAA,KAAK,EAAE;AAZE,GADoB;AAe/BG,EAAAA,SAAS,EAAE;AACTC,IAAAA,MAAM,EAAE,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,cANT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQGS,WARH,CAPF,CALJ,CALF,CADF;AAiCD,CAtDM;;;AAwDPJ,oBAAoB,CAACgB,WAArB,GAAmC,yDAAnC","sourcesContent":["import React from 'react';\nimport { GestureResponderEvent, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Down } from '../../icons';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n borderRadius: 20,\n elevation: 5,\n height: 40,\n justifyContent: 'center',\n shadowOffset: {\n height: 2,\n width: 0,\n },\n shadowOpacity: 0.25,\n shadowRadius: 4,\n width: 40,\n },\n touchable: {\n bottom: 20,\n position: 'absolute',\n right: 20,\n },\n unreadCountNotificationContainer: {\n alignItems: 'center',\n borderRadius: 10,\n elevation: 6,\n height: 20,\n justifyContent: 'center',\n minWidth: 20,\n paddingHorizontal: 4,\n position: 'absolute',\n top: 0,\n },\n unreadCountNotificationText: {\n fontSize: 11,\n textAlign: 'center',\n textAlignVertical: 'center',\n },\n wrapper: {\n alignItems: 'center',\n height: 50,\n justifyContent: 'flex-end',\n },\n});\n\nexport type ScrollToBottomButtonProps = {\n /** onPress handler */\n onPress: (event: GestureResponderEvent) => void;\n /** If we should show the notification or not */\n showNotification?: boolean;\n unreadCount?: number;\n};\n\nexport const ScrollToBottomButton: React.FC<ScrollToBottomButtonProps> = (props) => {\n const { onPress, showNotification = true, unreadCount } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, white },\n messageList: {\n scrollToBottomButton: {\n chevronColor,\n container,\n touchable,\n unreadCountNotificationContainer,\n unreadCountNotificationText,\n wrapper,\n },\n },\n },\n } = useTheme();\n\n if (!showNotification) return null;\n\n return (\n <TouchableOpacity\n onPress={onPress}\n style={[styles.touchable, touchable]}\n testID='message-notification'\n >\n <View style={[styles.wrapper, wrapper]}>\n <View style={[styles.container, { backgroundColor: white, shadowColor: black }, container]}>\n <Down pathFill={chevronColor ? chevronColor : black} />\n </View>\n {!!unreadCount && (\n <View\n style={[\n styles.unreadCountNotificationContainer,\n { backgroundColor: accent_blue },\n unreadCountNotificationContainer,\n ]}\n >\n <Text\n style={[\n styles.unreadCountNotificationText,\n { color: white },\n unreadCountNotificationText,\n ]}\n testID='unread-count'\n >\n {unreadCount}\n </Text>\n </View>\n )}\n </View>\n </TouchableOpacity>\n );\n};\n\nScrollToBottomButton.displayName = 'ScrollToBottomButton{messageList{scrollToBottomButton}}';\n"]}
@@ -32,7 +32,7 @@ var ChatProvider = function ChatProvider(_ref) {
32
32
  __self: _this,
33
33
  __source: {
34
34
  fileName: _jsxFileName,
35
- lineNumber: 67,
35
+ lineNumber: 71,
36
36
  columnNumber: 3
37
37
  }
38
38
  }, children);
@@ -53,7 +53,7 @@ var withChatContext = function withChatContext(Component) {
53
53
  __self: _this,
54
54
  __source: {
55
55
  fileName: _jsxFileName,
56
- lineNumber: 90,
56
+ lineNumber: 94,
57
57
  columnNumber: 12
58
58
  }
59
59
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","ChatProvider","children","value","useChatContext","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAKA;;;;;;;;;AAmDO,IAAMA,WAAW,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAApB;;;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe;AAAA,MAG1BC,QAH0B,QAG1BA,QAH0B;AAAA,MAI1BC,KAJ0B,QAI1BA,KAJ0B;AAAA,SAQ1B,gCAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEA,KAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR0B;AAAA,CAArB;;;;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAiB;AAAA,SAEvB,uBAAWN,WAAX,CAFuB;AAAA,CAAvB;;;;AASA,IAAMO,eAAe,GAAG,SAAlBA,eAAkB,CAI7BC,SAJ6B,EAKqC;AAClE,MAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,KAAD,EAAgE;AAC/F,QAAMC,WAAW,GAAGL,cAAc,EAAlC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,WAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAJD;;AAKAF,EAAAA,wBAAwB,CAACG,WAAzB,uBAAyD,oCAAeJ,SAAf,CAAzD;AACA,SAAOC,wBAAP;AACD,CAbM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n isOnline: boolean;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext({} as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"]}
1
+ {"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","ChatProvider","children","value","useChatContext","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAKA;;;;;;;;;AAuDO,IAAMA,WAAW,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAApB;;;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe;AAAA,MAG1BC,QAH0B,QAG1BA,QAH0B;AAAA,MAI1BC,KAJ0B,QAI1BA,KAJ0B;AAAA,SAQ1B,gCAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEA,KAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR0B;AAAA,CAArB;;;;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAiB;AAAA,SAEvB,uBAAWN,WAAX,CAFuB;AAAA,CAAvB;;;;AASA,IAAMO,eAAe,GAAG,SAAlBA,eAAkB,CAI7BC,SAJ6B,EAKqC;AAClE,MAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,KAAD,EAAgE;AAC/F,QAAMC,WAAW,GAAGL,cAAc,EAAlC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,WAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAJD;;AAKAF,EAAAA,wBAAwB,CAACG,WAAzB,uBAAyD,oCAAeJ,SAAf,CAAzD;AACA,SAAOC,wBAAP;AACD,CAbM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n isOnline: boolean;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext({} as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"]}
@@ -32,7 +32,7 @@ var MessageProvider = function MessageProvider(_ref) {
32
32
  __self: _this,
33
33
  __source: {
34
34
  fileName: _jsxFileName,
35
- lineNumber: 110,
35
+ lineNumber: 113,
36
36
  columnNumber: 3
37
37
  }
38
38
  }, children);
@@ -53,7 +53,7 @@ var withMessageContext = function withMessageContext(Component) {
53
53
  __self: _this,
54
54
  __source: {
55
55
  fileName: _jsxFileName,
56
- lineNumber: 135,
56
+ lineNumber: 138,
57
57
  columnNumber: 12
58
58
  }
59
59
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","MessageProvider","children","value","useMessageContext","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAUA;;;;;;;;;AAyFO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAvB;;;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAG7BC,QAH6B,QAG7BA,QAH6B;AAAA,MAI7BC,KAJ6B,QAI7BA,KAJ6B;AAAA,SAQ7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR6B;AAAA,CAAxB;;;;AAaA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAE1B,uBAAWN,cAAX,CAF0B;AAAA,CAA1B;;;;AASA,IAAMO,kBAAkB,GAAG,SAArBA,kBAAqB,CAIhCC,SAJgC,EAKqC;AACrE,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGL,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type { ActionHandler } from '../../components/Attachment/Attachment';\nimport type { TouchableHandlerPayload } from '../../components/Message/Message';\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';\nimport type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type Alignment = 'right' | 'left';\n\nexport type Reactions = {\n own: boolean;\n type: string;\n}[];\n\nexport type MessageContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /** Whether or not actions can be performed on message */\n actionsEnabled: boolean;\n /** Position of the message, either 'right' or 'left' */\n alignment: Alignment;\n /** The files attached to a message */\n files: Attachment<StreamChatGenerics>[];\n /**\n * Position of message in group - top, bottom, middle, single.\n *\n * Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group\n * e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.\n */\n groupStyles: GroupType[];\n /** Handler for actions. Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands). */\n handleAction: ActionHandler;\n handleDeleteMessage: () => Promise<void>;\n handleEditMessage: () => void;\n handleQuotedReplyMessage: () => void;\n handleResendMessage: () => Promise<void>;\n handleToggleBanUser: () => Promise<void>;\n handleToggleMuteUser: () => Promise<void>;\n handleToggleReaction: (reactionType: string) => Promise<void>;\n /** Whether or not message has reactions */\n hasReactions: boolean;\n /** The images attached to a message */\n images: Attachment<StreamChatGenerics>[];\n /** Whether or not this is the active user's message */\n isMyMessage: boolean;\n /** Whether or not this is the last message in a group of messages */\n lastGroupMessage: boolean;\n /** Current [message object](https://getstream.io/chat/docs/#message_format) */\n message: MessageType<StreamChatGenerics>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)\n *\n * By default, we show the overlay with all the message actions on long press.\n *\n * @param event Event object for onLongPress event\n */\n onLongPress: (payload: TouchableHandlerPayload) => void;\n /** Whether the message is only text and the text is only emojis */\n onlyEmojis: boolean;\n /** Handler to open a thread on a message */\n onOpenThread: () => void;\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)\n *\n * By default, we will dismiss the keyboard on press.\n *\n * @param event Event object for onPress event\n */\n onPress: (payload: TouchableHandlerPayload) => void;\n onPressIn: ((payload: TouchableHandlerPayload) => void) | null;\n /** The images attached to a message */\n otherAttachments: Attachment<StreamChatGenerics>[];\n reactions: Reactions;\n showMessageOverlay: (messageReactions?: boolean) => void;\n showMessageStatus: boolean;\n /** Whether or not the Message is part of a Thread */\n threadList: boolean;\n goToMessage?: (messageId: string) => void;\n /** Latest message id on current channel */\n lastReceivedId?: string;\n /** Prevent message being pressed for image viewer view */\n preventPress?: boolean;\n /** Whether or not the avatar show show next to Message */\n showAvatar?: boolean;\n} & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'members'>;\n\nexport const MessageContext = React.createContext({} as MessageContextValue);\n\nexport const MessageProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageContextValue<StreamChatGenerics>;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(MessageContext) as unknown as MessageContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if MessageContext\n * typing is desired while using the HOC withMessageContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageContextValue<StreamChatGenerics>>> => {\n const WithMessageContextComponent = (\n props: Omit<P, keyof MessageContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageContextComponent.displayName = `WithMessageContext${getDisplayName(Component)}`;\n return WithMessageContextComponent;\n};\n"]}
1
+ {"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","MessageProvider","children","value","useMessageContext","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAaA;;;;;;;;;AAyFO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAvB;;;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAG7BC,QAH6B,QAG7BA,QAH6B;AAAA,MAI7BC,KAJ6B,QAI7BA,KAJ6B;AAAA,SAQ7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR6B;AAAA,CAAxB;;;;AAaA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAE1B,uBAAWN,cAAX,CAF0B;AAAA,CAA1B;;;;AASA,IAAMO,kBAAkB,GAAG,SAArBA,kBAAqB,CAIhCC,SAJgC,EAKqC;AACrE,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGL,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type { ActionHandler } from '../../components/Attachment/Attachment';\nimport type {\n MessageTouchableHandlerPayload,\n TouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';\nimport type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type Alignment = 'right' | 'left';\n\nexport type Reactions = {\n own: boolean;\n type: string;\n}[];\n\nexport type MessageContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /** Whether or not actions can be performed on message */\n actionsEnabled: boolean;\n /** Position of the message, either 'right' or 'left' */\n alignment: Alignment;\n /** The files attached to a message */\n files: Attachment<StreamChatGenerics>[];\n /**\n * Position of message in group - top, bottom, middle, single.\n *\n * Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group\n * e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.\n */\n groupStyles: GroupType[];\n /** Handler for actions. Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands). */\n handleAction: ActionHandler;\n handleDeleteMessage: () => Promise<void>;\n handleEditMessage: () => void;\n handleQuotedReplyMessage: () => void;\n handleResendMessage: () => Promise<void>;\n handleToggleBanUser: () => Promise<void>;\n handleToggleMuteUser: () => Promise<void>;\n handleToggleReaction: (reactionType: string) => Promise<void>;\n /** Whether or not message has reactions */\n hasReactions: boolean;\n /** The images attached to a message */\n images: Attachment<StreamChatGenerics>[];\n /** Whether or not this is the active user's message */\n isMyMessage: boolean;\n /** Whether or not this is the last message in a group of messages */\n lastGroupMessage: boolean;\n /** Current [message object](https://getstream.io/chat/docs/#message_format) */\n message: MessageType<StreamChatGenerics>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)\n *\n * By default, we show the overlay with all the message actions on long press.\n *\n * @param payload Payload object for onLongPress event\n */\n onLongPress: (payload: TouchableHandlerPayload) => void;\n /** Whether the message is only text and the text is only emojis */\n onlyEmojis: boolean;\n /** Handler to open a thread on a message */\n onOpenThread: () => void;\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)\n *\n * By default, we will dismiss the keyboard on press.\n *\n * @param payload Payload object for onPress event\n */\n onPress: (payload: MessageTouchableHandlerPayload) => void;\n onPressIn: ((payload: TouchableHandlerPayload) => void) | null;\n /** The images attached to a message */\n otherAttachments: Attachment<StreamChatGenerics>[];\n reactions: Reactions;\n showMessageOverlay: (messageReactions?: boolean) => void;\n showMessageStatus: boolean;\n /** Whether or not the Message is part of a Thread */\n threadList: boolean;\n goToMessage?: (messageId: string) => void;\n /** Latest message id on current channel */\n lastReceivedId?: string;\n /** Prevent message being pressed for image viewer view */\n preventPress?: boolean;\n /** Whether or not the avatar show show next to Message */\n showAvatar?: boolean;\n} & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'members'>;\n\nexport const MessageContext = React.createContext({} as MessageContextValue);\n\nexport const MessageProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageContextValue<StreamChatGenerics>;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(MessageContext) as unknown as MessageContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if MessageContext\n * typing is desired while using the HOC withMessageContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageContextValue<StreamChatGenerics>>> => {\n const WithMessageContextComponent = (\n props: Omit<P, keyof MessageContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageContextComponent.displayName = `WithMessageContext${getDisplayName(Component)}`;\n return WithMessageContextComponent;\n};\n"]}